import { defineComponent, getCurrentInstance, h, createCommentVNode } from 'vue';
import { usePrimitives } from '../composables';
import { geometryInstances, appearance, show, vertexCacheOptimize, interleave, compressVertices, releaseGeometryInstances, allowPicking, asynchronous, classificationType, debugShowBoundingVolume, debugShowShadowVolume, enableMouseEvent, url, modelMatrix, scale, minimumPixelSize, maximumScale, id, incrementallyLoadTextures, clampAnimations, shadows, debugWireframe, heightReference, scene, distanceDisplayCondition, color, colorBlendMode, colorBlendAmount, silhouetteColor, silhouetteSize, clippingPlanes, imageBasedLightingFactor, lightColor, luminanceAtZenith, sphericalHarmonicCoefficients, specularEnvironmentMaps, credit, backFaceCulling, maximumScreenSpaceError, ellipsoid, lightColor2, startColor, endColor, image, imageSize, minimumImageSize, maximumImageSize, sizeInMeters } from '../utils/cesium-props';
import { kebabCase } from '../utils/util';
import { hSlot } from '../utils/private/render';

var VcPrimitiveClassification = defineComponent({
    name: 'VcPrimitiveClassification',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, geometryInstances), appearance), show), vertexCacheOptimize), interleave), compressVertices), releaseGeometryInstances), allowPicking), asynchronous), classificationType), debugShowBoundingVolume), debugShowShadowVolume), enableMouseEvent),
    emits: ['beforeLoad', 'ready', 'destroyed', 'readyPromise', 'update:geometryInstances'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'ClassificationPrimitive';
        usePrimitives(props, ctx, instance);
        return () => ctx.slots.default ? (h('i', {
            class: kebabCase(instance.proxy.$options.name),
            style: { display: 'none !important' }
        }, hSlot(ctx.slots.default))) : createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcPrimitiveGround = defineComponent({
    name: 'VcPrimitiveGround',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, geometryInstances), appearance), show), vertexCacheOptimize), interleave), compressVertices), releaseGeometryInstances), allowPicking), asynchronous), classificationType), debugShowBoundingVolume), debugShowShadowVolume), enableMouseEvent),
    emits: ['beforeLoad', 'ready', 'destroyed', 'readyPromise', 'update:geometryInstances'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'GroundPrimitive';
        usePrimitives(props, ctx, instance);
        return () => ctx.slots.default ? (h('i', {
            class: kebabCase(instance.proxy.$options.name),
            style: { display: 'none !important' }
        }, hSlot(ctx.slots.default))) : createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcPrimitiveGroundPolyline = defineComponent({
    name: 'VcPrimitivePolylineGround',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, geometryInstances), appearance), show), interleave), compressVertices), releaseGeometryInstances), allowPicking), asynchronous), classificationType), debugShowBoundingVolume), debugShowShadowVolume), enableMouseEvent),
    emits: ['beforeLoad', 'ready', 'destroyed', 'readyPromise', 'update:geometryInstances'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'GroundPolylinePrimitive';
        usePrimitives(props, ctx, instance);
        return () => ctx.slots.default ? (h('i', {
            class: kebabCase(instance.proxy.$options.name),
            style: { display: 'none !important' }
        }, hSlot(ctx.slots.default))) : createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

/*! *****************************************************************************
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 VcPrimitiveModel = defineComponent({
    name: 'VcPrimitiveModel',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, url), { basePath: String }), show), modelMatrix), scale), minimumPixelSize), maximumScale), id), allowPicking), incrementallyLoadTextures), asynchronous), clampAnimations), shadows), debugShowBoundingVolume), debugWireframe), heightReference), scene), distanceDisplayCondition), color), colorBlendMode), colorBlendAmount), silhouetteColor), silhouetteSize), clippingPlanes), { dequantizeInShader: {
            type: Boolean,
            default: true
        } }), imageBasedLightingFactor), lightColor), luminanceAtZenith), sphericalHarmonicCoefficients), specularEnvironmentMaps), credit), backFaceCulling), enableMouseEvent),
    emits: ['beforeLoad', 'ready', 'destroyed', 'readyPromise'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'Model';
        const primitivesState = usePrimitives(props, ctx, instance);
        instance.createCesiumObject = () => __awaiter(this, void 0, void 0, function* () {
            const options = primitivesState.transformProps(props);
            return Cesium.Model.fromGltf(options);
        });
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcPrimitive = defineComponent({
    name: 'VcPrimitive',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, geometryInstances), appearance), { depthFailAppearance: Object }), show), modelMatrix), vertexCacheOptimize), interleave), compressVertices), releaseGeometryInstances), allowPicking), { cull: {
            type: Boolean,
            default: true
        } }), asynchronous), debugShowBoundingVolume), shadows), enableMouseEvent),
    emits: ['beforeLoad', 'ready', 'destroyed', 'readyPromise', 'update:geometryInstances'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'Primitive';
        usePrimitives(props, ctx, instance);
        return () => ctx.slots.default ? (h('i', {
            class: kebabCase(instance.proxy.$options.name),
            style: { display: 'none !important' }
        }, hSlot(ctx.slots.default))) : createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcPrimitiveTileset = defineComponent({
    name: 'VcPrimitiveTileset',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, url), show), modelMatrix), shadows), maximumScreenSpaceError), { maximumMemoryUsage: {
            type: Number,
            default: 512
        }, cullWithChildrenBounds: {
            type: Boolean,
            default: true
        }, cullRequestsWhileMoving: {
            type: Boolean,
            default: true
        }, cullRequestsWhileMovingMultiplier: {
            type: Number,
            default: 60.0
        }, preloadWhenHidden: {
            type: Boolean,
            default: false
        }, preloadFlightDestinations: {
            type: Boolean,
            default: true
        }, preferLeaves: {
            type: Boolean,
            default: false
        }, dynamicScreenSpaceError: {
            type: Boolean,
            default: false
        }, dynamicScreenSpaceErrorDensity: {
            type: Number,
            default: 0.00278
        }, dynamicScreenSpaceErrorFactor: {
            type: Number,
            default: 4.0
        }, dynamicScreenSpaceErrorHeightFalloff: {
            type: Number,
            default: 0.25
        }, progressiveResolutionHeightFraction: {
            type: Number,
            default: 0.3
        }, foveatedScreenSpaceError: {
            type: Boolean,
            default: true
        }, foveatedConeSize: {
            type: Number,
            default: 0.1
        }, foveatedMinimumScreenSpaceErrorRelaxation: {
            type: Number,
            default: 0.0
        }, foveatedInterpolationCallback: Function, foveatedTimeDelay: {
            type: Number,
            default: 0.2
        }, skipLevelOfDetail: {
            type: Boolean,
            default: false
        }, baseScreenSpaceError: {
            type: Number,
            default: 1024
        }, skipScreenSpaceErrorFactor: {
            type: Number,
            default: 16
        }, skipLevels: {
            type: Number,
            default: 1
        }, immediatelyLoadDesiredLevelOfDetail: {
            type: Boolean,
            default: false
        }, loadSiblings: {
            type: Boolean,
            default: false
        } }), clippingPlanes), classificationType), ellipsoid), { pointCloudShading: Object }), imageBasedLightingFactor), lightColor2), luminanceAtZenith), sphericalHarmonicCoefficients), specularEnvironmentMaps), backFaceCulling), { vectorClassificationOnly: {
            type: Boolean,
            default: false
        }, debugHeatmapTilePropertyName: String, debugFreezeFrame: {
            type: Boolean,
            default: false
        }, debugColorizeTiles: {
            type: Boolean,
            default: false
        } }), debugWireframe), debugShowBoundingVolume), { debugShowContentBoundingVolume: {
            type: Boolean,
            default: false
        }, debugShowViewerRequestVolume: {
            type: Boolean,
            default: false
        }, debugShowGeometricError: {
            type: Boolean,
            default: false
        }, debugShowRenderingStatistics: {
            type: Boolean,
            default: false
        }, debugShowMemoryUsage: {
            type: Boolean,
            default: false
        }, debugShowUrl: {
            type: Boolean,
            default: false
        } }), enableMouseEvent),
    emits: ['beforeLoad', 'ready', 'destroyed', 'readyPromise'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'Cesium3DTileset';
        usePrimitives(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

var VcPrimitiveParticle = defineComponent({
    name: 'VcPrimitiveParticle',
    props: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, show), { updateCallback: Function, emitter: Object }), modelMatrix), { emitterModelMatrix: Object, emissionRate: Number, bursts: Array, loop: {
            type: Boolean,
            default: true
        }, scale: {
            type: Number,
            default: 1.0
        }, startScale: Number, endScale: Number }), color), startColor), endColor), image), imageSize), minimumImageSize), maximumImageSize), sizeInMeters), { speed: Number, minimumSpeed: Number, maximumSpeed: Number, lifetime: Number, particleLife: {
            type: Number,
            default: 5.0
        }, minimumParticleLife: Number, maximumParticleLife: Number, mass: {
            type: Number,
            default: 1.0
        }, minimumMass: Number, maximumMass: Number }), enableMouseEvent),
    emits: ['beforeLoad', 'ready', 'destroyed', 'readyPromise'],
    setup(props, ctx) {
        const instance = getCurrentInstance();
        instance.cesiumClass = 'ParticleSystem';
        instance.cesiumEvents = ['complete'];
        usePrimitives(props, ctx, instance);
        return () => createCommentVNode(kebabCase(instance.proxy.$options.name));
    }
});

const components = [
    VcPrimitiveClassification,
    VcPrimitiveGround,
    VcPrimitiveGroundPolyline,
    VcPrimitiveModel,
    VcPrimitive,
    VcPrimitiveTileset,
    VcPrimitiveParticle
];
const install = (app) => {
    components.forEach(cmp => {
        app.component(cmp.name, cmp);
    });
};
var index = {
    install
};

export default index;
export { VcPrimitive, VcPrimitiveClassification, VcPrimitiveGround, VcPrimitiveGroundPolyline, VcPrimitiveModel, VcPrimitiveParticle, VcPrimitiveTileset };
