/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/temple-events@1.1.6/lib/events.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var eventNames=["change","click","dblclick","mousedown","mouseup","mouseenter","mouseleave","scroll","blur","focus","input","submit","reset","keydown","keypress","keyup","drag","dragdrop","dragend","dragenter","dragexit","dragleave","dragover","dragstart","drop"],slice=Array.prototype.slice,decorators={};function Action(t){this.name=t}function addAction(t,n){if("object"==typeof t&&null==n)return each(t,(function(t,n){this.addAction(n,t)}),this),this;if("string"!=typeof t||""===t)throw new Error("Expecting non-empty string for action name.");if("function"!=typeof n)throw new Error("Expecting function for action.");return null==this._actions&&(this._actions={}),null==this._actions[t]&&(this._actions[t]=[]),~this._actions[t].indexOf(n)||this._actions[t].push(n),this}function addActionOnce(t,n){return"object"==typeof t&&null==n?(each(t,(function(t,n){this.addActionOnce(n,t)}),this),this):(this.addAction(t,i=function(){this.removeAction(t,i),n.apply(this,arguments)}),this);var i}function removeAction(t,n){if("function"==typeof t&&null==n&&(n=t,t=null),null==this._actions||null==t&&null==n)this._actions={};else if(null==n)delete this._actions[t];else if(null==t)each(this._actions,(function(t,i){this._actions[i]=t.filter((function(t){return t!==n}))}),this);else{var i,e=this._actions[t];Array.isArray(e)&&~(i=e.indexOf(n))&&e.splice(i,1)}return this}function fireAction(t){if("string"==typeof t&&(t=new Action(t)),null==t||"object"!=typeof t||t instanceof Action||(t=extend(new Action,t)),!(t instanceof Action))throw new Error("Expecting action name, object or instance of Action.");var n=t.name,i=slice.call(arguments,1);if(i.unshift(t),null!=this._actions&&Array.isArray(this._actions[n])&&this._actions[n].some((function(n){if(!t.bubbles)return!0;n.apply(this,i)}),this),t.bubbles&&null!=this.parent){for(var e=this.parent;"function"!=typeof e.fireAction;){if(null==e.parent)return;e=e.parent}e.fireAction.apply(e,i)}return this}function each(t,n,i){if(null!=t)if(Array.prototype.forEach&&t.forEach===Array.prototype.forEach)t.forEach(n,i);else if(t.length===+t.length)for(var e=0,o=t.length;e<o;e++)n.call(i,t[e],e,t);else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.call(i,t[r],r,t)}function extend(t){return each(Array.prototype.slice.call(arguments,1),(function(n){if(n)for(var i in n)t[i]=n[i]})),t}function result(t,n){if(null!=t){var i=t[n];return"function"==typeof i?i.call(t):i}}eventNames.forEach((function(t){decorators["on-"+t]=function(n){var i,e,o,r=this;function c(t){var c=new Action(i);c.original=t,c.node=n,c.context=o;for(var s=r;"function"!=typeof s.fireAction;){if(null==s.parent)return;s=s.parent}s.fireAction.apply(s,[c].concat(e))}return n.addEventListener(t,c),{update:function(t){if("string"!=typeof t)throw new Error("Expecting string for event name.");i=t,e=slice.call(arguments,1),o=this},destroy:function(){n.removeEventListener(t,c)}}}})),module.exports=function(){this.addAction=addAction,this.addActionOnce=addActionOnce,this.removeAction=removeAction,this.fireAction=fireAction,this.decorate(decorators);var t=result(this,"actions");null!=t&&this.addAction(t)},module.exports.Action=Action,Action.prototype.bubbles=!0,Action.prototype.stopPropagation=function(){return this.bubbles=!1,this};
//# sourceMappingURL=/sm/e792f523c2a06ce65377c7b03e0412413db2101062b504a7959b7ce41611c80e.map