{"version":3,"sources":["webpack:///./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js","webpack:///./node_modules/react-photo-gallery/dist/react-photo-gallery.esm.js"],"names":["MapShim","Map","getIndex","arr","key","result","some","entry","index","class_1","this","__entries__","Object","defineProperty","prototype","get","length","enumerable","configurable","set","value","push","delete","entries","splice","has","clear","forEach","callback","ctx","_i","_a","call","isBrowser","window","document","global$1","global","Math","self","Function","requestAnimationFrame$1","requestAnimationFrame","bind","setTimeout","Date","now","transitionKeys","mutationObserverSupported","MutationObserver","ResizeObserverController","connected_","mutationEventsAdded_","mutationsObserver_","observers_","onTransitionEnd_","refresh","delay","leadingCall","trailingCall","lastCallTime","resolvePending","proxy","timeoutCallback","timeStamp","throttle","addObserver","observer","indexOf","connect_","removeObserver","observers","disconnect_","updateObservers_","activeObservers","filter","gatherActive","hasActive","broadcastActive","addEventListener","observe","attributes","childList","characterData","subtree","removeEventListener","disconnect","_b","propertyName","getInstance","instance_","defineConfigurable","target","props","keys","writable","getWindowOf","ownerDocument","defaultView","emptyRect","createRectInit","toFloat","parseFloat","getBordersSize","styles","positions","arguments","reduce","size","position","getHTMLElementContentRect","clientWidth","clientHeight","getComputedStyle","paddings","positions_1","getPaddings","horizPad","left","right","vertPad","top","bottom","width","height","boxSizing","round","documentElement","isDocumentElement","vertScrollbar","horizScrollbar","abs","isSVGGraphicsElement","SVGGraphicsElement","SVGElement","getBBox","getContentRect","bbox","getSVGContentRect","x","y","ResizeObservation","broadcastWidth","broadcastHeight","contentRect_","isActive","rect","broadcastRect","ResizeObserverEntry","rectInit","Constr","contentRect","DOMRectReadOnly","create","ResizeObserverSPI","controller","callbackCtx","activeObservations_","observations_","TypeError","callback_","controller_","callbackCtx_","Element","observations","unobserve","clearActive","_this","observation","map","WeakMap","ResizeObserver","method","apply","_defineProperty","obj","_extends","assign","i","source","hasOwnProperty","_objectSpread","ownKeys","getOwnPropertySymbols","concat","sym","getOwnPropertyDescriptor","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","_slicedToArray","Array","isArray","_arrayWithHoles","_arr","_n","_d","_e","undefined","_s","Symbol","iterator","next","done","err","_iterableToArrayLimit","_nonIterableRest","imgWithClick","cursor","Photo","_ref","onClick","photo","margin","direction","imgStyle","display","createElement","style","event","decimals","Number","ratio","BinaryHeap","scoreFunction","content","element","bubbleUp","pop","end","sinkDown","remove","node","n","score","parentN","floor","parent","elemScore","child2N","child1N","swap","child1","child1Score","child2","findShortestPath","graph","startNode","endNode","precedentsMap","nodes","reverse","getPathFromPrecedentsMap","visited","storedShortestPaths","pQueue","weight","id","shortestNode","shortestNodeId","neighboringNodes","neighbor","newTotalWeight","Error","buildPrecedentsMap","getCommonHeight","row","containerWidth","acc","cost","photos","j","targetHeight","slice","commonHeight","pow","computeRowLayout","limitNodeSearch","targetRowHeight","getNeighbors","start","results","toString","makeGetNeighbors","path","Gallery","memo","columns","renderImage","_useState2","setContainerWidth","galleryEl","animationFrameID","newWidth","current","cancelAnimationFrame","handleClick","_ref2","previous","ref","galleryStyle","thumbs","findIdealNodeSearch","flexWrap","flexDirection","colWidth","photosWithSizes","newHeight","colLeftPositions","colCurrTopPositions","smallestCol","item","tallestCol","containerHeight","computeColumnLayout","renderComponent","className","thumb","src","defaultProps"],"mappings":"4FAAA,0BAUIA,EAAU,WACZ,GAAmB,oBAARC,IACT,OAAOA,IAWT,SAASC,EAASC,EAAKC,GACrB,IAAIC,GAAU,EASd,OARAF,EAAIG,MAAK,SAAUC,EAAOC,GACxB,OAAID,EAAM,KAAOH,IACfC,EAASG,GACF,MAKJH,EAGT,OAAO,WACL,SAASI,IACPC,KAAKC,YAAc,GAwFrB,OArFAC,OAAOC,eAAeJ,EAAQK,UAAW,OAAQ,CAI/CC,IAAK,WACH,OAAOL,KAAKC,YAAYK,QAE1BC,YAAY,EACZC,cAAc,IAOhBT,EAAQK,UAAUC,IAAM,SAAUX,GAChC,IAAII,EAAQN,EAASQ,KAAK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GAE/D,OADA6F,EAAM2C,EAAOF,EAAoBzC,GAAO7F,EAAI6F,IAE3C,GAEH,OADAxD,EAAMqG,gBAAkBJ,EAAoBG,GACrCpG,KA0XEsG,CAAoB,CAC3B/C,eAAgBnJ,EAChBuK,QAASA,EACT1E,OAAQA,EACRyD,OAAQA,IAEV8B,EAAanL,OAASoL,EAAOA,EAAOhS,OAAS,GAAG4S,iBAGlD,IAAIE,EAAkB3B,GAAe/E,EACrC,OAAO,IAAMQ,cAAc,MAAO,CAChCmG,UAAW,gCACV,IAAMnG,cAAc,MAAO,CAC5BkF,IAAKR,EACLzE,MAAOkF,GACNC,EAAOvI,KAAI,SAAUuJ,EAAOxT,GAC7B,IAAI8G,EAAO0M,EAAM1M,KACbG,EAAMuM,EAAMvM,IACZmM,EAAkBI,EAAMJ,gBACxBrG,EAAQ5B,EAAyBqI,EAAO,CAAC,OAAQ,MAAO,oBAE5D,OAAOF,EAAgB,CACrBxM,KAAMA,EACNG,IAAKA,EACLrH,IAAK4T,EAAM5T,KAAO4T,EAAMC,IACxBL,gBAAiBA,EACjBpT,MAAOA,EACPgN,OAAQA,EACRC,UAAWA,EACXH,QAASA,EAAUqF,EAAc,KACjCpF,MAAOA,YAIbyE,EAAQkC,aAAe,CACrB1G,OAAQ,EACRC,UAAW,MACXgE,gBAAiB,KAEJ","file":"9d4d614634008eda54849ec251547e93cf1e7853-be2ba1e74931d5925266.js","sourcesContent":["import \"core-js/modules/es.array.reduce.js\";\n\n/**\r\n * A collection of shims that provide minimal functionality of the ES6 collections.\r\n *\r\n * These implementations are not meant to be used outside of the ResizeObserver\r\n * modules as they cover only a limited range of use cases.\r\n */\n\n/* eslint-disable require-jsdoc, valid-jsdoc */\nvar MapShim = function () {\n if (typeof Map !== 'undefined') {\n return Map;\n }\n /**\r\n * Returns index in provided array that matches the specified key.\r\n *\r\n * @param {Array} arr\r\n * @param {*} key\r\n * @returns {number}\r\n */\n\n\n function getIndex(arr, key) {\n var result = -1;\n arr.some(function (entry, index) {\n if (entry[0] === key) {\n result = index;\n return true;\n }\n\n return false;\n });\n return result;\n }\n\n return function () {\n function class_1() {\n this.__entries__ = [];\n }\n\n Object.defineProperty(class_1.prototype, \"size\", {\n /**\r\n * @returns {boolean}\r\n */\n get: function get() {\n return this.__entries__.length;\n },\n enumerable: true,\n configurable: true\n });\n /**\r\n * @param {*} key\r\n * @returns {*}\r\n */\n\n class_1.prototype.get = function (key) {\n var index = getIndex(this.__entries__, key);\n var entry = this.__entries__[index];\n return entry && entry[1];\n };\n /**\r\n * @param {*} key\r\n * @param {*} value\r\n * @returns {void}\r\n */\n\n\n class_1.prototype.set = function (key, value) {\n var index = getIndex(this.__entries__, key);\n\n if (~index) {\n this.__entries__[index][1] = value;\n } else {\n this.__entries__.push([key, value]);\n }\n };\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\n\n\n class_1.prototype.delete = function (key) {\n var entries = this.__entries__;\n var index = getIndex(entries, key);\n\n if (~index) {\n entries.splice(index, 1);\n }\n };\n /**\r\n * @param {*} key\r\n * @returns {void}\r\n */\n\n\n class_1.prototype.has = function (key) {\n return !!~getIndex(this.__entries__, key);\n };\n /**\r\n * @returns {void}\r\n */\n\n\n class_1.prototype.clear = function () {\n this.__entries__.splice(0);\n };\n /**\r\n * @param {Function} callback\r\n * @param {*} [ctx=null]\r\n * @returns {void}\r\n */\n\n\n class_1.prototype.forEach = function (callback, ctx) {\n if (ctx === void 0) {\n ctx = null;\n }\n\n for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {\n var entry = _a[_i];\n callback.call(ctx, entry[1], entry[0]);\n }\n };\n\n return class_1;\n }();\n}();\n/**\r\n * Detects whether window and document objects are available in current environment.\r\n */\n\n\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document; // Returns global object of a current environment.\n\nvar global$1 = function () {\n if (typeof global !== 'undefined' && global.Math === Math) {\n return global;\n }\n\n if (typeof self !== 'undefined' && self.Math === Math) {\n return self;\n }\n\n if (typeof window !== 'undefined' && window.Math === Math) {\n return window;\n } // eslint-disable-next-line no-new-func\n\n\n return Function('return this')();\n}();\n/**\r\n * A shim for the requestAnimationFrame which falls back to the setTimeout if\r\n * first one is not supported.\r\n *\r\n * @returns {number} Requests' identifier.\r\n */\n\n\nvar requestAnimationFrame$1 = function () {\n if (typeof requestAnimationFrame === 'function') {\n // It's required to use a bounded function because IE sometimes throws\n // an \"Invalid calling object\" error if rAF is invoked without the global\n // object on the left hand side.\n return requestAnimationFrame.bind(global$1);\n }\n\n return function (callback) {\n return setTimeout(function () {\n return callback(Date.now());\n }, 1000 / 60);\n };\n}(); // Defines minimum timeout before adding a trailing call.\n\n\nvar trailingTimeout = 2;\n/**\r\n * Creates a wrapper function which ensures that provided callback will be\r\n * invoked only once during the specified delay period.\r\n *\r\n * @param {Function} callback - Function to be invoked after the delay period.\r\n * @param {number} delay - Delay after which to invoke callback.\r\n * @returns {Function}\r\n */\n\nfunction throttle(callback, delay) {\n var leadingCall = false,\n trailingCall = false,\n lastCallTime = 0;\n /**\r\n * Invokes the original callback function and schedules new invocation if\r\n * the \"proxy\" was called during current request.\r\n *\r\n * @returns {void}\r\n */\n\n function resolvePending() {\n if (leadingCall) {\n leadingCall = false;\n callback();\n }\n\n if (trailingCall) {\n proxy();\n }\n }\n /**\r\n * Callback invoked after the specified delay. It will further postpone\r\n * invocation of the original function delegating it to the\r\n * requestAnimationFrame.\r\n *\r\n * @returns {void}\r\n */\n\n\n function timeoutCallback() {\n requestAnimationFrame$1(resolvePending);\n }\n /**\r\n * Schedules invocation of the original function.\r\n *\r\n * @returns {void}\r\n */\n\n\n function proxy() {\n var timeStamp = Date.now();\n\n if (leadingCall) {\n // Reject immediately following calls.\n if (timeStamp - lastCallTime < trailingTimeout) {\n return;\n } // Schedule new call to be in invoked when the pending one is resolved.\n // This is important for \"transitions\" which never actually start\n // immediately so there is a chance that we might miss one if change\n // happens amids the pending invocation.\n\n\n trailingCall = true;\n } else {\n leadingCall = true;\n trailingCall = false;\n setTimeout(timeoutCallback, delay);\n }\n\n lastCallTime = timeStamp;\n }\n\n return proxy;\n} // Minimum delay before invoking the update of observers.\n\n\nvar REFRESH_DELAY = 20; // A list of substrings of CSS properties used to find transition events that\n// might affect dimensions of observed elements.\n\nvar transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight']; // Check if MutationObserver is available.\n\nvar mutationObserverSupported = typeof MutationObserver !== 'undefined';\n/**\r\n * Singleton controller class which handles updates of ResizeObserver instances.\r\n */\n\nvar ResizeObserverController = function () {\n /**\r\n * Creates a new instance of ResizeObserverController.\r\n *\r\n * @private\r\n */\n function ResizeObserverController() {\n /**\r\n * Indicates whether DOM listeners have been added.\r\n *\r\n * @private {boolean}\r\n */\n this.connected_ = false;\n /**\r\n * Tells that controller has subscribed for Mutation Events.\r\n *\r\n * @private {boolean}\r\n */\n\n this.mutationEventsAdded_ = false;\n /**\r\n * Keeps reference to the instance of MutationObserver.\r\n *\r\n * @private {MutationObserver}\r\n */\n\n this.mutationsObserver_ = null;\n /**\r\n * A list of connected observers.\r\n *\r\n * @private {Array}\r\n */\n\n this.observers_ = [];\n this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);\n this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);\n }\n /**\r\n * Adds observer to observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be added.\r\n * @returns {void}\r\n */\n\n\n ResizeObserverController.prototype.addObserver = function (observer) {\n if (!~this.observers_.indexOf(observer)) {\n this.observers_.push(observer);\n } // Add listeners if they haven't been added yet.\n\n\n if (!this.connected_) {\n this.connect_();\n }\n };\n /**\r\n * Removes observer from observers list.\r\n *\r\n * @param {ResizeObserverSPI} observer - Observer to be removed.\r\n * @returns {void}\r\n */\n\n\n ResizeObserverController.prototype.removeObserver = function (observer) {\n var observers = this.observers_;\n var index = observers.indexOf(observer); // Remove observer if it's present in registry.\n\n if (~index) {\n observers.splice(index, 1);\n } // Remove listeners if controller has no connected observers.\n\n\n if (!observers.length && this.connected_) {\n this.disconnect_();\n }\n };\n /**\r\n * Invokes the update of observers. It will continue running updates insofar\r\n * it detects changes.\r\n *\r\n * @returns {void}\r\n */\n\n\n ResizeObserverController.prototype.refresh = function () {\n var changesDetected = this.updateObservers_(); // Continue running updates if changes have been detected as there might\n // be future ones caused by CSS transitions.\n\n if (changesDetected) {\n this.refresh();\n }\n };\n /**\r\n * Updates every observer from observers list and notifies them of queued\r\n * entries.\r\n *\r\n * @private\r\n * @returns {boolean} Returns \"true\" if any observer has detected changes in\r\n * dimensions of it's elements.\r\n */\n\n\n ResizeObserverController.prototype.updateObservers_ = function () {\n // Collect observers that have active observations.\n var activeObservers = this.observers_.filter(function (observer) {\n return observer.gatherActive(), observer.hasActive();\n }); // Deliver notifications in a separate cycle in order to avoid any\n // collisions between observers, e.g. when multiple instances of\n // ResizeObserver are tracking the same element and the callback of one\n // of them changes content dimensions of the observed target. Sometimes\n // this may result in notifications being blocked for the rest of observers.\n\n activeObservers.forEach(function (observer) {\n return observer.broadcastActive();\n });\n return activeObservers.length > 0;\n };\n /**\r\n * Initializes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\n\n\n ResizeObserverController.prototype.connect_ = function () {\n // Do nothing if running in a non-browser environment or if listeners\n // have been already added.\n if (!isBrowser || this.connected_) {\n return;\n } // Subscription to the \"Transitionend\" event is used as a workaround for\n // delayed transitions. This way it's possible to capture at least the\n // final state of an element.\n\n\n document.addEventListener('transitionend', this.onTransitionEnd_);\n window.addEventListener('resize', this.refresh);\n\n if (mutationObserverSupported) {\n this.mutationsObserver_ = new MutationObserver(this.refresh);\n this.mutationsObserver_.observe(document, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true\n });\n } else {\n document.addEventListener('DOMSubtreeModified', this.refresh);\n this.mutationEventsAdded_ = true;\n }\n\n this.connected_ = true;\n };\n /**\r\n * Removes DOM listeners.\r\n *\r\n * @private\r\n * @returns {void}\r\n */\n\n\n ResizeObserverController.prototype.disconnect_ = function () {\n // Do nothing if running in a non-browser environment or if listeners\n // have been already removed.\n if (!isBrowser || !this.connected_) {\n return;\n }\n\n document.removeEventListener('transitionend', this.onTransitionEnd_);\n window.removeEventListener('resize', this.refresh);\n\n if (this.mutationsObserver_) {\n this.mutationsObserver_.disconnect();\n }\n\n if (this.mutationEventsAdded_) {\n document.removeEventListener('DOMSubtreeModified', this.refresh);\n }\n\n this.mutationsObserver_ = null;\n this.mutationEventsAdded_ = false;\n this.connected_ = false;\n };\n /**\r\n * \"Transitionend\" event handler.\r\n *\r\n * @private\r\n * @param {TransitionEvent} event\r\n * @returns {void}\r\n */\n\n\n ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {\n var _b = _a.propertyName,\n propertyName = _b === void 0 ? '' : _b; // Detect whether transition may affect dimensions of an element.\n\n var isReflowProperty = transitionKeys.some(function (key) {\n return !!~propertyName.indexOf(key);\n });\n\n if (isReflowProperty) {\n this.refresh();\n }\n };\n /**\r\n * Returns instance of the ResizeObserverController.\r\n *\r\n * @returns {ResizeObserverController}\r\n */\n\n\n ResizeObserverController.getInstance = function () {\n if (!this.instance_) {\n this.instance_ = new ResizeObserverController();\n }\n\n return this.instance_;\n };\n /**\r\n * Holds reference to the controller's instance.\r\n *\r\n * @private {ResizeObserverController}\r\n */\n\n\n ResizeObserverController.instance_ = null;\n return ResizeObserverController;\n}();\n/**\r\n * Defines non-writable/enumerable properties of the provided target object.\r\n *\r\n * @param {Object} target - Object for which to define properties.\r\n * @param {Object} props - Properties to be defined.\r\n * @returns {Object} Target object.\r\n */\n\n\nvar defineConfigurable = function defineConfigurable(target, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var key = _a[_i];\n Object.defineProperty(target, key, {\n value: props[key],\n enumerable: false,\n writable: false,\n configurable: true\n });\n }\n\n return target;\n};\n/**\r\n * Returns the global object associated with provided element.\r\n *\r\n * @param {Object} target\r\n * @returns {Object}\r\n */\n\n\nvar getWindowOf = function getWindowOf(target) {\n // Assume that the element is an instance of Node, which means that it\n // has the \"ownerDocument\" property from which we can retrieve a\n // corresponding global object.\n var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView; // Return the local global object if it's not possible extract one from\n // provided element.\n\n return ownerGlobal || global$1;\n}; // Placeholder of an empty content rectangle.\n\n\nvar emptyRect = createRectInit(0, 0, 0, 0);\n/**\r\n * Converts provided string to a number.\r\n *\r\n * @param {number|string} value\r\n * @returns {number}\r\n */\n\nfunction toFloat(value) {\n return parseFloat(value) || 0;\n}\n/**\r\n * Extracts borders size from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @param {...string} positions - Borders positions (top, right, ...)\r\n * @returns {number}\r\n */\n\n\nfunction getBordersSize(styles) {\n var positions = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n positions[_i - 1] = arguments[_i];\n }\n\n return positions.reduce(function (size, position) {\n var value = styles['border-' + position + '-width'];\n return size + toFloat(value);\n }, 0);\n}\n/**\r\n * Extracts paddings sizes from provided styles.\r\n *\r\n * @param {CSSStyleDeclaration} styles\r\n * @returns {Object} Paddings box.\r\n */\n\n\nfunction getPaddings(styles) {\n var positions = ['top', 'right', 'bottom', 'left'];\n var paddings = {};\n\n for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {\n var position = positions_1[_i];\n var value = styles['padding-' + position];\n paddings[position] = toFloat(value);\n }\n\n return paddings;\n}\n/**\r\n * Calculates content rectangle of provided SVG element.\r\n *\r\n * @param {SVGGraphicsElement} target - Element content rectangle of which needs\r\n * to be calculated.\r\n * @returns {DOMRectInit}\r\n */\n\n\nfunction getSVGContentRect(target) {\n var bbox = target.getBBox();\n return createRectInit(0, 0, bbox.width, bbox.height);\n}\n/**\r\n * Calculates content rectangle of provided HTMLElement.\r\n *\r\n * @param {HTMLElement} target - Element for which to calculate the content rectangle.\r\n * @returns {DOMRectInit}\r\n */\n\n\nfunction getHTMLElementContentRect(target) {\n // Client width & height properties can't be\n // used exclusively as they provide rounded values.\n var clientWidth = target.clientWidth,\n clientHeight = target.clientHeight; // By this condition we can catch all non-replaced inline, hidden and\n // detached elements. Though elements with width & height properties less\n // than 0.5 will be discarded as well.\n //\n // Without it we would need to implement separate methods for each of\n // those cases and it's not possible to perform a precise and performance\n // effective test for hidden elements. E.g. even jQuery's ':visible' filter\n // gives wrong results for elements with width & height less than 0.5.\n\n if (!clientWidth && !clientHeight) {\n return emptyRect;\n }\n\n var styles = getWindowOf(target).getComputedStyle(target);\n var paddings = getPaddings(styles);\n var horizPad = paddings.left + paddings.right;\n var vertPad = paddings.top + paddings.bottom; // Computed styles of width & height are being used because they are the\n // only dimensions available to JS that contain non-rounded values. It could\n // be possible to utilize the getBoundingClientRect if only it's data wasn't\n // affected by CSS transformations let alone paddings, borders and scroll bars.\n\n var width = toFloat(styles.width),\n height = toFloat(styles.height); // Width & height include paddings and borders when the 'border-box' box\n // model is applied (except for IE).\n\n if (styles.boxSizing === 'border-box') {\n // Following conditions are required to handle Internet Explorer which\n // doesn't include paddings and borders to computed CSS dimensions.\n //\n // We can say that if CSS dimensions + paddings are equal to the \"client\"\n // properties then it's either IE, and thus we don't need to subtract\n // anything, or an element merely doesn't have paddings/borders styles.\n if (Math.round(width + horizPad) !== clientWidth) {\n width -= getBordersSize(styles, 'left', 'right') + horizPad;\n }\n\n if (Math.round(height + vertPad) !== clientHeight) {\n height -= getBordersSize(styles, 'top', 'bottom') + vertPad;\n }\n } // Following steps can't be applied to the document's root element as its\n // client[Width/Height] properties represent viewport area of the window.\n // Besides, it's as well not necessary as the itself neither has\n // rendered scroll bars nor it can be clipped.\n\n\n if (!isDocumentElement(target)) {\n // In some browsers (only in Firefox, actually) CSS width & height\n // include scroll bars size which can be removed at this step as scroll\n // bars are the only difference between rounded dimensions + paddings\n // and \"client\" properties, though that is not always true in Chrome.\n var vertScrollbar = Math.round(width + horizPad) - clientWidth;\n var horizScrollbar = Math.round(height + vertPad) - clientHeight; // Chrome has a rather weird rounding of \"client\" properties.\n // E.g. for an element with content width of 314.2px it sometimes gives\n // the client width of 315px and for the width of 314.7px it may give\n // 314px. And it doesn't happen all the time. So just ignore this delta\n // as a non-relevant.\n\n if (Math.abs(vertScrollbar) !== 1) {\n width -= vertScrollbar;\n }\n\n if (Math.abs(horizScrollbar) !== 1) {\n height -= horizScrollbar;\n }\n }\n\n return createRectInit(paddings.left, paddings.top, width, height);\n}\n/**\r\n * Checks whether provided element is an instance of the SVGGraphicsElement.\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\n\n\nvar isSVGGraphicsElement = function () {\n // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement\n // interface.\n if (typeof SVGGraphicsElement !== 'undefined') {\n return function (target) {\n return target instanceof getWindowOf(target).SVGGraphicsElement;\n };\n } // If it's so, then check that element is at least an instance of the\n // SVGElement and that it has the \"getBBox\" method.\n // eslint-disable-next-line no-extra-parens\n\n\n return function (target) {\n return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === 'function';\n };\n}();\n/**\r\n * Checks whether provided element is a document element ().\r\n *\r\n * @param {Element} target - Element to be checked.\r\n * @returns {boolean}\r\n */\n\n\nfunction isDocumentElement(target) {\n return target === getWindowOf(target).document.documentElement;\n}\n/**\r\n * Calculates an appropriate content rectangle for provided html or svg element.\r\n *\r\n * @param {Element} target - Element content rectangle of which needs to be calculated.\r\n * @returns {DOMRectInit}\r\n */\n\n\nfunction getContentRect(target) {\n if (!isBrowser) {\n return emptyRect;\n }\n\n if (isSVGGraphicsElement(target)) {\n return getSVGContentRect(target);\n }\n\n return getHTMLElementContentRect(target);\n}\n/**\r\n * Creates rectangle with an interface of the DOMRectReadOnly.\r\n * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly\r\n *\r\n * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.\r\n * @returns {DOMRectReadOnly}\r\n */\n\n\nfunction createReadOnlyRect(_a) {\n var x = _a.x,\n y = _a.y,\n width = _a.width,\n height = _a.height; // If DOMRectReadOnly is available use it as a prototype for the rectangle.\n\n var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;\n var rect = Object.create(Constr.prototype); // Rectangle's properties are not writable and non-enumerable.\n\n defineConfigurable(rect, {\n x: x,\n y: y,\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: height + y,\n left: x\n });\n return rect;\n}\n/**\r\n * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.\r\n * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit\r\n *\r\n * @param {number} x - X coordinate.\r\n * @param {number} y - Y coordinate.\r\n * @param {number} width - Rectangle's width.\r\n * @param {number} height - Rectangle's height.\r\n * @returns {DOMRectInit}\r\n */\n\n\nfunction createRectInit(x, y, width, height) {\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n}\n/**\r\n * Class that is responsible for computations of the content rectangle of\r\n * provided DOM element and for keeping track of it's changes.\r\n */\n\n\nvar ResizeObservation = function () {\n /**\r\n * Creates an instance of ResizeObservation.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n */\n function ResizeObservation(target) {\n /**\r\n * Broadcasted width of content rectangle.\r\n *\r\n * @type {number}\r\n */\n this.broadcastWidth = 0;\n /**\r\n * Broadcasted height of content rectangle.\r\n *\r\n * @type {number}\r\n */\n\n this.broadcastHeight = 0;\n /**\r\n * Reference to the last observed content rectangle.\r\n *\r\n * @private {DOMRectInit}\r\n */\n\n this.contentRect_ = createRectInit(0, 0, 0, 0);\n this.target = target;\n }\n /**\r\n * Updates content rectangle and tells whether it's width or height properties\r\n * have changed since the last broadcast.\r\n *\r\n * @returns {boolean}\r\n */\n\n\n ResizeObservation.prototype.isActive = function () {\n var rect = getContentRect(this.target);\n this.contentRect_ = rect;\n return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;\n };\n /**\r\n * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data\r\n * from the corresponding properties of the last observed content rectangle.\r\n *\r\n * @returns {DOMRectInit} Last observed content rectangle.\r\n */\n\n\n ResizeObservation.prototype.broadcastRect = function () {\n var rect = this.contentRect_;\n this.broadcastWidth = rect.width;\n this.broadcastHeight = rect.height;\n return rect;\n };\n\n return ResizeObservation;\n}();\n\nvar ResizeObserverEntry = function () {\n /**\r\n * Creates an instance of ResizeObserverEntry.\r\n *\r\n * @param {Element} target - Element that is being observed.\r\n * @param {DOMRectInit} rectInit - Data of the element's content rectangle.\r\n */\n function ResizeObserverEntry(target, rectInit) {\n var contentRect = createReadOnlyRect(rectInit); // According to the specification following properties are not writable\n // and are also not enumerable in the native implementation.\n //\n // Property accessors are not being used as they'd require to define a\n // private WeakMap storage which may cause memory leaks in browsers that\n // don't support this type of collections.\n\n defineConfigurable(this, {\n target: target,\n contentRect: contentRect\n });\n }\n\n return ResizeObserverEntry;\n}();\n\nvar ResizeObserverSPI = function () {\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback function that is invoked\r\n * when one of the observed elements changes it's content dimensions.\r\n * @param {ResizeObserverController} controller - Controller instance which\r\n * is responsible for the updates of observer.\r\n * @param {ResizeObserver} callbackCtx - Reference to the public\r\n * ResizeObserver instance which will be passed to callback function.\r\n */\n function ResizeObserverSPI(callback, controller, callbackCtx) {\n /**\r\n * Collection of resize observations that have detected changes in dimensions\r\n * of elements.\r\n *\r\n * @private {Array}\r\n */\n this.activeObservations_ = [];\n /**\r\n * Registry of the ResizeObservation instances.\r\n *\r\n * @private {Map}\r\n */\n\n this.observations_ = new MapShim();\n\n if (typeof callback !== 'function') {\n throw new TypeError('The callback provided as parameter 1 is not a function.');\n }\n\n this.callback_ = callback;\n this.controller_ = controller;\n this.callbackCtx_ = callbackCtx;\n }\n /**\r\n * Starts observing provided element.\r\n *\r\n * @param {Element} target - Element to be observed.\r\n * @returns {void}\r\n */\n\n\n ResizeObserverSPI.prototype.observe = function (target) {\n if (!arguments.length) {\n throw new TypeError('1 argument required, but only 0 present.');\n } // Do nothing if current environment doesn't have the Element interface.\n\n\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\n return;\n }\n\n if (!(target instanceof getWindowOf(target).Element)) {\n throw new TypeError('parameter 1 is not of type \"Element\".');\n }\n\n var observations = this.observations_; // Do nothing if element is already being observed.\n\n if (observations.has(target)) {\n return;\n }\n\n observations.set(target, new ResizeObservation(target));\n this.controller_.addObserver(this); // Force the update of observations.\n\n this.controller_.refresh();\n };\n /**\r\n * Stops observing provided element.\r\n *\r\n * @param {Element} target - Element to stop observing.\r\n * @returns {void}\r\n */\n\n\n ResizeObserverSPI.prototype.unobserve = function (target) {\n if (!arguments.length) {\n throw new TypeError('1 argument required, but only 0 present.');\n } // Do nothing if current environment doesn't have the Element interface.\n\n\n if (typeof Element === 'undefined' || !(Element instanceof Object)) {\n return;\n }\n\n if (!(target instanceof getWindowOf(target).Element)) {\n throw new TypeError('parameter 1 is not of type \"Element\".');\n }\n\n var observations = this.observations_; // Do nothing if element is not being observed.\n\n if (!observations.has(target)) {\n return;\n }\n\n observations.delete(target);\n\n if (!observations.size) {\n this.controller_.removeObserver(this);\n }\n };\n /**\r\n * Stops observing all elements.\r\n *\r\n * @returns {void}\r\n */\n\n\n ResizeObserverSPI.prototype.disconnect = function () {\n this.clearActive();\n this.observations_.clear();\n this.controller_.removeObserver(this);\n };\n /**\r\n * Collects observation instances the associated element of which has changed\r\n * it's content rectangle.\r\n *\r\n * @returns {void}\r\n */\n\n\n ResizeObserverSPI.prototype.gatherActive = function () {\n var _this = this;\n\n this.clearActive();\n this.observations_.forEach(function (observation) {\n if (observation.isActive()) {\n _this.activeObservations_.push(observation);\n }\n });\n };\n /**\r\n * Invokes initial callback function with a list of ResizeObserverEntry\r\n * instances collected from active resize observations.\r\n *\r\n * @returns {void}\r\n */\n\n\n ResizeObserverSPI.prototype.broadcastActive = function () {\n // Do nothing if observer doesn't have active observations.\n if (!this.hasActive()) {\n return;\n }\n\n var ctx = this.callbackCtx_; // Create ResizeObserverEntry instance for every active observation.\n\n var entries = this.activeObservations_.map(function (observation) {\n return new ResizeObserverEntry(observation.target, observation.broadcastRect());\n });\n this.callback_.call(ctx, entries, ctx);\n this.clearActive();\n };\n /**\r\n * Clears the collection of active observations.\r\n *\r\n * @returns {void}\r\n */\n\n\n ResizeObserverSPI.prototype.clearActive = function () {\n this.activeObservations_.splice(0);\n };\n /**\r\n * Tells whether observer has active observations.\r\n *\r\n * @returns {boolean}\r\n */\n\n\n ResizeObserverSPI.prototype.hasActive = function () {\n return this.activeObservations_.length > 0;\n };\n\n return ResizeObserverSPI;\n}(); // Registry of internal observers. If WeakMap is not available use current shim\n// for the Map collection as it has all required methods and because WeakMap\n// can't be fully polyfilled anyway.\n\n\nvar observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();\n/**\r\n * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation\r\n * exposing only those methods and properties that are defined in the spec.\r\n */\n\nvar ResizeObserver = function () {\n /**\r\n * Creates a new instance of ResizeObserver.\r\n *\r\n * @param {ResizeObserverCallback} callback - Callback that is invoked when\r\n * dimensions of the observed elements change.\r\n */\n function ResizeObserver(callback) {\n if (!(this instanceof ResizeObserver)) {\n throw new TypeError('Cannot call a class as a function.');\n }\n\n if (!arguments.length) {\n throw new TypeError('1 argument required, but only 0 present.');\n }\n\n var controller = ResizeObserverController.getInstance();\n var observer = new ResizeObserverSPI(callback, controller, this);\n observers.set(this, observer);\n }\n\n return ResizeObserver;\n}(); // Expose public methods of ResizeObserver.\n\n\n['observe', 'unobserve', 'disconnect'].forEach(function (method) {\n ResizeObserver.prototype[method] = function () {\n var _a;\n\n return (_a = observers.get(this))[method].apply(_a, arguments);\n };\n});\n\nvar index = function () {\n // Export existing implementation if available.\n if (typeof global$1.ResizeObserver !== 'undefined') {\n return global$1.ResizeObserver;\n }\n\n return ResizeObserver;\n}();\n\nexport default index;","import \"core-js/modules/es.array.reduce.js\";\nimport React, { useState, useRef, useLayoutEffect } from 'react';\nimport ResizeObserver from 'resize-observer-polyfill';\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nvar imgWithClick = {\n cursor: 'pointer'\n};\n\nvar Photo = function Photo(_ref) {\n var index = _ref.index,\n onClick = _ref.onClick,\n photo = _ref.photo,\n margin = _ref.margin,\n direction = _ref.direction,\n top = _ref.top,\n left = _ref.left,\n key = _ref.key;\n var imgStyle = {\n margin: margin,\n display: 'block'\n };\n\n if (direction === 'column') {\n imgStyle.position = 'absolute';\n imgStyle.left = left;\n imgStyle.top = top;\n }\n\n var handleClick = function handleClick(event) {\n onClick(event, {\n photo: photo,\n index: index\n });\n };\n\n return React.createElement(\"img\", _extends({\n key: key,\n style: onClick ? _objectSpread({}, imgStyle, imgWithClick) : imgStyle\n }, photo, {\n onClick: onClick ? handleClick : null\n }));\n};\n\nvar round = function round(value, decimals) {\n if (!decimals) decimals = 0;\n return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);\n};\n\nvar computeColumnLayout = function computeColumnLayout(_ref) {\n var photos = _ref.photos,\n columns = _ref.columns,\n containerWidth = _ref.containerWidth,\n margin = _ref.margin; // calculate each colWidth based on total width and column amount\n\n var colWidth = (containerWidth - margin * 2 * columns) / columns; // map through each photo to assign adjusted height and width based on colWidth\n\n var photosWithSizes = photos.map(function (photo) {\n var newHeight = photo.height / photo.width * colWidth;\n return _objectSpread({}, photo, {\n width: round(colWidth, 1),\n height: round(newHeight, 1)\n });\n }); // store all possible left positions\n // and current top positions for each column\n\n var colLeftPositions = [];\n var colCurrTopPositions = [];\n\n for (var i = 0; i < columns; i++) {\n colLeftPositions[i] = round(i * (colWidth + margin * 2), 1);\n colCurrTopPositions[i] = 0;\n } // map through each photo, then reduce thru each \"column\"\n // find column with the smallest height and assign to photo's 'top'\n // update that column's height with this photo's height\n\n\n var photosPositioned = photosWithSizes.map(function (photo) {\n var smallestCol = colCurrTopPositions.reduce(function (acc, item, i) {\n acc = item < colCurrTopPositions[acc] ? i : acc;\n return acc;\n }, 0);\n photo.top = colCurrTopPositions[smallestCol];\n photo.left = colLeftPositions[smallestCol];\n colCurrTopPositions[smallestCol] = colCurrTopPositions[smallestCol] + photo.height + margin * 2; // store the tallest col to use for gallery height because of abs positioned elements\n\n var tallestCol = colCurrTopPositions.reduce(function (acc, item, i) {\n acc = item > colCurrTopPositions[acc] ? i : acc;\n return acc;\n }, 0);\n photo.containerHeight = colCurrTopPositions[tallestCol];\n return photo;\n });\n return photosPositioned;\n};\n\nvar ratio = function ratio(_ref) {\n var width = _ref.width,\n height = _ref.height;\n return round(width / height, 2);\n};\n/*\nCopyright 2007-2013 Marijn Haverbeke frin \"Eloquent Javascript, 1st Edition\"\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n\n\nfunction BinaryHeap(scoreFunction) {\n this.content = [];\n this.scoreFunction = scoreFunction;\n}\n\nBinaryHeap.prototype = {\n push: function push(element) {\n // Add the new element to the end of the array.\n this.content.push(element); // Allow it to bubble up.\n\n this.bubbleUp(this.content.length - 1);\n },\n pop: function pop() {\n // Store the first element so we can return it later.\n var result = this.content[0]; // Get the element at the end of the array.\n\n var end = this.content.pop(); // If there are any elements left, put the end element at the\n // start, and let it sink down.\n\n if (this.content.length > 0) {\n this.content[0] = end;\n this.sinkDown(0);\n }\n\n return result;\n },\n remove: function remove(node) {\n var length = this.content.length; // To remove a value, we must search through the array to find\n // it.\n\n for (var i = 0; i < length; i++) {\n if (this.content[i] != node) continue; // When it is found, the process seen in 'pop' is repeated\n // to fill up the hole.\n\n var end = this.content.pop(); // If the element we popped was the one we needed to remove,\n // we're done.\n\n if (i == length - 1) break; // Otherwise, we replace the removed element with the popped\n // one, and allow it to float up or sink down as appropriate.\n\n this.content[i] = end;\n this.bubbleUp(i);\n this.sinkDown(i);\n break;\n }\n },\n size: function size() {\n return this.content.length;\n },\n bubbleUp: function bubbleUp(n) {\n // Fetch the element that has to be moved.\n var element = this.content[n],\n score = this.scoreFunction(element); // When at 0, an element can not go up any further.\n\n while (n > 0) {\n // Compute the parent element's index, and fetch it.\n var parentN = Math.floor((n + 1) / 2) - 1,\n parent = this.content[parentN]; // If the parent has a lesser score, things are in order and we\n // are done.\n\n if (score >= this.scoreFunction(parent)) break; // Otherwise, swap the parent with the current element and\n // continue.\n\n this.content[parentN] = element;\n this.content[n] = parent;\n n = parentN;\n }\n },\n sinkDown: function sinkDown(n) {\n // Look up the target element and its score.\n var length = this.content.length,\n element = this.content[n],\n elemScore = this.scoreFunction(element);\n\n while (true) {\n // Compute the indices of the child elements.\n var child2N = (n + 1) * 2,\n child1N = child2N - 1; // This is used to store the new position of the element,\n // if any.\n\n var swap = null; // If the first child exists (is inside the array)...\n\n if (child1N < length) {\n // Look it up and compute its score.\n var child1 = this.content[child1N],\n child1Score = this.scoreFunction(child1); // If the score is less than our element's, we need to swap.\n\n if (child1Score < elemScore) swap = child1N;\n } // Do the same checks for the other child.\n\n\n if (child2N < length) {\n var child2 = this.content[child2N],\n child2Score = this.scoreFunction(child2);\n if (child2Score < (swap == null ? elemScore : child1Score)) swap = child2N;\n } // No need to swap further, we are done.\n\n\n if (swap == null) break; // Otherwise, swap and continue.\n\n this.content[n] = this.content[swap];\n this.content[swap] = element;\n n = swap;\n }\n }\n};\n\nvar buildPrecedentsMap = function buildPrecedentsMap(graph, startNode, endNode) {\n // store the previous vertex of the shortest path of arrival\n var precedentsMap = {}; // store nodes already visited\n\n var visited = {}; // store/update only the shortest edge weights measured\n // the purpose of this is object is constant time lookup vs. binary heap lookup O(n)\n\n var storedShortestPaths = {};\n storedShortestPaths[startNode] = 0; // priority queue of ALL nodes and storedShortestPaths\n // don't bother to delete them because it's faster to look at visited?\n\n var pQueue = new BinaryHeap(function (n) {\n return n.weight;\n });\n pQueue.push({\n id: startNode,\n weight: 0\n });\n\n while (pQueue.size()) {\n // pop node with shortest total weight from start node\n var shortestNode = pQueue.pop();\n var shortestNodeId = shortestNode.id; // if already visited, continue\n\n if (visited[shortestNodeId]) continue; // visit neighboring nodes\n\n var neighboringNodes = graph(shortestNodeId) || {};\n visited[shortestNodeId] = 1; // meet the neighbors, looking for shorter paths\n\n for (var neighbor in neighboringNodes) {\n // weight of path from startNode to this neighbor\n var newTotalWeight = shortestNode.weight + neighboringNodes[neighbor]; // if this is the first time meeting the neighbor OR if the new total weight from\n // start node to this neighbor node is greater than the old weight path, update it,\n // and update precedent node\n\n if (typeof storedShortestPaths[neighbor] === 'undefined' || storedShortestPaths[neighbor] > newTotalWeight) {\n storedShortestPaths[neighbor] = newTotalWeight;\n pQueue.push({\n id: neighbor,\n weight: newTotalWeight\n });\n precedentsMap[neighbor] = shortestNodeId;\n }\n }\n }\n\n if (typeof storedShortestPaths[endNode] === 'undefined') {\n throw new Error(\"There is no path from \".concat(startNode, \" to \").concat(endNode));\n }\n\n return precedentsMap;\n}; // build the route from precedent node vertices\n\n\nvar getPathFromPrecedentsMap = function getPathFromPrecedentsMap(precedentsMap, endNode) {\n var nodes = [];\n var n = endNode;\n var precedent;\n\n while (n) {\n nodes.push(n);\n precedent = precedentsMap[n];\n n = precedentsMap[n];\n }\n\n return nodes.reverse();\n}; // build the precedentsMap and find the shortest path from it\n\n\nvar findShortestPath = function findShortestPath(graph, startNode, endNode) {\n var precedentsMap = buildPrecedentsMap(graph, startNode, endNode);\n return getPathFromPrecedentsMap(precedentsMap, endNode);\n}; // to calculate the single best layout using Dijkstra's findShortestPat\n// get the height for a set of photos in a potential row\n\n\nvar getCommonHeight = function getCommonHeight(row, containerWidth, margin) {\n var rowWidth = containerWidth - row.length * (margin * 2);\n var totalAspectRatio = row.reduce(function (acc, photo) {\n return acc + ratio(photo);\n }, 0);\n return rowWidth / totalAspectRatio;\n}; // calculate the cost of breaking at this node (edge weight)\n\n\nvar cost = function cost(photos, i, j, width, targetHeight, margin) {\n var row = photos.slice(i, j);\n var commonHeight = getCommonHeight(row, width, margin);\n return Math.pow(Math.abs(commonHeight - targetHeight), 2);\n}; // return function that gets the neighboring nodes of node and returns costs\n\n\nvar makeGetNeighbors = function makeGetNeighbors(targetHeight, containerWidth, photos, limitNodeSearch, margin) {\n return function (start) {\n var results = {};\n start = +start;\n results[+start] = 0;\n\n for (var i = start + 1; i < photos.length + 1; ++i) {\n if (i - start > limitNodeSearch) break;\n results[i.toString()] = cost(photos, start, i, containerWidth, targetHeight, margin);\n }\n\n return results;\n };\n};\n\nvar computeRowLayout = function computeRowLayout(_ref) {\n var containerWidth = _ref.containerWidth,\n limitNodeSearch = _ref.limitNodeSearch,\n targetRowHeight = _ref.targetRowHeight,\n margin = _ref.margin,\n photos = _ref.photos; // const t = +new Date();\n\n var getNeighbors = makeGetNeighbors(targetRowHeight, containerWidth, photos, limitNodeSearch, margin);\n var path = findShortestPath(getNeighbors, '0', photos.length);\n path = path.map(function (node) {\n return +node;\n }); // console.log(`time to find the shortest path: ${(+new Date() - t)} ms`);\n\n for (var i = 1; i < path.length; ++i) {\n var row = photos.slice(path[i - 1], path[i]);\n var height = getCommonHeight(row, containerWidth, margin);\n\n for (var j = path[i - 1]; j < path[i]; ++j) {\n photos[j].width = round(height * ratio(photos[j]), 1);\n photos[j].height = height;\n }\n }\n\n return photos;\n}; // the aspect ratio of the container with images having an avg AR of 1.5\n// as the minimum amount of photos per row, plus some nodes\n\n\nvar findIdealNodeSearch = function findIdealNodeSearch(_ref) {\n var targetRowHeight = _ref.targetRowHeight,\n containerWidth = _ref.containerWidth;\n var rowAR = containerWidth / targetRowHeight;\n return round(rowAR / 1.5) + 8;\n};\n\nvar Gallery = React.memo(function Gallery(_ref) {\n var photos = _ref.photos,\n onClick = _ref.onClick,\n direction = _ref.direction,\n margin = _ref.margin,\n limitNodeSearch = _ref.limitNodeSearch,\n targetRowHeight = _ref.targetRowHeight,\n columns = _ref.columns,\n renderImage = _ref.renderImage;\n\n var _useState = useState(0),\n _useState2 = _slicedToArray(_useState, 2),\n containerWidth = _useState2[0],\n setContainerWidth = _useState2[1];\n\n var galleryEl = useRef(null);\n useLayoutEffect(function () {\n var animationFrameID = null;\n var observer = new ResizeObserver(function (entries) {\n // only do something if width changes\n var newWidth = entries[0].contentRect.width;\n\n if (containerWidth !== newWidth) {\n // put in an animation frame to stop \"benign errors\" from\n // ResizObserver https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n animationFrameID = window.requestAnimationFrame(function () {\n setContainerWidth(Math.floor(newWidth));\n });\n }\n });\n observer.observe(galleryEl.current);\n return function () {\n observer.disconnect();\n window.cancelAnimationFrame(animationFrameID);\n };\n });\n\n var handleClick = function handleClick(event, _ref2) {\n var index = _ref2.index;\n onClick(event, {\n index: index,\n photo: photos[index],\n previous: photos[index - 1] || null,\n next: photos[index + 1] || null\n });\n }; // no containerWidth until after first render with refs, skip calculations and render nothing\n\n\n if (!containerWidth) return React.createElement(\"div\", {\n ref: galleryEl\n }, \"\\xA0\"); // subtract 1 pixel because the browser may round up a pixel\n\n var width = containerWidth - 1;\n var galleryStyle, thumbs;\n\n if (direction === 'row') {\n // allow user to calculate limitNodeSearch from containerWidth\n if (typeof limitNodeSearch === 'function') {\n limitNodeSearch = limitNodeSearch(containerWidth);\n }\n\n if (typeof targetRowHeight === 'function') {\n targetRowHeight = targetRowHeight(containerWidth);\n } // set how many neighboring nodes the graph will visit\n\n\n if (limitNodeSearch === undefined) {\n limitNodeSearch = 2;\n\n if (containerWidth >= 450) {\n limitNodeSearch = findIdealNodeSearch({\n containerWidth: containerWidth,\n targetRowHeight: targetRowHeight\n });\n }\n }\n\n galleryStyle = {\n display: 'flex',\n flexWrap: 'wrap',\n flexDirection: 'row'\n };\n thumbs = computeRowLayout({\n containerWidth: width,\n limitNodeSearch: limitNodeSearch,\n targetRowHeight: targetRowHeight,\n margin: margin,\n photos: photos\n });\n }\n\n if (direction === 'column') {\n // allow user to calculate columns from containerWidth\n if (typeof columns === 'function') {\n columns = columns(containerWidth);\n } // set default breakpoints if user doesn't specify columns prop\n\n\n if (columns === undefined) {\n columns = 1;\n if (containerWidth >= 500) columns = 2;\n if (containerWidth >= 900) columns = 3;\n if (containerWidth >= 1500) columns = 4;\n }\n\n galleryStyle = {\n position: 'relative'\n };\n thumbs = computeColumnLayout({\n containerWidth: width,\n columns: columns,\n margin: margin,\n photos: photos\n });\n galleryStyle.height = thumbs[thumbs.length - 1].containerHeight;\n }\n\n var renderComponent = renderImage || Photo;\n return React.createElement(\"div\", {\n className: \"react-photo-gallery--gallery\"\n }, React.createElement(\"div\", {\n ref: galleryEl,\n style: galleryStyle\n }, thumbs.map(function (thumb, index) {\n var left = thumb.left,\n top = thumb.top,\n containerHeight = thumb.containerHeight,\n photo = _objectWithoutProperties(thumb, [\"left\", \"top\", \"containerHeight\"]);\n\n return renderComponent({\n left: left,\n top: top,\n key: thumb.key || thumb.src,\n containerHeight: containerHeight,\n index: index,\n margin: margin,\n direction: direction,\n onClick: onClick ? handleClick : null,\n photo: photo\n });\n })));\n});\nGallery.defaultProps = {\n margin: 2,\n direction: 'row',\n targetRowHeight: 300\n};\nexport default Gallery;\nexport { Photo };"],"sourceRoot":""}