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

nft-collection-gallery

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nft-collection-gallery - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

2

dist/CollectionGallery.min.js

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).CollectionGallery=t(e.React)}(this,function(R){"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=e(R);function r(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){m(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function g(e,t,n){return(g=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),1}catch(e){}}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);t=new(Function.bind.apply(e,r));return n&&o(t,n.prototype),t}).apply(null,arguments)}function j(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};for(var n,r={},o=Object.keys(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}}(e,t)||n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){var n;if(e)return"string"==typeof e?a(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const t="undefined"!=typeof crypto?crypto:{},F="function"==typeof t.randomBytes?e=>Uint8Array.from(t.randomBytes(e)):"function"==typeof t.getRandomValues?e=>t.getRandomValues(new Uint8Array(e)):e=>Uint8Array.from(Array(e),()=>256*Math.random());class W{static of(...e){return new(Function.prototype.bind.apply(this,[null].concat(e)))}static from(e){return new(Function.prototype.bind.apply(this,[null].concat(e)))}[Symbol.iterator](){return function*(t,n){for(let e=0n;e<n;e++)yield t.at(e)}(this,this.length)}toArray(){return[...this]}get isBig(){return Number.MAX_SAFE_INTEGER<this.length}get isSafe(){return"undefined"!=typeof BigInt||!this.isBig}_check(e){if(e<0){if(this.length<-e)throw new RangeError(e+" is out of range");return BigInt(this.length)+BigInt(e)}if(this.length<=e)throw new RangeError(e+" is out of range");return e}at(e){}nth(e){return this.at(e)}sample(){return this.at(function(e=0,t=Math.pow(2,53)){let n=e.constructor;if(0===arguments.length)return Math.floor(Math.random()*n(t));if(1==arguments.length&&([e,t]=[n(0),e]),"number"==typeof e)return[e,t]=[Math.ceil(Number(e)),Math.ceil(Number(t))],Math.floor(Math.random()*(t-e))+e;const r=n(t)-n(e),o=(t=r.toString(16).length,F(t));var i=o.reduce((e,t)=>(e<<n(8))+n(t),n(0));return(n(i)*r>>n(8*t))+n(e)}(this.length))}samples(){return function*(e){for(;;)yield e.sample()}(this)}}class D extends W{constructor(...e){super(),this.seed=e.map(e=>[...e]),this.size=this.seed.length;e=this.seed.reduce((e,t)=>e*BigInt(t.length),1n);this.length=e,Object.freeze(this)}at(e){if(void 0!==(e=this._check(e))){let t=BigInt(e),n=[];for(let e=0;e<this.size;e++){var r=this.seed[e].length,r=BigInt(r),o=t%r;n.push(this.seed[e][Number(o)]),t=(t-o)/r}return n}}}function l(e){function t(e){var t;return!e||0===(e=Object.entries(e).filter(function(e){e=v(e,2);return e[0],e[1]}).flatMap(function(e){return v(e,1)[0]})).length?o:(e=Object.values(e.reduce(function(e,t){var n=t.split(":")[0],r=e[n]||[];return r.push(t),e[n]=r,e},{})),t=y(g(D,e)),o.filter(function(e){var n=e.attributes.map(function(e){return n=(t=e).trait_type,t=e.value,"".concat(n,":").concat(t);var t,n});return t.find(function(e){return t=n,e.every(function(e){return t.includes(e)});var t})}))}var n=e.children,o=e.tokens,r=e.onFilterChange,i=(e=v(R.useState([]),2))[0],a=e[1],l=(e=v(R.useState({}),2))[0],s=e[1],c=(e=v(R.useState({}),2))[0],u=e[1],d=(e=v(R.useState({}),2))[0],f=e[1],e=(R.useEffect(function(){var n,r;s((n={},o.forEach(function(e){e.attributes.forEach(function(e){var t=e.trait_type,e=e.value;n[t]||(n[t]=new Set),n[t].add(e)})}),Object.entries(n).forEach(function(e){var e=v(e,2),t=e[0],e=e[1];n[t]=y(e)}),n)),u((r={},o.forEach(function(n){n.attributes.forEach(function(e){var t=e.trait_type,e=e.value,t="".concat(t,":").concat(e);r[t]?r[t].push(n):r[t]=[n]})}),r)),f(Object.keys(c).reduce(function(e,t){return p(p({},e),{},m({},t,!1))},{}))},[o]),R.useEffect(function(){r&&r(d),a(t(d))},[d]),{variationNamesByTraitName:l,tokensByVariationName:c,selectedFilters:d,setSelectedFilters:f,removeFilter:function(e){f(p(p({},d),{},m({},e,!1)))},tokens:o,filteredTokens:i});return h.default.createElement(_.Provider,{value:e},n)}function H(e){return e=e.TraitFilterContextConsumer,h.default.createElement("ul",{style:s.wrapper},h.default.createElement(e,null,function(e){var t=e.selectedFilters,n=e.removeFilter;return Object.entries(t).filter(function(e){e=v(e,2);return e[0],e[1]}).map(function(e){e=v(e,1)[0];return h.default.createElement(G,{key:e,name:e,onClick:n})})}))}function B(e){function n(e,t){return"".concat(e,":").concat(t)}var r=e.traitName,t=e.variationNames,o=e.getCount,i=e.onChange,a=e.isChecked,l={traitHeader:{paddingTop:"1.25rem",paddingBottom:"0.75rem",textAlign:"left"},variationNames:{textAlign:"left"},variationName:{display:"flex",flexGrow:1,justifyContent:"space-between"}};return h.default.createElement("div",null,h.default.createElement("div",{style:l.traitHeader},r),h.default.createElement("div",{style:l.variationNames},(t||[]).sort(function(e,t){return o(n(r,t))-o(n(r,e))}).map(function(e){var t=n(r,e);return h.default.createElement("label",{key:t,style:l.variationName,name:t},h.default.createElement("div",null,h.default.createElement("input",{name:t,type:"checkbox",checked:a(t)||!1,onChange:i,style:{marginRight:"0.5rem"}}),h.default.createElement("span",null,e)),h.default.createElement("span",null,o(t)))})))}function V(e){return e=e.TraitFilterContextConsumer,h.default.createElement(e,null,function(e){var t=e.variationNamesByTraitName,n=e.tokensByVariationName,r=e.selectedFilters,o=e.setSelectedFilters;return h.default.createElement(X,{variationNamesByTraitName:t,getCount:function(e){return n[e].length},onChange:function(e){var e=e.target,t=e.name,e=e.checked;o(p(p({},r),{},m({},t,e)))},isChecked:function(e){return r[e]}})})}function U(e){var t=e.TraitFilterContextConsumer,n=e.FiltersLayout,r=e.TokensLayout,e=e.CurrentFiltersLayout;return h.default.createElement("div",{style:c.wrapper},h.default.createElement("div",{style:c.content},h.default.createElement("div",{style:c.leftColumn},h.default.createElement(n,null)),h.default.createElement("div",{style:c.rightColumn},h.default.createElement("div",{style:c.supplyCount},h.default.createElement(t,null,function(e){var t=e.tokens,e=e.filteredTokens;return"".concat(e.length,"/").concat(t.length)})),h.default.createElement(e,null),h.default.createElement(r,null))))}var _=R.createContext({}),q=(l.defaultProps={tokens:[]},_.Consumer),s={wrapper:{display:"flex",flexWrap:"wrap",listStyle:"none",padding:"0.5rem",margin:0},filter:{border:"1px solid grey",borderRadius:2,padding:"0.5rem",marginRight:"0.5rem",cursor:"pointer"}},G=function(e){var t=e.name,n=e.onClick;return h.default.createElement("li",{style:s.filter,onClick:function(){return n(t)}},t.split(":").join(" - "))},K=["variationNamesByTraitName"],X=function(e){var t=e.variationNamesByTraitName,n=j(e,K);return Object.entries(t).sort(function(e,t){return e[0].localeCompare(t[0])}).map(function(e){var e=v(e,2),t=e[0],e=e[1];return h.default.createElement(B,i({key:t,traitName:t,variationNames:e},n))})},c={wrapper:{position:"fixed",top:0,bottom:0,left:0,right:0,zIndex:999,padding:"1rem",backgroundColor:"#1E1E1E"},content:{display:"flex",flexDirecetion:"row",height:"100%"},leftColumn:{minWidth:300,width:300,paddingRight:"1rem",display:"flex",flexDirection:"column",overflowY:"auto"},rightColumn:{flexGrow:1,display:"flex",flexDirection:"column"},supplyCount:{fontSize:"2.5rem",textAlign:"right"}},Y=function(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e};function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}var $=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},J=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var n=t,r=[],o=!0,t=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(o=(a=l.next()).done)&&(r.push(a.value),!n||r.length!==n);o=!0);}catch(e){t=!0,i=e}finally{try{!o&&l.return&&l.return()}finally{if(t)throw i}}return r}throw new TypeError("Invalid attempt to destructure non-iterable instance")},w=void 0,w="undefined"!=typeof window?window:"undefined"!=typeof self?self:global,b=null,Q=null,f=w.clearTimeout,S=w.setTimeout,C=w.cancelAnimationFrame||w.mozCancelAnimationFrame||w.webkitCancelAnimationFrame,E=w.requestAnimationFrame||w.mozRequestAnimationFrame||w.webkitRequestAnimationFrame;function Z(l){var s=void 0,c=void 0,u=void 0,d=void 0,f=void 0,h=void 0,p="undefined"!=typeof document&&document.attachEvent;if(!p){var f=function(e){var e=e.__resizeTriggers__,t=e.firstElementChild,e=e.lastElementChild,n=t.firstElementChild;e.scrollLeft=e.scrollWidth,e.scrollTop=e.scrollHeight,n.style.width=t.offsetWidth+1+"px",n.style.height=t.offsetHeight+1+"px",t.scrollLeft=t.scrollWidth,t.scrollTop=t.scrollHeight},e=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},h=function(t){var n;t.target.className&&"function"==typeof t.target.className.indexOf&&t.target.className.indexOf("contract-trigger")<0&&t.target.className.indexOf("expand-trigger")<0||(f(n=this),this.__resizeRAF__&&b(this.__resizeRAF__),this.__resizeRAF__=Q(function(){e(n)&&(n.__resizeLast__.width=n.offsetWidth,n.__resizeLast__.height=n.offsetHeight,n.__resizeListeners__.forEach(function(e){e.call(n,t)}))}))},t=!1,n="",u="animationstart",r="Webkit Moz O ms".split(" "),o="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),i=document.createElement("fakeelement");if(!1===(t=void 0!==i.style.animationName?!0:t))for(var a=0;a<r.length;a++)if(void 0!==i.style[r[a]+"AnimationName"]){n="-"+r[a].toLowerCase()+"-",u=o[a],t=!0;break}s="@"+n+"keyframes "+(c="resizeanim")+" { from { opacity: 0; } to { opacity: 0; } } ",d=n+"animation: 1ms "+c+"; "}return{addResizeListener:function(t,e){var n,r,o,i,a;p?t.attachEvent("onresize",e):(t.__resizeTriggers__||(n=t.ownerDocument,(r=w.getComputedStyle(t))&&"static"===r.position&&(t.style.position="relative"),(r=n).getElementById("detectElementResize")||(o=(s||"")+".resize-triggers { "+(d||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=r.head||r.getElementsByTagName("head")[0],(a=r.createElement("style")).id="detectElementResize",a.type="text/css",null!=l&&a.setAttribute("nonce",l),a.styleSheet?a.styleSheet.cssText=o:a.appendChild(r.createTextNode(o)),i.appendChild(a)),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=n.createElement("div")).className="resize-triggers",(r=n.createElement("div")).className="expand-trigger",r.appendChild(n.createElement("div")),(o=n.createElement("div")).className="contract-trigger",t.__resizeTriggers__.appendChild(r),t.__resizeTriggers__.appendChild(o),t.appendChild(t.__resizeTriggers__),f(t),t.addEventListener("scroll",h,!0),u&&(t.__resizeTriggers__.__animationListener__=function(e){e.animationName===c&&f(t)},t.__resizeTriggers__.addEventListener(u,t.__resizeTriggers__.__animationListener__))),t.__resizeListeners__.push(e))},removeResizeListener:function(e,t){if(p)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",h,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(u,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}var Q=null==C||null==E?(b=f,function(e){return S(e,20)}):(b=function(e){var e=J(e,2),t=e[0],e=e[1];C(t),f(e)},function(e){var t=E(function(){f(n),e()}),n=S(function(){C(t),e()},20);return[t,n]}),x=function(e){var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);function i(){var c,e=this,t=i;if(!(e instanceof t))throw new TypeError("Cannot call a class as a function");for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=c=d(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(r)))).state={height:c.props.defaultHeight||0,width:c.props.defaultWidth||0},c._onResize=function(){var e,t,n,r,o,i,a=c.props,l=a.disableHeight,s=a.disableWidth,a=a.onResize;c._parentNode&&(e=c._parentNode.offsetHeight||0,t=c._parentNode.offsetWidth||0,i=window.getComputedStyle(c._parentNode)||{},n=parseInt(i.paddingLeft,10)||0,r=parseInt(i.paddingRight,10)||0,o=parseInt(i.paddingTop,10)||0,i=parseInt(i.paddingBottom,10)||0,(!l&&c.state.height!==e-o-i||!s&&c.state.width!==t-n-r)&&(c.setState({height:e-o-i,width:t-n-r}),a({height:e,width:t})))},c._setRef=function(e){c._autoSizer=e},d(c,t)}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),Y(i,[{key:"componentDidMount",value:function(){var e=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=Z(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.disableHeight,o=e.disableWidth,e=e.style,i=this.state,a=i.height,i=i.width,l={overflow:"visible"},s={},c=!1;return r||(0===a&&(c=!0),l.height=0,s.height=a),o||(0===i&&(c=!0),l.width=0,s.width=i),R.createElement("div",{className:n,ref:this._setRef,style:$({},l,e)},!c&&t(s))}}]),i}(R.PureComponent);function O(){return(O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function I(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(e,t){return(z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}x.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}};var ee=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function te(e,t){if(e.length!==t.length)return!1;for(var n,r,o=0;o<e.length;o++)if(n=e[o],r=t[o],n!==r&&(!ee(n)||!ee(r)))return!1;return!0}function k(n,r){void 0===r&&(r=te);var o,i,a=[],l=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l&&o===this&&r(e,a)||(i=n.apply(this,e),l=!0,o=this,a=e),i}}var ne="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function re(e){cancelAnimationFrame(e.id)}var N=-1;var T=null;function oe(e){var t,n;return void 0===e&&(e=!1),null!==T&&!e||((t=(e=document.createElement("div")).style).width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl",(n=(t=document.createElement("div")).style).width="100px",n.height="100px",e.appendChild(t),document.body.appendChild(e),T=0<e.scrollLeft?"positive-descending":(e.scrollLeft=1,0===e.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(e)),T}function ie(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t}var L=null,M=null,P=null;function ae(e){var l=e.getColumnOffset,s=e.getColumnStartIndexForOffset,c=e.getColumnStopIndexForStartIndex,u=e.getColumnWidth,x=e.getEstimatedTotalHeight,T=e.getEstimatedTotalWidth,d=e.getOffsetForColumnAndAlignment,f=e.getOffsetForRowAndAlignment,h=e.getRowHeight,p=e.getRowOffset,m=e.getRowStartIndexForOffset,g=e.getRowStopIndexForStartIndex,o=e.initInstanceProps,v=e.shouldResetStyleCacheOnItemSizeChange,i=e.validateProps,e=function(t){var e;function n(e){var c=t.call(this,e)||this;return c._instanceProps=o(c.props,I(c)),c._resetIsScrollingTimeoutId=null,c._outerRef=void 0,c.state={instance:I(c),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof c.props.initialScrollLeft?c.props.initialScrollLeft:0,scrollTop:"number"==typeof c.props.initialScrollTop?c.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},c._callOnItemsRendered=void 0,c._callOnItemsRendered=k(function(e,t,n,r,o,i,a,l){return c.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:r,visibleColumnStartIndex:o,visibleColumnStopIndex:i,visibleRowStartIndex:a,visibleRowStopIndex:l})}),c._callOnScroll=void 0,c._callOnScroll=k(function(e,t,n,r,o){return c.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:r,scrollUpdateWasRequested:o})}),c._getItemStyle=void 0,c._getItemStyle=function(e,t){var n,r,o=c.props,i=o.columnWidth,a=o.direction,o=o.rowHeight,i=c._getItemStyleCache(v&&i,v&&a,v&&o),o=e+":"+t;return i.hasOwnProperty(o)?n=i[o]:(r=l(c.props,t,c._instanceProps),i[o]=n={position:"absolute",left:(i="rtl"===a)?void 0:r,right:i?r:void 0,top:p(c.props,e,c._instanceProps),height:h(c.props,e,c._instanceProps),width:u(c.props,t,c._instanceProps)}),n},c._getItemStyleCache=void 0,c._getItemStyleCache=k(function(e,t,n){return{}}),c._onScroll=function(e){var e=e.currentTarget,r=e.clientHeight,o=e.clientWidth,i=e.scrollLeft,a=e.scrollTop,l=e.scrollHeight,s=e.scrollWidth;c.setState(function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=c.props.direction,n=i;if("rtl"===t)switch(oe()){case"negative":n=-i;break;case"positive-descending":n=s-o-i}n=Math.max(0,Math.min(n,s-o)),t=Math.max(0,Math.min(a,l-r));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:n,scrollTop:t,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._outerRefSetter=function(e){var t=c.props.outerRef;c._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},c._resetIsScrollingDebounced=function(){var t,n,r,o;null!==c._resetIsScrollingTimeoutId&&re(c._resetIsScrollingTimeoutId),c._resetIsScrollingTimeoutId=(t=c._resetIsScrolling,n=150,r=ne(),o={id:requestAnimationFrame(function e(){ne()-r>=n?t.call(null):o.id=requestAnimationFrame(e)})})},c._resetIsScrolling=function(){c._resetIsScrollingTimeoutId=null,c.setState({isScrolling:!1},function(){c._getItemStyleCache(-1)})},c}e=t,(r=n).prototype=Object.create(e.prototype),z(r.prototype.constructor=r,e),n.getDerivedStateFromProps=function(e,t){return le(e,t),i(e),null};var r=n.prototype;return r.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}},this._resetIsScrollingDebounced)},r.scrollToItem=function(e){var t=e.align,t=void 0===t?"auto":t,n=e.columnIndex,e=e.rowIndex,r=this.props,o=r.columnCount,i=r.height,a=r.rowCount,r=r.width,l=this.state,s=l.scrollLeft,l=l.scrollTop,c=(void 0===u&&(u=!1),-1!==N&&!u||((c=(u=document.createElement("div")).style).width="50px",c.height="50px",c.overflow="scroll",document.body.appendChild(u),N=u.offsetWidth-u.clientWidth,document.body.removeChild(u)),N),u=(void 0!==n&&(n=Math.max(0,Math.min(n,o-1))),void 0!==e&&(e=Math.max(0,Math.min(e,a-1))),x(this.props,this._instanceProps)),o=r<T(this.props,this._instanceProps)?c:0;this.scrollTo({scrollLeft:void 0!==n?d(this.props,n,t,s,this._instanceProps,i<u?c:0):s,scrollTop:void 0!==e?f(this.props,e,t,l,this._instanceProps,o):l})},r.componentDidMount=function(){var e,t=this.props,n=t.initialScrollLeft,t=t.initialScrollTop;null!=this._outerRef&&(e=this._outerRef,"number"==typeof n&&(e.scrollLeft=n),"number"==typeof t&&(e.scrollTop=t)),this._callPropsCallbacks()},r.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("rtl"===e)switch(oe()){case"negative":o.scrollLeft=-n;break;case"positive-ascending":o.scrollLeft=n;break;default:var i=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-i-n}else o.scrollLeft=Math.max(0,n);o.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},r.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&re(this._resetIsScrollingTimeoutId)},r.render=function(){var e=this.props,t=e.children,n=e.className,r=e.columnCount,o=e.direction,i=e.height,a=e.innerRef,l=e.innerElementType,s=e.innerTagName,c=e.itemData,u=e.itemKey,d=void 0===u?ie:u,u=e.outerElementType,f=e.outerTagName,h=e.rowCount,p=e.style,m=e.useIsScrolling,e=e.width,g=this.state.isScrolling,v=this._getHorizontalRangeToRender(),y=v[0],_=v[1],v=this._getVerticalRangeToRender(),w=v[0],b=v[1],S=[];if(0<r&&h)for(var C=w;C<=b;C++)for(var E=y;E<=_;E++)S.push(R.createElement(t,{columnIndex:E,data:c,isScrolling:m?g:void 0,key:d({columnIndex:E,data:c,rowIndex:C}),rowIndex:C,style:this._getItemStyle(C,E)}));v=x(this.props,this._instanceProps),r=T(this.props,this._instanceProps);return R.createElement(u||f||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:O({position:"relative",height:i,width:e,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},p)},R.createElement(l||s||"div",{children:S,ref:a,style:{height:v,pointerEvents:g?"none":void 0,width:r}}))},r._callPropsCallbacks=function(){var e,t,n,r,o,i=this.props,a=i.columnCount,l=i.onItemsRendered,s=i.onScroll,i=i.rowCount;"function"==typeof l&&0<a&&0<i&&(a=(l=this._getHorizontalRangeToRender())[0],i=l[1],o=l[2],l=l[3],n=(t=this._getVerticalRangeToRender())[0],r=t[1],e=t[2],t=t[3],this._callOnItemsRendered(a,i,n,r,o,l,e,t)),"function"==typeof s&&(i=(a=this.state).horizontalScrollDirection,n=a.scrollLeft,r=a.scrollTop,o=a.scrollUpdateWasRequested,l=a.verticalScrollDirection,this._callOnScroll(n,r,i,l,o))},r._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,r=e.overscanColumnsCount,o=e.overscanCount,e=e.rowCount,i=this.state,a=i.horizontalScrollDirection,l=i.isScrolling,i=i.scrollLeft,n=n||r||o||1;return 0===t||0===e?[0,0,0,0]:(r=s(this.props,i,this._instanceProps),o=c(this.props,r,i,this._instanceProps),e=l&&"backward"!==a?1:Math.max(1,n),i=l&&"forward"!==a?1:Math.max(1,n),[Math.max(0,r-e),Math.max(0,Math.min(t-1,o+i)),r,o])},r._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,o=e.overscanRowsCount,e=e.rowCount,i=this.state,a=i.isScrolling,l=i.verticalScrollDirection,i=i.scrollTop,r=r||o||n||1;return 0===t||0===e?[0,0,0,0]:(o=m(this.props,i,this._instanceProps),n=g(this.props,o,i,this._instanceProps),t=a&&"backward"!==l?1:Math.max(1,r),i=a&&"forward"!==l?1:Math.max(1,r),[Math.max(0,o-t),Math.max(0,Math.min(e-1,n+i)),o,n])},n}(R.PureComponent);return e.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},e}"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&void 0!==window.WeakSet&&(L=new WeakSet,M=new WeakSet,P=new WeakSet);function le(e,t){var n=e.children,r=e.direction,o=e.height,i=e.innerTagName,a=e.outerTagName,l=e.overscanColumnsCount,s=e.overscanCount,c=e.overscanRowsCount,e=e.width,t=t.instance;if("production"!==process.env.NODE_ENV){if("number"==typeof s&&L&&!L.has(t)&&(L.add(t),console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")),"number"!=typeof l&&"number"!=typeof c||M&&!M.has(t)&&(M.add(t),console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")),null==i&&null==a||P&&!P.has(t)&&(P.add(t),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")),null==n)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===n?"null":typeof n)+'" was specified.');switch(r){case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+r+'" was specified.')}if("number"!=typeof e)throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. "'+(null===e?"null":typeof e)+'" was specified.');if("number"!=typeof o)throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. "'+(null===o?"null":typeof o)+'" was specified.')}}function se(e){function a(e){i(!0),r(e)}var e=e.TraitFilterContextConsumer,t=v(R.useState({}),2),n=t[0],r=t[1],o=(t=v(R.useState(!1),2))[0],i=t[1];return h.default.createElement(R.Fragment,null,o&&h.default.createElement(de,{imageWidth:250,token:n,onClose:function(){return i(!1)}}),h.default.createElement(e,null,function(e){var i=e.filteredTokens;return h.default.createElement(x,null,function(e){var t=e.height,e=e.width,o=Math.floor(e/270),n=Math.ceil(i.length/o);return h.default.createElement(ce,{columnCount:o,columnWidth:e/o,height:t,rowCount:n,rowHeight:310,width:e},function(e){var t=e.columnIndex,n=e.rowIndex,e=e.style,r=i[n*o+t];return r?h.default.createElement("div",{style:e},h.default.createElement(ue,{key:r.name,width:250,token:r,onClick:function(){return a(r)},showTokenName:!0})):null})})}))}function A(t){return function(e){return h.default.createElement(t,i({TraitFilterContextConsumer:q},e))}}process.env.NODE_ENV;var ce=ae({getColumnOffset:function(e,t){return t*e.columnWidth},getColumnWidth:function(e,t){return e.columnWidth},getRowOffset:function(e,t){return t*e.rowHeight},getRowHeight:function(e,t){return e.rowHeight},getEstimatedTotalHeight:function(e){var t=e.rowCount;return e.rowHeight*t},getEstimatedTotalWidth:function(e){var t=e.columnCount;return e.columnWidth*t},getOffsetForColumnAndAlignment:function(e,t,n,r,o,i){var a=e.columnCount,l=e.columnWidth,s=e.width,c=Math.max(0,a*l-s),u=Math.min(c,t*l),d=Math.max(0,t*l-s+i+l);switch(n="smart"===n?d-s<=r&&r<=u+s?"auto":"center":n){case"start":return u;case"end":return d;case"center":var f=Math.round(d+(u-d)/2);return f<Math.ceil(s/2)?0:f>c+Math.floor(s/2)?c:f;default:return d<=r&&r<=u?r:u<d||r<d?d:u}},getOffsetForRowAndAlignment:function(e,t,n,r,o,i){var a=e.rowHeight,l=e.height,e=e.rowCount,s=Math.max(0,e*a-l),c=Math.min(s,t*a),u=Math.max(0,t*a-l+i+a);switch(n="smart"===n?u-l<=r&&r<=c+l?"auto":"center":n){case"start":return c;case"end":return u;case"center":var d=Math.round(u+(c-u)/2);return d<Math.ceil(l/2)?0:d>s+Math.floor(l/2)?s:d;default:return u<=r&&r<=c?r:c<u||r<u?u:c}},getColumnStartIndexForOffset:function(e,t){var n=e.columnWidth,e=e.columnCount;return Math.max(0,Math.min(e-1,Math.floor(t/n)))},getColumnStopIndexForStartIndex:function(e,t,n){var r=e.columnWidth,o=e.columnCount,e=e.width,e=Math.ceil((e+n-t*r)/r);return Math.max(0,Math.min(o-1,t+e-1))},getRowStartIndexForOffset:function(e,t){var n=e.rowHeight,e=e.rowCount;return Math.max(0,Math.min(e-1,Math.floor(t/n)))},getRowStopIndexForStartIndex:function(e,t,n){var r=e.rowHeight,o=e.rowCount,e=e.height,e=Math.ceil((e+n-t*r)/r);return Math.max(0,Math.min(o-1,t+e-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var t=e.columnWidth,e=e.rowHeight;if("production"!==process.env.NODE_ENV){if("number"!=typeof t)throw Error('An invalid "columnWidth" prop has been specified. Value should be a number. "'+(null===t?"null":typeof t)+'" was specified.');if("number"!=typeof e)throw Error('An invalid "rowHeight" prop has been specified. Value should be a number. "'+(null===e?"null":typeof e)+'" was specified.')}}}),ue=function(e){var t=e.width,n=e.token,r=e.onClick,e=e.showTokenName,o={image:{borderRadius:"0.5rem"},wrapper:{position:"relative",display:"inline-block"},tokeName:{position:"absolute",top:"0.75rem",left:"0.75rem"}};return h.default.createElement("div",{style:o.wrapper},void 0!==e&&e&&h.default.createElement("div",{style:o.tokeName},n.name),h.default.createElement("img",i({width:t,height:"auto",src:n.image,alt:n.name,crossOrigin:"anonymous"},r?{onClick:r,style:p(p({},o.image),{},{cursor:"pointer"})}:{style:o.image})))},de=function(e){var t=e.imageWidth,n=e.token,e=e.onClose,r={modal:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:9999,background:"rgb(25 25 25 / 80%)",display:"flex",justifyContent:"center",alignItems:"center"},content:{borderRadius:3,padding:"3rem",paddingTop:"2rem",background:"#523878"},attributes:{padding:"0 0 0 2rem"}};return h.default.createElement("div",{style:r.modal},h.default.createElement("div",{style:r.content},h.default.createElement("div",{style:{textAlign:"right",paddingBottom:"0.5rem"}},h.default.createElement("a",{href:"#",style:{textDecoration:"none",color:"white"},onClick:e},"Close")),h.default.createElement("h3",{style:{textAlign:"left"}},n.name),h.default.createElement("div",{style:{display:"flex"}},h.default.createElement(ue,{width:t,token:n}),h.default.createElement("div",{style:r.attributes},h.default.createElement("h3",null,"Attributes"),h.default.createElement("ul",{style:{listStyle:"none",padding:0}},n.attributes.map(function(e){var t=e.trait_type,e=e.value;return h.default.createElement("li",{key:"".concat(t,":").concat(e)},t," - ",e)}))))))};return function(e){var t=e.tokens,n=e.GalleryLayout,r=e.FiltersLayout,o=e.TokensLayout,e=e.CurrentFiltersLayout,n=A(void 0===n?U:n),r=A(void 0===r?V:r),o=A(void 0===o?se:o),e=A(void 0===e?H:e);return h.default.createElement(l,{tokens:t},h.default.createElement(n,{FiltersLayout:r,TokensLayout:o,CurrentFiltersLayout:e}))}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).CollectionGallery=t(e.React)}(this,function(R){"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=e(R);function r(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){d(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function o(e,t){return(o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function f(e,t,n){return(f=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),1}catch(e){}}}()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);t=new(Function.bind.apply(e,r));return n&&o(t,n.prototype),t}).apply(null,arguments)}function W(e,t){if(null==e)return{};var n,r=function(e,t){if(null==e)return{};for(var n,r={},o=Object.keys(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)n=o[i],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){var n;if(e)return"string"==typeof e?a(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){var n,r,o,i,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return r=!(n=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return n=e.done,e},e:function(e){r=!0,o=e},f:function(){try{n||null==a.return||a.return()}finally{if(r)throw o}}};if(Array.isArray(e)||(a=l(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),i=0,{s:t=function(){},n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}const t="undefined"!=typeof crypto?crypto:{},F="function"==typeof t.randomBytes?e=>Uint8Array.from(t.randomBytes(e)):"function"==typeof t.getRandomValues?e=>t.getRandomValues(new Uint8Array(e)):e=>Uint8Array.from(Array(e),()=>256*Math.random());class n{static of(...e){return new(Function.prototype.bind.apply(this,[null].concat(e)))}static from(e){return new(Function.prototype.bind.apply(this,[null].concat(e)))}[Symbol.iterator](){return function*(t,n){for(let e=0n;e<n;e++)yield t.at(e)}(this,this.length)}toArray(){return[...this]}get isBig(){return Number.MAX_SAFE_INTEGER<this.length}get isSafe(){return"undefined"!=typeof BigInt||!this.isBig}_check(e){if(e<0){if(this.length<-e)throw new RangeError(e+" is out of range");return BigInt(this.length)+BigInt(e)}if(this.length<=e)throw new RangeError(e+" is out of range");return e}at(e){}nth(e){return this.at(e)}sample(){return this.at(function(e=0,t=Math.pow(2,53)){let n=e.constructor;if(0===arguments.length)return Math.floor(Math.random()*n(t));if(1==arguments.length&&([e,t]=[n(0),e]),"number"==typeof e)return[e,t]=[Math.ceil(Number(e)),Math.ceil(Number(t))],Math.floor(Math.random()*(t-e))+e;const r=n(t)-n(e),o=(t=r.toString(16).length,F(t));var i=o.reduce((e,t)=>(e<<n(8))+n(t),n(0));return(n(i)*r>>n(8*t))+n(e)}(this.length))}samples(){return function*(e){for(;;)yield e.sample()}(this)}}class D extends n{constructor(...e){super(),this.seed=e.map(e=>[...e]),this.size=this.seed.length;e=this.seed.reduce((e,t)=>e*BigInt(t.length),1n);this.length=e,Object.freeze(this)}at(e){if(void 0!==(e=this._check(e))){let t=BigInt(e),n=[];for(let e=0;e<this.size;e++){var r=this.seed[e].length,r=BigInt(r),o=t%r;n.push(this.seed[e][Number(o)]),t=(t-o)/r}return n}}}function s(e){var t=e.children,r=e.tokens,o=e.onFilterChange,e=R.useMemo(function(){return[(n={},r.forEach(function(e){e.attributes.forEach(function(e){var t=e.trait_type,e=e.value;n[t]||(n[t]=new Set),n[t].add(e)})}),Object.entries(n).forEach(function(e){var e=h(e,2),t=e[0],e=e[1];n[t]=p(e)}),n),function(e){var t,n={},r=m(e);try{for(r.s();!(t=r.n()).done;){var o,i=m(t.value.attributes);try{for(i.s();!(o=i.n()).done;){var a=o.value,l=a.trait_type,s=a.value,c="".concat(l,":").concat(s);n[c]||(n[c]=0),n[c]+=1}}catch(e){i.e(e)}finally{i.f()}}}catch(e){r.e(e)}finally{r.f()}return n}(r)];var n},[r]),n=(e=h(e,2))[0],i=e[1],e=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=h(R.useState({}),2),n=t[0],r=t[1],o=R.useCallback(function(t,n){r(function(e){return u(u({},e),{},d({},t,n))})},[r]),t=R.useCallback(function(e){return o(e,!1)},[o]),i=R.useCallback(function(e){return o(e,!0)},[o]);return R.useEffect(function(){r(q(e))},[e]),[n,i,t]}(R.useMemo(function(){return Object.keys(i)},[i])),a=(e=h(e,3))[0],l=e[1],e=e[2],s=R.useMemo(function(){return o&&o(a),t=r,!(e=a)||0===(e=Object.entries(e).filter(function(e){e=h(e,2);return e[0],e[1]}).flatMap(function(e){return h(e,1)[0]})).length?t:(e=Object.values(K(e)),n=p(f(D,e)),t.filter(function(e){var t=e.attributes.map(function(e){return X(e)});return n.find(function(e){return G(t,e)})}));var e,t,n},[a,r]);return c.default.createElement(g.Provider,{value:{variationNamesByTraitName:n,tokenCountByVariationName:i,filters:a,addFilter:l,removeFilter:e,tokens:r,filteredTokens:s}},t)}function H(e){return e=e.TraitFilterContextConsumer,c.default.createElement("ul",{style:v.wrapper},c.default.createElement(e,null,function(e){var t=e.filters,n=e.removeFilter;return Object.entries(t).filter(function(e){e=h(e,2);return e[0],e[1]}).map(function(e){e=h(e,1)[0];return c.default.createElement($,{key:e,name:e,onClick:n})})}))}function B(e){function n(e,t){return"".concat(e,":").concat(t)}var r=e.traitName,t=e.variationNames,o=e.getCount,i=e.onChange,a=e.isChecked,l={traitHeader:{paddingTop:"1.25rem",paddingBottom:"0.75rem",textAlign:"left"},variationNames:{textAlign:"left"},variationName:{display:"flex",flexGrow:1,justifyContent:"space-between"}};return c.default.createElement("div",null,c.default.createElement("div",{style:l.traitHeader},r),c.default.createElement("div",{style:l.variationNames},(t||[]).sort(function(e,t){return o(n(r,t))-o(n(r,e))}).map(function(e){var t=n(r,e);return c.default.createElement("label",{key:t,style:l.variationName,name:t},c.default.createElement("div",null,c.default.createElement("input",{name:t,type:"checkbox",checked:a(t)||!1,onChange:i,style:{marginRight:"0.5rem"}}),c.default.createElement("span",null,e)),c.default.createElement("span",null,o(t)))})))}function V(e){e.TraitFilterContextConsumer;var t=(e=R.useContext(g)).variationNamesByTraitName,n=e.tokenCountByVariationName,r=e.filters,o=e.addFilter,i=e.removeFilter,e=R.useCallback(function(e){return n[e]},[n]),a=R.useCallback(function(e){return r[e]},[r]),l=R.useCallback(function(e){var e=e.target,t=e.name;(e.checked?o:i)(t)},[o,i]);return c.default.createElement(Q,{variationNamesByTraitName:t,getCount:e,onChange:l,isChecked:a})}function U(e){var t=e.TraitFilterContextConsumer,n=e.FiltersLayout,r=e.TokensLayout,e=e.CurrentFiltersLayout;return c.default.createElement("div",{style:y.wrapper},c.default.createElement("div",{style:y.content},c.default.createElement("div",{style:y.leftColumn},c.default.createElement(n,null)),c.default.createElement("div",{style:y.rightColumn},c.default.createElement("div",{style:y.supplyCount},c.default.createElement(t,null,function(e){var t=e.tokens,e=e.filteredTokens;return"".concat(e.length,"/").concat(t.length)})),c.default.createElement(e,null),c.default.createElement(r,null))))}var q=function(e){return e.reduce(function(e,t){return e[t]=!1,e},{})},g=R.createContext({}),G=function(t,e){return e.every(function(e){return t.includes(e)})},K=function(e){return e.reduce(function(e,t){var n=t.split(":")[0],r=e[n]||[];return r.push(t),e[n]=r,e},{})},X=function(e){var t=e.trait_type,e=e.value;return"".concat(t,":").concat(e)},Y=(s.defaultProps={tokens:[]},g.Consumer),v={wrapper:{display:"flex",flexWrap:"wrap",listStyle:"none",padding:"0.5rem",margin:0},filter:{border:"1px solid grey",borderRadius:2,padding:"0.5rem",marginRight:"0.5rem",cursor:"pointer"}},$=function(e){var t=e.name,n=e.onClick;return c.default.createElement("li",{style:v.filter,onClick:function(){return n(t)}},t.split(":").join(" - "))},J=["variationNamesByTraitName"],Q=function(e){var t=e.variationNamesByTraitName,n=W(e,J);return R.useMemo(function(){return Object.entries(t).sort(function(e,t){return e[0].localeCompare(t[0])})},[t]).map(function(e){var e=h(e,2),t=e[0],e=e[1];return c.default.createElement(B,i({key:t,traitName:t,variationNames:e},n))})},y={wrapper:{position:"fixed",top:0,bottom:0,left:0,right:0,zIndex:999,padding:"1rem",backgroundColor:"#1E1E1E"},content:{display:"flex",flexDirecetion:"row",height:"100%"},leftColumn:{minWidth:300,width:300,paddingRight:"1rem",display:"flex",flexDirection:"column",overflowY:"auto"},rightColumn:{flexGrow:1,display:"flex",flexDirection:"column"},supplyCount:{fontSize:"2.5rem",textAlign:"right"}},Z=function(e,t,n){return t&&_(e.prototype,t),n&&_(e,n),e};function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}var ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},te=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var n=t,r=[],o=!0,t=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(o=(a=l.next()).done)&&(r.push(a.value),!n||r.length!==n);o=!0);}catch(e){t=!0,i=e}finally{try{!o&&l.return&&l.return()}finally{if(t)throw i}}return r}throw new TypeError("Invalid attempt to destructure non-iterable instance")},w=void 0,w="undefined"!=typeof window?window:"undefined"!=typeof self?self:global,C=null,ne=null,S=w.clearTimeout,E=w.setTimeout,x=w.cancelAnimationFrame||w.mozCancelAnimationFrame||w.webkitCancelAnimationFrame,T=w.requestAnimationFrame||w.mozRequestAnimationFrame||w.webkitRequestAnimationFrame;function re(l){var s=void 0,c=void 0,u=void 0,d=void 0,f=void 0,h=void 0,p="undefined"!=typeof document&&document.attachEvent;if(!p){var f=function(e){var e=e.__resizeTriggers__,t=e.firstElementChild,e=e.lastElementChild,n=t.firstElementChild;e.scrollLeft=e.scrollWidth,e.scrollTop=e.scrollHeight,n.style.width=t.offsetWidth+1+"px",n.style.height=t.offsetHeight+1+"px",t.scrollLeft=t.scrollWidth,t.scrollTop=t.scrollHeight},e=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},h=function(t){var n;t.target.className&&"function"==typeof t.target.className.indexOf&&t.target.className.indexOf("contract-trigger")<0&&t.target.className.indexOf("expand-trigger")<0||(f(n=this),this.__resizeRAF__&&C(this.__resizeRAF__),this.__resizeRAF__=ne(function(){e(n)&&(n.__resizeLast__.width=n.offsetWidth,n.__resizeLast__.height=n.offsetHeight,n.__resizeListeners__.forEach(function(e){e.call(n,t)}))}))},t=!1,n="",u="animationstart",r="Webkit Moz O ms".split(" "),o="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),i=document.createElement("fakeelement");if(!1===(t=void 0!==i.style.animationName?!0:t))for(var a=0;a<r.length;a++)if(void 0!==i.style[r[a]+"AnimationName"]){n="-"+r[a].toLowerCase()+"-",u=o[a],t=!0;break}s="@"+n+"keyframes "+(c="resizeanim")+" { from { opacity: 0; } to { opacity: 0; } } ",d=n+"animation: 1ms "+c+"; "}return{addResizeListener:function(t,e){var n,r,o,i,a;p?t.attachEvent("onresize",e):(t.__resizeTriggers__||(n=t.ownerDocument,(r=w.getComputedStyle(t))&&"static"===r.position&&(t.style.position="relative"),(r=n).getElementById("detectElementResize")||(o=(s||"")+".resize-triggers { "+(d||"")+'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',i=r.head||r.getElementsByTagName("head")[0],(a=r.createElement("style")).id="detectElementResize",a.type="text/css",null!=l&&a.setAttribute("nonce",l),a.styleSheet?a.styleSheet.cssText=o:a.appendChild(r.createTextNode(o)),i.appendChild(a)),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=n.createElement("div")).className="resize-triggers",(r=n.createElement("div")).className="expand-trigger",r.appendChild(n.createElement("div")),(o=n.createElement("div")).className="contract-trigger",t.__resizeTriggers__.appendChild(r),t.__resizeTriggers__.appendChild(o),t.appendChild(t.__resizeTriggers__),f(t),t.addEventListener("scroll",h,!0),u&&(t.__resizeTriggers__.__animationListener__=function(e){e.animationName===c&&f(t)},t.__resizeTriggers__.addEventListener(u,t.__resizeTriggers__.__animationListener__))),t.__resizeListeners__.push(e))},removeResizeListener:function(e,t){if(p)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",h,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(u,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}var ne=null==x||null==T?(C=S,function(e){return E(e,20)}):(C=function(e){var e=te(e,2),t=e[0],e=e[1];x(t),S(e)},function(e){var t=T(function(){S(n),e()}),n=E(function(){x(t),e()},20);return[t,n]}),O=function(e){var t=i;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);function i(){var c,e=this,t=i;if(!(e instanceof t))throw new TypeError("Cannot call a class as a function");for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=c=b(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(r)))).state={height:c.props.defaultHeight||0,width:c.props.defaultWidth||0},c._onResize=function(){var e,t,n,r,o,i,a=c.props,l=a.disableHeight,s=a.disableWidth,a=a.onResize;c._parentNode&&(e=c._parentNode.offsetHeight||0,t=c._parentNode.offsetWidth||0,i=window.getComputedStyle(c._parentNode)||{},n=parseInt(i.paddingLeft,10)||0,r=parseInt(i.paddingRight,10)||0,o=parseInt(i.paddingTop,10)||0,i=parseInt(i.paddingBottom,10)||0,(!l&&c.state.height!==e-o-i||!s&&c.state.width!==t-n-r)&&(c.setState({height:e-o-i,width:t-n-r}),a({height:e,width:t})))},c._setRef=function(e){c._autoSizer=e},b(c,t)}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e),Z(i,[{key:"componentDidMount",value:function(){var e=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=re(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())}},{key:"componentWillUnmount",value:function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.disableHeight,o=e.disableWidth,e=e.style,i=this.state,a=i.height,i=i.width,l={overflow:"visible"},s={},c=!1;return r||(0===a&&(c=!0),l.height=0,s.height=a),o||(0===i&&(c=!0),l.width=0,s.width=i),R.createElement("div",{className:n,ref:this._setRef,style:ee({},l,e)},!c&&t(s))}}]),i}(R.PureComponent);function I(){return(I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oe(e,t){return(oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}O.defaultProps={onResize:function(){},disableHeight:!1,disableWidth:!1,style:{}};var ie=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function ae(e,t){if(e.length!==t.length)return!1;for(var n,r,o=0;o<e.length;o++)if(n=e[o],r=t[o],n!==r&&(!ie(n)||!ie(r)))return!1;return!0}function z(n,r){void 0===r&&(r=ae);var o,i,a=[],l=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return l&&o===this&&r(e,a)||(i=n.apply(this,e),l=!0,o=this,a=e),i}}var le="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function se(e){cancelAnimationFrame(e.id)}var N=-1;var M=null;function ce(e){var t,n;return void 0===e&&(e=!1),null!==M&&!e||((t=(e=document.createElement("div")).style).width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl",(n=(t=document.createElement("div")).style).width="100px",n.height="100px",e.appendChild(t),document.body.appendChild(e),M=0<e.scrollLeft?"positive-descending":(e.scrollLeft=1,0===e.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(e)),M}function ue(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t}var L=null,A=null,P=null;function de(e){var l=e.getColumnOffset,s=e.getColumnStartIndexForOffset,c=e.getColumnStopIndexForStartIndex,u=e.getColumnWidth,x=e.getEstimatedTotalHeight,T=e.getEstimatedTotalWidth,d=e.getOffsetForColumnAndAlignment,f=e.getOffsetForRowAndAlignment,h=e.getRowHeight,p=e.getRowOffset,m=e.getRowStartIndexForOffset,g=e.getRowStopIndexForStartIndex,o=e.initInstanceProps,v=e.shouldResetStyleCacheOnItemSizeChange,i=e.validateProps,e=function(t){var e;function n(e){var c=t.call(this,e)||this;return c._instanceProps=o(c.props,k(c)),c._resetIsScrollingTimeoutId=null,c._outerRef=void 0,c.state={instance:k(c),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof c.props.initialScrollLeft?c.props.initialScrollLeft:0,scrollTop:"number"==typeof c.props.initialScrollTop?c.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},c._callOnItemsRendered=void 0,c._callOnItemsRendered=z(function(e,t,n,r,o,i,a,l){return c.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:r,visibleColumnStartIndex:o,visibleColumnStopIndex:i,visibleRowStartIndex:a,visibleRowStopIndex:l})}),c._callOnScroll=void 0,c._callOnScroll=z(function(e,t,n,r,o){return c.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:r,scrollUpdateWasRequested:o})}),c._getItemStyle=void 0,c._getItemStyle=function(e,t){var n,r,o=c.props,i=o.columnWidth,a=o.direction,o=o.rowHeight,i=c._getItemStyleCache(v&&i,v&&a,v&&o),o=e+":"+t;return i.hasOwnProperty(o)?n=i[o]:(r=l(c.props,t,c._instanceProps),i[o]=n={position:"absolute",left:(i="rtl"===a)?void 0:r,right:i?r:void 0,top:p(c.props,e,c._instanceProps),height:h(c.props,e,c._instanceProps),width:u(c.props,t,c._instanceProps)}),n},c._getItemStyleCache=void 0,c._getItemStyleCache=z(function(e,t,n){return{}}),c._onScroll=function(e){var e=e.currentTarget,r=e.clientHeight,o=e.clientWidth,i=e.scrollLeft,a=e.scrollTop,l=e.scrollHeight,s=e.scrollWidth;c.setState(function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=c.props.direction,n=i;if("rtl"===t)switch(ce()){case"negative":n=-i;break;case"positive-descending":n=s-o-i}n=Math.max(0,Math.min(n,s-o)),t=Math.max(0,Math.min(a,l-r));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:n,scrollTop:t,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},c._resetIsScrollingDebounced)},c._outerRefSetter=function(e){var t=c.props.outerRef;c._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},c._resetIsScrollingDebounced=function(){var t,n,r,o;null!==c._resetIsScrollingTimeoutId&&se(c._resetIsScrollingTimeoutId),c._resetIsScrollingTimeoutId=(t=c._resetIsScrolling,n=150,r=le(),o={id:requestAnimationFrame(function e(){le()-r>=n?t.call(null):o.id=requestAnimationFrame(e)})})},c._resetIsScrolling=function(){c._resetIsScrollingTimeoutId=null,c.setState({isScrolling:!1},function(){c._getItemStyleCache(-1)})},c}e=t,(r=n).prototype=Object.create(e.prototype),oe(r.prototype.constructor=r,e),n.getDerivedStateFromProps=function(e,t){return fe(e,t),i(e),null};var r=n.prototype;return r.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}},this._resetIsScrollingDebounced)},r.scrollToItem=function(e){var t=e.align,t=void 0===t?"auto":t,n=e.columnIndex,e=e.rowIndex,r=this.props,o=r.columnCount,i=r.height,a=r.rowCount,r=r.width,l=this.state,s=l.scrollLeft,l=l.scrollTop,c=(void 0===u&&(u=!1),-1!==N&&!u||((c=(u=document.createElement("div")).style).width="50px",c.height="50px",c.overflow="scroll",document.body.appendChild(u),N=u.offsetWidth-u.clientWidth,document.body.removeChild(u)),N),u=(void 0!==n&&(n=Math.max(0,Math.min(n,o-1))),void 0!==e&&(e=Math.max(0,Math.min(e,a-1))),x(this.props,this._instanceProps)),o=r<T(this.props,this._instanceProps)?c:0;this.scrollTo({scrollLeft:void 0!==n?d(this.props,n,t,s,this._instanceProps,i<u?c:0):s,scrollTop:void 0!==e?f(this.props,e,t,l,this._instanceProps,o):l})},r.componentDidMount=function(){var e,t=this.props,n=t.initialScrollLeft,t=t.initialScrollTop;null!=this._outerRef&&(e=this._outerRef,"number"==typeof n&&(e.scrollLeft=n),"number"==typeof t&&(e.scrollTop=t)),this._callPropsCallbacks()},r.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("rtl"===e)switch(ce()){case"negative":o.scrollLeft=-n;break;case"positive-ascending":o.scrollLeft=n;break;default:var i=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-i-n}else o.scrollLeft=Math.max(0,n);o.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},r.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&se(this._resetIsScrollingTimeoutId)},r.render=function(){var e=this.props,t=e.children,n=e.className,r=e.columnCount,o=e.direction,i=e.height,a=e.innerRef,l=e.innerElementType,s=e.innerTagName,c=e.itemData,u=e.itemKey,d=void 0===u?ue:u,u=e.outerElementType,f=e.outerTagName,h=e.rowCount,p=e.style,m=e.useIsScrolling,e=e.width,g=this.state.isScrolling,v=this._getHorizontalRangeToRender(),y=v[0],_=v[1],v=this._getVerticalRangeToRender(),b=v[0],w=v[1],C=[];if(0<r&&h)for(var S=b;S<=w;S++)for(var E=y;E<=_;E++)C.push(R.createElement(t,{columnIndex:E,data:c,isScrolling:m?g:void 0,key:d({columnIndex:E,data:c,rowIndex:S}),rowIndex:S,style:this._getItemStyle(S,E)}));v=x(this.props,this._instanceProps),r=T(this.props,this._instanceProps);return R.createElement(u||f||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:I({position:"relative",height:i,width:e,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},p)},R.createElement(l||s||"div",{children:C,ref:a,style:{height:v,pointerEvents:g?"none":void 0,width:r}}))},r._callPropsCallbacks=function(){var e,t,n,r,o,i=this.props,a=i.columnCount,l=i.onItemsRendered,s=i.onScroll,i=i.rowCount;"function"==typeof l&&0<a&&0<i&&(a=(l=this._getHorizontalRangeToRender())[0],i=l[1],o=l[2],l=l[3],n=(t=this._getVerticalRangeToRender())[0],r=t[1],e=t[2],t=t[3],this._callOnItemsRendered(a,i,n,r,o,l,e,t)),"function"==typeof s&&(i=(a=this.state).horizontalScrollDirection,n=a.scrollLeft,r=a.scrollTop,o=a.scrollUpdateWasRequested,l=a.verticalScrollDirection,this._callOnScroll(n,r,i,l,o))},r._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,r=e.overscanColumnsCount,o=e.overscanCount,e=e.rowCount,i=this.state,a=i.horizontalScrollDirection,l=i.isScrolling,i=i.scrollLeft,n=n||r||o||1;return 0===t||0===e?[0,0,0,0]:(r=s(this.props,i,this._instanceProps),o=c(this.props,r,i,this._instanceProps),e=l&&"backward"!==a?1:Math.max(1,n),i=l&&"forward"!==a?1:Math.max(1,n),[Math.max(0,r-e),Math.max(0,Math.min(t-1,o+i)),r,o])},r._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,o=e.overscanRowsCount,e=e.rowCount,i=this.state,a=i.isScrolling,l=i.verticalScrollDirection,i=i.scrollTop,r=r||o||n||1;return 0===t||0===e?[0,0,0,0]:(o=m(this.props,i,this._instanceProps),n=g(this.props,o,i,this._instanceProps),t=a&&"backward"!==l?1:Math.max(1,r),i=a&&"forward"!==l?1:Math.max(1,r),[Math.max(0,o-t),Math.max(0,Math.min(e-1,n+i)),o,n])},n}(R.PureComponent);return e.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},e}"production"!==process.env.NODE_ENV&&"undefined"!=typeof window&&void 0!==window.WeakSet&&(L=new WeakSet,A=new WeakSet,P=new WeakSet);function fe(e,t){var n=e.children,r=e.direction,o=e.height,i=e.innerTagName,a=e.outerTagName,l=e.overscanColumnsCount,s=e.overscanCount,c=e.overscanRowsCount,e=e.width,t=t.instance;if("production"!==process.env.NODE_ENV){if("number"==typeof s&&L&&!L.has(t)&&(L.add(t),console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")),"number"!=typeof l&&"number"!=typeof c||A&&!A.has(t)&&(A.add(t),console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")),null==i&&null==a||P&&!P.has(t)&&(P.add(t),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")),null==n)throw Error('An invalid "children" prop has been specified. Value should be a React component. "'+(null===n?"null":typeof n)+'" was specified.');switch(r){case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". "'+r+'" was specified.')}if("number"!=typeof e)throw Error('An invalid "width" prop has been specified. Grids must specify a number for width. "'+(null===e?"null":typeof e)+'" was specified.');if("number"!=typeof o)throw Error('An invalid "height" prop has been specified. Grids must specify a number for height. "'+(null===o?"null":typeof o)+'" was specified.')}}function he(e){function a(e){i(!0),r(e)}var e=e.TraitFilterContextConsumer,t=h(R.useState({}),2),n=t[0],r=t[1],o=(t=h(R.useState(!1),2))[0],i=t[1];return c.default.createElement(R.Fragment,null,o&&c.default.createElement(ge,{imageWidth:250,token:n,onClose:function(){return i(!1)}}),c.default.createElement(e,null,function(e){var i=e.filteredTokens;return c.default.createElement(O,null,function(e){var t=e.height,e=e.width,o=Math.floor(e/270),n=Math.ceil(i.length/o);return c.default.createElement(pe,{columnCount:o,columnWidth:e/o,height:t,rowCount:n,rowHeight:310,width:e},function(e){var t=e.columnIndex,n=e.rowIndex,e=e.style,r=i[n*o+t];return r?c.default.createElement("div",{style:e},c.default.createElement(me,{key:r.name,width:250,token:r,onClick:function(){return a(r)},showTokenName:!0})):null})})}))}function j(t){return function(e){return c.default.createElement(t,i({TraitFilterContextConsumer:Y},e))}}process.env.NODE_ENV;var pe=de({getColumnOffset:function(e,t){return t*e.columnWidth},getColumnWidth:function(e,t){return e.columnWidth},getRowOffset:function(e,t){return t*e.rowHeight},getRowHeight:function(e,t){return e.rowHeight},getEstimatedTotalHeight:function(e){var t=e.rowCount;return e.rowHeight*t},getEstimatedTotalWidth:function(e){var t=e.columnCount;return e.columnWidth*t},getOffsetForColumnAndAlignment:function(e,t,n,r,o,i){var a=e.columnCount,l=e.columnWidth,s=e.width,c=Math.max(0,a*l-s),u=Math.min(c,t*l),d=Math.max(0,t*l-s+i+l);switch(n="smart"===n?d-s<=r&&r<=u+s?"auto":"center":n){case"start":return u;case"end":return d;case"center":var f=Math.round(d+(u-d)/2);return f<Math.ceil(s/2)?0:f>c+Math.floor(s/2)?c:f;default:return d<=r&&r<=u?r:u<d||r<d?d:u}},getOffsetForRowAndAlignment:function(e,t,n,r,o,i){var a=e.rowHeight,l=e.height,e=e.rowCount,s=Math.max(0,e*a-l),c=Math.min(s,t*a),u=Math.max(0,t*a-l+i+a);switch(n="smart"===n?u-l<=r&&r<=c+l?"auto":"center":n){case"start":return c;case"end":return u;case"center":var d=Math.round(u+(c-u)/2);return d<Math.ceil(l/2)?0:d>s+Math.floor(l/2)?s:d;default:return u<=r&&r<=c?r:c<u||r<u?u:c}},getColumnStartIndexForOffset:function(e,t){var n=e.columnWidth,e=e.columnCount;return Math.max(0,Math.min(e-1,Math.floor(t/n)))},getColumnStopIndexForStartIndex:function(e,t,n){var r=e.columnWidth,o=e.columnCount,e=e.width,e=Math.ceil((e+n-t*r)/r);return Math.max(0,Math.min(o-1,t+e-1))},getRowStartIndexForOffset:function(e,t){var n=e.rowHeight,e=e.rowCount;return Math.max(0,Math.min(e-1,Math.floor(t/n)))},getRowStopIndexForStartIndex:function(e,t,n){var r=e.rowHeight,o=e.rowCount,e=e.height,e=Math.ceil((e+n-t*r)/r);return Math.max(0,Math.min(o-1,t+e-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var t=e.columnWidth,e=e.rowHeight;if("production"!==process.env.NODE_ENV){if("number"!=typeof t)throw Error('An invalid "columnWidth" prop has been specified. Value should be a number. "'+(null===t?"null":typeof t)+'" was specified.');if("number"!=typeof e)throw Error('An invalid "rowHeight" prop has been specified. Value should be a number. "'+(null===e?"null":typeof e)+'" was specified.')}}}),me=function(e){var t=e.width,n=e.token,r=e.onClick,e=e.showTokenName,o={image:{borderRadius:"0.5rem"},wrapper:{position:"relative",display:"inline-block"},tokeName:{position:"absolute",top:"0.75rem",left:"0.75rem"}};return c.default.createElement("div",{style:o.wrapper},void 0!==e&&e&&c.default.createElement("div",{style:o.tokeName},n.name),c.default.createElement("img",i({width:t,height:"auto",src:n.image,alt:n.name,crossOrigin:"anonymous"},r?{onClick:r,style:u(u({},o.image),{},{cursor:"pointer"})}:{style:o.image})))},ge=function(e){var t=e.imageWidth,n=e.token,e=e.onClose,r={modal:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:9999,background:"rgb(25 25 25 / 80%)",display:"flex",justifyContent:"center",alignItems:"center"},content:{borderRadius:3,padding:"3rem",paddingTop:"2rem",background:"#523878"},attributes:{padding:"0 0 0 2rem"}};return c.default.createElement("div",{style:r.modal},c.default.createElement("div",{style:r.content},c.default.createElement("div",{style:{textAlign:"right",paddingBottom:"0.5rem"}},c.default.createElement("a",{href:"#",style:{textDecoration:"none",color:"white"},onClick:e},"Close")),c.default.createElement("h3",{style:{textAlign:"left"}},n.name),c.default.createElement("div",{style:{display:"flex"}},c.default.createElement(me,{width:t,token:n}),c.default.createElement("div",{style:r.attributes},c.default.createElement("h3",null,"Attributes"),c.default.createElement("ul",{style:{listStyle:"none",padding:0}},n.attributes.map(function(e){var t=e.trait_type,e=e.value;return c.default.createElement("li",{key:"".concat(t,":").concat(e)},t," - ",e)}))))))};return function(e){var t=e.tokens,n=e.GalleryLayout,r=e.FiltersLayout,o=e.TokensLayout,e=e.CurrentFiltersLayout,n=j(void 0===n?U:n),r=j(void 0===r?V:r),o=j(void 0===o?he:o),e=j(void 0===e?H:e);return c.default.createElement(s,{tokens:t},c.default.createElement(n,{FiltersLayout:r,TokensLayout:o,CurrentFiltersLayout:e}))}});
{
"name": "nft-collection-gallery",
"version": "0.2.3",
"version": "0.3.0",
"scripts": {

@@ -5,0 +5,0 @@ "storybook": "start-storybook -p 6006 -s public",

@@ -126,2 +126,10 @@ # NFT Collection Gallery

## Build
You have to run the commands to build the files locally for testing. To do so,
```bash
npm run build
```
## Linking

@@ -128,0 +136,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc