1 | {"version":3,"file":"infinitegrid.esm.js","sources":["../src/consts.ts","../src/InfiniteGridItem.ts","../src/LoadingGrid.ts","../src/utils.ts","../src/GroupManager.ts","../src/Infinite.ts","../src/Renderer/Renderer.ts","../src/Renderer/VanillaRenderer.ts","../src/Renderer/VanillaGridRenderer.ts","../src/ScrollManager.ts","../src/InfiniteGrid.ts","../src/grids/MasonryInfiniteGrid.ts","../src/grids/JustifiedInfiniteGrid.ts","../src/grids/FrameInfiniteGrid.ts","../src/grids/PackingInfiniteGrid.ts"],"sourcesContent":["import { GRID_PROPERTY_TYPES } from \"@egjs/grid\";\nimport { InfiniteGridItemInfo } from \"./types\";\n\nconst ua = typeof window !== \"undefined\" ? window.navigator.userAgent : \"\";\n\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const CONTAINER_CLASS_NAME = \"infinitegrid-container\";\nexport const IGNORE_PROPERITES_MAP = {\n renderOnPropertyChange: true,\n useFit: true,\n autoResize: true,\n} as const;\n\n\nexport const INFINITEGRID_PROPERTY_TYPES = {\n ...GRID_PROPERTY_TYPES,\n};\n\nexport const DIRECTION = {\n START: \"start\",\n END: \"end\",\n NONE: \"\",\n} as const;\n\nexport const INFINITEGRID_EVENTS = {\n CHANGE_SCROLL: \"changeScroll\",\n REQUEST_APPEND: \"requestAppend\",\n REQUEST_PREPEND: \"requestPrepend\",\n RENDER_COMPLETE: \"renderComplete\",\n CONTENT_ERROR: \"contentError\",\n} as const;\n\nexport const ITEM_INFO_PROPERTIES: Record<keyof InfiniteGridItemInfo, true> = {\n type: true,\n groupKey: true,\n key: true,\n element: true,\n html: true,\n data: true,\n inserted: true,\n attributes: true,\n};\n\n\nexport const INFINITEGRID_METHODS = [\n \"insertByGroupIndex\",\n \"updateItems\",\n \"getItems\",\n \"getVisibleItems\",\n \"getGroups\",\n \"getVisibleGroups\",\n \"renderItems\",\n \"getContainerElement\",\n \"getScrollContainerElement\",\n \"getWrapperElement\",\n \"setStatus\",\n \"getStatus\",\n \"removePlaceholders\",\n \"prependPlaceholders\",\n \"appendPlaceholders\",\n \"getStartCursor\",\n \"getEndCursor\",\n \"setCursors\",\n] as const;\n\n\nexport enum GROUP_TYPE {\n NORMAL = 0,\n VIRTUAL = 1,\n LOADING = 2,\n}\n\nexport enum ITEM_TYPE {\n NORMAL = 0,\n VIRTUAL = 1,\n LOADING = 2,\n}\n\nexport enum STATUS_TYPE {\n // does not remove anything.\n NOT_REMOVE = 0,\n // Minimize information on invisible items\n MINIMIZE_INVISIBLE_ITEMS = 1,\n // Minimize information on invisible groups\n MINIMIZE_INVISIBLE_GROUPS = 2,\n // remove invisible groups\n REMOVE_INVISIBLE_GROUPS = 3,\n}\n\n\nexport const INVISIBLE_POS = -9999;\n","import { GridItem, GridItemStatus, MOUNT_STATE } from \"@egjs/grid\";\nimport { INVISIBLE_POS, ITEM_TYPE } from \"./consts\";\nimport { InfiniteGridItemInfo } from \"./types\";\n\n\nexport interface InfiniteGridItemStatus extends GridItemStatus {\n type?: ITEM_TYPE;\n groupKey?: string | number;\n key?: string | number;\n html?: string;\n}\n\n/**\n * @extends Grid.GridItem\n */\nexport class InfiniteGridItem extends GridItem implements Required<InfiniteGridItemInfo> {\n public groupKey: string | number;\n public inserted: boolean;\n public readonly html: string;\n constructor(horizontal: boolean, itemStatus?: Partial<InfiniteGridItemStatus>) {\n super(horizontal, {\n html: \"\",\n type: ITEM_TYPE.NORMAL,\n cssRect: { top: INVISIBLE_POS, left: INVISIBLE_POS },\n ...itemStatus,\n } as GridItemStatus);\n\n if (this.type === ITEM_TYPE.VIRTUAL) {\n if (this.rect.width || this.rect.height) {\n this.mountState = MOUNT_STATE.UNMOUNTED;\n }\n const orgRect = this.orgRect;\n const rect = this.rect;\n const cssRect = this.cssRect;\n\n if (cssRect.width) {\n rect.width = cssRect.width;\n } else if (orgRect.width) {\n rect.width = orgRect.width;\n }\n if (cssRect.height) {\n rect.height = cssRect.height;\n } else if (orgRect.height) {\n rect.height = orgRect.height;\n }\n }\n }\n public getVirtualStatus(): Partial<InfiniteGridItemStatus> {\n return {\n type: ITEM_TYPE.VIRTUAL,\n groupKey: this.groupKey,\n key: this.key,\n orgRect: this.orgRect,\n rect: this.rect,\n cssRect: this.cssRect,\n attributes: this.attributes,\n };\n }\n public getMinimizedStatus(): Partial<InfiniteGridItemStatus> {\n const status: Partial<InfiniteGridItemStatus> = {\n ...super.getMinimizedStatus(),\n type: ITEM_TYPE.NORMAL,\n groupKey: this.groupKey,\n };\n if (this.html) {\n status.html = this.html;\n }\n return status;\n }\n}\n\nexport interface InfiniteGridItem extends Required<InfiniteGridItemStatus> {}\n","import Grid, { GridItem, GridOutlines } from \"@egjs/grid\";\nimport { ITEM_TYPE } from \"./consts\";\nimport { InfiniteGridItem, InfiniteGridItemStatus } from \"./InfiniteGridItem\";\n\nexport const LOADING_GROUP_KEY = \"__INFINITEGRID__LOADING_GRID\";\nexport const LOADING_ITEM_KEY = \"__INFINITEGRID__LOADING_ITEM\";\n\nexport class LoadingGrid extends Grid {\n public type: \"start\" | \"end\" | \"\" = \"\";\n public getLoadingItem(): InfiniteGridItem | null {\n return this.items[0] as InfiniteGridItem || null;\n }\n public setLoadingItem(item: Partial<InfiniteGridItemStatus> | null) {\n if (item) {\n const loadingItem = this.getLoadingItem();\n\n if (!loadingItem) {\n this.items = [new InfiniteGridItem(this.options.horizontal, {\n ...item,\n type: ITEM_TYPE.LOADING,\n key: LOADING_ITEM_KEY,\n })];\n } else {\n for (const name in item) {\n loadingItem[name] = item[name];\n }\n }\n } else {\n this.items = [];\n }\n }\n public applyGrid(items: GridItem[], direction: \"start\" | \"end\", outline: number[]): GridOutlines {\n if (!items.length) {\n return {\n start: outline,\n end: outline,\n };\n }\n const nextOutline = outline.length ? [...outline] : [0];\n const item = items[0];\n const offset = item.contentSize + this.gap;\n\n item.cssInlinePos = this.getContainerInlineSize() / 2 - item.inlineSize / 2;\n\n if (direction === \"end\") {\n const maxPos = Math.max(...nextOutline);\n\n item.cssContentPos = maxPos;\n\n return {\n start: nextOutline,\n end: nextOutline.map((pos) => pos + offset),\n };\n } else {\n const minPos = Math.min(...nextOutline);\n\n item.cssContentPos = minPos - offset;\n\n return {\n start: nextOutline.map((pos) => pos - offset),\n end: nextOutline,\n };\n }\n }\n}\n","import { withClassMethods } from \"@cfcs/core\";\nimport Grid, { GRID_PROPERTY_TYPES } from \"@egjs/grid\";\nimport { diff } from \"@egjs/list-differ\";\nimport { GROUP_TYPE, IGNORE_PROPERITES_MAP, INFINITEGRID_METHODS, ITEM_INFO_PROPERTIES, ITEM_TYPE } from \"./consts\";\nimport { GroupManagerStatus, InfiniteGridGroupStatus } from \"./GroupManager\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { InfiniteGridItem, InfiniteGridItemStatus } from \"./InfiniteGridItem\";\nimport {\n CategorizedGroup, InfiniteGridGroup, InfiniteGridInsertedItems,\n InfiniteGridItemInfo,\n RenderingOptions,\n} from \"./types\";\n\nexport function isWindow(el: Window | Element): el is Window {\n return el === window;\n}\n\nexport function isNumber(val: any): val is number {\n return typeof val === \"number\";\n}\n\nexport function isString(val: any): val is string {\n return typeof val === \"string\";\n}\nexport function isObject(val: any): val is object {\n return typeof val === \"object\";\n}\n\nexport function flat<T>(arr: T[][]): T[] {\n return arr.reduce((prev, cur) => {\n return [...prev, ...cur];\n }, []);\n}\nexport function splitOptions(options: Record<string, any>) {\n const {\n gridOptions,\n ...otherOptions\n } = options;\n\n return {\n ...splitGridOptions(gridOptions),\n ...otherOptions,\n };\n}\nexport function splitGridOptions(options: Record<string, any>) {\n const nextOptions: Record<string, any> = {};\n const gridOptions: Record<string, any> = {};\n const defaultOptions = Grid.defaultOptions;\n\n for (const name in options) {\n const value = options[name];\n\n if (!(name in IGNORE_PROPERITES_MAP)) {\n gridOptions[name] = value;\n }\n\n if (name in defaultOptions) {\n nextOptions[name] = value;\n }\n }\n return {\n ...nextOptions,\n gridOptions,\n };\n}\n\nexport function categorize<Item extends InfiniteGridItemInfo = InfiniteGridItem>(items: Item[]) {\n const groups: Array<CategorizedGroup<Item>> = [];\n const groupKeys: Record<string | number, CategorizedGroup<Item>> = {};\n const registeredGroupKeys: Record<string | number, boolean> = {};\n\n items.filter((item) => item.groupKey != null).forEach(({ groupKey }) => {\n registeredGroupKeys[groupKey!] = true;\n });\n\n let generatedGroupKey: number | string;\n let isContinuousGroupKey = false;\n\n items.forEach((item, i) => {\n if (item.groupKey != null) {\n isContinuousGroupKey = false;\n } else if (!item.inserted && items[i - 1]) {\n // In case of framework, inserted is false.\n // If groupKey is not set, the group key of the previous item is followed.\n item.groupKey = items[i - 1].groupKey!;\n isContinuousGroupKey = false;\n } else {\n if (!isContinuousGroupKey) {\n generatedGroupKey = makeKey(registeredGroupKeys);\n isContinuousGroupKey = true;\n registeredGroupKeys[generatedGroupKey] = true;\n }\n item.groupKey = generatedGroupKey;\n }\n\n const groupKey = item.groupKey;\n let group = groupKeys[groupKey];\n\n if (!group) {\n group = {\n groupKey,\n items: [],\n };\n groupKeys[groupKey] = group;\n groups.push(group);\n }\n\n group.items.push(item);\n });\n return groups;\n}\n\nexport function getNextCursors(\n prevKeys: Array<string | number>,\n nextKeys: Array<string | number>,\n prevStartCursor: number,\n prevEndCursor: number,\n) {\n const result = diff(prevKeys, nextKeys, (key) => key);\n let nextStartCursor = -1;\n let nextEndCursor = -1;\n\n // sync cursors\n result.maintained.forEach(([prevIndex, nextIndex]) => {\n if (prevStartCursor <= prevIndex && prevIndex <= prevEndCursor) {\n if (nextStartCursor === -1) {\n nextStartCursor = nextIndex;\n nextEndCursor = nextIndex;\n } else {\n nextStartCursor = Math.min(nextStartCursor, nextIndex);\n nextEndCursor = Math.max(nextEndCursor, nextIndex);\n }\n }\n });\n return {\n startCursor: nextStartCursor,\n endCursor: nextEndCursor,\n };\n}\nexport function splitVirtualGroups<Group extends { type: GROUP_TYPE, groupKey: string | number }>(\n groups: Group[],\n direction: \"start\" | \"end\",\n nextGroups: CategorizedGroup<InfiniteGridItemStatus>[],\n) {\n let virtualGroups: Group[] = [];\n\n if (direction === \"start\") {\n const index = findIndex(groups, (group) => group.type === GROUP_TYPE.NORMAL);\n\n if (index === -1) {\n return [];\n }\n // Get the virtual group maintained in the group from the next group.\n const endMaintainedIndex = findIndex(groups, (group) => {\n return findIndex(nextGroups, (nextGroup) => nextGroup.groupKey === group.groupKey) >= 0;\n });\n const endIndex = endMaintainedIndex >= 0 ? Math.min(index, endMaintainedIndex) : index;\n\n virtualGroups = groups.slice(0, endIndex);\n } else {\n const index = findLastIndex(groups, (group) => group.type === GROUP_TYPE.NORMAL);\n\n if (index === -1) {\n return [];\n }\n const startMaintainedIndex = findLastIndex(groups, (group) => {\n return findIndex(nextGroups, (nextGroup) => nextGroup.groupKey === group.groupKey) >= 0;\n });\n const startIndex = startMaintainedIndex >= 0 ? Math.max(index, startMaintainedIndex) : index;\n\n virtualGroups = groups.slice(startIndex + 1);\n }\n\n return virtualGroups;\n}\n\nexport function getFirstRenderingItems(\n nextItems: InfiniteGridItemStatus[],\n horizontal: boolean,\n) {\n const groups = categorize(nextItems);\n\n if (!groups[0]) {\n return [];\n }\n return groups[0].items.map((item) => {\n return new InfiniteGridItem(horizontal, {\n ...item,\n });\n });\n}\nexport function getRenderingItemsByStatus(\n groupManagerStatus: GroupManagerStatus,\n nextItems: InfiniteGridItemStatus[],\n usePlaceholder: boolean,\n horizontal: boolean,\n) {\n const prevGroups = groupManagerStatus.groups;\n const groups = categorize(nextItems);\n\n const startVirtualGroups = splitVirtualGroups(prevGroups, \"start\", groups);\n const endVirtualGroups = splitVirtualGroups(prevGroups, \"end\", groups);\n const nextGroups = [\n ...startVirtualGroups,\n ...groups,\n ...endVirtualGroups,\n ] as Array<InfiniteGridGroupStatus | CategorizedGroup<InfiniteGridItemStatus>>;\n const {\n startCursor,\n endCursor,\n } = getNextCursors(\n prevGroups.map((group) => group.groupKey),\n nextGroups.map((group) => group.groupKey),\n groupManagerStatus.cursors[0],\n groupManagerStatus.cursors[1],\n );\n\n let nextVisibleItems = flat(nextGroups.slice(startCursor, endCursor + 1).map((group) => {\n return group.items.map((item) => {\n return new InfiniteGridItem(horizontal, { ...item });\n });\n }));\n\n if (!usePlaceholder) {\n nextVisibleItems = nextVisibleItems.filter((item) => {\n return item.type !== ITEM_TYPE.VIRTUAL;\n });\n }\n\n return nextVisibleItems;\n}\n\nexport function mountRenderingItems(items: InfiniteGridItemInfo[], options: RenderingOptions) {\n const {\n grid,\n usePlaceholder,\n useLoading,\n useFirstRender,\n status,\n } = options;\n if (!grid) {\n return;\n }\n if (usePlaceholder) {\n grid.setPlaceholder({});\n }\n if (useLoading) {\n grid.setLoading({});\n }\n if (status) {\n grid.setStatus(status, true);\n }\n\n grid.syncItems(items);\n\n if (useFirstRender && !status && grid.getGroups().length) {\n grid.setCursors(0, 0, true);\n }\n}\nexport function getRenderingItems(items: InfiniteGridItemInfo[], options: RenderingOptions) {\n const {\n status,\n usePlaceholder,\n useLoading,\n horizontal,\n useFirstRender,\n grid,\n } = options;\n let visibleItems: InfiniteGridItem[] = [];\n\n if (grid) {\n grid.setPlaceholder(usePlaceholder ? {} : null);\n grid.setLoading(useLoading ? {} : null);\n grid.syncItems(items);\n\n visibleItems = grid.getRenderingItems();\n } else if (status) {\n visibleItems = getRenderingItemsByStatus(status.groupManager, items, !!usePlaceholder, !!horizontal);\n } else if (useFirstRender) {\n visibleItems = getFirstRenderingItems(items, !!horizontal);\n }\n\n return visibleItems;\n}\n\n/* Class Decorator */\nexport function InfiniteGridGetterSetter(component: {\n prototype: InfiniteGrid<any>,\n propertyTypes: typeof GRID_PROPERTY_TYPES,\n}) {\n const {\n prototype,\n propertyTypes,\n } = component;\n for (const name in propertyTypes) {\n const attributes: Record<string, any> = {\n enumerable: true,\n configurable: true,\n get(this: InfiniteGrid) {\n const options = this.groupManager.options;\n if (name in options) {\n return options[name];\n } else {\n return options.gridOptions[name];\n }\n },\n set(this: InfiniteGrid, value: any) {\n const prevValue = this.groupManager[name];\n\n if (prevValue === value) {\n return;\n }\n this.groupManager.gridOptions = {\n [name]: value,\n };\n },\n };\n Object.defineProperty(prototype, name, attributes);\n }\n}\n\nexport function makeKey(\n registeredKeys: Record<string, any>,\n prefix = \"\",\n) {\n let index = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const key = `infinitegrid_${prefix}${index++}`;\n\n if (!(key in registeredKeys)) {\n return key;\n }\n }\n}\n\nexport function convertHTMLtoElement(html: string) {\n const dummy = document.createElement(\"div\");\n\n dummy.innerHTML = html;\n return toArray(dummy.children);\n}\n\nexport function convertInsertedItems(\n items: InfiniteGridInsertedItems,\n groupKey?: string | number,\n): InfiniteGridItemInfo[] {\n let insertedItems: Array<string | HTMLElement | InfiniteGridItemInfo>;\n\n if (isString(items)) {\n insertedItems = convertHTMLtoElement(items);\n } else {\n insertedItems = items;\n }\n return insertedItems.map((item) => {\n let element!: HTMLElement;\n let html = \"\";\n let key!: string | number;\n\n if (isString(item)) {\n html = item;\n } else if (\"parentNode\" in item) {\n element = item;\n html = item.outerHTML;\n } else {\n // inserted is true when adding via a method.\n return { groupKey, inserted: true, ...item };\n }\n\n // inserted is true when adding via a method.\n return {\n key,\n groupKey,\n html,\n element,\n inserted: true,\n };\n });\n}\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray<T>(nodes: { length: number, [key: number]: T }): T[];\nexport function toArray<T>(nodes: { length: number, [key: number]: T }): T[] {\n const array: T[] = [];\n\n if (nodes) {\n const length = nodes.length;\n\n for (let i = 0; i < length; i++) {\n array.push(nodes[i]);\n }\n }\n return array;\n}\n\n\nexport function find<T>(arr: T[], callback: (value: T, index: number) => boolean): T | null {\n const length = arr.length;\n\n for (let i = 0; i < length; ++i) {\n const value = arr[i];\n\n if (callback(value, i)) {\n return value;\n }\n }\n\n return null;\n}\n\nexport function findIndex<T>(arr: T[], callback: (value: T, index: number) => boolean) {\n const length = arr.length;\n for (let i = 0; i < length; ++i) {\n if (callback(arr[i], i)) {\n return i;\n }\n }\n\n return -1;\n}\n\nexport function findLastIndex<T>(arr: T[], callback: (value: T, index: number) => boolean) {\n const length = arr.length;\n for (let i = length - 1; i >= 0; --i) {\n if (callback(arr[i], i)) {\n return i;\n }\n }\n\n return -1;\n}\n\nexport function getItemInfo(info: InfiniteGridItemInfo) {\n const nextInfo: InfiniteGridItemInfo = {};\n\n for (const name in info) {\n if (name in ITEM_INFO_PROPERTIES) {\n nextInfo[name] = info[name];\n }\n }\n\n return nextInfo;\n}\n\nexport function setPlaceholder(item: InfiniteGridItem, info: InfiniteGridItemStatus) {\n for (const name in info) {\n const value = info[name];\n\n if (isObject(value)) {\n item[name] = {\n ...item[name],\n ...value,\n };\n } else {\n item[name] = info[name];\n }\n }\n}\n\nexport function isFlatOutline(start: number[], end: number[]) {\n return start.length === end.length && start.every((pos, i) => end[i] === pos);\n}\n\nexport function range(length: number): number[] {\n const arr: number[] = [];\n for (let i = 0; i < length; ++i) {\n arr.push(i);\n }\n return arr;\n}\n\nexport function flatGroups(groups: InfiniteGridGroup[]) {\n return flat(groups.map(({ grid }) => grid.getItems() as InfiniteGridItem[]));\n}\n\n\nexport function filterVirtuals<T extends InfiniteGridItem | InfiniteGridGroup>(\n items: T[],\n includePlaceholders?: boolean\n): T[] {\n if (includePlaceholders) {\n return [...items];\n } else {\n return items.filter((item) => item.type !== ITEM_TYPE.VIRTUAL);\n }\n}\n\n/**\n * Decorator that makes the method of InfiniteGrid available in the framework.\n * @ko 프레임워크에서 InfiniteGrid의 메소드를 사용할 수 있게 하는 데코레이터.\n * @private\n * @example\n * ```js\n * import { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class Grid extends React.Component<Partial<InfiniteGridProps & InfiniteGridOptions>> {\n * @withInfiniteGridMethods\n * private grid: NativeGrid;\n * }\n * ```\n */\nexport const withInfiniteGridMethods = withClassMethods(INFINITEGRID_METHODS);\n\n","import Grid, {\n GetterSetter,\n GridFunction, GridItem, GridOptions,\n GridOutlines, MOUNT_STATE, Properties, PROPERTY_TYPE,\n RenderOptions, UPDATE_STATE,\n} from \"@egjs/grid\";\nimport { GROUP_TYPE, ITEM_TYPE, STATUS_TYPE } from \"./consts\";\nimport { InfiniteGridItem, InfiniteGridItemStatus } from \"./InfiniteGridItem\";\nimport { LoadingGrid, LOADING_GROUP_KEY } from \"./LoadingGrid\";\nimport { CategorizedGroup, InfiniteGridGroup, InfiniteGridItemInfo } from \"./types\";\nimport {\n categorize, filterVirtuals, findIndex, findLastIndex,\n flat,\n flatGroups, getItemInfo, isNumber, makeKey,\n range,\n setPlaceholder,\n splitGridOptions, splitOptions, splitVirtualGroups,\n} from \"./utils\";\n\nexport interface InfiniteGridGroupStatus {\n type: GROUP_TYPE;\n groupKey: string | number;\n items: InfiniteGridItemStatus[];\n outlines: GridOutlines;\n}\n\nexport interface GroupManagerOptions extends GridOptions {\n appliedItemChecker?: (item: InfiniteGridItem, grid: Grid) => boolean;\n gridConstructor: GridFunction | null;\n gridOptions: Record<string, any>;\n}\n\nexport interface GroupManagerStatus {\n cursors: [number, number];\n orgCursors: [number, number];\n itemCursors: [number, number];\n startGroupKey: number | string;\n endGroupKey: number | string;\n groups: InfiniteGridGroupStatus[];\n outlines: GridOutlines;\n}\n\n@GetterSetter\nexport class GroupManager extends Grid<GroupManagerOptions> {\n public static defaultOptions: Required<GroupManagerOptions> = {\n ...Grid.defaultOptions,\n appliedItemChecker: () => false,\n gridConstructor: null,\n gridOptions: {},\n };\n public static propertyTypes = {\n ...Grid.propertyTypes,\n gridConstructor: PROPERTY_TYPE.PROPERTY,\n gridOptions: PROPERTY_TYPE.PROPERTY,\n } as const;\n protected items: InfiniteGridItem[];\n protected groupItems: InfiniteGridItem[] = [];\n protected groups: InfiniteGridGroup[] = [];\n protected itemKeys: Record<string | number, InfiniteGridItem> = {};\n protected groupKeys: Record<string | number, InfiniteGridGroup> = {};\n protected startCursor = 0;\n protected endCursor = 0;\n private _placeholder: Partial<InfiniteGridItemStatus> | null = null;\n private _loadingGrid!: LoadingGrid;\n private _mainGrid!: Grid;\n\n constructor(container: HTMLElement, options: GroupManagerOptions) {\n super(container, splitOptions(options));\n\n this._loadingGrid = new LoadingGrid(container, {\n externalContainerManager: this.containerManager,\n useFit: false,\n autoResize: false,\n renderOnPropertyChange: false,\n gap: this.gap,\n });\n this._mainGrid = this._makeGrid();\n }\n public set gridOptions(options: Record<string, any>) {\n const {\n gridOptions,\n ...otherOptions\n } = splitGridOptions(options);\n\n const shouldRender = this._checkShouldRender(options);\n this.options.gridOptions = {\n ...this.options.gridOptions,\n ...gridOptions,\n };\n [this._mainGrid, ...this.groups.map(({ grid }) => grid)].forEach((grid) => {\n for (const name in options) {\n (grid as any)[name] = options[name];\n }\n });\n for (const name in otherOptions) {\n this[name] = otherOptions[name];\n }\n\n this._loadingGrid.gap = this.gap;\n if (shouldRender) {\n this.scheduleRender();\n }\n }\n\n public getItemByKey(key: string | number): InfiniteGridItem | null {\n return this.itemKeys[key] || null;\n }\n\n public getGroupItems(includePlaceholders?: boolean) {\n return filterVirtuals(this.groupItems, includePlaceholders);\n }\n public getVisibleItems(includePlaceholders?: boolean) {\n return filterVirtuals(this.items, includePlaceholders);\n }\n\n public getRenderingItems() {\n if (this.hasPlaceholder()) {\n return this.items;\n } else {\n return this.items.filter((item) => item.type !== ITEM_TYPE.VIRTUAL);\n }\n }\n\n public getGroups(includePlaceholders?: boolean): InfiniteGridGroup[] {\n return filterVirtuals(this.groups, includePlaceholders);\n }\n\n public hasVisibleVirtualGroups() {\n return this.getVisibleGroups(true).some((group) => group.type === GROUP_TYPE.VIRTUAL);\n }\n public hasPlaceholder() {\n return !!this._placeholder;\n }\n public hasLoadingItem() {\n return !!this._getLoadingItem();\n }\n\n public updateItems(items = this.groupItems, options?: RenderOptions) {\n return super.updateItems(items, options);\n }\n public setPlaceholder(placeholder: Partial<InfiniteGridItemStatus> | null) {\n this._placeholder = placeholder;\n this._updatePlaceholder();\n }\n\n public getLoadingType() {\n return this._loadingGrid.type;\n }\n\n public startLoading(type: \"start\" | \"end\") {\n this._loadingGrid.type = type;\n this.items = this._getRenderingItems();\n\n return true;\n }\n\n public endLoading() {\n const prevType = this._loadingGrid.type;\n\n this._loadingGrid.type = \"\";\n this.items = this._getRenderingItems();\n return !!prevType;\n }\n\n public setLoading(loading: Partial<InfiniteGridItemStatus> | null) {\n this._loadingGrid.setLoadingItem(loading);\n this.items = this._getRenderingItems();\n }\n\n public getVisibleGroups(includePlaceholders?: boolean): InfiniteGridGroup[] {\n const groups = this.groups.slice(this.startCursor, this.endCursor + 1);\n\n return filterVirtuals(groups, includePlaceholders);\n }\n\n public getComputedOutlineLength(items = this.items) {\n return this._mainGrid.getComputedOutlineLength(items);\n }\n public getComputedOutlineSize(items = this.items) {\n return this._mainGrid.getComputedOutlineSize(items);\n }\n\n public applyGrid(items: InfiniteGridItem[], direction: \"end\" | \"start\", outline: number[]): GridOutlines {\n const renderingGroups = this.groups.slice();\n\n if (!renderingGroups.length) {\n return {\n start: [],\n end: [],\n };\n }\n\n\n const loadingGrid = this._loadingGrid;\n\n if (loadingGrid.getLoadingItem()) {\n if (loadingGrid.type === \"start\") {\n renderingGroups.unshift(this._getLoadingGroup());\n } else if (loadingGrid.type === \"end\") {\n renderingGroups.push(this._getLoadingGroup());\n }\n }\n\n const groups = renderingGroups.slice();\n\n let nextOutline = outline;\n\n if (direction === \"start\") {\n groups.reverse();\n }\n\n const appliedItemChecker = this.options.appliedItemChecker;\n const groupItems = this.groupItems;\n const outlineLength = this.getComputedOutlineLength(groupItems);\n const outlineSize = this.getComputedOutlineSize(groupItems);\n const itemRenderer = this.itemRenderer;\n\n groups.forEach((group) => {\n const grid = group.grid;\n const gridItems = grid.getItems() as InfiniteGridItem[];\n const isVirtual = group.type === GROUP_TYPE.VIRTUAL && !gridItems[0];\n\n grid.outlineLength = outlineLength;\n grid.outlineSize = outlineSize;\n\n const appliedItems = gridItems.filter((item) => {\n if (item.mountState === MOUNT_STATE.UNCHECKED || !item.rect.width) {\n itemRenderer.updateItem(item, true);\n }\n return (item.orgRect.width && item.rect.width) || appliedItemChecker(item, grid);\n });\n let gridOutlines: GridOutlines;\n\n if (isVirtual) {\n gridOutlines = this._applyVirtualGrid(grid, direction, nextOutline);\n } else if (appliedItems.length) {\n gridOutlines = grid.applyGrid(appliedItems, direction, nextOutline);\n } else {\n gridOutlines = {\n start: [...nextOutline],\n end: [...nextOutline],\n };\n }\n grid.setOutlines(gridOutlines);\n nextOutline = gridOutlines[direction];\n });\n\n return {\n start: renderingGroups[0].grid.getOutlines().start,\n end: renderingGroups[renderingGroups.length - 1].grid.getOutlines().end,\n };\n }\n\n public syncItems(nextItemInfos: InfiniteGridItemInfo[]) {\n const prevItemKeys = this.itemKeys;\n\n this.itemKeys = {};\n const nextItems = this._syncItemInfos(nextItemInfos.map((info) => getItemInfo(info)), prevItemKeys);\n const prevGroupKeys = this.groupKeys;\n let nextManagerGroups = categorize(nextItems);\n\n const startVirtualGroups = this._splitVirtualGroups(\"start\", nextManagerGroups);\n const endVirtualGroups = this._splitVirtualGroups(\"end\", nextManagerGroups);\n nextManagerGroups = [...startVirtualGroups, ...this._mergeVirtualGroups(nextManagerGroups), ...endVirtualGroups];\n\n const nextGroups: InfiniteGridGroup[] = nextManagerGroups.map(({ groupKey, items }) => {\n const isVirtual = !items[0] || items[0].type === ITEM_TYPE.VIRTUAL;\n const grid = prevGroupKeys[groupKey]?.grid ?? this._makeGrid();\n const gridItems = isVirtual ? items : items.filter(({ type }) => type === ITEM_TYPE.NORMAL);\n\n grid.setItems(gridItems);\n\n return {\n type: isVirtual ? GROUP_TYPE.VIRTUAL : GROUP_TYPE.NORMAL,\n groupKey,\n grid,\n items: gridItems,\n renderItems: items,\n };\n });\n\n this._registerGroups(nextGroups);\n }\n\n public renderItems(options: RenderOptions = {}) {\n if (options.useResize) {\n this.groupItems.forEach((item) => {\n item.updateState = UPDATE_STATE.NEED_UPDATE;\n });\n const loadingItem = this._getLoadingItem();\n\n if (loadingItem) {\n loadingItem.updateState = UPDATE_STATE.NEED_UPDATE;\n }\n }\n return super.renderItems(options);\n }\n\n public setCursors(startCursor: number, endCursor: number) {\n this.startCursor = startCursor;\n this.endCursor = endCursor;\n this.items = this._getRenderingItems();\n }\n\n public getStartCursor() {\n return this.startCursor;\n }\n\n public getEndCursor() {\n return this.endCursor;\n }\n\n public getGroupStatus(type?: STATUS_TYPE, includePlaceholders?: boolean): GroupManagerStatus {\n const orgStartCursor = this.startCursor;\n const orgEndCursor = this.endCursor;\n const orgGroups = this.groups;\n const startGroup = orgGroups[orgStartCursor];\n const endGroup = orgGroups[orgEndCursor];\n\n let startCursor = orgStartCursor;\n let endCursor = orgEndCursor;\n\n const isMinimizeItems = type === STATUS_TYPE.MINIMIZE_INVISIBLE_ITEMS;\n const isMinimizeGroups = type === STATUS_TYPE.MINIMIZE_INVISIBLE_GROUPS;\n let groups: InfiniteGridGroup[];\n\n if (type === STATUS_TYPE.REMOVE_INVISIBLE_GROUPS) {\n groups = this.getVisibleGroups(includePlaceholders);\n endCursor = groups.length - 1;\n startCursor = 0;\n } else {\n groups = this.getGroups(includePlaceholders);\n\n if (!includePlaceholders) {\n startCursor = -1;\n endCursor = -1;\n\n for (let orgIndex = orgStartCursor; orgIndex <= orgEndCursor; ++orgIndex) {\n const orgGroup = orgGroups[orgIndex];\n\n if (orgGroup && orgGroup.type !== GROUP_TYPE.VIRTUAL) {\n startCursor = groups.indexOf(orgGroup);\n break;\n }\n }\n for (let orgIndex = orgEndCursor; orgIndex >= orgStartCursor; --orgIndex) {\n const orgGroup = orgGroups[orgIndex];\n\n if (orgGroup && orgGroup.type !== GROUP_TYPE.VIRTUAL) {\n endCursor = groups.lastIndexOf(orgGroup);\n break;\n }\n }\n }\n }\n\n const groupStatus: InfiniteGridGroupStatus[] = groups.map(({ grid, groupKey }, i) => {\n const isOutsideCursor = i < startCursor || endCursor < i;\n const isVirtualItems = isMinimizeItems && isOutsideCursor;\n const isVirtualGroup = isMinimizeGroups && isOutsideCursor;\n const gridItems = grid.getItems() as InfiniteGridItem[];\n const items = isVirtualGroup\n ? []\n : gridItems.map((item) => isVirtualItems ? item.getVirtualStatus() : item.getMinimizedStatus());\n\n return {\n type: isVirtualGroup || isVirtualItems ? GROUP_TYPE.VIRTUAL : GROUP_TYPE.NORMAL,\n groupKey: groupKey,\n outlines: grid.getOutlines(),\n items,\n };\n });\n\n\n const totalItems = this.getGroupItems();\n\n const itemStartCursor = totalItems.indexOf(startGroup?.items[0]);\n const itemEndCursor = totalItems.indexOf(endGroup?.items.slice().reverse()[0]);\n\n return {\n cursors: [startCursor, endCursor],\n orgCursors: [orgStartCursor, orgEndCursor],\n itemCursors: [itemStartCursor, itemEndCursor],\n startGroupKey: startGroup?.groupKey,\n endGroupKey: endGroup?.groupKey,\n groups: groupStatus,\n outlines: this.outlines,\n };\n }\n protected fitOutlines(useFit = this.useFit) {\n const groups = this.groups;\n const firstGroup = groups[0];\n\n if (!firstGroup) {\n return;\n }\n const outlines = firstGroup.grid.getOutlines();\n const startOutline = outlines.start;\n const outlineOffset = startOutline.length ? Math.min(...startOutline) : 0;\n\n // If the outline is less than 0, a fit occurs forcibly.\n if (!useFit && outlineOffset > 0) {\n return;\n }\n\n groups.forEach(({ grid }) => {\n const { start, end } = grid.getOutlines();\n\n grid.setOutlines({\n start: start.map((point) => point - outlineOffset),\n end: end.map((point) => point - outlineOffset),\n });\n });\n\n this.groupItems.forEach((item) => {\n const contentPos = item.cssContentPos;\n\n if (!isNumber(contentPos)) {\n return;\n }\n item.cssContentPos = contentPos - outlineOffset;\n });\n }\n public setGroupStatus(status: GroupManagerStatus) {\n this.itemKeys = {};\n this.groupItems = [];\n this.items = [];\n const prevGroupKeys = this.groupKeys;\n\n const nextGroups: InfiniteGridGroup[] = status.groups.map(({\n type,\n groupKey,\n items,\n outlines,\n }) => {\n const nextItems = this._syncItemInfos(items);\n const grid = prevGroupKeys[groupKey]?.grid ?? this._makeGrid();\n\n grid.setOutlines(outlines);\n grid.setItems(nextItems);\n\n return {\n type,\n groupKey,\n grid,\n items: nextItems,\n renderItems: nextItems,\n };\n });\n\n this.setOutlines(status.outlines);\n this._registerGroups(nextGroups);\n this._updatePlaceholder();\n this.setCursors(status.cursors[0], status.cursors[1]);\n }\n public appendPlaceholders(items: number | InfiniteGridItemStatus[], groupKey?: string | number) {\n return this.insertPlaceholders(\"end\", items, groupKey);\n }\n public prependPlaceholders(items: number | InfiniteGridItemStatus[], groupKey?: string | number) {\n return this.insertPlaceholders(\"start\", items, groupKey);\n }\n public removePlaceholders(type: \"start\" | \"end\" | { groupKey: string | number }) {\n const groups = this.groups;\n const length = groups.length;\n\n if (type === \"start\") {\n const index = findIndex(groups, (group) => group.type === GROUP_TYPE.NORMAL);\n\n groups.splice(0, index);\n\n } else if (type === \"end\") {\n const index = findLastIndex(groups, (group) => group.type === GROUP_TYPE.NORMAL);\n\n groups.splice(index + 1, length - index - 1);\n } else {\n const groupKey = type.groupKey;\n\n const index = findIndex(groups, (group) => group.groupKey === groupKey);\n\n if (index > -1) {\n groups.splice(index, 1);\n }\n }\n\n this.syncItems(flatGroups(this.getGroups()));\n }\n public insertPlaceholders(\n direction: \"start\" | \"end\",\n items: number | InfiniteGridItemStatus[],\n groupKey: string | number = makeKey(this.groupKeys, \"virtual_\"),\n ) {\n\n let infos: InfiniteGridItemInfo[] = [];\n\n if (isNumber(items)) {\n infos = range(items).map(() => ({ type: ITEM_TYPE.VIRTUAL, groupKey }));\n } else if (Array.isArray(items)) {\n infos = items.map((status) => ({\n groupKey,\n ...status,\n type: ITEM_TYPE.VIRTUAL,\n }));\n }\n const grid = this._makeGrid();\n const nextItems = this._syncItemInfos(infos, this.itemKeys);\n\n this._updatePlaceholder(nextItems);\n grid.setItems(nextItems);\n\n const group = {\n type: GROUP_TYPE.VIRTUAL,\n groupKey,\n grid,\n items: nextItems,\n renderItems: nextItems,\n };\n\n this.groupKeys[groupKey] = group;\n\n if (direction === \"end\") {\n this.groups.push(group);\n this.groupItems.push(...nextItems);\n } else {\n this.groups.splice(0, 0, group);\n this.groupItems.splice(0, 0, ...nextItems);\n if (this.startCursor > -1) {\n ++this.startCursor;\n ++this.endCursor;\n }\n }\n\n\n return {\n group,\n items: nextItems,\n };\n }\n\n public shouldRerenderItems() {\n let isRerender = false;\n\n this.getVisibleGroups().forEach((group) => {\n const items = group.items;\n\n if (\n items.length === group.renderItems.length\n || items.every((item) => item.mountState === MOUNT_STATE.UNCHECKED)\n ) {\n return;\n }\n isRerender = true;\n group.renderItems = [...items];\n });\n if (isRerender) {\n this.items = this._getRenderingItems();\n }\n return isRerender;\n }\n\n protected _updateItems(items: GridItem[]): void {\n this.itemRenderer.updateEqualSizeItems(items, this.groupItems);\n }\n\n private _getGroupItems() {\n return flatGroups(this.getGroups(true));\n }\n\n private _getRenderingItems() {\n const items = flat(this.getVisibleGroups(true).map((item) => item.renderItems));\n\n\n const loadingGrid = this._loadingGrid;\n const loadingItem = loadingGrid.getLoadingItem();\n\n if (loadingItem) {\n if (loadingGrid.type === \"end\") {\n items.push(loadingItem);\n } else if (loadingGrid.type === \"start\") {\n items.unshift(loadingItem);\n }\n }\n\n return items;\n }\n\n private _checkShouldRender(options: Record<string, any>) {\n const GridConstructor = this.options.gridConstructor!;\n const prevOptions = this.gridOptions;\n const propertyTypes = GridConstructor.propertyTypes;\n\n for (const name in prevOptions) {\n if (!(name in options) && propertyTypes[name] === PROPERTY_TYPE.RENDER_PROPERTY) {\n return true;\n }\n }\n for (const name in options) {\n if (prevOptions[name] !== options[name] && propertyTypes[name] === PROPERTY_TYPE.RENDER_PROPERTY) {\n return true;\n }\n }\n return false;\n }\n private _applyVirtualGrid(grid: Grid, direction: \"start\" | \"end\", outline: number[]) {\n const startOutline = outline.length ? [...outline] : [0];\n const prevOutlines = grid.getOutlines();\n const prevOutline = prevOutlines[direction === \"end\" ? \"start\" : \"end\"];\n\n if (\n prevOutline.length !== startOutline.length\n || prevOutline.some((value, i) => value !== startOutline[i])\n ) {\n return {\n start: [...startOutline],\n end: [...startOutline],\n };\n }\n return prevOutlines;\n }\n private _syncItemInfos(\n nextItemInfos: InfiniteGridItemStatus[],\n prevItemKeys: Record<string | number, InfiniteGridItem> = {},\n ) {\n const horizontal = this.options.horizontal;\n const nextItemKeys = this.itemKeys;\n\n nextItemInfos.filter((info) => info.key != null).forEach((info) => {\n const key = info.key!;\n const prevItem = prevItemKeys[key];\n\n if (!prevItem) {\n nextItemKeys[key] = new InfiniteGridItem(horizontal, {\n ...info,\n });\n } else if (prevItem.type === ITEM_TYPE.VIRTUAL && info.type !== ITEM_TYPE.VIRTUAL) {\n nextItemKeys[key] = new InfiniteGridItem(horizontal, {\n orgRect: prevItem.orgRect,\n rect: prevItem.rect,\n ...info,\n });\n } else {\n if (info.data) {\n prevItem.data = info.data;\n }\n if (info.groupKey != null) {\n prevItem.groupKey = info.groupKey!;\n }\n if (info.element) {\n prevItem.element = info.element;\n }\n nextItemKeys[key] = prevItem;\n }\n });\n const nextItems = nextItemInfos.map((info) => {\n let key = info.key!;\n\n if (info.key == null) {\n key = makeKey(nextItemKeys, info.type === ITEM_TYPE.VIRTUAL ? \"virtual_\" : \"\");\n }\n let item = nextItemKeys[key];\n\n if (!item) {\n const prevItem = prevItemKeys[key];\n\n if (prevItem) {\n item = prevItem;\n\n if (info.data) {\n item.data = info.data;\n }\n if (info.element) {\n item.element = info.element;\n }\n } else {\n item = new InfiniteGridItem(horizontal, {\n ...info,\n key,\n });\n }\n nextItemKeys[key] = item;\n }\n return item;\n });\n return nextItems;\n }\n private _registerGroups(groups: InfiniteGridGroup[]) {\n const nextGroupKeys: Record<string | number, InfiniteGridGroup> = {};\n\n groups.forEach((group) => {\n nextGroupKeys[group.groupKey] = group;\n });\n\n this.groups = groups;\n this.groupKeys = nextGroupKeys;\n this.groupItems = this._getGroupItems();\n }\n private _splitVirtualGroups(direction: \"start\" | \"end\", nextGroups: CategorizedGroup[]) {\n const groups = splitVirtualGroups(this.groups, direction, nextGroups);\n const itemKeys = this.itemKeys;\n\n groups.forEach(({ renderItems }) => {\n renderItems.forEach((item) => {\n itemKeys[item.key] = item;\n });\n });\n\n return groups;\n }\n private _mergeVirtualGroups(groups: Array<CategorizedGroup<InfiniteGridItem>>) {\n const itemKeys = this.itemKeys;\n const groupKeys = this.groupKeys;\n\n groups.forEach((group) => {\n const prevGroup = groupKeys[group.groupKey];\n\n if (!prevGroup) {\n return;\n }\n const items = group.items;\n\n if (items.every((item) => item.mountState === MOUNT_STATE.UNCHECKED)) {\n prevGroup.renderItems.forEach((item) => {\n if (item.type === ITEM_TYPE.VIRTUAL && !itemKeys[item.key]) {\n items.push(item);\n itemKeys[item.key] = item;\n }\n });\n }\n });\n return groups;\n }\n\n private _updatePlaceholder(items = this.groupItems) {\n const placeholder = this._placeholder;\n\n if (!placeholder) {\n return;\n }\n\n items.filter((item) => item.type === ITEM_TYPE.VIRTUAL).forEach((item) => {\n setPlaceholder(item, placeholder);\n });\n }\n private _makeGrid() {\n const GridConstructor = this.options.gridConstructor!;\n const gridOptions = this.gridOptions;\n const container = this.containerElement;\n\n return new GridConstructor(container, {\n ...gridOptions,\n useFit: false,\n autoResize: false,\n useResizeObserver: false,\n observeChildren: false,\n renderOnPropertyChange: false,\n externalContainerManager: this.containerManager,\n externalItemRenderer: this.itemRenderer,\n });\n }\n private _getLoadingGroup(): InfiniteGridGroup {\n const loadingGrid = this._loadingGrid;\n const items = loadingGrid.getItems() as InfiniteGridItem[];\n\n return {\n groupKey: LOADING_GROUP_KEY,\n type: GROUP_TYPE.NORMAL,\n grid: loadingGrid,\n items,\n renderItems: items,\n };\n }\n private _getLoadingItem() {\n return this._loadingGrid.getLoadingItem();\n }\n}\n\nexport interface GroupManager extends Properties<typeof GroupManager> {\n getItems(): InfiniteGridItem[];\n}\n","import Component from \"@egjs/component\";\nimport { diff } from \"@egjs/list-differ\";\nimport { DIRECTION } from \"./consts\";\nimport { findIndex, findLastIndex, getNextCursors, isFlatOutline } from \"./utils\";\n\nexport interface OnInfiniteRequestAppend {\n key?: string | number | undefined;\n nextKey?: string | number | undefined;\n nextKeys?: Array<string | number>;\n isVirtual: boolean;\n}\n\nexport interface OnInfiniteRequestPrepend {\n key?: string | number;\n nextKey?: string | number;\n nextKeys?: Array<string | number>;\n isVirtual: boolean;\n}\n\nexport interface OnInfiniteChange {\n prevStartCursor: number;\n prevEndCursor: number;\n nextStartCursor: number;\n nextEndCursor: number;\n}\n\nexport interface InfiniteEvents {\n requestAppend: OnInfiniteRequestAppend;\n requestPrepend: OnInfiniteRequestPrepend;\n change: OnInfiniteChange;\n}\n\nexport interface InfiniteOptions {\n useRecycle?: boolean;\n threshold?: number;\n defaultDirection?: \"start\" | \"end\";\n}\n\nexport interface InfiniteItem {\n key: string | number;\n startOutline: number[];\n endOutline: number[];\n isVirtual?: boolean;\n}\n\nexport class Infinite extends Component<InfiniteEvents> {\n public options: Required<InfiniteOptions>;\n protected startCursor = -1;\n protected endCursor = -1;\n protected size = 0;\n protected items: InfiniteItem[] = [];\n protected itemKeys: Record<string | number, InfiniteItem> = {};\n constructor(options: InfiniteOptions) {\n super();\n this.options = {\n threshold: 0,\n useRecycle: true,\n defaultDirection: \"end\",\n ...options,\n };\n }\n public scroll(scrollPos: number) {\n const prevStartCursor = this.startCursor;\n const prevEndCursor = this.endCursor;\n const items = this.items;\n const length = items.length;\n const size = this.size;\n const {\n defaultDirection,\n threshold,\n useRecycle,\n } = this.options;\n const isDirectionEnd = defaultDirection === \"end\";\n\n if (!length) {\n this.trigger(isDirectionEnd ? \"requestAppend\" : \"requestPrepend\", {\n key: undefined,\n isVirtual: false,\n });\n return;\n } else if (prevStartCursor === -1 || prevEndCursor === -1) {\n const nextCursor = isDirectionEnd ? 0 : length - 1;\n this.trigger(\"change\", {\n prevStartCursor,\n prevEndCursor,\n nextStartCursor: nextCursor,\n nextEndCursor: nextCursor,\n });\n return;\n }\n\n const endScrollPos = scrollPos + size;\n const startEdgePos = Math.max(...items[prevStartCursor].startOutline);\n const endEdgePos = Math.min(...items[prevEndCursor].endOutline);\n const visibles = items.map((item) => {\n const {\n startOutline,\n endOutline,\n } = item;\n\n if (!startOutline.length || !endOutline.length || isFlatOutline(startOutline, endOutline)) {\n return false;\n }\n const startPos = Math.min(...startOutline);\n const endPos = Math.max(...endOutline);\n\n if (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n return true;\n }\n return false;\n });\n const hasStartItems = 0 < prevStartCursor;\n const hasEndItems = prevEndCursor < length - 1;\n const isStart = scrollPos <= startEdgePos + threshold;\n const isEnd = endScrollPos >= endEdgePos - threshold;\n let nextStartCursor = visibles.indexOf(true);\n let nextEndCursor = visibles.lastIndexOf(true);\n\n if (nextStartCursor === -1) {\n nextStartCursor = prevStartCursor;\n nextEndCursor = prevEndCursor;\n }\n\n if (!useRecycle) {\n nextStartCursor = Math.min(nextStartCursor, prevStartCursor);\n nextEndCursor = Math.max(nextEndCursor, prevEndCursor);\n }\n if (nextStartCursor === prevStartCursor && hasStartItems && isStart) {\n nextStartCursor -= 1;\n }\n if (nextEndCursor === prevEndCursor && hasEndItems && isEnd) {\n nextEndCursor += 1;\n }\n let nextVisibleItems = items.slice(nextStartCursor, nextEndCursor + 1);\n\n // It must contain no virtual items.\n if (nextVisibleItems.every((item) => item.isVirtual === true)) {\n // The real item can be in either the start or end direction.\n let hasRealItem = false;\n\n for (let i = nextStartCursor - 1; i >= 0; --i) {\n if (!items[i].isVirtual) {\n nextStartCursor = i;\n hasRealItem = true;\n break;\n }\n }\n if (!hasRealItem) {\n for (let i = nextEndCursor + 1; i < length; ++i) {\n if (!items[i].isVirtual) {\n nextEndCursor = i;\n hasRealItem = true;\n break;\n }\n }\n }\n if (hasRealItem) {\n nextVisibleItems = items.slice(nextStartCursor, nextEndCursor + 1);\n }\n }\n\n const hasVirtualItems = nextVisibleItems.some((item) => item.isVirtual === true);\n\n if (prevStartCursor !== nextStartCursor || prevEndCursor !== nextEndCursor) {\n this.trigger(\"change\", {\n prevStartCursor,\n prevEndCursor,\n nextStartCursor,\n nextEndCursor,\n });\n\n if (!hasVirtualItems) {\n return;\n }\n }\n\n // If a virtual item is included, a requestPrepend (or requestAppend) event is triggered.\n if (hasVirtualItems) {\n const isStartVirtual = nextVisibleItems[0]?.isVirtual;\n const isEndVirtual = nextVisibleItems[nextVisibleItems.length - 1]?.isVirtual;\n\n if ((!isDirectionEnd || !isEnd) && isStartVirtual) {\n const realItemIndex = findIndex(nextVisibleItems, (item) => !item.isVirtual);\n const endVirtualItemIndex = (realItemIndex === -1 ? nextVisibleItems.length : realItemIndex) - 1;\n\n if (nextVisibleItems[endVirtualItemIndex]) {\n this.trigger(\"requestPrepend\", {\n key: realItemIndex > -1 ? nextVisibleItems[realItemIndex].key : undefined,\n nextKey: nextVisibleItems[endVirtualItemIndex].key,\n nextKeys: nextVisibleItems.slice(0, endVirtualItemIndex + 1).map((item) => item.key),\n isVirtual: true,\n });\n }\n } else if ((isDirectionEnd || !isStart) && isEndVirtual) {\n const realItemIndex = findLastIndex(nextVisibleItems, (item) => !item.isVirtual);\n const startVirtualItemIndex = realItemIndex + 1;\n\n if (nextVisibleItems[startVirtualItemIndex]) {\n this.trigger(\"requestAppend\", {\n key: realItemIndex > -1 ? nextVisibleItems[realItemIndex].key : undefined,\n nextKey: nextVisibleItems[startVirtualItemIndex].key,\n nextKeys: nextVisibleItems.slice(startVirtualItemIndex).map((item) => item.key),\n isVirtual: true,\n });\n }\n }\n } else if (!this._requestVirtualItems()) {\n if ((!isDirectionEnd || !isEnd) && isStart) {\n this.trigger(\"requestPrepend\", {\n key: items[prevStartCursor].key,\n isVirtual: false,\n });\n } else if ((isDirectionEnd || !isStart) && isEnd) {\n this.trigger(\"requestAppend\", {\n key: items[prevEndCursor].key,\n isVirtual: false,\n });\n }\n }\n }\n\n /**\n * Call the requestAppend or requestPrepend event to fill the virtual items.\n * @ko virtual item을 채우기 위해 requestAppend 또는 requestPrepend 이벤트를 호출합니다.\n * @return - Whether the event is called. <ko>이벤트를 호출했는지 여부.</ko>\n */\n public _requestVirtualItems() {\n const isDirectionEnd = this.options.defaultDirection === \"end\";\n const items = this.items;\n const totalVisibleItems = this.getVisibleItems();\n const visibleItems = totalVisibleItems.filter((item) => !item.isVirtual);\n const totalVisibleLength = totalVisibleItems.length;\n const visibleLength = visibleItems.length;\n const startCursor = this.getStartCursor();\n const endCursor = this.getEndCursor();\n\n if (visibleLength === totalVisibleLength) {\n return false;\n } else if (visibleLength) {\n const startKey = visibleItems[0].key;\n const endKey = visibleItems[visibleLength - 1].key;\n const startIndex = findIndex(items, (item) => item.key === startKey) - 1;\n const endIndex = findIndex(items, (item) => item.key === endKey) + 1;\n\n const isEnd = endIndex <= endCursor;\n const isStart = startIndex >= startCursor;\n\n // Fill the placeholder with the original item.\n if ((isDirectionEnd || !isStart) && isEnd) {\n this.trigger(\"requestAppend\", {\n key: endKey,\n nextKey: items[endIndex].key,\n isVirtual: true,\n });\n return true;\n } else if ((!isDirectionEnd || !isEnd) && isStart) {\n this.trigger(\"requestPrepend\", {\n key: startKey,\n nextKey: items[startIndex].key,\n isVirtual: true,\n });\n return true;\n }\n } else if (totalVisibleLength) {\n const lastItem = totalVisibleItems[totalVisibleLength - 1];\n\n if (isDirectionEnd) {\n this.trigger(\"requestAppend\", {\n nextKey: totalVisibleItems[0].key,\n isVirtual: true,\n });\n } else {\n this.trigger(\"requestPrepend\", {\n nextKey: lastItem.key,\n isVirtual: true,\n });\n }\n return true;\n }\n return false;\n }\n public setCursors(startCursor: number, endCursor: number) {\n this.startCursor = startCursor;\n this.endCursor = endCursor;\n }\n public setSize(size: number) {\n this.size = size;\n }\n public getStartCursor() {\n return this.startCursor;\n }\n public getEndCursor() {\n return this.endCursor;\n }\n public isLoading(direction: \"start\" | \"end\") {\n const startCursor = this.startCursor;\n const endCursor = this.endCursor;\n const items = this.items;\n const firstItem = items[startCursor]!;\n const lastItem = items[endCursor]!;\n const length = items.length;\n\n if (\n direction === DIRECTION.END\n && endCursor > -1\n && endCursor < length - 1\n && !lastItem.isVirtual\n && !isFlatOutline(lastItem.startOutline, lastItem.endOutline)\n ) {\n return false;\n }\n if (\n direction === DIRECTION.START\n && startCursor > 0\n && !firstItem.isVirtual\n && !isFlatOutline(firstItem.startOutline, firstItem.endOutline)\n ) {\n return false;\n }\n return true;\n }\n public setItems(nextItems: InfiniteItem[]) {\n this.items = nextItems;\n\n const itemKeys: Record<string | number, InfiniteItem> = {};\n\n nextItems.forEach((item) => {\n itemKeys[item.key] = item;\n });\n this.itemKeys = itemKeys;\n }\n public syncItems(nextItems: InfiniteItem[]) {\n const prevItems = this.items;\n const prevStartCursor = this.startCursor;\n const prevEndCursor = this.endCursor;\n const {\n startCursor: nextStartCursor,\n endCursor: nextEndCursor,\n } = getNextCursors(\n this.items.map((item) => item.key),\n nextItems.map((item) => item.key),\n prevStartCursor,\n prevEndCursor,\n );\n // sync items between cursors\n let isChange = nextEndCursor - nextStartCursor !== prevEndCursor - prevStartCursor\n || (prevStartCursor === -1 || nextStartCursor === -1);\n\n if (!isChange) {\n const prevVisibleItems = prevItems.slice(prevStartCursor, prevEndCursor + 1);\n const nextVisibleItems = nextItems.slice(nextStartCursor, nextEndCursor + 1);\n const visibleResult = diff(prevVisibleItems, nextVisibleItems, (item) => item.key);\n\n isChange = visibleResult.added.length > 0\n || visibleResult.removed.length > 0\n || visibleResult.changed.length > 0;\n }\n this.setItems(nextItems);\n this.setCursors(nextStartCursor, nextEndCursor);\n return isChange;\n }\n public getItems() {\n return this.items;\n }\n public getVisibleItems() {\n const startCursor = this.startCursor;\n const endCursor = this.endCursor;\n\n if (startCursor === -1) {\n return [];\n }\n return this.items.slice(startCursor, endCursor + 1);\n }\n public getItemByKey(key: string | number) {\n return this.itemKeys[key];\n }\n public getRenderedVisibleItems() {\n const items = this.getVisibleItems();\n const rendered = items.map(({ startOutline, endOutline }) => {\n const length = startOutline.length;\n\n if (length === 0 || length !== endOutline.length) {\n return false;\n }\n return startOutline.some((pos, i) => endOutline[i] !== pos);\n });\n const startIndex = rendered.indexOf(true);\n const endIndex = rendered.lastIndexOf(true);\n\n return endIndex === -1 ? [] : items.slice(startIndex, endIndex + 1);\n }\n public destroy() {\n this.off();\n this.startCursor = -1;\n this.endCursor = -1;\n this.items = [];\n this.size = 0;\n }\n}\n","import Component from \"@egjs/component\";\nimport { diff, DiffResult } from \"@egjs/list-differ\";\nimport { toArray } from \"../utils\";\n\nexport interface RendererItem {\n key: string | number;\n renderKey?: string;\n element?: Element | null;\n}\n\nexport interface OnRendererUpdated<T extends RendererItem = RendererItem> {\n items: T[];\n elements: Element[];\n isChanged: boolean;\n isItemChanged: boolean;\n state: Record<string, any>;\n diffResult: DiffResult<T>;\n}\n\nexport interface OnRendererUpdate {\n state: Record<string, any>;\n}\nexport interface RendererEvents<T extends RendererItem = RendererItem> {\n update: OnRendererUpdate;\n updated: OnRendererUpdated<T>;\n requestUpdate: OnRendererUpdate;\n}\n\nexport class Renderer<Item extends RendererItem = RendererItem> extends Component<RendererEvents> {\n protected items: Item[] = [];\n protected container: Element | null = null;\n protected rendererKey = 0;\n private _diffResult: DiffResult<Item>;\n private _updateTimer = 0;\n private _state: Record<string, any> = {};\n private _isItemChanged = false;\n\n public updateKey() {\n this.rendererKey = Date.now();\n }\n\n public getItems() {\n return this.items;\n }\n public setContainer(container: Element) {\n this.container = container;\n }\n public render(nextItems: Item[], state?: Record<string, any>) {\n return this.syncItems(nextItems, state);\n }\n public update(state: Record<string, any> = {}) {\n this._state = { ...this._state, ...state };\n this.trigger(\"update\", {\n state,\n });\n\n clearTimeout(this._updateTimer);\n this._updateTimer = window.setTimeout(() => {\n this.trigger(\"requestUpdate\", {\n state,\n });\n });\n }\n public updated(nextElements: ArrayLike<Element> = this.container?.children ?? []) {\n const diffResult = this._diffResult;\n const isChanged = !!(diffResult.added.length || diffResult.removed.length || diffResult.changed.length);\n const state = this._state;\n const isItemChanged = this._isItemChanged;\n const nextItems = diffResult.list;\n\n\n this._isItemChanged = false;\n this._state = {};\n this.items = nextItems;\n nextItems.forEach((item, i) => {\n item.element = nextElements[i];\n });\n\n\n this.trigger(\"updated\", {\n items: nextItems,\n elements: toArray(nextElements),\n diffResult: this._diffResult,\n state,\n isItemChanged,\n isChanged,\n });\n\n return isChanged;\n }\n public syncItems(items: Item[], state: Record<string, any> = {}) {\n const rendererKey = this.rendererKey;\n const prevItems = this.items;\n const nextItems = items.map((item) => ({\n ...item,\n renderKey: `${rendererKey}_${item.key}`,\n }));\n const result = diff(prevItems, nextItems, (item) => item.renderKey!);\n\n this._isItemChanged = !!result.added.length || !!result.removed.length || !!result.changed.length;\n this._state = { ...this._state, ...state };\n this._diffResult = result;\n\n return result;\n }\n public destroy() {\n this.off();\n }\n}\n","import { Renderer, RendererItem } from \"./Renderer\";\n\nexport class VanillaRenderer<Item extends RendererItem = RendererItem> extends Renderer<Item> {\n public render(nextItems: Item[], state?: Record<string, any>) {\n const container = this.container!;\n const result = super.render(nextItems, state);\n const {\n prevList,\n removed,\n ordered,\n added,\n list,\n } = result;\n const diffList = [...prevList];\n\n\n removed.forEach((index) => {\n diffList.splice(index, 1);\n container.removeChild(prevList[index].element!);\n });\n ordered.forEach(([prevIndex, nextIndex]) => {\n const item = diffList.splice(prevIndex, 1)[0];\n\n diffList.splice(nextIndex, 0, item);\n container.insertBefore(item.element!, diffList[nextIndex + 1]?.element ?? null);\n });\n added.forEach((index) => {\n const item = list[index];\n\n diffList.splice(index, 0, item);\n container.insertBefore(item.element!, diffList[index + 1]?.element ?? null);\n });\n\n this.updated(container.children);\n return result;\n }\n}\n","import { InfiniteGridItem } from \"../InfiniteGridItem\";\nimport { convertHTMLtoElement } from \"../utils\";\nimport { RendererItem } from \"./Renderer\";\nimport { VanillaRenderer } from \"./VanillaRenderer\";\n\nexport interface GridRendererItem extends RendererItem {\n orgItem: InfiniteGridItem;\n}\n\nexport class VanillaGridRenderer extends VanillaRenderer<GridRendererItem> {\n public syncItems(nextItems: GridRendererItem[]) {\n const result = super.syncItems(nextItems);\n const {\n added,\n list,\n } = result;\n added.forEach((index) => {\n const orgItem = nextItems[index].orgItem;\n\n if (orgItem.html && !orgItem.element) {\n orgItem.element = convertHTMLtoElement(orgItem.html)[0];\n }\n list[index].element = orgItem.element!;\n });\n\n return result;\n }\n}\n","import { findTarget, Ref } from \"@cfcs/core\";\nimport Component, { ComponentEvent } from \"@egjs/component\";\nimport { CONTAINER_CLASS_NAME, IS_IOS } from \"./consts\";\nimport { OnChangeScroll } from \"./types\";\nimport { isWindow, toArray } from \"./utils\";\n\nexport interface ScrollManagerOptions {\n scrollContainer?: HTMLElement | string | Ref<HTMLElement> | null;\n container?: boolean | HTMLElement | string | Ref<HTMLElement>;\n containerTag?: string;\n horizontal?: boolean;\n}\n\nexport interface ScrollManagerStatus {\n contentSize: number;\n scrollOffset: number;\n prevScrollPos: number;\n}\n\n\nexport interface ScrollManagerEvents {\n scroll: OnChangeScroll;\n}\n\nexport class ScrollManager extends Component<ScrollManagerEvents> {\n public options: Required<ScrollManagerOptions>;\n protected prevScrollPos: number | null = null;\n protected eventTarget: HTMLElement | Window;\n protected scrollOffset = 0;\n protected contentSize = 0;\n protected container: HTMLElement;\n protected scrollContainer: HTMLElement;\n private _orgCSSText: string;\n private _isScrollIssue = IS_IOS;\n private _isCreateElement: boolean;\n\n constructor(\n protected wrapper: HTMLElement,\n options: ScrollManagerOptions,\n ) {\n super();\n this.options = {\n container: false,\n containerTag: \"div\",\n horizontal: false,\n scrollContainer: null,\n ...options,\n };\n\n this._init();\n }\n public getWrapper() {\n return this.wrapper;\n }\n public getContainer() {\n return this.container;\n }\n public getScrollContainer() {\n return this.scrollContainer;\n }\n public getScrollOffset() {\n return this.scrollOffset;\n }\n public getContentSize() {\n return this.contentSize;\n }\n public getRelativeScrollPos() {\n return (this.prevScrollPos || 0) - this.scrollOffset;\n }\n public getScrollPos() {\n return this.prevScrollPos;\n }\n public setScrollPos(pos: number) {\n this.prevScrollPos = pos;\n }\n public getOrgScrollPos() {\n const eventTarget = this.eventTarget;\n const horizontal = this.options.horizontal;\n\n const prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n if (isWindow(eventTarget)) {\n return window[horizontal ? \"pageXOffset\" : \"pageYOffset\"]\n || document.documentElement[prop] || document.body[prop];\n } else {\n return eventTarget[prop];\n }\n }\n public setStatus(status: ScrollManagerStatus) {\n this.contentSize = status.contentSize;\n this.scrollOffset = status.scrollOffset;\n this.prevScrollPos = status.prevScrollPos;\n\n this.scrollTo(this.prevScrollPos);\n }\n public getStatus(): ScrollManagerStatus {\n return {\n contentSize: this.contentSize,\n scrollOffset: this.scrollOffset,\n prevScrollPos: this.prevScrollPos!,\n };\n }\n public scrollTo(pos: number) {\n const eventTarget = this.eventTarget;\n const horizontal = this.options.horizontal;\n const [x, y] = horizontal ? [pos, 0] : [0, pos];\n\n if (isWindow(eventTarget)) {\n eventTarget.scroll(x, y);\n } else {\n eventTarget.scrollLeft = x;\n eventTarget.scrollTop = y;\n }\n }\n public scrollBy(pos: number) {\n if (!pos) {\n return;\n }\n const eventTarget = this.eventTarget;\n const horizontal = this.options.horizontal;\n const [x, y] = horizontal ? [pos, 0] : [0, pos];\n\n\n this.prevScrollPos! += pos;\n\n if (isWindow(eventTarget)) {\n eventTarget.scrollBy(x, y);\n } else {\n eventTarget.scrollLeft += x;\n eventTarget.scrollTop += y;\n }\n }\n public resize() {\n const scrollContainer = this.scrollContainer;\n const horizontal = this.options.horizontal;\n const isBody = scrollContainer === document.body;\n const scrollContainerRect = isBody\n ? { top: 0, left: 0 }\n : scrollContainer.getBoundingClientRect();\n const containerRect = this.container.getBoundingClientRect();\n\n this.scrollOffset = (this.prevScrollPos! || 0) + (horizontal\n ? containerRect.left - scrollContainerRect.left\n : containerRect.top - scrollContainerRect.top);\n\n if (isBody) {\n this.contentSize = horizontal ? window.innerWidth : window.innerHeight;\n } else {\n this.contentSize = horizontal ? scrollContainer.offsetWidth : scrollContainer.offsetHeight;\n }\n }\n public destroy() {\n const container = this.container;\n\n this.eventTarget.removeEventListener(\"scroll\", this._onCheck);\n\n if (this._isCreateElement) {\n const scrollContainer = this.scrollContainer;\n\n const fragment = document.createDocumentFragment();\n const childNodes = toArray(container.childNodes);\n\n scrollContainer.removeChild(container);\n childNodes.forEach((childNode) => {\n fragment.appendChild(childNode);\n });\n scrollContainer.appendChild(fragment);\n } else if (this.options.container) {\n container.style.cssText = this._orgCSSText;\n }\n }\n private _init() {\n const {\n container: containerOption,\n containerTag,\n horizontal,\n scrollContainer: scrollContainerOption,\n } = this.options;\n const wrapper = this.wrapper;\n let scrollContainer = wrapper;\n let container = wrapper;\n let containerCSSText = \"\";\n\n if (!containerOption) {\n scrollContainer = findTarget(scrollContainerOption) || document.body;\n containerCSSText = container.style.cssText;\n } else {\n if (containerOption === true) {\n // Create Container\n container = document.createElement(containerTag) as HTMLElement;\n\n container.style.position = \"relative\";\n container.className = CONTAINER_CLASS_NAME;\n const childNodes = toArray(scrollContainer.childNodes);\n\n childNodes.forEach((childNode) => {\n container.appendChild(childNode);\n });\n scrollContainer.appendChild(container);\n\n this._isCreateElement = true;\n } else {\n // Find Container\n container = findTarget(containerOption)!;\n }\n containerCSSText = container.style.cssText;\n\n const style = scrollContainer.style;\n\n [style.overflowX, style.overflowY] = horizontal ? [\"scroll\", \"hidden\"] : [\"hidden\", \"scroll\"];\n\n if (horizontal) {\n container.style.height = \"100%\";\n }\n }\n const eventTarget = scrollContainer === document.body ? window : scrollContainer;\n\n eventTarget.addEventListener(\"scroll\", this._onCheck);\n this._orgCSSText = containerCSSText;\n this.container = container;\n this.scrollContainer = scrollContainer;\n this.eventTarget = eventTarget;\n this.resize();\n this.setScrollPos(this.getOrgScrollPos());\n }\n private _onCheck = () => {\n const prevScrollPos = this.getScrollPos();\n const nextScrollPos = this.getOrgScrollPos();\n\n this.setScrollPos(nextScrollPos);\n\n if (prevScrollPos === null || (this._isScrollIssue && nextScrollPos === 0) || prevScrollPos === nextScrollPos) {\n nextScrollPos && (this._isScrollIssue = false);\n return;\n }\n this._isScrollIssue = false;\n this.trigger(new ComponentEvent(\"scroll\", {\n direction: prevScrollPos < nextScrollPos ? \"end\" : \"start\",\n scrollPos: nextScrollPos,\n relativeScrollPos: this.getRelativeScrollPos(),\n }));\n }\n}\n","import Component, { ComponentEvent } from \"@egjs/component\";\nimport Grid, {\n ContainerManager,\n DEFAULT_GRID_OPTIONS,\n Properties,\n RenderOptions,\n MOUNT_STATE,\n OnContentError,\n ItemRenderer,\n GridItem,\n ResizeWatcherResizeEvent,\n getUpdatedItems,\n} from \"@egjs/grid\";\nimport {\n DIRECTION,\n GROUP_TYPE,\n INFINITEGRID_EVENTS, INFINITEGRID_PROPERTY_TYPES,\n ITEM_TYPE, STATUS_TYPE,\n} from \"./consts\";\nimport { GroupManager } from \"./GroupManager\";\nimport {\n Infinite,\n OnInfiniteChange,\n OnInfiniteRequestAppend,\n OnInfiniteRequestPrepend,\n} from \"./Infinite\";\nimport { InfiniteGridItem, InfiniteGridItemStatus } from \"./InfiniteGridItem\";\nimport { OnRendererUpdated } from \"./Renderer/Renderer\";\nimport { GridRendererItem, VanillaGridRenderer } from \"./Renderer/VanillaGridRenderer\";\nimport { ScrollManager } from \"./ScrollManager\";\nimport {\n InfiniteGridEvents, InfiniteGridGroup,\n InfiniteGridInsertedItems, InfiniteGridItemInfo,\n InfiniteGridOptions,\n InfiniteGridStatus,\n InsertedPlaceholdersResult,\n OnPickedRenderComplete,\n OnRequestInsert,\n OnChangeScroll,\n} from \"./types\";\nimport {\n InfiniteGridGetterSetter, toArray, convertInsertedItems, findIndex,\n findLastIndex, isString,\n} from \"./utils\";\n\n\n/**\n * A module used to arrange items including content infinitely according to layout type. With this module, you can implement various layouts composed of different items whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 아이템을 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 아이템을 다양한 레이아웃으로 배치할 수 있다. 아이템의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @extends Component\n * @support {\"ie\": \"9+(with polyfill)\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"4.X+\"}\n * @example\n```html\n<ul id=\"grid\">\n <li class=\"card\">\n <div>test1</div>\n </li>\n <li class=\"card\">\n <div>test2</div>\n </li>\n <li class=\"card\">\n <div>test3</div>\n </li>\n <li class=\"card\">\n <div>test4</div>\n </li>\n <li class=\"card\">\n <div>test5</div>\n </li>\n <li class=\"card\">\n <div>test6</div>\n </li>\n</ul>\n<script>\nimport { MasonryInfiniteGrid } from \"@egjs/infinitegrid\";\nvar some = new MasonryInfiniteGrid(\"#grid\").on(\"renderComplete\", function(e) {\n // ...\n});\n// If you already have items in the container, call \"layout\" method.\nsome.renderItems();\n</script>\n```\n */\n@InfiniteGridGetterSetter\nclass InfiniteGrid<Options extends InfiniteGridOptions = InfiniteGridOptions> extends Component<InfiniteGridEvents> {\n public static defaultOptions = {\n ...DEFAULT_GRID_OPTIONS,\n container: false,\n containerTag: \"div\",\n renderer: null,\n threshold: 100,\n useRecycle: true,\n scrollContainer: null,\n appliedItemChecker: (() => false) as (item: InfiniteGridItem, grid: Grid) => boolean,\n } as Required<InfiniteGridOptions>;\n public static propertyTypes = INFINITEGRID_PROPERTY_TYPES;\n protected wrapperElement: HTMLElement;\n protected scrollManager: ScrollManager;\n protected itemRenderer: ItemRenderer;\n protected containerManager: ContainerManager;\n protected infinite: Infinite;\n protected groupManager: GroupManager;\n protected options: Required<Options>;\n private _waitType: \"\" | \"start\" | \"end\" = \"\";\n /**\n * @param - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param - The option object of the InfiniteGrid module <ko>eg.InfiniteGrid 모듈의 옵션 객체</ko>\n */\n constructor(wrapper: HTMLElement | string, options: Options) {\n super();\n this.options = {\n ...((this.constructor as typeof InfiniteGrid).defaultOptions as Required<Options>),\n renderer: new VanillaGridRenderer().on(\"requestUpdate\", () => this._render()),\n ...options,\n };\n\n const {\n gridConstructor,\n containerTag,\n container,\n renderer,\n threshold,\n useRecycle,\n scrollContainer,\n appliedItemChecker,\n ...gridOptions\n } = this.options;\n // options.container === false, wrapper = container, scrollContainer = document.body\n // options.container === true, wrapper = scrollContainer, container = wrapper's child\n // options.container === string,\n const {\n horizontal,\n attributePrefix,\n useTransform,\n percentage,\n isConstantSize,\n isEqualSize,\n autoResize,\n useResizeObserver,\n resizeDebounce,\n maxResizeDebounce,\n defaultDirection,\n } = gridOptions;\n const wrapperElement = isString(wrapper) ? document.querySelector(wrapper) as HTMLElement : wrapper;\n const scrollManager = new ScrollManager(wrapperElement, {\n scrollContainer,\n container,\n containerTag,\n horizontal,\n }).on({\n scroll: this._onScroll,\n });\n const containerElement = scrollManager.getContainer();\n const containerManager = new ContainerManager(containerElement, {\n horizontal,\n autoResize,\n resizeDebounce,\n maxResizeDebounce,\n useResizeObserver,\n }).on(\"resize\", this._onResize);\n const itemRenderer = new ItemRenderer({\n attributePrefix,\n horizontal,\n useTransform,\n percentage,\n isEqualSize,\n isConstantSize,\n });\n const infinite = new Infinite({\n defaultDirection,\n useRecycle,\n threshold,\n }).on({\n \"change\": this._onChange,\n \"requestAppend\": this._onRequestAppend,\n \"requestPrepend\": this._onRequestPrepend,\n });\n\n infinite.setSize(scrollManager.getContentSize());\n const groupManager = new GroupManager(containerElement, {\n appliedItemChecker: appliedItemChecker!,\n gridConstructor: gridConstructor!,\n externalItemRenderer: itemRenderer,\n externalContainerManager: containerManager,\n gridOptions,\n });\n\n groupManager.on({\n \"renderComplete\": this._onRenderComplete,\n \"contentError\": this._onContentError,\n });\n\n renderer!.setContainer(containerElement);\n renderer!.on(\"updated\", this._onRendererUpdated);\n\n this.itemRenderer = itemRenderer;\n this.groupManager = groupManager;\n this.wrapperElement = wrapperElement;\n this.scrollManager = scrollManager;\n this.containerManager = containerManager;\n this.infinite = infinite;\n\n this.containerManager.resize();\n }\n /**\n * Rearrange items to fit the grid and render them. When rearrange is complete, the `renderComplete` event is fired.\n * @ko grid에 맞게 아이템을 재배치하고 렌더링을 한다. 배치가 완료되면 `renderComplete` 이벤트가 발생한다.\n * @param - Options for rendering. <ko>렌더링을 하기 위한 옵션.</ko>\n * @example\n * ```ts\n * import { MasonryInfiniteGrid } from \"@egjs/infinitegrid\";\n * const grid = new MasonryInfiniteGrid();\n *\n * grid.on(\"renderComplete\", e => {\n * console.log(e);\n * });\n * grid.renderItems();\n * ```\n */\n public renderItems(options: RenderOptions = {}) {\n this._renderItems(options);\n return this;\n }\n /**\n * Returns the wrapper element specified by the user.\n * @ko 컨테이너 엘리먼트를 반환한다.\n */\n public getWrapperElement() {\n return this.scrollManager.getWrapper();\n }\n /**\n * Returns the container element corresponding to the scroll area.\n * @ko 스크롤 영역에 해당하는 컨테이너 엘리먼트를 반환한다.\n */\n public getScrollContainerElement() {\n return this.scrollManager.getScrollContainer();\n }\n /**\n * Returns the container element containing item elements.\n * @ko 아이템 엘리먼트들을 담긴 컨테이너 엘리먼트를 반환한다.\n */\n public getContainerElement() {\n return this.scrollManager.getContainer();\n }\n /**\n * When items change, it synchronizes and renders items.\n * @ko items가 바뀐 경우 동기화를 하고 렌더링을 한다.\n * @param - Options for rendering. <ko>렌더링을 하기 위한 옵션.</ko>\n */\n public syncItems(items: InfiniteGridItemInfo[]): this {\n this.groupManager.syncItems(items);\n this._syncGroups();\n\n return this;\n }\n /**\n * Change the currently visible groups.\n * @ko 현재 보이는 그룹들을 바꾼다.\n * @param - first index of visible groups. <ko>보이는 그룹의 첫번째 index.</ko>\n * @param - last index of visible groups. <ko>보이는 그룹의 마지막 index.</ko>\n * @param - Whether the first rendering has already been done. <ko>첫 렌더링이 이미 되어있는지 여부.</ko>\n */\n public setCursors(startCursor: number, endCursor: number, useFirstRender?: boolean): this {\n this.groupManager.setCursors(startCursor, endCursor);\n this.infinite.setCursors(startCursor, endCursor);\n\n if (useFirstRender) {\n this._syncItems();\n } else {\n this._update();\n this._checkEndLoading();\n }\n return this;\n }\n /**\n * Returns the first index of visible groups.\n * @ko 보이는 그룹들의 첫번째 index를 반환한다.\n */\n public getStartCursor(): number {\n return this.infinite.getStartCursor();\n }\n /**\n * Returns the last index of visible groups.\n * @ko 보이는 그룹들의 마지막 index를 반환한다.\n */\n public getEndCursor(): number {\n return this.infinite.getEndCursor();\n }\n /**\n * Add items at the bottom(right) of the grid.\n * @ko 아이템들을 grid 아래(오른쪽)에 추가한다.\n * @param - items to be added <ko>추가할 아이템들</ko>\n * @param - The group key to be configured in items. It is automatically generated by default. <ko>추가할 아이템에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.</ko>\n * @return - An instance of a module itself<ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * ig.append(`<div class=\"item\">test1</div><div class=\"item\">test2</div>`);\n * ig.append([`<div class=\"item\">test1</div>`, `<div class=\"item\">test2</div>`]);\n * ig.append([HTMLElement1, HTMLElement2]);\n * ```\n */\n public append(items: InfiniteGridInsertedItems, groupKey?: string | number): this {\n return this.insert(-1, items, groupKey);\n }\n /**\n * Add items at the top(left) of the grid.\n * @ko 아이템들을 grid 위(왼쪽)에 추가한다.\n * @param - items to be added <ko>추가할 아이템들</ko>\n * @param - The group key to be configured in items. It is automatically generated by default. <ko>추가할 아이템에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.</ko>\n * @return - An instance of a module itself<ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```ts\n * ig.prepend(`<div class=\"item\">test1</div><div class=\"item\">test2</div>`);\n * ig.prepend([`<div class=\"item\">test1</div>`, `<div class=\"item\">test2</div>`]);\n * ig.prepend([HTMLElement1, HTMLElement2]);\n * ```\n */\n public prepend(items: InfiniteGridInsertedItems, groupKey?: string | number): this {\n return this.insert(0, items, groupKey);\n }\n /**\n * Add items to a specific index.\n * @ko 아이템들을 특정 index에 추가한다.\n * @param - index to add <ko>추가하기 위한 index</ko>\n * @param - items to be added <ko>추가할 아이템들</ko>\n * @param - The group key to be configured in items. It is automatically generated by default. <ko>추가할 아이템에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.</ko>\n * @return - An instance of a module itself<ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```ts\n * ig.insert(2, `<div class=\"item\">test1</div><div class=\"item\">test2</div>`);\n * ig.insert(3, [`<div class=\"item\">test1</div>`, `<div class=\"item\">test2</div>`]);\n * ig.insert(4, [HTMLElement1, HTMLElement2]);\n * ```\n */\n public insert(index: number, items: InfiniteGridInsertedItems, groupKey?: string | number): this {\n const nextItemInfos: InfiniteGridItemInfo[] = this.groupManager.getGroupItems();\n const itemInfos = convertInsertedItems(items, groupKey);\n\n if (index === -1) {\n nextItemInfos.push(...itemInfos);\n } else {\n nextItemInfos.splice(index, 0, ...itemInfos);\n }\n return this.syncItems(nextItemInfos);\n }\n /**\n * Add items based on group index.\n * @ko group의 index 기준으로 item들을 추가한다.\n * @param - group index to add <ko>추가하기 위한 group의 index</ko>\n * @param - items to be added <ko>추가할 아이템들</ko>\n * @param - The group key to be configured in items. It is automatically generated by default. <ko>추가할 아이템에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.</ko>\n * @return - An instance of a module itself<ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```ts\n * ig.insertByGroupIndex(2, `<div class=\"item\">test1</div><div class=\"item\">test2</div>`);\n * ig.insertByGroupIndex(3, [`<div class=\"item\">test1</div>`, `<div class=\"item\">test2</div>`]);\n * ig.insertByGroupIndex(4, [HTMLElement1, HTMLElement2]);\n * ```\n */\n public insertByGroupIndex(groupIndex: number, items: InfiniteGridInsertedItems, groupKey?: string | number): this {\n const nextGroupInfos: InfiniteGridGroup[] = this.groupManager.getGroups();\n const rightGroup = nextGroupInfos[groupIndex];\n\n if (!rightGroup) {\n return this.append(items, groupKey);\n }\n const nextItemInfos: InfiniteGridItemInfo[] = this.groupManager.getGroupItems();\n const rightGroupKey = rightGroup.groupKey;\n const rightItemIndex = findIndex(nextItemInfos, (item) => item.groupKey === rightGroupKey);\n\n return this.insert(rightItemIndex, items, groupKey);\n }\n /**\n * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n * @ko 아이템의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n * @param - STATUS_TYPE.NOT_REMOVE = Get all information about items. STATUS_TYPE.REMOVE_INVISIBLE_ITEMS = Get information on visible items only. STATUS_TYPE.MINIMIZE_INVISIBLE_ITEMS = Compress invisible items. You can replace it with a placeholder. STATUS_TYPE.MINIMIZE_INVISIBLE_GROUPS = Compress invisible groups. <ko> STATUS_TYPE.NOT_REMOVE = 모든 아이템들의 정보를 가져온다. STATUS_TYPE.REMOVE_INVISIBLE_ITEMS = 보이는 아이템들의 정보만 가져온다. STATUS_TYPE.MINIMIZE_INVISIBLE_ITEMS = 안보이는 아이템들을 압축한다. placeholder로 대체가 가능하다. STATUS_TYPE.MINIMIZE_INVISIBLE_GROUPS = 안보이는 그룹을 압축한다.</ko>\n * @param - Whether to include items corresponding to placeholders. <ko>placeholder에 해당하는 아이템들을 포함할지 여부.</ko>\n */\n public getStatus(type?: STATUS_TYPE, includePlaceholders?: boolean): InfiniteGridStatus {\n return {\n containerManager: this.containerManager.getStatus(),\n itemRenderer: this.itemRenderer.getStatus(),\n groupManager: this.groupManager.getGroupStatus(type, includePlaceholders),\n scrollManager: this.scrollManager.getStatus(),\n };\n }\n\n /**\n * You can set placeholders to restore status or wait for items to be added.\n * @ko status 복구 또는 아이템 추가 대기를 위한 placeholder를 설정할 수 있다.\n * @param - The placeholder status. <ko>placeholder의 status</ko>\n */\n public setPlaceholder(info: Partial<InfiniteGridItemStatus> | null): this {\n this.groupManager.setPlaceholder(info);\n return this;\n }\n /**\n * You can set placeholders to restore status or wait for items to be added.\n * @ko status 복구 또는 아이템 추가 대기를 위한 placeholder를 설정할 수 있다.\n * @param - The placeholder status. <ko>placeholder의 status</ko>\n */\n public setLoading(info: Partial<InfiniteGridItemStatus> | null): this {\n this.groupManager.setLoading(info);\n return this;\n }\n /**\n * Add the placeholder at the end.\n * @ko placeholder들을 마지막에 추가한다.\n * @param - Items that correspond to placeholders. If it is a number, it duplicates the number of copies. <ko>placeholder에 해당하는 아이템들. 숫자면 갯수만큼 복제를 한다.</ko>\n * @param - The group key to be configured in items. It is automatically generated by default. <ko>추가할 아이템에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.</ko>\n */\n public appendPlaceholders(\n items: number | InfiniteGridItemStatus[],\n groupKey?: string | number,\n ): InsertedPlaceholdersResult {\n const result = this.groupManager.appendPlaceholders(items, groupKey);\n\n this._syncGroups(true);\n return {\n ...result,\n remove: () => {\n this.removePlaceholders({ groupKey: result.group.groupKey });\n },\n };\n }\n /**\n * Add the placeholder at the start.\n * @ko placeholder들을 처음에 추가한다.\n * @param - Items that correspond to placeholders. If it is a number, it duplicates the number of copies. <ko>placeholder에 해당하는 아이템들. 숫자면 갯수만큼 복제를 한다.</ko>\n * @param - The group key to be configured in items. It is automatically generated by default. <ko>추가할 아이템에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.</ko>\n */\n public prependPlaceholders(\n items: number | InfiniteGridItemStatus[],\n groupKey?: string | number,\n ): InsertedPlaceholdersResult {\n const result = this.groupManager.prependPlaceholders(items, groupKey);\n\n this._syncGroups(true);\n return {\n ...result,\n remove: () => {\n this.removePlaceholders({ groupKey: result.group.groupKey });\n },\n };\n }\n\n /**\n * Remove placeholders\n * @ko placeholder들을 삭제한다.\n * @param type - Remove the placeholders corresponding to the groupkey. When \"start\" or \"end\", remove all placeholders in that direction. <ko>groupkey에 해당하는 placeholder들을 삭제한다. \"start\" 또는 \"end\" 일 때 해당 방향의 모든 placeholder들을 삭제한다.</ko>\n */\n public removePlaceholders(type: \"start\" | \"end\" | { groupKey: string | number }) {\n this.groupManager.removePlaceholders(type);\n this._syncGroups(true);\n }\n\n /**\n * Sets the status of the InfiniteGrid module with the information returned through a call to the getStatus() method.\n * @ko getStatus() 메서드가 저장한 정보로 InfiniteGrid 모듈의 상태를 설정한다.\n * @param - status object of the InfiniteGrid module. <ko>InfiniteGrid 모듈의 status 객체.</ko>\n * @param - Whether the first rendering has already been done. <ko>첫 렌더링이 이미 되어있는지 여부.</ko>\n */\n public setStatus(status: InfiniteGridStatus, useFirstRender?: boolean): this {\n this.itemRenderer.setStatus(status.itemRenderer);\n this.containerManager.setStatus(status.containerManager);\n this.scrollManager.setStatus(status.scrollManager);\n const groupManager = this.groupManager;\n const prevInlineSize = this.containerManager.getInlineSize();\n\n groupManager.setGroupStatus(status.groupManager);\n this._syncInfinite();\n this.infinite.setCursors(groupManager.getStartCursor(), groupManager.getEndCursor());\n\n this._getRenderer().updateKey();\n\n const state = {\n isResize: this.containerManager.getInlineSize() !== prevInlineSize,\n isRestore: true,\n };\n if (useFirstRender) {\n this._syncItems(state);\n } else {\n this._update(state);\n }\n return this;\n }\n /**\n * Removes the group corresponding to index.\n * @ko index에 해당하는 그룹을 제거 한다.\n */\n public removeGroupByIndex(index: number): this {\n const nextGroups = this.getGroups();\n\n return this.removeGroupByKey(nextGroups[index].groupKey);\n }\n /**\n * Removes the group corresponding to key.\n * @ko key에 해당하는 그룹을 제거 한다.\n */\n public removeGroupByKey(key: number | string): this {\n const nextItemInfos = this.getItems();\n\n const firstIndex = findIndex(nextItemInfos, (item) => item.groupKey === key);\n const lastIndex = findLastIndex(nextItemInfos, (item) => item.groupKey === key);\n\n if (firstIndex === -1) {\n return this;\n }\n nextItemInfos.splice(firstIndex, lastIndex - firstIndex + 1);\n return this.syncItems(nextItemInfos);\n }\n /**\n * Removes the item corresponding to index.\n * @ko index에 해당하는 아이템을 제거 한다.\n */\n public removeByIndex(index: number): this {\n const nextItemInfos = this.getItems(true);\n\n nextItemInfos.splice(index, 1);\n\n return this.syncItems(nextItemInfos);\n }\n /**\n * Removes the item corresponding to key.\n * @ko key에 해당하는 아이템을 제거 한다.\n */\n public removeByKey(key: string | number): this {\n const nextItemInfos = this.getItems(true);\n const index = findIndex(nextItemInfos, (item) => item.key === key);\n\n return this.removeByIndex(index);\n }\n /**\n * Update the size of the items and render them.\n * @ko 아이템들의 사이즈를 업데이트하고 렌더링을 한다.\n * @param - Items to be updated. <ko>업데이트할 아이템들.</ko>\n * @param - Options for rendering. <ko>렌더링을 하기 위한 옵션.</ko>\n */\n public updateItems(items?: InfiniteGridItem[], options: RenderOptions = {}) {\n this.groupManager.updateItems(items, options);\n return this;\n }\n /**\n * Return all items of InfiniteGrid.\n * @ko InfiniteGrid의 모든 아이템들을 반환한다.\n * @param - Whether to include items corresponding to placeholders. <ko>placeholder에 해당하는 아이템들을 포함할지 여부.</ko>\n */\n public getItems(includePlaceholders?: boolean): InfiniteGridItem[] {\n return this.groupManager.getGroupItems(includePlaceholders);\n }\n /**\n * Return visible items of InfiniteGrid.\n * @ko InfiniteGrid의 보이는 아이템들을 반환한다.\n * @param - Whether to include items corresponding to placeholders. <ko>placeholder에 해당하는 아이템들을 포함할지 여부.</ko>\n */\n public getVisibleItems(includePlaceholders?: boolean): InfiniteGridItem[] {\n return this.groupManager.getVisibleItems(includePlaceholders);\n }\n\n /**\n * Return rendering items of InfiniteGrid.\n * @ko InfiniteGrid의 렌더링 아이템들을 반환한다.\n */\n public getRenderingItems(): InfiniteGridItem[] {\n return this.groupManager.getRenderingItems();\n }\n /**\n * Return all groups of InfiniteGrid.\n * @ko InfiniteGrid의 모든 그룹들을 반환한다.\n * @param - Whether to include groups corresponding to placeholders. <ko>placeholder에 해당하는 그룹들을 포함할지 여부.</ko>\n */\n public getGroups(includePlaceholders?: boolean): InfiniteGridGroup[] {\n return this.groupManager.getGroups(includePlaceholders);\n }\n /**\n * Return visible groups of InfiniteGrid.\n * @ko InfiniteGrid의 보이는 그룹들을 반환한다.\n * @param - Whether to include groups corresponding to placeholders. <ko>placeholder에 해당하는 그룹들을 포함할지 여부.</ko>\n */\n public getVisibleGroups(includePlaceholders?: boolean): InfiniteGridGroup[] {\n return this.groupManager.getVisibleGroups(includePlaceholders);\n }\n /**\n * Set to wait to request data.\n * @ko 데이터를 요청하기 위해 대기 상태로 설정한다.\n * @param direction - direction in which data will be added. <ko>데이터를 추가하기 위한 방향.</ko>\n */\n public wait(direction: \"start\" | \"end\" = DIRECTION.END) {\n this._waitType = direction;\n this._checkStartLoading(direction);\n }\n /**\n * When the data request is complete, it is set to ready state.\n * @ko 데이터 요청이 끝났다면 준비 상태로 설정한다.\n */\n public ready() {\n this._waitType = \"\";\n }\n /**\n * Returns whether it is set to wait to request data.\n * @ko 데이터를 요청하기 위해 대기 상태로 설정되어 있는지 여부를 반환한다.\n */\n public isWait() {\n return !!this._waitType;\n }\n /**\n * Releases the instnace and events and returns the CSS of the container and elements.\n * @ko 인스턴스와 이벤트를 해제하고 컨테이너와 엘리먼트들의 CSS를 되돌린다.\n */\n public destroy(): void {\n this.off();\n this._getRenderer().destroy();\n this.containerManager.destroy();\n this.groupManager.destroy();\n this.scrollManager.destroy();\n this.infinite.destroy();\n }\n\n private _getRenderer() {\n return this.options.renderer!;\n }\n private _getRendererItems() {\n return this.getRenderingItems().map((item) => {\n return {\n element: item.element,\n key: `${item.type}_${item.key}`,\n orgItem: item,\n };\n });\n }\n private _syncItems(state?: Record<string, any>): void {\n this._getRenderer().syncItems(this._getRendererItems(), state);\n }\n private _render(state?: Record<string, any>): void {\n this._getRenderer().render(this._getRendererItems(), state);\n }\n private _update(state: Record<string, any> = {}): void {\n this._getRenderer().update(state);\n }\n private _resizeScroll() {\n const scrollManager = this.scrollManager;\n\n scrollManager.resize();\n\n this.infinite.setSize(scrollManager.getContentSize());\n }\n private _syncGroups(isUpdate?: boolean) {\n const infinite = this.infinite;\n const scrollManager = this.scrollManager;\n\n if (!scrollManager.getContentSize()) {\n this._resizeScroll();\n }\n this._syncInfinite();\n this.groupManager.setCursors(infinite.getStartCursor(), infinite.getEndCursor());\n if (isUpdate) {\n this._update();\n } else {\n this._render();\n }\n }\n private _syncInfinite() {\n this.infinite.syncItems(this.getGroups(true).map(({ groupKey, grid, type }) => {\n const outlines = grid.getOutlines();\n\n return {\n key: groupKey,\n isVirtual: type === GROUP_TYPE.VIRTUAL,\n startOutline: outlines.start,\n endOutline: outlines.end,\n };\n }));\n }\n private _scroll() {\n this.infinite.scroll(this.scrollManager.getRelativeScrollPos());\n }\n private _onScroll = ({ direction, scrollPos, relativeScrollPos }: OnChangeScroll): void => {\n this._scroll();\n /**\n * This event is fired when scrolling.\n * @ko 스크롤하면 발생하는 이벤트이다.\n * @event InfiniteGrid#changeScroll\n * @param {InfiniteGrid.OnChangeScroll} e - The object of data to be sent to an event <ko>이벤트에 전달되는 데이터 객체</ko>\n */\n this.trigger(new ComponentEvent(INFINITEGRID_EVENTS.CHANGE_SCROLL, {\n direction,\n scrollPos,\n relativeScrollPos,\n }));\n }\n\n private _onChange = (e: OnInfiniteChange): void => {\n this.setCursors(e.nextStartCursor, e.nextEndCursor);\n }\n private _onRendererUpdated = (e: OnRendererUpdated<GridRendererItem>): void => {\n const renderedItems = e.items;\n\n renderedItems.forEach((item) => {\n // set grid element\n const gridItem = item.orgItem;\n\n gridItem.element = item.element as HTMLElement;\n });\n\n if (!e.isChanged) {\n this._checkEndLoading();\n this._scroll();\n return;\n }\n\n const {\n added,\n removed,\n prevList,\n list,\n } = e.diffResult;\n\n removed.forEach((index) => {\n const orgItem = prevList[index].orgItem;\n\n if (orgItem.mountState !== MOUNT_STATE.UNCHECKED) {\n orgItem.mountState = MOUNT_STATE.UNMOUNTED;\n }\n });\n\n\n const horizontal = this.options.horizontal;\n const addedItems = added.map((index) => {\n const gridItem = list[index].orgItem;\n const element = gridItem.element!;\n\n if (gridItem.type === ITEM_TYPE.VIRTUAL) {\n const cssRect = { ...gridItem.cssRect };\n const rect = gridItem.rect;\n\n if (!cssRect.width && rect.width) {\n cssRect.width = rect.width;\n }\n if (!cssRect.height && rect.height) {\n cssRect.height = rect.height;\n }\n // virtual item\n return new GridItem(horizontal!, {\n element,\n cssRect,\n });\n }\n return gridItem;\n });\n\n const containerManager = this.containerManager;\n if (this.options.observeChildren) {\n containerManager.unobserveChildren(removed.map((index) => prevList[index].element!));\n containerManager.observeChildren(added.map((index) => list[index].element!));\n }\n\n const {\n isRestore,\n isResize,\n } = e.state;\n\n this.itemRenderer.renderItems(addedItems);\n\n if (isRestore) {\n this._onRenderComplete({\n mounted: added.map((index) => list[index].orgItem),\n updated: [],\n isResize: false,\n direction: this.defaultDirection,\n });\n }\n if (!isRestore || isResize || e.isItemChanged) {\n this.groupManager.renderItems();\n }\n }\n\n private _onResize = (e: ResizeWatcherResizeEvent) => {\n if (e.isResizeContainer) {\n this._renderItems({ useResize: true }, true);\n } else {\n const updatedItems = getUpdatedItems(this.getVisibleItems(), e.childEntries) as InfiniteGridItem[];\n\n if (updatedItems.length > 0) {\n this.updateItems(updatedItems);\n }\n }\n }\n\n private _onRequestAppend = (e: OnRequestInsert): void => {\n /**\n * The event is fired when scrolling reaches the end or when data for a virtual group is required.\n * @ko 스크롤이 끝에 도달하거나 virtual 그룹에 대한 데이터가 필요한 경우 이벤트가 발생한다.\n * @event InfiniteGrid#requestAppend\n * @param {InfiniteGrid.OnRequestAppend} e - The object of data to be sent to an event <ko>이벤트에 전달되는 데이터 객체</ko>\n */\n this._onRequestInsert(DIRECTION.END, INFINITEGRID_EVENTS.REQUEST_APPEND, e);\n }\n\n private _onRequestPrepend = (e: OnInfiniteRequestPrepend): void => {\n /**\n * The event is fired when scrolling reaches the start or when data for a virtual group is required.\n * @ko 스크롤이 끝에 도달하거나 virtual 그룹에 대한 데이터가 필요한 경우 이벤트가 발생한다.\n * @event InfiniteGrid#requestPrepend\n * @param {InfiniteGrid.OnRequestPrepend} e - The object of data to be sent to an event <ko>이벤트에 전달되는 데이터 객체</ko>\n */\n this._onRequestInsert(DIRECTION.START, INFINITEGRID_EVENTS.REQUEST_PREPEND, e);\n }\n\n private _onRequestInsert(\n direction: \"start\" | \"end\",\n eventType: \"requestAppend\" | \"requestPrepend\",\n e: OnInfiniteRequestAppend | OnInfiniteRequestPrepend,\n ) {\n if (this._waitType) {\n this._checkStartLoading(this._waitType);\n return;\n }\n this.trigger(new ComponentEvent(eventType, {\n groupKey: e.key,\n nextGroupKey: e.nextKey,\n nextGroupKeys: e.nextKeys || [],\n isVirtual: e.isVirtual,\n wait: () => {\n this.wait(direction);\n },\n ready: () => {\n this.ready();\n },\n }));\n }\n\n private _onContentError = ({ element, target, item, update }: OnContentError): void => {\n /**\n * The event is fired when scrolling reaches the start or when data for a virtual group is required.\n * @ko 스크롤이 끝에 도달하거나 virtual 그룹에 대한 데이터가 필요한 경우 이벤트가 발생한다.\n * @event InfiniteGrid#contentError\n * @param {InfiniteGrid.OnContentError} e - The object of data to be sent to an event <ko>이벤트에 전달되는 데이터 객체</ko>\n */\n this.trigger(new ComponentEvent(INFINITEGRID_EVENTS.CONTENT_ERROR, {\n element,\n target,\n item: item as InfiniteGridItem,\n update,\n remove: () => {\n this.removeByKey(item.key!);\n },\n }));\n }\n\n private _onRenderComplete = ({ isResize, mounted, updated, direction }: OnPickedRenderComplete): void => {\n const infinite = this.infinite;\n const prevRenderedGroups = infinite.getRenderedVisibleItems();\n const length = prevRenderedGroups.length;\n const isDirectionEnd = direction === DIRECTION.END;\n\n this._syncInfinite();\n\n if (length) {\n const prevStandardGroup = prevRenderedGroups[isDirectionEnd ? 0 : length - 1];\n const nextStandardGroup = infinite.getItemByKey(prevStandardGroup.key);\n const offset = isDirectionEnd\n ? Math.min(...nextStandardGroup.startOutline) - Math.min(...prevStandardGroup.startOutline)\n : Math.max(...nextStandardGroup.endOutline) - Math.max(...prevStandardGroup.endOutline);\n\n this.scrollManager.scrollBy(offset);\n }\n\n /**\n * This event is fired when the InfiniteGrid has completed rendering.\n * @ko InfiniteGrid가 렌더링이 완료됐을 때 이벤트가 발생한다.\n * @event InfiniteGrid#renderComplete\n * @param {InfiniteGrid.OnRenderComplete} e - The object of data to be sent to an event <ko>이벤트에 전달되는 데이터 객체</ko>\n */\n this.trigger(new ComponentEvent(INFINITEGRID_EVENTS.RENDER_COMPLETE, {\n isResize,\n direction,\n mounted: (mounted as InfiniteGridItem[]).filter((item) => item.type !== ITEM_TYPE.LOADING),\n updated: (updated as InfiniteGridItem[]).filter((item) => item.type !== ITEM_TYPE.LOADING),\n startCursor: this.getStartCursor(),\n endCursor: this.getEndCursor(),\n items: this.getVisibleItems(true),\n groups: this.getVisibleGroups(true),\n }));\n\n if (this.groupManager.shouldRerenderItems()) {\n this._update();\n } else {\n this._checkEndLoading();\n this._scroll();\n }\n }\n private _renderItems(options: RenderOptions = {}, isTrusted?: boolean) {\n if (!isTrusted && options.useResize) {\n this.containerManager.resize();\n }\n this._resizeScroll();\n if (!this.getRenderingItems().length) {\n const children = toArray(this.getContainerElement().children);\n if (children.length > 0) {\n // no items, but has children\n this.groupManager.syncItems(convertInsertedItems(children));\n this._syncInfinite();\n this.setCursors(0, 0, true);\n this._getRenderer().updated();\n } else {\n this.infinite.scroll(0);\n }\n return this;\n }\n if (!this.getVisibleGroups(true).length) {\n this.setCursors(0, 0);\n } else {\n this.groupManager.renderItems(options);\n }\n return this;\n }\n private _checkStartLoading(direction: \"start\" | \"end\") {\n const groupManager = this.groupManager;\n const infinite = this.infinite;\n\n if (\n !groupManager.getLoadingType()\n && infinite.isLoading(direction)\n && groupManager.startLoading(direction)\n && groupManager.hasLoadingItem()\n ) {\n this._update();\n }\n }\n private _checkEndLoading() {\n const groupManager = this.groupManager;\n const loadingType = this.groupManager.getLoadingType();\n\n if (\n loadingType\n && (!this._waitType || !this.infinite.isLoading(loadingType))\n && groupManager.endLoading()\n && groupManager.hasLoadingItem()\n ) {\n this._update();\n }\n }\n}\n\ninterface InfiniteGrid extends Properties<typeof InfiniteGrid> { }\n\nexport default InfiniteGrid;\n","import { MasonryGrid, MasonryGridOptions } from \"@egjs/grid\";\nimport InfiniteGrid from \"../InfiniteGrid\";\nimport { InfiniteGridOptions } from \"../types\";\nimport { InfiniteGridGetterSetter } from \"../utils\";\n\n/**\n * @typedef\n * @extends InfiniteGridOptions\n * @extends Grid.MasonryGrid.MasonryGridOptions\n */\nexport interface MasonryInfiniteGridOptions extends MasonryGridOptions, InfiniteGridOptions {\n}\n\n/**\n * MasonryInfiniteGrid is a grid that stacks items with the same width as a stack of bricks. Adjust the width of all images to the same size, find the lowest height column, and insert a new item.\n * @ko MasonryInfiniteGrid는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 아이템을 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 아이템 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param {MasonryInfiniteGridOptions} options - The option object of the MasonryInfiniteGrid module <ko>MasonryInfiniteGrid 모듈의 옵션 객체</ko>\n */\n@InfiniteGridGetterSetter\nexport class MasonryInfiniteGrid extends InfiniteGrid<MasonryInfiniteGridOptions> {\n public static propertyTypes = {\n ...InfiniteGrid.propertyTypes,\n ...MasonryGrid.propertyTypes,\n };\n public static defaultOptions: Required<MasonryInfiniteGridOptions> = {\n ...InfiniteGrid.defaultOptions,\n ...MasonryGrid.defaultOptions,\n gridConstructor: MasonryGrid,\n appliedItemChecker: (item, grid) => {\n const column = parseFloat(item.attributes.column) || 0;\n\n return column >= grid.outlineLength;\n },\n } as const;\n}\n","import { JustifiedGrid, JustifiedGridOptions } from \"@egjs/grid\";\nimport InfiniteGrid from \"../InfiniteGrid\";\nimport { InfiniteGridOptions } from \"../types\";\nimport { InfiniteGridGetterSetter } from \"../utils\";\n\n/**\n * @typedef\n * @extends InfiniteGridOptions\n * @extends Grid.JustifiedGrid.JustifiedGridOptions\n */\nexport interface JustifiedInfiniteGridOptions extends JustifiedGridOptions, InfiniteGridOptions {\n}\n\n/**\n * 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedInfiniteGrid is a grid that the item is filled up on the basis of a line given a size.\n * If 'data-grid-inline-offset' or 'data-grid-content-offset' are set for item element, the ratio is maintained except for the offset value.\n * If 'data-grid-maintained-target' is set for an element whose ratio is to be maintained, the item is rendered while maintaining the ratio of the element.\n * @ko 'justified'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. JustifiedInfiniteGrid는 용어의 의미대로 너비가 주어진 사이즈를 기준으로 아이템가 가득 차도록 배치하는 Grid다.\n * 아이템 엘리먼트에 'data-grid-inline-offset' 또는 'data-grid-content-offset'를 설정하면 offset 값을 제외하고 비율을 유지한다.\n * 비율을 유지하고 싶은 엘리먼트에 'data-grid-maintained-target'을 설정한다면 해당 엘리먼트의 비율을 유지하면서 아이템이 렌더링이 된다.\n * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param {JustifiedInfiniteGridOptions} options - The option object of the JustifiedInfiniteGrid module <ko>JustifiedInfiniteGrid 모듈의 옵션 객체</ko>\n */\n@InfiniteGridGetterSetter\nexport class JustifiedInfiniteGrid extends InfiniteGrid<JustifiedInfiniteGridOptions> {\n public static propertyTypes = {\n ...InfiniteGrid.propertyTypes,\n ...JustifiedGrid.propertyTypes,\n };\n public static defaultOptions: Required<JustifiedInfiniteGridOptions> = {\n ...InfiniteGrid.defaultOptions,\n ...JustifiedGrid.defaultOptions,\n gridConstructor: JustifiedGrid,\n } as const;\n}\n","import { FrameGrid, FrameGridOptions } from \"@egjs/grid\";\nimport InfiniteGrid from \"../InfiniteGrid\";\nimport { InfiniteGridOptions } from \"../types\";\nimport { InfiniteGridGetterSetter } from \"../utils\";\n\n/**\n * @typedef\n * @extends InfiniteGridOptions\n * @extends Grid.FrameGrid.FrameGridOptions\n */\nexport interface FrameInfiniteGridOptions extends FrameGridOptions, InfiniteGridOptions {\n}\n\n/**\n * 'Frame' is a printing term with the meaning that 'it fits in one row wide'. FrameInfiniteGrid is a grid that the item is filled up on the basis of a line given a size.\n * @ko 'Frame'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. FrameInfiniteGrid는 용어의 의미대로 너비가 주어진 사이즈를 기준으로 아이템이 가득 차도록 배치하는 Grid다.\n * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param {FrameInfiniteGridOptions} options - The option object of the FrameInfiniteGrid module <ko>FrameGrid 모듈의 옵션 객체</ko>\n */\n@InfiniteGridGetterSetter\nexport class FrameInfiniteGrid extends InfiniteGrid<FrameInfiniteGridOptions> {\n public static propertyTypes = {\n ...InfiniteGrid.propertyTypes,\n ...FrameGrid.propertyTypes,\n };\n public static defaultOptions: Required<FrameInfiniteGridOptions> = {\n ...InfiniteGrid.defaultOptions,\n ...FrameGrid.defaultOptions,\n gridConstructor: FrameGrid,\n } as const;\n}\n","import { PackingGrid, PackingGridOptions } from \"@egjs/grid\";\nimport InfiniteGrid from \"../InfiniteGrid\";\nimport { InfiniteGridOptions } from \"../types\";\nimport { InfiniteGridGetterSetter } from \"../utils\";\n\n/**\n * @typedef\n * @extends InfiniteGridOptions\n * @extends Grid.PackingGrid.PackingGridOptions\n */\nexport interface PackingInfiniteGridOptions extends PackingGridOptions, InfiniteGridOptions {\n}\n\n/**\n * The PackingInfiniteGrid is a grid that shows the important items bigger without sacrificing the weight of the items.\n * Rows and columns are separated so that items are dynamically placed within the horizontal and vertical space rather than arranged in an orderly fashion.\n * If `sizeWeight` is higher than `ratioWeight`, the size of items is preserved as much as possible.\n * Conversely, if `ratioWeight` is higher than `sizeWeight`, the ratio of items is preserved as much as possible.\n * @ko PackingInfiniteGrid는 아이템의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다.\n * 행과 열이 구분돼 아이템을 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 아이템을 배치한다.\n * `sizeWeight`가 `ratioWeight`보다 높으면 아이템들의 size가 최대한 보존이 된다.\n * 반대로 `ratioWeight`가 `sizeWeight`보다 높으면 아이템들의 비율이 최대한 보존이 된다.\n * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param {PackingInfiniteGridOptions} options - The option object of the PackingInfiniteGrid module <ko>PackingInfiniteGrid 모듈의 옵션 객체</ko>\n */\n@InfiniteGridGetterSetter\nexport class PackingInfiniteGrid extends InfiniteGrid<PackingInfiniteGridOptions> {\n public static propertyTypes = {\n ...InfiniteGrid.propertyTypes,\n ...PackingGrid.propertyTypes,\n };\n public static defaultOptions: Required<PackingInfiniteGridOptions> = {\n ...InfiniteGrid.defaultOptions,\n ...PackingGrid.defaultOptions,\n gridConstructor: PackingGrid,\n };\n}\n"],"names":["ua","window","navigator","userAgent","IS_IOS","test","CONTAINER_CLASS_NAME","IGNORE_PROPERITES_MAP","renderOnPropertyChange","useFit","autoResize","INFINITEGRID_PROPERTY_TYPES","GRID_PROPERTY_TYPES","DIRECTION","START","END","NONE","INFINITEGRID_EVENTS","CHANGE_SCROLL","REQUEST_APPEND","REQUEST_PREPEND","RENDER_COMPLETE","CONTENT_ERROR","ITEM_INFO_PROPERTIES","type","groupKey","key","element","html","data","inserted","attributes","INFINITEGRID_METHODS","GROUP_TYPE","ITEM_TYPE","STATUS_TYPE","INVISIBLE_POS","__extends","horizontal","itemStatus","_super","__assign","NORMAL","cssRect","top","left","_this","VIRTUAL","rect","width","height","mountState","MOUNT_STATE","UNMOUNTED","orgRect","__proto","InfiniteGridItem","prototype","status","getMinimizedStatus","GridItem","LOADING_GROUP_KEY","LOADING_ITEM_KEY","LoadingGrid","items","item","loadingItem","getLoadingItem","options","LOADING","name","direction","outline","length","start","end","nextOutline","offset","contentSize","gap","cssInlinePos","getContainerInlineSize","inlineSize","maxPos","Math","max","cssContentPos","map","pos","minPos","min","Grid","isWindow","el","isNumber","val","isString","isObject","flat","arr","reduce","prev","cur","splitOptions","gridOptions","otherOptions","splitGridOptions","nextOptions","defaultOptions","value","categorize","groups","groupKeys","registeredGroupKeys","filter","forEach","_a","generatedGroupKey","isContinuousGroupKey","i","makeKey","group","push","getNextCursors","prevKeys","nextKeys","prevStartCursor","prevEndCursor","result","diff","nextStartCursor","nextEndCursor","maintained","prevIndex","nextIndex","startCursor","endCursor","splitVirtualGroups","nextGroups","virtualGroups","index","findIndex","endMaintainedIndex","nextGroup","endIndex","slice","findLastIndex","startMaintainedIndex","startIndex","getFirstRenderingItems","nextItems","getRenderingItemsByStatus","groupManagerStatus","usePlaceholder","prevGroups","startVirtualGroups","endVirtualGroups","__spreadArray","cursors","nextVisibleItems","mountRenderingItems","grid","useLoading","useFirstRender","setPlaceholder","setLoading","setStatus","syncItems","getGroups","setCursors","getRenderingItems","visibleItems","groupManager","InfiniteGridGetterSetter","component","propertyTypes","enumerable","configurable","get","set","prevValue","Object","defineProperty","registeredKeys","prefix","convertHTMLtoElement","dummy","document","createElement","innerHTML","toArray","children","convertInsertedItems","insertedItems","outerHTML","nodes","array","callback","getItemInfo","info","nextInfo","isFlatOutline","every","range","flatGroups","getItems","filterVirtuals","includePlaceholders","withInfiniteGridMethods","withClassMethods","container","_loadingGrid","externalContainerManager","containerManager","_mainGrid","_makeGrid","GroupManager","shouldRender","_checkShouldRender","scheduleRender","itemKeys","groupItems","hasPlaceholder","getVisibleGroups","some","_placeholder","_getLoadingItem","updateItems","placeholder","_updatePlaceholder","_getRenderingItems","prevType","loading","setLoadingItem","getComputedOutlineLength","getComputedOutlineSize","renderingGroups","loadingGrid","unshift","_getLoadingGroup","reverse","appliedItemChecker","outlineLength","outlineSize","itemRenderer","gridItems","isVirtual","appliedItems","UNCHECKED","updateItem","gridOutlines","_applyVirtualGrid","applyGrid","setOutlines","getOutlines","nextItemInfos","prevItemKeys","_syncItemInfos","prevGroupKeys","nextManagerGroups","_splitVirtualGroups","_mergeVirtualGroups","setItems","renderItems","_registerGroups","useResize","updateState","UPDATE_STATE","NEED_UPDATE","orgStartCursor","orgEndCursor","orgGroups","startGroup","endGroup","isMinimizeItems","MINIMIZE_INVISIBLE_ITEMS","isMinimizeGroups","MINIMIZE_INVISIBLE_GROUPS","REMOVE_INVISIBLE_GROUPS","orgIndex","orgGroup","indexOf","lastIndexOf","groupStatus","isOutsideCursor","isVirtualItems","isVirtualGroup","getVirtualStatus","outlines","totalItems","getGroupItems","itemStartCursor","itemEndCursor","orgCursors","itemCursors","startGroupKey","endGroupKey","firstGroup","startOutline","outlineOffset","_b","point","contentPos","insertPlaceholders","splice","groupKey_1","infos","Array","isArray","isRerender","updateEqualSizeItems","GridConstructor","gridConstructor","prevOptions","PROPERTY_TYPE","RENDER_PROPERTY","prevOutlines","prevOutline","nextItemKeys","prevItem","nextGroupKeys","_getGroupItems","prevGroup","containerElement","useResizeObserver","observeChildren","externalItemRenderer","PROPERTY","GetterSetter","threshold","useRecycle","defaultDirection","Infinite","scrollPos","size","_c","isDirectionEnd","trigger","undefined","nextCursor","endScrollPos","startEdgePos","endEdgePos","endOutline","visibles","startPos","endPos","hasStartItems","hasEndItems","isStart","isEnd","hasRealItem","hasVirtualItems","isStartVirtual","isEndVirtual","realItemIndex","endVirtualItemIndex","nextKey","startVirtualItemIndex","_requestVirtualItems","totalVisibleItems","getVisibleItems","totalVisibleLength","visibleLength","getStartCursor","getEndCursor","startKey_1","endKey_1","lastItem","firstItem","prevItems","isChange","prevVisibleItems","visibleResult","added","removed","changed","rendered","off","Component","Renderer","rendererKey","Date","now","state","_state","clearTimeout","_updateTimer","setTimeout","nextElements","diffResult","_diffResult","isChanged","isItemChanged","_isItemChanged","list","elements","renderKey","VanillaRenderer","render","prevList","ordered","diffList","removeChild","insertBefore","updated","VanillaGridRenderer","orgItem","wrapper","prevScrollPos","getScrollPos","nextScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","ComponentEvent","relativeScrollPos","getRelativeScrollPos","containerTag","scrollContainer","_init","ScrollManager","scrollOffset","eventTarget","prop","documentElement","body","scrollTo","x","y","scroll","scrollLeft","scrollTop","scrollBy","isBody","scrollContainerRect","getBoundingClientRect","containerRect","innerWidth","innerHeight","offsetWidth","offsetHeight","removeEventListener","_onCheck","_isCreateElement","fragment_1","createDocumentFragment","childNodes","childNode","appendChild","style","cssText","_orgCSSText","containerOption","scrollContainerOption","containerCSSText","findTarget","position","className","overflowX","overflowY","addEventListener","resize","_scroll","e","renderedItems","gridItem","_checkEndLoading","addedItems","unobserveChildren","isRestore","isResize","_onRenderComplete","mounted","isResizeContainer","_renderItems","updatedItems","getUpdatedItems","childEntries","_onRequestInsert","target","update","remove","removeByKey","infinite","prevRenderedGroups","getRenderedVisibleItems","_syncInfinite","prevStandardGroup","nextStandardGroup","getItemByKey","scrollManager","shouldRerenderItems","_update","constructor","renderer","on","_render","attributePrefix","useTransform","percentage","isConstantSize","isEqualSize","resizeDebounce","maxResizeDebounce","wrapperElement","querySelector","_onScroll","getContainer","ContainerManager","_onResize","ItemRenderer","_onChange","_onRequestAppend","_onRequestPrepend","setSize","getContentSize","_onContentError","setContainer","_onRendererUpdated","InfiniteGrid","getWrapper","getScrollContainer","_syncGroups","_syncItems","insert","itemInfos","groupIndex","nextGroupInfos","rightGroup","append","rightGroupKey","rightItemIndex","getStatus","getGroupStatus","appendPlaceholders","removePlaceholders","prependPlaceholders","prevInlineSize","getInlineSize","setGroupStatus","_getRenderer","updateKey","removeGroupByKey","firstIndex","lastIndex","removeByIndex","_waitType","_checkStartLoading","destroy","_getRendererItems","isUpdate","_resizeScroll","eventType","nextGroupKey","wait","ready","isTrusted","getContainerElement","getLoadingType","isLoading","startLoading","hasLoadingItem","loadingType","endLoading","DEFAULT_GRID_OPTIONS","MasonryInfiniteGrid","MasonryGrid","column","parseFloat","JustifiedInfiniteGrid","JustifiedGrid","FrameInfiniteGrid","FrameGrid","PackingInfiniteGrid","PackingGrid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,EAAE,GAAG,O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