{"version":3,"file":"scene.esm.js","sources":["../src/easing.ts","../src/consts.ts","../src/PropertyObject.ts","../src/utils/property.ts","../src/utils.ts","../src/Animator.ts","../src/Frame.ts","../src/utils/dot.ts","../src/SceneItem.ts","../src/Scene.ts","../src/presets.ts"],"sourcesContent":["import { between } from \"@daybrush/utils\";\nimport { EasingFunction } from \"./types\";\n\nfunction cubic(y1: number, y2: number, t: number) {\n  const t2 = 1 - t;\n\n  // Bezier Curve Formula\n  return t * t * t + 3 * t * t * t2 * y2 + 3 * t * t2 * t2 * y1;\n}\nfunction solveFromX(x1: number, x2: number, x: number) {\n  // x  0 ~ 1\n  // t 0 ~ 1\n  let t = x;\n  let solveX = x;\n  let dx = 1;\n\n  while (Math.abs(dx) > 1 / 1000) {\n    // 예상 t초에 의한 _x값\n    solveX = cubic(x1, x2, t);\n    dx = solveX - x;\n    // 차이가 미세하면 그 값을 t로 지정\n    if (Math.abs(dx) < 1 / 1000) {\n      return t;\n    }\n    t -= dx / 2;\n  }\n  return t;\n}\n/**\n * @namespace easing\n */\n/**\n* Cubic Bezier curve.\n* @memberof easing\n* @func bezier\n* @param {number} [x1] - point1's x\n* @param {number} [y1] - point1's y\n* @param {number} [x2] - point2's x\n* @param {number} [y2] - point2's y\n* @return {function} the curve function\n* @example\nimport {bezier} from \"scenejs\";\nScene.bezier(0, 0, 1, 1) // LINEAR\nScene.bezier(0.25, 0.1, 0.25, 1) // EASE\n*/\nexport function bezier(x1: number, y1: number, x2: number, y2: number) {\n  /*\n\t\tx = f(t)\n\t\tcalculate inverse function by x\n\t\tt = f-1(x)\n\t*/\n  const func: EasingFunction = (x: number) => {\n    const t = solveFromX(x1, x2, between(x, 0, 1));\n\n    return cubic(y1, y2, t);\n  };\n\n  func.easingName = `cubic-bezier(${x1},${y1},${x2},${y2})`;\n  return func;\n}\n/**\n* Specifies a stepping function\n* @see {@link https://www.w3schools.com/cssref/css3_pr_animation-timing-function.asp|CSS3 Timing Function}\n* @memberof easing\n* @func steps\n* @param {number} count - point1's x\n* @param {\"start\" | \"end\"} postion - point1's y\n* @return {function} the curve function\n* @example\nimport {steps} from \"scenejs\";\nScene.steps(1, \"start\") // Scene.STEP_START\nScene.steps(1, \"end\") // Scene.STEP_END\n*/\nexport function steps(count: number, position: \"start\" | \"end\") {\n  const func: EasingFunction = (time: number) => {\n    const level = 1 / count;\n\n    if (time >= 1) {\n      return 1;\n    }\n    return (position === \"start\" ? level : 0) + Math.floor(time / level) * level;\n  };\n\n  func.easingName = `steps(${count}, ${position})`;\n\n  return func;\n}\n\n/**\n* Equivalent to steps(1, start)\n* @memberof easing\n* @name STEP_START\n* @static\n* @type {function}\n* @example\nimport {STEP_START} from \"scenejs\";\nScene.STEP_START // steps(1, start)\n*/\nexport const STEP_START = /*#__PURE__#*/steps(1, \"start\");\n/**\n* Equivalent to steps(1, end)\n* @memberof easing\n* @name STEP_END\n* @static\n* @type {function}\n* @example\nimport {STEP_END} from \"scenejs\";\nScene.STEP_END // steps(1, end)\n*/\nexport const STEP_END = /*#__PURE__#*/steps(1, \"end\");\n/**\n* Linear Speed (0, 0, 1, 1)\n* @memberof easing\n* @name LINEAR\n* @static\n* @type {function}\n* @example\nimport {LINEAR} from \"scenejs\";\nScene.LINEAR\n*/\nexport const LINEAR = /*#__PURE__#*/bezier(0, 0, 1, 1);\n/**\n* Ease Speed (0.25, 0.1, 0.25, 1)\n* @memberof easing\n* @name EASE\n* @static\n* @type {function}\n* @example\nimport {EASE} from \"scenejs\";\nScene.EASE\n*/\nexport const EASE = /*#__PURE__#*/bezier(0.25, 0.1, 0.25, 1);\n/**\n* Ease In Speed (0.42, 0, 1, 1)\n* @memberof easing\n* @name EASE_IN\n* @static\n* @type {function}\n* @example\nimport {EASE_IN} from \"scenejs\";\nScene.EASE_IN\n*/\nexport const EASE_IN = /*#__PURE__#*/bezier(0.42, 0, 1, 1);\n/**\n* Ease Out Speed (0, 0, 0.58, 1)\n* @memberof easing\n* @name EASE_OUT\n* @static\n* @type {function}\n* @example\nimport {EASE_OUT} from \"scenejs\";\nScene.EASE_OUT\n*/\nexport const EASE_OUT = /*#__PURE__#*/bezier(0, 0, 0.58, 1);\n/**\n* Ease In Out Speed (0.42, 0, 0.58, 1)\n* @memberof easing\n* @name EASE_IN_OUT\n* @static\n* @type {function}\n* @example\nimport {EASE_IN_OUT} from \"scenejs\";\nScene.EASE_IN_OUT\n*/\nexport const EASE_IN_OUT = /*#__PURE__#*/bezier(0.42, 0, 0.58, 1);\n","import { IObject } from \"@daybrush/utils\";\nimport { RoleObject, OptionType, EventType, EasingFunction } from \"./types\";\nimport { EASE, EASE_IN, EASE_IN_OUT, LINEAR, EASE_OUT, STEP_START, STEP_END } from \"./easing\";\n\nexport const PREFIX = \"__SCENEJS_\";\nexport const DATA_SCENE_ID = \"data-scene-id\";\nexport const TIMING_FUNCTION = \"animation-timing-function\";\nexport const ROLES: RoleObject = { transform: {}, filter: {}, attribute: {}, html: true };\nexport const ALIAS: IObject<string[]> = { easing: [TIMING_FUNCTION] };\nexport const FIXED = { [TIMING_FUNCTION]: true, contents: true, html: true };\nexport const MAXIMUM = 1000000;\nexport const THRESHOLD = 0.000001;\n\nexport const DURATION = \"duration\";\nexport const FILL_MODE = \"fillMode\";\nexport const DIRECTION = \"direction\";\nexport const ITERATION_COUNT = \"iterationCount\";\nexport const DELAY = \"delay\";\nexport const EASING = \"easing\";\nexport const PLAY_SPEED = \"playSpeed\";\nexport const EASING_NAME = \"easingName\";\nexport const ITERATION_TIME = \"iterationTime\";\nexport const PAUSED = \"paused\";\nexport const ENDED = \"ended\";\nexport const TIMEUPDATE = \"timeupdate\";\nexport const ANIMATE = \"animate\";\nexport const PLAY = \"play\";\nexport const RUNNING = \"running\";\nexport const ITERATION = \"iteration\";\nexport const START_ANIMATION = \"startAnimation\";\nexport const PAUSE_ANIMATION = \"pauseAnimation\";\nexport const ALTERNATE = \"alternate\";\nexport const REVERSE = \"reverse\";\nexport const ALTERNATE_REVERSE = \"alternate-reverse\";\nexport const NORMAL = \"normal\";\nexport const INFINITE = \"infinite\";\nexport const PLAY_STATE = \"playState\";\nexport const PLAY_CSS = \"playCSS\";\nexport const PREV_TIME = \"prevTime\";\nexport const TICK_TIME = \"tickTime\";\nexport const CURRENT_TIME = \"currentTime\";\nexport const SELECTOR = \"selector\";\nexport const TRANSFORM_NAME = \"transform\";\nexport const EASINGS = {\n    \"linear\": LINEAR,\n    \"ease\": EASE,\n    \"ease-in\": EASE_IN,\n    \"ease-out\": EASE_OUT,\n    \"ease-in-out\": EASE_IN_OUT,\n    \"step-start\": STEP_START,\n    \"step-end\": STEP_END,\n};\nexport const NAME_SEPARATOR = \"_///_\";\n/**\n* option name list\n* @name Scene.OPTIONS\n* @memberof Scene\n* @static\n* @type {$ts:OptionType}\n* @example\n* Scene.OPTIONS // [\"duration\", \"fillMode\", \"direction\", \"iterationCount\", \"delay\", \"easing\", \"playSpeed\"]\n*/\nexport const OPTIONS: OptionType = [DURATION, FILL_MODE, DIRECTION, ITERATION_COUNT, DELAY, EASING, PLAY_SPEED];\n\n/**\n* Event name list\n* @name Scene.EVENTS\n* @memberof Scene\n* @static\n* @type {$ts:EventType}\n* @example\n* Scene.EVENTS // [\"paused\", \"ended\", \"timeupdate\", \"animate\", \"play\", \"iteration\"];\n*/\nexport const EVENTS: EventType = [PAUSED, ENDED, TIMEUPDATE, ANIMATE, PLAY, ITERATION];\n","import { isString } from \"@daybrush/utils\";\nimport { PropertyObjectState } from \"./types\";\n\n/**\n* Make string, array to PropertyObject for the dot product\n*/\nclass PropertyObject implements PropertyObjectState {\n    public value: any[];\n    public prefix: string = \"\";\n    public suffix: string = \"\";\n    public model: string = \"\";\n    public type: string = \"\";\n    public separator: string = \",\";\n\n    /**\n      * @param - This value is in the array format.\n      * @param - options\n      * @example\n  var obj = new PropertyObject([100,100,100,0.5], {\n      \"separator\" : \",\",\n      \"prefix\" : \"rgba(\",\n      \"suffix\" : \")\"\n  });\n       */\n    constructor(value: string | any[], options?: Partial<PropertyObjectState>) {\n        options && this.setOptions(options);\n        this.value = isString(value) ? value.split(this.separator) : value;\n    }\n    public setOptions(newOptions: Partial<PropertyObjectState>) {\n        for (const name in newOptions) {\n            this[name as keyof PropertyObjectState] = newOptions[name as keyof PropertyObjectState];\n        }\n        return this;\n    }\n    /**\n      * the number of values.\n      * @example\n  const obj1 = new PropertyObject(\"1,2,3\", \",\");\n\n  console.log(obj1.length);\n  // 3\n       */\n    public size() {\n        return this.value.length;\n    }\n    /**\n      * retrieve one of values at the index\n      * @param {Number} index - index\n      * @return {Object} one of values at the index\n      * @example\n  const obj1 = new PropertyObject(\"1,2,3\", \",\");\n\n  console.log(obj1.get(0));\n  // 1\n       */\n    public get(index: number) {\n        return this.value[index];\n    }\n    /**\n      * Set the value at that index\n      * @param {Number} index - index\n      * @param {Object} value - text, a number, object to set\n      * @return {PropertyObject} An instance itself\n      * @example\n  const obj1 = new PropertyObject(\"1,2,3\", \",\");\n  obj1.set(0, 2);\n  console.log(obj1.toValue());\n  // 2,2,3\n       */\n    public set(index: number, value: any) {\n        this.value[index] = value;\n        return this;\n    }\n    /**\n      * create a copy of an instance itself.\n      * @return {PropertyObject} clone\n      * @example\n  const obj1 = new PropertyObject(\"1,2,3\", \",\");\n  const obj2 = obj1.clone();\n       */\n    public clone(): PropertyObject {\n        const {\n            separator,\n            prefix,\n            suffix,\n            model,\n            type,\n        } = this;\n        const arr = this.value.map(v => ((v instanceof PropertyObject) ? v.clone() : v));\n        return new PropertyObject(arr, {\n            separator,\n            prefix,\n            suffix,\n            model,\n            type,\n        });\n    }\n    /**\n      * Make Property Object to String\n      * @return {String} Make Property Object to String\n      * @example\n  //rgba(100, 100, 100, 0.5)\n  const obj4 = new PropertyObject([100,100,100,0.5], {\n      \"separator\" : \",\",\n      \"prefix\" : \"rgba(\",\n      \"suffix\" : \")\",\n  });\n  console.log(obj4.toValue());\n  // \"rgba(100,100,100,0.5)\"\n      */\n    public toValue(): string {\n        return this.prefix + this.join() + this.suffix;\n    }\n    /**\n      * Make Property Object's array to String\n      * @return {String} Join the elements of an array into a string\n      * @example\n      //rgba(100, 100, 100, 0.5)\n      var obj4 = new PropertyObject([100,100,100,0.5], {\n          \"separator\" : \",\",\n          \"prefix\" : \"rgba(\",\n          \"suffix\" : \")\"\n      });\n      obj4.join();  // =>   \"100,100,100,0.5\"\n       */\n    public join() {\n        return this.value.map(v => ((v instanceof PropertyObject) ? v.toValue() : v)).join(this.separator);\n    }\n    /**\n      * executes a provided function once per array element.\n      * @param {Function} callback - Function to execute for each element, taking three arguments\n      * @param {All} [callback.currentValue] The current element being processed in the array.\n      * @param {Number} [callback.index] The index of the current element being processed in the array.\n      * @param {Array} [callback.array] the array.\n      * @return {PropertyObject} An instance itself\n      * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach|MDN Array.forEach()} reference to MDN document.\n      * @example\n  //rgba(100, 100, 100, 0.5)\n  var obj4 = new PropertyObject([100,100,100,0.5], {\n      \"separator\" : \",\",\n      \"prefix\" : \"rgba(\",\n      \"suffix\" : \")\"\n  });\n\n  obj4.forEach(t => {\n      console.log(t);\n  });  // =>   \"100,100,100,0.5\"\n      */\n    public forEach(func: (value?: any, index?: number, array?: any[]) => void) {\n        this.value.forEach(func);\n        return this;\n    }\n}\nexport default PropertyObject;\n","/**\n* @namespace\n* @name Property\n*/\n\nimport PropertyObject from \"../PropertyObject\";\nimport {\n    COLOR_MODELS, isString,\n    splitComma, splitSpace, stringToRGBA,\n    RGBA, splitBracket, IObject, isArray, splitText\n} from \"@daybrush/utils\";\nimport { NameType } from \"../types\";\n\nexport function splitStyle(str: string) {\n\n    const properties = splitText(str, \";\");\n    const obj: IObject<string | PropertyObject> = {};\n    const totalLength = properties.length;\n    let length = totalLength;\n\n    for (let i = 0; i < totalLength; ++i) {\n        const matches = splitText(properties[i], \":\");\n\n        if (matches.length < 2 || !matches[1]) {\n            --length;\n            continue;\n        }\n        obj[matches[0].trim()] = toPropertyObject(matches[1].trim());\n    }\n    return { styles: obj, length };\n}\n/**\n* convert array to PropertyObject[type=color].\n* default model \"rgba\"\n* @memberof Property\n* @function arrayToColorObject\n* @param {Array|PropertyObject} value ex) [0, 0, 0, 1]\n* @return {PropertyObject} PropertyObject[type=color]\n* @example\narrayToColorObject([0, 0, 0])\n// => PropertyObject(type=\"color\", model=\"rgba\", value=[0, 0, 0, 1], separator=\",\")\n*/\nexport function arrayToColorObject(arr: number[]) {\n    const model = RGBA;\n\n    if (arr.length === 3) {\n        arr[3] = 1;\n    }\n    return new PropertyObject(arr, {\n        model,\n        separator: \",\",\n        type: \"color\",\n        prefix: `${model}(`,\n        suffix: \")\",\n    });\n}\n/**\n* convert text with parentheses to object.\n* @memberof Property\n* @function stringToBracketObject\n* @param {String} value ex) \"rgba(0,0,0,1)\"\n* @return {PropertyObject} PropertyObject\n* @example\nstringToBracketObject(\"abcde(0, 0, 0,1)\")\n// => PropertyObject(model=\"abcde\", value=[0, 0, 0,1], separator=\",\")\n*/\nexport function stringToBracketObject(text: string) {\n    // [prefix, value, other]\n    const { prefix: model, value, suffix: afterModel } = splitBracket(text);\n\n    if (typeof value === \"undefined\") {\n        return text;\n    }\n    if (COLOR_MODELS.indexOf(model) > -1) {\n        return arrayToColorObject(stringToRGBA(text));\n    }\n    // divide comma(,)\n    const obj = toPropertyObject(value, model);\n\n    let arr = [value];\n    let separator = \",\";\n    let prefix = `${model}(`;\n    let suffix = `)${afterModel}`;\n\n    if (obj instanceof PropertyObject) {\n        separator = obj.separator;\n        arr = obj.value;\n        prefix += obj.prefix;\n        suffix = obj.suffix + suffix;\n    }\n    return new PropertyObject(arr, {\n        separator,\n        model,\n        prefix,\n        suffix,\n    });\n}\n\nexport function arrayToPropertyObject(arr: any[], separator: string) {\n    return new PropertyObject(arr, {\n        type: \"array\",\n        separator,\n    });\n}\n\n/**\n* convert text with parentheses to PropertyObject[type=color].\n* If the values are not RGBA model, change them RGBA mdoel.\n* @memberof Property\n* @function stringToColorObject\n* @param {String|PropertyObject} value ex) \"rgba(0,0,0,1)\"\n* @return {PropertyObject} PropertyObject[type=color]\n* @example\nstringToColorObject(\"rgba(0, 0, 0,1)\")\n// => PropertyObject(type=\"color\", model=\"rgba\", value=[0, 0, 0,1], separator=\",\")\n*/\nexport function stringToColorObject(value: string): string | PropertyObject {\n    const result = stringToRGBA(value);\n\n    return result ? arrayToColorObject(result) : value;\n}\n/**\n* convert CSS Value to PropertyObject\n* @memberof Property\n* @function toPropertyObject\n* @param {String} value it's text contains the array.\n* @return {String} Not Array, Not Separator, Only Number & Unit\n* @return {PropertyObject} Array with Separator.\n* @see referenced regular expression {@link http://stackoverflow.com/questions/20215440/parse-css-gradient-rule-with-javascript-regex}\n* @example\ntoPropertyObject(\"1px solid #000\");\n// => PropertyObject([\"1px\", \"solid\", rgba(0, 0, 0, 1)])\n*/\nexport function toPropertyObject(value: any[], model?: NameType): PropertyObject;\nexport function toPropertyObject(value: IObject<any>, model?: NameType): IObject<any>;\nexport function toPropertyObject(value: string, model?: NameType): PropertyObject | string;\nexport function toPropertyObject(value: string | IObject<any> | any[], model?: NameType) {\n    if (!isString(value)) {\n        if (isArray(value)) {\n            return arrayToPropertyObject(value, \",\");\n        }\n        return value;\n    }\n    let values: any = splitComma(value);\n\n    if (values.length > 1) {\n        return arrayToPropertyObject(values.map(v => toPropertyObject(v)), \",\");\n    }\n    values = splitSpace(value);\n\n    if (values.length > 1) {\n        return arrayToPropertyObject(values.map(v => toPropertyObject(v)), \" \");\n    }\n    values = /^(['\"])([^'\"]*)(['\"])$/g.exec(value);\n\n    if (values && values[1] === values[3]) {\n        // Quotes\n        return new PropertyObject([toPropertyObject(values[2])], {\n            prefix: values[1],\n            suffix: values[1],\n        });\n    } else if (value.indexOf(\"(\") !== -1) {\n        // color\n        return stringToBracketObject(value);\n    } else if (value.charAt(0) === \"#\" && model !== \"url\") {\n        return stringToColorObject(value);\n    }\n    return value;\n}\nexport function toObject(object: PropertyObject, result: IObject<any> = {}) {\n    const model = object.model;\n\n    if (model) {\n        object.setOptions({\n            model: \"\",\n            suffix: \"\",\n            prefix: \"\",\n        });\n        const value = object.size() > 1 ? object : object.get(0);\n\n        result[model] = value;\n    } else {\n        object.forEach(obj => {\n            toObject(obj, result);\n        });\n    }\n    return result;\n}\n","import {\n    ROLES, MAXIMUM, FIXED, ALIAS,\n    RUNNING, PLAY, ENDED, PLAY_CSS, CURRENT_TIME, START_ANIMATION, EASINGS, NAME_SEPARATOR\n} from \"./consts\";\nimport PropertyObject from \"./PropertyObject\";\nimport Scene from \"./Scene\";\nimport SceneItem from \"./SceneItem\";\nimport {\n    isArray, ANIMATION, ARRAY, OBJECT,\n    PROPERTY, STRING, NUMBER, IS_WINDOW, IObject, $, isObject, addEvent, removeEvent, isString,\n} from \"@daybrush/utils\";\nimport { EasingType, EasingFunction, NameType } from \"./types\";\nimport { toPropertyObject } from \"./utils/property\";\nimport { bezier, steps } from \"./easing\";\nimport Animator from \"./Animator\";\n\nexport function isPropertyObject(value: any): value is PropertyObject {\n    return value instanceof PropertyObject;\n}\nexport function setAlias(name: string, alias: string[]) {\n    ALIAS[name] = alias;\n}\nexport function setRole(names: string[], isProperty?: boolean, isFixedProperty?: boolean) {\n    const length = names.length;\n    let roles: any = ROLES;\n    let fixed: any = FIXED;\n\n    for (let i = 0; i < length - 1; ++i) {\n        !roles[names[i]] && (roles[names[i]] = {});\n        roles = roles[names[i]];\n        if (isFixedProperty) {\n            !fixed[names[i]] && (fixed[names[i]] = {});\n            fixed = fixed[names[i]];\n        }\n    }\n    isFixedProperty && (fixed[names[length - 1]] = true);\n    roles[names[length - 1]] = isProperty ? true : {};\n}\nexport function getType(value: any) {\n    const type = typeof value;\n\n    if (type === OBJECT) {\n        if (isArray(value)) {\n            return ARRAY;\n        } else if (isPropertyObject(value)) {\n            return PROPERTY;\n        }\n    } else if (type === STRING || type === NUMBER) {\n        return \"value\";\n    }\n    return type;\n}\nexport function isPureObject(obj: any): obj is object {\n    return isObject(obj) && obj.constructor === Object;\n}\nexport function getNames(names: IObject<any>, stack: string[]) {\n    let arr: string[][] = [];\n\n    if (isPureObject(names)) {\n        for (const name in names) {\n            stack.push(name);\n            arr = arr.concat(getNames(names[name], stack));\n            stack.pop();\n        }\n    } else {\n        arr.push(stack.slice());\n    }\n    return arr;\n}\nexport function updateFrame(names: IObject<any>, properties: IObject<any>) {\n    for (const name in properties) {\n        const value = properties[name];\n\n        if (!isPureObject(value)) {\n            names[name] = true;\n            continue;\n        }\n        if (!isObject(names[name])) {\n            names[name] = {};\n        }\n        updateFrame(names[name], properties[name]);\n    }\n    return names;\n}\nexport function toFixed(num: number) {\n    return Math.round(num * MAXIMUM) / MAXIMUM;\n}\nexport function getValueByNames(\n    names: Array<string | number>,\n    properties: IObject<any>, length: number = names.length) {\n    let value = properties;\n\n    for (let i = 0; i < length; ++i) {\n        if (!isObject(value) || value == null) {\n            return undefined;\n        }\n        value = value[names[i]];\n    }\n    return value;\n}\nexport function isInProperties(roles: IObject<any>, args: NameType[], isLast?: boolean) {\n    const length = args.length;\n    let role: any = roles;\n\n    if (length === 0) {\n        return false;\n    }\n    for (let i = 0; i < length; ++i) {\n        if (role === true) {\n            return false;\n        }\n        role = role[args[i]];\n        if (!role || (!isLast && role === true)) {\n            return false;\n        }\n    }\n    return true;\n}\n/**\n * @memberof Scene\n * @param - Property names\n * @param - Whether the property is the last property that cannot be an object (non-partitionable)\n */\nexport function isRole(args: NameType[], isLast?: boolean): boolean {\n    return isInProperties(ROLES, args, isLast);\n}\nexport function isFixed(args: NameType[]) {\n    return isInProperties(FIXED, args, true);\n}\n\nexport interface IterationInterface {\n    currentTime: number;\n    iterationCount: number;\n    elapsedTime: number;\n}\nexport function setPlayCSS(item: Animator, isActivate: boolean) {\n    item.state[PLAY_CSS] = isActivate;\n}\nexport function isPausedCSS(item: Scene | SceneItem) {\n    return item.state[PLAY_CSS] && item.isPaused();\n}\nexport function isEndedCSS(item: Scene | SceneItem) {\n    return !item.isEnded() && item.state[PLAY_CSS];\n}\n\nexport function makeId(selector?: boolean) {\n    for (; ;) {\n        const id = `${Math.floor(Math.random() * 10000000)}`;\n\n        if (!IS_WINDOW || !selector) {\n            return id;\n        }\n        const checkElement = $(`[data-scene-id=\"${id}\"]`);\n\n        if (!checkElement) {\n            return id;\n        }\n    }\n}\nexport function getRealId(item: Scene | SceneItem) {\n    return item.getId() || item.setId(makeId(false)).getId();\n}\nexport function toId(text: number | string) {\n    return `${text}`.match(/[0-9a-zA-Z]+/g).join(\"\");\n}\nexport function playCSS(\n    item: Scene | SceneItem, isExportCSS?: boolean,\n    playClassName?: string, properties: object = {}) {\n    if (!ANIMATION || item.getPlayState() === RUNNING) {\n        return;\n    }\n    const className = playClassName || START_ANIMATION;\n\n    if (isPausedCSS(item)) {\n        item.addPlayClass(true, className, properties);\n    } else {\n        if (item.isEnded()) {\n            item.setTime(0);\n        }\n        isExportCSS && item.exportCSS({ className });\n        const el = item.addPlayClass(false, className, properties);\n\n        if (!el) {\n            return;\n        }\n        addAnimationEvent(item, el);\n        setPlayCSS(item, true);\n    }\n    item.setPlayState(RUNNING);\n}\n\nexport function addAnimationEvent(item: Animator, el: Element) {\n    const state = item.state;\n    const duration = item.getDuration();\n    const isZeroDuration = !duration || !isFinite(duration);\n    const animationend = () => {\n        setPlayCSS(item, false);\n        item.finish();\n    };\n    const animationstart = () => {\n        item.trigger(PLAY);\n\n        addEvent(el, \"animationcancel\", animationend);\n        addEvent(el, \"animationend\", animationend);\n        addEvent(el, \"animationiteration\", animationiteration);\n    };\n    item.once(ENDED, () => {\n        removeEvent(el, \"animationcancel\", animationend);\n        removeEvent(el, \"animationend\", animationend);\n        removeEvent(el, \"animationiteration\", animationiteration);\n        removeEvent(el, \"animationstart\", animationstart);\n    });\n    const animationiteration = ({ elapsedTime }: any) => {\n        const currentTime = elapsedTime;\n        const iterationCount = isZeroDuration ? 0 : (currentTime / duration);\n\n        state[CURRENT_TIME] = currentTime;\n        item.setIteration(iterationCount);\n    };\n    addEvent(el, \"animationstart\", animationstart);\n}\n\nexport function getEasing(curveArray: string | number[] | EasingFunction): EasingType {\n    let easing: EasingType;\n\n    if (isString(curveArray)) {\n        if (curveArray in EASINGS) {\n            easing = EASINGS[curveArray];\n        } else {\n            const obj = toPropertyObject(curveArray);\n\n            if (isString(obj)) {\n                return 0;\n            } else {\n                if (obj.model === \"cubic-bezier\") {\n                    curveArray = obj.value.map(v => parseFloat(v));\n                    easing = bezier(curveArray[0], curveArray[1], curveArray[2], curveArray[3]);\n                } else if (obj.model === \"steps\") {\n                    easing = steps(parseFloat(obj.value[0]), obj.value[1]);\n                } else {\n                    return 0;\n                }\n            }\n        }\n    } else if (isArray(curveArray)) {\n        easing = bezier(curveArray[0], curveArray[1], curveArray[2], curveArray[3]);\n    } else {\n        easing = curveArray;\n    }\n\n    return easing;\n}\n","import {\n    THRESHOLD,\n    ALTERNATE, ALTERNATE_REVERSE, REVERSE, INFINITE, NORMAL,\n    ITERATION_COUNT, DELAY, FILL_MODE, DIRECTION, PLAY_SPEED,\n    DURATION, EASING, ITERATION_TIME, EASING_NAME, PAUSED,\n    RUNNING, PLAY, TIMEUPDATE, ENDED, PLAY_STATE, PREV_TIME, TICK_TIME, CURRENT_TIME, ITERATION, OPTIONS} from \"./consts\";\nimport { toFixed, getEasing } from \"./utils\";\nimport { splitUnit, isString, camelize, requestAnimationFrame, cancelAnimationFrame } from \"@daybrush/utils\";\nimport {\n    IterationCountType, DirectionType, AnimatorState,\n    EasingFunction, FillModeType, PlayStateType, EasingType, AnimatorOptions, AnimatorEvents,\n} from \"./types\";\nimport EventEmitter from \"@scena/event-emitter\";\n\nfunction GetterSetter<T extends new (...args: any[]) => {}>(\n    getter: string[], setter: string[], parent: string) {\n    return (constructor: T) => {\n        const prototype = constructor.prototype;\n\n        getter.forEach(name => {\n            prototype[camelize(`get ${name}`)] = function() {\n                return this[parent][name];\n            };\n        });\n        setter.forEach(name => {\n            prototype[camelize(`set ${name}`)] = function(value: any) {\n                this[parent][name] = value;\n                return this;\n            };\n        });\n    };\n}\nexport function isDirectionReverse(iteration: number, iteraiontCount: IterationCountType, direction: DirectionType) {\n    if (direction === REVERSE) {\n        return true;\n    } else if (iteraiontCount !== INFINITE && iteration === iteraiontCount && iteraiontCount % 1 === 0) {\n        return direction === (iteration % 2 >= 1 ? ALTERNATE_REVERSE : ALTERNATE);\n    }\n    return direction === (iteration % 2 >= 1 ? ALTERNATE : ALTERNATE_REVERSE);\n}\n/**\n* @typedef {Object} AnimatorState The Animator options. Properties used in css animation.\n* @property {number} [duration] The duration property defines how long an animation should take to complete one cycle.\n* @property {\"none\"|\"forwards\"|\"backwards\"|\"both\"} [fillMode] The fillMode property specifies a style for the element when the animation is not playing (before it starts, after it ends, or both).\n* @property {\"infinite\"|number} [iterationCount] The iterationCount property specifies the number of times an animation should be played.\n* @property {array|function} [easing] The easing(timing-function) specifies the speed curve of an animation.\n* @property {number} [delay] The delay property specifies a delay for the start of an animation.\n* @property {\"normal\"|\"reverse\"|\"alternate\"|\"alternate-reverse\"} [direction] The direction property defines whether an animation should be played forwards, backwards or in alternate cycles.\n*/\n\nconst setters = [\"id\", ITERATION_COUNT, DELAY, FILL_MODE,\n    DIRECTION, PLAY_SPEED, DURATION, PLAY_SPEED, ITERATION_TIME, PLAY_STATE];\nconst getters = [...setters, EASING, EASING_NAME];\n\n/**\n* play video, animation, the others\n* @extends EventEmitter\n* @see {@link https://www.w3schools.com/css/css3_animations.asp|CSS3 Animation}\n*/\n@GetterSetter(getters, setters, \"state\")\nclass Animator <\n    Options extends AnimatorOptions = AnimatorOptions,\n    State extends AnimatorState = AnimatorState,\n    Events extends {} = {},\n> extends EventEmitter<AnimatorEvents & Events> {\n    public state: State;\n    private timerId: number = 0;\n\n    /**\n     * @param - animator's options\n     * @example\n  const animator = new Animator({\n      delay: 2,\n      diretion: \"alternate\",\n      duration: 2,\n      fillMode: \"forwards\",\n      iterationCount: 3,\n      easing: Scene.easing.EASE,\n  });\n     */\n    constructor(options?: Partial<Options & AnimatorOptions>) {\n        super();\n        this.state = {\n            id: \"\",\n            easing: 0,\n            easingName: \"linear\",\n            iterationCount: 1,\n            delay: 0,\n            fillMode: \"forwards\",\n            direction: NORMAL,\n            playSpeed: 1,\n            currentTime: 0,\n            iterationTime: -1,\n            iteration: 0,\n            tickTime: 0,\n            prevTime: 0,\n            playState: PAUSED,\n            duration: 0,\n        } as State;\n        this.setOptions(options);\n    }\n    /**\n      * set animator's easing.\n      * @param curverArray - The speed curve of an animation.\n      * @return {Animator} An instance itself.\n      * @example\n  animator.({\n      delay: 2,\n      diretion: \"alternate\",\n      duration: 2,\n      fillMode: \"forwards\",\n      iterationCount: 3,\n      easing: Scene.easing.EASE,\n  });\n      */\n    public setEasing(curveArray: string | number[] | EasingFunction): this {\n        const easing: EasingType = getEasing(curveArray);\n        const easingName = easing && easing[EASING_NAME] || \"linear\";\n        const state = this.state;\n\n        state[EASING] = easing;\n        state[EASING_NAME] = easingName;\n        return this;\n    }\n    /**\n      * set animator's options.\n      * @see {@link https://www.w3schools.com/css/css3_animations.asp|CSS3 Animation}\n      * @param - animator's options\n      * @return {Animator} An instance itself.\n      * @example\n  animator.({\n      delay: 2,\n      diretion: \"alternate\",\n      duration: 2,\n      fillMode: \"forwards\",\n      iterationCount: 3,\n      easing: Scene.eaasing.EASE,\n  });\n      */\n    public setOptions(options: Partial<AnimatorOptions> = {}): this {\n        for (const name in options) {\n            const value = options[name];\n\n            if (name === EASING) {\n                this.setEasing(value);\n                continue;\n            } else if (name === DURATION) {\n                value && this.setDuration(value);\n                continue;\n            }\n            if (OPTIONS.indexOf(name as any) > -1) {\n                this.state[name] = value;\n            }\n        }\n\n        return this;\n    }\n    /**\n      * Get the animator's total duration including delay\n      * @return {number} Total duration\n      * @example\n  animator.getTotalDuration();\n      */\n    public getTotalDuration(): number {\n        return this.getActiveDuration(true);\n    }\n    /**\n      * Get the animator's total duration excluding delay\n      * @return {number} Total duration excluding delay\n      * @example\n  animator.getActiveDuration();\n      */\n    public getActiveDuration(delay?: boolean): number {\n        const state = this.state;\n        const count = state[ITERATION_COUNT];\n        if (count === INFINITE) {\n            return Infinity;\n        }\n        return (delay ? state[DELAY] : 0) + this.getDuration() * count;\n    }\n    /**\n      * Check if the animator has reached the end.\n      * @return {boolean} ended\n      * @example\n  animator.isEnded(); // true or false\n      */\n    public isEnded(): boolean {\n        if (this.state[TICK_TIME] === 0 && this.state[PLAY_STATE] === PAUSED) {\n            return true;\n        } else if (this.getTime() < this.getActiveDuration()) {\n            return false;\n        }\n        return true;\n    }\n    /**\n      *Check if the animator is paused:\n      * @return {boolean} paused\n      * @example\n  animator.isPaused(); // true or false\n      */\n    public isPaused(): boolean {\n        return this.state[PLAY_STATE] === PAUSED;\n    }\n    public start(delay: number = this.state[DELAY]): boolean {\n        const state = this.state;\n\n        state[PLAY_STATE] = RUNNING;\n\n        if (state[TICK_TIME] >= delay) {\n            /**\n             * This event is fired when play animator.\n             * @event Animator#play\n             */\n            this.trigger<\"play\", AnimatorEvents[\"play\"]>(PLAY);\n            return true;\n        }\n        return false;\n    }\n    /**\n      * play animator\n      * @return {Animator} An instance itself.\n      */\n    public play(toTime?: number) {\n        const state = this.state;\n        const delay = state[DELAY];\n        const currentTime = this.getTime();\n\n        state[PLAY_STATE] = RUNNING;\n\n        if (this.isEnded() && (currentTime === 0 || currentTime >= this.getActiveDuration())) {\n            this.setTime(-delay, true);\n        }\n\n        this.timerId = requestAnimationFrame((time: number) => {\n            state[PREV_TIME] = time;\n            this.tick(time, toTime);\n        });\n        this.start();\n        return this;\n    }\n    /**\n      * pause animator\n      * @return {Animator} An instance itself.\n      */\n    public pause(): this {\n        const state = this.state;\n\n        if (state[PLAY_STATE] !== PAUSED) {\n            state[PLAY_STATE] = PAUSED;\n            /**\n             * This event is fired when animator is paused.\n             * @event Animator#paused\n             */\n            this.trigger<\"paused\", AnimatorEvents[\"paused\"]>(PAUSED);\n        }\n        cancelAnimationFrame(this.timerId);\n        return this;\n    }\n    /**\n       * end animator\n       * @return {Animator} An instance itself.\n      */\n    public finish() {\n        this.setTime(0);\n        this.state[TICK_TIME] = 0;\n        this.end();\n        return this;\n    }\n    /**\n       * end animator\n       * @return {Animator} An instance itself.\n      */\n    public end() {\n        this.pause();\n        /**\n             * This event is fired when animator is ended.\n             * @event Animator#ended\n             */\n        this.trigger<\"ended\", AnimatorEvents[\"ended\"]>(ENDED);\n        return this;\n    }\n    /**\n      * set currentTime\n      * @param {Number|String} time - currentTime\n      * @return {Animator} An instance itself.\n      * @example\n\n  animator.setTime(\"from\"); // 0\n  animator.setTime(\"to\"); // 100%\n  animator.setTime(\"50%\");\n  animator.setTime(10);\n  animator.getTime() // 10\n      */\n    public setTime(time: number | string, isTick?: boolean, isParent?: boolean) {\n        const activeDuration = this.getActiveDuration();\n        const state = this.state;\n        const prevTime = state[TICK_TIME];\n        const delay = state[DELAY];\n        let currentTime = isTick ? (time as number) : this.getUnitTime(time);\n\n        state[TICK_TIME] = delay + currentTime;\n        if (currentTime < 0) {\n            currentTime = 0;\n        } else if (currentTime > activeDuration) {\n            currentTime = activeDuration;\n        }\n        state[CURRENT_TIME] = currentTime;\n        this.calculate();\n\n        if (isTick && !isParent) {\n            const tickTime = state[TICK_TIME];\n\n            if (prevTime < delay && time >= 0) {\n                this.start(0);\n            }\n            if (tickTime < prevTime || this.isEnded()) {\n                this.end();\n                return;\n            }\n        }\n        if (this.isDelay()) {\n            return this;\n        }\n        /**\n             * This event is fired when the animator updates the time.\n             * @event Animator#timeupdate\n             * @param {Object} param The object of data to be sent to an event.\n             * @param {Number} param.currentTime The total time that the animator is running.\n             * @param {Number} param.time The iteration time during duration that the animator is running.\n             * @param {Number} param.iterationCount The iteration count that the animator is running.\n             */\n        this.trigger<\"timeupdate\", AnimatorEvents[\"timeupdate\"]>(TIMEUPDATE, {\n            currentTime,\n            time: this.getIterationTime(),\n            iterationCount: state[ITERATION],\n        });\n\n        return this;\n    }\n    /**\n      * Get the animator's current time\n      * @return {number} current time\n      * @example\n  animator.getTime();\n      */\n    public getTime(): number {\n        return this.state[CURRENT_TIME];\n    }\n    public getUnitTime(time: string | number) {\n        if (isString(time)) {\n            const duration = this.getDuration() || 100;\n\n            if (time === \"from\") {\n                return 0;\n            } else if (time === \"to\") {\n                return duration;\n            }\n            const { unit, value } = splitUnit(time);\n\n            if (unit === \"%\") {\n                !this.getDuration() && (this.setDuration(duration));\n                return toFixed(parseFloat(time) / 100 * duration);\n            } else if (unit === \">\") {\n                return value + THRESHOLD;\n            } else {\n                return value;\n            }\n        } else {\n            return toFixed(time);\n        }\n    }\n    /**\n       * Check if the current state of animator is delayed.\n       * @return {boolean} check delay state\n       */\n    public isDelay() {\n        const state = this.state;\n        const delay = state[DELAY];\n        const tickTime = state[TICK_TIME];\n\n        return delay > 0 && (tickTime < delay);\n    }\n    public setIteration(iterationCount: number): this {\n        const state = this.state;\n        const passIterationCount = Math.floor(iterationCount);\n        const maxIterationCount = state[ITERATION_COUNT] === INFINITE ? Infinity : state[ITERATION_COUNT];\n\n        if (state[ITERATION] < passIterationCount && passIterationCount < maxIterationCount) {\n            /**\n                  * The event is fired when an iteration of an animation ends.\n                  * @event Animator#iteration\n                  * @param {Object} param The object of data to be sent to an event.\n                  * @param {Number} param.currentTime The total time that the animator is running.\n                  * @param {Number} param.iterationCount The iteration count that the animator is running.\n                  */\n            this.trigger<\"iteration\", AnimatorEvents[\"iteration\"]>(ITERATION, {\n                currentTime: state[CURRENT_TIME],\n                iterationCount: passIterationCount,\n            });\n        }\n        state[ITERATION] = iterationCount;\n        return this;\n    }\n    protected calculate() {\n        const state = this.state;\n        const iterationCount = state[ITERATION_COUNT];\n        const fillMode = state[FILL_MODE];\n        const direction = state[DIRECTION];\n        const duration = this.getDuration();\n        const time = this.getTime();\n        const iteration = duration === 0 ? 0 : time / duration;\n        let currentIterationTime = duration ? time % duration : 0;\n\n        if (!duration) {\n            this.setIterationTime(0);\n            return this;\n        }\n        this.setIteration(iteration);\n\n        // direction : normal, reverse, alternate, alternate-reverse\n        // fillMode : forwards, backwards, both, none\n        const isReverse = isDirectionReverse(iteration, iterationCount, direction);\n\n        const isFiniteDuration = isFinite(duration);\n        if (isFiniteDuration && isReverse) {\n            currentIterationTime = duration - currentIterationTime;\n        }\n        if (isFiniteDuration && iterationCount !== INFINITE) {\n            const isForwards = fillMode === \"both\" || fillMode === \"forwards\";\n\n            // fill forwards\n            if (iteration >= iterationCount) {\n                currentIterationTime = duration * (isForwards ? (iterationCount % 1) || 1 : 0);\n                isReverse && (currentIterationTime = duration - currentIterationTime);\n            }\n        }\n        this.setIterationTime(currentIterationTime);\n        return this;\n    }\n    private tick(now: number, to?: number) {\n        if (this.isPaused()) {\n            return;\n        }\n        const state = this.state;\n        const playSpeed = state[PLAY_SPEED];\n        const prevTime = state[PREV_TIME];\n        const delay = state[DELAY];\n        const tickTime = state[TICK_TIME];\n        const currentTime = tickTime + Math.min(1000, now - prevTime) / 1000 * playSpeed;\n\n        state[PREV_TIME] = now;\n        this.setTime(currentTime - delay, true);\n        if (to && to * 1000 < now) {\n            this.pause();\n        }\n        if (state[PLAY_STATE] === PAUSED) {\n            return;\n        }\n\n        this.timerId = requestAnimationFrame((time: number) => {\n            this.tick(time, to);\n        });\n    }\n}\n/**\n * Specifies the unique indicator of the animator\n * @method Animator#setId\n * @param {number | string} - String or number of id to be set in the animator\n * @return {Animator} An instance itself.\n */\n/**\n * Specifies the unique indicator of the animator\n * @method Animator#getId\n * @return {number | string} the indicator of the item.\n */\n/**\n * Get a delay for the start of an animation.\n * @method Animator#getDelay\n * @return {number} delay\n */\n/**\n * Set a delay for the start of an animation.\n * @method Animator#setDelay\n * @param {number} delay - delay\n * @return {Animator} An instance itself.\n */\n/**\n * Get fill mode for the item when the animation is not playing (before it starts, after it ends, or both)\n * @method Animator#getFillMode\n * @return {FillModeType} fillMode\n */\n/**\n * Set fill mode for the item when the animation is not playing (before it starts, after it ends, or both)\n * @method Animator#setFillMode\n * @param {FillModeType} fillMode - fillMode\n * @return {Animator} An instance itself.\n */\n/**\n * Get the number of times an animation should be played.\n * @method Animator#getIterationCount\n * @return {IterationCountType} iterationCount\n */\n/**\n * Set the number of times an animation should be played.\n * @method Animator#setIterationCount\n * @param {IterationCountType} iterationCount - iterationCount\n * @return {Animator} An instance itself.\n */\n/**\n * Get whether an animation should be played forwards, backwards or in alternate cycles.\n * @method Animator#getDirection\n * @return {DirectionType} direction\n */\n/**\n * Set whether an animation should be played forwards, backwards or in alternate cycles.\n * @method Animator#setDirection\n * @param {DirectionType} direction - direction\n * @return {Animator} An instance itself.\n */\n/**\n * Get whether the animation is running or paused.\n * @method Animator#getPlayState\n * @return {PlayStateType} playState\n */\n/**\n * Set whether the animation is running or paused.\n * @method Animator#setPlayState\n * @param {PlayStateType} playState - playState\n * @return {Animator} An instance itself.\n */\n/**\n * Get the animator's play speed\n * @method Animator#getPlaySpeed\n * @return {number} playSpeed\n */\n/**\n * Set the animator's play speed\n * @method Animator#setPlaySpeed\n * @param {number} playSpeed - playSpeed\n * @return {Animator} An instance itself.\n */\n/**\n * Get how long an animation should take to complete one cycle.\n * @method Animator#getDuration\n * @return {number} duration\n */\n/**\n * Set how long an animation should take to complete one cycle.\n * @method Animator#setDuration\n * @param {number} duration - duration\n * @return {Animator} An instance itself.\n */\n/**\n * Get the speed curve of an animation.\n * @method Animator#getEasing\n * @return {EasingType} easing\n */\n/**\n * Get the speed curve's name\n * @method Animator#getEasingName\n * @return {string} the curve's name.\n */\n/**\n\t* Get the animator's current iteration time\n\t* @method Animator#getIterationTime\n\t* @return {number} current iteration time\n\t* @example\nanimator.getIterationTime();\n\t*/\n\n// tslint:disable-next-line:interface-name\ninterface Animator <\n    Options extends AnimatorOptions = AnimatorOptions,\n    State extends AnimatorState = AnimatorState,\n    Events extends {} = {},\n> extends EventEmitter<AnimatorEvents & Events> {\n    setId(id: number | string): this;\n    getId(): number | string;\n    getIterationTime(): number;\n    setIterationTime(time: number): this;\n    setDelay(delay: number): this;\n    getDelay(): number;\n    setFillMode(fillMode: FillModeType): this;\n    getFillMode(): FillModeType;\n    setIterationCount(iterationCount: IterationCountType): this;\n    getIterationCount(): IterationCountType;\n    setDirection(direction: DirectionType): this;\n    getDirection(): DirectionType;\n    setPlayState(playState: PlayStateType): this;\n    getPlayState(): PlayStateType;\n    setPlaySpeed(playSpeed: number): this;\n    getPlaySpeed(): number;\n    setDuration(duration: number): this;\n    getDuration(): number;\n    getEasing(): EasingType;\n    getEasingName(): string;\n}\nexport default Animator;\n","import {\n    ALIAS, TIMING_FUNCTION, TRANSFORM_NAME, EASING_NAME, NAME_SEPARATOR\n} from \"./consts\";\nimport { isRole, getType, isPropertyObject, getValueByNames, isFixed, getNames, getEasing } from \"./utils\";\nimport { toPropertyObject, splitStyle, toObject } from \"./utils/property\";\nimport {\n    isObject, isArray, isString, getKeys,\n    ANIMATION, TRANSFORM, FILTER, PROPERTY, FUNCTION, ARRAY, OBJECT, IObject, isUndefined,\n    sortOrders,\n} from \"@daybrush/utils\";\nimport { NameType, KeyValueChildren } from \"./types\";\nimport OrderMap from \"order-map\";\n\nfunction toInnerProperties(obj: IObject<string>, orders: NameType[] = []) {\n    if (!obj) {\n        return \"\";\n    }\n    const arrObj = [];\n\n    const keys = getKeys(obj);\n\n    sortOrders(keys, orders);\n\n    keys.forEach(name => {\n        arrObj.push(`${name.replace(/\\d$/g, \"\")}(${obj[name]})`);\n    });\n\n    return arrObj.join(\" \");\n}\n\n/* eslint-disable */\nfunction clone(target: IObject<any>, toValue = false) {\n    return merge({}, target, toValue);\n}\nfunction merge(to: IObject<any>, from: IObject<any>, toValue = false) {\n    for (const name in from) {\n        const value = from[name];\n        const type = getType(value);\n\n        if (type === PROPERTY) {\n            to[name] = toValue ? value.toValue() : value.clone();\n        } else if (type === FUNCTION) {\n            to[name] = toValue ? getValue([name], value) : value;\n        } else if (type === ARRAY) {\n            to[name] = value.slice();\n        } else if (type === OBJECT) {\n            if (isObject(to[name]) && !isPropertyObject(to[name])) {\n                merge(to[name], value, toValue);\n            } else {\n                to[name] = clone(value, toValue);\n            }\n        } else {\n            to[name] = from[name];\n        }\n    }\n    return to;\n}\n/* eslint-enable */\n\nfunction getPropertyName(args: NameType[]) {\n    return args[0] in ALIAS ? ALIAS[args[0]] : args;\n}\nfunction getValue(names: NameType[], value: any): any {\n    const type = getType(value);\n\n    if (type === PROPERTY) {\n        return value.toValue();\n    } else if (type === FUNCTION) {\n        if (names[0] !== TIMING_FUNCTION) {\n            return getValue(names, value());\n        }\n    } else if (type === OBJECT) {\n        return clone(value, true);\n    }\n    return value;\n}\n/**\n* Animation's Frame\n*/\nclass Frame {\n    public properties: IObject<any> = {};\n    public orderMap: OrderMap = new OrderMap(NAME_SEPARATOR);\n    /**\n     * @param - properties\n     * @example\n  const frame = new Scene.Frame({\n      display: \"none\"\n      transform: {\n          translate: \"50px\",\n          scale: \"5, 5\",\n      }\n  });\n     */\n    constructor(properties: any = {}) {\n        this.properties = {};\n        // this.orders = [];\n        this.set(properties);\n    }\n    /**\n      * get property value\n      * @param {...Number|String|PropertyObject} args - property name or value\n      * @example\n      frame.get(\"display\") // => \"none\", \"block\", ....\n      frame.get(\"transform\", \"translate\") // => \"10px,10px\"\n      */\n    public get(...args: NameType[]) {\n        const value = this.raw(...args);\n\n        return getValue(getPropertyName(args), value);\n    }\n    /**\n      * get properties orders\n      * @param - property names\n      * @example\n      frame.getOrders([\"display\"]) // => []\n      frame.getOrders([\"transform\"]) // => [\"translate\", \"scale\"]\n      */\n    public getOrders(names: NameType[]): NameType[] | undefined {\n        return this.orderMap.get(names);\n    }\n    /**\n      * set properties orders\n      * @param - property names\n      * @param - orders\n      * @example\n      frame.getOrders([\"transform\"]) // => [\"translate\", \"scale\"]\n      frame.setOrders([\"transform\"], [\"scale\", \"tralsate\"])\n      */\n    public setOrders(names: NameType[], orders: NameType[]): NameType[] {\n        return this.orderMap.set(names, orders);\n    }\n    /**\n      * get properties order object\n      * @example\n      console.log(frame.getOrderObject());\n      */\n    public getOrderObject() {\n        return this.orderMap.getObject();\n    }\n    /**\n      * set properties orders object\n      * @param - properties orders object\n      * @example\n      frame.setOrderObject({\n          \"\": [\"transform\"],\n          \"transform\": [\"scale\", \"tralsate\"],\n      });\n      */\n    public setOrderObject(obj: IObject<NameType[]>) {\n        this.orderMap.setObject(obj);\n    }\n\n    /**\n      * get property keys\n      * @param - property names\n      * @example\n      frame.gets(\"display\") // => []\n      frame.gets(\"transform\") // => [\"translate\"]\n      */\n    public getKeys(...args: NameType[]): string[] {\n        const value = this.raw(...args);\n        const keys = getType(value) === OBJECT ? getKeys(value) : [];\n\n        sortOrders(keys, this.orderMap.get(args));\n        return keys;\n    }\n    /**\n      * get properties array\n      * @param - property names\n      * @example\n      frame.gets(\"display\") // => []\n      frame.gets(\"transform\") // => [{ key: \"translate\", value: \"10px, 10px\", children: [] }]\n      */\n    public gets(...args: NameType[]): KeyValueChildren[] {\n        const values = this.get(...args);\n        const keys = this.getKeys(...args);\n\n        return keys.map(key => {\n            const nextValue = values[key];\n            return { key, value: nextValue, children: this.gets(...args, key) };\n        });\n    }\n\n    public raw(...args: NameType[]) {\n        return getValueByNames(getPropertyName(args), this.properties);\n    }\n    /**\n      * remove property value\n      * @param {...String} args - property name\n      * @return {Frame} An instance itself\n      * @example\n      frame.remove(\"display\")\n      */\n    public remove(...args: NameType[]) {\n        const params = getPropertyName(args);\n        const length = params.length;\n\n        if (!length) {\n            return this;\n        }\n        this.orderMap.remove(params);\n        const value = getValueByNames(params, this.properties, length - 1);\n\n        if (isObject(value)) {\n            delete value[params[length - 1]];\n        }\n        return this;\n    }\n    /**\n      * set property\n      * @param {...Number|String|PropertyObject} args - property names or values\n      * @return {Frame} An instance itself\n      * @example\n  // one parameter\n  frame.set({\n      display: \"none\",\n      transform: {\n          translate: \"10px, 10px\",\n          scale: \"1\",\n      },\n      filter: {\n          brightness: \"50%\",\n          grayscale: \"100%\"\n      }\n  });\n\n  // two parameters\n  frame.set(\"transform\", {\n      translate: \"10px, 10px\",\n      scale: \"1\",\n  });\n\n  // three parameters\n  frame.set(\"transform\", \"translate\", \"50px\");\n    */\n    public set(...args: any[]) {\n        const self = this;\n        const length = args.length;\n        const params = args.slice(0, -1);\n        const value = args[length - 1];\n        const firstParam = params[0];\n\n        if (length === 1 && value instanceof Frame) {\n            self.merge(value);\n        } else if (firstParam in ALIAS) {\n            self._set(ALIAS[firstParam], value);\n        } else if (length === 2 && isArray(firstParam)) {\n            self._set(firstParam, value);\n        } else if (isPropertyObject(value)) {\n            if (isRole(params)) {\n                self.set(...params, toObject(value));\n            } else {\n                self._set(params, value);\n            }\n        } else if (isArray(value)) {\n            self._set(params, value);\n        } else if (isObject(value)) {\n            if (!self.has(...params) && isRole(params)) {\n                self._set(params, {});\n            }\n            for (const name in value) {\n                self.set(...params, name, value[name]);\n            }\n        } else if (isString(value)) {\n            if (isRole(params, true)) {\n                if (isFixed(params) || !isRole(params)) {\n                    this._set(params, value);\n                } else {\n                    const obj = toPropertyObject(value);\n\n                    if (isObject(obj)) {\n                        self.set(...params, obj);\n                    }\n                }\n                return this;\n            } else {\n                const { styles, length: stylesLength } = splitStyle(value);\n\n                for (const name in styles) {\n                    self.set(...params, name, styles[name]);\n                }\n                if (stylesLength) {\n                    return this;\n                }\n            }\n            self._set(params, value);\n        } else {\n            self._set(params, value);\n        }\n        return self;\n    }\n    /**\n      * Gets the names of properties.\n      * @return the names of properties.\n      * @example\n  // one parameter\n  frame.set({\n      display: \"none\",\n      transform: {\n          translate: \"10px, 10px\",\n          scale: \"1\",\n      },\n  });\n\n  // [[\"display\"], [\"transform\", \"translate\"], [\"transform\", \"scale\"]]\n  console.log(frame.getNames());\n    */\n    public getNames(): string[][] {\n        return getNames(this.properties, []);\n    }\n    /**\n      * check that has property.\n      * @param {...String} args - property name\n      * @example\n      frame.has(\"property\", \"display\") // => true or false\n      */\n    public has(...args: NameType[]) {\n        const params = getPropertyName(args);\n        const length = params.length;\n\n        if (!length) {\n            return false;\n        }\n        return !isUndefined(getValueByNames(params, this.properties, length));\n    }\n    /**\n      * clone frame.\n      * @return {Frame} An instance of clone\n      * @example\n      frame.clone();\n      */\n    public clone() {\n        const frame = new Frame();\n\n        frame.setOrderObject(this.orderMap.orderMap);\n        return frame.merge(this);\n    }\n    /**\n      * merge one frame to other frame.\n      * @param - target frame.\n      * @return {Frame} An instance itself\n      * @example\n      frame.merge(frame2);\n      */\n    public merge(frame: Frame) {\n        const properties = this.properties;\n        const frameProperties = frame.properties;\n\n        if (frameProperties) {\n            merge(properties, frameProperties);\n        }\n        return this;\n    }\n    /**\n      * Specifies an css object that coverted the frame.\n      * @return {object} cssObject\n      */\n    public toCSSObject() {\n        const properties = this.get();\n        const cssObject: IObject<string> = {};\n\n        for (const name in properties) {\n            if (isRole([name], true)) {\n                continue;\n            }\n            const value = properties[name];\n\n            if (name === TIMING_FUNCTION) {\n                cssObject[TIMING_FUNCTION.replace(\"animation\", ANIMATION)] =\n                    (isString(value) ? value : value[EASING_NAME]) || \"initial\";\n            } else {\n                cssObject[name] = value;\n            }\n        }\n        const transform = toInnerProperties(properties[TRANSFORM_NAME], this.orderMap.get([TRANSFORM_NAME]));\n        const filter = toInnerProperties(properties.filter, this.orderMap.get([FILTER]));\n\n        TRANSFORM && transform && (cssObject[TRANSFORM] = transform);\n        FILTER && filter && (cssObject[FILTER] = filter);\n        return cssObject;\n    }\n    /**\n      * Specifies an css text that coverted the frame.\n      * @return {string} cssText\n      */\n    public toCSS() {\n        const cssObject = this.toCSSObject();\n        const cssArray = [];\n        const keys = getKeys(cssObject);\n\n        sortOrders(keys, this.orderMap.get([]));\n        keys.forEach(name => {\n            cssArray.push(`${name}:${cssObject[name]};`);\n        });\n        return cssArray.join(\"\");\n    }\n    /**\n      * Remove All Properties\n      * @return {Frame} An instance itself\n      */\n    public clear() {\n        this.properties = {};\n        this.orderMap.clear();\n        return this;\n    }\n    private _set(args: NameType[], value: any) {\n        let properties = this.properties;\n        const length = args.length;\n\n        for (let i = 0; i < length - 1; ++i) {\n            const name = args[i];\n\n            !(name in properties) && (properties[name] = {});\n            properties = properties[name];\n        }\n        if (!length) {\n            return;\n        }\n        const lastParam = args[length - 1];\n\n        this.orderMap.add(args);\n        if (length === 1 && lastParam === TIMING_FUNCTION) {\n            properties[lastParam] = getEasing(value);\n        } else {\n            properties[lastParam] = isString(value) && !isFixed(args)\n                ? toPropertyObject(value, lastParam)\n                : value;\n        }\n    }\n}\nexport default Frame;\n","\nimport PropertyObject from \"../PropertyObject\";\nimport { getType } from \"../utils\";\nimport { toPropertyObject } from \"./property\";\nimport { splitUnit, PROPERTY, FUNCTION, ARRAY, dot as dotNumber } from \"@daybrush/utils\";\nimport { EasingType } from \"../types\";\n\nfunction dotArray(a1: any[], a2: any, b1: number, b2: number): any {\n  const length = a2.length;\n\n  return a1.map((v1, i) => {\n    if (i >= length) {\n      return v1;\n    } else {\n      return dot(v1, a2[i], b1, b2);\n    }\n  });\n}\n\nfunction dotColor(color1: PropertyObject, color2: PropertyObject, b1: number, b2: number) {\n  // convert array to PropertyObject(type=color)\n  const value1 = color1.value;\n  const value2 = color2.value;\n  // If the model name is not same, the inner product is impossible.\n  const model1 = color1.model;\n  const model2 = color2.model;\n\n  if (model1 !== model2) {\n    // It is recognized as a string.\n    return dot(color1.toValue(), color2.toValue(), b1, b2);\n  }\n  if (value1.length === 3) {\n    value1[3] = 1;\n  }\n  if (value2.length === 3) {\n    value2[3] = 1;\n  }\n  const v = dotArray(value1, value2, b1, b2);\n  const colorModel = model1;\n\n  for (let i = 0; i < 3; ++i) {\n    v[i] = parseInt(v[i], 10);\n  }\n  const object = new PropertyObject(v, {\n    type: \"color\",\n    model: colorModel,\n    prefix: `${colorModel}(`,\n    suffix: \")\",\n  });\n\n  return object;\n}\n\nfunction dotObject(a1: PropertyObject, a2: PropertyObject, b1: number, b2: number) {\n  const a1Type = a1.type;\n\n  if (a1Type === \"color\") {\n    return dotColor(a1, a2, b1, b2);\n  }\n  const value1 = a1.value;\n  const value2 = a2.value;\n  const arr = dotArray(value1, value2, b1, b2);\n\n  return new PropertyObject(arr, {\n    type: a1Type,\n    separator: a1.separator || a2.separator,\n    prefix: a1.prefix || a2.prefix,\n    suffix: a1.suffix || a2.suffix,\n    model: a1.model || a2.model,\n  });\n}\n/**\n* The dot product of a1 and a2 for the b1 and b2.\n* @memberof Dot\n* @function dot\n* @param {String|Number|PropertyObject} a1 value1\n* @param {String|Number|PropertyObject} a2 value2\n* @param {Number} b1 b1 ratio\n* @param {Number} b2 b2 ratio\n* @return {String} Not Array, Not Separator, Only Number & Unit\n* @return {PropertyObject} Array with Separator.\n* @example\ndot(1, 3, 0.3, 0.7);\n// => 1.6\n*/\nexport function dot(a1: any, a2: any, b1: number, b2: number): any {\n  if (b2 === 0) {\n    return a2;\n  } else if (b1 === 0 || b1 + b2 === 0) {\n    // prevent division by zero.\n    return a1;\n  }\n  // dot Object\n\n  const type1 = getType(a1);\n  const type2 = getType(a2);\n  const isFunction1 = type1 === FUNCTION;\n  const isFunction2 = type2 === FUNCTION;\n\n  if (isFunction1 || isFunction2) {\n    return () => {\n      return dot(isFunction1 ? toPropertyObject(a1()) : a1, isFunction2 ? toPropertyObject(a2()) : a2, b1, b2);\n    };\n  } else if (type1 === type2) {\n    if (type1 === PROPERTY) {\n      return dotObject(a1, a2, b1, b2);\n    } else if (type1 === ARRAY) {\n      return dotArray(a1, a2, b1, b2);\n    } else if (type1 !== \"value\") {\n      return a1;\n    }\n  } else {\n    return a1;\n  }\n  const v1 = splitUnit(`${a1}`);\n  const v2 = splitUnit(`${a2}`);\n  let v;\n\n  // 숫자가 아닐경우 첫번째 값을 반환 b2가 0일경우 두번째 값을 반환\n  if (isNaN(v1.value) || isNaN(v2.value)) {\n    return a1;\n  } else {\n    v = dotNumber(v1.value, v2.value, b1, b2);\n  }\n  const prefix = v1.prefix || v2.prefix;\n  const unit = v1.unit || v2.unit;\n\n  if (!prefix && !unit) {\n    return v;\n  }\n  return prefix + v + unit;\n}\n\nexport function dotValue(\n  time: number,\n  prevTime: number,\n  nextTime: number,\n  prevValue: any,\n  nextValue: any,\n  easing?: EasingType) {\n  if (time === prevTime) {\n    return prevValue;\n  } else if (time === nextTime) {\n    return nextValue;\n  } else if (!easing) {\n    return dot(prevValue, nextValue, time - prevTime, nextTime - time);\n  }\n  const ratio = easing((time - prevTime) / (nextTime - prevTime));\n  const value = dot(prevValue, nextValue, ratio, 1 - ratio);\n\n  return value;\n}\n","import Animator, { isDirectionReverse } from \"./Animator\";\nimport Frame from \"./Frame\";\nimport {\n    toFixed,\n    isFixed,\n    playCSS,\n    toId,\n    getRealId,\n    makeId,\n    isPausedCSS,\n    isRole,\n    getValueByNames,\n    isEndedCSS,\n    setPlayCSS,\n    getNames,\n    updateFrame,\n} from \"./utils\";\nimport { dotValue } from \"./utils/dot\";\nimport {\n    START_ANIMATION,\n    PREFIX, THRESHOLD,\n    TIMING_FUNCTION, ALTERNATE, ALTERNATE_REVERSE, INFINITE,\n    REVERSE, EASING, FILL_MODE, DIRECTION, ITERATION_COUNT,\n    EASING_NAME, DELAY, PLAY_SPEED, DURATION, PAUSE_ANIMATION,\n    DATA_SCENE_ID, SELECTOR, ROLES, NAME_SEPARATOR\n} from \"./consts\";\nimport {\n    isObject, isArray, isUndefined, decamelize,\n    ANIMATION, fromCSS, addClass, removeClass, hasClass,\n    KEYFRAMES, isFunction,\n    IObject, $, splitComma, toArray, isString, IArrayFormat,\n    dot as dotNumber,\n    find,\n    findIndex,\n    getKeys,\n    sortOrders,\n} from \"@daybrush/utils\";\nimport {\n    NameType, AnimateElement, AnimatorState,\n    SceneItemState, SceneItemOptions, EasingType, PlayCondition, DirectionType, SceneItemEvents\n} from \"./types\";\nimport OrderMap from \"order-map\";\nimport styled, { InjectResult, StyledInjector } from \"css-styled\";\n\nfunction getNearTimeIndex(times: number[], time: number) {\n    const length = times.length;\n\n    for (let i = 0; i < length; ++i) {\n        if (times[i] === time) {\n            return [i, i];\n        } else if (times[i] > time) {\n            return [i > 0 ? i - 1 : 0, i];\n        }\n    }\n    return [length - 1, length - 1];\n}\nfunction makeAnimationProperties(properties: object) {\n    const cssArray = [];\n\n    for (const name in properties) {\n        cssArray.push(`${ANIMATION}-${decamelize(name)}:${properties[name]};`);\n    }\n    return cssArray.join(\"\");\n}\nfunction addTime(times: number[], time: number) {\n    const length = times.length;\n    for (let i = 0; i < length; ++i) {\n        if (time < times[i]) {\n            times.splice(i, 0, time);\n            return;\n        }\n    }\n    times[length] = time;\n}\nfunction addEntry(entries: number[][], time: number, keytime: number) {\n    const prevEntry = entries[entries.length - 1];\n\n    (!prevEntry || prevEntry[0] !== time || prevEntry[1] !== keytime) &&\n        entries.push([toFixed(time), toFixed(keytime)]);\n}\nexport function getEntries(times: number[], states: AnimatorState[]) {\n    let entries = times.map(time => ([time, time]));\n    let nextEntries = [];\n\n    states.forEach(state => {\n        const iterationCount = state[ITERATION_COUNT] as number;\n        const delay = state[DELAY];\n        const playSpeed = state[PLAY_SPEED];\n        const direction = state[DIRECTION];\n        const intCount = Math.ceil(iterationCount);\n        const currentDuration = entries[entries.length - 1][0];\n        const length = entries.length;\n        const lastTime = currentDuration * iterationCount;\n\n        for (let i = 0; i < intCount; ++i) {\n            const isReverse =\n                direction === REVERSE ||\n                direction === ALTERNATE && i % 2 ||\n                direction === ALTERNATE_REVERSE && !(i % 2);\n\n            for (let j = 0; j < length; ++j) {\n                const entry = entries[isReverse ? length - j - 1 : j];\n                const time = entry[1];\n                const currentTime = currentDuration * i + (isReverse ? currentDuration - entry[0] : entry[0]);\n                const prevEntry = entries[isReverse ? length - j : j - 1];\n\n                if (currentTime > lastTime) {\n                    if (j !== 0) {\n                        const prevTime = currentDuration * i +\n                            (isReverse ? currentDuration - prevEntry[0] : prevEntry[0]);\n                        const divideTime = dotNumber(prevEntry[1], time, lastTime - prevTime, currentTime - lastTime);\n\n                        addEntry(nextEntries, (delay + currentDuration * iterationCount) / playSpeed, divideTime);\n                    }\n                    break;\n                } else if (\n                    currentTime === lastTime\n                    && nextEntries.length\n                    && nextEntries[nextEntries.length - 1][0] === lastTime + delay\n                ) {\n                    break;\n                }\n                addEntry(nextEntries, (delay + currentTime) / playSpeed, time);\n            }\n        }\n        // delay time\n        delay && nextEntries.unshift([0, nextEntries[0][1]]);\n\n        entries = nextEntries;\n        nextEntries = [];\n    });\n\n    return entries;\n}\n/**\n* manage Frame Keyframes and play keyframes.\n* @extends Animator\n* @example\nconst item = new SceneItem({\n\t0: {\n\t\tdisplay: \"none\",\n\t},\n\t1: {\n\t\tdisplay: \"block\",\n\t\topacity: 0,\n\t},\n\t2: {\n\t\topacity: 1,\n\t}\n});\n*/\nclass SceneItem extends Animator<SceneItemOptions, SceneItemState, SceneItemEvents> {\n    public times: number[] = [];\n    public items: IObject<Frame> = {};\n    public nameMap = new OrderMap(NAME_SEPARATOR);\n    public elements: AnimateElement[] = [];\n    public styled: StyledInjector;\n    public styledInjector: InjectResult;\n    public temp: Frame;\n    private needUpdate: boolean = true;\n    private target: any;\n    private targetFunc: (frame: Frame) => void;\n\n    /**\n      * @param - properties\n      * @param - options\n      * @example\n      const item = new SceneItem({\n          0: {\n              display: \"none\",\n          },\n          1: {\n              display: \"block\",\n              opacity: 0,\n          },\n          2: {\n              opacity: 1,\n          }\n      });\n       */\n    constructor(properties?: any, options?: Partial<SceneItemOptions>) {\n        super();\n        this.load(properties, options);\n    }\n    public getDuration() {\n        const times = this.times;\n        const length = times.length;\n\n        return (length === 0 ? 0 : times[length - 1]) || this.state[DURATION];\n    }\n    /**\n      * get size of list\n      * @return {Number} length of list\n      */\n    public size() {\n        return this.times.length;\n    }\n    public setDuration(duration: number) {\n        if (!duration) {\n            return this;\n        }\n        const originalDuration = this.getDuration();\n\n        if (originalDuration > 0) {\n            const ratio = duration / originalDuration;\n            const { times, items } = this;\n            const obj: IObject<Frame> = {};\n\n            this.times = times.map(time => {\n                const time2 = toFixed(time * ratio);\n\n                obj[time2] = items[time];\n\n                return time2;\n            });\n            this.items = obj;\n        } else {\n            this.newFrame(duration);\n        }\n        return this;\n    }\n    public setId(id?: number | string) {\n        const state = this.state;\n        const elements = this.elements;\n        const length = elements.length;\n\n        state.id = id || makeId(!!length);\n\n        if (length && !state[SELECTOR]) {\n            const sceneId = toId(this.getId());\n\n            state[SELECTOR] = `[${DATA_SCENE_ID}=\"${sceneId}\"]`;\n            elements.forEach(element => {\n                element.setAttribute(DATA_SCENE_ID, sceneId);\n            });\n        }\n        return this;\n    }\n\n    /**\n      * Set properties to the sceneItem at that time\n      * @param {Number} time - time\n      * @param {...String|Object} [properties] - property names or values\n      * @return {SceneItem} An instance itself\n      * @example\n  item.set(0, \"a\", \"b\") // item.getFrame(0).set(\"a\", \"b\")\n  console.log(item.get(0, \"a\")); // \"b\"\n      */\n    public set(time: any, ...args: any[]) {\n        if (time instanceof SceneItem) {\n            return this.set(0, time);\n        } else if (isArray(time)) {\n            const length = time.length;\n\n            for (let i = 0; i < length; ++i) {\n                const t = length === 1 ? 0 : this.getUnitTime(`${i / (length - 1) * 100}%`);\n\n                this.set(t, time[i]);\n            }\n        } else if (isObject(time)) {\n            for (const t in time) {\n                const value = time[t];\n\n                splitComma(t).forEach(eachTime => {\n                    const realTime = this.getUnitTime(eachTime);\n\n                    if (isNaN(realTime)) {\n                        getNames(value, [eachTime]).forEach(names => {\n                            const innerValue = getValueByNames(names.slice(1), value);\n                            const arr = isArray(innerValue) ?\n                                innerValue : [getValueByNames(names, this.target), innerValue];\n                            const length = arr.length;\n\n                            for (let i = 0; i < length; ++i) {\n                                this.newFrame(`${i / (length - 1) * 100}%`).set(...names, arr[i]);\n                            }\n                        });\n                    } else {\n                        this.set(realTime, value);\n                    }\n                });\n            }\n        } else if (!isUndefined(time)) {\n            const value = args[0];\n\n            splitComma(time + \"\").forEach(eachTime => {\n                const realTime = this.getUnitTime(eachTime);\n\n                if (value instanceof SceneItem) {\n                    const delay = value.getDelay();\n                    const frames = value.toObject(!this.hasFrame(realTime + delay));\n                    const duration = value.getDuration();\n                    const direction = value.getDirection();\n                    const isReverse = direction.indexOf(\"reverse\") > -1;\n\n                    for (const frameTime in frames) {\n                        const nextTime = isReverse ? duration - parseFloat(frameTime) : parseFloat(frameTime);\n                        this.set(realTime + nextTime, frames[frameTime]);\n                    }\n                } else if (args.length === 1 && isArray(value)) {\n                    value.forEach((item: any) => {\n                        this.set(realTime, item);\n                    });\n                } else {\n                    const frame = this.newFrame(realTime);\n\n                    frame.set(...args);\n                }\n            });\n        }\n        this.needUpdate = true;\n        return this;\n    }\n    /**\n      * Get properties of the sceneItem at that time\n      * @param {Number} time - time\n      * @param {...String|Object} args property's name or properties\n      * @return {Number|String|PropertyObejct} property value\n      * @example\n  item.get(0, \"a\"); // item.getFrame(0).get(\"a\");\n  item.get(0, \"transform\", \"translate\"); // item.getFrame(0).get(\"transform\", \"translate\");\n      */\n    public get(time: string | number, ...args: NameType[]) {\n        const frame = this.getFrame(time);\n\n        return frame && frame.get(...args);\n    }\n    /**\n      * get properties orders\n      * @param - property names\n      * @example\n      item.getOrders([\"display\"]) // => []\n      item.getOrders([\"transform\"]) // => [\"translate\", \"scale\"]\n      */\n    public getOrders(names: NameType[]): NameType[] | undefined {\n        this.needUpdate && this.update();\n\n        return this.nameMap.get(names);\n    }\n    /**\n      * set properties orders\n      * @param - property names\n      * @param - orders\n      * @example\n      item.getOrders([\"transform\"]) // => [\"translate\", \"scale\"]\n      item.setOrders([\"transform\"], [\"scale\", \"tralsate\"])\n      */\n    public setOrders(names: NameType[], orders: NameType[]): NameType[] {\n        this.needUpdate && this.update();\n\n        const result = this.nameMap.set(names, orders);\n\n        this.updateFrameOrders();\n\n        return result;\n    }\n    /**\n      * get properties order object\n      * @example\n      console.log(item.getOrderObject());\n      */\n     public getOrderObject() {\n        return this.nameMap.getObject();\n    }\n    /**\n      * set properties orders object\n      * @param - properties orders object\n      * @example\n      item.setOrderObject({\n          \"\": [\"transform\"],\n          \"transform\": [\"scale\", \"tralsate\"],\n      });\n      */\n    public setOrderObject(obj: IObject<NameType[]>) {\n        this.nameMap.setObject(obj);\n\n        this.updateFrameOrders();\n    }\n    public remove(time: string | number, ...args: any[]): this;\n    /**\n      * remove properties to the sceneItem at that time\n      * @param {Number} time - time\n      * @param {...String|Object} [properties] - property names or values\n      * @return {SceneItem} An instance itself\n      * @example\n  item.remove(0, \"a\");\n      */\n    public remove(time: string | number, ...args: NameType[]) {\n        if (args.length) {\n            const frame = this.getFrame(time);\n\n            frame && frame.remove(...args);\n        } else {\n            this.removeFrame(time);\n        }\n        this.needUpdate = true;\n        return this;\n    }\n    /**\n      * Append the item or object at the last time.\n      * @param - the scene item or item object\n      * @return An instance itself\n      * @example\n  item.append(new SceneItem({\n      0: {\n          opacity: 0,\n      },\n      1: {\n          opacity: 1,\n      }\n  }));\n  item.append({\n      0: {\n          opacity: 0,\n      },\n      1: {\n          opacity: 1,\n      }\n  });\n  item.set(item.getDuration(), {\n      0: {\n          opacity: 0,\n      },\n      1: {\n          opacity: 1,\n      }\n  });\n      */\n    public append(item: SceneItem | IObject<any>) {\n        if (item instanceof SceneItem) {\n            this.set(this.getDuration(), item);\n        } else {\n            this.append(new SceneItem(item));\n        }\n        return this;\n    }\n    /**\n      * Push the front frames for the time and prepend the scene item or item object.\n      * @param - the scene item or item object\n      * @return An instance itself\n      */\n    public prepend(item: SceneItem | IObject<any>) {\n        if (item instanceof SceneItem) {\n            const unshiftTime = item.getDuration() + item.getDelay();\n            const firstFrame = this.getFrame(0);\n            // remove first frame\n            this.removeFrame(0);\n            this.unshift(unshiftTime);\n            this.set(0, item);\n            this.set(unshiftTime + THRESHOLD, firstFrame);\n        } else {\n            this.prepend(new SceneItem(item));\n        }\n        return this;\n    }\n    /**\n     * Push out the amount of time.\n     * @param - time to push\n     * @example\n   item.get(0); // frame 0\n   item.unshift(3);\n   item.get(3) // frame 0\n     */\n    public unshift(time: number) {\n        const { times, items } = this;\n        const obj: IObject<Frame> = {};\n\n        this.times = times.map(t => {\n            const time2 = toFixed(time + t);\n\n            obj[time2] = items[t];\n            return time2;\n        });\n        this.items = obj;\n        return this;\n    }\n    /**\n     * Get the frames in the item in object form.\n     * @return {}\n     * @example\n item.toObject();\n // {0: {display: \"none\"}, 1: {display: \"block\"}}\n     */\n    public toObject(isStartZero = true): IObject<Frame> {\n        const obj: IObject<Frame> = {};\n        const delay = this.getDelay();\n\n        this.forEach((frame: Frame, time: number) => {\n            obj[(!time && !isStartZero ? THRESHOLD : 0) + delay + time] = frame.clone();\n        });\n        return obj;\n    }\n    /**\n     * Specifies an element to synchronize items' keyframes.\n     * @param {string} selectors - Selectors to find elements in items.\n     * @return {SceneItem} An instance itself\n     * @example\nitem.setSelector(\"#id.class\");\n     */\n    public setSelector(target: string | boolean | ((id: number | string) => string)) {\n        if (isFunction(target)) {\n            this.setElement(target(this.getId()));\n        } else {\n            this.setElement(target);\n        }\n        return this;\n    }\n    /**\n     * Get the elements connected to SceneItem.\n     */\n    public getElements(): AnimateElement[] {\n        return this.elements;\n    }\n    /**\n     * Specifies an element to synchronize item's keyframes.\n     * @param - elements to synchronize item's keyframes.\n     * @param - Make sure that you have peusdo.\n     * @return {SceneItem} An instance itself\n     * @example\nitem.setElement(document.querySelector(\"#id.class\"));\nitem.setElement(document.querySelectorAll(\".class\"));\n     */\n    public setElements(target: boolean | string | AnimateElement | IArrayFormat<AnimateElement>): this {\n        return this.setElement(target);\n    }\n    /**\n     * Specifies an element to synchronize item's keyframes.\n     * @param - elements to synchronize item's keyframes.\n     * @param - Make sure that you have peusdo.\n     * @return {SceneItem} An instance itself\n     * @example\nitem.setElement(document.querySelector(\"#id.class\"));\nitem.setElement(document.querySelectorAll(\".class\"));\n     */\n    public setElement(target: boolean | string | AnimateElement | IArrayFormat<AnimateElement>) {\n        const state = this.state;\n        let elements: AnimateElement[] = [];\n\n        if (!target) {\n            return this;\n        } else if (target === true || isString(target)) {\n            const selector = target === true ? `${state.id}` : target;\n            const matches = /([\\s\\S]+)(:+[a-zA-Z]+)$/g.exec(selector);\n\n            elements = toArray($(matches ? matches[1] : selector, true));\n            state[SELECTOR] = selector;\n        } else {\n            elements = (target instanceof Element) ? [target] : toArray(target);\n        }\n        if (!elements.length) {\n            return this;\n        }\n        this.elements = elements;\n        this.setId(this.getId());\n        this.target = elements[0].style;\n        this.targetFunc = (frame: Frame) => {\n            const attributes = frame.get(\"attribute\");\n\n            if (attributes) {\n                for (const name in attributes) {\n                    elements.forEach(el => {\n                        el.setAttribute(name, attributes[name]);\n                    });\n                }\n            }\n            if (frame.has(\"html\")) {\n                const html = frame.get(\"html\");\n\n                elements.forEach(el => {\n                    el.innerHTML = html;\n                });\n            }\n            const cssText = frame.toCSS();\n\n            if (state.cssText !== cssText) {\n                state.cssText = cssText;\n\n                elements.forEach(el => {\n                    el.style.cssText += cssText;\n                });\n                return frame;\n            }\n        };\n        return this;\n    }\n    public setTarget(target: any): this {\n        this.target = target;\n        this.targetFunc = (frame: Frame) => {\n            const obj = frame.get();\n\n            for (const name in obj) {\n                target[name] = obj[name];\n            }\n        };\n        return this;\n    }\n    /**\n      * add css styles of items's element to the frame at that time.\n      * @param - Time to synchronize and set css\n      * @param - elements to synchronize item's keyframes.\n      * @return {SceneItem} An instance itself\n      * @example\n  item.setElement(document.querySelector(\"#id.class\"));\n  item.setCSS(0, [\"opacity\"]);\n  item.setCSS(0, [\"opacity\", \"width\", \"height\"]);\n      */\n    public setCSS(time: number, properties: string[] = []) {\n        this.set(time, fromCSS(this.elements, properties));\n        return this;\n    }\n    public setTime(time: number | string, isTick?: boolean, isParent?: boolean, parentEasing?: EasingType) {\n        super.setTime(time, isTick, isParent);\n\n        const iterationTime = this.getIterationTime();\n        const easing = this.getEasing() || parentEasing;\n        const frame = this.getNowFrame(iterationTime, easing);\n        const currentTime = this.getTime();\n\n        this.temp = frame;\n        /**\n         * This event is fired when timeupdate and animate.\n         * @event SceneItem#animate\n         * @param {Number} param.currentTime The total time that the animator is running.\n         * @param {Number} param.time The iteration time during duration that the animator is running.\n         * @param {Frame} param.frame frame of that time.\n         */\n        this.trigger(\"animate\", {\n            frame,\n            currentTime,\n            time: iterationTime,\n        });\n        this.targetFunc && this.targetFunc(frame);\n        return this;\n    }\n    /**\n      * update property names used in frames.\n      * @return {SceneItem} An instance itself\n      * @example\n  item.update();\n      */\n    public update() {\n        const prevNameMap = this.nameMap;\n        const names = {};\n        this.forEach(frame => {\n            updateFrame(names, frame.properties);\n        });\n\n        const nameMap = new OrderMap(NAME_SEPARATOR);\n\n        function pushKeys(map: IObject<any>, stack: NameType[]) {\n            const keys = getKeys(map);\n\n            sortOrders(keys, prevNameMap.get(stack));\n\n            nameMap.set(stack, keys);\n            keys.forEach(key => {\n                const nextMap = map[key];\n                if (isObject(nextMap)) {\n                    pushKeys(nextMap, [...stack, key]);\n                }\n            });\n        }\n        pushKeys(names, []);\n\n        this.nameMap = nameMap;\n\n        this.forEach(frame => {\n            frame.setOrderObject(nameMap.orderMap);\n        });\n        this.needUpdate = false;\n        return this;\n    }\n    /**\n      * Create and add a frame to the sceneItem at that time\n      * @param {Number} time - frame's time\n      * @return {Frame} Created frame.\n      * @example\n  item.newFrame(time);\n      */\n    public newFrame(time: string | number) {\n        let frame = this.getFrame(time);\n\n        if (frame) {\n            return frame;\n        }\n        frame = new Frame();\n\n        this.setFrame(time, frame);\n        return frame;\n    }\n    /**\n      * Add a frame to the sceneItem at that time\n      * @param {Number} time - frame's time\n      * @return {SceneItem} An instance itself\n      * @example\n  item.setFrame(time, frame);\n      */\n    public setFrame(time: string | number, frame: Frame) {\n        const realTime = this.getUnitTime(time);\n\n        this.items[realTime] = frame;\n        addTime(this.times, realTime);\n        this.needUpdate = true;\n        return this;\n    }\n    public getFrame(time: number | string, ...names: any[]): Frame;\n    /**\n      * get sceneItem's frame at that time\n      * @param {Number} time - frame's time\n      * @return {Frame} sceneItem's frame at that time\n      * @example\n  const frame = item.getFrame(time);\n      */\n    public getFrame(time: number | string) {\n        return this.items[this.getUnitTime(time)];\n    }\n    public removeFrame(time: number | string, ...names: any[]): this;\n    /**\n      * remove sceneItem's frame at that time\n      * @param - frame's time\n      * @return {SceneItem} An instance itself\n      * @example\n  item.removeFrame(time);\n      */\n    public removeFrame(time: number | string) {\n        const realTime = this.getUnitTime(time);\n        const items = this.items;\n        const index = this.times.indexOf(realTime);\n\n        delete items[realTime];\n\n        // remove time\n        if (index > -1) {\n            this.times.splice(index, 1);\n        }\n        this.needUpdate = true;\n        return this;\n    }\n    /**\n      * check if the item has a frame at that time\n      * @param {Number} time - frame's time\n      * @return {Boolean} true: the item has a frame // false: not\n      * @example\n  if (item.hasFrame(10)) {\n      // has\n  } else {\n      // not\n  }\n      */\n    public hasFrame(time: number | string) {\n        return this.getUnitTime(time) in this.items;\n    }\n    /**\n      * Check if keyframes has propery's name\n      * @param - property's time\n      * @return {boolean} true: if has property, false: not\n      * @example\n    item.hasName([\"transform\", \"translate\"]); // true or not\n      */\n    public hasName(args: string[]) {\n        this.needUpdate && this.update();\n        return !!this.nameMap.get(args);\n    }\n    /**\n      * merge frame of the previous time at the next time.\n    * @param - The time of the frame to merge\n    * @param - The target frame\n      * @return {SceneItem} An instance itself\n      * @example\n  // getFrame(1) contains getFrame(0)\n  item.merge(0, 1);\n      */\n    public mergeFrame(time: number | string, frame: Frame) {\n        if (frame) {\n            const toFrame = this.newFrame(time);\n\n            toFrame.merge(frame);\n        }\n        return this;\n    }\n    /**\n      * Get frame of the current time\n      * @param {Number} time - the current time\n      * @param {function} easing - the speed curve of an animation\n      * @return {Frame} frame of the current time\n      * @example\n  let item = new SceneItem({\n      0: {\n          display: \"none\",\n      },\n      1: {\n          display: \"block\",\n          opacity: 0,\n      },\n      2: {\n          opacity: 1,\n      }\n  });\n  // opacity: 0.7; display:\"block\";\n  const frame = item.getNowFrame(1.7);\n      */\n    public getNowFrame(time: number, easing?: EasingType, isAccurate?: boolean) {\n        this.needUpdate && this.update();\n        const frame = new Frame();\n        const [left, right] = getNearTimeIndex(this.times, time);\n        let realEasing = this.getEasing() || easing;\n        let nameMap = this.nameMap;\n\n        if (this.hasName([TIMING_FUNCTION])) {\n            const nowEasing = this.getNowValue(time, [TIMING_FUNCTION], left, right, false, 0, true);\n\n            isFunction(nowEasing) && (realEasing = nowEasing);\n        }\n        if (isAccurate) {\n            const prevFrame = this.getFrame(time);\n            const prevOrderMap = prevFrame.orderMap.filter([], orders => {\n                return prevFrame.has(...orders);\n            });\n\n            for (const name in ROLES) {\n                const orders = nameMap.get([name]);\n                if (prevOrderMap.get([name]) && orders) {\n                    prevOrderMap.set([name], orders);\n                }\n            }\n            nameMap = prevOrderMap;\n        }\n        const names = nameMap.gets([]);\n\n        frame.setOrderObject(nameMap.orderMap);\n        names.forEach(properties => {\n            const value = this.getNowValue(time, properties, left, right, isAccurate, realEasing, isFixed(properties));\n\n            if (isUndefined(value)) {\n                return;\n            }\n            frame.set(properties, value);\n        });\n        return frame;\n    }\n    public load(properties: any = {}, options = properties.options) {\n        options && this.setOptions(options);\n\n        if (isArray(properties)) {\n            this.set(properties);\n        } else if (properties.keyframes) {\n            this.set(properties.keyframes);\n        } else {\n            for (const time in properties) {\n                if (time !== \"options\") {\n                    this.set({\n                        [time]: properties[time],\n                    });\n                }\n            }\n        }\n        if (options && options[DURATION]) {\n            this.setDuration(options[DURATION]);\n        }\n        return this;\n    }\n    /**\n       * clone SceneItem.\n       * @return {SceneItem} An instance of clone\n       * @example\n       * item.clone();\n       */\n    public clone() {\n        const item = new SceneItem();\n\n        item.setOptions(this.state);\n        item.setOrderObject(this.nameMap.orderMap);\n\n        this.forEach((frame: Frame, time: number) => {\n            item.setFrame(time, frame.clone());\n        });\n        return item;\n    }\n    /**\n       * executes a provided function once for each scene item.\n       * @param - Function to execute for each element, taking three arguments\n       * @return {Keyframes} An instance itself\n       */\n    public forEach(callback: (item: Frame, time: number, items: IObject<Frame>) => void) {\n        const times = this.times;\n        const items = this.items;\n\n        times.forEach(time => {\n            callback(items[time], time, items);\n        });\n        return this;\n    }\n    public setOptions(options: Partial<SceneItemOptions> = {}) {\n        super.setOptions(options);\n        const { id, selector, elements, element, target } = options;\n\n        id && this.setId(id);\n        if (target) {\n            this.setTarget(target);\n        } else if (selector) {\n            this.setSelector(selector);\n        } else if (elements || element) {\n            this.setElement(elements || element);\n        }\n        return this;\n    }\n    public toCSS(\n        playCondition: PlayCondition = { className: START_ANIMATION },\n        parentDuration = this.getDuration(), states: AnimatorState[] = []) {\n        const itemState = this.state;\n        const selector = itemState[SELECTOR];\n\n        if (!selector) {\n            return \"\";\n        }\n        const originalDuration = this.getDuration();\n        itemState[DURATION] = originalDuration;\n        states.push(itemState);\n\n        const reversedStates = toArray(states).reverse();\n        const id = toId(getRealId(this));\n        const superParent = states[0];\n        const infiniteIndex = findIndex(reversedStates, state => {\n            return state[ITERATION_COUNT] === INFINITE || !isFinite(state[DURATION]);\n        }, states.length - 1);\n        const finiteStates = reversedStates.slice(0, infiniteIndex);\n        const duration = parentDuration || finiteStates.reduce((prev, cur) => {\n            return (cur[DELAY] + prev * (cur[ITERATION_COUNT] as number)) / cur[PLAY_SPEED];\n        }, originalDuration);\n        const delay = reversedStates.slice(infiniteIndex).reduce((prev, cur) => {\n            return (prev + cur[DELAY]) / cur[PLAY_SPEED];\n        }, 0);\n        const easingName = find(reversedStates, state => (state[EASING] && state[EASING_NAME]), itemState)[EASING_NAME];\n        const iterationCount = reversedStates[infiniteIndex][ITERATION_COUNT];\n        const fillMode = superParent[FILL_MODE];\n        const direction = reversedStates[infiniteIndex][DIRECTION];\n        const cssText = makeAnimationProperties({\n            fillMode,\n            direction,\n            iterationCount,\n            delay: `${delay}s`,\n            name: `${PREFIX}KEYFRAMES_${id}`,\n            duration: `${duration / superParent[PLAY_SPEED]}s`,\n            timingFunction: easingName,\n        });\n        const selectors = splitComma(selector).map(sel => {\n            const matches = /([\\s\\S]+)(:+[a-zA-Z]+)$/g.exec(sel);\n\n            if (matches) {\n                return [matches[1], matches[2]];\n            } else {\n                return [sel, \"\"];\n            }\n        });\n        const className = playCondition.className;\n        const selectorCallback = playCondition.selector;\n        const preselector = isFunction(selectorCallback) ? selectorCallback(this, selector) : selectorCallback;\n\n        return `\n    ${preselector || selectors.map(([sel, peusdo]) => `${sel}.${className}${peusdo}`)} {${cssText}}\n    ${selectors.map(([sel, peusdo]) => `${sel}.${PAUSE_ANIMATION}${peusdo}`)} {${ANIMATION}-play-state: paused;}\n    @${KEYFRAMES} ${PREFIX}KEYFRAMES_${id}{${this._toKeyframes(duration, finiteStates, direction)}}`;\n    }\n    /**\n     * Export the CSS of the items to the style.\n     * @param - Add a selector or className to play.\n     * @return {SceneItem} An instance itself\n     */\n    public exportCSS(\n        playCondition?: PlayCondition,\n        duration?: number, options?: AnimatorState[]) {\n        if (!this.elements.length) {\n            return \"\";\n        }\n        const css = this.toCSS(playCondition, duration, options);\n        const isParent = options && !isUndefined(options[ITERATION_COUNT]);\n\n        if (!isParent) {\n            if (this.styledInjector) {\n                this.styledInjector.destroy();\n                this.styledInjector = null;\n            }\n            this.styled = styled(css);\n            this.styledInjector = this.styled.inject(this.getAnimationElement(), { original: true });\n        }\n        return this;\n    }\n    public pause() {\n        super.pause();\n        isPausedCSS(this) && this.pauseCSS();\n        return this;\n    }\n    public pauseCSS() {\n        this.elements.forEach(element => {\n            addClass(element, PAUSE_ANIMATION);\n        });\n        return this;\n    }\n    public endCSS() {\n        this.elements.forEach(element => {\n            removeClass(element, PAUSE_ANIMATION);\n            removeClass(element, START_ANIMATION);\n        });\n        setPlayCSS(this, false);\n        return this;\n    }\n    public end() {\n        isEndedCSS(this) && this.endCSS();\n        super.end();\n        return this;\n    }\n    /**\n      * Play using the css animation and keyframes.\n      * @param - Check if you want to export css.\n      * @param [playClassName=\"startAnimation\"] - Add a class name to play.\n      * @param - The shorthand properties for six of the animation properties.\n      * @see {@link https://www.w3schools.com/cssref/css3_pr_animation.asp}\n      * @example\n  item.playCSS();\n  item.playCSS(false, \"startAnimation\", {\n      direction: \"reverse\",\n      fillMode: \"forwards\",\n  });\n      */\n    public playCSS(isExportCSS = true, playClassName?: string, properties: object = {}) {\n        playCSS(this, isExportCSS, playClassName, properties);\n        return this;\n    }\n    public getAnimationElement(): AnimateElement {\n        return this.elements[0];\n    }\n    public addPlayClass(isPaused: boolean, playClassName?: string, properties: object = {}) {\n        const elements = this.elements;\n        const length = elements.length;\n        const cssText = makeAnimationProperties(properties);\n\n        if (!length) {\n            return;\n        }\n        if (isPaused) {\n            elements.forEach(element => {\n                removeClass(element, PAUSE_ANIMATION);\n            });\n        } else {\n            elements.forEach(element => {\n                element.style.cssText += cssText;\n\n                if (hasClass(element, START_ANIMATION)) {\n                    removeClass(element, START_ANIMATION);\n                }\n            });\n            elements.forEach(element => {\n                element.clientWidth;\n            });\n            elements.forEach(element => {\n                addClass(element, START_ANIMATION);\n            });\n        }\n        return elements[0];\n    }\n    /**\n      * Clear All Frames\n      * @return {SceneItem} An instance itself\n      */\n    public clear() {\n        this.times = [];\n        this.items = {};\n        this.nameMap = new OrderMap(NAME_SEPARATOR);\n\n        if (this.styledInjector) {\n            this.styledInjector.destroy();\n        }\n        this.styled = null;\n        this.styledInjector = null;\n        this.temp = null;\n        this.needUpdate = true;\n        return this;\n    }\n    public getNowValue(\n        time: number,\n        properties: NameType[],\n        left?: number,\n        right?: number,\n        isAccurate?: boolean,\n        easing?: EasingType,\n        usePrevValue?: boolean,\n    ) {\n        const times = this.times;\n        const length = times.length;\n\n        let prevTime: number;\n        let nextTime: number;\n        let prevFrame: Frame;\n        let nextFrame: Frame;\n        const isUndefinedLeft = isUndefined(left);\n        const isUndefinedRight = isUndefined(right);\n        if (isUndefinedLeft || isUndefinedRight) {\n            const indicies = getNearTimeIndex(times, time);\n            isUndefinedLeft && (left = indicies[0]);\n            isUndefinedRight && (right = indicies[1]);\n        }\n\n        for (let i = left; i >= 0; --i) {\n            const frame = this.getFrame(times[i]);\n\n            if (frame.has(...properties)) {\n                prevTime = times[i];\n                prevFrame = frame;\n                break;\n            }\n        }\n        const prevValue = prevFrame && prevFrame.raw(...properties);\n\n        if (isAccurate && !isRole([properties[0]])) {\n            return prevTime === time ? prevValue : undefined;\n        }\n        if (usePrevValue) {\n            return prevValue;\n        }\n        for (let i = right; i < length; ++i) {\n            const frame = this.getFrame(times[i]);\n\n            if (frame.has(...properties)) {\n                nextTime = times[i];\n                nextFrame = frame;\n                break;\n            }\n        }\n        const nextValue = nextFrame && nextFrame.raw(...properties);\n\n        if (!prevFrame || isUndefined(prevValue)) {\n            return nextValue;\n        }\n        if (!nextFrame || isUndefined(nextValue) || prevValue === nextValue) {\n            return prevValue;\n        }\n        return dotValue(time, Math.max(prevTime, 0), nextTime, prevValue, nextValue, easing);\n    }\n    private _toKeyframes(duration: number, states: AnimatorState[], direction: DirectionType) {\n        const frames: IObject<string> = {};\n        const times = this.times.slice();\n\n        if (!times.length) {\n            return \"\";\n        }\n        const originalDuration = this.getDuration();\n        (!this.getFrame(0)) && times.unshift(0);\n        (!this.getFrame(originalDuration)) && times.push(originalDuration);\n        const entries = getEntries(times, states);\n        const lastEntry = entries[entries.length - 1];\n\n        // end delay time\n        lastEntry[0] < duration && addEntry(entries, duration, lastEntry[1]);\n        let prevTime = -1;\n\n        return entries.map(([time, keytime]) => {\n            if (!frames[keytime]) {\n                frames[keytime] =\n                    (!this.hasFrame(keytime) || keytime === 0 || keytime === originalDuration ?\n                        this.getNowFrame(keytime) : this.getNowFrame(keytime, 0, true)).toCSS();\n            }\n\n            let frameTime = time / duration * 100;\n\n            if (frameTime - prevTime < THRESHOLD) {\n                frameTime += THRESHOLD;\n            }\n            prevTime = frameTime;\n            return `${Math.min(frameTime, 100)}%{\n                ${time === 0 && !isDirectionReverse(0, 1, direction) ? \"\" : frames[keytime]}\n            }`;\n        }).join(\"\");\n    }\n    private updateFrameOrders() {\n        const nameMap = this.nameMap.orderMap;\n\n        this.forEach(frame => {\n            frame.setOrderObject(nameMap);\n        });\n    }\n}\n\nexport default SceneItem;\n","import Animator from \"./Animator\";\nimport SceneItem from \"./SceneItem\";\nimport { SELECTOR, DURATION, DELAY, RUNNING, NAME_SEPARATOR } from \"./consts\";\nimport { playCSS, getRealId, isPausedCSS, isEndedCSS, setPlayCSS } from \"./utils\";\nimport { isFunction, IS_WINDOW, IObject, $, IArrayFormat } from \"@daybrush/utils\";\nimport {\n    AnimateElement, SceneState, SceneOptions, EasingType,\n    AnimatorState, SceneItemOptions, PlayCondition, NameType, SceneEvents\n} from \"./types\";\nimport Frame from \"./Frame\";\nimport OrderMap from \"order-map\";\nimport styled, { InjectResult, StyledInjector } from \"css-styled\";\n/**\n * manage sceneItems and play Scene.\n * @extends Animator\n * @sort 1\n */\nclass Scene extends Animator<SceneOptions, SceneState, SceneEvents> {\n    /**\n    * version info\n    * @type {string}\n    * @example\n    * Scene.VERSION // #__VERSION__#\n    */\n    public static VERSION: string = \"#__VERSION__#\";\n    public items: IObject<Scene | SceneItem> = {};\n    public orderMap = new OrderMap(NAME_SEPARATOR);\n    public styled: StyledInjector;\n    public styledInjector: InjectResult;\n    public temp: IObject<Frame>;\n    /**\n    * @param - properties\n    * @param - options\n    * @example\n    const scene = new Scene({\n      item1: {\n        0: {\n          display: \"none\",\n        },\n        1: {\n          display: \"block\",\n          opacity: 0,\n        },\n        2: {\n          opacity: 1,\n        },\n      },\n      item2: {\n        2: {\n          opacity: 1,\n        },\n      }\n    });\n      */\n    constructor(properties?: { options?: Partial<SceneOptions> } & IObject<any>, options?: Partial<SceneOptions>) {\n        super();\n        this.load(properties, options);\n    }\n    public getDuration() {\n        let time = 0;\n\n        this.forEach(item => {\n            time = Math.max(time, item.getTotalDuration() / item.getPlaySpeed());\n        });\n        return time || this.state[DURATION];\n    }\n    public setDuration(duration: number) {\n        const items = this.items;\n        const sceneDuration = this.getDuration();\n\n        if (duration === 0 || !isFinite(sceneDuration)) {\n            return this;\n        }\n        if (sceneDuration === 0) {\n            this.forEach(item => {\n                item.setDuration(duration);\n            });\n        } else {\n            const ratio = duration / sceneDuration;\n\n            this.forEach(item => {\n                item.setDelay(item.getDelay() * ratio);\n                item.setDuration(item.getDuration() * ratio);\n            });\n        }\n        super.setDuration(duration);\n        return this;\n    }\n    public getItem<T extends (Scene | SceneItem) = Scene | SceneItem>(name: number | string): T;\n    /**\n    * get item in scene by name\n    * @param - The item's name\n    * @return {Scene | SceneItem} item\n    * @example\n    const item = scene.getItem(\"item1\")\n    */\n    public getItem(name: number | string) {\n        return this.items[name];\n    }\n    /**\n    * create item in scene\n    * @param {} name - name of item to create\n    * @param {} options - The option object of SceneItem\n    * @return {} Newly created item\n    * @example\n    const item = scene.newItem(\"item1\")\n    */\n    public newItem(name: number | string, options: Partial<SceneItemOptions> = {}): Scene | SceneItem {\n        if (this.items[name]) {\n            return this.items[name];\n        }\n        const item = new SceneItem();\n\n        this.setItem(name, item);\n        item.setOptions(options);\n\n        return item;\n    }\n    /**\n    * remove item in scene\n    * @param - name of item to remove\n    * @return  An instance itself\n    * @example\n    const item = scene.newItem(\"item1\")\n\n    scene.removeItem(\"item1\");\n    */\n    public removeItem(name: number | string): this {\n        delete this.items[name];\n\n        this.orderMap.remove([name]);\n        return this;\n    }\n    /**\n    * add a sceneItem to the scene\n    * @param - name of item to create\n    * @param - sceneItem\n    * @example\n    const item = scene.newItem(\"item1\")\n    */\n    public setItem(name: number | string, item: Scene | SceneItem) {\n        item.setId(name);\n        this.items[name] = item;\n\n        this.orderMap.add([name]);\n        return this;\n    }\n    public setTime(time: number | string, isTick?: boolean, isParent?: boolean, parentEasing?: EasingType) {\n        super.setTime(time, isTick, isParent);\n\n        const iterationTime = this.getIterationTime();\n        const easing = this.getEasing() || parentEasing;\n        const frames: IObject<any> = {};\n\n        this.forEach(item => {\n            item.setTime(iterationTime * item.getPlaySpeed() - item.getDelay(), isTick, true, easing);\n\n            frames[item.getId()] = item.temp;\n        });\n        this.temp = frames;\n\n        /**\n         * This event is fired when timeupdate and animate.\n         * @event Scene#animate\n         * @param {object} param The object of data to be sent to an event.\n         * @param {number} param.currentTime The total time that the animator is running.\n         * @param {number} param.time The iteration time during duration that the animator is running.\n         * @param {object} param.frames frames of that time.\n         * @example\nconst scene = new Scene({\n    a: {\n        0: {\n            opacity: 0,\n        },\n        1: {\n            opacity: 1,\n        }\n    },\n    b: {\n        0: {\n            opacity: 0,\n        },\n        1: {\n            opacity: 1,\n        }\n    }\n}).on(\"animate\", e => {\n    console.log(e.frames);\n    // {a: Frame, b: Frame}\n    console.log(e.frames.a.get(\"opacity\"));\n});\n             */\n        this.trigger(\"animate\", {\n            frames,\n            currentTime: this.getTime(),\n            time: iterationTime,\n        });\n\n        return this;\n    }\n    /**\n     * executes a provided function once for each scene item.\n     * @param - Function to execute for each element, taking three arguments\n     * @return {Scene} An instance itself\n     */\n    public forEach(\n        func: (\n            item: Scene | SceneItem,\n            id: string | number,\n            index: number,\n            items: IObject<Scene | SceneItem>,\n        ) => void,\n    ) {\n        const items = this.items;\n        this.getOrders().forEach((id, index) => {\n            func(items[id], id, index, items);\n        });\n        return this;\n    }\n    public toCSS(\n        playCondition?: PlayCondition,\n        duration: number = this.getDuration(), parentStates: AnimatorState[] = []) {\n        const totalDuration = !duration || !isFinite(duration) ? 0 : duration;\n        const styles: string[] = [];\n        const state = this.state;\n\n        state[DURATION] = this.getDuration();\n\n        this.forEach(item => {\n            styles.push(item.toCSS(playCondition, totalDuration, parentStates.concat(state)));\n        });\n        return styles.join(\"\");\n    }\n    /**\n     * Export the CSS of the items to the style.\n     * @param - Add a selector or className to play.\n     * @return {Scene} An instance itself\n     */\n    public exportCSS(\n        playCondition?: PlayCondition, duration?: number, parentStates?: AnimatorState[]) {\n        const css = this.toCSS(playCondition, duration, parentStates);\n\n        if (!parentStates || !parentStates.length) {\n            if (this.styledInjector) {\n                this.styledInjector.destroy();\n                this.styledInjector = null;\n            }\n            this.styled = styled(css);\n            this.styledInjector = this.styled.inject(this.getAnimationElement(), { original: true });\n            // && exportCSS(getRealId(this), css);\n        }\n        return this;\n    }\n    public append(item: SceneItem | Scene) {\n        item.setDelay(item.getDelay() + this.getDuration());\n        this.setItem(getRealId(item), item);\n    }\n    public pauseCSS() {\n        return this.forEach(item => {\n            item.pauseCSS();\n        });\n    }\n    public pause() {\n        super.pause();\n\n        isPausedCSS(this) && this.pauseCSS();\n        this.forEach(item => {\n            item.pause();\n        });\n        return this;\n    }\n    public endCSS() {\n        this.forEach(item => {\n            item.endCSS();\n        });\n        setPlayCSS(this, false);\n    }\n    public end() {\n        isEndedCSS(this) && this.endCSS();\n        super.end();\n        return this;\n    }\n        /**\n      * get item orders\n      * @example\n      scene.getOrders() // => [\"item1\", \"item2\"]\n      */\n     public getOrders(): NameType[] {\n        return this.orderMap.get([]) || [];\n    }\n    /**\n      * set item orders\n      * @param - orders\n      * @example\n      frame.setOrders([\"item2\", \"item1\"]) // => [\"item2\", \"item1\"]\n      */\n    public setOrders(orders: NameType[]): NameType[] {\n        return this.orderMap.set([], orders);\n    }\n    public getAnimationElement() {\n        let animtionElement: AnimateElement;\n\n        this.forEach(item => {\n            const el = item.getAnimationElement();\n\n            !animtionElement && (animtionElement = el);\n        });\n        return animtionElement;\n    }\n    public addPlayClass(isPaused: boolean, playClassName?: string, properties: object = {}) {\n        let animtionElement: AnimateElement;\n\n        this.forEach(item => {\n            const el = item.addPlayClass(isPaused, playClassName, properties);\n\n            !animtionElement && (animtionElement = el);\n        });\n        return animtionElement;\n    }\n    /**\n    * Play using the css animation and keyframes.\n    * @param - Check if you want to export css.\n    * @param [playClassName=\"startAnimation\"] - Add a class name to play.\n    * @param - The shorthand properties for six of the animation properties.\n    * @return {Scene} An instance itself\n    * @see {@link https://www.w3schools.com/cssref/css3_pr_animation.asp}\n    * @example\n    scene.playCSS();\n    scene.playCSS(false, {\n    direction: \"reverse\",\n    fillMode: \"forwards\",\n    });\n    */\n    public playCSS(isExportCSS = true, playClassName?: string, properties: Partial<AnimatorState> = {}) {\n        playCSS(this, isExportCSS, playClassName, properties);\n        return this;\n    }\n    public set(properties: any, ...args: any[]): this;\n    /**\n      * Set properties to the Scene.\n      * @param - properties\n      * @return An instance itself\n      * @example\nscene.set({\n    \".a\": {\n        0: {\n            opacity: 0,\n        },\n        1: {\n            opacity: 1,\n        },\n    },\n});\n// 0\nconsole.log(scene.getItem(\".a\").get(0, \"opacity\"));\n// 1\nconsole.log(scene.getItem(\".a\").get(1, \"opacity\"));\n      */\n    public set(properties: any) {\n        this.load(properties);\n        return this;\n    }\n    /**\n      * Clear All Items\n      * @return {Scene} An instance itself\n      */\n    public clear() {\n        this.finish();\n        this.items = {};\n        this.orderMap = new OrderMap(NAME_SEPARATOR);\n\n        if (this.styledInjector) {\n            this.styledInjector.destroy();\n        }\n        this.styled = null;\n        this.styledInjector = null;\n    }\n    public load(properties: any = {}, options = properties.options) {\n        if (!properties) {\n            return this;\n        }\n        const selector = options && options[SELECTOR] || this.state[SELECTOR];\n        for (const name in properties) {\n            if (name === \"options\") {\n                continue;\n            }\n            const object = properties[name];\n            let item;\n\n            if (object instanceof Scene || object instanceof SceneItem) {\n                this.setItem(name, object);\n                item = object;\n            } else if (isFunction(object) && selector) {\n                const elements =\n                    IS_WINDOW\n                        ? $(`${isFunction(selector) ? selector(name) : name}`, true) as IArrayFormat<AnimateElement>\n                        : ([] as AnimateElement[]);\n                const length = elements.length;\n                const scene = new Scene();\n\n                for (let i = 0; i < length; ++i) {\n                    (scene.newItem(i) as SceneItem).setId().setElement(elements[i]).load(object(i, elements[i]));\n                }\n                this.setItem(name, scene);\n                continue;\n            } else {\n                item = this.newItem(name);\n                item.load(object);\n            }\n            selector && item.setSelector(selector);\n        }\n        this.setOptions(options);\n    }\n    public setOptions(options: Partial<SceneState> = {}): this {\n        super.setOptions(options);\n\n        const selector = options.selector;\n\n        if (selector) {\n            this.state[SELECTOR] = selector;\n        }\n        return this;\n    }\n    public setSelector(target?: string | boolean | ((id: number | string) => string)) {\n        const state = this.state;\n        const selector = target || state[SELECTOR];\n\n        state[SELECTOR] = selector;\n        const isItFunction = isFunction(target);\n        if (selector) {\n            this.forEach((item, name) => {\n                item.setSelector(isItFunction ? (target as (id: number | string) => string)(name) : selector);\n            });\n        }\n        return this;\n    }\n    public start(delay: number = this.state[DELAY]): boolean {\n        const result = super.start(delay);\n\n        if (result) {\n            this.forEach(item => {\n                item.start(0);\n            });\n        } else {\n            this.forEach(item => {\n                item.setPlayState(RUNNING);\n            });\n        }\n        return result;\n    }\n}\n\nexport default Scene;\n","import { IObject } from \"@daybrush/utils\";\nimport Scene from \"./Scene\";\nimport SceneItem from \"./SceneItem\";\nimport { SceneOptions, SceneItemOptions } from \"./types\";\n\nexport function animate(properties?: IObject<any>, options?: Partial<SceneOptions>) {\n    return new Scene(properties, options).play();\n}\nexport function animateItem(properties?: IObject<any>, options?: Partial<SceneItemOptions>) {\n    return new SceneItem(properties, options).play();\n}\n"],"names":["cubic","y1","y2","t","t2","solveFromX","x1","x2","x","solveX","dx","Math","abs","bezier","func","between","easingName","steps","count","position","time","level","floor","STEP_START","STEP_END","LINEAR","EASE","EASE_IN","EASE_OUT","EASE_IN_OUT","PREFIX","DATA_SCENE_ID","TIMING_FUNCTION","ROLES","transform","filter","attribute","html","ALIAS","easing","FIXED","_a","MAXIMUM","THRESHOLD","DURATION","FILL_MODE","DIRECTION","ITERATION_COUNT","DELAY","EASING","PLAY_SPEED","EASING_NAME","ITERATION_TIME","PAUSED","ENDED","TIMEUPDATE","ANIMATE","PLAY","RUNNING","ITERATION","START_ANIMATION","PAUSE_ANIMATION","ALTERNATE","REVERSE","ALTERNATE_REVERSE","NORMAL","INFINITE","PLAY_STATE","PLAY_CSS","PREV_TIME","TICK_TIME","CURRENT_TIME","SELECTOR","TRANSFORM_NAME","EASINGS","NAME_SEPARATOR","OPTIONS","EVENTS","value","options","setOptions","isString","split","separator","newOptions","name","length","index","prefix","suffix","model","type","arr","map","v","PropertyObject","clone","join","toValue","forEach","splitStyle","str","properties","splitText","obj","totalLength","i","matches","trim","toPropertyObject","styles","arrayToColorObject","RGBA","stringToBracketObject","text","splitBracket","afterModel","COLOR_MODELS","indexOf","stringToRGBA","arrayToPropertyObject","stringToColorObject","result","isArray","values","splitComma","splitSpace","exec","charAt","toObject","object","size","get","isPropertyObject","setAlias","alias","setRole","names","isProperty","isFixedProperty","roles","fixed","getType","OBJECT","ARRAY","PROPERTY","STRING","NUMBER","isPureObject","isObject","constructor","Object","getNames","stack","push","concat","pop","slice","updateFrame","toFixed","num","round","getValueByNames","undefined","isInProperties","args","isLast","role","isRole","isFixed","setPlayCSS","item","isActivate","state","isPausedCSS","isPaused","isEndedCSS","isEnded","makeId","selector","id","random","IS_WINDOW","checkElement","$","getRealId","getId","setId","toId","match","playCSS","isExportCSS","playClassName","ANIMATION","getPlayState","className","addPlayClass","setTime","exportCSS","el","addAnimationEvent","setPlayState","duration","getDuration","isZeroDuration","isFinite","animationend","finish","animationstart","trigger","addEvent","animationiteration","once","removeEvent","elapsedTime","currentTime","iterationCount","setIteration","getEasing","curveArray","parseFloat","GetterSetter","getter","setter","parent","prototype","camelize","isDirectionReverse","iteration","iteraiontCount","direction","setters","getters","__extends","_super","_this","delay","fillMode","playSpeed","iterationTime","tickTime","prevTime","playState","setEasing","setDuration","getActiveDuration","Infinity","getTime","toTime","timerId","requestAnimationFrame","tick","start","cancelAnimationFrame","end","pause","isTick","isParent","activeDuration","getUnitTime","calculate","isDelay","getIterationTime","splitUnit","unit","passIterationCount","maxIterationCount","currentIterationTime","setIterationTime","isReverse","isFiniteDuration","isForwards","now","to","min","Animator","EventEmitter","toInnerProperties","orders","arrObj","keys","getKeys","sortOrders","replace","target","merge","from","FUNCTION","getValue","getPropertyName","OrderMap","set","_i","raw","orderMap","getObject","setObject","key","nextValue","children","gets","params","remove","self","firstParam","Frame","_set","has","stylesLength","isUndefined","frame","setOrderObject","frameProperties","cssObject","FILTER","TRANSFORM","toCSSObject","cssArray","clear","lastParam","add","dotArray","a1","a2","b1","b2","v1","dot","dotColor","color1","color2","value1","value2","model1","model2","colorModel","parseInt","dotObject","a1Type","type1","type2","isFunction1","isFunction2","v2","isNaN","dotNumber","dotValue","nextTime","prevValue","ratio","getNearTimeIndex","times","makeAnimationProperties","decamelize","addTime","splice","addEntry","entries","keytime","prevEntry","getEntries","states","nextEntries","intCount","ceil","currentDuration","lastTime","j","entry","divideTime","unshift","load","originalDuration","ratio_1","items_1","obj_1","time2","items","newFrame","elements","sceneId_1","element","setAttribute","SceneItem","eachTime","realTime","innerValue","value_1","getDelay","frames","hasFrame","getDirection","frameTime","needUpdate","getFrame","update","nameMap","updateFrameOrders","removeFrame","append","unshiftTime","firstFrame","prepend","isStartZero","isFunction","setElement","toArray","Element","style","targetFunc","attributes","html_1","innerHTML","cssText","toCSS","fromCSS","parentEasing","getNowFrame","temp","prevNameMap","pushKeys","nextMap","setFrame","toFrame","isAccurate","left","right","realEasing","hasName","nowEasing","getNowValue","prevFrame_1","prevOrderMap","keyframes","callback","setTarget","setSelector","playCondition","parentDuration","itemState","reversedStates","reverse","superParent","infiniteIndex","findIndex","finiteStates","reduce","prev","cur","find","timingFunction","selectors","sel","selectorCallback","preselector","peusdo","KEYFRAMES","_toKeyframes","css","styledInjector","destroy","styled","inject","getAnimationElement","original","pauseCSS","addClass","removeClass","endCSS","hasClass","clientWidth","usePrevValue","prevFrame","nextFrame","isUndefinedLeft","isUndefinedRight","indicies","max","lastEntry","getTotalDuration","getPlaySpeed","sceneDuration","setDelay","setItem","getOrders","parentStates","totalDuration","animtionElement","Scene","scene","newItem","isItFunction","animate","play","animateItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAASA,KAAT,CAAeC,EAAf,EAA2BC,EAA3B,EAAuCC,CAAvC;AACE,MAAMC,EAAE,GAAG,IAAID,CAAf;;AAGA,SAAOA,CAAC,GAAGA,CAAJ,GAAQA,CAAR,GAAY,IAAIA,CAAJ,GAAQA,CAAR,GAAYC,EAAZ,GAAiBF,EAA7B,GAAkC,IAAIC,CAAJ,GAAQC,EAAR,GAAaA,EAAb,GAAkBH,EAA3D;AACD;;AACD,SAASI,UAAT,CAAoBC,EAApB,EAAgCC,EAAhC,EAA4CC,CAA5C;AACE;AACA;AACA,MAAIL,C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