nodality 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/README.md +15 -15
  2. package/bin/mcp-server.mjs +17 -4
  3. package/dist/animator.cjs.js.LICENSE.txt +1 -1
  4. package/dist/animator.esm.js.LICENSE.txt +1 -1
  5. package/dist/audionew.cjs.js.LICENSE.txt +1 -1
  6. package/dist/audionew.esm.js.LICENSE.txt +1 -1
  7. package/dist/base.cjs.js.LICENSE.txt +1 -1
  8. package/dist/base.esm.js.LICENSE.txt +1 -1
  9. package/dist/beta-desktop-bar.cjs.js.LICENSE.txt +1 -1
  10. package/dist/beta-desktop-bar.esm.js.LICENSE.txt +1 -1
  11. package/dist/beta-mobile-bar.cjs.js.LICENSE.txt +1 -1
  12. package/dist/beta-mobile-bar.esm.js.LICENSE.txt +1 -1
  13. package/dist/bundle.umd.js.LICENSE.txt +1 -1
  14. package/dist/button.cjs.js.LICENSE.txt +1 -1
  15. package/dist/button.esm.js.LICENSE.txt +1 -1
  16. package/dist/card-getter.cjs.js.LICENSE.txt +1 -1
  17. package/dist/card-getter.esm.js.LICENSE.txt +1 -1
  18. package/dist/center.cjs.js.LICENSE.txt +1 -1
  19. package/dist/center.esm.js.LICENSE.txt +1 -1
  20. package/dist/checkbox.cjs.js.LICENSE.txt +1 -1
  21. package/dist/checkbox.esm.js.LICENSE.txt +1 -1
  22. package/dist/code.cjs.js.LICENSE.txt +1 -1
  23. package/dist/code.esm.js.LICENSE.txt +1 -1
  24. package/dist/container.cjs.js.LICENSE.txt +1 -1
  25. package/dist/container.esm.js.LICENSE.txt +1 -1
  26. package/dist/data-list.cjs.js.LICENSE.txt +1 -1
  27. package/dist/data-list.esm.js.LICENSE.txt +1 -1
  28. package/dist/designer.cjs.js.LICENSE.txt +1 -1
  29. package/dist/designer.esm.js.LICENSE.txt +1 -1
  30. package/dist/element-mapper.cjs.js +1 -1
  31. package/dist/element-mapper.cjs.js.LICENSE.txt +1 -1
  32. package/dist/element-mapper.esm.js +1 -1
  33. package/dist/element-mapper.esm.js.LICENSE.txt +1 -1
  34. package/dist/finalresult.esm.js.LICENSE.txt +1 -1
  35. package/dist/flex-card.cjs.js.LICENSE.txt +1 -1
  36. package/dist/flex-card.esm.js.LICENSE.txt +1 -1
  37. package/dist/flex-grid.cjs.js.LICENSE.txt +1 -1
  38. package/dist/flex-grid.esm.js.LICENSE.txt +1 -1
  39. package/dist/flex-row.cjs.js.LICENSE.txt +1 -1
  40. package/dist/flex-row.esm.js.LICENSE.txt +1 -1
  41. package/dist/floating-input.cjs.js.LICENSE.txt +1 -1
  42. package/dist/floating-input.esm.js.LICENSE.txt +1 -1
  43. package/dist/free.cjs.js.LICENSE.txt +1 -1
  44. package/dist/free.esm.js.LICENSE.txt +1 -1
  45. package/dist/horizontal-scroller.cjs.js.LICENSE.txt +1 -1
  46. package/dist/horizontal-scroller.esm.js.LICENSE.txt +1 -1
  47. package/dist/image-picker.cjs.js.LICENSE.txt +1 -1
  48. package/dist/image-picker.esm.js.LICENSE.txt +1 -1
  49. package/dist/image.cjs.js.LICENSE.txt +1 -1
  50. package/dist/image.esm.js.LICENSE.txt +1 -1
  51. package/dist/index.cjs.js.LICENSE.txt +1 -1
  52. package/dist/index.d.ts +1 -1
  53. package/dist/index.esm.js.LICENSE.txt +1 -1
  54. package/dist/keyframe-animation.cjs.js.LICENSE.txt +1 -1
  55. package/dist/keyframe-animation.esm.js.LICENSE.txt +1 -1
  56. package/dist/link-getter.cjs.js.LICENSE.txt +1 -1
  57. package/dist/link-getter.esm.js.LICENSE.txt +1 -1
  58. package/dist/link.cjs.js.LICENSE.txt +1 -1
  59. package/dist/link.esm.js.LICENSE.txt +1 -1
  60. package/dist/meta-adder.cjs.js.LICENSE.txt +1 -1
  61. package/dist/meta-adder.esm.js.LICENSE.txt +1 -1
  62. package/dist/modal-2025.cjs.js.LICENSE.txt +1 -1
  63. package/dist/modal-2025.esm.js.LICENSE.txt +1 -1
  64. package/dist/multiswitcher.cjs.js.LICENSE.txt +1 -1
  65. package/dist/multiswitcher.esm.js.LICENSE.txt +1 -1
  66. package/dist/new-nav-bar.cjs.js.LICENSE.txt +1 -1
  67. package/dist/new-nav-bar.esm.js.LICENSE.txt +1 -1
  68. package/dist/picker.cjs.js.LICENSE.txt +1 -1
  69. package/dist/picker.esm.js.LICENSE.txt +1 -1
  70. package/dist/progress.cjs.js.LICENSE.txt +1 -1
  71. package/dist/progress.esm.js.LICENSE.txt +1 -1
  72. package/dist/radio.cjs.js.LICENSE.txt +1 -1
  73. package/dist/radio.esm.js.LICENSE.txt +1 -1
  74. package/dist/range.cjs.js.LICENSE.txt +1 -1
  75. package/dist/range.esm.js.LICENSE.txt +1 -1
  76. package/dist/scroll-video.cjs.js.LICENSE.txt +1 -1
  77. package/dist/scroll-video.esm.js.LICENSE.txt +1 -1
  78. package/dist/side-bar.cjs.js.LICENSE.txt +1 -1
  79. package/dist/side-bar.esm.js.LICENSE.txt +1 -1
  80. package/dist/side-nav-bar.cjs.js.LICENSE.txt +1 -1
  81. package/dist/side-nav-bar.esm.js.LICENSE.txt +1 -1
  82. package/dist/simple-bar.cjs.js.LICENSE.txt +1 -1
  83. package/dist/simple-bar.esm.js.LICENSE.txt +1 -1
  84. package/dist/slider-2025.cjs.js.LICENSE.txt +1 -1
  85. package/dist/slider-2025.esm.js.LICENSE.txt +1 -1
  86. package/dist/spacer.cjs.js.LICENSE.txt +1 -1
  87. package/dist/spacer.esm.js.LICENSE.txt +1 -1
  88. package/dist/stack.cjs.js.LICENSE.txt +1 -1
  89. package/dist/stack.esm.js.LICENSE.txt +1 -1
  90. package/dist/stacker.cjs.js.LICENSE.txt +1 -1
  91. package/dist/stacker.esm.js.LICENSE.txt +1 -1
  92. package/dist/table.cjs.js.LICENSE.txt +1 -1
  93. package/dist/table.esm.js.LICENSE.txt +1 -1
  94. package/dist/text-field.cjs.js.LICENSE.txt +1 -1
  95. package/dist/text-field.esm.js.LICENSE.txt +1 -1
  96. package/dist/text.cjs.js.LICENSE.txt +1 -1
  97. package/dist/text.esm.js.LICENSE.txt +1 -1
  98. package/dist/theme.cjs.js.LICENSE.txt +1 -1
  99. package/dist/theme.esm.js.LICENSE.txt +1 -1
  100. package/dist/transform-anim.cjs.js.LICENSE.txt +1 -1
  101. package/dist/transform-anim.esm.js.LICENSE.txt +1 -1
  102. package/dist/ulist.cjs.js.LICENSE.txt +1 -1
  103. package/dist/ulist.esm.js.LICENSE.txt +1 -1
  104. package/dist/video.cjs.js.LICENSE.txt +1 -1
  105. package/dist/video.esm.js.LICENSE.txt +1 -1
  106. package/dist/wrap.cjs.js.LICENSE.txt +1 -1
  107. package/dist/wrap.esm.js.LICENSE.txt +1 -1
  108. package/dist/zoom-card.cjs.js.LICENSE.txt +1 -1
  109. package/dist/zoom-card.esm.js.LICENSE.txt +1 -1
  110. package/layout/animator.js +1 -1
  111. package/layout/audio.js +1 -1
  112. package/layout/audionew.js +1 -1
  113. package/layout/base.js +1 -1
  114. package/layout/beta-desktop-bar.js +1 -1
  115. package/layout/beta-mobile-bar.js +1 -1
  116. package/layout/button.js +1 -1
  117. package/layout/center.js +1 -1
  118. package/layout/checkbox.js +1 -1
  119. package/layout/circle.js +1 -1
  120. package/layout/code.js +1 -1
  121. package/layout/container.js +1 -1
  122. package/layout/dropdown-2025.js +1 -1
  123. package/layout/flex-card.js +1 -1
  124. package/layout/flex-grid.js +1 -1
  125. package/layout/flex-row.js +1 -1
  126. package/layout/form-components/custom.js +1 -1
  127. package/layout/form-components/data-list.js +1 -1
  128. package/layout/form-components/floating-input.js +1 -1
  129. package/layout/form-components/form-all.js +1 -1
  130. package/layout/form-components/form.js +1 -1
  131. package/layout/form-components/image-picker.js +1 -1
  132. package/layout/form-components/picker.js +1 -1
  133. package/layout/form-components/radio.js +1 -1
  134. package/layout/form-components/radiogroup.js +1 -1
  135. package/layout/form-components/range.js +1 -1
  136. package/layout/free.js +1 -1
  137. package/layout/grid-switcher.js +1 -1
  138. package/layout/grid.js +1 -1
  139. package/layout/horizontal-scroller.js +1 -1
  140. package/layout/image.js +1 -1
  141. package/layout/index.js +1 -1
  142. package/layout/link.js +1 -1
  143. package/layout/list.js +1 -1
  144. package/layout/meta-adder.js +1 -1
  145. package/layout/modal-2025.js +1 -1
  146. package/layout/morph.js +1 -1
  147. package/layout/multiswitcher.js +1 -1
  148. package/layout/nav-bar.js +1 -1
  149. package/layout/nav-factor/custom-div.js +1 -1
  150. package/layout/new-nav-bar.js +1 -1
  151. package/layout/polygon.js +1 -1
  152. package/layout/prerender-site.js +1 -1
  153. package/layout/prerender.js +1 -1
  154. package/layout/progress.js +1 -1
  155. package/layout/row.js +1 -1
  156. package/layout/scroll-video.js +1 -1
  157. package/layout/side-bar.js +1 -1
  158. package/layout/side-nav-bar.js +1 -1
  159. package/layout/simple-bar.js +1 -1
  160. package/layout/slider-2025.js +1 -1
  161. package/layout/spacer.js +1 -1
  162. package/layout/stack.js +1 -1
  163. package/layout/svg.js +1 -1
  164. package/layout/switcher.js +1 -1
  165. package/layout/table.js +1 -1
  166. package/layout/text-field.js +1 -1
  167. package/layout/text.js +1 -1
  168. package/layout/ulist.js +1 -1
  169. package/layout/video.js +1 -1
  170. package/layout/wrap.js +1 -1
  171. package/layout/zoom-card.js +1 -1
  172. package/lib/agent-surface.js +1 -1
  173. package/lib/card-getter.js +1 -1
  174. package/lib/codegen.js +1 -1
  175. package/lib/data.js +1 -1
  176. package/lib/designer.js +1 -1
  177. package/lib/element-mapper.js +7 -2
  178. package/lib/keyframe-animation.js +1 -1
  179. package/lib/link-getter.js +1 -1
  180. package/lib/morph-node.js +1 -1
  181. package/lib/raster-inspect.js +1 -1
  182. package/lib/raster-ops.js +1 -1
  183. package/lib/raster-presets.js +1 -1
  184. package/lib/scroll-video.js +1 -1
  185. package/lib/seo.js +1 -1
  186. package/lib/stacker.js +1 -1
  187. package/lib/suggest.js +1 -1
  188. package/lib/theme.js +1 -1
  189. package/lib/transform-anim.js +1 -1
  190. package/lib/transition.js +1 -1
  191. package/lib/validate-nodes.js +75 -4
  192. package/lib/webmcp-adapter.js +1 -1
  193. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see element-mapper.cjs.js.LICENSE.txt */
2
- (()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},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 n(t){return n="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},n(t)}t.r(e),t.d(e,{ElementMapper:()=>Ho});var r="nodality.theme.mode",o="nodality:theme",i={mode:function(){try{var t=localStorage.getItem(r);if("light"===t||"dark"===t)return t}catch(t){}return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}(),tokens:{light:{},dark:{}},defaults:{light:{color:"#111"},dark:{}},setDefaults:function(t){return t&&"object"===n(t)&&(t.light&&(this.defaults.light=Object.assign({},this.defaults.light,t.light)),t.dark&&(this.defaults.dark=Object.assign({},this.defaults.dark,t.dark)),this._broadcast()),this},setTokens:function(t){return t&&"object"===n(t)&&(t.light&&Object.assign(this.tokens.light,t.light),t.dark&&Object.assign(this.tokens.dark,t.dark)),this},get current(){return this.tokens[this.mode]||{}},set:function(t){if("light"!==t&&"dark"!==t)return this;if(t===this.mode)return this;this.mode=t;try{localStorage.setItem(r,t)}catch(t){}return this._broadcast(),this},toggle:function(){return this.set("dark"===this.mode?"light":"dark")},subscribe:function(t){if("undefined"==typeof document)return function(){};var e=function(e){return t(e.detail.mode,e.detail.tokens)};document.addEventListener(o,e);try{t(this.mode,this.current)}catch(t){}return function(){return document.removeEventListener(o,e)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(o,{detail:{mode:this.mode,tokens:this.current}}))}};function a(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}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 l(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=u(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||u(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 u(t,e){if(t){if("string"==typeof t)return f(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var d={static:function(t){return{x:.5*t.w,y:.5*t.h,amt:1}},mouse:function(t){return{x:t.mouseX,y:t.mouseY,amt:1}},hover:function(t){return{x:t.mouseX,y:t.mouseY,amt:t.hover}},scroll:function(t){return{x:.5*t.w,y:t.h*t.scroll,amt:1}},time:function(t){return{x:t.w*(.5+.34*Math.cos(.6*t.t)),y:t.h*(.5+.34*Math.sin(.8*t.t)),amt:1}}},h=Object.keys(d),p={hexalize:{doc:{summary:"Hexagonal cell grid. Snaps sampling to a hex lattice and draws cell borders; with `lift`, cells near the driver swell toward the viewer and their content magnifies to match.",params:{size:{default:24,unit:"px",summary:"lattice pitch — the width of one cell"},lift:{default:0,unit:"ratio",structural:!0,summary:"how much bigger a cell gets at the focus: 0.3 renders the nearest hexagons at 1.3x. 0 compiles the cheap path entirely away, so crossing zero rebuilds."},radius:{default:200,unit:"px",summary:"falloff distance around the driver focus"}}},structuralOnToggle:["lift"],stage:"cell",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"lift;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return e.lift?"\n {\n vec2 hp = warped / ".concat(t,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n vec2 ").concat(t,"AX = normalize(vec2(1.0, 1.7320508));\n vec2 ").concat(t,"c0 = hp - gv;\n // Seed with the owning cell. Its own hexagon always covers the\n // fragment at any scale >= 1, so there is always a winner.\n vec2 ").concat(t,"bestC = ").concat(t,"c0;\n float ").concat(t,"bestF = (1.0 - smoothstep(0.0, ").concat(t,"radius,\n length(").concat(t,"c0 * ").concat(t,"size - ").concat(t,"dpos))) * ").concat(t,"damt;\n float ").concat(t,"bestS = 1.0 + ").concat(t,"lift * ").concat(t,"bestF;\n").concat([[1,0],[-1,0],[.5,.8660254],[-.5,.8660254],[.5,-.8660254],[-.5,-.8660254]].map(function(e){var n,r,o=c(e,2);return n=o[0],r=o[1],"\n {\n vec2 c = ".concat(t,"c0 + vec2(").concat(n.toFixed(7),", ").concat(r.toFixed(7),");\n float f = 1.0 - smoothstep(0.0, ").concat(t,"radius,\n length(c * ").concat(t,"size - ").concat(t,"dpos));\n f *= ").concat(t,"damt;\n float s = 1.0 + ").concat(t,"lift * f;\n vec2 q = hp - c;\n float hd = max(dot(abs(q), ").concat(t,"AX), abs(q).x);\n // Covered by this cell's grown hexagon, and nearer than\n // whatever we have so far.\n if (hd <= 0.5 * s && s > ").concat(t,"bestS) {\n ").concat(t,"bestS = s; ").concat(t,"bestC = c; ").concat(t,"bestF = f;\n }\n }")}).join(""),"\n center = ").concat(t,"bestC * ").concat(t,"size;\n // Divide by the winner's scale: the border test then reaches\n // 0.5 further out (a bigger hexagon) and the sample moves in\n // toward the centre (its content magnified to match), both by\n // the same factor, so proportions are preserved exactly.\n gv = (hp - ").concat(t,"bestC) / max(").concat(t,"bestS, 1e-3);\n warped = center + gv * ").concat(t,'size;\n gv = abs(gv);\n // Border strength follows the SAME falloff as the scale, so a\n // cell that has not been raised draws no border at all. Away\n // from the pointer bestF is 0, which means scale 1, sampling\n // untouched and edge 0 — bit-identical to the source image, so\n // nothing reveals that an effect is attached until the pointer\n // arrives. Pair with by:"hover" for a fully flush resting\n // state; by:"mouse" holds amt at 1 and so keeps a permanent\n // hotspot wherever the pointer last was.\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, ').concat(t,"AX), gv.x)) * ").concat(t,"bestF);\n }"):"\n {\n vec2 hp = warped / ".concat(t,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n center = (hp - gv) * ").concat(t,"size;\n gv = abs(gv);\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, normalize(vec2(1.0, 1.7320508))), gv.x)));\n }")},uniforms:function(t,e){return{size:["1f",(t.size||24)*e],lift:["1f",null!=t.lift?t.lift:0],radius:["1f",(t.radius||200)*e]}},map:function(t,e){return e.lift?null:t}},offset:{doc:{summary:"Pushes the coordinate space away from the driver focus. Warp stage, so cell grids and borders move WITH the content instead of staying a fixed screen-space lattice.",params:{strength:{default:20,unit:"px",summary:"how far the space is pushed at full amount"},radius:{default:260,unit:"px",summary:"falloff distance around the focus"}}},stage:"warp",defaultDriver:"mouse",decl:function(t){return"uniform float ".concat(t,"strength; uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos; uniform float ").concat(t,"damt;")},code:function(t){return"\n {\n float d = length(warped - ".concat(t,"dpos);\n float fall = 1.0 - smoothstep(0.0, ").concat(t,"radius, d);\n vec2 dir = d > 0.5 ? (warped - ").concat(t,"dpos) / d : vec2(0.0);\n warped -= dir * ").concat(t,"strength * fall * ").concat(t,"damt;\n }")},uniforms:function(t,e){return{strength:["1f",(t.strength||20)*e],radius:["1f",(t.radius||260)*e]}},map:function(t,e,n){var r,o,i,a=(e.strength||20)*n.dpr,s=(e.radius||260)*n.dpr,l=t[0]-n.dpos[0],c=t[1]-n.dpos[1],u=Math.hypot(l,c),f=1-(r=s,o=u,(i=Math.min(1,Math.max(0,(o-0)/(r-0||1e-6))))*i*(3-2*i));if(!(u>.5))return t;var d=a*f*n.damt/u;return[t[0]-l*d,t[1]-c*d]}},flow:{doc:{summary:"Curl-noise current. The coordinate space drifts along a divergence-free field, so content slides as if carried by water. Divergence-free means the flow never piles up or tears.",params:{strength:{default:18,unit:"px",summary:"how far the current carries the space"},scale:{default:120,unit:"px",summary:"size of one eddy — small is turbulent, large is a slow drift"},speed:{default:.25,unit:"seconds",summary:"how fast the field evolves; 0 freezes it"},seed:{default:0,unit:"count",summary:"picks a different field of the same character"},radius:{default:320,unit:"px",summary:"falloff around the focus. Only used when `by` names a driver; without one the current covers the whole element."}}},structural:["by"],stage:"warp",decl:function(t){return"\n uniform float ".concat(t,"scale;\n uniform float ").concat(t,"strength;\n uniform float ").concat(t,"speed;\n uniform float ").concat(t,"seed;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;\n // Polynomial bit-mixing hash, deliberately NOT the usual\n // fract(sin(dot(...))). Trig-based hashes disagree across GPU\n // vendors — sin's precision at large arguments is not\n // specified — so the same seed would render a different field\n // on different hardware. This one is multiply/fract only, so\n // the field is at least stable per-device. (Determinism rule,\n // MORPH-IMPL-SPEC §2.9.5a.)\n float ").concat(t,"h(vec2 v) {\n vec3 q = fract(vec3(v.xyx) * 0.1031 + ").concat(t,"seed);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n }\n float ").concat(t,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(t,"h(i), ").concat(t,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(t,"h(i + vec2(0.0, 1.0)), ").concat(t,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }\n // The potential. Two octaves: enough structure to read as a\n // current without the cost of a full fBm.\n float ").concat(t,"psi(vec2 v) {\n return ").concat(t,"n(v) * 0.65 + ").concat(t,"n(v * 2.3 + 11.0) * 0.35;\n }")},code:function(t,e){return"\n {\n float sc = max(".concat(t,"scale, 1.0);\n vec2 drift = vec2(0.0, u_time * ").concat(t,"speed);").concat(e.by?"\n float fall = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(warped - ").concat(t,"dpos));\n float amt = ").concat(t,"strength * fall * ").concat(t,"damt;"):"\n float amt = ".concat(t,"strength;"),"\n // Three fixed Euler steps along curl(psi). Fixed count, not\n // adaptive: the step budget is a compile-time property so the\n // shader cost cannot vary with the content.\n for (int i = 0; i < 3; i++) {\n vec2 q = warped / sc + drift;\n float e = 0.35;\n float dy = ").concat(t,"psi(q + vec2(0.0, e)) - ").concat(t,"psi(q - vec2(0.0, e));\n float dx = ").concat(t,"psi(q + vec2(e, 0.0)) - ").concat(t,"psi(q - vec2(e, 0.0));\n // curl of a 2D scalar potential = (dpsi/dy, -dpsi/dx)\n warped += vec2(dy, -dx) / (2.0 * e) * amt * 0.3333;\n }\n }")},uniforms:function(t,e){return{scale:["1f",(null!=t.scale?t.scale:120)*e],strength:["1f",(null!=t.strength?t.strength:18)*e],speed:["1f",null!=t.speed?t.speed:.25],seed:["1f",null!=t.seed?t.seed:0],radius:["1f",(null!=t.radius?t.radius:320)*e]}}},duotone:{doc:{summary:"Maps luminance onto a two-colour ramp. With `by`, the mapping is confined to a spot around the driver focus and the rest of the element keeps its own colour.",params:{colors:{default:["#104B87","#E8FF00"],unit:"color",summary:"[shadow, highlight] — the two ends of the ramp"},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by"],stage:"color",decl:function(t){return"uniform vec3 ".concat(t,"a; uniform vec3 ").concat(t,"b; uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos; uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(".concat(t,"a, ").concat(t,"b, lum);\n ").concat(e.by?"float mask = (1.0 - smoothstep(".concat(t,"radius * 0.35, ").concat(t,"radius,\n length(center - ").concat(t,"dpos))) * ").concat(t,"damt;"):"float mask = 1.0;","\n col = mix(col, duo, mask);\n }")},uniforms:function(t,e){var n=t.colors||["#104B87","#E8FF00"];return{a:["3fv",y(n[0])],b:["3fv",y(n[1])],radius:["1f",(t.radius||220)*e]}}},edges:{doc:{summary:"Draws the cell borders a cell-stage op produced. On its own it shows nothing — it colours `edge`, which only hexalize (or another cell op) writes.",params:{color:{default:"#FFFFFF",unit:"color",summary:"border colour"},strength:{default:1,unit:"ratio",summary:"border opacity"}}},stage:"color",decl:function(t){return"uniform vec3 ".concat(t,"color; uniform float ").concat(t,"strength;")},code:function(t){return"\n {\n edgeCol = ".concat(t,"color;\n edgeCov = max(edgeCov, edge * ").concat(t,"strength);\n }")},uniforms:function(t){return{color:["3fv",y(t.color||"#FFFFFF")],strength:["1f",null!=t.strength?t.strength:1]}}},halftone:{doc:{summary:"Print halftone: the image is redrawn as a grid of ink dots on paper, dot size following local luminance.",params:{size:{default:6,unit:"px",summary:"dot pitch"},angle:{default:15,unit:"deg",summary:"screen angle of the dot grid"},ink:{default:"#0B1B2B",unit:"color",summary:"dot colour"},paper:{default:"#FFFFFF",unit:"color",summary:"background colour"},softness:{default:.08,unit:"ratio",summary:"dot edge softness — 0 is a hard stencil"},amount:{default:1,unit:"ratio",summary:"blend back toward the un-screened image; 0 is identity. Keyframe it to 0 at both ends of a transition so the shader hands over to the real element without a pop."},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by"],stage:"color",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"amount;\n uniform float ").concat(t,"angle;\n uniform vec3 ").concat(t,"ink;\n uniform vec3 ").concat(t,"paper;\n uniform float ").concat(t,"soft;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float sz = ".concat(t,"size;").concat(e.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(t,"dpos));\n sz *= 1.0 + fd * ").concat(t,"damt * 1.8;"):"","\n // Screen angle: rotating the grid is what stops the dots\n // reading as a horizontal/vertical texture.\n float ca = cos(").concat(t,"angle), sa = sin(").concat(t,"angle);\n vec2 rp = vec2(ca * frag.x - sa * frag.y,\n sa * frag.x + ca * frag.y) / max(sz, 1.0);\n vec2 cell = fract(rp) - 0.5;\n // Dot radius from tone: darker tone prints a bigger dot.\n // sqrt because ink coverage goes as area, not radius.\n float rr = sqrt(clamp(1.0 - lum, 0.0, 1.0)) * 0.55;\n float dm = smoothstep(rr, rr - ").concat(t,"soft, length(cell));\n col = mix(col, mix(").concat(t,"paper, ").concat(t,"ink, dm), clamp(").concat(t,"amount, 0.0, 1.0));\n }")},uniforms:function(t,e){return{size:["1f",(t.size||6)*e],amount:["1f",null!=t.amount?t.amount:1],angle:["1f",(null!=t.angle?t.angle:15)*Math.PI/180],ink:["3fv",y(t.ink||"#0B1B2B")],paper:["3fv",y(t.paper||"#FFFFFF")],soft:["1f",null!=t.softness?t.softness:.08],radius:["1f",(t.radius||220)*e]}}},dither:{doc:{summary:"Ordered (Bayer) dithering to a small palette — the look of an 8-bit display, and the one op that gets sharper as the element gets smaller.",params:{size:{default:1,unit:"px",summary:"size of one dither cell; 1 is per-pixel"},levels:{default:6,unit:"count",summary:"quantisation steps per channel"},amount:{default:1,unit:"ratio",summary:"blend back toward the undithered image"},mono:{default:!1,unit:"bool",structural:!0,summary:"quantise luminance to ink/paper instead of per-channel colour. A different shader, so toggling rebuilds."},ink:{default:"#0B1B2B",unit:"color",summary:"dark end, mono only"},paper:{default:"#FFFFFF",unit:"color",summary:"light end, mono only"},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by","mono"],stage:"color",decl:function(t){return"\n uniform float ".concat(t,"levels;\n uniform float ").concat(t,"size;\n uniform float ").concat(t,"amount;\n uniform vec3 ").concat(t,"ink;\n uniform vec3 ").concat(t,"paper;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n // Bayer matrices by recursive bit-interleave rather than a\n // 64-entry table: WebGL1 has no constant array indexing, and\n // the nesting is exactly the recursive definition of the\n // ordered-dither matrix.\n float ").concat(t,"b2(vec2 a) {\n a = floor(a);\n return fract(a.x * 0.5 + a.y * a.y * 0.75);\n }\n float ").concat(t,"b4(vec2 a) { return ").concat(t,"b2(0.5 * a) * 0.25 + ").concat(t,"b2(a); }\n float ").concat(t,"b8(vec2 a) { return ").concat(t,"b4(0.5 * a) * 0.25 + ").concat(t,"b2(a); }")},code:function(t,e){return"\n {\n float sz = max(".concat(t,"size, 1e-3);").concat(e.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(t,"dpos));\n sz *= 1.0 + fd * ").concat(t,"damt * 1.8;"):"","\n // Centre the threshold on zero so dithering does not lift or\n // crush the overall exposure, only redistributes it.\n float t = ").concat(t,"b8(frag / sz) - 0.5;\n float lv = max(").concat(t,"levels, 1.0);\n ").concat(e.mono?"\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float q = step(0.5, lum + t);\n vec3 dq = mix(".concat(t,"ink, ").concat(t,"paper, q);"):"\n // Per channel: scale to level index, offset by the threshold,\n // round, scale back. The +t before rounding is what turns a\n // hard band edge into an interleaved pattern of the two\n // neighbouring levels.\n vec3 dq = floor(col * lv + 0.5 + t) / lv;","\n col = mix(col, clamp(dq, 0.0, 1.0), clamp(").concat(t,"amount, 0.0, 1.0));\n }")},uniforms:function(t,e){return{levels:["1f",null!=t.levels?t.levels:6],size:["1f",(null!=t.size?t.size:1)*e],amount:["1f",null!=t.amount?t.amount:1],ink:["3fv",y(t.ink||"#0B1B2B")],paper:["3fv",y(t.paper||"#FFFFFF")],radius:["1f",(t.radius||220)*e]}}},aberration:{movesCoords:!1,doc:{summary:"Chromatic aberration: the three colour channels are sampled at slightly different offsets, like a cheap lens.",params:{amount:{default:6,unit:"px",summary:"channel separation"},radius:{default:240,unit:"px",summary:"falloff around the focus when `by` names a driver"}}},structural:["by"],stage:"displace",chroma:!0,decl:function(t){return"\n uniform float ".concat(t,"amount;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n vec2 ctr = ".concat(e.by?"".concat(t,"dpos"):"u_res * 0.5",";\n vec2 dv = sampleP - ctr;\n float dl = length(dv);\n vec2 dir = dl > 0.5 ? dv / dl : vec2(0.0);\n ").concat(e.by?"float amt = ".concat(t,"amount * ").concat(t,"damt *\n (1.0 - smoothstep(0.0, ").concat(t,"radius, dl));"):"float amt = ".concat(t,"amount * (dl / max(length(u_res) * 0.5, 1.0));"),"\n chroma += dir * amt;\n }")},uniforms:function(t,e){return{amount:["1f",(null!=t.amount?t.amount:6)*e],radius:["1f",(t.radius||240)*e]}}},mask:{doc:{summary:'Writes a scalar FIELD for later ops to read — draws nothing itself. Give a downstream op `masked: "name"` and it applies only where this field is high. This is how any op becomes local without knowing anything about masking.',params:{as:{default:"mask",unit:"name",structural:!0,summary:"name of the field written. Consumers name it in `masked:`."},from:{default:"radial",unit:"name",structural:!0,summary:"field shape — compiled in, so changing it rebuilds"},at:{default:[.5,.5],unit:"point",structural:!0,summary:"centre as a fraction of the element box; survives resizes"},radius:{default:260,unit:"px",summary:"field radius"},invert:{default:!1,unit:"bool",summary:"swap inside and outside"},remap:{default:[0,1],unit:"range",summary:"rescale the field's output range"}}},structural:["as","from","at"],stage:"field",producesField:!0,defaultDriver:"static",decl:function(t){return"\n uniform vec2 ".concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"at;\n uniform vec2 ").concat(t,"remap;\n uniform float ").concat(t,"invert;")},code:function(t,e){var n=e.from||"radial",r=e.at?"(".concat(t,"at * u_res)"):"".concat(t,"dpos"),o="vertical"===n?"frag.y / max(u_res.y, 1.0)":"horizontal"===n?"frag.x / max(u_res.x, 1.0)":"1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(r,"))");return"\n {\n float m = ".concat(o,";\n m = clamp((m - ").concat(t,"remap.x) / max(").concat(t,"remap.y - ").concat(t,"remap.x, 1e-4), 0.0, 1.0);\n m = mix(m, 1.0 - m, ").concat(t,"invert);\n ").concat(S(e.as||"mask")," *= m * ").concat(t,"damt;\n }")},uniforms:function(t,e){return{radius:["1f",(null!=t.radius?t.radius:260)*e],at:["2fv",t.at||[.5,.5]],remap:["2fv",t.remap||[0,1]],invert:["1f",t.invert?1:0]}}},noise:{doc:{summary:"Writes an animated noise FIELD. Same contract as `mask` — it draws nothing; downstream ops read it via `masked:`. Use it to make any other op flicker, breathe or crawl.",params:{as:{default:"mask",unit:"name",structural:!0,summary:"name of the field written"},scale:{default:3,unit:"ratio",summary:"noise frequency across the element"},speed:{default:.3,unit:"seconds",summary:"how fast it evolves; 0 freezes it"},amount:{default:1,unit:"ratio",summary:"blend between flat 1.0 and full noise"},remap:{default:[0,1],unit:"range",summary:"rescale the field's output range"}}},structural:["as"],stage:"field",producesField:!0,decl:function(t){return"\n uniform float ".concat(t,"scale;\n uniform float ").concat(t,"speed;\n uniform vec2 ").concat(t,"remap;\n uniform float ").concat(t,"amp;\n float ").concat(t,"h(vec2 v) {\n return fract(sin(dot(v, vec2(41.113, 289.717))) * 43758.545);\n }\n float ").concat(t,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(t,"h(i), ").concat(t,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(t,"h(i + vec2(0.0, 1.0)), ").concat(t,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }")},code:function(t,e){return"\n {\n vec2 np = frag / max(u_res.y, 1.0) * ".concat(t,"scale;\n // Two octaves: enough structure to read as turbulence\n // without the cost of a full fBm.\n float n = ").concat(t,"n(np + u_time * ").concat(t,"speed) * 0.65 +\n ").concat(t,"n(np * 2.7 - u_time * ").concat(t,"speed * 0.6) * 0.35;\n n = clamp((n - ").concat(t,"remap.x) / max(").concat(t,"remap.y - ").concat(t,"remap.x, 1e-4), 0.0, 1.0);\n ").concat(S(e.as||"mask")," *= mix(1.0, n, ").concat(t,"amp);\n }")},uniforms:function(t){return{scale:["1f",null!=t.scale?t.scale:3],speed:["1f",null!=t.speed?t.speed:.3],remap:["2fv",t.remap||[0,1]],amp:["1f",null!=t.amount?t.amount:1]}}},copy:{multiSample:!0,doc:{summary:"Stamps extra copies of the element over itself. Copies sample the ORIGINAL texture, not the result of earlier colour ops, so a copy of a halftoned element is a copy of the unhalftoned source.",params:{count:{default:5,unit:"count",structural:!0,summary:"stamps arranged in a ring around the focus. The loop is unrolled at compile time, so this rebuilds — not something to animate."},points:{default:null,unit:"point",structural:!0,summary:"explicit [[x,y], ...] in fractions of the element box, instead of a ring. Survives resizes. Overrides `count`."},radius:{default:110,unit:"px",summary:"ring radius when using `count`"},scale:{default:.5,unit:"ratio",summary:"size of each copy"},rotate:{default:0,unit:"deg",summary:"rotation applied per copy"},fade:{default:1,unit:"ratio",summary:"opacity falloff across the set"},amount:{default:1,unit:"ratio",summary:"overall blend of the copies over the original"}}},structural:["count","points"],stage:"color",defaultDriver:"static",decl:function(t){return"\n uniform vec2 ".concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n uniform float ").concat(t,"scale;\n uniform float ").concat(t,"rotate;\n uniform float ").concat(t,"fade;\n uniform float ").concat(t,"amount;")},code:function(t,e){for(var n=Array.isArray(e.points)&&e.points.length>0,r=n?e.points.length:Math.max(1,Math.min(24,Math.round(e.count||5))),o="",i=function(i){var a,s=n?"vec2(".concat((+e.points[i][0]).toFixed(5),", ").concat((+e.points[i][1]).toFixed(5),") * u_res"):(a=i/r*Math.PI*2,"".concat(t,"dpos + vec2(").concat(Math.cos(a).toFixed(5),", ")+"".concat(Math.sin(a).toFixed(5),") * ").concat(t,"radius"));o+="\n {\n float ang = ".concat(t,"rotate * ").concat((i+1).toFixed(1),";\n float cs = cos(ang), sn = sin(ang);\n // Inverse transform: to draw a stamp scaled by s about a\n // centre c, fetch from the source at (frag - c) / s.\n vec2 d = mat2(cs, -sn, sn, cs) * (frag - (").concat(s,"));\n vec2 q = d / max(").concat(t,"scale, 1e-3) + u_res * 0.5;\n vec2 quv = vec2(q.x / u_res.x, 1.0 - q.y / u_res.y);\n vec2 inside = step(vec2(0.0), quv) * step(quv, vec2(1.0));\n vec4 s = texture2D(u_tex, clamp(quv, 0.0, 1.0));\n float w = s.a * inside.x * inside.y * ").concat(t,"amount * ").concat(t,"damt\n * pow(").concat(t,"fade, ").concat(i.toFixed(1),");\n // Straight-alpha OVER, newest stamp on top.\n float na = w + ovA * (1.0 - w);\n ovCol = (s.rgb * w + ovCol * ovA * (1.0 - w)) / max(na, 1e-4);\n ovA = na;\n }")},a=0;a<r;a++)i(a);return o},uniforms:function(t,e){return{radius:["1f",(null!=t.radius?t.radius:110)*e],scale:["1f",null!=t.scale?t.scale:.5],rotate:["1f",null!=t.rotate?t.rotate:0],fade:["1f",null!=t.fade?t.fade:1],amount:["1f",null!=t.amount?t.amount:1]}}},merge:{doc:{summary:"Runs two sub-chains over the same source and blends the results. The only op that takes other ops as arguments — everything else composes by sequence, this composes in parallel.",params:{a:{default:null,summary:"first branch: an array of nodes",structural:!0},b:{default:null,summary:"second branch: an array of nodes",structural:!0},mode:{default:"over",unit:"name",structural:!0,summary:"how the branches combine: over, add, screen, multiply, difference, lighten. Compiled in, so it rebuilds."},mix:{default:1,unit:"ratio",summary:"how far to blend b into a"}}},structural:["mode","a","b"],stage:"color",decl:function(t){return"uniform float ".concat(t,"mix;")},code:function(){return""},uniforms:function(t){return{mix:["1f",null!=t.mix?t.mix:1]}}},echo:{doc:{summary:"Temporal accumulation — a fading trail of what CHANGED. Typing smears, a ticking counter leaves a comet. The one op that does nothing on the snapshot backend, because a frozen image has no motion to record.",params:{strength:{default:.85,unit:"ratio",summary:"opacity of the trail"},decay:{default:.92,unit:"ratio",summary:"per-second persistence — higher is a longer tail"},tint:{default:"#7FD4FF",unit:"color",summary:"colour pushed into the trail"},tintAmount:{default:.5,unit:"ratio",summary:"how far the trail is tinted"}}},stage:"color",decl:function(t){return"\n uniform sampler2D ".concat(t,"hist;\n uniform float ").concat(t,"strength;\n uniform vec3 ").concat(t,"tint;\n uniform float ").concat(t,"tintAmt;")},code:function(t){return"\n {\n // Sampled in screen space: the trail records where things\n // WERE, which is not where a warp op would fetch them from.\n vec2 huv = vec2(frag.x / u_res.x, 1.0 - frag.y / u_res.y);\n vec4 h = texture2D(".concat(t,"hist, clamp(huv, 0.001, 0.999));\n float ha = clamp(h.a * ").concat(t,"strength, 0.0, 1.0);\n vec3 hc = mix(h.rgb, ").concat(t,"tint, ").concat(t,"tintAmt);\n // Straight-alpha OVER into the border layer so an edges op\n // in the same chain still composites correctly.\n float na = ha + edgeCov * (1.0 - ha);\n edgeCol = (hc * ha + edgeCol * edgeCov * (1.0 - ha)) / max(na, 1e-4);\n edgeCov = na;\n }")},uniforms:function(t){return{strength:["1f",null!=t.strength?t.strength:.85],tint:["3fv",y(t.tint||"#7FD4FF")],tintAmt:["1f",t.tint?null!=t.tintAmount?t.tintAmount:.5:0]}},solver:{resolutions:function(t,e,n){return{frame:[e,n]}},targets:{history:{double:!0,res:"frame",fmt:"rgba",smooth:!0}},samplers:{hist:"history"},programs:{accumulate:"\nprecision highp float;\nuniform sampler2D u_content;\nuniform sampler2D u_hist;\nuniform vec2 u_texel;\nuniform float u_decay;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec4 c = texture2D(u_content, uv);\n vec4 h = texture2D(u_hist, uv) * u_decay;\n gl_FragColor = max(c, h);\n}"},splatColor:function(){return[0,0,0]},step:function(t,e,n){var r=Math.min(n.dt,1/30),o=Math.pow(null!=e.decay?e.decay:.92,60*r);t.use("accumulate"),t.f2("u_texel",1/t.canvasW,1/t.canvasH),t.f1("u_decay",o),t.smp("u_content",t.content,0),t.smp("u_hist",t.read("history"),1),t.blit(t.write("history")),t.swap("history")}}},stir:{doc:{summary:"Stirred liquid: a real fluid simulation the content is dragged through. STATEFUL — it owns a ping-pong pair of render targets that evolve frame to frame, so it is the most expensive op here.",params:{strength:{default:26,unit:"px",summary:"how far the fluid carries the content"},force:{default:1,unit:"ratio",summary:"how hard the pointer pushes the fluid"},radius:{default:.1,unit:"ratio",summary:"splat size, as a fraction of the sim grid"},curl:{default:2.2,unit:"ratio",summary:"vorticity — how much the fluid curls into eddies"},decay:{default:.985,unit:"ratio",summary:"per-second velocity persistence"},pressure:{default:.8,unit:"ratio",summary:"pressure retained between frames"},pressureIterations:{default:6,unit:"count",summary:"solver iterations; higher is stiffer and slower"},intensity:{default:1.6,unit:"ratio",summary:"brightness of the dye layer"},sheen:{default:.15,unit:"ratio",summary:"specular highlight on the surface"},tint:{default:"#7FD4FF",unit:"color",summary:"dye colour, unless `rainbow`"},rainbow:{default:!1,unit:"bool",summary:"cycle dye hue instead of using `tint`"},dye:{default:.85,unit:"ratio",summary:"how much dye colour reaches the final image"},dyeAmount:{default:.6,unit:"ratio",summary:"how much dye each splat injects"},dyeFade:{default:.97,unit:"ratio",summary:"per-second dye persistence"},resolution:{default:128,unit:"count",summary:"velocity grid size, clamped 32..512"},dyeResolution:{default:512,unit:"count",summary:"dye grid size, clamped 64..1024"}}},stage:["warp","color"],decl:function(t){return"\n uniform sampler2D ".concat(t,"vel;\n uniform sampler2D ").concat(t,"dye;\n uniform float ").concat(t,"strength;\n uniform float ").concat(t,"dyemix;\n uniform float ").concat(t,"intensity;\n uniform float ").concat(t,"sheen;\n uniform vec3 ").concat(t,"tint;")},code:function(t,e,n){return"warp"===n?"\n {\n // frag/warped are top-down pixels, the field is bottom-up\n // [0,1]: flip y going in, and flip the y of the vector coming\n // out so the content drags WITH the pointer.\n vec2 fuv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec2 v = texture2D(".concat(t,"vel, clamp(fuv, 0.001, 0.999)).xy;\n warped += vec2(v.x, -v.y) * ").concat(t,"strength;\n }"):"\n {\n // Sampled at the CONTINUOUS warped position, never at the\n // cell centre: a cell op upstream (hexalize) snaps the cell\n // centre to one point per tile, which would quantise the\n // liquid into flat per-hex patches instead of smooth swirls.\n vec2 suv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec3 dc = texture2D(".concat(t,"dye, clamp(suv, 0.001, 0.999)).rgb;\n float mag = length(dc);\n // Colour is carried IN the dye field and advected with it, so\n // a ribbon keeps its hue while the flow folds it. Deriving\n // colour from the local flow direction instead would make\n // neighbouring pixels jump hue and read as confetti.\n vec3 liquid = mag > 1e-4 ? clamp(dc / mag * 1.25, 0.0, 1.0) : ").concat(t,"tint;\n float amt = clamp((1.0 - exp(-mag * ").concat(t,"intensity)) * ").concat(t,"dyemix, 0.0, 1.0);\n // Straight-alpha OVER so a later overlay op (blobs) still\n // composites correctly on top of the liquid.\n float na = amt + ovA * (1.0 - amt);\n ovCol = (liquid * amt + ovCol * ovA * (1.0 - amt)) / max(na, 1e-4);\n ovA = na;\n\n // Faint sheen on the content itself where the flow is fast.\n float sp = length(texture2D(").concat(t,"vel, clamp(suv, 0.001, 0.999)).xy);\n col = mix(col, ").concat(t,"tint, (1.0 - exp(-sp * 0.7)) * ").concat(t,"sheen);\n }")},uniforms:function(t,e){return{strength:["1f",(null!=t.strength?t.strength:26)*e],sheen:["1f",null!=t.sheen?t.sheen:.15],tint:["3fv",y(t.tint||"#7FD4FF")],dyemix:["1f",null!=t.dye?t.dye:.85],intensity:["1f",null!=t.intensity?t.intensity:1.6]}},solver:{resolutions:function(t){return{sim:Math.max(32,Math.min(t.resolution||128,512)),dye:Math.max(64,Math.min(t.dyeResolution||512,1024))}},targets:{velocity:{double:!0,res:"sim",fmt:"rg",smooth:!0},dye:{double:!0,res:"dye",fmt:"rgba",smooth:!0},pressure:{double:!0,res:"sim",fmt:"r",smooth:!1},divergence:{double:!1,res:"sim",fmt:"r",smooth:!1},vorticity:{double:!1,res:"sim",fmt:"r",smooth:!1}},samplers:{vel:"velocity",dye:"dye"},programs:{splat:"\nprecision highp float;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform vec2 u_point;\nuniform vec3 u_amount;\nuniform float u_radius;\nuniform float u_aspect;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 d = uv - u_point;\n if (u_aspect >= 1.0) d.y /= u_aspect; else d.x *= u_aspect;\n float g = exp(-dot(d, d) / max(u_radius * u_radius, 1e-6));\n gl_FragColor = vec4(texture2D(u_src, uv).xyz + u_amount * g, 1.0);\n}",advect:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform float u_dt;\nuniform float u_diss;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 back = uv - texture2D(u_vel, uv).xy * u_dt;\n gl_FragColor = vec4(texture2D(u_src, clamp(back, 0.0, 1.0)).xyz * u_diss, 1.0);\n}",curl:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).y;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).y;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).x;\n gl_FragColor = vec4(0.5 * ((r - l) - (t - b)), 0.0, 0.0, 1.0);\n}",confine:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_curl;\nuniform vec2 u_texel;\nuniform float u_eps;\nuniform float u_dt;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_curl, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_curl, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_curl, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_curl, uv - vec2(0.0, u_texel.y)).x;\n float c = texture2D(u_curl, uv).x;\n vec2 grad = 0.5 * vec2(abs(r) - abs(l), abs(t) - abs(b));\n vec2 n = grad / (length(grad) + 1e-5);\n vec2 force = u_eps * c * vec2(n.y, -n.x);\n vec2 v = texture2D(u_vel, uv).xy + force * u_dt;\n gl_FragColor = vec4(clamp(v, -64.0, 64.0), 0.0, 1.0);\n}",divergence:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).y;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).y;\n vec2 c = texture2D(u_vel, uv).xy;\n if (uv.x - u_texel.x < 0.0) l = -c.x;\n if (uv.x + u_texel.x > 1.0) r = -c.x;\n if (uv.y - u_texel.y < 0.0) b = -c.y;\n if (uv.y + u_texel.y > 1.0) t = -c.y;\n gl_FragColor = vec4(0.5 * ((r - l) + (t - b)), 0.0, 0.0, 1.0);\n}",jacobi:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_div;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n float d = texture2D(u_div, uv).x;\n gl_FragColor = vec4((r + l + t + b - d) * 0.25, 0.0, 0.0, 1.0);\n}",subtract:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n vec2 v = texture2D(u_vel, uv).xy - 0.5 * vec2(r - l, t - b);\n gl_FragColor = vec4(v, 0.0, 1.0);\n}",decay:"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_texel;\nuniform float u_value;\nvoid main() {\n gl_FragColor = texture2D(u_tex, gl_FragCoord.xy * u_texel) * u_value;\n}"},splatColor:function(t,e,n){var r=null!=t.dyeAmount?t.dyeAmount:.6;if(!t.rainbow){var o=y(t.tint||"#7FD4FF");return[o[0]*r,o[1]*r,o[2]*r]}var i=Math.atan2(n,e);return[(.5+.5*Math.cos(i))*r,(.5+.5*Math.cos(i+2.0944))*r,(.5+.5*Math.cos(i+4.1888))*r]},step:function(t,e,n){var r=Math.min(n.dt,1/30),o=1/t.res.sim,i=1/t.res.dye,a=function(t,e){return Math.pow(t,60*e)};if(n.moving){var s=null!=e.force?e.force:1;t.use("splat"),t.f1("u_radius",null!=e.radius?e.radius:.1),t.f1("u_aspect",n.aspect),t.f2("u_point",n.px,n.py),t.f2("u_texel",o,o),t.smp("u_src",t.read("velocity"),0),t.f3("u_amount",n.dx*s,n.dy*s,0),t.blit(t.write("velocity")),t.swap("velocity"),t.f2("u_texel",i,i),t.smp("u_src",t.read("dye"),0),t.f3("u_amount",n.col[0],n.col[1],n.col[2]),t.blit(t.write("dye")),t.swap("dye")}t.use("curl"),t.f2("u_texel",o,o),t.smp("u_vel",t.read("velocity"),0),t.blit(t.single("vorticity")),t.use("confine"),t.f2("u_texel",o,o),t.f1("u_eps",null!=e.curl?e.curl:2.2),t.f1("u_dt",r),t.smp("u_vel",t.read("velocity"),0),t.smp("u_curl",t.single("vorticity"),1),t.blit(t.write("velocity")),t.swap("velocity"),t.use("divergence"),t.f2("u_texel",o,o),t.smp("u_vel",t.read("velocity"),0),t.blit(t.single("divergence")),t.use("decay"),t.f2("u_texel",o,o),t.f1("u_value",a(null!=e.pressure?e.pressure:.8,r)),t.smp("u_tex",t.read("pressure"),0),t.blit(t.write("pressure")),t.swap("pressure"),t.use("jacobi"),t.f2("u_texel",o,o),t.smp("u_div",t.single("divergence"),1);for(var l=Math.max(1,Math.min(e.pressureIterations||6,40)),c=0;c<l;c++)t.smp("u_p",t.read("pressure"),0),t.blit(t.write("pressure")),t.swap("pressure");t.use("subtract"),t.f2("u_texel",o,o),t.smp("u_p",t.read("pressure"),0),t.smp("u_vel",t.read("velocity"),1),t.blit(t.write("velocity")),t.swap("velocity"),t.use("advect"),t.f1("u_dt",r),t.f2("u_texel",o,o),t.smp("u_vel",t.read("velocity"),0),t.smp("u_src",t.read("velocity"),0),t.f1("u_diss",a(null!=e.decay?e.decay:.985,r)),t.blit(t.write("velocity")),t.swap("velocity"),t.f2("u_texel",i,i),t.smp("u_vel",t.read("velocity"),0),t.smp("u_src",t.read("dye"),1),t.f1("u_diss",a(null!=e.dyeFade?e.dyeFade:.97,r)),t.blit(t.write("dye")),t.swap("dye")}}},blobs:{doc:{summary:"Liquid-glass blobs that follow the pointer: a chain of metaballs refracting the content behind them, stretching apart on a fast flick and relaxing back to a single circle at rest.",params:{count:{default:1,unit:"count",structural:!0,summary:"independent drifting blobs, on top of the trail chain"},trail:{default:7,unit:"count",structural:!0,summary:"blobs in the follow-the-leader chain. Unrolled at compile time, so it rebuilds."},radius:{default:46,unit:"px",summary:"blob radius at rest"},color:{default:"#EAF4EE",unit:"color",summary:"glass tint"},refract:{default:70,unit:"px",summary:"how far the glass bends what is behind it"},rim:{default:.6,unit:"ratio",summary:"brightness of the rim light"},alpha:{default:1,unit:"ratio",summary:"overall opacity"},iridescence:{default:.8,unit:"ratio",summary:"colour shift across the rim"},dispersion:{default:1,unit:"ratio",summary:"per-channel refraction spread"},frost:{default:.25,unit:"ratio",summary:"blur of what shows through"}}},structural:["count","trail"],stage:"color",overlay:!0,mips:!0,decl:function(t){return"\n uniform vec3 ".concat(t,"blobs[").concat(12,"];\n uniform int ").concat(t,"count;\n uniform vec3 ").concat(t,"tint;\n uniform float ").concat(t,"refract;\n uniform float ").concat(t,"rim;\n uniform float ").concat(t,"alpha;\n uniform float ").concat(t,"irid;\n uniform float ").concat(t,"disp;\n uniform float ").concat(t,"frost;\n float ").concat(t,"hash(vec3 v) {\n return fract(sin(dot(v, vec3(21.9898, 63.233, 41.719))) * 41739.317);\n }\n float ").concat(t,"noise(vec3 v) {\n vec3 f = floor(v);\n vec3 r = v - f;\n r = r * r * (3.0 - 2.0 * r);\n float c000 = ").concat(t,"hash(f);\n float c100 = ").concat(t,"hash(f + vec3(1.0, 0.0, 0.0));\n float c010 = ").concat(t,"hash(f + vec3(0.0, 1.0, 0.0));\n float c110 = ").concat(t,"hash(f + vec3(1.0, 1.0, 0.0));\n float c001 = ").concat(t,"hash(f + vec3(0.0, 0.0, 1.0));\n float c101 = ").concat(t,"hash(f + vec3(1.0, 0.0, 1.0));\n float c011 = ").concat(t,"hash(f + vec3(0.0, 1.0, 1.0));\n float c111 = ").concat(t,"hash(f + vec3(1.0, 1.0, 1.0));\n return mix(\n mix(mix(c000, c100, r.x), mix(c010, c110, r.x), r.y),\n mix(mix(c001, c101, r.x), mix(c011, c111, r.x), r.y), r.z);\n }")},code:function(t){return"\n {\n float field = 0.0;\n vec2 grad = vec2(0.0);\n for (int bi = 0; bi < ".concat(12,"; bi++) {\n if (bi >= ").concat(t,"count) break;\n vec2 bd = frag - ").concat(t,"blobs[bi].xy;\n float br = ").concat(t,"blobs[bi].z;\n float dd = max(dot(bd, bd), 1.0);\n field += (br * br) / dd;\n grad += (-2.0 * (br * br) / (dd * dd)) * bd;\n }\n float bmask = smoothstep(0.6, 1.0, field);\n if (bmask > 0.003) {\n float gmag = length(grad);\n vec2 g2 = gmag > 1e-6 ? -grad / gmag : vec2(0.0);\n // Pseudo-3D surface normal from the 2D field. For a\n // metaball field (sum of r^2/d^2), 1/sqrt(field) IS the\n // normalized radial position: 0 at the centre, 1 at the\n // surface. That yields a true hemisphere profile — the\n // curvature (and therefore refraction) varies smoothly\n // across the WHOLE disc, not just an edge annulus.\n float s = clamp(inversesqrt(max(field, 1e-4)), 0.0, 1.0);\n vec3 n = normalize(vec3(g2 * s, sqrt(max(1.0 - s * s, 0.004))));\n vec3 rd = vec3(0.0, 0.0, -1.0);\n\n // Dispersion: refract each channel with a slightly\n // different index (water-glass ~1.33). Near the rim the\n // exit direction flattens (|z| -> 0), so the sampling\n // offsets stretch — producing the smooth concentric\n // colour-fringed bands of a thick lens.\n float ca = 0.03 * ").concat(t,"disp;\n vec3 tR = refract(rd, n, 1.0 / (1.33 - ca));\n vec3 tG = refract(rd, n, 1.0 / 1.33);\n vec3 tB = refract(rd, n, 1.0 / (1.33 + ca));\n vec2 oR = tR.xy * (").concat(t,"refract / max(abs(tR.z), 0.3));\n vec2 oG = tG.xy * (").concat(t,"refract / max(abs(tG.z), 0.3));\n vec2 oB = tB.xy * (").concat(t,"refract / max(abs(tB.z), 0.3));\n\n // Blur grows with how far the ray was bent (mip bias), so\n // strongly-refracted regions smear smoothly instead of\n // showing sharp displaced copies. frost adds a base blur.\n float lod = ").concat(t,"frost * 5.0 + log2(1.0 + length(oG) * 0.035);\n vec2 px = 1.0 / u_res;\n vec4 sG = texture2D(u_tex, clamp(uv + oG * px, 0.002, 0.998), lod);\n vec3 refr;\n refr.r = texture2D(u_tex, clamp(uv + oR * px, 0.002, 0.998), lod).r;\n refr.g = sG.g;\n refr.b = texture2D(u_tex, clamp(uv + oB * px, 0.002, 0.998), lod).b;\n // Blend in (approximately) linear light for clean fringes.\n refr = pow(max(refr, 0.0), vec3(2.2));\n\n vec3 tintLin = pow(").concat(t,"tint, vec3(2.2));\n vec3 bodyLin = mix(tintLin * 0.35, refr, sG.a);\n\n // Glass darkens toward the silhouette (absorption), the\n // opposite of an additive glow ring.\n float edge = pow(1.0 - clamp(n.z, 0.0, 1.0), 1.5);\n bodyLin *= 1.0 - 0.35 * ").concat(t,"rim * edge;\n vec3 body = pow(max(bodyLin, 0.0), vec3(1.0 / 2.2));\n\n // Sparse iridescent glints: two drifting value-noise\n // fields sampled on the reflection direction, one warm\n // one cool, sharpened hard so only sparkles survive.\n vec3 rf = reflect(rd, n);\n float nA = ").concat(t,"noise(rf * 2.3 + u_time * 0.5);\n float nB = ").concat(t,"noise(rf * 2.3 - u_time * 0.5);\n vec3 glint = pow(max(vec3(0.30, 0.52, 0.86) * nA +\n vec3(0.80, 0.56, 0.34) * nB, 0.0), vec3(6.0));\n body += glint * ").concat(t,"irid;\n\n // Small hard specular from a fixed key light.\n vec3 L = normalize(vec3(-0.5, 0.7, 0.6));\n float spec = pow(max(dot(reflect(-L, n), vec3(0.0, 0.0, 1.0)), 0.0), 60.0);\n body += spec * 0.35;\n\n ovCol = body;\n ovA = max(ovA, bmask * ").concat(t,"alpha);\n }\n }")},uniforms:function(t,e){return{tint:["3fv",y(t.color||"#EAF4EE")],refract:["1f",(null!=t.refract?t.refract:70)*e],rim:["1f",null!=t.rim?t.rim:.6],alpha:["1f",null!=t.alpha?t.alpha:1],irid:["1f",null!=t.iridescence?t.iridescence:.8],disp:["1f",null!=t.dispersion?t.dispersion:1],frost:["1f",null!=t.frost?t.frost:.25]}},init:function(t,e,n,r){for(var o=(t.radius||46)*e,i=Math.max(1,Math.min(null!=t.trail?t.trail:7,12)),a=[],s=0,l=0;l<i;l++){var c=Math.pow(.86,l);a.push(c),s+=c*c}for(var u=Math.sqrt(s),f=a.map(function(t){return o*t/u}),d=a.map(function(t,e){return.85*o*Math.pow(.955,e)}),h=function(t,e){return t+Math.random()*(e-t)},p=Math.max(0,Math.min((t.count||1)-1,12-i)),y=[],m=0;m<p;m++){var v=h(0,2*Math.PI),b=h(30,80)*e;y.push({x:h(o,n-o),y:h(o,r-o),r:o*h(.45,.8),vx:Math.cos(v)*b,vy:Math.sin(v)*b,phase:h(0,2*Math.PI)})}for(var g={x:.5*n,y:.55*r},w=[],x=0;x<i;x++)w.push({x:g.x,y:g.y});return{head:g,chain:w,nTrail:i,drifters:y,trailIdleR:f,trailMoveR:d,stretch:0,seg:.9*o}},tick:function(t,e){var n=Math.min(e.dt,.05),r=e.w,o=e.h,i=1-Math.exp(9*-n);t.head.x+=(e.mouseX-t.head.x)*i,t.head.y+=(e.mouseY-t.head.y)*i;var a=t.chain;a[0].x=t.head.x,a[0].y=t.head.y;for(var s=1-Math.exp(16*-n),c=1;c<a.length;c++){var u=a[c-1],f=a[c],d=u.x-f.x,h=u.y-f.y,p=Math.hypot(d,h)||1e-4,y=t.seg;p>y&&(f.x+=d*(1-y/p),f.y+=h*(1-y/p)),f.x+=(u.x-f.x)*s,f.y+=(u.y-f.y)*s}var m=a[a.length-1],v=Math.hypot(m.x-t.head.x,m.y-t.head.y),b=Math.max(1,t.seg*(t.nTrail-1)),g=Math.min(1,v/b);t.stretch+=(g-t.stretch)*(1-Math.exp(8*-n));var w,x=l(t.drifters);try{for(x.s();!(w=x.n()).done;){var k=w.value;k.x+=k.vx*n,k.y+=k.vy*n,k.x<k.r?(k.x=k.r,k.vx=Math.abs(k.vx)):k.x>r-k.r&&(k.x=r-k.r,k.vx=-Math.abs(k.vx)),k.y<k.r?(k.y=k.r,k.vy=Math.abs(k.vy)):k.y>o-k.r&&(k.y=o-k.r,k.vy=-Math.abs(k.vy)),k.phase+=1.6*n}}catch(t){x.e(t)}finally{x.f()}for(var O=new Float32Array(36),S=t.stretch,E=0;E<t.nTrail;E++){var j=a[E];O[3*E]=j.x,O[3*E+1]=j.y,O[3*E+2]=t.trailIdleR[E]+(t.trailMoveR[E]-t.trailIdleR[E])*S}return t.drifters.forEach(function(e,n){var r=t.nTrail+n;O[3*r]=e.x,O[3*r+1]=e.y,O[3*r+2]=e.r*(1+.12*Math.sin(e.phase))}),[{name:"blobs",kind:"3fv",value:O},{name:"count",kind:"1i",value:t.nTrail+t.drifters.length}]}}};function y(t){return[1,3,5].map(function(e){return parseInt(t.slice(e,e+2),16)/255})}var m=Object.keys(p).concat("switch"),v=["px","ratio","deg","count","seconds"];function b(t,e,n){if(!Array.isArray(n)||n.length<2)return!1;var r,o=l(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;if("number"!=typeof i||!Number.isFinite(i))return!1}}catch(t){o.e(t)}finally{o.f()}var a=p[t],s=a&&a.doc&&a.doc.params&&a.doc.params[e];return!!s&&v.includes(s.unit)}function g(t,e){var n=t.length-1,r=Math.min(1,Math.max(0,e))*n,o=Math.min(n-1,Math.floor(r));return t[o]+(t[o+1]-t[o])*(r-o)}var w={linear:function(t){return t},in:function(t){return t*t*t},out:function(t){return 1-Math.pow(1-t,3)},"in-out":function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2},back:function(t){return 1+2.70158*Math.pow(t-1,3)+1.70158*Math.pow(t-1,2)}},x=Object.keys(w);var k="attribute vec2 a; void main(){ gl_Position = vec4(a, 0.0, 1.0); }",O={warp:["warped"],cell:["center","edge"],displace:["sampleP","chroma"],color:["col","edgeCol","edgeCov","ovCol","ovA"]},S=(["field"].concat(a(Object.keys(O))),"what steers the effect: ".concat(h.join(", "),". "),"easing for this node's local progress: ".concat(x.join(", ")),function(t){return"fld_".concat(String(t).replace(/[^A-Za-z0-9_]/g,""))}),E=function(t){return!0===t.masked?"mask":"string"==typeof t.masked?t.masked:null},j=function(t){return"edge"===t||"edgeCov"===t||"ovA"===t?"float":"col"===t||"edgeCol"===t||"ovCol"===t?"vec3":"vec2"},T={over:function(t,e){return e},add:function(t,e){return"min(".concat(t," + ").concat(e,", vec3(1.0))")},screen:function(t,e){return"1.0 - (1.0 - ".concat(t,") * (1.0 - ").concat(e,")")},multiply:function(t,e){return"".concat(t," * ").concat(e)},difference:function(t,e){return"abs(".concat(t," - ").concat(e,")")},lighten:function(t,e){return"max(".concat(t,", ").concat(e,")")},darken:function(t,e){return"min(".concat(t,", ").concat(e,")")}};function _(t,e){var n,r=[],o=l(t||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&i.op){var a={node:i,i:e.length};e.push(i),"merge"===i.op&&(a.a=_(i.a,e),a.b=_(i.b,e)),r.push(a)}}}catch(t){o.e(t)}finally{o.f()}return r}function C(t,e){var n,r=l(t);try{var o=function(){var t=n.value,r=t.node;if("merge"===r.op)return function(t,e){var n="u".concat(t.i,"_"),r=T[t.node.mode]||T.over,o={field:"",warp:"",cell:"",displace:"",color:""},i={field:"",warp:"",cell:"",displace:"",color:""};C(t.a||[],o),C(t.b||[],i),e.field+=o.field+i.field;for(var a=function(){var t=l[s];if(!o[t]&&!i[t])return 1;var a=O[t],c=" {\n";a.forEach(function(t,e){c+=" ".concat(j(t)," pre").concat(e," = ").concat(t,";\n")}),c+=o[t],a.forEach(function(t,e){c+=" ".concat(j(t)," bra").concat(e," = ").concat(t,";\n")}),a.forEach(function(t,e){c+=" ".concat(t," = pre").concat(e,";\n")}),c+=i[t],a.forEach(function(t,e){var o="vec3"===j(t)?r("bra".concat(e),t):t;c+=" ".concat(t," = mix(bra").concat(e,", ").concat(o,", ").concat(n,"mix);\n")}),c+=" }\n",e[t]+=c},s=0,l=["warp","cell","displace","color"];s<l.length;s++)a()}(t,e),0;var o=p[r.op];if(!o)return 0;var i="u".concat(t.i,"_"),a=Array.isArray(o.stage)?o.stage:[o.stage],s=E(r);a.forEach(function(t){var n=o.code(i,r,t)+"\n";if(s&&O[t]){var a=O[t],l=a.map(function(t,e){return" ".concat(j(t)," msv").concat(e," = ").concat(t,";")}).join("\n"),c=a.map(function(t,e){return" ".concat(t," = mix(msv").concat(e,", ").concat(t,", ").concat(S(s),");")}).join("\n");n=" {\n".concat(l,"\n").concat(n,"\n").concat(c,"\n }\n")}e["field"===t||"warp"===t||"cell"===t||"displace"===t?t:"color"]+=n})};for(r.s();!(n=r.n()).done;)o()}catch(t){r.e(t)}finally{r.f()}}function P(t,e,n,r){var o=r&&r.fade||"opaque",i="",s=new Set;e.forEach(function(t){var e=p[t.op];e&&e.producesField&&s.add(t.as||"mask");var n=E(t);n&&s.add(n)});var l=a(s).map(function(t){return" float ".concat(S(t)," = 1.0;")}).join("\n");e.forEach(function(t,e){var n=p[t.op];n&&(i+=n.decl("u".concat(e,"_"),t)+"\n")});var c=function(t){var e=t&&t.node&&t.node.side;if("old"!==e&&"new"!==e)return null;var n=p[t.node.op],o=n?Array.isArray(n.stage)?n.stage:[n.stage]:[];return o.every(function(t){return"color"===t})?r?e:(console.warn('[nodality] side:"'.concat(e,'" has no meaning without a ')+"transition — there is only one image. Ignoring it."),null):(console.warn('[nodality] "'.concat(t.node.op,'" is a ').concat(o.join("+")," op, ")+'so side:"'.concat(e,'" cannot apply to it — a sided op must be colour-only, ')+"because both sides share one sampling coordinate. Running it on the blended result instead."),null)},u=t.filter(function(t){return!c(t)}),f=t.filter(function(t){return"old"===c(t)}),d=t.filter(function(t){return"new"===c(t)}),h={field:"",warp:"",cell:"",displace:"",color:""};C(u,h);var y=function(t,e){if(!t.length)return"";var n={field:"",warp:"",cell:"",displace:"",color:""};if(C(t,n),!n.color)return"";var r=O.color.filter(function(t){return"col"!==t}).map(function(t){return" ".concat(j(t)," ").concat(t," = ").concat("vec3"===j(t)?"vec3(0.0)":"0.0",";")}).join("\n");return" {\n vec2 frag = p;\n vec3 col = ".concat(e,".rgb;\n").concat(r,"\n").concat(n.color,"\n ").concat(e,".rgb = col;\n }\n")},m=y(f,"o"),v=y(d,"n"),b=h.field,g=h.warp,w=h.cell,x=h.displace,k=h.color,T=e,_=T.some(function(t){return"edges"===t.op})?"":" col *= 1.0 - edge * 0.55;",P=T.some(function(t){return(p[t.op]||{}).chroma})?r?"\n vec2 cdev = vec2(chroma.x, chroma.y);\n col.r = nodSampleAt(sampleP + cdev).r;\n col.b = nodSampleAt(sampleP - cdev).b;":"\n vec2 cpx = vec2(chroma.x, -chroma.y) / u_res;\n col.r = texture2D(u_tex, clamp(uv + cpx, 0.001, 0.999)).r;\n col.b = texture2D(u_tex, clamp(uv - cpx, 0.001, 0.999)).b;":"",A=n?"u_probe + vec2(0.5)":"gl_FragCoord.xy";return"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_res;\nuniform vec2 u_mouse;\nuniform float u_time;\nuniform float u_t; // phase T1: transition progress, 0..1\n\n// Op uniforms are declared HERE, above the transition helpers, because a\n// per-side op's code is emitted inside nodSampleAt. GLSL requires\n// declaration before use, and with the declarations further down every\n// sided op failed to compile with \"'u0_amount' : undeclared identifier\".\n".concat(n?"uniform vec2 u_probe;\n":"").concat(i,"\n").concat(r?"\n// ── phase T2: transition mode ──────────────────────────────────────\n// Two captures instead of one. u_tex is the NEW element, u_old the\n// frozen OLD one, and u_box is the content box they are both drawn\n// into — lerped from the old rect to the new rect by u_t. So geometry\n// (the box) and pixels (the effect chain) stay separate problems, which\n// is the split View Transitions also makes and the one that keeps this\n// maintainable.\nuniform sampler2D u_old;\n".concat(r&&r.newImage?"uniform sampler2D u_newimg;":"",'\n// Phase T2, gap 2. TWO boxes, not one. With a single shared box the\n// only expressible motion is "both sides march together", so the classic\n// "old slides out while new slides in" was impossible. Each capture now\n// interpolates in its own rect, which keeps per-side motion in the\n// GEOMETRY tier (P-3) instead of needing per-side op scoping.\nuniform vec4 u_boxOld; // x, y, w, h — device px, top-down\nuniform vec4 u_boxNew;\n\n// sRGB <-> linear. A naive crossfade in gamma space dips visibly in\n// brightness at mid-fade on photographic content; this is the classic\n// artifact and it is why the mix below is not just mix().\nvec3 nodToLinear(vec3 c) { return pow(c, vec3(2.2)); }\nvec3 nodToSRGB(vec3 c) { return pow(c, vec3(1.0 / 2.2)); }\n\n// Premultiplied, so anti-aliased edges over transparency do not pick up\n// a dark halo as the two sides cross.\nvec4 nodBlend(vec4 a, vec4 b, float t, float d) {\n vec3 pa = nodToLinear(a.rgb) * a.a;\n vec3 pb = nodToLinear(b.rgb) * b.a;\n').concat("morph"===o?"\n // MORPH — a per-pixel CHOICE, not a mix. d is a stable hash of the\n // output pixel, so each pixel flips from old to new at its own point\n // in t. At any instant almost every pixel is showing exactly ONE\n // side, and the two contents are never both legible at once.\n //\n // A uniform crossfade cannot do this: at t=0.5 it is by definition\n // 50% of each, which reads as a double exposure the moment the two\n // states differ much — a wide nav bar and a small card, say.\n float k = smoothstep(d - 0.12, d + 0.12, t);\n vec3 pm = pa * (1.0 - k) + pb * k;\n float al = a.a * (1.0 - k) + b.a * k;":"dissolve"===o?'\n // DISSOLVE — a true cross-dissolve: alpha lerps between the two.\n // Correct, and the right choice when one side really should fade to\n // nothing. Wrong for a shape morph, because any region covered by\n // only ONE side is translucent for the whole transition and the\n // morph reads as "everything is disappearing".\n vec3 pm = mix(pa, pb, t);\n float al = mix(a.a, b.a, t);':"\n // OPAQUE (default) — the colour crosses over without the shape\n // thinning out. The coverage-weighted lerp already gives that for\n // free, and it is worth seeing why:\n //\n // both sides cover a.a = b.a = 1 -> w = 1 at every t. Solid\n // throughout. No mid-fade.\n // only the old b.a = 0 -> w = 1-t. Releases.\n // only the new a.a = 0 -> w = t. Arrives.\n //\n // So one expression covers the union case AND each side's release,\n // linearly, with no curve to pop against.\n vec3 pm = pa * (1.0 - t) + pb * t;\n float al = a.a * (1.0 - t) + b.a * t;","\n return vec4(nodToSRGB(pm / max(al, 1e-4)), al);\n}\n\n// EVERY fetch in transition mode goes through here. A displace-stage op\n// that sampled u_tex directly — aberration does exactly that for its\n// per-channel taps — would show fringes from the new capture only, with\n// the old one silently absent from those channels.\n// Takes a position in DEVICE PX (sampleP space), not uv, because the two\n// captures no longer share a uv. Each is mapped through its own box and\n// masked to it, then blended.\nvec2 nodBoxUV(vec4 box, vec2 p) {\n return vec2((p.x - box.x) / max(box.z, 1.0),\n 1.0 - (p.y - box.y) / max(box.w, 1.0));\n}\nfloat nodInBox(vec2 uv) {\n return step(0.0, uv.x) * step(uv.x, 1.0) * step(0.0, uv.y) * step(uv.y, 1.0);\n}\nvec4 nodSampleAt(vec2 p) {\n vec2 uo = nodBoxUV(u_boxOld, p);\n vec2 un = nodBoxUV(u_boxNew, p);\n vec4 o = texture2D(u_old, clamp(uo, 0.001, 0.999));\n // With newImage the new side is a capture of the ELEMENT, so both\n // sides can travel between their own rects and converge into one\n // shape. Without it the new side is the HOST capture, which can only\n // be mapped 1:1 — the destination then sits at its final place from\n // t=0 while the old shrinks toward it, and the result reads as two\n // things on screen at once rather than one thing morphing.\n vec4 n = texture2D(").concat(r&&r.newImage?"u_newimg":"u_tex",",\n clamp(un, 0.001, 0.999));\n o.a *= nodInBox(uo);\n n.a *= nodInBox(un);\n").concat(m).concat(v,"\n // The threshold each pixel flips at. Mostly a COHERENT ramp down the\n // box with a little grain on top — pure white noise chooses correctly\n // (never two legible images at once) but reads as television static\n // rather than as one thing becoming another. The ramp makes it a\n // wipe; the grain keeps the edge from looking like a ruler.\n float grain = fract(sin(dot(floor(p / 3.0), vec2(12.9898, 78.233))) * 43758.5453);\n float ramp = clamp(un.y, 0.0, 1.0);\n float d = ramp * 0.82 + grain * 0.18;\n return nodBlend(o, n, u_t, d);\n}"):"","\nvoid main() {\n vec2 fc = ").concat(A,";\n vec2 frag = vec2(fc.x, u_res.y - fc.y);\n").concat(l,"\n").concat(b,"\n vec2 warped = frag;\n").concat(g,"\n vec2 center = warped;\n float edge = 0.0;\n").concat(w,"\n vec2 sampleP = warped;\n vec2 chroma = vec2(0.0);\n").concat(x).concat(n?"\n vec2 q = clamp(sampleP / u_res, 0.0, 1.0) * 255.0;\n vec2 hi = floor(q);\n vec2 lo = floor(fract(q) * 255.0);\n gl_FragColor = vec4(hi.x, lo.x, hi.y, lo.y) / 255.0;\n}":"\n".concat(r?"\n // uv stays defined, as the NEW box's, for ops that reference it.\n vec2 uv = nodBoxUV(u_boxNew, sampleP);\n vec4 tex = nodSampleAt(sampleP);":"\n vec2 uv = vec2(sampleP.x / u_res.x, 1.0 - sampleP.y / u_res.y);\n vec4 tex = texture2D(u_tex, clamp(uv, 0.001, 0.999));","\n vec3 col = tex.rgb;").concat(P,"\n vec3 edgeCol = vec3(1.0);\n float edgeCov = 0.0;\n vec3 ovCol = vec3(0.0);\n float ovA = 0.0;\n").concat(k,"\n").concat(_,"\n // content OVER border\n float baseA = tex.a + edgeCov * (1.0 - tex.a);\n vec3 baseRGB = (col * tex.a + edgeCol * edgeCov * (1.0 - tex.a)) / max(baseA, 1e-4);\n // overlay OVER (content+border)\n float outA = ovA + baseA * (1.0 - ovA);\n vec3 outRGB = (ovCol * ovA + baseRGB * baseA * (1.0 - ovA)) / max(outA, 1e-4);\n gl_FragColor = vec4(outRGB, outA);\n}"))}var A=/\d(?:vw|vh|vmin|vmax|dvw|dvh|svw|svh|lvw|lvh)\b/i,R=["color","font-family","font-size","font-weight","font-style","line-height","letter-spacing","text-align","text-transform","text-decoration-color","white-space","word-break"],M=["background-color","background-image","background-size","background-position","background-repeat","background-clip","border-radius","box-shadow","opacity","outline-color"],F=new Set(["none","rgba(0, 0, 0, 0)","transparent","0px","auto","1","repeat","0% 0%","border-box","0% 0% / auto repeat scroll padding-box border-box"]);var I={coarse:"(pointer: coarse)",fine:"(pointer: fine)",hover:"(hover: hover)","no-hover":"(hover: none)","reduced-motion":"(prefers-reduced-motion: reduce)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};function D(t){if("function"==typeof t)try{return!!t()}catch(t){return!1}if("boolean"==typeof t)return t;if("string"!=typeof t||""===t)return!1;var e=I[t]||t;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return!1;try{return window.matchMedia(e).matches}catch(t){return!1}}function L(t,e){if(!Array.isArray(t))return[];if((e||0)>8)return[];var n,r=[],o=l(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&"switch"===i.op){var a,s=l(L((D(i.when)?i.use:i.else)||[],(e||0)+1));try{for(s.s();!(a=s.n()).done;){var c=a.value;r.push(c)}}catch(t){s.e(t)}finally{s.f()}}else r.push(i)}}catch(t){o.e(t)}finally{o.f()}return r}var z=new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),W=["objectFit","objectPosition","borderRadius","imageRendering","filter"],B=new Set,N=["op","masked","live"],U=!1;function G(t,e,n){var r=e,o=n&&n.transition||null;if(!t||"undefined"==typeof document||"undefined"==typeof window)return null;if(!(e&&0!==e.length||o))return null;if(e||(e=[]),e.some(function(t){return t&&"switch"===t.op})&&0===(e=L(e,0)).length&&!o)return null;var i=[],u=_(e,i);if(e=i,"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return null;if(z.has(t.tagName)){var f=t.parentElement&&t.parentElement.hasAttribute&&t.parentElement.hasAttribute("data-nodality-raster-host")?t.parentElement:null;if(t=f||function(t){if(!t.parentNode)return null;var e,n={},r=l(W);try{for(r.s();!(e=r.n()).done;){var o=e.value;t.style[o]&&(n[o]=t.style[o])}}catch(t){r.e(t)}finally{r.f()}var i=document.createElement("div");return i.setAttribute("data-nodality-raster-host",t.tagName.toLowerCase()),i.style.cssText=t.style.cssText,t.parentNode.insertBefore(i,t),i.appendChild(t),t.removeAttribute("style"),Object.assign(t.style,n),t.style.display="block",t.style.width="100%",t.style.height="100%","static"===("function"==typeof getComputedStyle?getComputedStyle(i).position:"static")&&(i.style.position="relative"),i.style.width||(i.style.width="100%"),i.style.height||(i.style.height="100%"),i}(t),!t)return null}if(t.querySelector&&t.querySelector(":scope > canvas[data-nodality-raster]"))return null;var y=function(){var e=t.getBoundingClientRect();return{width:e.width>=2?e.width:t.scrollWidth||0,height:e.height>=2?e.height:t.scrollHeight||0}},m=y();if(m.width<2||m.height<2)return null;var v=Math.max(1,Math.min(n&&n.resolution?n.resolution:window.devicePixelRatio||1,3)),x=e.some(function(t){return(p[t.op]||{}).overlay}),O=e.length>0&&!o&&e.every(function(t){return(p[t.op]||{}).overlay}),S=!(!o||!0!==o.live),j=!O&&(!o||S)&&!e.some(function(t){return!1===t.live}),T="undefined"!=typeof WebGL2RenderingContext&&"texElementImage2D"in WebGL2RenderingContext.prototype||"undefined"!=typeof WebGLRenderingContext&&"texElementImage2D"in WebGLRenderingContext.prototype,C=j&&T;j&&!C&&console.info("[nodality] HTML-in-Canvas API not available - raster ops fall back to snapshot capture.");var I=document.createElement("canvas");C&&I.setAttribute("layoutsubtree","");var D={alpha:!0,premultipliedAlpha:!1},H=I.getContext("webgl2",D)||I.getContext("webgl",D);if(!H)return null;var X="undefined"!=typeof WebGL2RenderingContext&&H instanceof WebGL2RenderingContext,q=X&&e.some(function(t){return(p[t.op]||{}).mips});C&&!("texElementImage2D"in H)&&(console.info("[nodality] texElementImage2D missing on the created context - snapshot fallback."),I.removeAttribute("layoutsubtree"),C=!1),"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),I.width=Math.round(m.width*v),I.height=Math.round(m.height*v),I.setAttribute("data-nodality-raster",C?"live":"snapshot"),console.info("[nodality] raster backend:",C?"html-in-canvas (live)":"snapshot");var J={width:m.width,height:m.height},V=t;if(C){var $=document.createElement("div"),Y=getComputedStyle(t),Q="flex"===Y.display||"inline-flex"===Y.display,K="grid"===Y.display||"inline-grid"===Y.display,Z=function(t){return parseFloat(t)||0},tt=Z(Y.paddingLeft)+Z(Y.paddingRight),et=Z(Y.paddingTop)+Z(Y.paddingBottom);for(J.width=Math.max(2,m.width-tt),J.height=Math.max(2,m.height-et),$.style.cssText="display:".concat(Q||K?Y.display:"block",";")+"width:".concat(J.width,"px;height:").concat(J.height,"px;"),K&&($.style.gridTemplateColumns=Y.gridTemplateColumns,$.style.gridTemplateRows=Y.gridTemplateRows,$.style.gridTemplateAreas=Y.gridTemplateAreas,$.style.gap=Y.gap,$.style.alignItems=Y.alignItems,$.style.justifyItems=Y.justifyItems),Q&&($.style.flexDirection=Y.flexDirection,$.style.alignItems=Y.alignItems,$.style.justifyContent=Y.justifyContent,$.style.gap=Y.gap);t.firstChild;)$.appendChild(t.firstChild);I.appendChild($),V=$,I.style.cssText="display:block;width:".concat(J.width,"px;height:").concat(J.height,"px;")}else if(I.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(m.width,"px;height:").concat(m.height,"px;")+"pointer-events:none;z-index:2147483000;",O)I.setAttribute("aria-hidden","true");else{I.setAttribute("role","img");var nt=(t.textContent||"").replace(/\s+/g," ").trim();nt&&I.setAttribute("aria-label",nt.slice(0,300))}t.appendChild(I);var rt=function(t,e){var n=H.createShader(t);if(H.shaderSource(n,e),H.compileShader(n),!H.getShaderParameter(n,H.COMPILE_STATUS))throw new Error("[nodality] raster shader: "+H.getShaderInfoLog(n));return n},ot=H.createProgram();H.attachShader(ot,rt(H.VERTEX_SHADER,k)),H.attachShader(ot,rt(H.FRAGMENT_SHADER,P(u,e,!1,o))),H.bindAttribLocation(ot,0,"a"),H.linkProgram(ot),H.useProgram(ot),H.bindBuffer(H.ARRAY_BUFFER,H.createBuffer()),H.bufferData(H.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),H.STATIC_DRAW),H.enableVertexAttribArray(0),H.vertexAttribPointer(0,2,H.FLOAT,!1,0,0);var it=function(t){return H.getUniformLocation(ot,t)},at=function(t,e,n){"1f"===e?H.uniform1f(t,n):"1i"===e?H.uniform1i(t,n):"2fv"===e?H.uniform2fv(t,n):"3fv"===e&&H.uniform3fv(t,n)},st=0,lt=e.map(function(t,e){return{node:t,i:e}}).filter(function(t){return function(t){for(var e in t)if(b(t.op,e,t[e]))return!0;return!1}(t.node)}),ct=function(t,n){e.forEach(function(e,r){if(!n||n.has(r)){var o=p[e.op];if(o&&o.uniforms){var i=o.uniforms(function(t,e){var n=null,r=t.window||t.ease?function(t,e){var n=Math.min(1,Math.max(0,e)),r=t.window;Array.isArray(r)&&2===r.length&&r[1]!==r[0]&&(n=Math.min(1,Math.max(0,(n-r[0])/(r[1]-r[0]))));var o=t.ease&&w[t.ease];return o?o(n):n}(t,e):e;for(var o in t)b(t.op,o,t[o])&&((n=n||Object.assign({},t))[o]=g(t[o],r));return n||t}(e,st),v);for(var a in i)at(t("u".concat(r,"_").concat(a)),i[a][0],i[a][1])}}})};ct(it);var ut=new Set(lt.map(function(t){return t.i})),ft=[];e.forEach(function(t,e){var n=p[t.op];n&&"function"==typeof n.init&&ft.push({i:e,def:n,state:n.init(t,v,I.width,I.height)})});var dt="undefined"!=typeof performance?performance.now():0,ht=[];e.forEach(function(t,e){var n=p[t.op];if(n&&n.solver){var r=function(t,e){var n=p[t.op];if(!X||!H.getExtension("EXT_color_buffer_float"))return console.info("[nodality] '"+t.op+"' needs WebGL2 float render targets - op skipped."),null;H.getExtension("OES_texture_float_linear");var r=n.solver.resolutions(t,I.width,I.height),o={r:[H.R16F,H.RED],rg:[H.RG16F,H.RG],rgba:[H.RGBA16F,H.RGBA]},i=[],a=function(t,e,n,r){var a=c(o[n],2),s=a[0],l=a[1],u=H.createTexture();H.bindTexture(H.TEXTURE_2D,u);var f=r?H.LINEAR:H.NEAREST;H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,f),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,f),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE),H.texImage2D(H.TEXTURE_2D,0,s,t,e,0,l,H.HALF_FLOAT,null);var d=H.createFramebuffer();H.bindFramebuffer(H.FRAMEBUFFER,d),H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,u,0);var h=H.checkFramebufferStatus(H.FRAMEBUFFER)===H.FRAMEBUFFER_COMPLETE;H.viewport(0,0,t,e),H.clearColor(0,0,0,1),H.clear(H.COLOR_BUFFER_BIT);var p={tex:u,fbo:d,w:t,h:e,ok:h};return i.push(p),p},s={},l=!0;for(var u in n.solver.targets){var f=n.solver.targets[u],d=r[f.res],h=c(Array.isArray(d)?d:[d,d],2),y=h[0],m=h[1];f.double?(s[u]={a:a(y,m,f.fmt,f.smooth),b:a(y,m,f.fmt,f.smooth)},l=l&&s[u].a.ok&&s[u].b.ok):(s[u]={a:a(y,m,f.fmt,f.smooth)},l=l&&s[u].a.ok)}H.bindFramebuffer(H.FRAMEBUFFER,null);var v=function(){return i.forEach(function(t){H.deleteFramebuffer(t.fbo),H.deleteTexture(t.tex)})};if(!l)return console.info("[nodality] '"+t.op+"' float targets incomplete - op skipped."),v(),null;var b={};try{for(var g in n.solver.programs){var w=H.createProgram();if(H.attachShader(w,rt(H.VERTEX_SHADER,k)),H.attachShader(w,rt(H.FRAGMENT_SHADER,n.solver.programs[g])),H.bindAttribLocation(w,0,"a"),H.linkProgram(w),!H.getProgramParameter(w,H.LINK_STATUS))throw new Error(g+": "+H.getProgramInfoLog(w));b[g]={prog:w,loc:{}}}}catch(e){for(var x in console.warn("[nodality] '"+t.op+"' solver programs failed:",e),v(),b)H.deleteProgram(b[x].prog);return null}return H.useProgram(ot),{i:e,node:t,def:n,res:r,targets:s,progs:b,cleanup:v,prevX:.5,prevY:.5,primed:!1}}(t,e);r&&ht.push(r)}});var pt=function(t,e){var n=null,r={res:t.res,use:function(e){n=t.progs[e],H.useProgram(n.prog)},u:function(t){return t in n.loc||(n.loc[t]=H.getUniformLocation(n.prog,t)),n.loc[t]},f1:function(t,e){H.uniform1f(r.u(t),e)},f2:function(t,e,n){H.uniform2f(r.u(t),e,n)},f3:function(t,e,n,o){H.uniform3f(r.u(t),e,n,o)},smp:function(t,e,n){H.activeTexture(H.TEXTURE0+n),H.bindTexture(H.TEXTURE_2D,e.tex),H.uniform1i(r.u(t),n)},read:function(e){return t.targets[e].a},write:function(e){return t.targets[e].b},single:function(e){return t.targets[e].a},content:{tex:yt},canvasW:I.width,canvasH:I.height,swap:function(e){var n=t.targets[e],r=n.a;n.a=n.b,n.b=r},blit:function(t){H.bindFramebuffer(H.FRAMEBUFFER,t.fbo),H.viewport(0,0,t.w,t.h),H.drawArrays(H.TRIANGLES,0,3)}},o=Rt[0]/I.width,i=1-Rt[1]/I.height,a=0,s=0;t.primed&&Mt&&(a=(o-t.prevX)/Math.max(e,.001),s=(i-t.prevY)/Math.max(e,.001)),t.prevX=o,t.prevY=i,t.primed=!0;var l=Mt&&Math.abs(a)+Math.abs(s)>.001;t.def.solver.step(r,t.node,{dt:e,px:o,py:i,dx:a,dy:s,moving:l,aspect:I.width/Math.max(I.height,1),col:t.def.solver.splatColor(t.node,a,s)})},yt=H.createTexture();H.bindTexture(H.TEXTURE_2D,yt),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,q?H.LINEAR_MIPMAP_LINEAR:H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,!0);var mt=function(){q&&H.generateMipmap(H.TEXTURE_2D)},vt=!1,bt=null,gt=null;if(o&&o.oldImage){bt=H.createTexture(),H.bindTexture(H.TEXTURE_2D,bt),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE);try{H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,o.oldImage)}catch(t){console.warn("[nodality] transition: old capture upload failed:",t),H.deleteTexture(bt),bt=null}}if(o&&o.newImage){gt=H.createTexture(),H.bindTexture(H.TEXTURE_2D,gt),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE);try{H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,o.newImage)}catch(t){console.warn("[nodality] transition: new capture upload failed:",t),H.deleteTexture(gt),gt=null}}var wt=!1,xt=C?"live":"snapshot",kt=!1,Ot={color:"transparent","-webkit-text-fill-color":"transparent","-webkit-text-stroke-color":"transparent","background-color":"transparent","background-image":"none","border-color":"transparent","box-shadow":"none","text-shadow":"none"},St=null,Et=function(){if(!St){!function(){if(!U&&"undefined"!=typeof document){U=!0;var t=document.createElement("style");t.setAttribute("data-nodality","selection"),t.textContent="[data-nodality-ink]::selection,[data-nodality-ink] *::selection{color:var(--nod-ink);-webkit-text-fill-color:var(--nod-ink)}[data-nodality-ink]::-moz-selection,[data-nodality-ink] *::-moz-selection{color:var(--nod-ink);-webkit-text-fill-color:var(--nod-ink)}",(document.head||document.documentElement).appendChild(t)}}(),St=[],t.setAttribute("data-nodality-ink","");for(var e=[t].concat(a(t.querySelectorAll("*"))).filter(function(t){return t!==I&&"CANVAS"!==t.tagName}),n=e.map(function(t){return getComputedStyle(t).color}),r=0;r<e.length;r++){var o=e[r],i={op:o.style.getPropertyValue("opacity"),ink:o.style.getPropertyValue("--nod-ink")};for(var s in Ot)i[s]=o.style.getPropertyValue(s);for(var l in St.push([o,i]),o.style.setProperty("--nod-ink",n[r]),Ot)o.style.setProperty(l,Ot[l],"important");o!==t&&o.matches&&o.matches("img,svg,video,picture,iframe")&&o.style.setProperty("opacity","0","important")}t.style.isolation="isolate",I.style.zIndex="-1"}},jt=function(){if(t.style.visibility="",t.removeAttribute("data-nodality-ink"),St){var e,n=l(St);try{for(n.s();!(e=n.n()).done;){var r=c(e.value,2),o=r[0],i=r[1];for(var a in Ot)i[a]?o.style.setProperty(a,i[a]):o.style.removeProperty(a);i.op?o.style.setProperty("opacity",i.op):o.style.removeProperty("opacity"),i.ink?o.style.setProperty("--nod-ink",i.ink):o.style.removeProperty("--nod-ink")}}catch(t){n.e(t)}finally{n.f()}St=null,t.style.isolation="",I.style.zIndex=""}},Tt=function(){if(!o)return!1;var e=st>=1,n=V!==t,r=o.standDownAtStart&&st<=0,i=e&&!n||r?"hidden":"visible";return I.style.visibility!==i&&(I.style.visibility=i),e||r?St&&jt():St||Et(),!0},_t=function(){if(x){var e=function(){var e="IMG"===t.tagName?t:t.querySelector?t.querySelector("img"):null;return e&&e.complete&&e.naturalWidth>0?e:null}();if(e)try{return H.bindTexture(H.TEXTURE_2D,yt),H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,e),mt(),vt=!0,Promise.resolve()}catch(t){}else if(!kt){var n="IMG"===t.tagName?t:t.querySelector&&t.querySelector("img");n&&(kt=!0,n.addEventListener("load",function(){wt||_t()},{once:!0}))}}I.style.display="none",jt();var r=function(t,e,n,r){var o=function(t){if(!t)return null;var e=null;if("IMG"===t.tagName)e=t;else if(t.children){var n=Array.prototype.filter.call(t.children,function(t){return!t.hasAttribute||!t.hasAttribute("data-nodality-raster")});1===n.length&&"IMG"===n[0].tagName&&(e=n[0])}if(!e||!e.complete||!e.naturalWidth)return null;try{if(new URL(e.currentSrc||e.src,location.href).origin!==location.origin)return null}catch(t){return null}return e}(t);return o?Promise.resolve(function(t,e,n,r){var o=Math.max(1,Math.round(e*r)),i=Math.max(1,Math.round(n*r)),a=t.naturalWidth,s=t.naturalHeight;if(!a||!s)return t;var l="fill",c="50% 50%";if("function"==typeof getComputedStyle){var u=getComputedStyle(t);l=u.objectFit||"fill",c=u.objectPosition||"50% 50%"}if("fill"===l)return t;var f=o/a,d=i/s,h="cover"===l?Math.max(f,d):"contain"===l?Math.min(f,d):"none"===l?1:"scale-down"===l?Math.min(1,Math.min(f,d)):Math.max(f,d),p=a*h,y=s*h,m=String(c).trim().split(/\s+/),v=function(t,e){if(null==t)return.5;if(t.endsWith("%"))return parseFloat(t)/100;if("left"===t||"top"===t)return 0;if("right"===t||"bottom"===t)return 1;if("center"===t)return.5;var n=parseFloat(t);return isNaN(n)?.5:n/(0===e?Math.max(o-p,1):Math.max(i-y,1))},b=v(m[0],0),g=v(m.length>1?m[1]:m[0],1),w=document.createElement("canvas");w.width=o,w.height=i;var x=w.getContext("2d");return x?(x.drawImage(t,(o-p)*b,(i-y)*g,p,y),w):t}(o,e,n,r)):new Promise(function(o,i){var s=(new XMLSerializer).serializeToString(function(t,e){for(var n=[t].concat(a(t.querySelectorAll("*"))),r=[e].concat(a(e.querySelectorAll("*"))),o=0;o<n.length&&o<r.length;o++){var i=r[o].style;if(i){if(i.length>0)for(var s=null,c=0,u=Array.from(i);c<u.length;c++){var f=u[c];if(A.test(i.getPropertyValue(f))){var d=(s=s||window.getComputedStyle(n[o])).getPropertyValue(f);d&&i.setProperty(f,d,i.getPropertyPriority(f))}}var h,p=window.getComputedStyle(n[o]),y=n[o].parentElement,m=0!==o&&y?window.getComputedStyle(y):null,v=l(R);try{for(v.s();!(h=v.n()).done;){var b=h.value,g=p.getPropertyValue(b);g&&(m&&m.getPropertyValue(b)===g||i.getPropertyValue(b)||i.setProperty(b,g))}}catch(t){v.e(t)}finally{v.f()}var w,x=l(M);try{for(x.s();!(w=x.n()).done;){var k=w.value;if(!i.getPropertyValue(k)){var O=p.getPropertyValue(k);O&&!F.has(O)&&i.setProperty(k,O)}}}catch(t){x.e(t)}finally{x.f()}}}return e}(t,t.cloneNode(!0))),c='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(e*r,'" height="').concat(n*r,'" viewBox="0 0 ').concat(e," ").concat(n,'">')+'<foreignObject width="100%" height="100%">'+'<div xmlns="http://www.w3.org/1999/xhtml">'.concat(s,"</div>")+"</foreignObject></svg>",u=document.createElement("img");u.onload=function(){return o(u)},u.onerror=i,u.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(c)})}(t,m.width,m.height,v).then(function(t){wt||(H.bindTexture(H.TEXTURE_2D,yt),H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,t),mt(),vt=!0,Tt()||(O||Et(),I.style.visibility="visible"))}).catch(function(t){jt(),console.warn("[nodality] raster snapshot failed:",t)});return I.style.display="",r},Ct=-1,Pt=function(){if(!wt&&"live"===xt){H.bindTexture(H.TEXTURE_2D,yt);var t,e=H.RGBA8||32856,n=[[H.TEXTURE_2D,e,V],[H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,V],[H.TEXTURE_2D,0,e,V],[H.TEXTURE_2D,0,V]];if(Ct>=0)t=[Ct];else{t=[0,1,2,3];var r={3:0,6:1,4:2}[H.texElementImage2D.length];null!=r&&(t.splice(t.indexOf(r),1),t.unshift(r))}var o,i=[],a=l(t);try{for(a.s();!(o=a.n()).done;){var s=o.value;try{return H.texElementImage2D.apply(H,n[s]),mt(),Ct<0&&(Ct=s,console.info("[nodality] texElementImage2D signature discovered: form",s,"(declared arity "+H.texElementImage2D.length+")")),void(vt=!0)}catch(t){i.push("form"+s+" -> "+(t&&t.name?t.name:"?")+": "+(t&&t.message?t.message:t))}}}catch(t){a.e(t)}finally{a.f()}At("texElementImage2D rejected all known signatures (arity "+H.texElementImage2D.length+"): "+i.join(" | "))}},At=function(e){if(!wt&&"live"===xt){for(xt="snapshot",console.warn("[nodality] live raster backend failed ("+e+") - falling back to snapshot."),I.removeEventListener("paint",Pt);V.firstChild;)t.appendChild(V.firstChild);V.parentNode===I&&I.removeChild(V),I.removeAttribute("layoutsubtree"),I.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(m.width,"px;height:").concat(m.height,"px;")+"pointer-events:none;z-index:2147483000;",I.setAttribute("aria-hidden","true"),I.setAttribute("data-nodality-raster","snapshot-fallback"),_t()}};C&&(I.addEventListener("paint",Pt),setTimeout(function(){wt||"live"!==xt||vt||At("no paint event within 1500ms")},1500));var Rt=[.5*I.width,.5*I.height],Mt=!1,Ft=function(t){var e=I.getBoundingClientRect(),n=t.touches?t.touches[0]:t,r=[(n.clientX-e.left)*v,(n.clientY-e.top)*v];r[0]===Rt[0]&&r[1]===Rt[1]||(Mt=!0),Rt=r};t.addEventListener("mousemove",Ft,{passive:!0}),t.addEventListener("touchmove",Ft,{passive:!0});var It=0,Dt=0,Lt=function(){It=1},zt=function(){It=0};t.addEventListener("mouseenter",Lt,{passive:!0}),t.addEventListener("mouseleave",zt,{passive:!0});var Wt=[];e.forEach(function(t,e){var n=p[t.op]||{},r=t.by||n.defaultDriver;r&&d[r]?Wt.push({i:e,fn:d[r]}):t.by&&console.warn("[nodality] unknown driver '"+t.by+"' on op '"+t.op+"' - known drivers: "+h.join(", "))});var Bt=function(){if("undefined"==typeof window)return.5;var e=t.getBoundingClientRect(),n=window.innerHeight||1;return Math.max(0,Math.min(1,(n-e.top)/(n+e.height)))},Nt=0,Ut=null,Gt=function(t,e){H.uniform2f(t("u_res"),e.res[0],e.res[1]),H.uniform2f(t("u_mouse"),e.mouse[0],e.mouse[1]),H.uniform1f(t("u_time"),e.time),H.uniform1f(t("u_t"),e.t);var n,r=l(e.drivers);try{for(r.s();!(n=r.n()).done;){var i=n.value;H.uniform2f(t("u".concat(i.i,"_dpos")),i.x,i.y),H.uniform1f(t("u".concat(i.i,"_damt")),i.amt)}}catch(t){r.e(t)}finally{r.f()}var a,s=l(e.dyn);try{for(s.s();!(a=s.n()).done;){var c,u=a.value,f=l(u.ups);try{for(f.s();!(c=f.n()).done;){var d=c.value;at(t("u".concat(u.i,"_").concat(d.name)),d.kind,d.value)}}catch(t){f.e(t)}finally{f.f()}}}catch(t){s.e(t)}finally{s.f()}H.activeTexture(H.TEXTURE0),H.bindTexture(H.TEXTURE_2D,yt),H.uniform1i(t("u_tex"),0);var h=1;if(o&&bt){H.activeTexture(H.TEXTURE0+h),H.bindTexture(H.TEXTURE_2D,bt),H.uniform1i(t("u_old"),h),h++;var p=e.t,y=function(t,e){return[(t.x+(e.x-t.x)*p)*v,(t.y+(e.y-t.y)*p)*v,(t.w+(e.w-t.w)*p)*v,(t.h+(e.h-t.h)*p)*v]},m=y(o.oldRect,o.oldTo||o.newRect),b=y(o.newFrom||o.oldRect,o.newRect);H.uniform4f(t("u_boxOld"),m[0],m[1],m[2],m[3]),H.uniform4f(t("u_boxNew"),b[0],b[1],b[2],b[3]),gt&&(H.activeTexture(H.TEXTURE0+h),H.bindTexture(H.TEXTURE_2D,gt),H.uniform1i(t("u_newimg"),h),h++)}for(var g=0,w=ht;g<w.length;g++){var x=w[g],k=x.def.solver.samplers;for(var O in k)H.activeTexture(H.TEXTURE0+h),H.bindTexture(H.TEXTURE_2D,x.targets[k[O]].a.tex),H.uniform1i(t("u".concat(x.i,"_").concat(O)),h),h++}H.activeTexture(H.TEXTURE0)},Ht=null,Xt=["warp","cell","displace"],qt=function(t,n,r){if(wt||!Ut||!vt)return null;var i=I.getBoundingClientRect();if(i.width&&i.height&&(!r||!r.gpu)){var a=I.width/i.width,s=I.height/i.height,c=(t-i.left)*a,f=(n-i.top)*s;if(c>=0&&f>=0&&c<I.width&&f<I.height){var d=Math.floor(c),h=Math.floor(I.height-f),y=function(t,n){if(!Ut)return null;var r,o={},i=l(Ut.drivers);try{for(i.s();!(r=i.n()).done;){var a=r.value;o[a.i]=a}}catch(t){i.e(t)}finally{i.f()}for(var s=[t,n],c=0,u=Xt;c<u.length;c++)for(var f=u[c],d=0;d<e.length;d++){var h=e[d],y=p[h.op];if(y&&(Array.isArray(y.stage)?y.stage:[y.stage]).includes(f)){if(E(h))return null;if("function"!=typeof y.map){if(!1===y.movesCoords)continue;return null}var m=o[d],b=y.map(s,h,{res:Ut.res,dpr:v,dpos:m?[m.x,m.y]:[Ut.res[0]/2,Ut.res[1]/2],damt:m?m.amt:1,time:Ut.time,mouse:Ut.mouse});if(!b)return null;s=b}}return s}(d+.5,I.height-h-.5);if(y)return{x:i.left+Math.min(Math.max(y[0],0),I.width)/a,y:i.top+Math.min(Math.max(y[1],0),I.height)/s}}}var m=function(){if(Ht)return Ht;var t=H.createProgram();if(H.attachShader(t,rt(H.VERTEX_SHADER,k)),H.attachShader(t,rt(H.FRAGMENT_SHADER,P(u,e,!0,o))),H.bindAttribLocation(t,0,"a"),H.linkProgram(t),!H.getProgramParameter(t,H.LINK_STATUS))return console.warn("[nodality] probe program failed:",H.getProgramInfoLog(t)),H.deleteProgram(t),Ht={broken:!0};var n=H.createTexture();H.bindTexture(H.TEXTURE_2D,n),H.texImage2D(H.TEXTURE_2D,0,H.RGBA,1,1,0,H.RGBA,H.UNSIGNED_BYTE,null),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,H.NEAREST),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,H.NEAREST),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE);var r=H.createFramebuffer();H.bindFramebuffer(H.FRAMEBUFFER,r),H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,n,0);var i=H.checkFramebufferStatus(H.FRAMEBUFFER);if(H.bindFramebuffer(H.FRAMEBUFFER,null),i!==H.FRAMEBUFFER_COMPLETE)return console.warn("[nodality] probe framebuffer incomplete:",i),H.deleteProgram(t),H.deleteFramebuffer(r),H.deleteTexture(n),Ht={broken:!0};var a={},s=function(e){return e in a?a[e]:a[e]=H.getUniformLocation(t,e)};return H.useProgram(t),ct(s),H.useProgram(ot),Ht={prog:t,fbo:r,tex:n,px:new Uint8Array(4),U:s}}();if(m.broken)return null;var b=I.getBoundingClientRect();if(!b.width||!b.height)return null;var g=I.width/b.width,w=I.height/b.height,x=(t-b.left)*g,O=(n-b.top)*w;if(x<0||O<0||x>=I.width||O>=I.height)return null;var S=Math.floor(x),j=Math.floor(I.height-O);H.bindFramebuffer(H.FRAMEBUFFER,m.fbo),H.useProgram(m.prog),H.viewport(0,0,1,1),H.uniform2f(m.U("u_probe"),S,j),Gt(m.U,Ut),H.drawArrays(H.TRIANGLES,0,3),H.readPixels(0,0,1,1,H.RGBA,H.UNSIGNED_BYTE,m.px),H.bindFramebuffer(H.FRAMEBUFFER,null),H.useProgram(ot),H.viewport(0,0,I.width,I.height);var T=m.px,_=(T[0]+T[1]/255)/255,C=(T[2]+T[3]/255)/255;return{x:b.left+_*I.width/g,y:b.top+C*I.height/w}},Jt="__nodalityRetargeted",Vt=!e.some(function(t){return!1===t.interactive}),$t="data-nodality-hover",Yt=e.some(function(t){return!0===t.hoverAttr}),Qt=[],Kt=function(e){for(var n=[],r=e;r&&r!==t.parentNode;r=r.parentElement)n.push(r);for(var o=new Set(n),i=0,a=Qt;i<a.length;i++){var s=a[i];o.has(s)||s.removeAttribute($t)}for(var l=0,c=n;l<c.length;l++){var u=c[l];u.hasAttribute($t)||u.setAttribute($t,"")}Qt=n},Zt=0,te=function(e){if(Vt&&!wt&&!e[Jt]){if("pointermove"===e.type||"mousemove"===e.type){var n="undefined"!=typeof performance?performance.now():0;if(n-Zt<12)return;Zt=n}var r=qt(e.clientX,e.clientY);if(r){var o=V!==t;if(!(!o&&Math.abs(r.x-e.clientX)<.5&&Math.abs(r.y-e.clientY)<.5)){var i,a,s,c,u=o?(i=r.x,a=r.y,s=null,(c=function(t){var e,n=l(t.children);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=r.getBoundingClientRect();o.width&&o.height&&(i<o.left||i>o.right||a<o.top||a>o.bottom||(s=r,c(r)))}}catch(t){n.e(t)}finally{n.f()}})(V),s):"function"==typeof document.elementFromPoint?document.elementFromPoint(r.x,r.y):null;if(u&&u!==e.target&&t.contains(u)){if(Yt&&Kt(u),"pointerdown"===e.type||"mousedown"===e.type||"click"===e.type){var f=u.closest&&u.closest("a, button, input, select, textarea, [tabindex]");f&&"function"==typeof f.focus&&f.focus({preventScroll:!0})}e.stopPropagation(),e.cancelable&&e.preventDefault(),u.dispatchEvent(function(t,e,n){var r=new("undefined"!=typeof PointerEvent&&t instanceof PointerEvent?PointerEvent:MouseEvent)(t.type,{bubbles:!0,cancelable:t.cancelable,composed:!0,view:t.view||("undefined"!=typeof window?window:null),detail:t.detail,clientX:e,clientY:n,screenX:t.screenX+(e-t.clientX),screenY:t.screenY+(n-t.clientY),ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey,button:t.button,buttons:t.buttons,relatedTarget:t.relatedTarget,pointerId:t.pointerId,pointerType:t.pointerType,isPrimary:t.isPrimary,pressure:t.pressure});return r[Jt]=!0,r}(e,r.x,r.y))}}}}},ee=["pointerdown","pointerup","pointermove","click","dblclick","contextmenu","mousedown","mouseup"],ne=function(){Yt&&Kt(null)};if(Vt){var re,oe=l(ee);try{for(oe.s();!(re=oe.n()).done;){var ie=re.value;t.addEventListener(ie,te,!0)}}catch(t){oe.e(t)}finally{oe.f()}t.addEventListener("pointerleave",ne,!0)}var ae=!0,se=function(){if(!wt){if(Tt(),ae&&vt){for(var t="undefined"!=typeof performance?performance.now():dt+16,e=Math.max(0,(t-dt)/1e3),n=0,r=ht;n<r.length;n++){var o=r[n];pt(o,e)}Mt=!1,H.bindFramebuffer(H.FRAMEBUFFER,null),H.useProgram(ot),H.viewport(0,0,I.width,I.height),H.clearColor(0,0,0,0),H.clear(H.COLOR_BUFFER_BIT);var i={res:[I.width,I.height],mouse:[Rt[0],Rt[1]],time:t/1e3,t:st,drivers:[],dyn:[]};if(Wt.length>0){Dt+=(It-Dt)*(1-Math.exp(8*-e));for(var a={mouseX:Rt[0],mouseY:Rt[1],w:I.width,h:I.height,t:t/1e3,hover:Dt,scroll:Bt()},s=0,l=Wt;s<l.length;s++){var c=l[s],u=c.fn(a);i.drivers.push({i:c.i,x:u.x,y:u.y,amt:u.amt})}}if(ft.length>0)for(var f={w:I.width,h:I.height,mouseX:Rt[0],mouseY:Rt[1],dt:e,t:t/1e3},d=0,h=ft;d<h.length;d++){var p=h[d];i.dyn.push({i:p.i,ups:p.def.tick(p.state,f)})}Ut=i,Gt(it,i),dt=t,H.drawArrays(H.TRIANGLES,0,3)}Nt=requestAnimationFrame(se)}},le=null;"undefined"!=typeof IntersectionObserver&&(le=new IntersectionObserver(function(t){var e=c(t,1)[0];ae=e.isIntersecting})).observe(t);var ce=null,ue=0,fe=function(){if(!wt){var t=y();if(!(t.width<2||t.height<2)){var e=Math.round(t.width*v),n=Math.round(t.height*v);m.width=t.width,m.height=t.height,I.style.width=t.width+"px",I.style.height=t.height+"px";var r=I.width!==e||I.height!==n;r&&(I.width=e,I.height=n),"snapshot"===xt?_t():r&&Pt()}}};"undefined"!=typeof ResizeObserver&&(ce=new ResizeObserver(function(){"live"!==xt&&(function(){if(!wt){var t=y();t.width<2||t.height<2||Math.round(t.width)===Math.round(m.width)&&Math.round(t.height)===Math.round(m.height)||(m.width=t.width,m.height=t.height,I.style.width=t.width+"px",I.style.height=t.height+"px")}}(),clearTimeout(ue),ue=setTimeout(fe,150))})).observe(t);var de=0,he=function(){clearTimeout(de),de=setTimeout(function(){if(!wt)if("snapshot"!==xt){var e=t.clientWidth||t.parentElement&&t.parentElement.clientWidth||m.width;I.style.width=e+"px",setTimeout(function(){if(!wt&&"live"===xt){var t=Math.max(2,Math.round(V.getBoundingClientRect().height))||m.height;m.width=e,m.height=t,I.style.height=t+"px",I.width=Math.round(e*v),I.height=Math.round(t*v),Pt()}},50)}else fe()},150)};"undefined"!=typeof window&&window.addEventListener("resize",he),"live"===xt?Nt=requestAnimationFrame(se):(_t().then(function(){Nt=requestAnimationFrame(se)}),"undefined"!=typeof document&&document.fonts&&"object"===s(document.fonts.ready)&&Promise.resolve(document.fonts.ready).then(fe).catch(function(){}));var pe=function(e,n,r,o,i){"function"==typeof CustomEvent&&"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("nodality:raster-param",{detail:{pipeline:ye,el:t,index:e,key:n,value:r,prev:o,how:i}}))},ye={canvas:I,nodes:e,get backend(){return xt},sourceAt:function(t,e,n){return qt(t,e,n)},get progress(){return st},setProgress:function(t){var e=Math.min(1,Math.max(0,Number(t)||0));return e===st||(st=e,lt.length&&(H.useProgram(ot),ct(it,ut),Ht&&!Ht.broken&&(H.useProgram(Ht.prog),ct(Ht.U,ut),H.useProgram(ot))),Tt()),st},setParam:function(t,n,r){var o=e[t];if(!o||wt)return!1;var i=o[n];if(o[n]=r,function(t,e,n,r){if(N.includes(e))return!0;var o=p[t];if(!o)return!0;if((o.structural||[]).includes(e))return!0;if((o.structuralOnToggle||[]).includes(e))return!n!=!r;if(o.uniforms)try{if(e in o.uniforms(Object.assign({op:t},function(t,e,n){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,n)),1))return!1}catch(t){}return!0}(o.op,n,r,i))return ye.rebuild(),pe(t,n,r,i,"rebuild"),"rebuild";var a=p[o.op];if(a&&a.uniforms){var l=a.uniforms(o,v);for(var c in H.useProgram(ot),l)at(it("u".concat(t,"_").concat(c)),l[c][0],l[c][1]);if(Ht&&!Ht.broken){for(var u in H.useProgram(Ht.prog),l)at(Ht.U("u".concat(t,"_").concat(u)),l[u][0],l[u][1]);H.useProgram(ot)}}return pe(t,n,r,i,"uniform"),"uniform"},rebuild:function(){if(wt)return null;var e=t;return ye.destroy(),G(e,r)}};return B.add(ye),Object.assign(ye,{refresh:function(){return"live"===xt?Pt():_t()},destroy:function(){B.delete(ye),wt=!0,cancelAnimationFrame(Nt),clearTimeout(ue),clearTimeout(de),le&&le.disconnect(),ce&&ce.disconnect(),"undefined"!=typeof window&&window.removeEventListener("resize",he),t.removeEventListener("mousemove",Ft),t.removeEventListener("touchmove",Ft);for(var e=0,n=ee;e<n.length;e++){var r=n[e];t.removeEventListener(r,te,!0)}t.removeEventListener("pointerleave",ne,!0),Kt(null),t.removeEventListener("mouseenter",Lt),t.removeEventListener("mouseleave",zt),I.removeEventListener("paint",Pt);for(var o=0,i=ht;o<i.length;o++){var a=i[o];for(var s in a.cleanup(),a.progs)H.deleteProgram(a.progs[s].prog)}for(ht.length=0,Ht&&!Ht.broken&&(H.deleteProgram(Ht.prog),H.deleteFramebuffer(Ht.fbo),H.deleteTexture(Ht.tex)),Ht=null,bt&&(H.deleteTexture(bt),bt=null),gt&&(H.deleteTexture(gt),gt=null);V!==t&&V.firstChild;)t.appendChild(V.firstChild);jt(),t.style.visibility="",I.remove()}})}function H(){return new RegExp('"([A-Za-z_$][A-Za-z0-9_$]*)"\\s*:',"g")}function X(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return"string"!=typeof(e=JSON.stringify(t,null,n))?e:e.replace(H(),"$1:")}function q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||V(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 J(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=V(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function V(t,e){if(t){if("string"==typeof t)return $(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$(t,e):void 0}}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Y(t){return Y="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},Y(t)}function Q(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,K(r.key),r)}}function K(t){var e=function(t){if("object"!=Y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Y(e)?e:e+""}var Z=function(){function t(){var e,n,r,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=function(t){if(t.transform||t.op){var e=t.op;t.transform||(e=t.op),e.duration||(e.duration="3s-ease-in-out"),o.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var n=function(){var n="",r="",i="",a="",s="",l="",c="",u="",f="";if(0!==e.values.length){e.values.forEach(function(t){t.startsWith("tx:")&&(n=t.replace("tx:","")),t.startsWith("ty:")&&(r=t.replace("ty:","")),t.startsWith("tz:")?i=t.replace("tz:",""):t.startsWith("scale(")?a=t:t.startsWith("skew(")?s=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var n=e[1].split(",").map(function(t){return t.trim()});return 1===n.length?"rotate(".concat(n[0],")"):2===n.length?"rotateX(".concat(n[0],") rotateY(").concat(n[1],")"):3===n.length?"rotateX(".concat(n[0],") rotateY(").concat(n[1],") rotate(").concat(n[2],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(f=t.replace("opacity:",""))}),n=o.setDefault(n),r=o.setDefault(r),i=o.setDefault(i);var d="";if("0px"!=r&&"0px"!=n&&"0px"!=i?d+="translate3d(".concat(n,", ").concat(r,", ").concat(i,")"):"0px"==r&&"0px"==n||(d+="translate(".concat(n,", ").concat(r,")")),a&&(d+=" ".concat(a)),l&&(d+=" ".concat(l)),s&&(d+=" ".concat(s)),c&&(d+=" ".concat(c)),u&&(d+=" ".concat(u)),d){if(t.op.duration){var h=t.op.duration.replace(/^(\d+)(s)-/,function(t,e,n){return e/2+n+" "}),p="transform ".concat(h,", opacity ").concat(h);o.res.style.transition=p}else o.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.static&&(o.res.style.transition=""),(o.blastTarget||o.res).style.transform=d,o.res.style.opacity=f}else console.warn("[nodality] transform produced no geometric value - check `values`")}};e.on?o.res.addEventListener(e.on,function(){e.delay?setTimeout(function(){n()},e.delay):n()}):o._on(window,"load",function(){e.delay?setTimeout(function(){n()},e.delay):n()});var r=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) "),o.res.style.opacity="1"}),t&&(o.res.style.transform=t.trim())};if(e.on)o.res.addEventListener("mouseout",function(){e.keep||r()});else{var i=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout(function(){e.keep||r()},i/2+a)}e.hardCSS&&(o.res.style.transform=e.hardCSS)}else console.warn("[nodality] reactOnTransform: unrecognised transform descriptor - ignored")},(n=K(n="reactOnTransform"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1},this.openedElements=new WeakMap,"undefined"!=typeof document&&(this._themeUnsub=i.subscribe(function(t){return o._applyTheme(t)}),Promise.resolve().then(function(){return o._applyTheme(i.mode)}))}return e=t,n=[{key:"rasterize",value:function(t){var e=this;if(t&&0!==t.length&&!this._rasterHandle&&!this._rasterCancelled&&"undefined"!=typeof document&&"undefined"!=typeof setTimeout){var n=0,r=function(){if(!e._rasterHandle&&!e._rasterCancelled){if(e.res&&e.res.isConnected){try{e._rasterHandle=G(e.res,t)}catch(t){return void console.warn("[nodality] raster pipeline skipped:",t)}if(e._rasterHandle)return}++n<80&&(e._rasterTimer=setTimeout(r,50))}};this._rasterTimer=setTimeout(r,0),this._track(function(){return clearTimeout(e._rasterTimer)})}}},{key:"isHidden",value:function(t){t&&(this.res.style.display="none")}},{key:"theme",value:function(t){var e=this;return t&&"object"===Y(t)?(this._themeMap=t,this._applyTheme(i.mode),this._themeUnsub||(this._themeUnsub=i.subscribe(function(t){return e._applyTheme(t)})),this):this}},{key:"_track",value:function(t){return"function"!=typeof t||(this._disposables||(this._disposables=[])).push(t),t}},{key:"_on",value:function(t,e,n,r){return t&&"function"==typeof t.addEventListener?(t.addEventListener(e,n,r),this._track(function(){return t.removeEventListener(e,n,r)}),n):n}},{key:"destroy",value:function(){if("function"==typeof this._themeUnsub&&(this._themeUnsub(),this._themeUnsub=null),this._rasterHandle&&"function"==typeof this._rasterHandle.destroy)try{this._rasterHandle.destroy()}catch(t){}if(this._rasterHandle=null,this._rasterCancelled=!0,this._disposables){var t,e=J(this._disposables);try{for(e.s();!(t=e.n()).done;){var n=t.value;try{n()}catch(t){}}}catch(t){e.e(t)}finally{e.f()}this._disposables.length=0}return this._responsiveTasks=null,this._responsiveHandler=null,this.res&&this.res.parentNode&&this.res.parentNode.removeChild(this.res),this}},{key:"_applyTheme",value:function(t){if(!this._noTheme&&this.res)if(this._themeMap){var e=this._themeMap[t];if(!e)return;for(var n in e)this.res.style[n]=e[n]}else{var r=i.defaults&&i.defaults[t];if(r)for(var o in this._themeOriginal||(this._themeOriginal={}),r)o in this._themeOriginal||(this._themeOriginal[o]=this.res.style[o]||""),this._themeOriginal[o]||(this.res.style[o]=r[o])}}},{key:"vars",value:function(t){if(!t||"object"!==Y(t))return this;for(var e in t)this.res.style.setProperty(e,String(t[e]));return this}},{key:"keySet",value:function(t){if(this.temporaryVal=1,Array.isArray(t)){for(var e=0;e<t.length;e++)t[e]&&null!=t[e].key&&(this.res.style[t[e].key]=t[e].value);return this}return this.res.style[t.key]=t.value,this}},{key:"commonMethods",value:function(t){var e={exact:"fontSize",cursor:"cursor",width:"width",maxWidth:"maxWidth",height:"height",maxHeight:"maxHeight",radius:"borderRadius",lineHeight:"lineHeight",background:"background",color:"color",font:"fontFamily",opacity:"opacity",gap:"gap",minHeight:"minHeight",position:"position",inset:"inset",top:"top",right:"right",bottom:"bottom",left:"left",zIndex:"zIndex",flex:"flex",flexShrink:"flexShrink",flexGrow:"flexGrow",flexBasis:"flexBasis",flexWrap:"flexWrap",alignSelf:"alignSelf",display:"display",gridTemplateColumns:"gridTemplateColumns",gridTemplateRows:"gridTemplateRows",rowGap:"rowGap",columnGap:"columnGap",cols:"gridTemplateColumns",rows:"gridTemplateRows",areas:"gridTemplateAreas",area:"gridArea",letterSpacing:"letterSpacing",textTransform:"textTransform",whiteSpace:"whiteSpace",overflowWrap:"overflowWrap",wordBreak:"wordBreak",wordWrap:"wordWrap",boxShadow:"boxShadow",backdropFilter:"backdropFilter",WebkitBackdropFilter:"WebkitBackdropFilter",overflow:"overflow",overflowX:"overflowX",overflowY:"overflowY",WebkitOverflowScrolling:"WebkitOverflowScrolling",WebkitTapHighlightColor:"WebkitTapHighlightColor",minWidth:"minWidth",boxSizing:"boxSizing",pointerEvents:"pointerEvents",userSelect:"userSelect",WebkitUserSelect:"WebkitUserSelect",textAlign:"textAlign",transition:"transition"};for(var n in e)null!=t[n]&&(this.res.style[e[n]]=t[n]);return"string"==typeof t.transform&&(this.res.style.transform=t.transform),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.respad&&this.respad(t.respad),t.borderObj&&t.borderObj.width&&this.borderObj(t.borderObj),t.resmar&&this.resmar(t.resmar),t.hover&&this.hover(t.hover),t.size&&this.fluidCopy(t.size),t.resprop&&this.resprop(t.resprop,t),t.vars&&this.vars(t.vars),t.keySet&&this.keySet(t.keySet),t.noTheme&&(this._noTheme=!0),t.theme&&this.theme(t.theme),t.hide&&this.isHidden(t.hide),t.raster&&this.rasterize(t.raster),t.center&&this.center(t.center,{display:t.disp||t.display,flexDirection:t.flexDir||t.flexDirection}),t.transform&&"object"===Y(t.transform)&&this.reactOnTransform(t.transform),void 0!==t.opacity&&(this.res.style.opacity=t.opacity),t.bold?this.res.style.fontWeight="bold":null!=t.weight&&(this.res.style.fontWeight=t.weight),this}},{key:"hover",value:function(t){var e=this;if(t.border){var n=t.border.width;this.res.style.border=n?"".concat(n,"px solid transparent"):"1px solid transparent"}var r=this.options&&this.options.borderObj;return r&&(this.res.style.border="".concat(r.width,"px solid ").concat(r.color)),this.prevColor=this.res.style.backgroundColor,this.foreColor=this.res.style.color,this.prevBorder=this.res.style.border,this.prevBoxShadow=this.res.style.boxShadow,t.animation&&(this.res.style.transition="".concat(t.animation),this.res.style.transitionProperty="background-color, color, border, box-shadow, transform"),this.prevTransform=this.res.style.transform,this.res.onmouseout=function(){e.res.style.backgroundColor="".concat(e.prevColor),e.res.style.color="".concat(e.foreColor),e.res.style.border=e.prevBorder,null==t.scale&&null==t.transform||(e.res.style.transform=e.prevTransform||""),null!=t.boxShadow&&(e.res.style.boxShadow=e.prevBoxShadow||"")},this.res.onmouseover=function(){if(e.res.style.color=t.color,e.res.style.backgroundColor=t.background,t.border){var n,r=t.border.width,o=null!==(n=t.border.color)&&void 0!==n?n:"#2ECC71";e.res.style.border=r?"".concat(r,"px solid ").concat(o):"1px solid #2ECC71"}if(null!=t.scale||null!=t.transform){var i=e.prevTransform?"".concat(e.prevTransform," "):"",a=[];null!=t.transform&&a.push(t.transform),null!=t.scale&&a.push("scale(".concat(t.scale,")")),e.res.style.transform="".concat(i).concat(a.join(" "))}null!=t.boxShadow&&(e.res.style.boxShadow=t.boxShadow)},this}},{key:"onScroll",value:function(t){var e=this,n=function(t){if(null==t)return{num:0,unit:"px"};var e=String(t).match(/^(-?[\d.]+)(.*)$/);return e?{num:parseFloat(e[1]),unit:e[2]||"px"}:{num:0,unit:"px"}},r=function(t){var n=t&&null!=t.tx?t.tx:"0px",r=t&&null!=t.ty?t.ty:"0px";e.res.style.transform="translate3d(".concat(n,", ").concat(r,", 0)")};"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value?this.res.style.transform="scale(".concat(t.valMin,")"):"trn"===t.value&&r(t.valMin);var o=function(){if("trn"!==t.value){var o=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?e.res.style.opacity=o:"scale"===t.value&&(e.res.style.transform="scale(".concat(o,")"))}else{for(var i={},a=["tx","ty"],s=0;s<a.length;s++){var l=a[s],c=t.valMin&&null!=t.valMin[l],u=t.valMax&&null!=t.valMax[l];if(c||u){var f=n(c?t.valMin[l]:u?t.valMax[l]:"0px"),d=n(u?t.valMax[l]:c?t.valMin[l]:"0px"),h=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:f.num,max:d.num});i[l]="".concat(h).concat(f.unit)}}r(i)}};this._on(window,"scroll",o),0===t.from&&o()}},{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:"_setupResponsiveManager",value:function(){var t=this;this._responsiveTasks=this._responsiveTasks||[];var e=function(){t._responsiveTasks.forEach(function(t){t()})};this._responsiveHandler||(this._responsiveHandler=e,this._on(window,"resize",e)),setTimeout(function(){e()},0)}},{key:"resprop",value:function(e,n){var r=this;this.options=n;var o={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]},i=["resprop","breakpoint","value","values","range"],a={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex",exact:"fontSize"},s=function(t){var e=a[t]||t;return"undefined"==typeof console||"function"==typeof r[t]||e in r.res.style||console.warn('[nodality] resprop: "'.concat(t,'" is not a CSS property or component method — ignored.')+(a[t]?"":" Did you mean one of: ".concat(Object.keys(a).join(", "),"?"))),e};e.forEach(function(t){void 0!==o[t.breakpoint]?t.range=o[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[0,parseInt(t.breakpoint,10)]}),e.sort(function(t,e){return t.range[1]-e.range[1]});var l=e.find(function(t){return"default"===t.breakpoint});l||(l={breakpoint:"default",range:o.default},e.unshift(l));var c=new Set;e.forEach(function(t){Object.keys(t).forEach(function(t){i.includes(t)||"range"===t||c.add(t)})}),c.forEach(function(t){void 0===l[t]&&(l[t]=r.options[t]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var n=t.viewportWidth(),o=l,a=0;a<e.length;a++){var u=e[a],f=q(u.range,2),d=f[0],h=f[1];if("default"!==u.breakpoint&&n>=d&&n<=h){o=u;break}}for(var p in c.forEach(function(t){if("keySet"===t){var e=l[t];e&&e.key&&(r.res.style[e.key]=e.value)}else r.res.style[s(t)]=l[t]}),o)if("exact"!==p){if(!i.includes(p)&&"range"!==p){var y=o[p];"keySet"===p&&y&&y.key?r.res.style[y.key]=y.value:"function"==typeof r[p]?r[p](y):r.res.style[s(p)]=y}}else r.res.style.fontSize=o[p]}),this._setupResponsiveManager()}},{key:"respad",value:function(e){var n=this,r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==r[t.breakpoint]?t.range=r[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[parseInt(t.breakpoint,10),1e5]}),e.sort(function(t,e){return t.range[0]-e.range[0]});var o=e.find(function(t){return"default"===t.breakpoint});o||(o={breakpoint:"default",range:r.default},e.unshift(o)),void 0===o.values&&(o.values=this.options&&this.options.pad||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),i=o,a=0;a<e.length;a++){var s=e[a],l=q(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&r>=c&&r<=u){i=s;break}}var f=void 0!==i.values?i.values:o.values;null!=f&&n.pad(f)}),this._setupResponsiveManager()}},{key:"resmar",value:function(e){var n=this,r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==r[t.breakpoint]?t.range=r[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[parseInt(t.breakpoint,10),1e5]}),e.sort(function(t,e){return t.range[0]-e.range[0]});var o=e.find(function(t){return"default"===t.breakpoint});o||(o={breakpoint:"default",range:r.default},e.unshift(o)),void 0===o.values&&(o.values=this.options&&(this.options.mar||this.options.pad)||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),i=o,a=0;a<e.length;a++){var s=e[a],l=q(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&r>=c&&r<=u){i=s;break}}var f=void 0!==i.values?i.values:o.values;null!=f&&n.mar(f)}),this._setupResponsiveManager()}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"radius",value:function(t){return this.res.style.borderRadius="number"==typeof t?"".concat(t,"px"):t,this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"scale",value:function(t){var e=this;return this.res.style.width,this.res.style.transition="0.5s all",this.res.addEventListener("mouseover",function(){e.res.style.width,e.res.style.transform="scale(1.04)"}),this.res.addEventListener("mouseout",function(){e.res.style.width,e.res.style.transform="scale(1.0)"}),this}},{key:"round",value:function(t){return this.deprecatedOption("round()","radius()"),this.radius(t)}},{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"deprecatedOption",value:function(t,e){return console.error("nodality: `".concat(t,"` is deprecated — use `").concat(e,"` instead.")),this}},{key:"center",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.res.style,r=n.display||e.display||"",o=n.flexDirection||e.flexDirection||"",i=!0===t||"both"===t||"x"===t,a=!0===t||"both"===t||"y"===t;if(r.includes("grid"))return i&&(n.justifyItems="center",n.justifyContent="center"),a&&(n.alignItems="center",n.alignContent="center"),this;r.includes("flex")||(n.display="flex"),n.flexDirection||(n.flexDirection=o||"column");var s=(n.flexDirection||"column").startsWith("column");return(s?a:i)&&(n.justifyContent="center"),(s?i:a)&&(n.alignItems="center"),this}},{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 n=Object.keys(t[e]),r=0;r<n.length;r++)for(var o=n[r],i=t[e][o],a=0;a<o.length;a++)switch(o[a]){case"a":this.res.style.padding=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.paddingTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.paddingLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.paddingRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.paddingBottom=this.isNumber(i)?"".concat(i,"px"):i}return this}},{key:"as",value:function(t){return this.res.style.alignSelf=t,this}},{key:"mar",value:function(t){if("center"===t)return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this;for(var e=0;e<t.length;e++)for(var n=Object.keys(t[e]),r=0;r<n.length;r++){for(var o=n[r],i=t[e][o],a=0;a<o.length;a++)switch(o[a]){case"a":"auto"===i?(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"):this.res.style.margin=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.marginTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.marginLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.marginRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.marginBottom=this.isNumber(i)?"".concat(i,"px"):i}"center"===o&&!0===i&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),"auto"===i&&(o.includes("l")||o.includes("r"))&&(o.includes("l")&&(this.res.style.marginLeft="auto"),o.includes("r")&&(this.res.style.marginRight="auto"))}return this}},{key:"smartRange",value:function(t,e,n){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var r=(t-e.min)/(e.max-e.min);return e.min>e.max&&(r=(t-e.max)/(e.min-e.max)),n.min+(n.max-n.min)*r}},{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 n=document.createTextNode(this.text);this.res.appendChild(n),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 r=document.createTextNode(this.text);this.res.appendChild(r),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 o=document.createTextNode(this.text);this.res.appendChild(o),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 i=document.createTextNode(this.text);this.res.appendChild(i),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 a=document.createTextNode(this.text);this.res.appendChild(a),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,n=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(n," ").concat(t.color),void 0!==t.radius&&(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}},{key:"chainReact",value:function(e,n,r){var o=this;this.ap=!1,this.cta=0,this.once=!1;var i,a=J(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;s.range||(s.range=["0px","999999px"])}}catch(t){a.e(t)}finally{a.f()}e.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var l=function(i){var a=t.viewportWidth(),s=[],l=[];o.resCopy=o.res,o.storedQueries=e.map(function(t){return t.target}).filter(function(t){return null!=t});var c,u=J(e);try{for(u.s();!(c=u.n()).done;){var f=c.value;o.counterIndex++;var d=q(f.range,2),h=d[0],p=d[1],y=parseInt(h),m=parseInt(p),v=!0;if(f.target){v=!1;for(var b=0;b<f.target.length;b++)f.target[b]===n&&(v=!0)}a>=y&&a<=m&&v&&(s.push(f.log),l.push(f),f.op&&f.op.margin&&(o.useMargin=f.op.margin))}}catch(t){u.e(t)}finally{u.f()}if(r&&!r.includes("background")&&(o.res.style.background="",o.res.style.backgroundColor=""),o.res.style.textShadow="",r&&!r.includes("border")&&(o.res.style.border=""),r&&!r.includes("margin")&&(o.res.style.margin=""),o.res.style["-webkit-text-fill-color"]="",o.res.style["-webkit-text-stroke-color"]="",o.res.style["-webkit-text-stroke-width"]="",o.res.style.filter="",o.options.background&&(o.res.style.background=o.options.background),s.includes("gradient"),(s.includes("gradient")||s.includes("shadow"))&&(o.res.style.position="relative"),s.includes("blast")){var g,w=l.filter(function(t){return"blast"===t.log})[0].op.color,x=null!==(g=l.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==g?g:"1px";"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()?(o.res.style.border="".concat("number"==typeof x?x+"px":x," solid orange"),o.res.style.display="inline-block","FlexRowLayoutElement"===o.getType()&&(o.res.style.display="flex"),o.res.style.boxSizing="border-box",o.res.style.transformOrigin="center",o.blastTarget=o.res):(o.text,o.res.style["-webkit-text-fill-color"]="transparent",o.res.style["-webkit-text-stroke-color"]=w,o.res.style["-webkit-text-stroke-width"]="".concat(x))}if(s.includes("filter")){var k=l.filter(function(t){return"filter"===t.log})[0].op.filter;o.res.style.filter=k}if(s.includes("background")&&(o.res.style.backgroundColor="green"),s.includes("gradient")&&("LayoutWrapperElement"!==o.getType()&&"FlexRowLayoutElement"!==o.getType()&&(o.res.style["-webkit-text-fill-color"]="transparent"),o.res.style.background=o.globalGradient,"LayoutWrapperElement"!==o.getType()&&"FlexRowLayoutElement"!==o.getType()&&(o.res.style["background-clip"]="text")),s.includes("shadow")){var O,S,E,j,T=o.options.shadow.op,_=null!==(O=T.steps)&&void 0!==O?O:1,C=null!==(S=T.colors)&&void 0!==S?S:["gray"],P=null!==(E=T.movements)&&void 0!==E?E:["3px","3px"],A=null!==(j=T.radius)&&void 0!==j?j:"3px";if(1===P.length&&(P=[P[0],P[0]]),"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()){for(var R=[],M=0;M<_;M++){var F,I=null!==(F=C[M])&&void 0!==F?F:C[0],D=P[0],L=P[1];R.push("".concat(D," ").concat(L," ").concat(A," ").concat(I))}o.res.style.boxShadow=R.join(", ")}else{for(var z=[],W=0;W<_;W++){var B,N=null!==(B=C[W])&&void 0!==B?B:C[0],U=P[0],G=P[1];z.push("drop-shadow(".concat(U," ").concat(G," ").concat(A," ").concat(N,")"))}o.res.style.filter=z.join(" ")}}if(s.includes("margin"))for(b=0;b<e.length;b++)if(e[b].op){var H=e[b].op.offsets;H&&void 0!==o.index&&(o.res.style.margin=H[Number(o.index)]+"px")}if(s.includes("spana")||s.includes("span")){var X=document.createElement("div");if(X.setAttribute("id","oroa"),Object.assign(X.style,{position:"absolute",inset:"0",background:"linear-gradient(90deg, rgb(52,152,219), rgb(26,188,156))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none"}),o.res&&o.res.querySelector("span"))return;o.res=o.resCopy,o.res.textContent="",o.options.span&&(Array.isArray(o.options.span)?o.options.span:[o.options.span]).forEach(function(t){if(t.op&&"span"===t.op.name&&Array.isArray(t.op.parts)){var e=0,n=o.prevText||"";if(t.op.parts.forEach(function(t){var r=t.text,i=t.style||{};if(e<n.length){var a=n.indexOf(r,e);if(a>e){var s=n.substring(e,a);o.res.appendChild(new o.constructor(s).setup({type:"span",id:i.id,animation:i.animation}).set({}).render())}e=a+r.length}var l=new o.constructor(r).setup({type:"span",id:i.id,animation:i.animation}).set(i).render();o.res.appendChild(l)}),e<n.length){var r=n.substring(e);o.res.appendChild(new o.constructor(r).setup({type:"span"}).set({}).render())}}})}else{var V=new o.constructor(o.prevText).set({}).render();o.prevText&&o.prevText.length>0&&i&&o.res.appendChild(V)}if(s.includes("animation")){if(o.options.animation&&!o.hasAnimated&&!o.options.animation.op.fireAt){o.hasAnimated=!0;var $=o.options.animation.op;o._on(window,"sidebar:open",function(){o.res.animate($.keyframesOpen,$.openOptions)}),o._on(window,"sidebar:closed",function(){o.res.animate($.keyframesClose,$.closeOptions)}),o.res.animate($.keyframesClose,{duration:0,fill:"forwards"}),o.openTag&&o.closeTag&&(o._on(window,o.openTag,function(){o.res.animate($.keyframesOpen,$.openOptions)}),o._on(window,o.closeTag,function(){o.res.animate($.keyframesClose,$.closeOptions)}))}if(o.options.animation&&o.options.animation.op.fireAt&&o.options.animation.op.fireAt.endsWith("px")){var Y=o.options.animation.op;o.res.animate(Y.keyframesClose,{duration:0,fill:"forwards"});var Q=function(){window.scrollY>parseFloat(Y.fireAt)&&(o.res.animate(Y.keyframesOpen,Y.openOptions),window.removeEventListener("scroll",Q))};o._on(window,"scroll",Q)}if(o.options.animation&&"inview"===o.options.animation.op.fireAt){var K=o.options.animation.op;o.res.animate(K.keyframesClose,{duration:0,fill:"forwards"});var Z=!1,tt=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!Z&&(Z=!0,o.res.animate(K.keyframesOpen,K.openOptions),e.disconnect())})});tt.observe(o.res),o._track(function(){return tt.disconnect()})}}};this.options.animation||this._on(window,"resize",function(){return l()}),l()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(H(),"$1:")}}],r=[{key:"viewportWidth",value:function(){if("undefined"==typeof window)return 0;var t=window.visualViewport;return t&&"number"==typeof t.width?t.width:window.innerWidth}}],n&&Q(e.prototype,n),r&&Q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function tt(t){return tt="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},tt(t)}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rt(r.key),r)}}function rt(t){var e=function(t){if("object"!=tt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tt(e)?e:e+""}function ot(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ot=function(){return!!t})()}function it(t,e,n,r){var o=at(st(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function at(){return at="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=st(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},at.apply(null,arguments)}function st(t){return st=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},st(t)}function lt(t,e){return lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lt(t,e)}var ct=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=st(e),function(t,e){if(e&&("object"==tt(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,ot()?Reflect.construct(e,n||[],st(t).constructor):e.apply(t,n))}(this,e)).text=t,r.res=null,r.setup(n),r.code=[],r.elCSS=[],r.html=[],r.react=[],r.code.push('new Text("'.concat(r.text,'")')),r}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&&lt(t,e)}(e,t),n=e,r=[{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=X(Object.fromEntries(Object.entries(this.options).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return et(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?et(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]})),4);return['new Text("'.concat(this.text,'").set(').concat(t,")")]}},{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:"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:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"styled",value:function(t){return this.set(t),this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(H(),"$1:")}},{key:"looksLikeMarkdown",value:function(t){return/(\*\*.*\*\*|\*.*\*|`[^`]+`|\[.*?\]\(.*?\)|^# )/m.test(t)}},{key:"parseMarkdown",value:function(t){var e=t;return(e=(e=(e=(e=(e=(e=(e=e.replace(/^### (.*$)/gim,"<h3>$1</h3>")).replace(/^## (.*$)/gim,"<h2>$1</h2>")).replace(/^# (.*$)/gim,"<h1>$1</h1>")).replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>")).replace(/\*(.*?)\*/g,"<em>$1</em>")).replace(/`([^`]+)`/g,"<code>$1</code>")).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>')).replace(/\n/g,"<br>")}},{key:"set",value:function(t){return this.resCopy=this.res,this.options=t,it(e,"setPrevText",this,3)([this.text]),t.raster&&this.rasterize(t.raster),this.commonMethods(t),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&&it(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.preffersId&&(this.preffersId=t.preffersId),it(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),this.options.id&&this.res.setAttribute("id",this.options.id),it(e,"setID",this,3)([this.options.id]),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.class&&this.res.setAttribute("class",this.options.class),it(e,"setClass",this,3)([this.options.class]),t.clampc&&this.clampCopy(t.clampc),t.absolute&&(this.res.style.position="absolute"),t.em&&this.em(t.em),t.fluid&&this.fluid(t.fluid),t.fluidc&&this.elCSS.push("font-family: ".concat(t.font,"; \n")),t.align&&(this.res.style.textAlign=t.align),t.breakWord&&(this.res.style.wordWrap="break-word"),t.center&&this.deprecatedOption("center on Text",'mar: "center"'),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),this.callReact(t),this}},{key:"callReact",value:function(t){var n=[],r=t.transform&&"object"===tt(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||r){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&it(e,"setAny",this,3)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var o=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,r?t.transform:void 0];o=o.filter(function(t){return null!=t});for(var i=0;i<o.length;i++)n.push({range:o[i].range,log:o[i].op.name,target:o[i].target,op:o[i].op});var a=[];t.borderObj&&a.push("border"),t.background&&a.push("background"),t.mar&&a.push("margin"),t.animation&&a.push("animation"),t.span&&a.push("span"),this.chainReact(n,this.options.id,a)}}},{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:"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:"stringGen",value:function(t){for(var e="",n=0;n<t;n++)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 n=this.stringGen(1e3);return this.res.setAttribute("id",n),document.styleSheets[0].insertRule("#".concat(n,"::first-letter { color: green; font-size: 3em; padding: 0.1em }"),0),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 n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.525rem + 3.525vw)"}if("S3"===t){this.res=document.createElement("h3");var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.375rem + 2.75vw)"}if("S4"===t){this.res=document.createElement("h4");var o=document.createTextNode(this.text);this.res.appendChild(o),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:"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:"responsive",value:function(t){var e=this;this.set=!1,this.setB=!1;var n=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 n(),window.addEventListener("resize",n),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 n=function(){for(var n=0;n<t.length;n++)t[n].width&&window.matchMedia("(min-width: ".concat(t[n].width,"px)")).matches&&(e.res.style.fontSize="".concat(t[n].size));window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.fontSize="".concat(t[t.length-1].mobile))};return n(),window.addEventListener("resize",n),this}},{key:"setup",value:function(t){var e;t?((e=document.createElement(t.type)).setAttribute("id",t.id),"span"===t.type&&t.animation&&(e.style.position="relative",e.style.display="block")):e=document.createElement("p");var n=document.createTextNode(this.text);return e.appendChild(n),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:"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:"updating",value:function(t,e){var n=this.res,r=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(r.replace("$",t));n.replaceChild(e,n.childNodes[0])}}),this}},{key:"apply",value:function(t){var e=this,n=this.res.styles,r=function(){for(var r=0;r<t.length;r++){var o=t[r];o.min&&o.max?window.matchMedia("(min-width: ".concat(o.min,"px) and (max-width: ").concat(o.max,"px)")).matches?Object.assign(e.res.style,o.styles):Object.assign(e.res.style,n):window.matchMedia("(max-width: ".concat(o.max,"px)")).matches?Object.assign(e.res.style,o.styles):Object.assign(e.res.style,n)}};return r(),window.addEventListener("resize",r),this}},{key:"render",value:function(t){if(!t)return this.options&&!this.options.span&&(this.res.textContent=this.text),this.looksLikeMarkdown(this.text)&&(this.res.innerHTML=this.parseMarkdown(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),this.looksLikeMarkdown(this.text)&&(this.res.innerHTML=this.parseMarkdown(this.text)),document.querySelector(t).appendChild(this.res)}}],r&&nt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function ut(t){return ut="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},ut(t)}function ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function dt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ht(r.key),r)}}function ht(t){var e=function(t){if("object"!=ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ut(e)?e:e+""}function pt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(pt=function(){return!!t})()}function yt(t,e,n,r){var o=mt(vt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function mt(){return mt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},mt.apply(null,arguments)}function vt(t){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vt(t)}function bt(t,e){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bt(t,e)}var gt=function(t){function e(t,n,r,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,n){return e=vt(e),function(t,e){if(e&&("object"==ut(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,pt()?Reflect.construct(e,n||[],vt(t).constructor):e.apply(t,n))}(this,e)).url=t,i.res=null,i.code=[],i}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&&bt(t,e)}(e,t),n=e,r=[{key:"setType",value:function(t){t.url;var e=t.type,n=t.mode;if(this.code=[],"exact"===e){var r='new Image("'.concat(this.url,'", "exact")');this.code.push(r)}else if("uncover"===e){var o='new Image("'.concat(this.url,'", "uncover")');this.code.push(o)}else this.code.push("new Image('".concat(this.url,"')"));return this.image(this.url,n,e),this}},{key:"hand",value:function(){return this.res.style.cursor="hand",this}},{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 n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ft(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(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 n="";this.options=t;var r=t;r.onTap&&this.onTap(r.onTap);var o=t.isFull;if(o?this.image(t.url,"exact",o,"a"):this.setup(),t.url&&this.res.setAttribute("src",t.url),"IMG"===this.res.tagName&&(t.srcset&&this.res.setAttribute("srcset",t.srcset),t.sizes&&this.res.setAttribute("sizes",t.sizes),void 0!==t.alt&&this.res.setAttribute("alt",t.alt),t.loading&&this.res.setAttribute("loading",t.loading),t.decoding&&this.res.setAttribute("decoding",t.decoding),t.fetchPriority&&this.res.setAttribute("fetchpriority",t.fetchPriority)),t.id&&this.res.setAttribute("id",t.id),t.id&&(n+=' id: "'.concat(t.id,'", \n')),this.id=t.id,"exact"===o?'new Image("'.concat(this.url,'", "exact")'):"uncover"===o&&'new Image("'.concat(this.url,'", "uncover")'),this.commonMethods(r),t.vtn&&(this.res.style.viewTransitionName=t.vtn),this.vtn=t.vtn,t.minHeight&&(this.res.style.minHeight=t.minHeight),t.index&&yt(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.index&&(n+='\n index: "'.concat(t.index,'",')),t.resprop&&this.resprop(t.resprop),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&&(n+='\n objectFit: "'.concat(t.objectFit,'",')),t.objectPosition&&(this.res.style.objectPosition=t.objectPosition),t.objectPosition&&(n+='\n objectPosition: "'.concat(t.objectPosition,'",')),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,n+="\n gpos: ".concat(this.removeQuotesFromFirstWord(JSON.stringify(t.gpos)),", ")),t.filtera){var i;i=Array.isArray(t.filtera)?r.filtera.filter(function(t){return"filter"===t.op.name})[0]:t.filtera;var a=this.removeQuotesFromFirstWord(JSON.stringify(i));n+="\n filtera: ".concat(a,", \n")}if(t.keySet&&this.keySet(t.keySet),t.stype&&this.setType(t.stype),t.isBackground&&(this.isBackground=t.isBackground),t.zIndex&&(n+='\n zIndex: "'.concat(t.zIndex,'", \n')),t.area&&this.setArea(t.area),t.area&&(n+='area: "'.concat(t.area,'", \n')),t.opacity&&(this.res.style.opacity=t.opacity),t.width&&(this.res.style.width=t.width),t.width&&(n+='width: "'.concat(t.width,'", ')),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.maxWidth&&(n+='maxWidth: "'.concat(t.maxWidth,'", ')),t.height&&(this.res.style.height=t.height),t.height&&(n+='height: "'.concat(t.height,'", ')),t.maxWidth&&this.maxWidth(t.maxWidth),t.maxWidth&&(n+='maxWidth: "'.concat(t.maxWidth,'", \n')),t.radius&&this.cornerRadius(t.radius),t.radius&&(n+='radius: "'.concat(t.radius,'", \n')),t.marginOp){var s=this.removeQuotesFromFirstWord(JSON.stringify(t.marginOp));n+="\n marginOp: ".concat(s,",")}if(t.clipPath&&this.clipPath(t.clipPath),t.clipPath&&(n+='clipPath: "'.concat(t.clipPath,'", \n')),r.stroke||r.gradient||r.span||r.backgroundOp||r.layout||r.marginOp||r.shadow||r.filtera||r.animation){r.gradient,r.gradient&&(this.globalGradient=r.gradient.op.gradient),r.stroke&&yt(e,"setAny",this,3)([{globalBlast:"".concat(r.stroke.op.width," ").concat(r.stroke.op.color)}]);var l=[r.stroke,r.gradient,r.animation,r.span,r.backgroundOp,r.layout,r.marginOp,r.shadow,r.filtera,r.animation];l=l.filter(function(t){return null!=t});for(var c=[],u=0;u<l.length;u++)c.push({range:l[u].range,log:l[u].op.name,target:l[u].target,op:l[u].op});this.chainReact(c,this.options.id)}if(r.shadow){var f=r.shadow,d=this.removeQuotesFromFirstWord(JSON.stringify(f));n+="\n shadow: ".concat(d,",")}if(r.animation){var h=r.animation,p=this.removeQuotesFromFirstWord(JSON.stringify(h));n+="\n animation: ".concat(p,",")}var y="\n .set({".concat(n,"}) \n \n");return Object.keys(t).length>0?this.code.push(y):this.code.push(","),this}},{key:"setID",value:function(t){return this.res.setAttribute("id",t),this}},{key:"opacity",value:function(t){return this.res.style.opacity="".concat(t),this}},{key:"setGrid",value:function(){return this.res.style.gridRow="span 2",this.res.style.gridColumn="span 3",this}},{key:"transform",value:function(t){return this.res.style.transform=t,this}},{key:"offset",value:function(){return this.res.style.marginLeft="-60px",this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"border",value:function(t){return this.res.style.borderTopLeftRadius="16px",this.res.style.borderTopRightRadius="16px",this}},{key:"mobileWidth",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="120%"),this}},{key:"image",value:function(t,e,n,r,o){var i=window.matchMedia("(max-device-width: 415px)"),a=document.createElement("div");return a.style.viewTransitionName=r,a.style.width="100%",a.style.height=this.options.height?this.options.height:"400px",o&&(a.style.gridColumn=o.gridColumn,a.style.gridRow=o.gridRow),i.matches&&(a.style.height="500"),a.style.backgroundImage="url(".concat(t,")"),a.style.backgroundPosition="center center",a.style.backgroundRepeat="no-repeat",a.style.backgroundSize="cover","uncover"===n&&(a.style.backgroundSize="contain"),"contain"===e&&(a.style.backgroundSize="contain"),this.res=a,this}},{key:"setup",value:function(){var t=document.createElement("img");return t.style.width="100%",t.src=this.url,this.res=t,this}},{key:"float",value:function(t){return this.res.style.float="".concat(t),this}},{key:"grayscale",value:function(t){return this.res.style.filter="grayscale(".concat(t,"%)"),this}},{key:"flex",value:function(t){return this.res.style.flex=1,this}},{key:"height",value:function(t){return this.res.style.height=t,this.res.style.width="auto",this}},{key:"expand",value:function(t){var e=this,n=function(){var n,r;if(window.matchMedia("(min-width: ".concat(t.at,")")).matches){e.res.style.width="".concat(t.width);var o=window.innerWidth/2-(r=n=t.width,(n.includes("%")||n.includes("px"))&&(r=r.substr(0,2)),(n.includes("%")?Number(r/100*window.innerWidth):n.includes("px")?Number(r):void 0)/2);e.res.style.marginLeft="".concat(o,"px")}else e.res.style.width="100%",e.res.style.marginLeft="0px";window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.width="100%",e.res.style.marginLeft="0px")};return n(),window.addEventListener("resize",n),this}},{key:"width",value:function(t){return this.res.style.width=t,this.res.style.height="auto",this}},{key:"dimensions",value:function(t,e){return t&&e?(this.res.style.width=t,this.res.style.height=e):(this.res.style.width=t,this.res.style.height=t),this}},{key:"size",value:function(t,e){return this.deprecatedOption("size() on this component","dimensions(w, h)"),this.dimensions(t,e)}},{key:"frame",value:function(t){var e=t.width,n=t.height;return e&&n?(this.res.style.width=e,this.res.style.height=n):(this.res.style.width=e,this.res.style.height=e),this}},{key:"shadow",value:function(t){return"mild"===t.type?this.res.style.boxShadow="0px 3px 15px rgba(0,0,0,0.2)":this.res.style.boxShadow="".concat(t.x,"px ").concat(t.y,"px ").concat(t.radius,"px ").concat(t.color),this}},{key:"cornerRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"clipPath",value:function(t){this.res.style.clipPath='path("'.concat(t,'")');var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.style.display="block",e.style.width="100%",e.style.height="100%",e.style.overflow="visible",this}},{key:"render",value:function(t){var e=this.res;if(!t)return e;document.querySelector(t).appendChild(e)}}],r&&dt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function wt(t){return wt="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},wt(t)}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function kt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ot(r.key),r)}}function Ot(t){var e=function(t){if("object"!=wt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wt(e)?e:e+""}function St(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(St=function(){return!!t})()}function Et(t,e,n,r){var o=jt(Tt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function jt(){return jt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Tt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},jt.apply(null,arguments)}function Tt(t){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tt(t)}function _t(t,e){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_t(t,e)}var Ct=function(t){function e(t,n,r){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,n){return e=Tt(e),function(t,e){if(e&&("object"==wt(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,St()?Reflect.construct(e,n||[],Tt(t).constructor):e.apply(t,n))}(this,e)).link=n,o.text=t,o.code=[],o.css=[],o.elCSS=[],o.html=[],o.res=null,o.stopEM=r,o.setup(),o.inlineBlock(),o.res.addEventListener("click",function(t){var e=o.link||o.res.getAttribute("href");if(e){var n=new URL(e,window.location.href).href,r=/^https?:\/\//i.test(n),i=n.startsWith("#"),a=/^[a-zA-Z]+:/.test(n);r||i||n.endsWith(".html")||a||(t.preventDefault(),"navigation"in window?navigation.navigate(n):(history.pushState({},"",n),document.dispatchEvent(new PopStateEvent("popstate"))))}}),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&&_t(t,e)}(e,t),n=e,(r=[{key:"toElCSS",value:function(){return 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"HTMLAnchorElement"}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=X(Object.fromEntries(Object.entries(this.options).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return xt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xt(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]})),4);return["new Link().set(".concat(t,")")]}},{key:"setup",value:function(){var t=document.createElement("a");t.setAttribute("href",this.link),t.style.textDecoration="none",t.style.color="black",t.style.fontFamily="Arial";var e=document.createTextNode(this.text);return t.appendChild(e),this.res=t,!1===this.stopEM&&this.em(1),this}},{key:"appendImageAsChild",value:function(t,e){var n=document.createElement("a");t.options.vtn&&(n.style.viewTransitionName=t.options.vtn),n.setAttribute("href",t.options.url);var r=document.createElement("img");return t.options&&(r.style.width=t.options.size,t.options.radius&&(r.style.borderRadius=t.options.radius),r.setAttribute("src",t.options.img),t.options.pad&&(this.res.style.padding=t.options.pad),n.appendChild(r)),this.res=n,e&&(this.res.style.marginLeft=e),this}},{key:"addIcon",value:function(t){var e=document.createElement("img");return e.style.width="20px",e.style.height="auto",e.style.marginLeft=t.padding?t.padding:"10px",e.setAttribute("src",t.url),this.res.appendChild(e),this}},{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(H(),"$1:")}},{key:"set",value:function(t){this.elCSS.push("text-decoration: none; \n"),this.options=t;var n="";t.onTap&&this.onTap(t.onTap),t.tags&&Et(e,"setTags",this,3)([t.tags]),t.id&&this.res.setAttribute("id",t.id),t.id&&Et(e,"setID",this,3)([t.id]),this.commonMethods(t),t.flex&&(this.res.style.display="flex"),t.fixMobileTap&&this.fixMobileTap(t.fixMobileTap);var r=this.removeQuotesFromFirstWord(JSON.stringify(t.pad));if(t.pad&&(n+="\n pad: ".concat(r,",")),t.preffersId&&(this.preffersId=t.preffersId),null!=t.preffersId&&(n+="\n preffersId: ".concat(t.preffersId,",")),t.class&&Et(e,"setClass",this,3)([t.class]),t.class&&(n+='\n class: "'.concat(t.class,'",')),t.borderObj){this.res.style.border="".concat(t.borderObj.width," solid ").concat(t.borderObj.color),this.res.style.borderRadius="".concat(t.borderObj.radius);var o=this.removeQuotesFromFirstWord(JSON.stringify(t.borderObj));n+="\n borderObj: ".concat(o,",")}if(!1===this.options.preffersId?this.html.push('<a class="'.concat(t.class,'" href="#hello">').concat(t.text,"</a> \n \n")):t.id&&this.html.push('<a id="'.concat(t.id.substr(1),'" href="#hello">').concat(t.text,"</a> \n \n")),null!=t.blastData){var i=this.removeQuotesFromFirstWord(JSON.stringify(t.blastData));Et(e,"setAny",this,3)([{globalBlast:"1px ".concat(t.blastData.color)}]),t.blastData&&(n+="\n blastData: ".concat(i,","))}t.nowrap&&(this.res.style.whiteSpace="nowrap"),t.font&&this.font(t.font),t.font&&(n+='\n font: "'.concat(t.font,'",')),t.font&&this.elCSS.push('font-family: "'.concat(t.font,'"; \n')),t.fluidc&&this.fluidCopy(t.fluidc),t.fluidc&&(n+='\n fluidc: "'.concat(t.fluidc,'",')),t.clampc&&this.clampCopy(t.clampc),this.options.id&&(n+='\n id: "'.concat(this.options.id,'",')),t.align&&this.leftAlign(t.align),t.align&&(n+='\n align: "'.concat(t.align,'",')),t.type&&(this.res.style.display="block"),t.color&&this.color(t.color),t.color&&(n+='\n color: "'.concat(t.color,'",')),t.color&&this.elCSS.push('color: "'.concat(t.color,'"; \n')),t.background&&this.background(t.background);var a=this.removeQuotesFromFirstWord(JSON.stringify(t.background));t.background&&(n+="\n background: ".concat(a,",")),t.hover&&this.hover(t.hover);var s=this.removeQuotesFromFirstWord(JSON.stringify(t.hover));if(t.hover&&(n+="\n hover: ".concat(s,",")),t.blast&&(this.blastData=t.blast),t.bold&&(n+="\n bold: ".concat(t.bold,",")),t.block&&this.toBlock(),t.block&&(n+="\n block: ".concat(t.block,",")),t.radius&&(n+='\n radius: "'.concat(t.radius,'",')),t.width&&(n+='\n width: "'.concat(t.width,'",')),t.maxWidth&&this.maxWidth(t.maxWidth),t.url&&this.res.setAttribute("href",t.url),n+='\n url: "'.concat(t.url,'",'),t.text&&(this.res.textContent=t.text),n+='\n text: "'.concat(t.text,'",'),t.data){t.data&&this.appendImageAsChild(t.data,"20px");var l=this.removeQuotesFromFirstWord(JSON.stringify(t.data));t.data&&(n+="\n data: ".concat(l))}if(t.icon){this.addIcon(t.icon);var c=this.removeQuotesFromFirstWord(JSON.stringify(t.icon));n+="\n icon: ".concat(c,",")}if(t.shadow){var u=t.shadow,f=this.removeQuotesFromFirstWord(JSON.stringify(u));n+="\n shadow: ".concat(f,",")}if(t.stroke){var d=this.removeQuotesFromFirstWord(JSON.stringify(t.stroke));t.stroke&&(n+="\n stroke: ".concat(d,","))}if(t.backgroundOp){var h=this.removeQuotesFromFirstWord(JSON.stringify(t.backgroundOp));n+="\n backgroundOp: ".concat(h,",")}if(t.marginOp){var p=this.removeQuotesFromFirstWord(JSON.stringify(t.marginOp));n+="\n marginOp: ".concat(p,",")}if(t.gradient){var y=this.removeQuotesFromFirstWord(JSON.stringify(t.gradient));n+="\n gradient: ".concat(y,",")}if(t.animation){var m=this.removeQuotesFromFirstWord(JSON.stringify(t.animation));n+="\n animation: ".concat(m,",")}if(t.transform){var v=this.removeQuotesFromFirstWord(JSON.stringify(t.transform));n+="\n transform: ".concat(v,",")}if(t.blast){var b=this.removeQuotesFromFirstWord(JSON.stringify(t.blast));n+="\n blast: ".concat(b,",")}var g="new Link().set({".concat(n,"}) \n");this.code.push(g),t.color&&this.color(t.color),t.rounded&&this.round(),t.new&&(this.res.setAttribute("target","_blank"),this.res.setAttribute("rel","noopener noreferrer")),t.transform&&this.reactOnTransform(t.transform);var w=[],x=[t.border,t.blast,t.gradient,t.animation,t.span,t.shadow,t.backgroundOp,t.animation,t.transform];if((x=x.filter(function(t){return null!=t})).length>0){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&Et(e,"setAny",this,3)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]);for(var k=0;k<x.length;k++)w.push({range:x[k].range,log:x[k].op.name,target:x[k].target,op:x[k].op});var O=[];t.borderObj&&O.push("border"),t.background&&O.push("background"),t.mar&&O.push("margin"),t.animation&&O.push("animation"),this.chainReact(w,t.id,O,t.isNavA),this.res.style.zIndex=1}return this}},{key:"fixMobileTap",value:function(t){this.res.style.pointerEvents="auto",this.res.style.touchAction="manipulation",this.res.style.cursor="pointer",this.res.style.zIndex="1",this.res.style.position="relative"}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"leftAlign",value:function(t){return this.res.style.textAlign=t,this}},{key:"getClampValue",value:function(t){return"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){return"S1"===t&&(this.res.style.fontSize="calc(1.625rem + 5.075vw)"),"S2"===t&&(this.res.style.fontSize="calc(1.500rem + 4.3vw)"),"S3"===t&&(this.res.style.fontSize="calc(1.375rem + 3.525vw)"),"S4"===t&&(this.res.style.fontSize="calc(1.250rem + 2.75vw)"),"S5"===t&&(this.res.style.fontSize="calc(1.125rem + 1.975vw)"),"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"inlineBlock",value:function(){return this.res.style.display="inline-block",this}},{key:"toBlock",value:function(){return this.res.style.display="block",this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"newWindow",value:function(){return this.res.target="_new",this}},{key:"transition",value:function(t){return this.res.style.transition="".concat(t,"s ease-in-out"),this.res.style.transionProperty="background, color",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"medium",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2rem":t.res.style.fontSize="1.5em"};return e(),window.addEventListener("resize",e),this}},{key:"opacity",value:function(t){return this.res.style.opacity=t,this}},{key:"em",value:function(t){var e=this,n=window.matchMedia("(max-device-width: 415px)"),r=function(){n.matches?e.res.style.fontSize="2em":e.res.style.fontSize="1em"};return r(),window.addEventListener("resize",r),this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this):this.res}}])&&kt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Pt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return At(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(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.")}()}function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Rt(t){return Rt="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},Rt(t)}function Mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ft(r.key),r)}}function Ft(t){var e=function(t){if("object"!=Rt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rt(e)?e:e+""}function It(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(It=function(){return!!t})()}function Dt(){return Dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Lt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Dt.apply(null,arguments)}function Lt(t){return Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lt(t)}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}var Wt=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Lt(e),function(t,e){if(e&&("object"==Rt(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,It()?Reflect.construct(e,n||[],Lt(t).constructor):e.apply(t,n))}(this,e)).code=[],r.saveEl=n,r.frs=t,r.res=null,r.setup(),r.responsive(),r}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&&zt(t,e)}(e,t),n=e,r=[{key:"getType",value:function(){return"FlexRowLayoutElement"}},{key:"set",value:function(t){this.options=t;var e=t;return e.onTap&&this.onTap(e.onTap),e.id&&this.res.setAttribute("id",e.id),e.position&&(this.res.style.position=e.position),void 0!==e.top&&(this.res.style.top=e.top),t.id&&this.res.setAttribute("id",t.id),this.commonMethods(e),t.padding&&this.pad([{a:t.padding}]),t.background&&(this.res.style.backgroundColor="#ecf0f1",this.res.style.cornerRadius="#3rem"),t.alignTo&&(this.res.style.justifyContent=t.alignTo),t.background&&(this.res.style.backgroundColor=t.background),t.justify&&(this.res.style.justifyContent=t.justify),t.border&&("top"===t.border[0]&&(this.res.style.borderTop="".concat(t.border[1]," solid white")),"all"===t.border[0]&&(this.res.style.border="".concat(t.border[1]," solid orange"))),t.borderObj&&(this.borderObj(t.borderObj),JSON.stringify(t.borderObj)),t.width&&(this.res.style.width=t.width),t.height&&(this.res.style.height=t.height),t.gap&&(this.res.style.gap=t.gap),t.align&&(JSON.stringify(t.align),this.res.style.alignItems="flex-start",this.res.style.alignItems="flex-start"),t.wrap&&this.wrap(),t.alignIts&&(JSON.stringify(t.alignIts),this.res.style.alignItems="flex-start"),t.owrap&&this.onlyWrap(),null!=t.owrap&&!1===t.owrap&&(this.res.style.flexWrap="nowrap",this.res.style.background="yellow"),t.toColumn&&this.deprecatedOption("toColumn","colat"),t.column&&this.makeCol(),t.colat&&t.colat&&this.toColumnAt(t.colat),t.align&&this.makeJustify(t.justify),t.justify&&this.makeAlign(t.justify),"flex-start"===t.justifo&&(this.res.style.justifyContent="flex-start"),t.radius&&(this.res.style.borderRadius=t.radius),t.aligns&&this.aligns(t.aligns),this.callReact(e),!0===t.center&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"callReact",value:function(t){this.options=t;var n,r,o,i=[],a=t.transform&&"object"===Rt(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||a){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&(n=e,r=this,"function"==typeof(o=Dt(Lt(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var s=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,a?t.transform:void 0];s=s.filter(function(t){return null!=t});for(var l=0;l<s.length;l++)i.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];t.borderObj&&c.push("border"),t.background&&c.push("background"),t.mar&&c.push("margin"),t.animation&&c.push("animation"),t.span&&c.push("span"),this.chainReact(i,t.id,c)}}},{key:"toColumnAt",value:function(t){var e=this;if(!this.columnAlways){var n=function(){var n=window.matchMedia("(max-width: ".concat(t,")")),r=window.matchMedia("(max-device-width: 415px)");n.matches||r.matches?e.res.style.flexDirection="column":e.res.style.flexDirection="row"};n(),window.addEventListener("resize",n)}return this}},{key:"onlyWrap",value:function(){return this.res.style.flexWrap="wrap",this}},{key:"wrap",value:function(){return this.res.style.flexWrap="wrap",this.res.style.justifyContent="space-between",this}},{key:"aligns",value:function(t){return"start"===t&&(this.res.style.alignItems="flex-start"),"end"===t&&(this.res.style.alignItems="flex-end"),"center"===t&&(this.res.style.alignItems="center"),this}},{key:"toCode",value:function(){for(var t={},e=0,n=Object.entries(this.options||{});e<n.length;e++){var r=Pt(n[e],2),o=r[0],i=r[1];null!=i&&""!==i&&(t[o]=i)}var a=JSON.stringify(t,null,4).replace(H(),"$1:").replace(/"([^"]*)"/g,function(t,e){return e.includes("\n")?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')}),s=(this.items||[]).map(function(t){return null!=t&&t.toCode?t.toCode():"/* element */"}).join(",\n ");return[["new FlexRow().set(".concat(a,")"),s?".items([\n ".concat(s,"\n])"):""].join("")]}},{key:"cornerRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"makeJustify",value:function(t){return"start"===t&&(this.res.style.justifyContent="flex-start"),this}},{key:"makeAlign",value:function(t){return"center"===t?this.res.style.alignItems="center":this.res.style.justifyContent=t,this}},{key:"makeCol",value:function(){return this.res.style.flexDirection="column",this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"setup",value:function(){var t=document.createElement("div");return t.style.display="flex",t.style.justifyContent="space-around",t.style.alignItems="center",this.res=t,this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,window.matchMedia("(max-device-width: 415px)").matches&&t.mobile&&(this.res.style.width=t.mobile),this}},{key:"radius",value:function(t){return this.res.style.borderRadius="".concat(t,"px"),this}},{key:"shadow",value:function(t,e,n){return this.res.style.boxShadow="0px 1px 10px 0px rgb(145 145 145)",this}},{key:"items",value:function(t){this.els=t,this.items=t;for(var e=0;e<t.length;e++){if(null!=t[e])if(t[e].render instanceof Function){var n=t[e].render();this.res.appendChild(n)}else this.res.appendChild(t[e]);if(null!=t[e]&&t[e].render instanceof Function){var r=t[e].render();this.res.appendChild(r),void 0!==t[e].toCode&&this.code.push(t[e].toCode().flatMap(function(t){return t}))}}return this}},{key:"responsive",value:function(t){var e=this,n=window.matchMedia("(max-device-width: 415px)");return window.innerWidth<t||n.matches?this.res.style.gridTemplateColumns="1fr":this.res.style.gridTemplateColumns="1fr 1fr",window.addEventListener("resize",function(){window.innerWidth<t||n.matches?e.res.style.gridTemplateColumns="1fr":e.res.style.gridTemplateColumns="1fr 1fr"}),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&Mt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Bt(t){return Bt="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},Bt(t)}function Nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ut(r.key),r)}}function Ut(t){var e=function(t){if("object"!=Bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bt(e)?e:e+""}var Gt=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.obj=e||{},this.items=n||[]},(e=[{key:"render",value:function(){var t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent="space-around",t.setAttribute("id","innerItemsWrapper");var e=window.matchMedia("(max-device-width: 415px)"),n=window.matchMedia("(max-width: 600px)");(e.matches||n.matches)&&(t.style.marginTop="3rem");for(var r=0;r<this.items.length;r++){var o=this.items[r];t.appendChild(o.render())}var i=document.createElement("div");return i.style.width=this.obj.isSide?"333px":"100%",i.style.background=this.obj.background||"white",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",i.style.height="100%",i.setAttribute("id","outerItemsWrapper"),i.appendChild(t),this.obj.customStyle&&(t.style.width="auto",t.style.top="0rem",t.style.borderRadius="1rem",t.style.background=this.obj.background||"white",t.style.margin="1rem",t.style.position="absolute",t.style.opacity=.8),i}}])&&Nt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Ht(t){return Ht="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},Ht(t)}function Xt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return qt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function qt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Jt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vt(r.key),r)}}function Vt(t){var e=function(t){if("object"!=Ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ht(e)?e:e+""}function $t(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($t=function(){return!!t})()}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yt(t)}function Qt(t,e){return Qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qt(t,e)}"undefined"!=typeof window&&(window.CustomDivRenderer=Gt);var Kt=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Yt(e),function(t,e){if(e&&("object"==Ht(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,$t()?Reflect.construct(e,n||[],Yt(t).constructor):e.apply(t,n))}(this,e)}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&&Qt(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(t){return this.obj=t,this.setTags(this.obj.tags),this.animate=void 0===this.obj.animate||this.obj.animate,this.res=this.createSideNav(t),this.res.style.position="relative",this.res.style.zIndex=3,this.closed=!0,this}},{key:"toggleSideNav",value:function(t){var e=this;this.closed=!this.closed;var n=this.res.children[0];if(this.closed)if(n.style.overflowX="hidden",t.style.opacity=1,this.animate){this.ope=n.animate([{transform:"translateX(0)"},{transform:"translateX(100%)"}],{duration:300,fill:"forwards"}),this.ope.finished.then(function(){var t=new CustomEvent(e.obj.tags.close);window.dispatchEvent(t)});var r,o=-1,i=Xt(n.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(o+=1,this.masterEL[o]){var s,l=Xt(a.children);try{for(l.s();!(s=l.n()).done;){var c=s.value,u=this.masterEL[o].options.animation;u&&this.mappedIDS.includes(c.id)&&c.animate(u.op.keyframesClose,u.op.closeOptions)}}catch(t){l.e(t)}finally{l.f()}}}}catch(t){i.e(t)}finally{i.f()}}else n.style.display="none";else{n.style.overflowX="none";var f,d=-1,h=Xt(n.children);try{for(h.s();!(f=h.n()).done;){var p=f.value;d+=1;var y,m=Xt(p.children);try{for(m.s();!(y=m.n()).done;){var v=y.value;if(this.mappedIDS.includes(v.id)&&void 0!==this.masterEL[0]){var b=this.masterEL[d].options.animation;if(b){var g=b.op.openOptions;g.delay||(g.delay=1),g.duration||(g.duration=300),v.animate(b.op.keyframesOpen,g)}}}}catch(t){m.e(t)}finally{m.f()}}}catch(t){h.e(t)}finally{h.f()}t.style.opacity=0,this.animate?(n.style.display="flex",this.opeClose=n.animate([{transform:"translateX(100%)"},{transform:"translateX(0)"}],{duration:300,fill:"forwards"}),this.opeClose.finished.then(function(){var t=new CustomEvent(e.obj.tags.open);window.dispatchEvent(t)})):n.style.display="flex"}}},{key:"createToggleButton",value:function(t){var e=document.createElement("button");return e.innerText="☰",e.style.padding="10px 20px",e.style.backgroundColor="transparent",e.style.color=null!=t?t:"#3498db",e.style.border="none",e.style.borderRadius="5px",e.style.cursor="pointer",e.style.zIndex=1,e.style.fontSize="1.6rem",this.obj.fixed&&(e.style.position="fixed"),e}},{key:"createCloseButton",value:function(t){var e=document.createElement("button");return e.innerText="×",e.style.fontSize="1.6rem",e.style.padding="10px 20px",e.style.backgroundColor="transparent",e.style.color=null!=t?t:"black",e.style.border="none",e.style.borderRadius="5px",e.style.cursor="pointer",e.style.zIndex=1,e.style.alignSelf="flex-end",e}},{key:"createSideNav",value:function(t){var e=this,n=document.createElement("div");n.style.display="flex",n.style.justifyContent="flex-end";var r=document.createElement("div");r.style.display="none",r.style.background=this.obj.background||"#1abc9c",r.style.height="100%",window.matchMedia("(max-device-width: 415px)").matches?r.style.width="100%":r.style.width=this.obj.width||"400px",r.style.position="fixed",r.style.right=0,this.animate&&(r.style.transform="translateX(100%)"),r.style.flexDirection="column",r.style.justifyContent="flex-start";var o=this.createToggleButton(this.obj.hamColour.opened),i=this.createCloseButton(this.obj.hamColour.closed);return o.addEventListener("click",function(){return e.toggleSideNav(o)}),i.addEventListener("click",function(){return e.toggleSideNav(o)}),r.appendChild(i),n.appendChild(r),n.appendChild(o),n}},{key:"items",value:function(t){this.masterEL=t.items.filter(function(t){return void 0!==t.link});var e=t.items.filter(function(t){return void 0===t.items}).map(function(t){return t.id});if(this.mappedIDS=e,this.item=t,this.res.children[0].appendChild(t.render()),void 0!==this.masterEL[0]){var n=this.masterEL[0].options.animation;if(n){var r,o=Xt(this.res.children[0].children);try{for(o.s();!(r=o.n()).done;){var i,a=Xt(r.value.children);try{for(a.s();!(i=a.n()).done;){var s=i.value;this.mappedIDS.includes(s.id)&&(n.op.closeOptions.delay=0,s.animate(n.op.keyframesClose,n.op.closeOptions))}}catch(t){a.e(t)}finally{a.f()}}}catch(t){o.e(t)}finally{o.f()}}}return this}},{key:"toCode",value:function(){var t="new SideNav().setup(".concat(this.formatObj(this.obj),")");if(this.item){var e=this.item.toCode?this.item.toCode().join(""):this.formatObj(this.item);e=e.replace(/,\s*(\.set\(|\.add\()/g,"\n $1"),t+=".items(".concat(e,")")}return t}},{key:"formatObj",value:function(t){return JSON.stringify(t,null,2).replace(/"(\w+)"\s*:/g,"$1:")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}])&&Jt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Zt(t){return Zt="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},Zt(t)}function te(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ne(r.key),r)}}function ne(t){var e=function(t){if("object"!=Zt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zt(e)?e:e+""}function re(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(re=function(){return!!t})()}function oe(t){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oe(t)}function ie(t,e){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ie(t,e)}var ae=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=oe(e),function(t,e){if(e&&("object"==Zt(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,re()?Reflect.construct(e,n||[],oe(t).constructor):e.apply(t,n))}(this,e)).res=document.createElement("div"),t.res.style.display="grid",t.attributes={},t}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&&ie(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){return this.options=t,this.attributes=t,this.templateCols=t.templateCols,t.templateCols&&(this.res.style.gridTemplateColumns="repeat(".concat(t.templateCols.cols,", 1fr)"),this.res.style.gridTemplateRows="repeat(".concat(t.templateCols.cols,", 1fr)")),this.res.style.height=t.height?t.height:"600px",t.positions&&(this.storedPositions=t.positions),this}},{key:"generateGridPositions",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,o=document.createElement("div");o.classList.add("container"),o.style.display="grid",o.style.gridTemplateColumns="repeat(".concat(r,", 1fr)"),o.style.gridTemplateRows="repeat(".concat(n,", 1fr)"),o.style.width="100%",o.style.height="100vh";var i=t.map(function(t,e){return{row:Math.floor(n/2)+e,col:Math.floor(r/2)+e}});return t.forEach(function(o,a){var s=i[a],l=s.row,c=s.col,u=function(e){var n=0,r=0;return t.forEach(function(t,o){var a=t.weight,s=t.direction,l=i[e],c=i[o],u=l.col-c.col,f=l.row-c.row,d=a*(1/(Math.sqrt(u*u+f*f)+1));switch(s){case"L":n-=d;break;case"R":n+=d;break;case"U":r-=d;break;case"B":r+=d}}),{forceX:n,forceY:r}}(a),f=u.forceX,d=u.forceY;c=Math.max(1,Math.min(r,c+Math.round(f))),l=Math.max(1,Math.min(n,l+Math.round(d)));var h=e.items.filter(function(t){return t.id===o.attract.slice(1)})[0].render();h.style.gridRowStart=l,h.style.gridColumnStart=c,h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.fontWeight="bold",e.res.appendChild(h)}),this}},{key:"add",value:function(t){this.items=t;var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return te(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.res.appendChild(r.render())}}catch(t){n.e(t)}finally{n.f()}return this.storedPositions&&this.generateGridPositions(this.storedPositions),this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=X(this.options,4),e="";return e+=".add([\n",e+=this.items.map(function(t){return t.toCode().join("").trim()}).join(",\n"),e+="\n])",["new Free().set(".concat(t,")").concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&ee(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function se(t){return se="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},se(t)}function le(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ce(r.key),r)}}function ce(t){var e=function(t){if("object"!=se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==se(e)?e:e+""}function ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ue=function(){return!!t})()}function fe(t){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fe(t)}function de(t,e){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},de(t,e)}var he=function(t){function e(t){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,n){return e=fe(e),function(t,e){if(e&&("object"==se(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,ue()?Reflect.construct(e,n||[],fe(t).constructor):e.apply(t,n))}(this,e)).url=t,n.res=null,n.setup(),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&&de(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){this.res=document.createElement("audio"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&le(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function pe(t){return pe="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},pe(t)}function ye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,me(r.key),r)}}function me(t){var e=function(t){if("object"!=pe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pe(e)?e:e+""}function ve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ve=function(){return!!t})()}function be(){return be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ge(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},be.apply(null,arguments)}function ge(t){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ge(t)}function we(t,e){return we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},we(t,e)}var xe=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=ge(e),function(t,e){if(e&&("object"==pe(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,ve()?Reflect.construct(e,n||[],ge(t).constructor):e.apply(t,n))}(this,e)).res=document.createElement("code"),t.pre=document.createElement("pre"),t.res.style.background="#18232e",t.res.style.display="block",t.res.style.width="auto",t.res.style.height="auto",t.res.style.borderRadius="1rem",t.pre.appendChild(t.res),t}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&&we(t,e)}(e,t),n=e,r=[{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"toCode",value:function(){var t=this.options;Object.keys(t).forEach(function(e){return void 0===t[e]&&delete t[e]});var e=JSON.stringify(t,null,2).replace(H(),"$1:").replace(/"([^"]+)"/g,function(t,e){return e.includes("\n")||e.includes("'")||e.includes('"')?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')});return"new Code().set(".concat(e,")")}},{key:"callReact",value:function(t){this.options=t;var n,r,o,i=[],a=t.transform&&"object"===pe(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||a){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&(n=e,r=this,"function"==typeof(o=be(ge(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var s=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,a?t.transform:void 0];s=s.filter(function(t){return null!=t});for(var l=0;l<s.length;l++)i.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];t.borderObj&&c.push("border"),t.background&&c.push("background"),t.mar&&c.push("margin"),t.animation&&c.push("animation"),t.span&&c.push("span"),this.chainReact(i,t.id,c)}}},{key:"set",value:function(t){return t.code&&(this.pre.children[0].innerHTML=t.code),t.class&&this.pre.children[0].setAttribute("class","".concat(t.class)),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.resprop&&this.resprop(t.resprop),t.width&&(this.res.style.width=t.width),t.background&&(this.res.style.background=t.background),t.color&&(this.res.style.color=t.color),t.borderRadius&&(this.res.style.background=t.borderRadius),t.borderObj&&(this.res.style.border="".concat(t.borderObj.width," solid ").concat(t.borderObj.color),this.res.style.borderRadius="".concat(t.borderObj.radius)),this.callReact(t),this}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.pre),this.res}}],r&&ye(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function ke(t){return ke="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},ke(t)}function Oe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Se(r.key),r)}}function Se(t){var e=function(t){if("object"!=ke(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ke(e)?e:e+""}function Ee(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ee=function(){return!!t})()}function je(t){return je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},je(t)}function Te(t,e){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Te(t,e)}var _e=function(t){function e(t){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,n){return e=je(e),function(t,e){if(e&&("object"==ke(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,Ee()?Reflect.construct(e,n||[],je(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,n.res=null,n.st=t,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&&Te(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){var t=document.createElement("div");return t.style.display="grid",this.res=t,this.st&&this.sticky(),this}},{key:"set",value:function(t){return this.setup(),t.height&&(this.res.style.height=t.height),t.sticky&&this.sticky(),this}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"add",value:function(t){this.children=t;for(var e=0;e<t.length;e++){var n=t[e].render();n.style.gridColumn=1,n.style.gridRow=1,this.res.appendChild(n)}return this}},{key:"toCode",value:function(){var t="new Stack().set({})";if(this.children.length>0){var e=this.children.map(function(t){return t.toCode()}).join(",\n");t+=".add([\n \n ".concat(e," \n \n])")}return[t]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector("body").style.margin=0,document.querySelector("body").style.padding=0,document.querySelector(t).appendChild(this.res)}}])&&Oe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Ce(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ae(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Pe(t){return Pe="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},Pe(t)}function Ae(t,e){if(t){if("string"==typeof t)return Re(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(t,e):void 0}}function Re(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fe(r.key),r)}}function Fe(t){var e=function(t){if("object"!=Pe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pe(e)?e:e+""}function Ie(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ie=function(){return!!t})()}function De(){return De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Le(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},De.apply(null,arguments)}function Le(t){return Le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Le(t)}function ze(t,e){return ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ze(t,e)}var We=function(t){function e(t){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,n){return e=Le(e),function(t,e){if(e&&("object"==Pe(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,Ie()?Reflect.construct(e,n||[],Le(t).constructor):e.apply(t,n))}(this,e)).res=null,n.setup(t),n.code=[],n.isLast=!1,n.constrObj=t,n.code.push("\n new Wrapper() \n"),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&&ze(t,e)}(e,t),n=e,r=[{key:"toCode",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var n=" ".repeat(e),r="".concat(n,'new Wrapper("').concat(this.constrObj,'")');if(this.constrObj||(r="".concat(n,"new Wrapper()")),Object.keys(this.obj).length){var o=X(Object.fromEntries(Object.entries(this.obj).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||Ae(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]})),2);r+="\n".concat(n," .set(").concat(o,")")}return null!==(t=this.items)&&void 0!==t&&t.length&&(r+="\n".concat(n," .add([\n")+this.items.map(function(t){return t.toCode(e+4)}).join(",\n")+"\n".concat(n," ])")),[r+="\n".concat(n)]}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(t){this.obj=t,this.commonMethods(t),t.onTap&&this.onTap(t.onTap);var n=".set({";t.isHidden&&this.isHidden(t.isHidden),t.scale&&(this.res.style.scale=t.scale),t.scale&&(n+="scale: ".concat(t.scale)),t.keySet&&this.keySet(t.keySet),t.resprop&&this.resprop(t.resprop),t.position&&(this.res.style.position=t.position),void 0!==t.top&&(this.res.style.top=t.top),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.gpos&&this.gpos(t.gpos);var r,o,i,a=[],s=t.transform&&"object"===Pe(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||s){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&(r=e,o=this,"function"==typeof(i=De(Le(1&3?r.prototype:r),"setAny",o))?function(t){return i.apply(o,t)}:i)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var l=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,s?t.transform:void 0];l=l.filter(function(t){return null!=t});for(var c=0;c<l.length;c++)a.push({range:l[c].range,log:l[c].op.name,target:l[c].target,op:l[c].op});var u=[];t.borderObj&&u.push("border"),t.background&&u.push("background"),t.mar&&u.push("margin"),t.animation&&u.push("animation"),t.span&&u.push("span"),s&&u.push("transform"),t.gradient&&u.push("gradient"),t.blast,this.options=t,this.chainReact(a,this.options.id,u)}if(t.centerColumn&&this.deprecatedOption("centerColumn",'center: "x"'),t.mboth&&(this.deprecatedOption("mboth",'mar: "center"'),this.mar("center")),t.mar&&this.mar(t.mar),t.sticky&&this.sticky(),t.transition&&(this.res.style.transition=t.transition),t.class&&this.res.setAttribute("class",t.class),t.ga&&(this.res.style.gridArea=t.ga),t.opacity&&(0==t.opacity&&(this.res.style.opacity=0),t.opacity&&(this.res.style.opacity=t.opacity)),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.id&&this.res.setAttribute("id",t.id),t.simpleCenter&&this.deprecatedOption("simpleCenter","center: true"),t.filter&&(this.res.style.backdropFilter="blur(3px)"),t.radius&&this.corner(t.radius),t.radius&&(n+='\n radius: "'.concat(t.radius,'",')),t.border&&this.border(t.border),t.simpleBorder&&(this.res.style.border=t.simpleBorder),t.width&&this.width(t.width),t.width&&(n+='\n width: "'.concat(t.width,'",')),t.overflow&&(n+='\n overflow: "'.concat(t.overflow,'",')),t.height&&this.heightNoAuto(t.height),t.height&&(n+='\n height: "'.concat(t.height,'",')),t.align&&this.flexAlign(t.align),t.align&&(n+='\n align: "'.concat(t.align,'",')),t.borderObj&&(this.res.style.border="".concat(t.borderObj.width," solid ").concat(t.borderObj.color),void 0!==t.borderObj.radius&&(this.res.style.borderRadius=t.borderObj.radius)),t.borderObja&&(this.res.style.border="".concat(t.borderObja.width," solid ").concat(t.borderObja.color),void 0!==t.borderObja.radius&&(this.res.style.borderRadius=t.borderObja.radius)),t.font&&this.font(t.font),t.font&&(n+='font: "'.concat(t.font,'",')),t.maxWidth&&this.maxWidth(t.maxWidth),t.flexCenter&&this.deprecatedOption("flexCenter",'center: "y"'),t.color&&this.color(t.color),t.background&&this.background(t.background),t.background&&(n+='background: "'.concat(t.background,'",')),t.weight&&this.weight(t.weight),t.area&&this.setArea(t.area),t.area&&(n+='area: "'.concat(t.area,'"')),t.column&&this.makeCol(),t.column&&(n+='\n column: "'.concat(t.column,'",')),t.alignIts&&(this.res.style.background="gray"),t.alignIts&&(this.res.style.alignItems="flex-start"),t.alignIts&&(this.res.style.justifyItems="flex-start"),t.customAlign&&(this.res.style.alignItems=t.customAlign),t.customJustify&&(this.res.style.justifyItems=t.customJustify),t.disp&&(this.res.style.display=t.disp),t.flexDir&&(this.res.style.flexDirection=t.flexDir),t.flexDir&&(this.res.style.display="flex"),t.flexDir&&(n+='\n flexDir: "'.concat(t.flexDir,'",')),t.center&&(n+="center: ".concat(JSON.stringify(t.center),",")),t.zIndex&&(this.res.style.zIndex=t.zIndex),t.transform&&"object"===Pe(t.transform)&&this.reactOnTransform(t.transform),t.name&&(this.name=t.name),t.responsive&&this.rsp(t.responsive),t.stretch){t.stretch&&this.stretch(t.stretch);var f=this.removeQuotesFromFirstWord(JSON.stringify(t.stretch));n+="\n stretch: ".concat(f,",")}for(var d in t)if("margin"===d){var h=t[d];if(Array.isArray(h)&&h.length>0){var p,y=Ce(h);try{for(y.s();!(p=y.n()).done;){var m=p.value;m.hasOwnProperty("top")&&(this.res.style.marginTop=m.top),m.hasOwnProperty("right")&&(this.res.style.marginRight=m.right),m.hasOwnProperty("bottom")&&(this.res.style.marginBottom=m.bottom),m.hasOwnProperty("left")&&(this.res.style.marginLeft=m.left)}}catch(t){y.e(t)}finally{y.f()}}}return 8===(n+="})\n").length&&(n=""),this.code.push(n),this}},{key:"rsp",value:function(t){var e=this;this.res.style.display="flex";var n=t.sequence.split("-"),r=function(){var r=t.ranges;"0px"!==r[0]&&r.unshift("0px");for(var o=0;o<r.length-1;o++)(window.matchMedia("(min-width: ".concat(r[o],") and (max-width: ").concat(r[o+1],")")).matches||window.matchMedia("(min-width: ".concat(r[r.length-1],")")).matches)&&("row"===n[o]&&(e.res.style.flexDirection="row",e.res.style.border="3px solid green"),"col"===n[o]&&(e.res.style.flexDirection="column",e.res.style.border="3px solid purple"));return e};window.addEventListener("resize",r),r()}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"toSticky",value:function(){return this.res.style.position="sticky",this.res.style.top="0",this}},{key:"stretch",value:function(t){var e=this,n=function(){window.matchMedia("(max-width: ".concat(t.at,")")).matches?e.res.style.width="auto":window.matchMedia("(max-device-width: 415px)").matches?e.res.style.width="100%":e.res.style.width=t.backTo};n(),window.addEventListener("resize",n)}},{key:"makeCol",value:function(){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="flex-start",this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"flexAlign",value:function(t){return this.res.style.display="flex",this.res.style.justifyContent="flex-start",this.res.style.alignItems="flex-start","center"===t?(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="center",this):this}},{key:"heightNoAuto",value:function(t){return this.res.style.height=t,this}},{key:"border",value:function(t){return this.res.style.borderRadius="".concat(t.radius,"px"),this.res.style.border="".concat(t.width,"px solid ").concat(t.color),this}},{key:"add",value:function(t){this.items=t,this.code.push(".add([ \n");var e=t.map(function(e,n){return e.toCode().flatMap(function(t){return t}).join("")+(n<t.length-1?",":"")}).join("");this.code.push(e);for(var n=0;n<t.length;n++)if(void 0!==t[n]&&void 0!==t[n].toCode){var r=t[n].render();this.res.appendChild(r)}return this.code.push("])"),this}},{key:"setWidth",value:function(t){this.res.style.width="100vw"}},{key:"setHeight",value:function(t){return this.res.style.height="".concat(t),this}},{key:"setup",value:function(t){var e=null;return t?(t.isLink&&(e=document.createElement("a")),"aside"===t&&(e=document.createElement("aside")),"article"===t&&(e=document.createElement("article")),"main"===t&&(e=document.createElement("main")),"section"===t&&(e=document.createElement("section")),"header"===t&&(e=document.createElement("header")),"footer"===t&&(e=document.createElement("footer"))):e=document.createElement("div"),t&&t.isLink&&(e.style.textDecoration="none",e.setAttribute("href",t.child)),this.res=e,this.res.style.margin=0,this.res.style.padding=0,t&&!0===t.hideOverflow&&(this.res.style.overflow="hidden",this.res.style.overflowY="scroll"),t&&!0===t.center&&(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center",this.res.style.alignItems="center"),t&&"left"===t.align&&(this.res.style.alignItems="flex-start"),t&&"right"===t.align&&(this.res.style.alignItems="flex-end"),t&&t.height&&(this.res.style.height=t.height),t&&t.width&&(this.res.style.width=t.width,this.res.style.marginLeft="auto",this.res.style.marginRight="auto",window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="95%")),this}},{key:"height",value:function(t){return this.res.style.width="auto",this.res.style.height="".concat(t),this}},{key:"dimensions",value:function(t,e){return this.w=t,this.h=e,this.w?this.res.style.width=this.w:this.res.style.width=window.innerWidth,this.h?this.res.style.height=this.h:this.res.style.height=window.innerHeight,this}},{key:"size",value:function(t,e){return this.deprecatedOption("size() on this component","dimensions(w, h)"),this.dimensions(t,e)}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"corner",value:function(t){return this.res.style.borderRadius=t,this}},{key:"apply",value:function(t){var e=this,n=function(){for(var n=0;n<t.length;n++){var r=t[n],o=window.matchMedia("(max-width: ".concat(r.width,"px)"));r.device&&(o=window.matchMedia("(max-device-width: ".concat(r.width,"px)"))),o.matches&&Object.assign(e.res.style,r.styles)}},r=window.matchMedia("(max-width: ".concat(t[0].width,"px)"));return t[0].device&&(r=window.matchMedia("(max-device-width: ".concat(t[0].width,"px)"))),r.matches||Object.assign(this.res.style,t[0].styles),n(),window.addEventListener("resize",n),this}},{key:"mount",value:function(t){document.querySelector(t).appendChild(this.res)}},{key:"render",value:function(t){return t?(document.querySelector("#mount"),document.querySelector(t).appendChild(this.res),this):this.res}}],r&&Me(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Be(t){return Be="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},Be(t)}function Ne(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ue(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,He(r.key),r)}}function He(t){var e=function(t){if("object"!=Be(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Be(e)?e:e+""}function Xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Xe=function(){return!!t})()}function qe(){return qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Je(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},qe.apply(null,arguments)}function Je(t){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Je(t)}function Ve(t,e){return Ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ve(t,e)}var $e=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Je(e),function(t,e){if(e&&("object"==Be(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,Xe()?Reflect.construct(e,n||[],Je(t).constructor):e.apply(t,n))}(this,e)).res=document.createElement("table"),t.res.style.borderCollapse="separate",t.res.style.borderSpacing="0",t.res.style.overflow="hidden",t}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&&Ve(t,e)}(e,t),n=e,r=[{key:"add",value:function(t){this.data=t,this.datas=t;var e=Object.keys(t[0]);return this.generateTable(this.res,t),this.generateTableHead(this.res,e),this}},{key:"style",value:function(t){return t.font&&(this.res.style.fontFamily=t.font),this}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(t){return t.cellPadding&&this.cellPadding(t.cellPadding),t.cellAlign&&this.cellAlign(t.cellAlign),t.style&&this.style(t.style),t.headStyle&&this.headStyle(t.headStyle),t.border&&this.border(t.border),t.center&&this.center(t.center),t.borderRadius&&this.borderRadius(t.borderRadius),t.gradient&&(this.res.style.background=t.gradient.op.gradient,this.res.style.backgroundClip="padding-box"),this.obj=t,this.options=t,this.callReact(t),this}},{key:"callReact",value:function(t){var n,r,o,i=[];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&&(n=e,r=this,"function"==typeof(o=qe(Je(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var a=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,t.transform];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];t.borderObj&&l.push("border"),t.background&&l.push("background"),t.mar&&l.push("margin"),t.animation&&l.push("animation"),t.span&&l.push("span"),l.push("border"),this.chainReact(i,this.options.id,l)}}},{key:"toCode",value:function(){var t=JSON.stringify(this.data,null,2),e=JSON.stringify(this.obj,null,2);return t=t.replace(/"(\w+)"\s*:/g,"$1:"),e=e.replace(/"(\w+)"\s*:/g,"$1:"),["new Table()\n .add(".concat(t,")\n .set(").concat(e,")")]}},{key:"borderRadius",value:function(t){return this.res.style.borderRadius="".concat(4*t,"px"),this.res.style.overflow="hidden",this}},{key:"cellPadding",value:function(t){var e,n=Ne(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,o=Ne(e.value.cells);try{for(o.s();!(r=o.n()).done;)r.value.style.padding=t}catch(t){o.e(t)}finally{o.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"cellAlign",value:function(t){var e,n=Ne(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,o=Ne(e.value.cells);try{for(o.s();!(r=o.n()).done;)r.value.style.textAlign=t}catch(t){o.e(t)}finally{o.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"headStyle",value:function(t){var e=this.res.rows[0];return e&&(e.style.color=t.color,t.background&&(e.style.backgroundColor=t.background)),this}},{key:"border",value:function(t){var e;this.res.style.borderCollapse="separate",this.res.style.borderSpacing="0",this.res.style.border=t,this.res.style.borderRadius="12px";var n,r=Ne(this.res.rows);try{for(r.s();!(n=r.n()).done;){var o,i=Ne(n.value.cells);try{for(i.s();!(o=i.n()).done;)o.value.style.border="none"}catch(t){i.e(t)}finally{i.f()}}}catch(t){r.e(t)}finally{r.f()}for(var a=0;a<this.res.rows.length-1;a++){var s,l=Ne(this.res.rows[a].cells);try{for(l.s();!(s=l.n()).done;)s.value.style.borderBottom=t}catch(t){l.e(t)}finally{l.f()}}var c,u=(null===(e=this.res.rows[0])||void 0===e?void 0:e.cells.length)||0,f=Ne(this.res.rows);try{for(f.s();!(c=f.n()).done;)for(var d=c.value,h=0;h<u-1;h++)d.cells[h].style.borderRight=t}catch(t){f.e(t)}finally{f.f()}return this}},{key:"generateTableHead",value:function(t,e){var n,r=t.createTHead().insertRow(),o=Ne(e);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=document.createElement("th");a.textContent=i,r.appendChild(a)}}catch(t){o.e(t)}finally{o.f()}}},{key:"generateTable",value:function(t,e){var n,r=Ne(e);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=t.insertRow();for(var a in o)i.insertCell().textContent=o[a]}}catch(t){r.e(t)}finally{r.f()}}},{key:"render",value:function(t){var e=document.createElement("div");if(e.style.overflowX="auto",e.appendChild(this.res),!t)return e;document.querySelector(t).appendChild(e)}}],r&&Ge(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Ye(t){return Ye="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},Ye(t)}function Qe(t,e){if(t){if("string"==typeof t)return Ke(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ke(t,e):void 0}}function Ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ze(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tn(r.key),r)}}function tn(t){var e=function(t){if("object"!=Ye(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ye(e)?e:e+""}function en(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(en=function(){return!!t})()}function nn(t){return nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nn(t)}function rn(t,e){return rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rn(t,e)}var on=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=nn(e),function(t,e){if(e&&("object"==Ye(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,en()?Reflect.construct(e,n||[],nn(t).constructor):e.apply(t,n))}(this,e)).res=document.createElement("div"),t.res.style.position="relative",t.toggleWrap=document.createElement("div"),t.toggleWrap.style.zIndex=9999,t.toggleWrap.style.borderRadius="0.3rem",t.toggleWrap.style.cursor="pointer",t.toggleWrap.style.display="flex",t.toggleWrap.style.alignItems="center",t.toggleWrap.style.justifyContent="center",t.res.appendChild(t.toggleWrap),t.contentWrap=document.createElement("div"),t.contentWrap.style.position="fixed",t.contentWrap.style.background="#ecf0f1",t.contentWrap.style.borderRadius="0.3rem",t.contentWrap.style.boxShadow="0 2px 5px rgba(0, 0, 0, 0.15)",t.contentWrap.style.width="250px",t.contentWrap.style.display="none",t.contentWrap.style.zIndex=99999,document.addEventListener("DOMContentLoaded",function(){document.body.appendChild(t.contentWrap)}),document.body&&document.body.appendChild(t.contentWrap),t.styles={},t.children=[],t.isExpanded=!1,t}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&&rn(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){var e=this;this.options=t,t.title&&(this.toggleWrap.textContent=t.title),t.width&&(this.toggleWrap.style.width=t.width),t.contentWidth&&(this.contentWrap.style.width=t.contentWidth),t.background&&(this.contentWrap.style.backgroundColor=t.background),t.radius&&(this.contentWrap.style.borderRadius=t.radius);var n=function(){var t=e.toggleWrap.getBoundingClientRect(),n=e.contentWrap.style.display,r=e.contentWrap.style.visibility;"none"===n&&(e.contentWrap.style.visibility="hidden",e.contentWrap.style.display="block");var o=e.contentWrap.getBoundingClientRect();"none"===n&&(e.contentWrap.style.display=n,e.contentWrap.style.visibility=r||"");var i=window.innerWidth,a=t.left+t.width/2-o.width/2;a<8&&(a=8),a+o.width>i-8&&(a=i-8-o.width),a<8&&(a=8),e.contentWrap.style.top=t.bottom+4+"px",e.contentWrap.style.left=a+"px"};this._positionContent=n;var r=function(){"none"!==e.contentWrap.style.display&&n()};if(window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),t.behaviour){var o=t.behaviour;if("mouseover"===o||"mouseenter"===o){var i,a=function(){clearTimeout(i),e.contentWrap.style.display="block",n()},s=function(){i=setTimeout(function(){e.contentWrap.style.display="none"},200)};this.toggleWrap.addEventListener("mouseenter",a),this.toggleWrap.addEventListener("mouseleave",s),this.contentWrap.addEventListener("mouseenter",a),this.contentWrap.addEventListener("mouseleave",s),this.toggleWrap.addEventListener("click",function(t){t.stopPropagation(),"block"===e.contentWrap.style.display?e.contentWrap.style.display="none":(e.contentWrap.style.display="block",n())}),document.addEventListener("click",function(t){"block"!==e.contentWrap.style.display||e.contentWrap.contains(t.target)||e.toggleWrap.contains(t.target)||(e.contentWrap.style.display="none")})}else"click"===o?this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&n()}):this.res.addEventListener(o,function(){e.contentWrap.style.display="block",n()})}else this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&n()});return t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),this}},{key:"add",value:function(t){var e,n=this;if(!Array.isArray(t))throw new Error("The 'add' method expects an array of children.");if(t.forEach(function(t,e){if(0!==e){if(!(t.res instanceof HTMLElement))throw new Error("Each child must have a valid 'element' property that is an HTMLElement.");n.contentWrap.appendChild(t.res)}}),!this.options||!this.options.title){var r=t[0];r&&r.res&&this.toggleWrap.appendChild(r.res)}return(e=this.children).push.apply(e,function(t){return function(t){if(Array.isArray(t))return Ke(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Qe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t)),this}},{key:"toggle",value:function(){this.isExpanded=!this.isExpanded,this.contentWrap.style.display=this.isExpanded?"block":"none"}},{key:"toCode",value:function(){var t=this,e=this.options?Object.entries(this.options).map(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||Qe(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),n=e[0],r=e[1];return"string"==typeof r?"".concat(n,': "').concat(r,'"'):"object"===Ye(r)?"".concat(n,": ").concat(JSON.stringify(r)):"".concat(n,": ").concat(r)}).join(",\n "):"",n=this.children.map(function(e,n){return e.toCode().flatMap(function(t){return t}).join("")+(n<t.children.length-1?",":"")}).join("");return["new Dropdown().set({\n ".concat(e,"\n}).add([\n ").concat(n,"\n])")]}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}],r&&Ze(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function an(t){return an="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},an(t)}function sn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ln(r.key),r)}}function ln(t){var e=function(t){if("object"!=an(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=an(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==an(e)?e:e+""}function cn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(cn=function(){return!!t})()}function un(t){return un=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},un(t)}function fn(t,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fn(t,e)}var dn=function(t){function e(t){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,n){return e=un(e),function(t,e){if(e&&("object"==an(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,cn()?Reflect.construct(e,n||[],un(t).constructor):e.apply(t,n))}(this,e)).text=t,n.res=null,n.valid=!1,n.setup(),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&&fn(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("input");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.padding=".4rem .75rem",this.res.style.fontSize="1rem",window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"set",value:function(t){var e;return this.options=t,this.res.setAttribute("type",null!==(e=t.type)&&void 0!==e?e:"text"),t.placeholder&&(this.res.placeholder=t.placeholder),t.name&&this.res.setAttribute("name",t.name),t.id&&this.res.setAttribute("id",t.id),t.required&&this.res.setAttribute("required",""),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.exact&&(this.res.style.fontSize=t.exact),t.radius&&this.round(t.radius),t.color&&(this.res.style.color=t.color),t.background&&(this.res.style.background=t.background),t.font&&(this.res.style.fontFamily=t.font),t.weight&&(this.res.style.fontWeight=t.weight),t.bold&&(this.res.style.fontWeight="bold"),t.theme&&this.theme(t.theme),this.commonMethods(t),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new TextField().set(".concat(t,")")]}},{key:"setValid",value:function(t,e){return this.res.style.border=t?"6px solid green":"6px solid red",0===e.length&&(this.res.style.border="none"),this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="3rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"value",value:function(t){return this.res.setAttribute("value",t),this}},{key:"password",value:function(){return this.res.setAttribute("type","password"),this}},{key:"number",value:function(){return this.res.setAttribute("type","number"),this}},{key:"process",value:function(t){return this.res.value}},{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:"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:"placeholder",value:function(t){return this.res.setAttribute("placeholder",t),this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"onChange",value:function(t){var e=this;return this.res.value,this.res.addEventListener("input",function(n){t(e.res.value)}),this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this.res):this.res}}],r&&sn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function hn(t){return hn="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},hn(t)}function pn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yn(r.key),r)}}function yn(t){var e=function(t){if("object"!=hn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hn(e)?e:e+""}function mn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(mn=function(){return!!t})()}function vn(t){return vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vn(t)}function bn(t,e){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bn(t,e)}var gn=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=vn(e),function(t,e){if(e&&("object"==hn(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,mn()?Reflect.construct(e,n||[],vn(t).constructor):e.apply(t,n))}(this,e)).navbar=document.createElement("nav"),t.navbar.classList.add("desktop-navbar"),t.navbarHeader=document.createElement("div"),t.navbarHeader.classList.add("navbar-header"),t.brand=document.createElement("div"),t.brand.classList.add("navbar-brand"),t.navContent=document.createElement("div"),t.navContent.classList.add("navbar-content"),t.navContent.style.width="100%",t.navContent.style.alignItems="center",t.navbarHeader.appendChild(t.brand),t.navbarHeader.appendChild(t.navContent),t.navbar.appendChild(t.navbarHeader),t.res=t.navbar,t}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&&bn(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){return this.obj=t,this.setStyles(t),t.background&&(this.res.style.backgroundColor=t.background),t.brand&&this.setBrand(t.brand),t.radius&&(this.res.style.borderRadius=t.radius),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.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),this}},{key:"setStyles",value:function(){var t;this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=null!==(t=this.obj.background)&&void 0!==t?t:"#333",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.navContent.style.display="flex",this.navContent.style.gap="1rem"}},{key:"setBrand",value:function(t){return this.brand.innerHTML="",this.brand.appendChild(t),this}},{key:"add",value:function(t){this.items=t;for(var e=0;e<t.length;e++)t[e],this.navContent.appendChild(t[e].render());return this}},{key:"toCode",value:function(){var t=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t});return"new DesktopBar().set(".concat(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),").add([\n ").concat(t.join(","),"\n\n \n \n\n ])")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}])&&pn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function wn(t){return wn="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},wn(t)}function xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kn(r.key),r)}}function kn(t){var e=function(t){if("object"!=wn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wn(e)?e:e+""}function On(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(On=function(){return!!t})()}function Sn(){return Sn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=En(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Sn.apply(null,arguments)}function En(t){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},En(t)}function jn(t,e){return jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jn(t,e)}var Tn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=En(e),function(t,e){if(e&&("object"==wn(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,On()?Reflect.construct(e,n||[],En(t).constructor):e.apply(t,n))}(this,e)}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&&jn(t,e)}(e,t),n=e,r=[{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(H(),"$1:")}},{key:"toCode",value:function(){var t=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t}),e=(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),'\nbackground: "'.concat(this.obj.background,'",\nbrand: ').concat(this.obj.brand.toCode(),",\nmar: ").concat(JSON.stringify(this.obj.mar),",\npad: ").concat(JSON.stringify(this.obj.pad),",\nresmar: ").concat(JSON.stringify(this.obj.resmar),",\nrespad: ").concat(JSON.stringify(this.obj.respad),",\nradius: ").concat(JSON.stringify(this.obj.radius),",\n"));return"new MobileBar().set({".concat(e,"}).add([\n ").concat(t.join(","),"\n\n ])")}},{key:"set",value:function(t){var n,r,o;return this.obj=t,this.obj=t,this.makeNavbar(t),t.mar&&(n=e,r=this,"function"==typeof(o=Sn(En(1&3?n.prototype:n),"mar",r))?function(t){return o.apply(r,t)}:o)([t.mar]),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.radius&&(this.res.style.borderRadius=t.radius),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),this.setStyles(t),this}},{key:"makeNavbar",value:function(t){var e=this,n=t.brand;this.navbar=document.createElement("nav"),this.navbar.classList.add("mobile-navbar"),this.navbarHeader=document.createElement("div"),this.navbarHeader.classList.add("navbar-header"),this.brand=document.createElement("div"),this.brand.classList.add("navbar-brand"),t.brand&&"function"==typeof n.render&&(console.log("Appending brand:",n.render()),this.brand.appendChild(n.render())),this.toggleButton=document.createElement("button"),this.toggleButton.classList.add("navbar-toggle"),this.toggleButton.innerHTML="&#9776;",this.navContent=document.createElement("div"),this.navContent.classList.add("navbar-content"),this.navbarHeader.appendChild(this.brand),this.navbarHeader.appendChild(this.toggleButton),this.navbar.appendChild(this.navbarHeader),this.navbar.appendChild(this.navContent),this.isMobileNavOpen=!1,this.toggleButton.addEventListener("click",function(){e.toggleMobileNav()}),this.res=this.navbar}},{key:"setStyles",value:function(t){var e,n;this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=null!==(e=t.background)&&void 0!==e?e:"orange",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.toggleButton.style.background="none",this.toggleButton.style.border="none",this.toggleButton.style.color=null!==(n=this.hamburgerColour)&&void 0!==n?n:"#34495e",this.toggleButton.style.fontSize="1.5rem",this.toggleButton.style.cursor="pointer",this.navContent.style.display="none"}},{key:"add",value:function(t){this.items=t;for(var e=0;e<t.length;e++){var n=t[e];this.navContent.appendChild(n.render())}return this}},{key:"toggleMobileNav",value:function(){this.isMobileNavOpen=!this.isMobileNavOpen,this.navContent.style.display=this.isMobileNavOpen?"flex":"none",this.isMobileNavOpen?(this.navContent.style.flexDirection="column",this.navContent.style.gap="0.5rem",this.navContent.style.padding="1rem"):(this.navContent.style.flexDirection="",this.navContent.style.gap="",this.navContent.style.backgroundColor="",this.navContent.style.padding="")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}],r&&xn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function _n(t){return _n="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},_n(t)}function Cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cn(Object(n),!0).forEach(function(e){An(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function An(t,e,n){return(e=Mn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Mn(r.key),r)}}function Mn(t){var e=function(t){if("object"!=_n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_n(e)?e:e+""}function Fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fn=function(){return!!t})()}function In(t){return In=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},In(t)}function Dn(t,e){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dn(t,e)}var Ln=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=In(e),function(t,e){if(e&&("object"==_n(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,Fn()?Reflect.construct(e,n||[],In(t).constructor):e.apply(t,n))}(this,e)).breakpoints=[],t.container=null,t.currentView=null,t.internalDiv=null,t.resizeListener=null,t}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&&Dn(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){var e=t.breakpoints,n=t.id,r=t.area;if(this.options={breakpoints:e},this._id=n,this._area=r,!Array.isArray(e))throw new Error("Breakpoints should be an array of objects with 'at' and 'view' properties.");return this.breakpoints=e.map(function(t){if("string"!=typeof t.at||!(t.view.render()instanceof HTMLElement))throw new Error("Each breakpoint must have 'at' as a string and 'view' as an HTMLElement.");return Pn(Pn({},t),{},{at:parseInt(t.at,10)})}),this.breakpoints.sort(function(t,e){return t.at-e.at}),this}},{key:"toCode",value:function(){JSON.stringify(this.options.breakpoints.map(function(t){return t.view.toCode()}).flat(),null,4),JSON.stringify(this.options.breakpoints.map(function(t){return t.at}),null,4),JSON.stringify(this.options.breakpoints,null,4);for(var t="",e=0;e<this.options.breakpoints.length;e++)t+='{ at: "'.concat(this.options.breakpoints[e].at,'", view: ').concat(this.options.breakpoints[e].view.toCode()," }, \n");return["new Switcher().set({\n breakpoints: [\n ".concat(t,"\n ]\n })")]}},{key:"render",value:function(t){return this.internalDiv=document.createElement("div"),this.res=this.internalDiv,this._id&&this.internalDiv.setAttribute("id",this._id),this._area&&(this.internalDiv.style.gridArea=this._area),this.applyView(),this.resizeListener=this.applyView.bind(this),window.addEventListener("resize",this.resizeListener),void 0!==t&&document.querySelector(t).appendChild(this.internalDiv),this.internalDiv}},{key:"createRanges",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:99999,n=[],r=0;r<t.length;r++)n.push({from:t[r],to:r<t.length-1?t[r+1]-1:e});return n}},{key:"addRanges",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:99999;return t.map(function(t,r){var o=e[r],i=r<e.length-1?e[r+1]-1:n;return Pn(Pn({},t),{},{range:{from:o,to:i}})})}},{key:"applyView",value:function(){var t=this,e=(window.innerWidth,this.breakpoints.map(function(t){return t.at})),n=this.breakpoints.map(function(t){return t.at});this.createRanges(n),this.addRanges(this.breakpoints,e).forEach(function(e){var n="(min-width: ".concat(e.range.from,"px) and (max-width: ").concat(e.range.to,"px)");window.matchMedia(n).matches&&t.currentView!==e.view.render()&&(t.internalDiv.innerHTML="",t.internalDiv.appendChild(e.view.render()),t.currentView=e.view.render())})}},{key:"destroy",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.internalDiv&&this.container&&this.container.removeChild(this.internalDiv),this.container=null,this.currentView=null,this.internalDiv=null}}],r&&Rn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function zn(t){return zn="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},zn(t)}function Wn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bn(r.key),r)}}function Bn(t){var e=function(t){if("object"!=zn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zn(e)?e:e+""}function Nn(t,e){if(e&&("object"==zn(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)}function Un(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Un=function(){return!!t})()}function Gn(t){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gn(t)}function Hn(t,e){return Hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hn(t,e)}var Xn=function(t){function e(t){var n,r,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,o=Gn(o=e),(n=Nn(r,Un()?Reflect.construct(o,[],Gn(r).constructor):o.apply(r,i)))._noTheme=!0;var a=document.createElement("div");return a.style.flex="1",n.res=a,n.res.setAttribute("class","innerHider"),Nn(n,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&&Hn(t,e)}(e,t),n=e,(r=[{key:"toCode",value:function(){return["new Spacer(".concat(this.hide,")")]}},{key:"render",value:function(){return this.res}}])&&Wn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function qn(t){return qn="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},qn(t)}function Jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Vn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$n(r.key),r)}}function $n(t){var e=function(t){if("object"!=qn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qn(e)?e:e+""}function Yn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Yn=function(){return!!t})()}function Qn(t){return Qn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qn(t)}function Kn(t,e){return Kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kn(t,e)}var Zn=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Qn(e),function(t,e){if(e&&("object"==qn(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,Yn()?Reflect.construct(e,n||[],Qn(t).constructor):e.apply(t,n))}(this,e)).res=null,t}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&&Kn(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){var e,n;this.options=t;var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center";var o=document.createElement("input");o.type="checkbox",o.style.position="relative",o.style.marginRight="0.5rem";var i=t.size||"24px";o.style.width=i,o.style.height=i,t.customStyle&&(o.style.appearance="none"),o.style.border="2px solid #ccc",o.style.borderRadius="4px",o.style.backgroundColor=t.backgroundColor||"white",o.style.cursor="pointer",o.style.transition="background-color 0.2s ease, border-color 0.2s ease",o.style.display="inline-block",o.style.setProperty("--checked-bg-color",t.checkedBackgroundColor||"#4CAF50"),o.style.setProperty("--checkmark-color","white"),o.style.setProperty("--checkmark-clip-path",null!==(e=this.options.clipPath)&&void 0!==e?e:"polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%)");var a=document.createElement("style");a.textContent='\n input[type="checkbox"] {\n appearance: none;\n -webkit-appearance: none; /* For Safari */\n width: var(--size, 24px);\n height: var(--size, 24px);\n border: 2px solid #ccc;\n border-radius: 4px;\n background-color: white;\n position: relative;\n cursor: pointer;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n input[type="checkbox"]:checked {\n background-color: var(--checked-bg-color, #4CAF50);\n border-color: var(--checked-bg-color, #4CAF50);\n }\n\n input[type="checkbox"]::after {\n content: \'\';\n position: absolute;\n width: 50%;\n height: 50%;\n top: 25%;\n left: 25%;\n transform: scale(0);\n background-color: var(--checkmark-color, white);\n clip-path: var(--checkmark-clip-path);\n -webkit-clip-path: var(--checkmark-clip-path);\n transition: transform 0.2s ease;\n }\n\n input[type="checkbox"]:checked::after {\n transform: scale(1);\n }\n',t.customStyle&&document.head.appendChild(a),t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),o.addEventListener("change",function(){o.checked?(o.style.backgroundColor=t.checkedBackgroundColor||"#4CAF50",o.style.borderColor=t.checkedBackgroundColor||"#4CAF50"):(o.style.backgroundColor=t.backgroundColor||"white",o.style.borderColor="#ccc")}),t.name&&o.setAttribute("name",t.name),r.appendChild(o);var s=document.createElement("div");if("function"==typeof(null===(n=t.label)||void 0===n?void 0:n.render))s.appendChild(t.label.render());else{var l=document.createTextNode(t.title||"Label");s.appendChild(l)}return s.style.opacity=.8,s.style.transition="opacity ease 0.2s, transform ease 0.2s",r.appendChild(s),this.res=r,this}},{key:"getValue",value:function(){return this.res.children[0].checked}},{key:"toCode",value:function(){var t=Object.entries(this.options).map(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Jn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(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),n=e[0],r=e[1];return"string"==typeof r?"".concat(n,': "').concat(r,'"'):"object"===qn(r)&&null!==r?"function"==typeof r.toCode?"".concat(n,": ").concat(r.toCode()[0]):"".concat(n,": ").concat(JSON.stringify(r,null,4)):"".concat(n,": ").concat(r)}).join(",\n ");return["new Checkbox().set({\n ".concat(t,"\n})")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Vn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function tr(t){return tr="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},tr(t)}function er(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nr(r.key),r)}}function nr(t){var e=function(t){if("object"!=tr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tr(e)?e:e+""}function rr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(rr=function(){return!!t})()}function or(t){return or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},or(t)}function ir(t,e){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ir(t,e)}"undefined"!=typeof window&&(window.Checkbox=Zn);var ar=function(t){function e(t){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,n){return e=or(e),function(t,e){if(e&&("object"==tr(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,rr()?Reflect.construct(e,n||[],or(t).constructor):e.apply(t,n))}(this,e)).url=t,n.res=null,n.setup(),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&&ir(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){this.res=document.createElement("video"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"set",value:function(t){return this.options=t,t.radius&&(this.res.style.borderRadius=t.radius),t.width&&(this.res.style.width="".concat(t.width)),t.opacity&&(this.res.style.opacity=t.opacity),this}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return['new Video("'.concat(this.url,'").set(').concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&er(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lr(t){return lr="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},lr(t)}function cr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ur(r.key),r)}}function ur(t){var e=function(t){if("object"!=lr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lr(e)?e:e+""}function fr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(fr=function(){return!!t})()}function dr(){return dr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=hr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},dr.apply(null,arguments)}function hr(t){return hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hr(t)}function pr(t,e){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pr(t,e)}var yr=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=hr(e),function(t,e){if(e&&("object"==lr(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,fr()?Reflect.construct(e,n||[],hr(t).constructor):e.apply(t,n))}(this,e)).res=null,t.items=[],t.setup(),t}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&&pr(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){return this.options=t,t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),this.commonMethods(t),this.callReact(t),this}},{key:"callReact",value:function(t){var n,r,o,i=[],a=t.transform&&"object"===lr(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||a){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&(n=e,r=this,"function"==typeof(o=dr(hr(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var s=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,a?t.transform:void 0];s=s.filter(function(t){return null!=t});for(var l=0;l<s.length;l++)i.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];t.borderObj&&c.push("border"),t.background&&c.push("background"),t.mar&&c.push("margin"),t.animation&&c.push("animation"),t.span&&c.push("span"),this.chainReact(i,this.options.id,c)}}},{key:"setup",value:function(){var t=document.createElement("ul");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this}},{key:"setItems",value:function(t){this.items=t;var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return sr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("string"==typeof r){var o=document.createElement("li");o.textContent=r,this.res.appendChild(o)}else{var i=r.render();this.res.appendChild(i)}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,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:"border",value:function(t,e){return this.res.style.border="".concat(t,"px solid ").concat(e),this}},{key:"toCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var e=" ".repeat(t),n="".concat(e,"new UList()");return this.items&&this.items.length&&(n+="\n".concat(e," .setItems([\n")+this.items.map(function(e){return"string"==typeof e?"".concat(" ".repeat(t+4),'"').concat(e,'"'):e.toCode(t+4)}).join(",\n")+"\n".concat(e," ])")),[n+="\n".concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&cr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function mr(t){return mr="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},mr(t)}function vr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,br(r.key),r)}}function br(t){var e=function(t){if("object"!=mr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mr(e)?e:e+""}function gr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gr=function(){return!!t})()}function wr(t){return wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wr(t)}function xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xr(t,e)}var kr=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=wr(e),function(t,e){if(e&&("object"==mr(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,gr()?Reflect.construct(e,n||[],wr(t).constructor):e.apply(t,n))}(this,e)).text=t,r.res=null,r.val=n,r.setup(),r}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&&xr(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(t){return this}},{key:"set",value:function(t){this.options=t;var e=document.createElement("button");if(e.style.background="transparent",e.style.border="none",t.img)e.append(t.img.render());else if(t.svg)if("string"==typeof t.svg){var n=(new DOMParser).parseFromString(t.svg,"image/svg+xml").documentElement;e.appendChild(n)}else t.svg instanceof SVGElement&&e.appendChild(t.svg);else if(t.url&&!t.img){var r,o,i=document.createElement("img");i.setAttribute("src",t.url),i.style.width=(null===(r=t.frame)||void 0===r?void 0:r.width)||"50px",i.style.height=(null===(o=t.frame)||void 0===o?void 0:o.height)||"50px",e.appendChild(i)}else{var a=document.createTextNode(this.text.replace("$",this.val));e.appendChild(a)}return this.res=e,this.commonMethods(t),t&&"submit"===t.type&&e.setAttribute("type",t.type),this.border("none"),this.res.style.display="block",t.background&&this.background(t.background),t.padding&&(this.deprecatedOption("padding","pad"),this.pad([{a:t.padding}])),t.margin&&(this.deprecatedOption("margin","mar"),this.mar([{a:t.margin}])),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.centered&&(this.res.style.marginRight="auto",this.res.style.marginLeft="auto",this.res.style.backgroundColor="black"),t.border&&this.border(t.border),t.radius&&this.borderRadius(t.radius),t.class&&this.setClass(t.class),t.color&&this.color(t.color),t.auto&&this.auto(),t.weight&&(this.res.style.fontWeight=t.weight),t.fluidc&&this.fluidButtonCopy(t.fluidc),t.fluidc&&'\n fluidc: "'.concat(t.fluidc,'",'),t.onTap&&this.onTap(t.onTap),t.frame&&this.frame(t.frame),t.frame&&'\n frame: "'.concat(t.frame,'",'),t.keySet&&this.keySet(t.keySet),t.align&&(this.res.style.textAlign=t.align),t.weight&&(this.res.style.fontWeight=t.weight),t.bold&&(this.res.style.fontWeight="bold"),t.width&&(this.res.style.width=t.width),t.exact&&(this.res.style.fontSize=t.exact),this}},{key:"fluidButtonCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("button"),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("button"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var a=document.createTextNode(this.text);this.res.appendChild(a),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"borderRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2.2rem":t.res.style.fontSize="1rem"};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="6rem":t.res.style.fontSize="3rem"};return e(),window.addEventListener("resize",e),this}},{key:"border",value:function(t,e){return"none"===t&&(this.res.style.border="none"),this.res.style.border="".concat(t," solid ").concat(e,"px"),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,this}},{key:"updating",value:function(t,e){var n=this.res,r=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(r.replace("$",t));n.replaceChild(e,n.childNodes[0])}}),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,function(t,e){return"function"==typeof e?e.toString():e},4).replace(/"(\w+)":/g,"$1:").replace(/"(\(\)\s*=>\s*{[^}]*})"/g,"$1").replace(/\\n/g,"").replace(/\\"/g,'"');return['new Button("'.concat(this.text,'").set(').concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&vr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Or(t){return Or="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},Or(t)}function Sr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Er(r.key),r)}}function Er(t){var e=function(t){if("object"!=Or(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Or(e)?e:e+""}function jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(jr=function(){return!!t})()}function Tr(t){return Tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tr(t)}function _r(t,e){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_r(t,e)}var Cr=function(t){function e(){var t,n,r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=Tr(r),t=function(t,e){if(e&&("object"==Or(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)}(n,jr()?Reflect.construct(r,o||[],Tr(n).constructor):r.apply(n,o))).el=null,t}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),n=e,(r=[{key:"set",value:function(t){this.options=t;var e=document.createElement("div"),n=document.createElement("label");n.style.position="relative",n.style.display="block";var r=document.createTextNode(t.title);n.appendChild(r),n.style.opacity=0;var o=document.createElement("input");return"textarea"===t.type&&(o=document.createElement("textarea")),o.style.position="relative",o.placeholder=t.title,o.style.fontSize="1rem",o.style.padding=".4rem .75rem",e.appendChild(n),e.appendChild(o),this.res=e,t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),o.addEventListener("focus",function(){n.style.transition="transform ease 0.2s",n.style.transform="scale(0.80)",n.style.textTransform="uppercase",n.style.transformOrigin="left top",n.style.fontWeight="bold",o.placeholder="",n.style.opacity="1.0",t.font&&(n.style.fontFamily=t.font),t.color&&(n.style.color=t.color),t.exact&&(n.style.fontSize=t.exact)}),o.addEventListener("focusout",function(){n.style.transform="scale(1.0)",o.placeholder=t.title,n.style.opacity="0.0"}),t.name&&o.setAttribute("name",t.name),window.matchMedia("(max-device-width: 415px)").matches&&(o.style.width="100%",e.style.width="100%"),o.style.fontSize="1rem",this.el=e,this}},{key:"getValue",value:function(){return this.el.children[1].value}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new FloatingInput().set(".concat(t,")")]}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&Sr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Pr(t){return Pr="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},Pr(t)}function Ar(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rr(r.key),r)}}function Rr(t){var e=function(t){if("object"!=Pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pr(e)?e:e+""}"undefined"!=typeof window&&(window.FloatingInput=Cr);var Mr=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=null,this.minLabel=null,this.maxLabel=null,this.currentLabel=null},(e=[{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new Range().set(".concat(t,")")]}},{key:"set",value:function(t){var e,n,r=this;this.options=t;var o=document.createElement("input");if(o.setAttribute("id","slider"),o.setAttribute("type","range"),o.setAttribute("min",t.min),o.setAttribute("max",t.max),o.setAttribute("value",t.min),o.style.width=null!==(e=t.width)&&void 0!==e?e:"100%",!t.plain){var i,a;o.style.setProperty("-webkit-appearance","none"),o.style.appearance="none",o.style.height="9px",o.style.background=null!==(i=t.style.trackColor)&&void 0!==i?i:"orange",o.style.borderRadius="5px";var s="\n #slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 25px;\n height: 25px;\n border-radius: 50%;\n background: ".concat(null!==(a=t.style.thumbColor)&&void 0!==a?a:"4CAF50",";\n cursor: pointer;\n }\n "),l=document.createElement("style");l.appendChild(document.createTextNode(s)),document.head.appendChild(l)}var c=document.createElement("div");c.style.display="flex",c.style.flexDirection="column",c.style.alignItems="center",c.style.width="100%";var u=document.createElement("div");if(u.style.display="flex",u.style.justifyContent="space-between",u.style.width=null!==(n=t.width)&&void 0!==n?n:"100%",this.minLabel=document.createElement("span"),this.minLabel.textContent=t.min,this.maxLabel=document.createElement("span"),this.maxLabel.textContent=t.max,this.currentLabel=document.createElement("span"),this.currentLabel.textContent=o.value,t.font&&(this.currentLabel.style.fontFamily=t.font),t.font&&(this.minLabel.style.fontFamily=t.font),t.font&&(this.maxLabel.style.fontFamily=t.font),t.plain||(u.appendChild(this.minLabel),u.appendChild(this.currentLabel),u.appendChild(this.maxLabel)),o.addEventListener("input",function(){r.currentLabel.textContent=o.value}),window.matchMedia("(max-device-width: 415px)").matches)if(t.plain)o.style.width="80%";else{var f,d;o.style.height="20px",o.style.background=null!==(f=t.style.trackColor)&&void 0!==f?f:"1abc9C",o.style.borderRadius="10px",o.style.fontSize="3rem",o.style.width="80%";var h="\n #slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 25px;\n height: 25px;\n border-radius: 50%;\n background: ".concat(null!==(d=t.style.thumbColor)&&void 0!==d?d:"blue",";\n cursor: pointer;\n }\n "),p=document.createElement("style");p.appendChild(document.createTextNode(h)),document.head.appendChild(p)}return c.appendChild(u),c.appendChild(o),this.el=c,this}},{key:"value",value:function(){return this.el.querySelector("#slider").value}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&Ar(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Fr(t){return Fr="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},Fr(t)}function Ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dr(r.key),r)}}function Dr(t){var e=function(t){if("object"!=Fr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fr(e)?e:e+""}"undefined"!=typeof window&&(window.Range=Mr);var Lr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=null,this.radioCount=0},(e=[{key:"set",value:function(t){this.options=t,this.radioCount=t.items.length;for(var e=document.createElement("div"),n=t.items,r=0;r<n.length;r++){var o=document.createElement("label");n.font&&(o.style.font=n.font),n.color&&(o.style.color=n.color),n.exact&&(o.style.fontSize=n.exact);var i=document.createTextNode(n[r]);o.appendChild(i),o.setAttribute("for",n[r]);var a=document.createElement("input");a.setAttribute("type","radio"),a.setAttribute("id","S".concat(r)),a.setAttribute("value",n[r].split(" ").join("")),a.style.appearance="none",a.style.width="20px",a.style.height="20px",a.style.border=this.options.tint?"2px solid ".concat(this.options.tint):"2px solid #007BFF",a.style.borderRadius="50%",a.style.outline="none",a.style.cursor="pointer",a.style.transition="0.3s",this.options.font&&(o.style.fontFamily=this.options.font),t.multiple?a.setAttribute("name",n[r].split(" ").join("")):a.setAttribute("name",t.name),e.appendChild(a),e.appendChild(o),e.innerHTML+="</br>"}return this.el=e,this.responsive(),this}},{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"getCheckedValues",value:function(){for(var t=[],e=0;e<this.radioCount;e++)if(document.querySelector("#S".concat(e)).checked){var n=document.querySelector("#S".concat(e));t.push(n.value)}return t}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new RadioGroup().set(".concat(t,")")]}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.el.style.fontSize="1.7em"),this}},{key:"render",value:function(t){var e=this;if(!t){for(var n=function(){var t=e.el.children[r];"[object HTMLInputElement]"===t.toString()&&t.addEventListener("change",function(){if(t.checked){t.style.backgroundColor=e.options.tint?e.options.tint:"#007BFF",t.style.boxShadow=e.options.tint?"0 0 0 2px ".concat(e.options.tint," inset"):"0 0 0 2px #0056b3 inset";for(var n=0;n<e.el.children.length;n++){var r=e.el.children[n];"INPUT"===r.tagName&&"radio"===r.type&&!1===e.options.multiple&&r!==t&&(r.style.backgroundColor="transparent",r.style.boxShadow="none")}}else t.style.backgroundColor="transparent",t.style.boxShadow="none"})},r=0;r<this.el.children.length;r++)n();return this.el}document.querySelector(t).appendChild(this.el)}}])&&Ir(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function zr(t){return zr="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},zr(t)}function Wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Br(r.key),r)}}function Br(t){var e=function(t){if("object"!=zr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zr(e)?e:e+""}function Nr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Nr=function(){return!!t})()}function Ur(t){return Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ur(t)}function Gr(t,e){return Gr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gr(t,e)}"undefined"!=typeof window&&(window.RadioGroup=Lr);var Hr=function(t){function e(){var t,n,r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=Ur(r),t=function(t,e){if(e&&("object"==zr(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)}(n,Nr()?Reflect.construct(r,o||[],Ur(n).constructor):r.apply(n,o))).el=null,t.file=null,t.selected="",t}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&&Gr(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(t,e){document.createElement("div");var n=document.createElement("select");n.setAttribute("type","file"),n.setAttribute("name",e),n.addEventListener("change",function(){n.options[n.selectedIndex].value});for(var r=0;r<t.length;r++)n.appendChild(this.addNode(t[r][0],t[r][1]));return this.el=n,this.res=n,this}},{key:"set",value:function(t){return this.options=t,t.items&&this.setup(t.items,t.name),t.arrayPadding&&this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.radius&&(this.el.style.borderRadius=t.radius),t.background&&(this.el.style.background=t.background),this.commonMethods(t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.el.style.paddingLeft=e),t.includes("right")&&(this.el.style.paddingRight=e),t.includes("top")&&(this.el.style.paddingTop=e),t.includes("bottom")&&(this.el.style.paddingBottom=e),t.includes("all")&&(this.el.style.padding=e),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.el.style.marginLeft=e),t.includes("right")&&(this.el.style.marginRight=e),t.includes("top")&&(this.el.style.marginTop=e),t.includes("bottom")&&(this.el.style.marginBottom=e),t.includes("all")&&(this.el.style.margin=e),this}},{key:"addNode",value:function(t,e){var n=document.createElement("option");n.setAttribute("value",t);var r=document.createTextNode(e);return n.appendChild(r),n}},{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"font",value:function(t){return this.el.style.fontFamily=t,this}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new Picker().set(".concat(t,")")]}},{key:"rounded",value:function(t){return this.el.style.borderRadius="4px",this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.el.style.fontSize="3rem":t.el.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&Wr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Xr(t){return Xr="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},Xr(t)}function qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jr(r.key),r)}}function Jr(t){var e=function(t){if("object"!=Xr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xr(e)?e:e+""}function Vr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Vr=function(){return!!t})()}function $r(t){return $r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$r(t)}function Yr(t,e){return Yr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yr(t,e)}"undefined"!=typeof window&&(window.Picker=Hr);var Qr=function(t){function e(){var t,n,r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=$r(r),t=function(t,e){if(e&&("object"==Xr(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)}(n,Vr()?Reflect.construct(r,o||[],$r(n).constructor):r.apply(n,o))).el=null,t.file=null,t}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&&Yr(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){var e=this;this.options=t,this.okayColor=t.okayColor,window.matchMedia("(max-device-width: 415px)");var n=document.createElement("div");n.style.paddingBottom="1em",n.style.display="flex",document.createElement("div");var r=document.createElement("input");r.setAttribute("type","text"),r.style.display="none",r.style.margin="0.5em";var o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("name",t.name),t.accept&&(o.accept=t.accept),o.setAttribute("id",t.id),o.style.visibility="hidden",o.style.display="none",window.matchMedia("(max-device-width: 415px)").matches&&(o.style.fontSize="1rem");var i=document.createElement("label");return i.setAttribute("for",t.id),i.innerText=t.title,i.style.marginRight=12,i.style.padding="0.5em",t.color&&(i.style.color=t.color),t.background&&(i.style.background=t.background,i.style.padding="10"),o.addEventListener("change",function(){r.style.display="block",t.hideField&&(r.style.display="none"),i.innerText="Change",e.file=o.files[0],e.onLoad(e.file),Kr[t.index]=e.file,r.setAttribute("value",e.file.name),r.setAttribute("readonly","true"),e.getLoaded(),e.highlight()}),n.appendChild(o),n.appendChild(i),n.appendChild(r),this.el=n,t.font&&this.font(t.font),t.radius&&this.borderRadius(t.radius),this}},{key:"borderRadius",value:function(t){return this.el.style.borderRadius=t,this}},{key:"addClass",value:function(t){return this.el.setAttribute("class",t),this}},{key:"font",value:function(t){return this.el.style.fontFamily=t,this}},{key:"bold",value:function(){return this.el.style.fontWeight="bold",this}},{key:"rounded",value:function(){return this.el.children[1].style.borderRadius="8px",this}},{key:"highlight",value:function(){return null===this.file?(this.hasFile=!1,this.el.children[1].style.background="red"):(this.hasFile=!0,this.okayColor?this.el.children[1].style.background=this.okayColor:this.el.children[1].style.background="#1abc9c"),this}},{key:"auto",value:function(){var t=function(){window.matchMedia("(max-device-width: 415px)").matches};return t(),window.addEventListener("resize",t),this}},{key:"onLoad",value:function(t){return this.returnObject(this.file),this}},{key:"getLoaded",value:function(){return this.file}},{key:"returnObject",value:function(t){return t}},{key:"loadCall",value:function(t){return this.func=t,this.func(this.file),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new FilePickera().set(".concat(t,")")]}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.el),this):this.el}}])&&qr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z),Kr=[];function Zr(t,e){return Zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zr(t,e)}function to(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(to=function(){return!!t})()}function eo(t){return eo="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},eo(t)}function no(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ro(r.key),r)}}function ro(t){var e=function(t){if("object"!=eo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eo(e)?e:e+""}var oo=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.res=null,this.currentItem=""},(e=[{key:"set",value:function(t){var e=this,n=t;this.options=t;var r=document.createElement("input");r.setAttribute("list","dlCities"),r.setAttribute("id","my");var o=t.data,i=0,a=o.length,s=document.createElement("datalist");for(s.id="dlCities",i=0;i<a;i+=1){var l=document.createElement("option");l.value=o[i],s.appendChild(l)}return r.appendChild(s),r.addEventListener("change",function(){var t=document.querySelector("#my").value;e.currentItem=t}),r.setAttribute("placeholder","Type value"),r.style.padding=".4rem .75rem",r.style.fontSize="1rem",this.res=r,this.responsive(),n.arrayPadding&&this.arrayPadding(n.arrayPadding.sides,n.arrayPadding.value),n.arrayMargin&&this.arrayMargin(n.arrayMargin.sides,n.arrayMargin.value),n.pad&&this.pad(n.pad),n.mar&&this.mar(n.mar),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new DataList().set(".concat(t,")")]}},{key:"getValue",value:function(){return this.res.value}},{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),t.includes("all")&&(this.res.style.padding=e),this}},{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),this}},{key:"margin",value:function(t){return this.res.style.margin=t,this}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&no(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),io=oo;function ao(t){return ao="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},ao(t)}function so(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,co(r.key),r)}}function co(t){var e=function(t){if("object"!=ao(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ao(e)?e:e+""}oo=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t,e,n){if(to())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Zr(o,n.prototype),o}(io,e)},"undefined"!=typeof window&&(window.DataList=oo);var uo=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"POST";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.action=e,this.method=n,this.elements=[],this.formElement=document.createElement("form"),this.formElement.action=this.action,this.formElement.method=this.method},e=[{key:"add",value:function(t){var e=this;return this.elements=t,t.forEach(function(t){if(!t||"function"!=typeof t.render)throw new Error("Each element in the array must have a render method that returns an HTML DOM element.");e.formElement.appendChild(t.render())}),this}},{key:"toCode",value:function(){var t=this.elements.map(function(t){return t.toCode()}),e=Object.entries(this.obj).map(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return so(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?so(t,e):void 0}}(e,n)||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.")}()),o=r[0],i=r[1],a="string"==typeof i?'"'.concat(i,'"'):i;return"".concat(o,": ").concat(a)}).join(", ");return["new Form().set({".concat(e,"}).add([ \n ").concat(t.join(", \n"),"])")]}},{key:"set",value:function(t){return this.obj=t,t.action&&this.setAction(t.action),t.method&&this.setMethod(t.method),t.id&&(this.formElement.id=t.id),this}},{key:"setAction",value:function(t){this.action=t,this.formElement.action=this.action}},{key:"setMethod",value:function(t){this.method=t,this.formElement.method=this.method}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.formElement),this.formElement}}],e&&lo(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function fo(t){return fo="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},fo(t)}function ho(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,po(r.key),r)}}function po(t){var e=function(t){if("object"!=fo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fo(e)?e:e+""}var yo=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"style",value:function(t){for(var e=t.bst,n=t.el,r=t.re,o=(t.options,[]),i=0;i<e.length;i++)e[i].target&&(n.id,e[i].target[0]);for(i=0;i<e.length;i++){var a=!0;e[i].target&&(a=!1,n.id===e[i].target[0]&&(a=!0));var s=e[i].op.ops.split("-");a&&s.includes("air")&&(r.borderObj={color:"#1abc9c",radius:"0rem",width:"3px"},r.color="#1abc9c",r.background="transparent"),a&&s.includes("round")&&(s.includes("air")?r.borderObj={width:"4px",radius:"0.7rem",color:"#1abc9c"}:r.borderObj={width:"0px",radius:"0.7rem",color:"#1abc9c"}),a&&s.includes("full")&&(r.background="#3498db",r.borderObj&&r.borderObj.radius&&(r.borderObj.radius="0.3rem"),r.color="white"),a&&s.includes("pill")&&(r.background="#3498db",r.borderObj.radius="9999px",r.color="white"),a&&s.includes("hover")&&(r.hover={color:"#1abc9c",background:"orange"}),o.push((new Ct).set(r))}return o}}])&&ho(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function mo(t){return mo="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},mo(t)}function vo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function bo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vo(Object(n),!0).forEach(function(e){go(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vo(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function go(t,e,n){return(e=xo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xo(r.key),r)}}function xo(t){var e=function(t){if("object"!=mo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mo(e)?e:e+""}function ko(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ko=function(){return!!t})()}function Oo(){return Oo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=So(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Oo.apply(null,arguments)}function So(t){return So=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},So(t)}function Eo(t,e){return Eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Eo(t,e)}var jo=function(t){function e(){var t,n,r,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=So(r),t=function(t,e){if(e&&("object"==mo(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)}(n,ko()?Reflect.construct(r,o||[],So(n).constructor):r.apply(n,o))).res=null,t.options={},t.code=[],t.elCSS=[],t.html=[],t.react=[],t.setup(i),t.code.push("new Polygon(".concat(JSON.stringify(i),")")),t}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&&Eo(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=document.createElement("div");return t.id&&e.setAttribute("id",t.id),this.res=e,this.res.style.padding=0,this.res.style.margin=0,this.res.style.display=t.inline?"inline-block":"block",this}},{key:"toCode",value:function(){var t=X(this.options||{},2);return"new Polygon().set(".concat(t,")")}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=bo(bo({},this.options),t),t.id&&(this.res.id=t.id),t.class&&(this.res.className=t.class),t.sides&&this.sides(t.sides),t.size&&this.size(t.size.width||t.size,t.size.height),t.color&&this.color(t.color),t.border&&this.border(t.border),t.margin&&this.mar([{a:t.margin}]),t.padding&&this.pad([{a:t.padding}]),t.background&&this.background(t.background),t.center&&this.center();var n=t;this.obj=t;var r,o,i=[];if(n.stroke||n.gradient||n.backgroundOp||n.layout||n.marginOp||n.shadow||n.animation||n.filtera||n.transform){var a;n.gradient&&(this.globalGradient=n.gradient.op.gradient),n.stroke&&(null===(r=this,a="function"==typeof(o=Oo(So(e.prototype),"setAny",r))?function(t){return o.apply(r,t)}:o)||void 0===a||a([{globalBlast:"".concat(n.stroke.op.width," ").concat(n.stroke.op.color)}]));for(var s=[n.stroke,n.gradient,n.animation,n.backgroundOp,n.layout,n.marginOp,n.shadow,n.animation,n.filtera,n.transform].filter(function(t){return null!=t}),l=0;l<s.length;l++)i.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];n.border&&c.push("border"),n.background&&c.push("background"),(n.mar||n.margin)&&c.push("margin"),n.animation&&c.push("animation"),"radial"===n.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),this.chainReact(i,this.options.id,c)}return this}},{key:"size",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.res.style.width="number"==typeof t?t+"px":t,this.res.style.height="number"==typeof e?e+"px":e,this}},{key:"sides",value:function(t){return t<3&&(t=3),this.res.style.clipPath=e.makePolygon(t),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"border",value:function(t){return this.res.style.border="string"==typeof t?t:"".concat((null==t?void 0:t.width)||"1px"," solid ").concat((null==t?void 0:t.color)||"black"),this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"render",value:function(t){return"string"==typeof t?document.querySelector(t).appendChild(this.res):t instanceof HTMLElement&&t.appendChild(this.res),this}}],o=[{key:"makePolygon",value:function(t){for(var e=2*Math.PI/t,n=[],r=0;r<t;r++){var o=50+50*Math.cos(r*e-Math.PI/2),i=50+50*Math.sin(r*e-Math.PI/2);n.push("".concat(o,"% ").concat(i,"%"))}return"polygon(".concat(n.join(","),")")}}],r&&wo(n.prototype,r),o&&wo(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Z);function To(t){return To="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},To(t)}function _o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Co(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Po(r.key),r)}}function Po(t){var e=function(t){if("object"!=To(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=To(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==To(e)?e:e+""}function Ao(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ao=function(){return!!t})()}function Ro(){return Ro="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Mo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ro.apply(null,arguments)}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}function Fo(t,e){return Fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fo(t,e)}var Io=function(t){function e(){var t,n,r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=Mo(r),t=function(t,e){if(e&&("object"==To(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)}(n,Ao()?Reflect.construct(r,o||[],Mo(n).constructor):r.apply(n,o))).res=null,t.options={},t.code=[],t.elCSS=[],t.html=[],t.react=[],t.setup(),t}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&&Fo(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("div");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.borderRadius="50%",this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=X(Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=(e=t,n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return _o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_o(t,e):void 0}}(e,n)||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.")}())[1];var e,n})),4);return["new Circle().set(".concat(t,")")]}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"diameter",value:function(t){return this.res.style.width=this.res.style.height="number"==typeof t?t+"px":t,this.res.style.borderRadius="50%",this}},{key:"size",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.res.style.width="number"==typeof t?t+"px":t,this.res.style.height="number"==typeof e?e+"px":e,this.res.style.borderRadius="50%",this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"border",value:function(t){return this.res.style.border="string"==typeof t?t:"".concat((null==t?void 0:t.width)||1,"px solid ").concat((null==t?void 0:t.color)||"black"),this}},{key:"radius",value:function(t){return this.res.style.borderRadius="number"==typeof t?t+"px":t,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t,t.top&&(this.res.style.top=t.top),t.left&&(this.res.style.left=t.left),(t.top||t.left)&&(this.res.style.position="absolute"),t.diameter&&this.diameter(t.diameter),t.size&&this.size(t.size.w||t.size,t.size.h||t.size),t.width&&(this.res.style.width=t.width),t.height&&(this.res.style.height=t.height),t.radius&&this.radius(t.radius),t.id&&this.res.setAttribute("id",t.id),t.class&&this.res.setAttribute("class",t.class),t.zIndex&&(this.res.style.zIndex=t.zIndex),t.pad&&(this.res.style.padding=t.pad),t.mar&&(this.res.style.margin=t.mar),t.background&&(this.res.style.background=t.background),t.color&&this.color(t.color),t.border&&this.border(t.border),t.shadow&&(this.res.style.boxShadow=t.shadow),t.cursor&&(this.res.style.cursor=!0===t.cursor?"pointer":t.cursor);var n,r,o=[];if(t.stroke||t.gradient||t.backgroundOp||t.layout||t.marginOp||t.shadow||t.animation||t.filtera||t.transform){var i;t.gradient&&(this.globalGradient=t.gradient.op.gradient),"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),t.stroke&&(null===(n=this,i="function"==typeof(r=Ro(Mo(e.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)||void 0===i||i([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]));for(var a=[t.stroke,t.gradient,t.animation,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,t.transform].filter(function(t){return null!=t}),s=0;s<a.length;s++)o.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];t.border&&l.push("border"),t.background&&l.push("background"),(t.mar||t.margin)&&l.push("margin"),t.animation&&l.push("animation"),this.chainReact(o,this.options.id,l)}return this}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"render",value:function(t){var e;return t&&(null===(e=document.querySelector(t))||void 0===e||e.appendChild(this.res)),this.res}}],r&&Co(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Do(t){return Do="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},Do(t)}function Lo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Wo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zo(Object(n),!0).forEach(function(e){Bo(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Bo(t,e,n){return(e=Uo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function No(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uo(r.key),r)}}function Uo(t){var e=function(t){if("object"!=Do(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Do(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Do(e)?e:e+""}var Go=["h1","h2","h3","h4","h5","h6","p","img","a","cards","free","nav","sideNav","row","dropdown","radio","input","labelInput","filePicker","picker","video","audio","multiswitcher","button","form","checkbox","stack","simple","copy","wrap","circle","polygon","code","table","ulist"],Ho=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"mapType",value:function(t){if(["h1","h2","h3","h4","h5","h6","p"].includes(t.el.type))return this.mapText(t);if("img"===t.el.type)return this.mapImage(t);if("a"===t.el.type)return this.mapLink(t);if("cards"===t.el.type)return this.mapGrid(t);if("free"===t.el.type)return this.mapFree(t);if("nav"===t.el.type)return this.protoNav(t);if("sideNav"===t.el.type)return this.sideNav(t);if("row"===t.el.type)return this.mapRow(t);if("dropdown"===t.el.type)return this.dropdown(t);if("radio"===t.el.type)return this.radio(t);if("input"===t.el.type)return this.input(t);if("labelInput"===t.el.type)return this.floatInput(t);if("filePicker"===t.el.type)return this.filePicker(t);if("picker"===t.el.type)return this.picker(t);if("video"===t.el.type)return this.video(t);if("audio"===t.el.type)return this.audio(t);if("multiswitcher"===t.el.type)return this.multiswitcher(t);if("button"===t.el.type)return this.button(t);if("form"===t.el.type)return this.form(t);if("checkbox"===t.el.type)return this.checkbox(t);if("stack"===t.el.type)return this.stack(t);if("simple"===t.el.type)return this.simple(t);if("copy"===t.el.type)return this.mapCopy(t);if("wrap"===t.el.type)return this.mapWrap(t);if("circle"===t.el.type)return this.mapCircle(t);if("polygon"===t.el.type)return this.mapPolygon(t);if("code"===t.el.type)return this.mapCode(t);if("table"===t.el.type)return this.mapTable(t);if("ulist"===t.el.type)return this.mapUList(t);throw new Error("[nodality] "+function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",r=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,r=String(t);return e.filter(function(t){return function(t,e){if(t===e)return 0;for(var n=new Array(e.length+1),r=0;r<=e.length;r++)n[r]=r;for(var o=1;o<=t.length;o++){for(var i=[o],a=1;a<=e.length;a++){var s=t.charCodeAt(o-1)===e.charCodeAt(a-1)?0:1;i[a]=Math.min(n[a]+1,i[a-1]+1,n[a-1]+s)}n=i}return n[e.length]}(r,t)<=n})}(t,e),o="Unknown ".concat(n,' "').concat(t,'".');return r.length&&(o+=' Did you mean "'.concat(r[0],'"?')),e.length&&(o+=" Valid ".concat(n,"s: ").concat(e.join(", "),".")),o}(t.el.type,Go,"element type"))}},{key:"mapTable",value:function(t){var e=t.el;return(new $e).add([{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"},{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"},{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"}]).set({cellPadding:"0.3em",cellAlign:"center",style:{font:"Arial"},headStyle:{color:"white",background:"#ff6d22"},border:"2px solid black",center:!0,borderRadius:2.2,stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)})}},{key:"mapRow",value:function(t){var e=t.el;return(new Wt).set({stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)}).items([new ct("This").set({size:"S3"}),new ct("is").set({size:"S3",text:"Hello"}),new ct("row.").set({size:"S3",text:"Hello"})])}},{key:"mapCode",value:function(t){var e=t.el;return(new xe).set({stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions),pad:[{l:30}],mar:[{a:30}],class:"language-js",code:'new Text("Modality").set({ font: "Arial" })'})}},{key:"mapCopy",value:function(t){var e,n=t.customOptions,r=n.filter(function(t){return"copy"===t.op})[0],o=null!==(e=null==r?void 0:r.count)&&void 0!==e?e:3,i=(this.filteroRaster(t.el.id,n)||[]).filter(function(t){return t!==r}),a=300;return'new Wrapper()\n.set({\n width: "'.concat(a,'px",\n height: "').concat(a,'px",\n display: "flex",\n justifyContent: "center",\n alignItems: "center",\n position: "absolute",\n id: "#first",\n scale: 0.3,\n ').concat(null!=r&&r.animation?'\nanimation: {\n op: {\n name: "animation",\n color: "green",\n width: "1px",\n fireAt: "inview",\n keyframesOpen: [\n {\n transform: "rotate(360deg)",\n opacity: 0\n },\n {\n transform: "rotate(0deg)",\n opacity: 1\n }\n ],\n keyframesClose: [\n {\n transform: "rotate(0deg)",\n opacity: 1\n },\n {\n transform: "rotate(0deg)",\n opacity: 0\n }\n ],\n openOptions: {\n duration: 300,\n fill: "forwards",\n delay: 1000\n },\n closeOptions: {\n duration: 1,\n fill: "forwards",\n delay: 1000\n }\n },\n target: [\n "#first"\n ]\n },\n ':"").concat(i.length?",\n raster: ".concat(JSON.stringify(i)):"","\n})\n.add(\n Array.from({ length: ").concat(o,' }).map((_, i) => {\n\n const bbox = {width: "').concat(a,'px", height: "').concat(a,'px"};\n\n const elHeight = bbox.height;\n\n const cx = ').concat(150,";\n const cy = ").concat(150,";\n\n const R = ").concat(150,";\n\n const n = ").concat(o,';\n\n // Evenly spaced angles, starting at top (-90°)\n const angle = (i / n) * Math.PI * 2 - Math.PI/2;\n const dist = R + parseFloat(elHeight)/2;\n\n const x = cx + dist * Math.cos(angle);\n const y = cy + dist * Math.sin(angle);\n\n let rot = angle * 180 / Math.PI + 90;\n rot = (rot % 360 + 360) % 360;\n rot = (rot % 360 + 360) % 360;\n\n return new Text("Hello").set({\n size: "S1",\n color: "green",\n font: "Arial",\n left: `${x}px`,\n top: `${y}px`,\n transform: {\n op: {\n name: "transform",\n transform: {\n static: true,\n keep: true,\n values: [\n "tx:-50%",\n "ty:-50%",\n `rotate(${rot}deg)`\n ]\n }\n }\n }\n })\n\n \n })\n)')}},{key:"button",value:function(t){var e,n=t.el;return new kr(null!==(e=n.text)&&void 0!==e?e:"Button").set(Wo(Wo({fluidc:"S6"},this.elOpts(n)),{},{raster:this.filteroRaster(n.id,t.customOptions)}))}},{key:"multiswitcher",value:function(t){var e=this,n=Array.isArray(t.el.breakpoints)?t.el.breakpoints:null;if(!n||!n.length)throw new Error('[nodality] a "multiswitcher" element needs a non-empty `breakpoints` array of { at, view }.');return(new Ln).set({id:t.el.id,area:t.el.area,breakpoints:n.map(function(n){return{at:n.at,view:n.view&&"function"==typeof n.view.render?n.view:e.mapType(Wo(Wo({},t),{},{el:n.view}))}})})}},{key:"video",value:function(t){var e=t.el;if(!e.url)throw new Error('[nodality] a "video" element needs a `url`.');return this.attachRaster(new ar(e.url).set(this.elOpts(e)),e,t.customOptions)}},{key:"audio",value:function(t){var e=t.el;if(!e.url)throw new Error('[nodality] an "audio" element needs a `url`.');return this.attachRaster(new he(e.url),e,t.customOptions)}},{key:"radio",value:function(t){var e,n=t.el;return(new Lr).set(Wo({items:Array.isArray(n.items)?n.items:[],multiple:null!==(e=n.multiple)&&void 0!==e&&e},this.elOpts(n)))}},{key:"input",value:function(t){var e,n=t.el;return(new dn).set(Wo(Wo({type:null!==(e=n.inputType)&&void 0!==e?e:"text"},this.elOpts(n)),{},{raster:this.filteroRaster(n.id,t.customOptions)}))}},{key:"floatInput",value:function(t){var e,n=t.el;return this.attachRaster((new Cr).set(Wo({type:null!==(e=n.inputType)&&void 0!==e?e:"input"},this.elOpts(n))),n,t.customOptions)}},{key:"filePicker",value:function(t){var e,n=t.el;return this.attachRaster((new Qr).set(Wo({title:null!==(e=n.title)&&void 0!==e?e:"Choose a file"},this.elOpts(n))),n,t.customOptions)}},{key:"picker",value:function(t){var e=t.el;return(new Hr).set(Wo(Wo({items:Array.isArray(e.items)?e.items:[],arrayPadding:{sides:["all"],value:"0.5rem"},rounded:!0},this.elOpts(e)),{},{raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"dropdown",value:function(t){t.el.items||(t.el.items=["Flower","Car","Maseratti"]);var e=t.el.items.map(function(t){return(new Ct).set({pad:[{a:10}],font:"Arial",bold:!0,link:"https://www.apple.com",text:t,icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"},hover:{color:"wheat",animation:.3}})}),n=(new on).set({behaviour:"click",pad:[{a:"1rem"}],mar:[{a:"1rem"}],border:"1px solid black",width:"180px",radius:"1rem"}).add([new ct(t.el.items[0]).set({font:"Arial",fluidc:"S6",weight:"bold",align:"center",cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},pad:[{l:10,r:10}]}),(new We).set({border:"1px solid green",background:"#1abc9c",radius:"0.7rem",socenter:!0}).add(e.slice(1))]),r=this.filteroRaster(t.el.id,t.customOptions);return r&&n.rasterize(r),n}},{key:"protoNav",value:function(t){var e=t.customOptions,n=[{title:"Fire",link:"@e"},{title:"and",link:"@e"},{title:"smoke",link:"@e"}],r=n.map(function(t,e){return new Ct('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3}})}),o=n.map(function(t,e){return new Ct('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3},animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}})});if(t.el.dropdown){var i=(new on).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black"}).add([new ct("First").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:20,r:10}],font:"Arial",align:"center",weight:"bold"}),(new We).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new Ct).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Second",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}}),(new Ct).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Third",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}})])]);o.push(i),r.push(i)}t.el.animation;var a=(new Ln).set({breakpoints:[{at:"0px",view:(new Tn).set({background:"#ecf0f1",mar:[{a:21}],brand:new ct("Company").set({size:"S6",font:"Helvetica"}),hamburgerColour:"#3498db",radius:"1rem"}).add([(new Ct).set({text:"About",url:"#a"}),(new on).set({behaviour:"mouseover",pad:[{a:40}],mar:[{lr:"auto"}],breakpoint:"1200px",padding:"10px",border:"1px solid black",height:"auto"}).add([new ct("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new ct("Our story").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new ct("Team").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})]),new Ct("B").set({text:"About",url:"#b"}),new Ct("C").set({text:"Contact",url:"https://www.abcnews.com"})])},{at:"1200px",view:(new gn).set({background:"#ecf0f1",mar:[{a:21}],maxHeight:"100px",radius:"1rem"}).add([new ct("Company").set({size:"S6",font:"Helvetica"}),new Xn(!0),(new on).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black",radius:"30px",width:"130px"}).add([new ct("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),(new We).set({flexDir:"column",mar:[{t:"10px"}],radius:".3rem"}).add([new Ct("").set({text:"Who we are",url:"jk",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Ct("").set({text:"Info",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Ct("").set({text:"About",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])]),(new Ct).set({text:"About",url:"#a"}),(new Ct).set({text:"Services",url:"#a"}),(new Ct).set({text:"Contact",url:"#a"})])}]});return this.attachRaster(a,t.el,e)}},{key:"sideNav",value:function(t){t.customOptions;var e=[{title:"Home",link:"@e"},{title:"Projects",link:"@e"},{title:"Services",link:"@e"}],n=e.map(function(t,e){return new Ct('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:"#e",id:"#"+t.title.toLowerCase(),font:"Arial",pad:[{a:20}],bold:!0,tags:{open:"sidebar:open",close:"sidebar:closed"},align:"left",hover:{color:"wheat",animation:.3}})}),r=(new on).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}}).add([new ct("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),(new We).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new Ct).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Second",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}}),(new Ct).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Third",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}})])]),o=e.map(function(t,e){return new Ct('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:"#myURL",id:"#"+t.title.toLowerCase(),font:"Arial",pad:[{a:20}],bold:!0,tags:{open:"sidebar:open",close:"sidebar:closed"},align:"left",hover:{color:"wheat",animation:.3},animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}})});t.el.dropdown&&(o.push(r),n.push(r));var i=(new We).set({column:!0}).add([new ct("Sidebar").set({size:"S6",font:"Arial",id:"#olod",italic:!0,animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}},pad:[{l:20},{t:20}]}),t.el.animation?o[0]:n[0],t.el.animation?o[1]:n[1],t.el.animation?o[2]:n[2],t.el.animation&&t.el.dropdown?o[3]:new ct("").set({}).excludeFromCode(),new ct("Company, 2025").set({pad:[{a:20}],animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}})]),a=(new We).set({column:!0}).add([new ct("Off canvas").set({fluidc:"S6",font:"Arial",id:"#olod",italic:!0,animation:t.el.animation?{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}:null,pad:[{l:40},{t:20}]})]),s=(new Kt).setup({animate:!0,radius:"1rem",isSide:!0,background:"#ecf0f1",hamColour:{opened:"#1abc9c",closed:"#e67e22"},mobileSize:"1.2em",fixed:!0,tags:{open:"sidebar:open",close:"sidebar:closed"}}).items(t.el.offcanvas?a:i),l=this.filteroRaster(t.el.id,t.customOptions);return l&&s.rasterize(l),s}},{key:"mapFree",value:function(t){var e=t.customOptions.filter(function(t){return"slayout"===t.op.name||"layout"===t.op.name})[0],n=null,r={cols:6,rows:6};"text-above-image"!==e.op.value&&"image-above-text"!==e.op.value||(n=null,r=null),"img-overlay-text"===e.op.value&&(n={text:{row:"1 / span 2",col:"3 / span 2"},image:{row:"2 / span 3",col:"3 / 3"}}),"img-leftof-text"===e.op.value&&(n={text:{row:"1",col:"1 / 3"},image:{row:"1",col:"3 / 4"}});var o=(new ae).set({id:"#3",templateCols:r,height:"600px"}).add([new ct("I am free").set({border:"3px solid green",font:"Arial",size:"S1",color:"#1abc9c",gpos:null!=n?n.text:null,zIndex:1}),(new gt).set({url:"https://upload.wikimedia.org/wikipedia/commons/a/ac/MSC_World_Europa_-_Saint-Nazaire_-_June_2022.jpg",width:"400px",height:"auto",gpos:null!=n?n.image:null})]),i=this.filteroRaster(t.el.id,t.customOptions);return i&&o.rasterize(i),o}},{key:"mapCircle",value:function(t){var e=t.el;return(new Io).set({diameter:108,background:"#1abc9c",stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)})}},{key:"mapPolygon",value:function(t){var e,n=t.el,r=null!==(e=t.el.sides)&&void 0!==e?e:7;return new jo({id:"hex"}).set({sides:r,size:300,background:"#1abc9c",gradient:this.filtero("gradient",n.id,t.customOptions),animation:this.filtero("animation",n.id,t.customOptions),shadow:this.filtero("shadow",n.id,t.customOptions),span:this.filtero("span",n.id,t.customOptions),backgroundOp:this.filtero("background",n.id,t.customOptions),marginOp:this.filtero("margin",n.id,t.customOptions),transform:this.filtero("transform",n.id,t.customOptions),filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions)})}},{key:"mapText",value:function(t){var e,n,r=t.el;return new ct(r.text||r.value).set({id:r.id,class:r.class,color:r.color,size:this.getElType(r.type),font:null!==(e=r.font)&&void 0!==e?e:"Arial",stroke:this.filtero("blast",r.id,t.customOptions),gradient:this.filtero("gradient",r.id,t.customOptions),animation:this.filtero("animation",r.id,t.customOptions),shadow:this.filtero("shadow",r.id,t.customOptions),span:this.filtero("span",r.id,t.customOptions),backgroundOp:this.filtero("background",r.id,t.customOptions),marginOp:this.filtero("margin",r.id,t.customOptions),transform:this.filtero("transform",r.id,t.customOptions),filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions),resprop:null!==(n=r.resprop)&&void 0!==n?n:null})}},{key:"mapImage",value:function(t){var e=t.el;return new gt(e.url).set(Wo(Wo({},e),{},{isFull:e.isFull,animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"mapLink",value:function(t){var e=t.customOptions.filter(function(t){return"link-style"===t.op.name}),n=t.el;return t.el.id&&(n.id=t.el.id),t.el.link&&t.el.text&&(n.url=t.el.link,n.text=t.el.text),n.animation=this.filtero("animation",t.el.id,t.customOptions),n.class=t.el.class,n.width=t.el.width,n.font="Arial",n.fluidc=t.el.fluidc,n.transform=this.filtero("transform",t.el.id,t.customOptions),n.shadow=this.filtero("shadow",t.el.id,t.customOptions),n.gradient=this.filtero("gradient",t.el.id,t.customOptions),n.blast=this.filtero("blast",t.el.id,t.customOptions),n.backgroundOp=this.filtero("background",t.el.id,t.customOptions),n.raster=this.filteroRaster(t.el.id,t.customOptions),n.pad=[{a:10}],e.length>0?yo.style({el:t.el,re:n,bst:e,options:t.customOptions})[e.length-1]:(new Ct).set(n)}},{key:"mapGrid",value:function(t){var e=t.el,n=(t.customOptions.find(function(t){return"card-style"===t.op.name}),this.filtero("gradient",e.id,t.customOptions)),r=this.filtero("animation",e.id,t.customOptions),o=this.filtero("shadow",e.id,t.customOptions),i=this.filtero("margin",e.id,t.customOptions),a=this.filtero("filter",e.id,t.customOptions),s=this.filteroRaster(e.id,t.customOptions),l=this.filtero("blast",e.id,t.customOptions),c='\n new Card()\n .set({\n width: "300px", \n height: "700px",\n radius: "0.7rem", \n mar: { sides: ["all"], value: "0.8rem" }\n '.concat(void 0!==n?",\n gradient: ".concat(JSON.stringify(n)):"").concat(void 0!==r?",\n animation: ".concat(JSON.stringify(r)):"").concat(void 0!==o?",\n shadow: ".concat(JSON.stringify(o)):"").concat(void 0!==i?",\n marginOp: ".concat(JSON.stringify(i)):"").concat(void 0!==a?",\n filtera: ".concat(JSON.stringify(a)):"").concat(void 0!==l?",\n blast: ".concat(JSON.stringify(l)):"",'\n })\n .items([\n new Image(item.img).set({isFull: true, url: item.img}),\n new Text(item.title).set({ size: "S5", color: "orange" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#3498db", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white",\n mar: [{"a": 21}]\n })\n ])'),u=t.el.backgroundCard?'\n new ZoomCard()\n .set({\n url: item.img, \n font: "Arial", \n mar: { sides: ["all"], value: "0.8rem" }, \n inpad: "1rem", \n useBrightness: true\n })\n .items([\n new Text(item.title).set({ fluidc: "S6", color: "orange" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#3498db", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white"\n })\n ])':c;return' new FlexGrid()\n .set({\n colat: "700px",\n wrap: true,\n align: "center",\n gap: "1rem"\n '.concat(void 0!==n?",\n gradient: ".concat(JSON.stringify(n)):"").concat(void 0!==r?",\n animation: ".concat(JSON.stringify(r)):"").concat(void 0!==o?",\n shadow: ".concat(JSON.stringify(o)):"").concat(void 0!==i?",\n marginOp: ".concat(JSON.stringify(i)):"").concat(void 0!==a?",\n filtera: ".concat(JSON.stringify(a)):"").concat(void 0!==l?",\n blast: ".concat(JSON.stringify(l)):"").concat(void 0!==s?",\n raster: ".concat(JSON.stringify(s)):"",'\n })\n .items(\n [\n { img: "https://upload.wikimedia.org/wikipedia/commons/3/3a/Starship_S20.jpg", title: "Starship", link: "#ship" },\n { img: "https://upload.wikimedia.org/wikipedia/commons/1/16/Apollo_11_Launch_-_GPN-2000-000630.jpg", title: "Saturn V", link: "#saturn" },\n { img: "https://upload.wikimedia.org/wikipedia/commons/d/d6/STS120LaunchHiRes-edit1.jpg", title: "Shuttle", link: "#shuttle" }\n ].map(item => \n ').concat(u,"\n )\n )\n ")}},{key:"checkbox",value:function(t){var e=t.el,n="string"==typeof e.label?new ct(e.label).set({size:"S6"}):e.label;return this.attachRaster((new Zn).set(Wo(Wo({},this.elOpts(e,["label"])),void 0!==n?{label:n}:{})),e,t.customOptions)}},{key:"stack",value:function(t){var e=this,n=t.el,r=(new _e).set(this.elOpts(n)),o=Array.isArray(n.children)?n.children:null;return o&&r.add(o.map(function(n){return e.mapType(Wo(Wo({},t),{},{el:n}))})),this.attachRaster(r,n,t.customOptions)}},{key:"form",value:function(t){var e,n=this,r=t.el,o=(new uo).set(Wo(Wo({action:null!==(e=r.action)&&void 0!==e?e:""},void 0!==r.method?{method:r.method}:{}),void 0!==r.id?{id:r.id}:{})),i=Array.isArray(r.children)?r.children:null;return i&&o.add(i.map(function(e){return n.mapType(Wo(Wo({},t),{},{el:e}))})),o}},{key:"simple",value:function(t){var e,n,r=this,o=t.el,i=Array.isArray(o.react)?o.react:[];if(!i.length)throw new Error('[nodality] a "simple" element needs a non-empty `react` array of { at, template }.');var a=(Array.isArray(o.children)?o.children:[]).map(function(e){var n=r.mapType(Wo(Wo({},t),{},{el:e})).toCode();return Array.isArray(n)?n.join(""):String(n)}).join(",\n ");return"new AreaSwitcher()\n .set(".concat(JSON.stringify(Wo({gap:null!==(e=o.gap)&&void 0!==e?e:"10px",height:null!==(n=o.height)&&void 0!==n?n:"700px"},void 0!==o.id?{id:o.id}:{})),")\n .react(").concat(JSON.stringify(i,null,2),")\n .add([\n ").concat(a,"\n ])")}},{key:"mapWrap",value:function(t){var e,n,r=this,o=t.el,i=null!==(e=t.el.kind)&&void 0!==e?e:"",a=new We(i).set(Wo(Wo({},o),{},{font:null!==(n=o.font)&&void 0!==n?n:"Arial",stroke:this.filtero("blast",o.id,t.customOptions),gradient:this.filtero("gradient",o.id,t.customOptions),animation:this.filtero("animation",o.id,t.customOptions),shadow:this.filtero("shadow",o.id,t.customOptions),transform:this.filtero("transform",o.id,t.customOptions),filtera:this.filtero("filter",o.id,t.customOptions),raster:this.filteroRaster(o.id,t.customOptions)})),s=Array.isArray(o.children)?o.children:null;return s&&a.add(s.map(function(e){return r.mapType(Wo(Wo({},t),{},{el:e}))})),a}},{key:"mapUList",value:function(t){var e,n,r=this,o=t.el,i=null!==(e=t.el.kind)&&void 0!==e?e:"",a=new yr(i).set(Wo(Wo({},o),{},{font:null!==(n=o.font)&&void 0!==n?n:"Arial",stroke:this.filtero("blast",o.id,t.customOptions),gradient:this.filtero("gradient",o.id,t.customOptions),animation:this.filtero("animation",o.id,t.customOptions),shadow:this.filtero("shadow",o.id,t.customOptions),transform:this.filtero("transform",o.id,t.customOptions),filtera:this.filtero("filter",o.id,t.customOptions),raster:this.filteroRaster(o.id,t.customOptions)})),s=Array.isArray(o.items)?o.items:null;return s&&a.setItems(s.map(function(e){return"string"==typeof e?new ct(e).set({}):r.mapType(Wo(Wo({},t),{},{el:e}))})),a}},{key:"getElType",value:function(t){return"p"===t?"S6":"S".concat(t.substr(1))}},{key:"filtero",value:function(t,e,n){return n.filter(function(e){return e.op.name===t}).filter(function(t){return!t.target||t.target.includes(e)})[0]}},{key:"elOpts",value:function(t){for(var e=new Set(["type","children","items","breakpoints","inputType","text","url"].concat(function(t){if(Array.isArray(t))return Lo(t)}(a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return Lo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lo(t,e):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];e.has(i)||(n[i]=t[i])}var a;return n}},{key:"attachRaster",value:function(t,e,n){var r=this.filteroRaster(e.id,n);return r&&t&&"function"==typeof t.rasterize&&t.rasterize(r),t}},{key:"filteroRaster",value:function(t,e){var n=(e||[]).filter(function(e){return e&&"string"==typeof e.op&&m.includes(e.op)&&(!e.target||t&&e.target.includes(t))});return n.length>0?n:void 0}}],e&&No(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();module.exports=e})();
2
+ (()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},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 n(t){return n="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},n(t)}t.r(e),t.d(e,{ELEMENT_TYPES:()=>Go,ElementMapper:()=>Ho});var r="nodality.theme.mode",o="nodality:theme",i={mode:function(){try{var t=localStorage.getItem(r);if("light"===t||"dark"===t)return t}catch(t){}return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}(),tokens:{light:{},dark:{}},defaults:{light:{color:"#111"},dark:{}},setDefaults:function(t){return t&&"object"===n(t)&&(t.light&&(this.defaults.light=Object.assign({},this.defaults.light,t.light)),t.dark&&(this.defaults.dark=Object.assign({},this.defaults.dark,t.dark)),this._broadcast()),this},setTokens:function(t){return t&&"object"===n(t)&&(t.light&&Object.assign(this.tokens.light,t.light),t.dark&&Object.assign(this.tokens.dark,t.dark)),this},get current(){return this.tokens[this.mode]||{}},set:function(t){if("light"!==t&&"dark"!==t)return this;if(t===this.mode)return this;this.mode=t;try{localStorage.setItem(r,t)}catch(t){}return this._broadcast(),this},toggle:function(){return this.set("dark"===this.mode?"light":"dark")},subscribe:function(t){if("undefined"==typeof document)return function(){};var e=function(e){return t(e.detail.mode,e.detail.tokens)};document.addEventListener(o,e);try{t(this.mode,this.current)}catch(t){}return function(){return document.removeEventListener(o,e)}},_broadcast:function(){"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(o,{detail:{mode:this.mode,tokens:this.current}}))}};function a(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}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 l(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=u(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||u(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 u(t,e){if(t){if("string"==typeof t)return f(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var d={static:function(t){return{x:.5*t.w,y:.5*t.h,amt:1}},mouse:function(t){return{x:t.mouseX,y:t.mouseY,amt:1}},hover:function(t){return{x:t.mouseX,y:t.mouseY,amt:t.hover}},scroll:function(t){return{x:.5*t.w,y:t.h*t.scroll,amt:1}},time:function(t){return{x:t.w*(.5+.34*Math.cos(.6*t.t)),y:t.h*(.5+.34*Math.sin(.8*t.t)),amt:1}}},h=Object.keys(d),p={hexalize:{doc:{summary:"Hexagonal cell grid. Snaps sampling to a hex lattice and draws cell borders; with `lift`, cells near the driver swell toward the viewer and their content magnifies to match.",params:{size:{default:24,unit:"px",summary:"lattice pitch — the width of one cell"},lift:{default:0,unit:"ratio",structural:!0,summary:"how much bigger a cell gets at the focus: 0.3 renders the nearest hexagons at 1.3x. 0 compiles the cheap path entirely away, so crossing zero rebuilds."},radius:{default:200,unit:"px",summary:"falloff distance around the driver focus"}}},structuralOnToggle:["lift"],stage:"cell",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"lift;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return e.lift?"\n {\n vec2 hp = warped / ".concat(t,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n vec2 ").concat(t,"AX = normalize(vec2(1.0, 1.7320508));\n vec2 ").concat(t,"c0 = hp - gv;\n // Seed with the owning cell. Its own hexagon always covers the\n // fragment at any scale >= 1, so there is always a winner.\n vec2 ").concat(t,"bestC = ").concat(t,"c0;\n float ").concat(t,"bestF = (1.0 - smoothstep(0.0, ").concat(t,"radius,\n length(").concat(t,"c0 * ").concat(t,"size - ").concat(t,"dpos))) * ").concat(t,"damt;\n float ").concat(t,"bestS = 1.0 + ").concat(t,"lift * ").concat(t,"bestF;\n").concat([[1,0],[-1,0],[.5,.8660254],[-.5,.8660254],[.5,-.8660254],[-.5,-.8660254]].map(function(e){var n,r,o=c(e,2);return n=o[0],r=o[1],"\n {\n vec2 c = ".concat(t,"c0 + vec2(").concat(n.toFixed(7),", ").concat(r.toFixed(7),");\n float f = 1.0 - smoothstep(0.0, ").concat(t,"radius,\n length(c * ").concat(t,"size - ").concat(t,"dpos));\n f *= ").concat(t,"damt;\n float s = 1.0 + ").concat(t,"lift * f;\n vec2 q = hp - c;\n float hd = max(dot(abs(q), ").concat(t,"AX), abs(q).x);\n // Covered by this cell's grown hexagon, and nearer than\n // whatever we have so far.\n if (hd <= 0.5 * s && s > ").concat(t,"bestS) {\n ").concat(t,"bestS = s; ").concat(t,"bestC = c; ").concat(t,"bestF = f;\n }\n }")}).join(""),"\n center = ").concat(t,"bestC * ").concat(t,"size;\n // Divide by the winner's scale: the border test then reaches\n // 0.5 further out (a bigger hexagon) and the sample moves in\n // toward the centre (its content magnified to match), both by\n // the same factor, so proportions are preserved exactly.\n gv = (hp - ").concat(t,"bestC) / max(").concat(t,"bestS, 1e-3);\n warped = center + gv * ").concat(t,'size;\n gv = abs(gv);\n // Border strength follows the SAME falloff as the scale, so a\n // cell that has not been raised draws no border at all. Away\n // from the pointer bestF is 0, which means scale 1, sampling\n // untouched and edge 0 — bit-identical to the source image, so\n // nothing reveals that an effect is attached until the pointer\n // arrives. Pair with by:"hover" for a fully flush resting\n // state; by:"mouse" holds amt at 1 and so keeps a permanent\n // hotspot wherever the pointer last was.\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, ').concat(t,"AX), gv.x)) * ").concat(t,"bestF);\n }"):"\n {\n vec2 hp = warped / ".concat(t,"size;\n vec2 hr = vec2(1.0, 1.7320508), hh = hr * 0.5;\n vec2 ha = mod(hp, hr) - hh, hb = mod(hp - hh, hr) - hh;\n vec2 gv = dot(ha, ha) < dot(hb, hb) ? ha : hb;\n center = (hp - gv) * ").concat(t,"size;\n gv = abs(gv);\n edge = max(edge, smoothstep(0.44, 0.5,\n max(dot(gv, normalize(vec2(1.0, 1.7320508))), gv.x)));\n }")},uniforms:function(t,e){return{size:["1f",(t.size||24)*e],lift:["1f",null!=t.lift?t.lift:0],radius:["1f",(t.radius||200)*e]}},map:function(t,e){return e.lift?null:t}},offset:{doc:{summary:"Pushes the coordinate space away from the driver focus. Warp stage, so cell grids and borders move WITH the content instead of staying a fixed screen-space lattice.",params:{strength:{default:20,unit:"px",summary:"how far the space is pushed at full amount"},radius:{default:260,unit:"px",summary:"falloff distance around the focus"}}},stage:"warp",defaultDriver:"mouse",decl:function(t){return"uniform float ".concat(t,"strength; uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos; uniform float ").concat(t,"damt;")},code:function(t){return"\n {\n float d = length(warped - ".concat(t,"dpos);\n float fall = 1.0 - smoothstep(0.0, ").concat(t,"radius, d);\n vec2 dir = d > 0.5 ? (warped - ").concat(t,"dpos) / d : vec2(0.0);\n warped -= dir * ").concat(t,"strength * fall * ").concat(t,"damt;\n }")},uniforms:function(t,e){return{strength:["1f",(t.strength||20)*e],radius:["1f",(t.radius||260)*e]}},map:function(t,e,n){var r,o,i,a=(e.strength||20)*n.dpr,s=(e.radius||260)*n.dpr,l=t[0]-n.dpos[0],c=t[1]-n.dpos[1],u=Math.hypot(l,c),f=1-(r=s,o=u,(i=Math.min(1,Math.max(0,(o-0)/(r-0||1e-6))))*i*(3-2*i));if(!(u>.5))return t;var d=a*f*n.damt/u;return[t[0]-l*d,t[1]-c*d]}},flow:{doc:{summary:"Curl-noise current. The coordinate space drifts along a divergence-free field, so content slides as if carried by water. Divergence-free means the flow never piles up or tears.",params:{strength:{default:18,unit:"px",summary:"how far the current carries the space"},scale:{default:120,unit:"px",summary:"size of one eddy — small is turbulent, large is a slow drift"},speed:{default:.25,unit:"seconds",summary:"how fast the field evolves; 0 freezes it"},seed:{default:0,unit:"count",summary:"picks a different field of the same character"},radius:{default:320,unit:"px",summary:"falloff around the focus. Only used when `by` names a driver; without one the current covers the whole element."}}},structural:["by"],stage:"warp",decl:function(t){return"\n uniform float ".concat(t,"scale;\n uniform float ").concat(t,"strength;\n uniform float ").concat(t,"speed;\n uniform float ").concat(t,"seed;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;\n // Polynomial bit-mixing hash, deliberately NOT the usual\n // fract(sin(dot(...))). Trig-based hashes disagree across GPU\n // vendors — sin's precision at large arguments is not\n // specified — so the same seed would render a different field\n // on different hardware. This one is multiply/fract only, so\n // the field is at least stable per-device. (Determinism rule,\n // MORPH-IMPL-SPEC §2.9.5a.)\n float ").concat(t,"h(vec2 v) {\n vec3 q = fract(vec3(v.xyx) * 0.1031 + ").concat(t,"seed);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n }\n float ").concat(t,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(t,"h(i), ").concat(t,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(t,"h(i + vec2(0.0, 1.0)), ").concat(t,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }\n // The potential. Two octaves: enough structure to read as a\n // current without the cost of a full fBm.\n float ").concat(t,"psi(vec2 v) {\n return ").concat(t,"n(v) * 0.65 + ").concat(t,"n(v * 2.3 + 11.0) * 0.35;\n }")},code:function(t,e){return"\n {\n float sc = max(".concat(t,"scale, 1.0);\n vec2 drift = vec2(0.0, u_time * ").concat(t,"speed);").concat(e.by?"\n float fall = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(warped - ").concat(t,"dpos));\n float amt = ").concat(t,"strength * fall * ").concat(t,"damt;"):"\n float amt = ".concat(t,"strength;"),"\n // Three fixed Euler steps along curl(psi). Fixed count, not\n // adaptive: the step budget is a compile-time property so the\n // shader cost cannot vary with the content.\n for (int i = 0; i < 3; i++) {\n vec2 q = warped / sc + drift;\n float e = 0.35;\n float dy = ").concat(t,"psi(q + vec2(0.0, e)) - ").concat(t,"psi(q - vec2(0.0, e));\n float dx = ").concat(t,"psi(q + vec2(e, 0.0)) - ").concat(t,"psi(q - vec2(e, 0.0));\n // curl of a 2D scalar potential = (dpsi/dy, -dpsi/dx)\n warped += vec2(dy, -dx) / (2.0 * e) * amt * 0.3333;\n }\n }")},uniforms:function(t,e){return{scale:["1f",(null!=t.scale?t.scale:120)*e],strength:["1f",(null!=t.strength?t.strength:18)*e],speed:["1f",null!=t.speed?t.speed:.25],seed:["1f",null!=t.seed?t.seed:0],radius:["1f",(null!=t.radius?t.radius:320)*e]}}},duotone:{doc:{summary:"Maps luminance onto a two-colour ramp. With `by`, the mapping is confined to a spot around the driver focus and the rest of the element keeps its own colour.",params:{colors:{default:["#104B87","#E8FF00"],unit:"color",summary:"[shadow, highlight] — the two ends of the ramp"},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by"],stage:"color",decl:function(t){return"uniform vec3 ".concat(t,"a; uniform vec3 ").concat(t,"b; uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos; uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n vec3 duo = mix(".concat(t,"a, ").concat(t,"b, lum);\n ").concat(e.by?"float mask = (1.0 - smoothstep(".concat(t,"radius * 0.35, ").concat(t,"radius,\n length(center - ").concat(t,"dpos))) * ").concat(t,"damt;"):"float mask = 1.0;","\n col = mix(col, duo, mask);\n }")},uniforms:function(t,e){var n=t.colors||["#104B87","#E8FF00"];return{a:["3fv",y(n[0])],b:["3fv",y(n[1])],radius:["1f",(t.radius||220)*e]}}},edges:{doc:{summary:"Draws the cell borders a cell-stage op produced. On its own it shows nothing — it colours `edge`, which only hexalize (or another cell op) writes.",params:{color:{default:"#FFFFFF",unit:"color",summary:"border colour"},strength:{default:1,unit:"ratio",summary:"border opacity"}}},stage:"color",decl:function(t){return"uniform vec3 ".concat(t,"color; uniform float ").concat(t,"strength;")},code:function(t){return"\n {\n edgeCol = ".concat(t,"color;\n edgeCov = max(edgeCov, edge * ").concat(t,"strength);\n }")},uniforms:function(t){return{color:["3fv",y(t.color||"#FFFFFF")],strength:["1f",null!=t.strength?t.strength:1]}}},halftone:{doc:{summary:"Print halftone: the image is redrawn as a grid of ink dots on paper, dot size following local luminance.",params:{size:{default:6,unit:"px",summary:"dot pitch"},angle:{default:15,unit:"deg",summary:"screen angle of the dot grid"},ink:{default:"#0B1B2B",unit:"color",summary:"dot colour"},paper:{default:"#FFFFFF",unit:"color",summary:"background colour"},softness:{default:.08,unit:"ratio",summary:"dot edge softness — 0 is a hard stencil"},amount:{default:1,unit:"ratio",summary:"blend back toward the un-screened image; 0 is identity. Keyframe it to 0 at both ends of a transition so the shader hands over to the real element without a pop."},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by"],stage:"color",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"amount;\n uniform float ").concat(t,"angle;\n uniform vec3 ").concat(t,"ink;\n uniform vec3 ").concat(t,"paper;\n uniform float ").concat(t,"soft;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float sz = ".concat(t,"size;").concat(e.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(t,"dpos));\n sz *= 1.0 + fd * ").concat(t,"damt * 1.8;"):"","\n // Screen angle: rotating the grid is what stops the dots\n // reading as a horizontal/vertical texture.\n float ca = cos(").concat(t,"angle), sa = sin(").concat(t,"angle);\n vec2 rp = vec2(ca * frag.x - sa * frag.y,\n sa * frag.x + ca * frag.y) / max(sz, 1.0);\n vec2 cell = fract(rp) - 0.5;\n // Dot radius from tone: darker tone prints a bigger dot.\n // sqrt because ink coverage goes as area, not radius.\n float rr = sqrt(clamp(1.0 - lum, 0.0, 1.0)) * 0.55;\n float dm = smoothstep(rr, rr - ").concat(t,"soft, length(cell));\n col = mix(col, mix(").concat(t,"paper, ").concat(t,"ink, dm), clamp(").concat(t,"amount, 0.0, 1.0));\n }")},uniforms:function(t,e){return{size:["1f",(t.size||6)*e],amount:["1f",null!=t.amount?t.amount:1],angle:["1f",(null!=t.angle?t.angle:15)*Math.PI/180],ink:["3fv",y(t.ink||"#0B1B2B")],paper:["3fv",y(t.paper||"#FFFFFF")],soft:["1f",null!=t.softness?t.softness:.08],radius:["1f",(t.radius||220)*e]}}},dither:{doc:{summary:"Ordered (Bayer) dithering to a small palette — the look of an 8-bit display, and the one op that gets sharper as the element gets smaller.",params:{size:{default:1,unit:"px",summary:"size of one dither cell; 1 is per-pixel"},levels:{default:6,unit:"count",summary:"quantisation steps per channel"},amount:{default:1,unit:"ratio",summary:"blend back toward the undithered image"},mono:{default:!1,unit:"bool",structural:!0,summary:"quantise luminance to ink/paper instead of per-channel colour. A different shader, so toggling rebuilds."},ink:{default:"#0B1B2B",unit:"color",summary:"dark end, mono only"},paper:{default:"#FFFFFF",unit:"color",summary:"light end, mono only"},radius:{default:220,unit:"px",summary:"spot size when `by` names a driver"}}},structural:["by","mono"],stage:"color",decl:function(t){return"\n uniform float ".concat(t,"levels;\n uniform float ").concat(t,"size;\n uniform float ").concat(t,"amount;\n uniform vec3 ").concat(t,"ink;\n uniform vec3 ").concat(t,"paper;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n // Bayer matrices by recursive bit-interleave rather than a\n // 64-entry table: WebGL1 has no constant array indexing, and\n // the nesting is exactly the recursive definition of the\n // ordered-dither matrix.\n float ").concat(t,"b2(vec2 a) {\n a = floor(a);\n return fract(a.x * 0.5 + a.y * a.y * 0.75);\n }\n float ").concat(t,"b4(vec2 a) { return ").concat(t,"b2(0.5 * a) * 0.25 + ").concat(t,"b2(a); }\n float ").concat(t,"b8(vec2 a) { return ").concat(t,"b4(0.5 * a) * 0.25 + ").concat(t,"b2(a); }")},code:function(t,e){return"\n {\n float sz = max(".concat(t,"size, 1e-3);").concat(e.by?"\n float fd = 1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(t,"dpos));\n sz *= 1.0 + fd * ").concat(t,"damt * 1.8;"):"","\n // Centre the threshold on zero so dithering does not lift or\n // crush the overall exposure, only redistributes it.\n float t = ").concat(t,"b8(frag / sz) - 0.5;\n float lv = max(").concat(t,"levels, 1.0);\n ").concat(e.mono?"\n float lum = dot(col, vec3(0.299, 0.587, 0.114));\n float q = step(0.5, lum + t);\n vec3 dq = mix(".concat(t,"ink, ").concat(t,"paper, q);"):"\n // Per channel: scale to level index, offset by the threshold,\n // round, scale back. The +t before rounding is what turns a\n // hard band edge into an interleaved pattern of the two\n // neighbouring levels.\n vec3 dq = floor(col * lv + 0.5 + t) / lv;","\n col = mix(col, clamp(dq, 0.0, 1.0), clamp(").concat(t,"amount, 0.0, 1.0));\n }")},uniforms:function(t,e){return{levels:["1f",null!=t.levels?t.levels:6],size:["1f",(null!=t.size?t.size:1)*e],amount:["1f",null!=t.amount?t.amount:1],ink:["3fv",y(t.ink||"#0B1B2B")],paper:["3fv",y(t.paper||"#FFFFFF")],radius:["1f",(t.radius||220)*e]}}},aberration:{movesCoords:!1,doc:{summary:"Chromatic aberration: the three colour channels are sampled at slightly different offsets, like a cheap lens.",params:{amount:{default:6,unit:"px",summary:"channel separation"},radius:{default:240,unit:"px",summary:"falloff around the focus when `by` names a driver"}}},structural:["by"],stage:"displace",chroma:!0,decl:function(t){return"\n uniform float ".concat(t,"amount;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"dpos;\n uniform float ").concat(t,"damt;")},code:function(t,e){return"\n {\n vec2 ctr = ".concat(e.by?"".concat(t,"dpos"):"u_res * 0.5",";\n vec2 dv = sampleP - ctr;\n float dl = length(dv);\n vec2 dir = dl > 0.5 ? dv / dl : vec2(0.0);\n ").concat(e.by?"float amt = ".concat(t,"amount * ").concat(t,"damt *\n (1.0 - smoothstep(0.0, ").concat(t,"radius, dl));"):"float amt = ".concat(t,"amount * (dl / max(length(u_res) * 0.5, 1.0));"),"\n chroma += dir * amt;\n }")},uniforms:function(t,e){return{amount:["1f",(null!=t.amount?t.amount:6)*e],radius:["1f",(t.radius||240)*e]}}},mask:{doc:{summary:'Writes a scalar FIELD for later ops to read — draws nothing itself. Give a downstream op `masked: "name"` and it applies only where this field is high. This is how any op becomes local without knowing anything about masking.',params:{as:{default:"mask",unit:"name",structural:!0,summary:"name of the field written. Consumers name it in `masked:`."},from:{default:"radial",unit:"name",structural:!0,summary:"field shape — compiled in, so changing it rebuilds"},at:{default:[.5,.5],unit:"point",structural:!0,summary:"centre as a fraction of the element box; survives resizes"},radius:{default:260,unit:"px",summary:"field radius"},invert:{default:!1,unit:"bool",summary:"swap inside and outside"},remap:{default:[0,1],unit:"range",summary:"rescale the field's output range"}}},structural:["as","from","at"],stage:"field",producesField:!0,defaultDriver:"static",decl:function(t){return"\n uniform vec2 ".concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n uniform vec2 ").concat(t,"at;\n uniform vec2 ").concat(t,"remap;\n uniform float ").concat(t,"invert;")},code:function(t,e){var n=e.from||"radial",r=e.at?"(".concat(t,"at * u_res)"):"".concat(t,"dpos"),o="vertical"===n?"frag.y / max(u_res.y, 1.0)":"horizontal"===n?"frag.x / max(u_res.x, 1.0)":"1.0 - smoothstep(0.0, ".concat(t,"radius, length(frag - ").concat(r,"))");return"\n {\n float m = ".concat(o,";\n m = clamp((m - ").concat(t,"remap.x) / max(").concat(t,"remap.y - ").concat(t,"remap.x, 1e-4), 0.0, 1.0);\n m = mix(m, 1.0 - m, ").concat(t,"invert);\n ").concat(S(e.as||"mask")," *= m * ").concat(t,"damt;\n }")},uniforms:function(t,e){return{radius:["1f",(null!=t.radius?t.radius:260)*e],at:["2fv",t.at||[.5,.5]],remap:["2fv",t.remap||[0,1]],invert:["1f",t.invert?1:0]}}},noise:{doc:{summary:"Writes an animated noise FIELD. Same contract as `mask` — it draws nothing; downstream ops read it via `masked:`. Use it to make any other op flicker, breathe or crawl.",params:{as:{default:"mask",unit:"name",structural:!0,summary:"name of the field written"},scale:{default:3,unit:"ratio",summary:"noise frequency across the element"},speed:{default:.3,unit:"seconds",summary:"how fast it evolves; 0 freezes it"},amount:{default:1,unit:"ratio",summary:"blend between flat 1.0 and full noise"},remap:{default:[0,1],unit:"range",summary:"rescale the field's output range"}}},structural:["as"],stage:"field",producesField:!0,decl:function(t){return"\n uniform float ".concat(t,"scale;\n uniform float ").concat(t,"speed;\n uniform vec2 ").concat(t,"remap;\n uniform float ").concat(t,"amp;\n float ").concat(t,"h(vec2 v) {\n return fract(sin(dot(v, vec2(41.113, 289.717))) * 43758.545);\n }\n float ").concat(t,"n(vec2 v) {\n vec2 i = floor(v), f = v - i;\n f = f * f * (3.0 - 2.0 * f);\n return mix(mix(").concat(t,"h(i), ").concat(t,"h(i + vec2(1.0, 0.0)), f.x),\n mix(").concat(t,"h(i + vec2(0.0, 1.0)), ").concat(t,"h(i + vec2(1.0, 1.0)), f.x), f.y);\n }")},code:function(t,e){return"\n {\n vec2 np = frag / max(u_res.y, 1.0) * ".concat(t,"scale;\n // Two octaves: enough structure to read as turbulence\n // without the cost of a full fBm.\n float n = ").concat(t,"n(np + u_time * ").concat(t,"speed) * 0.65 +\n ").concat(t,"n(np * 2.7 - u_time * ").concat(t,"speed * 0.6) * 0.35;\n n = clamp((n - ").concat(t,"remap.x) / max(").concat(t,"remap.y - ").concat(t,"remap.x, 1e-4), 0.0, 1.0);\n ").concat(S(e.as||"mask")," *= mix(1.0, n, ").concat(t,"amp);\n }")},uniforms:function(t){return{scale:["1f",null!=t.scale?t.scale:3],speed:["1f",null!=t.speed?t.speed:.3],remap:["2fv",t.remap||[0,1]],amp:["1f",null!=t.amount?t.amount:1]}}},copy:{multiSample:!0,doc:{summary:"Stamps extra copies of the element over itself. Copies sample the ORIGINAL texture, not the result of earlier colour ops, so a copy of a halftoned element is a copy of the unhalftoned source.",params:{count:{default:5,unit:"count",structural:!0,summary:"stamps arranged in a ring around the focus. The loop is unrolled at compile time, so this rebuilds — not something to animate."},points:{default:null,unit:"point",structural:!0,summary:"explicit [[x,y], ...] in fractions of the element box, instead of a ring. Survives resizes. Overrides `count`."},radius:{default:110,unit:"px",summary:"ring radius when using `count`"},scale:{default:.5,unit:"ratio",summary:"size of each copy"},rotate:{default:0,unit:"deg",summary:"rotation applied per copy"},fade:{default:1,unit:"ratio",summary:"opacity falloff across the set"},amount:{default:1,unit:"ratio",summary:"overall blend of the copies over the original"}}},structural:["count","points"],stage:"color",defaultDriver:"static",decl:function(t){return"\n uniform vec2 ".concat(t,"dpos;\n uniform float ").concat(t,"damt;\n uniform float ").concat(t,"radius;\n uniform float ").concat(t,"scale;\n uniform float ").concat(t,"rotate;\n uniform float ").concat(t,"fade;\n uniform float ").concat(t,"amount;")},code:function(t,e){for(var n=Array.isArray(e.points)&&e.points.length>0,r=n?e.points.length:Math.max(1,Math.min(24,Math.round(e.count||5))),o="",i=function(i){var a,s=n?"vec2(".concat((+e.points[i][0]).toFixed(5),", ").concat((+e.points[i][1]).toFixed(5),") * u_res"):(a=i/r*Math.PI*2,"".concat(t,"dpos + vec2(").concat(Math.cos(a).toFixed(5),", ")+"".concat(Math.sin(a).toFixed(5),") * ").concat(t,"radius"));o+="\n {\n float ang = ".concat(t,"rotate * ").concat((i+1).toFixed(1),";\n float cs = cos(ang), sn = sin(ang);\n // Inverse transform: to draw a stamp scaled by s about a\n // centre c, fetch from the source at (frag - c) / s.\n vec2 d = mat2(cs, -sn, sn, cs) * (frag - (").concat(s,"));\n vec2 q = d / max(").concat(t,"scale, 1e-3) + u_res * 0.5;\n vec2 quv = vec2(q.x / u_res.x, 1.0 - q.y / u_res.y);\n vec2 inside = step(vec2(0.0), quv) * step(quv, vec2(1.0));\n vec4 s = texture2D(u_tex, clamp(quv, 0.0, 1.0));\n float w = s.a * inside.x * inside.y * ").concat(t,"amount * ").concat(t,"damt\n * pow(").concat(t,"fade, ").concat(i.toFixed(1),");\n // Straight-alpha OVER, newest stamp on top.\n float na = w + ovA * (1.0 - w);\n ovCol = (s.rgb * w + ovCol * ovA * (1.0 - w)) / max(na, 1e-4);\n ovA = na;\n }")},a=0;a<r;a++)i(a);return o},uniforms:function(t,e){return{radius:["1f",(null!=t.radius?t.radius:110)*e],scale:["1f",null!=t.scale?t.scale:.5],rotate:["1f",null!=t.rotate?t.rotate:0],fade:["1f",null!=t.fade?t.fade:1],amount:["1f",null!=t.amount?t.amount:1]}}},merge:{doc:{summary:"Runs two sub-chains over the same source and blends the results. The only op that takes other ops as arguments — everything else composes by sequence, this composes in parallel.",params:{a:{default:null,summary:"first branch: an array of nodes",structural:!0},b:{default:null,summary:"second branch: an array of nodes",structural:!0},mode:{default:"over",unit:"name",structural:!0,summary:"how the branches combine: over, add, screen, multiply, difference, lighten. Compiled in, so it rebuilds."},mix:{default:1,unit:"ratio",summary:"how far to blend b into a"}}},structural:["mode","a","b"],stage:"color",decl:function(t){return"uniform float ".concat(t,"mix;")},code:function(){return""},uniforms:function(t){return{mix:["1f",null!=t.mix?t.mix:1]}}},echo:{doc:{summary:"Temporal accumulation — a fading trail of what CHANGED. Typing smears, a ticking counter leaves a comet. The one op that does nothing on the snapshot backend, because a frozen image has no motion to record.",params:{strength:{default:.85,unit:"ratio",summary:"opacity of the trail"},decay:{default:.92,unit:"ratio",summary:"per-second persistence — higher is a longer tail"},tint:{default:"#7FD4FF",unit:"color",summary:"colour pushed into the trail"},tintAmount:{default:.5,unit:"ratio",summary:"how far the trail is tinted"}}},stage:"color",decl:function(t){return"\n uniform sampler2D ".concat(t,"hist;\n uniform float ").concat(t,"strength;\n uniform vec3 ").concat(t,"tint;\n uniform float ").concat(t,"tintAmt;")},code:function(t){return"\n {\n // Sampled in screen space: the trail records where things\n // WERE, which is not where a warp op would fetch them from.\n vec2 huv = vec2(frag.x / u_res.x, 1.0 - frag.y / u_res.y);\n vec4 h = texture2D(".concat(t,"hist, clamp(huv, 0.001, 0.999));\n float ha = clamp(h.a * ").concat(t,"strength, 0.0, 1.0);\n vec3 hc = mix(h.rgb, ").concat(t,"tint, ").concat(t,"tintAmt);\n // Straight-alpha OVER into the border layer so an edges op\n // in the same chain still composites correctly.\n float na = ha + edgeCov * (1.0 - ha);\n edgeCol = (hc * ha + edgeCol * edgeCov * (1.0 - ha)) / max(na, 1e-4);\n edgeCov = na;\n }")},uniforms:function(t){return{strength:["1f",null!=t.strength?t.strength:.85],tint:["3fv",y(t.tint||"#7FD4FF")],tintAmt:["1f",t.tint?null!=t.tintAmount?t.tintAmount:.5:0]}},solver:{resolutions:function(t,e,n){return{frame:[e,n]}},targets:{history:{double:!0,res:"frame",fmt:"rgba",smooth:!0}},samplers:{hist:"history"},programs:{accumulate:"\nprecision highp float;\nuniform sampler2D u_content;\nuniform sampler2D u_hist;\nuniform vec2 u_texel;\nuniform float u_decay;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec4 c = texture2D(u_content, uv);\n vec4 h = texture2D(u_hist, uv) * u_decay;\n gl_FragColor = max(c, h);\n}"},splatColor:function(){return[0,0,0]},step:function(t,e,n){var r=Math.min(n.dt,1/30),o=Math.pow(null!=e.decay?e.decay:.92,60*r);t.use("accumulate"),t.f2("u_texel",1/t.canvasW,1/t.canvasH),t.f1("u_decay",o),t.smp("u_content",t.content,0),t.smp("u_hist",t.read("history"),1),t.blit(t.write("history")),t.swap("history")}}},stir:{doc:{summary:"Stirred liquid: a real fluid simulation the content is dragged through. STATEFUL — it owns a ping-pong pair of render targets that evolve frame to frame, so it is the most expensive op here.",params:{strength:{default:26,unit:"px",summary:"how far the fluid carries the content"},force:{default:1,unit:"ratio",summary:"how hard the pointer pushes the fluid"},radius:{default:.1,unit:"ratio",summary:"splat size, as a fraction of the sim grid"},curl:{default:2.2,unit:"ratio",summary:"vorticity — how much the fluid curls into eddies"},decay:{default:.985,unit:"ratio",summary:"per-second velocity persistence"},pressure:{default:.8,unit:"ratio",summary:"pressure retained between frames"},pressureIterations:{default:6,unit:"count",summary:"solver iterations; higher is stiffer and slower"},intensity:{default:1.6,unit:"ratio",summary:"brightness of the dye layer"},sheen:{default:.15,unit:"ratio",summary:"specular highlight on the surface"},tint:{default:"#7FD4FF",unit:"color",summary:"dye colour, unless `rainbow`"},rainbow:{default:!1,unit:"bool",summary:"cycle dye hue instead of using `tint`"},dye:{default:.85,unit:"ratio",summary:"how much dye colour reaches the final image"},dyeAmount:{default:.6,unit:"ratio",summary:"how much dye each splat injects"},dyeFade:{default:.97,unit:"ratio",summary:"per-second dye persistence"},resolution:{default:128,unit:"count",summary:"velocity grid size, clamped 32..512"},dyeResolution:{default:512,unit:"count",summary:"dye grid size, clamped 64..1024"}}},stage:["warp","color"],decl:function(t){return"\n uniform sampler2D ".concat(t,"vel;\n uniform sampler2D ").concat(t,"dye;\n uniform float ").concat(t,"strength;\n uniform float ").concat(t,"dyemix;\n uniform float ").concat(t,"intensity;\n uniform float ").concat(t,"sheen;\n uniform vec3 ").concat(t,"tint;")},code:function(t,e,n){return"warp"===n?"\n {\n // frag/warped are top-down pixels, the field is bottom-up\n // [0,1]: flip y going in, and flip the y of the vector coming\n // out so the content drags WITH the pointer.\n vec2 fuv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec2 v = texture2D(".concat(t,"vel, clamp(fuv, 0.001, 0.999)).xy;\n warped += vec2(v.x, -v.y) * ").concat(t,"strength;\n }"):"\n {\n // Sampled at the CONTINUOUS warped position, never at the\n // cell centre: a cell op upstream (hexalize) snaps the cell\n // centre to one point per tile, which would quantise the\n // liquid into flat per-hex patches instead of smooth swirls.\n vec2 suv = vec2(warped.x / u_res.x, 1.0 - warped.y / u_res.y);\n vec3 dc = texture2D(".concat(t,"dye, clamp(suv, 0.001, 0.999)).rgb;\n float mag = length(dc);\n // Colour is carried IN the dye field and advected with it, so\n // a ribbon keeps its hue while the flow folds it. Deriving\n // colour from the local flow direction instead would make\n // neighbouring pixels jump hue and read as confetti.\n vec3 liquid = mag > 1e-4 ? clamp(dc / mag * 1.25, 0.0, 1.0) : ").concat(t,"tint;\n float amt = clamp((1.0 - exp(-mag * ").concat(t,"intensity)) * ").concat(t,"dyemix, 0.0, 1.0);\n // Straight-alpha OVER so a later overlay op (blobs) still\n // composites correctly on top of the liquid.\n float na = amt + ovA * (1.0 - amt);\n ovCol = (liquid * amt + ovCol * ovA * (1.0 - amt)) / max(na, 1e-4);\n ovA = na;\n\n // Faint sheen on the content itself where the flow is fast.\n float sp = length(texture2D(").concat(t,"vel, clamp(suv, 0.001, 0.999)).xy);\n col = mix(col, ").concat(t,"tint, (1.0 - exp(-sp * 0.7)) * ").concat(t,"sheen);\n }")},uniforms:function(t,e){return{strength:["1f",(null!=t.strength?t.strength:26)*e],sheen:["1f",null!=t.sheen?t.sheen:.15],tint:["3fv",y(t.tint||"#7FD4FF")],dyemix:["1f",null!=t.dye?t.dye:.85],intensity:["1f",null!=t.intensity?t.intensity:1.6]}},solver:{resolutions:function(t){return{sim:Math.max(32,Math.min(t.resolution||128,512)),dye:Math.max(64,Math.min(t.dyeResolution||512,1024))}},targets:{velocity:{double:!0,res:"sim",fmt:"rg",smooth:!0},dye:{double:!0,res:"dye",fmt:"rgba",smooth:!0},pressure:{double:!0,res:"sim",fmt:"r",smooth:!1},divergence:{double:!1,res:"sim",fmt:"r",smooth:!1},vorticity:{double:!1,res:"sim",fmt:"r",smooth:!1}},samplers:{vel:"velocity",dye:"dye"},programs:{splat:"\nprecision highp float;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform vec2 u_point;\nuniform vec3 u_amount;\nuniform float u_radius;\nuniform float u_aspect;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 d = uv - u_point;\n if (u_aspect >= 1.0) d.y /= u_aspect; else d.x *= u_aspect;\n float g = exp(-dot(d, d) / max(u_radius * u_radius, 1e-6));\n gl_FragColor = vec4(texture2D(u_src, uv).xyz + u_amount * g, 1.0);\n}",advect:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_src;\nuniform vec2 u_texel;\nuniform float u_dt;\nuniform float u_diss;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n vec2 back = uv - texture2D(u_vel, uv).xy * u_dt;\n gl_FragColor = vec4(texture2D(u_src, clamp(back, 0.0, 1.0)).xyz * u_diss, 1.0);\n}",curl:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).y;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).y;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).x;\n gl_FragColor = vec4(0.5 * ((r - l) - (t - b)), 0.0, 0.0, 1.0);\n}",confine:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform sampler2D u_curl;\nuniform vec2 u_texel;\nuniform float u_eps;\nuniform float u_dt;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_curl, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_curl, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_curl, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_curl, uv - vec2(0.0, u_texel.y)).x;\n float c = texture2D(u_curl, uv).x;\n vec2 grad = 0.5 * vec2(abs(r) - abs(l), abs(t) - abs(b));\n vec2 n = grad / (length(grad) + 1e-5);\n vec2 force = u_eps * c * vec2(n.y, -n.x);\n vec2 v = texture2D(u_vel, uv).xy + force * u_dt;\n gl_FragColor = vec4(clamp(v, -64.0, 64.0), 0.0, 1.0);\n}",divergence:"\nprecision highp float;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_vel, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_vel, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_vel, uv + vec2(0.0, u_texel.y)).y;\n float b = texture2D(u_vel, uv - vec2(0.0, u_texel.y)).y;\n vec2 c = texture2D(u_vel, uv).xy;\n if (uv.x - u_texel.x < 0.0) l = -c.x;\n if (uv.x + u_texel.x > 1.0) r = -c.x;\n if (uv.y - u_texel.y < 0.0) b = -c.y;\n if (uv.y + u_texel.y > 1.0) t = -c.y;\n gl_FragColor = vec4(0.5 * ((r - l) + (t - b)), 0.0, 0.0, 1.0);\n}",jacobi:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_div;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n float d = texture2D(u_div, uv).x;\n gl_FragColor = vec4((r + l + t + b - d) * 0.25, 0.0, 0.0, 1.0);\n}",subtract:"\nprecision highp float;\nuniform sampler2D u_p;\nuniform sampler2D u_vel;\nuniform vec2 u_texel;\nvoid main() {\n vec2 uv = gl_FragCoord.xy * u_texel;\n float r = texture2D(u_p, uv + vec2(u_texel.x, 0.0)).x;\n float l = texture2D(u_p, uv - vec2(u_texel.x, 0.0)).x;\n float t = texture2D(u_p, uv + vec2(0.0, u_texel.y)).x;\n float b = texture2D(u_p, uv - vec2(0.0, u_texel.y)).x;\n vec2 v = texture2D(u_vel, uv).xy - 0.5 * vec2(r - l, t - b);\n gl_FragColor = vec4(v, 0.0, 1.0);\n}",decay:"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_texel;\nuniform float u_value;\nvoid main() {\n gl_FragColor = texture2D(u_tex, gl_FragCoord.xy * u_texel) * u_value;\n}"},splatColor:function(t,e,n){var r=null!=t.dyeAmount?t.dyeAmount:.6;if(!t.rainbow){var o=y(t.tint||"#7FD4FF");return[o[0]*r,o[1]*r,o[2]*r]}var i=Math.atan2(n,e);return[(.5+.5*Math.cos(i))*r,(.5+.5*Math.cos(i+2.0944))*r,(.5+.5*Math.cos(i+4.1888))*r]},step:function(t,e,n){var r=Math.min(n.dt,1/30),o=1/t.res.sim,i=1/t.res.dye,a=function(t,e){return Math.pow(t,60*e)};if(n.moving){var s=null!=e.force?e.force:1;t.use("splat"),t.f1("u_radius",null!=e.radius?e.radius:.1),t.f1("u_aspect",n.aspect),t.f2("u_point",n.px,n.py),t.f2("u_texel",o,o),t.smp("u_src",t.read("velocity"),0),t.f3("u_amount",n.dx*s,n.dy*s,0),t.blit(t.write("velocity")),t.swap("velocity"),t.f2("u_texel",i,i),t.smp("u_src",t.read("dye"),0),t.f3("u_amount",n.col[0],n.col[1],n.col[2]),t.blit(t.write("dye")),t.swap("dye")}t.use("curl"),t.f2("u_texel",o,o),t.smp("u_vel",t.read("velocity"),0),t.blit(t.single("vorticity")),t.use("confine"),t.f2("u_texel",o,o),t.f1("u_eps",null!=e.curl?e.curl:2.2),t.f1("u_dt",r),t.smp("u_vel",t.read("velocity"),0),t.smp("u_curl",t.single("vorticity"),1),t.blit(t.write("velocity")),t.swap("velocity"),t.use("divergence"),t.f2("u_texel",o,o),t.smp("u_vel",t.read("velocity"),0),t.blit(t.single("divergence")),t.use("decay"),t.f2("u_texel",o,o),t.f1("u_value",a(null!=e.pressure?e.pressure:.8,r)),t.smp("u_tex",t.read("pressure"),0),t.blit(t.write("pressure")),t.swap("pressure"),t.use("jacobi"),t.f2("u_texel",o,o),t.smp("u_div",t.single("divergence"),1);for(var l=Math.max(1,Math.min(e.pressureIterations||6,40)),c=0;c<l;c++)t.smp("u_p",t.read("pressure"),0),t.blit(t.write("pressure")),t.swap("pressure");t.use("subtract"),t.f2("u_texel",o,o),t.smp("u_p",t.read("pressure"),0),t.smp("u_vel",t.read("velocity"),1),t.blit(t.write("velocity")),t.swap("velocity"),t.use("advect"),t.f1("u_dt",r),t.f2("u_texel",o,o),t.smp("u_vel",t.read("velocity"),0),t.smp("u_src",t.read("velocity"),0),t.f1("u_diss",a(null!=e.decay?e.decay:.985,r)),t.blit(t.write("velocity")),t.swap("velocity"),t.f2("u_texel",i,i),t.smp("u_vel",t.read("velocity"),0),t.smp("u_src",t.read("dye"),1),t.f1("u_diss",a(null!=e.dyeFade?e.dyeFade:.97,r)),t.blit(t.write("dye")),t.swap("dye")}}},blobs:{doc:{summary:"Liquid-glass blobs that follow the pointer: a chain of metaballs refracting the content behind them, stretching apart on a fast flick and relaxing back to a single circle at rest.",params:{count:{default:1,unit:"count",structural:!0,summary:"independent drifting blobs, on top of the trail chain"},trail:{default:7,unit:"count",structural:!0,summary:"blobs in the follow-the-leader chain. Unrolled at compile time, so it rebuilds."},radius:{default:46,unit:"px",summary:"blob radius at rest"},color:{default:"#EAF4EE",unit:"color",summary:"glass tint"},refract:{default:70,unit:"px",summary:"how far the glass bends what is behind it"},rim:{default:.6,unit:"ratio",summary:"brightness of the rim light"},alpha:{default:1,unit:"ratio",summary:"overall opacity"},iridescence:{default:.8,unit:"ratio",summary:"colour shift across the rim"},dispersion:{default:1,unit:"ratio",summary:"per-channel refraction spread"},frost:{default:.25,unit:"ratio",summary:"blur of what shows through"}}},structural:["count","trail"],stage:"color",overlay:!0,mips:!0,decl:function(t){return"\n uniform vec3 ".concat(t,"blobs[").concat(12,"];\n uniform int ").concat(t,"count;\n uniform vec3 ").concat(t,"tint;\n uniform float ").concat(t,"refract;\n uniform float ").concat(t,"rim;\n uniform float ").concat(t,"alpha;\n uniform float ").concat(t,"irid;\n uniform float ").concat(t,"disp;\n uniform float ").concat(t,"frost;\n float ").concat(t,"hash(vec3 v) {\n return fract(sin(dot(v, vec3(21.9898, 63.233, 41.719))) * 41739.317);\n }\n float ").concat(t,"noise(vec3 v) {\n vec3 f = floor(v);\n vec3 r = v - f;\n r = r * r * (3.0 - 2.0 * r);\n float c000 = ").concat(t,"hash(f);\n float c100 = ").concat(t,"hash(f + vec3(1.0, 0.0, 0.0));\n float c010 = ").concat(t,"hash(f + vec3(0.0, 1.0, 0.0));\n float c110 = ").concat(t,"hash(f + vec3(1.0, 1.0, 0.0));\n float c001 = ").concat(t,"hash(f + vec3(0.0, 0.0, 1.0));\n float c101 = ").concat(t,"hash(f + vec3(1.0, 0.0, 1.0));\n float c011 = ").concat(t,"hash(f + vec3(0.0, 1.0, 1.0));\n float c111 = ").concat(t,"hash(f + vec3(1.0, 1.0, 1.0));\n return mix(\n mix(mix(c000, c100, r.x), mix(c010, c110, r.x), r.y),\n mix(mix(c001, c101, r.x), mix(c011, c111, r.x), r.y), r.z);\n }")},code:function(t){return"\n {\n float field = 0.0;\n vec2 grad = vec2(0.0);\n for (int bi = 0; bi < ".concat(12,"; bi++) {\n if (bi >= ").concat(t,"count) break;\n vec2 bd = frag - ").concat(t,"blobs[bi].xy;\n float br = ").concat(t,"blobs[bi].z;\n float dd = max(dot(bd, bd), 1.0);\n field += (br * br) / dd;\n grad += (-2.0 * (br * br) / (dd * dd)) * bd;\n }\n float bmask = smoothstep(0.6, 1.0, field);\n if (bmask > 0.003) {\n float gmag = length(grad);\n vec2 g2 = gmag > 1e-6 ? -grad / gmag : vec2(0.0);\n // Pseudo-3D surface normal from the 2D field. For a\n // metaball field (sum of r^2/d^2), 1/sqrt(field) IS the\n // normalized radial position: 0 at the centre, 1 at the\n // surface. That yields a true hemisphere profile — the\n // curvature (and therefore refraction) varies smoothly\n // across the WHOLE disc, not just an edge annulus.\n float s = clamp(inversesqrt(max(field, 1e-4)), 0.0, 1.0);\n vec3 n = normalize(vec3(g2 * s, sqrt(max(1.0 - s * s, 0.004))));\n vec3 rd = vec3(0.0, 0.0, -1.0);\n\n // Dispersion: refract each channel with a slightly\n // different index (water-glass ~1.33). Near the rim the\n // exit direction flattens (|z| -> 0), so the sampling\n // offsets stretch — producing the smooth concentric\n // colour-fringed bands of a thick lens.\n float ca = 0.03 * ").concat(t,"disp;\n vec3 tR = refract(rd, n, 1.0 / (1.33 - ca));\n vec3 tG = refract(rd, n, 1.0 / 1.33);\n vec3 tB = refract(rd, n, 1.0 / (1.33 + ca));\n vec2 oR = tR.xy * (").concat(t,"refract / max(abs(tR.z), 0.3));\n vec2 oG = tG.xy * (").concat(t,"refract / max(abs(tG.z), 0.3));\n vec2 oB = tB.xy * (").concat(t,"refract / max(abs(tB.z), 0.3));\n\n // Blur grows with how far the ray was bent (mip bias), so\n // strongly-refracted regions smear smoothly instead of\n // showing sharp displaced copies. frost adds a base blur.\n float lod = ").concat(t,"frost * 5.0 + log2(1.0 + length(oG) * 0.035);\n vec2 px = 1.0 / u_res;\n vec4 sG = texture2D(u_tex, clamp(uv + oG * px, 0.002, 0.998), lod);\n vec3 refr;\n refr.r = texture2D(u_tex, clamp(uv + oR * px, 0.002, 0.998), lod).r;\n refr.g = sG.g;\n refr.b = texture2D(u_tex, clamp(uv + oB * px, 0.002, 0.998), lod).b;\n // Blend in (approximately) linear light for clean fringes.\n refr = pow(max(refr, 0.0), vec3(2.2));\n\n vec3 tintLin = pow(").concat(t,"tint, vec3(2.2));\n vec3 bodyLin = mix(tintLin * 0.35, refr, sG.a);\n\n // Glass darkens toward the silhouette (absorption), the\n // opposite of an additive glow ring.\n float edge = pow(1.0 - clamp(n.z, 0.0, 1.0), 1.5);\n bodyLin *= 1.0 - 0.35 * ").concat(t,"rim * edge;\n vec3 body = pow(max(bodyLin, 0.0), vec3(1.0 / 2.2));\n\n // Sparse iridescent glints: two drifting value-noise\n // fields sampled on the reflection direction, one warm\n // one cool, sharpened hard so only sparkles survive.\n vec3 rf = reflect(rd, n);\n float nA = ").concat(t,"noise(rf * 2.3 + u_time * 0.5);\n float nB = ").concat(t,"noise(rf * 2.3 - u_time * 0.5);\n vec3 glint = pow(max(vec3(0.30, 0.52, 0.86) * nA +\n vec3(0.80, 0.56, 0.34) * nB, 0.0), vec3(6.0));\n body += glint * ").concat(t,"irid;\n\n // Small hard specular from a fixed key light.\n vec3 L = normalize(vec3(-0.5, 0.7, 0.6));\n float spec = pow(max(dot(reflect(-L, n), vec3(0.0, 0.0, 1.0)), 0.0), 60.0);\n body += spec * 0.35;\n\n ovCol = body;\n ovA = max(ovA, bmask * ").concat(t,"alpha);\n }\n }")},uniforms:function(t,e){return{tint:["3fv",y(t.color||"#EAF4EE")],refract:["1f",(null!=t.refract?t.refract:70)*e],rim:["1f",null!=t.rim?t.rim:.6],alpha:["1f",null!=t.alpha?t.alpha:1],irid:["1f",null!=t.iridescence?t.iridescence:.8],disp:["1f",null!=t.dispersion?t.dispersion:1],frost:["1f",null!=t.frost?t.frost:.25]}},init:function(t,e,n,r){for(var o=(t.radius||46)*e,i=Math.max(1,Math.min(null!=t.trail?t.trail:7,12)),a=[],s=0,l=0;l<i;l++){var c=Math.pow(.86,l);a.push(c),s+=c*c}for(var u=Math.sqrt(s),f=a.map(function(t){return o*t/u}),d=a.map(function(t,e){return.85*o*Math.pow(.955,e)}),h=function(t,e){return t+Math.random()*(e-t)},p=Math.max(0,Math.min((t.count||1)-1,12-i)),y=[],m=0;m<p;m++){var v=h(0,2*Math.PI),b=h(30,80)*e;y.push({x:h(o,n-o),y:h(o,r-o),r:o*h(.45,.8),vx:Math.cos(v)*b,vy:Math.sin(v)*b,phase:h(0,2*Math.PI)})}for(var g={x:.5*n,y:.55*r},w=[],x=0;x<i;x++)w.push({x:g.x,y:g.y});return{head:g,chain:w,nTrail:i,drifters:y,trailIdleR:f,trailMoveR:d,stretch:0,seg:.9*o}},tick:function(t,e){var n=Math.min(e.dt,.05),r=e.w,o=e.h,i=1-Math.exp(9*-n);t.head.x+=(e.mouseX-t.head.x)*i,t.head.y+=(e.mouseY-t.head.y)*i;var a=t.chain;a[0].x=t.head.x,a[0].y=t.head.y;for(var s=1-Math.exp(16*-n),c=1;c<a.length;c++){var u=a[c-1],f=a[c],d=u.x-f.x,h=u.y-f.y,p=Math.hypot(d,h)||1e-4,y=t.seg;p>y&&(f.x+=d*(1-y/p),f.y+=h*(1-y/p)),f.x+=(u.x-f.x)*s,f.y+=(u.y-f.y)*s}var m=a[a.length-1],v=Math.hypot(m.x-t.head.x,m.y-t.head.y),b=Math.max(1,t.seg*(t.nTrail-1)),g=Math.min(1,v/b);t.stretch+=(g-t.stretch)*(1-Math.exp(8*-n));var w,x=l(t.drifters);try{for(x.s();!(w=x.n()).done;){var k=w.value;k.x+=k.vx*n,k.y+=k.vy*n,k.x<k.r?(k.x=k.r,k.vx=Math.abs(k.vx)):k.x>r-k.r&&(k.x=r-k.r,k.vx=-Math.abs(k.vx)),k.y<k.r?(k.y=k.r,k.vy=Math.abs(k.vy)):k.y>o-k.r&&(k.y=o-k.r,k.vy=-Math.abs(k.vy)),k.phase+=1.6*n}}catch(t){x.e(t)}finally{x.f()}for(var O=new Float32Array(36),S=t.stretch,E=0;E<t.nTrail;E++){var j=a[E];O[3*E]=j.x,O[3*E+1]=j.y,O[3*E+2]=t.trailIdleR[E]+(t.trailMoveR[E]-t.trailIdleR[E])*S}return t.drifters.forEach(function(e,n){var r=t.nTrail+n;O[3*r]=e.x,O[3*r+1]=e.y,O[3*r+2]=e.r*(1+.12*Math.sin(e.phase))}),[{name:"blobs",kind:"3fv",value:O},{name:"count",kind:"1i",value:t.nTrail+t.drifters.length}]}}};function y(t){return[1,3,5].map(function(e){return parseInt(t.slice(e,e+2),16)/255})}var m=Object.keys(p).concat("switch"),v=["px","ratio","deg","count","seconds"];function b(t,e,n){if(!Array.isArray(n)||n.length<2)return!1;var r,o=l(n);try{for(o.s();!(r=o.n()).done;){var i=r.value;if("number"!=typeof i||!Number.isFinite(i))return!1}}catch(t){o.e(t)}finally{o.f()}var a=p[t],s=a&&a.doc&&a.doc.params&&a.doc.params[e];return!!s&&v.includes(s.unit)}function g(t,e){var n=t.length-1,r=Math.min(1,Math.max(0,e))*n,o=Math.min(n-1,Math.floor(r));return t[o]+(t[o+1]-t[o])*(r-o)}var w={linear:function(t){return t},in:function(t){return t*t*t},out:function(t){return 1-Math.pow(1-t,3)},"in-out":function(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2},back:function(t){return 1+2.70158*Math.pow(t-1,3)+1.70158*Math.pow(t-1,2)}},x=Object.keys(w);var k="attribute vec2 a; void main(){ gl_Position = vec4(a, 0.0, 1.0); }",O={warp:["warped"],cell:["center","edge"],displace:["sampleP","chroma"],color:["col","edgeCol","edgeCov","ovCol","ovA"]},S=(["field"].concat(a(Object.keys(O))),"what steers the effect: ".concat(h.join(", "),". "),"easing for this node's local progress: ".concat(x.join(", ")),function(t){return"fld_".concat(String(t).replace(/[^A-Za-z0-9_]/g,""))}),E=function(t){return!0===t.masked?"mask":"string"==typeof t.masked?t.masked:null},j=function(t){return"edge"===t||"edgeCov"===t||"ovA"===t?"float":"col"===t||"edgeCol"===t||"ovCol"===t?"vec3":"vec2"},T={over:function(t,e){return e},add:function(t,e){return"min(".concat(t," + ").concat(e,", vec3(1.0))")},screen:function(t,e){return"1.0 - (1.0 - ".concat(t,") * (1.0 - ").concat(e,")")},multiply:function(t,e){return"".concat(t," * ").concat(e)},difference:function(t,e){return"abs(".concat(t," - ").concat(e,")")},lighten:function(t,e){return"max(".concat(t,", ").concat(e,")")},darken:function(t,e){return"min(".concat(t,", ").concat(e,")")}};function _(t,e){var n,r=[],o=l(t||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&i.op){var a={node:i,i:e.length};e.push(i),"merge"===i.op&&(a.a=_(i.a,e),a.b=_(i.b,e)),r.push(a)}}}catch(t){o.e(t)}finally{o.f()}return r}function C(t,e){var n,r=l(t);try{var o=function(){var t=n.value,r=t.node;if("merge"===r.op)return function(t,e){var n="u".concat(t.i,"_"),r=T[t.node.mode]||T.over,o={field:"",warp:"",cell:"",displace:"",color:""},i={field:"",warp:"",cell:"",displace:"",color:""};C(t.a||[],o),C(t.b||[],i),e.field+=o.field+i.field;for(var a=function(){var t=l[s];if(!o[t]&&!i[t])return 1;var a=O[t],c=" {\n";a.forEach(function(t,e){c+=" ".concat(j(t)," pre").concat(e," = ").concat(t,";\n")}),c+=o[t],a.forEach(function(t,e){c+=" ".concat(j(t)," bra").concat(e," = ").concat(t,";\n")}),a.forEach(function(t,e){c+=" ".concat(t," = pre").concat(e,";\n")}),c+=i[t],a.forEach(function(t,e){var o="vec3"===j(t)?r("bra".concat(e),t):t;c+=" ".concat(t," = mix(bra").concat(e,", ").concat(o,", ").concat(n,"mix);\n")}),c+=" }\n",e[t]+=c},s=0,l=["warp","cell","displace","color"];s<l.length;s++)a()}(t,e),0;var o=p[r.op];if(!o)return 0;var i="u".concat(t.i,"_"),a=Array.isArray(o.stage)?o.stage:[o.stage],s=E(r);a.forEach(function(t){var n=o.code(i,r,t)+"\n";if(s&&O[t]){var a=O[t],l=a.map(function(t,e){return" ".concat(j(t)," msv").concat(e," = ").concat(t,";")}).join("\n"),c=a.map(function(t,e){return" ".concat(t," = mix(msv").concat(e,", ").concat(t,", ").concat(S(s),");")}).join("\n");n=" {\n".concat(l,"\n").concat(n,"\n").concat(c,"\n }\n")}e["field"===t||"warp"===t||"cell"===t||"displace"===t?t:"color"]+=n})};for(r.s();!(n=r.n()).done;)o()}catch(t){r.e(t)}finally{r.f()}}function P(t,e,n,r){var o=r&&r.fade||"opaque",i="",s=new Set;e.forEach(function(t){var e=p[t.op];e&&e.producesField&&s.add(t.as||"mask");var n=E(t);n&&s.add(n)});var l=a(s).map(function(t){return" float ".concat(S(t)," = 1.0;")}).join("\n");e.forEach(function(t,e){var n=p[t.op];n&&(i+=n.decl("u".concat(e,"_"),t)+"\n")});var c=function(t){var e=t&&t.node&&t.node.side;if("old"!==e&&"new"!==e)return null;var n=p[t.node.op],o=n?Array.isArray(n.stage)?n.stage:[n.stage]:[];return o.every(function(t){return"color"===t})?r?e:(console.warn('[nodality] side:"'.concat(e,'" has no meaning without a ')+"transition — there is only one image. Ignoring it."),null):(console.warn('[nodality] "'.concat(t.node.op,'" is a ').concat(o.join("+")," op, ")+'so side:"'.concat(e,'" cannot apply to it — a sided op must be colour-only, ')+"because both sides share one sampling coordinate. Running it on the blended result instead."),null)},u=t.filter(function(t){return!c(t)}),f=t.filter(function(t){return"old"===c(t)}),d=t.filter(function(t){return"new"===c(t)}),h={field:"",warp:"",cell:"",displace:"",color:""};C(u,h);var y=function(t,e){if(!t.length)return"";var n={field:"",warp:"",cell:"",displace:"",color:""};if(C(t,n),!n.color)return"";var r=O.color.filter(function(t){return"col"!==t}).map(function(t){return" ".concat(j(t)," ").concat(t," = ").concat("vec3"===j(t)?"vec3(0.0)":"0.0",";")}).join("\n");return" {\n vec2 frag = p;\n vec3 col = ".concat(e,".rgb;\n").concat(r,"\n").concat(n.color,"\n ").concat(e,".rgb = col;\n }\n")},m=y(f,"o"),v=y(d,"n"),b=h.field,g=h.warp,w=h.cell,x=h.displace,k=h.color,T=e,_=T.some(function(t){return"edges"===t.op})?"":" col *= 1.0 - edge * 0.55;",P=T.some(function(t){return(p[t.op]||{}).chroma})?r?"\n vec2 cdev = vec2(chroma.x, chroma.y);\n col.r = nodSampleAt(sampleP + cdev).r;\n col.b = nodSampleAt(sampleP - cdev).b;":"\n vec2 cpx = vec2(chroma.x, -chroma.y) / u_res;\n col.r = texture2D(u_tex, clamp(uv + cpx, 0.001, 0.999)).r;\n col.b = texture2D(u_tex, clamp(uv - cpx, 0.001, 0.999)).b;":"",A=n?"u_probe + vec2(0.5)":"gl_FragCoord.xy";return"\nprecision highp float;\nuniform sampler2D u_tex;\nuniform vec2 u_res;\nuniform vec2 u_mouse;\nuniform float u_time;\nuniform float u_t; // phase T1: transition progress, 0..1\n\n// Op uniforms are declared HERE, above the transition helpers, because a\n// per-side op's code is emitted inside nodSampleAt. GLSL requires\n// declaration before use, and with the declarations further down every\n// sided op failed to compile with \"'u0_amount' : undeclared identifier\".\n".concat(n?"uniform vec2 u_probe;\n":"").concat(i,"\n").concat(r?"\n// ── phase T2: transition mode ──────────────────────────────────────\n// Two captures instead of one. u_tex is the NEW element, u_old the\n// frozen OLD one, and u_box is the content box they are both drawn\n// into — lerped from the old rect to the new rect by u_t. So geometry\n// (the box) and pixels (the effect chain) stay separate problems, which\n// is the split View Transitions also makes and the one that keeps this\n// maintainable.\nuniform sampler2D u_old;\n".concat(r&&r.newImage?"uniform sampler2D u_newimg;":"",'\n// Phase T2, gap 2. TWO boxes, not one. With a single shared box the\n// only expressible motion is "both sides march together", so the classic\n// "old slides out while new slides in" was impossible. Each capture now\n// interpolates in its own rect, which keeps per-side motion in the\n// GEOMETRY tier (P-3) instead of needing per-side op scoping.\nuniform vec4 u_boxOld; // x, y, w, h — device px, top-down\nuniform vec4 u_boxNew;\n\n// sRGB <-> linear. A naive crossfade in gamma space dips visibly in\n// brightness at mid-fade on photographic content; this is the classic\n// artifact and it is why the mix below is not just mix().\nvec3 nodToLinear(vec3 c) { return pow(c, vec3(2.2)); }\nvec3 nodToSRGB(vec3 c) { return pow(c, vec3(1.0 / 2.2)); }\n\n// Premultiplied, so anti-aliased edges over transparency do not pick up\n// a dark halo as the two sides cross.\nvec4 nodBlend(vec4 a, vec4 b, float t, float d) {\n vec3 pa = nodToLinear(a.rgb) * a.a;\n vec3 pb = nodToLinear(b.rgb) * b.a;\n').concat("morph"===o?"\n // MORPH — a per-pixel CHOICE, not a mix. d is a stable hash of the\n // output pixel, so each pixel flips from old to new at its own point\n // in t. At any instant almost every pixel is showing exactly ONE\n // side, and the two contents are never both legible at once.\n //\n // A uniform crossfade cannot do this: at t=0.5 it is by definition\n // 50% of each, which reads as a double exposure the moment the two\n // states differ much — a wide nav bar and a small card, say.\n float k = smoothstep(d - 0.12, d + 0.12, t);\n vec3 pm = pa * (1.0 - k) + pb * k;\n float al = a.a * (1.0 - k) + b.a * k;":"dissolve"===o?'\n // DISSOLVE — a true cross-dissolve: alpha lerps between the two.\n // Correct, and the right choice when one side really should fade to\n // nothing. Wrong for a shape morph, because any region covered by\n // only ONE side is translucent for the whole transition and the\n // morph reads as "everything is disappearing".\n vec3 pm = mix(pa, pb, t);\n float al = mix(a.a, b.a, t);':"\n // OPAQUE (default) — the colour crosses over without the shape\n // thinning out. The coverage-weighted lerp already gives that for\n // free, and it is worth seeing why:\n //\n // both sides cover a.a = b.a = 1 -> w = 1 at every t. Solid\n // throughout. No mid-fade.\n // only the old b.a = 0 -> w = 1-t. Releases.\n // only the new a.a = 0 -> w = t. Arrives.\n //\n // So one expression covers the union case AND each side's release,\n // linearly, with no curve to pop against.\n vec3 pm = pa * (1.0 - t) + pb * t;\n float al = a.a * (1.0 - t) + b.a * t;","\n return vec4(nodToSRGB(pm / max(al, 1e-4)), al);\n}\n\n// EVERY fetch in transition mode goes through here. A displace-stage op\n// that sampled u_tex directly — aberration does exactly that for its\n// per-channel taps — would show fringes from the new capture only, with\n// the old one silently absent from those channels.\n// Takes a position in DEVICE PX (sampleP space), not uv, because the two\n// captures no longer share a uv. Each is mapped through its own box and\n// masked to it, then blended.\nvec2 nodBoxUV(vec4 box, vec2 p) {\n return vec2((p.x - box.x) / max(box.z, 1.0),\n 1.0 - (p.y - box.y) / max(box.w, 1.0));\n}\nfloat nodInBox(vec2 uv) {\n return step(0.0, uv.x) * step(uv.x, 1.0) * step(0.0, uv.y) * step(uv.y, 1.0);\n}\nvec4 nodSampleAt(vec2 p) {\n vec2 uo = nodBoxUV(u_boxOld, p);\n vec2 un = nodBoxUV(u_boxNew, p);\n vec4 o = texture2D(u_old, clamp(uo, 0.001, 0.999));\n // With newImage the new side is a capture of the ELEMENT, so both\n // sides can travel between their own rects and converge into one\n // shape. Without it the new side is the HOST capture, which can only\n // be mapped 1:1 — the destination then sits at its final place from\n // t=0 while the old shrinks toward it, and the result reads as two\n // things on screen at once rather than one thing morphing.\n vec4 n = texture2D(").concat(r&&r.newImage?"u_newimg":"u_tex",",\n clamp(un, 0.001, 0.999));\n o.a *= nodInBox(uo);\n n.a *= nodInBox(un);\n").concat(m).concat(v,"\n // The threshold each pixel flips at. Mostly a COHERENT ramp down the\n // box with a little grain on top — pure white noise chooses correctly\n // (never two legible images at once) but reads as television static\n // rather than as one thing becoming another. The ramp makes it a\n // wipe; the grain keeps the edge from looking like a ruler.\n float grain = fract(sin(dot(floor(p / 3.0), vec2(12.9898, 78.233))) * 43758.5453);\n float ramp = clamp(un.y, 0.0, 1.0);\n float d = ramp * 0.82 + grain * 0.18;\n return nodBlend(o, n, u_t, d);\n}"):"","\nvoid main() {\n vec2 fc = ").concat(A,";\n vec2 frag = vec2(fc.x, u_res.y - fc.y);\n").concat(l,"\n").concat(b,"\n vec2 warped = frag;\n").concat(g,"\n vec2 center = warped;\n float edge = 0.0;\n").concat(w,"\n vec2 sampleP = warped;\n vec2 chroma = vec2(0.0);\n").concat(x).concat(n?"\n vec2 q = clamp(sampleP / u_res, 0.0, 1.0) * 255.0;\n vec2 hi = floor(q);\n vec2 lo = floor(fract(q) * 255.0);\n gl_FragColor = vec4(hi.x, lo.x, hi.y, lo.y) / 255.0;\n}":"\n".concat(r?"\n // uv stays defined, as the NEW box's, for ops that reference it.\n vec2 uv = nodBoxUV(u_boxNew, sampleP);\n vec4 tex = nodSampleAt(sampleP);":"\n vec2 uv = vec2(sampleP.x / u_res.x, 1.0 - sampleP.y / u_res.y);\n vec4 tex = texture2D(u_tex, clamp(uv, 0.001, 0.999));","\n vec3 col = tex.rgb;").concat(P,"\n vec3 edgeCol = vec3(1.0);\n float edgeCov = 0.0;\n vec3 ovCol = vec3(0.0);\n float ovA = 0.0;\n").concat(k,"\n").concat(_,"\n // content OVER border\n float baseA = tex.a + edgeCov * (1.0 - tex.a);\n vec3 baseRGB = (col * tex.a + edgeCol * edgeCov * (1.0 - tex.a)) / max(baseA, 1e-4);\n // overlay OVER (content+border)\n float outA = ovA + baseA * (1.0 - ovA);\n vec3 outRGB = (ovCol * ovA + baseRGB * baseA * (1.0 - ovA)) / max(outA, 1e-4);\n gl_FragColor = vec4(outRGB, outA);\n}"))}var A=/\d(?:vw|vh|vmin|vmax|dvw|dvh|svw|svh|lvw|lvh)\b/i,R=["color","font-family","font-size","font-weight","font-style","line-height","letter-spacing","text-align","text-transform","text-decoration-color","white-space","word-break"],M=["background-color","background-image","background-size","background-position","background-repeat","background-clip","border-radius","box-shadow","opacity","outline-color"],F=new Set(["none","rgba(0, 0, 0, 0)","transparent","0px","auto","1","repeat","0% 0%","border-box","0% 0% / auto repeat scroll padding-box border-box"]);var I={coarse:"(pointer: coarse)",fine:"(pointer: fine)",hover:"(hover: hover)","no-hover":"(hover: none)","reduced-motion":"(prefers-reduced-motion: reduce)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)"};function D(t){if("function"==typeof t)try{return!!t()}catch(t){return!1}if("boolean"==typeof t)return t;if("string"!=typeof t||""===t)return!1;var e=I[t]||t;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return!1;try{return window.matchMedia(e).matches}catch(t){return!1}}function L(t,e){if(!Array.isArray(t))return[];if((e||0)>8)return[];var n,r=[],o=l(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&"switch"===i.op){var a,s=l(L((D(i.when)?i.use:i.else)||[],(e||0)+1));try{for(s.s();!(a=s.n()).done;){var c=a.value;r.push(c)}}catch(t){s.e(t)}finally{s.f()}}else r.push(i)}}catch(t){o.e(t)}finally{o.f()}return r}var z=new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),W=["objectFit","objectPosition","borderRadius","imageRendering","filter"],B=new Set,N=["op","masked","live"],U=!1;function G(t,e,n){var r=e,o=n&&n.transition||null;if(!t||"undefined"==typeof document||"undefined"==typeof window)return null;if(!(e&&0!==e.length||o))return null;if(e||(e=[]),e.some(function(t){return t&&"switch"===t.op})&&0===(e=L(e,0)).length&&!o)return null;var i=[],u=_(e,i);if(e=i,"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return null;if(z.has(t.tagName)){var f=t.parentElement&&t.parentElement.hasAttribute&&t.parentElement.hasAttribute("data-nodality-raster-host")?t.parentElement:null;if(t=f||function(t){if(!t.parentNode)return null;var e,n={},r=l(W);try{for(r.s();!(e=r.n()).done;){var o=e.value;t.style[o]&&(n[o]=t.style[o])}}catch(t){r.e(t)}finally{r.f()}var i=document.createElement("div");return i.setAttribute("data-nodality-raster-host",t.tagName.toLowerCase()),i.style.cssText=t.style.cssText,t.parentNode.insertBefore(i,t),i.appendChild(t),t.removeAttribute("style"),Object.assign(t.style,n),t.style.display="block",t.style.width="100%",t.style.height="100%","static"===("function"==typeof getComputedStyle?getComputedStyle(i).position:"static")&&(i.style.position="relative"),i.style.width||(i.style.width="100%"),i.style.height||(i.style.height="100%"),i}(t),!t)return null}if(t.querySelector&&t.querySelector(":scope > canvas[data-nodality-raster]"))return null;var y=function(){var e=t.getBoundingClientRect();return{width:e.width>=2?e.width:t.scrollWidth||0,height:e.height>=2?e.height:t.scrollHeight||0}},m=y();if(m.width<2||m.height<2)return null;var v=Math.max(1,Math.min(n&&n.resolution?n.resolution:window.devicePixelRatio||1,3)),x=e.some(function(t){return(p[t.op]||{}).overlay}),O=e.length>0&&!o&&e.every(function(t){return(p[t.op]||{}).overlay}),S=!(!o||!0!==o.live),j=!O&&(!o||S)&&!e.some(function(t){return!1===t.live}),T="undefined"!=typeof WebGL2RenderingContext&&"texElementImage2D"in WebGL2RenderingContext.prototype||"undefined"!=typeof WebGLRenderingContext&&"texElementImage2D"in WebGLRenderingContext.prototype,C=j&&T;j&&!C&&console.info("[nodality] HTML-in-Canvas API not available - raster ops fall back to snapshot capture.");var I=document.createElement("canvas");C&&I.setAttribute("layoutsubtree","");var D={alpha:!0,premultipliedAlpha:!1},H=I.getContext("webgl2",D)||I.getContext("webgl",D);if(!H)return null;var X="undefined"!=typeof WebGL2RenderingContext&&H instanceof WebGL2RenderingContext,q=X&&e.some(function(t){return(p[t.op]||{}).mips});C&&!("texElementImage2D"in H)&&(console.info("[nodality] texElementImage2D missing on the created context - snapshot fallback."),I.removeAttribute("layoutsubtree"),C=!1),"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),I.width=Math.round(m.width*v),I.height=Math.round(m.height*v),I.setAttribute("data-nodality-raster",C?"live":"snapshot"),console.info("[nodality] raster backend:",C?"html-in-canvas (live)":"snapshot");var J={width:m.width,height:m.height},V=t;if(C){var $=document.createElement("div"),Y=getComputedStyle(t),Q="flex"===Y.display||"inline-flex"===Y.display,K="grid"===Y.display||"inline-grid"===Y.display,Z=function(t){return parseFloat(t)||0},tt=Z(Y.paddingLeft)+Z(Y.paddingRight),et=Z(Y.paddingTop)+Z(Y.paddingBottom);for(J.width=Math.max(2,m.width-tt),J.height=Math.max(2,m.height-et),$.style.cssText="display:".concat(Q||K?Y.display:"block",";")+"width:".concat(J.width,"px;height:").concat(J.height,"px;"),K&&($.style.gridTemplateColumns=Y.gridTemplateColumns,$.style.gridTemplateRows=Y.gridTemplateRows,$.style.gridTemplateAreas=Y.gridTemplateAreas,$.style.gap=Y.gap,$.style.alignItems=Y.alignItems,$.style.justifyItems=Y.justifyItems),Q&&($.style.flexDirection=Y.flexDirection,$.style.alignItems=Y.alignItems,$.style.justifyContent=Y.justifyContent,$.style.gap=Y.gap);t.firstChild;)$.appendChild(t.firstChild);I.appendChild($),V=$,I.style.cssText="display:block;width:".concat(J.width,"px;height:").concat(J.height,"px;")}else if(I.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(m.width,"px;height:").concat(m.height,"px;")+"pointer-events:none;z-index:2147483000;",O)I.setAttribute("aria-hidden","true");else{I.setAttribute("role","img");var nt=(t.textContent||"").replace(/\s+/g," ").trim();nt&&I.setAttribute("aria-label",nt.slice(0,300))}t.appendChild(I);var rt=function(t,e){var n=H.createShader(t);if(H.shaderSource(n,e),H.compileShader(n),!H.getShaderParameter(n,H.COMPILE_STATUS))throw new Error("[nodality] raster shader: "+H.getShaderInfoLog(n));return n},ot=H.createProgram();H.attachShader(ot,rt(H.VERTEX_SHADER,k)),H.attachShader(ot,rt(H.FRAGMENT_SHADER,P(u,e,!1,o))),H.bindAttribLocation(ot,0,"a"),H.linkProgram(ot),H.useProgram(ot),H.bindBuffer(H.ARRAY_BUFFER,H.createBuffer()),H.bufferData(H.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),H.STATIC_DRAW),H.enableVertexAttribArray(0),H.vertexAttribPointer(0,2,H.FLOAT,!1,0,0);var it=function(t){return H.getUniformLocation(ot,t)},at=function(t,e,n){"1f"===e?H.uniform1f(t,n):"1i"===e?H.uniform1i(t,n):"2fv"===e?H.uniform2fv(t,n):"3fv"===e&&H.uniform3fv(t,n)},st=0,lt=e.map(function(t,e){return{node:t,i:e}}).filter(function(t){return function(t){for(var e in t)if(b(t.op,e,t[e]))return!0;return!1}(t.node)}),ct=function(t,n){e.forEach(function(e,r){if(!n||n.has(r)){var o=p[e.op];if(o&&o.uniforms){var i=o.uniforms(function(t,e){var n=null,r=t.window||t.ease?function(t,e){var n=Math.min(1,Math.max(0,e)),r=t.window;Array.isArray(r)&&2===r.length&&r[1]!==r[0]&&(n=Math.min(1,Math.max(0,(n-r[0])/(r[1]-r[0]))));var o=t.ease&&w[t.ease];return o?o(n):n}(t,e):e;for(var o in t)b(t.op,o,t[o])&&((n=n||Object.assign({},t))[o]=g(t[o],r));return n||t}(e,st),v);for(var a in i)at(t("u".concat(r,"_").concat(a)),i[a][0],i[a][1])}}})};ct(it);var ut=new Set(lt.map(function(t){return t.i})),ft=[];e.forEach(function(t,e){var n=p[t.op];n&&"function"==typeof n.init&&ft.push({i:e,def:n,state:n.init(t,v,I.width,I.height)})});var dt="undefined"!=typeof performance?performance.now():0,ht=[];e.forEach(function(t,e){var n=p[t.op];if(n&&n.solver){var r=function(t,e){var n=p[t.op];if(!X||!H.getExtension("EXT_color_buffer_float"))return console.info("[nodality] '"+t.op+"' needs WebGL2 float render targets - op skipped."),null;H.getExtension("OES_texture_float_linear");var r=n.solver.resolutions(t,I.width,I.height),o={r:[H.R16F,H.RED],rg:[H.RG16F,H.RG],rgba:[H.RGBA16F,H.RGBA]},i=[],a=function(t,e,n,r){var a=c(o[n],2),s=a[0],l=a[1],u=H.createTexture();H.bindTexture(H.TEXTURE_2D,u);var f=r?H.LINEAR:H.NEAREST;H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,f),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,f),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE),H.texImage2D(H.TEXTURE_2D,0,s,t,e,0,l,H.HALF_FLOAT,null);var d=H.createFramebuffer();H.bindFramebuffer(H.FRAMEBUFFER,d),H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,u,0);var h=H.checkFramebufferStatus(H.FRAMEBUFFER)===H.FRAMEBUFFER_COMPLETE;H.viewport(0,0,t,e),H.clearColor(0,0,0,1),H.clear(H.COLOR_BUFFER_BIT);var p={tex:u,fbo:d,w:t,h:e,ok:h};return i.push(p),p},s={},l=!0;for(var u in n.solver.targets){var f=n.solver.targets[u],d=r[f.res],h=c(Array.isArray(d)?d:[d,d],2),y=h[0],m=h[1];f.double?(s[u]={a:a(y,m,f.fmt,f.smooth),b:a(y,m,f.fmt,f.smooth)},l=l&&s[u].a.ok&&s[u].b.ok):(s[u]={a:a(y,m,f.fmt,f.smooth)},l=l&&s[u].a.ok)}H.bindFramebuffer(H.FRAMEBUFFER,null);var v=function(){return i.forEach(function(t){H.deleteFramebuffer(t.fbo),H.deleteTexture(t.tex)})};if(!l)return console.info("[nodality] '"+t.op+"' float targets incomplete - op skipped."),v(),null;var b={};try{for(var g in n.solver.programs){var w=H.createProgram();if(H.attachShader(w,rt(H.VERTEX_SHADER,k)),H.attachShader(w,rt(H.FRAGMENT_SHADER,n.solver.programs[g])),H.bindAttribLocation(w,0,"a"),H.linkProgram(w),!H.getProgramParameter(w,H.LINK_STATUS))throw new Error(g+": "+H.getProgramInfoLog(w));b[g]={prog:w,loc:{}}}}catch(e){for(var x in console.warn("[nodality] '"+t.op+"' solver programs failed:",e),v(),b)H.deleteProgram(b[x].prog);return null}return H.useProgram(ot),{i:e,node:t,def:n,res:r,targets:s,progs:b,cleanup:v,prevX:.5,prevY:.5,primed:!1}}(t,e);r&&ht.push(r)}});var pt=function(t,e){var n=null,r={res:t.res,use:function(e){n=t.progs[e],H.useProgram(n.prog)},u:function(t){return t in n.loc||(n.loc[t]=H.getUniformLocation(n.prog,t)),n.loc[t]},f1:function(t,e){H.uniform1f(r.u(t),e)},f2:function(t,e,n){H.uniform2f(r.u(t),e,n)},f3:function(t,e,n,o){H.uniform3f(r.u(t),e,n,o)},smp:function(t,e,n){H.activeTexture(H.TEXTURE0+n),H.bindTexture(H.TEXTURE_2D,e.tex),H.uniform1i(r.u(t),n)},read:function(e){return t.targets[e].a},write:function(e){return t.targets[e].b},single:function(e){return t.targets[e].a},content:{tex:yt},canvasW:I.width,canvasH:I.height,swap:function(e){var n=t.targets[e],r=n.a;n.a=n.b,n.b=r},blit:function(t){H.bindFramebuffer(H.FRAMEBUFFER,t.fbo),H.viewport(0,0,t.w,t.h),H.drawArrays(H.TRIANGLES,0,3)}},o=Rt[0]/I.width,i=1-Rt[1]/I.height,a=0,s=0;t.primed&&Mt&&(a=(o-t.prevX)/Math.max(e,.001),s=(i-t.prevY)/Math.max(e,.001)),t.prevX=o,t.prevY=i,t.primed=!0;var l=Mt&&Math.abs(a)+Math.abs(s)>.001;t.def.solver.step(r,t.node,{dt:e,px:o,py:i,dx:a,dy:s,moving:l,aspect:I.width/Math.max(I.height,1),col:t.def.solver.splatColor(t.node,a,s)})},yt=H.createTexture();H.bindTexture(H.TEXTURE_2D,yt),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,q?H.LINEAR_MIPMAP_LINEAR:H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE),H.pixelStorei(H.UNPACK_FLIP_Y_WEBGL,!0);var mt=function(){q&&H.generateMipmap(H.TEXTURE_2D)},vt=!1,bt=null,gt=null;if(o&&o.oldImage){bt=H.createTexture(),H.bindTexture(H.TEXTURE_2D,bt),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE);try{H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,o.oldImage)}catch(t){console.warn("[nodality] transition: old capture upload failed:",t),H.deleteTexture(bt),bt=null}}if(o&&o.newImage){gt=H.createTexture(),H.bindTexture(H.TEXTURE_2D,gt),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,H.LINEAR),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE);try{H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,o.newImage)}catch(t){console.warn("[nodality] transition: new capture upload failed:",t),H.deleteTexture(gt),gt=null}}var wt=!1,xt=C?"live":"snapshot",kt=!1,Ot={color:"transparent","-webkit-text-fill-color":"transparent","-webkit-text-stroke-color":"transparent","background-color":"transparent","background-image":"none","border-color":"transparent","box-shadow":"none","text-shadow":"none"},St=null,Et=function(){if(!St){!function(){if(!U&&"undefined"!=typeof document){U=!0;var t=document.createElement("style");t.setAttribute("data-nodality","selection"),t.textContent="[data-nodality-ink]::selection,[data-nodality-ink] *::selection{color:var(--nod-ink);-webkit-text-fill-color:var(--nod-ink)}[data-nodality-ink]::-moz-selection,[data-nodality-ink] *::-moz-selection{color:var(--nod-ink);-webkit-text-fill-color:var(--nod-ink)}",(document.head||document.documentElement).appendChild(t)}}(),St=[],t.setAttribute("data-nodality-ink","");for(var e=[t].concat(a(t.querySelectorAll("*"))).filter(function(t){return t!==I&&"CANVAS"!==t.tagName}),n=e.map(function(t){return getComputedStyle(t).color}),r=0;r<e.length;r++){var o=e[r],i={op:o.style.getPropertyValue("opacity"),ink:o.style.getPropertyValue("--nod-ink")};for(var s in Ot)i[s]=o.style.getPropertyValue(s);for(var l in St.push([o,i]),o.style.setProperty("--nod-ink",n[r]),Ot)o.style.setProperty(l,Ot[l],"important");o!==t&&o.matches&&o.matches("img,svg,video,picture,iframe")&&o.style.setProperty("opacity","0","important")}t.style.isolation="isolate",I.style.zIndex="-1"}},jt=function(){if(t.style.visibility="",t.removeAttribute("data-nodality-ink"),St){var e,n=l(St);try{for(n.s();!(e=n.n()).done;){var r=c(e.value,2),o=r[0],i=r[1];for(var a in Ot)i[a]?o.style.setProperty(a,i[a]):o.style.removeProperty(a);i.op?o.style.setProperty("opacity",i.op):o.style.removeProperty("opacity"),i.ink?o.style.setProperty("--nod-ink",i.ink):o.style.removeProperty("--nod-ink")}}catch(t){n.e(t)}finally{n.f()}St=null,t.style.isolation="",I.style.zIndex=""}},Tt=function(){if(!o)return!1;var e=st>=1,n=V!==t,r=o.standDownAtStart&&st<=0,i=e&&!n||r?"hidden":"visible";return I.style.visibility!==i&&(I.style.visibility=i),e||r?St&&jt():St||Et(),!0},_t=function(){if(x){var e=function(){var e="IMG"===t.tagName?t:t.querySelector?t.querySelector("img"):null;return e&&e.complete&&e.naturalWidth>0?e:null}();if(e)try{return H.bindTexture(H.TEXTURE_2D,yt),H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,e),mt(),vt=!0,Promise.resolve()}catch(t){}else if(!kt){var n="IMG"===t.tagName?t:t.querySelector&&t.querySelector("img");n&&(kt=!0,n.addEventListener("load",function(){wt||_t()},{once:!0}))}}I.style.display="none",jt();var r=function(t,e,n,r){var o=function(t){if(!t)return null;var e=null;if("IMG"===t.tagName)e=t;else if(t.children){var n=Array.prototype.filter.call(t.children,function(t){return!t.hasAttribute||!t.hasAttribute("data-nodality-raster")});1===n.length&&"IMG"===n[0].tagName&&(e=n[0])}if(!e||!e.complete||!e.naturalWidth)return null;try{if(new URL(e.currentSrc||e.src,location.href).origin!==location.origin)return null}catch(t){return null}return e}(t);return o?Promise.resolve(function(t,e,n,r){var o=Math.max(1,Math.round(e*r)),i=Math.max(1,Math.round(n*r)),a=t.naturalWidth,s=t.naturalHeight;if(!a||!s)return t;var l="fill",c="50% 50%";if("function"==typeof getComputedStyle){var u=getComputedStyle(t);l=u.objectFit||"fill",c=u.objectPosition||"50% 50%"}if("fill"===l)return t;var f=o/a,d=i/s,h="cover"===l?Math.max(f,d):"contain"===l?Math.min(f,d):"none"===l?1:"scale-down"===l?Math.min(1,Math.min(f,d)):Math.max(f,d),p=a*h,y=s*h,m=String(c).trim().split(/\s+/),v=function(t,e){if(null==t)return.5;if(t.endsWith("%"))return parseFloat(t)/100;if("left"===t||"top"===t)return 0;if("right"===t||"bottom"===t)return 1;if("center"===t)return.5;var n=parseFloat(t);return isNaN(n)?.5:n/(0===e?Math.max(o-p,1):Math.max(i-y,1))},b=v(m[0],0),g=v(m.length>1?m[1]:m[0],1),w=document.createElement("canvas");w.width=o,w.height=i;var x=w.getContext("2d");return x?(x.drawImage(t,(o-p)*b,(i-y)*g,p,y),w):t}(o,e,n,r)):new Promise(function(o,i){var s=(new XMLSerializer).serializeToString(function(t,e){for(var n=[t].concat(a(t.querySelectorAll("*"))),r=[e].concat(a(e.querySelectorAll("*"))),o=0;o<n.length&&o<r.length;o++){var i=r[o].style;if(i){if(i.length>0)for(var s=null,c=0,u=Array.from(i);c<u.length;c++){var f=u[c];if(A.test(i.getPropertyValue(f))){var d=(s=s||window.getComputedStyle(n[o])).getPropertyValue(f);d&&i.setProperty(f,d,i.getPropertyPriority(f))}}var h,p=window.getComputedStyle(n[o]),y=n[o].parentElement,m=0!==o&&y?window.getComputedStyle(y):null,v=l(R);try{for(v.s();!(h=v.n()).done;){var b=h.value,g=p.getPropertyValue(b);g&&(m&&m.getPropertyValue(b)===g||i.getPropertyValue(b)||i.setProperty(b,g))}}catch(t){v.e(t)}finally{v.f()}var w,x=l(M);try{for(x.s();!(w=x.n()).done;){var k=w.value;if(!i.getPropertyValue(k)){var O=p.getPropertyValue(k);O&&!F.has(O)&&i.setProperty(k,O)}}}catch(t){x.e(t)}finally{x.f()}}}return e}(t,t.cloneNode(!0))),c='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(e*r,'" height="').concat(n*r,'" viewBox="0 0 ').concat(e," ").concat(n,'">')+'<foreignObject width="100%" height="100%">'+'<div xmlns="http://www.w3.org/1999/xhtml">'.concat(s,"</div>")+"</foreignObject></svg>",u=document.createElement("img");u.onload=function(){return o(u)},u.onerror=i,u.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(c)})}(t,m.width,m.height,v).then(function(t){wt||(H.bindTexture(H.TEXTURE_2D,yt),H.texImage2D(H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,t),mt(),vt=!0,Tt()||(O||Et(),I.style.visibility="visible"))}).catch(function(t){jt(),console.warn("[nodality] raster snapshot failed:",t)});return I.style.display="",r},Ct=-1,Pt=function(){if(!wt&&"live"===xt){H.bindTexture(H.TEXTURE_2D,yt);var t,e=H.RGBA8||32856,n=[[H.TEXTURE_2D,e,V],[H.TEXTURE_2D,0,H.RGBA,H.RGBA,H.UNSIGNED_BYTE,V],[H.TEXTURE_2D,0,e,V],[H.TEXTURE_2D,0,V]];if(Ct>=0)t=[Ct];else{t=[0,1,2,3];var r={3:0,6:1,4:2}[H.texElementImage2D.length];null!=r&&(t.splice(t.indexOf(r),1),t.unshift(r))}var o,i=[],a=l(t);try{for(a.s();!(o=a.n()).done;){var s=o.value;try{return H.texElementImage2D.apply(H,n[s]),mt(),Ct<0&&(Ct=s,console.info("[nodality] texElementImage2D signature discovered: form",s,"(declared arity "+H.texElementImage2D.length+")")),void(vt=!0)}catch(t){i.push("form"+s+" -> "+(t&&t.name?t.name:"?")+": "+(t&&t.message?t.message:t))}}}catch(t){a.e(t)}finally{a.f()}At("texElementImage2D rejected all known signatures (arity "+H.texElementImage2D.length+"): "+i.join(" | "))}},At=function(e){if(!wt&&"live"===xt){for(xt="snapshot",console.warn("[nodality] live raster backend failed ("+e+") - falling back to snapshot."),I.removeEventListener("paint",Pt);V.firstChild;)t.appendChild(V.firstChild);V.parentNode===I&&I.removeChild(V),I.removeAttribute("layoutsubtree"),I.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(m.width,"px;height:").concat(m.height,"px;")+"pointer-events:none;z-index:2147483000;",I.setAttribute("aria-hidden","true"),I.setAttribute("data-nodality-raster","snapshot-fallback"),_t()}};C&&(I.addEventListener("paint",Pt),setTimeout(function(){wt||"live"!==xt||vt||At("no paint event within 1500ms")},1500));var Rt=[.5*I.width,.5*I.height],Mt=!1,Ft=function(t){var e=I.getBoundingClientRect(),n=t.touches?t.touches[0]:t,r=[(n.clientX-e.left)*v,(n.clientY-e.top)*v];r[0]===Rt[0]&&r[1]===Rt[1]||(Mt=!0),Rt=r};t.addEventListener("mousemove",Ft,{passive:!0}),t.addEventListener("touchmove",Ft,{passive:!0});var It=0,Dt=0,Lt=function(){It=1},zt=function(){It=0};t.addEventListener("mouseenter",Lt,{passive:!0}),t.addEventListener("mouseleave",zt,{passive:!0});var Wt=[];e.forEach(function(t,e){var n=p[t.op]||{},r=t.by||n.defaultDriver;r&&d[r]?Wt.push({i:e,fn:d[r]}):t.by&&console.warn("[nodality] unknown driver '"+t.by+"' on op '"+t.op+"' - known drivers: "+h.join(", "))});var Bt=function(){if("undefined"==typeof window)return.5;var e=t.getBoundingClientRect(),n=window.innerHeight||1;return Math.max(0,Math.min(1,(n-e.top)/(n+e.height)))},Nt=0,Ut=null,Gt=function(t,e){H.uniform2f(t("u_res"),e.res[0],e.res[1]),H.uniform2f(t("u_mouse"),e.mouse[0],e.mouse[1]),H.uniform1f(t("u_time"),e.time),H.uniform1f(t("u_t"),e.t);var n,r=l(e.drivers);try{for(r.s();!(n=r.n()).done;){var i=n.value;H.uniform2f(t("u".concat(i.i,"_dpos")),i.x,i.y),H.uniform1f(t("u".concat(i.i,"_damt")),i.amt)}}catch(t){r.e(t)}finally{r.f()}var a,s=l(e.dyn);try{for(s.s();!(a=s.n()).done;){var c,u=a.value,f=l(u.ups);try{for(f.s();!(c=f.n()).done;){var d=c.value;at(t("u".concat(u.i,"_").concat(d.name)),d.kind,d.value)}}catch(t){f.e(t)}finally{f.f()}}}catch(t){s.e(t)}finally{s.f()}H.activeTexture(H.TEXTURE0),H.bindTexture(H.TEXTURE_2D,yt),H.uniform1i(t("u_tex"),0);var h=1;if(o&&bt){H.activeTexture(H.TEXTURE0+h),H.bindTexture(H.TEXTURE_2D,bt),H.uniform1i(t("u_old"),h),h++;var p=e.t,y=function(t,e){return[(t.x+(e.x-t.x)*p)*v,(t.y+(e.y-t.y)*p)*v,(t.w+(e.w-t.w)*p)*v,(t.h+(e.h-t.h)*p)*v]},m=y(o.oldRect,o.oldTo||o.newRect),b=y(o.newFrom||o.oldRect,o.newRect);H.uniform4f(t("u_boxOld"),m[0],m[1],m[2],m[3]),H.uniform4f(t("u_boxNew"),b[0],b[1],b[2],b[3]),gt&&(H.activeTexture(H.TEXTURE0+h),H.bindTexture(H.TEXTURE_2D,gt),H.uniform1i(t("u_newimg"),h),h++)}for(var g=0,w=ht;g<w.length;g++){var x=w[g],k=x.def.solver.samplers;for(var O in k)H.activeTexture(H.TEXTURE0+h),H.bindTexture(H.TEXTURE_2D,x.targets[k[O]].a.tex),H.uniform1i(t("u".concat(x.i,"_").concat(O)),h),h++}H.activeTexture(H.TEXTURE0)},Ht=null,Xt=["warp","cell","displace"],qt=function(t,n,r){if(wt||!Ut||!vt)return null;var i=I.getBoundingClientRect();if(i.width&&i.height&&(!r||!r.gpu)){var a=I.width/i.width,s=I.height/i.height,c=(t-i.left)*a,f=(n-i.top)*s;if(c>=0&&f>=0&&c<I.width&&f<I.height){var d=Math.floor(c),h=Math.floor(I.height-f),y=function(t,n){if(!Ut)return null;var r,o={},i=l(Ut.drivers);try{for(i.s();!(r=i.n()).done;){var a=r.value;o[a.i]=a}}catch(t){i.e(t)}finally{i.f()}for(var s=[t,n],c=0,u=Xt;c<u.length;c++)for(var f=u[c],d=0;d<e.length;d++){var h=e[d],y=p[h.op];if(y&&(Array.isArray(y.stage)?y.stage:[y.stage]).includes(f)){if(E(h))return null;if("function"!=typeof y.map){if(!1===y.movesCoords)continue;return null}var m=o[d],b=y.map(s,h,{res:Ut.res,dpr:v,dpos:m?[m.x,m.y]:[Ut.res[0]/2,Ut.res[1]/2],damt:m?m.amt:1,time:Ut.time,mouse:Ut.mouse});if(!b)return null;s=b}}return s}(d+.5,I.height-h-.5);if(y)return{x:i.left+Math.min(Math.max(y[0],0),I.width)/a,y:i.top+Math.min(Math.max(y[1],0),I.height)/s}}}var m=function(){if(Ht)return Ht;var t=H.createProgram();if(H.attachShader(t,rt(H.VERTEX_SHADER,k)),H.attachShader(t,rt(H.FRAGMENT_SHADER,P(u,e,!0,o))),H.bindAttribLocation(t,0,"a"),H.linkProgram(t),!H.getProgramParameter(t,H.LINK_STATUS))return console.warn("[nodality] probe program failed:",H.getProgramInfoLog(t)),H.deleteProgram(t),Ht={broken:!0};var n=H.createTexture();H.bindTexture(H.TEXTURE_2D,n),H.texImage2D(H.TEXTURE_2D,0,H.RGBA,1,1,0,H.RGBA,H.UNSIGNED_BYTE,null),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MIN_FILTER,H.NEAREST),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_MAG_FILTER,H.NEAREST),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_S,H.CLAMP_TO_EDGE),H.texParameteri(H.TEXTURE_2D,H.TEXTURE_WRAP_T,H.CLAMP_TO_EDGE);var r=H.createFramebuffer();H.bindFramebuffer(H.FRAMEBUFFER,r),H.framebufferTexture2D(H.FRAMEBUFFER,H.COLOR_ATTACHMENT0,H.TEXTURE_2D,n,0);var i=H.checkFramebufferStatus(H.FRAMEBUFFER);if(H.bindFramebuffer(H.FRAMEBUFFER,null),i!==H.FRAMEBUFFER_COMPLETE)return console.warn("[nodality] probe framebuffer incomplete:",i),H.deleteProgram(t),H.deleteFramebuffer(r),H.deleteTexture(n),Ht={broken:!0};var a={},s=function(e){return e in a?a[e]:a[e]=H.getUniformLocation(t,e)};return H.useProgram(t),ct(s),H.useProgram(ot),Ht={prog:t,fbo:r,tex:n,px:new Uint8Array(4),U:s}}();if(m.broken)return null;var b=I.getBoundingClientRect();if(!b.width||!b.height)return null;var g=I.width/b.width,w=I.height/b.height,x=(t-b.left)*g,O=(n-b.top)*w;if(x<0||O<0||x>=I.width||O>=I.height)return null;var S=Math.floor(x),j=Math.floor(I.height-O);H.bindFramebuffer(H.FRAMEBUFFER,m.fbo),H.useProgram(m.prog),H.viewport(0,0,1,1),H.uniform2f(m.U("u_probe"),S,j),Gt(m.U,Ut),H.drawArrays(H.TRIANGLES,0,3),H.readPixels(0,0,1,1,H.RGBA,H.UNSIGNED_BYTE,m.px),H.bindFramebuffer(H.FRAMEBUFFER,null),H.useProgram(ot),H.viewport(0,0,I.width,I.height);var T=m.px,_=(T[0]+T[1]/255)/255,C=(T[2]+T[3]/255)/255;return{x:b.left+_*I.width/g,y:b.top+C*I.height/w}},Jt="__nodalityRetargeted",Vt=!e.some(function(t){return!1===t.interactive}),$t="data-nodality-hover",Yt=e.some(function(t){return!0===t.hoverAttr}),Qt=[],Kt=function(e){for(var n=[],r=e;r&&r!==t.parentNode;r=r.parentElement)n.push(r);for(var o=new Set(n),i=0,a=Qt;i<a.length;i++){var s=a[i];o.has(s)||s.removeAttribute($t)}for(var l=0,c=n;l<c.length;l++){var u=c[l];u.hasAttribute($t)||u.setAttribute($t,"")}Qt=n},Zt=0,te=function(e){if(Vt&&!wt&&!e[Jt]){if("pointermove"===e.type||"mousemove"===e.type){var n="undefined"!=typeof performance?performance.now():0;if(n-Zt<12)return;Zt=n}var r=qt(e.clientX,e.clientY);if(r){var o=V!==t;if(!(!o&&Math.abs(r.x-e.clientX)<.5&&Math.abs(r.y-e.clientY)<.5)){var i,a,s,c,u=o?(i=r.x,a=r.y,s=null,(c=function(t){var e,n=l(t.children);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=r.getBoundingClientRect();o.width&&o.height&&(i<o.left||i>o.right||a<o.top||a>o.bottom||(s=r,c(r)))}}catch(t){n.e(t)}finally{n.f()}})(V),s):"function"==typeof document.elementFromPoint?document.elementFromPoint(r.x,r.y):null;if(u&&u!==e.target&&t.contains(u)){if(Yt&&Kt(u),"pointerdown"===e.type||"mousedown"===e.type||"click"===e.type){var f=u.closest&&u.closest("a, button, input, select, textarea, [tabindex]");f&&"function"==typeof f.focus&&f.focus({preventScroll:!0})}e.stopPropagation(),e.cancelable&&e.preventDefault(),u.dispatchEvent(function(t,e,n){var r=new("undefined"!=typeof PointerEvent&&t instanceof PointerEvent?PointerEvent:MouseEvent)(t.type,{bubbles:!0,cancelable:t.cancelable,composed:!0,view:t.view||("undefined"!=typeof window?window:null),detail:t.detail,clientX:e,clientY:n,screenX:t.screenX+(e-t.clientX),screenY:t.screenY+(n-t.clientY),ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey,button:t.button,buttons:t.buttons,relatedTarget:t.relatedTarget,pointerId:t.pointerId,pointerType:t.pointerType,isPrimary:t.isPrimary,pressure:t.pressure});return r[Jt]=!0,r}(e,r.x,r.y))}}}}},ee=["pointerdown","pointerup","pointermove","click","dblclick","contextmenu","mousedown","mouseup"],ne=function(){Yt&&Kt(null)};if(Vt){var re,oe=l(ee);try{for(oe.s();!(re=oe.n()).done;){var ie=re.value;t.addEventListener(ie,te,!0)}}catch(t){oe.e(t)}finally{oe.f()}t.addEventListener("pointerleave",ne,!0)}var ae=!0,se=function(){if(!wt){if(Tt(),ae&&vt){for(var t="undefined"!=typeof performance?performance.now():dt+16,e=Math.max(0,(t-dt)/1e3),n=0,r=ht;n<r.length;n++){var o=r[n];pt(o,e)}Mt=!1,H.bindFramebuffer(H.FRAMEBUFFER,null),H.useProgram(ot),H.viewport(0,0,I.width,I.height),H.clearColor(0,0,0,0),H.clear(H.COLOR_BUFFER_BIT);var i={res:[I.width,I.height],mouse:[Rt[0],Rt[1]],time:t/1e3,t:st,drivers:[],dyn:[]};if(Wt.length>0){Dt+=(It-Dt)*(1-Math.exp(8*-e));for(var a={mouseX:Rt[0],mouseY:Rt[1],w:I.width,h:I.height,t:t/1e3,hover:Dt,scroll:Bt()},s=0,l=Wt;s<l.length;s++){var c=l[s],u=c.fn(a);i.drivers.push({i:c.i,x:u.x,y:u.y,amt:u.amt})}}if(ft.length>0)for(var f={w:I.width,h:I.height,mouseX:Rt[0],mouseY:Rt[1],dt:e,t:t/1e3},d=0,h=ft;d<h.length;d++){var p=h[d];i.dyn.push({i:p.i,ups:p.def.tick(p.state,f)})}Ut=i,Gt(it,i),dt=t,H.drawArrays(H.TRIANGLES,0,3)}Nt=requestAnimationFrame(se)}},le=null;"undefined"!=typeof IntersectionObserver&&(le=new IntersectionObserver(function(t){var e=c(t,1)[0];ae=e.isIntersecting})).observe(t);var ce=null,ue=0,fe=function(){if(!wt){var t=y();if(!(t.width<2||t.height<2)){var e=Math.round(t.width*v),n=Math.round(t.height*v);m.width=t.width,m.height=t.height,I.style.width=t.width+"px",I.style.height=t.height+"px";var r=I.width!==e||I.height!==n;r&&(I.width=e,I.height=n),"snapshot"===xt?_t():r&&Pt()}}};"undefined"!=typeof ResizeObserver&&(ce=new ResizeObserver(function(){"live"!==xt&&(function(){if(!wt){var t=y();t.width<2||t.height<2||Math.round(t.width)===Math.round(m.width)&&Math.round(t.height)===Math.round(m.height)||(m.width=t.width,m.height=t.height,I.style.width=t.width+"px",I.style.height=t.height+"px")}}(),clearTimeout(ue),ue=setTimeout(fe,150))})).observe(t);var de=0,he=function(){clearTimeout(de),de=setTimeout(function(){if(!wt)if("snapshot"!==xt){var e=t.clientWidth||t.parentElement&&t.parentElement.clientWidth||m.width;I.style.width=e+"px",setTimeout(function(){if(!wt&&"live"===xt){var t=Math.max(2,Math.round(V.getBoundingClientRect().height))||m.height;m.width=e,m.height=t,I.style.height=t+"px",I.width=Math.round(e*v),I.height=Math.round(t*v),Pt()}},50)}else fe()},150)};"undefined"!=typeof window&&window.addEventListener("resize",he),"live"===xt?Nt=requestAnimationFrame(se):(_t().then(function(){Nt=requestAnimationFrame(se)}),"undefined"!=typeof document&&document.fonts&&"object"===s(document.fonts.ready)&&Promise.resolve(document.fonts.ready).then(fe).catch(function(){}));var pe=function(e,n,r,o,i){"function"==typeof CustomEvent&&"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("nodality:raster-param",{detail:{pipeline:ye,el:t,index:e,key:n,value:r,prev:o,how:i}}))},ye={canvas:I,nodes:e,get backend(){return xt},sourceAt:function(t,e,n){return qt(t,e,n)},get progress(){return st},setProgress:function(t){var e=Math.min(1,Math.max(0,Number(t)||0));return e===st||(st=e,lt.length&&(H.useProgram(ot),ct(it,ut),Ht&&!Ht.broken&&(H.useProgram(Ht.prog),ct(Ht.U,ut),H.useProgram(ot))),Tt()),st},setParam:function(t,n,r){var o=e[t];if(!o||wt)return!1;var i=o[n];if(o[n]=r,function(t,e,n,r){if(N.includes(e))return!0;var o=p[t];if(!o)return!0;if((o.structural||[]).includes(e))return!0;if((o.structuralOnToggle||[]).includes(e))return!n!=!r;if(o.uniforms)try{if(e in o.uniforms(Object.assign({op:t},function(t,e,n){return(e=function(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,n)),1))return!1}catch(t){}return!0}(o.op,n,r,i))return ye.rebuild(),pe(t,n,r,i,"rebuild"),"rebuild";var a=p[o.op];if(a&&a.uniforms){var l=a.uniforms(o,v);for(var c in H.useProgram(ot),l)at(it("u".concat(t,"_").concat(c)),l[c][0],l[c][1]);if(Ht&&!Ht.broken){for(var u in H.useProgram(Ht.prog),l)at(Ht.U("u".concat(t,"_").concat(u)),l[u][0],l[u][1]);H.useProgram(ot)}}return pe(t,n,r,i,"uniform"),"uniform"},rebuild:function(){if(wt)return null;var e=t;return ye.destroy(),G(e,r)}};return B.add(ye),Object.assign(ye,{refresh:function(){return"live"===xt?Pt():_t()},destroy:function(){B.delete(ye),wt=!0,cancelAnimationFrame(Nt),clearTimeout(ue),clearTimeout(de),le&&le.disconnect(),ce&&ce.disconnect(),"undefined"!=typeof window&&window.removeEventListener("resize",he),t.removeEventListener("mousemove",Ft),t.removeEventListener("touchmove",Ft);for(var e=0,n=ee;e<n.length;e++){var r=n[e];t.removeEventListener(r,te,!0)}t.removeEventListener("pointerleave",ne,!0),Kt(null),t.removeEventListener("mouseenter",Lt),t.removeEventListener("mouseleave",zt),I.removeEventListener("paint",Pt);for(var o=0,i=ht;o<i.length;o++){var a=i[o];for(var s in a.cleanup(),a.progs)H.deleteProgram(a.progs[s].prog)}for(ht.length=0,Ht&&!Ht.broken&&(H.deleteProgram(Ht.prog),H.deleteFramebuffer(Ht.fbo),H.deleteTexture(Ht.tex)),Ht=null,bt&&(H.deleteTexture(bt),bt=null),gt&&(H.deleteTexture(gt),gt=null);V!==t&&V.firstChild;)t.appendChild(V.firstChild);jt(),t.style.visibility="",I.remove()}})}function H(){return new RegExp('"([A-Za-z_$][A-Za-z0-9_$]*)"\\s*:',"g")}function X(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return"string"!=typeof(e=JSON.stringify(t,null,n))?e:e.replace(H(),"$1:")}function q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||V(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 J(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=V(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function V(t,e){if(t){if("string"==typeof t)return $(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$(t,e):void 0}}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Y(t){return Y="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},Y(t)}function Q(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,K(r.key),r)}}function K(t){var e=function(t){if("object"!=Y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Y(e)?e:e+""}var Z=function(){function t(){var e,n,r,o=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,r=function(t){if(t.transform||t.op){var e=t.op;t.transform||(e=t.op),e.duration||(e.duration="3s-ease-in-out"),o.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var n=function(){var n="",r="",i="",a="",s="",l="",c="",u="",f="";if(0!==e.values.length){e.values.forEach(function(t){t.startsWith("tx:")&&(n=t.replace("tx:","")),t.startsWith("ty:")&&(r=t.replace("ty:","")),t.startsWith("tz:")?i=t.replace("tz:",""):t.startsWith("scale(")?a=t:t.startsWith("skew(")?s=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var n=e[1].split(",").map(function(t){return t.trim()});return 1===n.length?"rotate(".concat(n[0],")"):2===n.length?"rotateX(".concat(n[0],") rotateY(").concat(n[1],")"):3===n.length?"rotateX(".concat(n[0],") rotateY(").concat(n[1],") rotate(").concat(n[2],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(f=t.replace("opacity:",""))}),n=o.setDefault(n),r=o.setDefault(r),i=o.setDefault(i);var d="";if("0px"!=r&&"0px"!=n&&"0px"!=i?d+="translate3d(".concat(n,", ").concat(r,", ").concat(i,")"):"0px"==r&&"0px"==n||(d+="translate(".concat(n,", ").concat(r,")")),a&&(d+=" ".concat(a)),l&&(d+=" ".concat(l)),s&&(d+=" ".concat(s)),c&&(d+=" ".concat(c)),u&&(d+=" ".concat(u)),d){if(t.op.duration){var h=t.op.duration.replace(/^(\d+)(s)-/,function(t,e,n){return e/2+n+" "}),p="transform ".concat(h,", opacity ").concat(h);o.res.style.transition=p}else o.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.static&&(o.res.style.transition=""),(o.blastTarget||o.res).style.transform=d,o.res.style.opacity=f}else console.warn("[nodality] transform produced no geometric value - check `values`")}};e.on?o.res.addEventListener(e.on,function(){e.delay?setTimeout(function(){n()},e.delay):n()}):o._on(window,"load",function(){e.delay?setTimeout(function(){n()},e.delay):n()});var r=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) "),o.res.style.opacity="1"}),t&&(o.res.style.transform=t.trim())};if(e.on)o.res.addEventListener("mouseout",function(){e.keep||r()});else{var i=1e3*parseFloat(e.duration),a=e.closeAfter?e.closeAfter:0;setTimeout(function(){e.keep||r()},i/2+a)}e.hardCSS&&(o.res.style.transform=e.hardCSS)}else console.warn("[nodality] reactOnTransform: unrecognised transform descriptor - ignored")},(n=K(n="reactOnTransform"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1},this.openedElements=new WeakMap,"undefined"!=typeof document&&(this._themeUnsub=i.subscribe(function(t){return o._applyTheme(t)}),Promise.resolve().then(function(){return o._applyTheme(i.mode)}))}return e=t,n=[{key:"rasterize",value:function(t){var e=this;if(t&&0!==t.length&&!this._rasterHandle&&!this._rasterCancelled&&"undefined"!=typeof document&&"undefined"!=typeof setTimeout){var n=0,r=function(){if(!e._rasterHandle&&!e._rasterCancelled){if(e.res&&e.res.isConnected){try{e._rasterHandle=G(e.res,t)}catch(t){return void console.warn("[nodality] raster pipeline skipped:",t)}if(e._rasterHandle)return}++n<80&&(e._rasterTimer=setTimeout(r,50))}};this._rasterTimer=setTimeout(r,0),this._track(function(){return clearTimeout(e._rasterTimer)})}}},{key:"isHidden",value:function(t){t&&(this.res.style.display="none")}},{key:"theme",value:function(t){var e=this;return t&&"object"===Y(t)?(this._themeMap=t,this._applyTheme(i.mode),this._themeUnsub||(this._themeUnsub=i.subscribe(function(t){return e._applyTheme(t)})),this):this}},{key:"_track",value:function(t){return"function"!=typeof t||(this._disposables||(this._disposables=[])).push(t),t}},{key:"_on",value:function(t,e,n,r){return t&&"function"==typeof t.addEventListener?(t.addEventListener(e,n,r),this._track(function(){return t.removeEventListener(e,n,r)}),n):n}},{key:"destroy",value:function(){if("function"==typeof this._themeUnsub&&(this._themeUnsub(),this._themeUnsub=null),this._rasterHandle&&"function"==typeof this._rasterHandle.destroy)try{this._rasterHandle.destroy()}catch(t){}if(this._rasterHandle=null,this._rasterCancelled=!0,this._disposables){var t,e=J(this._disposables);try{for(e.s();!(t=e.n()).done;){var n=t.value;try{n()}catch(t){}}}catch(t){e.e(t)}finally{e.f()}this._disposables.length=0}return this._responsiveTasks=null,this._responsiveHandler=null,this.res&&this.res.parentNode&&this.res.parentNode.removeChild(this.res),this}},{key:"_applyTheme",value:function(t){if(!this._noTheme&&this.res)if(this._themeMap){var e=this._themeMap[t];if(!e)return;for(var n in e)this.res.style[n]=e[n]}else{var r=i.defaults&&i.defaults[t];if(r)for(var o in this._themeOriginal||(this._themeOriginal={}),r)o in this._themeOriginal||(this._themeOriginal[o]=this.res.style[o]||""),this._themeOriginal[o]||(this.res.style[o]=r[o])}}},{key:"vars",value:function(t){if(!t||"object"!==Y(t))return this;for(var e in t)this.res.style.setProperty(e,String(t[e]));return this}},{key:"keySet",value:function(t){if(this.temporaryVal=1,Array.isArray(t)){for(var e=0;e<t.length;e++)t[e]&&null!=t[e].key&&(this.res.style[t[e].key]=t[e].value);return this}return this.res.style[t.key]=t.value,this}},{key:"commonMethods",value:function(t){var e={exact:"fontSize",cursor:"cursor",width:"width",maxWidth:"maxWidth",height:"height",maxHeight:"maxHeight",radius:"borderRadius",lineHeight:"lineHeight",background:"background",color:"color",font:"fontFamily",opacity:"opacity",gap:"gap",minHeight:"minHeight",position:"position",inset:"inset",top:"top",right:"right",bottom:"bottom",left:"left",zIndex:"zIndex",flex:"flex",flexShrink:"flexShrink",flexGrow:"flexGrow",flexBasis:"flexBasis",flexWrap:"flexWrap",alignSelf:"alignSelf",display:"display",gridTemplateColumns:"gridTemplateColumns",gridTemplateRows:"gridTemplateRows",rowGap:"rowGap",columnGap:"columnGap",cols:"gridTemplateColumns",rows:"gridTemplateRows",areas:"gridTemplateAreas",area:"gridArea",letterSpacing:"letterSpacing",textTransform:"textTransform",whiteSpace:"whiteSpace",overflowWrap:"overflowWrap",wordBreak:"wordBreak",wordWrap:"wordWrap",boxShadow:"boxShadow",backdropFilter:"backdropFilter",WebkitBackdropFilter:"WebkitBackdropFilter",overflow:"overflow",overflowX:"overflowX",overflowY:"overflowY",WebkitOverflowScrolling:"WebkitOverflowScrolling",WebkitTapHighlightColor:"WebkitTapHighlightColor",minWidth:"minWidth",boxSizing:"boxSizing",pointerEvents:"pointerEvents",userSelect:"userSelect",WebkitUserSelect:"WebkitUserSelect",textAlign:"textAlign",transition:"transition"};for(var n in e)null!=t[n]&&(this.res.style[e[n]]=t[n]);return"string"==typeof t.transform&&(this.res.style.transform=t.transform),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.respad&&this.respad(t.respad),t.borderObj&&t.borderObj.width&&this.borderObj(t.borderObj),t.resmar&&this.resmar(t.resmar),t.hover&&this.hover(t.hover),t.size&&this.fluidCopy(t.size),t.resprop&&this.resprop(t.resprop,t),t.vars&&this.vars(t.vars),t.keySet&&this.keySet(t.keySet),t.noTheme&&(this._noTheme=!0),t.theme&&this.theme(t.theme),t.hide&&this.isHidden(t.hide),t.raster&&this.rasterize(t.raster),t.center&&this.center(t.center,{display:t.disp||t.display,flexDirection:t.flexDir||t.flexDirection}),t.transform&&"object"===Y(t.transform)&&this.reactOnTransform(t.transform),void 0!==t.opacity&&(this.res.style.opacity=t.opacity),t.bold?this.res.style.fontWeight="bold":null!=t.weight&&(this.res.style.fontWeight=t.weight),this}},{key:"hover",value:function(t){var e=this;if(t.border){var n=t.border.width;this.res.style.border=n?"".concat(n,"px solid transparent"):"1px solid transparent"}var r=this.options&&this.options.borderObj;return r&&(this.res.style.border="".concat(r.width,"px solid ").concat(r.color)),this.prevColor=this.res.style.backgroundColor,this.foreColor=this.res.style.color,this.prevBorder=this.res.style.border,this.prevBoxShadow=this.res.style.boxShadow,t.animation&&(this.res.style.transition="".concat(t.animation),this.res.style.transitionProperty="background-color, color, border, box-shadow, transform"),this.prevTransform=this.res.style.transform,this.res.onmouseout=function(){e.res.style.backgroundColor="".concat(e.prevColor),e.res.style.color="".concat(e.foreColor),e.res.style.border=e.prevBorder,null==t.scale&&null==t.transform||(e.res.style.transform=e.prevTransform||""),null!=t.boxShadow&&(e.res.style.boxShadow=e.prevBoxShadow||"")},this.res.onmouseover=function(){if(e.res.style.color=t.color,e.res.style.backgroundColor=t.background,t.border){var n,r=t.border.width,o=null!==(n=t.border.color)&&void 0!==n?n:"#2ECC71";e.res.style.border=r?"".concat(r,"px solid ").concat(o):"1px solid #2ECC71"}if(null!=t.scale||null!=t.transform){var i=e.prevTransform?"".concat(e.prevTransform," "):"",a=[];null!=t.transform&&a.push(t.transform),null!=t.scale&&a.push("scale(".concat(t.scale,")")),e.res.style.transform="".concat(i).concat(a.join(" "))}null!=t.boxShadow&&(e.res.style.boxShadow=t.boxShadow)},this}},{key:"onScroll",value:function(t){var e=this,n=function(t){if(null==t)return{num:0,unit:"px"};var e=String(t).match(/^(-?[\d.]+)(.*)$/);return e?{num:parseFloat(e[1]),unit:e[2]||"px"}:{num:0,unit:"px"}},r=function(t){var n=t&&null!=t.tx?t.tx:"0px",r=t&&null!=t.ty?t.ty:"0px";e.res.style.transform="translate3d(".concat(n,", ").concat(r,", 0)")};"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value?this.res.style.transform="scale(".concat(t.valMin,")"):"trn"===t.value&&r(t.valMin);var o=function(){if("trn"!==t.value){var o=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?e.res.style.opacity=o:"scale"===t.value&&(e.res.style.transform="scale(".concat(o,")"))}else{for(var i={},a=["tx","ty"],s=0;s<a.length;s++){var l=a[s],c=t.valMin&&null!=t.valMin[l],u=t.valMax&&null!=t.valMax[l];if(c||u){var f=n(c?t.valMin[l]:u?t.valMax[l]:"0px"),d=n(u?t.valMax[l]:c?t.valMin[l]:"0px"),h=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:f.num,max:d.num});i[l]="".concat(h).concat(f.unit)}}r(i)}};this._on(window,"scroll",o),0===t.from&&o()}},{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:"_setupResponsiveManager",value:function(){var t=this;this._responsiveTasks=this._responsiveTasks||[];var e=function(){t._responsiveTasks.forEach(function(t){t()})};this._responsiveHandler||(this._responsiveHandler=e,this._on(window,"resize",e)),setTimeout(function(){e()},0)}},{key:"resprop",value:function(e,n){var r=this;this.options=n;var o={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]},i=["resprop","breakpoint","value","values","range"],a={flexDir:"flexDirection",dir:"flexDirection",justify:"justifyContent",align:"alignItems",wrap:"flexWrap",bg:"background",radius:"borderRadius",z:"zIndex",exact:"fontSize"},s=function(t){var e=a[t]||t;return"undefined"==typeof console||"function"==typeof r[t]||e in r.res.style||console.warn('[nodality] resprop: "'.concat(t,'" is not a CSS property or component method — ignored.')+(a[t]?"":" Did you mean one of: ".concat(Object.keys(a).join(", "),"?"))),e};e.forEach(function(t){void 0!==o[t.breakpoint]?t.range=o[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[0,parseInt(t.breakpoint,10)]}),e.sort(function(t,e){return t.range[1]-e.range[1]});var l=e.find(function(t){return"default"===t.breakpoint});l||(l={breakpoint:"default",range:o.default},e.unshift(l));var c=new Set;e.forEach(function(t){Object.keys(t).forEach(function(t){i.includes(t)||"range"===t||c.add(t)})}),c.forEach(function(t){void 0===l[t]&&(l[t]=r.options[t]||"initial")}),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var n=t.viewportWidth(),o=l,a=0;a<e.length;a++){var u=e[a],f=q(u.range,2),d=f[0],h=f[1];if("default"!==u.breakpoint&&n>=d&&n<=h){o=u;break}}for(var p in c.forEach(function(t){if("keySet"===t){var e=l[t];e&&e.key&&(r.res.style[e.key]=e.value)}else r.res.style[s(t)]=l[t]}),o)if("exact"!==p){if(!i.includes(p)&&"range"!==p){var y=o[p];"keySet"===p&&y&&y.key?r.res.style[y.key]=y.value:"function"==typeof r[p]?r[p](y):r.res.style[s(p)]=y}}else r.res.style.fontSize=o[p]}),this._setupResponsiveManager()}},{key:"respad",value:function(e){var n=this,r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==r[t.breakpoint]?t.range=r[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[parseInt(t.breakpoint,10),1e5]}),e.sort(function(t,e){return t.range[0]-e.range[0]});var o=e.find(function(t){return"default"===t.breakpoint});o||(o={breakpoint:"default",range:r.default},e.unshift(o)),void 0===o.values&&(o.values=this.options&&this.options.pad||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),i=o,a=0;a<e.length;a++){var s=e[a],l=q(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&r>=c&&r<=u){i=s;break}}var f=void 0!==i.values?i.values:o.values;null!=f&&n.pad(f)}),this._setupResponsiveManager()}},{key:"resmar",value:function(e){var n=this,r={default:[0,1e5],xs:[0,575],sm:[576,767],md:[768,991],lg:[992,1199],xl:[1200,1399],xxl:[1400,1e5]};e.forEach(function(t){void 0!==r[t.breakpoint]?t.range=r[t.breakpoint]:Array.isArray(t.breakpoint)&&2===t.breakpoint.length?t.range=[parseInt(t.breakpoint[0],10),parseInt(t.breakpoint[1],10)]:t.range=[parseInt(t.breakpoint,10),1e5]}),e.sort(function(t,e){return t.range[0]-e.range[0]});var o=e.find(function(t){return"default"===t.breakpoint});o||(o={breakpoint:"default",range:r.default},e.unshift(o)),void 0===o.values&&(o.values=this.options&&(this.options.mar||this.options.pad)||null),this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){for(var r=t.viewportWidth(),i=o,a=0;a<e.length;a++){var s=e[a],l=q(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&r>=c&&r<=u){i=s;break}}var f=void 0!==i.values?i.values:o.values;null!=f&&n.mar(f)}),this._setupResponsiveManager()}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"radius",value:function(t){return this.res.style.borderRadius="number"==typeof t?"".concat(t,"px"):t,this}},{key:"width",value:function(t){return this.res.style.width=t,this}},{key:"scale",value:function(t){var e=this;return this.res.style.width,this.res.style.transition="0.5s all",this.res.addEventListener("mouseover",function(){e.res.style.width,e.res.style.transform="scale(1.04)"}),this.res.addEventListener("mouseout",function(){e.res.style.width,e.res.style.transform="scale(1.0)"}),this}},{key:"round",value:function(t){return this.deprecatedOption("round()","radius()"),this.radius(t)}},{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"deprecatedOption",value:function(t,e){return console.error("nodality: `".concat(t,"` is deprecated — use `").concat(e,"` instead.")),this}},{key:"center",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.res.style,r=n.display||e.display||"",o=n.flexDirection||e.flexDirection||"",i=!0===t||"both"===t||"x"===t,a=!0===t||"both"===t||"y"===t;if(r.includes("grid"))return i&&(n.justifyItems="center",n.justifyContent="center"),a&&(n.alignItems="center",n.alignContent="center"),this;r.includes("flex")||(n.display="flex"),n.flexDirection||(n.flexDirection=o||"column");var s=(n.flexDirection||"column").startsWith("column");return(s?a:i)&&(n.justifyContent="center"),(s?i:a)&&(n.alignItems="center"),this}},{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 n=Object.keys(t[e]),r=0;r<n.length;r++)for(var o=n[r],i=t[e][o],a=0;a<o.length;a++)switch(o[a]){case"a":this.res.style.padding=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.paddingTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.paddingLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.paddingRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.paddingBottom=this.isNumber(i)?"".concat(i,"px"):i}return this}},{key:"as",value:function(t){return this.res.style.alignSelf=t,this}},{key:"mar",value:function(t){if("center"===t)return this.res.style.marginLeft="auto",this.res.style.marginRight="auto",this;for(var e=0;e<t.length;e++)for(var n=Object.keys(t[e]),r=0;r<n.length;r++){for(var o=n[r],i=t[e][o],a=0;a<o.length;a++)switch(o[a]){case"a":"auto"===i?(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"):this.res.style.margin=this.isNumber(i)?"".concat(i,"px"):i;break;case"t":this.res.style.marginTop=this.isNumber(i)?"".concat(i,"px"):i;break;case"l":this.res.style.marginLeft=this.isNumber(i)?"".concat(i,"px"):i;break;case"r":this.res.style.marginRight=this.isNumber(i)?"".concat(i,"px"):i;break;case"b":this.res.style.marginBottom=this.isNumber(i)?"".concat(i,"px"):i}"center"===o&&!0===i&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),"auto"===i&&(o.includes("l")||o.includes("r"))&&(o.includes("l")&&(this.res.style.marginLeft="auto"),o.includes("r")&&(this.res.style.marginRight="auto"))}return this}},{key:"smartRange",value:function(t,e,n){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var r=(t-e.min)/(e.max-e.min);return e.min>e.max&&(r=(t-e.max)/(e.min-e.max)),n.min+(n.max-n.min)*r}},{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 n=document.createTextNode(this.text);this.res.appendChild(n),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 r=document.createTextNode(this.text);this.res.appendChild(r),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 o=document.createTextNode(this.text);this.res.appendChild(o),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 i=document.createTextNode(this.text);this.res.appendChild(i),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 a=document.createTextNode(this.text);this.res.appendChild(a),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,n=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(n," ").concat(t.color),void 0!==t.radius&&(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}},{key:"chainReact",value:function(e,n,r){var o=this;this.ap=!1,this.cta=0,this.once=!1;var i,a=J(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;s.range||(s.range=["0px","999999px"])}}catch(t){a.e(t)}finally{a.f()}e.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var l=function(i){var a=t.viewportWidth(),s=[],l=[];o.resCopy=o.res,o.storedQueries=e.map(function(t){return t.target}).filter(function(t){return null!=t});var c,u=J(e);try{for(u.s();!(c=u.n()).done;){var f=c.value;o.counterIndex++;var d=q(f.range,2),h=d[0],p=d[1],y=parseInt(h),m=parseInt(p),v=!0;if(f.target){v=!1;for(var b=0;b<f.target.length;b++)f.target[b]===n&&(v=!0)}a>=y&&a<=m&&v&&(s.push(f.log),l.push(f),f.op&&f.op.margin&&(o.useMargin=f.op.margin))}}catch(t){u.e(t)}finally{u.f()}if(r&&!r.includes("background")&&(o.res.style.background="",o.res.style.backgroundColor=""),o.res.style.textShadow="",r&&!r.includes("border")&&(o.res.style.border=""),r&&!r.includes("margin")&&(o.res.style.margin=""),o.res.style["-webkit-text-fill-color"]="",o.res.style["-webkit-text-stroke-color"]="",o.res.style["-webkit-text-stroke-width"]="",o.res.style.filter="",o.options.background&&(o.res.style.background=o.options.background),s.includes("gradient"),(s.includes("gradient")||s.includes("shadow"))&&(o.res.style.position="relative"),s.includes("blast")){var g,w=l.filter(function(t){return"blast"===t.log})[0].op.color,x=null!==(g=l.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==g?g:"1px";"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()?(o.res.style.border="".concat("number"==typeof x?x+"px":x," solid orange"),o.res.style.display="inline-block","FlexRowLayoutElement"===o.getType()&&(o.res.style.display="flex"),o.res.style.boxSizing="border-box",o.res.style.transformOrigin="center",o.blastTarget=o.res):(o.text,o.res.style["-webkit-text-fill-color"]="transparent",o.res.style["-webkit-text-stroke-color"]=w,o.res.style["-webkit-text-stroke-width"]="".concat(x))}if(s.includes("filter")){var k=l.filter(function(t){return"filter"===t.log})[0].op.filter;o.res.style.filter=k}if(s.includes("background")&&(o.res.style.backgroundColor="green"),s.includes("gradient")&&("LayoutWrapperElement"!==o.getType()&&"FlexRowLayoutElement"!==o.getType()&&(o.res.style["-webkit-text-fill-color"]="transparent"),o.res.style.background=o.globalGradient,"LayoutWrapperElement"!==o.getType()&&"FlexRowLayoutElement"!==o.getType()&&(o.res.style["background-clip"]="text")),s.includes("shadow")){var O,S,E,j,T=o.options.shadow.op,_=null!==(O=T.steps)&&void 0!==O?O:1,C=null!==(S=T.colors)&&void 0!==S?S:["gray"],P=null!==(E=T.movements)&&void 0!==E?E:["3px","3px"],A=null!==(j=T.radius)&&void 0!==j?j:"3px";if(1===P.length&&(P=[P[0],P[0]]),"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()){for(var R=[],M=0;M<_;M++){var F,I=null!==(F=C[M])&&void 0!==F?F:C[0],D=P[0],L=P[1];R.push("".concat(D," ").concat(L," ").concat(A," ").concat(I))}o.res.style.boxShadow=R.join(", ")}else{for(var z=[],W=0;W<_;W++){var B,N=null!==(B=C[W])&&void 0!==B?B:C[0],U=P[0],G=P[1];z.push("drop-shadow(".concat(U," ").concat(G," ").concat(A," ").concat(N,")"))}o.res.style.filter=z.join(" ")}}if(s.includes("margin"))for(b=0;b<e.length;b++)if(e[b].op){var H=e[b].op.offsets;H&&void 0!==o.index&&(o.res.style.margin=H[Number(o.index)]+"px")}if(s.includes("spana")||s.includes("span")){var X=document.createElement("div");if(X.setAttribute("id","oroa"),Object.assign(X.style,{position:"absolute",inset:"0",background:"linear-gradient(90deg, rgb(52,152,219), rgb(26,188,156))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none"}),o.res&&o.res.querySelector("span"))return;o.res=o.resCopy,o.res.textContent="",o.options.span&&(Array.isArray(o.options.span)?o.options.span:[o.options.span]).forEach(function(t){if(t.op&&"span"===t.op.name&&Array.isArray(t.op.parts)){var e=0,n=o.prevText||"";if(t.op.parts.forEach(function(t){var r=t.text,i=t.style||{};if(e<n.length){var a=n.indexOf(r,e);if(a>e){var s=n.substring(e,a);o.res.appendChild(new o.constructor(s).setup({type:"span",id:i.id,animation:i.animation}).set({}).render())}e=a+r.length}var l=new o.constructor(r).setup({type:"span",id:i.id,animation:i.animation}).set(i).render();o.res.appendChild(l)}),e<n.length){var r=n.substring(e);o.res.appendChild(new o.constructor(r).setup({type:"span"}).set({}).render())}}})}else{var V=new o.constructor(o.prevText).set({}).render();o.prevText&&o.prevText.length>0&&i&&o.res.appendChild(V)}if(s.includes("animation")){if(o.options.animation&&!o.hasAnimated&&!o.options.animation.op.fireAt){o.hasAnimated=!0;var $=o.options.animation.op;o._on(window,"sidebar:open",function(){o.res.animate($.keyframesOpen,$.openOptions)}),o._on(window,"sidebar:closed",function(){o.res.animate($.keyframesClose,$.closeOptions)}),o.res.animate($.keyframesClose,{duration:0,fill:"forwards"}),o.openTag&&o.closeTag&&(o._on(window,o.openTag,function(){o.res.animate($.keyframesOpen,$.openOptions)}),o._on(window,o.closeTag,function(){o.res.animate($.keyframesClose,$.closeOptions)}))}if(o.options.animation&&o.options.animation.op.fireAt&&o.options.animation.op.fireAt.endsWith("px")){var Y=o.options.animation.op;o.res.animate(Y.keyframesClose,{duration:0,fill:"forwards"});var Q=function(){window.scrollY>parseFloat(Y.fireAt)&&(o.res.animate(Y.keyframesOpen,Y.openOptions),window.removeEventListener("scroll",Q))};o._on(window,"scroll",Q)}if(o.options.animation&&"inview"===o.options.animation.op.fireAt){var K=o.options.animation.op;o.res.animate(K.keyframesClose,{duration:0,fill:"forwards"});var Z=!1,tt=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!Z&&(Z=!0,o.res.animate(K.keyframesOpen,K.openOptions),e.disconnect())})});tt.observe(o.res),o._track(function(){return tt.disconnect()})}}};this.options.animation||this._on(window,"resize",function(){return l()}),l()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(H(),"$1:")}}],r=[{key:"viewportWidth",value:function(){if("undefined"==typeof window)return 0;var t=window.visualViewport;return t&&"number"==typeof t.width?t.width:window.innerWidth}}],n&&Q(e.prototype,n),r&&Q(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function tt(t){return tt="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},tt(t)}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,rt(r.key),r)}}function rt(t){var e=function(t){if("object"!=tt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tt(e)?e:e+""}function ot(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ot=function(){return!!t})()}function it(t,e,n,r){var o=at(st(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function at(){return at="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=st(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},at.apply(null,arguments)}function st(t){return st=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},st(t)}function lt(t,e){return lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lt(t,e)}var ct=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=st(e),function(t,e){if(e&&("object"==tt(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,ot()?Reflect.construct(e,n||[],st(t).constructor):e.apply(t,n))}(this,e)).text=t,r.res=null,r.setup(n),r.code=[],r.elCSS=[],r.html=[],r.react=[],r.code.push('new Text("'.concat(r.text,'")')),r}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&&lt(t,e)}(e,t),n=e,r=[{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=X(Object.fromEntries(Object.entries(this.options).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return et(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?et(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]})),4);return['new Text("'.concat(this.text,'").set(').concat(t,")")]}},{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:"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:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"styled",value:function(t){return this.set(t),this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(H(),"$1:")}},{key:"looksLikeMarkdown",value:function(t){return/(\*\*.*\*\*|\*.*\*|`[^`]+`|\[.*?\]\(.*?\)|^# )/m.test(t)}},{key:"parseMarkdown",value:function(t){var e=t;return(e=(e=(e=(e=(e=(e=(e=e.replace(/^### (.*$)/gim,"<h3>$1</h3>")).replace(/^## (.*$)/gim,"<h2>$1</h2>")).replace(/^# (.*$)/gim,"<h1>$1</h1>")).replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>")).replace(/\*(.*?)\*/g,"<em>$1</em>")).replace(/`([^`]+)`/g,"<code>$1</code>")).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>')).replace(/\n/g,"<br>")}},{key:"set",value:function(t){return this.resCopy=this.res,this.options=t,it(e,"setPrevText",this,3)([this.text]),t.raster&&this.rasterize(t.raster),this.commonMethods(t),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&&it(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.preffersId&&(this.preffersId=t.preffersId),it(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),this.options.id&&this.res.setAttribute("id",this.options.id),it(e,"setID",this,3)([this.options.id]),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.class&&this.res.setAttribute("class",this.options.class),it(e,"setClass",this,3)([this.options.class]),t.clampc&&this.clampCopy(t.clampc),t.absolute&&(this.res.style.position="absolute"),t.em&&this.em(t.em),t.fluid&&this.fluid(t.fluid),t.fluidc&&this.elCSS.push("font-family: ".concat(t.font,"; \n")),t.align&&(this.res.style.textAlign=t.align),t.breakWord&&(this.res.style.wordWrap="break-word"),t.center&&this.deprecatedOption("center on Text",'mar: "center"'),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),this.callReact(t),this}},{key:"callReact",value:function(t){var n=[],r=t.transform&&"object"===tt(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||r){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&it(e,"setAny",this,3)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var o=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,r?t.transform:void 0];o=o.filter(function(t){return null!=t});for(var i=0;i<o.length;i++)n.push({range:o[i].range,log:o[i].op.name,target:o[i].target,op:o[i].op});var a=[];t.borderObj&&a.push("border"),t.background&&a.push("background"),t.mar&&a.push("margin"),t.animation&&a.push("animation"),t.span&&a.push("span"),this.chainReact(n,this.options.id,a)}}},{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:"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:"stringGen",value:function(t){for(var e="",n=0;n<t;n++)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 n=this.stringGen(1e3);return this.res.setAttribute("id",n),document.styleSheets[0].insertRule("#".concat(n,"::first-letter { color: green; font-size: 3em; padding: 0.1em }"),0),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 n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.525rem + 3.525vw)"}if("S3"===t){this.res=document.createElement("h3");var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.375rem + 2.75vw)"}if("S4"===t){this.res=document.createElement("h4");var o=document.createTextNode(this.text);this.res.appendChild(o),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:"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:"responsive",value:function(t){var e=this;this.set=!1,this.setB=!1;var n=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 n(),window.addEventListener("resize",n),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 n=function(){for(var n=0;n<t.length;n++)t[n].width&&window.matchMedia("(min-width: ".concat(t[n].width,"px)")).matches&&(e.res.style.fontSize="".concat(t[n].size));window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.fontSize="".concat(t[t.length-1].mobile))};return n(),window.addEventListener("resize",n),this}},{key:"setup",value:function(t){var e;t?((e=document.createElement(t.type)).setAttribute("id",t.id),"span"===t.type&&t.animation&&(e.style.position="relative",e.style.display="block")):e=document.createElement("p");var n=document.createTextNode(this.text);return e.appendChild(n),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:"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:"updating",value:function(t,e){var n=this.res,r=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(r.replace("$",t));n.replaceChild(e,n.childNodes[0])}}),this}},{key:"apply",value:function(t){var e=this,n=this.res.styles,r=function(){for(var r=0;r<t.length;r++){var o=t[r];o.min&&o.max?window.matchMedia("(min-width: ".concat(o.min,"px) and (max-width: ").concat(o.max,"px)")).matches?Object.assign(e.res.style,o.styles):Object.assign(e.res.style,n):window.matchMedia("(max-width: ".concat(o.max,"px)")).matches?Object.assign(e.res.style,o.styles):Object.assign(e.res.style,n)}};return r(),window.addEventListener("resize",r),this}},{key:"render",value:function(t){if(!t)return this.options&&!this.options.span&&(this.res.textContent=this.text),this.looksLikeMarkdown(this.text)&&(this.res.innerHTML=this.parseMarkdown(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),this.looksLikeMarkdown(this.text)&&(this.res.innerHTML=this.parseMarkdown(this.text)),document.querySelector(t).appendChild(this.res)}}],r&&nt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function ut(t){return ut="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},ut(t)}function ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function dt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ht(r.key),r)}}function ht(t){var e=function(t){if("object"!=ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ut(e)?e:e+""}function pt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(pt=function(){return!!t})()}function yt(t,e,n,r){var o=mt(vt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function mt(){return mt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},mt.apply(null,arguments)}function vt(t){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vt(t)}function bt(t,e){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bt(t,e)}var gt=function(t){function e(t,n,r,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,n){return e=vt(e),function(t,e){if(e&&("object"==ut(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,pt()?Reflect.construct(e,n||[],vt(t).constructor):e.apply(t,n))}(this,e)).url=t,i.res=null,i.code=[],i}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&&bt(t,e)}(e,t),n=e,r=[{key:"setType",value:function(t){t.url;var e=t.type,n=t.mode;if(this.code=[],"exact"===e){var r='new Image("'.concat(this.url,'", "exact")');this.code.push(r)}else if("uncover"===e){var o='new Image("'.concat(this.url,'", "uncover")');this.code.push(o)}else this.code.push("new Image('".concat(this.url,"')"));return this.image(this.url,n,e),this}},{key:"hand",value:function(){return this.res.style.cursor="hand",this}},{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 n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ft(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ft(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 n="";this.options=t;var r=t;r.onTap&&this.onTap(r.onTap);var o=t.isFull;if(o?this.image(t.url,"exact",o,"a"):this.setup(),t.url&&this.res.setAttribute("src",t.url),"IMG"===this.res.tagName&&(t.srcset&&this.res.setAttribute("srcset",t.srcset),t.sizes&&this.res.setAttribute("sizes",t.sizes),void 0!==t.alt&&this.res.setAttribute("alt",t.alt),t.loading&&this.res.setAttribute("loading",t.loading),t.decoding&&this.res.setAttribute("decoding",t.decoding),t.fetchPriority&&this.res.setAttribute("fetchpriority",t.fetchPriority)),t.id&&this.res.setAttribute("id",t.id),t.id&&(n+=' id: "'.concat(t.id,'", \n')),this.id=t.id,"exact"===o?'new Image("'.concat(this.url,'", "exact")'):"uncover"===o&&'new Image("'.concat(this.url,'", "uncover")'),this.commonMethods(r),t.vtn&&(this.res.style.viewTransitionName=t.vtn),this.vtn=t.vtn,t.minHeight&&(this.res.style.minHeight=t.minHeight),t.index&&yt(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.index&&(n+='\n index: "'.concat(t.index,'",')),t.resprop&&this.resprop(t.resprop),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&&(n+='\n objectFit: "'.concat(t.objectFit,'",')),t.objectPosition&&(this.res.style.objectPosition=t.objectPosition),t.objectPosition&&(n+='\n objectPosition: "'.concat(t.objectPosition,'",')),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,n+="\n gpos: ".concat(this.removeQuotesFromFirstWord(JSON.stringify(t.gpos)),", ")),t.filtera){var i;i=Array.isArray(t.filtera)?r.filtera.filter(function(t){return"filter"===t.op.name})[0]:t.filtera;var a=this.removeQuotesFromFirstWord(JSON.stringify(i));n+="\n filtera: ".concat(a,", \n")}if(t.keySet&&this.keySet(t.keySet),t.stype&&this.setType(t.stype),t.isBackground&&(this.isBackground=t.isBackground),t.zIndex&&(n+='\n zIndex: "'.concat(t.zIndex,'", \n')),t.area&&this.setArea(t.area),t.area&&(n+='area: "'.concat(t.area,'", \n')),t.opacity&&(this.res.style.opacity=t.opacity),t.width&&(this.res.style.width=t.width),t.width&&(n+='width: "'.concat(t.width,'", ')),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.maxWidth&&(n+='maxWidth: "'.concat(t.maxWidth,'", ')),t.height&&(this.res.style.height=t.height),t.height&&(n+='height: "'.concat(t.height,'", ')),t.maxWidth&&this.maxWidth(t.maxWidth),t.maxWidth&&(n+='maxWidth: "'.concat(t.maxWidth,'", \n')),t.radius&&this.cornerRadius(t.radius),t.radius&&(n+='radius: "'.concat(t.radius,'", \n')),t.marginOp){var s=this.removeQuotesFromFirstWord(JSON.stringify(t.marginOp));n+="\n marginOp: ".concat(s,",")}if(t.clipPath&&this.clipPath(t.clipPath),t.clipPath&&(n+='clipPath: "'.concat(t.clipPath,'", \n')),r.stroke||r.gradient||r.span||r.backgroundOp||r.layout||r.marginOp||r.shadow||r.filtera||r.animation){r.gradient,r.gradient&&(this.globalGradient=r.gradient.op.gradient),r.stroke&&yt(e,"setAny",this,3)([{globalBlast:"".concat(r.stroke.op.width," ").concat(r.stroke.op.color)}]);var l=[r.stroke,r.gradient,r.animation,r.span,r.backgroundOp,r.layout,r.marginOp,r.shadow,r.filtera,r.animation];l=l.filter(function(t){return null!=t});for(var c=[],u=0;u<l.length;u++)c.push({range:l[u].range,log:l[u].op.name,target:l[u].target,op:l[u].op});this.chainReact(c,this.options.id)}if(r.shadow){var f=r.shadow,d=this.removeQuotesFromFirstWord(JSON.stringify(f));n+="\n shadow: ".concat(d,",")}if(r.animation){var h=r.animation,p=this.removeQuotesFromFirstWord(JSON.stringify(h));n+="\n animation: ".concat(p,",")}var y="\n .set({".concat(n,"}) \n \n");return Object.keys(t).length>0?this.code.push(y):this.code.push(","),this}},{key:"setID",value:function(t){return this.res.setAttribute("id",t),this}},{key:"opacity",value:function(t){return this.res.style.opacity="".concat(t),this}},{key:"setGrid",value:function(){return this.res.style.gridRow="span 2",this.res.style.gridColumn="span 3",this}},{key:"transform",value:function(t){return this.res.style.transform=t,this}},{key:"offset",value:function(){return this.res.style.marginLeft="-60px",this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"border",value:function(t){return this.res.style.borderTopLeftRadius="16px",this.res.style.borderTopRightRadius="16px",this}},{key:"mobileWidth",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="120%"),this}},{key:"image",value:function(t,e,n,r,o){var i=window.matchMedia("(max-device-width: 415px)"),a=document.createElement("div");return a.style.viewTransitionName=r,a.style.width="100%",a.style.height=this.options.height?this.options.height:"400px",o&&(a.style.gridColumn=o.gridColumn,a.style.gridRow=o.gridRow),i.matches&&(a.style.height="500"),a.style.backgroundImage="url(".concat(t,")"),a.style.backgroundPosition="center center",a.style.backgroundRepeat="no-repeat",a.style.backgroundSize="cover","uncover"===n&&(a.style.backgroundSize="contain"),"contain"===e&&(a.style.backgroundSize="contain"),this.res=a,this}},{key:"setup",value:function(){var t=document.createElement("img");return t.style.width="100%",t.src=this.url,this.res=t,this}},{key:"float",value:function(t){return this.res.style.float="".concat(t),this}},{key:"grayscale",value:function(t){return this.res.style.filter="grayscale(".concat(t,"%)"),this}},{key:"flex",value:function(t){return this.res.style.flex=1,this}},{key:"height",value:function(t){return this.res.style.height=t,this.res.style.width="auto",this}},{key:"expand",value:function(t){var e=this,n=function(){var n,r;if(window.matchMedia("(min-width: ".concat(t.at,")")).matches){e.res.style.width="".concat(t.width);var o=window.innerWidth/2-(r=n=t.width,(n.includes("%")||n.includes("px"))&&(r=r.substr(0,2)),(n.includes("%")?Number(r/100*window.innerWidth):n.includes("px")?Number(r):void 0)/2);e.res.style.marginLeft="".concat(o,"px")}else e.res.style.width="100%",e.res.style.marginLeft="0px";window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.width="100%",e.res.style.marginLeft="0px")};return n(),window.addEventListener("resize",n),this}},{key:"width",value:function(t){return this.res.style.width=t,this.res.style.height="auto",this}},{key:"dimensions",value:function(t,e){return t&&e?(this.res.style.width=t,this.res.style.height=e):(this.res.style.width=t,this.res.style.height=t),this}},{key:"size",value:function(t,e){return this.deprecatedOption("size() on this component","dimensions(w, h)"),this.dimensions(t,e)}},{key:"frame",value:function(t){var e=t.width,n=t.height;return e&&n?(this.res.style.width=e,this.res.style.height=n):(this.res.style.width=e,this.res.style.height=e),this}},{key:"shadow",value:function(t){return"mild"===t.type?this.res.style.boxShadow="0px 3px 15px rgba(0,0,0,0.2)":this.res.style.boxShadow="".concat(t.x,"px ").concat(t.y,"px ").concat(t.radius,"px ").concat(t.color),this}},{key:"cornerRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"clipPath",value:function(t){this.res.style.clipPath='path("'.concat(t,'")');var e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.style.display="block",e.style.width="100%",e.style.height="100%",e.style.overflow="visible",this}},{key:"render",value:function(t){var e=this.res;if(!t)return e;document.querySelector(t).appendChild(e)}}],r&&dt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function wt(t){return wt="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},wt(t)}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function kt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ot(r.key),r)}}function Ot(t){var e=function(t){if("object"!=wt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wt(e)?e:e+""}function St(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(St=function(){return!!t})()}function Et(t,e,n,r){var o=jt(Tt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function jt(){return jt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Tt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},jt.apply(null,arguments)}function Tt(t){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tt(t)}function _t(t,e){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_t(t,e)}var Ct=function(t){function e(t,n,r){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,n){return e=Tt(e),function(t,e){if(e&&("object"==wt(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,St()?Reflect.construct(e,n||[],Tt(t).constructor):e.apply(t,n))}(this,e)).link=n,o.text=t,o.code=[],o.css=[],o.elCSS=[],o.html=[],o.res=null,o.stopEM=r,o.setup(),o.inlineBlock(),o.res.addEventListener("click",function(t){var e=o.link||o.res.getAttribute("href");if(e){var n=new URL(e,window.location.href).href,r=/^https?:\/\//i.test(n),i=n.startsWith("#"),a=/^[a-zA-Z]+:/.test(n);r||i||n.endsWith(".html")||a||(t.preventDefault(),"navigation"in window?navigation.navigate(n):(history.pushState({},"",n),document.dispatchEvent(new PopStateEvent("popstate"))))}}),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&&_t(t,e)}(e,t),n=e,(r=[{key:"toElCSS",value:function(){return 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"HTMLAnchorElement"}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=X(Object.fromEntries(Object.entries(this.options).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return xt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xt(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]})),4);return["new Link().set(".concat(t,")")]}},{key:"setup",value:function(){var t=document.createElement("a");t.setAttribute("href",this.link),t.style.textDecoration="none",t.style.color="black",t.style.fontFamily="Arial";var e=document.createTextNode(this.text);return t.appendChild(e),this.res=t,!1===this.stopEM&&this.em(1),this}},{key:"appendImageAsChild",value:function(t,e){var n=document.createElement("a");t.options.vtn&&(n.style.viewTransitionName=t.options.vtn),n.setAttribute("href",t.options.url);var r=document.createElement("img");return t.options&&(r.style.width=t.options.size,t.options.radius&&(r.style.borderRadius=t.options.radius),r.setAttribute("src",t.options.img),t.options.pad&&(this.res.style.padding=t.options.pad),n.appendChild(r)),this.res=n,e&&(this.res.style.marginLeft=e),this}},{key:"addIcon",value:function(t){var e=document.createElement("img");return e.style.width="20px",e.style.height="auto",e.style.marginLeft=t.padding?t.padding:"10px",e.setAttribute("src",t.url),this.res.appendChild(e),this}},{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(H(),"$1:")}},{key:"set",value:function(t){this.elCSS.push("text-decoration: none; \n"),this.options=t;var n="";t.onTap&&this.onTap(t.onTap),t.tags&&Et(e,"setTags",this,3)([t.tags]),t.id&&this.res.setAttribute("id",t.id),t.id&&Et(e,"setID",this,3)([t.id]),this.commonMethods(t),t.flex&&(this.res.style.display="flex"),t.fixMobileTap&&this.fixMobileTap(t.fixMobileTap);var r=this.removeQuotesFromFirstWord(JSON.stringify(t.pad));if(t.pad&&(n+="\n pad: ".concat(r,",")),t.preffersId&&(this.preffersId=t.preffersId),null!=t.preffersId&&(n+="\n preffersId: ".concat(t.preffersId,",")),t.class&&Et(e,"setClass",this,3)([t.class]),t.class&&(n+='\n class: "'.concat(t.class,'",')),t.borderObj){this.res.style.border="".concat(t.borderObj.width," solid ").concat(t.borderObj.color),this.res.style.borderRadius="".concat(t.borderObj.radius);var o=this.removeQuotesFromFirstWord(JSON.stringify(t.borderObj));n+="\n borderObj: ".concat(o,",")}if(!1===this.options.preffersId?this.html.push('<a class="'.concat(t.class,'" href="#hello">').concat(t.text,"</a> \n \n")):t.id&&this.html.push('<a id="'.concat(t.id.substr(1),'" href="#hello">').concat(t.text,"</a> \n \n")),null!=t.blastData){var i=this.removeQuotesFromFirstWord(JSON.stringify(t.blastData));Et(e,"setAny",this,3)([{globalBlast:"1px ".concat(t.blastData.color)}]),t.blastData&&(n+="\n blastData: ".concat(i,","))}t.nowrap&&(this.res.style.whiteSpace="nowrap"),t.font&&this.font(t.font),t.font&&(n+='\n font: "'.concat(t.font,'",')),t.font&&this.elCSS.push('font-family: "'.concat(t.font,'"; \n')),t.fluidc&&this.fluidCopy(t.fluidc),t.fluidc&&(n+='\n fluidc: "'.concat(t.fluidc,'",')),t.clampc&&this.clampCopy(t.clampc),this.options.id&&(n+='\n id: "'.concat(this.options.id,'",')),t.align&&this.leftAlign(t.align),t.align&&(n+='\n align: "'.concat(t.align,'",')),t.type&&(this.res.style.display="block"),t.color&&this.color(t.color),t.color&&(n+='\n color: "'.concat(t.color,'",')),t.color&&this.elCSS.push('color: "'.concat(t.color,'"; \n')),t.background&&this.background(t.background);var a=this.removeQuotesFromFirstWord(JSON.stringify(t.background));t.background&&(n+="\n background: ".concat(a,",")),t.hover&&this.hover(t.hover);var s=this.removeQuotesFromFirstWord(JSON.stringify(t.hover));if(t.hover&&(n+="\n hover: ".concat(s,",")),t.blast&&(this.blastData=t.blast),t.bold&&(n+="\n bold: ".concat(t.bold,",")),t.block&&this.toBlock(),t.block&&(n+="\n block: ".concat(t.block,",")),t.radius&&(n+='\n radius: "'.concat(t.radius,'",')),t.width&&(n+='\n width: "'.concat(t.width,'",')),t.maxWidth&&this.maxWidth(t.maxWidth),t.url&&this.res.setAttribute("href",t.url),n+='\n url: "'.concat(t.url,'",'),t.text&&(this.res.textContent=t.text),n+='\n text: "'.concat(t.text,'",'),t.data){t.data&&this.appendImageAsChild(t.data,"20px");var l=this.removeQuotesFromFirstWord(JSON.stringify(t.data));t.data&&(n+="\n data: ".concat(l))}if(t.icon){this.addIcon(t.icon);var c=this.removeQuotesFromFirstWord(JSON.stringify(t.icon));n+="\n icon: ".concat(c,",")}if(t.shadow){var u=t.shadow,f=this.removeQuotesFromFirstWord(JSON.stringify(u));n+="\n shadow: ".concat(f,",")}if(t.stroke){var d=this.removeQuotesFromFirstWord(JSON.stringify(t.stroke));t.stroke&&(n+="\n stroke: ".concat(d,","))}if(t.backgroundOp){var h=this.removeQuotesFromFirstWord(JSON.stringify(t.backgroundOp));n+="\n backgroundOp: ".concat(h,",")}if(t.marginOp){var p=this.removeQuotesFromFirstWord(JSON.stringify(t.marginOp));n+="\n marginOp: ".concat(p,",")}if(t.gradient){var y=this.removeQuotesFromFirstWord(JSON.stringify(t.gradient));n+="\n gradient: ".concat(y,",")}if(t.animation){var m=this.removeQuotesFromFirstWord(JSON.stringify(t.animation));n+="\n animation: ".concat(m,",")}if(t.transform){var v=this.removeQuotesFromFirstWord(JSON.stringify(t.transform));n+="\n transform: ".concat(v,",")}if(t.blast){var b=this.removeQuotesFromFirstWord(JSON.stringify(t.blast));n+="\n blast: ".concat(b,",")}var g="new Link().set({".concat(n,"}) \n");this.code.push(g),t.color&&this.color(t.color),t.rounded&&this.round(),t.new&&(this.res.setAttribute("target","_blank"),this.res.setAttribute("rel","noopener noreferrer")),t.transform&&this.reactOnTransform(t.transform);var w=[],x=[t.border,t.blast,t.gradient,t.animation,t.span,t.shadow,t.backgroundOp,t.animation,t.transform];if((x=x.filter(function(t){return null!=t})).length>0){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&Et(e,"setAny",this,3)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]);for(var k=0;k<x.length;k++)w.push({range:x[k].range,log:x[k].op.name,target:x[k].target,op:x[k].op});var O=[];t.borderObj&&O.push("border"),t.background&&O.push("background"),t.mar&&O.push("margin"),t.animation&&O.push("animation"),this.chainReact(w,t.id,O,t.isNavA),this.res.style.zIndex=1}return this}},{key:"fixMobileTap",value:function(t){this.res.style.pointerEvents="auto",this.res.style.touchAction="manipulation",this.res.style.cursor="pointer",this.res.style.zIndex="1",this.res.style.position="relative"}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"leftAlign",value:function(t){return this.res.style.textAlign=t,this}},{key:"getClampValue",value:function(t){return"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){return"S1"===t&&(this.res.style.fontSize="calc(1.625rem + 5.075vw)"),"S2"===t&&(this.res.style.fontSize="calc(1.500rem + 4.3vw)"),"S3"===t&&(this.res.style.fontSize="calc(1.375rem + 3.525vw)"),"S4"===t&&(this.res.style.fontSize="calc(1.250rem + 2.75vw)"),"S5"===t&&(this.res.style.fontSize="calc(1.125rem + 1.975vw)"),"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"inlineBlock",value:function(){return this.res.style.display="inline-block",this}},{key:"toBlock",value:function(){return this.res.style.display="block",this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"newWindow",value:function(){return this.res.target="_new",this}},{key:"transition",value:function(t){return this.res.style.transition="".concat(t,"s ease-in-out"),this.res.style.transionProperty="background, color",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"medium",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2rem":t.res.style.fontSize="1.5em"};return e(),window.addEventListener("resize",e),this}},{key:"opacity",value:function(t){return this.res.style.opacity=t,this}},{key:"em",value:function(t){var e=this,n=window.matchMedia("(max-device-width: 415px)"),r=function(){n.matches?e.res.style.fontSize="2em":e.res.style.fontSize="1em"};return r(),window.addEventListener("resize",r),this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this):this.res}}])&&kt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Pt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return At(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(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.")}()}function At(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Rt(t){return Rt="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},Rt(t)}function Mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ft(r.key),r)}}function Ft(t){var e=function(t){if("object"!=Rt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rt(e)?e:e+""}function It(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(It=function(){return!!t})()}function Dt(){return Dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Lt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Dt.apply(null,arguments)}function Lt(t){return Lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Lt(t)}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}var Wt=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=Lt(e),function(t,e){if(e&&("object"==Rt(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,It()?Reflect.construct(e,n||[],Lt(t).constructor):e.apply(t,n))}(this,e)).code=[],r.saveEl=n,r.frs=t,r.res=null,r.setup(),r.responsive(),r}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&&zt(t,e)}(e,t),n=e,r=[{key:"getType",value:function(){return"FlexRowLayoutElement"}},{key:"set",value:function(t){this.options=t;var e=t;return e.onTap&&this.onTap(e.onTap),e.id&&this.res.setAttribute("id",e.id),e.position&&(this.res.style.position=e.position),void 0!==e.top&&(this.res.style.top=e.top),t.id&&this.res.setAttribute("id",t.id),this.commonMethods(e),t.padding&&this.pad([{a:t.padding}]),t.background&&(this.res.style.backgroundColor="#ecf0f1",this.res.style.cornerRadius="#3rem"),t.alignTo&&(this.res.style.justifyContent=t.alignTo),t.background&&(this.res.style.backgroundColor=t.background),t.justify&&(this.res.style.justifyContent=t.justify),t.border&&("top"===t.border[0]&&(this.res.style.borderTop="".concat(t.border[1]," solid white")),"all"===t.border[0]&&(this.res.style.border="".concat(t.border[1]," solid orange"))),t.borderObj&&(this.borderObj(t.borderObj),JSON.stringify(t.borderObj)),t.width&&(this.res.style.width=t.width),t.height&&(this.res.style.height=t.height),t.gap&&(this.res.style.gap=t.gap),t.align&&(JSON.stringify(t.align),this.res.style.alignItems="flex-start",this.res.style.alignItems="flex-start"),t.wrap&&this.wrap(),t.alignIts&&(JSON.stringify(t.alignIts),this.res.style.alignItems="flex-start"),t.owrap&&this.onlyWrap(),null!=t.owrap&&!1===t.owrap&&(this.res.style.flexWrap="nowrap",this.res.style.background="yellow"),t.toColumn&&this.deprecatedOption("toColumn","colat"),t.column&&this.makeCol(),t.colat&&t.colat&&this.toColumnAt(t.colat),t.align&&this.makeJustify(t.justify),t.justify&&this.makeAlign(t.justify),"flex-start"===t.justifo&&(this.res.style.justifyContent="flex-start"),t.radius&&(this.res.style.borderRadius=t.radius),t.aligns&&this.aligns(t.aligns),this.callReact(e),!0===t.center&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"callReact",value:function(t){this.options=t;var n,r,o,i=[],a=t.transform&&"object"===Rt(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||a){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&(n=e,r=this,"function"==typeof(o=Dt(Lt(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var s=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,a?t.transform:void 0];s=s.filter(function(t){return null!=t});for(var l=0;l<s.length;l++)i.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];t.borderObj&&c.push("border"),t.background&&c.push("background"),t.mar&&c.push("margin"),t.animation&&c.push("animation"),t.span&&c.push("span"),this.chainReact(i,t.id,c)}}},{key:"toColumnAt",value:function(t){var e=this;if(!this.columnAlways){var n=function(){var n=window.matchMedia("(max-width: ".concat(t,")")),r=window.matchMedia("(max-device-width: 415px)");n.matches||r.matches?e.res.style.flexDirection="column":e.res.style.flexDirection="row"};n(),window.addEventListener("resize",n)}return this}},{key:"onlyWrap",value:function(){return this.res.style.flexWrap="wrap",this}},{key:"wrap",value:function(){return this.res.style.flexWrap="wrap",this.res.style.justifyContent="space-between",this}},{key:"aligns",value:function(t){return"start"===t&&(this.res.style.alignItems="flex-start"),"end"===t&&(this.res.style.alignItems="flex-end"),"center"===t&&(this.res.style.alignItems="center"),this}},{key:"toCode",value:function(){for(var t={},e=0,n=Object.entries(this.options||{});e<n.length;e++){var r=Pt(n[e],2),o=r[0],i=r[1];null!=i&&""!==i&&(t[o]=i)}var a=JSON.stringify(t,null,4).replace(H(),"$1:").replace(/"([^"]*)"/g,function(t,e){return e.includes("\n")?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')}),s=(this.items||[]).map(function(t){return null!=t&&t.toCode?t.toCode():"/* element */"}).join(",\n ");return[["new FlexRow().set(".concat(a,")"),s?".items([\n ".concat(s,"\n])"):""].join("")]}},{key:"cornerRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"makeJustify",value:function(t){return"start"===t&&(this.res.style.justifyContent="flex-start"),this}},{key:"makeAlign",value:function(t){return"center"===t?this.res.style.alignItems="center":this.res.style.justifyContent=t,this}},{key:"makeCol",value:function(){return this.res.style.flexDirection="column",this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"setup",value:function(){var t=document.createElement("div");return t.style.display="flex",t.style.justifyContent="space-around",t.style.alignItems="center",this.res=t,this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,window.matchMedia("(max-device-width: 415px)").matches&&t.mobile&&(this.res.style.width=t.mobile),this}},{key:"radius",value:function(t){return this.res.style.borderRadius="".concat(t,"px"),this}},{key:"shadow",value:function(t,e,n){return this.res.style.boxShadow="0px 1px 10px 0px rgb(145 145 145)",this}},{key:"items",value:function(t){this.els=t,this.items=t;for(var e=0;e<t.length;e++){if(null!=t[e])if(t[e].render instanceof Function){var n=t[e].render();this.res.appendChild(n)}else this.res.appendChild(t[e]);if(null!=t[e]&&t[e].render instanceof Function){var r=t[e].render();this.res.appendChild(r),void 0!==t[e].toCode&&this.code.push(t[e].toCode().flatMap(function(t){return t}))}}return this}},{key:"responsive",value:function(t){var e=this,n=window.matchMedia("(max-device-width: 415px)");return window.innerWidth<t||n.matches?this.res.style.gridTemplateColumns="1fr":this.res.style.gridTemplateColumns="1fr 1fr",window.addEventListener("resize",function(){window.innerWidth<t||n.matches?e.res.style.gridTemplateColumns="1fr":e.res.style.gridTemplateColumns="1fr 1fr"}),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&Mt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Bt(t){return Bt="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},Bt(t)}function Nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ut(r.key),r)}}function Ut(t){var e=function(t){if("object"!=Bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bt(e)?e:e+""}var Gt=function(){return t=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.obj=e||{},this.items=n||[]},(e=[{key:"render",value:function(){var t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent="space-around",t.setAttribute("id","innerItemsWrapper");var e=window.matchMedia("(max-device-width: 415px)"),n=window.matchMedia("(max-width: 600px)");(e.matches||n.matches)&&(t.style.marginTop="3rem");for(var r=0;r<this.items.length;r++){var o=this.items[r];t.appendChild(o.render())}var i=document.createElement("div");return i.style.width=this.obj.isSide?"333px":"100%",i.style.background=this.obj.background||"white",i.style.display="flex",i.style.justifyContent="center",i.style.alignItems="center",i.style.height="100%",i.setAttribute("id","outerItemsWrapper"),i.appendChild(t),this.obj.customStyle&&(t.style.width="auto",t.style.top="0rem",t.style.borderRadius="1rem",t.style.background=this.obj.background||"white",t.style.margin="1rem",t.style.position="absolute",t.style.opacity=.8),i}}])&&Nt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Ht(t){return Ht="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},Ht(t)}function Xt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return qt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function qt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Jt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Vt(r.key),r)}}function Vt(t){var e=function(t){if("object"!=Ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ht(e)?e:e+""}function $t(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($t=function(){return!!t})()}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yt(t)}function Qt(t,e){return Qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qt(t,e)}"undefined"!=typeof window&&(window.CustomDivRenderer=Gt);var Kt=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=Yt(e),function(t,e){if(e&&("object"==Ht(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,$t()?Reflect.construct(e,n||[],Yt(t).constructor):e.apply(t,n))}(this,e)}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&&Qt(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(t){return this.obj=t,this.setTags(this.obj.tags),this.animate=void 0===this.obj.animate||this.obj.animate,this.res=this.createSideNav(t),this.res.style.position="relative",this.res.style.zIndex=3,this.closed=!0,this}},{key:"toggleSideNav",value:function(t){var e=this;this.closed=!this.closed;var n=this.res.children[0];if(this.closed)if(n.style.overflowX="hidden",t.style.opacity=1,this.animate){this.ope=n.animate([{transform:"translateX(0)"},{transform:"translateX(100%)"}],{duration:300,fill:"forwards"}),this.ope.finished.then(function(){var t=new CustomEvent(e.obj.tags.close);window.dispatchEvent(t)});var r,o=-1,i=Xt(n.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(o+=1,this.masterEL[o]){var s,l=Xt(a.children);try{for(l.s();!(s=l.n()).done;){var c=s.value,u=this.masterEL[o].options.animation;u&&this.mappedIDS.includes(c.id)&&c.animate(u.op.keyframesClose,u.op.closeOptions)}}catch(t){l.e(t)}finally{l.f()}}}}catch(t){i.e(t)}finally{i.f()}}else n.style.display="none";else{n.style.overflowX="none";var f,d=-1,h=Xt(n.children);try{for(h.s();!(f=h.n()).done;){var p=f.value;d+=1;var y,m=Xt(p.children);try{for(m.s();!(y=m.n()).done;){var v=y.value;if(this.mappedIDS.includes(v.id)&&void 0!==this.masterEL[0]){var b=this.masterEL[d].options.animation;if(b){var g=b.op.openOptions;g.delay||(g.delay=1),g.duration||(g.duration=300),v.animate(b.op.keyframesOpen,g)}}}}catch(t){m.e(t)}finally{m.f()}}}catch(t){h.e(t)}finally{h.f()}t.style.opacity=0,this.animate?(n.style.display="flex",this.opeClose=n.animate([{transform:"translateX(100%)"},{transform:"translateX(0)"}],{duration:300,fill:"forwards"}),this.opeClose.finished.then(function(){var t=new CustomEvent(e.obj.tags.open);window.dispatchEvent(t)})):n.style.display="flex"}}},{key:"createToggleButton",value:function(t){var e=document.createElement("button");return e.innerText="☰",e.style.padding="10px 20px",e.style.backgroundColor="transparent",e.style.color=null!=t?t:"#3498db",e.style.border="none",e.style.borderRadius="5px",e.style.cursor="pointer",e.style.zIndex=1,e.style.fontSize="1.6rem",this.obj.fixed&&(e.style.position="fixed"),e}},{key:"createCloseButton",value:function(t){var e=document.createElement("button");return e.innerText="×",e.style.fontSize="1.6rem",e.style.padding="10px 20px",e.style.backgroundColor="transparent",e.style.color=null!=t?t:"black",e.style.border="none",e.style.borderRadius="5px",e.style.cursor="pointer",e.style.zIndex=1,e.style.alignSelf="flex-end",e}},{key:"createSideNav",value:function(t){var e=this,n=document.createElement("div");n.style.display="flex",n.style.justifyContent="flex-end";var r=document.createElement("div");r.style.display="none",r.style.background=this.obj.background||"#1abc9c",r.style.height="100%",window.matchMedia("(max-device-width: 415px)").matches?r.style.width="100%":r.style.width=this.obj.width||"400px",r.style.position="fixed",r.style.right=0,this.animate&&(r.style.transform="translateX(100%)"),r.style.flexDirection="column",r.style.justifyContent="flex-start";var o=this.createToggleButton(this.obj.hamColour.opened),i=this.createCloseButton(this.obj.hamColour.closed);return o.addEventListener("click",function(){return e.toggleSideNav(o)}),i.addEventListener("click",function(){return e.toggleSideNav(o)}),r.appendChild(i),n.appendChild(r),n.appendChild(o),n}},{key:"items",value:function(t){this.masterEL=t.items.filter(function(t){return void 0!==t.link});var e=t.items.filter(function(t){return void 0===t.items}).map(function(t){return t.id});if(this.mappedIDS=e,this.item=t,this.res.children[0].appendChild(t.render()),void 0!==this.masterEL[0]){var n=this.masterEL[0].options.animation;if(n){var r,o=Xt(this.res.children[0].children);try{for(o.s();!(r=o.n()).done;){var i,a=Xt(r.value.children);try{for(a.s();!(i=a.n()).done;){var s=i.value;this.mappedIDS.includes(s.id)&&(n.op.closeOptions.delay=0,s.animate(n.op.keyframesClose,n.op.closeOptions))}}catch(t){a.e(t)}finally{a.f()}}}catch(t){o.e(t)}finally{o.f()}}}return this}},{key:"toCode",value:function(){var t="new SideNav().setup(".concat(this.formatObj(this.obj),")");if(this.item){var e=this.item.toCode?this.item.toCode().join(""):this.formatObj(this.item);e=e.replace(/,\s*(\.set\(|\.add\()/g,"\n $1"),t+=".items(".concat(e,")")}return t}},{key:"formatObj",value:function(t){return JSON.stringify(t,null,2).replace(/"(\w+)"\s*:/g,"$1:")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}])&&Jt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Zt(t){return Zt="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},Zt(t)}function te(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ee(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ne(r.key),r)}}function ne(t){var e=function(t){if("object"!=Zt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Zt(e)?e:e+""}function re(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(re=function(){return!!t})()}function oe(t){return oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oe(t)}function ie(t,e){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ie(t,e)}var ae=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=oe(e),function(t,e){if(e&&("object"==Zt(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,re()?Reflect.construct(e,n||[],oe(t).constructor):e.apply(t,n))}(this,e)).res=document.createElement("div"),t.res.style.display="grid",t.attributes={},t}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&&ie(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){return this.options=t,this.attributes=t,this.templateCols=t.templateCols,t.templateCols&&(this.res.style.gridTemplateColumns="repeat(".concat(t.templateCols.cols,", 1fr)"),this.res.style.gridTemplateRows="repeat(".concat(t.templateCols.cols,", 1fr)")),this.res.style.height=t.height?t.height:"600px",t.positions&&(this.storedPositions=t.positions),this}},{key:"generateGridPositions",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,o=document.createElement("div");o.classList.add("container"),o.style.display="grid",o.style.gridTemplateColumns="repeat(".concat(r,", 1fr)"),o.style.gridTemplateRows="repeat(".concat(n,", 1fr)"),o.style.width="100%",o.style.height="100vh";var i=t.map(function(t,e){return{row:Math.floor(n/2)+e,col:Math.floor(r/2)+e}});return t.forEach(function(o,a){var s=i[a],l=s.row,c=s.col,u=function(e){var n=0,r=0;return t.forEach(function(t,o){var a=t.weight,s=t.direction,l=i[e],c=i[o],u=l.col-c.col,f=l.row-c.row,d=a*(1/(Math.sqrt(u*u+f*f)+1));switch(s){case"L":n-=d;break;case"R":n+=d;break;case"U":r-=d;break;case"B":r+=d}}),{forceX:n,forceY:r}}(a),f=u.forceX,d=u.forceY;c=Math.max(1,Math.min(r,c+Math.round(f))),l=Math.max(1,Math.min(n,l+Math.round(d)));var h=e.items.filter(function(t){return t.id===o.attract.slice(1)})[0].render();h.style.gridRowStart=l,h.style.gridColumnStart=c,h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.fontWeight="bold",e.res.appendChild(h)}),this}},{key:"add",value:function(t){this.items=t;var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return te(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.res.appendChild(r.render())}}catch(t){n.e(t)}finally{n.f()}return this.storedPositions&&this.generateGridPositions(this.storedPositions),this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=X(this.options,4),e="";return e+=".add([\n",e+=this.items.map(function(t){return t.toCode().join("").trim()}).join(",\n"),e+="\n])",["new Free().set(".concat(t,")").concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&ee(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function se(t){return se="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},se(t)}function le(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ce(r.key),r)}}function ce(t){var e=function(t){if("object"!=se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==se(e)?e:e+""}function ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ue=function(){return!!t})()}function fe(t){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fe(t)}function de(t,e){return de=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},de(t,e)}var he=function(t){function e(t){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,n){return e=fe(e),function(t,e){if(e&&("object"==se(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,ue()?Reflect.construct(e,n||[],fe(t).constructor):e.apply(t,n))}(this,e)).url=t,n.res=null,n.setup(),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&&de(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){this.res=document.createElement("audio"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&le(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function pe(t){return pe="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},pe(t)}function ye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,me(r.key),r)}}function me(t){var e=function(t){if("object"!=pe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pe(e)?e:e+""}function ve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ve=function(){return!!t})()}function be(){return be="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ge(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},be.apply(null,arguments)}function ge(t){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ge(t)}function we(t,e){return we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},we(t,e)}var xe=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=ge(e),function(t,e){if(e&&("object"==pe(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,ve()?Reflect.construct(e,n||[],ge(t).constructor):e.apply(t,n))}(this,e)).res=document.createElement("code"),t.pre=document.createElement("pre"),t.res.style.background="#18232e",t.res.style.display="block",t.res.style.width="auto",t.res.style.height="auto",t.res.style.borderRadius="1rem",t.pre.appendChild(t.res),t}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&&we(t,e)}(e,t),n=e,r=[{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"toCode",value:function(){var t=this.options;Object.keys(t).forEach(function(e){return void 0===t[e]&&delete t[e]});var e=JSON.stringify(t,null,2).replace(H(),"$1:").replace(/"([^"]+)"/g,function(t,e){return e.includes("\n")||e.includes("'")||e.includes('"')?"`"+e.replace(/`/g,"\\`")+"`":'"'.concat(e,'"')});return"new Code().set(".concat(e,")")}},{key:"callReact",value:function(t){this.options=t;var n,r,o,i=[],a=t.transform&&"object"===pe(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||a){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&(n=e,r=this,"function"==typeof(o=be(ge(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var s=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,a?t.transform:void 0];s=s.filter(function(t){return null!=t});for(var l=0;l<s.length;l++)i.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];t.borderObj&&c.push("border"),t.background&&c.push("background"),t.mar&&c.push("margin"),t.animation&&c.push("animation"),t.span&&c.push("span"),this.chainReact(i,t.id,c)}}},{key:"set",value:function(t){return t.code&&(this.pre.children[0].innerHTML=t.code),t.class&&this.pre.children[0].setAttribute("class","".concat(t.class)),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.resprop&&this.resprop(t.resprop),t.width&&(this.res.style.width=t.width),t.background&&(this.res.style.background=t.background),t.color&&(this.res.style.color=t.color),t.borderRadius&&(this.res.style.background=t.borderRadius),t.borderObj&&(this.res.style.border="".concat(t.borderObj.width," solid ").concat(t.borderObj.color),this.res.style.borderRadius="".concat(t.borderObj.radius)),this.callReact(t),this}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.pre),this.res}}],r&&ye(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function ke(t){return ke="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},ke(t)}function Oe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Se(r.key),r)}}function Se(t){var e=function(t){if("object"!=ke(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ke(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ke(e)?e:e+""}function Ee(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ee=function(){return!!t})()}function je(t){return je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},je(t)}function Te(t,e){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Te(t,e)}var _e=function(t){function e(t){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,n){return e=je(e),function(t,e){if(e&&("object"==ke(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,Ee()?Reflect.construct(e,n||[],je(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,n.res=null,n.st=t,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&&Te(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){var t=document.createElement("div");return t.style.display="grid",this.res=t,this.st&&this.sticky(),this}},{key:"set",value:function(t){return this.setup(),t.height&&(this.res.style.height=t.height),t.sticky&&this.sticky(),this}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"add",value:function(t){this.children=t;for(var e=0;e<t.length;e++){var n=t[e].render();n.style.gridColumn=1,n.style.gridRow=1,this.res.appendChild(n)}return this}},{key:"toCode",value:function(){var t="new Stack().set({})";if(this.children.length>0){var e=this.children.map(function(t){return t.toCode()}).join(",\n");t+=".add([\n \n ".concat(e," \n \n])")}return[t]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector("body").style.margin=0,document.querySelector("body").style.padding=0,document.querySelector(t).appendChild(this.res)}}])&&Oe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Ce(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ae(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Pe(t){return Pe="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},Pe(t)}function Ae(t,e){if(t){if("string"==typeof t)return Re(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(t,e):void 0}}function Re(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fe(r.key),r)}}function Fe(t){var e=function(t){if("object"!=Pe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pe(e)?e:e+""}function Ie(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ie=function(){return!!t})()}function De(){return De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Le(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},De.apply(null,arguments)}function Le(t){return Le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Le(t)}function ze(t,e){return ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ze(t,e)}var We=function(t){function e(t){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,n){return e=Le(e),function(t,e){if(e&&("object"==Pe(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,Ie()?Reflect.construct(e,n||[],Le(t).constructor):e.apply(t,n))}(this,e)).res=null,n.setup(t),n.code=[],n.isLast=!1,n.constrObj=t,n.code.push("\n new Wrapper() \n"),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&&ze(t,e)}(e,t),n=e,r=[{key:"toCode",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var n=" ".repeat(e),r="".concat(n,'new Wrapper("').concat(this.constrObj,'")');if(this.constrObj||(r="".concat(n,"new Wrapper()")),Object.keys(this.obj).length){var o=X(Object.fromEntries(Object.entries(this.obj).filter(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||Ae(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]})),2);r+="\n".concat(n," .set(").concat(o,")")}return null!==(t=this.items)&&void 0!==t&&t.length&&(r+="\n".concat(n," .add([\n")+this.items.map(function(t){return t.toCode(e+4)}).join(",\n")+"\n".concat(n," ])")),[r+="\n".concat(n)]}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(t){this.obj=t,this.commonMethods(t),t.onTap&&this.onTap(t.onTap);var n=".set({";t.isHidden&&this.isHidden(t.isHidden),t.scale&&(this.res.style.scale=t.scale),t.scale&&(n+="scale: ".concat(t.scale)),t.keySet&&this.keySet(t.keySet),t.resprop&&this.resprop(t.resprop),t.position&&(this.res.style.position=t.position),void 0!==t.top&&(this.res.style.top=t.top),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.gpos&&this.gpos(t.gpos);var r,o,i,a=[],s=t.transform&&"object"===Pe(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||s){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&(r=e,o=this,"function"==typeof(i=De(Le(1&3?r.prototype:r),"setAny",o))?function(t){return i.apply(o,t)}:i)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var l=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,s?t.transform:void 0];l=l.filter(function(t){return null!=t});for(var c=0;c<l.length;c++)a.push({range:l[c].range,log:l[c].op.name,target:l[c].target,op:l[c].op});var u=[];t.borderObj&&u.push("border"),t.background&&u.push("background"),t.mar&&u.push("margin"),t.animation&&u.push("animation"),t.span&&u.push("span"),s&&u.push("transform"),t.gradient&&u.push("gradient"),t.blast,this.options=t,this.chainReact(a,this.options.id,u)}if(t.centerColumn&&this.deprecatedOption("centerColumn",'center: "x"'),t.mboth&&(this.deprecatedOption("mboth",'mar: "center"'),this.mar("center")),t.mar&&this.mar(t.mar),t.sticky&&this.sticky(),t.transition&&(this.res.style.transition=t.transition),t.class&&this.res.setAttribute("class",t.class),t.ga&&(this.res.style.gridArea=t.ga),t.opacity&&(0==t.opacity&&(this.res.style.opacity=0),t.opacity&&(this.res.style.opacity=t.opacity)),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.id&&this.res.setAttribute("id",t.id),t.simpleCenter&&this.deprecatedOption("simpleCenter","center: true"),t.filter&&(this.res.style.backdropFilter="blur(3px)"),t.radius&&this.corner(t.radius),t.radius&&(n+='\n radius: "'.concat(t.radius,'",')),t.border&&this.border(t.border),t.simpleBorder&&(this.res.style.border=t.simpleBorder),t.width&&this.width(t.width),t.width&&(n+='\n width: "'.concat(t.width,'",')),t.overflow&&(n+='\n overflow: "'.concat(t.overflow,'",')),t.height&&this.heightNoAuto(t.height),t.height&&(n+='\n height: "'.concat(t.height,'",')),t.align&&this.flexAlign(t.align),t.align&&(n+='\n align: "'.concat(t.align,'",')),t.borderObj&&(this.res.style.border="".concat(t.borderObj.width," solid ").concat(t.borderObj.color),void 0!==t.borderObj.radius&&(this.res.style.borderRadius=t.borderObj.radius)),t.borderObja&&(this.res.style.border="".concat(t.borderObja.width," solid ").concat(t.borderObja.color),void 0!==t.borderObja.radius&&(this.res.style.borderRadius=t.borderObja.radius)),t.font&&this.font(t.font),t.font&&(n+='font: "'.concat(t.font,'",')),t.maxWidth&&this.maxWidth(t.maxWidth),t.flexCenter&&this.deprecatedOption("flexCenter",'center: "y"'),t.color&&this.color(t.color),t.background&&this.background(t.background),t.background&&(n+='background: "'.concat(t.background,'",')),t.weight&&this.weight(t.weight),t.area&&this.setArea(t.area),t.area&&(n+='area: "'.concat(t.area,'"')),t.column&&this.makeCol(),t.column&&(n+='\n column: "'.concat(t.column,'",')),t.alignIts&&(this.res.style.background="gray"),t.alignIts&&(this.res.style.alignItems="flex-start"),t.alignIts&&(this.res.style.justifyItems="flex-start"),t.customAlign&&(this.res.style.alignItems=t.customAlign),t.customJustify&&(this.res.style.justifyItems=t.customJustify),t.disp&&(this.res.style.display=t.disp),t.flexDir&&(this.res.style.flexDirection=t.flexDir),t.flexDir&&(this.res.style.display="flex"),t.flexDir&&(n+='\n flexDir: "'.concat(t.flexDir,'",')),t.center&&(n+="center: ".concat(JSON.stringify(t.center),",")),t.zIndex&&(this.res.style.zIndex=t.zIndex),t.transform&&"object"===Pe(t.transform)&&this.reactOnTransform(t.transform),t.name&&(this.name=t.name),t.responsive&&this.rsp(t.responsive),t.stretch){t.stretch&&this.stretch(t.stretch);var f=this.removeQuotesFromFirstWord(JSON.stringify(t.stretch));n+="\n stretch: ".concat(f,",")}for(var d in t)if("margin"===d){var h=t[d];if(Array.isArray(h)&&h.length>0){var p,y=Ce(h);try{for(y.s();!(p=y.n()).done;){var m=p.value;m.hasOwnProperty("top")&&(this.res.style.marginTop=m.top),m.hasOwnProperty("right")&&(this.res.style.marginRight=m.right),m.hasOwnProperty("bottom")&&(this.res.style.marginBottom=m.bottom),m.hasOwnProperty("left")&&(this.res.style.marginLeft=m.left)}}catch(t){y.e(t)}finally{y.f()}}}return 8===(n+="})\n").length&&(n=""),this.code.push(n),this}},{key:"rsp",value:function(t){var e=this;this.res.style.display="flex";var n=t.sequence.split("-"),r=function(){var r=t.ranges;"0px"!==r[0]&&r.unshift("0px");for(var o=0;o<r.length-1;o++)(window.matchMedia("(min-width: ".concat(r[o],") and (max-width: ").concat(r[o+1],")")).matches||window.matchMedia("(min-width: ".concat(r[r.length-1],")")).matches)&&("row"===n[o]&&(e.res.style.flexDirection="row",e.res.style.border="3px solid green"),"col"===n[o]&&(e.res.style.flexDirection="column",e.res.style.border="3px solid purple"));return e};window.addEventListener("resize",r),r()}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=0,this}},{key:"toSticky",value:function(){return this.res.style.position="sticky",this.res.style.top="0",this}},{key:"stretch",value:function(t){var e=this,n=function(){window.matchMedia("(max-width: ".concat(t.at,")")).matches?e.res.style.width="auto":window.matchMedia("(max-device-width: 415px)").matches?e.res.style.width="100%":e.res.style.width=t.backTo};n(),window.addEventListener("resize",n)}},{key:"makeCol",value:function(){return this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="flex-start",this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"flexAlign",value:function(t){return this.res.style.display="flex",this.res.style.justifyContent="flex-start",this.res.style.alignItems="flex-start","center"===t?(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.alignItems="center",this):this}},{key:"heightNoAuto",value:function(t){return this.res.style.height=t,this}},{key:"border",value:function(t){return this.res.style.borderRadius="".concat(t.radius,"px"),this.res.style.border="".concat(t.width,"px solid ").concat(t.color),this}},{key:"add",value:function(t){this.items=t,this.code.push(".add([ \n");var e=t.map(function(e,n){return e.toCode().flatMap(function(t){return t}).join("")+(n<t.length-1?",":"")}).join("");this.code.push(e);for(var n=0;n<t.length;n++)if(void 0!==t[n]&&void 0!==t[n].toCode){var r=t[n].render();this.res.appendChild(r)}return this.code.push("])"),this}},{key:"setWidth",value:function(t){this.res.style.width="100vw"}},{key:"setHeight",value:function(t){return this.res.style.height="".concat(t),this}},{key:"setup",value:function(t){var e=null;return t?(t.isLink&&(e=document.createElement("a")),"aside"===t&&(e=document.createElement("aside")),"article"===t&&(e=document.createElement("article")),"main"===t&&(e=document.createElement("main")),"section"===t&&(e=document.createElement("section")),"header"===t&&(e=document.createElement("header")),"footer"===t&&(e=document.createElement("footer"))):e=document.createElement("div"),t&&t.isLink&&(e.style.textDecoration="none",e.setAttribute("href",t.child)),this.res=e,this.res.style.margin=0,this.res.style.padding=0,t&&!0===t.hideOverflow&&(this.res.style.overflow="hidden",this.res.style.overflowY="scroll"),t&&!0===t.center&&(this.res.style.display="flex",this.res.style.flexDirection="column",this.res.style.justifyContent="center",this.res.style.alignItems="center"),t&&"left"===t.align&&(this.res.style.alignItems="flex-start"),t&&"right"===t.align&&(this.res.style.alignItems="flex-end"),t&&t.height&&(this.res.style.height=t.height),t&&t.width&&(this.res.style.width=t.width,this.res.style.marginLeft="auto",this.res.style.marginRight="auto",window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="95%")),this}},{key:"height",value:function(t){return this.res.style.width="auto",this.res.style.height="".concat(t),this}},{key:"dimensions",value:function(t,e){return this.w=t,this.h=e,this.w?this.res.style.width=this.w:this.res.style.width=window.innerWidth,this.h?this.res.style.height=this.h:this.res.style.height=window.innerHeight,this}},{key:"size",value:function(t,e){return this.deprecatedOption("size() on this component","dimensions(w, h)"),this.dimensions(t,e)}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"corner",value:function(t){return this.res.style.borderRadius=t,this}},{key:"apply",value:function(t){var e=this,n=function(){for(var n=0;n<t.length;n++){var r=t[n],o=window.matchMedia("(max-width: ".concat(r.width,"px)"));r.device&&(o=window.matchMedia("(max-device-width: ".concat(r.width,"px)"))),o.matches&&Object.assign(e.res.style,r.styles)}},r=window.matchMedia("(max-width: ".concat(t[0].width,"px)"));return t[0].device&&(r=window.matchMedia("(max-device-width: ".concat(t[0].width,"px)"))),r.matches||Object.assign(this.res.style,t[0].styles),n(),window.addEventListener("resize",n),this}},{key:"mount",value:function(t){document.querySelector(t).appendChild(this.res)}},{key:"render",value:function(t){return t?(document.querySelector("#mount"),document.querySelector(t).appendChild(this.res),this):this.res}}],r&&Me(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Be(t){return Be="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},Be(t)}function Ne(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ue(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ge(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,He(r.key),r)}}function He(t){var e=function(t){if("object"!=Be(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Be(e)?e:e+""}function Xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Xe=function(){return!!t})()}function qe(){return qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Je(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},qe.apply(null,arguments)}function Je(t){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Je(t)}function Ve(t,e){return Ve=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ve(t,e)}var $e=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Je(e),function(t,e){if(e&&("object"==Be(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,Xe()?Reflect.construct(e,n||[],Je(t).constructor):e.apply(t,n))}(this,e)).res=document.createElement("table"),t.res.style.borderCollapse="separate",t.res.style.borderSpacing="0",t.res.style.overflow="hidden",t}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&&Ve(t,e)}(e,t),n=e,r=[{key:"add",value:function(t){this.data=t,this.datas=t;var e=Object.keys(t[0]);return this.generateTable(this.res,t),this.generateTableHead(this.res,e),this}},{key:"style",value:function(t){return t.font&&(this.res.style.fontFamily=t.font),this}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(t){return t.cellPadding&&this.cellPadding(t.cellPadding),t.cellAlign&&this.cellAlign(t.cellAlign),t.style&&this.style(t.style),t.headStyle&&this.headStyle(t.headStyle),t.border&&this.border(t.border),t.center&&this.center(t.center),t.borderRadius&&this.borderRadius(t.borderRadius),t.gradient&&(this.res.style.background=t.gradient.op.gradient,this.res.style.backgroundClip="padding-box"),this.obj=t,this.options=t,this.callReact(t),this}},{key:"callReact",value:function(t){var n,r,o,i=[];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&&(n=e,r=this,"function"==typeof(o=qe(Je(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var a=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,t.transform];a=a.filter(function(t){return null!=t});for(var s=0;s<a.length;s++)i.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];t.borderObj&&l.push("border"),t.background&&l.push("background"),t.mar&&l.push("margin"),t.animation&&l.push("animation"),t.span&&l.push("span"),l.push("border"),this.chainReact(i,this.options.id,l)}}},{key:"toCode",value:function(){var t=JSON.stringify(this.data,null,2),e=JSON.stringify(this.obj,null,2);return t=t.replace(/"(\w+)"\s*:/g,"$1:"),e=e.replace(/"(\w+)"\s*:/g,"$1:"),["new Table()\n .add(".concat(t,")\n .set(").concat(e,")")]}},{key:"borderRadius",value:function(t){return this.res.style.borderRadius="".concat(4*t,"px"),this.res.style.overflow="hidden",this}},{key:"cellPadding",value:function(t){var e,n=Ne(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,o=Ne(e.value.cells);try{for(o.s();!(r=o.n()).done;)r.value.style.padding=t}catch(t){o.e(t)}finally{o.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"cellAlign",value:function(t){var e,n=Ne(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,o=Ne(e.value.cells);try{for(o.s();!(r=o.n()).done;)r.value.style.textAlign=t}catch(t){o.e(t)}finally{o.f()}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"headStyle",value:function(t){var e=this.res.rows[0];return e&&(e.style.color=t.color,t.background&&(e.style.backgroundColor=t.background)),this}},{key:"border",value:function(t){var e;this.res.style.borderCollapse="separate",this.res.style.borderSpacing="0",this.res.style.border=t,this.res.style.borderRadius="12px";var n,r=Ne(this.res.rows);try{for(r.s();!(n=r.n()).done;){var o,i=Ne(n.value.cells);try{for(i.s();!(o=i.n()).done;)o.value.style.border="none"}catch(t){i.e(t)}finally{i.f()}}}catch(t){r.e(t)}finally{r.f()}for(var a=0;a<this.res.rows.length-1;a++){var s,l=Ne(this.res.rows[a].cells);try{for(l.s();!(s=l.n()).done;)s.value.style.borderBottom=t}catch(t){l.e(t)}finally{l.f()}}var c,u=(null===(e=this.res.rows[0])||void 0===e?void 0:e.cells.length)||0,f=Ne(this.res.rows);try{for(f.s();!(c=f.n()).done;)for(var d=c.value,h=0;h<u-1;h++)d.cells[h].style.borderRight=t}catch(t){f.e(t)}finally{f.f()}return this}},{key:"generateTableHead",value:function(t,e){var n,r=t.createTHead().insertRow(),o=Ne(e);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=document.createElement("th");a.textContent=i,r.appendChild(a)}}catch(t){o.e(t)}finally{o.f()}}},{key:"generateTable",value:function(t,e){var n,r=Ne(e);try{for(r.s();!(n=r.n()).done;){var o=n.value,i=t.insertRow();for(var a in o)i.insertCell().textContent=o[a]}}catch(t){r.e(t)}finally{r.f()}}},{key:"render",value:function(t){var e=document.createElement("div");if(e.style.overflowX="auto",e.appendChild(this.res),!t)return e;document.querySelector(t).appendChild(e)}}],r&&Ge(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Ye(t){return Ye="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},Ye(t)}function Qe(t,e){if(t){if("string"==typeof t)return Ke(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ke(t,e):void 0}}function Ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ze(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tn(r.key),r)}}function tn(t){var e=function(t){if("object"!=Ye(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ye(e)?e:e+""}function en(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(en=function(){return!!t})()}function nn(t){return nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nn(t)}function rn(t,e){return rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rn(t,e)}var on=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=nn(e),function(t,e){if(e&&("object"==Ye(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,en()?Reflect.construct(e,n||[],nn(t).constructor):e.apply(t,n))}(this,e)).res=document.createElement("div"),t.res.style.position="relative",t.toggleWrap=document.createElement("div"),t.toggleWrap.style.zIndex=9999,t.toggleWrap.style.borderRadius="0.3rem",t.toggleWrap.style.cursor="pointer",t.toggleWrap.style.display="flex",t.toggleWrap.style.alignItems="center",t.toggleWrap.style.justifyContent="center",t.res.appendChild(t.toggleWrap),t.contentWrap=document.createElement("div"),t.contentWrap.style.position="fixed",t.contentWrap.style.background="#ecf0f1",t.contentWrap.style.borderRadius="0.3rem",t.contentWrap.style.boxShadow="0 2px 5px rgba(0, 0, 0, 0.15)",t.contentWrap.style.width="250px",t.contentWrap.style.display="none",t.contentWrap.style.zIndex=99999,document.addEventListener("DOMContentLoaded",function(){document.body.appendChild(t.contentWrap)}),document.body&&document.body.appendChild(t.contentWrap),t.styles={},t.children=[],t.isExpanded=!1,t}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&&rn(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){var e=this;this.options=t,t.title&&(this.toggleWrap.textContent=t.title),t.width&&(this.toggleWrap.style.width=t.width),t.contentWidth&&(this.contentWrap.style.width=t.contentWidth),t.background&&(this.contentWrap.style.backgroundColor=t.background),t.radius&&(this.contentWrap.style.borderRadius=t.radius);var n=function(){var t=e.toggleWrap.getBoundingClientRect(),n=e.contentWrap.style.display,r=e.contentWrap.style.visibility;"none"===n&&(e.contentWrap.style.visibility="hidden",e.contentWrap.style.display="block");var o=e.contentWrap.getBoundingClientRect();"none"===n&&(e.contentWrap.style.display=n,e.contentWrap.style.visibility=r||"");var i=window.innerWidth,a=t.left+t.width/2-o.width/2;a<8&&(a=8),a+o.width>i-8&&(a=i-8-o.width),a<8&&(a=8),e.contentWrap.style.top=t.bottom+4+"px",e.contentWrap.style.left=a+"px"};this._positionContent=n;var r=function(){"none"!==e.contentWrap.style.display&&n()};if(window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),t.behaviour){var o=t.behaviour;if("mouseover"===o||"mouseenter"===o){var i,a=function(){clearTimeout(i),e.contentWrap.style.display="block",n()},s=function(){i=setTimeout(function(){e.contentWrap.style.display="none"},200)};this.toggleWrap.addEventListener("mouseenter",a),this.toggleWrap.addEventListener("mouseleave",s),this.contentWrap.addEventListener("mouseenter",a),this.contentWrap.addEventListener("mouseleave",s),this.toggleWrap.addEventListener("click",function(t){t.stopPropagation(),"block"===e.contentWrap.style.display?e.contentWrap.style.display="none":(e.contentWrap.style.display="block",n())}),document.addEventListener("click",function(t){"block"!==e.contentWrap.style.display||e.contentWrap.contains(t.target)||e.toggleWrap.contains(t.target)||(e.contentWrap.style.display="none")})}else"click"===o?this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&n()}):this.res.addEventListener(o,function(){e.contentWrap.style.display="block",n()})}else this.res.addEventListener("click",function(){e.toggle(),"block"===e.contentWrap.style.display&&n()});return t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),this}},{key:"add",value:function(t){var e,n=this;if(!Array.isArray(t))throw new Error("The 'add' method expects an array of children.");if(t.forEach(function(t,e){if(0!==e){if(!(t.res instanceof HTMLElement))throw new Error("Each child must have a valid 'element' property that is an HTMLElement.");n.contentWrap.appendChild(t.res)}}),!this.options||!this.options.title){var r=t[0];r&&r.res&&this.toggleWrap.appendChild(r.res)}return(e=this.children).push.apply(e,function(t){return function(t){if(Array.isArray(t))return Ke(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Qe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t)),this}},{key:"toggle",value:function(){this.isExpanded=!this.isExpanded,this.contentWrap.style.display=this.isExpanded?"block":"none"}},{key:"toCode",value:function(){var t=this,e=this.options?Object.entries(this.options).map(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||Qe(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),n=e[0],r=e[1];return"string"==typeof r?"".concat(n,': "').concat(r,'"'):"object"===Ye(r)?"".concat(n,": ").concat(JSON.stringify(r)):"".concat(n,": ").concat(r)}).join(",\n "):"",n=this.children.map(function(e,n){return e.toCode().flatMap(function(t){return t}).join("")+(n<t.children.length-1?",":"")}).join("");return["new Dropdown().set({\n ".concat(e,"\n}).add([\n ").concat(n,"\n])")]}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.res),this.res}}],r&&Ze(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function an(t){return an="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},an(t)}function sn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ln(r.key),r)}}function ln(t){var e=function(t){if("object"!=an(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=an(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==an(e)?e:e+""}function cn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(cn=function(){return!!t})()}function un(t){return un=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},un(t)}function fn(t,e){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fn(t,e)}var dn=function(t){function e(t){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,n){return e=un(e),function(t,e){if(e&&("object"==an(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,cn()?Reflect.construct(e,n||[],un(t).constructor):e.apply(t,n))}(this,e)).text=t,n.res=null,n.valid=!1,n.setup(),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&&fn(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("input");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.padding=".4rem .75rem",this.res.style.fontSize="1rem",window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"set",value:function(t){var e;return this.options=t,this.res.setAttribute("type",null!==(e=t.type)&&void 0!==e?e:"text"),t.placeholder&&(this.res.placeholder=t.placeholder),t.name&&this.res.setAttribute("name",t.name),t.id&&this.res.setAttribute("id",t.id),t.required&&this.res.setAttribute("required",""),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.exact&&(this.res.style.fontSize=t.exact),t.radius&&this.round(t.radius),t.color&&(this.res.style.color=t.color),t.background&&(this.res.style.background=t.background),t.font&&(this.res.style.fontFamily=t.font),t.weight&&(this.res.style.fontWeight=t.weight),t.bold&&(this.res.style.fontWeight="bold"),t.theme&&this.theme(t.theme),this.commonMethods(t),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new TextField().set(".concat(t,")")]}},{key:"setValid",value:function(t,e){return this.res.style.border=t?"6px solid green":"6px solid red",0===e.length&&(this.res.style.border="none"),this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="3rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"value",value:function(t){return this.res.setAttribute("value",t),this}},{key:"password",value:function(){return this.res.setAttribute("type","password"),this}},{key:"number",value:function(){return this.res.setAttribute("type","number"),this}},{key:"process",value:function(t){return this.res.value}},{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:"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:"placeholder",value:function(t){return this.res.setAttribute("placeholder",t),this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"onChange",value:function(t){var e=this;return this.res.value,this.res.addEventListener("input",function(n){t(e.res.value)}),this}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.res),this.res):this.res}}],r&&sn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function hn(t){return hn="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},hn(t)}function pn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yn(r.key),r)}}function yn(t){var e=function(t){if("object"!=hn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hn(e)?e:e+""}function mn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(mn=function(){return!!t})()}function vn(t){return vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vn(t)}function bn(t,e){return bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},bn(t,e)}var gn=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=vn(e),function(t,e){if(e&&("object"==hn(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,mn()?Reflect.construct(e,n||[],vn(t).constructor):e.apply(t,n))}(this,e)).navbar=document.createElement("nav"),t.navbar.classList.add("desktop-navbar"),t.navbarHeader=document.createElement("div"),t.navbarHeader.classList.add("navbar-header"),t.brand=document.createElement("div"),t.brand.classList.add("navbar-brand"),t.navContent=document.createElement("div"),t.navContent.classList.add("navbar-content"),t.navContent.style.width="100%",t.navContent.style.alignItems="center",t.navbarHeader.appendChild(t.brand),t.navbarHeader.appendChild(t.navContent),t.navbar.appendChild(t.navbarHeader),t.res=t.navbar,t}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&&bn(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){return this.obj=t,this.setStyles(t),t.background&&(this.res.style.backgroundColor=t.background),t.brand&&this.setBrand(t.brand),t.radius&&(this.res.style.borderRadius=t.radius),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.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),this}},{key:"setStyles",value:function(){var t;this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=null!==(t=this.obj.background)&&void 0!==t?t:"#333",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.navContent.style.display="flex",this.navContent.style.gap="1rem"}},{key:"setBrand",value:function(t){return this.brand.innerHTML="",this.brand.appendChild(t),this}},{key:"add",value:function(t){this.items=t;for(var e=0;e<t.length;e++)t[e],this.navContent.appendChild(t[e].render());return this}},{key:"toCode",value:function(){var t=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t});return"new DesktopBar().set(".concat(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),").add([\n ").concat(t.join(","),"\n\n \n \n\n ])")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}])&&pn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function wn(t){return wn="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},wn(t)}function xn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,kn(r.key),r)}}function kn(t){var e=function(t){if("object"!=wn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wn(e)?e:e+""}function On(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(On=function(){return!!t})()}function Sn(){return Sn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=En(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Sn.apply(null,arguments)}function En(t){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},En(t)}function jn(t,e){return jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},jn(t,e)}var Tn=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,n){return e=En(e),function(t,e){if(e&&("object"==wn(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,On()?Reflect.construct(e,n||[],En(t).constructor):e.apply(t,n))}(this,e)}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&&jn(t,e)}(e,t),n=e,r=[{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(H(),"$1:")}},{key:"toCode",value:function(){var t=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t}),e=(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),'\nbackground: "'.concat(this.obj.background,'",\nbrand: ').concat(this.obj.brand.toCode(),",\nmar: ").concat(JSON.stringify(this.obj.mar),",\npad: ").concat(JSON.stringify(this.obj.pad),",\nresmar: ").concat(JSON.stringify(this.obj.resmar),",\nrespad: ").concat(JSON.stringify(this.obj.respad),",\nradius: ").concat(JSON.stringify(this.obj.radius),",\n"));return"new MobileBar().set({".concat(e,"}).add([\n ").concat(t.join(","),"\n\n ])")}},{key:"set",value:function(t){var n,r,o;return this.obj=t,this.obj=t,this.makeNavbar(t),t.mar&&(n=e,r=this,"function"==typeof(o=Sn(En(1&3?n.prototype:n),"mar",r))?function(t){return o.apply(r,t)}:o)([t.mar]),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.radius&&(this.res.style.borderRadius=t.radius),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),this.setStyles(t),this}},{key:"makeNavbar",value:function(t){var e=this,n=t.brand;this.navbar=document.createElement("nav"),this.navbar.classList.add("mobile-navbar"),this.navbarHeader=document.createElement("div"),this.navbarHeader.classList.add("navbar-header"),this.brand=document.createElement("div"),this.brand.classList.add("navbar-brand"),t.brand&&"function"==typeof n.render&&(console.log("Appending brand:",n.render()),this.brand.appendChild(n.render())),this.toggleButton=document.createElement("button"),this.toggleButton.classList.add("navbar-toggle"),this.toggleButton.innerHTML="&#9776;",this.navContent=document.createElement("div"),this.navContent.classList.add("navbar-content"),this.navbarHeader.appendChild(this.brand),this.navbarHeader.appendChild(this.toggleButton),this.navbar.appendChild(this.navbarHeader),this.navbar.appendChild(this.navContent),this.isMobileNavOpen=!1,this.toggleButton.addEventListener("click",function(){e.toggleMobileNav()}),this.res=this.navbar}},{key:"setStyles",value:function(t){var e,n;this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=null!==(e=t.background)&&void 0!==e?e:"orange",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.toggleButton.style.background="none",this.toggleButton.style.border="none",this.toggleButton.style.color=null!==(n=this.hamburgerColour)&&void 0!==n?n:"#34495e",this.toggleButton.style.fontSize="1.5rem",this.toggleButton.style.cursor="pointer",this.navContent.style.display="none"}},{key:"add",value:function(t){this.items=t;for(var e=0;e<t.length;e++){var n=t[e];this.navContent.appendChild(n.render())}return this}},{key:"toggleMobileNav",value:function(){this.isMobileNavOpen=!this.isMobileNavOpen,this.navContent.style.display=this.isMobileNavOpen?"flex":"none",this.isMobileNavOpen?(this.navContent.style.flexDirection="column",this.navContent.style.gap="0.5rem",this.navContent.style.padding="1rem"):(this.navContent.style.flexDirection="",this.navContent.style.gap="",this.navContent.style.backgroundColor="",this.navContent.style.padding="")}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}],r&&xn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function _n(t){return _n="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},_n(t)}function Cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Pn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cn(Object(n),!0).forEach(function(e){An(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function An(t,e,n){return(e=Mn(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Mn(r.key),r)}}function Mn(t){var e=function(t){if("object"!=_n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_n(e)?e:e+""}function Fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fn=function(){return!!t})()}function In(t){return In=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},In(t)}function Dn(t,e){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dn(t,e)}var Ln=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=In(e),function(t,e){if(e&&("object"==_n(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,Fn()?Reflect.construct(e,n||[],In(t).constructor):e.apply(t,n))}(this,e)).breakpoints=[],t.container=null,t.currentView=null,t.internalDiv=null,t.resizeListener=null,t}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&&Dn(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){var e=t.breakpoints,n=t.id,r=t.area;if(this.options={breakpoints:e},this._id=n,this._area=r,!Array.isArray(e))throw new Error("Breakpoints should be an array of objects with 'at' and 'view' properties.");return this.breakpoints=e.map(function(t){if("string"!=typeof t.at||!(t.view.render()instanceof HTMLElement))throw new Error("Each breakpoint must have 'at' as a string and 'view' as an HTMLElement.");return Pn(Pn({},t),{},{at:parseInt(t.at,10)})}),this.breakpoints.sort(function(t,e){return t.at-e.at}),this}},{key:"toCode",value:function(){JSON.stringify(this.options.breakpoints.map(function(t){return t.view.toCode()}).flat(),null,4),JSON.stringify(this.options.breakpoints.map(function(t){return t.at}),null,4),JSON.stringify(this.options.breakpoints,null,4);for(var t="",e=0;e<this.options.breakpoints.length;e++)t+='{ at: "'.concat(this.options.breakpoints[e].at,'", view: ').concat(this.options.breakpoints[e].view.toCode()," }, \n");return["new Switcher().set({\n breakpoints: [\n ".concat(t,"\n ]\n })")]}},{key:"render",value:function(t){return this.internalDiv=document.createElement("div"),this.res=this.internalDiv,this._id&&this.internalDiv.setAttribute("id",this._id),this._area&&(this.internalDiv.style.gridArea=this._area),this.applyView(),this.resizeListener=this.applyView.bind(this),window.addEventListener("resize",this.resizeListener),void 0!==t&&document.querySelector(t).appendChild(this.internalDiv),this.internalDiv}},{key:"createRanges",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:99999,n=[],r=0;r<t.length;r++)n.push({from:t[r],to:r<t.length-1?t[r+1]-1:e});return n}},{key:"addRanges",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:99999;return t.map(function(t,r){var o=e[r],i=r<e.length-1?e[r+1]-1:n;return Pn(Pn({},t),{},{range:{from:o,to:i}})})}},{key:"applyView",value:function(){var t=this,e=(window.innerWidth,this.breakpoints.map(function(t){return t.at})),n=this.breakpoints.map(function(t){return t.at});this.createRanges(n),this.addRanges(this.breakpoints,e).forEach(function(e){var n="(min-width: ".concat(e.range.from,"px) and (max-width: ").concat(e.range.to,"px)");window.matchMedia(n).matches&&t.currentView!==e.view.render()&&(t.internalDiv.innerHTML="",t.internalDiv.appendChild(e.view.render()),t.currentView=e.view.render())})}},{key:"destroy",value:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.internalDiv&&this.container&&this.container.removeChild(this.internalDiv),this.container=null,this.currentView=null,this.internalDiv=null}}],r&&Rn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function zn(t){return zn="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},zn(t)}function Wn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bn(r.key),r)}}function Bn(t){var e=function(t){if("object"!=zn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zn(e)?e:e+""}function Nn(t,e){if(e&&("object"==zn(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)}function Un(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Un=function(){return!!t})()}function Gn(t){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gn(t)}function Hn(t,e){return Hn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hn(t,e)}var Xn=function(t){function e(t){var n,r,o,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),r=this,o=Gn(o=e),(n=Nn(r,Un()?Reflect.construct(o,[],Gn(r).constructor):o.apply(r,i)))._noTheme=!0;var a=document.createElement("div");return a.style.flex="1",n.res=a,n.res.setAttribute("class","innerHider"),Nn(n,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&&Hn(t,e)}(e,t),n=e,(r=[{key:"toCode",value:function(){return["new Spacer(".concat(this.hide,")")]}},{key:"render",value:function(){return this.res}}])&&Wn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function qn(t){return qn="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},qn(t)}function Jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Vn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,$n(r.key),r)}}function $n(t){var e=function(t){if("object"!=qn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qn(e)?e:e+""}function Yn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Yn=function(){return!!t})()}function Qn(t){return Qn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qn(t)}function Kn(t,e){return Kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Kn(t,e)}var Zn=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=Qn(e),function(t,e){if(e&&("object"==qn(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,Yn()?Reflect.construct(e,n||[],Qn(t).constructor):e.apply(t,n))}(this,e)).res=null,t}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&&Kn(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){var e,n;this.options=t;var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center";var o=document.createElement("input");o.type="checkbox",o.style.position="relative",o.style.marginRight="0.5rem";var i=t.size||"24px";o.style.width=i,o.style.height=i,t.customStyle&&(o.style.appearance="none"),o.style.border="2px solid #ccc",o.style.borderRadius="4px",o.style.backgroundColor=t.backgroundColor||"white",o.style.cursor="pointer",o.style.transition="background-color 0.2s ease, border-color 0.2s ease",o.style.display="inline-block",o.style.setProperty("--checked-bg-color",t.checkedBackgroundColor||"#4CAF50"),o.style.setProperty("--checkmark-color","white"),o.style.setProperty("--checkmark-clip-path",null!==(e=this.options.clipPath)&&void 0!==e?e:"polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%)");var a=document.createElement("style");a.textContent='\n input[type="checkbox"] {\n appearance: none;\n -webkit-appearance: none; /* For Safari */\n width: var(--size, 24px);\n height: var(--size, 24px);\n border: 2px solid #ccc;\n border-radius: 4px;\n background-color: white;\n position: relative;\n cursor: pointer;\n transition: background-color 0.2s ease, border-color 0.2s ease;\n }\n\n input[type="checkbox"]:checked {\n background-color: var(--checked-bg-color, #4CAF50);\n border-color: var(--checked-bg-color, #4CAF50);\n }\n\n input[type="checkbox"]::after {\n content: \'\';\n position: absolute;\n width: 50%;\n height: 50%;\n top: 25%;\n left: 25%;\n transform: scale(0);\n background-color: var(--checkmark-color, white);\n clip-path: var(--checkmark-clip-path);\n -webkit-clip-path: var(--checkmark-clip-path);\n transition: transform 0.2s ease;\n }\n\n input[type="checkbox"]:checked::after {\n transform: scale(1);\n }\n',t.customStyle&&document.head.appendChild(a),t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),o.addEventListener("change",function(){o.checked?(o.style.backgroundColor=t.checkedBackgroundColor||"#4CAF50",o.style.borderColor=t.checkedBackgroundColor||"#4CAF50"):(o.style.backgroundColor=t.backgroundColor||"white",o.style.borderColor="#ccc")}),t.name&&o.setAttribute("name",t.name),r.appendChild(o);var s=document.createElement("div");if("function"==typeof(null===(n=t.label)||void 0===n?void 0:n.render))s.appendChild(t.label.render());else{var l=document.createTextNode(t.title||"Label");s.appendChild(l)}return s.style.opacity=.8,s.style.transition="opacity ease 0.2s, transform ease 0.2s",r.appendChild(s),this.res=r,this}},{key:"getValue",value:function(){return this.res.children[0].checked}},{key:"toCode",value:function(){var t=Object.entries(this.options).map(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Jn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(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),n=e[0],r=e[1];return"string"==typeof r?"".concat(n,': "').concat(r,'"'):"object"===qn(r)&&null!==r?"function"==typeof r.toCode?"".concat(n,": ").concat(r.toCode()[0]):"".concat(n,": ").concat(JSON.stringify(r,null,4)):"".concat(n,": ").concat(r)}).join(",\n ");return["new Checkbox().set({\n ".concat(t,"\n})")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Vn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function tr(t){return tr="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},tr(t)}function er(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nr(r.key),r)}}function nr(t){var e=function(t){if("object"!=tr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tr(e)?e:e+""}function rr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(rr=function(){return!!t})()}function or(t){return or=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},or(t)}function ir(t,e){return ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ir(t,e)}"undefined"!=typeof window&&(window.Checkbox=Zn);var ar=function(t){function e(t){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,n){return e=or(e),function(t,e){if(e&&("object"==tr(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,rr()?Reflect.construct(e,n||[],or(t).constructor):e.apply(t,n))}(this,e)).url=t,n.res=null,n.setup(),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&&ir(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){this.res=document.createElement("video"),this.res.setAttribute("src",this.url),this.res.setAttribute("controls","controls")}},{key:"set",value:function(t){return this.options=t,t.radius&&(this.res.style.borderRadius=t.radius),t.width&&(this.res.style.width="".concat(t.width)),t.opacity&&(this.res.style.opacity=t.opacity),this}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return['new Video("'.concat(this.url,'").set(').concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&er(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lr(t){return lr="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},lr(t)}function cr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ur(r.key),r)}}function ur(t){var e=function(t){if("object"!=lr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=lr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lr(e)?e:e+""}function fr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(fr=function(){return!!t})()}function dr(){return dr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=hr(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},dr.apply(null,arguments)}function hr(t){return hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hr(t)}function pr(t,e){return pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pr(t,e)}var yr=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(t,e,n){return e=hr(e),function(t,e){if(e&&("object"==lr(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,fr()?Reflect.construct(e,n||[],hr(t).constructor):e.apply(t,n))}(this,e)).res=null,t.items=[],t.setup(),t}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&&pr(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){return this.options=t,t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),this.commonMethods(t),this.callReact(t),this}},{key:"callReact",value:function(t){var n,r,o,i=[],a=t.transform&&"object"===lr(t.transform);if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||a){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&(n=e,r=this,"function"==typeof(o=dr(hr(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var s=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,a?t.transform:void 0];s=s.filter(function(t){return null!=t});for(var l=0;l<s.length;l++)i.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];t.borderObj&&c.push("border"),t.background&&c.push("background"),t.mar&&c.push("margin"),t.animation&&c.push("animation"),t.span&&c.push("span"),this.chainReact(i,this.options.id,c)}}},{key:"setup",value:function(){var t=document.createElement("ul");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this}},{key:"setItems",value:function(t){this.items=t;var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return sr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;if("string"==typeof r){var o=document.createElement("li");o.textContent=r,this.res.appendChild(o)}else{var i=r.render();this.res.appendChild(i)}}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,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:"border",value:function(t,e){return this.res.style.border="".concat(t,"px solid ").concat(e),this}},{key:"toCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.code=[],this.excludeFromCodeTrue)return[""];var e=" ".repeat(t),n="".concat(e,"new UList()");return this.items&&this.items.length&&(n+="\n".concat(e," .setItems([\n")+this.items.map(function(e){return"string"==typeof e?"".concat(" ".repeat(t+4),'"').concat(e,'"'):e.toCode(t+4)}).join(",\n")+"\n".concat(e," ])")),[n+="\n".concat(e)]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&cr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function mr(t){return mr="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},mr(t)}function vr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,br(r.key),r)}}function br(t){var e=function(t){if("object"!=mr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mr(e)?e:e+""}function gr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gr=function(){return!!t})()}function wr(t){return wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wr(t)}function xr(t,e){return xr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xr(t,e)}var kr=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=function(t,e,n){return e=wr(e),function(t,e){if(e&&("object"==mr(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,gr()?Reflect.construct(e,n||[],wr(t).constructor):e.apply(t,n))}(this,e)).text=t,r.res=null,r.val=n,r.setup(),r}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&&xr(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(t){return this}},{key:"set",value:function(t){this.options=t;var e=document.createElement("button");if(e.style.background="transparent",e.style.border="none",t.img)e.append(t.img.render());else if(t.svg)if("string"==typeof t.svg){var n=(new DOMParser).parseFromString(t.svg,"image/svg+xml").documentElement;e.appendChild(n)}else t.svg instanceof SVGElement&&e.appendChild(t.svg);else if(t.url&&!t.img){var r,o,i=document.createElement("img");i.setAttribute("src",t.url),i.style.width=(null===(r=t.frame)||void 0===r?void 0:r.width)||"50px",i.style.height=(null===(o=t.frame)||void 0===o?void 0:o.height)||"50px",e.appendChild(i)}else{var a=document.createTextNode(this.text.replace("$",this.val));e.appendChild(a)}return this.res=e,this.commonMethods(t),t&&"submit"===t.type&&e.setAttribute("type",t.type),this.border("none"),this.res.style.display="block",t.background&&this.background(t.background),t.padding&&(this.deprecatedOption("padding","pad"),this.pad([{a:t.padding}])),t.margin&&(this.deprecatedOption("margin","mar"),this.mar([{a:t.margin}])),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.centered&&(this.res.style.marginRight="auto",this.res.style.marginLeft="auto",this.res.style.backgroundColor="black"),t.border&&this.border(t.border),t.radius&&this.borderRadius(t.radius),t.class&&this.setClass(t.class),t.color&&this.color(t.color),t.auto&&this.auto(),t.weight&&(this.res.style.fontWeight=t.weight),t.fluidc&&this.fluidButtonCopy(t.fluidc),t.fluidc&&'\n fluidc: "'.concat(t.fluidc,'",'),t.onTap&&this.onTap(t.onTap),t.frame&&this.frame(t.frame),t.frame&&'\n frame: "'.concat(t.frame,'",'),t.keySet&&this.keySet(t.keySet),t.align&&(this.res.style.textAlign=t.align),t.weight&&(this.res.style.fontWeight=t.weight),t.bold&&(this.res.style.fontWeight="bold"),t.width&&(this.res.style.width=t.width),t.exact&&(this.res.style.fontSize=t.exact),this}},{key:"fluidButtonCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("button"),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("button"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("button"),this.res.style.cssText=this.prevStylex.cssText;var a=document.createTextNode(this.text);this.res.appendChild(a),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"borderRadius",value:function(t){return this.res.style.borderRadius=t,this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2.2rem":t.res.style.fontSize="1rem"};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="6rem":t.res.style.fontSize="3rem"};return e(),window.addEventListener("resize",e),this}},{key:"border",value:function(t,e){return"none"===t&&(this.res.style.border="none"),this.res.style.border="".concat(t," solid ").concat(e,"px"),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,this}},{key:"updating",value:function(t,e){var n=this.res,r=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(r.replace("$",t));n.replaceChild(e,n.childNodes[0])}}),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,function(t,e){return"function"==typeof e?e.toString():e},4).replace(/"(\w+)":/g,"$1:").replace(/"(\(\)\s*=>\s*{[^}]*})"/g,"$1").replace(/\\n/g,"").replace(/\\"/g,'"');return['new Button("'.concat(this.text,'").set(').concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&vr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Or(t){return Or="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},Or(t)}function Sr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Er(r.key),r)}}function Er(t){var e=function(t){if("object"!=Or(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Or(e)?e:e+""}function jr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(jr=function(){return!!t})()}function Tr(t){return Tr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tr(t)}function _r(t,e){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_r(t,e)}var Cr=function(t){function e(){var t,n,r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=Tr(r),t=function(t,e){if(e&&("object"==Or(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)}(n,jr()?Reflect.construct(r,o||[],Tr(n).constructor):r.apply(n,o))).el=null,t}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),n=e,(r=[{key:"set",value:function(t){this.options=t;var e=document.createElement("div"),n=document.createElement("label");n.style.position="relative",n.style.display="block";var r=document.createTextNode(t.title);n.appendChild(r),n.style.opacity=0;var o=document.createElement("input");return"textarea"===t.type&&(o=document.createElement("textarea")),o.style.position="relative",o.placeholder=t.title,o.style.fontSize="1rem",o.style.padding=".4rem .75rem",e.appendChild(n),e.appendChild(o),this.res=e,t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),o.addEventListener("focus",function(){n.style.transition="transform ease 0.2s",n.style.transform="scale(0.80)",n.style.textTransform="uppercase",n.style.transformOrigin="left top",n.style.fontWeight="bold",o.placeholder="",n.style.opacity="1.0",t.font&&(n.style.fontFamily=t.font),t.color&&(n.style.color=t.color),t.exact&&(n.style.fontSize=t.exact)}),o.addEventListener("focusout",function(){n.style.transform="scale(1.0)",o.placeholder=t.title,n.style.opacity="0.0"}),t.name&&o.setAttribute("name",t.name),window.matchMedia("(max-device-width: 415px)").matches&&(o.style.width="100%",e.style.width="100%"),o.style.fontSize="1rem",this.el=e,this}},{key:"getValue",value:function(){return this.el.children[1].value}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new FloatingInput().set(".concat(t,")")]}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&Sr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Pr(t){return Pr="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},Pr(t)}function Ar(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Rr(r.key),r)}}function Rr(t){var e=function(t){if("object"!=Pr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pr(e)?e:e+""}"undefined"!=typeof window&&(window.FloatingInput=Cr);var Mr=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=null,this.minLabel=null,this.maxLabel=null,this.currentLabel=null},(e=[{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new Range().set(".concat(t,")")]}},{key:"set",value:function(t){var e,n,r=this;this.options=t;var o=document.createElement("input");if(o.setAttribute("id","slider"),o.setAttribute("type","range"),o.setAttribute("min",t.min),o.setAttribute("max",t.max),o.setAttribute("value",t.min),o.style.width=null!==(e=t.width)&&void 0!==e?e:"100%",!t.plain){var i,a;o.style.setProperty("-webkit-appearance","none"),o.style.appearance="none",o.style.height="9px",o.style.background=null!==(i=t.style.trackColor)&&void 0!==i?i:"orange",o.style.borderRadius="5px";var s="\n #slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 25px;\n height: 25px;\n border-radius: 50%;\n background: ".concat(null!==(a=t.style.thumbColor)&&void 0!==a?a:"4CAF50",";\n cursor: pointer;\n }\n "),l=document.createElement("style");l.appendChild(document.createTextNode(s)),document.head.appendChild(l)}var c=document.createElement("div");c.style.display="flex",c.style.flexDirection="column",c.style.alignItems="center",c.style.width="100%";var u=document.createElement("div");if(u.style.display="flex",u.style.justifyContent="space-between",u.style.width=null!==(n=t.width)&&void 0!==n?n:"100%",this.minLabel=document.createElement("span"),this.minLabel.textContent=t.min,this.maxLabel=document.createElement("span"),this.maxLabel.textContent=t.max,this.currentLabel=document.createElement("span"),this.currentLabel.textContent=o.value,t.font&&(this.currentLabel.style.fontFamily=t.font),t.font&&(this.minLabel.style.fontFamily=t.font),t.font&&(this.maxLabel.style.fontFamily=t.font),t.plain||(u.appendChild(this.minLabel),u.appendChild(this.currentLabel),u.appendChild(this.maxLabel)),o.addEventListener("input",function(){r.currentLabel.textContent=o.value}),window.matchMedia("(max-device-width: 415px)").matches)if(t.plain)o.style.width="80%";else{var f,d;o.style.height="20px",o.style.background=null!==(f=t.style.trackColor)&&void 0!==f?f:"1abc9C",o.style.borderRadius="10px",o.style.fontSize="3rem",o.style.width="80%";var h="\n #slider::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 25px;\n height: 25px;\n border-radius: 50%;\n background: ".concat(null!==(d=t.style.thumbColor)&&void 0!==d?d:"blue",";\n cursor: pointer;\n }\n "),p=document.createElement("style");p.appendChild(document.createTextNode(h)),document.head.appendChild(p)}return c.appendChild(u),c.appendChild(o),this.el=c,this}},{key:"value",value:function(){return this.el.querySelector("#slider").value}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&Ar(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Fr(t){return Fr="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},Fr(t)}function Ir(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Dr(r.key),r)}}function Dr(t){var e=function(t){if("object"!=Fr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fr(e)?e:e+""}"undefined"!=typeof window&&(window.Range=Mr);var Lr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=null,this.radioCount=0},(e=[{key:"set",value:function(t){this.options=t,this.radioCount=t.items.length;for(var e=document.createElement("div"),n=t.items,r=0;r<n.length;r++){var o=document.createElement("label");n.font&&(o.style.font=n.font),n.color&&(o.style.color=n.color),n.exact&&(o.style.fontSize=n.exact);var i=document.createTextNode(n[r]);o.appendChild(i),o.setAttribute("for",n[r]);var a=document.createElement("input");a.setAttribute("type","radio"),a.setAttribute("id","S".concat(r)),a.setAttribute("value",n[r].split(" ").join("")),a.style.appearance="none",a.style.width="20px",a.style.height="20px",a.style.border=this.options.tint?"2px solid ".concat(this.options.tint):"2px solid #007BFF",a.style.borderRadius="50%",a.style.outline="none",a.style.cursor="pointer",a.style.transition="0.3s",this.options.font&&(o.style.fontFamily=this.options.font),t.multiple?a.setAttribute("name",n[r].split(" ").join("")):a.setAttribute("name",t.name),e.appendChild(a),e.appendChild(o),e.innerHTML+="</br>"}return this.el=e,this.responsive(),this}},{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"getCheckedValues",value:function(){for(var t=[],e=0;e<this.radioCount;e++)if(document.querySelector("#S".concat(e)).checked){var n=document.querySelector("#S".concat(e));t.push(n.value)}return t}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new RadioGroup().set(".concat(t,")")]}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.el.style.fontSize="1.7em"),this}},{key:"render",value:function(t){var e=this;if(!t){for(var n=function(){var t=e.el.children[r];"[object HTMLInputElement]"===t.toString()&&t.addEventListener("change",function(){if(t.checked){t.style.backgroundColor=e.options.tint?e.options.tint:"#007BFF",t.style.boxShadow=e.options.tint?"0 0 0 2px ".concat(e.options.tint," inset"):"0 0 0 2px #0056b3 inset";for(var n=0;n<e.el.children.length;n++){var r=e.el.children[n];"INPUT"===r.tagName&&"radio"===r.type&&!1===e.options.multiple&&r!==t&&(r.style.backgroundColor="transparent",r.style.boxShadow="none")}}else t.style.backgroundColor="transparent",t.style.boxShadow="none"})},r=0;r<this.el.children.length;r++)n();return this.el}document.querySelector(t).appendChild(this.el)}}])&&Ir(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function zr(t){return zr="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},zr(t)}function Wr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Br(r.key),r)}}function Br(t){var e=function(t){if("object"!=zr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zr(e)?e:e+""}function Nr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Nr=function(){return!!t})()}function Ur(t){return Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ur(t)}function Gr(t,e){return Gr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gr(t,e)}"undefined"!=typeof window&&(window.RadioGroup=Lr);var Hr=function(t){function e(){var t,n,r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=Ur(r),t=function(t,e){if(e&&("object"==zr(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)}(n,Nr()?Reflect.construct(r,o||[],Ur(n).constructor):r.apply(n,o))).el=null,t.file=null,t.selected="",t}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&&Gr(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(t,e){document.createElement("div");var n=document.createElement("select");n.setAttribute("type","file"),n.setAttribute("name",e),n.addEventListener("change",function(){n.options[n.selectedIndex].value});for(var r=0;r<t.length;r++)n.appendChild(this.addNode(t[r][0],t[r][1]));return this.el=n,this.res=n,this}},{key:"set",value:function(t){return this.options=t,t.items&&this.setup(t.items,t.name),t.arrayPadding&&this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.radius&&(this.el.style.borderRadius=t.radius),t.background&&(this.el.style.background=t.background),this.commonMethods(t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.el.style.paddingLeft=e),t.includes("right")&&(this.el.style.paddingRight=e),t.includes("top")&&(this.el.style.paddingTop=e),t.includes("bottom")&&(this.el.style.paddingBottom=e),t.includes("all")&&(this.el.style.padding=e),this}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.el.style.marginLeft=e),t.includes("right")&&(this.el.style.marginRight=e),t.includes("top")&&(this.el.style.marginTop=e),t.includes("bottom")&&(this.el.style.marginBottom=e),t.includes("all")&&(this.el.style.margin=e),this}},{key:"addNode",value:function(t,e){var n=document.createElement("option");n.setAttribute("value",t);var r=document.createTextNode(e);return n.appendChild(r),n}},{key:"padding",value:function(t){return this.el.style.padding=t,this}},{key:"font",value:function(t){return this.el.style.fontFamily=t,this}},{key:"margin",value:function(t){return this.el.style.margin=t,this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new Picker().set(".concat(t,")")]}},{key:"rounded",value:function(t){return this.el.style.borderRadius="4px",this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.el.style.fontSize="3rem":t.el.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}])&&Wr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Xr(t){return Xr="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},Xr(t)}function qr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jr(r.key),r)}}function Jr(t){var e=function(t){if("object"!=Xr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xr(e)?e:e+""}function Vr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Vr=function(){return!!t})()}function $r(t){return $r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$r(t)}function Yr(t,e){return Yr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yr(t,e)}"undefined"!=typeof window&&(window.Picker=Hr);var Qr=function(t){function e(){var t,n,r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=$r(r),t=function(t,e){if(e&&("object"==Xr(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)}(n,Vr()?Reflect.construct(r,o||[],$r(n).constructor):r.apply(n,o))).el=null,t.file=null,t}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&&Yr(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){var e=this;this.options=t,this.okayColor=t.okayColor,window.matchMedia("(max-device-width: 415px)");var n=document.createElement("div");n.style.paddingBottom="1em",n.style.display="flex",document.createElement("div");var r=document.createElement("input");r.setAttribute("type","text"),r.style.display="none",r.style.margin="0.5em";var o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("name",t.name),t.accept&&(o.accept=t.accept),o.setAttribute("id",t.id),o.style.visibility="hidden",o.style.display="none",window.matchMedia("(max-device-width: 415px)").matches&&(o.style.fontSize="1rem");var i=document.createElement("label");return i.setAttribute("for",t.id),i.innerText=t.title,i.style.marginRight=12,i.style.padding="0.5em",t.color&&(i.style.color=t.color),t.background&&(i.style.background=t.background,i.style.padding="10"),o.addEventListener("change",function(){r.style.display="block",t.hideField&&(r.style.display="none"),i.innerText="Change",e.file=o.files[0],e.onLoad(e.file),Kr[t.index]=e.file,r.setAttribute("value",e.file.name),r.setAttribute("readonly","true"),e.getLoaded(),e.highlight()}),n.appendChild(o),n.appendChild(i),n.appendChild(r),this.el=n,t.font&&this.font(t.font),t.radius&&this.borderRadius(t.radius),this}},{key:"borderRadius",value:function(t){return this.el.style.borderRadius=t,this}},{key:"addClass",value:function(t){return this.el.setAttribute("class",t),this}},{key:"font",value:function(t){return this.el.style.fontFamily=t,this}},{key:"bold",value:function(){return this.el.style.fontWeight="bold",this}},{key:"rounded",value:function(){return this.el.children[1].style.borderRadius="8px",this}},{key:"highlight",value:function(){return null===this.file?(this.hasFile=!1,this.el.children[1].style.background="red"):(this.hasFile=!0,this.okayColor?this.el.children[1].style.background=this.okayColor:this.el.children[1].style.background="#1abc9c"),this}},{key:"auto",value:function(){var t=function(){window.matchMedia("(max-device-width: 415px)").matches};return t(),window.addEventListener("resize",t),this}},{key:"onLoad",value:function(t){return this.returnObject(this.file),this}},{key:"getLoaded",value:function(){return this.file}},{key:"returnObject",value:function(t){return t}},{key:"loadCall",value:function(t){return this.func=t,this.func(this.file),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return t=t.replace(/"(\w+)"(?=\s*:)/g,"$1"),["new FilePickera().set(".concat(t,")")]}},{key:"render",value:function(t){return t?(document.querySelector(t).appendChild(this.el),this):this.el}}])&&qr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z),Kr=[];function Zr(t,e){return Zr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zr(t,e)}function to(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(to=function(){return!!t})()}function eo(t){return eo="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},eo(t)}function no(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ro(r.key),r)}}function ro(t){var e=function(t){if("object"!=eo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=eo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==eo(e)?e:e+""}var oo=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.res=null,this.currentItem=""},(e=[{key:"set",value:function(t){var e=this,n=t;this.options=t;var r=document.createElement("input");r.setAttribute("list","dlCities"),r.setAttribute("id","my");var o=t.data,i=0,a=o.length,s=document.createElement("datalist");for(s.id="dlCities",i=0;i<a;i+=1){var l=document.createElement("option");l.value=o[i],s.appendChild(l)}return r.appendChild(s),r.addEventListener("change",function(){var t=document.querySelector("#my").value;e.currentItem=t}),r.setAttribute("placeholder","Type value"),r.style.padding=".4rem .75rem",r.style.fontSize="1rem",this.res=r,this.responsive(),n.arrayPadding&&this.arrayPadding(n.arrayPadding.sides,n.arrayPadding.value),n.arrayMargin&&this.arrayMargin(n.arrayMargin.sides,n.arrayMargin.value),n.pad&&this.pad(n.pad),n.mar&&this.mar(n.mar),this}},{key:"toCode",value:function(){var t=JSON.stringify(this.options,null,4);return["new DataList().set(".concat(t,")")]}},{key:"getValue",value:function(){return this.res.value}},{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),t.includes("all")&&(this.res.style.padding=e),this}},{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),this}},{key:"margin",value:function(t){return this.res.style.margin=t,this}},{key:"responsive",value:function(){return window.matchMedia("(max-device-width: 415px)").matches&&(this.res.style.width="100%"),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&no(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),io=oo;function ao(t){return ao="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},ao(t)}function so(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,co(r.key),r)}}function co(t){var e=function(t){if("object"!=ao(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ao(e)?e:e+""}oo=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t,e,n){if(to())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Zr(o,n.prototype),o}(io,e)},"undefined"!=typeof window&&(window.DataList=oo);var uo=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"POST";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.action=e,this.method=n,this.elements=[],this.formElement=document.createElement("form"),this.formElement.action=this.action,this.formElement.method=this.method},e=[{key:"add",value:function(t){var e=this;return this.elements=t,t.forEach(function(t){if(!t||"function"!=typeof t.render)throw new Error("Each element in the array must have a render method that returns an HTML DOM element.");e.formElement.appendChild(t.render())}),this}},{key:"toCode",value:function(){var t=this.elements.map(function(t){return t.toCode()}),e=Object.entries(this.obj).map(function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return so(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?so(t,e):void 0}}(e,n)||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.")}()),o=r[0],i=r[1],a="string"==typeof i?'"'.concat(i,'"'):i;return"".concat(o,": ").concat(a)}).join(", ");return["new Form().set({".concat(e,"}).add([ \n ").concat(t.join(", \n"),"])")]}},{key:"set",value:function(t){return this.obj=t,t.action&&this.setAction(t.action),t.method&&this.setMethod(t.method),t.id&&(this.formElement.id=t.id),this}},{key:"setAction",value:function(t){this.action=t,this.formElement.action=this.action}},{key:"setMethod",value:function(t){this.method=t,this.formElement.method=this.method}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.formElement),this.formElement}}],e&&lo(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function fo(t){return fo="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},fo(t)}function ho(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,po(r.key),r)}}function po(t){var e=function(t){if("object"!=fo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fo(e)?e:e+""}var yo=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"style",value:function(t){for(var e=t.bst,n=t.el,r=t.re,o=(t.options,[]),i=0;i<e.length;i++)e[i].target&&(n.id,e[i].target[0]);for(i=0;i<e.length;i++){var a=!0;e[i].target&&(a=!1,n.id===e[i].target[0]&&(a=!0));var s=e[i].op.ops.split("-");a&&s.includes("air")&&(r.borderObj={color:"#1abc9c",radius:"0rem",width:"3px"},r.color="#1abc9c",r.background="transparent"),a&&s.includes("round")&&(s.includes("air")?r.borderObj={width:"4px",radius:"0.7rem",color:"#1abc9c"}:r.borderObj={width:"0px",radius:"0.7rem",color:"#1abc9c"}),a&&s.includes("full")&&(r.background="#3498db",r.borderObj&&r.borderObj.radius&&(r.borderObj.radius="0.3rem"),r.color="white"),a&&s.includes("pill")&&(r.background="#3498db",r.borderObj.radius="9999px",r.color="white"),a&&s.includes("hover")&&(r.hover={color:"#1abc9c",background:"orange"}),o.push((new Ct).set(r))}return o}}])&&ho(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function mo(t){return mo="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},mo(t)}function vo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function bo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vo(Object(n),!0).forEach(function(e){go(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vo(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function go(t,e,n){return(e=xo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wo(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xo(r.key),r)}}function xo(t){var e=function(t){if("object"!=mo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==mo(e)?e:e+""}function ko(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ko=function(){return!!t})()}function Oo(){return Oo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=So(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Oo.apply(null,arguments)}function So(t){return So=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},So(t)}function Eo(t,e){return Eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Eo(t,e)}var jo=function(t){function e(){var t,n,r,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=So(r),t=function(t,e){if(e&&("object"==mo(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)}(n,ko()?Reflect.construct(r,o||[],So(n).constructor):r.apply(n,o))).res=null,t.options={},t.code=[],t.elCSS=[],t.html=[],t.react=[],t.setup(i),t.code.push("new Polygon(".concat(JSON.stringify(i),")")),t}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&&Eo(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=document.createElement("div");return t.id&&e.setAttribute("id",t.id),this.res=e,this.res.style.padding=0,this.res.style.margin=0,this.res.style.display=t.inline?"inline-block":"block",this}},{key:"toCode",value:function(){var t=X(this.options||{},2);return"new Polygon().set(".concat(t,")")}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=bo(bo({},this.options),t),t.id&&(this.res.id=t.id),t.class&&(this.res.className=t.class),t.sides&&this.sides(t.sides),t.size&&this.size(t.size.width||t.size,t.size.height),t.color&&this.color(t.color),t.border&&this.border(t.border),t.margin&&this.mar([{a:t.margin}]),t.padding&&this.pad([{a:t.padding}]),t.background&&this.background(t.background),t.center&&this.center();var n=t;this.obj=t;var r,o,i=[];if(n.stroke||n.gradient||n.backgroundOp||n.layout||n.marginOp||n.shadow||n.animation||n.filtera||n.transform){var a;n.gradient&&(this.globalGradient=n.gradient.op.gradient),n.stroke&&(null===(r=this,a="function"==typeof(o=Oo(So(e.prototype),"setAny",r))?function(t){return o.apply(r,t)}:o)||void 0===a||a([{globalBlast:"".concat(n.stroke.op.width," ").concat(n.stroke.op.color)}]));for(var s=[n.stroke,n.gradient,n.animation,n.backgroundOp,n.layout,n.marginOp,n.shadow,n.animation,n.filtera,n.transform].filter(function(t){return null!=t}),l=0;l<s.length;l++)i.push({range:s[l].range,log:s[l].op.name,target:s[l].target,op:s[l].op});var c=[];n.border&&c.push("border"),n.background&&c.push("background"),(n.mar||n.margin)&&c.push("margin"),n.animation&&c.push("animation"),"radial"===n.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),this.chainReact(i,this.options.id,c)}return this}},{key:"size",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.res.style.width="number"==typeof t?t+"px":t,this.res.style.height="number"==typeof e?e+"px":e,this}},{key:"sides",value:function(t){return t<3&&(t=3),this.res.style.clipPath=e.makePolygon(t),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"border",value:function(t){return this.res.style.border="string"==typeof t?t:"".concat((null==t?void 0:t.width)||"1px"," solid ").concat((null==t?void 0:t.color)||"black"),this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"render",value:function(t){return"string"==typeof t?document.querySelector(t).appendChild(this.res):t instanceof HTMLElement&&t.appendChild(this.res),this}}],o=[{key:"makePolygon",value:function(t){for(var e=2*Math.PI/t,n=[],r=0;r<t;r++){var o=50+50*Math.cos(r*e-Math.PI/2),i=50+50*Math.sin(r*e-Math.PI/2);n.push("".concat(o,"% ").concat(i,"%"))}return"polygon(".concat(n.join(","),")")}}],r&&wo(n.prototype,r),o&&wo(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Z);function To(t){return To="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},To(t)}function _o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Co(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Po(r.key),r)}}function Po(t){var e=function(t){if("object"!=To(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=To(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==To(e)?e:e+""}function Ao(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ao=function(){return!!t})()}function Ro(){return Ro="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Mo(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Ro.apply(null,arguments)}function Mo(t){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(t)}function Fo(t,e){return Fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fo(t,e)}var Io=function(t){function e(){var t,n,r,o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,r=e,r=Mo(r),t=function(t,e){if(e&&("object"==To(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)}(n,Ao()?Reflect.construct(r,o||[],Mo(n).constructor):r.apply(n,o))).res=null,t.options={},t.code=[],t.elCSS=[],t.html=[],t.react=[],t.setup(),t}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&&Fo(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("div");return this.res=t,this.res.style.padding=0,this.res.style.margin=0,this.res.style.borderRadius="50%",this}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=X(Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=(e=t,n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,n)||function(t,e){if(t){if("string"==typeof t)return _o(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_o(t,e):void 0}}(e,n)||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.")}())[1];var e,n})),4);return["new Circle().set(".concat(t,")")]}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"diameter",value:function(t){return this.res.style.width=this.res.style.height="number"==typeof t?t+"px":t,this.res.style.borderRadius="50%",this}},{key:"size",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.res.style.width="number"==typeof t?t+"px":t,this.res.style.height="number"==typeof e?e+"px":e,this.res.style.borderRadius="50%",this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"background",value:function(t){return this.res.style.background=t,this}},{key:"border",value:function(t){return this.res.style.border="string"==typeof t?t:"".concat((null==t?void 0:t.width)||1,"px solid ").concat((null==t?void 0:t.color)||"black"),this}},{key:"radius",value:function(t){return this.res.style.borderRadius="number"==typeof t?t+"px":t,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t,t.top&&(this.res.style.top=t.top),t.left&&(this.res.style.left=t.left),(t.top||t.left)&&(this.res.style.position="absolute"),t.diameter&&this.diameter(t.diameter),t.size&&this.size(t.size.w||t.size,t.size.h||t.size),t.width&&(this.res.style.width=t.width),t.height&&(this.res.style.height=t.height),t.radius&&this.radius(t.radius),t.id&&this.res.setAttribute("id",t.id),t.class&&this.res.setAttribute("class",t.class),t.zIndex&&(this.res.style.zIndex=t.zIndex),t.pad&&(this.res.style.padding=t.pad),t.mar&&(this.res.style.margin=t.mar),t.background&&(this.res.style.background=t.background),t.color&&this.color(t.color),t.border&&this.border(t.border),t.shadow&&(this.res.style.boxShadow=t.shadow),t.cursor&&(this.res.style.cursor=!0===t.cursor?"pointer":t.cursor);var n,r,o=[];if(t.stroke||t.gradient||t.backgroundOp||t.layout||t.marginOp||t.shadow||t.animation||t.filtera||t.transform){var i;t.gradient&&(this.globalGradient=t.gradient.op.gradient),"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),t.stroke&&(null===(n=this,i="function"==typeof(r=Ro(Mo(e.prototype),"setAny",n))?function(t){return r.apply(n,t)}:r)||void 0===i||i([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]));for(var a=[t.stroke,t.gradient,t.animation,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,t.transform].filter(function(t){return null!=t}),s=0;s<a.length;s++)o.push({range:a[s].range,log:a[s].op.name,target:a[s].target,op:a[s].op});var l=[];t.border&&l.push("border"),t.background&&l.push("background"),(t.mar||t.margin)&&l.push("margin"),t.animation&&l.push("animation"),this.chainReact(o,this.options.id,l)}return this}},{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"render",value:function(t){var e;return t&&(null===(e=document.querySelector(t))||void 0===e||e.appendChild(this.res)),this.res}}],r&&Co(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Z);function Do(t){return Do="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},Do(t)}function Lo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function zo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Wo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zo(Object(n),!0).forEach(function(e){Bo(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Bo(t,e,n){return(e=Uo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function No(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uo(r.key),r)}}function Uo(t){var e=function(t){if("object"!=Do(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Do(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Do(e)?e:e+""}var Go=["h1","h2","h3","h4","h5","h6","p","img","a","cards","free","nav","sideNav","row","dropdown","radio","input","labelInput","filePicker","picker","video","audio","multiswitcher","button","form","checkbox","stack","simple","copy","wrap","circle","polygon","code","table","ulist"],Ho=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"mapType",value:function(t){if(["h1","h2","h3","h4","h5","h6","p"].includes(t.el.type))return this.mapText(t);if("img"===t.el.type)return this.mapImage(t);if("a"===t.el.type)return this.mapLink(t);if("cards"===t.el.type)return this.mapGrid(t);if("free"===t.el.type)return this.mapFree(t);if("nav"===t.el.type)return this.protoNav(t);if("sideNav"===t.el.type)return this.sideNav(t);if("row"===t.el.type)return this.mapRow(t);if("dropdown"===t.el.type)return this.dropdown(t);if("radio"===t.el.type)return this.radio(t);if("input"===t.el.type)return this.input(t);if("labelInput"===t.el.type)return this.floatInput(t);if("filePicker"===t.el.type)return this.filePicker(t);if("picker"===t.el.type)return this.picker(t);if("video"===t.el.type)return this.video(t);if("audio"===t.el.type)return this.audio(t);if("multiswitcher"===t.el.type)return this.multiswitcher(t);if("button"===t.el.type)return this.button(t);if("form"===t.el.type)return this.form(t);if("checkbox"===t.el.type)return this.checkbox(t);if("stack"===t.el.type)return this.stack(t);if("simple"===t.el.type)return this.simple(t);if("copy"===t.el.type)return this.mapCopy(t);if("wrap"===t.el.type)return this.mapWrap(t);if("circle"===t.el.type)return this.mapCircle(t);if("polygon"===t.el.type)return this.mapPolygon(t);if("code"===t.el.type)return this.mapCode(t);if("table"===t.el.type)return this.mapTable(t);if("ulist"===t.el.type)return this.mapUList(t);throw new Error("[nodality] "+function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"value",r=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,r=String(t);return e.filter(function(t){return function(t,e){if(t===e)return 0;for(var n=new Array(e.length+1),r=0;r<=e.length;r++)n[r]=r;for(var o=1;o<=t.length;o++){for(var i=[o],a=1;a<=e.length;a++){var s=t.charCodeAt(o-1)===e.charCodeAt(a-1)?0:1;i[a]=Math.min(n[a]+1,i[a-1]+1,n[a-1]+s)}n=i}return n[e.length]}(r,t)<=n})}(t,e),o="Unknown ".concat(n,' "').concat(t,'".');return r.length&&(o+=' Did you mean "'.concat(r[0],'"?')),e.length&&(o+=" Valid ".concat(n,"s: ").concat(e.join(", "),".")),o}(t.el.type,Go,"element type"))}},{key:"mapTable",value:function(t){var e=t.el;return(new $e).add([{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"},{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"},{abbr:"AUIUI/AK9PT",name:"Pokročilé mobilní technologie",grade:"A",date:"09.01.2024"}]).set({cellPadding:"0.3em",cellAlign:"center",style:{font:"Arial"},headStyle:{color:"white",background:"#ff6d22"},border:"2px solid black",center:!0,borderRadius:2.2,stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)})}},{key:"mapRow",value:function(t){var e=t.el;return(new Wt).set({stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)}).items([new ct("This").set({size:"S3"}),new ct("is").set({size:"S3",text:"Hello"}),new ct("row.").set({size:"S3",text:"Hello"})])}},{key:"mapCode",value:function(t){var e=t.el;return(new xe).set({stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions),pad:[{l:30}],mar:[{a:30}],class:"language-js",code:'new Text("Modality").set({ font: "Arial" })'})}},{key:"mapCopy",value:function(t){var e,n=t.customOptions,r=n.filter(function(t){return"copy"===t.op})[0],o=null!==(e=null==r?void 0:r.count)&&void 0!==e?e:3,i=(this.filteroRaster(t.el.id,n)||[]).filter(function(t){return t!==r}),a=300;return'new Wrapper()\n.set({\n width: "'.concat(a,'px",\n height: "').concat(a,'px",\n display: "flex",\n justifyContent: "center",\n alignItems: "center",\n position: "absolute",\n id: "#first",\n scale: 0.3,\n ').concat(null!=r&&r.animation?'\nanimation: {\n op: {\n name: "animation",\n color: "green",\n width: "1px",\n fireAt: "inview",\n keyframesOpen: [\n {\n transform: "rotate(360deg)",\n opacity: 0\n },\n {\n transform: "rotate(0deg)",\n opacity: 1\n }\n ],\n keyframesClose: [\n {\n transform: "rotate(0deg)",\n opacity: 1\n },\n {\n transform: "rotate(0deg)",\n opacity: 0\n }\n ],\n openOptions: {\n duration: 300,\n fill: "forwards",\n delay: 1000\n },\n closeOptions: {\n duration: 1,\n fill: "forwards",\n delay: 1000\n }\n },\n target: [\n "#first"\n ]\n },\n ':"").concat(i.length?",\n raster: ".concat(JSON.stringify(i)):"","\n})\n.add(\n Array.from({ length: ").concat(o,' }).map((_, i) => {\n\n const bbox = {width: "').concat(a,'px", height: "').concat(a,'px"};\n\n const elHeight = bbox.height;\n\n const cx = ').concat(150,";\n const cy = ").concat(150,";\n\n const R = ").concat(150,";\n\n const n = ").concat(o,';\n\n // Evenly spaced angles, starting at top (-90°)\n const angle = (i / n) * Math.PI * 2 - Math.PI/2;\n const dist = R + parseFloat(elHeight)/2;\n\n const x = cx + dist * Math.cos(angle);\n const y = cy + dist * Math.sin(angle);\n\n let rot = angle * 180 / Math.PI + 90;\n rot = (rot % 360 + 360) % 360;\n rot = (rot % 360 + 360) % 360;\n\n return new Text("Hello").set({\n size: "S1",\n color: "green",\n font: "Arial",\n left: `${x}px`,\n top: `${y}px`,\n transform: {\n op: {\n name: "transform",\n transform: {\n static: true,\n keep: true,\n values: [\n "tx:-50%",\n "ty:-50%",\n `rotate(${rot}deg)`\n ]\n }\n }\n }\n })\n\n \n })\n)')}},{key:"button",value:function(t){var e,n=t.el;return new kr(null!==(e=n.text)&&void 0!==e?e:"Button").set(Wo(Wo({fluidc:"S6"},this.elOpts(n)),{},{raster:this.filteroRaster(n.id,t.customOptions)}))}},{key:"multiswitcher",value:function(t){var e=this,n=Array.isArray(t.el.breakpoints)?t.el.breakpoints:null;if(!n||!n.length)throw new Error('[nodality] a "multiswitcher" element needs a non-empty `breakpoints` array of { at, view }.');return(new Ln).set({id:t.el.id,area:t.el.area,breakpoints:n.map(function(n){return{at:n.at,view:n.view&&"function"==typeof n.view.render?n.view:e.mapType(Wo(Wo({},t),{},{el:n.view}))}})})}},{key:"video",value:function(t){var e=t.el;if(!e.url)throw new Error('[nodality] a "video" element needs a `url`.');return this.attachRaster(new ar(e.url).set(this.elOpts(e)),e,t.customOptions)}},{key:"audio",value:function(t){var e=t.el;if(!e.url)throw new Error('[nodality] an "audio" element needs a `url`.');return this.attachRaster(new he(e.url),e,t.customOptions)}},{key:"radio",value:function(t){var e,n=t.el;return(new Lr).set(Wo({items:Array.isArray(n.items)?n.items:[],multiple:null!==(e=n.multiple)&&void 0!==e&&e},this.elOpts(n)))}},{key:"input",value:function(t){var e,n=t.el;return(new dn).set(Wo(Wo({type:null!==(e=n.inputType)&&void 0!==e?e:"text"},this.elOpts(n)),{},{raster:this.filteroRaster(n.id,t.customOptions)}))}},{key:"floatInput",value:function(t){var e,n=t.el;return this.attachRaster((new Cr).set(Wo({type:null!==(e=n.inputType)&&void 0!==e?e:"input"},this.elOpts(n))),n,t.customOptions)}},{key:"filePicker",value:function(t){var e,n=t.el;return this.attachRaster((new Qr).set(Wo({title:null!==(e=n.title)&&void 0!==e?e:"Choose a file"},this.elOpts(n))),n,t.customOptions)}},{key:"picker",value:function(t){var e=t.el;return(new Hr).set(Wo(Wo({items:Array.isArray(e.items)?e.items:[],arrayPadding:{sides:["all"],value:"0.5rem"},rounded:!0},this.elOpts(e)),{},{raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"dropdown",value:function(t){t.el.items||(t.el.items=["Flower","Car","Maseratti"]);var e=t.el.items.map(function(t){return(new Ct).set({pad:[{a:10}],font:"Arial",bold:!0,link:"https://www.apple.com",text:t,icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"},hover:{color:"wheat",animation:.3}})}),n=(new on).set({behaviour:"click",pad:[{a:"1rem"}],mar:[{a:"1rem"}],border:"1px solid black",width:"180px",radius:"1rem"}).add([new ct(t.el.items[0]).set({font:"Arial",fluidc:"S6",weight:"bold",align:"center",cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},pad:[{l:10,r:10}]}),(new We).set({border:"1px solid green",background:"#1abc9c",radius:"0.7rem",socenter:!0}).add(e.slice(1))]),r=this.filteroRaster(t.el.id,t.customOptions);return r&&n.rasterize(r),n}},{key:"protoNav",value:function(t){var e=t.customOptions,n=[{title:"Fire",link:"@e"},{title:"and",link:"@e"},{title:"smoke",link:"@e"}],r=n.map(function(t,e){return new Ct('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3}})}),o=n.map(function(t,e){return new Ct('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3},animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}})});if(t.el.dropdown){var i=(new on).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black"}).add([new ct("First").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:20,r:10}],font:"Arial",align:"center",weight:"bold"}),(new We).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new Ct).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Second",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}}),(new Ct).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Third",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}})])]);o.push(i),r.push(i)}t.el.animation;var a=(new Ln).set({breakpoints:[{at:"0px",view:(new Tn).set({background:"#ecf0f1",mar:[{a:21}],brand:new ct("Company").set({size:"S6",font:"Helvetica"}),hamburgerColour:"#3498db",radius:"1rem"}).add([(new Ct).set({text:"About",url:"#a"}),(new on).set({behaviour:"mouseover",pad:[{a:40}],mar:[{lr:"auto"}],breakpoint:"1200px",padding:"10px",border:"1px solid black",height:"auto"}).add([new ct("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new ct("Our story").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new ct("Team").set({cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})]),new Ct("B").set({text:"About",url:"#b"}),new Ct("C").set({text:"Contact",url:"https://www.abcnews.com"})])},{at:"1200px",view:(new gn).set({background:"#ecf0f1",mar:[{a:21}],maxHeight:"100px",radius:"1rem"}).add([new ct("Company").set({size:"S6",font:"Helvetica"}),new Xn(!0),(new on).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black",radius:"30px",width:"130px"}).add([new ct("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),(new We).set({flexDir:"column",mar:[{t:"10px"}],radius:".3rem"}).add([new Ct("").set({text:"Who we are",url:"jk",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Ct("").set({text:"Info",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Ct("").set({text:"About",url:"#u",cursor:"hand",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])]),(new Ct).set({text:"About",url:"#a"}),(new Ct).set({text:"Services",url:"#a"}),(new Ct).set({text:"Contact",url:"#a"})])}]});return this.attachRaster(a,t.el,e)}},{key:"sideNav",value:function(t){t.customOptions;var e=[{title:"Home",link:"@e"},{title:"Projects",link:"@e"},{title:"Services",link:"@e"}],n=e.map(function(t,e){return new Ct('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:"#e",id:"#"+t.title.toLowerCase(),font:"Arial",pad:[{a:20}],bold:!0,tags:{open:"sidebar:open",close:"sidebar:closed"},align:"left",hover:{color:"wheat",animation:.3}})}),r=(new on).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}}).add([new ct("More").set({cursor:"hand",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),(new We).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new Ct).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Second",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}}),(new Ct).set({pad:[{a:10}],font:"Arial",hover:{color:"wheat",animation:.3},bold:!0,link:"https://www.apple.com",text:"Third",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/32/32339.png"}})])]),o=e.map(function(t,e){return new Ct('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:"#myURL",id:"#"+t.title.toLowerCase(),font:"Arial",pad:[{a:20}],bold:!0,tags:{open:"sidebar:open",close:"sidebar:closed"},align:"left",hover:{color:"wheat",animation:.3},animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px",keyframesOpen:[{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, ".concat(10*e,"%)"),opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}}})});t.el.dropdown&&(o.push(r),n.push(r));var i=(new We).set({column:!0}).add([new ct("Sidebar").set({size:"S6",font:"Arial",id:"#olod",italic:!0,animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}},pad:[{l:20},{t:20}]}),t.el.animation?o[0]:n[0],t.el.animation?o[1]:n[1],t.el.animation?o[2]:n[2],t.el.animation&&t.el.dropdown?o[3]:new ct("").set({}).excludeFromCode(),new ct("Company, 2025").set({pad:[{a:20}],animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}})]),a=(new We).set({column:!0}).add([new ct("Off canvas").set({fluidc:"S6",font:"Arial",id:"#olod",italic:!0,animation:t.el.animation?{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}:null,pad:[{l:40},{t:20}]})]),s=(new Kt).setup({animate:!0,radius:"1rem",isSide:!0,background:"#ecf0f1",hamColour:{opened:"#1abc9c",closed:"#e67e22"},mobileSize:"1.2em",fixed:!0,tags:{open:"sidebar:open",close:"sidebar:closed"}}).items(t.el.offcanvas?a:i),l=this.filteroRaster(t.el.id,t.customOptions);return l&&s.rasterize(l),s}},{key:"mapFree",value:function(t){var e=t.customOptions.filter(function(t){return"slayout"===t.op.name||"layout"===t.op.name})[0],n=null,r={cols:6,rows:6};"text-above-image"!==e.op.value&&"image-above-text"!==e.op.value||(n=null,r=null),"img-overlay-text"===e.op.value&&(n={text:{row:"1 / span 2",col:"3 / span 2"},image:{row:"2 / span 3",col:"3 / 3"}}),"img-leftof-text"===e.op.value&&(n={text:{row:"1",col:"1 / 3"},image:{row:"1",col:"3 / 4"}});var o=(new ae).set({id:"#3",templateCols:r,height:"600px"}).add([new ct("I am free").set({border:"3px solid green",font:"Arial",size:"S1",color:"#1abc9c",gpos:null!=n?n.text:null,zIndex:1}),(new gt).set({url:"https://upload.wikimedia.org/wikipedia/commons/a/ac/MSC_World_Europa_-_Saint-Nazaire_-_June_2022.jpg",width:"400px",height:"auto",gpos:null!=n?n.image:null})]),i=this.filteroRaster(t.el.id,t.customOptions);return i&&o.rasterize(i),o}},{key:"mapCircle",value:function(t){var e=t.el;return(new Io).set({diameter:108,background:"#1abc9c",stroke:this.filtero("blast",e.id,t.customOptions),gradient:this.filtero("gradient",e.id,t.customOptions),animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),span:this.filtero("span",e.id,t.customOptions),backgroundOp:this.filtero("background",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),transform:this.filtero("transform",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)})}},{key:"mapPolygon",value:function(t){var e,n=t.el,r=null!==(e=t.el.sides)&&void 0!==e?e:7;return new jo({id:"hex"}).set({sides:r,size:300,background:"#1abc9c",gradient:this.filtero("gradient",n.id,t.customOptions),animation:this.filtero("animation",n.id,t.customOptions),shadow:this.filtero("shadow",n.id,t.customOptions),span:this.filtero("span",n.id,t.customOptions),backgroundOp:this.filtero("background",n.id,t.customOptions),marginOp:this.filtero("margin",n.id,t.customOptions),transform:this.filtero("transform",n.id,t.customOptions),filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions)})}},{key:"mapText",value:function(t){var e,n,r=t.el;return new ct(r.text||r.value).set({id:r.id,class:r.class,color:r.color,size:this.getElType(r.type),font:null!==(e=r.font)&&void 0!==e?e:"Arial",stroke:this.filtero("blast",r.id,t.customOptions),gradient:this.filtero("gradient",r.id,t.customOptions),animation:this.filtero("animation",r.id,t.customOptions),shadow:this.filtero("shadow",r.id,t.customOptions),span:this.filtero("span",r.id,t.customOptions),backgroundOp:this.filtero("background",r.id,t.customOptions),marginOp:this.filtero("margin",r.id,t.customOptions),transform:this.filtero("transform",r.id,t.customOptions),filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions),resprop:null!==(n=r.resprop)&&void 0!==n?n:null})}},{key:"mapImage",value:function(t){var e=t.el;return new gt(e.url).set(Wo(Wo({},e),{},{isFull:e.isFull,animation:this.filtero("animation",e.id,t.customOptions),shadow:this.filtero("shadow",e.id,t.customOptions),marginOp:this.filtero("margin",e.id,t.customOptions),filtera:this.filtero("filter",e.id,t.customOptions),raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"mapLink",value:function(t){var e=t.customOptions.filter(function(t){return"link-style"===t.op.name}),n=t.el;return t.el.id&&(n.id=t.el.id),t.el.link&&t.el.text&&(n.url=t.el.link,n.text=t.el.text),n.animation=this.filtero("animation",t.el.id,t.customOptions),n.class=t.el.class,n.width=t.el.width,n.font="Arial",n.fluidc=t.el.fluidc,n.transform=this.filtero("transform",t.el.id,t.customOptions),n.shadow=this.filtero("shadow",t.el.id,t.customOptions),n.gradient=this.filtero("gradient",t.el.id,t.customOptions),n.blast=this.filtero("blast",t.el.id,t.customOptions),n.backgroundOp=this.filtero("background",t.el.id,t.customOptions),n.raster=this.filteroRaster(t.el.id,t.customOptions),n.pad=[{a:10}],e.length>0?yo.style({el:t.el,re:n,bst:e,options:t.customOptions})[e.length-1]:(new Ct).set(n)}},{key:"mapGrid",value:function(t){var e=t.el,n=(t.customOptions.find(function(t){return"card-style"===t.op.name}),this.filtero("gradient",e.id,t.customOptions)),r=this.filtero("animation",e.id,t.customOptions),o=this.filtero("shadow",e.id,t.customOptions),i=this.filtero("margin",e.id,t.customOptions),a=this.filtero("filter",e.id,t.customOptions),s=this.filteroRaster(e.id,t.customOptions),l=this.filtero("blast",e.id,t.customOptions),c='\n new Card()\n .set({\n width: "300px", \n height: "700px",\n radius: "0.7rem", \n mar: { sides: ["all"], value: "0.8rem" }\n '.concat(void 0!==n?",\n gradient: ".concat(JSON.stringify(n)):"").concat(void 0!==r?",\n animation: ".concat(JSON.stringify(r)):"").concat(void 0!==o?",\n shadow: ".concat(JSON.stringify(o)):"").concat(void 0!==i?",\n marginOp: ".concat(JSON.stringify(i)):"").concat(void 0!==a?",\n filtera: ".concat(JSON.stringify(a)):"").concat(void 0!==l?",\n blast: ".concat(JSON.stringify(l)):"",'\n })\n .items([\n new Image(item.img).set({isFull: true, url: item.img}),\n new Text(item.title).set({ size: "S5", color: "orange" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#3498db", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white",\n mar: [{"a": 21}]\n })\n ])'),u=t.el.backgroundCard?'\n new ZoomCard()\n .set({\n url: item.img, \n font: "Arial", \n mar: { sides: ["all"], value: "0.8rem" }, \n inpad: "1rem", \n useBrightness: true\n })\n .items([\n new Text(item.title).set({ fluidc: "S6", color: "orange" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#3498db", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white"\n })\n ])':c;return' new FlexGrid()\n .set({\n colat: "700px",\n wrap: true,\n align: "center",\n gap: "1rem"\n '.concat(void 0!==n?",\n gradient: ".concat(JSON.stringify(n)):"").concat(void 0!==r?",\n animation: ".concat(JSON.stringify(r)):"").concat(void 0!==o?",\n shadow: ".concat(JSON.stringify(o)):"").concat(void 0!==i?",\n marginOp: ".concat(JSON.stringify(i)):"").concat(void 0!==a?",\n filtera: ".concat(JSON.stringify(a)):"").concat(void 0!==l?",\n blast: ".concat(JSON.stringify(l)):"").concat(void 0!==s?",\n raster: ".concat(JSON.stringify(s)):"",'\n })\n .items(\n [\n { img: "https://upload.wikimedia.org/wikipedia/commons/3/3a/Starship_S20.jpg", title: "Starship", link: "#ship" },\n { img: "https://upload.wikimedia.org/wikipedia/commons/1/16/Apollo_11_Launch_-_GPN-2000-000630.jpg", title: "Saturn V", link: "#saturn" },\n { img: "https://upload.wikimedia.org/wikipedia/commons/d/d6/STS120LaunchHiRes-edit1.jpg", title: "Shuttle", link: "#shuttle" }\n ].map(item => \n ').concat(u,"\n )\n )\n ")}},{key:"checkbox",value:function(t){var e=t.el,n="string"==typeof e.label?new ct(e.label).set({size:"S6"}):e.label;return this.attachRaster((new Zn).set(Wo(Wo({},this.elOpts(e,["label"])),void 0!==n?{label:n}:{})),e,t.customOptions)}},{key:"stack",value:function(t){var e=this,n=t.el,r=(new _e).set(this.elOpts(n)),o=Array.isArray(n.children)?n.children:null;return o&&r.add(o.map(function(n){return e.mapType(Wo(Wo({},t),{},{el:n}))})),this.attachRaster(r,n,t.customOptions)}},{key:"form",value:function(t){var e,n=this,r=t.el,o=(new uo).set(Wo(Wo({action:null!==(e=r.action)&&void 0!==e?e:""},void 0!==r.method?{method:r.method}:{}),void 0!==r.id?{id:r.id}:{})),i=Array.isArray(r.children)?r.children:null;return i&&o.add(i.map(function(e){return n.mapType(Wo(Wo({},t),{},{el:e}))})),o}},{key:"simple",value:function(t){var e,n,r=this,o=t.el,i=Array.isArray(o.react)?o.react:[];if(!i.length)throw new Error('[nodality] a "simple" element needs a non-empty `react` array of { at, template }.');var a=(Array.isArray(o.children)?o.children:[]).map(function(e){var n=r.mapType(Wo(Wo({},t),{},{el:e})).toCode();return Array.isArray(n)?n.join(""):String(n)}).join(",\n ");return"new AreaSwitcher()\n .set(".concat(JSON.stringify(Wo({gap:null!==(e=o.gap)&&void 0!==e?e:"10px",height:null!==(n=o.height)&&void 0!==n?n:"700px"},void 0!==o.id?{id:o.id}:{})),")\n .react(").concat(JSON.stringify(i,null,2),")\n .add([\n ").concat(a,"\n ])")}},{key:"mapWrap",value:function(t){var e,n,r=this,o=t.el,i=null!==(e=t.el.kind)&&void 0!==e?e:"",a=new We(i).set(Wo(Wo({},o),{},{font:null!==(n=o.font)&&void 0!==n?n:"Arial",stroke:this.filtero("blast",o.id,t.customOptions),gradient:this.filtero("gradient",o.id,t.customOptions),animation:this.filtero("animation",o.id,t.customOptions),shadow:this.filtero("shadow",o.id,t.customOptions),transform:this.filtero("transform",o.id,t.customOptions),filtera:this.filtero("filter",o.id,t.customOptions),raster:this.filteroRaster(o.id,t.customOptions)})),s=Array.isArray(o.children)?o.children:null;return s&&a.add(s.map(function(e){return r.mapType(Wo(Wo({},t),{},{el:e}))})),a}},{key:"mapUList",value:function(t){var e,n,r=this,o=t.el,i=null!==(e=t.el.kind)&&void 0!==e?e:"",a=new yr(i).set(Wo(Wo({},o),{},{font:null!==(n=o.font)&&void 0!==n?n:"Arial",stroke:this.filtero("blast",o.id,t.customOptions),gradient:this.filtero("gradient",o.id,t.customOptions),animation:this.filtero("animation",o.id,t.customOptions),shadow:this.filtero("shadow",o.id,t.customOptions),transform:this.filtero("transform",o.id,t.customOptions),filtera:this.filtero("filter",o.id,t.customOptions),raster:this.filteroRaster(o.id,t.customOptions)})),s=Array.isArray(o.items)?o.items:null;return s&&a.setItems(s.map(function(e){return"string"==typeof e?new ct(e).set({}):r.mapType(Wo(Wo({},t),{},{el:e}))})),a}},{key:"getElType",value:function(t){return"p"===t?"S6":"S".concat(t.substr(1))}},{key:"filtero",value:function(t,e,n){return n.filter(function(e){return e.op.name===t}).filter(function(t){return!t.target||t.target.includes(e)})[0]}},{key:"elOpts",value:function(t){for(var e=new Set(["type","children","items","breakpoints","inputType","text","url"].concat(function(t){if(Array.isArray(t))return Lo(t)}(a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[])||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return Lo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lo(t,e):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];e.has(i)||(n[i]=t[i])}var a;return n}},{key:"attachRaster",value:function(t,e,n){var r=this.filteroRaster(e.id,n);return r&&t&&"function"==typeof t.rasterize&&t.rasterize(r),t}},{key:"filteroRaster",value:function(t,e){var n=(e||[]).filter(function(e){return e&&"string"==typeof e.op&&m.includes(e.op)&&(!e.target||t&&e.target.includes(t))});return n.length>0?n:void 0}}],e&&No(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();module.exports=e})();