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E,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC;IACH,kBAAC;AAAD,CAAC,AAnCD,IAmCC;AAnCY,kCAAW",
10 "sourcesContent": [
11 "import { Param } from '.';\nimport { extend, ancestors, Obj } from '../common/common';\nimport { StateObject } from '../state/stateObject';\n\nexport class StateParams {\n [key: string]: any;\n\n constructor(params: Obj = {}) {\n extend(this, params);\n }\n\n /**\n * Merges a set of parameters with all parameters inherited between the common parents of the\n * current state and a given destination state.\n *\n * @param {Object} newParams The set of parameters which will be composited with inherited params.\n * @param {Object} $current Internal definition of object representing the current state.\n * @param {Object} $to Internal definition of object representing state to transition to.\n */\n $inherit(newParams: Obj, $current: StateObject, $to: StateObject) {\n const parents = ancestors($current, $to),\n inherited: Obj = {},\n inheritList: string[] = [];\n\n for (const i in parents) {\n if (!parents[i] || !parents[i].params) continue;\n const parentParams = parents[i].params;\n const parentParamsKeys = Object.keys(parentParams);\n if (!parentParamsKeys.length) continue;\n\n for (const j in parentParamsKeys) {\n if (parentParams[parentParamsKeys[j]].inherit == false || inheritList.indexOf(parentParamsKeys[j]) >= 0)\n continue;\n inheritList.push(parentParamsKeys[j]);\n inherited[parentParamsKeys[j]] = this[parentParamsKeys[j]];\n }\n }\n return extend({}, inherited, newParams);\n }\n}\n"
12 ]
13}
\No newline at end of file