"use strict";
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.11.8
//   protoc               v4.25.9
// source: io/restorecommerce/geometry.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.protoMetadata = exports.OriginBoundingBox = exports.BoundingBox3D = exports.Vector3D = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const options_1 = require("./options");
exports.protobufPackage = "io.restorecommerce.geometry";
function createBaseVector3D() {
    return {};
}
exports.Vector3D = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.x !== undefined) {
            writer.uint32(9).double(message.x);
        }
        if (message.y !== undefined) {
            writer.uint32(17).double(message.y);
        }
        if (message.z !== undefined) {
            writer.uint32(25).double(message.z);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseVector3D();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 9) {
                        break;
                    }
                    message.x = reader.double();
                    continue;
                }
                case 2: {
                    if (tag !== 17) {
                        break;
                    }
                    message.y = reader.double();
                    continue;
                }
                case 3: {
                    if (tag !== 25) {
                        break;
                    }
                    message.z = reader.double();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            x: isSet(object.x) ? globalThis.Number(object.x) : undefined,
            y: isSet(object.y) ? globalThis.Number(object.y) : undefined,
            z: isSet(object.z) ? globalThis.Number(object.z) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.x !== undefined) {
            obj.x = message.x;
        }
        if (message.y !== undefined) {
            obj.y = message.y;
        }
        if (message.z !== undefined) {
            obj.z = message.z;
        }
        return obj;
    },
    create(base) {
        return exports.Vector3D.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseVector3D();
        message.x = object.x ?? undefined;
        message.y = object.y ?? undefined;
        message.z = object.z ?? undefined;
        return message;
    },
};
function createBaseBoundingBox3D() {
    return {};
}
exports.BoundingBox3D = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.width !== undefined) {
            writer.uint32(9).double(message.width);
        }
        if (message.height !== undefined) {
            writer.uint32(17).double(message.height);
        }
        if (message.length !== undefined) {
            writer.uint32(25).double(message.length);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseBoundingBox3D();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 9) {
                        break;
                    }
                    message.width = reader.double();
                    continue;
                }
                case 2: {
                    if (tag !== 17) {
                        break;
                    }
                    message.height = reader.double();
                    continue;
                }
                case 3: {
                    if (tag !== 25) {
                        break;
                    }
                    message.length = reader.double();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            width: isSet(object.width) ? globalThis.Number(object.width) : undefined,
            height: isSet(object.height) ? globalThis.Number(object.height) : undefined,
            length: isSet(object.length) ? globalThis.Number(object.length) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.width !== undefined) {
            obj.width = message.width;
        }
        if (message.height !== undefined) {
            obj.height = message.height;
        }
        if (message.length !== undefined) {
            obj.length = message.length;
        }
        return obj;
    },
    create(base) {
        return exports.BoundingBox3D.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseBoundingBox3D();
        message.width = object.width ?? undefined;
        message.height = object.height ?? undefined;
        message.length = object.length ?? undefined;
        return message;
    },
};
function createBaseOriginBoundingBox() {
    return {};
}
exports.OriginBoundingBox = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.origin !== undefined) {
            exports.Vector3D.encode(message.origin, writer.uint32(10).fork()).join();
        }
        if (message.bbox !== undefined) {
            exports.BoundingBox3D.encode(message.bbox, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        const end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseOriginBoundingBox();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.origin = exports.Vector3D.decode(reader, reader.uint32());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.bbox = exports.BoundingBox3D.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            origin: isSet(object.origin) ? exports.Vector3D.fromJSON(object.origin) : undefined,
            bbox: isSet(object.bbox) ? exports.BoundingBox3D.fromJSON(object.bbox) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.origin !== undefined) {
            obj.origin = exports.Vector3D.toJSON(message.origin);
        }
        if (message.bbox !== undefined) {
            obj.bbox = exports.BoundingBox3D.toJSON(message.bbox);
        }
        return obj;
    },
    create(base) {
        return exports.OriginBoundingBox.fromPartial(base ?? {});
    },
    fromPartial(object) {
        const message = createBaseOriginBoundingBox();
        message.origin = (object.origin !== undefined && object.origin !== null)
            ? exports.Vector3D.fromPartial(object.origin)
            : undefined;
        message.bbox = (object.bbox !== undefined && object.bbox !== null)
            ? exports.BoundingBox3D.fromPartial(object.bbox)
            : undefined;
        return message;
    },
};
exports.protoMetadata = {
    fileDescriptor: {
        "name": "io/restorecommerce/geometry.proto",
        "package": "io.restorecommerce.geometry",
        "dependency": ["io/restorecommerce/options.proto"],
        "publicDependency": [],
        "weakDependency": [],
        "optionDependency": [],
        "messageType": [{
                "name": "Vector3D",
                "field": [{
                        "name": "x",
                        "number": 1,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "x",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "y",
                        "number": 2,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "y",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "z",
                        "number": 3,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "z",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_x", "options": undefined }, { "name": "_y", "options": undefined }, {
                        "name": "_z",
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "BoundingBox3D",
                "field": [{
                        "name": "width",
                        "number": 1,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "width",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "height",
                        "number": 2,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "height",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "length",
                        "number": 3,
                        "label": 1,
                        "type": 1,
                        "typeName": "",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 2,
                        "jsonName": "length",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_width", "options": undefined }, { "name": "_height", "options": undefined }, {
                        "name": "_length",
                        "options": undefined,
                    }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }, {
                "name": "OriginBoundingBox",
                "field": [{
                        "name": "origin",
                        "number": 1,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.geometry.Vector3D",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 0,
                        "jsonName": "origin",
                        "options": undefined,
                        "proto3Optional": true,
                    }, {
                        "name": "bbox",
                        "number": 2,
                        "label": 1,
                        "type": 11,
                        "typeName": ".io.restorecommerce.geometry.BoundingBox3D",
                        "extendee": "",
                        "defaultValue": "",
                        "oneofIndex": 1,
                        "jsonName": "bbox",
                        "options": undefined,
                        "proto3Optional": true,
                    }],
                "extension": [],
                "nestedType": [],
                "enumType": [],
                "extensionRange": [],
                "oneofDecl": [{ "name": "_origin", "options": undefined }, { "name": "_bbox", "options": undefined }],
                "options": undefined,
                "reservedRange": [],
                "reservedName": [],
                "visibility": 0,
            }],
        "enumType": [],
        "service": [],
        "extension": [],
        "options": undefined,
        "sourceCodeInfo": { "location": [] },
        "syntax": "proto3",
        "edition": 0,
    },
    references: {
        ".io.restorecommerce.geometry.Vector3D": exports.Vector3D,
        ".io.restorecommerce.geometry.BoundingBox3D": exports.BoundingBox3D,
        ".io.restorecommerce.geometry.OriginBoundingBox": exports.OriginBoundingBox,
    },
    dependencies: [options_1.protoMetadata],
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=geometry.js.map