@aquera/nile-elements 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/flow-8340c041.esm.js +16 -0
- package/dist/flow-d0fa8803.cjs.js +14 -0
- package/dist/flow-d0fa8803.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/index.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +25 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +11 -2
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +50 -10
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +5 -5
- package/dist/nile-chip/index.cjs.js +1 -1
- package/dist/nile-chip/index.esm.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.esm.js +7 -5
- package/dist/nile-chip/nile-chip.test.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.test.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.test.esm.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.css.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.css.cjs.js.map +1 -1
- package/dist/nile-radio-group/nile-radio-group.css.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +7 -2
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js +9 -0
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.d.ts +10 -5
- package/dist/src/nile-auto-complete/nile-auto-complete.js +63 -44
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.d.ts +7 -5
- package/dist/src/nile-chip/nile-chip.js +83 -78
- package/dist/src/nile-chip/nile-chip.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.css.js +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.css.js.map +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +5 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/watch.cjs.js +1 -1
- package/dist/watch.cjs.js.map +1 -1
- package/dist/watch.esm.js +1 -1
- package/package.json +3 -2
- package/src/nile-auto-complete/nile-auto-complete.css.ts +9 -0
- package/src/nile-auto-complete/nile-auto-complete.ts +61 -44
- package/src/nile-chip/nile-chip.ts +100 -95
- package/src/nile-radio-group/nile-radio-group.css.ts +1 -1
- package/src/nile-slide-toggle/nile-slide-toggle.css.ts +5 -0
- package/vscode-html-custom-data.json +12 -2
package/README.md
CHANGED
@@ -80,6 +80,15 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
80
80
|
In this section, you can find the updates for each release of `nile-elements`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
|
81
81
|
|
82
82
|
|
83
|
+
#### Version 0.1.23
|
84
|
+
- Nile Autocomplete: enableVirtualScroll property available
|
85
|
+
- Nile Chip: enableVirtualScroll property available
|
86
|
+
- Nile Autocomplete/Nile Chip: Use css variable for width control
|
87
|
+
- Nile Slide Toggle: Label css fix
|
88
|
+
|
89
|
+
#### Version 0.1.22
|
90
|
+
- Nile Radio: CSS update
|
91
|
+
|
83
92
|
#### Version 0.1.21
|
84
93
|
- Nile Autocomplete: property added loading, filterFunction
|
85
94
|
- Nile Chip: property added loading, filterFunction
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2021 Google LLC
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
5
|
+
*/
|
6
|
+
class t{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===t?.roundAverageSize&&(this._roundAverageSize=!0)}set(t,i){const s=this._map.get(t)||0;this._map.set(t,i),this.totalSize+=i-s}get averageSize(){if(this._map.size>0){const t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}
|
7
|
+
/**
|
8
|
+
* @license
|
9
|
+
* Copyright 2021 Google LLC
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
11
|
+
*/function i(t){return"horizontal"===t?"width":"height"}class s{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,i){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then((()=>this.config=i||this._getDefaultConfig()))}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:i,_viewDim2:s}=this;Object.assign(this._viewportSize,t),s!==this._viewDim2?this._scheduleLayoutUpdate():i!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const i=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(i-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:t,block:i}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:i}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[i(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then((()=>this.reflowIfNeeded()))}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const t=this._scrollPosition,{index:i,block:s}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:i,block:s||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){const{block:i}=t,s=Math.min(this.items.length,Math.max(0,t.index)),h=this._getItemPosition(s)[this._positionDim];let e=h;if("start"!==i){const t=this._getItemSize(s)[this._sizeDim];if("center"===i)e=h-.5*this._viewDim1+.5*t;else{const s=h-this._viewDim1+t;if("end"===i)e=s;else{const t=this._scrollPosition;e=Math.abs(t-h)<Math.abs(t-s)?h:s}}}return e+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(e)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const t=new Map;if(-1!==this._first&&-1!==this._last)for(let i=this._first;i<=this._last;i++)t.set(i,this._getItemPosition(i));const i={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(i.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(i)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),i=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<i?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(-1===this._first||-1===this._last)return;let i=this._first;for(;i<this._last&&Math.round(this._getItemPosition(i)[this._positionDim]+this._getItemSize(i)[this._sizeDim])<=Math.round(this._scrollPosition);)i++;let s=this._last;for(;s>this._first&&Math.round(this._getItemPosition(s)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)s--;i===this._firstVisible&&s===this._lastVisible||(this._firstVisible=i,this._lastVisible=s,t&&t.emit&&this._sendVisibilityChangedMessage())}}
|
12
|
+
/**
|
13
|
+
* @license
|
14
|
+
* Copyright 2021 Google LLC
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
16
|
+
*/function h(t){return"horizontal"===t?"marginLeft":"marginTop"}function e(t){return"horizontal"===t?"marginRight":"marginBottom"}function r(t){return"horizontal"===t?"xOffset":"yOffset"}function n(t,i){const s=[t,i].sort();return s[1]<=0?Math.min(...s):s[0]>=0?Math.max(...s):s[0]+s[1]}class o{constructor(){this._childSizeCache=new t,this._marginSizeCache=new t,this._metricsCache=new Map}update(t,s){const r=new Set;Object.keys(t).forEach((h=>{const e=Number(h);this._metricsCache.set(e,t[e]),this._childSizeCache.set(e,t[e][i(s)]),r.add(e),r.add(e+1)}));for(const t of r){const i=this._metricsCache.get(t)?.[h(s)]||0,r=this._metricsCache.get(t-1)?.[e(s)]||0;this._marginSizeCache.set(t,n(i,r))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,i){return this._metricsCache.get(t)?.[h(i)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}class l extends s{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new o,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){const i=this._metricsCache;if(-1===this._first||-1===this._last)return i.averageMarginSize+t*(i.averageMarginSize+this._getAverageSize());if(t<this._first){const s=this._first-t;return this._getPhysicalItem(this._first).pos-(i.getMarginSize(this._first-1)||i.averageMarginSize)-(s*i.averageChildSize+(s-1)*i.averageMarginSize)}{const s=t-this._last;return this._getPhysicalItem(this._last).pos+(i.getChildSize(this._last)||i.averageChildSize)+(i.getMarginSize(this._last)||i.averageMarginSize)+s*(i.averageChildSize+i.averageMarginSize)}}_getPosition(t){const i=this._getPhysicalItem(t),{averageMarginSize:s}=this._metricsCache;return 0===t?this._metricsCache.getMarginSize(0)??s:i?i.pos:this._estimatePosition(t)}_calculateAnchor(t,i){return t<=0?0:i>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+i)/2/this._delta)))}_getAnchor(t,i){if(0===this._physicalItems.size)return this._calculateAnchor(t,i);if(this._first<0)return this._calculateAnchor(t,i);if(this._last<0)return this._calculateAnchor(t,i);const s=this._getPhysicalItem(this._first),h=this._getPhysicalItem(this._last),e=s.pos;if(h.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,i);if(e>i)return this._calculateAnchor(t,i);let r=this._firstVisible-1,n=-1/0;for(;n<t;){n=this._getPhysicalItem(++r).pos+this._metricsCache.getChildSize(r)}return r}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){const t=this._newPhysicalItems;let i,s;if(this._stable=!0,null!==this.pin){const{index:t}=this.pin;this._anchorIdx=t,this._anchorPos=this._getPosition(t)}if(i=this._scrollPosition-this._overhang,s=this._scrollPosition+this._viewDim1+this._overhang,s<0||i>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(i,s),this._anchorPos=this._getPosition(this._anchorIdx));let h=this._getSize(this._anchorIdx);void 0===h&&(this._stable=!1,h=this._getAverageSize());const e=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,r=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=e),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-r-h);let n=0;for(this._anchorPos+h+r<i&&(n=i-(this._anchorPos+h+r)),this._anchorPos-e>s&&(n=s-(this._anchorPos-e)),n&&(this._scrollPosition-=n,i-=n,s-=n,this._scrollError+=n),t.set(this._anchorIdx,{pos:this._anchorPos,size:h}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-e,this._physicalMax=this._anchorPos+h+r;this._physicalMin>i&&this._first>0;){let i=this._getSize(--this._first);void 0===i&&(this._stable=!1,i=this._getAverageSize());let s=this._metricsCache.getMarginSize(this._first);void 0===s&&(this._stable=!1,s=this._metricsCache.averageMarginSize),this._physicalMin-=i;const h=this._physicalMin;if(t.set(this._first,{pos:h,size:i}),this._physicalMin-=s,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<s&&this._last<this.items.length-1;){let i=this._getSize(++this._last);void 0===i&&(this._stable=!1,i=this._getAverageSize());let s=this._metricsCache.getMarginSize(this._last);void 0===s&&(this._stable=!1,s=this._metricsCache.averageMarginSize);const h=this._physicalMax;if(t.set(this._last,{pos:h,size:i}),this._physicalMax+=i+s,!this._stable&&!this._estimate)break}const o=this._calculateError();o&&(this._physicalMin-=o,this._physicalMax-=o,this._anchorPos-=o,this._scrollPosition-=o,t.forEach((t=>t.pos-=o)),this._scrollError+=o),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:t,_last:i}=this;super._reflow(),(-1===this._first&&-1==this._last||this._first===t&&this._last===i)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){const{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[r(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}export{l as FlowLayout};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
System.register([],function(_export,_context){"use strict";var t,s,o,l;function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}/**
|
2
|
+
* @license
|
3
|
+
* Copyright 2021 Google LLC
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
5
|
+
*/function i(t){return"horizontal"===t?"width":"height";}/**
|
6
|
+
* @license
|
7
|
+
* Copyright 2021 Google LLC
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
9
|
+
*/function h(t){return"horizontal"===t?"marginLeft":"marginTop";}function e(t){return"horizontal"===t?"marginRight":"marginBottom";}function r(t){return"horizontal"===t?"xOffset":"yOffset";}function n(t,i){var s=[t,i].sort();return s[1]<=0?Math.min.apply(Math,_toConsumableArray(s)):s[0]>=0?Math.max.apply(Math,_toConsumableArray(s)):s[0]+s[1];}return{setters:[],execute:function execute(){/**
|
10
|
+
* @license
|
11
|
+
* Copyright 2021 Google LLC
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
13
|
+
*/t=/*#__PURE__*/function(){function t(_t){_classCallCheck(this,t);this._map=new Map(),this._roundAverageSize=!1,this.totalSize=0,!0===(_t===null||_t===void 0?void 0:_t.roundAverageSize)&&(this._roundAverageSize=!0);}return _createClass(t,[{key:"set",value:function set(_t2,i){var s=this._map.get(_t2)||0;this._map.set(_t2,i),this.totalSize+=i-s;}},{key:"averageSize",get:function get(){if(this._map.size>0){var _t3=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(_t3):_t3;}return 0;}},{key:"getSize",value:function getSize(_t4){return this._map.get(_t4);}},{key:"clear",value:function clear(){this._map.clear(),this.totalSize=0;}}]);}();s=/*#__PURE__*/function(){function s(t,i){var _this=this;_classCallCheck(this,s);this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(function(){return _this.config=i||_this._getDefaultConfig();});}return _createClass(s,[{key:"_getDefaultConfig",value:function _getDefaultConfig(){return{direction:"vertical"};}},{key:"config",get:function get(){return{direction:this.direction};},set:function set(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t));}},{key:"items",get:function get(){return this._items;},set:function set(t){this._setItems(t);}},{key:"_setItems",value:function _setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow());}},{key:"direction",get:function get(){return this._direction;},set:function set(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow());}},{key:"viewportSize",get:function get(){return this._viewportSize;},set:function set(t){var i=this._viewDim1,_s=this._viewDim2;Object.assign(this._viewportSize,t),_s!==this._viewDim2?this._scheduleLayoutUpdate():i!==this._viewDim1&&this._checkThresholds();}},{key:"viewportScroll",get:function get(){return this._latestCoords;},set:function set(t){Object.assign(this._latestCoords,t);var i=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(i-this._scrollPosition)>=1&&this._checkThresholds();}},{key:"reflowIfNeeded",value:function reflowIfNeeded(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow());}},{key:"pin",get:function get(){if(null!==this._pin){var _this$_pin=this._pin,_t5=_this$_pin.index,_i=_this$_pin.block;return{index:Math.max(0,Math.min(_t5,this.items.length-1)),block:_i};}return null;},set:function set(t){this._pin=t,this._triggerReflow();}},{key:"_clampScrollPosition",value:function _clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[i(this.direction)]-this._viewDim1));}},{key:"unpin",value:function unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null);}},{key:"_updateLayout",value:function _updateLayout(){}},{key:"_viewDim1",get:function get(){return this._viewportSize[this._sizeDim];}},{key:"_viewDim2",get:function get(){return this._viewportSize[this._secondarySizeDim];}},{key:"_scheduleReflow",value:function _scheduleReflow(){this._pendingReflow=!0;}},{key:"_scheduleLayoutUpdate",value:function _scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow();}},{key:"_triggerReflow",value:function _triggerReflow(){var _this2=this;this._scheduleLayoutUpdate(),Promise.resolve().then(function(){return _this2.reflowIfNeeded();});}},{key:"_reflow",value:function _reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage();}},{key:"_setPositionFromPin",value:function _setPositionFromPin(){if(null!==this.pin){var _t6=this._scrollPosition,_this$pin=this.pin,_i2=_this$pin.index,_s2=_this$pin.block;this._scrollPosition=this._calculateScrollIntoViewPosition({index:_i2,block:_s2||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=_t6-this._scrollPosition;}}},{key:"_calculateScrollIntoViewPosition",value:function _calculateScrollIntoViewPosition(t){var i=t.block,_s3=Math.min(this.items.length,Math.max(0,t.index)),h=this._getItemPosition(_s3)[this._positionDim];var e=h;if("start"!==i){var _t7=this._getItemSize(_s3)[this._sizeDim];if("center"===i)e=h-.5*this._viewDim1+.5*_t7;else{var _s4=h-this._viewDim1+_t7;if("end"===i)e=_s4;else{var _t8=this._scrollPosition;e=Math.abs(_t8-h)<Math.abs(_t8-_s4)?h:_s4;}}}return e+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(e);}},{key:"getScrollIntoViewCoordinates",value:function getScrollIntoViewCoordinates(t){return _defineProperty({},this._positionDim,this._calculateScrollIntoViewPosition(t));}},{key:"_sendUnpinnedMessage",value:function _sendUnpinnedMessage(){this._hostSink({type:"unpinned"});}},{key:"_sendVisibilityChangedMessage",value:function _sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible});}},{key:"_sendStateChangedMessage",value:function _sendStateChangedMessage(){var t=new Map();if(-1!==this._first&&-1!==this._last)for(var _i3=this._first;_i3<=this._last;_i3++)t.set(_i3,this._getItemPosition(_i3));var i={type:"stateChanged",scrollSize:_defineProperty(_defineProperty({},this._sizeDim,this._scrollSize),this._secondarySizeDim,null),range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(i.scrollError=_defineProperty(_defineProperty({},this._positionDim,this._scrollError),this._secondaryPositionDim,0),this._scrollError=0),this._hostSink(i);}},{key:"_num",get:function get(){return-1===this._first||-1===this._last?0:this._last-this._first+1;}},{key:"_checkThresholds",value:function _checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{var _t9=Math.max(0,this._scrollPosition-this._overhang),_i4=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>_t9||this._physicalMax<_i4?this._scheduleReflow():this._updateVisibleIndices({emit:!0});}}},{key:"_updateVisibleIndices",value:function _updateVisibleIndices(t){if(-1===this._first||-1===this._last)return;var i=this._first;for(;i<this._last&&Math.round(this._getItemPosition(i)[this._positionDim]+this._getItemSize(i)[this._sizeDim])<=Math.round(this._scrollPosition);)i++;var _s5=this._last;for(;_s5>this._first&&Math.round(this._getItemPosition(_s5)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)_s5--;i===this._firstVisible&&_s5===this._lastVisible||(this._firstVisible=i,this._lastVisible=_s5,t&&t.emit&&this._sendVisibilityChangedMessage());}}]);}();o=/*#__PURE__*/function(){function o(){_classCallCheck(this,o);this._childSizeCache=new t(),this._marginSizeCache=new t(),this._metricsCache=new Map();}return _createClass(o,[{key:"update",value:function update(t,s){var _this3=this;var r=new Set();Object.keys(t).forEach(function(h){var e=Number(h);_this3._metricsCache.set(e,t[e]),_this3._childSizeCache.set(e,t[e][i(s)]),r.add(e),r.add(e+1);});var _iterator=_createForOfIteratorHelper(r),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _this$_metricsCache$g,_this$_metricsCache$g2;var _t10=_step.value;var _i5=((_this$_metricsCache$g=this._metricsCache.get(_t10))===null||_this$_metricsCache$g===void 0?void 0:_this$_metricsCache$g[h(s)])||0,_r=((_this$_metricsCache$g2=this._metricsCache.get(_t10-1))===null||_this$_metricsCache$g2===void 0?void 0:_this$_metricsCache$g2[e(s)])||0;this._marginSizeCache.set(_t10,n(_i5,_r));}}catch(err){_iterator.e(err);}finally{_iterator.f();}}},{key:"averageChildSize",get:function get(){return this._childSizeCache.averageSize;}},{key:"totalChildSize",get:function get(){return this._childSizeCache.totalSize;}},{key:"averageMarginSize",get:function get(){return this._marginSizeCache.averageSize;}},{key:"totalMarginSize",get:function get(){return this._marginSizeCache.totalSize;}},{key:"getLeadingMarginValue",value:function getLeadingMarginValue(t,i){var _this$_metricsCache$g3;return((_this$_metricsCache$g3=this._metricsCache.get(t))===null||_this$_metricsCache$g3===void 0?void 0:_this$_metricsCache$g3[h(i)])||0;}},{key:"getChildSize",value:function getChildSize(t){return this._childSizeCache.getSize(t);}},{key:"getMarginSize",value:function getMarginSize(t){return this._marginSizeCache.getSize(t);}},{key:"clear",value:function clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear();}}]);}();_export("FlowLayout",l=/*#__PURE__*/function(_s6){function l(){var _this4;_classCallCheck(this,l);_this4=_callSuper(this,l,arguments),_this4._itemSize={width:100,height:100},_this4._physicalItems=new Map(),_this4._newPhysicalItems=new Map(),_this4._metricsCache=new o(),_this4._anchorIdx=null,_this4._anchorPos=null,_this4._stable=!0,_this4._measureChildren=!0,_this4._estimate=!0;return _this4;}_inherits(l,_s6);return _createClass(l,[{key:"measureChildren",get:function get(){return this._measureChildren;}},{key:"updateItemSizes",value:function updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow();}},{key:"_getPhysicalItem",value:function _getPhysicalItem(t){var _this$_newPhysicalIte;return(_this$_newPhysicalIte=this._newPhysicalItems.get(t))!==null&&_this$_newPhysicalIte!==void 0?_this$_newPhysicalIte:this._physicalItems.get(t);}},{key:"_getSize",value:function _getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t);}},{key:"_getAverageSize",value:function _getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim];}},{key:"_estimatePosition",value:function _estimatePosition(t){var i=this._metricsCache;if(-1===this._first||-1===this._last)return i.averageMarginSize+t*(i.averageMarginSize+this._getAverageSize());if(t<this._first){var _s7=this._first-t;return this._getPhysicalItem(this._first).pos-(i.getMarginSize(this._first-1)||i.averageMarginSize)-(_s7*i.averageChildSize+(_s7-1)*i.averageMarginSize);}{var _s8=t-this._last;return this._getPhysicalItem(this._last).pos+(i.getChildSize(this._last)||i.averageChildSize)+(i.getMarginSize(this._last)||i.averageMarginSize)+_s8*(i.averageChildSize+i.averageMarginSize);}}},{key:"_getPosition",value:function _getPosition(t){var _this$_metricsCache$g4;var i=this._getPhysicalItem(t),s=this._metricsCache.averageMarginSize;return 0===t?(_this$_metricsCache$g4=this._metricsCache.getMarginSize(0))!==null&&_this$_metricsCache$g4!==void 0?_this$_metricsCache$g4:s:i?i.pos:this._estimatePosition(t);}},{key:"_calculateAnchor",value:function _calculateAnchor(t,i){return t<=0?0:i>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+i)/2/this._delta)));}},{key:"_getAnchor",value:function _getAnchor(t,i){if(0===this._physicalItems.size)return this._calculateAnchor(t,i);if(this._first<0)return this._calculateAnchor(t,i);if(this._last<0)return this._calculateAnchor(t,i);var s=this._getPhysicalItem(this._first),h=this._getPhysicalItem(this._last),e=s.pos;if(h.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,i);if(e>i)return this._calculateAnchor(t,i);var r=this._firstVisible-1,n=-1/0;for(;n<t;){n=this._getPhysicalItem(++r).pos+this._metricsCache.getChildSize(r);}return r;}},{key:"_getActiveItems",value:function _getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems();}},{key:"_clearItems",value:function _clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;var t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0;}},{key:"_getItems",value:function _getItems(){var _this$_metricsCache$g5,_this$_metricsCache$g6;var t=this._newPhysicalItems;var i,s;if(this._stable=!0,null!==this.pin){var _t11=this.pin.index;this._anchorIdx=_t11,this._anchorPos=this._getPosition(_t11);}if(i=this._scrollPosition-this._overhang,s=this._scrollPosition+this._viewDim1+this._overhang,s<0||i>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(i,s),this._anchorPos=this._getPosition(this._anchorIdx));var h=this._getSize(this._anchorIdx);void 0===h&&(this._stable=!1,h=this._getAverageSize());var e=(_this$_metricsCache$g5=this._metricsCache.getMarginSize(this._anchorIdx))!==null&&_this$_metricsCache$g5!==void 0?_this$_metricsCache$g5:this._metricsCache.averageMarginSize,r=(_this$_metricsCache$g6=this._metricsCache.getMarginSize(this._anchorIdx+1))!==null&&_this$_metricsCache$g6!==void 0?_this$_metricsCache$g6:this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=e),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-r-h);var n=0;for(this._anchorPos+h+r<i&&(n=i-(this._anchorPos+h+r)),this._anchorPos-e>s&&(n=s-(this._anchorPos-e)),n&&(this._scrollPosition-=n,i-=n,s-=n,this._scrollError+=n),t.set(this._anchorIdx,{pos:this._anchorPos,size:h}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-e,this._physicalMax=this._anchorPos+h+r;this._physicalMin>i&&this._first>0;){var _i6=this._getSize(--this._first);void 0===_i6&&(this._stable=!1,_i6=this._getAverageSize());var _s9=this._metricsCache.getMarginSize(this._first);void 0===_s9&&(this._stable=!1,_s9=this._metricsCache.averageMarginSize),this._physicalMin-=_i6;var _h=this._physicalMin;if(t.set(this._first,{pos:_h,size:_i6}),this._physicalMin-=_s9,!1===this._stable&&!1===this._estimate)break;}for(;this._physicalMax<s&&this._last<this.items.length-1;){var _i7=this._getSize(++this._last);void 0===_i7&&(this._stable=!1,_i7=this._getAverageSize());var _s10=this._metricsCache.getMarginSize(this._last);void 0===_s10&&(this._stable=!1,_s10=this._metricsCache.averageMarginSize);var _h2=this._physicalMax;if(t.set(this._last,{pos:_h2,size:_i7}),this._physicalMax+=_i7+_s10,!this._stable&&!this._estimate)break;}var o=this._calculateError();o&&(this._physicalMin-=o,this._physicalMax-=o,this._anchorPos-=o,this._scrollPosition-=o,t.forEach(function(t){return t.pos-=o;}),this._scrollError+=o),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t);}},{key:"_calculateError",value:function _calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0;}},{key:"_reflow",value:function _reflow(){var t=this._first,i=this._last;_superPropGet(l,"_reflow",this,3)([]),(-1===this._first&&-1==this._last||this._first===t&&this._last===i)&&this._resetReflowState();}},{key:"_resetReflowState",value:function _resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0;}},{key:"_updateScrollSize",value:function _updateScrollSize(){var t=this._metricsCache.averageMarginSize;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t);}},{key:"_delta",get:function get(){var t=this._metricsCache.averageMarginSize;return this._getAverageSize()+t;}},{key:"_getItemPosition",value:function _getItemPosition(t){var _this$_metricsCache$g7;return _defineProperty(_defineProperty(_defineProperty({},this._positionDim,this._getPosition(t)),this._secondaryPositionDim,0),r(this.direction),-((_this$_metricsCache$g7=this._metricsCache.getLeadingMarginValue(t,this.direction))!==null&&_this$_metricsCache$g7!==void 0?_this$_metricsCache$g7:this._metricsCache.averageMarginSize));}},{key:"_getItemSize",value:function _getItemSize(t){return _defineProperty(_defineProperty({},this._sizeDim,this._getSize(t)||this._getAverageSize()),this._secondarySizeDim,this._itemSize[this._secondarySizeDim]);}},{key:"_viewDim2Changed",value:function _viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow();}}]);}(s));}};});
|
14
|
+
//# sourceMappingURL=flow-d0fa8803.cjs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"flow-d0fa8803.cjs.js","sources":["../../../node_modules/@lit-labs/virtualizer/layouts/shared/BaseLayout.js","../../../node_modules/@lit-labs/virtualizer/layouts/flow.js","../../../node_modules/@lit-labs/virtualizer/layouts/shared/SizeCache.js"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport function dim1(direction) {\n return direction === 'horizontal' ? 'width' : 'height';\n}\nexport function dim2(direction) {\n return direction === 'horizontal' ? 'height' : 'width';\n}\nexport function pos1(direction) {\n return direction === 'horizontal' ? 'left' : 'top';\n}\nexport function pos2(direction) {\n return direction === 'horizontal' ? 'top' : 'left';\n}\nexport class BaseLayout {\n _getDefaultConfig() {\n return {\n direction: 'vertical',\n };\n }\n constructor(hostSink, config) {\n /**\n * The last set viewport scroll position.\n */\n this._latestCoords = { left: 0, top: 0 };\n /**\n * Scrolling direction.\n */\n this._direction = null;\n /**\n * Dimensions of the viewport.\n */\n this._viewportSize = { width: 0, height: 0 };\n this.totalScrollSize = { width: 0, height: 0 };\n this.offsetWithinScroller = { left: 0, top: 0 };\n /**\n * Flag for debouncing asynchronous reflow requests.\n */\n this._pendingReflow = false;\n this._pendingLayoutUpdate = false;\n this._pin = null;\n /**\n * The index of the first item intersecting the viewport.\n */\n this._firstVisible = 0;\n /**\n * The index of the last item intersecting the viewport.\n */\n this._lastVisible = 0;\n /**\n * Pixel offset in the scroll direction of the first child.\n */\n this._physicalMin = 0;\n /**\n * Pixel offset in the scroll direction of the last child.\n */\n this._physicalMax = 0;\n /**\n * Index of the first child.\n */\n this._first = -1;\n /**\n * Index of the last child.\n */\n this._last = -1;\n /**\n * Length in the scrolling direction.\n */\n this._sizeDim = 'height';\n /**\n * Length in the non-scrolling direction.\n */\n this._secondarySizeDim = 'width';\n /**\n * Position in the scrolling direction.\n */\n this._positionDim = 'top';\n /**\n * Position in the non-scrolling direction.\n */\n this._secondaryPositionDim = 'left';\n /**\n * Current scroll offset in pixels.\n */\n this._scrollPosition = 0;\n /**\n * Difference between current scroll offset and scroll offset calculated due\n * to a reflow.\n */\n this._scrollError = 0;\n /**\n * Total number of items that could possibly be displayed. Used to help\n * calculate the scroll size.\n */\n this._items = [];\n /**\n * The total (estimated) length of all items in the scrolling direction.\n */\n this._scrollSize = 1;\n /**\n * Number of pixels beyond the viewport to still include\n * in the active range of items.\n */\n // TODO (graynorton): Probably want to make this something we calculate based\n // on viewport size, item size, other factors, possibly still with a dial of some kind\n this._overhang = 1000;\n this._hostSink = hostSink;\n // Delay setting config so that subclasses do setup work first\n Promise.resolve().then(() => (this.config = config || this._getDefaultConfig()));\n }\n set config(config) {\n Object.assign(this, Object.assign({}, this._getDefaultConfig(), config));\n }\n get config() {\n return {\n direction: this.direction,\n };\n }\n /**\n * Maximum index of children + 1, to help estimate total height of the scroll\n * space.\n */\n get items() {\n return this._items;\n }\n set items(items) {\n this._setItems(items);\n }\n _setItems(items) {\n if (items !== this._items) {\n this._items = items;\n this._scheduleReflow();\n }\n }\n /**\n * Primary scrolling direction.\n */\n get direction() {\n return this._direction;\n }\n set direction(dir) {\n // Force it to be either horizontal or vertical.\n dir = dir === 'horizontal' ? dir : 'vertical';\n if (dir !== this._direction) {\n this._direction = dir;\n this._sizeDim = dir === 'horizontal' ? 'width' : 'height';\n this._secondarySizeDim = dir === 'horizontal' ? 'height' : 'width';\n this._positionDim = dir === 'horizontal' ? 'left' : 'top';\n this._secondaryPositionDim = dir === 'horizontal' ? 'top' : 'left';\n this._triggerReflow();\n }\n }\n /**\n * Height and width of the viewport.\n */\n get viewportSize() {\n return this._viewportSize;\n }\n set viewportSize(dims) {\n const { _viewDim1, _viewDim2 } = this;\n Object.assign(this._viewportSize, dims);\n if (_viewDim2 !== this._viewDim2) {\n // this._viewDim2Changed();\n this._scheduleLayoutUpdate();\n }\n else if (_viewDim1 !== this._viewDim1) {\n this._checkThresholds();\n }\n }\n /**\n * Scroll offset of the viewport.\n */\n get viewportScroll() {\n return this._latestCoords;\n }\n set viewportScroll(coords) {\n Object.assign(this._latestCoords, coords);\n const oldPos = this._scrollPosition;\n this._scrollPosition = this._latestCoords[this._positionDim];\n const change = Math.abs(oldPos - this._scrollPosition);\n if (change >= 1) {\n this._checkThresholds();\n }\n }\n /**\n * Perform a reflow if one has been scheduled.\n */\n reflowIfNeeded(force = false) {\n if (force || this._pendingReflow) {\n this._pendingReflow = false;\n this._reflow();\n }\n }\n set pin(options) {\n this._pin = options;\n this._triggerReflow();\n }\n get pin() {\n if (this._pin !== null) {\n const { index, block } = this._pin;\n return {\n index: Math.max(0, Math.min(index, this.items.length - 1)),\n block,\n };\n }\n return null;\n }\n _clampScrollPosition(val) {\n return Math.max(-this.offsetWithinScroller[this._positionDim], Math.min(val, this.totalScrollSize[dim1(this.direction)] - this._viewDim1));\n }\n unpin() {\n if (this._pin !== null) {\n this._sendUnpinnedMessage();\n this._pin = null;\n }\n }\n _updateLayout() {\n // Override\n }\n // protected _viewDim2Changed(): void {\n // this._scheduleLayoutUpdate();\n // }\n /**\n * The height or width of the viewport, whichever corresponds to the scrolling direction.\n */\n get _viewDim1() {\n return this._viewportSize[this._sizeDim];\n }\n /**\n * The height or width of the viewport, whichever does NOT correspond to the scrolling direction.\n */\n get _viewDim2() {\n return this._viewportSize[this._secondarySizeDim];\n }\n _scheduleReflow() {\n this._pendingReflow = true;\n }\n _scheduleLayoutUpdate() {\n this._pendingLayoutUpdate = true;\n this._scheduleReflow();\n }\n // For triggering a reflow based on incoming changes to\n // the layout config.\n _triggerReflow() {\n this._scheduleLayoutUpdate();\n // TODO graynorton@: reflowIfNeeded() isn't really supposed\n // to be called internally. Address in larger cleanup\n // of virtualizer / layout interaction pattern.\n // this.reflowIfNeeded(true);\n Promise.resolve().then(() => this.reflowIfNeeded());\n }\n _reflow() {\n if (this._pendingLayoutUpdate) {\n this._updateLayout();\n this._pendingLayoutUpdate = false;\n }\n this._updateScrollSize();\n this._setPositionFromPin();\n this._getActiveItems();\n this._updateVisibleIndices();\n this._sendStateChangedMessage();\n }\n /**\n * If we are supposed to be pinned to a particular\n * item or set of coordinates, we set `_scrollPosition`\n * accordingly and adjust `_scrollError` as needed\n * so that the virtualizer can keep the scroll\n * position in the DOM in sync\n */\n _setPositionFromPin() {\n if (this.pin !== null) {\n const lastScrollPosition = this._scrollPosition;\n const { index, block } = this.pin;\n this._scrollPosition =\n this._calculateScrollIntoViewPosition({\n index,\n block: block || 'start',\n }) - this.offsetWithinScroller[this._positionDim];\n this._scrollError = lastScrollPosition - this._scrollPosition;\n }\n }\n /**\n * Calculate the coordinates to scroll to, given\n * a request to scroll to the element at a specific\n * index.\n *\n * Supports the same positioning options (`start`,\n * `center`, `end`, `nearest`) as the standard\n * `Element.scrollIntoView()` method, but currently\n * only considers the provided value in the `block`\n * dimension, since we don't yet have any layouts\n * that support virtualization in two dimensions.\n */\n _calculateScrollIntoViewPosition(options) {\n const { block } = options;\n const index = Math.min(this.items.length, Math.max(0, options.index));\n const itemStartPosition = this._getItemPosition(index)[this._positionDim];\n let scrollPosition = itemStartPosition;\n if (block !== 'start') {\n const itemSize = this._getItemSize(index)[this._sizeDim];\n if (block === 'center') {\n scrollPosition =\n itemStartPosition - 0.5 * this._viewDim1 + 0.5 * itemSize;\n }\n else {\n const itemEndPosition = itemStartPosition - this._viewDim1 + itemSize;\n if (block === 'end') {\n scrollPosition = itemEndPosition;\n }\n else {\n // block === 'nearest'\n const currentScrollPosition = this._scrollPosition;\n scrollPosition =\n Math.abs(currentScrollPosition - itemStartPosition) <\n Math.abs(currentScrollPosition - itemEndPosition)\n ? itemStartPosition\n : itemEndPosition;\n }\n }\n }\n scrollPosition += this.offsetWithinScroller[this._positionDim];\n return this._clampScrollPosition(scrollPosition);\n }\n getScrollIntoViewCoordinates(options) {\n return {\n [this._positionDim]: this._calculateScrollIntoViewPosition(options),\n };\n }\n _sendUnpinnedMessage() {\n this._hostSink({\n type: 'unpinned',\n });\n }\n _sendVisibilityChangedMessage() {\n this._hostSink({\n type: 'visibilityChanged',\n firstVisible: this._firstVisible,\n lastVisible: this._lastVisible,\n });\n }\n _sendStateChangedMessage() {\n const childPositions = new Map();\n if (this._first !== -1 && this._last !== -1) {\n for (let idx = this._first; idx <= this._last; idx++) {\n childPositions.set(idx, this._getItemPosition(idx));\n }\n }\n const message = {\n type: 'stateChanged',\n scrollSize: {\n [this._sizeDim]: this._scrollSize,\n [this._secondarySizeDim]: null,\n },\n range: {\n first: this._first,\n last: this._last,\n firstVisible: this._firstVisible,\n lastVisible: this._lastVisible,\n },\n childPositions,\n };\n if (this._scrollError) {\n message.scrollError = {\n [this._positionDim]: this._scrollError,\n [this._secondaryPositionDim]: 0,\n };\n this._scrollError = 0;\n }\n this._hostSink(message);\n }\n /**\n * Number of items to display.\n */\n get _num() {\n if (this._first === -1 || this._last === -1) {\n return 0;\n }\n return this._last - this._first + 1;\n }\n _checkThresholds() {\n if ((this._viewDim1 === 0 && this._num > 0) || this._pin !== null) {\n this._scheduleReflow();\n }\n else {\n const min = Math.max(0, this._scrollPosition - this._overhang);\n const max = Math.min(this._scrollSize, this._scrollPosition + this._viewDim1 + this._overhang);\n if (this._physicalMin > min || this._physicalMax < max) {\n this._scheduleReflow();\n }\n else {\n this._updateVisibleIndices({ emit: true });\n }\n }\n }\n /**\n * Find the indices of the first and last items to intersect the viewport.\n * Emit a visibleindiceschange event when either index changes.\n */\n _updateVisibleIndices(options) {\n if (this._first === -1 || this._last === -1)\n return;\n let firstVisible = this._first;\n while (firstVisible < this._last &&\n Math.round(this._getItemPosition(firstVisible)[this._positionDim] +\n this._getItemSize(firstVisible)[this._sizeDim]) <= Math.round(this._scrollPosition)) {\n firstVisible++;\n }\n let lastVisible = this._last;\n while (lastVisible > this._first &&\n Math.round(this._getItemPosition(lastVisible)[this._positionDim]) >=\n Math.round(this._scrollPosition + this._viewDim1)) {\n lastVisible--;\n }\n if (firstVisible !== this._firstVisible ||\n lastVisible !== this._lastVisible) {\n this._firstVisible = firstVisible;\n this._lastVisible = lastVisible;\n if (options && options.emit) {\n this._sendVisibilityChangedMessage();\n }\n }\n }\n}\n//# sourceMappingURL=BaseLayout.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nimport { SizeCache } from './shared/SizeCache.js';\nimport { BaseLayout, dim1 } from './shared/BaseLayout.js';\nexport const flow = (config) => Object.assign({\n type: FlowLayout,\n}, config);\nfunction leadingMargin(direction) {\n return direction === 'horizontal' ? 'marginLeft' : 'marginTop';\n}\nfunction trailingMargin(direction) {\n return direction === 'horizontal' ? 'marginRight' : 'marginBottom';\n}\nfunction offset(direction) {\n return direction === 'horizontal' ? 'xOffset' : 'yOffset';\n}\nfunction collapseMargins(a, b) {\n const m = [a, b].sort();\n return m[1] <= 0 ? Math.min(...m) : m[0] >= 0 ? Math.max(...m) : m[0] + m[1];\n}\nclass MetricsCache {\n constructor() {\n this._childSizeCache = new SizeCache();\n this._marginSizeCache = new SizeCache();\n this._metricsCache = new Map();\n }\n update(metrics, direction) {\n const marginsToUpdate = new Set();\n Object.keys(metrics).forEach((key) => {\n const k = Number(key);\n this._metricsCache.set(k, metrics[k]);\n this._childSizeCache.set(k, metrics[k][dim1(direction)]);\n marginsToUpdate.add(k);\n marginsToUpdate.add(k + 1);\n });\n for (const k of marginsToUpdate) {\n const a = this._metricsCache.get(k)?.[leadingMargin(direction)] || 0;\n const b = this._metricsCache.get(k - 1)?.[trailingMargin(direction)] || 0;\n this._marginSizeCache.set(k, collapseMargins(a, b));\n }\n }\n get averageChildSize() {\n return this._childSizeCache.averageSize;\n }\n get totalChildSize() {\n return this._childSizeCache.totalSize;\n }\n get averageMarginSize() {\n return this._marginSizeCache.averageSize;\n }\n get totalMarginSize() {\n return this._marginSizeCache.totalSize;\n }\n getLeadingMarginValue(index, direction) {\n return this._metricsCache.get(index)?.[leadingMargin(direction)] || 0;\n }\n getChildSize(index) {\n return this._childSizeCache.getSize(index);\n }\n getMarginSize(index) {\n return this._marginSizeCache.getSize(index);\n }\n clear() {\n this._childSizeCache.clear();\n this._marginSizeCache.clear();\n this._metricsCache.clear();\n }\n}\nexport class FlowLayout extends BaseLayout {\n constructor() {\n super(...arguments);\n /**\n * Initial estimate of item size\n */\n this._itemSize = { width: 100, height: 100 };\n /**\n * Indices of children mapped to their (position and length) in the scrolling\n * direction. Used to keep track of children that are in range.\n */\n this._physicalItems = new Map();\n /**\n * Used in tandem with _physicalItems to track children in range across\n * reflows.\n */\n this._newPhysicalItems = new Map();\n /**\n * Width and height of children by their index.\n */\n this._metricsCache = new MetricsCache();\n /**\n * anchorIdx is the anchor around which we reflow. It is designed to allow\n * jumping to any point of the scroll size. We choose it once and stick with\n * it until stable. _first and _last are deduced around it.\n */\n this._anchorIdx = null;\n /**\n * Position in the scrolling direction of the anchor child.\n */\n this._anchorPos = null;\n /**\n * Whether all children in range were in range during the previous reflow.\n */\n this._stable = true;\n this._measureChildren = true;\n this._estimate = true;\n }\n // protected _defaultConfig: BaseLayoutConfig = Object.assign({}, super._defaultConfig, {\n // })\n // constructor(config: Layout1dConfig) {\n // super(config);\n // }\n get measureChildren() {\n return this._measureChildren;\n }\n /**\n * Determine the average size of all children represented in the sizes\n * argument.\n */\n updateItemSizes(sizes) {\n this._metricsCache.update(sizes, this.direction);\n // if (this._nMeasured) {\n // this._updateItemSize();\n this._scheduleReflow();\n // }\n }\n /**\n * Set the average item size based on the total length and number of children\n * in range.\n */\n // _updateItemSize() {\n // // Keep integer values.\n // this._itemSize[this._sizeDim] = this._metricsCache.averageChildSize;\n // }\n _getPhysicalItem(idx) {\n return this._newPhysicalItems.get(idx) ?? this._physicalItems.get(idx);\n }\n _getSize(idx) {\n const item = this._getPhysicalItem(idx);\n return item && this._metricsCache.getChildSize(idx);\n }\n _getAverageSize() {\n return this._metricsCache.averageChildSize || this._itemSize[this._sizeDim];\n }\n _estimatePosition(idx) {\n const c = this._metricsCache;\n if (this._first === -1 || this._last === -1) {\n return (c.averageMarginSize +\n idx * (c.averageMarginSize + this._getAverageSize()));\n }\n else {\n if (idx < this._first) {\n const delta = this._first - idx;\n const refItem = this._getPhysicalItem(this._first);\n return (refItem.pos -\n (c.getMarginSize(this._first - 1) || c.averageMarginSize) -\n (delta * c.averageChildSize + (delta - 1) * c.averageMarginSize));\n }\n else {\n const delta = idx - this._last;\n const refItem = this._getPhysicalItem(this._last);\n return (refItem.pos +\n (c.getChildSize(this._last) || c.averageChildSize) +\n (c.getMarginSize(this._last) || c.averageMarginSize) +\n delta * (c.averageChildSize + c.averageMarginSize));\n }\n }\n }\n /**\n * Returns the position in the scrolling direction of the item at idx.\n * Estimates it if the item at idx is not in the DOM.\n */\n _getPosition(idx) {\n const item = this._getPhysicalItem(idx);\n const { averageMarginSize } = this._metricsCache;\n return idx === 0\n ? this._metricsCache.getMarginSize(0) ?? averageMarginSize\n : item\n ? item.pos\n : this._estimatePosition(idx);\n }\n _calculateAnchor(lower, upper) {\n if (lower <= 0) {\n return 0;\n }\n if (upper > this._scrollSize - this._viewDim1) {\n return this.items.length - 1;\n }\n return Math.max(0, Math.min(this.items.length - 1, Math.floor((lower + upper) / 2 / this._delta)));\n }\n _getAnchor(lower, upper) {\n if (this._physicalItems.size === 0) {\n return this._calculateAnchor(lower, upper);\n }\n if (this._first < 0) {\n return this._calculateAnchor(lower, upper);\n }\n if (this._last < 0) {\n return this._calculateAnchor(lower, upper);\n }\n const firstItem = this._getPhysicalItem(this._first), lastItem = this._getPhysicalItem(this._last), firstMin = firstItem.pos, lastMin = lastItem.pos, lastMax = lastMin + this._metricsCache.getChildSize(this._last);\n if (lastMax < lower) {\n // Window is entirely past physical items, calculate new anchor\n return this._calculateAnchor(lower, upper);\n }\n if (firstMin > upper) {\n // Window is entirely before physical items, calculate new anchor\n return this._calculateAnchor(lower, upper);\n }\n // Window contains a physical item\n // Find one, starting with the one that was previously first visible\n let candidateIdx = this._firstVisible - 1;\n let cMax = -Infinity;\n while (cMax < lower) {\n const candidate = this._getPhysicalItem(++candidateIdx);\n cMax = candidate.pos + this._metricsCache.getChildSize(candidateIdx);\n }\n return candidateIdx;\n }\n /**\n * Updates _first and _last based on items that should be in the current\n * viewed range.\n */\n _getActiveItems() {\n if (this._viewDim1 === 0 || this.items.length === 0) {\n this._clearItems();\n }\n else {\n this._getItems();\n }\n }\n /**\n * Sets the range to empty.\n */\n _clearItems() {\n this._first = -1;\n this._last = -1;\n this._physicalMin = 0;\n this._physicalMax = 0;\n const items = this._newPhysicalItems;\n this._newPhysicalItems = this._physicalItems;\n this._newPhysicalItems.clear();\n this._physicalItems = items;\n this._stable = true;\n }\n /*\n * Updates _first and _last based on items that should be in the given range.\n */\n _getItems() {\n const items = this._newPhysicalItems;\n this._stable = true;\n let lower, upper;\n // The anchorIdx is the anchor around which we reflow. It is designed to\n // allow jumping to any point of the scroll size. We choose it once and\n // stick with it until stable. first and last are deduced around it.\n // If we have a pinned item, we anchor on it\n if (this.pin !== null) {\n const { index } = this.pin;\n this._anchorIdx = index;\n this._anchorPos = this._getPosition(index);\n }\n // Determine the lower and upper bounds of the region to be\n // rendered, relative to the viewport\n lower = this._scrollPosition - this._overhang; //leadingOverhang;\n upper = this._scrollPosition + this._viewDim1 + this._overhang; // trailingOverhang;\n if (upper < 0 || lower > this._scrollSize) {\n this._clearItems();\n return;\n }\n // If we are scrolling to a specific index or if we are doing another\n // pass to stabilize a previously started reflow, we will already\n // have an anchor. If not, establish an anchor now.\n if (this._anchorIdx === null || this._anchorPos === null) {\n this._anchorIdx = this._getAnchor(lower, upper);\n this._anchorPos = this._getPosition(this._anchorIdx);\n }\n let anchorSize = this._getSize(this._anchorIdx);\n if (anchorSize === undefined) {\n this._stable = false;\n anchorSize = this._getAverageSize();\n }\n const anchorLeadingMargin = this._metricsCache.getMarginSize(this._anchorIdx) ??\n this._metricsCache.averageMarginSize;\n const anchorTrailingMargin = this._metricsCache.getMarginSize(this._anchorIdx + 1) ??\n this._metricsCache.averageMarginSize;\n if (this._anchorIdx === 0) {\n this._anchorPos = anchorLeadingMargin;\n }\n if (this._anchorIdx === this.items.length - 1) {\n this._anchorPos = this._scrollSize - anchorTrailingMargin - anchorSize;\n }\n // Anchor might be outside bounds, so prefer correcting the error and keep\n // that anchorIdx.\n let anchorErr = 0;\n if (this._anchorPos + anchorSize + anchorTrailingMargin < lower) {\n anchorErr = lower - (this._anchorPos + anchorSize + anchorTrailingMargin);\n }\n if (this._anchorPos - anchorLeadingMargin > upper) {\n anchorErr = upper - (this._anchorPos - anchorLeadingMargin);\n }\n if (anchorErr) {\n this._scrollPosition -= anchorErr;\n lower -= anchorErr;\n upper -= anchorErr;\n this._scrollError += anchorErr;\n }\n items.set(this._anchorIdx, { pos: this._anchorPos, size: anchorSize });\n this._first = this._last = this._anchorIdx;\n this._physicalMin = this._anchorPos - anchorLeadingMargin;\n this._physicalMax = this._anchorPos + anchorSize + anchorTrailingMargin;\n while (this._physicalMin > lower && this._first > 0) {\n let size = this._getSize(--this._first);\n if (size === undefined) {\n this._stable = false;\n size = this._getAverageSize();\n }\n let margin = this._metricsCache.getMarginSize(this._first);\n if (margin === undefined) {\n this._stable = false;\n margin = this._metricsCache.averageMarginSize;\n }\n this._physicalMin -= size;\n const pos = this._physicalMin;\n items.set(this._first, { pos, size });\n this._physicalMin -= margin;\n if (this._stable === false && this._estimate === false) {\n break;\n }\n }\n while (this._physicalMax < upper && this._last < this.items.length - 1) {\n let size = this._getSize(++this._last);\n if (size === undefined) {\n this._stable = false;\n size = this._getAverageSize();\n }\n let margin = this._metricsCache.getMarginSize(this._last);\n if (margin === undefined) {\n this._stable = false;\n margin = this._metricsCache.averageMarginSize;\n }\n const pos = this._physicalMax;\n items.set(this._last, { pos, size });\n this._physicalMax += size + margin;\n if (!this._stable && !this._estimate) {\n break;\n }\n }\n // This handles the cases where we were relying on estimated sizes.\n const extentErr = this._calculateError();\n if (extentErr) {\n this._physicalMin -= extentErr;\n this._physicalMax -= extentErr;\n this._anchorPos -= extentErr;\n this._scrollPosition -= extentErr;\n items.forEach((item) => (item.pos -= extentErr));\n this._scrollError += extentErr;\n }\n if (this._stable) {\n this._newPhysicalItems = this._physicalItems;\n this._newPhysicalItems.clear();\n this._physicalItems = items;\n }\n }\n _calculateError() {\n if (this._first === 0) {\n return this._physicalMin;\n }\n else if (this._physicalMin <= 0) {\n return this._physicalMin - this._first * this._delta;\n }\n else if (this._last === this.items.length - 1) {\n return this._physicalMax - this._scrollSize;\n }\n else if (this._physicalMax >= this._scrollSize) {\n return (this._physicalMax -\n this._scrollSize +\n (this.items.length - 1 - this._last) * this._delta);\n }\n return 0;\n }\n _reflow() {\n const { _first, _last } = this;\n super._reflow();\n if ((this._first === -1 && this._last == -1) ||\n (this._first === _first && this._last === _last)) {\n this._resetReflowState();\n }\n }\n _resetReflowState() {\n this._anchorIdx = null;\n this._anchorPos = null;\n this._stable = true;\n }\n _updateScrollSize() {\n const { averageMarginSize } = this._metricsCache;\n this._scrollSize = Math.max(1, this.items.length * (averageMarginSize + this._getAverageSize()) +\n averageMarginSize);\n }\n /**\n * Returns the average size (precise or estimated) of an item in the scrolling direction,\n * including any surrounding space.\n */\n get _delta() {\n const { averageMarginSize } = this._metricsCache;\n return this._getAverageSize() + averageMarginSize;\n }\n /**\n * Returns the top and left positioning of the item at idx.\n */\n _getItemPosition(idx) {\n return {\n [this._positionDim]: this._getPosition(idx),\n [this._secondaryPositionDim]: 0,\n [offset(this.direction)]: -(this._metricsCache.getLeadingMarginValue(idx, this.direction) ??\n this._metricsCache.averageMarginSize),\n };\n }\n /**\n * Returns the height and width of the item at idx.\n */\n _getItemSize(idx) {\n return {\n [this._sizeDim]: this._getSize(idx) || this._getAverageSize(),\n [this._secondarySizeDim]: this._itemSize[this._secondarySizeDim],\n };\n }\n _viewDim2Changed() {\n this._metricsCache.clear();\n this._scheduleReflow();\n }\n}\n//# sourceMappingURL=flow.js.map","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nexport class SizeCache {\n constructor(config) {\n this._map = new Map();\n this._roundAverageSize = false;\n this.totalSize = 0;\n if (config?.roundAverageSize === true) {\n this._roundAverageSize = true;\n }\n }\n set(index, value) {\n const prev = this._map.get(index) || 0;\n this._map.set(index, value);\n this.totalSize += value - prev;\n }\n get averageSize() {\n if (this._map.size > 0) {\n const average = this.totalSize / this._map.size;\n return this._roundAverageSize ? Math.round(average) : average;\n }\n return 0;\n }\n getSize(index) {\n return this._map.get(index);\n }\n clear() {\n this._map.clear();\n this.totalSize = 0;\n }\n}\n//# sourceMappingURL=SizeCache.js.map"],"names":["dim1","direction","leadingMargin","trailingMargin","offset","collapseMargins","a","b","m","sort","Math","min","max","setters","execute","SizeCache","t","config","this","_map","Map","_roundAverageSize","totalSize","roundAverageSize","_createClass","key","value","set","index","prev","get","averageSize","size","average","round","getSize","clear","BaseLayout","s","hostSink","_latestCoords","left","top","_direction","_viewportSize","width","height","totalScrollSize","offsetWithinScroller","_pendingReflow","_pendingLayoutUpdate","_pin","_firstVisible","_lastVisible","_physicalMin","_physicalMax","_first","_last","_sizeDim","_secondarySizeDim","_positionDim","_secondaryPositionDim","_scrollPosition","_scrollError","_items","_scrollSize","_overhang","_hostSink","Promise","resolve","then","_getDefaultConfig","Object","assign","items","_setItems","_scheduleReflow","dir","_triggerReflow","dims","_viewDim1","_viewDim2","_scheduleLayoutUpdate","_checkThresholds","coords","oldPos","abs","reflowIfNeeded","force","_reflow","_this$_pin","block","length","options","_clampScrollPosition","val","unpin","_sendUnpinnedMessage","_updateLayout","_updateScrollSize","_setPositionFromPin","_getActiveItems","_updateVisibleIndices","_sendStateChangedMessage","pin","lastScrollPosition","_calculateScrollIntoViewPosition","itemStartPosition","_getItemPosition","scrollPosition","itemSize","_getItemSize","itemEndPosition","currentScrollPosition","getScrollIntoViewCoordinates","_defineProperty","type","_sendVisibilityChangedMessage","firstVisible","lastVisible","childPositions","idx","message","scrollSize","range","first","last","scrollError","_num","emit","MetricsCache","o","constructor","_childSizeCache","_marginSizeCache","_metricsCache","update","metrics","marginsToUpdate","Set","keys","forEach","k","Number","add","_iterator","_createForOfIteratorHelper","_step","n","done","_this$_metricsCache$g","_this$_metricsCache$g2","err","e","f","totalChildSize","averageMarginSize","totalMarginSize","getLeadingMarginValue","getChildSize","getMarginSize","_export","FlowLayout","l","super","arguments","_itemSize","_physicalItems","_newPhysicalItems","_anchorIdx","_anchorPos","_stable","_measureChildren","_estimate","_this4","_inherits","_s6","updateItemSizes","sizes","_getPhysicalItem","_this$_newPhysicalIte","_getSize","_getAverageSize","averageChildSize","_estimatePosition","c","delta","pos","_getPosition","item","_calculateAnchor","lower","upper","floor","_delta","_getAnchor","firstItem","lastItem","firstMin","candidateIdx","cMax","Infinity","_clearItems","_getItems","anchorSize","undefined","anchorLeadingMargin","anchorTrailingMargin","anchorErr","margin","extentErr","_calculateError","_resetReflowState","_viewDim2Changed"],"mappings":";;;;GAKO,QAASA,CAAAA,CAAAA,CAAKC,GACjB,MAAqB,YAAA,GAAdA,EAA6B,OAAU,CAAA,QAClD;;;;ACGA,GAAA,QAASC,CAAAA,CAAcD,CAAAA,CAAAA,CAAAA,CACnB,MAAqB,YAAA,GAAdA,CAA6B,CAAA,YAAA,CAAe,WACvD,EACA,QAASE,CAAAA,CAAAA,CAAeF,CACpB,CAAA,CAAA,MAAqB,eAAdA,CAA6B,CAAA,aAAA,CAAgB,cACxD,EACA,QAASG,CAAAA,CAAAA,CAAOH,CACZ,CAAA,CAAA,MAAqB,YAAdA,GAAAA,CAAAA,CAA6B,SAAY,CAAA,SACpD,EACA,QAASI,CAAAA,CA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