@aiworker/web 1.23.0 → 1.23.2

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.
Files changed (152) hide show
  1. package/dist/assets/{CodeMirrorCommentWidgets-B1Gizi3a.js → CodeMirrorCommentWidgets-COGJG0Iv.js} +1 -1
  2. package/dist/assets/DiffView-BviYY3zL.js +4 -0
  3. package/dist/assets/{DirtyBranchSwitchDialog-aig6zJjg.js → DirtyBranchSwitchDialog-C26DvfVJ.js} +1 -1
  4. package/dist/assets/FilesView-D0ZU_nCt.js +13 -0
  5. package/dist/assets/{GitView-BXsS3jG6.js → GitView-CYgiDRH-.js} +4 -4
  6. package/dist/assets/{JsonTreeView-D_hpXBnF.js → JsonTreeView-GsV9UScz.js} +1 -1
  7. package/dist/assets/{LinearIssuesView-BoUiLQG1.js → LinearIssuesView-shqUS8nl.js} +1 -1
  8. package/dist/assets/{MarkdownImageGallery-B_B_a9KS.js → MarkdownImageGallery-CQSTFp6m.js} +1 -1
  9. package/dist/assets/{MarkdownRendererImpl-xgyyLiBM.js → MarkdownRendererImpl-DJWP3A8X.js} +2 -2
  10. package/dist/assets/{OnboardingScreen-DIp84OWt.js → OnboardingScreen-CTuu4lgo.js} +1 -1
  11. package/dist/assets/{PatchDiff-8p6nLJaU.js → PatchDiff-Dp53v2pl.js} +1 -1
  12. package/dist/assets/{PierreDiffViewer-DjC8nTk9.js → PierreDiffViewer-B5l0djPS.js} +1 -1
  13. package/dist/assets/PlanView-CLUWkGiG.js +5 -0
  14. package/dist/assets/SettingsView-CojPQVHx.js +28 -0
  15. package/dist/assets/{SettingsWindow-Cpb4hM6q.js → SettingsWindow-DbgEnZ6T.js} +1 -1
  16. package/dist/assets/{ToolOutputDialog-DfaKZXNU.js → ToolOutputDialog-Du-RZj-a.js} +6 -6
  17. package/dist/assets/{ToolPartDiffPreview-DtZLzrSK.js → ToolPartDiffPreview-HBLSokoe.js} +2 -2
  18. package/dist/assets/{VirtualizedFileDiff-C8i9HpTB.js → VirtualizedFileDiff-Bzp3hClU.js} +4 -4
  19. package/dist/assets/WalkthroughView-CpgA4s9w.js +4 -0
  20. package/dist/assets/{computeVirtualFileMetrics-BBI7ZwrC.js → computeVirtualFileMetrics-CI1PC_z2.js} +2 -2
  21. package/dist/assets/de-BX8b4hDD.js +10 -0
  22. package/dist/assets/es-e98cS-yM.js +16 -0
  23. package/dist/assets/fr-BOiqxJAs.js +14 -0
  24. package/dist/assets/index-BD8ILbxF.js +40 -0
  25. package/dist/assets/{index-jXSK5RrB.js → index-Cmn74sw-.js} +1 -1
  26. package/dist/assets/index-zhgg-SDz.css +1 -0
  27. package/dist/assets/{isDiffPlainText-B_x_rVon.js → isDiffPlainText-DVralkU-.js} +1 -1
  28. package/dist/assets/{isFilePlainText-DW_xMer1.js → isFilePlainText-CgTREsRX.js} +1 -1
  29. package/dist/assets/ja-aoO55hGu.js +16 -0
  30. package/dist/assets/{ko-idhXGF8j.js → ko-BGzFLogk.js} +3 -3
  31. package/dist/assets/{main-CzdPuL0s.js → main-BgfXQ-4g.js} +2 -2
  32. package/dist/assets/main-DGYUWmIt.js +930 -0
  33. package/dist/assets/{markdownCore-Cn4Tyejo.js → markdownCore-BesaNs_G.js} +3 -3
  34. package/dist/assets/{miniChat-CCkqKOLp.js → miniChat-DHKXp-_I.js} +2 -2
  35. package/dist/assets/{mobile-mvxTo055.js → mobile-lXQ08VnX.js} +2 -2
  36. package/dist/assets/patchFileDiff-i1lTtNbn.js +13 -0
  37. package/dist/assets/{pl-CGZWUqZJ.js → pl-B5x19laq.js} +3 -3
  38. package/dist/assets/pt-BR-C3oU51Il.js +16 -0
  39. package/dist/assets/renderElectronMiniChatApp-CuO4ue6B.js +2 -0
  40. package/dist/assets/renderMobileApp-B3zFlHy4.js +25 -0
  41. package/dist/assets/runtimeEndpointReset-BLzrtrmj.js +41 -0
  42. package/dist/assets/scheduledTasksApi-BEuUF_cj.js +1 -0
  43. package/dist/assets/{shikiHighlight-CRl0SUC9.js → shikiHighlight-ctlcPvvx.js} +1 -1
  44. package/dist/assets/surface-COKb77Ua.js +1 -0
  45. package/dist/assets/tr-C0QQa7et.js +7 -0
  46. package/dist/assets/uk-CqLSe9wT.js +16 -0
  47. package/dist/assets/{useAppFontEffects-CPKeOpUo.js → useAppFontEffects-B6OfEypo.js} +153 -155
  48. package/dist/assets/useGitComparison-BXZXEAW6.js +1 -0
  49. package/dist/assets/{useInlineCommentController-BiWz4AVb.js → useInlineCommentController-CgbrpEWu.js} +2 -2
  50. package/dist/assets/{useRootScrollLock-BS4-kr7P.js → useRootScrollLock-Me41OjBT.js} +1 -1
  51. package/dist/assets/{vendor-base-ui-DdV8vhHn.js → vendor-base-ui-BY_5qla_.js} +1 -1
  52. package/dist/assets/{vendor-codemirror-language-data-Bg4AEeCr.js → vendor-codemirror-language-data-SJuFp0a0.js} +2 -2
  53. package/dist/assets/vendor-legendapp-list-BuBPBC3R.js +1 -0
  54. package/dist/assets/{vendor-zod-BPAANqvH.js → vendor-zod-B6551dwG.js} +2 -2
  55. package/dist/assets/{web-components-z7hfnS8n.js → web-components-D8GS8Ork.js} +1 -1
  56. package/dist/assets/zh-CN-iJEie4d6.js +16 -0
  57. package/dist/assets/zh-TW-CyslEwlK.js +16 -0
  58. package/dist/index.html +4 -4
  59. package/dist/mini-chat.html +4 -4
  60. package/dist/mobile.html +4 -4
  61. package/package.json +1 -1
  62. package/server/index.js +3 -13
  63. package/server/lib/agent-memory/runtime.js +7 -2
  64. package/server/lib/agent-memory/runtime.test.js +22 -0
  65. package/server/lib/event-stream/DOCUMENTATION.md +3 -0
  66. package/server/lib/event-stream/global-hub.js +29 -4
  67. package/server/lib/event-stream/global-hub.test.js +22 -0
  68. package/server/lib/event-stream/global-ws-bridge.js +15 -18
  69. package/server/lib/event-stream/protocol.js +21 -7
  70. package/server/lib/event-stream/runtime.js +9 -6
  71. package/server/lib/event-stream/runtime.test.js +60 -0
  72. package/server/lib/git/DOCUMENTATION.md +10 -1
  73. package/server/lib/git/routes.js +21 -8
  74. package/server/lib/git/routes.test.js +78 -0
  75. package/server/lib/git/service.js +159 -4
  76. package/server/lib/git/service.test.js +74 -0
  77. package/server/lib/github/DOCUMENTATION.md +5 -0
  78. package/server/lib/github/routes.js +2 -2
  79. package/server/lib/message-queue/DOCUMENTATION.md +7 -0
  80. package/server/lib/message-queue/runtime.js +13 -0
  81. package/server/lib/message-queue/runtime.test.js +31 -1
  82. package/server/lib/notifications/DOCUMENTATION.md +1 -1
  83. package/server/lib/notifications/emitter-runtime.js +4 -3
  84. package/server/lib/opencode/DOCUMENTATION.md +18 -4
  85. package/server/lib/opencode/env-runtime.js +5 -1
  86. package/server/lib/opencode/env-runtime.test.js +72 -0
  87. package/server/lib/opencode/feature-routes-runtime.js +15 -1
  88. package/server/lib/opencode/lifecycle.js +4 -3
  89. package/server/lib/opencode/lifecycle.test.js +29 -0
  90. package/server/lib/opencode/managed-plugin-config.js +1 -1
  91. package/server/lib/opencode/proxy.js +33 -0
  92. package/server/lib/opencode/settings-helpers.js +3 -0
  93. package/server/lib/opencode/settings-helpers.test.js +11 -1
  94. package/server/lib/opencode/settings-registry.json +3 -0
  95. package/server/lib/opencode/settings-runtime.js +36 -9
  96. package/server/lib/opencode/settings-runtime.test.js +158 -2
  97. package/server/lib/project-context/DOCUMENTATION.md +13 -3
  98. package/server/lib/project-context/runtime.js +8 -2
  99. package/server/lib/project-context/runtime.test.js +54 -0
  100. package/server/lib/projects/DOCUMENTATION.md +2 -1
  101. package/server/lib/projects/project-config.js +38 -9
  102. package/server/lib/projects/project-config.test.js +97 -0
  103. package/server/lib/projects/project-id.js +26 -0
  104. package/server/lib/relay/DOCUMENTATION.md +20 -0
  105. package/server/lib/relay/host-client.js +7 -0
  106. package/server/lib/relay/host-client.test.js +14 -0
  107. package/server/lib/scheduled-tasks/DOCUMENTATION.md +9 -1
  108. package/server/lib/scheduled-tasks/issue-2710-double-execution.test.js +28 -0
  109. package/server/lib/scheduled-tasks/runtime.js +12 -2
  110. package/server/lib/scheduled-tasks/runtime.test.js +53 -0
  111. package/server/lib/session-assist/DOCUMENTATION.md +131 -66
  112. package/server/lib/session-assist/context.js +127 -0
  113. package/server/lib/session-assist/context.test.js +132 -0
  114. package/server/lib/session-assist/prompt.js +54 -0
  115. package/server/lib/session-assist/runtime.js +111 -257
  116. package/server/lib/session-assist/runtime.test.js +203 -0
  117. package/server/lib/walkthrough/DOCUMENTATION.md +15 -5
  118. package/server/lib/walkthrough/pr-source.test.js +21 -0
  119. package/server/lib/walkthrough/pull-request.js +7 -4
  120. package/server/lib/walkthrough/pull-request.test.js +16 -0
  121. package/server/lib/walkthrough/routes.js +19 -0
  122. package/server/lib/walkthrough/routes.test.js +26 -0
  123. package/server/lib/walkthrough/sources.js +13 -2
  124. package/server/opencode-worktree-readiness.test.js +130 -0
  125. package/dist/assets/DiffView-DXjVsEOw.js +0 -4
  126. package/dist/assets/FilesView-CJdG0-wk.js +0 -17
  127. package/dist/assets/PlanView-CJTmOF6I.js +0 -5
  128. package/dist/assets/SettingsView-DD-JqIJx.js +0 -28
  129. package/dist/assets/WalkthroughView-DeKMvZlL.js +0 -4
  130. package/dist/assets/de-DCrsQ5zS.js +0 -10
  131. package/dist/assets/es-Dwv4YfH6.js +0 -16
  132. package/dist/assets/fr-BCWg4Cnx.js +0 -14
  133. package/dist/assets/index-B68h5S5B.css +0 -1
  134. package/dist/assets/index-DVwMarHI.js +0 -39
  135. package/dist/assets/ja-Bruw3RYC.js +0 -16
  136. package/dist/assets/main-BkyaQhJX.js +0 -930
  137. package/dist/assets/patchFileDiff-Csk4iNUi.js +0 -13
  138. package/dist/assets/pt-BR-B8V7u7tA.js +0 -16
  139. package/dist/assets/renderElectronMiniChatApp-BxoyujA5.js +0 -2
  140. package/dist/assets/renderMobileApp-B48CsP4r.js +0 -25
  141. package/dist/assets/runtimeEndpointReset-Bg5gx18H.js +0 -17
  142. package/dist/assets/scheduledTasksApi-BW0Etzwz.js +0 -1
  143. package/dist/assets/surface-oMvhsog3.js +0 -1
  144. package/dist/assets/tr-BK_KiO2V.js +0 -7
  145. package/dist/assets/uk-CG74xV8N.js +0 -16
  146. package/dist/assets/useGitComparison-DH220WmO.js +0 -1
  147. package/dist/assets/vendor-legendapp-list-gg7YLRW7.js +0 -1
  148. package/dist/assets/zh-CN-T4AXofZI.js +0 -16
  149. package/dist/assets/zh-TW-Dte40sxp.js +0 -16
  150. package/server/lib/mcp-reconnect/DOCUMENTATION.md +0 -55
  151. package/server/lib/mcp-reconnect/runtime.js +0 -122
  152. package/server/lib/mcp-reconnect/runtime.test.js +0 -140
