t2-mapper/docs/assets/nipplejs-ub19og8W.js
2026-03-13 23:00:08 -07:00

1 line
No EOL
20 KiB
JavaScript

import{t as e}from"./chunk-DECur_0Z.js";var t=e(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`nipplejs`,[],r):typeof e==`object`?e.nipplejs=r():n.nipplejs=r()})(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,`default`,{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=0)}([function(e,t,n){n.r(t);var r,i=function(e,t){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)},a=function(e){return e*(Math.PI/180)},o=function(e){return e*(180/Math.PI)},s=new Map,c=function(e){s.has(e)&&clearTimeout(s.get(e)),s.set(e,setTimeout(e,100))},l=function(e,t,n){for(var r,i=t.split(/[ ,]+/g),a=0;a<i.length;a+=1)r=i[a],e.addEventListener?e.addEventListener(r,n,!1):e.attachEvent&&e.attachEvent(r,n)},u=function(e,t,n){for(var r,i=t.split(/[ ,]+/g),a=0;a<i.length;a+=1)r=i[a],e.removeEventListener?e.removeEventListener(r,n):e.detachEvent&&e.detachEvent(r,n)},d=function(e){return e.preventDefault(),e.type.match(/^touch/)?e.changedTouches:e},f=function(){return{x:window.pageXOffset===void 0?(document.documentElement||document.body.parentNode||document.body).scrollLeft:window.pageXOffset,y:window.pageYOffset===void 0?(document.documentElement||document.body.parentNode||document.body).scrollTop:window.pageYOffset}},p=function(e,t){t.top||t.right||t.bottom||t.left?(e.style.top=t.top,e.style.right=t.right,e.style.bottom=t.bottom,e.style.left=t.left):(e.style.left=t.x+`px`,e.style.top=t.y+`px`)},m=function(e,t,n){var r=h(e);for(var i in r)if(r.hasOwnProperty(i))if(typeof t==`string`)r[i]=t+` `+n;else{for(var a=``,o=0,s=t.length;o<s;o+=1)a+=t[o]+` `+n+`, `;r[i]=a.slice(0,-2)}return r},h=function(e){var t={};return t[e]=``,[`webkit`,`Moz`,`o`].forEach(function(n){t[n+e.charAt(0).toUpperCase()+e.slice(1)]=``}),t},g=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},_=function(e,t){if(e.length)for(var n=0,r=e.length;n<r;n+=1)t(e[n]);else t(e)},v=`ontouchstart`in window,y=!!window.PointerEvent,b=!!window.MSPointerEvent,x={start:`mousedown`,move:`mousemove`,end:`mouseup`},S={};function C(){}y?r={start:`pointerdown`,move:`pointermove`,end:`pointerup, pointercancel`}:b?r={start:`MSPointerDown`,move:`MSPointerMove`,end:`MSPointerUp`}:v?(r={start:`touchstart`,move:`touchmove`,end:`touchend, touchcancel`},S=x):r=x,C.prototype.on=function(e,t){var n,r=e.split(/[ ,]+/g);this._handlers_=this._handlers_||{};for(var i=0;i<r.length;i+=1)n=r[i],this._handlers_[n]=this._handlers_[n]||[],this._handlers_[n].push(t);return this},C.prototype.off=function(e,t){return this._handlers_=this._handlers_||{},e===void 0?this._handlers_={}:t===void 0?this._handlers_[e]=null:this._handlers_[e]&&this._handlers_[e].indexOf(t)>=0&&this._handlers_[e].splice(this._handlers_[e].indexOf(t),1),this},C.prototype.trigger=function(e,t){var n,r=this,i=e.split(/[ ,]+/g);r._handlers_=r._handlers_||{};for(var a=0;a<i.length;a+=1)n=i[a],r._handlers_[n]&&r._handlers_[n].length&&r._handlers_[n].forEach(function(e){e.call(r,{type:n,target:r},t)})},C.prototype.config=function(e){this.options=this.defaults||{},e&&(this.options=function(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&t.hasOwnProperty(r)?n[r]=t[r]:e.hasOwnProperty(r)&&(n[r]=e[r]);return n}(this.options,e))},C.prototype.bindEvt=function(e,t){var n=this;return n._domHandlers_=n._domHandlers_||{},n._domHandlers_[t]=function(){typeof n[`on`+t]==`function`?n[`on`+t].apply(n,arguments):console.warn(`[WARNING] : Missing "on`+t+`" handler.`)},l(e,r[t],n._domHandlers_[t]),S[t]&&l(e,S[t],n._domHandlers_[t]),n},C.prototype.unbindEvt=function(e,t){return this._domHandlers_=this._domHandlers_||{},u(e,r[t],this._domHandlers_[t]),S[t]&&u(e,S[t],this._domHandlers_[t]),delete this._domHandlers_[t],this};var w=C;function T(e,t){return this.identifier=t.identifier,this.position=t.position,this.frontPosition=t.frontPosition,this.collection=e,this.defaults={size:100,threshold:.1,color:`white`,fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,mode:`dynamic`,zone:document.body,lockX:!1,lockY:!1,shape:`circle`},this.config(t),this.options.mode===`dynamic`&&(this.options.restOpacity=0),this.id=T.id,T.id+=1,this.buildEl().stylize(),this.instance={el:this.ui.el,on:this.on.bind(this),off:this.off.bind(this),show:this.show.bind(this),hide:this.hide.bind(this),add:this.addToDom.bind(this),remove:this.removeFromDom.bind(this),destroy:this.destroy.bind(this),setPosition:this.setPosition.bind(this),resetDirection:this.resetDirection.bind(this),computeDirection:this.computeDirection.bind(this),trigger:this.trigger.bind(this),position:this.position,frontPosition:this.frontPosition,ui:this.ui,identifier:this.identifier,id:this.id,options:this.options},this.instance}T.prototype=new w,T.constructor=T,T.id=0,T.prototype.buildEl=function(e){return this.ui={},this.options.dataOnly?this:(this.ui.el=document.createElement(`div`),this.ui.back=document.createElement(`div`),this.ui.front=document.createElement(`div`),this.ui.el.className=`nipple collection_`+this.collection.id,this.ui.back.className=`back`,this.ui.front.className=`front`,this.ui.el.setAttribute(`id`,`nipple_`+this.collection.id+`_`+this.id),this.ui.el.appendChild(this.ui.back),this.ui.el.appendChild(this.ui.front),this)},T.prototype.stylize=function(){if(this.options.dataOnly)return this;var e=this.options.fadeTime+`ms`,t=function(e,t){var n=h(e);for(var r in n)n.hasOwnProperty(r)&&(n[r]=t);return n}(`borderRadius`,`50%`),n=m(`transition`,`opacity`,e),r={};return r.el={position:`absolute`,opacity:this.options.restOpacity,display:`block`,zIndex:999},r.back={position:`absolute`,display:`block`,width:this.options.size+`px`,height:this.options.size+`px`,left:0,marginLeft:-this.options.size/2+`px`,marginTop:-this.options.size/2+`px`,background:this.options.color,opacity:`.5`},r.front={width:this.options.size/2+`px`,height:this.options.size/2+`px`,position:`absolute`,display:`block`,left:0,marginLeft:-this.options.size/4+`px`,marginTop:-this.options.size/4+`px`,background:this.options.color,opacity:`.5`,transform:`translate(0px, 0px)`},g(r.el,n),this.options.shape===`circle`&&g(r.back,t),g(r.front,t),this.applyStyles(r),this},T.prototype.applyStyles=function(e){for(var t in this.ui)if(this.ui.hasOwnProperty(t))for(var n in e[t])this.ui[t].style[n]=e[t][n];return this},T.prototype.addToDom=function(){return this.options.dataOnly||document.body.contains(this.ui.el)||this.options.zone.appendChild(this.ui.el),this},T.prototype.removeFromDom=function(){return this.options.dataOnly||!document.body.contains(this.ui.el)||this.options.zone.removeChild(this.ui.el),this},T.prototype.destroy=function(){clearTimeout(this.removeTimeout),clearTimeout(this.showTimeout),clearTimeout(this.restTimeout),this.trigger(`destroyed`,this.instance),this.removeFromDom(),this.off()},T.prototype.show=function(e){var t=this;return t.options.dataOnly?t:(clearTimeout(t.removeTimeout),clearTimeout(t.showTimeout),clearTimeout(t.restTimeout),t.addToDom(),t.restCallback(),setTimeout(function(){t.ui.el.style.opacity=1},0),t.showTimeout=setTimeout(function(){t.trigger(`shown`,t.instance),typeof e==`function`&&e.call(this)},t.options.fadeTime),t)},T.prototype.hide=function(e){var t=this;if(t.options.dataOnly)return t;if(t.ui.el.style.opacity=t.options.restOpacity,clearTimeout(t.removeTimeout),clearTimeout(t.showTimeout),clearTimeout(t.restTimeout),t.removeTimeout=setTimeout(function(){var n=t.options.mode===`dynamic`?`none`:`block`;t.ui.el.style.display=n,typeof e==`function`&&e.call(t),t.trigger(`hidden`,t.instance)},t.options.fadeTime),t.options.restJoystick){var n=t.options.restJoystick,r={};r.x=!0===n||!1!==n.x?0:t.instance.frontPosition.x,r.y=!0===n||!1!==n.y?0:t.instance.frontPosition.y,t.setPosition(e,r)}return t},T.prototype.setPosition=function(e,t){var n=this;n.frontPosition={x:t.x,y:t.y};var r=n.options.fadeTime+`ms`,i={};i.front=m(`transition`,[`transform`],r);var a={front:{}};a.front={transform:`translate(`+n.frontPosition.x+`px,`+n.frontPosition.y+`px)`},n.applyStyles(i),n.applyStyles(a),n.restTimeout=setTimeout(function(){typeof e==`function`&&e.call(n),n.restCallback()},n.options.fadeTime)},T.prototype.restCallback=function(){var e={};e.front=m(`transition`,`none`,``),this.applyStyles(e),this.trigger(`rested`,this.instance)},T.prototype.resetDirection=function(){this.direction={x:!1,y:!1,angle:!1}},T.prototype.computeDirection=function(e){var t,n,r,i=e.angle.radian,a=Math.PI/4,o=Math.PI/2;if(i>a&&i<3*a&&!e.lockX?t=`up`:i>-a&&i<=a&&!e.lockY?t=`left`:i>3*-a&&i<=-a&&!e.lockX?t=`down`:e.lockY||(t=`right`),e.lockY||(n=i>-o&&i<o?`left`:`right`),e.lockX||(r=i>0?`up`:`down`),e.force>this.options.threshold){var s,c={};for(s in this.direction)this.direction.hasOwnProperty(s)&&(c[s]=this.direction[s]);var l={};for(s in this.direction={x:n,y:r,angle:t},e.direction=this.direction,c)c[s]===this.direction[s]&&(l[s]=!0);if(l.x&&l.y&&l.angle)return e;l.x&&l.y||this.trigger(`plain`,e),l.x||this.trigger(`plain:`+n,e),l.y||this.trigger(`plain:`+r,e),l.angle||this.trigger(`dir dir:`+t,e)}else this.resetDirection();return e};var E=T;function D(e,t){this.nipples=[],this.idles=[],this.actives=[],this.ids=[],this.pressureIntervals={},this.manager=e,this.id=D.id,D.id+=1,this.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:`dynamic`,position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:`white`,fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,lockX:!1,lockY:!1,shape:`circle`,dynamicPage:!1,follow:!1},this.config(t),this.options.mode!==`static`&&this.options.mode!==`semi`||(this.options.multitouch=!1),this.options.multitouch||(this.options.maxNumberOfNipples=1);var n=getComputedStyle(this.options.zone.parentElement);return n&&n.display===`flex`&&(this.parentIsFlex=!0),this.updateBox(),this.prepareNipples(),this.bindings(),this.begin(),this.nipples}D.prototype=new w,D.constructor=D,D.id=0,D.prototype.prepareNipples=function(){var e=this.nipples;e.on=this.on.bind(this),e.off=this.off.bind(this),e.options=this.options,e.destroy=this.destroy.bind(this),e.ids=this.ids,e.id=this.id,e.processOnMove=this.processOnMove.bind(this),e.processOnEnd=this.processOnEnd.bind(this),e.get=function(t){if(t===void 0)return e[0];for(var n=0,r=e.length;n<r;n+=1)if(e[n].identifier===t)return e[n];return!1}},D.prototype.bindings=function(){this.bindEvt(this.options.zone,`start`),this.options.zone.style.touchAction=`none`,this.options.zone.style.msTouchAction=`none`},D.prototype.begin=function(){var e=this.options;if(e.mode===`static`){var t=this.createNipple(e.position,this.manager.getIdentifier());t.add(),this.idles.push(t)}},D.prototype.createNipple=function(e,t){var n=this.manager.scroll,r={},i=this.options,a=this.parentIsFlex?n.x:n.x+this.box.left,o=this.parentIsFlex?n.y:n.y+this.box.top;if(e.x&&e.y)r={x:e.x-a,y:e.y-o};else if(e.top||e.right||e.bottom||e.left){var s=document.createElement(`DIV`);s.style.display=`hidden`,s.style.top=e.top,s.style.right=e.right,s.style.bottom=e.bottom,s.style.left=e.left,s.style.position=`absolute`,i.zone.appendChild(s);var c=s.getBoundingClientRect();i.zone.removeChild(s),r=e,e={x:c.left+n.x,y:c.top+n.y}}var l=new E(this,{color:i.color,size:i.size,threshold:i.threshold,fadeTime:i.fadeTime,dataOnly:i.dataOnly,restJoystick:i.restJoystick,restOpacity:i.restOpacity,mode:i.mode,identifier:t,position:e,zone:i.zone,frontPosition:{x:0,y:0},shape:i.shape});return i.dataOnly||(p(l.ui.el,r),p(l.ui.front,l.frontPosition)),this.nipples.push(l),this.trigger(`added `+l.identifier+`:added`,l),this.manager.trigger(`added `+l.identifier+`:added`,l),this.bindNipple(l),l},D.prototype.updateBox=function(){this.box=this.options.zone.getBoundingClientRect()},D.prototype.bindNipple=function(e){var t,n=this,r=function(e,r){t=e.type+` `+r.id+`:`+e.type,n.trigger(t,r)};e.on(`destroyed`,n.onDestroyed.bind(n)),e.on(`shown hidden rested dir plain`,r),e.on(`dir:up dir:right dir:down dir:left`,r),e.on(`plain:up plain:right plain:down plain:left`,r)},D.prototype.pressureFn=function(e,t,n){var r=this,i=0;clearInterval(r.pressureIntervals[n]),r.pressureIntervals[n]=setInterval(function(){var n=e.force||e.pressure||e.webkitForce||0;n!==i&&(t.trigger(`pressure`,n),r.trigger(`pressure `+t.identifier+`:pressure`,n),i=n)}.bind(r),100)},D.prototype.onstart=function(e){var t=this,n=t.options,r=e;return e=d(e),t.updateBox(),_(e,function(i){t.actives.length<n.maxNumberOfNipples?t.processOnStart(i):r.type.match(/^touch/)&&(Object.keys(t.manager.ids).forEach(function(n){if(Object.values(r.touches).findIndex(function(e){return e.identifier===n})<0){var i=[e[0]];i.identifier=n,t.processOnEnd(i)}}),t.actives.length<n.maxNumberOfNipples&&t.processOnStart(i))}),t.manager.bindDocument(),!1},D.prototype.processOnStart=function(e){var t,n=this,r=n.options,a=n.manager.getIdentifier(e),o=e.force||e.pressure||e.webkitForce||0,s={x:e.pageX,y:e.pageY},c=n.getOrCreate(a,s);c.identifier!==a&&n.manager.removeIdentifier(c.identifier),c.identifier=a;var l=function(t){t.trigger(`start`,t),n.trigger(`start `+t.id+`:start`,t),t.show(),o>0&&n.pressureFn(e,t,t.identifier),n.processOnMove(e)};if((t=n.idles.indexOf(c))>=0&&n.idles.splice(t,1),n.actives.push(c),n.ids.push(c.identifier),r.mode!==`semi`)l(c);else{if(!(i(s,c.position)<=r.catchDistance))return c.destroy(),void n.processOnStart(e);l(c)}return c},D.prototype.getOrCreate=function(e,t){var n,r=this.options;return/(semi|static)/.test(r.mode)?(n=this.idles[0])?(this.idles.splice(0,1),n):r.mode===`semi`?this.createNipple(t,e):(console.warn(`Coudln't find the needed nipple.`),!1):n=this.createNipple(t,e)},D.prototype.processOnMove=function(e){var t=this.options,n=this.manager.getIdentifier(e),r=this.nipples.get(n),s=this.manager.scroll;if(function(e){return isNaN(e.buttons)?e.pressure!==0:e.buttons!==0}(e)){if(!r)return console.error(`Found zombie joystick with ID `+n),void this.manager.removeIdentifier(n);if(t.dynamicPage){var c=r.el.getBoundingClientRect();r.position={x:s.x+c.left,y:s.y+c.top}}r.identifier=n;var l=r.options.size/2,u={x:e.pageX,y:e.pageY};t.lockX&&(u.y=r.position.y),t.lockY&&(u.x=r.position.x);var d,f,p,m,h,g,_,v,y,b,x=i(u,r.position),S=(d=u,f=r.position,p=f.x-d.x,m=f.y-d.y,o(Math.atan2(m,p))),C=a(S),w=x/l,T={distance:x,position:u};if(r.options.shape===`circle`?(h=Math.min(x,l),_=r.position,v=h,b={x:0,y:0},y=a(y=S),b.x=_.x-v*Math.cos(y),b.y=_.y-v*Math.sin(y),g=b):(g=function(e,t,n){return{x:Math.min(Math.max(e.x,t.x-n),t.x+n),y:Math.min(Math.max(e.y,t.y-n),t.y+n)}}(u,r.position,l),h=i(g,r.position)),t.follow){if(x>l){var E=u.x-g.x,D=u.y-g.y;r.position.x+=E,r.position.y+=D,r.el.style.top=r.position.y-(this.box.top+s.y)+`px`,r.el.style.left=r.position.x-(this.box.left+s.x)+`px`,x=i(u,r.position)}}else u=g,x=h;var O=u.x-r.position.x,k=u.y-r.position.y;r.frontPosition={x:O,y:k},t.dataOnly||(r.ui.front.style.transform=`translate(`+O+`px,`+k+`px)`);var A={identifier:r.identifier,position:u,force:w,pressure:e.force||e.pressure||e.webkitForce||0,distance:x,angle:{radian:C,degree:S},vector:{x:O/l,y:-k/l},raw:T,instance:r,lockX:t.lockX,lockY:t.lockY};(A=r.computeDirection(A)).angle={radian:a(180-S),degree:180-S},r.trigger(`move`,A),this.trigger(`move `+r.id+`:move`,A)}else this.processOnEnd(e)},D.prototype.processOnEnd=function(e){var t=this,n=t.options,r=t.manager.getIdentifier(e),i=t.nipples.get(r),a=t.manager.removeIdentifier(i.identifier);i&&(n.dataOnly||i.hide(function(){n.mode===`dynamic`&&(i.trigger(`removed`,i),t.trigger(`removed `+i.id+`:removed`,i),t.manager.trigger(`removed `+i.id+`:removed`,i),i.destroy())}),clearInterval(t.pressureIntervals[i.identifier]),i.resetDirection(),i.trigger(`end`,i),t.trigger(`end `+i.id+`:end`,i),t.ids.indexOf(i.identifier)>=0&&t.ids.splice(t.ids.indexOf(i.identifier),1),t.actives.indexOf(i)>=0&&t.actives.splice(t.actives.indexOf(i),1),/(semi|static)/.test(n.mode)?t.idles.push(i):t.nipples.indexOf(i)>=0&&t.nipples.splice(t.nipples.indexOf(i),1),t.manager.unbindDocument(),/(semi|static)/.test(n.mode)&&(t.manager.ids[a.id]=a.identifier))},D.prototype.onDestroyed=function(e,t){this.nipples.indexOf(t)>=0&&this.nipples.splice(this.nipples.indexOf(t),1),this.actives.indexOf(t)>=0&&this.actives.splice(this.actives.indexOf(t),1),this.idles.indexOf(t)>=0&&this.idles.splice(this.idles.indexOf(t),1),this.ids.indexOf(t.identifier)>=0&&this.ids.splice(this.ids.indexOf(t.identifier),1),this.manager.removeIdentifier(t.identifier),this.manager.unbindDocument()},D.prototype.destroy=function(){for(var e in this.unbindEvt(this.options.zone,`start`),this.nipples.forEach(function(e){e.destroy()}),this.pressureIntervals)this.pressureIntervals.hasOwnProperty(e)&&clearInterval(this.pressureIntervals[e]);this.trigger(`destroyed`,this.nipples),this.manager.unbindDocument(),this.off()};var O=D;function k(e){var t=this;t.ids={},t.index=0,t.collections=[],t.scroll=f(),t.config(e),t.prepareCollections();var n=function(){var e;t.collections.forEach(function(n){n.forEach(function(n){e=n.el.getBoundingClientRect(),n.position={x:t.scroll.x+e.left,y:t.scroll.y+e.top}})})};l(window,`resize`,function(){c(n)});var r=function(){t.scroll=f()};return l(window,`scroll`,function(){c(r)}),t.collections}k.prototype=new w,k.constructor=k,k.prototype.prepareCollections=function(){var e=this;e.collections.create=e.create.bind(e),e.collections.on=e.on.bind(e),e.collections.off=e.off.bind(e),e.collections.destroy=e.destroy.bind(e),e.collections.get=function(t){var n;return e.collections.every(function(e){return!(n=e.get(t))}),n}},k.prototype.create=function(e){return this.createCollection(e)},k.prototype.createCollection=function(e){var t=new O(this,e);return this.bindCollection(t),this.collections.push(t),t},k.prototype.bindCollection=function(e){var t,n=this,r=function(e,r){t=e.type+` `+r.id+`:`+e.type,n.trigger(t,r)};e.on(`destroyed`,n.onDestroyed.bind(n)),e.on(`shown hidden rested dir plain`,r),e.on(`dir:up dir:right dir:down dir:left`,r),e.on(`plain:up plain:right plain:down plain:left`,r)},k.prototype.bindDocument=function(){this.binded||=(this.bindEvt(document,`move`).bindEvt(document,`end`),!0)},k.prototype.unbindDocument=function(e){Object.keys(this.ids).length&&!0!==e||(this.unbindEvt(document,`move`).unbindEvt(document,`end`),this.binded=!1)},k.prototype.getIdentifier=function(e){var t;return e?(t=e.identifier===void 0?e.pointerId:e.identifier)===void 0&&(t=this.latest||0):t=this.index,this.ids[t]===void 0&&(this.ids[t]=this.index,this.index+=1),this.latest=t,this.ids[t]},k.prototype.removeIdentifier=function(e){var t={};for(var n in this.ids)if(this.ids[n]===e){t.id=n,t.identifier=this.ids[n],delete this.ids[n];break}return t},k.prototype.onmove=function(e){return this.onAny(`move`,e),!1},k.prototype.onend=function(e){return this.onAny(`end`,e),!1},k.prototype.oncancel=function(e){return this.onAny(`end`,e),!1},k.prototype.onAny=function(e,t){var n,r=this,i=`processOn`+e.charAt(0).toUpperCase()+e.slice(1);return t=d(t),_(t,function(e){n=r.getIdentifier(e),_(r.collections,function(e,t,n){n.ids.indexOf(t)>=0&&(n[i](e),e._found_=!0)}.bind(null,e,n)),e._found_||r.removeIdentifier(n)}),!1},k.prototype.destroy=function(){this.unbindDocument(!0),this.ids={},this.index=0,this.collections.forEach(function(e){e.destroy()}),this.off()},k.prototype.onDestroyed=function(e,t){if(this.collections.indexOf(t)<0)return!1;this.collections.splice(this.collections.indexOf(t),1)};var A=new k;t.default={create:function(e){return A.create(e)},factory:A}}]).default})}));export default t();