digital-garden/.obsidian/plugins/obsidian-hover-editor/main.js
2024-06-13 21:01:37 +03:00

19 lines
175 KiB
JavaScript

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var Oa=Object.create;var $t=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var Ca=Object.getOwnPropertyNames;var La=Object.getPrototypeOf,Ia=Object.prototype.hasOwnProperty;var Tr=g=>$t(g,"__esModule",{value:!0});var Mr=(g,a)=>()=>(a||g((a={exports:{}}).exports,a),a.exports),Aa=(g,a)=>{Tr(g);for(var u in a)$t(g,u,{get:a[u],enumerable:!0})},Da=(g,a,u)=>{if(a&&typeof a=="object"||typeof a=="function")for(let h of Ca(a))!Ia.call(g,h)&&h!=="default"&&$t(g,h,{get:()=>a[h],enumerable:!(u=_a(a,h))||u.enumerable});return g},be=g=>Da(Tr($t(g!=null?Oa(La(g)):{},"default",g&&g.__esModule&&"default"in g?{get:()=>g.default,enumerable:!0}:{value:g,enumerable:!0})),g);var _r=Mr((Ua,Or)=>{Or.exports=function(a,u){u||(u=[0,""]),a=String(a);var h=parseFloat(a,10);return u[0]=h,u[1]=a.match(/[\d.\-\+]*\s*(.*)/)[1]||"",u}});var Gr=Mr(($r,Qn)=>{(function(g){typeof $r=="object"&&typeof Qn!="undefined"?Qn.exports=g():typeof define=="function"&&define.amd?define([],g):(typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this).interact=g()})(function(){var g={};Object.defineProperty(g,"__esModule",{value:!0}),g.default=void 0,g.default=function(e){return!(!e||!e.Window)&&e instanceof e.Window};var a={};Object.defineProperty(a,"__esModule",{value:!0}),a.init=v,a.getWindow=function(e){return(0,g.default)(e)?e:(e.ownerDocument||e).defaultView||h.window},a.window=a.realWindow=void 0;var u=void 0;a.realWindow=u;var h=void 0;function v(e){a.realWindow=u=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),a.window=h=e}a.window=h,typeof window!="undefined"&&window&&v(window);var d={};function E(e){return(E=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}Object.defineProperty(d,"__esModule",{value:!0}),d.default=void 0;var k=function(e){return!!e&&E(e)==="object"},S=function(e){return typeof e=="function"},T={window:function(e){return e===a.window||(0,g.default)(e)},docFrag:function(e){return k(e)&&e.nodeType===11},object:k,func:S,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||E(e)!=="object")return!1;var t=a.getWindow(e)||a.window;return/object|function/.test(E(t.Element))?e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return k(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return k(e)&&e.length!==void 0&&S(e.splice)}};d.default=T;var _={};function M(e){var t=e.interaction;if(t.prepared.name==="drag"){var o=t.prepared.axis;o==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):o==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function B(e){var t=e.iEvent,o=e.interaction;if(o.prepared.name==="drag"){var n=o.prepared.axis;if(n==="x"||n==="y"){var r=n==="x"?"y":"x";t.page[r]=o.coords.start.page[r],t.client[r]=o.coords.start.client[r],t.delta[r]=0}}}Object.defineProperty(_,"__esModule",{value:!0}),_.default=void 0;var R={id:"actions/drag",install:function(e){var t=e.actions,o=e.Interactable,n=e.defaults;o.prototype.draggable=R.draggable,t.map.drag=R,t.methodDict.drag="draggable",n.actions.drag=R.defaults},listeners:{"interactions:before-action-move":M,"interactions:action-resume":M,"interactions:action-move":B,"auto-start:check":function(e){var t=e.interaction,o=e.interactable,n=e.buttons,r=o.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(n&o.options.drag.mouseButtons)!=0))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return d.default.object(e)?(this.options.drag.enabled=e.enabled!==!1,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):d.default.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:M,move:B,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"}},q=R;_.default=q;var D={};Object.defineProperty(D,"__esModule",{value:!0}),D.default=void 0;var W={init:function(e){var t=e;W.document=t.document,W.DocumentFragment=t.DocumentFragment||Q,W.SVGElement=t.SVGElement||Q,W.SVGSVGElement=t.SVGSVGElement||Q,W.SVGElementInstance=t.SVGElementInstance||Q,W.Element=t.Element||Q,W.HTMLElement=t.HTMLElement||W.Element,W.Event=t.Event,W.Touch=t.Touch||Q,W.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function Q(){}var le=W;D.default=le;var $={};Object.defineProperty($,"__esModule",{value:!0}),$.default=void 0;var J={init:function(e){var t=D.default.Element,o=e.navigator||{};J.supportsTouch="ontouchstart"in e||d.default.func(e.DocumentTouch)&&D.default.document instanceof e.DocumentTouch,J.supportsPointerEvent=o.pointerEnabled!==!1&&!!D.default.PointerEvent,J.isIOS=/iP(hone|od|ad)/.test(o.platform),J.isIOS7=/iP(hone|od|ad)/.test(o.platform)&&/OS 7[^\d]/.test(o.appVersion),J.isIe9=/MSIE 9/.test(o.userAgent),J.isOperaMobile=o.appName==="Opera"&&J.supportsTouch&&/Presto/.test(o.userAgent),J.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",J.pEventTypes=J.supportsPointerEvent?D.default.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,J.wheelEvent=D.default.document&&"onmousewheel"in D.default.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},rn=J;$.default=rn;var A={};function ht(e){var t=e.parentNode;if(d.default.docFrag(t)){for(;(t=t.host)&&d.default.docFrag(t););return t}return t}function vt(e,t){return a.window!==a.realWindow&&(t=t.replace(/\/deep\//g," ")),e[$.default.prefixedMatchesSelector](t)}Object.defineProperty(A,"__esModule",{value:!0}),A.nodeContains=function(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1},A.closest=function(e,t){for(;d.default.element(e);){if(vt(e,t))return e;e=ht(e)}return null},A.parentNode=ht,A.matchesSelector=vt,A.indexOfDeepestElement=function(e){for(var t,o=[],n=0;n<e.length;n++){var r=e[n],i=e[t];if(r&&n!==t)if(i){var c=an(r),s=an(i);if(c!==r.ownerDocument)if(s!==r.ownerDocument)if(c!==s){o=o.length?o:eo(i);var l=void 0;if(i instanceof D.default.HTMLElement&&r instanceof D.default.SVGElement&&!(r instanceof D.default.SVGSVGElement)){if(r===s)continue;l=r.ownerSVGElement}else l=r;for(var p=eo(l,i.ownerDocument),f=0;p[f]&&p[f]===o[f];)f++;var m=[p[f-1],p[f],o[f]];if(m[0])for(var b=m[0].lastChild;b;){if(b===m[1]){t=n,o=p;break}if(b===m[2])break;b=b.previousSibling}}else w=r,y=i,(parseInt(a.getWindow(w).getComputedStyle(w).zIndex,10)||0)>=(parseInt(a.getWindow(y).getComputedStyle(y).zIndex,10)||0)&&(t=n);else t=n}else t=n}var w,y;return t},A.matchesUpTo=function(e,t,o){for(;d.default.element(e);){if(vt(e,t))return!0;if((e=ht(e))===o)return vt(e,t)}return!1},A.getActualElement=function(e){return e.correspondingUseElement||e},A.getScrollXY=to,A.getElementClientRect=no,A.getElementRect=function(e){var t=no(e);if(!$.default.isIOS7&&t){var o=to(a.getWindow(e));t.left+=o.x,t.right+=o.x,t.top+=o.y,t.bottom+=o.y}return t},A.getPath=function(e){for(var t=[];e;)t.push(e),e=ht(e);return t},A.trySelector=function(e){return!!d.default.string(e)&&(D.default.document.querySelector(e),!0)};var an=function(e){return e.parentNode||e.host};function eo(e,t){for(var o,n=[],r=e;(o=an(r))&&r!==t&&o!==r.ownerDocument;)n.unshift(r),r=o;return n}function to(e){return{x:(e=e||a.window).scrollX||e.document.documentElement.scrollLeft,y:e.scrollY||e.document.documentElement.scrollTop}}function no(e){var t=e instanceof D.default.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}var I={};Object.defineProperty(I,"__esModule",{value:!0}),I.default=function(e,t){for(var o in t)e[o]=t[o];return e};var G={};function sn(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function oo(e,t,o){return e==="parent"?(0,A.parentNode)(o):e==="self"?t.getRect(o):(0,A.closest)(o,e)}Object.defineProperty(G,"__esModule",{value:!0}),G.getStringOptionResult=oo,G.resolveRectLike=function(e,t,o,n){var r,i=e;return d.default.string(i)?i=oo(i,t,o):d.default.func(i)&&(i=i.apply(void 0,function(c){if(Array.isArray(c))return sn(c)}(r=n)||function(c){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(c))return Array.from(c)}(r)||function(c,s){if(c){if(typeof c=="string")return sn(c,s);var l=Object.prototype.toString.call(c).slice(8,-1);return l==="Object"&&c.constructor&&(l=c.constructor.name),l==="Map"||l==="Set"?Array.from(c):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?sn(c,s):void 0}}(r)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())),d.default.element(i)&&(i=(0,A.getElementRect)(i)),i},G.rectToXY=function(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}},G.xywhToTlbr=function(e){return!e||"left"in e&&"top"in e||((e=(0,I.default)({},e)).left=e.x||0,e.top=e.y||0,e.right=e.right||e.left+e.width,e.bottom=e.bottom||e.top+e.height),e},G.tlbrToXywh=function(e){return!e||"x"in e&&"y"in e||((e=(0,I.default)({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e},G.addEdges=function(e,t,o){e.left&&(t.left+=o.x),e.right&&(t.right+=o.x),e.top&&(t.top+=o.y),e.bottom&&(t.bottom+=o.y),t.width=t.right-t.left,t.height=t.bottom-t.top};var ke={};Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=function(e,t,o){var n=e.options[o],r=n&&n.origin||e.options.origin,i=(0,G.resolveRectLike)(r,e,t,[e&&t]);return(0,G.rectToXY)(i)||{x:0,y:0}};var De={};function ro(e){return e.trim().split(/ +/)}Object.defineProperty(De,"__esModule",{value:!0}),De.default=function e(t,o,n){if(n=n||{},d.default.string(t)&&t.search(" ")!==-1&&(t=ro(t)),d.default.array(t))return t.reduce(function(l,p){return(0,I.default)(l,e(p,o,n))},n);if(d.default.object(t)&&(o=t,t=""),d.default.func(o))n[t]=n[t]||[],n[t].push(o);else if(d.default.array(o))for(var r=0;r<o.length;r++){var i;i=o[r],e(t,i,n)}else if(d.default.object(o))for(var c in o){var s=ro(c).map(function(l){return"".concat(t).concat(l)});e(s,o[c],n)}return n};var we={};Object.defineProperty(we,"__esModule",{value:!0}),we.default=void 0,we.default=function(e,t){return Math.sqrt(e*e+t*t)};var Ze={};function ln(e,t){for(var o in t){var n=ln.prefixedPropREs,r=!1;for(var i in n)if(o.indexOf(i)===0&&n[i].test(o)){r=!0;break}r||typeof t[o]=="function"||(e[o]=t[o])}return e}Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0,ln.prefixedPropREs={webkit:/(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,moz:/(Pressure)$/};var Qr=ln;Ze.default=Qr;var L={};function cn(e){return e instanceof D.default.Event||e instanceof D.default.Touch}function Qe(e,t,o){return e=e||"page",(o=o||{}).x=t[e+"X"],o.y=t[e+"Y"],o}function io(e,t){return t=t||{x:0,y:0},$.default.isOperaMobile&&cn(e)?(Qe("screen",e,t),t.x+=window.scrollX,t.y+=window.scrollY):Qe("page",e,t),t}function ao(e,t){return t=t||{},$.default.isOperaMobile&&cn(e)?Qe("screen",e,t):Qe("client",e,t),t}function gt(e){var t=[];return d.default.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function so(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},o=0;o<e.length;o++){var n=e[o];for(var r in t)t[r]+=n[r]}for(var i in t)t[i]/=e.length;return t}Object.defineProperty(L,"__esModule",{value:!0}),L.copyCoords=function(e,t){e.page=e.page||{},e.page.x=t.page.x,e.page.y=t.page.y,e.client=e.client||{},e.client.x=t.client.x,e.client.y=t.client.y,e.timeStamp=t.timeStamp},L.setCoordDeltas=function(e,t,o){e.page.x=o.page.x-t.page.x,e.page.y=o.page.y-t.page.y,e.client.x=o.client.x-t.client.x,e.client.y=o.client.y-t.client.y,e.timeStamp=o.timeStamp-t.timeStamp},L.setCoordVelocity=function(e,t){var o=Math.max(t.timeStamp/1e3,.001);e.page.x=t.page.x/o,e.page.y=t.page.y/o,e.client.x=t.client.x/o,e.client.y=t.client.y/o,e.timeStamp=o},L.setZeroCoords=function(e){e.page.x=0,e.page.y=0,e.client.x=0,e.client.y=0},L.isNativePointer=cn,L.getXY=Qe,L.getPageXY=io,L.getClientXY=ao,L.getPointerId=function(e){return d.default.number(e.pointerId)?e.pointerId:e.identifier},L.setCoords=function(e,t,o){var n=t.length>1?so(t):t[0];io(n,e.page),ao(n,e.client),e.timeStamp=o},L.getTouchPair=gt,L.pointerAverage=so,L.touchBBox=function(e){if(!e.length)return null;var t=gt(e),o=Math.min(t[0].pageX,t[1].pageX),n=Math.min(t[0].pageY,t[1].pageY),r=Math.max(t[0].pageX,t[1].pageX),i=Math.max(t[0].pageY,t[1].pageY);return{x:o,y:n,left:o,top:n,right:r,bottom:i,width:r-o,height:i-n}},L.touchDistance=function(e,t){var o=t+"X",n=t+"Y",r=gt(e),i=r[0][o]-r[1][o],c=r[0][n]-r[1][n];return(0,we.default)(i,c)},L.touchAngle=function(e,t){var o=t+"X",n=t+"Y",r=gt(e),i=r[1][o]-r[0][o],c=r[1][n]-r[0][n];return 180*Math.atan2(c,i)/Math.PI},L.getPointerType=function(e){return d.default.string(e.pointerType)?e.pointerType:d.default.number(e.pointerType)?[void 0,void 0,"touch","pen","mouse"][e.pointerType]:/touch/.test(e.type||"")||e instanceof D.default.Touch?"touch":"mouse"},L.getEventTargets=function(e){var t=d.default.func(e.composedPath)?e.composedPath():e.path;return[A.getActualElement(t?t[0]:e.target),A.getActualElement(e.currentTarget)]},L.newCoords=function(){return{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},L.coordsToEvent=function(e){return{coords:e,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}},Object.defineProperty(L,"pointerExtend",{enumerable:!0,get:function(){return Ze.default}});var je={};function Jr(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(je,"__esModule",{value:!0}),je.BaseEvent=void 0;var lo=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.type=void 0,this.target=void 0,this.currentTarget=void 0,this.interactable=void 0,this._interaction=void 0,this.timeStamp=void 0,this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=n}var t,o;return t=e,(o=[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}])&&Jr(t.prototype,o),e}();je.BaseEvent=lo,Object.defineProperty(lo.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var K={};Object.defineProperty(K,"__esModule",{value:!0}),K.find=K.findIndex=K.from=K.merge=K.remove=K.contains=void 0,K.contains=function(e,t){return e.indexOf(t)!==-1},K.remove=function(e,t){return e.splice(e.indexOf(t),1)};var co=function(e,t){for(var o=0;o<t.length;o++){var n=t[o];e.push(n)}return e};K.merge=co,K.from=function(e){return co([],e)};var uo=function(e,t){for(var o=0;o<e.length;o++)if(t(e[o],o,e))return o;return-1};K.findIndex=uo,K.find=function(e,t){return e[uo(e,t)]};var he={};function po(e){return(po=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function ei(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fo(e,t){return(fo=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function ti(e,t){return!t||po(t)!=="object"&&typeof t!="function"?function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(e):t}function un(e){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}Object.defineProperty(he,"__esModule",{value:!0}),he.DropEvent=void 0;var ni=function(e){(function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),l&&fo(s,l)})(c,e);var t,o,n,r,i=(n=c,r=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}(),function(){var s,l=un(n);if(r){var p=un(this).constructor;s=Reflect.construct(l,arguments,p)}else s=l.apply(this,arguments);return ti(this,s)});function c(s,l,p){var f;(function(y,P){if(!(y instanceof P))throw new TypeError("Cannot call a class as a function")})(this,c),(f=i.call(this,l._interaction)).target=void 0,f.dropzone=void 0,f.dragEvent=void 0,f.relatedTarget=void 0,f.draggable=void 0,f.timeStamp=void 0,f.propagationStopped=!1,f.immediatePropagationStopped=!1;var m=p==="dragleave"?s.prev:s.cur,b=m.element,w=m.dropzone;return f.type=p,f.target=b,f.currentTarget=b,f.dropzone=w,f.dragEvent=l,f.relatedTarget=l.target,f.draggable=l.interactable,f.timeStamp=l.timeStamp,f}return t=c,(o=[{key:"reject",value:function(){var s=this,l=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&l.cur.dropzone===this.dropzone&&l.cur.element===this.target)if(l.prev.dropzone=this.dropzone,l.prev.element=this.target,l.rejected=!0,l.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var p=l.activeDrops,f=K.findIndex(p,function(b){var w=b.dropzone,y=b.element;return w===s.dropzone&&y===s.target});l.activeDrops.splice(f,1);var m=new c(l,this.dragEvent,"dropdeactivate");m.dropzone=this.dropzone,m.target=this.target,this.dropzone.fire(m)}else this.dropzone.fire(new c(l,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}])&&ei(t.prototype,o),c}(je.BaseEvent);he.DropEvent=ni;var mt={};function ho(e,t){for(var o=0;o<e.slice().length;o++){var n=e.slice()[o],r=n.dropzone,i=n.element;t.dropzone=r,t.target=i,r.fire(t),t.propagationStopped=t.immediatePropagationStopped=!1}}function pn(e,t){for(var o=function(i,c){for(var s=i.interactables,l=[],p=0;p<s.list.length;p++){var f=s.list[p];if(f.options.drop.enabled){var m=f.options.drop.accept;if(!(d.default.element(m)&&m!==c||d.default.string(m)&&!A.matchesSelector(c,m)||d.default.func(m)&&!m({dropzone:f,draggableElement:c})))for(var b=d.default.string(f.target)?f._context.querySelectorAll(f.target):d.default.array(f.target)?f.target:[f.target],w=0;w<b.length;w++){var y=b[w];y!==c&&l.push({dropzone:f,element:y,rect:f.getRect(y)})}}}return l}(e,t),n=0;n<o.length;n++){var r=o[n];r.rect=r.dropzone.getRect(r.element)}return o}function vo(e,t,o){for(var n=e.dropState,r=e.interactable,i=e.element,c=[],s=0;s<n.activeDrops.length;s++){var l=n.activeDrops[s],p=l.dropzone,f=l.element,m=l.rect;c.push(p.dropCheck(t,o,r,i,f,m)?f:null)}var b=A.indexOfDeepestElement(c);return n.activeDrops[b]||null}function dn(e,t,o){var n=e.dropState,r={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return o.type==="dragstart"&&(r.activate=new he.DropEvent(n,o,"dropactivate"),r.activate.target=null,r.activate.dropzone=null),o.type==="dragend"&&(r.deactivate=new he.DropEvent(n,o,"dropdeactivate"),r.deactivate.target=null,r.deactivate.dropzone=null),n.rejected||(n.cur.element!==n.prev.element&&(n.prev.dropzone&&(r.leave=new he.DropEvent(n,o,"dragleave"),o.dragLeave=r.leave.target=n.prev.element,o.prevDropzone=r.leave.dropzone=n.prev.dropzone),n.cur.dropzone&&(r.enter=new he.DropEvent(n,o,"dragenter"),o.dragEnter=n.cur.element,o.dropzone=n.cur.dropzone)),o.type==="dragend"&&n.cur.dropzone&&(r.drop=new he.DropEvent(n,o,"drop"),o.dropzone=n.cur.dropzone,o.relatedTarget=n.cur.element),o.type==="dragmove"&&n.cur.dropzone&&(r.move=new he.DropEvent(n,o,"dropmove"),r.move.dragmove=o,o.dropzone=n.cur.dropzone)),r}function fn(e,t){var o=e.dropState,n=o.activeDrops,r=o.cur,i=o.prev;t.leave&&i.dropzone.fire(t.leave),t.enter&&r.dropzone.fire(t.enter),t.move&&r.dropzone.fire(t.move),t.drop&&r.dropzone.fire(t.drop),t.deactivate&&ho(n,t.deactivate),o.prev.dropzone=r.dropzone,o.prev.element=r.element}function go(e,t){var o=e.interaction,n=e.iEvent,r=e.event;if(n.type==="dragmove"||n.type==="dragend"){var i=o.dropState;t.dynamicDrop&&(i.activeDrops=pn(t,o.element));var c=n,s=vo(o,c,r);i.rejected=i.rejected&&!!s&&s.dropzone===i.cur.dropzone&&s.element===i.cur.element,i.cur.dropzone=s&&s.dropzone,i.cur.element=s&&s.element,i.events=dn(o,0,c)}}Object.defineProperty(mt,"__esModule",{value:!0}),mt.default=void 0;var mo={id:"actions/drop",install:function(e){var t=e.actions,o=e.interactStatic,n=e.Interactable,r=e.defaults;e.usePlugin(_.default),n.prototype.dropzone=function(i){return function(c,s){if(d.default.object(s)){if(c.options.drop.enabled=s.enabled!==!1,s.listeners){var l=(0,De.default)(s.listeners),p=Object.keys(l).reduce(function(f,m){return f[/^(enter|leave)/.test(m)?"drag".concat(m):/^(activate|deactivate|move)/.test(m)?"drop".concat(m):m]=l[m],f},{});c.off(c.options.drop.listeners),c.on(p),c.options.drop.listeners=p}return d.default.func(s.ondrop)&&c.on("drop",s.ondrop),d.default.func(s.ondropactivate)&&c.on("dropactivate",s.ondropactivate),d.default.func(s.ondropdeactivate)&&c.on("dropdeactivate",s.ondropdeactivate),d.default.func(s.ondragenter)&&c.on("dragenter",s.ondragenter),d.default.func(s.ondragleave)&&c.on("dragleave",s.ondragleave),d.default.func(s.ondropmove)&&c.on("dropmove",s.ondropmove),/^(pointer|center)$/.test(s.overlap)?c.options.drop.overlap=s.overlap:d.default.number(s.overlap)&&(c.options.drop.overlap=Math.max(Math.min(1,s.overlap),0)),"accept"in s&&(c.options.drop.accept=s.accept),"checker"in s&&(c.options.drop.checker=s.checker),c}return d.default.bool(s)?(c.options.drop.enabled=s,c):c.options.drop}(this,i)},n.prototype.dropCheck=function(i,c,s,l,p,f){return function(m,b,w,y,P,O,x){var C=!1;if(!(x=x||m.getRect(O)))return!!m.options.drop.checker&&m.options.drop.checker(b,w,C,m,O,y,P);var j=m.options.drop.overlap;if(j==="pointer"){var F=(0,ke.default)(y,P,"drag"),X=L.getPageXY(b);X.x+=F.x,X.y+=F.y;var Z=X.x>x.left&&X.x<x.right,N=X.y>x.top&&X.y<x.bottom;C=Z&&N}var Y=y.getRect(P);if(Y&&j==="center"){var ue=Y.left+Y.width/2,ye=Y.top+Y.height/2;C=ue>=x.left&&ue<=x.right&&ye>=x.top&&ye<=x.bottom}return Y&&d.default.number(j)&&(C=Math.max(0,Math.min(x.right,Y.right)-Math.max(x.left,Y.left))*Math.max(0,Math.min(x.bottom,Y.bottom)-Math.max(x.top,Y.top))/(Y.width*Y.height)>=j),m.options.drop.checker&&(C=m.options.drop.checker(b,w,C,m,O,y,P)),C}(this,i,c,s,l,p,f)},o.dynamicDrop=function(i){return d.default.bool(i)?(e.dynamicDrop=i,o):e.dynamicDrop},(0,I.default)(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",e.dynamicDrop=!1,r.actions.drop=mo.defaults},listeners:{"interactions:before-action-start":function(e){var t=e.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,t){var o=e.interaction,n=(e.event,e.iEvent);if(o.prepared.name==="drag"){var r=o.dropState;r.activeDrops=null,r.events=null,r.activeDrops=pn(t,o.element),r.events=dn(o,0,n),r.events.activate&&(ho(r.activeDrops,r.events.activate),t.fire("actions/drop:start",{interaction:o,dragEvent:n}))}},"interactions:action-move":go,"interactions:after-action-move":function(e,t){var o=e.interaction,n=e.iEvent;o.prepared.name==="drag"&&(fn(o,o.dropState.events),t.fire("actions/drop:move",{interaction:o,dragEvent:n}),o.dropState.events={})},"interactions:action-end":function(e,t){if(e.interaction.prepared.name==="drag"){var o=e.interaction,n=e.iEvent;go(e,t),fn(o,o.dropState.events),t.fire("actions/drop:end",{interaction:o,dragEvent:n})}},"interactions:stop":function(e){var t=e.interaction;if(t.prepared.name==="drag"){var o=t.dropState;o&&(o.activeDrops=null,o.events=null,o.cur.dropzone=null,o.cur.element=null,o.prev.dropzone=null,o.prev.element=null,o.rejected=!1)}}},getActiveDrops:pn,getDrop:vo,getDropEvents:dn,fireDropEvents:fn,defaults:{enabled:!1,accept:null,overlap:"pointer"}},oi=mo;mt.default=oi;var yt={};function hn(e){var t=e.interaction,o=e.iEvent,n=e.phase;if(t.prepared.name==="gesture"){var r=t.pointers.map(function(p){return p.pointer}),i=n==="start",c=n==="end",s=t.interactable.options.deltaSource;if(o.touches=[r[0],r[1]],i)o.distance=L.touchDistance(r,s),o.box=L.touchBBox(r),o.scale=1,o.ds=0,o.angle=L.touchAngle(r,s),o.da=0,t.gesture.startDistance=o.distance,t.gesture.startAngle=o.angle;else if(c){var l=t.prevEvent;o.distance=l.distance,o.box=l.box,o.scale=l.scale,o.ds=0,o.angle=l.angle,o.da=0}else o.distance=L.touchDistance(r,s),o.box=L.touchBBox(r),o.scale=o.distance/t.gesture.startDistance,o.angle=L.touchAngle(r,s),o.ds=o.scale-t.gesture.scale,o.da=o.angle-t.gesture.angle;t.gesture.distance=o.distance,t.gesture.angle=o.angle,d.default.number(o.scale)&&o.scale!==1/0&&!isNaN(o.scale)&&(t.gesture.scale=o.scale)}}Object.defineProperty(yt,"__esModule",{value:!0}),yt.default=void 0;var vn={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var t=e.actions,o=e.Interactable,n=e.defaults;o.prototype.gesturable=function(r){return d.default.object(r)?(this.options.gesture.enabled=r.enabled!==!1,this.setPerAction("gesture",r),this.setOnEvents("gesture",r),this):d.default.bool(r)?(this.options.gesture.enabled=r,this):this.options.gesture},t.map.gesture=vn,t.methodDict.gesture="gesturable",n.actions.gesture=vn.defaults},listeners:{"interactions:action-start":hn,"interactions:action-move":hn,"interactions:action-end":hn,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var t=e.interactable.options.gesture;if(t&&t.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""}},ri=vn;yt.default=ri;var bt={};function ii(e,t,o,n,r,i,c){if(!t)return!1;if(t===!0){var s=d.default.number(i.width)?i.width:i.right-i.left,l=d.default.number(i.height)?i.height:i.bottom-i.top;if(c=Math.min(c,Math.abs((e==="left"||e==="right"?s:l)/2)),s<0&&(e==="left"?e="right":e==="right"&&(e="left")),l<0&&(e==="top"?e="bottom":e==="bottom"&&(e="top")),e==="left")return o.x<(s>=0?i.left:i.right)+c;if(e==="top")return o.y<(l>=0?i.top:i.bottom)+c;if(e==="right")return o.x>(s>=0?i.right:i.left)-c;if(e==="bottom")return o.y>(l>=0?i.bottom:i.top)-c}return!!d.default.element(n)&&(d.default.element(t)?t===n:A.matchesUpTo(n,t,r))}function yo(e){var t=e.iEvent,o=e.interaction;if(o.prepared.name==="resize"&&o.resizeAxes){var n=t;o.interactable.options.resize.square?(o.resizeAxes==="y"?n.delta.x=n.delta.y:n.delta.y=n.delta.x,n.axes="xy"):(n.axes=o.resizeAxes,o.resizeAxes==="x"?n.delta.y=0:o.resizeAxes==="y"&&(n.delta.x=0))}}Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=void 0;var ve={id:"actions/resize",before:["actions/drag"],install:function(e){var t=e.actions,o=e.browser,n=e.Interactable,r=e.defaults;ve.cursors=function(i){return i.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(o),ve.defaultMargin=o.supportsTouch||o.supportsPointerEvent?20:10,n.prototype.resizable=function(i){return function(c,s,l){return d.default.object(s)?(c.options.resize.enabled=s.enabled!==!1,c.setPerAction("resize",s),c.setOnEvents("resize",s),d.default.string(s.axis)&&/^x$|^y$|^xy$/.test(s.axis)?c.options.resize.axis=s.axis:s.axis===null&&(c.options.resize.axis=l.defaults.actions.resize.axis),d.default.bool(s.preserveAspectRatio)?c.options.resize.preserveAspectRatio=s.preserveAspectRatio:d.default.bool(s.square)&&(c.options.resize.square=s.square),c):d.default.bool(s)?(c.options.resize.enabled=s,c):c.options.resize}(this,i,e)},t.map.resize=ve,t.methodDict.resize="resizable",r.actions.resize=ve.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(t){var o=t.iEvent,n=t.interaction;if(n.prepared.name==="resize"&&n.prepared.edges){var r=o,i=n.rect;n._rects={start:(0,I.default)({},i),corrected:(0,I.default)({},i),previous:(0,I.default)({},i),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},r.edges=n.prepared.edges,r.rect=n._rects.corrected,r.deltaRect=n._rects.delta}})(e),yo(e)},"interactions:action-move":function(e){(function(t){var o=t.iEvent,n=t.interaction;if(n.prepared.name==="resize"&&n.prepared.edges){var r=o,i=n.interactable.options.resize.invert,c=i==="reposition"||i==="negate",s=n.rect,l=n._rects,p=l.start,f=l.corrected,m=l.delta,b=l.previous;if((0,I.default)(b,f),c){if((0,I.default)(f,s),i==="reposition"){if(f.top>f.bottom){var w=f.top;f.top=f.bottom,f.bottom=w}if(f.left>f.right){var y=f.left;f.left=f.right,f.right=y}}}else f.top=Math.min(s.top,p.bottom),f.bottom=Math.max(s.bottom,p.top),f.left=Math.min(s.left,p.right),f.right=Math.max(s.right,p.left);for(var P in f.width=f.right-f.left,f.height=f.bottom-f.top,f)m[P]=f[P]-b[P];r.edges=n.prepared.edges,r.rect=f,r.deltaRect=m}})(e),yo(e)},"interactions:action-end":function(e){var t=e.iEvent,o=e.interaction;if(o.prepared.name==="resize"&&o.prepared.edges){var n=t;n.edges=o.prepared.edges,n.rect=o._rects.corrected,n.deltaRect=o._rects.delta}},"auto-start:check":function(e){var t=e.interaction,o=e.interactable,n=e.element,r=e.rect,i=e.buttons;if(r){var c=(0,I.default)({},t.coords.cur.page),s=o.options.resize;if(s&&s.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||(i&s.mouseButtons)!=0)){if(d.default.object(s.edges)){var l={left:!1,right:!1,top:!1,bottom:!1};for(var p in l)l[p]=ii(p,s.edges[p],c,t._latestPointer.eventTarget,n,r,s.margin||ve.defaultMargin);l.left=l.left&&!l.right,l.top=l.top&&!l.bottom,(l.left||l.right||l.top||l.bottom)&&(e.action={name:"resize",edges:l})}else{var f=s.axis!=="y"&&c.x>r.right-ve.defaultMargin,m=s.axis!=="x"&&c.y>r.bottom-ve.defaultMargin;(f||m)&&(e.action={name:"resize",axes:(f?"x":"")+(m?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var t=e.edges,o=e.axis,n=e.name,r=ve.cursors,i=null;if(o)i=r[n+o];else if(t){for(var c="",s=["top","bottom","left","right"],l=0;l<s.length;l++){var p=s[l];t[p]&&(c+=p)}i=r[c]}return i},defaultMargin:null},ai=ve;bt.default=ai;var wt={};Object.defineProperty(wt,"__esModule",{value:!0}),wt.default=void 0;var si={id:"actions",install:function(e){e.usePlugin(yt.default),e.usePlugin(bt.default),e.usePlugin(_.default),e.usePlugin(mt.default)}};wt.default=si;var de={};Object.defineProperty(de,"__esModule",{value:!0}),de.default=void 0;var ge,Te,bo=0,li={request:function(e){return ge(e)},cancel:function(e){return Te(e)},init:function(e){if(ge=e.requestAnimationFrame,Te=e.cancelAnimationFrame,!ge)for(var t=["ms","moz","webkit","o"],o=0;o<t.length;o++){var n=t[o];ge=e["".concat(n,"RequestAnimationFrame")],Te=e["".concat(n,"CancelAnimationFrame")]||e["".concat(n,"CancelRequestAnimationFrame")]}ge=ge&&ge.bind(e),Te=Te&&Te.bind(e),ge||(ge=function(r){var i=Date.now(),c=Math.max(0,16-(i-bo)),s=e.setTimeout(function(){r(i+c)},c);return bo=i+c,s},Te=function(r){return clearTimeout(r)})}};de.default=li;var Ee={};Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.getContainer=Et,Ee.getScroll=Je,Ee.getScrollSize=function(e){return d.default.window(e)&&(e=window.document.body),{x:e.scrollWidth,y:e.scrollHeight}},Ee.getScrollSizeDelta=function(e,t){var o=e.interaction,n=e.element,r=o&&o.interactable.options[o.prepared.name].autoScroll;if(!r||!r.enabled)return t(),{x:0,y:0};var i=Et(r.container,o.interactable,n),c=Je(i);t();var s=Je(i);return{x:s.x-c.x,y:s.y-c.y}},Ee.default=void 0;var z={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(e){z.isScrolling=!0,de.default.cancel(z.i),e.autoScroll=z,z.interaction=e,z.prevTime=z.now(),z.i=de.default.request(z.scroll)},stop:function(){z.isScrolling=!1,z.interaction&&(z.interaction.autoScroll=null),de.default.cancel(z.i)},scroll:function(){var e=z.interaction,t=e.interactable,o=e.element,n=e.prepared.name,r=t.options[n].autoScroll,i=Et(r.container,t,o),c=z.now(),s=(c-z.prevTime)/1e3,l=r.speed*s;if(l>=1){var p={x:z.x*l,y:z.y*l};if(p.x||p.y){var f=Je(i);d.default.window(i)?i.scrollBy(p.x,p.y):i&&(i.scrollLeft+=p.x,i.scrollTop+=p.y);var m=Je(i),b={x:m.x-f.x,y:m.y-f.y};(b.x||b.y)&&t.fire({type:"autoscroll",target:o,interactable:t,delta:b,interaction:e,container:i})}z.prevTime=c}z.isScrolling&&(de.default.cancel(z.i),z.i=de.default.request(z.scroll))},check:function(e,t){var o;return(o=e.options[t].autoScroll)==null?void 0:o.enabled},onInteractionMove:function(e){var t=e.interaction,o=e.pointer;if(t.interacting()&&z.check(t.interactable,t.prepared.name))if(t.simulation)z.x=z.y=0;else{var n,r,i,c,s=t.interactable,l=t.element,p=t.prepared.name,f=s.options[p].autoScroll,m=Et(f.container,s,l);if(d.default.window(m))c=o.clientX<z.margin,n=o.clientY<z.margin,r=o.clientX>m.innerWidth-z.margin,i=o.clientY>m.innerHeight-z.margin;else{var b=A.getElementClientRect(m);c=o.clientX<b.left+z.margin,n=o.clientY<b.top+z.margin,r=o.clientX>b.right-z.margin,i=o.clientY>b.bottom-z.margin}z.x=r?1:c?-1:0,z.y=i?1:n?-1:0,z.isScrolling||(z.margin=f.margin,z.speed=f.speed,z.start(t))}}};function Et(e,t,o){return(d.default.string(e)?(0,G.getStringOptionResult)(e,t,o):e)||(0,a.getWindow)(o)}function Je(e){return d.default.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var ci={id:"auto-scroll",install:function(e){var t=e.defaults,o=e.actions;e.autoScroll=z,z.now=function(){return e.now()},o.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=z.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,z.stop(),z.interaction&&(z.interaction=null)},"interactions:stop":z.stop,"interactions:action-move":function(e){return z.onInteractionMove(e)}}};Ee.default=ci;var ae={};Object.defineProperty(ae,"__esModule",{value:!0}),ae.warnOnce=function(e,t){var o=!1;return function(){return o||(a.window.console.warn(t),o=!0),e.apply(this,arguments)}},ae.copyAction=function(e,t){return e.name=t.name,e.axis=t.axis,e.edges=t.edges,e},ae.sign=void 0,ae.sign=function(e){return e>=0?1:-1};var xt={};function ui(e){return d.default.bool(e)?(this.options.styleCursor=e,this):e===null?(delete this.options.styleCursor,this):this.options.styleCursor}function pi(e){return d.default.func(e)?(this.options.actionChecker=e,this):e===null?(delete this.options.actionChecker,this):this.options.actionChecker}Object.defineProperty(xt,"__esModule",{value:!0}),xt.default=void 0;var di={id:"auto-start/interactableMethods",install:function(e){var t=e.Interactable;t.prototype.getAction=function(o,n,r,i){var c=function(s,l,p,f,m){var b=s.getRect(f),w={action:null,interactable:s,interaction:p,element:f,rect:b,buttons:l.buttons||{0:1,1:4,3:8,4:16}[l.button]};return m.fire("auto-start:check",w),w.action}(this,n,r,i,e);return this.options.actionChecker?this.options.actionChecker(o,n,c,this,i,r):c},t.prototype.ignoreFrom=(0,ae.warnOnce)(function(o){return this._backCompatOption("ignoreFrom",o)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=(0,ae.warnOnce)(function(o){return this._backCompatOption("allowFrom",o)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=pi,t.prototype.styleCursor=ui}};xt.default=di;var He={};function wo(e,t,o,n,r){return t.testIgnoreAllow(t.options[e.name],o,n)&&t.options[e.name].enabled&&St(t,o,e,r)?e:null}function fi(e,t,o,n,r,i,c){for(var s=0,l=n.length;s<l;s++){var p=n[s],f=r[s],m=p.getAction(t,o,e,f);if(m){var b=wo(m,p,f,i,c);if(b)return{action:b,interactable:p,element:f}}}return{action:null,interactable:null,element:null}}function Eo(e,t,o,n,r){var i=[],c=[],s=n;function l(f){i.push(f),c.push(s)}for(;d.default.element(s);){i=[],c=[],r.interactables.forEachMatch(s,l);var p=fi(e,t,o,i,c,n,r);if(p.action&&!p.interactable.options[p.action.name].manualStart)return p;s=A.parentNode(s)}return{action:null,interactable:null,element:null}}function xo(e,t,o){var n=t.action,r=t.interactable,i=t.element;n=n||{name:null},e.interactable=r,e.element=i,(0,ae.copyAction)(e.prepared,n),e.rect=r&&n.name?r.getRect(i):null,Po(e,o),o.fire("autoStart:prepared",{interaction:e})}function St(e,t,o,n){var r=e.options,i=r[o.name].max,c=r[o.name].maxPerElement,s=n.autoStart.maxInteractions,l=0,p=0,f=0;if(!(i&&c&&s))return!1;for(var m=0;m<n.interactions.list.length;m++){var b=n.interactions.list[m],w=b.prepared.name;if(b.interacting()&&(++l>=s||b.interactable===e&&((p+=w===o.name?1:0)>=i||b.element===t&&(f++,w===o.name&&f>=c))))return!1}return s>0}function So(e,t){return d.default.number(e)?(t.autoStart.maxInteractions=e,this):t.autoStart.maxInteractions}function gn(e,t,o){var n=o.autoStart.cursorElement;n&&n!==e&&(n.style.cursor=""),e.ownerDocument.documentElement.style.cursor=t,e.style.cursor=t,o.autoStart.cursorElement=t?e:null}function Po(e,t){var o=e.interactable,n=e.element,r=e.prepared;if(e.pointerType==="mouse"&&o&&o.options.styleCursor){var i="";if(r.name){var c=o.options[r.name].cursorChecker;i=d.default.func(c)?c(r,o,n,e._interacting):t.actions.map[r.name].getCursor(r)}gn(e.element,i||"",t)}else t.autoStart.cursorElement&&gn(t.autoStart.cursorElement,"",t)}Object.defineProperty(He,"__esModule",{value:!0}),He.default=void 0;var hi={id:"auto-start/base",before:["actions"],install:function(e){var t=e.interactStatic,o=e.defaults;e.usePlugin(xt.default),o.base.actionChecker=null,o.base.styleCursor=!0,(0,I.default)(o.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(n){return So(n,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:St,cursorElement:null}},listeners:{"interactions:down":function(e,t){var o=e.interaction,n=e.pointer,r=e.event,i=e.eventTarget;o.interacting()||xo(o,Eo(o,n,r,i,t),t)},"interactions:move":function(e,t){(function(o,n){var r=o.interaction,i=o.pointer,c=o.event,s=o.eventTarget;r.pointerType!=="mouse"||r.pointerIsDown||r.interacting()||xo(r,Eo(r,i,c,s,n),n)})(e,t),function(o,n){var r=o.interaction;if(r.pointerIsDown&&!r.interacting()&&r.pointerWasMoved&&r.prepared.name){n.fire("autoStart:before-start",o);var i=r.interactable,c=r.prepared.name;c&&i&&(i.options[c].manualStart||!St(i,r.element,r.prepared,n)?r.stop():(r.start(r.prepared,i,r.element),Po(r,n)))}}(e,t)},"interactions:stop":function(e,t){var o=e.interaction,n=o.interactable;n&&n.options.styleCursor&&gn(o.element,"",t)}},maxInteractions:So,withinInteractionLimit:St,validateAction:wo};He.default=hi;var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.default=void 0;var vi={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,t){var o=e.interaction,n=e.eventTarget,r=e.dx,i=e.dy;if(o.prepared.name==="drag"){var c=Math.abs(r),s=Math.abs(i),l=o.interactable.options.drag,p=l.startAxis,f=c>s?"x":c<s?"y":"xy";if(o.prepared.axis=l.lockAxis==="start"?f[0]:l.lockAxis,f!=="xy"&&p!=="xy"&&p!==f){o.prepared.name=null;for(var m=n,b=function(y){if(y!==o.interactable){var P=o.interactable.options.drag;if(!P.manualStart&&y.testIgnoreAllow(P,m,n)){var O=y.getAction(o.downPointer,o.downEvent,o,m);if(O&&O.name==="drag"&&function(x,C){if(!C)return!1;var j=C.options.drag.startAxis;return x==="xy"||j==="xy"||j===x}(f,y)&&He.default.validateAction(O,y,m,n,t))return y}}};d.default.element(m);){var w=t.interactables.forEachMatch(m,b);if(w){o.prepared.name="drag",o.interactable=w,o.element=m;break}m=(0,A.parentNode)(m)}}}}}};Pt.default=vi;var kt={};function mn(e){var t=e.prepared&&e.prepared.name;if(!t)return null;var o=e.interactable.options;return o[t].hold||o[t].delay}Object.defineProperty(kt,"__esModule",{value:!0}),kt.default=void 0;var gi={id:"auto-start/hold",install:function(e){var t=e.defaults;e.usePlugin(He.default),t.perAction.hold=0,t.perAction.delay=0},listeners:{"interactions:new":function(e){e.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(e){var t=e.interaction,o=mn(t);o>0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},o))},"interactions:move":function(e){var t=e.interaction,o=e.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!o&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var t=e.interaction;mn(t)>0&&(t.prepared.name=null)}},getHoldDuration:mn};kt.default=gi;var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.default=void 0;var mi={id:"auto-start",install:function(e){e.usePlugin(He.default),e.usePlugin(kt.default),e.usePlugin(Pt.default)}};Tt.default=mi;var Re={};function yi(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):d.default.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault}function bi(e){var t=e.interaction,o=e.event;t.interactable&&t.interactable.checkAndPreventDefault(o)}function ko(e){var t=e.Interactable;t.prototype.preventDefault=yi,t.prototype.checkAndPreventDefault=function(o){return function(n,r,i){var c=n.options.preventDefault;if(c!=="never")if(c!=="always"){if(r.events.supportsPassive&&/^touch(start|move)$/.test(i.type)){var s=(0,a.getWindow)(i.target).document,l=r.getDocOptions(s);if(!l||!l.events||l.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(i.type)||d.default.element(i.target)&&(0,A.matchesSelector)(i.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||i.preventDefault()}else i.preventDefault()}(this,e,o)},e.interactions.docEvents.push({type:"dragstart",listener:function(o){for(var n=0;n<e.interactions.list.length;n++){var r=e.interactions.list[n];if(r.element&&(r.element===o.target||(0,A.nodeContains)(r.element,o.target)))return void r.interactable.checkAndPreventDefault(o)}}})}Object.defineProperty(Re,"__esModule",{value:!0}),Re.install=ko,Re.default=void 0;var wi={id:"core/interactablePreventDefault",install:ko,listeners:["down","move","up","cancel"].reduce(function(e,t){return e["interactions:".concat(t)]=bi,e},{})};Re.default=wi;var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.default=void 0,Mt.default={};var ze,Ot={};function yn(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.default=void 0,function(e){e.touchAction="touchAction",e.boxSizing="boxSizing",e.noListeners="noListeners"}(ze||(ze={}));var To="[interact.js] ",bn={touchAction:"https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action",boxSizing:"https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing"},wn=[{name:ze.touchAction,perform:function(e){return!function(t,o,n){for(var r=t;d.default.element(r);){if(Mo(r,"touchAction",n))return!0;r=(0,A.parentNode)(r)}return!1}(e.element,0,/pan-|pinch|none/)},getInfo:function(e){return[e.element,bn.touchAction]},text:`Consider adding CSS "touch-action: none" to this element
`},{name:ze.boxSizing,perform:function(e){var t=e.element;return e.prepared.name==="resize"&&t instanceof D.default.HTMLElement&&!Mo(t,"boxSizing",/border-box/)},text:'Consider adding CSS "box-sizing: border-box" to this resizable element',getInfo:function(e){return[e.element,bn.boxSizing]}},{name:ze.noListeners,perform:function(e){var t=e.prepared.name;return!(e.interactable.events.types["".concat(t,"move")]||[]).length},getInfo:function(e){return[e.prepared.name,e.interactable]},text:"There are no listeners set for this action"}];function Mo(e,t,o){var n=e.style[t]||a.window.getComputedStyle(e)[t];return o.test((n||"").toString())}var Ei={id:"dev-tools",install:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t.logger,n=e.Interactable,r=e.defaults;e.logger=o||console,r.base.devTools={ignore:{}},n.prototype.devTools=function(i){return i?((0,I.default)(this.options.devTools,i),this):this.options.devTools},e.usePlugin(Mt.default)},listeners:{"interactions:action-start":function(e,t){for(var o=e.interaction,n=0;n<wn.length;n++){var r,i=wn[n],c=o.interactable&&o.interactable.options;c&&c.devTools&&c.devTools.ignore[i.name]||!i.perform(o)||(r=t.logger).warn.apply(r,[To+i.text].concat(function(l){if(Array.isArray(l))return yn(l)}(s=i.getInfo(o))||function(l){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(l))return Array.from(l)}(s)||function(l,p){if(l){if(typeof l=="string")return yn(l,p);var f=Object.prototype.toString.call(l).slice(8,-1);return f==="Object"&&l.constructor&&(f=l.constructor.name),f==="Map"||f==="Set"?Array.from(l):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?yn(l,p):void 0}}(s)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()))}var s}},checks:wn,CheckName:ze,links:bn,prefix:To};Ot.default=Ei;var Me={};Object.defineProperty(Me,"__esModule",{value:!0}),Me.default=function e(t){var o={};for(var n in t){var r=t[n];d.default.plainObject(r)?o[n]=e(r):d.default.array(r)?o[n]=K.from(r):o[n]=r}return o};var Oe={};function Oo(e,t){return function(o){if(Array.isArray(o))return o}(e)||function(o,n){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(o)){var r=[],i=!0,c=!1,s=void 0;try{for(var l,p=o[Symbol.iterator]();!(i=(l=p.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(f){c=!0,s=f}finally{try{i||p.return==null||p.return()}finally{if(c)throw s}}return r}}(e,t)||function(o,n){if(o){if(typeof o=="string")return _o(o,n);var r=Object.prototype.toString.call(o).slice(8,-1);return r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set"?Array.from(o):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_o(o,n):void 0}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function _o(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function xi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.getRectOffset=Co,Oe.default=void 0;var Si=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=n,this.result=_t()}var t,o;return t=e,(o=[{key:"start",value:function(n,r){var i=n.phase,c=this.interaction,s=function(p){var f=p.interactable.options[p.prepared.name],m=f.modifiers;return m&&m.length?m:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(b){var w=f[b];return w&&w.enabled&&{options:w,methods:w._methods}}).filter(function(b){return!!b})}(c);this.prepareStates(s),this.edges=(0,I.default)({},c.edges),this.startOffset=Co(c.rect,r),this.startDelta={x:0,y:0};var l=this.fillArg({phase:i,pageCoords:r,preEnd:!1});return this.result=_t(),this.startAll(l),this.result=this.setAll(l)}},{key:"fillArg",value:function(n){var r=this.interaction;return n.interaction=r,n.interactable=r.interactable,n.element=r.element,n.rect=n.rect||r.rect,n.edges=this.edges,n.startOffset=this.startOffset,n}},{key:"startAll",value:function(n){for(var r=0;r<this.states.length;r++){var i=this.states[r];i.methods.start&&(n.state=i,i.methods.start(n))}}},{key:"setAll",value:function(n){var r=n.phase,i=n.preEnd,c=n.skipModifiers,s=n.rect;n.coords=(0,I.default)({},n.pageCoords),n.rect=(0,I.default)({},s);for(var l=c?this.states.slice(c):this.states,p=_t(n.coords,n.rect),f=0;f<l.length;f++){var m,b=l[f],w=b.options,y=(0,I.default)({},n.coords),P=null;(m=b.methods)!=null&&m.set&&this.shouldDo(w,i,r)&&(n.state=b,P=b.methods.set(n),G.addEdges(this.interaction.edges,n.rect,{x:n.coords.x-y.x,y:n.coords.y-y.y})),p.eventProps.push(P)}p.delta.x=n.coords.x-n.pageCoords.x,p.delta.y=n.coords.y-n.pageCoords.y,p.rectDelta.left=n.rect.left-s.left,p.rectDelta.right=n.rect.right-s.right,p.rectDelta.top=n.rect.top-s.top,p.rectDelta.bottom=n.rect.bottom-s.bottom;var O=this.result.coords,x=this.result.rect;if(O&&x){var C=p.rect.left!==x.left||p.rect.right!==x.right||p.rect.top!==x.top||p.rect.bottom!==x.bottom;p.changed=C||O.x!==p.coords.x||O.y!==p.coords.y}return p}},{key:"applyToInteraction",value:function(n){var r=this.interaction,i=n.phase,c=r.coords.cur,s=r.coords.start,l=this.result,p=this.startDelta,f=l.delta;i==="start"&&(0,I.default)(this.startDelta,l.delta);for(var m=[[s,p],[c,f]],b=0;b<m.length;b++){var w=Oo(m[b],2),y=w[0],P=w[1];y.page.x+=P.x,y.page.y+=P.y,y.client.x+=P.x,y.client.y+=P.y}var O=this.result.rectDelta,x=n.rect||r.rect;x.left+=O.left,x.right+=O.right,x.top+=O.top,x.bottom+=O.bottom,x.width=x.right-x.left,x.height=x.bottom-x.top}},{key:"setAndApply",value:function(n){var r=this.interaction,i=n.phase,c=n.preEnd,s=n.skipModifiers,l=this.setAll(this.fillArg({preEnd:c,phase:i,pageCoords:n.modifiedCoords||r.coords.cur.page}));if(this.result=l,!l.changed&&(!s||s<this.states.length)&&r.interacting())return!1;if(n.modifiedCoords){var p=r.coords.cur.page,f={x:n.modifiedCoords.x-p.x,y:n.modifiedCoords.y-p.y};l.coords.x+=f.x,l.coords.y+=f.y,l.delta.x+=f.x,l.delta.y+=f.y}this.applyToInteraction(n)}},{key:"beforeEnd",value:function(n){var r=n.interaction,i=n.event,c=this.states;if(c&&c.length){for(var s=!1,l=0;l<c.length;l++){var p=c[l];n.state=p;var f=p.options,m=p.methods,b=m.beforeEnd&&m.beforeEnd(n);if(b)return this.endResult=b,!1;s=s||!s&&this.shouldDo(f,!0,n.phase,!0)}s&&r.move({event:i,preEnd:!0})}}},{key:"stop",value:function(n){var r=n.interaction;if(this.states&&this.states.length){var i=(0,I.default)({states:this.states,interactable:r.interactable,element:r.element,rect:null},n);this.fillArg(i);for(var c=0;c<this.states.length;c++){var s=this.states[c];i.state=s,s.methods.stop&&s.methods.stop(i)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(n){this.states=[];for(var r=0;r<n.length;r++){var i=n[r],c=i.options,s=i.methods,l=i.name;this.states.push({options:c,methods:s,index:r,name:l})}return this.states}},{key:"restoreInteractionCoords",value:function(n){var r=n.interaction,i=r.coords,c=r.rect,s=r.modification;if(s.result){for(var l=s.startDelta,p=s.result,f=p.delta,m=p.rectDelta,b=[[i.start,l],[i.cur,f]],w=0;w<b.length;w++){var y=Oo(b[w],2),P=y[0],O=y[1];P.page.x-=O.x,P.page.y-=O.y,P.client.x-=O.x,P.client.y-=O.y}c.left-=m.left,c.right-=m.right,c.top-=m.top,c.bottom-=m.bottom}}},{key:"shouldDo",value:function(n,r,i,c){return!(!n||n.enabled===!1||c&&!n.endOnly||n.endOnly&&!r||i==="start"&&!n.setStart)}},{key:"copyFrom",value:function(n){this.startOffset=n.startOffset,this.startDelta=n.startDelta,this.edges=n.edges,this.states=n.states.map(function(r){return(0,Me.default)(r)}),this.result=_t((0,I.default)({},n.result.coords),(0,I.default)({},n.result.rect))}},{key:"destroy",value:function(){for(var n in this)this[n]=null}}])&&xi(t.prototype,o),e}();function _t(e,t){return{rect:t,coords:e,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function Co(e,t){return e?{left:t.x-e.left,top:t.y-e.top,right:e.right-t.x,bottom:e.bottom-t.y}:{left:0,top:0,right:0,bottom:0}}Oe.default=Si;var ee={};function Ct(e){var t=e.iEvent,o=e.interaction.modification.result;o&&(t.modifiers=o.eventProps)}Object.defineProperty(ee,"__esModule",{value:!0}),ee.makeModifier=function(e,t){var o=e.defaults,n={start:e.start,set:e.set,beforeEnd:e.beforeEnd,stop:e.stop},r=function(i){var c=i||{};for(var s in c.enabled=c.enabled!==!1,o)s in c||(c[s]=o[s]);var l={options:c,methods:n,name:t,enable:function(){return c.enabled=!0,l},disable:function(){return c.enabled=!1,l}};return l};return t&&typeof t=="string"&&(r._defaults=o,r._methods=n),r},ee.addEventModifiers=Ct,ee.default=void 0;var Pi={id:"modifiers/base",before:["actions"],install:function(e){e.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(e){var t=e.interaction;t.modification=new Oe.default(t)},"interactions:before-action-start":function(e){var t=e.interaction.modification;t.start(e,e.interaction.coords.start.page),e.interaction.edges=t.edges,t.applyToInteraction(e)},"interactions:before-action-move":function(e){return e.interaction.modification.setAndApply(e)},"interactions:before-action-end":function(e){return e.interaction.modification.beforeEnd(e)},"interactions:action-start":Ct,"interactions:action-move":Ct,"interactions:action-end":Ct,"interactions:after-action-start":function(e){return e.interaction.modification.restoreInteractionCoords(e)},"interactions:after-action-move":function(e){return e.interaction.modification.restoreInteractionCoords(e)},"interactions:stop":function(e){return e.interaction.modification.stop(e)}}};ee.default=Pi;var et={};Object.defineProperty(et,"__esModule",{value:!0}),et.defaults=void 0,et.defaults={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}};var tt={};function Lo(e){return(Lo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function ki(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Io(e,t){return(Io=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function Ti(e,t){return!t||Lo(t)!=="object"&&typeof t!="function"?Ao(e):t}function Ao(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function En(e){return(En=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}Object.defineProperty(tt,"__esModule",{value:!0}),tt.InteractEvent=void 0;var Do=function(e){(function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),l&&Io(s,l)})(c,e);var t,o,n,r,i=(n=c,r=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}(),function(){var s,l=En(n);if(r){var p=En(this).constructor;s=Reflect.construct(l,arguments,p)}else s=l.apply(this,arguments);return Ti(this,s)});function c(s,l,p,f,m,b,w){var y;(function(Z,N){if(!(Z instanceof N))throw new TypeError("Cannot call a class as a function")})(this,c),(y=i.call(this,s)).target=void 0,y.currentTarget=void 0,y.relatedTarget=null,y.screenX=void 0,y.screenY=void 0,y.button=void 0,y.buttons=void 0,y.ctrlKey=void 0,y.shiftKey=void 0,y.altKey=void 0,y.metaKey=void 0,y.page=void 0,y.client=void 0,y.delta=void 0,y.rect=void 0,y.x0=void 0,y.y0=void 0,y.t0=void 0,y.dt=void 0,y.duration=void 0,y.clientX0=void 0,y.clientY0=void 0,y.velocity=void 0,y.speed=void 0,y.swipe=void 0,y.timeStamp=void 0,y.axes=void 0,y.preEnd=void 0,m=m||s.element;var P=s.interactable,O=(P&&P.options||et.defaults).deltaSource,x=(0,ke.default)(P,m,p),C=f==="start",j=f==="end",F=C?Ao(y):s.prevEvent,X=C?s.coords.start:j?{page:F.page,client:F.client,timeStamp:s.coords.cur.timeStamp}:s.coords.cur;return y.page=(0,I.default)({},X.page),y.client=(0,I.default)({},X.client),y.rect=(0,I.default)({},s.rect),y.timeStamp=X.timeStamp,j||(y.page.x-=x.x,y.page.y-=x.y,y.client.x-=x.x,y.client.y-=x.y),y.ctrlKey=l.ctrlKey,y.altKey=l.altKey,y.shiftKey=l.shiftKey,y.metaKey=l.metaKey,y.button=l.button,y.buttons=l.buttons,y.target=m,y.currentTarget=m,y.preEnd=b,y.type=w||p+(f||""),y.interactable=P,y.t0=C?s.pointers[s.pointers.length-1].downTime:F.t0,y.x0=s.coords.start.page.x-x.x,y.y0=s.coords.start.page.y-x.y,y.clientX0=s.coords.start.client.x-x.x,y.clientY0=s.coords.start.client.y-x.y,y.delta=C||j?{x:0,y:0}:{x:y[O].x-F[O].x,y:y[O].y-F[O].y},y.dt=s.coords.delta.timeStamp,y.duration=y.timeStamp-y.t0,y.velocity=(0,I.default)({},s.coords.velocity[O]),y.speed=(0,we.default)(y.velocity.x,y.velocity.y),y.swipe=j||f==="inertiastart"?y.getSwipe():null,y}return t=c,(o=[{key:"getSwipe",value:function(){var s=this._interaction;if(s.prevEvent.speed<600||this.timeStamp-s.prevEvent.timeStamp>150)return null;var l=180*Math.atan2(s.prevEvent.velocityY,s.prevEvent.velocityX)/Math.PI;l<0&&(l+=360);var p=112.5<=l&&l<247.5,f=202.5<=l&&l<337.5;return{up:f,down:!f&&22.5<=l&&l<157.5,left:p,right:!p&&(292.5<=l||l<67.5),angle:l,speed:s.prevEvent.speed,velocity:{x:s.prevEvent.velocityX,y:s.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}])&&ki(t.prototype,o),c}(je.BaseEvent);tt.InteractEvent=Do,Object.defineProperties(Do.prototype,{pageX:{get:function(){return this.page.x},set:function(e){this.page.x=e}},pageY:{get:function(){return this.page.y},set:function(e){this.page.y=e}},clientX:{get:function(){return this.client.x},set:function(e){this.client.x=e}},clientY:{get:function(){return this.client.y},set:function(e){this.client.y=e}},dx:{get:function(){return this.delta.x},set:function(e){this.delta.x=e}},dy:{get:function(){return this.delta.y},set:function(e){this.delta.y=e}},velocityX:{get:function(){return this.velocity.x},set:function(e){this.velocity.x=e}},velocityY:{get:function(){return this.velocity.y},set:function(e){this.velocity.y=e}}});var nt={};Object.defineProperty(nt,"__esModule",{value:!0}),nt.PointerInfo=void 0,nt.PointerInfo=function e(t,o,n,r,i){(function(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")})(this,e),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=o,this.event=n,this.downTime=r,this.downTarget=i};var Lt,It,ie={};function Mi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(ie,"__esModule",{value:!0}),Object.defineProperty(ie,"PointerInfo",{enumerable:!0,get:function(){return nt.PointerInfo}}),ie.default=ie.Interaction=ie._ProxyMethods=ie._ProxyValues=void 0,ie._ProxyValues=Lt,function(e){e.interactable="",e.element="",e.prepared="",e.pointerIsDown="",e.pointerWasMoved="",e._proxy=""}(Lt||(ie._ProxyValues=Lt={})),ie._ProxyMethods=It,function(e){e.start="",e.move="",e.end="",e.stop="",e.interacting=""}(It||(ie._ProxyMethods=It={}));var Oi=0,jo=function(){function e(n){var r=this,i=n.pointerType,c=n.scopeFire;(function(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")})(this,e),this.interactable=null,this.element=null,this.rect=void 0,this._rects=void 0,this.edges=void 0,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=null,this.simulation=null,this.doMove=(0,ae.warnOnce)(function(b){this.move(b)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:L.newCoords(),prev:L.newCoords(),cur:L.newCoords(),delta:L.newCoords(),velocity:L.newCoords()},this._id=Oi++,this._scopeFire=c,this.pointerType=i;var s=this;this._proxy={};var l=function(b){Object.defineProperty(r._proxy,b,{get:function(){return s[b]}})};for(var p in Lt)l(p);var f=function(b){Object.defineProperty(r._proxy,b,{value:function(){return s[b].apply(s,arguments)}})};for(var m in It)f(m);this._scopeFire("interactions:new",{interaction:this})}var t,o;return t=e,(o=[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(n,r,i){var c=this.updatePointer(n,r,i,!0),s=this.pointers[c];this._scopeFire("interactions:down",{pointer:n,event:r,eventTarget:i,pointerIndex:c,pointerInfo:s,type:"down",interaction:this})}},{key:"start",value:function(n,r,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(n.name==="gesture"?2:1)||!r.options[n.name].enabled)&&((0,ae.copyAction)(this.prepared,n),this.interactable=r,this.element=i,this.rect=r.getRect(i),this.edges=this.prepared.edges?(0,I.default)({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(n,r,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(n,r,i,!1);var c,s,l=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(c=this.coords.cur.client.x-this.coords.start.client.x,s=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=(0,we.default)(c,s)>this.pointerMoveTolerance);var p=this.getPointerIndex(n),f={pointer:n,pointerIndex:p,pointerInfo:this.pointers[p],event:r,type:"move",eventTarget:i,dx:c,dy:s,duplicate:l,interaction:this};l||L.setCoordVelocity(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",f),l||this.simulation||(this.interacting()&&(f.type=null,this.move(f)),this.pointerWasMoved&&L.copyCoords(this.coords.prev,this.coords.cur))}},{key:"move",value:function(n){n&&n.event||L.setZeroCoords(this.coords.delta),(n=(0,I.default)({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},n||{})).phase="move",this._doPhase(n)}},{key:"pointerUp",value:function(n,r,i,c){var s=this.getPointerIndex(n);s===-1&&(s=this.updatePointer(n,r,i,!1));var l=/cancel$/i.test(r.type)?"cancel":"up";this._scopeFire("interactions:".concat(l),{pointer:n,pointerIndex:s,pointerInfo:this.pointers[s],event:r,eventTarget:i,type:l,curEventTarget:c,interaction:this}),this.simulation||this.end(r),this.removePointer(n,r)}},{key:"documentBlur",value:function(n){this.end(n),this._scopeFire("interactions:blur",{event:n,type:"blur",interaction:this})}},{key:"end",value:function(n){var r;this._ending=!0,n=n||this._latestPointer.event,this.interacting()&&(r=this._doPhase({event:n,interaction:this,phase:"end"})),this._ending=!1,r===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(n){var r=L.getPointerId(n);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:K.findIndex(this.pointers,function(i){return i.id===r})}},{key:"getPointerInfo",value:function(n){return this.pointers[this.getPointerIndex(n)]}},{key:"updatePointer",value:function(n,r,i,c){var s=L.getPointerId(n),l=this.getPointerIndex(n),p=this.pointers[l];return c=c!==!1&&(c||/(down|start)$/i.test(r.type)),p?p.pointer=n:(p=new nt.PointerInfo(s,n,r,null,null),l=this.pointers.length,this.pointers.push(p)),L.setCoords(this.coords.cur,this.pointers.map(function(f){return f.pointer}),this._now()),L.setCoordDeltas(this.coords.delta,this.coords.prev,this.coords.cur),c&&(this.pointerIsDown=!0,p.downTime=this.coords.cur.timeStamp,p.downTarget=i,L.pointerExtend(this.downPointer,n),this.interacting()||(L.copyCoords(this.coords.start,this.coords.cur),L.copyCoords(this.coords.prev,this.coords.cur),this.downEvent=r,this.pointerWasMoved=!1)),this._updateLatestPointer(n,r,i),this._scopeFire("interactions:update-pointer",{pointer:n,event:r,eventTarget:i,down:c,pointerInfo:p,pointerIndex:l,interaction:this}),l}},{key:"removePointer",value:function(n,r){var i=this.getPointerIndex(n);if(i!==-1){var c=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:n,event:r,eventTarget:null,pointerIndex:i,pointerInfo:c,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(n,r,i){this._latestPointer.pointer=n,this._latestPointer.event=r,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(n,r,i,c){return new tt.InteractEvent(this,n,this.prepared.name,r,this.element,i,c)}},{key:"_fireEvent",value:function(n){this.interactable.fire(n),(!this.prevEvent||n.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=n)}},{key:"_doPhase",value:function(n){var r=n.event,i=n.phase,c=n.preEnd,s=n.type,l=this.rect;if(l&&i==="move"&&(G.addEdges(this.edges,l,this.coords.delta[this.interactable.options.deltaSource]),l.width=l.right-l.left,l.height=l.bottom-l.top),this._scopeFire("interactions:before-action-".concat(i),n)===!1)return!1;var p=n.iEvent=this._createPreparedEvent(r,i,c,s);return this._scopeFire("interactions:action-".concat(i),n),i==="start"&&(this.prevEvent=p),this._fireEvent(p),this._scopeFire("interactions:after-action-".concat(i),n),!0}},{key:"_now",value:function(){return Date.now()}}])&&Mi(t.prototype,o),e}();ie.Interaction=jo;var _i=jo;ie.default=_i;var _e={};function Ho(e){e.pointerIsDown&&(Sn(e.coords.cur,e.offset.total),e.offset.pending.x=0,e.offset.pending.y=0)}function Ro(e){xn(e.interaction)}function xn(e){if(!function(o){return!(!o.offset.pending.x&&!o.offset.pending.y)}(e))return!1;var t=e.offset.pending;return Sn(e.coords.cur,t),Sn(e.coords.delta,t),G.addEdges(e.edges,e.rect,t),t.x=0,t.y=0,!0}function Ci(e){var t=e.x,o=e.y;this.offset.pending.x+=t,this.offset.pending.y+=o,this.offset.total.x+=t,this.offset.total.y+=o}function Sn(e,t){var o=e.page,n=e.client,r=t.x,i=t.y;o.x+=r,o.y+=i,n.x+=r,n.y+=i}Object.defineProperty(_e,"__esModule",{value:!0}),_e.addTotal=Ho,_e.applyPending=xn,_e.default=void 0,ie._ProxyMethods.offsetBy="";var Li={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(e){e.Interaction.prototype.offsetBy=Ci},listeners:{"interactions:new":function(e){e.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(e){return Ho(e.interaction)},"interactions:before-action-start":Ro,"interactions:before-action-move":Ro,"interactions:before-action-end":function(e){var t=e.interaction;if(xn(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(e){var t=e.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}};_e.default=Li;var We={};function Ii(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(We,"__esModule",{value:!0}),We.default=We.InertiaState=void 0;var zo=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=n}var t,o;return t=e,(o=[{key:"start",value:function(n){var r=this.interaction,i=At(r);if(!i||!i.enabled)return!1;var c=r.coords.velocity.client,s=(0,we.default)(c.x,c.y),l=this.modification||(this.modification=new Oe.default(r));if(l.copyFrom(r.modification),this.t0=r._now(),this.allowResume=i.allowResume,this.v0=s,this.currentOffset={x:0,y:0},this.startCoords=r.coords.cur.page,this.modifierArg=l.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-r.coords.cur.timeStamp<50&&s>i.minSpeed&&s>i.endSpeed)this.startInertia();else{if(l.result=l.setAll(this.modifierArg),!l.result.changed)return!1;this.startSmoothEnd()}return r.modification.result.rect=null,r.offsetBy(this.targetOffset),r._doPhase({interaction:r,event:n,phase:"inertiastart"}),r.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),r.modification.result.rect=null,this.active=!0,r.simulation=this,!0}},{key:"startInertia",value:function(){var n=this,r=this.interaction.coords.velocity.client,i=At(this.interaction),c=i.resistance,s=-Math.log(i.endSpeed/this.v0)/c;this.targetOffset={x:(r.x-s)/c,y:(r.y-s)/c},this.te=s,this.lambda_v0=c/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var l=this.modification,p=this.modifierArg;p.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},l.result=l.setAll(p),l.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+l.result.delta.x,y:this.targetOffset.y+l.result.delta.y}),this.onNextFrame(function(){return n.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var n=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return n.smoothEndTick()})}},{key:"onNextFrame",value:function(n){var r=this;this.timeout=de.default.request(function(){r.active&&n()})}},{key:"inertiaTick",value:function(){var n,r,i,c,s,l=this,p=this.interaction,f=At(p).resistance,m=(p._now()-this.t0)/1e3;if(m<this.te){var b,w=1-(Math.exp(-f*m)-this.lambda_v0)/this.one_ve_v0;this.isModified?(n=this.targetOffset.x,r=this.targetOffset.y,i=this.modifiedOffset.x,c=this.modifiedOffset.y,b={x:Wo(s=w,0,n,i),y:Wo(s,0,r,c)}):b={x:this.targetOffset.x*w,y:this.targetOffset.y*w};var y={x:b.x-this.currentOffset.x,y:b.y-this.currentOffset.y};this.currentOffset.x+=y.x,this.currentOffset.y+=y.y,p.offsetBy(y),p.move(),this.onNextFrame(function(){return l.inertiaTick()})}else p.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var n=this,r=this.interaction,i=r._now()-this.t0,c=At(r).smoothEndDuration;if(i<c){var s={x:Fo(i,0,this.targetOffset.x,c),y:Fo(i,0,this.targetOffset.y,c)},l={x:s.x-this.currentOffset.x,y:s.y-this.currentOffset.y};this.currentOffset.x+=l.x,this.currentOffset.y+=l.y,r.offsetBy(l),r.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return n.smoothEndTick()})}else r.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(n){var r=n.pointer,i=n.event,c=n.eventTarget,s=this.interaction;s.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),s.updatePointer(r,i,c,!0),s._doPhase({interaction:s,event:i,phase:"resume"}),(0,L.copyCoords)(s.coords.prev,s.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,de.default.cancel(this.timeout)}}])&&Ii(t.prototype,o),e}();function At(e){var t=e.interactable,o=e.prepared;return t&&t.options&&o.name&&t.options[o.name].inertia}function Wo(e,t,o,n){var r=1-e;return r*r*t+2*r*e*o+e*e*n}function Fo(e,t,o,n){return-o*(e/=n)*(e-2)+t}We.InertiaState=zo;var Ai={id:"inertia",before:["modifiers","actions"],install:function(e){var t=e.defaults;e.usePlugin(_e.default),e.usePlugin(ee.default),e.actions.phases.inertiastart=!0,e.actions.phases.resume=!0,t.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(e){var t=e.interaction;t.inertia=new zo(t)},"interactions:before-action-end":function(e){var t=e.interaction,o=e.event;return(!t._interacting||t.simulation||!t.inertia.start(o))&&null},"interactions:down":function(e){var t=e.interaction,o=e.eventTarget,n=t.inertia;if(n.active)for(var r=o;d.default.element(r);){if(r===t.element){n.resume(e);break}r=A.parentNode(r)}},"interactions:stop":function(e){var t=e.interaction.inertia;t.active&&t.stop()},"interactions:before-action-resume":function(e){var t=e.interaction.modification;t.stop(e),t.start(e,e.interaction.coords.cur.page),t.applyToInteraction(e)},"interactions:before-action-inertiastart":function(e){return e.interaction.modification.setAndApply(e)},"interactions:action-resume":ee.addEventModifiers,"interactions:action-inertiastart":ee.addEventModifiers,"interactions:after-action-inertiastart":function(e){return e.interaction.modification.restoreInteractionCoords(e)},"interactions:after-action-resume":function(e){return e.interaction.modification.restoreInteractionCoords(e)}}};We.default=Ai;var ot={};function Di(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vo(e,t){for(var o=0;o<t.length;o++){var n=t[o];if(e.immediatePropagationStopped)break;n(e)}}Object.defineProperty(ot,"__esModule",{value:!0}),ot.Eventable=void 0;var ji=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=(0,I.default)({},n||{})}var t,o;return t=e,(o=[{key:"fire",value:function(n){var r,i=this.global;(r=this.types[n.type])&&Vo(n,r),!n.propagationStopped&&i&&(r=i[n.type])&&Vo(n,r)}},{key:"on",value:function(n,r){var i=(0,De.default)(n,r);for(n in i)this.types[n]=K.merge(this.types[n]||[],i[n])}},{key:"off",value:function(n,r){var i=(0,De.default)(n,r);for(n in i){var c=this.types[n];if(c&&c.length)for(var s=0;s<i[n].length;s++){var l=i[n][s],p=c.indexOf(l);p!==-1&&c.splice(p,1)}}}},{key:"getRect",value:function(n){return null}}])&&Di(t.prototype,o),e}();ot.Eventable=ji;var rt={};Object.defineProperty(rt,"__esModule",{value:!0}),rt.default=function(e,t){if(t.phaselessTypes[e])return!0;for(var o in t.map)if(e.indexOf(o)===0&&e.substr(o.length)in t.phases)return!0;return!1};var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.createInteractStatic=function(e){var t=function o(n,r){var i=e.interactables.get(n,r);return i||((i=e.interactables.new(n,r)).events.global=o.globalEvents),i};return t.getPointerAverage=L.pointerAverage,t.getTouchBBox=L.touchBBox,t.getTouchDistance=L.touchDistance,t.getTouchAngle=L.touchAngle,t.getElementRect=A.getElementRect,t.getElementClientRect=A.getElementClientRect,t.matchesSelector=A.matchesSelector,t.closest=A.closest,t.globalEvents={},t.version="1.10.11",t.scope=e,t.use=function(o,n){return this.scope.usePlugin(o,n),this},t.isSet=function(o,n){return!!this.scope.interactables.get(o,n&&n.context)},t.on=(0,ae.warnOnce)(function(o,n,r){if(d.default.string(o)&&o.search(" ")!==-1&&(o=o.trim().split(/ +/)),d.default.array(o)){for(var i=0;i<o.length;i++){var c=o[i];this.on(c,n,r)}return this}if(d.default.object(o)){for(var s in o)this.on(s,o[s],n);return this}return(0,rt.default)(o,this.scope.actions)?this.globalEvents[o]?this.globalEvents[o].push(n):this.globalEvents[o]=[n]:this.scope.events.add(this.scope.document,o,n,{options:r}),this},"The interact.on() method is being deprecated"),t.off=(0,ae.warnOnce)(function(o,n,r){if(d.default.string(o)&&o.search(" ")!==-1&&(o=o.trim().split(/ +/)),d.default.array(o)){for(var i=0;i<o.length;i++){var c=o[i];this.off(c,n,r)}return this}if(d.default.object(o)){for(var s in o)this.off(s,o[s],n);return this}var l;return(0,rt.default)(o,this.scope.actions)?o in this.globalEvents&&(l=this.globalEvents[o].indexOf(n))!==-1&&this.globalEvents[o].splice(l,1):this.scope.events.remove(this.scope.document,o,n,r),this},"The interact.off() method is being deprecated"),t.debug=function(){return this.scope},t.supportsTouch=function(){return $.default.supportsTouch},t.supportsPointerEvent=function(){return $.default.supportsPointerEvent},t.stop=function(){for(var o=0;o<this.scope.interactions.list.length;o++)this.scope.interactions.list[o].stop();return this},t.pointerMoveTolerance=function(o){return d.default.number(o)?(this.scope.interactions.pointerMoveTolerance=o,this):this.scope.interactions.pointerMoveTolerance},t.addDocument=function(o,n){this.scope.addDocument(o,n)},t.removeDocument=function(o){this.scope.removeDocument(o)},t};var Dt={};function Hi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Interactable=void 0;var Ri=function(){function e(n,r,i,c){(function(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")})(this,e),this.options=void 0,this._actions=void 0,this.target=void 0,this.events=new ot.Eventable,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._rectChecker=void 0,this._actions=r.actions,this.target=n,this._context=r.context||i,this._win=(0,a.getWindow)((0,A.trySelector)(n)?this._context:n),this._doc=this._win.document,this._scopeEvents=c,this.set(r)}var t,o;return t=e,(o=[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(n,r){return d.default.func(r.onstart)&&this.on("".concat(n,"start"),r.onstart),d.default.func(r.onmove)&&this.on("".concat(n,"move"),r.onmove),d.default.func(r.onend)&&this.on("".concat(n,"end"),r.onend),d.default.func(r.oninertiastart)&&this.on("".concat(n,"inertiastart"),r.oninertiastart),this}},{key:"updatePerActionListeners",value:function(n,r,i){(d.default.array(r)||d.default.object(r))&&this.off(n,r),(d.default.array(i)||d.default.object(i))&&this.on(n,i)}},{key:"setPerAction",value:function(n,r){var i=this._defaults;for(var c in r){var s=c,l=this.options[n],p=r[s];s==="listeners"&&this.updatePerActionListeners(n,l.listeners,p),d.default.array(p)?l[s]=K.from(p):d.default.plainObject(p)?(l[s]=(0,I.default)(l[s]||{},(0,Me.default)(p)),d.default.object(i.perAction[s])&&"enabled"in i.perAction[s]&&(l[s].enabled=p.enabled!==!1)):d.default.bool(p)&&d.default.object(i.perAction[s])?l[s].enabled=p:l[s]=p}}},{key:"getRect",value:function(n){return n=n||(d.default.element(this.target)?this.target:null),d.default.string(this.target)&&(n=n||this._context.querySelector(this.target)),(0,A.getElementRect)(n)}},{key:"rectChecker",value:function(n){var r=this;return d.default.func(n)?(this._rectChecker=n,this.getRect=function(i){var c=(0,I.default)({},r._rectChecker(i));return"width"in c||(c.width=c.right-c.left,c.height=c.bottom-c.top),c},this):n===null?(delete this.getRect,delete this._rectChecker,this):this.getRect}},{key:"_backCompatOption",value:function(n,r){if((0,A.trySelector)(r)||d.default.object(r)){for(var i in this.options[n]=r,this._actions.map)this.options[i][n]=r;return this}return this.options[n]}},{key:"origin",value:function(n){return this._backCompatOption("origin",n)}},{key:"deltaSource",value:function(n){return n==="page"||n==="client"?(this.options.deltaSource=n,this):this.options.deltaSource}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(n){return this._context===n.ownerDocument||(0,A.nodeContains)(this._context,n)}},{key:"testIgnoreAllow",value:function(n,r,i){return!this.testIgnore(n.ignoreFrom,r,i)&&this.testAllow(n.allowFrom,r,i)}},{key:"testAllow",value:function(n,r,i){return!n||!!d.default.element(i)&&(d.default.string(n)?(0,A.matchesUpTo)(i,n,r):!!d.default.element(n)&&(0,A.nodeContains)(n,i))}},{key:"testIgnore",value:function(n,r,i){return!(!n||!d.default.element(i))&&(d.default.string(n)?(0,A.matchesUpTo)(i,n,r):!!d.default.element(n)&&(0,A.nodeContains)(n,i))}},{key:"fire",value:function(n){return this.events.fire(n),this}},{key:"_onOff",value:function(n,r,i,c){d.default.object(r)&&!d.default.array(r)&&(c=i,i=null);var s=n==="on"?"add":"remove",l=(0,De.default)(r,i);for(var p in l){p==="wheel"&&(p=$.default.wheelEvent);for(var f=0;f<l[p].length;f++){var m=l[p][f];(0,rt.default)(p,this._actions)?this.events[n](p,m):d.default.string(this.target)?this._scopeEvents["".concat(s,"Delegate")](this.target,this._context,p,m,c):this._scopeEvents[s](this.target,p,m,c)}}return this}},{key:"on",value:function(n,r,i){return this._onOff("on",n,r,i)}},{key:"off",value:function(n,r,i){return this._onOff("off",n,r,i)}},{key:"set",value:function(n){var r=this._defaults;for(var i in d.default.object(n)||(n={}),this.options=(0,Me.default)(r.base),this._actions.methodDict){var c=i,s=this._actions.methodDict[c];this.options[c]={},this.setPerAction(c,(0,I.default)((0,I.default)({},r.perAction),r.actions[c])),this[s](n[c])}for(var l in n)d.default.func(this[l])&&this[l](n[l]);return this}},{key:"unset",value:function(){if(d.default.string(this.target))for(var n in this._scopeEvents.delegatedEvents)for(var r=this._scopeEvents.delegatedEvents[n],i=r.length-1;i>=0;i--){var c=r[i],s=c.selector,l=c.context,p=c.listeners;s===this.target&&l===this._context&&r.splice(i,1);for(var f=p.length-1;f>=0;f--)this._scopeEvents.removeDelegate(this.target,this._context,n,p[f][0],p[f][1])}else this._scopeEvents.remove(this.target,"all")}}])&&Hi(t.prototype,o),e}();Dt.Interactable=Ri;var jt={};function zi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(jt,"__esModule",{value:!0}),jt.InteractableSet=void 0;var Wi=function(){function e(n){var r=this;(function(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")})(this,e),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=n,n.addListeners({"interactable:unset":function(i){var c=i.interactable,s=c.target,l=c._context,p=d.default.string(s)?r.selectorMap[s]:s[r.scope.id],f=K.findIndex(p,function(m){return m.context===l});p[f]&&(p[f].context=null,p[f].interactable=null),p.splice(f,1)}})}var t,o;return t=e,(o=[{key:"new",value:function(n,r){r=(0,I.default)(r||{},{actions:this.scope.actions});var i=new this.scope.Interactable(n,r,this.scope.document,this.scope.events),c={context:i._context,interactable:i};return this.scope.addDocument(i._doc),this.list.push(i),d.default.string(n)?(this.selectorMap[n]||(this.selectorMap[n]=[]),this.selectorMap[n].push(c)):(i.target[this.scope.id]||Object.defineProperty(n,this.scope.id,{value:[],configurable:!0}),n[this.scope.id].push(c)),this.scope.fire("interactable:new",{target:n,options:r,interactable:i,win:this.scope._win}),i}},{key:"get",value:function(n,r){var i=r&&r.context||this.scope.document,c=d.default.string(n),s=c?this.selectorMap[n]:n[this.scope.id];if(!s)return null;var l=K.find(s,function(p){return p.context===i&&(c||p.interactable.inContext(n))});return l&&l.interactable}},{key:"forEachMatch",value:function(n,r){for(var i=0;i<this.list.length;i++){var c=this.list[i],s=void 0;if((d.default.string(c.target)?d.default.element(n)&&A.matchesSelector(n,c.target):n===c.target)&&c.inContext(n)&&(s=r(c)),s!==void 0)return s}}}])&&zi(t.prototype,o),e}();jt.InteractableSet=Wi;var Ht={};function Fi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function kn(e,t){return function(o){if(Array.isArray(o))return o}(e)||function(o,n){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(o)){var r=[],i=!0,c=!1,s=void 0;try{for(var l,p=o[Symbol.iterator]();!(i=(l=p.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(f){c=!0,s=f}finally{try{i||p.return==null||p.return()}finally{if(c)throw s}}return r}}(e,t)||function(o,n){if(o){if(typeof o=="string")return Bo(o,n);var r=Object.prototype.toString.call(o).slice(8,-1);return r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set"?Array.from(o):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bo(o,n):void 0}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Bo(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=void 0;var Vi=function(){function e(n){(function(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")})(this,e),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=n,(0,Ze.default)(this,n)}var t,o;return t=e,(o=[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}])&&Fi(t.prototype,o),e}();function it(e){if(!d.default.object(e))return{capture:!!e,passive:!1};var t=(0,I.default)({},e);return t.capture=!!e.capture,t.passive=!!e.passive,t}var Bi={id:"events",install:function(e){var t,o=[],n={},r=[],i={add:c,remove:s,addDelegate:function(f,m,b,w,y){var P=it(y);if(!n[b]){n[b]=[];for(var O=0;O<r.length;O++){var x=r[O];c(x,b,l),c(x,b,p,!0)}}var C=n[b],j=K.find(C,function(F){return F.selector===f&&F.context===m});j||(j={selector:f,context:m,listeners:[]},C.push(j)),j.listeners.push([w,P])},removeDelegate:function(f,m,b,w,y){var P,O=it(y),x=n[b],C=!1;if(x)for(P=x.length-1;P>=0;P--){var j=x[P];if(j.selector===f&&j.context===m){for(var F=j.listeners,X=F.length-1;X>=0;X--){var Z=kn(F[X],2),N=Z[0],Y=Z[1],ue=Y.capture,ye=Y.passive;if(N===w&&ue===O.capture&&ye===O.passive){F.splice(X,1),F.length||(x.splice(P,1),s(m,b,l),s(m,b,p,!0)),C=!0;break}}if(C)break}}},delegateListener:l,delegateUseCapture:p,delegatedEvents:n,documents:r,targets:o,supportsOptions:!1,supportsPassive:!1};function c(f,m,b,w){var y=it(w),P=K.find(o,function(O){return O.eventTarget===f});P||(P={eventTarget:f,events:{}},o.push(P)),P.events[m]||(P.events[m]=[]),f.addEventListener&&!K.contains(P.events[m],b)&&(f.addEventListener(m,b,i.supportsOptions?y:y.capture),P.events[m].push(b))}function s(f,m,b,w){var y=it(w),P=K.findIndex(o,function(X){return X.eventTarget===f}),O=o[P];if(O&&O.events)if(m!=="all"){var x=!1,C=O.events[m];if(C){if(b==="all"){for(var j=C.length-1;j>=0;j--)s(f,m,C[j],y);return}for(var F=0;F<C.length;F++)if(C[F]===b){f.removeEventListener(m,b,i.supportsOptions?y:y.capture),C.splice(F,1),C.length===0&&(delete O.events[m],x=!0);break}}x&&!Object.keys(O.events).length&&o.splice(P,1)}else for(m in O.events)O.events.hasOwnProperty(m)&&s(f,m,"all")}function l(f,m){for(var b=it(m),w=new Vi(f),y=n[f.type],P=kn(L.getEventTargets(f),1)[0],O=P;d.default.element(O);){for(var x=0;x<y.length;x++){var C=y[x],j=C.selector,F=C.context;if(A.matchesSelector(O,j)&&A.nodeContains(F,P)&&A.nodeContains(F,O)){var X=C.listeners;w.currentTarget=O;for(var Z=0;Z<X.length;Z++){var N=kn(X[Z],2),Y=N[0],ue=N[1],ye=ue.capture,Wn=ue.passive;ye===b.capture&&Wn===b.passive&&Y(w)}}}O=A.parentNode(O)}}function p(f){return l(f,!0)}return(t=e.document)==null||t.createElement("div").addEventListener("test",null,{get capture(){return i.supportsOptions=!0},get passive(){return i.supportsPassive=!0}}),e.events=i,i}};Ht.default=Bi;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=void 0;var zt={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(e){for(var t=0;t<zt.methodOrder.length;t++){var o;o=zt.methodOrder[t];var n=zt[o](e);if(n)return n}return null},simulationResume:function(e){var t=e.pointerType,o=e.eventType,n=e.eventTarget,r=e.scope;if(!/down|start/i.test(o))return null;for(var i=0;i<r.interactions.list.length;i++){var c=r.interactions.list[i],s=n;if(c.simulation&&c.simulation.allowResume&&c.pointerType===t)for(;s;){if(s===c.element)return c;s=A.parentNode(s)}}return null},mouseOrPen:function(e){var t,o=e.pointerId,n=e.pointerType,r=e.eventType,i=e.scope;if(n!=="mouse"&&n!=="pen")return null;for(var c=0;c<i.interactions.list.length;c++){var s=i.interactions.list[c];if(s.pointerType===n){if(s.simulation&&!No(s,o))continue;if(s.interacting())return s;t||(t=s)}}if(t)return t;for(var l=0;l<i.interactions.list.length;l++){var p=i.interactions.list[l];if(!(p.pointerType!==n||/down/i.test(r)&&p.simulation))return p}return null},hasPointer:function(e){for(var t=e.pointerId,o=e.scope,n=0;n<o.interactions.list.length;n++){var r=o.interactions.list[n];if(No(r,t))return r}return null},idle:function(e){for(var t=e.pointerType,o=e.scope,n=0;n<o.interactions.list.length;n++){var r=o.interactions.list[n];if(r.pointers.length===1){var i=r.interactable;if(i&&(!i.options.gesture||!i.options.gesture.enabled))continue}else if(r.pointers.length>=2)continue;if(!r.interacting()&&t===r.pointerType)return r}return null}};function No(e,t){return e.pointers.some(function(o){return o.id===t})}var Ni=zt;Rt.default=Ni;var Wt={};function qo(e){return(qo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function Xo(e,t){return function(o){if(Array.isArray(o))return o}(e)||function(o,n){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(o)){var r=[],i=!0,c=!1,s=void 0;try{for(var l,p=o[Symbol.iterator]();!(i=(l=p.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(f){c=!0,s=f}finally{try{i||p.return==null||p.return()}finally{if(c)throw s}}return r}}(e,t)||function(o,n){if(o){if(typeof o=="string")return Yo(o,n);var r=Object.prototype.toString.call(o).slice(8,-1);return r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set"?Array.from(o):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Yo(o,n):void 0}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Yo(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}function qi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xi(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Uo(e,t){return(Uo=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function Yi(e,t){return!t||qo(t)!=="object"&&typeof t!="function"?function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(e):t}function Tn(e){return(Tn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.default=void 0;var Mn=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ko(e,t){return function(o){var n=t.interactions.list,r=L.getPointerType(o),i=Xo(L.getEventTargets(o),2),c=i[0],s=i[1],l=[];if(/^touch/.test(o.type)){t.prevTouchTime=t.now();for(var p=0;p<o.changedTouches.length;p++){var f=o.changedTouches[p],m={pointer:f,pointerId:L.getPointerId(f),pointerType:r,eventType:o.type,eventTarget:c,curEventTarget:s,scope:t},b=$o(m);l.push([m.pointer,m.eventTarget,m.curEventTarget,b])}}else{var w=!1;if(!$.default.supportsPointerEvent&&/mouse/.test(o.type)){for(var y=0;y<n.length&&!w;y++)w=n[y].pointerType!=="mouse"&&n[y].pointerIsDown;w=w||t.now()-t.prevTouchTime<500||o.timeStamp===0}if(!w){var P={pointer:o,pointerId:L.getPointerId(o),pointerType:r,eventType:o.type,curEventTarget:s,eventTarget:c,scope:t},O=$o(P);l.push([P.pointer,P.eventTarget,P.curEventTarget,O])}}for(var x=0;x<l.length;x++){var C=Xo(l[x],4),j=C[0],F=C[1],X=C[2];C[3][e](j,o,F,X)}}}function $o(e){var t=e.pointerType,o=e.scope,n={interaction:Rt.default.search(e),searchDetails:e};return o.fire("interactions:find",n),n.interaction||o.interactions.new({pointerType:t})}function On(e,t){var o=e.doc,n=e.scope,r=e.options,i=n.interactions.docEvents,c=n.events,s=c[t];for(var l in n.browser.isIOS&&!r.events&&(r.events={passive:!1}),c.delegatedEvents)s(o,l,c.delegateListener),s(o,l,c.delegateUseCapture,!0);for(var p=r&&r.events,f=0;f<i.length;f++){var m=i[f];s(o,m.type,m.listener,p)}}var Ui={id:"core/interactions",install:function(e){for(var t={},o=0;o<Mn.length;o++){var n=Mn[o];t[n]=Ko(n,e)}var r,i=$.default.pEventTypes;function c(){for(var s=0;s<e.interactions.list.length;s++){var l=e.interactions.list[s];if(l.pointerIsDown&&l.pointerType==="touch"&&!l._interacting)for(var p=function(){var m=l.pointers[f];e.documents.some(function(b){var w=b.doc;return(0,A.nodeContains)(w,m.downTarget)})||l.removePointer(m.pointer,m.event)},f=0;f<l.pointers.length;f++)p()}}(r=D.default.PointerEvent?[{type:i.down,listener:c},{type:i.down,listener:t.pointerDown},{type:i.move,listener:t.pointerMove},{type:i.up,listener:t.pointerUp},{type:i.cancel,listener:t.pointerUp}]:[{type:"mousedown",listener:t.pointerDown},{type:"mousemove",listener:t.pointerMove},{type:"mouseup",listener:t.pointerUp},{type:"touchstart",listener:c},{type:"touchstart",listener:t.pointerDown},{type:"touchmove",listener:t.pointerMove},{type:"touchend",listener:t.pointerUp},{type:"touchcancel",listener:t.pointerUp}]).push({type:"blur",listener:function(s){for(var l=0;l<e.interactions.list.length;l++)e.interactions.list[l].documentBlur(s)}}),e.prevTouchTime=0,e.Interaction=function(s){(function(y,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(P&&P.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),P&&Uo(y,P)})(w,s);var l,p,f,m,b=(f=w,m=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(y){return!1}}(),function(){var y,P=Tn(f);if(m){var O=Tn(this).constructor;y=Reflect.construct(P,arguments,O)}else y=P.apply(this,arguments);return Yi(this,y)});function w(){return qi(this,w),b.apply(this,arguments)}return l=w,(p=[{key:"pointerMoveTolerance",get:function(){return e.interactions.pointerMoveTolerance},set:function(y){e.interactions.pointerMoveTolerance=y}},{key:"_now",value:function(){return e.now()}}])&&Xi(l.prototype,p),w}(ie.default),e.interactions={list:[],new:function(s){s.scopeFire=function(p,f){return e.fire(p,f)};var l=new e.Interaction(s);return e.interactions.list.push(l),l},listeners:t,docEvents:r,pointerMoveTolerance:1},e.usePlugin(Re.default)},listeners:{"scope:add-document":function(e){return On(e,"add")},"scope:remove-document":function(e){return On(e,"remove")},"interactable:unset":function(e,t){for(var o=e.interactable,n=t.interactions.list.length-1;n>=0;n--){var r=t.interactions.list[n];r.interactable===o&&(r.stop(),t.fire("interactions:destroy",{interaction:r}),r.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(n,1))}}},onDocSignal:On,doOnInteractions:Ko,methodNames:Mn};Wt.default=Ui;var at={};function Go(e){return(Go=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function _n(e,t,o){return(_n=typeof Reflect!="undefined"&&Reflect.get?Reflect.get:function(n,r,i){var c=function(l,p){for(;!Object.prototype.hasOwnProperty.call(l,p)&&(l=Fe(l))!==null;);return l}(n,r);if(c){var s=Object.getOwnPropertyDescriptor(c,r);return s.get?s.get.call(i):s.value}})(e,t,o||e)}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function Ki(e,t){return!t||Go(t)!=="object"&&typeof t!="function"?function(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(e):t}function Fe(e){return(Fe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}function Qo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jo(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function er(e,t,o){return t&&Jo(e.prototype,t),o&&Jo(e,o),e}Object.defineProperty(at,"__esModule",{value:!0}),at.initScope=tr,at.Scope=void 0;var $i=function(){function e(){var t=this;Qo(this,e),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=$.default,this.defaults=(0,Me.default)(et.defaults),this.Eventable=ot.Eventable,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=(0,Pn.createInteractStatic)(this),this.InteractEvent=tt.InteractEvent,this.Interactable=void 0,this.interactables=new jt.InteractableSet(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(n){return t.removeDocument(n.target)};var o=this;this.Interactable=function(n){(function(l,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(p&&p.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),p&&Zo(l,p)})(s,n);var r,i,c=(r=s,i=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}(),function(){var l,p=Fe(r);if(i){var f=Fe(this).constructor;l=Reflect.construct(p,arguments,f)}else l=p.apply(this,arguments);return Ki(this,l)});function s(){return Qo(this,s),c.apply(this,arguments)}return er(s,[{key:"_defaults",get:function(){return o.defaults}},{key:"set",value:function(l){return _n(Fe(s.prototype),"set",this).call(this,l),o.fire("interactable:set",{options:l,interactable:this}),this}},{key:"unset",value:function(){_n(Fe(s.prototype),"unset",this).call(this),o.interactables.list.splice(o.interactables.list.indexOf(this),1),o.fire("interactable:unset",{interactable:this})}}]),s}(Dt.Interactable)}return er(e,[{key:"addListeners",value:function(t,o){this.listenerMaps.push({id:o,map:t})}},{key:"fire",value:function(t,o){for(var n=0;n<this.listenerMaps.length;n++){var r=this.listenerMaps[n].map[t];if(r&&r(o,this,t)===!1)return!1}}},{key:"init",value:function(t){return this.isInitialized?this:tr(this,t)}},{key:"pluginIsInstalled",value:function(t){return this._plugins.map[t.id]||this._plugins.list.indexOf(t)!==-1}},{key:"usePlugin",value:function(t,o){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,o),t.listeners&&t.before){for(var n=0,r=this.listenerMaps.length,i=t.before.reduce(function(s,l){return s[l]=!0,s[nr(l)]=!0,s},{});n<r;n++){var c=this.listenerMaps[n].id;if(i[c]||i[nr(c)])break}this.listenerMaps.splice(n,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}},{key:"addDocument",value:function(t,o){if(this.getDocIndex(t)!==-1)return!1;var n=a.getWindow(t);o=o?(0,I.default)({},o):{},this.documents.push({doc:t,options:o}),this.events.documents.push(t),t!==this.document&&this.events.add(n,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:n,scope:this,options:o})}},{key:"removeDocument",value:function(t){var o=this.getDocIndex(t),n=a.getWindow(t),r=this.documents[o].options;this.events.remove(n,"unload",this.onWindowUnload),this.documents.splice(o,1),this.events.documents.splice(o,1),this.fire("scope:remove-document",{doc:t,window:n,scope:this,options:r})}},{key:"getDocIndex",value:function(t){for(var o=0;o<this.documents.length;o++)if(this.documents[o].doc===t)return o;return-1}},{key:"getDocOptions",value:function(t){var o=this.getDocIndex(t);return o===-1?null:this.documents[o].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),e}();function tr(e,t){return e.isInitialized=!0,d.default.window(t)&&a.init(t),D.default.init(t),$.default.init(t),de.default.init(t),e.window=t,e.document=t.document,e.usePlugin(Wt.default),e.usePlugin(Ht.default),e}function nr(e){return e&&e.replace(/\/.*$/,"")}at.Scope=$i;var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.default=void 0;var or=new at.Scope,Gi=or.interactStatic;te.default=Gi;var Zi=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:void 0;or.init(Zi);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.default=void 0,Ft.default=function(){};var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.default=void 0,Vt.default=function(){};var Bt={};function rr(e,t){return function(o){if(Array.isArray(o))return o}(e)||function(o,n){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(o)){var r=[],i=!0,c=!1,s=void 0;try{for(var l,p=o[Symbol.iterator]();!(i=(l=p.next()).done)&&(r.push(l.value),!n||r.length!==n);i=!0);}catch(f){c=!0,s=f}finally{try{i||p.return==null||p.return()}finally{if(c)throw s}}return r}}(e,t)||function(o,n){if(o){if(typeof o=="string")return ir(o,n);var r=Object.prototype.toString.call(o).slice(8,-1);return r==="Object"&&o.constructor&&(r=o.constructor.name),r==="Map"||r==="Set"?Array.from(o):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ir(o,n):void 0}}(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ir(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.default=void 0,Bt.default=function(e){var t=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(n){var r=rr(n,2),i=r[0],c=r[1];return i in e||c in e}),o=function(n,r){for(var i=e.range,c=e.limits,s=c===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:c,l=e.offset,p=l===void 0?{x:0,y:0}:l,f={range:i,grid:e,x:null,y:null},m=0;m<t.length;m++){var b=rr(t[m],2),w=b[0],y=b[1],P=Math.round((n-p.x)/e[w]),O=Math.round((r-p.y)/e[y]);f[w]=Math.max(s.left,Math.min(s.right,P*e[w]+p.x)),f[y]=Math.max(s.top,Math.min(s.bottom,O*e[y]+p.y))}return f};return o.grid=e,o.coordFields=t,o};var st={};Object.defineProperty(st,"__esModule",{value:!0}),Object.defineProperty(st,"edgeTarget",{enumerable:!0,get:function(){return Ft.default}}),Object.defineProperty(st,"elements",{enumerable:!0,get:function(){return Vt.default}}),Object.defineProperty(st,"grid",{enumerable:!0,get:function(){return Bt.default}});var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.default=void 0;var Qi={id:"snappers",install:function(e){var t=e.interactStatic;t.snappers=(0,I.default)(t.snappers||{},st),t.createSnapGrid=t.snappers.grid}};Nt.default=Qi;var Ve={};function ar(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),o.push.apply(o,n)}return o}function Cn(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?ar(Object(o),!0).forEach(function(n){Ji(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ar(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function Ji(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.aspectRatio=Ve.default=void 0;var sr={start:function(e){if(!e.state.options.enabled)return!1;var t=e.state,o=e.rect,n=e.edges,r=e.pageCoords,i=t.options.ratio,c=t.options,s=c.equalDelta,l=c.modifiers;i==="preserve"&&(i=o.width/o.height),t.startCoords=(0,I.default)({},r),t.startRect=(0,I.default)({},o),t.ratio=i,t.equalDelta=s;var p=t.linkedEdges={top:n.top||n.left&&!n.bottom,left:n.left||n.top&&!n.right,bottom:n.bottom||n.right&&!n.top,right:n.right||n.bottom&&!n.left};if(t.xIsPrimaryAxis=!(!n.left&&!n.right),t.equalDelta)t.edgeSign=(p.left?1:-1)*(p.top?1:-1);else{var f=t.xIsPrimaryAxis?p.top:p.left;t.edgeSign=f?-1:1}if((0,I.default)(e.edges,p),l&&l.length){var m=new Oe.default(e.interaction);m.copyFrom(e.interaction.modification),m.prepareStates(l),t.subModification=m,m.startAll(Cn({},e))}},set:function(e){if(e.state.options.enabled===!1)return!1;var t=e.state,o=e.rect,n=e.coords,r=(0,I.default)({},n),i=t.equalDelta?ea:ta;if(i(t,t.xIsPrimaryAxis,n,o),!t.subModification)return null;var c=(0,I.default)({},o);(0,G.addEdges)(t.linkedEdges,c,{x:n.x-r.x,y:n.y-r.y});var s=t.subModification.setAll(Cn(Cn({},e),{},{rect:c,edges:t.linkedEdges,pageCoords:n,prevCoords:n,prevRect:c})),l=s.delta;return s.changed&&(i(t,Math.abs(l.x)>Math.abs(l.y),s.coords,s.rect),(0,I.default)(n,s.coords)),s.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function ea(e,t,o){var n=e.startCoords,r=e.edgeSign;t?o.y=n.y+(o.x-n.x)*r:o.x=n.x+(o.y-n.y)*r}function ta(e,t,o,n){var r=e.startRect,i=e.startCoords,c=e.ratio,s=e.edgeSign;if(t){var l=n.width/c;o.y=i.y+(l-r.height)*s}else{var p=n.height*c;o.x=i.x+(p-r.width)*s}}Ve.aspectRatio=sr;var na=(0,ee.makeModifier)(sr,"aspectRatio");Ve.default=na;var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.default=void 0;var lr=function(){};lr._defaults={};var oa=lr;Ce.default=oa;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0}),Object.defineProperty(Ln,"default",{enumerable:!0,get:function(){return Ce.default}});var ne={};function In(e,t,o){return d.default.func(e)?G.resolveRectLike(e,t.interactable,t.element,[o.x,o.y,t]):G.resolveRectLike(e,t.interactable,t.element)}Object.defineProperty(ne,"__esModule",{value:!0}),ne.getRestrictionRect=In,ne.restrict=ne.default=void 0;var cr={start:function(e){var t=e.rect,o=e.startOffset,n=e.state,r=e.interaction,i=e.pageCoords,c=n.options,s=c.elementRect,l=(0,I.default)({left:0,top:0,right:0,bottom:0},c.offset||{});if(t&&s){var p=In(c.restriction,r,i);if(p){var f=p.right-p.left-t.width,m=p.bottom-p.top-t.height;f<0&&(l.left+=f,l.right+=f),m<0&&(l.top+=m,l.bottom+=m)}l.left+=o.left-t.width*s.left,l.top+=o.top-t.height*s.top,l.right+=o.right-t.width*(1-s.right),l.bottom+=o.bottom-t.height*(1-s.bottom)}n.offset=l},set:function(e){var t=e.coords,o=e.interaction,n=e.state,r=n.options,i=n.offset,c=In(r.restriction,o,t);if(c){var s=G.xywhToTlbr(c);t.x=Math.max(Math.min(s.right-i.right,t.x),s.left+i.left),t.y=Math.max(Math.min(s.bottom-i.bottom,t.y),s.top+i.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}};ne.restrict=cr;var ra=(0,ee.makeModifier)(cr,"restrict");ne.default=ra;var fe={};Object.defineProperty(fe,"__esModule",{value:!0}),fe.restrictEdges=fe.default=void 0;var ur={top:1/0,left:1/0,bottom:-1/0,right:-1/0},pr={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function dr(e,t){for(var o=["top","left","bottom","right"],n=0;n<o.length;n++){var r=o[n];r in e||(e[r]=t[r])}return e}var fr={noInner:ur,noOuter:pr,start:function(e){var t,o=e.interaction,n=e.startOffset,r=e.state,i=r.options;if(i){var c=(0,ne.getRestrictionRect)(i.offset,o,o.coords.start.page);t=G.rectToXY(c)}t=t||{x:0,y:0},r.offset={top:t.y+n.top,left:t.x+n.left,bottom:t.y-n.bottom,right:t.x-n.right}},set:function(e){var t=e.coords,o=e.edges,n=e.interaction,r=e.state,i=r.offset,c=r.options;if(o){var s=(0,I.default)({},t),l=(0,ne.getRestrictionRect)(c.inner,n,s)||{},p=(0,ne.getRestrictionRect)(c.outer,n,s)||{};dr(l,ur),dr(p,pr),o.top?t.y=Math.min(Math.max(p.top+i.top,s.y),l.top+i.top):o.bottom&&(t.y=Math.max(Math.min(p.bottom+i.bottom,s.y),l.bottom+i.bottom)),o.left?t.x=Math.min(Math.max(p.left+i.left,s.x),l.left+i.left):o.right&&(t.x=Math.max(Math.min(p.right+i.right,s.x),l.right+i.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}};fe.restrictEdges=fr;var ia=(0,ee.makeModifier)(fr,"restrictEdges");fe.default=ia;var Be={};Object.defineProperty(Be,"__esModule",{value:!0}),Be.restrictRect=Be.default=void 0;var aa=(0,I.default)({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(e){}},ne.restrict.defaults),hr={start:ne.restrict.start,set:ne.restrict.set,defaults:aa};Be.restrictRect=hr;var sa=(0,ee.makeModifier)(hr,"restrictRect");Be.default=sa;var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.restrictSize=Ne.default=void 0;var la={width:-1/0,height:-1/0},ca={width:1/0,height:1/0},vr={start:function(e){return fe.restrictEdges.start(e)},set:function(e){var t=e.interaction,o=e.state,n=e.rect,r=e.edges,i=o.options;if(r){var c=G.tlbrToXywh((0,ne.getRestrictionRect)(i.min,t,e.coords))||la,s=G.tlbrToXywh((0,ne.getRestrictionRect)(i.max,t,e.coords))||ca;o.options={endOnly:i.endOnly,inner:(0,I.default)({},fe.restrictEdges.noInner),outer:(0,I.default)({},fe.restrictEdges.noOuter)},r.top?(o.options.inner.top=n.bottom-c.height,o.options.outer.top=n.bottom-s.height):r.bottom&&(o.options.inner.bottom=n.top+c.height,o.options.outer.bottom=n.top+s.height),r.left?(o.options.inner.left=n.right-c.width,o.options.outer.left=n.right-s.width):r.right&&(o.options.inner.right=n.left+c.width,o.options.outer.right=n.left+s.width),fe.restrictEdges.set(e),o.options=i}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}};Ne.restrictSize=vr;var ua=(0,ee.makeModifier)(vr,"restrictSize");Ne.default=ua;var An={};Object.defineProperty(An,"__esModule",{value:!0}),Object.defineProperty(An,"default",{enumerable:!0,get:function(){return Ce.default}});var xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.snap=xe.default=void 0;var gr={start:function(e){var t,o=e.interaction,n=e.interactable,r=e.element,i=e.rect,c=e.state,s=e.startOffset,l=c.options,p=l.offsetWithOrigin?function(b){var w=b.interaction.element;return(0,G.rectToXY)((0,G.resolveRectLike)(b.state.options.origin,null,null,[w]))||(0,ke.default)(b.interactable,w,b.interaction.prepared.name)}(e):{x:0,y:0};if(l.offset==="startCoords")t={x:o.coords.start.page.x,y:o.coords.start.page.y};else{var f=(0,G.resolveRectLike)(l.offset,n,r,[o]);(t=(0,G.rectToXY)(f)||{x:0,y:0}).x+=p.x,t.y+=p.y}var m=l.relativePoints;c.offsets=i&&m&&m.length?m.map(function(b,w){return{index:w,relativePoint:b,x:s.left-i.width*b.x+t.x,y:s.top-i.height*b.y+t.y}}):[{index:0,relativePoint:null,x:t.x,y:t.y}]},set:function(e){var t=e.interaction,o=e.coords,n=e.state,r=n.options,i=n.offsets,c=(0,ke.default)(t.interactable,t.element,t.prepared.name),s=(0,I.default)({},o),l=[];r.offsetWithOrigin||(s.x-=c.x,s.y-=c.y);for(var p=0;p<i.length;p++)for(var f=i[p],m=s.x-f.x,b=s.y-f.y,w=0,y=r.targets.length;w<y;w++){var P,O=r.targets[w];(P=d.default.func(O)?O(m,b,t._proxy,f,w):O)&&l.push({x:(d.default.number(P.x)?P.x:m)+f.x,y:(d.default.number(P.y)?P.y:b)+f.y,range:d.default.number(P.range)?P.range:r.range,source:O,index:w,offset:f})}for(var x={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},C=0;C<l.length;C++){var j=l[C],F=j.range,X=j.x-s.x,Z=j.y-s.y,N=(0,we.default)(X,Z),Y=N<=F;F===1/0&&x.inRange&&x.range!==1/0&&(Y=!1),x.target&&!(Y?x.inRange&&F!==1/0?N/F<x.distance/x.range:F===1/0&&x.range!==1/0||N<x.distance:!x.inRange&&N<x.distance)||(x.target=j,x.distance=N,x.range=F,x.inRange=Y,x.delta.x=X,x.delta.y=Z)}return x.inRange&&(o.x=x.target.x,o.y=x.target.y),n.closest=x,x},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}};xe.snap=gr;var pa=(0,ee.makeModifier)(gr,"snap");xe.default=pa;var me={};function mr(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}Object.defineProperty(me,"__esModule",{value:!0}),me.snapSize=me.default=void 0;var yr={start:function(e){var t=e.state,o=e.edges,n=t.options;if(!o)return null;e.state={options:{targets:null,relativePoints:[{x:o.left?0:1,y:o.top?0:1}],offset:n.offset||"self",origin:{x:0,y:0},range:n.range}},t.targetFields=t.targetFields||[["width","height"],["x","y"]],xe.snap.start(e),t.offsets=e.state.offsets,e.state=t},set:function(e){var t,o,n=e.interaction,r=e.state,i=e.coords,c=r.options,s=r.offsets,l={x:i.x-s[0].x,y:i.y-s[0].y};r.options=(0,I.default)({},c),r.options.targets=[];for(var p=0;p<(c.targets||[]).length;p++){var f=(c.targets||[])[p],m=void 0;if(m=d.default.func(f)?f(l.x,l.y,n):f){for(var b=0;b<r.targetFields.length;b++){var w=(t=r.targetFields[b],o=2,function(x){if(Array.isArray(x))return x}(t)||function(x,C){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(x)){var j=[],F=!0,X=!1,Z=void 0;try{for(var N,Y=x[Symbol.iterator]();!(F=(N=Y.next()).done)&&(j.push(N.value),!C||j.length!==C);F=!0);}catch(ue){X=!0,Z=ue}finally{try{F||Y.return==null||Y.return()}finally{if(X)throw Z}}return j}}(t,o)||function(x,C){if(x){if(typeof x=="string")return mr(x,C);var j=Object.prototype.toString.call(x).slice(8,-1);return j==="Object"&&x.constructor&&(j=x.constructor.name),j==="Map"||j==="Set"?Array.from(x):j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j)?mr(x,C):void 0}}(t,o)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()),y=w[0],P=w[1];if(y in m||P in m){m.x=m[y],m.y=m[P];break}}r.options.targets.push(m)}}var O=xe.snap.set(e);return r.options=c,O},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}};me.snapSize=yr;var da=(0,ee.makeModifier)(yr,"snapSize");me.default=da;var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.snapEdges=qe.default=void 0;var br={start:function(e){var t=e.edges;return t?(e.state.targetFields=e.state.targetFields||[[t.left?"left":"right",t.top?"top":"bottom"]],me.snapSize.start(e)):null},set:me.snapSize.set,defaults:(0,I.default)((0,Me.default)(me.snapSize.defaults),{targets:null,range:null,offset:{x:0,y:0}})};qe.snapEdges=br;var fa=(0,ee.makeModifier)(br,"snapEdges");qe.default=fa;var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0}),Object.defineProperty(Dn,"default",{enumerable:!0,get:function(){return Ce.default}});var jn={};Object.defineProperty(jn,"__esModule",{value:!0}),Object.defineProperty(jn,"default",{enumerable:!0,get:function(){return Ce.default}});var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.default=void 0;var ha={aspectRatio:Ve.default,restrictEdges:fe.default,restrict:ne.default,restrictRect:Be.default,restrictSize:Ne.default,snapEdges:qe.default,snap:xe.default,snapSize:me.default,spring:Dn.default,avoid:Ln.default,transform:jn.default,rubberband:An.default};Xe.default=ha;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.default=void 0;var va={id:"modifiers",install:function(e){var t=e.interactStatic;for(var o in e.usePlugin(ee.default),e.usePlugin(Nt.default),t.modifiers=Xe.default,Xe.default){var n=Xe.default[o],r=n._defaults,i=n._methods;r._methods=i,e.defaults.perAction[o]=r}}};qt.default=va;var Le={};function wr(e){return(wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function ga(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Er(e,t){return(Er=Object.setPrototypeOf||function(o,n){return o.__proto__=n,o})(e,t)}function ma(e,t){return!t||wr(t)!=="object"&&typeof t!="function"?Hn(e):t}function Hn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rn(e){return(Rn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(e)}Object.defineProperty(Le,"__esModule",{value:!0}),Le.PointerEvent=Le.default=void 0;var ya=function(e){(function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(l&&l.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),l&&Er(s,l)})(c,e);var t,o,n,r,i=(n=c,r=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(s){return!1}}(),function(){var s,l=Rn(n);if(r){var p=Rn(this).constructor;s=Reflect.construct(l,arguments,p)}else s=l.apply(this,arguments);return ma(this,s)});function c(s,l,p,f,m,b){var w;if(function(O,x){if(!(O instanceof x))throw new TypeError("Cannot call a class as a function")}(this,c),(w=i.call(this,m)).type=void 0,w.originalEvent=void 0,w.pointerId=void 0,w.pointerType=void 0,w.double=void 0,w.pageX=void 0,w.pageY=void 0,w.clientX=void 0,w.clientY=void 0,w.dt=void 0,w.eventable=void 0,L.pointerExtend(Hn(w),p),p!==l&&L.pointerExtend(Hn(w),l),w.timeStamp=b,w.originalEvent=p,w.type=s,w.pointerId=L.getPointerId(l),w.pointerType=L.getPointerType(l),w.target=f,w.currentTarget=null,s==="tap"){var y=m.getPointerIndex(l);w.dt=w.timeStamp-m.pointers[y].downTime;var P=w.timeStamp-m.tapTime;w.double=!!(m.prevTap&&m.prevTap.type!=="doubletap"&&m.prevTap.target===w.target&&P<500)}else s==="doubletap"&&(w.dt=l.timeStamp-m.tapTime);return w}return t=c,(o=[{key:"_subtractOrigin",value:function(s){var l=s.x,p=s.y;return this.pageX-=l,this.pageY-=p,this.clientX-=l,this.clientY-=p,this}},{key:"_addOrigin",value:function(s){var l=s.x,p=s.y;return this.pageX+=l,this.pageY+=p,this.clientX+=l,this.clientY+=p,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}])&&ga(t.prototype,o),c}(je.BaseEvent);Le.PointerEvent=Le.default=ya;var lt={};Object.defineProperty(lt,"__esModule",{value:!0}),lt.default=void 0;var Xt={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(e){e.pointerEvents=Xt,e.defaults.actions.pointerEvents=Xt.defaults,(0,I.default)(e.actions.phaselessTypes,Xt.types)},listeners:{"interactions:new":function(e){var t=e.interaction;t.prevTap=null,t.tapTime=0},"interactions:update-pointer":function(e){var t=e.down,o=e.pointerInfo;!t&&o.hold||(o.hold={duration:1/0,timeout:null})},"interactions:move":function(e,t){var o=e.interaction,n=e.pointer,r=e.event,i=e.eventTarget;e.duplicate||o.pointerIsDown&&!o.pointerWasMoved||(o.pointerIsDown&&zn(e),Se({interaction:o,pointer:n,event:r,eventTarget:i,type:"move"},t))},"interactions:down":function(e,t){(function(o,n){for(var r=o.interaction,i=o.pointer,c=o.event,s=o.eventTarget,l=o.pointerIndex,p=r.pointers[l].hold,f=A.getPath(s),m={interaction:r,pointer:i,event:c,eventTarget:s,type:"hold",targets:[],path:f,node:null},b=0;b<f.length;b++){var w=f[b];m.node=w,n.fire("pointerEvents:collect-targets",m)}if(m.targets.length){for(var y=1/0,P=0;P<m.targets.length;P++){var O=m.targets[P].eventable.options.holdDuration;O<y&&(y=O)}p.duration=y,p.timeout=setTimeout(function(){Se({interaction:r,eventTarget:s,pointer:i,event:c,type:"hold"},n)},y)}})(e,t),Se(e,t)},"interactions:up":function(e,t){zn(e),Se(e,t),function(o,n){var r=o.interaction,i=o.pointer,c=o.event,s=o.eventTarget;r.pointerWasMoved||Se({interaction:r,eventTarget:s,pointer:i,event:c,type:"tap"},n)}(e,t)},"interactions:cancel":function(e,t){zn(e),Se(e,t)}},PointerEvent:Le.PointerEvent,fire:Se,collectEventTargets:xr,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function Se(e,t){var o=e.interaction,n=e.pointer,r=e.event,i=e.eventTarget,c=e.type,s=e.targets,l=s===void 0?xr(e,t):s,p=new Le.PointerEvent(c,n,r,i,o,t.now());t.fire("pointerEvents:new",{pointerEvent:p});for(var f={interaction:o,pointer:n,event:r,eventTarget:i,targets:l,type:c,pointerEvent:p},m=0;m<l.length;m++){var b=l[m];for(var w in b.props||{})p[w]=b.props[w];var y=(0,ke.default)(b.eventable,b.node);if(p._subtractOrigin(y),p.eventable=b.eventable,p.currentTarget=b.node,b.eventable.fire(p),p._addOrigin(y),p.immediatePropagationStopped||p.propagationStopped&&m+1<l.length&&l[m+1].node!==p.currentTarget)break}if(t.fire("pointerEvents:fired",f),c==="tap"){var P=p.double?Se({interaction:o,pointer:n,event:r,eventTarget:i,type:"doubletap"},t):p;o.prevTap=P,o.tapTime=P.timeStamp}return p}function xr(e,t){var o=e.interaction,n=e.pointer,r=e.event,i=e.eventTarget,c=e.type,s=o.getPointerIndex(n),l=o.pointers[s];if(c==="tap"&&(o.pointerWasMoved||!l||l.downTarget!==i))return[];for(var p=A.getPath(i),f={interaction:o,pointer:n,event:r,eventTarget:i,type:c,path:p,targets:[],node:null},m=0;m<p.length;m++){var b=p[m];f.node=b,t.fire("pointerEvents:collect-targets",f)}return c==="hold"&&(f.targets=f.targets.filter(function(w){var y;return w.eventable.options.holdDuration===((y=o.pointers[s])==null?void 0:y.hold.duration)})),f.targets}function zn(e){var t=e.interaction,o=e.pointerIndex,n=t.pointers[o].hold;n&&n.timeout&&(clearTimeout(n.timeout),n.timeout=null)}var ba=Xt;lt.default=ba;var Yt={};function wa(e){var t=e.interaction;t.holdIntervalHandle&&(clearInterval(t.holdIntervalHandle),t.holdIntervalHandle=null)}Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.default=void 0;var Ea={id:"pointer-events/holdRepeat",install:function(e){e.usePlugin(lt.default);var t=e.pointerEvents;t.defaults.holdRepeatInterval=0,t.types.holdrepeat=e.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(e,t){return e["pointerEvents:".concat(t)]=wa,e},{"pointerEvents:new":function(e){var t=e.pointerEvent;t.type==="hold"&&(t.count=(t.count||0)+1)},"pointerEvents:fired":function(e,t){var o=e.interaction,n=e.pointerEvent,r=e.eventTarget,i=e.targets;if(n.type==="hold"&&i.length){var c=i[0].eventable.options.holdRepeatInterval;c<=0||(o.holdIntervalHandle=setTimeout(function(){t.pointerEvents.fire({interaction:o,eventTarget:r,type:"hold",pointer:n,event:n},t)},c))}}})};Yt.default=Ea;var Ut={};function xa(e){return(0,I.default)(this.events.options,e),this}Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.default=void 0;var Sa={id:"pointer-events/interactableTargets",install:function(e){var t=e.Interactable;t.prototype.pointerEvents=xa;var o=t.prototype._backCompatOption;t.prototype._backCompatOption=function(n,r){var i=o.call(this,n,r);return i===this&&(this.events.options[n]=r),i}},listeners:{"pointerEvents:collect-targets":function(e,t){var o=e.targets,n=e.node,r=e.type,i=e.eventTarget;t.interactables.forEachMatch(n,function(c){var s=c.events,l=s.options;s.types[r]&&s.types[r].length&&c.testIgnoreAllow(l,n,i)&&o.push({node:n,eventable:s,props:{interactable:c}})})},"interactable:new":function(e){var t=e.interactable;t.events.getRect=function(o){return t.getRect(o)}},"interactable:set":function(e,t){var o=e.interactable,n=e.options;(0,I.default)(o.events.options,t.pointerEvents.defaults),(0,I.default)(o.events.options,n.pointerEvents||{})}}};Ut.default=Sa;var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.default=void 0;var Pa={id:"pointer-events",install:function(e){e.usePlugin(lt),e.usePlugin(Yt.default),e.usePlugin(Ut.default)}};Kt.default=Pa;var ct={};function Sr(e){var t=e.Interactable;e.actions.phases.reflow=!0,t.prototype.reflow=function(o){return function(n,r,i){for(var c=d.default.string(n.target)?K.from(n._context.querySelectorAll(n.target)):[n.target],s=i.window.Promise,l=s?[]:null,p=function(){var m=c[f],b=n.getRect(m);if(!b)return"break";var w=K.find(i.interactions.list,function(C){return C.interacting()&&C.interactable===n&&C.element===m&&C.prepared.name===r.name}),y=void 0;if(w)w.move(),l&&(y=w._reflowPromise||new s(function(C){w._reflowResolve=C}));else{var P=(0,G.tlbrToXywh)(b),O={page:{x:P.x,y:P.y},client:{x:P.x,y:P.y},timeStamp:i.now()},x=L.coordsToEvent(O);y=function(C,j,F,X,Z){var N=C.interactions.new({pointerType:"reflow"}),Y={interaction:N,event:Z,pointer:Z,eventTarget:F,phase:"reflow"};N.interactable=j,N.element=F,N.prevEvent=Z,N.updatePointer(Z,Z,F,!0),L.setZeroCoords(N.coords.delta),(0,ae.copyAction)(N.prepared,X),N._doPhase(Y);var ue=C.window.Promise,ye=ue?new ue(function(Wn){N._reflowResolve=Wn}):void 0;return N._reflowPromise=ye,N.start(X,j,F),N._interacting?(N.move(Y),N.end(Z)):(N.stop(),N._reflowResolve()),N.removePointer(Z,Z),ye}(i,n,m,r,x)}l&&l.push(y)},f=0;f<c.length&&p()!=="break";f++);return l&&s.all(l).then(function(){return n})}(this,o,e)}}Object.defineProperty(ct,"__esModule",{value:!0}),ct.install=Sr,ct.default=void 0;var ka={id:"reflow",install:Sr,listeners:{"interactions:stop":function(e,t){var o=e.interaction;o.pointerType==="reflow"&&(o._reflowResolve&&o._reflowResolve(),K.remove(t.interactions.list,o))}}};ct.default=ka;var ce={exports:{}};function Pr(e){return(Pr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}Object.defineProperty(ce.exports,"__esModule",{value:!0}),ce.exports.default=void 0,te.default.use(Re.default),te.default.use(_e.default),te.default.use(Kt.default),te.default.use(We.default),te.default.use(qt.default),te.default.use(Tt.default),te.default.use(wt.default),te.default.use(Ee.default),te.default.use(ct.default),te.default.use(Ot.default);var Ta=te.default;if(ce.exports.default=Ta,Pr(ce)==="object"&&ce)try{ce.exports=te.default}catch(e){}te.default.default=te.default,ce=ce.exports;var Ie={exports:{}};function kr(e){return(kr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}Object.defineProperty(Ie.exports,"__esModule",{value:!0}),Ie.exports.default=void 0;var Ma=ce.default;if(Ie.exports.default=Ma,kr(Ie)==="object"&&Ie)try{Ie.exports=ce.default}catch(e){}return ce.default.default=ce.default,Ie.exports})});Aa(exports,{default:()=>on,genId:()=>Xn});function oe(g,a){let u=Object.keys(a).map(h=>ja(g,h,a[h]));return u.length===1?u[0]:function(){u.forEach(h=>h())}}function ja(g,a,u){let h=g[a],v=g.hasOwnProperty(a),d=v?h:function(){return Object.getPrototypeOf(g)[a].apply(this,arguments)},E=u(d);return h&&Object.setPrototypeOf(E,h),Object.setPrototypeOf(k,E),g[a]=k,S;function k(...T){return E===d&&g[a]===k&&S(),E.apply(this,T)}function S(){g[a]===k&&(v?g[a]=d:delete g[a]),E!==d&&(E=d,Object.setPrototypeOf(k,h||Function))}}var V=be(require("obsidian"));var Pe=be(require("obsidian"));var H=be(require("obsidian"));function Fn(g){let a=_r(),[u,h]=a(g);if(!u)return!1;if(h||(h="px"),["em","ex","ch","rem","vw","vh","vmin","vmax","%","cm","mm","in","px","pt","pc"].contains(h))return u+h}function pe(g,a){var u;return g instanceof a||((u=g==null?void 0:g.instanceOf)==null?void 0:u.call(g,a))}var Cr=10,Vn=60;function Ye(g){let a=g.body.querySelector(".app-container, .workspace-split"),u=g.body.querySelector(".mod-left.workspace-ribbon"),h=a.offsetTop,v=g.body.hasClass("hider-ribbon")?0:u?u.offsetWidth:0;return{top:h,left:v}}function Ha(g){let a=g.getAttribute("data-orig-height"),u=g.getAttribute("data-orig-width"),h=parseFloat(g.getAttribute("data-orig-pos-left")||"0"),v=parseFloat(g.getAttribute("data-orig-pos-top")||"0"),d=Ye(g.ownerDocument).top;return v<d&&(v=d),{height:a,width:u,top:v,left:h}}function Ue(g,a){let{height:u,width:h,top:v,left:d}=Ha(g);a||(g.removeAttribute("data-orig-width"),g.removeAttribute("data-orig-height"),g.removeAttribute("data-orig-pos-left"),g.removeAttribute("data-orig-pos-top")),h&&(g.style.width=h+"px"),u&&(g.style.height=u+"px"),v&&(g.style.top=v+"px",g.setAttribute("data-y",String(v))),d&&(g.style.left=d+"px")}function Gt(g){if(g.hasClass("snap-to-viewport")){g.removeClass("snap-to-viewport"),Ue(g);return}}function Bn(g,a){let u=g.querySelector(".view-content").offsetHeight;u=a?-u:u;let h=parseFloat(g.getAttribute("data-y")||"0")+u;g.style.top=h+"px",g.setAttribute("data-y",String(h))}function ut(g){g.hasAttribute("data-orig-width")||g.setAttribute("data-orig-width",String(g.offsetWidth)),g.hasAttribute("data-orig-height")||g.setAttribute("data-orig-height",String(g.offsetHeight)),g.hasAttribute("data-orig-pos-left")||g.setAttribute("data-orig-pos-left",String(parseFloat(g.style.left))),g.hasAttribute("data-orig-pos-top")||g.setAttribute("data-orig-pos-top",String(parseFloat(g.style.top)))}function Lr(g){return g.hasAttribute("data-orig-width")&&g.hasAttribute("data-orig-height")&&g.hasAttribute("data-orig-pos-left")&&g.hasAttribute("data-orig-pos-top")}function Nn(g){let a=g.target,u=g.client.x-g.rect.left,h=g.rect.width,v=u/h,d=a.offsetWidth,E=String(g.client.x-v*d),k=String(g.client.y);a.setAttribute("data-x",String(E)),a.setAttribute("data-y",String(k))}function Ae(g,a,u){g.addClass(`snap-to-${a}`),g.style.top=u.top+"px",g.style.height=`calc(100vh - ${u.top}px)`,g.style.left=a==="right"?"unset":u.left+"px",a==="viewport"&&(g.style.width=`calc(100vw - ${u.left}px)`)}function Ir(g){let a=g.target,{x:u,y:h}=a.dataset;if(u=u||a.style.left,h=h||a.style.top,u=String((parseFloat(u)||0)+g.dx),h=String((parseFloat(h)||0)+g.dy),this.plugin.settings.snapToEdges){let v,d=a.ownerDocument,E=g.client.x<Cr,k=g.client.x>d.body.offsetWidth-Cr,S=g.client.y<30;if((E||k||S)&&(v=Ye(d),ut(a)),E&&g.buttons){Ae(a,"left",v);return}else if(k&&g.buttons){Ae(a,"right",v);return}else if(S&&g.buttons){Ae(a,"viewport",v);return}else if(a.hasClass("snap-to-viewport")){if(g.client.y<Vn)return;a.removeClass("snap-to-viewport"),Ue(a),Nn(g);return}else if(a.hasClass("snap-to-left")){if(g.client.y<Vn)return;a.removeClass("snap-to-left"),Ue(a),Nn(g);return}else if(a.hasClass("snap-to-right")){if(g.client.y<Vn)return;a.removeClass("snap-to-right"),Ue(a),Nn(g);return}}a.style.top=h?h+"px":a.style.top,a.style.left=u?u+"px":a.style.left,a.setAttribute("data-x",String(u)),a.setAttribute("data-y",String(h))}var Ar=["left","right","viewport"],Dr=(g,a)=>{var h;let u=(h=U.activePopover)==null?void 0:h.hoverEl;if(u&&pe(u,HTMLElement)){if(!a){Lr(u)?Ue(u,!0):ut(u),u.removeClasses(["snap-to-left","snap-to-right","snap-to-viewport"]);let v=Ye(u.ownerDocument);Ae(u,g,v)}return!0}return!1},jr=g=>{var u;let a=(u=U.activePopover)==null?void 0:u.hoverEl;return a&&pe(a,HTMLElement)?(g||Lr(a)&&(a.removeClasses(["snap-to-left","snap-to-right","snap-to-viewport"]),Ue(a)),!0):!1},Hr=g=>{var h;let a=(h=U.activePopover)==null?void 0:h.hoverEl,u=U.activePopovers().find(v=>v.hoverEl===a);return u?(g||u.toggleMinimized(),!0):!1};var Zt=new WeakMap,Qt={x:0,y:0};function Ra(g){let a=function(){return Object.setPrototypeOf(new H.Component,new.target.prototype)};return a.prototype=g.prototype,Object.setPrototypeOf(a,g)}var qn=new WeakMap,zr,Wr,Fr,Vr,Br,U=class extends Ra(H.HoverPopover){constructor(a,u,h,v,d){super();this.targetEl=u;this.plugin=h;this.onShowCallback=d;this.isPinned=this.plugin.settings.autoPin==="always";this.abortController=this.addChild(new H.Component);this.detaching=!1;this.opening=!1;this.rootSplit=new H.WorkspaceSplit(window.app.workspace,"vertical");this.targetRect=(zr=this.targetEl)==null?void 0:zr.getBoundingClientRect();this.oldPopover=(Wr=this.parent)==null?void 0:Wr.hoverPopover;this.document=(Br=(Vr=(Fr=this.targetEl)==null?void 0:Fr.ownerDocument)!=null?Vr:window.activeDocument)!=null?Br:window.document;this.interactStatic=this.plugin.interact.forDom(this.document.body).interact;this.id=Xn(8);this.hoverEl=this.document.defaultView.createDiv({cls:"popover hover-popover",attr:{id:"he"+this.id}});this.activate=(0,H.debounce)(()=>{let{win:a}=this.document,u=qn.get(a);u||qn.set(a,u=new Set),u.delete(this),u.add(this),a.requestAnimationFrame(()=>{let h=41;Array.from(u).reverse().forEach(v=>{v.hoverEl.style.setProperty("--he-popover-layer-inactive",""+h),h>31&&h--})})},100);v===void 0&&(v=300),this.onTarget=!0,this.onHover=!1,this.shownPos=null,this.parent=a,this.waitTime=v,this.state=H.PopoverState.Showing;let{hoverEl:E}=this;this.onMouseIn=this._onMouseIn.bind(this),this.onMouseOut=this._onMouseOut.bind(this),this.abortController.load(),u&&(u.addEventListener("mouseover",this.onMouseIn),u.addEventListener("mouseout",this.onMouseOut)),E.addEventListener("mouseover",S=>{Jt(S,E)&&(this.onHover=!0,this.onTarget=!1,this.transition())}),E.addEventListener("mouseout",S=>{Jt(S,E)&&(this.onHover=!1,this.onTarget=!1,this.transition())}),this.timer=window.setTimeout(this.show.bind(this),v),this.document.addEventListener("mousemove",dt),Zt.set(this.hoverEl,this),this.hoverEl.addClass("hover-editor"),this.containerEl=this.hoverEl.createDiv("popover-content"),this.buildWindowControls(),this.setInitialDimensions();let k=this.pinEl=this.document.defaultView.createEl("a","popover-header-icon mod-pin-popover");this.titleEl.prepend(this.pinEl),k.onclick=()=>{this.togglePin()},H.requireApiVersion&&(0,H.requireApiVersion)("0.13.27")?(0,H.setIcon)(k,"lucide-pin",17):(0,H.setIcon)(k,"pin",17),this.createResizeHandles(),this.plugin.settings.imageZoom&&this.registerZoomImageHandlers()}static activeWindows(){let a=[window],{floatingSplit:u}=app.workspace;if(u)for(let h of u.children)h.win&&a.push(h.win);return a}static containerForDocument(a){if(a!==document&&app.workspace.floatingSplit){for(let u of app.workspace.floatingSplit.children)if(u.doc===a)return u}return app.workspace.rootSplit}static activePopovers(){return this.activeWindows().flatMap(this.popoversForWindow)}static popoversForWindow(a){var u,h;return Array.prototype.slice.call((h=(u=a==null?void 0:a.document)==null?void 0:u.body.querySelectorAll(".hover-popover"))!=null?h:[]).map(v=>Zt.get(v)).filter(v=>v)}static forLeaf(a){let u=a&&document.body.matchParent.call(a.containerEl,".hover-popover");return u?Zt.get(u):void 0}static iteratePopoverLeaves(a,u){for(let h of this.activePopovers())if(h.rootSplit&&a.iterateLeaves(u,h.rootSplit))return!0;return!1}adopt(a){if(this.targetEl===a)return!0;let u=a==null?void 0:a.getBoundingClientRect();if(Rr(this.targetRect,u)){this.targetEl.removeEventListener("mouseover",this.onMouseIn),this.targetEl.removeEventListener("mouseout",this.onMouseOut),a.addEventListener("mouseover",this.onMouseIn),a.addEventListener("mouseout",this.onMouseOut),this.targetEl=a,this.targetRect=u;let{x:h,y:v}=Qt;return this.onTarget=Rr(u,{left:h,right:h,top:v,bottom:v}),this.transition(),!0}else this.onTarget=!1,this.transition();return!1}onZoomOut(){this.document.body.removeEventListener("mouseup",this.boundOnZoomOut),this.document.body.removeEventListener("dragend",this.boundOnZoomOut),this.hoverEl.hasClass("do-not-restore")?this.hoverEl.removeClass("do-not-restore"):Gt(this.hoverEl)}onZoomIn(a){if(a.button!==0)return;this.hoverEl.hasClass("snap-to-viewport")&&this.hoverEl.addClass("do-not-restore"),this.document.body.addEventListener("mouseup",this.boundOnZoomOut,{once:!0}),this.document.body.addEventListener("dragend",this.boundOnZoomOut,{once:!0});let u=Ye(this.document);return ut(this.hoverEl),Ae(this.hoverEl,"viewport",u),!1}registerZoomImageHandlers(){this.hoverEl.addClass("image-zoom"),this.boundOnZoomOut=this.onZoomOut.bind(this),this.hoverEl.on("mousedown","img",this.onZoomIn.bind(this))}togglePin(a){var u;this.activate(),a===void 0&&(a=!this.isPinned),a&&((u=this.abortController)==null||u.unload()),this.hoverEl.toggleClass("is-pinned",a),this.pinEl.toggleClass("is-active",a),this.isPinned=a}getDefaultMode(){var a,u;return((u=(a=this.parent)==null?void 0:a.view)==null?void 0:u.getMode)?this.parent.view.getMode():"preview"}updateLeaves(){this.onTarget&&this.targetEl&&!this.document.contains(this.targetEl)&&(this.onTarget=!1,this.transition());let a=0;this.plugin.app.workspace.iterateLeaves(u=>{a++},this.rootSplit),a===0?this.hide():a>1&&this.toggleConstrainAspectRatio(!1),this.hoverEl.setAttribute("data-leaf-count",a.toString())}get headerHeight(){let a=this.hoverEl;return this.titleEl.getBoundingClientRect().bottom-a.getBoundingClientRect().top}toggleMinimized(){var h;this.activate();let a=this.hoverEl,u=this.headerHeight;if(!a.hasAttribute("data-restore-height"))this.plugin.settings.rollDown&&Bn(a,!1),a.setAttribute("data-restore-height",String(a.offsetHeight)),a.style.minHeight=u+"px",a.style.maxHeight=u+"px",a.toggleClass("is-minimized",!0);else{let v=a.getAttribute("data-restore-height");v&&(a.removeAttribute("data-restore-height"),a.style.height=v+"px"),a.style.removeProperty("max-height"),a.toggleClass("is-minimized",!1),this.plugin.settings.rollDown&&Bn(a,!0)}(h=this.interact)==null||h.reflow({name:"drag",axis:"xy"})}attachLeaf(){this.rootSplit.getRoot=()=>app.workspace[this.document===document?"rootSplit":"floatingSplit"],this.rootSplit.getContainer=()=>U.containerForDocument(this.document),this.titleEl.insertAdjacentElement("afterend",this.rootSplit.containerEl);let a=this.plugin.app.workspace.createLeafInParent(this.rootSplit,0);return this.updateLeaves(),a}onload(){super.onload(),this.registerEvent(this.plugin.app.workspace.on("layout-change",this.updateLeaves,this)),this.registerEvent(app.workspace.on("layout-change",()=>{this.rootSplit.children.forEach((a,u)=>{a instanceof H.WorkspaceTabs&&this.rootSplit.replaceChild(u,a.children[0])})}))}leaves(){let a=[];return this.plugin.app.workspace.iterateLeaves(u=>{a.push(u)},this.rootSplit),a}setInitialDimensions(){this.hoverEl.style.height=this.plugin.settings.initialHeight,this.hoverEl.style.width=this.plugin.settings.initialWidth}adjustHeight(a){this.hoverEl.style.height=this.hoverEl.offsetHeight+a+"px"}toggleViewHeader(a,u){var d;this.activate(),a===void 0&&(a=!this.hoverEl.hasClass("show-navbar")),(d=this.hideNavBarEl)==null||d.toggleClass("is-active",a),this.hoverEl.toggleClass("show-navbar",a);let h=this.hoverEl.querySelector(".view-header");if(!h||u)return;let v=parseFloat(getComputedStyle(h).getPropertyValue("--he-view-header-height"));this.hoverEl.style.transition="height 0.2s",this.adjustHeight(a?v:-v),setTimeout(()=>{this.hoverEl.style.removeProperty("transition")},200),this.requestLeafMeasure()}buildWindowControls(){this.titleEl=this.document.defaultView.createDiv("popover-titlebar"),this.titleEl.createDiv("popover-title");let a=this.titleEl.createDiv("popover-actions"),u=this.hideNavBarEl=a.createEl("a","popover-action mod-show-navbar");(0,H.setIcon)(u,"sidebar-open",14),u.addEventListener("click",E=>{this.toggleViewHeader()}),this.plugin.settings.showViewHeader&&this.toggleViewHeader(!0,!0);let h=a.createEl("a","popover-action mod-minimize");(0,H.setIcon)(h,"minus"),h.addEventListener("click",E=>{Gt(this.hoverEl),this.toggleMinimized()});let v=a.createEl("a","popover-action mod-maximize");(0,H.setIcon)(v,"maximize",14),v.addEventListener("click",E=>{if(this.activate(),this.hoverEl.hasClass("snap-to-viewport")){(0,H.setIcon)(v,"maximize",14),Gt(this.hoverEl);return}(0,H.setIcon)(v,"minimize",14);let k=Ye(this.document);ut(this.hoverEl),Ae(this.hoverEl,"viewport",k)});let d=a.createEl("a","popover-action mod-close");(0,H.setIcon)(d,"x"),d.addEventListener("click",E=>{this.hide()}),this.containerEl.prepend(this.titleEl)}requestLeafMeasure(){let a=this.leaves();a.length&&setTimeout(()=>{a.forEach(u=>u.onResize())},200)}onShow(){var u,h;let{closeDelay:a}=this.plugin.settings;setTimeout(()=>this.waitTime=a,a),(u=this.oldPopover)==null||u.hide(),this.oldPopover=null,this.activate(),this.hoverEl.toggleClass("is-new",!0),this.document.body.addEventListener("click",()=>{this.hoverEl.toggleClass("is-new",!1)},{once:!0,capture:!0}),this.parent&&(this.parent.hoverPopover=this),(0,H.requireApiVersion)("0.15.1")&&!(0,H.requireApiVersion)("0.15.7")&&app.workspace.iterateLeaves(v=>{var d,E;v.view instanceof H.MarkdownView&&((E=(d=v.view.editMode).reinit)==null||E.call(d))},this.rootSplit),this.togglePin(this.isPinned),(h=this.onShowCallback)==null||h.call(this),this.onShowCallback=void 0}startBounce(){this.bounce=setTimeout(()=>{this.hoverEl.style.left=parseFloat(this.hoverEl.style.left)+this.xspeed+"px",this.hoverEl.style.top=parseFloat(this.hoverEl.style.top)+this.yspeed+"px",this.checkHitBox(),this.startBounce()},20)}toggleBounce(){if(this.xspeed=7,this.yspeed=7,this.bounce){clearTimeout(this.bounce),this.bounce=void 0;let a=this.hoverEl.querySelector(".view-content");(a==null?void 0:a.style)&&a.style.removeProperty("backgroundColor")}else this.startBounce()}checkHitBox(){let a=parseFloat(this.hoverEl.style.left),u=parseFloat(this.hoverEl.style.top),h=parseFloat(this.hoverEl.style.width),v=parseFloat(this.hoverEl.style.height);(a<=0||a+h>=this.document.body.offsetWidth)&&(this.xspeed*=-1,this.pickColor()),(u<=0||u+v>=this.document.body.offsetHeight)&&(this.yspeed*=-1,this.pickColor())}pickColor(){let a=Math.random()*(254-0)+0,u=Math.random()*(254-0)+0,h=Math.random()*(254-0)+0,v=this.hoverEl.querySelector(".view-content");(v==null?void 0:v.style)&&(v.style.backgroundColor="rgb("+a+","+u+", "+h+")")}transition(){this.shouldShow()?this.state===H.PopoverState.Hiding&&(this.state=H.PopoverState.Shown,clearTimeout(this.timer)):this.state===H.PopoverState.Showing?this.hide():this.state===H.PopoverState.Shown&&(this.state=H.PopoverState.Hiding,this.timer=window.setTimeout(()=>{this.shouldShow()?this.transition():this.hide()},this.waitTime))}detect(a){let{targetEl:u,hoverEl:h}=this;u&&(this.onTarget=a===u||u.contains(a)),this.onHover=a===h||h.contains(a)}_onMouseIn(a){this.targetEl&&!Jt(a,this.targetEl)||(this.onTarget=!0,this.transition())}_onMouseOut(a){this.targetEl&&!Jt(a,this.targetEl)||(this.onTarget=!1,this.transition())}position(a){a===void 0&&(a=this.shownPos);let u;if(a)u={top:a.y-10,bottom:a.y+10,left:a.x,right:a.x};else if(this.targetEl){let h=Wa(this.targetEl,this.document.body);u={top:h.top,bottom:h.top+this.targetEl.offsetHeight,left:h.left,right:h.left+this.targetEl.offsetWidth}}else u={top:0,bottom:0,left:0,right:0};this.document.body.appendChild(this.hoverEl),za(u,this.hoverEl,{gap:10},this.document),a&&setTimeout(()=>{let h=parseFloat(this.hoverEl.style.left),v=parseFloat(this.hoverEl.style.top);this.hoverEl.setAttribute("data-x",String(h)),this.hoverEl.setAttribute("data-y",String(v))},0)}shouldShow(){return this.shouldShowSelf()||this.shouldShowChild()}shouldShowChild(){return U.activePopovers().some(a=>a!==this&&a.targetEl&&this.hoverEl.contains(a.targetEl)?a.shouldShow():!1)}shouldShowSelf(){return!this.detaching&&!!(this.onTarget||this.onHover||this.state==H.PopoverState.Shown&&this.isPinned||this.document.querySelector(`body>.modal-container, body > #he${this.id} ~ .menu, body > #he${this.id} ~ .suggestion-container`))}calculateMinSize(){return{width:40,height:this.headerHeight}}calculateBoundaries(a,u,h){let v=h.element.closest("body"),d=(v==null?void 0:v.querySelector(".workspace"))||(v==null?void 0:v.querySelector(".workspace-window"));return d==null?void 0:d.getBoundingClientRect()}calculateMaxSize(a,u,h){let v=h.pointerType==="reflow"?this.document.body.offsetWidth/1.5:this.document.body.offsetWidth,d=h.pointerType==="reflow"?this.document.body.offsetHeight/1.5:this.document.body.offsetHeight;return{width:v,height:d}}toggleConstrainAspectRatio(a,u){let h=this.resizeModifiers.find(v=>v.name=="aspectRatio");!h||(a===void 0&&(a=!h.options.enabled),a?(h.enable(),this.constrainAspectRatio=!0,u!==void 0&&h.options.ratio!==u&&(h.options.ratio=u)):(h.disable(),this.constrainAspectRatio=!1))}registerInteract(){var T,_;let a=this.document.querySelector("div.app-container, div.workspace-split"),u=this,h=function(M,B,R){let{top:q,right:D,bottom:W,left:Q,x:le,y:$,width:J,height:rn}=a.getBoundingClientRect(),A={top:q,right:D,bottom:W,left:Q,x:le,y:$,width:J,height:rn};return R.pointerType==="reflow"?u.dragElementRect.bottom=1:u.dragElementRect.bottom=0,u.plugin.settings.snapToEdges&&(A.top=q-30),A.bottom=W-u.headerHeight,A},v=!0,d,E=((T=this.hoverEl.dataset)==null?void 0:T.imgRatio)?parseFloat((_=this.hoverEl.dataset)==null?void 0:_.imgRatio):void 0;this.resizeModifiers=[this.interactStatic.modifiers.restrictEdges({outer:u.calculateBoundaries.bind(this)}),this.interactStatic.modifiers.restrictSize({min:u.calculateMinSize.bind(this),max:u.calculateMaxSize.bind(this)}),this.interactStatic.modifiers.aspectRatio({ratio:E||"preserve",enabled:!1})],this.dragElementRect={top:0,left:1,bottom:0,right:0};let k=[this.interactStatic.modifiers.restrict({restriction:h,offset:{top:0,left:40,bottom:0,right:40},elementRect:this.dragElementRect,endOnly:!1})];this.constrainAspectRatio&&E!==void 0&&this.toggleConstrainAspectRatio(!0,E);let S=this.interactStatic(this.hoverEl).preventDefault("always").on("doubletap",this.onDoubleTap.bind(this)).draggable({modifiers:k,allowFrom:".popover-titlebar",listeners:{start(M){M.buttons&&u.togglePin(!0),M.buttons&&pe(M.target,HTMLElement)&&(M.target.addClass("is-dragging"),u.activate())},end(M){pe(M.target,HTMLElement)&&M.target.removeClass("is-dragging")},move:Ir.bind(u)}}).resizable({edges:{top:".top-left, .top-right, .top",left:".top-left, .bottom-left, .left",bottom:".bottom-left, .bottom-right, .bottom",right:".top-right, .bottom-right, .right"},modifiers:this.resizeModifiers,listeners:{start(M){var D;let B=M.target;u.activate(),B.style.removeProperty("max-height");let R=(D=u.hoverEl.querySelector(".view-header"))==null?void 0:D.offsetHeight;d=u.titleEl.offsetHeight+R,v=!0,M.buttons&&u.togglePin(!0)},move:function(M){var Q,le,$;if(!(M==null?void 0:M.deltaRect)||!M.edges)return;let{target:B}=M,{x:R,y:q}=B.dataset,D=M.rect.height,W=M.rect.width;R=R||B.style.left,q=q||B.style.top,R=String((parseFloat(R)||0)+((Q=M.deltaRect)==null?void 0:Q.left)),q=String((parseFloat(q)||0)+((le=M.deltaRect)==null?void 0:le.top)),u.constrainAspectRatio&&E&&M.buttons!==void 0?(v&&(M.edges.top&&(M.edges.right||M.edges.left)?q=String(parseFloat(q)-d):M.edges.top?R=String(parseFloat(R)+d*E):M.edges.left&&!(M.edges.top||M.edges.bottom)&&(q=String(parseFloat(q)-d))),v=!1,(M.edges.top&&!(M.edges.right||M.edges.left)||M.edges.bottom&&!(M.edges.right||M.edges.left))&&(D=D-d,W=W-d*E),D=D+d,(B.hasClass("snap-to-left")||B.hasClass("snap-to-right"))&&(q=String(parseFloat(B.style.top)),R=String(parseFloat(B.style.left)))):E&&D>(($=this==null?void 0:this.document)==null?void 0:$.body.offsetHeight)&&(D=D/1.5,W=D*E),Object.assign(B.style,{width:`${W}px`,height:`${D}px`,top:`${q}px`,left:R==="NaN"?"unset":`${R}px`}),Object.assign(B.dataset,{x:R,y:q})},end:function(M){M.rect.height>u.headerHeight&&M.target.removeAttribute("data-restore-height"),S.reflow({name:"drag",axis:"xy"})}}});this.interact=S}createResizeHandles(){this.hoverEl.createDiv("resize-handle bottom-left"),this.hoverEl.createDiv("resize-handle bottom-right"),this.hoverEl.createDiv("resize-handle top-left"),this.hoverEl.createDiv("resize-handle top-right"),this.hoverEl.createDiv("resize-handle right"),this.hoverEl.createDiv("resize-handle left"),this.hoverEl.createDiv("resize-handle bottom"),this.hoverEl.createDiv("resize-handle top")}onDoubleTap(a){a.target.tagName==="DIV"&&a.target.closest(".popover-titlebar")&&(a.preventDefault(),this.togglePin(!0),this.toggleMinimized())}show(){var a,u;!this.targetEl||this.document.body.contains(this.targetEl)?(this.state=H.PopoverState.Shown,this.timer=0,this.shownPos=Qt,this.position(Qt),this.document.removeEventListener("mousemove",dt),this.onShow(),app.workspace.onLayoutChange(),this.load()):this.hide(),this.hoverEl.dataset.imgHeight&&this.hoverEl.dataset.imgWidth&&(this.hoverEl.style.height=parseFloat(this.hoverEl.dataset.imgHeight)+this.titleEl.offsetHeight+"px",this.hoverEl.style.width=parseFloat(this.hoverEl.dataset.imgWidth)+"px"),this.registerInteract(),(a=this.interact)==null||a.reflow({name:"resize",edges:{right:!0,bottom:!0}}),(u=this.interact)==null||u.reflow({name:"drag",axis:"xy"})}onHide(){var a;this.oldPopover=null,((a=this.parent)==null?void 0:a.hoverPopover)===this&&(this.parent.hoverPopover=null)}hide(){var u,h,v;if(this.onTarget=this.onHover=!1,this.isPinned=!1,this.detaching=!0,(u=qn.get(this.document.win))==null||u.delete(this),this.document.removeEventListener("mousemove",dt),this.timer&&(clearTimeout(this.timer),this.timer=0),this.hoverEl.hide(),this.opening)return;let a=this.leaves();if(a.length)a.forEach(d=>{d.view instanceof H.MarkdownView&&!this._loaded&&(d.view.onMarkdownFold=()=>null),d.detach(),d===app.workspace.activeLeaf&&(app.workspace.activeLeaf=null)});else return this.parent=null,((h=this.interact)==null?void 0:h.unset)&&this.interact.unset(),(v=this.abortController)==null||v.unload(),this.abortController=void 0,this.interact=void 0,this.nativeHide()}nativeHide(){var h;let{hoverEl:a,targetEl:u}=this;if(this.state=H.PopoverState.Hidden,a.detach(),u){let v=u.matchParent(".hover-popover");v&&((h=Zt.get(v))==null||h.transition()),u.removeEventListener("mouseover",this.onMouseIn),u.removeEventListener("mouseout",this.onMouseOut)}this.onHide(),this.unload()}resolveLink(a,u){let h=(0,H.parseLinktext)(a);return h?this.plugin.app.metadataCache.getFirstLinkpathDest(h.path,u):null}async openLink(a,u,h,v){var R,q,D;let d=this.resolveLink(a,u),E=(0,H.parseLinktext)(a);if(!d&&v){let W=this.plugin.app.fileManager.getNewFileParent(u);d=await this.plugin.app.fileManager.createNewMarkdownFile(W,E.path)}if(!d){this.displayCreateFileAction(a,u,h);return}let{viewRegistry:k}=this.plugin.app,S=k.typeByExtension[d.extension];if(!S||!k.viewByType[S]){this.displayOpenFileAction(d);return}h=Object.assign(this.buildEphemeralState(d,E),h);let T=this.getDefaultMode(),_=this.buildState(T,h),M=await this.openFile(d,_,v),B=(R=M==null?void 0:M.view)==null?void 0:R.getViewType();if(B==="image"){this.plugin.settings.autoFocus&&((q=this.parent)==null?void 0:q.hasOwnProperty("editorEl"))&&this.parent.editorEl.hasClass("is-live-preview")&&(this.waitTime=3e3),this.constrainAspectRatio=!0;let W=M.view.contentEl.querySelector("img");this.hoverEl.dataset.imgHeight=String(W.naturalHeight),this.hoverEl.dataset.imgWidth=String(W.naturalWidth),this.hoverEl.dataset.imgRatio=String(W.naturalWidth/W.naturalHeight)}else B==="pdf"&&(this.hoverEl.style.height="800px",this.hoverEl.style.width="600px");((D=_.state)==null?void 0:D.mode)==="source"&&this.whenShown(()=>{var W,Q,le,$;(0,H.requireApiVersion)("1.0")&&((le=(Q=(W=M==null?void 0:M.view)==null?void 0:W.editMode)==null?void 0:Q.reinit)==null||le.call(Q)),($=M==null?void 0:M.view)==null||$.setEphemeralState(_.eState)})}displayOpenFileAction(a){let h=this.attachLeaf().view;h.emptyTitleEl.hide(),h.actionListEl.empty();let{actionListEl:v}=h;v.createDiv({cls:"file-embed-title"},d=>{d.createSpan({cls:"file-embed-icon"},E=>(0,H.setIcon)(E,"document",22)),d.appendText(" "+a.name)}),v.addEventListener("click",()=>this.plugin.app.openWithDefaultApp(a.path)),v.setAttribute("aria-label",i18next.t("interface.embed-open-in-default-app-tooltip"))}displayCreateFileAction(a,u,h){var E,k,S;let v=this.attachLeaf(),d=v.view;if(d){(E=d.emptyTitleEl)==null||E.hide(),(k=d.actionListEl)==null||k.empty();let T=(S=d.actionListEl)==null?void 0:S.createEl("button","empty-state-action");if(!T)return;T.textContent=`${a} is not yet created. Click to create.`,this.plugin.settings.autoFocus&&setTimeout(()=>{T==null||T.focus()},200),T.addEventListener("click",async()=>{this.togglePin(!0),await this.openLink(a,u,h,v)},{once:!0})}}whenShown(a){if(this.detaching)return;let u=this.onShowCallback;this.onShowCallback=()=>{this.detaching||(a(),typeof u=="function"&&u())},this.state===H.PopoverState.Shown&&(this.onShowCallback(),this.onShowCallback=void 0)}async openFile(a,u,h){var d,E,k;if(this.detaching)return;let v=h!=null?h:this.attachLeaf();this.opening=!0;try{if(await v.openFile(a,u),this.plugin.settings.autoFocus&&!this.detaching)this.whenShown(()=>{app.workspace.setActiveLeaf(v,!1,!1),app.workspace.activeLeaf===v&&v.setEphemeralState({focus:!0}),setTimeout(oe(H.Workspace.prototype,{recordMostRecentOpenedFile(T){return function(_){if(_!==a)return T.call(this,_)}}}),1);let S=this.plugin.app.plugins.plugins["recent-files-obsidian"];S&&setTimeout(oe(S,{shouldAddFile(T){return function(_){return _!==a&&T.call(this,_)}}}),1)});else if(!this.plugin.settings.autoFocus&&!this.detaching){let S=this.hoverEl.querySelector(".popover-title");if(!S)return;S.textContent=(d=v.view)==null?void 0:d.getDisplayText(),S.setAttribute("data-path",(k=(E=v.view)==null?void 0:E.file)==null?void 0:k.path)}}catch(S){console.error(S)}finally{this.opening=!1,this.detaching&&this.hide()}return v}buildState(a,u){let v=this.plugin.settings.defaultMode==="match"?a:this.plugin.settings.defaultMode;return{active:!1,state:{mode:v},eState:u}}buildEphemeralState(a,u){let h=this.plugin.app.metadataCache.getFileCache(a),v=h?(0,H.resolveSubpath)(h,(u==null?void 0:u.subpath)||""):void 0,d={subpath:u==null?void 0:u.subpath};return v&&(d.line=v.start.line,d.startLoc=v.start,d.endLoc=v.end||void 0),d}};function pt(g){return g.containerEl.matches(".popover.hover-popover.hover-editor .workspace-leaf")}function za(g,a,u,h){u=u||{},a.show();let v=u.gap||0,d=u.preference||"bottom",E=u.offsetParent||a.offsetParent||h.documentElement,k=u.horizontalAlignment||"left",S=E.scrollTop+10,T=E.scrollTop+E.clientHeight-10,_=Math.min(g.top,T),M=Math.max(g.bottom,S),B=a.offsetHeight,R=g.top-S>=B+v,q=T-g.bottom>=B+v,D=0,W="";!R||d!=="top"&&q?!q||d!=="bottom"&&R?E.clientHeight<B+v?(D=S,W="overlap"):d==="top"?(D=S+v,W="overlap"):(D=T-B,W="overlap"):(D=M+v,W="bottom"):(D=_-v-B,W="top");let Q=E.scrollLeft+10,le=E.scrollLeft+E.clientWidth-10,$=a.offsetWidth,J=k==="left"?g.left:g.right-$;return J<Q?J=Q:J>le-$&&(J=le-$),a.style.top="".concat(D.toString(),"px"),a.style.left="".concat(J.toString(),"px"),{top:D,left:J,vresult:W}}function Wa(g,a){let u=0,h=0;for(let v=a?a.offsetParent:null;g&&g!==a&&g!==v;){u+=g.offsetTop,h+=g.offsetLeft;let d=g.offsetParent;for(let E=g.parentElement;E&&E!==d;)u-=E.scrollTop,h-=E.scrollLeft,E=E.parentElement;d&&d!==a&&d!==v&&(u-=d.scrollTop,h-=d.scrollLeft),g=d}return{top:u,left:h}}function dt(g){Qt={x:g.clientX,y:g.clientY}}function Jt(g,a){let u=g.relatedTarget;return!(pe(u,Node)&&a.contains(u))}function Rr(g,a){return!!(g&&a&&g.right>a.left&&g.left<a.right&&g.bottom>a.top&&g.top<a.bottom)}var en=new WeakMap;function Nr(g,a,u,h,v,d,...E){var T;u&&u.matches('.workspace-leaf-content[data-type="calendar"] table.calendar td > div')&&(u=u.parentElement),d&&"scroll"in d&&!("line"in d)&&u&&u.matches(".search-result-file-match")&&(d.line=d.scroll,delete d.scroll),u&&u.matches(".bookmark .tree-item-inner")&&(a&&a.innerEl===u&&(a=a.tree),u=(T=u.parentElement)!=null?T:u);let k=en.has(u)?en.get(u):a.hoverPopover;if(k==null?void 0:k.lockedOut)return;if(k&&k.state!==Pe.PopoverState.Hidden&&(!k.isPinned||g.settings.autoPin==="always")&&k.targetEl!==null&&k.originalLinkText===h&&k.originalPath===v&&u&&k.adopt(u))en.set(u,k);else{let _=new U(a,u,g,g.settings.triggerDelay);u&&en.set(u,_),_.originalLinkText=h,_.originalPath=v,a.hoverPopover=_;let M=_.abortController,B=function(){!_||(_.lockedOut=!1)},R=function(W){!_||pe(W.target,HTMLElement)&&!W.target.closest(".hover-editor, .menu")&&(_.state=Pe.PopoverState.Hidden,_.hide(),_.lockedOut=!0,setTimeout(B,1e3))},{document:q}=_,D=function(W){if(!_)return;let Q=Pe.Platform.isMacOS?"Meta":"Control";!_.onHover&&_.state!==Pe.PopoverState.Shown&&W.key!==Q?(_.state=Pe.PopoverState.Hidden,_.hide(),_.lockedOut=!0,setTimeout(B,1e3)):q.body.removeEventListener("keyup",D,!0)};q.addEventListener("pointerdown",R,!0),q.addEventListener("mousedown",R,!0),q.body.addEventListener("keyup",D,!0),M.register(()=>{q.removeEventListener("pointerdown",R,!0),q.removeEventListener("mousedown",R,!0),q.body.removeEventListener("keyup",D,!0)}),setTimeout(()=>{(_==null?void 0:_.state)!=Pe.PopoverState.Hidden&&(_==null||_.openLink(h,v,d))},0)}}var Ge=be(require("obsidian"));var Yn=Symbol.for("v1.to-use.peak-dev.org"),Un=Symbol.for("v1.factory.to-use.peak-dev.org"),Ke,ft,se=function(){return Object.defineProperties(g(),{this:{get(){if(Ke)return Ke;throw new TypeError("No current context")}},me:{value:Yn},factory:{value:Un}});function g(v){let d=new Map;d.prev=v;let E=Object.assign(v?S=>{let T=d.get(S);if(!T){for(let R=d.prev;R;R=R.prev)if(T=R.get(S)){T=Object.assign(Object.assign({},T),{s:T.s||1});break}T=T||{s:2,v:u},d.set(S,T)}let _,M,B;for(;;)switch(T.s){case 0:return Ke===E&&ft&&ft.push(S),T.v;case 1:if(_=T.d,!_||k(()=>_.k.every(R=>E(R)===_.c(R)))){T.s=0;break}T.v=_.f;case 2:T.s=4;try{a(d,S,0,k(M=T.v,S,B=[])),B.length&&(T.d={c:E,f:M,k:B});break}catch(R){T.s=3,T.v=R,T.d=null}case 3:throw T.v;case 4:throw new Error(`Factory ${String(T.v)} didn't resolve ${String(S)}`)}}:S=>se.this(S),{def(S,T){return a(d,S,2,T),E},set(S,T){return a(d,S,1,T),E},fork(S){let T=g(d);return S!=null?T(S):T}});return v?E.use=E:E;function k(S,T,_){let M=Ke,B=ft;try{return Ke=E,ft=_,S(T)}finally{Ke=M,ft=B}}}function a(v,d,E,k){if(v.has(d)){let S=v.get(d);if(!S.s)throw new Error(`Already read: ${String(d)}`);S.s=E,S.v=k,S.d=null}else v.set(d,{s:E,v:k})}function u(v){if(typeof v[Yn]=="function")return v[Yn](v);if(h(v))return typeof v.prototype[Un]=="function"?v.prototype[Un]():new v;throw new ReferenceError(`No config for ${String(v)}`)}function h(v){return typeof v=="function"&&v.prototype!==void 0&&(Object.getPrototypeOf(v.prototype)!==Object.prototype||Object.getOwnPropertyNames(v.prototype).length>1||v.toString().startsWith("class"))}}();var qr,$e=(qr=window.queueMicrotask)!=null?qr:(g=>a=>g.then(a))(Promise.resolve());se.def(Ge.Plugin,()=>{throw new Error("Plugin not created yet")});var tn=class extends Ge.Component{constructor(){super(...arguments);this.use=se.service(this)}};se.service=function g(g){return se(Kn).addChild(g),se.this};se.plugin=function g(g){let a=se.fork().set(Ge.Plugin,g).set(g.constructor,g);return g.addChild(a.use(Kn)),a};var Kn=class extends Ge.Component{constructor(){super(...arguments);this.children=new Set([this])}onload(){this.loaded=!0}onunload(){this.loaded=!1,this.children.clear()}addChild(a){return this.children.has(a)||(this.children.add(a),this.loaded?$e(()=>super.addChild(a)):super.addChild(a)),a}};var Xr=be(require("obsidian"));var $n=2,Is=Symbol.for(`v${$n}.layout-storage-events.ophidian.peak-dev.org`);var As=`ophidian-layout-storage:v${$n}:item-load`,Ds=`ophidian-layout-storage:v${$n}:item-save`;var Yr=be(require("obsidian"));var Ur=be(require("obsidian"));var Gn=class extends Ur.Component{constructor(a,u){super();this.use=a;this.win=u}get container(){return Ba(this.win)}[se.factory](){return new Kr(this.constructor)}},Kr=class extends tn{constructor(a){super();this.factory=a;this.instances=new WeakMap;this.watching=!1}watch(){if(!this._loaded)this.onload=()=>this.watch();else if(!this.watching){let{workspace:a}=app;this.watching=!0,this.registerEvent(a.on("window-open",(u,h)=>{a.onLayoutReady(()=>$e(()=>this.forWindow(h)))})),a.onLayoutReady(()=>$e(()=>this.forAll()))}return this}forWindow(a=(h=>(h=window.activeWindow)!=null?h:window)(),u=!0){let v=this.instances.get(a);return!v&&u&&(v=new this.factory(this.use,a),v&&(this.instances.set(a,v),v.registerDomEvent(a,"beforeunload",()=>{this.removeChild(v),this.instances.delete(a)}),this.addChild(v))),v||void 0}forDom(a,u=!0){return this.forWindow(Va(a),u)}forLeaf(a,u=!0){return this.forDom(a.containerEl,u)}forView(a,u=!0){return this.forLeaf(a.leaf,u)}forAll(a=!0){return Fa().map(u=>this.forWindow(u,a)).filter(u=>u)}};function Fa(){let g=[window],{floatingSplit:a}=app.workspace;if(a)for(let u of a.children)u.win&&g.push(u.win);return g}function Va(g){return g.win||(g.ownerDocument||g).defaultView||window}function Ba(g){if(g===window)return app.workspace.rootSplit;let{floatingSplit:a}=app.workspace;if(a){for(let u of a.children)if(g===u.win)return u}}var re=be(require("obsidian"));var nn={defaultMode:"preview",autoPin:"onMove",triggerDelay:300,closeDelay:600,autoFocus:!0,rollDown:!1,snapToEdges:!1,initialHeight:"340px",initialWidth:"400px",showViewHeader:!1,imageZoom:!0,hoverEmbeds:!1},Na={preview:"Reading view",source:"Editing view",match:"Match current view"},qa={onMove:"On drag or resize",always:"Always"},Zn=class extends re.PluginSettingTab{constructor(a,u){super(a,u);this.plugin=u}hide(){}display(){let{containerEl:a}=this;a.empty(),new re.Setting(a).setName("Default Mode").addDropdown(u=>{u.addOptions(Na),u.setValue(this.plugin.settings.defaultMode),u.onChange(async h=>{this.plugin.settings.defaultMode=h,await this.plugin.saveSettings()})}),new re.Setting(a).setName("Auto Pin").addDropdown(u=>{u.addOptions(qa),u.setValue(this.plugin.settings.autoPin),u.onChange(async h=>{this.plugin.settings.autoPin=h,await this.plugin.saveSettings()})}),new re.Setting(a).setName("Trigger hover preview on embeds").setDesc("Allow hover preview to trigger when hovering over any type of rendered embed such as images or block references").addToggle(u=>u.setValue(this.plugin.settings.hoverEmbeds).onChange(h=>{this.plugin.settings.hoverEmbeds=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Auto Focus").setDesc("Set the hover editor as the active pane when opened").addToggle(u=>u.setValue(this.plugin.settings.autoFocus).onChange(h=>{this.plugin.settings.autoFocus=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Minimize downwards").setDesc("When double clicking to minimize, the window will roll down instead of rolling up").addToggle(u=>u.setValue(this.plugin.settings.rollDown).onChange(h=>{this.plugin.settings.rollDown=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Snap to edges").setDesc(`Quickly arrange popovers by dragging them to the edges of the screen. The left and right edges
will maximize the popover vertically. The top edge will maximize the popover to fill the entire
screen. Dragging the popovers away from the edges will restore the popver to its original size.`).addToggle(u=>u.setValue(this.plugin.settings.snapToEdges).onChange(h=>{this.plugin.settings.snapToEdges=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Show view header by default").setDesc(`Show the view header by default when triggering a hover editor.
When disabled, view headers will only show if you click the view header icon to the left of the minimize button.`).addToggle(u=>u.setValue(this.plugin.settings.showViewHeader).onChange(h=>{this.plugin.settings.showViewHeader=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Click to zoom image").setDesc(`Click and hold an image within a hover editor to temporarily maximize the popover and image to fill the entire viewport.
On mouse up, the hover editor will restore to its original size.`).addToggle(u=>u.setValue(this.plugin.settings.imageZoom).onChange(h=>{this.plugin.settings.imageZoom=h,this.plugin.saveSettings()})),new re.Setting(a).setName("Initial popover width").setDesc("Enter any valid CSS unit").addText(u=>{u.setPlaceholder(this.plugin.settings.initialWidth),u.inputEl.type="text",u.setValue(this.plugin.settings.initialWidth),u.onChange(async h=>{h=Fn(h),h||(h=nn.initialWidth),this.plugin.settings.initialWidth=h,this.plugin.saveSettings()})}),new re.Setting(a).setName("Initial popover height").setDesc("Enter any valid CSS unit").addText(u=>{u.setPlaceholder(String(this.plugin.settings.initialHeight)),u.inputEl.type="text",u.setValue(String(this.plugin.settings.initialHeight)),u.onChange(async h=>{h=Fn(h),h||(h=nn.initialHeight),this.plugin.settings.initialHeight=h,this.plugin.saveSettings()})}),new re.Setting(a).setName("Hover Trigger Delay (ms)").setDesc("How long to wait before showing a Hover Editor when hovering over a link").addText(u=>{u.setPlaceholder(String(this.plugin.settings.triggerDelay)),u.inputEl.type="number",u.setValue(String(this.plugin.settings.triggerDelay)),u.onChange(async h=>{this.plugin.settings.triggerDelay=Number(h),this.plugin.saveSettings()})}),new re.Setting(a).setName("Hover Close Delay (ms)").setDesc("How long to wait before closing a Hover Editor once the mouse leaves").addText(u=>{u.setPlaceholder(String(this.plugin.settings.closeDelay)),u.inputEl.type="number",u.setValue(String(this.plugin.settings.closeDelay)),u.onChange(async h=>{this.plugin.settings.closeDelay=Number(h),this.plugin.saveSettings()})})}};var Jn=be(Gr());var Zr=class extends Gn{constructor(){super(...arguments);this.interact=this.createInteractor();this.plugin=this.use(on)}createInteractor(){if(this.win===window)return Jn.default;let a=Jn.default.scope,h=new a.constructor().init(this.win).interactStatic;for(let v of a._plugins.list)h.use(v);return h}onload(){this.win.addEventListener("resize",this.plugin.debouncedPopoverReflow)}onunload(){this.win.removeEventListener("resize",this.plugin.debouncedPopoverReflow);try{this.interact.removeDocument(this.win.document)}catch(a){console.error(a)}}},on=class extends V.Plugin{constructor(){super(...arguments);this.use=se.plugin(this);this.interact=this.use(Zr);this.debouncedPopoverReflow=(0,V.debounce)(()=>{U.activePopovers().forEach(a=>{var u;(u=a.interact)==null||u.reflow({name:"drag",axis:"xy"})})},100,!0)}async onload(){this.registerActivePopoverHandler(),this.registerFileRenameHandler(),this.registerContextMenuHandler(),this.registerCommands(),this.patchUnresolvedGraphNodeHover(),this.patchWorkspace(),this.patchQuickSwitcher(),this.patchWorkspaceLeaf(),this.patchItemView(),this.patchMarkdownPreviewRenderer(),this.patchMarkdownPreviewView(),await this.loadSettings(),this.registerSettingsTab(),this.app.workspace.onLayoutReady(()=>{this.patchSlidingPanes(),this.patchLinkHover(),setTimeout(()=>{this.app.workspace.trigger("css-change")},2e3)})}get activePopovers(){return U.activePopovers()}patchWorkspaceLeaf(){this.register(oe(V.WorkspaceLeaf.prototype,{getRoot(a){return function(){let u=a.call(this);return u.getRoot===this.getRoot?u:u.getRoot()}},onResize(a){return function(){var u;(u=this.view)==null||u.onResize()}},setViewState(a){return async function(u,h){var d,E,k;let v=await a.call(this,u,h);try{let S=U.forLeaf(this);if(S){u.type&&S.hoverEl.setAttribute("data-active-view-type",u.type);let T=S.hoverEl.querySelector(".popover-title");T&&(T.textContent=(d=this.view)==null?void 0:d.getDisplayText(),((k=(E=this.view)==null?void 0:E.file)==null?void 0:k.path)?T.setAttribute("data-path",this.view.file.path):T.removeAttribute("data-path"))}}catch(S){}return v}},setEphemeralState(a){return function(u){var h;a.call(this,u),u.focus&&((h=this.view)==null?void 0:h.getViewType())==="empty"&&(this.view.contentEl.tabIndex=-1,this.view.contentEl.focus())}}})),this.register(oe(V.WorkspaceItem.prototype,{getContainer(a){return function(){if(!!a)return!this.parentSplit||this instanceof V.WorkspaceContainer?a.call(this):this.parentSplit.getContainer()}}}))}patchQuickSwitcher(){let a=this,{QuickSwitcherModal:u}=this.app.internalPlugins.plugins.switcher.instance,h=oe(u.prototype,{open(v){return function(){let d=v.call(this);return this.instructionsEl&&setTimeout(oe(this.instructionsEl,{empty(E){return()=>{}}}),0),this.setInstructions([{command:V.Platform.isMacOS?"cmd p":"ctrl p",purpose:"to open in new popover"}]),this.scope.register(["Mod"],"p",E=>{this.close();let k=this.chooser.values[this.chooser.selectedItem];if(!(k==null?void 0:k.file))return;let S=a.spawnPopover(void 0,()=>this.app.workspace.setActiveLeaf(S,!1,!0));return S.openFile(k.file),!1}),d}}});this.register(h)}patchItemView(){let a=this,[u,h]=V.View.prototype.onPaneMenu?[V.View,"onPaneMenu"]:[V.ItemView,"onMoreOptionsMenu"],v=oe(u.prototype,{[h](d){return function(E,...k){return(this.leaf?U.forLeaf(this.leaf):void 0)?E.addItem(T=>{var _,M;(M=(_=T.setIcon("popup-open").setTitle("Dock Hover Editor to workspace").onClick(()=>{a.dockPopoverToWorkspace(this.leaf)})).setSection)==null||M.call(_,"open")}):(E.addItem(T=>{var _,M;(M=(_=T.setIcon("popup-open").setTitle("Open in Hover Editor").onClick(()=>{var R;let B=a.spawnPopover();((R=this.leaf)==null?void 0:R.getViewState)&&B.setViewState(this.leaf.getViewState())})).setSection)==null||M.call(_,"open")}),E.addItem(T=>{var _,M;(M=(_=T.setIcon("popup-open").setTitle("Convert to Hover Editor").onClick(()=>{a.convertLeafToPopover(this.leaf)})).setSection)==null||M.call(_,"open")})),d.call(this,E,...k)}}});this.register(v)}patchMarkdownPreviewView(){this.register(oe(V.MarkdownPreviewView.prototype,{onResize(a){return function(){this.renderer.onResize(),this.view.scroll!==null&&this.view.scroll!==this.getScroll()&&this.renderer.applyScrollDelayed(this.view.scroll)}}}))}patchMarkdownPreviewRenderer(){let a=this,u=oe(V.MarkdownPreviewRenderer,{registerDomEvents(h){return function(v,d,...E){return v==null||v.on("mouseover",".internal-embed.is-loaded",(k,S)=>{var T,_,M,B,R;S&&a.settings.hoverEmbeds&&app.workspace.trigger("hover-link",{event:k,source:S.matchParent(".markdown-source-view")?"editor":"preview",hoverParent:(T=d.hoverParent)!=null?T:d.info,targetEl:S,linktext:S.getAttribute("src"),sourcePath:((R=(B=(M=(_=d.info)!=null?_:d).getFile)==null?void 0:B.call(M))==null?void 0:R.path)||""})}),h.call(this,v,d,...E)}}});this.register(u)}patchWorkspace(){let a=!1,u=oe(V.Workspace.prototype,{changeLayout(h){return async function(v){a=!0;try{await h.call(this,v)}finally{a=!1}}},recordHistory(h){return function(v,d,...E){var S;if(!(!((S=this.app.plugins.plugins["pane-relief"])==null?void 0:S._loaded)&&pt(v)))return h.call(this,v,d,...E)}},iterateLeaves(h){return function(v,d){if(h.call(this,v,d))return!0;let E=typeof v=="function"?v:d,k=typeof v=="function"?d:v;if(!k||a)return!1;if(k===app.workspace.rootSplit||V.WorkspaceContainer&&k instanceof V.WorkspaceContainer){for(let S of U.popoversForWindow(k.win))if(h.call(this,E,S.rootSplit))return!0}return!1}},getDropLocation(h){return function(d){for(let E of U.activePopovers()){let k=this.recursiveGetTarget(d,E.rootSplit);if(k)return V.requireApiVersion&&(0,V.requireApiVersion)("0.15.3")?k:{target:k,sidedock:!1}}return h.call(this,d)}},onDragLeaf(h){return function(v,d){let E=U.forLeaf(d);return E==null||E.togglePin(!0),h.call(this,v,d)}}});this.register(u)}patchSlidingPanes(){var u;let a=(u=this.app.plugins.plugins["sliding-panes-obsidian"])==null?void 0:u.constructor;if(a){let h=oe(a.prototype,{handleFileOpen(v){return function(...d){if(!pt(this.app.workspace.activeLeaf))return v.call(this,...d)}},handleLayoutChange(v){return function(...d){if(!pt(this.app.workspace.activeLeaf))return v.call(this,...d)}},focusActiveLeaf(v){return function(...d){if(!pt(this.app.workspace.activeLeaf))return v.call(this,...d)}}});this.register(h)}}patchLinkHover(){let a=this,u=this.app.internalPlugins.plugins["page-preview"];if(!u.enabled)return;let h=oe(u.instance.constructor.prototype,{onHoverLink(v){return function(d,...E){return d&&pe(d.event,MouseEvent)&&dt(d.event),v.call(this,d,...E)}},onLinkHover(v){return function(d,E,k,S,T,..._){Nr(a,d,E,k,S,T,..._)}}});this.register(h),u.disable(),u.enable(),a.register(function(){!u.enabled||(u.disable(),u.enable())})}registerContextMenuHandler(){this.registerEvent(this.app.workspace.on("file-menu",(a,u,h,v)=>{let d=v?U.forLeaf(v):void 0;u instanceof V.TFile&&!d&&!v&&a.addItem(E=>{var k,S;(S=(k=E.setIcon("popup-open").setTitle("Open in Hover Editor").onClick(()=>{this.spawnPopover().openFile(u)})).setSection)==null||S.call(k,"open")})}))}registerActivePopoverHandler(){this.registerEvent(this.app.workspace.on("active-leaf-change",a=>{var h,v,d,E,k;(h=U.activePopover)==null||h.hoverEl.removeClass("is-active");let u=U.activePopover=a?U.forLeaf(a):void 0;if(u&&a){u.activate(),u.hoverEl.addClass("is-active");let S=u.hoverEl.querySelector(".popover-title");if(!S)return;S.textContent=(v=a.view)==null?void 0:v.getDisplayText(),((d=a==null?void 0:a.view)==null?void 0:d.getViewType())&&u.hoverEl.setAttribute("data-active-view-type",a.view.getViewType()),((k=(E=a.view)==null?void 0:E.file)==null?void 0:k.path)?S.setAttribute("data-path",a.view.file.path):S.removeAttribute("data-path")}}))}registerFileRenameHandler(){this.app.vault.on("rename",(a,u)=>{U.iteratePopoverLeaves(this.app.workspace,h=>{var v,d;if(a===((v=h==null?void 0:h.view)==null?void 0:v.file)&&a instanceof V.TFile){let E=U.forLeaf(h);if(E==null?void 0:E.hoverEl){let k=E.hoverEl.querySelector(".popover-title");if(!k)return;let S=k.getAttribute("data-path");u===S&&(k.textContent=(d=h.view)==null?void 0:d.getDisplayText(),k.setAttribute("data-path",a.path))}}})})}patchUnresolvedGraphNodeHover(){var d,E;let a=new V.WorkspaceLeaf(this.app),u=this.app.internalPlugins.plugins.graph.views.localgraph(a),h=u.engine.constructor;a.detach(),(E=(d=u.renderer)==null?void 0:d.worker)==null||E.terminate();let v=oe(h.prototype,{onNodeHover(k){return function(S,T,_,...M){if(_==="unresolved"){if(this.onNodeUnhover(),pe(S,MouseEvent)){if(this.hoverPopover&&this.hoverPopover.state!==V.PopoverState.Hidden&&this.lastHoverLink===T)return this.hoverPopover.onTarget=!0,void this.hoverPopover.transition();this.lastHoverLink=T,this.app.workspace.trigger("hover-link",{event:S,source:"graph",hoverParent:this,targetEl:null,linktext:T})}}else return k.call(this,S,T,_,...M)}}});this.register(v),a.detach()}onunload(){U.activePopovers().forEach(a=>a.hide())}async loadSettings(){this.settings=Object.assign({},nn,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}registerCommands(){this.addCommand({id:"bounce-popovers",name:"Toggle bouncing popovers",callback:()=>{this.activePopovers.forEach(a=>{a.toggleBounce()})}}),this.addCommand({id:"open-new-popover",name:"Open new Hover Editor",callback:()=>{let a=this.spawnPopover(void 0,()=>this.app.workspace.setActiveLeaf(a,!1,!0))}}),this.addCommand({id:"open-link-in-new-popover",name:"Open link under cursor in new Hover Editor",checkCallback:a=>{let u=this.app.workspace.getActiveViewOfType(V.MarkdownView);if(u){if(!a){let h=u.editor.getClickableTokenAt(u.editor.getCursor());if((h==null?void 0:h.type)==="internal-link"){let v=this.spawnPopover(void 0,()=>this.app.workspace.setActiveLeaf(v,!1,!0));v.openLinkText(h.text,u.file.path)}}return!0}return!1}}),this.addCommand({id:"open-current-file-in-new-popover",name:"Open current file in new Hover Editor",checkCallback:a=>{var h,v;let u=(v=(h=this.app.workspace.activeEditor)==null?void 0:h.file)!=null?v:this.app.workspace.getActiveFile();if(u){if(!a){let d=this.spawnPopover(void 0,()=>this.app.workspace.setActiveLeaf(d,!1,!0));d.openFile(u)}return!0}return!1}}),this.addCommand({id:"convert-active-pane-to-popover",name:"Convert active pane to Hover Editor",checkCallback:a=>{let{activeLeaf:u}=this.app.workspace;return u?(a||this.convertLeafToPopover(u),!0):!1}}),this.addCommand({id:"dock-active-popover-to-workspace",name:"Dock active Hover Editor to workspace",checkCallback:a=>{let{activeLeaf:u}=this.app.workspace;return u&&U.forLeaf(u)?(a||this.dockPopoverToWorkspace(u),!0):!1}}),this.addCommand({id:"restore-active-popover",name:"Restore active Hover Editor",checkCallback:a=>jr(a)}),this.addCommand({id:"minimize-active-popover",name:"Minimize active Hover Editor",checkCallback:a=>Hr(a)}),Ar.forEach(a=>{this.addCommand({id:`snap-active-popover-to-${a}`,name:`Snap active Hover Editor to ${a}`,checkCallback:u=>Dr(a,u)})})}convertLeafToPopover(a){if(!a)return;let u=this.spawnPopover(void 0,()=>{let{parentSplit:h}=u,{parentSplit:v}=a;v.removeChild(a),h.replaceChild(0,a,!0),this.app.workspace.setActiveLeaf(a,!1,!0)});return u}dockPopoverToWorkspace(a){if(!a)return;a.parentSplit.removeChild(a);let{rootSplit:u}=this.app.workspace;return(0,V.requireApiVersion)("0.16.3")&&u.children[0]instanceof V.WorkspaceTabs?u.children[0].insertChild(-1,a):u.insertChild(-1,a),app.workspace.activeLeaf=null,app.workspace.setActiveLeaf(a,!1,!0),a}spawnPopover(a,u){let h=this.app.workspace.activeLeaf;a||(a=h.containerEl);let v=new U(h,a,this,void 0,u);return v.togglePin(!0),v.attachLeaf()}registerSettingsTab(){this.settingsTab=new Zn(this.app,this),this.addSettingTab(this.settingsTab)}};function Xn(g){let a=[];for(let u=0;u<g;u++)a.push((16*Math.random()|0).toString(16));return a.join("")}