text: (function(m){"use strict";function n(){const e=new Map,f={delete(a,c){if(f.has(a,c)){const d=e.get(a);d.has(c)&&d.delete(c),d.size||e.delete(a)}},set(a,b,c){p(b)&&(!e.has(a)&&e.set(a,new Set),!0===c&&(b.__isOnce=!0),e.get(a).add(b))},get:a=>e.get(a),has:(a,b)=>0<e.size&&e.has(a)&&e.get(a).has(b),loop(a,d){e.has(a)&&e.get(a).forEach((c,a)=>{d(c),!0===c.__isOnce&&a.delete(c)})},makeHandle(b,a){if(!p(a))throw new TypeError("eventsys : listener needs a function");const c={on(){if(Array.isArray(b))for(const c of b)f.set(c,a);else f.set(b,a);return c},once(){if(Array.isArray(b))for(const c of b)f.set(c,a,!0);else f.set(b,a,!0);return c},off(){if(Array.isArray(b))for(const c of b)f.delete(c,a);else f.delete(b,a);return c}};return c}};return f}function b(g){g||(g={});const h=n();let c=!1;return f(g,{on:(c,a)=>h.makeHandle(c,a).on(),once:(c,a)=>h.makeHandle(c,a).once(),off:(c,a)=>h.makeHandle(c,a).off(),emit(a){if(!c&&e(a)){const c=[].slice.call(arguments,1);h.loop(a,a=>a.apply(g,c))}else throw new TypeError("eventsys : you cannot emit that! "+a)},stopall:b=>c=!d(b)||b,defineHandle(a,e){e||(e=a),g[a]=(a,b)=>g[b?"once":"on"](e,a)}})}function o(f,c){f||(f={}),c||(f=b(f));const d=n();for(let a in i(f,"isObservable",k(!0)),["$get","$set"].map(a=>{const g="$get"==a?"Get":"Set";i(f,a,k((c,f)=>{if(p(c)&&(f=c,c="*"),!p(f))throw new Error("."+c+" no function");return f.prop=e(c)?c:"*",d.makeHandle(g,f).on()}))}),i(f,"get",k(a=>{if("get"!=a&&"set"!=a){let b;return d.loop("Get",c=>{("*"===c.prop||c.prop===a)&&(b=c(a,f))}),b==h?f[a]:b}return f[a]})),i(f,"set",k((a,b)=>{let c;d.loop("Set",e=>{("*"===e.prop||e.prop===a)&&(c=e(a,b,f,Object.hasOwnProperty(f,a)))}),c=c==h?b:c,g(c)&&!c.isObservable&&(c=o(c)),f.emit("$uberset:"+a,c),f[a]=c})),f)g(f[a])&&!f[a].isObservable&&(f[a]=o(f[a]));return"undefined"==typeof Proxy?(console.warn("This JavaScript Environment does not support Proxy, observables need to use the .set and .get accessors to work"),f):new Proxy(f,{get(e,a){if("get"!=a&&"set"!=a){let b;return d.loop("Get",c=>{("*"===c.prop||c.prop===a)&&(b=c(a,e))}),b==h?Reflect.get(e,a):b}return Reflect.get(e,a)},set(i,a,b){let j,k=!1;return d.loop("Set",c=>{("*"===c.prop||c.prop===a)&&(k?(b=j,k=!1):k=!0,j=c(a,b,i,!Reflect.has(i,a)))}),j=j==h?b:j,g(j)&&!j.isObservable&&(j=o(j)),i.emit("$uberset:"+a,j),Reflect.set(i,a,j)}})}const p=b=>b instanceof Function,e=b=>"string"==typeof b,d=b=>"boolean"==typeof b,g=b=>"[object Object]"===toString.call(b),h=void 0,{assign:f,defineProperty:i}=Object,k=(e,a,b)=>({value:e,write:!!d(a)&&a,enumerable:!!d(b)&&b});o.observable=o,o.eventsys=b,o.listener=n,"undefined"==typeof module?m.define instanceof Function&&m.define.amd?m.define(["craft-observable"],()=>o):m.observable=o:module.exports=o})("undefined"==typeof global?window:global);