import { defineComponent, getCurrentInstance, createCommentVNode } from 'vue';
import { useGeometries } from '../composables';
import { kebabCase } from '../utils/util';
import { dimensions, vertexFormat, center, radius, ellipsoid, height, granularity, extrudedHeight, stRotation, numberOfVerticalLines, polygonHierarchy, positions, width, cornerType, length, topRadius, bottomRadius, slices, semiMajorAxis, semiMinorAxis, rotation, radii, innerRadii, minimumClock, maximumClock, minimumCone, maximumCone, stackPartitions, slicePartitions, subdivisions, frustum, origin, orientation, loop, arcType, perPositionHeight, closeTop, closeBottom, colors, polylinePositions, shapePositions, rectangle, maximumHeights, minimumHeights } from '../utils/cesium-props';

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

function __awaiter(thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
}

var VcGeometryBox = defineComponent({
    name: 'VcGeometryBox',
    props: Object.assign(Object.assign({}, dimensions), vertexFormat),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'BoxGeometry';
        const geometriesState = useGeometries(props, ctx, instance);
        instance.createCesiumObject = () => __awaiter(this, void 0, void 0, function* () {
            const options = geometriesState.transformProps(props);
            return Cesium.BoxGeometry.fromDimensions(options);
        });
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryBoxOutline = defineComponent({
    name: 'VcGeometryBoxOutline',
    props: Object.assign({}, dimensions),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'BoxOutlineGeometry';
        const geometriesState = useGeometries(props, ctx, instance);
        instance.createCesiumObject = () => __awaiter(this, void 0, void 0, function* () {
            const options = geometriesState.transformProps(props);
            return Cesium.BoxOutlineGeometry.fromDimensions(options);
        });
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryCircle = defineComponent({
    name: 'VcGeometryCircle',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, center), radius), ellipsoid), height), granularity), vertexFormat), extrudedHeight), stRotation),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'CircleGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryCircleOutline = defineComponent({
    name: 'VcGeometryCircleOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, center), radius), ellipsoid), height), granularity), extrudedHeight), numberOfVerticalLines),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'CircleOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolygonCoplanar = defineComponent({
    name: 'VcGeometryPolygonCoplanar',
    props: Object.assign(Object.assign(Object.assign(Object.assign({}, polygonHierarchy), ellipsoid), vertexFormat), stRotation),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'CoplanarPolygonGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolygonCoplanarOutline = defineComponent({
    name: 'VcGeometryPolygonCoplanarOutline',
    props: Object.assign({}, polygonHierarchy),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'CoplanarPolygonOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryCorridor = defineComponent({
    name: 'VcGeometryCorridor',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, positions), width), ellipsoid), granularity), height), extrudedHeight), vertexFormat), cornerType),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'CorridorGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryCorridorOutline = defineComponent({
    name: 'VcGeometryCorridorOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, positions), width), ellipsoid), granularity), height), extrudedHeight), cornerType),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'CorridorOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryCylinder = defineComponent({
    name: 'VcGeometryCylinder',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, length), topRadius), bottomRadius), slices), vertexFormat),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'CylinderGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryCylinderOutline = defineComponent({
    name: 'VcGeometryCylinderOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, length), topRadius), bottomRadius), slices), numberOfVerticalLines),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'CylinderOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryEllipse = defineComponent({
    name: 'VcGeometryEllipse',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, center), semiMajorAxis), semiMinorAxis), ellipsoid), height), extrudedHeight), rotation), stRotation), granularity), vertexFormat),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'EllipseGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryEllipseOutline = defineComponent({
    name: 'VcGeometryEllipseOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, center), semiMajorAxis), semiMinorAxis), ellipsoid), height), extrudedHeight), rotation), stRotation), granularity), numberOfVerticalLines),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'EllipseOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryEllipsoid = defineComponent({
    name: 'VcGeometryEllipsoid',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, radii), innerRadii), minimumClock), maximumClock), minimumCone), maximumCone), stackPartitions), slicePartitions), vertexFormat),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'EllipsoidGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryEllipsoidOutline = defineComponent({
    name: 'VcGeometryEllipsoidOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, radii), innerRadii), minimumClock), maximumClock), minimumCone), maximumCone), stackPartitions), slicePartitions), subdivisions),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'EllipsoidOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryFrustum = defineComponent({
    name: 'VcGeometryFrustum',
    props: Object.assign(Object.assign(Object.assign(Object.assign({}, frustum), origin), orientation), vertexFormat),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'FrustumGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryFrustumOutline = defineComponent({
    name: 'VcGeometryFrustumOutline',
    props: Object.assign(Object.assign(Object.assign({}, frustum), origin), orientation),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'FrustumOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolylineGround = defineComponent({
    name: 'VcGeometryPolylineGround',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, positions), width), granularity), loop), arcType),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'GroundPolylineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPlane = defineComponent({
    name: 'VcGeometryPlane',
    props: Object.assign({}, vertexFormat),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'PlaneGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPlaneOutline = defineComponent({
    name: 'VcGeometryPlaneOutline',
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'PlaneOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolygon = defineComponent({
    name: 'VcGeometryPolygon',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, polygonHierarchy), height), extrudedHeight), vertexFormat), stRotation), ellipsoid), granularity), perPositionHeight), closeTop), closeBottom), arcType),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'PolygonGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolygonOutline = defineComponent({
    name: 'VcGeometryPolygonOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, polygonHierarchy), height), extrudedHeight), vertexFormat), ellipsoid), granularity), perPositionHeight), arcType),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'PolygonOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolyline = defineComponent({
    name: 'VcGeometryPolyline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, positions), width), colors), { colorsPerVertex: {
            type: Boolean,
            default: false
        } }), arcType), granularity), vertexFormat), ellipsoid),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'PolylineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolylineVolume = defineComponent({
    name: 'VcGeometryPolylineVolume',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, polylinePositions), shapePositions), ellipsoid), granularity), vertexFormat), cornerType),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'PolylineVolumeGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolylineVolumeOutline = defineComponent({
    name: 'VcGeometryPolylineVolumeOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, polylinePositions), shapePositions), ellipsoid), granularity), cornerType),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'PolylineVolumeOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryRectangle = defineComponent({
    name: 'VcGeometryRectangle',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, rectangle), vertexFormat), ellipsoid), granularity), height), rotation), stRotation), extrudedHeight),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'RectangleGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryRectangleOutline = defineComponent({
    name: 'VcGeometryRectangleOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, rectangle), ellipsoid), granularity), height), rotation), extrudedHeight),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'RectangleOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryPolylineSimple = defineComponent({
    name: 'VcGeometryPolylineSimple',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, positions), colors), { colorsPerVertex: {
            type: Boolean,
            default: false
        } }), arcType), granularity), ellipsoid),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'SimplePolylineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometrySphere = defineComponent({
    name: 'VcGeometrySphere',
    props: Object.assign(Object.assign(Object.assign(Object.assign({}, radius), stackPartitions), slicePartitions), vertexFormat),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'SphereGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometrySphereOutline = defineComponent({
    name: 'VcGeometrySphereOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign({}, radius), stackPartitions), slicePartitions), subdivisions),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'SphereOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryWall = defineComponent({
    name: 'VcGeometryWall',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, positions), granularity), maximumHeights), minimumHeights), ellipsoid), vertexFormat),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'WallGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcGeometryWallOutline = defineComponent({
    name: 'VcGeometryWallOutline',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, positions), granularity), maximumHeights), minimumHeights), ellipsoid),
    emits: ['beforeLoad', 'ready', 'destroyed'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'WallOutlineGeometry';
        useGeometries(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

const components = [
    VcGeometryBox,
    VcGeometryBoxOutline,
    VcGeometryCircle,
    VcGeometryCircleOutline,
    VcGeometryPolygonCoplanar,
    VcGeometryPolygonCoplanarOutline,
    VcGeometryCorridor,
    VcGeometryCorridorOutline,
    VcGeometryCylinder,
    VcGeometryCylinderOutline,
    VcGeometryEllipse,
    VcGeometryEllipseOutline,
    VcGeometryEllipsoid,
    VcGeometryEllipsoidOutline,
    VcGeometryFrustum,
    VcGeometryFrustumOutline,
    VcGeometryPolylineGround,
    VcGeometryPlane,
    VcGeometryPlaneOutline,
    VcGeometryPolygon,
    VcGeometryPolygonOutline,
    VcGeometryPolyline,
    VcGeometryPolylineVolume,
    VcGeometryPolylineVolumeOutline,
    VcGeometryRectangle,
    VcGeometryRectangleOutline,
    VcGeometryPolylineSimple,
    VcGeometrySphere,
    VcGeometrySphereOutline,
    VcGeometryWall,
    VcGeometryWallOutline
];
const install = (app) => {
    components.forEach(cmp => {
        app.component(cmp.name, cmp);
    });
};
var index = {
    install
};

export default index;
export { VcGeometryBox, VcGeometryBoxOutline, VcGeometryCircle, VcGeometryCircleOutline, VcGeometryCorridor, VcGeometryCorridorOutline, VcGeometryCylinder, VcGeometryCylinderOutline, VcGeometryEllipse, VcGeometryEllipseOutline, VcGeometryEllipsoid, VcGeometryEllipsoidOutline, VcGeometryFrustum, VcGeometryFrustumOutline, VcGeometryPlane, VcGeometryPlaneOutline, VcGeometryPolygon, VcGeometryPolygonCoplanar, VcGeometryPolygonCoplanarOutline, VcGeometryPolygonOutline, VcGeometryPolyline, VcGeometryPolylineGround, VcGeometryPolylineSimple, VcGeometryPolylineVolume, VcGeometryPolylineVolumeOutline, VcGeometryRectangle, VcGeometryRectangleOutline, VcGeometrySphere, VcGeometrySphereOutline, VcGeometryWall, VcGeometryWallOutline };
