nodality 1.5.2 → 1.5.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 (242) hide show
  1. package/README.md +2 -22
  2. package/dist/animator.cjs.js.LICENSE.txt +1 -1
  3. package/dist/animator.esm.js.LICENSE.txt +1 -1
  4. package/dist/audionew.cjs.js +1 -1
  5. package/dist/audionew.cjs.js.LICENSE.txt +1 -1
  6. package/dist/audionew.esm.js +1 -1
  7. package/dist/audionew.esm.js.LICENSE.txt +1 -1
  8. package/dist/base.cjs.js.LICENSE.txt +1 -1
  9. package/dist/base.esm.js.LICENSE.txt +1 -1
  10. package/dist/beta-desktop-bar.cjs.js.LICENSE.txt +1 -1
  11. package/dist/beta-desktop-bar.esm.js.LICENSE.txt +1 -1
  12. package/dist/beta-mobile-bar.cjs.js.LICENSE.txt +1 -1
  13. package/dist/beta-mobile-bar.esm.js.LICENSE.txt +1 -1
  14. package/dist/bundle.umd.js +1 -1
  15. package/dist/bundle.umd.js.LICENSE.txt +28 -1
  16. package/dist/button.cjs.js +1 -1
  17. package/dist/button.cjs.js.LICENSE.txt +1 -1
  18. package/dist/button.esm.js +1 -1
  19. package/dist/button.esm.js.LICENSE.txt +1 -1
  20. package/dist/card-getter.cjs.js.LICENSE.txt +1 -1
  21. package/dist/card-getter.esm.js.LICENSE.txt +1 -1
  22. package/dist/center.cjs.js.LICENSE.txt +1 -1
  23. package/dist/center.esm.js.LICENSE.txt +1 -1
  24. package/dist/checkbox.cjs.js +1 -1
  25. package/dist/checkbox.cjs.js.LICENSE.txt +1 -1
  26. package/dist/checkbox.esm.js +1 -1
  27. package/dist/checkbox.esm.js.LICENSE.txt +1 -1
  28. package/dist/code.cjs.js +1 -1
  29. package/dist/code.cjs.js.LICENSE.txt +1 -1
  30. package/dist/code.esm.js +1 -1
  31. package/dist/code.esm.js.LICENSE.txt +1 -1
  32. package/dist/container.cjs.js +1 -1
  33. package/dist/container.cjs.js.LICENSE.txt +1 -1
  34. package/dist/container.esm.js +1 -1
  35. package/dist/container.esm.js.LICENSE.txt +1 -1
  36. package/dist/data-list.cjs.js.LICENSE.txt +1 -1
  37. package/dist/data-list.esm.js.LICENSE.txt +1 -1
  38. package/dist/designer.cjs.js +1 -1
  39. package/dist/designer.cjs.js.LICENSE.txt +28 -1
  40. package/dist/designer.esm.js +1 -1
  41. package/dist/designer.esm.js.LICENSE.txt +28 -1
  42. package/dist/element-mapper.cjs.js +1 -1
  43. package/dist/element-mapper.cjs.js.LICENSE.txt +1 -1
  44. package/dist/element-mapper.esm.js +1 -1
  45. package/dist/element-mapper.esm.js.LICENSE.txt +1 -1
  46. package/dist/finalresult.esm.js +1 -1
  47. package/dist/finalresult.esm.js.LICENSE.txt +28 -1
  48. package/dist/flex-card.cjs.js.LICENSE.txt +1 -1
  49. package/dist/flex-card.esm.js.LICENSE.txt +1 -1
  50. package/dist/flex-grid.cjs.js +1 -1
  51. package/dist/flex-grid.cjs.js.LICENSE.txt +1 -1
  52. package/dist/flex-grid.esm.js +1 -1
  53. package/dist/flex-grid.esm.js.LICENSE.txt +1 -1
  54. package/dist/flex-row.cjs.js +1 -1
  55. package/dist/flex-row.cjs.js.LICENSE.txt +1 -1
  56. package/dist/flex-row.esm.js +1 -1
  57. package/dist/flex-row.esm.js.LICENSE.txt +1 -1
  58. package/dist/floating-input.cjs.js.LICENSE.txt +1 -1
  59. package/dist/floating-input.esm.js.LICENSE.txt +1 -1
  60. package/dist/free.cjs.js.LICENSE.txt +1 -1
  61. package/dist/free.esm.js.LICENSE.txt +1 -1
  62. package/dist/horizontal-scroller.cjs.js.LICENSE.txt +1 -1
  63. package/dist/horizontal-scroller.esm.js.LICENSE.txt +1 -1
  64. package/dist/image-picker.cjs.js.LICENSE.txt +1 -1
  65. package/dist/image-picker.esm.js.LICENSE.txt +1 -1
  66. package/dist/image.cjs.js +1 -1
  67. package/dist/image.cjs.js.LICENSE.txt +1 -1
  68. package/dist/image.esm.js +1 -1
  69. package/dist/image.esm.js.LICENSE.txt +1 -1
  70. package/dist/index.cjs.js +1 -1
  71. package/dist/index.cjs.js.LICENSE.txt +28 -1
  72. package/dist/index.d.ts +1 -1
  73. package/dist/index.esm.js +1 -1
  74. package/dist/index.esm.js.LICENSE.txt +28 -1
  75. package/dist/keyframe-animation.cjs.js.LICENSE.txt +1 -1
  76. package/dist/keyframe-animation.esm.js.LICENSE.txt +1 -1
  77. package/dist/link-getter.cjs.js +1 -1
  78. package/dist/link-getter.cjs.js.LICENSE.txt +1 -1
  79. package/dist/link-getter.esm.js +1 -1
  80. package/dist/link-getter.esm.js.LICENSE.txt +1 -1
  81. package/dist/link.cjs.js +1 -1
  82. package/dist/link.cjs.js.LICENSE.txt +1 -1
  83. package/dist/link.esm.js +1 -1
  84. package/dist/link.esm.js.LICENSE.txt +1 -1
  85. package/dist/meta-adder.cjs.js.LICENSE.txt +1 -1
  86. package/dist/meta-adder.esm.js.LICENSE.txt +1 -1
  87. package/dist/modal-2025.cjs.js.LICENSE.txt +1 -1
  88. package/dist/modal-2025.esm.js.LICENSE.txt +1 -1
  89. package/dist/multiswitcher.cjs.js +1 -1
  90. package/dist/multiswitcher.cjs.js.LICENSE.txt +1 -1
  91. package/dist/multiswitcher.esm.js +1 -1
  92. package/dist/multiswitcher.esm.js.LICENSE.txt +1 -1
  93. package/dist/new-nav-bar.cjs.js.LICENSE.txt +1 -1
  94. package/dist/new-nav-bar.esm.js.LICENSE.txt +1 -1
  95. package/dist/picker.cjs.js.LICENSE.txt +1 -1
  96. package/dist/picker.esm.js.LICENSE.txt +1 -1
  97. package/dist/progress.cjs.js.LICENSE.txt +1 -1
  98. package/dist/progress.esm.js.LICENSE.txt +1 -1
  99. package/dist/radio.cjs.js.LICENSE.txt +1 -1
  100. package/dist/radio.esm.js.LICENSE.txt +1 -1
  101. package/dist/range.cjs.js.LICENSE.txt +1 -1
  102. package/dist/range.esm.js.LICENSE.txt +1 -1
  103. package/dist/scroll-video.cjs.js.LICENSE.txt +1 -1
  104. package/dist/scroll-video.esm.js.LICENSE.txt +1 -1
  105. package/dist/side-bar.cjs.js.LICENSE.txt +1 -1
  106. package/dist/side-bar.esm.js.LICENSE.txt +1 -1
  107. package/dist/side-nav-bar.cjs.js.LICENSE.txt +1 -1
  108. package/dist/side-nav-bar.esm.js.LICENSE.txt +1 -1
  109. package/dist/simple-bar.cjs.js.LICENSE.txt +1 -1
  110. package/dist/simple-bar.esm.js.LICENSE.txt +1 -1
  111. package/dist/slider-2025.cjs.js +1 -1
  112. package/dist/slider-2025.cjs.js.LICENSE.txt +1 -1
  113. package/dist/slider-2025.esm.js +1 -1
  114. package/dist/slider-2025.esm.js.LICENSE.txt +1 -1
  115. package/dist/spacer.cjs.js.LICENSE.txt +1 -1
  116. package/dist/spacer.esm.js.LICENSE.txt +1 -1
  117. package/dist/stack.cjs.js.LICENSE.txt +1 -1
  118. package/dist/stack.esm.js.LICENSE.txt +1 -1
  119. package/dist/stacker.cjs.js.LICENSE.txt +1 -1
  120. package/dist/stacker.esm.js.LICENSE.txt +1 -1
  121. package/dist/table.cjs.js.LICENSE.txt +1 -1
  122. package/dist/table.esm.js.LICENSE.txt +1 -1
  123. package/dist/text-field.cjs.js.LICENSE.txt +1 -1
  124. package/dist/text-field.esm.js.LICENSE.txt +1 -1
  125. package/dist/text.cjs.js +1 -1
  126. package/dist/text.cjs.js.LICENSE.txt +1 -1
  127. package/dist/text.esm.js +1 -1
  128. package/dist/text.esm.js.LICENSE.txt +1 -1
  129. package/dist/theme.cjs.js.LICENSE.txt +1 -1
  130. package/dist/theme.esm.js.LICENSE.txt +1 -1
  131. package/dist/transform-anim.cjs.js.LICENSE.txt +1 -1
  132. package/dist/transform-anim.esm.js.LICENSE.txt +1 -1
  133. package/dist/ulist.cjs.js +1 -1
  134. package/dist/ulist.cjs.js.LICENSE.txt +1 -1
  135. package/dist/ulist.esm.js +1 -1
  136. package/dist/ulist.esm.js.LICENSE.txt +1 -1
  137. package/dist/video.cjs.js +1 -1
  138. package/dist/video.cjs.js.LICENSE.txt +1 -1
  139. package/dist/video.esm.js +1 -1
  140. package/dist/video.esm.js.LICENSE.txt +1 -1
  141. package/dist/wrap.cjs.js.LICENSE.txt +1 -1
  142. package/dist/wrap.esm.js.LICENSE.txt +1 -1
  143. package/dist/zoom-card.cjs.js.LICENSE.txt +1 -1
  144. package/dist/zoom-card.esm.js.LICENSE.txt +1 -1
  145. package/layout/animator.js +1 -1
  146. package/layout/audio.js +1 -1
  147. package/layout/audionew.js +3 -2
  148. package/layout/base.js +1 -1
  149. package/layout/beta-desktop-bar.js +1 -1
  150. package/layout/beta-mobile-bar.js +1 -1
  151. package/layout/button.js +9 -7
  152. package/layout/center.js +1 -1
  153. package/layout/checkbox.js +3 -2
  154. package/layout/circle.js +1 -1
  155. package/layout/code.js +5 -11
  156. package/layout/container.js +14 -14
  157. package/layout/dropdown-2025.js +3 -2
  158. package/layout/flex-card.js +1 -1
  159. package/layout/flex-grid.js +4 -3
  160. package/layout/flex-row.js +3 -9
  161. package/layout/form-components/custom.js +1 -1
  162. package/layout/form-components/data-list.js +1 -1
  163. package/layout/form-components/floating-input.js +1 -1
  164. package/layout/form-components/form-all.js +1 -1
  165. package/layout/form-components/form.js +1 -1
  166. package/layout/form-components/image-picker.js +1 -1
  167. package/layout/form-components/picker.js +1 -1
  168. package/layout/form-components/radio.js +1 -1
  169. package/layout/form-components/radiogroup.js +1 -1
  170. package/layout/form-components/range.js +1 -1
  171. package/layout/free.js +1 -1
  172. package/layout/grid-overlay.js +1 -1
  173. package/layout/grid-switcher.js +1 -1
  174. package/layout/grid.js +1 -1
  175. package/layout/horizontal-scroller.js +1 -1
  176. package/layout/image.js +18 -17
  177. package/layout/index.js +1 -1
  178. package/layout/link.js +12 -12
  179. package/layout/list.js +1 -1
  180. package/layout/meta-adder.js +1 -1
  181. package/layout/modal-2025.js +1 -1
  182. package/layout/morph.js +1 -1
  183. package/layout/multiswitcher.js +3 -2
  184. package/layout/nav-bar.js +1 -1
  185. package/layout/nav-factor/custom-div.js +1 -1
  186. package/layout/new-nav-bar.js +1 -1
  187. package/layout/polygon.js +1 -1
  188. package/layout/prerender-site.js +1 -1
  189. package/layout/prerender.js +1 -1
  190. package/layout/progress.js +1 -1
  191. package/layout/row.js +1 -1
  192. package/layout/scroll-video.js +1 -1
  193. package/layout/shop.js +1 -1
  194. package/layout/side-bar.js +1 -1
  195. package/layout/side-nav-bar.js +1 -1
  196. package/layout/simple-bar.js +1 -1
  197. package/layout/slider-2025.js +1 -1
  198. package/layout/spacer.js +1 -1
  199. package/layout/stack.js +1 -1
  200. package/layout/svg.js +1 -1
  201. package/layout/switcher.js +3 -2
  202. package/layout/table.js +1 -1
  203. package/layout/text-field.js +1 -1
  204. package/layout/text.js +21 -13
  205. package/layout/ulist.js +3 -2
  206. package/layout/video.js +3 -3
  207. package/layout/wrap.js +1 -1
  208. package/layout/zoom-card.js +1 -1
  209. package/lib/agent-surface.js +1 -1
  210. package/lib/card-getter.js +1 -1
  211. package/lib/check-page.js +1 -1
  212. package/lib/codegen.js +11 -2
  213. package/lib/data.js +1 -1
  214. package/lib/designer.js +4 -3
  215. package/lib/element-mapper.js +3 -2
  216. package/lib/element-params.generated.js +1 -1
  217. package/lib/grid-geometry.js +1 -1
  218. package/lib/keyframe-animation.js +1 -1
  219. package/lib/known-inert.js +1 -1
  220. package/lib/link-getter.js +1 -1
  221. package/lib/morph-node.js +1 -1
  222. package/lib/normalize-spec.js +1 -1
  223. package/lib/op-semantics.js +178 -0
  224. package/lib/parse-html.js +1 -1
  225. package/lib/raster-inspect.js +1 -1
  226. package/lib/raster-ops.js +1 -1
  227. package/lib/raster-presets.js +1 -1
  228. package/lib/react.js +1 -1
  229. package/lib/resolve-refs.js +1 -1
  230. package/lib/responsive.js +41 -1
  231. package/lib/scroll-video.js +1 -1
  232. package/lib/seo.js +1 -1
  233. package/lib/stacker.js +1 -1
  234. package/lib/suggest.js +1 -1
  235. package/lib/theme.js +1 -1
  236. package/lib/transform-anim.js +1 -1
  237. package/lib/transition.js +1 -1
  238. package/lib/validate-nodes.js +13 -2
  239. package/lib/view-transition.js +1 -1
  240. package/lib/webmcp-adapter.js +1 -1
  241. package/package.json +1 -1
  242. package/skills/nodality/SKILL.md +3 -5
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see designer.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,{Des:()=>Kc});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(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var a=r&&r.prototype instanceof c?r:c,u=Object.create(a.prototype);return s(u,"_invoke",function(n,r,o){var i,a,s,c=0,u=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,a=0,s=t,d.n=n,l}};function h(n,r){for(a=n,s=r,e=0;!f&&c&&!o&&e<u.length;e++){var o,i=u[e],h=d.p,p=i[2];n>3?(o=p===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,a=0))}if(o||n>1)return l;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),a=u,s=p;(e=a<2?t:s)||!f;){i||(a?a<3?(a>1&&(d.n=-1),h(a,s)):d.n=s:d.v=s);try{if(c=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(f=d.n<0)?s:n.call(r,d))!==l)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),u}var l={};function c(){}function u(){}function f(){}e=Object.getPrototypeOf;var d=[][r]?e(e([][r]())):(s(e={},r,function(){return this}),e),h=f.prototype=c.prototype=Object.create(d);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(h),t}return u.prototype=f,s(h,"constructor",f),s(f,"constructor",u),u.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(h),s(h,o,"Generator"),s(h,r,function(){return this}),s(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:p}})()}function s(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,n,r){if(e)o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n;else{var i=function(e,n){s(t,e,function(t){return this._invoke(e,n,t)})};i("next",0),i("throw",1),i("return",2)}},s(t,e,n,r)}function l(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function c(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){l(i,r,o,a,s,"next",t)}function s(t){l(i,r,o,a,s,"throw",t)}a(void 0)})}}function u(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||p(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 f(t){return f="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},f(t)}function d(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=p(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 h(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)||p(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 p(t,e){if(t){if("string"==typeof t)return y(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)?y(t,e):void 0}}function y(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 m={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}}},v=Object.keys(m),b={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. Away from the focus a lifted chain is untouched — no magnification, no border — so with `by: "hover"` the element is pixel-identical at rest and the cells appear only under the pointer.',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=h(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",g(n[0])],b:["3fv",g(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",needs:"cell",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",g(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",g(t.ink||"#0B1B2B")],paper:["3fv",g(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",g(t.ink||"#0B1B2B")],paper:["3fv",g(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]}}},particles:{doc:{summary:"Breaks the image into one particle per cell, which shrinks to a dot and scatters on its own heading. Built for transitions (t-particles), where the gaps are transparent; elsewhere they show the image unmoved.",params:{size:{default:6,unit:"px",summary:"particle size: one particle per cell this big"},amount:{default:1,unit:"ratio",summary:"0 is the intact image, 1 fully scattered"},reach:{default:4,unit:"count",structural:!0,summary:"travel limit: a particle moves at most reach - 1 cells. Compiled in, and the cost: each pixel searches (2·reach + 1)² cells."},seed:{default:0,unit:"count",summary:"picks a different scatter of the same character"}}},structural:["reach"],stage:"displace",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"amount;\n uniform float ").concat(t,"seed;\n // Polynomial hash, as in flow: trig hashes band on Apple\n // silicon and differ between GPU vendors.\n float ").concat(t,"h(vec2 v) {\n vec3 q = fract(vec3(v.xyx) * 0.1031 + ").concat(t,"seed * 0.1);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n }")},code:function(t,e){var n=Math.max(1,Math.min(6,Math.round(null!=e.reach?e.reach:4)));return"\n {\n float sz = max(".concat(t,"size, 1.0);\n float a = clamp(").concat(t,"amount, 0.0, 1.0);\n if (a > 0.0) {\n vec2 x = sampleP;\n vec2 q = floor(x / sz);\n // Square and full-size at rest, so at a = 0 the cells tile\n // the image exactly; round and at 45% in full flight.\n float h = sz * 0.5 * (1.0 - 0.55 * a);\n float travel = ").concat(n-1,".0 * sz * a;\n float best = -1.0;\n vec2 hit = vec2(-1.0e5);\n for (int j = -").concat(n,"; j <= ").concat(n,"; j++) {\n for (int i = -").concat(n,"; i <= ").concat(n,"; i++) {\n vec2 c = q + vec2(float(i), float(j));\n vec2 dir = vec2(").concat(t,"h(c), ").concat(t,"h(c + vec2(57.3, 11.9))) * 2.0 - 1.0;\n // How far this one goes, and how high it stacks.\n float k = ").concat(t,"h(c + vec2(31.7, 83.1));\n vec2 home = (c + 0.5) * sz;\n vec2 d = x - (home + dir * travel * (0.35 + 0.65 * k));\n float dist = mix(max(abs(d.x), abs(d.y)), length(d), a);\n if (dist <= h && k > best) {\n best = k;\n // The particle carries its own cell, shrunk.\n hit = home + d * (0.5 * sz / h);\n }\n }\n }\n#ifdef NOD_TRANSITION\n // A gap lands outside both boxes, which is transparent.\n sampleP = hit;\n#else\n // No backdrop outside a transition: a gap would clamp to an\n // edge texel, so it shows the image unmoved instead.\n if (best >= 0.0) sampleP = hit;\n#endif\n }\n }")},uniforms:function(t,e){return{size:["1f",(null!=t.size?t.size:6)*e],amount:["1f",null!=t.amount?t.amount:1],seed:["1f",null!=t.seed?t.seed:0]}}},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(C(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(C(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. This default is the shader\'s; the DOM path that an element of type "copy" takes uses 3 instead.'},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"},animation:{default:!1,unit:"bool",readBy:"element-mapper",summary:'DOM path only. An element of type "copy" is built by the mapper rather than by the shader, and this asks that mapper for animated copies; the shader path ignores it. Declared because the mapper has always read it and the docs have always taught it, while the registry did not list it – so the validator reported a documented, working node as an unknown parameter.'}}},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",g(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",g(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=g(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",g(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),l=1;l<a.length;l++){var c=a[l-1],u=a[l],f=c.x-u.x,h=c.y-u.y,p=Math.hypot(f,h)||1e-4,y=t.seg;p>y&&(u.x+=f*(1-y/p),u.y+=h*(1-y/p)),u.x+=(c.x-u.x)*s,u.y+=(c.y-u.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=d(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 S=new Float32Array(36),O=t.stretch,j=0;j<t.nTrail;j++){var E=a[j];S[3*j]=E.x,S[3*j+1]=E.y,S[3*j+2]=t.trailIdleR[j]+(t.trailMoveR[j]-t.trailIdleR[j])*O}return t.drifters.forEach(function(e,n){var r=t.nTrail+n;S[3*r]=e.x,S[3*r+1]=e.y,S[3*r+2]=e.r*(1+.12*Math.sin(e.phase))}),[{name:"blobs",kind:"3fv",value:S},{name:"count",kind:"1i",value:t.nTrail+t.drifters.length}]}}};function g(t){return[1,3,5].map(function(e){return parseInt(t.slice(e,e+2),16)/255})}var w=Object.keys(b).concat("switch"),x=["px","ratio","deg","count","seconds"];function k(t,e,n){if(!Array.isArray(n)||n.length<2)return!1;var r,o=d(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=b[t],s=a&&a.doc&&a.doc.params&&a.doc.params[e];return!!s&&x.includes(s.unit)}function S(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 O={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)}},j=Object.keys(O);function E(t){return t?"texElementSubImage2D"in t?"sub-image":"texElementImage2D"in t?"image":null:null}function _(t){t.removeAttribute("content"),t.removeAttribute("layoutsubtree"),t.removeAttribute("data-nodality-raster-api")}var A="attribute vec2 a; void main(){ gl_Position = vec4(a, 0.0, 1.0); }",T={warp:["warped"],cell:["center","edge"],displace:["sampleP","chroma"],color:["col","edgeCol","edgeCov","ovCol","ovA"]},C=(["field"].concat(u(Object.keys(T))),"what steers the effect: ".concat(v.join(", "),". "),"easing for this node's local progress: ".concat(j.join(", ")),function(t){return"fld_".concat(String(t).replace(/[^A-Za-z0-9_]/g,""))}),P=function(t){return!0===t.masked?"mask":"string"==typeof t.masked?t.masked:null},R=function(t){return"edge"===t||"edgeCov"===t||"ovA"===t?"float":"col"===t||"edgeCol"===t||"ovCol"===t?"vec3":"vec2"},I={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 M(t,e){var n,r=[],o=d(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=M(i.a,e),a.b=M(i.b,e)),r.push(a)}}}catch(t){o.e(t)}finally{o.f()}return r}function D(t,e){var n,r=d(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=I[t.node.mode]||I.over,o={field:"",warp:"",cell:"",displace:"",color:""},i={field:"",warp:"",cell:"",displace:"",color:""};D(t.a||[],o),D(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=T[t],c=" {\n";a.forEach(function(t,e){c+=" ".concat(R(t)," pre").concat(e," = ").concat(t,";\n")}),c+=o[t],a.forEach(function(t,e){c+=" ".concat(R(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"===R(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=b[r.op];if(!o)return 0;var i="u".concat(t.i,"_"),a=Array.isArray(o.stage)?o.stage:[o.stage],s=P(r);a.forEach(function(t){var n=o.code(i,r,t)+"\n";if(s&&T[t]){var a=T[t],l=a.map(function(t,e){return" ".concat(R(t)," msv").concat(e," = ").concat(t,";")}).join("\n"),c=a.map(function(t,e){return" ".concat(t," = mix(msv").concat(e,", ").concat(t,", ").concat(C(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 F(t,e,n,r){var o=r&&r.fade||"opaque",i=function(t){var e=Number(t);return(Number.isFinite(e)?e:0).toFixed(5)},a=function(t){return t&&t.w>0&&t.h>0?t.h/t.w:0},s=!(!r||"width"!==r.fit),l=r&&Array.isArray(r.crossfade)&&2===r.crossfade.length?r.crossfade:null,c="",f=new Set;e.forEach(function(t){var e=b[t.op];e&&e.producesField&&f.add(t.as||"mask");var n=P(t);n&&f.add(n)});var d=u(f).map(function(t){return" float ".concat(C(t)," = 1.0;")}).join("\n");e.forEach(function(t,e){var n=b[t.op];n&&(c+=n.decl("u".concat(e,"_"),t)+"\n")});var h=function(t){var e=t&&t.node&&t.node.side;if("old"!==e&&"new"!==e)return null;var n=b[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)},p=t.filter(function(t){return!h(t)}),y=t.filter(function(t){return"old"===h(t)}),m=t.filter(function(t){return"new"===h(t)}),v={field:"",warp:"",cell:"",displace:"",color:""};D(p,v);var g=function(t,e){if(!t.length)return"";var n={field:"",warp:"",cell:"",displace:"",color:""};if(D(t,n),!n.color)return"";var r=T.color.filter(function(t){return"col"!==t}).map(function(t){return" ".concat(R(t)," ").concat(t," = ").concat("vec3"===R(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")},w=g(y,"o"),x=g(m,"n"),k=v.field,S=v.warp,O=v.cell,j=v.displace,E=v.color,_=e,A=_.some(function(t){return"edges"===t.op})?"":" col *= 1.0 - edge * 0.55;",I=_.some(function(t){return(b[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;":"",M=n?"uniform vec2 u_probe;\n":"",F=n?"u_probe + vec2(0.5)":"gl_FragCoord.xy";return"\nprecision highp float;\n".concat(r?"#define NOD_TRANSITION 1\n":"","uniform 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(M).concat(c,"\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}\n").concat(s?'// fit: "width" — the capture\'s own height at this box width.\nvec2 nodFitUV(vec4 box, vec2 p, float aspect) {\n return vec2((p.x - box.x) / max(box.z, 1.0),\n 1.0 - (p.y - box.y) / max(box.z * aspect, 1.0));\n}\n':"","vec4 nodSampleAt(vec2 p) {\n").concat(s?" vec2 uo = nodFitUV(u_boxOld, p, ".concat(i(a(r.oldRect)),");\n vec2 un = nodFitUV(u_boxNew, p, ").concat(i(a(r.newRect)),");"):" 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(s?" // Clipped to the travelling box as well, so a tall capture in a\n // short box shows its top rather than spilling below it.\n o.a *= nodInBox(nodBoxUV(u_boxOld, p));\n n.a *= nodInBox(nodBoxUV(u_boxNew, p));\n":"").concat(w).concat(x,"\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, ").concat(l?"smoothstep(".concat(i(l[0]),", ").concat(i(l[1]),", u_t)"):"u_t",", d);\n}"):"","\nvoid main() {\n vec2 fc = ").concat(F,";\n vec2 frag = vec2(fc.x, u_res.y - fc.y);\n").concat(d,"\n").concat(k,"\n vec2 warped = frag;\n").concat(S,"\n vec2 center = warped;\n float edge = 0.0;\n").concat(O,"\n vec2 sampleP = warped;\n vec2 chroma = vec2(0.0);\n").concat(j).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(I,"\n vec3 edgeCol = vec3(1.0);\n float edgeCov = 0.0;\n vec3 ovCol = vec3(0.0);\n float ovA = 0.0;\n").concat(E,"\n").concat(A,"\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 z=/\d(?:vw|vh|vmin|vmax|dvw|dvh|svw|svh|lvw|lvh)\b/i,L=["font-size","line-height","letter-spacing","word-spacing"],N=["color","font-family","font-size","font-weight","font-style","line-height","letter-spacing","text-align","text-transform","text-decoration-color","white-space","word-break"],B=["background-color","background-image","background-size","background-position","background-repeat","background-clip","border-radius","box-shadow","opacity","outline-color"],W=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"]),q=new Map,U=null,H=/@font-face\s*{[^}]*}/gi,G=/font-family\s*:\s*(['"]?)([^;'"]+)\1/i,X=/font-weight\s*:\s*([^;]+)/i,J=/font-style\s*:\s*([^;]+)/i,V=/url\((['"]?)([^)'"]+)\1\)/gi,$=/unicode-range\s*:\s*([^;}]+)/i;function Y(t,e){if(!t)return!0;var n,r=[],o=d(t.split(","));try{for(o.s();!(n=o.n()).done;){var i=n.value,a=/U\+([0-9a-fA-F?]+)(?:-([0-9a-fA-F]+))?/.exec(i.trim());if(a)if(-1!==a[1].indexOf("?"))r.push([parseInt(a[1].replace(/\?/g,"0"),16),parseInt(a[1].replace(/\?/g,"F"),16)]);else{var s=parseInt(a[1],16);r.push([s,a[2]?parseInt(a[2],16):s])}}}catch(t){o.e(t)}finally{o.f()}if(!r.length)return!0;var l,c=d(e);try{for(c.s();!(l=c.n()).done;)for(var u=l.value.codePointAt(0),f=0;f<r.length;f++)if(u>=r[f][0]&&u<=r[f][1])return!0}catch(t){c.e(t)}finally{c.f()}return!1}function Q(t,e){var n,r=[],o=d(t.match(H)||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=G.exec(i);if(a){var s=[],l=void 0;for(V.lastIndex=0;l=V.exec(i);)try{s.push(new URL(l[2],e).href)}catch(t){}s.length&&r.push({family:a[2].trim().toLowerCase(),weight:(X.exec(i)||[,"400"])[1].trim(),style:(J.exec(i)||[,"normal"])[1].trim(),range:($.exec(i)||[,""])[1].trim(),block:i,urls:s})}}}catch(t){o.e(t)}finally{o.f()}return r}function K(){return Z.apply(this,arguments)}function Z(){return(Z=c(a().m(function t(){var e,n,r,o,i,s,l,c,f,d,h,p,y,m,v,b,g;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!U){t.n=1;break}return t.a(2,U);case 1:e=[],n=0,r=Array.from(document.styleSheets||[]);case 2:if(!(n<r.length)){t.n=10;break}o=r[n],i=null;try{i=o.cssRules}catch(t){i=null}if(!i){t.n=3;break}for(s=0,l=Array.from(i);s<l.length;s++)(c=l[s]).constructor&&"CSSFontFaceRule"===c.constructor.name&&e.push.apply(e,u(Q(c.cssText,o.href||location.href)));t.n=9;break;case 3:if(!o.href){t.n=9;break}return t.p=4,t.n=5,fetch(o.href,{mode:"cors"});case 5:if(!(f=t.v).ok){t.n=7;break}return d=e.push,h=e,p=u,y=Q,t.n=6,f.text();case 6:m=t.v,v=o.href,b=y(m,v),g=p(b),d.apply.call(d,h,g);case 7:t.n=9;break;case 8:t.p=8,t.v;case 9:n++,t.n=2;break;case 10:return U=e,t.a(2,e)}},t,null,[[4,8]])}))).apply(this,arguments)}function tt(t){return et.apply(this,arguments)}function et(){return(et=c(a().m(function t(e){var n,r,o,i,s,l,c,u;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!q.has(e)){t.n=1;break}return t.a(2,q.get(e));case 1:return n=null,t.p=2,t.n=3,fetch(e,{mode:"cors"});case 3:if(!(r=t.v).ok){t.n=5;break}return c=Uint8Array,t.n=4,r.arrayBuffer();case 4:for(u=t.v,o=new c(u),i="",s=0;s<o.length;s++)i+=String.fromCharCode(o[s]);l=e.endsWith(".woff2")?"font/woff2":e.endsWith(".woff")?"font/woff":"font/ttf",n="data:".concat(l,";base64,").concat(btoa(i));case 5:t.n=7;break;case 6:t.p=6,t.v,n=null;case 7:return q.set(e,n),t.a(2,n)}},t,null,[[2,6]])}))).apply(this,arguments)}function nt(t){for(var e=new Map,n=0,r=[t].concat(u(t.querySelectorAll("*")));n<r.length;n++){var o=r[n],i=window.getComputedStyle(o),a=(i.fontFamily||"").split(",")[0].trim().replace(/^['"]|['"]$/g,"");if(a){var s="".concat(a.toLowerCase(),"|").concat(i.fontWeight,"|").concat(i.fontStyle);e.has(s)||e.set(s,{family:a.toLowerCase(),weight:i.fontWeight,style:i.fontStyle})}}return Array.from(e.values())}function rt(){return(rt=c(a().m(function t(e){var n,r,o,i,s,l,c,u,f,h,p,y,m,v;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,K();case 1:n=t.v,t.n=3;break;case 2:return t.p=2,t.v,t.a(2,"");case 3:if(n.length){t.n=4;break}return t.a(2,"");case 4:if(r=nt(e),o=e.textContent||"",i=n.filter(function(t){return Y(t.range,o)&&r.some(function(e){return e.family===t.family&&(t.style===e.style||"normal"===t.style)&&(t.weight===String(e.weight)||/\s/.test(t.weight))})}),i.length){t.n=5;break}return t.a(2,"");case 5:s=[],l=d(i),t.p=6,l.s();case 7:if((c=l.n()).done){t.n=18;break}u=c.value,f=null,h=d(u.urls),t.p=8,h.s();case 9:if((p=h.n()).done){t.n=12;break}return y=p.value,t.n=10,tt(y);case 10:if(!(f=t.v)){t.n=11;break}return t.a(3,12);case 11:t.n=9;break;case 12:t.n=14;break;case 13:t.p=13,m=t.v,h.e(m);case 14:return t.p=14,h.f(),t.f(14);case 15:if(f){t.n=16;break}return t.a(3,17);case 16:s.push("@font-face{font-family:'".concat(u.family,"';font-style:").concat(u.style,";")+"font-weight:".concat(u.weight,";src:url(").concat(f,");}"));case 17:t.n=7;break;case 18:t.n=20;break;case 19:t.p=19,v=t.v,l.e(v);case 20:return t.p=20,l.f(),t.f(20);case 21:return t.a(2,s.join(""))}},t,null,[[8,13,14,15],[6,19,20,21],[0,2]])}))).apply(this,arguments)}var ot={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 it(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=ot[t]||t;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return!1;try{return window.matchMedia(e).matches}catch(t){return!1}}function at(t,e){if(!Array.isArray(t))return[];if((e||0)>8)return[];var n,r=[],o=d(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&"switch"===i.op){var a,s=d(at((it(i.when)?i.use:i.else)||[],(e||0)+1));try{for(s.s();!(a=s.n()).done;){var l=a.value;r.push(l)}}catch(t){s.e(t)}finally{s.f()}}else r.push(i)}}catch(t){o.e(t)}finally{o.f()}return r}var st=new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),lt=["objectFit","objectPosition","borderRadius","imageRendering","filter"],ct=new Set;function ut(){return u(ct)}var ft=["op","masked","live"],dt=!1;function ht(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=at(e,0)).length&&!o)return null;var i=[],a=M(e,i);if(e=i,"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return null;if(st.has(t.tagName)){var s=t.parentElement&&t.parentElement.hasAttribute&&t.parentElement.hasAttribute("data-nodality-raster-host")?t.parentElement:null;if(t=s||function(t){if(!t.parentNode)return null;var e,n={},r=d(lt);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 l=function(){var e=t.getBoundingClientRect();return{width:e.width>=2?e.width:t.scrollWidth||0,height:e.height>=2?e.height:t.scrollHeight||0}},c=l();if(c.width<2||c.height<2)return null;var p=Math.max(1,Math.min(n&&n.resolution?n.resolution:window.devicePixelRatio||1,3)),y=e.some(function(t){return(b[t.op]||{}).overlay}),g=e.length>0&&!o&&e.every(function(t){return(b[t.op]||{}).overlay}),w=!(!o||!0!==o.live),x=!g&&(!o||w)&&!e.some(function(t){return!1===t.live}),j=E("undefined"!=typeof WebGL2RenderingContext&&WebGL2RenderingContext.prototype)||E("undefined"!=typeof WebGLRenderingContext&&WebGLRenderingContext.prototype),T=x&&null!==j;x&&!T&&console.info("[nodality] HTML-in-Canvas API not available - raster ops fall back to snapshot capture.");var C=document.createElement("canvas");T&&function(t,e){"sub-image"===e?t.setAttribute("content","drawable"):t.setAttribute("layoutsubtree","")}(C,j);var R={alpha:!0,premultipliedAlpha:!1},I=C.getContext("webgl2",R)||C.getContext("webgl",R);if(!I)return null;var D="undefined"!=typeof WebGL2RenderingContext&&I instanceof WebGL2RenderingContext,q=D&&e.some(function(t){return(b[t.op]||{}).mips}),U=T?E(I):null;T&&U!==j&&(console.info("[nodality] HTML-in-Canvas upload missing on the created context ("+U+" vs "+j+") - snapshot fallback."),_(C),T=!1),"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),C.width=Math.round(c.width*p),C.height=Math.round(c.height*p),C.setAttribute("data-nodality-raster",T?"live":"snapshot"),T&&C.setAttribute("data-nodality-raster-api",U),console.info("[nodality] raster backend:",T?"html-in-canvas (live, "+U+")":"snapshot");var H={width:c.width,height:c.height},G=t;if(T){var X=document.createElement("div"),J=getComputedStyle(t),V="flex"===J.display||"inline-flex"===J.display,$="grid"===J.display||"inline-grid"===J.display,Y=function(t){return parseFloat(t)||0},Q=Y(J.paddingLeft)+Y(J.paddingRight),K=Y(J.paddingTop)+Y(J.paddingBottom);for(H.width=Math.max(2,c.width-Q),H.height=Math.max(2,c.height-K),X.style.cssText="display:".concat(V||$?J.display:"block",";")+"width:".concat(H.width,"px;height:").concat(H.height,"px;"),$&&(X.style.gridTemplateColumns=J.gridTemplateColumns,X.style.gridTemplateRows=J.gridTemplateRows,X.style.gridTemplateAreas=J.gridTemplateAreas,X.style.gap=J.gap,X.style.alignItems=J.alignItems,X.style.justifyItems=J.justifyItems),V&&(X.style.flexDirection=J.flexDirection,X.style.alignItems=J.alignItems,X.style.justifyContent=J.justifyContent,X.style.gap=J.gap),"sub-image"===U&&X.setAttribute("drawable","");t.firstChild;)X.appendChild(t.firstChild);C.appendChild(X),G=X,C.style.cssText="display:block;width:".concat(H.width,"px;height:").concat(H.height,"px;")}else if(C.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(c.width,"px;height:").concat(c.height,"px;")+"pointer-events:none;z-index:2147483000;",g)C.setAttribute("aria-hidden","true");else{C.setAttribute("role","img");var Z=(t.textContent||"").replace(/\s+/g," ").trim();Z&&C.setAttribute("aria-label",Z.slice(0,300))}t.appendChild(C);var tt=function(t,e){var n=I.createShader(t);if(I.shaderSource(n,e),I.compileShader(n),!I.getShaderParameter(n,I.COMPILE_STATUS))throw new Error("[nodality] raster shader: "+I.getShaderInfoLog(n));return n},et=I.createProgram();I.attachShader(et,tt(I.VERTEX_SHADER,A)),I.attachShader(et,tt(I.FRAGMENT_SHADER,F(a,e,!1,o))),I.bindAttribLocation(et,0,"a"),I.linkProgram(et),I.useProgram(et),I.bindBuffer(I.ARRAY_BUFFER,I.createBuffer()),I.bufferData(I.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),I.STATIC_DRAW),I.enableVertexAttribArray(0),I.vertexAttribPointer(0,2,I.FLOAT,!1,0,0);var nt=function(t){return I.getUniformLocation(et,t)},ot=function(t,e,n){"1f"===e?I.uniform1f(t,n):"1i"===e?I.uniform1i(t,n):"2fv"===e?I.uniform2fv(t,n):"3fv"===e&&I.uniform3fv(t,n)},it=0,ut=e.map(function(t,e){return{node:t,i:e}}).filter(function(t){return function(t){for(var e in t)if(k(t.op,e,t[e]))return!0;return!1}(t.node)}),pt=function(t,n){e.forEach(function(e,r){if(!n||n.has(r)){var o=b[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&&O[t.ease];return o?o(n):n}(t,e):e;for(var o in t)k(t.op,o,t[o])&&((n=n||Object.assign({},t))[o]=S(t[o],r));return n||t}(e,it),p);for(var a in i)ot(t("u".concat(r,"_").concat(a)),i[a][0],i[a][1])}}})};pt(nt);var yt=new Set(ut.map(function(t){return t.i})),mt=[];e.forEach(function(t,e){var n=b[t.op];n&&"function"==typeof n.init&&mt.push({i:e,def:n,state:n.init(t,p,C.width,C.height)})});var vt="undefined"!=typeof performance?performance.now():0,bt=[];e.forEach(function(t,e){var n=b[t.op];if(n&&n.solver){var r=function(t,e){var n=b[t.op];if(!D||!I.getExtension("EXT_color_buffer_float"))return console.info("[nodality] '"+t.op+"' needs WebGL2 float render targets - op skipped."),null;I.getExtension("OES_texture_float_linear");var r=n.solver.resolutions(t,C.width,C.height),o={r:[I.R16F,I.RED],rg:[I.RG16F,I.RG],rgba:[I.RGBA16F,I.RGBA]},i=[],a=function(t,e,n,r){var a=h(o[n],2),s=a[0],l=a[1],c=I.createTexture();I.bindTexture(I.TEXTURE_2D,c);var u=r?I.LINEAR:I.NEAREST;I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,u),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,u),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.texImage2D(I.TEXTURE_2D,0,s,t,e,0,l,I.HALF_FLOAT,null);var f=I.createFramebuffer();I.bindFramebuffer(I.FRAMEBUFFER,f),I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_2D,c,0);var d=I.checkFramebufferStatus(I.FRAMEBUFFER)===I.FRAMEBUFFER_COMPLETE;I.viewport(0,0,t,e),I.clearColor(0,0,0,1),I.clear(I.COLOR_BUFFER_BIT);var p={tex:c,fbo:f,w:t,h:e,ok:d};return i.push(p),p},s={},l=!0;for(var c in n.solver.targets){var u=n.solver.targets[c],f=r[u.res],d=h(Array.isArray(f)?f:[f,f],2),p=d[0],y=d[1];u.double?(s[c]={a:a(p,y,u.fmt,u.smooth),b:a(p,y,u.fmt,u.smooth)},l=l&&s[c].a.ok&&s[c].b.ok):(s[c]={a:a(p,y,u.fmt,u.smooth)},l=l&&s[c].a.ok)}I.bindFramebuffer(I.FRAMEBUFFER,null);var m=function(){return i.forEach(function(t){I.deleteFramebuffer(t.fbo),I.deleteTexture(t.tex)})};if(!l)return console.info("[nodality] '"+t.op+"' float targets incomplete - op skipped."),m(),null;var v={};try{for(var g in n.solver.programs){var w=I.createProgram();if(I.attachShader(w,tt(I.VERTEX_SHADER,A)),I.attachShader(w,tt(I.FRAGMENT_SHADER,n.solver.programs[g])),I.bindAttribLocation(w,0,"a"),I.linkProgram(w),!I.getProgramParameter(w,I.LINK_STATUS))throw new Error(g+": "+I.getProgramInfoLog(w));v[g]={prog:w,loc:{}}}}catch(e){for(var x in console.warn("[nodality] '"+t.op+"' solver programs failed:",e),m(),v)I.deleteProgram(v[x].prog);return null}return I.useProgram(et),{i:e,node:t,def:n,res:r,targets:s,progs:v,cleanup:m,prevX:.5,prevY:.5,primed:!1}}(t,e);r&&bt.push(r)}});var gt=function(t,e){var n=null,r={res:t.res,use:function(e){n=t.progs[e],I.useProgram(n.prog)},u:function(t){return t in n.loc||(n.loc[t]=I.getUniformLocation(n.prog,t)),n.loc[t]},f1:function(t,e){I.uniform1f(r.u(t),e)},f2:function(t,e,n){I.uniform2f(r.u(t),e,n)},f3:function(t,e,n,o){I.uniform3f(r.u(t),e,n,o)},smp:function(t,e,n){I.activeTexture(I.TEXTURE0+n),I.bindTexture(I.TEXTURE_2D,e.tex),I.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:wt},canvasW:C.width,canvasH:C.height,swap:function(e){var n=t.targets[e],r=n.a;n.a=n.b,n.b=r},blit:function(t){I.bindFramebuffer(I.FRAMEBUFFER,t.fbo),I.viewport(0,0,t.w,t.h),I.drawArrays(I.TRIANGLES,0,3)}},o=Bt[0]/C.width,i=1-Bt[1]/C.height,a=0,s=0;t.primed&&Wt&&(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=Wt&&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:C.width/Math.max(C.height,1),col:t.def.solver.splatColor(t.node,a,s)})},wt=I.createTexture();I.bindTexture(I.TEXTURE_2D,wt),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,q?I.LINEAR_MIPMAP_LINEAR:I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,!0);var xt=function(){q&&I.generateMipmap(I.TEXTURE_2D)},kt=!1,St=null,Ot=null;if(o&&o.oldImage){St=I.createTexture(),I.bindTexture(I.TEXTURE_2D,St),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE);try{I.texImage2D(I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,o.oldImage)}catch(t){console.warn("[nodality] transition: old capture upload failed:",t),I.deleteTexture(St),St=null}}if(o&&o.newImage){Ot=I.createTexture(),I.bindTexture(I.TEXTURE_2D,Ot),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE);try{I.texImage2D(I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,o.newImage)}catch(t){console.warn("[nodality] transition: new capture upload failed:",t),I.deleteTexture(Ot),Ot=null}}var jt=!1,Et=T?"live":"snapshot",_t=!1,At={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"},Tt=null,Ct=function(){if(!Tt){!function(){if(!dt&&"undefined"!=typeof document){dt=!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)}}(),Tt=[],t.setAttribute("data-nodality-ink","");for(var e=[t].concat(u(t.querySelectorAll("*"))).filter(function(t){return t!==C&&"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 a in At)i[a]=o.style.getPropertyValue(a);for(var s in Tt.push([o,i]),o.style.setProperty("--nod-ink",n[r]),At)o.style.setProperty(s,At[s],"important");o!==t&&o.matches&&o.matches("img,svg,video,picture,iframe")&&o.style.setProperty("opacity","0","important")}t.style.isolation="isolate",C.style.zIndex="-1"}},Pt=function(){if(t.style.visibility="",t.removeAttribute("data-nodality-ink"),Tt){var e,n=d(Tt);try{for(n.s();!(e=n.n()).done;){var r=h(e.value,2),o=r[0],i=r[1];for(var a in At)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()}Tt=null,t.style.isolation="",C.style.zIndex=""}},Rt=function(){if(!o)return!1;var e=it>=1,n=G!==t,r=o.standDownAtStart&&it<=0,i=e&&!n||r?"hidden":"visible";return C.style.visibility!==i&&(C.style.visibility=i),e||r?Tt&&Pt():Tt||Ct(),!0},It=function(){if(y){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 I.bindTexture(I.TEXTURE_2D,wt),I.texImage2D(I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,e),xt(),kt=!0,Promise.resolve()}catch(t){}else if(!_t){var n="IMG"===t.tagName?t:t.querySelector&&t.querySelector("img");n&&(_t=!0,n.addEventListener("load",function(){jt||It()},{once:!0}))}}C.style.display="none",Pt();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)):function(t){return rt.apply(this,arguments)}(t).catch(function(){return""}).then(function(o){return new Promise(function(i,a){var s=(new XMLSerializer).serializeToString(function(t,e){for(var n=[t].concat(u(t.querySelectorAll("*"))),r=[e].concat(u(e.querySelectorAll("*"))),o=0;o<n.length&&o<r.length;o++){var i=r[o].style;if(i){var a=null;if(i.length>0)for(var s=0,l=Array.from(i);s<l.length;s++){var c=l[s];if(z.test(i.getPropertyValue(c))){var f=(a=a||window.getComputedStyle(n[o])).getPropertyValue(c);f&&i.setProperty(c,f,i.getPropertyPriority(c))}}var h,p=d(L);try{for(p.s();!(h=p.n()).done;){var y=h.value,m=(a=a||window.getComputedStyle(n[o])).getPropertyValue(y);m&&"normal"!==m&&i.setProperty(y,m)}}catch(t){p.e(t)}finally{p.f()}var v,b=window.getComputedStyle(n[o]),g=n[o].parentElement,w=0!==o&&g?window.getComputedStyle(g):null,x=d(N);try{for(x.s();!(v=x.n()).done;){var k=v.value,S=b.getPropertyValue(k);S&&(w&&w.getPropertyValue(k)===S||i.getPropertyValue(k)||i.setProperty(k,S))}}catch(t){x.e(t)}finally{x.f()}var O,j=d(B);try{for(j.s();!(O=j.n()).done;){var E=O.value;if(!i.getPropertyValue(E)){var _=b.getPropertyValue(E);_&&!W.has(_)&&i.setProperty(E,_)}}}catch(t){j.e(t)}finally{j.f()}}}return e}(t,t.cloneNode(!0))),l='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(e,'" height="').concat(n,'" viewBox="0 0 ').concat(e," ").concat(n,'">')+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+(o?"<style>".concat(o,"</style>"):"")+"".concat(s,"</div>")+"</foreignObject></svg>",c=document.createElement("img");c.onload=function(){var t=document.createElement("canvas");t.width=Math.max(1,Math.round(e*r)),t.height=Math.max(1,Math.round(n*r));var o=t.getContext("2d");o?(o.drawImage(c,0,0,t.width,t.height),i(t)):i(c)},c.onerror=a,c.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(l)})})}(t,c.width,c.height,p).then(function(t){jt||(I.bindTexture(I.TEXTURE_2D,wt),I.texImage2D(I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,t),xt(),kt=!0,Rt()||(g||Ct(),C.style.visibility="visible"))}).catch(function(t){Pt(),console.warn("[nodality] raster snapshot failed:",t)});return C.style.display="",r},Mt="",Dt=-1,Ft=function(){if(!jt&&"live"===Et){if(I.bindTexture(I.TEXTURE_2D,wt),"sub-image"===U){try{!function(){var t=C.width+"x"+C.height;if(t!==Mt){var e=C.width,n=C.height;if("function"==typeof C.captureElementImage){var r=C.captureElementImage(G);try{e=Math.ceil(r.width),n=Math.ceil(r.height)}finally{r&&"function"==typeof r.close&&r.close()}}I.texImage2D(I.TEXTURE_2D,0,D?I.RGBA8||32856:I.RGBA,Math.max(1,e),Math.max(1,n),0,I.RGBA,I.UNSIGNED_BYTE,null),Mt=t}}(),I.texElementSubImage2D(I.TEXTURE_2D,0,0,0,G)}catch(t){return Mt="",void zt("texElementSubImage2D failed: "+(t&&t.name?t.name:"?")+": "+(t&&t.message?t.message:t))}return xt(),void(kt=!0)}var t,e=I.RGBA8||32856,n=[[I.TEXTURE_2D,e,G],[I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,G],[I.TEXTURE_2D,0,e,G],[I.TEXTURE_2D,0,G]];if(Dt>=0)t=[Dt];else{t=[0,1,2,3];var r={3:0,6:1,4:2}[I.texElementImage2D.length];null!=r&&(t.splice(t.indexOf(r),1),t.unshift(r))}var o,i=[],a=d(t);try{for(a.s();!(o=a.n()).done;){var s=o.value;try{return I.texElementImage2D.apply(I,n[s]),xt(),Dt<0&&(Dt=s,console.info("[nodality] texElementImage2D signature discovered: form",s,"(declared arity "+I.texElementImage2D.length+")")),void(kt=!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()}zt("texElementImage2D rejected all known signatures (arity "+I.texElementImage2D.length+"): "+i.join(" | "))}},zt=function(e){if(!jt&&"live"===Et){for(Et="snapshot",console.warn("[nodality] live raster backend failed ("+e+") - falling back to snapshot."),C.removeEventListener("paint",Ft);G.firstChild;)t.appendChild(G.firstChild);G.parentNode===C&&C.removeChild(G),_(C),C.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(c.width,"px;height:").concat(c.height,"px;")+"pointer-events:none;z-index:2147483000;",C.setAttribute("aria-hidden","true"),C.setAttribute("data-nodality-raster","snapshot-fallback"),It()}};if(T){C.addEventListener("paint",Ft);var Lt=function(){return setTimeout(function(){jt||"live"!==Et||kt||zt("no paint event within 1500ms")},1500)};if("undefined"!=typeof document&&"hidden"===document.visibilityState){var Nt=function(){"hidden"!==document.visibilityState&&(document.removeEventListener("visibilitychange",Nt),jt||Lt())};document.addEventListener("visibilitychange",Nt)}else Lt()}var Bt=[.5*C.width,.5*C.height],Wt=!1,qt=function(t){var e=C.getBoundingClientRect(),n=t.touches?t.touches[0]:t,r=[(n.clientX-e.left)*p,(n.clientY-e.top)*p];r[0]===Bt[0]&&r[1]===Bt[1]||(Wt=!0),Bt=r};t.addEventListener("mousemove",qt,{passive:!0}),t.addEventListener("touchmove",qt,{passive:!0});var Ut=0,Ht=0,Gt=function(){Ut=1},Xt=function(){Ut=0};t.addEventListener("mouseenter",Gt,{passive:!0}),t.addEventListener("mouseleave",Xt,{passive:!0});var Jt=[];e.forEach(function(t,e){var n=b[t.op]||{},r=t.by||n.defaultDriver;r&&m[r]?Jt.push({i:e,fn:m[r]}):t.by&&console.warn("[nodality] unknown driver '"+t.by+"' on op '"+t.op+"' - known drivers: "+v.join(", "))});var Vt=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)))},$t=0,Yt=null,Qt=function(t,e){I.uniform2f(t("u_res"),e.res[0],e.res[1]),I.uniform2f(t("u_mouse"),e.mouse[0],e.mouse[1]),I.uniform1f(t("u_time"),e.time),I.uniform1f(t("u_t"),e.t);var n,r=d(e.drivers);try{for(r.s();!(n=r.n()).done;){var i=n.value;I.uniform2f(t("u".concat(i.i,"_dpos")),i.x,i.y),I.uniform1f(t("u".concat(i.i,"_damt")),i.amt)}}catch(t){r.e(t)}finally{r.f()}var a,s=d(e.dyn);try{for(s.s();!(a=s.n()).done;){var l,c=a.value,u=d(c.ups);try{for(u.s();!(l=u.n()).done;){var f=l.value;ot(t("u".concat(c.i,"_").concat(f.name)),f.kind,f.value)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){s.e(t)}finally{s.f()}I.activeTexture(I.TEXTURE0),I.bindTexture(I.TEXTURE_2D,wt),I.uniform1i(t("u_tex"),0);var h=1;if(o&&St){I.activeTexture(I.TEXTURE0+h),I.bindTexture(I.TEXTURE_2D,St),I.uniform1i(t("u_old"),h),h++;var y=e.t,m=function(t,e){return[(t.x+(e.x-t.x)*y)*p,(t.y+(e.y-t.y)*y)*p,(t.w+(e.w-t.w)*y)*p,(t.h+(e.h-t.h)*y)*p]},v=m(o.oldRect,o.oldTo||o.newRect),b=m(o.newFrom||o.oldRect,o.newRect);I.uniform4f(t("u_boxOld"),v[0],v[1],v[2],v[3]),I.uniform4f(t("u_boxNew"),b[0],b[1],b[2],b[3]),Ot&&(I.activeTexture(I.TEXTURE0+h),I.bindTexture(I.TEXTURE_2D,Ot),I.uniform1i(t("u_newimg"),h),h++)}for(var g=0,w=bt;g<w.length;g++){var x=w[g],k=x.def.solver.samplers;for(var S in k)I.activeTexture(I.TEXTURE0+h),I.bindTexture(I.TEXTURE_2D,x.targets[k[S]].a.tex),I.uniform1i(t("u".concat(x.i,"_").concat(S)),h),h++}I.activeTexture(I.TEXTURE0)},Kt=null,Zt=["warp","cell","displace"],te=function(t,n,r){if(jt||!Yt||!kt)return null;var i=C.getBoundingClientRect();if(i.width&&i.height&&(!r||!r.gpu)){var s=C.width/i.width,l=C.height/i.height,c=(t-i.left)*s,u=(n-i.top)*l;if(c>=0&&u>=0&&c<C.width&&u<C.height){var f=Math.floor(c),h=Math.floor(C.height-u),y=function(t,n){if(!Yt)return null;var r,o={},i=d(Yt.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],l=0,c=Zt;l<c.length;l++)for(var u=c[l],f=0;f<e.length;f++){var h=e[f],y=b[h.op];if(y&&(Array.isArray(y.stage)?y.stage:[y.stage]).includes(u)){if(P(h))return null;if("function"!=typeof y.map){if(!1===y.movesCoords)continue;return null}var m=o[f],v=y.map(s,h,{res:Yt.res,dpr:p,dpos:m?[m.x,m.y]:[Yt.res[0]/2,Yt.res[1]/2],damt:m?m.amt:1,time:Yt.time,mouse:Yt.mouse});if(!v)return null;s=v}}return s}(f+.5,C.height-h-.5);if(y)return{x:i.left+Math.min(Math.max(y[0],0),C.width)/s,y:i.top+Math.min(Math.max(y[1],0),C.height)/l}}}var m=function(){if(Kt)return Kt;var t=I.createProgram();if(I.attachShader(t,tt(I.VERTEX_SHADER,A)),I.attachShader(t,tt(I.FRAGMENT_SHADER,F(a,e,!0,o))),I.bindAttribLocation(t,0,"a"),I.linkProgram(t),!I.getProgramParameter(t,I.LINK_STATUS))return console.warn("[nodality] probe program failed:",I.getProgramInfoLog(t)),I.deleteProgram(t),Kt={broken:!0};var n=I.createTexture();I.bindTexture(I.TEXTURE_2D,n),I.texImage2D(I.TEXTURE_2D,0,I.RGBA,1,1,0,I.RGBA,I.UNSIGNED_BYTE,null),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.NEAREST),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.NEAREST),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE);var r=I.createFramebuffer();I.bindFramebuffer(I.FRAMEBUFFER,r),I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_2D,n,0);var i=I.checkFramebufferStatus(I.FRAMEBUFFER);if(I.bindFramebuffer(I.FRAMEBUFFER,null),i!==I.FRAMEBUFFER_COMPLETE)return console.warn("[nodality] probe framebuffer incomplete:",i),I.deleteProgram(t),I.deleteFramebuffer(r),I.deleteTexture(n),Kt={broken:!0};var s={},l=function(e){return e in s?s[e]:s[e]=I.getUniformLocation(t,e)};return I.useProgram(t),pt(l),I.useProgram(et),Kt={prog:t,fbo:r,tex:n,px:new Uint8Array(4),U:l}}();if(m.broken)return null;var v=C.getBoundingClientRect();if(!v.width||!v.height)return null;var g=C.width/v.width,w=C.height/v.height,x=(t-v.left)*g,k=(n-v.top)*w;if(x<0||k<0||x>=C.width||k>=C.height)return null;var S=Math.floor(x),O=Math.floor(C.height-k);I.bindFramebuffer(I.FRAMEBUFFER,m.fbo),I.useProgram(m.prog),I.viewport(0,0,1,1),I.uniform2f(m.U("u_probe"),S,O),Qt(m.U,Yt),I.drawArrays(I.TRIANGLES,0,3),I.readPixels(0,0,1,1,I.RGBA,I.UNSIGNED_BYTE,m.px),I.bindFramebuffer(I.FRAMEBUFFER,null),I.useProgram(et),I.viewport(0,0,C.width,C.height);var j=m.px,E=(j[0]+j[1]/255)/255,_=(j[2]+j[3]/255)/255;return{x:v.left+E*C.width/g,y:v.top+_*C.height/w}},ee="__nodalityRetargeted",ne=!e.some(function(t){return!1===t.interactive}),re="data-nodality-hover",oe=e.some(function(t){return!0===t.hoverAttr}),ie=[],ae=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=ie;i<a.length;i++){var s=a[i];o.has(s)||s.removeAttribute(re)}for(var l=0,c=n;l<c.length;l++){var u=c[l];u.hasAttribute(re)||u.setAttribute(re,"")}ie=n},se=0,le=function(e){if(ne&&!jt&&!e[ee]){if("pointermove"===e.type||"mousemove"===e.type){var n="undefined"!=typeof performance?performance.now():0;if(n-se<12)return;se=n}var r=te(e.clientX,e.clientY);if(r){var o=G!==t;if(!(!o&&Math.abs(r.x-e.clientX)<.5&&Math.abs(r.y-e.clientY)<.5)){var i=o?function(t,e){var n=null,r=function(o){var i,a=d(o.children);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=s.getBoundingClientRect();l.width&&l.height&&(t<l.left||t>l.right||e<l.top||e>l.bottom||(n=s,r(s)))}}catch(t){a.e(t)}finally{a.f()}};return r(G),n}(r.x,r.y):"function"==typeof document.elementFromPoint?document.elementFromPoint(r.x,r.y):null;if(i&&i!==e.target&&t.contains(i)){if(oe&&ae(i),"pointerdown"===e.type||"mousedown"===e.type||"click"===e.type){var a=i.closest&&i.closest("a, button, input, select, textarea, [tabindex]");a&&"function"==typeof a.focus&&a.focus({preventScroll:!0})}e.stopPropagation(),e.cancelable&&e.preventDefault(),i.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[ee]=!0,r}(e,r.x,r.y))}}}}},ce=["pointerdown","pointerup","pointermove","click","dblclick","contextmenu","mousedown","mouseup"],ue=function(){oe&&ae(null)};if(ne){var fe,de=d(ce);try{for(de.s();!(fe=de.n()).done;){var he=fe.value;t.addEventListener(he,le,!0)}}catch(t){de.e(t)}finally{de.f()}t.addEventListener("pointerleave",ue,!0)}var pe=!0,ye=function(){if(!jt){if(Rt(),pe&&kt){for(var t="undefined"!=typeof performance?performance.now():vt+16,e=Math.max(0,(t-vt)/1e3),n=0,r=bt;n<r.length;n++){var o=r[n];gt(o,e)}Wt=!1,I.bindFramebuffer(I.FRAMEBUFFER,null),I.useProgram(et),I.viewport(0,0,C.width,C.height),I.clearColor(0,0,0,0),I.clear(I.COLOR_BUFFER_BIT);var i={res:[C.width,C.height],mouse:[Bt[0],Bt[1]],time:t/1e3,t:it,drivers:[],dyn:[]};if(Jt.length>0){Ht+=(Ut-Ht)*(1-Math.exp(8*-e));for(var a={mouseX:Bt[0],mouseY:Bt[1],w:C.width,h:C.height,t:t/1e3,hover:Ht,scroll:Vt()},s=0,l=Jt;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(mt.length>0)for(var f={w:C.width,h:C.height,mouseX:Bt[0],mouseY:Bt[1],dt:e,t:t/1e3},d=0,h=mt;d<h.length;d++){var p=h[d];i.dyn.push({i:p.i,ups:p.def.tick(p.state,f)})}Yt=i,Qt(nt,i),vt=t,I.drawArrays(I.TRIANGLES,0,3)}$t=requestAnimationFrame(ye)}},me=null;"undefined"!=typeof IntersectionObserver&&(me=new IntersectionObserver(function(t){var e=h(t,1)[0];pe=e.isIntersecting})).observe(t);var ve=null,be=0,ge=function(){if(!jt){var t=l();if(!(t.width<2||t.height<2)){var e=Math.round(t.width*p),n=Math.round(t.height*p);c.width=t.width,c.height=t.height,C.style.width=t.width+"px",C.style.height=t.height+"px";var r=C.width!==e||C.height!==n;r&&(C.width=e,C.height=n),"snapshot"===Et?It():r&&Ft()}}};"undefined"!=typeof ResizeObserver&&(ve=new ResizeObserver(function(){"live"!==Et&&(function(){if(!jt){var t=l();t.width<2||t.height<2||Math.round(t.width)===Math.round(c.width)&&Math.round(t.height)===Math.round(c.height)||(c.width=t.width,c.height=t.height,C.style.width=t.width+"px",C.style.height=t.height+"px")}}(),clearTimeout(be),be=setTimeout(ge,150))})).observe(t);var we=0,xe=function(){clearTimeout(we),we=setTimeout(function(){if(!jt)if("snapshot"!==Et){var e=t.clientWidth||t.parentElement&&t.parentElement.clientWidth||c.width;C.style.width=e+"px",setTimeout(function(){if(!jt&&"live"===Et){var t=Math.max(2,Math.round(G.getBoundingClientRect().height))||c.height;c.width=e,c.height=t,C.style.height=t+"px",C.width=Math.round(e*p),C.height=Math.round(t*p),Ft()}},50)}else ge()},150)};"undefined"!=typeof window&&window.addEventListener("resize",xe),"live"===Et?$t=requestAnimationFrame(ye):(It().then(function(){$t=requestAnimationFrame(ye)}),"undefined"!=typeof document&&document.fonts&&"object"===f(document.fonts.ready)&&Promise.resolve(document.fonts.ready).then(ge).catch(function(){}));var ke=function(e,n,r,o,i){"function"==typeof CustomEvent&&"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("nodality:raster-param",{detail:{pipeline:Se,el:t,index:e,key:n,value:r,prev:o,how:i}}))},Se={canvas:C,nodes:e,get backend(){return Et},sourceAt:function(t,e,n){return te(t,e,n)},get progress(){return it},setProgress:function(t){var e=Math.min(1,Math.max(0,Number(t)||0));return e===it||(it=e,ut.length&&(I.useProgram(et),pt(nt,yt),Kt&&!Kt.broken&&(I.useProgram(Kt.prog),pt(Kt.U,yt),I.useProgram(et))),Rt()),it},setParam:function(t,n,r){var o=e[t];if(!o||jt)return!1;var i=o[n];if(o[n]=r,function(t,e,n,r){if(ft.includes(e))return!0;var o=b[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"!=f(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==f(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 Se.rebuild(),ke(t,n,r,i,"rebuild"),"rebuild";var a=b[o.op];if(a&&a.uniforms){var s=a.uniforms(o,p);for(var l in I.useProgram(et),s)ot(nt("u".concat(t,"_").concat(l)),s[l][0],s[l][1]);if(Kt&&!Kt.broken){for(var c in I.useProgram(Kt.prog),s)ot(Kt.U("u".concat(t,"_").concat(c)),s[c][0],s[c][1]);I.useProgram(et)}}return ke(t,n,r,i,"uniform"),"uniform"},rebuild:function(){if(jt)return null;var e=t;return Se.destroy(),ht(e,r)}};return ct.add(Se),Object.assign(Se,{refresh:function(){return"live"===Et?Ft():It()},destroy:function(){ct.delete(Se),jt=!0,cancelAnimationFrame($t),clearTimeout(be),clearTimeout(we),me&&me.disconnect(),ve&&ve.disconnect(),"undefined"!=typeof window&&window.removeEventListener("resize",xe),t.removeEventListener("mousemove",qt),t.removeEventListener("touchmove",qt);for(var e=0,n=ce;e<n.length;e++){var r=n[e];t.removeEventListener(r,le,!0)}t.removeEventListener("pointerleave",ue,!0),ae(null),t.removeEventListener("mouseenter",Gt),t.removeEventListener("mouseleave",Xt),C.removeEventListener("paint",Ft);for(var o=0,i=bt;o<i.length;o++){var a=i[o];for(var s in a.cleanup(),a.progs)I.deleteProgram(a.progs[s].prog)}for(bt.length=0,Kt&&!Kt.broken&&(I.deleteProgram(Kt.prog),I.deleteFramebuffer(Kt.fbo),I.deleteTexture(Kt.tex)),Kt=null,St&&(I.deleteTexture(St),St=null),Ot&&(I.deleteTexture(Ot),Ot=null);G!==t&&G.firstChild;)t.appendChild(G.firstChild);Pt(),t.style.visibility="";try{var l=I.getExtension("WEBGL_lose_context");l&&l.loseContext()}catch(t){}C.remove()}})}function pt(){return new RegExp('"([A-Za-z_$][A-Za-z0-9_$]*)"\\s*:',"g")}function yt(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(pt(),"$1:")}function mt(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)||bt(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 vt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=bt(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 bt(t,e){if(t){if("string"==typeof t)return gt(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)?gt(t,e):void 0}}function gt(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 wt(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,xt(r.key),r)}}function xt(t){var e=function(t){if("object"!=kt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kt(e)?e:e+""}function kt(t){return kt="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},kt(t)}var St=new Set,Ot={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",alignContent:"alignContent",alignItems:"alignItems",justifyContent:"justifyContent",justifyItems:"justifyItems",justifySelf:"justifySelf",aspectRatio:"aspectRatio",borderTop:"borderTop",borderRight:"borderRight",borderBottom:"borderBottom",borderLeft:"borderLeft",textDecoration:"textDecoration",objectFit:"objectFit",objectPosition:"objectPosition",weight:"fontWeight",colorScheme:"colorScheme"},jt=new Set(["radius","width","height","maxWidth","maxHeight","minWidth","minHeight","top","left","right","bottom","gap"]),Et=function(t){return!0===t||"hand"===t?"pointer":t};function _t(t,e){if(!e||!t)return t;var n=document.createElement("a");return n.setAttribute("href",e),n.style.display="flex",n.style.alignItems="center",n.style.textDecoration="none",n.style.color="inherit",n.appendChild(t),n}function At(t){var e={};if(!t||"object"!==kt(t))return e;for(var n in Ot)null!=t[n]&&(e[n]=t[n]);return e}var Tt=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;if(t.transform||(e=t.op),!e||!Array.isArray(e.values))return void console.warn('[nodality] reactOnTransform: a transform node needs a `values` array, e.g. ["ty:-20px"] - ignored');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=xt(n="reactOnTransform"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,t._owner&&t._owner.push(this),this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1};var a=this.set;if("function"==typeof a&&!a.__appliesId){var s=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=a.call.apply(a,[this,t].concat(n)),i=t&&t.id,s=this.res;return null!=i&&""!==i&&s&&"function"==typeof s.setAttribute&&!s.getAttribute("id")&&s.setAttribute("id",String(i)),t&&t.loop&&"object"===kt(t.loop)&&this.loop(t.loop),o};s.__appliesId=!0,this.set=s}var l="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__;if(l&&!l.inDes&&"function"==typeof l.sourceOf){try{this.__nodSrc=l.sourceOf((new Error).stack)}catch(e){}if(this.__nodSrc){var c=this.set,u=this.__nodSrc;this.set=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=c.call.apply(c,[this,t].concat(n)),i=this.res;return i&&"function"==typeof i.setAttribute&&!i.hasAttribute("data-nod-src")&&i.setAttribute("data-nod-src",u),o},this.set.__appliesId=!0}}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=ht(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"===kt(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=vt(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"!==kt(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:"applyStyleOptions",value:function(t){if(!t||!this.res)return this;for(var e in Ot)if(null!=t[e]){var n="number"==typeof t[e]&&0!==t[e]&&jt.has(e)?"".concat(t[e],"px"):"cursor"===e?Et(t[e]):t[e];this.res.style[Ot[e]]=n}return this}},{key:"commonMethods",value:function(t){return this.applyStyleOptions(t),"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"===kt(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&&t._responsiveTasks.forEach(function(t){t()})};this._responsiveHandler||(this._responsiveHandler=e,this._on(window,"resize",e));var n=setTimeout(function(){e()},0);this._track(function(){return clearTimeout(n)})}},{key:"resprop",value:function(e,n){var r=this;n&&"object"===kt(n)?this.options=n:this.options&&"object"===kt(this.options)||(this.options={});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"};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 s=e.find(function(t){return"default"===t.breakpoint});s||(s={breakpoint:"default",range:o.default},e.unshift(s));var l=new Set;e.forEach(function(t){Object.keys(t).forEach(function(t){i.includes(t)||"range"===t||l.add(t)})});var c=new Map;l.forEach(function(t){void 0===s[t]&&(null==r.options[t]?"keySet"!==t&&c.set(t,void 0):s[t]=r.options[t])});var u=function(t){return"exact"===t?"fontSize":a[t]||t},f=function(t,e){var n=null==e?"":e;r.res.style[t]!==String(n)&&(r.res.style[t]=n)};this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){var n,o=vt(c);try{for(o.s();!(n=o.n()).done;){var i=mt(n.value,2),d=i[0];if(void 0===i[1]){var h=r.res.style[u(d)];c.set(d,"string"==typeof h?h:"")}}}catch(t){o.e(t)}finally{o.f()}for(var p=t.viewportWidth(),y=s,m=0;m<e.length;m++){var v=e[m],b=mt(v.range,2),g=b[0],w=b[1];if("default"!==v.breakpoint&&Math.floor(p)>=g&&Math.floor(p)<=w){y=v;break}}l.forEach(function(t){var e=y!==s&&t in y,n=e?y[t]:c.has(t)?c.get(t):s[t];"keySet"!==t?"exact"!==t?e&&"function"==typeof r[t]?r[t](n):f(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}(t),n):f("fontSize",n):n&&n.key&&f(n.key,n.value)})}),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=mt(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&Math.floor(r)>=c&&Math.floor(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=mt(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&Math.floor(r)>=c&&Math.floor(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:"loop",value:function(t){var e=this.res,n=t&&"object"===kt(t)?t:{},r=Array.isArray(n.keyframes)?n.keyframes.filter(function(t){return t&&"object"===kt(t)}):[];return!e||r.length<2?(r.length<2&&console.warn("nodality: loop needs at least two keyframes"),this):(this._loop&&"function"==typeof this._loop.cancel&&this._loop.cancel(),this._loop=null,"undefined"==typeof window||"function"!=typeof e.animate||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||(this._loop=e.animate(r,{duration:Number(n.duration)>0?Number(n.duration):1e4,easing:n.easing||"linear",direction:n.direction||"normal",delay:Number(n.delay)||0,iterations:1/0})),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){var n="nodality: `".concat(t,"` is deprecated — use `").concat(e,"` instead.");return St.has(n)||(St.add(n),console.error(n)),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 t&&null!=t.col&&(this.res.style.gridColumn=t.col),t&&null!=t.row&&(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,s=vt(e);try{for(s.s();!(i=s.n()).done;){var l=i.value;l.range||(l.range=["0px","999999px"])}}catch(t){s.e(t)}finally{s.f()}e.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var c=function(i){var s=t.viewportWidth(),l=[],c=[];o.resCopy=o.res,o.storedQueries=e.map(function(t){return t.target}).filter(function(t){return null!=t});var u,f=vt(e);try{for(f.s();!(u=f.n()).done;){var d=u.value;o.counterIndex++;var h=mt(d.range,2),p=h[0],y=h[1],m=parseInt(p),v=parseInt(y),b=!0;if(d.target){b=!1;for(var g=0;g<d.target.length;g++){var w=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):t};w(d.target[g])===w(n)&&(b=!0)}}s>=m&&s<=v&&b&&(l.push(d.log),c.push(d),d.op&&d.op.margin&&(o.useMargin=d.op.margin))}}catch(t){f.e(t)}finally{f.f()}var x=c.map(function(t){return e.indexOf(t)}).join(",");if(x!==a){if(a=x,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),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(o.res.style.position="relative"),l.includes("blast")){var k,S=c.filter(function(t){return"blast"===t.log})[0].op.color,O=null!==(k=c.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==k?k:"1px";"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()?(o.res.style.border="".concat("number"==typeof O?O+"px":O," 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"]=S,o.res.style["-webkit-text-stroke-width"]="".concat(O))}if(l.includes("filter")){var j=c.filter(function(t){return"filter"===t.log})[0].op.filter;o.res.style.filter=j}if(l.includes("background")&&(o.res.style.backgroundColor="green"),l.includes("gradient")&&o.globalGradient&&("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")),l.includes("shadow")){var E,_,A,T,C=o.options.shadow.op,P=null!==(E=C.steps)&&void 0!==E?E:1,R=null!==(_=C.colors)&&void 0!==_?_:["gray"],I=null!==(A=C.movements)&&void 0!==A?A:["3px","3px"],M=null!==(T=C.radius)&&void 0!==T?T:"3px";if(1===I.length&&(I=[I[0],I[0]]),"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()){for(var D=[],F=0;F<P;F++){var z,L=null!==(z=R[F])&&void 0!==z?z:R[0],N=I[0],B=I[1];D.push("".concat(N," ").concat(B," ").concat(M," ").concat(L))}o.res.style.boxShadow=D.join(", ")}else{for(var W=[],q=0;q<P;q++){var U,H=null!==(U=R[q])&&void 0!==U?U:R[0],G=I[0],X=I[1];W.push("drop-shadow(".concat(G," ").concat(X," ").concat(M," ").concat(H,")"))}o.res.style.filter=W.join(" ")}}if(l.includes("margin"))for(g=0;g<e.length;g++)if(e[g].op){var J=e[g].op.offsets;J&&void 0!==o.index&&(o.res.style.margin=J[Number(o.index)]+"px")}if(l.includes("spana")||l.includes("span")){var V=document.createElement("div");if(V.setAttribute("id","oroa"),Object.assign(V.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._spanParts?o._spanParts.splice(0).forEach(function(t){return t.destroy()}):(o._spanParts=[],o._track(function(){return o._spanParts.splice(0).forEach(function(t){return t.destroy()})}));var $=function(t,e,n){var r=new o.constructor(t);return o._spanParts.push(r),r.setup(e).set(n).render()};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($(s,{type:"span",id:i.id,animation:i.animation},{}))}e=a+r.length}var l=$(r,{type:"span",id:i.id,animation:i.animation},i);o.res.appendChild(l)}),e<n.length){var r=n.substring(e);o.res.appendChild($(r,{type:"span"},{}))}}})}else o.rebuildText(i);if(l.includes("animation")){if(o.options.animation&&!o.hasAnimated&&!o.options.animation.op.fireAt){o.hasAnimated=!0;var Y=o.options.animation.op;o._on(window,"sidebar:open",function(){o.res.animate(Y.keyframesOpen,Y.openOptions)}),o._on(window,"sidebar:closed",function(){o.res.animate(Y.keyframesClose,Y.closeOptions)}),o.res.animate(Y.keyframesClose,{duration:0,fill:"forwards"}),o.openTag&&o.closeTag&&(o._on(window,o.openTag,function(){o.res.animate(Y.keyframesOpen,Y.openOptions)}),o._on(window,o.closeTag,function(){o.res.animate(Y.keyframesClose,Y.closeOptions)}))}if(o.options.animation&&o.options.animation.op.fireAt&&o.options.animation.op.fireAt.endsWith("px")){var Q=o.options.animation.op;o.res.animate(Q.keyframesClose,{duration:0,fill:"forwards"});var K=function(){window.scrollY>parseFloat(Q.fireAt)&&(o.res.animate(Q.keyframesOpen,Q.openOptions),window.removeEventListener("scroll",K))};o._on(window,"scroll",K)}if(o.options.animation&&"inview"===o.options.animation.op.fireAt){var Z=o.options.animation.op;o.res.animate(Z.keyframesClose,{duration:0,fill:"forwards"});var tt=!1,et=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!tt&&(tt=!0,o.res.animate(Z.keyframesOpen,Z.openOptions),e.disconnect())})});et.observe(o.res),o._track(function(){return et.disconnect()})}}}};this.options.animation||this._on(window,"resize",function(){return c()}),c()}},{key:"rebuildText",value:function(t){}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(pt(),"$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&&wt(e.prototype,n),r&&wt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function Ct(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}function Pt(t){return Pt="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},Pt(t)}function Rt(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,It(r.key),r)}}function It(t){var e=function(t){if("object"!=Pt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pt(e)?e:e+""}function Mt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Mt=function(){return!!t})()}function Dt(t){return Dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dt(t)}function Ft(t,e){return Ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ft(t,e)}var zt=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=Dt(e),function(t,e){if(e&&("object"==Pt(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,Mt()?Reflect.construct(e,n||[],Dt(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,t.oldLength=0,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&&Ft(t,e)}(e,t),n=e,r=[{key:"observe",value:function(t){return this.initialState=t,this.Proxima(t)}},{key:"Proxima",value:function(t){var e=this;return new Proxy(t,{set:function(t,n,r){return t[n]=r,e.initialState&&e.initialState.data&&"function"==typeof e.initialState.data.push&&e.initialState.data.push(n),"length"!==n&&e.refreshUI("Added"),!0},has:function(t,n){return"length"!==n&&e.refreshUI("Deleted"),Reflect.has(t,n)}})}},{key:"refreshUI",value:function(t){var e=this.initialState;this.adjustState(e)}},{key:"loadState",value:function(t,e){return this.loadEl=e,this.initialState=t,this.observe(this.state.data)}},{key:"adjustState",value:function(t){document.querySelector(this.loadEl);var e=t[t.length-1],n=document.createElement("p"),r=document.createTextNode(e);n.appendChild(r),document.body.appendChild(n)}},{key:"mount",value:function(t){this.res=t,this.render(t).render(t)}},{key:"toCode",value:function(){return[""]}}],r&&Rt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Lt(t){return Lt="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},Lt(t)}function Nt(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 Bt(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,Wt(r.key),r)}}function Wt(t){var e=function(t){if("object"!=Lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lt(e)?e:e+""}function qt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(qt=function(){return!!t})()}function Ut(t,e,n,r){var o=Ht(Gt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Ht(){return Ht="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Gt(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}},Ht.apply(null,arguments)}function Gt(t){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gt(t)}function Xt(t,e){return Xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xt(t,e)}var Jt=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=Gt(e),function(t,e){if(e&&("object"==Lt(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,qt()?Reflect.construct(e,n||[],Gt(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&&Xt(t,e)}(e,t),n=e,r=[{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=yt(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 Nt(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)?Nt(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:"rebuildText",value:function(t){if(t&&this.prevText&&this.prevText.length>0){var e=new this.constructor(this.prevText);this.res.appendChild(e.set({}).render()),this._track(function(){return e.destroy()})}}},{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(pt(),"$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){if(this.resCopy=this.res,this.options=t,Ut(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.gpos&&this.gpos(t.gpos),t.vtn&&(this.res.style.viewTransitionName=t.vtn),t.index&&Ut(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.preffersId&&(this.preffersId=t.preffersId),Ut(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),Ut(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),Ut(e,"setClass",this,3)([this.options.class]),t.clampc&&this.clampCopy(t.clampc),null!=t.exact&&(this.res.style.fontSize=t.exact),t.absolute&&(this.res.style.position="absolute"),t.em&&this.em(t.em),t.fluid&&this.fluid(t.fluid),t.tag&&/^(h[1-6]|p)$/.test(String(t.tag))){var n=String(t.tag).toLowerCase();if(this.res&&this.res.tagName.toLowerCase()!==n){for(var r=document.createElement(n),o=0,i=Array.from(this.res.attributes);o<i.length;o++){var a=i[o];r.setAttribute(a.name,a.value)}for(;this.res.firstChild;)r.appendChild(this.res.firstChild);this.res=r}}return 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"===Lt(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&&Ut(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),e.setAttribute("alt",void 0===t.alt?"":String(t.alt)),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(),this._on(window,"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(),this._on(window,"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(),this._on(window,"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(),this._on(window,"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(),this._on(window,"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(),this._on(window,"resize",n),this}},{key:"setup",value:function(t){var e;t?(e=document.createElement(t.type),void 0!==t.id&&null!==t.id&&e.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(),this._on(window,"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&&Bt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Vt(t){return Vt="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},Vt(t)}function $t(t,e){if(t){if("string"==typeof t)return Yt(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)?Yt(t,e):void 0}}function Yt(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 Qt(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,Kt(r.key),r)}}function Kt(t){var e=function(t){if("object"!=Vt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Vt(e)?e:e+""}function Zt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Zt=function(){return!!t})()}function te(t,e,n,r){var o=ee(ne(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ee(){return ee="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ne(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}},ee.apply(null,arguments)}function ne(t){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ne(t)}function re(t,e){return re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},re(t,e)}var oe=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=ne(e),function(t,e){if(e&&("object"==Vt(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,Zt()?Reflect.construct(e,n||[],ne(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&&re(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="pointer",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)||$t(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(),"IMG"===this.res.tagName?t.url&&this.res.setAttribute("src",t.url):void 0!==t.alt&&(this.res.setAttribute("role","img"),this.res.setAttribute("aria-label",t.alt)),"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&&te(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),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.gpos(t.gpos),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')),t.reveal&&this.reveal(t.reveal),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&&te(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 null!=t&&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%",null!=this.url&&""!==this.url&&(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._declared=this._declared||{},this._declared.height=!0,this.res.style.height=t,this.declaresDimension("width")||(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(),this._on(window,"resize",n),this}},{key:"width",value:function(t){return this._declared=this._declared||{},this._declared.width=!0,this.res.style.width=t,this.declaresDimension("height")||(this.res.style.height="auto"),this}},{key:"declaresDimension",value:function(t){if(this._declared&&this._declared[t])return!0;var e=this.options||{};return null!=e[t]&&""!==e[t]||(Array.isArray(e.keySet)?e.keySet:e.keySet?[e.keySet]:[]).some(function(e){return e&&e.key===t})}},{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:"reveal",value:function(t){var e,n,r,o,i,a,s,l=this.res,c=t&&"object"===Vt(t)?t:{},u=null!==(e=c.mask)&&void 0!==e?e:"square";if("square"!==u)return console.warn('nodality: img.reveal mask "'.concat(u,'" is not supported — use "square".')),this;if("undefined"==typeof window||"function"!=typeof window.IntersectionObserver)return this;if("function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return this;var f=Math.min(1,Math.max(0,Number(null!==(n=c.size)&&void 0!==n?n:.3))),d=null!==(r=c.duration)&&void 0!==r?r:"1.2s",h=null!==(o=c.easing)&&void 0!==o?o:"cubic-bezier(0.76, 0, 0.24, 1)",p=null!==(i=c.delay)&&void 0!==i?i:"0s",y=Number(null!==(a=c.zoom)&&void 0!==a?a:1.12),m=!1!==c.once,v=["clip-path","scale"].map(function(t){return"".concat(t," ").concat(d," ").concat(h," ").concat(p)}).join(", "),b=!1,g=function(){var t=l.clientWidth,e=l.clientHeight;if(!t||!e)return"inset(".concat(50*(1-f),"% ").concat(50*(1-f),"%)");var n=Math.min(t,e)*f;return"inset(".concat((e-n)/2,"px ").concat((t-n)/2,"px)")};l.style.clipPath=g(),l.style.scale=String(y),l.style.willChange="clip-path, scale",l.style.transition=v;var w="function"==typeof window.ResizeObserver?new window.ResizeObserver(function(){b||(l.style.transition="none",l.style.clipPath=g(),l.offsetWidth,l.style.transition=v)}):null;w&&w.observe(l);var x=Math.min(.9,Math.max(0,Number(null!==(s=c.offset)&&void 0!==s?s:.2))),k=new window.IntersectionObserver(function(t){var e,n=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=$t(t))){e&&(t=e);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.isIntersecting&&!b?(b=!0,l.style.clipPath="inset(0px 0px)",l.style.scale="1",m&&(k.disconnect(),w&&w.disconnect())):r.isIntersecting||!b||m||(b=!1,l.style.clipPath=g(),l.style.scale=String(y))}}catch(t){n.e(t)}finally{n.f()}},{threshold:0,rootMargin:"0px 0px ".concat(100*-x,"% 0px")});return k.observe(l),l.addEventListener("transitionend",function(){b&&m&&(l.style.willChange="auto")}),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&&Qt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function ie(t){return ie="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},ie(t)}function ae(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 se(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,le(r.key),r)}}function le(t){var e=function(t){if("object"!=ie(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ie(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ie(e)?e:e+""}function ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ce=function(){return!!t})()}function ue(t,e,n,r){var o=fe(de(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function fe(){return fe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=de(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}},fe.apply(null,arguments)}function de(t){return de=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},de(t)}function he(t,e){return he=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},he(t,e)}var pe=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=de(e),function(t,e){if(e&&("object"==ie(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,ce()?Reflect.construct(e,n||[],de(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&&he(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=yt(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 ae(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)?ae(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(pt(),"$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&&ue(e,"setTags",this,3)([t.tags]),t.id&&this.res.setAttribute("id",t.id),t.id&&ue(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&&ue(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));ue(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.radius("0.5rem"),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&&ue(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 S=[];t.borderObj&&S.push("border"),t.background&&S.push("background"),t.mar&&S.push("margin"),t.animation&&S.push("animation"),this.chainReact(w,t.id,S,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(),this._on(window,"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(),this._on(window,"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}}])&&se(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function ye(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 me(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)?me(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 me(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 ve(t){return ve="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},ve(t)}function be(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,ge(r.key),r)}}function ge(t){var e=function(t){if("object"!=ve(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ve(e)?e:e+""}function we(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(we=function(){return!!t})()}function xe(){return xe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ke(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}},xe.apply(null,arguments)}function ke(t){return ke=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ke(t)}function Se(t,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Se(t,e)}var Oe=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=ke(e),function(t,e){if(e&&("object"==ve(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,we()?Reflect.construct(e,n||[],ke(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&&Se(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"===ve(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=xe(ke(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(),this._on(window,"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=ye(n[e],2),o=r[0],i=r[1];null!=i&&""!==i&&(t[o]=i)}var a=JSON.stringify(t,null,4).replace(pt(),"$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",this._on(window,"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&&be(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function je(t){return je="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},je(t)}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,_e(r.key),r)}}function _e(t){var e=function(t){if("object"!=je(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==je(e)?e:e+""}var Ae=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}}])&&Ee(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Te(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Te=function(){return!!t})()}function Ce(t){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ce(t)}function Pe(t,e){return Pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pe(t,e)}function Re(t){return Re="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},Re(t)}function Ie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}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 De(t,e,n){return e&&Me(t.prototype,e),n&&Me(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Fe(t){var e=function(t){if("object"!=Re(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Re(e)?e:e+""}"undefined"!=typeof window&&(window.CustomDivRenderer=Ae);var ze=function(){return De(function t(e,n){Ie(this,t),this.obj=e||{},this.items=n||[]},[{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}}])}(),Le=function(t){function e(t){var n,r,o,i;return Ie(this,e),n=function(t,e,n){return e=Ce(e),function(t,e){if(e&&("object"==Re(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,Te()?Reflect.construct(e,n||[],Ce(t).constructor):e.apply(t,n))}(this,e),r=n,i=function(){var t,e=window.matchMedia("(max-device-width: 415px)"),r=document.createElement("button");if(r.setAttribute("id","hamburger"),r.setAttribute("type","button"),r.setAttribute("aria-label","Menu"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls","innerItemsWrapper"),r.style.border="none",r.style.fontWeight="bold",r.style.position="absolute",r.style.color=null!==(t=n.hamburgerColour)&&void 0!==t?t:"orange",r.style.backgroundColor="transparent",r.style.fontSize=e.matches?"2.1em":"2em",n.hamburgerInset){var o=String(n.hamburgerInset).trim().split(/\s+/);r.style.padding=o.length>1?"".concat(o[0]," ").concat(o[1]):"".concat(o[0]," ").concat(o[0])}var i=document.createTextNode(n.symbol?n.symbol:"☰");return r.appendChild(i),r.style.marginLeft="auto",n.isShown=!1,r.addEventListener("click",function(){n.isShown=!n.isShown,r.setAttribute("aria-expanded",String(n.isShown)),n.hasAnimatedToWide=!1;var t=n.items[0].options;if(t&&t.animation){var e=t.animation.op,o=n.res.children[0].children[1].children[0];if(e){if(n.isShown)for(var i=0;i<o.children.length;i++)o.children[i].animate(e.keyframesClose,{duration:1,fill:"forwards",delay:0}).onfinish=function(){o.parentElement.style.display="block"};else o.parentElement.style.display="none";for(i=0;i<o.children.length;i++){var a=o.children[i];a.animate(e.keyframesClose,{duration:1,fill:"forwards",delay:0}),n.isShown?a.animate(e.keyframesOpen,e.openOptions):a.animate(e.keyframesClose,e.closeOptions)}}}else n.isShown?innerItemsWrapper.parentElement.style.display="block":innerItemsWrapper.parentElement.style.display="none"}),r},(o=Fe(o="addHamburger"))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,n.titleText="",n.hasHamburger=!1,n.code=[],n.attributes={},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&&Pe(t,e)}(e,t),De(e,[{key:"toCode",value:function(){var t="new UINavBar()";return Object.keys(this.attributes).length>0?t+=".setup(".concat(yt(this.attributes,2),")"):t+=".setup({})",t+=".items([\n",t+=this.items.map(function(t){return t.toCode().join("").trim()}).join(",\n"),[t+="\n])"]}},{key:"styled",value:function(t){return this.setup(t),this.styles=t,this}},{key:"setup",value:function(t){this.obj=t,this.obj.isSide||(this.obj.animate=!1),this.attributes=t;var e=document.createElement("div");e.setAttribute("id","sars"),e.style.padding=0,e.style.margin=0;var n=document.createElement("div");return n.setAttribute("id","covid"),n.style.position="absolute",n.style.width="100%",n.style.zIndex=1,n.style.alignItems="flex-start",document.createElement("div").style.position="absolute",n.style.margin="20px",n.style.display="flex",n.style.alignItems="flex-end",n.style.margin=0,n.style.padding=0,n.style.margin=0,e.appendChild(n),this.addCloseButton=!1,this.res=e,t.background&&this.background({color:t.background}),t.openColor&&(this.openColor=t.openColor),t.sticky&&this.sticky(),t.pad&&this.pad(t.pad),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),t.hamburgerInset&&(this.hamburgerInset=t.hamburgerInset),t.mobileSize&&(this.mobileSize=t.mobileSize),t.desktopSize&&(this.desktopSize=t.desktopSize),t.height&&(this.res.children[0].style.height=t.height),this._ui={gap:t.gap,justify:t.justify,alignItems:t.alignItems,barPad:t.barPad,maxWidth:t.maxWidth,borderBottom:t.borderBottom},this.res.setAttribute("role","navigation"),this.res.setAttribute("aria-label",t.ariaLabel||"Primary"),this}},{key:"items",value:function(t){this.items=t;var e=["Link","Image","Spacer","Dropdown"].some(function(e){return t[0].__proto__.constructor.toString().startsWith("class ".concat(e))});this.itemCount=t.length;var n=new ze(this.obj,this.items).render();this.res.children[0].appendChild(n);var r=this.res.children[0].children[0].children[0],o=this.items[0].options;if(o&&o.animation){var i=o.animation.op;if(i){var a=window.matchMedia("(max-device-width: 415px)"),s=window.matchMedia("(max-width: 600px)");if(a.matches||s.matches){var l={duration:1,fill:"forwards",delay:1};for(c=0;c<r.children.length;c++)r.children[c].animate(i.keyframesClose,l)}else for(var c=0;c<r.children.length;c++)r.children[c].animate(i.keyframesClose,{duration:1,fill:"forwards",delay:1}),r.children[c].animate(i.keyframesOpen,i.openOptions)}}if(this.adjust(),!e){this.itemCount=t.length;var u=document.createElement("div");for(u.style.backgroundColor="orange",c=0;c<t.length;c++){var f=t[c];if(f.logo){var d=new Image(f.logo).width("100px"),h=document.createElement("div");h.style.flex="1",h.style.height=23;var p=document.createElement("div");p.setAttribute("id","WR"),p.style.display="flex",p.style.flexDirection="row",p.appendChild(d.render()),this.res.children[0].appendChild(d.render()),this.obj.spacing&&this.res.children[0].appendChild(h)}if(f.logo&&(this.allowPad=!0),f.logo&&this.obj.spacing&&(this.res.children[0].children[0].style.marginLeft=this.obj.spacing.sides,this.res.children[0].children[0].style.marginRight=this.obj.spacing.sides),f.title){var y=void 0;y=this.allowPad?f.type?new Dropdown(f.items,f.title):new Link(f.title,f.url).pad([{lr:"1em"}]):f.type?new Link("DRPA",f.url):new Link(f.title,f.url),u.appendChild(y.render())}}this.res.children[0].appendChild(u),this.adjust()}var m=this.addHamburger();this.itemCount,this.obj.spacing,m.style.zIndex=1;var v=this.res.children[0];return v&&!v.querySelector("#hamburger")&&v.insertBefore(m,v.firstChild),this}},{key:"instance",value:function(){return this.res.children[0]}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=this.res.style.top||"0px",this.res.style.zIndex=this.res.style.zIndex||50,this._sticky=!0,this}},{key:"font",value:function(t){for(var e=0;e<this.res.children[0].children;e++)this.res.children[0].children[e].style.fontFamily=t;return this}},{key:"background",value:function(t){return t.background?(this.res.children[0].style.backgroundColor=t.color,this.res.children[0].style.opacity=t.opacity,this):(this.res.children[0].style.backgroundColor="transparent",this)}},{key:"adjust",value:function(t){var e=this,n=window.matchMedia("(max-width: 600px)"),r=window.matchMedia("(max-device-width: 415px)"),o=function(){e.isShown=!1,e.res.children[0],function(){for(var t=0;t<e.res.children[0].children.length;t++){var n=e.res.children[0].children[t];n.style.fontSize=r.matches?e.mobileSize?e.mobileSize:"1.2em":e.desktopSize?e.desktopSize:"1em","☰"===n.textContent&&(n.style.fontSize="2em")}}(),e.res.children[0].style.flexDirection="column";for(var t=0;t<e.res.children[0].children.length;t++)"☰"==e.res.children[0].children[t].textContent||e.res.children[0].children[t].textContent==e.keepItem?(e.res.children[0].children[t].id,e.res.children[0].children[t].style.display="flex"):e.res.children[0].children[t].style.display="none"};if(this.obj.isSide)o();else{var i=this.res.children[1];null!=i&&(i.style.background="yellow"),n.matches||r.matches?o():function(){e.res.children[0];for(var t=0;t<e.res.children[0].children.length;t++){var n=e.res.children[0].children[t];n.style.marginTop="0em",n.id,n.style.display="flex",n.textContent===e.titleText&&e.titleText.length>0&&(n.style.fontSize="2em")}var r=e.items[0].options;if(r&&r.animation){var o=r.animation.op,i=e.res.children[0].children[1].children[0];if(i.style.marginTop="0",o&&!e.hasAnimatedToWide)for(e.hasAnimatedToWide=!0,t=0;t<i.children.length;t++)i.children[t].animate(o.keyframesOpen,o.openOptions)}}()}return this}},{key:"render",value:function(t){var e=this,n=function(){var t=window.matchMedia("(max-width: 600px)"),n=window.matchMedia("(max-device-width: 415px)"),r=e.res.querySelector("#outerItemsWrapper")||e.res.children[0].children[1],o=r&&(r.querySelector("#innerItemsWrapper")||r.children[0]),i=e._ui||{};if(o&&(i.gap&&(o.style.gap=i.gap),i.justify&&(o.style.justifyContent=i.justify),i.alignItems&&(o.style.alignItems=i.alignItems),i.barPad&&(o.style.padding=i.barPad),i.maxWidth&&(o.style.maxWidth=i.maxWidth,o.style.marginLeft="auto",o.style.marginRight="auto")),r&&i.borderBottom&&(r.style.borderBottom=i.borderBottom),n.matches&&(o.style.position="relative"),(t.matches||n.matches)&&null!=o?o.style.flexDirection="column":null==o||e.obj.isSide||(o.style.flexDirection="row"),!e.obj.isSide&&!t.matches&&!n.matches){var a=e.res.querySelector("#hamburger");a&&(a.style.display="none")}e.obj.isSide&&(o.style.flexDirection="column"),e.obj.isSide||t.matches||(e.res.children[0].style.position="relative",r.style.transform="translateY(0px)"),!e.obj.isSide&&t.matches,e.obj.customStyle&&(e.res.children[0].style.marginTop="1rem",e.res.children[0].style.position="absolute",e.res.children[0].style.borderRadius="1rem",r.style.borderRadius="1rem"),e.obj.radius&&(e.res.children[0].style.borderRadius="1rem",r.style.borderRadius="1rem")};return this._on(window,"resize",function(){return n()}),n(),t?(document.querySelector(t).style.padding=0,document.querySelector(t).style.margin=0,document.querySelector(t).appendChild(this.res),this.res):this.res}}])}(Tt);function Ne(t){return Ne="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},Ne(t)}function Be(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 We(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)?We(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 We(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 qe(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,Ue(r.key),r)}}function Ue(t){var e=function(t){if("object"!=Ne(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ne(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ne(e)?e:e+""}function He(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(He=function(){return!!t})()}function Ge(t){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ge(t)}function Xe(t,e){return Xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Xe(t,e)}var Je=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=Ge(e),function(t,e){if(e&&("object"==Ne(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,He()?Reflect.construct(e,n||[],Ge(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&&Xe(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),t&&null!=t.id&&""!==t.id&&this.res&&this.res.setAttribute&&this.res.setAttribute("id",String(t.id)),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=Be(n.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(o+=1,this.masterEL[o]){var s,l=Be(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=Be(n.children);try{for(h.s();!(f=h.n()).done;){var p=f.value;d+=1;var y,m=Be(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.textContent="☰",e.style.padding="10px 20px",e.style.minWidth="24px",e.style.minHeight="24px",e.style.lineHeight="1",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.textContent="×",e.style.fontSize="1.6rem",e.style.padding="10px 20px",e.style.minWidth="24px",e.style.minHeight="24px",e.style.lineHeight="1",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=Be(this.res.children[0].children);try{for(o.s();!(r=o.n()).done;){var i,a=Be(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}}])&&qe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Ve(t){return Ve="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},Ve(t)}function $e(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 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,Qe(r.key),r)}}function Qe(t){var e=function(t){if("object"!=Ve(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ve(e)?e:e+""}function Ke(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ke=function(){return!!t})()}function Ze(t){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ze(t)}function tn(t,e){return tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tn(t,e)}var en=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=Ze(e),function(t,e){if(e&&("object"==Ve(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,Ke()?Reflect.construct(e,n||[],Ze(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&&tn(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 $e(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)?$e(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=yt(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&&Ye(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function nn(t){return nn="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},nn(t)}function rn(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 on(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,an(r.key),r)}}function an(t){var e=function(t){if("object"!=nn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=nn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nn(e)?e:e+""}function sn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(sn=function(){return!!t})()}function ln(t){return ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ln(t)}function cn(t,e){return cn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cn(t,e)}var un=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=ln(e),function(t,e){if(e&&("object"==nn(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,sn()?Reflect.construct(e,n||[],ln(t).constructor):e.apply(t,n))}(this,e)).url=t,n.res=null,n.options={},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&&cn(t,e)}(e,t),n=e,r=[{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.options=t||{},this}},{key:"toCode",value:function(){var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=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 rn(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)?rn(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)[1]})),e=Object.keys(t).length?".set(".concat(JSON.stringify(t),")"):"";return["new Audio(".concat(JSON.stringify(this.url),")").concat(e)]}},{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)}}],r&&on(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function fn(t){return fn="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},fn(t)}function dn(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,hn(r.key),r)}}function hn(t){var e=function(t){if("object"!=fn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=fn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==fn(e)?e:e+""}function pn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(pn=function(){return!!t})()}function yn(t){return yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yn(t)}function mn(t,e){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mn(t,e)}var vn=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=yn(e),function(t,e){if(e&&("object"==fn(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,pn()?Reflect.construct(e,n||[],yn(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,n.res=null,n.value=t,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&&mn(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div");return e.style.position="absolute",n.style.position="relative",t.appendChild(e),t.appendChild(n),this.res=t,this}},{key:"padding",value:function(t,e,n,r){return(t||e||n||r)&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r),e||n||r||(this.res.style.padding=t),this}},{key:"size",value:function(t){var e=this,n=t.width.split("%")[0],r=t.height;this.res.children[0].style.width=n/100*window.innerWidth,this.res.children[0].style.height=r,this.res.children[1].style.width=n/100*window.innerWidth*this.value,this.res.children[1].style.height=r;var o=function(){e.res.children[0].style.width=n/100*window.innerWidth,e.res.children[0].style.height=r,e.res.children[1].style.width=n/100*window.innerWidth*e.value,e.res.children[1].style.height=r};return this._on(window,"resize",o),o(),this}},{key:"colors",value:function(t,e){return this.res.children[0].style.background=t,this.res.children[1].style.background=e,this}},{key:"round",value:function(t){return this.res.children[0].style.borderRadius="".concat(t,"px"),this.res.children[1].style.borderRadius="".concat(t,"px"),this}},{key:"render",value:function(t){if(Array.from(this.res.children).forEach(function(t){return t.style.padding=0}),Array.from(this.res.children).forEach(function(t){return t.style.margin=0}),!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&dn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function bn(t){return bn="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},bn(t)}function gn(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,wn(r.key),r)}}function wn(t){var e=function(t){if("object"!=bn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bn(e)?e:e+""}function xn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(xn=function(){return!!t})()}function kn(t){return kn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kn(t)}function Sn(t,e){return Sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Sn(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=kn(e),function(t,e){if(e&&("object"==bn(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,xn()?Reflect.construct(e,n||[],kn(t).constructor):e.apply(t,n))}(this,e)).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&&Sn(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){var t=document.createElement("div");t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.width="100%",t.style.height="auto",t.style.margin=0,t.style.padding=0,this.res=t}},{key:"set",value:function(t){return void 0!==t.id&&null!==t.id&&this.res.setAttribute("id",t.id),this.commonMethods(t),this}},{key:"toCode",value:function(){return[""]}},{key:"items",value:function(t){for(var e=0;e<t.length;e++){var n=t[e].render();this.res.appendChild(n)}return this}},{key:"add",value:function(t){for(var e=0;e<t.length;e++){var n=t[e].render();this.res.appendChild(n)}return this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&gn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function jn(t){return jn="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},jn(t)}function En(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"!=jn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jn(e)?e:e+""}function An(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(An=function(){return!!t})()}function Tn(){return Tn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Cn(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}},Tn.apply(null,arguments)}function Cn(t){return Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Cn(t)}function Pn(t,e){return Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pn(t,e)}var Rn=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=Cn(e),function(t,e){if(e&&("object"==jn(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,An()?Reflect.construct(e,n||[],Cn(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&&Pn(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(pt(),"$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"===jn(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=Tn(Cn(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),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&&En(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function In(t){return In="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},In(t)}function Mn(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,Dn(r.key),r)}}function Dn(t){var e=function(t){if("object"!=In(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=In(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==In(e)?e:e+""}function Fn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Fn=function(){return!!t})()}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},zn(t)}function Ln(t,e){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ln(t,e)}var Nn=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=zn(e),function(t,e){if(e&&("object"==In(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||[],zn(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&&Ln(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.options=t||{},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=this.options&&this.options.id,e="new Stack().set(".concat(t?"{ id: ".concat(JSON.stringify(String(t))," }"):"{}",")");if(this.children.length>0){var n=this.children.map(function(t){return t.toCode()}).join(",\n");e+=".add([\n \n ".concat(n," \n \n])")}return[e]}},{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)}}])&&Mn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Bn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=qn(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 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 qn(t,e){if(t){if("string"==typeof t)return Un(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)?Un(t,e):void 0}}function Un(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 Hn(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,Gn(r.key),r)}}function Gn(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 Xn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Xn=function(){return!!t})()}function Jn(){return Jn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Vn(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}},Jn.apply(null,arguments)}function Vn(t){return Vn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vn(t)}function $n(t,e){return $n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$n(t,e)}var Yn=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=Vn(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,Xn()?Reflect.construct(e,n||[],Vn(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&&$n(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=yt(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)||qn(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),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"===Wn(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=Jn(Vn(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"===Wn(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=Bn(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};this._on(window,"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(),this._on(window,"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(),this._on(window,"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&&Hn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);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 Kn(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,Zn(r.key),r)}}function Zn(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 tr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(tr=function(){return!!t})()}function er(t){return er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},er(t)}function nr(t,e){return nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nr(t,e)}var rr=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=er(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,tr()?Reflect.construct(e,n||[],er(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,t.res=document.createElement("meta"),t.res.setAttribute("name","viewport"),t.res.setAttribute("content","width=device-width, initial-scale=1"),t.charset=document.createElement("meta"),t.charset.setAttribute("charset","UTF-8"),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&&nr(t,e)}(e,t),n=e,(r=[{key:"add",value:function(){document.head.appendChild(this.res),document.head.appendChild(this.charset)}}])&&Kn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);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 ir(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 ar(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)?ar(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 ar(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 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,lr(r.key),r)}}function lr(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 cr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(cr=function(){return!!t})()}function ur(){return ur="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fr(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}},ur.apply(null,arguments)}function fr(t){return fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fr(t)}function dr(t,e){return dr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dr(t,e)}var hr=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=fr(e),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)}(t,cr()?Reflect.construct(e,n||[],fr(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&&dr(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=ur(fr(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=ir(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,o=ir(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=ir(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,o=ir(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=ir(this.res.rows);try{for(r.s();!(n=r.n()).done;){var o,i=ir(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=ir(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=ir(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=ir(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=ir(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&&sr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);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 yr(t,e){if(t){if("string"==typeof t)return mr(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)?mr(t,e):void 0}}function mr(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 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"!=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+""}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(){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=wr(e),function(t,e){if(e&&("object"==pr(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)).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,t._on(document,"DOMContentLoaded",function(){document.body.appendChild(t.contentWrap)}),t._track(function(){return t.contentWrap.remove()}),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&&xr(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(this._on(window,"resize",r),this._on(window,"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())}),this._on(document,"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.");var r=!this.options||!this.options.title;if(t.forEach(function(t,e){if(!r||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)}}),r){var o=t[0];o&&o.res&&this.toggleWrap.appendChild(o.res)}return(e=this.children).push.apply(e,function(t){return function(t){if(Array.isArray(t))return mr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||yr(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)||yr(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"===pr(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&&vr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Sr(t){return Sr="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},Sr(t)}function Or(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"!=Sr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Sr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sr(e)?e:e+""}function Er(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Er=function(){return!!t})()}function _r(t){return _r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_r(t)}function Ar(t,e){return Ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ar(t,e)}var Tr=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=_r(e),function(t,e){if(e&&("object"==Sr(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,Er()?Reflect.construct(e,n||[],_r(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,t.el=null,t.obj=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&&Ar(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){var e=document.createElement("div");return e.style.width="100vw",e.style.height="100vh",e.style.backgroundColor=t.background,e.style.zIndex="1",e.style.position="absolute",e.style.overflowY="scroll",this.obj=t,this.res=e,t.close&&this.close(),this}},{key:"close",value:function(){return this.res.style.display="none",this}},{key:"show",value:function(){return this.res.style.display="block",this}},{key:"add",value:function(t){var e=document.createElement("div");e.style.width=this.obj.width,e.style.height="auto",e.style.marginLeft="auto",e.style.marginRight="auto",e.style.backgroundColor="white",window.matchMedia("(max-device-width: 415px)").matches&&(e.style.marginTop="200px",e.style.width="100%");for(var n=0;n<t.length;n++)e.appendChild(t[n].render());return this.res.appendChild(e),this}},{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)}}])&&Or(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Cr(t){return Cr="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},Cr(t)}function Pr(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"!=Cr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Cr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Cr(e)?e:e+""}function Ir(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ir=function(){return!!t})()}function Mr(t){return Mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mr(t)}function Dr(t,e){return Dr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dr(t,e)}var Fr=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=Mr(e),function(t,e){if(e&&("object"==Cr(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,Ir()?Reflect.construct(e,n||[],Mr(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&&Dr(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;if(this.options=t,this.res.setAttribute("type",null!==(e=t.type)&&void 0!==e?e:"text"),t.placeholder&&(this.res.placeholder=t.placeholder),this.res.style.boxSizing="border-box",!this.res.getAttribute("aria-label")){var n,r,o=null!==(n=null!==(r=t.label)&&void 0!==r?r:t.title)&&void 0!==n?n:t.placeholder;o&&this.res.setAttribute("aria-label",String(o))}return 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.radius(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(),this._on(window,"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&&Pr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);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 Lr(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"!=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 Br(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Br=function(){return!!t})()}function Wr(){return Wr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=qr(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}},Wr.apply(null,arguments)}function qr(t){return qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qr(t)}function Ur(t,e){return Ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ur(t,e)}var Hr=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=qr(e),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)}(t,Br()?Reflect.construct(e,n||[],qr(t).constructor):e.apply(t,n))}(this,e)).text=t,r.url=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&&Ur(t,e)}(e,t),n=e,r=[{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"setup",value:function(){window.matchMedia("(max-device-width: 415px)");var t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="center",t.style.backgroundColor="#fff",t.style.fontFamily="Arial",t.style.width="100%",t.style.overflow="hidden",this.res=t,this}},{key:"set",value:function(t){return this.obj=t,t.onTap&&this.onTap(t.onTap),t.background&&(this.res.style.background=t.background),t.border&&(this.res.style.border=t.border),t.radius&&(this.res.style.borderRadius=t.radius),t.width&&(this.res.style.width=t.width),this.options=t,this.callReact(t),this.commonMethods(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=Wr(qr(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.backgroundOp&&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:"frame",value:function(t){return t.height&&(this.res.style.height=t.height),t.width&&(this.res.style.width=t.width),this}},{key:"items",value:function(t){for(var e=0;e<t.length;e++)this.res.appendChild(t[e].render());return this}},{key:"shadow",value:function(){return this.res.style.boxShadow="1px 1px 20px rgba(0, 0, 0, 0.60)",this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&Lr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Gr(t){return Gr="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},Gr(t)}function Xr(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"!=Gr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Gr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Gr(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)}var Qr=function(t){function e(t){var n;!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=$r(e),function(t,e){if(e&&("object"==Gr(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,Vr()?Reflect.construct(e,n||[],$r(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,n.code=[],n.setup();for(var r=0;r<t.length;r++)n.res.appendChild(t[r].render().render());return 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&&Yr(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){var t=document.createElement("div");t.style.padding=0,t.style.margin=0,this.res=t}},{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:"padding",value:function(t){return this.res.style.padding="".concat(t,"px"),this}},{key:"size",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:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Xr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Kr(t){return Kr="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},Kr(t)}function Zr(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,to(r.key),r)}}function to(t){var e=function(t){if("object"!=Kr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Kr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kr(e)?e:e+""}function eo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(eo=function(){return!!t})()}function no(){return no="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ro(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}},no.apply(null,arguments)}function ro(t){return ro=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ro(t)}function oo(t,e){return oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oo(t,e)}var io=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=ro(e),function(t,e){if(e&&("object"==Kr(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,eo()?Reflect.construct(e,n||[],ro(t).constructor):e.apply(t,n))}(this,e)).code=[],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&&oo(t,e)}(e,t),n=e,r=[{key:"toCode",value:function(){return this.code}},{key:"setup",value:function(){this.code.push("new FlexGrid()"),this.code.push(".setup()");var t=document.createElement("div");return t.style.display="flex",t.style.padding=0,t.style.margin=0,this.res=t,this}},{key:"getType",value:function(){return"FlexRowLayoutElement"}},{key:"set",value:function(t){t.id&&this.res.setAttribute("id",t.id),this.commonMethods(t),t.onTap&&this.onTap(t.onTap),this.code.push(".set({"),t.gap&&this.code.push("gap: ".concat(t.gap)),t.gap&&(this.res.style.gap=t.gap),t.flex&&(this.res.style.flex=t.flex),t.flex&&this.code.push("flex: ".concat(t.flex,",")),t.wrap&&(this.res.style.flexWrap="wrap"),t.wrap&&this.code.push("wrap: ".concat(t.wrap,",")),t.align&&(this.res.style.justifyContent=t.align),t.align&&this.code.push("align: ".concat(t.align,",")),t.colat&&this.toColumnAt(t.colat),t.colat&&this.code.push('\n colat: "'.concat(t.colat,'",')),this.code.push("}),");var e=t;return this.callReact(e),this}},{key:"callReact",value:function(t){this.options=t;var n,r,o,i=[],a=t.transform&&"object"===Kr(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(orange, green)")),t.stroke&&(n=e,r=this,"function"==typeof(o=no(ro(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.alignItems="center"):e.res.style.flexDirection="row"};n(),this._on(window,"resize",n)}}},{key:"flex",value:function(t){return this.arra=Array.from(t.replace(/\s/g,"")),this.areas=Array.from(Array(t.replace(/\s/g,"")).join("")),this.save='"'.concat(t,'"'),this}},{key:"items",value:function(t){this.items=t,this.code.push("\n .items([");for(var e=0;e<t.length;e++){var n=t[e];if(null!=n){var r=n.render();void 0!==n.toCode&&this.code.push(n.toCode().flatMap(function(t){return t})),this.res.appendChild(r)}}return this.code.push("\n ])"),this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"adjust",value:function(t){var e=this,n=function(){var n=window.matchMedia("(max-device-width: 415px)");if(window.innerWidth<t||n.matches)for(var r=0;r<e.res.children.length;r++)e.res.children[r].style.flex="",e.res.children[r].style.width="100%";else for(r=0;r<e.res.children.length;r++)e.res.children[r].style.flex="".concat(e.arra[r])};return n(),this._on(window,"resize",n),this}},{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)}}],r&&Zr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);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){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,lo(r.key),r)}}function lo(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+""}function co(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(co=function(){return!!t})()}function uo(t){return uo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},uo(t)}function fo(t,e){return fo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},fo(t,e)}var ho=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=uo(e),function(t,e){if(e&&("object"==ao(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,co()?Reflect.construct(e,n||[],uo(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&&fo(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){return this.imageUrl=t.url,this.createCard(),t.useBrightness&&(this.useBrightness=!0),t.useBrightness&&"\n useBrightness: ".concat(this.useBrightness),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.inpad&&this.inpad(t.inpad),t.inpad&&"\n inpad: {".concat(t.inpad,"}"),t.font&&(this.res.style.fontFamily=t.font),t.inpad&&"\n font: ".concat(t.font),this.addListeners(),this}},{key:"inpad",value:function(t){return this.res.children[1].style.boxSizing="border-box",this.res.children[1].style.padding=t,this}},{key:"items",value:function(t){for(var e=0;e<t.length;e++)this.res.children[1].appendChild(t[e].render());return this}},{key:"createCard",value:function(){var t=document.createElement("div");t.style.display="grid",t.style.width="300px",t.style.height="400px",t.setAttribute("id","AAA");var e=document.createElement("div");e.style.gridArea="1/1",e.style.height="400px",e.style.borderRadius="15px",e.style.boxShadow="0 4px 8px 0 rgba(0,0,0,0.2)",e.style.overflow="hidden";var n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.transition="0.9s",n.style.backgroundImage="url(".concat(this.imageUrl,")"),n.style.backgroundSize="cover",n.style.backgroundPostion="cover",n.style.backgroundRepeat="no-repeat",e.appendChild(n);var r=document.createElement("div");return r.style.gridArea="1/1",r.style.zIndex="1",t.appendChild(e),t.appendChild(r),this.res=t,this}},{key:"addListeners",value:function(){var t=this,e=this.res.children[0].children[0];return this.res.onmouseover=function(){e.style.transform="scale(1.3)",t.useBrightness&&(e.style.filter="brightness(31%)")},this.res.onmouseout=function(){e.style.transform="scale(1.0)",t.useBrightness&&(e.style.filter="brightness(100%)")},this}},{key:"render",value:function(t){if(!t)return this.res;this.options.id&&this.res.setAttribute("id",this.options.id),document.querySelector(t).appendChild(this.res)}}])&&so(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function po(t){return po="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},po(t)}var yo=["background","color","radius","maxHeight"];function mo(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,vo(r.key),r)}}function vo(t){var e=function(t){if("object"!=po(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=po(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==po(e)?e:e+""}function bo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bo=function(){return!!t})()}function go(t){return go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},go(t)}function wo(t,e){return wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},wo(t,e)}var xo=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=go(e),function(t,e){if(e&&("object"==po(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,bo()?Reflect.construct(e,n||[],go(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&&wo(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){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),t.color&&(this.res.style.color=t.color),t.background,t.color,t.radius,t.maxHeight;var e=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,yo);return this.applyStyleOptions(e),t.keySet&&this.keySet(t.keySet),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];var n=t[e].render();this.navContent.appendChild(0===e&&this.obj&&this.obj.brandLink?_t(n,this.obj.brandLink):n)}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}}],r&&mo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function ko(t){return ko="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},ko(t)}var So=["background","color","radius","maxHeight"];function Oo(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 jo(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,Eo(r.key),r)}}function Eo(t){var e=function(t){if("object"!=ko(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ko(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ko(e)?e:e+""}function _o(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_o=function(){return!!t})()}function Ao(){return Ao="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=To(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}},Ao.apply(null,arguments)}function To(t){return To=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},To(t)}function Co(t,e){return Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Co(t,e)}var Po=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=To(e),function(t,e){if(e&&("object"==ko(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,_o()?Reflect.construct(e,n||[],To(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&&Co(t,e)}(e,t),n=e,r=[{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(pt(),"$1:")}},{key:"toCode",value:function(){var t=this,e=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t}),n=(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),["background","color","mar","pad","resmar","respad","radius","maxHeight","hamburgerColour","keySet","menuLabel","menuId","brandLink"]),r=[].concat(n,function(t){return function(t){if(Array.isArray(t))return Oo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Oo(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)?Oo(t,e):void 0}}(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.")}()}(Object.keys(this.obj).filter(function(t){return t in Ot&&!n.includes(t)}))).filter(function(e){return void 0!==t.obj[e]}).map(function(e){return"".concat(e,": ").concat(JSON.stringify(t.obj[e]),",")}).join("\n");return this.obj.brand&&"function"==typeof this.obj.brand.toCode&&(r+="\nbrand: ".concat([].concat(this.obj.brand.toCode()).join(""),",")),"new MobileBar().set({".concat(r,"}).add([\n ").concat(e.join(","),"\n\n ])")}},{key:"set",value:function(t){var n,r,o;this.obj=t,this.obj=t,this.makeNavbar(t),t.mar&&(n=e,r=this,"function"==typeof(o=Ao(To(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),t.color&&(this.navbar.style.color=t.color),t.pad&&this.pad(t.pad),t.background,t.color,t.radius,t.maxHeight;var i=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,So);return this.applyStyleOptions(i),t.keySet&&this.keySet(t.keySet),this}},{key:"makeNavbar",value:function(t){var e,n=this,r=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 r.render&&this.brand.appendChild(_t(r.render(),t.brandLink)),this.toggleButton=document.createElement("button"),this.toggleButton.classList.add("navbar-toggle"),this.toggleButton.innerHTML="&#9776;",this.toggleButton.setAttribute("type","button"),this.toggleButton.setAttribute("aria-label",null!==(e=t.menuLabel)&&void 0!==e?e:"Menu"),this.toggleButton.setAttribute("aria-expanded","false"),this.navContent=document.createElement("div"),this.navContent.classList.add("navbar-content"),t.menuId&&(this.navContent.setAttribute("id",t.menuId),this.toggleButton.setAttribute("aria-controls",t.menuId)),this.navContent.addEventListener("click",function(t){n.isMobileNavOpen&&t.target&&t.target.closest&&t.target.closest("a")&&n.toggleMobileNav()}),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(){n.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.toggleButton.setAttribute("aria-expanded",String(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&&jo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Ro(t){return Ro="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},Ro(t)}function Io(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 Mo(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Io(Object(n),!0).forEach(function(e){Do(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Do(t,e,n){return(e=zo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fo(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,zo(r.key),r)}}function zo(t){var e=function(t){if("object"!=Ro(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ro(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ro(e)?e:e+""}function Lo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Lo=function(){return!!t})()}function No(){return No="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Bo(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}},No.apply(null,arguments)}function Bo(t){return Bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bo(t)}function Wo(t,e){return Wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wo(t,e)}var qo=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=Bo(e),function(t,e){if(e&&("object"==Ro(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,Lo()?Reflect.construct(e,n||[],Bo(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&&Wo(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 Mo(Mo({},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");var n=this._id?"\n id: ".concat(JSON.stringify(String(this._id)),","):"";return["new Switcher().set({".concat(n,"\n breakpoints: [\n ").concat(t,"\n ]\n })")]}},{key:"render",value:function(t){return this.internalDiv?(void 0!==t&&document.querySelector(t).appendChild(this.internalDiv),this.internalDiv):(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),this._on(window,"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 Mo(Mo({},t),{},{range:{from:o,to:i}})})}},{key:"applyView",value:function(){var t=this;if("function"==typeof window.matchMedia){window.innerWidth;var e=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())})}else{var r=this.breakpoints.reduce(function(t,e){return parseFloat(e.at)>parseFloat(t.at)?e:t},this.breakpoints[0]);r&&this.currentView!==r.view.render()&&(this.internalDiv.innerHTML="",this.internalDiv.appendChild(r.view.render()),this.currentView=r.view.render())}}},{key:"destroy",value:function(){var t,n,r;(t=e,n=this,"function"==typeof(r=No(Bo(1&3?t.prototype:t),"destroy",n))?function(t){return r.apply(n,t)}:r)([]),this.resizeListener=null,this.internalDiv&&this.container&&this.container.removeChild(this.internalDiv),this.container=null,this.currentView=null,this.internalDiv=null}}],r&&Fo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Uo(t){return Uo="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},Uo(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,Go(r.key),r)}}function Go(t){var e=function(t){if("object"!=Uo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Uo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Uo(e)?e:e+""}function Xo(t,e){if(e&&("object"==Uo(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 Jo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jo=function(){return!!t})()}function Vo(t){return Vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vo(t)}function $o(t,e){return $o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$o(t,e)}var Yo=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=Vo(o=e),(n=Xo(r,Jo()?Reflect.construct(o,[],Vo(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"),Xo(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&&$o(t,e)}(e,t),n=e,(r=[{key:"toCode",value:function(){return["new Spacer(".concat(this.hide,")")]}},{key:"render",value:function(){return this.res}}])&&Ho(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Qo(t){return Qo="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},Qo(t)}function Ko(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){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,ti(r.key),r)}}function ti(t){var e=function(t){if("object"!=Qo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Qo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qo(e)?e:e+""}function ei(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ei=function(){return!!t})()}function ni(t){return ni=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ni(t)}function ri(t,e){return ri=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ri(t,e)}var oi=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=ni(e),function(t,e){if(e&&("object"==Qo(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,ei()?Reflect.construct(e,n||[],ni(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&&ri(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 Ko(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)?Ko(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"===Qo(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)}}])&&Zo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function ii(t){return ii="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},ii(t)}function ai(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=si(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 si(t,e){if(t){if("string"==typeof t)return li(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)?li(t,e):void 0}}function li(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 ci(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,ui(r.key),r)}}function ui(t){var e=function(t){if("object"!=ii(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ii(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ii(e)?e:e+""}function fi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(fi=function(){return!!t})()}function di(t){return di=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},di(t)}function hi(t,e){return hi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hi(t,e)}"undefined"!=typeof window&&(window.Checkbox=oi);var pi=function(t){return t&&"function"==typeof t.play},yi={mp4:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',m4v:"video/mp4",mov:"video/quicktime",webm:"video/webm",ogv:"video/ogg",ogg:"video/ogg"},mi=function(t){var e=String(t||"").split("?")[0].split("#")[0].split(".").pop().toLowerCase();return yi[e]||""},vi=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=di(e),function(t,e){if(e&&("object"==ii(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,fi()?Reflect.construct(e,n||[],di(t).constructor):e.apply(t,n))}(this,e)).url=t,n.options={},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&&hi(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("video");return null!=this.url&&t.setAttribute("src",this.url),t.setAttribute("controls","controls"),this.res=t,this}},{key:"set",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=n;var r=this.res;if(Array.isArray(n.sources)&&n.sources.length){r.removeAttribute("src");for(var o=0,i=function(t){return function(t){if(Array.isArray(t))return li(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||si(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.")}()}(r.querySelectorAll("source"));o<i.length;o++)i[o].remove();var a,s=n.sources.concat(null!=this.url?[this.url]:[]),l=new Set,c=ai(s);try{for(c.s();!(a=c.n()).done;){var u=a.value,f="string"==typeof u?u:u&&u.url;if(f&&!l.has(f)){l.add(f);var d=document.createElement("source");d.setAttribute("src",f);var h="object"===ii(u)&&u.type||mi(f);h&&d.setAttribute("type",h),r.appendChild(d)}}}catch(t){c.e(t)}finally{c.f()}}n.poster&&r.setAttribute("poster",n.poster),n.preload&&r.setAttribute("preload",n.preload),!1===n.controls?r.removeAttribute("controls"):!0===n.controls&&r.setAttribute("controls","controls"),n.loop&&(r.loop=!0,r.setAttribute("loop","loop")),(null!==(t=n.playsinline)&&void 0!==t?t:n.autoplay)&&(r.setAttribute("playsinline",""),r.setAttribute("webkit-playsinline",""));var p=null!==(e=n.muted)&&void 0!==e?e:!!n.autoplay||void 0;if(!0===p?(r.muted=!0,r.setAttribute("muted","")):!1===p&&(r.muted=!1,r.removeAttribute("muted")),n.autoplay&&this._autoplay(!1!==n.lazy),n.objectFit&&(r.style.objectFit=n.objectFit),n.aspectRatio&&(r.style.aspectRatio=n.aspectRatio),n.id&&r.setAttribute("id",n.id),n.label&&r.setAttribute("aria-label",n.label),n.decorative&&r.setAttribute("aria-hidden","true"),n.background&&(r.style.background=n.background),n.poster&&!1!==n.posterBehind&&!/url\(|gradient\(/.test(String(n.background||""))){var y=n.objectFit||"contain";r.style.backgroundImage="url(".concat(JSON.stringify(String(n.poster)),")"),r.style.backgroundSize="cover"===y?"cover":"fill"===y?"100% 100%":"none"===y?"auto":"contain",r.style.backgroundPosition="center",r.style.backgroundRepeat="no-repeat"}return n.height&&(r.style.height=n.height),n.maxWidth&&(r.style.maxWidth=n.maxWidth),n.radius&&(r.style.borderRadius="number"==typeof n.radius?"".concat(n.radius,"px"):n.radius),n.width&&(r.style.width="".concat(n.width)),n.opacity&&(r.style.opacity=n.opacity),n.raster&&this.rasterize(n.raster),this}},{key:"_autoplay",value:function(t){var e=this,n=this.res;if("undefined"==typeof window||!pi(n))return this;if("function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.removeAttribute("autoplay"),this;n.setAttribute("autoplay","");var r=function(){var t=n.play();t&&t.catch&&t.catch(function(){})};if(!t||"function"!=typeof window.IntersectionObserver)return r(),this;this._visible=!1;var o=new window.IntersectionObserver(function(t){var o,i=ai(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;e._visible=a.isIntersecting,a.isIntersecting&&!e._hidden?r():n.pause()}}catch(t){i.e(t)}finally{i.f()}},{threshold:.2});return o.observe(n),this._track(function(){return o.disconnect()}),this._hidden=!1,this._on(document,"visibilitychange",function(){e._hidden=document.hidden,document.hidden?n.pause():e._visible&&r()}),this}},{key:"play",value:function(){var t,e;return pi(this.res)&&(null===(t=this.res.play())||void 0===t||null===(e=t.catch)||void 0===e||e.call(t,function(){})),this}},{key:"pause",value:function(){return pi(this.res)&&this.res.pause(),this}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"toCode",value:function(){var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=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)||si(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)[1]}));return['new Video("'.concat(this.url,'").set(').concat(yt(t,4),")")]}},{key:"render",value:function(t){var e;return t?(null===(e=document.querySelector(t))||void 0===e||e.appendChild(this.res),this.res):this.res}}],r&&ci(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function bi(t,e){if(t){if("string"==typeof t)return gi(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)?gi(t,e):void 0}}function gi(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 wi(t){return wi="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},wi(t)}function xi(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,ki(r.key),r)}}function ki(t){var e=function(t){if("object"!=wi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=wi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==wi(e)?e:e+""}function Si(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Si=function(){return!!t})()}function Oi(){return Oi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ji(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}},Oi.apply(null,arguments)}function ji(t){return ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ji(t)}function Ei(t,e){return Ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ei(t,e)}var _i=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=ji(e),function(t,e){if(e&&("object"==wi(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,Si()?Reflect.construct(e,n||[],ji(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&&Ei(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"===wi(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=Oi(ji(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){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=bi(t))){e&&(t=e);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(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()"),r=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)||bi(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)[1];return null!=e&&""!==e}));return Object.keys(r).length&&(n+="\n".concat(e," .set(").concat(JSON.stringify(r,null,2).split("\n").join("\n".concat(e," ")),")")),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&&xi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Ai(t){return Ai="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},Ai(t)}function Ti(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,Ci(r.key),r)}}function Ci(t){var e=function(t){if("object"!=Ai(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ai(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ai(e)?e:e+""}function Pi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pi=function(){return!!t})()}function Ri(t){return Ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ri(t)}function Ii(t,e){return Ii=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ii(t,e)}var Mi=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=Ri(e),function(t,e){if(e&&("object"==Ai(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,Pi()?Reflect.construct(e,n||[],Ri(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&&Ii(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="number"==typeof t?"".concat(t,"px"):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(),this._on(window,"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(),this._on(window,"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)}}])&&Ti(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Di(t){return Di="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},Di(t)}function Fi(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,zi(r.key),r)}}function zi(t){var e=function(t){if("object"!=Di(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Di(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Di(e)?e:e+""}var Li=function(){return t=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=document.createElement("div"),this.container.style.width="100%",this.container.style.margin="20px auto",this.container.style.textAlign="center",this.elements=e,this.currentSlideIndex=0,this.buttons=n,this.tintColor=r.tintColor||"green",this.inactiveColor=r.inactiveColor||"gray",this.options=r,!this.buttons){var o={leftButton:new Mi("L").set({frame:{width:50,height:50},svg:this.createArrowSVG("left",28,this.tintColor),color:this.tintColor,radius:"100%",mar:[{a:"1rem"}]}),rightButton:new Mi("R").set({frame:{width:50,height:50},svg:this.createArrowSVG("right",28,this.tintColor),color:this.tintColor,radius:"100%",mar:[{a:"1rem"}]})};this.buttons=o}this.createSlider(),this.init()},e=[{key:"createArrowSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:28,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"currentColor",r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg");o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("width",String(e)),o.setAttribute("height",String(e)),o.setAttribute("aria-hidden","true"),o.style.display="block",o.style.pointerEvents="none";var i=document.createElementNS(r,"path");return i.setAttribute("fill",n),"left"===t?i.setAttribute("d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"):i.setAttribute("d","M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z"),o.appendChild(i),o}},{key:"toCode",value:function(){var t="new Slider([".concat(this.elements.map(function(t){return t.toCode()}),"], null)");return[t=t.replace(/,\s*\./g,".")]}},{key:"createSlider",value:function(){var t,e=this;this.slider=document.createElement("div"),this.slider.style.width="100%",this.slider.style.height=null!==(t=this.options.height)&&void 0!==t?t:"400px",this.slider.style.borderRadius="20px",this.slider.style.overflow="hidden",this.slider.style.position="relative",this.slider.style.marginBottom="15px";var n=document.createElement("div");this.slidesWrapper=n,n.style.display="flex",n.style.overflowX="scroll",n.style.scrollBehavior="smooth",n.style.scrollSnapType="x mandatory",this.elements.forEach(function(t,r){var o=document.createElement("div");o.setAttribute("class","slide"),o.style.display="flex",o.style.justifyContent="center",o.style.alignItems="center",o.style.flexShrink="0",o.style.width="100%",o.style.height="400px",o.style.transformOrigin="center center",o.style.transform="scale(1)",o.style.scrollSnapAlign="center";var i=t.render();o.appendChild(i),i.style.cursor="pointer",i.addEventListener("click",function(){e.showLightbox(r)}),n.appendChild(o)}),this.arrowPrev=this.buttons.leftButton.render(),this.arrowPrev.style.position="absolute",this.arrowPrev.style.left="10px",this.arrowPrev.style.top="50%",this.arrowPrev.style.transform="translateY(-50%)",this.arrowPrev.style.zIndex="1",this.arrowPrev.style.display="flex",this.arrowPrev.style.alignItems="center",this.arrowPrev.style.justifyContent="center",this.arrowPrev.style.backgroundColor="white",this.arrowPrev.style.padding=".4rem",this.arrowNext=this.buttons.rightButton.render(),this.arrowNext.style.position="absolute",this.arrowNext.style.right="10px",this.arrowNext.style.top="50%",this.arrowNext.style.transform="translateY(-50%)",this.arrowNext.style.zIndex="1",this.arrowNext.style.display="flex",this.arrowNext.style.alignItems="center",this.arrowNext.style.justifyContent="center",this.arrowNext.style.backgroundColor="white",this.arrowNext.style.padding=".4rem";var r=document.createElement("div");r.style.position="absolute",r.style.bottom="10%",r.style.left="50%",r.style.transform="translateX(-50%)",r.style.textAlign="center",r.style.background="#ffffff",r.style.borderRadius="1rem",r.style.padding=".2rem",r.style.boxShadow="3px 3px 10px #000",this.options.hideSelector&&(r.style.display="none"),this.elements.forEach(function(t,n){var o=document.createElement("a");o.style.display="inline-block",o.style.height="15px",o.style.width="15px",o.style.borderRadius="50%",o.style.backgroundColor=e.inactiveColor,o.style.margin="0 10px",o.style.cursor="pointer",o.dataset.index=n,r.appendChild(o)});var o=document.createElement("div");o.style.display="flex",o.style.justifyContent="flex-start",o.style.margin="1rem",o.style.gap="10px",o.style.flexWrap="nowrap",o.style.overflowX="auto",this.options.hideThumbnails&&(o.style.display="none"),n.querySelectorAll(".slide").forEach(function(t,n){var r=document.createElement("div");r.className="slider-thumb",r.dataset.index=n.toString(),r.style.width="60px",r.style.height="40px",r.style.border="2px solid ".concat(e.inactiveColor),r.style.borderRadius="5px",r.style.overflow="hidden",r.style.cursor="pointer",r.style.flexShrink="0",r.style.position="relative";var i=(t.firstElementChild||t.cloneNode(!0)).cloneNode(!0);i.style.transform="scale(0.2)",i.style.transformOrigin="top left",i.style.width="300px",i.style.height="300px",i.style.backgroundSize="contain",i.style.pointerEvents="none",r.appendChild(i),o.appendChild(r)}),this.slider.appendChild(this.arrowPrev),this.slider.appendChild(this.arrowNext),this.slider.appendChild(n),this.slider.appendChild(r),this.container.appendChild(this.slider),this.container.appendChild(o),this.slidesWrapper=n,this.navLinks=Array.from(r.querySelectorAll("a")),this.thumbs=Array.from(o.querySelectorAll(".slider-thumb"))}},{key:"init",value:function(){this.updateActiveSlide(),this.attachEventListeners()}},{key:"attachEventListeners",value:function(){var t=this;this.arrowPrev.addEventListener("click",function(){t.moveToSlide(t.currentSlideIndex-1<0?t.elements.length-1:t.currentSlideIndex-1)}),this.arrowNext.addEventListener("click",function(){t.moveToSlide((t.currentSlideIndex+1)%t.elements.length)}),this.navLinks.forEach(function(e){e.addEventListener("click",function(n){n.preventDefault();var r=parseInt(e.dataset.index,10);t.moveToSlide(r)})}),this.thumbs.forEach(function(e){e.addEventListener("click",function(){var n=parseInt(e.dataset.index,10);t.moveToSlide(n)})}),document.addEventListener("keydown",function(e){"ArrowLeft"===e.key?t.moveToSlide(t.currentSlideIndex-1<0?t.elements.length-1:t.currentSlideIndex-1):"ArrowRight"===e.key&&t.moveToSlide((t.currentSlideIndex+1)%t.elements.length)})}},{key:"moveToSlide",value:function(t){this.currentSlideIndex=t,this.updateActiveSlide()}},{key:"updateActiveSlide",value:function(){var t=this;this.navLinks.forEach(function(e){var n=parseInt(e.dataset.index,10);e.style.backgroundColor=n===t.currentSlideIndex?t.tintColor:t.inactiveColor}),this.thumbs.forEach(function(e){var n=parseInt(e.dataset.index,10);e.style.borderColor=n===t.currentSlideIndex?t.tintColor:t.inactiveColor});var e=this.slidesWrapper.querySelector(".slide"),n=e?e.offsetWidth:this.slidesWrapper.clientWidth;this.slidesWrapper.scrollTo({left:this.currentSlideIndex*n,behavior:"smooth"})}},{key:"showLightbox",value:function(t){var e=this,n=t,r=document.createElement("div");r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100vw",r.style.height="100vh",r.style.backgroundColor="rgba(0,0,0,0.9)",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.zIndex="9999",r.style.cursor="default";var o=document.createElement("div");o.style.position="relative",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.maxWidth="90%",o.style.maxHeight="90%",r.appendChild(o);var i=function(t){o.innerHTML="";var n,r=e.elements[t].render();if(n="IMG"===r.tagName?r:r.querySelector("img")){var i=document.createElement("img");i.src=n.src,i.style.maxWidth="90vw",i.style.maxHeight="90vh",i.style.objectFit="contain",i.style.pointerEvents="none",i.style.display="block",o.appendChild(i)}else{var a=r.cloneNode(!0);a.style.width="90vw",a.style.height="90vh",a.style.maxWidth="90vw",a.style.maxHeight="90vh",a.style.pointerEvents="none",o.appendChild(a)}};i(n);var a=this.buttons.leftButton.render().cloneNode(!0),s=this.buttons.rightButton.render().cloneNode(!0),l={position:"absolute",top:"50%",transform:"translateY(-50%)",background:"white",border:"none",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",width:"50px",height:"50px",margin:"1rem",padding:"0",zIndex:"10000",cursor:"pointer",boxShadow:"0 2px 8px rgba(0,0,0,0.4)"};Object.assign(a.style,l,{left:"10px"}),Object.assign(s.style,l,{right:"10px"}),a.addEventListener("click",function(t){t.stopPropagation(),n=n-1<0?e.elements.length-1:n-1,i(n)}),s.addEventListener("click",function(t){t.stopPropagation(),n=(n+1)%e.elements.length,i(n)}),r.appendChild(a),r.appendChild(s);var c=document.createElement("div");c.innerHTML="✕",c.style.position="absolute",c.style.top="15px",c.style.right="20px",c.style.fontSize="2rem",c.style.color="white",c.style.cursor="pointer",c.style.zIndex="10000",c.style.userSelect="none",c.style.transition="transform 0.2s ease",c.addEventListener("mouseenter",function(){c.style.transform="scale(1.2)"}),c.addEventListener("mouseleave",function(){c.style.transform="scale(1)"}),c.addEventListener("click",function(t){t.stopPropagation(),document.body.removeChild(r),document.removeEventListener("keydown",u)}),r.appendChild(c),r.addEventListener("click",function(){document.body.removeChild(r),document.removeEventListener("keydown",u)});var u=function(t){"Escape"===t.key?(document.body.removeChild(r),document.removeEventListener("keydown",u)):"ArrowLeft"===t.key?(n=n-1<0?e.elements.length-1:n-1,i(n)):"ArrowRight"===t.key&&(n=(n+1)%e.elements.length,i(n))};document.addEventListener("keydown",u),document.body.appendChild(r)}},{key:"render",value:function(t){if(!t)return this.container;document.querySelector(t).appendChild(this.container)}}],e&&Fi(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Ni(t){return Ni="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},Ni(t)}function Bi(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,Wi(r.key),r)}}function Wi(t){var e=function(t){if("object"!=Ni(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ni(e)?e:e+""}function qi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(qi=function(){return!!t})()}function Ui(t){return Ui=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ui(t)}function Hi(t,e){return Hi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hi(t,e)}var Gi=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=Ui(e),function(t,e){if(e&&("object"==Ni(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,qi()?Reflect.construct(e,n||[],Ui(t).constructor):e.apply(t,n))}(this,e)).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&&Hi(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=null==t.title?"":String(t.title),o=document.createTextNode(r);n.appendChild(o),n.style.opacity=0;var i=document.createElement("input");return"textarea"===t.type&&(i=document.createElement("textarea")),i.style.position="relative",i.placeholder=r,i.style.boxSizing="border-box",r&&!i.getAttribute("aria-label")&&i.setAttribute("aria-label",r),i.style.fontSize="1rem",i.style.padding=".4rem .75rem",e.appendChild(n),e.appendChild(i),this.res=e,t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),i.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",i.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)}),i.addEventListener("focusout",function(){n.style.transform="scale(1.0)",i.placeholder=r,n.style.opacity="0.0"}),t.name&&i.setAttribute("name",t.name),"INPUT"===i.tagName&&t.type&&"input"!==t.type&&i.setAttribute("type",t.type),t.required&&i.setAttribute("required",""),window.matchMedia("(max-device-width: 415px)").matches&&(i.style.width="100%",e.style.width="100%"),i.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)}}])&&Bi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Xi(t){return Xi="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},Xi(t)}function Ji(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,Vi(r.key),r)}}function Vi(t){var e=function(t){if("object"!=Xi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xi(e)?e:e+""}"undefined"!=typeof window&&(window.FloatingInput=Gi);var $i=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)}}])&&Ji(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Yi(t){return Yi="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},Yi(t)}function Qi(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,Ki(r.key),r)}}function Ki(t){var e=function(t){if("object"!=Yi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Yi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Yi(e)?e:e+""}"undefined"!=typeof window&&(window.Range=$i);var Zi=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,t&&null!=t.id&&""!==t.id&&this.el.setAttribute("id",String(t.id)),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)}}])&&Qi(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ta(t){return ta="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},ta(t)}function ea(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,na(r.key),r)}}function na(t){var e=function(t){if("object"!=ta(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ta(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ta(e)?e:e+""}function ra(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ra=function(){return!!t})()}function oa(t){return oa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oa(t)}function ia(t,e){return ia=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ia(t,e)}"undefined"!=typeof window&&(window.RadioGroup=Zi);var aa=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=oa(e),function(t,e){if(e&&("object"==ta(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,ra()?Reflect.construct(e,n||[],oa(t).constructor):e.apply(t,n))}(this,e)).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&&ia(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++){var o=t[r],i="string"==typeof o||"number"==typeof o?[String(o),String(o)]:[o&&o[0],o&&o[1]];n.appendChild(this.addNode(i[0],i[1]))}return this.el=n,this.res=n,this}},{key:"set",value:function(t){this.options=t;var e=t.name;t.items&&this.setup(t.items,e),t.arrayPadding&&(this.deprecatedOption("arrayPadding",'pad: [{a: "0.5rem"}]'),this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value)),t.arrayMargin&&(this.deprecatedOption("arrayMargin","mar: [{a: 10}]"),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);var n=t.title,r=void 0!==t.label?t.label:n;return null==r||this.el.getAttribute("aria-label")||this.el.setAttribute("aria-label",String(r)),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(),this._on(window,"resize",e),this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}],r&&ea(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function sa(t){return sa="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},sa(t)}function la(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,ca(r.key),r)}}function ca(t){var e=function(t){if("object"!=sa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=sa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==sa(e)?e:e+""}function ua(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ua=function(){return!!t})()}function fa(t){return fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fa(t)}function da(t,e){return da=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},da(t,e)}"undefined"!=typeof window&&(window.Picker=aa);var ha=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=fa(e),function(t,e){if(e&&("object"==sa(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,ua()?Reflect.construct(e,n||[],fa(t).constructor):e.apply(t,n))}(this,e)).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&&da(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),void 0!==t.id&&null!==t.id&&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.textContent=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.textContent="Change",e.file=o.files[0],e.onLoad(e.file),pa[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(),this._on(window,"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}}])&&la(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt),pa=[];function ya(t,e){return ya=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ya(t,e)}function ma(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ma=function(){return!!t})()}function va(t){return va="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},va(t)}function ba(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,ga(r.key),r)}}function ga(t){var e=function(t){if("object"!=va(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=va(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==va(e)?e:e+""}var wa=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)}}])&&ba(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),xa=wa;function ka(t){return ka="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},ka(t)}function Sa(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 Oa(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,ja(r.key),r)}}function ja(t){var e=function(t){if("object"!=ka(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ka(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ka(e)?e:e+""}wa=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(ma())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&ya(o,n.prototype),o}(xa,e)},"undefined"!=typeof window&&(window.DataList=wa);var Ea=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=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 Sa(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)?Sa(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],o="string"==typeof r?JSON.stringify(r):r;return"".concat(n,": ").concat(o)}).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),t.title&&this.formElement.setAttribute("aria-label",t.title),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&&Oa(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function _a(t){return _a="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},_a(t)}function Aa(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,Ta(r.key),r)}}function Ta(t){var e=function(t){if("object"!=_a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_a(e)?e:e+""}var Ca=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 pe).set(r))}return o}}],null&&Aa(t.prototype,null),e&&Aa(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Pa(t){return Pa="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},Pa(t)}function Ra(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,Ia(r.key),r)}}function Ia(t){var e=function(t){if("object"!=Pa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pa(e)?e:e+""}function Ma(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ma=function(){return!!t})()}function Da(t){return Da=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Da(t)}function Fa(t,e){return Fa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fa(t,e)}var za=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=Da(r),t=function(t,e){if(e&&("object"==Pa(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,Ma()?Reflect.construct(r,o||[],Da(n).constructor):r.apply(n,o)))._noTheme=!0,t.gridContainer=document.createElement("div"),t.gridContainer.classList.add("grid-container"),t.gridContainer.style.display="grid",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&&Fa(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){return t&&null!=t.id&&""!==t.id&&this.gridContainer.setAttribute("id",String(t.id)),t.gap&&(this.gridContainer.style.gap=t.gap),t.height&&(this.gridContainer.style.height=t.height),t.width&&(this.gridContainer.style.width=t.width),this}},{key:"react",value:function(t){var e=this,n=function(){for(var n=0;n<t.length-1;n++){var r=parseInt(t[n].at),o=parseInt(t[n+1].at);if(window.innerWidth>r&&window.innerWidth<o){var i=t[n].template.map(function(t){return t.split("").join(" ")}).map(function(t){return'"'.concat(t,'"')}).join(" ");e.gridContainer.style.gridTemplateAreas=i}else if(window.innerWidth>o){var a=t[t.length-1].template.map(function(t){return t.split("").join(" ")}).map(function(t){return'"'.concat(t,'"')}).join(" ");e.gridContainer.style.gridTemplateAreas=a}}};return n(),this._on(window,"resize",n),this}},{key:"add",value:function(t){for(var e=function(t){for(var e=[],n=0;n<t;n++){var r="",o=n;do{r=String.fromCharCode(65+o%26)+r,o=Math.floor(o/26)-1}while(o>=0);e.push(r)}return e}(t.length),n=0;n<t.length;n++){var r=t[n].render();r.style.gridArea=e[n].toLowerCase();var o=document.createElement("div");o.textContent=t[n].text,o.style.gridArea=e[n].toLowerCase(),this.gridContainer.appendChild(r)}return this}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.gridContainer),this.gridContainer}},{key:"toCode",value:function(){return"new Simple().set({}).react([])"}}],r&&Ra(n.prototype,r),o&&Ra(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Tt);function La(t){return La="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},La(t)}function Na(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 Ba(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Na(Object(n),!0).forEach(function(e){Wa(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Na(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Wa(t,e,n){return(e=Ua(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qa(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,Ua(r.key),r)}}function Ua(t){var e=function(t){if("object"!=La(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=La(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==La(e)?e:e+""}function Ha(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ha=function(){return!!t})()}function Ga(){return Ga="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Xa(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}},Ga.apply(null,arguments)}function Xa(t){return Xa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xa(t)}function Ja(t,e){return Ja=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ja(t,e)}var Va=function(t){function e(){var t,n=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),(t=function(t,e,n){return e=Xa(e),function(t,e){if(e&&("object"==La(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,Ha()?Reflect.construct(e,n||[],Xa(t).constructor):e.apply(t,n))}(this,e)).res=null,t.options={},t.code=[],t.elCSS=[],t.html=[],t.react=[],t.setup(n),t.code.push("new Polygon(".concat(JSON.stringify(n),")")),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&&Ja(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=yt(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=Ba(Ba({},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,a=[];if(n.stroke||n.gradient||n.backgroundOp||n.layout||n.marginOp||n.shadow||n.animation||n.filtera||n.transform){var s;n.gradient&&(this.globalGradient=n.gradient.op.gradient),n.stroke&&(null===(r=e,o=this,s="function"==typeof(i=Ga(Xa(1&3?r.prototype:r),"setAny",o))?function(t){return i.apply(o,t)}:i)||void 0===s||s([{globalBlast:"".concat(n.stroke.op.width," ").concat(n.stroke.op.color)}]));for(var l=[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}),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=[];n.border&&u.push("border"),n.background&&u.push("background"),(n.mar||n.margin)&&u.push("margin"),n.animation&&u.push("animation"),"radial"===n.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),this.chainReact(a,this.options.id,u)}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&&qa(n.prototype,r),o&&qa(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Tt);function $a(t){return $a="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},$a(t)}function Ya(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 Qa(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,Ka(r.key),r)}}function Ka(t){var e=function(t){if("object"!=$a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$a(e)?e:e+""}function Za(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Za=function(){return!!t})()}function ts(){return ts="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=es(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}},ts.apply(null,arguments)}function es(t){return es=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},es(t)}function ns(t,e){return ns=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ns(t,e)}var rs=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=es(e),function(t,e){if(e&&("object"==$a(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,Za()?Reflect.construct(e,n||[],es(t).constructor):e.apply(t,n))}(this,e)).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&&ns(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=yt(Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=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 Ya(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)?Ya(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)[1]})),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,i=[];if(t.stroke||t.gradient||t.backgroundOp||t.layout||t.marginOp||t.shadow||t.animation||t.filtera||t.transform){var 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&&(null===(n=e,r=this,a="function"==typeof(o=ts(es(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)||void 0===a||a([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]));for(var s=[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}),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.border&&c.push("border"),t.background&&c.push("background"),(t.mar||t.margin)&&c.push("margin"),t.animation&&c.push("animation"),this.chainReact(i,this.options.id,c)}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&&Qa(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt),os=["mobile"];function is(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 as(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?is(Object(n),!0).forEach(function(e){ss(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):is(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ss(t,e,n){return(e=function(t){var e=function(t){if("object"!=ls(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ls(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ls(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ls(t){return ls="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},ls(t)}var cs=function(t){var e=Math.floor(Number(t));return Number.isFinite(e)&&e>0?e:0},us=function(t,e){return Math.max(1,Math.round(Number(e)||1))%2==1?Math.round(t-.5)+.5:Math.round(t)},fs=function(t,e,n,r){if(0===t||n<=e)return[];for(var o=(n-e)/t,i=[],a=0;a<=t;a++)i.push(us(e+o*a,r));return i};function ds(t){return ds="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},ds(t)}function hs(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ps(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 ps(t,e){if(t){if("string"==typeof t)return ys(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)?ys(t,e):void 0}}function ys(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 ms(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,vs(r.key),r)}}function vs(t){var e=function(t){if("object"!=ds(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ds(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ds(e)?e:e+""}function bs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(bs=function(){return!!t})()}function gs(t){return gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gs(t)}function ws(t,e){return ws=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ws(t,e)}var xs="http://www.w3.org/2000/svg",ks={columns:4,rows:2,inset:16,lineWidth:1,lineOpacity:.35,marks:"square",markSize:8,position:"fixed",zIndex:2,font:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:11,letterSpacing:"0.04em",uppercase:!0,breakpoint:768,readouts:[]},Ss=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=gs(e),function(t,e){if(e&&("object"==ds(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,bs()?Reflect.construct(e,n||[],gs(t).constructor):e.apply(t,n))}(this,e)).options={},t.config=null,t._readoutEls=new Map,t._readoutText=new Map,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&&ws(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("div");t.setAttribute("aria-hidden","true"),t.setAttribute("data-nodality","grid-overlay"),t.style.pointerEvents="none",t.style.top="0",t.style.right="0",t.style.bottom="0",t.style.left="0",t.style.overflow="hidden";var e=document.createElementNS(xs,"svg");return e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("focusable","false"),e.style.display="block",t.appendChild(e),this.res=t,this.svg=e,this}},{key:"set",value:function(){var t,e,n,r,o,i,a,s,l,c,u,f,d,h,p,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=y,this.config={columns:null!==(t=y.columns)&&void 0!==t?t:ks.columns,rows:null!==(e=y.rows)&&void 0!==e?e:ks.rows,inset:null!==(n=y.inset)&&void 0!==n?n:ks.inset,color:y.color,lineWidth:null!==(r=y.lineWidth)&&void 0!==r?r:ks.lineWidth,lineOpacity:null!==(o=y.lineOpacity)&&void 0!==o?o:ks.lineOpacity,marks:null!==(i=y.marks)&&void 0!==i?i:ks.marks,markSize:null!==(a=y.markSize)&&void 0!==a?a:ks.markSize,position:null!==(s=y.position)&&void 0!==s?s:ks.position,zIndex:null!==(l=y.zIndex)&&void 0!==l?l:ks.zIndex,font:null!==(c=y.font)&&void 0!==c?c:ks.font,fontSize:null!==(u=y.fontSize)&&void 0!==u?u:ks.fontSize,letterSpacing:null!==(f=y.letterSpacing)&&void 0!==f?f:ks.letterSpacing,uppercase:null!==(d=y.uppercase)&&void 0!==d?d:ks.uppercase,breakpoint:null!==(h=y.breakpoint)&&void 0!==h?h:ks.breakpoint,mobile:y.mobile,readouts:null!==(p=y.readouts)&&void 0!==p?p:ks.readouts};var m=this.config;return this.res.style.position="absolute"===m.position?"absolute":"fixed",this.res.style.zIndex=String(m.zIndex),y.color&&(this.res.style.color=y.color),y.id&&this.res.setAttribute("id",y.id),this._watchSize(),this.draw(),y.raster&&this.rasterize(y.raster),this}},{key:"readout",value:function(t,e){this._readoutText.set(t,e);var n=this._readoutEls.get(t);return n&&(n.textContent=this._format(e)),this}},{key:"geometry",value:function(){return this._geometry||null}},{key:"draw",value:function(){var t=this;if(!this.config)return this;var e=this._measure(),n=e.width,r=e.height,o=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})||{},n=e.mobile,r=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,os),o=Number(r.breakpoint)||768;return n&&"object"===ls(n)&&t<o?as(as({},r),n):r}(this.config,this._viewportWidth()),i=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.width,n=void 0===e?0:e,r=t.height,o=void 0===r?0:r,i=t.columns,a=void 0===i?4:i,s=t.rows,l=void 0===s?2:s,c=t.inset,u=void 0===c?0:c,f=t.lineWidth,d=void 0===f?1:f,h=Math.max(0,Number(n)||0),p=Math.max(0,Number(o)||0),y=cs(a),m=cs(l),v=function(t){if(t&&"object"===ls(t))return{x:Math.max(0,Number(t.x)||0),y:Math.max(0,Number(t.y)||0)};var e=Math.max(0,Number(t)||0);return{x:e,y:e}}(u),b=Math.min(v.x,h/2),g=Math.min(v.y,p/2),w=fs(y,b,h-b,d),x=fs(m,g,p-g,d),k=[],S=0;S<x.length;S++)for(var O=0;O<w.length;O++)k.push({col:O,row:S,x:w[O],y:x[S]});return{width:h,height:p,columns:y,rows:m,inset:{x:b,y:g},cell:{width:y?(h-2*b)/y:0,height:m?(p-2*g)/m:0},x:w,y:x,intersections:k}}({width:n,height:r,columns:o.columns,rows:o.rows,inset:o.inset,lineWidth:o.lineWidth});this._geometry=i;for(var a=this.svg;a.firstChild;)a.removeChild(a.firstChild);if(this._readoutEls.clear(),!n||!r)return this;a.setAttribute("viewBox","0 0 ".concat(n," ").concat(r));var s,l=this._node("g",{stroke:"currentColor","stroke-width":o.lineWidth,"stroke-opacity":o.lineOpacity,"shape-rendering":"crispEdges"}),c=hs(i.x);try{for(c.s();!(s=c.n()).done;){var u=s.value;l.appendChild(this._node("line",{x1:u,y1:0,x2:u,y2:r}))}}catch(t){c.e(t)}finally{c.f()}var f,d=hs(i.y);try{for(d.s();!(f=d.n()).done;){var h=f.value;l.appendChild(this._node("line",{x1:0,y1:h,x2:n,y2:h}))}}catch(t){d.e(t)}finally{d.f()}a.appendChild(l);var p=Number(o.markSize)||0;if(p>0&&"square"===o.marks){var y,m=this._node("g",{fill:"currentColor","shape-rendering":"crispEdges"}),v=hs(i.intersections);try{for(v.s();!(y=v.n()).done;){var b=y.value;m.appendChild(this._node("rect",{x:b.x-p/2,y:b.y-p/2,width:p,height:p}))}}catch(t){v.e(t)}finally{v.f()}a.appendChild(m)}else if(p>0&&"cross"===o.marks){var g=i.intersections.map(function(t){return"M".concat(t.x-p/2," ").concat(t.y,"H").concat(t.x+p/2,"M").concat(t.x," ").concat(t.y-p/2,"V").concat(t.y+p/2)}).join("");g&&a.appendChild(this._node("path",{d:g,fill:"none",stroke:"currentColor","stroke-width":o.lineWidth,"shape-rendering":"crispEdges"}))}var w=Array.isArray(o.readouts)?o.readouts:[];if(w.length){var x=this._node("g",{fill:"currentColor","font-family":o.font,"font-size":o.fontSize,"letter-spacing":o.letterSpacing}),k=p/2+6;w.forEach(function(e,o){if(e){var a=i.intersections.find(function(t){return t.col===e.col&&t.row===e.row});if(a){var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"br",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=["tl","tr","bl","br"].includes(e)?e:"br",i="r"===o[1],a="b"===o[0];if(r){var s=Number(r.width)||0,l=Number(r.height)||0,c=n+24;i&&t.x+c>s?i=!1:!i&&t.x-c<0&&(i=!0),a&&t.y+c>l?a=!1:!a&&t.y-c<0&&(a=!0)}return{x:t.x+(i?n:-n),y:t.y+(a?n:-n),textAnchor:i?"start":"end",baseline:a?"hanging":"alphabetic"}}(a,e.anchor,k,{width:n,height:r}),l=null!=e.id?String(e.id):"readout-".concat(o),c=t._node("text",{x:s.x,y:s.y,"text-anchor":s.textAnchor,"dominant-baseline":s.baseline,"data-readout":l});c.textContent=t._format(t._readoutText.has(l)?t._readoutText.get(l):e.text),x.appendChild(c),t._readoutEls.set(l,c)}}}),a.appendChild(x)}return this}},{key:"_format",value:function(t){var e=null==t?"":String(t);return this.config&&!1===this.config.uppercase?e:e.toUpperCase()}},{key:"_node",value:function(t,e){var n=document.createElementNS(xs,t);for(var r in e)n.setAttribute(r,String(e[r]));return n}},{key:"_viewportWidth",value:function(){return"undefined"!=typeof window&&window.innerWidth?window.innerWidth:1/0}},{key:"_measure",value:function(){var t="undefined"!=typeof window;return{width:this.res.clientWidth||(t?window.innerWidth:0)||0,height:this.res.clientHeight||(t?window.innerHeight:0)||0}}},{key:"_watchSize",value:function(){var t=this;if(!this._watching&&"undefined"!=typeof window)if(this._watching=!0,"function"==typeof window.ResizeObserver){var e=new window.ResizeObserver(function(){return t.draw()});e.observe(this.res),this._track(function(){return e.disconnect()})}else this._on(window,"resize",function(){return t.draw()})}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=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)||ps(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)[1]}));return["new GridOverlay().set(".concat(yt(t,4),")")]}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"render",value:function(t){if(t){var e=document.querySelector(t);e&&(e.appendChild(this.res),this.draw())}return this.res}}],r&&ms(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Tt);function Os(t){return Os="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},Os(t)}function js(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)||_s(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Es(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=_s(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 _s(t,e){if(t){if("string"==typeof t)return As(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)?As(t,e):void 0}}function As(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 Ts(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,Cs(r.key),r)}}function Cs(t){var e=function(t){if("object"!=Os(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Os(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Os(e)?e:e+""}function Ps(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ps=function(){return!!t})()}function Rs(t){return Rs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Rs(t)}function Is(t,e){return Is=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Is(t,e)}var Ms="https://cdn.shopify.com/storefront/web-components.js",Ds=function(t,e){var n=String(null!=t?t:e).replace(/^#/,"");return/^[A-Za-z][\w-]*$/.test(n)?n:e},Fs=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=Rs(e),function(t,e){if(e&&("object"==Os(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,Ps()?Reflect.construct(e,n||[],Rs(t).constructor):e.apply(t,n))}(this,e)).items=[],t.fallbackItems=[],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&&Is(t,e)}(e,t),n=e,r=[{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.kind,n=this["build_".concat(e)];if("function"!=typeof n)throw new Error('nodality: Shop has no kind "'.concat(e,'"'));return this.res=n.call(this,t),"product"===e&&(this.res.style.display="block",this.commonMethods(t)),t.id&&this.res.setAttribute("id",String(t.id)),t.font&&(this.res.style.fontFamily=t.font),t.color&&(this.res.style.color=t.color),"product"!==e&&"store"!==e&&"cart"!==e&&(this.applyStyleOptions(t),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar)),t.keySet&&this.keySet(t.keySet),this}},{key:"build_store",value:function(t){var n=document.createElement("shopify-store");return n.setAttribute("store-domain",t.domain),t.token&&n.setAttribute("public-access-token",t.token),t.country&&n.setAttribute("country",t.country),t.language&&n.setAttribute("language",t.language),e.loadScript(),n}},{key:"build_product",value:function(t){var e=document.createElement("shopify-context");return e.setAttribute("type","product"),e.setAttribute("handle",t.handle),this.template=document.createElement("template"),this.placeholder=document.createElement("div"),this.placeholder.setAttribute("shopify-loading-placeholder",""),this.placeholder.style.display="contents",e.appendChild(this.template),e.appendChild(this.placeholder),e}},{key:"build_price",value:function(t){var e;if(t.fallback)return this.text(t.text);var n=document.createElement("shopify-money");return n.setAttribute("query",null!==(e=t.query)&&void 0!==e?e:"product.selectedOrFirstAvailableVariant.price"),null!=t.text&&(n.textContent=t.text),n}},{key:"build_productData",value:function(t){var e;if(t.fallback)return this.text(t.text);var n=document.createElement("shopify-data");return n.setAttribute("query",null!==(e=t.query)&&void 0!==e?e:"product.title"),null!=t.text&&(n.textContent=t.text),n}},{key:"build_productMedia",value:function(t){var e;if(t.fallback){var n,r=document.createElement("img");return t.url&&r.setAttribute("src",t.url),r.setAttribute("alt",null!==(n=t.alt)&&void 0!==n?n:""),t.width&&r.setAttribute("width",String(t.width)),t.height&&r.setAttribute("height",String(t.height)),r}var o=document.createElement("shopify-media");if(o.setAttribute("query",null!==(e=t.query)&&void 0!==e?e:"product.selectedOrFirstAvailableVariant.image"),t.width&&o.setAttribute("width",String(t.width)),t.height&&o.setAttribute("height",String(t.height)),t.url){var i,a=document.createElement("img");a.setAttribute("src",t.url),a.setAttribute("alt",null!==(i=t.alt)&&void 0!==i?i:""),o.appendChild(a)}return o}},{key:"build_variantPicker",value:function(t){if(t.fallback)return this.text(t.text);var e=document.createElement("shopify-variant-selector");return null!=t.text&&(e.textContent=t.text),e}},{key:"build_buy",value:function(t){var e;if(t.fallback){var n,r=document.createElement("a");return t.url&&r.setAttribute("href",t.url),r.textContent=null!==(n=t.text)&&void 0!==n?n:"Buy",r}var o=document.createElement("button");o.setAttribute("type","button"),o.textContent=null!==(e=t.text)&&void 0!==e?e:"Add to cart";var i=Ds(t.cart,"cart"),a=Ds(t.store,"store");return o.setAttribute("onclick","buyNow"===t.mode?"document.getElementById('".concat(a,"').buyNow(event)"):"document.getElementById('".concat(i,"').addLine(event).showModal()")),o}},{key:"build_cart",value:function(t){var n=document.createElement("shopify-cart");t.target&&n.setAttribute("target",t.target),t.discountCodes&&n.setAttribute("discount-codes",t.discountCodes);var r=Ds(t.id,"cart");return t.theme&&e.themeCart(r,t.theme),n}},{key:"text",value:function(t){var e=document.createElement("span");return e.textContent=null!=t?t:"",e}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.items=t;var e,n=this.template?this.template.content:this.res,r=Es(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;o&&"function"==typeof o.render&&n.appendChild(o.render())}}catch(t){r.e(t)}finally{r.f()}return this}},{key:"fallback",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.fallbackItems=t;var e,n=this.placeholder||this.res,r=Es(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;o&&"function"==typeof o.render&&n.appendChild(o.render())}}catch(t){r.e(t)}finally{r.f()}return this}},{key:"toCode",value:function(){var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=js(t,2)[1]})),e=function(t){return t.filter(function(t){return t&&"function"==typeof t.toCode}).map(function(t){return[].concat(t.toCode()).join("")}).join(",\n")},n="new Shop().set(".concat(yt(t,4),")");return this.items.length&&(n+=".add([".concat(e(this.items),"])")),this.fallbackItems.length&&(n+=".fallback([".concat(e(this.fallbackItems),"])")),[n]}},{key:"render",value:function(t){if(t){var e=document.querySelector(t);e&&e.appendChild(this.res)}return this.res}}],o=[{key:"loadScript",value:function(){if("undefined"!=typeof document&&document.head&&!document.querySelector('script[src="'.concat(Ms,'"]'))){var t=document.createElement("script");t.setAttribute("type","module"),t.setAttribute("src",Ms),document.head.appendChild(t)}}},{key:"themeCart",value:function(t,e){var n,r;if("undefined"!=typeof document&&document.head){var o="#".concat(t),i=function(t){return Object.entries(t).filter(function(t){var e=js(t,2)[1];return null!=e&&""!==e}).map(function(t){var e=js(t,2),n=e[0],r=e[1];return"".concat(n,": ").concat(String(r).replace(/[;{}<>]/g,""))}).join("; ")},a=["".concat(o," { ").concat(i({"font-family":e.font})," }"),"".concat(o,"::part(dialog) { ").concat(i({background:e.background,color:e.color,"font-family":e.font,"border-radius":e.radius})," }"),"".concat(o,"::part(primary-button) { ").concat(i({background:e.accent,color:e.accentText,"font-family":e.font,"border-radius":null!==(n=e.buttonRadius)&&void 0!==n?n:e.radius})," }"),"".concat(o,"::part(secondary-button) { ").concat(i({color:e.color,"font-family":e.font})," }"),"".concat(o,"::part(line-heading) { ").concat(i({"font-family":null!==(r=e.headingFont)&&void 0!==r?r:e.font})," }")].join("\n"),s="nodality-cart-".concat(t),l=document.head.querySelector('style[data-shop="'.concat(s,'"]'));l||((l=document.createElement("style")).setAttribute("data-shop",s),document.head.appendChild(l)),l.textContent=a}}}],r&&Ts(n.prototype,r),o&&Ts(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Tt),zs=["font","color","background","radius"];function Ls(t){return function(t){if(Array.isArray(t))return Bs(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ns(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 Ns(t,e){if(t){if("string"==typeof t)return Bs(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)?Bs(t,e):void 0}}function Bs(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 Ws(t){return Ws="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},Ws(t)}function qs(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,Xs(r.key),r)}}function Us(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 Hs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Us(Object(n),!0).forEach(function(e){Gs(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Us(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Gs(t,e,n){return(e=Xs(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xs(t){var e=function(t){if("object"!=Ws(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ws(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ws(e)?e:e+""}var Js=["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","gridOverlay","store","product","price","productData","productMedia","variantPicker","buy","cart"],Vs=function(t,e){var n=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):t};return n(t)===n(e)},$s=function(t){var e,n;return"string"==typeof t||"number"==typeof t?{title:String(t),link:"#e"}:Hs(Hs({},t),{},{title:String(null!==(e=null==t?void 0:t.title)&&void 0!==e?e:""),link:null!==(n=null==t?void 0:t.link)&&void 0!==n?n:"#e"})},Ys=Object.freeze({cards:"items",table:"items",ulist:"items",nav:"items",sideNav:"items",dropdown:"items",picker:"items",radio:"items",row:"children",form:"children",stack:"children",wrap:"children",product:"children"}),Qs=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){var e=this.dispatchType(t),n=t&&t.el&&t.el.id;if(null!=n&&""!==n){var r=String(n);e&&"object"===Ws(e)&&(e.options&&"object"===Ws(e.options)&&(e.options.id=r),e.obj&&"object"===Ws(e.obj)&&(e.obj.id=r));var o=e&&(e.res||e.formElement||e.el||e.container),i=e&&[e.res,e.formElement,e.el,e.container].some(function(t){return t&&"function"==typeof t.getAttribute&&(t.getAttribute("id")===r||"function"==typeof t.querySelectorAll&&Ls(t.querySelectorAll("[id]")).some(function(t){return t.getAttribute("id")===r}))});o&&!i&&"function"==typeof o.setAttribute&&(o.getAttribute("id")||o.setAttribute("id",String(n)))}return e}},{key:"dispatchType",value:function(t){if(function(t){var e=Ys[t&&t.type];if(e){var n="items"===e?"children":"items",r=function(e){return Array.isArray(t[e])&&t[e].length>0};if(r(n)&&!r(e)){var o=t.id?' (id "'.concat(t.id,'")'):"";console.warn('[nodality] "'.concat(t.type,'"').concat(o,' carries content in "').concat(n,'" but reads ')+'"'.concat(e,'". The "').concat(n,'" content is ignored and the placeholder template ')+'rendered instead. Move it to "'.concat(e,'".'))}}}(t&&t.el),["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);if("gridOverlay"===t.el.type)return this.mapGridOverlay(t);if("store"===t.el.type)return this.mapStore(t);if("product"===t.el.type)return this.mapProduct(t);if("price"===t.el.type)return this.mapPrice(t);if("productData"===t.el.type)return this.mapProductData(t);if("productMedia"===t.el.type)return this.mapProductMedia(t);if("variantPicker"===t.el.type)return this.mapVariantPicker(t);if("buy"===t.el.type)return this.mapBuy(t);if("cart"===t.el.type)return this.mapCart(t);throw new Error("[nodality] "+Ct(t.el.type,Js,"element type"))}},{key:"mapTable",value:function(t){var e,n=t.el,r=Array.isArray(n.items)&&n.items.length?n.items:[{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"}];return(new hr).add(r).set(Hs(Hs({},null!=t.el.id&&""!==t.el.id?{id:String(t.el.id)}:{}),{},{cellPadding:"0.3em",cellAlign:"center",style:{font:"Arial"},headStyle:{color:"white",background:"#c2410c"},border:"2px solid black",center:!0,borderRadius:2.2,stroke:this.filtero("blast",n.id,t.customOptions),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:null!==(e=this.filtero("transform",n.id,t.customOptions))&&void 0!==e?e:n.transform,filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions)}))}},{key:"mapRow",value:function(t){var e,n=this,r=t.el;return(new Oe).set(Hs(Hs({},this.elOpts(r,["stroke","gradient","animation","shadow","span","backgroundOp","marginOp","transform","filtera","raster"])),{},{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:null!==(e=this.filtero("transform",r.id,t.customOptions))&&void 0!==e?e:r.transform,filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions)})).items(Ls(Array.isArray(r.children)&&r.children.length?r.children.map(function(e){return n.mapType(Hs(Hs({},t),{},{el:e}))}):[new Jt("This").set({size:"S3"}),new Jt("is").set({size:"S3",text:"Hello"}),new Jt("row.").set({size:"S3",text:"Hello"})]))}},{key:"mapCode",value:function(t){var e,n=t.el;return(new Rn).set(Hs(Hs({},null!=n.id&&""!==n.id?{id:String(n.id)}:{}),{},{stroke:this.filtero("blast",n.id,t.customOptions),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:null!==(e=this.filtero("transform",n.id,t.customOptions))&&void 0!==e?e:n.transform,filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.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,s='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: "').concat(t.el.id?String(t.el.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)'),l=(new Yn).set(Hs(Hs({width:a+"px",height:a+"px",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",id:t.el.id?String(t.el.id):"#first",scale:.3},null!=r&&r.animation?{animation:{op:{name:"animation",color:"green",width:"1px",fireAt:"inview",keyframesOpen:[{transform:"rotate(360deg)",opacity:0},{transform:"rotate(0deg)",opacity:1}],keyframesClose:[{transform:"rotate(0deg)",opacity:1},{transform:"rotate(0deg)",opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}},target:["#first"]}}:{}),i.length?{raster:JSON.parse(JSON.stringify(i))}:{})),c=Array.from({length:o}).map(function(t,e){var n=e/o*Math.PI*2-Math.PI/2,r=150+300*Math.cos(n),i=150+300*Math.sin(n),a=180*n/Math.PI+90;return a=((a=(a%360+360)%360)%360+360)%360,new Jt("Hello").set({size:"S1",color:"green",font:"Arial",left:r+"px",top:i+"px",transform:{op:{name:"transform",transform:{static:!0,keep:!0,values:["tx:-50%","ty:-50%","rotate("+a+"deg)"]}}}})});return l.add(c),this.withSource(l,s)}},{key:"button",value:function(t){var e,n=t.el;return new Mi(null!==(e=n.text)&&void 0!==e?e:"Button").set(Hs(Hs({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 qo).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(Hs(Hs({},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 vi(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 un(e.url),e,t.customOptions)}},{key:"radio",value:function(t){var e,n=t.el;return(new Zi).set(Hs({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 Fr).set(Hs(Hs({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 Gi).set(Hs(Hs({type:null!==(e=n.inputType)&&void 0!==e?e:"input"},void 0!==n.title||void 0===n.label&&void 0===n.text?{}:{title:void 0!==n.label?n.label:n.text}),this.elOpts(n))),n,t.customOptions)}},{key:"filePicker",value:function(t){var e,n=t.el;return this.attachRaster((new ha).set(Hs({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 aa).set(Hs(Hs({items:Array.isArray(e.items)?e.items:[],pad:[{a:"0.5rem"}],rounded:!0},this.elOpts(e)),{},{raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"mapGridOverlay",value:function(t){for(var e=t.el,n={id:e.id,columns:e.columns,rows:e.rows,inset:e.inset,color:e.color,lineWidth:e.lineWidth,lineOpacity:e.lineOpacity,marks:e.marks,markSize:e.markSize,position:e.position,zIndex:e.zIndex,font:e.font,fontSize:e.fontSize,letterSpacing:e.letterSpacing,uppercase:e.uppercase,breakpoint:e.breakpoint,mobile:e.mobile,readouts:e.readouts,raster:this.filteroRaster(e.id,t.customOptions)},r=0,o=Object.keys(n);r<o.length;r++){var i=o[r];null==n[i]&&delete n[i]}return(new Ss).set(n)}},{key:"shop",value:function(t,e,n,r){var o=Hs({kind:t,id:e.id,font:e.font,color:e.color,keySet:e.keySet},n);r.shopFallback&&(o.fallback=!0);for(var i=0,a=Object.keys(o);i<a.length;i++){var s=a[i];null==o[s]&&delete o[s]}return(new Fs).set(o)}},{key:"mapStore",value:function(t){var e=t.el;return this.shop("store",e,{domain:e.domain,token:e.token,country:e.country,language:e.language},t)}},{key:"mapProduct",value:function(t){var e=this,n=t.el,r=this.shop("product",n,Hs(Hs({},this.elOpts(n)),{},{handle:n.handle}),t),o=Array.isArray(n.children)?n.children:[];r.add(o.map(function(n){return e.mapType(Hs(Hs({},t),{},{el:n,shopFallback:!1}))}));var i=function(t){if(!t||"object"!==Ws(t))return t;var e=Hs({},t);return e.id&&(e.id="".concat(String(e.id).replace(/^#/,""),"-static")),Array.isArray(e.children)&&(e.children=e.children.map(i)),e};return r.fallback(o.map(function(n){return e.mapType(Hs(Hs({},t),{},{el:i(n),shopFallback:!0}))})),r}},{key:"shopStyle",value:function(t){return Hs(Hs({},At(t)),{},{pad:t.pad,mar:t.mar})}},{key:"mapPrice",value:function(t){var e=t.el;return this.shop("price",e,Hs(Hs({},this.shopStyle(e)),{},{text:e.text,query:e.query}),t)}},{key:"mapProductData",value:function(t){var e=t.el;return this.shop("productData",e,Hs(Hs({},this.shopStyle(e)),{},{query:e.query,text:e.text}),t)}},{key:"mapProductMedia",value:function(t){var e=t.el;return this.shop("productMedia",e,Hs(Hs({},this.shopStyle(e)),{},{query:e.query,url:e.url,alt:e.alt,width:e.width,height:e.height}),t)}},{key:"mapVariantPicker",value:function(t){var e=t.el;return this.shop("variantPicker",e,Hs(Hs({},this.shopStyle(e)),{},{text:e.text}),t)}},{key:"mapBuy",value:function(t){var e=t.el;return this.shop("buy",e,Hs(Hs({},this.shopStyle(e)),{},{text:e.text,mode:e.mode,cart:e.cart,store:e.store,url:e.url}),t)}},{key:"mapCart",value:function(t){var e=t.el;return this.shop("cart",e,{theme:e.theme,target:e.target,discountCodes:e.discountCodes},t)}},{key:"dropdown",value:function(t){var e,n=null!==(e=t.el.label)&&void 0!==e?e:t.el.title;t.el.items||(t.el.items=["Flower","Car","Maseratti"]);var r=t.el.items.map(function(t){return(new pe).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}})}),o=(new kr).set(Hs(Hs({},void 0===n?{}:{title:n}),{},{behaviour:"click",pad:[{a:"1rem"}],mar:[{a:"1rem"}],border:"1px solid black",width:"180px",radius:"1rem"})).add([].concat(Ls(void 0!==n?[]:[new Jt(t.el.items[0]).set({font:"Arial",fluidc:"S6",weight:"bold",align:"center",cursor:"pointer",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},pad:[{l:10,r:10}]})]),[(new Yn).set({border:"1px solid green",background:"#1abc9c",radius:"0.7rem",socenter:!0}).add(void 0===n?r.slice(1):r)])),i=this.filteroRaster(t.el.id,t.customOptions);return i&&o.rasterize(i),o}},{key:"pageNav",value:function(t,e){var n,r,o,i,a,s=this,l=t.el||{},c=function(){var e,n;return l.brand&&"object"===Ws(l.brand)?s.mapType(Hs(Hs({},t),{},{el:l.brand})):new Jt(null!==(e=l.brand)&&void 0!==e?e:"Company").set(Hs({size:"S6",font:null!==(n=l.font)&&void 0!==n?n:"Helvetica"},l.color?{color:l.color}:{}))},u=function(){return e.map(function(t){return(new pe).set(Hs(Hs(Hs({text:t.title,url:t.link,pad:[{tb:8,lr:4}]},l.font?{font:l.font}:{}),l.color?{color:l.color}:{}),l.hover?{hover:l.hover}:{}))})},f=At(l),d=(f.font,f.color,f.background,f.radius,Hs(Hs(Hs(Hs(Hs({},function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(f,zs)),{},{background:null!==(n=l.background)&&void 0!==n?n:"#ecf0f1",mar:null!==(r=l.mar)&&void 0!==r?r:[{a:21}],radius:null!==(o=l.radius)&&void 0!==o?o:"1rem"},void 0!==l.pad?{pad:l.pad}:{}),void 0!==l.color?{color:l.color}:{}),void 0!==l.keySet?{keySet:l.keySet}:{}),l.brandLink?{brandLink:l.brandLink}:{})),h=void 0===l.breakpoint?"1200px":"number"==typeof l.breakpoint?"".concat(l.breakpoint,"px"):String(l.breakpoint),p=(new Po).set(Hs(Hs(Hs({},d),{},{brand:c(),hamburgerColour:null!==(i=null!==(a=l.hamburgerColour)&&void 0!==a?a:l.color)&&void 0!==i?i:"#3498db"},l.menuLabel?{menuLabel:l.menuLabel}:{}),l.id?{menuId:"".concat(String(l.id).replace(/^#/,""),"-menu")}:{})).add(u()),y=(new xo).set(Hs(Hs({},d),{},{maxHeight:"100px"})).add([c(),new Yo(!0)].concat(Ls(u())));return(new qo).set({id:l.id,breakpoints:[{at:"0px",view:p},{at:h,view:y}]})}},{key:"protoNav",value:function(t){var e,n,r=t.customOptions,o=Array.isArray(null===(e=t.el)||void 0===e?void 0:e.items)&&t.el.items.length?t.el.items.map($s):[{title:"Fire",link:"@e"},{title:"and",link:"@e"},{title:"smoke",link:"@e"}],i=Array.isArray(null===(n=t.el)||void 0===n?void 0:n.items)&&t.el.items.length?t.el.items.map($s):null,a=function(){return i.map(function(t){return(new pe).set({text:t.title,url:t.link,pad:[{tb:8,lr:4}]})})};if(i)return this.pageNav(t,i);var s=o.map(function(t,e){return new pe('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3}})}),l=o.map(function(t,e){return new pe('"'.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 c=(new kr).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black"}).add([new Jt("First").set({cursor:"pointer",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 Yn).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new pe).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 pe).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"}})])]);l.push(c),s.push(c)}t.el.animation;var u=(new qo).set({id:t.el&&t.el.id,breakpoints:[{at:"0px",view:(new Po).set({background:"#ecf0f1",mar:[{a:21}],brand:new Jt("Company").set({size:"S6",font:"Helvetica"}),hamburgerColour:"#3498db",radius:"1rem"}).add([].concat(Ls(i?a():[(new pe).set({text:"About",url:"#a"})]),[(new kr).set({behaviour:"mouseover",pad:[{a:40}],mar:[{lr:"auto"}],breakpoint:"1200px",padding:"10px",border:"1px solid black",height:"auto"}).add([new Jt("More").set({cursor:"pointer",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 Jt("Our story").set({cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Jt("Team").set({cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])],Ls(i?[]:[new pe("B").set({text:"About",url:"#b"}),new pe("C").set({text:"Contact",url:"https://www.abcnews.com"})])))},{at:"1200px",view:(new xo).set({background:"#ecf0f1",mar:[{a:21}],maxHeight:"100px",radius:"1rem"}).add([new Jt("Company").set({size:"S6",font:"Helvetica"}),new Yo(!0),(new kr).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black",radius:"30px",width:"130px"}).add([new Jt("More").set({cursor:"pointer",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 Yn).set({flexDir:"column",mar:[{t:"10px"}],radius:".3rem"}).add([new pe("").set({text:"Who we are",url:"jk",cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new pe("").set({text:"Info",url:"#u",cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new pe("").set({text:"About",url:"#u",cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])])].concat(Ls(i?a():[(new pe).set({text:"About",url:"#a"}),(new pe).set({text:"Services",url:"#a"}),(new pe).set({text:"Contact",url:"#a"})])))}]});return this.attachRaster(u,t.el,r)}},{key:"sideNav",value:function(t){t.customOptions;var e,n,r=Array.isArray(null===(e=t.el)||void 0===e?void 0:e.items)&&t.el.items.length>0,o=Array.isArray(null===(n=t.el)||void 0===n?void 0:n.items)&&t.el.items.length?t.el.items.map($s):[{title:"Home",link:"@e"},{title:"Projects",link:"@e"},{title:"Services",link:"@e"}],i=o.map(function(t,e){return new pe('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:r&&t.link||"#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}})}),a=(new kr).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 Jt("More").set({cursor:"pointer",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 Yn).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new pe).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 pe).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"}})])]),s=o.map(function(t,e){return new pe('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:r&&t.link||"#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&&(s.push(a),i.push(a));var l=(new Yn).set({column:!0}).add([new Jt("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}]})].concat(Ls((t.el.animation?s:i).slice(0,o.length).filter(Boolean)),Ls(t.el.animation&&t.el.dropdown?[s[o.length]]:[]),[new Jt("Company, 2025").set({pad:[{a:20}],animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}})])),c=(new Yn).set({column:!0}).add([new Jt("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}]})]),u=(new Je).setup({animate:!0,radius:"1rem",isSide:!0,background:"#ecf0f1",hamColour:{opened:"#0f766e",closed:"#c2410c"},mobileSize:"1.2em",fixed:!0,tags:{open:"sidebar:open",close:"sidebar:closed"}}).items(t.el.offcanvas?c:l),f=this.filteroRaster(t.el.id,t.customOptions);return f&&u.rasterize(f),u}},{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 en).set({id:null!=t.el.id&&""!==t.el.id?String(t.el.id):"#3",templateCols:r,height:"600px"}).add([new Jt("I am free").set({border:"3px solid green",font:"Arial",size:"S1",color:"#1abc9c",gpos:null!=n?n.text:null,zIndex:1}),(new oe).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,n=t.el;return(new rs).set(Hs(Hs({},null!=n.id&&""!==n.id?{id:String(n.id)}:{}),{},{diameter:108,background:"#1abc9c",stroke:this.filtero("blast",n.id,t.customOptions),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:null!==(e=this.filtero("transform",n.id,t.customOptions))&&void 0!==e?e:n.transform,filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions)}))}},{key:"mapPolygon",value:function(t){var e,n,r=t.el,o=null!==(e=t.el.sides)&&void 0!==e?e:7;return new Va({id:r.id?String(r.id):"hex"}).set(Hs(Hs({},null!=r.id&&""!==r.id?{id:String(r.id)}:{}),{},{sides:o,size:300,background:"#1abc9c",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:null!==(n=this.filtero("transform",r.id,t.customOptions))&&void 0!==n?n:r.transform,filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions)}))}},{key:"mapText",value:function(t){var e,n,r,o=t.el;return new Jt(o.text||o.value).set(Hs(Hs({},this.elOpts(o,["value","stroke","gradient","animation","shadow","span","backgroundOp","marginOp","transform","filtera","raster"])),{},{id:o.id,class:o.class,color:o.color,size:this.getElType(o.type),tag:o.tag,font:null!==(e=o.font)&&void 0!==e?e:"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),span:this.filtero("span",o.id,t.customOptions),backgroundOp:this.filtero("background",o.id,t.customOptions),marginOp:this.filtero("margin",o.id,t.customOptions),transform:null!==(n=this.filtero("transform",o.id,t.customOptions))&&void 0!==n?n:o.transform,filtera:this.filtero("filter",o.id,t.customOptions),raster:this.filteroRaster(o.id,t.customOptions),resprop:null!==(r=o.resprop)&&void 0!==r?r:null}))}},{key:"mapImage",value:function(t){var e=t.el;return new oe(e.url).set(Hs(Hs({},this.elOpts(e)),{},{url:e.url,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,n,r,o=t.customOptions.filter(function(t){return"link-style"===t.op.name}),i=t.el;return t.el.id&&(i.id=t.el.id),t.el.link&&t.el.text&&(i.url=t.el.link,i.text=t.el.text),i.animation=this.filtero("animation",t.el.id,t.customOptions),i.class=t.el.class,i.width=t.el.width,i.font=null!==(e=t.el.font)&&void 0!==e?e:"Arial",i.fluidc=t.el.fluidc,i.transform=null!==(n=this.filtero("transform",t.el.id,t.customOptions))&&void 0!==n?n:t.el.transform,i.shadow=this.filtero("shadow",t.el.id,t.customOptions),i.gradient=this.filtero("gradient",t.el.id,t.customOptions),i.blast=this.filtero("blast",t.el.id,t.customOptions),i.backgroundOp=this.filtero("background",t.el.id,t.customOptions),i.raster=this.filteroRaster(t.el.id,t.customOptions),i.pad=null!==(r=t.el.pad)&&void 0!==r?r:[{a:10}],o.length>0?Ca.style({el:t.el,re:i,bst:o,options:t.customOptions})[o.length-1]:(new pe).set(i)}},{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 // #c2410c is 5.18:1 on white; h2 keeps the outline intact.\n new Text(item.title).set({ size: "S5", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#1d6fe0", \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", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#1d6fe0", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white"\n })\n ])':c,f=Object.entries(this.elOpts(t.el,["backgroundCard","gradient","animation","shadow","marginOp","filtera","blast","raster"])).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)||Ns(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",\n ".concat(JSON.stringify(n),": ").concat(JSON.stringify(r))}).join(""),d=this.gridItemsBuild(t,u),h=' new FlexGrid()\n .set({\n colat: "700px",\n wrap: true,\n align: "center",\n gap: "1rem"'.concat(f,"\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 ").concat(d.src,"\n )\n "),p=function(t){return JSON.parse(JSON.stringify(t))},y=p(this.elOpts(t.el,["backgroundCard","gradient","animation","shadow","marginOp","filtera","blast","raster"])),m=(new io).set(Hs(Hs(Hs({colat:"700px",wrap:!0,align:"center",gap:"1rem"},y),this.gridOps({gradient:n,animation:r,shadow:o,marginOp:i,filtera:a,blast:l})),void 0!==s?{raster:p(s)}:{}));return m.items(d.cards()),this.withSource(m,h)}},{key:"gridOps",value:function(t){for(var e={},n=0,r=["gradient","animation","shadow","marginOp","filtera","blast"];n<r.length;n++){var o=r[n];void 0!==t[o]&&(e[o]=JSON.parse(JSON.stringify(t[o])))}return e}},{key:"withSource",value:function(t,e){return t.toCode=function(){return[e]},t}},{key:"gridItemsBuild",value:function(t,e){var n=this,r=t.el.items,o=!!t.el.backgroundCard,i=t.el,a={gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),marginOp:this.filtero("margin",i.id,t.customOptions),filtera:this.filtero("filter",i.id,t.customOptions),blast:this.filtero("blast",i.id,t.customOptions)},s={width:"300px",height:"700px",radius:"0.7rem",mar:{sides:["all"],value:"0.8rem"}},l={background:"#1d6fe0",pad:[{lr:"0.5rem",tb:"1rem"}],radius:"0.4rem",color:"white"},c=function(t,e){return o?(new ho).set({url:t.img,font:"Arial",mar:{sides:["all"],value:"0.8rem"},inpad:"1rem",useBrightness:!0}).items([new Jt(t.title).set({fluidc:"S6",tag:"h2",color:"#c2410c"}),new pe("Link").set(Hs({text:t.title,url:t.link},l))]):(new Hr).set(Hs(Hs({},s),n.gridOps(a))).items([new oe(t.img).set(e?{isFull:!0,url:t.img,alt:t.alt}:{isFull:!0,url:t.img}),new Jt(t.title).set({size:"S5",tag:"h2",color:"#c2410c"}),new pe("Link").set(Hs(Hs({text:t.title,url:t.link},l),{},{mar:[{a:21}]}))])};if(!Array.isArray(r)||0===r.length){var u=[{img:"https://upload.wikimedia.org/wikipedia/commons/3/3a/Starship_S20.jpg",title:"Starship",link:"#ship"},{img:"https://upload.wikimedia.org/wikipedia/commons/1/16/Apollo_11_Launch_-_GPN-2000-000630.jpg",title:"Saturn V",link:"#saturn"},{img:"https://upload.wikimedia.org/wikipedia/commons/d/d6/STS120LaunchHiRes-edit1.jpg",title:"Shuttle",link:"#shuttle"}];return{src:this.gridItemsSource(t,e),cards:function(){return u.map(function(t){return c(t,!1)})}}}var f=function(t){return Array.isArray(t)},d=r.filter(function(t){return!f(t)});if(!r.some(f)){var h=d.some(function(t){return t&&void 0!==t.alt}),p=JSON.parse(JSON.stringify(d));return{src:this.gridItemsSource(t,e),cards:function(){return p.map(function(t){return c(t,h)})}}}var y=r.map(function(e){return f(e)?e.map(function(e){return n.mapType(Hs(Hs({},t),{},{el:e}))}):null}),m=function(t){return("string"==typeof t?t:[].concat(t&&t.toCode?t.toCode():[]).join("")).trim()},v=r.map(function(t,e){return f(t)?'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n '.concat(y[e].map(m).filter(Boolean).join(",\n "),"\n ])"):n.cardFromShorthand(t)}),b=function(t){return JSON.parse(JSON.stringify(null!=t?t:""))};return{src:"[\n ".concat(v.join(",\n "),"\n ]"),cards:function(){return r.map(function(t,e){return f(t)?(new Hr).set(Hs({},s)).items(y[e].filter(function(t){return t&&"object"===Ws(t)})):(new Hr).set(Hs({},s)).items([new oe(b(t.img)).set(void 0===t.alt?{isFull:!0,url:b(t.img)}:{isFull:!0,url:b(t.img),alt:b(t.alt)}),new Jt(b(t.title)).set({size:"S5",tag:"h2",color:"#c2410c"}),new pe("Link").set(Hs({text:b(t.title),url:b(t.link)},l))])})}}}},{key:"gridItemsSource",value:function(t,e){var n=this,r=t.el.items;if(!Array.isArray(r)||0===r.length)return'[\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(e,"\n )");var o,i=function(t){return Array.isArray(t)},a=r.filter(function(t){return!i(t)});if(0===r.filter(i).length)return"".concat(JSON.stringify(a,null,2).split("\n").map(function(t,e){return 0===e?t:" "+t}).join("\n"),".map(item => \n ").concat((o=e,a.some(function(t){return t&&void 0!==t.alt})?o.replace("url: item.img}","url: item.img, alt: item.alt}"):o),"\n )");var s=r.map(function(e){return i(e)?n.cardFromSpecs(t,e):n.cardFromShorthand(e)});return"[\n ".concat(s.join(",\n "),"\n ]")}},{key:"cardFromSpecs",value:function(t,e){var n=this,r=e.map(function(e){var r=n.mapType(Hs(Hs({},t),{},{el:e}));return"string"==typeof r?r.trim():(r&&"function"==typeof r.toCode?[].concat(r.toCode()).join(""):"").trim()}).filter(Boolean);return'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n '.concat(r.join(",\n "),"\n ])")}},{key:"cardFromShorthand",value:function(t){var e=function(t){return JSON.stringify(null!=t?t:"")};return'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n new Image('.concat(e(t.img),").set({isFull: true, url: ").concat(e(t.img)).concat(void 0===t.alt?"":", alt: ".concat(e(t.alt)),"}),\n new Text(").concat(e(t.title),').set({ size: "S5", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({ text: ').concat(e(t.title),", url: ").concat(e(t.link),', background: "#1d6fe0", pad: [{ lr: "0.5rem", tb: "1rem" }], radius: "0.4rem", color: "white" })\n ])')}},{key:"checkbox",value:function(t){var e=t.el,n="string"==typeof e.label?new Jt(e.label).set({size:"S6"}):e.label;return this.attachRaster((new oi).set(Hs(Hs({},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 Nn).set(this.elOpts(n)),o=Array.isArray(n.children)?n.children:null;return o&&r.add(o.map(function(n){return e.mapType(Hs(Hs({},t),{},{el:n}))})),this.attachRaster(r,n,t.customOptions)}},{key:"form",value:function(t){var e,n=this,r=t.el,o=(new Ea).set(Hs(Hs(Hs({action:null!==(e=r.action)&&void 0!==e?e:""},void 0!==r.method?{method:r.method}:{}),void 0!==r.id?{id:r.id}:{}),void 0!==r.title?{title:r.title}:{})),i=Array.isArray(r.children)?r.children:null;return i&&o.add(i.map(function(e){return n.mapType(Hs(Hs({},t),{},{el:e}))})),o}},{key:"simple",value:function(t){var e,n,r,o,i=this,a=t.el,s=Array.isArray(a.react)?a.react:[];if(!s.length)throw new Error('[nodality] a "simple" element needs a non-empty `react` array of { at, template }.');var l=(Array.isArray(a.children)?a.children:[]).map(function(e){return i.mapType(Hs(Hs({},t),{},{el:e}))}),c=l.map(function(t){var e=t.toCode();return Array.isArray(e)?e.join(""):String(e)}).join(",\n "),u="new AreaSwitcher()\n .set(".concat(JSON.stringify(Hs({gap:null!==(e=a.gap)&&void 0!==e?e:"10px",height:null!==(n=a.height)&&void 0!==n?n:"700px"},void 0!==a.id?{id:a.id}:{})),")\n .react(").concat(JSON.stringify(s,null,2),")\n .add([\n ").concat(c,"\n ])"),f=(new za).set(Hs({gap:null!==(r=a.gap)&&void 0!==r?r:"10px",height:null!==(o=a.height)&&void 0!==o?o:"700px"},void 0!==a.id?{id:a.id}:{})).react(JSON.parse(JSON.stringify(s)));return f.add(l),this.withSource(f,u)}},{key:"mapWrap",value:function(t){var e,n,r,o=this,i=t.el,a=null!==(e=t.el.kind)&&void 0!==e?e:"",s=new Yn(a).set(Hs(Hs({},this.elOpts(i)),{},{font:null!==(n=i.font)&&void 0!==n?n:"Arial",stroke:this.filtero("blast",i.id,t.customOptions),gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),transform:null!==(r=this.filtero("transform",i.id,t.customOptions))&&void 0!==r?r:i.transform,filtera:this.filtero("filter",i.id,t.customOptions),raster:this.filteroRaster(i.id,t.customOptions)})),l=Array.isArray(i.children)?i.children:null;return l&&s.add(l.map(function(e){return o.mapType(Hs(Hs({},t),{},{el:e}))})),s}},{key:"mapUList",value:function(t){var e,n,r,o=this,i=t.el,a=null!==(e=t.el.kind)&&void 0!==e?e:"",s=new _i(a).set(Hs(Hs({},this.elOpts(i)),{},{font:null!==(n=i.font)&&void 0!==n?n:"Arial",stroke:this.filtero("blast",i.id,t.customOptions),gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),transform:null!==(r=this.filtero("transform",i.id,t.customOptions))&&void 0!==r?r:i.transform,filtera:this.filtero("filter",i.id,t.customOptions),raster:this.filteroRaster(i.id,t.customOptions)})),l=Array.isArray(i.items)?i.items:null;return l&&s.setItems(l.map(function(e){return"string"==typeof e?new Jt(e).set({}):o.mapType(Hs(Hs({},t),{},{el:e}))})),s}},{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.some(function(t){return Vs(t,e)})})[0]}},{key:"elOpts",value:function(t){for(var e=new Set(["type","children","items","breakpoints","inputType","text","url"].concat(Ls(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]))),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];e.has(i)||(n[i]=t[i])}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&&w.includes(e.op)&&(!e.target||t&&e.target.some(function(e){return Vs(e,t)}))});return n.length>0?n:void 0}}],null&&qs(t.prototype,null),e&&qs(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),Ks={"t-vhs":{summary:"Tape-glitch morph: chroma splits and the image tears, strongest at the midpoint, gone at both ends.",nodes:[{op:"aberration",amount:[0,18,0]},{op:"flow",strength:[0,34,0],scale:60,speed:0,window:[.15,.95],ease:"in-out"}]},"t-dissolve":{summary:"Ordered-dither dissolve — the old state breaks into pixels before the new one resolves.",nodes:[{op:"dither",levels:[8,2,8],size:[1,7,1],amount:[0,1,0],ease:"in-out"}]},"t-split":{summary:"Per-side morph: the old state posterises to duotone while the new one resolves through a halftone screen.",nodes:[{op:"duotone",side:"old",amount:[0,1,1],dark:"#0B1B2B",light:"#1abc9c"},{op:"halftone",side:"new",size:[10,6,2],amount:[1,1,0],softness:.35,angle:15}]},"t-bloom":{summary:"A soft halftone bloom through the middle of the morph.",nodes:[{op:"halftone",size:[2,9,2],amount:[0,1,0],softness:.4,angle:15,window:[.1,.9]}]},"t-fluid":{summary:"Liquid morph: the old state is carried on a current and pours into the new one, calm at both ends.",nodes:[{op:"flow",strength:[0,46,0],scale:130,speed:.8,ease:"in-out"},{op:"aberration",amount:[0,4,0],window:[.2,.8]}]},"t-particles":{summary:"Particle morph: the old state breaks into dots that scatter and re-form as the new one, with see-through gaps in between.",nodes:[{op:"particles",size:9,amount:[0,1,1,0],reach:5,ease:"in-out"}]},"liquid-hero":{summary:"A ripple that trails the pointer, then relaxes back in ~1.5s.",live:"enhanced",nodes:[{op:"stir",by:"mouse",radius:.055,force:2.2,strength:16,curl:.8,resolution:256,decay:.988}]},linger:{summary:"The same current, held for four or five seconds. Only `decay` differs.",live:"enhanced",nodes:[{op:"stir",by:"mouse",radius:.055,force:2.2,strength:7,curl:.8,resolution:256,decay:.9985,dye:0,sheen:0}]},"flow-field":{summary:"A standing current across the whole element. No solver, runs anywhere.",nodes:[{op:"flow",strength:18,scale:120,speed:.25}]},"flow-pointer":{summary:"The same current, but only around the pointer.",nodes:[{op:"flow",by:"mouse",strength:26,scale:100,radius:320}]},"print-shop":{summary:"Offset-litho dot screen with white seams under the glyphs.",nodes:[{op:"halftone",size:6,angle:15},{op:"edges",color:"#FFFFFF"}]},newsprint:{summary:"One-bit ordered dither — ink on paper, no greys.",nodes:[{op:"dither",mono:!0,ink:"#0B1B2B"}]},crt:{summary:"Posterised to a few levels, with a lens-like colour split.",nodes:[{op:"dither",levels:3},{op:"aberration",amount:6}]},glass:{summary:"Refractive metaball lens over untouched content.",nodes:[{op:"blobs",refract:70,dispersion:1,frost:.25}]},"hex-lens":{summary:"Hex cells rise toward the pointer; flush and invisible at rest.",nodes:[{op:"hexalize",size:26,lift:.3,by:"hover",radius:220}]},ripple:{summary:"The coordinate space pushes away from the pointer.",nodes:[{op:"offset",by:"mouse",strength:22,radius:280}]},spotlight:{summary:"A duotone disc that travels with the pointer; the rest is untouched.",nodes:[{op:"mask",from:"radial",as:"spot",by:"mouse",radius:200},{op:"duotone",masked:"spot",colors:["#104B87","#E8FF00"]}]},turbulent:{summary:"Animated noise drives the displacement, so the warp breathes.",nodes:[{op:"noise",as:"turbulence",scale:3,speed:.4},{op:"offset",masked:"turbulence",by:"static",strength:30}]},echoes:{summary:"Changing content leaves a fading trail behind it.",live:"required",nodes:[{op:"echo",decay:.92,strength:.85}]},comet:{summary:"A long, tinted comet tail. Needs live capture — on snapshot you see nothing move.",live:"required",nodes:[{op:"echo",decay:.975,strength:.95,tint:"#7FD4FF",tintAmount:.65}]}};function Zs(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Ks[t];if(!r)throw new Error("[nodality] "+Ct(t,Object.keys(Ks),"raster preset"));return(e=r.nodes,JSON.parse(JSON.stringify(e))).map(function(t){return Object.assign(t,n)})}var tl={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}};function el(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"function"!=typeof t.setProgress){var n=0;t={setProgress:function(t){return n=Math.min(1,Math.max(0,Number(t)||0))},get progress(){return n}}}var r=null!=e.duration?e.duration:600,o=tl[e.easing]||tl["in-out"],i=!1!==e.respectReducedMotion,a=0,s=t.progress||0,l=s,c=0,u=0,f=0,d=0,h=!1,p=null,y=null,m=!1,v=function(){if(!m){var e="undefined"!=typeof performance?performance.now():Date.now();c||(c=e,u=e),f+=Math.min(e-u,Math.max(d/6,50)),u=e;var n=d<=0?1:Math.min(1,f/d);if(t.setProgress(s+(l-s)*o(n)),n>=1)return function(){h=!1,a=0;var e=p;p=null,e&&e(t.progress)}();a=requestAnimationFrame(v)}},b={get value(){return t.progress},get running(){return h},set:function(e){return b.stop(),t.setProgress(e),t.progress},to:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(m)return Promise.resolve(t.progress);var o=Math.min(1,Math.max(0,Number(e)||0));if(i&&"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return b.set(o),Promise.resolve(o);if(p){var u=p;p=null,u(t.progress)}a&&cancelAnimationFrame(a),s=t.progress,l=o;var y=Math.abs(l-s);return y<1e-4?(t.setProgress(o),Promise.resolve(o)):(d=(null!=n.duration?n.duration:r)*y,c=0,f=0,h=!0,a=requestAnimationFrame(v),new Promise(function(t){p=t}))},stop:function(){if(a&&cancelAnimationFrame(a),a=0,h=!1,p){var e=p;p=null,e(t.progress)}return t.progress},bindScroll:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="string"==typeof e?document.querySelector(e):e;if(!r)return b;b.unbindScroll(),b.stop();var o=null!=n.start?n.start:0,i=null!=n.end?n.end:1,a=function(){if(!m){var e=r.getBoundingClientRect(),n=window.innerHeight||1,a=(n-e.top)/(n+e.height||1),s=(Math.min(1,Math.max(0,a))-o)/(i-o||1);t.setProgress(Math.min(1,Math.max(0,s)))}};return y={node:r,update:a},window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),a(),b},unbindScroll:function(){return y?(window.removeEventListener("scroll",y.update),window.removeEventListener("resize",y.update),y=null,b):b},drive:function(t){return b.set(t)},destroy:function(){m=!0,b.stop(),b.unbindScroll()}};return b}function nl(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return rl(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,s=0,l=t,d.n=n,a}};function h(n,r){for(s=n,l=r,e=0;!f&&c&&!o&&e<u.length;e++){var o,i=u[e],h=d.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),s=u,l=p;(e=s<2?t:l)||!f;){i||(s?s<3?(s>1&&(d.n=-1),h(s,l)):d.n=l:d.v=l);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=d.n<0)?l:n.call(r,d))!==a)break}catch(e){i=t,s=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(rl(e={},r,function(){return this}),e),f=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,rl(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,rl(f,"constructor",c),rl(c,"constructor",l),l.displayName="GeneratorFunction",rl(c,o,"GeneratorFunction"),rl(f),rl(f,o,"Generator"),rl(f,r,function(){return this}),rl(f,"toString",function(){return"[object Generator]"}),(nl=function(){return{w:i,m:d}})()}function rl(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}rl=function(t,e,n,r){if(e)o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n;else{var i=function(e,n){rl(t,e,function(t){return this._invoke(e,n,t)})};i("next",0),i("throw",1),i("return",2)}},rl(t,e,n,r)}function ol(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=sl(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 il(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)||sl(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 al(t){return function(t){if(Array.isArray(t))return ll(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||sl(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 sl(t,e){if(t){if("string"==typeof t)return ll(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)?ll(t,e):void 0}}function ll(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 cl(t){return cl="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},cl(t)}function ul(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function fl(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){ul(i,r,o,a,s,"next",t)}function s(t){ul(i,r,o,a,s,"throw",t)}a(void 0)})}}var dl=function(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:r.x-n.x,y:r.y-n.y,w:r.width,h:r.height}};function hl(t,e,n){return pl.apply(this,arguments)}function pl(){return pl=fl(nl().m(function t(e,n,r){var o,i,a,s,l,c,u,f,d,h,p=arguments;return nl().w(function(t){for(;;)switch(t.n){case 0:for(o=p.length>3&&void 0!==p[3]?p[3]:1,(i=e.cloneNode(!0)).style.position="static",i.style.left=i.style.top="0",i.style.margin="0",i.style.visibility="visible",a=[e].concat(al(e.querySelectorAll("*"))),s=[i].concat(al(i.querySelectorAll("*"))),l=0;l<a.length;l++)c=getComputedStyle(a[l]),s[l].style.fontSize=c.fontSize,s[l].style.lineHeight=c.lineHeight,s[l].style.fontWeight=c.fontWeight,s[l].style.fontFamily=c.fontFamily,s[l].style.letterSpacing=c.letterSpacing,s[l].style.width=c.width,s[l].style.height=c.height,s[l].style.padding=c.padding,s[l].style.boxSizing=c.boxSizing,l>0&&(s[l].style.margin=c.margin),s[l].style.color=c.color,s[l].style.backgroundColor=c.backgroundColor,s[l].style.backgroundImage=c.backgroundImage,s[l].style.borderStyle=c.borderStyle,s[l].style.borderWidth=c.borderWidth,s[l].style.borderColor=c.borderColor,s[l].style.borderRadius=c.borderRadius,s[l].style.boxShadow=c.boxShadow;return u=Math.max(1,Math.min("undefined"!=typeof window&&window.devicePixelRatio||1,3)),f=Math.max(1,Math.min(u*Math.max(1,o||1),4096/Math.max(n,r,1))),d='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(n*f,'" ')+'height="'.concat(r*f,'" viewBox="0 0 ').concat(n," ").concat(r,'">')+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+(new XMLSerializer).serializeToString(i)+"</div></foreignObject></svg>",h=document.createElement("img"),t.n=1,new Promise(function(t,e){h.onload=t,h.onerror=e,h.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(d)});case 1:return t.a(2,h)}},t)})),pl.apply(this,arguments)}var yl=function(t){if(!t)return[];if(Array.isArray(t))return t;try{return Zs(t)||[]}catch(t){return[]}},ml=function(t){return String(t||"").replace(/\s+/g," ").trim().toLowerCase()},vl=function(t){return"string"==typeof t&&t.startsWith("#")?t.slice(1):t},bl=function(t){return(Array.isArray(t.chain)&&t.chain.length?t.chain:[{from:t.from,to:t.to}]).map(function(e){var n=function(n,r){return void 0!==e[n]?e[n]:void 0!==t[n]?t[n]:r},r=e.to&&!Array.isArray(e.to)&&"object"===cl(e.to)?e.to:null,o=r?al(new Set(Object.values(e.to))).map(vl):(Array.isArray(e.to)?e.to:[e.to]).map(vl),i=new Map;if(r)for(var a=0,s=Object.entries(e.to);a<s.length;a++){var l=il(s[a],2),c=l[0],u=l[1];i.set(ml(c),vl(u))}return{from:vl(e.from),byLabel:r,toIds:o,labelToId:i,effect:n("effect"),duration:n("duration",900),back:!1!==n("back",!0),live:!0===n("live"),fade:n("fade","morph")}})};function gl(t,e,n){if(!t||"undefined"==typeof document)return[];var r=(n||[]).filter(function(t){return t&&"morph"===t.op});if(!r.length)return[];var o=al(t.children),i=function(n){var r=vl(n),i=document.getElementById(r);if(i&&t.contains(i))return i;var a=(e||[]).findIndex(function(t){return t&&vl(t.id)===r});return a>=0?o[a]:null};return r.map(function(e){return function(t,e,n){var r=bl(e),o=r[0],i=o&&o.from,a=null!=i?n(i):null,s=new Map;a&&s.set(i,a);var l,c=ol(r);try{for(c.s();!(l=c.n()).done;){var u=l.value,f=n(u.from);f&&!s.has(u.from)&&s.set(u.from,f);var d,h=ol(u.toIds);try{for(h.s();!(d=h.n()).done;){var p=d.value,y=n(p);y&&!s.has(p)&&s.set(p,y)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){c.e(t)}finally{c.f()}if(!a||!o.toIds.some(function(t){return s.has(t)}))return console.warn("[nodality] morph: could not resolve",i,"->",o?o.toIds:[]),null;var m=function(t){return r.find(function(e){return e.from===t})||null},v=document.createElement("div");v.className="nod-morph",v.style.cssText="position:relative;",t.insertBefore(v,a);var b=document.createElement("div");b.className="nod-morph-host",b.style.cssText="position:absolute;inset:0;";var g=document.createElement("div");g.className="nod-morph-live",g.style.cssText="position:absolute;inset:0;",v.appendChild(b),v.appendChild(g),g.appendChild(a),a.style.position="absolute",a.style.left=a.style.top="0";var w,x=ol(s);try{for(x.s();!(w=x.n()).done;){var k=il(w.value,2),S=k[0],O=k[1];S!==i&&O.remove()}}catch(t){x.e(t)}finally{x.f()}var j=i,E=[],_=function(){return s.get(j)||a},A=function(t){v.style.minHeight=Math.max(_().getBoundingClientRect().height,t||0)+24+"px"};A(0);var T=null,C=null,P=-1,R=null,I=null,M=null,D=!1,F=null,z=null,L=r.length>1,N=function(){var t=fl(nl().m(function t(e,n,r){var o,i,a,s,l,c,u;return nl().w(function(t){for(;;)switch(t.n){case 0:if(!(o=al(n.querySelectorAll("img"))).length){t.n=2;break}return t.n=1,Promise.all(o.map(function(t){return t.complete&&t.naturalWidth?null:"function"==typeof t.decode?t.decode().catch(function(){}):new Promise(function(e){t.addEventListener("load",e,{once:!0}),t.addEventListener("error",e,{once:!0})})}));case 1:return t.n=2,new Promise(function(t){return requestAnimationFrame(t)});case 2:return i=dl(b,e),a=dl(b,n),A(Math.max(i.y+i.h,a.y+a.h)),t.n=3,Promise.all([hl(e,i.w,i.h),hl(n,a.w,a.h)]);case 3:s=t.v,l=il(s,2),c=l[0],u=l[1],T=ht(b,yl(r.effect),{transition:{oldImage:c,newImage:u,oldRect:i,oldTo:a,newRect:a,newFrom:i,standDownAtStart:!0,live:!0===r.live,fade:r.fade||"morph"}}),C&&C.destroy(),C=el(T,{duration:null!=r.duration?r.duration:900});case 4:return t.a(2)}},t)}));return function(e,n,r){return t.apply(this,arguments)}}(),B=function(){var t=fl(nl().m(function t(e){var n,r,o,i,a,l,c,u,f,d;return nl().w(function(t){for(;;)switch(t.n){case 0:if((n=m(j))&&n.toIds.includes(e)){t.n=1;break}return t.a(2);case 1:if(r=s.get(e)){t.n=2;break}return t.a(2);case 2:o=_(),P=n.toIds.indexOf(e),M=j,i=ol(ut());try{for(i.s();!(a=i.n()).done;)l=a.value,v.contains(l.canvas)&&l.destroy()}catch(t){i.e(t)}finally{i.f()}for(c=0,u=al(b.children);c<u.length;c++)(f=u[c])!==o&&f.remove();return b.appendChild(r),I=o,R=r,r.style.visibility="hidden",d=dl(b,o),Object.assign(r.style,{position:"absolute",left:"0",top:Math.round(L?d.y:d.h+20)+"px"}),t.n=3,N(o,r,n);case 3:if(C){t.n=4;break}return t.a(2);case 4:return F=M,z=e,C.set(0),Y(e),n.back&&V(r),t.n=5,C.to(1);case 5:1===t.v&&R===r&&J(e,o,n);case 6:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),W=!1,q=0,U=function(){var t=fl(nl().m(function t(){var e,n,r;return nl().w(function(t){for(;;)switch(t.n){case 0:if(E.length){t.n=1;break}return t.a(2);case 1:if(e=E[E.length-1],n=s.get(e)){t.n=2;break}return t.a(2);case 2:if(r=_(),!T||!C||F!==e||z!==j){t.n=4;break}return t.n=3,C.to(0);case 3:return 0===t.v&&X(e),t.a(2);case 4:return t.n=5,G(e,n,r);case 5:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}(),H=function(){var t=fl(nl().m(function t(){return nl().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!W){t.n=1;break}return q++,t.a(2);case 1:return W=!0,t.p=2,t.n=3,U();case 3:if(!(q>0&&E.length)){t.n=5;break}return q--,t.n=4,U();case 4:t.n=3;break;case 5:return t.p=5,W=!1,q=0,t.f(5);case 6:return t.a(2)}},t,null,[[2,,5,6]])}));return function(){return t.apply(this,arguments)}}(),G=function(){var t=fl(nl().m(function t(e,n,r){var o,i,s,l,c;return nl().w(function(t){for(;;)switch(t.n){case 0:return o=al(ut()).filter(function(t){return v.contains(t.canvas)}),i=m(e)||{},n===a?(D=!0,g.style.display=""):n.parentNode!==b&&(n.style.visibility="hidden",b.appendChild(n),s=dl(b,r),Object.assign(n.style,{position:"absolute",left:"0",top:Math.round(L?s.y:0)+"px"})),t.n=1,N(n,r,i);case 1:l=ol(o);try{for(l.s();!(c=l.n()).done;)c.value.destroy()}catch(t){l.e(t)}finally{l.f()}if(D=!1,C){t.n=2;break}return t.a(2);case 2:return F=e,z=j,I=n,R=r,C.set(1),t.n=3,C.to(0);case 3:0===t.v&&X(e);case 4:return t.a(2)}},t)}));return function(e,n,r){return t.apply(this,arguments)}}(),X=function(t){E[E.length-1]===t&&E.pop(),j=t;var e,n=ol(ut());try{for(n.s();!(e=n.n()).done;){var r=e.value;v.contains(r.canvas)&&r.destroy()}}catch(t){n.e(t)}finally{n.f()}T=null,C=null,F=null,z=null,M=E.length?E[E.length-1]:null,Y(t)},J=function(t,e,n){null!=M&&M!==t&&E.push(M),j=t,I=e&&e!==a?e:null,Y(t),n&&n.back&&V(s.get(t))},V=function(t){if(t){var e=al(t.querySelectorAll("button")).find(function(t){return!t.dataset.nodMorphWired&&!t.dataset.nodMorphBack&&!t.closest("form")});e&&(e.dataset.nodMorphBack="1",e.addEventListener("click",function(){H()}))}},$=new Set,Y=function(t){var e=m(t),n=s.get(t);if(e&&n){var r=function(t){var e=al(t.querySelectorAll("a"));if(e.length)return e;var n=al(t.querySelectorAll("button, [role=button]"));return n.length?n:[t]}(n),o=!!e.byLabel&&r.some(function(t){return e.labelToId.has(ml(t.textContent))});r.forEach(function(t){return function(t,e,n,r){if(!t.dataset.nodMorphWired&&!t.dataset.nodMorphBack){var o=r?e.labelToId.get(ml(t.textContent)):1===e.toIds.length?e.toIds[0]:e.byLabel?e.labelToId.get(ml(t.textContent)):e.toIds[n.indexOf(t)];o&&s.has(o)&&(t.dataset.nodMorphWired="1",t.dataset.nodMorphTo=o,t.addEventListener("click",function(t){s.has(o)&&(t.preventDefault(),B(o))}))}}(t,e,r,o)}),"undefined"==typeof MutationObserver||$.has(t)||($.add(t),new MutationObserver(function(){return Y(t)}).observe(n,{childList:!0,subtree:!0}))}};Y(i);var Q=function(){if(v.isConnected){var t=T?T.progress:0,e=b.querySelector("canvas"),n=!!e&&"visible"===(e.style.visibility||"visible"),r=!T||!n,o=D||r&&t<=0&&(j===i||I===a)?"":"none";g.style.display!==o&&(g.style.display=o);var s=R||b.firstElementChild;if(s&&s.style){var l=T&&r&&t>=1?"":"hidden";s.style.visibility!==l&&(s.style.visibility=l)}if(I&&I!==a&&I.style){var c=r&&t<=0?"":"hidden";I.style.visibility!==c&&(I.style.visibility=c)}requestAnimationFrame(Q)}};return requestAnimationFrame(Q),{stage:v,from:a,get destinations(){return o.toIds.map(function(t){return s.get(t)||null})},get states(){return s},get current(){return j},get history(){return[].concat(E)},get progress(){return T?T.progress:0},get active(){return P},goTo:function(t){var e=m(j);return e?B(e.toIds[t]):void 0},goToState:B,back:function(){C&&C.to(0)},goBack:H,destroy:function(){C&&C.destroy();var t,e=ol(ut());try{for(e.s();!(t=e.n()).done;){var n=t.value;v.contains(n.canvas)&&n.destroy()}}catch(t){e.e(t)}finally{e.f()}v.remove()}}}(t,e,i)}).filter(Boolean)}var wl=["kind","formId","productId"];function xl(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)||Cl(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 kl(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 Sl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?kl(Object(n),!0).forEach(function(e){Ol(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Ol(t,e,n){return(e=function(t){var e=function(t){if("object"!=Rl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jl(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(Rl(t)+" is not iterable")}function El(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return _l(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,s=0,l=t,d.n=n,a}};function h(n,r){for(s=n,l=r,e=0;!f&&c&&!o&&e<u.length;e++){var o,i=u[e],h=d.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),s=u,l=p;(e=s<2?t:l)||!f;){i||(s?s<3?(s>1&&(d.n=-1),h(s,l)):d.n=l:d.v=l);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=d.n<0)?l:n.call(r,d))!==a)break}catch(e){i=t,s=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(_l(e={},r,function(){return this}),e),f=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,_l(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,_l(f,"constructor",c),_l(c,"constructor",l),l.displayName="GeneratorFunction",_l(c,o,"GeneratorFunction"),_l(f),_l(f,o,"Generator"),_l(f,r,function(){return this}),_l(f,"toString",function(){return"[object Generator]"}),(El=function(){return{w:i,m:d}})()}function _l(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}_l=function(t,e,n,r){if(e)o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n;else{var i=function(e,n){_l(t,e,function(t){return this._invoke(e,n,t)})};i("next",0),i("throw",1),i("return",2)}},_l(t,e,n,r)}var Al=El().m(Fl);function Tl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Cl(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 Cl(t,e){if(t){if("string"==typeof t)return Pl(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)?Pl(t,e):void 0}}function Pl(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 Rl(t){return Rl="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},Rl(t)}var Il=new Set(["input","labelInput","checkbox","radio","picker"]),Ml={text:{type:"string"},email:{type:"string",format:"email"},tel:{type:"string"},url:{type:"string",format:"uri"},number:{type:"number"},password:{type:"string"},date:{type:"string",format:"date"},time:{type:"string",format:"time"},search:{type:"string"}},Dl=function(t){return!!t&&"object"===Rl(t)};function Fl(t){var e,n,r,o,i;return El().w(function(a){for(;;)switch(a.p=a.n){case 0:if(Dl(t)){a.n=1;break}return a.a(2);case 1:return a.n=2,t;case 2:e=Array.isArray(t.children)?t.children:[],n=Tl(e),a.p=3,n.s();case 4:if((r=n.n()).done){a.n=6;break}return o=r.value,a.d(jl(Fl(o)),5);case 5:a.n=4;break;case 6:a.n=8;break;case 7:a.p=7,i=a.v,n.e(i);case 8:return a.p=8,n.f(),a.f(8);case 9:return a.a(2)}},Al,null,[[3,7,8,9]])}function zl(t){var e,n="string"==typeof t.name?t.name:t.id;if("string"!=typeof n||!n)return null;if("checkbox"===t.type)e={type:"boolean"};else if("radio"===t.type||"picker"===t.type){var r=Array.isArray(t.items)?t.items.filter(function(t){return"string"==typeof t}):[];e=r.length?{type:"string",enum:r}:{type:"string"},"radio"===t.type&&!0===t.multiple&&(e={type:"array",items:e})}else e=Sl({},Ml[t.inputType]||Ml.text);var o=[t.label,t.placeholder,t.title].find(function(t){return"string"==typeof t&&t.trim()});return o&&(e.description=o.trim()),{key:n,schema:e,required:!0===t.required}}function Ll(t){return t.routes.map(function(t){var e=t.to.map(function(t){return t.label?"".concat(t.label," → ").concat(t.to):t.to}).join(", ");return"from ".concat(t.from,": ").concat(e)}).join("; ")}function Nl(t){return Nl="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},Nl(t)}function Bl(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(Nl(t)+" is not iterable")}function Wl(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)||Ql(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 ql(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Ul(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,s=0,l=t,d.n=n,a}};function h(n,r){for(s=n,l=r,e=0;!f&&c&&!o&&e<u.length;e++){var o,i=u[e],h=d.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),s=u,l=p;(e=s<2?t:l)||!f;){i||(s?s<3?(s>1&&(d.n=-1),h(s,l)):d.n=l:d.v=l);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=d.n<0)?l:n.call(r,d))!==a)break}catch(e){i=t,s=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(Ul(e={},r,function(){return this}),e),f=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Ul(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Ul(f,"constructor",c),Ul(c,"constructor",l),l.displayName="GeneratorFunction",Ul(c,o,"GeneratorFunction"),Ul(f),Ul(f,o,"Generator"),Ul(f,r,function(){return this}),Ul(f,"toString",function(){return"[object Generator]"}),(ql=function(){return{w:i,m:d}})()}function Ul(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Ul=function(t,e,n,r){if(e)o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n;else{var i=function(e,n){Ul(t,e,function(t){return this._invoke(e,n,t)})};i("next",0),i("throw",1),i("return",2)}},Ul(t,e,n,r)}function Hl(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 Gl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hl(Object(n),!0).forEach(function(e){Xl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Xl(t,e,n){return(e=function(t){var e=function(t){if("object"!=Nl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Nl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jl(t){return function(t){if(Array.isArray(t))return Kl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ql(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 Vl(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function $l(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){Vl(i,r,o,a,s,"next",t)}function s(t){Vl(i,r,o,a,s,"throw",t)}a(void 0)})}}function Yl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ql(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 Ql(t,e){if(t){if("string"==typeof t)return Kl(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)?Kl(t,e):void 0}}function Kl(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 Zl="nodality-agent-manifest";function tc(t){if(!t)return{text:"",actions:[]};var e,n=function(t){var e=getComputedStyle(t);if("none"===e.display||"0"===e.opacity)return!1;var n=t.getBoundingClientRect();return n.width>0&&n.height>0},r=[],o=Yl(t.querySelectorAll("h1,h2,h3,h4,h5,h6,p,li"));try{for(o.s();!(e=o.n()).done;){var i=e.value;if(n(i)){var a=(i.textContent||"").replace(/\s+/g," ").trim();if(a){var s=i.tagName.toLowerCase();r.push(/^h[1-6]$/.test(s)?"".concat("#".repeat(+s[1])," ").concat(a):a)}}}}catch(t){o.e(t)}finally{o.f()}var l,c=[],u=Yl(t.querySelectorAll("a,button,[role=button]"));try{for(u.s();!(l=u.n()).done;){var f=l.value;if(n(f)){var d=(f.textContent||"").replace(/\s+/g," ").trim();d&&!c.includes(d)&&c.push(d)}}}catch(t){u.e(t)}finally{u.f()}return{text:r.join("\n"),actions:c}}var ec=function(t,e,n){return{ok:!1,code:t,got:e,valid:n}};function nc(t){var e=t.mount,n=t.elements,r=t.nodes,o=t.morphs,i=function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).specDraft,r=void 0===n?null:n,o=(Array.isArray(e)?e:[]).find(function(t){return Dl(t)&&"agent-surface"===t.op});if(!o)return null;var i,a=function(t){var e,n=[],r=Tl(Array.isArray(t)?t:[]);try{for(r.s();!(e=r.n()).done;){var o,i=Tl(Fl(e.value));try{for(i.s();!(o=i.n()).done;){var a=o.value;n.push(a)}}catch(t){i.e(t)}finally{i.f()}}}catch(t){r.e(t)}finally{r.f()}return n}(t),s=new Map,l=Tl(a);try{for(l.s();!(i=l.n()).done;){var c=i.value;"string"==typeof c.id&&s.set(c.id,c)}}catch(t){l.e(t)}finally{l.f()}var u=new Set((Array.isArray(o.exclude)?o.exclude:[]).filter(function(t){return"string"==typeof t})),f="string"==typeof o.name&&o.name.trim()?o.name.trim().replace(/[^a-zA-Z0-9_-]/g,"_"):null,d=function(t){return f?"".concat(f,"_").concat(t):t},h=[],p=function(t,e){var n=(Array.isArray(t)?t:[]).filter(function(t){return Dl(t)&&"morph"===t.op});if(!n.length)return null;var r,o,i=[],a=Tl(n);try{for(a.s();!(r=a.n()).done;){var s,l=r.value,c=Tl(bl(l));try{for(c.s();!(s=c.n()).done;){var u=s.value;"string"==typeof u.from&&i.push(u)}}catch(t){c.e(t)}finally{c.f()}}}catch(t){a.e(t)}finally{a.f()}if(!i.length)return null;for(var f=i[0].from,d=function(t){return i.filter(function(e){return e.from===t})},h=new Set([f]),p=[f];p.length;){var y,m=Tl(d(p.shift()));try{for(m.s();!(y=m.n()).done;){var v,b=Tl(y.value.toIds);try{for(b.s();!(v=b.n()).done;){var g=v.value;"string"!=typeof g||h.has(g)||(h.add(g),p.push(g))}}catch(t){b.e(t)}finally{b.f()}}}catch(t){m.e(t)}finally{m.f()}}for(var w=[],x=0,k=i;x<k.length;x++){var S=k[x];if(h.has(S.from)&&!e.has(S.from)){var O=[];if(S.byLabel)for(var j=0,E=Object.entries(S.byLabel);j<E.length;j++){var _=xl(E[j],2),A=_[0],T=_[1],C="string"==typeof T&&T.startsWith("#")?T.slice(1):T;e.has(C)||O.push({label:A,to:C})}else{var P,R=Tl(S.toIds);try{for(R.s();!(P=R.n()).done;){var I=P.value;e.has(I)||O.push({label:null,to:I})}}catch(t){R.e(t)}finally{R.f()}}O.length&&w.push({from:S.from,to:O,back:!0===S.back})}}for(var M=[],D=0,F=w;D<F.length;D++){var z,L=Tl(F[D].to);try{for(L.s();!(z=L.n()).done;){var N=z.value;M.includes(N.to)||M.push(N.to)}}catch(t){L.e(t)}finally{L.f()}}return{root:f,states:[f].concat((o=M.filter(function(t){return t!==f}),function(t){if(Array.isArray(t))return Pl(t)}(o)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(o)||Cl(o)||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.")}())),destinations:M,routes:w,canGoBack:w.some(function(t){return t.back})}}(e,u);if(p){var y=p.destinations.filter(function(t){return!u.has(t)});y.length&&h.push({name:d("navigate"),kind:"navigate",description:"Move to another view of this page. These are in-page views reached by a transition, not separate URLs. Routes: "+Ll(p)+".",inputSchema:{type:"object",properties:{destination:{type:"string",enum:y,description:"The view to move to."}},required:["destination"]}}),p.canGoBack&&h.push({name:d("go_back"),kind:"back",description:"Return to the previous view, unwinding the path actually taken rather than following an edge.",inputSchema:{type:"object",properties:{}}})}var m,v=Tl((Array.isArray(o.forms)?o.forms:[]).filter(function(t){return"string"==typeof t}));try{for(v.s();!(m=v.n()).done;){var b=m.value,g=s.get(b);if(g&&"form"===g.type){var w,x={},k=[],S=Tl(Fl(g));try{for(S.s();!(w=S.n()).done;){var O=w.value;if(Il.has(O.type)){var j=zl(O);j&&!x[j.key]&&(x[j.key]=j.schema,j.required&&k.push(j.key))}}}catch(t){S.e(t)}finally{S.f()}Object.keys(x).length&&h.push({name:d("submit_".concat(b.replace(/[^a-zA-Z0-9_-]/g,"_"))),kind:"submit",formId:b,description:"string"==typeof g.title&&g.title.trim()?g.title.trim():'Fill and submit the "'.concat(b,'" form on this page.'),inputSchema:Sl({type:"object",properties:x},k.length?{required:k}:{})})}}}catch(t){v.e(t)}finally{v.f()}var E,_=Tl((Array.isArray(o.products)?o.products:[]).filter(function(t){return"string"==typeof t}).map(function(t){return t.replace(/^#/,"")}));try{for(_.s();!(E=_.n()).done;){var A=E.value,T=s.get(A)||s.get("#".concat(A));T&&"product"===T.type&&h.push({name:d("get_product_".concat(A.replace(/[^a-zA-Z0-9_-]/g,"_"))),kind:"product",productId:A,description:'Read the product "'.concat(T.handle,'" as it is shown on this page: ')+"name, price for the visitor's market, options and availability. Read-only; buying happens on the shop's checkout.",inputSchema:{type:"object",properties:{}}})}}catch(t){_.e(t)}finally{_.f()}h.push({name:d("read_view"),kind:"read",description:"Read the content currently on screen as structured text: headings, body text and the labels of anything actionable.",inputSchema:{type:"object",properties:{}}});var C=Sl({spec:r,tools:h.map(function(t){return t.kind,t.formId,t.productId,function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,wl)})},p?{views:{root:p.root,states:p.states.filter(function(t){return!u.has(t)}),routes:p.routes}}:{});return{tools:h,manifest:C}}(n,r,{specDraft:"2026-07-21"});if(!i)return null;var a=i.tools,s=i.manifest,l=Array.isArray(o)?o.filter(Boolean):[],c=function(t){return l.find(function(e){return e.states&&e.states.has(t)})||null},u=function(){var t,n=Yl(l);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=r.states&&null!=r.current?r.states.get(r.current):null;if(o)return o}}catch(t){n.e(t)}finally{n.f()}return e},f=function(t){var n=function(e){if(!e||"function"!=typeof e.querySelector)return null;if(e.id===t)return"FORM"===e.tagName?e:e.querySelector("form");var n,r=e.querySelector("#".concat((n=String(t),"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(n):n.replace(/([^a-zA-Z0-9_-])/g,"\\$1"))));return r?"FORM"===r.tagName?r:r.querySelector("form"):null},r=n(e);if(r)return r;var o,i=Yl(l);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(a.states){var s,c=Yl(a.states.values());try{for(c.s();!(s=c.n()).done;){var u=n(s.value);if(u)return u}}catch(t){c.e(t)}finally{c.f()}}}}catch(t){i.e(t)}finally{i.f()}return null};if("undefined"!=typeof document){var d=document.getElementById(Zl);d&&d.remove();var h=document.createElement("script");h.type="application/json",h.id=Zl,h.textContent=JSON.stringify(s,null,2),(document.body||document.documentElement).appendChild(h)}var p,y=Yl(a);try{for(y.s();!(p=y.n()).done;){var m=p.value;if("submit"===m.kind&&e){var v=f(m.formId);v&&(v.setAttribute("toolname",m.name),v.setAttribute("tooldescription",m.description))}}}catch(t){y.e(t)}finally{y.f()}var b,g,w,x=Promise.resolve(),k=function(t){var e=x.then(t,t);return x=e.then(function(){},function(){}),e},S=function(){var t,e=Yl(l);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(null!=n.current)return n.current}}catch(t){e.e(t)}finally{e.f()}return null},O={navigate:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).destination;return k($l(ql().m(function n(){var r,o,i;return ql().w(function(n){for(;;)switch(n.n){case 0:if(r=c(t)){n.n=1;break}return n.a(2,ec("UNKNOWN_VIEW",t,l.flatMap(function(t){return Jl(t.states.keys())})));case 1:return o=r.current,n.n=2,r.goToState(t);case 2:if(r.current===t){n.n=3;break}return i=Jl(r.states.keys()),n.a(2,ec("UNREACHABLE_FROM_HERE",t,i.filter(function(t){return t!==o})));case 3:return n.a(2,Gl({ok:!0,view:r.current},tc(r.states.get(r.current)||e)))}},n)})))},back:function(){return k($l(ql().m(function t(){var n;return ql().w(function(t){for(;;)switch(t.n){case 0:if(n=l.find(function(t){return t.history&&t.history.length})){t.n=1;break}return t.a(2,ec("NO_HISTORY",null,[]));case 1:return t.n=2,n.goBack();case 2:return t.a(2,Gl({ok:!0,view:n.current},tc(n.states.get(n.current)||e)))}},t)})))},read:(w=$l(ql().m(function t(){return ql().w(function(t){for(;;)if(0===t.n)return t.a(2,Gl({ok:!0,view:S()},tc(u())))},t)})),function(){return w.apply(this,arguments)}),product:(g=$l(ql().m(function t(n,r){var o,i,a,s,l,c;return ql().w(function(t){for(;;)switch(t.n){case 0:if(o=e&&e.querySelector('[id="'.concat(r.productId,'"]'))){t.n=1;break}return t.a(2,ec("NO_PRODUCT",r.productId,[]));case 1:return i=o.querySelector("[shopify-loading-placeholder]"),a=i&&"undefined"!=typeof window&&"none"===window.getComputedStyle(i).display,s=[],l=[],c=function(t){var e,n=Yl(t.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(3===r.nodeType){var o=r.textContent.replace(/\s+/g," ").trim();o&&s.push(o)}else if(1===r.nodeType){if(/^(TEMPLATE|SCRIPT|STYLE)$/.test(r.tagName))continue;if("none"===window.getComputedStyle(r).display)continue;if(/^(A|BUTTON)$/.test(r.tagName)){var i=r.textContent.replace(/\s+/g," ").trim();i&&!l.includes(i)&&l.push(i)}r.shadowRoot&&c(r.shadowRoot),c(r)}}}catch(t){n.e(t)}finally{n.f()}},c(o),t.a(2,{ok:!0,product:r.productId,handle:o.getAttribute("handle"),live:!!a,text:s.join("\n"),actions:l})}},t)})),function(t,e){return g.apply(this,arguments)}),submit:(b=$l(ql().m(function t(){var e,n,r,o,i,a,s,c,u,d,h,p,y,m,v,b,g,w,x,k,S=arguments;return ql().w(function(t){for(;;)switch(t.n){case 0:if(e=S.length>0&&void 0!==S[0]?S[0]:{},r=f((n=S.length>1?S[1]:void 0).formId)){t.n=1;break}return t.a(2,ec("NO_FORM",n.formId,[]));case 1:if(r.isConnected){t.n=2;break}return o=l.flatMap(function(t){return t.states?Jl(t.states):[]}).filter(function(t){return Wl(t,2)[1].contains(r)}).map(function(t){return Wl(t,1)[0]}),t.a(2,ec("FORM_NOT_IN_VIEW",n.formId,o));case 2:if(i=n.inputSchema&&n.inputSchema.properties||{},a=n.inputSchema&&n.inputSchema.required||[],!(s=a.filter(function(t){return void 0===e[t]||""===e[t]||null===e[t]})).length){t.n=3;break}return t.a(2,ec("MISSING_REQUIRED",s,Object.keys(i)));case 3:c=[],u=[],d=[],h=function(t){return"SELECT"===t.tagName?Jl(t.options).map(function(t){return t.value}):[]},p="input, select, textarea",y=function(t){var e=r.querySelector('[name="'.concat(t,'"], #').concat(CSS.escape(t)));return!e||e.matches(p)?e:e.querySelector(p)},m=ql().m(function t(){var n,o,i,a,s,l;return ql().w(function(t){for(;;)switch(t.n){case 0:if(n=b[v],void 0!==e[n]){t.n=1;break}return t.a(2,0);case 1:if(o=e[n],i=y(n)){t.n=2;break}return d.push(n),t.a(2,0);case 2:if("checkbox"!==i.type){t.n=3;break}i.checked=!!o,t.n=7;break;case 3:if("radio"!==i.type){t.n=6;break}if(a=Jl(r.querySelectorAll('[name="'.concat(n,'"]'))),!(s=a.find(function(t){return t.value===String(o)}))){t.n=4;break}s.checked=!0,t.n=5;break;case 4:return u.push({field:n,got:null,valid:a.map(function(t){return t.value})}),t.a(2,0);case 5:t.n=7;break;case 6:i.value=String(o);case 7:i.dispatchEvent(new Event("input",{bubbles:!0})),i.dispatchEvent(new Event("change",{bubbles:!0})),l="checkbox"===i.type?i.checked:"radio"===i.type?String(o):i.value,("checkbox"===i.type?!!o===l:String(o)===l)?c.push(n):u.push({field:n,got:l,valid:h(i)});case 8:return t.a(2)}},t)}),v=0,b=Object.keys(i);case 4:if(!(v<b.length)){t.n=7;break}return t.d(Bl(m()),5);case 5:if(0!==t.v){t.n=6;break}return t.a(3,6);case 6:v++,t.n=4;break;case 7:if(!u.length&&!d.length){t.n=8;break}return t.a(2,Gl(Gl({},ec("FIELD_NOT_SET",[].concat(Jl(u.map(function(t){return t.field})),d),[].concat(Jl(u.map(function(t){return t.valid.length?'"'.concat(t.field,'" accepts ').concat(t.valid.map(function(t){return JSON.stringify(t)}).join(", ")):'"'.concat(t.field,'" did not take the value given')})),Jl(d.map(function(t){return'"'.concat(t,'" is named by the schema but no control in the form carries it')}))))),{},{filled:c,submitted:null}));case 8:if("function"==typeof r.requestSubmit){t.n=9;break}return r.submit(),t.a(2,{ok:!0,submitted:n.formId,filled:c});case 9:if(g=r.ownerDocument.defaultView,w=!1,x=function(t){t.target===r&&(w=!0)},g.addEventListener("submit",x,!0),r.requestSubmit(),g.removeEventListener("submit",x,!0),w){t.n=10;break}return k=Object.keys(i).map(function(t){return[t,y(t)]}).filter(function(t){var e=Wl(t,2)[1];return e&&e.willValidate&&!e.validity.valid}).map(function(t){var e=Wl(t,2);return{field:e[0],message:e[1].validationMessage}}),t.a(2,Gl(Gl({},ec("NOT_SUBMITTED",n.formId,k)),{},{filled:c,submitted:null}));case 10:return t.a(2,{ok:!0,submitted:n.formId,filled:c})}},t)})),function(){return b.apply(this,arguments)})},j="undefined"!=typeof document&&document.modelContext?document.modelContext:"undefined"!=typeof navigator&&navigator.modelContext?navigator.modelContext:null,E=!1;if(j&&"function"==typeof j.registerTool){var _,A=Yl(a);try{var T=function(){var t=_.value;try{j.registerTool({name:t.name,description:t.description,inputSchema:t.inputSchema,execute:function(e){return O[t.kind](e,t)}}),E=!0}catch(e){console.warn("[nodality] agent surface: tool rejected",t.name,e)}};for(A.s();!(_=A.n()).done;)T()}catch(t){A.e(t)}finally{A.f()}}return{manifest:s,tools:a,registered:E,destroy:function(){if(j&&"function"==typeof j.unregisterTool){var t,e=Yl(a);try{for(e.s();!(t=e.n()).done;){var n=t.value;try{j.unregisterTool(n.name)}catch(t){}}}catch(t){e.e(t)}finally{e.f()}}if("undefined"!=typeof document){var r=document.getElementById(Zl);r&&r.remove()}}}}function rc(t,e){return sc(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)||ic(t,e)||oc()}function oc(){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 ic(t,e){if(t){if("string"==typeof t)return ac(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)?ac(t,e):void 0}}function ac(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 sc(t){if(Array.isArray(t))return t}function lc(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 cc(t,e,n){return(e=function(t){var e=function(t){if("object"!=uc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=uc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==uc(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uc(t){return uc="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},uc(t)}var fc=Object.freeze({src:"url",href:"url",options:"items"}),dc=(new Set(Object.values(fc)),function(t,e){if(Array.isArray(t))return t.map(function(t){return dc(t,e)});if(!t||"object"!==uc(t))return t;for(var n=e(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lc(Object(n),!0).forEach(function(e){cc(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lc(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t)),r=0,o=["children","items"];r<o.length;r++){var i=o[r];void 0!==n[i]&&(n[i]=dc(n[i],e))}return n});function hc(t){return function(t){return dc(t,function(t){if("table"!==t.type||!Array.isArray(t.items)||t.items.length<2)return t;if(!t.items.every(function(t){return Array.isArray(t)}))return t;var e,n=sc(e=t.items)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||ic(e)||oc(),r=n[0],o=n.slice(1);return r.every(function(t){return"string"==typeof t||"number"==typeof t})?(t.items=o.map(function(t){return Object.fromEntries(r.map(function(e,n){return[String(e),t[n]]}))}),t):t})}(function(t){return dc(t,function(t){for(var e=0,n=Object.entries(fc);e<n.length;e++){var r=rc(n[e],2),o=r[0],i=r[1];Object.prototype.hasOwnProperty.call(t,o)&&(Object.prototype.hasOwnProperty.call(t,i)||(t[i]=t[o]),delete t[o])}return t})}(t))}Object.freeze(Object.keys(fc)),new Set(["h1.size","h2.size","h3.size","h4.size","h5.size","h6.size","p.size","a.transform","checkbox.exact","checkbox.area","checkbox.background","checkbox.color","checkbox.cursor","checkbox.height","checkbox.keySet","checkbox.mar","checkbox.maxWidth","checkbox.pad","checkbox.transform","checkbox.width","circle.transform","code.transform","filePicker.radius","labelInput.color","labelInput.exact","nav.size","nav.transform","polygon.transform","radio.color","radio.exact","sideNav.exact","sideNav.area","sideNav.background","sideNav.color","sideNav.cursor","sideNav.height","sideNav.keySet","sideNav.mar","sideNav.maxHeight","sideNav.maxWidth","sideNav.opacity","sideNav.pad","sideNav.radius","sideNav.size","sideNav.transform","sideNav.width","sideNav.zIndex","table.transform"]);[].concat(["op","target","range","style","duration"],["filter","gradient","color","width"]),new Set(["ulist"]),new Set(["h1","h2","h3","h4","h5","h6"]);function pc(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 yc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pc(Object(n),!0).forEach(function(e){mc(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pc(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function mc(t,e,n){return(e=vc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vc(t){var e=function(t){if("object"!=bc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bc(e)?e:e+""}function bc(t){return bc="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},bc(t)}var gc="$ref",wc=function(t){return!!t&&"object"===bc(t)&&!Array.isArray(t)&&"string"==typeof t[gc]};function xc(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!e||"object"!==bc(e))return t;var r=function(t){if(Array.isArray(t))return t.map(r);if(!t||"object"!==bc(t))return t;if(wc(t)){var o=t[gc];if(!Object.prototype.hasOwnProperty.call(e,o))return t;if(n.has(o))return t;var i=new Set(n).add(o),a=xc([e[o]],e,i)[0],s=(t[gc],function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,[gc].map(vc)));return Object.keys(s).length?yc(yc({},a&&"object"===bc(a)?a:{}),s):a}for(var l=yc({},t),c=0,u=["children","items"];c<u.length;c++){var f=u[c];void 0!==l[f]&&(l[f]=r(l[f]))}return l};return Array.isArray(t)?t.map(r):t}function kc(t){return function(t){if(Array.isArray(t))return _c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ec(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 Sc(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 Oc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Sc(Object(n),!0).forEach(function(e){jc(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sc(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function jc(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ac(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ac(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ac(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ec(t,e){if(t){if("string"==typeof t)return _c(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)?_c(t,e):void 0}}function _c(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 Ac(t){return Ac="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},Ac(t)}var Tc=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):null==t?t:String(t)};var Cc=function(t){return"number"==typeof t?Math.round(t):parseInt(t,10)};function Pc(t,e){var n=[],r=[],o=new Map;if((Array.isArray(e)?e:[]).forEach(function(t,e){if(t&&t.op&&"object"===Ac(t.op)&&"arrange"===t.op.name){var n=function(t){if(!Array.isArray(t)||2!==t.length)return null;var e=Cc(t[0]),n=Cc(t[1]);return!Number.isFinite(e)||!Number.isFinite(n)||e<0||n<e?null:[e,n]}(t.range),i=Array.isArray(t.target)?t.target:[];if(n&&i.length){var a,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Ec(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}}}}(i);try{for(s.s();!(a=s.n()).done;){var l=a.value,c=Tc(String(l)),u=o.get(c)||[],f=u.find(function(t){return e=t.range,r=n,e[0]<=r[1]&&r[0]<=e[1];var e,r});f?r.push({node:e,target:c,reason:"overlaps node ".concat(f.node)}):(u.push({node:e,mode:t.op.mode||"column",range:n}),o.set(c,u))}}catch(t){s.e(t)}finally{s.f()}}else r.push({node:e,reason:"needs target and range [lo, hi]"})}}),!o.size)return{elements:t,applied:n,skipped:r};var i=function(t){if(!Array.isArray(t))return t;var e=!1,a=t.map(function(t){if(!t||"object"!==Ac(t))return t;var a=function(t){var e=null==t.id?null:Tc(String(t.id)),i=e&&o.get(e);if(!i)return t;var a=function(t){return"row"===t.type?"row":"cards"===t.type?"cards":"nav"===t.type?"nav":null}(t),s=i.slice().sort(function(t,e){return t.range[0]-e.range[0]});if(("row"===a||"cards"===a)&&i.every(function(t){return"column"===t.mode||"row"===t.mode})){var l=s.map(function(t){var e={breakpoint:[t.range[0],t.range[1]],flexDirection:t.mode};return"cards"===a&&"column"===t.mode&&(e.alignItems="center"),e});i.forEach(function(t){return n.push({node:t.node,target:e,via:"resprop"})});var c=Oc(Oc({},t),{},{resprop:[].concat(kc(Array.isArray(t.resprop)?t.resprop.map(function(t){return Oc({},t)}):[]),kc(l))});return"cards"===a&&(c.colat=!1),c}if("nav"===a&&i.every(function(t){return"collapse"===t.mode||"expand"===t.mode})){var u=s.filter(function(t){return"collapse"===t.mode}),f=s.filter(function(t){return"expand"===t.mode}),d=null;if(u.length||1!==f.length||0!==f[0].range[0]){if(1===u.length&&0===u[0].range[0]){var h=u[0].range[1];f.length?1===f.length&&f[0].range[0]===h+1&&(d=h+1):d=h>=99999?99999:h+1}}else d=0;return null!==d?(i.forEach(function(t){return n.push({node:t.node,target:e,via:"breakpoint"})}),Oc(Oc({},t),{},{breakpoint:"".concat(d,"px")})):(i.forEach(function(t){return r.push({node:t.node,target:e,reason:"a nav collapses below one width and expands above it; these ranges say otherwise"})}),t)}return i.forEach(function(n){return r.push({node:n.node,target:e,reason:'mode "'.concat(n.mode,'" does not apply to ').concat(t.type)})}),t}(t),s=i(t.children);return s!==t.children&&(a=Oc(Oc({},a===t?t:a),{},{children:s})),a!==t&&(e=!0),a});return e?a:t};return{elements:i(t),applied:n,skipped:r}}function Rc(t){return Rc="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},Rc(t)}function Ic(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,Mc(r.key),r)}}function Mc(t){var e=function(t){if("object"!=Rc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Rc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Rc(e)?e:e+""}var Dc=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.setupa()},e=[{key:"seto",value:function(t){return this.e=t.a,t.speed&&(this.divisor=t.speed),t.height&&(this.setH=t.height),this}},{key:"setupa",value:function(){return this.parallaxIDs(["#rta"]),this.divisor(1),this}},{key:"add",value:function(t){return this.items=t,this.setup(),this}},{key:"parallaxIDs",value:function(t){return this.parallaxIDs=t,this}},{key:"divisor",value:function(t){return this.divisor=t,this}},{key:"setup",value:function(){var t,e=this;this.pts=0;var n=document.createElement("div");n.style.width="100%",n.style.height=null!==(t=this.setH)&&void 0!==t?t:"100%";var r=document.createElement("div");r.style.display="flex",r.style.width="100%";for(var o=0;o<this.items.length;o++){var i=this.items[o].render();r.appendChild(i)}n.appendChild(r);var a=window.localStorage.getItem("pts");null!==a&&(this.pts=a),n.addEventListener("wheel",function(t){t.deltaY<0?e.pts--:t.deltaY>0&&e.pts++,window.localStorage.setItem("pts",e.pts),t.preventDefault();for(var n=0;n<r.childNodes.length;n++){var o=r.childNodes[n];e.parallaxIDs.includes(o.id)&&(o.style.transform="translateX(".concat(e.pts/e.divisor,"%)"))}r.style.transform="translateX(".concat(e.pts/e.divisor,"%)"),window.localStorage.setItem("translation",e.pts/e.divisor)});var s=window.localStorage.getItem("translation");null!==s&&(r.style.transform="translateX(".concat(s,"%)")),this.div=n}},{key:"render",value:function(t){if(!t)return this.div;document.querySelector(t).appendChild(this.div)}}],e&&Ic(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Fc(t){return Fc="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},Fc(t)}function zc(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,Lc(r.key),r)}}function Lc(t){var e=function(t){if("object"!=Fc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fc(e)?e:e+""}var Nc=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:"cards",value:function(t,e,n){for(var r=[],o=0;o<t.children.length;o++){var i=t.children[o];"text"===i&&this.insertTextToCard(r,e,t,n),"image"!==i||t.backgroundCard||r.push('\n new Image("https://upload.wikimedia.org/wikipedia/commons/3/3a/Starship_S20.jpg").set({})'),"link"===i&&(e.op?r.push("\n ".concat(n.tabSpace(6)," ").concat(n.link[e.op.theme.toLowerCase()].code)):r.push("\n ".concat(n.tabSpace(6)," ").concat(n.link.base.code)))}return r}},{key:"insertTextToCard",value:function(t,e,n,r){if(e.op)if(e.op.ops&&e.op.ops.includes("text-blast")){var o="\n ".concat(r.tabSpace(6)," ").concat(r.text[e.op.theme.toLowerCase()].code),i=r.ops[e.op.theme.toLowerCase()].blast.code;n.backgroundCard||(i=r.ops[e.op.theme.toLowerCase()].blastFun(1));var a=this.insertTextBetween(o,i);t.push(a)}else t.push("\n ".concat(r.tabSpace(6)," ").concat(r.text[e.op.theme.toLowerCase()].code));else t.push("\n ".concat(r.tabSpace(6)," ").concat(r.text.base.code))}},{key:"insertTextBetween",value:function(t,e){var n=t.match(/(color: ".+?",)(.+?)(id: ".+?")/);if(n){var r=n.index+n[0].length;return t.slice(0,r)+", "+e+", "+t.slice(r)}return t}}],null&&zc(t.prototype,null),e&&zc(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Bc(t,e){return Bc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Bc(t,e)}function Wc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Wc=function(){return!!t})()}function qc(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 Uc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qc(Object(n),!0).forEach(function(e){Hc(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qc(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Hc(t,e,n){return(e=Qc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gc(t){return function(t){if(Array.isArray(t))return Vc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Jc(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 Xc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Jc(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 Jc(t,e){if(t){if("string"==typeof t)return Vc(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)?Vc(t,e):void 0}}function Vc(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 $c(t){return $c="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},$c(t)}function Yc(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,Qc(r.key),r)}}function Qc(t){var e=function(t){if("object"!=$c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$c(e)?e:e+""}var Kc=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),St.clear(),this.items=[],this.options=[],this.code=[],this.ready2Render=[],this._built=[],this._owned=[],this.stor={text:{miami:{code:'new Text("Hello").set({fluidc: "S3", color: "orange"})'},base:{code:'new Text("Hello").set({fluidc: "S3", color: "orange"})'},nepal:{code:'new Text("Hello").set({fluidc: "S3", color: "#2ECC71", font: "Helvetica Neue"})'},patagonia:{code:'new Text("Hello").set({fluidc: "S3", color: "#3498DB", font: "DIN Alternate"})'}},complexa:{code:"new Wrapper()\n .set({...}) // Rest of the code omitted for brevity"},complex:{code:'new Wrapper() \n\t.set({\n\t\t\n\t\tresponsive: {\n\t\t\tranges: ["700px", "1200px", "1400px"],\n\t\t\tsequence: "col-row-col"\n\t\t}\n\t})\n\t.add([\n\t\tnew Image("img/wix.jpeg").set({\n\t\t\twidth: "100%",\n\t\t\theight: "200px",\n objectFit: "cover"\n\t\t}),\n\n new Wrapper().set({\n responsive: {\n\t\t\tranges: ["700px", "1200px", "1400px"],\n\t\t\tsequence: "col-col-row"\n\t\t}\n }).add([\n new Text("Running in the desert").set({\n size: "S3",\n font: "Arial",\n color: "orange"\n }),\n\n new Text("This is example content").set({\n exact: "1rem",\n font: "Arial"\n }),\n\n\n new Image("img/wix.jpeg").set({\n width: "100%",\n height: "300px",\n objectFit: "cover"\n })\n ])\n\t])'},ops:{miami:{blast:{code:'stroke: {range:["0px","3000px"], op:{name:"blast",color:"orange",width:"3px"}}'},blastFun:function(t){return'stroke: {range:["0px","3000px"], op:{name:"blast",color:"orange",width:"'.concat(t,'px"}}')}},nepal:{blast:{code:'stroke: {range:["0px","3000px"], op:{name:"blast",color:"#2ECC71",width:"3px"}}'},blastFun:function(t){return'stroke: {range:["0px","3000px"], op:{name:"blast",color:"#2ECC71",width:"'.concat(t,'px"}}')}},patagonia:{blast:{code:'stroke: {range:["0px","3000px"], op:{name:"blast",color:"#1abc9c",width:"3px"}}'},blastFun:function(t){return'stroke: {range:["0px","3000px"], op:{name:"blast",color:"#1abc9c",width:"'.concat(t,'px"}}')}}},link:{miami:{code:'new Link("Link").set({text: "Hello", url: "#a", background: "", color: "orange", hover: {color: "white", background: "orange", animation: 0.6}, borderObj: {color: "orange", width: "3px", radius: "0.7rem"}, pad: { sides: ["all"], value: "0.6rem" }, mar: { "t": 0.8rem }, radius: "0.4rem"})'},base:{code:'new Link("Link").set({text: "Hello", url: "#ai", background: "#3498db", pad: [{lr: "0.5rem", tb: "1rem"}], radius: "0.4rem", color: "white"})'},nepal:{code:'new Link("Link").set({text: "Hello", url: "#a", background: "#2ECC71", pad: { sides: ["all"], value: "0.6rem" }, mar: { sides: ["top", "bottom"], value: "0.8rem" }, hover: {color: "#2ECC71", background: "white", border: true, animation: 0.3}, color: "white"})'},patagonia:{code:'new Link("Link", "#a").set({text: "Hello", url: "#a", background: "#1ABC9C", pad: { sides: ["all"], value: "0.6rem" }, mar: { sides: ["top", "bottom"], value: "0.8rem" }, hover: {color: "#2ECC71", background: "white", border: true, animation: 0.3}, color: "white"})'}},grid:{code:' new AreaSwitcher()\n .set({\n gap: "1rem"\n })\n .react([{\n at: "0px",\n template: [\n "eeeeee",\n "eeeeee",\n "abbbbb",\n "abbbbb",\n "abbbbb",\n "cccccc",\n "cccccc",\n "dddddd"\n ]\n },\n\n {\n at: "900px",\n color: "orange",\n template: [\n "aaaccc",\n "aaaccc",\n "bbbbbb",\n "dddddd",\n "eeeeee"\n ]\n },\n\n {\n at: "1200px",\n color: "purple",\n template: [\n "cccaaa",\n "cccaaa",\n "bbbbbb",\n "dddddd",\n "eeeeee"\n ]\n },\n ])\n .add([\n new Wrapper().set({\n pad: [{\n a: 20\n }],\n background: "#ecf0f1",\n radius: "1.7rem"\n }).add([\n new Text("NEW PRODUCT").set({\n exact: "1rem",\n font: "Oswald",\n width: "100%"\n }),\n new Text("Feel").set({\n fluidc: "S2",\n font: "Oswald",\n width: "100%",\n color: "black"\n }),\n new Text("Speed").set({\n exact: "7rem",\n font: "Oswald",\n width: "100%",\n color: "#3498db"\n }),\n ]),\n\n new Wrapper().set({\n pad: [{\n a: 20\n }],\n background: "#ecf0f1",\n radius: "1.7rem"\n }).add([\n new Text("TOP QUALITY").set({\n exact: "1rem",\n font: "Oswald",\n width: "100%"\n }),\n new Text("Amazing animals").set({\n fluidc: "S2",\n font: "Oswald",\n width: "100%",\n color: "black"\n }),\n\n new Text("Seals are intelligent, agile marine mammals found in oceans around the world, known for their streamlined bodies, flippers, and ability to thrive both in water and on land. Belonging to the pinniped family, they are divided into true seals, which lack external ears, and eared seals like sea lions, which are more mobile on land. Seals feed primarily on fish and squid, using their sensitive whiskers to detect prey underwater, and can dive to great depths while holding their breath for extended periods. Adapted to cold environments with thick blubber for insulation, seals play a crucial role in marine ecosystems but face threats from climate change, pollution, and human activity, making conservation efforts increasingly important.")\n .set({\n font: "Arial",\n exact: "1.3rem"\n })\n\n ]),\n\n new Wrapper().set({\n radius: "1.7rem",\n overflow: "hidden"\n\n }).add([\n\n new Image("https://cdn.pixabay.com/photo/2017/02/09/18/40/seal-2053165_640.jpg", "exact").set({\n width: "100%",\n height: "420px",\n minHeight: "100px",\n objectFit: "cover"\n\n })\n ]),\n\n new Wrapper().set({\n pad: [{\n a: 20\n }],\n background: "#ecf0f1",\n radius: "1.7rem",\n }).add([\n new Text("Welcome seals").set({\n fluidc: "S3",\n font: "Oswald",\n color: "black"\n }),\n \n ]),\n new Wrapper().set({\n mc: true,\n pad: [{\n a: 20\n }],\n background: "#ecf0f1",\n radius: "1.7rem",\n\n }).add([new Text("Top line").set({\n font: "Arial",\n exact: "1.3rem"\n }), ]),\n ])'},flexRow:function(t){return{image:{code:'new FlexRow().set({border: ["all", "3px"], colat: "600px"}).items([new Image(...), new Image(...), new Image(...)])'},text:{code:'new FlexRow().set({}).items([\n\nnew Text("This").set({\n size: "S3"\n}), \n\nnew Text("is").set({\n size: "S3",\n text: "Hello"\n}), \n\nnew Text("row.").set({\n size: "S3",\n text: "Hello"\n})\n \n])'}}},tabSpace:function(t){return" ".repeat(t)}}}return e=t,n=[{key:"at",value:function(e){Array.isArray(this.options)||(this.options=[]),Array.isArray(this.protoOptions)||(this.protoOptions=[]);var n=t.cloneNodes([e])[0];return this.options.push(n),this.protoOptions.push(n),this}},{key:"nodes",value:function(e){return this.options=t.cloneNodes(e),this.protoOptions=t.cloneNodes(e),this}},{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:"add",value:function(t){var e="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__&&"object"===$c(globalThis.__NODALITY_DEV__)?globalThis.__NODALITY_DEV__:null;e&&(e.inDes=!0);var n=Tt._owner;Tt._owner=this._owned;try{return this._add(t)}finally{Tt._owner=n,e&&(e.inDes=!1)}}},{key:"destroy",value:function(){var t,e=this,n=Xc(this._owned.splice(0).reverse());try{for(n.s();!(t=n.n()).done;){var r=t.value;try{r&&"function"==typeof r.destroy&&r.destroy()}catch(t){}}}catch(t){n.e(t)}finally{n.f()}var o,i=Xc([].concat(this._morphs||[]));try{for(i.s();!(o=i.n()).done;){var a=o.value;try{a&&"function"==typeof a.destroy&&a.destroy()}catch(t){}}}catch(t){i.e(t)}finally{i.f()}this._morphs=null;try{this._agentSurface&&"function"==typeof this._agentSurface.destroy&&this._agentSurface.destroy()}catch(t){}this._agentSurface=null;for(var s=0,l=[this._codeEl,this._preEl];s<l.length;s++){var c=l[s];c&&c.parentNode&&c.parentNode.removeChild(c)}var u="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__;return u&&Array.isArray(u.pages)&&(u.pages=u.pages.filter(function(t){return!e._devEntry||t!==e._devEntry})),this._built=[],this.ready2Render=[],this}},{key:"_add",value:function(e){var n=this,r=function(t){var e=[],n=function(t,r){if(Array.isArray(t))return t.forEach(function(t,e){return n(t,"".concat(r,"[").concat(e,"]"))});if(t&&"object"===bc(t))if(wc(t))e.push({name:t[gc],path:r});else for(var o=0,i=["children","items"];o<i.length;o++){var a=i[o];void 0!==t[a]&&n(t[a],"".concat(r,".").concat(a))}};return n(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"elements"),e}(e=hc(e=xc(Array.isArray(e)?e:[],this._defs))).filter(function(t){return!n._defs||!Object.prototype.hasOwnProperty.call(n._defs,t.name)});if(r.length){var o=Object.keys(this._defs||{});throw new Error('[nodality] no definition for $ref "'.concat(r[0].name,'" at ')+"".concat(r[0].path,". Defined: ").concat(o.length?o.join(", "):"(none)"))}if(Array.isArray(this.options)&&this.options.some(function(t){return t&&t.op&&"arrange"===t.op.name})){var i=Pc(e,this.options);e=i.elements;var a,s=Xc(i.skipped);try{for(s.s();!(a=s.n()).done;){var l=a.value;"undefined"!=typeof console&&console.warn("[nodality] arrange node ".concat(l.node).concat(l.target?' on "'.concat(l.target,'"'):""," ignored: ").concat(l.reason,"."))}}catch(t){s.e(t)}finally{s.f()}}this.css=[],this.elCSS=[],this.elHTML=[];var c=this.options;c.forEach(function(t){"radial"===t.direction&&(t.gradient="radial-gradient(orange, green)")}),e=[].concat(Gc(e.filter(function(t){return t&&("nav"===t.type||"sideNav"===t.type)})),Gc(e.filter(function(t){return!t||"nav"!==t.type&&"sideNav"!==t.type}))),this._elements=e;for(var u,f,d=function(){var r=e[h],o=null,i=n.ready2Render.length,a=n.code.length,s=["blast","gradient","shadow","filter","animation","transform","span"],l=[{op:{name:"blast",color:"green",width:"1px"}},{op:{name:"gradient",gradient:"linear-gradient(orange, green)"}},{op:{name:"shadow",color:"#1abc9c",steps:3,colors:["orange","green","yellow"]}},{op:{name:"filter",filter:"grayscale(0.7)"}},{op:{name:"animation",color:"green",width:"1px",fireAt:"inview",keyframesOpen:[{transform:"translate(100%, 0%)",opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, 0%)",opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}},{op:{name:"transform",values:["ty:-20px","scale(3)","rotate(3deg)","skew(3deg, 0deg)","perspective(100px)","matrix(1, 0, 0, 1, 50, 50)"]}},{op:{name:"span",parts:[{text:"The first time",style:{italic:!0,arrpad:{sides:["left"],value:"3rem"},stroke:{range:["950px","1000px"],op:{name:"blast",background:["header","button"],color:"yellow",width:"1px"}}}},{text:"We went to the Moon",style:{}}]}}];for(f=0;f<s.length;f++){var d=c.map(function(t){return t.op}).map(function(t,e){return t===s[f]?e:""}).filter(String);if(d.length>0)for(u=0;u<d.length;u++){var p=d[u],y=c[p].target,m=c[p].range,v=c[p].filter,b=c[p].gradient,g=c[p].color,w=c[p].width,x=t.cloneNodes([l[f]])[0];x.target=y,null!=m&&(x.range=m),null!=v&&(x.op.filter=v),null!=b&&(x.op.gradient=b),"blast"===s[f]&&(null!=g&&(x.op.color=g),null!=w&&(x.op.width=w)),c[p]=x}}for(f=0;f<c.length;f++){var k=c[f].op.name,S=n.protoOptions[f].style||"default",O=n.protoOptions[f].duration||"default";if("transform"===k){var j,E,_,A;A="SOLARIUM"===S?["scale(3)"]:"WAVE"===S?["skew(15deg, 0deg)","tx:50px","rotate(10deg)","scale(1.1)"]:"CUBE-SPIN"===S?["perspective(700px)","scale(0.9)"]:"TORNADO-SWITCH"===S?["rotate(720deg)","scale(0.8)","tx:30px","ty:-50px","tz:-80px"]:"LASER-SWEEP"===S?["tx:100px","opacity:0.2","scale(1.2, 1.0)"]:"TORNADO-TWIST"===S?["rotate(720deg)","scale(0.8)","tx:30px","ty:-50px","skew(10deg, 0deg)"]:"JELLY-WOBBLE"===S?["scale(1.2, 0.8)","rotate(5deg)","ty:-10px","skew(5deg, 0deg)"]:"DRUNKEN-SWAY"===S?["rotate(15deg)","tx:20px","ty:-10px","skew(10deg, 5deg)"]:"FLAME-FLICKER"===S?["scale(1.1, 0.9)","rotate(-5deg)","ty:5px","opacity:0.7"]:"PHANTOM-SHIFT"===S?["tx:15px","ty:-5px","opacity:0.5","skew(5deg, 5deg)"]:"RUBBER-BOUNCE"===S?["scale(1.3, 0.8)","skew(10deg, 0deg)","ty:-20px"]:"ASTEROID-CRASH"===S?["tx:-80px","ty:100px","rotate(45deg)","scale(0.7)","opacity:0.5"]:"CYBER-GLITCH"===S?["tx:5px","ty:-5px","rotate(3deg)","opacity:0.6","scale(1.05)"]:"BUBBLE-POP"===S?["scale(1.5)","opacity:0.3","ty:-20px"]:"SUPERNOVA-BURST"===S?["scale(2)","opacity:0","tx:50px","ty:-50px"]:"GRAVITY-DROP"===S?["ty:100px","scale(0.8)","rotate(10deg)","skew(0deg, 10deg)"]:"LASER-SWEEP"===S?["tx:100px","opacity:0.2","scale(1.2, 1.0)"]:"VORTEX-SINK"===S?["rotate(-360deg)","scale(0.5)","ty:50px"]:"SHOCKWAVE"===S?["scale(1.7)","opacity:0.4","skew(5deg, 5deg)"]:["ty:20px","tx:30px","rotate(3deg)","skew(40deg, 0deg)"],c[f].op={name:"transform",values:A,duration:O};var T,C="style",P="duration";null!==(j=c[f])&&void 0!==j&&j.op&&C in c[f].op&&delete c[f].op[C],null!==(E=c[f])&&void 0!==E&&E.op&&P in c[f].op&&delete c[f].op[P],null!==(_=c[f])&&void 0!==_&&_.op.values&&null!==(T=c[f])&&void 0!==T&&T.op.values}}!function t(e){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if("object"===$c(e[o])&&null!==e[o])t(e[o]);else if("string"==typeof e[o])switch(e[o].toLowerCase()){case"medium":e[o]="6s-ease-in-out";break;case"fast":e[o]="3s-ease-in-out";break;case"slow":e[o]="9s-ease-in-out";break;case"default":delete e[o]}}}(c),["h1","h2","h3","h4","h5","h6","p"].includes(r.type)||"img"===r.type||"a"===r.type?((o=Qs.mapType({el:r,customOptions:c,i:h})).toCode?n.code.push(o.toCode().join("")):n.code.push(o),n.ready2Render.push(o),o=o.render()):"table"===r.type?(o=Qs.mapType({el:r,customOptions:c,i:h,storage:n.stor}),n.code.push(o.toCode())):"slider"===r.type?n.code.push(' \nlet texts = [\n\nnew Text("One").set({size: "S1", color: "#1abc9c", font: "Arial"}),\n /*new Image().set({\n url: "https://image.datart.cz/foto/500/7/0/8/product_7766807.jpg",\n width: "400px",\n height: "auto"\n }),*/\n\n new Text("Two").set({size: "S1", color: "#1abc9c", font: "Arial"}),\n \n new Text("Three").set({size: "S1", color: "#1abc9c", font: "Arial"}),\n\n new Text("Four").set({size: "S1", color: "#1abc9c", font: "Arial"}),\n];\n\nnew Slider(texts, null, { tintColor: "#e74c3c", inactiveColor: "#ccc" })\n \n'):"hslider"===r.type?n.code.push('\n new HScroller()\n .seto({\n height: "300px",\n speed: 1.0 // the bigger the slower\n })\n .add([\n new Text("First").set({size: "S1", pad: [{"a": 40}] }),\n new Text("Second").set({size: "S1", pad: [{"a": 40}] }),\n new Text("Third").set({size: "S1", pad: [{"a": 40}] })\n ])\n '):"grid"===r.type?n.code.push(n.stor.grid.code):"modal"===r.type?n.code.push('new Code()\n .set({\n pad: [\n { l: 30 },\n ], \n mar: [\n { a: 30 },\n ], \n class: "language-js",\n code: `\n // You need to copy and paste this example\n\n\n import {Animator} from "../layout/animator.js";\n import {Text} from "../layout/text.js";\n import {Modal} from "../layout/modal-2025.js";\n import {Stack} from "../layout/stack.js";\n import {Image} from "../layout/image.js";\n import {FlexRow} from "../layout/flex-row.js";\n import {Button} from "../layout/button.js";\n import {Spacer} from "../layout/spacer.js";\n import {Wrapper} from "../layout/container.js";\n \n \n let firstLong = "Apple today announced that the company has surpassed a 60 percent reduction in its global greenhouse gas emissions compared to 2015 levels, as part of its Apple 2030 goal to become carbon neutral across its entire footprint in the next five years. The company achieved several other major environmental milestones, including the use of 99 percent recycled rare earth elements in all magnets and 99 percent recycled cobalt in all Apple-designed batteries.1 Apple shared this and other progress in its annual Environmental Progress Report, published today.\n “We’re incredibly proud of the progress we’re making toward Apple 2030, which touches every part of our business,” said Lisa Jackson, Apple’s vice president of Environment, Policy, and Social Initiatives. “Today, we’re using more clean energy and recycled materials to make our products than ever before, we’re preserving water and preventing waste around the world, and we’re investing big in nature. As we get closer to 2030, the work gets even harder — and we’re meeting the challenge with innovation, collaboration, and urgency.\n Apple’s 2030 strategy prioritizes cutting greenhouse gas emissions by 75 percent compared with its 2015 baseline year, before applying high-quality carbon credits to balance the remaining emissions. Last year, Apple’s comprehensive efforts to reduce its carbon footprint — including the continued transition of its supply chain to renewable electricity and designing products with more recycled materials — avoided an estimated 41 million metric tons of greenhouse gas emissions.";\n \n let elements = [\n new Stack()\n .setup({})\n .add([\n new Image("https://pbs.twimg.com/media/DwYvbCBVAAEKY_R.jpg").set({}),\n \n new FlexRow().set({aligns: "start"}).items([\n \n new Button("×")\n \n .set({\n fluidc: "S3",\n onTap: () => modal.close(),\n frame: { width: 80, height: 80 },\n color: "white",\n background: "none"\n }),\n \n new Spacer(true),\n ])\n ]),\n \n \n new Text("Samuel Suresh")\n .set({\n color: "#00ae56",\n font: "SF Pro Display",\n fluidc: "S2",\n pad: [{"tl": 20}]\n }),\n \n \n new Text("Studying Science and Business, Western Sydney University, class of 2022")\n .set({\n font: "Arial",\n fluidc: "S6",\n pad: [{"l": 20}]\n }),\n \n \n new Text(firstLong)\n .set({\n font: "Arial",\n fluidc: "S6",\n pad: [{"l": 20}]\n }), \n ];\n \n \n let wrapper = new Wrapper()\n .set({})\n .add(elements);\n \n \n let modal = new Modal();\n modal\n .set({\n width: "600px", \n background: "#469d73cc",\n close: true\n })\n .add([wrapper])\n .render("#res"); \n \n \n new Button("Wow")\n .set({\n fluidc: "S3",\n onTap: () => modal.show()\n })\n .render("#res");\n \n `\n })'):"row"===r.type?(o=Qs.mapType({el:r,customOptions:c,i:h,storage:n.stor}),n.code.push(o.toCode())):"cards"===r.type?(o=Qs.mapType({el:r,customOptions:c,i:h,storage:n.stor}))&&"object"===$c(o)&&"function"==typeof o.toCode?(n.code.push([].concat(o.toCode()).join("")),n.ready2Render.push(o)):n.code.push(o):"wrap"===r.type?(o=Qs.mapType({el:r,customOptions:c,i:h,storage:n.stor}),n.code.push(o.toCode()),n.ready2Render.push(o)):"responsive"===r.type?n.code.push(n.stor.complex.code):"free"===r.type||"nav"===r.type||"sideNav"===r.type||"dropdown"===r.type?(o=Qs.mapType({el:r,customOptions:c,i:h,storage:n.stor}),n.code.push(o.toCode()),n.ready2Render.push(o),o=o.render()):((o=Qs.mapType({el:r,customOptions:c,i:h,storage:n.stor})).toCode?n.code.push(o.toCode()):n.code.push(o),n.ready2Render.push(o),o=o.render());var R=n.ready2Render.length>i?n.ready2Render[n.ready2Render.length-1]:null,I=!R&&o&&"object"===$c(o)&&"function"==typeof o.render&&"function"==typeof o.toCode&&["table","row"].includes(r.type)?o:null,M=R&&"object"===$c(R)&&"function"==typeof R.render?R:I;n._built.push({instance:M,codeCount:n.code.length-a})},h=0;h<e.length;h++)d();return this}},{key:"toTextArea",value:function(t){var e=t||"#mount",n=document.createElement("textarea");n.style.width=300,n.style.height=300,n.setAttribute("id","elements"),n.value=this.code.join(";\n\n"),this.target="#elements";var r=document.createElement("pre"),o=document.createElement("code"),i=this.code.map(function(t){return"".concat(t,'.render("').concat(e,'"); \n \n')});return this.code=i,o.textContent=this.code,r.appendChild(o),r.setAttribute("class","nonLayout"),document.body.appendChild(r),document.body.appendChild(n),this._codeEl=n,this._preEl=r,this}},{key:"defs",value:function(t){if(void 0!==this._elements)throw new Error("[nodality] .defs() must come before .add(): add() renders as it goes, so definitions given afterwards cannot be used. Chain it as new Des().defs({ ... }).nodes(N).add(E)");return this._defs=t&&"object"===$c(t)&&!Array.isArray(t)?t:{},this}},{key:"set",value:function(t){if("undefined"!=typeof globalThis&&!0===globalThis.NODALITY_EMIT){var e=this.code.map(function(e){return"".concat(e,'.render("').concat(t&&t.mount||"#mount",'")')});return globalThis.__NODALITY_EMITTED__=e,this}this.toTextArea(t&&t.mount),this._codeEl.style.display="none",this._preEl.style.display="block",!1===t.elements&&(this._preEl.style.display="none"),!1===t.layout&&null!=document.querySelector("#layoutPre")&&(document.querySelector("#layoutPre").style.display="none"),!1===t.code&&(this._preEl.style.display="none");var n={FloatingInput:Gi,Range:$i,RadioGroup:Zi,Picker:aa,FilePickera:ha,DataList:wa,Base:zt,Form:Ea,Button:Mi,Slider:Li,Video:vi,Checkbox:oi},r={ElementMapper:Qs,Animator:Tt,LinkStyler:Ca,CardGen:Nc,AreaSwitcher:za},o=Uc(Uc(Uc({},{Text:Jt,Image:oe,Link:pe,FlexRow:Oe,UINavBar:Le,Free:en,Audio:un,Progress:vn,Center:On,Code:Rn,Stack:Nn,Wrapper:Yn,MetaAdder:rr,Table:hr,Dropdown:kr,Modal:Tr,TextField:Fr,Card:Hr,Wrap:Qr,FlexGrid:io,ZoomCard:ho,Switcher:qo,MobileBar:Po,DesktopBar:xo,SideNav:Je,Spacer:Yo,HScroller:Dc,Polygon:Va,Circle:rs,UList:_i,GridOverlay:Ss,Shop:Fs}),n),r),i="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__&&"object"===$c(globalThis.__NODALITY_DEV__)?globalThis.__NODALITY_DEV__:null;i&&(i.inDes=!0);var a=function(t){return function(t,e,n){if(Wc())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Bc(o,n.prototype),o}(Function,Gc(Object.keys(o)).concat([t])).apply(void 0,Gc(Object.values(o)))},s=Tt._owner;Tt._owner=this._owned;try{var l,c=t&&t.mount||"#mount",u=0,f=Xc(this._built);try{for(f.s();!(l=f.n()).done;){var d=l.value;if(d.instance)d.instance.render(c),u+=d.codeCount;else for(var h=0;h<d.codeCount;h++,u++)a(this.code[u])}}catch(t){f.e(t)}finally{f.f()}}finally{Tt._owner=s,i&&(i.inDes=!1)}try{var p=document.querySelector(t&&t.mount||"#mount");this._morphs=gl(p,this._elements,this.protoOptions)}catch(t){console.warn("[nodality] morph node skipped:",t)}try{this._agentSurface=nc({mount:document.querySelector(t&&t.mount||"#mount"),elements:this._elements,nodes:this.protoOptions,morphs:this._morphs})}catch(t){console.warn("[nodality] agent surface skipped:",t)}var y="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__&&Array.isArray(globalThis.__NODALITY_DEV__.pages)?globalThis.__NODALITY_DEV__:null;try{(t&&t.annotate||y&&y.annotate)&&function(t,e){if(!t||!Array.isArray(e))return 0;for(var n=Array.from(t.children||[]),r=0;r<n.length&&r<e.length;r++)try{n[r].setAttribute("data-nod",JSON.stringify(e[r]))}catch(t){}}(document.querySelector(t&&t.mount||"#mount"),this._elements)}catch(t){console.warn("[nodality] round-trip annotation skipped:",t)}if(y)try{var m={mount:t&&t.mount||"#mount",elements:this._elements,nodes:this.protoOptions};this._devEntry=m,y.pages.push(m),"undefined"!=typeof window&&"function"==typeof window.dispatchEvent&&"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("nodality:rendered",{detail:m}))}catch(t){console.warn("[nodality] dev registration skipped:",t)}}}],r=[{key:"cloneNodes",value:function(t){if(!Array.isArray(t))return[];try{if("function"==typeof structuredClone)return structuredClone(t)}catch(t){}var e=function(t){if(Array.isArray(t))return t.map(e);if(t&&"object"===$c(t)){var n={};for(var r in t)n[r]=e(t[r]);return n}return t};return t.map(e)}}],n&&Yc(e.prototype,n),r&&Yc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();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,{Des:()=>ru});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(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var a=r&&r.prototype instanceof c?r:c,u=Object.create(a.prototype);return s(u,"_invoke",function(n,r,o){var i,a,s,c=0,u=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,a=0,s=t,d.n=n,l}};function h(n,r){for(a=n,s=r,e=0;!f&&c&&!o&&e<u.length;e++){var o,i=u[e],h=d.p,p=i[2];n>3?(o=p===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,a=0))}if(o||n>1)return l;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),a=u,s=p;(e=a<2?t:s)||!f;){i||(a?a<3?(a>1&&(d.n=-1),h(a,s)):d.n=s:d.v=s);try{if(c=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(f=d.n<0)?s:n.call(r,d))!==l)break}catch(e){i=t,a=1,s=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),u}var l={};function c(){}function u(){}function f(){}e=Object.getPrototypeOf;var d=[][r]?e(e([][r]())):(s(e={},r,function(){return this}),e),h=f.prototype=c.prototype=Object.create(d);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(h),t}return u.prototype=f,s(h,"constructor",f),s(f,"constructor",u),u.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(h),s(h,o,"Generator"),s(h,r,function(){return this}),s(h,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:p}})()}function s(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,n,r){if(e)o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n;else{var i=function(e,n){s(t,e,function(t){return this._invoke(e,n,t)})};i("next",0),i("throw",1),i("return",2)}},s(t,e,n,r)}function l(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function c(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){l(i,r,o,a,s,"next",t)}function s(t){l(i,r,o,a,s,"throw",t)}a(void 0)})}}function u(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||p(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 f(t){return f="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},f(t)}function d(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=p(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 h(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)||p(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 p(t,e){if(t){if("string"==typeof t)return y(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)?y(t,e):void 0}}function y(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 m={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}}},v=Object.keys(m),b={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. Away from the focus a lifted chain is untouched — no magnification, no border — so with `by: "hover"` the element is pixel-identical at rest and the cells appear only under the pointer.',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=h(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",g(n[0])],b:["3fv",g(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",needs:"cell",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",g(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",g(t.ink||"#0B1B2B")],paper:["3fv",g(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",g(t.ink||"#0B1B2B")],paper:["3fv",g(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]}}},particles:{doc:{summary:"Breaks the image into one particle per cell, which shrinks to a dot and scatters on its own heading. Built for transitions (t-particles), where the gaps are transparent; elsewhere they show the image unmoved.",params:{size:{default:6,unit:"px",summary:"particle size: one particle per cell this big"},amount:{default:1,unit:"ratio",summary:"0 is the intact image, 1 fully scattered"},reach:{default:4,unit:"count",structural:!0,summary:"travel limit: a particle moves at most reach - 1 cells. Compiled in, and the cost: each pixel searches (2·reach + 1)² cells."},seed:{default:0,unit:"count",summary:"picks a different scatter of the same character"}}},structural:["reach"],stage:"displace",decl:function(t){return"\n uniform float ".concat(t,"size;\n uniform float ").concat(t,"amount;\n uniform float ").concat(t,"seed;\n // Polynomial hash, as in flow: trig hashes band on Apple\n // silicon and differ between GPU vendors.\n float ").concat(t,"h(vec2 v) {\n vec3 q = fract(vec3(v.xyx) * 0.1031 + ").concat(t,"seed * 0.1);\n q += dot(q, q.yzx + 33.33);\n return fract((q.x + q.y) * q.z);\n }")},code:function(t,e){var n=Math.max(1,Math.min(6,Math.round(null!=e.reach?e.reach:4)));return"\n {\n float sz = max(".concat(t,"size, 1.0);\n float a = clamp(").concat(t,"amount, 0.0, 1.0);\n if (a > 0.0) {\n vec2 x = sampleP;\n vec2 q = floor(x / sz);\n // Square and full-size at rest, so at a = 0 the cells tile\n // the image exactly; round and at 45% in full flight.\n float h = sz * 0.5 * (1.0 - 0.55 * a);\n float travel = ").concat(n-1,".0 * sz * a;\n float best = -1.0;\n vec2 hit = vec2(-1.0e5);\n for (int j = -").concat(n,"; j <= ").concat(n,"; j++) {\n for (int i = -").concat(n,"; i <= ").concat(n,"; i++) {\n vec2 c = q + vec2(float(i), float(j));\n vec2 dir = vec2(").concat(t,"h(c), ").concat(t,"h(c + vec2(57.3, 11.9))) * 2.0 - 1.0;\n // How far this one goes, and how high it stacks.\n float k = ").concat(t,"h(c + vec2(31.7, 83.1));\n vec2 home = (c + 0.5) * sz;\n vec2 d = x - (home + dir * travel * (0.35 + 0.65 * k));\n float dist = mix(max(abs(d.x), abs(d.y)), length(d), a);\n if (dist <= h && k > best) {\n best = k;\n // The particle carries its own cell, shrunk.\n hit = home + d * (0.5 * sz / h);\n }\n }\n }\n#ifdef NOD_TRANSITION\n // A gap lands outside both boxes, which is transparent.\n sampleP = hit;\n#else\n // No backdrop outside a transition: a gap would clamp to an\n // edge texel, so it shows the image unmoved instead.\n if (best >= 0.0) sampleP = hit;\n#endif\n }\n }")},uniforms:function(t,e){return{size:["1f",(null!=t.size?t.size:6)*e],amount:["1f",null!=t.amount?t.amount:1],seed:["1f",null!=t.seed?t.seed:0]}}},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(C(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(C(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. This default is the shader\'s; the DOM path that an element of type "copy" takes uses 3 instead.'},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"},animation:{default:!1,unit:"bool",readBy:"element-mapper",summary:'DOM path only. An element of type "copy" is built by the mapper rather than by the shader, and this asks that mapper for animated copies; the shader path ignores it. Declared because the mapper has always read it and the docs have always taught it, while the registry did not list it – so the validator reported a documented, working node as an unknown parameter.'}}},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",g(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",g(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=g(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",g(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),l=1;l<a.length;l++){var c=a[l-1],u=a[l],f=c.x-u.x,h=c.y-u.y,p=Math.hypot(f,h)||1e-4,y=t.seg;p>y&&(u.x+=f*(1-y/p),u.y+=h*(1-y/p)),u.x+=(c.x-u.x)*s,u.y+=(c.y-u.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=d(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 S=new Float32Array(36),O=t.stretch,j=0;j<t.nTrail;j++){var E=a[j];S[3*j]=E.x,S[3*j+1]=E.y,S[3*j+2]=t.trailIdleR[j]+(t.trailMoveR[j]-t.trailIdleR[j])*O}return t.drifters.forEach(function(e,n){var r=t.nTrail+n;S[3*r]=e.x,S[3*r+1]=e.y,S[3*r+2]=e.r*(1+.12*Math.sin(e.phase))}),[{name:"blobs",kind:"3fv",value:S},{name:"count",kind:"1i",value:t.nTrail+t.drifters.length}]}}};function g(t){return[1,3,5].map(function(e){return parseInt(t.slice(e,e+2),16)/255})}var w=Object.keys(b).concat("switch"),x=["px","ratio","deg","count","seconds"];function k(t,e,n){if(!Array.isArray(n)||n.length<2)return!1;var r,o=d(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=b[t],s=a&&a.doc&&a.doc.params&&a.doc.params[e];return!!s&&x.includes(s.unit)}function S(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 O={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)}},j=Object.keys(O);function E(t){return t?"texElementSubImage2D"in t?"sub-image":"texElementImage2D"in t?"image":null:null}function _(t){t.removeAttribute("content"),t.removeAttribute("layoutsubtree"),t.removeAttribute("data-nodality-raster-api")}var A="attribute vec2 a; void main(){ gl_Position = vec4(a, 0.0, 1.0); }",T={warp:["warped"],cell:["center","edge"],displace:["sampleP","chroma"],color:["col","edgeCol","edgeCov","ovCol","ovA"]},C=(["field"].concat(u(Object.keys(T))),"what steers the effect: ".concat(v.join(", "),". "),"easing for this node's local progress: ".concat(j.join(", ")),function(t){return"fld_".concat(String(t).replace(/[^A-Za-z0-9_]/g,""))}),P=function(t){return!0===t.masked?"mask":"string"==typeof t.masked?t.masked:null},R=function(t){return"edge"===t||"edgeCov"===t||"ovA"===t?"float":"col"===t||"edgeCol"===t||"ovCol"===t?"vec3":"vec2"},I={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 M(t,e){var n,r=[],o=d(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=M(i.a,e),a.b=M(i.b,e)),r.push(a)}}}catch(t){o.e(t)}finally{o.f()}return r}function D(t,e){var n,r=d(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=I[t.node.mode]||I.over,o={field:"",warp:"",cell:"",displace:"",color:""},i={field:"",warp:"",cell:"",displace:"",color:""};D(t.a||[],o),D(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=T[t],c=" {\n";a.forEach(function(t,e){c+=" ".concat(R(t)," pre").concat(e," = ").concat(t,";\n")}),c+=o[t],a.forEach(function(t,e){c+=" ".concat(R(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"===R(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=b[r.op];if(!o)return 0;var i="u".concat(t.i,"_"),a=Array.isArray(o.stage)?o.stage:[o.stage],s=P(r);a.forEach(function(t){var n=o.code(i,r,t)+"\n";if(s&&T[t]){var a=T[t],l=a.map(function(t,e){return" ".concat(R(t)," msv").concat(e," = ").concat(t,";")}).join("\n"),c=a.map(function(t,e){return" ".concat(t," = mix(msv").concat(e,", ").concat(t,", ").concat(C(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 F(t,e,n,r){var o=r&&r.fade||"opaque",i=function(t){var e=Number(t);return(Number.isFinite(e)?e:0).toFixed(5)},a=function(t){return t&&t.w>0&&t.h>0?t.h/t.w:0},s=!(!r||"width"!==r.fit),l=r&&Array.isArray(r.crossfade)&&2===r.crossfade.length?r.crossfade:null,c="",f=new Set;e.forEach(function(t){var e=b[t.op];e&&e.producesField&&f.add(t.as||"mask");var n=P(t);n&&f.add(n)});var d=u(f).map(function(t){return" float ".concat(C(t)," = 1.0;")}).join("\n");e.forEach(function(t,e){var n=b[t.op];n&&(c+=n.decl("u".concat(e,"_"),t)+"\n")});var h=function(t){var e=t&&t.node&&t.node.side;if("old"!==e&&"new"!==e)return null;var n=b[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)},p=t.filter(function(t){return!h(t)}),y=t.filter(function(t){return"old"===h(t)}),m=t.filter(function(t){return"new"===h(t)}),v={field:"",warp:"",cell:"",displace:"",color:""};D(p,v);var g=function(t,e){if(!t.length)return"";var n={field:"",warp:"",cell:"",displace:"",color:""};if(D(t,n),!n.color)return"";var r=T.color.filter(function(t){return"col"!==t}).map(function(t){return" ".concat(R(t)," ").concat(t," = ").concat("vec3"===R(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")},w=g(y,"o"),x=g(m,"n"),k=v.field,S=v.warp,O=v.cell,j=v.displace,E=v.color,_=e,A=_.some(function(t){return"edges"===t.op})?"":" col *= 1.0 - edge * 0.55;",I=_.some(function(t){return(b[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;":"",M=n?"uniform vec2 u_probe;\n":"",F=n?"u_probe + vec2(0.5)":"gl_FragCoord.xy";return"\nprecision highp float;\n".concat(r?"#define NOD_TRANSITION 1\n":"","uniform 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(M).concat(c,"\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}\n").concat(s?'// fit: "width" — the capture\'s own height at this box width.\nvec2 nodFitUV(vec4 box, vec2 p, float aspect) {\n return vec2((p.x - box.x) / max(box.z, 1.0),\n 1.0 - (p.y - box.y) / max(box.z * aspect, 1.0));\n}\n':"","vec4 nodSampleAt(vec2 p) {\n").concat(s?" vec2 uo = nodFitUV(u_boxOld, p, ".concat(i(a(r.oldRect)),");\n vec2 un = nodFitUV(u_boxNew, p, ").concat(i(a(r.newRect)),");"):" 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(s?" // Clipped to the travelling box as well, so a tall capture in a\n // short box shows its top rather than spilling below it.\n o.a *= nodInBox(nodBoxUV(u_boxOld, p));\n n.a *= nodInBox(nodBoxUV(u_boxNew, p));\n":"").concat(w).concat(x,"\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, ").concat(l?"smoothstep(".concat(i(l[0]),", ").concat(i(l[1]),", u_t)"):"u_t",", d);\n}"):"","\nvoid main() {\n vec2 fc = ").concat(F,";\n vec2 frag = vec2(fc.x, u_res.y - fc.y);\n").concat(d,"\n").concat(k,"\n vec2 warped = frag;\n").concat(S,"\n vec2 center = warped;\n float edge = 0.0;\n").concat(O,"\n vec2 sampleP = warped;\n vec2 chroma = vec2(0.0);\n").concat(j).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(I,"\n vec3 edgeCol = vec3(1.0);\n float edgeCov = 0.0;\n vec3 ovCol = vec3(0.0);\n float ovA = 0.0;\n").concat(E,"\n").concat(A,"\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 z=/\d(?:vw|vh|vmin|vmax|dvw|dvh|svw|svh|lvw|lvh)\b/i,L=["font-size","line-height","letter-spacing","word-spacing"],N=["color","font-family","font-size","font-weight","font-style","line-height","letter-spacing","text-align","text-transform","text-decoration-color","white-space","word-break"],B=["background-color","background-image","background-size","background-position","background-repeat","background-clip","border-radius","box-shadow","opacity","outline-color"],W=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"]),q=new Map,U=null,H=/@font-face\s*{[^}]*}/gi,G=/font-family\s*:\s*(['"]?)([^;'"]+)\1/i,X=/font-weight\s*:\s*([^;]+)/i,J=/font-style\s*:\s*([^;]+)/i,V=/url\((['"]?)([^)'"]+)\1\)/gi,$=/unicode-range\s*:\s*([^;}]+)/i;function Y(t,e){if(!t)return!0;var n,r=[],o=d(t.split(","));try{for(o.s();!(n=o.n()).done;){var i=n.value,a=/U\+([0-9a-fA-F?]+)(?:-([0-9a-fA-F]+))?/.exec(i.trim());if(a)if(-1!==a[1].indexOf("?"))r.push([parseInt(a[1].replace(/\?/g,"0"),16),parseInt(a[1].replace(/\?/g,"F"),16)]);else{var s=parseInt(a[1],16);r.push([s,a[2]?parseInt(a[2],16):s])}}}catch(t){o.e(t)}finally{o.f()}if(!r.length)return!0;var l,c=d(e);try{for(c.s();!(l=c.n()).done;)for(var u=l.value.codePointAt(0),f=0;f<r.length;f++)if(u>=r[f][0]&&u<=r[f][1])return!0}catch(t){c.e(t)}finally{c.f()}return!1}function Q(t,e){var n,r=[],o=d(t.match(H)||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value,a=G.exec(i);if(a){var s=[],l=void 0;for(V.lastIndex=0;l=V.exec(i);)try{s.push(new URL(l[2],e).href)}catch(t){}s.length&&r.push({family:a[2].trim().toLowerCase(),weight:(X.exec(i)||[,"400"])[1].trim(),style:(J.exec(i)||[,"normal"])[1].trim(),range:($.exec(i)||[,""])[1].trim(),block:i,urls:s})}}}catch(t){o.e(t)}finally{o.f()}return r}function K(){return Z.apply(this,arguments)}function Z(){return(Z=c(a().m(function t(){var e,n,r,o,i,s,l,c,f,d,h,p,y,m,v,b,g;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!U){t.n=1;break}return t.a(2,U);case 1:e=[],n=0,r=Array.from(document.styleSheets||[]);case 2:if(!(n<r.length)){t.n=10;break}o=r[n],i=null;try{i=o.cssRules}catch(t){i=null}if(!i){t.n=3;break}for(s=0,l=Array.from(i);s<l.length;s++)(c=l[s]).constructor&&"CSSFontFaceRule"===c.constructor.name&&e.push.apply(e,u(Q(c.cssText,o.href||location.href)));t.n=9;break;case 3:if(!o.href){t.n=9;break}return t.p=4,t.n=5,fetch(o.href,{mode:"cors"});case 5:if(!(f=t.v).ok){t.n=7;break}return d=e.push,h=e,p=u,y=Q,t.n=6,f.text();case 6:m=t.v,v=o.href,b=y(m,v),g=p(b),d.apply.call(d,h,g);case 7:t.n=9;break;case 8:t.p=8,t.v;case 9:n++,t.n=2;break;case 10:return U=e,t.a(2,e)}},t,null,[[4,8]])}))).apply(this,arguments)}function tt(t){return et.apply(this,arguments)}function et(){return(et=c(a().m(function t(e){var n,r,o,i,s,l,c,u;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!q.has(e)){t.n=1;break}return t.a(2,q.get(e));case 1:return n=null,t.p=2,t.n=3,fetch(e,{mode:"cors"});case 3:if(!(r=t.v).ok){t.n=5;break}return c=Uint8Array,t.n=4,r.arrayBuffer();case 4:for(u=t.v,o=new c(u),i="",s=0;s<o.length;s++)i+=String.fromCharCode(o[s]);l=e.endsWith(".woff2")?"font/woff2":e.endsWith(".woff")?"font/woff":"font/ttf",n="data:".concat(l,";base64,").concat(btoa(i));case 5:t.n=7;break;case 6:t.p=6,t.v,n=null;case 7:return q.set(e,n),t.a(2,n)}},t,null,[[2,6]])}))).apply(this,arguments)}function nt(t){for(var e=new Map,n=0,r=[t].concat(u(t.querySelectorAll("*")));n<r.length;n++){var o=r[n],i=window.getComputedStyle(o),a=(i.fontFamily||"").split(",")[0].trim().replace(/^['"]|['"]$/g,"");if(a){var s="".concat(a.toLowerCase(),"|").concat(i.fontWeight,"|").concat(i.fontStyle);e.has(s)||e.set(s,{family:a.toLowerCase(),weight:i.fontWeight,style:i.fontStyle})}}return Array.from(e.values())}function rt(){return(rt=c(a().m(function t(e){var n,r,o,i,s,l,c,u,f,h,p,y,m,v;return a().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,K();case 1:n=t.v,t.n=3;break;case 2:return t.p=2,t.v,t.a(2,"");case 3:if(n.length){t.n=4;break}return t.a(2,"");case 4:if(r=nt(e),o=e.textContent||"",i=n.filter(function(t){return Y(t.range,o)&&r.some(function(e){return e.family===t.family&&(t.style===e.style||"normal"===t.style)&&(t.weight===String(e.weight)||/\s/.test(t.weight))})}),i.length){t.n=5;break}return t.a(2,"");case 5:s=[],l=d(i),t.p=6,l.s();case 7:if((c=l.n()).done){t.n=18;break}u=c.value,f=null,h=d(u.urls),t.p=8,h.s();case 9:if((p=h.n()).done){t.n=12;break}return y=p.value,t.n=10,tt(y);case 10:if(!(f=t.v)){t.n=11;break}return t.a(3,12);case 11:t.n=9;break;case 12:t.n=14;break;case 13:t.p=13,m=t.v,h.e(m);case 14:return t.p=14,h.f(),t.f(14);case 15:if(f){t.n=16;break}return t.a(3,17);case 16:s.push("@font-face{font-family:'".concat(u.family,"';font-style:").concat(u.style,";")+"font-weight:".concat(u.weight,";src:url(").concat(f,");}"));case 17:t.n=7;break;case 18:t.n=20;break;case 19:t.p=19,v=t.v,l.e(v);case 20:return t.p=20,l.f(),t.f(20);case 21:return t.a(2,s.join(""))}},t,null,[[8,13,14,15],[6,19,20,21],[0,2]])}))).apply(this,arguments)}var ot={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 it(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=ot[t]||t;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return!1;try{return window.matchMedia(e).matches}catch(t){return!1}}function at(t,e){if(!Array.isArray(t))return[];if((e||0)>8)return[];var n,r=[],o=d(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i&&"switch"===i.op){var a,s=d(at((it(i.when)?i.use:i.else)||[],(e||0)+1));try{for(s.s();!(a=s.n()).done;){var l=a.value;r.push(l)}}catch(t){s.e(t)}finally{s.f()}}else r.push(i)}}catch(t){o.e(t)}finally{o.f()}return r}var st=new Set(["IMG","VIDEO","CANVAS","IFRAME","INPUT","EMBED","OBJECT","TEXTAREA","SELECT","BR","HR","AREA","SOURCE","TRACK","WBR"]),lt=["objectFit","objectPosition","borderRadius","imageRendering","filter"],ct=new Set;function ut(){return u(ct)}var ft=["op","masked","live"],dt=!1;function ht(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=at(e,0)).length&&!o)return null;var i=[],a=M(e,i);if(e=i,"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return null;if(st.has(t.tagName)){var s=t.parentElement&&t.parentElement.hasAttribute&&t.parentElement.hasAttribute("data-nodality-raster-host")?t.parentElement:null;if(t=s||function(t){if(!t.parentNode)return null;var e,n={},r=d(lt);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 l=function(){var e=t.getBoundingClientRect();return{width:e.width>=2?e.width:t.scrollWidth||0,height:e.height>=2?e.height:t.scrollHeight||0}},c=l();if(c.width<2||c.height<2)return null;var p=Math.max(1,Math.min(n&&n.resolution?n.resolution:window.devicePixelRatio||1,3)),y=e.some(function(t){return(b[t.op]||{}).overlay}),g=e.length>0&&!o&&e.every(function(t){return(b[t.op]||{}).overlay}),w=!(!o||!0!==o.live),x=!g&&(!o||w)&&!e.some(function(t){return!1===t.live}),j=E("undefined"!=typeof WebGL2RenderingContext&&WebGL2RenderingContext.prototype)||E("undefined"!=typeof WebGLRenderingContext&&WebGLRenderingContext.prototype),T=x&&null!==j;x&&!T&&console.info("[nodality] HTML-in-Canvas API not available - raster ops fall back to snapshot capture.");var C=document.createElement("canvas");T&&function(t,e){"sub-image"===e?t.setAttribute("content","drawable"):t.setAttribute("layoutsubtree","")}(C,j);var R={alpha:!0,premultipliedAlpha:!1},I=C.getContext("webgl2",R)||C.getContext("webgl",R);if(!I)return null;var D="undefined"!=typeof WebGL2RenderingContext&&I instanceof WebGL2RenderingContext,q=D&&e.some(function(t){return(b[t.op]||{}).mips}),U=T?E(I):null;T&&U!==j&&(console.info("[nodality] HTML-in-Canvas upload missing on the created context ("+U+" vs "+j+") - snapshot fallback."),_(C),T=!1),"static"===window.getComputedStyle(t).position&&(t.style.position="relative"),C.width=Math.round(c.width*p),C.height=Math.round(c.height*p),C.setAttribute("data-nodality-raster",T?"live":"snapshot"),T&&C.setAttribute("data-nodality-raster-api",U),console.info("[nodality] raster backend:",T?"html-in-canvas (live, "+U+")":"snapshot");var H={width:c.width,height:c.height},G=t;if(T){var X=document.createElement("div"),J=getComputedStyle(t),V="flex"===J.display||"inline-flex"===J.display,$="grid"===J.display||"inline-grid"===J.display,Y=function(t){return parseFloat(t)||0},Q=Y(J.paddingLeft)+Y(J.paddingRight),K=Y(J.paddingTop)+Y(J.paddingBottom);for(H.width=Math.max(2,c.width-Q),H.height=Math.max(2,c.height-K),X.style.cssText="display:".concat(V||$?J.display:"block",";")+"width:".concat(H.width,"px;height:").concat(H.height,"px;"),$&&(X.style.gridTemplateColumns=J.gridTemplateColumns,X.style.gridTemplateRows=J.gridTemplateRows,X.style.gridTemplateAreas=J.gridTemplateAreas,X.style.gap=J.gap,X.style.alignItems=J.alignItems,X.style.justifyItems=J.justifyItems),V&&(X.style.flexDirection=J.flexDirection,X.style.alignItems=J.alignItems,X.style.justifyContent=J.justifyContent,X.style.gap=J.gap),"sub-image"===U&&X.setAttribute("drawable","");t.firstChild;)X.appendChild(t.firstChild);C.appendChild(X),G=X,C.style.cssText="display:block;width:".concat(H.width,"px;height:").concat(H.height,"px;")}else if(C.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(c.width,"px;height:").concat(c.height,"px;")+"pointer-events:none;z-index:2147483000;",g)C.setAttribute("aria-hidden","true");else{C.setAttribute("role","img");var Z=(t.textContent||"").replace(/\s+/g," ").trim();Z&&C.setAttribute("aria-label",Z.slice(0,300))}t.appendChild(C);var tt=function(t,e){var n=I.createShader(t);if(I.shaderSource(n,e),I.compileShader(n),!I.getShaderParameter(n,I.COMPILE_STATUS))throw new Error("[nodality] raster shader: "+I.getShaderInfoLog(n));return n},et=I.createProgram();I.attachShader(et,tt(I.VERTEX_SHADER,A)),I.attachShader(et,tt(I.FRAGMENT_SHADER,F(a,e,!1,o))),I.bindAttribLocation(et,0,"a"),I.linkProgram(et),I.useProgram(et),I.bindBuffer(I.ARRAY_BUFFER,I.createBuffer()),I.bufferData(I.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),I.STATIC_DRAW),I.enableVertexAttribArray(0),I.vertexAttribPointer(0,2,I.FLOAT,!1,0,0);var nt=function(t){return I.getUniformLocation(et,t)},ot=function(t,e,n){"1f"===e?I.uniform1f(t,n):"1i"===e?I.uniform1i(t,n):"2fv"===e?I.uniform2fv(t,n):"3fv"===e&&I.uniform3fv(t,n)},it=0,ut=e.map(function(t,e){return{node:t,i:e}}).filter(function(t){return function(t){for(var e in t)if(k(t.op,e,t[e]))return!0;return!1}(t.node)}),pt=function(t,n){e.forEach(function(e,r){if(!n||n.has(r)){var o=b[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&&O[t.ease];return o?o(n):n}(t,e):e;for(var o in t)k(t.op,o,t[o])&&((n=n||Object.assign({},t))[o]=S(t[o],r));return n||t}(e,it),p);for(var a in i)ot(t("u".concat(r,"_").concat(a)),i[a][0],i[a][1])}}})};pt(nt);var yt=new Set(ut.map(function(t){return t.i})),mt=[];e.forEach(function(t,e){var n=b[t.op];n&&"function"==typeof n.init&&mt.push({i:e,def:n,state:n.init(t,p,C.width,C.height)})});var vt="undefined"!=typeof performance?performance.now():0,bt=[];e.forEach(function(t,e){var n=b[t.op];if(n&&n.solver){var r=function(t,e){var n=b[t.op];if(!D||!I.getExtension("EXT_color_buffer_float"))return console.info("[nodality] '"+t.op+"' needs WebGL2 float render targets - op skipped."),null;I.getExtension("OES_texture_float_linear");var r=n.solver.resolutions(t,C.width,C.height),o={r:[I.R16F,I.RED],rg:[I.RG16F,I.RG],rgba:[I.RGBA16F,I.RGBA]},i=[],a=function(t,e,n,r){var a=h(o[n],2),s=a[0],l=a[1],c=I.createTexture();I.bindTexture(I.TEXTURE_2D,c);var u=r?I.LINEAR:I.NEAREST;I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,u),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,u),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.texImage2D(I.TEXTURE_2D,0,s,t,e,0,l,I.HALF_FLOAT,null);var f=I.createFramebuffer();I.bindFramebuffer(I.FRAMEBUFFER,f),I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_2D,c,0);var d=I.checkFramebufferStatus(I.FRAMEBUFFER)===I.FRAMEBUFFER_COMPLETE;I.viewport(0,0,t,e),I.clearColor(0,0,0,1),I.clear(I.COLOR_BUFFER_BIT);var p={tex:c,fbo:f,w:t,h:e,ok:d};return i.push(p),p},s={},l=!0;for(var c in n.solver.targets){var u=n.solver.targets[c],f=r[u.res],d=h(Array.isArray(f)?f:[f,f],2),p=d[0],y=d[1];u.double?(s[c]={a:a(p,y,u.fmt,u.smooth),b:a(p,y,u.fmt,u.smooth)},l=l&&s[c].a.ok&&s[c].b.ok):(s[c]={a:a(p,y,u.fmt,u.smooth)},l=l&&s[c].a.ok)}I.bindFramebuffer(I.FRAMEBUFFER,null);var m=function(){return i.forEach(function(t){I.deleteFramebuffer(t.fbo),I.deleteTexture(t.tex)})};if(!l)return console.info("[nodality] '"+t.op+"' float targets incomplete - op skipped."),m(),null;var v={};try{for(var g in n.solver.programs){var w=I.createProgram();if(I.attachShader(w,tt(I.VERTEX_SHADER,A)),I.attachShader(w,tt(I.FRAGMENT_SHADER,n.solver.programs[g])),I.bindAttribLocation(w,0,"a"),I.linkProgram(w),!I.getProgramParameter(w,I.LINK_STATUS))throw new Error(g+": "+I.getProgramInfoLog(w));v[g]={prog:w,loc:{}}}}catch(e){for(var x in console.warn("[nodality] '"+t.op+"' solver programs failed:",e),m(),v)I.deleteProgram(v[x].prog);return null}return I.useProgram(et),{i:e,node:t,def:n,res:r,targets:s,progs:v,cleanup:m,prevX:.5,prevY:.5,primed:!1}}(t,e);r&&bt.push(r)}});var gt=function(t,e){var n=null,r={res:t.res,use:function(e){n=t.progs[e],I.useProgram(n.prog)},u:function(t){return t in n.loc||(n.loc[t]=I.getUniformLocation(n.prog,t)),n.loc[t]},f1:function(t,e){I.uniform1f(r.u(t),e)},f2:function(t,e,n){I.uniform2f(r.u(t),e,n)},f3:function(t,e,n,o){I.uniform3f(r.u(t),e,n,o)},smp:function(t,e,n){I.activeTexture(I.TEXTURE0+n),I.bindTexture(I.TEXTURE_2D,e.tex),I.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:wt},canvasW:C.width,canvasH:C.height,swap:function(e){var n=t.targets[e],r=n.a;n.a=n.b,n.b=r},blit:function(t){I.bindFramebuffer(I.FRAMEBUFFER,t.fbo),I.viewport(0,0,t.w,t.h),I.drawArrays(I.TRIANGLES,0,3)}},o=Bt[0]/C.width,i=1-Bt[1]/C.height,a=0,s=0;t.primed&&Wt&&(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=Wt&&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:C.width/Math.max(C.height,1),col:t.def.solver.splatColor(t.node,a,s)})},wt=I.createTexture();I.bindTexture(I.TEXTURE_2D,wt),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,q?I.LINEAR_MIPMAP_LINEAR:I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL,!0);var xt=function(){q&&I.generateMipmap(I.TEXTURE_2D)},kt=!1,St=null,Ot=null;if(o&&o.oldImage){St=I.createTexture(),I.bindTexture(I.TEXTURE_2D,St),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE);try{I.texImage2D(I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,o.oldImage)}catch(t){console.warn("[nodality] transition: old capture upload failed:",t),I.deleteTexture(St),St=null}}if(o&&o.newImage){Ot=I.createTexture(),I.bindTexture(I.TEXTURE_2D,Ot),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.LINEAR),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE);try{I.texImage2D(I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,o.newImage)}catch(t){console.warn("[nodality] transition: new capture upload failed:",t),I.deleteTexture(Ot),Ot=null}}var jt=!1,Et=T?"live":"snapshot",_t=!1,At={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"},Tt=null,Ct=function(){if(!Tt){!function(){if(!dt&&"undefined"!=typeof document){dt=!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)}}(),Tt=[],t.setAttribute("data-nodality-ink","");for(var e=[t].concat(u(t.querySelectorAll("*"))).filter(function(t){return t!==C&&"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 a in At)i[a]=o.style.getPropertyValue(a);for(var s in Tt.push([o,i]),o.style.setProperty("--nod-ink",n[r]),At)o.style.setProperty(s,At[s],"important");o!==t&&o.matches&&o.matches("img,svg,video,picture,iframe")&&o.style.setProperty("opacity","0","important")}t.style.isolation="isolate",C.style.zIndex="-1"}},Pt=function(){if(t.style.visibility="",t.removeAttribute("data-nodality-ink"),Tt){var e,n=d(Tt);try{for(n.s();!(e=n.n()).done;){var r=h(e.value,2),o=r[0],i=r[1];for(var a in At)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()}Tt=null,t.style.isolation="",C.style.zIndex=""}},Rt=function(){if(!o)return!1;var e=it>=1,n=G!==t,r=o.standDownAtStart&&it<=0,i=e&&!n||r?"hidden":"visible";return C.style.visibility!==i&&(C.style.visibility=i),e||r?Tt&&Pt():Tt||Ct(),!0},It=function(){if(y){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 I.bindTexture(I.TEXTURE_2D,wt),I.texImage2D(I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,e),xt(),kt=!0,Promise.resolve()}catch(t){}else if(!_t){var n="IMG"===t.tagName?t:t.querySelector&&t.querySelector("img");n&&(_t=!0,n.addEventListener("load",function(){jt||It()},{once:!0}))}}C.style.display="none",Pt();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)):function(t){return rt.apply(this,arguments)}(t).catch(function(){return""}).then(function(o){return new Promise(function(i,a){var s=(new XMLSerializer).serializeToString(function(t,e){for(var n=[t].concat(u(t.querySelectorAll("*"))),r=[e].concat(u(e.querySelectorAll("*"))),o=0;o<n.length&&o<r.length;o++){var i=r[o].style;if(i){var a=null;if(i.length>0)for(var s=0,l=Array.from(i);s<l.length;s++){var c=l[s];if(z.test(i.getPropertyValue(c))){var f=(a=a||window.getComputedStyle(n[o])).getPropertyValue(c);f&&i.setProperty(c,f,i.getPropertyPriority(c))}}var h,p=d(L);try{for(p.s();!(h=p.n()).done;){var y=h.value,m=(a=a||window.getComputedStyle(n[o])).getPropertyValue(y);m&&"normal"!==m&&i.setProperty(y,m)}}catch(t){p.e(t)}finally{p.f()}var v,b=window.getComputedStyle(n[o]),g=n[o].parentElement,w=0!==o&&g?window.getComputedStyle(g):null,x=d(N);try{for(x.s();!(v=x.n()).done;){var k=v.value,S=b.getPropertyValue(k);S&&(w&&w.getPropertyValue(k)===S||i.getPropertyValue(k)||i.setProperty(k,S))}}catch(t){x.e(t)}finally{x.f()}var O,j=d(B);try{for(j.s();!(O=j.n()).done;){var E=O.value;if(!i.getPropertyValue(E)){var _=b.getPropertyValue(E);_&&!W.has(_)&&i.setProperty(E,_)}}}catch(t){j.e(t)}finally{j.f()}}}return e}(t,t.cloneNode(!0))),l='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(e,'" height="').concat(n,'" viewBox="0 0 ').concat(e," ").concat(n,'">')+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+(o?"<style>".concat(o,"</style>"):"")+"".concat(s,"</div>")+"</foreignObject></svg>",c=document.createElement("img");c.onload=function(){var t=document.createElement("canvas");t.width=Math.max(1,Math.round(e*r)),t.height=Math.max(1,Math.round(n*r));var o=t.getContext("2d");o?(o.drawImage(c,0,0,t.width,t.height),i(t)):i(c)},c.onerror=a,c.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(l)})})}(t,c.width,c.height,p).then(function(t){jt||(I.bindTexture(I.TEXTURE_2D,wt),I.texImage2D(I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,t),xt(),kt=!0,Rt()||(g||Ct(),C.style.visibility="visible"))}).catch(function(t){Pt(),console.warn("[nodality] raster snapshot failed:",t)});return C.style.display="",r},Mt="",Dt=-1,Ft=function(){if(!jt&&"live"===Et){if(I.bindTexture(I.TEXTURE_2D,wt),"sub-image"===U){try{!function(){var t=C.width+"x"+C.height;if(t!==Mt){var e=C.width,n=C.height;if("function"==typeof C.captureElementImage){var r=C.captureElementImage(G);try{e=Math.ceil(r.width),n=Math.ceil(r.height)}finally{r&&"function"==typeof r.close&&r.close()}}I.texImage2D(I.TEXTURE_2D,0,D?I.RGBA8||32856:I.RGBA,Math.max(1,e),Math.max(1,n),0,I.RGBA,I.UNSIGNED_BYTE,null),Mt=t}}(),I.texElementSubImage2D(I.TEXTURE_2D,0,0,0,G)}catch(t){return Mt="",void zt("texElementSubImage2D failed: "+(t&&t.name?t.name:"?")+": "+(t&&t.message?t.message:t))}return xt(),void(kt=!0)}var t,e=I.RGBA8||32856,n=[[I.TEXTURE_2D,e,G],[I.TEXTURE_2D,0,I.RGBA,I.RGBA,I.UNSIGNED_BYTE,G],[I.TEXTURE_2D,0,e,G],[I.TEXTURE_2D,0,G]];if(Dt>=0)t=[Dt];else{t=[0,1,2,3];var r={3:0,6:1,4:2}[I.texElementImage2D.length];null!=r&&(t.splice(t.indexOf(r),1),t.unshift(r))}var o,i=[],a=d(t);try{for(a.s();!(o=a.n()).done;){var s=o.value;try{return I.texElementImage2D.apply(I,n[s]),xt(),Dt<0&&(Dt=s,console.info("[nodality] texElementImage2D signature discovered: form",s,"(declared arity "+I.texElementImage2D.length+")")),void(kt=!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()}zt("texElementImage2D rejected all known signatures (arity "+I.texElementImage2D.length+"): "+i.join(" | "))}},zt=function(e){if(!jt&&"live"===Et){for(Et="snapshot",console.warn("[nodality] live raster backend failed ("+e+") - falling back to snapshot."),C.removeEventListener("paint",Ft);G.firstChild;)t.appendChild(G.firstChild);G.parentNode===C&&C.removeChild(G),_(C),C.style.cssText="position:absolute;top:0;left:0;"+"width:".concat(c.width,"px;height:").concat(c.height,"px;")+"pointer-events:none;z-index:2147483000;",C.setAttribute("aria-hidden","true"),C.setAttribute("data-nodality-raster","snapshot-fallback"),It()}};if(T){C.addEventListener("paint",Ft);var Lt=function(){return setTimeout(function(){jt||"live"!==Et||kt||zt("no paint event within 1500ms")},1500)};if("undefined"!=typeof document&&"hidden"===document.visibilityState){var Nt=function(){"hidden"!==document.visibilityState&&(document.removeEventListener("visibilitychange",Nt),jt||Lt())};document.addEventListener("visibilitychange",Nt)}else Lt()}var Bt=[.5*C.width,.5*C.height],Wt=!1,qt=function(t){var e=C.getBoundingClientRect(),n=t.touches?t.touches[0]:t,r=[(n.clientX-e.left)*p,(n.clientY-e.top)*p];r[0]===Bt[0]&&r[1]===Bt[1]||(Wt=!0),Bt=r};t.addEventListener("mousemove",qt,{passive:!0}),t.addEventListener("touchmove",qt,{passive:!0});var Ut=0,Ht=0,Gt=function(){Ut=1},Xt=function(){Ut=0};t.addEventListener("mouseenter",Gt,{passive:!0}),t.addEventListener("mouseleave",Xt,{passive:!0});var Jt=[];e.forEach(function(t,e){var n=b[t.op]||{},r=t.by||n.defaultDriver;r&&m[r]?Jt.push({i:e,fn:m[r]}):t.by&&console.warn("[nodality] unknown driver '"+t.by+"' on op '"+t.op+"' - known drivers: "+v.join(", "))});var Vt=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)))},$t=0,Yt=null,Qt=function(t,e){I.uniform2f(t("u_res"),e.res[0],e.res[1]),I.uniform2f(t("u_mouse"),e.mouse[0],e.mouse[1]),I.uniform1f(t("u_time"),e.time),I.uniform1f(t("u_t"),e.t);var n,r=d(e.drivers);try{for(r.s();!(n=r.n()).done;){var i=n.value;I.uniform2f(t("u".concat(i.i,"_dpos")),i.x,i.y),I.uniform1f(t("u".concat(i.i,"_damt")),i.amt)}}catch(t){r.e(t)}finally{r.f()}var a,s=d(e.dyn);try{for(s.s();!(a=s.n()).done;){var l,c=a.value,u=d(c.ups);try{for(u.s();!(l=u.n()).done;){var f=l.value;ot(t("u".concat(c.i,"_").concat(f.name)),f.kind,f.value)}}catch(t){u.e(t)}finally{u.f()}}}catch(t){s.e(t)}finally{s.f()}I.activeTexture(I.TEXTURE0),I.bindTexture(I.TEXTURE_2D,wt),I.uniform1i(t("u_tex"),0);var h=1;if(o&&St){I.activeTexture(I.TEXTURE0+h),I.bindTexture(I.TEXTURE_2D,St),I.uniform1i(t("u_old"),h),h++;var y=e.t,m=function(t,e){return[(t.x+(e.x-t.x)*y)*p,(t.y+(e.y-t.y)*y)*p,(t.w+(e.w-t.w)*y)*p,(t.h+(e.h-t.h)*y)*p]},v=m(o.oldRect,o.oldTo||o.newRect),b=m(o.newFrom||o.oldRect,o.newRect);I.uniform4f(t("u_boxOld"),v[0],v[1],v[2],v[3]),I.uniform4f(t("u_boxNew"),b[0],b[1],b[2],b[3]),Ot&&(I.activeTexture(I.TEXTURE0+h),I.bindTexture(I.TEXTURE_2D,Ot),I.uniform1i(t("u_newimg"),h),h++)}for(var g=0,w=bt;g<w.length;g++){var x=w[g],k=x.def.solver.samplers;for(var S in k)I.activeTexture(I.TEXTURE0+h),I.bindTexture(I.TEXTURE_2D,x.targets[k[S]].a.tex),I.uniform1i(t("u".concat(x.i,"_").concat(S)),h),h++}I.activeTexture(I.TEXTURE0)},Kt=null,Zt=["warp","cell","displace"],te=function(t,n,r){if(jt||!Yt||!kt)return null;var i=C.getBoundingClientRect();if(i.width&&i.height&&(!r||!r.gpu)){var s=C.width/i.width,l=C.height/i.height,c=(t-i.left)*s,u=(n-i.top)*l;if(c>=0&&u>=0&&c<C.width&&u<C.height){var f=Math.floor(c),h=Math.floor(C.height-u),y=function(t,n){if(!Yt)return null;var r,o={},i=d(Yt.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],l=0,c=Zt;l<c.length;l++)for(var u=c[l],f=0;f<e.length;f++){var h=e[f],y=b[h.op];if(y&&(Array.isArray(y.stage)?y.stage:[y.stage]).includes(u)){if(P(h))return null;if("function"!=typeof y.map){if(!1===y.movesCoords)continue;return null}var m=o[f],v=y.map(s,h,{res:Yt.res,dpr:p,dpos:m?[m.x,m.y]:[Yt.res[0]/2,Yt.res[1]/2],damt:m?m.amt:1,time:Yt.time,mouse:Yt.mouse});if(!v)return null;s=v}}return s}(f+.5,C.height-h-.5);if(y)return{x:i.left+Math.min(Math.max(y[0],0),C.width)/s,y:i.top+Math.min(Math.max(y[1],0),C.height)/l}}}var m=function(){if(Kt)return Kt;var t=I.createProgram();if(I.attachShader(t,tt(I.VERTEX_SHADER,A)),I.attachShader(t,tt(I.FRAGMENT_SHADER,F(a,e,!0,o))),I.bindAttribLocation(t,0,"a"),I.linkProgram(t),!I.getProgramParameter(t,I.LINK_STATUS))return console.warn("[nodality] probe program failed:",I.getProgramInfoLog(t)),I.deleteProgram(t),Kt={broken:!0};var n=I.createTexture();I.bindTexture(I.TEXTURE_2D,n),I.texImage2D(I.TEXTURE_2D,0,I.RGBA,1,1,0,I.RGBA,I.UNSIGNED_BYTE,null),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MIN_FILTER,I.NEAREST),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_MAG_FILTER,I.NEAREST),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE);var r=I.createFramebuffer();I.bindFramebuffer(I.FRAMEBUFFER,r),I.framebufferTexture2D(I.FRAMEBUFFER,I.COLOR_ATTACHMENT0,I.TEXTURE_2D,n,0);var i=I.checkFramebufferStatus(I.FRAMEBUFFER);if(I.bindFramebuffer(I.FRAMEBUFFER,null),i!==I.FRAMEBUFFER_COMPLETE)return console.warn("[nodality] probe framebuffer incomplete:",i),I.deleteProgram(t),I.deleteFramebuffer(r),I.deleteTexture(n),Kt={broken:!0};var s={},l=function(e){return e in s?s[e]:s[e]=I.getUniformLocation(t,e)};return I.useProgram(t),pt(l),I.useProgram(et),Kt={prog:t,fbo:r,tex:n,px:new Uint8Array(4),U:l}}();if(m.broken)return null;var v=C.getBoundingClientRect();if(!v.width||!v.height)return null;var g=C.width/v.width,w=C.height/v.height,x=(t-v.left)*g,k=(n-v.top)*w;if(x<0||k<0||x>=C.width||k>=C.height)return null;var S=Math.floor(x),O=Math.floor(C.height-k);I.bindFramebuffer(I.FRAMEBUFFER,m.fbo),I.useProgram(m.prog),I.viewport(0,0,1,1),I.uniform2f(m.U("u_probe"),S,O),Qt(m.U,Yt),I.drawArrays(I.TRIANGLES,0,3),I.readPixels(0,0,1,1,I.RGBA,I.UNSIGNED_BYTE,m.px),I.bindFramebuffer(I.FRAMEBUFFER,null),I.useProgram(et),I.viewport(0,0,C.width,C.height);var j=m.px,E=(j[0]+j[1]/255)/255,_=(j[2]+j[3]/255)/255;return{x:v.left+E*C.width/g,y:v.top+_*C.height/w}},ee="__nodalityRetargeted",ne=!e.some(function(t){return!1===t.interactive}),re="data-nodality-hover",oe=e.some(function(t){return!0===t.hoverAttr}),ie=[],ae=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=ie;i<a.length;i++){var s=a[i];o.has(s)||s.removeAttribute(re)}for(var l=0,c=n;l<c.length;l++){var u=c[l];u.hasAttribute(re)||u.setAttribute(re,"")}ie=n},se=0,le=function(e){if(ne&&!jt&&!e[ee]){if("pointermove"===e.type||"mousemove"===e.type){var n="undefined"!=typeof performance?performance.now():0;if(n-se<12)return;se=n}var r=te(e.clientX,e.clientY);if(r){var o=G!==t;if(!(!o&&Math.abs(r.x-e.clientX)<.5&&Math.abs(r.y-e.clientY)<.5)){var i=o?function(t,e){var n=null,r=function(o){var i,a=d(o.children);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=s.getBoundingClientRect();l.width&&l.height&&(t<l.left||t>l.right||e<l.top||e>l.bottom||(n=s,r(s)))}}catch(t){a.e(t)}finally{a.f()}};return r(G),n}(r.x,r.y):"function"==typeof document.elementFromPoint?document.elementFromPoint(r.x,r.y):null;if(i&&i!==e.target&&t.contains(i)){if(oe&&ae(i),"pointerdown"===e.type||"mousedown"===e.type||"click"===e.type){var a=i.closest&&i.closest("a, button, input, select, textarea, [tabindex]");a&&"function"==typeof a.focus&&a.focus({preventScroll:!0})}e.stopPropagation(),e.cancelable&&e.preventDefault(),i.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[ee]=!0,r}(e,r.x,r.y))}}}}},ce=["pointerdown","pointerup","pointermove","click","dblclick","contextmenu","mousedown","mouseup"],ue=function(){oe&&ae(null)};if(ne){var fe,de=d(ce);try{for(de.s();!(fe=de.n()).done;){var he=fe.value;t.addEventListener(he,le,!0)}}catch(t){de.e(t)}finally{de.f()}t.addEventListener("pointerleave",ue,!0)}var pe=!0,ye=function(){if(!jt){if(Rt(),pe&&kt){for(var t="undefined"!=typeof performance?performance.now():vt+16,e=Math.max(0,(t-vt)/1e3),n=0,r=bt;n<r.length;n++){var o=r[n];gt(o,e)}Wt=!1,I.bindFramebuffer(I.FRAMEBUFFER,null),I.useProgram(et),I.viewport(0,0,C.width,C.height),I.clearColor(0,0,0,0),I.clear(I.COLOR_BUFFER_BIT);var i={res:[C.width,C.height],mouse:[Bt[0],Bt[1]],time:t/1e3,t:it,drivers:[],dyn:[]};if(Jt.length>0){Ht+=(Ut-Ht)*(1-Math.exp(8*-e));for(var a={mouseX:Bt[0],mouseY:Bt[1],w:C.width,h:C.height,t:t/1e3,hover:Ht,scroll:Vt()},s=0,l=Jt;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(mt.length>0)for(var f={w:C.width,h:C.height,mouseX:Bt[0],mouseY:Bt[1],dt:e,t:t/1e3},d=0,h=mt;d<h.length;d++){var p=h[d];i.dyn.push({i:p.i,ups:p.def.tick(p.state,f)})}Yt=i,Qt(nt,i),vt=t,I.drawArrays(I.TRIANGLES,0,3)}$t=requestAnimationFrame(ye)}},me=null;"undefined"!=typeof IntersectionObserver&&(me=new IntersectionObserver(function(t){var e=h(t,1)[0];pe=e.isIntersecting})).observe(t);var ve=null,be=0,ge=function(){if(!jt){var t=l();if(!(t.width<2||t.height<2)){var e=Math.round(t.width*p),n=Math.round(t.height*p);c.width=t.width,c.height=t.height,C.style.width=t.width+"px",C.style.height=t.height+"px";var r=C.width!==e||C.height!==n;r&&(C.width=e,C.height=n),"snapshot"===Et?It():r&&Ft()}}};"undefined"!=typeof ResizeObserver&&(ve=new ResizeObserver(function(){"live"!==Et&&(function(){if(!jt){var t=l();t.width<2||t.height<2||Math.round(t.width)===Math.round(c.width)&&Math.round(t.height)===Math.round(c.height)||(c.width=t.width,c.height=t.height,C.style.width=t.width+"px",C.style.height=t.height+"px")}}(),clearTimeout(be),be=setTimeout(ge,150))})).observe(t);var we=0,xe=function(){clearTimeout(we),we=setTimeout(function(){if(!jt)if("snapshot"!==Et){var e=t.clientWidth||t.parentElement&&t.parentElement.clientWidth||c.width;C.style.width=e+"px",setTimeout(function(){if(!jt&&"live"===Et){var t=Math.max(2,Math.round(G.getBoundingClientRect().height))||c.height;c.width=e,c.height=t,C.style.height=t+"px",C.width=Math.round(e*p),C.height=Math.round(t*p),Ft()}},50)}else ge()},150)};"undefined"!=typeof window&&window.addEventListener("resize",xe),"live"===Et?$t=requestAnimationFrame(ye):(It().then(function(){$t=requestAnimationFrame(ye)}),"undefined"!=typeof document&&document.fonts&&"object"===f(document.fonts.ready)&&Promise.resolve(document.fonts.ready).then(ge).catch(function(){}));var ke=function(e,n,r,o,i){"function"==typeof CustomEvent&&"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("nodality:raster-param",{detail:{pipeline:Se,el:t,index:e,key:n,value:r,prev:o,how:i}}))},Se={canvas:C,nodes:e,get backend(){return Et},sourceAt:function(t,e,n){return te(t,e,n)},get progress(){return it},setProgress:function(t){var e=Math.min(1,Math.max(0,Number(t)||0));return e===it||(it=e,ut.length&&(I.useProgram(et),pt(nt,yt),Kt&&!Kt.broken&&(I.useProgram(Kt.prog),pt(Kt.U,yt),I.useProgram(et))),Rt()),it},setParam:function(t,n,r){var o=e[t];if(!o||jt)return!1;var i=o[n];if(o[n]=r,function(t,e,n,r){if(ft.includes(e))return!0;var o=b[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"!=f(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==f(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 Se.rebuild(),ke(t,n,r,i,"rebuild"),"rebuild";var a=b[o.op];if(a&&a.uniforms){var s=a.uniforms(o,p);for(var l in I.useProgram(et),s)ot(nt("u".concat(t,"_").concat(l)),s[l][0],s[l][1]);if(Kt&&!Kt.broken){for(var c in I.useProgram(Kt.prog),s)ot(Kt.U("u".concat(t,"_").concat(c)),s[c][0],s[c][1]);I.useProgram(et)}}return ke(t,n,r,i,"uniform"),"uniform"},rebuild:function(){if(jt)return null;var e=t;return Se.destroy(),ht(e,r)}};return ct.add(Se),Object.assign(Se,{refresh:function(){return"live"===Et?Ft():It()},destroy:function(){ct.delete(Se),jt=!0,cancelAnimationFrame($t),clearTimeout(be),clearTimeout(we),me&&me.disconnect(),ve&&ve.disconnect(),"undefined"!=typeof window&&window.removeEventListener("resize",xe),t.removeEventListener("mousemove",qt),t.removeEventListener("touchmove",qt);for(var e=0,n=ce;e<n.length;e++){var r=n[e];t.removeEventListener(r,le,!0)}t.removeEventListener("pointerleave",ue,!0),ae(null),t.removeEventListener("mouseenter",Gt),t.removeEventListener("mouseleave",Xt),C.removeEventListener("paint",Ft);for(var o=0,i=bt;o<i.length;o++){var a=i[o];for(var s in a.cleanup(),a.progs)I.deleteProgram(a.progs[s].prog)}for(bt.length=0,Kt&&!Kt.broken&&(I.deleteProgram(Kt.prog),I.deleteFramebuffer(Kt.fbo),I.deleteTexture(Kt.tex)),Kt=null,St&&(I.deleteTexture(St),St=null),Ot&&(I.deleteTexture(Ot),Ot=null);G!==t&&G.firstChild;)t.appendChild(G.firstChild);Pt(),t.style.visibility="";try{var l=I.getExtension("WEBGL_lose_context");l&&l.loseContext()}catch(t){}C.remove()}})}function pt(){return new RegExp('"([A-Za-z_$][A-Za-z0-9_$]*)"\\s*:',"g")}function yt(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(pt(),"$1:")}function mt(t){return JSON.stringify(String(t))}function vt(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)||gt(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 bt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=gt(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 gt(t,e){if(t){if("string"==typeof t)return wt(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)?wt(t,e):void 0}}function wt(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 xt(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,kt(r.key),r)}}function kt(t){var e=function(t){if("object"!=St(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=St(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==St(e)?e:e+""}function St(t){return St="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},St(t)}var Ot=new Set,jt={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",alignContent:"alignContent",alignItems:"alignItems",justifyContent:"justifyContent",justifyItems:"justifyItems",justifySelf:"justifySelf",aspectRatio:"aspectRatio",borderTop:"borderTop",borderRight:"borderRight",borderBottom:"borderBottom",borderLeft:"borderLeft",textDecoration:"textDecoration",objectFit:"objectFit",objectPosition:"objectPosition",weight:"fontWeight",colorScheme:"colorScheme"},Et=new Set(["radius","width","height","maxWidth","maxHeight","minWidth","minHeight","top","left","right","bottom","gap"]),_t=function(t){return!0===t||"hand"===t?"pointer":t};function At(t,e){if(!e||!t)return t;var n=document.createElement("a");return n.setAttribute("href",e),n.style.display="flex",n.style.alignItems="center",n.style.textDecoration="none",n.style.color="inherit",n.appendChild(t),n}function Tt(t){var e={};if(!t||"object"!==St(t))return e;for(var n in jt)null!=t[n]&&(e[n]=t[n]);return e}var Ct=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;if(t.transform||(e=t.op),!e||!Array.isArray(e.values))return void console.warn('[nodality] reactOnTransform: a transform node needs a `values` array, e.g. ["ty:-20px"] - ignored');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=kt(n="reactOnTransform"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,t._owner&&t._owner.push(this),this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1};var a=this.set;if("function"==typeof a&&!a.__appliesId){var s=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=a.call.apply(a,[this,t].concat(n)),i=t&&t.id,s=this.res;return null!=i&&""!==i&&s&&"function"==typeof s.setAttribute&&!s.getAttribute("id")&&s.setAttribute("id",String(i)),t&&t.loop&&"object"===St(t.loop)&&this.loop(t.loop),o};s.__appliesId=!0,this.set=s}var l="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__;if(l&&!l.inDes&&"function"==typeof l.sourceOf){try{this.__nodSrc=l.sourceOf((new Error).stack)}catch(e){}if(this.__nodSrc){var c=this.set,u=this.__nodSrc;this.set=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=c.call.apply(c,[this,t].concat(n)),i=this.res;return i&&"function"==typeof i.setAttribute&&!i.hasAttribute("data-nod-src")&&i.setAttribute("data-nod-src",u),o},this.set.__appliesId=!0}}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=ht(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"===St(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=bt(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"!==St(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:"applyStyleOptions",value:function(t){if(!t||!this.res)return this;for(var e in jt)if(null!=t[e]){var n="number"==typeof t[e]&&0!==t[e]&&Et.has(e)?"".concat(t[e],"px"):"cursor"===e?_t(t[e]):t[e];this.res.style[jt[e]]=n}return this}},{key:"commonMethods",value:function(t){return this.applyStyleOptions(t),"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"===St(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&&t._responsiveTasks.forEach(function(t){t()})};this._responsiveHandler||(this._responsiveHandler=e,this._on(window,"resize",e));var n=setTimeout(function(){e()},0);this._track(function(){return clearTimeout(n)})}},{key:"resprop",value:function(e,n){var r=this;n&&"object"===St(n)?this.options=n:this.options&&"object"===St(this.options)||(this.options={});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"};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 s=e.find(function(t){return"default"===t.breakpoint});s||(s={breakpoint:"default",range:o.default},e.unshift(s));var l=new Set;e.forEach(function(t){Object.keys(t).forEach(function(t){i.includes(t)||"range"===t||l.add(t)})});var c=new Map;l.forEach(function(t){void 0===s[t]&&(null==r.options[t]?"keySet"!==t&&c.set(t,void 0):s[t]=r.options[t])});var u=function(t){return"exact"===t?"fontSize":a[t]||t},f=function(t,e){var n=null==e?"":e;r.res.style[t]!==String(n)&&(r.res.style[t]=n)};this._responsiveTasks=this._responsiveTasks||[],this._responsiveTasks.push(function(){var n,o=bt(c);try{for(o.s();!(n=o.n()).done;){var i=vt(n.value,2),d=i[0];if(void 0===i[1]){var h=r.res.style[u(d)];c.set(d,"string"==typeof h?h:"")}}}catch(t){o.e(t)}finally{o.f()}for(var p=t.viewportWidth(),y=s,m=0;m<e.length;m++){var v=e[m],b=vt(v.range,2),g=b[0],w=b[1];if("default"!==v.breakpoint&&Math.floor(p)>=g&&Math.floor(p)<=w){y=v;break}}l.forEach(function(t){var e=y!==s&&t in y,n=e?y[t]:c.has(t)?c.get(t):s[t];"keySet"!==t?"exact"!==t?e&&"function"==typeof r[t]?r[t](n):f(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}(t),n):f("fontSize",n):n&&n.key&&f(n.key,n.value)})}),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=vt(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&Math.floor(r)>=c&&Math.floor(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=vt(s.range,2),c=l[0],u=l[1];if("default"!==s.breakpoint&&Math.floor(r)>=c&&Math.floor(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:"loop",value:function(t){var e=this.res,n=t&&"object"===St(t)?t:{},r=Array.isArray(n.keyframes)?n.keyframes.filter(function(t){return t&&"object"===St(t)}):[];return!e||r.length<2?(r.length<2&&console.warn("nodality: loop needs at least two keyframes"),this):(this._loop&&"function"==typeof this._loop.cancel&&this._loop.cancel(),this._loop=null,"undefined"==typeof window||"function"!=typeof e.animate||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||(this._loop=e.animate(r,{duration:Number(n.duration)>0?Number(n.duration):1e4,easing:n.easing||"linear",direction:n.direction||"normal",delay:Number(n.delay)||0,iterations:1/0})),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){var n="nodality: `".concat(t,"` is deprecated — use `").concat(e,"` instead.");return Ot.has(n)||(Ot.add(n),console.error(n)),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 t&&null!=t.col&&(this.res.style.gridColumn=t.col),t&&null!=t.row&&(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,s=bt(e);try{for(s.s();!(i=s.n()).done;){var l=i.value;l.range||(l.range=["0px","999999px"])}}catch(t){s.e(t)}finally{s.f()}e.sort(function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])});var c=function(i){var s=t.viewportWidth(),l=[],c=[];o.resCopy=o.res,o.storedQueries=e.map(function(t){return t.target}).filter(function(t){return null!=t});var u,f=bt(e);try{for(f.s();!(u=f.n()).done;){var d=u.value;o.counterIndex++;var h=vt(d.range,2),p=h[0],y=h[1],m=parseInt(p),v=parseInt(y),b=!0;if(d.target){b=!1;for(var g=0;g<d.target.length;g++){var w=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):t};w(d.target[g])===w(n)&&(b=!0)}}s>=m&&s<=v&&b&&(l.push(d.log),c.push(d),d.op&&d.op.margin&&(o.useMargin=d.op.margin))}}catch(t){f.e(t)}finally{f.f()}var x=c.map(function(t){return e.indexOf(t)}).join(",");if(x!==a){if(a=x,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),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(o.res.style.position="relative"),l.includes("blast")){var k,S=c.filter(function(t){return"blast"===t.log})[0].op.color,O=null!==(k=c.filter(function(t){return"blast"===t.log})[0].op.width)&&void 0!==k?k:"1px";"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()?(o.res.style.border="".concat("number"==typeof O?O+"px":O," 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"]=S,o.res.style["-webkit-text-stroke-width"]="".concat(O))}if(l.includes("filter")){var j=c.filter(function(t){return"filter"===t.log})[0].op.filter;o.res.style.filter=j}if(l.includes("background")&&(o.res.style.backgroundColor="green"),l.includes("gradient")&&o.globalGradient&&("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")),l.includes("shadow")){var E,_,A,T,C=o.options.shadow.op,P=null!==(E=C.steps)&&void 0!==E?E:1,R=null!==(_=C.colors)&&void 0!==_?_:["gray"],I=null!==(A=C.movements)&&void 0!==A?A:["3px","3px"],M=null!==(T=C.radius)&&void 0!==T?T:"3px";if(1===I.length&&(I=[I[0],I[0]]),"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()){for(var D=[],F=0;F<P;F++){var z,L=null!==(z=R[F])&&void 0!==z?z:R[0],N=I[0],B=I[1];D.push("".concat(N," ").concat(B," ").concat(M," ").concat(L))}o.res.style.boxShadow=D.join(", ")}else{for(var W=[],q=0;q<P;q++){var U,H=null!==(U=R[q])&&void 0!==U?U:R[0],G=I[0],X=I[1];W.push("drop-shadow(".concat(G," ").concat(X," ").concat(M," ").concat(H,")"))}o.res.style.filter=W.join(" ")}}if(l.includes("margin"))for(g=0;g<e.length;g++)if(e[g].op){var J=e[g].op.offsets;J&&void 0!==o.index&&(o.res.style.margin=J[Number(o.index)]+"px")}if(l.includes("spana")||l.includes("span")){var V=document.createElement("div");if(V.setAttribute("id","oroa"),Object.assign(V.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._spanParts?o._spanParts.splice(0).forEach(function(t){return t.destroy()}):(o._spanParts=[],o._track(function(){return o._spanParts.splice(0).forEach(function(t){return t.destroy()})}));var $=function(t,e,n){var r=new o.constructor(t);return o._spanParts.push(r),r.setup(e).set(n).render()};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($(s,{type:"span",id:i.id,animation:i.animation},{}))}e=a+r.length}var l=$(r,{type:"span",id:i.id,animation:i.animation},i);o.res.appendChild(l)}),e<n.length){var r=n.substring(e);o.res.appendChild($(r,{type:"span"},{}))}}})}else o.rebuildText(i);if(l.includes("animation")){if(o.options.animation&&!o.hasAnimated&&!o.options.animation.op.fireAt){o.hasAnimated=!0;var Y=o.options.animation.op;o._on(window,"sidebar:open",function(){o.res.animate(Y.keyframesOpen,Y.openOptions)}),o._on(window,"sidebar:closed",function(){o.res.animate(Y.keyframesClose,Y.closeOptions)}),o.res.animate(Y.keyframesClose,{duration:0,fill:"forwards"}),o.openTag&&o.closeTag&&(o._on(window,o.openTag,function(){o.res.animate(Y.keyframesOpen,Y.openOptions)}),o._on(window,o.closeTag,function(){o.res.animate(Y.keyframesClose,Y.closeOptions)}))}if(o.options.animation&&o.options.animation.op.fireAt&&o.options.animation.op.fireAt.endsWith("px")){var Q=o.options.animation.op;o.res.animate(Q.keyframesClose,{duration:0,fill:"forwards"});var K=function(){window.scrollY>parseFloat(Q.fireAt)&&(o.res.animate(Q.keyframesOpen,Q.openOptions),window.removeEventListener("scroll",K))};o._on(window,"scroll",K)}if(o.options.animation&&"inview"===o.options.animation.op.fireAt){var Z=o.options.animation.op;o.res.animate(Z.keyframesClose,{duration:0,fill:"forwards"});var tt=!1,et=new IntersectionObserver(function(t,e){t.forEach(function(t){t.isIntersecting&&!tt&&(tt=!0,o.res.animate(Z.keyframesOpen,Z.openOptions),e.disconnect())})});et.observe(o.res),o._track(function(){return et.disconnect()})}}}};this.options.animation||this._on(window,"resize",function(){return c()}),c()}},{key:"rebuildText",value:function(t){}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(pt(),"$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&&xt(e.prototype,n),r&&xt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();function Pt(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}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 It(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,Mt(r.key),r)}}function Mt(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 Dt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Dt=function(){return!!t})()}function Ft(t){return Ft=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ft(t)}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}var Lt=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=Ft(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,Dt()?Reflect.construct(e,n||[],Ft(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,t.oldLength=0,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&&zt(t,e)}(e,t),n=e,r=[{key:"observe",value:function(t){return this.initialState=t,this.Proxima(t)}},{key:"Proxima",value:function(t){var e=this;return new Proxy(t,{set:function(t,n,r){return t[n]=r,e.initialState&&e.initialState.data&&"function"==typeof e.initialState.data.push&&e.initialState.data.push(n),"length"!==n&&e.refreshUI("Added"),!0},has:function(t,n){return"length"!==n&&e.refreshUI("Deleted"),Reflect.has(t,n)}})}},{key:"refreshUI",value:function(t){var e=this.initialState;this.adjustState(e)}},{key:"loadState",value:function(t,e){return this.loadEl=e,this.initialState=t,this.observe(this.state.data)}},{key:"adjustState",value:function(t){document.querySelector(this.loadEl);var e=t[t.length-1],n=document.createElement("p"),r=document.createTextNode(e);n.appendChild(r),document.body.appendChild(n)}},{key:"mount",value:function(t){this.res=t,this.render(t).render(t)}},{key:"toCode",value:function(){return[""]}}],r&&It(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Nt(t){return Nt="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},Nt(t)}function Bt(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 Wt(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,qt(r.key),r)}}function qt(t){var e=function(t){if("object"!=Nt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nt(e)?e:e+""}function Ut(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ut=function(){return!!t})()}function Ht(t,e,n,r){var o=Gt(Xt(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function Gt(){return Gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Xt(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}},Gt.apply(null,arguments)}function Xt(t){return Xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xt(t)}function Jt(t,e){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Jt(t,e)}var Vt=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=Xt(e),function(t,e){if(e&&("object"==Nt(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,Ut()?Reflect.construct(e,n||[],Xt(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(mt(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&&Jt(t,e)}(e,t),n=e,r=[{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=yt(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 Bt(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)?Bt(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(mt(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:"rebuildText",value:function(t){if(t&&this.prevText&&this.prevText.length>0){var e=new this.constructor(this.prevText);this.res.appendChild(e.set({}).render()),this._track(function(){return e.destroy()})}}},{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(pt(),"$1:")}},{key:"looksLikeMarkdown",value:function(t){return/(\*\*.*\*\*|\*.*\*|`[^`]+`|\[.*?\]\(.*?\)|^# )/m.test(t)}},{key:"parseMarkdown",value:function(t){var e=String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");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(/\*\*(?=\S)(.+?)(?<=\S)\*\*/g,"<strong>$1</strong>")).replace(/\*(?=\S)([^*\n]+?)(?<=\S)\*/g,"<em>$1</em>")).replace(/`([^`]+)`/g,"<code>$1</code>")).replace(/\[([^\]]+)\]\(([^)]+)\)/g,function(t,e,n){var r=n.replace(/[\u0000-\u0020]/g,""),o=/^([a-z][a-z0-9+.-]*):/i.exec(r);return!o||/^(https?|mailto|tel)$/i.test(o[1])?'<a href="'.concat(r,'">').concat(e,"</a>"):e})).replace(/\n/g,"<br>")}},{key:"set",value:function(t){if(this.resCopy=this.res,this.options=t,Ht(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.gpos&&this.gpos(t.gpos),t.vtn&&(this.res.style.viewTransitionName=t.vtn),t.index&&Ht(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.preffersId&&(this.preffersId=t.preffersId),Ht(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),Ht(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),Ht(e,"setClass",this,3)([this.options.class]),t.clampc&&this.clampCopy(t.clampc),null!=t.exact&&(this.res.style.fontSize=t.exact),t.absolute&&(this.res.style.position="absolute"),t.em&&this.em(t.em),t.fluid&&this.fluid(t.fluid),t.tag&&/^(h[1-6]|p)$/.test(String(t.tag))){var n=String(t.tag).toLowerCase();if(this.res&&this.res.tagName.toLowerCase()!==n){for(var r=document.createElement(n),o=0,i=Array.from(this.res.attributes);o<i.length;o++){var a=i[o];r.setAttribute(a.name,a.value)}for(;this.res.firstChild;)r.appendChild(this.res.firstChild);this.res=r}}return 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"===Nt(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&&Ht(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),e.setAttribute("alt",void 0===t.alt?"":String(t.alt)),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(),this._on(window,"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(),this._on(window,"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(),this._on(window,"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(),this._on(window,"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(),this._on(window,"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(),this._on(window,"resize",n),this}},{key:"setup",value:function(t){var e;t?(e=document.createElement(t.type),void 0!==t.id&&null!==t.id&&e.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(),this._on(window,"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&&Wt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function $t(t){return $t="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},$t(t)}function Yt(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}}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 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,Zt(r.key),r)}}function Zt(t){var e=function(t){if("object"!=$t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$t(e)?e:e+""}function te(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(te=function(){return!!t})()}function ee(t,e,n,r){var o=ne(re(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function ne(){return ne="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=re(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}},ne.apply(null,arguments)}function re(t){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},re(t)}function oe(t,e){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oe(t,e)}var ie=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=re(e),function(t,e){if(e&&("object"==$t(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,te()?Reflect.construct(e,n||[],re(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&&oe(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(mt(this.url),', "exact")');this.code.push(r)}else if("uncover"===e){var o="new Image(".concat(mt(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="pointer",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)||Yt(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(),"IMG"===this.res.tagName?t.url&&this.res.setAttribute("src",t.url):void 0!==t.alt&&(this.res.setAttribute("role","img"),this.res.setAttribute("aria-label",t.alt)),"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(mt(t.id),", \n")),this.id=t.id,"exact"===o?"new Image(".concat(mt(this.url),', "exact")'):"uncover"===o&&"new Image(".concat(mt(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&&ee(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.index&&(n+="\n index: ".concat(mt(t.index),",")),t.resprop&&this.resprop(t.resprop,t),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(mt(t.objectFit),",")),t.objectPosition&&(this.res.style.objectPosition=t.objectPosition),t.objectPosition&&(n+="\n objectPosition: ".concat(mt(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.gpos(t.gpos),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(mt(t.zIndex),", \n")),t.area&&this.setArea(t.area),t.area&&(n+="area: ".concat(mt(t.area),", \n")),t.opacity&&(this.res.style.opacity=t.opacity),t.width&&(this.res.style.width=t.width),t.width&&(n+="width: ".concat(mt(t.width),", ")),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.maxWidth&&(n+="maxWidth: ".concat(mt(t.maxWidth),", ")),t.height&&(this.res.style.height=t.height),t.height&&(n+="height: ".concat(mt(t.height),", ")),t.maxWidth&&this.maxWidth(t.maxWidth),t.maxWidth&&(n+="maxWidth: ".concat(mt(t.maxWidth),", \n")),t.radius&&this.cornerRadius(t.radius),t.radius&&(n+="radius: ".concat(mt(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(mt(t.clipPath),", \n")),t.reveal&&this.reveal(t.reveal),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&&ee(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 null!=t&&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%",null!=this.url&&""!==this.url&&(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._declared=this._declared||{},this._declared.height=!0,this.res.style.height=t,this.declaresDimension("width")||(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(),this._on(window,"resize",n),this}},{key:"width",value:function(t){return this._declared=this._declared||{},this._declared.width=!0,this.res.style.width=t,this.declaresDimension("height")||(this.res.style.height="auto"),this}},{key:"declaresDimension",value:function(t){if(this._declared&&this._declared[t])return!0;var e=this.options||{};return null!=e[t]&&""!==e[t]||(Array.isArray(e.keySet)?e.keySet:e.keySet?[e.keySet]:[]).some(function(e){return e&&e.key===t})}},{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:"reveal",value:function(t){var e,n,r,o,i,a,s,l=this.res,c=t&&"object"===$t(t)?t:{},u=null!==(e=c.mask)&&void 0!==e?e:"square";if("square"!==u)return console.warn('nodality: img.reveal mask "'.concat(u,'" is not supported — use "square".')),this;if("undefined"==typeof window||"function"!=typeof window.IntersectionObserver)return this;if("function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return this;var f=Math.min(1,Math.max(0,Number(null!==(n=c.size)&&void 0!==n?n:.3))),d=null!==(r=c.duration)&&void 0!==r?r:"1.2s",h=null!==(o=c.easing)&&void 0!==o?o:"cubic-bezier(0.76, 0, 0.24, 1)",p=null!==(i=c.delay)&&void 0!==i?i:"0s",y=Number(null!==(a=c.zoom)&&void 0!==a?a:1.12),m=!1!==c.once,v=["clip-path","scale"].map(function(t){return"".concat(t," ").concat(d," ").concat(h," ").concat(p)}).join(", "),b=!1,g=function(){var t=l.clientWidth,e=l.clientHeight;if(!t||!e)return"inset(".concat(50*(1-f),"% ").concat(50*(1-f),"%)");var n=Math.min(t,e)*f;return"inset(".concat((e-n)/2,"px ").concat((t-n)/2,"px)")};l.style.clipPath=g(),l.style.scale=String(y),l.style.willChange="clip-path, scale",l.style.transition=v;var w="function"==typeof window.ResizeObserver?new window.ResizeObserver(function(){b||(l.style.transition="none",l.style.clipPath=g(),l.offsetWidth,l.style.transition=v)}):null;w&&w.observe(l);var x=Math.min(.9,Math.max(0,Number(null!==(s=c.offset)&&void 0!==s?s:.2))),k=new window.IntersectionObserver(function(t){var e,n=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Yt(t))){e&&(t=e);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.isIntersecting&&!b?(b=!0,l.style.clipPath="inset(0px 0px)",l.style.scale="1",m&&(k.disconnect(),w&&w.disconnect())):r.isIntersecting||!b||m||(b=!1,l.style.clipPath=g(),l.style.scale=String(y))}}catch(t){n.e(t)}finally{n.f()}},{threshold:0,rootMargin:"0px 0px ".concat(100*-x,"% 0px")});return k.observe(l),l.addEventListener("transitionend",function(){b&&m&&(l.style.willChange="auto")}),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&&Kt(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function ae(t){return ae="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},ae(t)}function se(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 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"!=ae(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ae(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,e,n,r){var o=de(he(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof o?function(t){return o.apply(n,t)}:o}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=he(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 he(t){return he=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},he(t)}function pe(t,e){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pe(t,e)}var ye=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=he(e),function(t,e){if(e&&("object"==ae(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||[],he(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&&pe(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=yt(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 se(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)?se(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(pt(),"$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&&fe(e,"setTags",this,3)([t.tags]),t.id&&this.res.setAttribute("id",t.id),t.id&&fe(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&&fe(e,"setClass",this,3)([t.class]),t.class&&(n+="\n class: ".concat(mt(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));fe(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(mt(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(mt(t.fluidc),",")),t.clampc&&this.clampCopy(t.clampc),this.options.id&&(n+="\n id: ".concat(mt(this.options.id),",")),t.align&&this.leftAlign(t.align),t.align&&(n+="\n align: ".concat(mt(t.align),",")),t.type&&(this.res.style.display="block"),t.color&&this.color(t.color),t.color&&(n+="\n color: ".concat(mt(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(mt(t.radius),",")),t.width&&(n+="\n width: ".concat(mt(t.width),",")),t.maxWidth&&this.maxWidth(t.maxWidth),t.url&&this.res.setAttribute("href",t.url),n+="\n url: ".concat(mt(t.url),","),t.text&&(this.res.textContent=t.text),n+="\n text: ".concat(mt(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.radius("0.5rem"),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&&fe(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 S=[];t.borderObj&&S.push("border"),t.background&&S.push("background"),t.mar&&S.push("margin"),t.animation&&S.push("animation"),this.chainReact(w,t.id,S,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(),this._on(window,"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(),this._on(window,"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}}])&&le(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function me(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 ve(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)?ve(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 ve(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 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 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,we(r.key),r)}}function we(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 ke(){return ke="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Se(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}},ke.apply(null,arguments)}function Se(t){return Se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Se(t)}function Oe(t,e){return Oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Oe(t,e)}var je=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=Se(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||[],Se(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&&Oe(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"===be(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=ke(Se(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(),this._on(window,"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=me(n[e],2),o=r[0],i=r[1];null!=i&&""!==i&&(t[o]=i)}var a=yt(t,4),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",this._on(window,"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&&ge(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Ee(t){return Ee="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},Ee(t)}function _e(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,Ae(r.key),r)}}function Ae(t){var e=function(t){if("object"!=Ee(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ee(e)?e:e+""}var Te=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}}])&&_e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ce=function(){return!!t})()}function Pe(t){return Pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pe(t)}function Re(t,e){return Re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Re(t,e)}function Ie(t){return Ie="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},Ie(t)}function Me(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function De(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,ze(r.key),r)}}function Fe(t,e,n){return e&&De(t.prototype,e),n&&De(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ze(t){var e=function(t){if("object"!=Ie(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ie(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ie(e)?e:e+""}"undefined"!=typeof window&&(window.CustomDivRenderer=Te);var Le=function(){return Fe(function t(e,n){Me(this,t),this.obj=e||{},this.items=n||[]},[{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}}])}(),Ne=function(t){function e(t){var n,r,o,i;return Me(this,e),n=function(t,e,n){return e=Pe(e),function(t,e){if(e&&("object"==Ie(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,Ce()?Reflect.construct(e,n||[],Pe(t).constructor):e.apply(t,n))}(this,e),r=n,i=function(){var t,e=window.matchMedia("(max-device-width: 415px)"),r=document.createElement("button");if(r.setAttribute("id","hamburger"),r.setAttribute("type","button"),r.setAttribute("aria-label","Menu"),r.setAttribute("aria-expanded","false"),r.setAttribute("aria-controls","innerItemsWrapper"),r.style.border="none",r.style.fontWeight="bold",r.style.position="absolute",r.style.color=null!==(t=n.hamburgerColour)&&void 0!==t?t:"orange",r.style.backgroundColor="transparent",r.style.fontSize=e.matches?"2.1em":"2em",n.hamburgerInset){var o=String(n.hamburgerInset).trim().split(/\s+/);r.style.padding=o.length>1?"".concat(o[0]," ").concat(o[1]):"".concat(o[0]," ").concat(o[0])}var i=document.createTextNode(n.symbol?n.symbol:"☰");return r.appendChild(i),r.style.marginLeft="auto",n.isShown=!1,r.addEventListener("click",function(){n.isShown=!n.isShown,r.setAttribute("aria-expanded",String(n.isShown)),n.hasAnimatedToWide=!1;var t=n.items[0].options;if(t&&t.animation){var e=t.animation.op,o=n.res.children[0].children[1].children[0];if(e){if(n.isShown)for(var i=0;i<o.children.length;i++)o.children[i].animate(e.keyframesClose,{duration:1,fill:"forwards",delay:0}).onfinish=function(){o.parentElement.style.display="block"};else o.parentElement.style.display="none";for(i=0;i<o.children.length;i++){var a=o.children[i];a.animate(e.keyframesClose,{duration:1,fill:"forwards",delay:0}),n.isShown?a.animate(e.keyframesOpen,e.openOptions):a.animate(e.keyframesClose,e.closeOptions)}}}else n.isShown?innerItemsWrapper.parentElement.style.display="block":innerItemsWrapper.parentElement.style.display="none"}),r},(o=ze(o="addHamburger"))in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,n.titleText="",n.hasHamburger=!1,n.code=[],n.attributes={},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&&Re(t,e)}(e,t),Fe(e,[{key:"toCode",value:function(){var t="new UINavBar()";return Object.keys(this.attributes).length>0?t+=".setup(".concat(yt(this.attributes,2),")"):t+=".setup({})",t+=".items([\n",t+=this.items.map(function(t){return t.toCode().join("").trim()}).join(",\n"),[t+="\n])"]}},{key:"styled",value:function(t){return this.setup(t),this.styles=t,this}},{key:"setup",value:function(t){this.obj=t,this.obj.isSide||(this.obj.animate=!1),this.attributes=t;var e=document.createElement("div");e.setAttribute("id","sars"),e.style.padding=0,e.style.margin=0;var n=document.createElement("div");return n.setAttribute("id","covid"),n.style.position="absolute",n.style.width="100%",n.style.zIndex=1,n.style.alignItems="flex-start",document.createElement("div").style.position="absolute",n.style.margin="20px",n.style.display="flex",n.style.alignItems="flex-end",n.style.margin=0,n.style.padding=0,n.style.margin=0,e.appendChild(n),this.addCloseButton=!1,this.res=e,t.background&&this.background({color:t.background}),t.openColor&&(this.openColor=t.openColor),t.sticky&&this.sticky(),t.pad&&this.pad(t.pad),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),t.hamburgerInset&&(this.hamburgerInset=t.hamburgerInset),t.mobileSize&&(this.mobileSize=t.mobileSize),t.desktopSize&&(this.desktopSize=t.desktopSize),t.height&&(this.res.children[0].style.height=t.height),this._ui={gap:t.gap,justify:t.justify,alignItems:t.alignItems,barPad:t.barPad,maxWidth:t.maxWidth,borderBottom:t.borderBottom},this.res.setAttribute("role","navigation"),this.res.setAttribute("aria-label",t.ariaLabel||"Primary"),this}},{key:"items",value:function(t){this.items=t;var e=["Link","Image","Spacer","Dropdown"].some(function(e){return t[0].__proto__.constructor.toString().startsWith("class ".concat(e))});this.itemCount=t.length;var n=new Le(this.obj,this.items).render();this.res.children[0].appendChild(n);var r=this.res.children[0].children[0].children[0],o=this.items[0].options;if(o&&o.animation){var i=o.animation.op;if(i){var a=window.matchMedia("(max-device-width: 415px)"),s=window.matchMedia("(max-width: 600px)");if(a.matches||s.matches){var l={duration:1,fill:"forwards",delay:1};for(c=0;c<r.children.length;c++)r.children[c].animate(i.keyframesClose,l)}else for(var c=0;c<r.children.length;c++)r.children[c].animate(i.keyframesClose,{duration:1,fill:"forwards",delay:1}),r.children[c].animate(i.keyframesOpen,i.openOptions)}}if(this.adjust(),!e){this.itemCount=t.length;var u=document.createElement("div");for(u.style.backgroundColor="orange",c=0;c<t.length;c++){var f=t[c];if(f.logo){var d=new Image(f.logo).width("100px"),h=document.createElement("div");h.style.flex="1",h.style.height=23;var p=document.createElement("div");p.setAttribute("id","WR"),p.style.display="flex",p.style.flexDirection="row",p.appendChild(d.render()),this.res.children[0].appendChild(d.render()),this.obj.spacing&&this.res.children[0].appendChild(h)}if(f.logo&&(this.allowPad=!0),f.logo&&this.obj.spacing&&(this.res.children[0].children[0].style.marginLeft=this.obj.spacing.sides,this.res.children[0].children[0].style.marginRight=this.obj.spacing.sides),f.title){var y=void 0;y=this.allowPad?f.type?new Dropdown(f.items,f.title):new Link(f.title,f.url).pad([{lr:"1em"}]):f.type?new Link("DRPA",f.url):new Link(f.title,f.url),u.appendChild(y.render())}}this.res.children[0].appendChild(u),this.adjust()}var m=this.addHamburger();this.itemCount,this.obj.spacing,m.style.zIndex=1;var v=this.res.children[0];return v&&!v.querySelector("#hamburger")&&v.insertBefore(m,v.firstChild),this}},{key:"instance",value:function(){return this.res.children[0]}},{key:"sticky",value:function(){return this.res.style.position="sticky",this.res.style.top=this.res.style.top||"0px",this.res.style.zIndex=this.res.style.zIndex||50,this._sticky=!0,this}},{key:"font",value:function(t){for(var e=0;e<this.res.children[0].children;e++)this.res.children[0].children[e].style.fontFamily=t;return this}},{key:"background",value:function(t){return t.background?(this.res.children[0].style.backgroundColor=t.color,this.res.children[0].style.opacity=t.opacity,this):(this.res.children[0].style.backgroundColor="transparent",this)}},{key:"adjust",value:function(t){var e=this,n=window.matchMedia("(max-width: 600px)"),r=window.matchMedia("(max-device-width: 415px)"),o=function(){e.isShown=!1,e.res.children[0],function(){for(var t=0;t<e.res.children[0].children.length;t++){var n=e.res.children[0].children[t];n.style.fontSize=r.matches?e.mobileSize?e.mobileSize:"1.2em":e.desktopSize?e.desktopSize:"1em","☰"===n.textContent&&(n.style.fontSize="2em")}}(),e.res.children[0].style.flexDirection="column";for(var t=0;t<e.res.children[0].children.length;t++)"☰"==e.res.children[0].children[t].textContent||e.res.children[0].children[t].textContent==e.keepItem?(e.res.children[0].children[t].id,e.res.children[0].children[t].style.display="flex"):e.res.children[0].children[t].style.display="none"};if(this.obj.isSide)o();else{var i=this.res.children[1];null!=i&&(i.style.background="yellow"),n.matches||r.matches?o():function(){e.res.children[0];for(var t=0;t<e.res.children[0].children.length;t++){var n=e.res.children[0].children[t];n.style.marginTop="0em",n.id,n.style.display="flex",n.textContent===e.titleText&&e.titleText.length>0&&(n.style.fontSize="2em")}var r=e.items[0].options;if(r&&r.animation){var o=r.animation.op,i=e.res.children[0].children[1].children[0];if(i.style.marginTop="0",o&&!e.hasAnimatedToWide)for(e.hasAnimatedToWide=!0,t=0;t<i.children.length;t++)i.children[t].animate(o.keyframesOpen,o.openOptions)}}()}return this}},{key:"render",value:function(t){var e=this,n=function(){var t=window.matchMedia("(max-width: 600px)"),n=window.matchMedia("(max-device-width: 415px)"),r=e.res.querySelector("#outerItemsWrapper")||e.res.children[0].children[1],o=r&&(r.querySelector("#innerItemsWrapper")||r.children[0]),i=e._ui||{};if(o&&(i.gap&&(o.style.gap=i.gap),i.justify&&(o.style.justifyContent=i.justify),i.alignItems&&(o.style.alignItems=i.alignItems),i.barPad&&(o.style.padding=i.barPad),i.maxWidth&&(o.style.maxWidth=i.maxWidth,o.style.marginLeft="auto",o.style.marginRight="auto")),r&&i.borderBottom&&(r.style.borderBottom=i.borderBottom),n.matches&&(o.style.position="relative"),(t.matches||n.matches)&&null!=o?o.style.flexDirection="column":null==o||e.obj.isSide||(o.style.flexDirection="row"),!e.obj.isSide&&!t.matches&&!n.matches){var a=e.res.querySelector("#hamburger");a&&(a.style.display="none")}e.obj.isSide&&(o.style.flexDirection="column"),e.obj.isSide||t.matches||(e.res.children[0].style.position="relative",r.style.transform="translateY(0px)"),!e.obj.isSide&&t.matches,e.obj.customStyle&&(e.res.children[0].style.marginTop="1rem",e.res.children[0].style.position="absolute",e.res.children[0].style.borderRadius="1rem",r.style.borderRadius="1rem"),e.obj.radius&&(e.res.children[0].style.borderRadius="1rem",r.style.borderRadius="1rem")};return this._on(window,"resize",function(){return n()}),n(),t?(document.querySelector(t).style.padding=0,document.querySelector(t).style.margin=0,document.querySelector(t).appendChild(this.res),this.res):this.res}}])}(Ct);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 We(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 qe(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)?qe(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 qe(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 Ue(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 Ge(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ge=function(){return!!t})()}function Xe(t){return Xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Xe(t)}function Je(t,e){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Je(t,e)}var Ve=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=Xe(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,Ge()?Reflect.construct(e,n||[],Xe(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&&Je(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),t&&null!=t.id&&""!==t.id&&this.res&&this.res.setAttribute&&this.res.setAttribute("id",String(t.id)),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=We(n.children);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(o+=1,this.masterEL[o]){var s,l=We(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=We(n.children);try{for(h.s();!(f=h.n()).done;){var p=f.value;d+=1;var y,m=We(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.textContent="☰",e.style.padding="10px 20px",e.style.minWidth="24px",e.style.minHeight="24px",e.style.lineHeight="1",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.textContent="×",e.style.fontSize="1.6rem",e.style.padding="10px 20px",e.style.minWidth="24px",e.style.minHeight="24px",e.style.lineHeight="1",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=We(this.res.children[0].children);try{for(o.s();!(r=o.n()).done;){var i,a=We(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}}])&&Ue(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function $e(t){return $e="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},$e(t)}function Ye(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 Qe(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,Ke(r.key),r)}}function Ke(t){var e=function(t){if("object"!=$e(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=$e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$e(e)?e:e+""}function Ze(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ze=function(){return!!t})()}function tn(t){return tn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},tn(t)}function en(t,e){return en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},en(t,e)}var nn=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=tn(e),function(t,e){if(e&&("object"==$e(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,Ze()?Reflect.construct(e,n||[],tn(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&&en(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 Ye(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)?Ye(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=yt(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&&Qe(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function rn(t){return rn="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},rn(t)}function on(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 an(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,sn(r.key),r)}}function sn(t){var e=function(t){if("object"!=rn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rn(e)?e:e+""}function ln(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ln=function(){return!!t})()}function cn(t){return cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(t)}function un(t,e){return un=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},un(t,e)}var fn=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=cn(e),function(t,e){if(e&&("object"==rn(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,ln()?Reflect.construct(e,n||[],cn(t).constructor):e.apply(t,n))}(this,e)).url=t,n.res=null,n.options={},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&&un(t,e)}(e,t),n=e,r=[{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.options=t||{},this}},{key:"toCode",value:function(){var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=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 on(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)?on(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)[1]})),e=Object.keys(t).length?".set(".concat(JSON.stringify(t),")"):"";return["new Audio(".concat(JSON.stringify(this.url),")").concat(e)]}},{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)}}],r&&an(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function dn(t){return dn="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},dn(t)}function hn(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,pn(r.key),r)}}function pn(t){var e=function(t){if("object"!=dn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dn(e)?e:e+""}function yn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(yn=function(){return!!t})()}function mn(t){return mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},mn(t)}function vn(t,e){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vn(t,e)}var bn=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=mn(e),function(t,e){if(e&&("object"==dn(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||[],mn(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,n.res=null,n.value=t,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&&vn(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("div"),e=document.createElement("div"),n=document.createElement("div");return e.style.position="absolute",n.style.position="relative",t.appendChild(e),t.appendChild(n),this.res=t,this}},{key:"padding",value:function(t,e,n,r){return(t||e||n||r)&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=n,this.res.style.paddingBottom=r),e||n||r||(this.res.style.padding=t),this}},{key:"size",value:function(t){var e=this,n=t.width.split("%")[0],r=t.height;this.res.children[0].style.width=n/100*window.innerWidth,this.res.children[0].style.height=r,this.res.children[1].style.width=n/100*window.innerWidth*this.value,this.res.children[1].style.height=r;var o=function(){e.res.children[0].style.width=n/100*window.innerWidth,e.res.children[0].style.height=r,e.res.children[1].style.width=n/100*window.innerWidth*e.value,e.res.children[1].style.height=r};return this._on(window,"resize",o),o(),this}},{key:"colors",value:function(t,e){return this.res.children[0].style.background=t,this.res.children[1].style.background=e,this}},{key:"round",value:function(t){return this.res.children[0].style.borderRadius="".concat(t,"px"),this.res.children[1].style.borderRadius="".concat(t,"px"),this}},{key:"render",value:function(t){if(Array.from(this.res.children).forEach(function(t){return t.style.padding=0}),Array.from(this.res.children).forEach(function(t){return t.style.margin=0}),!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&hn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function gn(t){return gn="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},gn(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,xn(r.key),r)}}function xn(t){var e=function(t){if("object"!=gn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gn(e)?e:e+""}function kn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(kn=function(){return!!t})()}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}function On(t,e){return On=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},On(t,e)}var jn=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=Sn(e),function(t,e){if(e&&("object"==gn(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,kn()?Reflect.construct(e,n||[],Sn(t).constructor):e.apply(t,n))}(this,e)).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&&On(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){var t=document.createElement("div");t.style.display="flex",t.style.flexDirection="column",t.style.justifyContent="center",t.style.alignItems="center",t.style.width="100%",t.style.height="auto",t.style.margin=0,t.style.padding=0,this.res=t}},{key:"set",value:function(t){return void 0!==t.id&&null!==t.id&&this.res.setAttribute("id",t.id),this.commonMethods(t),this}},{key:"toCode",value:function(){return[""]}},{key:"items",value:function(t){for(var e=0;e<t.length;e++){var n=t[e].render();this.res.appendChild(n)}return this}},{key:"add",value:function(t){for(var e=0;e<t.length;e++){var n=t[e].render();this.res.appendChild(n)}return this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&wn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function En(t){return En="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},En(t)}function _n(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,An(r.key),r)}}function An(t){var e=function(t){if("object"!=En(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=En(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==En(e)?e:e+""}function Tn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Tn=function(){return!!t})()}function Cn(){return Cn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Pn(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}},Cn.apply(null,arguments)}function Pn(t){return Pn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pn(t)}function Rn(t,e){return Rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Rn(t,e)}var In=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=Pn(e),function(t,e){if(e&&("object"==En(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,Tn()?Reflect.construct(e,n||[],Pn(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&&Rn(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=yt(t,2);return"new Code().set(".concat(e,")")}},{key:"callReact",value:function(t){this.options=t;var n,r,o,i=[],a=t.transform&&"object"===En(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=Cn(Pn(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),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&&_n(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Mn(t){return Mn="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},Mn(t)}function Dn(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,Fn(r.key),r)}}function Fn(t){var e=function(t){if("object"!=Mn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Mn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Mn(e)?e:e+""}function zn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(zn=function(){return!!t})()}function Ln(t){return Ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ln(t)}function Nn(t,e){return Nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Nn(t,e)}var Bn=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=Ln(e),function(t,e){if(e&&("object"==Mn(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,zn()?Reflect.construct(e,n||[],Ln(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&&Nn(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.options=t||{},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=this.options&&this.options.id,e="new Stack().set(".concat(t?"{ id: ".concat(JSON.stringify(String(t))," }"):"{}",")");if(this.children.length>0){var n=this.children.map(function(t){return t.toCode()}).join(",\n");e+=".add([\n \n ".concat(n," \n \n])")}return[e]}},{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)}}])&&Dn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Wn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Un(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 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 Un(t,e){if(t){if("string"==typeof t)return Hn(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)?Hn(t,e):void 0}}function Hn(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 Gn(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,Xn(r.key),r)}}function Xn(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 Jn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Jn=function(){return!!t})()}function Vn(){return Vn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=$n(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}},Vn.apply(null,arguments)}function $n(t){return $n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$n(t)}function Yn(t,e){return Yn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yn(t,e)}var Qn=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=$n(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,Jn()?Reflect.construct(e,n||[],$n(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&&Yn(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(mt(this.constrObj),")");if(this.constrObj||(r="".concat(n,"new Wrapper()")),Object.keys(this.obj).length){var o=yt(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)||Un(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),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"===qn(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=Vn($n(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(mt(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(mt(t.width),",")),t.overflow&&(n+="\n overflow: ".concat(mt(t.overflow),",")),t.height&&this.heightNoAuto(t.height),t.height&&(n+="\n height: ".concat(mt(t.height),",")),t.align&&this.flexAlign(t.align),t.align&&(n+="\n align: ".concat(mt(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(mt(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(mt(t.background),",")),t.weight&&this.weight(t.weight),t.area&&this.setArea(t.area),t.area&&(n+="area: ".concat(mt(t.area))),t.column&&this.makeCol(),t.column&&(n+="\n column: ".concat(mt(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(mt(t.flexDir),",")),t.center&&(n+="center: ".concat(JSON.stringify(t.center),",")),t.zIndex&&(this.res.style.zIndex=t.zIndex),t.transform&&"object"===qn(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=Wn(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};this._on(window,"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(),this._on(window,"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(),this._on(window,"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&&Gn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Kn(t){return Kn="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},Kn(t)}function Zn(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,tr(r.key),r)}}function tr(t){var e=function(t){if("object"!=Kn(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Kn(e)?e:e+""}function er(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(er=function(){return!!t})()}function nr(t){return nr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},nr(t)}function rr(t,e){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rr(t,e)}var or=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=nr(e),function(t,e){if(e&&("object"==Kn(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,er()?Reflect.construct(e,n||[],nr(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,t.res=document.createElement("meta"),t.res.setAttribute("name","viewport"),t.res.setAttribute("content","width=device-width, initial-scale=1"),t.charset=document.createElement("meta"),t.charset.setAttribute("charset","UTF-8"),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&&rr(t,e)}(e,t),n=e,(r=[{key:"add",value:function(){document.head.appendChild(this.res),document.head.appendChild(this.charset)}}])&&Zn(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function ir(t){return ir="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},ir(t)}function ar(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}}}}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,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,cr(r.key),r)}}function cr(t){var e=function(t){if("object"!=ir(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ir(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ir(e)?e:e+""}function ur(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ur=function(){return!!t})()}function fr(){return fr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=dr(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}},fr.apply(null,arguments)}function dr(t){return dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},dr(t)}function hr(t,e){return hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},hr(t,e)}var pr=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=dr(e),function(t,e){if(e&&("object"==ir(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,ur()?Reflect.construct(e,n||[],dr(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&&hr(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=fr(dr(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=ar(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,o=ar(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=ar(this.res.rows);try{for(n.s();!(e=n.n()).done;){var r,o=ar(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=ar(this.res.rows);try{for(r.s();!(n=r.n()).done;){var o,i=ar(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=ar(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=ar(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=ar(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=ar(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&&lr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function yr(t){return yr="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},yr(t)}function mr(t,e){if(t){if("string"==typeof t)return vr(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)?vr(t,e):void 0}}function vr(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 br(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,gr(r.key),r)}}function gr(t){var e=function(t){if("object"!=yr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yr(e)?e:e+""}function wr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(wr=function(){return!!t})()}function xr(t){return xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},xr(t)}function kr(t,e){return kr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kr(t,e)}var Sr=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=xr(e),function(t,e){if(e&&("object"==yr(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,wr()?Reflect.construct(e,n||[],xr(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,t._on(document,"DOMContentLoaded",function(){document.body.appendChild(t.contentWrap)}),t._track(function(){return t.contentWrap.remove()}),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&&kr(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(this._on(window,"resize",r),this._on(window,"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())}),this._on(document,"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.");var r=!this.options||!this.options.title;if(t.forEach(function(t,e){if(!r||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)}}),r){var o=t[0];o&&o.res&&this.toggleWrap.appendChild(o.res)}return(e=this.children).push.apply(e,function(t){return function(t){if(Array.isArray(t))return vr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||mr(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)||mr(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(mt(r)):"object"===yr(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&&br(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);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 jr(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 _r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_r=function(){return!!t})()}function Ar(t){return Ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ar(t)}function Tr(t,e){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tr(t,e)}var Cr=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=Ar(e),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)}(t,_r()?Reflect.construct(e,n||[],Ar(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,t.el=null,t.obj=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&&Tr(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){var e=document.createElement("div");return e.style.width="100vw",e.style.height="100vh",e.style.backgroundColor=t.background,e.style.zIndex="1",e.style.position="absolute",e.style.overflowY="scroll",this.obj=t,this.res=e,t.close&&this.close(),this}},{key:"close",value:function(){return this.res.style.display="none",this}},{key:"show",value:function(){return this.res.style.display="block",this}},{key:"add",value:function(t){var e=document.createElement("div");e.style.width=this.obj.width,e.style.height="auto",e.style.marginLeft="auto",e.style.marginRight="auto",e.style.backgroundColor="white",window.matchMedia("(max-device-width: 415px)").matches&&(e.style.marginTop="200px",e.style.width="100%");for(var n=0;n<t.length;n++)e.appendChild(t[n].render());return this.res.appendChild(e),this}},{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)}}])&&jr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);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 Rr(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,Ir(r.key),r)}}function Ir(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+""}function Mr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Mr=function(){return!!t})()}function Dr(t){return Dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dr(t)}function Fr(t,e){return Fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Fr(t,e)}var zr=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=Dr(e),function(t,e){if(e&&("object"==Pr(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,Mr()?Reflect.construct(e,n||[],Dr(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&&Fr(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;if(this.options=t,this.res.setAttribute("type",null!==(e=t.type)&&void 0!==e?e:"text"),t.placeholder&&(this.res.placeholder=t.placeholder),this.res.style.boxSizing="border-box",!this.res.getAttribute("aria-label")){var n,r,o=null!==(n=null!==(r=t.label)&&void 0!==r?r:t.title)&&void 0!==n?n:t.placeholder;o&&this.res.setAttribute("aria-label",String(o))}return 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.radius(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(),this._on(window,"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&&Rr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);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 Nr(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"!=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 Wr(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Wr=function(){return!!t})()}function qr(){return qr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ur(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}},qr.apply(null,arguments)}function Ur(t){return Ur=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ur(t)}function Hr(t,e){return Hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Hr(t,e)}var Gr=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=Ur(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,Wr()?Reflect.construct(e,n||[],Ur(t).constructor):e.apply(t,n))}(this,e)).text=t,r.url=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&&Hr(t,e)}(e,t),n=e,r=[{key:"getType",value:function(){return"LayoutWrapperElement"}},{key:"setup",value:function(){window.matchMedia("(max-device-width: 415px)");var t=document.createElement("div");return t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="center",t.style.backgroundColor="#fff",t.style.fontFamily="Arial",t.style.width="100%",t.style.overflow="hidden",this.res=t,this}},{key:"set",value:function(t){return this.obj=t,t.onTap&&this.onTap(t.onTap),t.background&&(this.res.style.background=t.background),t.border&&(this.res.style.border=t.border),t.radius&&(this.res.style.borderRadius=t.radius),t.width&&(this.res.style.width=t.width),this.options=t,this.callReact(t),this.commonMethods(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=qr(Ur(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.backgroundOp&&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:"frame",value:function(t){return t.height&&(this.res.style.height=t.height),t.width&&(this.res.style.width=t.width),this}},{key:"items",value:function(t){for(var e=0;e<t.length;e++)this.res.appendChild(t[e].render());return this}},{key:"shadow",value:function(){return this.res.style.boxShadow="1px 1px 20px rgba(0, 0, 0, 0.60)",this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}],r&&Nr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);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 Jr(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,Vr(r.key),r)}}function Vr(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 $r(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return($r=function(){return!!t})()}function Yr(t){return Yr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yr(t)}function Qr(t,e){return Qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qr(t,e)}var Kr=function(t){function e(t){var n;!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=Yr(e),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)}(t,$r()?Reflect.construct(e,n||[],Yr(t).constructor):e.apply(t,n))}(this,e))._noTheme=!0,n.code=[],n.setup();for(var r=0;r<t.length;r++)n.res.appendChild(t[r].render().render());return 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&&Qr(t,e)}(e,t),n=e,(r=[{key:"setup",value:function(){var t=document.createElement("div");t.style.padding=0,t.style.margin=0,this.res=t}},{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:"padding",value:function(t){return this.res.style.padding="".concat(t,"px"),this}},{key:"size",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:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Jr(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);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 to(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,eo(r.key),r)}}function eo(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 no(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(no=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=oo(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 oo(t){return oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},oo(t)}function io(t,e){return io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},io(t,e)}var ao=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=oo(e),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)}(t,no()?Reflect.construct(e,n||[],oo(t).constructor):e.apply(t,n))}(this,e)).code=[],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&&io(t,e)}(e,t),n=e,r=[{key:"toCode",value:function(){return this.code}},{key:"setup",value:function(){this.code.push("new FlexGrid()"),this.code.push(".setup()");var t=document.createElement("div");return t.style.display="flex",t.style.padding=0,t.style.margin=0,this.res=t,this}},{key:"getType",value:function(){return"FlexRowLayoutElement"}},{key:"set",value:function(t){t.id&&this.res.setAttribute("id",t.id),this.commonMethods(t),t.onTap&&this.onTap(t.onTap),this.code.push(".set({"),t.gap&&this.code.push("gap: ".concat(t.gap)),t.gap&&(this.res.style.gap=t.gap),t.flex&&(this.res.style.flex=t.flex),t.flex&&this.code.push("flex: ".concat(t.flex,",")),t.wrap&&(this.res.style.flexWrap="wrap"),t.wrap&&this.code.push("wrap: ".concat(t.wrap,",")),t.align&&(this.res.style.justifyContent=t.align),t.align&&this.code.push("align: ".concat(t.align,",")),t.colat&&this.toColumnAt(t.colat),t.colat&&this.code.push("\n colat: ".concat(mt(t.colat),",")),this.code.push("}),");var e=t;return this.callReact(e),this}},{key:"callReact",value:function(t){this.options=t;var n,r,o,i=[],a=t.transform&&"object"===Zr(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(orange, green)")),t.stroke&&(n=e,r=this,"function"==typeof(o=ro(oo(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.alignItems="center"):e.res.style.flexDirection="row"};n(),this._on(window,"resize",n)}}},{key:"flex",value:function(t){return this.arra=Array.from(t.replace(/\s/g,"")),this.areas=Array.from(Array(t.replace(/\s/g,"")).join("")),this.save="".concat(mt(t)),this}},{key:"items",value:function(t){this.items=t,this.code.push("\n .items([");for(var e=0;e<t.length;e++){var n=t[e];if(null!=n){var r=n.render();void 0!==n.toCode&&this.code.push(n.toCode().flatMap(function(t){return t})),this.res.appendChild(r)}}return this.code.push("\n ])"),this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"adjust",value:function(t){var e=this,n=function(){var n=window.matchMedia("(max-device-width: 415px)");if(window.innerWidth<t||n.matches)for(var r=0;r<e.res.children.length;r++)e.res.children[r].style.flex="",e.res.children[r].style.width="100%";else for(r=0;r<e.res.children.length;r++)e.res.children[r].style.flex="".concat(e.arra[r])};return n(),this._on(window,"resize",n),this}},{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)}}],r&&to(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function so(t){return so="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},so(t)}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"!=so(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=so(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==so(e)?e:e+""}function uo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(uo=function(){return!!t})()}function fo(t){return fo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fo(t)}function ho(t,e){return ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ho(t,e)}var po=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=fo(e),function(t,e){if(e&&("object"==so(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,uo()?Reflect.construct(e,n||[],fo(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&&ho(t,e)}(e,t),n=e,(r=[{key:"set",value:function(t){return this.imageUrl=t.url,this.createCard(),t.useBrightness&&(this.useBrightness=!0),t.useBrightness&&"\n useBrightness: ".concat(this.useBrightness),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar),t.inpad&&this.inpad(t.inpad),t.inpad&&"\n inpad: {".concat(t.inpad,"}"),t.font&&(this.res.style.fontFamily=t.font),t.inpad&&"\n font: ".concat(t.font),this.addListeners(),this}},{key:"inpad",value:function(t){return this.res.children[1].style.boxSizing="border-box",this.res.children[1].style.padding=t,this}},{key:"items",value:function(t){for(var e=0;e<t.length;e++)this.res.children[1].appendChild(t[e].render());return this}},{key:"createCard",value:function(){var t=document.createElement("div");t.style.display="grid",t.style.width="300px",t.style.height="400px",t.setAttribute("id","AAA");var e=document.createElement("div");e.style.gridArea="1/1",e.style.height="400px",e.style.borderRadius="15px",e.style.boxShadow="0 4px 8px 0 rgba(0,0,0,0.2)",e.style.overflow="hidden";var n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.transition="0.9s",n.style.backgroundImage="url(".concat(this.imageUrl,")"),n.style.backgroundSize="cover",n.style.backgroundPostion="cover",n.style.backgroundRepeat="no-repeat",e.appendChild(n);var r=document.createElement("div");return r.style.gridArea="1/1",r.style.zIndex="1",t.appendChild(e),t.appendChild(r),this.res=t,this}},{key:"addListeners",value:function(){var t=this,e=this.res.children[0].children[0];return this.res.onmouseover=function(){e.style.transform="scale(1.3)",t.useBrightness&&(e.style.filter="brightness(31%)")},this.res.onmouseout=function(){e.style.transform="scale(1.0)",t.useBrightness&&(e.style.filter="brightness(100%)")},this}},{key:"render",value:function(t){if(!t)return this.res;this.options.id&&this.res.setAttribute("id",this.options.id),document.querySelector(t).appendChild(this.res)}}])&&lo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function yo(t){return yo="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},yo(t)}var mo=["background","color","radius","maxHeight"];function vo(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,bo(r.key),r)}}function bo(t){var e=function(t){if("object"!=yo(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yo(e)?e:e+""}function go(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(go=function(){return!!t})()}function wo(t){return wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},wo(t)}function xo(t,e){return xo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xo(t,e)}var ko=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=wo(e),function(t,e){if(e&&("object"==yo(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,go()?Reflect.construct(e,n||[],wo(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&&xo(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){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),t.color&&(this.res.style.color=t.color),t.background,t.color,t.radius,t.maxHeight;var e=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,mo);return this.applyStyleOptions(e),t.keySet&&this.keySet(t.keySet),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];var n=t[e].render();this.navContent.appendChild(0===e&&this.obj&&this.obj.brandLink?At(n,this.obj.brandLink):n)}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}}],r&&vo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function So(t){return So="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},So(t)}var Oo=["background","color","radius","maxHeight"];function jo(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 Eo(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,_o(r.key),r)}}function _o(t){var e=function(t){if("object"!=So(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=So(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==So(e)?e:e+""}function Ao(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ao=function(){return!!t})()}function To(){return To="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Co(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}},To.apply(null,arguments)}function Co(t){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Co(t)}function Po(t,e){return Po=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Po(t,e)}var Ro=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=Co(e),function(t,e){if(e&&("object"==So(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,Ao()?Reflect.construct(e,n||[],Co(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&&Po(t,e)}(e,t),n=e,r=[{key:"removeQuotesFromFirstWord",value:function(t){if(t)return t.replace(pt(),"$1:")}},{key:"toCode",value:function(){var t=this,e=this.items.map(function(t){return t.toCode()}).flatMap(function(t){return t}),n=(this.removeQuotesFromFirstWord(JSON.stringify(this.obj)),["background","color","mar","pad","resmar","respad","radius","maxHeight","hamburgerColour","keySet","menuLabel","menuId","brandLink"]),r=[].concat(n,function(t){return function(t){if(Array.isArray(t))return jo(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return jo(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)?jo(t,e):void 0}}(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.")}()}(Object.keys(this.obj).filter(function(t){return t in jt&&!n.includes(t)}))).filter(function(e){return void 0!==t.obj[e]}).map(function(e){return"".concat(e,": ").concat(JSON.stringify(t.obj[e]),",")}).join("\n");return this.obj.brand&&"function"==typeof this.obj.brand.toCode&&(r+="\nbrand: ".concat([].concat(this.obj.brand.toCode()).join(""),",")),"new MobileBar().set({".concat(r,"}).add([\n ").concat(e.join(","),"\n\n ])")}},{key:"set",value:function(t){var n,r,o;this.obj=t,this.obj=t,this.makeNavbar(t),t.mar&&(n=e,r=this,"function"==typeof(o=To(Co(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),t.color&&(this.navbar.style.color=t.color),t.pad&&this.pad(t.pad),t.background,t.color,t.radius,t.maxHeight;var i=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,Oo);return this.applyStyleOptions(i),t.keySet&&this.keySet(t.keySet),this}},{key:"makeNavbar",value:function(t){var e,n=this,r=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 r.render&&this.brand.appendChild(At(r.render(),t.brandLink)),this.toggleButton=document.createElement("button"),this.toggleButton.classList.add("navbar-toggle"),this.toggleButton.innerHTML="&#9776;",this.toggleButton.setAttribute("type","button"),this.toggleButton.setAttribute("aria-label",null!==(e=t.menuLabel)&&void 0!==e?e:"Menu"),this.toggleButton.setAttribute("aria-expanded","false"),this.navContent=document.createElement("div"),this.navContent.classList.add("navbar-content"),t.menuId&&(this.navContent.setAttribute("id",t.menuId),this.toggleButton.setAttribute("aria-controls",t.menuId)),this.navContent.addEventListener("click",function(t){n.isMobileNavOpen&&t.target&&t.target.closest&&t.target.closest("a")&&n.toggleMobileNav()}),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(){n.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.toggleButton.setAttribute("aria-expanded",String(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&&Eo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Io(t){return Io="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},Io(t)}function Mo(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 Do(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mo(Object(n),!0).forEach(function(e){Fo(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mo(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Fo(t,e,n){return(e=Lo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zo(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,Lo(r.key),r)}}function Lo(t){var e=function(t){if("object"!=Io(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Io(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Io(e)?e:e+""}function No(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(No=function(){return!!t})()}function Bo(){return Bo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Wo(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}},Bo.apply(null,arguments)}function Wo(t){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wo(t)}function qo(t,e){return qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},qo(t,e)}var Uo=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=Wo(e),function(t,e){if(e&&("object"==Io(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,No()?Reflect.construct(e,n||[],Wo(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&&qo(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 Do(Do({},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(mt(this.options.breakpoints[e].at),", view: ").concat(this.options.breakpoints[e].view.toCode()," }, \n");var n=this._id?"\n id: ".concat(JSON.stringify(String(this._id)),","):"";return["new Switcher().set({".concat(n,"\n breakpoints: [\n ").concat(t,"\n ]\n })")]}},{key:"render",value:function(t){return this.internalDiv?(void 0!==t&&document.querySelector(t).appendChild(this.internalDiv),this.internalDiv):(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),this._on(window,"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 Do(Do({},t),{},{range:{from:o,to:i}})})}},{key:"applyView",value:function(){var t=this;if("function"==typeof window.matchMedia){window.innerWidth;var e=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())})}else{var r=this.breakpoints.reduce(function(t,e){return parseFloat(e.at)>parseFloat(t.at)?e:t},this.breakpoints[0]);r&&this.currentView!==r.view.render()&&(this.internalDiv.innerHTML="",this.internalDiv.appendChild(r.view.render()),this.currentView=r.view.render())}}},{key:"destroy",value:function(){var t,n,r;(t=e,n=this,"function"==typeof(r=Bo(Wo(1&3?t.prototype:t),"destroy",n))?function(t){return r.apply(n,t)}:r)([]),this.resizeListener=null,this.internalDiv&&this.container&&this.container.removeChild(this.internalDiv),this.container=null,this.currentView=null,this.internalDiv=null}}],r&&zo(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Ho(t){return Ho="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},Ho(t)}function Go(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"!=Ho(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ho(e)?e:e+""}function Jo(t,e){if(e&&("object"==Ho(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 Vo(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Vo=function(){return!!t})()}function $o(t){return $o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},$o(t)}function Yo(t,e){return Yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Yo(t,e)}var Qo=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=$o(o=e),(n=Jo(r,Vo()?Reflect.construct(o,[],$o(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"),Jo(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&&Yo(t,e)}(e,t),n=e,(r=[{key:"toCode",value:function(){return["new Spacer(".concat(this.hide,")")]}},{key:"render",value:function(){return this.res}}])&&Go(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Ko(t){return Ko="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},Ko(t)}function Zo(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 ti(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,ei(r.key),r)}}function ei(t){var e=function(t){if("object"!=Ko(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ko(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ko(e)?e:e+""}function ni(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ni=function(){return!!t})()}function ri(t){return ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ri(t)}function oi(t,e){return oi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oi(t,e)}var ii=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=ri(e),function(t,e){if(e&&("object"==Ko(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,ni()?Reflect.construct(e,n||[],ri(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&&oi(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 Zo(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)?Zo(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(mt(r)):"object"===Ko(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)}}])&&ti(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function ai(t){return ai="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},ai(t)}function si(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=li(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 li(t,e){if(t){if("string"==typeof t)return ci(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)?ci(t,e):void 0}}function ci(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 ui(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,fi(r.key),r)}}function fi(t){var e=function(t){if("object"!=ai(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ai(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ai(e)?e:e+""}function di(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(di=function(){return!!t})()}function hi(t){return hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},hi(t)}function pi(t,e){return pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pi(t,e)}"undefined"!=typeof window&&(window.Checkbox=ii);var yi=function(t){return t&&"function"==typeof t.play},mi={mp4:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',m4v:"video/mp4",mov:"video/quicktime",webm:"video/webm",ogv:"video/ogg",ogg:"video/ogg"},vi=function(t){var e=String(t||"").split("?")[0].split("#")[0].split(".").pop().toLowerCase();return mi[e]||""},bi=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=hi(e),function(t,e){if(e&&("object"==ai(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,di()?Reflect.construct(e,n||[],hi(t).constructor):e.apply(t,n))}(this,e)).url=t,n.options={},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&&pi(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("video");return null!=this.url&&t.setAttribute("src",this.url),t.setAttribute("controls","controls"),this.res=t,this}},{key:"set",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=n;var r=this.res;if(Array.isArray(n.sources)&&n.sources.length){r.removeAttribute("src");for(var o=0,i=function(t){return function(t){if(Array.isArray(t))return ci(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||li(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.")}()}(r.querySelectorAll("source"));o<i.length;o++)i[o].remove();var a,s=n.sources.concat(null!=this.url?[this.url]:[]),l=new Set,c=si(s);try{for(c.s();!(a=c.n()).done;){var u=a.value,f="string"==typeof u?u:u&&u.url;if(f&&!l.has(f)){l.add(f);var d=document.createElement("source");d.setAttribute("src",f);var h="object"===ai(u)&&u.type||vi(f);h&&d.setAttribute("type",h),r.appendChild(d)}}}catch(t){c.e(t)}finally{c.f()}}n.poster&&r.setAttribute("poster",n.poster),n.preload&&r.setAttribute("preload",n.preload),!1===n.controls?r.removeAttribute("controls"):!0===n.controls&&r.setAttribute("controls","controls"),n.loop&&(r.loop=!0,r.setAttribute("loop","loop")),(null!==(t=n.playsinline)&&void 0!==t?t:n.autoplay)&&(r.setAttribute("playsinline",""),r.setAttribute("webkit-playsinline",""));var p=null!==(e=n.muted)&&void 0!==e?e:!!n.autoplay||void 0;if(!0===p?(r.muted=!0,r.setAttribute("muted","")):!1===p&&(r.muted=!1,r.removeAttribute("muted")),n.autoplay&&this._autoplay(!1!==n.lazy),n.objectFit&&(r.style.objectFit=n.objectFit),n.aspectRatio&&(r.style.aspectRatio=n.aspectRatio),n.id&&r.setAttribute("id",n.id),n.label&&r.setAttribute("aria-label",n.label),n.decorative&&r.setAttribute("aria-hidden","true"),n.background&&(r.style.background=n.background),n.poster&&!1!==n.posterBehind&&!/url\(|gradient\(/.test(String(n.background||""))){var y=n.objectFit||"contain";r.style.backgroundImage="url(".concat(JSON.stringify(String(n.poster)),")"),r.style.backgroundSize="cover"===y?"cover":"fill"===y?"100% 100%":"none"===y?"auto":"contain",r.style.backgroundPosition="center",r.style.backgroundRepeat="no-repeat"}return n.height&&(r.style.height=n.height),n.maxWidth&&(r.style.maxWidth=n.maxWidth),n.radius&&(r.style.borderRadius="number"==typeof n.radius?"".concat(n.radius,"px"):n.radius),n.width&&(r.style.width="".concat(n.width)),n.opacity&&(r.style.opacity=n.opacity),n.raster&&this.rasterize(n.raster),this}},{key:"_autoplay",value:function(t){var e=this,n=this.res;if("undefined"==typeof window||!yi(n))return this;if("function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.removeAttribute("autoplay"),this;n.setAttribute("autoplay","");var r=function(){var t=n.play();t&&t.catch&&t.catch(function(){})};if(!t||"function"!=typeof window.IntersectionObserver)return r(),this;this._visible=!1;var o=new window.IntersectionObserver(function(t){var o,i=si(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;e._visible=a.isIntersecting,a.isIntersecting&&!e._hidden?r():n.pause()}}catch(t){i.e(t)}finally{i.f()}},{threshold:.2});return o.observe(n),this._track(function(){return o.disconnect()}),this._hidden=!1,this._on(document,"visibilitychange",function(){e._hidden=document.hidden,document.hidden?n.pause():e._visible&&r()}),this}},{key:"play",value:function(){var t,e;return yi(this.res)&&(null===(t=this.res.play())||void 0===t||null===(e=t.catch)||void 0===e||e.call(t,function(){})),this}},{key:"pause",value:function(){return yi(this.res)&&this.res.pause(),this}},{key:"size",value:function(t){return this.res.style.width=t,this}},{key:"toCode",value:function(){var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=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)||li(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)[1]}));return["new Video(".concat(mt(this.url),").set(").concat(yt(t,4),")")]}},{key:"render",value:function(t){var e;return t?(null===(e=document.querySelector(t))||void 0===e||e.appendChild(this.res),this.res):this.res}}],r&&ui(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function gi(t,e){if(t){if("string"==typeof t)return wi(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)?wi(t,e):void 0}}function wi(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 xi(t){return xi="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},xi(t)}function ki(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,Si(r.key),r)}}function Si(t){var e=function(t){if("object"!=xi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=xi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==xi(e)?e:e+""}function Oi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Oi=function(){return!!t})()}function ji(){return ji="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ei(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}},ji.apply(null,arguments)}function Ei(t){return Ei=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ei(t)}function _i(t,e){return _i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_i(t,e)}var Ai=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=Ei(e),function(t,e){if(e&&("object"==xi(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,Oi()?Reflect.construct(e,n||[],Ei(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&&_i(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"===xi(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=ji(Ei(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){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=gi(t))){e&&(t=e);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}(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()"),r=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)||gi(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)[1];return null!=e&&""!==e}));return Object.keys(r).length&&(n+="\n".concat(e," .set(").concat(JSON.stringify(r,null,2).split("\n").join("\n".concat(e," ")),")")),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(mt(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&&ki(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Ti(t){return Ti="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},Ti(t)}function Ci(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,Pi(r.key),r)}}function Pi(t){var e=function(t){if("object"!=Ti(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ti(e)?e:e+""}function Ri(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ri=function(){return!!t})()}function Ii(t){return Ii=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ii(t)}function Mi(t,e){return Mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Mi(t,e)}var Di=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=Ii(e),function(t,e){if(e&&("object"==Ti(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,Ri()?Reflect.construct(e,n||[],Ii(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&&Mi(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(mt(t.fluidc),","),t.onTap&&this.onTap(t.onTap),t.frame&&this.frame(t.frame),t.frame&&"\n frame: ".concat(mt(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="number"==typeof t?"".concat(t,"px"):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(),this._on(window,"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(),this._on(window,"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,function(t){return JSON.parse(t)});return["new Button(".concat(mt(this.text),").set(").concat(t,")")]}},{key:"render",value:function(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}])&&Ci(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Fi(t){return Fi="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},Fi(t)}function zi(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,Li(r.key),r)}}function Li(t){var e=function(t){if("object"!=Fi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Fi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Fi(e)?e:e+""}var Ni=function(){return t=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=document.createElement("div"),this.container.style.width="100%",this.container.style.margin="20px auto",this.container.style.textAlign="center",this.elements=e,this.currentSlideIndex=0,this.buttons=n,this.tintColor=r.tintColor||"green",this.inactiveColor=r.inactiveColor||"gray",this.options=r,!this.buttons){var o={leftButton:new Di("L").set({frame:{width:50,height:50},svg:this.createArrowSVG("left",28,this.tintColor),color:this.tintColor,radius:"100%",mar:[{a:"1rem"}]}),rightButton:new Di("R").set({frame:{width:50,height:50},svg:this.createArrowSVG("right",28,this.tintColor),color:this.tintColor,radius:"100%",mar:[{a:"1rem"}]})};this.buttons=o}this.createSlider(),this.init()},e=[{key:"createArrowSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"left",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:28,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"currentColor",r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg");o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("width",String(e)),o.setAttribute("height",String(e)),o.setAttribute("aria-hidden","true"),o.style.display="block",o.style.pointerEvents="none";var i=document.createElementNS(r,"path");return i.setAttribute("fill",n),"left"===t?i.setAttribute("d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"):i.setAttribute("d","M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z"),o.appendChild(i),o}},{key:"toCode",value:function(){var t="new Slider([".concat(this.elements.map(function(t){return t.toCode()}),"], null)");return[t=t.replace(/,\s*\./g,".")]}},{key:"createSlider",value:function(){var t,e=this;this.slider=document.createElement("div"),this.slider.style.width="100%",this.slider.style.height=null!==(t=this.options.height)&&void 0!==t?t:"400px",this.slider.style.borderRadius="20px",this.slider.style.overflow="hidden",this.slider.style.position="relative",this.slider.style.marginBottom="15px";var n=document.createElement("div");this.slidesWrapper=n,n.style.display="flex",n.style.overflowX="scroll",n.style.scrollBehavior="smooth",n.style.scrollSnapType="x mandatory",this.elements.forEach(function(t,r){var o=document.createElement("div");o.setAttribute("class","slide"),o.style.display="flex",o.style.justifyContent="center",o.style.alignItems="center",o.style.flexShrink="0",o.style.width="100%",o.style.height="400px",o.style.transformOrigin="center center",o.style.transform="scale(1)",o.style.scrollSnapAlign="center";var i=t.render();o.appendChild(i),i.style.cursor="pointer",i.addEventListener("click",function(){e.showLightbox(r)}),n.appendChild(o)}),this.arrowPrev=this.buttons.leftButton.render(),this.arrowPrev.style.position="absolute",this.arrowPrev.style.left="10px",this.arrowPrev.style.top="50%",this.arrowPrev.style.transform="translateY(-50%)",this.arrowPrev.style.zIndex="1",this.arrowPrev.style.display="flex",this.arrowPrev.style.alignItems="center",this.arrowPrev.style.justifyContent="center",this.arrowPrev.style.backgroundColor="white",this.arrowPrev.style.padding=".4rem",this.arrowNext=this.buttons.rightButton.render(),this.arrowNext.style.position="absolute",this.arrowNext.style.right="10px",this.arrowNext.style.top="50%",this.arrowNext.style.transform="translateY(-50%)",this.arrowNext.style.zIndex="1",this.arrowNext.style.display="flex",this.arrowNext.style.alignItems="center",this.arrowNext.style.justifyContent="center",this.arrowNext.style.backgroundColor="white",this.arrowNext.style.padding=".4rem";var r=document.createElement("div");r.style.position="absolute",r.style.bottom="10%",r.style.left="50%",r.style.transform="translateX(-50%)",r.style.textAlign="center",r.style.background="#ffffff",r.style.borderRadius="1rem",r.style.padding=".2rem",r.style.boxShadow="3px 3px 10px #000",this.options.hideSelector&&(r.style.display="none"),this.elements.forEach(function(t,n){var o=document.createElement("a");o.style.display="inline-block",o.style.height="15px",o.style.width="15px",o.style.borderRadius="50%",o.style.backgroundColor=e.inactiveColor,o.style.margin="0 10px",o.style.cursor="pointer",o.dataset.index=n,r.appendChild(o)});var o=document.createElement("div");o.style.display="flex",o.style.justifyContent="flex-start",o.style.margin="1rem",o.style.gap="10px",o.style.flexWrap="nowrap",o.style.overflowX="auto",this.options.hideThumbnails&&(o.style.display="none"),n.querySelectorAll(".slide").forEach(function(t,n){var r=document.createElement("div");r.className="slider-thumb",r.dataset.index=n.toString(),r.style.width="60px",r.style.height="40px",r.style.border="2px solid ".concat(e.inactiveColor),r.style.borderRadius="5px",r.style.overflow="hidden",r.style.cursor="pointer",r.style.flexShrink="0",r.style.position="relative";var i=(t.firstElementChild||t.cloneNode(!0)).cloneNode(!0);i.style.transform="scale(0.2)",i.style.transformOrigin="top left",i.style.width="300px",i.style.height="300px",i.style.backgroundSize="contain",i.style.pointerEvents="none",r.appendChild(i),o.appendChild(r)}),this.slider.appendChild(this.arrowPrev),this.slider.appendChild(this.arrowNext),this.slider.appendChild(n),this.slider.appendChild(r),this.container.appendChild(this.slider),this.container.appendChild(o),this.slidesWrapper=n,this.navLinks=Array.from(r.querySelectorAll("a")),this.thumbs=Array.from(o.querySelectorAll(".slider-thumb"))}},{key:"init",value:function(){this.updateActiveSlide(),this.attachEventListeners()}},{key:"attachEventListeners",value:function(){var t=this;this.arrowPrev.addEventListener("click",function(){t.moveToSlide(t.currentSlideIndex-1<0?t.elements.length-1:t.currentSlideIndex-1)}),this.arrowNext.addEventListener("click",function(){t.moveToSlide((t.currentSlideIndex+1)%t.elements.length)}),this.navLinks.forEach(function(e){e.addEventListener("click",function(n){n.preventDefault();var r=parseInt(e.dataset.index,10);t.moveToSlide(r)})}),this.thumbs.forEach(function(e){e.addEventListener("click",function(){var n=parseInt(e.dataset.index,10);t.moveToSlide(n)})}),document.addEventListener("keydown",function(e){"ArrowLeft"===e.key?t.moveToSlide(t.currentSlideIndex-1<0?t.elements.length-1:t.currentSlideIndex-1):"ArrowRight"===e.key&&t.moveToSlide((t.currentSlideIndex+1)%t.elements.length)})}},{key:"moveToSlide",value:function(t){this.currentSlideIndex=t,this.updateActiveSlide()}},{key:"updateActiveSlide",value:function(){var t=this;this.navLinks.forEach(function(e){var n=parseInt(e.dataset.index,10);e.style.backgroundColor=n===t.currentSlideIndex?t.tintColor:t.inactiveColor}),this.thumbs.forEach(function(e){var n=parseInt(e.dataset.index,10);e.style.borderColor=n===t.currentSlideIndex?t.tintColor:t.inactiveColor});var e=this.slidesWrapper.querySelector(".slide"),n=e?e.offsetWidth:this.slidesWrapper.clientWidth;this.slidesWrapper.scrollTo({left:this.currentSlideIndex*n,behavior:"smooth"})}},{key:"showLightbox",value:function(t){var e=this,n=t,r=document.createElement("div");r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100vw",r.style.height="100vh",r.style.backgroundColor="rgba(0,0,0,0.9)",r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.zIndex="9999",r.style.cursor="default";var o=document.createElement("div");o.style.position="relative",o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.maxWidth="90%",o.style.maxHeight="90%",r.appendChild(o);var i=function(t){o.innerHTML="";var n,r=e.elements[t].render();if(n="IMG"===r.tagName?r:r.querySelector("img")){var i=document.createElement("img");i.src=n.src,i.style.maxWidth="90vw",i.style.maxHeight="90vh",i.style.objectFit="contain",i.style.pointerEvents="none",i.style.display="block",o.appendChild(i)}else{var a=r.cloneNode(!0);a.style.width="90vw",a.style.height="90vh",a.style.maxWidth="90vw",a.style.maxHeight="90vh",a.style.pointerEvents="none",o.appendChild(a)}};i(n);var a=this.buttons.leftButton.render().cloneNode(!0),s=this.buttons.rightButton.render().cloneNode(!0),l={position:"absolute",top:"50%",transform:"translateY(-50%)",background:"white",border:"none",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",width:"50px",height:"50px",margin:"1rem",padding:"0",zIndex:"10000",cursor:"pointer",boxShadow:"0 2px 8px rgba(0,0,0,0.4)"};Object.assign(a.style,l,{left:"10px"}),Object.assign(s.style,l,{right:"10px"}),a.addEventListener("click",function(t){t.stopPropagation(),n=n-1<0?e.elements.length-1:n-1,i(n)}),s.addEventListener("click",function(t){t.stopPropagation(),n=(n+1)%e.elements.length,i(n)}),r.appendChild(a),r.appendChild(s);var c=document.createElement("div");c.innerHTML="✕",c.style.position="absolute",c.style.top="15px",c.style.right="20px",c.style.fontSize="2rem",c.style.color="white",c.style.cursor="pointer",c.style.zIndex="10000",c.style.userSelect="none",c.style.transition="transform 0.2s ease",c.addEventListener("mouseenter",function(){c.style.transform="scale(1.2)"}),c.addEventListener("mouseleave",function(){c.style.transform="scale(1)"}),c.addEventListener("click",function(t){t.stopPropagation(),document.body.removeChild(r),document.removeEventListener("keydown",u)}),r.appendChild(c),r.addEventListener("click",function(){document.body.removeChild(r),document.removeEventListener("keydown",u)});var u=function(t){"Escape"===t.key?(document.body.removeChild(r),document.removeEventListener("keydown",u)):"ArrowLeft"===t.key?(n=n-1<0?e.elements.length-1:n-1,i(n)):"ArrowRight"===t.key&&(n=(n+1)%e.elements.length,i(n))};document.addEventListener("keydown",u),document.body.appendChild(r)}},{key:"render",value:function(t){if(!t)return this.container;document.querySelector(t).appendChild(this.container)}}],e&&zi(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Bi(t){return Bi="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},Bi(t)}function Wi(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,qi(r.key),r)}}function qi(t){var e=function(t){if("object"!=Bi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bi(e)?e:e+""}function Ui(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ui=function(){return!!t})()}function Hi(t){return Hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Hi(t)}function Gi(t,e){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gi(t,e)}var Xi=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=Hi(e),function(t,e){if(e&&("object"==Bi(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,Ui()?Reflect.construct(e,n||[],Hi(t).constructor):e.apply(t,n))}(this,e)).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&&Gi(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=null==t.title?"":String(t.title),o=document.createTextNode(r);n.appendChild(o),n.style.opacity=0;var i=document.createElement("input");return"textarea"===t.type&&(i=document.createElement("textarea")),i.style.position="relative",i.placeholder=r,i.style.boxSizing="border-box",r&&!i.getAttribute("aria-label")&&i.setAttribute("aria-label",r),i.style.fontSize="1rem",i.style.padding=".4rem .75rem",e.appendChild(n),e.appendChild(i),this.res=e,t.mar&&this.mar(t.mar),t.pad&&this.pad(t.pad),i.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",i.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)}),i.addEventListener("focusout",function(){n.style.transform="scale(1.0)",i.placeholder=r,n.style.opacity="0.0"}),t.name&&i.setAttribute("name",t.name),"INPUT"===i.tagName&&t.type&&"input"!==t.type&&i.setAttribute("type",t.type),t.required&&i.setAttribute("required",""),window.matchMedia("(max-device-width: 415px)").matches&&(i.style.width="100%",e.style.width="100%"),i.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)}}])&&Wi(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function Ji(t){return Ji="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},Ji(t)}function Vi(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,$i(r.key),r)}}function $i(t){var e=function(t){if("object"!=Ji(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ji(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ji(e)?e:e+""}"undefined"!=typeof window&&(window.FloatingInput=Xi);var Yi=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)}}])&&Vi(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Qi(t){return Qi="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},Qi(t)}function Ki(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,Zi(r.key),r)}}function Zi(t){var e=function(t){if("object"!=Qi(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Qi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Qi(e)?e:e+""}"undefined"!=typeof window&&(window.Range=Yi);var ta=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,t&&null!=t.id&&""!==t.id&&this.el.setAttribute("id",String(t.id)),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)}}])&&Ki(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function ea(t){return ea="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},ea(t)}function na(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,ra(r.key),r)}}function ra(t){var e=function(t){if("object"!=ea(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ea(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ea(e)?e:e+""}function oa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(oa=function(){return!!t})()}function ia(t){return ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ia(t)}function aa(t,e){return aa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},aa(t,e)}"undefined"!=typeof window&&(window.RadioGroup=ta);var sa=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=ia(e),function(t,e){if(e&&("object"==ea(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,oa()?Reflect.construct(e,n||[],ia(t).constructor):e.apply(t,n))}(this,e)).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&&aa(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++){var o=t[r],i="string"==typeof o||"number"==typeof o?[String(o),String(o)]:[o&&o[0],o&&o[1]];n.appendChild(this.addNode(i[0],i[1]))}return this.el=n,this.res=n,this}},{key:"set",value:function(t){this.options=t;var e=t.name;t.items&&this.setup(t.items,e),t.arrayPadding&&(this.deprecatedOption("arrayPadding",'pad: [{a: "0.5rem"}]'),this.arrayPadding(t.arrayPadding.sides,t.arrayPadding.value)),t.arrayMargin&&(this.deprecatedOption("arrayMargin","mar: [{a: 10}]"),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);var n=t.title,r=void 0!==t.label?t.label:n;return null==r||this.el.getAttribute("aria-label")||this.el.setAttribute("aria-label",String(r)),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(),this._on(window,"resize",e),this}},{key:"render",value:function(t){if(!t)return this.el;document.querySelector(t).appendChild(this.el)}}],r&&na(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function la(t){return la="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},la(t)}function ca(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,ua(r.key),r)}}function ua(t){var e=function(t){if("object"!=la(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=la(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==la(e)?e:e+""}function fa(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(fa=function(){return!!t})()}function da(t){return da=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},da(t)}function ha(t,e){return ha=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ha(t,e)}"undefined"!=typeof window&&(window.Picker=sa);var pa=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=da(e),function(t,e){if(e&&("object"==la(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,fa()?Reflect.construct(e,n||[],da(t).constructor):e.apply(t,n))}(this,e)).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&&ha(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),void 0!==t.id&&null!==t.id&&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.textContent=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.textContent="Change",e.file=o.files[0],e.onLoad(e.file),ya[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(),this._on(window,"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}}])&&ca(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct),ya=[];function ma(t,e){return ma=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ma(t,e)}function va(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(va=function(){return!!t})()}function ba(t){return ba="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},ba(t)}function ga(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,wa(r.key),r)}}function wa(t){var e=function(t){if("object"!=ba(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ba(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ba(e)?e:e+""}var xa=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)}}])&&ga(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),ka=xa;function Sa(t){return Sa="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},Sa(t)}function Oa(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 ja(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,Ea(r.key),r)}}function Ea(t){var e=function(t){if("object"!=Sa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Sa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sa(e)?e:e+""}xa=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(va())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&ma(o,n.prototype),o}(ka,e)},"undefined"!=typeof window&&(window.DataList=xa);var _a=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=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 Oa(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)?Oa(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],o="string"==typeof r?JSON.stringify(r):r;return"".concat(n,": ").concat(o)}).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),t.title&&this.formElement.setAttribute("aria-label",t.title),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&&ja(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Aa(t){return Aa="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},Aa(t)}function Ta(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,Ca(r.key),r)}}function Ca(t){var e=function(t){if("object"!=Aa(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Aa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Aa(e)?e:e+""}var Pa=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 ye).set(r))}return o}}],null&&Ta(t.prototype,null),e&&Ta(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Ra(t){return Ra="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},Ra(t)}function Ia(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,Ma(r.key),r)}}function Ma(t){var e=function(t){if("object"!=Ra(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ra(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ra(e)?e:e+""}function Da(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Da=function(){return!!t})()}function Fa(t){return Fa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fa(t)}function za(t,e){return za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},za(t,e)}var La=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=Fa(r),t=function(t,e){if(e&&("object"==Ra(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,Da()?Reflect.construct(r,o||[],Fa(n).constructor):r.apply(n,o)))._noTheme=!0,t.gridContainer=document.createElement("div"),t.gridContainer.classList.add("grid-container"),t.gridContainer.style.display="grid",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&&za(t,e)}(e,t),n=e,r=[{key:"set",value:function(t){return t&&null!=t.id&&""!==t.id&&this.gridContainer.setAttribute("id",String(t.id)),t.gap&&(this.gridContainer.style.gap=t.gap),t.height&&(this.gridContainer.style.height=t.height),t.width&&(this.gridContainer.style.width=t.width),this}},{key:"react",value:function(t){var e=this,n=function(){for(var n=0;n<t.length-1;n++){var r=parseInt(t[n].at),o=parseInt(t[n+1].at);if(window.innerWidth>r&&window.innerWidth<o){var i=t[n].template.map(function(t){return t.split("").join(" ")}).map(function(t){return'"'.concat(t,'"')}).join(" ");e.gridContainer.style.gridTemplateAreas=i}else if(window.innerWidth>o){var a=t[t.length-1].template.map(function(t){return t.split("").join(" ")}).map(function(t){return'"'.concat(t,'"')}).join(" ");e.gridContainer.style.gridTemplateAreas=a}}};return n(),this._on(window,"resize",n),this}},{key:"add",value:function(t){for(var e=function(t){for(var e=[],n=0;n<t;n++){var r="",o=n;do{r=String.fromCharCode(65+o%26)+r,o=Math.floor(o/26)-1}while(o>=0);e.push(r)}return e}(t.length),n=0;n<t.length;n++){var r=t[n].render();r.style.gridArea=e[n].toLowerCase();var o=document.createElement("div");o.textContent=t[n].text,o.style.gridArea=e[n].toLowerCase(),this.gridContainer.appendChild(r)}return this}},{key:"render",value:function(t){return t&&document.querySelector(t).appendChild(this.gridContainer),this.gridContainer}},{key:"toCode",value:function(){return"new Simple().set({}).react([])"}}],r&&Ia(n.prototype,r),o&&Ia(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Ct);function Na(t){return Na="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},Na(t)}function Ba(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 Wa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ba(Object(n),!0).forEach(function(e){qa(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ba(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function qa(t,e,n){return(e=Ha(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ua(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,Ha(r.key),r)}}function Ha(t){var e=function(t){if("object"!=Na(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Na(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Na(e)?e:e+""}function Ga(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ga=function(){return!!t})()}function Xa(){return Xa="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ja(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}},Xa.apply(null,arguments)}function Ja(t){return Ja=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ja(t)}function Va(t,e){return Va=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Va(t,e)}var $a=function(t){function e(){var t,n=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),(t=function(t,e,n){return e=Ja(e),function(t,e){if(e&&("object"==Na(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,Ga()?Reflect.construct(e,n||[],Ja(t).constructor):e.apply(t,n))}(this,e)).res=null,t.options={},t.code=[],t.elCSS=[],t.html=[],t.react=[],t.setup(n),t.code.push("new Polygon(".concat(JSON.stringify(n),")")),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&&Va(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=yt(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=Wa(Wa({},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,a=[];if(n.stroke||n.gradient||n.backgroundOp||n.layout||n.marginOp||n.shadow||n.animation||n.filtera||n.transform){var s;n.gradient&&(this.globalGradient=n.gradient.op.gradient),n.stroke&&(null===(r=e,o=this,s="function"==typeof(i=Xa(Ja(1&3?r.prototype:r),"setAny",o))?function(t){return i.apply(o,t)}:i)||void 0===s||s([{globalBlast:"".concat(n.stroke.op.width," ").concat(n.stroke.op.color)}]));for(var l=[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}),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=[];n.border&&u.push("border"),n.background&&u.push("background"),(n.mar||n.margin)&&u.push("margin"),n.animation&&u.push("animation"),"radial"===n.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)"),this.chainReact(a,this.options.id,u)}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&&Ua(n.prototype,r),o&&Ua(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Ct);function Ya(t){return Ya="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},Ya(t)}function Qa(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 Ka(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,Za(r.key),r)}}function Za(t){var e=function(t){if("object"!=Ya(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ya(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ya(e)?e:e+""}function ts(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ts=function(){return!!t})()}function es(){return es="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=ns(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}},es.apply(null,arguments)}function ns(t){return ns=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ns(t)}function rs(t,e){return rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},rs(t,e)}var os=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=ns(e),function(t,e){if(e&&("object"==Ya(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,ts()?Reflect.construct(e,n||[],ns(t).constructor):e.apply(t,n))}(this,e)).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&&rs(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=yt(Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=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 Qa(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)?Qa(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)[1]})),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,i=[];if(t.stroke||t.gradient||t.backgroundOp||t.layout||t.marginOp||t.shadow||t.animation||t.filtera||t.transform){var 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&&(null===(n=e,r=this,a="function"==typeof(o=es(ns(1&3?n.prototype:n),"setAny",r))?function(t){return o.apply(r,t)}:o)||void 0===a||a([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]));for(var s=[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}),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.border&&c.push("border"),t.background&&c.push("background"),(t.mar||t.margin)&&c.push("margin"),t.animation&&c.push("animation"),this.chainReact(i,this.options.id,c)}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&&Ka(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct),is=["mobile"];function as(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 ss(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?as(Object(n),!0).forEach(function(e){ls(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):as(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ls(t,e,n){return(e=function(t){var e=function(t){if("object"!=cs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=cs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==cs(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cs(t){return cs="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},cs(t)}var us=function(t){var e=Math.floor(Number(t));return Number.isFinite(e)&&e>0?e:0},fs=function(t,e){return Math.max(1,Math.round(Number(e)||1))%2==1?Math.round(t-.5)+.5:Math.round(t)},ds=function(t,e,n,r){if(0===t||n<=e)return[];for(var o=(n-e)/t,i=[],a=0;a<=t;a++)i.push(fs(e+o*a,r));return i};function hs(t){return hs="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},hs(t)}function ps(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ys(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 ys(t,e){if(t){if("string"==typeof t)return ms(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)?ms(t,e):void 0}}function ms(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 vs(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,bs(r.key),r)}}function bs(t){var e=function(t){if("object"!=hs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=hs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==hs(e)?e:e+""}function gs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gs=function(){return!!t})()}function ws(t){return ws=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ws(t)}function xs(t,e){return xs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xs(t,e)}var ks="http://www.w3.org/2000/svg",Ss={columns:4,rows:2,inset:16,lineWidth:1,lineOpacity:.35,marks:"square",markSize:8,position:"fixed",zIndex:2,font:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:11,letterSpacing:"0.04em",uppercase:!0,breakpoint:768,readouts:[]},Os=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=ws(e),function(t,e){if(e&&("object"==hs(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,gs()?Reflect.construct(e,n||[],ws(t).constructor):e.apply(t,n))}(this,e)).options={},t.config=null,t._readoutEls=new Map,t._readoutText=new Map,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&&xs(t,e)}(e,t),n=e,r=[{key:"setup",value:function(){var t=document.createElement("div");t.setAttribute("aria-hidden","true"),t.setAttribute("data-nodality","grid-overlay"),t.style.pointerEvents="none",t.style.top="0",t.style.right="0",t.style.bottom="0",t.style.left="0",t.style.overflow="hidden";var e=document.createElementNS(ks,"svg");return e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("focusable","false"),e.style.display="block",t.appendChild(e),this.res=t,this.svg=e,this}},{key:"set",value:function(){var t,e,n,r,o,i,a,s,l,c,u,f,d,h,p,y=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=y,this.config={columns:null!==(t=y.columns)&&void 0!==t?t:Ss.columns,rows:null!==(e=y.rows)&&void 0!==e?e:Ss.rows,inset:null!==(n=y.inset)&&void 0!==n?n:Ss.inset,color:y.color,lineWidth:null!==(r=y.lineWidth)&&void 0!==r?r:Ss.lineWidth,lineOpacity:null!==(o=y.lineOpacity)&&void 0!==o?o:Ss.lineOpacity,marks:null!==(i=y.marks)&&void 0!==i?i:Ss.marks,markSize:null!==(a=y.markSize)&&void 0!==a?a:Ss.markSize,position:null!==(s=y.position)&&void 0!==s?s:Ss.position,zIndex:null!==(l=y.zIndex)&&void 0!==l?l:Ss.zIndex,font:null!==(c=y.font)&&void 0!==c?c:Ss.font,fontSize:null!==(u=y.fontSize)&&void 0!==u?u:Ss.fontSize,letterSpacing:null!==(f=y.letterSpacing)&&void 0!==f?f:Ss.letterSpacing,uppercase:null!==(d=y.uppercase)&&void 0!==d?d:Ss.uppercase,breakpoint:null!==(h=y.breakpoint)&&void 0!==h?h:Ss.breakpoint,mobile:y.mobile,readouts:null!==(p=y.readouts)&&void 0!==p?p:Ss.readouts};var m=this.config;return this.res.style.position="absolute"===m.position?"absolute":"fixed",this.res.style.zIndex=String(m.zIndex),y.color&&(this.res.style.color=y.color),y.id&&this.res.setAttribute("id",y.id),this._watchSize(),this.draw(),y.raster&&this.rasterize(y.raster),this}},{key:"readout",value:function(t,e){this._readoutText.set(t,e);var n=this._readoutEls.get(t);return n&&(n.textContent=this._format(e)),this}},{key:"geometry",value:function(){return this._geometry||null}},{key:"draw",value:function(){var t=this;if(!this.config)return this;var e=this._measure(),n=e.width,r=e.height,o=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})||{},n=e.mobile,r=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,is),o=Number(r.breakpoint)||768;return n&&"object"===cs(n)&&t<o?ss(ss({},r),n):r}(this.config,this._viewportWidth()),i=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.width,n=void 0===e?0:e,r=t.height,o=void 0===r?0:r,i=t.columns,a=void 0===i?4:i,s=t.rows,l=void 0===s?2:s,c=t.inset,u=void 0===c?0:c,f=t.lineWidth,d=void 0===f?1:f,h=Math.max(0,Number(n)||0),p=Math.max(0,Number(o)||0),y=us(a),m=us(l),v=function(t){if(t&&"object"===cs(t))return{x:Math.max(0,Number(t.x)||0),y:Math.max(0,Number(t.y)||0)};var e=Math.max(0,Number(t)||0);return{x:e,y:e}}(u),b=Math.min(v.x,h/2),g=Math.min(v.y,p/2),w=ds(y,b,h-b,d),x=ds(m,g,p-g,d),k=[],S=0;S<x.length;S++)for(var O=0;O<w.length;O++)k.push({col:O,row:S,x:w[O],y:x[S]});return{width:h,height:p,columns:y,rows:m,inset:{x:b,y:g},cell:{width:y?(h-2*b)/y:0,height:m?(p-2*g)/m:0},x:w,y:x,intersections:k}}({width:n,height:r,columns:o.columns,rows:o.rows,inset:o.inset,lineWidth:o.lineWidth});this._geometry=i;for(var a=this.svg;a.firstChild;)a.removeChild(a.firstChild);if(this._readoutEls.clear(),!n||!r)return this;a.setAttribute("viewBox","0 0 ".concat(n," ").concat(r));var s,l=this._node("g",{stroke:"currentColor","stroke-width":o.lineWidth,"stroke-opacity":o.lineOpacity,"shape-rendering":"crispEdges"}),c=ps(i.x);try{for(c.s();!(s=c.n()).done;){var u=s.value;l.appendChild(this._node("line",{x1:u,y1:0,x2:u,y2:r}))}}catch(t){c.e(t)}finally{c.f()}var f,d=ps(i.y);try{for(d.s();!(f=d.n()).done;){var h=f.value;l.appendChild(this._node("line",{x1:0,y1:h,x2:n,y2:h}))}}catch(t){d.e(t)}finally{d.f()}a.appendChild(l);var p=Number(o.markSize)||0;if(p>0&&"square"===o.marks){var y,m=this._node("g",{fill:"currentColor","shape-rendering":"crispEdges"}),v=ps(i.intersections);try{for(v.s();!(y=v.n()).done;){var b=y.value;m.appendChild(this._node("rect",{x:b.x-p/2,y:b.y-p/2,width:p,height:p}))}}catch(t){v.e(t)}finally{v.f()}a.appendChild(m)}else if(p>0&&"cross"===o.marks){var g=i.intersections.map(function(t){return"M".concat(t.x-p/2," ").concat(t.y,"H").concat(t.x+p/2,"M").concat(t.x," ").concat(t.y-p/2,"V").concat(t.y+p/2)}).join("");g&&a.appendChild(this._node("path",{d:g,fill:"none",stroke:"currentColor","stroke-width":o.lineWidth,"shape-rendering":"crispEdges"}))}var w=Array.isArray(o.readouts)?o.readouts:[];if(w.length){var x=this._node("g",{fill:"currentColor","font-family":o.font,"font-size":o.fontSize,"letter-spacing":o.letterSpacing}),k=p/2+6;w.forEach(function(e,o){if(e){var a=i.intersections.find(function(t){return t.col===e.col&&t.row===e.row});if(a){var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"br",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=["tl","tr","bl","br"].includes(e)?e:"br",i="r"===o[1],a="b"===o[0];if(r){var s=Number(r.width)||0,l=Number(r.height)||0,c=n+24;i&&t.x+c>s?i=!1:!i&&t.x-c<0&&(i=!0),a&&t.y+c>l?a=!1:!a&&t.y-c<0&&(a=!0)}return{x:t.x+(i?n:-n),y:t.y+(a?n:-n),textAnchor:i?"start":"end",baseline:a?"hanging":"alphabetic"}}(a,e.anchor,k,{width:n,height:r}),l=null!=e.id?String(e.id):"readout-".concat(o),c=t._node("text",{x:s.x,y:s.y,"text-anchor":s.textAnchor,"dominant-baseline":s.baseline,"data-readout":l});c.textContent=t._format(t._readoutText.has(l)?t._readoutText.get(l):e.text),x.appendChild(c),t._readoutEls.set(l,c)}}}),a.appendChild(x)}return this}},{key:"_format",value:function(t){var e=null==t?"":String(t);return this.config&&!1===this.config.uppercase?e:e.toUpperCase()}},{key:"_node",value:function(t,e){var n=document.createElementNS(ks,t);for(var r in e)n.setAttribute(r,String(e[r]));return n}},{key:"_viewportWidth",value:function(){return"undefined"!=typeof window&&window.innerWidth?window.innerWidth:1/0}},{key:"_measure",value:function(){var t="undefined"!=typeof window;return{width:this.res.clientWidth||(t?window.innerWidth:0)||0,height:this.res.clientHeight||(t?window.innerHeight:0)||0}}},{key:"_watchSize",value:function(){var t=this;if(!this._watching&&"undefined"!=typeof window)if(this._watching=!0,"function"==typeof window.ResizeObserver){var e=new window.ResizeObserver(function(){return t.draw()});e.observe(this.res),this._track(function(){return e.disconnect()})}else this._on(window,"resize",function(){return t.draw()})}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=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)||ys(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)[1]}));return["new GridOverlay().set(".concat(yt(t,4),")")]}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"render",value:function(t){if(t){var e=document.querySelector(t);e&&(e.appendChild(this.res),this.draw())}return this.res}}],r&&vs(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(Ct);function js(t){return js="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},js(t)}function Es(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)||As(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 _s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=As(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 As(t,e){if(t){if("string"==typeof t)return Ts(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)?Ts(t,e):void 0}}function Ts(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 Cs(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,Ps(r.key),r)}}function Ps(t){var e=function(t){if("object"!=js(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=js(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==js(e)?e:e+""}function Rs(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Rs=function(){return!!t})()}function Is(t){return Is=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Is(t)}function Ms(t,e){return Ms=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ms(t,e)}var Ds="https://cdn.shopify.com/storefront/web-components.js",Fs=function(t,e){var n=String(null!=t?t:e).replace(/^#/,"");return/^[A-Za-z][\w-]*$/.test(n)?n:e},zs=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=Is(e),function(t,e){if(e&&("object"==js(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,Rs()?Reflect.construct(e,n||[],Is(t).constructor):e.apply(t,n))}(this,e)).items=[],t.fallbackItems=[],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&&Ms(t,e)}(e,t),n=e,r=[{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=t;var e=t.kind,n=this["build_".concat(e)];if("function"!=typeof n)throw new Error('nodality: Shop has no kind "'.concat(e,'"'));return this.res=n.call(this,t),"product"===e&&(this.res.style.display="block",this.commonMethods(t)),t.id&&this.res.setAttribute("id",String(t.id)),t.font&&(this.res.style.fontFamily=t.font),t.color&&(this.res.style.color=t.color),"product"!==e&&"store"!==e&&"cart"!==e&&(this.applyStyleOptions(t),t.pad&&this.pad(t.pad),t.mar&&this.mar(t.mar)),t.keySet&&this.keySet(t.keySet),this}},{key:"build_store",value:function(t){var n=document.createElement("shopify-store");return n.setAttribute("store-domain",t.domain),t.token&&n.setAttribute("public-access-token",t.token),t.country&&n.setAttribute("country",t.country),t.language&&n.setAttribute("language",t.language),e.loadScript(),n}},{key:"build_product",value:function(t){var e=document.createElement("shopify-context");return e.setAttribute("type","product"),e.setAttribute("handle",t.handle),this.template=document.createElement("template"),this.placeholder=document.createElement("div"),this.placeholder.setAttribute("shopify-loading-placeholder",""),this.placeholder.style.display="contents",e.appendChild(this.template),e.appendChild(this.placeholder),e}},{key:"build_price",value:function(t){var e;if(t.fallback)return this.text(t.text);var n=document.createElement("shopify-money");return n.setAttribute("query",null!==(e=t.query)&&void 0!==e?e:"product.selectedOrFirstAvailableVariant.price"),null!=t.text&&(n.textContent=t.text),n}},{key:"build_productData",value:function(t){var e;if(t.fallback)return this.text(t.text);var n=document.createElement("shopify-data");return n.setAttribute("query",null!==(e=t.query)&&void 0!==e?e:"product.title"),null!=t.text&&(n.textContent=t.text),n}},{key:"build_productMedia",value:function(t){var e;if(t.fallback){var n,r=document.createElement("img");return t.url&&r.setAttribute("src",t.url),r.setAttribute("alt",null!==(n=t.alt)&&void 0!==n?n:""),t.width&&r.setAttribute("width",String(t.width)),t.height&&r.setAttribute("height",String(t.height)),r}var o=document.createElement("shopify-media");if(o.setAttribute("query",null!==(e=t.query)&&void 0!==e?e:"product.selectedOrFirstAvailableVariant.image"),t.width&&o.setAttribute("width",String(t.width)),t.height&&o.setAttribute("height",String(t.height)),t.url){var i,a=document.createElement("img");a.setAttribute("src",t.url),a.setAttribute("alt",null!==(i=t.alt)&&void 0!==i?i:""),o.appendChild(a)}return o}},{key:"build_variantPicker",value:function(t){if(t.fallback)return this.text(t.text);var e=document.createElement("shopify-variant-selector");return null!=t.text&&(e.textContent=t.text),e}},{key:"build_buy",value:function(t){var e;if(t.fallback){var n,r=document.createElement("a");return t.url&&r.setAttribute("href",t.url),r.textContent=null!==(n=t.text)&&void 0!==n?n:"Buy",r}var o=document.createElement("button");o.setAttribute("type","button"),o.textContent=null!==(e=t.text)&&void 0!==e?e:"Add to cart";var i=Fs(t.cart,"cart"),a=Fs(t.store,"store");return o.setAttribute("onclick","buyNow"===t.mode?"document.getElementById('".concat(a,"').buyNow(event)"):"document.getElementById('".concat(i,"').addLine(event).showModal()")),o}},{key:"build_cart",value:function(t){var n=document.createElement("shopify-cart");t.target&&n.setAttribute("target",t.target),t.discountCodes&&n.setAttribute("discount-codes",t.discountCodes);var r=Fs(t.id,"cart");return t.theme&&e.themeCart(r,t.theme),n}},{key:"text",value:function(t){var e=document.createElement("span");return e.textContent=null!=t?t:"",e}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.items=t;var e,n=this.template?this.template.content:this.res,r=_s(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;o&&"function"==typeof o.render&&n.appendChild(o.render())}}catch(t){r.e(t)}finally{r.f()}return this}},{key:"fallback",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.fallbackItems=t;var e,n=this.placeholder||this.res,r=_s(t);try{for(r.s();!(e=r.n()).done;){var o=e.value;o&&"function"==typeof o.render&&n.appendChild(o.render())}}catch(t){r.e(t)}finally{r.f()}return this}},{key:"toCode",value:function(){var t=Object.fromEntries(Object.entries(this.options||{}).filter(function(t){return null!=Es(t,2)[1]})),e=function(t){return t.filter(function(t){return t&&"function"==typeof t.toCode}).map(function(t){return[].concat(t.toCode()).join("")}).join(",\n")},n="new Shop().set(".concat(yt(t,4),")");return this.items.length&&(n+=".add([".concat(e(this.items),"])")),this.fallbackItems.length&&(n+=".fallback([".concat(e(this.fallbackItems),"])")),[n]}},{key:"render",value:function(t){if(t){var e=document.querySelector(t);e&&e.appendChild(this.res)}return this.res}}],o=[{key:"loadScript",value:function(){if("undefined"!=typeof document&&document.head&&!document.querySelector('script[src="'.concat(Ds,'"]'))){var t=document.createElement("script");t.setAttribute("type","module"),t.setAttribute("src",Ds),document.head.appendChild(t)}}},{key:"themeCart",value:function(t,e){var n,r;if("undefined"!=typeof document&&document.head){var o="#".concat(t),i=function(t){return Object.entries(t).filter(function(t){var e=Es(t,2)[1];return null!=e&&""!==e}).map(function(t){var e=Es(t,2),n=e[0],r=e[1];return"".concat(n,": ").concat(String(r).replace(/[;{}<>]/g,""))}).join("; ")},a=["".concat(o," { ").concat(i({"font-family":e.font})," }"),"".concat(o,"::part(dialog) { ").concat(i({background:e.background,color:e.color,"font-family":e.font,"border-radius":e.radius})," }"),"".concat(o,"::part(primary-button) { ").concat(i({background:e.accent,color:e.accentText,"font-family":e.font,"border-radius":null!==(n=e.buttonRadius)&&void 0!==n?n:e.radius})," }"),"".concat(o,"::part(secondary-button) { ").concat(i({color:e.color,"font-family":e.font})," }"),"".concat(o,"::part(line-heading) { ").concat(i({"font-family":null!==(r=e.headingFont)&&void 0!==r?r:e.font})," }")].join("\n"),s="nodality-cart-".concat(t),l=document.head.querySelector('style[data-shop="'.concat(s,'"]'));l||((l=document.createElement("style")).setAttribute("data-shop",s),document.head.appendChild(l)),l.textContent=a}}}],r&&Cs(n.prototype,r),o&&Cs(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(Ct),Ls=["font","color","background","radius"];function Ns(t){return function(t){if(Array.isArray(t))return Ws(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Bs(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 Bs(t,e){if(t){if("string"==typeof t)return Ws(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)?Ws(t,e):void 0}}function Ws(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 qs(t){return qs="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},qs(t)}function Us(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,Js(r.key),r)}}function Hs(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 Gs(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hs(Object(n),!0).forEach(function(e){Xs(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hs(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Xs(t,e,n){return(e=Js(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Js(t){var e=function(t){if("object"!=qs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qs(e)?e:e+""}var Vs=["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","gridOverlay","store","product","price","productData","productMedia","variantPicker","buy","cart"],$s=function(t,e){var n=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):t};return n(t)===n(e)},Ys=function(t){var e,n;return"string"==typeof t||"number"==typeof t?{title:String(t),link:"#e"}:Gs(Gs({},t),{},{title:String(null!==(e=null==t?void 0:t.title)&&void 0!==e?e:""),link:null!==(n=null==t?void 0:t.link)&&void 0!==n?n:"#e"})},Qs=Object.freeze({cards:"items",table:"items",ulist:"items",nav:"items",sideNav:"items",dropdown:"items",picker:"items",radio:"items",row:"children",form:"children",stack:"children",wrap:"children",product:"children"}),Ks=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){var e=this.dispatchType(t),n=t&&t.el&&t.el.id;if(null!=n&&""!==n){var r=String(n);e&&"object"===qs(e)&&(e.options&&"object"===qs(e.options)&&(e.options.id=r),e.obj&&"object"===qs(e.obj)&&(e.obj.id=r));var o=e&&(e.res||e.formElement||e.el||e.container),i=e&&[e.res,e.formElement,e.el,e.container].some(function(t){return t&&"function"==typeof t.getAttribute&&(t.getAttribute("id")===r||"function"==typeof t.querySelectorAll&&Ns(t.querySelectorAll("[id]")).some(function(t){return t.getAttribute("id")===r}))});o&&!i&&"function"==typeof o.setAttribute&&(o.getAttribute("id")||o.setAttribute("id",String(n)))}return e}},{key:"dispatchType",value:function(t){if(function(t){var e=Qs[t&&t.type];if(e){var n="items"===e?"children":"items",r=function(e){return Array.isArray(t[e])&&t[e].length>0};if(r(n)&&!r(e)){var o=t.id?' (id "'.concat(t.id,'")'):"";console.warn('[nodality] "'.concat(t.type,'"').concat(o,' carries content in "').concat(n,'" but reads ')+'"'.concat(e,'". The "').concat(n,'" content is ignored and the placeholder template ')+'rendered instead. Move it to "'.concat(e,'".'))}}}(t&&t.el),["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);if("gridOverlay"===t.el.type)return this.mapGridOverlay(t);if("store"===t.el.type)return this.mapStore(t);if("product"===t.el.type)return this.mapProduct(t);if("price"===t.el.type)return this.mapPrice(t);if("productData"===t.el.type)return this.mapProductData(t);if("productMedia"===t.el.type)return this.mapProductMedia(t);if("variantPicker"===t.el.type)return this.mapVariantPicker(t);if("buy"===t.el.type)return this.mapBuy(t);if("cart"===t.el.type)return this.mapCart(t);throw new Error("[nodality] "+Pt(t.el.type,Vs,"element type"))}},{key:"mapTable",value:function(t){var e,n=t.el,r=Array.isArray(n.items)&&n.items.length?n.items:[{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"}];return(new pr).add(r).set(Gs(Gs({},null!=t.el.id&&""!==t.el.id?{id:String(t.el.id)}:{}),{},{cellPadding:"0.3em",cellAlign:"center",style:{font:"Arial"},headStyle:{color:"white",background:"#c2410c"},border:"2px solid black",center:!0,borderRadius:2.2,stroke:this.filtero("blast",n.id,t.customOptions),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:null!==(e=this.filtero("transform",n.id,t.customOptions))&&void 0!==e?e:n.transform,filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions)}))}},{key:"mapRow",value:function(t){var e,n=this,r=t.el;return(new je).set(Gs(Gs({},this.elOpts(r,["stroke","gradient","animation","shadow","span","backgroundOp","marginOp","transform","filtera","raster"])),{},{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:null!==(e=this.filtero("transform",r.id,t.customOptions))&&void 0!==e?e:r.transform,filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions)})).items(Ns(Array.isArray(r.children)&&r.children.length?r.children.map(function(e){return n.mapType(Gs(Gs({},t),{},{el:e}))}):[new Vt("This").set({size:"S3"}),new Vt("is").set({size:"S3",text:"Hello"}),new Vt("row.").set({size:"S3",text:"Hello"})]))}},{key:"mapCode",value:function(t){var e,n=t.el;return(new In).set(Gs(Gs({},null!=n.id&&""!==n.id?{id:String(n.id)}:{}),{},{stroke:this.filtero("blast",n.id,t.customOptions),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:null!==(e=this.filtero("transform",n.id,t.customOptions))&&void 0!==e?e:n.transform,filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.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,s='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: ').concat(mt(t.el.id?String(t.el.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)'),l=(new Qn).set(Gs(Gs({width:a+"px",height:a+"px",display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",id:t.el.id?String(t.el.id):"#first",scale:.3},null!=r&&r.animation?{animation:{op:{name:"animation",color:"green",width:"1px",fireAt:"inview",keyframesOpen:[{transform:"rotate(360deg)",opacity:0},{transform:"rotate(0deg)",opacity:1}],keyframesClose:[{transform:"rotate(0deg)",opacity:1},{transform:"rotate(0deg)",opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}},target:["#first"]}}:{}),i.length?{raster:JSON.parse(JSON.stringify(i))}:{})),c=Array.from({length:o}).map(function(t,e){var n=e/o*Math.PI*2-Math.PI/2,r=150+300*Math.cos(n),i=150+300*Math.sin(n),a=180*n/Math.PI+90;return a=((a=(a%360+360)%360)%360+360)%360,new Vt("Hello").set({size:"S1",color:"green",font:"Arial",left:r+"px",top:i+"px",transform:{op:{name:"transform",transform:{static:!0,keep:!0,values:["tx:-50%","ty:-50%","rotate("+a+"deg)"]}}}})});return l.add(c),this.withSource(l,s)}},{key:"button",value:function(t){var e,n=t.el;return new Di(null!==(e=n.text)&&void 0!==e?e:"Button").set(Gs(Gs({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 Uo).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(Gs(Gs({},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 bi(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 fn(e.url),e,t.customOptions)}},{key:"radio",value:function(t){var e,n=t.el;return(new ta).set(Gs({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 zr).set(Gs(Gs({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 Xi).set(Gs(Gs({type:null!==(e=n.inputType)&&void 0!==e?e:"input"},void 0!==n.title||void 0===n.label&&void 0===n.text?{}:{title:void 0!==n.label?n.label:n.text}),this.elOpts(n))),n,t.customOptions)}},{key:"filePicker",value:function(t){var e,n=t.el;return this.attachRaster((new pa).set(Gs({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 sa).set(Gs(Gs({items:Array.isArray(e.items)?e.items:[],pad:[{a:"0.5rem"}],rounded:!0},this.elOpts(e)),{},{raster:this.filteroRaster(e.id,t.customOptions)}))}},{key:"mapGridOverlay",value:function(t){for(var e=t.el,n={id:e.id,columns:e.columns,rows:e.rows,inset:e.inset,color:e.color,lineWidth:e.lineWidth,lineOpacity:e.lineOpacity,marks:e.marks,markSize:e.markSize,position:e.position,zIndex:e.zIndex,font:e.font,fontSize:e.fontSize,letterSpacing:e.letterSpacing,uppercase:e.uppercase,breakpoint:e.breakpoint,mobile:e.mobile,readouts:e.readouts,raster:this.filteroRaster(e.id,t.customOptions)},r=0,o=Object.keys(n);r<o.length;r++){var i=o[r];null==n[i]&&delete n[i]}return(new Os).set(n)}},{key:"shop",value:function(t,e,n,r){var o=Gs({kind:t,id:e.id,font:e.font,color:e.color,keySet:e.keySet},n);r.shopFallback&&(o.fallback=!0);for(var i=0,a=Object.keys(o);i<a.length;i++){var s=a[i];null==o[s]&&delete o[s]}return(new zs).set(o)}},{key:"mapStore",value:function(t){var e=t.el;return this.shop("store",e,{domain:e.domain,token:e.token,country:e.country,language:e.language},t)}},{key:"mapProduct",value:function(t){var e=this,n=t.el,r=this.shop("product",n,Gs(Gs({},this.elOpts(n)),{},{handle:n.handle}),t),o=Array.isArray(n.children)?n.children:[];r.add(o.map(function(n){return e.mapType(Gs(Gs({},t),{},{el:n,shopFallback:!1}))}));var i=function(t){if(!t||"object"!==qs(t))return t;var e=Gs({},t);return e.id&&(e.id="".concat(String(e.id).replace(/^#/,""),"-static")),Array.isArray(e.children)&&(e.children=e.children.map(i)),e};return r.fallback(o.map(function(n){return e.mapType(Gs(Gs({},t),{},{el:i(n),shopFallback:!0}))})),r}},{key:"shopStyle",value:function(t){return Gs(Gs({},Tt(t)),{},{pad:t.pad,mar:t.mar})}},{key:"mapPrice",value:function(t){var e=t.el;return this.shop("price",e,Gs(Gs({},this.shopStyle(e)),{},{text:e.text,query:e.query}),t)}},{key:"mapProductData",value:function(t){var e=t.el;return this.shop("productData",e,Gs(Gs({},this.shopStyle(e)),{},{query:e.query,text:e.text}),t)}},{key:"mapProductMedia",value:function(t){var e=t.el;return this.shop("productMedia",e,Gs(Gs({},this.shopStyle(e)),{},{query:e.query,url:e.url,alt:e.alt,width:e.width,height:e.height}),t)}},{key:"mapVariantPicker",value:function(t){var e=t.el;return this.shop("variantPicker",e,Gs(Gs({},this.shopStyle(e)),{},{text:e.text}),t)}},{key:"mapBuy",value:function(t){var e=t.el;return this.shop("buy",e,Gs(Gs({},this.shopStyle(e)),{},{text:e.text,mode:e.mode,cart:e.cart,store:e.store,url:e.url}),t)}},{key:"mapCart",value:function(t){var e=t.el;return this.shop("cart",e,{theme:e.theme,target:e.target,discountCodes:e.discountCodes},t)}},{key:"dropdown",value:function(t){var e,n=null!==(e=t.el.label)&&void 0!==e?e:t.el.title;t.el.items||(t.el.items=["Flower","Car","Maseratti"]);var r=t.el.items.map(function(t){return(new ye).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}})}),o=(new Sr).set(Gs(Gs({},void 0===n?{}:{title:n}),{},{behaviour:"click",pad:[{a:"1rem"}],mar:[{a:"1rem"}],border:"1px solid black",width:"180px",radius:"1rem"})).add([].concat(Ns(void 0!==n?[]:[new Vt(t.el.items[0]).set({font:"Arial",fluidc:"S6",weight:"bold",align:"center",cursor:"pointer",icon:{padding:30,url:"https://cdn-icons-png.flaticon.com/512/60/60995.png"},pad:[{l:10,r:10}]})]),[(new Qn).set({border:"1px solid green",background:"#1abc9c",radius:"0.7rem",socenter:!0}).add(void 0===n?r.slice(1):r)])),i=this.filteroRaster(t.el.id,t.customOptions);return i&&o.rasterize(i),o}},{key:"pageNav",value:function(t,e){var n,r,o,i,a,s=this,l=t.el||{},c=function(){var e,n;return l.brand&&"object"===qs(l.brand)?s.mapType(Gs(Gs({},t),{},{el:l.brand})):new Vt(null!==(e=l.brand)&&void 0!==e?e:"Company").set(Gs({size:"S6",font:null!==(n=l.font)&&void 0!==n?n:"Helvetica"},l.color?{color:l.color}:{}))},u=function(){return e.map(function(t){return(new ye).set(Gs(Gs(Gs({text:t.title,url:t.link,pad:[{tb:8,lr:4}]},l.font?{font:l.font}:{}),l.color?{color:l.color}:{}),l.hover?{hover:l.hover}:{}))})},f=Tt(l),d=(f.font,f.color,f.background,f.radius,Gs(Gs(Gs(Gs(Gs({},function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(f,Ls)),{},{background:null!==(n=l.background)&&void 0!==n?n:"#ecf0f1",mar:null!==(r=l.mar)&&void 0!==r?r:[{a:21}],radius:null!==(o=l.radius)&&void 0!==o?o:"1rem"},void 0!==l.pad?{pad:l.pad}:{}),void 0!==l.color?{color:l.color}:{}),void 0!==l.keySet?{keySet:l.keySet}:{}),l.brandLink?{brandLink:l.brandLink}:{})),h=void 0===l.breakpoint?"1200px":"number"==typeof l.breakpoint?"".concat(l.breakpoint,"px"):String(l.breakpoint),p=(new Ro).set(Gs(Gs(Gs({},d),{},{brand:c(),hamburgerColour:null!==(i=null!==(a=l.hamburgerColour)&&void 0!==a?a:l.color)&&void 0!==i?i:"#3498db"},l.menuLabel?{menuLabel:l.menuLabel}:{}),l.id?{menuId:"".concat(String(l.id).replace(/^#/,""),"-menu")}:{})).add(u()),y=(new ko).set(Gs(Gs({},d),{},{maxHeight:"100px"})).add([c(),new Qo(!0)].concat(Ns(u())));return(new Uo).set({id:l.id,breakpoints:[{at:"0px",view:p},{at:h,view:y}]})}},{key:"protoNav",value:function(t){var e,n,r=t.customOptions,o=Array.isArray(null===(e=t.el)||void 0===e?void 0:e.items)&&t.el.items.length?t.el.items.map(Ys):[{title:"Fire",link:"@e"},{title:"and",link:"@e"},{title:"smoke",link:"@e"}],i=Array.isArray(null===(n=t.el)||void 0===n?void 0:n.items)&&t.el.items.length?t.el.items.map(Ys):null,a=function(){return i.map(function(t){return(new ye).set({text:t.title,url:t.link,pad:[{tb:8,lr:4}]})})};if(i)return this.pageNav(t,i);var s=o.map(function(t,e){return new ye('"'.concat(t.title,'"')).set({fluidc:"S6",text:t.title,link:t.link,font:"Arial",pad:[{a:40}],bold:!0,hover:{color:"wheat",animation:.3}})}),l=o.map(function(t,e){return new ye('"'.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 c=(new Sr).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black"}).add([new Vt("First").set({cursor:"pointer",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 Qn).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new ye).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 ye).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"}})])]);l.push(c),s.push(c)}t.el.animation;var u=(new Uo).set({id:t.el&&t.el.id,breakpoints:[{at:"0px",view:(new Ro).set({background:"#ecf0f1",mar:[{a:21}],brand:new Vt("Company").set({size:"S6",font:"Helvetica"}),hamburgerColour:"#3498db",radius:"1rem"}).add([].concat(Ns(i?a():[(new ye).set({text:"About",url:"#a"})]),[(new Sr).set({behaviour:"mouseover",pad:[{a:40}],mar:[{lr:"auto"}],breakpoint:"1200px",padding:"10px",border:"1px solid black",height:"auto"}).add([new Vt("More").set({cursor:"pointer",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 Vt("Our story").set({cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new Vt("Team").set({cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])],Ns(i?[]:[new ye("B").set({text:"About",url:"#b"}),new ye("C").set({text:"Contact",url:"https://www.abcnews.com"})])))},{at:"1200px",view:(new ko).set({background:"#ecf0f1",mar:[{a:21}],maxHeight:"100px",radius:"1rem"}).add([new Vt("Company").set({size:"S6",font:"Helvetica"}),new Qo(!0),(new Sr).set({behaviour:"mouseover",pad:[{a:40}],padding:"10px",border:"1px solid black",radius:"30px",width:"130px"}).add([new Vt("More").set({cursor:"pointer",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 Qn).set({flexDir:"column",mar:[{t:"10px"}],radius:".3rem"}).add([new ye("").set({text:"Who we are",url:"jk",cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new ye("").set({text:"Info",url:"#u",cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"}),new ye("").set({text:"About",url:"#u",cursor:"pointer",fluidc:"S6",pad:[{l:10,r:10}],font:"Arial",align:"center",weight:"bold"})])])].concat(Ns(i?a():[(new ye).set({text:"About",url:"#a"}),(new ye).set({text:"Services",url:"#a"}),(new ye).set({text:"Contact",url:"#a"})])))}]});return this.attachRaster(u,t.el,r)}},{key:"sideNav",value:function(t){t.customOptions;var e,n,r=Array.isArray(null===(e=t.el)||void 0===e?void 0:e.items)&&t.el.items.length>0,o=Array.isArray(null===(n=t.el)||void 0===n?void 0:n.items)&&t.el.items.length?t.el.items.map(Ys):[{title:"Home",link:"@e"},{title:"Projects",link:"@e"},{title:"Services",link:"@e"}],i=o.map(function(t,e){return new ye('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:r&&t.link||"#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}})}),a=(new Sr).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 Vt("More").set({cursor:"pointer",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 Qn).set({centerColumn:!0,radius:"0.7rem",background:"#1abc9c",makeResponsiveBehaviour:"undefined"}).add([(new ye).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 ye).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"}})])]),s=o.map(function(t,e){return new ye('"'.concat(t.title,'"')).set({fluidc:"S4",text:t.title,link:t.link,isNavA:!0,url:r&&t.link||"#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&&(s.push(a),i.push(a));var l=(new Qn).set({column:!0}).add([new Vt("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}]})].concat(Ns((t.el.animation?s:i).slice(0,o.length).filter(Boolean)),Ns(t.el.animation&&t.el.dropdown?[s[o.length]]:[]),[new Vt("Company, 2025").set({pad:[{a:20}],animation:{range:["0px","1900px"],op:{name:"animation",color:"green",width:"1px"}}})])),c=(new Qn).set({column:!0}).add([new Vt("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}]})]),u=(new Ve).setup({animate:!0,radius:"1rem",isSide:!0,background:"#ecf0f1",hamColour:{opened:"#0f766e",closed:"#c2410c"},mobileSize:"1.2em",fixed:!0,tags:{open:"sidebar:open",close:"sidebar:closed"}}).items(t.el.offcanvas?c:l),f=this.filteroRaster(t.el.id,t.customOptions);return f&&u.rasterize(f),u}},{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 nn).set({id:null!=t.el.id&&""!==t.el.id?String(t.el.id):"#3",templateCols:r,height:"600px"}).add([new Vt("I am free").set({border:"3px solid green",font:"Arial",size:"S1",color:"#1abc9c",gpos:null!=n?n.text:null,zIndex:1}),(new ie).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,n=t.el;return(new os).set(Gs(Gs({},null!=n.id&&""!==n.id?{id:String(n.id)}:{}),{},{diameter:108,background:"#1abc9c",stroke:this.filtero("blast",n.id,t.customOptions),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:null!==(e=this.filtero("transform",n.id,t.customOptions))&&void 0!==e?e:n.transform,filtera:this.filtero("filter",n.id,t.customOptions),raster:this.filteroRaster(n.id,t.customOptions)}))}},{key:"mapPolygon",value:function(t){var e,n,r=t.el,o=null!==(e=t.el.sides)&&void 0!==e?e:7;return new $a({id:r.id?String(r.id):"hex"}).set(Gs(Gs({},null!=r.id&&""!==r.id?{id:String(r.id)}:{}),{},{sides:o,size:300,background:"#1abc9c",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:null!==(n=this.filtero("transform",r.id,t.customOptions))&&void 0!==n?n:r.transform,filtera:this.filtero("filter",r.id,t.customOptions),raster:this.filteroRaster(r.id,t.customOptions)}))}},{key:"mapText",value:function(t){var e,n,r,o=t.el;return new Vt(o.text||o.value).set(Gs(Gs({},this.elOpts(o,["value","stroke","gradient","animation","shadow","span","backgroundOp","marginOp","transform","filtera","raster"])),{},{id:o.id,class:o.class,color:o.color,size:this.getElType(o.type),tag:o.tag,font:null!==(e=o.font)&&void 0!==e?e:"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),span:this.filtero("span",o.id,t.customOptions),backgroundOp:this.filtero("background",o.id,t.customOptions),marginOp:this.filtero("margin",o.id,t.customOptions),transform:null!==(n=this.filtero("transform",o.id,t.customOptions))&&void 0!==n?n:o.transform,filtera:this.filtero("filter",o.id,t.customOptions),raster:this.filteroRaster(o.id,t.customOptions),resprop:null!==(r=o.resprop)&&void 0!==r?r:null}))}},{key:"mapImage",value:function(t){var e=t.el;return new ie(e.url).set(Gs(Gs({},this.elOpts(e)),{},{url:e.url,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,n,r,o=t.customOptions.filter(function(t){return"link-style"===t.op.name}),i=t.el;return t.el.id&&(i.id=t.el.id),t.el.link&&t.el.text&&(i.url=t.el.link,i.text=t.el.text),i.animation=this.filtero("animation",t.el.id,t.customOptions),i.class=t.el.class,i.width=t.el.width,i.font=null!==(e=t.el.font)&&void 0!==e?e:"Arial",i.fluidc=t.el.fluidc,i.transform=null!==(n=this.filtero("transform",t.el.id,t.customOptions))&&void 0!==n?n:t.el.transform,i.shadow=this.filtero("shadow",t.el.id,t.customOptions),i.gradient=this.filtero("gradient",t.el.id,t.customOptions),i.blast=this.filtero("blast",t.el.id,t.customOptions),i.backgroundOp=this.filtero("background",t.el.id,t.customOptions),i.raster=this.filteroRaster(t.el.id,t.customOptions),i.pad=null!==(r=t.el.pad)&&void 0!==r?r:[{a:10}],o.length>0?Pa.style({el:t.el,re:i,bst:o,options:t.customOptions})[o.length-1]:(new ye).set(i)}},{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 // #c2410c is 5.18:1 on white; h2 keeps the outline intact.\n new Text(item.title).set({ size: "S5", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#1d6fe0", \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", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({\n text: item.title, \n url: item.link, \n background: "#1d6fe0", \n pad: [{ lr: "0.5rem", tb: "1rem" }], \n radius: "0.4rem", \n color: "white"\n })\n ])':c,f=Object.entries(this.elOpts(t.el,["backgroundCard","gradient","animation","shadow","marginOp","filtera","blast","raster"])).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)||Bs(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",\n ".concat(JSON.stringify(n),": ").concat(JSON.stringify(r))}).join(""),d=this.gridItemsBuild(t,u),h=' new FlexGrid()\n .set({\n colat: "700px",\n wrap: true,\n align: "center",\n gap: "1rem"'.concat(f,"\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 ").concat(d.src,"\n )\n "),p=function(t){return JSON.parse(JSON.stringify(t))},y=p(this.elOpts(t.el,["backgroundCard","gradient","animation","shadow","marginOp","filtera","blast","raster"])),m=(new ao).set(Gs(Gs(Gs({colat:"700px",wrap:!0,align:"center",gap:"1rem"},y),this.gridOps({gradient:n,animation:r,shadow:o,marginOp:i,filtera:a,blast:l})),void 0!==s?{raster:p(s)}:{}));return m.items(d.cards()),this.withSource(m,h)}},{key:"gridOps",value:function(t){for(var e={},n=0,r=["gradient","animation","shadow","marginOp","filtera","blast"];n<r.length;n++){var o=r[n];void 0!==t[o]&&(e[o]=JSON.parse(JSON.stringify(t[o])))}return e}},{key:"withSource",value:function(t,e){return t.toCode=function(){return[e]},t}},{key:"gridItemsBuild",value:function(t,e){var n=this,r=t.el.items,o=!!t.el.backgroundCard,i=t.el,a={gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),marginOp:this.filtero("margin",i.id,t.customOptions),filtera:this.filtero("filter",i.id,t.customOptions),blast:this.filtero("blast",i.id,t.customOptions)},s={width:"300px",height:"700px",radius:"0.7rem",mar:{sides:["all"],value:"0.8rem"}},l={background:"#1d6fe0",pad:[{lr:"0.5rem",tb:"1rem"}],radius:"0.4rem",color:"white"},c=function(t,e){return o?(new po).set({url:t.img,font:"Arial",mar:{sides:["all"],value:"0.8rem"},inpad:"1rem",useBrightness:!0}).items([new Vt(t.title).set({fluidc:"S6",tag:"h2",color:"#c2410c"}),new ye("Link").set(Gs({text:t.title,url:t.link},l))]):(new Gr).set(Gs(Gs({},s),n.gridOps(a))).items([new ie(t.img).set(e?{isFull:!0,url:t.img,alt:t.alt}:{isFull:!0,url:t.img}),new Vt(t.title).set({size:"S5",tag:"h2",color:"#c2410c"}),new ye("Link").set(Gs(Gs({text:t.title,url:t.link},l),{},{mar:[{a:21}]}))])};if(!Array.isArray(r)||0===r.length){var u=[{img:"https://upload.wikimedia.org/wikipedia/commons/3/3a/Starship_S20.jpg",title:"Starship",link:"#ship"},{img:"https://upload.wikimedia.org/wikipedia/commons/1/16/Apollo_11_Launch_-_GPN-2000-000630.jpg",title:"Saturn V",link:"#saturn"},{img:"https://upload.wikimedia.org/wikipedia/commons/d/d6/STS120LaunchHiRes-edit1.jpg",title:"Shuttle",link:"#shuttle"}];return{src:this.gridItemsSource(t,e),cards:function(){return u.map(function(t){return c(t,!1)})}}}var f=function(t){return Array.isArray(t)},d=r.filter(function(t){return!f(t)});if(!r.some(f)){var h=d.some(function(t){return t&&void 0!==t.alt}),p=JSON.parse(JSON.stringify(d));return{src:this.gridItemsSource(t,e),cards:function(){return p.map(function(t){return c(t,h)})}}}var y=r.map(function(e){return f(e)?e.map(function(e){return n.mapType(Gs(Gs({},t),{},{el:e}))}):null}),m=function(t){return("string"==typeof t?t:[].concat(t&&t.toCode?t.toCode():[]).join("")).trim()},v=r.map(function(t,e){return f(t)?'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n '.concat(y[e].map(m).filter(Boolean).join(",\n "),"\n ])"):n.cardFromShorthand(t)}),b=function(t){return JSON.parse(JSON.stringify(null!=t?t:""))};return{src:"[\n ".concat(v.join(",\n "),"\n ]"),cards:function(){return r.map(function(t,e){return f(t)?(new Gr).set(Gs({},s)).items(y[e].filter(function(t){return t&&"object"===qs(t)})):(new Gr).set(Gs({},s)).items([new ie(b(t.img)).set(void 0===t.alt?{isFull:!0,url:b(t.img)}:{isFull:!0,url:b(t.img),alt:b(t.alt)}),new Vt(b(t.title)).set({size:"S5",tag:"h2",color:"#c2410c"}),new ye("Link").set(Gs({text:b(t.title),url:b(t.link)},l))])})}}}},{key:"gridItemsSource",value:function(t,e){var n=this,r=t.el.items;if(!Array.isArray(r)||0===r.length)return'[\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(e,"\n )");var o,i=function(t){return Array.isArray(t)},a=r.filter(function(t){return!i(t)});if(0===r.filter(i).length)return"".concat(JSON.stringify(a,null,2).split("\n").map(function(t,e){return 0===e?t:" "+t}).join("\n"),".map(item => \n ").concat((o=e,a.some(function(t){return t&&void 0!==t.alt})?o.replace("url: item.img}","url: item.img, alt: item.alt}"):o),"\n )");var s=r.map(function(e){return i(e)?n.cardFromSpecs(t,e):n.cardFromShorthand(e)});return"[\n ".concat(s.join(",\n "),"\n ]")}},{key:"cardFromSpecs",value:function(t,e){var n=this,r=e.map(function(e){var r=n.mapType(Gs(Gs({},t),{},{el:e}));return"string"==typeof r?r.trim():(r&&"function"==typeof r.toCode?[].concat(r.toCode()).join(""):"").trim()}).filter(Boolean);return'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n '.concat(r.join(",\n "),"\n ])")}},{key:"cardFromShorthand",value:function(t){var e=function(t){return JSON.stringify(null!=t?t:"")};return'new Card()\n .set({ width: "300px", height: "700px", radius: "0.7rem", mar: { sides: ["all"], value: "0.8rem" } })\n .items([\n new Image('.concat(e(t.img),").set({isFull: true, url: ").concat(e(t.img)).concat(void 0===t.alt?"":", alt: ".concat(e(t.alt)),"}),\n new Text(").concat(e(t.title),').set({ size: "S5", tag: "h2", color: "#c2410c" }),\n new Link("Link").set({ text: ').concat(e(t.title),", url: ").concat(e(t.link),', background: "#1d6fe0", pad: [{ lr: "0.5rem", tb: "1rem" }], radius: "0.4rem", color: "white" })\n ])')}},{key:"checkbox",value:function(t){var e=t.el,n="string"==typeof e.label?new Vt(e.label).set({size:"S6"}):e.label;return this.attachRaster((new ii).set(Gs(Gs({},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 Bn).set(this.elOpts(n)),o=Array.isArray(n.children)?n.children:null;return o&&r.add(o.map(function(n){return e.mapType(Gs(Gs({},t),{},{el:n}))})),this.attachRaster(r,n,t.customOptions)}},{key:"form",value:function(t){var e,n=this,r=t.el,o=(new _a).set(Gs(Gs(Gs({action:null!==(e=r.action)&&void 0!==e?e:""},void 0!==r.method?{method:r.method}:{}),void 0!==r.id?{id:r.id}:{}),void 0!==r.title?{title:r.title}:{})),i=Array.isArray(r.children)?r.children:null;return i&&o.add(i.map(function(e){return n.mapType(Gs(Gs({},t),{},{el:e}))})),o}},{key:"simple",value:function(t){var e,n,r,o,i=this,a=t.el,s=Array.isArray(a.react)?a.react:[];if(!s.length)throw new Error('[nodality] a "simple" element needs a non-empty `react` array of { at, template }.');var l=(Array.isArray(a.children)?a.children:[]).map(function(e){return i.mapType(Gs(Gs({},t),{},{el:e}))}),c=l.map(function(t){var e=t.toCode();return Array.isArray(e)?e.join(""):String(e)}).join(",\n "),u="new AreaSwitcher()\n .set(".concat(JSON.stringify(Gs({gap:null!==(e=a.gap)&&void 0!==e?e:"10px",height:null!==(n=a.height)&&void 0!==n?n:"700px"},void 0!==a.id?{id:a.id}:{})),")\n .react(").concat(JSON.stringify(s,null,2),")\n .add([\n ").concat(c,"\n ])"),f=(new La).set(Gs({gap:null!==(r=a.gap)&&void 0!==r?r:"10px",height:null!==(o=a.height)&&void 0!==o?o:"700px"},void 0!==a.id?{id:a.id}:{})).react(JSON.parse(JSON.stringify(s)));return f.add(l),this.withSource(f,u)}},{key:"mapWrap",value:function(t){var e,n,r,o=this,i=t.el,a=null!==(e=t.el.kind)&&void 0!==e?e:"",s=new Qn(a).set(Gs(Gs({},this.elOpts(i)),{},{font:null!==(n=i.font)&&void 0!==n?n:"Arial",stroke:this.filtero("blast",i.id,t.customOptions),gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),transform:null!==(r=this.filtero("transform",i.id,t.customOptions))&&void 0!==r?r:i.transform,filtera:this.filtero("filter",i.id,t.customOptions),raster:this.filteroRaster(i.id,t.customOptions)})),l=Array.isArray(i.children)?i.children:null;return l&&s.add(l.map(function(e){return o.mapType(Gs(Gs({},t),{},{el:e}))})),s}},{key:"mapUList",value:function(t){var e,n,r,o=this,i=t.el,a=null!==(e=t.el.kind)&&void 0!==e?e:"",s=new Ai(a).set(Gs(Gs({},this.elOpts(i)),{},{font:null!==(n=i.font)&&void 0!==n?n:"Arial",stroke:this.filtero("blast",i.id,t.customOptions),gradient:this.filtero("gradient",i.id,t.customOptions),animation:this.filtero("animation",i.id,t.customOptions),shadow:this.filtero("shadow",i.id,t.customOptions),transform:null!==(r=this.filtero("transform",i.id,t.customOptions))&&void 0!==r?r:i.transform,filtera:this.filtero("filter",i.id,t.customOptions),raster:this.filteroRaster(i.id,t.customOptions)})),l=Array.isArray(i.items)?i.items:null;return l&&s.setItems(l.map(function(e){return"string"==typeof e?new Vt(e).set({}):o.mapType(Gs(Gs({},t),{},{el:e}))})),s}},{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.some(function(t){return $s(t,e)})})[0]}},{key:"elOpts",value:function(t){for(var e=new Set(["type","children","items","breakpoints","inputType","text","url"].concat(Ns(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]))),n={},r=0,o=Object.keys(t);r<o.length;r++){var i=o[r];e.has(i)||(n[i]=t[i])}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&&w.includes(e.op)&&(!e.target||t&&e.target.some(function(e){return $s(e,t)}))});return n.length>0?n:void 0}}],null&&Us(t.prototype,null),e&&Us(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),Zs={"t-vhs":{summary:"Tape-glitch morph: chroma splits and the image tears, strongest at the midpoint, gone at both ends.",nodes:[{op:"aberration",amount:[0,18,0]},{op:"flow",strength:[0,34,0],scale:60,speed:0,window:[.15,.95],ease:"in-out"}]},"t-dissolve":{summary:"Ordered-dither dissolve — the old state breaks into pixels before the new one resolves.",nodes:[{op:"dither",levels:[8,2,8],size:[1,7,1],amount:[0,1,0],ease:"in-out"}]},"t-split":{summary:"Per-side morph: the old state posterises to duotone while the new one resolves through a halftone screen.",nodes:[{op:"duotone",side:"old",amount:[0,1,1],dark:"#0B1B2B",light:"#1abc9c"},{op:"halftone",side:"new",size:[10,6,2],amount:[1,1,0],softness:.35,angle:15}]},"t-bloom":{summary:"A soft halftone bloom through the middle of the morph.",nodes:[{op:"halftone",size:[2,9,2],amount:[0,1,0],softness:.4,angle:15,window:[.1,.9]}]},"t-fluid":{summary:"Liquid morph: the old state is carried on a current and pours into the new one, calm at both ends.",nodes:[{op:"flow",strength:[0,46,0],scale:130,speed:.8,ease:"in-out"},{op:"aberration",amount:[0,4,0],window:[.2,.8]}]},"t-particles":{summary:"Particle morph: the old state breaks into dots that scatter and re-form as the new one, with see-through gaps in between.",nodes:[{op:"particles",size:9,amount:[0,1,1,0],reach:5,ease:"in-out"}]},"liquid-hero":{summary:"A ripple that trails the pointer, then relaxes back in ~1.5s.",live:"enhanced",nodes:[{op:"stir",by:"mouse",radius:.055,force:2.2,strength:16,curl:.8,resolution:256,decay:.988}]},linger:{summary:"The same current, held for four or five seconds. Only `decay` differs.",live:"enhanced",nodes:[{op:"stir",by:"mouse",radius:.055,force:2.2,strength:7,curl:.8,resolution:256,decay:.9985,dye:0,sheen:0}]},"flow-field":{summary:"A standing current across the whole element. No solver, runs anywhere.",nodes:[{op:"flow",strength:18,scale:120,speed:.25}]},"flow-pointer":{summary:"The same current, but only around the pointer.",nodes:[{op:"flow",by:"mouse",strength:26,scale:100,radius:320}]},"print-shop":{summary:"Offset-litho dot screen with white seams under the glyphs.",nodes:[{op:"halftone",size:6,angle:15},{op:"edges",color:"#FFFFFF"}]},newsprint:{summary:"One-bit ordered dither — ink on paper, no greys.",nodes:[{op:"dither",mono:!0,ink:"#0B1B2B"}]},crt:{summary:"Posterised to a few levels, with a lens-like colour split.",nodes:[{op:"dither",levels:3},{op:"aberration",amount:6}]},glass:{summary:"Refractive metaball lens over untouched content.",nodes:[{op:"blobs",refract:70,dispersion:1,frost:.25}]},"hex-lens":{summary:"Hex cells rise toward the pointer; flush and invisible at rest.",nodes:[{op:"hexalize",size:26,lift:.3,by:"hover",radius:220}]},ripple:{summary:"The coordinate space pushes away from the pointer.",nodes:[{op:"offset",by:"mouse",strength:22,radius:280}]},spotlight:{summary:"A duotone disc that travels with the pointer; the rest is untouched.",nodes:[{op:"mask",from:"radial",as:"spot",by:"mouse",radius:200},{op:"duotone",masked:"spot",colors:["#104B87","#E8FF00"]}]},turbulent:{summary:"Animated noise drives the displacement, so the warp breathes.",nodes:[{op:"noise",as:"turbulence",scale:3,speed:.4},{op:"offset",masked:"turbulence",by:"static",strength:30}]},echoes:{summary:"Changing content leaves a fading trail behind it.",live:"required",nodes:[{op:"echo",decay:.92,strength:.85}]},comet:{summary:"A long, tinted comet tail. Needs live capture — on snapshot you see nothing move.",live:"required",nodes:[{op:"echo",decay:.975,strength:.95,tint:"#7FD4FF",tintAmount:.65}]}};function tl(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Zs[t];if(!r)throw new Error("[nodality] "+Pt(t,Object.keys(Zs),"raster preset"));return(e=r.nodes,JSON.parse(JSON.stringify(e))).map(function(t){return Object.assign(t,n)})}var el={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}};function nl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"function"!=typeof t.setProgress){var n=0;t={setProgress:function(t){return n=Math.min(1,Math.max(0,Number(t)||0))},get progress(){return n}}}var r=null!=e.duration?e.duration:600,o=el[e.easing]||el["in-out"],i=!1!==e.respectReducedMotion,a=0,s=t.progress||0,l=s,c=0,u=0,f=0,d=0,h=!1,p=null,y=null,m=!1,v=function(){if(!m){var e="undefined"!=typeof performance?performance.now():Date.now();c||(c=e,u=e),f+=Math.min(e-u,Math.max(d/6,50)),u=e;var n=d<=0?1:Math.min(1,f/d);if(t.setProgress(s+(l-s)*o(n)),n>=1)return function(){h=!1,a=0;var e=p;p=null,e&&e(t.progress)}();a=requestAnimationFrame(v)}},b={get value(){return t.progress},get running(){return h},set:function(e){return b.stop(),t.setProgress(e),t.progress},to:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(m)return Promise.resolve(t.progress);var o=Math.min(1,Math.max(0,Number(e)||0));if(i&&"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return b.set(o),Promise.resolve(o);if(p){var u=p;p=null,u(t.progress)}a&&cancelAnimationFrame(a),s=t.progress,l=o;var y=Math.abs(l-s);return y<1e-4?(t.setProgress(o),Promise.resolve(o)):(d=(null!=n.duration?n.duration:r)*y,c=0,f=0,h=!0,a=requestAnimationFrame(v),new Promise(function(t){p=t}))},stop:function(){if(a&&cancelAnimationFrame(a),a=0,h=!1,p){var e=p;p=null,e(t.progress)}return t.progress},bindScroll:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="string"==typeof e?document.querySelector(e):e;if(!r)return b;b.unbindScroll(),b.stop();var o=null!=n.start?n.start:0,i=null!=n.end?n.end:1,a=function(){if(!m){var e=r.getBoundingClientRect(),n=window.innerHeight||1,a=(n-e.top)/(n+e.height||1),s=(Math.min(1,Math.max(0,a))-o)/(i-o||1);t.setProgress(Math.min(1,Math.max(0,s)))}};return y={node:r,update:a},window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),a(),b},unbindScroll:function(){return y?(window.removeEventListener("scroll",y.update),window.removeEventListener("resize",y.update),y=null,b):b},drive:function(t){return b.set(t)},destroy:function(){m=!0,b.stop(),b.unbindScroll()}};return b}function rl(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return ol(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,s=0,l=t,d.n=n,a}};function h(n,r){for(s=n,l=r,e=0;!f&&c&&!o&&e<u.length;e++){var o,i=u[e],h=d.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),s=u,l=p;(e=s<2?t:l)||!f;){i||(s?s<3?(s>1&&(d.n=-1),h(s,l)):d.n=l:d.v=l);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=d.n<0)?l:n.call(r,d))!==a)break}catch(e){i=t,s=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(ol(e={},r,function(){return this}),e),f=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,ol(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,ol(f,"constructor",c),ol(c,"constructor",l),l.displayName="GeneratorFunction",ol(c,o,"GeneratorFunction"),ol(f),ol(f,o,"Generator"),ol(f,r,function(){return this}),ol(f,"toString",function(){return"[object Generator]"}),(rl=function(){return{w:i,m:d}})()}function ol(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}ol=function(t,e,n,r){if(e)o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n;else{var i=function(e,n){ol(t,e,function(t){return this._invoke(e,n,t)})};i("next",0),i("throw",1),i("return",2)}},ol(t,e,n,r)}function il(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ll(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 al(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)||ll(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 sl(t){return function(t){if(Array.isArray(t))return cl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ll(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 ll(t,e){if(t){if("string"==typeof t)return cl(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)?cl(t,e):void 0}}function cl(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 ul(t){return ul="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},ul(t)}function fl(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function dl(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){fl(i,r,o,a,s,"next",t)}function s(t){fl(i,r,o,a,s,"throw",t)}a(void 0)})}}var hl=function(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:r.x-n.x,y:r.y-n.y,w:r.width,h:r.height}};function pl(t,e,n){return yl.apply(this,arguments)}function yl(){return yl=dl(rl().m(function t(e,n,r){var o,i,a,s,l,c,u,f,d,h,p=arguments;return rl().w(function(t){for(;;)switch(t.n){case 0:for(o=p.length>3&&void 0!==p[3]?p[3]:1,(i=e.cloneNode(!0)).style.position="static",i.style.left=i.style.top="0",i.style.margin="0",i.style.visibility="visible",a=[e].concat(sl(e.querySelectorAll("*"))),s=[i].concat(sl(i.querySelectorAll("*"))),l=0;l<a.length;l++)c=getComputedStyle(a[l]),s[l].style.fontSize=c.fontSize,s[l].style.lineHeight=c.lineHeight,s[l].style.fontWeight=c.fontWeight,s[l].style.fontFamily=c.fontFamily,s[l].style.letterSpacing=c.letterSpacing,s[l].style.width=c.width,s[l].style.height=c.height,s[l].style.padding=c.padding,s[l].style.boxSizing=c.boxSizing,l>0&&(s[l].style.margin=c.margin),s[l].style.color=c.color,s[l].style.backgroundColor=c.backgroundColor,s[l].style.backgroundImage=c.backgroundImage,s[l].style.borderStyle=c.borderStyle,s[l].style.borderWidth=c.borderWidth,s[l].style.borderColor=c.borderColor,s[l].style.borderRadius=c.borderRadius,s[l].style.boxShadow=c.boxShadow;return u=Math.max(1,Math.min("undefined"!=typeof window&&window.devicePixelRatio||1,3)),f=Math.max(1,Math.min(u*Math.max(1,o||1),4096/Math.max(n,r,1))),d='<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(n*f,'" ')+'height="'.concat(r*f,'" viewBox="0 0 ').concat(n," ").concat(r,'">')+'<foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">'+(new XMLSerializer).serializeToString(i)+"</div></foreignObject></svg>",h=document.createElement("img"),t.n=1,new Promise(function(t,e){h.onload=t,h.onerror=e,h.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(d)});case 1:return t.a(2,h)}},t)})),yl.apply(this,arguments)}var ml=function(t){if(!t)return[];if(Array.isArray(t))return t;try{return tl(t)||[]}catch(t){return[]}},vl=function(t){return String(t||"").replace(/\s+/g," ").trim().toLowerCase()},bl=function(t){return"string"==typeof t&&t.startsWith("#")?t.slice(1):t},gl=function(t){return(Array.isArray(t.chain)&&t.chain.length?t.chain:[{from:t.from,to:t.to}]).map(function(e){var n=function(n,r){return void 0!==e[n]?e[n]:void 0!==t[n]?t[n]:r},r=e.to&&!Array.isArray(e.to)&&"object"===ul(e.to)?e.to:null,o=r?sl(new Set(Object.values(e.to))).map(bl):(Array.isArray(e.to)?e.to:[e.to]).map(bl),i=new Map;if(r)for(var a=0,s=Object.entries(e.to);a<s.length;a++){var l=al(s[a],2),c=l[0],u=l[1];i.set(vl(c),bl(u))}return{from:bl(e.from),byLabel:r,toIds:o,labelToId:i,effect:n("effect"),duration:n("duration",900),back:!1!==n("back",!0),live:!0===n("live"),fade:n("fade","morph")}})};function wl(t,e,n){if(!t||"undefined"==typeof document)return[];var r=(n||[]).filter(function(t){return t&&"morph"===t.op});if(!r.length)return[];var o=sl(t.children),i=function(n){var r=bl(n),i=document.getElementById(r);if(i&&t.contains(i))return i;var a=(e||[]).findIndex(function(t){return t&&bl(t.id)===r});return a>=0?o[a]:null};return r.map(function(e){return function(t,e,n){var r=gl(e),o=r[0],i=o&&o.from,a=null!=i?n(i):null,s=new Map;a&&s.set(i,a);var l,c=il(r);try{for(c.s();!(l=c.n()).done;){var u=l.value,f=n(u.from);f&&!s.has(u.from)&&s.set(u.from,f);var d,h=il(u.toIds);try{for(h.s();!(d=h.n()).done;){var p=d.value,y=n(p);y&&!s.has(p)&&s.set(p,y)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){c.e(t)}finally{c.f()}if(!a||!o.toIds.some(function(t){return s.has(t)}))return console.warn("[nodality] morph: could not resolve",i,"->",o?o.toIds:[]),null;var m=function(t){return r.find(function(e){return e.from===t})||null},v=document.createElement("div");v.className="nod-morph",v.style.cssText="position:relative;",t.insertBefore(v,a);var b=document.createElement("div");b.className="nod-morph-host",b.style.cssText="position:absolute;inset:0;";var g=document.createElement("div");g.className="nod-morph-live",g.style.cssText="position:absolute;inset:0;",v.appendChild(b),v.appendChild(g),g.appendChild(a),a.style.position="absolute",a.style.left=a.style.top="0";var w,x=il(s);try{for(x.s();!(w=x.n()).done;){var k=al(w.value,2),S=k[0],O=k[1];S!==i&&O.remove()}}catch(t){x.e(t)}finally{x.f()}var j=i,E=[],_=function(){return s.get(j)||a},A=function(t){v.style.minHeight=Math.max(_().getBoundingClientRect().height,t||0)+24+"px"};A(0);var T=null,C=null,P=-1,R=null,I=null,M=null,D=!1,F=null,z=null,L=r.length>1,N=function(){var t=dl(rl().m(function t(e,n,r){var o,i,a,s,l,c,u;return rl().w(function(t){for(;;)switch(t.n){case 0:if(!(o=sl(n.querySelectorAll("img"))).length){t.n=2;break}return t.n=1,Promise.all(o.map(function(t){return t.complete&&t.naturalWidth?null:"function"==typeof t.decode?t.decode().catch(function(){}):new Promise(function(e){t.addEventListener("load",e,{once:!0}),t.addEventListener("error",e,{once:!0})})}));case 1:return t.n=2,new Promise(function(t){return requestAnimationFrame(t)});case 2:return i=hl(b,e),a=hl(b,n),A(Math.max(i.y+i.h,a.y+a.h)),t.n=3,Promise.all([pl(e,i.w,i.h),pl(n,a.w,a.h)]);case 3:s=t.v,l=al(s,2),c=l[0],u=l[1],T=ht(b,ml(r.effect),{transition:{oldImage:c,newImage:u,oldRect:i,oldTo:a,newRect:a,newFrom:i,standDownAtStart:!0,live:!0===r.live,fade:r.fade||"morph"}}),C&&C.destroy(),C=nl(T,{duration:null!=r.duration?r.duration:900});case 4:return t.a(2)}},t)}));return function(e,n,r){return t.apply(this,arguments)}}(),B=function(){var t=dl(rl().m(function t(e){var n,r,o,i,a,l,c,u,f,d;return rl().w(function(t){for(;;)switch(t.n){case 0:if((n=m(j))&&n.toIds.includes(e)){t.n=1;break}return t.a(2);case 1:if(r=s.get(e)){t.n=2;break}return t.a(2);case 2:o=_(),P=n.toIds.indexOf(e),M=j,i=il(ut());try{for(i.s();!(a=i.n()).done;)l=a.value,v.contains(l.canvas)&&l.destroy()}catch(t){i.e(t)}finally{i.f()}for(c=0,u=sl(b.children);c<u.length;c++)(f=u[c])!==o&&f.remove();return b.appendChild(r),I=o,R=r,r.style.visibility="hidden",d=hl(b,o),Object.assign(r.style,{position:"absolute",left:"0",top:Math.round(L?d.y:d.h+20)+"px"}),t.n=3,N(o,r,n);case 3:if(C){t.n=4;break}return t.a(2);case 4:return F=M,z=e,C.set(0),Y(e),n.back&&V(r),t.n=5,C.to(1);case 5:1===t.v&&R===r&&J(e,o,n);case 6:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),W=!1,q=0,U=function(){var t=dl(rl().m(function t(){var e,n,r;return rl().w(function(t){for(;;)switch(t.n){case 0:if(E.length){t.n=1;break}return t.a(2);case 1:if(e=E[E.length-1],n=s.get(e)){t.n=2;break}return t.a(2);case 2:if(r=_(),!T||!C||F!==e||z!==j){t.n=4;break}return t.n=3,C.to(0);case 3:return 0===t.v&&X(e),t.a(2);case 4:return t.n=5,G(e,n,r);case 5:return t.a(2)}},t)}));return function(){return t.apply(this,arguments)}}(),H=function(){var t=dl(rl().m(function t(){return rl().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!W){t.n=1;break}return q++,t.a(2);case 1:return W=!0,t.p=2,t.n=3,U();case 3:if(!(q>0&&E.length)){t.n=5;break}return q--,t.n=4,U();case 4:t.n=3;break;case 5:return t.p=5,W=!1,q=0,t.f(5);case 6:return t.a(2)}},t,null,[[2,,5,6]])}));return function(){return t.apply(this,arguments)}}(),G=function(){var t=dl(rl().m(function t(e,n,r){var o,i,s,l,c;return rl().w(function(t){for(;;)switch(t.n){case 0:return o=sl(ut()).filter(function(t){return v.contains(t.canvas)}),i=m(e)||{},n===a?(D=!0,g.style.display=""):n.parentNode!==b&&(n.style.visibility="hidden",b.appendChild(n),s=hl(b,r),Object.assign(n.style,{position:"absolute",left:"0",top:Math.round(L?s.y:0)+"px"})),t.n=1,N(n,r,i);case 1:l=il(o);try{for(l.s();!(c=l.n()).done;)c.value.destroy()}catch(t){l.e(t)}finally{l.f()}if(D=!1,C){t.n=2;break}return t.a(2);case 2:return F=e,z=j,I=n,R=r,C.set(1),t.n=3,C.to(0);case 3:0===t.v&&X(e);case 4:return t.a(2)}},t)}));return function(e,n,r){return t.apply(this,arguments)}}(),X=function(t){E[E.length-1]===t&&E.pop(),j=t;var e,n=il(ut());try{for(n.s();!(e=n.n()).done;){var r=e.value;v.contains(r.canvas)&&r.destroy()}}catch(t){n.e(t)}finally{n.f()}T=null,C=null,F=null,z=null,M=E.length?E[E.length-1]:null,Y(t)},J=function(t,e,n){null!=M&&M!==t&&E.push(M),j=t,I=e&&e!==a?e:null,Y(t),n&&n.back&&V(s.get(t))},V=function(t){if(t){var e=sl(t.querySelectorAll("button")).find(function(t){return!t.dataset.nodMorphWired&&!t.dataset.nodMorphBack&&!t.closest("form")});e&&(e.dataset.nodMorphBack="1",e.addEventListener("click",function(){H()}))}},$=new Set,Y=function(t){var e=m(t),n=s.get(t);if(e&&n){var r=function(t){var e=sl(t.querySelectorAll("a"));if(e.length)return e;var n=sl(t.querySelectorAll("button, [role=button]"));return n.length?n:[t]}(n),o=!!e.byLabel&&r.some(function(t){return e.labelToId.has(vl(t.textContent))});r.forEach(function(t){return function(t,e,n,r){if(!t.dataset.nodMorphWired&&!t.dataset.nodMorphBack){var o=r?e.labelToId.get(vl(t.textContent)):1===e.toIds.length?e.toIds[0]:e.byLabel?e.labelToId.get(vl(t.textContent)):e.toIds[n.indexOf(t)];o&&s.has(o)&&(t.dataset.nodMorphWired="1",t.dataset.nodMorphTo=o,t.addEventListener("click",function(t){s.has(o)&&(t.preventDefault(),B(o))}))}}(t,e,r,o)}),"undefined"==typeof MutationObserver||$.has(t)||($.add(t),new MutationObserver(function(){return Y(t)}).observe(n,{childList:!0,subtree:!0}))}};Y(i);var Q=function(){if(v.isConnected){var t=T?T.progress:0,e=b.querySelector("canvas"),n=!!e&&"visible"===(e.style.visibility||"visible"),r=!T||!n,o=D||r&&t<=0&&(j===i||I===a)?"":"none";g.style.display!==o&&(g.style.display=o);var s=R||b.firstElementChild;if(s&&s.style){var l=T&&r&&t>=1?"":"hidden";s.style.visibility!==l&&(s.style.visibility=l)}if(I&&I!==a&&I.style){var c=r&&t<=0?"":"hidden";I.style.visibility!==c&&(I.style.visibility=c)}requestAnimationFrame(Q)}};return requestAnimationFrame(Q),{stage:v,from:a,get destinations(){return o.toIds.map(function(t){return s.get(t)||null})},get states(){return s},get current(){return j},get history(){return[].concat(E)},get progress(){return T?T.progress:0},get active(){return P},goTo:function(t){var e=m(j);return e?B(e.toIds[t]):void 0},goToState:B,back:function(){C&&C.to(0)},goBack:H,destroy:function(){C&&C.destroy();var t,e=il(ut());try{for(e.s();!(t=e.n()).done;){var n=t.value;v.contains(n.canvas)&&n.destroy()}}catch(t){e.e(t)}finally{e.f()}v.remove()}}}(t,e,i)}).filter(Boolean)}var xl=["kind","formId","productId"];function kl(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)||Pl(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 Sl(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 Ol(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Sl(Object(n),!0).forEach(function(e){jl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function jl(t,e,n){return(e=function(t){var e=function(t){if("object"!=Il(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Il(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Il(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function El(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(Il(t)+" is not iterable")}function _l(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Al(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,s=0,l=t,d.n=n,a}};function h(n,r){for(s=n,l=r,e=0;!f&&c&&!o&&e<u.length;e++){var o,i=u[e],h=d.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),s=u,l=p;(e=s<2?t:l)||!f;){i||(s?s<3?(s>1&&(d.n=-1),h(s,l)):d.n=l:d.v=l);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=d.n<0)?l:n.call(r,d))!==a)break}catch(e){i=t,s=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(Al(e={},r,function(){return this}),e),f=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Al(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Al(f,"constructor",c),Al(c,"constructor",l),l.displayName="GeneratorFunction",Al(c,o,"GeneratorFunction"),Al(f),Al(f,o,"Generator"),Al(f,r,function(){return this}),Al(f,"toString",function(){return"[object Generator]"}),(_l=function(){return{w:i,m:d}})()}function Al(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Al=function(t,e,n,r){if(e)o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n;else{var i=function(e,n){Al(t,e,function(t){return this._invoke(e,n,t)})};i("next",0),i("throw",1),i("return",2)}},Al(t,e,n,r)}var Tl=_l().m(zl);function Cl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Pl(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 Pl(t,e){if(t){if("string"==typeof t)return Rl(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)?Rl(t,e):void 0}}function Rl(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 Il(t){return Il="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},Il(t)}var Ml=new Set(["input","labelInput","checkbox","radio","picker"]),Dl={text:{type:"string"},email:{type:"string",format:"email"},tel:{type:"string"},url:{type:"string",format:"uri"},number:{type:"number"},password:{type:"string"},date:{type:"string",format:"date"},time:{type:"string",format:"time"},search:{type:"string"}},Fl=function(t){return!!t&&"object"===Il(t)};function zl(t){var e,n,r,o,i;return _l().w(function(a){for(;;)switch(a.p=a.n){case 0:if(Fl(t)){a.n=1;break}return a.a(2);case 1:return a.n=2,t;case 2:e=Array.isArray(t.children)?t.children:[],n=Cl(e),a.p=3,n.s();case 4:if((r=n.n()).done){a.n=6;break}return o=r.value,a.d(El(zl(o)),5);case 5:a.n=4;break;case 6:a.n=8;break;case 7:a.p=7,i=a.v,n.e(i);case 8:return a.p=8,n.f(),a.f(8);case 9:return a.a(2)}},Tl,null,[[3,7,8,9]])}function Ll(t){var e,n="string"==typeof t.name?t.name:t.id;if("string"!=typeof n||!n)return null;if("checkbox"===t.type)e={type:"boolean"};else if("radio"===t.type||"picker"===t.type){var r=Array.isArray(t.items)?t.items.filter(function(t){return"string"==typeof t}):[];e=r.length?{type:"string",enum:r}:{type:"string"},"radio"===t.type&&!0===t.multiple&&(e={type:"array",items:e})}else e=Ol({},Dl[t.inputType]||Dl.text);var o=[t.label,t.placeholder,t.title].find(function(t){return"string"==typeof t&&t.trim()});return o&&(e.description=o.trim()),{key:n,schema:e,required:!0===t.required}}function Nl(t){return t.routes.map(function(t){var e=t.to.map(function(t){return t.label?"".concat(t.label," → ").concat(t.to):t.to}).join(", ");return"from ".concat(t.from,": ").concat(e)}).join("; ")}function Bl(t){return Bl="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},Bl(t)}function Wl(t){if(null!=t){var e=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}throw new TypeError(Bl(t)+" is not iterable")}function ql(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)||Kl(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 Ul(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Hl(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],f=!1,d={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,n){return i=e,s=0,l=t,d.n=n,a}};function h(n,r){for(s=n,l=r,e=0;!f&&c&&!o&&e<u.length;e++){var o,i=u[e],h=d.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,s=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),s=u,l=p;(e=s<2?t:l)||!f;){i||(s?s<3?(s>1&&(d.n=-1),h(s,l)):d.n=l:d.v=l);try{if(c=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,l)))throw TypeError("iterator result is not an object");if(!e.done)return e;l=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=d.n<0)?l:n.call(r,d))!==a)break}catch(e){i=t,s=1,l=e}finally{c=1}}return{value:e,done:f}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(Hl(e={},r,function(){return this}),e),f=c.prototype=s.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,Hl(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return l.prototype=c,Hl(f,"constructor",c),Hl(c,"constructor",l),l.displayName="GeneratorFunction",Hl(c,o,"GeneratorFunction"),Hl(f),Hl(f,o,"Generator"),Hl(f,r,function(){return this}),Hl(f,"toString",function(){return"[object Generator]"}),(Ul=function(){return{w:i,m:d}})()}function Hl(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Hl=function(t,e,n,r){if(e)o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n;else{var i=function(e,n){Hl(t,e,function(t){return this._invoke(e,n,t)})};i("next",0),i("throw",1),i("return",2)}},Hl(t,e,n,r)}function Gl(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 Xl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Gl(Object(n),!0).forEach(function(e){Jl(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Gl(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Jl(t,e,n){return(e=function(t){var e=function(t){if("object"!=Bl(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bl(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vl(t){return function(t){if(Array.isArray(t))return Zl(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Kl(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 $l(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function Yl(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){$l(i,r,o,a,s,"next",t)}function s(t){$l(i,r,o,a,s,"throw",t)}a(void 0)})}}function Ql(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Kl(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 Kl(t,e){if(t){if("string"==typeof t)return Zl(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)?Zl(t,e):void 0}}function Zl(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 tc="nodality-agent-manifest";function ec(t){if(!t)return{text:"",actions:[]};var e,n=function(t){var e=getComputedStyle(t);if("none"===e.display||"0"===e.opacity)return!1;var n=t.getBoundingClientRect();return n.width>0&&n.height>0},r=[],o=Ql(t.querySelectorAll("h1,h2,h3,h4,h5,h6,p,li"));try{for(o.s();!(e=o.n()).done;){var i=e.value;if(n(i)){var a=(i.textContent||"").replace(/\s+/g," ").trim();if(a){var s=i.tagName.toLowerCase();r.push(/^h[1-6]$/.test(s)?"".concat("#".repeat(+s[1])," ").concat(a):a)}}}}catch(t){o.e(t)}finally{o.f()}var l,c=[],u=Ql(t.querySelectorAll("a,button,[role=button]"));try{for(u.s();!(l=u.n()).done;){var f=l.value;if(n(f)){var d=(f.textContent||"").replace(/\s+/g," ").trim();d&&!c.includes(d)&&c.push(d)}}}catch(t){u.e(t)}finally{u.f()}return{text:r.join("\n"),actions:c}}var nc=function(t,e,n){return{ok:!1,code:t,got:e,valid:n}};function rc(t){var e=t.mount,n=t.elements,r=t.nodes,o=t.morphs,i=function(t,e){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).specDraft,r=void 0===n?null:n,o=(Array.isArray(e)?e:[]).find(function(t){return Fl(t)&&"agent-surface"===t.op});if(!o)return null;var i,a=function(t){var e,n=[],r=Cl(Array.isArray(t)?t:[]);try{for(r.s();!(e=r.n()).done;){var o,i=Cl(zl(e.value));try{for(i.s();!(o=i.n()).done;){var a=o.value;n.push(a)}}catch(t){i.e(t)}finally{i.f()}}}catch(t){r.e(t)}finally{r.f()}return n}(t),s=new Map,l=Cl(a);try{for(l.s();!(i=l.n()).done;){var c=i.value;"string"==typeof c.id&&s.set(c.id,c)}}catch(t){l.e(t)}finally{l.f()}var u=new Set((Array.isArray(o.exclude)?o.exclude:[]).filter(function(t){return"string"==typeof t})),f="string"==typeof o.name&&o.name.trim()?o.name.trim().replace(/[^a-zA-Z0-9_-]/g,"_"):null,d=function(t){return f?"".concat(f,"_").concat(t):t},h=[],p=function(t,e){var n=(Array.isArray(t)?t:[]).filter(function(t){return Fl(t)&&"morph"===t.op});if(!n.length)return null;var r,o,i=[],a=Cl(n);try{for(a.s();!(r=a.n()).done;){var s,l=r.value,c=Cl(gl(l));try{for(c.s();!(s=c.n()).done;){var u=s.value;"string"==typeof u.from&&i.push(u)}}catch(t){c.e(t)}finally{c.f()}}}catch(t){a.e(t)}finally{a.f()}if(!i.length)return null;for(var f=i[0].from,d=function(t){return i.filter(function(e){return e.from===t})},h=new Set([f]),p=[f];p.length;){var y,m=Cl(d(p.shift()));try{for(m.s();!(y=m.n()).done;){var v,b=Cl(y.value.toIds);try{for(b.s();!(v=b.n()).done;){var g=v.value;"string"!=typeof g||h.has(g)||(h.add(g),p.push(g))}}catch(t){b.e(t)}finally{b.f()}}}catch(t){m.e(t)}finally{m.f()}}for(var w=[],x=0,k=i;x<k.length;x++){var S=k[x];if(h.has(S.from)&&!e.has(S.from)){var O=[];if(S.byLabel)for(var j=0,E=Object.entries(S.byLabel);j<E.length;j++){var _=kl(E[j],2),A=_[0],T=_[1],C="string"==typeof T&&T.startsWith("#")?T.slice(1):T;e.has(C)||O.push({label:A,to:C})}else{var P,R=Cl(S.toIds);try{for(R.s();!(P=R.n()).done;){var I=P.value;e.has(I)||O.push({label:null,to:I})}}catch(t){R.e(t)}finally{R.f()}}O.length&&w.push({from:S.from,to:O,back:!0===S.back})}}for(var M=[],D=0,F=w;D<F.length;D++){var z,L=Cl(F[D].to);try{for(L.s();!(z=L.n()).done;){var N=z.value;M.includes(N.to)||M.push(N.to)}}catch(t){L.e(t)}finally{L.f()}}return{root:f,states:[f].concat((o=M.filter(function(t){return t!==f}),function(t){if(Array.isArray(t))return Rl(t)}(o)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(o)||Pl(o)||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.")}())),destinations:M,routes:w,canGoBack:w.some(function(t){return t.back})}}(e,u);if(p){var y=p.destinations.filter(function(t){return!u.has(t)});y.length&&h.push({name:d("navigate"),kind:"navigate",description:"Move to another view of this page. These are in-page views reached by a transition, not separate URLs. Routes: "+Nl(p)+".",inputSchema:{type:"object",properties:{destination:{type:"string",enum:y,description:"The view to move to."}},required:["destination"]}}),p.canGoBack&&h.push({name:d("go_back"),kind:"back",description:"Return to the previous view, unwinding the path actually taken rather than following an edge.",inputSchema:{type:"object",properties:{}}})}var m,v=Cl((Array.isArray(o.forms)?o.forms:[]).filter(function(t){return"string"==typeof t}));try{for(v.s();!(m=v.n()).done;){var b=m.value,g=s.get(b);if(g&&"form"===g.type){var w,x={},k=[],S=Cl(zl(g));try{for(S.s();!(w=S.n()).done;){var O=w.value;if(Ml.has(O.type)){var j=Ll(O);j&&!x[j.key]&&(x[j.key]=j.schema,j.required&&k.push(j.key))}}}catch(t){S.e(t)}finally{S.f()}Object.keys(x).length&&h.push({name:d("submit_".concat(b.replace(/[^a-zA-Z0-9_-]/g,"_"))),kind:"submit",formId:b,description:"string"==typeof g.title&&g.title.trim()?g.title.trim():'Fill and submit the "'.concat(b,'" form on this page.'),inputSchema:Ol({type:"object",properties:x},k.length?{required:k}:{})})}}}catch(t){v.e(t)}finally{v.f()}var E,_=Cl((Array.isArray(o.products)?o.products:[]).filter(function(t){return"string"==typeof t}).map(function(t){return t.replace(/^#/,"")}));try{for(_.s();!(E=_.n()).done;){var A=E.value,T=s.get(A)||s.get("#".concat(A));T&&"product"===T.type&&h.push({name:d("get_product_".concat(A.replace(/[^a-zA-Z0-9_-]/g,"_"))),kind:"product",productId:A,description:'Read the product "'.concat(T.handle,'" as it is shown on this page: ')+"name, price for the visitor's market, options and availability. Read-only; buying happens on the shop's checkout.",inputSchema:{type:"object",properties:{}}})}}catch(t){_.e(t)}finally{_.f()}h.push({name:d("read_view"),kind:"read",description:"Read the content currently on screen as structured text: headings, body text and the labels of anything actionable.",inputSchema:{type:"object",properties:{}}});var C=Ol({spec:r,tools:h.map(function(t){return t.kind,t.formId,t.productId,function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,xl)})},p?{views:{root:p.root,states:p.states.filter(function(t){return!u.has(t)}),routes:p.routes}}:{});return{tools:h,manifest:C}}(n,r,{specDraft:"2026-07-21"});if(!i)return null;var a=i.tools,s=i.manifest,l=Array.isArray(o)?o.filter(Boolean):[],c=function(t){return l.find(function(e){return e.states&&e.states.has(t)})||null},u=function(){var t,n=Ql(l);try{for(n.s();!(t=n.n()).done;){var r=t.value,o=r.states&&null!=r.current?r.states.get(r.current):null;if(o)return o}}catch(t){n.e(t)}finally{n.f()}return e},f=function(t){var n=function(e){if(!e||"function"!=typeof e.querySelector)return null;if(e.id===t)return"FORM"===e.tagName?e:e.querySelector("form");var n,r=e.querySelector("#".concat((n=String(t),"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(n):n.replace(/([^a-zA-Z0-9_-])/g,"\\$1"))));return r?"FORM"===r.tagName?r:r.querySelector("form"):null},r=n(e);if(r)return r;var o,i=Ql(l);try{for(i.s();!(o=i.n()).done;){var a=o.value;if(a.states){var s,c=Ql(a.states.values());try{for(c.s();!(s=c.n()).done;){var u=n(s.value);if(u)return u}}catch(t){c.e(t)}finally{c.f()}}}}catch(t){i.e(t)}finally{i.f()}return null};if("undefined"!=typeof document){var d=document.getElementById(tc);d&&d.remove();var h=document.createElement("script");h.type="application/json",h.id=tc,h.textContent=JSON.stringify(s,null,2),(document.body||document.documentElement).appendChild(h)}var p,y=Ql(a);try{for(y.s();!(p=y.n()).done;){var m=p.value;if("submit"===m.kind&&e){var v=f(m.formId);v&&(v.setAttribute("toolname",m.name),v.setAttribute("tooldescription",m.description))}}}catch(t){y.e(t)}finally{y.f()}var b,g,w,x=Promise.resolve(),k=function(t){var e=x.then(t,t);return x=e.then(function(){},function(){}),e},S=function(){var t,e=Ql(l);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(null!=n.current)return n.current}}catch(t){e.e(t)}finally{e.f()}return null},O={navigate:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).destination;return k(Yl(Ul().m(function n(){var r,o,i;return Ul().w(function(n){for(;;)switch(n.n){case 0:if(r=c(t)){n.n=1;break}return n.a(2,nc("UNKNOWN_VIEW",t,l.flatMap(function(t){return Vl(t.states.keys())})));case 1:return o=r.current,n.n=2,r.goToState(t);case 2:if(r.current===t){n.n=3;break}return i=Vl(r.states.keys()),n.a(2,nc("UNREACHABLE_FROM_HERE",t,i.filter(function(t){return t!==o})));case 3:return n.a(2,Xl({ok:!0,view:r.current},ec(r.states.get(r.current)||e)))}},n)})))},back:function(){return k(Yl(Ul().m(function t(){var n;return Ul().w(function(t){for(;;)switch(t.n){case 0:if(n=l.find(function(t){return t.history&&t.history.length})){t.n=1;break}return t.a(2,nc("NO_HISTORY",null,[]));case 1:return t.n=2,n.goBack();case 2:return t.a(2,Xl({ok:!0,view:n.current},ec(n.states.get(n.current)||e)))}},t)})))},read:(w=Yl(Ul().m(function t(){return Ul().w(function(t){for(;;)if(0===t.n)return t.a(2,Xl({ok:!0,view:S()},ec(u())))},t)})),function(){return w.apply(this,arguments)}),product:(g=Yl(Ul().m(function t(n,r){var o,i,a,s,l,c;return Ul().w(function(t){for(;;)switch(t.n){case 0:if(o=e&&e.querySelector('[id="'.concat(r.productId,'"]'))){t.n=1;break}return t.a(2,nc("NO_PRODUCT",r.productId,[]));case 1:return i=o.querySelector("[shopify-loading-placeholder]"),a=i&&"undefined"!=typeof window&&"none"===window.getComputedStyle(i).display,s=[],l=[],c=function(t){var e,n=Ql(t.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;if(3===r.nodeType){var o=r.textContent.replace(/\s+/g," ").trim();o&&s.push(o)}else if(1===r.nodeType){if(/^(TEMPLATE|SCRIPT|STYLE)$/.test(r.tagName))continue;if("none"===window.getComputedStyle(r).display)continue;if(/^(A|BUTTON)$/.test(r.tagName)){var i=r.textContent.replace(/\s+/g," ").trim();i&&!l.includes(i)&&l.push(i)}r.shadowRoot&&c(r.shadowRoot),c(r)}}}catch(t){n.e(t)}finally{n.f()}},c(o),t.a(2,{ok:!0,product:r.productId,handle:o.getAttribute("handle"),live:!!a,text:s.join("\n"),actions:l})}},t)})),function(t,e){return g.apply(this,arguments)}),submit:(b=Yl(Ul().m(function t(){var e,n,r,o,i,a,s,c,u,d,h,p,y,m,v,b,g,w,x,k,S=arguments;return Ul().w(function(t){for(;;)switch(t.n){case 0:if(e=S.length>0&&void 0!==S[0]?S[0]:{},r=f((n=S.length>1?S[1]:void 0).formId)){t.n=1;break}return t.a(2,nc("NO_FORM",n.formId,[]));case 1:if(r.isConnected){t.n=2;break}return o=l.flatMap(function(t){return t.states?Vl(t.states):[]}).filter(function(t){return ql(t,2)[1].contains(r)}).map(function(t){return ql(t,1)[0]}),t.a(2,nc("FORM_NOT_IN_VIEW",n.formId,o));case 2:if(i=n.inputSchema&&n.inputSchema.properties||{},a=n.inputSchema&&n.inputSchema.required||[],!(s=a.filter(function(t){return void 0===e[t]||""===e[t]||null===e[t]})).length){t.n=3;break}return t.a(2,nc("MISSING_REQUIRED",s,Object.keys(i)));case 3:c=[],u=[],d=[],h=function(t){return"SELECT"===t.tagName?Vl(t.options).map(function(t){return t.value}):[]},p="input, select, textarea",y=function(t){var e=r.querySelector('[name="'.concat(t,'"], #').concat(CSS.escape(t)));return!e||e.matches(p)?e:e.querySelector(p)},m=Ul().m(function t(){var n,o,i,a,s,l;return Ul().w(function(t){for(;;)switch(t.n){case 0:if(n=b[v],void 0!==e[n]){t.n=1;break}return t.a(2,0);case 1:if(o=e[n],i=y(n)){t.n=2;break}return d.push(n),t.a(2,0);case 2:if("checkbox"!==i.type){t.n=3;break}i.checked=!!o,t.n=7;break;case 3:if("radio"!==i.type){t.n=6;break}if(a=Vl(r.querySelectorAll('[name="'.concat(n,'"]'))),!(s=a.find(function(t){return t.value===String(o)}))){t.n=4;break}s.checked=!0,t.n=5;break;case 4:return u.push({field:n,got:null,valid:a.map(function(t){return t.value})}),t.a(2,0);case 5:t.n=7;break;case 6:i.value=String(o);case 7:i.dispatchEvent(new Event("input",{bubbles:!0})),i.dispatchEvent(new Event("change",{bubbles:!0})),l="checkbox"===i.type?i.checked:"radio"===i.type?String(o):i.value,("checkbox"===i.type?!!o===l:String(o)===l)?c.push(n):u.push({field:n,got:l,valid:h(i)});case 8:return t.a(2)}},t)}),v=0,b=Object.keys(i);case 4:if(!(v<b.length)){t.n=7;break}return t.d(Wl(m()),5);case 5:if(0!==t.v){t.n=6;break}return t.a(3,6);case 6:v++,t.n=4;break;case 7:if(!u.length&&!d.length){t.n=8;break}return t.a(2,Xl(Xl({},nc("FIELD_NOT_SET",[].concat(Vl(u.map(function(t){return t.field})),d),[].concat(Vl(u.map(function(t){return t.valid.length?'"'.concat(t.field,'" accepts ').concat(t.valid.map(function(t){return JSON.stringify(t)}).join(", ")):'"'.concat(t.field,'" did not take the value given')})),Vl(d.map(function(t){return'"'.concat(t,'" is named by the schema but no control in the form carries it')}))))),{},{filled:c,submitted:null}));case 8:if("function"==typeof r.requestSubmit){t.n=9;break}return r.submit(),t.a(2,{ok:!0,submitted:n.formId,filled:c});case 9:if(g=r.ownerDocument.defaultView,w=!1,x=function(t){t.target===r&&(w=!0)},g.addEventListener("submit",x,!0),r.requestSubmit(),g.removeEventListener("submit",x,!0),w){t.n=10;break}return k=Object.keys(i).map(function(t){return[t,y(t)]}).filter(function(t){var e=ql(t,2)[1];return e&&e.willValidate&&!e.validity.valid}).map(function(t){var e=ql(t,2);return{field:e[0],message:e[1].validationMessage}}),t.a(2,Xl(Xl({},nc("NOT_SUBMITTED",n.formId,k)),{},{filled:c,submitted:null}));case 10:return t.a(2,{ok:!0,submitted:n.formId,filled:c})}},t)})),function(){return b.apply(this,arguments)})},j="undefined"!=typeof document&&document.modelContext?document.modelContext:"undefined"!=typeof navigator&&navigator.modelContext?navigator.modelContext:null,E=!1;if(j&&"function"==typeof j.registerTool){var _,A=Ql(a);try{var T=function(){var t=_.value;try{j.registerTool({name:t.name,description:t.description,inputSchema:t.inputSchema,execute:function(e){return O[t.kind](e,t)}}),E=!0}catch(e){console.warn("[nodality] agent surface: tool rejected",t.name,e)}};for(A.s();!(_=A.n()).done;)T()}catch(t){A.e(t)}finally{A.f()}}return{manifest:s,tools:a,registered:E,destroy:function(){if(j&&"function"==typeof j.unregisterTool){var t,e=Ql(a);try{for(e.s();!(t=e.n()).done;){var n=t.value;try{j.unregisterTool(n.name)}catch(t){}}}catch(t){e.e(t)}finally{e.f()}}if("undefined"!=typeof document){var r=document.getElementById(tc);r&&r.remove()}}}}function oc(t){return oc="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},oc(t)}function ic(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 ac(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ic(Object(n),!0).forEach(function(e){sc(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ic(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function sc(t,e,n){return(e=function(t){var e=function(t){if("object"!=oc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=oc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==oc(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lc(t,e){return dc(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)||uc(t,e)||cc()}function cc(){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 uc(t,e){if(t){if("string"==typeof t)return fc(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)?fc(t,e):void 0}}function fc(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 dc(t){if(Array.isArray(t))return t}function hc(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 pc(t,e,n){return(e=function(t){var e=function(t){if("object"!=yc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=yc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yc(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yc(t){return yc="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},yc(t)}Object.freeze(ac(ac(ac({},{animation:{combine:"first",scope:"element"},arrange:{combine:"first",scope:"range"},background:{combine:"first",scope:"element"},blast:{combine:"first",scope:"element"},"card-style":{combine:"first",scope:"page"},filter:{combine:"first",scope:"element"},gradient:{combine:"first",scope:"element"},layout:{combine:"first",scope:"page",slot:"layout"},slayout:{combine:"first",scope:"page",slot:"layout"},"link-style":{combine:"sequence",scope:"element",firstTargetOnly:!0},margin:{combine:"first",scope:"element"},navStyle:{combine:"inert",scope:"element"},shadow:{combine:"first",scope:"element"},span:{combine:"first",scope:"element"},transform:{combine:"first",scope:"element"}}),Object.fromEntries(w.map(function(t){return[t,{combine:"sequence",scope:"element",byStage:!0}]}))),{},{morph:{combine:"sequence",scope:"page"},"agent-surface":{combine:"first",scope:"page"}}));var mc=Object.freeze({src:"url",href:"url",options:"items"}),vc=(new Set(Object.values(mc)),function(t,e){if(Array.isArray(t))return t.map(function(t){return vc(t,e)});if(!t||"object"!==yc(t))return t;for(var n=e(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?hc(Object(n),!0).forEach(function(e){pc(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t)),r=0,o=["children","items"];r<o.length;r++){var i=o[r];void 0!==n[i]&&(n[i]=vc(n[i],e))}return n});function bc(t){return function(t){return vc(t,function(t){if("table"!==t.type||!Array.isArray(t.items)||t.items.length<2)return t;if(!t.items.every(function(t){return Array.isArray(t)}))return t;var e,n=dc(e=t.items)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||uc(e)||cc(),r=n[0],o=n.slice(1);return r.every(function(t){return"string"==typeof t||"number"==typeof t})?(t.items=o.map(function(t){return Object.fromEntries(r.map(function(e,n){return[String(e),t[n]]}))}),t):t})}(function(t){return vc(t,function(t){for(var e=0,n=Object.entries(mc);e<n.length;e++){var r=lc(n[e],2),o=r[0],i=r[1];Object.prototype.hasOwnProperty.call(t,o)&&(Object.prototype.hasOwnProperty.call(t,i)||(t[i]=t[o]),delete t[o])}return t})}(t))}Object.freeze(Object.keys(mc)),new Set(["h1.size","h2.size","h3.size","h4.size","h5.size","h6.size","p.size","a.transform","checkbox.exact","checkbox.area","checkbox.background","checkbox.color","checkbox.cursor","checkbox.height","checkbox.keySet","checkbox.mar","checkbox.maxWidth","checkbox.pad","checkbox.transform","checkbox.width","circle.transform","code.transform","filePicker.radius","labelInput.color","labelInput.exact","nav.size","nav.transform","polygon.transform","radio.color","radio.exact","sideNav.exact","sideNav.area","sideNav.background","sideNav.color","sideNav.cursor","sideNav.height","sideNav.keySet","sideNav.mar","sideNav.maxHeight","sideNav.maxWidth","sideNav.opacity","sideNav.pad","sideNav.radius","sideNav.size","sideNav.transform","sideNav.width","sideNav.zIndex","table.transform"]);[].concat(["op","target","range","style","duration"],["filter","gradient","color","width"]),new Set(["ulist"]),new Set(["h1","h2","h3","h4","h5","h6"]);function gc(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 wc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?gc(Object(n),!0).forEach(function(e){xc(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xc(t,e,n){return(e=kc(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kc(t){var e=function(t){if("object"!=Sc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Sc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Sc(e)?e:e+""}function Sc(t){return Sc="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},Sc(t)}var Oc="$ref",jc=function(t){return!!t&&"object"===Sc(t)&&!Array.isArray(t)&&"string"==typeof t[Oc]};function Ec(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!e||"object"!==Sc(e))return t;var r=function(t){if(Array.isArray(t))return t.map(r);if(!t||"object"!==Sc(t))return t;if(jc(t)){var o=t[Oc];if(!Object.prototype.hasOwnProperty.call(e,o))return t;if(n.has(o))return t;var i=new Set(n).add(o),a=Ec([e[o]],e,i)[0],s=(t[Oc],function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,[Oc].map(kc)));return Object.keys(s).length?wc(wc({},a&&"object"===Sc(a)?a:{}),s):a}for(var l=wc({},t),c=0,u=["children","items"];c<u.length;c++){var f=u[c];void 0!==l[f]&&(l[f]=r(l[f]))}return l};return Array.isArray(t)?t.map(r):t}function _c(t){return function(t){if(Array.isArray(t))return Rc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Pc(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 Ac(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 Tc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ac(Object(n),!0).forEach(function(e){Cc(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ac(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Cc(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ic(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ic(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ic(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pc(t,e){if(t){if("string"==typeof t)return Rc(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)?Rc(t,e):void 0}}function Rc(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 Ic(t){return Ic="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},Ic(t)}var Mc=function(t){return"string"==typeof t&&"#"===t.charAt(0)?t.slice(1):null==t?t:String(t)};var Dc=function(t){return"number"==typeof t?Math.round(t):parseInt(t,10)};function Fc(t,e){var n=[],r=[],o=new Map;if((Array.isArray(e)?e:[]).forEach(function(t,e){if(t&&t.op&&"object"===Ic(t.op)&&"arrange"===t.op.name){var n=function(t){if(!Array.isArray(t)||2!==t.length)return null;var e=Dc(t[0]),n=Dc(t[1]);return!Number.isFinite(e)||!Number.isFinite(n)||e<0||n<e?null:[e,n]}(t.range),i=Array.isArray(t.target)?t.target:[];if(n&&i.length){var a,s=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Pc(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}}}}(i);try{for(s.s();!(a=s.n()).done;){var l=a.value,c=Mc(String(l)),u=o.get(c)||[],f=u.find(function(t){return e=t.range,r=n,e[0]<=r[1]&&r[0]<=e[1];var e,r});f?r.push({node:e,target:c,reason:"overlaps node ".concat(f.node)}):(u.push({node:e,mode:t.op.mode||"column",range:n}),o.set(c,u))}}catch(t){s.e(t)}finally{s.f()}}else r.push({node:e,reason:"needs target and range [lo, hi]"})}}),!o.size)return{elements:t,applied:n,skipped:r};var i=function(t){if(!Array.isArray(t))return t;var e=!1,a=t.map(function(t){if(!t||"object"!==Ic(t))return t;var a=function(t){var e=null==t.id?null:Mc(String(t.id)),i=e&&o.get(e);if(!i)return t;var a=function(t){return"row"===t.type?"row":"cards"===t.type?"cards":"nav"===t.type?"nav":null}(t),s=i.slice().sort(function(t,e){return t.range[0]-e.range[0]});if(("row"===a||"cards"===a)&&i.every(function(t){return"column"===t.mode||"row"===t.mode})){var l=s.map(function(t){var e={breakpoint:[t.range[0],t.range[1]],flexDirection:t.mode};return"cards"===a&&"column"===t.mode&&(e.alignItems="center"),e});i.forEach(function(t){return n.push({node:t.node,target:e,via:"resprop"})});var c=Tc(Tc({},t),{},{resprop:[].concat(_c(Array.isArray(t.resprop)?t.resprop.map(function(t){return Tc({},t)}):[]),_c(l))});return"cards"===a&&(c.colat=!1),c}if("nav"===a&&i.every(function(t){return"collapse"===t.mode||"expand"===t.mode})){var u=s.filter(function(t){return"collapse"===t.mode}),f=s.filter(function(t){return"expand"===t.mode}),d=null;if(u.length||1!==f.length||0!==f[0].range[0]){if(1===u.length&&0===u[0].range[0]){var h=u[0].range[1];f.length?1===f.length&&f[0].range[0]===h+1&&(d=h+1):d=h>=99999?99999:h+1}}else d=0;return null!==d?(i.forEach(function(t){return n.push({node:t.node,target:e,via:"breakpoint"})}),Tc(Tc({},t),{},{breakpoint:"".concat(d,"px")})):(i.forEach(function(t){return r.push({node:t.node,target:e,reason:"a nav collapses below one width and expands above it; these ranges say otherwise"})}),t)}return i.forEach(function(n){return r.push({node:n.node,target:e,reason:'mode "'.concat(n.mode,'" does not apply to ').concat(t.type)})}),t}(t),s=i(t.children);return s!==t.children&&(a=Tc(Tc({},a===t?t:a),{},{children:s})),a!==t&&(e=!0),a});return e?a:t};return{elements:i(t),applied:n,skipped:r}}function zc(t){return zc="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},zc(t)}function Lc(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,Nc(r.key),r)}}function Nc(t){var e=function(t){if("object"!=zc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=zc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==zc(e)?e:e+""}var Bc=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.setupa()},e=[{key:"seto",value:function(t){return this.e=t.a,t.speed&&(this.divisor=t.speed),t.height&&(this.setH=t.height),this}},{key:"setupa",value:function(){return this.parallaxIDs(["#rta"]),this.divisor(1),this}},{key:"add",value:function(t){return this.items=t,this.setup(),this}},{key:"parallaxIDs",value:function(t){return this.parallaxIDs=t,this}},{key:"divisor",value:function(t){return this.divisor=t,this}},{key:"setup",value:function(){var t,e=this;this.pts=0;var n=document.createElement("div");n.style.width="100%",n.style.height=null!==(t=this.setH)&&void 0!==t?t:"100%";var r=document.createElement("div");r.style.display="flex",r.style.width="100%";for(var o=0;o<this.items.length;o++){var i=this.items[o].render();r.appendChild(i)}n.appendChild(r);var a=window.localStorage.getItem("pts");null!==a&&(this.pts=a),n.addEventListener("wheel",function(t){t.deltaY<0?e.pts--:t.deltaY>0&&e.pts++,window.localStorage.setItem("pts",e.pts),t.preventDefault();for(var n=0;n<r.childNodes.length;n++){var o=r.childNodes[n];e.parallaxIDs.includes(o.id)&&(o.style.transform="translateX(".concat(e.pts/e.divisor,"%)"))}r.style.transform="translateX(".concat(e.pts/e.divisor,"%)"),window.localStorage.setItem("translation",e.pts/e.divisor)});var s=window.localStorage.getItem("translation");null!==s&&(r.style.transform="translateX(".concat(s,"%)")),this.div=n}},{key:"render",value:function(t){if(!t)return this.div;document.querySelector(t).appendChild(this.div)}}],e&&Lc(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Wc(t){return Wc="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},Wc(t)}function qc(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,Uc(r.key),r)}}function Uc(t){var e=function(t){if("object"!=Wc(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Wc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wc(e)?e:e+""}var Hc=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:"cards",value:function(t,e,n){for(var r=[],o=0;o<t.children.length;o++){var i=t.children[o];"text"===i&&this.insertTextToCard(r,e,t,n),"image"!==i||t.backgroundCard||r.push('\n new Image("https://upload.wikimedia.org/wikipedia/commons/3/3a/Starship_S20.jpg").set({})'),"link"===i&&(e.op?r.push("\n ".concat(n.tabSpace(6)," ").concat(n.link[e.op.theme.toLowerCase()].code)):r.push("\n ".concat(n.tabSpace(6)," ").concat(n.link.base.code)))}return r}},{key:"insertTextToCard",value:function(t,e,n,r){if(e.op)if(e.op.ops&&e.op.ops.includes("text-blast")){var o="\n ".concat(r.tabSpace(6)," ").concat(r.text[e.op.theme.toLowerCase()].code),i=r.ops[e.op.theme.toLowerCase()].blast.code;n.backgroundCard||(i=r.ops[e.op.theme.toLowerCase()].blastFun(1));var a=this.insertTextBetween(o,i);t.push(a)}else t.push("\n ".concat(r.tabSpace(6)," ").concat(r.text[e.op.theme.toLowerCase()].code));else t.push("\n ".concat(r.tabSpace(6)," ").concat(r.text.base.code))}},{key:"insertTextBetween",value:function(t,e){var n=t.match(/(color: ".+?",)(.+?)(id: ".+?")/);if(n){var r=n.index+n[0].length;return t.slice(0,r)+", "+e+", "+t.slice(r)}return t}}],null&&qc(t.prototype,null),e&&qc(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function Gc(t,e){return Gc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gc(t,e)}function Xc(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Xc=function(){return!!t})()}function Jc(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 Vc(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jc(Object(n),!0).forEach(function(e){$c(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jc(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function $c(t,e,n){return(e=nu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yc(t){return function(t){if(Array.isArray(t))return Zc(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Kc(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 Qc(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Kc(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 Kc(t,e){if(t){if("string"==typeof t)return Zc(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)?Zc(t,e):void 0}}function Zc(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 tu(t){return tu="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},tu(t)}function eu(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,nu(r.key),r)}}function nu(t){var e=function(t){if("object"!=tu(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=tu(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==tu(e)?e:e+""}var ru=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ot.clear(),this.items=[],this.options=[],this.code=[],this.ready2Render=[],this._built=[],this._owned=[],this.stor={text:{miami:{code:'new Text("Hello").set({fluidc: "S3", color: "orange"})'},base:{code:'new Text("Hello").set({fluidc: "S3", color: "orange"})'},nepal:{code:'new Text("Hello").set({fluidc: "S3", color: "#2ECC71", font: "Helvetica Neue"})'},patagonia:{code:'new Text("Hello").set({fluidc: "S3", color: "#3498DB", font: "DIN Alternate"})'}},complexa:{code:"new Wrapper()\n .set({...}) // Rest of the code omitted for brevity"},complex:{code:'new Wrapper() \n\t.set({\n\t\t\n\t\tresponsive: {\n\t\t\tranges: ["700px", "1200px", "1400px"],\n\t\t\tsequence: "col-row-col"\n\t\t}\n\t})\n\t.add([\n\t\tnew Image("img/wix.jpeg").set({\n\t\t\twidth: "100%",\n\t\t\theight: "200px",\n objectFit: "cover"\n\t\t}),\n\n new Wrapper().set({\n responsive: {\n\t\t\tranges: ["700px", "1200px", "1400px"],\n\t\t\tsequence: "col-col-row"\n\t\t}\n }).add([\n new Text("Running in the desert").set({\n size: "S3",\n font: "Arial",\n color: "orange"\n }),\n\n new Text("This is example content").set({\n exact: "1rem",\n font: "Arial"\n }),\n\n\n new Image("img/wix.jpeg").set({\n width: "100%",\n height: "300px",\n objectFit: "cover"\n })\n ])\n\t])'},ops:{miami:{blast:{code:'stroke: {range:["0px","3000px"], op:{name:"blast",color:"orange",width:"3px"}}'},blastFun:function(t){return'stroke: {range:["0px","3000px"], op:{name:"blast",color:"orange",width:"'.concat(t,'px"}}')}},nepal:{blast:{code:'stroke: {range:["0px","3000px"], op:{name:"blast",color:"#2ECC71",width:"3px"}}'},blastFun:function(t){return'stroke: {range:["0px","3000px"], op:{name:"blast",color:"#2ECC71",width:"'.concat(t,'px"}}')}},patagonia:{blast:{code:'stroke: {range:["0px","3000px"], op:{name:"blast",color:"#1abc9c",width:"3px"}}'},blastFun:function(t){return'stroke: {range:["0px","3000px"], op:{name:"blast",color:"#1abc9c",width:"'.concat(t,'px"}}')}}},link:{miami:{code:'new Link("Link").set({text: "Hello", url: "#a", background: "", color: "orange", hover: {color: "white", background: "orange", animation: 0.6}, borderObj: {color: "orange", width: "3px", radius: "0.7rem"}, pad: { sides: ["all"], value: "0.6rem" }, mar: { "t": 0.8rem }, radius: "0.4rem"})'},base:{code:'new Link("Link").set({text: "Hello", url: "#ai", background: "#3498db", pad: [{lr: "0.5rem", tb: "1rem"}], radius: "0.4rem", color: "white"})'},nepal:{code:'new Link("Link").set({text: "Hello", url: "#a", background: "#2ECC71", pad: { sides: ["all"], value: "0.6rem" }, mar: { sides: ["top", "bottom"], value: "0.8rem" }, hover: {color: "#2ECC71", background: "white", border: true, animation: 0.3}, color: "white"})'},patagonia:{code:'new Link("Link", "#a").set({text: "Hello", url: "#a", background: "#1ABC9C", pad: { sides: ["all"], value: "0.6rem" }, mar: { sides: ["top", "bottom"], value: "0.8rem" }, hover: {color: "#2ECC71", background: "white", border: true, animation: 0.3}, color: "white"})'}},grid:{code:' new AreaSwitcher()\n .set({\n gap: "1rem"\n })\n .react([{\n at: "0px",\n template: [\n "eeeeee",\n "eeeeee",\n "abbbbb",\n "abbbbb",\n "abbbbb",\n "cccccc",\n "cccccc",\n "dddddd"\n ]\n },\n\n {\n at: "900px",\n color: "orange",\n template: [\n "aaaccc",\n "aaaccc",\n "bbbbbb",\n "dddddd",\n "eeeeee"\n ]\n },\n\n {\n at: "1200px",\n color: "purple",\n template: [\n "cccaaa",\n "cccaaa",\n "bbbbbb",\n "dddddd",\n "eeeeee"\n ]\n },\n ])\n .add([\n new Wrapper().set({\n pad: [{\n a: 20\n }],\n background: "#ecf0f1",\n radius: "1.7rem"\n }).add([\n new Text("NEW PRODUCT").set({\n exact: "1rem",\n font: "Oswald",\n width: "100%"\n }),\n new Text("Feel").set({\n fluidc: "S2",\n font: "Oswald",\n width: "100%",\n color: "black"\n }),\n new Text("Speed").set({\n exact: "7rem",\n font: "Oswald",\n width: "100%",\n color: "#3498db"\n }),\n ]),\n\n new Wrapper().set({\n pad: [{\n a: 20\n }],\n background: "#ecf0f1",\n radius: "1.7rem"\n }).add([\n new Text("TOP QUALITY").set({\n exact: "1rem",\n font: "Oswald",\n width: "100%"\n }),\n new Text("Amazing animals").set({\n fluidc: "S2",\n font: "Oswald",\n width: "100%",\n color: "black"\n }),\n\n new Text("Seals are intelligent, agile marine mammals found in oceans around the world, known for their streamlined bodies, flippers, and ability to thrive both in water and on land. Belonging to the pinniped family, they are divided into true seals, which lack external ears, and eared seals like sea lions, which are more mobile on land. Seals feed primarily on fish and squid, using their sensitive whiskers to detect prey underwater, and can dive to great depths while holding their breath for extended periods. Adapted to cold environments with thick blubber for insulation, seals play a crucial role in marine ecosystems but face threats from climate change, pollution, and human activity, making conservation efforts increasingly important.")\n .set({\n font: "Arial",\n exact: "1.3rem"\n })\n\n ]),\n\n new Wrapper().set({\n radius: "1.7rem",\n overflow: "hidden"\n\n }).add([\n\n new Image("https://cdn.pixabay.com/photo/2017/02/09/18/40/seal-2053165_640.jpg", "exact").set({\n width: "100%",\n height: "420px",\n minHeight: "100px",\n objectFit: "cover"\n\n })\n ]),\n\n new Wrapper().set({\n pad: [{\n a: 20\n }],\n background: "#ecf0f1",\n radius: "1.7rem",\n }).add([\n new Text("Welcome seals").set({\n fluidc: "S3",\n font: "Oswald",\n color: "black"\n }),\n \n ]),\n new Wrapper().set({\n mc: true,\n pad: [{\n a: 20\n }],\n background: "#ecf0f1",\n radius: "1.7rem",\n\n }).add([new Text("Top line").set({\n font: "Arial",\n exact: "1.3rem"\n }), ]),\n ])'},flexRow:function(t){return{image:{code:'new FlexRow().set({border: ["all", "3px"], colat: "600px"}).items([new Image(...), new Image(...), new Image(...)])'},text:{code:'new FlexRow().set({}).items([\n\nnew Text("This").set({\n size: "S3"\n}), \n\nnew Text("is").set({\n size: "S3",\n text: "Hello"\n}), \n\nnew Text("row.").set({\n size: "S3",\n text: "Hello"\n})\n \n])'}}},tabSpace:function(t){return" ".repeat(t)}}}return e=t,n=[{key:"at",value:function(e){Array.isArray(this.options)||(this.options=[]),Array.isArray(this.protoOptions)||(this.protoOptions=[]);var n=t.cloneNodes([e])[0];return this.options.push(n),this.protoOptions.push(n),this}},{key:"nodes",value:function(e){return this.options=t.cloneNodes(e),this.protoOptions=t.cloneNodes(e),this}},{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:"add",value:function(t){var e="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__&&"object"===tu(globalThis.__NODALITY_DEV__)?globalThis.__NODALITY_DEV__:null;e&&(e.inDes=!0);var n=Ct._owner;Ct._owner=this._owned;try{return this._add(t)}finally{Ct._owner=n,e&&(e.inDes=!1)}}},{key:"destroy",value:function(){var t,e=this,n=Qc(this._owned.splice(0).reverse());try{for(n.s();!(t=n.n()).done;){var r=t.value;try{r&&"function"==typeof r.destroy&&r.destroy()}catch(t){}}}catch(t){n.e(t)}finally{n.f()}var o,i=Qc([].concat(this._morphs||[]));try{for(i.s();!(o=i.n()).done;){var a=o.value;try{a&&"function"==typeof a.destroy&&a.destroy()}catch(t){}}}catch(t){i.e(t)}finally{i.f()}this._morphs=null;try{this._agentSurface&&"function"==typeof this._agentSurface.destroy&&this._agentSurface.destroy()}catch(t){}this._agentSurface=null;for(var s=0,l=[this._codeEl,this._preEl];s<l.length;s++){var c=l[s];c&&c.parentNode&&c.parentNode.removeChild(c)}var u="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__;return u&&Array.isArray(u.pages)&&(u.pages=u.pages.filter(function(t){return!e._devEntry||t!==e._devEntry})),this._built=[],this.ready2Render=[],this}},{key:"_add",value:function(e){var n=this,r=function(t){var e=[],n=function(t,r){if(Array.isArray(t))return t.forEach(function(t,e){return n(t,"".concat(r,"[").concat(e,"]"))});if(t&&"object"===Sc(t))if(jc(t))e.push({name:t[Oc],path:r});else for(var o=0,i=["children","items"];o<i.length;o++){var a=i[o];void 0!==t[a]&&n(t[a],"".concat(r,".").concat(a))}};return n(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"elements"),e}(e=bc(e=Ec(Array.isArray(e)?e:[],this._defs))).filter(function(t){return!n._defs||!Object.prototype.hasOwnProperty.call(n._defs,t.name)});if(r.length){var o=Object.keys(this._defs||{});throw new Error('[nodality] no definition for $ref "'.concat(r[0].name,'" at ')+"".concat(r[0].path,". Defined: ").concat(o.length?o.join(", "):"(none)"))}if(Array.isArray(this.options)&&this.options.some(function(t){return t&&t.op&&"arrange"===t.op.name})){var i=Fc(e,this.options);e=i.elements;var a,s=Qc(i.skipped);try{for(s.s();!(a=s.n()).done;){var l=a.value;"undefined"!=typeof console&&console.warn("[nodality] arrange node ".concat(l.node).concat(l.target?' on "'.concat(l.target,'"'):""," ignored: ").concat(l.reason,"."))}}catch(t){s.e(t)}finally{s.f()}}this.css=[],this.elCSS=[],this.elHTML=[];var c=this.options;c.forEach(function(t){"radial"===t.direction&&(t.gradient="radial-gradient(orange, green)")}),e=[].concat(Yc(e.filter(function(t){return t&&("nav"===t.type||"sideNav"===t.type)})),Yc(e.filter(function(t){return!t||"nav"!==t.type&&"sideNav"!==t.type}))),this._elements=e;for(var u,f,d=function(){var r=e[h],o=null,i=n.ready2Render.length,a=n.code.length,s=["blast","gradient","shadow","filter","animation","transform","span"],l=[{op:{name:"blast",color:"green",width:"1px"}},{op:{name:"gradient",gradient:"linear-gradient(orange, green)"}},{op:{name:"shadow",color:"#1abc9c",steps:3,colors:["orange","green","yellow"]}},{op:{name:"filter",filter:"grayscale(0.7)"}},{op:{name:"animation",color:"green",width:"1px",fireAt:"inview",keyframesOpen:[{transform:"translate(100%, 0%)",opacity:0},{transform:"translate(0%)",opacity:1}],keyframesClose:[{transform:"translate(0%)",opacity:1},{transform:"translate(100%, 0%)",opacity:0}],openOptions:{duration:300,fill:"forwards",delay:1e3},closeOptions:{duration:1,fill:"forwards",delay:1e3}}},{op:{name:"transform",values:["ty:-20px","scale(3)","rotate(3deg)","skew(3deg, 0deg)","perspective(100px)","matrix(1, 0, 0, 1, 50, 50)"]}},{op:{name:"span",parts:[{text:"The first time",style:{italic:!0,arrpad:{sides:["left"],value:"3rem"},stroke:{range:["950px","1000px"],op:{name:"blast",background:["header","button"],color:"yellow",width:"1px"}}}},{text:"We went to the Moon",style:{}}]}}];for(f=0;f<s.length;f++){var d=c.map(function(t){return t.op}).map(function(t,e){return t===s[f]?e:""}).filter(String);if(d.length>0)for(u=0;u<d.length;u++){var p=d[u],y=c[p].target,m=c[p].range,v=c[p].filter,b=c[p].gradient,g=c[p].color,w=c[p].width,x=t.cloneNodes([l[f]])[0];x.target=y,null!=m&&(x.range=m),null!=v&&(x.op.filter=v),null!=b&&(x.op.gradient=b),"blast"===s[f]&&(null!=g&&(x.op.color=g),null!=w&&(x.op.width=w)),c[p]=x}}for(f=0;f<c.length;f++){var k=c[f].op.name,S=n.protoOptions[f].style||"default",O=n.protoOptions[f].duration||"default";if("transform"===k){var j,E,_,A;A="SOLARIUM"===S?["scale(3)"]:"WAVE"===S?["skew(15deg, 0deg)","tx:50px","rotate(10deg)","scale(1.1)"]:"CUBE-SPIN"===S?["perspective(700px)","scale(0.9)"]:"TORNADO-SWITCH"===S?["rotate(720deg)","scale(0.8)","tx:30px","ty:-50px","tz:-80px"]:"LASER-SWEEP"===S?["tx:100px","opacity:0.2","scale(1.2, 1.0)"]:"TORNADO-TWIST"===S?["rotate(720deg)","scale(0.8)","tx:30px","ty:-50px","skew(10deg, 0deg)"]:"JELLY-WOBBLE"===S?["scale(1.2, 0.8)","rotate(5deg)","ty:-10px","skew(5deg, 0deg)"]:"DRUNKEN-SWAY"===S?["rotate(15deg)","tx:20px","ty:-10px","skew(10deg, 5deg)"]:"FLAME-FLICKER"===S?["scale(1.1, 0.9)","rotate(-5deg)","ty:5px","opacity:0.7"]:"PHANTOM-SHIFT"===S?["tx:15px","ty:-5px","opacity:0.5","skew(5deg, 5deg)"]:"RUBBER-BOUNCE"===S?["scale(1.3, 0.8)","skew(10deg, 0deg)","ty:-20px"]:"ASTEROID-CRASH"===S?["tx:-80px","ty:100px","rotate(45deg)","scale(0.7)","opacity:0.5"]:"CYBER-GLITCH"===S?["tx:5px","ty:-5px","rotate(3deg)","opacity:0.6","scale(1.05)"]:"BUBBLE-POP"===S?["scale(1.5)","opacity:0.3","ty:-20px"]:"SUPERNOVA-BURST"===S?["scale(2)","opacity:0","tx:50px","ty:-50px"]:"GRAVITY-DROP"===S?["ty:100px","scale(0.8)","rotate(10deg)","skew(0deg, 10deg)"]:"LASER-SWEEP"===S?["tx:100px","opacity:0.2","scale(1.2, 1.0)"]:"VORTEX-SINK"===S?["rotate(-360deg)","scale(0.5)","ty:50px"]:"SHOCKWAVE"===S?["scale(1.7)","opacity:0.4","skew(5deg, 5deg)"]:["ty:20px","tx:30px","rotate(3deg)","skew(40deg, 0deg)"],c[f].op={name:"transform",values:A,duration:O};var T,C="style",P="duration";null!==(j=c[f])&&void 0!==j&&j.op&&C in c[f].op&&delete c[f].op[C],null!==(E=c[f])&&void 0!==E&&E.op&&P in c[f].op&&delete c[f].op[P],null!==(_=c[f])&&void 0!==_&&_.op.values&&null!==(T=c[f])&&void 0!==T&&T.op.values}}!function t(e){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if("object"===tu(e[o])&&null!==e[o])t(e[o]);else if("string"==typeof e[o])switch(e[o].toLowerCase()){case"medium":e[o]="6s-ease-in-out";break;case"fast":e[o]="3s-ease-in-out";break;case"slow":e[o]="9s-ease-in-out";break;case"default":delete e[o]}}}(c),["h1","h2","h3","h4","h5","h6","p"].includes(r.type)||"img"===r.type||"a"===r.type?((o=Ks.mapType({el:r,customOptions:c,i:h})).toCode?n.code.push(o.toCode().join("")):n.code.push(o),n.ready2Render.push(o),o=o.render()):"table"===r.type?(o=Ks.mapType({el:r,customOptions:c,i:h,storage:n.stor}),n.code.push(o.toCode())):"slider"===r.type?n.code.push(' \nlet texts = [\n\nnew Text("One").set({size: "S1", color: "#1abc9c", font: "Arial"}),\n /*new Image().set({\n url: "https://image.datart.cz/foto/500/7/0/8/product_7766807.jpg",\n width: "400px",\n height: "auto"\n }),*/\n\n new Text("Two").set({size: "S1", color: "#1abc9c", font: "Arial"}),\n \n new Text("Three").set({size: "S1", color: "#1abc9c", font: "Arial"}),\n\n new Text("Four").set({size: "S1", color: "#1abc9c", font: "Arial"}),\n];\n\nnew Slider(texts, null, { tintColor: "#e74c3c", inactiveColor: "#ccc" })\n \n'):"hslider"===r.type?n.code.push('\n new HScroller()\n .seto({\n height: "300px",\n speed: 1.0 // the bigger the slower\n })\n .add([\n new Text("First").set({size: "S1", pad: [{"a": 40}] }),\n new Text("Second").set({size: "S1", pad: [{"a": 40}] }),\n new Text("Third").set({size: "S1", pad: [{"a": 40}] })\n ])\n '):"grid"===r.type?n.code.push(n.stor.grid.code):"modal"===r.type?n.code.push('new Code()\n .set({\n pad: [\n { l: 30 },\n ], \n mar: [\n { a: 30 },\n ], \n class: "language-js",\n code: `\n // You need to copy and paste this example\n\n\n import {Animator} from "../layout/animator.js";\n import {Text} from "../layout/text.js";\n import {Modal} from "../layout/modal-2025.js";\n import {Stack} from "../layout/stack.js";\n import {Image} from "../layout/image.js";\n import {FlexRow} from "../layout/flex-row.js";\n import {Button} from "../layout/button.js";\n import {Spacer} from "../layout/spacer.js";\n import {Wrapper} from "../layout/container.js";\n \n \n let firstLong = "Apple today announced that the company has surpassed a 60 percent reduction in its global greenhouse gas emissions compared to 2015 levels, as part of its Apple 2030 goal to become carbon neutral across its entire footprint in the next five years. The company achieved several other major environmental milestones, including the use of 99 percent recycled rare earth elements in all magnets and 99 percent recycled cobalt in all Apple-designed batteries.1 Apple shared this and other progress in its annual Environmental Progress Report, published today.\n “We’re incredibly proud of the progress we’re making toward Apple 2030, which touches every part of our business,” said Lisa Jackson, Apple’s vice president of Environment, Policy, and Social Initiatives. “Today, we’re using more clean energy and recycled materials to make our products than ever before, we’re preserving water and preventing waste around the world, and we’re investing big in nature. As we get closer to 2030, the work gets even harder — and we’re meeting the challenge with innovation, collaboration, and urgency.\n Apple’s 2030 strategy prioritizes cutting greenhouse gas emissions by 75 percent compared with its 2015 baseline year, before applying high-quality carbon credits to balance the remaining emissions. Last year, Apple’s comprehensive efforts to reduce its carbon footprint — including the continued transition of its supply chain to renewable electricity and designing products with more recycled materials — avoided an estimated 41 million metric tons of greenhouse gas emissions.";\n \n let elements = [\n new Stack()\n .setup({})\n .add([\n new Image("https://pbs.twimg.com/media/DwYvbCBVAAEKY_R.jpg").set({}),\n \n new FlexRow().set({aligns: "start"}).items([\n \n new Button("×")\n \n .set({\n fluidc: "S3",\n onTap: () => modal.close(),\n frame: { width: 80, height: 80 },\n color: "white",\n background: "none"\n }),\n \n new Spacer(true),\n ])\n ]),\n \n \n new Text("Samuel Suresh")\n .set({\n color: "#00ae56",\n font: "SF Pro Display",\n fluidc: "S2",\n pad: [{"tl": 20}]\n }),\n \n \n new Text("Studying Science and Business, Western Sydney University, class of 2022")\n .set({\n font: "Arial",\n fluidc: "S6",\n pad: [{"l": 20}]\n }),\n \n \n new Text(firstLong)\n .set({\n font: "Arial",\n fluidc: "S6",\n pad: [{"l": 20}]\n }), \n ];\n \n \n let wrapper = new Wrapper()\n .set({})\n .add(elements);\n \n \n let modal = new Modal();\n modal\n .set({\n width: "600px", \n background: "#469d73cc",\n close: true\n })\n .add([wrapper])\n .render("#res"); \n \n \n new Button("Wow")\n .set({\n fluidc: "S3",\n onTap: () => modal.show()\n })\n .render("#res");\n \n `\n })'):"row"===r.type?(o=Ks.mapType({el:r,customOptions:c,i:h,storage:n.stor}),n.code.push(o.toCode())):"cards"===r.type?(o=Ks.mapType({el:r,customOptions:c,i:h,storage:n.stor}))&&"object"===tu(o)&&"function"==typeof o.toCode?(n.code.push([].concat(o.toCode()).join("")),n.ready2Render.push(o)):n.code.push(o):"wrap"===r.type?(o=Ks.mapType({el:r,customOptions:c,i:h,storage:n.stor}),n.code.push(o.toCode()),n.ready2Render.push(o)):"responsive"===r.type?n.code.push(n.stor.complex.code):"free"===r.type||"nav"===r.type||"sideNav"===r.type||"dropdown"===r.type?(o=Ks.mapType({el:r,customOptions:c,i:h,storage:n.stor}),n.code.push(o.toCode()),n.ready2Render.push(o),o=o.render()):((o=Ks.mapType({el:r,customOptions:c,i:h,storage:n.stor})).toCode?n.code.push(o.toCode()):n.code.push(o),n.ready2Render.push(o),o=o.render());var R=n.ready2Render.length>i?n.ready2Render[n.ready2Render.length-1]:null,I=!R&&o&&"object"===tu(o)&&"function"==typeof o.render&&"function"==typeof o.toCode&&["table","row"].includes(r.type)?o:null,M=R&&"object"===tu(R)&&"function"==typeof R.render?R:I;n._built.push({instance:M,codeCount:n.code.length-a})},h=0;h<e.length;h++)d();return this}},{key:"toTextArea",value:function(t){var e=t||"#mount",n=document.createElement("textarea");n.style.width=300,n.style.height=300,n.setAttribute("id","elements"),n.value=this.code.join(";\n\n"),this.target="#elements";var r=document.createElement("pre"),o=document.createElement("code"),i=this.code.map(function(t){return"".concat(t,".render(").concat(mt(e),"); \n \n")});return this.code=i,o.textContent=this.code,r.appendChild(o),r.setAttribute("class","nonLayout"),document.body.appendChild(r),document.body.appendChild(n),this._codeEl=n,this._preEl=r,this}},{key:"defs",value:function(t){if(void 0!==this._elements)throw new Error("[nodality] .defs() must come before .add(): add() renders as it goes, so definitions given afterwards cannot be used. Chain it as new Des().defs({ ... }).nodes(N).add(E)");return this._defs=t&&"object"===tu(t)&&!Array.isArray(t)?t:{},this}},{key:"set",value:function(t){if("undefined"!=typeof globalThis&&!0===globalThis.NODALITY_EMIT){var e=this.code.map(function(e){return"".concat(e,".render(").concat(mt(t&&t.mount||"#mount"),")")});return globalThis.__NODALITY_EMITTED__=e,this}this.toTextArea(t&&t.mount),this._codeEl.style.display="none",this._preEl.style.display="block",!1===t.elements&&(this._preEl.style.display="none"),!1===t.layout&&null!=document.querySelector("#layoutPre")&&(document.querySelector("#layoutPre").style.display="none"),!1===t.code&&(this._preEl.style.display="none");var n={FloatingInput:Xi,Range:Yi,RadioGroup:ta,Picker:sa,FilePickera:pa,DataList:xa,Base:Lt,Form:_a,Button:Di,Slider:Ni,Video:bi,Checkbox:ii},r={ElementMapper:Ks,Animator:Ct,LinkStyler:Pa,CardGen:Hc,AreaSwitcher:La},o=Vc(Vc(Vc({},{Text:Vt,Image:ie,Link:ye,FlexRow:je,UINavBar:Ne,Free:nn,Audio:fn,Progress:bn,Center:jn,Code:In,Stack:Bn,Wrapper:Qn,MetaAdder:or,Table:pr,Dropdown:Sr,Modal:Cr,TextField:zr,Card:Gr,Wrap:Kr,FlexGrid:ao,ZoomCard:po,Switcher:Uo,MobileBar:Ro,DesktopBar:ko,SideNav:Ve,Spacer:Qo,HScroller:Bc,Polygon:$a,Circle:os,UList:Ai,GridOverlay:Os,Shop:zs}),n),r),i="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__&&"object"===tu(globalThis.__NODALITY_DEV__)?globalThis.__NODALITY_DEV__:null;i&&(i.inDes=!0);var a=function(t){return function(t,e,n){if(Xc())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&Gc(o,n.prototype),o}(Function,Yc(Object.keys(o)).concat([t])).apply(void 0,Yc(Object.values(o)))},s=Ct._owner;Ct._owner=this._owned;try{var l,c=t&&t.mount||"#mount",u=0,f=Qc(this._built);try{for(f.s();!(l=f.n()).done;){var d=l.value;if(d.instance)d.instance.render(c),u+=d.codeCount;else for(var h=0;h<d.codeCount;h++,u++)a(this.code[u])}}catch(t){f.e(t)}finally{f.f()}}finally{Ct._owner=s,i&&(i.inDes=!1)}try{var p=document.querySelector(t&&t.mount||"#mount");this._morphs=wl(p,this._elements,this.protoOptions)}catch(t){console.warn("[nodality] morph node skipped:",t)}try{this._agentSurface=rc({mount:document.querySelector(t&&t.mount||"#mount"),elements:this._elements,nodes:this.protoOptions,morphs:this._morphs})}catch(t){console.warn("[nodality] agent surface skipped:",t)}var y="undefined"!=typeof globalThis&&globalThis.__NODALITY_DEV__&&Array.isArray(globalThis.__NODALITY_DEV__.pages)?globalThis.__NODALITY_DEV__:null;try{(t&&t.annotate||y&&y.annotate)&&function(t,e){if(!t||!Array.isArray(e))return 0;for(var n=Array.from(t.children||[]),r=0;r<n.length&&r<e.length;r++)try{n[r].setAttribute("data-nod",JSON.stringify(e[r]))}catch(t){}}(document.querySelector(t&&t.mount||"#mount"),this._elements)}catch(t){console.warn("[nodality] round-trip annotation skipped:",t)}if(y)try{var m={mount:t&&t.mount||"#mount",elements:this._elements,nodes:this.protoOptions};this._devEntry=m,y.pages.push(m),"undefined"!=typeof window&&"function"==typeof window.dispatchEvent&&"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("nodality:rendered",{detail:m}))}catch(t){console.warn("[nodality] dev registration skipped:",t)}}}],r=[{key:"cloneNodes",value:function(t){if(!Array.isArray(t))return[];try{if("function"==typeof structuredClone)return structuredClone(t)}catch(t){}var e=function(t){if(Array.isArray(t))return t.map(e);if(t&&"object"===tu(t)){var n={};for(var r in t)n[r]=e(t[r]);return n}return t};return t.map(e)}}],n&&eu(e.prototype,n),r&&eu(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n,r}();module.exports=e})();