vane-waterfall 1.0.1

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 (42) hide show
  1. package/README.md +370 -0
  2. package/dist/404.jpg +0 -0
  3. package/dist/components/WaterfallPlugin/core/WaterfallCore.d.ts +174 -0
  4. package/dist/components/WaterfallPlugin/custom-plugins/A11y/index.d.ts +16 -0
  5. package/dist/components/WaterfallPlugin/custom-plugins/Alignment/index.d.ts +12 -0
  6. package/dist/components/WaterfallPlugin/custom-plugins/AutoColumn/index.d.ts +17 -0
  7. package/dist/components/WaterfallPlugin/custom-plugins/Bookmark/index.d.ts +15 -0
  8. package/dist/components/WaterfallPlugin/custom-plugins/ClickAnalytics/index.d.ts +12 -0
  9. package/dist/components/WaterfallPlugin/custom-plugins/DebounceLayout/index.d.ts +10 -0
  10. package/dist/components/WaterfallPlugin/custom-plugins/DragReorder/index.d.ts +13 -0
  11. package/dist/components/WaterfallPlugin/custom-plugins/Filter/index.d.ts +15 -0
  12. package/dist/components/WaterfallPlugin/custom-plugins/FixedHeight/index.d.ts +11 -0
  13. package/dist/components/WaterfallPlugin/custom-plugins/Gap/index.d.ts +31 -0
  14. package/dist/components/WaterfallPlugin/custom-plugins/Grouping/index.d.ts +12 -0
  15. package/dist/components/WaterfallPlugin/custom-plugins/HeatmapAnalytics/index.d.ts +14 -0
  16. package/dist/components/WaterfallPlugin/custom-plugins/InfiniteScroll/index.d.ts +13 -0
  17. package/dist/components/WaterfallPlugin/custom-plugins/Pagination/index.d.ts +15 -0
  18. package/dist/components/WaterfallPlugin/custom-plugins/PinItem/index.d.ts +13 -0
  19. package/dist/components/WaterfallPlugin/custom-plugins/Recycle/index.d.ts +12 -0
  20. package/dist/components/WaterfallPlugin/custom-plugins/ReducedMotion/index.d.ts +13 -0
  21. package/dist/components/WaterfallPlugin/custom-plugins/ResponsiveColumns/index.d.ts +10 -0
  22. package/dist/components/WaterfallPlugin/custom-plugins/ScrollAnchor/index.d.ts +12 -0
  23. package/dist/components/WaterfallPlugin/custom-plugins/Search/index.d.ts +15 -0
  24. package/dist/components/WaterfallPlugin/custom-plugins/Sort/index.d.ts +15 -0
  25. package/dist/components/WaterfallPlugin/custom-plugins/StatePersistence/index.d.ts +16 -0
  26. package/dist/components/WaterfallPlugin/custom-plugins/StickyHeader/index.d.ts +11 -0
  27. package/dist/components/WaterfallPlugin/custom-plugins/Throttle/index.d.ts +12 -0
  28. package/dist/components/WaterfallPlugin/custom-plugins/Transition/index.d.ts +13 -0
  29. package/dist/components/WaterfallPlugin/custom-plugins/URLSync/index.d.ts +14 -0
  30. package/dist/components/WaterfallPlugin/custom-plugins/VirtualWaterfall/index.d.ts +12 -0
  31. package/dist/components/WaterfallPlugin/custom-plugins/index.d.ts +30 -0
  32. package/dist/components/WaterfallPlugin/index.d.ts +10 -0
  33. package/dist/components/WaterfallPlugin/plugins/PluginBus.d.ts +2 -0
  34. package/dist/components/WaterfallPlugin/plugins/PluginManager.d.ts +2 -0
  35. package/dist/components/WaterfallPlugin/plugins/index.d.ts +8 -0
  36. package/dist/components/WaterfallPlugin/plugins/types.d.ts +468 -0
  37. package/dist/components/WaterfallPlugin/plugins/withPlugins.d.ts +8 -0
  38. package/dist/index.d.ts +11 -0
  39. package/dist/index.es.js +2382 -0
  40. package/dist/index.umd.js +30 -0
  41. package/dist/vite.svg +1 -0
  42. package/package.json +82 -0
