You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/10/31 12:12:32 UTC
[incubator-echarts-www] branch master updated: refact(builder):
build source from jsdelivr. add version choose. add no-official hint
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-echarts-www.git
The following commit(s) were added to refs/heads/master by this push:
new a73af9a refact(builder): build source from jsdelivr. add version choose. add no-official hint
a73af9a is described below
commit a73af9ae76f7138dd16d2f93c8fb21e2d4989782
Author: pissang <bm...@gmail.com>
AuthorDate: Sat Oct 31 20:11:51 2020 +0800
refact(builder): build source from jsdelivr. add version choose. add no-official hint
---
_jade/builder3.jade | 4 -
_jade/components/builder.jade | 48 +-
_scss/_pages.builder.scss | 18 +-
builder/build.js | 237 +-
builder/echarts.html | 8 +-
builder/lib/transform-dev-bundle.js | 61850 +++++++++++++++++++
builder/src/echarts/.eslintrc.yaml | 189 -
builder/src/echarts/CoordinateSystem.js | 54 -
builder/src/echarts/ExtensionAPI.js | 28 -
.../src/echarts/action/createDataSelectAction.js | 55 -
builder/src/echarts/action/geoRoam.js | 60 -
builder/src/echarts/action/roamHelper.js | 64 -
builder/src/echarts/chart/bar.js | 37 -
builder/src/echarts/chart/bar/BarSeries.js | 68 -
builder/src/echarts/chart/bar/BarView.js | 655 -
builder/src/echarts/chart/bar/BaseBarSeries.js | 79 -
.../src/echarts/chart/bar/PictorialBarSeries.js | 61 -
builder/src/echarts/chart/bar/PictorialBarView.js | 643 -
builder/src/echarts/chart/bar/barItemStyle.js | 33 -
builder/src/echarts/chart/bar/helper.js | 39 -
builder/src/echarts/chart/boxplot.js | 25 -
builder/src/echarts/chart/boxplot/BoxplotSeries.js | 92 -
builder/src/echarts/chart/boxplot/BoxplotView.js | 143 -
builder/src/echarts/chart/boxplot/boxplotLayout.js | 176 -
builder/src/echarts/chart/boxplot/boxplotVisual.js | 41 -
builder/src/echarts/chart/candlestick.js | 27 -
.../echarts/chart/candlestick/CandlestickSeries.js | 105 -
.../echarts/chart/candlestick/CandlestickView.js | 289 -
.../echarts/chart/candlestick/candlestickLayout.js | 181 -
.../echarts/chart/candlestick/candlestickVisual.js | 69 -
.../src/echarts/chart/candlestick/preprocessor.js | 31 -
builder/src/echarts/chart/chord.js | 27 -
builder/src/echarts/chart/chord/ChordSeries.js | 69 -
builder/src/echarts/chart/chord/ChordView.js | 82 -
builder/src/echarts/chart/chord/Ribbon.js | 64 -
.../src/echarts/chart/chord/chordCircularLayout.js | 127 -
builder/src/echarts/chart/custom.js | 659 -
builder/src/echarts/chart/effectScatter.js | 25 -
.../chart/effectScatter/EffectScatterSeries.js | 65 -
.../chart/effectScatter/EffectScatterView.js | 61 -
builder/src/echarts/chart/funnel.js | 27 -
builder/src/echarts/chart/funnel/FunnelSeries.js | 109 -
builder/src/echarts/chart/funnel/FunnelView.js | 179 -
builder/src/echarts/chart/funnel/funnelLayout.js | 351 -
builder/src/echarts/chart/gauge.js | 20 -
builder/src/echarts/chart/gauge/GaugeSeries.js | 120 -
builder/src/echarts/chart/gauge/GaugeView.js | 349 -
builder/src/echarts/chart/gauge/PointerPath.js | 45 -
builder/src/echarts/chart/graph.js | 41 -
builder/src/echarts/chart/graph/GraphSeries.js | 252 -
builder/src/echarts/chart/graph/GraphView.js | 374 -
builder/src/echarts/chart/graph/adjustEdge.js | 165 -
builder/src/echarts/chart/graph/backwardCompat.js | 18 -
builder/src/echarts/chart/graph/categoryFilter.js | 53 -
builder/src/echarts/chart/graph/categoryVisual.js | 64 -
builder/src/echarts/chart/graph/circularLayout.js | 26 -
.../echarts/chart/graph/circularLayoutHelper.js | 128 -
builder/src/echarts/chart/graph/createView.js | 82 -
builder/src/echarts/chart/graph/edgeVisual.js | 68 -
builder/src/echarts/chart/graph/forceHelper.js | 161 -
builder/src/echarts/chart/graph/forceLayout.js | 161 -
builder/src/echarts/chart/graph/graphAction.js | 47 -
builder/src/echarts/chart/graph/graphHelper.js | 42 -
builder/src/echarts/chart/graph/simpleLayout.js | 60 -
.../src/echarts/chart/graph/simpleLayoutHelper.js | 49 -
builder/src/echarts/chart/heatmap.js | 20 -
builder/src/echarts/chart/heatmap/HeatmapLayer.js | 159 -
builder/src/echarts/chart/heatmap/HeatmapSeries.js | 51 -
builder/src/echarts/chart/heatmap/HeatmapView.js | 253 -
builder/src/echarts/chart/helper/EffectLine.js | 207 -
builder/src/echarts/chart/helper/EffectPolyline.js | 124 -
builder/src/echarts/chart/helper/EffectSymbol.js | 231 -
builder/src/echarts/chart/helper/LargeLineDraw.js | 248 -
.../src/echarts/chart/helper/LargeSymbolDraw.js | 276 -
builder/src/echarts/chart/helper/Line.js | 452 -
builder/src/echarts/chart/helper/LineDraw.js | 171 -
builder/src/echarts/chart/helper/LinePath.js | 63 -
builder/src/echarts/chart/helper/Polyline.js | 92 -
builder/src/echarts/chart/helper/Symbol.js | 356 -
builder/src/echarts/chart/helper/SymbolDraw.js | 198 -
.../chart/helper/createClipPathFromCoordSys.js | 99 -
.../chart/helper/createGraphFromNodeEdge.js | 93 -
.../chart/helper/createGraphFromNodeMatrix.js | 114 -
.../echarts/chart/helper/createListFromArray.js | 128 -
.../src/echarts/chart/helper/createListSimply.js | 48 -
.../echarts/chart/helper/createRenderPlanner.js | 38 -
.../chart/helper/focusNodeAdjacencyAction.js | 44 -
builder/src/echarts/chart/helper/labelHelper.js | 42 -
.../chart/helper/multipleGraphEdgeHelper.js | 231 -
builder/src/echarts/chart/helper/treeHelper.js | 75 -
.../src/echarts/chart/helper/whiskerBoxCommon.js | 117 -
builder/src/echarts/chart/line.js | 30 -
builder/src/echarts/chart/line/LineSeries.js | 82 -
builder/src/echarts/chart/line/LineView.js | 693 -
builder/src/echarts/chart/line/helper.js | 108 -
.../src/echarts/chart/line/lineAnimationDiff.js | 165 -
builder/src/echarts/chart/line/poly.js | 356 -
builder/src/echarts/chart/lines.js | 25 -
builder/src/echarts/chart/lines/LinesSeries.js | 297 -
builder/src/echarts/chart/lines/LinesView.js | 162 -
builder/src/echarts/chart/lines/linesLayout.js | 96 -
builder/src/echarts/chart/lines/linesVisual.js | 56 -
builder/src/echarts/chart/map.js | 45 -
builder/src/echarts/chart/map/MapSeries.js | 230 -
builder/src/echarts/chart/map/MapView.js | 200 -
builder/src/echarts/chart/map/backwardCompat.js | 31 -
builder/src/echarts/chart/map/mapDataStatistic.js | 93 -
builder/src/echarts/chart/map/mapSymbolLayout.js | 65 -
builder/src/echarts/chart/map/mapVisual.js | 30 -
builder/src/echarts/chart/parallel.js | 24 -
.../src/echarts/chart/parallel/ParallelSeries.js | 105 -
builder/src/echarts/chart/parallel/ParallelView.js | 248 -
.../src/echarts/chart/parallel/parallelVisual.js | 56 -
builder/src/echarts/chart/pictorialBar.js | 29 -
builder/src/echarts/chart/pie.js | 42 -
builder/src/echarts/chart/pie/PieSeries.js | 168 -
builder/src/echarts/chart/pie/PieView.js | 366 -
builder/src/echarts/chart/pie/labelLayout.js | 329 -
builder/src/echarts/chart/pie/pieLayout.js | 154 -
builder/src/echarts/chart/radar.js | 33 -
builder/src/echarts/chart/radar/RadarSeries.js | 92 -
builder/src/echarts/chart/radar/RadarView.js | 194 -
builder/src/echarts/chart/radar/backwardCompat.js | 55 -
builder/src/echarts/chart/radar/radarLayout.js | 61 -
builder/src/echarts/chart/sankey.js | 26 -
builder/src/echarts/chart/sankey/SankeySeries.js | 198 -
builder/src/echarts/chart/sankey/SankeyView.js | 426 -
builder/src/echarts/chart/sankey/sankeyAction.js | 34 -
builder/src/echarts/chart/sankey/sankeyLayout.js | 562 -
builder/src/echarts/chart/sankey/sankeyVisual.js | 53 -
builder/src/echarts/chart/scatter.js | 45 -
builder/src/echarts/chart/scatter/ScatterSeries.js | 88 -
builder/src/echarts/chart/scatter/ScatterView.js | 102 -
builder/src/echarts/chart/sunburst.js | 29 -
.../src/echarts/chart/sunburst/SunburstPiece.js | 371 -
.../src/echarts/chart/sunburst/SunburstSeries.js | 194 -
builder/src/echarts/chart/sunburst/SunburstView.js | 219 -
.../src/echarts/chart/sunburst/sunburstAction.js | 83 -
.../src/echarts/chart/sunburst/sunburstLayout.js | 188 -
builder/src/echarts/chart/themeRiver.js | 28 -
.../echarts/chart/themeRiver/ThemeRiverSeries.js | 277 -
.../src/echarts/chart/themeRiver/ThemeRiverView.js | 154 -
.../echarts/chart/themeRiver/themeRiverLayout.js | 149 -
.../echarts/chart/themeRiver/themeRiverVisual.js | 40 -
builder/src/echarts/chart/tree.js | 26 -
builder/src/echarts/chart/tree/TreeSeries.js | 164 -
builder/src/echarts/chart/tree/TreeView.js | 594 -
builder/src/echarts/chart/tree/layoutHelper.js | 333 -
builder/src/echarts/chart/tree/traversalHelper.js | 77 -
builder/src/echarts/chart/tree/treeAction.js | 56 -
builder/src/echarts/chart/tree/treeLayout.js | 123 -
builder/src/echarts/chart/treemap.js | 26 -
builder/src/echarts/chart/treemap/Breadcrumb.js | 168 -
builder/src/echarts/chart/treemap/TreemapSeries.js | 391 -
builder/src/echarts/chart/treemap/TreemapView.js | 904 -
builder/src/echarts/chart/treemap/helper.js | 71 -
builder/src/echarts/chart/treemap/treemapAction.js | 61 -
builder/src/echarts/chart/treemap/treemapLayout.js | 540 -
builder/src/echarts/chart/treemap/treemapVisual.js | 187 -
builder/src/echarts/component/angleAxis.js | 20 -
builder/src/echarts/component/axis.js | 20 -
.../src/echarts/component/axis/AngleAxisView.js | 321 -
builder/src/echarts/component/axis/AxisBuilder.js | 639 -
builder/src/echarts/component/axis/AxisView.js | 111 -
.../echarts/component/axis/CartesianAxisView.js | 191 -
.../src/echarts/component/axis/ParallelAxisView.js | 168 -
.../src/echarts/component/axis/RadiusAxisView.js | 181 -
.../src/echarts/component/axis/SingleAxisView.js | 120 -
.../src/echarts/component/axis/axisSplitHelper.js | 106 -
.../echarts/component/axis/parallelAxisAction.js | 50 -
builder/src/echarts/component/axisPointer.js | 54 -
.../component/axisPointer/AxisPointerModel.js | 107 -
.../component/axisPointer/AxisPointerView.js | 57 -
.../component/axisPointer/BaseAxisPointer.js | 497 -
.../component/axisPointer/CartesianAxisPointer.js | 121 -
.../src/echarts/component/axisPointer/IAxisPointer | 41 -
.../component/axisPointer/PolarAxisPointer.js | 123 -
.../component/axisPointer/SingleAxisPointer.js | 117 -
.../echarts/component/axisPointer/axisTrigger.js | 403 -
.../component/axisPointer/findPointFromSeries.js | 67 -
.../component/axisPointer/globalListener.js | 134 -
.../echarts/component/axisPointer/modelHelper.js | 299 -
.../echarts/component/axisPointer/viewHelper.js | 220 -
builder/src/echarts/component/brush.js | 30 -
builder/src/echarts/component/brush/BrushModel.js | 152 -
builder/src/echarts/component/brush/BrushView.js | 118 -
builder/src/echarts/component/brush/brushAction.js | 73 -
.../src/echarts/component/brush/preprocessor.js | 73 -
builder/src/echarts/component/brush/selector.js | 92 -
.../src/echarts/component/brush/visualEncoding.js | 297 -
builder/src/echarts/component/calendar.js | 21 -
.../src/echarts/component/calendar/CalendarView.js | 423 -
builder/src/echarts/component/dataZoom.js | 21 -
.../src/echarts/component/dataZoom/AxisProxy.js | 493 -
.../echarts/component/dataZoom/DataZoomModel.js | 602 -
.../src/echarts/component/dataZoom/DataZoomView.js | 82 -
.../echarts/component/dataZoom/InsideZoomModel.js | 39 -
.../echarts/component/dataZoom/InsideZoomView.js | 222 -
.../echarts/component/dataZoom/SelectZoomModel.js | 22 -
.../echarts/component/dataZoom/SelectZoomView.js | 22 -
.../echarts/component/dataZoom/SliderZoomModel.js | 90 -
.../echarts/component/dataZoom/SliderZoomView.js | 721 -
.../echarts/component/dataZoom/dataZoomAction.js | 41 -
.../component/dataZoom/dataZoomProcessor.js | 81 -
builder/src/echarts/component/dataZoom/helper.js | 144 -
builder/src/echarts/component/dataZoom/history.js | 115 -
builder/src/echarts/component/dataZoom/roams.js | 204 -
.../echarts/component/dataZoom/typeDefaulter.js | 23 -
builder/src/echarts/component/dataZoomInside.js | 25 -
builder/src/echarts/component/dataZoomSelect.js | 30 -
builder/src/echarts/component/dataZoomSlider.js | 25 -
builder/src/echarts/component/dataset.js | 52 -
builder/src/echarts/component/geo.js | 58 -
builder/src/echarts/component/geo/GeoView.js | 47 -
builder/src/echarts/component/graphic.js | 509 -
builder/src/echarts/component/grid.js | 21 -
builder/src/echarts/component/gridSimple.js | 47 -
.../echarts/component/helper/BrushController.js | 894 -
.../echarts/component/helper/BrushTargetManager.js | 390 -
builder/src/echarts/component/helper/MapDraw.js | 435 -
.../src/echarts/component/helper/RoamController.js | 260 -
.../src/echarts/component/helper/brushHelper.js | 46 -
.../src/echarts/component/helper/cursorHelper.js | 34 -
.../echarts/component/helper/interactionMutex.js | 53 -
.../src/echarts/component/helper/listComponent.js | 62 -
builder/src/echarts/component/helper/roamHelper.js | 64 -
.../echarts/component/helper/selectableMixin.js | 102 -
builder/src/echarts/component/helper/sliderMove.js | 98 -
builder/src/echarts/component/legend.js | 31 -
.../src/echarts/component/legend/LegendModel.js | 323 -
builder/src/echarts/component/legend/LegendView.js | 448 -
.../component/legend/ScrollableLegendModel.js | 80 -
.../component/legend/ScrollableLegendView.js | 422 -
.../src/echarts/component/legend/legendAction.js | 94 -
.../src/echarts/component/legend/legendFilter.js | 37 -
.../component/legend/scrollableLegendAction.js | 36 -
builder/src/echarts/component/legendScroll.js | 26 -
builder/src/echarts/component/markArea.js | 25 -
builder/src/echarts/component/markLine.js | 25 -
builder/src/echarts/component/markPoint.js | 26 -
.../src/echarts/component/marker/MarkAreaModel.js | 48 -
.../src/echarts/component/marker/MarkAreaView.js | 331 -
.../src/echarts/component/marker/MarkLineModel.js | 50 -
.../src/echarts/component/marker/MarkLineView.js | 338 -
.../src/echarts/component/marker/MarkPointModel.js | 45 -
.../src/echarts/component/marker/MarkPointView.js | 174 -
.../src/echarts/component/marker/MarkerModel.js | 144 -
builder/src/echarts/component/marker/MarkerView.js | 46 -
.../src/echarts/component/marker/markerHelper.js | 220 -
builder/src/echarts/component/parallel.js | 114 -
builder/src/echarts/component/parallelAxis.js | 21 -
builder/src/echarts/component/polar.js | 32 -
builder/src/echarts/component/radar.js | 21 -
builder/src/echarts/component/radar/RadarView.js | 178 -
builder/src/echarts/component/radiusAxis.js | 20 -
builder/src/echarts/component/singleAxis.js | 27 -
builder/src/echarts/component/timeline.js | 29 -
.../component/timeline/SliderTimelineModel.js | 118 -
.../component/timeline/SliderTimelineView.js | 621 -
.../src/echarts/component/timeline/TimelineAxis.js | 70 -
.../echarts/component/timeline/TimelineModel.js | 196 -
.../src/echarts/component/timeline/TimelineView.js | 22 -
.../src/echarts/component/timeline/preprocessor.js | 101 -
.../echarts/component/timeline/timelineAction.js | 52 -
.../echarts/component/timeline/typeDefaulter.js | 23 -
builder/src/echarts/component/title.js | 213 -
builder/src/echarts/component/toolbox.js | 25 -
.../src/echarts/component/toolbox/ToolboxModel.js | 68 -
.../src/echarts/component/toolbox/ToolboxView.js | 263 -
.../src/echarts/component/toolbox/feature/Brush.js | 130 -
.../echarts/component/toolbox/feature/DataView.js | 485 -
.../echarts/component/toolbox/feature/DataZoom.js | 299 -
.../echarts/component/toolbox/feature/MagicType.js | 192 -
.../echarts/component/toolbox/feature/Restore.js | 56 -
.../component/toolbox/feature/SaveAsImage.js | 94 -
.../echarts/component/toolbox/featureManager.js | 25 -
builder/src/echarts/component/tooltip.js | 44 -
.../echarts/component/tooltip/TooltipContent.js | 348 -
.../component/tooltip/TooltipContentManager.js | 103 -
.../src/echarts/component/tooltip/TooltipModel.js | 98 -
.../component/tooltip/TooltipRichContent.js | 229 -
.../src/echarts/component/tooltip/TooltipView.js | 740 -
builder/src/echarts/component/visualMap.js | 24 -
.../echarts/component/visualMap/ContinuousModel.js | 250 -
.../echarts/component/visualMap/ContinuousView.js | 766 -
.../echarts/component/visualMap/PiecewiseModel.js | 509 -
.../echarts/component/visualMap/PiecewiseView.js | 210 -
.../echarts/component/visualMap/VisualMapModel.js | 514 -
.../echarts/component/visualMap/VisualMapView.js | 163 -
builder/src/echarts/component/visualMap/helper.js | 71 -
.../echarts/component/visualMap/preprocessor.js | 59 -
.../echarts/component/visualMap/typeDefaulter.js | 23 -
.../echarts/component/visualMap/visualEncoding.js | 92 -
.../echarts/component/visualMap/visualMapAction.js | 33 -
.../src/echarts/component/visualMapContinuous.js | 30 -
.../src/echarts/component/visualMapPiecewise.js | 30 -
builder/src/echarts/config.js | 37 -
builder/src/echarts/coord/Axis.js | 360 -
builder/src/echarts/coord/ICoordinateSystem | 85 -
builder/src/echarts/coord/View.js | 297 -
builder/src/echarts/coord/axisDefault.js | 188 -
builder/src/echarts/coord/axisHelper.js | 383 -
builder/src/echarts/coord/axisModelCommonMixin.js | 82 -
builder/src/echarts/coord/axisModelCreator.js | 88 -
builder/src/echarts/coord/axisTickLabelBuilder.js | 337 -
builder/src/echarts/coord/calendar/Calendar.js | 407 -
.../src/echarts/coord/calendar/CalendarModel.js | 135 -
.../src/echarts/coord/calendar/prepareCustom.js | 44 -
builder/src/echarts/coord/cartesian/Axis2D.js | 124 -
builder/src/echarts/coord/cartesian/AxisModel.js | 82 -
builder/src/echarts/coord/cartesian/Cartesian.js | 118 -
builder/src/echarts/coord/cartesian/Cartesian2D.js | 137 -
builder/src/echarts/coord/cartesian/Grid.js | 563 -
builder/src/echarts/coord/cartesian/GridModel.js | 48 -
.../echarts/coord/cartesian/cartesianAxisHelper.js | 85 -
.../src/echarts/coord/cartesian/prepareCustom.js | 51 -
builder/src/echarts/coord/geo/Geo.js | 193 -
builder/src/echarts/coord/geo/GeoModel.js | 142 -
builder/src/echarts/coord/geo/Region.js | 185 -
builder/src/echarts/coord/geo/fix/diaoyuIsland.js | 31 -
builder/src/echarts/coord/geo/fix/geoCoord.js | 34 -
builder/src/echarts/coord/geo/fix/nanhai.js | 43 -
builder/src/echarts/coord/geo/fix/textCoord.js | 38 -
builder/src/echarts/coord/geo/geoCreator.js | 202 -
builder/src/echarts/coord/geo/geoJSONLoader.js | 83 -
builder/src/echarts/coord/geo/geoSVGLoader.js | 132 -
builder/src/echarts/coord/geo/geoSourceManager.js | 101 -
builder/src/echarts/coord/geo/mapDataStorage.js | 79 -
builder/src/echarts/coord/geo/parseGeoJson.js | 132 -
builder/src/echarts/coord/geo/prepareCustom.js | 56 -
builder/src/echarts/coord/parallel/AxisModel.js | 130 -
builder/src/echarts/coord/parallel/Parallel.js | 486 -
builder/src/echarts/coord/parallel/ParallelAxis.js | 67 -
.../src/echarts/coord/parallel/ParallelModel.js | 124 -
.../src/echarts/coord/parallel/parallelCreator.js | 52 -
.../echarts/coord/parallel/parallelPreprocessor.js | 66 -
builder/src/echarts/coord/polar/AngleAxis.js | 105 -
builder/src/echarts/coord/polar/AxisModel.js | 67 -
builder/src/echarts/coord/polar/Polar.js | 269 -
builder/src/echarts/coord/polar/PolarModel.js | 50 -
builder/src/echarts/coord/polar/RadiusAxis.js | 49 -
builder/src/echarts/coord/polar/polarCreator.js | 145 -
builder/src/echarts/coord/polar/prepareCustom.js | 62 -
builder/src/echarts/coord/radar/IndicatorAxis.js | 49 -
builder/src/echarts/coord/radar/Radar.js | 256 -
builder/src/echarts/coord/radar/RadarModel.js | 134 -
builder/src/echarts/coord/single/AxisModel.js | 91 -
builder/src/echarts/coord/single/Single.js | 259 -
builder/src/echarts/coord/single/SingleAxis.js | 104 -
builder/src/echarts/coord/single/prepareCustom.js | 47 -
.../src/echarts/coord/single/singleAxisHelper.js | 74 -
builder/src/echarts/coord/single/singleCreator.js | 58 -
builder/src/echarts/data/DataDiffer.js | 140 -
builder/src/echarts/data/DataDimensionInfo.js | 135 -
builder/src/echarts/data/Graph.js | 538 -
builder/src/echarts/data/List.js | 2049 -
builder/src/echarts/data/OrdinalMeta.js | 141 -
builder/src/echarts/data/Source.js | 137 -
builder/src/echarts/data/Tree.js | 507 -
.../src/echarts/data/helper/completeDimensions.js | 282 -
.../src/echarts/data/helper/createDimensions.js | 48 -
builder/src/echarts/data/helper/dataProvider.js | 327 -
builder/src/echarts/data/helper/dataStackHelper.js | 152 -
builder/src/echarts/data/helper/dimensionHelper.js | 131 -
builder/src/echarts/data/helper/linkList.js | 145 -
builder/src/echarts/data/helper/sourceHelper.js | 625 -
builder/src/echarts/data/helper/sourceType.js | 28 -
builder/src/echarts/echarts.js | 2235 -
builder/src/echarts/export.js | 57 -
builder/src/echarts/helper.js | 98 -
builder/src/echarts/lang.js | 125 -
builder/src/echarts/langEN.js | 125 -
builder/src/echarts/langES.js | 67 -
builder/src/echarts/langFI.js | 67 -
builder/src/echarts/langTH.js | 67 -
builder/src/echarts/layout/barGrid.js | 542 -
builder/src/echarts/layout/barPolar.js | 256 -
builder/src/echarts/layout/points.js | 89 -
builder/src/echarts/loading/default.js | 122 -
builder/src/echarts/model/Component.js | 211 -
builder/src/echarts/model/Global.js | 678 -
builder/src/echarts/model/Model.js | 204 -
builder/src/echarts/model/OptionManager.js | 429 -
builder/src/echarts/model/Series.js | 565 -
builder/src/echarts/model/globalDefault.js | 68 -
builder/src/echarts/model/mixin/areaStyle.js | 25 -
builder/src/echarts/model/mixin/boxLayout.js | 30 -
builder/src/echarts/model/mixin/colorPalette.js | 76 -
builder/src/echarts/model/mixin/dataFormat.js | 132 -
builder/src/echarts/model/mixin/itemStyle.js | 32 -
builder/src/echarts/model/mixin/lineStyle.js | 44 -
builder/src/echarts/model/mixin/makeStyleMapper.js | 49 -
builder/src/echarts/model/mixin/textStyle.js | 48 -
builder/src/echarts/model/referHelper.js | 159 -
builder/src/echarts/preprocessor/backwardCompat.js | 113 -
.../src/echarts/preprocessor/helper/compatStyle.js | 295 -
builder/src/echarts/processor/dataFilter.js | 45 -
builder/src/echarts/processor/dataSample.js | 109 -
builder/src/echarts/processor/dataStack.js | 112 -
builder/src/echarts/scale/Interval.js | 283 -
builder/src/echarts/scale/Log.js | 187 -
builder/src/echarts/scale/Ordinal.js | 125 -
builder/src/echarts/scale/Scale.js | 173 -
builder/src/echarts/scale/Time.js | 217 -
builder/src/echarts/scale/helper.js | 78 -
builder/src/echarts/stream/Scheduler.js | 537 -
builder/src/echarts/stream/task.js | 314 -
builder/src/echarts/theme/dark.js | 151 -
builder/src/echarts/theme/light.js | 23 -
builder/src/echarts/util/KDTree.js | 261 -
builder/src/echarts/util/animation.js | 115 -
builder/src/echarts/util/clazz.js | 247 -
builder/src/echarts/util/component.js | 189 -
builder/src/echarts/util/format.js | 246 -
builder/src/echarts/util/graphic.js | 1387 -
builder/src/echarts/util/layout.js | 478 -
builder/src/echarts/util/model.js | 493 -
builder/src/echarts/util/number.js | 530 -
builder/src/echarts/util/quickSelect.js | 99 -
builder/src/echarts/util/shape/sausage.js | 68 -
builder/src/echarts/util/symbol.js | 316 -
builder/src/echarts/util/throttle.js | 167 -
builder/src/echarts/view/Chart.js | 253 -
builder/src/echarts/view/Component.js | 63 -
builder/src/echarts/visual/LegendVisualProvider.js | 54 -
builder/src/echarts/visual/VisualMapping.js | 586 -
builder/src/echarts/visual/aria.js | 146 -
builder/src/echarts/visual/dataColor.js | 73 -
builder/src/echarts/visual/seriesColor.js | 68 -
builder/src/echarts/visual/symbol.js | 95 -
builder/src/echarts/visual/visualDefault.js | 67 -
builder/src/echarts/visual/visualSolution.js | 207 -
builder/src/echarts3/CoordinateSystem.js | 37 -
builder/src/echarts3/ExtensionAPI.js | 10 -
.../src/echarts3/action/createDataSelectAction.js | 36 -
builder/src/echarts3/action/geoRoam.js | 42 -
builder/src/echarts3/action/roamHelper.js | 45 -
builder/src/echarts3/chart/bar.js | 16 -
builder/src/echarts3/chart/bar/BarSeries.js | 6 -
builder/src/echarts3/chart/bar/BarView.js | 222 -
builder/src/echarts3/chart/bar/BaseBarSeries.js | 58 -
.../src/echarts3/chart/bar/PictorialBarSeries.js | 43 -
builder/src/echarts3/chart/bar/PictorialBarView.js | 625 -
builder/src/echarts3/chart/bar/barItemStyle.js | 15 -
builder/src/echarts3/chart/bar/helper.js | 20 -
builder/src/echarts3/chart/boxplot.js | 7 -
.../src/echarts3/chart/boxplot/BoxplotSeries.js | 59 -
builder/src/echarts3/chart/boxplot/BoxplotView.js | 35 -
.../src/echarts3/chart/boxplot/boxplotLayout.js | 170 -
.../src/echarts3/chart/boxplot/boxplotVisual.js | 23 -
builder/src/echarts3/chart/candlestick.js | 9 -
.../chart/candlestick/CandlestickSeries.js | 71 -
.../echarts3/chart/candlestick/CandlestickView.js | 36 -
.../chart/candlestick/candlestickLayout.js | 122 -
.../chart/candlestick/candlestickVisual.js | 23 -
.../src/echarts3/chart/candlestick/preprocessor.js | 13 -
builder/src/echarts3/chart/chord.js | 10 -
builder/src/echarts3/chart/chord/ChordSeries.js | 53 -
builder/src/echarts3/chart/chord/ChordView.js | 64 -
builder/src/echarts3/chart/chord/Ribbon.js | 46 -
.../echarts3/chart/chord/chordCircularLayout.js | 114 -
builder/src/echarts3/chart/custom.js | 463 -
builder/src/echarts3/chart/effectScatter.js | 8 -
.../chart/effectScatter/EffectScatterSeries.js | 48 -
.../chart/effectScatter/EffectScatterView.js | 22 -
builder/src/echarts3/chart/funnel.js | 10 -
builder/src/echarts3/chart/funnel/FunnelSeries.js | 97 -
builder/src/echarts3/chart/funnel/FunnelView.js | 162 -
builder/src/echarts3/chart/funnel/funnelLayout.js | 159 -
builder/src/echarts3/chart/gauge.js | 2 -
builder/src/echarts3/chart/gauge/GaugeSeries.js | 114 -
builder/src/echarts3/chart/gauge/GaugeView.js | 326 -
builder/src/echarts3/chart/gauge/PointerPath.js | 27 -
builder/src/echarts3/chart/graph.js | 24 -
builder/src/echarts3/chart/graph/GraphSeries.js | 224 -
builder/src/echarts3/chart/graph/GraphView.js | 342 -
builder/src/echarts3/chart/graph/adjustEdge.js | 157 -
builder/src/echarts3/chart/graph/backwardCompat.js | 0
builder/src/echarts3/chart/graph/categoryFilter.js | 35 -
builder/src/echarts3/chart/graph/categoryVisual.js | 33 -
builder/src/echarts3/chart/graph/circularLayout.js | 8 -
.../echarts3/chart/graph/circularLayoutHelper.js | 43 -
builder/src/echarts3/chart/graph/createView.js | 64 -
builder/src/echarts3/chart/graph/edgeVisual.js | 50 -
builder/src/echarts3/chart/graph/forceHelper.js | 135 -
builder/src/echarts3/chart/graph/forceLayout.js | 138 -
builder/src/echarts3/chart/graph/graphAction.js | 53 -
builder/src/echarts3/chart/graph/simpleLayout.js | 37 -
.../src/echarts3/chart/graph/simpleLayoutHelper.js | 29 -
builder/src/echarts3/chart/heatmap.js | 2 -
builder/src/echarts3/chart/heatmap/HeatmapLayer.js | 146 -
.../src/echarts3/chart/heatmap/HeatmapSeries.js | 23 -
builder/src/echarts3/chart/heatmap/HeatmapView.js | 211 -
builder/src/echarts3/chart/helper/EffectLine.js | 166 -
.../src/echarts3/chart/helper/EffectPolyline.js | 105 -
builder/src/echarts3/chart/helper/EffectSymbol.js | 212 -
builder/src/echarts3/chart/helper/LargeLineDraw.js | 121 -
.../src/echarts3/chart/helper/LargeSymbolDraw.js | 128 -
builder/src/echarts3/chart/helper/Line.js | 341 -
builder/src/echarts3/chart/helper/LineDraw.js | 82 -
builder/src/echarts3/chart/helper/LinePath.js | 39 -
builder/src/echarts3/chart/helper/Polyline.js | 73 -
builder/src/echarts3/chart/helper/Symbol.js | 303 -
builder/src/echarts3/chart/helper/SymbolDraw.js | 118 -
.../src/echarts3/chart/helper/WhiskerBoxDraw.js | 197 -
.../chart/helper/createGraphFromNodeEdge.js | 65 -
.../chart/helper/createGraphFromNodeMatrix.js | 92 -
.../echarts3/chart/helper/createListFromArray.js | 255 -
builder/src/echarts3/chart/helper/labelHelper.js | 21 -
.../src/echarts3/chart/helper/whiskerBoxCommon.js | 98 -
builder/src/echarts3/chart/line.js | 13 -
builder/src/echarts3/chart/line/LineSeries.js | 65 -
builder/src/echarts3/chart/line/LineView.js | 653 -
.../src/echarts3/chart/line/lineAnimationDiff.js | 170 -
builder/src/echarts3/chart/line/poly.js | 220 -
builder/src/echarts3/chart/lines.js | 7 -
builder/src/echarts3/chart/lines/LinesSeries.js | 129 -
builder/src/echarts3/chart/lines/LinesView.js | 84 -
builder/src/echarts3/chart/lines/linesLayout.js | 29 -
builder/src/echarts3/chart/lines/linesVisual.js | 32 -
builder/src/echarts3/chart/map.js | 27 -
builder/src/echarts3/chart/map/MapSeries.js | 191 -
builder/src/echarts3/chart/map/MapView.js | 130 -
builder/src/echarts3/chart/map/backwardCompat.js | 13 -
builder/src/echarts3/chart/map/mapDataStatistic.js | 76 -
builder/src/echarts3/chart/map/mapSymbolLayout.js | 47 -
builder/src/echarts3/chart/map/mapVisual.js | 12 -
builder/src/echarts3/chart/parallel.js | 6 -
.../src/echarts3/chart/parallel/ParallelSeries.js | 140 -
.../src/echarts3/chart/parallel/ParallelView.js | 218 -
.../src/echarts3/chart/parallel/parallelVisual.js | 31 -
builder/src/echarts3/chart/pictorialBar.js | 11 -
builder/src/echarts3/chart/pie.js | 24 -
builder/src/echarts3/chart/pie/PieSeries.js | 125 -
builder/src/echarts3/chart/pie/PieView.js | 311 -
builder/src/echarts3/chart/pie/labelLayout.js | 209 -
builder/src/echarts3/chart/pie/pieLayout.js | 123 -
builder/src/echarts3/chart/radar.js | 16 -
builder/src/echarts3/chart/radar/RadarSeries.js | 62 -
builder/src/echarts3/chart/radar/RadarView.js | 178 -
builder/src/echarts3/chart/radar/backwardCompat.js | 37 -
builder/src/echarts3/chart/radar/radarLayout.js | 27 -
builder/src/echarts3/chart/sankey.js | 7 -
builder/src/echarts3/chart/sankey/SankeySeries.js | 112 -
builder/src/echarts3/chart/sankey/SankeyView.js | 147 -
builder/src/echarts3/chart/sankey/sankeyLayout.js | 394 -
builder/src/echarts3/chart/sankey/sankeyVisual.js | 34 -
builder/src/echarts3/chart/scatter.js | 10 -
.../src/echarts3/chart/scatter/ScatterSeries.js | 48 -
builder/src/echarts3/chart/scatter/ScatterView.js | 28 -
builder/src/echarts3/chart/themeRiver.js | 11 -
.../echarts3/chart/themeRiver/ThemeRiverSeries.js | 281 -
.../echarts3/chart/themeRiver/ThemeRiverView.js | 140 -
.../echarts3/chart/themeRiver/themeRiverLayout.js | 133 -
.../echarts3/chart/themeRiver/themeRiverVisual.js | 26 -
builder/src/echarts3/chart/tree.js | 11 -
builder/src/echarts3/chart/tree/TreeSeries.js | 109 -
builder/src/echarts3/chart/tree/TreeView.js | 322 -
builder/src/echarts3/chart/tree/commonLayout.js | 94 -
builder/src/echarts3/chart/tree/layoutHelper.js | 260 -
.../src/echarts3/chart/tree/orthogonalLayout.js | 6 -
builder/src/echarts3/chart/tree/radialLayout.js | 6 -
builder/src/echarts3/chart/tree/traversalHelper.js | 58 -
builder/src/echarts3/chart/tree/treeAction.js | 17 -
builder/src/echarts3/chart/treemap.js | 8 -
builder/src/echarts3/chart/treemap/Breadcrumb.js | 149 -
.../src/echarts3/chart/treemap/TreemapSeries.js | 359 -
builder/src/echarts3/chart/treemap/TreemapView.js | 843 -
builder/src/echarts3/chart/treemap/helper.js | 53 -
.../src/echarts3/chart/treemap/treemapAction.js | 41 -
.../src/echarts3/chart/treemap/treemapLayout.js | 510 -
.../src/echarts3/chart/treemap/treemapVisual.js | 179 -
builder/src/echarts3/component/angleAxis.js | 2 -
builder/src/echarts3/component/axis.js | 2 -
.../src/echarts3/component/axis/AngleAxisView.js | 204 -
builder/src/echarts3/component/axis/AxisBuilder.js | 607 -
builder/src/echarts3/component/axis/AxisView.js | 93 -
.../echarts3/component/axis/CartesianAxisView.js | 195 -
.../echarts3/component/axis/ParallelAxisView.js | 150 -
.../src/echarts3/component/axis/RadiusAxisView.js | 127 -
.../src/echarts3/component/axis/SingleAxisView.js | 97 -
.../echarts3/component/axis/cartesianAxisHelper.js | 66 -
.../echarts3/component/axis/parallelAxisAction.js | 32 -
.../echarts3/component/axis/singleAxisHelper.js | 57 -
builder/src/echarts3/component/axisPointer.js | 36 -
.../component/axisPointer/AxisPointerModel.js | 84 -
.../component/axisPointer/AxisPointerView.js | 39 -
.../component/axisPointer/BaseAxisPointer.js | 479 -
.../component/axisPointer/CartesianAxisPointer.js | 107 -
.../echarts3/component/axisPointer/IAxisPointer | 21 -
.../component/axisPointer/PolarAxisPointer.js | 105 -
.../component/axisPointer/SingleAxisPointer.js | 103 -
.../echarts3/component/axisPointer/axisTrigger.js | 384 -
.../component/axisPointer/findPointFromSeries.js | 49 -
.../component/axisPointer/globalListener.js | 116 -
.../echarts3/component/axisPointer/modelHelper.js | 280 -
.../echarts3/component/axisPointer/viewHelper.js | 198 -
builder/src/echarts3/component/brush.js | 11 -
builder/src/echarts3/component/brush/BrushModel.js | 128 -
builder/src/echarts3/component/brush/BrushView.js | 84 -
.../src/echarts3/component/brush/brushAction.js | 49 -
.../src/echarts3/component/brush/preprocessor.js | 55 -
builder/src/echarts3/component/brush/selector.js | 118 -
.../src/echarts3/component/brush/visualEncoding.js | 272 -
builder/src/echarts3/component/calendar.js | 7 -
.../echarts3/component/calendar/CalendarView.js | 405 -
builder/src/echarts3/component/dataZoom.js | 12 -
.../src/echarts3/component/dataZoom/AxisProxy.js | 426 -
.../echarts3/component/dataZoom/DataZoomModel.js | 519 -
.../echarts3/component/dataZoom/DataZoomView.js | 64 -
.../echarts3/component/dataZoom/InsideZoomModel.js | 19 -
.../echarts3/component/dataZoom/InsideZoomView.js | 188 -
.../echarts3/component/dataZoom/SelectZoomModel.js | 4 -
.../echarts3/component/dataZoom/SelectZoomView.js | 4 -
.../echarts3/component/dataZoom/SliderZoomModel.js | 68 -
.../echarts3/component/dataZoom/SliderZoomView.js | 701 -
.../echarts3/component/dataZoom/dataZoomAction.js | 23 -
.../component/dataZoom/dataZoomProcessor.js | 45 -
builder/src/echarts3/component/dataZoom/helper.js | 126 -
builder/src/echarts3/component/dataZoom/history.js | 97 -
builder/src/echarts3/component/dataZoom/roams.js | 191 -
.../echarts3/component/dataZoom/typeDefaulter.js | 5 -
builder/src/echarts3/component/dataZoomInside.js | 10 -
builder/src/echarts3/component/dataZoomSelect.js | 10 -
builder/src/echarts3/component/geo.js | 40 -
builder/src/echarts3/component/geo/GeoView.js | 29 -
builder/src/echarts3/component/graphic.js | 438 -
builder/src/echarts3/component/grid.js | 3 -
builder/src/echarts3/component/gridSimple.js | 29 -
.../echarts3/component/helper/BrushController.js | 859 -
.../component/helper/BrushTargetManager.js | 372 -
builder/src/echarts3/component/helper/MapDraw.js | 325 -
.../echarts3/component/helper/RoamController.js | 182 -
.../src/echarts3/component/helper/brushHelper.js | 28 -
.../src/echarts3/component/helper/cursorHelper.js | 16 -
.../echarts3/component/helper/interactionMutex.js | 35 -
.../src/echarts3/component/helper/listComponent.js | 44 -
.../src/echarts3/component/helper/roamHelper.js | 45 -
.../echarts3/component/helper/selectableMixin.js | 78 -
.../src/echarts3/component/helper/sliderMove.js | 79 -
builder/src/echarts3/component/legend.js | 13 -
.../src/echarts3/component/legend/LegendModel.js | 182 -
.../src/echarts3/component/legend/LegendView.js | 275 -
.../component/legend/ScrollableLegendModel.js | 71 -
.../component/legend/ScrollableLegendView.js | 329 -
.../src/echarts3/component/legend/legendAction.js | 70 -
.../src/echarts3/component/legend/legendFilter.js | 19 -
.../component/legend/scrollableLegendAction.js | 18 -
builder/src/echarts3/component/legendScroll.js | 7 -
builder/src/echarts3/component/markArea.js | 7 -
builder/src/echarts3/component/markLine.js | 7 -
builder/src/echarts3/component/markPoint.js | 8 -
.../src/echarts3/component/marker/MarkAreaModel.js | 32 -
.../src/echarts3/component/marker/MarkAreaView.js | 254 -
.../src/echarts3/component/marker/MarkLineModel.js | 33 -
.../src/echarts3/component/marker/MarkLineView.js | 294 -
.../echarts3/component/marker/MarkPointModel.js | 29 -
.../src/echarts3/component/marker/MarkPointView.js | 127 -
.../src/echarts3/component/marker/MarkerModel.js | 116 -
.../src/echarts3/component/marker/MarkerView.js | 28 -
.../src/echarts3/component/marker/markerHelper.js | 165 -
builder/src/echarts3/component/parallel.js | 96 -
builder/src/echarts3/component/parallelAxis.js | 3 -
builder/src/echarts3/component/polar.js | 14 -
builder/src/echarts3/component/radar.js | 3 -
builder/src/echarts3/component/radar/RadarView.js | 160 -
builder/src/echarts3/component/radiusAxis.js | 2 -
builder/src/echarts3/component/singleAxis.js | 9 -
builder/src/echarts3/component/timeline.js | 10 -
.../component/timeline/SliderTimelineModel.js | 104 -
.../component/timeline/SliderTimelineView.js | 607 -
.../echarts3/component/timeline/TimelineAxis.js | 81 -
.../echarts3/component/timeline/TimelineModel.js | 184 -
.../echarts3/component/timeline/TimelineView.js | 4 -
.../echarts3/component/timeline/preprocessor.js | 83 -
.../echarts3/component/timeline/timelineAction.js | 34 -
.../echarts3/component/timeline/typeDefaulter.js | 5 -
builder/src/echarts3/component/title.js | 187 -
builder/src/echarts3/component/toolbox.js | 7 -
.../src/echarts3/component/toolbox/ToolboxModel.js | 47 -
.../src/echarts3/component/toolbox/ToolboxView.js | 213 -
.../echarts3/component/toolbox/feature/Brush.js | 105 -
.../echarts3/component/toolbox/feature/DataView.js | 467 -
.../echarts3/component/toolbox/feature/DataZoom.js | 275 -
.../component/toolbox/feature/MagicType.js | 165 -
.../echarts3/component/toolbox/feature/Restore.js | 34 -
.../component/toolbox/feature/SaveAsImage.js | 70 -
.../echarts3/component/toolbox/featureManager.js | 7 -
builder/src/echarts3/component/tooltip.js | 26 -
.../echarts3/component/tooltip/TooltipContent.js | 222 -
.../component/tooltip/TooltipContentManager.js | 85 -
.../src/echarts3/component/tooltip/TooltipModel.js | 75 -
.../src/echarts3/component/tooltip/TooltipView.js | 699 -
builder/src/echarts3/component/visualMap.js | 5 -
.../component/visualMap/ContinuousModel.js | 232 -
.../echarts3/component/visualMap/ContinuousView.js | 749 -
.../echarts3/component/visualMap/PiecewiseModel.js | 494 -
.../echarts3/component/visualMap/PiecewiseView.js | 192 -
.../echarts3/component/visualMap/VisualMapModel.js | 477 -
.../echarts3/component/visualMap/VisualMapView.js | 145 -
builder/src/echarts3/component/visualMap/helper.js | 51 -
.../echarts3/component/visualMap/preprocessor.js | 41 -
.../echarts3/component/visualMap/typeDefaulter.js | 5 -
.../echarts3/component/visualMap/visualEncoding.js | 65 -
.../component/visualMap/visualMapAction.js | 15 -
.../src/echarts3/component/visualMapContinuous.js | 11 -
.../src/echarts3/component/visualMapPiecewise.js | 11 -
builder/src/echarts3/config.js | 19 -
builder/src/echarts3/coord/Axis.js | 260 -
builder/src/echarts3/coord/ICoordinateSystem | 64 -
builder/src/echarts3/coord/View.js | 267 -
builder/src/echarts3/coord/axisDefault.js | 149 -
builder/src/echarts3/coord/axisHelper.js | 249 -
builder/src/echarts3/coord/axisModelCommonMixin.js | 88 -
builder/src/echarts3/coord/axisModelCreator.js | 35 -
builder/src/echarts3/coord/calendar/Calendar.js | 385 -
.../src/echarts3/coord/calendar/CalendarModel.js | 119 -
.../src/echarts3/coord/calendar/prepareCustom.js | 25 -
builder/src/echarts3/coord/cartesian/Axis2D.js | 117 -
builder/src/echarts3/coord/cartesian/AxisModel.js | 64 -
builder/src/echarts3/coord/cartesian/Cartesian.js | 99 -
.../src/echarts3/coord/cartesian/Cartesian2D.js | 78 -
builder/src/echarts3/coord/cartesian/Grid.js | 582 -
builder/src/echarts3/coord/cartesian/GridModel.js | 30 -
.../src/echarts3/coord/cartesian/prepareCustom.js | 30 -
builder/src/echarts3/coord/geo/Geo.js | 208 -
builder/src/echarts3/coord/geo/GeoModel.js | 124 -
builder/src/echarts3/coord/geo/Region.js | 158 -
builder/src/echarts3/coord/geo/fix/diaoyuIsland.js | 17 -
builder/src/echarts3/coord/geo/fix/geoCoord.js | 17 -
builder/src/echarts3/coord/geo/fix/nanhai.js | 25 -
builder/src/echarts3/coord/geo/fix/textCoord.js | 21 -
builder/src/echarts3/coord/geo/geoCreator.js | 188 -
builder/src/echarts3/coord/geo/parseGeoJson.js | 112 -
builder/src/echarts3/coord/geo/prepareCustom.js | 32 -
builder/src/echarts3/coord/parallel/AxisModel.js | 103 -
builder/src/echarts3/coord/parallel/Parallel.js | 460 -
.../src/echarts3/coord/parallel/ParallelAxis.js | 49 -
.../src/echarts3/coord/parallel/ParallelModel.js | 106 -
.../src/echarts3/coord/parallel/parallelCreator.js | 33 -
.../coord/parallel/parallelPreprocessor.js | 48 -
builder/src/echarts3/coord/polar/AngleAxis.js | 32 -
builder/src/echarts3/coord/polar/AxisModel.js | 49 -
builder/src/echarts3/coord/polar/Polar.js | 217 -
builder/src/echarts3/coord/polar/PolarModel.js | 32 -
builder/src/echarts3/coord/polar/RadiusAxis.js | 31 -
builder/src/echarts3/coord/polar/polarCreator.js | 114 -
builder/src/echarts3/coord/polar/prepareCustom.js | 44 -
builder/src/echarts3/coord/radar/IndicatorAxis.js | 31 -
builder/src/echarts3/coord/radar/Radar.js | 223 -
builder/src/echarts3/coord/radar/RadarModel.js | 113 -
builder/src/echarts3/coord/single/AxisModel.js | 73 -
builder/src/echarts3/coord/single/Single.js | 240 -
builder/src/echarts3/coord/single/SingleAxis.js | 91 -
builder/src/echarts3/coord/single/prepareCustom.js | 26 -
builder/src/echarts3/coord/single/singleCreator.js | 39 -
builder/src/echarts3/data/DataDiffer.js | 124 -
builder/src/echarts3/data/Graph.js | 528 -
builder/src/echarts3/data/List.js | 1208 -
builder/src/echarts3/data/Tree.js | 493 -
.../src/echarts3/data/helper/completeDimensions.js | 215 -
builder/src/echarts3/data/helper/linkList.js | 126 -
builder/src/echarts3/echarts.js | 1869 -
builder/src/echarts3/export.js | 32 -
builder/src/echarts3/helper.js | 67 -
builder/src/echarts3/lang.js | 39 -
builder/src/echarts3/langEN.js | 39 -
builder/src/echarts3/langFI.js | 39 -
builder/src/echarts3/layout/barGrid.js | 289 -
builder/src/echarts3/layout/barPolar.js | 248 -
builder/src/echarts3/layout/points.js | 29 -
builder/src/echarts3/loading/default.js | 89 -
builder/src/echarts3/model/Component.js | 177 -
builder/src/echarts3/model/Global.js | 633 -
builder/src/echarts3/model/Model.js | 183 -
builder/src/echarts3/model/OptionManager.js | 400 -
builder/src/echarts3/model/Series.js | 305 -
builder/src/echarts3/model/globalDefault.js | 51 -
builder/src/echarts3/model/mixin/areaStyle.js | 7 -
builder/src/echarts3/model/mixin/boxLayout.js | 12 -
builder/src/echarts3/model/mixin/colorPalette.js | 31 -
builder/src/echarts3/model/mixin/itemStyle.js | 14 -
builder/src/echarts3/model/mixin/lineStyle.js | 20 -
.../src/echarts3/model/mixin/makeStyleMapper.js | 31 -
builder/src/echarts3/model/mixin/textStyle.js | 30 -
.../src/echarts3/preprocessor/backwardCompat.js | 99 -
.../echarts3/preprocessor/helper/compatStyle.js | 178 -
builder/src/echarts3/processor/dataFilter.js | 24 -
builder/src/echarts3/processor/dataSample.js | 85 -
builder/src/echarts3/scale/Interval.js | 193 -
builder/src/echarts3/scale/Log.js | 161 -
builder/src/echarts3/scale/Ordinal.js | 87 -
builder/src/echarts3/scale/Scale.js | 162 -
builder/src/echarts3/scale/Time.js | 183 -
builder/src/echarts3/scale/helper.js | 99 -
builder/src/echarts3/util/KDTree.js | 249 -
builder/src/echarts3/util/animation.js | 97 -
builder/src/echarts3/util/array/nest.js | 101 -
builder/src/echarts3/util/clazz.js | 242 -
builder/src/echarts3/util/component.js | 172 -
builder/src/echarts3/util/format.js | 151 -
builder/src/echarts3/util/graphic.js | 981 -
builder/src/echarts3/util/layout.js | 460 -
builder/src/echarts3/util/model.js | 610 -
builder/src/echarts3/util/number.js | 456 -
builder/src/echarts3/util/quickSelect.js | 83 -
builder/src/echarts3/util/symbol.js | 296 -
builder/src/echarts3/util/throttle.js | 142 -
builder/src/echarts3/view/Chart.js | 137 -
builder/src/echarts3/view/Component.js | 36 -
builder/src/echarts3/visual/VisualMapping.js | 559 -
builder/src/echarts3/visual/dataColor.js | 39 -
builder/src/echarts3/visual/seriesColor.js | 32 -
builder/src/echarts3/visual/symbol.js | 39 -
builder/src/echarts3/visual/visualDefault.js | 48 -
builder/src/echarts3/visual/visualSolution.js | 134 -
builder/src/zrender/.eslintrc.yaml | 189 -
builder/src/zrender/Element.js | 264 -
builder/src/zrender/Handler.js | 429 -
builder/src/zrender/Layer.js | 229 -
builder/src/zrender/Painter.js | 1023 -
builder/src/zrender/Storage.js | 228 -
builder/src/zrender/animation/Animation.js | 240 -
builder/src/zrender/animation/Animator.js | 638 -
builder/src/zrender/animation/Clip.js | 100 -
builder/src/zrender/animation/easing.js | 377 -
.../src/zrender/animation/requestAnimationFrame.js | 4 -
builder/src/zrender/animation/track.js | 420 -
builder/src/zrender/config.js | 21 -
builder/src/zrender/contain/arc.js | 56 -
builder/src/zrender/contain/cubic.js | 31 -
builder/src/zrender/contain/line.js | 37 -
builder/src/zrender/contain/path.js | 382 -
builder/src/zrender/contain/polygon.js | 30 -
builder/src/zrender/contain/quadratic.js | 29 -
builder/src/zrender/contain/text.js | 686 -
builder/src/zrender/contain/util.js | 10 -
builder/src/zrender/contain/windingLine.js | 21 -
builder/src/zrender/container/Group.js | 308 -
builder/src/zrender/core/BoundingRect.js | 180 -
builder/src/zrender/core/GestureMgr.js | 98 -
builder/src/zrender/core/LRU.js | 201 -
builder/src/zrender/core/PathProxy.js | 762 -
builder/src/zrender/core/arrayDiff.js | 207 -
builder/src/zrender/core/arrayDiff2.js | 195 -
builder/src/zrender/core/bbox.js | 209 -
builder/src/zrender/core/curve.js | 504 -
builder/src/zrender/core/dom.js | 130 -
builder/src/zrender/core/env.js | 167 -
builder/src/zrender/core/event.js | 249 -
builder/src/zrender/core/fourPointsTransform.js | 92 -
builder/src/zrender/core/guid.js | 9 -
builder/src/zrender/core/log.js | 9 -
builder/src/zrender/core/matrix.js | 167 -
builder/src/zrender/core/timsort.js | 664 -
builder/src/zrender/core/util.js | 661 -
builder/src/zrender/core/vector.js | 268 -
builder/src/zrender/dom/HandlerProxy.js | 495 -
builder/src/zrender/export.js | 41 -
builder/src/zrender/graphic/CompoundPath.js | 53 -
builder/src/zrender/graphic/Displayable.js | 272 -
builder/src/zrender/graphic/Gradient.js | 17 -
builder/src/zrender/graphic/Image.js | 88 -
.../src/zrender/graphic/IncrementalDisplayable.js | 141 -
builder/src/zrender/graphic/LinearGradient.js | 32 -
builder/src/zrender/graphic/Path.js | 372 -
builder/src/zrender/graphic/Pattern.js | 14 -
builder/src/zrender/graphic/RadialGradient.js | 30 -
builder/src/zrender/graphic/States.js | 394 -
builder/src/zrender/graphic/Style.js | 473 -
builder/src/zrender/graphic/Text.js | 72 -
builder/src/zrender/graphic/constant.js | 7 -
.../zrender/graphic/helper/fixClipWithShadow.js | 52 -
builder/src/zrender/graphic/helper/fixShadow.js | 18 -
builder/src/zrender/graphic/helper/image.js | 82 -
builder/src/zrender/graphic/helper/poly.js | 33 -
builder/src/zrender/graphic/helper/roundRect.js | 88 -
builder/src/zrender/graphic/helper/smoothBezier.js | 94 -
builder/src/zrender/graphic/helper/smoothSpline.js | 63 -
.../src/zrender/graphic/helper/subPixelOptimize.js | 107 -
builder/src/zrender/graphic/helper/text.js | 521 -
builder/src/zrender/graphic/mixin/RectText.js | 56 -
builder/src/zrender/graphic/mixin/Stateful.js | 29 -
builder/src/zrender/graphic/shape/Arc.js | 32 -
builder/src/zrender/graphic/shape/BezierCurve.js | 101 -
builder/src/zrender/graphic/shape/Circle.js | 29 -
builder/src/zrender/graphic/shape/Droplet.js | 24 -
builder/src/zrender/graphic/shape/Ellipse.js | 32 -
builder/src/zrender/graphic/shape/Heart.js | 23 -
builder/src/zrender/graphic/shape/Isogon.js | 39 -
builder/src/zrender/graphic/shape/Line.js | 68 -
builder/src/zrender/graphic/shape/Polygon.js | 17 -
builder/src/zrender/graphic/shape/Polyline.js | 20 -
builder/src/zrender/graphic/shape/Rect.js | 54 -
builder/src/zrender/graphic/shape/Ring.js | 23 -
builder/src/zrender/graphic/shape/Rose.js | 43 -
builder/src/zrender/graphic/shape/Sector.js | 40 -
builder/src/zrender/graphic/shape/Star.js | 53 -
builder/src/zrender/graphic/shape/Trochoid.js | 57 -
builder/src/zrender/mixin/Animatable.js | 266 -
builder/src/zrender/mixin/Draggable.js | 85 -
builder/src/zrender/mixin/Eventful.js | 370 -
builder/src/zrender/mixin/Transformable.js | 321 -
builder/src/zrender/svg/Painter.js | 385 -
builder/src/zrender/svg/core.js | 4 -
builder/src/zrender/svg/graphic.js | 513 -
builder/src/zrender/svg/helper/ClippathManager.js | 152 -
builder/src/zrender/svg/helper/Definable.js | 253 -
builder/src/zrender/svg/helper/GradientManager.js | 203 -
builder/src/zrender/svg/helper/ShadowManager.js | 184 -
builder/src/zrender/svg/svg.js | 4 -
builder/src/zrender/tool/color.js | 608 -
builder/src/zrender/tool/parseSVG.js | 665 -
builder/src/zrender/tool/path.js | 431 -
builder/src/zrender/tool/transformPath.js | 94 -
builder/src/zrender/vml/Painter.js | 170 -
builder/src/zrender/vml/core.js | 41 -
builder/src/zrender/vml/graphic.js | 987 -
builder/src/zrender/vml/vml.js | 4 -
builder/src/zrender/zrender.js | 436 -
builder/src/zrender3/Element.js | 258 -
builder/src/zrender3/Handler.js | 316 -
builder/src/zrender3/Layer.js | 214 -
builder/src/zrender3/Painter.js | 1048 -
builder/src/zrender3/Storage.js | 236 -
builder/src/zrender3/animation/Animation.js | 231 -
builder/src/zrender3/animation/Animator.js | 638 -
builder/src/zrender3/animation/Clip.js | 100 -
builder/src/zrender3/animation/easing.js | 377 -
.../zrender3/animation/requestAnimationFrame.js | 4 -
builder/src/zrender3/config.js | 22 -
builder/src/zrender3/contain/arc.js | 56 -
builder/src/zrender3/contain/cubic.js | 31 -
builder/src/zrender3/contain/line.js | 37 -
builder/src/zrender3/contain/path.js | 381 -
builder/src/zrender3/contain/polygon.js | 30 -
builder/src/zrender3/contain/quadratic.js | 29 -
builder/src/zrender3/contain/text.js | 657 -
builder/src/zrender3/contain/util.js | 10 -
builder/src/zrender3/contain/windingLine.js | 20 -
builder/src/zrender3/container/Group.js | 308 -
builder/src/zrender3/core/BoundingRect.js | 180 -
builder/src/zrender3/core/GestureMgr.js | 98 -
builder/src/zrender3/core/LRU.js | 201 -
builder/src/zrender3/core/PathProxy.js | 755 -
builder/src/zrender3/core/arrayDiff.js | 207 -
builder/src/zrender3/core/arrayDiff2.js | 195 -
builder/src/zrender3/core/bbox.js | 209 -
builder/src/zrender3/core/curve.js | 504 -
builder/src/zrender3/core/env.js | 121 -
builder/src/zrender3/core/event.js | 135 -
builder/src/zrender3/core/guid.js | 9 -
builder/src/zrender3/core/log.js | 19 -
builder/src/zrender3/core/matrix.js | 155 -
builder/src/zrender3/core/timsort.js | 662 -
builder/src/zrender3/core/util.js | 604 -
builder/src/zrender3/core/vector.js | 267 -
builder/src/zrender3/dom/HandlerProxy.js | 323 -
builder/src/zrender3/export.js | 38 -
builder/src/zrender3/graphic/CompoundPath.js | 53 -
builder/src/zrender3/graphic/Displayable.js | 244 -
builder/src/zrender3/graphic/Gradient.js | 17 -
builder/src/zrender3/graphic/Image.js | 87 -
builder/src/zrender3/graphic/LinearGradient.js | 32 -
builder/src/zrender3/graphic/Path.js | 343 -
builder/src/zrender3/graphic/Pattern.js | 14 -
builder/src/zrender3/graphic/RadialGradient.js | 30 -
builder/src/zrender3/graphic/States.js | 391 -
builder/src/zrender3/graphic/Style.js | 446 -
builder/src/zrender3/graphic/Text.js | 67 -
.../zrender3/graphic/helper/fixClipWithShadow.js | 52 -
builder/src/zrender3/graphic/helper/image.js | 82 -
builder/src/zrender3/graphic/helper/poly.js | 33 -
builder/src/zrender3/graphic/helper/roundRect.js | 79 -
.../src/zrender3/graphic/helper/smoothBezier.js | 93 -
.../src/zrender3/graphic/helper/smoothSpline.js | 63 -
builder/src/zrender3/graphic/helper/text.js | 417 -
builder/src/zrender3/graphic/mixin/RectText.js | 52 -
builder/src/zrender3/graphic/mixin/Stateful.js | 29 -
builder/src/zrender3/graphic/shape/Arc.js | 32 -
builder/src/zrender3/graphic/shape/BezierCurve.js | 101 -
builder/src/zrender3/graphic/shape/Circle.js | 29 -
builder/src/zrender3/graphic/shape/Droplet.js | 24 -
builder/src/zrender3/graphic/shape/Ellipse.js | 32 -
builder/src/zrender3/graphic/shape/Heart.js | 23 -
builder/src/zrender3/graphic/shape/Isogon.js | 39 -
builder/src/zrender3/graphic/shape/Line.js | 51 -
builder/src/zrender3/graphic/shape/Polygon.js | 17 -
builder/src/zrender3/graphic/shape/Polyline.js | 20 -
builder/src/zrender3/graphic/shape/Rect.js | 36 -
builder/src/zrender3/graphic/shape/Ring.js | 23 -
builder/src/zrender3/graphic/shape/Rose.js | 43 -
builder/src/zrender3/graphic/shape/Sector.js | 40 -
builder/src/zrender3/graphic/shape/Star.js | 53 -
builder/src/zrender3/graphic/shape/Trochoid.js | 57 -
builder/src/zrender3/mixin/Animatable.js | 245 -
builder/src/zrender3/mixin/Draggable.js | 78 -
builder/src/zrender3/mixin/Eventful.js | 327 -
builder/src/zrender3/mixin/Transformable.js | 280 -
builder/src/zrender3/svg/Painter.js | 303 -
builder/src/zrender3/svg/core.js | 4 -
builder/src/zrender3/svg/graphic.js | 488 -
builder/src/zrender3/svg/helper/ClippathManager.js | 150 -
builder/src/zrender3/svg/helper/Definable.js | 246 -
builder/src/zrender3/svg/helper/GradientManager.js | 185 -
builder/src/zrender3/svg/svg.js | 4 -
builder/src/zrender3/tool/color.js | 602 -
builder/src/zrender3/tool/path.js | 400 -
builder/src/zrender3/tool/transformPath.js | 94 -
builder/src/zrender3/vml/Painter.js | 170 -
builder/src/zrender3/vml/core.js | 41 -
builder/src/zrender3/vml/graphic.js | 997 -
builder/src/zrender3/vml/vml.js | 4 -
builder/src/zrender3/zrender.js | 417 -
1014 files changed, 62015 insertions(+), 166750 deletions(-)
diff --git a/_jade/builder3.jade b/_jade/builder3.jade
deleted file mode 100644
index 2574b7c..0000000
--- a/_jade/builder3.jade
+++ /dev/null
@@ -1,4 +0,0 @@
-extends layouts/redirect
-
-block variables
- - var redirectTo = 'builder3.html'
diff --git a/_jade/components/builder.jade b/_jade/components/builder.jade
index 0244f9f..a5d8502 100644
--- a/_jade/components/builder.jade
+++ b/_jade/components/builder.jade
@@ -21,20 +21,21 @@ block content
#title.container
h1 #{isCN ? '在线定制' : 'Online Builder'}
if isCN
- p 可自由选择所需图表、坐标系、组件进行打包下载,并且可对渲染引擎、兼容及压缩问题进行设置
+ p 可自由选择所需图表、坐标系、组件进行打包下载。
+ p 注意:打包的源文件来自 jsdelivr CDN,非 Apache 官方源代码和编译产物
else
- p Pack and download the needed charts, coordinates or components<br>with the appropriate settings about rendering engine, compatibility and compression.
- div.download-version (version: #{downloadVersion})
+ p Pack and download the needed charts, coordinates or components.
+ p NOTE: The bundler download sources from jsdelivr CDN, It's not an official apache source release or distribution.
+ div.download-version
+ if isCN
+ span 选择版本
+ else
+ span Select a verion
+ select#versions
.page-content
#configuration.container
- if isCN
- if isECharts4
- a(href='builder3.html', style="float: right") 前往定制 3.x 版本
- else
- a(href='builder.html', style="float: right") 前往定制 4.x 版本
-
section#charts
h3 #{isCN ? '图表' : 'Chart'}
span #{isCN ? 'chart' : ''}
@@ -115,14 +116,6 @@ block content
p.desc Whether to Compress code. It is recommended not to compress code in the development environment, because warnings and hints will be removed after compressing.
#action
- //- if isCN
- //- p 感谢对ECharts关注与支持,为了更好地为您提供关于 ECharts 的相关资讯,您可以留下您的电子邮箱
- //- else
- //- p Thank you for your concern and support to ECharts. <br>For deep exchanges or providing more infomation about echarts for you, would you please leave your email:
- //- div
- //- input(type="text" name="email" id="email" placeholder="someone@email.com")
- //- .clear
- //- div
a.btn.btn-main.btn-thirdary#build(href="javascript:;") #{isCN ? '下载' : 'Download'}
if isCN
@@ -131,9 +124,23 @@ block content
include ../en/footer
block extra_js
- - var buildVersion = isECharts4 ? '4' : '3';
-
+ script(src="https://cdn.jsdelivr.net/npm/compare-versions@3.6.0/index.min.js")
script.
+ var $versionsDom = document.querySelector('#versions');
+
+ fetch('https://data.jsdelivr.com/v1/package/npm/echarts', {
+ mode: 'cors'
+ }).then(res => res.json()).then(json => {
+ const versions = json.versions.filter(version => compareVersions(version, '3.8.0') >= 0);
+ versions.forEach(version => {
+ const $optionDom = document.createElement('option');
+ $optionDom.value = version;
+ $optionDom.innerHTML = version;
+ $versionsDom.appendChild($optionDom);
+ });
+ $versionsDom.value = json.tags.latest;
+ });
+
function updateCheckbox() {
$('#charts input, #components input, #coords input').each(function () {
$(this).attr('checked', $(this).parent().hasClass('checked'));
@@ -178,8 +185,7 @@ block extra_js
parameters += '&api=true';
}
- parameters += '&version=#{buildVersion}'
- + '&versionCode=#{downloadVersion}';
+ parameters += `&version=${$versionsDom.value || ''}`;
//- var email = $('#email').val();
var log = parameters;
diff --git a/_scss/_pages.builder.scss b/_scss/_pages.builder.scss
index 431789d..6bcb9cc 100644
--- a/_scss/_pages.builder.scss
+++ b/_scss/_pages.builder.scss
@@ -26,9 +26,13 @@
}
}
.download-version {
- margin: 5px;
+ margin: 15px;
font-size: 18px;
font-weight: bold;
+
+ select {
+ margin-left: 10px;
+ }
}
}
@@ -110,13 +114,14 @@
}
&:hover {
- box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
+ box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
&.checked {
// box-shadow: 0px 0px 20px rgba(192, 55, 54, 1);
- box-shadow: 0px 0px 15px rgb(41, 60, 85);
- border: 1px solid rgba(41, 60, 85, 0.6);
+ box-shadow: 0px 0px 15px rgba(41, 60, 85, 0.2);
+ // border: 1px solid rgba(41, 60, 85, 0.2);
+ border-radius: 5px;
h5::before {
content: '';
@@ -126,8 +131,9 @@
background-image: url(../images/builder/checked.png);
display: inline-block;
position: absolute;
- right: 0;
- top: -105px;
+ right: -2px;
+ top: -107px;
+ border-radius: 0 3px 0 0;
}
}
}
diff --git a/builder/build.js b/builder/build.js
index 6875cba..6301166 100644
--- a/builder/build.js
+++ b/builder/build.js
@@ -4,125 +4,161 @@ define(function (require) {
// var mangleString = require('./mangleString');
var saveAs = require('./lib/FileSaver');
var rollup = require('rollup');
+ var transformDev = require('transformDev');
var TOP_MODULE_NAME = 'topModuleInRequireES';
- var RETRY_MAX = 5;
+ var RETRY_MAX = 2;
var TIMEOUT = 10000;
var RETRY_DELAY = 2000;
var $log = document.getElementById('log');
- var baseURL = dir(location.pathname);
- var suffix = BUILD_CONFIG.version === 3 ? '3' : '';
- var pathsConfig = {
- 'echarts/src': './src/echarts' + suffix,
- 'zrender/src': './src/zrender' + suffix
- };
+ var version = BUILD_CONFIG.version;
+ var isVersion5 = (version + '').startsWith('5');
+ var jsDelivrBase = 'https://cdn.jsdelivr.net/npm';
+
var urlArgs = '__v__=' + (+new Date());
- var topCode = [
- 'import "echarts/src/config";',
- 'export * from "echarts/src/echarts";'
- ];
+ var topCode = [`export * from "echarts/src/echarts";`];
if (BUILD_CONFIG.api) {
- topCode.push('export * from "echarts/src/export";');
+ topCode.push(`export * from "echarts/src/export";`);
}
// Including charts
(BUILD_CONFIG.charts || '').split(',').forEach(function (chart) {
- chart && topCode.push('import "echarts/src/chart/' + chart + '";');
+ chart && topCode.push(`import "echarts/src/chart/${chart}";`);
});
- if (topCode.indexOf('echarts/src/chart/scatter') >= 0) {
- topCode.push('import "echarts/src/chart/effectScatter"');
+ if (topCode.indexOf(`echarts/src/chart/scatter`) >= 0) {
+ topCode.push(`import "echarts/src/chart/effectScatter"`);
}
// Including components
(BUILD_CONFIG.components || '').split(',').forEach(function (component) {
- component && topCode.push('import "echarts/src/component/' + component + '";');
+ component && topCode.push(`import "echarts/src/component/${component}";`);
});
if (BUILD_CONFIG.vml) {
- topCode.push('import "zrender/src/vml/vml";');
+ topCode.push(`import "zrender/src/vml/vml";`);
}
if (BUILD_CONFIG.svg) {
- topCode.push('import "zrender/src/svg/svg";');
+ topCode.push(`import "zrender/src/svg/svg";`);
}
// Always require log and time axis
topCode.push(
- 'import "echarts/src/scale/Time";',
- 'import "echarts/src/scale/Log";'
+ `import "echarts/src/scale/Time";`,
+ `import "echarts/src/scale/Log";`
);
- // Loading scripts and build
- rollup.rollup({
- input: TOP_MODULE_NAME,
- legacy: true,
- plugins: [{
- resolveId: function (importee, importor) {
- if (importee === TOP_MODULE_NAME) {
- return importee;
+ var srcFolder = isVersion5 ? 'esm' : 'src';
+
+ var npmEntries = {};
+ var pathsConfig = {
+ 'echarts/src': `/echarts@${version}/${srcFolder}`
+ };
+
+ function resolveNpmDependencies(package, version) {
+ return fetch(`${jsDelivrBase}/${package}@${version}/package.json`, { mode: 'cors' })
+ .then(response => response.json())
+ .then(pkgCfg => {
+ var entry = pkgCfg.module || pkgCfg.main || 'index.js';
+ if (!entry.endsWith('.js')) {
+ entry = entry + '.js';
}
- // console.log('resolveid', importee, importor);
- return getAbsolutePath(
- importee,
- importor !== TOP_MODULE_NAME ? importor : null
- );
- },
- load: function (path) {
- if (path === TOP_MODULE_NAME) {
- return topCode.join('\n');
+ npmEntries[package] = `/${package}@${version}/${entry}`;
+
+ var promises = [];
+ for (let pkgName in pkgCfg.dependencies) {
+ var depVersion = pkgCfg.dependencies[pkgName];
+ pathsConfig[pkgName] = `/${pkgName}@${depVersion}`;
+ promises.push(resolveNpmDependencies(pkgName, depVersion));
}
+ return Promise.all(promises);
+ });
+ }
- var retryCount = 0;
- return new Promise(function (resolve, reject) {
- function retryableLoad() {
- // When using apache CDN, might fail to loading soource.
- if (retryCount >= RETRY_MAX) {
- var log = 'Loaded module failed: "' + path
- + '"<br><strong style="color:red">! Please reload page to retry. !</strong>';
- builderLog(log);
- return reject(log);
- }
- ajax(location.origin + path, TIMEOUT)
- .then(function (content) {
- builderLog('Loaded module: "' + path + '"');
- resolve(content);
- })
- .catch(function () {
- retryCount++;
- setTimeout(retryableLoad, RETRY_DELAY);
- });
+ resolveNpmDependencies('echarts', version)
+ .then(startRollup)
+ // Loading scripts and build
+
+ function startRollup() {
+ rollup.rollup({
+ input: TOP_MODULE_NAME,
+ legacy: true,
+ plugins: [{
+ resolveId: function (importee, importor) {
+ if (importee === TOP_MODULE_NAME) {
+ return importee;
+ }
+ // console.log('resolveid', importee, importor);
+ return getAbsolutePath(
+ importee,
+ importor !== TOP_MODULE_NAME ? importor : null
+ );
+ },
+ transform: function (code) {
+ return {
+ code: code.replace(/process.env.NODE_ENV/g, JSON.stringify(
+ !BUILD_CONFIG.source ? 'production' : 'development'
+ ))
+ };
+ },
+ load: function (path) {
+ if (path === TOP_MODULE_NAME) {
+ return topCode.join('\n');
}
- retryableLoad();
- });
+
+ var retryCount = 0;
+ return new Promise(function (resolve, reject) {
+ function retryableLoad() {
+ // When using apache CDN, might fail to loading soource.
+ if (retryCount >= RETRY_MAX) {
+ var log = 'Loaded module failed: "' + path
+ + '"<br><strong style="color:red">! Please reload page to retry. !</strong>';
+ builderLog(log);
+ return reject(log);
+ }
+ ajax(`${jsDelivrBase}/${path}`, TIMEOUT)
+ .then(function (content) {
+ builderLog('Loaded module: "' + path + '"');
+ resolve(content);
+ })
+ .catch(function () {
+ retryCount++;
+ setTimeout(retryableLoad, RETRY_DELAY);
+ });
+ }
+ retryableLoad();
+ });
+ }
+ }]
+ }).then(function (bundle) {
+ return bundle.generate({
+ name: 'echarts',
+ format: 'umd',
+ legacy: true
+ });
+ }).then(function (result) {
+ var code = result.code;
+ code = transformDev.transform(code, false, !BUILD_CONFIG.source ? 'false' : 'true').code;
+
+ if (!BUILD_CONFIG.source) {
+ builderLog('<br />Compressing code...');
+ // code = mangleString(code);
+ // Otherwise uglify will throw error.
+ code = code.replace(/\t/g, ' ');
+ code = jsCompress(code);
}
- }]
- }).then(function (bundle) {
- return bundle.generate({
- name: 'echarts',
- format: 'umd',
- legacy: true
- });
- }).then(function (result) {
- var code = result.code;
-
- if (!BUILD_CONFIG.source) {
- builderLog('<br />Compressing code...');
- // code = mangleString(code);
- // Otherwise uglify will throw error.
- code = code.replace(/\t/g, ' ');
- code = jsCompress(code);
- }
- download(code);
+ download(code);
- builderLog('<br />Completed');
+ builderLog('<br />Completed');
- document.getElementById('tip').innerHTML = 'OK';
- });
+ document.getElementById('tip').innerHTML = 'OK';
+ });
+ }
function download(code) {
try {
@@ -139,9 +175,6 @@ define(function (require) {
// return;
var fileName = ['echarts'];
- if (BUILD_CONFIG.amd) {
- fileName.push('amd');
- }
if (!BUILD_CONFIG.source) {
fileName.push('min');
}
@@ -177,13 +210,16 @@ define(function (require) {
// Get absolute path. `basePath` can be omitted if moduleId is absolute.
function getAbsolutePath(moduleId, basePath) {
+ if (npmEntries[moduleId]) {
+ return npmEntries[moduleId];
+ }
+
moduleId = addExt(moduleId);
for (var path in pathsConfig) {
if (pathsConfig.hasOwnProperty(path)) {
if (moduleId.indexOf(path) === 0) {
- moduleId = moduleId.replace(path, pathsConfig[path]);
- return resolve(baseURL, moduleId);
+ return moduleId.replace(path, pathsConfig[path]);
}
}
}
@@ -209,36 +245,9 @@ define(function (require) {
function ajax(toUrl, timeout) {
toUrl += '?' + urlArgs;
- return new Promise(function (promiseResolve, promiseReject) {
- var xhr = window.XMLHttpRequest
- ? new XMLHttpRequest()
- : new ActiveXObject('Microsoft.XMLHTTP');
-
- xhr.open('GET', toUrl, true);
-
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- (xhr.status >= 200 && xhr.status < 300)
- ? promiseResolve(xhr.responseText)
- : promiseReject({
- status: xhr.status,
- content: xhr.responseText
- });
- xhr.onreadystatechange = new Function();
- xhr = null;
- }
- };
-
- xhr.timeout = timeout; // in ms
- xhr.ontimeout = function () {
- promiseReject({
- status: 999,
- content: 'timeout'
- })
- };
-
- xhr.send(null);
- });
+ return fetch(toUrl, {
+ mode: 'cors'
+ }).then(response => response.text());
}
// Nodejs `path.resolve`.
diff --git a/builder/echarts.html b/builder/echarts.html
index 9d0678e..2d4d6dc 100644
--- a/builder/echarts.html
+++ b/builder/echarts.html
@@ -4,7 +4,6 @@
<meta charset="utf-8" />
<script src="lib/esl.js"></script>
<script src="lib/uglify.js"></script>
- <script src="lib/escodegen.js"></script>
<style type="text/css">
body {
@@ -46,15 +45,14 @@
}
}
- BUILD_CONFIG.version = +BUILD_CONFIG.version || 2;
+ BUILD_CONFIG.version = BUILD_CONFIG.version || 'latest';
var postfix = BUILD_CONFIG.dev ? '-dev' : '';
require.config({
paths: {
'rollup': 'lib/rollup.browser',
- 'esprima': 'lib/esprima',
- 'estraverse': 'lib/estraverse'
+ 'transformDev': 'lib/transform-dev-bundle'
},
urlArgs: 'v=4.3.0'
});
@@ -62,7 +60,7 @@
require(['build']);
function parseURIValue(value) { // for XSS
- return value.replace(/[^0-9a-zA-Z-_,]/g, '');
+ return value.replace(/[^0-9a-zA-Z-_,.]/g, '');
}
</script>
diff --git a/builder/lib/transform-dev-bundle.js b/builder/lib/transform-dev-bundle.js
new file mode 100644
index 0000000..9702c7e
--- /dev/null
+++ b/builder/lib/transform-dev-bundle.js
@@ -0,0 +1,61850 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.transformDev = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)ret [...]
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+const babel = require('@babel/core');
+const parser = require('@babel/parser');
+
+function transformDEVPlugin ({types, template}) {
+ return {
+ visitor: {
+ Identifier: {
+ enter(path, state) {
+ if (path.isIdentifier({ name: '__DEV__' }) && path.scope.hasGlobal('__DEV__')) {
+ path.replaceWith(
+ parser.parseExpression(state.opts.expr)
+ );
+ }
+ }
+ }
+ }
+ };
+};
+
+
+module.exports.transform = function (sourceCode, sourcemap, expr) {
+ let {code, map} = babel.transformSync(sourceCode, {
+ plugins: [ [transformDEVPlugin, {
+ expr: expr || 'process.env.NODE_ENV !== \'production\''
+ }] ],
+ compact: false,
+ sourceMaps: sourcemap
+ });
+
+ return {code, map};
+};
+
+/**
+ * @param {string} code
+ * @throws {Error} If check failed.
+ */
+module.exports.recheckDEV = function (code) {
+ return code.indexOf('process.env.NODE_ENV') >= 0;
+};
+
+},{"@babel/core":20,"@babel/parser":67}],2:[function(require,module,exports){
+(function (process){(function (){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.codeFrameColumns = codeFrameColumns;
+exports.default = _default;
+
+var _highlight = _interopRequireWildcard(require("@babel/highlight"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescript [...]
+
+let deprecationWarningShown = false;
+
+function getDefs(chalk) {
+ return {
+ gutter: chalk.grey,
+ marker: chalk.red.bold,
+ message: chalk.red.bold
+ };
+}
+
+const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
+
+function getMarkerLines(loc, source, opts) {
+ const startLoc = Object.assign({
+ column: 0,
+ line: -1
+ }, loc.start);
+ const endLoc = Object.assign({}, startLoc, loc.end);
+ const {
+ linesAbove = 2,
+ linesBelow = 3
+ } = opts || {};
+ const startLine = startLoc.line;
+ const startColumn = startLoc.column;
+ const endLine = endLoc.line;
+ const endColumn = endLoc.column;
+ let start = Math.max(startLine - (linesAbove + 1), 0);
+ let end = Math.min(source.length, endLine + linesBelow);
+
+ if (startLine === -1) {
+ start = 0;
+ }
+
+ if (endLine === -1) {
+ end = source.length;
+ }
+
+ const lineDiff = endLine - startLine;
+ const markerLines = {};
+
+ if (lineDiff) {
+ for (let i = 0; i <= lineDiff; i++) {
+ const lineNumber = i + startLine;
+
+ if (!startColumn) {
+ markerLines[lineNumber] = true;
+ } else if (i === 0) {
+ const sourceLength = source[lineNumber - 1].length;
+ markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
+ } else if (i === lineDiff) {
+ markerLines[lineNumber] = [0, endColumn];
+ } else {
+ const sourceLength = source[lineNumber - i].length;
+ markerLines[lineNumber] = [0, sourceLength];
+ }
+ }
+ } else {
+ if (startColumn === endColumn) {
+ if (startColumn) {
+ markerLines[startLine] = [startColumn, 0];
+ } else {
+ markerLines[startLine] = true;
+ }
+ } else {
+ markerLines[startLine] = [startColumn, endColumn - startColumn];
+ }
+ }
+
+ return {
+ start,
+ end,
+ markerLines
+ };
+}
+
+function codeFrameColumns(rawLines, loc, opts = {}) {
+ const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
+ const chalk = (0, _highlight.getChalk)(opts);
+ const defs = getDefs(chalk);
+
+ const maybeHighlight = (chalkFn, string) => {
+ return highlighted ? chalkFn(string) : string;
+ };
+
+ const lines = rawLines.split(NEWLINE);
+ const {
+ start,
+ end,
+ markerLines
+ } = getMarkerLines(loc, lines, opts);
+ const hasColumns = loc.start && typeof loc.start.column === "number";
+ const numberMaxWidth = String(end).length;
+ const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
+ let frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
+ const number = start + 1 + index;
+ const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
+ const gutter = ` ${paddedNumber} | `;
+ const hasMarker = markerLines[number];
+ const lastMarkerLine = !markerLines[number + 1];
+
+ if (hasMarker) {
+ let markerLine = "";
+
+ if (Array.isArray(hasMarker)) {
+ const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
+ const numberOfMarkers = hasMarker[1] || 1;
+ markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
+
+ if (lastMarkerLine && opts.message) {
+ markerLine += " " + maybeHighlight(defs.message, opts.message);
+ }
+ }
+
+ return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
+ } else {
+ return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;
+ }
+ }).join("\n");
+
+ if (opts.message && !hasColumns) {
+ frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
+ }
+
+ if (highlighted) {
+ return chalk.reset(frame);
+ } else {
+ return frame;
+ }
+}
+
+function _default(rawLines, lineNumber, colNumber, opts = {}) {
+ if (!deprecationWarningShown) {
+ deprecationWarningShown = true;
+ const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
+
+ if (process.emitWarning) {
+ process.emitWarning(message, "DeprecationWarning");
+ } else {
+ const deprecationError = new Error(message);
+ deprecationError.name = "DeprecationWarning";
+ console.warn(new Error(message));
+ }
+ }
+
+ colNumber = Math.max(colNumber, 0);
+ const location = {
+ start: {
+ column: colNumber,
+ line: lineNumber
+ }
+ };
+ return codeFrameColumns(rawLines, location, opts);
+}
+}).call(this)}).call(this,require('_process'))
+},{"@babel/highlight":64,"_process":386}],3:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.makeStrongCache = makeStrongCache;
+exports.makeWeakCache = makeWeakCache;
+exports.assertSimpleType = assertSimpleType;
+
+function makeStrongCache(handler) {
+ return makeCachedFunction(new Map(), handler);
+}
+
+function makeWeakCache(handler) {
+ return makeCachedFunction(new WeakMap(), handler);
+}
+
+function makeCachedFunction(callCache, handler) {
+ return function cachedFunction(arg, data) {
+ let cachedValue = callCache.get(arg);
+
+ if (cachedValue) {
+ for (const _ref of cachedValue) {
+ const {
+ value,
+ valid
+ } = _ref;
+ if (valid(data)) return value;
+ }
+ }
+
+ const cache = new CacheConfigurator(data);
+ const value = handler(arg, cache);
+ if (!cache.configured()) cache.forever();
+ cache.deactivate();
+
+ switch (cache.mode()) {
+ case "forever":
+ cachedValue = [{
+ value,
+ valid: () => true
+ }];
+ callCache.set(arg, cachedValue);
+ break;
+
+ case "invalidate":
+ cachedValue = [{
+ value,
+ valid: cache.validator()
+ }];
+ callCache.set(arg, cachedValue);
+ break;
+
+ case "valid":
+ if (cachedValue) {
+ cachedValue.push({
+ value,
+ valid: cache.validator()
+ });
+ } else {
+ cachedValue = [{
+ value,
+ valid: cache.validator()
+ }];
+ callCache.set(arg, cachedValue);
+ }
+
+ }
+
+ return value;
+ };
+}
+
+class CacheConfigurator {
+ constructor(data) {
+ this._active = true;
+ this._never = false;
+ this._forever = false;
+ this._invalidate = false;
+ this._configured = false;
+ this._pairs = [];
+ this._data = data;
+ }
+
+ simple() {
+ return makeSimpleConfigurator(this);
+ }
+
+ mode() {
+ if (this._never) return "never";
+ if (this._forever) return "forever";
+ if (this._invalidate) return "invalidate";
+ return "valid";
+ }
+
+ forever() {
+ if (!this._active) {
+ throw new Error("Cannot change caching after evaluation has completed.");
+ }
+
+ if (this._never) {
+ throw new Error("Caching has already been configured with .never()");
+ }
+
+ this._forever = true;
+ this._configured = true;
+ }
+
+ never() {
+ if (!this._active) {
+ throw new Error("Cannot change caching after evaluation has completed.");
+ }
+
+ if (this._forever) {
+ throw new Error("Caching has already been configured with .forever()");
+ }
+
+ this._never = true;
+ this._configured = true;
+ }
+
+ using(handler) {
+ if (!this._active) {
+ throw new Error("Cannot change caching after evaluation has completed.");
+ }
+
+ if (this._never || this._forever) {
+ throw new Error("Caching has already been configured with .never or .forever()");
+ }
+
+ this._configured = true;
+ const key = handler(this._data);
+
+ this._pairs.push([key, handler]);
+
+ return key;
+ }
+
+ invalidate(handler) {
+ if (!this._active) {
+ throw new Error("Cannot change caching after evaluation has completed.");
+ }
+
+ if (this._never || this._forever) {
+ throw new Error("Caching has already been configured with .never or .forever()");
+ }
+
+ this._invalidate = true;
+ this._configured = true;
+ const key = handler(this._data);
+
+ this._pairs.push([key, handler]);
+
+ return key;
+ }
+
+ validator() {
+ const pairs = this._pairs;
+ return data => pairs.every(([key, fn]) => key === fn(data));
+ }
+
+ deactivate() {
+ this._active = false;
+ }
+
+ configured() {
+ return this._configured;
+ }
+
+}
+
+function makeSimpleConfigurator(cache) {
+ function cacheFn(val) {
+ if (typeof val === "boolean") {
+ if (val) cache.forever();else cache.never();
+ return;
+ }
+
+ return cache.using(() => assertSimpleType(val()));
+ }
+
+ cacheFn.forever = () => cache.forever();
+
+ cacheFn.never = () => cache.never();
+
+ cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));
+
+ cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));
+
+ return cacheFn;
+}
+
+function assertSimpleType(value) {
+ if (value != null && typeof value !== "string" && typeof value !== "boolean" && typeof value !== "number") {
+ throw new Error("Cache keys must be either string, boolean, number, null, or undefined.");
+ }
+
+ return value;
+}
+},{}],4:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.buildPresetChain = buildPresetChain;
+exports.buildRootChain = buildRootChain;
+exports.buildPresetChainWalker = void 0;
+
+function _path() {
+ const data = _interopRequireDefault(require("path"));
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _debug() {
+ const data = _interopRequireDefault(require("debug"));
+
+ _debug = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _options = require("./validation/options");
+
+var _patternToRegex = _interopRequireDefault(require("./pattern-to-regex"));
+
+var _files = require("./files");
+
+var _caching = require("./caching");
+
+var _configDescriptors = require("./config-descriptors");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const debug = (0, _debug().default)("babel:config:config-chain");
+
+function buildPresetChain(arg, context) {
+ const chain = buildPresetChainWalker(arg, context);
+ if (!chain) return null;
+ return {
+ plugins: dedupDescriptors(chain.plugins),
+ presets: dedupDescriptors(chain.presets),
+ options: chain.options.map(o => normalizeOptions(o))
+ };
+}
+
+const buildPresetChainWalker = makeChainWalker({
+ init: arg => arg,
+ root: preset => loadPresetDescriptors(preset),
+ env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),
+ overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),
+ overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName)
+});
+exports.buildPresetChainWalker = buildPresetChainWalker;
+const loadPresetDescriptors = (0, _caching.makeWeakCache)(preset => buildRootDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors));
+const loadPresetEnvDescriptors = (0, _caching.makeWeakCache)(preset => (0, _caching.makeStrongCache)(envName => buildEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, envName)));
+const loadPresetOverridesDescriptors = (0, _caching.makeWeakCache)(preset => (0, _caching.makeStrongCache)(index => buildOverrideDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index)));
+const loadPresetOverridesEnvDescriptors = (0, _caching.makeWeakCache)(preset => (0, _caching.makeStrongCache)(index => (0, _caching.makeStrongCache)(envName => buildOverrideEnvDescriptors(preset, preset.alias, _configDescriptors.createUncachedDescriptors, index, envName))));
+
+function buildRootChain(opts, context) {
+ const programmaticChain = loadProgrammaticChain({
+ options: opts,
+ dirname: context.cwd
+ }, context);
+ if (!programmaticChain) return null;
+ let configFile;
+
+ if (typeof opts.configFile === "string") {
+ configFile = (0, _files.loadConfig)(opts.configFile, context.cwd, context.envName, context.caller);
+ } else if (opts.configFile !== false) {
+ configFile = (0, _files.findRootConfig)(context.root, context.envName, context.caller);
+ }
+
+ let {
+ babelrc,
+ babelrcRoots
+ } = opts;
+ let babelrcRootsDirectory = context.cwd;
+ const configFileChain = emptyChain();
+
+ if (configFile) {
+ const validatedFile = validateConfigFile(configFile);
+ const result = loadFileChain(validatedFile, context);
+ if (!result) return null;
+
+ if (babelrc === undefined) {
+ babelrc = validatedFile.options.babelrc;
+ }
+
+ if (babelrcRoots === undefined) {
+ babelrcRootsDirectory = validatedFile.dirname;
+ babelrcRoots = validatedFile.options.babelrcRoots;
+ }
+
+ mergeChain(configFileChain, result);
+ }
+
+ const pkgData = typeof context.filename === "string" ? (0, _files.findPackageData)(context.filename) : null;
+ let ignoreFile, babelrcFile;
+ const fileChain = emptyChain();
+
+ if ((babelrc === true || babelrc === undefined) && pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)) {
+ ({
+ ignore: ignoreFile,
+ config: babelrcFile
+ } = (0, _files.findRelativeConfig)(pkgData, context.envName, context.caller));
+
+ if (ignoreFile && shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)) {
+ return null;
+ }
+
+ if (babelrcFile) {
+ const result = loadFileChain(validateBabelrcFile(babelrcFile), context);
+ if (!result) return null;
+ mergeChain(fileChain, result);
+ }
+ }
+
+ const chain = mergeChain(mergeChain(mergeChain(emptyChain(), configFileChain), fileChain), programmaticChain);
+ return {
+ plugins: dedupDescriptors(chain.plugins),
+ presets: dedupDescriptors(chain.presets),
+ options: chain.options.map(o => normalizeOptions(o)),
+ ignore: ignoreFile || undefined,
+ babelrc: babelrcFile || undefined,
+ config: configFile || undefined
+ };
+}
+
+function babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) {
+ if (typeof babelrcRoots === "boolean") return babelrcRoots;
+ const absoluteRoot = context.root;
+
+ if (babelrcRoots === undefined) {
+ return pkgData.directories.indexOf(absoluteRoot) !== -1;
+ }
+
+ let babelrcPatterns = babelrcRoots;
+ if (!Array.isArray(babelrcPatterns)) babelrcPatterns = [babelrcPatterns];
+ babelrcPatterns = babelrcPatterns.map(pat => {
+ return typeof pat === "string" ? _path().default.resolve(babelrcRootsDirectory, pat) : pat;
+ });
+
+ if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {
+ return pkgData.directories.indexOf(absoluteRoot) !== -1;
+ }
+
+ return babelrcPatterns.some(pat => {
+ if (typeof pat === "string") {
+ pat = (0, _patternToRegex.default)(pat, babelrcRootsDirectory);
+ }
+
+ return pkgData.directories.some(directory => {
+ return matchPattern(pat, babelrcRootsDirectory, directory, context);
+ });
+ });
+}
+
+const validateConfigFile = (0, _caching.makeWeakCache)(file => ({
+ filepath: file.filepath,
+ dirname: file.dirname,
+ options: (0, _options.validate)("configfile", file.options)
+}));
+const validateBabelrcFile = (0, _caching.makeWeakCache)(file => ({
+ filepath: file.filepath,
+ dirname: file.dirname,
+ options: (0, _options.validate)("babelrcfile", file.options)
+}));
+const validateExtendFile = (0, _caching.makeWeakCache)(file => ({
+ filepath: file.filepath,
+ dirname: file.dirname,
+ options: (0, _options.validate)("extendsfile", file.options)
+}));
+const loadProgrammaticChain = makeChainWalker({
+ root: input => buildRootDescriptors(input, "base", _configDescriptors.createCachedDescriptors),
+ env: (input, envName) => buildEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, envName),
+ overrides: (input, index) => buildOverrideDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index),
+ overridesEnv: (input, index, envName) => buildOverrideEnvDescriptors(input, "base", _configDescriptors.createCachedDescriptors, index, envName)
+});
+const loadFileChain = makeChainWalker({
+ root: file => loadFileDescriptors(file),
+ env: (file, envName) => loadFileEnvDescriptors(file)(envName),
+ overrides: (file, index) => loadFileOverridesDescriptors(file)(index),
+ overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName)
+});
+const loadFileDescriptors = (0, _caching.makeWeakCache)(file => buildRootDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors));
+const loadFileEnvDescriptors = (0, _caching.makeWeakCache)(file => (0, _caching.makeStrongCache)(envName => buildEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, envName)));
+const loadFileOverridesDescriptors = (0, _caching.makeWeakCache)(file => (0, _caching.makeStrongCache)(index => buildOverrideDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index)));
+const loadFileOverridesEnvDescriptors = (0, _caching.makeWeakCache)(file => (0, _caching.makeStrongCache)(index => (0, _caching.makeStrongCache)(envName => buildOverrideEnvDescriptors(file, file.filepath, _configDescriptors.createUncachedDescriptors, index, envName))));
+
+function buildRootDescriptors({
+ dirname,
+ options
+}, alias, descriptors) {
+ return descriptors(dirname, options, alias);
+}
+
+function buildEnvDescriptors({
+ dirname,
+ options
+}, alias, descriptors, envName) {
+ const opts = options.env && options.env[envName];
+ return opts ? descriptors(dirname, opts, `${alias}.env["${envName}"]`) : null;
+}
+
+function buildOverrideDescriptors({
+ dirname,
+ options
+}, alias, descriptors, index) {
+ const opts = options.overrides && options.overrides[index];
+ if (!opts) throw new Error("Assertion failure - missing override");
+ return descriptors(dirname, opts, `${alias}.overrides[${index}]`);
+}
+
+function buildOverrideEnvDescriptors({
+ dirname,
+ options
+}, alias, descriptors, index, envName) {
+ const override = options.overrides && options.overrides[index];
+ if (!override) throw new Error("Assertion failure - missing override");
+ const opts = override.env && override.env[envName];
+ return opts ? descriptors(dirname, opts, `${alias}.overrides[${index}].env["${envName}"]`) : null;
+}
+
+function makeChainWalker({
+ root,
+ env,
+ overrides,
+ overridesEnv
+}) {
+ return (input, context, files = new Set()) => {
+ const {
+ dirname
+ } = input;
+ const flattenedConfigs = [];
+ const rootOpts = root(input);
+
+ if (configIsApplicable(rootOpts, dirname, context)) {
+ flattenedConfigs.push(rootOpts);
+ const envOpts = env(input, context.envName);
+
+ if (envOpts && configIsApplicable(envOpts, dirname, context)) {
+ flattenedConfigs.push(envOpts);
+ }
+
+ (rootOpts.options.overrides || []).forEach((_, index) => {
+ const overrideOps = overrides(input, index);
+
+ if (configIsApplicable(overrideOps, dirname, context)) {
+ flattenedConfigs.push(overrideOps);
+ const overrideEnvOpts = overridesEnv(input, index, context.envName);
+
+ if (overrideEnvOpts && configIsApplicable(overrideEnvOpts, dirname, context)) {
+ flattenedConfigs.push(overrideEnvOpts);
+ }
+ }
+ });
+ }
+
+ if (flattenedConfigs.some(({
+ options: {
+ ignore,
+ only
+ }
+ }) => shouldIgnore(context, ignore, only, dirname))) {
+ return null;
+ }
+
+ const chain = emptyChain();
+
+ for (const op of flattenedConfigs) {
+ if (!mergeExtendsChain(chain, op.options, dirname, context, files)) {
+ return null;
+ }
+
+ mergeChainOpts(chain, op);
+ }
+
+ return chain;
+ };
+}
+
+function mergeExtendsChain(chain, opts, dirname, context, files) {
+ if (opts.extends === undefined) return true;
+ const file = (0, _files.loadConfig)(opts.extends, dirname, context.envName, context.caller);
+
+ if (files.has(file)) {
+ throw new Error(`Configuration cycle detected loading ${file.filepath}.\n` + `File already loaded following the config chain:\n` + Array.from(files, file => ` - ${file.filepath}`).join("\n"));
+ }
+
+ files.add(file);
+ const fileChain = loadFileChain(validateExtendFile(file), context, files);
+ files.delete(file);
+ if (!fileChain) return false;
+ mergeChain(chain, fileChain);
+ return true;
+}
+
+function mergeChain(target, source) {
+ target.options.push(...source.options);
+ target.plugins.push(...source.plugins);
+ target.presets.push(...source.presets);
+ return target;
+}
+
+function mergeChainOpts(target, {
+ options,
+ plugins,
+ presets
+}) {
+ target.options.push(options);
+ target.plugins.push(...plugins());
+ target.presets.push(...presets());
+ return target;
+}
+
+function emptyChain() {
+ return {
+ options: [],
+ presets: [],
+ plugins: []
+ };
+}
+
+function normalizeOptions(opts) {
+ const options = Object.assign({}, opts);
+ delete options.extends;
+ delete options.env;
+ delete options.overrides;
+ delete options.plugins;
+ delete options.presets;
+ delete options.passPerPreset;
+ delete options.ignore;
+ delete options.only;
+ delete options.test;
+ delete options.include;
+ delete options.exclude;
+
+ if (options.hasOwnProperty("sourceMap")) {
+ options.sourceMaps = options.sourceMap;
+ delete options.sourceMap;
+ }
+
+ return options;
+}
+
+function dedupDescriptors(items) {
+ const map = new Map();
+ const descriptors = [];
+
+ for (const item of items) {
+ if (typeof item.value === "function") {
+ const fnKey = item.value;
+ let nameMap = map.get(fnKey);
+
+ if (!nameMap) {
+ nameMap = new Map();
+ map.set(fnKey, nameMap);
+ }
+
+ let desc = nameMap.get(item.name);
+
+ if (!desc) {
+ desc = {
+ value: item
+ };
+ descriptors.push(desc);
+ if (!item.ownPass) nameMap.set(item.name, desc);
+ } else {
+ desc.value = item;
+ }
+ } else {
+ descriptors.push({
+ value: item
+ });
+ }
+ }
+
+ return descriptors.reduce((acc, desc) => {
+ acc.push(desc.value);
+ return acc;
+ }, []);
+}
+
+function configIsApplicable({
+ options
+}, dirname, context) {
+ return (options.test === undefined || configFieldIsApplicable(context, options.test, dirname)) && (options.include === undefined || configFieldIsApplicable(context, options.include, dirname)) && (options.exclude === undefined || !configFieldIsApplicable(context, options.exclude, dirname));
+}
+
+function configFieldIsApplicable(context, test, dirname) {
+ const patterns = Array.isArray(test) ? test : [test];
+ return matchesPatterns(context, patterns, dirname);
+}
+
+function shouldIgnore(context, ignore, only, dirname) {
+ if (ignore && matchesPatterns(context, ignore, dirname)) {
+ debug("Ignored %o because it matched one of %O from %o", context.filename, ignore, dirname);
+ return true;
+ }
+
+ if (only && !matchesPatterns(context, only, dirname)) {
+ debug("Ignored %o because it failed to match one of %O from %o", context.filename, only, dirname);
+ return true;
+ }
+
+ return false;
+}
+
+function matchesPatterns(context, patterns, dirname) {
+ return patterns.some(pattern => matchPattern(pattern, dirname, context.filename, context));
+}
+
+function matchPattern(pattern, dirname, pathToTest, context) {
+ if (typeof pattern === "function") {
+ return !!pattern(pathToTest, {
+ dirname,
+ envName: context.envName,
+ caller: context.caller
+ });
+ }
+
+ if (typeof pathToTest !== "string") {
+ throw new Error(`Configuration contains string/RegExp pattern, but no filename was passed to Babel`);
+ }
+
+ if (typeof pattern === "string") {
+ pattern = (0, _patternToRegex.default)(pattern, dirname);
+ }
+
+ return pattern.test(pathToTest);
+}
+},{"./caching":3,"./config-descriptors":5,"./files":6,"./pattern-to-regex":13,"./validation/options":17,"debug":185,"path":385}],5:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.createCachedDescriptors = createCachedDescriptors;
+exports.createUncachedDescriptors = createUncachedDescriptors;
+exports.createDescriptor = createDescriptor;
+
+var _files = require("./files");
+
+var _item = require("./item");
+
+var _caching = require("./caching");
+
+function isEqualDescriptor(a, b) {
+ return a.name === b.name && a.value === b.value && a.options === b.options && a.dirname === b.dirname && a.alias === b.alias && a.ownPass === b.ownPass && (a.file && a.file.request) === (b.file && b.file.request) && (a.file && a.file.resolved) === (b.file && b.file.resolved);
+}
+
+function createCachedDescriptors(dirname, options, alias) {
+ const {
+ plugins,
+ presets,
+ passPerPreset
+ } = options;
+ return {
+ options,
+ plugins: plugins ? () => createCachedPluginDescriptors(plugins, dirname)(alias) : () => [],
+ presets: presets ? () => createCachedPresetDescriptors(presets, dirname)(alias)(!!passPerPreset) : () => []
+ };
+}
+
+function createUncachedDescriptors(dirname, options, alias) {
+ let plugins;
+ let presets;
+ return {
+ options,
+ plugins: () => {
+ if (!plugins) {
+ plugins = createPluginDescriptors(options.plugins || [], dirname, alias);
+ }
+
+ return plugins;
+ },
+ presets: () => {
+ if (!presets) {
+ presets = createPresetDescriptors(options.presets || [], dirname, alias, !!options.passPerPreset);
+ }
+
+ return presets;
+ }
+ };
+}
+
+const PRESET_DESCRIPTOR_CACHE = new WeakMap();
+const createCachedPresetDescriptors = (0, _caching.makeWeakCache)((items, cache) => {
+ const dirname = cache.using(dir => dir);
+ return (0, _caching.makeStrongCache)(alias => (0, _caching.makeStrongCache)(passPerPreset => createPresetDescriptors(items, dirname, alias, passPerPreset).map(desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc))));
+});
+const PLUGIN_DESCRIPTOR_CACHE = new WeakMap();
+const createCachedPluginDescriptors = (0, _caching.makeWeakCache)((items, cache) => {
+ const dirname = cache.using(dir => dir);
+ return (0, _caching.makeStrongCache)(alias => createPluginDescriptors(items, dirname, alias).map(desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc)));
+});
+const DEFAULT_OPTIONS = {};
+
+function loadCachedDescriptor(cache, desc) {
+ const {
+ value,
+ options = DEFAULT_OPTIONS
+ } = desc;
+ if (options === false) return desc;
+ let cacheByOptions = cache.get(value);
+
+ if (!cacheByOptions) {
+ cacheByOptions = new WeakMap();
+ cache.set(value, cacheByOptions);
+ }
+
+ let possibilities = cacheByOptions.get(options);
+
+ if (!possibilities) {
+ possibilities = [];
+ cacheByOptions.set(options, possibilities);
+ }
+
+ if (possibilities.indexOf(desc) === -1) {
+ const matches = possibilities.filter(possibility => isEqualDescriptor(possibility, desc));
+
+ if (matches.length > 0) {
+ return matches[0];
+ }
+
+ possibilities.push(desc);
+ }
+
+ return desc;
+}
+
+function createPresetDescriptors(items, dirname, alias, passPerPreset) {
+ return createDescriptors("preset", items, dirname, alias, passPerPreset);
+}
+
+function createPluginDescriptors(items, dirname, alias) {
+ return createDescriptors("plugin", items, dirname, alias);
+}
+
+function createDescriptors(type, items, dirname, alias, ownPass) {
+ const descriptors = items.map((item, index) => createDescriptor(item, dirname, {
+ type,
+ alias: `${alias}$${index}`,
+ ownPass: !!ownPass
+ }));
+ assertNoDuplicates(descriptors);
+ return descriptors;
+}
+
+function createDescriptor(pair, dirname, {
+ type,
+ alias,
+ ownPass
+}) {
+ const desc = (0, _item.getItemDescriptor)(pair);
+
+ if (desc) {
+ return desc;
+ }
+
+ let name;
+ let options;
+ let value = pair;
+
+ if (Array.isArray(value)) {
+ if (value.length === 3) {
+ [value, options, name] = value;
+ } else {
+ [value, options] = value;
+ }
+ }
+
+ let file = undefined;
+ let filepath = null;
+
+ if (typeof value === "string") {
+ if (typeof type !== "string") {
+ throw new Error("To resolve a string-based item, the type of item must be given");
+ }
+
+ const resolver = type === "plugin" ? _files.loadPlugin : _files.loadPreset;
+ const request = value;
+ ({
+ filepath,
+ value
+ } = resolver(value, dirname));
+ file = {
+ request,
+ resolved: filepath
+ };
+ }
+
+ if (!value) {
+ throw new Error(`Unexpected falsy value: ${String(value)}`);
+ }
+
+ if (typeof value === "object" && value.__esModule) {
+ if (value.default) {
+ value = value.default;
+ } else {
+ throw new Error("Must export a default export when using ES6 modules.");
+ }
+ }
+
+ if (typeof value !== "object" && typeof value !== "function") {
+ throw new Error(`Unsupported format: ${typeof value}. Expected an object or a function.`);
+ }
+
+ if (filepath !== null && typeof value === "object" && value) {
+ throw new Error(`Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`);
+ }
+
+ return {
+ name,
+ alias: filepath || alias,
+ value,
+ options,
+ dirname,
+ ownPass,
+ file
+ };
+}
+
+function assertNoDuplicates(items) {
+ const map = new Map();
+
+ for (const item of items) {
+ if (typeof item.value !== "function") continue;
+ let nameMap = map.get(item.value);
+
+ if (!nameMap) {
+ nameMap = new Set();
+ map.set(item.value, nameMap);
+ }
+
+ if (nameMap.has(item.name)) {
+ throw new Error([`Duplicate plugin/preset detected.`, `If you'd like to use two separate instances of a plugin,`, `they need separate names, e.g.`, ``, ` plugins: [`, ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`].join("\n"));
+ }
+
+ nameMap.add(item.name);
+ }
+}
+},{"./caching":3,"./files":6,"./item":11}],6:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.findConfigUpwards = findConfigUpwards;
+exports.findPackageData = findPackageData;
+exports.findRelativeConfig = findRelativeConfig;
+exports.findRootConfig = findRootConfig;
+exports.loadConfig = loadConfig;
+exports.resolvePlugin = resolvePlugin;
+exports.resolvePreset = resolvePreset;
+exports.loadPlugin = loadPlugin;
+exports.loadPreset = loadPreset;
+
+function findConfigUpwards(rootDir) {
+ return null;
+}
+
+function findPackageData(filepath) {
+ return {
+ filepath,
+ directories: [],
+ pkg: null,
+ isPackage: false
+ };
+}
+
+function findRelativeConfig(pkgData, envName, caller) {
+ return {
+ pkg: null,
+ config: null,
+ ignore: null
+ };
+}
+
+function findRootConfig(dirname, envName, caller) {
+ return null;
+}
+
+function loadConfig(name, dirname, envName, caller) {
+ throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);
+}
+
+function resolvePlugin(name, dirname) {
+ return null;
+}
+
+function resolvePreset(name, dirname) {
+ return null;
+}
+
+function loadPlugin(name, dirname) {
+ throw new Error(`Cannot load plugin ${name} relative to ${dirname} in a browser`);
+}
+
+function loadPreset(name, dirname) {
+ throw new Error(`Cannot load preset ${name} relative to ${dirname} in a browser`);
+}
+},{}],7:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = loadFullConfig;
+
+var _util = require("./util");
+
+var context = _interopRequireWildcard(require("../index"));
+
+var _plugin = _interopRequireDefault(require("./plugin"));
+
+var _item = require("./item");
+
+var _configChain = require("./config-chain");
+
+function _traverse() {
+ const data = _interopRequireDefault(require("@babel/traverse"));
+
+ _traverse = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _caching = require("./caching");
+
+var _options = require("./validation/options");
+
+var _plugins = require("./validation/plugins");
+
+var _configApi = _interopRequireDefault(require("./helpers/config-api"));
+
+var _partial = _interopRequireDefault(require("./partial"));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
+
+function loadFullConfig(inputOpts) {
+ const result = (0, _partial.default)(inputOpts);
+
+ if (!result) {
+ return null;
+ }
+
+ const {
+ options,
+ context
+ } = result;
+ const optionDefaults = {};
+ const passes = [[]];
+
+ try {
+ const {
+ plugins,
+ presets
+ } = options;
+
+ if (!plugins || !presets) {
+ throw new Error("Assertion failure - plugins and presets exist");
+ }
+
+ const ignored = function recurseDescriptors(config, pass) {
+ const plugins = config.plugins.reduce((acc, descriptor) => {
+ if (descriptor.options !== false) {
+ acc.push(loadPluginDescriptor(descriptor, context));
+ }
+
+ return acc;
+ }, []);
+ const presets = config.presets.reduce((acc, descriptor) => {
+ if (descriptor.options !== false) {
+ acc.push({
+ preset: loadPresetDescriptor(descriptor, context),
+ pass: descriptor.ownPass ? [] : pass
+ });
+ }
+
+ return acc;
+ }, []);
+
+ if (presets.length > 0) {
+ passes.splice(1, 0, ...presets.map(o => o.pass).filter(p => p !== pass));
+
+ for (const _ref of presets) {
+ const {
+ preset,
+ pass
+ } = _ref;
+ if (!preset) return true;
+ const ignored = recurseDescriptors({
+ plugins: preset.plugins,
+ presets: preset.presets
+ }, pass);
+ if (ignored) return true;
+ preset.options.forEach(opts => {
+ (0, _util.mergeOptions)(optionDefaults, opts);
+ });
+ }
+ }
+
+ if (plugins.length > 0) {
+ pass.unshift(...plugins);
+ }
+ }({
+ plugins: plugins.map(item => {
+ const desc = (0, _item.getItemDescriptor)(item);
+
+ if (!desc) {
+ throw new Error("Assertion failure - must be config item");
+ }
+
+ return desc;
+ }),
+ presets: presets.map(item => {
+ const desc = (0, _item.getItemDescriptor)(item);
+
+ if (!desc) {
+ throw new Error("Assertion failure - must be config item");
+ }
+
+ return desc;
+ })
+ }, passes[0]);
+
+ if (ignored) return null;
+ } catch (e) {
+ if (!/^\[BABEL\]/.test(e.message)) {
+ e.message = `[BABEL] ${context.filename || "unknown"}: ${e.message}`;
+ }
+
+ throw e;
+ }
+
+ const opts = optionDefaults;
+ (0, _util.mergeOptions)(opts, options);
+ opts.plugins = passes[0];
+ opts.presets = passes.slice(1).filter(plugins => plugins.length > 0).map(plugins => ({
+ plugins
+ }));
+ opts.passPerPreset = opts.presets.length > 0;
+ return {
+ options: opts,
+ passes: passes
+ };
+}
+
+const loadDescriptor = (0, _caching.makeWeakCache)(({
+ value,
+ options,
+ dirname,
+ alias
+}, cache) => {
+ if (options === false) throw new Error("Assertion failure");
+ options = options || {};
+ let item = value;
+
+ if (typeof value === "function") {
+ const api = Object.assign({}, context, (0, _configApi.default)(cache));
+
+ try {
+ item = value(api, options, dirname);
+ } catch (e) {
+ if (alias) {
+ e.message += ` (While processing: ${JSON.stringify(alias)})`;
+ }
+
+ throw e;
+ }
+ }
+
+ if (!item || typeof item !== "object") {
+ throw new Error("Plugin/Preset did not return an object.");
+ }
+
+ if (typeof item.then === "function") {
+ throw new Error(`You appear to be using an async plugin, ` + `which your current version of Babel does not support.` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`);
+ }
+
+ return {
+ value: item,
+ options,
+ dirname,
+ alias
+ };
+});
+
+function loadPluginDescriptor(descriptor, context) {
+ if (descriptor.value instanceof _plugin.default) {
+ if (descriptor.options) {
+ throw new Error("Passed options to an existing Plugin instance will not work.");
+ }
+
+ return descriptor.value;
+ }
+
+ return instantiatePlugin(loadDescriptor(descriptor, context), context);
+}
+
+const instantiatePlugin = (0, _caching.makeWeakCache)(({
+ value,
+ options,
+ dirname,
+ alias
+}, cache) => {
+ const pluginObj = (0, _plugins.validatePluginObject)(value);
+ const plugin = Object.assign({}, pluginObj);
+
+ if (plugin.visitor) {
+ plugin.visitor = _traverse().default.explode(Object.assign({}, plugin.visitor));
+ }
+
+ if (plugin.inherits) {
+ const inheritsDescriptor = {
+ name: undefined,
+ alias: `${alias}$inherits`,
+ value: plugin.inherits,
+ options,
+ dirname
+ };
+ const inherits = cache.invalidate(data => loadPluginDescriptor(inheritsDescriptor, data));
+ plugin.pre = chain(inherits.pre, plugin.pre);
+ plugin.post = chain(inherits.post, plugin.post);
+ plugin.manipulateOptions = chain(inherits.manipulateOptions, plugin.manipulateOptions);
+ plugin.visitor = _traverse().default.visitors.merge([inherits.visitor || {}, plugin.visitor || {}]);
+ }
+
+ return new _plugin.default(plugin, options, alias);
+});
+
+const loadPresetDescriptor = (descriptor, context) => {
+ return (0, _configChain.buildPresetChain)(instantiatePreset(loadDescriptor(descriptor, context)), context);
+};
+
+const instantiatePreset = (0, _caching.makeWeakCache)(({
+ value,
+ dirname,
+ alias
+}) => {
+ return {
+ options: (0, _options.validate)("preset", value),
+ alias,
+ dirname
+ };
+});
+
+function chain(a, b) {
+ const fns = [a, b].filter(Boolean);
+ if (fns.length <= 1) return fns[0];
+ return function (...args) {
+ for (const fn of fns) {
+ fn.apply(this, args);
+ }
+ };
+}
+},{"../index":20,"./caching":3,"./config-chain":4,"./helpers/config-api":8,"./item":11,"./partial":12,"./plugin":14,"./util":15,"./validation/options":17,"./validation/plugins":18,"@babel/traverse":79}],8:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = makeAPI;
+
+function _semver() {
+ const data = _interopRequireDefault(require("semver"));
+
+ _semver = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _ = require("../../");
+
+var _caching = require("../caching");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function makeAPI(cache) {
+ const env = value => cache.using(data => {
+ if (typeof value === "undefined") return data.envName;
+
+ if (typeof value === "function") {
+ return (0, _caching.assertSimpleType)(value(data.envName));
+ }
+
+ if (!Array.isArray(value)) value = [value];
+ return value.some(entry => {
+ if (typeof entry !== "string") {
+ throw new Error("Unexpected non-string value");
+ }
+
+ return entry === data.envName;
+ });
+ });
+
+ const caller = cb => cache.using(data => (0, _caching.assertSimpleType)(cb(data.caller)));
+
+ return {
+ version: _.version,
+ cache: cache.simple(),
+ env,
+ async: () => false,
+ caller,
+ assertVersion,
+ tokTypes: undefined
+ };
+}
+
+function assertVersion(range) {
+ if (typeof range === "number") {
+ if (!Number.isInteger(range)) {
+ throw new Error("Expected string or integer value.");
+ }
+
+ range = `^${range}.0.0-0`;
+ }
+
+ if (typeof range !== "string") {
+ throw new Error("Expected string or integer value.");
+ }
+
+ if (_semver().default.satisfies(_.version, range)) return;
+ const limit = Error.stackTraceLimit;
+
+ if (typeof limit === "number" && limit < 25) {
+ Error.stackTraceLimit = 25;
+ }
+
+ const err = new Error(`Requires Babel "${range}", but was loaded with "${_.version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`);
+
+ if (typeof limit === "number") {
+ Error.stackTraceLimit = limit;
+ }
+
+ throw Object.assign(err, {
+ code: "BABEL_VERSION_UNSUPPORTED",
+ version: _.version,
+ range
+ });
+}
+},{"../../":20,"../caching":3,"semver":35}],9:[function(require,module,exports){
+(function (process){(function (){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.getEnv = getEnv;
+
+function getEnv(defaultValue = "development") {
+ return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;
+}
+}).call(this)}).call(this,require('_process'))
+},{"_process":386}],10:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.loadOptions = loadOptions;
+Object.defineProperty(exports, "default", {
+ enumerable: true,
+ get: function () {
+ return _full.default;
+ }
+});
+Object.defineProperty(exports, "loadPartialConfig", {
+ enumerable: true,
+ get: function () {
+ return _partial.loadPartialConfig;
+ }
+});
+
+var _full = _interopRequireDefault(require("./full"));
+
+var _partial = require("./partial");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function loadOptions(opts) {
+ const config = (0, _full.default)(opts);
+ return config ? config.options : null;
+}
+},{"./full":7,"./partial":12}],11:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.createItemFromDescriptor = createItemFromDescriptor;
+exports.createConfigItem = createConfigItem;
+exports.getItemDescriptor = getItemDescriptor;
+
+function _path() {
+ const data = _interopRequireDefault(require("path"));
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _configDescriptors = require("./config-descriptors");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function createItemFromDescriptor(desc) {
+ return new ConfigItem(desc);
+}
+
+function createConfigItem(value, {
+ dirname = ".",
+ type
+} = {}) {
+ const descriptor = (0, _configDescriptors.createDescriptor)(value, _path().default.resolve(dirname), {
+ type,
+ alias: "programmatic item"
+ });
+ return createItemFromDescriptor(descriptor);
+}
+
+function getItemDescriptor(item) {
+ if (item instanceof ConfigItem) {
+ return item._descriptor;
+ }
+
+ return undefined;
+}
+
+class ConfigItem {
+ constructor(descriptor) {
+ this._descriptor = descriptor;
+ Object.defineProperty(this, "_descriptor", {
+ enumerable: false
+ });
+ this.value = this._descriptor.value;
+ this.options = this._descriptor.options;
+ this.dirname = this._descriptor.dirname;
+ this.name = this._descriptor.name;
+ this.file = this._descriptor.file ? {
+ request: this._descriptor.file.request,
+ resolved: this._descriptor.file.resolved
+ } : undefined;
+ Object.freeze(this);
+ }
+
+}
+
+Object.freeze(ConfigItem.prototype);
+},{"./config-descriptors":5,"path":385}],12:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = loadPrivatePartialConfig;
+exports.loadPartialConfig = loadPartialConfig;
+
+function _path() {
+ const data = _interopRequireDefault(require("path"));
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _plugin = _interopRequireDefault(require("./plugin"));
+
+var _util = require("./util");
+
+var _item = require("./item");
+
+var _configChain = require("./config-chain");
+
+var _environment = require("./helpers/environment");
+
+var _options = require("./validation/options");
+
+var _files = require("./files");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function resolveRootMode(rootDir, rootMode) {
+ switch (rootMode) {
+ case "root":
+ return rootDir;
+
+ case "upward-optional":
+ {
+ const upwardRootDir = (0, _files.findConfigUpwards)(rootDir);
+ return upwardRootDir === null ? rootDir : upwardRootDir;
+ }
+
+ case "upward":
+ {
+ const upwardRootDir = (0, _files.findConfigUpwards)(rootDir);
+ if (upwardRootDir !== null) return upwardRootDir;
+ throw Object.assign(new Error(`Babel was run with rootMode:"upward" but a root could not ` + `be found when searching upward from "${rootDir}"`), {
+ code: "BABEL_ROOT_NOT_FOUND",
+ dirname: rootDir
+ });
+ }
+
+ default:
+ throw new Error(`Assertion failure - unknown rootMode value`);
+ }
+}
+
+function loadPrivatePartialConfig(inputOpts) {
+ if (inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts))) {
+ throw new Error("Babel options must be an object, null, or undefined");
+ }
+
+ const args = inputOpts ? (0, _options.validate)("arguments", inputOpts) : {};
+ const {
+ envName = (0, _environment.getEnv)(),
+ cwd = ".",
+ root: rootDir = ".",
+ rootMode = "root",
+ caller
+ } = args;
+
+ const absoluteCwd = _path().default.resolve(cwd);
+
+ const absoluteRootDir = resolveRootMode(_path().default.resolve(absoluteCwd, rootDir), rootMode);
+ const context = {
+ filename: typeof args.filename === "string" ? _path().default.resolve(cwd, args.filename) : undefined,
+ cwd: absoluteCwd,
+ root: absoluteRootDir,
+ envName,
+ caller
+ };
+ const configChain = (0, _configChain.buildRootChain)(args, context);
+ if (!configChain) return null;
+ const options = {};
+ configChain.options.forEach(opts => {
+ (0, _util.mergeOptions)(options, opts);
+ });
+ options.babelrc = false;
+ options.configFile = false;
+ options.passPerPreset = false;
+ options.envName = context.envName;
+ options.cwd = context.cwd;
+ options.root = context.root;
+ options.filename = typeof context.filename === "string" ? context.filename : undefined;
+ options.plugins = configChain.plugins.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor));
+ options.presets = configChain.presets.map(descriptor => (0, _item.createItemFromDescriptor)(descriptor));
+ return {
+ options,
+ context,
+ ignore: configChain.ignore,
+ babelrc: configChain.babelrc,
+ config: configChain.config
+ };
+}
+
+function loadPartialConfig(inputOpts) {
+ const result = loadPrivatePartialConfig(inputOpts);
+ if (!result) return null;
+ const {
+ options,
+ babelrc,
+ ignore,
+ config
+ } = result;
+ (options.plugins || []).forEach(item => {
+ if (item.value instanceof _plugin.default) {
+ throw new Error("Passing cached plugin instances is not supported in " + "babel.loadPartialConfig()");
+ }
+ });
+ return new PartialConfig(options, babelrc ? babelrc.filepath : undefined, ignore ? ignore.filepath : undefined, config ? config.filepath : undefined);
+}
+
+class PartialConfig {
+ constructor(options, babelrc, ignore, config) {
+ this.options = options;
+ this.babelignore = ignore;
+ this.babelrc = babelrc;
+ this.config = config;
+ Object.freeze(this);
+ }
+
+ hasFilesystemConfig() {
+ return this.babelrc !== undefined || this.config !== undefined;
+ }
+
+}
+
+Object.freeze(PartialConfig.prototype);
+},{"./config-chain":4,"./files":6,"./helpers/environment":9,"./item":11,"./plugin":14,"./util":15,"./validation/options":17,"path":385}],13:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = pathToPattern;
+
+function _path() {
+ const data = _interopRequireDefault(require("path"));
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _escapeRegExp() {
+ const data = _interopRequireDefault(require("lodash/escapeRegExp"));
+
+ _escapeRegExp = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const sep = `\\${_path().default.sep}`;
+const endSep = `(?:${sep}|$)`;
+const substitution = `[^${sep}]+`;
+const starPat = `(?:${substitution}${sep})`;
+const starPatLast = `(?:${substitution}${endSep})`;
+const starStarPat = `${starPat}*?`;
+const starStarPatLast = `${starPat}*?${starPatLast}?`;
+
+function pathToPattern(pattern, dirname) {
+ const parts = _path().default.resolve(dirname, pattern).split(_path().default.sep);
+
+ return new RegExp(["^", ...parts.map((part, i) => {
+ const last = i === parts.length - 1;
+ if (part === "**") return last ? starStarPatLast : starStarPat;
+ if (part === "*") return last ? starPatLast : starPat;
+
+ if (part.indexOf("*.") === 0) {
+ return substitution + (0, _escapeRegExp().default)(part.slice(1)) + (last ? endSep : sep);
+ }
+
+ return (0, _escapeRegExp().default)(part) + (last ? endSep : sep);
+ })].join(""));
+}
+},{"lodash/escapeRegExp":339,"path":385}],14:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+class Plugin {
+ constructor(plugin, options, key) {
+ this.key = plugin.name || key;
+ this.manipulateOptions = plugin.manipulateOptions;
+ this.post = plugin.post;
+ this.pre = plugin.pre;
+ this.visitor = plugin.visitor || {};
+ this.parserOverride = plugin.parserOverride;
+ this.generatorOverride = plugin.generatorOverride;
+ this.options = options;
+ }
+
+}
+
+exports.default = Plugin;
+},{}],15:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.mergeOptions = mergeOptions;
+
+function mergeOptions(target, source) {
+ for (const k of Object.keys(source)) {
+ if (k === "parserOpts" && source.parserOpts) {
+ const parserOpts = source.parserOpts;
+ const targetObj = target.parserOpts = target.parserOpts || {};
+ mergeDefaultFields(targetObj, parserOpts);
+ } else if (k === "generatorOpts" && source.generatorOpts) {
+ const generatorOpts = source.generatorOpts;
+ const targetObj = target.generatorOpts = target.generatorOpts || {};
+ mergeDefaultFields(targetObj, generatorOpts);
+ } else {
+ const val = source[k];
+ if (val !== undefined) target[k] = val;
+ }
+ }
+}
+
+function mergeDefaultFields(target, source) {
+ for (const k of Object.keys(source)) {
+ const val = source[k];
+ if (val !== undefined) target[k] = val;
+ }
+}
+},{}],16:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.msg = msg;
+exports.access = access;
+exports.assertRootMode = assertRootMode;
+exports.assertSourceMaps = assertSourceMaps;
+exports.assertCompact = assertCompact;
+exports.assertSourceType = assertSourceType;
+exports.assertCallerMetadata = assertCallerMetadata;
+exports.assertInputSourceMap = assertInputSourceMap;
+exports.assertString = assertString;
+exports.assertFunction = assertFunction;
+exports.assertBoolean = assertBoolean;
+exports.assertObject = assertObject;
+exports.assertArray = assertArray;
+exports.assertIgnoreList = assertIgnoreList;
+exports.assertConfigApplicableTest = assertConfigApplicableTest;
+exports.assertConfigFileSearch = assertConfigFileSearch;
+exports.assertBabelrcSearch = assertBabelrcSearch;
+exports.assertPluginList = assertPluginList;
+
+function msg(loc) {
+ switch (loc.type) {
+ case "root":
+ return ``;
+
+ case "env":
+ return `${msg(loc.parent)}.env["${loc.name}"]`;
+
+ case "overrides":
+ return `${msg(loc.parent)}.overrides[${loc.index}]`;
+
+ case "option":
+ return `${msg(loc.parent)}.${loc.name}`;
+
+ case "access":
+ return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;
+
+ default:
+ throw new Error(`Assertion failure: Unknown type ${loc.type}`);
+ }
+}
+
+function access(loc, name) {
+ return {
+ type: "access",
+ name,
+ parent: loc
+ };
+}
+
+function assertRootMode(loc, value) {
+ if (value !== undefined && value !== "root" && value !== "upward" && value !== "upward-optional") {
+ throw new Error(`${msg(loc)} must be a "root", "upward", "upward-optional" or undefined`);
+ }
+
+ return value;
+}
+
+function assertSourceMaps(loc, value) {
+ if (value !== undefined && typeof value !== "boolean" && value !== "inline" && value !== "both") {
+ throw new Error(`${msg(loc)} must be a boolean, "inline", "both", or undefined`);
+ }
+
+ return value;
+}
+
+function assertCompact(loc, value) {
+ if (value !== undefined && typeof value !== "boolean" && value !== "auto") {
+ throw new Error(`${msg(loc)} must be a boolean, "auto", or undefined`);
+ }
+
+ return value;
+}
+
+function assertSourceType(loc, value) {
+ if (value !== undefined && value !== "module" && value !== "script" && value !== "unambiguous") {
+ throw new Error(`${msg(loc)} must be "module", "script", "unambiguous", or undefined`);
+ }
+
+ return value;
+}
+
+function assertCallerMetadata(loc, value) {
+ const obj = assertObject(loc, value);
+
+ if (obj) {
+ if (typeof obj["name"] !== "string") {
+ throw new Error(`${msg(loc)} set but does not contain "name" property string`);
+ }
+
+ for (const prop of Object.keys(obj)) {
+ const propLoc = access(loc, prop);
+ const value = obj[prop];
+
+ if (value != null && typeof value !== "boolean" && typeof value !== "string" && typeof value !== "number") {
+ throw new Error(`${msg(propLoc)} must be null, undefined, a boolean, a string, or a number.`);
+ }
+ }
+ }
+
+ return value;
+}
+
+function assertInputSourceMap(loc, value) {
+ if (value !== undefined && typeof value !== "boolean" && (typeof value !== "object" || !value)) {
+ throw new Error(`${msg(loc)} must be a boolean, object, or undefined`);
+ }
+
+ return value;
+}
+
+function assertString(loc, value) {
+ if (value !== undefined && typeof value !== "string") {
+ throw new Error(`${msg(loc)} must be a string, or undefined`);
+ }
+
+ return value;
+}
+
+function assertFunction(loc, value) {
+ if (value !== undefined && typeof value !== "function") {
+ throw new Error(`${msg(loc)} must be a function, or undefined`);
+ }
+
+ return value;
+}
+
+function assertBoolean(loc, value) {
+ if (value !== undefined && typeof value !== "boolean") {
+ throw new Error(`${msg(loc)} must be a boolean, or undefined`);
+ }
+
+ return value;
+}
+
+function assertObject(loc, value) {
+ if (value !== undefined && (typeof value !== "object" || Array.isArray(value) || !value)) {
+ throw new Error(`${msg(loc)} must be an object, or undefined`);
+ }
+
+ return value;
+}
+
+function assertArray(loc, value) {
+ if (value != null && !Array.isArray(value)) {
+ throw new Error(`${msg(loc)} must be an array, or undefined`);
+ }
+
+ return value;
+}
+
+function assertIgnoreList(loc, value) {
+ const arr = assertArray(loc, value);
+
+ if (arr) {
+ arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));
+ }
+
+ return arr;
+}
+
+function assertIgnoreItem(loc, value) {
+ if (typeof value !== "string" && typeof value !== "function" && !(value instanceof RegExp)) {
+ throw new Error(`${msg(loc)} must be an array of string/Funtion/RegExp values, or undefined`);
+ }
+
+ return value;
+}
+
+function assertConfigApplicableTest(loc, value) {
+ if (value === undefined) return value;
+
+ if (Array.isArray(value)) {
+ value.forEach((item, i) => {
+ if (!checkValidTest(item)) {
+ throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
+ }
+ });
+ } else if (!checkValidTest(value)) {
+ throw new Error(`${msg(loc)} must be a string/Function/RegExp, or an array of those`);
+ }
+
+ return value;
+}
+
+function checkValidTest(value) {
+ return typeof value === "string" || typeof value === "function" || value instanceof RegExp;
+}
+
+function assertConfigFileSearch(loc, value) {
+ if (value !== undefined && typeof value !== "boolean" && typeof value !== "string") {
+ throw new Error(`${msg(loc)} must be a undefined, a boolean, a string, ` + `got ${JSON.stringify(value)}`);
+ }
+
+ return value;
+}
+
+function assertBabelrcSearch(loc, value) {
+ if (value === undefined || typeof value === "boolean") return value;
+
+ if (Array.isArray(value)) {
+ value.forEach((item, i) => {
+ if (!checkValidTest(item)) {
+ throw new Error(`${msg(access(loc, i))} must be a string/Function/RegExp.`);
+ }
+ });
+ } else if (!checkValidTest(value)) {
+ throw new Error(`${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + `or an array of those, got ${JSON.stringify(value)}`);
+ }
+
+ return value;
+}
+
+function assertPluginList(loc, value) {
+ const arr = assertArray(loc, value);
+
+ if (arr) {
+ arr.forEach((item, i) => assertPluginItem(access(loc, i), item));
+ }
+
+ return arr;
+}
+
+function assertPluginItem(loc, value) {
+ if (Array.isArray(value)) {
+ if (value.length === 0) {
+ throw new Error(`${msg(loc)} must include an object`);
+ }
+
+ if (value.length > 3) {
+ throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);
+ }
+
+ assertPluginTarget(access(loc, 0), value[0]);
+
+ if (value.length > 1) {
+ const opts = value[1];
+
+ if (opts !== undefined && opts !== false && (typeof opts !== "object" || Array.isArray(opts))) {
+ throw new Error(`${msg(access(loc, 1))} must be an object, false, or undefined`);
+ }
+ }
+
+ if (value.length === 3) {
+ const name = value[2];
+
+ if (name !== undefined && typeof name !== "string") {
+ throw new Error(`${msg(access(loc, 2))} must be a string, or undefined`);
+ }
+ }
+ } else {
+ assertPluginTarget(loc, value);
+ }
+
+ return value;
+}
+
+function assertPluginTarget(loc, value) {
+ if ((typeof value !== "object" || !value) && typeof value !== "string" && typeof value !== "function") {
+ throw new Error(`${msg(loc)} must be a string, object, function`);
+ }
+
+ return value;
+}
+},{}],17:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.validate = validate;
+
+var _plugin = _interopRequireDefault(require("../plugin"));
+
+var _removed = _interopRequireDefault(require("./removed"));
+
+var _optionAssertions = require("./option-assertions");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const ROOT_VALIDATORS = {
+ cwd: _optionAssertions.assertString,
+ root: _optionAssertions.assertString,
+ rootMode: _optionAssertions.assertRootMode,
+ configFile: _optionAssertions.assertConfigFileSearch,
+ caller: _optionAssertions.assertCallerMetadata,
+ filename: _optionAssertions.assertString,
+ filenameRelative: _optionAssertions.assertString,
+ code: _optionAssertions.assertBoolean,
+ ast: _optionAssertions.assertBoolean,
+ envName: _optionAssertions.assertString
+};
+const BABELRC_VALIDATORS = {
+ babelrc: _optionAssertions.assertBoolean,
+ babelrcRoots: _optionAssertions.assertBabelrcSearch
+};
+const NONPRESET_VALIDATORS = {
+ extends: _optionAssertions.assertString,
+ ignore: _optionAssertions.assertIgnoreList,
+ only: _optionAssertions.assertIgnoreList
+};
+const COMMON_VALIDATORS = {
+ inputSourceMap: _optionAssertions.assertInputSourceMap,
+ presets: _optionAssertions.assertPluginList,
+ plugins: _optionAssertions.assertPluginList,
+ passPerPreset: _optionAssertions.assertBoolean,
+ env: assertEnvSet,
+ overrides: assertOverridesList,
+ test: _optionAssertions.assertConfigApplicableTest,
+ include: _optionAssertions.assertConfigApplicableTest,
+ exclude: _optionAssertions.assertConfigApplicableTest,
+ retainLines: _optionAssertions.assertBoolean,
+ comments: _optionAssertions.assertBoolean,
+ shouldPrintComment: _optionAssertions.assertFunction,
+ compact: _optionAssertions.assertCompact,
+ minified: _optionAssertions.assertBoolean,
+ auxiliaryCommentBefore: _optionAssertions.assertString,
+ auxiliaryCommentAfter: _optionAssertions.assertString,
+ sourceType: _optionAssertions.assertSourceType,
+ wrapPluginVisitorMethod: _optionAssertions.assertFunction,
+ highlightCode: _optionAssertions.assertBoolean,
+ sourceMaps: _optionAssertions.assertSourceMaps,
+ sourceMap: _optionAssertions.assertSourceMaps,
+ sourceFileName: _optionAssertions.assertString,
+ sourceRoot: _optionAssertions.assertString,
+ getModuleId: _optionAssertions.assertFunction,
+ moduleRoot: _optionAssertions.assertString,
+ moduleIds: _optionAssertions.assertBoolean,
+ moduleId: _optionAssertions.assertString,
+ parserOpts: _optionAssertions.assertObject,
+ generatorOpts: _optionAssertions.assertObject
+};
+
+function getSource(loc) {
+ return loc.type === "root" ? loc.source : getSource(loc.parent);
+}
+
+function validate(type, opts) {
+ return validateNested({
+ type: "root",
+ source: type
+ }, opts);
+}
+
+function validateNested(loc, opts) {
+ const type = getSource(loc);
+ assertNoDuplicateSourcemap(opts);
+ Object.keys(opts).forEach(key => {
+ const optLoc = {
+ type: "option",
+ name: key,
+ parent: loc
+ };
+
+ if (type === "preset" && NONPRESET_VALIDATORS[key]) {
+ throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in preset options`);
+ }
+
+ if (type !== "arguments" && ROOT_VALIDATORS[key]) {
+ throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options`);
+ }
+
+ if (type !== "arguments" && type !== "configfile" && BABELRC_VALIDATORS[key]) {
+ if (type === "babelrcfile" || type === "extendsfile") {
+ throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is not allowed in .babelrc or "extends"ed files, only in root programmatic options, ` + `or babel.config.js/config file options`);
+ }
+
+ throw new Error(`${(0, _optionAssertions.msg)(optLoc)} is only allowed in root programmatic options, or babel.config.js/config file options`);
+ }
+
+ const validator = COMMON_VALIDATORS[key] || NONPRESET_VALIDATORS[key] || BABELRC_VALIDATORS[key] || ROOT_VALIDATORS[key] || throwUnknownError;
+ validator(optLoc, opts[key]);
+ });
+ return opts;
+}
+
+function throwUnknownError(loc) {
+ const key = loc.name;
+
+ if (_removed.default[key]) {
+ const {
+ message,
+ version = 5
+ } = _removed.default[key];
+ throw new ReferenceError(`Using removed Babel ${version} option: ${(0, _optionAssertions.msg)(loc)} - ${message}`);
+ } else {
+ const unknownOptErr = `Unknown option: ${(0, _optionAssertions.msg)(loc)}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`;
+ throw new ReferenceError(unknownOptErr);
+ }
+}
+
+function has(obj, key) {
+ return Object.prototype.hasOwnProperty.call(obj, key);
+}
+
+function assertNoDuplicateSourcemap(opts) {
+ if (has(opts, "sourceMap") && has(opts, "sourceMaps")) {
+ throw new Error(".sourceMap is an alias for .sourceMaps, cannot use both");
+ }
+}
+
+function assertEnvSet(loc, value) {
+ if (loc.parent.type === "env") {
+ throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside of another .env block`);
+ }
+
+ const parent = loc.parent;
+ const obj = (0, _optionAssertions.assertObject)(loc, value);
+
+ if (obj) {
+ for (const envName of Object.keys(obj)) {
+ const env = (0, _optionAssertions.assertObject)((0, _optionAssertions.access)(loc, envName), obj[envName]);
+ if (!env) continue;
+ const envLoc = {
+ type: "env",
+ name: envName,
+ parent
+ };
+ validateNested(envLoc, env);
+ }
+ }
+
+ return obj;
+}
+
+function assertOverridesList(loc, value) {
+ if (loc.parent.type === "env") {
+ throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .env block`);
+ }
+
+ if (loc.parent.type === "overrides") {
+ throw new Error(`${(0, _optionAssertions.msg)(loc)} is not allowed inside an .overrides block`);
+ }
+
+ const parent = loc.parent;
+ const arr = (0, _optionAssertions.assertArray)(loc, value);
+
+ if (arr) {
+ for (const [index, item] of arr.entries()) {
+ const objLoc = (0, _optionAssertions.access)(loc, index);
+ const env = (0, _optionAssertions.assertObject)(objLoc, item);
+ if (!env) throw new Error(`${(0, _optionAssertions.msg)(objLoc)} must be an object`);
+ const overridesLoc = {
+ type: "overrides",
+ index,
+ parent
+ };
+ validateNested(overridesLoc, env);
+ }
+ }
+
+ return arr;
+}
+},{"../plugin":14,"./option-assertions":16,"./removed":19}],18:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.validatePluginObject = validatePluginObject;
+
+var _optionAssertions = require("./option-assertions");
+
+const VALIDATORS = {
+ name: _optionAssertions.assertString,
+ manipulateOptions: _optionAssertions.assertFunction,
+ pre: _optionAssertions.assertFunction,
+ post: _optionAssertions.assertFunction,
+ inherits: _optionAssertions.assertFunction,
+ visitor: assertVisitorMap,
+ parserOverride: _optionAssertions.assertFunction,
+ generatorOverride: _optionAssertions.assertFunction
+};
+
+function assertVisitorMap(key, value) {
+ const obj = (0, _optionAssertions.assertObject)(key, value);
+
+ if (obj) {
+ Object.keys(obj).forEach(prop => assertVisitorHandler(prop, obj[prop]));
+
+ if (obj.enter || obj.exit) {
+ throw new Error(`.${key} cannot contain catch-all "enter" or "exit" handlers. Please target individual nodes.`);
+ }
+ }
+
+ return obj;
+}
+
+function assertVisitorHandler(key, value) {
+ if (value && typeof value === "object") {
+ Object.keys(value).forEach(handler => {
+ if (handler !== "enter" && handler !== "exit") {
+ throw new Error(`.visitor["${key}"] may only have .enter and/or .exit handlers.`);
+ }
+ });
+ } else if (typeof value !== "function") {
+ throw new Error(`.visitor["${key}"] must be a function`);
+ }
+
+ return value;
+}
+
+function validatePluginObject(obj) {
+ Object.keys(obj).forEach(key => {
+ const validator = VALIDATORS[key];
+ if (validator) validator(key, obj[key]);else throw new Error(`.${key} is not a valid Plugin property`);
+ });
+ return obj;
+}
+},{"./option-assertions":16}],19:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+var _default = {
+ auxiliaryComment: {
+ message: "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"
+ },
+ blacklist: {
+ message: "Put the specific transforms you want in the `plugins` option"
+ },
+ breakConfig: {
+ message: "This is not a necessary option in Babel 6"
+ },
+ experimental: {
+ message: "Put the specific transforms you want in the `plugins` option"
+ },
+ externalHelpers: {
+ message: "Use the `external-helpers` plugin instead. " + "Check out http://babeljs.io/docs/plugins/external-helpers/"
+ },
+ extra: {
+ message: ""
+ },
+ jsxPragma: {
+ message: "use the `pragma` option in the `react-jsx` plugin. " + "Check out http://babeljs.io/docs/plugins/transform-react-jsx/"
+ },
+ loose: {
+ message: "Specify the `loose` option for the relevant plugin you are using " + "or use a preset that sets the option."
+ },
+ metadataUsedHelpers: {
+ message: "Not required anymore as this is enabled by default"
+ },
+ modules: {
+ message: "Use the corresponding module transform plugin in the `plugins` option. " + "Check out http://babeljs.io/docs/plugins/#modules"
+ },
+ nonStandard: {
+ message: "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. " + "Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"
+ },
+ optional: {
+ message: "Put the specific transforms you want in the `plugins` option"
+ },
+ sourceMapName: {
+ message: "The `sourceMapName` option has been removed because it makes more sense for the " + "tooling that calls Babel to assign `map.file` themselves."
+ },
+ stage: {
+ message: "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"
+ },
+ whitelist: {
+ message: "Put the specific transforms you want in the `plugins` option"
+ },
+ resolveModuleSource: {
+ version: 6,
+ message: "Use `babel-plugin-module-resolver@3`'s 'resolvePath' options"
+ },
+ metadata: {
+ version: 6,
+ message: "Generated plugin metadata is always included in the output result"
+ },
+ sourceMapTarget: {
+ version: 6,
+ message: "The `sourceMapTarget` option has been removed because it makes more sense for the tooling " + "that calls Babel to assign `map.file` themselves."
+ }
+};
+exports.default = _default;
+},{}],20:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.Plugin = Plugin;
+Object.defineProperty(exports, "File", {
+ enumerable: true,
+ get: function () {
+ return _file.default;
+ }
+});
+Object.defineProperty(exports, "buildExternalHelpers", {
+ enumerable: true,
+ get: function () {
+ return _buildExternalHelpers.default;
+ }
+});
+Object.defineProperty(exports, "resolvePlugin", {
+ enumerable: true,
+ get: function () {
+ return _files.resolvePlugin;
+ }
+});
+Object.defineProperty(exports, "resolvePreset", {
+ enumerable: true,
+ get: function () {
+ return _files.resolvePreset;
+ }
+});
+Object.defineProperty(exports, "version", {
+ enumerable: true,
+ get: function () {
+ return _package.version;
+ }
+});
+Object.defineProperty(exports, "getEnv", {
+ enumerable: true,
+ get: function () {
+ return _environment.getEnv;
+ }
+});
+Object.defineProperty(exports, "tokTypes", {
+ enumerable: true,
+ get: function () {
+ return _parser().tokTypes;
+ }
+});
+Object.defineProperty(exports, "traverse", {
+ enumerable: true,
+ get: function () {
+ return _traverse().default;
+ }
+});
+Object.defineProperty(exports, "template", {
+ enumerable: true,
+ get: function () {
+ return _template().default;
+ }
+});
+Object.defineProperty(exports, "createConfigItem", {
+ enumerable: true,
+ get: function () {
+ return _item.createConfigItem;
+ }
+});
+Object.defineProperty(exports, "loadPartialConfig", {
+ enumerable: true,
+ get: function () {
+ return _config.loadPartialConfig;
+ }
+});
+Object.defineProperty(exports, "loadOptions", {
+ enumerable: true,
+ get: function () {
+ return _config.loadOptions;
+ }
+});
+Object.defineProperty(exports, "transform", {
+ enumerable: true,
+ get: function () {
+ return _transform.transform;
+ }
+});
+Object.defineProperty(exports, "transformSync", {
+ enumerable: true,
+ get: function () {
+ return _transform.transformSync;
+ }
+});
+Object.defineProperty(exports, "transformAsync", {
+ enumerable: true,
+ get: function () {
+ return _transform.transformAsync;
+ }
+});
+Object.defineProperty(exports, "transformFile", {
+ enumerable: true,
+ get: function () {
+ return _transformFile.transformFile;
+ }
+});
+Object.defineProperty(exports, "transformFileSync", {
+ enumerable: true,
+ get: function () {
+ return _transformFile.transformFileSync;
+ }
+});
+Object.defineProperty(exports, "transformFileAsync", {
+ enumerable: true,
+ get: function () {
+ return _transformFile.transformFileAsync;
+ }
+});
+Object.defineProperty(exports, "transformFromAst", {
+ enumerable: true,
+ get: function () {
+ return _transformAst.transformFromAst;
+ }
+});
+Object.defineProperty(exports, "transformFromAstSync", {
+ enumerable: true,
+ get: function () {
+ return _transformAst.transformFromAstSync;
+ }
+});
+Object.defineProperty(exports, "transformFromAstAsync", {
+ enumerable: true,
+ get: function () {
+ return _transformAst.transformFromAstAsync;
+ }
+});
+Object.defineProperty(exports, "parse", {
+ enumerable: true,
+ get: function () {
+ return _parse.parse;
+ }
+});
+Object.defineProperty(exports, "parseSync", {
+ enumerable: true,
+ get: function () {
+ return _parse.parseSync;
+ }
+});
+Object.defineProperty(exports, "parseAsync", {
+ enumerable: true,
+ get: function () {
+ return _parse.parseAsync;
+ }
+});
+exports.types = exports.OptionManager = exports.DEFAULT_EXTENSIONS = void 0;
+
+var _file = _interopRequireDefault(require("./transformation/file/file"));
+
+var _buildExternalHelpers = _interopRequireDefault(require("./tools/build-external-helpers"));
+
+var _files = require("./config/files");
+
+var _package = require("../package.json");
+
+var _environment = require("./config/helpers/environment");
+
+function _types() {
+ const data = _interopRequireWildcard(require("@babel/types"));
+
+ _types = function () {
+ return data;
+ };
+
+ return data;
+}
+
+Object.defineProperty(exports, "types", {
+ enumerable: true,
+ get: function () {
+ return _types();
+ }
+});
+
+function _parser() {
+ const data = require("@babel/parser");
+
+ _parser = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _traverse() {
+ const data = _interopRequireDefault(require("@babel/traverse"));
+
+ _traverse = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _template() {
+ const data = _interopRequireDefault(require("@babel/template"));
+
+ _template = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _item = require("./config/item");
+
+var _config = require("./config");
+
+var _transform = require("./transform");
+
+var _transformFile = require("./transform-file");
+
+var _transformAst = require("./transform-ast");
+
+var _parse = require("./parse");
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const DEFAULT_EXTENSIONS = Object.freeze([".js", ".jsx", ".es6", ".es", ".mjs"]);
+exports.DEFAULT_EXTENSIONS = DEFAULT_EXTENSIONS;
+
+class OptionManager {
+ init(opts) {
+ return (0, _config.loadOptions)(opts);
+ }
+
+}
+
+exports.OptionManager = OptionManager;
+
+function Plugin(alias) {
+ throw new Error(`The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`);
+}
+},{"../package.json":36,"./config":10,"./config/files":6,"./config/helpers/environment":9,"./config/item":11,"./parse":21,"./tools/build-external-helpers":22,"./transform":25,"./transform-ast":23,"./transform-file":24,"./transformation/file/file":27,"@babel/parser":67,"@babel/template":70,"@babel/traverse":79,"@babel/types":143}],21:[function(require,module,exports){
+(function (process){(function (){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.parseSync = parseSync;
+exports.parseAsync = parseAsync;
+exports.parse = void 0;
+
+var _config = _interopRequireDefault(require("./config"));
+
+var _normalizeFile = _interopRequireDefault(require("./transformation/normalize-file"));
+
+var _normalizeOpts = _interopRequireDefault(require("./transformation/normalize-opts"));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const parse = function parse(code, opts, callback) {
+ if (typeof opts === "function") {
+ callback = opts;
+ opts = undefined;
+ }
+
+ if (callback === undefined) return parseSync(code, opts);
+ const config = (0, _config.default)(opts);
+
+ if (config === null) {
+ return null;
+ }
+
+ const cb = callback;
+ process.nextTick(() => {
+ let ast = null;
+
+ try {
+ const cfg = (0, _config.default)(opts);
+ if (cfg === null) return cb(null, null);
+ ast = (0, _normalizeFile.default)(cfg.passes, (0, _normalizeOpts.default)(cfg), code).ast;
+ } catch (err) {
+ return cb(err);
+ }
+
+ cb(null, ast);
+ });
+};
+
+exports.parse = parse;
+
+function parseSync(code, opts) {
+ const config = (0, _config.default)(opts);
+
+ if (config === null) {
+ return null;
+ }
+
+ return (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code).ast;
+}
+
+function parseAsync(code, opts) {
+ return new Promise((res, rej) => {
+ parse(code, opts, (err, result) => {
+ if (err == null) res(result);else rej(err);
+ });
+ });
+}
+}).call(this)}).call(this,require('_process'))
+},{"./config":10,"./transformation/normalize-file":31,"./transformation/normalize-opts":32,"_process":386}],22:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = _default;
+
+function helpers() {
+ const data = _interopRequireWildcard(require("@babel/helpers"));
+
+ helpers = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _generator() {
+ const data = _interopRequireDefault(require("@babel/generator"));
+
+ _generator = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _template() {
+ const data = _interopRequireDefault(require("@babel/template"));
+
+ _template = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function t() {
+ const data = _interopRequireWildcard(require("@babel/types"));
+
+ t = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
+
+const buildUmdWrapper = replacements => _template().default`
+ (function (root, factory) {
+ if (typeof define === "function" && define.amd) {
+ define(AMD_ARGUMENTS, factory);
+ } else if (typeof exports === "object") {
+ factory(COMMON_ARGUMENTS);
+ } else {
+ factory(BROWSER_ARGUMENTS);
+ }
+ })(UMD_ROOT, function (FACTORY_PARAMETERS) {
+ FACTORY_BODY
+ });
+ `(replacements);
+
+function buildGlobal(whitelist) {
+ const namespace = t().identifier("babelHelpers");
+ const body = [];
+ const container = t().functionExpression(null, [t().identifier("global")], t().blockStatement(body));
+ const tree = t().program([t().expressionStatement(t().callExpression(container, [t().conditionalExpression(t().binaryExpression("===", t().unaryExpression("typeof", t().identifier("global")), t().stringLiteral("undefined")), t().identifier("self"), t().identifier("global"))]))]);
+ body.push(t().variableDeclaration("var", [t().variableDeclarator(namespace, t().assignmentExpression("=", t().memberExpression(t().identifier("global"), namespace), t().objectExpression([])))]));
+ buildHelpers(body, namespace, whitelist);
+ return tree;
+}
+
+function buildModule(whitelist) {
+ const body = [];
+ const refs = buildHelpers(body, null, whitelist);
+ body.unshift(t().exportNamedDeclaration(null, Object.keys(refs).map(name => {
+ return t().exportSpecifier(t().cloneNode(refs[name]), t().identifier(name));
+ })));
+ return t().program(body, [], "module");
+}
+
+function buildUmd(whitelist) {
+ const namespace = t().identifier("babelHelpers");
+ const body = [];
+ body.push(t().variableDeclaration("var", [t().variableDeclarator(namespace, t().identifier("global"))]));
+ buildHelpers(body, namespace, whitelist);
+ return t().program([buildUmdWrapper({
+ FACTORY_PARAMETERS: t().identifier("global"),
+ BROWSER_ARGUMENTS: t().assignmentExpression("=", t().memberExpression(t().identifier("root"), namespace), t().objectExpression([])),
+ COMMON_ARGUMENTS: t().identifier("exports"),
+ AMD_ARGUMENTS: t().arrayExpression([t().stringLiteral("exports")]),
+ FACTORY_BODY: body,
+ UMD_ROOT: t().identifier("this")
+ })]);
+}
+
+function buildVar(whitelist) {
+ const namespace = t().identifier("babelHelpers");
+ const body = [];
+ body.push(t().variableDeclaration("var", [t().variableDeclarator(namespace, t().objectExpression([]))]));
+ const tree = t().program(body);
+ buildHelpers(body, namespace, whitelist);
+ body.push(t().expressionStatement(namespace));
+ return tree;
+}
+
+function buildHelpers(body, namespace, whitelist) {
+ const getHelperReference = name => {
+ return namespace ? t().memberExpression(namespace, t().identifier(name)) : t().identifier(`_${name}`);
+ };
+
+ const refs = {};
+ helpers().list.forEach(function (name) {
+ if (whitelist && whitelist.indexOf(name) < 0) return;
+ const ref = refs[name] = getHelperReference(name);
+ const {
+ nodes
+ } = helpers().get(name, getHelperReference, ref);
+ body.push(...nodes);
+ });
+ return refs;
+}
+
+function _default(whitelist, outputType = "global") {
+ let tree;
+ const build = {
+ global: buildGlobal,
+ module: buildModule,
+ umd: buildUmd,
+ var: buildVar
+ }[outputType];
+
+ if (build) {
+ tree = build(whitelist);
+ } else {
+ throw new Error(`Unsupported output type ${outputType}`);
+ }
+
+ return (0, _generator().default)(tree).code;
+}
+},{"@babel/generator":50,"@babel/helpers":63,"@babel/template":70,"@babel/types":143}],23:[function(require,module,exports){
+(function (process){(function (){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.transformFromAstSync = transformFromAstSync;
+exports.transformFromAstAsync = transformFromAstAsync;
+exports.transformFromAst = void 0;
+
+var _config = _interopRequireDefault(require("./config"));
+
+var _transformation = require("./transformation");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const transformFromAst = function transformFromAst(ast, code, opts, callback) {
+ if (typeof opts === "function") {
+ callback = opts;
+ opts = undefined;
+ }
+
+ if (callback === undefined) return transformFromAstSync(ast, code, opts);
+ const cb = callback;
+ process.nextTick(() => {
+ let cfg;
+
+ try {
+ cfg = (0, _config.default)(opts);
+ if (cfg === null) return cb(null, null);
+ } catch (err) {
+ return cb(err);
+ }
+
+ if (!ast) return cb(new Error("No AST given"));
+ (0, _transformation.runAsync)(cfg, code, ast, cb);
+ });
+};
+
+exports.transformFromAst = transformFromAst;
+
+function transformFromAstSync(ast, code, opts) {
+ const config = (0, _config.default)(opts);
+ if (config === null) return null;
+ if (!ast) throw new Error("No AST given");
+ return (0, _transformation.runSync)(config, code, ast);
+}
+
+function transformFromAstAsync(ast, code, opts) {
+ return new Promise((res, rej) => {
+ transformFromAst(ast, code, opts, (err, result) => {
+ if (err == null) res(result);else rej(err);
+ });
+ });
+}
+}).call(this)}).call(this,require('_process'))
+},{"./config":10,"./transformation":30,"_process":386}],24:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.transformFileSync = transformFileSync;
+exports.transformFileAsync = transformFileAsync;
+exports.transformFile = void 0;
+
+const transformFile = function transformFile(filename, opts, callback) {
+ if (typeof opts === "function") {
+ callback = opts;
+ }
+
+ callback(new Error("Transforming files is not supported in browsers"), null);
+};
+
+exports.transformFile = transformFile;
+
+function transformFileSync() {
+ throw new Error("Transforming files is not supported in browsers");
+}
+
+function transformFileAsync() {
+ return Promise.reject(new Error("Transforming files is not supported in browsers"));
+}
+},{}],25:[function(require,module,exports){
+(function (process){(function (){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.transformSync = transformSync;
+exports.transformAsync = transformAsync;
+exports.transform = void 0;
+
+var _config = _interopRequireDefault(require("./config"));
+
+var _transformation = require("./transformation");
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const transform = function transform(code, opts, callback) {
+ if (typeof opts === "function") {
+ callback = opts;
+ opts = undefined;
+ }
+
+ if (callback === undefined) return transformSync(code, opts);
+ const cb = callback;
+ process.nextTick(() => {
+ let cfg;
+
+ try {
+ cfg = (0, _config.default)(opts);
+ if (cfg === null) return cb(null, null);
+ } catch (err) {
+ return cb(err);
+ }
+
+ (0, _transformation.runAsync)(cfg, code, null, cb);
+ });
+};
+
+exports.transform = transform;
+
+function transformSync(code, opts) {
+ const config = (0, _config.default)(opts);
+ if (config === null) return null;
+ return (0, _transformation.runSync)(config, code);
+}
+
+function transformAsync(code, opts) {
+ return new Promise((res, rej) => {
+ transform(code, opts, (err, result) => {
+ if (err == null) res(result);else rej(err);
+ });
+ });
+}
+}).call(this)}).call(this,require('_process'))
+},{"./config":10,"./transformation":30,"_process":386}],26:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = loadBlockHoistPlugin;
+
+function _sortBy() {
+ const data = _interopRequireDefault(require("lodash/sortBy"));
+
+ _sortBy = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _config = _interopRequireDefault(require("../config"));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+let LOADED_PLUGIN;
+
+function loadBlockHoistPlugin() {
+ if (!LOADED_PLUGIN) {
+ const config = (0, _config.default)({
+ babelrc: false,
+ configFile: false,
+ plugins: [blockHoistPlugin]
+ });
+ LOADED_PLUGIN = config ? config.passes[0][0] : undefined;
+ if (!LOADED_PLUGIN) throw new Error("Assertion failure");
+ }
+
+ return LOADED_PLUGIN;
+}
+
+const blockHoistPlugin = {
+ name: "internal.blockHoist",
+ visitor: {
+ Block: {
+ exit({
+ node
+ }) {
+ let hasChange = false;
+
+ for (let i = 0; i < node.body.length; i++) {
+ const bodyNode = node.body[i];
+
+ if (bodyNode && bodyNode._blockHoist != null) {
+ hasChange = true;
+ break;
+ }
+ }
+
+ if (!hasChange) return;
+ node.body = (0, _sortBy().default)(node.body, function (bodyNode) {
+ let priority = bodyNode && bodyNode._blockHoist;
+ if (priority == null) priority = 1;
+ if (priority === true) priority = 2;
+ return -1 * priority;
+ });
+ }
+
+ }
+ }
+};
+},{"../config":10,"lodash/sortBy":361}],27:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+function helpers() {
+ const data = _interopRequireWildcard(require("@babel/helpers"));
+
+ helpers = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _traverse() {
+ const data = _interopRequireWildcard(require("@babel/traverse"));
+
+ _traverse = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _codeFrame() {
+ const data = require("@babel/code-frame");
+
+ _codeFrame = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function t() {
+ const data = _interopRequireWildcard(require("@babel/types"));
+
+ t = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _semver() {
+ const data = _interopRequireDefault(require("semver"));
+
+ _semver = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
+
+const errorVisitor = {
+ enter(path, state) {
+ const loc = path.node.loc;
+
+ if (loc) {
+ state.loc = loc;
+ path.stop();
+ }
+ }
+
+};
+
+class File {
+ constructor(options, {
+ code,
+ ast,
+ inputMap
+ }) {
+ this._map = new Map();
+ this.declarations = {};
+ this.path = null;
+ this.ast = {};
+ this.metadata = {};
+ this.code = "";
+ this.inputMap = null;
+ this.hub = {
+ file: this,
+ getCode: () => this.code,
+ getScope: () => this.scope,
+ addHelper: this.addHelper.bind(this),
+ buildError: this.buildCodeFrameError.bind(this)
+ };
+ this.opts = options;
+ this.code = code;
+ this.ast = ast;
+ this.inputMap = inputMap;
+ this.path = _traverse().NodePath.get({
+ hub: this.hub,
+ parentPath: null,
+ parent: this.ast,
+ container: this.ast,
+ key: "program"
+ }).setContext();
+ this.scope = this.path.scope;
+ }
+
+ get shebang() {
+ const {
+ interpreter
+ } = this.path.node;
+ return interpreter ? interpreter.value : "";
+ }
+
+ set shebang(value) {
+ if (value) {
+ this.path.get("interpreter").replaceWith(t().interpreterDirective(value));
+ } else {
+ this.path.get("interpreter").remove();
+ }
+ }
+
+ set(key, val) {
+ if (key === "helpersNamespace") {
+ throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." + "If you are using @babel/plugin-external-helpers you will need to use a newer " + "version than the one you currently have installed. " + "If you have your own implementation, you'll want to explore using 'helperGenerator' " + "alongside 'file.availableHelper()'.");
+ }
+
+ this._map.set(key, val);
+ }
+
+ get(key) {
+ return this._map.get(key);
+ }
+
+ has(key) {
+ return this._map.has(key);
+ }
+
+ getModuleName() {
+ const {
+ filename,
+ filenameRelative = filename,
+ moduleId,
+ moduleIds = !!moduleId,
+ getModuleId,
+ sourceRoot: sourceRootTmp,
+ moduleRoot = sourceRootTmp,
+ sourceRoot = moduleRoot
+ } = this.opts;
+ if (!moduleIds) return null;
+
+ if (moduleId != null && !getModuleId) {
+ return moduleId;
+ }
+
+ let moduleName = moduleRoot != null ? moduleRoot + "/" : "";
+
+ if (filenameRelative) {
+ const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : "";
+ moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.(\w*?)$/, "");
+ }
+
+ moduleName = moduleName.replace(/\\/g, "/");
+
+ if (getModuleId) {
+ return getModuleId(moduleName) || moduleName;
+ } else {
+ return moduleName;
+ }
+ }
+
+ addImport() {
+ throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'.");
+ }
+
+ availableHelper(name, versionRange) {
+ let minVersion;
+
+ try {
+ minVersion = helpers().minVersion(name);
+ } catch (err) {
+ if (err.code !== "BABEL_HELPER_UNKNOWN") throw err;
+ return false;
+ }
+
+ if (typeof versionRange !== "string") return true;
+ if (_semver().default.valid(versionRange)) versionRange = `^${versionRange}`;
+ return !_semver().default.intersects(`<${minVersion}`, versionRange) && !_semver().default.intersects(`>=8.0.0`, versionRange);
+ }
+
+ addHelper(name) {
+ const declar = this.declarations[name];
+ if (declar) return t().cloneNode(declar);
+ const generator = this.get("helperGenerator");
+
+ if (generator) {
+ const res = generator(name);
+ if (res) return res;
+ }
+
+ const uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
+ const dependencies = {};
+
+ for (const dep of helpers().getDependencies(name)) {
+ dependencies[dep] = this.addHelper(dep);
+ }
+
+ const {
+ nodes,
+ globals
+ } = helpers().get(name, dep => dependencies[dep], uid, Object.keys(this.scope.getAllBindings()));
+ globals.forEach(name => {
+ if (this.path.scope.hasBinding(name, true)) {
+ this.path.scope.rename(name);
+ }
+ });
+ nodes.forEach(node => {
+ node._compact = true;
+ });
+ this.path.unshiftContainer("body", nodes);
+ this.path.get("body").forEach(path => {
+ if (nodes.indexOf(path.node) === -1) return;
+ if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);
+ });
+ return uid;
+ }
+
+ addTemplateObject() {
+ throw new Error("This function has been moved into the template literal transform itself.");
+ }
+
+ buildCodeFrameError(node, msg, Error = SyntaxError) {
+ let loc = node && (node.loc || node._loc);
+ msg = `${this.opts.filename}: ${msg}`;
+
+ if (!loc && node) {
+ const state = {
+ loc: null
+ };
+ (0, _traverse().default)(node, errorVisitor, this.scope, state);
+ loc = state.loc;
+ let txt = "This is an error on an internal node. Probably an internal error.";
+ if (loc) txt += " Location has been estimated.";
+ msg += ` (${txt})`;
+ }
+
+ if (loc) {
+ const {
+ highlightCode = true
+ } = this.opts;
+ msg += "\n" + (0, _codeFrame().codeFrameColumns)(this.code, {
+ start: {
+ line: loc.start.line,
+ column: loc.start.column + 1
+ }
+ }, {
+ highlightCode
+ });
+ }
+
+ return new Error(msg);
+ }
+
+}
+
+exports.default = File;
+},{"@babel/code-frame":2,"@babel/helpers":63,"@babel/traverse":79,"@babel/types":143,"semver":35}],28:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = generateCode;
+
+function _convertSourceMap() {
+ const data = _interopRequireDefault(require("convert-source-map"));
+
+ _convertSourceMap = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _generator() {
+ const data = _interopRequireDefault(require("@babel/generator"));
+
+ _generator = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _mergeMap = _interopRequireDefault(require("./merge-map"));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function generateCode(pluginPasses, file) {
+ const {
+ opts,
+ ast,
+ code,
+ inputMap
+ } = file;
+ const results = [];
+
+ for (const plugins of pluginPasses) {
+ for (const plugin of plugins) {
+ const {
+ generatorOverride
+ } = plugin;
+
+ if (generatorOverride) {
+ const result = generatorOverride(ast, opts.generatorOpts, code, _generator().default);
+ if (result !== undefined) results.push(result);
+ }
+ }
+ }
+
+ let result;
+
+ if (results.length === 0) {
+ result = (0, _generator().default)(ast, opts.generatorOpts, code);
+ } else if (results.length === 1) {
+ result = results[0];
+
+ if (typeof result.then === "function") {
+ throw new Error(`You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`);
+ }
+ } else {
+ throw new Error("More than one plugin attempted to override codegen.");
+ }
+
+ let {
+ code: outputCode,
+ map: outputMap
+ } = result;
+
+ if (outputMap && inputMap) {
+ outputMap = (0, _mergeMap.default)(inputMap.toObject(), outputMap);
+ }
+
+ if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
+ outputCode += "\n" + _convertSourceMap().default.fromObject(outputMap).toComment();
+ }
+
+ if (opts.sourceMaps === "inline") {
+ outputMap = null;
+ }
+
+ return {
+ outputCode,
+ outputMap
+ };
+}
+},{"./merge-map":29,"@babel/generator":50,"convert-source-map":184}],29:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = mergeSourceMap;
+
+function _sourceMap() {
+ const data = _interopRequireDefault(require("source-map"));
+
+ _sourceMap = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function mergeSourceMap(inputMap, map) {
+ const input = buildMappingData(inputMap);
+ const output = buildMappingData(map);
+ const mergedGenerator = new (_sourceMap().default.SourceMapGenerator)();
+
+ for (const _ref of input.sources) {
+ const {
+ source
+ } = _ref;
+
+ if (typeof source.content === "string") {
+ mergedGenerator.setSourceContent(source.path, source.content);
+ }
+ }
+
+ if (output.sources.length === 1) {
+ const defaultSource = output.sources[0];
+ const insertedMappings = new Map();
+ eachInputGeneratedRange(input, (generated, original, source) => {
+ eachOverlappingGeneratedOutputRange(defaultSource, generated, item => {
+ const key = makeMappingKey(item);
+ if (insertedMappings.has(key)) return;
+ insertedMappings.set(key, item);
+ mergedGenerator.addMapping({
+ source: source.path,
+ original: {
+ line: original.line,
+ column: original.columnStart
+ },
+ generated: {
+ line: item.line,
+ column: item.columnStart
+ },
+ name: original.name
+ });
+ });
+ });
+
+ for (const item of insertedMappings.values()) {
+ if (item.columnEnd === Infinity) {
+ continue;
+ }
+
+ const clearItem = {
+ line: item.line,
+ columnStart: item.columnEnd
+ };
+ const key = makeMappingKey(clearItem);
+
+ if (insertedMappings.has(key)) {
+ continue;
+ }
+
+ mergedGenerator.addMapping({
+ generated: {
+ line: clearItem.line,
+ column: clearItem.columnStart
+ }
+ });
+ }
+ }
+
+ const result = mergedGenerator.toJSON();
+
+ if (typeof input.sourceRoot === "string") {
+ result.sourceRoot = input.sourceRoot;
+ }
+
+ return result;
+}
+
+function makeMappingKey(item) {
+ return `${item.line}/${item.columnStart}`;
+}
+
+function eachOverlappingGeneratedOutputRange(outputFile, inputGeneratedRange, callback) {
+ const overlappingOriginal = filterApplicableOriginalRanges(outputFile, inputGeneratedRange);
+
+ for (const _ref2 of overlappingOriginal) {
+ const {
+ generated
+ } = _ref2;
+
+ for (const item of generated) {
+ callback(item);
+ }
+ }
+}
+
+function filterApplicableOriginalRanges({
+ mappings
+}, {
+ line,
+ columnStart,
+ columnEnd
+}) {
+ return filterSortedArray(mappings, ({
+ original: outOriginal
+ }) => {
+ if (line > outOriginal.line) return -1;
+ if (line < outOriginal.line) return 1;
+ if (columnStart >= outOriginal.columnEnd) return -1;
+ if (columnEnd <= outOriginal.columnStart) return 1;
+ return 0;
+ });
+}
+
+function eachInputGeneratedRange(map, callback) {
+ for (const _ref3 of map.sources) {
+ const {
+ source,
+ mappings
+ } = _ref3;
+
+ for (const _ref4 of mappings) {
+ const {
+ original,
+ generated
+ } = _ref4;
+
+ for (const item of generated) {
+ callback(item, original, source);
+ }
+ }
+ }
+}
+
+function buildMappingData(map) {
+ const consumer = new (_sourceMap().default.SourceMapConsumer)(Object.assign({}, map, {
+ sourceRoot: null
+ }));
+ const sources = new Map();
+ const mappings = new Map();
+ let last = null;
+ consumer.computeColumnSpans();
+ consumer.eachMapping(m => {
+ if (m.originalLine === null) return;
+ let source = sources.get(m.source);
+
+ if (!source) {
+ source = {
+ path: m.source,
+ content: consumer.sourceContentFor(m.source, true)
+ };
+ sources.set(m.source, source);
+ }
+
+ let sourceData = mappings.get(source);
+
+ if (!sourceData) {
+ sourceData = {
+ source,
+ mappings: []
+ };
+ mappings.set(source, sourceData);
+ }
+
+ const obj = {
+ line: m.originalLine,
+ columnStart: m.originalColumn,
+ columnEnd: Infinity,
+ name: m.name
+ };
+
+ if (last && last.source === source && last.mapping.line === m.originalLine) {
+ last.mapping.columnEnd = m.originalColumn;
+ }
+
+ last = {
+ source,
+ mapping: obj
+ };
+ sourceData.mappings.push({
+ original: obj,
+ generated: consumer.allGeneratedPositionsFor({
+ source: m.source,
+ line: m.originalLine,
+ column: m.originalColumn
+ }).map(item => ({
+ line: item.line,
+ columnStart: item.column,
+ columnEnd: item.lastColumn + 1
+ }))
+ });
+ }, null, _sourceMap().default.SourceMapConsumer.ORIGINAL_ORDER);
+ return {
+ file: map.file,
+ sourceRoot: map.sourceRoot,
+ sources: Array.from(mappings.values())
+ };
+}
+
+function findInsertionLocation(array, callback) {
+ let left = 0;
+ let right = array.length;
+
+ while (left < right) {
+ const mid = Math.floor((left + right) / 2);
+ const item = array[mid];
+ const result = callback(item);
+
+ if (result === 0) {
+ left = mid;
+ break;
+ }
+
+ if (result >= 0) {
+ right = mid;
+ } else {
+ left = mid + 1;
+ }
+ }
+
+ let i = left;
+
+ if (i < array.length) {
+ while (i >= 0 && callback(array[i]) >= 0) {
+ i--;
+ }
+
+ return i + 1;
+ }
+
+ return i;
+}
+
+function filterSortedArray(array, callback) {
+ const start = findInsertionLocation(array, callback);
+ const results = [];
+
+ for (let i = start; i < array.length && callback(array[i]) === 0; i++) {
+ results.push(array[i]);
+ }
+
+ return results;
+}
+},{"source-map":377}],30:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.runAsync = runAsync;
+exports.runSync = runSync;
+
+function _traverse() {
+ const data = _interopRequireDefault(require("@babel/traverse"));
+
+ _traverse = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _pluginPass = _interopRequireDefault(require("./plugin-pass"));
+
+var _blockHoistPlugin = _interopRequireDefault(require("./block-hoist-plugin"));
+
+var _normalizeOpts = _interopRequireDefault(require("./normalize-opts"));
+
+var _normalizeFile = _interopRequireDefault(require("./normalize-file"));
+
+var _generate = _interopRequireDefault(require("./file/generate"));
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function runAsync(config, code, ast, callback) {
+ let result;
+
+ try {
+ result = runSync(config, code, ast);
+ } catch (err) {
+ return callback(err);
+ }
+
+ return callback(null, result);
+}
+
+function runSync(config, code, ast) {
+ const file = (0, _normalizeFile.default)(config.passes, (0, _normalizeOpts.default)(config), code, ast);
+ transformFile(file, config.passes);
+ const opts = file.opts;
+ const {
+ outputCode,
+ outputMap
+ } = opts.code !== false ? (0, _generate.default)(config.passes, file) : {};
+ return {
+ metadata: file.metadata,
+ options: opts,
+ ast: opts.ast === true ? file.ast : null,
+ code: outputCode === undefined ? null : outputCode,
+ map: outputMap === undefined ? null : outputMap,
+ sourceType: file.ast.program.sourceType
+ };
+}
+
+function transformFile(file, pluginPasses) {
+ for (const pluginPairs of pluginPasses) {
+ const passPairs = [];
+ const passes = [];
+ const visitors = [];
+
+ for (const plugin of pluginPairs.concat([(0, _blockHoistPlugin.default)()])) {
+ const pass = new _pluginPass.default(file, plugin.key, plugin.options);
+ passPairs.push([plugin, pass]);
+ passes.push(pass);
+ visitors.push(plugin.visitor);
+ }
+
+ for (const [plugin, pass] of passPairs) {
+ const fn = plugin.pre;
+
+ if (fn) {
+ const result = fn.call(pass, file);
+
+ if (isThenable(result)) {
+ throw new Error(`You appear to be using an plugin with an async .pre, ` + `which your current version of Babel does not support.` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
+ }
+ }
+ }
+
+ const visitor = _traverse().default.visitors.merge(visitors, passes, file.opts.wrapPluginVisitorMethod);
+
+ (0, _traverse().default)(file.ast, visitor, file.scope);
+
+ for (const [plugin, pass] of passPairs) {
+ const fn = plugin.post;
+
+ if (fn) {
+ const result = fn.call(pass, file);
+
+ if (isThenable(result)) {
+ throw new Error(`You appear to be using an plugin with an async .post, ` + `which your current version of Babel does not support.` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
+ }
+ }
+ }
+ }
+}
+
+function isThenable(val) {
+ return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
+}
+},{"./block-hoist-plugin":26,"./file/generate":28,"./normalize-file":31,"./normalize-opts":32,"./plugin-pass":33,"@babel/traverse":79}],31:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = normalizeFile;
+
+function _path() {
+ const data = _interopRequireDefault(require("path"));
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _debug() {
+ const data = _interopRequireDefault(require("debug"));
+
+ _debug = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _cloneDeep() {
+ const data = _interopRequireDefault(require("lodash/cloneDeep"));
+
+ _cloneDeep = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function t() {
+ const data = _interopRequireWildcard(require("@babel/types"));
+
+ t = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _convertSourceMap() {
+ const data = _interopRequireDefault(require("convert-source-map"));
+
+ _convertSourceMap = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _parser() {
+ const data = require("@babel/parser");
+
+ _parser = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _codeFrame() {
+ const data = require("@babel/code-frame");
+
+ _codeFrame = function () {
+ return data;
+ };
+
+ return data;
+}
+
+var _file = _interopRequireDefault(require("./file/file"));
+
+var _missingPluginHelper = _interopRequireDefault(require("./util/missing-plugin-helper"));
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+const debug = (0, _debug().default)("babel:transform:file");
+
+function normalizeFile(pluginPasses, options, code, ast) {
+ code = `${code || ""}`;
+ let inputMap = null;
+
+ if (options.inputSourceMap !== false) {
+ if (typeof options.inputSourceMap === "object") {
+ inputMap = _convertSourceMap().default.fromObject(options.inputSourceMap);
+ }
+
+ if (!inputMap) {
+ try {
+ inputMap = _convertSourceMap().default.fromSource(code);
+
+ if (inputMap) {
+ code = _convertSourceMap().default.removeComments(code);
+ }
+ } catch (err) {
+ debug("discarding unknown inline input sourcemap", err);
+ code = _convertSourceMap().default.removeComments(code);
+ }
+ }
+
+ if (!inputMap) {
+ if (typeof options.filename === "string") {
+ try {
+ inputMap = _convertSourceMap().default.fromMapFileSource(code, _path().default.dirname(options.filename));
+
+ if (inputMap) {
+ code = _convertSourceMap().default.removeMapFileComments(code);
+ }
+ } catch (err) {
+ debug("discarding unknown file input sourcemap", err);
+ code = _convertSourceMap().default.removeMapFileComments(code);
+ }
+ } else {
+ debug("discarding un-loadable file input sourcemap");
+ code = _convertSourceMap().default.removeMapFileComments(code);
+ }
+ }
+ }
+
+ if (ast) {
+ if (ast.type === "Program") {
+ ast = t().file(ast, [], []);
+ } else if (ast.type !== "File") {
+ throw new Error("AST root must be a Program or File node");
+ }
+
+ ast = (0, _cloneDeep().default)(ast);
+ } else {
+ ast = parser(pluginPasses, options, code);
+ }
+
+ return new _file.default(options, {
+ code,
+ ast,
+ inputMap
+ });
+}
+
+function parser(pluginPasses, {
+ parserOpts,
+ highlightCode = true,
+ filename = "unknown"
+}, code) {
+ try {
+ const results = [];
+
+ for (const plugins of pluginPasses) {
+ for (const plugin of plugins) {
+ const {
+ parserOverride
+ } = plugin;
+
+ if (parserOverride) {
+ const ast = parserOverride(code, parserOpts, _parser().parse);
+ if (ast !== undefined) results.push(ast);
+ }
+ }
+ }
+
+ if (results.length === 0) {
+ return (0, _parser().parse)(code, parserOpts);
+ } else if (results.length === 1) {
+ if (typeof results[0].then === "function") {
+ throw new Error(`You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`);
+ }
+
+ return results[0];
+ }
+
+ throw new Error("More than one plugin attempted to override parsing.");
+ } catch (err) {
+ if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") {
+ err.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module " + "or sourceType:unambiguous in your Babel config for this file.";
+ }
+
+ const {
+ loc,
+ missingPlugin
+ } = err;
+
+ if (loc) {
+ const codeFrame = (0, _codeFrame().codeFrameColumns)(code, {
+ start: {
+ line: loc.line,
+ column: loc.column + 1
+ }
+ }, {
+ highlightCode
+ });
+
+ if (missingPlugin) {
+ err.message = `${filename}: ` + (0, _missingPluginHelper.default)(missingPlugin[0], loc, codeFrame);
+ } else {
+ err.message = `${filename}: ${err.message}\n\n` + codeFrame;
+ }
+
+ err.code = "BABEL_PARSE_ERROR";
+ }
+
+ throw err;
+ }
+}
+},{"./file/file":27,"./util/missing-plugin-helper":34,"@babel/code-frame":2,"@babel/parser":67,"@babel/types":143,"convert-source-map":184,"debug":185,"lodash/cloneDeep":335,"path":385}],32:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = normalizeOptions;
+
+function _path() {
+ const data = _interopRequireDefault(require("path"));
+
+ _path = function () {
+ return data;
+ };
+
+ return data;
+}
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function normalizeOptions(config) {
+ const {
+ filename,
+ cwd,
+ filenameRelative = typeof filename === "string" ? _path().default.relative(cwd, filename) : "unknown",
+ sourceType = "module",
+ inputSourceMap,
+ sourceMaps = !!inputSourceMap,
+ moduleRoot,
+ sourceRoot = moduleRoot,
+ sourceFileName = _path().default.basename(filenameRelative),
+ comments = true,
+ compact = "auto"
+ } = config.options;
+ const opts = config.options;
+ const options = Object.assign({}, opts, {
+ parserOpts: Object.assign({
+ sourceType: _path().default.extname(filenameRelative) === ".mjs" ? "module" : sourceType,
+ sourceFileName: filename,
+ plugins: []
+ }, opts.parserOpts),
+ generatorOpts: Object.assign({
+ filename,
+ auxiliaryCommentBefore: opts.auxiliaryCommentBefore,
+ auxiliaryCommentAfter: opts.auxiliaryCommentAfter,
+ retainLines: opts.retainLines,
+ comments,
+ shouldPrintComment: opts.shouldPrintComment,
+ compact,
+ minified: opts.minified,
+ sourceMaps,
+ sourceRoot,
+ sourceFileName
+ }, opts.generatorOpts)
+ });
+
+ for (const plugins of config.passes) {
+ for (const plugin of plugins) {
+ if (plugin.manipulateOptions) {
+ plugin.manipulateOptions(options, options.parserOpts);
+ }
+ }
+ }
+
+ return options;
+}
+},{"path":385}],33:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+class PluginPass {
+ constructor(file, key, options) {
+ this._map = new Map();
+ this.key = key;
+ this.file = file;
+ this.opts = options || {};
+ this.cwd = file.opts.cwd;
+ this.filename = file.opts.filename;
+ }
+
+ set(key, val) {
+ this._map.set(key, val);
+ }
+
+ get(key) {
+ return this._map.get(key);
+ }
+
+ availableHelper(name, versionRange) {
+ return this.file.availableHelper(name, versionRange);
+ }
+
+ addHelper(name) {
+ return this.file.addHelper(name);
+ }
+
+ addImport() {
+ return this.file.addImport();
+ }
+
+ getModuleName() {
+ return this.file.getModuleName();
+ }
+
+ buildCodeFrameError(node, msg, Error) {
+ return this.file.buildCodeFrameError(node, msg, Error);
+ }
+
+}
+
+exports.default = PluginPass;
+},{}],34:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = generateMissingPluginMessage;
+const pluginNameMap = {
+ classProperties: {
+ syntax: {
+ name: "@babel/plugin-syntax-class-properties",
+ url: "https://git.io/vb4yQ"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-class-properties",
+ url: "https://git.io/vb4SL"
+ }
+ },
+ decorators: {
+ syntax: {
+ name: "@babel/plugin-syntax-decorators",
+ url: "https://git.io/vb4y9"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-decorators",
+ url: "https://git.io/vb4ST"
+ }
+ },
+ doExpressions: {
+ syntax: {
+ name: "@babel/plugin-syntax-do-expressions",
+ url: "https://git.io/vb4yh"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-do-expressions",
+ url: "https://git.io/vb4S3"
+ }
+ },
+ dynamicImport: {
+ syntax: {
+ name: "@babel/plugin-syntax-dynamic-import",
+ url: "https://git.io/vb4Sv"
+ }
+ },
+ exportDefaultFrom: {
+ syntax: {
+ name: "@babel/plugin-syntax-export-default-from",
+ url: "https://git.io/vb4SO"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-export-default-from",
+ url: "https://git.io/vb4yH"
+ }
+ },
+ exportNamespaceFrom: {
+ syntax: {
+ name: "@babel/plugin-syntax-export-namespace-from",
+ url: "https://git.io/vb4Sf"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-export-namespace-from",
+ url: "https://git.io/vb4SG"
+ }
+ },
+ flow: {
+ syntax: {
+ name: "@babel/plugin-syntax-flow",
+ url: "https://git.io/vb4yb"
+ },
+ transform: {
+ name: "@babel/plugin-transform-flow-strip-types",
+ url: "https://git.io/vb49g"
+ }
+ },
+ functionBind: {
+ syntax: {
+ name: "@babel/plugin-syntax-function-bind",
+ url: "https://git.io/vb4y7"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-function-bind",
+ url: "https://git.io/vb4St"
+ }
+ },
+ functionSent: {
+ syntax: {
+ name: "@babel/plugin-syntax-function-sent",
+ url: "https://git.io/vb4yN"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-function-sent",
+ url: "https://git.io/vb4SZ"
+ }
+ },
+ importMeta: {
+ syntax: {
+ name: "@babel/plugin-syntax-import-meta",
+ url: "https://git.io/vbKK6"
+ }
+ },
+ jsx: {
+ syntax: {
+ name: "@babel/plugin-syntax-jsx",
+ url: "https://git.io/vb4yA"
+ },
+ transform: {
+ name: "@babel/plugin-transform-react-jsx",
+ url: "https://git.io/vb4yd"
+ }
+ },
+ logicalAssignment: {
+ syntax: {
+ name: "@babel/plugin-syntax-logical-assignment-operators",
+ url: "https://git.io/vAlBp"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-logical-assignment-operators",
+ url: "https://git.io/vAlRe"
+ }
+ },
+ nullishCoalescingOperator: {
+ syntax: {
+ name: "@babel/plugin-syntax-nullish-coalescing-operator",
+ url: "https://git.io/vb4yx"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-nullish-coalescing-operator",
+ url: "https://git.io/vb4Se"
+ }
+ },
+ numericSeparator: {
+ syntax: {
+ name: "@babel/plugin-syntax-numeric-separator",
+ url: "https://git.io/vb4Sq"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-numeric-separator",
+ url: "https://git.io/vb4yS"
+ }
+ },
+ optionalChaining: {
+ syntax: {
+ name: "@babel/plugin-syntax-optional-chaining",
+ url: "https://git.io/vb4Sc"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-optional-chaining",
+ url: "https://git.io/vb4Sk"
+ }
+ },
+ pipelineOperator: {
+ syntax: {
+ name: "@babel/plugin-syntax-pipeline-operator",
+ url: "https://git.io/vb4yj"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-pipeline-operator",
+ url: "https://git.io/vb4SU"
+ }
+ },
+ throwExpressions: {
+ syntax: {
+ name: "@babel/plugin-syntax-throw-expressions",
+ url: "https://git.io/vb4SJ"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-throw-expressions",
+ url: "https://git.io/vb4yF"
+ }
+ },
+ typescript: {
+ syntax: {
+ name: "@babel/plugin-syntax-typescript",
+ url: "https://git.io/vb4SC"
+ },
+ transform: {
+ name: "@babel/plugin-transform-typescript",
+ url: "https://git.io/vb4Sm"
+ }
+ },
+ asyncGenerators: {
+ syntax: {
+ name: "@babel/plugin-syntax-async-generators",
+ url: "https://git.io/vb4SY"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-async-generator-functions",
+ url: "https://git.io/vb4yp"
+ }
+ },
+ objectRestSpread: {
+ syntax: {
+ name: "@babel/plugin-syntax-object-rest-spread",
+ url: "https://git.io/vb4y5"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-object-rest-spread",
+ url: "https://git.io/vb4Ss"
+ }
+ },
+ optionalCatchBinding: {
+ syntax: {
+ name: "@babel/plugin-syntax-optional-catch-binding",
+ url: "https://git.io/vb4Sn"
+ },
+ transform: {
+ name: "@babel/plugin-proposal-optional-catch-binding",
+ url: "https://git.io/vb4SI"
+ }
+ }
+};
+
+const getNameURLCombination = ({
+ name,
+ url
+}) => `${name} (${url})`;
+
+function generateMissingPluginMessage(missingPluginName, loc, codeFrame) {
+ let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame;
+ const pluginInfo = pluginNameMap[missingPluginName];
+
+ if (pluginInfo) {
+ const {
+ syntax: syntaxPlugin,
+ transform: transformPlugin
+ } = pluginInfo;
+
+ if (syntaxPlugin) {
+ if (transformPlugin) {
+ const transformPluginInfo = getNameURLCombination(transformPlugin);
+ helpMessage += `\n\nAdd ${transformPluginInfo} to the 'plugins' section of your Babel config ` + `to enable transformation.`;
+ } else {
+ const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);
+ helpMessage += `\n\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`;
+ }
+ }
+ }
+
+ return helpMessage;
+}
+},{}],35:[function(require,module,exports){
+(function (process){(function (){
+exports = module.exports = SemVer
+
+var debug
+/* istanbul ignore next */
+if (typeof process === 'object' &&
+ process.env &&
+ process.env.NODE_DEBUG &&
+ /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
+ debug = function () {
+ var args = Array.prototype.slice.call(arguments, 0)
+ args.unshift('SEMVER')
+ console.log.apply(console, args)
+ }
+} else {
+ debug = function () {}
+}
+
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+exports.SEMVER_SPEC_VERSION = '2.0.0'
+
+var MAX_LENGTH = 256
+var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
+ /* istanbul ignore next */ 9007199254740991
+
+// Max safe segment length for coercion.
+var MAX_SAFE_COMPONENT_LENGTH = 16
+
+// The actual regexps go on exports.re
+var re = exports.re = []
+var src = exports.src = []
+var R = 0
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+var NUMERICIDENTIFIER = R++
+src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
+var NUMERICIDENTIFIERLOOSE = R++
+src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+var NONNUMERICIDENTIFIER = R++
+src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+var MAINVERSION = R++
+src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIER] + ')'
+
+var MAINVERSIONLOOSE = R++
+src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+var PRERELEASEIDENTIFIER = R++
+src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
+ '|' + src[NONNUMERICIDENTIFIER] + ')'
+
+var PRERELEASEIDENTIFIERLOOSE = R++
+src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
+ '|' + src[NONNUMERICIDENTIFIER] + ')'
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+var PRERELEASE = R++
+src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
+ '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
+
+var PRERELEASELOOSE = R++
+src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
+ '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+var BUILDIDENTIFIER = R++
+src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+var BUILD = R++
+src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
+ '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups. The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+var FULL = R++
+var FULLPLAIN = 'v?' + src[MAINVERSION] +
+ src[PRERELEASE] + '?' +
+ src[BUILD] + '?'
+
+src[FULL] = '^' + FULLPLAIN + '$'
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
+ src[PRERELEASELOOSE] + '?' +
+ src[BUILD] + '?'
+
+var LOOSE = R++
+src[LOOSE] = '^' + LOOSEPLAIN + '$'
+
+var GTLT = R++
+src[GTLT] = '((?:<|>)?=?)'
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+var XRANGEIDENTIFIERLOOSE = R++
+src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
+var XRANGEIDENTIFIER = R++
+src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
+
+var XRANGEPLAIN = R++
+src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:' + src[PRERELEASE] + ')?' +
+ src[BUILD] + '?' +
+ ')?)?'
+
+var XRANGEPLAINLOOSE = R++
+src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:' + src[PRERELEASELOOSE] + ')?' +
+ src[BUILD] + '?' +
+ ')?)?'
+
+var XRANGE = R++
+src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
+var XRANGELOOSE = R++
+src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
+
+// Coercion.
+// Extract anything that could conceivably be a part of a valid semver
+var COERCE = R++
+src[COERCE] = '(?:^|[^\\d])' +
+ '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+ '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+ '(?:$|[^\\d])'
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+var LONETILDE = R++
+src[LONETILDE] = '(?:~>?)'
+
+var TILDETRIM = R++
+src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
+re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
+var tildeTrimReplace = '$1~'
+
+var TILDE = R++
+src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
+var TILDELOOSE = R++
+src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+var LONECARET = R++
+src[LONECARET] = '(?:\\^)'
+
+var CARETTRIM = R++
+src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
+re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
+var caretTrimReplace = '$1^'
+
+var CARET = R++
+src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
+var CARETLOOSE = R++
+src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+var COMPARATORLOOSE = R++
+src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
+var COMPARATOR = R++
+src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+var COMPARATORTRIM = R++
+src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
+ '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
+
+// this one has to use the /g flag
+re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
+var comparatorTrimReplace = '$1$2$3'
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+var HYPHENRANGE = R++
+src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[XRANGEPLAIN] + ')' +
+ '\\s*$'
+
+var HYPHENRANGELOOSE = R++
+src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[XRANGEPLAINLOOSE] + ')' +
+ '\\s*$'
+
+// Star ranges basically just allow anything at all.
+var STAR = R++
+src[STAR] = '(<|>)?=?\\s*\\*'
+
+// Compile to actual regexp objects.
+// All are flag-free, unless they were created above with a flag.
+for (var i = 0; i < R; i++) {
+ debug(i, src[i])
+ if (!re[i]) {
+ re[i] = new RegExp(src[i])
+ }
+}
+
+exports.parse = parse
+function parse (version, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ if (version.length > MAX_LENGTH) {
+ return null
+ }
+
+ var r = options.loose ? re[LOOSE] : re[FULL]
+ if (!r.test(version)) {
+ return null
+ }
+
+ try {
+ return new SemVer(version, options)
+ } catch (er) {
+ return null
+ }
+}
+
+exports.valid = valid
+function valid (version, options) {
+ var v = parse(version, options)
+ return v ? v.version : null
+}
+
+exports.clean = clean
+function clean (version, options) {
+ var s = parse(version.trim().replace(/^[=v]+/, ''), options)
+ return s ? s.version : null
+}
+
+exports.SemVer = SemVer
+
+function SemVer (version, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+ if (version instanceof SemVer) {
+ if (version.loose === options.loose) {
+ return version
+ } else {
+ version = version.version
+ }
+ } else if (typeof version !== 'string') {
+ throw new TypeError('Invalid Version: ' + version)
+ }
+
+ if (version.length > MAX_LENGTH) {
+ throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
+ }
+
+ if (!(this instanceof SemVer)) {
+ return new SemVer(version, options)
+ }
+
+ debug('SemVer', version, options)
+ this.options = options
+ this.loose = !!options.loose
+
+ var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
+
+ if (!m) {
+ throw new TypeError('Invalid Version: ' + version)
+ }
+
+ this.raw = version
+
+ // these are actually numbers
+ this.major = +m[1]
+ this.minor = +m[2]
+ this.patch = +m[3]
+
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+ throw new TypeError('Invalid major version')
+ }
+
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+ throw new TypeError('Invalid minor version')
+ }
+
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+ throw new TypeError('Invalid patch version')
+ }
+
+ // numberify any prerelease numeric ids
+ if (!m[4]) {
+ this.prerelease = []
+ } else {
+ this.prerelease = m[4].split('.').map(function (id) {
+ if (/^[0-9]+$/.test(id)) {
+ var num = +id
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
+ return num
+ }
+ }
+ return id
+ })
+ }
+
+ this.build = m[5] ? m[5].split('.') : []
+ this.format()
+}
+
+SemVer.prototype.format = function () {
+ this.version = this.major + '.' + this.minor + '.' + this.patch
+ if (this.prerelease.length) {
+ this.version += '-' + this.prerelease.join('.')
+ }
+ return this.version
+}
+
+SemVer.prototype.toString = function () {
+ return this.version
+}
+
+SemVer.prototype.compare = function (other) {
+ debug('SemVer.compare', this.version, this.options, other)
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return this.compareMain(other) || this.comparePre(other)
+}
+
+SemVer.prototype.compareMain = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ return compareIdentifiers(this.major, other.major) ||
+ compareIdentifiers(this.minor, other.minor) ||
+ compareIdentifiers(this.patch, other.patch)
+}
+
+SemVer.prototype.comparePre = function (other) {
+ if (!(other instanceof SemVer)) {
+ other = new SemVer(other, this.options)
+ }
+
+ // NOT having a prerelease is > having one
+ if (this.prerelease.length && !other.prerelease.length) {
+ return -1
+ } else if (!this.prerelease.length && other.prerelease.length) {
+ return 1
+ } else if (!this.prerelease.length && !other.prerelease.length) {
+ return 0
+ }
+
+ var i = 0
+ do {
+ var a = this.prerelease[i]
+ var b = other.prerelease[i]
+ debug('prerelease compare', i, a, b)
+ if (a === undefined && b === undefined) {
+ return 0
+ } else if (b === undefined) {
+ return 1
+ } else if (a === undefined) {
+ return -1
+ } else if (a === b) {
+ continue
+ } else {
+ return compareIdentifiers(a, b)
+ }
+ } while (++i)
+}
+
+// preminor will bump the version up to the next minor release, and immediately
+// down to pre-release. premajor and prepatch work the same way.
+SemVer.prototype.inc = function (release, identifier) {
+ switch (release) {
+ case 'premajor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor = 0
+ this.major++
+ this.inc('pre', identifier)
+ break
+ case 'preminor':
+ this.prerelease.length = 0
+ this.patch = 0
+ this.minor++
+ this.inc('pre', identifier)
+ break
+ case 'prepatch':
+ // If this is already a prerelease, it will bump to the next version
+ // drop any prereleases that might already exist, since they are not
+ // relevant at this point.
+ this.prerelease.length = 0
+ this.inc('patch', identifier)
+ this.inc('pre', identifier)
+ break
+ // If the input is a non-prerelease version, this acts the same as
+ // prepatch.
+ case 'prerelease':
+ if (this.prerelease.length === 0) {
+ this.inc('patch', identifier)
+ }
+ this.inc('pre', identifier)
+ break
+
+ case 'major':
+ // If this is a pre-major version, bump up to the same major version.
+ // Otherwise increment major.
+ // 1.0.0-5 bumps to 1.0.0
+ // 1.1.0 bumps to 2.0.0
+ if (this.minor !== 0 ||
+ this.patch !== 0 ||
+ this.prerelease.length === 0) {
+ this.major++
+ }
+ this.minor = 0
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'minor':
+ // If this is a pre-minor version, bump up to the same minor version.
+ // Otherwise increment minor.
+ // 1.2.0-5 bumps to 1.2.0
+ // 1.2.1 bumps to 1.3.0
+ if (this.patch !== 0 || this.prerelease.length === 0) {
+ this.minor++
+ }
+ this.patch = 0
+ this.prerelease = []
+ break
+ case 'patch':
+ // If this is not a pre-release version, it will increment the patch.
+ // If it is a pre-release it will bump up to the same patch version.
+ // 1.2.0-5 patches to 1.2.0
+ // 1.2.0 patches to 1.2.1
+ if (this.prerelease.length === 0) {
+ this.patch++
+ }
+ this.prerelease = []
+ break
+ // This probably shouldn't be used publicly.
+ // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
+ case 'pre':
+ if (this.prerelease.length === 0) {
+ this.prerelease = [0]
+ } else {
+ var i = this.prerelease.length
+ while (--i >= 0) {
+ if (typeof this.prerelease[i] === 'number') {
+ this.prerelease[i]++
+ i = -2
+ }
+ }
+ if (i === -1) {
+ // didn't increment anything
+ this.prerelease.push(0)
+ }
+ }
+ if (identifier) {
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+ if (this.prerelease[0] === identifier) {
+ if (isNaN(this.prerelease[1])) {
+ this.prerelease = [identifier, 0]
+ }
+ } else {
+ this.prerelease = [identifier, 0]
+ }
+ }
+ break
+
+ default:
+ throw new Error('invalid increment argument: ' + release)
+ }
+ this.format()
+ this.raw = this.version
+ return this
+}
+
+exports.inc = inc
+function inc (version, release, loose, identifier) {
+ if (typeof (loose) === 'string') {
+ identifier = loose
+ loose = undefined
+ }
+
+ try {
+ return new SemVer(version, loose).inc(release, identifier).version
+ } catch (er) {
+ return null
+ }
+}
+
+exports.diff = diff
+function diff (version1, version2) {
+ if (eq(version1, version2)) {
+ return null
+ } else {
+ var v1 = parse(version1)
+ var v2 = parse(version2)
+ var prefix = ''
+ if (v1.prerelease.length || v2.prerelease.length) {
+ prefix = 'pre'
+ var defaultResult = 'prerelease'
+ }
+ for (var key in v1) {
+ if (key === 'major' || key === 'minor' || key === 'patch') {
+ if (v1[key] !== v2[key]) {
+ return prefix + key
+ }
+ }
+ }
+ return defaultResult // may be undefined
+ }
+}
+
+exports.compareIdentifiers = compareIdentifiers
+
+var numeric = /^[0-9]+$/
+function compareIdentifiers (a, b) {
+ var anum = numeric.test(a)
+ var bnum = numeric.test(b)
+
+ if (anum && bnum) {
+ a = +a
+ b = +b
+ }
+
+ return a === b ? 0
+ : (anum && !bnum) ? -1
+ : (bnum && !anum) ? 1
+ : a < b ? -1
+ : 1
+}
+
+exports.rcompareIdentifiers = rcompareIdentifiers
+function rcompareIdentifiers (a, b) {
+ return compareIdentifiers(b, a)
+}
+
+exports.major = major
+function major (a, loose) {
+ return new SemVer(a, loose).major
+}
+
+exports.minor = minor
+function minor (a, loose) {
+ return new SemVer(a, loose).minor
+}
+
+exports.patch = patch
+function patch (a, loose) {
+ return new SemVer(a, loose).patch
+}
+
+exports.compare = compare
+function compare (a, b, loose) {
+ return new SemVer(a, loose).compare(new SemVer(b, loose))
+}
+
+exports.compareLoose = compareLoose
+function compareLoose (a, b) {
+ return compare(a, b, true)
+}
+
+exports.rcompare = rcompare
+function rcompare (a, b, loose) {
+ return compare(b, a, loose)
+}
+
+exports.sort = sort
+function sort (list, loose) {
+ return list.sort(function (a, b) {
+ return exports.compare(a, b, loose)
+ })
+}
+
+exports.rsort = rsort
+function rsort (list, loose) {
+ return list.sort(function (a, b) {
+ return exports.rcompare(a, b, loose)
+ })
+}
+
+exports.gt = gt
+function gt (a, b, loose) {
+ return compare(a, b, loose) > 0
+}
+
+exports.lt = lt
+function lt (a, b, loose) {
+ return compare(a, b, loose) < 0
+}
+
+exports.eq = eq
+function eq (a, b, loose) {
+ return compare(a, b, loose) === 0
+}
+
+exports.neq = neq
+function neq (a, b, loose) {
+ return compare(a, b, loose) !== 0
+}
+
+exports.gte = gte
+function gte (a, b, loose) {
+ return compare(a, b, loose) >= 0
+}
+
+exports.lte = lte
+function lte (a, b, loose) {
+ return compare(a, b, loose) <= 0
+}
+
+exports.cmp = cmp
+function cmp (a, op, b, loose) {
+ switch (op) {
+ case '===':
+ if (typeof a === 'object')
+ a = a.version
+ if (typeof b === 'object')
+ b = b.version
+ return a === b
+
+ case '!==':
+ if (typeof a === 'object')
+ a = a.version
+ if (typeof b === 'object')
+ b = b.version
+ return a !== b
+
+ case '':
+ case '=':
+ case '==':
+ return eq(a, b, loose)
+
+ case '!=':
+ return neq(a, b, loose)
+
+ case '>':
+ return gt(a, b, loose)
+
+ case '>=':
+ return gte(a, b, loose)
+
+ case '<':
+ return lt(a, b, loose)
+
+ case '<=':
+ return lte(a, b, loose)
+
+ default:
+ throw new TypeError('Invalid operator: ' + op)
+ }
+}
+
+exports.Comparator = Comparator
+function Comparator (comp, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (comp instanceof Comparator) {
+ if (comp.loose === !!options.loose) {
+ return comp
+ } else {
+ comp = comp.value
+ }
+ }
+
+ if (!(this instanceof Comparator)) {
+ return new Comparator(comp, options)
+ }
+
+ debug('comparator', comp, options)
+ this.options = options
+ this.loose = !!options.loose
+ this.parse(comp)
+
+ if (this.semver === ANY) {
+ this.value = ''
+ } else {
+ this.value = this.operator + this.semver.version
+ }
+
+ debug('comp', this)
+}
+
+var ANY = {}
+Comparator.prototype.parse = function (comp) {
+ var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
+ var m = comp.match(r)
+
+ if (!m) {
+ throw new TypeError('Invalid comparator: ' + comp)
+ }
+
+ this.operator = m[1]
+ if (this.operator === '=') {
+ this.operator = ''
+ }
+
+ // if it literally is just '>' or '' then allow anything.
+ if (!m[2]) {
+ this.semver = ANY
+ } else {
+ this.semver = new SemVer(m[2], this.options.loose)
+ }
+}
+
+Comparator.prototype.toString = function () {
+ return this.value
+}
+
+Comparator.prototype.test = function (version) {
+ debug('Comparator.test', version, this.options.loose)
+
+ if (this.semver === ANY) {
+ return true
+ }
+
+ if (typeof version === 'string') {
+ version = new SemVer(version, this.options)
+ }
+
+ return cmp(version, this.operator, this.semver, this.options)
+}
+
+Comparator.prototype.intersects = function (comp, options) {
+ if (!(comp instanceof Comparator)) {
+ throw new TypeError('a Comparator is required')
+ }
+
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ var rangeTmp
+
+ if (this.operator === '') {
+ rangeTmp = new Range(comp.value, options)
+ return satisfies(this.value, rangeTmp, options)
+ } else if (comp.operator === '') {
+ rangeTmp = new Range(this.value, options)
+ return satisfies(comp.semver, rangeTmp, options)
+ }
+
+ var sameDirectionIncreasing =
+ (this.operator === '>=' || this.operator === '>') &&
+ (comp.operator === '>=' || comp.operator === '>')
+ var sameDirectionDecreasing =
+ (this.operator === '<=' || this.operator === '<') &&
+ (comp.operator === '<=' || comp.operator === '<')
+ var sameSemVer = this.semver.version === comp.semver.version
+ var differentDirectionsInclusive =
+ (this.operator === '>=' || this.operator === '<=') &&
+ (comp.operator === '>=' || comp.operator === '<=')
+ var oppositeDirectionsLessThan =
+ cmp(this.semver, '<', comp.semver, options) &&
+ ((this.operator === '>=' || this.operator === '>') &&
+ (comp.operator === '<=' || comp.operator === '<'))
+ var oppositeDirectionsGreaterThan =
+ cmp(this.semver, '>', comp.semver, options) &&
+ ((this.operator === '<=' || this.operator === '<') &&
+ (comp.operator === '>=' || comp.operator === '>'))
+
+ return sameDirectionIncreasing || sameDirectionDecreasing ||
+ (sameSemVer && differentDirectionsInclusive) ||
+ oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
+}
+
+exports.Range = Range
+function Range (range, options) {
+ if (!options || typeof options !== 'object') {
+ options = {
+ loose: !!options,
+ includePrerelease: false
+ }
+ }
+
+ if (range instanceof Range) {
+ if (range.loose === !!options.loose &&
+ range.includePrerelease === !!options.includePrerelease) {
+ return range
+ } else {
+ return new Range(range.raw, options)
+ }
+ }
+
+ if (range instanceof Comparator) {
+ return new Range(range.value, options)
+ }
+
+ if (!(this instanceof Range)) {
+ return new Range(range, options)
+ }
+
+ this.options = options
+ this.loose = !!options.loose
+ this.includePrerelease = !!options.includePrerelease
+
+ // First, split based on boolean or ||
+ this.raw = range
+ this.set = range.split(/\s*\|\|\s*/).map(function (range) {
+ return this.parseRange(range.trim())
+ }, this).filter(function (c) {
+ // throw out any that are not relevant for whatever reason
+ return c.length
+ })
+
+ if (!this.set.length) {
+ throw new TypeError('Invalid SemVer Range: ' + range)
+ }
+
+ this.format()
+}
+
+Range.prototype.format = function () {
+ this.range = this.set.map(function (comps) {
+ return comps.join(' ').trim()
+ }).join('||').trim()
+ return this.range
+}
+
+Range.prototype.toString = function () {
+ return this.range
+}
+
+Range.prototype.parseRange = function (range) {
+ var loose = this.options.loose
+ range = range.trim()
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+ var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
+ range = range.replace(hr, hyphenReplace)
+ debug('hyphen replace', range)
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+ range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
+ debug('comparator trim', range, re[COMPARATORTRIM])
+
+ // `~ 1.2.3` => `~1.2.3`
+ range = range.replace(re[TILDETRIM], tildeTrimReplace)
+
+ // `^ 1.2.3` => `^1.2.3`
+ range = range.replace(re[CARETTRIM], caretTrimReplace)
+
+ // normalize spaces
+ range = range.split(/\s+/).join(' ')
+
+ // At this point, the range is completely trimmed and
+ // ready to be split into comparators.
+
+ var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
+ var set = range.split(' ').map(function (comp) {
+ return parseComparator(comp, this.options)
+ }, this).join(' ').split(/\s+/)
+ if (this.options.loose) {
+ // in loose mode, throw out any that are not valid comparators
+ set = set.filter(function (comp) {
+ return !!comp.match(compRe)
+ })
+ }
+ set = set.map(function (comp) {
+ return new Comparator(comp, this.options)
+ }, this)
+
+ return set
+}
+
+Range.prototype.intersects = function (range, options) {
+ if (!(range instanceof Range)) {
+ throw new TypeError('a Range is required')
+ }
+
+ return this.set.some(function (thisComparators) {
+ return thisComparators.every(function (thisComparator) {
+ return range.set.some(function (rangeComparators) {
+ return rangeComparators.every(function (rangeComparator) {
+ return thisComparator.intersects(rangeComparator, options)
+ })
+ })
+ })
+ })
+}
+
+// Mostly just for testing and legacy API reasons
+exports.toComparators = toComparators
+function toComparators (range, options) {
+ return new Range(range, options).set.map(function (comp) {
+ return comp.map(function (c) {
+ return c.value
+ }).join(' ').trim().split(' ')
+ })
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+function parseComparator (comp, options) {
+ debug('comp', comp, options)
+ comp = replaceCarets(comp, options)
+ debug('caret', comp)
+ comp = replaceTildes(comp, options)
+ debug('tildes', comp)
+ comp = replaceXRanges(comp, options)
+ debug('xrange', comp)
+ comp = replaceStars(comp, options)
+ debug('stars', comp)
+ return comp
+}
+
+function isX (id) {
+ return !id || id.toLowerCase() === 'x' || id === '*'
+}
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
+function replaceTildes (comp, options) {
+ return comp.trim().split(/\s+/).map(function (comp) {
+ return replaceTilde(comp, options)
+ }).join(' ')
+}
+
+function replaceTilde (comp, options) {
+ var r = options.loose ? re[TILDELOOSE] : re[TILDE]
+ return comp.replace(r, function (_, M, m, p, pr) {
+ debug('tilde', comp, _, M, m, p, pr)
+ var ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (isX(p)) {
+ // ~1.2 == >=1.2.0 <1.3.0
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ } else if (pr) {
+ debug('replaceTilde pr', pr)
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ } else {
+ // ~1.2.3 == >=1.2.3 <1.3.0
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+
+ debug('tilde return', ret)
+ return ret
+ })
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
+// ^1.2.3 --> >=1.2.3 <2.0.0
+// ^1.2.0 --> >=1.2.0 <2.0.0
+function replaceCarets (comp, options) {
+ return comp.trim().split(/\s+/).map(function (comp) {
+ return replaceCaret(comp, options)
+ }).join(' ')
+}
+
+function replaceCaret (comp, options) {
+ debug('caret', comp, options)
+ var r = options.loose ? re[CARETLOOSE] : re[CARET]
+ return comp.replace(r, function (_, M, m, p, pr) {
+ debug('caret', comp, _, M, m, p, pr)
+ var ret
+
+ if (isX(M)) {
+ ret = ''
+ } else if (isX(m)) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (isX(p)) {
+ if (M === '0') {
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ } else {
+ ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
+ }
+ } else if (pr) {
+ debug('replaceCaret pr', pr)
+ if (M === '0') {
+ if (m === '0') {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + m + '.' + (+p + 1)
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+ ' <' + (+M + 1) + '.0.0'
+ }
+ } else {
+ debug('no pr')
+ if (M === '0') {
+ if (m === '0') {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + m + '.' + (+p + 1)
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0'
+ }
+ } else {
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + (+M + 1) + '.0.0'
+ }
+ }
+
+ debug('caret return', ret)
+ return ret
+ })
+}
+
+function replaceXRanges (comp, options) {
+ debug('replaceXRanges', comp, options)
+ return comp.split(/\s+/).map(function (comp) {
+ return replaceXRange(comp, options)
+ }).join(' ')
+}
+
+function replaceXRange (comp, options) {
+ comp = comp.trim()
+ var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
+ return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
+ debug('xRange', comp, ret, gtlt, M, m, p, pr)
+ var xM = isX(M)
+ var xm = xM || isX(m)
+ var xp = xm || isX(p)
+ var anyX = xp
+
+ if (gtlt === '=' && anyX) {
+ gtlt = ''
+ }
+
+ if (xM) {
+ if (gtlt === '>' || gtlt === '<') {
+ // nothing is allowed
+ ret = '<0.0.0'
+ } else {
+ // nothing is forbidden
+ ret = '*'
+ }
+ } else if (gtlt && anyX) {
+ // we know patch is an x, because we have any x at all.
+ // replace X with 0
+ if (xm) {
+ m = 0
+ }
+ p = 0
+
+ if (gtlt === '>') {
+ // >1 => >=2.0.0
+ // >1.2 => >=1.3.0
+ // >1.2.3 => >= 1.2.4
+ gtlt = '>='
+ if (xm) {
+ M = +M + 1
+ m = 0
+ p = 0
+ } else {
+ m = +m + 1
+ p = 0
+ }
+ } else if (gtlt === '<=') {
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
+ gtlt = '<'
+ if (xm) {
+ M = +M + 1
+ } else {
+ m = +m + 1
+ }
+ }
+
+ ret = gtlt + M + '.' + m + '.' + p
+ } else if (xm) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+ } else if (xp) {
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+ }
+
+ debug('xRange return', ret)
+
+ return ret
+ })
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+function replaceStars (comp, options) {
+ debug('replaceStars', comp, options)
+ // Looseness is ignored here. star is always as loose as it gets!
+ return comp.trim().replace(re[STAR], '')
+}
+
+// This function is passed to string.replace(re[HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0
+function hyphenReplace ($0,
+ from, fM, fm, fp, fpr, fb,
+ to, tM, tm, tp, tpr, tb) {
+ if (isX(fM)) {
+ from = ''
+ } else if (isX(fm)) {
+ from = '>=' + fM + '.0.0'
+ } else if (isX(fp)) {
+ from = '>=' + fM + '.' + fm + '.0'
+ } else {
+ from = '>=' + from
+ }
+
+ if (isX(tM)) {
+ to = ''
+ } else if (isX(tm)) {
+ to = '<' + (+tM + 1) + '.0.0'
+ } else if (isX(tp)) {
+ to = '<' + tM + '.' + (+tm + 1) + '.0'
+ } else if (tpr) {
+ to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
+ } else {
+ to = '<=' + to
+ }
+
+ return (from + ' ' + to).trim()
+}
+
+// if ANY of the sets match ALL of its comparators, then pass
+Range.prototype.test = function (version) {
+ if (!version) {
+ return false
+ }
+
+ if (typeof version === 'string') {
+ version = new SemVer(version, this.options)
+ }
+
+ for (var i = 0; i < this.set.length; i++) {
+ if (testSet(this.set[i], version, this.options)) {
+ return true
+ }
+ }
+ return false
+}
+
+function testSet (set, version, options) {
+ for (var i = 0; i < set.length; i++) {
+ if (!set[i].test(version)) {
+ return false
+ }
+ }
+
+ if (version.prerelease.length && !options.includePrerelease) {
+ // Find the set of versions that are allowed to have prereleases
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+ // That should allow `1.2.3-pr.2` to pass.
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
+ // even though it's within the range set by the comparators.
+ for (i = 0; i < set.length; i++) {
+ debug(set[i].semver)
+ if (set[i].semver === ANY) {
+ continue
+ }
+
+ if (set[i].semver.prerelease.length > 0) {
+ var allowed = set[i].semver
+ if (allowed.major === version.major &&
+ allowed.minor === version.minor &&
+ allowed.patch === version.patch) {
+ return true
+ }
+ }
+ }
+
+ // Version has a -pre, but it's not one of the ones we like.
+ return false
+ }
+
+ return true
+}
+
+exports.satisfies = satisfies
+function satisfies (version, range, options) {
+ try {
+ range = new Range(range, options)
+ } catch (er) {
+ return false
+ }
+ return range.test(version)
+}
+
+exports.maxSatisfying = maxSatisfying
+function maxSatisfying (versions, range, options) {
+ var max = null
+ var maxSV = null
+ try {
+ var rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach(function (v) {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!max || maxSV.compare(v) === -1) {
+ // compare(max, v, true)
+ max = v
+ maxSV = new SemVer(max, options)
+ }
+ }
+ })
+ return max
+}
+
+exports.minSatisfying = minSatisfying
+function minSatisfying (versions, range, options) {
+ var min = null
+ var minSV = null
+ try {
+ var rangeObj = new Range(range, options)
+ } catch (er) {
+ return null
+ }
+ versions.forEach(function (v) {
+ if (rangeObj.test(v)) {
+ // satisfies(v, range, options)
+ if (!min || minSV.compare(v) === 1) {
+ // compare(min, v, true)
+ min = v
+ minSV = new SemVer(min, options)
+ }
+ }
+ })
+ return min
+}
+
+exports.minVersion = minVersion
+function minVersion (range, loose) {
+ range = new Range(range, loose)
+
+ var minver = new SemVer('0.0.0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = new SemVer('0.0.0-0')
+ if (range.test(minver)) {
+ return minver
+ }
+
+ minver = null
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i]
+
+ comparators.forEach(function (comparator) {
+ // Clone to avoid manipulating the comparator's semver object.
+ var compver = new SemVer(comparator.semver.version)
+ switch (comparator.operator) {
+ case '>':
+ if (compver.prerelease.length === 0) {
+ compver.patch++
+ } else {
+ compver.prerelease.push(0)
+ }
+ compver.raw = compver.format()
+ /* fallthrough */
+ case '':
+ case '>=':
+ if (!minver || gt(minver, compver)) {
+ minver = compver
+ }
+ break
+ case '<':
+ case '<=':
+ /* Ignore maximum versions */
+ break
+ /* istanbul ignore next */
+ default:
+ throw new Error('Unexpected operation: ' + comparator.operator)
+ }
+ })
+ }
+
+ if (minver && range.test(minver)) {
+ return minver
+ }
+
+ return null
+}
+
+exports.validRange = validRange
+function validRange (range, options) {
+ try {
+ // Return '*' instead of '' so that truthiness works.
+ // This will throw if it's invalid anyway
+ return new Range(range, options).range || '*'
+ } catch (er) {
+ return null
+ }
+}
+
+// Determine if version is less than all the versions possible in the range
+exports.ltr = ltr
+function ltr (version, range, options) {
+ return outside(version, range, '<', options)
+}
+
+// Determine if version is greater than all the versions possible in the range.
+exports.gtr = gtr
+function gtr (version, range, options) {
+ return outside(version, range, '>', options)
+}
+
+exports.outside = outside
+function outside (version, range, hilo, options) {
+ version = new SemVer(version, options)
+ range = new Range(range, options)
+
+ var gtfn, ltefn, ltfn, comp, ecomp
+ switch (hilo) {
+ case '>':
+ gtfn = gt
+ ltefn = lte
+ ltfn = lt
+ comp = '>'
+ ecomp = '>='
+ break
+ case '<':
+ gtfn = lt
+ ltefn = gte
+ ltfn = gt
+ comp = '<'
+ ecomp = '<='
+ break
+ default:
+ throw new TypeError('Must provide a hilo val of "<" or ">"')
+ }
+
+ // If it satisifes the range it is not outside
+ if (satisfies(version, range, options)) {
+ return false
+ }
+
+ // From now on, variable terms are as if we're in "gtr" mode.
+ // but note that everything is flipped for the "ltr" function.
+
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i]
+
+ var high = null
+ var low = null
+
+ comparators.forEach(function (comparator) {
+ if (comparator.semver === ANY) {
+ comparator = new Comparator('>=0.0.0')
+ }
+ high = high || comparator
+ low = low || comparator
+ if (gtfn(comparator.semver, high.semver, options)) {
+ high = comparator
+ } else if (ltfn(comparator.semver, low.semver, options)) {
+ low = comparator
+ }
+ })
+
+ // If the edge version comparator has a operator then our version
+ // isn't outside it
+ if (high.operator === comp || high.operator === ecomp) {
+ return false
+ }
+
+ // If the lowest version comparator has an operator and our version
+ // is less than it then it isn't higher than the range
+ if ((!low.operator || low.operator === comp) &&
+ ltefn(version, low.semver)) {
+ return false
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+ return false
+ }
+ }
+ return true
+}
+
+exports.prerelease = prerelease
+function prerelease (version, options) {
+ var parsed = parse(version, options)
+ return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
+}
+
+exports.intersects = intersects
+function intersects (r1, r2, options) {
+ r1 = new Range(r1, options)
+ r2 = new Range(r2, options)
+ return r1.intersects(r2)
+}
+
+exports.coerce = coerce
+function coerce (version) {
+ if (version instanceof SemVer) {
+ return version
+ }
+
+ if (typeof version !== 'string') {
+ return null
+ }
+
+ var match = version.match(re[COERCE])
+
+ if (match == null) {
+ return null
+ }
+
+ return parse(match[1] +
+ '.' + (match[2] || '0') +
+ '.' + (match[3] || '0'))
+}
+
+}).call(this)}).call(this,require('_process'))
+},{"_process":386}],36:[function(require,module,exports){
+module.exports={
+ "_args": [
+ [
+ "@babel/core@7.3.4",
+ "/Users/lang/Develop/echarts-next"
+ ]
+ ],
+ "_development": true,
+ "_from": "@babel/core@7.3.4",
+ "_id": "@babel/core@7.3.4",
+ "_inBundle": false,
+ "_integrity": "sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA==",
+ "_location": "/@babel/core",
+ "_phantomChildren": {
+ "@babel/code-frame": "7.5.5",
+ "esutils": "2.0.3",
+ "lodash": "4.17.15",
+ "to-fast-properties": "2.0.0"
+ },
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "@babel/core@7.3.4",
+ "name": "@babel/core",
+ "escapedName": "@babel%2fcore",
+ "scope": "@babel",
+ "rawSpec": "7.3.4",
+ "saveSpec": null,
+ "fetchSpec": "7.3.4"
+ },
+ "_requiredBy": [
+ "#DEV:/",
+ "/@jest/transform",
+ "/jest-config"
+ ],
+ "_resolved": "https://registry.npmjs.org/@babel/core/-/core-7.3.4.tgz",
+ "_spec": "7.3.4",
+ "_where": "/Users/lang/Develop/echarts-next",
+ "author": {
+ "name": "Sebastian McKenzie",
+ "email": "sebmck@gmail.com"
+ },
+ "browser": {
+ "./lib/config/files/index.js": "./lib/config/files/index-browser.js",
+ "./lib/transform-file.js": "./lib/transform-file-browser.js"
+ },
+ "dependencies": {
+ "@babel/code-frame": "^7.0.0",
+ "@babel/generator": "^7.3.4",
+ "@babel/helpers": "^7.2.0",
+ "@babel/parser": "^7.3.4",
+ "@babel/template": "^7.2.2",
+ "@babel/traverse": "^7.3.4",
+ "@babel/types": "^7.3.4",
+ "convert-source-map": "^1.1.0",
+ "debug": "^4.1.0",
+ "json5": "^2.1.0",
+ "lodash": "^4.17.11",
+ "resolve": "^1.3.2",
+ "semver": "^5.4.1",
+ "source-map": "^0.5.0"
+ },
+ "description": "Babel compiler core.",
+ "devDependencies": {
+ "@babel/helper-transform-fixture-test-runner": "^7.0.0",
+ "@babel/register": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "gitHead": "1f6454cc90fe33e0a32260871212e2f719f35741",
+ "homepage": "https://babeljs.io/",
+ "keywords": [
+ "6to5",
+ "babel",
+ "classes",
+ "const",
+ "es6",
+ "harmony",
+ "let",
+ "modules",
+ "transpile",
+ "transpiler",
+ "var",
+ "babel-core",
+ "compiler"
+ ],
+ "license": "MIT",
+ "main": "lib/index.js",
+ "name": "@babel/core",
+ "publishConfig": {
+ "access": "public"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/babel/babel/tree/master/packages/babel-core"
+ },
+ "version": "7.3.4"
+}
+
+},{}],37:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+const SPACES_RE = /^[ \t]+$/;
+
+class Buffer {
+ constructor(map) {
+ this._map = null;
+ this._buf = [];
+ this._last = "";
+ this._queue = [];
+ this._position = {
+ line: 1,
+ column: 0
+ };
+ this._sourcePosition = {
+ identifierName: null,
+ line: null,
+ column: null,
+ filename: null
+ };
+ this._disallowedPop = null;
+ this._map = map;
+ }
+
+ get() {
+ this._flush();
+
+ const map = this._map;
+ const result = {
+ code: this._buf.join("").trimRight(),
+ map: null,
+ rawMappings: map == null ? void 0 : map.getRawMappings()
+ };
+
+ if (map) {
+ Object.defineProperty(result, "map", {
+ configurable: true,
+ enumerable: true,
+
+ get() {
+ return this.map = map.get();
+ },
+
+ set(value) {
+ Object.defineProperty(this, "map", {
+ value,
+ writable: true
+ });
+ }
+
+ });
+ }
+
+ return result;
+ }
+
+ append(str) {
+ this._flush();
+
+ const {
+ line,
+ column,
+ filename,
+ identifierName,
+ force
+ } = this._sourcePosition;
+
+ this._append(str, line, column, identifierName, filename, force);
+ }
+
+ queue(str) {
+ if (str === "\n") {
+ while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
+ this._queue.shift();
+ }
+ }
+
+ const {
+ line,
+ column,
+ filename,
+ identifierName,
+ force
+ } = this._sourcePosition;
+
+ this._queue.unshift([str, line, column, identifierName, filename, force]);
+ }
+
+ _flush() {
+ let item;
+
+ while (item = this._queue.pop()) this._append(...item);
+ }
+
+ _append(str, line, column, identifierName, filename, force) {
+ if (this._map && str[0] !== "\n") {
+ this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename, force);
+ }
+
+ this._buf.push(str);
+
+ this._last = str[str.length - 1];
+
+ for (let i = 0; i < str.length; i++) {
+ if (str[i] === "\n") {
+ this._position.line++;
+ this._position.column = 0;
+ } else {
+ this._position.column++;
+ }
+ }
+ }
+
+ removeTrailingNewline() {
+ if (this._queue.length > 0 && this._queue[0][0] === "\n") {
+ this._queue.shift();
+ }
+ }
+
+ removeLastSemicolon() {
+ if (this._queue.length > 0 && this._queue[0][0] === ";") {
+ this._queue.shift();
+ }
+ }
+
+ endsWith(suffix) {
+ if (suffix.length === 1) {
+ let last;
+
+ if (this._queue.length > 0) {
+ const str = this._queue[0][0];
+ last = str[str.length - 1];
+ } else {
+ last = this._last;
+ }
+
+ return last === suffix;
+ }
+
+ const end = this._last + this._queue.reduce((acc, item) => item[0] + acc, "");
+
+ if (suffix.length <= end.length) {
+ return end.slice(-suffix.length) === suffix;
+ }
+
+ return false;
+ }
+
+ hasContent() {
+ return this._queue.length > 0 || !!this._last;
+ }
+
+ exactSource(loc, cb) {
+ this.source("start", loc, true);
+ cb();
+ this.source("end", loc);
+
+ this._disallowPop("start", loc);
+ }
+
+ source(prop, loc, force) {
+ if (prop && !loc) return;
+
+ this._normalizePosition(prop, loc, this._sourcePosition, force);
+ }
+
+ withSource(prop, loc, cb) {
+ if (!this._map) return cb();
+ const originalLine = this._sourcePosition.line;
+ const originalColumn = this._sourcePosition.column;
+ const originalFilename = this._sourcePosition.filename;
+ const originalIdentifierName = this._sourcePosition.identifierName;
+ this.source(prop, loc);
+ cb();
+
+ if ((!this._sourcePosition.force || this._sourcePosition.line !== originalLine || this._sourcePosition.column !== originalColumn || this._sourcePosition.filename !== originalFilename) && (!this._disallowedPop || this._disallowedPop.line !== originalLine || this._disallowedPop.column !== originalColumn || this._disallowedPop.filename !== originalFilename)) {
+ this._sourcePosition.line = originalLine;
+ this._sourcePosition.column = originalColumn;
+ this._sourcePosition.filename = originalFilename;
+ this._sourcePosition.identifierName = originalIdentifierName;
+ this._sourcePosition.force = false;
+ this._disallowedPop = null;
+ }
+ }
+
+ _disallowPop(prop, loc) {
+ if (prop && !loc) return;
+ this._disallowedPop = this._normalizePosition(prop, loc);
+ }
+
+ _normalizePosition(prop, loc, targetObj, force) {
+ const pos = loc ? loc[prop] : null;
+
+ if (targetObj === undefined) {
+ targetObj = {
+ identifierName: null,
+ line: null,
+ column: null,
+ filename: null,
+ force: false
+ };
+ }
+
+ const origLine = targetObj.line;
+ const origColumn = targetObj.column;
+ const origFilename = targetObj.filename;
+ targetObj.identifierName = prop === "start" && (loc == null ? void 0 : loc.identifierName) || null;
+ targetObj.line = pos == null ? void 0 : pos.line;
+ targetObj.column = pos == null ? void 0 : pos.column;
+ targetObj.filename = loc == null ? void 0 : loc.filename;
+
+ if (force || targetObj.line !== origLine || targetObj.column !== origColumn || targetObj.filename !== origFilename) {
+ targetObj.force = force;
+ }
+
+ return targetObj;
+ }
+
+ getCurrentColumn() {
+ const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
+
+ const lastIndex = extra.lastIndexOf("\n");
+ return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
+ }
+
+ getCurrentLine() {
+ const extra = this._queue.reduce((acc, item) => item[0] + acc, "");
+
+ let count = 0;
+
+ for (let i = 0; i < extra.length; i++) {
+ if (extra[i] === "\n") count++;
+ }
+
+ return this._position.line + count;
+ }
+
+}
+
+exports.default = Buffer;
+},{}],38:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.File = File;
+exports.Program = Program;
+exports.BlockStatement = BlockStatement;
+exports.Noop = Noop;
+exports.Directive = Directive;
+exports.DirectiveLiteral = DirectiveLiteral;
+exports.InterpreterDirective = InterpreterDirective;
+exports.Placeholder = Placeholder;
+
+function File(node) {
+ if (node.program) {
+ this.print(node.program.interpreter, node);
+ }
+
+ this.print(node.program, node);
+}
+
+function Program(node) {
+ this.printInnerComments(node, false);
+ this.printSequence(node.directives, node);
+ if (node.directives && node.directives.length) this.newline();
+ this.printSequence(node.body, node);
+}
+
+function BlockStatement(node) {
+ var _node$directives;
+
+ this.token("{");
+ this.printInnerComments(node);
+ const hasDirectives = (_node$directives = node.directives) == null ? void 0 : _node$directives.length;
+
+ if (node.body.length || hasDirectives) {
+ this.newline();
+ this.printSequence(node.directives, node, {
+ indent: true
+ });
+ if (hasDirectives) this.newline();
+ this.printSequence(node.body, node, {
+ indent: true
+ });
+ this.removeTrailingNewline();
+ this.source("end", node.loc);
+ if (!this.endsWith("\n")) this.newline();
+ this.rightBrace();
+ } else {
+ this.source("end", node.loc);
+ this.token("}");
+ }
+}
+
+function Noop() {}
+
+function Directive(node) {
+ this.print(node.value, node);
+ this.semicolon();
+}
+
+const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
+const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
+
+function DirectiveLiteral(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (raw != null) {
+ this.token(raw);
+ return;
+ }
+
+ const {
+ value
+ } = node;
+
+ if (!unescapedDoubleQuoteRE.test(value)) {
+ this.token(`"${value}"`);
+ } else if (!unescapedSingleQuoteRE.test(value)) {
+ this.token(`'${value}'`);
+ } else {
+ throw new Error("Malformed AST: it is not possible to print a directive containing" + " both unescaped single and double quotes.");
+ }
+}
+
+function InterpreterDirective(node) {
+ this.token(`#!${node.value}\n`);
+}
+
+function Placeholder(node) {
+ this.token("%%");
+ this.print(node.name);
+ this.token("%%");
+
+ if (node.expectedNode === "Statement") {
+ this.semicolon();
+ }
+}
+},{}],39:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ClassExpression = exports.ClassDeclaration = ClassDeclaration;
+exports.ClassBody = ClassBody;
+exports.ClassProperty = ClassProperty;
+exports.ClassPrivateProperty = ClassPrivateProperty;
+exports.ClassMethod = ClassMethod;
+exports.ClassPrivateMethod = ClassPrivateMethod;
+exports._classMethodHead = _classMethodHead;
+
+var t = _interopRequireWildcard(require("@babel/types"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescript [...]
+
+function ClassDeclaration(node, parent) {
+ if (!this.format.decoratorsBeforeExport || !t.isExportDefaultDeclaration(parent) && !t.isExportNamedDeclaration(parent)) {
+ this.printJoin(node.decorators, node);
+ }
+
+ if (node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ if (node.abstract) {
+ this.word("abstract");
+ this.space();
+ }
+
+ this.word("class");
+
+ if (node.id) {
+ this.space();
+ this.print(node.id, node);
+ }
+
+ this.print(node.typeParameters, node);
+
+ if (node.superClass) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.print(node.superClass, node);
+ this.print(node.superTypeParameters, node);
+ }
+
+ if (node.implements) {
+ this.space();
+ this.word("implements");
+ this.space();
+ this.printList(node.implements, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function ClassBody(node) {
+ this.token("{");
+ this.printInnerComments(node);
+
+ if (node.body.length === 0) {
+ this.token("}");
+ } else {
+ this.newline();
+ this.indent();
+ this.printSequence(node.body, node);
+ this.dedent();
+ if (!this.endsWith("\n")) this.newline();
+ this.rightBrace();
+ }
+}
+
+function ClassProperty(node) {
+ this.printJoin(node.decorators, node);
+ this.tsPrintClassMemberModifiers(node, true);
+
+ if (node.computed) {
+ this.token("[");
+ this.print(node.key, node);
+ this.token("]");
+ } else {
+ this._variance(node);
+
+ this.print(node.key, node);
+ }
+
+ if (node.optional) {
+ this.token("?");
+ }
+
+ if (node.definite) {
+ this.token("!");
+ }
+
+ this.print(node.typeAnnotation, node);
+
+ if (node.value) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.value, node);
+ }
+
+ this.semicolon();
+}
+
+function ClassPrivateProperty(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.print(node.key, node);
+ this.print(node.typeAnnotation, node);
+
+ if (node.value) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.value, node);
+ }
+
+ this.semicolon();
+}
+
+function ClassMethod(node) {
+ this._classMethodHead(node);
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function ClassPrivateMethod(node) {
+ this._classMethodHead(node);
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function _classMethodHead(node) {
+ this.printJoin(node.decorators, node);
+ this.tsPrintClassMemberModifiers(node, false);
+
+ this._methodHead(node);
+}
+},{"@babel/types":143}],40:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.UnaryExpression = UnaryExpression;
+exports.DoExpression = DoExpression;
+exports.ParenthesizedExpression = ParenthesizedExpression;
+exports.UpdateExpression = UpdateExpression;
+exports.ConditionalExpression = ConditionalExpression;
+exports.NewExpression = NewExpression;
+exports.SequenceExpression = SequenceExpression;
+exports.ThisExpression = ThisExpression;
+exports.Super = Super;
+exports.Decorator = Decorator;
+exports.OptionalMemberExpression = OptionalMemberExpression;
+exports.OptionalCallExpression = OptionalCallExpression;
+exports.CallExpression = CallExpression;
+exports.Import = Import;
+exports.EmptyStatement = EmptyStatement;
+exports.ExpressionStatement = ExpressionStatement;
+exports.AssignmentPattern = AssignmentPattern;
+exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression;
+exports.BindExpression = BindExpression;
+exports.MemberExpression = MemberExpression;
+exports.MetaProperty = MetaProperty;
+exports.PrivateName = PrivateName;
+exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
+exports.AwaitExpression = exports.YieldExpression = void 0;
+
+var t = _interopRequireWildcard(require("@babel/types"));
+
+var n = _interopRequireWildcard(require("../node"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescript [...]
+
+function UnaryExpression(node) {
+ if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof" || node.operator === "throw") {
+ this.word(node.operator);
+ this.space();
+ } else {
+ this.token(node.operator);
+ }
+
+ this.print(node.argument, node);
+}
+
+function DoExpression(node) {
+ this.word("do");
+ this.space();
+ this.print(node.body, node);
+}
+
+function ParenthesizedExpression(node) {
+ this.token("(");
+ this.print(node.expression, node);
+ this.token(")");
+}
+
+function UpdateExpression(node) {
+ if (node.prefix) {
+ this.token(node.operator);
+ this.print(node.argument, node);
+ } else {
+ this.startTerminatorless(true);
+ this.print(node.argument, node);
+ this.endTerminatorless();
+ this.token(node.operator);
+ }
+}
+
+function ConditionalExpression(node) {
+ this.print(node.test, node);
+ this.space();
+ this.token("?");
+ this.space();
+ this.print(node.consequent, node);
+ this.space();
+ this.token(":");
+ this.space();
+ this.print(node.alternate, node);
+}
+
+function NewExpression(node, parent) {
+ this.word("new");
+ this.space();
+ this.print(node.callee, node);
+
+ if (this.format.minified && node.arguments.length === 0 && !node.optional && !t.isCallExpression(parent, {
+ callee: node
+ }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) {
+ return;
+ }
+
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+}
+
+function SequenceExpression(node) {
+ this.printList(node.expressions, node);
+}
+
+function ThisExpression() {
+ this.word("this");
+}
+
+function Super() {
+ this.word("super");
+}
+
+function Decorator(node) {
+ this.token("@");
+ this.print(node.expression, node);
+ this.newline();
+}
+
+function OptionalMemberExpression(node) {
+ this.print(node.object, node);
+
+ if (!node.computed && t.isMemberExpression(node.property)) {
+ throw new TypeError("Got a MemberExpression for MemberExpression property");
+ }
+
+ let computed = node.computed;
+
+ if (t.isLiteral(node.property) && typeof node.property.value === "number") {
+ computed = true;
+ }
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ if (computed) {
+ this.token("[");
+ this.print(node.property, node);
+ this.token("]");
+ } else {
+ if (!node.optional) {
+ this.token(".");
+ }
+
+ this.print(node.property, node);
+ }
+}
+
+function OptionalCallExpression(node) {
+ this.print(node.callee, node);
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+
+ if (node.optional) {
+ this.token("?.");
+ }
+
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+}
+
+function CallExpression(node) {
+ this.print(node.callee, node);
+ this.print(node.typeArguments, node);
+ this.print(node.typeParameters, node);
+ this.token("(");
+ this.printList(node.arguments, node);
+ this.token(")");
+}
+
+function Import() {
+ this.word("import");
+}
+
+function buildYieldAwait(keyword) {
+ return function (node) {
+ this.word(keyword);
+
+ if (node.delegate) {
+ this.token("*");
+ }
+
+ if (node.argument) {
+ this.space();
+ const terminatorState = this.startTerminatorless();
+ this.print(node.argument, node);
+ this.endTerminatorless(terminatorState);
+ }
+ };
+}
+
+const YieldExpression = buildYieldAwait("yield");
+exports.YieldExpression = YieldExpression;
+const AwaitExpression = buildYieldAwait("await");
+exports.AwaitExpression = AwaitExpression;
+
+function EmptyStatement() {
+ this.semicolon(true);
+}
+
+function ExpressionStatement(node) {
+ this.print(node.expression, node);
+ this.semicolon();
+}
+
+function AssignmentPattern(node) {
+ this.print(node.left, node);
+ if (node.left.optional) this.token("?");
+ this.print(node.left.typeAnnotation, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.right, node);
+}
+
+function AssignmentExpression(node, parent) {
+ const parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent);
+
+ if (parens) {
+ this.token("(");
+ }
+
+ this.print(node.left, node);
+ this.space();
+
+ if (node.operator === "in" || node.operator === "instanceof") {
+ this.word(node.operator);
+ } else {
+ this.token(node.operator);
+ }
+
+ this.space();
+ this.print(node.right, node);
+
+ if (parens) {
+ this.token(")");
+ }
+}
+
+function BindExpression(node) {
+ this.print(node.object, node);
+ this.token("::");
+ this.print(node.callee, node);
+}
+
+function MemberExpression(node) {
+ this.print(node.object, node);
+
+ if (!node.computed && t.isMemberExpression(node.property)) {
+ throw new TypeError("Got a MemberExpression for MemberExpression property");
+ }
+
+ let computed = node.computed;
+
+ if (t.isLiteral(node.property) && typeof node.property.value === "number") {
+ computed = true;
+ }
+
+ if (computed) {
+ this.token("[");
+ this.print(node.property, node);
+ this.token("]");
+ } else {
+ this.token(".");
+ this.print(node.property, node);
+ }
+}
+
+function MetaProperty(node) {
+ this.print(node.meta, node);
+ this.token(".");
+ this.print(node.property, node);
+}
+
+function PrivateName(node) {
+ this.token("#");
+ this.print(node.id, node);
+}
+
+function V8IntrinsicIdentifier(node) {
+ this.token("%");
+ this.word(node.name);
+}
+},{"../node":51,"@babel/types":143}],41:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.AnyTypeAnnotation = AnyTypeAnnotation;
+exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
+exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
+exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
+exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
+exports.DeclareClass = DeclareClass;
+exports.DeclareFunction = DeclareFunction;
+exports.InferredPredicate = InferredPredicate;
+exports.DeclaredPredicate = DeclaredPredicate;
+exports.DeclareInterface = DeclareInterface;
+exports.DeclareModule = DeclareModule;
+exports.DeclareModuleExports = DeclareModuleExports;
+exports.DeclareTypeAlias = DeclareTypeAlias;
+exports.DeclareOpaqueType = DeclareOpaqueType;
+exports.DeclareVariable = DeclareVariable;
+exports.DeclareExportDeclaration = DeclareExportDeclaration;
+exports.DeclareExportAllDeclaration = DeclareExportAllDeclaration;
+exports.EnumDeclaration = EnumDeclaration;
+exports.EnumBooleanBody = EnumBooleanBody;
+exports.EnumNumberBody = EnumNumberBody;
+exports.EnumStringBody = EnumStringBody;
+exports.EnumSymbolBody = EnumSymbolBody;
+exports.EnumDefaultedMember = EnumDefaultedMember;
+exports.EnumBooleanMember = EnumBooleanMember;
+exports.EnumNumberMember = EnumNumberMember;
+exports.EnumStringMember = EnumStringMember;
+exports.ExistsTypeAnnotation = ExistsTypeAnnotation;
+exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
+exports.FunctionTypeParam = FunctionTypeParam;
+exports.GenericTypeAnnotation = exports.ClassImplements = exports.InterfaceExtends = InterfaceExtends;
+exports._interfaceish = _interfaceish;
+exports._variance = _variance;
+exports.InterfaceDeclaration = InterfaceDeclaration;
+exports.InterfaceTypeAnnotation = InterfaceTypeAnnotation;
+exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
+exports.MixedTypeAnnotation = MixedTypeAnnotation;
+exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
+exports.NullableTypeAnnotation = NullableTypeAnnotation;
+exports.NumberTypeAnnotation = NumberTypeAnnotation;
+exports.StringTypeAnnotation = StringTypeAnnotation;
+exports.ThisTypeAnnotation = ThisTypeAnnotation;
+exports.TupleTypeAnnotation = TupleTypeAnnotation;
+exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
+exports.TypeAlias = TypeAlias;
+exports.TypeAnnotation = TypeAnnotation;
+exports.TypeParameterDeclaration = exports.TypeParameterInstantiation = TypeParameterInstantiation;
+exports.TypeParameter = TypeParameter;
+exports.OpaqueType = OpaqueType;
+exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
+exports.ObjectTypeInternalSlot = ObjectTypeInternalSlot;
+exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
+exports.ObjectTypeIndexer = ObjectTypeIndexer;
+exports.ObjectTypeProperty = ObjectTypeProperty;
+exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
+exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
+exports.SymbolTypeAnnotation = SymbolTypeAnnotation;
+exports.UnionTypeAnnotation = UnionTypeAnnotation;
+exports.TypeCastExpression = TypeCastExpression;
+exports.Variance = Variance;
+exports.VoidTypeAnnotation = VoidTypeAnnotation;
+Object.defineProperty(exports, "NumberLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _types2.NumericLiteral;
+ }
+});
+Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
+ enumerable: true,
+ get: function () {
+ return _types2.StringLiteral;
+ }
+});
+
+var t = _interopRequireWildcard(require("@babel/types"));
+
+var _modules = require("./modules");
+
+var _types2 = require("./types");
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescript [...]
+
+function AnyTypeAnnotation() {
+ this.word("any");
+}
+
+function ArrayTypeAnnotation(node) {
+ this.print(node.elementType, node);
+ this.token("[");
+ this.token("]");
+}
+
+function BooleanTypeAnnotation() {
+ this.word("boolean");
+}
+
+function BooleanLiteralTypeAnnotation(node) {
+ this.word(node.value ? "true" : "false");
+}
+
+function NullLiteralTypeAnnotation() {
+ this.word("null");
+}
+
+function DeclareClass(node, parent) {
+ if (!t.isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("class");
+ this.space();
+
+ this._interfaceish(node);
+}
+
+function DeclareFunction(node, parent) {
+ if (!t.isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("function");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.id.typeAnnotation.typeAnnotation, node);
+
+ if (node.predicate) {
+ this.space();
+ this.print(node.predicate, node);
+ }
+
+ this.semicolon();
+}
+
+function InferredPredicate() {
+ this.token("%");
+ this.word("checks");
+}
+
+function DeclaredPredicate(node) {
+ this.token("%");
+ this.word("checks");
+ this.token("(");
+ this.print(node.value, node);
+ this.token(")");
+}
+
+function DeclareInterface(node) {
+ this.word("declare");
+ this.space();
+ this.InterfaceDeclaration(node);
+}
+
+function DeclareModule(node) {
+ this.word("declare");
+ this.space();
+ this.word("module");
+ this.space();
+ this.print(node.id, node);
+ this.space();
+ this.print(node.body, node);
+}
+
+function DeclareModuleExports(node) {
+ this.word("declare");
+ this.space();
+ this.word("module");
+ this.token(".");
+ this.word("exports");
+ this.print(node.typeAnnotation, node);
+}
+
+function DeclareTypeAlias(node) {
+ this.word("declare");
+ this.space();
+ this.TypeAlias(node);
+}
+
+function DeclareOpaqueType(node, parent) {
+ if (!t.isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.OpaqueType(node);
+}
+
+function DeclareVariable(node, parent) {
+ if (!t.isDeclareExportDeclaration(parent)) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word("var");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.id.typeAnnotation, node);
+ this.semicolon();
+}
+
+function DeclareExportDeclaration(node) {
+ this.word("declare");
+ this.space();
+ this.word("export");
+ this.space();
+
+ if (node.default) {
+ this.word("default");
+ this.space();
+ }
+
+ FlowExportDeclaration.apply(this, arguments);
+}
+
+function DeclareExportAllDeclaration() {
+ this.word("declare");
+ this.space();
+
+ _modules.ExportAllDeclaration.apply(this, arguments);
+}
+
+function EnumDeclaration(node) {
+ const {
+ id,
+ body
+ } = node;
+ this.word("enum");
+ this.space();
+ this.print(id, node);
+ this.print(body, node);
+}
+
+function enumExplicitType(context, name, hasExplicitType) {
+ if (hasExplicitType) {
+ context.space();
+ context.word("of");
+ context.space();
+ context.word(name);
+ }
+
+ context.space();
+}
+
+function enumBody(context, node) {
+ const {
+ members
+ } = node;
+ context.token("{");
+ context.indent();
+ context.newline();
+
+ for (const member of members) {
+ context.print(member, node);
+ context.newline();
+ }
+
+ context.dedent();
+ context.token("}");
+}
+
+function EnumBooleanBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "boolean", explicitType);
+ enumBody(this, node);
+}
+
+function EnumNumberBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "number", explicitType);
+ enumBody(this, node);
+}
+
+function EnumStringBody(node) {
+ const {
+ explicitType
+ } = node;
+ enumExplicitType(this, "string", explicitType);
+ enumBody(this, node);
+}
+
+function EnumSymbolBody(node) {
+ enumExplicitType(this, "symbol", true);
+ enumBody(this, node);
+}
+
+function EnumDefaultedMember(node) {
+ const {
+ id
+ } = node;
+ this.print(id, node);
+ this.token(",");
+}
+
+function enumInitializedMember(context, node) {
+ const {
+ id,
+ init
+ } = node;
+ context.print(id, node);
+ context.space();
+ context.token("=");
+ context.space();
+ context.print(init, node);
+ context.token(",");
+}
+
+function EnumBooleanMember(node) {
+ enumInitializedMember(this, node);
+}
+
+function EnumNumberMember(node) {
+ enumInitializedMember(this, node);
+}
+
+function EnumStringMember(node) {
+ enumInitializedMember(this, node);
+}
+
+function FlowExportDeclaration(node) {
+ if (node.declaration) {
+ const declar = node.declaration;
+ this.print(declar, node);
+ if (!t.isStatement(declar)) this.semicolon();
+ } else {
+ this.token("{");
+
+ if (node.specifiers.length) {
+ this.space();
+ this.printList(node.specifiers, node);
+ this.space();
+ }
+
+ this.token("}");
+
+ if (node.source) {
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ }
+
+ this.semicolon();
+ }
+}
+
+function ExistsTypeAnnotation() {
+ this.token("*");
+}
+
+function FunctionTypeAnnotation(node, parent) {
+ this.print(node.typeParameters, node);
+ this.token("(");
+ this.printList(node.params, node);
+
+ if (node.rest) {
+ if (node.params.length) {
+ this.token(",");
+ this.space();
+ }
+
+ this.token("...");
+ this.print(node.rest, node);
+ }
+
+ this.token(")");
+
+ if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction" || parent.type === "ObjectTypeProperty" && parent.method) {
+ this.token(":");
+ } else {
+ this.space();
+ this.token("=>");
+ }
+
+ this.space();
+ this.print(node.returnType, node);
+}
+
+function FunctionTypeParam(node) {
+ this.print(node.name, node);
+ if (node.optional) this.token("?");
+
+ if (node.name) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.typeAnnotation, node);
+}
+
+function InterfaceExtends(node) {
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+}
+
+function _interfaceish(node) {
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+
+ if (node.extends.length) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.printList(node.extends, node);
+ }
+
+ if (node.mixins && node.mixins.length) {
+ this.space();
+ this.word("mixins");
+ this.space();
+ this.printList(node.mixins, node);
+ }
+
+ if (node.implements && node.implements.length) {
+ this.space();
+ this.word("implements");
+ this.space();
+ this.printList(node.implements, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function _variance(node) {
+ if (node.variance) {
+ if (node.variance.kind === "plus") {
+ this.token("+");
+ } else if (node.variance.kind === "minus") {
+ this.token("-");
+ }
+ }
+}
+
+function InterfaceDeclaration(node) {
+ this.word("interface");
+ this.space();
+
+ this._interfaceish(node);
+}
+
+function andSeparator() {
+ this.space();
+ this.token("&");
+ this.space();
+}
+
+function InterfaceTypeAnnotation(node) {
+ this.word("interface");
+
+ if (node.extends && node.extends.length) {
+ this.space();
+ this.word("extends");
+ this.space();
+ this.printList(node.extends, node);
+ }
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function IntersectionTypeAnnotation(node) {
+ this.printJoin(node.types, node, {
+ separator: andSeparator
+ });
+}
+
+function MixedTypeAnnotation() {
+ this.word("mixed");
+}
+
+function EmptyTypeAnnotation() {
+ this.word("empty");
+}
+
+function NullableTypeAnnotation(node) {
+ this.token("?");
+ this.print(node.typeAnnotation, node);
+}
+
+function NumberTypeAnnotation() {
+ this.word("number");
+}
+
+function StringTypeAnnotation() {
+ this.word("string");
+}
+
+function ThisTypeAnnotation() {
+ this.word("this");
+}
+
+function TupleTypeAnnotation(node) {
+ this.token("[");
+ this.printList(node.types, node);
+ this.token("]");
+}
+
+function TypeofTypeAnnotation(node) {
+ this.word("typeof");
+ this.space();
+ this.print(node.argument, node);
+}
+
+function TypeAlias(node) {
+ this.word("type");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.right, node);
+ this.semicolon();
+}
+
+function TypeAnnotation(node) {
+ this.token(":");
+ this.space();
+ if (node.optional) this.token("?");
+ this.print(node.typeAnnotation, node);
+}
+
+function TypeParameterInstantiation(node) {
+ this.token("<");
+ this.printList(node.params, node, {});
+ this.token(">");
+}
+
+function TypeParameter(node) {
+ this._variance(node);
+
+ this.word(node.name);
+
+ if (node.bound) {
+ this.print(node.bound, node);
+ }
+
+ if (node.default) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.default, node);
+ }
+}
+
+function OpaqueType(node) {
+ this.word("opaque");
+ this.space();
+ this.word("type");
+ this.space();
+ this.print(node.id, node);
+ this.print(node.typeParameters, node);
+
+ if (node.supertype) {
+ this.token(":");
+ this.space();
+ this.print(node.supertype, node);
+ }
+
+ if (node.impltype) {
+ this.space();
+ this.token("=");
+ this.space();
+ this.print(node.impltype, node);
+ }
+
+ this.semicolon();
+}
+
+function ObjectTypeAnnotation(node) {
+ if (node.exact) {
+ this.token("{|");
+ } else {
+ this.token("{");
+ }
+
+ const props = node.properties.concat(node.callProperties || [], node.indexers || [], node.internalSlots || []);
+
+ if (props.length) {
+ this.space();
+ this.printJoin(props, node, {
+ addNewlines(leading) {
+ if (leading && !props[0]) return 1;
+ },
+
+ indent: true,
+ statement: true,
+ iterator: () => {
+ if (props.length !== 1 || node.inexact) {
+ this.token(",");
+ this.space();
+ }
+ }
+ });
+ this.space();
+ }
+
+ if (node.inexact) {
+ this.indent();
+ this.token("...");
+
+ if (props.length) {
+ this.newline();
+ }
+
+ this.dedent();
+ }
+
+ if (node.exact) {
+ this.token("|}");
+ } else {
+ this.token("}");
+ }
+}
+
+function ObjectTypeInternalSlot(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.token("[");
+ this.token("[");
+ this.print(node.id, node);
+ this.token("]");
+ this.token("]");
+ if (node.optional) this.token("?");
+
+ if (!node.method) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.value, node);
+}
+
+function ObjectTypeCallProperty(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this.print(node.value, node);
+}
+
+function ObjectTypeIndexer(node) {
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ this._variance(node);
+
+ this.token("[");
+
+ if (node.id) {
+ this.print(node.id, node);
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.key, node);
+ this.token("]");
+ this.token(":");
+ this.space();
+ this.print(node.value, node);
+}
+
+function ObjectTypeProperty(node) {
+ if (node.proto) {
+ this.word("proto");
+ this.space();
+ }
+
+ if (node.static) {
+ this.word("static");
+ this.space();
+ }
+
+ if (node.kind === "get" || node.kind === "set") {
+ this.word(node.kind);
+ this.space();
+ }
+
+ this._variance(node);
+
+ this.print(node.key, node);
+ if (node.optional) this.token("?");
+
+ if (!node.method) {
+ this.token(":");
+ this.space();
+ }
+
+ this.print(node.value, node);
+}
+
+function ObjectTypeSpreadProperty(node) {
+ this.token("...");
+ this.print(node.argument, node);
+}
+
+function QualifiedTypeIdentifier(node) {
+ this.print(node.qualification, node);
+ this.token(".");
+ this.print(node.id, node);
+}
+
+function SymbolTypeAnnotation() {
+ this.word("symbol");
+}
+
+function orSeparator() {
+ this.space();
+ this.token("|");
+ this.space();
+}
+
+function UnionTypeAnnotation(node) {
+ this.printJoin(node.types, node, {
+ separator: orSeparator
+ });
+}
+
+function TypeCastExpression(node) {
+ this.token("(");
+ this.print(node.expression, node);
+ this.print(node.typeAnnotation, node);
+ this.token(")");
+}
+
+function Variance(node) {
+ if (node.kind === "plus") {
+ this.token("+");
+ } else {
+ this.token("-");
+ }
+}
+
+function VoidTypeAnnotation() {
+ this.word("void");
+}
+},{"./modules":45,"./types":48,"@babel/types":143}],42:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _templateLiterals = require("./template-literals");
+
+Object.keys(_templateLiterals).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _templateLiterals[key];
+ }
+ });
+});
+
+var _expressions = require("./expressions");
+
+Object.keys(_expressions).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _expressions[key];
+ }
+ });
+});
+
+var _statements = require("./statements");
+
+Object.keys(_statements).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _statements[key];
+ }
+ });
+});
+
+var _classes = require("./classes");
+
+Object.keys(_classes).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _classes[key];
+ }
+ });
+});
+
+var _methods = require("./methods");
+
+Object.keys(_methods).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _methods[key];
+ }
+ });
+});
+
+var _modules = require("./modules");
+
+Object.keys(_modules).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _modules[key];
+ }
+ });
+});
+
+var _types = require("./types");
+
+Object.keys(_types).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _types[key];
+ }
+ });
+});
+
+var _flow = require("./flow");
+
+Object.keys(_flow).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _flow[key];
+ }
+ });
+});
+
+var _base = require("./base");
+
+Object.keys(_base).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _base[key];
+ }
+ });
+});
+
+var _jsx = require("./jsx");
+
+Object.keys(_jsx).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _jsx[key];
+ }
+ });
+});
+
+var _typescript = require("./typescript");
+
+Object.keys(_typescript).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function () {
+ return _typescript[key];
+ }
+ });
+});
+},{"./base":38,"./classes":39,"./expressions":40,"./flow":41,"./jsx":43,"./methods":44,"./modules":45,"./statements":46,"./template-literals":47,"./types":48,"./typescript":49}],43:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.JSXAttribute = JSXAttribute;
+exports.JSXIdentifier = JSXIdentifier;
+exports.JSXNamespacedName = JSXNamespacedName;
+exports.JSXMemberExpression = JSXMemberExpression;
+exports.JSXSpreadAttribute = JSXSpreadAttribute;
+exports.JSXExpressionContainer = JSXExpressionContainer;
+exports.JSXSpreadChild = JSXSpreadChild;
+exports.JSXText = JSXText;
+exports.JSXElement = JSXElement;
+exports.JSXOpeningElement = JSXOpeningElement;
+exports.JSXClosingElement = JSXClosingElement;
+exports.JSXEmptyExpression = JSXEmptyExpression;
+exports.JSXFragment = JSXFragment;
+exports.JSXOpeningFragment = JSXOpeningFragment;
+exports.JSXClosingFragment = JSXClosingFragment;
+
+function JSXAttribute(node) {
+ this.print(node.name, node);
+
+ if (node.value) {
+ this.token("=");
+ this.print(node.value, node);
+ }
+}
+
+function JSXIdentifier(node) {
+ this.word(node.name);
+}
+
+function JSXNamespacedName(node) {
+ this.print(node.namespace, node);
+ this.token(":");
+ this.print(node.name, node);
+}
+
+function JSXMemberExpression(node) {
+ this.print(node.object, node);
+ this.token(".");
+ this.print(node.property, node);
+}
+
+function JSXSpreadAttribute(node) {
+ this.token("{");
+ this.token("...");
+ this.print(node.argument, node);
+ this.token("}");
+}
+
+function JSXExpressionContainer(node) {
+ this.token("{");
+ this.print(node.expression, node);
+ this.token("}");
+}
+
+function JSXSpreadChild(node) {
+ this.token("{");
+ this.token("...");
+ this.print(node.expression, node);
+ this.token("}");
+}
+
+function JSXText(node) {
+ const raw = this.getPossibleRaw(node);
+
+ if (raw != null) {
+ this.token(raw);
+ } else {
+ this.token(node.value);
+ }
+}
+
+function JSXElement(node) {
+ const open = node.openingElement;
+ this.print(open, node);
+ if (open.selfClosing) return;
+ this.indent();
+
+ for (const child of node.children) {
+ this.print(child, node);
+ }
+
+ this.dedent();
+ this.print(node.closingElement, node);
+}
+
+function spaceSeparator() {
+ this.space();
+}
+
+function JSXOpeningElement(node) {
+ this.token("<");
+ this.print(node.name, node);
+ this.print(node.typeParameters, node);
+
+ if (node.attributes.length > 0) {
+ this.space();
+ this.printJoin(node.attributes, node, {
+ separator: spaceSeparator
+ });
+ }
+
+ if (node.selfClosing) {
+ this.space();
+ this.token("/>");
+ } else {
+ this.token(">");
+ }
+}
+
+function JSXClosingElement(node) {
+ this.token("</");
+ this.print(node.name, node);
+ this.token(">");
+}
+
+function JSXEmptyExpression(node) {
+ this.printInnerComments(node);
+}
+
+function JSXFragment(node) {
+ this.print(node.openingFragment, node);
+ this.indent();
+
+ for (const child of node.children) {
+ this.print(child, node);
+ }
+
+ this.dedent();
+ this.print(node.closingFragment, node);
+}
+
+function JSXOpeningFragment() {
+ this.token("<");
+ this.token(">");
+}
+
+function JSXClosingFragment() {
+ this.token("</");
+ this.token(">");
+}
+},{}],44:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports._params = _params;
+exports._parameters = _parameters;
+exports._param = _param;
+exports._methodHead = _methodHead;
+exports._predicate = _predicate;
+exports._functionHead = _functionHead;
+exports.FunctionDeclaration = exports.FunctionExpression = FunctionExpression;
+exports.ArrowFunctionExpression = ArrowFunctionExpression;
+
+var t = _interopRequireWildcard(require("@babel/types"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescript [...]
+
+function _params(node) {
+ this.print(node.typeParameters, node);
+ this.token("(");
+
+ this._parameters(node.params, node);
+
+ this.token(")");
+ this.print(node.returnType, node);
+}
+
+function _parameters(parameters, parent) {
+ for (let i = 0; i < parameters.length; i++) {
+ this._param(parameters[i], parent);
+
+ if (i < parameters.length - 1) {
+ this.token(",");
+ this.space();
+ }
+ }
+}
+
+function _param(parameter, parent) {
+ this.printJoin(parameter.decorators, parameter);
+ this.print(parameter, parent);
+ if (parameter.optional) this.token("?");
+ this.print(parameter.typeAnnotation, parameter);
+}
+
+function _methodHead(node) {
+ const kind = node.kind;
+ const key = node.key;
+
+ if (kind === "get" || kind === "set") {
+ this.word(kind);
+ this.space();
+ }
+
+ if (node.async) {
+ this._catchUp("start", key.loc);
+
+ this.word("async");
+ this.space();
+ }
+
+ if (kind === "method" || kind === "init") {
+ if (node.generator) {
+ this.token("*");
+ }
+ }
+
+ if (node.computed) {
+ this.token("[");
+ this.print(key, node);
+ this.token("]");
+ } else {
+ this.print(key, node);
+ }
+
+ if (node.optional) {
+ this.token("?");
+ }
+
+ this._params(node);
+}
+
+function _predicate(node) {
+ if (node.predicate) {
+ if (!node.returnType) {
+ this.token(":");
+ }
+
+ this.space();
+ this.print(node.predicate, node);
+ }
+}
+
+function _functionHead(node) {
+ if (node.async) {
+ this.word("async");
+ this.space();
+ }
+
+ this.word("function");
+ if (node.generator) this.token("*");
+ this.space();
+
+ if (node.id) {
+ this.print(node.id, node);
+ }
+
+ this._params(node);
+
+ this._predicate(node);
+}
+
+function FunctionExpression(node) {
+ this._functionHead(node);
+
+ this.space();
+ this.print(node.body, node);
+}
+
+function ArrowFunctionExpression(node) {
+ if (node.async) {
+ this.word("async");
+ this.space();
+ }
+
+ const firstParam = node.params[0];
+
+ if (node.params.length === 1 && t.isIdentifier(firstParam) && !hasTypes(node, firstParam)) {
+ if ((this.format.retainLines || node.async) && node.loc && node.body.loc && node.loc.start.line < node.body.loc.start.line) {
+ this.token("(");
+
+ if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {
+ this.indent();
+ this.print(firstParam, node);
+ this.dedent();
+
+ this._catchUp("start", node.body.loc);
+ } else {
+ this.print(firstParam, node);
+ }
+
+ this.token(")");
+ } else {
+ this.print(firstParam, node);
+ }
+ } else {
+ this._params(node);
+ }
+
+ this._predicate(node);
+
+ this.space();
+ this.token("=>");
+ this.space();
+ this.print(node.body, node);
+}
+
+function hasTypes(node, param) {
+ return node.typeParameters || node.returnType || param.typeAnnotation || param.optional || param.trailingComments;
+}
+},{"@babel/types":143}],45:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.ImportSpecifier = ImportSpecifier;
+exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
+exports.ExportDefaultSpecifier = ExportDefaultSpecifier;
+exports.ExportSpecifier = ExportSpecifier;
+exports.ExportNamespaceSpecifier = ExportNamespaceSpecifier;
+exports.ExportAllDeclaration = ExportAllDeclaration;
+exports.ExportNamedDeclaration = ExportNamedDeclaration;
+exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
+exports.ImportDeclaration = ImportDeclaration;
+exports.ImportAttribute = ImportAttribute;
+exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
+
+var t = _interopRequireWildcard(require("@babel/types"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescript [...]
+
+function ImportSpecifier(node) {
+ if (node.importKind === "type" || node.importKind === "typeof") {
+ this.word(node.importKind);
+ this.space();
+ }
+
+ this.print(node.imported, node);
+
+ if (node.local && node.local.name !== node.imported.name) {
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.local, node);
+ }
+}
+
+function ImportDefaultSpecifier(node) {
+ this.print(node.local, node);
+}
+
+function ExportDefaultSpecifier(node) {
+ this.print(node.exported, node);
+}
+
+function ExportSpecifier(node) {
+ this.print(node.local, node);
+
+ if (node.exported && node.local.name !== node.exported.name) {
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.exported, node);
+ }
+}
+
+function ExportNamespaceSpecifier(node) {
+ this.token("*");
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.exported, node);
+}
+
+function ExportAllDeclaration(node) {
+ this.word("export");
+ this.space();
+
+ if (node.exportKind === "type") {
+ this.word("type");
+ this.space();
+ }
+
+ this.token("*");
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ this.semicolon();
+}
+
+function ExportNamedDeclaration(node) {
+ if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {
+ this.printJoin(node.declaration.decorators, node);
+ }
+
+ this.word("export");
+ this.space();
+ ExportDeclaration.apply(this, arguments);
+}
+
+function ExportDefaultDeclaration(node) {
+ if (this.format.decoratorsBeforeExport && t.isClassDeclaration(node.declaration)) {
+ this.printJoin(node.declaration.decorators, node);
+ }
+
+ this.word("export");
+ this.space();
+ this.word("default");
+ this.space();
+ ExportDeclaration.apply(this, arguments);
+}
+
+function ExportDeclaration(node) {
+ if (node.declaration) {
+ const declar = node.declaration;
+ this.print(declar, node);
+ if (!t.isStatement(declar)) this.semicolon();
+ } else {
+ if (node.exportKind === "type") {
+ this.word("type");
+ this.space();
+ }
+
+ const specifiers = node.specifiers.slice(0);
+ let hasSpecial = false;
+
+ for (;;) {
+ const first = specifiers[0];
+
+ if (t.isExportDefaultSpecifier(first) || t.isExportNamespaceSpecifier(first)) {
+ hasSpecial = true;
+ this.print(specifiers.shift(), node);
+
+ if (specifiers.length) {
+ this.token(",");
+ this.space();
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (specifiers.length || !specifiers.length && !hasSpecial) {
+ this.token("{");
+
+ if (specifiers.length) {
+ this.space();
+ this.printList(specifiers, node);
+ this.space();
+ }
+
+ this.token("}");
+ }
+
+ if (node.source) {
+ this.space();
+ this.word("from");
+ this.space();
+ this.print(node.source, node);
+ }
+
+ this.semicolon();
+ }
+}
+
+function ImportDeclaration(node) {
+ var _node$attributes;
+
+ this.word("import");
+ this.space();
+
+ if (node.importKind === "type" || node.importKind === "typeof") {
+ this.word(node.importKind);
+ this.space();
+ }
+
+ const specifiers = node.specifiers.slice(0);
+
+ if (specifiers == null ? void 0 : specifiers.length) {
+ for (;;) {
+ const first = specifiers[0];
+
+ if (t.isImportDefaultSpecifier(first) || t.isImportNamespaceSpecifier(first)) {
+ this.print(specifiers.shift(), node);
+
+ if (specifiers.length) {
+ this.token(",");
+ this.space();
+ }
+ } else {
+ break;
+ }
+ }
+
+ if (specifiers.length) {
+ this.token("{");
+ this.space();
+ this.printList(specifiers, node);
+ this.space();
+ this.token("}");
+ }
+
+ this.space();
+ this.word("from");
+ this.space();
+ }
+
+ this.print(node.source, node);
+
+ if ((_node$attributes = node.attributes) == null ? void 0 : _node$attributes.length) {
+ this.space();
+ this.word("with");
+ this.space();
+ this.printList(node.attributes, node);
+ }
+
+ this.semicolon();
+}
+
+function ImportAttribute(node) {
+ this.print(node.key);
+ this.token(":");
+ this.space();
+ this.print(node.value);
+}
+
+function ImportNamespaceSpecifier(node) {
+ this.token("*");
+ this.space();
+ this.word("as");
+ this.space();
+ this.print(node.local, node);
+}
+},{"@babel/types":143}],46:[function(require,module,exports){
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.WithStatement = WithStatement;
+exports.IfStatement = IfStatement;
+exports.ForStatement = ForStatement;
+exports.WhileStatement = WhileStatement;
+exports.DoWhileStatement = DoWhileStatement;
+exports.LabeledStatement = LabeledStatement;
+exports.TryStatement = TryStatement;
+exports.CatchClause = CatchClause;
+exports.SwitchStatement = SwitchStatement;
+exports.SwitchCase = SwitchCase;
+exports.DebuggerStatement = DebuggerStatement;
+exports.VariableDeclaration = VariableDeclaration;
+exports.VariableDeclarator = VariableDeclarator;
+exports.ThrowStatement = exports.BreakStatement = exports.ReturnStatement = exports.ContinueStatement = exports.ForOfStatement = exports.ForInStatement = void 0;
+
+var t = _interopRequireWildcard(require("@babel/types"));
+
+function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
+
+function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescript [...]
+
+function WithStatement(node) {
+ this.word("with");
+ this.space();
+ this.token("(");
+ this.print(node.object, node);
+ this.token(")");
+ this.printBlock(node);
+}
+
+function IfStatement(node) {
+ this.word("if");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.space();
+ const needsBlock = node.alternate && t.isIfStatement(getLastStatement(node.consequent));
+
+ if (needsBlock) {
+ this.token("{");
+ this.newline();
+ this.indent();
+ }
+
+ this.printAndIndentOnComments(node.consequent, node);
+
+ if (needsBlock) {
+ this.dedent();
+ this.newline();
+ this.token("}");
+ }
+
+ if (node.alternate) {
+ if (this.endsWith("}")) this.space();
+ this.word("else");
+ this.space();
+ this.printAndIndentOnComments(node.alternate, node);
+ }
+}
+
+function getLastStatement(statement) {
+ if (!t.isStatement(statement.body)) return statement;
+ return getLastStatement(statement.body);
+}
+
+function ForStatement(node) {
+ this.word("for");
+ this.space();
+ this.token("(");
+ this.inForStatementInitCounter++;
+ this.print(node.init, node);
+ this.inForStatementInitCounter--;
+ this.token(";");
+
+ if (node.test) {
+ this.space();
+ this.print(node.test, node);
+ }
+
+ this.token(";");
+
+ if (node.update) {
+ this.space();
+ this.print(node.update, node);
+ }
+
+ this.token(")");
+ this.printBlock(node);
+}
+
+function WhileStatement(node) {
+ this.word("while");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.printBlock(node);
+}
+
+const buildForXStatement = function (op) {
+ return function (node) {
+ this.word("for");
+ this.space();
+
+ if (op === "of" && node.await) {
+ this.word("await");
+ this.space();
+ }
+
+ this.token("(");
+ this.print(node.left, node);
+ this.space();
+ this.word(op);
+ this.space();
+ this.print(node.right, node);
+ this.token(")");
+ this.printBlock(node);
+ };
+};
+
+const ForInStatement = buildForXStatement("in");
+exports.ForInStatement = ForInStatement;
+const ForOfStatement = buildForXStatement("of");
+exports.ForOfStatement = ForOfStatement;
+
+function DoWhileStatement(node) {
+ this.word("do");
+ this.space();
+ this.print(node.body, node);
+ this.space();
+ this.word("while");
+ this.space();
+ this.token("(");
+ this.print(node.test, node);
+ this.token(")");
+ this.semicolon();
+}
+
+function buildLabelStatement(prefix, key = "label") {
+ return function (node) {
+ this.word(prefix);
+ const label = node[key];
+
+ if (label) {
+ this.space();
+ const isLabel = key == "label";
+ const terminatorState = this.startTerminatorless(isLabel);
+ this.print(label, node);
+ this.endTerminatorless(terminatorState);
+ }
+
+ this.semicolon();
+ };
+}
+
+const ContinueStatement = buildLabelStatement("continue");
+exports.ContinueStatement = ContinueStatement;
+const ReturnStatement = buildLabelStatement("return", "argument");
+exports.ReturnStatement = ReturnStatement;
+const BreakStatement = buildLabelStatement("break");
+exports.BreakStatement = BreakStatement;
+const ThrowStatement = buildLabelStatement("throw", "argument");
+exports.ThrowStatement = ThrowStatement;
+
+function LabeledStatement(node) {
+ this.print(node.label, node);
+ this.token(":");
+ this.space();
+ this.print(node.body, node);
+}
+
+function TryStatement(node) {
+ this.word("try");
+ this.space();
+ this.print(node.block, node);
+ this.space();
+
+ if (node.handlers) {
+ this.print(node.handlers[0], node);
+ } else {
+ this.print(node.handler, node);
+ }
+
+ if (node.finalizer) {
+ this.space();
+ this.word("finally");
+ this.space();
+ this.print(node.finalizer, node);
+ }
+}
+
+function CatchClause(node) {
+ this.word("catch");
+ this.space();
+
+ if (node.param) {
+ this.token("(");
+ this.print(node.param, node);
+ this.print(node.param.typeAnnotation, node);
+ this.token(")");
+ this.space();
+ }
+
+ this.print(node.body, node);
+}
+
+function SwitchStatement(node) {
+ this.word("switch");
+ this.space();
+ this.token("(");
+ this.print(node.discriminant, node);
+ this.token(")");
+ this.space();
+ this.token("{");
+ this.printSequence(node.cases, node, {
+ indent: true,
+
+ addNewlines(leading, cas) {
+ if (!leading && node.cases[node.cases.length - 1] === cas) return -1;
+ }
+
+ });
+ this.token("}");
+}
+
+function SwitchCase(node) {
+ if (node.test) {
+ this.word("case");
+ this.space();
+ this.print(node.test, node);
+ this.token(":");
+ } else {
+ this.word("default");
+ this.token(":");
+ }
+
+ if (node.consequent.length) {
+ this.newline();
+ this.printSequence(node.consequent, node, {
+ indent: true
+ });
+ }
+}
+
+function DebuggerStatement() {
+ this.word("debugger");
+ this.semicolon();
+}
+
+function variableDeclarationIndent() {
+ this.token(",");
+ this.newline();
+ if (this.endsWith("\n")) for (let i = 0; i < 4; i++) this.space(true);
+}
+
+function constDeclarationIndent() {
+ this.token(",");
+ this.newline();
+ if (this.endsWith("\n")) for (let i = 0; i < 6; i++) this.space(true);
+}
+
+function VariableDeclaration(node, parent) {
+ if (node.declare) {
+ this.word("declare");
+ this.space();
+ }
+
+ this.word(node.kind);
+ this.space();
+ let hasInits = false;
+
+ if (!t.isFor(parent)) {
+ for (const declar of node.declarations) {
+ if (declar.init) {
+ hasInits = true;
+ }
+ }
+ }
+
+ let separator;
+
+ if (hasInits) {
... 227030 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org