@midas-ds/components 11.1.0 → 11.2.0
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/CHANGELOG.md +25 -0
- package/{CheckboxGroup-oosHSGAt.js → CheckboxGroup-DvrN1oyw.js} +1 -1
- package/{ColorSchemeSwitch-Cnyb9EKC.js → ColorSchemeSwitch-PiEHptw1.js} +1 -1
- package/{ComboBox-CQ49PhNd.cjs → ComboBox-D_jh7TKo.cjs} +1 -1
- package/{ComboBox-D4MsSPBu.js → ComboBox-DfJ_aJrf.js} +10 -10
- package/{DateField-COs1-CkQ.js → DateField-DKCbEonm.js} +2 -2
- package/{DateInputDivider-B3oE1_tB.js → DateInputDivider-BmvqW1Hk.js} +2 -2
- package/{DateRangePicker-CvEycxmX.js → DateRangePicker-B5vx9onl.js} +183 -196
- package/DateRangePicker-DkIAEIIj.cjs +6 -0
- package/Dialog-CxHiZorC.cjs +1 -0
- package/{Dialog-DKHo0W9B.js → Dialog-D5c_dUnB.js} +3 -3
- package/Dialog-DuGcBeNN.js +212 -0
- package/{Dropdown-D6WCi_Ll.js → Dropdown-Cpc2EszJ.js} +1 -1
- package/{FocusScope-BCsrRPqD.js → FocusScope-DMsfA3bj.js} +1 -1
- package/{Label-DA6FZwy0.js → Label-endv1fkJ.js} +2 -2
- package/Layout-D0E1fOgZ.cjs +16 -0
- package/Layout-DtyhUz-G.js +498 -0
- package/{ListBox-CsxDGpCA.js → ListBox-Djy7244v.js} +5 -5
- package/{ListBoxButton-BsuHFd_O.cjs → ListBoxButton-CIqNRR3y.cjs} +1 -1
- package/{ListBoxButton-DawRfuny.js → ListBoxButton-sqirI6I4.js} +1 -1
- package/{ListBoxSection-C-Rz358T.cjs → ListBoxSection-BYJccE4T.cjs} +1 -1
- package/{ListBoxSection-Cc2cx0_S.js → ListBoxSection-Cicbu8pS.js} +375 -375
- package/{ListKeyboardDelegate-C-sPNj0f.js → ListKeyboardDelegate-CHki611g.js} +1 -1
- package/{Popover-DHoXfBp2.js → Popover-Tniqbaes.js} +1 -1
- package/{ProgressBar-C0IBfi5I.js → ProgressBar-DTn23Zkr.js} +1 -1
- package/{Radio-B6N9dCtB.js → Radio-CCN3o3s-.js} +2 -2
- package/{Select-DMVj2lrG.js → Select-MwvnbChP.js} +8 -8
- package/{Select-DiCEyap1.cjs → Select-lhIwwJL7.cjs} +1 -1
- package/{SelectionManager-BubxiIKu.js → SelectionManager-BKrZ_mMO.js} +1 -1
- package/{Separator-CEZ5y7tZ.js → Separator-DvvVAypT.js} +2 -2
- package/{TabList-BkSWzbDG.cjs → TabList-CWMlbijV.cjs} +1 -1
- package/{TabList-QApx8qRC.js → TabList-VpTv_Xff.js} +4 -4
- package/{Table-B5Aine4F.js → Table-DGTwyh7U.js} +4 -4
- package/{Tag-Byva_Xuy.js → Tag-rI-NhuT0.js} +7 -7
- package/{TextArea-eK7Jx3qs.js → TextArea-CrEALC58.js} +1 -1
- package/{ToggleButtonGroup-HjvaTYD4.js → ToggleButtonGroup-98z8Dw8-.js} +1 -1
- package/assets/Layout.css +1 -1
- package/assets/ListBoxSection.css +1 -1
- package/checkbox/index.js +1 -1
- package/color-scheme-switch/index.js +1 -1
- package/combobox/index.cjs +1 -1
- package/combobox/index.js +1 -1
- package/date-field/index.js +2 -2
- package/date-picker/DatePickerPopover.d.ts +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +1 -1
- package/dropdown/index.js +1 -1
- package/grid/index.d.ts +1 -1
- package/index.cjs +1 -1
- package/index.js +20 -20
- package/label/index.js +1 -1
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/list-box/index.cjs +1 -1
- package/list-box/index.js +2 -2
- package/modal/index.cjs +1 -1
- package/modal/index.js +2 -2
- package/package.json +1 -1
- package/popover/index.js +1 -1
- package/progress-bar/index.js +1 -1
- package/radio/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/table/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.js +1 -1
- package/textfield/index.js +1 -1
- package/theme/index.cjs +1 -1
- package/theme/index.d.ts +1 -0
- package/theme/index.js +2 -2
- package/theme/tokens.d.ts +1 -0
- package/toggle-button/index.js +1 -1
- package/{tokens-BF-dPard.cjs → tokens-5PzK5zK7.cjs} +1 -1
- package/{tokens-r1r3wC04.js → tokens-CqvelUoA.js} +13 -12
- package/{useFilter-DginflOU.js → useFilter-DsOxD9JB.js} +1 -1
- package/{useHasTabbableChild-DP62kzkG.js → useHasTabbableChild-BgEe5J35.js} +1 -1
- package/{useListState-DNB7JWoj.js → useListState-B3c3xcNW.js} +1 -1
- package/{useSingleSelectListState-B0OMoHd_.js → useSingleSelectListState-DdBsBWKG.js} +1 -1
- package/DateRangePicker-Bfibl08v.cjs +0 -6
- package/Dialog-B3R3WtL5.cjs +0 -1
- package/Dialog-BkUw6PlA.js +0 -221
- package/Layout-BwLxIwtY.cjs +0 -16
- package/Layout-CcADAhds.js +0 -498
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require('./assets/ListBoxSection.css');const S=require("react/jsx-runtime"),V=require("./ListBox-B0E1hdEt.cjs"),Y=require("./Collection-BtBX5IMY.cjs"),c=require("react"),C=require("./mergeProps-B5KXZAI3.cjs"),W=require("./context-Df3XbgBG.cjs"),T=require("react-dom"),Z=require("./OverlayArrow-DpZ1FqOd.cjs"),ee=require("./useEvent-DPxMu-X9.cjs"),M=require("./clsx-C11secjj.cjs"),q=require("./SelectionManager-BJjqIWtf.cjs"),te=require("./Dialog-DtHk3eXI.cjs"),ie=require("./Separator-DPLEx950.cjs");class le{shouldInvalidate(e,t){return e.width!==t.width||e.height!==t.height}shouldInvalidateLayoutOptions(e,t){return e!==t}update(e){}getItemRect(e){var t,i;return(i=(t=this.getLayoutInfo(e))===null||t===void 0?void 0:t.rect)!==null&&i!==void 0?i:null}getVisibleRect(){return this.virtualizer.visibleRect}constructor(){this.virtualizer=null}}class b{copy(){let e=new b(this.type,this.key,this.rect.copy());return e.estimatedSize=this.estimatedSize,e.opacity=this.opacity,e.transform=this.transform,e.parentKey=this.parentKey,e.content=this.content,e.isSticky=this.isSticky,e.zIndex=this.zIndex,e.allowOverflow=this.allowOverflow,e}constructor(e,t,i){this.type=e,this.key=t,this.parentKey=null,this.content=null,this.rect=i,this.estimatedSize=!1,this.isSticky=!1,this.opacity=1,this.transform=null,this.zIndex=0,this.allowOverflow=!1}}class x{copy(){return new x(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}isOrigin(){return this.x===0&&this.y===0}constructor(e=0,t=0){this.x=e,this.y=t}}class f{get maxX(){return this.x+this.width}get maxY(){return this.y+this.height}get area(){return this.width*this.height}get topLeft(){return new x(this.x,this.y)}get topRight(){return new x(this.maxX,this.y)}get bottomLeft(){return new x(this.x,this.maxY)}get bottomRight(){return new x(this.maxX,this.maxY)}intersects(e){return this.area>0&&e.area>0&&this.x<=e.x+e.width&&e.x<=this.x+this.width&&this.y<=e.y+e.height&&e.y<=this.y+this.height}containsRect(e){return this.x<=e.x&&this.y<=e.y&&this.maxX>=e.maxX&&this.maxY>=e.maxY}containsPoint(e){return this.x<=e.x&&this.y<=e.y&&this.maxX>=e.x&&this.maxY>=e.y}getCornerInRect(e){for(let t of["topLeft","topRight","bottomLeft","bottomRight"])if(e.containsPoint(this[t]))return t;return null}equals(e){return e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}pointEquals(e){return this.x===e.x&&this.y===e.y}sizeEquals(e){return this.width===e.width&&this.height===e.height}union(e){let t=Math.min(this.x,e.x),i=Math.min(this.y,e.y),l=Math.max(this.maxX,e.maxX)-t,o=Math.max(this.maxY,e.maxY)-i;return new f(t,i,l,o)}intersection(e){if(!this.intersects(e))return new f(0,0,0,0);let t=Math.max(this.x,e.x),i=Math.max(this.y,e.y);return new f(t,i,Math.min(this.maxX,e.maxX)-t,Math.min(this.maxY,e.maxY)-i)}copy(){return new f(this.x,this.y,this.width,this.height)}constructor(e=0,t=0,i=0,l=0){this.x=e,this.y=t,this.width=i,this.height=l}}class z{copy(){return new z(this.width,this.height)}equals(e){return this.width===e.width&&this.height===e.height}get area(){return this.width*this.height}constructor(e=0,t=0){this.width=Math.max(e,0),this.height=Math.max(t,0)}}let oe=0;class D{prepareForReuse(){this.content=null,this.rendered=null,this.layoutInfo=null}getReusableView(e){let t=this.reusableViews.get(e);return t&&t.length>0?t.shift():new se(this.virtualizer,this,e)}reuseChild(e){e.prepareForReuse();let t=this.reusableViews.get(e.viewType);t||(t=[],this.reusableViews.set(e.viewType,t)),t.push(e)}constructor(e,t){this.virtualizer=e,this.key=++oe,this.viewType=t,this.children=new Set,this.reusableViews=new Map,this.layoutInfo=null,this.content=null,this.rendered=null}}class ne extends D{constructor(e){super(e,"root")}}class se extends D{constructor(e,t,i){super(e,i),this.parent=t}}function re(n,e){if(n===e)return!0;if(n.size!==e.size)return!1;for(let t of n)if(!e.has(t))return!1;return!0}class ae{setVisibleRect(e){let t=performance.now()-this.startTime;t<500&&(e.x!==this.visibleRect.x&&t>0&&(this.velocity.x=(e.x-this.visibleRect.x)/t),e.y!==this.visibleRect.y&&t>0&&(this.velocity.y=(e.y-this.visibleRect.y)/t)),this.startTime=performance.now(),this.visibleRect=e}getOverscannedRect(){let e=this.visibleRect.copy(),t=this.visibleRect.height/3;if(e.height+=t,this.velocity.y<0&&(e.y-=t),this.velocity.x!==0){let i=this.visibleRect.width/3;e.width+=i,this.velocity.x<0&&(e.x-=i)}return e}constructor(){this.startTime=0,this.velocity=new x(0,0),this.visibleRect=new f}}class he{isPersistedKey(e){if(this.persistedKeys.has(e))return!0;for(let t of this.persistedKeys)for(;t!=null;){let i=this.layout.getLayoutInfo(t);if(!i||i.parentKey==null)break;if(t=i.parentKey,t===e)return!0}return!1}getParentView(e){return e.parentKey!=null?this._visibleViews.get(e.parentKey):this._rootView}getReusableView(e){let i=this.getParentView(e).getReusableView(e.type);return i.layoutInfo=e,this._renderView(i),i}_renderView(e){if(e.layoutInfo){let{type:t,key:i,content:l}=e.layoutInfo;e.content=l||this.collection.getItem(i),e.rendered=this._renderContent(t,e.content)}}_renderContent(e,t){let i=t!=null?this._renderedContent.get(t):null;if(i!=null)return i;let l=this.delegate.renderView(e,t);return t&&this._renderedContent.set(t,l),l}keyAtPoint(e){let t=new f(e.x,e.y,1,1),i=t.area===0?[]:this.layout.getVisibleLayoutInfos(t);for(let l of i)if(l.rect.intersects(t))return l.key;return null}relayout(e={}){this.layout.update(e),this.contentSize=this.layout.getContentSize();let t=this.visibleRect,i=e.contentChanged?0:t.x,l=e.contentChanged?0:t.y;if(i=Math.max(0,Math.min(this.contentSize.width-t.width,i)),l=Math.max(0,Math.min(this.contentSize.height-t.height,l)),i!==t.x||l!==t.y){let o=new f(i,l,t.width,t.height);this.delegate.setVisibleRect(o)}else this.updateSubviews()}getVisibleLayoutInfos(){let e=process.env.NODE_ENV==="test"&&!process.env.VIRT_ON,t=e&&typeof HTMLElement<"u"&&Object.getOwnPropertyNames(HTMLElement.prototype).includes("clientWidth"),i=e&&typeof HTMLElement<"u"&&Object.getOwnPropertyNames(HTMLElement.prototype).includes("clientHeight"),l;e&&!(t&&i)?l=new f(0,0,this.contentSize.width,this.contentSize.height):l=this._overscanManager.getOverscannedRect();let o=this.layout.getVisibleLayoutInfos(l),s=new Map;for(let a of o)s.set(a.key,a);return s}updateSubviews(){let e=this.getVisibleLayoutInfos(),t=new Set;for(let[i,l]of this._visibleViews){let o=e.get(i);(!o||l.parent!==this.getParentView(o))&&(this._visibleViews.delete(i),l.parent.reuseChild(l),t.add(l))}for(let[i,l]of e){let o=this._visibleViews.get(i);if(!o)o=this.getReusableView(l),o.parent.children.add(o),this._visibleViews.set(i,o),t.delete(o);else{o.layoutInfo=l;let s=this.collection.getItem(l.key);o.content!==s&&(o.content!=null&&this._renderedContent.delete(o.content),this._renderView(o))}}for(let i of t)i.parent.children.delete(i),i.parent.reusableViews.clear();if(!this._isScrolling)for(let i of e.keys()){let l=this._visibleViews.get(i);l.parent.children.delete(l),l.parent.children.add(l)}}render(e){let t=this,i=!1,l=!1,o=!1,s=!1,a=!1,h=!1;return e.collection!==this.collection&&(t.collection=e.collection,i=!0),(e.layout!==this.layout||this.layout.virtualizer!==this)&&(this.layout&&(this.layout.virtualizer=null),e.layout.virtualizer=this,t.layout=e.layout,i=!0),e.persistedKeys&&!re(e.persistedKeys,this.persistedKeys)&&(t.persistedKeys=e.persistedKeys,h=!0),this.visibleRect.equals(e.visibleRect)||(this._overscanManager.setVisibleRect(e.visibleRect),this.layout.shouldInvalidate(e.visibleRect,this.visibleRect)?(l=!e.visibleRect.pointEquals(this.visibleRect),o=!e.visibleRect.sizeEquals(this.visibleRect),i=!0):h=!0,t.visibleRect=e.visibleRect),e.invalidationContext!==this._invalidationContext&&(e.invalidationContext&&(o||(o=e.invalidationContext.sizeChanged||!1),l||(l=e.invalidationContext.offsetChanged||!1),s||(s=e.invalidationContext.itemSizeChanged||!1),a||(a=e.invalidationContext.layoutOptions!=null&&this._invalidationContext.layoutOptions!=null&&e.invalidationContext.layoutOptions!==this._invalidationContext.layoutOptions&&this.layout.shouldInvalidateLayoutOptions(e.invalidationContext.layoutOptions,this._invalidationContext.layoutOptions)),i||(i=s||o||l||a)),this._invalidationContext=e.invalidationContext),e.isScrolling!==this._isScrolling&&(this._isScrolling=e.isScrolling,e.isScrolling||(h=!0)),i?this.relayout({offsetChanged:l,sizeChanged:o,itemSizeChanged:s,layoutOptionsChanged:a,layoutOptions:this._invalidationContext.layoutOptions}):h&&this.updateSubviews(),Array.from(this._rootView.children)}getVisibleView(e){return this._visibleViews.get(e)}invalidate(e){this.delegate.invalidate(e)}updateItemSize(e,t){if(!this.layout.updateItemSize)return;this.layout.updateItemSize(e,t)&&this.invalidate({itemSizeChanged:!0})}constructor(e){this.delegate=e.delegate,this.collection=e.collection,this.layout=e.layout,this.contentSize=new z,this.visibleRect=new f,this.persistedKeys=new Set,this._visibleViews=new Map,this._renderedContent=new WeakMap,this._rootView=new ne(this),this._isScrolling=!1,this._invalidationContext={},this._overscanManager=new ae}}function de(n){let[e,t]=c.useState(new f(0,0,0,0)),[i,l]=c.useState(!1),[o,s]=c.useState({}),a=c.useRef(!1),[h]=c.useState(()=>new he({collection:n.collection,layout:n.layout,delegate:{setVisibleRect(w){t(w),a.current=!0},renderView:n.renderView,invalidate:s}}));C.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{a.current&&(a.current=!1,n.onVisibleRectChange(e))});let r=c.useMemo(()=>n.layoutOptions!=null?{...o,layoutOptions:n.layoutOptions}:o,[o,n.layoutOptions]),d=h.render({layout:n.layout,collection:n.collection,persistedKeys:n.persistedKeys,layoutOptions:n.layoutOptions,visibleRect:e,invalidationContext:r,isScrolling:i}),u=h.contentSize,g=c.useCallback(()=>{l(!0)},[]),y=c.useCallback(()=>{l(!1)},[]);return c.useMemo(()=>({virtualizer:h,visibleViews:d,setVisibleRect:t,contentSize:u,isScrolling:i,startScrolling:g,endScrolling:y}),[h,d,t,u,i,g,y])}const $=48;class ce extends le{get collection(){return this.virtualizer.collection}getLayoutInfo(e){var t;return this.ensureLayoutInfo(e),((t=this.layoutNodes.get(e))===null||t===void 0?void 0:t.layoutInfo)||null}getVisibleLayoutInfos(e){if(e.height>1){var t,i;let s=((i=(t=this.rowHeight)!==null&&t!==void 0?t:this.estimatedRowHeight)!==null&&i!==void 0?i:$)+this.gap;e.y=Math.floor(e.y/s)*s,e.height=Math.ceil(e.height/s)*s}this.layoutIfNeeded(e);let l=[],o=s=>{for(let a of s)this.isVisible(a,e)&&(l.push(a.layoutInfo),a.children&&o(a.children))};return o(this.rootNodes),l}layoutIfNeeded(e){if(this.lastCollection){this.requestedRect.containsRect(e)||(this.requestedRect=this.requestedRect.union(e),this.rootNodes=this.buildCollection());for(let t of this.virtualizer.persistedKeys)if(this.ensureLayoutInfo(t))return}}ensureLayoutInfo(e){return!this.layoutNodes.has(e)&&this.requestedRect.area<this.contentSize.area&&this.lastCollection?(this.requestedRect=new f(0,0,1/0,1/0),this.rootNodes=this.buildCollection(),this.requestedRect=new f(0,0,this.contentSize.width,this.contentSize.height),!0):!1}isVisible(e,t){return e.layoutInfo.rect.intersects(t)||e.layoutInfo.isSticky||e.layoutInfo.type==="header"||e.layoutInfo.type==="loader"||this.virtualizer.isPersistedKey(e.layoutInfo.key)}shouldInvalidateEverything(e){let t=e.layoutOptions;var i,l,o,s,a;return e.sizeChanged||this.rowHeight!==((i=t==null?void 0:t.rowHeight)!==null&&i!==void 0?i:this.rowHeight)||this.headingHeight!==((l=t==null?void 0:t.headingHeight)!==null&&l!==void 0?l:this.headingHeight)||this.loaderHeight!==((o=t==null?void 0:t.loaderHeight)!==null&&o!==void 0?o:this.loaderHeight)||this.gap!==((s=t==null?void 0:t.gap)!==null&&s!==void 0?s:this.gap)||this.padding!==((a=t==null?void 0:t.padding)!==null&&a!==void 0?a:this.padding)}shouldInvalidateLayoutOptions(e,t){return e.rowHeight!==t.rowHeight||e.estimatedRowHeight!==t.estimatedRowHeight||e.headingHeight!==t.headingHeight||e.estimatedHeadingHeight!==t.estimatedHeadingHeight||e.loaderHeight!==t.loaderHeight||e.dropIndicatorThickness!==t.dropIndicatorThickness||e.gap!==t.gap||e.padding!==t.padding}update(e){let t=this.virtualizer.collection;this.invalidateEverything=this.shouldInvalidateEverything(e),this.invalidateEverything&&(this.requestedRect=this.virtualizer.visibleRect.copy(),this.layoutNodes.clear());let i=e.layoutOptions;var l;this.rowHeight=(l=i==null?void 0:i.rowHeight)!==null&&l!==void 0?l:this.rowHeight;var o;this.estimatedRowHeight=(o=i==null?void 0:i.estimatedRowHeight)!==null&&o!==void 0?o:this.estimatedRowHeight;var s;this.headingHeight=(s=i==null?void 0:i.headingHeight)!==null&&s!==void 0?s:this.headingHeight;var a;this.estimatedHeadingHeight=(a=i==null?void 0:i.estimatedHeadingHeight)!==null&&a!==void 0?a:this.estimatedHeadingHeight;var h;this.loaderHeight=(h=i==null?void 0:i.loaderHeight)!==null&&h!==void 0?h:this.loaderHeight;var r;this.dropIndicatorThickness=(r=i==null?void 0:i.dropIndicatorThickness)!==null&&r!==void 0?r:this.dropIndicatorThickness;var d;this.gap=(d=i==null?void 0:i.gap)!==null&&d!==void 0?d:this.gap;var u;if(this.padding=(u=i==null?void 0:i.padding)!==null&&u!==void 0?u:this.padding,this.rootNodes=this.buildCollection(),this.lastCollection&&t!==this.lastCollection)for(let g of this.lastCollection.getKeys())t.getItem(g)||this.layoutNodes.get(g)&&this.layoutNodes.delete(g);this.lastCollection=t,this.invalidateEverything=!1,this.validRect=this.requestedRect.copy()}buildCollection(e=this.padding){let t=this.virtualizer.collection,i=0,l=[],o=(t==null?void 0:t.size)===0||t.size===1&&t.getItem(t.getFirstKey()).type==="loader";o&&(e=0);for(let r of t){var s,a;let d=((a=(s=this.rowHeight)!==null&&s!==void 0?s:this.estimatedRowHeight)!==null&&a!==void 0?a:$)+this.gap;if(r.type==="item"&&e+d<this.requestedRect.y&&!this.isValid(r,e)){e+=d,i++;continue}let u=this.buildChild(r,this.padding,e,null);if(e=u.layoutInfo.rect.maxY+this.gap,l.push(u),r.type==="item"&&e>this.requestedRect.maxY){var h;let g=t.size-(l.length+i),y=t.getItem(t.getLastKey());if((y==null?void 0:y.type)==="loader"&&g--,e+=g*d,(y==null?void 0:y.type)==="loader"&&((h=l.at(-1))===null||h===void 0?void 0:h.layoutInfo.type)!=="loader"){let v=this.buildChild(y,this.padding,e,null);l.push(v),e=v.layoutInfo.rect.maxY}break}}return e-=this.gap,e+=o?0:this.padding,this.contentSize=new z(this.virtualizer.visibleRect.width,e),l}isValid(e,t){let i=this.layoutNodes.get(e.key);return!this.invalidateEverything&&!!i&&i.node===e&&t===i.layoutInfo.rect.y&&i.layoutInfo.rect.intersects(this.validRect)&&i.validRect.containsRect(i.layoutInfo.rect.intersection(this.requestedRect))}buildChild(e,t,i,l){if(this.isValid(e,i))return this.layoutNodes.get(e.key);let o=this.buildNode(e,t,i);return o.layoutInfo.parentKey=l??null,o.layoutInfo.allowOverflow=!0,this.layoutNodes.set(e.key,o),o}buildNode(e,t,i){switch(e.type){case"section":return this.buildSection(e,t,i);case"item":return this.buildItem(e,t,i);case"header":return this.buildSectionHeader(e,t,i);case"loader":return this.buildLoader(e,t,i);case"separator":return this.buildItem(e,t,i);default:throw new Error("Unsupported node type: "+e.type)}}buildLoader(e,t,i){let l=new f(t,i,this.padding,0),o=new b("loader",e.key,l);l.width=this.virtualizer.contentSize.width-this.padding-t;var s,a,h;return l.height=e.props.isLoading?(h=(a=(s=this.loaderHeight)!==null&&s!==void 0?s:this.rowHeight)!==null&&a!==void 0?a:this.estimatedRowHeight)!==null&&h!==void 0?h:$:0,{layoutInfo:o,validRect:l.intersection(this.requestedRect)}}buildSection(e,t,i){let l=this.virtualizer.collection,o=this.virtualizer.visibleRect.width-this.padding,s=new f(t,i,o-t,0),a=new b(e.type,e.key,s),h=i,r=0,d=[];for(let y of q.$c5a24bc478652b5f$export$1005530eda016c13(e,l)){var u,g;let v=((g=(u=this.rowHeight)!==null&&u!==void 0?u:this.estimatedRowHeight)!==null&&g!==void 0?g:$)+this.gap;if(i+v<this.requestedRect.y&&!this.isValid(e,i)){i+=v,r++;continue}let w=this.buildChild(y,t,i,a.key);if(i=w.layoutInfo.rect.maxY+this.gap,d.push(w),i>this.requestedRect.maxY){i+=([...q.$c5a24bc478652b5f$export$1005530eda016c13(e,l)].length-(d.length+r))*v;break}}return i-=this.gap,s.height=i-h,{layoutInfo:a,children:d,validRect:a.rect.intersection(this.requestedRect),node:e}}buildSectionHeader(e,t,i){let l=this.virtualizer.visibleRect.width-this.padding,o=this.headingHeight,s=!1;if(o==null){let r=this.layoutNodes.get(e.key),d=r==null?void 0:r.layoutInfo;if(d){let u=this.virtualizer.collection.getItem(e.key),g=this.lastCollection?this.lastCollection.getItem(e.key):null;o=d.rect.height,s=l!==d.rect.width||u!==g||d.estimatedSize}else o=e.rendered?this.estimatedHeadingHeight:0,s=!0}o==null&&(o=$);let a=new f(t,i,l-t,o),h=new b("header",e.key,a);return h.estimatedSize=s,{layoutInfo:h,children:[],validRect:h.rect.intersection(this.requestedRect),node:e}}buildItem(e,t,i){let l=this.virtualizer.visibleRect.width-this.padding-t,o=this.rowHeight,s=!1;if(o==null){let r=this.layoutNodes.get(e.key);r?(o=r.layoutInfo.rect.height,s=l!==r.layoutInfo.rect.width||e!==r.node||r.layoutInfo.estimatedSize):(o=this.estimatedRowHeight,s=!0)}o==null&&(o=$);let a=new f(t,i,l,o),h=new b(e.type,e.key,a);return h.estimatedSize=s,{layoutInfo:h,children:[],validRect:h.rect,node:e}}updateItemSize(e,t){let i=this.layoutNodes.get(e);if(!i)return!1;let l=this.virtualizer.collection,o=i.layoutInfo;if(o.estimatedSize=!1,o.rect.height!==t.height){let s=o.copy();s.rect.height=t.height,i.layoutInfo=s,this.validRect.height=Math.min(this.validRect.height,o.rect.y-this.validRect.y),this.requestedRect.height+=s.rect.height-o.rect.height,this.updateLayoutNode(e,o,s);let a=o.parentKey!=null?l.getItem(o.parentKey):null;for(;a;)this.updateLayoutNode(a.key,o,s),a=a.parentKey!=null?l.getItem(a.parentKey):null;return!0}return!1}updateLayoutNode(e,t,i){let l=this.layoutNodes.get(e);l&&(l.validRect=l.validRect.intersection(this.validRect),l.layoutInfo===t&&(l.layoutInfo=i))}getContentSize(){return this.contentSize}getDropTargetFromPoint(e,t,i){e+=this.virtualizer.visibleRect.x,t+=this.virtualizer.visibleRect.y;let l=new f(e,Math.max(0,t-this.gap),1,Math.max(1,this.gap*2)),o=this.getVisibleLayoutInfos(l),s=null,a=1/0;for(let u of o){if(!u.rect.intersects(l))continue;let g=Math.abs(u.rect.y-t),y=Math.abs(u.rect.maxY-t),v=Math.min(g,y);v<a&&(a=v,s=u.key)}if(s==null||this.virtualizer.collection.size===0)return{type:"root"};let h=this.getLayoutInfo(s);if(!h)return null;let r=h.rect,d={type:"item",key:h.key,dropPosition:"on"};return i(d)?t<=r.y+10&&i({...d,dropPosition:"before"})?d.dropPosition="before":t>=r.maxY-10&&i({...d,dropPosition:"after"})&&(d.dropPosition="after"):t<=r.y+r.height/2&&i({...d,dropPosition:"before"})?d.dropPosition="before":i({...d,dropPosition:"after"})&&(d.dropPosition="after"),d}getDropTargetLayoutInfo(e){let t=this.getLayoutInfo(e.key),i;return e.dropPosition==="before"?i=new f(t.rect.x,t.rect.y-this.dropIndicatorThickness/2,t.rect.width,this.dropIndicatorThickness):e.dropPosition==="after"?i=new f(t.rect.x,t.rect.maxY-this.dropIndicatorThickness/2,t.rect.width,this.dropIndicatorThickness):i=t.rect,new b("dropIndicator",e.key+":"+e.dropPosition,i)}constructor(e={}){super();var t;this.rowHeight=(t=e.rowHeight)!==null&&t!==void 0?t:null;var i;this.estimatedRowHeight=(i=e.estimatedRowHeight)!==null&&i!==void 0?i:null;var l;this.headingHeight=(l=e.headingHeight)!==null&&l!==void 0?l:null;var o;this.estimatedHeadingHeight=(o=e.estimatedHeadingHeight)!==null&&o!==void 0?o:null;var s;this.loaderHeight=(s=e.loaderHeight)!==null&&s!==void 0?s:null,this.dropIndicatorThickness=e.dropIndicatorThickness||2,this.gap=e.gap||0,this.padding=e.padding||0,this.layoutNodes=new Map,this.rootNodes=[],this.lastCollection=null,this.invalidateEverything=!1,this.validRect=new f,this.requestedRect=new f,this.contentSize=new z}}let R=null;function ue(n=!1){if(R===null||n){const e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";const i=document.createElement("div"),l=i.style;return l.width="100px",l.height="100px",e.appendChild(i),document.body.appendChild(e),e.scrollLeft>0?R="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?R="negative":R="positive-ascending"),document.body.removeChild(e),R}return R}function fe(n,e){let{scrollLeft:t}=n;if(e==="rtl"){let{scrollWidth:i,clientWidth:l}=n;switch(ue()){case"negative":t=-t;break;case"positive-descending":t=i-l-t;break}}return t}function ge(n,e){let{contentSize:t,onVisibleRectChange:i,innerStyle:l,onScrollStart:o,onScrollEnd:s,scrollDirection:a="both",...h}=n,r=c.useRef({scrollTop:0,scrollLeft:0,scrollEndTime:0,scrollTimeout:null,width:0,height:0,isScrolling:!1}).current,{direction:d}=W.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),[u,g]=c.useState(!1),y=c.useCallback(p=>{p.target===p.currentTarget&&(n.onScroll&&n.onScroll(p),T.flushSync(()=>{let m=p.currentTarget.scrollTop,H=fe(p.currentTarget,d);r.scrollTop=Math.max(0,Math.min(m,t.height-r.height)),r.scrollLeft=Math.max(0,Math.min(H,t.width-r.width)),i(new f(r.scrollLeft,r.scrollTop,r.width,r.height)),r.isScrolling||(r.isScrolling=!0,g(!0),window.dispatchEvent(new Event("tk.disconnect-observer")),o&&o());let L=Date.now();r.scrollEndTime<=L+50&&(r.scrollEndTime=L+300,r.scrollTimeout!=null&&clearTimeout(r.scrollTimeout),r.scrollTimeout=setTimeout(()=>{r.isScrolling=!1,g(!1),r.scrollTimeout=null,window.dispatchEvent(new Event("tk.connect-observer")),s&&s()},300))}))},[n,d,r,t,i,o,s]);ee.$e9faafb641e167db$export$90fc3a17d93f704c(e,"scroll",y),c.useEffect(()=>()=>{r.scrollTimeout!=null&&clearTimeout(r.scrollTimeout),r.isScrolling&&window.dispatchEvent(new Event("tk.connect-observer"))},[]);let v=c.useRef(!1),w=C.$8ae05eaa5c114e9c$export$7f54fc3180508a52(p=>{let m=e.current;if(!m||v.current)return;v.current=!0;let H=process.env.NODE_ENV==="test"&&!process.env.VIRT_ON,L=Object.getOwnPropertyNames(window.HTMLElement.prototype).includes("clientWidth"),Q=Object.getOwnPropertyNames(window.HTMLElement.prototype).includes("clientHeight"),O=m.clientWidth,P=m.clientHeight,N=H&&!L?1/0:O,E=H&&!Q?1/0:P;(r.width!==N||r.height!==E)&&(r.width=N,r.height=E,p(()=>{i(new f(r.scrollLeft,r.scrollTop,N,E))}),(!H&&O!==m.clientWidth||P!==m.clientHeight)&&(r.width=m.clientWidth,r.height=m.clientHeight,p(()=>{i(new f(r.scrollLeft,r.scrollTop,r.width,r.height))}))),v.current=!1}),_=c.useRef(null),[U,G]=c.useState({});C.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{if(!v.current&&(_.current==null||!t.equals(_.current)))if(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u"){G({}),_.current=t;return}else queueMicrotask(()=>w(T.flushSync));_.current=t}),C.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{w(p=>p())},[U]);let J=c.useCallback(()=>{w(T.flushSync)},[w]);Z.$9daab02d461809db$export$683480f191c0e3ea({ref:e,box:"border-box",onResize:J});let I={padding:0,...h.style};return a==="horizontal"?(I.overflowX="auto",I.overflowY="hidden"):a==="vertical"||t.width===r.width?(I.overflowY="auto",I.overflowX="hidden"):I.overflow="auto",l={width:Number.isFinite(t.width)?t.width:void 0,height:Number.isFinite(t.height)?t.height:void 0,pointerEvents:u?"none":"auto",position:"relative",...l},{scrollViewProps:{...h,style:I},contentProps:{role:"presentation",style:l}}}function ye(n){let{layoutInfo:e,virtualizer:t,ref:i}=n,l=e==null?void 0:e.key,o=c.useCallback(()=>{if(l!=null&&i.current){let s=ve(i.current);t.updateItemSize(l,s)}},[t,l,i]);return C.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{e!=null&&e.estimatedSize&&o()}),{updateSize:o}}function ve(n){let e=n.style.height;n.style.height="";let t=new z(n.scrollWidth,n.scrollHeight);return n.style.height=e,t}function X(n){let{style:e,className:t,layoutInfo:i,virtualizer:l,parent:o,children:s}=n,{direction:a}=W.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),h=c.useRef(null);return ye({layoutInfo:i,virtualizer:l,ref:h}),c.createElement("div",{role:"presentation",ref:h,className:t,style:{...pe(i,a,o),...e}},s)}let B=new WeakMap;function pe(n,e,t){let i=e==="rtl"?"right":"left",l=B.get(n);if(l&&l[i]!=null){if(!t)return l;let h=n.rect.y-t.rect.y,r=n.rect.x-t.rect.x;if(l.top===h&&l[i]===r)return l}let o={top:n.rect.y-(t&&!(t.allowOverflow&&n.isSticky)?t.rect.y:0),[i]:n.rect.x-(t&&!(t.allowOverflow&&n.isSticky)?t.rect.x:0),width:n.rect.width,height:n.rect.height};Object.entries(o).forEach(([h,r])=>{Number.isFinite(r)||(o[h]=void 0)});var s;let a={position:n.isSticky?"sticky":"absolute",display:n.isSticky?"inline-block":void 0,overflow:n.allowOverflow?"visible":"hidden",opacity:n.opacity,zIndex:n.zIndex,transform:(s=n.transform)!==null&&s!==void 0?s:void 0,contain:"size layout style",...o};return B.set(n,a),a}const j=c.createContext(null),A=c.createContext(null);function we(n){let{children:e,layout:t,layoutOptions:i}=n,l=c.useMemo(()=>typeof t=="function"?new t:t,[t]),o=c.useMemo(()=>({isVirtualized:!0,layoutDelegate:l,dropTargetDelegate:l.getDropTargetFromPoint?l:void 0,CollectionRoot:me,CollectionBranch:be}),[l]);return c.createElement(Y.$7135fc7d473fd974$export$4feb769f8ddf26c5.Provider,{value:o},c.createElement(A.Provider,{value:{layout:l,layoutOptions:i}},e))}function me({collection:n,persistedKeys:e,scrollRef:t,renderDropIndicator:i}){var l;let{layout:o,layoutOptions:s}=c.useContext(A),a=(l=o.useLayoutOptions)===null||l===void 0?void 0:l.call(o),h=de({layout:o,collection:n,renderView:(d,u)=>{var g;return u==null||(g=u.render)===null||g===void 0?void 0:g.call(u,u)},onVisibleRectChange(d){let u=t==null?void 0:t.current;u&&(u.scrollLeft=d.x,u.scrollTop=d.y)},persistedKeys:e,layoutOptions:c.useMemo(()=>s&&a?{...s,...a}:s||a,[s,a])}),{contentProps:r}=ge({onVisibleRectChange:h.setVisibleRect,contentSize:h.contentSize,onScrollStart:h.startScrolling,onScrollEnd:h.endScrolling},t);return c.createElement("div",r,c.createElement(j.Provider,{value:h},F(null,h.visibleViews,i)))}function be({parent:n,renderDropIndicator:e}){let i=c.useContext(j).virtualizer.getVisibleView(n.key);return F(i,Array.from(i.children),e)}function F(n,e,t){return e.map(i=>xe(n,i,t))}function xe(n,e,t){let i=c.createElement(X,{key:e.key,layoutInfo:e.layoutInfo,virtualizer:e.virtualizer,parent:n==null?void 0:n.layoutInfo},e.rendered),{collection:l,layout:o}=e.virtualizer,s=e.content;return(s==null?void 0:s.type)==="item"&&t&&o.getDropTargetLayoutInfo&&(i=c.createElement(c.Fragment,{key:e.key},K(n,e,{type:"item",key:e.content.key,dropPosition:"before"},t),i,Y.$7135fc7d473fd974$export$2dbbd341daed716d(l,s,a=>K(n,e,a,t)))),i}function K(n,e,t,i){let l=i(t);if(l){let o=e.virtualizer.layout.getDropTargetLayoutInfo(t);l=c.createElement(X,{layoutInfo:o,virtualizer:e.virtualizer,parent:n==null?void 0:n.layoutInfo},l)}return l}class Ie extends ce{getContentSize(){var t;const e=(t=this==null?void 0:this.virtualizer)==null?void 0:t.collection.getKeys();return Array.from(e||[]).forEach(i=>{this.getLayoutInfo(i)}),this.contentSize}}const $e="_listBox_iev2c_7",Re="_listBoxPopover_iev2c_19",Se="_listBoxSectionHeading_iev2c_31",ze="_listBoxButton_iev2c_38",He="_listBoxItem_iev2c_50",k={listBox:$e,listBoxPopover:Re,listBoxSectionHeading:Se,listBoxButton:ze,listBoxItem:He},Ce=({className:n,children:e,...t})=>S.jsx(we,{layout:Ie,layoutOptions:{headingHeight:44},children:S.jsx(V.$eed445e0843c11d0$export$41f133550aa26f48,{className:M.clsx(k.listBox,n),...t,children:e})}),ke=({children:n,className:e,...t})=>S.jsx(V.$eed445e0843c11d0$export$a11e76429ed99b4,{className:M.clsx(k.listBoxItem,e),...t,children:n}),_e=({className:n,children:e,...t})=>S.jsx(te.$07b14b47974efb58$export$5b6b19405a83ff9d,{className:M.clsx(n,k.listBoxPopover),offset:0,...t,children:e}),Le=({children:n,name:e,...t})=>S.jsxs(V.$eed445e0843c11d0$export$dca12b0bb56e4fc,{...t,children:[S.jsx(ie.$72a5793c14baf454$export$8b251419efc915eb,{className:k.listBoxSectionHeading,children:e}),n]});exports.ListBox=Ce;exports.ListBoxItem=ke;exports.ListBoxPopover=_e;exports.ListBoxSection=Le;exports.styles=k;
|
|
1
|
+
"use strict";require('./assets/ListBoxSection.css');const S=require("react/jsx-runtime"),V=require("./ListBox-B0E1hdEt.cjs"),Y=require("./Collection-BtBX5IMY.cjs"),c=require("react"),C=require("./mergeProps-B5KXZAI3.cjs"),W=require("./context-Df3XbgBG.cjs"),T=require("react-dom"),Z=require("./OverlayArrow-DpZ1FqOd.cjs"),ee=require("./useEvent-DPxMu-X9.cjs"),M=require("./clsx-C11secjj.cjs"),q=require("./SelectionManager-BJjqIWtf.cjs"),te=require("./Dialog-DtHk3eXI.cjs"),ie=require("./Separator-DPLEx950.cjs");class le{shouldInvalidate(e,t){return e.width!==t.width||e.height!==t.height}shouldInvalidateLayoutOptions(e,t){return e!==t}update(e){}getItemRect(e){var t,i;return(i=(t=this.getLayoutInfo(e))===null||t===void 0?void 0:t.rect)!==null&&i!==void 0?i:null}getVisibleRect(){return this.virtualizer.visibleRect}constructor(){this.virtualizer=null}}class b{copy(){let e=new b(this.type,this.key,this.rect.copy());return e.estimatedSize=this.estimatedSize,e.opacity=this.opacity,e.transform=this.transform,e.parentKey=this.parentKey,e.content=this.content,e.isSticky=this.isSticky,e.zIndex=this.zIndex,e.allowOverflow=this.allowOverflow,e}constructor(e,t,i){this.type=e,this.key=t,this.parentKey=null,this.content=null,this.rect=i,this.estimatedSize=!1,this.isSticky=!1,this.opacity=1,this.transform=null,this.zIndex=0,this.allowOverflow=!1}}class x{copy(){return new x(this.x,this.y)}equals(e){return this.x===e.x&&this.y===e.y}isOrigin(){return this.x===0&&this.y===0}constructor(e=0,t=0){this.x=e,this.y=t}}class f{get maxX(){return this.x+this.width}get maxY(){return this.y+this.height}get area(){return this.width*this.height}get topLeft(){return new x(this.x,this.y)}get topRight(){return new x(this.maxX,this.y)}get bottomLeft(){return new x(this.x,this.maxY)}get bottomRight(){return new x(this.maxX,this.maxY)}intersects(e){return this.area>0&&e.area>0&&this.x<=e.x+e.width&&e.x<=this.x+this.width&&this.y<=e.y+e.height&&e.y<=this.y+this.height}containsRect(e){return this.x<=e.x&&this.y<=e.y&&this.maxX>=e.maxX&&this.maxY>=e.maxY}containsPoint(e){return this.x<=e.x&&this.y<=e.y&&this.maxX>=e.x&&this.maxY>=e.y}getCornerInRect(e){for(let t of["topLeft","topRight","bottomLeft","bottomRight"])if(e.containsPoint(this[t]))return t;return null}equals(e){return e.x===this.x&&e.y===this.y&&e.width===this.width&&e.height===this.height}pointEquals(e){return this.x===e.x&&this.y===e.y}sizeEquals(e){return this.width===e.width&&this.height===e.height}union(e){let t=Math.min(this.x,e.x),i=Math.min(this.y,e.y),l=Math.max(this.maxX,e.maxX)-t,o=Math.max(this.maxY,e.maxY)-i;return new f(t,i,l,o)}intersection(e){if(!this.intersects(e))return new f(0,0,0,0);let t=Math.max(this.x,e.x),i=Math.max(this.y,e.y);return new f(t,i,Math.min(this.maxX,e.maxX)-t,Math.min(this.maxY,e.maxY)-i)}copy(){return new f(this.x,this.y,this.width,this.height)}constructor(e=0,t=0,i=0,l=0){this.x=e,this.y=t,this.width=i,this.height=l}}class z{copy(){return new z(this.width,this.height)}equals(e){return this.width===e.width&&this.height===e.height}get area(){return this.width*this.height}constructor(e=0,t=0){this.width=Math.max(e,0),this.height=Math.max(t,0)}}let oe=0;class D{prepareForReuse(){this.content=null,this.rendered=null,this.layoutInfo=null}getReusableView(e){let t=this.reusableViews.get(e);return t&&t.length>0?t.shift():new se(this.virtualizer,this,e)}reuseChild(e){e.prepareForReuse();let t=this.reusableViews.get(e.viewType);t||(t=[],this.reusableViews.set(e.viewType,t)),t.push(e)}constructor(e,t){this.virtualizer=e,this.key=++oe,this.viewType=t,this.children=new Set,this.reusableViews=new Map,this.layoutInfo=null,this.content=null,this.rendered=null}}class ne extends D{constructor(e){super(e,"root")}}class se extends D{constructor(e,t,i){super(e,i),this.parent=t}}function re(n,e){if(n===e)return!0;if(n.size!==e.size)return!1;for(let t of n)if(!e.has(t))return!1;return!0}class ae{setVisibleRect(e){let t=performance.now()-this.startTime;t<500&&(e.x!==this.visibleRect.x&&t>0&&(this.velocity.x=(e.x-this.visibleRect.x)/t),e.y!==this.visibleRect.y&&t>0&&(this.velocity.y=(e.y-this.visibleRect.y)/t)),this.startTime=performance.now(),this.visibleRect=e}getOverscannedRect(){let e=this.visibleRect.copy(),t=this.visibleRect.height/3;if(e.height+=t,this.velocity.y<0&&(e.y-=t),this.velocity.x!==0){let i=this.visibleRect.width/3;e.width+=i,this.velocity.x<0&&(e.x-=i)}return e}constructor(){this.startTime=0,this.velocity=new x(0,0),this.visibleRect=new f}}class he{isPersistedKey(e){if(this.persistedKeys.has(e))return!0;for(let t of this.persistedKeys)for(;t!=null;){let i=this.layout.getLayoutInfo(t);if(!i||i.parentKey==null)break;if(t=i.parentKey,t===e)return!0}return!1}getParentView(e){return e.parentKey!=null?this._visibleViews.get(e.parentKey):this._rootView}getReusableView(e){let i=this.getParentView(e).getReusableView(e.type);return i.layoutInfo=e,this._renderView(i),i}_renderView(e){if(e.layoutInfo){let{type:t,key:i,content:l}=e.layoutInfo;e.content=l||this.collection.getItem(i),e.rendered=this._renderContent(t,e.content)}}_renderContent(e,t){let i=t!=null?this._renderedContent.get(t):null;if(i!=null)return i;let l=this.delegate.renderView(e,t);return t&&this._renderedContent.set(t,l),l}keyAtPoint(e){let t=new f(e.x,e.y,1,1),i=t.area===0?[]:this.layout.getVisibleLayoutInfos(t);for(let l of i)if(l.rect.intersects(t))return l.key;return null}relayout(e={}){this.layout.update(e),this.contentSize=this.layout.getContentSize();let t=this.visibleRect,i=e.contentChanged?0:t.x,l=e.contentChanged?0:t.y;if(i=Math.max(0,Math.min(this.contentSize.width-t.width,i)),l=Math.max(0,Math.min(this.contentSize.height-t.height,l)),i!==t.x||l!==t.y){let o=new f(i,l,t.width,t.height);this.delegate.setVisibleRect(o)}else this.updateSubviews()}getVisibleLayoutInfos(){let e=process.env.NODE_ENV==="test"&&!process.env.VIRT_ON,t=e&&typeof HTMLElement<"u"&&Object.getOwnPropertyNames(HTMLElement.prototype).includes("clientWidth"),i=e&&typeof HTMLElement<"u"&&Object.getOwnPropertyNames(HTMLElement.prototype).includes("clientHeight"),l;e&&!(t&&i)?l=new f(0,0,this.contentSize.width,this.contentSize.height):l=this._overscanManager.getOverscannedRect();let o=this.layout.getVisibleLayoutInfos(l),s=new Map;for(let a of o)s.set(a.key,a);return s}updateSubviews(){let e=this.getVisibleLayoutInfos(),t=new Set;for(let[i,l]of this._visibleViews){let o=e.get(i);(!o||l.parent!==this.getParentView(o))&&(this._visibleViews.delete(i),l.parent.reuseChild(l),t.add(l))}for(let[i,l]of e){let o=this._visibleViews.get(i);if(!o)o=this.getReusableView(l),o.parent.children.add(o),this._visibleViews.set(i,o),t.delete(o);else{o.layoutInfo=l;let s=this.collection.getItem(l.key);o.content!==s&&(o.content!=null&&this._renderedContent.delete(o.content),this._renderView(o))}}for(let i of t)i.parent.children.delete(i),i.parent.reusableViews.clear();if(!this._isScrolling)for(let i of e.keys()){let l=this._visibleViews.get(i);l.parent.children.delete(l),l.parent.children.add(l)}}render(e){let t=this,i=!1,l=!1,o=!1,s=!1,a=!1,h=!1;return e.collection!==this.collection&&(t.collection=e.collection,i=!0),(e.layout!==this.layout||this.layout.virtualizer!==this)&&(this.layout&&(this.layout.virtualizer=null),e.layout.virtualizer=this,t.layout=e.layout,i=!0),e.persistedKeys&&!re(e.persistedKeys,this.persistedKeys)&&(t.persistedKeys=e.persistedKeys,h=!0),this.visibleRect.equals(e.visibleRect)||(this._overscanManager.setVisibleRect(e.visibleRect),this.layout.shouldInvalidate(e.visibleRect,this.visibleRect)?(l=!e.visibleRect.pointEquals(this.visibleRect),o=!e.visibleRect.sizeEquals(this.visibleRect),i=!0):h=!0,t.visibleRect=e.visibleRect),e.invalidationContext!==this._invalidationContext&&(e.invalidationContext&&(o||(o=e.invalidationContext.sizeChanged||!1),l||(l=e.invalidationContext.offsetChanged||!1),s||(s=e.invalidationContext.itemSizeChanged||!1),a||(a=e.invalidationContext.layoutOptions!=null&&this._invalidationContext.layoutOptions!=null&&e.invalidationContext.layoutOptions!==this._invalidationContext.layoutOptions&&this.layout.shouldInvalidateLayoutOptions(e.invalidationContext.layoutOptions,this._invalidationContext.layoutOptions)),i||(i=s||o||l||a)),this._invalidationContext=e.invalidationContext),e.isScrolling!==this._isScrolling&&(this._isScrolling=e.isScrolling,e.isScrolling||(h=!0)),i?this.relayout({offsetChanged:l,sizeChanged:o,itemSizeChanged:s,layoutOptionsChanged:a,layoutOptions:this._invalidationContext.layoutOptions}):h&&this.updateSubviews(),Array.from(this._rootView.children)}getVisibleView(e){return this._visibleViews.get(e)}invalidate(e){this.delegate.invalidate(e)}updateItemSize(e,t){if(!this.layout.updateItemSize)return;this.layout.updateItemSize(e,t)&&this.invalidate({itemSizeChanged:!0})}constructor(e){this.delegate=e.delegate,this.collection=e.collection,this.layout=e.layout,this.contentSize=new z,this.visibleRect=new f,this.persistedKeys=new Set,this._visibleViews=new Map,this._renderedContent=new WeakMap,this._rootView=new ne(this),this._isScrolling=!1,this._invalidationContext={},this._overscanManager=new ae}}function de(n){let[e,t]=c.useState(new f(0,0,0,0)),[i,l]=c.useState(!1),[o,s]=c.useState({}),a=c.useRef(!1),[h]=c.useState(()=>new he({collection:n.collection,layout:n.layout,delegate:{setVisibleRect(w){t(w),a.current=!0},renderView:n.renderView,invalidate:s}}));C.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{a.current&&(a.current=!1,n.onVisibleRectChange(e))});let r=c.useMemo(()=>n.layoutOptions!=null?{...o,layoutOptions:n.layoutOptions}:o,[o,n.layoutOptions]),d=h.render({layout:n.layout,collection:n.collection,persistedKeys:n.persistedKeys,layoutOptions:n.layoutOptions,visibleRect:e,invalidationContext:r,isScrolling:i}),u=h.contentSize,g=c.useCallback(()=>{l(!0)},[]),y=c.useCallback(()=>{l(!1)},[]);return c.useMemo(()=>({virtualizer:h,visibleViews:d,setVisibleRect:t,contentSize:u,isScrolling:i,startScrolling:g,endScrolling:y}),[h,d,t,u,i,g,y])}const $=48;class ce extends le{get collection(){return this.virtualizer.collection}getLayoutInfo(e){var t;return this.ensureLayoutInfo(e),((t=this.layoutNodes.get(e))===null||t===void 0?void 0:t.layoutInfo)||null}getVisibleLayoutInfos(e){if(e.height>1){var t,i;let s=((i=(t=this.rowHeight)!==null&&t!==void 0?t:this.estimatedRowHeight)!==null&&i!==void 0?i:$)+this.gap;e.y=Math.floor(e.y/s)*s,e.height=Math.ceil(e.height/s)*s}this.layoutIfNeeded(e);let l=[],o=s=>{for(let a of s)this.isVisible(a,e)&&(l.push(a.layoutInfo),a.children&&o(a.children))};return o(this.rootNodes),l}layoutIfNeeded(e){if(this.lastCollection){this.requestedRect.containsRect(e)||(this.requestedRect=this.requestedRect.union(e),this.rootNodes=this.buildCollection());for(let t of this.virtualizer.persistedKeys)if(this.ensureLayoutInfo(t))return}}ensureLayoutInfo(e){return!this.layoutNodes.has(e)&&this.requestedRect.area<this.contentSize.area&&this.lastCollection?(this.requestedRect=new f(0,0,1/0,1/0),this.rootNodes=this.buildCollection(),this.requestedRect=new f(0,0,this.contentSize.width,this.contentSize.height),!0):!1}isVisible(e,t){return e.layoutInfo.rect.intersects(t)||e.layoutInfo.isSticky||e.layoutInfo.type==="header"||e.layoutInfo.type==="loader"||this.virtualizer.isPersistedKey(e.layoutInfo.key)}shouldInvalidateEverything(e){let t=e.layoutOptions;var i,l,o,s,a;return e.sizeChanged||this.rowHeight!==((i=t==null?void 0:t.rowHeight)!==null&&i!==void 0?i:this.rowHeight)||this.headingHeight!==((l=t==null?void 0:t.headingHeight)!==null&&l!==void 0?l:this.headingHeight)||this.loaderHeight!==((o=t==null?void 0:t.loaderHeight)!==null&&o!==void 0?o:this.loaderHeight)||this.gap!==((s=t==null?void 0:t.gap)!==null&&s!==void 0?s:this.gap)||this.padding!==((a=t==null?void 0:t.padding)!==null&&a!==void 0?a:this.padding)}shouldInvalidateLayoutOptions(e,t){return e.rowHeight!==t.rowHeight||e.estimatedRowHeight!==t.estimatedRowHeight||e.headingHeight!==t.headingHeight||e.estimatedHeadingHeight!==t.estimatedHeadingHeight||e.loaderHeight!==t.loaderHeight||e.dropIndicatorThickness!==t.dropIndicatorThickness||e.gap!==t.gap||e.padding!==t.padding}update(e){let t=this.virtualizer.collection;this.invalidateEverything=this.shouldInvalidateEverything(e),this.invalidateEverything&&(this.requestedRect=this.virtualizer.visibleRect.copy(),this.layoutNodes.clear());let i=e.layoutOptions;var l;this.rowHeight=(l=i==null?void 0:i.rowHeight)!==null&&l!==void 0?l:this.rowHeight;var o;this.estimatedRowHeight=(o=i==null?void 0:i.estimatedRowHeight)!==null&&o!==void 0?o:this.estimatedRowHeight;var s;this.headingHeight=(s=i==null?void 0:i.headingHeight)!==null&&s!==void 0?s:this.headingHeight;var a;this.estimatedHeadingHeight=(a=i==null?void 0:i.estimatedHeadingHeight)!==null&&a!==void 0?a:this.estimatedHeadingHeight;var h;this.loaderHeight=(h=i==null?void 0:i.loaderHeight)!==null&&h!==void 0?h:this.loaderHeight;var r;this.dropIndicatorThickness=(r=i==null?void 0:i.dropIndicatorThickness)!==null&&r!==void 0?r:this.dropIndicatorThickness;var d;this.gap=(d=i==null?void 0:i.gap)!==null&&d!==void 0?d:this.gap;var u;if(this.padding=(u=i==null?void 0:i.padding)!==null&&u!==void 0?u:this.padding,this.rootNodes=this.buildCollection(),this.lastCollection&&t!==this.lastCollection)for(let g of this.lastCollection.getKeys())t.getItem(g)||this.layoutNodes.get(g)&&this.layoutNodes.delete(g);this.lastCollection=t,this.invalidateEverything=!1,this.validRect=this.requestedRect.copy()}buildCollection(e=this.padding){let t=this.virtualizer.collection,i=0,l=[],o=(t==null?void 0:t.size)===0||t.size===1&&t.getItem(t.getFirstKey()).type==="loader";o&&(e=0);for(let r of t){var s,a;let d=((a=(s=this.rowHeight)!==null&&s!==void 0?s:this.estimatedRowHeight)!==null&&a!==void 0?a:$)+this.gap;if(r.type==="item"&&e+d<this.requestedRect.y&&!this.isValid(r,e)){e+=d,i++;continue}let u=this.buildChild(r,this.padding,e,null);if(e=u.layoutInfo.rect.maxY+this.gap,l.push(u),r.type==="item"&&e>this.requestedRect.maxY){var h;let g=t.size-(l.length+i),y=t.getItem(t.getLastKey());if((y==null?void 0:y.type)==="loader"&&g--,e+=g*d,(y==null?void 0:y.type)==="loader"&&((h=l.at(-1))===null||h===void 0?void 0:h.layoutInfo.type)!=="loader"){let v=this.buildChild(y,this.padding,e,null);l.push(v),e=v.layoutInfo.rect.maxY}break}}return e-=this.gap,e+=o?0:this.padding,this.contentSize=new z(this.virtualizer.visibleRect.width,e),l}isValid(e,t){let i=this.layoutNodes.get(e.key);return!this.invalidateEverything&&!!i&&i.node===e&&t===i.layoutInfo.rect.y&&i.layoutInfo.rect.intersects(this.validRect)&&i.validRect.containsRect(i.layoutInfo.rect.intersection(this.requestedRect))}buildChild(e,t,i,l){if(this.isValid(e,i))return this.layoutNodes.get(e.key);let o=this.buildNode(e,t,i);return o.layoutInfo.parentKey=l??null,o.layoutInfo.allowOverflow=!0,this.layoutNodes.set(e.key,o),o}buildNode(e,t,i){switch(e.type){case"section":return this.buildSection(e,t,i);case"item":return this.buildItem(e,t,i);case"header":return this.buildSectionHeader(e,t,i);case"loader":return this.buildLoader(e,t,i);case"separator":return this.buildItem(e,t,i);default:throw new Error("Unsupported node type: "+e.type)}}buildLoader(e,t,i){let l=new f(t,i,this.padding,0),o=new b("loader",e.key,l);l.width=this.virtualizer.contentSize.width-this.padding-t;var s,a,h;return l.height=e.props.isLoading?(h=(a=(s=this.loaderHeight)!==null&&s!==void 0?s:this.rowHeight)!==null&&a!==void 0?a:this.estimatedRowHeight)!==null&&h!==void 0?h:$:0,{layoutInfo:o,validRect:l.intersection(this.requestedRect)}}buildSection(e,t,i){let l=this.virtualizer.collection,o=this.virtualizer.visibleRect.width-this.padding,s=new f(t,i,o-t,0),a=new b(e.type,e.key,s),h=i,r=0,d=[];for(let y of q.$c5a24bc478652b5f$export$1005530eda016c13(e,l)){var u,g;let v=((g=(u=this.rowHeight)!==null&&u!==void 0?u:this.estimatedRowHeight)!==null&&g!==void 0?g:$)+this.gap;if(i+v<this.requestedRect.y&&!this.isValid(e,i)){i+=v,r++;continue}let w=this.buildChild(y,t,i,a.key);if(i=w.layoutInfo.rect.maxY+this.gap,d.push(w),i>this.requestedRect.maxY){i+=([...q.$c5a24bc478652b5f$export$1005530eda016c13(e,l)].length-(d.length+r))*v;break}}return i-=this.gap,s.height=i-h,{layoutInfo:a,children:d,validRect:a.rect.intersection(this.requestedRect),node:e}}buildSectionHeader(e,t,i){let l=this.virtualizer.visibleRect.width-this.padding,o=this.headingHeight,s=!1;if(o==null){let r=this.layoutNodes.get(e.key),d=r==null?void 0:r.layoutInfo;if(d){let u=this.virtualizer.collection.getItem(e.key),g=this.lastCollection?this.lastCollection.getItem(e.key):null;o=d.rect.height,s=l!==d.rect.width||u!==g||d.estimatedSize}else o=e.rendered?this.estimatedHeadingHeight:0,s=!0}o==null&&(o=$);let a=new f(t,i,l-t,o),h=new b("header",e.key,a);return h.estimatedSize=s,{layoutInfo:h,children:[],validRect:h.rect.intersection(this.requestedRect),node:e}}buildItem(e,t,i){let l=this.virtualizer.visibleRect.width-this.padding-t,o=this.rowHeight,s=!1;if(o==null){let r=this.layoutNodes.get(e.key);r?(o=r.layoutInfo.rect.height,s=l!==r.layoutInfo.rect.width||e!==r.node||r.layoutInfo.estimatedSize):(o=this.estimatedRowHeight,s=!0)}o==null&&(o=$);let a=new f(t,i,l,o),h=new b(e.type,e.key,a);return h.estimatedSize=s,{layoutInfo:h,children:[],validRect:h.rect,node:e}}updateItemSize(e,t){let i=this.layoutNodes.get(e);if(!i)return!1;let l=this.virtualizer.collection,o=i.layoutInfo;if(o.estimatedSize=!1,o.rect.height!==t.height){let s=o.copy();s.rect.height=t.height,i.layoutInfo=s,this.validRect.height=Math.min(this.validRect.height,o.rect.y-this.validRect.y),this.requestedRect.height+=s.rect.height-o.rect.height,this.updateLayoutNode(e,o,s);let a=o.parentKey!=null?l.getItem(o.parentKey):null;for(;a;)this.updateLayoutNode(a.key,o,s),a=a.parentKey!=null?l.getItem(a.parentKey):null;return!0}return!1}updateLayoutNode(e,t,i){let l=this.layoutNodes.get(e);l&&(l.validRect=l.validRect.intersection(this.validRect),l.layoutInfo===t&&(l.layoutInfo=i))}getContentSize(){return this.contentSize}getDropTargetFromPoint(e,t,i){e+=this.virtualizer.visibleRect.x,t+=this.virtualizer.visibleRect.y;let l=new f(e,Math.max(0,t-this.gap),1,Math.max(1,this.gap*2)),o=this.getVisibleLayoutInfos(l),s=null,a=1/0;for(let u of o){if(!u.rect.intersects(l))continue;let g=Math.abs(u.rect.y-t),y=Math.abs(u.rect.maxY-t),v=Math.min(g,y);v<a&&(a=v,s=u.key)}if(s==null||this.virtualizer.collection.size===0)return{type:"root"};let h=this.getLayoutInfo(s);if(!h)return null;let r=h.rect,d={type:"item",key:h.key,dropPosition:"on"};return i(d)?t<=r.y+10&&i({...d,dropPosition:"before"})?d.dropPosition="before":t>=r.maxY-10&&i({...d,dropPosition:"after"})&&(d.dropPosition="after"):t<=r.y+r.height/2&&i({...d,dropPosition:"before"})?d.dropPosition="before":i({...d,dropPosition:"after"})&&(d.dropPosition="after"),d}getDropTargetLayoutInfo(e){let t=this.getLayoutInfo(e.key),i;return e.dropPosition==="before"?i=new f(t.rect.x,t.rect.y-this.dropIndicatorThickness/2,t.rect.width,this.dropIndicatorThickness):e.dropPosition==="after"?i=new f(t.rect.x,t.rect.maxY-this.dropIndicatorThickness/2,t.rect.width,this.dropIndicatorThickness):i=t.rect,new b("dropIndicator",e.key+":"+e.dropPosition,i)}constructor(e={}){super();var t;this.rowHeight=(t=e.rowHeight)!==null&&t!==void 0?t:null;var i;this.estimatedRowHeight=(i=e.estimatedRowHeight)!==null&&i!==void 0?i:null;var l;this.headingHeight=(l=e.headingHeight)!==null&&l!==void 0?l:null;var o;this.estimatedHeadingHeight=(o=e.estimatedHeadingHeight)!==null&&o!==void 0?o:null;var s;this.loaderHeight=(s=e.loaderHeight)!==null&&s!==void 0?s:null,this.dropIndicatorThickness=e.dropIndicatorThickness||2,this.gap=e.gap||0,this.padding=e.padding||0,this.layoutNodes=new Map,this.rootNodes=[],this.lastCollection=null,this.invalidateEverything=!1,this.validRect=new f,this.requestedRect=new f,this.contentSize=new z}}let R=null;function ue(n=!1){if(R===null||n){const e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";const i=document.createElement("div"),l=i.style;return l.width="100px",l.height="100px",e.appendChild(i),document.body.appendChild(e),e.scrollLeft>0?R="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?R="negative":R="positive-ascending"),document.body.removeChild(e),R}return R}function fe(n,e){let{scrollLeft:t}=n;if(e==="rtl"){let{scrollWidth:i,clientWidth:l}=n;switch(ue()){case"negative":t=-t;break;case"positive-descending":t=i-l-t;break}}return t}function ge(n,e){let{contentSize:t,onVisibleRectChange:i,innerStyle:l,onScrollStart:o,onScrollEnd:s,scrollDirection:a="both",...h}=n,r=c.useRef({scrollTop:0,scrollLeft:0,scrollEndTime:0,scrollTimeout:null,width:0,height:0,isScrolling:!1}).current,{direction:d}=W.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),[u,g]=c.useState(!1),y=c.useCallback(p=>{p.target===p.currentTarget&&(n.onScroll&&n.onScroll(p),T.flushSync(()=>{let m=p.currentTarget.scrollTop,H=fe(p.currentTarget,d);r.scrollTop=Math.max(0,Math.min(m,t.height-r.height)),r.scrollLeft=Math.max(0,Math.min(H,t.width-r.width)),i(new f(r.scrollLeft,r.scrollTop,r.width,r.height)),r.isScrolling||(r.isScrolling=!0,g(!0),window.dispatchEvent(new Event("tk.disconnect-observer")),o&&o());let L=Date.now();r.scrollEndTime<=L+50&&(r.scrollEndTime=L+300,r.scrollTimeout!=null&&clearTimeout(r.scrollTimeout),r.scrollTimeout=setTimeout(()=>{r.isScrolling=!1,g(!1),r.scrollTimeout=null,window.dispatchEvent(new Event("tk.connect-observer")),s&&s()},300))}))},[n,d,r,t,i,o,s]);ee.$e9faafb641e167db$export$90fc3a17d93f704c(e,"scroll",y),c.useEffect(()=>()=>{r.scrollTimeout!=null&&clearTimeout(r.scrollTimeout),r.isScrolling&&window.dispatchEvent(new Event("tk.connect-observer"))},[]);let v=c.useRef(!1),w=C.$8ae05eaa5c114e9c$export$7f54fc3180508a52(p=>{let m=e.current;if(!m||v.current)return;v.current=!0;let H=process.env.NODE_ENV==="test"&&!process.env.VIRT_ON,L=Object.getOwnPropertyNames(window.HTMLElement.prototype).includes("clientWidth"),Q=Object.getOwnPropertyNames(window.HTMLElement.prototype).includes("clientHeight"),O=m.clientWidth,P=m.clientHeight,N=H&&!L?1/0:O,E=H&&!Q?1/0:P;(r.width!==N||r.height!==E)&&(r.width=N,r.height=E,p(()=>{i(new f(r.scrollLeft,r.scrollTop,N,E))}),(!H&&O!==m.clientWidth||P!==m.clientHeight)&&(r.width=m.clientWidth,r.height=m.clientHeight,p(()=>{i(new f(r.scrollLeft,r.scrollTop,r.width,r.height))}))),v.current=!1}),_=c.useRef(null),[U,G]=c.useState({});C.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{if(!v.current&&(_.current==null||!t.equals(_.current)))if(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u"){G({}),_.current=t;return}else queueMicrotask(()=>w(T.flushSync));_.current=t}),C.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{w(p=>p())},[U]);let J=c.useCallback(()=>{w(T.flushSync)},[w]);Z.$9daab02d461809db$export$683480f191c0e3ea({ref:e,box:"border-box",onResize:J});let I={padding:0,...h.style};return a==="horizontal"?(I.overflowX="auto",I.overflowY="hidden"):a==="vertical"||t.width===r.width?(I.overflowY="auto",I.overflowX="hidden"):I.overflow="auto",l={width:Number.isFinite(t.width)?t.width:void 0,height:Number.isFinite(t.height)?t.height:void 0,pointerEvents:u?"none":"auto",position:"relative",...l},{scrollViewProps:{...h,style:I},contentProps:{role:"presentation",style:l}}}function ye(n){let{layoutInfo:e,virtualizer:t,ref:i}=n,l=e==null?void 0:e.key,o=c.useCallback(()=>{if(l!=null&&i.current){let s=ve(i.current);t.updateItemSize(l,s)}},[t,l,i]);return C.$f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(()=>{e!=null&&e.estimatedSize&&o()}),{updateSize:o}}function ve(n){let e=n.style.height;n.style.height="";let t=new z(n.scrollWidth,n.scrollHeight);return n.style.height=e,t}function X(n){let{style:e,className:t,layoutInfo:i,virtualizer:l,parent:o,children:s}=n,{direction:a}=W.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7(),h=c.useRef(null);return ye({layoutInfo:i,virtualizer:l,ref:h}),c.createElement("div",{role:"presentation",ref:h,className:t,style:{...pe(i,a,o),...e}},s)}let B=new WeakMap;function pe(n,e,t){let i=e==="rtl"?"right":"left",l=B.get(n);if(l&&l[i]!=null){if(!t)return l;let h=n.rect.y-t.rect.y,r=n.rect.x-t.rect.x;if(l.top===h&&l[i]===r)return l}let o={top:n.rect.y-(t&&!(t.allowOverflow&&n.isSticky)?t.rect.y:0),[i]:n.rect.x-(t&&!(t.allowOverflow&&n.isSticky)?t.rect.x:0),width:n.rect.width,height:n.rect.height};Object.entries(o).forEach(([h,r])=>{Number.isFinite(r)||(o[h]=void 0)});var s;let a={position:n.isSticky?"sticky":"absolute",display:n.isSticky?"inline-block":void 0,overflow:n.allowOverflow?"visible":"hidden",opacity:n.opacity,zIndex:n.zIndex,transform:(s=n.transform)!==null&&s!==void 0?s:void 0,contain:"size layout style",...o};return B.set(n,a),a}const j=c.createContext(null),A=c.createContext(null);function we(n){let{children:e,layout:t,layoutOptions:i}=n,l=c.useMemo(()=>typeof t=="function"?new t:t,[t]),o=c.useMemo(()=>({isVirtualized:!0,layoutDelegate:l,dropTargetDelegate:l.getDropTargetFromPoint?l:void 0,CollectionRoot:me,CollectionBranch:be}),[l]);return c.createElement(Y.$7135fc7d473fd974$export$4feb769f8ddf26c5.Provider,{value:o},c.createElement(A.Provider,{value:{layout:l,layoutOptions:i}},e))}function me({collection:n,persistedKeys:e,scrollRef:t,renderDropIndicator:i}){var l;let{layout:o,layoutOptions:s}=c.useContext(A),a=(l=o.useLayoutOptions)===null||l===void 0?void 0:l.call(o),h=de({layout:o,collection:n,renderView:(d,u)=>{var g;return u==null||(g=u.render)===null||g===void 0?void 0:g.call(u,u)},onVisibleRectChange(d){let u=t==null?void 0:t.current;u&&(u.scrollLeft=d.x,u.scrollTop=d.y)},persistedKeys:e,layoutOptions:c.useMemo(()=>s&&a?{...s,...a}:s||a,[s,a])}),{contentProps:r}=ge({onVisibleRectChange:h.setVisibleRect,contentSize:h.contentSize,onScrollStart:h.startScrolling,onScrollEnd:h.endScrolling},t);return c.createElement("div",r,c.createElement(j.Provider,{value:h},F(null,h.visibleViews,i)))}function be({parent:n,renderDropIndicator:e}){let i=c.useContext(j).virtualizer.getVisibleView(n.key);return F(i,Array.from(i.children),e)}function F(n,e,t){return e.map(i=>xe(n,i,t))}function xe(n,e,t){let i=c.createElement(X,{key:e.key,layoutInfo:e.layoutInfo,virtualizer:e.virtualizer,parent:n==null?void 0:n.layoutInfo},e.rendered),{collection:l,layout:o}=e.virtualizer,s=e.content;return(s==null?void 0:s.type)==="item"&&t&&o.getDropTargetLayoutInfo&&(i=c.createElement(c.Fragment,{key:e.key},K(n,e,{type:"item",key:e.content.key,dropPosition:"before"},t),i,Y.$7135fc7d473fd974$export$2dbbd341daed716d(l,s,a=>K(n,e,a,t)))),i}function K(n,e,t,i){let l=i(t);if(l){let o=e.virtualizer.layout.getDropTargetLayoutInfo(t);l=c.createElement(X,{layoutInfo:o,virtualizer:e.virtualizer,parent:n==null?void 0:n.layoutInfo},l)}return l}class Ie extends ce{getContentSize(){var t;const e=(t=this==null?void 0:this.virtualizer)==null?void 0:t.collection.getKeys();return Array.from(e||[]).forEach(i=>{this.getLayoutInfo(i)}),this.contentSize}}const $e="_listBox_1f4kp_7",Re="_listBoxPopover_1f4kp_19",Se="_listBoxSectionHeading_1f4kp_31",ze="_listBoxButton_1f4kp_40",He="_listBoxItem_1f4kp_52",k={listBox:$e,listBoxPopover:Re,listBoxSectionHeading:Se,listBoxButton:ze,listBoxItem:He},Ce=({className:n,children:e,...t})=>S.jsx(we,{layout:Ie,layoutOptions:{headingHeight:44},children:S.jsx(V.$eed445e0843c11d0$export$41f133550aa26f48,{className:M.clsx(k.listBox,n),...t,children:e})}),ke=({children:n,className:e,...t})=>S.jsx(V.$eed445e0843c11d0$export$a11e76429ed99b4,{className:M.clsx(k.listBoxItem,e),...t,children:n}),_e=({className:n,children:e,...t})=>S.jsx(te.$07b14b47974efb58$export$5b6b19405a83ff9d,{className:M.clsx(n,k.listBoxPopover),offset:0,...t,children:e}),Le=({children:n,name:e,...t})=>S.jsxs(V.$eed445e0843c11d0$export$dca12b0bb56e4fc,{...t,children:[S.jsx(ie.$72a5793c14baf454$export$8b251419efc915eb,{className:k.listBoxSectionHeading,children:e}),n]});exports.ListBox=Ce;exports.ListBoxItem=ke;exports.ListBoxPopover=_e;exports.ListBoxSection=Le;exports.styles=k;
|