@@ -1 +0,0 @@
1
- import{R as i,r as E}from"./vendor-react-BUCujlKS.js";import{f as M,ai as y,hh as D,hi as G,hj as T,hk as P}from"./useAppFontEffects-CPKeOpUo.js";import{a as C}from"./index-DVwMarHI.js";const _=(e,n)=>!!e&&n!==null&&e!==n,j=(e,n,a,p)=>a?e===null||p&&n===null?!0:n!==null&&e===n:!1,F=(e,n)=>e==="branch"&&!n?"working":e,J=(e,n,a,p,f,g)=>{const s=i.useRef({directory:"",attempts:0}),[r,k]=i.useState(()=>({directory:"",exhausted:!1})),m=i.useRef(f);m.current=f;const R=!!e&&r.directory===e&&r.exhausted;return i.useEffect(()=>{if(!e||!n||p||a)return;const u=s.current.directory===e?s.current.attempts:0;if(u>=g){r.directory===e&&r.exhausted||k({directory:e,exhausted:!0});return}s.current={directory:e,attempts:u+1},m.current()},[e,r,p,n,a,g]),R},K=(e,n,a,p,f="")=>{const[g,s]=i.useState(()=>new Map),r=i.useRef(g);r.current=g;const k=i.useRef(new Map),m=i.useRef(null),R=i.useRef(a);R.current=a;const u=i.useCallback((c,h)=>{const o=new Map(r.current);if(h===null){if(!o.delete(c))return}else o.set(c,h);r.current=o,s(o)},[]);return i.useEffect(()=>{m.current=e,k.current.clear(),r.current=new Map,s(r.current)},[e]),i.useEffect(()=>{const c=R.current;if(!e||!c||!n)return;let h=!1;const o=new Set,b=k.current;for(const t of n.split("\0"))r.current.has(t)&&b.get(t)===f||(o.add(t),r.current.has(t)||u(t,p),c(t).then(d=>{h||(o.delete(t),b.set(t,f),u(t,d))}).catch(()=>{h||(o.delete(t),b.delete(t),u(t,null))}));return()=>{h=!0;for(const t of o)b.has(t)||u(t,null)}},[n,p,e,f,u]),m.current===e?g:new Map};function L(e,n,a=!0,p=""){const{t:f}=M(),g=y(t=>t.runtimeKey),s=e&&n?JSON.stringify([g,e,n]):null,r=E.useRef({key:s,source:n,enabled:a});r.current={key:s,source:n,enabled:a};const[k,m]=E.useState(null),R=E.useRef(0),u=E.useCallback(async()=>{const{key:t,source:d,enabled:v}=r.current;if(!a||!v||!s||t!==s||!e||!d)return;const w=++R.current,x=C();m(l=>l?.key===s&&l.status==="ready"?l:{key:s,status:"loading"});try{const l=d.kind==="branch"?(await D(e,{base:d.baseRef,head:d.headRef,includeWorkingTree:!0})).map(S=>({...S,insertions:0,deletions:0})):(await G(e,d.hash)).files.map(S=>({path:S.path,status:S.changeType,previousPath:S.previousPath,insertions:S.insertions,deletions:S.deletions}));if(R.current!==w||C()!==x)return;m({key:s,status:"ready",files:l})}catch(l){if(R.current!==w||C()!==x)return;m({key:s,status:"error",message:l instanceof Error?l.message:f("diffView.state.failedToLoadDiff")})}},[e,a,s,f]);E.useEffect(()=>(u(),()=>{R.current+=1}),[u,p]);const c=k?.key===s?k:null,h=c?.status==="ready"?c.files:null,o=E.useMemo(()=>new Map((h??[]).map(t=>[t.path,t])),[h]),b=E.useCallback(async(t,d=3)=>{const{key:v,source:w,enabled:x}=r.current,l=o.get(t);if(!e||v!==s||!w||!l||!a||!x)throw new Error(f("diffView.state.failedToLoadDiff"));return w.kind==="branch"?T(e,{base:w.baseRef,head:w.headRef,path:t,contextLines:d,includeWorkingTree:!0}):P(e,{hash:w.hash,path:t,previousPath:l.previousPath,contextLines:d})},[e,a,o,s,f]);return{key:s,files:h,loading:!!(a&&s&&(!c||c.status==="loading")),error:c?.status==="error"?c.message:null,refresh:u,fetchDiff:b}}export{K as a,_ as b,J as c,F as d,j as i,L as u};
@@ -1 +0,0 @@
1
- import{r as p,c as yi}from"./vendor-react-BUCujlKS.js";import{s as Ci}from"./vendor-use-sync-external-store-D6wYuSt-.js";var qn={};p.forwardRef(function(t,n){return p.createElement("div",{ref:n,...t})});var _n=p.forwardRef(function(t,n){return p.createElement("div",{ref:n,...t})}),Te=_n,Qe={OS:"web"};function gt(e,t){return t===void 0?e:Math.max(0,Math.min(t,e))}function Ei(e,t){return t===void 0||!Number.isFinite(t)||!Number.isFinite(e.scrollLength)||t<=e.scrollLength?t!==void 0&&Number.isFinite(t)&&Number.isFinite(e.scrollLength)?0:void 0:Math.max(0,t-e.scrollLength)}function Ai(){return"normal"}function Vl(e){var t;return(t=e?.horizontalRTLScrollType)!=null?t:Ai()}function Bl(e){var t;return(t=e?.rtl)!=null?t:!1}function ct(e){return fo(e?.props)}function fo(e){return!!e?.horizontal&&Bl(e)}function vo(e){return e?.horizontal?(fo(e)?e.stylePaddingLeft:e.stylePaddingRight)||0:e?.stylePaddingBottom||0}function Vo(e,t){return t&&(ct(e)?t.left:t.right)||0}function jl(e,t,n,o){return!ct(e)||o===void 0||!Number.isFinite(o)?t:Math.max(0,o-t-n)}function bi(e,t,n){if(!e||!ct(e))return t;const o=Ei(e,n),i=gt(t,o),l=Vl(e);return l==="negative"?i===0?0:-i:l==="inverted"?o===void 0?i:gt(o-i,o):i}function Wl(e,t,n){if(!ct(e))return e.horizontalRTLScrollType=void 0,t;const o=Ei(e,n);if(t<0)return e.horizontalRTLScrollType="negative",gt(-t,o);if(o===void 0)return t;const i=t,l=o-t;if(!Number.isFinite(l))return e.horizontalRTLScrollType="normal",i;const r=e.horizontalRTLScrollType;if(r==="inverted")return gt(l,o);if(r==="normal")return gt(i,o);if(!e.hasScrolled){const d=Ai();return e.horizontalRTLScrollType=d,gt(i,o)}const s=e.scroll,a=Math.abs(i-s),u=Math.abs(l-s)+.5<a;return e.horizontalRTLScrollType=u?"inverted":"normal",gt(u?l:i,o)}var Hl=e=>e,Pn=p.createContext(null),wi="\0",Kl=0;function Ul({children:e}){const[t]=p.useState(()=>({animatedScrollY:Hl(0),columnWrapperStyle:void 0,containerLayoutTriggers:new Map,contextNum:Kl++,listeners:new Map,mapViewabilityAmountCallbacks:new Map,mapViewabilityAmountValues:new Map,mapViewabilityCallbacks:new Map,mapViewabilityConfigStates:new Map,mapViewabilityValues:new Map,pendingContainerIds:void 0,positionListeners:new Map,scrollAxisGap:0,state:void 0,values:new Map([["alignItemsAtEndPadding",0],["containerLayoutEpoch",0],["stylePaddingTop",0],["headerSize",0],["numContainers",0],["activeStickyIndex",-1],["isAtEnd",!1],["isAtStart",!1],["isNearEnd",!1],["isNearStart",!1],["isWithinMaintainScrollAtEndThreshold",!1],["adaptiveRender","normal"],["totalSize",0],["scrollAdjustPending",0]]),viewRefs:new Map}));return p.createElement(Pn.Provider,{value:t},e)}function Fe(){return p.useContext(Pn)}function Ri(e,t){if(!e){const i=[];return{get:()=>i,subscribe:()=>()=>{}}}let n=[],o=[];return{get:()=>{const i=[];let l=!1;for(let r=0;r<t.length;r++){const s=C(e,t[r]);i.push(s),s!==o[r]&&(l=!0)}return o=i,l&&(n=i),n},subscribe:i=>{const l=[];for(const r of t)l.push(Ze(e,r,i));return()=>{for(const r of l)r()}}}}function $l(e){return e.length===1?e[0]:e.join(wi)}function ql(e){return e.split(wi)}function Ze(e,t,n){const{listeners:o}=e;let i=o.get(t);return i||(i=new Set,o.set(t,i)),i.add(n),()=>i.delete(n)}function C(e,t){const{values:n}=e;return n.get(t)}function _(e,t,n){const{listeners:o,values:i}=e;if(i.get(t)!==n){i.set(t,n);const l=o.get(t);if(l)for(const r of l)r(n)}}function Gl(e,t,n){const{positionListeners:o}=e;let i=o.get(t);return i||(i=new Set,o.set(t,i)),i.add(n),()=>i.delete(n)}function Yl(e,t,n){const{positionListeners:o}=e,i=o.get(t);if(i)for(const l of i)l(n)}function Pe(e){const t=p.useContext(Pn),n=$l(e),{subscribe:o,get:i}=p.useMemo(()=>Ri(t,ql(n)),[t,n]);return Ci.useSyncExternalStore(o,i,i)}function xl(e,t){const n=p.useContext(Pn),{subscribe:o,get:i}=p.useMemo(()=>Ri(n,[e]),[n,e]),l=p.useCallback(()=>t(i()[0]),[i,t]);return Ci.useSyncExternalStore(o,l,l)}function Xl(e){return Math.max(0,e??0)}function It(e,t){var n;const o=e.state,{props:i}=o,l=i.horizontal,r=i.contentInset,s=r??o.nativeContentInset,a=(l?Vo(o,s):s?.bottom)||0,c=Xl(t??i.contentInsetEndAdjustment),u=C(e,"anchoredEndSpaceSize"),d=i.anchoredEndSpace&&u?u:0,h=(n=o.contentInsetOverride)!=null?n:void 0,v=a+c;if(h){const f={bottom:0,left:0,right:0,...s,...h};return Math.max(((l?Vo(o,f):f.bottom)||0)+c,d)}return Math.max(v,d)}function Ce(e){var t,n;const{values:o,state:i}=e,l=i.props.horizontal?i.props.stylePaddingLeft||0:o.get("stylePaddingTop")||0,r=i.props.horizontal?i.props.stylePaddingRight||0:i.props.stylePaddingBottom||0,s=o.get("alignItemsAtEndPadding")||0,a=o.get("headerSize")||0,c=o.get("footerSize")||0,u=It(e),d=(n=(t=i.pendingTotalSize)!=null?t:i.totalSize)!=null?n:o.get("totalSize"),h=Math.max(0,d-(i.props.data.length>0?e.scrollAxisGap:0));return a+c+h+l+s+r+(u||0)}var Mt=({children:e})=>p.createElement(_n,{style:{alignItems:"center",flexDirection:"row",justifyContent:"space-between"}},e);p.memo(function(){const t=Fe(),[n=0,o=0,i=0,l=0,r=0,s=0,a=!1]=Pe(["totalSize","scrollAdjust","debugRawScroll","debugComputedScroll","numContainers","numContainersPooled","isAtEnd"]),c=Ce(t),[,u]=p.useReducer(d=>d+1,0);return Zl(()=>{u()},100),p.createElement(_n,{pointerEvents:"none",style:{backgroundColor:"#FFFFFFCC",borderRadius:4,padding:4,paddingBottom:4,paddingLeft:4,position:"absolute",right:0,top:0}},p.createElement(Mt,null,p.createElement(Te,null,"TotalSize:"),p.createElement(Te,null,n.toFixed(2))),p.createElement(Mt,null,p.createElement(Te,null,"ContentSize:"),p.createElement(Te,null,c.toFixed(2))),p.createElement(Mt,null,p.createElement(Te,null,"At end:"),p.createElement(Te,null,String(a))),p.createElement(Mt,null,p.createElement(Te,null,"ScrollAdjust:"),p.createElement(Te,null,o.toFixed(2))),p.createElement(Mt,null,p.createElement(Te,null,"RawScroll: "),p.createElement(Te,null,i.toFixed(2))),p.createElement(Mt,null,p.createElement(Te,null,"ComputedScroll: "),p.createElement(Te,null,l.toFixed(2))))});function Zl(e,t){p.useEffect(()=>{const n=setInterval(e,t);return()=>clearInterval(n)},[t])}var ho=!0,_i=new WeakMap;function Jl(e){return _i.get(e)}function Ql(e,t){_i.set(e,t)}var er=typeof __DEV__<"u"?__DEV__:void 0,Bo,jo=typeof process<"u"&&typeof qn=="object"&&qn?(Bo="production")!=null?Bo:qn.MODE:void 0,Wo=typeof jo=="string"?jo.toLowerCase()!=="production":void 0,Ho,_e=(Ho=Wo??er)!=null?Ho:!1,zt=-1e7,Pi=1,tr=_e&&!1,nr=_e&&!1;function Tn({scheduledWork:e}){e.cancel("checkFinishedScrollFrame"),e.cancel("checkFinishedScrollRetryFrame"),e.cancel("checkFinishedScrollFallback"),e.cancel("platformScrollCompletion")}function Ti(e){var t,n;const o=(n=e.pendingScrollResolve)!=null?n:(t=e.pendingScrollToEnd)==null?void 0:t.resolve;e.pendingScrollResolve=void 0,e.pendingScrollToEnd=void 0,o?.()}function Ko(e){Tn(e),e.scheduledWork.cancel("imperativeScrollReady"),e.scrollingTo=void 0,e.scrollTargetPinnedRange=void 0,Ti(e)}function or(e,t,n){return{...t,nativeEvent:{...t.nativeEvent,contentOffset:e.props.horizontal?{x:n,y:0}:{x:0,y:n}}}}function ir(e,t){var n,o,i,l;const r=e.state,s=r.deferredPublicOnScrollEvent;r.deferredPublicOnScrollEvent=void 0,s&&((l=(i=r.props).onScroll)==null||l.call(i,or(r,s,(o=(n=t??r.scrollPending)!=null?n:r.scroll)!=null?o:0)))}var Gn=1;function lr(e){return!!(e?.didDispatchNativeScroll||e?.didRetrySilentInitialScroll||e?.watchdog)}function Uo(e){e.initialScrollSession=void 0}function Qn(e){const{bootstrap:t,completion:n,kind:o,previousDataLength:i}=e;return o==="offset"?{completion:n,kind:o,previousDataLength:i}:{bootstrap:t,completion:n,kind:o,previousDataLength:i}}function mn(e,t=(n=>(n=(o=>(o=e.initialScrollSession)==null?void 0:o.kind)())!=null?n:"bootstrap")()){var n,o;return e.initialScrollSession?e.initialScrollSession.kind!==t&&(e.initialScrollSession=Qn({bootstrap:e.initialScrollSession.kind==="bootstrap"?e.initialScrollSession.bootstrap:void 0,completion:e.initialScrollSession.completion,kind:t,previousDataLength:e.initialScrollSession.previousDataLength})):e.initialScrollSession=Qn({completion:{},kind:t,previousDataLength:0}),(o=(n=e.initialScrollSession).completion)!=null||(n.completion={}),e.initialScrollSession.completion}var Ln={didDispatchNativeScroll(e){var t,n;return!!((n=(t=e.initialScrollSession)==null?void 0:t.completion)!=null&&n.didDispatchNativeScroll)},didRetrySilentInitialScroll(e){var t,n;return!!((n=(t=e.initialScrollSession)==null?void 0:t.completion)!=null&&n.didRetrySilentInitialScroll)},markInitialScrollNativeDispatch(e){mn(e).didDispatchNativeScroll=!0},markSilentInitialScrollRetry(e){mn(e).didRetrySilentInitialScroll=!0},resetFlags(e){if(!e.initialScrollSession)return;const t=mn(e,e.initialScrollSession.kind);t.didDispatchNativeScroll=void 0,t.didRetrySilentInitialScroll=void 0}},ye={clear(e){ye.set(e,void 0)},didReachTarget(e,t){return Math.abs(e-t.targetOffset)<=Gn},get(e){var t,n;return(n=(t=e.initialScrollSession)==null?void 0:t.completion)==null?void 0:n.watchdog},hasNonZeroTargetOffset(e){return e!==void 0&&e>Gn},isAtZeroTargetOffset(e){return e<=Gn},set(e,t){var n,o;if(!t&&!((o=(n=e.initialScrollSession)==null?void 0:n.completion)!=null&&o.watchdog))return;const i=mn(e);i.watchdog=t?{startScroll:t.startScroll,targetOffset:t.targetOffset}:void 0}};function et(e,t={}){var n,o,i,l;const r=e.initialScrollSession,s=(n=t.kind)!=null?n:r?.kind,a=r?.completion,c=r?.kind==="bootstrap"?r.bootstrap:void 0,u=s==="bootstrap"?t.bootstrap===null?void 0:(o=t.bootstrap)!=null?o:c:void 0;if(!s||!e.initialScroll&&!u&&!lr(a))return Uo(e);const d=(l=(i=t.previousDataLength)!=null?i:r?.previousDataLength)!=null?l:0;return e.initialScrollSession=Qn({bootstrap:u,completion:a,kind:s,previousDataLength:d}),e.initialScrollSession}var rr=1.3;function eo(e,t,n){const o=Math.abs(e);return!t&&n>0&&o>=n*rr||!t&&n<=0&&o>0}var Li=(e,t,n,o,i,l,r,s)=>{const a=Math.abs(e),c=t||n>0&&a<=n,u=()=>{s({atThreshold:t,contentSize:l.contentSize,dataLength:l.dataLength,scrollPosition:l.scrollPosition})};return o?eo(e,t,n)?(s(void 0),!1):(c&&(!i||i.atThreshold!==t||i.contentSize!==l.contentSize||i.dataLength!==l.dataLength)&&u(),!0):c?(r(e),u(),!0):!1};function sr(e,t){const n=e.state;t==="start"?(n.isStartReached=!1,n.startReachedSnapshot=void 0):(n.isEndReached=!1,n.endReachedSnapshot=void 0)}function Mi(e){const t=e.state;if(!t.edgeReachedGate)return;const n=Ce(e),o=n-t.scroll-t.scrollLength-It(e),i=n<t.scrollLength,l=t.props.onStartReachedThreshold*t.scrollLength,r=t.props.onEndReachedThreshold*t.scrollLength,s=eo(t.scroll,!1,l),a=eo(o,i,r);s&&a&&(t.edgeReachedGate=void 0)}function zi(e,t,n,o){return!e.state.edgeReachedGate||n===t||!!o}function Oi(e){e.state.edgeReachedGate="closed"}function $o(e){e.state.edgeReachedGate&&(e.state.edgeReachedGate="prepared")}function ar(e,t){const n=e.state;if(n.edgeReachedGate!=="prepared")return;const o=t<0?"start":"end";return n.edgeReachedGate="closed",sr(e,o),o}function Yt(e){return!!e?.initialScroll&&!e.didFinishInitialScroll}function ki(e,t,n){var o;const i=e.state;if(!i)return;const{queuedInitialLayout:l,scrollLength:r,scroll:s,maintainingScrollAtEnd:a,props:{maintainScrollAtEndThreshold:c,onEndReachedThreshold:u}}=i,d=Ce(e);if(Mi(e),i.props.data.length===0&&r>0&&d<=r){_(e,"isAtEnd",!0),_(e,"isNearEnd",!0),_(e,"isWithinMaintainScrollAtEndThreshold",!0);return}if(d>0&&l){const h=It(e),v=d-s-r-h,f=d<r;_(e,"isAtEnd",f||v<=Pi),_(e,"isNearEnd",f||v<=u*r),_(e,"isWithinMaintainScrollAtEndThreshold",f||v<=c*r||i.pendingMaintainScrollAtEnd||a==="animated"||a==="instant"),Yt(i)||a||(i.isEndReached=Li(v,f,u*r,i.isEndReached,i.endReachedSnapshot,{contentSize:d,dataLength:(o=i.props.data)==null?void 0:o.length,scrollPosition:s},m=>{var g,I;zi(e,"end",t,n)&&(Oi(e),(I=(g=i.props).onEndReached)==null||I.call(g,{distanceFromEnd:m}))},m=>{i.endReachedSnapshot=m}))}}function cr(e,t,n){const o=e?.state;if(!o)return;const{isStartReached:i,props:{data:l,onStartReachedThreshold:r},scroll:s,scrollLength:a,startReachedSnapshot:c,totalSize:u}=o,d=l.length,h=r*a;Mi(e),i&&h>0&&s>h&&c&&(c.contentSize!==u||c.dataLength!==d)&&(o.isStartReached=!1,o.startReachedSnapshot=void 0),_(e,"isAtStart",s<=Pi),_(e,"isNearStart",s<=h),Yt(o)||o.scrollingTo||(o.isStartReached=Li(s,!1,h,o.isStartReached,c,{contentSize:u,dataLength:d,scrollPosition:s},f=>{var S,m;zi(e,"start",t,n)&&(Oi(e),(m=(S=o.props).onStartReached)==null||m.call(S,{distanceFromStart:f}))},f=>{o.startReachedSnapshot=f}))}function Mn(e,t){const n=!e.state.edgeReachedGate;ki(e,t,n),cr(e,t,n)}function Fi(e){var t,n;const o=e.state;(t=o.props)!=null&&t.data&&((n=o.triggerCalculateItemsInView)==null||n.call(o,{forceFullItemPositions:!0})),Mn(e)}var dr=6,ur=3,fr=250;function Ni(e){e.state.scheduledWork.cancel("adaptiveRender")}function qo(e,t){const n=e.state;Ni(e),t<=0?Qt(e,"normal","scroll"):n.scheduledWork.timeout(()=>Qt(e,"normal","scroll"),t,"adaptiveRender")}function Qt(e,t,n){var o,i;C(e,"adaptiveRender")!==t&&(_(e,"adaptiveRender",t),(i=(o=e.state.props.adaptiveRender)==null?void 0:o.onChange)==null||i.call(o,t,n))}function So(e){var t,n;Ni(e);const o=(n=(t=e.state.props.adaptiveRender)==null?void 0:t.initialMode)!=null?n:"normal";C(e,"adaptiveRender")!==o&&Qt(e,o,"initial")}function vr(e,t,n){var o,i,l;const r=e.state,s=r.props.adaptiveRender,a=C(e,"adaptiveRender");if(C(e,"readyToRender"))if(s){const c=(o=s.enterVelocity)!=null?o:dr,u=(i=s.exitVelocity)!=null?i:ur,d=(l=s.exitDelay)!=null?l:fr,h=a==="light"?u:c,v=n?.forceLight||Math.abs(t)>h?"light":"normal",f=r.scheduledWork.has("adaptiveRender")?"normal":a;v!==f&&(v==="light"?(Qt(e,"light","scroll"),qo(e,d)):a==="light"&&qo(e,d))}else So(e)}var po=50;function Di(e,t){var n;const o=e.state.props.drawDistance,i=e.state.initialScroll,l=i!==void 0&&((n=i.viewPosition)!=null?n:0)>0;return t==="visible-first"||t!=="full"&&!C(e,"readyToRender")&&!l?Math.min(o,po):o}function Vi(e){const{state:t}=e;t.props.drawDistance<=po||t.scheduledWork.has("fullDrawDistancePrewarm")||t.scheduledWork.frame(()=>{var n;return(n=t.triggerCalculateItemsInView)==null?void 0:n.call(t)},"fullDrawDistancePrewarm")}function go(e,{resetLayout:t,resetInitialScroll:n}){const{state:o}=e;t&&(o.didContainersLayout=!1,o.queuedInitialLayout=!1),n&&(o.didFinishInitialScroll=!1),_(e,"readyToRender",!1),So(e)}function mo(e,{didLayout:t,didInitialScroll:n}){const{state:o}=e,{loadStartTime:i,props:{onLoad:l}}=o;t&&(o.didContainersLayout=!0),n&&(o.didFinishInitialScroll=!0),o.didContainersLayout&&o.didFinishInitialScroll&&!C(e,"readyToRender")&&(_(e,"readyToRender",!0),Qt(e,"normal","ready"),o.props.drawDistance>po&&Vi(e),o.didLoad||(o.didLoad=!0,l&&l({elapsedTimeInMs:Date.now()-i})))}var hr=2e3;function Go(e,t){e.scroll=t,e.scrollPending=t,e.scrollPrev=t}function Bi(e){e.scheduledWork.cancel("preservedInitialScroll")}function Ot(e){Bi(e),e.clearPreservedInitialScrollOnNextFinish=void 0,e.initialScroll=void 0,et(e)}function Yo(e){var t,n,o;const i=e.state,l=((t=i.initialScrollSession)==null?void 0:t.kind)==="bootstrap"?i.initialScrollSession.bootstrap:void 0;(i.initialScroll||l||(n=i.scrollingTo)!=null&&n.isInitialScroll)&&(l?.frameHandle!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(l.frameHandle),(o=i.scrollingTo)!=null&&o.isInitialScroll&&(Tn(i),i.scrollingTo=void 0,i.scrollTargetPinnedRange=void 0),Ln.resetFlags(i),et(i,{bootstrap:null}),kt(e))}function kt(e,t){var n,o,i;const l=e.state;if(t?.resolvedOffset!==void 0)Go(l,t.resolvedOffset);else if(t?.syncObservedOffset&&((n=l.initialScrollSession)==null?void 0:n.kind)==="offset"){const s=(i=(o=l.refScroller.current)==null?void 0:o.getCurrentScrollOffset)==null?void 0:i.call(o);typeof s=="number"&&Number.isFinite(s)&&Go(l,s)}const r=()=>{var s,a,c,u,d;const h=((s=l.initialScrollSession)==null?void 0:s.kind)==="bootstrap",v=(u=(c=(a=t?.resolvedOffset)!=null?a:l.scrollPending)!=null?c:l.scroll)!=null?u:0;ye.clear(l),t?.preserveTarget&&l.initialScroll?(l.clearPreservedInitialScrollOnNextFinish=void 0,et(l),Bi(l),t?.schedulePreservedTargetClear&&l.scheduledWork.timeout(()=>{var f;!l.didFinishInitialScroll||(f=l.scrollingTo)!=null&&f.isInitialScroll||!l.initialScroll||Ot(l)},hr,"preservedInitialScroll")):Ot(l),t?.recalculateItems&&Fi(e),mo(e,{didInitialScroll:!0}),h&&ir(e,v),(d=t?.onFinished)==null||d.call(t)};if(t?.waitForCompletionFrame){requestAnimationFrame(r);return}r()}function zn(e,t){const n=e.state;return t!==void 0&&n.positions[t]||0}function Sr(e){const{state:t}=e;return(t.props.horizontal?(ct(t)?t.props.stylePaddingRight:t.props.stylePaddingLeft)||0:C(e,"stylePaddingTop")||0)+(C(e,"alignItemsAtEndPadding")||0)+(C(e,"headerSize")||0)}function Z(e,t){const{data:n,keyExtractor:o}=e.props;if(!n)return"";const l=t<n.length?o?o(n[t],t):t:null;return e.idCache[t]=l,l}function pr(e){var t,n,o;const{state:i,values:l}=e;return(l.get("headerSize")||0)+(l.get("footerSize")||0)+((o=(n=(t=i.pendingTotalSize)!=null?t:i.totalSize)!=null?n:l.get("totalSize"))!=null?o:0)+(i.props.stylePaddingTop||0)+(i.props.stylePaddingBottom||0)}function to(e){const{state:t}=e;return!!t.props.alignItemsAtEndPaddingEnabled&&!t.props.horizontal&&t.props.data.length>0&&t.scrollLength>0?Math.max(0,t.scrollLength-pr(e)-It(e)):0}function Et(e){var t;const{state:n}=e,o=C(e,"alignItemsAtEndPadding")||0,i=to(e);if(o!==i){const l=n.maintainingScrollAtEnd==="pending-animated"||n.maintainingScrollAtEnd==="animated",r=n.didContainersLayout&&((t=n.props.maintainScrollAtEnd)==null?void 0:t.animated)&&(l||o>i&&C(e,"isWithinMaintainScrollAtEndThreshold"));r&&!l&&!n.pendingMaintainScrollAtEnd?n.scheduledWork.microtask(()=>{!n.maintainingScrollAtEnd&&!n.pendingMaintainScrollAtEnd&&_(e,"alignItemsAtEndPadding",to(e))},"alignItemsAtEndPaddingFallback"):r||_(e,"alignItemsAtEndPadding",i)}}function xt(e,t,n,o=!0){const i=e.state,l=i.totalSize;let r=i.totalSize;t===null?(r=n,i.timeoutSetPaddingTop&&(clearTimeout(i.timeoutSetPaddingTop),i.timeoutSetPaddingTop=void 0)):r+=n,l!==r?(i.pendingTotalSize=void 0,i.totalSize=r,o&&_(e,"totalSize",r),Et(e)):o&&e.values.get("totalSize")!==r&&_(e,"totalSize",r)}function no(e,t,n,o=!0){const i=e.state,{sizes:l}=i,r=l.get(t),s=r!==void 0?n-r:n;s!==0&&xt(e,t,s,o),l.set(t,n)}function ji(e){return typeof e=="function"}function On(e){return Array.isArray(e)}var xo=new Set;function mt(e,t){_e&&!xo.has(e)&&(xo.add(e),console.warn(`[legend-list] ${t}`))}function en(e){return Math.floor(e*8)/8}function Xt(e){return e==null}function Xo(e,t){var n,o,i;const l=t==="Left"||t==="Right"?e.paddingHorizontal:e.paddingVertical;return(i=(o=(n=e[`padding${t}`])!=null?n:l)!=null?o:e.padding)!=null?i:0}function Gt(e,t,n){return Xo(e,n)+Xo(t,n)}function oo(e,t){var n,o;const i=(o=(n=e.state)==null?void 0:n.containerItemKeys)==null?void 0:o.get(t);if(i!==void 0)return i;const l=C(e,"numContainers");for(let r=0;r<l;r++)if(C(e,`containerItemKey${r}`)===t)return r;return-1}function Wi(e,t,n,o,i){var l,r;const s=e.state,{getFixedItemSize:a,getItemType:c}=s.props;let u=t?s.sizesKnown.get(t):void 0;if(u===void 0&&t&&a){const d=(r=i?.itemType)!=null?r:c&&(l=c(o,n))!=null?l:"",h=i?.didResolveFixedItemSize?i.fixedItemSize:a(o,n,d);h!==void 0&&(u=h+e.scrollAxisGap,s.sizesKnown.set(t,u))}return u}function Hi(e,t){const n=Z(e.state,t);return Wi(e,n,t,e.state.props.data[t])}function gr(e,t,n){for(let o=t;o<=n;o++)if(Hi(e,o)===void 0)return!1;return!0}function ge(e,t,n,o,i,l,r,s){var a,c,u,d;const h=e.state,{sizes:v,averageSizes:f,props:{estimatedItemSize:S,getItemType:m},scrollingTo:g}=h,I=h.sizesKnown.get(t);if(I!==void 0)return I;let y;const b=v.get(t);if(l&&b!==void 0)return b;if(y=Wi(e,t,n,o,s),y!==void 0)return no(e,t,y,r),y;const T=(c=s?.itemType)!=null?c:m&&(a=m(o,n))!=null?a:"";if(i&&!g){const M=(u=f[T])==null?void 0:u.avg;M!==void 0&&(y=en(M))}if(y===void 0&&b!==void 0)return b;if(y===void 0&&i&&g){const M=(d=g.averageSizeSnapshot)==null?void 0:d[T];M!==void 0&&(y=en(M))}return y===void 0&&(y=S+e.scrollAxisGap),no(e,t,y,r),y}function Io(e,t){if(t===void 0||t<0)return;const n=Z(e.state,t);return ge(e,n,t,e.state.props.data[t])}function kn(e,t,n){var o;const i=e.state,{index:l,viewOffset:r,viewPosition:s}=n;let a=t;if(r&&(a-=r),l!==void 0){const c=Sr(e);c&&(a+=c)}if(s!==void 0&&l!==void 0){const c=i.props.data.length;if(c===0)return a;const u=l<0||l>=c,d=(o=i.props.estimatedItemSize)!=null?o:0,h=u?d:ge(e,Z(i,l),l,i.props.data[l]),v=Math.max(0,h-(u?0:e.scrollAxisGap)),f=It(e);if(a-=s*(i.scrollLength-f-v),!u&&l===i.props.data.length-1){const S=C(e,"footerSize")||0;a+=S}}return a}function tt(e,t,n){const o=e.state,i=Ce(e);let l=t;if(Number.isFinite(i)&&Number.isFinite(o.scrollLength)&&Qe.OS!=="android"){const r=Math.max(0,i-o.scrollLength),s=n?.viewOffset,a=typeof s=="number"&&s<0?-s:0,c=r+a;l=Math.min(t,c)}return l=Math.max(0,l),l}function tn(e){var t,n;const o=e.state;if(o?.scrollingTo){Tn(o);const i=o.pendingScrollResolve;o.pendingScrollResolve=void 0;const l=o.scrollingTo;if(o.scrollHistory.length=0,o.scrollingTo=void 0,o.scrollTargetPinnedRange=void 0,o.pendingTotalSize!==void 0&&xt(e,null,o.pendingTotalSize),o.scrollAdjustHandler.commitPendingAdjust(l),l.isInitialScroll||o.initialScroll){const r=((t=o.initialScrollSession)==null?void 0:t.kind)==="offset",s=!!l.isInitialScroll&&!o.clearPreservedInitialScrollOnNextFinish&&o.props.data.length>0&&((n=o.initialScroll)==null?void 0:n.viewPosition)===1;kt(e,{onFinished:()=>{i?.()},preserveTarget:r&&o.props.data.length===0||s,recalculateItems:!0,schedulePreservedTargetClear:s,syncObservedOffset:r,waitForCompletionFrame:!!l.waitForInitialScrollCompletionFrame});return}Fi(e),i?.()}}var mr=80,Ir=1500,yr=320,Cr=1;function Er(e,t){var n,o;const i=e.state,{animated:l,horizontal:r,offset:s}=t;i.scheduledWork.cancel("platformScrollCompletion");const a=i.refScroller.current,c=a?.getScrollableNode();if(!a||!c)return;const u=!!l,d=!!r,h=d?Ce(e):void 0,v=d?bi(i,s,h):0,f=d?0:s;if(a.scrollTo({animated:u,x:v,y:f}),u){const S=(o=(n=a.getScrollEventTarget)==null?void 0:n.call(a))!=null?o:null;Ar(e,{readOffset:()=>a.getCurrentScrollOffset(),target:S,targetOffset:s})}else{i.scroll=s;const S=i.scrollingTo;i.scheduledWork.timeout(()=>{S===i.scrollingTo&&tn(e)},100,"platformScrollCompletion")}}function Ar(e,t){const{readOffset:n,target:o,targetOffset:i}=t;if(!o){tn(e);return}const l="onscrollend"in o;let r,s=!1;const{scheduledWork:a,scrollingTo:c}=e.state,u=setTimeout(()=>v("max"),Ir),d=()=>{o.removeEventListener("scroll",f),l&&o.removeEventListener("scrollend",S),r!==void 0&&clearTimeout(r),clearTimeout(u)},h=()=>{s||(s=!0,d())},v=m=>{if(s)return;if(c!==e.state.scrollingTo){a.cancel("platformScrollCompletion");return}const g=n(),I=Math.abs(g-i)<=Cr;m==="scrollend"&&!I||(a.cancel("platformScrollCompletion"),tn(e))},f=()=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>v("idle"),mr)},S=()=>v("scrollend");o.addEventListener("scroll",f),l?o.addEventListener("scrollend",S):r=setTimeout(()=>v("idle"),yr),a.register("platformScrollCompletion",h)}function Ki(e){if(!e.scrollRequestTracker){let t=0;const n=i=>{const l=e.state;l.scheduledWork.cancel("imperativeScrollReady");const r=++t;return Ti(l),l.pendingScrollResolve=i,r},o=(i,l,r)=>{const s=e.state;if(i!==t)return;(!r()||!s.scrollingTo)&&(s.pendingScrollResolve===l&&(s.pendingScrollResolve=void 0),l())};e.scrollRequestTracker={isCurrent:i=>i===t,runNow:o,runNowIfIdle:i=>{const l=e.state;return l.pendingScrollResolve||l.scrollingTo?Promise.resolve():new Promise(r=>{const s=n(r);o(s,r,i)})},start:n}}return e.scrollRequestTracker}function At(e,t,n){const o=e.state;if(Math.abs(t)>.1){const i=()=>{o.scrollAdjustHandler.requestAdjust(t),o.adjustingFromInitialMount&&o.adjustingFromInitialMount--};o.scroll+=t,o.scrollForNextCalculateItemsInView=void 0,C(e,"readyToRender")?i():(o.adjustingFromInitialMount=(o.adjustingFromInitialMount||0)+1,requestAnimationFrame(i))}}function Zt(e){var t;const{state:n}=e,o=C(e,"alignItemsAtEndPadding")||0,i=to(e);if(n.maintainingScrollAtEnd=void 0,n.pendingMaintainScrollAtEnd=!1,o!==i){_(e,"alignItemsAtEndPadding",i),n.scrollForNextCalculateItemsInView=void 0,(t=n.triggerCalculateItemsInView)==null||t.call(n,{forceFullItemPositions:!0});const l=tt(e,n.scroll+i-o);At(e,l-n.scroll)}}function bt(e){const t=e.state,{didContainersLayout:n,didFinishInitialScroll:o,pendingNativeMVCPAdjust:i,props:{maintainScrollAtEnd:l}}=t,r=C(e,"isWithinMaintainScrollAtEndThreshold"),s=!!t.pendingMaintainScrollAtEnd,a=!!((r||s)&&l&&o);if(a&&!n)return t.pendingMaintainScrollAtEnd=!0,!1;if(i)return t.pendingMaintainScrollAtEnd=a,!1;if(a&&n){if(t.pendingMaintainScrollAtEnd=!1,Ce(e)<t.scrollLength&&(t.scroll=0),t.maintainingScrollAtEnd)t.pendingMaintainScrollAtEnd=!0;else{const u=l.animated?"pending-animated":"pending-instant",d=l.animated?"animated":"instant",h=t.scroll;t.maintainingScrollAtEnd=u,requestAnimationFrame(()=>{if(t.maintainingScrollAtEnd!==u)return;const v=C(e,"isWithinMaintainScrollAtEndThreshold"),f=t.scroll!==h;s||v||!f?(t.maintainingScrollAtEnd=d,Ki(e).runNowIfIdle(()=>e.scrollToEnd({animated:l.animated})).then(()=>{t.maintainingScrollAtEnd===d&&(t.pendingMaintainScrollAtEnd?(t.maintainingScrollAtEnd=void 0,bt(e)):Zt(e))})):t.maintainingScrollAtEnd===u&&Zt(e)})}return!0}return Zt(e),!1}var Ie=.1,br=300,wr=2,Rr=1;function _r(e,t,n,o){if(!t){e.mvcpAnchorLock=void 0;return}const i=e.mvcpAnchorLock;if(!i)return;const l=o>i.expiresAt,r=e.indexByKey.get(i.id)===void 0;if(l||r||!n){e.mvcpAnchorLock=void 0;return}return i}function Pr(e,t){{const{anchorId:n,anchorPosition:o,dataChanged:i,now:l,positionDiff:r}=t,s=!!i||!!e.mvcpAnchorLock,a=e.props.maintainVisibleContentPosition.data;if(!s||!a||e.scrollingTo||!n||o===void 0)return;const c=e.mvcpAnchorLock,u=!i&&Math.abs(r)<=Ie&&c?.id===n?c.quietPasses+1:0;if(!i&&u>=wr){e.mvcpAnchorLock=void 0;return}e.mvcpAnchorLock={expiresAt:l+br,id:n,position:o,quietPasses:u}}}function Tr(e,t,n,o,i,l){return!1}function Lr(e,t,n){if(Math.abs(t)<=Ie)return 0;const i=Math.max(0,n-e.scrollLength)-e.scroll;return t<0?Math.max(t,Math.min(0,i)):t>0?Math.min(t,Math.max(0,i)):0}function Mr(e,t){return e<0?-t:t}function Yn(e,t,n){const o=e.state;o.pendingNativeMVCPAdjust=void 0;const i=t-n;Math.abs(i)>Ie&&At(e,i)}function zr(e){const t=e.state,n=t.pendingNativeMVCPAdjust;if(!n||Math.abs(n.manualApplied)>Ie)return;const o=Ce(e),i=Lr(t,n.amount,o);if(Math.abs(i)<=Ie)return;const l=n.amount-i;Math.abs(l)<=Ie||(n.manualApplied=l,At(e,l),n.furthestProgressTowardAmount=0)}function Or(e,t){const n=e.state,o=n.pendingNativeMVCPAdjust;if(!o)return!1;const i=o.amount-o.manualApplied,l=t-(o.startScroll+o.manualApplied),r=i<0&&l>Ie||i>0&&l<-Ie,s=Mr(i,l);if(Math.abs(i)<=Ie)return n.pendingNativeMVCPAdjust=void 0,!0;if(r)return n.pendingNativeMVCPAdjust=void 0,!1;if(s+Ie>=Math.abs(i))return Yn(e,i,l),!0;const a=Math.max(0,Ce(e)-n.scrollLength);return Math.abs(t-a)<=Rr||n.pendingMaintainScrollAtEnd&&C(e,"isWithinMaintainScrollAtEndThreshold")&&s>Ie?(Yn(e,i,l),!0):s>o.furthestProgressTowardAmount+Ie?(o.furthestProgressTowardAmount=s,!1):(o.furthestProgressTowardAmount>Ie&&s<o.furthestProgressTowardAmount-Ie&&(n.pendingNativeMVCPAdjust=void 0),!1)}function kr(e,t,n){const o=e.state,{idsInView:i,positions:l,props:r}=o,{maintainVisibleContentPosition:{data:s,size:a,shouldRestorePosition:c}}=r,u=Date.now(),d=!!t||!!o.mvcpAnchorLock,h=o.scrollingTo;if(t&&o.pendingScrollToEnd&&h===void 0){o.mvcpAnchorLock=void 0;return}const v=_r(o,d,s,u);let f,S;const m=[],g=h?.index,I=h?.viewPosition,y=g!==void 0&&o.props.data.length>0&&g>=o.props.data.length-1&&(I??0)>0,b=t?s:a,T=o.indexByKey,M=o.scroll;if(Ce(e),b){if(v&&g===void 0?(S=v.id,f=v.position):g!==void 0?S=Z(o,g):i.length>0&&o.didContainersLayout&&!t&&(S=i.find(w=>T.get(w)!==void 0)),t&&i.length>0&&o.didContainersLayout)for(let w=0;w<i.length;w++){const F=i[w],P=T.get(F);if(P!==void 0){const E=l[P];E!==void 0&&m.push({id:F,position:E})}}if(S!==void 0&&f===void 0){const w=T.get(S);w!==void 0&&(f=l[w])}return()=>{let w=0,F=v?.id,P,E=!1;const L=o.props.data;if(t&&s&&g===void 0&&S!==void 0&&v?.id===S&&c!==void 0&&S!==void 0){const z=T.get(S);if(z!==void 0){const N=L[z];E=N===void 0||!c(N,z,L),E&&v?.id===S&&(o.mvcpAnchorLock=void 0)}}if(t&&s&&g===void 0&&(()=>{if(S===void 0||E)return!0;const z=T.get(S);return z===void 0||l[z]===void 0})())for(let z=0;z<m.length;z++){const{id:N,position:U}=m[z],$=T.get(N);if($!==void 0&&c){const te=L[$];if(te===void 0||!c(te,$,L))continue}const le=$!==void 0?l[$]:void 0;if(le!==void 0){w=le-U,F=N,P=le;break}}if(!E&&S!==void 0&&f!==void 0){const z=T.get(S),N=z!==void 0?l[z]:void 0;if(N!==void 0){const U=Ce(e);let $=N-f;if($!==0&&y&&o.scroll+o.scrollLength>U)if($>0)$=Math.max(0,U-o.scroll-o.scrollLength);else{const le=Math.max(0,U-o.scrollLength);o.scroll=le,o.scrollPending=le,$=0}w=$,F=S,P=N}}if(I&&I>0){const z=ge(e,S,g,o.props.data[g]),N=h?.itemSize;if(z!==void 0&&N!==void 0&&z!==N){const U=z-N;U!==0&&(w+=U*I,h.itemSize=z)}}if(Pr(o,{anchorId:F,anchorPosition:P,dataChanged:t,now:u,positionDiff:w}),Tr()){o.pendingNativeMVCPAdjust={amount:w,furthestProgressTowardAmount:0,manualApplied:0,startScroll:M},zr(e);return}Math.abs(w)>Ie&&((o.maintainingScrollAtEnd==="pending-animated"||o.maintainingScrollAtEnd==="animated")&&C(e,"isWithinMaintainScrollAtEndThreshold")||At(e,w))}}}var Zo=1e3,Fr=200,Fn=e=>{const{scrollHistory:t}=e,n=t.length-1;if(n<1)return 0;const o=t[n];if(Date.now()-o.time>Zo)return 0;let i=0,l=0,r=0;for(let s=n;s>0;s--){const a=t[s],c=t[s-1],u=a.scroll-c.scroll,d=a.time-c.time,h=Math.sign(u);if(h!==0){if(i===0)i=h;else if(h!==i)break}if(o.time-c.time>Zo)break;if(u===0||d<=0)continue;const v=o.time-a.time,f=Math.exp(-v/Fr);l+=u/d*f,r+=f}return r>0?l/r:0};function Nr(e){const t=e.mvcpAnchorLock;return t?Date.now()>t.expiresAt?(e.mvcpAnchorLock=void 0,!1):!0:!1}function sn(e){return e.dataChangeNeedsScrollUpdate||Nr(e)}function Ft(e,t,n,o){var i;const l=e.state,{ignoreScrollFromMVCP:r,lastScrollAdjustForHistory:s,scrollAdjustHandler:a,scrollHistory:c,scrollingTo:u}=l,d=l.scroll;o?.markHasScrolled!==!1&&(l.hasScrolled=!0);const h=Date.now();l.lastBatchingAction=h;const v=a.getAdjust(),f=s!==void 0&&Math.abs(v-s)>.1;if(f&&(c.length=0),l.lastScrollAdjustForHistory=v,u===void 0&&!(c.length===0&&t===l.scroll)&&(f||c.push({scroll:t,time:h})),c.length>5&&c.shift(),r&&!u){const{lt:E,gt:L}=r;if(E&&t<E||L&&t>L){l.ignoreScrollFromMVCPIgnored=!0;return}}l.scrollPrev=d,l.scrollPrevTime=l.scrollTime,l.scroll=t,l.scrollTime=h;const S=Math.abs(t-d),m=!!o?.fromNativeScrollEvent&&S>.1&&!f&&u===void 0&&!l.pendingNativeMVCPAdjust,g=m&&t<d&&!!(l.maintainingScrollAtEnd||l.pendingMaintainScrollAtEnd);g&&Zt(e);const I=m?ar(e,t-d):void 0,y=Or(e,t),b=l.scrollLength,T=b>0&&u===void 0&&S>b&&!l.pendingNativeMVCPAdjust,M=Fn(l);vr(e,M,{forceLight:T});const w=l.scrollLastCalculate;if(sn(l)||y||g||I!==void 0||n||w===void 0||Math.abs(l.scroll-w)>2){l.scrollLastCalculate=l.scroll,l.ignoreScrollFromMVCPIgnored=!1,l.lastScrollDelta=S;const E=()=>{var D;const R={doMVCP:u!==void 0,scrollVelocity:M};T&&(R.drawDistanceMode="visible-first"),(D=l.triggerCalculateItemsInView)==null||D.call(l,R),Mn(e,I)};T?(l.mvcpAnchorLock=void 0,l.pendingNativeMVCPAdjust=void 0,l.userScrollAnchorReset={keys:new Set},l.scheduledWork.cancel("mvcpRecalculate"),yi.flushSync(E),Vi(e)):E();const L=!!l.pendingMaintainScrollAtEnd||!!((i=l.props.maintainScrollAtEnd)!=null&&i.onDataChange);y&&L&&(l.pendingMaintainScrollAtEnd=!1,bt(e)),l.dataChangeNeedsScrollUpdate=!1,l.lastScrollDelta=0}}function Dr(e){if(Object.keys(e.averageSizes).length===0)return;const t={};for(const n in e.averageSizes){const o=e.averageSizes[n];t[n]=o.avg}return t}function Vr(e,t){var n;const{isInitialScroll:o,requestedOffset:i,targetOffset:l}=t,r=ye.get(e),s=!e.didFinishInitialScroll&&(o||!!r)&&ye.hasNonZeroTargetOffset(l),a=!e.didFinishInitialScroll&&!!r&&ye.isAtZeroTargetOffset(i);if(s){e.hasScrolled=!1,ye.set(e,{startScroll:(n=r?.startScroll)!=null?n:e.scroll,targetOffset:l});return}a&&ye.clear(e)}function Br(e,t){const n=e.state,o=n.props.data.length;let i=0,l=o-1,r;for(;i<=l;){const s=Math.floor((i+l)/2),a=n.positions[s];a===void 0?l=s-1:a<=t?(r=s,i=s+1):l=s-1}return r}function Jo(e,t){var n;const o=e.state.positions[t];if(o===void 0)return;const i=(n=Io(e,t))!=null?n:0;return o+(Number.isFinite(i)?i:0)}function jr(e,t,n){const o=e.state,i=o.props.data.length;if(i===0)return;const l=Math.max(0,t),r=Math.max(l,t+o.scrollLength);let s=n!==void 0?Math.max(0,Math.min(i-1,n)):Br(e,l);if(s===void 0)return;if(n!==void 0&&o.positions[s]===void 0)return{end:s,start:s};if(n===void 0){const c=Jo(e,s);if(c===void 0||c<=l)return}for(;s>0;){const c=o.positions[s];if(c===void 0||c<=l||o.positions[s-1]===void 0)break;s--}for(;s>0;){const c=Jo(e,s-1);if(c===void 0||c<=l)break;s--}let a=s;for(;a+1<i;){const c=o.positions[a+1];if(c===void 0||c>r)break;a++}return{end:a,start:s}}function Wr(e,t,n){const o=jr(e,t,n);o?(e.state.scrollTargetPinnedRange=o,e.state.scrollForNextCalculateItemsInView=void 0):e.state.scrollTargetPinnedRange=void 0}function Nn(e,t){var n,o;const i=e.state,{noScrollingTo:l,forceScroll:r,...s}=t,{animated:a,isInitialScroll:c,offset:u,precomputedWithViewOffset:d,waitForInitialScrollCompletionFrame:h}=s,{props:{horizontal:v}}=i;Tn(i);const f=d?u:kn(e,u,s),S=!!c&&((n=i.initialScrollSession)==null?void 0:n.kind)==="offset",m=tt(e,f,s),g=S?f:m;if(i.scrollHistory.length=0,!l){c&&Ln.resetFlags(i);const I=Dr(i);i.scrollingTo={...s,...I?{averageSizeSnapshot:I}:{},targetOffset:m,waitForInitialScrollCompletionFrame:h},c||Wr(e,m,s.index)}i.scrollPending=m,Vr(i,{isInitialScroll:c,requestedOffset:g,targetOffset:m}),!c&&!l&&Math.abs(i.scroll-m)>1&&(a?i.scrollTargetPinnedRange&&((o=i.triggerCalculateItemsInView)==null||o.call(i)):Ft(e,m,!0,{markHasScrolled:!1})),r||!c||Qe.OS==="android"?Er(e,{animated:a,horizontal:v,offset:g}):i.scroll=g}function Ui(e,t){return t<=0?-1:e>=t?t-1:e<0?0:e}function In(e,{index:t,viewOffset:n=0,animated:o=!0,forceScroll:i,isInitialScroll:l,viewPosition:r}){const s=e.state,{data:a}=s.props;t=Ui(t,a.length);const c=Io(e,t),u=zn(e,t);t===a.length-1&&r===void 0&&(r=1),s.scrollForNextCalculateItemsInView=void 0,Nn(e,{animated:o,forceScroll:i,index:t,isInitialScroll:l,itemSize:c,offset:u,viewOffset:n,viewPosition:r??0})}function an(e,t){const{forceScroll:n,resolvedOffset:o,target:i,waitForCompletionFrame:l}=t,r=i.index,s=r!==void 0?Ui(r,e.state.props.data.length):void 0,a=Io(e,s);Nn(e,{animated:!1,forceScroll:n,index:s!==void 0&&s>=0?s:void 0,isInitialScroll:!0,itemSize:a,offset:o,precomputedWithViewOffset:!0,viewOffset:i.viewOffset,viewPosition:i.viewPosition,waitForInitialScrollCompletionFrame:l})}function yt(e,t,n){var o;const{state:i}=e;i.clearPreservedInitialScrollOnNextFinish=void 0,i.scheduledWork.cancel("preservedInitialScroll"),i.initialScroll=t,n?.resetDidFinish&&go(e,{resetInitialScroll:!0}),et(i,{kind:((o=i.initialScrollSession)==null?void 0:o.kind)==="offset"?"offset":"bootstrap"})}function ke(e,t){var n,o;if(((n=e.state.initialScrollSession)==null?void 0:n.kind)==="offset")return(o=t.contentOffset)!=null?o:0;const l=t.index!==void 0?zn(e,t.index):0,r=kn(e,l,t);return tt(e,r,t)}function $i(e,t){const{didFinishInitialScroll:n,queuedInitialLayout:o,scrollingTo:i}=e,l=e.initialScroll,r=!!i?.isInitialScroll,s=!!t?.requiresMeasuredLayout&&!o&&!r;if(!(!l||s||n||i&&!r))return{initialScroll:l,isInitialScrollInProgress:r,queuedInitialLayout:o,scrollingTo:i}}function Hr(e,t){var n,o,i;const l=e.state,r=$i(l,{requiresMeasuredLayout:!0});if(!r)return!1;const{initialScroll:s,isInitialScrollInProgress:a,queuedInitialLayout:c}=r,u=a?r.scrollingTo:void 0,d=ke(e,s),h=u?(n=u.targetOffset)!=null?n:u.offset:void 0,v=s.contentOffset===void 0||Math.abs(s.contentOffset-d)>1,f=h!==void 0&&Math.abs(h-d)>1,S=h!==void 0&&Math.abs(l.scroll-d)<=1&&Math.abs(l.scrollPending-d)<=1;if(!t?.forceScroll&&!v&&a&&!f||t?.forceScroll&&S)return!1;v&&((o=l.initialScrollSession)==null?void 0:o.kind)!=="offset"&&yt(e,{...s,contentOffset:d});const m=(i=t?.forceScroll)!=null?i:!!c||a&&v;return an(e,{forceScroll:m,resolvedOffset:d,target:s}),!0}function Kr(e,t){var n,o;const i=e.state,l=$i(i);if(!l)return!1;const{initialScroll:r,queuedInitialLayout:s}=l,a=(n=r.contentOffset)!=null?n:0,c=Math.abs(i.scroll-a)<=1&&Math.abs(i.scrollPending-a)<=1;if(t?.forceScroll&&c)return!1;const u=!!i.lastLayout&&i.scrollLength>0,d=(o=t?.forceScroll)!=null?o:u||!!s;return an(e,{forceScroll:d,resolvedOffset:a,target:r}),!0}function nn(e,t){var n;return((n=e.state.initialScrollSession)==null?void 0:n.kind)==="offset"?Kr(e,{forceScroll:t?.forceScroll}):Hr(e,{forceScroll:t?.forceScroll})}function Jt(e,t,n){if(t==null||n==null||t<0||n<t)return!1;let o=!1;for(const i of e.containerItemKeys.keys()){const l=e.indexByKey.get(i);if(l!==void 0&&l>=t&&l<=n){o=!0;const r=Z(e,l);if(r===void 0||!e.sizesKnown.has(r))return!1}}return o}var Dn=1,Ur=8,$r=24,qr="LegendList bootstrap initial scroll aborted after exceeding convergence bounds.";function Le(e){var t;return((t=e.initialScrollSession)==null?void 0:t.kind)==="bootstrap"?e.initialScrollSession.bootstrap:void 0}function wt(e){var t;return((t=e.initialScrollSession)==null?void 0:t.kind)==="offset"}function Gr(e,t){if(!e||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Yr(e){const{dataLength:t,getSize:n,offset:o,positions:i,scrollLength:l,startIndex:r}=e,s=o+l,a=[];let c=r!==void 0?Math.max(0,Math.min(t-1,r)):0;for(;c>0;){const u=c-1,d=i[u];if(d===void 0){c=u;continue}const h=n(u);if(h===void 0){c=u;continue}if(d+h<=o)break;c=u}for(;c<t;c++){const u=i[c];if(u===void 0)continue;const d=n(c);if(d!==void 0){if(u<s&&u+d>o)a.push(c);else if(a.length>0&&u>=s)break}}return a}function xr(e){const{mountFrameCount:t,maxFrames:n=Ur,maxPasses:o=$r,passCount:i}=e;return t>=n||i>=o}function qi(e,t){return xr(t)?(_e&&console.warn(qr),as(e),!0):!1}function on(e){var t;const n=Le(e),o=n?.frameHandle;o!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(o),n&&(n.frameHandle=void 0),et(e,{bootstrap:null,kind:(t=e.initialScrollSession)==null?void 0:t.kind})}function Gi(e,t){var n,o,i;const l=Le(e);et(e,{bootstrap:{frameHandle:l?.frameHandle,mountFrameCount:(n=l?.mountFrameCount)!=null?n:0,passCount:0,previousResolvedOffset:void 0,scroll:t.scroll,seedContentOffset:(i=(o=t.seedContentOffset)!=null?o:l?.seedContentOffset)!=null?i:t.scroll,targetIndexSeed:t.targetIndexSeed,visibleIndices:void 0},kind:"bootstrap"})}function Xr(e,t){var n,o,i;const l=Le(e);l?(l.passCount=0,l.previousResolvedOffset=void 0,l.scroll=(n=t?.scroll)!=null?n:l.scroll,l.seedContentOffset=(o=t?.seedContentOffset)!=null?o:l.seedContentOffset,l.targetIndexSeed=(i=t?.targetIndexSeed)!=null?i:l.targetIndexSeed,l.visibleIndices=void 0,et(e,{bootstrap:l,kind:"bootstrap"})):t?.scroll!==void 0&&Gi(e,{scroll:t.scroll,seedContentOffset:t.seedContentOffset,targetIndexSeed:t.targetIndexSeed})}function io(e){requestAnimationFrame(()=>{var t;Le(e)&&((t=e.triggerCalculateItemsInView)==null||t.call(e,{forceFullItemPositions:!0}))})}function yo(e){const t=e.state,n=Le(t);if(!n||n.frameHandle!==void 0)return;const o=()=>{const i=Le(t);i&&(i.frameHandle=void 0,i.mountFrameCount+=1,!qi(e,{mountFrameCount:i.mountFrameCount,passCount:i.passCount})&&yo(e))};n.frameHandle=requestAnimationFrame(o)}function An(e,t){Xr(e.state,t),yo(e),io(e.state)}function Co(e){const{dataLength:t,footerSize:n,preserveForFooterLayout:o,stylePaddingEnd:i}=e;return{contentOffset:void 0,index:Math.max(0,t-1),preserveForBottomPadding:!0,preserveForFooterLayout:o,viewOffset:-i-n,viewPosition:1}}function Zr(e){return!!e?.preserveForBottomPadding}function Ct(e){return!!e?.preserveForFooterLayout}function Yi(e){return!!(e&&e.viewPosition===1&&(Zr(e)||Ct(e)))}function Jr(e){const{dataLength:t,footerSize:n,initialScrollAtEnd:o,stylePaddingEnd:i,target:l}=e,r=Ct(l);return{...l,contentOffset:void 0,index:o?Math.max(0,t-1):l.index,preserveForBottomPadding:!0,preserveForFooterLayout:r,viewOffset:-i-(r?n:0),viewPosition:1}}function Qr(e,t){return e.index===t.index&&e.preserveForBottomPadding===t.preserveForBottomPadding&&e.preserveForFooterLayout===t.preserveForFooterLayout&&e.viewOffset===t.viewOffset&&e.viewPosition===t.viewPosition}function bn(e,t){const{dataLength:n,stylePaddingEnd:o,target:i}=t;if(!Ct(i))return;const l=Co({dataLength:n,footerSize:0,preserveForFooterLayout:void 0,stylePaddingEnd:o});yt(e,l)}function es(e){Ot(e)}function Eo(e,t,n=Dn){const o=e.state;if(!o.didFinishInitialScroll)return!1;const i=ln(o);return Math.abs(i-ke(e,t))>n}function ln(e){var t,n,o,i;const l=(n=(t=e.refScroller.current)==null?void 0:t.getCurrentScrollOffset)==null?void 0:n.call(t);return typeof l=="number"&&Number.isFinite(l)?l:(i=(o=e.scrollPending)!=null?o:e.scroll)!=null?i:0}function xi(e){var t;const n=e.state,o=n.initialScroll;if(!n.didFinishInitialScroll||(t=n.scrollingTo)!=null&&t.isInitialScroll||!o||o.viewPosition!==1||n.props.data.length===0||wt(n))return;const i=typeof n.lastNativeScroll=="number"&&Number.isFinite(n.lastNativeScroll)?n.lastNativeScroll:ln(n);return ke(e,o)-i}function Xi(e){return xi(e)===void 0?!1:(Zi(e,{}),!0)}function Zi(e,t){const n=e.state;n.preservedEndAnchorCorrection=t,requestAnimationFrame(()=>{var o;const i=n.preservedEndAnchorCorrection;if(i!==t)return;const l=xi(e);if(l===void 0||Math.abs(l)<=Dn){n.preservedEndAnchorCorrection=void 0;return}(!i.lastRequestTime||((o=n.lastNativeScrollTime)!=null?o:0)>i.lastRequestTime)&&(i.lastRequestTime=Date.now(),At(e,l)),Zi(e,t)})}function ts(e){var t;const n=e.state,o=n.initialScroll;!n.didFinishInitialScroll||(t=n.scrollingTo)!=null&&t.isInitialScroll||o?.viewPosition!==1||n.preservedEndAnchorCorrection||Eo(e,o)&&(Yi(o)&&C(e,"isAtEnd")||(Ct(o)?bn(e,{dataLength:n.props.data.length,stylePaddingEnd:vo(n.props),target:o}):es(n)))}function ns(e,t){var n,o,i;const{initialScrollAtEnd:l,target:r}=t,s=e.state,a=ke(e,r),c=a===0&&!l&&(wt(s)?Math.abs((n=r.contentOffset)!=null?n:0)<=1:r.index===0&&((o=r.viewPosition)!=null?o:0)===0&&Math.abs((i=r.viewOffset)!=null?i:0)<=1),u=s.props.data.length===0&&r.index!==void 0;c?(on(s),kt(e,{resolvedOffset:a})):u?(on(s),kt(e,{preserveTarget:!0,resolvedOffset:a})):(Gi(s,{scroll:a,seedContentOffset:0,targetIndexSeed:r.index}),yo(e))}function os(e,t){const{dataLength:n,didDataChange:o,initialScrollAtEnd:i,previousDataLength:l,stylePaddingEnd:r}=t,s=e.state,a=s.initialScroll;if(wt(s)||!a)return;const c=!!(s.didFinishInitialScroll&&l===0&&n>0&&a.index!==void 0),u=Le(s);if(!i&&o&&n>0&&s.didFinishInitialScroll&&!u&&!c){Ot(s);return}const h=n>0&&(i||Yi(a));if(!(!o&&!c&&!h)){if(h){const v=i?Co({dataLength:n,footerSize:C(e,"footerSize")||0,preserveForFooterLayout:Ct(a),stylePaddingEnd:r}):Jr({dataLength:n,footerSize:C(e,"footerSize")||0,initialScrollAtEnd:i,stylePaddingEnd:r,target:a});if(!c&&Eo(e,a)){bn(e,{dataLength:n,stylePaddingEnd:r,target:a});return}if(!Qr(a,v)||u||c||o){yt(e,v,{resetDidFinish:c}),An(e,{scroll:ke(e,v),seedContentOffset:c&&!u?ln(s):void 0,targetIndexSeed:v.index});return}}o&&(u||c)&&(yt(e,a,{resetDidFinish:c}),An(e,{scroll:ke(e,a),seedContentOffset:c&&!u?ln(s):void 0,targetIndexSeed:a.index}))}}function is(e,t){const{dataLength:n,footerSize:o,initialScrollAtEnd:i,stylePaddingEnd:l}=t,r=e.state;if(!i)return;const s=r.initialScroll;if(!(wt(r)||n===0||!s||!(Le(r)||Ct(s))))if(Eo(e,s))bn(e,{dataLength:n,stylePaddingEnd:l,target:s});else{const c=Co({dataLength:n,footerSize:o,preserveForFooterLayout:Ct(s),stylePaddingEnd:l});if(!(s.index!==c.index||s.viewPosition!==c.viewPosition||s.viewOffset!==c.viewOffset))bn(e,{dataLength:n,stylePaddingEnd:l,target:s});else{const d=!!r.didFinishInitialScroll;yt(e,c,{resetDidFinish:d}),An(e,{scroll:ke(e,c),targetIndexSeed:c.index})}}}function ls(e){var t,n;const o=e.state,i=o.initialScroll,l=Le(o);if(i&&o.props.data.length>0&&!wt(o)&&(l||i.viewPosition===1)){const r=ke(e,i),s=(t=o.scrollingTo)!=null&&t.isInitialScroll?o.scrollingTo:void 0;if(!l&&(s||o.didFinishInitialScroll)){const a=s?(n=s.targetOffset)!=null?n:s.offset:ln(o),c=r-a;Math.abs(c)>Dn&&(o.didFinishInitialScroll?Xi(e):s&&(o.initialScroll={...i,contentOffset:r},an(e,{forceScroll:!0,resolvedOffset:r,target:o.initialScroll})))}else An(e,{scroll:r,targetIndexSeed:i.index})}}function rs(e){var t,n;const o=e.state,i=Le(o),l=o.initialScroll;if(!i||!l||wt(o)||(t=o.scrollingTo)!=null&&t.isInitialScroll||(i.passCount+=1,qi(e,{mountFrameCount:i.mountFrameCount,passCount:i.passCount})))return;l.index!==void 0&&o.startBuffered>=0&&o.endBuffered>=0&&l.index>=o.startBuffered&&l.index<=o.endBuffered&&(i.targetIndexSeed=void 0);const r=ke(e,l),s=Jt(o,o.startBuffered,o.endBuffered),a=Math.abs(i.scroll-r)>1,{data:c}=o.props,u=Yr({dataLength:c.length,getSize:S=>{var m,g;const I=(m=o.idCache[S])!=null?m:Z(o,S);return(g=o.sizes.get(I))!=null?g:ge(e,I,S,c[S])},offset:r,positions:o.positions,scrollLength:o.scrollLength,startIndex:(n=i.targetIndexSeed)!=null?n:o.startBuffered>=0?o.startBuffered:void 0}),d=u.length>0&&u.every(S=>{var m;const g=(m=o.idCache[S])!=null?m:Z(o,S);return o.sizesKnown.has(g)}),h=i.previousResolvedOffset,v=i.visibleIndices;if(i.previousResolvedOffset=r,i.visibleIndices=u,a){i.scroll=r,io(o);return}if(!s||!d)return;if(!(h!==void 0&&Math.abs(h-r)<=Dn&&Gr(v,u))){io(o);return}on(o),an(e,{forceScroll:!0,resolvedOffset:r,target:l,waitForCompletionFrame:Qe.OS==="web"})}function ss(e,t){var n;const o=e.state;on(o);const i=!o.clearPreservedInitialScrollOnNextFinish&&o.props.data.length>0&&((n=o.initialScroll)==null?void 0:n.viewPosition)===1;kt(e,{preserveTarget:i,recalculateItems:!0,resolvedOffset:t,schedulePreservedTargetClear:i})}function as(e){var t,n,o,i;const l=e.state,r=Le(l),s=l.initialScroll;r&&s&&!wt(l)&&l.refScroller.current?(on(l),an(e,{forceScroll:!0,resolvedOffset:r.scroll,target:s,waitForCompletionFrame:Qe.OS==="web"})):ss(e,(i=(o=(n=(t=Le(l))==null?void 0:t.scroll)!=null?n:l.scrollPending)!=null?o:l.scroll)!=null?i:0)}function Ji(e,t,n,o){return{data:e.props.data,dataChangeEpoch:e.dataChangeEpoch,getFixedItemSize:e.props.getFixedItemSize,getItemType:e.props.getItemType,itemData:n,itemIndex:t,itemType:o}}function Qi(e,t,n,o,i){var l;const{getItemType:r}=e.props,s=e.containerItemMetadata.get(t);if(s?.dataChangeEpoch===e.dataChangeEpoch&&s.getItemType===r&&s.itemData===o&&s.itemIndex===n)return s;const a=r?(l=r(o,n))!=null?l:"":void 0,c=Ji(e,n,o,a);return e.containerItemMetadata.set(t,c),c}function el(e,t,n,o){var i;const{getFixedItemSize:l}=e.props,r=Qi(e,t,n,o);return r.getFixedItemSize!==l&&(r.didResolveFixedItemSize=!1,r.fixedItemSize=void 0,r.getFixedItemSize=l),l&&!r.didResolveFixedItemSize&&(r.fixedItemSize=l(o,n,(i=r.itemType)!=null?i:""),r.didResolveFixedItemSize=!0),r}function tl(e){for(const t of e.containerItemMetadata.values())t.didResolveFixedItemSize=!1,t.fixedItemSize=void 0}var cs=20,ds=1,us=1,xn=16;function Ao(e,t){const n=e.state.scrollingTo;t?.onlyIfAligned&&(!n?.isInitialScroll||n.animated||!bo(e,n).isAtResolvedTarget)||e.state.scheduledWork.frame(()=>ps(e),"checkFinishedScrollFrame")}function fs(e,t){const{clampedTargetOffset:n,scrollingTo:o}=t;return!o.isInitialScroll||e.hasScrolled||n<=ds}function vs(e,t){return!!t?.isInitialScroll&&Ln.didDispatchNativeScroll(e)&&!e.hasScrolled}function nl(e){var t;return(t=ye.get(e))==null?void 0:t.targetOffset}function ol(e){const t=nl(e);return!e.didFinishInitialScroll&&ye.hasNonZeroTargetOffset(t)}function Qo(e,t){var n,o;if(!t.isInitialScroll||t.animated||!e.didContainersLayout||((n=e.initialScrollSession)==null?void 0:n.kind)==="bootstrap")return!1;const i=(o=t.targetOffset)!=null?o:t.offset;return ye.hasNonZeroTargetOffset(i)&&Ln.didDispatchNativeScroll(e)&&!e.hasScrolled||ye.isAtZeroTargetOffset(i)||Math.abs(e.scroll-i)>1||Math.abs(e.scrollPending-i)>1?!1:!!t.waitForInitialScrollCompletionFrame||ol(e)}function ei(e){var t;const{state:n}=e;return!!((t=n.scrollingTo)!=null&&t.isInitialScroll)&&n.props.data.length>0&&Ce(e)<=n.scrollLength&&n.scrollPending<=us}function hs(e,t){return t.index===e.state.props.data.length-1&&t.viewPosition===1}function Ss(e,t){var n;const o=t.index,l=hs(e,t)&&o!==void 0?kn(e,zn(e,o),t):(n=t.targetOffset)!=null?n:tt(e,t.offset-(t.viewOffset||0),t);return tt(e,l,t)}function bo(e,t){const{state:n}=e,o=n.scrollPending,i=n.scrollAdjustHandler.getAdjust(),l=Ss(e,t),r=tt(e,o,t),s=Math.abs(o-l),a=l+i,c=Math.abs(o-a),u=!t.animated||Qe.OS==="ios";return{clampedTargetOffset:l,isAtResolvedTarget:Math.abs(o-r)<1&&(s<1||u&&c<1)}}function ps(e){const t=e.state.scrollingTo;if(!t)return;const{state:n}=e,o=bo(e,t);o.isAtResolvedTarget&&fs(n,{clampedTargetOffset:o.clampedTargetOffset,scrollingTo:t})&&tn(e)}function gs(e,t){var n;(n=e.state.refScroller.current)==null||n.scrollTo({animated:!1,x:e.state.props.horizontal?t:0,y:e.state.props.horizontal?0:t})}function ms(e){const t=e.state;if(t.scheduledWork.has("checkFinishedScrollFallback"))return;const n=t.scrollingTo,o=ei(e),i=vs(t,n),l=n!==void 0?Qo(t,n):!1,r=n?.isInitialScroll&&!o&&!l||!t.didContainersLayout,s=o||l?0:i?xn:r?500:100;let a=0;const c=d=>{t.scheduledWork.timeout(u,d,"checkFinishedScrollFallback")},u=()=>{var d,h;const v=t.scrollingTo;if(v){a++;const f=ol(t)&&!t.hasScrolled,S=i?5:f?cs:5,m=ei(e),g=Qo(t,v),I=bo(e,v),y=Qe.OS==="android",b=t.hasScrolled&&(!v.isInitialScroll||I.isAtResolvedTarget),T=v.isInitialScroll&&!I.isAtResolvedTarget&&a<=S;if(m||b||g||y||a>S)tn(e);else if((f||T)&&a<=S){const M=(h=(d=nl(t))!=null?d:v.targetOffset)!=null?h:t.scrollPending;gs(e,M),c(i?xn:100)}else c(i?xn:100)}};c(s)}function il(e){var t;const n=e.state,o=n.initialScroll;return n.didFinishInitialScroll?Xi(e):!o||((t=n.initialScrollSession)==null?void 0:t.kind)==="offset"||o.viewPosition!==1||n.props.data.length===0?!1:nn(e,{forceScroll:!0})}function Is(e){var t;if(!e.state.initialScroll)return;const n=()=>nn(e,{forceScroll:!0});n(),((t=e.state.initialScrollSession)==null?void 0:t.kind)!=="offset"&&requestAnimationFrame(n),Ao(e,{onlyIfAligned:!0})}function ys(e,t){var n,o;const{alwaysDispatchInitialScroll:i,dataLength:l,hasFooterComponent:r,initialContentOffset:s,initialScrollAtEnd:a,useBootstrapInitialScroll:c}=t,u=e.state,d=u.initialScroll,h=s??0,v=c&&a&&r;if(d&&(d.contentOffset===void 0||!!d.preserveForFooterLayout!==v&&((n=u.initialScrollSession)==null?void 0:n.kind)!=="offset")&&yt(e,{...d,contentOffset:h,preserveForFooterLayout:v}),c&&d&&((o=u.initialScrollSession)==null?void 0:o.kind)!=="offset"){ns(e,{initialScrollAtEnd:a,target:u.initialScroll});return}!i&&!h&&!(d&&l===0&&!(h===0&&!a))&&(d&&!a?kt(e,{resolvedOffset:h}):mo(e,{didInitialScroll:!0}))}function Cs(e,t){var n,o,i;const{dataLength:l,didDataChange:r,didStartFreshData:s,initialScrollAtEnd:a,latestInitialScroll:c,latestInitialScrollSessionKind:u,stylePaddingEnd:d,useBootstrapInitialScroll:h}=t,v=e.state,f=(o=(n=v.initialScrollSession)==null?void 0:n.previousDataLength)!=null?o:0,S=l>0&&(!v.hasHadNonEmptyData||s);if(l>0&&(v.hasHadNonEmptyData=!0),S&&(c?(yt(e,c),et(v,{kind:u,previousDataLength:f})):Ot(v)),v.initialScrollSession&&(v.initialScrollSession.previousDataLength=l),et(v),h){os(e,{dataLength:l,didDataChange:r,initialScrollAtEnd:a,previousDataLength:f,stylePaddingEnd:d});return}const m=f===0&&l>0&&!!v.initialScroll&&((i=e.state.initialScrollSession)==null?void 0:i.kind)==="offset"&&!!v.didFinishInitialScroll;f!==0||l===0||!v.initialScroll||!v.queuedInitialLayout||v.didFinishInitialScroll&&!m||(m&&go(e,{resetInitialScroll:!0}),nn(e))}function ll(e){e.indexByKey.clear(),e.idCache.length=0,e.positions.length=0,e.columns.length=0,e.columnSpans.length=0}function Es(e){var t;const n=e.pendingContainerIds;if(e.pendingContainerIds=void 0,n===void 0)return;const o=e.state;let i=n;if(i&&((t=o.userScrollAnchorReset)!=null&&t.keys.size)){i=new Set(i);for(const l of o.userScrollAnchorReset.keys){const r=o.containerItemKeys.get(l);r!==void 0&&i.add(r)}}return i}function wn(e,t){var n;const o=e.pendingContainerIds!==void 0,i=e.pendingContainerIds;if(t===void 0)e.pendingContainerIds=null;else if(i!==null){let l=i;if(!l)l=typeof t=="number"?new Set([t]):new Set(t);else if(typeof t=="number")l.add(t);else for(const r of t)l.add(r);e.pendingContainerIds=l}if(!o){const l=((n=C(e,"containerLayoutEpoch"))!=null?n:0)+1;_(e,"containerLayoutEpoch",l)}}function As(e,t,n,o){var i,l,r,s,a,c,u,d,h;const v=e.state,{columns:f,columnSpans:S,positions:m,props:{data:g,itemsAreEqual:I,keyExtractor:y}}=v,b=g[n];if(b===void 0)return{didChangePosition:!1,didRefreshData:!1};const T=(i=v.idCache[n])!=null?i:Z(v,n),M=Qi(v,t,n,b),w=(l=o?.updateLayout)!=null?l:!0;let F=!1,P=!1;if(w){const R=m[n];if(R===void 0)return _(e,`containerPosition${t}`,zt),{didChangePosition:!1,didRefreshData:!1};const z=(R||0)-((r=o?.scrollAdjustPending)!=null?r:0),N=(s=v.sizes.get(T))!=null?s:ge(e,T,n,b,void 0,void 0,void 0,M),U=jl(v,z,N,C(e,"totalSize")),$=f[n]||1,le=S[n]||1,te=C(e,`containerPosition${t}`),de=C(e,`containerColumn${t}`),ue=C(e,`containerSpan${t}`);U>zt&&U!==te&&(_(e,`containerPosition${t}`,U),F=!0),$>=0&&$!==de&&_(e,`containerColumn${t}`,$),le!==ue&&_(e,`containerSpan${t}`,le)}C(e,`containerItemIndex${t}`)!==n&&_(e,`containerItemIndex${t}`,n);const L=C(e,`containerItemData${t}`),D=()=>{_(e,`containerItemData${t}`,b),P=!0};if(L!==b){const R=((a=v.pendingDataComparison)==null?void 0:a.previousData)===v.previousData&&((c=v.pendingDataComparison)==null?void 0:c.nextData)===g?v.pendingDataComparison:void 0,z=(u=R?.byIndex[n])!=null?u:0;if(z===2)D();else if(z!==1){const N=(d=C(e,`containerItemKey${t}`))!=null?d:T,U=y?.(L,n);if(L===void 0||!y||U!==N)D();else if(!I)D();else{const $=I(L,b,n,g);(!v.pendingDataComparison||v.pendingDataComparison.previousData!==v.previousData||v.pendingDataComparison.nextData!==g)&&v.previousData&&(v.pendingDataComparison={byIndex:[],nextData:g,previousData:v.previousData}),(h=v.pendingDataComparison)!=null&&h.byIndex&&(v.pendingDataComparison.byIndex[n]=$?1:2),$||D()}}}return{didChangePosition:F,didRefreshData:P}}function bs(e,t,n){var o;const i=e.state,l=C(e,"numColumns");let r=t;i.columns[t]!==1&&(r=ti(i,l,t));let a=0;const c=i.columns[r];if(r>0){const u=r-1,d=(o=i.positions[u])!=null?o:0,h=ti(i,l,u),v=ws(e,h,u,n);a=d+v}return{column:c,currentRowTop:a,startIndex:r}}function ti(e,t,n){if(t<=1)return Math.max(0,n);let o=Math.max(0,n);for(;o>0&&e.columns[o]!==1;)o--;return o}function ws(e,t,n,o){const i=e.state;if(n<t)return 0;const{data:l}=i.props;if(!l)return 0;let r=0;for(let s=t;s<=n;s++){if(s<0||s>=l.length)continue;const a=i.idCache[s],c=ge(e,a,s,l[s],o);c>r&&(r=c)}return r}function Rs(e){var t,n;const o=e.state,{positions:i,props:{data:l}}=o,r=(t=C(e,"numColumns"))!=null?t:1;if(l.length===0)xt(e,null,0);else{const s=l.length-1,a=Z(o,s),c=i[s];if(a!==void 0&&c!==void 0)if(r>1){let u=s;for(;u>0;){const h=o.columns[u];if(h===1||h===void 0)break;u-=1}let d=0;for(let h=u;h<=s;h++){const v=(n=o.idCache[h])!=null?n:Z(o,h),f=ge(e,v,h,l[h]);f>d&&(d=f)}xt(e,null,c+d)}else{const u=ge(e,a,s,l[s]);if(u!==void 0){const d=c+u;xt(e,null,d)}}}}function rl(e){const t=e.state,{props:{snapToIndices:n}}=t,o=t.props.horizontal?Ce(e):void 0,i=Array(n.length);for(let l=0;l<n.length;l++){const r=n[l];Z(t,r);const s=t.positions[r];i[l]=bi(t,s,o)}_(e,"snapToOffsets",i)}function sl(e,t,{doMVCP:n,forceFullUpdate:o=!1,optimizeForVisibleWindow:i=!1,scrollBottomBuffered:l,scrollVelocity:r,startIndex:s}={doMVCP:!1,forceFullUpdate:!1,optimizeForVisibleWindow:!1,scrollBottomBuffered:-1,startIndex:0}){var a,c,u,d,h;const v=e.state,f=e.positionListeners.size>0,{columns:S,columnSpans:m,indexByKey:g,positions:I,idCache:y,sizesKnown:b,props:{data:T,overrideItemLayout:M,snapToIndices:w},scrollingTo:F}=v,P=T.length,E=(a=C(e,"numColumns"))!=null?a:1,L=E>1,D=_e?new Map:void 0,R=C(e,"extraData"),z=M?{span:1}:void 0,N=v.lastScrollDelta,U=r??Fn(v),$=!o&&!t&&(i||Math.abs(U)>0||v.scrollLength>0&&N>v.scrollLength),le=l+1e3,te=!0,de=!n||t||v.scrollAdjustHandler.getAdjust()!==0||((c=C(e,"scrollAdjustPending"))!=null?c:0)!==0,ue=!1;let re=0,x=1,ne=0;if(t&&(m.length=0),L||(S.length&&(S.length=0),m.length&&(m.length=0)),s>0){if(L){const{startIndex:j,currentRowTop:ie}=bs(e,s,te);s=j,re=ie}else if(s<P){const j=s-1,ie=Z(v,j),Se=(u=I[j])!=null?u:0,Ne=(d=b.get(ie))!=null?d:ge(e,ie,j,T[j],te,de,ue);re=Se+Ne}}const oe=t||g.size===0,ee=L&&!!M&&!!z;let Y=!1,G;for(let j=s;j<P;j++){if($&&G!==void 0&&j>G){Y=!0;break}$&&G===void 0&&!F&&!t&&re>le&&(G=j+(L?E:1)+10);const ie=(h=y[j])!=null?h:Z(v,j);let Se=1;if(ee){z.span=1,M(z,T[j],j,E,R);const pe=z.span;pe!==void 0&&Number.isFinite(pe)&&(Se=Math.max(1,Math.min(E,Math.round(pe))))}L&&x+Se-1>E&&(re+=ne,x=1,ne=0);const Ne=b.get(ie),fe=Ne!==void 0?Ne:ge(e,ie,j,T[j],te,de,ue);_e&&oe&&(D.has(ie)&&console.error(`[legend-list] Error: Detected overlapping key (${ie}) which causes missing items and gaps and other terrrible things. Check that keyExtractor returns unique values.`),D.set(ie,j)),re!==I[j]&&(I[j]=re,f&&Yl(e,ie,re)),oe&&g.set(ie,j),L?(S[j]=x,m[j]=Se,fe>ne&&(ne=fe),x+=Se,x>E&&(re+=ne,x=1,ne=0)):re+=fe}Y||Rs(e),w&&rl(e)}function al(e,t){let n=e.mapViewabilityConfigStates;n||(n=new Map,e.mapViewabilityConfigStates=n);let o=n.get(t);return o||(o={end:-1,endBuffered:-1,previousEnd:-1,previousStart:-1,start:-1,startBuffered:-1,viewableItems:[]},n.set(t,o)),o}function _s(e){let{viewabilityConfig:t,viewabilityConfigCallbackPairs:n,onViewableItemsChanged:o}=e;return(t||o)&&(n=[...n||[],{onViewableItemsChanged:o,viewabilityConfig:t||{viewAreaCoveragePercentThreshold:0}}]),n}function cl(e,t,n,o,i,l,r=i,s=l){const{props:{data:a}}=e;for(const c of n){const u=al(t,c.viewabilityConfig.id);u.start=i,u.end=l,u.startBuffered=r,u.endBuffered=s,c.viewabilityConfig.minimumViewTime?e.scheduledWork.timeout(()=>ni(a,c,e,t,o),c.viewabilityConfig.minimumViewTime):ni(a,c,e,t,o)}}function ni(e,t,n,o,i){const{viewabilityConfig:l,onViewableItemsChanged:r}=t,s=l.id,a=al(o,s),{viewableItems:c,start:u,end:d,startBuffered:h,endBuffered:v}=a;let f;for(const[I,y]of o.mapViewabilityAmountValues)dl(n,o,l,I,y.key,i,y.item,y.index).sizeVisible<0&&(f??(f=[]),f.push(I));const S=[],m=new Set;if(c)for(const I of c){m.add(I.key);const y=n.indexByKey.get(I.key),b=y!==void 0?e[y]:void 0,T=oo(o,I.key);let M=!1;y!==void 0&&b!==void 0&&(M=ii(n,o,l,T,I.key,i,b,y)),M||S.push({...I,index:y??I.index,isViewable:!1,item:b??I.item})}const g=[];for(let I=u;I<=d;I++){const y=e[I];if(y){const b=Z(n,I),T=oo(o,b);if(ii(n,o,l,T,b,i,y,I)){const M={containerId:T,index:I,isViewable:!0,item:y,key:b};g.push(M),m.has(M.key)||S.push(M)}}}if(Object.assign(a,{previousEnd:d,previousStart:u,viewableItems:g}),S.length>0){a.viewableItems=g;for(let I=0;I<S.length;I++){const y=S[I];Ps(o,s,y.containerId,y)}r&&r({changed:S,end:d,endBuffered:v,start:u,startBuffered:h,viewableItems:g})}if(f)for(const I of f){const y=o.mapViewabilityAmountValues.get(I);y&&y.sizeVisible<0&&o.mapViewabilityAmountValues.delete(I)}}function oi(e,t){return!!e&&e.containerId===t.containerId&&e.index===t.index&&e.isViewable===t.isViewable&&e.item===t.item&&e.key===t.key&&e.percentOfScroller===t.percentOfScroller&&e.percentVisible===t.percentVisible&&e.scrollSize===t.scrollSize&&e.size===t.size&&e.sizeVisible===t.sizeVisible}function dl(e,t,n,o,i,l,r,s){const{sizes:a,scroll:c}=e,u=(C(t,"stylePaddingTop")||0)+(C(t,"alignItemsAtEndPadding")||0)+(C(t,"headerSize")||0),{itemVisiblePercentThreshold:d,viewAreaCoveragePercentThreshold:h}=n,v=h!=null,f=v?h:d,S=c-u,m=e.positions[s],g=a.get(i)||0;if(m===void 0){const D={containerId:o,index:s,isViewable:!1,item:r,key:i,percentOfScroller:0,percentVisible:0,scrollSize:l,size:g,sizeVisible:-1},R=t.mapViewabilityAmountValues.get(o);if(!oi(R,D)){t.mapViewabilityAmountValues.set(o,D);const z=t.mapViewabilityAmountCallbacks.get(o);z&&z(D)}return D}const I=m-S,y=I+g,b=I>=0&&y<=l&&y>I,T=b?g:Math.min(y,l)-Math.max(I,0),M=g?b?100:100*(T/g):0,w=g?100*(T/l):0,P=(b?100:v?w:M)>=f,E={containerId:o,index:s,isViewable:P,item:r,key:i,percentOfScroller:w,percentVisible:M,scrollSize:l,size:g,sizeVisible:T},L=t.mapViewabilityAmountValues.get(o);if(!oi(L,E)){t.mapViewabilityAmountValues.set(o,E);const D=t.mapViewabilityAmountCallbacks.get(o);D&&D(E)}return E}function ii(e,t,n,o,i,l,r,s){let a=t.mapViewabilityAmountValues.get(o);return(!a||a.key!==i||a.index!==s)&&(a=dl(e,t,n,o,i,l,r,s)),a.isViewable}function Ps(e,t,n,o){const i=n+t;e.mapViewabilityValues.set(i,o);const l=e.mapViewabilityCallbacks.get(i);l?.(o)}var li=yi.unstable_batchedUpdates,Ts=typeof li=="function"?li:e=>e(),Ls=32,Ms=64,zs=3;function Os(e,t){if(e<=0||t<=0)return 0;const n=Math.ceil(t*zs),o=t+Ms,i=Math.max(t,Math.min(n,o),Math.min(e,Ls)),l=Math.max(e,t);return Math.min(l,i)}function ks(e,t){return e<=0||t<=0?0:Math.min(Math.max(e,t),Math.max(t,Math.ceil(t*1.5)))}function Fs(e,t,n,o,i,l,r){var s;const a=t.length;if(a===0)return[];const c=C(e,"numContainers"),u=e.state,{containerItemMetadata:d,stickyContainerPool:h}=u,v=u.props.recycleItems&&!!u.props.positionComponentInternal,f=i.length>0?new Set(i):void 0,S=t.map((E,L)=>({isSticky:u.props.stickyHeaderIndicesSet.has(E),itemIndex:E,itemType:l?.(E),order:L})),m=S.filter(E=>!E.isSticky),g=S.filter(E=>E.isSticky),I=[],y=[];for(let E=0;E<c;E++){const L=C(e,`containerItemKey${E}`),D=!!f?.has(E);if(!(L&&r?.has(L)&&u.indexByKey.has(L))){if(h.has(E))(L===void 0||D)&&y.push({containerIndex:E,distance:Number.POSITIVE_INFINITY});else if(L===void 0||D)I.push({containerIndex:E,distance:Number.POSITIVE_INFINITY});else if(!v){const z=u.indexByKey.get(L);if(z!==void 0&&(z<n||z>o)){const N=z<n?n-z:z-o;I.push({containerIndex:E,distance:N})}}}}I.sort(Ns);const b=new Array(a);let T=c,M=!1;const w=(E,L)=>{b[E.order]={containerIndex:L,itemIndex:E.itemIndex,itemType:E.itemType},f?.delete(L)&&(M=!0)},F=(E,L,D)=>{for(const R of E){if(b[R.order])continue;const z=L.findIndex(N=>{var U;return D((U=d.get(N.containerIndex))==null?void 0:U.itemType,R.itemType)});if(z!==-1){const[N]=L.splice(z,1);w(R,N.containerIndex)}}},P=(E,L,D)=>{l&&F(E,L,(R,z)=>z!==void 0&&R===z),F(E,L,R=>R===void 0),D&&F(E,L,()=>!0)};P(m,I,!0),P(g,y,!1);for(const E of S){if(b[E.order])continue;const L=T++;E.isSticky&&h.add(L),w(E,L)}if(M&&(i.length=0,f))for(const E of f)i.push(E);if(_e){const E=(s=C(e,"numContainersPooled"))!=null?s:Number.POSITIVE_INFINITY;T>E&&console.warn("[legend-list] No unused container available, so creating one on demand. This can be a minor performance issue and is likely caused by the estimatedItemSize being too large. Consider decreasing estimatedItemSize.",{debugInfo:{numContainers:c,numContainersPooled:E,numNeeded:a,stillNeeded:T-c}})}return b}function Ns(e,t){return t.distance-e.distance}function Ds(e){const t=e.state;t.queuedInitialLayout=!0,ki(e),mo(e,{didLayout:!0}),t.pendingMaintainScrollAtEnd&&bt(e)}var Vs=4,Bs=100;function js(e,t){if(t<=0)return 0;const n=Math.min(1,Math.abs(e)/Vs);return Math.sign(e)*t*n}function Ws(e){const t=e.state;t.scheduledWork.timeout(()=>{var n;t.scrollHistory.length=0,(n=t.triggerCalculateItemsInView)==null||n.call(t)},Bs,"renderRangeProjection")}function Hs(e,t,n){const o=n.positions;for(let i=e.length-1;i>=0;i--){const l=e[i],r=o[l];if(r!==void 0&&t>=r)return i}return-1}function Ks(e,t){const n=e.state;let o=!1;for(const i of n.stickyContainerPool){const l=C(e,`containerItemKey${i}`);if((l?n.indexByKey.get(l):void 0)===t){o=!0;break}}return o}function Us(e,t,n,o,i,l,r){var s;const a=e.state;_(e,"activeStickyIndex",n>=0?t[n]:-1);for(let c=0;c<=1;c++){const u=n-c;if(u<0)continue;const d=t[u];if(Ks(e,d))continue;const h=(s=a.idCache[d])!=null?s:Z(a,d);h&&!a.containerItemKeys.has(h)&&(d<l||d>r)&&!i.has(d)&&(i.add(d),o.push(d))}}function $s(e,t,n,o,i,l,r){var s,a;const c=e.state;for(const u of c.stickyContainerPool){const d=C(e,`containerItemKey${u}`),h=d?c.indexByKey.get(d):void 0;if(h===void 0||r(h))continue;const v=t.indexOf(h);if(v===-1){c.stickyContainerPool.delete(u),_(e,`containerSticky${u}`,!1);continue}if(v>=i-1&&v<=i+1)continue;const S=t[v+1];let m=!1;if(S){const g=c.positions[S];m=g!==void 0&&n>g+o*2}else{const g=(s=c.idCache[h])!=null?s:Z(c,h);if(g){const I=c.positions[h],y=(a=c.sizes.get(g))!=null?a:ge(e,g,h,c.props.data[h]);m=I!==void 0&&n>I+y+o*3}}m&&l.push(u)}}function ul(e,t,n,o,i,l){let r=!1;return e.startNoBuffer===null&&n+o>i&&(e.startNoBuffer=t),e.firstFullyOnScreenIndex===void 0&&n>=i-10&&n<=l&&(e.firstFullyOnScreenIndex=t),e.startNoBuffer!==null&&(n<=l?e.endNoBuffer=t:r=!0),r}function fl(e,t){var n,o;const i=[],l=(n=t.firstFullyOnScreenIndex)!=null?n:t.startNoBuffer;if(l!=null&&t.endNoBuffer!==null)for(let r=l;r<=t.endNoBuffer;r++){const s=(o=e.idCache[r])!=null?o:Z(e,r);i.push(s)}return i}function lo(e,t){var n;const o=e.props.onFirstVisibleItemChanged;if(!o||t===null||t<0||t>=e.props.data.length)return;const i=(n=e.idCache[t])!=null?n:Z(e,t),l=e.lastFirstVisibleItemCallback;l?.index===t&&l.key===i||(e.lastFirstVisibleItemCallback={index:t,key:i},o({index:t,item:e.props.data[t],key:i}))}function qs(e,t){var n,o;const i=e.state,{endBuffered:l,idCache:r,positions:s,props:{data:a},sizes:c,startBuffered:u}=i;if(u===null||l===null||u<0||l<u)return null;for(let d=u;d<=l&&d<a.length;d++){const h=(n=r[d])!=null?n:Z(i,d),v=(o=c.get(h))!=null?o:ge(e,h,d,a[d]);if(s[d]+v>t)return d}return null}function Gs(e,t,n,o,i){var l,r;const s=e.state,{endBuffered:a,idCache:c,positions:u,props:{data:d},sizes:h,startBuffered:v}=s;if(v===null||a===null||v<0||a<v)return;const f={endNoBuffer:null,firstFullyOnScreenIndex:void 0,startNoBuffer:null};for(let S=v;S<=a&&S<d.length;S++){const m=(l=c[S])!=null?l:Z(s,S),g=(r=h.get(m))!=null?r:ge(e,m,S,d[S]),I=u[S];if(ul(f,S,I,g,o,i))break}Object.assign(s,{endNoBuffer:f.endNoBuffer,firstFullyOnScreenIndex:f.firstFullyOnScreenIndex,idsInView:fl(s,f),startNoBuffer:f.startNoBuffer}),lo(s,f.startNoBuffer),f.startNoBuffer!==null&&f.endNoBuffer!==null&&cl(s,e,t,n,f.startNoBuffer,f.endNoBuffer,v,a)}function Je(e,t={}){const n=e.state;Ts(()=>{var o,i,l,r,s,a,c,u,d,h,v,f,S,m,g,I,y,b,T,M,w;const{columns:F,containerItemKeys:P,enableScrollForNextCalculateItemsInView:E,idCache:L,indexByKey:D,minIndexSizeChanged:R,positions:z,props:{alwaysRenderIndicesArr:N,alwaysRenderIndicesSet:U,getItemType:$,keyExtractor:le,onStickyHeaderChange:te},scrollForNextCalculateItemsInView:de,scrollLength:ue,sizes:re,startBufferedId:x,viewabilityConfigCallbackPairs:ne}=n,{data:oe}=n.props,ee=n.props.stickyHeaderIndicesArr||[],Y=n.props.stickyHeaderIndicesSet||new Set,G=Di(e,t.drawDistanceMode),{dataChanged:j,doMVCP:ie,forceFullItemPositions:Se,mvcpAdjustmentSource:Ne}=t,fe=((o=n.initialScrollSession)==null?void 0:o.kind)==="bootstrap"?n.initialScrollSession.bootstrap:void 0,pe=!!fe,Ue=C(e,"numContainers");if(!oe||ue===0||!Ue)return;let nt=Ce(e),V;const H=C(e,"stylePaddingTop")+C(e,"alignItemsAtEndPadding")+C(e,"headerSize"),Q=C(e,"numColumns"),K=(i=t.scrollVelocity)!=null?i:Fn(n),De=0,{initialScroll:ot,queuedInitialLayout:Nt}=n,Ve=pe?(l=fe?.scroll)!=null?l:n.scroll:!Nt&&Yt(n)&&ot?ke(e,ot):n.scroll;let Be=0,Rt=0,me=0,$e=0,dt=0,je=0,cn=Ve;const dn=A=>{var W;cn=A,Be=(W=C(e,"scrollAdjustPending"))!=null?W:0,Rt=Be-H,me=Math.round(A+De+Rt),me+ue>nt&&(me=Math.max(0,nt-ue))};dn(Ve);const Dt=C(e,"activeStickyIndex"),un=()=>{const A=ee.length>0?Hs(ee,me,n):-1,W=A>=0?ee[A]:-1,J=Dt!==W;(A>=0||Dt>=0)&&_(e,"activeStickyIndex",W);const q=!!te&&ee.length>0&&J;return{currentStickyIdx:A,finishCalculateItemsInView:q?()=>{const Ae=oe[W];Ae!==void 0&&te?.({index:W,item:Ae})}:void 0}};let we=j?void 0:un(),ut=G,_t=G;K>0||K===0&&me<Math.max(50,G)?(ut=G*.5,_t=G*1.5):(ut=G*1.5,_t=G*.5);const Vt=!j&&!Se&&!pe&&!Yt(n)&&!n.scrollingTo&&!n.pendingNativeMVCPAdjust&&!!C(e,"readyToRender")?js(K,Math.min(ut,_t)):0,fn=()=>{const A=Math.max(0,me),W=Math.max(0,-cn);dt=Math.max(A,me+ue+W),$e=A-ut+Vt,je=dt+_t+Vt};if(fn(),Vt!==0&&Ws(e),E&&!pe&&!j&&!Se&&de){const{top:A,bottom:W}=de;if(A===null&&W===null)n.scrollForNextCalculateItemsInView=void 0;else if((A===null||$e>A)&&(W===null||je<W)&&!sn(n)){ne?Gs(e,ne,ue,me,dt):n.props.onFirstVisibleItemChanged&&lo(n,qs(e,me)),(r=we?.finishCalculateItemsInView)==null||r.call(we);return}}const Bt=ie&&!pe?kr(e,j):void 0;j&&ll(n);const vn=Se||j?0:(s=R??n.startBuffered)!=null?s:0,Bn=!Se&&!j&&Q>1&&R!==void 0;sl(e,j,{doMVCP:ie,forceFullUpdate:!!Se,optimizeForVisibleWindow:Bn,scrollBottomBuffered:je,scrollVelocity:K,startIndex:vn}),nt=Ce(e),R!==void 0&&(n.minIndexSizeChanged=void 0);let ft;if(j&&ie&&n.props.maintainVisibleContentPosition.data&&n.didContainersLayout&&n.idsInView.length>0){const A=n.props.maintainVisibleContentPosition.shouldRestorePosition;ft=new Set;for(const W of n.idsInView){const J=D.get(W);J!==void 0&&(A&&!A(oe[J],J,oe)||ft.add(W))}}const Pt=n.scroll,jn=(a=C(e,"scrollAdjustPending"))!=null?a:0;Bt?.(),Bt&&(n.scroll!==Pt||((c=C(e,"scrollAdjustPending"))!=null?c:0)!==jn)&&(dn(n.scroll),fn()),j&&(we=un());let Me=null,jt=null,ze=null,it=(u=pe?fe?.targetIndexSeed:void 0)!=null?u:!j&&x&&D.get(x)||0;for(let A=it;A>=0;A--){const W=(d=L[A])!=null?d:Z(n,A),J=z[A],q=(h=re.get(W))!=null?h:ge(e,W,A,oe[A]);if(J+q>$e)it=A;else break}if(Q>1)for(;it>0;){const A=F[it];if(A===1||A===void 0)break;it-=1}let Wt=!1,vt,ht,Ht=0;for(let A=0;A<Ue;A++){const W=C(e,`containerItemKey${A}`);if(W!==void 0){const J=D.get(W);Ht=Math.max(Ht,J)}}const Ee={endNoBuffer:null,firstFullyOnScreenIndex:void 0,startNoBuffer:null},Kt=oe.length;for(let A=Math.max(0,it);A<Kt&&(!Wt||A<=Ht);A++){const W=(v=L[A])!=null?v:Z(n,A),J=(f=re.get(W))!=null?f:ge(e,W,A,oe[A]),q=z[A];Wt||(ul(Ee,A,q,J,me,dt),Me===null&&q+J>$e&&(Me=A,jt=W,$e<0?vt=null:vt=q),Ee.startNoBuffer!==null&&(q<=je?(ze=A,je>nt?ht=null:ht=q+J):Wt=!0))}Object.assign(n,{endBuffered:ze,endNoBuffer:Ee.endNoBuffer,firstFullyOnScreenIndex:Ee.firstFullyOnScreenIndex,idsInView:fl(n,Ee),startBuffered:Me,startBufferedId:jt,startNoBuffer:Ee.startNoBuffer}),E&&vt!==void 0&&ht!==void 0&&(n.scrollForNextCalculateItemsInView=Xt(vt)&&Xt(ht)?void 0:{bottom:ht,top:vt});let qe=Ue;const St=[];if(j)for(let A=0;A<qe;A++){const W=C(e,`containerItemKey${A}`);(!le||W&&D.get(W)===void 0)&&St.push(A)}const Re=n.scrollTargetPinnedRange;let Ge=0,Tt=-1;Re&&(Ge=Math.max(0,Math.min(Re.start,Re.end)),Tt=Math.min(Kt-1,Math.max(Re.start,Re.end)));const Oe=Ge<=Tt,lt=A=>U.has(A)||Oe&&A>=Ge&&A<=Tt;if(Me!==null&&ze!==null){const A=[],W=new Set,J=q=>{var Ae;if(q>=0&&q<Kt){const be=(Ae=L[q])!=null?Ae:Z(n,q),se=P.get(be);se!==void 0?n.stickyContainerPool.add(se):!Xt(be)&&!W.has(q)&&(W.add(q),A.push(q))}};for(let q=Me;q<=ze;q++){const Ae=(S=L[q])!=null?S:Z(n,q);P.has(Ae)||(W.add(q),A.push(q))}for(const q of N)J(q);if(Oe)for(let q=Ge;q<=Tt;q++)J(q);if(ee.length>0?Us(e,ee,(m=we?.currentStickyIdx)!=null?m:-1,A,W,Me,ze):Dt!==-1&&_(e,"activeStickyIndex",-1),A.length>0){const Ae=Fs(e,A,Me,ze,St,$?be=>{const se=$(oe[be],be);return se!==void 0?String(se):""}:void 0,ft);for(const be of Ae){const se=be.itemIndex,ae=be.containerIndex,He=(g=L[se])!=null?g:Z(n,se),ve=C(e,`containerItemKey${ae}`);if(ve&&ve!==He&&P.delete(ve),n.containerItemMetadata.set(ae,Ji(n,se,oe[se],be.itemType)),ve!==He&&(V??(V=new Set),V.add(ae),n.containerItemGenerations[ae]=((I=n.containerItemGenerations[ae])!=null?I:0)+1,n.props.hideItemsUntilMeasured)){const Hn=n.sizesKnown.has(He)||el(n,ae,se,oe[se]).fixedItemSize!==void 0;_(e,`containerLayoutReady${ae}`,Hn)}_(e,`containerItemKey${ae}`,He),_(e,`containerItemIndex${ae}`,se),_(e,`containerItemData${ae}`,oe[se]),P.set(He,ae),(y=n.userScrollAnchorReset)==null||y.keys.add(He);const pt=`containerSticky${ae}`,Lt=Y.has(se),Wn=lt(se);Lt?(_(e,pt,!0),n.stickyContainerPool.add(ae)):(C(e,pt)&&_(e,pt,!1),Wn?n.stickyContainerPool.add(ae):n.stickyContainerPool.delete(ae)),ae>=qe&&(qe=ae+1)}qe!==Ue&&(_(e,"numContainers",qe),qe>C(e,"numContainersPooled")&&_(e,"numContainersPooled",ks(Kt,qe)))}((b=n.userScrollAnchorReset)==null?void 0:b.keys.size)===0&&(n.userScrollAnchorReset=void 0)}n.stickyContainerPool.size>0&&$s(e,ee,me,G,(T=we?.currentStickyIdx)!=null?T:-1,St,lt);const We=St.length>0?new Set(St):void 0;let Ye=!1;for(let A=0;A<qe;A++){const W=C(e,`containerItemKey${A}`);if(We?.has(A))W!==void 0&&(P.delete(W),V??(V=new Set),V.add(A),n.containerItemGenerations[A]=((M=n.containerItemGenerations[A])!=null?M:0)+1),n.containerItemMetadata.delete(A),n.stickyContainerPool.has(A)&&(_(e,`containerSticky${A}`,!1),n.stickyContainerPool.delete(A)),_(e,`containerItemKey${A}`,void 0),_(e,`containerItemIndex${A}`,void 0),_(e,`containerItemData${A}`,void 0),_(e,`containerPosition${A}`,zt),_(e,`containerColumn${A}`,-1),_(e,`containerSpan${A}`,1);else{const J=D.get(W);J!==void 0&&(Ye=As(e,A,J,{scrollAdjustPending:Be,updateLayout:!0}).didChangePosition||Ye)}}if(V&&ho&&wn(e,V),Ye&&_(e,"lastPositionUpdate",Date.now()),pe){rs(e);return}lo(n,Ee.startNoBuffer),!Nt&&!n.didContainersLayout&&(Yt(n)?Jt(n,n.startBuffered,n.endBuffered):Jt(n,n.startNoBuffer,n.endNoBuffer)||Jt(n,n.startBuffered,n.endBuffered))&&(Ds(e),Is(e)),ne&&Ee.startNoBuffer!==null&&Ee.endNoBuffer!==null&&cl(e.state,e,ne,ue,Ee.startNoBuffer,Ee.endNoBuffer,Me??Ee.startNoBuffer,ze??Ee.endNoBuffer),(w=we?.finishCalculateItemsInView)==null||w.call(we)})}function Rn(e){var t,n;const o=e.state,i=o.props.anchoredEndSpace,l=C(e,"anchoredEndSpaceSize"),r=o.anchoredEndSpaceReadyAnchorIndex,s=o.anchoredEndSpaceReadyAnchorKey,a=i?.anchorIndex;let c,u=!0,d=0;if(i){const{anchorIndex:S,anchorMaxSize:m,anchorOffset:g=0}=i,{data:I}=o.props;if(S>=0&&S<I.length&&o.scrollLength>0){c=Z(o,S);let y=0,b=!1;for(let T=S;T<I.length;T++){const M=Hi(e,T),w=T===S&&m!==void 0?Math.min(M||0,Math.max(0,m)):M;M===void 0&&(b=!0),w!=null&&w>0&&(y+=w)}y=Math.max(0,y-e.scrollAxisGap),y+=(e.values.get("footerSize")||0)+vo(o.props),u=!b,d=b?l||0:Math.max(0,o.scrollLength-y-g)}else S>=0&&(u=!1)}const h=l!==d&&(l!==void 0||i!==void 0),v=(l||0)!==d;return u&&(h||(r!==a||s!==c))&&(o.anchoredEndSpaceReadyAnchorIndex=a,o.anchoredEndSpaceReadyAnchorKey=c,h&&(_(e,"anchoredEndSpaceSize",d),(t=i?.onSizeChanged)==null||t.call(i,d)),v&&(Et(e),Ft(e,o.scroll,!0,{markHasScrolled:!1})),(n=i?.onReady)==null||n.call(i,{anchorIndex:a,anchorKey:c,size:d})),d}function Ys(e){var t;const n=e.state;n.userScrollAnchorReset!==void 0?(Je(e),((t=n.userScrollAnchorReset)==null?void 0:t.keys.size)===0&&(n.userScrollAnchorReset=void 0)):n.mvcpAnchorLock?n.scheduledWork.has("mvcpRecalculate")||n.scheduledWork.frame(()=>Je(e,{doMVCP:!0,mvcpAdjustmentSource:"item-size"}),"mvcpRecalculate"):(n.scheduledWork.cancel("mvcpRecalculate"),Je(e,{doMVCP:!0,mvcpAdjustmentSource:"item-size"}))}function ri(e,t,n){if(e.state.needsOtherAxisSize){const i=n?t.height:t.width,l=C(e,"otherAxisSize");(!l||i>l)&&_(e,"otherAxisSize",i)}}var Xe;function vl(e){const t=Xe===void 0;Xe??(Xe=new Map);try{e()}finally{if(t){const n=Xe;Xe=void 0;for(const[o,i]of n)wo(o,i)}}}function xs(e,t){e.didChange||(e.didChange=t.didChange),e.didMeasureUserScrollAnchorResetItem||(e.didMeasureUserScrollAnchorResetItem=t.didMeasureUserScrollAnchorResetItem),e.needsRecalculate||(e.needsRecalculate=t.needsRecalculate),e.shouldMaintainScrollAtEnd||(e.shouldMaintainScrollAtEnd=t.shouldMaintainScrollAtEnd)}function Xs(e,t){var n;const o=e.state;t.needsRecalculate?(o.scrollForNextCalculateItemsInView=void 0,Ys(e)):t.didMeasureUserScrollAnchorResetItem&&((n=o.userScrollAnchorReset)==null?void 0:n.keys.size)===0&&(o.userScrollAnchorReset=void 0),t.didChange&&Rn(e),t.didChange&&t.shouldMaintainScrollAtEnd&&bt(e)}function hl(e,t){if(Xe){const n=Xe.get(e);n?n.push(t):Xe.set(e,[t])}else wo(e,[t])}function wo(e,t){var n;const o=e.state,i={};for(const l of t)if(l.containerId===void 0||C(e,`containerItemKey${l.containerId}`)===l.itemKey){const s=o.indexByKey.get(l.itemKey),a=s===void 0||(n=o.props.data)==null?void 0:n[s],c=l.containerId!==void 0&&s!==void 0&&a!==void 0?el(o,l.containerId,s,a):void 0,u=Zs(e,l.itemKey,l.size,c);xs(i,u)}Xs(e,i)}function Zs(e,t,n,o){var i,l;const r=e.state,s=r.userScrollAnchorReset,a=!!s?.keys.delete(t),{didContainersLayout:c,sizesKnown:u,props:{getFixedItemSize:d,getItemType:h,horizontal:v,onItemSizeChanged:f,data:S,maintainScrollAtEnd:m}}=r;if(!S)return{didMeasureUserScrollAnchorResetItem:a};const g=r.indexByKey.get(t);if(d){if(g===void 0)return{didMeasureUserScrollAnchorResetItem:a};const F=r.props.data[g];if(F===void 0)return{didMeasureUserScrollAnchorResetItem:a};if(!o?.didResolveFixedItemSize){const E=(l=o?.itemType)!=null?l:h&&(i=h(F,g))!=null?i:"";o={didResolveFixedItemSize:!0,fixedItemSize:d(F,g,E),itemType:E}}const P=o.fixedItemSize;if(P!==void 0&&P===u.get(t))return ri(e,n,v),{didMeasureUserScrollAnchorResetItem:a}}let I=!c,y=!1,b;const T=r.sizesKnown.get(t),M=Js(e,t,n,o),w=en(v?n.width:n.height);if(M!==0){b=b!==void 0?Math.min(b,g):g;const{startBuffered:F,endBuffered:P}=r;I||(I=g>=F&&g<=P),!I&&r.containerItemKeys.has(t)&&(I=!0),(T===void 0||Math.abs(T-w)>5)&&(y=!0),f?.({index:g,itemData:r.props.data[g],itemKey:t,previous:w-M,size:w})}if(b!==void 0&&(r.minIndexSizeChanged=r.minIndexSizeChanged!==void 0?Math.min(r.minIndexSizeChanged,b):b),ri(e,n,v),c||Jt(r,r.startBuffered,r.endBuffered)){const F=y&&!!m?.onItemLayout;return{didChange:M!==0,didMeasureUserScrollAnchorResetItem:a,needsRecalculate:I,shouldMaintainScrollAtEnd:F}}return{didChange:M!==0,didMeasureUserScrollAnchorResetItem:a}}function Js(e,t,n,o){var i,l;const r=e.state,{indexByKey:s,sizesKnown:a,averageSizes:c,props:{data:u,horizontal:d,getItemType:h,getFixedItemSize:v}}=r;if(!u)return 0;const f=s.get(t),S=u[f];let m=o?.itemType,g=o?.fixedItemSize;v&&!o?.didResolveFixedItemSize&&(m=h&&(i=h(S,f))!=null?i:"",g=v(S,f,m));const I=o?.didResolveFixedItemSize||m!==void 0||g!==void 0?{didResolveFixedItemSize:o?.didResolveFixedItemSize,fixedItemSize:g,itemType:m}:void 0,y=ge(e,t,f,S,void 0,void 0,void 0,I),b=d?n.width:n.height,T=a.get(t),M=Math.round(b);if(a.set(t,M),g===void 0&&M>0){m??(m=h&&(l=h(S,f))!=null?l:"");let w=c[m];w||(w=c[m]={avg:0,num:0}),w.num===0?(w.avg=M,w.num++):T!==void 0&&T>0?w.avg+=(M-T)/w.num:(w.avg=(w.avg*w.num+M)/(w.num+1),w.num++)}return!y||Math.abs(y-M)>.1?(no(e,t,M),M-y):0}function Qs(e,t=null){const n=[],o=t??e.viewRefs.keys();for(const i of o){const l=e.viewRefs.get(i),r=C(e,`containerItemKey${i}`),s=l?.current;if(r!==void 0&&s){const a=s.getBoundingClientRect();Ql(s,a),n.push({containerId:i,itemKey:r,size:{height:a.height,width:a.width}})}}n.length>0&&wo(e,n)}var Sl=p.forwardRef,Ke=p.memo,ea=Ke(function({children:t}){const n=Fe(),[o]=Pe(["containerLayoutEpoch"]);return p.useLayoutEffect(()=>{{const i=Es(n);i!==void 0&&Qs(n,i)}},[n,o]),t}),yn=e=>p.isValidElement(e)?e:e?p.createElement(e,null):null,ta=typeof document<"u"&&!!document.getElementById("react-native-stylesheet"),ro={contain:"paint layout style",...ta?{display:"flex",flexDirection:"column"}:{}},na=Ke(function({id:t,horizontal:n,style:o,refView:i,...l}){const[r=zt]=Pe([`containerPosition${t}`]),s=On(o)?Object.assign({},...o):o,a=n?{...ro,...s,left:r}:{...ro,...s,top:r},{animatedScrollY:c,onLayout:u,onLayoutChange:d,stickyHeaderConfig:h,...v}=l;return p.createElement("div",{ref:i,...v,style:a})}),oa=Ke(function({id:t,horizontal:n,style:o,refView:i,animatedScrollY:l,stickyHeaderConfig:r,onLayout:s,onLayoutChange:a,children:c,...u}){const[d=zt,h,v]=Pe([`containerPosition${t}`,"activeStickyIndex",`containerItemIndex${t}`]),f=p.useMemo(()=>{var g;return(g=On(o)?Object.assign({},...o):o)!=null?g:{}},[o]),S=p.useMemo(()=>{var g;const I={...ro,...f};delete I.transform;const y=(g=r?.offset)!=null?g:0,b=h===v;return I.position=b?"sticky":"absolute",I.zIndex=v+1e3,n?I.left=b?y:d:I.top=b?y:d,I},[f,n,d,v,h,r?.offset]),m=p.useMemo(()=>r?.backdropComponent?p.createElement("div",{style:{inset:0,pointerEvents:"none",position:"absolute"}},yn(r.backdropComponent)):null,[r?.backdropComponent]);return p.createElement("div",{ref:i,style:S,...u},m,c)}),ia=na;function la(e){p.useState(()=>e())}var pl=p.createContext(null),ra=-1;function sa(){return p.useContext(pl)}function aa(){var e;const t=sa(),n=(e=t?.containerId)!=null?e:ra,[o]=Pe([`containerItemKey${n}`]);return xl("lastItemKeys",l=>t&&!Xt(o)&&l?.includes(o)||!1)}function ca({ItemSeparatorComponent:e,leadingItem:t}){return aa()?null:p.createElement(e,{leadingItem:t})}var Xn=null;function da(){return Xn||(Xn=new ResizeObserver(e=>{vl(()=>{for(const t of e){const n=Cn.get(t.target);if(n)for(const o of n)o(t)}})})),Xn}var Cn=new WeakMap;function ua(e,t){var n;if(typeof ResizeObserver>"u"||!e)return()=>{};const o=da(),i=(n=Cn.get(e))!=null?n:new Set;return i.size===0&&(Cn.set(e,i),o.observe(e,{box:"border-box"})),i.add(t),()=>{i.delete(t),i.size===0&&(Cn.delete(e),o.unobserve(e))}}function Ro({ref:e,measureInLayoutEffect:t=!0,onLayoutProp:n,onLayoutChange:o,webLayoutResync:i},l){return p.useLayoutEffect(()=>{var r,s;const a=e.current,u=((s=(r=a?.getScrollableNode)==null?void 0:r.call(a))!=null?s:null)||a;if(!u)return;const d=(v,f)=>{v.height===0&&v.width===0||(o(v,f),n?.({nativeEvent:{layout:v}}))};let h;if(t){const v=u.getBoundingClientRect();d(si(v),!0),h=v}return ua(u,v=>{var f;const S=v.target instanceof HTMLElement?v.target:void 0,m=Array.isArray(v.borderBoxSize)?v.borderBoxSize[0]:v.borderBoxSize,g=m?{height:m.blockSize,left:v.contentRect.left,top:v.contentRect.top,width:m.inlineSize}:(f=S?.getBoundingClientRect())!=null?f:v.contentRect,I=h??Jl(u),y=I===void 0||g.width!==I.width||g.height!==I.height;h=g;const b=!!i?.();(y||b)&&d(si(g),!1)})},[t,...l||[]]),{}}function si(e){return e?{height:e.height,width:e.width,x:e.left,y:e.top}:{height:0,width:0,x:0,y:0}}var En=new Map,Zn;function gl(e){En.delete(e)}function fa(e,t){En.set(e,t),Zn===void 0&&(Zn=requestAnimationFrame(()=>{const n=Array.from(En.values());En.clear(),Zn=void 0,vl(()=>{for(const o of n)o()})}))}function va({containerId:e,ctx:t,rectangle:n,ref:o,state:i}){const l=t.state,r=i.itemKey;i.didLayout=!0;let s=n;const a=i.horizontal?"width":"height",c=en(n[a]);i.lastSize&&en(i.lastSize[a]);const d=l.sizesKnown.get(r),h=()=>{i.lastSize=s,hl(t,{containerId:e,itemKey:r,size:s})};!sn(l)&&d!==void 0&&c+1<d?fa(i,()=>{var f;if(i.itemKey===r){const S=o.current,m=(f=S?.getBoundingClientRect)==null?void 0:f.call(S);m&&(s={height:m.height,width:m.width}),h()}}):(gl(i),h())}function ha({containerId:e,ctx:t,horizontal:n,itemKey:o,ref:i}){const l=p.useRef({didLayout:!1,horizontal:n,itemKey:o});l.current.horizontal=n,l.current.itemKey=o;const[r,s]=p.useState(0),a=p.useCallback(d=>{va({containerId:e,ctx:t,rectangle:d,ref:i,state:l.current})},[e,t,i]),c=p.useCallback(()=>{wn(t,e)},[e,t]);p.useLayoutEffect(()=>(t.containerLayoutTriggers.set(e,c),()=>{gl(l.current),t.containerLayoutTriggers.get(e)===c&&t.containerLayoutTriggers.delete(e)}),[e,t,c]),p.useLayoutEffect(()=>{wn(t,e)});const{onLayout:u}=Ro({measureInLayoutEffect:!ho,onLayoutChange:a,ref:i,webLayoutResync:()=>sn(t.state)},[o,r]);return p.useEffect(()=>{},[e,t,o]),{onLayout:u,triggerLayout:c}}function Sa({columnWrapperStyle:e,contentContainerAlignItems:t,horizontal:n,hasItemSeparator:o,isHorizontalRTLList:i,numColumns:l,otherAxisPos:r,otherAxisSize:s}){let a;if(e){const{columnGap:c,rowGap:u,gap:d}=e;n?a={paddingBottom:l>1?(u||d||0)/2:void 0,paddingRight:c||d||void 0,paddingTop:l>1?(u||d||0)/2:void 0}:a={paddingBottom:u||d||void 0,paddingLeft:l>1?(c||d||0)/2:void 0,paddingRight:l>1?(c||d||0)/2:void 0}}return n?{bottom:t==="flex-end"&&l===1?0:void 0,boxSizing:a?"border-box":void 0,direction:i&&Qe.OS==="web"?"ltr":void 0,flexDirection:o?"row":void 0,height:s,left:0,position:"absolute",top:t==="flex-end"&&l===1?void 0:r,...a||{}}:{boxSizing:a?"border-box":void 0,left:r,position:"absolute",right:l>1?null:0,top:0,width:s,...a||{}}}var pa=Ke(function({id:t,itemKey:n,recycleItems:o,horizontal:i,getRenderedItem:l,ItemSeparatorComponent:r,stickyHeaderConfig:s}){const a=Fe(),{columnWrapperStyle:c,animatedScrollY:u}=a,d=ct(a.state),h=a.state.props.positionComponentInternal,v=a.state.props.stickyPositionComponentInternal,[f=0,S=1,m,g=1,I,y]=Pe([`containerColumn${t}`,`containerSpan${t}`,`containerItemData${t}`,"numColumns","extraData",`containerSticky${t}`]),b=p.useRef(null),{onLayout:T,triggerLayout:M}=ha({containerId:t,ctx:a,horizontal:i,itemKey:n,ref:b}),w=f>0?f:1,F=Math.min(Math.max(S||1,1),g),P=g>1?`${(w-1)/g*100}%`:0,E=g>1?`${F/g*100}%`:void 0,L=p.useMemo(()=>Sa({columnWrapperStyle:c,contentContainerAlignItems:a.state.props.contentContainerAlignItems,hasItemSeparator:!!r,horizontal:i,isHorizontalRTLList:d,numColumns:g,otherAxisPos:P,otherAxisSize:E}),[i,d,P,E,c,a.state.props.contentContainerAlignItems,g,r]),D=p.useMemo(()=>n!==void 0?l(n,t):null,[n,m,I]),{renderedItem:R}=D||{},z=p.useMemo(()=>(a.viewRefs.set(t,b),{containerId:t,triggerLayout:M}),[t,M]),N=y?v||oa:h||ia;return p.createElement(N,{animatedScrollY:y?u:void 0,horizontal:i,id:t,key:o?void 0:n,onLayout:T,refView:b,stickyHeaderConfig:s,style:L},p.createElement(pl.Provider,{value:z},R,D&&r&&p.createElement(ca,{ItemSeparatorComponent:r,leadingItem:D.item})))});function ga({id:e,horizontal:t,recycleItems:n,ItemSeparatorComponent:o,getRenderedItem:i,stickyHeaderConfig:l,ContainerComponent:r=pa}){const[s]=Pe([`containerItemKey${e}`]);return s===void 0?null:p.createElement(r,{getRenderedItem:i,horizontal:t,ItemSeparatorComponent:o,id:e,itemKey:s,recycleItems:n,stickyHeaderConfig:l})}var ma=Ke(function(t){return p.createElement(ga,{...t})});function Ia(e,t){const n=Array.from(e.children);if(n.length<=1)return n;const o=n.map(a=>{var c;return[a,(c=t.get(a))!=null?c:null]});o.sort((a,c)=>{const u=a[1],d=c[1];return u===null?1:d===null?-1:u-d});const i=new Map;o.forEach((a,c)=>{i.set(a[0],c)});const l=n.map(a=>i.get(a)),r=ya(l),s=new Set(r);for(let a=0;a<o.length;a++){const c=o[a][0],u=n.indexOf(c);if(!s.has(u)){let d=null;for(let h=a+1;h<o.length;h++){const v=o[h][0],f=n.indexOf(v);if(s.has(f)){d=v;break}}d?e.insertBefore(c,d):e.appendChild(c)}}}function ya(e){const t=e.length,n=[],o=new Array(t).fill(-1),i=[];for(let s=0;s<t;s++){const a=e[s];let c=0,u=n.length;for(;c<u;){const d=Math.floor((c+u)/2);e[i[d]]<a?c=d+1:u=d}c===n.length?(n.push(a),i.push(s)):(n[c]=a,i[c]=s),c>0&&(o[s]=i[c-1])}const l=[];let r=i[i.length-1];for(;r!==-1;)l.unshift(r),r=o[r];return l}function Ca(e){const t=Fe(),n=p.useRef(void 0);p.useEffect(()=>{const o=Ze(t,"lastPositionUpdate",()=>{n.current!==void 0&&clearTimeout(n.current),n.current=setTimeout(()=>{const i=e.current;if(i){const l=new Map;for(const[r,s]of t.viewRefs){const a=s.current,c=C(t,`containerItemIndex${r}`);a&&c!==void 0&&l.set(a,c)}Ia(i,l)}n.current=void 0},500)});return()=>{o(),n.current!==void 0&&clearTimeout(n.current)}},[t])}function Ea(e,t){const[n,o]=p.useState(t),i=n!==t;return p.useLayoutEffect(()=>{o(t)},[t]),e&&!i}var Aa=Ke(function({freshDataTransitionEpoch:t,horizontal:n,numColumns:o,children:i}){const l=p.useRef(null),r=Fe(),s=r.columnWrapperStyle,a=ct(r.state),[c,u,d]=Pe(["otherAxisSize","readyToRender","totalSize"]),h=Ea(!!u,t);Ca(l);const v=n?{direction:a?"ltr":void 0,flexShrink:0,minHeight:c,opacity:h?1:0,position:"relative",width:d}:{height:d,minWidth:c,opacity:h?1:0,position:"relative"};if(h||(v.pointerEvents="none"),s&&o>1){const{columnGap:f,rowGap:S,gap:m}=s,g=f||m||0,I=S||m||0;n?(I&&(v.marginTop=v.marginBottom=-I/2),g&&(v.marginRight=-g)):I&&(v.marginBottom=-I)}return p.createElement("div",{ref:l,style:v},p.createElement(ea,null,i))}),ba=Ke(function({freshDataTransitionEpoch:t,horizontal:n,recycleItems:o,ItemSeparatorComponent:i,getRenderedItem:l,stickyHeaderConfig:r}){const[s,a]=Pe(["numContainersPooled","numColumns"]),c=[];for(let u=0;u<s;u++)c.push(p.createElement(ma,{getRenderedItem:l,horizontal:n,ItemSeparatorComponent:i,id:u,key:u,recycleItems:o,stickyHeaderConfig:r}));return p.createElement(Aa,{freshDataTransitionEpoch:t,horizontal:n,numColumns:a},c)});function wa(e){return On(e)?Object.assign({},...e.filter(Boolean)):e}var rn={create:e=>e,flatten:e=>wa(e)};function so(e){const t=p.useRef(e);return t.current=e,t}function Ra(e){const t=so(e),n=p.useRef(void 0),o=p.useMemo(()=>({cancel(){n.current!==void 0&&(cancelAnimationFrame(n.current),n.current=void 0)},flush(){o.cancel(),t.current()},schedule(){if(n.current!==void 0)return!1;const i=requestAnimationFrame(()=>{n.current===i&&(n.current=void 0,t.current())});return n.current=i,!0}}),[]);return p.useEffect(()=>()=>{o.cancel()},[o]),o}var ao="legend-list-content-container",ml="legend-list-scrollbar-x-hidden",Il="legend-list-scrollbar-y-hidden";function _a(){return typeof document>"u"?null:document.scrollingElement||document.documentElement||document.body}function co(){var e,t,n,o;return typeof window>"u"?{x:0,y:0}:{x:(t=(e=window.scrollX)!=null?e:window.pageXOffset)!=null?t:0,y:(o=(n=window.scrollY)!=null?n:window.pageYOffset)!=null?o:0}}function ai(e,t){var n,o;const i=e?.getBoundingClientRect();return{left:((n=i?.left)!=null?n:0)+t.x,top:((o=i?.top)!=null?o:0)+t.y}}function yl(e){var t,n;return{height:(t=e?.scrollHeight)!=null?t:0,width:(n=e?.scrollWidth)!=null?n:0}}function Pa(e,t,n){return yl(n?t:e)}function ci(e,t,n){var o,i,l,r,s,a;if(t&&typeof window<"u"){const c=e?.getBoundingClientRect();return{height:n&&(i=(o=c?.height)!=null?o:e?.clientHeight)!=null?i:window.innerHeight,width:n?window.innerWidth:(r=(l=c?.width)!=null?l:e?.clientWidth)!=null?r:window.innerWidth}}return{height:(s=e?.clientHeight)!=null?s:0,width:(a=e?.clientWidth)!=null?a:0}}function di(e,t){return Math.max(0,Math.min(e,t))}function ui(e,t){return t?e.width:e.height}function Ta(e,t,n){return Math.max(0,ui(e,n)-ui(t,n))}function fi(e,t){return t&&_a()||e}function La(e,t){return t&&typeof window<"u"?window:e}function Ma(e,t,n){const o=e.getBoundingClientRect(),i=co();return{height:t&&typeof window<"u"&&!n?window.innerHeight:o.height,width:t&&typeof window<"u"&&n?window.innerWidth:o.width,x:t?o.left+i.x:o.left,y:t?o.top+i.y:o.top}}function za({clampedOffset:e,horizontal:t,listPos:n,scroll:o}){return{left:t?n.left+e:o.x,top:t?o.y:n.top+e}}var vi="legend-list-scrollbar-axis-hidden-style",Oa=200,ka=`.${Il}::-webkit-scrollbar:vertical{width:0;display:none;}.${ml}::-webkit-scrollbar:horizontal{height:0;display:none;}`;function Fa(){if(typeof document>"u"||document.getElementById(vi))return;const e=document.createElement("style");e.id=vi,e.textContent=ka,document.head.appendChild(e)}function Na(e){var t,n;const o=(n=(t=e.state)==null?void 0:t.props)==null?void 0:n.contentInsetEndAdjustment;return Math.max(0,o??0)}function Da(e){if(!e?.length)return[];const t=[],n=new Set;for(const o of e)Number.isFinite(o)&&!n.has(o)&&(n.add(o),t.push(o));return t}function Va(e,t){return{height:t?"100%":1,left:t?e:0,pointerEvents:"none",position:"absolute",scrollSnapAlign:"start",top:t?0:e,width:t?1:"100%"}}var hi=p.forwardRef(function({children:t,style:n,contentContainerClassName:o,contentContainerStyle:i,horizontal:l=!1,contentOffset:r,maintainVisibleContentPosition:s,onScroll:a,onInternalScrollEnd:c,onMomentumScrollEnd:u,showsHorizontalScrollIndicator:d=!0,showsVerticalScrollIndicator:h=!0,refreshControl:v,useWindowScroll:f=!1,onLayout:S,...m},g){var I,y,b;const T=Fe(),[M]=Pe(["anchoredEndSpaceSize"]),w=p.useRef(null),F=p.useRef(null),P=f,E=p.useCallback(()=>La(w.current,P),[P]),L=p.useCallback(()=>{const V=w.current,H=Pa(V,F.current,P),Q=ci(V,P,l);return Ta(H,Q,l)},[l,P]),D=p.useCallback(()=>{const V=w.current;if(P){const H=L(),Q=co(),K=ai(V,Q),De=l?Q.x-K.left:Q.y-K.top;return di(De,H)}return V?l?V.scrollLeft:V.scrollTop:0},[L,l,P]),R=p.useCallback((V,H)=>{const Q=w.current,K=E();if(!K||typeof K.scrollTo!="function")return;const De=L(),ot=di(V,De),Ve={behavior:H?"smooth":"auto"};if(P){const Be=co(),Rt=ai(Q,Be),{left:me,top:$e}=za({clampedOffset:ot,horizontal:l,listPos:Rt,scroll:Be});Ve.left=me,Ve.top=$e}else l?Ve.left=ot:Ve.top=ot;K.scrollTo(Ve)},[L,E,l,P]);p.useImperativeHandle(g,()=>({getBoundingClientRect:()=>{var H;return(H=w.current)==null?void 0:H.getBoundingClientRect()},getCurrentScrollOffset:D,getScrollableNode:()=>fi(w.current,P),getScrollEventTarget:()=>E(),getScrollResponder:()=>fi(w.current,P),isWindowScroll:()=>P,scrollBy:(H,Q)=>{const K=E();!K||typeof K.scrollBy!="function"||K.scrollBy({behavior:"auto",left:H,top:Q})},scrollTo:H=>{const{x:Q=0,y:K=0,animated:De=!0}=H;R(l?Q:K,De)},scrollToEnd:(H={})=>{const{animated:Q=!0}=H,K=L();R(K,Q)},scrollToOffset:H=>{const{offset:Q,animated:K=!0}=H;R(Q,K)}}),[D,L,E,l,P,R]);const z=p.useCallback(()=>{if(!a||!w.current)return;const V=yl(F.current),H=ci(w.current,P,l),Q=D(),K={nativeEvent:{contentOffset:{x:l?Q:0,y:l?0:Q},contentSize:{height:V.height,width:V.width},layoutMeasurement:{height:H.height,width:H.width}}};a(K)},[D,l,P,a]),N=Ra(z),U=p.useRef(void 0),$=p.useCallback(()=>{const V=U.current;V!==void 0&&(clearTimeout(V),U.current=void 0),N.flush(),c?.()},[c,N]),le=p.useCallback(V=>{if(!a)return;const H=T.state;if(!!H?.scrollingTo||!!H?.initialScrollSession&&!H.didFinishInitialScroll||!!H?.initialScroll&&!H.didFinishInitialScroll||!!H&&sn(H)?N.flush():N.schedule(),c){const K=U.current;K!==void 0&&clearTimeout(K),U.current=setTimeout($,Oa)}},[T.state,$,c,a,N]);p.useLayoutEffect(()=>{const V=E();if(V)return V.addEventListener("scroll",le,{passive:!0}),"onscrollend"in V&&V.addEventListener("scrollend",$),()=>{V.removeEventListener("scroll",le),"onscrollend"in V&&V.removeEventListener("scrollend",$);const H=U.current;H!==void 0&&(clearTimeout(H),U.current=void 0),N.cancel()}},[$,E,le,N]),p.useEffect(()=>{const V=()=>{r&&R(l?r.x||0:r.y||0,!1)};V(),requestAnimationFrame(V)},[r?.x,r?.y,l,R]),p.useLayoutEffect(()=>{if(!S||!w.current)return;const V=w.current,H=()=>{S({nativeEvent:{layout:Ma(V,P,l)}})};H();const Q=new ResizeObserver(()=>{H()});Q.observe(V);const K=()=>{H()};return P&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("resize",K),()=>{Q.disconnect(),P&&typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("resize",K)}},[P,S]);const te=!P&&(l?!d&&ml:!h&&Il);p.useLayoutEffect(()=>{te&&Fa()},[te]);const de={...P?{}:{overflow:"auto",overflowX:l||d?"auto":"hidden",overflowY:l?h?"auto":"hidden":"auto",WebkitOverflowScrolling:"touch"},...rn.flatten(n),...s?{overflowAnchor:"none"}:{}},ue=Na(T),re=(y=(I=T.state)==null?void 0:I.props)!=null&&y.anchoredEndSpace&&M?M:0,x=Math.max(0,ue-re),ne=x?l?{flexShrink:0,width:x}:{height:x}:void 0,oe={display:l?"flex":"block",flexDirection:l?"row":void 0,minHeight:l?void 0:"100%",minWidth:l?"100%":void 0,...rn.flatten(i),...s?{overflowAnchor:"none"}:{}},ee=o?`${ao} ${o}`:ao,{contentContainerClassName:Y,contentInset:G,scrollEventThrottle:j,ScrollComponent:ie,snapToOffsets:Se,useWindowScroll:Ne,className:fe,...pe}=m,Ue=P?[]:Da(Se);Ue.length>0&&(de.scrollSnapType=l?"x mandatory":"y mandatory",oe.position=(b=oe.position)!=null?b:"relative");const nt=te?fe?`${fe} ${te}`:te:fe;return _e&&/(?:^|\s)(?:[a-z0-9_-]+:)*gap(?:-[xy])?-(?:\[[^\]]+\]|[^\s]+)/.test(`${o??""} ${fe??""}`)&&mt("className-gap","className/contentContainerClassName gap classes are not supported in LegendList because it needs to use exact values internally. Use contentContainerStyle={{ gap: ... }} or columnWrapperStyle instead."),p.createElement("div",{className:nt,ref:w,...pe,style:de},v,p.createElement("div",{className:ee,ref:F,style:oe},Ue.map(V=>p.createElement("div",{"aria-hidden":!0,"data-legend-list-snap-anchor":V,key:`snap-${V}`,style:Va(V,l)})),t,ne?p.createElement("div",{"aria-hidden":!0,style:ne}):null))});function Ba({horizontal:e,needsOtherAxisSize:t,otherAxisSize:n}){if(!(!t||!n||n<=0))return e?{height:n}:{width:n}}function Si(e,t){const n=Fe();p.useLayoutEffect(()=>Ze(n,e,i=>{t(i)}),[t,n,e])}function ja(e){return e?{contentSizeKey:"scrollWidth",paddingEndProp:"paddingRight",viewportSizeKey:"clientWidth",x:1,y:0}:{contentSizeKey:"scrollHeight",paddingEndProp:"paddingBottom",viewportSizeKey:"clientHeight",x:0,y:1}}function Wa(e,t){var n,o,i;const l=(n=e.state)==null?void 0:n.refScroller.current,r=(i=(o=l?.getScrollableNode)==null?void 0:o.call(l))!=null?i:null;let s=null;return r&&(s=t?.isConnected&&t.parentElement===r?t:r.querySelector(`:scope > .${ao}`)),r?{contentNode:s,scrollElement:r}:null}function Ha(e,t,n){e.scrollBy({behavior:"auto",left:t,top:n})}function Ka(){const e=Fe(),t=p.useRef(0),n=p.useRef(0),o=p.useRef(void 0),i=p.useRef(void 0),l=p.useRef(null),r=p.useCallback(()=>{const s=C(e,"scrollAdjust"),a=C(e,"scrollAdjustUserOffset"),c=(s||0)+(a||0);if(c-t.current!==0){const d=Wa(e,l.current);if(d){const h=!!e.state.props.horizontal,v=ja(h),{contentNode:f,scrollElement:S}=d,m=h?S.scrollLeft:S.scrollTop,g=(a||0)-n.current,y=(g!==0?m+g:e.state.scroll)-m,b=Math.abs(y)>.01,T=()=>Ha(S,v.x*y,v.y*y);if(l.current=f,b&&f){const M=f[v.contentSizeKey],w=S[v.viewportSizeKey],F=m+y;if(y>0&&!e.state.adjustingFromInitialMount&&M<F+w){const E=f.style[v.paddingEndProp],L=i.current,D=L?.value===E?L.baseline:E,R=(F+w-M)*2,N=`${(Number.parseFloat(window.getComputedStyle(f)[v.paddingEndProp])||0)+R}px`;i.current={baseline:D,value:N},f.style[v.paddingEndProp]=N,f.offsetHeight,T(),o.current!==void 0&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{const U=i.current;o.current=void 0,i.current=void 0,f.style[v.paddingEndProp]===U?.value&&(f.style[v.paddingEndProp]=U.baseline)})}else T()}else b&&T()}t.current=c,n.current=a||0}},[e]);return Si("scrollAdjust",r),Si("scrollAdjustUserOffset",r),null}var Ua=p.forwardRef(function({ScrollComponent:t,...n},o){const[i]=Pe(["snapToOffsets"]);return p.createElement(t,{...n,ref:o,snapToOffsets:i})}),uo=.1;function $a(e,t,n){const o=C(e,t)!==n;return o&&(_(e,t,n),Et(e)),o}function qa(e,t,n){const{didContainersLayout:o,didFinishInitialScroll:i,props:l,scroll:r,scrollingTo:s}=e.state,a=n-t,u=((l.horizontal?l.stylePaddingLeft:l.stylePaddingTop)||0)+t;return l.maintainVisibleContentPosition.size&&o&&i&&!s&&r>=u-uo&&Math.abs(a)>uo}function pi(e,t){const{state:n}=e,o=C(e,"headerSize")||0,i=o!==t,l=n.didMeasureHeader||o>uo;i&&(_(e,"headerSize",t),Et(e),l&&qa(e,o,t)&&At(e,t-o)),n.didMeasureHeader=!0}function Ga(e,t){const n=$a(e,"footerSize",t);return n&&Rn(e),n}function Ya(e,t){var n,o,i,l,r,s,a,c;return((n=e?.top)!=null?n:0)===((o=t?.top)!=null?o:0)&&((i=e?.bottom)!=null?i:0)===((l=t?.bottom)!=null?l:0)&&((r=e?.left)!=null?r:0)===((s=t?.left)!=null?s:0)&&((a=e?.right)!=null?a:0)===((c=t?.right)!=null?c:0)}function xa(e,t){const{state:n}=e,o=n.contentInsetOverride,i=t??void 0,l=!Ya(o,i);return n.contentInsetOverride=i,l&&Et(e),l}function Xa(e,t){const n=so(e),o=so(t);return p.useMemo(()=>p.forwardRef((i,l)=>{var r,s;return(s=(r=n.current)==null?void 0:r.call(n,o.current(i,l)))!=null?s:null}),[o,n])}var gi=({onLayoutChange:e,refView:t,children:n,...o})=>{const i=p.useRef(null),l=t??i;return Ro({onLayoutChange:e,ref:l}),p.createElement("div",{...o,ref:l},n)},Za=Ke(function({horizontal:t}){const[n=0]=Pe(["alignItemsAtEndPadding"]);return n<=0?null:p.createElement(_n,{style:t?{flexShrink:0,width:n}:{flexShrink:0,height:n}},null)}),Ja=Ke(function({canRender:t,freshDataTransitionEpoch:n,style:o,contentContainerStyle:i,horizontal:l,initialContentOffset:r,recycleItems:s,ItemSeparatorComponent:a,alignItemsAtEnd:c,onScroll:u,onLayout:d,ListHeaderComponent:h,ListHeaderComponentStyle:v,ListFooterComponent:f,ListFooterComponentStyle:S,ListEmptyComponent:m,getRenderedItem:g,refScrollView:I,renderScrollComponent:y,onLayoutFooter:b,onInternalScrollBeginDrag:T,onInternalScrollEnd:M,scrollAdjustHandler:w,snapToIndices:F,stickyHeaderConfig:P,stickyHeaderIndices:E,useWindowScroll:L=!1,...D}){const R=Fe(),z=R.state.props.maintainVisibleContentPosition,[N=0,U=0]=Pe(["anchoredEndSpaceSize","otherAxisSize"]),$=R.state.props.alignItemsAtEndPaddingEnabled,le=!!R.state.props.anchoredEndSpace&&R.state.props.anchoredEndSpaceOwner==="list"&&N>0;let te;if(le){const Y=l?ct(R.state)?"Left":"Right":"Bottom",G=rn.flatten(i);te={[`padding${Y}`]:Gt({},G||{},Y)+N}}const de=Ba({horizontal:l,needsOtherAxisSize:R.state.needsOtherAxisSize,otherAxisSize:U}),ue=Xa(y,(Y,G)=>({...Y,ref:G})),re=y?ue:hi,x=F?Ua:re,ne=p.useCallback((Y,G)=>{var j;const ie=Ga(R,Y);G?.(),ie&&((j=R.state.props.maintainScrollAtEnd)!=null&&j.onFooterLayout)&&bt(R)},[R]);p.useLayoutEffect(()=>{h||pi(R,0),f||ne(0)},[h,f,R,ne]);const oe=p.useCallback(Y=>{const G=Y[l?"width":"height"];pi(R,G)},[R,l]),ee=p.useCallback((Y,G)=>{const j=Y[l?"width":"height"];ne(j,()=>{b?.(Y,G)})},[l,b,ne]);return p.createElement(x,{...D,...re===hi?{onInternalScrollEnd:M,useWindowScroll:L}:{},contentContainerStyle:[l?{height:"100%"}:{},i,te,{boxSizing:"border-box"}],contentOffset:r!==void 0?l?{x:r,y:0}:{x:0,y:r}:void 0,horizontal:l,maintainVisibleContentPosition:z.size||z.data?{minIndexForVisible:0}:void 0,onLayout:d,onScroll:u,ref:I,ScrollComponent:F?re:void 0,style:de?[de,o]:o},p.createElement(Ka,null),h&&p.createElement(gi,{onLayoutChange:oe,style:v},yn(h)),m&&yn(m),$&&p.createElement(Za,{horizontal:l}),t&&!m&&p.createElement(ba,{freshDataTransitionEpoch:n,getRenderedItem:g,horizontal:l,ItemSeparatorComponent:a,recycleItems:s,stickyHeaderConfig:P}),f&&p.createElement(gi,{onLayoutChange:ee,style:S},yn(f)),_e&&tr)}),Qa=100,ec=.9,tc=.9;function nc(e){const t=Fe(),{anchoredEndSpace:n,childrenMode:o,keyExtractor:i,numColumns:l,renderScrollComponent:r,useWindowScroll:s}=e,a=!!n;p.useEffect(()=>{a&&(l??1)>1&&mt("anchoredEndSpaceNumColumns","anchoredEndSpace is only supported when numColumns is 1. Using it with multiple columns may produce incorrect anchored spacing.")},[a,l]),p.useEffect(()=>{s&&r&&mt("useWindowScrollRenderScrollComponent","useWindowScroll is not supported when renderScrollComponent is provided.")},[r,s]),p.useEffect(()=>{!i&&!t.state.isFirst&&t.state.didDataChange&&!o&&mt("keyExtractor","Changing data without a keyExtractor can cause slow performance and resetting scroll. If your list data can change you should use a keyExtractor with a unique id for best performance and behavior.")},[o,t,i]),p.useEffect(()=>{const c=t.state,u=c.props.data.length;if(c.props.useWindowScroll||u<Qa)return;const h=()=>{const f=C(t,"readyToRender"),S=C(t,"numContainers")||0,m=C(t,"totalSize")||0,g=t.state.scrollLength||0;if(!f||m<=0||g<=0)return;const I=S>=Math.ceil(u*ec),y=g>=m*tc;I&&y&&mt("webUnboundedOuterSize","LegendList appears to have an unbounded outer height on web, so virtualization is effectively disabled. Set a bounded height or flex: 1 on the list container, or use useWindowScroll.")};h();const v=[Ze(t,"numContainers",h),Ze(t,"readyToRender",h),Ze(t,"totalSize",h)];return()=>{for(const f of v)f()}},[t])}function oc(e){}var ic=_e?nc:oc;function lc(e,t,{didColumnsChange:n=!1}={}){const o=e.state,{previousData:i}=o,{maintainScrollAtEnd:l}=o.props;if(n){o.sizes.clear(),o.sizesKnown.clear(),tl(o);for(const a in o.averageSizes)delete o.averageSizes[a];o.minIndexSizeChanged=0,o.scrollForNextCalculateItemsInView=void 0}Je(e,{dataChanged:!0,doMVCP:!0});const s=!n&&l?.onDataChange&&bt(e);!s&&i&&t.length>i.length&&(o.isEndReached=!1),s||Mn(e),delete o.previousData}function rc(e,t,n){var o;if(e.pendingDataComparison=void 0,!n||!t||t.length!==n.length)return!0;const{idCache:i,props:{itemsAreEqual:l,keyExtractor:r}}=e;let s;for(let a=0;a<t.length;a++){if(t[a]===n[a])continue;if(!r)return s&&(e.pendingDataComparison={byIndex:s,nextData:t,previousData:n}),!0;const c=(o=i[a])!=null?o:r(n[a],a),u=r(t[a],a);if(c!==u)return s&&(e.pendingDataComparison={byIndex:s,nextData:t,previousData:n}),!0;if(!l)return s&&(e.pendingDataComparison={byIndex:s,nextData:t,previousData:n}),!0;const d=l(n[a],t[a],a,t);if(s??(s=[]),s[a]=d?1:2,!d)return e.pendingDataComparison={byIndex:s,nextData:t,previousData:n},!0}return!1}var sc="containerLayoutReady";function ac(e){for(const t of e.values.keys())t.startsWith(sc)&&_(e,t,void 0)}function Cl(e){var t,n;const o=e.state,{scrollLength:i,props:{data:l,getFixedItemSize:r,getItemType:s,numColumns:a,estimatedItemSize:c}}=o,u=Di(e),d=C(e,"numContainers");if(i>0&&l.length>0&&!d){let h;if(r){let f=0;const S=Math.min(20,l.length);for(let m=0;m<S;m++){const g=l[m];if(g!==void 0){const I=(t=s?.(g,m))!=null?t:"";f+=((n=r(g,m,I))!=null?n:c)+e.scrollAxisGap}}h=f/S}else h=c+e.scrollAxisGap;const v=Math.max(1,Math.ceil((i+u*2)/h*a));for(let f=0;f<v;f++)_(e,`containerPosition${f}`,zt),_(e,`containerColumn${f}`,-1),_(e,`containerSpan${f}`,1);return _(e,"numContainers",v),_(e,"numContainersPooled",Os(l.length,v)),o.lastLayout&&(o.initialScroll?requestAnimationFrame(()=>{Je(e,{dataChanged:!0,doMVCP:!0})}):Je(e,{dataChanged:!0,doMVCP:!0})),!0}}function cc(){return typeof window>"u"?{height:0,width:0}:{height:window.innerHeight,width:window.innerWidth}}function dc(e,t,n){const o=e.state,{maintainScrollAtEnd:i,useWindowScroll:l}=o.props,r=o.props.horizontal?"width":"height",s=o.props.horizontal?"height":"width";let a=t;if(l){const m=cc()[r];a=m>0?{...t,[r]:m}:t}const c=a[r],u=o.scrollLength,d=c>0?c:u,h=a[s],v=!o.lastLayout||d>o.scrollLength||o.lastLayout.x!==a.x||o.lastLayout.y!==a.y;o.lastLayout=a;const f=o.otherAxisSize,S=d!==o.scrollLength||h!==f;if(S){if(o.scrollLength=d,o.otherAxisSize=h,Et(e),o.lastBatchingAction=Date.now(),o.scrollForNextCalculateItemsInView=void 0,d>0&&Cl(e),v&&Je(e,{doMVCP:!0}),(S||h!==f)&&_(e,"scrollSize",{height:a.height,width:a.width}),i?.onLayout&&bt(e),Mn(e),o){const m=o.props.horizontal?(o.props.stylePaddingTop||0)+(o.props.stylePaddingBottom||0):(o.props.stylePaddingLeft||0)+(o.props.stylePaddingRight||0);o.needsOtherAxisSize=h-m<10}_e&&c===0&&mt("height0",`List ${o.props.horizontal?"width":"height"} is 0. You may need to set a style or \`flex: \` for the list, because children are absolutely positioned.`)}n(!0)}function uc(e,t){const n=ye.get(e);if(!!n&&ye.didReachTarget(t,n)){ye.clear(e);return}n&&(e.hasScrolled=!1,ye.set(e,{startScroll:n.startScroll,targetOffset:n.targetOffset}))}function fc(e){var t;return!!e.initialScroll&&((t=e.initialScrollSession)==null?void 0:t.kind)==="bootstrap"&&!e.didFinishInitialScroll}function vc(e){return{...e,nativeEvent:{...e.nativeEvent}}}function hc(e,t){var n,o,i,l,r,s;const a=e.state,{scrollProcessingEnabled:c}=a;if(c===!1||((o=(n=t.nativeEvent)==null?void 0:n.contentSize)==null?void 0:o.height)===0&&((i=t.nativeEvent.contentSize)==null?void 0:i.width)===0)return;let u=!1;if((l=t.nativeEvent)!=null&&l.contentInset){const{contentInset:h}=t.nativeEvent,v=a.nativeContentInset;(!v||v.top!==h.top||v.bottom!==h.bottom||v.left!==h.left||v.right!==h.right)&&(a.nativeContentInset=h,u=!0)}let d=t.nativeEvent.contentOffset[a.props.horizontal?"x":"y"];if(a.props.horizontal&&(d=Wl(a,d,(r=t.nativeEvent.contentSize)==null?void 0:r.width)),a.didFinishInitialScroll&&((s=a.initialScroll)==null?void 0:s.viewPosition)===1&&a.scroll>a.scrollLength,a.lastNativeScroll=d,a.lastNativeScrollTime=Date.now(),a.scrollingTo&&a.scrollingTo.offset>=d){const h=tt(e,d,a.scrollingTo);if(d!==h&&Math.abs(d-h)>1){d=h,Nn(e,{forceScroll:!0,isInitialScroll:!0,noScrollingTo:!0,offset:d});return}}a.scrollPending=d,Ft(e,d,u,{fromNativeScrollEvent:!0}),uc(a,d),ts(e),a.scrollingTo&&Ao(e),a.props.onScroll&&(fc(a)?a.deferredPublicOnScrollEvent=vc(t):a.props.onScroll(t))}var Sc=class{constructor(){this.work=new Map}microtask(e,t){const n=this.work.get(t);if(n?.callback)n.callback=e;else{this.cancel(t);const o={callback:e,cancel:()=>{}};this.work.set(t,o),queueMicrotask(()=>{var i;this.work.get(t)===o&&(this.work.delete(t),(i=o.callback)==null||i.call(o))})}}timeout(e,t,n){n&&this.cancel(n);const o={cancel:()=>clearTimeout(i)},i=setTimeout(()=>{const l=n??i;this.work.get(l)===o&&(this.work.delete(l),e())},t);this.work.set(n??i,o)}frame(e,t){this.cancel(t);const n={cancel:()=>cancelAnimationFrame(o)};this.work.set(t,n);const o=requestAnimationFrame(()=>{this.work.get(t)===n&&(this.work.delete(t),e())})}register(e,t){this.cancel(e),this.work.set(e,{cancel:t})}cancel(e){const t=this.work.get(e);t&&(this.work.delete(e),t.cancel())}has(e){return this.work.has(e)}dispose(){for(const e of this.work.values())e.cancel();this.work.clear()}},pc=class{constructor(e){this.appliedAdjust=0,this.pendingAdjust=0,this.ctx=e}requestAdjust(e){const t=this.ctx.state.scrollingTo;t?.animated&&!t.isInitialScroll?(this.pendingAdjust+=e,_(this.ctx,"scrollAdjustPending",this.pendingAdjust)):(this.appliedAdjust+=e,_(this.ctx,"scrollAdjust",this.appliedAdjust)),this.ctx.state.scrollingTo&&Ao(this.ctx)}getAdjust(){return this.appliedAdjust}commitPendingAdjust(e){{const t=this.ctx.state,n=this.pendingAdjust;if(this.pendingAdjust=0,n!==0){let o;if(e?.index!==void 0){const l=zn(this.ctx,e.index);o=kn(this.ctx,l,e),o=tt(this.ctx,o,e)}else o=tt(this.ctx,t.scroll+n);const i=o-t.scroll;(Math.abs(i)>.1||Math.abs(n)>.1)&&(this.appliedAdjust+=i,t.scroll=o,t.scrollForNextCalculateItemsInView=void 0,_(this.ctx,"scrollAdjust",this.appliedAdjust)),_(this.ctx,"scrollAdjustPending",0),Je(this.ctx)}}}};function El(e,t){const n=e.state,i=n.props.data.length-1;if(i===-1)return!1;const l=n.props.stylePaddingBottom||0,r=C(e,"footerSize")||0;return In(e,{...t,index:i,viewOffset:-l-r+(t?.viewOffset||0),viewPosition:1}),!0}function gc(e,t){const n=e.state,o=It(e,t),l=It(e)-o;if(l!==0){const r=!!C(e,"isWithinMaintainScrollAtEndThreshold");Ft(e,n.scroll,!0,{markHasScrolled:!1}),!il(e)&&r&&l>0&&At(e,l)}}function Jn(e){return p.useMemo(()=>e?(t,n,o)=>t!==void 0&&n!==void 0?e(t,n,o):void 0:void 0,[e])}var mc=(...e)=>p.useCallback(n=>{for(const o of e)o&&(ji(o)?o(n):o.current=n)},e);function Ic(e){return null}function yc(e,t,n,o){return o}function Cc(e){const{gap:t,columnGap:n,rowGap:o}=e;if(t||n||o)return e.gap=void 0,e.columnGap=void 0,e.rowGap=void 0,{columnGap:n,gap:t,rowGap:o}}var Ec="default";function Ac(e){const t={};for(const n in e.averageSizes){const o=e.averageSizes[n];o&&(t[n||Ec]={average:o.avg,count:o.num})}return t}function bc(e){wn(e)}function wc(e,t){const n=e.state,o=Ki(e),i=800,l=2,r=()=>!!n.didDataChange||!!n.didColumnsChange||n.scheduledWork.has("mvcpRecalculate")||n.ignoreScrollFromMVCP!==void 0,s=(f,S=!1)=>{var m;const g=n.props,I=g.data.length,y=(m=g.anchoredEndSpace)==null?void 0:m.anchorIndex;return f<0?S:f>=I?!1:y===void 0||y<0||y>=I||f<y?!0:gr(e,y,I-1)},a=(f,S,m)=>{const g=Date.now();let I=0;const y=()=>{if(!o.isCurrent(f))return;r()||!m()?I=0:I+=1;const b=Date.now()-g>=i;if(I>=l||b){S();return}n.scheduledWork.frame(y,"imperativeScrollReady")};n.scheduledWork.frame(y,"imperativeScrollReady")},c=(f,S,m,g=()=>!0)=>{const I=()=>o.runNow(f,S,m);r()||!g()?a(f,I,g):I()},u=(f,S=()=>!0)=>new Promise(m=>{const g=o.start(m);Yo(e),c(g,m,f,S)});n.runPendingScrollToEnd=()=>{const f=n.pendingScrollToEnd;f&&(n.pendingScrollToEnd=void 0,o.isCurrent(f.token)&&c(f.token,f.resolve,()=>El(e,f.options),()=>s(n.props.data.length-1,!0)))};const d=f=>{if(n){const{index:S,...m}=f,{startNoBuffer:g,endNoBuffer:I}=n;if(S<g||S>I){const y=S<g?0:1;return In(e,{...m,index:S,viewPosition:y}),!0}}return!1},h=n.refScroller;return{clearCaches:f=>{var S,m;const g=(S=f?.mode)!=null?S:"sizes";n.sizes.clear(),n.sizesKnown.clear(),tl(n);for(const I in n.averageSizes)delete n.averageSizes[I];n.minIndexSizeChanged=0,n.scrollForNextCalculateItemsInView=void 0,n.pendingTotalSize=void 0,n.totalSize=0,_(e,"totalSize",0),g==="full"&&(n.indexByKey.clear(),n.idCache.length=0,n.positions.length=0,n.columns.length=0,n.columnSpans.length=0),bc(e),(m=n.triggerCalculateItemsInView)==null||m.call(n,{forceFullItemPositions:!0})},flashScrollIndicators:()=>h.current.flashScrollIndicators(),getAnimatableRef:()=>{var f,S,m;return(m=(S=(f=h.current).getNativeScrollRef)==null?void 0:S.call(f))!=null?m:h.current},getNativeScrollRef:()=>h.current,getScrollableNode:()=>h.current.getScrollableNode(),getScrollResponder:()=>h.current.getScrollResponder(),getState:()=>({activeStickyIndex:C(e,"activeStickyIndex"),contentLength:Ce(e),data:n.props.data,elementAtIndex:f=>{var S;return(S=e.viewRefs.get(oo(e,Z(n,f))))==null?void 0:S.current},end:n.endNoBuffer,endBuffered:n.endBuffered,getAverageItemSizes:()=>Ac(n),indexByKey:f=>n.indexByKey.get(f),isAtEnd:C(e,"isAtEnd"),isAtStart:C(e,"isAtStart"),isEndReached:n.isEndReached,isNearEnd:C(e,"isNearEnd"),isNearStart:C(e,"isNearStart"),isStartReached:n.isStartReached,isWithinMaintainScrollAtEndThreshold:C(e,"isWithinMaintainScrollAtEndThreshold"),listen:(f,S)=>Ze(e,f,S),listenToPosition:(f,S)=>Gl(e,f,S),positionAtIndex:f=>n.positions[f],positionByKey:f=>{const S=n.indexByKey.get(f);return S===void 0?void 0:n.positions[S]},scroll:n.scroll,scrollLength:n.scrollLength,scrollVelocity:Fn(n),sizeAtIndex:f=>n.sizesKnown.get(Z(n,f)),sizes:n.sizesKnown,start:n.startNoBuffer,startBuffered:n.startBuffered}),reportContentInset:f=>{const S=xa(e,f);Ft(e,n.scroll,!0,{markHasScrolled:!1}),S&&il(e)},scrollIndexIntoView:f=>u(()=>d(f)),scrollItemIntoView:({item:f,...S})=>u(()=>{const g=n.props.data.indexOf(f);return g!==-1?(d({index:g,...S}),!0):!1}),scrollToEnd:f=>new Promise(S=>{var m;const g=o.start(S);n.pendingScrollToEnd={options:f,resolve:S,token:g},t?.(),Yo(e),t||(m=n.runPendingScrollToEnd)==null||m.call(n)}),scrollToIndex:f=>u(()=>(In(e,f),!0),f.index>=0?()=>s(f.index):void 0),scrollToItem:({item:f,...S})=>u(()=>{const g=n.props.data.indexOf(f);return g!==-1?(In(e,{index:g,...S}),!0):!1}),scrollToOffset:f=>u(()=>(Nn(e,f),!0)),setItemSize:(f,S)=>{hl(e,{itemKey:f,size:S})},setScrollProcessingEnabled:f=>{n.scrollProcessingEnabled=f},setVisibleContentAnchorOffset:f=>{const S=ji(f)?f(C(e,"scrollAdjustUserOffset")||0):f;_(e,"scrollAdjustUserOffset",S)}}}var Rc=(e,t)=>e-t,mi=e=>typeof e=="number"&&Number.isFinite(e)?Math.max(0,Math.floor(e)):0,qt=(e,t,n)=>{n>=0&&n<t&&e.add(n)};function _c(e,t,n,o){var i,l;if(t.length===0)return[];const r=new Set,s=t.length,a=mi(e?.top);if(a>0)for(let d=0;d<Math.min(a,s);d++)qt(r,s,d);const c=mi(e?.bottom);if(c>0)for(let d=Math.max(0,s-c);d<s;d++)qt(r,s,d);if((i=e?.indices)!=null&&i.length)for(const d of e.indices)Number.isFinite(d)&&qt(r,s,Math.floor(d));if((l=e?.keys)!=null&&l.length){const d=new Set(e.keys);for(let h=0;h<s&&d.size>0;h++){const v=n(t[h],h);d.has(v)&&(qt(r,s,h),d.delete(v))}}if(o!==void 0&&Number.isFinite(o)){const d=Math.floor(o);for(let h=d>=0?d:s;h<s;h++)qt(r,s,h)}const u=Array.from(r);return u.sort(Rc),u}function Pc(e,t,n){var o,i,l;const r=e.state;if(!r)return null;const s=r.containerItemMetadata.get(n),a=s&&s.dataChangeEpoch!==r.dataChangeEpoch,{indexByKey:c,props:{data:u,getItemType:d,renderItem:h}}=r,v=a?s.data:u,f=(o=s?.itemIndex)!=null?o:c.get(t);if(f===void 0)return null;let S=null;const m=C(e,"extraData"),g=a?s.itemData:v[f];if(h&&!Xt(g)){const I={data:v,extraData:m,index:f,item:g,type:a?(i=s.itemType)!=null?i:"":d&&(l=d(g,f))!=null?l:""};S=h(I)}return{index:f,item:g,renderedItem:S}}function Ii(e,t){var n,o,i,l;return{animated:!1,onDataChange:t?(n=e?.dataChange)!=null?n:!1:!0,onFooterLayout:t?(o=e?.footerLayout)!=null?o:!1:!0,onItemLayout:t?(i=e?.itemLayout)!=null?i:!1:!0,onLayout:t?(l=e?.layout)!=null?l:!1:!0}}function Tc(e){var t;return e?e===!0?{...Ii(void 0,!1),animated:!1}:{...Ii(e.on,"on"in e),animated:(t=e.animated)!=null?t:!1}:void 0}function Lc(e){var t,n;return e===!0?{data:!0,size:!0}:e&&typeof e=="object"?{data:(t=e.data)!=null?t:!1,shouldRestorePosition:e.shouldRestorePosition,size:(n=e.size)!=null?n:!0}:e===!1?{data:!1,size:!1}:{data:!1,size:!0}}function Mc(e,{stylePaddingTop:t}){const n=e.state;if(t!==void 0){const o=C(e,"stylePaddingTop")||0;if(t<o){let i=C(e,"totalSize")||0;_(e,"totalSize",i+o),n.timeoutSetPaddingTop=setTimeout(()=>{i=C(e,"totalSize")||0,_(e,"totalSize",i-o)},16)}_(e,"stylePaddingTop",t)}}function zc(e){const t=p.useRef(null),n=p.useRef(0),o=p.useRef(null),i=()=>{t.current&&(clearTimeout(t.current),t.current=null)};return p.useCallback((r,s,...a)=>{{const c=Date.now();o.current=a,c-n.current>=s?(n.current=c,r(...a),i()):(i(),t.current=setTimeout(()=>{o.current&&(n.current=Date.now(),r(...o.current),t.current=null,o.current=null)},s-(c-n.current)))}},[e])}function Oc(e,t){const n=zc("throttle");return o=>n(e,t,{nativeEvent:o.nativeEvent})}var kc=Ke(Sl(function(t,n){const{children:o,data:i,renderItem:l,...r}=t,a=o!==void 0&&i===void 0?{...r,childrenMode:!0,data:(On(o)?o:p.Children.toArray(o)).flat(1),renderItem:({item:c})=>c}:{...r,data:i||[],renderItem:l};return p.createElement(Ul,null,p.createElement(Fc,{...a,ref:n}))})),Fc=Sl(function(t,n){var o,i,l,r,s,a,c,u,d,h,v,f,S,m,g,I,y,b,T;const M=p.useCallback(B=>{},[]);t.recycleItems===void 0&&mt("recycleItems-omitted","recycleItems was not provided, so it defaults to false. Set recycleItems explicitly to true for better performance with recycling-aware rows, or false to preserve remount-on-reuse behavior.");const{alignItemsAtEnd:w=!1,anchoredEndSpace:F,alwaysRender:P,columnWrapperStyle:E,contentContainerStyle:L,contentInset:D,data:R=[],dataKey:z,dataVersion:N,drawDistance:U=250,contentInsetEndAdjustment:$,estimatedItemSize:le=100,estimatedListSize:te,extraData:de,getFixedItemSize:ue,getItemType:re,horizontal:x,rtl:ne,estimatedHeaderSize:oe,initialScrollAtEnd:ee=!1,initialScrollIndex:Y,initialScrollOffset:G,experimental_adaptiveRender:j,experimental_hideItemsUntilMeasured:ie,itemsAreEqual:Se,keyExtractor:Ne,ListEmptyComponent:fe,ListFooterComponent:pe,ListFooterComponentStyle:Ue,ListHeaderComponent:nt,maintainScrollAtEnd:V=!1,maintainScrollAtEndThreshold:H=.1,maintainVisibleContentPosition:Q,numColumns:K=1,overrideItemLayout:De,onEndReached:ot,onEndReachedThreshold:Nt=.5,onItemSizeChanged:Ve,onMetricsChange:Be,onLayout:Rt,onLoad:me,onMomentumScrollEnd:$e,onRefresh:dt,onScroll:je,onScrollBeginDrag:cn,onStartReached:dn,onStartReachedThreshold:Dt=.5,onStickyHeaderChange:un,onFirstVisibleItemChanged:we,onViewableItemsChanged:ut,progressViewOffset:_t,recycleItems:Vn=!1,refreshControl:Vt,refreshing:fn,refScrollView:Bt,renderScrollComponent:vn,renderItem:Bn,scrollEventThrottle:ft,snapToIndices:Pt,stickyHeaderIndices:jn,style:_o,useWindowScroll:Me=!1,viewabilityConfig:jt,viewabilityConfigCallbackPairs:ze,...it}=t,Wt=t.animatedPropsInternal,vt=(o=t.anchoredEndSpaceOwnerInternal)!=null?o:"list",ht=t.positionComponentInternal,Ht=t.stickyPositionComponentInternal,{anchoredEndSpaceOwnerInternal:Ee,positionComponentInternal:Kt,stickyPositionComponentInternal:qe,...St}=it,Re=rn.flatten(L),Ge=w&&!x&&Re?.minHeight==null&&R.length>0,Tt=w&&!Ge&&(x?Re?.minWidth==null:Re?.minHeight==null),Oe={...Re,...w&&!Ge?{display:"flex",flexDirection:x?"row":"column",...Tt?{flexGrow:1}:{},justifyContent:"flex-end"}:{}},lt={...rn.flatten(_o)},We=Gt(lt,Oe,"Top"),Ye=Gt(lt,Oe,"Bottom"),A=Gt(lt,Oe,"Left"),W=Gt(lt,Oe,"Right"),J=vo({horizontal:x,rtl:ne,stylePaddingBottom:Ye,stylePaddingLeft:A,stylePaddingRight:W}),q=Tc(V),Ae=Lc(Q),be=Y!=null,se=G!=null,ae=!ee&&!be&&!se&&fo({horizontal:x,rtl:ne}),He=!ee&&!be&&(se||ae),ve=ee||be,pt=typeof Y=="number"&&!se&&R.length>1&&Y>=R.length-1,Lt=ee?{index:Math.max(0,R.length-1),preserveForBottomPadding:!0,viewOffset:-J,viewPosition:1}:be?typeof Y=="object"?{index:(i=Y.index)!=null?i:0,preserveForBottomPadding:Y.viewOffset===void 0&&Y.viewPosition===1?!0:void 0,viewOffset:(l=Y.viewOffset)!=null?l:Y.viewPosition===1?-J:0,viewPosition:(r=Y.viewPosition)!=null?r:0}:{index:Y??0,preserveForBottomPadding:pt?!0:void 0,viewOffset:G??(pt?-J:0),viewPosition:pt?1:void 0}:He?{contentOffset:G??0,index:0,viewOffset:0}:void 0,[Wn,Hn]=p.useState(!ho),[,Al]=p.useReducer(B=>B+1,0),O=Fe();O.columnWrapperStyle=E||(Oe?Cc(Oe):void 0);const Kn=x?(c=(s=O.columnWrapperStyle)==null?void 0:s.columnGap)!=null?c:(a=O.columnWrapperStyle)==null?void 0:a.gap:(h=(u=O.columnWrapperStyle)==null?void 0:u.rowGap)!=null?h:(d=O.columnWrapperStyle)==null?void 0:d.gap,hn=typeof Kn=="number"&&Number.isFinite(Kn)?Kn:0,Un=p.useRef(null),bl=mc(Un,Bt),$n=Ne??((B,X)=>X.toString()),rt=jn,Sn=$,Po=p.useRef(Sn),To=p.useMemo(()=>{const B=_c(P,R,$n,F?.anchorIndex);return{arr:B,set:new Set(B)}},[F?.anchorIndex,P?.top,P?.bottom,(v=P?.indices)==null?void 0:v.join(","),(f=P?.keys)==null?void 0:f.join(","),R,z,N,$n]),Lo=!!Me&&!vn,xe=p.useRef(void 0),Ut=!!De,Mo=p.useRef(Ut);if(!xe.current){if(!O.state){const B=(te??{height:0,width:0})[x?"width":"height"];O.values.set("adaptiveRender",(S=j?.initialMode)!=null?S:"normal"),O.state={averageSizes:{},columnSpans:[],columns:[],containerItemGenerations:[],containerItemKeys:new Map,containerItemMetadata:new Map,contentInsetOverride:void 0,dataChangeEpoch:0,dataChangeNeedsScrollUpdate:!1,didColumnsChange:!1,didDataChange:!1,didLoad:!1,enableScrollForNextCalculateItemsInView:!0,endBuffered:-1,endNoBuffer:-1,endReachedSnapshot:void 0,firstFullyOnScreenIndex:-1,freshDataTransitionEpoch:0,hasHadNonEmptyData:R.length>0,idCache:[],idsInView:[],indexByKey:new Map,initialScroll:Lt,initialScrollSession:Lt?{kind:He?"offset":"bootstrap",previousDataLength:R.length}:void 0,isEndReached:null,isFirst:!0,isStartReached:null,lastBatchingAction:Date.now(),lastLayout:void 0,lastScrollDelta:0,loadStartTime:Date.now(),minIndexSizeChanged:0,nativeContentInset:void 0,nativeMarginTop:0,pendingDataComparison:void 0,pendingNativeMVCPAdjust:void 0,positions:[],props:{},queuedCalculateItemsInView:0,refScroller:{current:null},scheduledWork:new Sc,scroll:0,scrollAdjustHandler:new pc(O),scrollForNextCalculateItemsInView:void 0,scrollHistory:[],scrollLength:B,scrollPending:0,scrollPrev:0,scrollPrevTime:0,scrollProcessingEnabled:!0,scrollTime:0,sizes:new Map,sizesKnown:new Map,startBuffered:-1,startNoBuffer:-1,startReachedSnapshot:void 0,stickyContainerPool:new Set,stickyContainers:new Map,totalSize:0,viewabilityConfigCallbackPairs:void 0};const X=O.state;O.scrollToEnd=ce=>El(O,ce),X.triggerCalculateItemsInView=ce=>Je(O,ce),X.reprocessCurrentScroll=()=>Ft(O,X.scroll,!0),_(O,"maintainVisibleContentPosition",Ae),_(O,"extraData",de),oe!==void 0&&_(O,"headerSize",oe)}xe.current=O.state}const k=xe.current,st=k.isFirst,wl=k.props.adaptiveRender,Rl=k.props.hideItemsUntilMeasured,_l=k.props.numColumns,Pl=!st&&O.scrollAxisGap!==hn;O.scrollAxisGap=hn,k.didColumnsChange=K!==_l||Pl;const Tl=(g=(m=k.props.data)==null?void 0:m.length)!=null?g:0,Ll=k.props.data!==R,zo=k.props.dataKey!==z,Ml=k.props.dataVersion!==N,at=zo||Ml||Ll&&rc(k,R,k.props.data),pn=!st&&at&&k.hasHadNonEmptyData&&(zo||Tl===0)&&R.length>0;at&&!ee&&k.didFinishInitialScroll&&((I=k.initialScroll)==null?void 0:I.viewPosition)===1&&k.props.data.length>0&&Ot(k),at&&(k.dataChangeEpoch+=1,k.dataChangeNeedsScrollUpdate=!0,k.didDataChange=!0,k.previousData=k.props.data),pn&&(k.freshDataTransitionEpoch+=1);const zl=Oc(je??M,ft??0),Ol=ft&&je?zl:je,Oo=!st&&!at&&((y=k.props.anchoredEndSpace)==null?void 0:y.anchorIndex)!==F?.anchorIndex;k.props={adaptiveRender:j,alignItemsAtEnd:w,alignItemsAtEndPaddingEnabled:Ge,alwaysRender:P,alwaysRenderIndicesArr:To.arr,alwaysRenderIndicesSet:To.set,anchoredEndSpace:F,anchoredEndSpaceOwner:vt,animatedProps:Wt,contentContainerAlignItems:Oe.alignItems,contentInset:D,contentInsetEndAdjustment:Sn,data:R,dataKey:z,dataVersion:N,drawDistance:U,estimatedItemSize:le,getFixedItemSize:Jn(ue),getItemType:Jn(re),hideItemsUntilMeasured:ie,horizontal:!!x,itemsAreEqual:Se,keyExtractor:Jn($n),maintainScrollAtEnd:q,maintainScrollAtEndThreshold:H,maintainVisibleContentPosition:Ae,numColumns:K,onEndReached:ot,onEndReachedThreshold:Nt,onFirstVisibleItemChanged:we,onItemSizeChanged:Ve,onLoad:me,onMomentumScrollEnd:$e,onScroll:Ol,onScrollBeginDrag:cn,onStartReached:dn,onStartReachedThreshold:Dt,onStickyHeaderChange:un,overrideItemLayout:De,positionComponentInternal:ht,recycleItems:!!Vn,renderItem:Bn,rtl:ne,snapToIndices:Pt,stickyHeaderIndicesArr:rt??[],stickyHeaderIndicesSet:p.useMemo(()=>new Set(rt??[]),[rt?.join(",")]),stickyPositionComponentInternal:Ht,stylePaddingBottom:Ye,stylePaddingLeft:A,stylePaddingRight:W,stylePaddingTop:We,useWindowScroll:Lo},k.refScroller=Un,!st&&wl&&!j&&So(O),!st&&Rl&&!ie&&ac(O);const ko=p.useMemo(()=>R.length?Array.from({length:Math.min(K,R.length)},(B,X)=>Z(k,R.length-1-X)):[],[R,z,N,K]),Fo=B=>{_(O,"lastItemKeys",ko),_(O,"numColumns",K);const X=C(O,"stylePaddingTop");Mc(O,{stylePaddingTop:We}),xe.current.props.stylePaddingBottom=Ye,Et(O);let ce=We-X;B&&Ae.size&&ce&&X!==void 0&&Qe.OS};st&&(Fo(!1),ll(k),sl(O,!0));const No=p.useMemo(()=>{var B,X;const ce=k.initialScroll;if(!ce)return;const he=(B=ce.contentOffset)!=null?B:ke(O,ce);return ve&&((X=k.initialScrollSession)==null?void 0:X.kind)==="bootstrap"&&Qe.OS==="web"?void 0:he},[ve]);p.useLayoutEffect(()=>{ys(O,{alwaysDispatchInitialScroll:ae,dataLength:R.length,hasFooterComponent:!!pe,initialContentOffset:No,initialScrollAtEnd:ee,useBootstrapInitialScroll:ve})},[]),(st||at||k.didColumnsChange)&&(xe.current.lastBatchingAction=Date.now(),!Ne&&!st&&at&&(xe.current.sizes.clear(),xe.current.positions.length=0,xe.current.totalSize=0,_(O,"totalSize",0))),_e&&ic(t),p.useLayoutEffect(()=>{pn&&go(O,{resetInitialScroll:!!Lt,resetLayout:!0}),Cs(O,{dataLength:R.length,didDataChange:at,didStartFreshData:pn,initialScrollAtEnd:ee,latestInitialScroll:Lt,latestInitialScrollSessionKind:He?"offset":"bootstrap",stylePaddingEnd:J,useBootstrapInitialScroll:ve})},[R.length,z,at,pn,ee,J,ve]),p.useLayoutEffect(()=>{var B;Oo&&(k.scrollForNextCalculateItemsInView=void 0,(B=k.triggerCalculateItemsInView)==null||B.call(k)),Rn(O)},[O,R,N,F?.anchorIndex,F?.anchorMaxSize,F?.anchorOffset,Oo,x,K,ne,Ye,A,W]),p.useLayoutEffect(()=>{const B=Po.current;Po.current=Sn,gc(O,B)},[O,Sn]);const kl=p.useCallback(B=>{ve&&is(O,{dataLength:R.length,footerSize:B[x?"width":"height"],initialScrollAtEnd:ee,stylePaddingEnd:J})},[R.length,ee,x,J,ve]),Fl=p.useCallback((B,X)=>{const ce=k.scrollLength,he=k.otherAxisSize;dc(O,B,Hn),Rn(O);const Do=ce!==k.scrollLength||he!==k.otherAxisSize;ve&&!X&&Do&&ls(O),!ve&&nn(O)},[R.length,ee,J,ve]),{onLayout:Nl}=Ro({onLayoutChange:Fl,onLayoutProp:Rt,ref:Un});p.useLayoutEffect(()=>{Pt&&rl(O)},[Pt]),p.useLayoutEffect(()=>Fo(!0),[z,N,ko.join(","),K,hn,Ye,We,Ge]),p.useLayoutEffect(()=>{const{didColumnsChange:B,didDataChange:X,isFirst:ce,props:{data:he}}=k;!(he.length>0&&Cl(O))&&!ce&&(X||B)&&lc(O,he,{didColumnsChange:B}),X&&(k.pendingDataComparison=void 0),k.didColumnsChange=!1,k.didDataChange=!1,k.isFirst=!1},[R,z,N,K,hn]),p.useLayoutEffect(()=>{var B;_(O,"extraData",de);const X=Mo.current!==Ut;Mo.current=Ut,(Ut||X)&&K>1&&((B=k.triggerCalculateItemsInView)==null||B.call(k,{forceFullItemPositions:!0}))},[de,Ut,K]),p.useEffect(()=>{if(!Be)return;let B;const X=()=>{const he={footerSize:C(O,"footerSize")||0,headerSize:C(O,"headerSize")||0};(!B||he.headerSize!==B.headerSize||he.footerSize!==B.footerSize)&&(B=he,Be(he))};X();const ce=[Ze(O,"headerSize",X),Ze(O,"footerSize",X)];return()=>{for(const he of ce)he()}},[O,Be]),p.useEffect(()=>{const B=_s({onViewableItemsChanged:ut,viewabilityConfig:jt,viewabilityConfigCallbackPairs:ze});k.viewabilityConfigCallbackPairs=B,k.enableScrollForNextCalculateItemsInView=!0,B&&(k.scrollForNextCalculateItemsInView=void 0)},[jt,ze,ut]),la(()=>{}),p.useImperativeHandle(n,()=>wc(O,Al),[]),p.useEffect(()=>()=>{Ko(k),k.scheduledWork.dispose()},[k]),p.useLayoutEffect(()=>{var B;(B=k.runPendingScrollToEnd)==null||B.call(k)}),p.useEffect(()=>{ve||nn(O)},[O,ve]);const $t=p.useMemo(()=>({getRenderedItem:(B,X)=>Pc(O,B,X),onMomentumScrollEnd:B=>{ms(O),k.props.onMomentumScrollEnd&&k.props.onMomentumScrollEnd(B)},onScroll:B=>hc(O,B),onScrollBeginDrag:B=>{var X,ce;const he=k.maintainingScrollAtEnd;(he==="animated"||he==="instant")&&Ko(k),he&&Zt(O),$o(O),(ce=(X=k.props).onScrollBeginDrag)==null||ce.call(X,B)},onScrollEnd:()=>$o(O)}),[]),Dl=yc(rt,x,O,$t.onScroll),gn=Vt;return p.createElement(p.Fragment,null,p.createElement(Ja,{...St,alignItemsAtEnd:w,canRender:Wn,contentContainerStyle:Oe,contentInset:D,freshDataTransitionEpoch:k.freshDataTransitionEpoch,getRenderedItem:$t.getRenderedItem,horizontal:x,initialContentOffset:No,ListEmptyComponent:R.length===0?fe:void 0,ListFooterComponent:pe,ListFooterComponentStyle:Ue,ListHeaderComponent:nt,onInternalScrollBeginDrag:$t.onScrollBeginDrag,onInternalScrollEnd:$t.onScrollEnd,onLayout:Nl,onLayoutFooter:kl,onMomentumScrollEnd:$t.onMomentumScrollEnd,onScroll:Dl,recycleItems:Vn,refreshControl:gn?We>0?p.cloneElement(gn,{progressViewOffset:((b=gn.props.progressViewOffset)!=null?b:0)+We}):gn:dt&&p.createElement(Ic,{onRefresh:dt,progressViewOffset:(_t||0)+We,refreshing:!!fn}),refScrollView:bl,renderScrollComponent:vn,scrollAdjustHandler:(T=xe.current)==null?void 0:T.scrollAdjustHandler,scrollEventThrottle:0,snapToIndices:Pt,stickyHeaderIndices:rt,style:lt,useWindowScroll:Lo}),_e&&nr)}),Nc=kc,Bc=Nc;export{Bc as L};