Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dflex/core-instance

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dflex/core-instance - npm Package Compare versions

Comparing version 3.10.1 to 3.10.2

2

./dist/dflex-core.js

@@ -1,1 +0,1 @@

class t{constructor(t,s){this.x=t,this.y=s}}class s extends t{setAxes(t,s){this.x=t,this.y=s}clone(t){this.setAxes(t.x,t.y)}getInstance(){return{x:this.x,y:this.y}}isInstanceEqual(t){return this.x===t.x&&this.y===t.y}isEqual(t,s){return this.x===t&&this.y===s}isNotEqual(t,s){return this.x!==t||this.y!==s}}class i{constructor(t,s,i,h){this.top=t,this.right=s,this.bottom=i,this.left=h}}class h extends i{clone(t){this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left}setBox(t,s,i,h){return this.top=t,this.right=s,this.bottom=i,this.left=h,this}getBox(){return{top:this.top,right:this.right,bottom:this.bottom,left:this.left}}setByAxis(t,s,i){"x"===t?(this.left=s,this.right=i):(this.top=s,this.bottom=i)}setOne(t,s,i){"x"===t?-1===s?this.left=i:this.right=i:-1===s?this.top=i:this.bottom=i}getOne(t,s){return"x"===t?-1===s?this.left:this.right:-1===s?this.top:this.bottom}setPositionInstance(t){this.top=t.y,this.left=t.x}setPosition(t,s){this.top=s,this.left=t}hasEqualPosition(t,s){return this.top===s||this.left===t}getPosition(){return{x:this.left,y:this.top}}}class e extends h{constructor(t,s,i,h){super(t,s,i,h)}setFalsy(){return this.setBox(!1,!1,!1,!1),this}isTruthyByAxis(t){return"x"===t?this.left||this.right:this.top||this.bottom}isTruthyOnSide(t,s){return"x"===t?1===s?this.right:this.left:1===s?this.bottom:this.top}isTruthy(){return this.left||this.right||this.top||this.bottom}}class n extends h{t(t){return this.top>=t.bottom}i(t){return this.bottom<=t.top}h(t){return this.right<=t.left}o(t){return this.left>=t.right}u(t){return this.top<t.top}l(t){return this.right>t.right}m(t){return this.bottom>t.bottom}p(t){return this.left<t.left}T(t){return this.top>=t.top}_(t){return this.right<=t.right}v(t){return this.bottom<=t.bottom}O(t){return this.left>=t.left}isBoxIntersect(t){return!(this.i(t)||this.o(t)||this.t(t)||this.h(t))}isOutThreshold(t,s,i){if(s.setBox(!1,!1,!1,!1),i){if("y"===i){const i=this.u(t),h=this.m(t);return i&&(s.top=!0),h&&(s.bottom=!0),i||h}const h=this.p(t),e=this.l(t);return h&&(s.left=!0),e&&(s.right=!0),h||e}return this.u(t)?(s.top=!0,!0):this.l(t)?(s.right=!0,!0):this.m(t)?(s.bottom=!0,!0):!!this.p(t)&&(s.left=!0,!0)}isInsideThreshold(t){return this.T(t)&&this._(t)&&this.v(t)&&this.O(t)}getSurroundingBox(t){return{left:Math.min(t.left,this.left),top:Math.min(t.top,this.top),right:Math.max(t.right,this.right),bottom:Math.max(t.bottom,this.bottom)}}isPositionedY(t){return this.t(t)||this.i(t)}assignBiggestBox(t){const{top:s,left:i,right:h,bottom:e}=t;i<this.left&&(this.left=i),s<this.top&&(this.top=s),h>this.right&&(this.right=h),e>this.bottom&&(this.bottom=e)}}function r(t,s){return`${t}_${s}`}function o(){}const u="height",l="width",c="position";function a(t){return"x"===t?l:u}function d(t){return"x"===t?"left":"top"}class f extends n{constructor(t,s,i,h){super(t,s,i,h),this.width=s-h,this.height=i-t}setByPointAndDimensions(t,s,i,h){this.top=t,this.left=s,this.width=h,this.height=i,this.right=s+h,this.bottom=t+i}setAxes(t,s){this.left=t,this.right=this.width+t,this.top=s,this.bottom=this.height+s}getDimensionDiff(t,s){const i=a(t);return this[i]-s[i]}getPositionDiff(t,s){return this[d(t)]-s[t]}}class m extends s{increase(t){return this.x+=t.x,this.y+=t.y,this}composeBox(t,s){const{top:i,left:h,bottom:e,right:r}=t;return s?new n(i+this.y,r-this.x,e-this.y,h+this.x):new n(i-this.y,r+this.x,e+this.y,h-this.x)}onSameAxis(t,s){return"y"===t?s.x===this.x:s.y===this.y}}class p extends s{isOneTruthy(){return this.x||this.y}isAllFalsy(){return!(this.x||this.y)}setFalsy(){this.x=!1,this.y=!1}}class g{static containerKey(t,s){return r(t,s)}static depthKey(t){return r(t,"dp")}constructor(t){this.P=t,this.thresholds={},this.isOut={}}S({width:t,height:s}){const i=Math.round(this.P.horizontal*t/100),h=Math.round(this.P.vertical*s/100);this.D=new m(i,h)}M(t,s,i){this.thresholds[t]=this.D.composeBox(s,i),this.isOut[t]=new e(!1,!1,!1,!1)}setMainThreshold(t,s,i){this.S(s),this.M(t,s,i)}updateMainThreshold(t,s,i){this.thresholds[t]=this.D.composeBox(s,i),this.isOut[t].setFalsy()}getElmMainThreshold(t){return this.D.composeBox(t,!1)}setContainerThreshold(t,s,i,h){this.M(t,i,!1);const{top:e,left:n}=i,{height:r,width:o}=h,u=g.containerKey(s,t),l=g.depthKey(s);this.M(u,{left:n,top:e,right:n+o,bottom:e+r},!1),this.thresholds[l]?this.thresholds[l].assignBiggestBox(this.thresholds[u]):this.M(l,this.thresholds[u],!1)}isOutThreshold(t,s,i){return s.isOutThreshold(this.thresholds[t],this.isOut[t],i)}destroy(){Object.keys(this.thresholds).forEach((t=>{delete this.thresholds[t]})),Object.keys(this.isOut).forEach((t=>{delete this.isOut[t]}))}}function x(t,s){!function(t,s,i,h=!0,e="true"){!1||t.setAttribute(h?`data-${s}`:s,e)}(t,"index",0,!0,`${s}`)}function y(t,s,i){const{left:h,top:e,right:n,bottom:r,height:o,width:u}=t.getBoundingClientRect(),l=new f(e,n,r,h);return 0===s&&0===i||l.setByPointAndDimensions(e+i,h+s,o,u),l}const w=[];function T(){let t,s=!0;function i(){s=!0}function h(){!function(t){cancelAnimationFrame(t)}(t),w.splice(w.indexOf(t),1)}return[function(e,n){n&&h();try{s=!1;const h=function(t,s){return i=>{t(i),s()}}(e,i);t=requestAnimationFrame(h),w.push(t)}catch(t){}},h,function(){return s}]}function _(t,s=!1,i=200){const[h,e]=function(t){let s=null,i=!1;function h(){s&&(clearTimeout(s),s=null)}return[function(e,n){const r=e||o;i=!0,n&&h(),s=setTimeout((()=>{i=!1,r()}),t)},h,function(){return i}]}(i),[n,r]=T();let u=performance.now(),l=!1;const c=()=>{if(l)return;const e=performance.now();s||e-u>=i?(n(t,!0),u=e):h(c,!0)};return c.isPaused=()=>l,c.pause=()=>{l||(l=!0,r(),e())},c.resume=()=>{l&&(l=!1,c())},c}const v=Object.freeze(["x","y"]);let O=new WeakMap;function b(t,s,i){t.style.setProperty(s,i)}function P(t,s){t.style.removeProperty(s)}function S(t,s,i){const h=function(t){if(O.has(t))return O.get(t);const s={computedStyle:getComputedStyle(t),parsedProperties:new Map};return O.set(t,s),s}(t),{parsedProperties:e,computedStyle:n}=h,r=e.get(s);if(void 0===r){const t=n.getPropertyValue(s),h=i?function(t){const s=parseFloat(t);return Number.isNaN(s)?0:s}(t):t;return e.set(s,h),h}return r}function D(t){return S(t,c,!1)}function M(t,s){return S(t,s,!1)}function E(t,s,i){b(t,"transform",`translate3d(${s}px, ${i}px, 0)`)}class A{static getType(){return"base:element"}static transform=E;constructor(t){this.id=t,this.translate=new m(0,0)}}const B="transition-property",I="transition-delay",F="transition-duration",L="transition-timing-function";const R="transitionend";class z extends A{static getType(){return"core:element"}constructor(t){const{order:s,keys:i,depth:h,readonly:e,animation:n,id:r,CSSTransform:o}=t;super(r),this.VDOMOrder={...s},this.DOMOrder={...s},this.keys={...i},this.depth=h,this.readonly=e,this.A=n,this.B=o,[this.I]=T(),this.F=!0,this.L=!1,this.R=void 0,this.C=null,this.$=new m(0,0),this.rect=new f(0,0,0,0),this.DOMGrid=new m(0,0)}updateConfig(t,s,i){this.readonly=t,this.A=s,this.B=i}initElmRect(t,s,i){this.rect=y(t,s,i);const{left:h,top:e}=this.rect;this.$.setAxes(h,e),this.q(t)}q(t){const s=function(t){const s=function(t){if(!/matrix\([^)]+\)/.test(t))return null;const s=t.match(/matrix\(\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^)]+)\)/);return s?[parseFloat(s[5]),parseFloat(s[6])]:null}(S(t,"transform",!1));return s}(t);if(s){const[t,i]=s,h=this.$.x-t,e=this.$.y-i;this.$.setAxes(h,e),this.rect.setByPointAndDimensions(e,h,this.rect.height,this.rect.width),this.translate.setAxes(t,i)}}getDimensions(t){if(this.C)return this.C;const{width:s,height:i}=function(t){return{width:S(t,l,!0),height:S(t,u,!0)}}(t);return this.C=new m(s,i),this.C}getInitialPosition(){return this.$}changeVisibility(t,s){s!==this.F&&(this.F=s,this.L&&this.F&&(this.k(t,null),this.L=!1))}k(t,s,i=o){if(!this.F)return void(this.L=!0);const h=()=>{this.B&&function(t,s){"string"!=typeof s?function(t,s){Object.keys(s).forEach((s=>{P(t,s)}))}(t,s):function(t,s){t.classList.remove(s)}(t,s)}(t,this.B),this.A&&function(t){P(t,B),P(t,I),P(t,F),P(t,L)}(t),s&&t.removeEventListener(R,h),i()};this.I((()=>{if(this.B&&function(t,s){"string"!=typeof s?function(t,s){Object.entries(s).forEach((([s,i])=>{b(t,s,i)}))}(t,s):function(t,s){t.classList.add(s)}(t,s)}(t,this.B),null===s)return z.transform(t,this.translate.x,this.translate.y),void h();t.addEventListener(R,h),function(t,s,i,h){b(t,B,"transform"),b(t,I,"0ms"),b(t,F,`${i}ms`),b(t,L,h)}(t,0,s,this.A.easing),z.transform(t,this.translate.x,this.translate.y)}),!0)}updateIndex(t,s){x(t,s),this.VDOMOrder.self=s}assignNewIndex(t,s){t[s]=this.id}V(t,s,i){const h={axes:t,numberOfPassedElm:i,translate:this.translate.getInstance()};void 0===this.R&&(this.R=new Map),this.R.has(s)||this.R.set(s,[]),this.R.get(s).push(h)}N(t,s,i){if(s)return!this.F&&this.L?void(this.L=!1):void this.k(t,i);this.F?this.k(t,i):this.L=!0}j(t,s,i,h){let e=null;if(this.A){const{duration:t}=this.A,i=this.translate.getInstance(),h=this.translate.increase(s).getInstance();e="number"==typeof t?t:function(t,s){const i=t.x-s.x,h=t.y-s.y,e=Math.sqrt(i*i+h*h);return 20*Math.sqrt(e)}(i,h)}else this.translate.increase(s);this.rect.setAxes(this.$.x+this.translate.x,this.$.y+this.translate.y),this.N(t,i,e);const{self:n}=this.VDOMOrder,r=n+h;return this.updateIndex(t,r),[n,r]}H(t,s,i){if(-1!==t)for(let t=0;t<s;t+=1)this.DOMGrid.x+=1,this.DOMGrid.x>i.x&&(this.DOMGrid.x=0,this.DOMGrid.y+=1);else for(let t=0;t<s;t+=1)this.DOMGrid.x-=1,this.DOMGrid.x<0&&(this.DOMGrid.x=i.x,this.DOMGrid.y-=1)}reconcilePosition(t,s,i,h,e,n,r,o){let u;const l={x:1===s?-1:1,y:s};"z"===t?u=v:(u=[t],l[t]=s),u.forEach((t=>{e[t]*=l[t],this.H(l[t],n,r)})),this.V(t,o,n);const c=s*n,[a,d]=this.j(i,e,!1,c);h[a]="",h[d]=this.id}restorePosition(t){this.k(t,null),x(t,this.VDOMOrder.self)}assignNewPosition(t,s){this.translate.clone(s),this.k(t,null)}rollBackPosition(t,s){if(void 0===this.R||!this.R.has(s))return;const i=this.R.get(s),{translate:h,axes:e,numberOfPassedElm:n}=i.pop(),r={x:h.x-this.translate.x,y:h.y-this.translate.y};let o=0;const u={x:r.x>0?1:-1,y:r.y>0?1:-1};if("z"===e?(o=r.x>0||r.y>0?1:-1,this.DOMGrid.increase({x:u.x*n,y:u.y*n})):(o=u[e]*n,this.DOMGrid[e]+=o),this.j(t,r,!0,o),0===i.length)return this.R.delete(s),void(0===this.R.size&&(this.R=void 0));this.rollBackPosition(t,s)}hasTransformedFromOrigin(){return this.$.isNotEqual(this.rect.left,this.rect.top)}needDOMReconciliation(){return this.VDOMOrder.self!==this.DOMOrder.self}refreshIndicators(t){this.R=void 0,this.translate.setAxes(0,0),this.L=!1,this.DOMOrder.self=this.VDOMOrder.self,P(t,"transform"),function(t,s){if(!t.hasAttribute(s))return;const i=t.getAttribute(s);i&&""===i.trim()&&t.removeAttribute(s)}(t,"style"),this.DOMGrid.setAxes(0,0)}getSerializedInstance(){return{type:z.getType(),version:3,id:this.id,grid:this.DOMGrid,translate:this.translate instanceof m?this.translate:null,order:this.VDOMOrder,initialPosition:this.$.getInstance(),rect:this.rect,hasTransformedFromOrigin:this.hasTransformedFromOrigin(),hasPendingTransformation:this.L,isVisible:this.F}}}class C extends z{static getDistance(t,s,i){let h=t[i]-s.rect["x"===i?"left":"top"];return h+=s.translate[i],h}static getDisplacement(t,s,i){return t[i]-("x"===i?s.rect.right:s.rect.bottom)}getDisplacement(t,s){return C.getDisplacement(this.rect.getPosition(),t,s)}getDistance(t,s){return C.getDistance(this.rect.getPosition(),t,s)}}const $=/(auto|scroll|overlay)/;function q(t){const s=D(t),i=[void 0,!1,new p(!1,!1)],h=function(t,h){let e=0,n=t;try{do{if(e+=1,e>1&&((t,s,i)=>{const h=M(t,"overflow-x"),e=M(t,"overflow-y");if("absolute"===s&&"static"===D(t))return!1;const[,,n]=i,r=(s,i)=>((t,s,i,h)=>{if($.test(s)){const s=function(t,s){return"y"===s?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth}(i,t);if(s)return h[t]=!0,!0}return!1})(s,i,t,n);return r("y",e)||r("x",h)})(n,s,i))return e=0,n;n=n.parentElement}while(null!==n&&!n.isSameNode(document.body))}catch(t){}finally{e=0}return null}(t);return h&&"fixed"!==s?i[0]=h:(i[0]=document.documentElement,i[1]=!0),i}const k={horizontal:25,vertical:25},V={horizontal:10,vertical:10};class N{static getType(){return"scroll:container"}constructor(t,s,i,h){this.G=s,this.W=h,this.K={inner:{threshold:null,key:`scroll_inner_${s}`},outer:{threshold:null,key:`scroll_outer_${s}`}},this.U=`scroll__${s}`,[this.Y,this.J,this.hasOverflow]=q(t),this.totalScrollRect=new f(0,0,0,0),this.visibleScrollRect=new f(0,0,0,0),this.X=!1,this.refreshScrollAndVisibility(i),this.Z(!0)}hasDynamicVisibility(){return this.X&&this.hasOverflow.isOneTruthy()}tt(t,s){const i=this.K[t];if(!s)return void(i.threshold&&(i.threshold.destroy(),i.threshold=null));const h=new g(s);i.threshold=h,h.setMainThreshold(i.key,this.visibleScrollRect,"inner"===t)}st(t,s){const i=this.U,h=s.toString(),e=this.J?document.body:this.Y;t?e.dataset[i]=h:delete e.dataset[i]}it(){if(this.hasOverflow.isAllFalsy())return this.tt("inner",null),this.tt("outer",null),void this.st(!1,!0);this.st(!0,!0),this.tt("inner",null),this.tt("inner",V),this.hasDynamicVisibility()&&(this.tt("outer",null),this.tt("outer",k))}ht(){const t=(t,s)=>function(t,s,i,h=!1){const e=a(i);return t[e]/(h?.5:1)>s[e]}(this.totalScrollRect,this.visibleScrollRect,t,s),s=t("x"),i=t("y");this.hasOverflow.setAxes(s,i),this.it()}et(t,s){return this.Y["x"===t?"scrollWidth":"scrollHeight"]!==s}hasScrollDimensionChanges(){const{width:t,height:s}=this.totalScrollRect;return this.et("y",s)||this.et("x",t)}refreshScrollAndVisibility(t){this.nt(),this.X=t>10,this.J?this.ht():this.it()}nt(){const{scrollHeight:t,scrollWidth:s,scrollLeft:i,scrollTop:h,clientHeight:e,clientWidth:n}=this.Y;if(this.totalScrollRect.setByPointAndDimensions(h,i,t,s),this.J)this.visibleScrollRect.setByPointAndDimensions(h,i,e,n);else{const{left:t,top:s}=this.Y.getBoundingClientRect();this.visibleScrollRect.setByPointAndDimensions(s,t,e,n)}}rt(t,s,i){return!!this.totalScrollRect.hasEqualPosition(t,s)&&(this.totalScrollRect.setPosition(t,s),i&&(this.Y.scrollTop=s,this.Y.scrollLeft=t),!0)}scrollTo(t,s){this.rt(-1===t?this.totalScrollRect.left:t,-1===s?this.totalScrollRect.right:s,!0),this.W(this.G)}ot(t){const s=d(t),i=this.totalScrollRect[s],h=function(t){return"x"===t?"right":"bottom"}(t),e=this.totalScrollRect[h],n=a(t);return[i,e,this.visibleScrollRect[n]]}calculateDistance(t,s){const[i,h,e]=this.ot(t);return 1===s?h-(i+e):i}hasScrollableArea(t,s){const[i,h,e]=this.ot(t);return 1===s?i+e<h:i>0}ut=_((()=>{const{scrollLeft:t,scrollTop:s}=this.Y;this.rt(t,s,!1)&&this.W(this.G)}));lt=_((()=>{this.nt(),this.ht()}));Z(t){const s=t?"addEventListener":"removeEventListener",i=this.J?window:this.Y,h={passive:!0};i[s]("resize",this.lt,h),i[s]("scroll",this.ut,h)}pauseListeners(t){t?this.ut.pause():this.ut.resume()}getMaximumScrollContainerLeft(){const{left:t,width:s}=this.visibleScrollRect;return t+s+this.totalScrollRect.left}getMaximumScrollContainerTop(){const{top:t,height:s}=this.visibleScrollRect;return t+s+this.totalScrollRect.top}getElmViewportPosition(t,s){const{top:i,left:h}=this.totalScrollRect;return[t-i,s-h]}isElmOutViewport(t){let s,i;if(t instanceof f){const[h,e]=this.getElmViewportPosition(t.top,t.left);s=new n(h,e+t.width,h+t.height,e),i=this.K.outer}else s=t,i=this.K.inner;const{threshold:h,key:e}=i;return[h.isOutThreshold(e,s,this.hasOverflow.y?"y":"x"),h.isOut[e]]}ct(){const{height:t,width:s}=this.visibleScrollRect;return{height:t,width:s}}getSerializedInstance(){return{type:N.getType(),version:3,key:this.G,hasOverFlow:this.hasOverflow.getInstance(),hasDocumentAsContainer:this.J,scrollRect:this.totalScrollRect.getBox(),scrollContainerRect:this.visibleScrollRect.getBox(),visibleScreen:this.ct()}}destroy(){this.Z(!1),this.tt("inner",null),this.tt("outer",null),this.st(!1,!0),this.W=void 0,this.Y=void 0}}exports.DFlexBaseElement=A,exports.DFlexElement=C,exports.DFlexParentContainer=class{constructor(t,s,i,h){this.id=t,this.dt=new m(-1,-1),this.grid=new m(-1,-1),this.originLength=i,this.ft=new n(0,0,0,0),this.gt=null;const{left:e,top:r}=h;this.xt=y(s,e,r),this.lastElmPosition=null}yt(t){const s=this.ft;return s.isPositionedY(t)?(this.dt.y+=1,this.dt.x=0,this.ft.setBox(0,0,0,0)):this.dt.x+=1,this.dt.x>this.grid.x&&(this.grid.x=this.dt.x),this.dt.y>this.grid.y&&(this.grid.y=this.dt.y),s.assignBiggestBox(t),this.dt}register(t,s){this.gt?this.gt.assignBiggestBox(t):this.gt=new n(t.top,t.right,t.bottom,t.left);const i=this.yt(t),h=this.gt,e=s;if(!e)return i;const r=h.bottom-h.top,o=h.right-h.left;return e.height<r&&(e.height=r),e.width<o&&(e.width=r),i}extendGrid(t){this.grid[t]+=1}reduceGrid(t){this.grid[t]-=1}getBoundaries(){return this.gt||this.xt.getBox()}resetIndicators(t){this.dt.setAxes(-1,-1),this.grid.setAxes(-1,-1),this.originLength=t,this.ft.setBox(0,0,0,0),this.gt=null,this.lastElmPosition=null}preservePosition(t){this.lastElmPosition?this.lastElmPosition.setAxes(t.x,t.y):this.lastElmPosition=new m(t.x,t.y)}},exports.DFlexScrollContainer=N;
class t{constructor(t,s){this.x=t,this.y=s}}class s extends t{setAxes(t,s){this.x=t,this.y=s}clone(t){this.setAxes(t.x,t.y)}getInstance(){return{x:this.x,y:this.y}}isInstanceEqual(t){return this.x===t.x&&this.y===t.y}isEqual(t,s){return this.x===t&&this.y===s}isNotEqual(t,s){return this.x!==t||this.y!==s}}class i{constructor(t,s,i,h){this.top=t,this.right=s,this.bottom=i,this.left=h}}class h extends i{clone(t){this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left}setBox(t,s,i,h){return this.top=t,this.right=s,this.bottom=i,this.left=h,this}getBox(){return{top:this.top,right:this.right,bottom:this.bottom,left:this.left}}setByAxis(t,s,i){"x"===t?(this.left=s,this.right=i):(this.top=s,this.bottom=i)}setOne(t,s,i){"x"===t?-1===s?this.left=i:this.right=i:-1===s?this.top=i:this.bottom=i}getOne(t,s){return"x"===t?-1===s?this.left:this.right:-1===s?this.top:this.bottom}setPositionInstance(t){this.top=t.y,this.left=t.x}setPosition(t,s){this.top=s,this.left=t}hasEqualPosition(t,s){return this.top===s||this.left===t}getPosition(){return{x:this.left,y:this.top}}}class e extends h{constructor(t,s,i,h){super(t,s,i,h)}setFalsy(){return this.setBox(!1,!1,!1,!1),this}isTruthyByAxis(t){return"x"===t?this.left||this.right:this.top||this.bottom}isTruthyOnSide(t,s){return"x"===t?1===s?this.right:this.left:1===s?this.bottom:this.top}isTruthy(){return this.left||this.right||this.top||this.bottom}}class n extends h{t(t){return this.top>=t.bottom}i(t){return this.bottom<=t.top}h(t){return this.right<=t.left}o(t){return this.left>=t.right}u(t){return this.top<t.top}l(t){return this.right>t.right}m(t){return this.bottom>t.bottom}p(t){return this.left<t.left}T(t){return this.top>=t.top}_(t){return this.right<=t.right}v(t){return this.bottom<=t.bottom}O(t){return this.left>=t.left}isBoxIntersect(t){return!(this.i(t)||this.o(t)||this.t(t)||this.h(t))}isOutThreshold(t,s,i){if(s.setBox(!1,!1,!1,!1),i){if("y"===i){const i=this.u(t),h=this.m(t);return i&&(s.top=!0),h&&(s.bottom=!0),i||h}const h=this.p(t),e=this.l(t);return h&&(s.left=!0),e&&(s.right=!0),h||e}return this.u(t)?(s.top=!0,!0):this.l(t)?(s.right=!0,!0):this.m(t)?(s.bottom=!0,!0):!!this.p(t)&&(s.left=!0,!0)}isInsideThreshold(t){return this.T(t)&&this._(t)&&this.v(t)&&this.O(t)}getSurroundingBox(t){return{left:Math.min(t.left,this.left),top:Math.min(t.top,this.top),right:Math.max(t.right,this.right),bottom:Math.max(t.bottom,this.bottom)}}isPositionedY(t){return this.t(t)||this.i(t)}assignBiggestBox(t){const{top:s,left:i,right:h,bottom:e}=t;i<this.left&&(this.left=i),s<this.top&&(this.top=s),h>this.right&&(this.right=h),e>this.bottom&&(this.bottom=e)}}function r(t,s){return`${t}_${s}`}function o(){}const u="height",l="width",c="position";function a(t){return"x"===t?l:u}function d(t){return"x"===t?"left":"top"}class f extends n{constructor(t,s,i,h){super(t,s,i,h),this.width=s-h,this.height=i-t}setByPointAndDimensions(t,s,i,h){this.top=t,this.left=s,this.width=h,this.height=i,this.right=s+h,this.bottom=t+i}setAxes(t,s){this.left=t,this.right=this.width+t,this.top=s,this.bottom=this.height+s}getDimensionDiff(t,s){const i=a(t);return this[i]-s[i]}getPositionDiff(t,s){return this[d(t)]-s[t]}}class m extends s{increase(t){return this.x+=t.x,this.y+=t.y,this}composeBox(t,s){const{top:i,left:h,bottom:e,right:r}=t;return s?new n(i+this.y,r-this.x,e-this.y,h+this.x):new n(i-this.y,r+this.x,e+this.y,h-this.x)}onSameAxis(t,s){return"y"===t?s.x===this.x:s.y===this.y}}class p extends s{isOneTruthy(){return this.x||this.y}isAllFalsy(){return!(this.x||this.y)}setFalsy(){this.x=!1,this.y=!1}}class g{static containerKey(t,s){return r(t,s)}static depthKey(t){return r(t,"dp")}constructor(t){this.P=t,this.thresholds={},this.isOut={}}S({width:t,height:s}){const i=Math.round(this.P.horizontal*t/100),h=Math.round(this.P.vertical*s/100);this.D=new m(i,h)}M(t,s,i){this.thresholds[t]=this.D.composeBox(s,i),this.isOut[t]=new e(!1,!1,!1,!1)}setMainThreshold(t,s,i){this.S(s),this.M(t,s,i)}updateMainThreshold(t,s,i){this.thresholds[t]=this.D.composeBox(s,i),this.isOut[t].setFalsy()}getElmMainThreshold(t){return this.D.composeBox(t,!1)}setContainerThreshold(t,s,i,h){this.M(t,i,!1);const{top:e,left:n}=i,{height:r,width:o}=h,u=g.containerKey(s,t),l=g.depthKey(s);this.M(u,{left:n,top:e,right:n+o,bottom:e+r},!1),this.thresholds[l]?this.thresholds[l].assignBiggestBox(this.thresholds[u]):this.M(l,this.thresholds[u],!1)}isOutThreshold(t,s,i){return s.isOutThreshold(this.thresholds[t],this.isOut[t],i)}destroy(){Object.keys(this.thresholds).forEach((t=>{delete this.thresholds[t]})),Object.keys(this.isOut).forEach((t=>{delete this.isOut[t]}))}}function x(t,s){!function(t,s,i,h=!0,e="true"){const n=h?`data-${s}`:s;!1?t.removeAttribute(n):t.setAttribute(n,e)}(t,"index",0,!0,`${s}`)}function y(t,s,i){const{left:h,top:e,right:n,bottom:r,height:o,width:u}=t.getBoundingClientRect(),l=new f(e,n,r,h);return 0===s&&0===i||l.setByPointAndDimensions(e+i,h+s,o,u),l}const w=[];function T(){let t,s=!0;function i(){s=!0}function h(){!function(t){cancelAnimationFrame(t)}(t),w.splice(w.indexOf(t),1)}return[function(e,n){n&&h();try{s=!1;const h=function(t,s){return i=>{t(i),s()}}(e,i);t=requestAnimationFrame(h),w.push(t)}catch(t){}},h,function(){return s}]}function _(t,s=!1,i=200){const[h,e]=function(t){let s=null,i=!1;function h(){s&&(clearTimeout(s),s=null)}return[function(e,n){const r=e||o;i=!0,n&&h(),s=setTimeout((()=>{i=!1,r()}),t)},h,function(){return i}]}(i),[n,r]=T();let u=performance.now(),l=!1;const c=()=>{if(l)return;const e=performance.now();s||e-u>=i?(n(t,!0),u=e):h(c,!0)};return c.isPaused=()=>l,c.pause=()=>{l||(l=!0,r(),e())},c.resume=()=>{l&&(l=!1,c())},c}const v=Object.freeze(["x","y"]);let O=new WeakMap;function b(t,s,i){t.style.setProperty(s,i)}function P(t,s){t.style.removeProperty(s)}function S(t,s,i){const h=function(t){if(O.has(t))return O.get(t);const s={computedStyle:getComputedStyle(t),parsedProperties:new Map};return O.set(t,s),s}(t),{parsedProperties:e,computedStyle:n}=h,r=e.get(s);if(void 0===r){const t=n.getPropertyValue(s),h=i?function(t){const s=parseFloat(t);return Number.isNaN(s)?0:s}(t):t;return e.set(s,h),h}return r}function D(t){return S(t,c,!1)}function M(t,s){return S(t,s,!1)}function E(t,s,i){b(t,"transform",`translate3d(${s}px, ${i}px, 0)`)}class A{static getType(){return"base:element"}static transform=E;constructor(t){this.id=t,this.translate=new m(0,0)}}const B="transition-property",I="transition-delay",F="transition-duration",L="transition-timing-function";const R="transitionend";class z extends A{static getType(){return"core:element"}constructor(t){const{order:s,keys:i,depth:h,readonly:e,animation:n,id:r,CSSTransform:o}=t;super(r),this.VDOMOrder={...s},this.DOMOrder={...s},this.keys={...i},this.depth=h,this.readonly=e,this.A=n,this.B=o,[this.I]=T(),this.F=!0,this.L=!1,this.R=void 0,this.C=null,this.$=new m(0,0),this.rect=new f(0,0,0,0),this.DOMGrid=new m(0,0)}updateConfig(t,s,i){this.readonly=t,this.A=s,this.B=i}initElmRect(t,s,i){this.rect=y(t,s,i);const{left:h,top:e}=this.rect;this.$.setAxes(h,e),this.q(t)}q(t){const s=function(t){const s=function(t){if(!/matrix\([^)]+\)/.test(t))return null;const s=t.match(/matrix\(\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^)]+)\)/);return s?[parseFloat(s[5]),parseFloat(s[6])]:null}(S(t,"transform",!1));return s}(t);if(s){const[t,i]=s,h=this.$.x-t,e=this.$.y-i;this.$.setAxes(h,e),this.rect.setByPointAndDimensions(e,h,this.rect.height,this.rect.width),this.translate.setAxes(t,i)}}getDimensions(t){if(this.C)return this.C;const{width:s,height:i}=function(t){return{width:S(t,l,!0),height:S(t,u,!0)}}(t);return this.C=new m(s,i),this.C}getInitialPosition(){return this.$}changeVisibility(t,s){s!==this.F&&(this.F=s,this.L&&this.F&&(this.k(t,null),this.L=!1))}k(t,s,i=o){if(!this.F)return void(this.L=!0);const h=()=>{this.B&&function(t,s){"string"!=typeof s?function(t,s){Object.keys(s).forEach((s=>{P(t,s)}))}(t,s):function(t,s){t.classList.remove(s)}(t,s)}(t,this.B),this.A&&function(t){P(t,B),P(t,I),P(t,F),P(t,L)}(t),s&&t.removeEventListener(R,h),i()};this.I((()=>{if(this.B&&function(t,s){"string"!=typeof s?function(t,s){Object.entries(s).forEach((([s,i])=>{b(t,s,i)}))}(t,s):function(t,s){t.classList.add(s)}(t,s)}(t,this.B),null===s)return z.transform(t,this.translate.x,this.translate.y),void h();t.addEventListener(R,h),function(t,s,i,h){b(t,B,"transform"),b(t,I,"0ms"),b(t,F,`${i}ms`),b(t,L,h)}(t,0,s,this.A.easing),z.transform(t,this.translate.x,this.translate.y)}),!0)}updateIndex(t,s){x(t,s),this.VDOMOrder.self=s}assignNewIndex(t,s){t[s]=this.id}V(t,s,i){const h={axes:t,numberOfPassedElm:i,translate:this.translate.getInstance()};void 0===this.R&&(this.R=new Map),this.R.has(s)||this.R.set(s,[]),this.R.get(s).push(h)}N(t,s,i){if(s)return!this.F&&this.L?void(this.L=!1):void this.k(t,i);this.F?this.k(t,i):this.L=!0}j(t,s,i,h){let e=null;if(this.A){const{duration:t}=this.A,i=this.translate.getInstance(),h=this.translate.increase(s).getInstance();e="number"==typeof t?t:function(t,s){const i=t.x-s.x,h=t.y-s.y,e=Math.sqrt(i*i+h*h);return 20*Math.sqrt(e)}(i,h)}else this.translate.increase(s);this.rect.setAxes(this.$.x+this.translate.x,this.$.y+this.translate.y),this.N(t,i,e);const{self:n}=this.VDOMOrder,r=n+h;return this.updateIndex(t,r),[n,r]}H(t,s,i){if(-1!==t)for(let t=0;t<s;t+=1)this.DOMGrid.x+=1,this.DOMGrid.x>i.x&&(this.DOMGrid.x=0,this.DOMGrid.y+=1);else for(let t=0;t<s;t+=1)this.DOMGrid.x-=1,this.DOMGrid.x<0&&(this.DOMGrid.x=i.x,this.DOMGrid.y-=1)}reconcilePosition(t,s,i,h,e,n,r,o){let u;const l={x:1===s?-1:1,y:s};"z"===t?u=v:(u=[t],l[t]=s),u.forEach((t=>{e[t]*=l[t],this.H(l[t],n,r)})),this.V(t,o,n);const c=s*n,[a,d]=this.j(i,e,!1,c);h[a]="",h[d]=this.id}restorePosition(t){this.k(t,null),x(t,this.VDOMOrder.self)}assignNewPosition(t,s){this.translate.clone(s),this.k(t,null)}rollBackPosition(t,s){if(void 0===this.R||!this.R.has(s))return;const i=this.R.get(s),{translate:h,axes:e,numberOfPassedElm:n}=i.pop(),r={x:h.x-this.translate.x,y:h.y-this.translate.y};let o=0;const u={x:r.x>0?1:-1,y:r.y>0?1:-1};if("z"===e?(o=r.x>0||r.y>0?1:-1,this.DOMGrid.increase({x:u.x*n,y:u.y*n})):(o=u[e]*n,this.DOMGrid[e]+=o),this.j(t,r,!0,o),0===i.length)return this.R.delete(s),void(0===this.R.size&&(this.R=void 0));this.rollBackPosition(t,s)}hasTransformedFromOrigin(){return this.$.isNotEqual(this.rect.left,this.rect.top)}needDOMReconciliation(){return this.VDOMOrder.self!==this.DOMOrder.self}refreshIndicators(t){this.R=void 0,this.translate.setAxes(0,0),this.L=!1,this.DOMOrder.self=this.VDOMOrder.self,P(t,"transform"),function(t,s){if(!t.hasAttribute(s))return;const i=t.getAttribute(s);i&&""===i.trim()&&t.removeAttribute(s)}(t,"style"),this.DOMGrid.setAxes(0,0)}getSerializedInstance(){return{type:z.getType(),version:3,id:this.id,grid:this.DOMGrid,translate:this.translate instanceof m?this.translate:null,order:this.VDOMOrder,initialPosition:this.$.getInstance(),rect:this.rect,hasTransformedFromOrigin:this.hasTransformedFromOrigin(),hasPendingTransformation:this.L,isVisible:this.F}}}class C extends z{static getDistance(t,s,i){let h=t[i]-s.rect["x"===i?"left":"top"];return h+=s.translate[i],h}static getDisplacement(t,s,i){return t[i]-("x"===i?s.rect.right:s.rect.bottom)}getDisplacement(t,s){return C.getDisplacement(this.rect.getPosition(),t,s)}getDistance(t,s){return C.getDistance(this.rect.getPosition(),t,s)}}const $=/(auto|scroll|overlay)/;function q(t){const s=D(t),i=[void 0,!1,new p(!1,!1)],h=function(t,h){let e=0,n=t;try{do{if(e+=1,e>1&&((t,s,i)=>{const h=M(t,"overflow-x"),e=M(t,"overflow-y");if("absolute"===s&&"static"===D(t))return!1;const[,,n]=i,r=(s,i)=>((t,s,i,h)=>{if($.test(s)){const s=function(t,s){return"y"===s?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth}(i,t);if(s)return h[t]=!0,!0}return!1})(s,i,t,n);return r("y",e)||r("x",h)})(n,s,i))return e=0,n;n=n.parentElement}while(null!==n&&!n.isSameNode(document.body))}catch(t){}finally{e=0}return null}(t);return h&&"fixed"!==s?i[0]=h:(i[0]=document.documentElement,i[1]=!0),i}const k={horizontal:25,vertical:25},V={horizontal:10,vertical:10};class N{static getType(){return"scroll:container"}constructor(t,s,i,h){this.G=s,this.W=h,this.K={inner:{threshold:null,key:`scroll_inner_${s}`},outer:{threshold:null,key:`scroll_outer_${s}`}},this.U=`scroll__${s}`,[this.Y,this.J,this.hasOverflow]=q(t),this.totalScrollRect=new f(0,0,0,0),this.visibleScrollRect=new f(0,0,0,0),this.X=!1,this.refreshScrollAndVisibility(i),this.Z(!0)}hasDynamicVisibility(){return this.X&&this.hasOverflow.isOneTruthy()}tt(t,s){const i=this.K[t];if(!s)return void(i.threshold&&(i.threshold.destroy(),i.threshold=null));const h=new g(s);i.threshold=h,h.setMainThreshold(i.key,this.visibleScrollRect,"inner"===t)}st(t,s){const i=this.U,h=s.toString(),e=this.J?document.body:this.Y;t?e.dataset[i]=h:delete e.dataset[i]}it(){if(this.hasOverflow.isAllFalsy())return this.tt("inner",null),this.tt("outer",null),void this.st(!1,!0);this.st(!0,!0),this.tt("inner",null),this.tt("inner",V),this.hasDynamicVisibility()&&(this.tt("outer",null),this.tt("outer",k))}ht(){const t=(t,s)=>function(t,s,i,h=!1){const e=a(i);return t[e]/(h?.5:1)>s[e]}(this.totalScrollRect,this.visibleScrollRect,t,s),s=t("x"),i=t("y");this.hasOverflow.setAxes(s,i),this.it()}et(t,s){return this.Y["x"===t?"scrollWidth":"scrollHeight"]!==s}hasScrollDimensionChanges(){const{width:t,height:s}=this.totalScrollRect;return this.et("y",s)||this.et("x",t)}refreshScrollAndVisibility(t){this.nt(),this.X=t>10,this.J?this.ht():this.it()}nt(){const{scrollHeight:t,scrollWidth:s,scrollLeft:i,scrollTop:h,clientHeight:e,clientWidth:n}=this.Y;if(this.totalScrollRect.setByPointAndDimensions(h,i,t,s),this.J)this.visibleScrollRect.setByPointAndDimensions(h,i,e,n);else{const{left:t,top:s}=this.Y.getBoundingClientRect();this.visibleScrollRect.setByPointAndDimensions(s,t,e,n)}}rt(t,s,i){return!!this.totalScrollRect.hasEqualPosition(t,s)&&(this.totalScrollRect.setPosition(t,s),i&&(this.Y.scrollTop=s,this.Y.scrollLeft=t),!0)}scrollTo(t,s){this.rt(-1===t?this.totalScrollRect.left:t,-1===s?this.totalScrollRect.right:s,!0),this.W(this.G)}ot(t){const s=d(t),i=this.totalScrollRect[s],h=function(t){return"x"===t?"right":"bottom"}(t),e=this.totalScrollRect[h],n=a(t);return[i,e,this.visibleScrollRect[n]]}calculateDistance(t,s){const[i,h,e]=this.ot(t);return 1===s?h-(i+e):i}hasScrollableArea(t,s){const[i,h,e]=this.ot(t);return 1===s?i+e<h:i>0}ut=_((()=>{const{scrollLeft:t,scrollTop:s}=this.Y;this.rt(t,s,!1)&&this.W(this.G)}));lt=_((()=>{this.nt(),this.ht()}));Z(t){const s=t?"addEventListener":"removeEventListener",i=this.J?window:this.Y,h={passive:!0};i[s]("resize",this.lt,h),i[s]("scroll",this.ut,h)}pauseListeners(t){t?this.ut.pause():this.ut.resume()}getMaximumScrollContainerLeft(){const{left:t,width:s}=this.visibleScrollRect;return t+s+this.totalScrollRect.left}getMaximumScrollContainerTop(){const{top:t,height:s}=this.visibleScrollRect;return t+s+this.totalScrollRect.top}getElmViewportPosition(t,s){const{top:i,left:h}=this.totalScrollRect;return[t-i,s-h]}isElmOutViewport(t){let s,i;if(t instanceof f){const[h,e]=this.getElmViewportPosition(t.top,t.left);s=new n(h,e+t.width,h+t.height,e),i=this.K.outer}else s=t,i=this.K.inner;const{threshold:h,key:e}=i;return[h.isOutThreshold(e,s,this.hasOverflow.y?"y":"x"),h.isOut[e]]}ct(){const{height:t,width:s}=this.visibleScrollRect;return{height:t,width:s}}getSerializedInstance(){return{type:N.getType(),version:3,key:this.G,hasOverFlow:this.hasOverflow.getInstance(),hasDocumentAsContainer:this.J,scrollRect:this.totalScrollRect.getBox(),scrollContainerRect:this.visibleScrollRect.getBox(),visibleScreen:this.ct()}}destroy(){this.Z(!1),this.tt("inner",null),this.tt("outer",null),this.st(!1,!0),this.W=void 0,this.Y=void 0}}exports.DFlexBaseElement=A,exports.DFlexElement=C,exports.DFlexParentContainer=class{constructor(t,s,i,h){this.id=t,this.dt=new m(-1,-1),this.grid=new m(-1,-1),this.originLength=i,this.ft=new n(0,0,0,0),this.gt=null;const{left:e,top:r}=h;this.xt=y(s,e,r),this.lastElmPosition=null}yt(t){const s=this.ft;return s.isPositionedY(t)?(this.dt.y+=1,this.dt.x=0,this.ft.setBox(0,0,0,0)):this.dt.x+=1,this.dt.x>this.grid.x&&(this.grid.x=this.dt.x),this.dt.y>this.grid.y&&(this.grid.y=this.dt.y),s.assignBiggestBox(t),this.dt}register(t,s){this.gt?this.gt.assignBiggestBox(t):this.gt=new n(t.top,t.right,t.bottom,t.left);const i=this.yt(t),h=this.gt,e=s;if(!e)return i;const r=h.bottom-h.top,o=h.right-h.left;return e.height<r&&(e.height=r),e.width<o&&(e.width=r),i}extendGrid(t){this.grid[t]+=1}reduceGrid(t){this.grid[t]-=1}getBoundaries(){return this.gt||this.xt.getBox()}resetIndicators(t){this.dt.setAxes(-1,-1),this.grid.setAxes(-1,-1),this.originLength=t,this.ft.setBox(0,0,0,0),this.gt=null,this.lastElmPosition=null}preservePosition(t){this.lastElmPosition?this.lastElmPosition.setAxes(t.x,t.y):this.lastElmPosition=new m(t.x,t.y)}},exports.DFlexScrollContainer=N;

