export default ({ React, reactComponents }) => {

    const global = window;

    React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;

    /*! *****************************************************************************
    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.
    ***************************************************************************** */
    /* global Reflect, Promise */

    var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };

    function __extends(d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }

    var __assign = function() {
        __assign = Object.assign || function __assign(t) {
            for (var s, i = 1, n = arguments.length; i < n; i++) {
                s = arguments[i];
                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
            }
            return t;
        };
        return __assign.apply(this, arguments);
    };

    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());
        });
    }

    function __generator(thisArg, body) {
        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f) throw new TypeError("Generator is already executing.");
            while (_) try {
                if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
                if (y = 0, t) op = [op[0] & 2, t.value];
                switch (op[0]) {
                    case 0: case 1: t = op; break;
                    case 4: _.label++; return { value: op[1], done: false };
                    case 5: _.label++; y = op[1]; op = [0]; continue;
                    case 7: op = _.ops.pop(); _.trys.pop(); continue;
                    default:
                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                        if (t[2]) _.ops.pop();
                        _.trys.pop(); continue;
                }
                op = body.call(thisArg, _);
            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
        }
    }

    function __spreadArrays() {
        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
        for (var r = Array(s), k = 0, i = 0; i < il; i++)
            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                r[k] = a[j];
        return r;
    }

    var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

    function createCommonjsModule(fn, basedir, module) {
    	return module = {
    	  path: basedir,
    	  exports: {},
    	  require: function (path, base) {
          return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
        }
    	}, fn(module, module.exports), module.exports;
    }

    function commonjsRequire () {
    	throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
    }

    var createIconComponent_1 = createCommonjsModule(function (module, exports) {

    Object.defineProperty(exports, "__esModule", {
      value: true
    });

    var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };



    var _react2 = _interopRequireDefault(React);

    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

    var sizes = {
      'lg': 19, '2x': 28, '3x': 42, '4x': 56, '5x': 70
    };
    var baseStyle = {
      position: 'relative',
      userSelect: 'none',
      textAlignVertical: 'text-bottom',
      display: 'inline-block'
    };
    var getContent = function getContent(fillContent, lightContent, regularContent) {
      var weight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'regular';

      switch (weight) {
        case 'regular':
          return regularContent;
        case 'light':
          return lightContent;
        case 'fill':
          return fillContent;
      }
      return regularContent;
    };
    var createIconComponent = function createIconComponent(_ref) {
      var fillContent = _ref.fillContent,
          lightContent = _ref.lightContent,
          regularContent = _ref.regularContent,
          height = _ref.height,
          width = _ref.width,
          viewBox = _ref.viewBox;
      return function (props) {
        return (0, React.createElement)('svg', _extends({}, props, {
          style: _extends({}, baseStyle, {
            height: sizes[props.size] || 14 + 'px',
            fill: props.color || 'currentColor'
          }, props.style),
          viewBox: viewBox || '0 0 ' + width + ' ' + height
        }), getContent(fillContent, lightContent, regularContent, props.weight));
      };
    };
    exports.default = createIconComponent;
    });

    var IconMessagesBubbleQuestion_1 = createCommonjsModule(function (module, exports) {

    Object.defineProperty(exports, "__esModule", {
      value: true
    });



    var _createIconComponent2 = _interopRequireDefault(createIconComponent_1);



    var _react2 = _interopRequireDefault(React);

    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

    var IconMessagesBubbleQuestion = (0, _createIconComponent2.default)({ fillContent: _react2.default.createElement(
        'g',
        null,
        _react2.default.createElement('path', { d: 'M12 1.337C5.659 1.337.5 5.587.5 10.812a8.592 8.592 0 0 0 3.175 6.539l-2.3 4.587a.5.5 0 0 0 .658.677l6.149-2.862a13.733 13.733 0 0 0 3.818.532c6.341 0 11.5-4.25 11.5-9.473S18.341 1.337 12 1.337zm.5 15.538a1 1 0 1 1 1-1 1 1 0 0 1-1 1zm1.5-5.062a1.252 1.252 0 0 0-.75 1.146v.416a.75.75 0 0 1-1.5 0v-.416a2.75 2.75 0 0 1 1.65-2.521 2.25 2.25 0 1 0-3.15-2.063.75.75 0 0 1-1.5 0A3.75 3.75 0 1 1 14 11.813z' })
      ), lightContent: _react2.default.createElement(
        'g',
        null,
        _react2.default.createElement('path', { d: 'M1.556 23.5a.5.5 0 0 1-.462-.692l2.255-5.413A9.21 9.21 0 0 1 .055 10.51C.055 4.988 5.438.5 12.055.5s12 4.486 12 10-5.383 10-12 10c-1.381 0-2.749-.202-4.068-.599l-6.183 3.533a.5.5 0 0 1-.248.066zm10.5-22c-6.065 0-11 4.037-11 9a8.19 8.19 0 0 0 3.205 6.345.5.5 0 0 1 .156.588l-1.835 4.405 5.098-2.913a.503.503 0 0 1 .399-.043c1.287.41 2.624.618 3.975.618 6.068 0 11.002-4.037 11.002-9s-4.935-9-11-9z' }),
        _react2.default.createElement('path', { d: 'M12.056 13.5a.5.5 0 0 1-.5-.5v-.416a2.5 2.5 0 0 1 1.5-2.291 2.498 2.498 0 0 0 .769-4.058 2.48 2.48 0 0 0-1.767-.733c-.669 0-1.296.26-1.768.731A2.48 2.48 0 0 0 9.556 8a.5.5 0 0 1-1 0c0-.935.365-1.813 1.026-2.474a3.478 3.478 0 0 1 2.474-1.024c.937 0 1.815.365 2.476 1.026a3.498 3.498 0 0 1-1.076 5.681 1.5 1.5 0 0 0-.9 1.375V13a.5.5 0 0 1-.5.5zM12.056 16.25a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5z' })
      ), regularContent: _react2.default.createElement(
        'g',
        null,
        _react2.default.createElement('path', { d: 'M.755 24a.75.75 0 0 1-.678-1.072l2.911-6.113a11.245 11.245 0 0 1-1.484-5.596C1.513 5.033 6.553 0 12.739 0h.035c2.102 0 4.157.587 5.942 1.697a11.175 11.175 0 0 1 5.015 7 11.176 11.176 0 0 1-1.404 8.495 11.176 11.176 0 0 1-6.999 5.015 11.199 11.199 0 0 1-8.139-1.191l-6.112 2.912A.768.768 0 0 1 .755 24zM12.739 1.5c-5.36 0-9.727 4.361-9.735 9.721a9.724 9.724 0 0 0 1.47 5.158.745.745 0 0 1 .04.719L2.34 21.664l4.566-2.175a.744.744 0 0 1 .719.041 9.706 9.706 0 0 0 7.362 1.216 9.69 9.69 0 0 0 6.066-4.346 9.69 9.69 0 0 0 1.216-7.363 9.687 9.687 0 0 0-4.346-6.066A9.739 9.739 0 0 0 12.774 1.5h-.035z' }),
        _react2.default.createElement('circle', { cx: '12.755', cy: '15.375', r: '1.125' }),
        _react2.default.createElement('path', { d: 'M12.755 13.5a.75.75 0 0 1 0-1.5c1.241 0 2.25-1.009 2.25-2.25s-1.009-2.25-2.25-2.25-2.25 1.009-2.25 2.25a.75.75 0 0 1-1.5 0c0-2.068 1.682-3.75 3.75-3.75s3.75 1.682 3.75 3.75-1.683 3.75-3.75 3.75z' })
      ), height: undefined, width: undefined, viewBox: "0 0 24 24" });
    IconMessagesBubbleQuestion.displayName = 'IconMessagesBubbleQuestion';
    exports.default = IconMessagesBubbleQuestion;
    });

    var defaultValues = {
        disableItemScan: false,
        'activeFulfillmentLocationId': '',
        'adapter-getItem-url': '',
        allowConsoleV1: false,
        displayCarrierCapabilities: false,
        'customShip-enabled': false,
        'customShip-displayPrices': false,
        'customShip-displayReference': false,
        'customShip-displayNonContractPricing': false,
        'customShip-requestCustomsDetails': false,
        'customShip-rotateLabel': false,
        'customShip-resizeLabel': false,
        'customShip-defaultCountryCode': '',
        'customShip-sendEmailNotification': false,
        'customShip-uploadShipments': false,
        'defaults-enabled': false,
        'defaults-weight': '',
        'defaults-dimension1': '',
        'defaults-dimension2': '',
        'defaults-dimension3': '',
        disallowExpressOverride: false,
        hideShippingAddress: false,
        'supportEmailAddress-enabled': false,
        'supportEmailAddress': '',
        useBoxManBoxes: false,
        scanOnwards: false,
        'customShip-requestDimensions': false,
        'customShip-defaultWidth': '',
        'customShip-defaultHeight': '',
        'customShip-defaultDepth': '',
        'shippingConsoleAdapterV0-getItem': '',
        'shippingConsoleAdapterV0-packingRecommendations': '',
        'shippingConsoleAdapterV0-shipNotification': '',
        'shippingConsoleAdapterV0-cancelShipment': '',
        'shippingConsoleAdapterV0-shipmentPreferences': '',
        'maximumCartCost-maxCost': '',
        'maximumCartCost-currencyCode': '',
        resetPackaging: false,
        customMessage: '',
        disallowPDFLabels: false
    };
    var settingConfig = {
        disableItemScan: {
            displayLabel: 'Disable Item Scan',
            helpText: 'Disabled the item scan (ship) page in Shipping Console',
            type: 'boolean',
            visibility: 'LT',
            children: [
                'scanType',
                'defaults-enabled',
                'disallowExpressOverride',
                'hideShippingAddress',
                'maximumCartCost-enabled',
                'adapter-getItem-enabled',
                'shippingConsoleAdapterV0-enabled',
                'scanOnwards',
                'useBoxManBoxes',
                'displayCarrierCapabilities',
                'resetPackaging',
                'disallowPDFLabels'
            ],
            controlStyle: 'hide',
            controlType: 'inverted'
        },
        scanType: {
            helpText: 'Scan Item ID type in the Shipping Console',
            displayLabel: 'Scan Type',
            type: 'enum',
            parent: 'disableItemScan',
            options: ['fulfillerOrderId', 'fulfillerItemId', 'fulfillmentGroupId', 'itemId', 'merchantItemId', 'merchantOrderId', 'orderId', 'shortFulfillmentGroupId', 'shortItemId'],
            visibility: 'LT'
        },
        customMessage: {
            helpText: 'Custom Message to Display on the Shipping Console',
            visibility: 'all',
            type: 'textarea'
        },
        'defaults-enabled': {
            displayLabel: 'Set default values in Shipping Console',
            type: 'boolean',
            visibility: 'all',
            parent: 'disableItemScan',
            children: ['defaults-weight', 'defaults-dimension1', 'defaults-dimension2', 'defaults-dimension3'],
            controlStyle: 'hide',
            controlType: 'standard',
            controlStyling: 'child',
            doNotSend: true
        },
        'defaults-weight': {
            displayLabel: 'Weight',
            type: 'number',
            visibility: 'all',
            parent: 'defaults-enabled',
            locationUnit: 'weightUnits',
            required: false,
            validator: 'validateDefaults',
            outboundFormatter: 'formatOutboundDefault',
            inboundFormatter: 'formatInboundDefault'
        },
        'defaults-dimension1': {
            displayLabel: 'Dimension 1',
            type: 'number',
            visibility: 'all',
            parent: 'defaults-enabled',
            locationUnit: 'lengthUnits',
            required: false,
            validator: 'validateDefaults',
            outboundFormatter: 'formatOutboundDefault',
            inboundFormatter: 'formatInboundDefault'
        },
        'defaults-dimension2': {
            displayLabel: 'Dimension 2',
            type: 'number',
            visibility: 'all',
            parent: 'defaults-enabled',
            locationUnit: 'lengthUnits',
            required: false,
            validator: 'validateDefaults',
            outboundFormatter: 'formatOutboundDefault',
            inboundFormatter: 'formatInboundDefault'
        },
        'defaults-dimension3': {
            displayLabel: 'Dimension 3',
            type: 'number',
            visibility: 'all',
            parent: 'defaults-enabled',
            locationUnit: 'lengthUnits',
            required: false,
            validator: 'validateDefaults',
            outboundFormatter: 'formatOutboundDefault',
            inboundFormatter: 'formatInboundDefault'
        },
        disallowExpressOverride: {
            displayLabel: 'Disallow location from overriding carrier recommendation on late orders',
            type: 'boolean',
            visibility: 'all',
            parent: 'disableItemScan'
        },
        hideShippingAddress: {
            displayLabel: 'Hide the shipping address in the Shipping Console',
            type: 'boolean',
            visibility: 'LT',
            parent: 'disableItemScan'
        },
        'supportEmailAddress-enabled': {
            displayLabel: 'Use a different support email for errors in the Shipping Console',
            type: 'boolean',
            visibility: 'all',
            children: ['supportEmailAddress'],
            controlStyle: 'disable',
            controlType: 'standard',
            controlStyling: 'child',
            doNotSend: true
        },
        'supportEmailAddress': {
            helpText: 'Default email address is ShippingConsoleSupport@cimpress.com',
            displayLabel: 'Email Address',
            type: 'email',
            visibility: 'all',
            parent: 'supportEmailAddress-enabled',
            required: true,
            validator: 'checkSupportEmail'
        },
        disallowPDFLabels: {
            displayLabel: 'Disallow PDF labels',
            type: 'boolean',
            visibility: 'LT',
            parent: 'disableItemScan'
        },
        'maximumCartCost-enabled': {
            displayLabel: 'Set maximum cart cost',
            type: 'boolean',
            visibility: 'all',
            children: ['maximumCartCost-maxCost', 'maximumCartCost-currencyCode'],
            controlStyle: 'hide',
            controlType: 'standard',
            controlStyling: 'child',
            doNotSend: true,
            parent: 'disableItemScan'
        },
        'maximumCartCost-maxCost': {
            displayLabel: 'Maximum cost',
            parent: 'maximumCartCost-enabled',
            required: true,
            type: 'number',
            visibility: 'all'
        },
        'maximumCartCost-currencyCode': {
            displayLabel: 'Currency Code',
            parent: 'maximumCartCost-enabled',
            required: true,
            type: 'currencyCode',
            visibility: 'all'
        },
        'activeFulfillmentLocationId-enabled': {
            displayLabel: 'Set the default fulfillment location for a Logistics Location with multiple fulfillment locations',
            type: 'boolean',
            visibility: 'LT',
            children: ['activeFulfillmentLocationId'],
            controlStyle: 'hide',
            controlType: 'standard',
            controlStyling: 'child',
            doNotSend: true
        },
        'activeFulfillmentLocationId': {
            displayLabel: 'Fulfillment location id',
            parent: 'activeFulfillmentLocationId-enabled',
            required: true,
            type: 'fulfillmentLocationId',
            visibility: 'LT'
        },
        'apiIntegration-header': {
            displayLabel: 'API Integration',
            type: 'header',
            visibility: 'all'
        },
        'adapter-getItem-enabled': {
            displayLabel: 'Provide URL for retrieving (searching for) item information in the fulfiller information systems',
            type: 'boolean',
            visibility: 'all',
            children: ['adapter-getItem-url'],
            controlStyle: 'hide',
            controlType: 'standard',
            controlStyling: 'child',
            doNotSend: true,
            parent: 'disableItemScan'
        },
        'adapter-getItem-url': {
            displayLabel: 'Adapter getItem URL',
            parent: 'adapter-getItem-enabled',
            required: true,
            type: 'url',
            visibility: 'all'
        },
        'shippingConsoleAdapterV0-enabled': {
            displayLabel: 'Provide URLs for Shipping Console Adapter v0 configuration',
            type: 'boolean',
            visibility: 'all',
            children: ['shippingConsoleAdapterV0-getItem', 'shippingConsoleAdapterV0-packingRecommendations', 'shippingConsoleAdapterV0-shipNotification', 'shippingConsoleAdapterV0-cancelShipment', 'shippingConsoleAdapterV0-shipmentPreferences'],
            controlStyle: 'hide',
            controlType: 'standard',
            controlStyling: 'child',
            doNotSend: true,
            parent: 'disableItemScan'
        },
        'shippingConsoleAdapterV0-getItem': {
            displayLabel: 'Adapter getItem URL',
            parent: 'shippingConsoleAdapterV0-enabled',
            required: true,
            type: 'url',
            visibility: 'all'
        },
        'shippingConsoleAdapterV0-packingRecommendations': {
            displayLabel: 'Adapter packing recommendations URL',
            parent: 'shippingConsoleAdapterV0-enabled',
            required: false,
            type: 'url',
            visibility: 'all'
        },
        'shippingConsoleAdapterV0-shipNotification': {
            displayLabel: 'Adapter shipNotification URL',
            parent: 'shippingConsoleAdapterV0-enabled',
            required: false,
            type: 'url',
            visibility: 'all'
        },
        'shippingConsoleAdapterV0-cancelShipment': {
            displayLabel: 'Adapter cancelShipment URL',
            parent: 'shippingConsoleAdapterV0-enabled',
            required: false,
            type: 'url',
            visibility: 'all'
        },
        'shippingConsoleAdapterV0-shipmentPreferences': {
            displayLabel: 'Adapter shipment preferences URL',
            parent: 'shippingConsoleAdapterV0-enabled',
            required: false,
            type: 'url',
            visibility: 'all'
        },
        'internal-header': {
            displayLabel: 'Internal',
            type: 'header',
            visibility: 'LT'
        },
        scanOnwards: {
            displayLabel: 'This location will be used for shipping existing packages to onward destinations',
            type: 'boolean',
            visibility: 'LT',
            parent: 'disableItemScan'
        },
        allowConsoleV1: {
            displayLabel: 'Allow users to use Shipping Console v1',
            type: 'boolean',
            visibility: 'LT'
        },
        useBoxManBoxes: {
            displayLabel: 'Integrate with Shipping Box Manager',
            type: 'boolean',
            visibility: 'LT',
            parent: 'disableItemScan'
        },
        displayCarrierCapabilities: {
            displayLabel: 'Enable Carrier Service Capabilites',
            type: 'boolean',
            visibility: 'LT',
            parent: 'disableItemScan'
        },
        resetPackaging: {
            displayLabel: 'Allow user to put all items in one box',
            type: 'boolean',
            visibility: 'LT',
            parent: 'disableItemScan'
        },
        'customShip-header': {
            displayLabel: 'Custom Shipment',
            type: 'header',
            visibility: 'all'
        },
        'customShip-enabled': {
            displayLabel: 'Use Custom Shipments for this location',
            type: 'boolean',
            visibility: 'all',
            children: [
                'customShip-displayPrices',
                'customShip-displayReference',
                'customShip-displayNonContractPricing',
                'customShip-requestCustomsDetails',
                'customShip-requestDimensions',
                'customShip-defaultWidth',
                'customShip-defaultHeight',
                'customShip-defaultDepth',
                'customShip-rotateLabel',
                'customShip-resizeLabel',
                'customShip-sendEmailNotification',
                'customShip-defaultCountryEnabled',
                'customShip-defaultCountryCode',
                'customShip-uploadShipments',
            ],
            controlStyle: 'hide',
            controlType: 'standard',
            controlStyling: 'child'
        },
        'customShip-displayPrices': {
            displayLabel: 'Display shipping prices',
            type: 'boolean',
            visibility: 'LT',
            parent: 'customShip-enabled'
        },
        'customShip-displayReference': {
            displayLabel: 'Display shipping reference field',
            type: 'boolean',
            visibility: 'LT',
            parent: 'customShip-enabled'
        },
        'customShip-displayNonContractPricing': {
            displayLabel: 'Display non contract shipping prices',
            type: 'boolean',
            visibility: 'LT',
            parent: 'customShip-enabled'
        },
        'customShip-requestCustomsDetails': {
            displayLabel: 'Enable HTS codes for international shipping',
            type: 'boolean',
            visibility: 'LT',
            parent: 'customShip-enabled'
        },
        'customShip-requestDimensions': {
            displayLabel: 'Enable dimensions for custom ship.  Default dimensions, if desired, can be specified below:',
            type: 'boolean',
            visibility: 'LT',
            parent: 'customShip-enabled',
            children: ['customShip-defaultWidth', 'customShip-defaultHeight', 'customShip-defaultDepth'],
            controlStyle: 'hide',
            controlType: 'standard',
            controlStyling: 'child'
        },
        'customShip-defaultWidth': {
            displayLabel: 'Default package width',
            type: 'number',
            visibility: 'LT',
            parent: 'customShip-requestDimensions',
            locationUnit: 'lengthUnits'
        },
        'customShip-defaultHeight': {
            displayLabel: 'Default package height',
            type: 'number',
            visibility: 'LT',
            parent: 'customShip-requestDimensions',
            locationUnit: 'lengthUnits'
        },
        'customShip-defaultDepth': {
            displayLabel: 'Default package depth',
            type: 'number',
            visibility: 'LT',
            parent: 'customShip-requestDimensions',
            locationUnit: 'lengthUnits'
        },
        'customShip-rotateLabel': {
            displayLabel: 'Rotate the label 180 degrees',
            type: 'boolean',
            visibility: 'LT',
            parent: 'customShip-enabled'
        },
        'customShip-resizeLabel': {
            displayLabel: 'Resize the label to 8.5x11',
            type: 'boolean',
            visibility: 'LT',
            parent: 'customShip-enabled'
        },
        'customShip-sendEmailNotification': {
            displayLabel: 'Send email notification to user when shipment successful',
            type: 'boolean',
            visibility: 'all',
            parent: 'customShip-enabled'
        },
        'customShip-defaultCountryEnabled': {
            displayLabel: 'Set default country',
            parent: 'customShip-enabled',
            type: 'boolean',
            visibility: 'LT',
            children: ['customShip-defaultCountryCode'],
            controlStyle: 'hide',
            controlType: 'standard',
            controlStyling: 'child',
            doNotSend: true
        },
        'customShip-defaultCountryCode': {
            helpText: 'Please select a default country',
            displayLabel: 'Default country',
            parent: 'customShip-defaultCountryEnabled',
            required: true,
            type: 'countryCode',
            visibility: 'LT'
        },
        'customShip-uploadShipments': {
            displayLabel: 'Enabled use of the address list/spreadsheet upload',
            type: 'boolean',
            visibility: 'LT',
            parent: 'customShip-enabled'
        }
    };

    var lodash_merge = createCommonjsModule(function (module, exports) {
    /**
     * Lodash (Custom Build) <https://lodash.com/>
     * Build: `lodash modularize exports="npm" -o ./`
     * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
     * Released under MIT license <https://lodash.com/license>
     * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
     * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
     */

    /** Used as the size to enable large array optimizations. */
    var LARGE_ARRAY_SIZE = 200;

    /** Used to stand-in for `undefined` hash values. */
    var HASH_UNDEFINED = '__lodash_hash_undefined__';

    /** Used to detect hot functions by number of calls within a span of milliseconds. */
    var HOT_COUNT = 800,
        HOT_SPAN = 16;

    /** Used as references for various `Number` constants. */
    var MAX_SAFE_INTEGER = 9007199254740991;

    /** `Object#toString` result references. */
    var argsTag = '[object Arguments]',
        arrayTag = '[object Array]',
        asyncTag = '[object AsyncFunction]',
        boolTag = '[object Boolean]',
        dateTag = '[object Date]',
        errorTag = '[object Error]',
        funcTag = '[object Function]',
        genTag = '[object GeneratorFunction]',
        mapTag = '[object Map]',
        numberTag = '[object Number]',
        nullTag = '[object Null]',
        objectTag = '[object Object]',
        proxyTag = '[object Proxy]',
        regexpTag = '[object RegExp]',
        setTag = '[object Set]',
        stringTag = '[object String]',
        undefinedTag = '[object Undefined]',
        weakMapTag = '[object WeakMap]';

    var arrayBufferTag = '[object ArrayBuffer]',
        dataViewTag = '[object DataView]',
        float32Tag = '[object Float32Array]',
        float64Tag = '[object Float64Array]',
        int8Tag = '[object Int8Array]',
        int16Tag = '[object Int16Array]',
        int32Tag = '[object Int32Array]',
        uint8Tag = '[object Uint8Array]',
        uint8ClampedTag = '[object Uint8ClampedArray]',
        uint16Tag = '[object Uint16Array]',
        uint32Tag = '[object Uint32Array]';

    /**
     * Used to match `RegExp`
     * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
     */
    var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;

    /** Used to detect host constructors (Safari). */
    var reIsHostCtor = /^\[object .+?Constructor\]$/;

    /** Used to detect unsigned integer values. */
    var reIsUint = /^(?:0|[1-9]\d*)$/;

    /** Used to identify `toStringTag` values of typed arrays. */
    var typedArrayTags = {};
    typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
    typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
    typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
    typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
    typedArrayTags[uint32Tag] = true;
    typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
    typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
    typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
    typedArrayTags[errorTag] = typedArrayTags[funcTag] =
    typedArrayTags[mapTag] = typedArrayTags[numberTag] =
    typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
    typedArrayTags[setTag] = typedArrayTags[stringTag] =
    typedArrayTags[weakMapTag] = false;

    /** Detect free variable `global` from Node.js. */
    var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;

    /** Detect free variable `self`. */
    var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

    /** Used as a reference to the global object. */
    var root = freeGlobal || freeSelf || Function('return this')();

    /** Detect free variable `exports`. */
    var freeExports =  exports && !exports.nodeType && exports;

    /** Detect free variable `module`. */
    var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;

    /** Detect the popular CommonJS extension `module.exports`. */
    var moduleExports = freeModule && freeModule.exports === freeExports;

    /** Detect free variable `process` from Node.js. */
    var freeProcess = moduleExports && freeGlobal.process;

    /** Used to access faster Node.js helpers. */
    var nodeUtil = (function() {
      try {
        // Use `util.types` for Node.js 10+.
        var types = freeModule && freeModule.require && freeModule.require('util').types;

        if (types) {
          return types;
        }

        // Legacy `process.binding('util')` for Node.js < 10.
        return freeProcess && freeProcess.binding && freeProcess.binding('util');
      } catch (e) {}
    }());

    /* Node.js helper references. */
    var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;

    /**
     * A faster alternative to `Function#apply`, this function invokes `func`
     * with the `this` binding of `thisArg` and the arguments of `args`.
     *
     * @private
     * @param {Function} func The function to invoke.
     * @param {*} thisArg The `this` binding of `func`.
     * @param {Array} args The arguments to invoke `func` with.
     * @returns {*} Returns the result of `func`.
     */
    function apply(func, thisArg, args) {
      switch (args.length) {
        case 0: return func.call(thisArg);
        case 1: return func.call(thisArg, args[0]);
        case 2: return func.call(thisArg, args[0], args[1]);
        case 3: return func.call(thisArg, args[0], args[1], args[2]);
      }
      return func.apply(thisArg, args);
    }

    /**
     * The base implementation of `_.times` without support for iteratee shorthands
     * or max array length checks.
     *
     * @private
     * @param {number} n The number of times to invoke `iteratee`.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array} Returns the array of results.
     */
    function baseTimes(n, iteratee) {
      var index = -1,
          result = Array(n);

      while (++index < n) {
        result[index] = iteratee(index);
      }
      return result;
    }

    /**
     * The base implementation of `_.unary` without support for storing metadata.
     *
     * @private
     * @param {Function} func The function to cap arguments for.
     * @returns {Function} Returns the new capped function.
     */
    function baseUnary(func) {
      return function(value) {
        return func(value);
      };
    }

    /**
     * Gets the value at `key` of `object`.
     *
     * @private
     * @param {Object} [object] The object to query.
     * @param {string} key The key of the property to get.
     * @returns {*} Returns the property value.
     */
    function getValue(object, key) {
      return object == null ? undefined : object[key];
    }

    /**
     * Creates a unary function that invokes `func` with its argument transformed.
     *
     * @private
     * @param {Function} func The function to wrap.
     * @param {Function} transform The argument transform.
     * @returns {Function} Returns the new function.
     */
    function overArg(func, transform) {
      return function(arg) {
        return func(transform(arg));
      };
    }

    /** Used for built-in method references. */
    var arrayProto = Array.prototype,
        funcProto = Function.prototype,
        objectProto = Object.prototype;

    /** Used to detect overreaching core-js shims. */
    var coreJsData = root['__core-js_shared__'];

    /** Used to resolve the decompiled source of functions. */
    var funcToString = funcProto.toString;

    /** Used to check objects for own properties. */
    var hasOwnProperty = objectProto.hasOwnProperty;

    /** Used to detect methods masquerading as native. */
    var maskSrcKey = (function() {
      var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
      return uid ? ('Symbol(src)_1.' + uid) : '';
    }());

    /**
     * Used to resolve the
     * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
     * of values.
     */
    var nativeObjectToString = objectProto.toString;

    /** Used to infer the `Object` constructor. */
    var objectCtorString = funcToString.call(Object);

    /** Used to detect if a method is native. */
    var reIsNative = RegExp('^' +
      funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
      .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
    );

    /** Built-in value references. */
    var Buffer = moduleExports ? root.Buffer : undefined,
        Symbol = root.Symbol,
        Uint8Array = root.Uint8Array,
        allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
        getPrototype = overArg(Object.getPrototypeOf, Object),
        objectCreate = Object.create,
        propertyIsEnumerable = objectProto.propertyIsEnumerable,
        splice = arrayProto.splice,
        symToStringTag = Symbol ? Symbol.toStringTag : undefined;

    var defineProperty = (function() {
      try {
        var func = getNative(Object, 'defineProperty');
        func({}, '', {});
        return func;
      } catch (e) {}
    }());

    /* Built-in method references for those with the same name as other `lodash` methods. */
    var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
        nativeMax = Math.max,
        nativeNow = Date.now;

    /* Built-in method references that are verified to be native. */
    var Map = getNative(root, 'Map'),
        nativeCreate = getNative(Object, 'create');

    /**
     * The base implementation of `_.create` without support for assigning
     * properties to the created object.
     *
     * @private
     * @param {Object} proto The object to inherit from.
     * @returns {Object} Returns the new object.
     */
    var baseCreate = (function() {
      function object() {}
      return function(proto) {
        if (!isObject(proto)) {
          return {};
        }
        if (objectCreate) {
          return objectCreate(proto);
        }
        object.prototype = proto;
        var result = new object;
        object.prototype = undefined;
        return result;
      };
    }());

    /**
     * Creates a hash object.
     *
     * @private
     * @constructor
     * @param {Array} [entries] The key-value pairs to cache.
     */
    function Hash(entries) {
      var index = -1,
          length = entries == null ? 0 : entries.length;

      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }

    /**
     * Removes all key-value entries from the hash.
     *
     * @private
     * @name clear
     * @memberOf Hash
     */
    function hashClear() {
      this.__data__ = nativeCreate ? nativeCreate(null) : {};
      this.size = 0;
    }

    /**
     * Removes `key` and its value from the hash.
     *
     * @private
     * @name delete
     * @memberOf Hash
     * @param {Object} hash The hash to modify.
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
     */
    function hashDelete(key) {
      var result = this.has(key) && delete this.__data__[key];
      this.size -= result ? 1 : 0;
      return result;
    }

    /**
     * Gets the hash value for `key`.
     *
     * @private
     * @name get
     * @memberOf Hash
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the entry value.
     */
    function hashGet(key) {
      var data = this.__data__;
      if (nativeCreate) {
        var result = data[key];
        return result === HASH_UNDEFINED ? undefined : result;
      }
      return hasOwnProperty.call(data, key) ? data[key] : undefined;
    }

    /**
     * Checks if a hash value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf Hash
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function hashHas(key) {
      var data = this.__data__;
      return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
    }

    /**
     * Sets the hash `key` to `value`.
     *
     * @private
     * @name set
     * @memberOf Hash
     * @param {string} key The key of the value to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns the hash instance.
     */
    function hashSet(key, value) {
      var data = this.__data__;
      this.size += this.has(key) ? 0 : 1;
      data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
      return this;
    }

    // Add methods to `Hash`.
    Hash.prototype.clear = hashClear;
    Hash.prototype['delete'] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;

    /**
     * Creates an list cache object.
     *
     * @private
     * @constructor
     * @param {Array} [entries] The key-value pairs to cache.
     */
    function ListCache(entries) {
      var index = -1,
          length = entries == null ? 0 : entries.length;

      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }

    /**
     * Removes all key-value entries from the list cache.
     *
     * @private
     * @name clear
     * @memberOf ListCache
     */
    function listCacheClear() {
      this.__data__ = [];
      this.size = 0;
    }

    /**
     * Removes `key` and its value from the list cache.
     *
     * @private
     * @name delete
     * @memberOf ListCache
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
     */
    function listCacheDelete(key) {
      var data = this.__data__,
          index = assocIndexOf(data, key);

      if (index < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index == lastIndex) {
        data.pop();
      } else {
        splice.call(data, index, 1);
      }
      --this.size;
      return true;
    }

    /**
     * Gets the list cache value for `key`.
     *
     * @private
     * @name get
     * @memberOf ListCache
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the entry value.
     */
    function listCacheGet(key) {
      var data = this.__data__,
          index = assocIndexOf(data, key);

      return index < 0 ? undefined : data[index][1];
    }

    /**
     * Checks if a list cache value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf ListCache
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function listCacheHas(key) {
      return assocIndexOf(this.__data__, key) > -1;
    }

    /**
     * Sets the list cache `key` to `value`.
     *
     * @private
     * @name set
     * @memberOf ListCache
     * @param {string} key The key of the value to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns the list cache instance.
     */
    function listCacheSet(key, value) {
      var data = this.__data__,
          index = assocIndexOf(data, key);

      if (index < 0) {
        ++this.size;
        data.push([key, value]);
      } else {
        data[index][1] = value;
      }
      return this;
    }

    // Add methods to `ListCache`.
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype['delete'] = listCacheDelete;
    ListCache.prototype.get = listCacheGet;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet;

    /**
     * Creates a map cache object to store key-value pairs.
     *
     * @private
     * @constructor
     * @param {Array} [entries] The key-value pairs to cache.
     */
    function MapCache(entries) {
      var index = -1,
          length = entries == null ? 0 : entries.length;

      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }

    /**
     * Removes all key-value entries from the map.
     *
     * @private
     * @name clear
     * @memberOf MapCache
     */
    function mapCacheClear() {
      this.size = 0;
      this.__data__ = {
        'hash': new Hash,
        'map': new (Map || ListCache),
        'string': new Hash
      };
    }

    /**
     * Removes `key` and its value from the map.
     *
     * @private
     * @name delete
     * @memberOf MapCache
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
     */
    function mapCacheDelete(key) {
      var result = getMapData(this, key)['delete'](key);
      this.size -= result ? 1 : 0;
      return result;
    }

    /**
     * Gets the map value for `key`.
     *
     * @private
     * @name get
     * @memberOf MapCache
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the entry value.
     */
    function mapCacheGet(key) {
      return getMapData(this, key).get(key);
    }

    /**
     * Checks if a map value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf MapCache
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function mapCacheHas(key) {
      return getMapData(this, key).has(key);
    }

    /**
     * Sets the map `key` to `value`.
     *
     * @private
     * @name set
     * @memberOf MapCache
     * @param {string} key The key of the value to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns the map cache instance.
     */
    function mapCacheSet(key, value) {
      var data = getMapData(this, key),
          size = data.size;

      data.set(key, value);
      this.size += data.size == size ? 0 : 1;
      return this;
    }

    // Add methods to `MapCache`.
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype['delete'] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;

    /**
     * Creates a stack cache object to store key-value pairs.
     *
     * @private
     * @constructor
     * @param {Array} [entries] The key-value pairs to cache.
     */
    function Stack(entries) {
      var data = this.__data__ = new ListCache(entries);
      this.size = data.size;
    }

    /**
     * Removes all key-value entries from the stack.
     *
     * @private
     * @name clear
     * @memberOf Stack
     */
    function stackClear() {
      this.__data__ = new ListCache;
      this.size = 0;
    }

    /**
     * Removes `key` and its value from the stack.
     *
     * @private
     * @name delete
     * @memberOf Stack
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed, else `false`.
     */
    function stackDelete(key) {
      var data = this.__data__,
          result = data['delete'](key);

      this.size = data.size;
      return result;
    }

    /**
     * Gets the stack value for `key`.
     *
     * @private
     * @name get
     * @memberOf Stack
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the entry value.
     */
    function stackGet(key) {
      return this.__data__.get(key);
    }

    /**
     * Checks if a stack value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf Stack
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function stackHas(key) {
      return this.__data__.has(key);
    }

    /**
     * Sets the stack `key` to `value`.
     *
     * @private
     * @name set
     * @memberOf Stack
     * @param {string} key The key of the value to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns the stack cache instance.
     */
    function stackSet(key, value) {
      var data = this.__data__;
      if (data instanceof ListCache) {
        var pairs = data.__data__;
        if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
          pairs.push([key, value]);
          this.size = ++data.size;
          return this;
        }
        data = this.__data__ = new MapCache(pairs);
      }
      data.set(key, value);
      this.size = data.size;
      return this;
    }

    // Add methods to `Stack`.
    Stack.prototype.clear = stackClear;
    Stack.prototype['delete'] = stackDelete;
    Stack.prototype.get = stackGet;
    Stack.prototype.has = stackHas;
    Stack.prototype.set = stackSet;

    /**
     * Creates an array of the enumerable property names of the array-like `value`.
     *
     * @private
     * @param {*} value The value to query.
     * @param {boolean} inherited Specify returning inherited property names.
     * @returns {Array} Returns the array of property names.
     */
    function arrayLikeKeys(value, inherited) {
      var isArr = isArray(value),
          isArg = !isArr && isArguments(value),
          isBuff = !isArr && !isArg && isBuffer(value),
          isType = !isArr && !isArg && !isBuff && isTypedArray(value),
          skipIndexes = isArr || isArg || isBuff || isType,
          result = skipIndexes ? baseTimes(value.length, String) : [],
          length = result.length;

      for (var key in value) {
        if ((inherited || hasOwnProperty.call(value, key)) &&
            !(skipIndexes && (
               // Safari 9 has enumerable `arguments.length` in strict mode.
               key == 'length' ||
               // Node.js 0.10 has enumerable non-index properties on buffers.
               (isBuff && (key == 'offset' || key == 'parent')) ||
               // PhantomJS 2 has enumerable non-index properties on typed arrays.
               (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
               // Skip index properties.
               isIndex(key, length)
            ))) {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * This function is like `assignValue` except that it doesn't assign
     * `undefined` values.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {string} key The key of the property to assign.
     * @param {*} value The value to assign.
     */
    function assignMergeValue(object, key, value) {
      if ((value !== undefined && !eq(object[key], value)) ||
          (value === undefined && !(key in object))) {
        baseAssignValue(object, key, value);
      }
    }

    /**
     * Assigns `value` to `key` of `object` if the existing value is not equivalent
     * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {string} key The key of the property to assign.
     * @param {*} value The value to assign.
     */
    function assignValue(object, key, value) {
      var objValue = object[key];
      if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
          (value === undefined && !(key in object))) {
        baseAssignValue(object, key, value);
      }
    }

    /**
     * Gets the index at which the `key` is found in `array` of key-value pairs.
     *
     * @private
     * @param {Array} array The array to inspect.
     * @param {*} key The key to search for.
     * @returns {number} Returns the index of the matched value, else `-1`.
     */
    function assocIndexOf(array, key) {
      var length = array.length;
      while (length--) {
        if (eq(array[length][0], key)) {
          return length;
        }
      }
      return -1;
    }

    /**
     * The base implementation of `assignValue` and `assignMergeValue` without
     * value checks.
     *
     * @private
     * @param {Object} object The object to modify.
     * @param {string} key The key of the property to assign.
     * @param {*} value The value to assign.
     */
    function baseAssignValue(object, key, value) {
      if (key == '__proto__' && defineProperty) {
        defineProperty(object, key, {
          'configurable': true,
          'enumerable': true,
          'value': value,
          'writable': true
        });
      } else {
        object[key] = value;
      }
    }

    /**
     * The base implementation of `baseForOwn` which iterates over `object`
     * properties returned by `keysFunc` and invokes `iteratee` for each property.
     * Iteratee functions may exit iteration early by explicitly returning `false`.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {Function} keysFunc The function to get the keys of `object`.
     * @returns {Object} Returns `object`.
     */
    var baseFor = createBaseFor();

    /**
     * The base implementation of `getTag` without fallbacks for buggy environments.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the `toStringTag`.
     */
    function baseGetTag(value) {
      if (value == null) {
        return value === undefined ? undefinedTag : nullTag;
      }
      return (symToStringTag && symToStringTag in Object(value))
        ? getRawTag(value)
        : objectToString(value);
    }

    /**
     * The base implementation of `_.isArguments`.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an `arguments` object,
     */
    function baseIsArguments(value) {
      return isObjectLike(value) && baseGetTag(value) == argsTag;
    }

    /**
     * The base implementation of `_.isNative` without bad shim checks.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a native function,
     *  else `false`.
     */
    function baseIsNative(value) {
      if (!isObject(value) || isMasked(value)) {
        return false;
      }
      var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
      return pattern.test(toSource(value));
    }

    /**
     * The base implementation of `_.isTypedArray` without Node.js optimizations.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
     */
    function baseIsTypedArray(value) {
      return isObjectLike(value) &&
        isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
    }

    /**
     * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     */
    function baseKeysIn(object) {
      if (!isObject(object)) {
        return nativeKeysIn(object);
      }
      var isProto = isPrototype(object),
          result = [];

      for (var key in object) {
        if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.merge` without support for multiple sources.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @param {number} srcIndex The index of `source`.
     * @param {Function} [customizer] The function to customize merged values.
     * @param {Object} [stack] Tracks traversed source values and their merged
     *  counterparts.
     */
    function baseMerge(object, source, srcIndex, customizer, stack) {
      if (object === source) {
        return;
      }
      baseFor(source, function(srcValue, key) {
        stack || (stack = new Stack);
        if (isObject(srcValue)) {
          baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
        }
        else {
          var newValue = customizer
            ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
            : undefined;

          if (newValue === undefined) {
            newValue = srcValue;
          }
          assignMergeValue(object, key, newValue);
        }
      }, keysIn);
    }

    /**
     * A specialized version of `baseMerge` for arrays and objects which performs
     * deep merges and tracks traversed objects enabling objects with circular
     * references to be merged.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @param {string} key The key of the value to merge.
     * @param {number} srcIndex The index of `source`.
     * @param {Function} mergeFunc The function to merge values.
     * @param {Function} [customizer] The function to customize assigned values.
     * @param {Object} [stack] Tracks traversed source values and their merged
     *  counterparts.
     */
    function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
      var objValue = safeGet(object, key),
          srcValue = safeGet(source, key),
          stacked = stack.get(srcValue);

      if (stacked) {
        assignMergeValue(object, key, stacked);
        return;
      }
      var newValue = customizer
        ? customizer(objValue, srcValue, (key + ''), object, source, stack)
        : undefined;

      var isCommon = newValue === undefined;

      if (isCommon) {
        var isArr = isArray(srcValue),
            isBuff = !isArr && isBuffer(srcValue),
            isTyped = !isArr && !isBuff && isTypedArray(srcValue);

        newValue = srcValue;
        if (isArr || isBuff || isTyped) {
          if (isArray(objValue)) {
            newValue = objValue;
          }
          else if (isArrayLikeObject(objValue)) {
            newValue = copyArray(objValue);
          }
          else if (isBuff) {
            isCommon = false;
            newValue = cloneBuffer(srcValue, true);
          }
          else if (isTyped) {
            isCommon = false;
            newValue = cloneTypedArray(srcValue, true);
          }
          else {
            newValue = [];
          }
        }
        else if (isPlainObject(srcValue) || isArguments(srcValue)) {
          newValue = objValue;
          if (isArguments(objValue)) {
            newValue = toPlainObject(objValue);
          }
          else if (!isObject(objValue) || isFunction(objValue)) {
            newValue = initCloneObject(srcValue);
          }
        }
        else {
          isCommon = false;
        }
      }
      if (isCommon) {
        // Recursively merge objects and arrays (susceptible to call stack limits).
        stack.set(srcValue, newValue);
        mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
        stack['delete'](srcValue);
      }
      assignMergeValue(object, key, newValue);
    }

    /**
     * The base implementation of `_.rest` which doesn't validate or coerce arguments.
     *
     * @private
     * @param {Function} func The function to apply a rest parameter to.
     * @param {number} [start=func.length-1] The start position of the rest parameter.
     * @returns {Function} Returns the new function.
     */
    function baseRest(func, start) {
      return setToString(overRest(func, start, identity), func + '');
    }

    /**
     * The base implementation of `setToString` without support for hot loop shorting.
     *
     * @private
     * @param {Function} func The function to modify.
     * @param {Function} string The `toString` result.
     * @returns {Function} Returns `func`.
     */
    var baseSetToString = !defineProperty ? identity : function(func, string) {
      return defineProperty(func, 'toString', {
        'configurable': true,
        'enumerable': false,
        'value': constant(string),
        'writable': true
      });
    };

    /**
     * Creates a clone of  `buffer`.
     *
     * @private
     * @param {Buffer} buffer The buffer to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @returns {Buffer} Returns the cloned buffer.
     */
    function cloneBuffer(buffer, isDeep) {
      if (isDeep) {
        return buffer.slice();
      }
      var length = buffer.length,
          result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);

      buffer.copy(result);
      return result;
    }

    /**
     * Creates a clone of `arrayBuffer`.
     *
     * @private
     * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
     * @returns {ArrayBuffer} Returns the cloned array buffer.
     */
    function cloneArrayBuffer(arrayBuffer) {
      var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
      new Uint8Array(result).set(new Uint8Array(arrayBuffer));
      return result;
    }

    /**
     * Creates a clone of `typedArray`.
     *
     * @private
     * @param {Object} typedArray The typed array to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @returns {Object} Returns the cloned typed array.
     */
    function cloneTypedArray(typedArray, isDeep) {
      var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
      return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
    }

    /**
     * Copies the values of `source` to `array`.
     *
     * @private
     * @param {Array} source The array to copy values from.
     * @param {Array} [array=[]] The array to copy values to.
     * @returns {Array} Returns `array`.
     */
    function copyArray(source, array) {
      var index = -1,
          length = source.length;

      array || (array = Array(length));
      while (++index < length) {
        array[index] = source[index];
      }
      return array;
    }

    /**
     * Copies properties of `source` to `object`.
     *
     * @private
     * @param {Object} source The object to copy properties from.
     * @param {Array} props The property identifiers to copy.
     * @param {Object} [object={}] The object to copy properties to.
     * @param {Function} [customizer] The function to customize copied values.
     * @returns {Object} Returns `object`.
     */
    function copyObject(source, props, object, customizer) {
      var isNew = !object;
      object || (object = {});

      var index = -1,
          length = props.length;

      while (++index < length) {
        var key = props[index];

        var newValue = customizer
          ? customizer(object[key], source[key], key, object, source)
          : undefined;

        if (newValue === undefined) {
          newValue = source[key];
        }
        if (isNew) {
          baseAssignValue(object, key, newValue);
        } else {
          assignValue(object, key, newValue);
        }
      }
      return object;
    }

    /**
     * Creates a function like `_.assign`.
     *
     * @private
     * @param {Function} assigner The function to assign values.
     * @returns {Function} Returns the new assigner function.
     */
    function createAssigner(assigner) {
      return baseRest(function(object, sources) {
        var index = -1,
            length = sources.length,
            customizer = length > 1 ? sources[length - 1] : undefined,
            guard = length > 2 ? sources[2] : undefined;

        customizer = (assigner.length > 3 && typeof customizer == 'function')
          ? (length--, customizer)
          : undefined;

        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          customizer = length < 3 ? undefined : customizer;
          length = 1;
        }
        object = Object(object);
        while (++index < length) {
          var source = sources[index];
          if (source) {
            assigner(object, source, index, customizer);
          }
        }
        return object;
      });
    }

    /**
     * Creates a base function for methods like `_.forIn` and `_.forOwn`.
     *
     * @private
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new base function.
     */
    function createBaseFor(fromRight) {
      return function(object, iteratee, keysFunc) {
        var index = -1,
            iterable = Object(object),
            props = keysFunc(object),
            length = props.length;

        while (length--) {
          var key = props[fromRight ? length : ++index];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object;
      };
    }

    /**
     * Gets the data for `map`.
     *
     * @private
     * @param {Object} map The map to query.
     * @param {string} key The reference key.
     * @returns {*} Returns the map data.
     */
    function getMapData(map, key) {
      var data = map.__data__;
      return isKeyable(key)
        ? data[typeof key == 'string' ? 'string' : 'hash']
        : data.map;
    }

    /**
     * Gets the native function at `key` of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {string} key The key of the method to get.
     * @returns {*} Returns the function if it's native, else `undefined`.
     */
    function getNative(object, key) {
      var value = getValue(object, key);
      return baseIsNative(value) ? value : undefined;
    }

    /**
     * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
     *
     * @private
     * @param {*} value The value to query.
     * @returns {string} Returns the raw `toStringTag`.
     */
    function getRawTag(value) {
      var isOwn = hasOwnProperty.call(value, symToStringTag),
          tag = value[symToStringTag];

      try {
        value[symToStringTag] = undefined;
        var unmasked = true;
      } catch (e) {}

      var result = nativeObjectToString.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag] = tag;
        } else {
          delete value[symToStringTag];
        }
      }
      return result;
    }

    /**
     * Initializes an object clone.
     *
     * @private
     * @param {Object} object The object to clone.
     * @returns {Object} Returns the initialized clone.
     */
    function initCloneObject(object) {
      return (typeof object.constructor == 'function' && !isPrototype(object))
        ? baseCreate(getPrototype(object))
        : {};
    }

    /**
     * Checks if `value` is a valid array-like index.
     *
     * @private
     * @param {*} value The value to check.
     * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
     * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
     */
    function isIndex(value, length) {
      var type = typeof value;
      length = length == null ? MAX_SAFE_INTEGER : length;

      return !!length &&
        (type == 'number' ||
          (type != 'symbol' && reIsUint.test(value))) &&
            (value > -1 && value % 1 == 0 && value < length);
    }

    /**
     * Checks if the given arguments are from an iteratee call.
     *
     * @private
     * @param {*} value The potential iteratee value argument.
     * @param {*} index The potential iteratee index or key argument.
     * @param {*} object The potential iteratee object argument.
     * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
     *  else `false`.
     */
    function isIterateeCall(value, index, object) {
      if (!isObject(object)) {
        return false;
      }
      var type = typeof index;
      if (type == 'number'
            ? (isArrayLike(object) && isIndex(index, object.length))
            : (type == 'string' && index in object)
          ) {
        return eq(object[index], value);
      }
      return false;
    }

    /**
     * Checks if `value` is suitable for use as unique object key.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
     */
    function isKeyable(value) {
      var type = typeof value;
      return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
        ? (value !== '__proto__')
        : (value === null);
    }

    /**
     * Checks if `func` has its source masked.
     *
     * @private
     * @param {Function} func The function to check.
     * @returns {boolean} Returns `true` if `func` is masked, else `false`.
     */
    function isMasked(func) {
      return !!maskSrcKey && (maskSrcKey in func);
    }

    /**
     * Checks if `value` is likely a prototype object.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
     */
    function isPrototype(value) {
      var Ctor = value && value.constructor,
          proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;

      return value === proto;
    }

    /**
     * This function is like
     * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
     * except that it includes inherited enumerable properties.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     */
    function nativeKeysIn(object) {
      var result = [];
      if (object != null) {
        for (var key in Object(object)) {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * Converts `value` to a string using `Object.prototype.toString`.
     *
     * @private
     * @param {*} value The value to convert.
     * @returns {string} Returns the converted string.
     */
    function objectToString(value) {
      return nativeObjectToString.call(value);
    }

    /**
     * A specialized version of `baseRest` which transforms the rest array.
     *
     * @private
     * @param {Function} func The function to apply a rest parameter to.
     * @param {number} [start=func.length-1] The start position of the rest parameter.
     * @param {Function} transform The rest array transform.
     * @returns {Function} Returns the new function.
     */
    function overRest(func, start, transform) {
      start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
      return function() {
        var args = arguments,
            index = -1,
            length = nativeMax(args.length - start, 0),
            array = Array(length);

        while (++index < length) {
          array[index] = args[start + index];
        }
        index = -1;
        var otherArgs = Array(start + 1);
        while (++index < start) {
          otherArgs[index] = args[index];
        }
        otherArgs[start] = transform(array);
        return apply(func, this, otherArgs);
      };
    }

    /**
     * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
     *
     * @private
     * @param {Object} object The object to query.
     * @param {string} key The key of the property to get.
     * @returns {*} Returns the property value.
     */
    function safeGet(object, key) {
      if (key === 'constructor' && typeof object[key] === 'function') {
        return;
      }

      if (key == '__proto__') {
        return;
      }

      return object[key];
    }

    /**
     * Sets the `toString` method of `func` to return `string`.
     *
     * @private
     * @param {Function} func The function to modify.
     * @param {Function} string The `toString` result.
     * @returns {Function} Returns `func`.
     */
    var setToString = shortOut(baseSetToString);

    /**
     * Creates a function that'll short out and invoke `identity` instead
     * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
     * milliseconds.
     *
     * @private
     * @param {Function} func The function to restrict.
     * @returns {Function} Returns the new shortable function.
     */
    function shortOut(func) {
      var count = 0,
          lastCalled = 0;

      return function() {
        var stamp = nativeNow(),
            remaining = HOT_SPAN - (stamp - lastCalled);

        lastCalled = stamp;
        if (remaining > 0) {
          if (++count >= HOT_COUNT) {
            return arguments[0];
          }
        } else {
          count = 0;
        }
        return func.apply(undefined, arguments);
      };
    }

    /**
     * Converts `func` to its source code.
     *
     * @private
     * @param {Function} func The function to convert.
     * @returns {string} Returns the source code.
     */
    function toSource(func) {
      if (func != null) {
        try {
          return funcToString.call(func);
        } catch (e) {}
        try {
          return (func + '');
        } catch (e) {}
      }
      return '';
    }

    /**
     * Performs a
     * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
     * comparison between two values to determine if they are equivalent.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
     * @example
     *
     * var object = { 'a': 1 };
     * var other = { 'a': 1 };
     *
     * _.eq(object, object);
     * // => true
     *
     * _.eq(object, other);
     * // => false
     *
     * _.eq('a', 'a');
     * // => true
     *
     * _.eq('a', Object('a'));
     * // => false
     *
     * _.eq(NaN, NaN);
     * // => true
     */
    function eq(value, other) {
      return value === other || (value !== value && other !== other);
    }

    /**
     * Checks if `value` is likely an `arguments` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an `arguments` object,
     *  else `false`.
     * @example
     *
     * _.isArguments(function() { return arguments; }());
     * // => true
     *
     * _.isArguments([1, 2, 3]);
     * // => false
     */
    var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
      return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
        !propertyIsEnumerable.call(value, 'callee');
    };

    /**
     * Checks if `value` is classified as an `Array` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an array, else `false`.
     * @example
     *
     * _.isArray([1, 2, 3]);
     * // => true
     *
     * _.isArray(document.body.children);
     * // => false
     *
     * _.isArray('abc');
     * // => false
     *
     * _.isArray(_.noop);
     * // => false
     */
    var isArray = Array.isArray;

    /**
     * Checks if `value` is array-like. A value is considered array-like if it's
     * not a function and has a `value.length` that's an integer greater than or
     * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
     * @example
     *
     * _.isArrayLike([1, 2, 3]);
     * // => true
     *
     * _.isArrayLike(document.body.children);
     * // => true
     *
     * _.isArrayLike('abc');
     * // => true
     *
     * _.isArrayLike(_.noop);
     * // => false
     */
    function isArrayLike(value) {
      return value != null && isLength(value.length) && !isFunction(value);
    }

    /**
     * This method is like `_.isArrayLike` except that it also checks if `value`
     * is an object.
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an array-like object,
     *  else `false`.
     * @example
     *
     * _.isArrayLikeObject([1, 2, 3]);
     * // => true
     *
     * _.isArrayLikeObject(document.body.children);
     * // => true
     *
     * _.isArrayLikeObject('abc');
     * // => false
     *
     * _.isArrayLikeObject(_.noop);
     * // => false
     */
    function isArrayLikeObject(value) {
      return isObjectLike(value) && isArrayLike(value);
    }

    /**
     * Checks if `value` is a buffer.
     *
     * @static
     * @memberOf _
     * @since 4.3.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
     * @example
     *
     * _.isBuffer(new Buffer(2));
     * // => true
     *
     * _.isBuffer(new Uint8Array(2));
     * // => false
     */
    var isBuffer = nativeIsBuffer || stubFalse;

    /**
     * Checks if `value` is classified as a `Function` object.
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a function, else `false`.
     * @example
     *
     * _.isFunction(_);
     * // => true
     *
     * _.isFunction(/abc/);
     * // => false
     */
    function isFunction(value) {
      if (!isObject(value)) {
        return false;
      }
      // The use of `Object#toString` avoids issues with the `typeof` operator
      // in Safari 9 which returns 'object' for typed arrays and other constructors.
      var tag = baseGetTag(value);
      return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
    }

    /**
     * Checks if `value` is a valid array-like length.
     *
     * **Note:** This method is loosely based on
     * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
     * @example
     *
     * _.isLength(3);
     * // => true
     *
     * _.isLength(Number.MIN_VALUE);
     * // => false
     *
     * _.isLength(Infinity);
     * // => false
     *
     * _.isLength('3');
     * // => false
     */
    function isLength(value) {
      return typeof value == 'number' &&
        value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
    }

    /**
     * Checks if `value` is the
     * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
     * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
     *
     * @static
     * @memberOf _
     * @since 0.1.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an object, else `false`.
     * @example
     *
     * _.isObject({});
     * // => true
     *
     * _.isObject([1, 2, 3]);
     * // => true
     *
     * _.isObject(_.noop);
     * // => true
     *
     * _.isObject(null);
     * // => false
     */
    function isObject(value) {
      var type = typeof value;
      return value != null && (type == 'object' || type == 'function');
    }

    /**
     * Checks if `value` is object-like. A value is object-like if it's not `null`
     * and has a `typeof` result of "object".
     *
     * @static
     * @memberOf _
     * @since 4.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
     * @example
     *
     * _.isObjectLike({});
     * // => true
     *
     * _.isObjectLike([1, 2, 3]);
     * // => true
     *
     * _.isObjectLike(_.noop);
     * // => false
     *
     * _.isObjectLike(null);
     * // => false
     */
    function isObjectLike(value) {
      return value != null && typeof value == 'object';
    }

    /**
     * Checks if `value` is a plain object, that is, an object created by the
     * `Object` constructor or one with a `[[Prototype]]` of `null`.
     *
     * @static
     * @memberOf _
     * @since 0.8.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     * }
     *
     * _.isPlainObject(new Foo);
     * // => false
     *
     * _.isPlainObject([1, 2, 3]);
     * // => false
     *
     * _.isPlainObject({ 'x': 0, 'y': 0 });
     * // => true
     *
     * _.isPlainObject(Object.create(null));
     * // => true
     */
    function isPlainObject(value) {
      if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
        return false;
      }
      var proto = getPrototype(value);
      if (proto === null) {
        return true;
      }
      var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
      return typeof Ctor == 'function' && Ctor instanceof Ctor &&
        funcToString.call(Ctor) == objectCtorString;
    }

    /**
     * Checks if `value` is classified as a typed array.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
     * @example
     *
     * _.isTypedArray(new Uint8Array);
     * // => true
     *
     * _.isTypedArray([]);
     * // => false
     */
    var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;

    /**
     * Converts `value` to a plain object flattening inherited enumerable string
     * keyed properties of `value` to own properties of the plain object.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {Object} Returns the converted plain object.
     * @example
     *
     * function Foo() {
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.assign({ 'a': 1 }, new Foo);
     * // => { 'a': 1, 'b': 2 }
     *
     * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
     * // => { 'a': 1, 'b': 2, 'c': 3 }
     */
    function toPlainObject(value) {
      return copyObject(value, keysIn(value));
    }

    /**
     * Creates an array of the own and inherited enumerable property names of `object`.
     *
     * **Note:** Non-object values are coerced to objects.
     *
     * @static
     * @memberOf _
     * @since 3.0.0
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.keysIn(new Foo);
     * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
     */
    function keysIn(object) {
      return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
    }

    /**
     * This method is like `_.assign` except that it recursively merges own and
     * inherited enumerable string keyed properties of source objects into the
     * destination object. Source properties that resolve to `undefined` are
     * skipped if a destination value exists. Array and plain object properties
     * are merged recursively. Other objects and value types are overridden by
     * assignment. Source objects are applied from left to right. Subsequent
     * sources overwrite property assignments of previous sources.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @since 0.5.0
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var object = {
     *   'a': [{ 'b': 2 }, { 'd': 4 }]
     * };
     *
     * var other = {
     *   'a': [{ 'c': 3 }, { 'e': 5 }]
     * };
     *
     * _.merge(object, other);
     * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
     */
    var merge = createAssigner(function(object, source, srcIndex) {
      baseMerge(object, source, srcIndex);
    });

    /**
     * Creates a function that returns `value`.
     *
     * @static
     * @memberOf _
     * @since 2.4.0
     * @category Util
     * @param {*} value The value to return from the new function.
     * @returns {Function} Returns the new constant function.
     * @example
     *
     * var objects = _.times(2, _.constant({ 'a': 1 }));
     *
     * console.log(objects);
     * // => [{ 'a': 1 }, { 'a': 1 }]
     *
     * console.log(objects[0] === objects[1]);
     * // => true
     */
    function constant(value) {
      return function() {
        return value;
      };
    }

    /**
     * This method returns the first argument it receives.
     *
     * @static
     * @since 0.1.0
     * @memberOf _
     * @category Util
     * @param {*} value Any value.
     * @returns {*} Returns `value`.
     * @example
     *
     * var object = { 'a': 1 };
     *
     * console.log(_.identity(object) === object);
     * // => true
     */
    function identity(value) {
      return value;
    }

    /**
     * This method returns `false`.
     *
     * @static
     * @memberOf _
     * @since 4.13.0
     * @category Util
     * @returns {boolean} Returns `false`.
     * @example
     *
     * _.times(2, _.stubFalse);
     * // => [false, false]
     */
    function stubFalse() {
      return false;
    }

    module.exports = merge;
    });

    var bind = function bind(fn, thisArg) {
      return function wrap() {
        var args = new Array(arguments.length);
        for (var i = 0; i < args.length; i++) {
          args[i] = arguments[i];
        }
        return fn.apply(thisArg, args);
      };
    };

    /*global toString:true*/

    // utils is a library of generic helper functions non-specific to axios

    var toString = Object.prototype.toString;

    /**
     * Determine if a value is an Array
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is an Array, otherwise false
     */
    function isArray(val) {
      return toString.call(val) === '[object Array]';
    }

    /**
     * Determine if a value is undefined
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if the value is undefined, otherwise false
     */
    function isUndefined(val) {
      return typeof val === 'undefined';
    }

    /**
     * Determine if a value is a Buffer
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Buffer, otherwise false
     */
    function isBuffer(val) {
      return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
        && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
    }

    /**
     * Determine if a value is an ArrayBuffer
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is an ArrayBuffer, otherwise false
     */
    function isArrayBuffer(val) {
      return toString.call(val) === '[object ArrayBuffer]';
    }

    /**
     * Determine if a value is a FormData
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is an FormData, otherwise false
     */
    function isFormData(val) {
      return (typeof FormData !== 'undefined') && (val instanceof FormData);
    }

    /**
     * Determine if a value is a view on an ArrayBuffer
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
     */
    function isArrayBufferView(val) {
      var result;
      if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
        result = ArrayBuffer.isView(val);
      } else {
        result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
      }
      return result;
    }

    /**
     * Determine if a value is a String
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a String, otherwise false
     */
    function isString(val) {
      return typeof val === 'string';
    }

    /**
     * Determine if a value is a Number
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Number, otherwise false
     */
    function isNumber(val) {
      return typeof val === 'number';
    }

    /**
     * Determine if a value is an Object
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is an Object, otherwise false
     */
    function isObject(val) {
      return val !== null && typeof val === 'object';
    }

    /**
     * Determine if a value is a plain Object
     *
     * @param {Object} val The value to test
     * @return {boolean} True if value is a plain Object, otherwise false
     */
    function isPlainObject(val) {
      if (toString.call(val) !== '[object Object]') {
        return false;
      }

      var prototype = Object.getPrototypeOf(val);
      return prototype === null || prototype === Object.prototype;
    }

    /**
     * Determine if a value is a Date
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Date, otherwise false
     */
    function isDate(val) {
      return toString.call(val) === '[object Date]';
    }

    /**
     * Determine if a value is a File
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a File, otherwise false
     */
    function isFile(val) {
      return toString.call(val) === '[object File]';
    }

    /**
     * Determine if a value is a Blob
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Blob, otherwise false
     */
    function isBlob(val) {
      return toString.call(val) === '[object Blob]';
    }

    /**
     * Determine if a value is a Function
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Function, otherwise false
     */
    function isFunction(val) {
      return toString.call(val) === '[object Function]';
    }

    /**
     * Determine if a value is a Stream
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a Stream, otherwise false
     */
    function isStream(val) {
      return isObject(val) && isFunction(val.pipe);
    }

    /**
     * Determine if a value is a URLSearchParams object
     *
     * @param {Object} val The value to test
     * @returns {boolean} True if value is a URLSearchParams object, otherwise false
     */
    function isURLSearchParams(val) {
      return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
    }

    /**
     * Trim excess whitespace off the beginning and end of a string
     *
     * @param {String} str The String to trim
     * @returns {String} The String freed of excess whitespace
     */
    function trim(str) {
      return str.replace(/^\s*/, '').replace(/\s*$/, '');
    }

    /**
     * Determine if we're running in a standard browser environment
     *
     * This allows axios to run in a web worker, and react-native.
     * Both environments support XMLHttpRequest, but not fully standard globals.
     *
     * web workers:
     *  typeof window -> undefined
     *  typeof document -> undefined
     *
     * react-native:
     *  navigator.product -> 'ReactNative'
     * nativescript
     *  navigator.product -> 'NativeScript' or 'NS'
     */
    function isStandardBrowserEnv() {
      if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
                                               navigator.product === 'NativeScript' ||
                                               navigator.product === 'NS')) {
        return false;
      }
      return (
        typeof window !== 'undefined' &&
        typeof document !== 'undefined'
      );
    }

    /**
     * Iterate over an Array or an Object invoking a function for each item.
     *
     * If `obj` is an Array callback will be called passing
     * the value, index, and complete array for each item.
     *
     * If 'obj' is an Object callback will be called passing
     * the value, key, and complete object for each property.
     *
     * @param {Object|Array} obj The object to iterate
     * @param {Function} fn The callback to invoke for each item
     */
    function forEach(obj, fn) {
      // Don't bother if no value provided
      if (obj === null || typeof obj === 'undefined') {
        return;
      }

      // Force an array if not already something iterable
      if (typeof obj !== 'object') {
        /*eslint no-param-reassign:0*/
        obj = [obj];
      }

      if (isArray(obj)) {
        // Iterate over array values
        for (var i = 0, l = obj.length; i < l; i++) {
          fn.call(null, obj[i], i, obj);
        }
      } else {
        // Iterate over object keys
        for (var key in obj) {
          if (Object.prototype.hasOwnProperty.call(obj, key)) {
            fn.call(null, obj[key], key, obj);
          }
        }
      }
    }

    /**
     * Accepts varargs expecting each argument to be an object, then
     * immutably merges the properties of each object and returns result.
     *
     * When multiple objects contain the same key the later object in
     * the arguments list will take precedence.
     *
     * Example:
     *
     * ```js
     * var result = merge({foo: 123}, {foo: 456});
     * console.log(result.foo); // outputs 456
     * ```
     *
     * @param {Object} obj1 Object to merge
     * @returns {Object} Result of all merge properties
     */
    function merge(/* obj1, obj2, obj3, ... */) {
      var result = {};
      function assignValue(val, key) {
        if (isPlainObject(result[key]) && isPlainObject(val)) {
          result[key] = merge(result[key], val);
        } else if (isPlainObject(val)) {
          result[key] = merge({}, val);
        } else if (isArray(val)) {
          result[key] = val.slice();
        } else {
          result[key] = val;
        }
      }

      for (var i = 0, l = arguments.length; i < l; i++) {
        forEach(arguments[i], assignValue);
      }
      return result;
    }

    /**
     * Extends object a by mutably adding to it the properties of object b.
     *
     * @param {Object} a The object to be extended
     * @param {Object} b The object to copy properties from
     * @param {Object} thisArg The object to bind function to
     * @return {Object} The resulting value of object a
     */
    function extend(a, b, thisArg) {
      forEach(b, function assignValue(val, key) {
        if (thisArg && typeof val === 'function') {
          a[key] = bind(val, thisArg);
        } else {
          a[key] = val;
        }
      });
      return a;
    }

    /**
     * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
     *
     * @param {string} content with BOM
     * @return {string} content value without BOM
     */
    function stripBOM(content) {
      if (content.charCodeAt(0) === 0xFEFF) {
        content = content.slice(1);
      }
      return content;
    }

    var utils = {
      isArray: isArray,
      isArrayBuffer: isArrayBuffer,
      isBuffer: isBuffer,
      isFormData: isFormData,
      isArrayBufferView: isArrayBufferView,
      isString: isString,
      isNumber: isNumber,
      isObject: isObject,
      isPlainObject: isPlainObject,
      isUndefined: isUndefined,
      isDate: isDate,
      isFile: isFile,
      isBlob: isBlob,
      isFunction: isFunction,
      isStream: isStream,
      isURLSearchParams: isURLSearchParams,
      isStandardBrowserEnv: isStandardBrowserEnv,
      forEach: forEach,
      merge: merge,
      extend: extend,
      trim: trim,
      stripBOM: stripBOM
    };

    function encode(val) {
      return encodeURIComponent(val).
        replace(/%3A/gi, ':').
        replace(/%24/g, '$').
        replace(/%2C/gi, ',').
        replace(/%20/g, '+').
        replace(/%5B/gi, '[').
        replace(/%5D/gi, ']');
    }

    /**
     * Build a URL by appending params to the end
     *
     * @param {string} url The base of the url (e.g., http://www.google.com)
     * @param {object} [params] The params to be appended
     * @returns {string} The formatted url
     */
    var buildURL = function buildURL(url, params, paramsSerializer) {
      /*eslint no-param-reassign:0*/
      if (!params) {
        return url;
      }

      var serializedParams;
      if (paramsSerializer) {
        serializedParams = paramsSerializer(params);
      } else if (utils.isURLSearchParams(params)) {
        serializedParams = params.toString();
      } else {
        var parts = [];

        utils.forEach(params, function serialize(val, key) {
          if (val === null || typeof val === 'undefined') {
            return;
          }

          if (utils.isArray(val)) {
            key = key + '[]';
          } else {
            val = [val];
          }

          utils.forEach(val, function parseValue(v) {
            if (utils.isDate(v)) {
              v = v.toISOString();
            } else if (utils.isObject(v)) {
              v = JSON.stringify(v);
            }
            parts.push(encode(key) + '=' + encode(v));
          });
        });

        serializedParams = parts.join('&');
      }

      if (serializedParams) {
        var hashmarkIndex = url.indexOf('#');
        if (hashmarkIndex !== -1) {
          url = url.slice(0, hashmarkIndex);
        }

        url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
      }

      return url;
    };

    function InterceptorManager() {
      this.handlers = [];
    }

    /**
     * Add a new interceptor to the stack
     *
     * @param {Function} fulfilled The function to handle `then` for a `Promise`
     * @param {Function} rejected The function to handle `reject` for a `Promise`
     *
     * @return {Number} An ID used to remove interceptor later
     */
    InterceptorManager.prototype.use = function use(fulfilled, rejected) {
      this.handlers.push({
        fulfilled: fulfilled,
        rejected: rejected
      });
      return this.handlers.length - 1;
    };

    /**
     * Remove an interceptor from the stack
     *
     * @param {Number} id The ID that was returned by `use`
     */
    InterceptorManager.prototype.eject = function eject(id) {
      if (this.handlers[id]) {
        this.handlers[id] = null;
      }
    };

    /**
     * Iterate over all the registered interceptors
     *
     * This method is particularly useful for skipping over any
     * interceptors that may have become `null` calling `eject`.
     *
     * @param {Function} fn The function to call for each interceptor
     */
    InterceptorManager.prototype.forEach = function forEach(fn) {
      utils.forEach(this.handlers, function forEachHandler(h) {
        if (h !== null) {
          fn(h);
        }
      });
    };

    var InterceptorManager_1 = InterceptorManager;

    /**
     * Transform the data for a request or a response
     *
     * @param {Object|String} data The data to be transformed
     * @param {Array} headers The headers for the request or response
     * @param {Array|Function} fns A single function or Array of functions
     * @returns {*} The resulting transformed data
     */
    var transformData = function transformData(data, headers, fns) {
      /*eslint no-param-reassign:0*/
      utils.forEach(fns, function transform(fn) {
        data = fn(data, headers);
      });

      return data;
    };

    var isCancel = function isCancel(value) {
      return !!(value && value.__CANCEL__);
    };

    var browser = createCommonjsModule(function (module) {
    // shim for using process in browser
    var process = module.exports = {};

    // cached from whatever global is present so that test runners that stub it
    // don't break things.  But we need to wrap it in a try catch in case it is
    // wrapped in strict mode code which doesn't define any globals.  It's inside a
    // function because try/catches deoptimize in certain engines.

    var cachedSetTimeout;
    var cachedClearTimeout;

    function defaultSetTimout() {
        throw new Error('setTimeout has not been defined');
    }
    function defaultClearTimeout () {
        throw new Error('clearTimeout has not been defined');
    }
    (function () {
        try {
            if (typeof setTimeout === 'function') {
                cachedSetTimeout = setTimeout;
            } else {
                cachedSetTimeout = defaultSetTimout;
            }
        } catch (e) {
            cachedSetTimeout = defaultSetTimout;
        }
        try {
            if (typeof clearTimeout === 'function') {
                cachedClearTimeout = clearTimeout;
            } else {
                cachedClearTimeout = defaultClearTimeout;
            }
        } catch (e) {
            cachedClearTimeout = defaultClearTimeout;
        }
    } ());
    function runTimeout(fun) {
        if (cachedSetTimeout === setTimeout) {
            //normal enviroments in sane situations
            return setTimeout(fun, 0);
        }
        // if setTimeout wasn't available but was latter defined
        if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
            cachedSetTimeout = setTimeout;
            return setTimeout(fun, 0);
        }
        try {
            // when when somebody has screwed with setTimeout but no I.E. maddness
            return cachedSetTimeout(fun, 0);
        } catch(e){
            try {
                // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
                return cachedSetTimeout.call(null, fun, 0);
            } catch(e){
                // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
                return cachedSetTimeout.call(this, fun, 0);
            }
        }


    }
    function runClearTimeout(marker) {
        if (cachedClearTimeout === clearTimeout) {
            //normal enviroments in sane situations
            return clearTimeout(marker);
        }
        // if clearTimeout wasn't available but was latter defined
        if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
            cachedClearTimeout = clearTimeout;
            return clearTimeout(marker);
        }
        try {
            // when when somebody has screwed with setTimeout but no I.E. maddness
            return cachedClearTimeout(marker);
        } catch (e){
            try {
                // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
                return cachedClearTimeout.call(null, marker);
            } catch (e){
                // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
                // Some versions of I.E. have different rules for clearTimeout vs setTimeout
                return cachedClearTimeout.call(this, marker);
            }
        }



    }
    var queue = [];
    var draining = false;
    var currentQueue;
    var queueIndex = -1;

    function cleanUpNextTick() {
        if (!draining || !currentQueue) {
            return;
        }
        draining = false;
        if (currentQueue.length) {
            queue = currentQueue.concat(queue);
        } else {
            queueIndex = -1;
        }
        if (queue.length) {
            drainQueue();
        }
    }

    function drainQueue() {
        if (draining) {
            return;
        }
        var timeout = runTimeout(cleanUpNextTick);
        draining = true;

        var len = queue.length;
        while(len) {
            currentQueue = queue;
            queue = [];
            while (++queueIndex < len) {
                if (currentQueue) {
                    currentQueue[queueIndex].run();
                }
            }
            queueIndex = -1;
            len = queue.length;
        }
        currentQueue = null;
        draining = false;
        runClearTimeout(timeout);
    }

    process.nextTick = function (fun) {
        var args = new Array(arguments.length - 1);
        if (arguments.length > 1) {
            for (var i = 1; i < arguments.length; i++) {
                args[i - 1] = arguments[i];
            }
        }
        queue.push(new Item(fun, args));
        if (queue.length === 1 && !draining) {
            runTimeout(drainQueue);
        }
    };

    // v8 likes predictible objects
    function Item(fun, array) {
        this.fun = fun;
        this.array = array;
    }
    Item.prototype.run = function () {
        this.fun.apply(null, this.array);
    };
    process.title = 'browser';
    process.browser = true;
    process.env = {};
    process.argv = [];
    process.version = ''; // empty string to avoid regexp issues
    process.versions = {};

    function noop() {}

    process.on = noop;
    process.addListener = noop;
    process.once = noop;
    process.off = noop;
    process.removeListener = noop;
    process.removeAllListeners = noop;
    process.emit = noop;
    process.prependListener = noop;
    process.prependOnceListener = noop;

    process.listeners = function (name) { return [] };

    process.binding = function (name) {
        throw new Error('process.binding is not supported');
    };

    process.cwd = function () { return '/' };
    process.chdir = function (dir) {
        throw new Error('process.chdir is not supported');
    };
    process.umask = function() { return 0; };
    });

    var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
      utils.forEach(headers, function processHeader(value, name) {
        if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
          headers[normalizedName] = value;
          delete headers[name];
        }
      });
    };

    /**
     * Update an Error with the specified config, error code, and response.
     *
     * @param {Error} error The error to update.
     * @param {Object} config The config.
     * @param {string} [code] The error code (for example, 'ECONNABORTED').
     * @param {Object} [request] The request.
     * @param {Object} [response] The response.
     * @returns {Error} The error.
     */
    var enhanceError = function enhanceError(error, config, code, request, response) {
      error.config = config;
      if (code) {
        error.code = code;
      }

      error.request = request;
      error.response = response;
      error.isAxiosError = true;

      error.toJSON = function toJSON() {
        return {
          // Standard
          message: this.message,
          name: this.name,
          // Microsoft
          description: this.description,
          number: this.number,
          // Mozilla
          fileName: this.fileName,
          lineNumber: this.lineNumber,
          columnNumber: this.columnNumber,
          stack: this.stack,
          // Axios
          config: this.config,
          code: this.code
        };
      };
      return error;
    };

    /**
     * Create an Error with the specified message, config, error code, request and response.
     *
     * @param {string} message The error message.
     * @param {Object} config The config.
     * @param {string} [code] The error code (for example, 'ECONNABORTED').
     * @param {Object} [request] The request.
     * @param {Object} [response] The response.
     * @returns {Error} The created error.
     */
    var createError = function createError(message, config, code, request, response) {
      var error = new Error(message);
      return enhanceError(error, config, code, request, response);
    };

    /**
     * Resolve or reject a Promise based on response status.
     *
     * @param {Function} resolve A function that resolves the promise.
     * @param {Function} reject A function that rejects the promise.
     * @param {object} response The response.
     */
    var settle = function settle(resolve, reject, response) {
      var validateStatus = response.config.validateStatus;
      if (!response.status || !validateStatus || validateStatus(response.status)) {
        resolve(response);
      } else {
        reject(createError(
          'Request failed with status code ' + response.status,
          response.config,
          null,
          response.request,
          response
        ));
      }
    };

    var cookies = (
      utils.isStandardBrowserEnv() ?

      // Standard browser envs support document.cookie
        (function standardBrowserEnv() {
          return {
            write: function write(name, value, expires, path, domain, secure) {
              var cookie = [];
              cookie.push(name + '=' + encodeURIComponent(value));

              if (utils.isNumber(expires)) {
                cookie.push('expires=' + new Date(expires).toGMTString());
              }

              if (utils.isString(path)) {
                cookie.push('path=' + path);
              }

              if (utils.isString(domain)) {
                cookie.push('domain=' + domain);
              }

              if (secure === true) {
                cookie.push('secure');
              }

              document.cookie = cookie.join('; ');
            },

            read: function read(name) {
              var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
              return (match ? decodeURIComponent(match[3]) : null);
            },

            remove: function remove(name) {
              this.write(name, '', Date.now() - 86400000);
            }
          };
        })() :

      // Non standard browser env (web workers, react-native) lack needed support.
        (function nonStandardBrowserEnv() {
          return {
            write: function write() {},
            read: function read() { return null; },
            remove: function remove() {}
          };
        })()
    );

    /**
     * Determines whether the specified URL is absolute
     *
     * @param {string} url The URL to test
     * @returns {boolean} True if the specified URL is absolute, otherwise false
     */
    var isAbsoluteURL = function isAbsoluteURL(url) {
      // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
      // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
      // by any combination of letters, digits, plus, period, or hyphen.
      return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
    };

    /**
     * Creates a new URL by combining the specified URLs
     *
     * @param {string} baseURL The base URL
     * @param {string} relativeURL The relative URL
     * @returns {string} The combined URL
     */
    var combineURLs = function combineURLs(baseURL, relativeURL) {
      return relativeURL
        ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
        : baseURL;
    };

    /**
     * Creates a new URL by combining the baseURL with the requestedURL,
     * only when the requestedURL is not already an absolute URL.
     * If the requestURL is absolute, this function returns the requestedURL untouched.
     *
     * @param {string} baseURL The base URL
     * @param {string} requestedURL Absolute or relative URL to combine
     * @returns {string} The combined full path
     */
    var buildFullPath = function buildFullPath(baseURL, requestedURL) {
      if (baseURL && !isAbsoluteURL(requestedURL)) {
        return combineURLs(baseURL, requestedURL);
      }
      return requestedURL;
    };

    // Headers whose duplicates are ignored by node
    // c.f. https://nodejs.org/api/http.html#http_message_headers
    var ignoreDuplicateOf = [
      'age', 'authorization', 'content-length', 'content-type', 'etag',
      'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
      'last-modified', 'location', 'max-forwards', 'proxy-authorization',
      'referer', 'retry-after', 'user-agent'
    ];

    /**
     * Parse headers into an object
     *
     * ```
     * Date: Wed, 27 Aug 2014 08:58:49 GMT
     * Content-Type: application/json
     * Connection: keep-alive
     * Transfer-Encoding: chunked
     * ```
     *
     * @param {String} headers Headers needing to be parsed
     * @returns {Object} Headers parsed into an object
     */
    var parseHeaders = function parseHeaders(headers) {
      var parsed = {};
      var key;
      var val;
      var i;

      if (!headers) { return parsed; }

      utils.forEach(headers.split('\n'), function parser(line) {
        i = line.indexOf(':');
        key = utils.trim(line.substr(0, i)).toLowerCase();
        val = utils.trim(line.substr(i + 1));

        if (key) {
          if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
            return;
          }
          if (key === 'set-cookie') {
            parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
          } else {
            parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
          }
        }
      });

      return parsed;
    };

    var isURLSameOrigin = (
      utils.isStandardBrowserEnv() ?

      // Standard browser envs have full support of the APIs needed to test
      // whether the request URL is of the same origin as current location.
        (function standardBrowserEnv() {
          var msie = /(msie|trident)/i.test(navigator.userAgent);
          var urlParsingNode = document.createElement('a');
          var originURL;

          /**
        * Parse a URL to discover it's components
        *
        * @param {String} url The URL to be parsed
        * @returns {Object}
        */
          function resolveURL(url) {
            var href = url;

            if (msie) {
            // IE needs attribute set twice to normalize properties
              urlParsingNode.setAttribute('href', href);
              href = urlParsingNode.href;
            }

            urlParsingNode.setAttribute('href', href);

            // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
            return {
              href: urlParsingNode.href,
              protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
              host: urlParsingNode.host,
              search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
              hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
              hostname: urlParsingNode.hostname,
              port: urlParsingNode.port,
              pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
                urlParsingNode.pathname :
                '/' + urlParsingNode.pathname
            };
          }

          originURL = resolveURL(window.location.href);

          /**
        * Determine if a URL shares the same origin as the current location
        *
        * @param {String} requestURL The URL to test
        * @returns {boolean} True if URL shares the same origin, otherwise false
        */
          return function isURLSameOrigin(requestURL) {
            var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
            return (parsed.protocol === originURL.protocol &&
                parsed.host === originURL.host);
          };
        })() :

      // Non standard browser envs (web workers, react-native) lack needed support.
        (function nonStandardBrowserEnv() {
          return function isURLSameOrigin() {
            return true;
          };
        })()
    );

    var xhr = function xhrAdapter(config) {
      return new Promise(function dispatchXhrRequest(resolve, reject) {
        var requestData = config.data;
        var requestHeaders = config.headers;

        if (utils.isFormData(requestData)) {
          delete requestHeaders['Content-Type']; // Let the browser set it
        }

        if (
          (utils.isBlob(requestData) || utils.isFile(requestData)) &&
          requestData.type
        ) {
          delete requestHeaders['Content-Type']; // Let the browser set it
        }

        var request = new XMLHttpRequest();

        // HTTP basic authentication
        if (config.auth) {
          var username = config.auth.username || '';
          var password = unescape(encodeURIComponent(config.auth.password)) || '';
          requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
        }

        var fullPath = buildFullPath(config.baseURL, config.url);
        request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);

        // Set the request timeout in MS
        request.timeout = config.timeout;

        // Listen for ready state
        request.onreadystatechange = function handleLoad() {
          if (!request || request.readyState !== 4) {
            return;
          }

          // The request errored out and we didn't get a response, this will be
          // handled by onerror instead
          // With one exception: request that using file: protocol, most browsers
          // will return status as 0 even though it's a successful request
          if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
            return;
          }

          // Prepare the response
          var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
          var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
          var response = {
            data: responseData,
            status: request.status,
            statusText: request.statusText,
            headers: responseHeaders,
            config: config,
            request: request
          };

          settle(resolve, reject, response);

          // Clean up request
          request = null;
        };

        // Handle browser request cancellation (as opposed to a manual cancellation)
        request.onabort = function handleAbort() {
          if (!request) {
            return;
          }

          reject(createError('Request aborted', config, 'ECONNABORTED', request));

          // Clean up request
          request = null;
        };

        // Handle low level network errors
        request.onerror = function handleError() {
          // Real errors are hidden from us by the browser
          // onerror should only fire if it's a network error
          reject(createError('Network Error', config, null, request));

          // Clean up request
          request = null;
        };

        // Handle timeout
        request.ontimeout = function handleTimeout() {
          var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
          if (config.timeoutErrorMessage) {
            timeoutErrorMessage = config.timeoutErrorMessage;
          }
          reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
            request));

          // Clean up request
          request = null;
        };

        // Add xsrf header
        // This is only done if running in a standard browser environment.
        // Specifically not if we're in a web worker, or react-native.
        if (utils.isStandardBrowserEnv()) {
          // Add xsrf header
          var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
            cookies.read(config.xsrfCookieName) :
            undefined;

          if (xsrfValue) {
            requestHeaders[config.xsrfHeaderName] = xsrfValue;
          }
        }

        // Add headers to the request
        if ('setRequestHeader' in request) {
          utils.forEach(requestHeaders, function setRequestHeader(val, key) {
            if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
              // Remove Content-Type if data is undefined
              delete requestHeaders[key];
            } else {
              // Otherwise add header to the request
              request.setRequestHeader(key, val);
            }
          });
        }

        // Add withCredentials to request if needed
        if (!utils.isUndefined(config.withCredentials)) {
          request.withCredentials = !!config.withCredentials;
        }

        // Add responseType to request if needed
        if (config.responseType) {
          try {
            request.responseType = config.responseType;
          } catch (e) {
            // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
            // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
            if (config.responseType !== 'json') {
              throw e;
            }
          }
        }

        // Handle progress if needed
        if (typeof config.onDownloadProgress === 'function') {
          request.addEventListener('progress', config.onDownloadProgress);
        }

        // Not all browsers support upload events
        if (typeof config.onUploadProgress === 'function' && request.upload) {
          request.upload.addEventListener('progress', config.onUploadProgress);
        }

        if (config.cancelToken) {
          // Handle cancellation
          config.cancelToken.promise.then(function onCanceled(cancel) {
            if (!request) {
              return;
            }

            request.abort();
            reject(cancel);
            // Clean up request
            request = null;
          });
        }

        if (!requestData) {
          requestData = null;
        }

        // Send the request
        request.send(requestData);
      });
    };

    var DEFAULT_CONTENT_TYPE = {
      'Content-Type': 'application/x-www-form-urlencoded'
    };

    function setContentTypeIfUnset(headers, value) {
      if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
        headers['Content-Type'] = value;
      }
    }

    function getDefaultAdapter() {
      var adapter;
      {
        // For browsers use XHR adapter
        adapter = xhr;
      }
      return adapter;
    }

    var defaults = {
      adapter: getDefaultAdapter(),

      transformRequest: [function transformRequest(data, headers) {
        normalizeHeaderName(headers, 'Accept');
        normalizeHeaderName(headers, 'Content-Type');
        if (utils.isFormData(data) ||
          utils.isArrayBuffer(data) ||
          utils.isBuffer(data) ||
          utils.isStream(data) ||
          utils.isFile(data) ||
          utils.isBlob(data)
        ) {
          return data;
        }
        if (utils.isArrayBufferView(data)) {
          return data.buffer;
        }
        if (utils.isURLSearchParams(data)) {
          setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
          return data.toString();
        }
        if (utils.isObject(data)) {
          setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
          return JSON.stringify(data);
        }
        return data;
      }],

      transformResponse: [function transformResponse(data) {
        /*eslint no-param-reassign:0*/
        if (typeof data === 'string') {
          try {
            data = JSON.parse(data);
          } catch (e) { /* Ignore */ }
        }
        return data;
      }],

      /**
       * A timeout in milliseconds to abort a request. If set to 0 (default) a
       * timeout is not created.
       */
      timeout: 0,

      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',

      maxContentLength: -1,
      maxBodyLength: -1,

      validateStatus: function validateStatus(status) {
        return status >= 200 && status < 300;
      }
    };

    defaults.headers = {
      common: {
        'Accept': 'application/json, text/plain, */*'
      }
    };

    utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
      defaults.headers[method] = {};
    });

    utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
      defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
    });

    var defaults_1 = defaults;

    /**
     * Throws a `Cancel` if cancellation has been requested.
     */
    function throwIfCancellationRequested(config) {
      if (config.cancelToken) {
        config.cancelToken.throwIfRequested();
      }
    }

    /**
     * Dispatch a request to the server using the configured adapter.
     *
     * @param {object} config The config that is to be used for the request
     * @returns {Promise} The Promise to be fulfilled
     */
    var dispatchRequest = function dispatchRequest(config) {
      throwIfCancellationRequested(config);

      // Ensure headers exist
      config.headers = config.headers || {};

      // Transform request data
      config.data = transformData(
        config.data,
        config.headers,
        config.transformRequest
      );

      // Flatten headers
      config.headers = utils.merge(
        config.headers.common || {},
        config.headers[config.method] || {},
        config.headers
      );

      utils.forEach(
        ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
        function cleanHeaderConfig(method) {
          delete config.headers[method];
        }
      );

      var adapter = config.adapter || defaults_1.adapter;

      return adapter(config).then(function onAdapterResolution(response) {
        throwIfCancellationRequested(config);

        // Transform response data
        response.data = transformData(
          response.data,
          response.headers,
          config.transformResponse
        );

        return response;
      }, function onAdapterRejection(reason) {
        if (!isCancel(reason)) {
          throwIfCancellationRequested(config);

          // Transform response data
          if (reason && reason.response) {
            reason.response.data = transformData(
              reason.response.data,
              reason.response.headers,
              config.transformResponse
            );
          }
        }

        return Promise.reject(reason);
      });
    };

    /**
     * Config-specific merge-function which creates a new config-object
     * by merging two configuration objects together.
     *
     * @param {Object} config1
     * @param {Object} config2
     * @returns {Object} New object resulting from merging config2 to config1
     */
    var mergeConfig = function mergeConfig(config1, config2) {
      // eslint-disable-next-line no-param-reassign
      config2 = config2 || {};
      var config = {};

      var valueFromConfig2Keys = ['url', 'method', 'data'];
      var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
      var defaultToConfig2Keys = [
        'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
        'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
        'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
        'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
        'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
      ];
      var directMergeKeys = ['validateStatus'];

      function getMergedValue(target, source) {
        if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
          return utils.merge(target, source);
        } else if (utils.isPlainObject(source)) {
          return utils.merge({}, source);
        } else if (utils.isArray(source)) {
          return source.slice();
        }
        return source;
      }

      function mergeDeepProperties(prop) {
        if (!utils.isUndefined(config2[prop])) {
          config[prop] = getMergedValue(config1[prop], config2[prop]);
        } else if (!utils.isUndefined(config1[prop])) {
          config[prop] = getMergedValue(undefined, config1[prop]);
        }
      }

      utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
        if (!utils.isUndefined(config2[prop])) {
          config[prop] = getMergedValue(undefined, config2[prop]);
        }
      });

      utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);

      utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
        if (!utils.isUndefined(config2[prop])) {
          config[prop] = getMergedValue(undefined, config2[prop]);
        } else if (!utils.isUndefined(config1[prop])) {
          config[prop] = getMergedValue(undefined, config1[prop]);
        }
      });

      utils.forEach(directMergeKeys, function merge(prop) {
        if (prop in config2) {
          config[prop] = getMergedValue(config1[prop], config2[prop]);
        } else if (prop in config1) {
          config[prop] = getMergedValue(undefined, config1[prop]);
        }
      });

      var axiosKeys = valueFromConfig2Keys
        .concat(mergeDeepPropertiesKeys)
        .concat(defaultToConfig2Keys)
        .concat(directMergeKeys);

      var otherKeys = Object
        .keys(config1)
        .concat(Object.keys(config2))
        .filter(function filterAxiosKeys(key) {
          return axiosKeys.indexOf(key) === -1;
        });

      utils.forEach(otherKeys, mergeDeepProperties);

      return config;
    };

    /**
     * Create a new instance of Axios
     *
     * @param {Object} instanceConfig The default config for the instance
     */
    function Axios(instanceConfig) {
      this.defaults = instanceConfig;
      this.interceptors = {
        request: new InterceptorManager_1(),
        response: new InterceptorManager_1()
      };
    }

    /**
     * Dispatch a request
     *
     * @param {Object} config The config specific for this request (merged with this.defaults)
     */
    Axios.prototype.request = function request(config) {
      /*eslint no-param-reassign:0*/
      // Allow for axios('example/url'[, config]) a la fetch API
      if (typeof config === 'string') {
        config = arguments[1] || {};
        config.url = arguments[0];
      } else {
        config = config || {};
      }

      config = mergeConfig(this.defaults, config);

      // Set config.method
      if (config.method) {
        config.method = config.method.toLowerCase();
      } else if (this.defaults.method) {
        config.method = this.defaults.method.toLowerCase();
      } else {
        config.method = 'get';
      }

      // Hook up interceptors middleware
      var chain = [dispatchRequest, undefined];
      var promise = Promise.resolve(config);

      this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
        chain.unshift(interceptor.fulfilled, interceptor.rejected);
      });

      this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
        chain.push(interceptor.fulfilled, interceptor.rejected);
      });

      while (chain.length) {
        promise = promise.then(chain.shift(), chain.shift());
      }

      return promise;
    };

    Axios.prototype.getUri = function getUri(config) {
      config = mergeConfig(this.defaults, config);
      return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
    };

    // Provide aliases for supported request methods
    utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
      /*eslint func-names:0*/
      Axios.prototype[method] = function(url, config) {
        return this.request(mergeConfig(config || {}, {
          method: method,
          url: url
        }));
      };
    });

    utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
      /*eslint func-names:0*/
      Axios.prototype[method] = function(url, data, config) {
        return this.request(mergeConfig(config || {}, {
          method: method,
          url: url,
          data: data
        }));
      };
    });

    var Axios_1 = Axios;

    /**
     * A `Cancel` is an object that is thrown when an operation is canceled.
     *
     * @class
     * @param {string=} message The message.
     */
    function Cancel(message) {
      this.message = message;
    }

    Cancel.prototype.toString = function toString() {
      return 'Cancel' + (this.message ? ': ' + this.message : '');
    };

    Cancel.prototype.__CANCEL__ = true;

    var Cancel_1 = Cancel;

    /**
     * A `CancelToken` is an object that can be used to request cancellation of an operation.
     *
     * @class
     * @param {Function} executor The executor function.
     */
    function CancelToken(executor) {
      if (typeof executor !== 'function') {
        throw new TypeError('executor must be a function.');
      }

      var resolvePromise;
      this.promise = new Promise(function promiseExecutor(resolve) {
        resolvePromise = resolve;
      });

      var token = this;
      executor(function cancel(message) {
        if (token.reason) {
          // Cancellation has already been requested
          return;
        }

        token.reason = new Cancel_1(message);
        resolvePromise(token.reason);
      });
    }

    /**
     * Throws a `Cancel` if cancellation has been requested.
     */
    CancelToken.prototype.throwIfRequested = function throwIfRequested() {
      if (this.reason) {
        throw this.reason;
      }
    };

    /**
     * Returns an object that contains a new `CancelToken` and a function that, when called,
     * cancels the `CancelToken`.
     */
    CancelToken.source = function source() {
      var cancel;
      var token = new CancelToken(function executor(c) {
        cancel = c;
      });
      return {
        token: token,
        cancel: cancel
      };
    };

    var CancelToken_1 = CancelToken;

    /**
     * Syntactic sugar for invoking a function and expanding an array for arguments.
     *
     * Common use case would be to use `Function.prototype.apply`.
     *
     *  ```js
     *  function f(x, y, z) {}
     *  var args = [1, 2, 3];
     *  f.apply(null, args);
     *  ```
     *
     * With `spread` this example can be re-written.
     *
     *  ```js
     *  spread(function(x, y, z) {})([1, 2, 3]);
     *  ```
     *
     * @param {Function} callback
     * @returns {Function}
     */
    var spread = function spread(callback) {
      return function wrap(arr) {
        return callback.apply(null, arr);
      };
    };

    /**
     * Create an instance of Axios
     *
     * @param {Object} defaultConfig The default config for the instance
     * @return {Axios} A new instance of Axios
     */
    function createInstance(defaultConfig) {
      var context = new Axios_1(defaultConfig);
      var instance = bind(Axios_1.prototype.request, context);

      // Copy axios.prototype to instance
      utils.extend(instance, Axios_1.prototype, context);

      // Copy context to instance
      utils.extend(instance, context);

      return instance;
    }

    // Create the default instance to be exported
    var axios = createInstance(defaults_1);

    // Expose Axios class to allow class inheritance
    axios.Axios = Axios_1;

    // Factory for creating new instances
    axios.create = function create(instanceConfig) {
      return createInstance(mergeConfig(axios.defaults, instanceConfig));
    };

    // Expose Cancel & CancelToken
    axios.Cancel = Cancel_1;
    axios.CancelToken = CancelToken_1;
    axios.isCancel = isCancel;

    // Expose all/spread
    axios.all = function all(promises) {
      return Promise.all(promises);
    };
    axios.spread = spread;

    var axios_1 = axios;

    // Allow use of default import syntax in TypeScript
    var _default = axios;
    axios_1.default = _default;

    var axios$1 = axios_1;

    var LOGISTICS_LOCATION_BASE_URLS = {
        production: 'https://configuration.logistics.cimpress.io',
        staging: 'https://staging.configuration.logistics.cimpress.io',
        fragments: 'https://configuration.logistics.cimpress.io' // development
    };
    function getLogisticsLocationSettings(logisticsLocationId, token, env) {
        return __awaiter(this, void 0, void 0, function () {
            var baseUrl, url, config, response, err_1;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        baseUrl = env ? LOGISTICS_LOCATION_BASE_URLS[env] : LOGISTICS_LOCATION_BASE_URLS.staging;
                        url = baseUrl + "/v0/locations/" + logisticsLocationId + "/customData/shipping-console";
                        config = {
                            headers: {
                                authorization: "Bearer " + token
                            }
                        };
                        _a.label = 1;
                    case 1:
                        _a.trys.push([1, 3, , 4]);
                        return [4 /*yield*/, axios$1.get(url, config)];
                    case 2:
                        response = _a.sent();
                        return [2 /*return*/, {
                                etag: response.headers.etag,
                                settings: convertSettingsToState({}, response.data, undefined)
                            }];
                    case 3:
                        err_1 = _a.sent();
                        if (err_1.response.status === 404) {
                            return [2 /*return*/, {
                                    etag: undefined,
                                    settings: {}
                                }];
                        }
                        throw err_1;
                    case 4: return [2 /*return*/];
                }
            });
        });
    }
    function convertSettingsToState(state, settings, parentKey) {
        for (var _i = 0, _a = Object.keys(settings); _i < _a.length; _i++) {
            var key = _a[_i];
            var settingsKey = parentKey ? parentKey + "-" + key : key;
            if (typeof settings[key] === 'object') {
                state = convertSettingsToState(state, settings[key], settingsKey);
            }
            else {
                state[settingsKey] = settings[key];
            }
        }
        return state;
    }
    function putLogisticsLocationSettings(logisticsLocationId, token, env, etag, state) {
        var baseUrl = env ? LOGISTICS_LOCATION_BASE_URLS[env] : LOGISTICS_LOCATION_BASE_URLS.staging;
        var url = baseUrl + "/v0/locations/" + logisticsLocationId + "/customData/shipping-console";
        var config = {
            headers: {
                authorization: "Bearer " + token
            }
        };
        if (etag) {
            config.headers['if-match'] = etag;
        }
        return axios$1.put(url, convertStateToSettings(state), config);
    }
    function convertStateToSettings(state) {
        var settings = [];
        for (var _i = 0, _a = Object.keys(state); _i < _a.length; _i++) {
            var key = _a[_i];
            var value = state[key];
            var keyParts = key.split('-');
            settings = settings.concat(convertKeyToNestedObject(keyParts, value));
        }
        return lodash_merge.apply(void 0, __spreadArrays([{}], settings));
    }
    function convertKeyToNestedObject(keys, value) {
        var _a, _b;
        if (keys.length === 1) {
            return _a = {}, _a[keys[0]] = value, _a;
        }
        else {
            return _b = {}, _b[keys[0]] = convertKeyToNestedObject(keys.slice(1), value), _b;
        }
    }

    function styleInject(css, ref) {
      if ( ref === void 0 ) ref = {};
      var insertAt = ref.insertAt;

      if (!css || typeof document === 'undefined') { return; }

      var head = document.head || document.getElementsByTagName('head')[0];
      var style = document.createElement('style');
      style.type = 'text/css';

      if (insertAt === 'top') {
        if (head.firstChild) {
          head.insertBefore(style, head.firstChild);
        } else {
          head.appendChild(style);
        }
      } else {
        head.appendChild(style);
      }

      if (style.styleSheet) {
        style.styleSheet.cssText = css;
      } else {
        style.appendChild(document.createTextNode(css));
      }
    }

    var css_248z = ".fragment-module_child__2GDoc {\r\n  margin-left: 50px\r\n}\r\n\r\n.fragment-module_flex__1psav {\r\n  display: flex;\r\n}\r\n\r\n.fragment-module_margined__3V66j {\r\n  margin-top: 10px;\r\n  margin-left: 10px\r\n}\r\n";
    var styles = {"child":"fragment-module_child__2GDoc","flex":"fragment-module_flex__1psav","margined":"fragment-module_margined__3V66j"};
    styleInject(css_248z);

    var countryList = [
    	{
    		label: "Afghanistan",
    		value: "AF"
    	},
    	{
    		label: "Åland Islands",
    		value: "AX"
    	},
    	{
    		label: "Albania",
    		value: "AL"
    	},
    	{
    		label: "Algeria",
    		value: "DZ"
    	},
    	{
    		label: "American Samoa",
    		value: "AS"
    	},
    	{
    		label: "Andorra",
    		value: "AD"
    	},
    	{
    		label: "Angola",
    		value: "AO"
    	},
    	{
    		label: "Anguilla",
    		value: "AI"
    	},
    	{
    		label: "Antarctica",
    		value: "AQ"
    	},
    	{
    		label: "Antigua and Barbuda",
    		value: "AG"
    	},
    	{
    		label: "Argentina",
    		value: "AR"
    	},
    	{
    		label: "Armenia",
    		value: "AM"
    	},
    	{
    		label: "Aruba",
    		value: "AW"
    	},
    	{
    		label: "Australia",
    		value: "AU"
    	},
    	{
    		label: "Austria",
    		value: "AT"
    	},
    	{
    		label: "Azerbaijan",
    		value: "AZ"
    	},
    	{
    		label: "Bahamas",
    		value: "BS"
    	},
    	{
    		label: "Bahrain",
    		value: "BH"
    	},
    	{
    		label: "Bangladesh",
    		value: "BD"
    	},
    	{
    		label: "Barbados",
    		value: "BB"
    	},
    	{
    		label: "Belarus",
    		value: "BY"
    	},
    	{
    		label: "Belgium",
    		value: "BE"
    	},
    	{
    		label: "Belize",
    		value: "BZ"
    	},
    	{
    		label: "Benin",
    		value: "BJ"
    	},
    	{
    		label: "Bermuda",
    		value: "BM"
    	},
    	{
    		label: "Bhutan",
    		value: "BT"
    	},
    	{
    		label: "Bolivia (Plurinational State of)",
    		value: "BO"
    	},
    	{
    		label: "Bonaire, Sint Eustatius and Saba",
    		value: "BQ"
    	},
    	{
    		label: "Bosnia and Herzegovina",
    		value: "BA"
    	},
    	{
    		label: "Botswana",
    		value: "BW"
    	},
    	{
    		label: "Bouvet Island",
    		value: "BV"
    	},
    	{
    		label: "Brazil",
    		value: "BR"
    	},
    	{
    		label: "British Indian Ocean Territory",
    		value: "IO"
    	},
    	{
    		label: "Brunei Darussalam",
    		value: "BN"
    	},
    	{
    		label: "Bulgaria",
    		value: "BG"
    	},
    	{
    		label: "Burkina Faso",
    		value: "BF"
    	},
    	{
    		label: "Burundi",
    		value: "BI"
    	},
    	{
    		label: "Cambodia",
    		value: "KH"
    	},
    	{
    		label: "Cameroon",
    		value: "CM"
    	},
    	{
    		label: "Canada",
    		value: "CA"
    	},
    	{
    		label: "Canary Islands",
    		value: "IC"
    	},
    	{
    		label: "Cabo Verde",
    		value: "CV"
    	},
    	{
    		label: "Cayman Islands",
    		value: "KY"
    	},
    	{
    		label: "Central African Republic",
    		value: "CF"
    	},
    	{
    		label: "Chad",
    		value: "TD"
    	},
    	{
    		label: "Chile",
    		value: "CL"
    	},
    	{
    		label: "China",
    		value: "CN"
    	},
    	{
    		label: "Christmas Island",
    		value: "CX"
    	},
    	{
    		label: "Cocos (Keeling) Islands",
    		value: "CC"
    	},
    	{
    		label: "Colombia",
    		value: "CO"
    	},
    	{
    		label: "Comoros",
    		value: "KM"
    	},
    	{
    		label: "Congo",
    		value: "CG"
    	},
    	{
    		label: "Congo (Democratic Republic of the)",
    		value: "CD"
    	},
    	{
    		label: "Cook Islands",
    		value: "CK"
    	},
    	{
    		label: "Costa Rica",
    		value: "CR"
    	},
    	{
    		label: "Côte d'Ivoire",
    		value: "CI"
    	},
    	{
    		label: "Croatia",
    		value: "HR"
    	},
    	{
    		label: "Cuba",
    		value: "CU"
    	},
    	{
    		label: "Curaçao",
    		value: "CW"
    	},
    	{
    		label: "Cyprus",
    		value: "CY"
    	},
    	{
    		label: "Czech Republic",
    		value: "CZ"
    	},
    	{
    		label: "Denmark",
    		value: "DK"
    	},
    	{
    		label: "Djibouti",
    		value: "DJ"
    	},
    	{
    		label: "Dominica",
    		value: "DM"
    	},
    	{
    		label: "Dominican Republic",
    		value: "DO"
    	},
    	{
    		label: "Ecuador",
    		value: "EC"
    	},
    	{
    		label: "Egypt",
    		value: "EG"
    	},
    	{
    		label: "El Salvador",
    		value: "SV"
    	},
    	{
    		label: "Equatorial Guinea",
    		value: "GQ"
    	},
    	{
    		label: "Eritrea",
    		value: "ER"
    	},
    	{
    		label: "Estonia",
    		value: "EE"
    	},
    	{
    		label: "Ethiopia",
    		value: "ET"
    	},
    	{
    		label: "Falkland Islands (Malvinas)",
    		value: "FK"
    	},
    	{
    		label: "Faroe Islands",
    		value: "FO"
    	},
    	{
    		label: "Fiji",
    		value: "FJ"
    	},
    	{
    		label: "Finland",
    		value: "FI"
    	},
    	{
    		label: "France",
    		value: "FR"
    	},
    	{
    		label: "French Guiana",
    		value: "GF"
    	},
    	{
    		label: "French Polynesia",
    		value: "PF"
    	},
    	{
    		label: "French Southern Territories",
    		value: "TF"
    	},
    	{
    		label: "Gabon",
    		value: "GA"
    	},
    	{
    		label: "Gambia",
    		value: "GM"
    	},
    	{
    		label: "Georgia",
    		value: "GE"
    	},
    	{
    		label: "Germany",
    		value: "DE"
    	},
    	{
    		label: "Ghana",
    		value: "GH"
    	},
    	{
    		label: "Gibraltar",
    		value: "GI"
    	},
    	{
    		label: "Greece",
    		value: "GR"
    	},
    	{
    		label: "Greenland",
    		value: "GL"
    	},
    	{
    		label: "Grenada",
    		value: "GD"
    	},
    	{
    		label: "Guadeloupe",
    		value: "GP"
    	},
    	{
    		label: "Guam",
    		value: "GU"
    	},
    	{
    		label: "Guatemala",
    		value: "GT"
    	},
    	{
    		label: "Guernsey",
    		value: "GG"
    	},
    	{
    		label: "Guinea",
    		value: "GN"
    	},
    	{
    		label: "Guinea-Bissau",
    		value: "GW"
    	},
    	{
    		label: "Guyana",
    		value: "GY"
    	},
    	{
    		label: "Haiti",
    		value: "HT"
    	},
    	{
    		label: "Heard Island and McDonald Islands",
    		value: "HM"
    	},
    	{
    		label: "Holy See",
    		value: "VA"
    	},
    	{
    		label: "Honduras",
    		value: "HN"
    	},
    	{
    		label: "Hong Kong, Special Administrative Region of China",
    		value: "HK"
    	},
    	{
    		label: "Hungary",
    		value: "HU"
    	},
    	{
    		label: "Iceland",
    		value: "IS"
    	},
    	{
    		label: "India",
    		value: "IN"
    	},
    	{
    		label: "Indonesia",
    		value: "ID"
    	},
    	{
    		label: "Iran (Islamic Republic of)",
    		value: "IR"
    	},
    	{
    		label: "Iraq",
    		value: "IQ"
    	},
    	{
    		label: "Ireland",
    		value: "IE"
    	},
    	{
    		label: "Isle of Man",
    		value: "IM"
    	},
    	{
    		label: "Israel",
    		value: "IL"
    	},
    	{
    		label: "Italy",
    		value: "IT"
    	},
    	{
    		label: "Jamaica",
    		value: "JM"
    	},
    	{
    		label: "Japan",
    		value: "JP"
    	},
    	{
    		label: "Jersey",
    		value: "JE"
    	},
    	{
    		label: "Jordan",
    		value: "JO"
    	},
    	{
    		label: "Kazakhstan",
    		value: "KZ"
    	},
    	{
    		label: "Kenya",
    		value: "KE"
    	},
    	{
    		label: "Kiribati",
    		value: "KI"
    	},
    	{
    		label: "Korea (Democratic People's Republic of)",
    		value: "KP"
    	},
    	{
    		label: "Korea (Republic of)",
    		value: "KR"
    	},
    	{
    		label: "Kuwait",
    		value: "KW"
    	},
    	{
    		label: "Kyrgyzstan",
    		value: "KG"
    	},
    	{
    		label: "Lao People's Democratic Republic",
    		value: "LA"
    	},
    	{
    		label: "Latvia",
    		value: "LV"
    	},
    	{
    		label: "Lebanon",
    		value: "LB"
    	},
    	{
    		label: "Lesotho",
    		value: "LS"
    	},
    	{
    		label: "Liberia",
    		value: "LR"
    	},
    	{
    		label: "Libya",
    		value: "LY"
    	},
    	{
    		label: "Liechtenstein",
    		value: "LI"
    	},
    	{
    		label: "Lithuania",
    		value: "LT"
    	},
    	{
    		label: "Luxembourg",
    		value: "LU"
    	},
    	{
    		label: "Macao, Special Administrative Region of China",
    		value: "MO"
    	},
    	{
    		label: "Macedonia (the former Yugoslav Republic of)",
    		value: "MK"
    	},
    	{
    		label: "Madagascar",
    		value: "MG"
    	},
    	{
    		label: "Malawi",
    		value: "MW"
    	},
    	{
    		label: "Malaysia",
    		value: "MY"
    	},
    	{
    		label: "Maldives",
    		value: "MV"
    	},
    	{
    		label: "Mali",
    		value: "ML"
    	},
    	{
    		label: "Malta",
    		value: "MT"
    	},
    	{
    		label: "Marshall Islands",
    		value: "MH"
    	},
    	{
    		label: "Martinique",
    		value: "MQ"
    	},
    	{
    		label: "Mauritania",
    		value: "MR"
    	},
    	{
    		label: "Mauritius",
    		value: "MU"
    	},
    	{
    		label: "Mayotte",
    		value: "YT"
    	},
    	{
    		label: "Mexico",
    		value: "MX"
    	},
    	{
    		label: "Micronesia (Federated States of)",
    		value: "FM"
    	},
    	{
    		label: "Moldova (Republic of)",
    		value: "MD"
    	},
    	{
    		label: "Monaco",
    		value: "MC"
    	},
    	{
    		label: "Mongolia",
    		value: "MN"
    	},
    	{
    		label: "Montenegro",
    		value: "ME"
    	},
    	{
    		label: "Montserrat",
    		value: "MS"
    	},
    	{
    		label: "Morocco",
    		value: "MA"
    	},
    	{
    		label: "Mozambique",
    		value: "MZ"
    	},
    	{
    		label: "Myanmar",
    		value: "MM"
    	},
    	{
    		label: "Namibia",
    		value: "NA"
    	},
    	{
    		label: "Nauru",
    		value: "NR"
    	},
    	{
    		label: "Nepal",
    		value: "NP"
    	},
    	{
    		label: "Netherlands",
    		value: "NL"
    	},
    	{
    		label: "New Caledonia",
    		value: "NC"
    	},
    	{
    		label: "New Zealand",
    		value: "NZ"
    	},
    	{
    		label: "Nicaragua",
    		value: "NI"
    	},
    	{
    		label: "Niger",
    		value: "NE"
    	},
    	{
    		label: "Nigeria",
    		value: "NG"
    	},
    	{
    		label: "Niue",
    		value: "NU"
    	},
    	{
    		label: "Norfolk Island",
    		value: "NF"
    	},
    	{
    		label: "Northern Mariana Islands",
    		value: "MP"
    	},
    	{
    		label: "Norway",
    		value: "NO"
    	},
    	{
    		label: "Oman",
    		value: "OM"
    	},
    	{
    		label: "Pakistan",
    		value: "PK"
    	},
    	{
    		label: "Palau",
    		value: "PW"
    	},
    	{
    		label: "Palestine, State of",
    		value: "PS"
    	},
    	{
    		label: "Panama",
    		value: "PA"
    	},
    	{
    		label: "Papua New Guinea",
    		value: "PG"
    	},
    	{
    		label: "Paraguay",
    		value: "PY"
    	},
    	{
    		label: "Peru",
    		value: "PE"
    	},
    	{
    		label: "Philippines",
    		value: "PH"
    	},
    	{
    		label: "Pitcairn",
    		value: "PN"
    	},
    	{
    		label: "Poland",
    		value: "PL"
    	},
    	{
    		label: "Portugal",
    		value: "PT"
    	},
    	{
    		label: "Puerto Rico",
    		value: "PR"
    	},
    	{
    		label: "Qatar",
    		value: "QA"
    	},
    	{
    		label: "Réunion",
    		value: "RE"
    	},
    	{
    		label: "Romania",
    		value: "RO"
    	},
    	{
    		label: "Russian Federation",
    		value: "RU"
    	},
    	{
    		label: "Rwanda",
    		value: "RW"
    	},
    	{
    		label: "Saint Barthélemy",
    		value: "BL"
    	},
    	{
    		label: "Saint Helena, Ascension and Tristan da Cunha",
    		value: "SH"
    	},
    	{
    		label: "Saint Kitts and Nevis",
    		value: "KN"
    	},
    	{
    		label: "Saint Lucia",
    		value: "LC"
    	},
    	{
    		label: "Saint Martin (French part)",
    		value: "MF"
    	},
    	{
    		label: "Saint Pierre and Miquelon",
    		value: "PM"
    	},
    	{
    		label: "Saint Vincent and the Grenadines",
    		value: "VC"
    	},
    	{
    		label: "Samoa",
    		value: "WS"
    	},
    	{
    		label: "San Marino",
    		value: "SM"
    	},
    	{
    		label: "Sao Tome and Principe",
    		value: "ST"
    	},
    	{
    		label: "Saudi Arabia",
    		value: "SA"
    	},
    	{
    		label: "Senegal",
    		value: "SN"
    	},
    	{
    		label: "Serbia",
    		value: "RS"
    	},
    	{
    		label: "Seychelles",
    		value: "SC"
    	},
    	{
    		label: "Sierra Leone",
    		value: "SL"
    	},
    	{
    		label: "Singapore",
    		value: "SG"
    	},
    	{
    		label: "Sint Maarten (Dutch part)",
    		value: "SX"
    	},
    	{
    		label: "Slovakia",
    		value: "SK"
    	},
    	{
    		label: "Slovenia",
    		value: "SI"
    	},
    	{
    		label: "Solomon Islands",
    		value: "SB"
    	},
    	{
    		label: "Somalia",
    		value: "SO"
    	},
    	{
    		label: "South Africa",
    		value: "ZA"
    	},
    	{
    		label: "South Georgia and the South Sandwich Islands",
    		value: "GS"
    	},
    	{
    		label: "South Sudan",
    		value: "SS"
    	},
    	{
    		label: "Spain",
    		value: "ES"
    	},
    	{
    		label: "Sri Lanka",
    		value: "LK"
    	},
    	{
    		label: "Sudan",
    		value: "SD"
    	},
    	{
    		label: "Suriname",
    		value: "SR"
    	},
    	{
    		label: "Svalbard and Jan Mayen",
    		value: "SJ"
    	},
    	{
    		label: "Swaziland",
    		value: "SZ"
    	},
    	{
    		label: "Sweden",
    		value: "SE"
    	},
    	{
    		label: "Switzerland",
    		value: "CH"
    	},
    	{
    		label: "Syrian Arab Republic",
    		value: "SY"
    	},
    	{
    		label: "Taiwan, Province of China",
    		value: "TW"
    	},
    	{
    		label: "Tajikistan",
    		value: "TJ"
    	},
    	{
    		label: "Tanzania, United Republic of",
    		value: "TZ"
    	},
    	{
    		label: "Thailand",
    		value: "TH"
    	},
    	{
    		label: "Timor-Leste",
    		value: "TL"
    	},
    	{
    		label: "Togo",
    		value: "TG"
    	},
    	{
    		label: "Tokelau",
    		value: "TK"
    	},
    	{
    		label: "Tonga",
    		value: "TO"
    	},
    	{
    		label: "Trinidad and Tobago",
    		value: "TT"
    	},
    	{
    		label: "Tunisia",
    		value: "TN"
    	},
    	{
    		label: "Turkey",
    		value: "TR"
    	},
    	{
    		label: "Turkmenistan",
    		value: "TM"
    	},
    	{
    		label: "Turks and Caicos Islands",
    		value: "TC"
    	},
    	{
    		label: "Tuvalu",
    		value: "TV"
    	},
    	{
    		label: "Uganda",
    		value: "UG"
    	},
    	{
    		label: "Ukraine",
    		value: "UA"
    	},
    	{
    		label: "United Arab Emirates",
    		value: "AE"
    	},
    	{
    		label: "United Kingdom of Great Britain and Northern Ireland",
    		value: "GB"
    	},
    	{
    		label: "United States of America",
    		value: "US"
    	},
    	{
    		label: "United States Minor Outlying Islands",
    		value: "UM"
    	},
    	{
    		label: "Uruguay",
    		value: "UY"
    	},
    	{
    		label: "Uzbekistan",
    		value: "UZ"
    	},
    	{
    		label: "Vanuatu",
    		value: "VU"
    	},
    	{
    		label: "Venezuela (Bolivarian Republic of)",
    		value: "VE"
    	},
    	{
    		label: "Viet Nam",
    		value: "VN"
    	},
    	{
    		label: "Virgin Islands (British)",
    		value: "VG"
    	},
    	{
    		label: "Virgin Islands (U.S.)",
    		value: "VI"
    	},
    	{
    		label: "Wallis and Futuna",
    		value: "WF"
    	},
    	{
    		label: "Western Sahara",
    		value: "EH"
    	},
    	{
    		label: "Yemen",
    		value: "YE"
    	},
    	{
    		label: "Zambia",
    		value: "ZM"
    	},
    	{
    		label: "Zimbabwe",
    		value: "ZW"
    	}
    ];

    var currencyCode = [
    	"AED",
    	"AFN",
    	"ALL",
    	"AMD",
    	"ANG",
    	"AOA",
    	"ARS",
    	"AUD",
    	"AWG",
    	"AZN",
    	"BAM",
    	"BBD",
    	"BDT",
    	"BGN",
    	"BHD",
    	"BIF",
    	"BMD",
    	"BND",
    	"BOB",
    	"BOV",
    	"BRL",
    	"BSD",
    	"BTN",
    	"BWP",
    	"BYR",
    	"BZD",
    	"CAD",
    	"CDF",
    	"CHE",
    	"CHF",
    	"CHW",
    	"CLF",
    	"CLP",
    	"CNY",
    	"COP",
    	"COU",
    	"CRC",
    	"CUC",
    	"CUP",
    	"CVE",
    	"CZK",
    	"DJF",
    	"DKK",
    	"DOP",
    	"DZD",
    	"EGP",
    	"ERN",
    	"ETB",
    	"EUR",
    	"FJD",
    	"FKP",
    	"GBP",
    	"GEL",
    	"GHS",
    	"GIP",
    	"GMD",
    	"GNF",
    	"GTQ",
    	"GYD",
    	"HKD",
    	"HNL",
    	"HRK",
    	"HTG",
    	"HUF",
    	"IDR",
    	"ILS",
    	"INR",
    	"IQD",
    	"IRR",
    	"ISK",
    	"JMD",
    	"JOD",
    	"JPY",
    	"KES",
    	"KGS",
    	"KHR",
    	"KMF",
    	"KPW",
    	"KRW",
    	"KWD",
    	"KYD",
    	"KZT",
    	"LAK",
    	"LBP",
    	"LKR",
    	"LRD",
    	"LSL",
    	"LTL",
    	"LVL",
    	"LYD",
    	"MAD",
    	"MDL",
    	"MGA",
    	"MKD",
    	"MMK",
    	"MNT",
    	"MOP",
    	"MRO",
    	"MUR",
    	"MVR",
    	"MWK",
    	"MXN",
    	"MXV",
    	"MYR",
    	"MZN",
    	"NAD",
    	"NGN",
    	"NIO",
    	"NOK",
    	"NPR",
    	"NZD",
    	"OMR",
    	"PAB",
    	"PEN",
    	"PGK",
    	"PHP",
    	"PKR",
    	"PLN",
    	"PYG",
    	"QAR",
    	"RON",
    	"RSD",
    	"RUB",
    	"RWF",
    	"SAR",
    	"SBD",
    	"SCR",
    	"SDG",
    	"SEK",
    	"SGD",
    	"SHP",
    	"SLL",
    	"SOS",
    	"SRD",
    	"SSP",
    	"STD",
    	"SYP",
    	"SZL",
    	"THB",
    	"TJS",
    	"TMT",
    	"TND",
    	"TOP",
    	"TRY",
    	"TTD",
    	"TWD",
    	"TZS",
    	"UAH",
    	"UGX",
    	"USD",
    	"USN",
    	"USS",
    	"UYI",
    	"UYU",
    	"UZS",
    	"VEF",
    	"VND",
    	"VUV",
    	"WST",
    	"XAF",
    	"XAG",
    	"XAU",
    	"XBA",
    	"XBB",
    	"XBC",
    	"XBD",
    	"XCD",
    	"XDR",
    	"XFU",
    	"XOF",
    	"XPD",
    	"XPF",
    	"XPT",
    	"XTS",
    	"XXX",
    	"YER",
    	"ZAR",
    	"ZMW"
    ];
    var currencyList = {
    	currencyCode: currencyCode
    };

    function validateDefaults(settings) {
        if (settings['defaults-enabled']) {
            if (!settings['defaults-weight'] && everyDimensionIsEmpty(settings)) {
                throw new Error('Must provide either a valid weight or valid dimensions');
            }
            if (!hasAllDimensions(settings) && !everyDimensionIsEmpty(settings)) {
                throw new Error('Invalid dimensions, must provide all three dimensions or leave them all blank.');
            }
            return true;
        }
        return false;
    }
    function validateSupportEmail(settings) {
        if (settings['supportEmailAddress-enabled']) {
            if (!!settings['supportEmailAddress']) {
                if (!validateEmailValue(settings['supportEmailAddress'])) {
                    throw new Error('Email address is invalid');
                }
                return true;
            }
            else {
                throw new Error('Must provide email address when custom address is enabled');
            }
        }
        return false;
    }
    function validateEmailValue(email) {
        var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        return re.test(String(email).toLowerCase());
    }
    function validateUrlValue(url) {
        return url.startsWith('https://');
    }
    function hasAllDimensions(settings) {
        if (!!settings['defaults-dimension1'] && !!settings['defaults-dimension2'] && !!settings['defaults-dimension3'])
            return true;
    }
    function everyDimensionIsEmpty(settings) {
        if (!settings['defaults-dimension1'] && !settings['defaults-dimension2'] && !settings['defaults-dimension3'])
            return true;
    }
    var validators = {
        validateDefaults: validateDefaults,
        validateSupportEmail: validateSupportEmail,
        validateEmailValue: validateEmailValue,
        validateUrlValue: validateUrlValue
    };

    function formatOutboundDefault(settings, localeSettings, key) {
        if (key === 'defaults-weight') {
            return settings[key] + " " + localeSettings.weightUnits;
        }
        return settings[key] + " " + localeSettings.lengthUnits;
    }
    function formatInboundDefault(value) {
        return (value.split(' '))[0];
    }
    var formatters = {
        formatOutboundDefault: formatOutboundDefault,
        formatInboundDefault: formatInboundDefault
    };

    var Spinner = reactComponents.shapes.Spinner, Robot = reactComponents.shapes.Robot;
    var FragmentComponent = /** @class */ (function (_super) {
        __extends(FragmentComponent, _super);
        function FragmentComponent(props) {
            var _this = _super.call(this, props) || this;
            _this.updateStateWithValues = _this.updateStateWithValues.bind(_this);
            _this.cancelChanges = _this.cancelChanges.bind(_this);
            _this.submitChanges = _this.submitChanges.bind(_this);
            _this.formatSettingsForUpdate = _this.formatSettingsForUpdate.bind(_this);
            _this.onCheckboxChange = _this.onCheckboxChange.bind(_this);
            _this.onTextChange = _this.onTextChange.bind(_this);
            _this.generateBody = _this.generateBody.bind(_this);
            _this.checkPermissions = _this.checkPermissions.bind(_this);
            _this.checkEnabled = _this.checkEnabled.bind(_this);
            _this.pullSettingsToDisplay = _this.pullSettingsToDisplay.bind(_this);
            _this.createElement = _this.createElement.bind(_this);
            _this.onChangeSelectedFulfillmentLocation = _this.onChangeSelectedFulfillmentLocation.bind(_this);
            _this.processKeyForUpdate = _this.processKeyForUpdate.bind(_this);
            _this.getParentControlStyle = _this.getParentControlStyle.bind(_this);
            _this.state = {
                settings: __assign({}, defaultValues),
                changedFields: [],
                originalValues: {},
                selectedFulfillmentLocation: undefined,
                loading: true,
                etag: undefined,
                snackBar: {
                    showSnackBar: false
                }
            };
            return _this;
        }
        // Lifecycle Functions
        FragmentComponent.prototype.componentDidMount = function () {
            return __awaiter(this, void 0, void 0, function () {
                var _a, settings, etag;
                return __generator(this, function (_b) {
                    switch (_b.label) {
                        case 0: return [4 /*yield*/, getLogisticsLocationSettings(this.props.location.id, this.props.token, this.props.environment)];
                        case 1:
                            _a = _b.sent(), settings = _a.settings, etag = _a.etag;
                            this.setState({ originalValues: settings, etag: etag, selectedFulfillmentLocation: this.props.location.fulfillmentLocations[0].id, loading: false });
                            this.updateStateWithValues(settings);
                            return [2 /*return*/];
                    }
                });
            });
        };
        // Element interaction
        FragmentComponent.prototype.cancelChanges = function () {
            this.setState({ settings: __assign({}, this.state.originalValues) });
        };
        FragmentComponent.prototype.showSuccessSnackBar = function (message) {
            this.setState(function (prevState) { return __assign(__assign({}, prevState), { snackBar: { showSnackBar: true, style: 'success', delay: 3000, message: message } }); });
        };
        FragmentComponent.prototype.showErrorSnackBar = function (message) {
            this.setState(function (prevState) { return __assign(__assign({}, prevState), { snackBar: { showSnackBar: true, style: 'danger', message: message } }); });
        };
        FragmentComponent.prototype.onCheckboxChange = function (e, payload) {
            var _a = this.state, settings = _a.settings, changedFields = _a.changedFields;
            settings[payload] = !settings[payload];
            if (changedFields.includes(payload)) {
                changedFields = changedFields.filter(function (field) {
                    return field !== payload;
                });
            }
            else {
                changedFields = changedFields.concat(payload);
            }
            this.setState({ changedFields: changedFields, settings: settings });
        };
        FragmentComponent.prototype.onTextChange = function (e) {
            var _a = e.target, id = _a.id, value = _a.value, type = _a.type;
            if (type === 'select') {
                value = value.value;
            }
            var _b = this.state, settings = _b.settings, changedFields = _b.changedFields, originalValues = _b.originalValues;
            var originalValue = originalValues[id] || '';
            settings[id] = value;
            if (changedFields.includes(id)) {
                if (value === originalValue) {
                    changedFields = changedFields.filter(function (field) {
                        return field !== id;
                    });
                }
            }
            else {
                changedFields = changedFields.concat(id);
            }
            this.setState({ changedFields: changedFields, settings: settings });
        };
        FragmentComponent.prototype.onChangeSelectedFulfillmentLocation = function (e) {
            var value = e.value;
            this.setState({ selectedFulfillmentLocation: value });
        };
        FragmentComponent.prototype.submitChanges = function () {
            return __awaiter(this, void 0, void 0, function () {
                var formattedSettings_1, etag_1, err_1;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0:
                            _a.trys.push([0, 3, , 4]);
                            formattedSettings_1 = this.formatSettingsForUpdate();
                            return [4 /*yield*/, putLogisticsLocationSettings(this.props.location.id, this.props.token, this.props.environment, this.state.etag, formattedSettings_1)];
                        case 1:
                            _a.sent();
                            return [4 /*yield*/, getLogisticsLocationSettings(this.props.location.id, this.props.token, this.props.environment)];
                        case 2:
                            etag_1 = (_a.sent()).etag;
                            this.setState(function (prevState) {
                                return { changedFields: [], etag: etag_1, originalValues: formattedSettings_1 };
                            });
                            this.showSuccessSnackBar('Settings have been saved successfully!');
                            return [3 /*break*/, 4];
                        case 3:
                            err_1 = _a.sent();
                            this.showErrorSnackBar("Failed to update Shipping Console Configuration. Reason: " + err_1.message);
                            return [3 /*break*/, 4];
                        case 4: return [2 /*return*/];
                    }
                });
            });
        };
        FragmentComponent.prototype.processKeyForUpdate = function (prunedSettings, key, disabled) {
            if (disabled === void 0) { disabled = false; }
            if (!settingConfig[key]) {
                delete prunedSettings[key];
                return prunedSettings;
            }
            var parentDisabled = disabled;
            var parentKey = settingConfig[key].parent;
            if (parentKey) {
                if (!this.checkEnabled(parentKey)) {
                    parentDisabled = true;
                }
            }
            if (settingConfig[key].children) {
                for (var _i = 0, _a = settingConfig[key].children; _i < _a.length; _i++) {
                    var childKey = _a[_i];
                    prunedSettings = this.processKeyForUpdate(prunedSettings, childKey, parentDisabled);
                }
            }
            if (!parentDisabled && !settingConfig[key].doNotSend && (!settingConfig[key].validator || validators["" + settingConfig[key].validator](this.state.settings)) && this.state.settings[key]) {
                if (settingConfig[key].outboundFormatter) {
                    prunedSettings[key] = formatters["" + settingConfig[key].outboundFormatter](this.state.settings, this.props.location.localeSettings, key);
                }
                else {
                    prunedSettings[key] = this.state.settings[key];
                }
            }
            else {
                delete prunedSettings[key];
            }
            return prunedSettings;
        };
        // Massaging state with what comes from/goes to location config
        FragmentComponent.prototype.formatSettingsForUpdate = function () {
            var _a = this.state, originalValues = _a.originalValues, changedFields = _a.changedFields;
            var prunedSettings = Object.assign({}, originalValues);
            for (var _i = 0, changedFields_1 = changedFields; _i < changedFields_1.length; _i++) {
                var key = changedFields_1[_i];
                prunedSettings = this.processKeyForUpdate(prunedSettings, key);
            }
            return prunedSettings;
        };
        FragmentComponent.prototype.updateStateWithValues = function (values) {
            var settings = this.state.settings;
            for (var _i = 0, _a = Object.keys(values); _i < _a.length; _i++) {
                var key = _a[_i];
                if (!settingConfig[key])
                    continue;
                var parentKey = settingConfig[key].parent;
                if (parentKey && !values[parentKey]) {
                    if (settingConfig[parentKey].controlType === 'inverted') {
                        settings[parentKey] = false;
                    }
                    else {
                        settings[parentKey] = true;
                    }
                }
                if (settingConfig[key].inboundFormatter) {
                    settings[key] = formatters["" + settingConfig[key].inboundFormatter](values[key]);
                }
                else {
                    settings[key] = values[key];
                }
            }
            this.setState({ settings: settings });
        };
        FragmentComponent.prototype.checkEnabled = function (key) {
            var enabled = true;
            var parentKey = settingConfig[key].parent;
            if (parentKey) {
                enabled = this.state.settings[parentKey];
                if (settingConfig[parentKey].controlType === 'inverted')
                    enabled = !enabled;
                if (!this.checkEnabled(parentKey))
                    enabled = false;
            }
            return enabled;
        };
        FragmentComponent.prototype.getParentControlStyle = function (key) {
            return settingConfig[key].parent && settingConfig[settingConfig[key].parent].controlStyle;
        };
        FragmentComponent.prototype.checkPermissions = function (config) {
            return this.props.isAdvancedUser || config.visibility === 'all';
        };
        // Rendering Helpers
        FragmentComponent.prototype.generateBody = function () {
            var settingsToDisplay = this.pullSettingsToDisplay();
            return settingsToDisplay.map(this.createElement);
        };
        FragmentComponent.prototype.pullSettingsToDisplay = function () {
            var settings = [];
            for (var _i = 0, _a = Object.keys(settingConfig); _i < _a.length; _i++) {
                var key = _a[_i];
                if (this.checkPermissions(settingConfig[key]) && !settingConfig[key].parent || this.getParentControlStyle(key) === 'hide' && this.checkEnabled(key)) {
                    settings = settings.concat(key);
                }
            }
            return settings;
        };
        FragmentComponent.prototype.createElement = function (key) {
            var _this = this;
            var config = settingConfig[key];
            var component;
            var style;
            var bsStyle = '';
            var disabled = false;
            if (config.parent) {
                if (!this.checkEnabled(key) && this.getParentControlStyle(key) === 'disable') {
                    disabled = true;
                }
                if (settingConfig[config.parent].controlStyling)
                    style = styles[settingConfig[config.parent].controlStyling];
            }
            switch (config.type) {
                case 'header':
                    component = (React.createElement("h4", { key: key }, config.displayLabel));
                    break;
                case 'boolean':
                    component = (React.createElement("div", { className: style + " " + styles.flex, key: key + "-div" },
                        React.createElement(reactComponents.Checkbox, { id: key, key: key, payload: key, checked: this.state.settings[key], label: config.displayLabel, onChange: this.onCheckboxChange, disabled: disabled })));
                    break;
                case 'textarea':
                    component = (React.createElement("div", { className: style + " " + styles.flex, key: key + "-div" },
                        React.createElement(reactComponents.TextField, { id: key, key: key, value: this.state.settings[key], helpText: config.helpText, label: config.displayLabel, onChange: this.onTextChange, required: config.required, bsStyle: bsStyle, disabled: disabled, type: 'textarea' })));
                    break;
                case 'email':
                    if (this.state.settings[key] && !validators.validateEmailValue(this.state.settings[key])) {
                        bsStyle = 'error';
                    }
                    component = (React.createElement("div", { className: style + " " + styles.flex, key: key + "-div" },
                        React.createElement(reactComponents.TextField, { id: key, key: key, value: this.state.settings[key], helpText: config.helpText, label: config.displayLabel, onChange: this.onTextChange, required: config.required, bsStyle: bsStyle, disabled: disabled, type: 'email' })));
                    break;
                case 'number':
                    var numberLabel = config.displayLabel.concat(this.props.location.localeSettings[config.locationUnit] ? " (" + this.props.location.localeSettings[config.locationUnit] + ")" : '');
                    component = (React.createElement("div", { className: style + " " + styles.flex, key: key + "-div" },
                        React.createElement(reactComponents.TextField, { id: key, key: key, value: this.state.settings[key], helpText: config.helpText, label: numberLabel, onChange: this.onTextChange, required: config.required, bsStyle: bsStyle, disabled: disabled, type: 'number', step: '0.01', min: '0', max: '1000000' })));
                    break;
                case 'url':
                    if (this.state.settings[key] && !validators.validateUrlValue(this.state.settings[key])) {
                        bsStyle = 'error';
                    }
                    component = (React.createElement("div", { className: style + " " + styles.flex, key: key + "-div" },
                        React.createElement(reactComponents.TextField, { id: key, key: key, value: this.state.settings[key], helpText: config.helpText, label: config.displayLabel, onChange: this.onTextChange, required: config.required, bsStyle: bsStyle, disabled: disabled, type: 'url' })));
                    break;
                case 'countryCode':
                    var country = countryList.find(function (country) { return country.value === _this.state.settings[key]; }) || { label: '', value: '' };
                    component = (React.createElement("div", { className: style + " " + styles.flex, key: key + "-div", style: { width: '300px', marginLeft: '75px' } }, this.state.settings['customShip-defaultCountryEnabled'] && React.createElement(reactComponents.Select, { id: key, key: key, value: country, label: config.displayLabel, onChange: function (value) { return _this.onTextChange({ target: { value: value, id: key, type: 'select' } }); }, required: config.required, bsStyle: bsStyle, disabled: disabled, options: countryList, helpText: config.helpText, type: 'countryCode' })));
                    break;
                case 'fulfillmentLocationId':
                    component = (React.createElement("div", { className: style + " " + styles.flex, key: key + "-div" },
                        React.createElement(reactComponents.TextField, { id: key, key: key, value: this.state.settings[key], helpText: config.helpText, label: config.displayLabel, onChange: this.onTextChange, required: config.required, bsStyle: bsStyle, disabled: disabled })));
                    break;
                case 'enum':
                    var enumValue = { label: this.state.settings[key], value: this.state.settings[key] };
                    component = (React.createElement("div", { className: "" + styles.flex, key: key + "-div" },
                        React.createElement(reactComponents.Select, { id: key, key: key, value: enumValue, label: config.displayLabel, onChange: function (value) { return _this.onTextChange({ target: { value: value, id: key, type: 'select' } }); }, required: config.required, bsStyle: bsStyle, disabled: disabled, options: config.options.map(function (value) { return ({ label: value, value: value }); }), helpText: config.helpText })));
                    break;
                case 'currencyCode':
                    var currencyCode = { label: this.state.settings[key], value: this.state.settings[key] };
                    component = (React.createElement("div", { className: "" + styles.child, key: key + "-div", style: { width: '130px' } },
                        React.createElement(reactComponents.Select, { id: key, key: key, value: currencyCode, label: config.displayLabel, onChange: function (value) { return _this.onTextChange({ target: { value: value, id: key, type: 'select' } }); }, required: config.required, bsStyle: bsStyle, disabled: disabled, options: currencyList.currencyCode.map(function (value) { return ({ label: value, value: value }); }), helpText: config.helpText })));
                    break;
                default:
                    component = (React.createElement("div", null,
                        "Unsupported type ",
                        config.type));
            }
            if (config.visibility === 'LT') {
                return (React.createElement("div", { key: key + "-tooltip" },
                    React.createElement(reactComponents.Tooltip, { direction: 'right', contents: 'This setting is only visible to members of Logistics Technology' }, component)));
            }
            return component;
        };
        FragmentComponent.prototype.render = function () {
            var _this = this;
            var snackBar = this.state.snackBar;
            if (this.state.loading) {
                return (React.createElement("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' } },
                    React.createElement(Spinner, { size: 'large' })));
            }
            return (React.createElement("div", null,
                React.createElement(reactComponents.Snackbar, { show: snackBar.showSnackBar, bsStyle: snackBar.style, delay: snackBar.delay, onHideSnackbar: function () { return _this.setState(function (prevState) {
                        return __assign(__assign({}, prevState), { snackBar: __assign(__assign({}, prevState.snackBar), { showSnackBar: false }) });
                    }); } }, snackBar.message),
                React.createElement("div", { className: "flex", style: { justifyContent: 'space-between', alignItems: 'baseline' } },
                    React.createElement("h2", { style: { 'fontWeight': 'bold' } }, "Shipping Console"),
                    React.createElement("a", { href: "https://cimpress-support.atlassian.net/wiki/spaces/LT/pages/645565165/Shipping+Console+configuration" },
                        React.createElement("span", { style: { verticalAlign: 'middle' } },
                            React.createElement(IconMessagesBubbleQuestion_1.default, null)),
                        ' ',
                        "Learn more about Shipping Console settings")),
                React.createElement("div", { className: 'card' },
                    React.createElement("div", { className: styles.margined }, this.generateBody()),
                    React.createElement("div", { className: styles.margined, style: { 'marginBottom': 10 } },
                        React.createElement(reactComponents.Button, { style: { 'marginRight': 10 }, type: 'default', onClick: this.cancelChanges }, "Cancel"),
                        React.createElement(reactComponents.Button, { type: 'primary', disabled: this.state.changedFields.length < 1, onClick: this.submitChanges }, "Submit")))));
        };
        return FragmentComponent;
    }(React.Component));

    function Fragment(props) {
        return (React.createElement(React.Fragment, null,
            React.createElement(FragmentComponent, __assign({}, props))));
    }

    return Fragment;

}
