{"version":3,"sources":["jsdelivr-header.js","/npm/@egjs/grid@1.18.0/src/consts.ts","/npm/@egjs/grid@1.18.0/src/utils.ts","/npm/@egjs/grid@1.18.0/src/ResizeWatcher.ts","/npm/@egjs/grid@1.18.0/src/ContainerManager.ts","/npm/@egjs/grid@1.18.0/src/ItemRenderer.ts","/npm/@egjs/grid@1.18.0/src/GridItem.ts","/npm/@egjs/grid@1.18.0/src/Grid.ts","/npm/@egjs/grid@1.18.0/src/grids/MasonryGrid.ts","/npm/@egjs/grid@1.18.0/src/grids/lib/dijkstra.ts","/npm/@egjs/grid@1.18.0/src/grids/JustifiedGrid.ts","/npm/@egjs/grid@1.18.0/src/grids/FrameGrid.ts","/npm/@egjs/grid@1.18.0/src/grids/lib/BoxModel.ts","/npm/@egjs/grid@1.18.0/src/grids/PackingGrid.ts","/npm/@egjs/grid@1.18.0/src/index.cjs.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,uxCCCa,qBAA8C,CACzD,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,IAAK,EACL,gBAAiB,aACjB,eAAgB,IAChB,kBAAmB,EACnB,YAAY,EACZ,qBAAqB,EACrB,iBAAkB,MAClB,yBAA0B,KAC1B,qBAAsB,KACtB,wBAAwB,EACxB,QAAQ,EACR,cAAe,EACf,YAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,IAGnB,SAAY,GACV,gBAAA,WACA,uBAAA,iBAFF,EAAY,8CAAa,KAIzB,SAAY,GACV,iBAAA,YACA,iBAAA,YACA,eAAA,SAHF,EAAY,0CAAW,KAKvB,SAAY,GACV,mBAAA,cACA,oBAAA,eACA,eAAA,SAHF,EAAY,4CAAY,K,IAMX,oBAAsB,CACjC,IAAK,sBAAc,gBACnB,iBAAkB,sBAAc,SAChC,uBAAwB,sBAAc,SACtC,oBAAqB,sBAAc,SACnC,OAAQ,sBAAc,SACtB,YAAa,sBAAc,gBAC3B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BAC3B,eAAgB,sBAAc,kBAElB,iBAAA,kBAAA,GACT,KAAK,iBACR,YAAa,EACb,WAAY,EACZ,YAAa,EACb,eAAgB,WAbP,EAAW,WAAA,CADvB,cACY,EAuJZ,C,CAvJgC,M,krBCzFjC,IAAK,IAAM,QAAQ,QAChB,KAAa,MAAS,QAAgB,MAIzC,OAAO,QAAU,K","file":"/npm/@egjs/grid@1.18.0/dist/grid.cjs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@egjs/grid@1.18.0/dist/grid.cjs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport { GridOptions } from \"./types\";\n\nexport const DEFAULT_GRID_OPTIONS: Required<GridOptions> = {\n  horizontal: false,\n  useTransform: false,\n  percentage: false,\n  isEqualSize: false,\n  isConstantSize: false,\n  gap: 0,\n  attributePrefix: \"data-grid-\",\n  resizeDebounce: 100,\n  maxResizeDebounce: 0,\n  autoResize: true,\n  preserveUIOnDestroy: false,\n  defaultDirection: \"end\",\n  externalContainerManager: null,\n  externalItemRenderer: null,\n  renderOnPropertyChange: true,\n  useFit: true,\n  outlineLength: 0,\n  outlineSize: 0,\n  useRoundedSize: true,\n  useResizeObserver: false,\n  observeChildren: false,\n};\n\nexport enum PROPERTY_TYPE {\n  PROPERTY = 1,\n  RENDER_PROPERTY = 2,\n}\nexport enum MOUNT_STATE {\n  UNCHECKED = 1,\n  UNMOUNTED = 2,\n  MOUNTED = 3,\n}\nexport enum UPDATE_STATE {\n  NEED_UPDATE = 1,\n  WAIT_LOADING = 2,\n  UPDATED = 3,\n}\n\nexport const GRID_PROPERTY_TYPES = {\n  gap: PROPERTY_TYPE.RENDER_PROPERTY,\n  defaultDirection: PROPERTY_TYPE.PROPERTY,\n  renderOnPropertyChange: PROPERTY_TYPE.PROPERTY,\n  preserveUIOnDestroy: PROPERTY_TYPE.PROPERTY,\n  useFit: PROPERTY_TYPE.PROPERTY,\n  outlineSize: PROPERTY_TYPE.RENDER_PROPERTY,\n  outlineLength: PROPERTY_TYPE.RENDER_PROPERTY,\n};\n\nexport const GRID_METHODS = [\n  \"syncElements\",\n  \"updateItems\",\n  \"getItems\",\n  \"setItems\",\n  \"renderItems\",\n  \"getContainerInlineSize\",\n  \"getContainerElement\",\n] as const;\n\nexport const GRID_EVENTS = [\n  \"renderComplete\",\n  \"contentError\",\n] as const;\n\nexport const RECT_NAMES = {\n  horizontal: {\n    inlinePos: \"top\",\n    contentPos: \"left\",\n    inlineSize: \"height\",\n    contentSize: \"width\",\n  },\n  vertical: {\n    inlinePos: \"left\",\n    contentPos: \"top\",\n    inlineSize: \"width\",\n    contentSize: \"height\",\n  },\n} as const;\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport Grid from \"./Grid\";\nimport { GRID_METHODS, GRID_PROPERTY_TYPES, PROPERTY_TYPE } from \"./consts\";\nimport { GridItem } from \"./GridItem\";\nimport { ResizeWatcherEntry } from \"./ResizeWatcher\";\nimport { diff } from \"@egjs/children-differ\";\n\nexport function getKeys<T extends Record<string, any>>(obj: T): Array<keyof T> {\n  return Object.keys(obj);\n}\nexport function getUpdatedItems(items: GridItem[], entries: ResizeWatcherEntry[]) {\n  const mountedItems = getMountedItems(items);\n\n  return diff(\n    entries.map((entry) => entry.target),\n    mountedItems.map((item) => item.element!),\n  ).maintained.filter(([prevIndex, nextIndex]) => {\n    const entrySize = entries[prevIndex].size!;\n    const item = items[nextIndex];\n\n    return !item.inlineSize || !item.contentSize\n      || entrySize.inlineSize !== item.computedInlineSize\n      || entrySize.blockSize !== item.computedContentSize;\n  }).map(([, nextIndex]) => items[nextIndex]);\n}\nexport function getMountedItems(items: GridItem[]) {\n  return items.filter((item) => item.element);\n}\nexport function getMountedElements(items: GridItem[]) {\n  return getMountedItems(items).map((item) => item.element!);\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}\nexport function isFunction(val: any): val is Function {\n  return typeof val === \"function\";\n}\nexport function isNumber(val: any): val is number {\n  return typeof val === \"number\";\n}\nexport function camelize(str: string) {\n  return str.replace(/[\\s-_]([a-z])/g, (all, letter) => letter.toUpperCase());\n}\nexport function sum(arr: number[]) {\n  return arr.reduce((a, b) => a + b, 0);\n}\n\nexport function getDataAttributes(element: HTMLElement, attributePrefix: string) {\n  const dataAttributes: Record<string, string> = {};\n  const attributes = element.attributes;\n  const length = attributes.length;\n\n  for (let i = 0; i < length; ++i) {\n    const attribute = attributes[i];\n    const { name, value } = attribute;\n    if (name.indexOf(attributePrefix) === -1) {\n      continue;\n    }\n    dataAttributes[camelize(name.replace(attributePrefix, \"\"))] = value;\n  }\n\n  return dataAttributes;\n}\n\n/* Class Decorator */\nexport function GetterSetter(component: {\n  prototype: Grid<any>,\n  propertyTypes: typeof GRID_PROPERTY_TYPES,\n}) {\n  const {\n    prototype,\n    propertyTypes,\n  } = component;\n  for (const name in propertyTypes) {\n    const shouldRender = propertyTypes[name] === PROPERTY_TYPE.RENDER_PROPERTY;\n\n    const descriptor = Object.getOwnPropertyDescriptor(prototype, name) || {};\n\n    const getter = descriptor.get || function get(this: Grid) {\n      return this.options[name];\n    };\n    const setter = descriptor.set || function set(this: Grid, value: any) {\n      const options = this.options;\n      const prevValue = options[name];\n\n      if (prevValue === value) {\n        return;\n      }\n      options[name] = value;\n\n      if (shouldRender && options.renderOnPropertyChange) {\n        this.scheduleRender();\n      }\n    };\n    const attributes: Record<string, any> = {\n      enumerable: true,\n      configurable: true,\n      get: getter,\n      set: setter,\n    };\n    Object.defineProperty(prototype, name, attributes);\n  }\n}\n\nexport function withMethods(methods: readonly string[]) {\n  return function (prototype: any, memberName: string) {\n    methods.forEach((name: string) => {\n      if (name in prototype) {\n        return;\n      }\n      prototype[name] = function (...args) {\n        const result = this[memberName][name](...args);\n\n        // fix `this` type to return your own `class` instance to the instance using the decorator.\n        if (result === this[memberName]) {\n          return this;\n        } else {\n          return result;\n        }\n      };\n    });\n  };\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 getRangeCost(value: number, valueRange: number[]) {\n  return Math.max(value - valueRange[1], valueRange[0] - value, 0) + 1;\n}\n\nexport function between(value: number, min: number, max: number) {\n  return Math.min(max, Math.max(value, min));\n}\n\nexport function throttle(num: number, unit?: number) {\n  if (!unit) {\n    return num;\n  }\n  const reverseUnit = 1 / unit;\n  return Math.round(num / unit) / reverseUnit;\n}\n\n/**\n * Decorator that makes the method of grid available in the framework.\n * @ko 프레임워크에서 그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.Grid\n * @private\n * @example\n * ```js\n * import { withGridMethods } from \"@egjs/grid\";\n *\n * class Grid extends React.Component<Partial<GridProps & GridOptions>> {\n *   &#64;withGridMethods\n *   private grid: NativeGrid;\n * }\n * ```\n */\nexport const withGridMethods = withMethods(GRID_METHODS);\n","import Component from \"@egjs/component\";\nimport { SizeRect } from \"./types\";\nimport { isString } from \"./utils\";\n\nexport interface ResizeWatherOptions {\n  resizeDebounce?: number;\n  maxResizeDebounce?: number;\n  useResizeObserver?: boolean;\n  useWindowResize?: boolean;\n  watchDirection?: \"width\" | \"height\" | \"box\" | false;\n  rectBox?: \"border-box\" | \"content-box\";\n  childrenRectBox?: \"border-box\" | \"content-box\";\n}\n\nexport interface ResizeWatcherResizeEvent {\n  isResizeContainer: boolean;\n  childEntries: ResizeWatcherEntry[];\n}\n\nexport interface ResizeWatcherEntry {\n  target: Element;\n  size?: { inlineSize: number, blockSize: number };\n}\n\nexport class ResizeWatcher {\n  private _resizeTimer = 0;\n  private _maxResizeDebounceTimer = 0;\n  private _emitter: Component<{ resize: ResizeWatcherResizeEvent }>;\n  private _observer: ResizeObserver | null;\n  protected container: HTMLElement;\n  protected rect: SizeRect = { width: 0, height: 0 };\n  private _options!: Required<ResizeWatherOptions>;\n  private _updatedEntries: ResizeWatcherEntry[] = [];\n\n  constructor(container: HTMLElement | string, options: ResizeWatherOptions = {}) {\n    this._options = {\n      resizeDebounce: 100,\n      maxResizeDebounce: 0,\n      useResizeObserver: false,\n      useWindowResize: true,\n      watchDirection: false,\n      rectBox: \"content-box\",\n      childrenRectBox: \"border-box\",\n      ...options,\n    };\n\n    this.container = isString(container) ? document.querySelector<HTMLElement>(container)! : container;\n    this._init();\n  }\n  public getRect() {\n    return this.rect;\n  }\n  public setRect(rect: SizeRect) {\n    this.rect = { ...rect };\n  }\n  public isObserverEnabled() {\n    return !!this._observer;\n  }\n  public resize() {\n    const container = this.container;\n\n    this.setRect(this._options.rectBox === \"border-box\" ? {\n      width: container.offsetWidth,\n      height: container.offsetHeight,\n    } : {\n      width: container.clientWidth,\n      height: container.clientHeight,\n    });\n  }\n  public observeChildren(children: Element[]) {\n    const observer = this._observer;\n\n    if (!observer) {\n      return;\n    }\n    const box = this._options.childrenRectBox;\n\n    children.forEach((element) => {\n      if (element) {\n        observer.observe(element, {\n          box,\n        });\n      }\n    });\n  }\n  public unobserveChildren(children: Element[]) {\n    const observer = this._observer;\n\n    if (!observer) {\n      return;\n    }\n    children.forEach((element) => {\n      if (element) {\n        observer.unobserve(element);\n      }\n    });\n  }\n  public listen(callback: (e: ResizeWatcherResizeEvent) => void) {\n    this._emitter.on(\"resize\", callback);\n    return this;\n  }\n  public destroy() {\n    this._observer?.disconnect();\n    if (this._options.useWindowResize) {\n      window.removeEventListener(\"resize\", this._onWindowResize);\n    }\n  }\n  private _init() {\n    const container = this.container;\n    const options = this._options;\n\n    this._emitter = new Component();\n    if (options.useResizeObserver && !!window.ResizeObserver) {\n      this._observer = new window.ResizeObserver(this._onObserve);\n      this._observer.observe(container, {\n        box: options.rectBox,\n      });\n    }\n    if (options.useWindowResize) {\n      window.addEventListener(\"resize\", this._onWindowResize);\n    }\n    this.resize();\n  }\n  private _onWindowResize = () => {\n    this._scheduleResize([{\n      target: this.container,\n    }]);\n  }\n  private _onObserve = (entries: ResizeObserverEntry[]) => {\n    const options = this._options;\n    const container = this.container;\n    const containerRectBox = options.rectBox;\n    const childrenRectBox = options.childrenRectBox;\n\n    this._scheduleResize(entries.map((entry) => {\n      const target = entry.target;\n      const rectBox = target === container ? containerRectBox : childrenRectBox;\n      let sizes = (rectBox === \"border-box\" ? entry.borderBoxSize : entry.contentBoxSize);\n\n      // Safari < 15.3\n      if (!sizes) {\n        const contentRect = entry.contentRect;\n\n        sizes = [{\n          inlineSize: contentRect.width,\n          blockSize: contentRect.height,\n        }];\n      }\n      return {\n        // not array in old browser\n        size: sizes[0] || sizes as any,\n        target: entry.target,\n      };\n    }));\n  }\n  private _scheduleResize = (entries: ResizeWatcherEntry[]) => {\n    const {\n      resizeDebounce,\n      maxResizeDebounce,\n    } = this._options;\n\n    const updatedEntries = this._updatedEntries;\n\n    updatedEntries.push(...entries);\n    this._updatedEntries = updatedEntries.filter((entry, index) => {\n      return updatedEntries.lastIndexOf(entry) === index;\n    });\n\n\n    if (!this._maxResizeDebounceTimer && maxResizeDebounce >= resizeDebounce) {\n      this._maxResizeDebounceTimer = window.setTimeout(this._onResize, maxResizeDebounce);\n    }\n    if (this._resizeTimer) {\n      clearTimeout(this._resizeTimer);\n      this._resizeTimer = 0;\n    }\n    this._resizeTimer = window.setTimeout(this._onResize, resizeDebounce);\n  }\n  private _onResize = () => {\n    clearTimeout(this._resizeTimer);\n    clearTimeout(this._maxResizeDebounceTimer);\n\n    this._maxResizeDebounceTimer = 0;\n    this._resizeTimer = 0;\n\n    const updated = this._updatedEntries;\n    const container = this.container;\n    let containerEntry!: ResizeWatcherEntry;\n    const childEntries = updated.filter((entry) => {\n      if (entry.target === container) {\n        containerEntry = entry;\n        return false;\n      } else {\n        return true;\n      }\n    });\n    const isResizeChildren = childEntries.length > 0;\n    let isResizeContainer = !!containerEntry;\n\n    if (isResizeContainer) {\n      const watchDirection = this._options.watchDirection;\n      const prevRect = this.rect;\n      const containerEntrySize = containerEntry.size;\n\n      if (containerEntrySize) {\n        // ResizeObserver\n        this.setRect({\n          width: containerEntrySize.inlineSize,\n          height: containerEntrySize.blockSize,\n        });\n      } else {\n        // window's resize event\n        this.resize();\n      }\n      const rect = this.rect;\n      const isWatchWidth = watchDirection === \"box\" || watchDirection === \"width\";\n      const isWatchHeight = watchDirection === \"box\" || watchDirection === \"height\";\n\n      isResizeContainer = !watchDirection\n        || (isWatchWidth && prevRect.width !== rect.width)\n        || (isWatchHeight && prevRect.height !== rect.height);\n    }\n    this._updatedEntries = [];\n\n    if (isResizeContainer || isResizeChildren) {\n      this._emitter.trigger(\"resize\", {\n        isResizeContainer,\n        childEntries,\n      });\n    }\n  }\n}\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport Component from \"@egjs/component\";\nimport { DestroyOptions, SizeRect } from \"./types\";\nimport { ResizeWatcherResizeEvent, ResizeWatcher } from \"./ResizeWatcher\";\nimport { DEFAULT_GRID_OPTIONS, RECT_NAMES } from \"./consts\";\n\nexport interface ContainerManagerOptions {\n  horizontal?: boolean;\n  autoResize?: boolean;\n  resizeDebounce?: number;\n  maxResizeDebounce?: number;\n  useResizeObserver?: boolean;\n}\n\nexport interface ContainerManagerStatus {\n  rect: SizeRect;\n}\nexport interface ContainerManagerEvents {\n  resize: ResizeWatcherResizeEvent;\n}\nexport class ContainerManager extends Component<ContainerManagerEvents> {\n  protected options: Required<ContainerManagerOptions>;\n  protected orgCSSText: string;\n  protected _watcher: ResizeWatcher;\n\n  constructor(protected container: HTMLElement, options: ContainerManagerOptions) {\n    super();\n    this.options = {\n      horizontal: DEFAULT_GRID_OPTIONS.horizontal,\n      autoResize: DEFAULT_GRID_OPTIONS.autoResize,\n      resizeDebounce: DEFAULT_GRID_OPTIONS.resizeDebounce,\n      maxResizeDebounce: DEFAULT_GRID_OPTIONS.maxResizeDebounce,\n      useResizeObserver: DEFAULT_GRID_OPTIONS.useResizeObserver,\n      ...options,\n    };\n\n    this._init();\n  }\n  public resize() {\n    const container = this.container;\n\n    this.setRect({\n      width: container.clientWidth,\n      height: container.clientHeight,\n    });\n  }\n  public isObserverEnabled() {\n    return this._watcher.isObserverEnabled();\n  }\n  public getRect() {\n    return this._watcher.getRect();\n  }\n  public observeChildren(children: Element[]) {\n    this._watcher.observeChildren(children);\n  }\n  public unobserveChildren(children: Element[]) {\n    this._watcher.unobserveChildren(children);\n  }\n  public setRect(rect: SizeRect) {\n    this._watcher.setRect(rect);\n  }\n  public getInlineSize() {\n    return this.getRect()[this._names.inlineSize];\n  }\n  public getContentSize() {\n    return this.getRect()[this._names.contentSize];\n  }\n  public getStatus() {\n    return { rect: this._watcher.getRect() };\n  }\n  public setStatus(status: ContainerManagerStatus) {\n    this.setRect(status.rect);\n    this.setContentSize(this.getContentSize());\n  }\n  public setContentSize(size: number) {\n    const sizeName = this.options.horizontal ? \"width\" : \"height\";\n    this.setRect({\n      ...this.getRect(),\n      [sizeName]: size,\n    });\n    this.container.style[sizeName] = `${size}px`;\n  }\n  public destroy(options: DestroyOptions = {}) {\n    this._watcher.destroy();\n\n    if (!options.preserveUI) {\n      this.container.style.cssText = this.orgCSSText;\n    }\n  }\n  private _init() {\n    const container = this.container;\n    const style = window.getComputedStyle(container);\n\n    this.orgCSSText = container.style.cssText;\n\n    if (style.position === \"static\") {\n      container.style.position = \"relative\";\n    }\n    const options = this.options;\n\n    this._watcher = new ResizeWatcher(container, {\n      useWindowResize: options.autoResize,\n      useResizeObserver: options.useResizeObserver,\n      resizeDebounce: options.resizeDebounce,\n      maxResizeDebounce: options.maxResizeDebounce,\n      watchDirection: options.useResizeObserver ? this._names.inlineSize : false,\n    }).listen(this._onResize);\n  }\n  private _onResize = (e: ResizeWatcherResizeEvent) => {\n    this.trigger(\"resize\", e);\n  }\n  private get _names() {\n    return RECT_NAMES[this.options.horizontal ? \"horizontal\" : \"vertical\"];\n  }\n}\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport { DEFAULT_GRID_OPTIONS, MOUNT_STATE, RECT_NAMES, UPDATE_STATE } from \"./consts\";\nimport { GridItem } from \"./GridItem\";\nimport { DOMRect } from \"./types\";\nimport { getDataAttributes, getKeys } from \"./utils\";\n\nexport interface ItemRendererOptions {\n  attributePrefix?: string;\n  useTransform?: boolean;\n  horizontal?: boolean;\n  percentage?: Array<\"position\" | \"size\"> | boolean;\n  isEqualSize?: boolean;\n  isConstantSize?: boolean;\n  useRoundedSize?: boolean;\n}\nexport interface ItemRendererStatus {\n  initialRects: Record<string, Required<DOMRect>>;\n}\n\nexport class ItemRenderer {\n  protected options: Required<ItemRendererOptions>;\n  protected containerRect: DOMRect;\n  protected initialRects: Record<string, Required<DOMRect>> = {};\n  protected sizePercetage = false;\n  protected posPercetage = false;\n\n  constructor(options: ItemRendererOptions) {\n    this.options = {\n      attributePrefix: DEFAULT_GRID_OPTIONS.attributePrefix,\n      useTransform: DEFAULT_GRID_OPTIONS.useTransform,\n      horizontal: DEFAULT_GRID_OPTIONS.horizontal,\n      percentage: DEFAULT_GRID_OPTIONS.percentage,\n      isEqualSize: DEFAULT_GRID_OPTIONS.isEqualSize,\n      isConstantSize: DEFAULT_GRID_OPTIONS.isConstantSize,\n      useRoundedSize: DEFAULT_GRID_OPTIONS.useRoundedSize,\n      ...options,\n    };\n    this._init();\n  }\n  public resize() {\n    this.initialRects = {};\n  }\n  public renderItems(items: GridItem[]) {\n    items.forEach((item) => {\n      this._renderItem(item);\n    });\n  }\n  public getInlineSize() {\n    return this.containerRect[this.options.horizontal ? \"height\" : \"width\"]!;\n  }\n  public setContainerRect(rect: DOMRect) {\n    this.containerRect = rect;\n  }\n  public updateEqualSizeItems(items: GridItem[], totalItems: GridItem[]) {\n    this.updateItems(items);\n\n    const hasSizeGroup = items.some((item) => item.attributes.sizeGroup);\n\n    // Check the rest of the items(totalItems) except `items`.\n    if (this.options.isEqualSize || hasSizeGroup) {\n      const updatedItem = items.some((item) => item.updateState === UPDATE_STATE.UPDATED);\n\n      if (updatedItem) {\n        totalItems.forEach((item) => {\n          if (items.indexOf(item) === -1) {\n            this.updateItem(item, true);\n          }\n        });\n      }\n    }\n  }\n  public updateItems(items: GridItem[]) {\n    items.forEach((item) => {\n      this.updateItem(item);\n    });\n  }\n  public getStatus(): ItemRendererStatus {\n    return {\n      initialRects: this.initialRects,\n    };\n  }\n  public setStatus(status: ItemRendererStatus) {\n    this.initialRects = status.initialRects;\n  }\n  private _init() {\n    const { percentage } = this.options;\n\n    let sizePercentage = false;\n    let posPercentage = false;\n\n    if (percentage === true) {\n      sizePercentage = true;\n      posPercentage = true;\n    } else if (percentage) {\n      if (percentage.indexOf(\"position\") > -1) {\n        posPercentage = true;\n      }\n      if (percentage.indexOf(\"size\") > -1) {\n        sizePercentage = true;\n      }\n    }\n\n    this.posPercetage = posPercentage;\n    this.sizePercetage = sizePercentage;\n  }\n  public updateItem(item: GridItem, checkSizeGroup?: boolean) {\n    const { isEqualSize, isConstantSize, useRoundedSize } = this.options;\n    const initialRects = this.initialRects;\n    const { orgRect, element } = item;\n    const isLoading = item.updateState === UPDATE_STATE.WAIT_LOADING;\n    const hasOrgSize = orgRect && orgRect.width && orgRect.height;\n    let rect: Required<DOMRect>;\n\n    const attributes: Record<string, string> = element\n      ? getDataAttributes(element, this.options.attributePrefix)\n      : item.attributes;\n    const sizeGroup = attributes.sizeGroup ?? \"\";\n    const isNotEqualSize = attributes.notEqualSize;\n\n    if (sizeGroup !== \"\" && initialRects[sizeGroup]) {\n      rect = initialRects[sizeGroup];\n    } else if (isEqualSize && !isNotEqualSize && !sizeGroup && initialRects[\"\"]) {\n      rect = initialRects[\"\"];\n    } else if (isConstantSize && hasOrgSize && !isLoading && item.isFirstUpdate) {\n      rect = orgRect;\n    } else if (checkSizeGroup || !element) {\n      return;\n    } else {\n      rect = {\n        left: element.offsetLeft,\n        top: element.offsetTop,\n        width: 0,\n        height: 0,\n      };\n      if (useRoundedSize) {\n        rect.width = element.offsetWidth;\n        rect.height = element.offsetHeight;\n      } else {\n        const clientRect = element.getBoundingClientRect();\n\n        rect.width = clientRect.width;\n        rect.height = clientRect.height;\n      }\n    }\n    item.attributes = attributes;\n    item.shouldReupdate = false;\n\n    if (!item.isFirstUpdate || !hasOrgSize) {\n      item.orgRect = { ...rect };\n    }\n    item.rect = { ...rect };\n\n    // If it's equal size items, it doesn't affect the state.\n    if (!checkSizeGroup) {\n      if (item.element) {\n        item.mountState = MOUNT_STATE.MOUNTED;\n      }\n\n      if (item.updateState === UPDATE_STATE.NEED_UPDATE) {\n        item.updateState = UPDATE_STATE.UPDATED;\n        item.isFirstUpdate = true;\n      }\n      if (!isLoading && !isNotEqualSize && !initialRects[sizeGroup]) {\n        initialRects[sizeGroup] = { ...rect };\n      }\n    }\n\n    return rect;\n  }\n  private _renderItem(item: GridItem) {\n    const element = item.element;\n    const cssRect = item.cssRect;\n\n    if (!element || !cssRect) {\n      return;\n    }\n\n    const {\n      horizontal,\n      useTransform,\n    } = this.options;\n    const posPercentage = this.posPercetage;\n    const sizePercentage = this.sizePercetage;\n    const cssTexts: string[] = [\"position: absolute;\"];\n    const {\n      inlineSize: sizeName,\n      inlinePos: posName,\n    } = RECT_NAMES[horizontal ? \"horizontal\" : \"vertical\"];\n    const inlineSize = this.getInlineSize();\n    let keys = getKeys(cssRect);\n    const hasRectProperties = keys.length > 0;\n\n    if (useTransform) {\n      keys = keys.filter((key) => key !== \"top\" && key !== \"left\");\n\n      cssTexts.push(`transform: `\n        + `translate(${cssRect.left || 0}px, ${cssRect.top || 0}px);`\n      );\n    }\n    cssTexts.push(...keys.map((name) => {\n      const value = cssRect[name]!;\n\n      if (\n        (name === sizeName && sizePercentage) ||\n        (name === posName && posPercentage)\n      ) {\n        return `${name}: ${(value / inlineSize) * 100}%;`;\n      }\n      return `${name}: ${value}px;`;\n    }));\n\n    if (hasRectProperties) {\n      element.style.cssText += cssTexts.join(\"\");\n    }\n  }\n}\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport { DOMRect, GridRect } from \"./types\";\nimport { MOUNT_STATE, RECT_NAMES, UPDATE_STATE } from \"./consts\";\n\n/**\n * @typedef\n * @memberof Grid.GridItem\n * @property - The item key. <ko>아이템 키.</ko>\n * @property - The item index. <ko>아이템 index.</ko>\n * @property - The element for the item. <ko>아이템에 있는 엘리먼트.</ko>\n * @property - State of whether the element has been added to the container. <ko>element가 container에 추가되었는지 상태.</ko>\n * @property - The update state of the element's rect. <ko>element의 rect의 업데이트 상태.</ko>\n * @property - Whether the element's rect was updated for the first time. <ko>처음으로 element의 rect를 업데이트 했는지 여부.</ko>\n * @property - Attributes set as `data-grid-` of element. <ko>element의 `data-grid-`으로 설정된 속성들.</ko>\n * @property - cssText of the first style when an element is added to the container. <ko>element가 container에 추가됐을 때 처음 style의 cssText.</ko>\n * @property - The element's rect before first rendering. <ko>처음 렌더링 하기 전 엘리먼트의 rect.</ko>\n * @property - The updated element's rect before rendering. <ko>렌더링 하기 전 업데이트 된 엘리먼트의 rect.</ko>\n * @property - The CSS rect of the item to be rendered by being applied to the Grid. <ko>Grid에 적용되어 렌더링을 하기 위한 item의 CSS rect</ko>\n * @property - Additional data of the item. <ko>item의 추가적인 데이터들.</ko>\n * @property - Grid ready data for rendering. <ko>렌더링을 하기 위한 grid의 준비 데이터.</ko>\n */\nexport interface GridItemStatus {\n  key?: string | number;\n  index?: number;\n  element?: HTMLElement | null;\n  mountState?: MOUNT_STATE;\n  updateState?: UPDATE_STATE;\n  isFirstUpdate?: boolean;\n  attributes?: Record<string, any>;\n  orgCSSText?: string;\n  orgRect?: Required<DOMRect>;\n  rect?: Required<DOMRect>;\n  cssRect?: DOMRect;\n  data?: Record<string, any>;\n  gridData?: Record<string, any>;\n}\n\n/**\n * @memberof Grid\n * @implements Grid.GridItem.GridItemStatus\n */\nclass GridItem {\n  /**\n   * Whether or not it will be updated upon request.\n   * @inner\n   */\n  public isUpdating = false;\n  /**\n   * Whether the item needs to be updated again\n   * @inner\n   */\n  public shouldReupdate = false;\n  public hasTransition = false;\n  public transitionDuration = \"\";\n  public isRestoreOrgCSSText = true;\n\n  /**\n   * @constructor\n   * @param horizontal - Direction of the scroll movement. (true: horizontal, false: vertical) <ko>스크롤 이동 방향. (true: 가로방향, false: 세로방향)</ko>\n   * @param itemStatus - Default status object of GridItem module. <ko>GridItem 모듈의 기본 status 객체.</ko>\n   */\n  constructor(\n    protected horizontal: boolean,\n    itemStatus: Partial<GridItemStatus> = {},\n  ) {\n    const element = itemStatus.element;\n    const status: Required<GridItemStatus> = {\n      key: \"\",\n      index: 0,\n      orgRect: { left: 0, top: 0, width: 0, height: 0 },\n      rect: { left: 0, top: 0, width: 0, height: 0 },\n      cssRect: {},\n      attributes: {},\n      data: {},\n      isFirstUpdate: false,\n      mountState: MOUNT_STATE.UNCHECKED,\n      updateState: UPDATE_STATE.NEED_UPDATE,\n      element: element || null,\n      orgCSSText: element?.style.cssText ?? \"\",\n      gridData: {},\n      ...itemStatus,\n    };\n\n    for (const name in status) {\n      this[name] = status[name];\n    }\n  }\n  /**\n   * The size in inline direction before first rendering. \"width\" if horizontal is false, \"height\" otherwise.\n   * @ko 첫 렌더링 되기 전의 inline 방향의 사이즈. horizontal이 false면 \"width\", 아니면 \"height\".\n   * @member Grid.GridItem#orgInlineSize\n   */\n  public get orgInlineSize() {\n    const name = this._names.inlineSize;\n\n    return this.orgRect[name] || this.rect[name];\n  }\n  /**\n   * The size in content direction before first rendering. \"height\" if horizontal is false, \"width\" otherwise.\n   * @ko 첫 렌더링 되기 전의 content 방향의 사이즈. horizontal이 false면 \"height\", 아니면 \"width\".\n   * @member Grid.GridItem#orgContentSize\n   */\n  public get orgContentSize() {\n    const name = this._names.contentSize;\n\n    return this.orgRect[name] || this.rect[name];\n  }\n  /**\n   * The size in inline direction. \"width\" if horizontal is false, \"height\" otherwise.\n   * @ko inline 방향의 사이즈. horizontal이 false면 \"width\", 아니면 \"height\".\n   * @member Grid.GridItem#inlineSize\n   */\n  public get inlineSize() {\n    return this.rect[this._names.inlineSize];\n  }\n  /**\n   * The size in content direction. \"height\" if horizontal is false, \"width\" otherwise.\n   * @ko content 방향의 사이즈. horizontal이 false면 \"height\", 아니면 \"width\".\n   * @member Grid.GridItem#contentSize\n   */\n  public get contentSize() {\n    return this.rect[this._names.contentSize];\n  }\n  /**\n   * The CSS size in inline direction applied to the Grid. \"width\" if horizontal is false, \"height\" otherwise.\n   * @ko Grid에 적용된 inline 방향의 CSS 사이즈. horizontal이 false면 \"width\", 아니면 \"height\".\n   * @member Grid.GridItem#cssInlineSize\n   */\n  public get cssInlineSize() {\n    return this.cssRect[this._names.inlineSize];\n  }\n  /**\n   * The CSS size in content direction applied to the Grid. \"height\" if horizontal is false, \"width\" otherwise.\n   * @ko Grid에 적용된 content 방향의 CSS 사이즈. horizontal이 false면 \"height\", 아니면 \"width\".\n   * @member Grid.GridItem#cssContentSize\n   */\n  public get cssContentSize() {\n    return this.cssRect[this._names.contentSize];\n  }\n  /**\n   * The CSS pos in inline direction applied to the Grid. \"left\" if horizontal is false, \"top\" otherwise.\n   * @ko Grid에 적용된 inline 방향의 CSS 포지션. horizontal이 false면 \"left\", 아니면 \"top\".\n   * @member Grid.GridItem#cssInlinePos\n   */\n  public get cssInlinePos() {\n    return this.cssRect[this._names.inlinePos];\n  }\n  /**\n   * The CSS pos in content direction applied to the Grid. \"top\" if horizontal is false, \"left\" otherwise.\n   * @ko Grid에 적용된 content 방향의 CSS 포지션. horizontal이 false면 \"top\", 아니면 \"left\".\n   * @member Grid.GridItem#cssContentPos\n   */\n  public get cssContentPos() {\n    return this.cssRect[this._names.contentPos];\n  }\n  public set cssInlinePos(inlinePos: number | undefined) {\n    this.cssRect[this._names.inlinePos] = inlinePos;\n  }\n  public set cssContentPos(contentPos: number | undefined) {\n    this.cssRect[this._names.contentPos] = contentPos;\n  }\n  public set cssInlineSize(inlineSize: number | undefined) {\n    this.cssRect[this._names.inlineSize] = inlineSize;\n  }\n  public set cssContentSize(contentSize: number | undefined) {\n    this.cssRect[this._names.contentSize] = contentSize;\n  }\n  /**\n   * Calculated size in the direction of the inline applied to the grid. \"width\" if horizontal is false, \"height\" otherwise.\n   * @ko Grid에 적용된 inline 방향의 계산된 사이즈. horizontal이 false면 \"width\", 아니면 \"height\".\n   * @member Grid.GridItem#computedInlineSize\n   */\n  public get computedInlineSize() {\n    const name = this._names.inlineSize;\n\n    return this.cssRect[name] || this.rect[name] || this.orgRect[name];\n  }\n  /**\n   * Calculated size in the direction of the content applied to the grid. \"height\" if horizontal is false, \"width\" otherwise.\n   * @ko Grid에 적용된 content 방향의 계산된 사이즈. horizontal이 false면 \"height\", 아니면 \"width\".\n   * @member Grid.GridItem#computedContentSize\n   */\n  public get computedContentSize() {\n    const name = this._names.contentSize;\n\n    return this.cssRect[name] || this.rect[name] || this.orgRect[name];\n  }\n  /**\n   * Calculated position in the direction of the inline applied to the grid. \"left\" if horizontal is false, \"top\" otherwise.\n   * @ko Grid에 적용된 content 방향의 계산된 포지션. horizontal이 false면 \"left\", 아니면 \"top\".\n   * @member Grid.GridItem#computedInlinePos\n   */\n  public get computedInlinePos() {\n    const name = this._names.inlinePos;\n\n    return this.cssRect[name] ?? this.rect[name];\n  }\n  /**\n   * Calculated position in the direction of the content applied to the grid. \"top\" if horizontal is false, \"left\" otherwise.\n   * @ko Grid에 적용된 content 방향의 계산된 포지션. horizontal이 false면 \"top\", 아니면 \"left\".\n   * @member Grid.GridItem#computedContentPos\n   */\n  public get computedContentPos() {\n    const name = this._names.contentPos;\n\n    return this.cssRect[name] ?? this.rect[name];\n  }\n  /**\n   * Set CSS rect through GridRect.\n   * @ko GridRect을 통해 CSS Rect를 설정한다.\n   * @param - The style for setting CSS rect. <ko>CSS rect를 설정하기 위한 스타일.</ko>\n   */\n  public setCSSGridRect(gridRect: GridRect) {\n    const names = RECT_NAMES[this.horizontal ? \"horizontal\" : \"vertical\"];\n\n    const rect: DOMRect = {};\n\n    for (const name in gridRect) {\n      rect[names[name]] = gridRect[name];\n    }\n    this.cssRect = rect;\n  }\n  /**\n   * Add CSS part of rect through GridRect.\n   * @ko GridRect을 통해 CSS Rect의 일부를 추가한다..\n   * @param - The style for setting CSS rect. <ko>CSS rect를 설정하기 위한 스타일.</ko>\n   */\n  public addCSSGridRect(gridRect: GridRect) {\n    const names = RECT_NAMES[this.horizontal ? \"horizontal\" : \"vertical\"];\n\n    const rect: DOMRect = this.cssRect;\n\n    for (const name in gridRect) {\n      rect[names[name]] = gridRect[name];\n    }\n  }\n  /**\n   * Returns the status of the item.\n   * @ko 아이템의 상태를 반환한다.\n   */\n  public getStatus(): Required<GridItemStatus> {\n    return {\n      index: this.index,\n      mountState: this.mountState,\n      updateState: this.updateState,\n      attributes: this.attributes,\n      orgCSSText: this.orgCSSText,\n      isFirstUpdate: this.isFirstUpdate,\n      element: null,\n      key: this.key,\n      orgRect: this.orgRect,\n      rect: this.rect,\n      cssRect: this.cssRect,\n      gridData: this.gridData,\n      data: this.data,\n    };\n  }\n  /**\n   * Returns minimized status of the item.\n   * @ko 아이템의 간소화된 상태를 반환한다.\n   */\n  public getMinimizedStatus(): Partial<GridItemStatus> {\n    const status: Partial<GridItemStatus> = {\n      orgRect: this.orgRect,\n      rect: this.rect,\n      cssRect: this.cssRect,\n      attributes: this.attributes,\n      gridData: this.gridData,\n    };\n\n    const {\n      key,\n      mountState,\n      updateState,\n      isFirstUpdate,\n      orgCSSText,\n    } = this;\n    if (typeof key !== \"undefined\") {\n      status.key = key;\n    }\n    if (mountState !== MOUNT_STATE.UNCHECKED) {\n      status.mountState = mountState;\n    }\n    if (updateState !== UPDATE_STATE.NEED_UPDATE) {\n      status.updateState = updateState;\n    }\n    if (isFirstUpdate) {\n      status.isFirstUpdate = true;\n    }\n    if (orgCSSText) {\n      status.orgCSSText = orgCSSText;\n    }\n    return status;\n  }\n  private get _names() {\n    return this.horizontal ? RECT_NAMES.horizontal : RECT_NAMES.vertical;\n  }\n}\n\ninterface GridItem extends Required<GridItemStatus> {\n}\nexport { GridItem };\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport Component from \"@egjs/component\";\nimport { DEFAULT_GRID_OPTIONS, GRID_PROPERTY_TYPES, MOUNT_STATE, UPDATE_STATE } from \"./consts\";\nimport { ContainerManager } from \"./ContainerManager\";\nimport {\n  DestroyOptions, GridEvents, GridOptions,\n  GridOutlines, GridStatus, Properties, RenderOptions,\n  OnRenderComplete,\n} from \"./types\";\nimport ImReady from \"@egjs/imready\";\nimport { ItemRenderer } from \"./ItemRenderer\";\nimport { GetterSetter, getMountedElements, isNumber, isString, getUpdatedItems } from \"./utils\";\nimport { diff } from \"@egjs/children-differ\";\nimport { GridItem } from \"./GridItem\";\nimport { ResizeWatcherResizeEvent } from \"./ResizeWatcher\";\n\n/**\n * @extends eg.Component\n */\n@GetterSetter\nabstract class Grid<Options extends GridOptions = GridOptions> extends Component<GridEvents> {\n  public static defaultOptions: Required<GridOptions> = DEFAULT_GRID_OPTIONS;\n  public static propertyTypes = GRID_PROPERTY_TYPES;\n  public options: Required<Options>;\n  protected containerElement: HTMLElement;\n  protected containerManager: ContainerManager;\n  protected itemRenderer!: ItemRenderer;\n  protected items: GridItem[] = [];\n  protected outlines: GridOutlines = {\n    start: [],\n    end: [],\n  };\n  private _renderTimer = 0;\n  private _im: ImReady;\n\n  /**\n  * Apply the CSS rect of items to fit the Grid and calculate the outline.\n  * @ko  Grid에 맞게 아이템들의 CSS rect를 적용하고 outline을 계산한다.\n  * @abstract\n  * @method Grid#applyGrid\n  * @param {\"start\" | \"end\"} direcion - The direction to apply the Grid. (\"end\": start to end, \"start\": end to start) <ko>Grid를 적용할 방향. (\"end\": 시작에서 끝 방향, \"start\": 끝에서 시작 방향)</ko>\n  * @param {number[]} outline - The start outline to apply the Grid. <ko>Grid를 적용할 시작 outline.</ko>\n  */\n  public abstract applyGrid(items: GridItem[], direction: \"start\" | \"end\", outline: number[]): GridOutlines;\n\n  /**\n   * @param - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n   * @param - The option object of the Grid module <ko>Grid 모듈의 옵션 객체</ko>\n   */\n  constructor(containerElement: HTMLElement | string, options: Partial<Options> = {}) {\n    super();\n\n    this.options = {\n      ...((this.constructor as typeof Grid)\n        .defaultOptions as Required<Options>),\n      ...options,\n    };\n\n    this.containerElement = isString(containerElement)\n      ? document.querySelector<HTMLElement>(containerElement)!\n      : containerElement;\n\n    const {\n      isEqualSize,\n      isConstantSize,\n      useTransform,\n      horizontal,\n      percentage,\n      externalContainerManager,\n      externalItemRenderer,\n      resizeDebounce,\n      maxResizeDebounce,\n      autoResize,\n      useRoundedSize,\n      useResizeObserver,\n    } = this.options;\n\n    // TODO: 테스트용 설정\n    this.containerManager = externalContainerManager!\n      || new ContainerManager(this.containerElement, {\n        horizontal,\n        resizeDebounce,\n        maxResizeDebounce,\n        autoResize,\n        useResizeObserver,\n      }).on(\"resize\", this._onResize);\n    this.itemRenderer = externalItemRenderer!\n      || new ItemRenderer({\n        useTransform,\n        isEqualSize,\n        isConstantSize,\n        percentage,\n        useRoundedSize,\n      });\n\n    this._init();\n  }\n  /**\n   * Return Container Element.\n   * @ko 컨테이너 엘리먼트를 반환한다.\n   */\n  public getContainerElement(): HTMLElement {\n    return this.containerElement;\n  }\n  /**\n   * Return items.\n   * @ko 아이템들을 반환한다.\n   */\n  public getItems(): GridItem[] {\n    return this.items;\n  }\n  /**\n   * Returns the children of the container element.\n   * @ko 컨테이너 엘리먼트의 children을 반환한다.\n   */\n  public getChildren(): HTMLElement[] {\n    return [].slice.call(this.containerElement.children);\n  }\n  /**\n   * Set items.\n   * @ko 아이템들을 설정한다.\n   * @param items - The items to set. <ko>설정할 아이템들</ko>\n   */\n  public setItems(items: GridItem[]): this {\n    items.forEach((item, i) => {\n      item.index = i;\n    });\n    const options = this.options;\n\n    if (options.useResizeObserver && options.observeChildren) {\n      const containerManager = this.containerManager;\n\n      containerManager.unobserveChildren(getMountedElements(this.items));\n      containerManager.observeChildren(getMountedElements(items));\n    }\n    this.items = items;\n    return this;\n  }\n  /**\n   * Gets the container's inline size. (\"width\" if horizontal is false, otherwise \"height\")\n   * @ko container의 inline 사이즈를 가져온다. (horizontal이 false면 \"width\", 아니면 \"height\")\n   */\n  public getContainerInlineSize(): number {\n    return this.containerManager.getInlineSize()!;\n  }\n  /**\n   * Returns the outlines of the start and end of the Grid.\n   * @ko Grid의 처음과 끝의 outline을 반환한다.\n   */\n  public getOutlines(): GridOutlines {\n    return this.outlines;\n  }\n  /**\n   * Set outlines.\n   * @ko 아웃라인을 설정한다.\n   * @param outlines - The outlines to set. <ko>설정할 아웃라인.</ko>\n   */\n  public setOutlines(outlines: GridOutlines) {\n    this.outlines = outlines;\n    return this;\n  }\n  /**\n   * When elements change, it synchronizes and renders items.\n   * @ko elements가 바뀐 경우 동기화를 하고 렌더링을 한다.\n   * @param - Options for rendering. <ko>렌더링을 하기 위한 옵션.</ko>\n   */\n  public syncElements(options: RenderOptions = {}) {\n    const items = this.items;\n    const { horizontal } = this.options;\n    const elements: HTMLElement[] = this.getChildren();\n    const { added, maintained, changed, removed } = diff(this.items.map((item) => item.element!), elements);\n\n    const nextItems: GridItem[] = [];\n\n    maintained.forEach(([beforeIndex, afterIndex]) => {\n      nextItems[afterIndex] = items[beforeIndex];\n    });\n    added.forEach((index) => {\n      nextItems[index] = new GridItem(horizontal!, {\n        element: elements[index],\n      });\n    });\n\n    this.setItems(nextItems);\n\n    if (added.length || removed.length || changed.length) {\n      this.renderItems(options);\n    }\n    return this;\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: GridItem[] = this.items, options: RenderOptions = {}) {\n    const useOrgResize = options.useOrgResize;\n\n    items.forEach((item) => {\n      if (useOrgResize) {\n        const orgRect = item.orgRect;\n\n        orgRect.width = 0;\n        orgRect.height = 0;\n      }\n      item.updateState = UPDATE_STATE.NEED_UPDATE;\n    });\n    this.checkReady(options);\n    return this;\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   * ```js\n   * import { MasonryGrid } from \"@egjs/grid\";\n   * const grid = new MasonryGrid();\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 current status such as item's position, size. The returned status can be restored with the setStatus() method.\n   * @ko 아이템의 위치, 사이즈 등 현재 상태를 반환한다. 반환한 상태는 setStatus() 메서드로 복원할 수 있다.\n   * @param - Whether to minimize the status of the item. (default: false) <ko>item의 status를 최소화할지 여부. (default: false)</ko>\n   */\n  public getStatus(minimize?: boolean): GridStatus {\n    return {\n      outlines: this.outlines,\n      items: this.items.map((item) => minimize ? item.getMinimizedStatus() : item.getStatus()),\n      containerManager: this.containerManager.getStatus(),\n      itemRenderer: this.itemRenderer.getStatus(),\n    };\n  }\n  /**\n   * Set status of the Grid module with the status returned through a call to the getStatus() method.\n   * @ko getStatus() 메서드에 대한 호출을 통해 반환된 상태로 Grid 모듈의 상태를 설정한다.\n   */\n  public setStatus(status: GridStatus) {\n    const horizontal = this.options.horizontal;\n    const containerManager = this.containerManager;\n    const prevInlineSize = containerManager.getInlineSize();\n    const children = this.getChildren();\n\n    this.itemRenderer.setStatus(status.itemRenderer);\n    containerManager.setStatus(status.containerManager);\n    this.outlines = status.outlines;\n    this.items = status.items.map((item, i) => new GridItem(horizontal!, {\n      ...item,\n      element: children[i],\n    }));\n\n    this.itemRenderer.renderItems(this.items);\n\n    if (prevInlineSize !== containerManager.getInlineSize()) {\n      this.renderItems({\n        useResize: true,\n      });\n    } else {\n      window.setTimeout(() => {\n        this._renderComplete({\n          direction: this.defaultDirection,\n          mounted: this.items,\n          updated: [],\n          isResize: false,\n        });\n      });\n    }\n    return this;\n  }\n  /**\n   * Get the inline size corresponding to outline.\n   * @ko outline에 해당하는 inline 사이즈를 구한다.\n   * @param items - Items to get outline size. <ko>outline 사이즈를 구하기 위한 아이템들.</ko>\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  public getComputedOutlineSize(items: GridItem[] = this.items) {\n    return this.options.outlineSize! || this.getContainerInlineSize();\n  }\n  /**\n   * Get the length corresponding to outline.\n   * @ko outline에 해당하는 length를 가져온다.\n   * @param items - Items to get outline length. <ko>outline length를 구하기 위한 아이템들.</ko>\n   */\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  public getComputedOutlineLength(items: GridItem[] = this.items): number {\n    return this.options.outlineLength! || 1;\n  }\n\n  /**\n   * Releases the instnace and events and returns the CSS of the container and elements.\n   * @ko 인스턴스와 이벤트를 해제하고 컨테이너와 엘리먼트들의 CSS를 되돌린다.\n   * @param Options for destroy. <ko>destory()를 위한 옵션</ko>\n   */\n  public destroy(options: DestroyOptions = {}) {\n    const {\n      preserveUI = this.options.preserveUIOnDestroy,\n    } = options;\n    this.containerManager.destroy({\n      preserveUI,\n    });\n\n    if (!preserveUI) {\n      this.items.forEach(({ element, orgCSSText }) => {\n        if (element) {\n          element.style.cssText = orgCSSText;\n        }\n      });\n    }\n\n    this._im?.destroy();\n  }\n  protected getInlineGap(): number {\n    return this._getDirectionalGap('inline');\n  }\n  protected getContentGap(): number {\n    return this._getDirectionalGap('content');\n  }\n  protected checkReady(options: RenderOptions = {}) {\n    // Grid: renderItems => checkReady => readyItems => applyGrid\n    const useOrgResize = options.useOrgResize;\n    const items = this.items;\n    const updated = items.filter((item) => item.element?.parentNode && item.updateState !== UPDATE_STATE.UPDATED);\n    const mounted = items.filter((item) => item.element?.parentNode && item.mountState !== MOUNT_STATE.MOUNTED);\n    const moreUpdated: GridItem[] = [];\n\n    mounted.filter((item) => {\n      if (item.hasTransition) {\n        return true;\n      } else {\n        const element = item.element!;\n        const transitionDuration = parseFloat(getComputedStyle(element).transitionDuration);\n\n        if (transitionDuration > 0) {\n          item.hasTransition = true;\n          item.transitionDuration = element.style.transitionDuration;\n          return true;\n        }\n      }\n      return false;\n    }).forEach((item) => {\n      item.element!.style.transitionDuration = \"0s\";\n    });\n\n    this._im?.destroy();\n    this._im = new ImReady({\n      prefix: this.options.attributePrefix,\n    }).on(\"preReadyElement\", (e) => {\n      updated[e.index].updateState = UPDATE_STATE.WAIT_LOADING;\n    }).on(\"preReady\", () => {\n      // reset org size\n      updated.forEach((item) => {\n        const isInitialState = !item.isFirstUpdate || !item.orgRect.width || !item.orgRect.height;\n        const hasCSSSize = item.cssRect.width || item.cssRect.height;\n\n        if ((isInitialState || useOrgResize) && hasCSSSize) {\n          item.element!.style.cssText = item.orgCSSText;\n        }\n      });\n      this._updateItems(updated);\n      this.readyItems(mounted, updated, options);\n    }).on(\"readyElement\", (e) => {\n      const item = updated[e.index];\n\n      item.updateState = UPDATE_STATE.NEED_UPDATE;\n      // after preReady\n      if (e.isPreReadyOver) {\n        const isInitialState = !item.isFirstUpdate || !item.orgRect.width || !item.orgRect.height;\n        const hasCSSSize = item.cssRect.width || item.cssRect.height;\n\n        if (item.isRestoreOrgCSSText || (isInitialState || useOrgResize) && hasCSSSize) {\n          item.element!.style.cssText = item.orgCSSText;\n        }\n\n        this._updateItems([item]);\n        this.readyItems([], [item], options);\n      }\n    }).on(\"error\", (e) => {\n      const item = updated[e.index];\n      /**\n       * This event is fired when an error occurs in the content.\n       * @ko 콘텐츠 로드에 에러가 날 때 발생하는 이벤트.\n       * @event Grid#contentError\n       * @param {Grid.OnContentError} e - The object of data to be sent to an event <ko>이벤트에 전달되는 데이터 객체</ko>\n       * @example\n       * ```js\n       * grid.on(\"contentError\", e => {\n       *   e.update();\n       * });\n       * ```\n      */\n      this.trigger(\"contentError\", {\n        element: e.element,\n        target: e.target,\n        item,\n        update: () => {\n          moreUpdated.push(item);\n        },\n      });\n    }).on(\"ready\", () => {\n      if (moreUpdated.length) {\n        this.updateItems(moreUpdated);\n      }\n    }).check(updated.map((item) => item.element!));\n  }\n\n  protected scheduleRender() {\n    this._clearRenderTimer();\n    this._renderTimer = window.setTimeout(() => {\n      this.renderItems();\n    });\n  }\n  protected fitOutlines(useFit = this.useFit) {\n    const outlines = this.outlines;\n    const startOutline = outlines.start;\n    const endOutline = outlines.end;\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    outlines.start = startOutline.map((point) => point - outlineOffset);\n    outlines.end = endOutline.map((point) => point - outlineOffset);\n\n    this.items.forEach((item) => {\n      const contentPos = item.cssContentPos;\n\n      if (!isNumber(contentPos)) {\n        return;\n      }\n      item.cssContentPos = contentPos - outlineOffset;\n    });\n  }\n  protected readyItems(mounted: GridItem[], updated: GridItem[], options: RenderOptions) {\n    const prevOutlines = this.outlines;\n    const direction = options.direction || this.options.defaultDirection!;\n    const prevOutline = options.outline || prevOutlines[direction === \"end\" ? \"start\" : \"end\"];\n    const items = this.items;\n    let nextOutlines = {\n      start: [...prevOutline],\n      end: [...prevOutline],\n    };\n\n    mounted.forEach((item) => {\n      item.mountState = MOUNT_STATE.MOUNTED;\n    });\n    updated.forEach((item) => {\n      item.isUpdating = true;\n    });\n    if (items.length) {\n      nextOutlines = this.applyGrid(this.items, direction, prevOutline);\n    }\n    updated.forEach((item) => {\n      item.isUpdating = false;\n    });\n    this.setOutlines(nextOutlines);\n    this.fitOutlines();\n    this.itemRenderer.renderItems(this.items);\n    this._refreshContainerContentSize();\n\n    const transitionMounted = mounted.filter((item) => item.hasTransition);\n\n    if (transitionMounted.length) {\n      this.containerManager.resize();\n      transitionMounted.forEach((item) => {\n        const element = item.element!;\n\n        element.style.transitionDuration = item.transitionDuration;\n      });\n    }\n    this._renderComplete({\n      direction,\n      mounted,\n      updated,\n      isResize: !!options.useResize,\n    });\n    const shouldReupdateItems = updated.filter((item) => item.shouldReupdate);\n\n    if (shouldReupdateItems.length) {\n      this.updateItems(shouldReupdateItems);\n    }\n  }\n  protected _isObserverEnabled() {\n    return this.containerManager.isObserverEnabled();\n  }\n  protected _updateItems(items: GridItem[]) {\n    this.itemRenderer.updateEqualSizeItems(items, this.getItems());\n  }\n  private _getDirectionalGap(direction: 'inline' | 'content'): number {\n    const horizontal = this.options.horizontal!;\n    const gap = this.options.gap!;\n    if (typeof gap === 'number') return gap;\n    const isVerticalGap = horizontal && direction === 'inline' || !horizontal && direction === 'content';\n    return (isVerticalGap ? (gap as any).vertical : (gap as any).horizontal) ?? (DEFAULT_GRID_OPTIONS[\"gap\"] as number);\n  }\n  private _renderComplete(e: OnRenderComplete) {\n    /**\n     * This event is fired when the Grid has completed rendering.\n     * @ko Grid가 렌더링이 완료됐을 때  발생하는 이벤트이다.\n     * @event Grid#renderComplete\n     * @param {Grid.OnRenderComplete} e - The object of data to be sent to an event <ko>이벤트에 전달되는 데이터 객체</ko>\n     * @example\n     * ```js\n     * grid.on(\"renderComplete\", e => {\n     *   console.log(e.mounted, e.updated, e.useResize);\n     * });\n     * ```\n     */\n    this.trigger(\"renderComplete\", e);\n  }\n  private _clearRenderTimer() {\n    clearTimeout(this._renderTimer);\n    this._renderTimer = 0;\n  }\n  private _refreshContainerContentSize() {\n    const {\n      start: startOutline,\n      end: endOutline,\n    } = this.outlines;\n    const contentGap = this.getContentGap();\n\n    const endPoint = endOutline.length ? Math.max(...endOutline) : 0;\n    const startPoint = startOutline.length ? Math.max(...startOutline) : 0;\n    const contentSize = Math.max(startPoint, endPoint - contentGap);\n\n    this.containerManager.setContentSize(contentSize);\n  }\n  private _resizeContainer() {\n    this.containerManager.resize();\n    this.itemRenderer.setContainerRect(this.containerManager.getRect());\n  }\n  private _onResize = (e: ResizeWatcherResizeEvent) => {\n    if (e.isResizeContainer) {\n      this._renderItems({\n        useResize: true,\n      }, true);\n    } else {\n      const updatedItems = getUpdatedItems(this.items, e.childEntries);\n\n      if (updatedItems.length > 0) {\n        this.updateItems(updatedItems);\n      }\n    }\n  }\n  private _init() {\n    this._resizeContainer();\n  }\n  private _renderItems(options: RenderOptions = {}, isTrusted?: boolean) {\n    this._clearRenderTimer();\n\n    const isResize = options.useResize || options.useOrgResize;\n\n\n    if (isResize && !isTrusted) {\n      // Resize container\n      // isTrusted has already been resized internally.\n      this._resizeContainer();\n      this.itemRenderer.resize();\n    }\n\n    // 초기상태\n    if (!this.getItems().length && this.getChildren().length) {\n      this.syncElements(options);\n    } else if (isResize) {\n      // Update all items\n      this.updateItems(this.items, options);\n    } else {\n      // Update only items that need to be updated.\n      this.checkReady(options);\n    }\n  }\n}\n\ninterface Grid extends Properties<typeof Grid> { }\n\nexport default Grid;\n\n/**\n * Gap used to create space around items.\n * @ko 아이템들 사이의 공간.\n * @name Grid#gap\n * @type {$ts:Grid.GridOptions[\"gap\"]}\n * @default 0\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   gap: 0,\n * });\n *\n * grid.gap = 5;\n * ```\n */\n\n/**\n * The default direction value when direction is not set in the render option.\n * @ko render옵션에서 direction을 미설정시의 기본 방향값.\n * @name Grid#defaultDirection\n * @type {$ts:Grid.GridOptions[\"defaultDirection\"]}\n * @default \"end\"\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   defaultDirection: \"end\",\n * });\n *\n * grid.defaultDirection = \"start\";\n * ```\n */\n\n\n/**\n * Whether to move the outline to 0 when the top is empty when rendering. However, if it overflows above the top, the outline is forced to 0. (default: true)\n * @ko 렌더링시 상단이 비어있을 때 아웃라인을 0으로 이동시킬지 여부. 하지만 상단보다 넘치는 경우 아웃라인을 0으로 강제 이동한다. (default: true)\n * @name Grid#useFit\n * @type {$ts:Grid.GridOptions[\"useFit\"]}\n * @default true\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   useFit: true,\n * });\n *\n * grid.useFit = false;\n * ```\n */\n\n/**\n * Whether to preserve the UI of the existing container or item when destroying.\n * @ko destroy 시 기존 컨테이너, 아이템의 UI를 보존할지 여부.\n * @name Grid#preserveUIOnDestroy\n * @type {$ts:Grid.GridOptions[\"preserveUIOnDestroy\"]}\n * @default false\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   preserveUIOnDestroy: false,\n * });\n *\n * grid.preserveUIOnDestroy = true;\n * ```\n */\n\n\n/**\n * The number of outlines. If the number of outlines is 0, it is calculated according to the type of grid.\n * @ko outline의 개수. 아웃라인의 개수가 0이라면 grid의 종류에 따라 계산이 된다.\n * @name Grid#outlineLength\n * @type {$ts:Grid.GridOptions[\"outlineLength\"]}\n * @default 0\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   outlineLength: 0,\n *   outlineSize: 0,\n * });\n *\n * grid.outlineLength = 3;\n * ```\n */\n\n\n/**\n * The size of the outline. If the outline size is 0, it is calculated according to the grid type.\n * @ko outline의 사이즈. 만약 outline의 사이즈가 0이면, grid의 종류에 따라 계산이 된다.\n * @name Grid#outlineSize\n * @type {$ts:Grid.GridOptions[\"outlineSize\"]}\n * @default 0\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   outlineLength: 0,\n *   outlineSize: 0,\n * });\n *\n * grid.outlineSize = 300;\n * ```\n */\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport Grid from \"../Grid\";\nimport { PROPERTY_TYPE, UPDATE_STATE } from \"../consts\";\nimport { GridOptions, Properties, GridOutlines, GridAlign, MasonryGridVerticalAlign } from \"../types\";\nimport { range, GetterSetter, between, isString, throttle } from \"../utils\";\nimport { GridItem } from \"../GridItem\";\n\n\nfunction getColumnPoint(\n  outline: number[],\n  columnIndex: number,\n  columnCount: number,\n  pointCaculationName: \"max\" | \"min\",\n) {\n  return Math[pointCaculationName](...outline.slice(columnIndex, columnIndex + columnCount));\n}\n\nfunction getColumnIndex(\n  outline: number[],\n  columnCount: number,\n  nearestCalculationName: \"max\" | \"min\",\n  startPos: number,\n) {\n  const length = outline.length - columnCount + 1;\n  const pointCaculationName = nearestCalculationName === \"max\" ? \"min\" : \"max\";\n  const indexCaculationName = nearestCalculationName === \"max\" ? \"lastIndexOf\" : \"indexOf\";\n  const points = range(length).map((index) => {\n    const point = getColumnPoint(outline, index, columnCount, pointCaculationName);\n\n    return Math[pointCaculationName](startPos, point);\n  });\n\n  return points[indexCaculationName](Math[nearestCalculationName](...points));\n}\n\n/**\n * @typedef\n * @memberof Grid.MasonryGrid\n * @extends Grid.GridOptions\n */\nexport interface MasonryGridOptions extends GridOptions {\n  /**\n   * The number of columns. If the number of columns is 0, it is automatically calculated according to the size of the container. Can be used instead of outlineLength.\n   * <ko>열의 개수. 열의 개수가 0이라면, 컨테이너의 사이즈에 의해 계산이 된다. outlineLength 대신 사용할 수 있다.</ko>\n   * @default 0\n   */\n  column?: number;\n  /**\n   * The size of the columns. If it is 0, it is calculated as the size of the first item in items. Can be used instead of outlineSize.\n   * <ko>열의 사이즈. 만약 열의 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. outlineSize 대신 사용할 수 있다.</ko>\n   * @default 0\n   */\n  columnSize?: number;\n  /**\n   * The size ratio(inlineSize / contentSize) of the columns. 0 is not set. `true` is automatically calculated as orgInlineSize / orgContentSize.\n   * <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다. `true` 는 orgInlineSize / orgContentSize로 자동 계산이 된다.</ko>\n   * @default 0\n   */\n  columnSizeRatio?: number | boolean;\n  /**\n   * Align of the position of the items. If you want to use `stretch`, be sure to set `column`, `columnSize` or `maxStretchColumnSize` option. (\"start\", \"center\", \"end\", \"justify\", \"stretch\")\n   * <ko>아이템들의 위치의 정렬. `stretch`를 사용하고 싶다면 `column`, `columnSize` 또는 `maxStretchColumnSize` 옵션을 설정해라.  (\"start\", \"center\", \"end\", \"justify\", \"stretch\")</ko>\n   * @default \"justify\"\n   */\n  align?: GridAlign;\n  /**\n   * Content direction alignment of items. “Masonry” is sorted in the form of masonry. Others are applied as content direction alignment, similar to vertical-align of inline-block.\n   * If you set multiple columns (`data-grid-column`), the screen may look strange.\n   * <ko>아이템들의 Content 방향의 정렬. \"masonry\"는 masonry 형태로 정렬이 된다. 그 외는 inline-block의 vertical-align과 유사하게 content 방향 정렬로 적용이 된다.칼럼(`data-grid-column` )을 여러개 설정하면 화면이 이상하게 보일 수 있다. </ko>\n   * @default \"masonry\"\n   */\n  contentAlign?: MasonryGridVerticalAlign;\n  /**\n   * Difference Threshold for Counting Columns. Since offsetSize is calculated by rounding, the number of columns may not be accurate.\n   * <ko>칼럼 개수를 계산하기 위한 차이 임계값. offset 사이즈는 반올림으로 게산하기 때문에 정확하지 않을 수 있다.</ko>\n   * @default 1\n   */\n  columnCalculationThreshold?: number;\n  /**\n   * If stretch is used, the column can be automatically calculated by setting the maximum size of the column that can be stretched.\n   * <ko>stretch를 사용한 경우 최대로 늘릴 수 있는 column의 사이즈를 설정하여 column을 자동 계산할 수 있다.</ko>\n   * @default Infinity\n   */\n  maxStretchColumnSize?: number;\n\n  /**\n   * Adjust the contentSize of the items to make the outlines equal.\n   * \"scale-down\": Scales down to fit the start of the item's outline.\n   * \"scale-center\": Scales down or up to fit the center of the item's outline.\n   * \"scale-up\": Scales up to fit the end of the item's outline.\n   * <ko>아이템들의 contentSize를 조절하여 outline을 동등하게 한다.\n   * \"scale-down\": 아이템들의 아웃라인 시작 부분에 맞춰 축소시킨다.\n   * \"scale-center\": 아이템들의 아웃라인 중간 부분에 맞춰 축소시키거나 확장시킨다.\n   * \"scale-up\": 아이템들의 아웃라인 끝 부분에 맞춰 확장시킨다.</ko>\n   * @default \"\"\n   */\n  stretchOutline?: \"scale-down\" | \"scale-up\" | \"scale-center\" | \"\";\n  /**\n   * When using stretchOutline, the contentSize of the items is adjusted to adjust the outline to a value between min and max. ([minSize, maxSize])\n   * <ko>stretchOutline를 사용하는 경우 아이템들의 contentSize를 조절하여 container의 outline을 min과 max 사이 값으로 조절한다. ([minSize, maxSize])</ko>\n   * @default [0, Infinity]\n   */\n  stretchContainerSize?: number[];\n  /**\n   * adjust the minimum and maximum item size of the items. ([minSize, maxSize])\n   * <ko>아이템들의 item size 최소, 최대 크기를 조절한다. ([minSize, maxSize])</ko>\n   * @default [0, Infinity]\n   */\n  stretchItemSize?: Array<string | number>;\n}\n\n/**\n * MasonryGrid 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 MasonryGrid는 벽돌을 쌓아 올린 모양처럼 동일한 너비를 가진 아이템를 쌓는 레이아웃이다. 모든 이미지의 너비를 동일한 크기로 조정하고, 가장 높이가 낮은 열을 찾아 새로운 이미지를 삽입한다. 따라서 배치된 아이템 사이에 빈 공간이 생기지는 않지만 배치된 레이아웃의 아래쪽은 울퉁불퉁해진다.\n * @memberof Grid\n * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param {Grid.MasonryGrid.MasonryGridOptions} options - The option object of the MasonryGrid module <ko>MasonryGrid 모듈의 옵션 객체</ko>\n */\n@GetterSetter\nexport class MasonryGrid extends Grid<MasonryGridOptions> {\n  public static propertyTypes = {\n    ...Grid.propertyTypes,\n    column: PROPERTY_TYPE.RENDER_PROPERTY,\n    columnSize: PROPERTY_TYPE.RENDER_PROPERTY,\n    columnSizeRatio: PROPERTY_TYPE.RENDER_PROPERTY,\n    align: PROPERTY_TYPE.RENDER_PROPERTY,\n    columnCalculationThreshold: PROPERTY_TYPE.RENDER_PROPERTY,\n    maxStretchColumnSize: PROPERTY_TYPE.RENDER_PROPERTY,\n    contentAlign: PROPERTY_TYPE.RENDER_PROPERTY,\n    stretchOutline: PROPERTY_TYPE.RENDER_PROPERTY,\n    stretchContainerSize: PROPERTY_TYPE.RENDER_PROPERTY,\n    stretchItemSize: PROPERTY_TYPE.RENDER_PROPERTY,\n  };\n  public static defaultOptions: Required<MasonryGridOptions> = {\n    ...Grid.defaultOptions,\n    align: \"justify\",\n    column: 0,\n    columnSize: 0,\n    columnSizeRatio: 0,\n    columnCalculationThreshold: 0.5,\n    maxStretchColumnSize: Infinity,\n    contentAlign: \"masonry\",\n    stretchOutline: \"\",\n    stretchContainerSize: [0, Infinity],\n    stretchItemSize: [0, Infinity],\n  };\n\n  public applyGrid(items: GridItem[], direction: \"start\" | \"end\", outline: number[]): GridOutlines {\n    items.forEach((item) => {\n      item.isRestoreOrgCSSText = false;\n    });\n    const columnSize = this.getComputedOutlineSize(items);\n    const column = this.getComputedOutlineLength(items);\n\n    // contentPos를 변경했는지에 따라 computedSize로 설정해야 함.\n    let useComputedSize = false;\n    const {\n      align,\n      observeChildren,\n      columnSizeRatio,\n      contentAlign,\n      stretchOutline,\n      stretchContainerSize,\n      stretchItemSize,\n    } = this.options;\n    const inlineGap = this.getInlineGap();\n    const contentGap = this.getContentGap();\n    const outlineLength = outline.length;\n    const itemsLength = items.length;\n    const alignPoses = this._getAlignPoses(column, columnSize);\n    const isEndDirection = direction === \"end\";\n    const nearestCalculationName = isEndDirection ? \"min\" : \"max\";\n    const pointCalculationName = isEndDirection ? \"max\" : \"min\";\n\n    let startOutline = [0];\n\n    if (outlineLength === column) {\n      startOutline = outline.slice();\n    } else {\n      const point = outlineLength ? Math[pointCalculationName](...outline) : 0;\n\n      startOutline = range(column).map(() => point);\n    }\n    let endOutline = startOutline.slice();\n    const columnDist = column > 1 ? alignPoses[1] - alignPoses[0] : 0;\n    const isStretch = align === \"stretch\";\n    const isStartContentAlign = isEndDirection && contentAlign === \"start\";\n    const itemIndexes: number[][] = range(startOutline.length).map(() => []);\n\n\n\n    let startPos = isEndDirection ? -Infinity : Infinity;\n\n\n    if (isStartContentAlign) {\n      // support only end direction\n      startPos = Math.min(...endOutline);\n    }\n\n\n    for (let i = 0; i < itemsLength; ++i) {\n      const itemIndex = isEndDirection ? i : itemsLength - 1 - i;\n      const item = items[itemIndex];\n      const columnAttribute = parseInt(item.attributes.column || \"1\", 10);\n      const maxColumnAttribute = parseInt(item.attributes.maxColumn || \"1\", 10);\n      let contentSize = item.contentSize;\n      let columnCount = Math.min(\n        column,\n        columnAttribute || Math.max(1, Math.ceil((item.inlineSize + inlineGap) / columnDist)),\n      );\n      const maxColumnCount = Math.min(column, Math.max(columnCount, maxColumnAttribute));\n      let columnIndex = getColumnIndex(endOutline, columnCount, nearestCalculationName, startPos);\n      let contentPos = getColumnPoint(endOutline, columnIndex, columnCount, pointCalculationName);\n\n      if (isStartContentAlign && startPos !== contentPos) {\n        startPos = Math.max(...endOutline);\n        endOutline = endOutline.map(() => startPos);\n        contentPos = startPos;\n        columnIndex = 0;\n      }\n\n      while (columnCount < maxColumnCount) {\n        const nextEndColumnIndex = columnIndex + columnCount;\n        const nextColumnIndex = columnIndex - 1;\n\n        if (isEndDirection && (nextEndColumnIndex >= column || endOutline[nextEndColumnIndex] > contentPos)) {\n          break;\n        }\n        if (!isEndDirection && (nextColumnIndex < 0 || endOutline[nextColumnIndex] < contentPos)) {\n          break;\n        }\n        if (!isEndDirection) {\n          --columnIndex;\n        }\n        ++columnCount;\n      }\n\n      columnIndex = Math.max(0, columnIndex);\n      columnCount = Math.min(column - columnIndex, columnCount);\n\n      itemIndexes[columnIndex].push(itemIndex);\n\n      // stretch mode or data-grid-column > \"1\"\n      if ((columnAttribute > 0 && columnCount > 1) || isStretch) {\n        const nextInlineSize = (columnCount - 1) * columnDist + columnSize;\n\n        if ((!this._isObserverEnabled() || !observeChildren) && item.cssInlineSize !== nextInlineSize) {\n          item.shouldReupdate = true;\n        }\n        item.cssInlineSize = nextInlineSize;\n      }\n      if (columnSizeRatio === true) {\n        const ratio = item.orgContentSize / item.orgInlineSize;\n\n        contentSize = item.computedInlineSize * ratio;\n        item.cssContentSize = contentSize;\n        useComputedSize = true;\n      } else if (columnSizeRatio && columnSizeRatio > 0) {\n        contentSize = item.computedInlineSize / columnSizeRatio;\n        item.cssContentSize = contentSize;\n        useComputedSize = true;\n      }\n      // 배치가 조금 더 수월하기 위해서는 min, max scaling 1차 작업\n      let minStretchSize = 0;\n      let maxStretchSize = Infinity;\n      let useStretchItemSize = false;\n\n      if (isString(stretchItemSize[0])) {\n        const [inline, content] = stretchItemSize[0].split(\":\").map((value) => parseFloat(value));\n\n        minStretchSize = item.computedInlineSize * content / inline;\n        useStretchItemSize = true;\n      } else if (stretchItemSize[0]) {\n        minStretchSize = stretchItemSize[0];\n        useStretchItemSize = true;\n      }\n      if (isString(stretchItemSize[1])) {\n        const [inline, content] = stretchItemSize[1].split(\":\").map((value) => parseFloat(value));\n\n        maxStretchSize = item.computedInlineSize * content / inline;\n        useStretchItemSize = true;\n      } else if (stretchItemSize[1] && isFinite(stretchItemSize[1])) {\n        // 유한한 숫자라면 stretch 대상으로 판단\n        maxStretchSize = stretchItemSize[1];\n        useStretchItemSize = true;\n      }\n      const nextContentSize = between(contentSize, minStretchSize, maxStretchSize);\n\n\n      // stretchItemSize를 사용한 케이스라면 반영\n      if (useStretchItemSize) {\n        contentSize = nextContentSize;\n        item.cssContentSize = contentSize;\n        useComputedSize = true;\n      }\n      const inlinePos = alignPoses[columnIndex];\n      contentPos = isEndDirection ? contentPos : contentPos - contentGap - contentSize;\n\n      item.cssInlinePos = inlinePos;\n      item.cssContentPos = contentPos;\n      const nextOutlinePoint = isEndDirection ? contentPos + contentSize + contentGap : contentPos;\n\n      range(columnCount).forEach((indexOffset) => {\n        endOutline[columnIndex + indexOffset] = nextOutlinePoint;\n      });\n    }\n\n    if (stretchOutline && items.length) {\n      let scalePoint = 0;\n\n      if (stretchOutline === \"scale-up\") {\n        scalePoint = Math.max(...endOutline);\n      } else if (stretchOutline === \"scale-center\") {\n        scalePoint = (Math.max(...endOutline) + Math.min(...endOutline)) / 2;\n      } else {\n        // scale-down\n        scalePoint = Math.min(...endOutline);\n      }\n      if (isEndDirection) {\n        // end 방향이면 endOutline이 gap만큼 더 추가되어 있다.\n        scalePoint -= contentGap;\n\n        // 높이 제한\n        const startPoint = Math.min(...startOutline);\n        const nextHeight = between(\n          // 높이\n          scalePoint - startPoint,\n          stretchContainerSize[0],\n          stretchContainerSize[1],\n        );\n\n        scalePoint = nextHeight + startPoint;\n      } else {\n        // 높이 제한\n        const startPoint = Math.max(...startOutline);\n        const nextHeight = between(\n          // 반대 방향의 경우 startPoint(start)가 scalePoint(end)보다 큰 숫자다.\n          startPoint - scalePoint,\n          stretchContainerSize[0],\n          stretchContainerSize[1],\n        );\n\n        scalePoint = nextHeight - startPoint;\n      }\n\n      endOutline.forEach((point, i) => {\n        const totalGap = (itemIndexes[i].length - 1) * contentGap;\n        const startPoint = startOutline[i];\n        const prevSize = Math.abs(point - startPoint) - (isEndDirection ? contentGap : 0) - totalGap;\n        const nextSize = (Math.abs(scalePoint - startPoint) - totalGap);\n        const scale = nextSize / prevSize;\n\n        if (!prevSize || scale === 1 || !isFinite(scale)) {\n          return;\n        }\n        if (isEndDirection) {\n          endOutline[i] = scalePoint + contentGap;\n        } else {\n          endOutline[i] = scalePoint;\n        }\n\n        const length = itemIndexes[i].length;\n        let prevPoint = isEndDirection ? startOutline[i] : startOutline[i] - contentGap;\n\n        const itemInfos = itemIndexes[i].map((itemIndex, j) => {\n          const item = items[itemIndex];\n          const originalSize = useComputedSize\n            ? item.computedContentSize\n            : item.contentSize;\n          let minStretchSize = 0;\n          let maxStretchSize = Infinity;\n\n          if (isString(stretchItemSize[0])) {\n            const [inline, content] = stretchItemSize[0].split(\":\").map((value) => parseFloat(value));\n\n            minStretchSize = item.computedInlineSize * content / inline;\n          } else {\n            minStretchSize = stretchItemSize[0];\n          }\n          if (isString(stretchItemSize[1])) {\n            const [inline, content] = stretchItemSize[1].split(\":\").map((value) => parseFloat(value));\n\n            maxStretchSize = item.computedInlineSize * content / inline;\n          } else {\n            maxStretchSize = stretchItemSize[1];\n          }\n\n\n          return {\n            item,\n            index: j,\n            itemIndex,\n            minSize: minStretchSize,\n            originalSize,\n            nextSize: originalSize,\n            maxSize: maxStretchSize,\n          };\n        });\n\n        if (scale > 1) {\n          itemInfos.sort((a, b) => {\n            return a.originalSize - b.originalSize;\n          });\n        } else {\n          itemInfos.sort((a, b) => {\n            return b.originalSize - a.originalSize;\n          });\n        }\n        // minSize, maxSize 제한하여 scale을 적용한다.\n        let sumPrevSize = 0;\n        let sumNextSize = 0;\n        itemInfos.forEach((itemInfo) => {\n          // 이전까지의 합 scale은 점점 목표치(`scale`)에 다가가야 한다.\n          // 그렇지 않는 경우는 max, min에 도달한 경우라고 판단.\n\n          const nextScale = sumNextSize > nextSize ? scale : (nextSize - sumNextSize) / (prevSize - sumPrevSize);\n          const prevItemSize = itemInfo.originalSize;\n          const nextItemSize = throttle(between(prevItemSize * nextScale, itemInfo.minSize, itemInfo.maxSize), 0.01);\n\n          sumPrevSize += prevItemSize;\n          sumNextSize += nextItemSize;\n          itemInfo.nextSize = nextItemSize;\n        });\n        // minSize, maxSize 적용 이후 gap이 남는 경우 전부 강제 scale 한다.\n        if (throttle(sumNextSize - nextSize, 0.01)) {\n          const lastScale = throttle(nextSize / sumNextSize, 0.01);\n\n          itemInfos.forEach((itemInfo) => {\n            itemInfo.nextSize *= lastScale;\n          });\n        }\n        // 다시 index 순서로 정렬해야 포지션을 설정 가능함\n        itemInfos.sort((a, b) => {\n          return a.index - b.index;\n        });\n        itemInfos.forEach((itemInfo, j) => {\n          const item = itemInfo.item;\n          const nextItemSize = itemInfo.nextSize;\n          item.addCSSGridRect({\n            contentPos: isEndDirection ? prevPoint : prevPoint - nextItemSize,\n            contentSize: nextItemSize,\n          });\n\n          if (isEndDirection) {\n            prevPoint = item.cssContentPos! + item.cssContentSize! + contentGap;\n          } else {\n            prevPoint = item.cssContentPos! - contentGap;\n          }\n\n          if (j === length - 1) {\n            let posOffset = 0;\n            let sizeOffset = 0;\n\n            if (isEndDirection) {\n              sizeOffset = (item.cssContentPos! % 1 >= 0.5 ? 1 : 0)\n                + (item.cssContentSize! % 1 >= 0.5 ? 1 : 0)\n                + (scalePoint % 1 >= 0.5 ? -1 : 0);\n            } else {\n              posOffset = (item.cssContentPos! % 1 < 0.5 ? -1 : 0)\n                + (scalePoint % 1 < 0.5 ? 1 : 0);\n            }\n            // Offset position and size need to be adjusted because they are rounded.\n\n\n            item.addCSSGridRect({\n              contentPos: item.cssContentPos! - posOffset,\n              contentSize: item.cssContentSize! - sizeOffset,\n            });\n          }\n        });\n      });\n    }\n    // Finally, check whether startPos and min of the outline match.\n    // If different, endOutline is updated.\n    if (isStartContentAlign && startPos !== Math.min(...endOutline)) {\n      startPos = Math.max(...endOutline);\n      endOutline = endOutline.map(() => startPos);\n    }\n\n    // if end items, startOutline is low, endOutline is high\n    // if start items, startOutline is high, endOutline is low\n    return {\n      start: isEndDirection ? startOutline : endOutline,\n      end: isEndDirection ? endOutline : startOutline,\n    };\n  }\n  public getComputedOutlineSize(items = this.items) {\n    const { align } = this.options;\n    const inlineGap = this.getInlineGap();\n    const containerInlineSize = this.getContainerInlineSize();\n    const columnSizeOption = this.columnSize || this.outlineSize;\n    const columnOption = this.column || this.outlineLength;\n    let column = columnOption || 1;\n\n    let columnSize = 0;\n\n    if (align === \"stretch\") {\n      if (!columnOption) {\n        const maxStretchColumnSize = this.maxStretchColumnSize || Infinity;\n\n        column = Math.max(1, Math.ceil((containerInlineSize + inlineGap) / (maxStretchColumnSize + inlineGap)));\n      }\n      columnSize = (containerInlineSize + inlineGap) / (column || 1) - inlineGap;\n    } else if (columnSizeOption) {\n      columnSize = columnSizeOption;\n    } else if (items.length) {\n      let checkedItem = items[0];\n\n      for (const item of items) {\n        const attributes = item.attributes;\n        const columnAttribute = parseInt(attributes.column || \"1\", 10);\n        const maxColumnAttribute = parseInt(attributes.maxColumn || \"1\", 10);\n\n        if (\n          item.updateState !== UPDATE_STATE.UPDATED\n          || !item.inlineSize\n          || columnAttribute !== 1\n          || maxColumnAttribute !== 1\n        ) {\n          continue;\n        }\n        checkedItem = item;\n        break;\n      }\n      const inlineSize = checkedItem.inlineSize || 0;\n\n      columnSize = inlineSize;\n    } else {\n      columnSize = containerInlineSize;\n    }\n    return columnSize || 0;\n  }\n  public getComputedOutlineLength(items = this.items) {\n    const inlineGap = this.getInlineGap();\n    const columnOption = this.column || this.outlineLength;\n    const columnCalculationThreshold = this.columnCalculationThreshold;\n    let column = 1;\n\n    if (columnOption) {\n      column = columnOption;\n    } else {\n      const columnSize = this.getComputedOutlineSize(items);\n\n      column = Math.max(\n        1,\n        Math.floor(\n          (this.getContainerInlineSize() + inlineGap) /\n          (columnSize - columnCalculationThreshold + inlineGap)\n        )\n      );\n      if (!this.maxStretchColumnSize) {\n        column = Math.min(\n          items.length,\n          column,\n        );\n      }\n    }\n    return column;\n  }\n  private _getAlignPoses(column: number, columnSize: number) {\n    const { align } = this.options;\n    const inlineGap = this.getInlineGap();\n    const containerSize = this.getContainerInlineSize();\n    const indexes = range(column);\n\n    let offset = 0;\n    let dist = 0;\n\n    if (align === \"justify\" || align === \"stretch\") {\n      const countDist = column - 1;\n\n      dist = countDist ? Math.max((containerSize - columnSize) / countDist, columnSize + inlineGap) : 0;\n      offset = Math.min(0, containerSize / 2 - (countDist * dist + columnSize) / 2);\n    } else {\n      dist = columnSize + inlineGap;\n      const totalColumnSize = (column - 1) * dist + columnSize;\n\n      if (align === \"center\") {\n        offset = (containerSize - totalColumnSize) / 2;\n      } else if (align === \"end\") {\n        offset = containerSize - totalColumnSize;\n      }\n    }\n    return indexes.map((i) => {\n      return offset + i * dist;\n    });\n  }\n}\n\nexport interface MasonryGrid extends Properties<typeof MasonryGrid> {\n}\n\n\n/**\n * Align of the position of the items. If you want to use `stretch`, be sure to set `column` or `columnSize` option. (\"start\", \"center\", \"end\", \"justify\", \"stretch\")\n * @ko 아이템들의 위치의 정렬. `stretch`를 사용하고 싶다면 `column` 또는 `columnSize` 옵션을 설정해라.  (\"start\", \"center\", \"end\", \"justify\", \"stretch\")\n * @name Grid.MasonryGrid#align\n * @type {$ts:Grid.MasonryGrid.MasonryGridOptions[\"align\"]}\n * @default \"justify\"\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   align: \"start\",\n * });\n *\n * grid.align = \"justify\";\n * ```\n */\n\n\n/**\n * The number of columns. If the number of columns is 0, it is automatically calculated according to the size of the container.  Can be used instead of outlineLength.\n * @ko 열의 개수. 열의 개수가 0이라면, 컨테이너의 사이즈에 의해 계산이 된다. outlineLength 대신 사용할 수 있다.\n * @name Grid.MasonryGrid#column\n * @type {$ts:Grid.MasonryGrid.MasonryGridOptions[\"column\"]}\n * @default 0\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   column: 0,\n * });\n *\n * grid.column = 4;\n * ```\n */\n\n\n/**\n * The size of the columns. If it is 0, it is calculated as the size of the first item in items. Can be used instead of outlineSize.\n * @ko 열의 사이즈. 만약 열의 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. outlineSize 대신 사용할 수 있다.\n * @name Grid.MasonryGrid#columnSize\n * @type {$ts:Grid.MasonryGrid.MasonryGridOptions[\"columnSize\"]}\n * @default 0\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   columnSize: 0,\n * });\n *\n * grid.columnSize = 200;\n * ```\n */\n\n\n/**\n * The size ratio(inlineSize / contentSize) of the columns. 0 is not set.\n * @ko 열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다.\n * @name Grid.MasonryGrid#columnSizeRatio\n * @type {$ts:Grid.MasonryGrid.MasonryGridOptions[\"columnSizeRatio\"]}\n * @default 0\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   columnSizeRatio: 0,\n * });\n *\n * grid.columnSizeRatio = 0.5;\n * ```\n */\n\n\n/**\n * If stretch is used, the column can be automatically calculated by setting the maximum size of the column that can be stretched.\n * @ko stretch를 사용한 경우 최대로 늘릴 수 있는 column의 사이즈를 설정하여 column을 자동 계산할 수 있다.\n * @name Grid.MasonryGrid#maxStretchColumnSize\n * @type {$ts:Grid.MasonryGrid.MasonryGridOptions[\"maxStretchColumnSize\"]}\n * @default Infinity\n * @example\n * ```js\n * import { MasonryGrid } from \"@egjs/grid\";\n *\n * const grid = new MasonryGrid(container, {\n *   align: \"stretch\",\n *   maxStretchColumnSize: 0,\n * });\n *\n * grid.maxStretchColumnSize = 400;\n * ```\n */\n","/* eslint-disable */\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n *   Wyatt Baldwin <self@wyattbaldwin.com>\n *   All rights reserved\n *\n * Licensed under the MIT license.\n *\n *   http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nfunction single_source_shortest_paths(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\t// Predecessor map for each node that has been encountered.\n\t// node ID => predecessor node ID\n\tconst predecessors: { [key: string]: string } = {};\n\t// Costs of shortest paths from s to all nodes encountered.\n\t// node ID => cost\n\tconst costs: { [key: string]: number } = {};\n\tcosts[s] = 0;\n\n\t// Costs of shortest paths from s to all nodes encountered; differs from\n\t// `costs` in that it provides easy access to the node that currently has\n\t// the known shortest path from s.\n\t// XXX: Do we actually need both `costs` and `open`?\n\tconst open = new BinaryHeap<{ value: string, cost: number }>(x => x.cost);\n\topen.push({ value: s, cost: 0 });\n\n\tlet closest;\n\tlet u;\n\tlet cost_of_s_to_u;\n\tlet adjacent_nodes;\n\tlet cost_of_e;\n\tlet cost_of_s_to_u_plus_cost_of_e;\n\tlet cost_of_s_to_v;\n\tlet first_visit: boolean;\n\n\twhile (open.size()) {\n\t\t// In the nodes remaining in graph that have a known cost from s,\n\t\t// find the node, u, that currently has the shortest path from s.\n\t\tclosest = open.pop();\n\t\tu = closest.value;\n\t\tcost_of_s_to_u = closest.cost;\n\n\t\t// Get nodes adjacent to u...\n\t\tadjacent_nodes = graph(u) || {};\n\n\t\t// ...and explore the edges that connect u to those nodes, updating\n\t\t// the cost of the shortest paths to any or all of those nodes as\n\t\t// necessary. v is the node across the current edge from u.\n\t\tfor (const v in adjacent_nodes) {\n\t\t\t// Get the cost of the edge running from u to v.\n\t\t\tcost_of_e = adjacent_nodes[v];\n\n\t\t\t// Cost of s to u plus the cost of u to v across e--this is *a*\n\t\t\t// cost from s to v that may or may not be less than the current\n\t\t\t// known cost to v.\n\t\t\tcost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n\t\t\t// If we haven't visited v yet OR if the current known cost from s to\n\t\t\t// v is greater than the new cost we just found (cost of s to u plus\n\t\t\t// cost of u to v across e), update v's cost in the cost list and\n\t\t\t// update v's predecessor in the predecessor list (it's now u).\n\t\t\tcost_of_s_to_v = costs[v];\n\t\t\tfirst_visit = (typeof costs[v] === \"undefined\");\n\t\t\tif (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n\t\t\t\tcosts[v] = cost_of_s_to_u_plus_cost_of_e;\n\t\t\t\topen.push({ value: v, cost: cost_of_s_to_u_plus_cost_of_e });\n\t\t\t\tpredecessors[v] = u;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (typeof costs[d] === \"undefined\") {\n\t\tconst msg = [\"Could not find a path from \", s, \" to \", d, \".\"].join(\"\");\n\t\tthrow new Error(msg);\n\t}\n\n\treturn predecessors;\n}\nfunction extract_shortest_path_from_predecessor_list(\n\tpredecessors: { [key: string]: string },\n\td: string,\n) {\n\tconst nodes: string[] = [];\n\tlet u = d;\n\n\twhile (u) {\n\t\tnodes.push(u);\n\t\tu = predecessors[u];\n\t}\n\tnodes.reverse();\n\treturn nodes;\n}\nfunction find_path(\n\tgraph: (x: string) => ({ [key: string]: number }),\n\ts: string,\n\td: string,\n) {\n\tconst predecessors = single_source_shortest_paths(graph, s, d);\n\n\treturn extract_shortest_path_from_predecessor_list(predecessors, d);\n}\n\nclass BinaryHeap<T> {\n\tprivate content: T[];\n\tprivate scoreFunction: (x: T) => number;\n\n\tconstructor(scoreFunction: (x: T) => number) {\n\t\tthis.content = [];\n\t\tthis.scoreFunction = scoreFunction;\n\t}\n\tpublic push(element: T) {\n\t\t// Add the new element to the end of the array.\n\t\tthis.content.push(element);\n\t\t// Allow it to bubble up.\n\t\tthis.bubbleUp(this.content.length - 1);\n\t}\n\tpublic pop() {\n\t\t// Store the first element so we can return it later.\n\t\tconst result = this.content[0];\n\t\t// Get the element at the end of the array.\n\t\tconst end = this.content.pop()!;\n\t\t// If there are any elements left, put the end element at the\n\t\t// start, and let it sink down.\n\t\tif (this.content.length > 0) {\n\t\t\tthis.content[0] = end;\n\t\t\tthis.sinkDown(0);\n\t\t}\n\t\treturn result;\n\t}\n\tpublic size() {\n\t\treturn this.content.length;\n\t}\n\tpublic bubbleUp(_n: number) {\n\t\tlet n = _n;\n\t\t// Fetch the element that has to be moved.\n\t\tconst element = this.content[n];\n\t\t// When at 0, an element can not go up any further.\n\t\twhile (n > 0) {\n\t\t\t// Compute the parent element's index, and fetch it.\n\t\t\tconst parentN = Math.floor((n + 1) / 2) - 1;\n\t\t\tconst parent = this.content[parentN];\n\n\t\t\t// Swap the elements if the parent is greater.\n\t\t\tif (this.scoreFunction(element) < this.scoreFunction(parent)) {\n\t\t\t\tthis.content[parentN] = element;\n\t\t\t\tthis.content[n] = parent;\n\t\t\t\t// Update 'n' to continue at the new position.\n\t\t\t\tn = parentN;\n\t\t\t} else {\n\t\t\t\t// Found a parent that is less, no need to move it further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tpublic sinkDown(n: number) {\n\t\t// Look up the target element and its score.\n\t\tconst length = this.content.length;\n\t\tconst element = this.content[n];\n\t\tconst elemScore = this.scoreFunction(element);\n\t\tlet child1Score;\n\n\t\twhile (true) {\n\t\t\t// Compute the indices of the child elements.\n\t\t\tconst child2N = (n + 1) * 2;\n\t\t\tconst child1N = child2N - 1;\n\t\t\t// This is used to store the new position of the element,\n\t\t\t// if any.\n\t\t\tlet swap: number | null = null;\n\t\t\t// If the first child exists (is inside the array)...\n\t\t\tif (child1N < length) {\n\t\t\t\t// Look it up and compute its score.\n\t\t\t\tconst child1 = this.content[child1N];\n\t\t\t\tchild1Score = this.scoreFunction(child1);\n\t\t\t\t// If the score is less than our element's, we need to swap.\n\t\t\t\tif (child1Score < elemScore) {\n\t\t\t\t\tswap = child1N;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Do the same checks for the other child.\n\t\t\tif (child2N < length) {\n\t\t\t\tconst child2 = this.content[child2N];\n\t\t\t\tconst child2Score = this.scoreFunction(child2);\n\n\t\t\t\tif (child2Score < (swap == null ? elemScore : child1Score)) {\n\t\t\t\t\tswap = child2N;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the element needs to be moved, swap it, and continue.\n\t\t\tif (swap !== null) {\n\t\t\t\tthis.content[n] = this.content[swap];\n\t\t\t\tthis.content[swap] = element;\n\t\t\t\tn = swap;\n\t\t\t} else {\n\t\t\t\t// Otherwise, we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport { find_path };\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport Grid from \"../Grid\";\nimport { MOUNT_STATE, PROPERTY_TYPE } from \"../consts\";\nimport { GridOptions, GridOutlines, Properties } from \"../types\";\nimport { between, getRangeCost, GetterSetter, isFunction, isNumber, isObject, sum, throttle } from \"../utils\";\nimport { find_path } from \"./lib/dijkstra\";\nimport { GridItem } from \"../GridItem\";\n\n\ninterface Link {\n  path: number[];\n  cost: number;\n  length: number;\n  currentNode: number;\n  isOver?: boolean;\n}\n\nfunction splitItems(items: GridItem[], path: string[]) {\n  const length = path.length;\n  const groups: GridItem[][] = [];\n\n  for (let i = 0; i < length - 1; ++i) {\n    const path1 = parseInt(path[i], 10);\n    const path2 = parseInt(path[i + 1], 10);\n\n    groups.push(items.slice(path1, path2));\n  }\n  return groups;\n}\n\nfunction parseStretchSize(inlineSize: number, size: number | string) {\n  if (isNumber(size)) {\n    return size;\n  }\n  const signText = size.charAt(0);\n  const sign = signText === \"+\" ? 1 : (signText === \"-\" ? -1 : 0);\n  let nextSize = parseFloat(size);\n\n  if (size.match(/%$/g)) {\n    nextSize *= inlineSize / 100;\n  }\n  if (sign) {\n    return inlineSize + nextSize;\n  }\n  return nextSize;\n}\n\nfunction getExpectedItemInlineSize(item: GridItem, rowSize: number) {\n  const inlineSize = item.orgInlineSize;\n  const contentSize = item.orgContentSize;\n  const inlineOffset = item.gridData.inlineOffset || 0;\n  const contentOffset = item.gridData.contentOffset || 0;\n\n  if (!inlineSize || !contentSize) {\n    return rowSize;\n  }\n\n  const ratio = contentSize <= contentOffset ? 1 : (inlineSize - inlineOffset) / (contentSize - contentOffset);\n\n  return ratio * (rowSize - contentOffset) + inlineOffset;\n}\n\n/**\n * @typedef\n * @memberof Grid.JustifiedGrid\n * @extends Grid.GridOptions\n */\nexport interface JustifiedGridOptions extends GridOptions {\n  /**\n   * The minimum and maximum number of items per line.\n   * <ko> 한 줄에 들어가는 아이템의 최소, 최대 개수.</ko>\n   * @default [1, 8]\n   */\n  columnRange?: number | number[] | ((self: JustifiedGrid) => number | number[]);\n  /**\n   * The minimum and maximum number of rows in a group, 0 is not set.\n   * <ko> 한 그룹에 들어가는 행의 최소, 최대 개수, 0은 미설정이다.</ko>\n   * @default 0\n   */\n  rowRange?: number | number[];\n  /**\n   * The minimum and maximum size by which the item is adjusted. If it is not calculated, it may deviate from the minimum and maximum sizes.\n   * <ko>아이템이 조정되는 최소, 최대 사이즈. 계산이 되지 않는 경우 최소, 최대 사이즈를 벗어날 수 있다.</ko>\n   * @default [0, Infinity]\n   */\n  sizeRange?: number | number[];\n  /**\n   * Maximum number of rows to be counted for container size. You can hide it on the screen by setting overflow: hidden. -1 is not set.\n   * <ko>컨테이너 크기에 계산될 최대 row 개수. overflow: hidden을 설정하면 화면에 가릴 수 있다. -1은 미설정이다.</ko>\n   * @default -1\n   */\n  displayedRow?: number;\n  /**\n   * Whether to crop when the row size is out of sizeRange. If set to true, this ratio can be broken.\n   * <ko>row사이즈가 sizeRange에 벗어나면 크롭할지 여부. true로 설정하면 비율이 깨질 수 있다.</ko>\n   * @default false\n   */\n  isCroppedSize?: boolean;\n  /**\n   * The ratio is maintained except for the offset value in the inline direction. If 'data-grid-inline-offset' is set in the element of each item, it will be applied first.\n   * <ko>inline 방향의 offset 수치 만큼 제외하고 비율을 유지한다. 각 아이템의 element에 'data-grid-inline-offset' 을 설정하면 우선 적용한다.</ko>\n   * @default 0\n   */\n  inlineOffset?: number;\n  /**\n   * The ratio is maintained except for the offset value in the content direction. If 'data-grid-content-offset' is set in the element or JSX of each item, it will be applied first.\n   * <ko>content 방향의 offset 수치 만큼 제외하고 비율을 유지한다. 각 아이템의 Element 또는 JSX에 'data-grid-content-offset' 을 설정하면 우선 적용한다.</ko>\n   * @default 0\n   */\n  contentOffset?: number;\n  /**\n   * it is possible to basically break the proportion of the item and stretch the inline size to fill the container.\n   * If you set the `sizeRange` range narrowly, you can stretch well.\n   * <ko>기본적으로 아이템의 비율을 깨서 inline size를 stretch하여 container를 꽉 채우게 가능하다. sizeRange의 범위를 좁게 설정하면 stretch가 잘 될 수 있다. </ko>\n   * @default false\n   */\n  stretch?: boolean;\n  /**\n   * If `-`, `+`, or `%` are added as a string value, it is a relative value to the original size. If it is a number value, the stretch range can be set as an absolute value.\n   * If `data-grid-min-stretch` and `data-grid-max-stretch` are set in the Element or JSX of each item, they will be applied first.\n   * <ko>string 값으로 `-`, `+`, `%`이 붙으면 원본 크기에 대한 상대값이며 number 값으로 들어오면 절대 값으로 stretch 범위를 설정할 수 있습니다.\n   * 각 아이템의 Element 또는 JSX에 `data-grid-min-stretch`, `data-grid-max-stretch`을 설정하면 우선 적용한다.</ko>\n   * @\n   * @default [\"-10%\", \"+10%\"]\n   */\n  stretchRange?: Array<string | number>;\n  /**\n   * Items placed in the last row are not stretched and are drawn maintaining their proportions. When using InfiniteGrid, it is calculated and re-rendered as follows:\n   * <ko>마지막 row에 배치되는 아이템들 경우 stretch되지 않고 비율유지한채로 그려진다. InfiniteGrid를 사용하는 경우 다음 그룹과 같이 계산되어 재렌더링한다.</ko>\n   */\n  passUnstretchRow?: boolean;\n}\n\n/**\n * 'justified' is a printing term with the meaning that 'it fits in one row wide'. JustifiedGrid 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행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. JustifiedGrid는 용어의 의미대로 너비가 주어진 사이즈를 기준으로 아이템가 가득 차도록 배치하는 Grid다.\n * 아이템 엘리먼트에 'data-grid-inline-offset' 또는 'data-grid-content-offset'를 설정하면 offset 값을 제외하고 비율을 유지한다.\n * 비율을 유지하고 싶은 엘리먼트에 'data-grid-maintained-target'을 설정한다면 해당 엘리먼트의 비율을 유지하면서 아이템이 렌더링이 된다.\n * @memberof Grid\n * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param {Grid.JustifiedGrid.JustifiedGridOptions} options - The option object of the JustifiedGrid module <ko>JustifiedGrid 모듈의 옵션 객체</ko>\n */\n@GetterSetter\nexport class JustifiedGrid extends Grid<JustifiedGridOptions> {\n  public static propertyTypes = {\n    ...Grid.propertyTypes,\n    columnRange: PROPERTY_TYPE.RENDER_PROPERTY,\n    rowRange: PROPERTY_TYPE.RENDER_PROPERTY,\n    sizeRange: PROPERTY_TYPE.RENDER_PROPERTY,\n    isCroppedSize: PROPERTY_TYPE.RENDER_PROPERTY,\n    displayedRow: PROPERTY_TYPE.RENDER_PROPERTY,\n    stretch: PROPERTY_TYPE.RENDER_PROPERTY,\n    stretchRange: PROPERTY_TYPE.RENDER_PROPERTY,\n    passUnstretchRow: PROPERTY_TYPE.RENDER_PROPERTY,\n    inlineMargin: PROPERTY_TYPE.RENDER_PROPERTY,\n    contentMargin: PROPERTY_TYPE.RENDER_PROPERTY,\n    inlineOffset: PROPERTY_TYPE.RENDER_PROPERTY,\n    contentOffset: PROPERTY_TYPE.RENDER_PROPERTY,\n  };\n  public static defaultOptions: Required<JustifiedGridOptions> = {\n    ...Grid.defaultOptions,\n    columnRange: [1, 8],\n    rowRange: 0,\n    sizeRange: [0, Infinity],\n    displayedRow: -1,\n    isCroppedSize: false,\n    stretch: false,\n    passUnstretchRow: true,\n    stretchRange: [\"-20%\", \"+20%\"],\n    inlineOffset: 0,\n    contentOffset: 0,\n  };\n  public applyGrid(items: GridItem[], direction: \"start\" | \"end\", outline: number[]): GridOutlines {\n    const {\n      attributePrefix,\n      horizontal,\n    } = this.options;\n\n    items.forEach((item) => {\n      if (!item.isUpdating) {\n        return;\n      }\n      const element = item.element;\n      const attributes = item.attributes;\n      const gridData = item.gridData;\n      let inlineOffset = parseFloat(attributes.inlineOffset);\n      let contentOffset = parseFloat(attributes.contentOffset);\n      // let contentMargin = parseFloat(attributes.contentMargin);\n\n      if (isNaN(inlineOffset)) {\n        inlineOffset = this.inlineOffset || gridData.inlineOffset || 0;\n      }\n      if (isNaN(contentOffset)) {\n        contentOffset = this.contentOffset || gridData.contentOffset | 0;\n      }\n      // if (isNaN(contentMargin)) {\n      //   contentMargin = this.contentMargin || gridData.contentMargin | 0;\n      // }\n\n      if (\n        element && !(\"inlineOffset\" in attributes) && !(\"contentOffset\" in attributes)\n        && item.mountState === MOUNT_STATE.MOUNTED\n      ) {\n        const maintainedTarget = element.querySelector<HTMLImageElement>(`[${attributePrefix}maintained-target]`);\n\n        if (maintainedTarget) {\n          const widthOffset = element.offsetWidth - element.clientWidth\n            + element.scrollWidth - maintainedTarget.clientWidth;\n          const heightOffset = element.offsetHeight - element.clientHeight\n            + element.scrollHeight - maintainedTarget.clientHeight;\n\n          if (horizontal) {\n            inlineOffset = heightOffset;\n            contentOffset = widthOffset;\n          } else {\n            inlineOffset = widthOffset;\n            contentOffset = heightOffset;\n          }\n        }\n      }\n      gridData.inlineOffset = inlineOffset;\n      gridData.contentOffset = contentOffset;\n      // gridData.contentMargin = contentMargin;\n    });\n    const rowRange = this.options.rowRange;\n    let path: string[] = [];\n\n    const isEndDirection = direction === \"end\";\n\n    if (items.length) {\n      path = rowRange ? this._getRowPath(items, isEndDirection) : this._getPath(items, isEndDirection);\n    }\n\n    return this._setStyle(items, path, outline, direction === \"end\");\n  }\n  private _getRowPath(items: GridItem[], isEndDirection: boolean) {\n    const columnRange = this._getColumnRange();\n    const rowRange = this._getRowRange();\n\n    const pathLink = this._getRowLink(items, {\n      path: [0],\n      cost: 0,\n      length: 0,\n      currentNode: 0,\n    }, columnRange, rowRange, isEndDirection);\n\n    return pathLink?.path.map((node) => `${node}`) ?? [];\n  }\n  private _getRowLink(\n    items: GridItem[],\n    currentLink: Link,\n    columnRange: number[],\n    rowRange: number[],\n    isEndDirection: boolean,\n  ): Link {\n    const [minColumn] = columnRange;\n    const [minRow, maxRow] = rowRange;\n    const lastNode = items.length;\n    const {\n      path,\n      length: pathLength,\n      cost,\n      currentNode,\n    } = currentLink;\n\n    // not reached lastNode but path is exceed or the number of remaining nodes is less than minColumn.\n    if (currentNode < lastNode && (maxRow <= pathLength || currentNode + minColumn > lastNode)) {\n      const rangeCost = getRangeCost(lastNode - currentNode, columnRange);\n      const lastCost = rangeCost * Math.abs(this._getCost(items, currentNode, lastNode, isEndDirection));\n\n      return {\n        ...currentLink,\n        length: pathLength + 1,\n        path: [...path, lastNode],\n        currentNode: lastNode,\n        cost: cost + lastCost,\n        isOver: true,\n      };\n    } else if (currentNode >= lastNode) {\n      return {\n        ...currentLink,\n        currentNode: lastNode,\n        isOver: minRow > pathLength || maxRow < pathLength,\n      };\n    } else {\n      return this._searchRowLink(items, currentLink, lastNode, columnRange, rowRange, isEndDirection);\n    }\n\n  }\n  private _searchRowLink(\n    items: GridItem[],\n    currentLink: Link,\n    lastNode: number,\n    columnRange: number[],\n    rowRange: number[],\n    isEndDirection: boolean,\n  ) {\n    const [minColumn, maxColumn] = columnRange;\n    const {\n      currentNode,\n      path,\n      length: pathLength,\n      cost,\n    } = currentLink;\n    const length = Math.min(lastNode, currentNode + maxColumn);\n    const links: Link[] = [];\n\n    for (let nextNode = currentNode + minColumn; nextNode <= length; ++nextNode) {\n      if (nextNode === currentNode) {\n        continue;\n      }\n      const nextCost = Math.abs(this._getCost(items, currentNode, nextNode, isEndDirection));\n      const nextLink = this._getRowLink(items, {\n        path: [...path, nextNode],\n        length: pathLength + 1,\n        cost: cost + nextCost,\n        currentNode: nextNode,\n      }, columnRange, rowRange, isEndDirection);\n\n      if (nextLink) {\n        links.push(nextLink);\n      }\n    }\n    links.sort((a, b) => {\n      const aIsOver = a.isOver;\n      const bIsOver = b.isOver;\n\n      if (aIsOver !== bIsOver) {\n        // If it is over, the cost is high.\n        return aIsOver ? 1 : -1;\n      }\n      const aRangeCost = getRangeCost(a.length, rowRange);\n      const bRangeCost = getRangeCost(b.length, rowRange);\n\n      return aRangeCost - bRangeCost || a.cost - b.cost;\n    });\n\n    // It returns the lowest cost link.\n    return links[0];\n  }\n  private _getExpectedRowSize(items: GridItem[], forceStretch?: boolean) {\n    const containerInlineSize = this.getContainerInlineSize()! - this.getInlineGap() * (items.length - 1);\n    let fixedContainerInsize = containerInlineSize;\n    let ratioSum = 0;\n    let inlineSum = 0;\n\n    items.forEach((item) => {\n      const inlineSize = item.orgInlineSize;\n      const contentSize = item.orgContentSize;\n\n      if (!inlineSize || !contentSize) {\n        ratioSum += 1;\n        return;\n      }\n      // sum((expect - offset) * ratio) = container inline size\n      const inlineOffset = item.gridData.inlineOffset || 0;\n      const contentOffset = item.gridData.contentOffset || 0;\n      // const contentMargin = item.gridData.contentMargin || 0;\n\n      const maintainedRatio = contentSize <= contentOffset ? 1\n        : (inlineSize - inlineOffset) / (contentSize - contentOffset);\n\n      ratioSum += maintainedRatio;\n      // inlineSum += (contentOffset + contentMargin) * maintainedRatio;\n      inlineSum += contentOffset * maintainedRatio;\n      fixedContainerInsize -= inlineOffset;\n    });\n\n    if (ratioSum) {\n      const nextRowSize = (fixedContainerInsize + inlineSum) / ratioSum;\n\n      if (this.stretch) {\n        const [minRowSize, maxRowSize] = this._getSizeRange();\n\n        const stretchRowSize = between(nextRowSize, minRowSize, maxRowSize);\n\n\n        if (forceStretch) {\n          return stretchRowSize;\n        }\n        const stretchRange = this.stretchRange;\n        const inlineSizes = items.map((item) => {\n          return getExpectedItemInlineSize(item, stretchRowSize);\n        });\n        const minInlineSize = inlineSizes.reduce((prev, itemInlineSize, i) => {\n          return prev + parseStretchSize(itemInlineSize, items[i].attributes.minStretch || stretchRange[0]);\n        }, 0);\n        const maxInlineSize = inlineSizes.reduce((prev, itemInlineSize, i) => {\n          return prev + parseStretchSize(itemInlineSize, items[i].attributes.maxStretch || stretchRange[1]);\n        }, 0);\n\n        // for stretch\n        if (minInlineSize <= containerInlineSize && containerInlineSize <= maxInlineSize) {\n          return stretchRowSize;\n        }\n      }\n\n      return nextRowSize;\n    }\n    return 0;\n  }\n\n  private _getExpectedInlineSizes(items: GridItem[], rowSize: number) {\n    const {\n      stretch,\n      stretchRange,\n    } = this.options;\n    return items.map((item) => {\n      const minInlineSize = stretch\n        ? parseStretchSize(item.orgInlineSize, item.attributes.minStretch || stretchRange[0])\n        : -Infinity;\n      const maxInlineSize = stretch\n        ? parseStretchSize(item.orgInlineSize, item.attributes.maxStretch || stretchRange[1])\n        : Infinity;\n\n      const itemInlineSize = getExpectedItemInlineSize(item, rowSize);\n      let isMax = false;\n      let isMin = false;\n      if (itemInlineSize >= maxInlineSize) {\n        isMax = true;\n      } else if (itemInlineSize <= minInlineSize) {\n        isMin = true;\n      }\n\n      return {\n        minSize: minInlineSize,\n        maxSize: maxInlineSize,\n        size: between(itemInlineSize, minInlineSize, maxInlineSize),\n        originalSize: itemInlineSize,\n        isMax,\n        isMin,\n      };\n    });\n  }\n  private _getStretchItemInfos(items: GridItem[], rowSize: number) {\n    const itemsLength = items.length;\n    const containerInlineSize = this.getContainerInlineSize() - this.getInlineGap() * (Math.max(1, itemsLength) - 1);\n    const itemInfos = this._getExpectedInlineSizes(items, rowSize);\n    const firstItemsSize = sum(itemInfos.map((info) => info.size));\n    const distSize = containerInlineSize - firstItemsSize;\n    const firstScale = containerInlineSize / sum(itemInfos.map((info) => info.originalSize));\n    const costInfos = itemInfos.map((info) => {\n      return {\n        ...info,\n        passed: false,\n        size: info.originalSize * firstScale,\n      };\n    });\n\n    if (distSize === 0) {\n      return {\n        infos: costInfos,\n        cost: 0,\n      };\n    }\n    // increase\n    const isIncrease = distSize > 0;\n    const costInfosLength = costInfos.length;\n\n    for (let i = 0; i < costInfosLength; ++i) {\n      const passedItemsSize = sum(costInfos.map((info) => info.passed ? info.size : 0));\n      const restItemsSize = sum(costInfos.map((info) => info.passed ? 0 : info.originalSize));\n      let distScale = (containerInlineSize - passedItemsSize) / restItemsSize;\n      // minimize or maximize\n      costInfos.forEach((info) => {\n        if (info.passed) {\n          return;\n        }\n\n        if (isIncrease) {\n          if (info.size > info.maxSize) {\n            distScale = Math.min(distScale, info.maxSize / info.originalSize);\n          }\n        } else {\n          if (info.size < info.minSize) {\n            distScale = Math.max(distScale, info.minSize / info.originalSize);\n          }\n        }\n      });\n\n      costInfos.forEach((info) => {\n        if (!info.passed) {\n          info.size = between(info.originalSize * distScale, info.minSize, info.maxSize);\n\n          if (\n            (isIncrease && !throttle(info.size - info.maxSize, 0.001))\n            || (!isIncrease && !throttle(info.size - info.minSize, 0.001))\n          ) {\n            info.passed = true;\n          }\n        }\n      });\n\n      if (costInfos.every((info) => info.passed)) {\n        break;\n      }\n    }\n    const lastDistScale = containerInlineSize / sum(costInfos.map((info) => info.size));\n\n    // last\n    if (throttle(lastDistScale - 1, 0.001)) {\n      costInfos.forEach((info) => {\n        info.size *= lastDistScale;\n      });\n    }\n\n\n    return {\n      infos: costInfos,\n      cost: sum(costInfos.map((info) => {\n        let cost = Math.abs(info.originalSize - info.size) / 2;\n        let costRatio = 1;\n\n        if (info.size > info.maxSize) {\n          costRatio = 2;\n          if (info.isMin) {\n            cost += Math.abs(info.size - info.minSize);\n          } else {\n            cost += Math.abs(info.size - info.maxSize);\n          }\n        } else if (info.size < info.minSize) {\n          costRatio = 2;\n\n          if (info.isMax) {\n            cost += Math.abs(info.size - info.maxSize);\n          } else {\n            cost += Math.abs(info.size - info.minSize);\n          }\n        } else if (info.isMax) {\n          cost += Math.abs(info.maxSize - info.size);\n        } else if (info.isMin) {\n          cost += Math.abs(info.minSize - info.size);\n        }\n        return cost * costRatio;\n      })),\n    };\n  }\n  private _getExpectedInlineSize(items: GridItem[], rowSize: number) {\n    const inlineGap = this.getInlineGap();\n    const itemInfos = this._getExpectedInlineSizes(items, rowSize);\n\n    return itemInfos.length ? sum(itemInfos.map((info) => info.size)) + inlineGap * (items.length - 1) : 0;\n  }\n  private _getCost(\n    items: GridItem[],\n    i: number,\n    j: number,\n    isEndDirection: boolean,\n  ) {\n    const lineItems = items.slice(i, j);\n    const containerInlineSize = this.getContainerInlineSize();\n    let rowSize = this._getExpectedRowSize(lineItems);\n    const [minSize, maxSize] = this._getSizeRange();\n\n    if (this.isCroppedSize) {\n      if (minSize <= rowSize && rowSize <= maxSize) {\n        return 0;\n      }\n      const expectedInlineSize = this._getExpectedInlineSize(\n        lineItems,\n        rowSize < minSize ? minSize : maxSize,\n      );\n\n      return Math.pow(expectedInlineSize - containerInlineSize, 2);\n    }\n    let extraCost = 0;\n\n    if (this.stretch) {\n      if (rowSize < minSize) {\n        rowSize = minSize;\n      } else if (rowSize > maxSize) {\n        rowSize = maxSize;\n      }\n      const sizeCost = Math.abs(rowSize - minSize);\n\n      const expectedInlineSize = this._getExpectedInlineSize(\n        lineItems,\n        rowSize,\n      );\n\n      if (\n        !this.passUnstretchRow\n        || (isEndDirection ? j !== items.length : i !== 0)\n        || expectedInlineSize >= containerInlineSize\n      ) {\n        const res = this._getStretchItemInfos(lineItems, rowSize);\n\n        extraCost = res.cost;\n      }\n\n      return extraCost + sizeCost;\n    }\n\n    if (isFinite(maxSize)) {\n      // if this size is not in range, the cost increases sharply.\n      if (rowSize < minSize) {\n        return Math.pow(rowSize - minSize, 2) + Math.pow(maxSize, 2) + extraCost;\n      } else if (rowSize > maxSize) {\n        return Math.pow(rowSize - maxSize, 2) + Math.pow(maxSize, 2) + extraCost;\n      }\n    } else if (rowSize < minSize) {\n      return Math.max(Math.pow(minSize, 2), Math.pow(rowSize, 2)) + Math.pow(maxSize, 2) + extraCost;\n    }\n    // if this size in range, the cost is row\n    return rowSize - minSize + extraCost;\n  }\n  private _getPath(items: GridItem[], isEndDirection: boolean) {\n    const lastNode = items.length;\n    const [minColumn, maxColumn]: number[] = this._getColumnRange();\n    const graphMap: Record<string, Record<string, number>> = {};\n\n    const graph = (nodeKey: string) => {\n      // use cache\n      if (nodeKey in graphMap) {\n        return graphMap[nodeKey];\n      }\n      graphMap[nodeKey] = {};\n\n      const results: { [key: string]: number } = {};\n      const currentNode = parseInt(nodeKey, 10);\n\n      for (let nextNode = Math.min(currentNode + minColumn, lastNode); nextNode <= lastNode; ++nextNode) {\n        if (nextNode - currentNode > maxColumn) {\n          break;\n        }\n        let cost = this._getCost(\n          items,\n          currentNode,\n          nextNode,\n          isEndDirection,\n        );\n\n        if (cost < 0 && nextNode === lastNode) {\n          cost = 0;\n        }\n        results[`${nextNode}`] = Math.pow(cost, 2);\n      }\n      // caching\n      graphMap[nodeKey] = results;\n      return results;\n    };\n    // shortest path for items' total height.\n    return find_path(graph, \"0\", `${lastNode}`);\n  }\n  private _setStyle(\n    items: GridItem[],\n    path: string[],\n    outline: number[] = [],\n    isEndDirection: boolean,\n  ) {\n    const {\n      isCroppedSize,\n      displayedRow,\n      stretch,\n      passUnstretchRow,\n    } = this.options;\n    const itemsLength = items.length;\n    const sizeRange = this._getSizeRange();\n    const startPoint = outline[0] || 0;\n    const containerInlineSize = this.getContainerInlineSize();\n    const inlineGap = this.getInlineGap();\n    const contentGap = this.getContentGap();\n    const groups = splitItems(items, path);\n    let passedItems!: number[];\n    const groupsLength = groups.length;\n    let contentPos = startPoint;\n    let displayedSize = 0;\n    let passedPoint!: number[];\n\n    groups.forEach((groupItems, rowIndex) => {\n      const groupItemslength = groupItems.length;\n      let rowSize = this._getExpectedRowSize(groupItems, true);\n\n      if (isCroppedSize) {\n        rowSize = Math.max(sizeRange[0], Math.min(rowSize, sizeRange[1]));\n      }\n      const allGap = inlineGap * (groupItemslength - 1);\n      const itemInfos = groupItems.map((item, index) => {\n        const itemInlineSize = getExpectedItemInlineSize(item, rowSize);\n\n        return {\n          index,\n          item,\n          inlineSize: itemInlineSize,\n          orgInlineSize: itemInlineSize,\n          maxInlineSize: itemInlineSize,\n          minInlineSize: itemInlineSize,\n        };\n      });\n\n      const expectedInlineSize = this._getExpectedInlineSize(groupItems, rowSize);\n      const scale = (containerInlineSize - allGap) / (expectedInlineSize - allGap);\n      const noGapExpectedContainerInlineSize = expectedInlineSize - allGap;\n      const noGapContainerInlineSize = containerInlineSize - allGap;\n\n      if (stretch && expectedInlineSize) {\n        // passed and for the last group, if stretchSize is less than containerSize, pass!\n        const passed = passUnstretchRow\n          && noGapExpectedContainerInlineSize < noGapContainerInlineSize\n          && (isEndDirection ? rowIndex === groupsLength - 1 : rowIndex === 0);\n        if (passed || noGapContainerInlineSize === noGapExpectedContainerInlineSize) {\n          if (passed) {\n            passedPoint = [contentPos];\n            passedItems = groupItems.map((_, i) => itemsLength - groupItemslength + i);\n          }\n\n          const inlineSizes = this._getExpectedInlineSizes(groupItems, rowSize);\n\n          itemInfos.forEach((info, i) => {\n            info.minInlineSize = inlineSizes[i].minSize;\n            info.maxInlineSize = inlineSizes[i].maxSize;\n            info.inlineSize = between(info.inlineSize, info.minInlineSize, info.maxInlineSize);\n\n          });\n        } else {\n          const { infos } = this._getStretchItemInfos(groupItems, rowSize);\n\n          itemInfos.forEach((info, i) => {\n            info.inlineSize = infos[i].size;\n            info.minInlineSize = infos[i].minSize;\n            info.maxInlineSize = infos[i].maxSize;\n          });\n        }\n      }\n\n      itemInfos.forEach((info, i) => {\n        const {\n          item,\n          inlineSize,\n        } = info;\n        let nextInlineSize = inlineSize;\n        const prevItem = groupItems[i - 1];\n        const inlinePos = prevItem\n          ? prevItem.cssInlinePos! + prevItem.cssInlineSize! + inlineGap\n          : 0;\n\n        if (isCroppedSize) {\n          nextInlineSize *= scale;\n        }\n\n\n        const gridData = item.gridData;\n\n        gridData.orgInlineSize = info.orgInlineSize;\n        gridData.orgContentSize = rowSize;\n        gridData.minInlineSize = info.minInlineSize;\n        gridData.maxInlineSize = info.maxInlineSize;\n\n        item.setCSSGridRect({\n          inlinePos,\n          contentPos,\n          inlineSize: nextInlineSize,\n          contentSize: rowSize,\n        });\n      });\n      contentPos += contentGap + rowSize;\n      if (displayedRow < 0 || rowIndex < displayedRow) {\n        displayedSize = contentPos;\n      }\n    });\n\n    if (isEndDirection) {\n      // previous group's end outline is current group's start outline\n      return {\n        start: [startPoint],\n        end: [displayedSize],\n        passedItems,\n        passed: passedPoint,\n      };\n    }\n    // always start is lower than end.\n    // contentPos is endPoinnt\n    const height = contentPos - startPoint;\n\n    items.forEach((item) => {\n      item.cssContentPos! -= height;\n    });\n    return {\n      passedItems,\n      passed: passedPoint ? [passedPoint[0] - height] : null,\n      start: [startPoint - height],\n      end: [startPoint], // endPoint - height = startPoint\n    };\n  }\n  public getComputedOutlineLength() {\n    return 1;\n  }\n  public getComputedOutlineSize() {\n    return this.getContainerInlineSize();\n  }\n  private _getRowRange() {\n    const rowRange = this.rowRange;\n    return isObject(rowRange) ? rowRange : [rowRange, rowRange];\n  }\n  private _getColumnRange() {\n    const columnRange = this.columnRange;\n\n    let res: number | number[];\n\n    if (isFunction(columnRange)) {\n      res = columnRange(this);\n    } else {\n      res = columnRange;\n    }\n    return isObject(res) ? res : [res, res];\n  }\n  private _getSizeRange() {\n    const sizeRange = this.sizeRange;\n    return isObject(sizeRange) ? sizeRange : [sizeRange, sizeRange];\n  }\n}\n\nexport interface JustifiedGrid extends Properties<typeof JustifiedGrid> {\n}\n\n\n/**\n * The minimum and maximum number of items per line.\n * @ko 한 줄에 들어가는 아이템의 최소, 최대 개수.\n * @name Grid.JustifiedGrid#columnRange\n * @type {$ts:Grid.JustifiedGrid.JustifiedGridOptions[\"columnRange\"]}\n * @default [1, 8]\n * @example\n * ```js\n * import { JustifiedGrid } from \"@egjs/grid\";\n *\n * const grid = new JustifiedGrid(container, {\n *   columnRange: [1, 8],\n * });\n *\n * grid.columnRange = [3, 6];\n * ```\n */\n\n\n/**\n * The minimum and maximum number of rows in a group, 0 is not set.\n * @ko 한 그룹에 들어가는 행의 최소, 최대 개수, 0은 미설정이다.\n * @name Grid.JustifiedGrid#rowRange\n * @type {$ts:Grid.JustifiedGrid.JustifiedGridOptions[\"rowRange\"]}\n * @default 0\n * @example\n * ```js\n * import { JustifiedGrid } from \"@egjs/grid\";\n *\n * const grid = new JustifiedGrid(container, {\n *   rowRange: 0,\n * });\n *\n * grid.rowRange = [3, 4];\n * ```\n */\n\n/**\n * The minimum and maximum size by which the item is adjusted. If it is not calculated, it may deviate from the minimum and maximum sizes.\n * @ko 아이템이 조정되는 최소, 최대 사이즈. 계산이 되지 않는 경우 최소, 최대 사이즈를 벗어날 수 있다.\n * @name Grid.JustifiedGrid#sizeRange\n * @type {$ts:Grid.JustifiedGrid.JustifiedGridOptions[\"sizeRange\"]}\n * @default [0, Infinity]\n * @example\n * ```js\n * import { JustifiedGrid } from \"@egjs/grid\";\n *\n * const grid = new JustifiedGrid(container, {\n *   sizeRange: [0, Infinity],\n * });\n *\n * grid.sizeRange = [200, 800];\n * ```\n */\n\n/**\n * Maximum number of rows to be counted for container size. You can hide it on the screen by setting overflow: hidden. -1 is not set.\n * @ko - 컨테이너 크기에 계산될 최대 row 개수. overflow: hidden을 설정하면 화면에 가릴 수 있다. -1은 미설정이다.\n * @name Grid.JustifiedGrid#displayedRow\n * @type {$ts:Grid.JustifiedGrid.JustifiedGridOptions[\"displayedRow\"]}\n * @default -1\n * @example\n * ```js\n * import { JustifiedGrid } from \"@egjs/grid\";\n *\n * const grid = new JustifiedGrid(container, {\n *   displayedRow: -1,\n * });\n *\n * grid.displayedRow = 3;\n * ```\n */\n\n/**\n * Whether to crop when the row size is out of sizeRange. If set to true, this ratio can be broken.\n * @ko - row 사이즈가 sizeRange에 벗어나면 크롭할지 여부. true로 설정하면 비율이 깨질 수 있다.\n * @name Grid.JustifiedGrid#isCroppedSize\n * @type {$ts:Grid.JustifiedGrid.JustifiedGridOptions[\"isCroppedSize\"]}\n * @default false\n * @example\n * ```js\n * import { JustifiedGrid } from \"@egjs/grid\";\n *\n * const grid = new JustifiedGrid(container, {\n *   sizeRange: [200, 250],\n *   isCroppedSize: false,\n * });\n *\n * grid.isCroppedSize = true;\n * ```\n */\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport Grid from \"../Grid\";\nimport { PROPERTY_TYPE } from \"../consts\";\nimport { GridOptions, Properties, GridOutlines, GridRect } from \"../types\";\nimport { GetterSetter, range } from \"../utils\";\nimport { GridItem } from \"../GridItem\";\n\n\nfunction getMaxPoint(outline: number[]) {\n  let maxPoint = -Infinity;\n\n  outline.forEach((point) => {\n    if (isFinite(point)) {\n      maxPoint = Math.max(maxPoint, point);\n    }\n  });\n  return isFinite(maxPoint) ? maxPoint : 0;\n}\nfunction getMinPoint(outline: number[]) {\n  let minPoint = Infinity;\n\n  outline.forEach((point) => {\n    if (isFinite(point)) {\n      minPoint = Math.min(minPoint, point);\n    }\n  });\n  return isFinite(minPoint) ? minPoint : 0;\n}\nfunction getOutlinePoint(startOutline: number[], frameOutline: number[], useFrameFill: boolean) {\n  return getMaxPoint(startOutline)\n    + getOutlineDist(startOutline, frameOutline, useFrameFill);\n}\n\nfunction getOutlineDist(startOutline: number[], endOutline: number[], useFrameFill: boolean) {\n  const length = startOutline.length;\n\n  if (!length) {\n    return 0;\n  }\n  const minEndPoint = getMinPoint(endOutline);\n  const maxStartPoint = getMaxPoint(startOutline);\n  let frameDist = 0;\n\n  if (!useFrameFill) {\n    return 0;\n  }\n\n\n  for (let outlineIndex = 0; outlineIndex < length; ++outlineIndex) {\n    const startPoint = startOutline[outlineIndex];\n    const endPoint = endOutline[outlineIndex];\n\n    if (!isFinite(startPoint) || !isFinite(endPoint)) {\n      continue;\n    }\n    const startPos = startPoint - maxStartPoint;\n    const endPos = endPoint - minEndPoint;\n\n\n    // Fill empty block.\n    frameDist = outlineIndex ? Math.max(frameDist, frameDist + startPos - endPos) : startPos - endPos;\n  }\n\n  return frameDist;\n}\nfunction fillOutlines(startOutline: number[], endOutline: number[], rect: {\n  inlinePos: number;\n  inlineSize: number;\n  contentPos: number;\n  contentSize: number;\n}) {\n  const {\n    inlinePos,\n    inlineSize,\n    contentPos,\n    contentSize,\n  } = rect;\n  for (\n    let outlineIndex = inlinePos;\n    outlineIndex < inlinePos + inlineSize;\n    ++outlineIndex\n  ) {\n    startOutline[outlineIndex] = Math.min(startOutline[outlineIndex], contentPos);\n    endOutline[outlineIndex] = Math.max(endOutline[outlineIndex], contentPos + contentSize);\n  }\n}\nexport interface FrameRect extends Required<GridRect> {\n  type: any;\n}\n/**\n * @typedef\n * @memberof Grid.FrameGrid\n * @extends Grid.GridOptions\n */\nexport interface FrameGridOptions extends GridOptions {\n  /**\n   * The shape of the grid. You can set the shape and order of items with a 2d array ([contentPos][inlinePos]). You can place items as many times as you fill the array with numbers, and zeros and spaces are empty spaces. The order of the items is arranged in ascending order of the numeric values that fill the array.\n   * <ko>Grid의 모양. 2d 배열([contentPos][inlinePos])로 아이템의 모양과 순서를 설정할 수 있다. 숫자로 배열을 채운만큼 아이템을 배치할 수 있으며 0과 공백은 빈 공간이다. 아이템들의 순서는 배열을 채운 숫자값의 오름차순대로 배치가 된다. (default: [])</ko>\n   * @default []\n   */\n  frame?: number[][];\n  /**\n   * Make sure that the frame can be attached after the previous frame.\n   * <ko> 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다.</ko>\n   * @default true\n   */\n  useFrameFill?: boolean;\n  /**\n   * 1x1 rect size. If it is 0, it is determined by the number of columns in the frame.\n   * <ko>1x1 직사각형 크기. 0이면 frame의 column의 개수에 의해 결정된다.</ko>\n   * @default 0\n   */\n  rectSize?: number | { inlineSize: number, contentSize: number };\n}\n\n/**\n * 'Frame' is a printing term with the meaning that 'it fits in one row wide'. FrameGrid is a grid that the item is filled up on the basis of a line given a size.\n * @ko 'Frame'는 '1행의 너비에 맞게 꼭 들어찬'이라는 의미를 가진 인쇄 용어다. FrameGrid는 용어의 의미대로 너비가 주어진 사이즈를 기준으로 아이템이 가득 차도록 배치하는 Grid다.\n * @memberof Grid\n * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param {Grid.FrameGrid.FrameGridOptions} options - The option object of the FrameGrid module <ko>FrameGrid 모듈의 옵션 객체</ko>\n */\n@GetterSetter\nexport class FrameGrid extends Grid<FrameGridOptions> {\n  public static propertyTypes = {\n    ...Grid.propertyTypes,\n    frame: PROPERTY_TYPE.RENDER_PROPERTY,\n    useFrameFill: PROPERTY_TYPE.RENDER_PROPERTY,\n    rectSize: PROPERTY_TYPE.RENDER_PROPERTY,\n  };\n  public static defaultOptions: Required<FrameGridOptions> = {\n    ...Grid.defaultOptions,\n    frame: [],\n    rectSize: 0,\n    useFrameFill: true,\n  };\n\n  public applyGrid(items: GridItem[], direction: \"start\" | \"end\", outline: number[]): GridOutlines {\n    const frame = this._getFrame();\n    const {\n      inlineSize: frameInlineSize,\n      contentSize: frameContentSize,\n      rects: frameRects,\n    } = frame;\n    const {\n      useFrameFill,\n    } = this.options;\n\n    const {\n      inlineSize: rectInlineSize,\n      contentSize: rectContentSize,\n    } = this.getRectSize(frameInlineSize);\n    const inlineGap = this.getInlineGap();\n    const contentGap = this.getContentGap();\n\n\n    const itemsLength = items.length;\n\n    if (!itemsLength || !frameInlineSize || !frameContentSize) {\n      return { start: outline, end: outline };\n    }\n    const rectsLength = frameRects.length;\n    let startOutline = range(frameInlineSize).map(() => Infinity);\n    let endOutline = range(frameInlineSize).map(() => -Infinity);\n    const frameOutline = frame.outline.map((point) => point * (rectContentSize + contentGap));\n\n    for (let startIndex = 0; startIndex < itemsLength; startIndex += rectsLength) {\n      // Compare group's startOutline and startOutline of rect\n      const startPoint = getOutlinePoint(endOutline, frameOutline, useFrameFill);\n\n      for (let rectIndex = 0; rectIndex < rectsLength && startIndex + rectIndex < itemsLength; ++rectIndex) {\n        const item = items[startIndex + rectIndex];\n        const {\n          contentPos: frameRectContentPos,\n          inlinePos: frameRectInlinePos,\n          contentSize: frameRectContentSize,\n          inlineSize: frameRectInlineSize,\n        } = frameRects[rectIndex];\n        const contentPos = startPoint + frameRectContentPos * (rectContentSize + contentGap);\n        const inlinePos = frameRectInlinePos * (rectInlineSize + inlineGap);\n        const contentSize = frameRectContentSize * (rectContentSize + contentGap) - contentGap;\n        const inlineSize = frameRectInlineSize * (rectInlineSize + inlineGap) - inlineGap;\n\n        fillOutlines(startOutline, endOutline, {\n          inlinePos: frameRectInlinePos,\n          inlineSize: frameRectInlineSize,\n          contentPos: contentPos,\n          contentSize: contentSize + contentGap,\n        });\n        item.setCSSGridRect({\n          inlinePos,\n          contentPos,\n          inlineSize,\n          contentSize,\n        });\n      }\n    }\n    const isDirectionEnd = direction === \"end\";\n\n    let gridOutline = outline.length ? outline : [0];\n\n    if (gridOutline.length !== frameInlineSize) {\n      const point = isDirectionEnd ? Math.max(...gridOutline) : Math.min(...gridOutline);\n\n      gridOutline = range(frameInlineSize).map(() => point);\n    }\n    startOutline = startOutline.map((point) => isFinite(point) ? point : 0);\n    endOutline = endOutline.map((point) => isFinite(point) ? point : 0);\n    const outlineDist = isDirectionEnd\n      ? getOutlinePoint(gridOutline, startOutline, useFrameFill)\n      : getOutlinePoint(endOutline, gridOutline, useFrameFill);\n\n    items.forEach((item) => {\n      item.cssContentPos! += outlineDist;\n    });\n\n    return {\n      start: startOutline.map((point) => point + outlineDist),\n      end: endOutline.map((point) => point + outlineDist),\n    };\n  }\n  public getComputedOutlineLength() {\n    const frame = this.options.frame;\n\n    return frame.length ? frame[0].length : 0;\n  }\n  public getComputedOutlineSize() {\n    const { rectSize: rectSizeOption } = this.options;\n\n    if (typeof rectSizeOption === \"object\") {\n      return rectSizeOption.inlineSize;\n    }\n    const inlineGap = this.getInlineGap();\n    return (\n      rectSizeOption ||\n      (this.getContainerInlineSize()! + inlineGap) / this.getComputedOutlineLength() - inlineGap\n    );\n  }\n  protected getRectSize(frameInlineSize: number) {\n    const { rectSize: rectSizeOption } = this.options;\n\n    if (typeof rectSizeOption === \"object\") {\n      return rectSizeOption;\n    }\n    const inlineGap = this.getInlineGap();\n    const rectSizeValue = rectSizeOption\n      ? rectSizeOption\n      : (this.getContainerInlineSize()! + inlineGap) / frameInlineSize - inlineGap;\n\n    return { inlineSize: rectSizeValue, contentSize: rectSizeValue };\n  }\n  private _getFrame() {\n    const frame = this.options.frame;\n    const frameContentSize = frame.length;\n    const frameInlineSize = frameContentSize ? frame[0].length : 0;\n    const rects: FrameRect[] = [];\n    const passMap: Record<string, boolean> = {};\n    const startOutline = range(frameInlineSize).map(() => Infinity);\n    const endOutline = range(frameInlineSize).map(() => -Infinity);\n\n    for (let y1 = 0; y1 < frameContentSize; ++y1) {\n      for (let x1 = 0; x1 < frameInlineSize; ++x1) {\n        const type = frame[y1][x1];\n\n        if (!type) {\n          continue;\n        }\n        if (passMap[`${y1},${x1}`]) {\n          continue;\n        }\n        const rect = this._findRect(passMap, type, y1, x1, frameInlineSize, frameContentSize);\n\n        fillOutlines(startOutline, endOutline, rect);\n        rects.push(rect);\n      }\n    }\n    rects.sort((a, b) => (a.type < b.type ? -1 : 1));\n\n\n    return {\n      rects,\n      inlineSize: frameInlineSize,\n      contentSize: frameContentSize,\n      outline: startOutline,\n    };\n  }\n  private _findRect(\n    passMap: Record<string, boolean>,\n    type: number,\n    y1: number,\n    x1: number,\n    frameInlineSize: number,\n    frameContentSize: number,\n  ) {\n    const frame = this.options.frame;\n\n    let contentSize = 1;\n    let inlineSize = 1;\n\n    // find rect\n    for (let x2 = x1; x2 < frameInlineSize; ++x2) {\n      if (frame[y1][x2] === type) {\n        inlineSize = x2 - x1 + 1;\n        continue;\n      }\n      break;\n    }\n    for (let y2 = y1; y2 < frameContentSize; ++y2) {\n      if (frame[y2][x1] === type) {\n        contentSize = y2 - y1 + 1;\n        continue;\n      }\n      break;\n    }\n\n    // pass rect\n    for (let y = y1; y < y1 + contentSize; ++y) {\n      for (let x = x1; x < x1 + inlineSize; ++x) {\n        passMap[`${y},${x}`] = true;\n      }\n    }\n\n    const rect: FrameRect = {\n      type,\n      inlinePos: x1,\n      contentPos: y1,\n      inlineSize,\n      contentSize,\n    };\n    return rect;\n  }\n}\n\nexport interface FrameGrid extends Properties<typeof FrameGrid> {\n}\n\n\n/**\n * The shape of the grid. You can set the shape and order of items with a 2d array ([contentPos][inlinePos]). You can place items as many times as you fill the array with numbers, and zeros and spaces are empty spaces. The order of the items is arranged in ascending order of the numeric values that fill the array.\n * @ko Grid의 모양. 2d 배열([contentPos][inlinePos])로 아이템의 모양과 순서를 설정할 수 있다. 숫자로 배열을 채운만큼 아이템을 배치할 수 있으며 0과 공백은 빈 공간이다. 아이템들의 순서는 배열을 채운 숫자값의 오름차순대로 배치가 된다.\n * @name Grid.FrameGrid#frame\n * @type {$ts:Grid.FrameGrid.FrameGridOptions[\"frame\"]}\n * @default []\n * @example\n * ```js\n * import { FrameGrid } from \"@egjs/grid\";\n *\n * // Item 1 : 2 x 2\n * // Item 2 : 1 x 1\n * // Item 3 : 1 x 2\n * // Item 4 : 1 x 1\n * // Item 5 : 2 x 1\n * const grid = new FrameGrid(container, {\n *   frame: [\n *     [1, 1, 0, 0, 2, 3],\n *     [1, 1, 0, 4, 5, 5],\n *   ],\n * });\n *\n * // Item 1 : 2 x 2\n * // Item 2 : 2 x 2\n * grid.frame = [\n *   [1, 1, 0, 0, 2, 2],\n *   [1, 1, 0, 0, 2, 2],\n * ];\n * ```\n */\n\n/**\n * Make sure that the frame can be attached after the previous frame.\n * @ko 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다.\n * @name Grid.FrameGrid#useFrameFill\n * @type {$ts:Grid.FrameGrid.FrameGridOptions[\"useFrameFill\"]}\n * @default true\n * @example\n * ```js\n * import { FrameGrid } from \"@egjs/grid\";\n *\n * const grid = new FrameGrid(container, {\n *   useFrameFill: true,\n * });\n *\n * grid.useFrameFill = false;\n * ```\n */\n\n/**\n * 1x1 rect size. If it is 0, it is determined by the number of columns in the frame. (default: 0)\n * @ko 1x1 직사각형 크기. 0이면 frame의 column의 개수에 의해 결정된다. (default: 0)\n * @name Grid.FrameGrid#rectSize\n * @type {$ts:Grid.FrameGrid.FrameGridOptions[\"rectSize\"]}\n * @example\n * ```js\n * import { FrameGrid } from \"@egjs/grid\";\n *\n * const grid = new FrameGrid(container, {\n *   rectSize: 0,\n * });\n *\n * grid.rectSize = { inlineSize: 100, contentSize: 150 };\n * ```\n */\n","export interface BoxModelStatus {\n  orgInlineSize: number;\n  orgContentSize: number;\n  inlineSize: number;\n  contentSize: number;\n  inlinePos: number;\n  contentPos: number;\n  items: BoxModel[];\n}\n\nexport default class BoxModel implements BoxModelStatus {\n  public orgInlineSize: number;\n  public orgContentSize: number;\n  public inlineSize: number;\n  public contentSize: number;\n  public inlinePos: number;\n  public contentPos: number;\n  public items: BoxModel[];\n  constructor(status: Partial<BoxModelStatus>) {\n    const boxStatus = {\n      orgInlineSize: 0,\n      orgContentSize: 0,\n      inlineSize: 0,\n      contentSize: 0,\n      inlinePos: 0,\n      contentPos: 0,\n      items: [],\n      ...status,\n    };\n    for (const name in boxStatus) {\n      this[name] = boxStatus[name];\n    }\n  }\n  public scaleTo(inlineSize: number, contentSize: number) {\n    const scaleX = this.inlineSize ? inlineSize / this.inlineSize : 0;\n    const scaleY = this.contentSize ? contentSize / this.contentSize : 0;\n\n    this.items.forEach((item) => {\n      if (scaleX !== 0) {\n        item.inlinePos *= scaleX;\n        item.inlineSize *= scaleX;\n      }\n      if (scaleY !== 0) {\n        item.contentPos *= scaleY;\n        item.contentSize *= scaleY;\n      }\n    });\n\n    this.inlineSize = inlineSize;\n    this.contentSize = contentSize;\n  }\n  public push(item: BoxModel) {\n    this.items.push(item);\n  }\n  public getOrgSizeWeight() {\n    return this.orgInlineSize * this.orgContentSize;\n  }\n  public getSize() {\n    return this.inlineSize * this.contentSize;\n  }\n  public getOrgRatio() {\n    return (this.orgContentSize === 0) ? 0 : this.orgInlineSize / this.orgContentSize;\n  }\n  public getRatio() {\n    return (this.contentSize === 0) ? 0 : this.inlineSize / this.contentSize;\n  }\n}\n","/**\n * egjs-grid\n * Copyright (c) 2021-present NAVER Corp.\n * MIT license\n */\nimport Grid from \"../Grid\";\nimport { PROPERTY_TYPE } from \"../consts\";\nimport { GridOptions, Properties, GridOutlines } from \"../types\";\nimport { GetterSetter } from \"../utils\";\nimport { GridItem } from \"../GridItem\";\nimport BoxModel from \"./lib/BoxModel\";\n\n\nfunction getCost(originLength: number, length: number) {\n  let cost = originLength / length;\n\n  if (cost < 1) {\n    cost = 1 / cost;\n  }\n\n  return cost - 1;\n}\nfunction fitArea(\n  item: BoxModel,\n  bestFitArea: BoxModel,\n  itemFitSize: { inlineSize: number, contentSize: number },\n  containerFitSize: { inlineSize: number, contentSize: number },\n  isContentDirection: boolean,\n) {\n  item.contentSize = itemFitSize.contentSize;\n  item.inlineSize = itemFitSize.inlineSize;\n  bestFitArea.contentSize = containerFitSize.contentSize;\n  bestFitArea.inlineSize = containerFitSize.inlineSize;\n\n  if (isContentDirection) {\n    item.contentPos = bestFitArea.contentPos + bestFitArea.contentSize;\n    item.inlinePos = bestFitArea.inlinePos;\n  } else {\n    item.inlinePos = bestFitArea.inlinePos + bestFitArea.inlineSize;\n    item.contentPos = bestFitArea.contentPos;\n  }\n}\n\n\n/**\n * @typedef\n * @memberof Grid.PackingGrid\n * @extends Grid.GridOptions\n */\nexport interface PackingGridOptions extends GridOptions {\n  /**\n   * The aspect ratio (inlineSize / contentSize) of the container with items.\n   * <ko>아이템들을 가진 컨테이너의 종횡비(inlineSize / contentSize).</ko>\n   * @default 1\n   */\n  aspectRatio?: number;\n  /**\n   * The size weight when placing items.\n   * <ko>아이템들을 배치하는데 사이즈 가중치.</ko>\n   * @default 1\n   */\n  sizeWeight?: number;\n  /**\n   * The weight to keep ratio when placing items.\n   * <ko>아이템들을 배치하는데 비율을 유지하는 가중치.</ko>\n   * @default 1\n   */\n  ratioWeight?: number;\n  /**\n   * The priority that determines the weight of the item. \"size\" = (sizeWieght: 100, ratioWeight: 1), \"ratio\" = (sizeWeight: 1, ratioWeight; 100), \"custom\" = (set sizeWeight, ratioWeight)\n   * item's weight = item's ratio(inlineSize / contentSize) change * `ratioWeight` + size(inlineSize * contentSize) change * `sizeWeight`.\n   * <ko> 아이템의 가중치를 결정하는 우선수치. \"size\" = (sizeWieght: 100, ratioWeight: 1), \"ratio\" = (sizeWeight: 1, ratioWeight; 100), \"custom\" = (set sizeWeight, ratioWeight). 아이템의 가중치 = ratio(inlineSize / contentSize)의 변화량 * `ratioWeight` + size(inlineSize * contentSize)의 변화량 * `sizeWeight`.</ko>\n   * @default \"custom\"\n   */\n  weightPriority?: \"size\" | \"ratio\" | \"custom\";\n}\n\n/**\n * The PackingGrid 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 PackingGrid는 아이템의 본래 크기에 따른 비중을 해치지 않으면서 중요한 카드는 더 크게 보여 주는 레이아웃이다.\n * 행과 열이 구분돼 아이템을 정돈되게 배치하는 대신 가로세로 일정 공간 내에서 동적으로 아이템을 배치한다.\n * `sizeWeight`가 `ratioWeight`보다 높으면 아이템들의 size가 최대한 보존이 된다.\n * 반대로 `ratioWeight`가 `sizeWeight`보다 높으면 아이템들의 비율이 최대한 보존이 된다.\n * @memberof Grid\n * @param {HTMLElement | string} container - A base element for a module <ko>모듈을 적용할 기준 엘리먼트</ko>\n * @param {Grid.PackingGrid.PackingGridOptions} options - The option object of the PackingGrid module <ko>PackingGrid 모듈의 옵션 객체</ko>\n */\n@GetterSetter\nexport class PackingGrid extends Grid<PackingGridOptions> {\n  public static propertyTypes = {\n    ...Grid.propertyTypes,\n    aspectRatio: PROPERTY_TYPE.RENDER_PROPERTY,\n    sizeWeight: PROPERTY_TYPE.RENDER_PROPERTY,\n    ratioWeight: PROPERTY_TYPE.RENDER_PROPERTY,\n    weightPriority: PROPERTY_TYPE.RENDER_PROPERTY,\n  };\n  public static defaultOptions: Required<PackingGridOptions> = {\n    ...Grid.defaultOptions,\n    aspectRatio: 1,\n    sizeWeight: 1,\n    ratioWeight: 1,\n    weightPriority: \"custom\",\n  };\n\n\n  public applyGrid(items: GridItem[], direction: \"start\" | \"end\", outline: number[]): GridOutlines {\n    const { aspectRatio } = this.options;\n    const containerInlineSize = this.getContainerInlineSize();\n    const containerContentSize = containerInlineSize / aspectRatio;\n    const inlineGap = this.getInlineGap();\n    const contentGap = this.getContentGap();\n    const prevOutline = outline.length ? outline : [0];\n    const startPoint = direction === \"end\"\n      ? Math.max(...prevOutline)\n      : Math.min(...prevOutline) - containerContentSize - contentGap;\n    const endPoint = startPoint + containerContentSize + contentGap;\n    const container = new BoxModel({});\n\n    items.forEach((item) => {\n      const model = new BoxModel({\n        inlineSize: item.orgInlineSize,\n        contentSize: item.orgContentSize,\n        orgInlineSize: item.orgInlineSize,\n        orgContentSize: item.orgContentSize,\n      });\n\n      this._findBestFitArea(container, model);\n      container.push(model);\n      container.scaleTo(containerInlineSize + inlineGap, containerContentSize + contentGap);\n    });\n    items.forEach((item, i) => {\n      const boxItem = container.items[i];\n      const inlineSize = boxItem.inlineSize - inlineGap;\n      const contentSize = boxItem.contentSize - contentGap;\n      const contentPos = startPoint + boxItem.contentPos;\n      const inlinePos = boxItem.inlinePos;\n\n      item.setCSSGridRect({\n        inlinePos,\n        contentPos,\n        inlineSize,\n        contentSize,\n      });\n    });\n\n    return {\n      start: [startPoint],\n      end: [endPoint],\n    };\n  }\n  private _findBestFitArea(container: BoxModel, item: BoxModel) {\n    if (container.getRatio() === 0) { // 아이템 최초 삽입시 전체영역 지정\n      container.orgInlineSize = item.inlineSize;\n      container.orgContentSize = item.contentSize;\n      container.inlineSize = item.inlineSize;\n      container.contentSize = item.contentSize;\n      return;\n    }\n\n    let bestFitArea!: BoxModel;\n    let minCost = Infinity;\n    let isContentDirection = false;\n    const itemFitSize = {\n      inlineSize: 0,\n      contentSize: 0,\n    };\n    const containerFitSize = {\n      inlineSize: 0,\n      contentSize: 0,\n    };\n    const sizeWeight = this._getWeight(\"size\");\n    const ratioWeight = this._getWeight(\"ratio\");\n\n    container.items.forEach((child) => {\n      const containerSizeCost = getCost(child.getOrgSizeWeight(), child.getSize()) * sizeWeight;\n      const containerRatioCost = getCost(child.getOrgRatio(), child.getRatio()) * ratioWeight;\n      const inlineSize = child.inlineSize;\n      const contentSize = child.contentSize;\n      for (let i = 0; i < 2; ++i) {\n        let itemInlineSize;\n        let itemContentSize;\n        let containerInlineSize;\n        let containerContentSize;\n\n        if (i === 0) {\n          // add item to content pos (top, bottom)\n          itemInlineSize = inlineSize;\n          itemContentSize = contentSize * (item.contentSize / (child.orgContentSize + item.contentSize));\n          containerInlineSize = inlineSize;\n          containerContentSize = contentSize - itemContentSize;\n        } else {\n          // add item to inline pos (left, right)\n          itemContentSize = contentSize;\n          itemInlineSize = inlineSize * (item.inlineSize / (child.orgInlineSize + item.inlineSize));\n          containerContentSize = contentSize;\n          containerInlineSize = inlineSize - itemInlineSize;\n        }\n\n        const itemSize = itemInlineSize * itemContentSize;\n        const itemRatio = itemInlineSize / itemContentSize;\n        const containerSize = containerInlineSize * containerContentSize;\n        const containerRatio = containerContentSize / containerContentSize;\n\n        let cost = getCost(item.getSize(), itemSize) * sizeWeight;\n        cost += getCost(item.getRatio(), itemRatio) * ratioWeight;\n        cost += getCost(child.getOrgSizeWeight(), containerSize) * sizeWeight - containerSizeCost;\n        cost += getCost(child.getOrgRatio(), containerRatio) * ratioWeight - containerRatioCost;\n\n        if (cost === Math.min(cost, minCost)) {\n          minCost = cost;\n          bestFitArea = child;\n          isContentDirection = (i === 0);\n          itemFitSize.inlineSize = itemInlineSize;\n          itemFitSize.contentSize = itemContentSize;\n          containerFitSize.inlineSize = containerInlineSize;\n          containerFitSize.contentSize = containerContentSize;\n        }\n      }\n    });\n\n    fitArea(item, bestFitArea, itemFitSize, containerFitSize, isContentDirection);\n  }\n  public getComputedOutlineLength() {\n    return 1;\n  }\n  public getComputedOutlineSize() {\n    return this.getContainerInlineSize();\n  }\n  private _getWeight(type: \"size\" | \"ratio\"): number {\n    const options = this.options;\n    const weightPriority = options.weightPriority;\n\n    if (weightPriority === type) {\n      return 100;\n    } else if (weightPriority === \"custom\") {\n      return options[`${type}Weight`];\n    }\n    return 1;\n  }\n}\n\nexport interface PackingGrid extends Properties<typeof PackingGrid> {\n}\n\n\n/**\n * The aspect ratio (inlineSize / contentSize) of the container with items.\n * @ko 아이템들을 가진 컨테이너의 종횡비(inlineSize / contentSize).\n * @name Grid.PackingGrid#aspectRatio\n * @type {$ts:Grid.PackingGrid.PackingGridOptions[\"aspectRatio\"]}\n * @default 1\n * @example\n * ```js\n * import { PackingGrid } from \"@egjs/grid\";\n *\n * const grid = new PackingGrid(container, {\n *   aspectRatio: 1,\n * });\n *\n * grid.aspectRatio = 1.5;\n * ```\n */\n\n/**\n * The priority that determines the weight of the item. \"size\" = (sizeWieght: 2, ratioWeight: 1), \"ratio\" = (sizeWeight: 1, ratioWeight; 2), \"custom\" = (set sizeWeight, ratioWeight)\n * item's weight = item's ratio(inlineSize / contentSize) change * `ratioWeight` + size(inlineSize * contentSize) change * `sizeWeight`.\n * @ko 아이템의 가중치를 결정하는 우선수치. \"size\" = (sizeWieght: 2, ratioWeight: 1), \"ratio\" = (sizeWeight: 1, ratioWeight; 2), \"custom\" = (set sizeWeight, ratioWeight). 아이템의 가중치 = ratio(inlineSize / contentSize)의 변화량 * `ratioWeight` + size(inlineSize * contentSize)의 변화량 * `sizeWeight`.\n * @name Grid.PackingGrid#weightPriority\n * @type {$ts:Grid.PackingGrid.PackingGridOptions[\"weightPriority\"]}\n * @default \"custom\"\n * @example\n * ```js\n * import { PackingGrid } from \"@egjs/grid\";\n *\n * const grid = new PackingGrid(container, {\n *   weightPriority: \"custom\",\n *   sizeWeight: 1,\n *   ratioWeight: 1,\n * });\n *\n * grid.weightPriority = \"size\";\n * // or\n * grid.weightPriority = \"ratio\";\n * ```\n */\n\n/**\n * The size weight when placing items.\n * @ko 아이템들을 배치하는데 사이즈 가중치.\n * @name Grid.PackingGrid#sizeWeight\n * @type {$ts:Grid.PackingGrid.PackingGridOptions[\"sizeWeight\"]}\n * @default 1\n * @example\n * ```js\n * import { PackingGrid } from \"@egjs/grid\";\n *\n * const grid = new PackingGrid(container, {\n *   sizeWeight: 1,\n * });\n *\n * grid.sizeWeight = 10;\n * ```\n */\n\n\n/**\n * The weight to keep ratio when placing items.\n * @ko 아이템들을 배치하는데 비율을 유지하는 가중치.\n * @name Grid.PackingGrid#ratioWeight\n * @type {$ts:Grid.PackingGrid.PackingGridOptions[\"ratioWeight\"]}\n * @default 1\n * @example\n * ```js\n * import { PackingGrid } from \"@egjs/grid\";\n *\n * const grid = new PackingGrid(container, {\n *   ratioWeight: 1,\n * });\n *\n * grid.ratioWeight = 10;\n * ```\n */\n","import Grid, * as modules from './index';\n\nfor (const name in modules) {\n  (Grid as any)[name] = (modules as any)[name];\n}\n\ndeclare const module: any;\nmodule.exports = Grid;\nexport default Grid;\nexport * from './index';\n"]}