@@ -791,4 +791,4 @@ 'use strict';

}
DOM.removeAttribute(attrName);
}
DOM.removeAttribute(attrName);
return;

@@ -795,0 +795,0 @@ }

@@ -1,1 +0,1 @@

class t{constructor(t,s){this.x=t,this.y=s}}class s extends t{setAxes(t,s){this.x=t,this.y=s}clone(t){this.setAxes(t.x,t.y)}getInstance(){return{x:this.x,y:this.y}}isInstanceEqual(t){return this.x===t.x&&this.y===t.y}isEqual(t,s){return this.x===t&&this.y===s}isNotEqual(t,s){return this.x!==t||this.y!==s}}class i{constructor(t,s,i,h){this.top=t,this.right=s,this.bottom=i,this.left=h}}class h extends i{clone(t){this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left}setBox(t,s,i,h){return this.top=t,this.right=s,this.bottom=i,this.left=h,this}getBox(){return{top:this.top,right:this.right,bottom:this.bottom,left:this.left}}setByAxis(t,s,i){"x"===t?(this.left=s,this.right=i):(this.top=s,this.bottom=i)}setOne(t,s,i){"x"===t?-1===s?this.left=i:this.right=i:-1===s?this.top=i:this.bottom=i}getOne(t,s){return"x"===t?-1===s?this.left:this.right:-1===s?this.top:this.bottom}setPositionInstance(t){this.top=t.y,this.left=t.x}setPosition(t,s){this.top=s,this.left=t}hasEqualPosition(t,s){return this.top===s||this.left===t}getPosition(){return{x:this.left,y:this.top}}}class e extends h{constructor(t,s,i,h){super(t,s,i,h)}setFalsy(){return this.setBox(!1,!1,!1,!1),this}isTruthyByAxis(t){return"x"===t?this.left||this.right:this.top||this.bottom}isTruthyOnSide(t,s){return"x"===t?1===s?this.right:this.left:1===s?this.bottom:this.top}isTruthy(){return this.left||this.right||this.top||this.bottom}}class n extends h{t(t){return this.top>=t.bottom}i(t){return this.bottom<=t.top}h(t){return this.right<=t.left}o(t){return this.left>=t.right}u(t){return this.top<t.top}l(t){return this.right>t.right}m(t){return this.bottom>t.bottom}p(t){return this.left<t.left}T(t){return this.top>=t.top}_(t){return this.right<=t.right}v(t){return this.bottom<=t.bottom}O(t){return this.left>=t.left}isBoxIntersect(t){return!(this.i(t)||this.o(t)||this.t(t)||this.h(t))}isOutThreshold(t,s,i){if(s.setBox(!1,!1,!1,!1),i){if("y"===i){const i=this.u(t),h=this.m(t);return i&&(s.top=!0),h&&(s.bottom=!0),i||h}const h=this.p(t),e=this.l(t);return h&&(s.left=!0),e&&(s.right=!0),h||e}return this.u(t)?(s.top=!0,!0):this.l(t)?(s.right=!0,!0):this.m(t)?(s.bottom=!0,!0):!!this.p(t)&&(s.left=!0,!0)}isInsideThreshold(t){return this.T(t)&&this._(t)&&this.v(t)&&this.O(t)}getSurroundingBox(t){return{left:Math.min(t.left,this.left),top:Math.min(t.top,this.top),right:Math.max(t.right,this.right),bottom:Math.max(t.bottom,this.bottom)}}isPositionedY(t){return this.t(t)||this.i(t)}assignBiggestBox(t){const{top:s,left:i,right:h,bottom:e}=t;i<this.left&&(this.left=i),s<this.top&&(this.top=s),h>this.right&&(this.right=h),e>this.bottom&&(this.bottom=e)}}function r(t,s){return`${t}_${s}`}function o(){}const u="height",l="width",c="position";function a(t){return"x"===t?l:u}function d(t){return"x"===t?"left":"top"}class f extends n{constructor(t,s,i,h){super(t,s,i,h),this.width=s-h,this.height=i-t}setByPointAndDimensions(t,s,i,h){this.top=t,this.left=s,this.width=h,this.height=i,this.right=s+h,this.bottom=t+i}setAxes(t,s){this.left=t,this.right=this.width+t,this.top=s,this.bottom=this.height+s}getDimensionDiff(t,s){const i=a(t);return this[i]-s[i]}getPositionDiff(t,s){return this[d(t)]-s[t]}}class m extends s{increase(t){return this.x+=t.x,this.y+=t.y,this}composeBox(t,s){const{top:i,left:h,bottom:e,right:r}=t;return s?new n(i+this.y,r-this.x,e-this.y,h+this.x):new n(i-this.y,r+this.x,e+this.y,h-this.x)}onSameAxis(t,s){return"y"===t?s.x===this.x:s.y===this.y}}class p extends s{isOneTruthy(){return this.x||this.y}isAllFalsy(){return!(this.x||this.y)}setFalsy(){this.x=!1,this.y=!1}}class g{static containerKey(t,s){return r(t,s)}static depthKey(t){return r(t,"dp")}constructor(t){this.P=t,this.thresholds={},this.isOut={}}S({width:t,height:s}){const i=Math.round(this.P.horizontal*t/100),h=Math.round(this.P.vertical*s/100);this.D=new m(i,h)}M(t,s,i){this.thresholds[t]=this.D.composeBox(s,i),this.isOut[t]=new e(!1,!1,!1,!1)}setMainThreshold(t,s,i){this.S(s),this.M(t,s,i)}updateMainThreshold(t,s,i){this.thresholds[t]=this.D.composeBox(s,i),this.isOut[t].setFalsy()}getElmMainThreshold(t){return this.D.composeBox(t,!1)}setContainerThreshold(t,s,i,h){this.M(t,i,!1);const{top:e,left:n}=i,{height:r,width:o}=h,u=g.containerKey(s,t),l=g.depthKey(s);this.M(u,{left:n,top:e,right:n+o,bottom:e+r},!1),this.thresholds[l]?this.thresholds[l].assignBiggestBox(this.thresholds[u]):this.M(l,this.thresholds[u],!1)}isOutThreshold(t,s,i){return s.isOutThreshold(this.thresholds[t],this.isOut[t],i)}destroy(){Object.keys(this.thresholds).forEach((t=>{delete this.thresholds[t]})),Object.keys(this.isOut).forEach((t=>{delete this.isOut[t]}))}}function x(t,s){!function(t,s,i,h=!0,e="true"){!1||t.setAttribute(h?`data-${s}`:s,e)}(t,"index",0,!0,`${s}`)}function y(t,s,i){const{left:h,top:e,right:n,bottom:r,height:o,width:u}=t.getBoundingClientRect(),l=new f(e,n,r,h);return 0===s&&0===i||l.setByPointAndDimensions(e+i,h+s,o,u),l}const w=[];function T(){let t,s=!0;function i(){s=!0}function h(){!function(t){cancelAnimationFrame(t)}(t),w.splice(w.indexOf(t),1)}return[function(e,n){n&&h();try{s=!1;const h=function(t,s){return i=>{t(i),s()}}(e,i);t=requestAnimationFrame(h),w.push(t)}catch(t){}},h,function(){return s}]}function _(t,s=!1,i=200){const[h,e]=function(t){let s=null,i=!1;function h(){s&&(clearTimeout(s),s=null)}return[function(e,n){const r=e||o;i=!0,n&&h(),s=setTimeout((()=>{i=!1,r()}),t)},h,function(){return i}]}(i),[n,r]=T();let u=performance.now(),l=!1;const c=()=>{if(l)return;const e=performance.now();s||e-u>=i?(n(t,!0),u=e):h(c,!0)};return c.isPaused=()=>l,c.pause=()=>{l||(l=!0,r(),e())},c.resume=()=>{l&&(l=!1,c())},c}const v=Object.freeze(["x","y"]);let O=new WeakMap;function b(t,s,i){t.style.setProperty(s,i)}function P(t,s){t.style.removeProperty(s)}function S(t,s,i){const h=function(t){if(O.has(t))return O.get(t);const s={computedStyle:getComputedStyle(t),parsedProperties:new Map};return O.set(t,s),s}(t),{parsedProperties:e,computedStyle:n}=h,r=e.get(s);if(void 0===r){const t=n.getPropertyValue(s),h=i?function(t){const s=parseFloat(t);return Number.isNaN(s)?0:s}(t):t;return e.set(s,h),h}return r}function D(t){return S(t,c,!1)}function M(t,s){return S(t,s,!1)}function E(t,s,i){b(t,"transform",`translate3d(${s}px, ${i}px, 0)`)}class A{static getType(){return"base:element"}static transform=E;constructor(t){this.id=t,this.translate=new m(0,0)}}const B="transition-property",I="transition-delay",F="transition-duration",L="transition-timing-function";const R="transitionend";class z extends A{static getType(){return"core:element"}constructor(t){const{order:s,keys:i,depth:h,readonly:e,animation:n,id:r,CSSTransform:o}=t;super(r),this.VDOMOrder={...s},this.DOMOrder={...s},this.keys={...i},this.depth=h,this.readonly=e,this.A=n,this.B=o,[this.I]=T(),this.F=!0,this.L=!1,this.R=void 0,this.C=null,this.$=new m(0,0),this.rect=new f(0,0,0,0),this.DOMGrid=new m(0,0)}updateConfig(t,s,i){this.readonly=t,this.A=s,this.B=i}initElmRect(t,s,i){this.rect=y(t,s,i);const{left:h,top:e}=this.rect;this.$.setAxes(h,e),this.q(t)}q(t){const s=function(t){const s=function(t){if(!/matrix\([^)]+\)/.test(t))return null;const s=t.match(/matrix\(\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^)]+)\)/);return s?[parseFloat(s[5]),parseFloat(s[6])]:null}(S(t,"transform",!1));return s}(t);if(s){const[t,i]=s,h=this.$.x-t,e=this.$.y-i;this.$.setAxes(h,e),this.rect.setByPointAndDimensions(e,h,this.rect.height,this.rect.width),this.translate.setAxes(t,i)}}getDimensions(t){if(this.C)return this.C;const{width:s,height:i}=function(t){return{width:S(t,l,!0),height:S(t,u,!0)}}(t);return this.C=new m(s,i),this.C}getInitialPosition(){return this.$}changeVisibility(t,s){s!==this.F&&(this.F=s,this.L&&this.F&&(this.k(t,null),this.L=!1))}k(t,s,i=o){if(!this.F)return void(this.L=!0);const h=()=>{this.B&&function(t,s){"string"!=typeof s?function(t,s){Object.keys(s).forEach((s=>{P(t,s)}))}(t,s):function(t,s){t.classList.remove(s)}(t,s)}(t,this.B),this.A&&function(t){P(t,B),P(t,I),P(t,F),P(t,L)}(t),s&&t.removeEventListener(R,h),i()};this.I((()=>{if(this.B&&function(t,s){"string"!=typeof s?function(t,s){Object.entries(s).forEach((([s,i])=>{b(t,s,i)}))}(t,s):function(t,s){t.classList.add(s)}(t,s)}(t,this.B),null===s)return z.transform(t,this.translate.x,this.translate.y),void h();t.addEventListener(R,h),function(t,s,i,h){b(t,B,"transform"),b(t,I,"0ms"),b(t,F,`${i}ms`),b(t,L,h)}(t,0,s,this.A.easing),z.transform(t,this.translate.x,this.translate.y)}),!0)}updateIndex(t,s){x(t,s),this.VDOMOrder.self=s}assignNewIndex(t,s){t[s]=this.id}V(t,s,i){const h={axes:t,numberOfPassedElm:i,translate:this.translate.getInstance()};void 0===this.R&&(this.R=new Map),this.R.has(s)||this.R.set(s,[]),this.R.get(s).push(h)}N(t,s,i){if(s)return!this.F&&this.L?void(this.L=!1):void this.k(t,i);this.F?this.k(t,i):this.L=!0}j(t,s,i,h){let e=null;if(this.A){const{duration:t}=this.A,i=this.translate.getInstance(),h=this.translate.increase(s).getInstance();e="number"==typeof t?t:function(t,s){const i=t.x-s.x,h=t.y-s.y,e=Math.sqrt(i*i+h*h);return 20*Math.sqrt(e)}(i,h)}else this.translate.increase(s);this.rect.setAxes(this.$.x+this.translate.x,this.$.y+this.translate.y),this.N(t,i,e);const{self:n}=this.VDOMOrder,r=n+h;return this.updateIndex(t,r),[n,r]}H(t,s,i){if(-1!==t)for(let t=0;t<s;t+=1)this.DOMGrid.x+=1,this.DOMGrid.x>i.x&&(this.DOMGrid.x=0,this.DOMGrid.y+=1);else for(let t=0;t<s;t+=1)this.DOMGrid.x-=1,this.DOMGrid.x<0&&(this.DOMGrid.x=i.x,this.DOMGrid.y-=1)}reconcilePosition(t,s,i,h,e,n,r,o){let u;const l={x:1===s?-1:1,y:s};"z"===t?u=v:(u=[t],l[t]=s),u.forEach((t=>{e[t]*=l[t],this.H(l[t],n,r)})),this.V(t,o,n);const c=s*n,[a,d]=this.j(i,e,!1,c);h[a]="",h[d]=this.id}restorePosition(t){this.k(t,null),x(t,this.VDOMOrder.self)}assignNewPosition(t,s){this.translate.clone(s),this.k(t,null)}rollBackPosition(t,s){if(void 0===this.R||!this.R.has(s))return;const i=this.R.get(s),{translate:h,axes:e,numberOfPassedElm:n}=i.pop(),r={x:h.x-this.translate.x,y:h.y-this.translate.y};let o=0;const u={x:r.x>0?1:-1,y:r.y>0?1:-1};if("z"===e?(o=r.x>0||r.y>0?1:-1,this.DOMGrid.increase({x:u.x*n,y:u.y*n})):(o=u[e]*n,this.DOMGrid[e]+=o),this.j(t,r,!0,o),0===i.length)return this.R.delete(s),void(0===this.R.size&&(this.R=void 0));this.rollBackPosition(t,s)}hasTransformedFromOrigin(){return this.$.isNotEqual(this.rect.left,this.rect.top)}needDOMReconciliation(){return this.VDOMOrder.self!==this.DOMOrder.self}refreshIndicators(t){this.R=void 0,this.translate.setAxes(0,0),this.L=!1,this.DOMOrder.self=this.VDOMOrder.self,P(t,"transform"),function(t,s){if(!t.hasAttribute(s))return;const i=t.getAttribute(s);i&&""===i.trim()&&t.removeAttribute(s)}(t,"style"),this.DOMGrid.setAxes(0,0)}getSerializedInstance(){return{type:z.getType(),version:3,id:this.id,grid:this.DOMGrid,translate:this.translate instanceof m?this.translate:null,order:this.VDOMOrder,initialPosition:this.$.getInstance(),rect:this.rect,hasTransformedFromOrigin:this.hasTransformedFromOrigin(),hasPendingTransformation:this.L,isVisible:this.F}}}class C extends z{static getDistance(t,s,i){let h=t[i]-s.rect["x"===i?"left":"top"];return h+=s.translate[i],h}static getDisplacement(t,s,i){return t[i]-("x"===i?s.rect.right:s.rect.bottom)}getDisplacement(t,s){return C.getDisplacement(this.rect.getPosition(),t,s)}getDistance(t,s){return C.getDistance(this.rect.getPosition(),t,s)}}const $=/(auto|scroll|overlay)/;function q(t){const s=D(t),i=[void 0,!1,new p(!1,!1)],h=function(t,h){let e=0,n=t;try{do{if(e+=1,e>1&&((t,s,i)=>{const h=M(t,"overflow-x"),e=M(t,"overflow-y");if("absolute"===s&&"static"===D(t))return!1;const[,,n]=i,r=(s,i)=>((t,s,i,h)=>{if($.test(s)){const s=function(t,s){return"y"===s?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth}(i,t);if(s)return h[t]=!0,!0}return!1})(s,i,t,n);return r("y",e)||r("x",h)})(n,s,i))return e=0,n;n=n.parentElement}while(null!==n&&!n.isSameNode(document.body))}catch(t){}finally{e=0}return null}(t);return h&&"fixed"!==s?i[0]=h:(i[0]=document.documentElement,i[1]=!0),i}const k={horizontal:25,vertical:25},V={horizontal:10,vertical:10};class N{static getType(){return"scroll:container"}constructor(t,s,i,h){this.G=s,this.W=h,this.K={inner:{threshold:null,key:`scroll_inner_${s}`},outer:{threshold:null,key:`scroll_outer_${s}`}},this.U=`scroll__${s}`,[this.Y,this.J,this.hasOverflow]=q(t),this.totalScrollRect=new f(0,0,0,0),this.visibleScrollRect=new f(0,0,0,0),this.X=!1,this.refreshScrollAndVisibility(i),this.Z(!0)}hasDynamicVisibility(){return this.X&&this.hasOverflow.isOneTruthy()}tt(t,s){const i=this.K[t];if(!s)return void(i.threshold&&(i.threshold.destroy(),i.threshold=null));const h=new g(s);i.threshold=h,h.setMainThreshold(i.key,this.visibleScrollRect,"inner"===t)}st(t,s){const i=this.U,h=s.toString(),e=this.J?document.body:this.Y;t?e.dataset[i]=h:delete e.dataset[i]}it(){if(this.hasOverflow.isAllFalsy())return this.tt("inner",null),this.tt("outer",null),void this.st(!1,!0);this.st(!0,!0),this.tt("inner",null),this.tt("inner",V),this.hasDynamicVisibility()&&(this.tt("outer",null),this.tt("outer",k))}ht(){const t=(t,s)=>function(t,s,i,h=!1){const e=a(i);return t[e]/(h?.5:1)>s[e]}(this.totalScrollRect,this.visibleScrollRect,t,s),s=t("x"),i=t("y");this.hasOverflow.setAxes(s,i),this.it()}et(t,s){return this.Y["x"===t?"scrollWidth":"scrollHeight"]!==s}hasScrollDimensionChanges(){const{width:t,height:s}=this.totalScrollRect;return this.et("y",s)||this.et("x",t)}refreshScrollAndVisibility(t){this.nt(),this.X=t>10,this.J?this.ht():this.it()}nt(){const{scrollHeight:t,scrollWidth:s,scrollLeft:i,scrollTop:h,clientHeight:e,clientWidth:n}=this.Y;if(this.totalScrollRect.setByPointAndDimensions(h,i,t,s),this.J)this.visibleScrollRect.setByPointAndDimensions(h,i,e,n);else{const{left:t,top:s}=this.Y.getBoundingClientRect();this.visibleScrollRect.setByPointAndDimensions(s,t,e,n)}}rt(t,s,i){return!!this.totalScrollRect.hasEqualPosition(t,s)&&(this.totalScrollRect.setPosition(t,s),i&&(this.Y.scrollTop=s,this.Y.scrollLeft=t),!0)}scrollTo(t,s){this.rt(-1===t?this.totalScrollRect.left:t,-1===s?this.totalScrollRect.right:s,!0),this.W(this.G)}ot(t){const s=d(t),i=this.totalScrollRect[s],h=function(t){return"x"===t?"right":"bottom"}(t),e=this.totalScrollRect[h],n=a(t);return[i,e,this.visibleScrollRect[n]]}calculateDistance(t,s){const[i,h,e]=this.ot(t);return 1===s?h-(i+e):i}hasScrollableArea(t,s){const[i,h,e]=this.ot(t);return 1===s?i+e<h:i>0}ut=_((()=>{const{scrollLeft:t,scrollTop:s}=this.Y;this.rt(t,s,!1)&&this.W(this.G)}));lt=_((()=>{this.nt(),this.ht()}));Z(t){const s=t?"addEventListener":"removeEventListener",i=this.J?window:this.Y,h={passive:!0};i[s]("resize",this.lt,h),i[s]("scroll",this.ut,h)}pauseListeners(t){t?this.ut.pause():this.ut.resume()}getMaximumScrollContainerLeft(){const{left:t,width:s}=this.visibleScrollRect;return t+s+this.totalScrollRect.left}getMaximumScrollContainerTop(){const{top:t,height:s}=this.visibleScrollRect;return t+s+this.totalScrollRect.top}getElmViewportPosition(t,s){const{top:i,left:h}=this.totalScrollRect;return[t-i,s-h]}isElmOutViewport(t){let s,i;if(t instanceof f){const[h,e]=this.getElmViewportPosition(t.top,t.left);s=new n(h,e+t.width,h+t.height,e),i=this.K.outer}else s=t,i=this.K.inner;const{threshold:h,key:e}=i;return[h.isOutThreshold(e,s,this.hasOverflow.y?"y":"x"),h.isOut[e]]}ct(){const{height:t,width:s}=this.visibleScrollRect;return{height:t,width:s}}getSerializedInstance(){return{type:N.getType(),version:3,key:this.G,hasOverFlow:this.hasOverflow.getInstance(),hasDocumentAsContainer:this.J,scrollRect:this.totalScrollRect.getBox(),scrollContainerRect:this.visibleScrollRect.getBox(),visibleScreen:this.ct()}}destroy(){this.Z(!1),this.tt("inner",null),this.tt("outer",null),this.st(!1,!0),this.W=void 0,this.Y=void 0}}exports.DFlexBaseElement=A,exports.DFlexElement=C,exports.DFlexParentContainer=class{constructor(t,s,i,h){this.id=t,this.dt=new m(-1,-1),this.grid=new m(-1,-1),this.originLength=i,this.ft=new n(0,0,0,0),this.gt=null;const{left:e,top:r}=h;this.xt=y(s,e,r),this.lastElmPosition=null}yt(t){const s=this.ft;return s.isPositionedY(t)?(this.dt.y+=1,this.dt.x=0,this.ft.setBox(0,0,0,0)):this.dt.x+=1,this.dt.x>this.grid.x&&(this.grid.x=this.dt.x),this.dt.y>this.grid.y&&(this.grid.y=this.dt.y),s.assignBiggestBox(t),this.dt}register(t,s){this.gt?this.gt.assignBiggestBox(t):this.gt=new n(t.top,t.right,t.bottom,t.left);const i=this.yt(t),h=this.gt,e=s;if(!e)return i;const r=h.bottom-h.top,o=h.right-h.left;return e.height<r&&(e.height=r),e.width<o&&(e.width=r),i}extendGrid(t){this.grid[t]+=1}reduceGrid(t){this.grid[t]-=1}getBoundaries(){return this.gt||this.xt.getBox()}resetIndicators(t){this.dt.setAxes(-1,-1),this.grid.setAxes(-1,-1),this.originLength=t,this.ft.setBox(0,0,0,0),this.gt=null,this.lastElmPosition=null}preservePosition(t){this.lastElmPosition?this.lastElmPosition.setAxes(t.x,t.y):this.lastElmPosition=new m(t.x,t.y)}},exports.DFlexScrollContainer=N;
class t{constructor(t,s){this.x=t,this.y=s}}class s extends t{setAxes(t,s){this.x=t,this.y=s}clone(t){this.setAxes(t.x,t.y)}getInstance(){return{x:this.x,y:this.y}}isInstanceEqual(t){return this.x===t.x&&this.y===t.y}isEqual(t,s){return this.x===t&&this.y===s}isNotEqual(t,s){return this.x!==t||this.y!==s}}class i{constructor(t,s,i,h){this.top=t,this.right=s,this.bottom=i,this.left=h}}class h extends i{clone(t){this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left}setBox(t,s,i,h){return this.top=t,this.right=s,this.bottom=i,this.left=h,this}getBox(){return{top:this.top,right:this.right,bottom:this.bottom,left:this.left}}setByAxis(t,s,i){"x"===t?(this.left=s,this.right=i):(this.top=s,this.bottom=i)}setOne(t,s,i){"x"===t?-1===s?this.left=i:this.right=i:-1===s?this.top=i:this.bottom=i}getOne(t,s){return"x"===t?-1===s?this.left:this.right:-1===s?this.top:this.bottom}setPositionInstance(t){this.top=t.y,this.left=t.x}setPosition(t,s){this.top=s,this.left=t}hasEqualPosition(t,s){return this.top===s||this.left===t}getPosition(){return{x:this.left,y:this.top}}}class e extends h{constructor(t,s,i,h){super(t,s,i,h)}setFalsy(){return this.setBox(!1,!1,!1,!1),this}isTruthyByAxis(t){return"x"===t?this.left||this.right:this.top||this.bottom}isTruthyOnSide(t,s){return"x"===t?1===s?this.right:this.left:1===s?this.bottom:this.top}isTruthy(){return this.left||this.right||this.top||this.bottom}}class n extends h{t(t){return this.top>=t.bottom}i(t){return this.bottom<=t.top}h(t){return this.right<=t.left}o(t){return this.left>=t.right}u(t){return this.top<t.top}l(t){return this.right>t.right}m(t){return this.bottom>t.bottom}p(t){return this.left<t.left}T(t){return this.top>=t.top}_(t){return this.right<=t.right}v(t){return this.bottom<=t.bottom}O(t){return this.left>=t.left}isBoxIntersect(t){return!(this.i(t)||this.o(t)||this.t(t)||this.h(t))}isOutThreshold(t,s,i){if(s.setBox(!1,!1,!1,!1),i){if("y"===i){const i=this.u(t),h=this.m(t);return i&&(s.top=!0),h&&(s.bottom=!0),i||h}const h=this.p(t),e=this.l(t);return h&&(s.left=!0),e&&(s.right=!0),h||e}return this.u(t)?(s.top=!0,!0):this.l(t)?(s.right=!0,!0):this.m(t)?(s.bottom=!0,!0):!!this.p(t)&&(s.left=!0,!0)}isInsideThreshold(t){return this.T(t)&&this._(t)&&this.v(t)&&this.O(t)}getSurroundingBox(t){return{left:Math.min(t.left,this.left),top:Math.min(t.top,this.top),right:Math.max(t.right,this.right),bottom:Math.max(t.bottom,this.bottom)}}isPositionedY(t){return this.t(t)||this.i(t)}assignBiggestBox(t){const{top:s,left:i,right:h,bottom:e}=t;i<this.left&&(this.left=i),s<this.top&&(this.top=s),h>this.right&&(this.right=h),e>this.bottom&&(this.bottom=e)}}function r(t,s){return`${t}_${s}`}function o(){}const u="height",l="width",c="position";function a(t){return"x"===t?l:u}function d(t){return"x"===t?"left":"top"}class f extends n{constructor(t,s,i,h){super(t,s,i,h),this.width=s-h,this.height=i-t}setByPointAndDimensions(t,s,i,h){this.top=t,this.left=s,this.width=h,this.height=i,this.right=s+h,this.bottom=t+i}setAxes(t,s){this.left=t,this.right=this.width+t,this.top=s,this.bottom=this.height+s}getDimensionDiff(t,s){const i=a(t);return this[i]-s[i]}getPositionDiff(t,s){return this[d(t)]-s[t]}}class m extends s{increase(t){return this.x+=t.x,this.y+=t.y,this}composeBox(t,s){const{top:i,left:h,bottom:e,right:r}=t;return s?new n(i+this.y,r-this.x,e-this.y,h+this.x):new n(i-this.y,r+this.x,e+this.y,h-this.x)}onSameAxis(t,s){return"y"===t?s.x===this.x:s.y===this.y}}class p extends s{isOneTruthy(){return this.x||this.y}isAllFalsy(){return!(this.x||this.y)}setFalsy(){this.x=!1,this.y=!1}}class g{static containerKey(t,s){return r(t,s)}static depthKey(t){return r(t,"dp")}constructor(t){this.P=t,this.thresholds={},this.isOut={}}S({width:t,height:s}){const i=Math.round(this.P.horizontal*t/100),h=Math.round(this.P.vertical*s/100);this.D=new m(i,h)}M(t,s,i){this.thresholds[t]=this.D.composeBox(s,i),this.isOut[t]=new e(!1,!1,!1,!1)}setMainThreshold(t,s,i){this.S(s),this.M(t,s,i)}updateMainThreshold(t,s,i){this.thresholds[t]=this.D.composeBox(s,i),this.isOut[t].setFalsy()}getElmMainThreshold(t){return this.D.composeBox(t,!1)}setContainerThreshold(t,s,i,h){this.M(t,i,!1);const{top:e,left:n}=i,{height:r,width:o}=h,u=g.containerKey(s,t),l=g.depthKey(s);this.M(u,{left:n,top:e,right:n+o,bottom:e+r},!1),this.thresholds[l]?this.thresholds[l].assignBiggestBox(this.thresholds[u]):this.M(l,this.thresholds[u],!1)}isOutThreshold(t,s,i){return s.isOutThreshold(this.thresholds[t],this.isOut[t],i)}destroy(){Object.keys(this.thresholds).forEach((t=>{delete this.thresholds[t]})),Object.keys(this.isOut).forEach((t=>{delete this.isOut[t]}))}}function x(t,s){!function(t,s,i,h=!0,e="true"){const n=h?`data-${s}`:s;!1?t.removeAttribute(n):t.setAttribute(n,e)}(t,"index",0,!0,`${s}`)}function y(t,s,i){const{left:h,top:e,right:n,bottom:r,height:o,width:u}=t.getBoundingClientRect(),l=new f(e,n,r,h);return 0===s&&0===i||l.setByPointAndDimensions(e+i,h+s,o,u),l}const w=[];function T(){let t,s=!0;function i(){s=!0}function h(){!function(t){cancelAnimationFrame(t)}(t),w.splice(w.indexOf(t),1)}return[function(e,n){n&&h();try{s=!1;const h=function(t,s){return i=>{t(i),s()}}(e,i);t=requestAnimationFrame(h),w.push(t)}catch(t){}},h,function(){return s}]}function _(t,s=!1,i=200){const[h,e]=function(t){let s=null,i=!1;function h(){s&&(clearTimeout(s),s=null)}return[function(e,n){const r=e||o;i=!0,n&&h(),s=setTimeout((()=>{i=!1,r()}),t)},h,function(){return i}]}(i),[n,r]=T();let u=performance.now(),l=!1;const c=()=>{if(l)return;const e=performance.now();s||e-u>=i?(n(t,!0),u=e):h(c,!0)};return c.isPaused=()=>l,c.pause=()=>{l||(l=!0,r(),e())},c.resume=()=>{l&&(l=!1,c())},c}const v=Object.freeze(["x","y"]);let O=new WeakMap;function b(t,s,i){t.style.setProperty(s,i)}function P(t,s){t.style.removeProperty(s)}function S(t,s,i){const h=function(t){if(O.has(t))return O.get(t);const s={computedStyle:getComputedStyle(t),parsedProperties:new Map};return O.set(t,s),s}(t),{parsedProperties:e,computedStyle:n}=h,r=e.get(s);if(void 0===r){const t=n.getPropertyValue(s),h=i?function(t){const s=parseFloat(t);return Number.isNaN(s)?0:s}(t):t;return e.set(s,h),h}return r}function D(t){return S(t,c,!1)}function M(t,s){return S(t,s,!1)}function E(t,s,i){b(t,"transform",`translate3d(${s}px, ${i}px, 0)`)}class A{static getType(){return"base:element"}static transform=E;constructor(t){this.id=t,this.translate=new m(0,0)}}const B="transition-property",I="transition-delay",F="transition-duration",L="transition-timing-function";const R="transitionend";class z extends A{static getType(){return"core:element"}constructor(t){const{order:s,keys:i,depth:h,readonly:e,animation:n,id:r,CSSTransform:o}=t;super(r),this.VDOMOrder={...s},this.DOMOrder={...s},this.keys={...i},this.depth=h,this.readonly=e,this.A=n,this.B=o,[this.I]=T(),this.F=!0,this.L=!1,this.R=void 0,this.C=null,this.$=new m(0,0),this.rect=new f(0,0,0,0),this.DOMGrid=new m(0,0)}updateConfig(t,s,i){this.readonly=t,this.A=s,this.B=i}initElmRect(t,s,i){this.rect=y(t,s,i);const{left:h,top:e}=this.rect;this.$.setAxes(h,e),this.q(t)}q(t){const s=function(t){const s=function(t){if(!/matrix\([^)]+\)/.test(t))return null;const s=t.match(/matrix\(\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^)]+)\)/);return s?[parseFloat(s[5]),parseFloat(s[6])]:null}(S(t,"transform",!1));return s}(t);if(s){const[t,i]=s,h=this.$.x-t,e=this.$.y-i;this.$.setAxes(h,e),this.rect.setByPointAndDimensions(e,h,this.rect.height,this.rect.width),this.translate.setAxes(t,i)}}getDimensions(t){if(this.C)return this.C;const{width:s,height:i}=function(t){return{width:S(t,l,!0),height:S(t,u,!0)}}(t);return this.C=new m(s,i),this.C}getInitialPosition(){return this.$}changeVisibility(t,s){s!==this.F&&(this.F=s,this.L&&this.F&&(this.k(t,null),this.L=!1))}k(t,s,i=o){if(!this.F)return void(this.L=!0);const h=()=>{this.B&&function(t,s){"string"!=typeof s?function(t,s){Object.keys(s).forEach((s=>{P(t,s)}))}(t,s):function(t,s){t.classList.remove(s)}(t,s)}(t,this.B),this.A&&function(t){P(t,B),P(t,I),P(t,F),P(t,L)}(t),s&&t.removeEventListener(R,h),i()};this.I((()=>{if(this.B&&function(t,s){"string"!=typeof s?function(t,s){Object.entries(s).forEach((([s,i])=>{b(t,s,i)}))}(t,s):function(t,s){t.classList.add(s)}(t,s)}(t,this.B),null===s)return z.transform(t,this.translate.x,this.translate.y),void h();t.addEventListener(R,h),function(t,s,i,h){b(t,B,"transform"),b(t,I,"0ms"),b(t,F,`${i}ms`),b(t,L,h)}(t,0,s,this.A.easing),z.transform(t,this.translate.x,this.translate.y)}),!0)}updateIndex(t,s){x(t,s),this.VDOMOrder.self=s}assignNewIndex(t,s){t[s]=this.id}V(t,s,i){const h={axes:t,numberOfPassedElm:i,translate:this.translate.getInstance()};void 0===this.R&&(this.R=new Map),this.R.has(s)||this.R.set(s,[]),this.R.get(s).push(h)}N(t,s,i){if(s)return!this.F&&this.L?void(this.L=!1):void this.k(t,i);this.F?this.k(t,i):this.L=!0}j(t,s,i,h){let e=null;if(this.A){const{duration:t}=this.A,i=this.translate.getInstance(),h=this.translate.increase(s).getInstance();e="number"==typeof t?t:function(t,s){const i=t.x-s.x,h=t.y-s.y,e=Math.sqrt(i*i+h*h);return 20*Math.sqrt(e)}(i,h)}else this.translate.increase(s);this.rect.setAxes(this.$.x+this.translate.x,this.$.y+this.translate.y),this.N(t,i,e);const{self:n}=this.VDOMOrder,r=n+h;return this.updateIndex(t,r),[n,r]}H(t,s,i){if(-1!==t)for(let t=0;t<s;t+=1)this.DOMGrid.x+=1,this.DOMGrid.x>i.x&&(this.DOMGrid.x=0,this.DOMGrid.y+=1);else for(let t=0;t<s;t+=1)this.DOMGrid.x-=1,this.DOMGrid.x<0&&(this.DOMGrid.x=i.x,this.DOMGrid.y-=1)}reconcilePosition(t,s,i,h,e,n,r,o){let u;const l={x:1===s?-1:1,y:s};"z"===t?u=v:(u=[t],l[t]=s),u.forEach((t=>{e[t]*=l[t],this.H(l[t],n,r)})),this.V(t,o,n);const c=s*n,[a,d]=this.j(i,e,!1,c);h[a]="",h[d]=this.id}restorePosition(t){this.k(t,null),x(t,this.VDOMOrder.self)}assignNewPosition(t,s){this.translate.clone(s),this.k(t,null)}rollBackPosition(t,s){if(void 0===this.R||!this.R.has(s))return;const i=this.R.get(s),{translate:h,axes:e,numberOfPassedElm:n}=i.pop(),r={x:h.x-this.translate.x,y:h.y-this.translate.y};let o=0;const u={x:r.x>0?1:-1,y:r.y>0?1:-1};if("z"===e?(o=r.x>0||r.y>0?1:-1,this.DOMGrid.increase({x:u.x*n,y:u.y*n})):(o=u[e]*n,this.DOMGrid[e]+=o),this.j(t,r,!0,o),0===i.length)return this.R.delete(s),void(0===this.R.size&&(this.R=void 0));this.rollBackPosition(t,s)}hasTransformedFromOrigin(){return this.$.isNotEqual(this.rect.left,this.rect.top)}needDOMReconciliation(){return this.VDOMOrder.self!==this.DOMOrder.self}refreshIndicators(t){this.R=void 0,this.translate.setAxes(0,0),this.L=!1,this.DOMOrder.self=this.VDOMOrder.self,P(t,"transform"),function(t,s){if(!t.hasAttribute(s))return;const i=t.getAttribute(s);i&&""===i.trim()&&t.removeAttribute(s)}(t,"style"),this.DOMGrid.setAxes(0,0)}getSerializedInstance(){return{type:z.getType(),version:3,id:this.id,grid:this.DOMGrid,translate:this.translate instanceof m?this.translate:null,order:this.VDOMOrder,initialPosition:this.$.getInstance(),rect:this.rect,hasTransformedFromOrigin:this.hasTransformedFromOrigin(),hasPendingTransformation:this.L,isVisible:this.F}}}class C extends z{static getDistance(t,s,i){let h=t[i]-s.rect["x"===i?"left":"top"];return h+=s.translate[i],h}static getDisplacement(t,s,i){return t[i]-("x"===i?s.rect.right:s.rect.bottom)}getDisplacement(t,s){return C.getDisplacement(this.rect.getPosition(),t,s)}getDistance(t,s){return C.getDistance(this.rect.getPosition(),t,s)}}const $=/(auto|scroll|overlay)/;function q(t){const s=D(t),i=[void 0,!1,new p(!1,!1)],h=function(t,h){let e=0,n=t;try{do{if(e+=1,e>1&&((t,s,i)=>{const h=M(t,"overflow-x"),e=M(t,"overflow-y");if("absolute"===s&&"static"===D(t))return!1;const[,,n]=i,r=(s,i)=>((t,s,i,h)=>{if($.test(s)){const s=function(t,s){return"y"===s?t.scrollHeight>t.clientHeight:t.scrollWidth>t.clientWidth}(i,t);if(s)return h[t]=!0,!0}return!1})(s,i,t,n);return r("y",e)||r("x",h)})(n,s,i))return e=0,n;n=n.parentElement}while(null!==n&&!n.isSameNode(document.body))}catch(t){}finally{e=0}return null}(t);return h&&"fixed"!==s?i[0]=h:(i[0]=document.documentElement,i[1]=!0),i}const k={horizontal:25,vertical:25},V={horizontal:10,vertical:10};class N{static getType(){return"scroll:container"}constructor(t,s,i,h){this.G=s,this.W=h,this.K={inner:{threshold:null,key:`scroll_inner_${s}`},outer:{threshold:null,key:`scroll_outer_${s}`}},this.U=`scroll__${s}`,[this.Y,this.J,this.hasOverflow]=q(t),this.totalScrollRect=new f(0,0,0,0),this.visibleScrollRect=new f(0,0,0,0),this.X=!1,this.refreshScrollAndVisibility(i),this.Z(!0)}hasDynamicVisibility(){return this.X&&this.hasOverflow.isOneTruthy()}tt(t,s){const i=this.K[t];if(!s)return void(i.threshold&&(i.threshold.destroy(),i.threshold=null));const h=new g(s);i.threshold=h,h.setMainThreshold(i.key,this.visibleScrollRect,"inner"===t)}st(t,s){const i=this.U,h=s.toString(),e=this.J?document.body:this.Y;t?e.dataset[i]=h:delete e.dataset[i]}it(){if(this.hasOverflow.isAllFalsy())return this.tt("inner",null),this.tt("outer",null),void this.st(!1,!0);this.st(!0,!0),this.tt("inner",null),this.tt("inner",V),this.hasDynamicVisibility()&&(this.tt("outer",null),this.tt("outer",k))}ht(){const t=(t,s)=>function(t,s,i,h=!1){const e=a(i);return t[e]/(h?.5:1)>s[e]}(this.totalScrollRect,this.visibleScrollRect,t,s),s=t("x"),i=t("y");this.hasOverflow.setAxes(s,i),this.it()}et(t,s){return this.Y["x"===t?"scrollWidth":"scrollHeight"]!==s}hasScrollDimensionChanges(){const{width:t,height:s}=this.totalScrollRect;return this.et("y",s)||this.et("x",t)}refreshScrollAndVisibility(t){this.nt(),this.X=t>10,this.J?this.ht():this.it()}nt(){const{scrollHeight:t,scrollWidth:s,scrollLeft:i,scrollTop:h,clientHeight:e,clientWidth:n}=this.Y;if(this.totalScrollRect.setByPointAndDimensions(h,i,t,s),this.J)this.visibleScrollRect.setByPointAndDimensions(h,i,e,n);else{const{left:t,top:s}=this.Y.getBoundingClientRect();this.visibleScrollRect.setByPointAndDimensions(s,t,e,n)}}rt(t,s,i){return!!this.totalScrollRect.hasEqualPosition(t,s)&&(this.totalScrollRect.setPosition(t,s),i&&(this.Y.scrollTop=s,this.Y.scrollLeft=t),!0)}scrollTo(t,s){this.rt(-1===t?this.totalScrollRect.left:t,-1===s?this.totalScrollRect.right:s,!0),this.W(this.G)}ot(t){const s=d(t),i=this.totalScrollRect[s],h=function(t){return"x"===t?"right":"bottom"}(t),e=this.totalScrollRect[h],n=a(t);return[i,e,this.visibleScrollRect[n]]}calculateDistance(t,s){const[i,h,e]=this.ot(t);return 1===s?h-(i+e):i}hasScrollableArea(t,s){const[i,h,e]=this.ot(t);return 1===s?i+e<h:i>0}ut=_((()=>{const{scrollLeft:t,scrollTop:s}=this.Y;this.rt(t,s,!1)&&this.W(this.G)}));lt=_((()=>{this.nt(),this.ht()}));Z(t){const s=t?"addEventListener":"removeEventListener",i=this.J?window:this.Y,h={passive:!0};i[s]("resize",this.lt,h),i[s]("scroll",this.ut,h)}pauseListeners(t){t?this.ut.pause():this.ut.resume()}getMaximumScrollContainerLeft(){const{left:t,width:s}=this.visibleScrollRect;return t+s+this.totalScrollRect.left}getMaximumScrollContainerTop(){const{top:t,height:s}=this.visibleScrollRect;return t+s+this.totalScrollRect.top}getElmViewportPosition(t,s){const{top:i,left:h}=this.totalScrollRect;return[t-i,s-h]}isElmOutViewport(t){let s,i;if(t instanceof f){const[h,e]=this.getElmViewportPosition(t.top,t.left);s=new n(h,e+t.width,h+t.height,e),i=this.K.outer}else s=t,i=this.K.inner;const{threshold:h,key:e}=i;return[h.isOutThreshold(e,s,this.hasOverflow.y?"y":"x"),h.isOut[e]]}ct(){const{height:t,width:s}=this.visibleScrollRect;return{height:t,width:s}}getSerializedInstance(){return{type:N.getType(),version:3,key:this.G,hasOverFlow:this.hasOverflow.getInstance(),hasDocumentAsContainer:this.J,scrollRect:this.totalScrollRect.getBox(),scrollContainerRect:this.visibleScrollRect.getBox(),visibleScreen:this.ct()}}destroy(){this.Z(!1),this.tt("inner",null),this.tt("outer",null),this.st(!1,!0),this.W=void 0,this.Y=void 0}}exports.DFlexBaseElement=A,exports.DFlexElement=C,exports.DFlexParentContainer=class{constructor(t,s,i,h){this.id=t,this.dt=new m(-1,-1),this.grid=new m(-1,-1),this.originLength=i,this.ft=new n(0,0,0,0),this.gt=null;const{left:e,top:r}=h;this.xt=y(s,e,r),this.lastElmPosition=null}yt(t){const s=this.ft;return s.isPositionedY(t)?(this.dt.y+=1,this.dt.x=0,this.ft.setBox(0,0,0,0)):this.dt.x+=1,this.dt.x>this.grid.x&&(this.grid.x=this.dt.x),this.dt.y>this.grid.y&&(this.grid.y=this.dt.y),s.assignBiggestBox(t),this.dt}register(t,s){this.gt?this.gt.assignBiggestBox(t):this.gt=new n(t.top,t.right,t.bottom,t.left);const i=this.yt(t),h=this.gt,e=s;if(!e)return i;const r=h.bottom-h.top,o=h.right-h.left;return e.height<r&&(e.height=r),e.width<o&&(e.width=r),i}extendGrid(t){this.grid[t]+=1}reduceGrid(t){this.grid[t]-=1}getBoundaries(){return this.gt||this.xt.getBox()}resetIndicators(t){this.dt.setAxes(-1,-1),this.grid.setAxes(-1,-1),this.originLength=t,this.ft.setBox(0,0,0,0),this.gt=null,this.lastElmPosition=null}preservePosition(t){this.lastElmPosition?this.lastElmPosition.setAxes(t.x,t.y):this.lastElmPosition=new m(t.x,t.y)}},exports.DFlexScrollContainer=N;
{
"name": "@dflex/core-instance",
"version": "3.10.1",
"version": "3.10.2",
"description": "Core instance is a DFlex package for interactive DOM element",

@@ -30,3 +30,3 @@ "author": "Jalal Maskoun",

"devDependencies": {
"@dflex/utils": "^3.10.1"
"@dflex/utils": "^3.10.2"
},

@@ -33,0 +33,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc