!function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var c=n[a]={exports:{}};e[a][0].call(c.exports,(function(t){return o(e[a][1][t]||t)}),c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a1&&(e.country=this.countryCodes()[t[1]]),e}static timeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone?Intl.DateTimeFormat().resolvedOptions().timeZone:(new Date).getTimezoneOffset()}static gpuInfo(){const t=document.createElement("canvas").getContext("webgl"),e=t.getExtension("WEBGL_debug_renderer_info");let n=t.getParameter(t.VENDOR),r=t.getParameter(t.RENDERER);return e&&(n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),r=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),{vendor:n,renderer:r}}static browserInfo(){if(!this.isBrowser())return this._browserErr();const t=navigator.userAgent;let e,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?(e=/\brv[ :]+(\d+)/g.exec(t)||[],"IE "+(e[1]||"")):"Chrome"===n[1]&&(e=t.match(/\b(OPR|Edge)\/(\d+)/),null!==e)?e.slice(1).join(" ").replace("OPR","Opera"):(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),window.navigator.brave&&"isBrave"===window.navigator.brave.isBrave.name&&(n[0]="Brave",n[1]=null),{name:n[0],version:n[1]})}static platformInfo(){if(this.isBrowser())return{mobile:this.isMobile(),browser:this.browserInfo(),oscpu:navigator.oscpu,processors:navigator.hardwareConcurrency,platform:navigator.platform};const e=t("os");return{platform:n.platform,os:{arch:e.arch(),type:e.type(),release:e.release(),cpus:e.cpus(),freemem:e.freemem(),totalmem:e.totalmem(),homedir:e.homedir(),hostname:e.hostname(),userInfo:e.userInfo(),networkInterfaces:e.networkInterfaces()},env:n.env}}static audioSupport(){if(!this.isBrowser())return this._browserErr();const t={mp3:"no",vorbis:"no",wav:"no",aac:"no"},e=document.createElement("audio");return"function"==typeof e.canPlayType&&(t.mp3=e.canPlayType("audio/mpeg;"),""===t.mp3&&(t.mp3="no"),t.vorbis=e.canPlayType('audio/ogg; codecs="vorbis"'),""===t.vorbis&&(t.vorbis="no"),t.wav=e.canPlayType('audio/wav; codecs="1"'),""===t.wav&&(t.wav="no"),t.aac=e.canPlayType('audio/mp4; codecs="mp4a.40.2"'),""===t.aac&&(t.aac="no")),t}static videoSupport(){if(!this.isBrowser())return this._browserErr();const t={captions:"no",poster:"no",webm:"no",h264:"no",theora:"no"},e=document.createElement("video");return"function"==typeof e.canPlayType&&(t.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"'),""===t.webm&&(t.webm="no"),t.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'),""===t.h264&&(t.h264="no"),t.theora=e.canPlayType('video/ogg; codecs="theora"'),""===t.theora&&(t.theora="no"),t.poster="poster"in document.createElement("video")?"probably":"no",t.captions="src"in document.createElement("track")?"probably":"no"),t}static pluginSupport(){if(!this.isBrowser())return this._browserErr();const t=[];for(let e=0;e{const e=t.getAttribute("data-bind-var"),n=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=n.match(/[a-z%]+$/i),o=r?r[0]:"",i=n.match(/^-?\d+(\.\d+)?/),a=i?i[0]:"";""!==a&&(t.value=a);const s=()=>{let n=t.value.trim();o&&(isNaN(n)||""===n||(n=parseFloat(n)+"",n+=o)),""!==n&&document.documentElement.style.setProperty(e,n)};t.addEventListener("input",s),t.addEventListener("change",s)}));document.querySelectorAll("[data-bind-click]").forEach((t=>{const e=t.getAttribute("data-bind-click");if(!e)return void console.error("Missing data-bind-click attribute on button:",t);const[n,r]=e.split(":");if(!r)return void console.error("Invalid data-bind-click format on button:",t);const o=r.match(/(\w+)\(([^)]+)\)/);if(!o)return void console.error("Invalid action format in data-bind-click:",r);const[,i,a]=o,s=a.split(",").map((t=>t.trim()));t.addEventListener("click",(()=>{const t=window.getComputedStyle(document.documentElement).getPropertyValue(n).trim();let e;const r=i.toLowerCase();if("add"===r||"sub"===r){const o=t.match(/[a-z%]+$/i),a=o?o[0]:"",l=t.match(/^-?\d+(\.\d+)?/),h=l?parseFloat(l[0]):NaN,c=parseFloat(s[0]);if(isNaN(h)||isNaN(c))return void console.error(`Invalid numeric values for operation '${i}' on CSS variable '${n}'.`);e="add"===r?h+c+a:h-c+a}else if("toggle"===r){if(s.length<2)return void console.error(`Toggle operation requires at least two values. Provided: ${s.length}`);const n=t.toLowerCase();e=0===s.map((t=>t.toLowerCase())).indexOf(n)?s[1]:s[0]}else{if("cycle"!==r)return void console.error(`Unsupported operation in data-bind-click: ${i}`);{if(0===s.length)return void console.error("Cycle operation requires at least one value.");const n=s.findIndex((e=>e===t)),r=-1===n?0:(n+1)%s.length;e=s[r]}}document.documentElement.style.setProperty(n,e)}))}))}}void 0!==e?e.exports=r:window.Bind=r},{}],3:[function(t,e,n){void 0!==e&&(e.exports=class{static alpha2hex(t){const e=(255*t).toString(16).split(".")[0];return 1===e.length?`0${e}`:e}static hex2alpha(t){const e=parseInt(t,16)/255;return Math.round(100*e)/100}static _hex2rgb(t){const e=this.hex2rgb(t);return{r:e.r/255,g:e.g/255,b:e.b/255}}static hex2rgb(t){9===t.length?t=t.substring(0,7):5===t.length&&(t=t.substring(0,4));t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}static _hex2hsl(t){const e=this.hex2rgb(t);return this._rgb2hsl(e.r/255,e.g/255,e.b/255)}static hex2hsl(t){9===t.length?t=t.substring(0,7):5===t.length&&(t=t.substring(0,4));const e=this.hex2rgb(t);return this.rgb2hsl(e.r,e.g,e.b)}static _hex2hsv(t){const e=this.hex2rgb(t);return this._rgb2hsv(e.r/255,e.g/255,e.b/255)}static hex2hsv(t){const e=this.hex2rgb(t);return this.rgb2hsv(e.r,e.g,e.b)}static _rgb2hex(t,e,n){return"#"+((1<<24)+((t*=255)<<16)+((e*=255)<<8)+(n*=255)).toString(16).slice(1)}static rgb2hex(t,e,n){return"#"+((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)}static _rgb2hsl(t,e,n){const r=this._rgb2hsv(t,e,n);return this._hsv2hsl(r.h,r.s,r.v)}static rgb2hsl(t,e,n){const r=this._rgb2hsv(t/255,e/255,n/255),o=this._hsv2hsl(r.h,r.s,r.v);return{h:Math.round(360*o.h),s:Math.round(100*o.s),l:Math.round(100*o.l)}}static _rgb2hsv(t,e,n){t*=255,e*=255,n*=255;const r=Math.max(t,e,n),o=Math.min(t,e,n),i=r-o;let a;const s=0===r?0:i/r,l=r/255;switch(r){case o:a=0;break;case t:a=e-n+i*(e{const e=Math.round(255*t).toString(16);return 1===e.length?"0"+e:e};return`#${o(r.r)}${o(r.g)}${o(r.b)}`}static hsl2hex(t,e,n){return t/=360,e/=100,n/=100,this._hsl2hex(t,e,n)}static _hsl2rgb(t,e,n){t*=360;const r=e*Math.min(n,1-n),o=(e,o=(e+t/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return{r:o(0),g:o(8),b:o(4)}}static hsl2rgb(t,e,n){const r=(t,e,n,r,o)=>(t-e)*(o-r)/(n-e)+r;t=Math.round(10*r(t,0,360,0,1))/10,e=Math.round(10*r(e,0,100,0,1))/10,n=Math.round(10*r(n,0,100,0,1))/10;const o=this._hsl2rgb(t,e,n);return{r:Math.ceil(255*o.r),g:Math.ceil(255*o.g),b:Math.ceil(255*o.b)}}static _hsl2hsv(t,e,n){const r=(1+(e*=(n*=2)<=1?n:1))/2;return{h:t,s:e=2*e/(n+e),v:r}}static hsl2hsv(t,e,n){t/=360,e/=100,n/=100;const r=this._hsl2hsv(t,e,n);return{h:Math.round(360*r.h),s:Math.round(100*r.s),v:Math.round(100*r.v)}}static _hsv2hex(t,e,n){const r=this._hsv2rgb(t,e,n);return this._rgb2hex(r.r,r.g,r.b)}static hsv2hex(t,e,n){const r=this.hsv2rgb(t,e,n);return this.rgb2hex(r.r,r.g,r.b)}static _hsv2rgb(t,e,n){let r,o,i;const a=Math.floor(6*t),s=6*t-a,l=n*(1-e),h=n*(1-s*e),c=n*(1-(1-s)*e);switch(a%6){case 0:r=n,o=c,i=l;break;case 1:r=h,o=n,i=l;break;case 2:r=l,o=n,i=c;break;case 3:r=l,o=h,i=n;break;case 4:r=c,o=l,i=n;break;case 5:r=n,o=l,i=h}return{r:r,g:o,b:i}}static hsv2rgb(t,e,n){t/=360,e/=100,n/=100;const r=this._hsv2rgb(t,e,n);return{r:Math.round(255*r.r),g:Math.round(255*r.g),b:Math.round(255*r.b)}}static _hsv2hsl(t,e,n){const r=(2-e)*n/2;return 0!==r&&(e=1===r?0:r<.5?e*n/(2*r):e*n/(2-2*r)),{h:t,s:e,l:r}}static hsv2hsl(t,e,n){t/=360,e/=100,n/=100;const r=this._hsv2hsl(t,e,n);return{h:Math.round(360*r.h),s:Math.round(100*r.s),l:Math.round(100*r.l)}}static toHSL(t,e={}){const n=(t,e,n)=>Math.min(n,Math.max(e,t)),r=t=>(t%360+360)%360;if("number"==typeof t)return{h:r(t),s:"number"==typeof e.saturation?n(e.saturation,0,100):100,l:"number"==typeof e.lightness?n(e.lightness,0,100):50};if("string"==typeof t&&t){const e=t.trim();if("#"===e[0])return this.hex2hsl(e);const o=this.match(e);if(o){const t=o[0];if("hex"===t)return this.hex2hsl(o[1]);if("rgb"===t){const t=parseFloat(o[2]),e=parseFloat(o[3]),n=parseFloat(o[4]);return this.rgb2hsl(t,e,n)}if("hsl"===t){const t=parseFloat(o[2]),e=parseFloat(o[3]),i=parseFloat(o[4]);return{h:r(t),s:n(e,0,100),l:n(i,0,100)}}}}if(t&&"object"==typeof t){if("h"in t&&"s"in t&&"l"in t)return{h:r(t.h),s:n(t.s,0,100),l:n(t.l,0,100)};if("h"in t&&"s"in t&&"v"in t){const e=this.hsv2hsl(t.h,t.s,t.v);return{h:r(e.h),s:n(e.s,0,100),l:n(e.l,0,100)}}if("r"in t&&"g"in t&&"b"in t)return this.rgb2hsl(t.r,t.g,t.b)}return{h:0,s:100,l:50}}static toRGB(t,e={}){if("number"==typeof t||t&&"object"==typeof t&&"h"in t){const n=this.toHSL(t,e);return this.hsl2rgb(n.h,n.s,n.l)}if("string"==typeof t&&t){const e=t.trim();if("#"===e[0])return this.hex2rgb(e);const n=this.match(e);if(n){const t=n[0];if("hex"===t)return this.hex2rgb(n[1]);if("rgb"===t)return{r:parseFloat(n[2]),g:parseFloat(n[3]),b:parseFloat(n[4])};if("hsl"===t){const t=parseFloat(n[2]),e=parseFloat(n[3]),r=parseFloat(n[4]);return this.hsl2rgb(t,e,r)}}}return t&&"object"==typeof t&&"r"in t&&"g"in t&&"b"in t?{r:t.r,g:t.g,b:t.b}:{r:255,g:0,b:0}}static random(t,e){let n,r,o,i,a,s,l,h;const c="rgba"===t||"hsla"===t;return"number"==typeof e?l="hex"===t?this.alpha2hex(e):e:(!0===e||c)&&(l="hex"===t?Math.floor(255*Math.random()).toString(16):Math.round(100*Math.random())/100),"rgb"===t||"rgba"===t?(n=Math.floor(255*Math.random()),r=Math.floor(255*Math.random()),o=Math.floor(255*Math.random()),l?`rgba(${n}, ${r}, ${o}, ${l})`:`rgb(${n}, ${r}, ${o})`):"hsl"===t||"hsla"===t?(i=Math.floor(360*Math.random()),a=Math.floor(100*Math.random()),s=Math.floor(100*Math.random()),l?`hsla(${i}, ${a}%, ${s}%, ${l})`:`hsl(${i}, ${a}%, ${s}%)`):(h=`#${(1048575*Math.random()*1e6).toString(16).slice(0,6)}`,l?h+l:h)}static contrast(t,e){const n=this.toRGB(t),r=this.toRGB(e),o=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},i=.2126*o(n.r)+.7152*o(n.g)+.0722*o(n.b),a=.2126*o(r.r)+.7152*o(r.g)+.0722*o(r.b);return(Math.max(i,a)+.05)/(Math.min(i,a)+.05)}static isLight(t){let e,n,r;t.match(/^rgb/)?(e=(t=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/))[1],n=t[2],r=t[3]):(e=(t=+("0x"+t.slice(1).replace(t.length<5&&/./g,"$&$&")))>>16,n=t>>8&255,r=255&t);return Math.sqrt(e*e*.299+n*n*.587+r*r*.114)>127.5}static match(t){const e=t.match(/#[a-f\d]{3}(?:[a-f\d]?|(?:[a-f\d]{3}(?:[a-f\d]{2})?)?)\b/),n=t.match(/rgba?\((?:(25[0-5]|2[0-4]\d|1?\d{1,2}|(?:\d{1,2}|100)%),\s*(25[0-5]|2[0-4]\d|1?\d{1,2}|(?:\d{1,2}|100)%),\s*(25[0-5]|2[0-4]\d|1?\d{1,2}|(?:\d{1,2}|100)%)(?:,\s*((?:\d{1,2}|100)%|0(?:\.\d+)?|1))?|(25[0-5]|2[0-4]\d|1?\d{1,2}|(?:\d{1,2}|100)%)\s+(25[0-5]|2[0-4]\d|1?\d{1,2}|(?:\d{1,2}|100)%)\s+(25[0-5]|2[0-4]\d|1?\d{1,2}|(?:\d{1,2}|100)%)(?:\s+((?:\d{1,2}|100)%|0(?:\.\d+)?|1))?)\)/),r=t.match(/hsla?\((?:(-?\d+(?:deg|g?rad|turn)?),\s*((?:\d{1,2}|100)%),\s*((?:\d{1,2}|100)%)(?:,\s*((?:\d{1,2}|100)%|0(?:\.\d+)?|1))?|(-?\d+(?:deg|g?rad|turn)?)\s+((?:\d{1,2}|100)%)\s+((?:\d{1,2}|100)%)(?:\s+((?:\d{1,2}|100)%|0(?:\.\d+)?|1))?)\)/);return e?["hex",...e]:n?["rgb",...n]:r?["hsl",...r]:null}static scheme(t={}){const e=(t.harmony||"").toLowerCase(),n=t||{},r=(t,e,n)=>Math.min(n,Math.max(e,t)),o=t=>(t%360+360)%360,i=this.toHSL(t.base,{saturation:n.saturation,lightness:n.lightness}),a=o(i.h),s=r("saturation"in n?n.saturation:i.s,0,100),l=r("lightness"in n?n.lightness:i.l,0,100),h=!("includeBase"in n)||!!n.includeBase,c="number"==typeof n.count&&n.count>0?Math.floor(n.count):void 0,u="number"==typeof n.angle?n.angle:30,d="number"==typeof n.offset?n.offset:30,f=null!=n.contrast?n.contrast:n.minContrast,m="string"==typeof f?"AAA"===f.toUpperCase()?7:4.5:"number"==typeof f?f:null,p=n.contrastAgainst||n.against,g=n.contrastStrategy||n.strategy||"adjust",b="number"==typeof n.steps&&n.steps>0?Math.min(50,Math.floor(n.steps)):1,y=t=>!m||!p||this.contrast(t,p)>=m,w=t=>{if(!m||!p)return t;if(y(t))return t;const e=this.toHSL(t),n=t=>{let n="darker"===t?0:e.l,r="darker"===t?e.l:100,o=null;for(let i=0;i=m?(o={l:i,hex:a},"darker"===t?r=i:n=i):"darker"===t?n=i:r=i}return o},r=n("darker"),o=n("lighter");return r||o?r&&!o?r.hex:!r&&o?o.hex:Math.abs(r.l-e.l)<=Math.abs(o.l-e.l)?r.hex:o.hex:t},A=(t,e=s,n=l,i)=>{let a=this.hsl2hex(o(t),r(e,0,100),r(n,0,100));if(m&&p)if("adjust"===g)a=w(a);else if(!y(a))return;(i||S).push(a)},S=[];if("random"===e){const t=c||5;for(let e=0;e=0&&(t+=1),A(a+t*u)}return S}if("monochromatic"===e){const t=c||5,e=Array.isArray(n.lightnessRange)&&2===n.lightnessRange.length?[r(n.lightnessRange[0],0,100),r(n.lightnessRange[1],0,100)]:[r(Math.max(0,l-40),0,100),r(Math.min(100,l+40),0,100)];for(let n=0;nA(t))),S}if("complementary"===e){let t=[a,a+180];return h||(t=t.slice(1)),c&&(t=t.slice(0,c)),t.forEach((t=>A(t))),S}if("split-complementary"===e||"split_complementary"===e||"split"===e){let t=[a,a+180-d,a+180+d];return h||(t=t.slice(1)),c&&(t=t.slice(0,c)),t.forEach((t=>A(t))),S}if("square"===e){let t=[a,a+90,a+180,a+270];return h||(t=t.slice(1)),c&&(t=t.slice(0,c)),t.forEach((t=>A(t))),S}if("compound"===e){let t=[a-d,a,a+d,a+180-d,a+180+d];return h||(t=t.filter((t=>o(t)!==o(a)))),c&&(t=t.slice(0,c)),t.forEach((t=>A(t))),S}const x=c||5,v=h?-Math.floor((x-1)/2):-Math.floor(x/2);for(let t=0;t=0&&(e+=1),A(a+e*u)}return S}})},{}],4:[function(t,e,n){function r(t){if(!(t instanceof window.HTMLCanvasElement))return t;if(t.__nn_canvasAugmented)return t;if(t.__nn_canvasAugmented=!0,t.ctx=t.getContext("2d"),t.mouseDown=!1,t.mouseX=0,t.mouseY=0,!t.__nn_mouseHandlersBound){const e=e=>{const n=t.getBoundingClientRect();t.mouseX=e.clientX-n.left,t.mouseY=e.clientY-n.top},n=e=>{const n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom&&(t.mouseDown=!0)},r=()=>{t.mouseDown=!1};window.addEventListener("mousemove",e),window.addEventListener("mousedown",n),window.addEventListener("mouseup",r),t.__nn_mouseHandlersBound={updateMouse:e,onMouseDown:n,onMouseUp:r}}if("function"==typeof t.addTo){const e=t.addTo;t.addTo=function(t){e.call(this,t);const n=this.parentNode;return n&&n instanceof window.HTMLElement&&(this.hasAttribute("width")||300!==this.width||(this.width=n.offsetWidth),this.hasAttribute("height")||150!==this.height||(this.height=n.offsetHeight)),this}}if("function"==typeof t.remove&&t.__nn_mouseHandlersBound){const e=t.remove;t.remove=function(){const t=this.__nn_mouseHandlersBound;return t&&(window.removeEventListener("mousemove",t.updateMouse),window.removeEventListener("mousedown",t.onMouseDown),window.removeEventListener("mouseup",t.onMouseUp),this.__nn_mouseHandlersBound=null),e.call(this)}}return Object.defineProperties(t,{fillColor:{get(){return this.ctx.fillStyle},set(t){const e=void 0!==window.CanvasGradient&&t instanceof window.CanvasGradient,n=void 0!==window.CanvasPattern&&t instanceof window.CanvasPattern;if(!e&&!n&&"string"!=typeof t)throw new Error("canvas.fillColor must be a CSS color string, CanvasGradient or CanvasPattern, but you passed a "+typeof t);this.ctx.fillStyle=t},configurable:!0},strokeColor:{get(){return this.ctx.strokeStyle},set(t){const e=void 0!==window.CanvasGradient&&t instanceof window.CanvasGradient,n=void 0!==window.CanvasPattern&&t instanceof window.CanvasPattern;if(!e&&!n&&"string"!=typeof t)throw new Error("canvas.strokeColor must be a CSS color string, CanvasGradient or CanvasPattern, but you passed a "+typeof t);this.ctx.strokeStyle=t},configurable:!0},lineWidth:{get(){return this.ctx.lineWidth},set(t){if("number"!=typeof t)throw new Error("lineWidth is expecting a number, for example canvas.lineWidth = 5 but you passed a "+typeof t);this.ctx.lineWidth=t},configurable:!0},lineCap:{get(){return this.ctx.lineCap},set(t){if("string"!=typeof t)throw new Error("lineCap is expecting a string, for example canvas.lineCap = 'round' but you passed a "+typeof t);this.ctx.lineCap=t},configurable:!0},lineJoin:{get(){return this.ctx.lineJoin},set(t){if("string"!=typeof t)throw new Error("lineJoin is expecting a string, for example canvas.lineJoin = 'miter' but you passed a "+typeof t);this.ctx.lineJoin=t},configurable:!0},font:{get(){return this.ctx.font},set(t){if("string"!=typeof t)throw new Error("canvas.font is expecting a CSS font string, for example canvas.font = '16px sans-serif' but you passed a "+typeof t);this.ctx.font=t},configurable:!0},textAlign:{get(){return this.ctx.textAlign},set(t){if("string"!=typeof t)throw new Error("canvas.textAlign is expecting a string, for example canvas.textAlign = 'center' but you passed a "+typeof t);this.ctx.textAlign=t},configurable:!0},textBaseline:{get(){return this.ctx.textBaseline},set(t){if("string"!=typeof t)throw new Error("canvas.textBaseline is expecting a string, for example canvas.textBaseline = 'middle' but you passed a "+typeof t);this.ctx.textBaseline=t},configurable:!0},blendMode:{get(){return this.ctx.globalCompositeOperation},set(t){if("string"!=typeof t)throw new Error("canvas.blendMode expects a string, for example canvas.blendMode = 'multiply' but you passed "+typeof t);this.ctx.globalCompositeOperation=t},configurable:!0},fillStyle:{get(){return this.ctx.fillStyle},set(t){this.fillColor=t},configurable:!0},strokeStyle:{get(){return this.ctx.strokeStyle},set(t){this.strokeColor=t},configurable:!0},globalAlpha:{get(){return this.ctx.globalAlpha},set(t){if("number"!=typeof t)throw new Error("canvas.globalAlpha must be a number");this.ctx.globalAlpha=t},configurable:!0},miterLimit:{get(){return this.ctx.miterLimit},set(t){if("number"!=typeof t)throw new Error("canvas.miterLimit must be a number");this.ctx.miterLimit=t},configurable:!0},shadowBlur:{get(){return this.ctx.shadowBlur},set(t){if("number"!=typeof t)throw new Error("canvas.shadowBlur must be a number");this.ctx.shadowBlur=t},configurable:!0},shadowColor:{get(){return this.ctx.shadowColor},set(t){if("string"!=typeof t)throw new Error("canvas.shadowColor must be a string");this.ctx.shadowColor=t},configurable:!0},shadowOffsetX:{get(){return this.ctx.shadowOffsetX},set(t){if("number"!=typeof t)throw new Error("canvas.shadowOffsetX must be a number");this.ctx.shadowOffsetX=t},configurable:!0},shadowOffsetY:{get(){return this.ctx.shadowOffsetY},set(t){if("number"!=typeof t)throw new Error("canvas.shadowOffsetY must be a number");this.ctx.shadowOffsetY=t},configurable:!0},imageSmoothingEnabled:{get(){return this.ctx.imageSmoothingEnabled},set(t){this.ctx.imageSmoothingEnabled=!!t},configurable:!0},imageSmoothingQuality:{get(){return this.ctx.imageSmoothingQuality},set(t){this.ctx.imageSmoothingQuality=t},configurable:!0},lineDashOffset:{get(){return this.ctx.lineDashOffset},set(t){if("number"!=typeof t)throw new Error("canvas.lineDashOffset must be a number");this.ctx.lineDashOffset=t},configurable:!0},direction:{get(){return this.ctx.direction},set(t){this.ctx.direction=t},configurable:!0},globalCompositeOperation:{get(){return this.ctx.globalCompositeOperation},set(t){this.blendMode=t},configurable:!0},filter:{get(){return this.ctx.filter},set(t){this.ctx.filter=t},configurable:!0},fontKerning:{get(){return void 0!==this.ctx.fontKerning?this.ctx.fontKerning:this.__nn_fontKerning},set(t){void 0!==this.ctx.fontKerning?this.ctx.fontKerning=t:this.__nn_fontKerning=t},configurable:!0},fontStretch:{get(){return void 0!==this.ctx.fontStretch?this.ctx.fontStretch:this.__nn_fontStretch},set(t){void 0!==this.ctx.fontStretch?this.ctx.fontStretch=t:this.__nn_fontStretch=t},configurable:!0},fontVariantCaps:{get(){return void 0!==this.ctx.fontVariantCaps?this.ctx.fontVariantCaps:this.__nn_fontVariantCaps},set(t){void 0!==this.ctx.fontVariantCaps?this.ctx.fontVariantCaps=t:this.__nn_fontVariantCaps=t},configurable:!0},letterSpacing:{get(){return void 0!==this.ctx.letterSpacing?this.ctx.letterSpacing:this.__nn_letterSpacing},set(t){void 0!==this.ctx.letterSpacing?this.ctx.letterSpacing=t:this.__nn_letterSpacing=t},configurable:!0},textRendering:{get(){return void 0!==this.ctx.textRendering?this.ctx.textRendering:this.__nn_textRendering},set(t){void 0!==this.ctx.textRendering?this.ctx.textRendering=t:this.__nn_textRendering=t},configurable:!0},wordSpacing:{get(){return void 0!==this.ctx.wordSpacing?this.ctx.wordSpacing:this.__nn_wordSpacing},set(t){void 0!==this.ctx.wordSpacing?this.ctx.wordSpacing=t:this.__nn_wordSpacing=t},configurable:!0}}),t.resize=function(t,e){if("number"!=typeof t||"number"!=typeof e)throw new Error(`canvas.resize() expects two numbers, for example canvas.resize(640, 480) but you passed ${typeof t} and ${typeof e}`);const n=document.createElement("canvas");n.width=this.width,n.height=this.height,n.getContext("2d").drawImage(this,0,0);const r=this.ctx.getLineDash?this.ctx.getLineDash():[],o=this.ctx.getTransform?this.ctx.getTransform():null,i={fillColor:this.fillColor,strokeColor:this.strokeColor,lineWidth:this.lineWidth,lineCap:this.lineCap,lineJoin:this.lineJoin,font:this.font,textAlign:this.textAlign,textBaseline:this.textBaseline,blendMode:this.blendMode,filter:this.ctx.filter,globalAlpha:"number"==typeof this.ctx.globalAlpha?this.ctx.globalAlpha:void 0,miterLimit:"number"==typeof this.ctx.miterLimit?this.ctx.miterLimit:void 0,shadowBlur:this.ctx.shadowBlur,shadowColor:this.ctx.shadowColor,shadowOffsetX:this.ctx.shadowOffsetX,shadowOffsetY:this.ctx.shadowOffsetY,imageSmoothingEnabled:this.ctx.imageSmoothingEnabled,imageSmoothingQuality:this.ctx.imageSmoothingQuality,lineDashOffset:this.ctx.lineDashOffset};return this.width=t,this.height=e,this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.lineWidth=i.lineWidth,this.lineCap=i.lineCap,this.lineJoin=i.lineJoin,this.font=i.font,this.textAlign=i.textAlign,this.textBaseline=i.textBaseline,this.blendMode=i.blendMode,this.ctx.filter=i.filter,"number"==typeof i.globalAlpha&&(this.ctx.globalAlpha=i.globalAlpha),"number"==typeof i.miterLimit&&(this.ctx.miterLimit=i.miterLimit),this.ctx.shadowBlur=i.shadowBlur,this.ctx.shadowColor=i.shadowColor,this.ctx.shadowOffsetX=i.shadowOffsetX,this.ctx.shadowOffsetY=i.shadowOffsetY,void 0!==i.imageSmoothingEnabled&&(this.ctx.imageSmoothingEnabled=i.imageSmoothingEnabled),void 0!==i.imageSmoothingQuality&&(this.ctx.imageSmoothingQuality=i.imageSmoothingQuality),"number"==typeof i.lineDashOffset&&(this.ctx.lineDashOffset=i.lineDashOffset),this.ctx.setLineDash&&Array.isArray(r)&&this.ctx.setLineDash(r),o&&this.ctx.setTransform&&this.ctx.setTransform(o),this.ctx.drawImage(n,0,0),this},t.getPixelData=function(t=0,e=0,n,r){if("number"!=typeof t||"number"!=typeof e)throw new Error("canvas.getPixelData() x and y must be numbers, for example canvas.getPixelData(0, 0)");if(n=n||this.width,r=r||this.height,"number"!=typeof n||"number"!=typeof r)throw new Error("canvas.getPixelData() width and height must be numbers, for example canvas.getPixelData(0, 0, 100, 100)");return this.ctx.getImageData(t,e,n,r).data},t.getPixels=function(){const t=this.getPixelData(),e=[];for(let n=0;n"number"!=typeof t)))throw new Error("canvas.clear() expects numbers, for example canvas.clear(50, 50, 25, 15)");this.ctx.clearRect(t,e,n,r)}return this},t.ellipse=function(t,e,n,r){if([t,e,n].some((t=>"number"!=typeof t)))throw new Error("canvas.ellipse() expects numbers, for example canvas.ellipse(50, 50, 25, 15)");return this.ctx.beginPath(),this.ctx.ellipse(t,e,n,r||n,0,2*Math.PI,!1),this.ctx.closePath(),this.ctx.fill(),this.ctx.stroke(),this},t.pathRect=function(t,e,n,r){return this.ctx.rect(t,e,n,r),this},t.pathEllipse=function(t,e,n,r,o=0,i=0,a=2*Math.PI,s=!1){return this.ctx.ellipse(t,e,n,r,o,i,a,s),this},t.circle=function(t,e,n){if([t,e,n].some((t=>"number"!=typeof t)))throw new Error("canvas.circle() expects numbers, for example canvas.circle(50, 50, 100)");return this.ellipse(t,e,n,n)},t.rect=function(t,e,n,r){if([t,e,n,r].some((t=>"number"!=typeof t)))throw new Error("canvas.rect() expects numbers, for example canvas.rect(10, 10, 100, 50)");return this.ctx.beginPath(),this.ctx.rect(t,e,n,r),this.ctx.closePath(),this.ctx.fill(),this.ctx.stroke(),this},t.line=function(t,e,n,r){if([t,e,n,r].some((t=>"number"!=typeof t)))throw new Error("canvas.line() expects numbers, for example canvas.line(0, 0, 100, 100)");return this.ctx.beginPath(),this.ctx.moveTo(t,e),this.ctx.lineTo(n,r),this.ctx.closePath(),this.ctx.stroke(),this},t.triangle=function(t,e,n,r,o,i){if([t,e,n,r,o,i].some((t=>"number"!=typeof t)))throw new Error("canvas.triangle() expects numbers, for example canvas.triangle(0,0, 50,100, 100,0)");return this.ctx.beginPath(),this.ctx.moveTo(t,e),this.ctx.lineTo(n,r),this.ctx.lineTo(o,i),this.ctx.closePath(),this.ctx.fill(),this.ctx.stroke(),this},t.text=function(t,e,n,r){if("string"!=typeof t)throw new Error('canvas.text() expects first argument to be a string, for example canvas.text("hello", 10, 20)');if("number"!=typeof e||"number"!=typeof n)throw new Error('canvas.text() x and y must be numbers, for example canvas.text("hello", 10, 20)');if("fill"!==(r=r||"fill")&&"stroke"!==r)throw new Error(`canvas.text() type must be 'fill' or 'stroke', but you passed '${r}'`);return"stroke"===r?this.ctx.strokeText(t,e,n):this.ctx.fillText(t,e,n),this},t.drawImage=function(t,...e){const n=t=>{const n=t.naturalWidth||t.videoWidth||t.width,r=t.naturalHeight||t.videoHeight||t.height;let o,i;return 4===e.length?(e[2]||(e[2]=n),e[3]||(e[3]=r)):8===e.length&&(e[6]||(e[6]=e[2]||n),e[7]||(e[7]=e[3]||r)),2===e.length?(o=n,i=r):4===e.length?(o=e[2],i=e[3]):8===e.length&&(o=e[6],i=e[7]),(0===this.width||0===this.height)&&o&&i&&(this.width=o,this.height=i),this.ctx.drawImage(t,...e),this};if("string"==typeof t){const e=new Image;return e.onload=()=>n(e),e.src=t,this}return t instanceof window.HTMLImageElement&&(!t.complete||t.naturalWidth+t.naturalHeight===0)?(t.addEventListener("load",(()=>n(t)),{once:!0}),this):n(t)},t.fillRect=function(t,e,n,r){return this.ctx.fillRect(t,e,n,r),this},t.strokeRect=function(t,e,n,r){return this.ctx.strokeRect(t,e,n,r),this},t.clearRect=function(t,e,n,r){return this.ctx.clearRect(t,e,n,r),this},t.beginPath=function(){return this.ctx.beginPath(),this},t.closePath=function(){return this.ctx.closePath(),this},t.moveTo=function(t,e){return this.ctx.moveTo(t,e),this},t.lineTo=function(t,e){return this.ctx.lineTo(t,e),this},t.bezierCurveTo=function(...t){return this.ctx.bezierCurveTo(...t),this},t.quadraticCurveTo=function(...t){return this.ctx.quadraticCurveTo(...t),this},t.arc=function(...t){return this.ctx.arc(...t),this},t.arcTo=function(...t){return this.ctx.arcTo(...t),this},t.clip=function(...t){return this.ctx.clip(...t),this},t.fill=function(...t){return this.ctx.fill(...t),this},t.stroke=function(...t){return this.ctx.stroke(...t),this},t.resetTransform=function(){return this.ctx.resetTransform?this.ctx.resetTransform():this.ctx.setTransform(1,0,0,1,0,0),this},t.setLineDash=function(t){if(!Array.isArray(t))throw new Error("setLineDash expects an array");return this.ctx.setLineDash&&this.ctx.setLineDash(t),this},t.getLineDash=function(){return this.ctx.getLineDash?this.ctx.getLineDash():[]},t.measureText=function(t){return this.ctx.measureText(t)},t.fillText=function(t,e,n,r){return this.ctx.fillText(t,e,n,r),this},t.strokeText=function(t,e,n,r){return this.ctx.strokeText(t,e,n,r),this},t.createLinearGradient=function(...t){return this.ctx.createLinearGradient(...t)},t.createRadialGradient=function(...t){return this.ctx.createRadialGradient(...t)},t.createConicGradient=function(...t){if(!this.ctx.createConicGradient)throw new Error("createConicGradient is not supported");return this.ctx.createConicGradient(...t)},t.createPattern=function(...t){return this.ctx.createPattern(...t)},t.createImageData=function(...t){return this.ctx.createImageData(...t)},t.getImageData=function(...t){return this.ctx.getImageData(...t)},t.putImageData=function(...t){return this.ctx.putImageData(...t),this},t.getTransform=function(){return this.ctx.getTransform?this.ctx.getTransform():void 0},t.isPointInPath=function(...t){return this.ctx.isPointInPath(...t)},t.isPointInStroke=function(...t){return this.ctx.isPointInStroke(...t)},t.isContextLost=function(){return!!this.ctx.isContextLost&&this.ctx.isContextLost()},t.getContextAttributes=function(){return this.ctx.getContextAttributes?this.ctx.getContextAttributes():void 0},t.reset=function(){return this.ctx.reset?this.ctx.reset():this.ctx.setTransform(1,0,0,1,0,0),this},t.roundRect=function(...t){if(this.ctx.roundRect)return this.ctx.roundRect(...t),this;const[e,n,r,o,i]=t,a=Math.max(0,Math.min(r,o,"number"==typeof i?i:0));return this.beginPath().moveTo(e+a,n).lineTo(e+r-a,n).arc(e+r-a,n+a,a,-Math.PI/2,0).lineTo(e+r,n+o-a).arc(e+r-a,n+o-a,a,0,Math.PI/2).lineTo(e+a,n+o).arc(e+a,n+o-a,a,Math.PI/2,Math.PI).lineTo(e,n+a).arc(e+a,n+a,a,Math.PI,1.5*Math.PI),this},t.drawFocusIfNeeded=function(...t){return this.ctx.drawFocusIfNeeded&&this.ctx.drawFocusIfNeeded(...t),this},t.scale=function(t,e){if("number"!=typeof t)throw new Error("scale() expects numbers");return this.ctx.scale(t,"number"==typeof e?e:t),this},t.rotate=function(t){if("number"!=typeof t)throw new Error("rotate() expects a number in radians");return this.ctx.rotate(t),this},t.translate=function(t,e){if("number"!=typeof t||"number"!=typeof e)throw new Error("translate() expects two numbers");return this.ctx.translate(t,e),this},t.transform=function(t,e,n,r,o,i){if([t,e,n,r,o,i].some((t=>"number"!=typeof t)))throw new Error("transform() expects six numbers");return this.ctx.transform(t,e,n,r,o,i),this},t.setTransform=function(t,e,n,r,o,i){if([t,e,n,r,o,i].some((t=>"number"!=typeof t)))throw new Error("setTransform() expects six numbers");return this.ctx.setTransform(t,e,n,r,o,i),this},t.save=function(){if(arguments.length)throw new Error("canvas.save() does not take any arguments");return this.ctx.save(),this},t.restore=function(){if(arguments.length)throw new Error("canvas.restore() does not take any arguments");return this.ctx.restore(),this},t.fitToParent=function(t){const e=this.parentNode;if(!(e instanceof window.HTMLElement))throw new Error("canvas.fitToParent() requires the canvas to be in the DOM (use .addTo() first)");const n=e.clientWidth||e.offsetWidth,r=e.clientHeight||e.offsetHeight,o="number"==typeof t&&isFinite(t)&&t>0?t:window.devicePixelRatio||1,i={fillColor:this.fillColor,strokeColor:this.strokeColor,lineWidth:this.lineWidth,lineCap:this.lineCap,lineJoin:this.lineJoin,font:this.font,textAlign:this.textAlign,textBaseline:this.textBaseline,blendMode:this.blendMode,filter:this.ctx.filter,globalAlpha:"number"==typeof this.ctx.globalAlpha?this.ctx.globalAlpha:void 0,miterLimit:"number"==typeof this.ctx.miterLimit?this.ctx.miterLimit:void 0,shadowBlur:this.ctx.shadowBlur,shadowColor:this.ctx.shadowColor,shadowOffsetX:this.ctx.shadowOffsetX,shadowOffsetY:this.ctx.shadowOffsetY,imageSmoothingEnabled:this.ctx.imageSmoothingEnabled,imageSmoothingQuality:this.ctx.imageSmoothingQuality,lineDash:this.ctx.getLineDash?this.ctx.getLineDash():[],lineDashOffset:this.ctx.lineDashOffset};return this.style.width=n+"px",this.style.height=r+"px",this.width=Math.max(1,Math.floor(n*o)),this.height=Math.max(1,Math.floor(r*o)),this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.lineWidth=i.lineWidth,this.lineCap=i.lineCap,this.lineJoin=i.lineJoin,this.font=i.font,this.textAlign=i.textAlign,this.textBaseline=i.textBaseline,this.blendMode=i.blendMode,this.ctx.filter=i.filter,"number"==typeof i.globalAlpha&&(this.ctx.globalAlpha=i.globalAlpha),"number"==typeof i.miterLimit&&(this.ctx.miterLimit=i.miterLimit),this.ctx.shadowBlur=i.shadowBlur,this.ctx.shadowColor=i.shadowColor,this.ctx.shadowOffsetX=i.shadowOffsetX,this.ctx.shadowOffsetY=i.shadowOffsetY,void 0!==i.imageSmoothingEnabled&&(this.ctx.imageSmoothingEnabled=i.imageSmoothingEnabled),void 0!==i.imageSmoothingQuality&&(this.ctx.imageSmoothingQuality=i.imageSmoothingQuality),"number"==typeof i.lineDashOffset&&(this.ctx.lineDashOffset=i.lineDashOffset),this.ctx.setLineDash&&Array.isArray(i.lineDash)&&this.ctx.setLineDash(i.lineDash),this.ctx.setTransform?this.ctx.setTransform(o,0,0,o,0,0):this.ctx.scale(o,o),this},t}void 0!==e?e.exports={augment:r}:window.NNCanvas={augment:r}},{}],5:[function(t,e,n){class r{static on(t,e,n){"string"!=typeof t?console.error("( ◕ ◞ ◕ ) nn: the first argument to the .on() method should be an event type written as a string"):"function"!=typeof e&&console.error('( ◕ ◞ ◕ ) nn: the second argument to the .on() method should be a function you want to call "on" that event'),window.addEventListener(t,e,n),["afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","blur","copy","cut","devicemotion","deviceorientation","deviceorientationabsolute","error","focus","gamepadconnected","gamepaddisconnected","hashchange","languagechange","load","message","messageerror","offline","online","orientationchange","Deprecated","pagehide","pageshow","paste","popstate","rejectionhandled","resize","storage","unhandledrejection","unload","keydown","keypress","keyup","losecapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","move","moveend","movestart","click","contextmenu","dblclick"].includes(t)||console.warn(`( ◕ ◞ ◕ ) nn: you might want to make sure that '${t}' is a valid window event type`)}static off(t,e,n){"string"!=typeof t?console.error("( ◕ ◞ ◕ ) nn: the first argument to the .off() method should be an event type written as a string"):"function"!=typeof e&&console.error("( ◕ ◞ ◕ ) nn: the second argument to the .off() method should be the same function reference previously passed to .on()");const r="boolean"==typeof n?n:n&&"object"==typeof n&&!0===n.capture;window.removeEventListener(t,e,r),["afterprint","appinstalled","beforeinstallprompt","beforeprint","beforeunload","blur","copy","cut","devicemotion","deviceorientation","deviceorientationabsolute","error","focus","gamepadconnected","gamepaddisconnected","hashchange","languagechange","load","message","messageerror","offline","online","orientationchange","Deprecated","pagehide","pageshow","paste","popstate","rejectionhandled","resize","storage","unhandledrejection","unload","keydown","keypress","keyup","losecapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","move","moveend","movestart","click","contextmenu","dblclick"].includes(t)||console.warn(`( ◕ ◞ ◕ ) nn: you might want to make sure that '${t}' is a valid window event type`)}static create(t){["html","base","head","link","meta","style","title","body","address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","embed","iframe","object","param","picture","source","svg","math","canvas","noscript","script","del","ins","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr","button","datalist","fieldset","form","input","label","legend","meter","optgroup","option","output","progress","select","textarea","details","dialog","menu","summary","slot","template","acronym","applet","basefont","bgsound","big","blink","center","command","content","dir","element","font","frame","frameset","image","isindex","keygen","listing","marquee","menuitem","multicol","nextid","nobr","noembed","noframes","plaintext","shadow","spacer","strike","tt","xmp"].includes(t)||console.warn(`( ◕ ◞ ◕ ) nn: are you sure that '${t}' is a valid HTMLElement?`);const e=document.createElement(t);return this.get(e)}static getAll(t){const e=[];return document.querySelectorAll(t).forEach((t=>e.push(this.get(t)))),e}static get(e){const n=["activate","afterupdate","beforeactivate","beforecopy","beforecut","beforedeactivate","beforeeditfocus","beforepaste","beforeupdate","blur","click","contextmenu","controlselect","copy","cut","dblclick","deactivate","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","errorupdate","filterchange","focus","focusin","focusout","help","input","keydown","keypress","keyup","losecapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","move","moveend","movestart","paste","propertychange","readystatechange","resize","resizeend","resizestart","selectstart","timeerror"],o=["abort","canplay","canplaythrough","durationchange","emptied","encrypted","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],i=e instanceof window.HTMLElement?e:document.querySelector(e);if("string"==typeof e&&!i)return void console.warn(`( ◕ ◞ ◕ ) nn.get: couldn't find an HTML element matching the CSS selector query "${e}"`);if(!i)return;function a(t,e,n){const r=new RegExp(`${e}\\([^)]*\\)`);let o=t.style.filter||"";r.test(o)?o=o.replace(r,`${e}(${n})`):o+=` ${e}(${n})`,t.style.filter=o.trim()}function s(t,e,n){const r=new RegExp(`${e}\\([^)]*\\)`);let o=t.style.transform||"";r.test(o)?o=o.replace(r,`${e}(${n})`):o+=` ${e}(${n})`,t.style.transform=o.trim()}i.on=function(t,e,r){"string"!=typeof t?console.error("( ◕ ◞ ◕ ) nn: the first argument to the .on() method should be an event type written as a string"):"function"!=typeof e&&console.error('( ◕ ◞ ◕ ) nn: the second argument to the .on() method should be a function you want to call "on" that event'),this.__nn_listeners||(this.__nn_listeners={}),this.__nn_listeners[t]||(this.__nn_listeners[t]=new Map);const i=this,a=function(t){return e.call(i,t)},s="boolean"==typeof r?r:r&&"object"==typeof r&&!0===r.capture;this.addEventListener(t,a,r),this.__nn_listeners[t].set(e,{wrapped:a,capture:s});return(this instanceof window.HTMLMediaElement?[...n,...o]:n).includes(t)||console.warn(`( ◕ ◞ ◕ ) nn: you might want to make sure that this element has a '${t}' event type`),this},i.off=function(t,e,r){"string"!=typeof t?console.error("( ◕ ◞ ◕ ) nn: the first argument to the .off() method should be an event type written as a string"):"function"!=typeof e&&console.error("( ◕ ◞ ◕ ) nn: the second argument to the .off() method should be the same function reference previously passed to .on()");let i,a=e;if(this.__nn_listeners&&this.__nn_listeners[t]){const n=this.__nn_listeners[t].get(e);n&&(a=n.wrapped,i=n.capture,this.__nn_listeners[t].delete(e))}void 0===i&&(i="boolean"==typeof r?r:r&&"object"==typeof r&&!0===r.capture),this.removeEventListener(t,a,i);return(this instanceof window.HTMLMediaElement?[...n,...o]:n).includes(t)||console.warn(`( ◕ ◞ ◕ ) nn: you might want to make sure that this element has a '${t}' event type`),this},i.content=function(t){return"string"!=typeof t&&console.error("( ◕ ◞ ◕ ) nn: the .content() method is expecting some content as a string"),this.innerHTML=t,this},i.get=function(t){let e;return"string"==typeof t?(e=this.querySelector(t),e?r.get(e):void console.warn(`( ◕ ◞ ◕ ) nn.get: couldn't find an HTML element matching the CSS selector query "${t}" within this element`)):t instanceof window.HTMLElement?this.contains(t)?r.get(t):void console.error("( ◕ ◞ ◕ ) nn: the element you passed to .get() is not a descendant of this element"):void console.error("( ◕ ◞ ◕ ) nn: the .get() method expects either a CSS query selector string or an HTMLElement")},i.getAll=function(t){if("string"!=typeof t)return console.error("( ◕ ◞ ◕ ) nn: the .getAll() method expects a CSS query selector string"),[];const e=[];return this.querySelectorAll(t).forEach((t=>e.push(r.get(t)))),e},i.addTo=function(t){return"string"==typeof t||t instanceof window.HTMLElement||console.error("( ◕ ◞ ◕ ) nn: the .addTo() method expects either a CSS query selector string or an HTMLElement"),this.parentNode&&this.remove(),t instanceof window.HTMLElement?t.appendChild(this):document.querySelector(t).appendChild(this),this},i.set=function(t,e){const n=(t,e)=>{"stream"===t?(e instanceof window.MediaStream||console.error('( ◕ ◞ ◕ ) nn: when passing a "stream" property to .set() the value should a "Promise" which will resolve to a MediaStream object.'),i.srcObject=e):"options"===t&&e instanceof Array&&"select"===i.tagName.toLocaleLowerCase()?e.forEach((t=>{const e=document.createElement("option");e.textContent=t,e.setAttribute("value",t),i.appendChild(e)})):i.setAttribute(t,e)};if("string"==typeof t&&void 0!==e)n(t,e);else if("object"!=typeof t||e)console.error("( ◕ ◞ ◕ ) nn: the .set() method expects two arguments, an HTML attribute and value, or an object of HTML attributes and values");else for(const e in t){n(e,t[e])}return this},i.css=function(t,e){if("string"==typeof t&&void 0!==e){const n=t;(t={})[n]=e}else"object"!=typeof t&&console.error("( ◕ ◞ ◕ ) nn: the .css() method expects two arguments, a CSS property and value, or an object of CSS properties and values");for(const e in t){const n=t[e],r="string"==typeof n||"number"==typeof n;if(r){if("string"==typeof n)this.style[e]=n;else if("number"==typeof n){const t=this.style[e];this.style[e]=n,""!==this.style[e]&&t!==this.style[e]||(this.style[e]=n+"px")}}else console.error("( ◕ ◞ ◕ ) nn: the CSS values in the object passed to .css() should be strings or a numbers");r&&""===this.style[e]&&console.error(`( ◕ ◞ ◕ ) nn: "${n}" is not a valid value for the "${e}" property in CSS`)}return this},i.blur=function(t=0){return a(this,"blur",`${t}px`),this},i.brightness=function(t=1){return a(this,"brightness",t),this},i.contrast=function(t=1){return a(this,"contrast",t),this},i.dropShadow=function(t=0,e=0,n=0,r="black"){return a(this,"drop-shadow",`${t}px ${e}px ${n}px ${r}`),this},i.grayscale=function(t=0){return a(this,"grayscale",t),this},i.hueRotate=function(t=0){return a(this,"hue-rotate",`${t}deg`),this},i.invert=function(t=0){return a(this,"invert",t),this},i.opacity=function(t=1){return a(this,"opacity",t),this},i.sepia=function(t=0){return a(this,"sepia",t),this},i.saturate=function(t=1){return a(this,"saturate",t),this},i.scale=function(t,e){return s(this,"scale",`${t}, ${e=e||t}`),this},i.rotate=function(t){return s(this,"rotate",`${t}deg`),this},i.skew=function(t,e){return s(this,"skew",`${t}deg, ${e=e||"0"}deg`),this},i.position=function(t,e,n,r){const o=["absolute","relative","fixed","sticky"];"number"!=typeof t&&null!=t?console.error("( ◕ ◞ ◕ ) nn: the .position(x) method expects the first argument to be a number, but you passed a "+typeof t):"number"!=typeof e&&null!=e?console.error("( ◕ ◞ ◕ ) nn: the .position(x, y) method expects the second argument to be a number, but you passed a "+typeof e):"string"!=typeof n&&null!=n?console.error(`( ◕ ◞ ◕ ) nn: the .position(x, y, type) method expects the third argument to be a string, specificaly a type of CSS positioning: ${o.map((t=>`"${t}"`)).join(", ")}`):"string"!=typeof n||o.includes(n)||console.error(`( ◕ ◞ ◕ ) nn: the .position(x, y, type) method expects the third argument to be a valid CSS positioning value, specificaly: ${o.map((t=>`"${t}"`)).join(", ")}`),e=e||this.y,this.style.position=n||"absolute";const i="center"===this.__nn_positionOrigin?-this.width/2:0,a="center"===this.__nn_positionOrigin?-this.height/2:0;return this.style.left=i+t+"px",this.style.top=a+e+"px",this},i.positionOrigin=function(t){return"center"!==t&&"default"!==t&&null!=t&&console.error('( ◕ ◞ ◕ ) nn: the .positionOrigin() method expects either "center" or "default" (which is top/left)'),this.__nn_positionOrigin="center"===t?"center":"default",this};["x","y","width","height","top","left","bottom","right"].forEach((t=>{const e="width"===t||"height"===t;if("number"!=typeof i[t]||0===i[t]){if(e&&((n=i)instanceof window.HTMLIFrameElement||n instanceof window.HTMLImageElement||n instanceof window.HTMLCanvasElement))return;Object.defineProperty(i,t,{get:function(){return this.getBoundingClientRect()[t]},configurable:!0})}var n}));const l=t=>{if("string"!=typeof t)return t;const e=t.trim();if(""===e)return"";if("true"===e)return!0;if("false"===e)return!1;if("null"===e)return null;if("undefined"===e)return;if(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e)}catch(t){}const n=Number(e);return Number.isNaN(n)?t:n},h=new Proxy({},{get:(t,e)=>{if("symbol"!=typeof e)return"toJSON"===e?()=>{const t={};for(const e of Object.keys(i.dataset))t[e]=l(i.dataset[e]);return t}:l(i.dataset[e])},set:(t,e,n)=>{if("symbol"==typeof e)return!1;const r=(t=>{if(void 0===t)return;if(null===t)return"null";if("object"==typeof t)try{return JSON.stringify(t)}catch(e){return String(t)}return String(t)})(n);return void 0===r?delete i.dataset[e]:i.dataset[e]=r,!0},deleteProperty:(t,e)=>"symbol"!=typeof e&&(delete i.dataset[e],!0),has:(t,e)=>"symbol"!=typeof e&&Object.prototype.hasOwnProperty.call(i.dataset,e),ownKeys:()=>Object.keys(i.dataset),getOwnPropertyDescriptor:(t,e)=>{if("symbol"!=typeof e)return Object.prototype.hasOwnProperty.call(i.dataset,e)?{enumerable:!0,configurable:!0}:void 0}});Object.defineProperty(i,"data",{get:function(){return h},enumerable:!1,configurable:!0});try{if(i instanceof window.HTMLCanvasElement){let e;try{e=t("./canvas.js")}catch(t){e=window.NNCanvas||{}}const n=e&&(e.augment||e.default);"function"==typeof n&&n(i)}}catch(t){}return i}}void 0!==e?e.exports=r:window.DOM=r},{"./canvas.js":4}],6:[function(t,e,n){class r{static parseCSV(t){if("string"!=typeof t)return void console.error("( ◕ ◞ ◕ ) nn: parseCSV() method expects a string of CSV data as it's first argument");if(0===t.trim().length)return void console.error("( ◕ ◞ ◕ ) nn: the CSV string is empty");const e=[];let n=[],r="",o=!1;for(let i=0;i0)&&(n.push(r.trim()),e.push(n));const i=e.shift();if(i&&0!==i.length)return e.map((t=>i.reduce(((e,n,r)=>(e[n]=t[r],e)),{})));console.error("( ◕ ◞ ◕ ) nn: the CSV data is missing its headers")}static parseJSON(t){return JSON.parse(t)}static stringifyCSV(t){if(!Array.isArray(t))return void console.error("( ◕ ◞ ◕ ) nn: stringifyCSV() is expecting an array of objects");if(0===t.length)return void console.error("( ◕ ◞ ◕ ) nn: the array passed to stringifyCSV() is empty");if(!t.every((t=>"object"==typeof t&&null!==t&&Object.keys(t).length>0)))return void console.error("( ◕ ◞ ◕ ) nn: all items in the array passed to stringifyCSV() must be non-empty objects");const e=Object.keys(t[0]),n=t.map((t=>e.map((e=>`"${`${t[e]}`.replace(/"/g,'""')}"`)).join(",")));return[e.join(","),...n].join("\n")}static stringifyJSON(t){return JSON.stringify(t)}static parseData(t){if("string"!=typeof t)return this.parseJSON(t);if(!t.trim().startsWith("{")&&!t.trim().startsWith("["))return this.parseCSV(t);try{return this.parseJSON(t)}catch(t){console.error("( ◕ ◞ ◕ ) nn: there was an error parsing your JSON string"),console.error(t)}}static stringifyData(t){return Array.isArray(t)&&t.every((t=>"object"==typeof t&&!Array.isArray(t)))?this.stringifyCSV(t):this.stringifyJSON(t)}static async loadData(t,e){const n=e||(t=>{const e=t.lastIndexOf(".");return-1===e?"":t.substring(e+1)})(t),r=await window.fetch(t);if("json"===n){return await r.json()}{const t=await r.text();return"csv"===n?this.parseCSV(t):t}}static bindCSS(){document.querySelectorAll("[data-bind-var]").forEach((t=>{const e=t.getAttribute("data-bind-var"),n=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=n.match(/[a-z%]+$/i),o=r?r[0]:"",i=n.match(/^-?\d+(\.\d+)?/),a=i?i[0]:"";""!==a&&(t.value=a);const s=()=>{let n=t.value.trim();o&&(isNaN(n)||""===n||(n=parseFloat(n)+"",n+=o)),""!==n&&document.documentElement.style.setProperty(e,n)};t.addEventListener("input",s),t.addEventListener("change",s)}));document.querySelectorAll("[data-bind-click]").forEach((t=>{const e=t.getAttribute("data-bind-click");if(!e)return void console.error("Missing data-bind-click attribute on button:",t);const[n,r]=e.split(":");if(!r)return void console.error("Invalid data-bind-click format on button:",t);const o=r.match(/(\w+)\(([^)]+)\)/);if(!o)return void console.error("Invalid action format in data-bind-click:",r);const[,i,a]=o,s=a.split(",").map((t=>t.trim()));t.addEventListener("click",(()=>{const t=window.getComputedStyle(document.documentElement).getPropertyValue(n).trim();let e;const r=i.toLowerCase();if("add"===r||"sub"===r){const o=t.match(/[a-z%]+$/i),a=o?o[0]:"",l=t.match(/^-?\d+(\.\d+)?/),h=l?parseFloat(l[0]):NaN,c=parseFloat(s[0]);if(isNaN(h)||isNaN(c))return void console.error(`Invalid numeric values for operation '${i}' on CSS variable '${n}'.`);e="add"===r?h+c+a:h-c+a}else if("toggle"===r){if(s.length<2)return void console.error(`Toggle operation requires at least two values. Provided: ${s.length}`);const n=t.toLowerCase();e=0===s.map((t=>t.toLowerCase())).indexOf(n)?s[1]:s[0]}else{if("cycle"!==r)return void console.error(`Unsupported operation in data-bind-click: ${i}`);{if(0===s.length)return void console.error("Cycle operation requires at least one value.");const n=s.findIndex((e=>e===t)),r=-1===n?0:(n+1)%s.length;e=s[r]}}document.documentElement.style.setProperty(n,e)}))}))}}void 0!==e?e.exports=r:window.Data=r},{}],7:[function(t,e,n){void 0!==e&&(e.exports=class{constructor(t){this.clickEle=document.querySelectorAll(t.click),this.dropEle=document.querySelector(t.drop),this.dropping=t.dropping,this.dropped=t.dropped,this.maxSize=t.maxSize,this.types=t.types,this.filter=t.filter,this.error=t.error,this.ready="function"==typeof t.ready?t.ready:this.err('missing "ready" callback to constructor to handle data'),this.clickEle&&this.createClickable(),"draggable"in document.createElement("span")?this.dropEle&&(this.dropEle.addEventListener("dragenter",(t=>this.dndEnter(t)),!1),this.dropEle.addEventListener("dragover",(t=>this.dndOver(t)),!1),this.dropEle.addEventListener("drop",(t=>this.dndDrop(t)),!1)):this.err("your browser does not support drag and drop")}err(t){this.error&&this.error(t),console.error(`FileUploader: ${t}`)}createClickable(){this.input=document.createElement("input"),this.input.setAttribute("type","file"),this.input.setAttribute("hidden",!0),document.body.appendChild(this.input),this.input.addEventListener("change",(t=>{this.readFile(this.input.files[0])}));for(let t=0;t{this.input.click()}))}dndEnter(t){t.stopPropagation(),t.preventDefault(),this.dropping&&this.dropping(this.dropEle)}dndOver(t){t.stopPropagation(),t.preventDefault()}dndDrop(t){t.stopPropagation(),t.preventDefault(),this.dropped&&this.dropped(this.dropEle),t.dataTransfer.files.length>1?alert("You can only drag and drop one file at a time."):this.readFile(t.dataTransfer.files[0])}isAllowed(t){return this.types?this.types.indexOf(t)>-1:!this.filter||this.filter(t)}readFile(t){const e=this.maxSize?1e3*this.maxSize:1/0;if("undefined"!=typeof FileReader&&this.isAllowed(t.type)&&t.size<=e){const e=new window.FileReader;e.onload=e=>{this.handleFile(t.name,t.type,e.target.result)},e.readAsDataURL(t)}else"undefined"==typeof FileReader&&this.error?this.error("browser does not support FileReader"):this.isAllowed(t.type)?t.size>e&&this.error(`file larger than max size of ${e}`):this.error(`attempted to upload restricted file type ${t.type}`)}handleFile(t,e,n){this.ready({name:t,type:e,data:n})}})},{}],8:[function(t,e,n){void 0!==e&&(e.exports=class{static norm(t,e,n){return(t-e)/(n-e)}static clamp(t,e,n){return Math.max(e,Math.min(n,t))}static lerp(t,e,n){return(1-n)*t+n*e}static _lerp(t,e,n){return(n-e)*t+e}static map(t,e,n,r,o){return this._lerp(this.norm(t,e,n),r,o)}static dist(t,e,n,r){return Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2))}static angleBtw(t,e,n,r){return Math.atan2(n-t,r-e)}static radToDeg(t){return t*(180/Math.PI)}static degToRad(t){return t*(Math.PI/180)}static cartesianToPolar(t,e){var n=Math.sqrt(t*t+e*e),r=Math.atan2(e,t);return{distance:n,radians:r,degrees:r*(180/Math.PI)}}static polarToCartesian(t,e){return{x:t*Math.cos(e),y:t*Math.sin(e)}}static shuffle(t){let e,n,r;for(r=t.length-1;r>0;r--)e=Math.floor(Math.random()*(r+1)),n=t[r],t[r]=t[e],t[e]=n;return t}static randomInt(t,e){return void 0===e&&(e=t,t=0),Math.floor(t+Math.random()*(e-t+1))}static randomFloat(t,e){return void 0===e&&(e=t,t=0),t+Math.random()*(e-t)}static random(t,e){if(t instanceof Array)return t[Math.floor(Math.random()*t.length)];if("string"==typeof t){const e=t.match(/\S+/gu)||[];if(0===e.length)return;if(1===e.length){const t=Array.from(e[0]);return t[Math.floor(Math.random()*t.length)]}return e[Math.floor(Math.random()*e.length)]}{let n,r;return void 0!==t&&void 0===e?(n=0,r=t):void 0!==t&&void 0!==e?(n=t,r=e):(n=0,r=1),this.randomFloat(n,r)}}static perlin(){return{randVect:function(){const t=2*Math.random()*Math.PI;return{x:Math.cos(t),y:Math.sin(t)}},dot_prod_grid:function(t,e,n,r){let o;const i=t-n,a=e-r;return this.gradients[[n,r]]?o=this.gradients[[n,r]]:(o=this.randVect(),this.gradients[[n,r]]=o),i*o.x+a*o.y},smootherstep:function(t){return 6*t**5-15*t**4+10*t**3},interp:function(t,e,n){return e+this.smootherstep(t)*(n-e)},seed:function(){this.gradients={}},memory:{},get:function(t,e){e=e||0;if(Object.prototype.hasOwnProperty.call(this.memory,[t,e]))return this.memory[[t,e]];const n=Math.floor(t),r=Math.floor(e),o=this.dot_prod_grid(t,e,n,r),i=this.dot_prod_grid(t,e,n+1,r),a=this.dot_prod_grid(t,e,n,r+1),s=this.dot_prod_grid(t,e,n+1,r+1),l=this.interp(t-n,o,i),h=this.interp(t-n,a,s),c=this.interp(e-r,l,h);return this.memory[[t,e]]=c,c}}}static easeInQuad(t){return t*t}static easeOutQuad(t){return t*(2-t)}static easeInOutQuad(t){return t<.5?2*t*t:(4-2*t)*t-1}static easeInCubic(t){return t*t*t}static easeOutCubic(t){return--t*t*t+1}static easeInOutCubic(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}static easeInQuart(t){return t*t*t*t}static easeOutQuart(t){return 1- --t*t*t*t}static easeInOutQuart(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t}static easeInQuint(t){return t*t*t*t*t}static easeOutQuint(t){return 1+--t*t*t*t*t}static easeInOutQuint(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}static easeInSine(t){return 1-Math.cos(t*Math.PI/2)}static easeOutSine(t){return Math.sin(t*Math.PI/2)}static easeInOutSine(t){return-(Math.cos(Math.PI*t)-1)/2}static easeInCirc(t){return 1-Math.sqrt(1-Math.pow(t,2))}static easeOutCirc(t){return Math.sqrt(1-Math.pow(t-1,2))}static easeInOutCirc(t){return t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2}static easeInElastic(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:-Math.pow(2,10*t-10)*Math.sin((10*t-10.75)*e)}static easeOutElastic(t){const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1}static easeInOutElastic(t){const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1}static easeInExpo(t){return 0===t?0:Math.pow(2,10*t-10)}static easeOutExpo(t){return 1===t?1:1-Math.pow(2,-10*t)}static easeInOutExpo(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static easeInBack(t){const e=1.70158;return 2.70158*t*t*t-e*t*t}static easeOutBack(t){const e=1.70158;return 1+2.70158*Math.pow(t-1,3)+e*Math.pow(t-1,2)}static easeInOutBack(t){const e=2.5949095;return t<.5?Math.pow(2*t,2)*(7.189819*t-e)/2:(Math.pow(2*t-2,2)*((e+1)*(2*t-2)+e)+2)/2}static easeInBounce(t){return 1-this.easeOutBounce(1-t)}static easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375}static easeInOutBounce(t){return t<.5?(1-this.easeOutBounce(1-2*t))/2:(1+this.easeOutBounce(2*t-1))/2}})},{}],9:[function(t,e,n){class r{static loadImage(t){return new Promise(((e,n)=>{const r=this.create("img");r.addEventListener("load",(()=>e(r))),r.addEventListener("error",(t=>n(t))),r.src=t}))}static async modifyPixels(t,e){"string"==typeof t?0!==t.indexOf("data:image")&&console.error("( ◕ ◞ ◕ ) nn.modifyPixels: string data passed into the first argument must be a base64 encoded image"):t instanceof window.Image||console.error("( ◕ ◞ ◕ ) nn.modifyPixels: the first argument must either be a base64 encoded image or an HTML image element"),"function"!=typeof e&&console.error("( ◕ ◞ ◕ ) nn.modifyPixels: the second argument must be a function, the algorithm you want to use to process the image");const n=document.createElement("canvas"),r=n.getContext("2d");t instanceof window.Image||(t=await window.nn.loadImage(t)),n.width=t.width,n.height=t.height,r.drawImage(t,0,0);const o=r.getImageData(0,0,n.width,n.height);e(o.data),r.putImageData(o,0,0);const i=n.toDataURL();return t.src=i,{image:t,canvas:n,data:i}}static async askFor(t){return await this.askForStream(t)}static async askForStream(t){"object"==typeof t&&null!==t||console.error("( ◕ ◞ ◕ ) nn.askFor: you forgot to pass an argument, should be something like { video: true }");const{audio:e,video:n}=t;void 0===e&&void 0===n&&console.error("( ◕ ◞ ◕ ) nn.askFor: the object you passed must have at least an audio or video property.");const r=(t,e)=>"boolean"==typeof t||"object"==typeof t&&null!==t?null:`${e} property should be either true, false or an object with media parameters`;if(e){const t=r(e,"audio");t&&console.error(`( ◕ ◞ ◕ ) nn.askFor: ${t}`)}else if(n){const t=r(n,"video");t&&console.error(`( ◕ ◞ ◕ ) nn.askFor: ${t}`)}return await navigator.mediaDevices.getUserMedia(t)}static MIDI(t){"function"!=typeof t&&console.error("( ◕ ◞ ◕ ) nn.MIDI: requires a callback function, this will run everytime you interact with your MIDI device."),navigator.requestMIDIAccess().then((function(e){const n=e.inputs.values();for(const e of n)console.log(`( ◕ ◞ ◕ ) nn.MIDI: ${e.name} connected!`),e.onmidimessage=n=>t({dev:e.name,chl:n.data[1],val:n.data[2]})})).catch((t=>console.error(`( ◕ ◞ ◕ ) nn.MIDI: ${t}`)))}static askForGPS(t,e){let n=null,r={};return"function"==typeof t?(n=t,r=e||{}):r=t||{},new Promise(((t,e)=>{const o=e=>{const{latitude:r,longitude:o}=e.coords,i={lat:r,lng:o,timestamp:e.timestamp,coords:e.coords};n&&n(i),t(i)},i=t=>{console.error(`( ◕ ◞ ◕ ) nn.GPS: ${t.message}`),e(t)};if(!("geolocation"in navigator)){const t=r.support||"oh no! your device does not support geolocation";return console.log(`( ◕ ◞ ◕ ) nn.GPS: ${t}`),"string"==typeof r.support&&window.alert(t),e(new Error(t))}navigator.permissions.query({name:"geolocation"}).then((t=>{if("granted"===t.state||"prompt"===t.state)navigator.geolocation.getCurrentPosition(o,i);else if("denied"===t.state){const t=r.enable||"Please enable location services for this website in your browser settings.";console.log(`( ◕ ◞ ◕ ) nn.GPS: ${t}`),"string"==typeof r.enable&&window.alert(t),e(new Error(t))}})).catch((t=>{console.error("( ◕ ◞ ◕ ) nn.GPS permission check failed:",t),e(t)}))}))}}void 0!==e?e.exports=r:window.Media=r},{}],10:[function(t,e,n){class r{static noteToMidi(t){const e=t.match(/^([A-G])(b|#)?(\d+)$/);if(!e)return null;const[,n,o,i]=e;let a=r.NOTE_TO_SEMITONE[n];"#"===o&&a++,"b"===o&&a--;return a+12*(parseInt(i)+1)}static midiToFrequency(t){return"number"!=typeof t||Number.isNaN(t)?null:440*Math.pow(2,(t-69)/12)}static frequencyToMidi(t){return"number"!=typeof t||t<=0||Number.isNaN(t)?null:Math.round(12*Math.log2(t/440)+69)}static midiToNote(t){if("number"!=typeof t||Number.isNaN(t))return null;const e=Math.round(t),n=(e%12+12)%12,o=Math.floor(e/12)-1;return r.SEMITONE_TO_NOTE[n]+o}static noteToFrequency(t){const e=r.noteToMidi(t);return null===e?null:r.midiToFrequency(e)}static frequencyToNote(t){const e=r.frequencyToMidi(t);return null===e?null:r.midiToNote(e)}static randomMode(){const t=[];let e=0;for(;e<12;){const n=Math.random()<.4||e>10?1:2;e+n<=12&&(t.push(n),e+=n)}for(;7!==t.length;)t.length<7?t.push(1):t.pop();return t}static createScale(t="C",e="major"){const n=r.MODES,o=e instanceof Array?e:"random"===e?this.randomMode():n[e.toLowerCase()];if(!o)return null;const i=t.match(/^([A-G])(b|#)?(\d+)?$/);if(!i)return null;const[,a,s,l]=i,h=a+(s||"");let c=l?parseInt(l):4;const u=!!l,d=r.SEMITONE_TO_NOTE;let f=d.indexOf(h);if(f<0)return null;const m=[];m.push(u?h+c:h);for(const t of o)f+=t,f>=d.length&&(f%=d.length,c++),m.push(u?d[f]+c:d[f]);return m}static createChord(t,e="triad"){const n=[],o=e instanceof Array?e:r.CHORDS[e.toLowerCase()];for(const e of o){const r=t[(e-1)%t.length];n.push(r)}return n}static rotateScale(t,e=0){if(!Array.isArray(t)||0===t.length)return[];const n=t.length,r=(e%n+n)%n;return 0===r?t.slice():t.slice(r).concat(t.slice(0,r))}static transposeScale(t,e=0){return Array.isArray(t)&&0!==t.length&&Number.isFinite(e)?t.map((t=>{if("number"==typeof t)return t+e;if("string"!=typeof t)return t;const n=/^([A-Ga-g])(#{1}|b{1})?(\d+)?$/.exec(t);if(!n)return t;const o=n[1].toUpperCase(),i=n[2]||"";if(null!=n[3]){const a=r.noteToMidi(o+i+n[3]);return null==a?t:r.midiToNote(a+e)}{let t=r.NOTE_TO_SEMITONE[o];"#"===i&&(t+=1),"b"===i&&(t-=1);const n=((t+e)%12+12)%12;return r.SEMITONE_TO_NOTE[n]}})):t?t.slice():t}static stripOctave(t){const e=t=>{if("string"!=typeof t)return t;const e=/^([A-Ga-g])(#{1}|b{1})?(\d+)?$/.exec(t);if(!e)return t;return e[1].toUpperCase()+(e[2]||"")};return Array.isArray(t)?t.map(e):e(t)}static voiceChord(t,e=4){if(!Array.isArray(t)||0===t.length)return[];let n="number"==typeof e&&isFinite(e)?Math.floor(e):4,o=-1/0;const i=[];for(const e of t){if("number"==typeof e&&isFinite(e)){let t=Math.round(e);for(;t<=o;)t+=12;o=t,i.push(t);continue}if("string"!=typeof e){i.push(e);continue}const t=/^([A-Ga-g])(#{1}|b{1})?(\d+)?$/.exec(e);if(!t){i.push(e);continue}const a=t[1].toUpperCase(),s=t[2]||"",l=null!=t[3];let h=l?parseInt(t[3]):n,c=r.noteToMidi(a+s+h);if(null!=c&&isFinite(c)){for(;c<=o&&(h+=1,c=r.noteToMidi(a+s+h),null!=c););o=c,i.push(r.midiToNote(c)),l||(n=h)}else i.push(e)}return i}}r.NOTE_TO_SEMITONE={C:0,D:2,E:4,F:5,G:7,A:9,B:11},r.SEMITONE_TO_NOTE=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],r.CHORDS={"root-only":[1],"power-chord":[1,5],triad:[1,3,5],seventh:[1,3,5,7],ninth:[1,3,5,7,9],eleventh:[1,3,5,7,9,11],thirteenth:[1,3,5,7,9,11,13],sus2:[1,2,5],sus4:[1,4,5],dominant7sus4:[1,4,5,7],add9:[1,3,5,9],"six-chord":[1,3,5,6]},r.MODES={ionian:[2,2,1,2,2,2,1],dorian:[2,1,2,2,2,1,2],phrygian:[1,2,2,2,1,2,2],lydian:[2,2,2,1,2,2,1],mixolydian:[2,2,1,2,2,1,2],aeolian:[2,1,2,2,1,2,2],locrian:[1,2,2,1,2,2,2],phrygiandominant:[1,3,1,2,1,2,2],"dorian-b2":[1,2,2,2,2,1,2],"lydian-augmented":[2,2,2,2,1,2,1],"lydian-b7":[2,2,2,1,2,1,2],"mixolydian-b13":[2,2,1,2,1,2,2],"locrian-#2":[2,1,2,1,2,2,2],"super-locrian":[1,2,1,2,2,2,2],major:[2,2,1,2,2,2,1],minor:[2,1,2,2,1,2,2],"harmonic-minor":[2,1,2,2,1,3,1],"melodic-minor":[2,1,2,2,2,2,1],"major-pentatonic":[2,2,3,2,3],"minor-pentatonic":[3,2,2,3,2],blues:[3,2,1,1,3,2],"minor-blues":[2,1,2,1,1,1,2,2],"major-blues":[2,1,1,1,1,1,2,1,2],augmented:[2,2,2,2,2,2],diminished:[2,1,2,1,2,1,2,1],"jazz-melodic-minor":[2,1,2,2,2,2,1],"whole-half-diminished":[2,1,2,1,2,1,2,1],"half-whole-diminished":[1,2,1,2,1,2,1,2],enigmatic:[1,3,2,2,2,1,1],"double-harmonic":[1,3,1,2,1,3,1],"hungarian-minor":[2,1,3,1,1,3,1],persian:[1,3,1,1,2,3,1],arabian:[2,2,1,1,2,2,2],japanese:[1,4,2,1,4],egyptian:[2,3,2,3,2],hirajoshi:[2,1,4,1,4]},void 0!==e?e.exports=r:window.Music=r},{}],11:[function(t,e,n){const r=t("./Maths/Maths.js"),o=t("./Averigua/Averigua.js"),i=t("./Color/Color.js"),a=t("./Music/nn-music.js"),s=t("./Media/nn-media.js"),l=t("./DOM/nn-dom.js"),h=t("./Data/nn-data.js"),c=t("./Bind/data-bind.js");window.nn={_mouseX:0,_mouseY:0,_mouseDown:!1,_trackingMouse:!1,_trackMouse:function(){window.addEventListener("mousemove",(t=>{this._mouseX=t.clientX,this._mouseY=t.clientY})),window.addEventListener("mousedown",(t=>{this._mouseDown=!0})),window.addEventListener("mouseup",(t=>{this._mouseDown=!1})),this._trackingMouse=!0},get mouseX(){return this._trackingMouse||this._trackMouse(),this._mouseX},set mouseX(t){return console.error("( ◕ ◞ ◕ ) nn: mouseX is a read-only property")},get mouseY(){return this._trackingMouse||this._trackMouse(),this._mouseY},set mouseY(t){return console.error("( ◕ ◞ ◕ ) nn: mouseY is a read-only property")},get mouseDown(){return this._trackingMouse||this._trackMouse(),this._mouseDown},set mouseDown(t){return console.error("( ◕ ◞ ◕ ) nn: mouseDown is a read-only property")},get width(){return window.innerWidth},set width(t){return console.error("( ◕ ◞ ◕ ) nn: width is a read-only property")},get height(){return window.innerHeight},set height(t){return console.error("( ◕ ◞ ◕ ) nn: height is a read-only property")},on:l.on,off:l.off,create:l.create,get:l.get,getAll:l.getAll,loadImage:s.loadImage,modifyPixels:s.modifyPixels,askFor:s.askFor,askForStream:s.askForStream,askForGPS:s.askForGPS,MIDI:s.MIDI,notes:a.SEMITONE_TO_NOTE,modes:a.MODES,chords:a.CHORDS,noteToMidi:a.noteToMidi,noteToFrequency:a.noteToFrequency,midiToNote:a.midiToNote,midiToFrequency:a.midiToFrequency,frequencyToMidi:a.frequencyToMidi,frequencyToNote:a.frequencyToNote,randomMode:a.randomMode,createScale:a.createScale,createChord:a.createChord,voiceChord:a.voiceChord,rotateScale:a.rotateScale,transposeScale:a.transposeScale,stripOctave:a.stripOctave,fetch:(t,e)=>(t=`/api/nn-proxy?url=${t}`,window.fetch(t,e)),sleep:t=>new Promise((e=>setTimeout(e,t))),times:(t,e)=>{if("number"!=typeof t||!isFinite(t))return console.error("( ◕ ◞ ◕ ) nn.times: first argument should be a finite number"),[];if("function"!=typeof e)return console.error("( ◕ ◞ ◕ ) nn.times: second argument should be a function"),[];const n=Math.max(0,Math.floor(t)),r=[];for(let t=0;t{if("number"!=typeof t||!isFinite(t))return console.error("( ◕ ◞ ◕ ) nn.range: expects numbers. Usage: range(end) or range(start, end, step[, map])"),[];let o,i,a;if("function"==typeof r?o=r:"function"==typeof n&&(o=n),void 0===e?(i=0,e=t):i=t,"number"!=typeof e||!isFinite(e))return console.error("( ◕ ◞ ◕ ) nn.range: end must be a finite number"),[];if("number"==typeof n&&(a=n),null==a&&(a=e>i?1:-1),"number"!=typeof a||!isFinite(a)||0===a)return console.error("( ◕ ◞ ◕ ) nn.range: step must be a non-zero finite number"),[];const s=[];if(a>0)for(let t=0,n=i;ne;n+=a,t++)s.push(o?o(n,t):n);return s},bindCSS:c.bindCSS,parseCSV:h.parseCSV,parseJSON:h.parseJSON,stringifyCSV:h.stringifyCSV,stringifyJSON:h.stringifyJSON,stringifyData:h.stringifyData,parseData:h.parseData,loadData:h.loadData,isBrowser:o.isBrowser,isMobile:o.isMobile,hasWebGL:o.hasWebGL,hasWebVR:o.hasWebVR,hasMIDI:o.hasMIDI,hasTouch:o.hasTouch,orientation:o.orientation,screen:o.screen,gpuInfo:o.gpuInfo,browserInfo:o.browserInfo,platformInfo:o.platformInfo,audioSupport:o.audioSupport,videoSupport:o.videoSupport,norm:r.norm,clamp:r.clamp,lerp:r.lerp,_lerp:r._lerp,map:r.map,dist:r.dist,angleBtw:r.angleBtw,radToDeg:r.radToDeg,degToRad:r.degToRad,cartesianToPolar:r.cartesianToPolar,polarToCartesian:r.polarToCartesian,shuffle:r.shuffle,randomInt:r.randomInt,randomFloat:r.randomFloat,random:(t,e)=>{const n=t=>console.error(`( ◕ ◞ ◕ ) nn: ${t}`),o=t=>console.warn(`( ◕ ◞ ◕ ) nn: ${t}`);return void 0===t&&void 0===e?r.random():Array.isArray(t)?0===t.length?void n("the first argument to .random() was an empty array, add at least one item."):r.random(t):"string"==typeof t?/\S/u.test(t)?r.random(t):void n("the first argument to .random() was an empty/whitespace-only string, add some letters or words."):"number"==typeof t?Number.isFinite(t)?void 0===e?r.random(t):"number"==typeof e&&Number.isFinite(e)?t===e?(o("you passed identical min and max to the .random() method, returning that exact value."),t):t>e?(o("you passed a min that was greater than max to the .random() method, so I swapped them for you."),r.random(e,t)):r.random(t,e):void n("when the first argument in .random() is a number, the second argument (max) must also be a finite number."):void n("the first argument to .random() must be a finite number."):void n("the first argument to .random() should be an Array, String, Number, or nothing.")},perlin:r.perlin,ease:(t,e)=>r[`ease${t}`](e),randomColor:i.random,colorScheme:i.scheme,toRGB:i.toRGB,rgb:(t,e,n,r)=>{const o=(t,e,n)=>Math.min(n,Math.max(e,t)),i=Math.round(o(Number(t),0,255)),a=Math.round(o(Number(e),0,255)),s=Math.round(o(Number(n),0,255));if("number"==typeof r){return`rgba(${i}, ${a}, ${s}, ${o(r,0,1)})`}return`rgb(${i}, ${a}, ${s})`},toHSL:i.toHSL,hsl:(t,e,n,r)=>{const o=(t,e,n)=>Math.min(n,Math.max(e,t)),i=Math.round(o(Number(t),0,360)),a=Math.round(o(Number(e),0,100)),s=Math.round(o(Number(n),0,100));if("number"==typeof r){return`hsla(${i}, ${a}%, ${s}%, ${o(r,0,1)})`}return`hsl(${i}, ${a}%, ${s}%)`},isLight:i.isLight,colorContrast:i.contrast,contrast:i.contrast,colorMatch:i.match,match:i.match,alpha2hex:i.alpha2hex,hex2alpha:i.hex2alpha,hex2rgb:i.hex2rgb,_hex2rgb:i._hex2rgb,hex2hsl:i.hex2hsl,_hex2hsl:i._hex2hsl,hex2hsv:i.hex2hsv,_hex2hsv:i._hex2hsv,rgb2hex:i.rgb2hex,_rgb2hex:i._rgb2hex,rgb2hsl:i.rgb2hsl,_rgb2hsl:i._rgb2hsl,rgb2hsv:i.rgb2hsv,_rgb2hsv:i._rgb2hsv,hsl2hex:i.hsl2hex,_hsl2hex:i._hsl2hex,hsl2rgb:i.hsl2rgb,_hsl2rgb:i._hsl2rgb,hsl2hsv:i.hsl2hsv,_hsl2hsv:i._hsl2hsv,hsv2hex:i.hsv2hex,_hsv2hex:i._hsv2hex,hsv2rgb:i.hsv2rgb,_hsv2rgb:i._hsv2rgb,hsv2hsl:i.hsv2hsl,_hsv2hsl:i._hsv2hsl,FileUploader:t("./FileUploader/FileUploader.js")}},{"./Averigua/Averigua.js":1,"./Bind/data-bind.js":2,"./Color/Color.js":3,"./DOM/nn-dom.js":5,"./Data/nn-data.js":6,"./FileUploader/FileUploader.js":7,"./Maths/Maths.js":8,"./Media/nn-media.js":9,"./Music/nn-music.js":10}],12:[function(t,e,n){n.endianness=function(){return"LE"},n.hostname=function(){return"undefined"!=typeof location?location.hostname:""},n.loadavg=function(){return[]},n.uptime=function(){return 0},n.freemem=function(){return Number.MAX_VALUE},n.totalmem=function(){return Number.MAX_VALUE},n.cpus=function(){return[]},n.type=function(){return"Browser"},n.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},n.networkInterfaces=n.getNetworkInterfaces=function(){return{}},n.arch=function(){return"javascript"},n.platform=function(){return"browser"},n.tmpdir=n.tmpDir=function(){return"/tmp"},n.EOL="\n",n.homedir=function(){return"/"}},{}],13:[function(t,e,n){var r,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(t){r=a}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();var h,c=[],u=!1,d=-1;function f(){u&&h&&(u=!1,h.length?c=h.concat(c):d=-1,c.length&&m())}function m(){if(!u){var t=l(f);u=!0;for(var e=c.length;e;){for(h=c,c=[];++d1)for(var n=1;n