@@ -0,0 +1,30 @@
1
+ (function(M,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],y):(M=typeof globalThis<"u"?globalThis:M||self,y(M.WaterfallPlugin={},M.React))})(this,function(M,y){"use strict";var Je={exports:{}},De={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Xe;function ot(){if(Xe)return De;Xe=1;var a=y,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,i=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(c,u,h){var p,m={},f=null,w=null;h!==void 0&&(f=""+h),u.key!==void 0&&(f=""+u.key),u.ref!==void 0&&(w=u.ref);for(p in u)t.call(u,p)&&!s.hasOwnProperty(p)&&(m[p]=u[p]);if(c&&c.defaultProps)for(p in u=c.defaultProps,u)m[p]===void 0&&(m[p]=u[p]);return{$$typeof:n,type:c,key:f,ref:w,props:m,_owner:i.current}}return De.Fragment=r,De.jsx=l,De.jsxs=l,De}var We={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Ze;function at(){return Ze||(Ze=1,process.env.NODE_ENV!=="production"&&function(){var a=y,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),k=Symbol.iterator,I="@@iterator";function ue(e){if(e===null||typeof e!="object")return null;var d=k&&e[k]||e[I];return typeof d=="function"?d:null}var Q=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var d=arguments.length,v=new Array(d>1?d-1:0),E=1;E<d;E++)v[E-1]=arguments[E];ee("error",e,v)}}function ee(e,d,v){{var E=Q.ReactDebugCurrentFrame,L=E.getStackAddendum();L!==""&&(d+="%s",v=v.concat([L]));var B=v.map(function(j){return String(j)});B.unshift("Warning: "+d),Function.prototype.apply.call(console[e],console,B)}}var ye=!1,we=!1,Re=!1,re=!1,Te=!1,be;be=Symbol.for("react.module.reference");function pe(e){return!!(typeof e=="string"||typeof e=="function"||e===t||e===s||Te||e===i||e===h||e===p||re||e===w||ye||we||Re||typeof e=="object"&&e!==null&&(e.$$typeof===f||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===u||e.$$typeof===be||e.getModuleId!==void 0))}function Se(e,d,v){var E=e.displayName;if(E)return E;var L=d.displayName||d.name||"";return L!==""?v+"("+L+")":v}function he(e){return e.displayName||"Context"}function te(e){if(e==null)return null;if(typeof e.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case t:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case h:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var d=e;return he(d)+".Consumer";case l:var v=e;return he(v._context)+".Provider";case u:return Se(e,e.render,"ForwardRef");case m:var E=e.displayName||null;return E!==null?E:te(e.type)||"Memo";case f:{var L=e,B=L._payload,j=L._init;try{return te(j(B))}catch{return null}}}return null}var X=Object.assign,fe=0,Ee,J,P,W,ge,F,b;function oe(){}oe.__reactDisabledLog=!0;function o(){{if(fe===0){Ee=console.log,J=console.info,P=console.warn,W=console.error,ge=console.group,F=console.groupCollapsed,b=console.groupEnd;var e={configurable:!0,enumerable:!0,value:oe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}fe++}}function g(){{if(fe--,fe===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:X({},e,{value:Ee}),info:X({},e,{value:J}),warn:X({},e,{value:P}),error:X({},e,{value:W}),group:X({},e,{value:ge}),groupCollapsed:X({},e,{value:F}),groupEnd:X({},e,{value:b})})}fe<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var S=Q.ReactCurrentDispatcher,_;function H(e,d,v){{if(_===void 0)try{throw Error()}catch(L){var E=L.stack.trim().match(/\n( *(at )?)/);_=E&&E[1]||""}return`
18
+ `+_+e}}var V=!1,U;{var N=typeof WeakMap=="function"?WeakMap:Map;U=new N}function Z(e,d){if(!e||V)return"";{var v=U.get(e);if(v!==void 0)return v}var E;V=!0;var L=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var B;B=S.current,S.current=null,o();try{if(d){var j=function(){throw Error()};if(Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(ce){E=ce}Reflect.construct(e,[],j)}else{try{j.call()}catch(ce){E=ce}e.call(j.prototype)}}else{try{throw Error()}catch(ce){E=ce}e()}}catch(ce){if(ce&&E&&typeof ce.stack=="string"){for(var O=ce.stack.split(`
19
+ `),ne=E.stack.split(`
20
+ `),K=O.length-1,x=ne.length-1;K>=1&&x>=0&&O[K]!==ne[x];)x--;for(;K>=1&&x>=0;K--,x--)if(O[K]!==ne[x]){if(K!==1||x!==1)do if(K--,x--,x<0||O[K]!==ne[x]){var ve=`
21
+ `+O[K].replace(" at new "," at ");return e.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,ve),ve}while(K>=1&&x>=0);break}}}finally{V=!1,S.current=B,g(),Error.prepareStackTrace=L}var Le=e?e.displayName||e.name:"",Ae=Le?H(Le):"";return typeof e=="function"&&U.set(e,Ae),Ae}function q(e,d,v){return Z(e,!1)}function $(e){var d=e.prototype;return!!(d&&d.isReactComponent)}function me(e,d,v){if(e==null)return"";if(typeof e=="function")return Z(e,$(e));if(typeof e=="string")return H(e);switch(e){case h:return H("Suspense");case p:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return q(e.render);case m:return me(e.type,d,v);case f:{var E=e,L=E._payload,B=E._init;try{return me(B(L),d,v)}catch{}}}return""}var de=Object.prototype.hasOwnProperty,Be={},ze=Q.ReactDebugCurrentFrame;function Me(e){if(e){var d=e._owner,v=me(e.type,e._source,d?d.type:null);ze.setExtraStackFrame(v)}else ze.setExtraStackFrame(null)}function Ie(e,d,v,E,L){{var B=Function.call.bind(de);for(var j in e)if(B(e,j)){var O=void 0;try{if(typeof e[j]!="function"){var ne=Error((E||"React class")+": "+v+" type `"+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[j]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ne.name="Invariant Violation",ne}O=e[j](d,j,E,v,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(K){O=K}O&&!(O instanceof Error)&&(Me(L),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",v,j,typeof O),Me(null)),O instanceof Error&&!(O.message in Be)&&(Be[O.message]=!0,Me(L),C("Failed %s type: %s",v,O.message),Me(null))}}}var Ue=Array.isArray;function Ce(e){return Ue(e)}function _e(e){{var d=typeof Symbol=="function"&&Symbol.toStringTag,v=d&&e[Symbol.toStringTag]||e.constructor.name||"Object";return v}}function He(e){try{return Fe(e),!1}catch{return!0}}function Fe(e){return""+e}function Ne(e){if(He(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_e(e)),Fe(e)}var Ge=Q.ReactCurrentOwner,xe={key:!0,ref:!0,__self:!0,__source:!0},T,R;function G(e){if(de.call(e,"ref")){var d=Object.getOwnPropertyDescriptor(e,"ref").get;if(d&&d.isReactWarning)return!1}return e.ref!==void 0}function z(e){if(de.call(e,"key")){var d=Object.getOwnPropertyDescriptor(e,"key").get;if(d&&d.isReactWarning)return!1}return e.key!==void 0}function Y(e,d){typeof e.ref=="string"&&Ge.current}function A(e,d){{var v=function(){T||(T=!0,C("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};v.isReactWarning=!0,Object.defineProperty(e,"key",{get:v,configurable:!0})}}function ae(e,d){{var v=function(){R||(R=!0,C("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};v.isReactWarning=!0,Object.defineProperty(e,"ref",{get:v,configurable:!0})}}var Pe=function(e,d,v,E,L,B,j){var O={$$typeof:n,type:e,key:d,ref:v,props:j,_owner:B};return O._store={},Object.defineProperty(O._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(O,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(O,"_source",{configurable:!1,enumerable:!1,writable:!1,value:L}),Object.freeze&&(Object.freeze(O.props),Object.freeze(O)),O};function Ye(e,d,v,E,L){{var B,j={},O=null,ne=null;v!==void 0&&(Ne(v),O=""+v),z(d)&&(Ne(d.key),O=""+d.key),G(d)&&(ne=d.ref,Y(d,L));for(B in d)de.call(d,B)&&!xe.hasOwnProperty(B)&&(j[B]=d[B]);if(e&&e.defaultProps){var K=e.defaultProps;for(B in K)j[B]===void 0&&(j[B]=K[B])}if(O||ne){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;O&&A(j,x),ne&&ae(j,x)}return Pe(e,O,ne,L,E,Ge.current,j)}}var ie=Q.ReactCurrentOwner,je=Q.ReactDebugCurrentFrame;function ke(e){if(e){var d=e._owner,v=me(e.type,e._source,d?d.type:null);je.setExtraStackFrame(v)}else je.setExtraStackFrame(null)}var se;se=!1;function Ve(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ke(){{if(ie.current){var e=te(ie.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function Oe(e){return""}var le={};function Bt(e){{var d=Ke();if(!d){var v=typeof e=="string"?e:e.displayName||e.name;v&&(d=`
24
+
25
+ Check the top-level render call using <`+v+">.")}return d}}function et(e,d){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var v=Bt(d);if(le[v])return;le[v]=!0;var E="";e&&e._owner&&e._owner!==ie.current&&(E=" It was passed a child from "+te(e._owner.type)+"."),ke(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',v,E),ke(null)}}function tt(e,d){{if(typeof e!="object")return;if(Ce(e))for(var v=0;v<e.length;v++){var E=e[v];Ve(E)&&et(E,d)}else if(Ve(e))e._store&&(e._store.validated=!0);else if(e){var L=ue(e);if(typeof L=="function"&&L!==e.entries)for(var B=L.call(e),j;!(j=B.next()).done;)Ve(j.value)&&et(j.value,d)}}}function Ft(e){{var d=e.type;if(d==null||typeof d=="string")return;var v;if(typeof d=="function")v=d.propTypes;else if(typeof d=="object"&&(d.$$typeof===u||d.$$typeof===m))v=d.propTypes;else return;if(v){var E=te(d);Ie(v,e.props,"prop",E,e)}else if(d.PropTypes!==void 0&&!se){se=!0;var L=te(d);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",L||"Unknown")}typeof d.getDefaultProps=="function"&&!d.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vt(e){{for(var d=Object.keys(e.props),v=0;v<d.length;v++){var E=d[v];if(E!=="children"&&E!=="key"){ke(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),ke(null);break}}e.ref!==null&&(ke(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),ke(null))}}var nt={};function rt(e,d,v,E,L,B){{var j=pe(e);if(!j){var O="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(O+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ne=Oe();ne?O+=ne:O+=Ke();var K;e===null?K="null":Ce(e)?K="array":e!==void 0&&e.$$typeof===n?(K="<"+(te(e.type)||"Unknown")+" />",O=" Did you accidentally export a JSX literal instead of a component?"):K=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",K,O)}var x=Ye(e,d,v,L,B);if(x==null)return x;if(j){var ve=d.children;if(ve!==void 0)if(E)if(Ce(ve)){for(var Le=0;Le<ve.length;Le++)tt(ve[Le],e);Object.freeze&&Object.freeze(ve)}else C("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tt(ve,e)}if(de.call(d,"key")){var Ae=te(e),ce=Object.keys(d).filter(function(Kt){return Kt!=="key"}),Qe=ce.length>0?"{key: someKey, "+ce.join(": ..., ")+": ...}":"{key: someKey}";if(!nt[Ae+Qe]){var Yt=ce.length>0?"{"+ce.join(": ..., ")+": ...}":"{}";C(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,Qe,Ae,Yt,Ae),nt[Ae+Qe]=!0}}return e===t?Vt(x):Ft(x),x}}function zt(e,d,v){return rt(e,d,v,!0)}function Ut(e,d,v){return rt(e,d,v,!1)}var Nt=Ut,Gt=zt;We.Fragment=t,We.jsx=Nt,We.jsxs=Gt}()),We}process.env.NODE_ENV==="production"?Je.exports=ot():Je.exports=at();var D=Je.exports;const it=y.forwardRef(function(n,r){const{items:t=[],renderItem:i,keyExtractor:s=(T,R)=>R,columns:l=3,gap:c=16,rowGap:u,columnGap:h,alignmentMode:p="shortest",padding:m=0,containerStyle:f,containerClassName:w,itemStyle:k,itemClassName:I,useTransform:ue=!0,throttleDelay:Q=16,debounceDelay:C=150,onMount:ee,onUnmount:ye,onBeforeLayout:we,onLayout:Re,onLayoutComplete:re,onItemMount:Te,onItemUnmount:be,onItemEnterViewport:pe,onItemLeaveViewport:Se,onScroll:he,onResize:te,onReachBottom:X,onItemClick:fe,children:Ee,containerRefExternal:J,itemRefsExternal:P,debug:W=!1}=n,ge=y.useRef(null),F=y.useRef(new Map),b=J||ge,oe=P||F,o=y.useRef(new Map),g=y.useRef(null),S=y.useRef(),_=y.useRef(),H=y.useRef(0),[V,U]=y.useState({columns:l,columnWidth:0,gap:h||c,columnHeights:Array(l).fill(0),totalHeight:0,containerWidth:0,containerHeight:0}),[N,Z]=y.useState(new Map),q=y.useRef(!1),$=y.useRef(!1),me=y.useRef(!1),[de,Be]=y.useState({scrollTop:0,scrollLeft:0,scrollHeight:0,scrollWidth:0,clientHeight:0,clientWidth:0,isScrolling:!1,direction:null}),[,ze]=y.useState({}),Me=y.useRef(new Set),Ie=y.useMemo(()=>typeof m=="number"?{top:m,right:m,bottom:m,left:m}:{top:m.top||0,right:m.right||0,bottom:m.bottom||0,left:m.left||0},[m]),Ue=u!==void 0?u:c,Ce=h!==void 0?h:c,_e=y.useCallback(async()=>{const T=b.current,R=oe.current;if(!T||q.current)return;if(q.current=!0,me.current=!1,we&&await we()===!1){q.current=!1;return}const G=T.clientWidth,Y=(G-Ie.left-Ie.right-Ce*(l-1))/l,A=Array(l).fill(Ie.top),ae=Array(l).fill(0),Pe=new Map;if(Re&&Re(),t.length===0){const ie=Ie.top+Ie.bottom;U({columns:l,columnWidth:Y,gap:Ce,columnHeights:A,totalHeight:ie,containerWidth:G,containerHeight:T.clientHeight}),Z(new Map),$.current=!0,re&&re(),q.current=!1,me.current=!1;return}for(let ie=0;ie<t.length;ie++){const je=R.get(ie),ke=(je==null?void 0:je.offsetHeight)||0;if(ke===0)continue;let se=0;if(p==="sequential")se=ie%l;else if(p==="balanced"){let Oe=ae[0];se=0;for(let le=1;le<l;le++)ae[le]<Oe&&(Oe=ae[le],se=le)}else{let Oe=A[0];se=0;for(let le=1;le<A.length;le++)A[le]<Oe&&(Oe=A[le],se=le)}const Ve=Ie.left+se*(Y+Ce),Ke=A[se];Pe.set(ie,{x:Ve,y:Ke,width:Y,height:ke,column:se,row:Math.floor(ie/l)}),A[se]+=ke+Ue,ae[se]+=1}const Ye=Math.max(...A)+Ie.bottom;U({columns:l,columnWidth:Y,gap:Ce,columnHeights:A,totalHeight:Ye,containerWidth:G,containerHeight:T.clientHeight}),Z(Pe),$.current=!0,re&&re(),q.current=!1,me.current=!1},[t,l,Ce,Ue,Ie,we,Re,re,W,b,oe]),He=y.useCallback(()=>{_.current&&window.clearTimeout(_.current),_.current=window.setTimeout(()=>{_e()},C)},[_e,C]),Fe=y.useCallback(()=>{const T=b.current;if(!T)return;const R=de.scrollTop,G=de.scrollLeft,z=T.scrollTop,Y=T.scrollLeft,A=z>R?"down":z<R?"up":Y>G?"right":Y<G?"left":null;Be({scrollTop:z,scrollLeft:Y,scrollHeight:T.scrollHeight,scrollWidth:T.scrollWidth,clientHeight:T.clientHeight,clientWidth:T.clientWidth,isScrolling:!0,direction:A})},[de.scrollTop,de.scrollLeft,b]),Ne=y.useCallback(()=>{const T=Date.now();Fe();const R=b.current;if(R){if(he&&he(R.scrollTop,R.scrollLeft),T-H.current>=Q){if(H.current=T,X){const G=R.scrollTop,z=R.scrollHeight,Y=R.clientHeight,A=z-(G+Y);A<100&&X(A)}if(pe||Se){const G=R.scrollTop,z=R.clientHeight,Y=new Set;N.forEach((A,ae)=>{const Pe=A.y;A.y+A.height>G&&Pe<G+z&&(Y.add(ae),!Me.current.has(ae)&&pe&&pe(ae))}),Se&&Me.current.forEach(A=>{Y.has(A)||Se(A)}),Me.current=Y}}S.current&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{Be(G=>({...G,isScrolling:!1}))},C)}},[Fe,he,X,pe,Se,b,N,Q,C]),Ge=y.useCallback(T=>{var Y;const R=(Y=T[0])==null?void 0:Y.target;if(!R)return;const G=R.clientWidth,z=R.clientHeight;te&&te(G,z),He()},[te,He]);y.useEffect(()=>{ee&&ee(),$.current||_e();const T=b.current;return T&&(g.current=new ResizeObserver(Ge),g.current.observe(T)),()=>{var R;ye&&ye(),(R=g.current)==null||R.disconnect(),S.current&&window.clearTimeout(S.current),_.current&&window.clearTimeout(_.current)}},[]),y.useEffect(()=>{$.current=!1,me.current=!1,He()},[t,He]),y.useEffect(()=>{$.current=!1,me.current=!1,_e()},[l]),y.useImperativeHandle(r,()=>({relayout:_e,scrollToItem:(T,R={})=>{const G=N.get(T);if(!G||!b.current)return;const z=b.current,Y=R.offset||0;let A=G.y+Y;R.block==="center"?A-=z.clientHeight/2-G.height/2:R.block==="end"&&(A-=z.clientHeight-G.height),z.scrollTo({top:Math.max(0,A),behavior:R.behavior||"auto"})},scrollToTop:(T={})=>{var R;(R=b.current)==null||R.scrollTo({top:T.offset||0,behavior:T.behavior||"auto"})},scrollToBottom:(T={})=>{const R=b.current;R&&R.scrollTo({top:R.scrollHeight-R.clientHeight+(T.offset||0),behavior:T.behavior||"auto"})},getItemPosition:T=>N.get(T)||null,getAllItemPositions:()=>N,getColumnHeights:()=>V.columnHeights,getLayoutInfo:()=>V,getViewportInfo:()=>{const T=b.current;return T?{scrollTop:T.scrollTop,scrollLeft:T.scrollLeft,scrollHeight:T.scrollHeight,scrollWidth:T.scrollWidth,clientHeight:T.clientHeight,clientWidth:T.clientWidth,isScrolling:de.isScrolling,direction:de.direction}:de},forceUpdate:()=>ze({}),getContainer:()=>b.current,getItemElement:T=>oe.current.get(T)||null,measureItem:async T=>{const R=oe.current.get(T);return R?{width:R.offsetWidth,height:R.offsetHeight}:{width:0,height:0}}}));const xe=()=>t.map((T,R)=>{const G=s(T,R),z=N.get(R),Y=z?ue?{position:"absolute",transform:`translate(${z.x}px, ${z.y}px)`,width:z.width,boxSizing:"border-box"}:{position:"absolute",left:z.x,top:z.y,width:z.width,boxSizing:"border-box"}:{position:"absolute",opacity:0,pointerEvents:"none"};return D.jsx("div",{ref:A=>{if(A){if(oe.current.set(R,A),!o.current.get(R)){const Pe=new ResizeObserver(()=>{He()});try{Pe.observe(A),o.current.set(R,Pe)}catch{}}Te&&Te(R,A),$.current&&!z&&!q.current&&!me.current&&(me.current=!0,requestAnimationFrame(()=>_e()))}else{oe.current.delete(R);const ae=o.current.get(R);if(ae){try{ae.disconnect()}catch{}o.current.delete(R)}be&&be(R)}},style:{...Y,...k},className:I,onClick:A=>fe==null?void 0:fe(R,T,A),"data-index":R,children:i(T,R)},G)});return D.jsxs("div",{ref:b,style:{position:"relative",overflowX:"hidden",overflowY:"auto",...f},className:w,onScroll:Ne,children:[Ee,D.jsx("div",{style:{position:"relative",width:"100%",height:V.totalHeight,minWidth:0},children:xe()})]})});function qe(){const a=new Map,n=new Map,r=(f,w)=>{const k=a.get(f);if(k)for(const I of k)try{I(w)}catch{}},t=(f,w)=>{let k=a.get(f);return k||(k=new Set,a.set(f,k)),k.add(w),()=>{k==null||k.delete(w)}},i=(f,w)=>{const k=I=>{w(I),s(f,k)};return t(f,k)},s=(f,w)=>{if(!w){a.delete(f);return}const k=a.get(f);k&&k.delete(w)};return{emit:r,on:t,once:i,off:s,getData:f=>n.get(f),setData:(f,w)=>{n.set(f,w)},deleteData:f=>{n.delete(f)},hasData:f=>n.has(f),getAll:()=>{const f={};return n.forEach((w,k)=>{f[k]=w}),f},clear:()=>{a.clear(),n.clear()}}}function $e(){const a=new Map,n=f=>{if(f.dependencies)for(const w of f.dependencies)a.has(w);a.set(f.name,{...f,enabled:f.enabled??!0}),f.init&&Promise.resolve(f.init()).catch(w=>{})},r=f=>{const w=[...f].sort((k,I)=>(I.priority??0)-(k.priority??0));for(const k of w)n(k)},t=f=>{const w=a.get(f);w&&(w.destroy&&Promise.resolve(w.destroy()).catch(k=>{}),a.delete(f))},i=f=>a.get(f),s=()=>Array.from(a.values()),l=()=>Array.from(a.values()).filter(f=>f.enabled!==!1);return{register:n,registerAll:r,unregister:t,getPlugin:i,getAllPlugins:s,getEnabledPlugins:l,enablePlugin:f=>{const w=a.get(f);w&&(w.enabled=!0)},disablePlugin:f=>{const w=a.get(f);w&&(w.enabled=!1)},hasPlugin:f=>a.has(f),executeHook:async(f,w,...k)=>{const ue=[...l()].sort((Q,C)=>(C.priority??0)-(Q.priority??0));for(const Q of ue){const C=Q.hooks[f];if(C)try{const ee=await Promise.resolve(C(w,...k));if(ee===!1)return!1;if(ee!==void 0&&ee!==!0)return ee}catch{if(f==="onError")break}}},clear:()=>{for(const f of a.values())f.destroy&&Promise.resolve(f.destroy()).catch(w=>{});a.clear()}}}function st(){const a=typeof navigator<"u"?navigator:void 0,n=(a==null?void 0:a.connection)||(a==null?void 0:a.mozConnection)||(a==null?void 0:a.webkitConnection);if(n)return{effectiveType:n.effectiveType||"4g",downlink:Number(n.downlink||10),rtt:Number(n.rtt||50),saveData:!!n.saveData,online:(a==null?void 0:a.onLine)!==!1}}function lt(){const a=typeof window<"u"?window.innerWidth:1024,n=typeof window<"u"?window.innerHeight:768,r=typeof window<"u"&&window.devicePixelRatio||1,t=typeof navigator<"u"&&navigator.userAgent||"",i=/Mobile|Android|iPhone|iPad/i.test(t),l=/iPad|Tablet/i.test(t)?"tablet":i?"mobile":"desktop",c=typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0);return{type:l,os:t,browser:t,devicePixelRatio:r,viewportWidth:a,viewportHeight:n,isTouchDevice:c,isRetina:r>=2}}function ct(a,n){const r=Array.isArray(n)?{plugins:n,enableDebug:!1}:n,{plugins:t,enableDebug:i=!1}=r,s=y.forwardRef((l,c)=>{const h=y.useRef($e()).current,m=y.useRef(qe()).current,f=y.useRef(null),w=y.useRef(new Map),k=y.useRef(new Map),I=y.useRef(null),[ue,Q]=y.useState({columns:l.columns||3,columnWidth:0,gap:l.gap||16,columnHeights:[],totalHeight:0,containerWidth:0,containerHeight:0}),[C,ee]=y.useState(new Map),[ye,we]=y.useState({scrollTop:0,scrollLeft:0,scrollHeight:0,scrollWidth:0,clientHeight:0,clientWidth:0,isScrolling:!1,direction:null}),[Re,re]=y.useState(new Set),[Te,be]=y.useState(!1),[pe,Se]=y.useState(!1),[he,te]=y.useState(!0),[X,fe]=y.useState(null),Ee=y.useMemo(()=>st(),[]),J=y.useMemo(()=>lt(),[]),P=y.useMemo(()=>({items:l.items||[],itemCount:(l.items||[]).length,containerRef:f,itemRefs:w.current,getItemRef:o=>w.current.get(o)||null,layout:ue,itemPositions:C,getItemPosition:o=>C.get(o)||null,viewport:ye,visibleItems:Re,visibleRange:(()=>{const o=f.current;if(!o||C.size===0)return{start:0,end:0};const g=o.scrollTop,S=g+o.clientHeight;let _=null,H=null;return C.forEach((V,U)=>{const N=V.y,Z=V.y+V.height;Math.max(0,Math.min(S,Z)-Math.max(g,N))>0&&((_===null||U<_)&&(_=U),(H===null||U>H)&&(H=U))}),{start:_??0,end:H??0}})(),isLayouting:Te,isScrolling:ye.isScrolling,isDragging:!1,isLoading:pe,hasMore:he,error:X,props:l,bus:m,sharedData:k.current,networkInfo:Ee,deviceInfo:J,relayout:()=>{var o;return(o=I.current)==null?void 0:o.relayout()},scrollToItem:(o,g)=>{var S;return(S=I.current)==null?void 0:S.scrollToItem(o,g)},scrollToTop:o=>{var g;return(g=I.current)==null?void 0:g.scrollToTop(o)},scrollToBottom:o=>{var g;return(g=I.current)==null?void 0:g.scrollToBottom(o)},measureItem:o=>{var g;return((g=I.current)==null?void 0:g.measureItem(o))||Promise.resolve({width:0,height:0})},forceUpdate:()=>{var o;return(o=I.current)==null?void 0:o.forceUpdate()}}),[l,ue,C,ye,Re,Te,pe,he,X,m,Ee,J]),W=y.useRef([]),ge=t.map(o=>o.name);(W.current.length===0||W.current.join("|")!==ge.join("|"))&&(h.clear(),h.registerAll(t),W.current=ge);const F=y.useRef(l);y.useEffect(()=>{const o=F.current;o!==l&&(h.executeHook("onPropsChange",P,o,l).catch(()=>{}),F.current=l)},[l]);const b=y.useMemo(()=>{let o={...l};return t.forEach(g=>{g.hooks.transformProps&&(o=g.hooks.transformProps(o))}),o},[l,t,ye.clientWidth]),oe={...b,containerRefExternal:f,itemRefsExternal:w,debug:b.debug??i,onMount:()=>{var o;(o=b.onMount)==null||o.call(b),h.executeHook("onMount",P).catch(()=>{})},onUnmount:()=>{var o;(o=b.onUnmount)==null||o.call(b),h.executeHook("onUnmount",P).catch(()=>{})},onBeforeLayout:async()=>{var g;return be(!0),await h.executeHook("onBeforeLayout",P)===!1?!1:((g=b.onBeforeLayout)==null?void 0:g.call(b))??!0},onLayout:()=>{var o;(o=b.onLayout)==null||o.call(b),h.executeHook("onLayout",P).catch(()=>{})},onLayoutComplete:()=>{var o;be(!1),(o=b.onLayoutComplete)==null||o.call(b),h.executeHook("onLayoutComplete",P).catch(()=>{}),I.current&&(Q(I.current.getLayoutInfo()),ee(I.current.getAllItemPositions()))},onItemMount:(o,g)=>{var S;(S=b.onItemMount)==null||S.call(b,o,g),h.executeHook("onItemMount",P,o,g).catch(()=>{})},onItemUnmount:o=>{var g;(g=b.onItemUnmount)==null||g.call(b,o),h.executeHook("onItemUnmount",P,o).catch(()=>{})},onItemEnterViewport:o=>{var H;(H=b.onItemEnterViewport)==null||H.call(b,o);const g=f.current,S=C.get(o),_=(()=>{if(!g||!S)return{index:o,isVisible:!0,visibleRatio:1,isAboveViewport:!1,isBelowViewport:!1};const V=g.scrollTop,U=V+g.clientHeight,N=S.y,Z=S.y+S.height,q=Math.max(0,Math.min(U,Z)-Math.max(V,N)),$=Math.min(1,Math.max(0,q/S.height));return{index:o,isVisible:q>0,visibleRatio:$,isAboveViewport:Z<=V,isBelowViewport:N>=U}})();h.executeHook("onItemEnterViewport",P,o,_).catch(()=>{})},onItemLeaveViewport:o=>{var H;(H=b.onItemLeaveViewport)==null||H.call(b,o);const g=f.current,S=C.get(o),_=(()=>{if(!g||!S)return{index:o,isVisible:!1,visibleRatio:0,isAboveViewport:!1,isBelowViewport:!1};const V=g.scrollTop,U=V+g.clientHeight,N=S.y,Z=S.y+S.height,q=Math.max(0,Math.min(U,Z)-Math.max(V,N)),$=Math.min(1,Math.max(0,q/S.height));return{index:o,isVisible:q>0,visibleRatio:$,isAboveViewport:Z<=V,isBelowViewport:N>=U}})();h.executeHook("onItemLeaveViewport",P,o,_).catch(()=>{})},onScroll:(o,g)=>{var S;(S=b.onScroll)==null||S.call(b,o,g),h.executeHook("onScroll",P,o,g).catch(()=>{}),f.current&&we(_=>({..._,scrollTop:o,scrollLeft:g,isScrolling:!0}))},onResize:(o,g)=>{var S;(S=b.onResize)==null||S.call(b,o,g),we(_=>({..._,clientWidth:o,clientHeight:g})),h.executeHook("onResize",P,o,g).catch(()=>{})},onReachBottom:async o=>{var g;await((g=b.onReachBottom)==null?void 0:g.call(b,o)),await h.executeHook("onReachBottom",P,o)},onItemClick:(o,g,S)=>{var _;(_=b.onItemClick)==null||_.call(b,o,g,S),h.executeHook("onItemClick",P,o,g,S).catch(()=>{})},renderItem:(o,g)=>{var H,V;let _=(b.renderItem||(U=>null))(o,g);for(const U of t){const N=(V=(H=U.hooks).renderItemWrapper)==null?void 0:V.call(H,P,g,o,_);N!=null&&(_=N)}return _},children:D.jsxs(D.Fragment,{children:[b.children,t.map((o,g)=>{var _,H;const S=(H=(_=o.hooks).renderOverlay)==null?void 0:H.call(_,P);return S?D.jsx(y.Fragment,{children:S},`plugin-overlay-${o.name}-${g}`):null})]})};return y.useImperativeHandle(c,()=>({relayout:()=>{var o;return(o=I.current)==null?void 0:o.relayout()},scrollToItem:(o,g)=>{var S;return(S=I.current)==null?void 0:S.scrollToItem(o,g)},scrollToTop:o=>{var g;return(g=I.current)==null?void 0:g.scrollToTop(o)},scrollToBottom:o=>{var g;return(g=I.current)==null?void 0:g.scrollToBottom(o)},getItemPosition:o=>{var g;return((g=I.current)==null?void 0:g.getItemPosition(o))||null},getAllItemPositions:()=>{var o;return((o=I.current)==null?void 0:o.getAllItemPositions())||new Map},getColumnHeights:()=>{var o;return((o=I.current)==null?void 0:o.getColumnHeights())||[]},getLayoutInfo:()=>{var o;return((o=I.current)==null?void 0:o.getLayoutInfo())||{columns:0,columnWidth:0,gap:0,columnHeights:[],totalHeight:0,containerWidth:0,containerHeight:0}},getViewportInfo:()=>{var o;return((o=I.current)==null?void 0:o.getViewportInfo())||{scrollTop:0,scrollLeft:0,scrollHeight:0,scrollWidth:0,clientHeight:0,clientWidth:0,isScrolling:!1,direction:null}},forceUpdate:()=>{var o;return(o=I.current)==null?void 0:o.forceUpdate()},getContainer:()=>{var o;return((o=I.current)==null?void 0:o.getContainer())||null},getItemElement:o=>{var g;return((g=I.current)==null?void 0:g.getItemElement(o))||null},measureItem:o=>{var g;return((g=I.current)==null?void 0:g.measureItem(o))||Promise.resolve({width:0,height:0})}})),D.jsx(a,{ref:I,...oe})});return s.displayName="WithPlugins(WaterfallCore)",s}function ut(a){const n=(r,t)=>{const i=Object.values(a.breakpoints).sort((l,c)=>l.width-c.width);let s=t;for(const l of i)r>=l.width&&(s=l.columns);return s};return{name:"ResponsiveColumnsPlugin",enabled:!0,hooks:{transformProps:r=>{const t=r.columns??3,i=typeof window<"u"?window.innerWidth:1024,s=n(i,t);return{...r,columns:s}},onResize:(r,t)=>{var i;(i=r.relayout)==null||i.call(r)}}}}function ft(a){const n=r=>{if(!r)return 0;if(typeof r=="number")return r*2;const{left:t=0,right:i=0}=r;return t+i};return{name:"AutoColumnPlugin",enabled:!0,hooks:{transformProps:r=>{const t=typeof window<"u"?window.innerWidth:1024,i=r.columnGap??r.gap??0,s=n(r.padding),l=Math.max(0,t-s),c=Math.max(1,Math.floor((l+i)/(a.minColumnWidth+i))),u=Math.max(1,a.minColumns??1),h=a.maxColumns??Number.POSITIVE_INFINITY,p=Math.min(Math.max(c,u),h);return{...r,columns:p}},onResize:r=>{var t;(t=r.relayout)==null||t.call(r)}}}}function dt(a){return{name:"AlignmentPlugin",enabled:!0,hooks:{transformProps:n=>({...n,alignmentMode:a.mode}),onResize:n=>{var r;(r=n.relayout)==null||r.call(n)}}}}function ht(a){const n=typeof window<"u"?window.innerWidth:1024,r=a.responsive||{};return n>=1200&&r.xl?r.xl:n>=992&&r.lg?r.lg:n>=768&&r.md?r.md:r.sm?r.sm:{}}function gt(a){return{name:"GapPlugin",enabled:!0,hooks:{transformProps:n=>{const r={columnGap:a.columnGap,rowGap:a.rowGap},t=ht(a),i={columnGap:t.columnGap??r.columnGap??n.columnGap,rowGap:t.rowGap??r.rowGap??n.rowGap};return{...n,...i}},onResize:n=>{var r;(r=n.relayout)==null||r.call(n)}}}}function mt(a){return{name:"FixedHeightPlugin",enabled:!0,hooks:{transformProps:n=>{const{itemHeight:r}=a,t=(n.items||[]).map(i=>typeof i=="object"&&i!==null&&"height"in i?{...i,height:r}:i);return{...n,items:t}},onResize:n=>{var r;(r=n.relayout)==null||r.call(n)}}}}function vt(a){let n=null;function r({context:t}){var Se,he,te,X,fe,Ee;const i=t.items||[],s=Math.max(1,((Se=t.layout)==null?void 0:Se.columns)||3),l=Number(((he=t.layout)==null?void 0:he.gap)||0),c=((te=t.getContainer)==null?void 0:te.call(t))||null,u=Number(((X=t.layout)==null?void 0:X.columnWidth)||0),h=u>0?u:c?(c.clientWidth-l*(s-1))/s:0,p=a.overscanPx??300,m=a.getItemHeight,f=!!a.dynamicHeights,w=Math.max(0,Number(a.estimateItemHeight??200)),k=y.useRef(new Map),I=y.useRef(new Map),ue=y.useRef(new Map),Q=y.useRef(!1),C=y.useRef(null),ee=y.useRef(new Map),ye=y.useRef([]),[we,Re]=y.useState(0);y.useEffect(()=>()=>{I.current.forEach(J=>{try{J.disconnect()}catch{}}),I.current.clear(),k.current.clear(),ue.current.clear()},[]);const re=y.useMemo(()=>{const J=Array.from({length:s},()=>({indices:[],sizes:[],ys:[],height:0})),P=Array.from({length:s},()=>0),W=ye.current,ge=W.length!==i.length;for(let F=0;F<i.length;F++){const b=k.current.get(F),oe=(f?b??void 0:void 0)??(m?m(i[F],F):void 0)??w,o=Math.max(0,Number(oe)||0);let g;if(ge||W[F]===void 0){g=0;let _=P[0];for(let H=1;H<s;H++)P[H]<_&&(_=P[H],g=H);W[F]=g}else g=W[F];const S=P[g];J[g].indices.push(F),J[g].sizes.push(o),J[g].ys.push(S),P[g]+=o+l}for(let F=0;F<s;F++)J[F].height=P[F];return J},[i,s,l,m,f,w,we]),Te=y.useMemo(()=>re.reduce((J,P)=>Math.max(J,P.height),0),[re]),be=Number(((fe=t.viewport)==null?void 0:fe.scrollTop)||0),pe=be+Number(((Ee=t.viewport)==null?void 0:Ee.clientHeight)||0);if(h<=0){const J=Math.ceil(i.length/s),P=Math.max(0,J*(w+l));return D.jsx("div",{style:{position:"relative",inset:0},children:D.jsx("div",{style:{height:P,pointerEvents:"none"}})})}return D.jsxs("div",{style:{position:"relative",inset:0},children:[D.jsx("div",{style:{height:Te,pointerEvents:"none"}}),D.jsx("div",{style:{position:"absolute",inset:0},children:Array.from({length:s}).map((J,P)=>D.jsx("div",{style:{position:"absolute",left:P*(h+l),top:0,width:h,height:Te},children:re[P].indices.map((W,ge)=>{const F=re[P].ys[ge],b=re[P].sizes[ge];if(!(F+b>be-p&&F<pe+p))return null;const g=i[W],S=n?n(g,W):D.jsx("div",{style:{height:b,boxSizing:"border-box",background:"#fff",borderBottom:"1px solid #f0f0f0"}}),_=H=>{const V=ue.current.get(W)||null;if(V===H)return;const U=I.current.get(W);if(U&&V&&V!==H){try{U.disconnect()}catch{}I.current.delete(W)}if(ue.current.set(W,H),!H||!f)return;const N=new ResizeObserver(()=>{const Z=H.offsetHeight||0,q=k.current.get(W)||0;if(Z>0&&Math.abs(Z-q)>.5)k.current.set(W,Z),ee.current.set(W,0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>{Re($=>$+1),C.current=null,Q.current=!1},50);else{const $=(ee.current.get(W)||0)+1;if(ee.current.set(W,$),$>=2){try{N.disconnect()}catch{}I.current.delete(W)}}});try{N.observe(H),I.current.set(W,N)}catch{}};return D.jsx("div",{ref:_,style:{position:"absolute",top:F,left:0,width:"100%",height:f?void 0:b},children:S},W)})},P))})]})}return{name:"VirtualWaterfallPlugin",enabled:!0,hooks:{transformProps:t=>(n=t.renderItem,{...t,renderItem:()=>null}),renderOverlay:t=>D.jsx(r,{context:t})}}}function yt(a){return{name:"ThrottlePlugin",enabled:!0,hooks:{transformProps:n=>({...n,throttleDelay:a.scroll,debounceDelay:a.resize??n.debounceDelay})}}}function bt(a){return{name:"DebounceLayoutPlugin",enabled:!0,hooks:{transformProps:n=>({...n,debounceDelay:a.delay})}}}function pt(a){const n=new Set,r=()=>{if(n.size<=a.poolSize)return;const t=n.values().next().value;typeof t=="number"&&n.delete(t)};return{name:"RecyclePlugin",enabled:!0,hooks:{onItemEnterViewport:(t,i)=>{const s=t.getItemRef(i);s&&(s.style.visibility="visible"),n.add(i),r()},onItemLeaveViewport:(t,i)=>{const s=t.getItemRef(i);s&&(s.style.visibility="hidden"),n.delete(i)},onItemUnmount:(t,i)=>{n.delete(i)},onUnmount:()=>{n.clear()}}}}function wt(a={}){return{name:"InfiniteScrollPlugin",enabled:!0,hooks:{transformProps:n=>{const r=n.onReachBottom,t=Math.max(0,Number(a.threshold??0)),i=a.onLoadMore??n.onLoadMore;return{...n,onReachBottom:async s=>{typeof r=="function"&&await Promise.resolve(r(s)),s<=t&&typeof i=="function"&&await Promise.resolve(i())}}}}}}function Rt(a={}){return{name:"PaginationPlugin",enabled:!0,hooks:{transformProps:n=>{const r=Math.max(1,Number(n.pageIndex??1)),t=Math.max(1,Number(n.pageSize??a.pageSize??20)),i=Array.isArray(n.items)?n.items:[],s=(r-1)*t,l=s+t,c=i.slice(s,l);return{...n,items:c}},onPropsChange:(n,r,t)=>{var u;const i=Math.max(1,Number((r==null?void 0:r.pageIndex)??1)),s=Math.max(1,Number((t==null?void 0:t.pageIndex)??1));if(((typeof(t==null?void 0:t.scrollToTopOnPageChange)=="boolean"?t.scrollToTopOnPageChange:void 0)??!!a.scrollToTop)&&i!==s){const h=(t==null?void 0:t.scrollToTopBehavior)??a.scrollBehavior??"auto";(u=n.scrollToTop)==null||u.call(n,{behavior:h})}}}}}function Tt(a={}){return{name:"FilterPlugin",enabled:!0,hooks:{transformProps:n=>{const r=Array.isArray(n.items)?n.items:[],t=n.filterFn||a.predicate;if(typeof t!="function")return n;const i=r.filter((s,l)=>{try{return!!t(s,l)}catch{return!0}});return{...n,items:i}},onPropsChange:(n,r,t)=>{var u;const i=r==null?void 0:r.filterFn,s=t==null?void 0:t.filterFn;if(((typeof(t==null?void 0:t.scrollToTopOnFilterChange)=="boolean"?t.scrollToTopOnFilterChange:void 0)??!!a.scrollToTop)&&i!==s){const h=(t==null?void 0:t.scrollToTopBehavior)??a.scrollBehavior??"auto";(u=n.scrollToTop)==null||u.call(n,{behavior:h})}}}}}function St(a={}){return{name:"SortPlugin",enabled:!0,hooks:{transformProps:n=>{const r=Array.isArray(n.items)?n.items:[],t=n.sortComparator||a.comparator;if(typeof t!="function")return n;const i=[...r].sort((s,l)=>{try{return t(s,l)}catch{return 0}});return{...n,items:i}},onPropsChange:(n,r,t)=>{var u;const i=r==null?void 0:r.sortComparator,s=t==null?void 0:t.sortComparator;if(((typeof(t==null?void 0:t.scrollToTopOnSortChange)=="boolean"?t.scrollToTopOnSortChange:void 0)??!!a.scrollToTop)&&i!==s){const h=(t==null?void 0:t.scrollToTopBehavior)??a.scrollBehavior??"auto";(u=n.scrollToTop)==null||u.call(n,{behavior:h})}}}}}function Et(a={}){const n=a.fields??[];return{name:"SearchPlugin",enabled:!0,hooks:{transformProps:r=>{const t=String(r.searchQuery??"").trim(),i=Array.isArray(r.items)?r.items:[];if(!t)return r;const s=t.toLowerCase(),l=i.filter(c=>{if(typeof c!="object"||c===null)return!1;const u=n.length>0?n:Object.keys(c);for(const h of u){const p=c[h];if(p!=null&&String(p).toLowerCase().includes(s))return!0}return!1});return{...r,items:l}},onPropsChange:(r,t,i)=>{var h;const s=String((t==null?void 0:t.searchQuery)??""),l=String((i==null?void 0:i.searchQuery)??"");if(((typeof(i==null?void 0:i.scrollToTopOnSearchChange)=="boolean"?i.scrollToTopOnSearchChange:void 0)??!!a.scrollToTop)&&s!==l){const p=(i==null?void 0:i.scrollToTopBehavior)??a.scrollBehavior??"auto";(h=r.scrollToTop)==null||h.call(r,{behavior:p})}}}}}function It(a={}){const{log:n=!0}=a;return{name:"ClickAnalyticsPlugin",enabled:!0,hooks:{onMount:r=>{var t;(t=r.sharedData)==null||t.set("click-count",0)},onItemClick:(r,t,i,s)=>{var u,h,p;const c=(((u=r.sharedData)==null?void 0:u.get("click-count"))||0)+1;(h=r.sharedData)==null||h.set("click-count",c),(p=r.bus)==null||p.emit("analytics:click",{index:t,item:i,event:s,total:c})},renderOverlay:r=>{var i;const t=((i=r.sharedData)==null?void 0:i.get("click-count"))||0;return D.jsxs("div",{style:{position:"absolute",top:12,right:12,padding:"10px 12px",background:"#222",color:"#fff",borderRadius:8,fontSize:14,fontWeight:600,boxShadow:"0 4px 12px rgba(0,0,0,0.25)",border:"1px solid rgba(255,255,255,0.15)",pointerEvents:"none",zIndex:99},children:["点击次数:",t,D.jsx("div",{style:{fontSize:12,fontWeight:400,opacity:.85,marginTop:4},children:"提示:点击任意卡片观察计数变化"})]})}}}}function kt(a={}){const n=a.storageKey||"waterfall-bookmark",r=a.scrollBehavior||"smooth",t=i=>{var u;const s=i;if(!s)return!1;const l=(u=s.tagName)==null?void 0:u.toLowerCase(),c=(s.getAttribute&&s.getAttribute("contenteditable"))==="true";return l==="input"||l==="textarea"||c};return{name:"BookmarkPlugin",enabled:!0,hooks:{onMount:i=>{const s=l=>{var h,p;if(t(l.target))return;const c=(l.key||"").toLowerCase(),u=l.code||"";if(c==="b"||u==="KeyB"){const m=((h=i.containerRef)==null?void 0:h.current)||null;let f=0;m&&m.scrollHeight>m.clientHeight?f=m.scrollTop:f=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;try{localStorage.setItem(n,String(Math.max(0,f)))}catch{}}else if(c==="r"||u==="KeyR"){let m=0;try{const w=localStorage.getItem(n)||"0";m=Math.max(0,Number(w)||0)}catch{}const f=((p=i.containerRef)==null?void 0:p.current)||null;f&&f.scrollHeight>f.clientHeight?f.scrollTo({top:m,behavior:r}):window.scrollTo({top:m,behavior:r})}};return window.addEventListener("keydown",s,{capture:!0}),document.addEventListener("keydown",s,{capture:!0}),()=>{window.removeEventListener("keydown",s,{capture:!0}),document.removeEventListener("keydown",s,{capture:!0})}}}}}function Ct(a={}){const n=a.mode||"hash",r=a.keys||["pageIndex","pageSize","searchQuery"];function t(){try{if(n==="hash"){const s=window.location.hash||"",l=s.indexOf("?"),c=l>=0?s.slice(l+1):s.replace(/^#/,""),u=new URLSearchParams(c),h={};return r.forEach(p=>{const m=u.get(p);m!==null&&(h[p]=m)}),h}else{const s=new URLSearchParams(window.location.search),l={};return r.forEach(c=>{const u=s.get(c);u!==null&&(l[c]=u)}),l}}catch{return{}}}function i(s){try{const l=new URLSearchParams;r.forEach(u=>{const h=s[u];h!=null&&String(h).length>0&&l.set(u,String(h))});const c=l.toString();if(n==="hash"){const u=window.location.hash||"",m=`#${u.replace(/^#/,"").split("?")[0]||""}${c?`?${c}`:""}`;u!==m&&history.replaceState(null,"",`${window.location.pathname}${window.location.search}${m}`)}else{const h=window.location.pathname+(c?`?${c}`:"")+(window.location.hash||"");history.replaceState(null,"",h)}}catch{}}return{name:"URLSyncPlugin",enabled:!0,hooks:{onMount:s=>{var c;const l=t();(c=s.bus)==null||c.emit("urlsync:init",l)},onPropsChange:(s,l,c)=>{const u={};r.forEach(h=>{const p=c==null?void 0:c[h];p!==void 0&&(u[h]=p)}),i(u)}}}}function Pt(a={}){const n=a.containerRole??"list",r=a.itemRole??"listitem",t=a.enableTabIndex??!0;return{name:"A11yPlugin",enabled:!0,hooks:{renderOverlay:i=>{const s=i.containerRef.current;return s&&(s.setAttribute("role",n),s.setAttribute("aria-label","Waterfall list")),null},renderItemWrapper:(i,s,l)=>D.jsx("div",{role:r,"aria-posinset":typeof l=="number"?l+1:void 0,"aria-setsize":i.itemCount,tabIndex:t?0:void 0,style:{outline:"none"},children:s})}}}function Mt(a={}){const n=typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null,r=(n==null?void 0:n.matches)??!1,t=a.disableTransform??!0,i=a.removeTransitions??!0;return{name:"ReducedMotionPlugin",enabled:!0,hooks:{transformProps:s=>{if(!r)return s;const l={...s};return t&&(l.useTransform=!1),i&&(l.itemStyle={...s.itemStyle??{},transition:"none"}),l}}}}function _t(a={}){const n=a.duration??300,r=a.easing??"ease";return{name:"TransitionPlugin",enabled:!0,hooks:{onItemMount:(t,i,s)=>{s.style.transition=`transform ${n}ms ${r}, opacity ${n}ms ${r}`},onLayout:t=>{t.itemRefs.forEach(i=>{i&&(i.style.transition=`transform ${n}ms ${r}, opacity ${n}ms ${r}`)})}}}}function Ht(a){const n=a.column??0,r=new Set(a.pinnedIndices);let t=0;return{name:"PinItemPlugin",enabled:!0,hooks:{onBeforeLayout:()=>(t=0,!0),calculateItemPosition:(i,s,l)=>{if(!r.has(s))return;const{columnWidth:c,gap:u}=i.layout;return{x:n*(c+u),y:t,width:c,height:l,column:n,row:0}},renderOverlay:()=>null}}}function Ot(a={}){const n=a.showOverlay??a.showOverlaySummary??!0,r=new Map,t=new Map;let i=!1;return{name:"HeatmapAnalyticsPlugin",enabled:!0,hooks:{onLayoutComplete:s=>{if(i)return;const{start:l,end:c}=s.visibleRange;for(let u=l;u<=c;u++)r.set(u,(r.get(u)||0)+1);i=!0},onItemEnterViewport:(s,l)=>{r.set(l,(r.get(l)||0)+1)},onItemClick:(s,l)=>{t.set(l,(t.get(l)||0)+1)},renderOverlay:()=>{if(!n)return null;const s=Array.from(r.values()).reduce((c,u)=>c+u,0),l=Array.from(t.values()).reduce((c,u)=>c+u,0);return D.jsxs("div",{style:{position:"sticky",top:0,zIndex:100,display:"flex",gap:12,alignItems:"center",padding:"6px 10px",background:"rgba(0,0,0,0.6)",color:"white",borderRadius:8,fontSize:12,marginBottom:8},children:[D.jsxs("span",{children:["曝光总计: ",s]}),D.jsxs("span",{children:["点击总计: ",l]})]})}}}}function At(a={}){const n=a.storageKey||"waterfall-state",r=a.persistScroll??!0,t=a.persistKeys||["pageIndex","pageSize","searchQuery"];let i=!1;function s(){try{const c=localStorage.getItem(n);return c?JSON.parse(c):null}catch{return null}}function l(c){try{localStorage.setItem(n,JSON.stringify(c))}catch{}}return{name:"StatePersistencePlugin",enabled:!0,hooks:{transformProps:c=>{if(i)return c;const u=s();if(!u)return c;const h={...c};let p=!1;return t.forEach(m=>{u[m]!==void 0&&(h[m]=u[m],p=!0)}),p&&(i=!0),h},onMount:c=>{var p,m;const u=s();if(!u)return;if(r){const f=Number(u.scrollTop??0),w=c.containerRef.current;w?w.scrollTo({top:f,behavior:"auto"}):(p=c.scrollToTop)==null||p.call(c,{behavior:"auto"})}const h={};if(t.forEach(f=>{u[f]!==void 0&&(h[f]=u[f])}),Object.keys(h).length>0&&((m=c.bus)==null||m.emit("state:restored",h),typeof window<"u"))try{window.dispatchEvent(new CustomEvent("waterfall:state-restored",{detail:h}))}catch{}},onPropsChange:(c,u,h)=>{const m={...s()||{}};t.forEach(f=>{const w=h==null?void 0:h[f];w!==void 0&&(m[f]=w)}),l(m)},onUnmount:c=>{var h;const u={};r&&(u.scrollTop=((h=c.containerRef.current)==null?void 0:h.scrollTop)||0),t.forEach(p=>{var f;const m=(f=c.props)==null?void 0:f[p];m!==void 0&&(u[p]=m)}),l(u)}}}}function jt(a={}){const n=a.groupBy||(t=>(t==null?void 0:t.category)??"default"),r="GROUPS";return{name:"GroupingPlugin",enabled:!0,hooks:{onPropsChange:(t,i,s)=>{var u;const l=s.items||[],c=new Map;l.forEach((h,p)=>{const m=n(h,p);c.has(m)||c.set(m,[]),c.get(m).push(p)}),(u=t.sharedData)==null||u.set(r,c)},renderOverlay:t=>{var l;const i=((l=t.sharedData)==null?void 0:l.get(r))||new Map;if(i.size===0)return null;const s=Array.from(i.entries()).slice(0,3);return D.jsxs("div",{style:{position:"absolute",top:12,left:12,zIndex:99,background:"#111827",color:"#fff",padding:"10px",borderRadius:8,boxShadow:"0 4px 12px rgba(0,0,0,0.25)",border:"1px solid rgba(255,255,255,0.15)",minWidth:160,fontSize:12},children:[D.jsxs("div",{style:{opacity:.85,marginBottom:6},children:["分组统计:",i.size," 组"]}),s.map(([c,u])=>D.jsxs("div",{children:[String(c),":",u.length," 项"]},String(c)))]})}}}}function Lt(a={}){const n=a.title||"分组标题";return{name:"StickyHeaderPlugin",enabled:!0,hooks:{renderOverlay:r=>{var s;const t=((s=r.sharedData)==null?void 0:s.get("GROUPS"))||new Map,i=t.size>0?Array.from(t.keys())[0]:void 0;return D.jsxs("div",{style:{position:"sticky",top:0,zIndex:20,background:"#111827",color:"#fff",borderBottom:"1px solid rgba(255,255,255,0.15)",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"10px 14px",fontSize:15,fontWeight:600},children:[n," ",i!==void 0?`:${String(i)}`:"",D.jsx("span",{style:{marginLeft:8,fontSize:12,opacity:.8},children:"提示:向下滚动观察吸顶条"})]})}}}}function Dt(a={}){const n=a.getAnchorId||(t=>t==null?void 0:t.id);let r;return{name:"ScrollAnchorPlugin",enabled:!0,hooks:{onMount:t=>{var i;r=(i=t.bus)==null?void 0:i.on("anchor:scrollToId",s=>{var u,h;const c=(((u=t.props)==null?void 0:u.items)||[]).findIndex((p,m)=>n(p,m)===s.id);c>=0&&((h=t.scrollToItem)==null||h.call(t,c,{behavior:"smooth",block:"start"}))})},onUnmount:()=>r==null?void 0:r()}}}function Wt(a={}){const n=a.enabled??!0;return{name:"DragReorderPlugin",enabled:n,hooks:{renderItemWrapper:(r,t,i,s)=>{const l=n,c=p=>{var m;p.dataTransfer.setData("text/plain",String(t)),(m=r.sharedData)==null||m.set("drag-from",t)},u=p=>{p.preventDefault()},h=p=>{var w,k;const m=Number(p.dataTransfer.getData("text/plain")),f=t;if((w=r.sharedData)==null||w.set("drag-to",f),(k=r.bus)==null||k.emit("drag:reorder",{from:m,to:f}),typeof window<"u")try{window.dispatchEvent(new CustomEvent("waterfall:drag-reorder",{detail:{from:m,to:f}}))}catch{}};return D.jsx("div",{draggable:l,onDragStart:c,onDragOver:u,onDrop:h,style:{cursor:l?"grab":"default",border:"1px dashed #bdbdbd",borderRadius:6},children:s})}}}}M.WaterfallCore=it,M.createA11yPlugin=Pt,M.createAlignmentPlugin=dt,M.createAutoColumnPlugin=ft,M.createBookmarkPlugin=kt,M.createClickAnalyticsPlugin=It,M.createDebounceLayoutPlugin=bt,M.createDragReorderPlugin=Wt,M.createFilterPlugin=Tt,M.createFixedHeightPlugin=mt,M.createGapPlugin=gt,M.createGroupingPlugin=jt,M.createHeatmapAnalyticsPlugin=Ot,M.createInfiniteScrollPlugin=wt,M.createPaginationPlugin=Rt,M.createPinItemPlugin=Ht,M.createPluginBus=qe,M.createPluginManager=$e,M.createRecyclePlugin=pt,M.createReducedMotionPlugin=Mt,M.createResponsiveColumnsPlugin=ut,M.createScrollAnchorPlugin=Dt,M.createSearchPlugin=Et,M.createSortPlugin=St,M.createStatePersistencePlugin=At,M.createStickyHeaderPlugin=Lt,M.createThrottlePlugin=yt,M.createTransitionPlugin=_t,M.createURLSyncPlugin=Ct,M.createVirtualWaterfallPlugin=vt,M.withPlugins=ct,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "vane-waterfall",
3
+ "version": "1.0.1",
4
+ "description": "vane-waterfall",
5
+ "type": "module",
6
+ "main": "dist/index.umd.js",
7
+ "module": "dist/index.es.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.es.js",
12
+ "require": "./dist/index.umd.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./plugins": {
16
+ "types": "./dist/plugins/index.d.ts",
17
+ "import": "./dist/plugins/index.js"
18
+ },
19
+ "./custom-plugins/*": {
20
+ "types": "./dist/custom-plugins/*/index.d.ts",
21
+ "import": "./dist/custom-plugins/*/index.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "sideEffects": false,
28
+ "keywords": [
29
+ "react",
30
+ "web-worker",
31
+ "virtual-scroll",
32
+ "performance",
33
+ "typescript"
34
+ ],
35
+ "author": "vane",
36
+ "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/frankvane/vane-waterfall.git"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/frankvane/vane-waterfall/issues"
43
+ },
44
+ "homepage": "https://github.com/frankvane/vane-waterfall#readme",
45
+ "scripts": {
46
+ "dev": "vite",
47
+ "build": "tsc -b && vite build --mode lib",
48
+ "build:demo": "vite build",
49
+ "preview": "vite preview",
50
+ "preview:demo": "vite preview --outDir vane-waterfall",
51
+ "lint": "eslint .",
52
+ "prepublishOnly": "npm run build"
53
+ },
54
+ "dependencies": {
55
+ "localforage": "^1.10.0",
56
+ "react": "^18.3.1",
57
+ "react-dom": "^18.3.1",
58
+ "react-markdown": "^10.1.0",
59
+ "react-router-dom": "^7.9.3",
60
+ "react-syntax-highlighter": "^15.6.6",
61
+ "remark-gfm": "^4.0.1",
62
+ "vane-lazy-image": "^1.0.14"
63
+ },
64
+ "devDependencies": {
65
+ "@eslint/js": "^9.9.0",
66
+ "@types/node": "^20.19.18",
67
+ "@types/react": "^18.3.3",
68
+ "@types/react-dom": "^18.3.0",
69
+ "@types/react-syntax-highlighter": "^15.5.13",
70
+ "@vitejs/plugin-react": "^4.3.1",
71
+ "eslint": "^9.9.0",
72
+ "eslint-plugin-react-hooks": "^5.1.0-rc.0",
73
+ "eslint-plugin-react-refresh": "^0.4.9",
74
+ "globals": "^15.9.0",
75
+ "react-window": "^2.2.0",
76
+ "terser": "^5.44.0",
77
+ "typescript": "^5.5.3",
78
+ "typescript-eslint": "^8.0.1",
79
+ "vite": "^5.4.1",
80
+ "vite-plugin-dts": "^4.5.4"
81
+ }
82
+ }