/**
 * DevExtreme (cjs/viz/gauges/circular_range_container.js)
 * Version: 22.1.3 (build 22187-0312)
 * Build date: Wed Jul 06 2022
 *
 * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
"use strict";
exports.default = void 0;
var _base_range_container = _interopRequireDefault(require("./base_range_container"));
var _utils = require("../core/utils");

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    }
}
var _Number = Number;
var _max = Math.max;
var CircularRangeContainer = _base_range_container.default.inherit({
    _processOptions: function() {
        this._inner = this._outer = 0;
        switch ((0, _utils.normalizeEnum)(this._options.orientation)) {
            case "inside":
                this._inner = 1;
                break;
            case "center":
                this._inner = this._outer = .5;
                break;
            default:
                this._outer = 1
        }
    },
    _isVisible: function(layout) {
        var width = this._options.width;
        width = _Number(width) || _max(_Number(width.start), _Number(width.end));
        return layout.radius - this._inner * width > 0
    },
    _createRange: function(range, layout) {
        var width = (range.startWidth + range.endWidth) / 2;
        return this._renderer.arc(layout.x, layout.y, layout.radius - this._inner * width, layout.radius + this._outer * width, this._translator.translate(range.end), this._translator.translate(range.start)).attr({
            "stroke-linejoin": "round"
        })
    },
    measure: function(layout) {
        var width = this._options.width;
        width = _Number(width) || _max(_Number(width.start), _Number(width.end));
        return {
            min: layout.radius - this._inner * width,
            max: layout.radius + this._outer * width
        }
    }
});
var _default = CircularRangeContainer;
exports.default = _default;
module.exports = exports.default;
module.exports.default = exports.default;
