{"ast":null,"code":"/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\n\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\n\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\nimport * as zrUtil from 'zrender/lib/core/util.js';\nimport { makeInner } from '../../util/model.js';\nvar each = zrUtil.each;\nvar inner = makeInner();\n/**\r\n * @param ecModel\r\n * @param newSnapshot key is dataZoomId\r\n */\n\nexport function push(ecModel, newSnapshot) {\n var storedSnapshots = getStoreSnapshots(ecModel); // If previous dataZoom can not be found,\n // complete an range with current range.\n\n each(newSnapshot, function (batchItem, dataZoomId) {\n var i = storedSnapshots.length - 1;\n\n for (; i >= 0; i--) {\n var snapshot = storedSnapshots[i];\n\n if (snapshot[dataZoomId]) {\n break;\n }\n }\n\n if (i < 0) {\n // No origin range set, create one by current range.\n var dataZoomModel = ecModel.queryComponents({\n mainType: 'dataZoom',\n subType: 'select',\n id: dataZoomId\n })[0];\n\n if (dataZoomModel) {\n var percentRange = dataZoomModel.getPercentRange();\n storedSnapshots[0][dataZoomId] = {\n dataZoomId: dataZoomId,\n start: percentRange[0],\n end: percentRange[1]\n };\n }\n }\n });\n storedSnapshots.push(newSnapshot);\n}\nexport function pop(ecModel) {\n var storedSnapshots = getStoreSnapshots(ecModel);\n var head = storedSnapshots[storedSnapshots.length - 1];\n storedSnapshots.length > 1 && storedSnapshots.pop(); // Find top for all dataZoom.\n\n var snapshot = {};\n each(head, function (batchItem, dataZoomId) {\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\n batchItem = storedSnapshots[i][dataZoomId];\n\n if (batchItem) {\n snapshot[dataZoomId] = batchItem;\n break;\n }\n }\n });\n return snapshot;\n}\nexport function clear(ecModel) {\n inner(ecModel).snapshots = null;\n}\nexport function count(ecModel) {\n return getStoreSnapshots(ecModel).length;\n}\n/**\r\n * History length of each dataZoom may be different.\r\n * this._history[0] is used to store origin range.\r\n */\n\nfunction getStoreSnapshots(ecModel) {\n var store = inner(ecModel);\n\n if (!store.snapshots) {\n store.snapshots = [{}];\n }\n\n return store.snapshots;\n}","map":{"version":3,"sources":["D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/qingge-Market/qingge-vue/node_modules/echarts/lib/component/dataZoom/history.js"],"names":["zrUtil","makeInner","each","inner","push","ecModel","newSnapshot","storedSnapshots","getStoreSnapshots","batchItem","dataZoomId","i","length","snapshot","dataZoomModel","queryComponents","mainType","subType","id","percentRange","getPercentRange","start","end","pop","head","clear","snapshots","count","store"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\n\r\n\r\n/**\r\n * AUTO-GENERATED FILE. DO NOT MODIFY.\r\n */\r\n\r\n/*\r\n* Licensed to the Apache Software Foundation (ASF) under one\r\n* or more contributor license agreements. See the NOTICE file\r\n* distributed with this work for additional information\r\n* regarding copyright ownership. The ASF licenses this file\r\n* to you under the Apache License, Version 2.0 (the\r\n* \"License\"); you may not use this file except in compliance\r\n* with the License. You may obtain a copy of the License at\r\n*\r\n* http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing,\r\n* software distributed under the License is distributed on an\r\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\n* KIND, either express or implied. See the License for the\r\n* specific language governing permissions and limitations\r\n* under the License.\r\n*/\r\nimport * as zrUtil from 'zrender/lib/core/util.js';\r\nimport { makeInner } from '../../util/model.js';\r\nvar each = zrUtil.each;\r\nvar inner = makeInner();\r\n/**\r\n * @param ecModel\r\n * @param newSnapshot key is dataZoomId\r\n */\r\n\r\nexport function push(ecModel, newSnapshot) {\r\n var storedSnapshots = getStoreSnapshots(ecModel); // If previous dataZoom can not be found,\r\n // complete an range with current range.\r\n\r\n each(newSnapshot, function (batchItem, dataZoomId) {\r\n var i = storedSnapshots.length - 1;\r\n\r\n for (; i >= 0; i--) {\r\n var snapshot = storedSnapshots[i];\r\n\r\n if (snapshot[dataZoomId]) {\r\n break;\r\n }\r\n }\r\n\r\n if (i < 0) {\r\n // No origin range set, create one by current range.\r\n var dataZoomModel = ecModel.queryComponents({\r\n mainType: 'dataZoom',\r\n subType: 'select',\r\n id: dataZoomId\r\n })[0];\r\n\r\n if (dataZoomModel) {\r\n var percentRange = dataZoomModel.getPercentRange();\r\n storedSnapshots[0][dataZoomId] = {\r\n dataZoomId: dataZoomId,\r\n start: percentRange[0],\r\n end: percentRange[1]\r\n };\r\n }\r\n }\r\n });\r\n storedSnapshots.push(newSnapshot);\r\n}\r\nexport function pop(ecModel) {\r\n var storedSnapshots = getStoreSnapshots(ecModel);\r\n var head = storedSnapshots[storedSnapshots.length - 1];\r\n storedSnapshots.length > 1 && storedSnapshots.pop(); // Find top for all dataZoom.\r\n\r\n var snapshot = {};\r\n each(head, function (batchItem, dataZoomId) {\r\n for (var i = storedSnapshots.length - 1; i >= 0; i--) {\r\n batchItem = storedSnapshots[i][dataZoomId];\r\n\r\n if (batchItem) {\r\n snapshot[dataZoomId] = batchItem;\r\n break;\r\n }\r\n }\r\n });\r\n return snapshot;\r\n}\r\nexport function clear(ecModel) {\r\n inner(ecModel).snapshots = null;\r\n}\r\nexport function count(ecModel) {\r\n return getStoreSnapshots(ecModel).length;\r\n}\r\n/**\r\n * History length of each dataZoom may be different.\r\n * this._history[0] is used to store origin range.\r\n */\r\n\r\nfunction getStoreSnapshots(ecModel) {\r\n var store = inner(ecModel);\r\n\r\n if (!store.snapshots) {\r\n store.snapshots = [{}];\r\n }\r\n\r\n return store.snapshots;\r\n}"]},"metadata":{},"sourceType":"module"}