'use strict';

const index = require('./index-8277cbb3.js');
const global = require('./global-b7b1b8fe.js');
const JSS = require('./JSS-8503a151.js');
const data = require('./data-8c8a08f6.js');

const style = {
  Description: {
    fontSize: "var(--sl-font-size-small)",
    marginTop: "var(--sl-spacing-small)",
    margin: "0 0 var(--sl-spacing-large)",
    color: "var(--sqm-text-subdued)",
  },
  Header: {
    fontSize: "var(--sl-font-size-large)",
    fontWeight: "var(-sl-font-weight-semibold)",
    margin: "0 0 var(--sl-spacing-xxx-small)",
  },
  Container: {},
  InvoiceTableContaier: {
    "& sl-details::part(base)": {
      border: "none",
    },
    "& sl-details::part(content)": {
      padding: 0,
    },
    "& sl-details::part(header)": {
      fontSize: "var(--sl-font-size-medium)",
      padding: "0px",
    },
    "& sl-details::part(summary)": {
      fontWeight: "var(-sl-font-weight-semibold)",
    },
    "& sl-details::part(summary-icon)": {
      marginRight: "100%",
      marginLeft: "var(--sl-spacing-x-small)",
      transform: "rotate(90deg)",
    },
    "& sl-details[open]::part(summary-icon)": {
      transform: "rotate(270deg)",
    },
  },
};
function InvoiceTableView(props, children) {
  const sheet = JSS.createStyleSheet(style);
  const styleString = sheet.toString();
  const vanillaStyle = `
    :host{
      display: block;
    }`;
  return (index.h("div", { class: sheet.classes.Container },
    index.h("style", { type: "text/css" },
      vanillaStyle,
      styleString),
    index.h("div", { class: sheet.classes.InvoiceTableContaier },
      index.h("sl-details", { summary: props.header },
        index.h("p", { class: sheet.classes.Description }, props.description),
        children))));
}

const INDIRECT_TAX_PROVINCES = [
  { regionCode: "ALBERTA", taxType: "GST", displayName: "Alberta" },
  {
    regionCode: "BRITISHCOLUMBIA",
    taxType: "HST",
    displayName: "British Columbia",
  },
  { regionCode: "MANITOBA", taxType: "HST", displayName: "Manitoba" },
  {
    regionCode: "NEWBRUNSWICK",
    taxType: "HST",
    displayName: "New Brunswick",
  },
  {
    regionCode: "NEWFOUNDLANDLABRADOR",
    taxType: "HST",
    displayName: "Newfoundland",
  },
  {
    regionCode: "NORTHWESTTERRITORIES",
    taxType: "GST",
    displayName: "North West Territories",
  },
  { regionCode: "NOVASCOTIA", taxType: "HST", displayName: "Nova Scotia" },
  { regionCode: "NUNAVUT", taxType: "HST", displayName: "Nunavut" },
  { regionCode: "ONTARIO", taxType: "HST", displayName: "Ontario" },
  {
    regionCode: "PRINCEEDWARDISLAND",
    taxType: "HST",
    displayName: "Prince Edward Island",
  },
  { regionCode: "QUEBEC", taxType: "GST", displayName: "Quebec" },
  { regionCode: "SASKATCHEWAN", taxType: "HST", displayName: "Saskatchewan" },
  { regionCode: "YUKON", taxType: "GST", displayName: "Yukon" },
];
const INDIRECT_TAX_SPAIN_REGIONS = [
  { regionCode: "SPAINPROPER", taxType: "VAT", displayName: "Spain Proper" },
  {
    regionCode: "CANARYISLANDS",
    taxType: "VAT",
    displayName: "Canary Islands",
  },
];
const ADDRESS_REGIONS = {
  CA: {
    labelEnum: "PROVINCE",
    regions: [
      {
        label: "Alberta",
        value: "ALBERTA",
      },
      {
        label: "British Columbia",
        value: "BRITISHCOLUMBIA",
      },
      {
        label: "Manitoba",
        value: "MANITOBA",
      },
      {
        label: "New Brunswick",
        value: "NEWBRUNSWICK",
      },
      {
        label: "Newfoundland & Labrador",
        value: "NEWFOUNDLANDANDLABRADOR",
      },
      {
        label: "Northwest Territories",
        value: "NORTHWESTTERRITORIES",
      },
      {
        label: "Nova Scotia",
        value: "NOVASCOTIA",
      },
      {
        label: "Nunavut",
        value: "NUNAVUT",
      },
      {
        label: "Ontario",
        value: "ONTARIO",
      },
      {
        label: "Prince Edward Island",
        value: "PRINCEEDWARDISLAND",
      },
      {
        label: "Quebec",
        value: "QUEBEC",
      },
      {
        label: "Saskatchewan",
        value: "SASKATCHEWAN",
      },
      {
        label: "Yukon",
        value: "YUKON",
      },
    ],
  },
  ES: {
    labelEnum: "REGION",
    regions: [
      {
        label: "Canary Islands",
        value: "CANARYISLANDS",
      },
      {
        label: "Spain Proper",
        value: "SPAINPROPER",
      },
    ],
  },
  AU: {
    labelEnum: "STATE",
    regions: [
      {
        label: "Australian Capital Territory",
        value: "CAPITALTERRITORY",
      },
      {
        label: "New South Wales",
        value: "NEWSOUTHWALES",
      },
      {
        label: "Northern Territory",
        value: "NORTHERNTERRITORY",
      },
      {
        label: "Queensland",
        value: "QUEENSLAND",
      },
      {
        label: "South Australia",
        value: "SOUTHAUSTRALIA",
      },
      {
        label: "Tasmania",
        value: "TASMANIA",
      },
      {
        label: "Victoria",
        value: "VICTORIA",
      },
      {
        label: "Western Australia",
        value: "WESTERNAUSTRALIA",
      },
    ],
  },
  US: {
    labelEnum: "STATE",
    regions: [
      {
        label: "Alabama",
        value: "ALABAMA",
      },
      {
        label: "Alaska",
        value: "ALASKA",
      },
      {
        label: "Arizona",
        value: "ARIZONA",
      },
      {
        label: "Arkansas",
        value: "ARKANSAS",
      },
      {
        label: "California",
        value: "CALIFORNIA",
      },
      {
        label: "Colorado",
        value: "COLORADO",
      },
      {
        label: "Connecticut",
        value: "CONNECTICUT",
      },
      {
        label: "Delaware",
        value: "DELAWARE",
      },
      {
        label: "District of Columbia",
        value: "DISTRICTOFCOLUMBIA",
      },
      {
        label: "Florida",
        value: "FLORIDA",
      },
      {
        label: "Georgia",
        value: "GEORGIA",
      },
      {
        label: "Hawaii",
        value: "HAWAII",
      },
      {
        label: "Idaho",
        value: "IDAHO",
      },
      {
        label: "Illinois",
        value: "ILLINOIS",
      },
      {
        label: "Indiana",
        value: "INDIANA",
      },
      {
        label: "Iowa",
        value: "IOWA",
      },
      {
        label: "Kansas",
        value: "KANSAS",
      },
      {
        label: "Kentucky",
        value: "KENTUCKY",
      },
      {
        label: "Louisiana",
        value: "LOUISIANA",
      },
      {
        label: "Maine",
        value: "MAINE",
      },
      {
        label: "Maryland",
        value: "MARYLAND",
      },
      {
        label: "Massachusetts",
        value: "MASSACHUSETTS",
      },
      {
        label: "Michigan",
        value: "MICHIGAN",
      },
      {
        label: "Minnesota",
        value: "MINNESOTA",
      },
      {
        label: "Mississippi",
        value: "MISSISSIPPI",
      },
      {
        label: "Missouri",
        value: "MISSOURI",
      },
      {
        label: "Montana",
        value: "MONTANA",
      },
      {
        label: "Nebraska",
        value: "NEBRASKA",
      },
      {
        label: "Nevada",
        value: "NEVADA",
      },
      {
        label: "New Hampshire",
        value: "NEWHAMPSHIRE",
      },
      {
        label: "New Jersey",
        value: "NEWJERSEY",
      },
      {
        label: "New Mexico",
        value: "NEWMEXICO",
      },
      {
        label: "New York",
        value: "NEWYORK",
      },
      {
        label: "North Carolina",
        value: "NORTHCAROLINA",
      },
      {
        label: "North Dakota",
        value: "NORTHDAKOTA",
      },
      {
        label: "Ohio",
        value: "OHIO",
      },
      {
        label: "Oklahoma",
        value: "OKLAHOMA",
      },
      {
        label: "Oregon",
        value: "OREGON",
      },
      {
        label: "Pennsylvania",
        value: "PENNSYLVANIA",
      },
      {
        label: "Rhode Island",
        value: "RHODEISLAND",
      },
      {
        label: "South Carolina",
        value: "SOUTHCAROLINA",
      },
      {
        label: "South Dakota",
        value: "SOUTHDAKOTA",
      },
      {
        label: "Tennessee",
        value: "TENNESSEE",
      },
      {
        label: "Texas",
        value: "TEXAS",
      },
      {
        label: "Utah",
        value: "UTAH",
      },
      {
        label: "Vermont",
        value: "VERMONT",
      },
      {
        label: "Virgin Islands",
        value: "VIRGINISLANDS",
      },
      {
        label: "Virginia",
        value: "VIRGINIA",
      },
      {
        label: "Washington",
        value: "WASHINGTON",
      },
      {
        label: "West Virginia",
        value: "WESTVIRGINIA",
      },
      {
        label: "Wisconsin",
        value: "WISCONSIN",
      },
      {
        label: "Wyoming",
        value: "WYOMING",
      },
      {
        label: "Americas Forces",
        value: "AAMILITARY",
      },
      {
        label: "Europe, Middle East, Canada, Africa and Canada Forces",
        value: "AEMILITARY",
      },
      {
        label: "Pacific Forces",
        value: "APMILITARY",
      },
      {
        label: "Other",
        value: "OTHER",
      },
    ],
  },
};

const vatLabels = {
  GB: "VAT",
  AU: "GST",
  NZ: "GST",
  CA: "HST",
  AT: "VAT",
  BE: "VAT",
  BG: "VAT",
  HR: "VAT",
  CY: "VAT",
  CZ: "VAT",
  DK: "VAT",
  EE: "VAT",
  FI: "VAT",
  FR: "VAT",
  DE: "VAT",
  GR: "VAT",
  HU: "VAT",
  IE: "VAT",
  IT: "VAT",
  LV: "VAT",
  LT: "VAT",
  LU: "VAT",
  MT: "VAT",
  NL: "VAT",
  PL: "VAT",
  PT: "VAT",
  RO: "VAT",
  SK: "VAT",
  SI: "VAT",
  ES: "VAT",
  SE: "VAT",
  IS: "VAT",
  IN: "GST",
  IL: "VAT",
  JP: "CT",
  MX: "VAT",
  NO: "VAT",
  SG: "GST",
  ZA: "VAT",
  KR: "VAT",
  CH: "VAT",
  TW: "VAT",
  TH: "VAT",
  PH: "VAT",
  MY: "SST",
  AE: "VAT",
  TR: "VAT",
  RU: "VAT",
};

const style$1 = {
  Container: {
    width: "100%",
  },
  InputContainer: {
    width: "100%",
    display: "flex",
    justifyContent: "flex-start",
    flexDirection: "column",
    gap: "16px",
    padding: "16px",
    maxWidth: "450px",
  },
  ConditionalInputsContainer: {
    width: "100%",
    display: "flex",
    justifyContent: "flex-start",
    flexDirection: "column",
    gap: "16px",
  },
  HR: {
    border: "var(--sqm-border-thickness, 1px) solid var(--sqm-border-color)",
    margin: "10px 0",
  },
  Input: { maxWidth: "500px" },
  Checkbox: {
    "&::part(control)": {
      borderRadius: "0 !important",
    },
  },
  SearchInput: {
    padding: "var(--sl-spacing-x-small)",
  },
  ErrorInput: {
    maxWidth: "500px",
    "&::part(base)": {
      border: "var(--sqm-border-thickness, 1px) solid var(--sqm-danger-color-border)",
      borderRadius: "var(--sl-input-border-radius-medium)",
    },
    "&::part(help-text)": {
      color: "var(--sqm-danger-color-text)",
    },
  },
};
const sheet = JSS.createStyleSheet(style$1);
const styleString = sheet.toString();
const vanillaStyle = `
    :host{
      display: block;   
    }
    * {
       margin: 0;
       padding: 0;
       box-sizing: border-box;
    }
    sl-menu-item::part(base) {
      color: var(--sqm-input-color);
    }

    sl-menu-item::part(base):hover {
      background-color: var(--sqm-input-border-color-hover);
    }
    sl-checkbox[checked]::part(control){
      background-color: var(--sqm-input-border-color-focus);
    }

    sl-checkbox[checked]::part(checked-icon){
      color: var(--sqm-input-background);
    }
  `;
const OtherRegionSlotView = (props) => {
  var _a, _b, _c;
  const { states, states: { formState }, callbacks, text, } = props;
  const { classes } = sheet;
  const getTaxFieldLabel = (taxType) => {
    return global.intl.formatMessage({
      id: `tax-field-label${taxType}`,
      defaultMessage: text.indirectTaxNumber,
    }, { taxType });
  };
  const getTaxFieldError = (taxType) => {
    return global.intl.formatMessage({
      id: `tax-field-label${taxType}`,
      defaultMessage: text.error.indirectTaxNumber,
    }, { taxType });
  };
  const IndirectTaxNumberInput = ({ label, error, name, }) => {
    var _a;
    return (index.h("sl-input", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, label: label, disabled: states.loading || states.disabled, value: formState[name] }, (((_a = formState.errors) === null || _a === void 0 ? void 0 : _a[name]) && {
      class: classes.ErrorInput,
      helpText: error,
    }), { id: name, name: `/${name}` })));
  };
  const SpainFields = () => {
    var _a, _b;
    return (index.h("div", { class: classes.ConditionalInputsContainer },
      index.h("sl-select", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, value: formState.subRegion, label: text.subRegion, disabled: states.loading || states.disabled }, (((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.indirectTaxNumber) && {
        class: classes.ErrorInput,
        helpText: data.formatErrorMessage(text.subRegion, text.error.fieldRequiredError),
      }), { id: "subRegion", name: "/subRegion" }), props.data.esRegions.map((r) => (index.h("sl-menu-item", { value: r.regionCode }, r.displayName)))),
      index.h(IndirectTaxNumberInput, { name: "indirectTaxNumber", label: getTaxFieldLabel("VAT"), error: getTaxFieldError("VAT") }),
      index.h("sl-checkbox", { class: classes.Checkbox, exportparts: "label: input-label, base: input-base", checked: formState.hasSubRegionTaxNumber, "onSl-change": callbacks.onSpainToggle, disabled: states.disabled || states.isPartner }, text.isRegisteredSubRegionIncomeTax),
      formState.hasSubRegionTaxNumber && (index.h("sl-input", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, label: text.subRegionTaxNumberLabel, disabled: states.loading || states.disabled, value: formState.subRegionTaxNumber }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.subRegionTaxNumber) && {
        class: classes.ErrorInput,
        helpText: data.formatErrorMessage(text.subRegionTaxNumberLabel, text.error.fieldRequiredError),
      }), { id: "subRegionTaxNumber", name: "/subRegionTaxNumber" })))));
  };
  const CanadaFields = () => {
    var _a, _b;
    const { classes } = sheet;
    const currentTaxType = (_a = INDIRECT_TAX_PROVINCES === null || INDIRECT_TAX_PROVINCES === void 0 ? void 0 : INDIRECT_TAX_PROVINCES.find((p) => p.regionCode === formState.province)) === null || _a === void 0 ? void 0 : _a.taxType;
    return (index.h("div", { class: classes.ConditionalInputsContainer },
      index.h("sl-select", Object.assign({ required: true, value: formState.province, exportparts: "label: input-label, base: input-base", class: classes.Input, label: text.province, disabled: states.loading || states.disabled, "onSl-select": (e) => callbacks.onFormChange("province", e) }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.province) && {
        class: classes.ErrorInput,
        helpText: data.formatErrorMessage(text.province, text.error.fieldRequiredError),
      }), { id: "province", name: "/province" }), props.data.provinces.map((p) => (index.h("sl-menu-item", { value: p.regionCode }, p.displayName)))),
      currentTaxType === "GST" && (index.h(IndirectTaxNumberInput, { label: getTaxFieldLabel("GST"), error: getTaxFieldError("GST"), name: "indirectTaxNumber" })),
      currentTaxType === "HST" && (index.h(IndirectTaxNumberInput, { label: getTaxFieldLabel("HST"), error: getTaxFieldError("HST"), name: "indirectTaxNumber" })),
      formState.province === "QUEBEC" && (index.h("div", { class: classes.ConditionalInputsContainer },
        index.h("sl-checkbox", { class: classes.Checkbox, exportparts: "label: input-label, base: input-base", "onSl-change": callbacks.onQstToggle, checked: formState.hasQst, disabled: states.isPartner || states.disabled }, text.isRegisteredQST),
        formState.hasQst && (index.h(IndirectTaxNumberInput, { name: "qstNumber", label: text.qstNumber, error: data.formatErrorMessage(text.qstNumber, text.error.fieldRequiredError) }))))));
  };
  const getActiveForm = (selectedRegion) => {
    var _a;
    switch (selectedRegion) {
      case "CA":
        return index.h(CanadaFields, null);
      case "ES":
        return index.h(SpainFields, null);
      default:
        return (index.h("sl-input", Object.assign({ required: true, exportparts: "label: input-label, base: input-base", class: classes.Input, value: formState.indirectTaxNumber, label: getTaxFieldLabel(vatLabels[selectedRegion] || "GENERAL"), disabled: states.loading || states.disabled }, (((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.indirectTaxNumber) && {
          class: classes.ErrorInput,
          helpText: getTaxFieldError(vatLabels[selectedRegion] || "GENERAL"),
        }), { id: "indirectTaxNumber", name: "/indirectTaxNumber" })));
    }
  };
  const activeForm = getActiveForm(formState.selectedRegion);
  return (index.h("div", { style: states.hide ? { display: "none" } : {} },
    index.h("form", { class: classes.Container },
      index.h("style", { type: "text/css" },
        styleString,
        vanillaStyle),
      index.h("hr", { class: classes.HR }),
      index.h("div", { class: classes.InputContainer },
        index.h("sl-select", Object.assign({ required: true, class: classes.Input, value: formState.selectedRegion, exportparts: "label: input-label, base: input-base", label: text.selectedRegion, disabled: states.loading || states.disabled, "onSl-select": (e) => callbacks.onFormChange("selectedRegion", e) }, (((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.selectedRegion) && {
          class: classes.ErrorInput,
          helpText: data.formatErrorMessage(text.selectedRegion, text.error.fieldRequiredError),
        }), { id: "selectedRegion", name: "/selectedRegion" }),
          index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
              // Stop shoelace intercepting key presses
              e.stopPropagation();
            }, "onSl-input": (e) => {
              callbacks.setCountrySearch(e.target.value);
            } }), (_b = props.data.countries) === null || _b === void 0 ? void 0 :
          _b.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_c = props.data.allCountries) === null || _c === void 0 ? void 0 :
          _c.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
        activeForm),
      index.h("hr", { class: classes.HR }))));
};

const PHONE_EXTENSIONS = {
  AF: {
    name: "Afghanistan",
    dial_code: "+93",
  },
  AX: {
    name: "Aland Islands",
    dial_code: "+358",
  },
  AL: {
    name: "Albania",
    dial_code: "+355",
  },
  DZ: {
    name: "Algeria",
    dial_code: "+213",
  },
  AS: {
    name: "AmericanSamoa",
    dial_code: "+1684",
  },
  AD: {
    name: "Andorra",
    dial_code: "+376",
  },
  AO: {
    name: "Angola",
    dial_code: "+244",
  },
  AI: {
    name: "Anguilla",
    dial_code: "+1264",
  },
  AQ: {
    name: "Antarctica",
    dial_code: "+672",
  },
  AG: {
    name: "Antigua and Barbuda",
    dial_code: "+1268",
  },
  AR: {
    name: "Argentina",
    dial_code: "+54",
  },
  AM: {
    name: "Armenia",
    dial_code: "+374",
  },
  AW: {
    name: "Aruba",
    dial_code: "+297",
  },
  AU: {
    name: "Australia",
    dial_code: "+61",
  },
  AT: {
    name: "Austria",
    dial_code: "+43",
  },
  AZ: {
    name: "Azerbaijan",
    dial_code: "+994",
  },
  BS: {
    name: "Bahamas",
    dial_code: "+1242",
  },
  BH: {
    name: "Bahrain",
    dial_code: "+973",
  },
  BD: {
    name: "Bangladesh",
    dial_code: "+880",
  },
  BB: {
    name: "Barbados",
    dial_code: "+1246",
  },
  BY: {
    name: "Belarus",
    dial_code: "+375",
  },
  BE: {
    name: "Belgium",
    dial_code: "+32",
  },
  BZ: {
    name: "Belize",
    dial_code: "+501",
  },
  BJ: {
    name: "Benin",
    dial_code: "+229",
  },
  BM: {
    name: "Bermuda",
    dial_code: "+1441",
  },
  BT: {
    name: "Bhutan",
    dial_code: "+975",
  },
  BO: {
    name: "Bolivia, Plurinational State of",
    dial_code: "+591",
  },
  BA: {
    name: "Bosnia and Herzegovina",
    dial_code: "+387",
  },
  BW: {
    name: "Botswana",
    dial_code: "+267",
  },
  BR: {
    name: "Brazil",
    dial_code: "+55",
  },
  IO: {
    name: "British Indian Ocean Territory",
    dial_code: "+246",
  },
  BN: {
    name: "Brunei Darussalam",
    dial_code: "+673",
  },
  BG: {
    name: "Bulgaria",
    dial_code: "+359",
  },
  BF: {
    name: "Burkina Faso",
    dial_code: "+226",
  },
  BI: {
    name: "Burundi",
    dial_code: "+257",
  },
  KH: {
    name: "Cambodia",
    dial_code: "+855",
  },
  CM: {
    name: "Cameroon",
    dial_code: "+237",
  },
  CA: {
    name: "Canada",
    dial_code: "+1",
  },
  CV: {
    name: "Cape Verde",
    dial_code: "+238",
  },
  KY: {
    name: "Cayman Islands",
    dial_code: "+ 345",
  },
  CF: {
    name: "Central African Republic",
    dial_code: "+236",
  },
  TD: {
    name: "Chad",
    dial_code: "+235",
  },
  CL: {
    name: "Chile",
    dial_code: "+56",
  },
  CN: {
    name: "China",
    dial_code: "+86",
  },
  CX: {
    name: "Christmas Island",
    dial_code: "+61",
  },
  CC: {
    name: "Cocos (Keeling) Islands",
    dial_code: "+61",
  },
  CO: {
    name: "Colombia",
    dial_code: "+57",
  },
  KM: {
    name: "Comoros",
    dial_code: "+269",
  },
  CG: {
    name: "Congo",
    dial_code: "+242",
  },
  CD: {
    name: "Congo, The Democratic Republic of the Congo",
    dial_code: "+243",
  },
  CK: {
    name: "Cook Islands",
    dial_code: "+682",
  },
  CR: {
    name: "Costa Rica",
    dial_code: "+506",
  },
  CI: {
    name: "Cote d'Ivoire",
    dial_code: "+225",
  },
  HR: {
    name: "Croatia",
    dial_code: "+385",
  },
  CU: {
    name: "Cuba",
    dial_code: "+53",
  },
  CY: {
    name: "Cyprus",
    dial_code: "+357",
  },
  CZ: {
    name: "Czech Republic",
    dial_code: "+420",
  },
  DK: {
    name: "Denmark",
    dial_code: "+45",
  },
  DJ: {
    name: "Djibouti",
    dial_code: "+253",
  },
  DM: {
    name: "Dominica",
    dial_code: "+1767",
  },
  DO: {
    name: "Dominican Republic",
    dial_code: "+1849",
  },
  EC: {
    name: "Ecuador",
    dial_code: "+593",
  },
  EG: {
    name: "Egypt",
    dial_code: "+20",
  },
  SV: {
    name: "El Salvador",
    dial_code: "+503",
  },
  GQ: {
    name: "Equatorial Guinea",
    dial_code: "+240",
  },
  ER: {
    name: "Eritrea",
    dial_code: "+291",
  },
  EE: {
    name: "Estonia",
    dial_code: "+372",
  },
  ET: {
    name: "Ethiopia",
    dial_code: "+251",
  },
  FK: {
    name: "Falkland Islands (Malvinas)",
    dial_code: "+500",
  },
  FO: {
    name: "Faroe Islands",
    dial_code: "+298",
  },
  FJ: {
    name: "Fiji",
    dial_code: "+679",
  },
  FI: {
    name: "Finland",
    dial_code: "+358",
  },
  FR: {
    name: "France",
    dial_code: "+33",
  },
  GF: {
    name: "French Guiana",
    dial_code: "+594",
  },
  PF: {
    name: "French Polynesia",
    dial_code: "+689",
  },
  GA: {
    name: "Gabon",
    dial_code: "+241",
  },
  GM: {
    name: "Gambia",
    dial_code: "+220",
  },
  GE: {
    name: "Georgia",
    dial_code: "+995",
  },
  DE: {
    name: "Germany",
    dial_code: "+49",
  },
  GH: {
    name: "Ghana",
    dial_code: "+233",
  },
  GI: {
    name: "Gibraltar",
    dial_code: "+350",
  },
  GR: {
    name: "Greece",
    dial_code: "+30",
  },
  GL: {
    name: "Greenland",
    dial_code: "+299",
  },
  GD: {
    name: "Grenada",
    dial_code: "+1473",
  },
  GP: {
    name: "Guadeloupe",
    dial_code: "+590",
  },
  GU: {
    name: "Guam",
    dial_code: "+1671",
  },
  GT: {
    name: "Guatemala",
    dial_code: "+502",
  },
  GG: {
    name: "Guernsey",
    dial_code: "+44",
  },
  GN: {
    name: "Guinea",
    dial_code: "+224",
  },
  GW: {
    name: "Guinea-Bissau",
    dial_code: "+245",
  },
  GY: {
    name: "Guyana",
    dial_code: "+595",
  },
  HT: {
    name: "Haiti",
    dial_code: "+509",
  },
  VA: {
    name: "Holy See (Vatican City State)",
    dial_code: "+379",
  },
  HN: {
    name: "Honduras",
    dial_code: "+504",
  },
  HK: {
    name: "Hong Kong",
    dial_code: "+852",
  },
  HU: {
    name: "Hungary",
    dial_code: "+36",
  },
  IS: {
    name: "Iceland",
    dial_code: "+354",
  },
  IN: {
    name: "India",
    dial_code: "+91",
  },
  ID: {
    name: "Indonesia",
    dial_code: "+62",
  },
  IR: {
    name: "Iran, Islamic Republic of Persian Gulf",
    dial_code: "+98",
  },
  IQ: {
    name: "Iraq",
    dial_code: "+964",
  },
  IE: {
    name: "Ireland",
    dial_code: "+353",
  },
  IM: {
    name: "Isle of Man",
    dial_code: "+44",
  },
  IL: {
    name: "Israel",
    dial_code: "+972",
  },
  IT: {
    name: "Italy",
    dial_code: "+39",
  },
  JM: {
    name: "Jamaica",
    dial_code: "+1876",
  },
  JP: {
    name: "Japan",
    dial_code: "+81",
  },
  JE: {
    name: "Jersey",
    dial_code: "+44",
  },
  JO: {
    name: "Jordan",
    dial_code: "+962",
  },
  KZ: {
    name: "Kazakhstan",
    dial_code: "+77",
  },
  KE: {
    name: "Kenya",
    dial_code: "+254",
  },
  KI: {
    name: "Kiribati",
    dial_code: "+686",
  },
  KP: {
    name: "Korea, Democratic People's Republic of Korea",
    dial_code: "+850",
  },
  KR: {
    name: "Korea, Republic of South Korea",
    dial_code: "+82",
  },
  KW: {
    name: "Kuwait",
    dial_code: "+965",
  },
  KG: {
    name: "Kyrgyzstan",
    dial_code: "+996",
  },
  LA: {
    name: "Laos",
    dial_code: "+856",
  },
  LV: {
    name: "Latvia",
    dial_code: "+371",
  },
  LB: {
    name: "Lebanon",
    dial_code: "+961",
  },
  LS: {
    name: "Lesotho",
    dial_code: "+266",
  },
  LR: {
    name: "Liberia",
    dial_code: "+231",
  },
  LY: {
    name: "Libyan Arab Jamahiriya",
    dial_code: "+218",
  },
  LI: {
    name: "Liechtenstein",
    dial_code: "+423",
  },
  LT: {
    name: "Lithuania",
    dial_code: "+370",
  },
  LU: {
    name: "Luxembourg",
    dial_code: "+352",
  },
  MO: {
    name: "Macao",
    dial_code: "+853",
  },
  MK: {
    name: "Macedonia",
    dial_code: "+389",
  },
  MG: {
    name: "Madagascar",
    dial_code: "+261",
  },
  MW: {
    name: "Malawi",
    dial_code: "+265",
  },
  MY: {
    name: "Malaysia",
    dial_code: "+60",
  },
  MV: {
    name: "Maldives",
    dial_code: "+960",
  },
  ML: {
    name: "Mali",
    dial_code: "+223",
  },
  MT: {
    name: "Malta",
    dial_code: "+356",
  },
  MH: {
    name: "Marshall Islands",
    dial_code: "+692",
  },
  MQ: {
    name: "Martinique",
    dial_code: "+596",
  },
  MR: {
    name: "Mauritania",
    dial_code: "+222",
  },
  MU: {
    name: "Mauritius",
    dial_code: "+230",
  },
  YT: {
    name: "Mayotte",
    dial_code: "+262",
  },
  MX: {
    name: "Mexico",
    dial_code: "+52",
  },
  FM: {
    name: "Micronesia, Federated States of Micronesia",
    dial_code: "+691",
  },
  MD: {
    name: "Moldova",
    dial_code: "+373",
  },
  MC: {
    name: "Monaco",
    dial_code: "+377",
  },
  MN: {
    name: "Mongolia",
    dial_code: "+976",
  },
  ME: {
    name: "Montenegro",
    dial_code: "+382",
  },
  MS: {
    name: "Montserrat",
    dial_code: "+1664",
  },
  MA: {
    name: "Morocco",
    dial_code: "+212",
  },
  MZ: {
    name: "Mozambique",
    dial_code: "+258",
  },
  MM: {
    name: "Myanmar",
    dial_code: "+95",
  },
  NA: {
    name: "Namibia",
    dial_code: "+264",
  },
  NR: {
    name: "Nauru",
    dial_code: "+674",
  },
  NP: {
    name: "Nepal",
    dial_code: "+977",
  },
  NL: {
    name: "Netherlands",
    dial_code: "+31",
  },
  AN: {
    name: "Netherlands Antilles",
    dial_code: "+599",
  },
  NC: {
    name: "New Caledonia",
    dial_code: "+687",
  },
  NZ: {
    name: "New Zealand",
    dial_code: "+64",
  },
  NI: {
    name: "Nicaragua",
    dial_code: "+505",
  },
  NE: {
    name: "Niger",
    dial_code: "+227",
  },
  NG: {
    name: "Nigeria",
    dial_code: "+234",
  },
  NU: {
    name: "Niue",
    dial_code: "+683",
  },
  NF: {
    name: "Norfolk Island",
    dial_code: "+672",
  },
  MP: {
    name: "Northern Mariana Islands",
    dial_code: "+1670",
  },
  NO: {
    name: "Norway",
    dial_code: "+47",
  },
  OM: {
    name: "Oman",
    dial_code: "+968",
  },
  PK: {
    name: "Pakistan",
    dial_code: "+92",
  },
  PW: {
    name: "Palau",
    dial_code: "+680",
  },
  PS: {
    name: "Palestinian Territory, Occupied",
    dial_code: "+970",
  },
  PA: {
    name: "Panama",
    dial_code: "+507",
  },
  PG: {
    name: "Papua New Guinea",
    dial_code: "+675",
  },
  PY: {
    name: "Paraguay",
    dial_code: "+595",
  },
  PE: {
    name: "Peru",
    dial_code: "+51",
  },
  PH: {
    name: "Philippines",
    dial_code: "+63",
  },
  PN: {
    name: "Pitcairn",
    dial_code: "+872",
  },
  PL: {
    name: "Poland",
    dial_code: "+48",
  },
  PT: {
    name: "Portugal",
    dial_code: "+351",
  },
  PR: {
    name: "Puerto Rico",
    dial_code: "+1939",
  },
  QA: {
    name: "Qatar",
    dial_code: "+974",
  },
  RO: {
    name: "Romania",
    dial_code: "+40",
  },
  RU: {
    name: "Russia",
    dial_code: "+7",
  },
  RW: {
    name: "Rwanda",
    dial_code: "+250",
  },
  RE: {
    name: "Reunion",
    dial_code: "+262",
  },
  BL: {
    name: "Saint Barthelemy",
    dial_code: "+590",
  },
  SH: {
    name: "Saint Helena, Ascension and Tristan Da Cunha",
    dial_code: "+290",
  },
  KN: {
    name: "Saint Kitts and Nevis",
    dial_code: "+1869",
  },
  LC: {
    name: "Saint Lucia",
    dial_code: "+1758",
  },
  MF: {
    name: "Saint Martin",
    dial_code: "+590",
  },
  PM: {
    name: "Saint Pierre and Miquelon",
    dial_code: "+508",
  },
  VC: {
    name: "Saint Vincent and the Grenadines",
    dial_code: "+1784",
  },
  WS: {
    name: "Samoa",
    dial_code: "+685",
  },
  SM: {
    name: "San Marino",
    dial_code: "+378",
  },
  ST: {
    name: "Sao Tome and Principe",
    dial_code: "+239",
  },
  SA: {
    name: "Saudi Arabia",
    dial_code: "+966",
  },
  SN: {
    name: "Senegal",
    dial_code: "+221",
  },
  RS: {
    name: "Serbia",
    dial_code: "+381",
  },
  SC: {
    name: "Seychelles",
    dial_code: "+248",
  },
  SL: {
    name: "Sierra Leone",
    dial_code: "+232",
  },
  SG: {
    name: "Singapore",
    dial_code: "+65",
  },
  SK: {
    name: "Slovakia",
    dial_code: "+421",
  },
  SI: {
    name: "Slovenia",
    dial_code: "+386",
  },
  SB: {
    name: "Solomon Islands",
    dial_code: "+677",
  },
  SO: {
    name: "Somalia",
    dial_code: "+252",
  },
  ZA: {
    name: "South Africa",
    dial_code: "+27",
  },
  SS: {
    name: "South Sudan",
    dial_code: "+211",
  },
  GS: {
    name: "South Georgia and the South Sandwich Islands",
    dial_code: "+500",
  },
  ES: {
    name: "Spain",
    dial_code: "+34",
  },
  LK: {
    name: "Sri Lanka",
    dial_code: "+94",
  },
  SD: {
    name: "Sudan",
    dial_code: "+249",
  },
  SR: {
    name: "Suriname",
    dial_code: "+597",
  },
  SJ: {
    name: "Svalbard and Jan Mayen",
    dial_code: "+47",
  },
  SZ: {
    name: "Swaziland",
    dial_code: "+268",
  },
  SE: {
    name: "Sweden",
    dial_code: "+46",
  },
  CH: {
    name: "Switzerland",
    dial_code: "+41",
  },
  SY: {
    name: "Syrian Arab Republic",
    dial_code: "+963",
  },
  TW: {
    name: "Taiwan",
    dial_code: "+886",
  },
  TJ: {
    name: "Tajikistan",
    dial_code: "+992",
  },
  TZ: {
    name: "Tanzania, United Republic of Tanzania",
    dial_code: "+255",
  },
  TH: {
    name: "Thailand",
    dial_code: "+66",
  },
  TL: {
    name: "Timor-Leste",
    dial_code: "+670",
  },
  TG: {
    name: "Togo",
    dial_code: "+228",
  },
  TK: {
    name: "Tokelau",
    dial_code: "+690",
  },
  TO: {
    name: "Tonga",
    dial_code: "+676",
  },
  TT: {
    name: "Trinidad and Tobago",
    dial_code: "+1868",
  },
  TN: {
    name: "Tunisia",
    dial_code: "+216",
  },
  TR: {
    name: "Turkey",
    dial_code: "+90",
  },
  TM: {
    name: "Turkmenistan",
    dial_code: "+993",
  },
  TC: {
    name: "Turks and Caicos Islands",
    dial_code: "+1649",
  },
  TV: {
    name: "Tuvalu",
    dial_code: "+688",
  },
  UG: {
    name: "Uganda",
    dial_code: "+256",
  },
  UA: {
    name: "Ukraine",
    dial_code: "+380",
  },
  AE: {
    name: "United Arab Emirates",
    dial_code: "+971",
  },
  GB: {
    name: "United Kingdom",
    dial_code: "+44",
  },
  US: {
    name: "United States",
    dial_code: "+1",
  },
  UY: {
    name: "Uruguay",
    dial_code: "+598",
  },
  UZ: {
    name: "Uzbekistan",
    dial_code: "+998",
  },
  VU: {
    name: "Vanuatu",
    dial_code: "+678",
  },
  VE: {
    name: "Venezuela, Bolivarian Republic of Venezuela",
    dial_code: "+58",
  },
  VN: {
    name: "Vietnam",
    dial_code: "+84",
  },
  VG: {
    name: "Virgin Islands, British",
    dial_code: "+1284",
  },
  VI: {
    name: "Virgin Islands, U.S.",
    dial_code: "+1340",
  },
  WF: {
    name: "Wallis and Futuna",
    dial_code: "+681",
  },
  YE: {
    name: "Yemen",
    dial_code: "+967",
  },
  ZM: {
    name: "Zambia",
    dial_code: "+260",
  },
  ZW: {
    name: "Zimbabwe",
    dial_code: "+263",
  },
};

const style$2 = {
  FormWrapper: {},
  ErrorInput: {
    "&::part(base)": {
      border: "var(--sqm-border-thickness, 1px) solid var(--sqm-danger-color-border)",
      borderRadius: "var(--sl-input-border-radius-medium)",
    },
    "&::part(help-text)": {
      color: "var(--sqm-danger-color-text)",
    },
  },
  ErrorText: {
    color: "var(--sqm-danger-color-text)",
    marginTop: "10px",
  },
  TextContainer: {
    display: "flex",
    justifyContent: "flex-start",
    flexDirection: "column",
    gap: "24px",
    paddingBottom: "16px",
  },
  InputContainer: {
    display: "flex",
    justifyContent: "flex-start",
    flexDirection: "column",
    gap: "24px",
    paddingBottom: "36px",
    maxWidth: "450px",
  },
  SearchInput: {
    padding: "var(--sl-spacing-x-small)",
  },
  BtnContainer: {
    paddingTop: "36px",
    display: "flex",
    gap: "8px",
  },
  CheckboxWrapper: {
    display: "flex",
    justifyContent: "flex-start",
    flexDirection: "column",
  },
  BoldText: {
    fontWeight: "bold",
  },
  RoundedCheckbox: {
    "&::part(control)": {
      borderRadius: "50%",
    },
  },
  PageDescriptionText: {
    color: "var(--sqm-text-subdued)",
    fontSize: "var(--sl-font-size-medium)",
  },
  PhoneInputsSection: {
    display: "flex",
    flexDirection: "column",
    gap: "4px",
    "& p": {
      fontSize: "var(--sl-font-size-small)",
      color: "var(--sqm-input-label-color)",
      fontWeight: "var(--sl-font-weight-semibold)",
    },
  },
  PhoneInputsContainer: {
    display: "flex",
    gap: "4px",
    width: "100%",
    "& #phoneNumber": {
      width: "100%",
      minWidth: "0px",
    },
  },
};
const sheet$1 = JSS.createStyleSheet(style$2);
const styleString$1 = sheet$1.toString();
const vanillaStyle$1 = `
    :host{
      display: block;   
    }
    * {
       margin: 0;
       padding: 0;
       box-sizing: border-box;
    }
    a {
      color: var(--sqm-text);
      color: inherit !important;
      text-decoration: underline;
    }

    p {
      line-height: 18px;
      font-size: var(--sl-font-size-small);
    }

    sl-radio-group::part(base) {
      display: flex;
      flex-direction: column;
    }

    sl-select#phoneNumberCountryCode::part(menu) {
      min-width: 250px;
    }

    sl-button[type="primary"]::part(base){
        background-color: var(--sqm-primary-button-background);
        color: var(--sqm-primary-button-color);
        border-color: var(--sqm-primary-button-color-border);
        border-radius: var(--sqm-primary-button-radius);
    }

    sl-button[type="primary"]::part(base):hover{
        background-color: var(--sqm-primary-button-background-hover);
    }

    sl-button[type="primary"]::part(base):focus{
        box-shadow: none;
    }

    sl-button[type="secondary"]::part(base){
        background-color: var(--sqm-secondary-button-background);
        color: var(--sqm-secondary-button-color);
        border-color: var(--sqm-secondary-button-color-border);
        border-radius: var(--sqm-secondary-button-radius);
    }

    sl-button[type="secondary"]::part(base):hover{
        background-color: var(--sqm-secondary-button-background-hover);
    }



*::part(primarybutton-base){
  background-color: var(--sqm-primary-button-background);
  color: var(--sqm-primary-button-color);
  border-color: var(--sqm-primary-button-color-border);
  border-radius: var(--sqm-primary-button-radius);
}

*::part(primarybutton-base):hover{
  background-color: var(--sqm-primary-button-background-hover);
}

*::part(primarybutton-base):focus{
  box-shadow: none;
}

*::part(secondarybutton-base){
  background-color: var(--sqm-secondary-button-background);
  color: var(--sqm-secondary-button-color);
  border-color: var(--sqm-secondary-button-color-border);
  border-radius: var(--sqm-secondary-button-radius);
}

*::part(secondarybutton-base):hover{
  background-color: var(--sqm-secondary-button-background-hover);
}

*::part(secondarybutton-base){
  background-color: var(--sqm-secondary-button-background);
  color: var(--sqm-secondary-button-color);
  border-color: var(--sqm-secondary-button-color-border);
  border-radius: var(--sqm-secondary-button-radius);
  width: max-content;
  display: flex;
  margin: auto;
}

*::part(secondarybutton-base):hover{
  background: var(--sqm-secondary-button-background-hover);
}

    sl-input::part(label),
    sl-select::part(label),
    sl-textarea::part(label){
      font-size: var(--sqm-input-label-font-size, var(--sl-input-font-size-small));
      font-weight: var(--sl-font-weight-semibold);
      color: var(--sqm-input-label-color, var(--sqm-text), black);
    }

    /* Corrected: Target sl-input, sl-select, sl-textarea base elements */
    sl-input::part(base),
    sl-dropdown::part(base),
    sl-textarea::part(base){
      background-color: var(--sqm-input-background, #fff);
      border-radius: var(--sqm-input-border-radius, var(--sl-input-border-radius-large), 0.25rem);
      color: var(--sqm-input-color, white);
      border-width: var(--sqm-border-thickness, 1px);
      border-style: solid; 
      border-color: var(--sqm-input-border-color, #ccc); 
    }


    sl-select::part(menu) {
      background: var(--sqm-input-background, inherit);
      color: var(--sqm-input-color, inherit);
      border:none;
    }

    sl-menu-item::part(base) {
      color: var(--sqm-input-color);
    }

     sl-menu-item::part(base):hover {
      background-color: var(--sqm-input-border-color-hover);
    }

    sl-select::part(panel) {
      border-radius: var(--sqm-border-radius-normal);
    }

    sl-select::part(help-text) {
      color: var(--sqm-text-subdued, var(--sl-input-help-text-color, #6c757d));
    }

    sl-input::part(base):focus,
    sl-select::part(base):focus, /* Corrected part name for sl-select */
    sl-textarea::part(base):focus { /* Corrected part name for sl-textarea */
      border: var(--sqm-input-focus-border, 1px solid var(--sl-input-border-color-focus, #007bff)); /* Added fallback for --sl-input-border-color-focus */
    }

    sl-input[disabled]::part(base),
    sl-select[disabled]::part(base),
    sl-textarea[disabled]::part(base){
      background: var(--sqm-input-disabled-background, #f5f5f5);
      border-color: var(--sl-input-border-color-disabled, #e0e0e0); /* Example disabled border color */
    }


    sl-input::part(input):-webkit-autofill {
      box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
      -webkit-text-fill-color: var(--sqm-input-color, white) !important;
    }

    sl-input::part(input):-webkit-autofill:hover {
      box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
      -webkit-text-fill-color: var(--sqm-input-color, white) !important;
    }

    sl-input::part(input):-webkit-autofill:focus {
      box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;
      -webkit-text-fill-color: var(--sqm-input-color, white) !important;
    }

    sl-checkbox::part(label){
      color: var(--sqm-text);
    }

    sl-checkbox[checked]::part(control){
      background-color: var(--sqm-input-border-color-focus);
    }

    sl-checkbox[checked]::part(checked-icon){
      color: var(--sqm-input-background);
    }
`;
const UserInfoFormView = (props) => {
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
  const { states, states: { formState }, callbacks, text, refs, data: data$1, } = props;
  const { classes } = sheet$1;
  const bankingCollectionText = global.intl.formatMessage({
    id: "bankingCollectionText",
    defaultMessage: text.allowBankingCollection,
  }, {
    termsAndConditionsLink: (index.h("a", { href: text.termsAndConditionsLink, target: "_blank" }, text.termsAndConditionsLabel)),
  });
  let regionLabel = undefined;
  switch (data$1.regionLabelEnum) {
    case "STATE":
      regionLabel = text.state;
      break;
    case "PROVINCE":
      regionLabel = text.province;
      break;
    case "REGION":
      regionLabel = text.region;
      break;
    default:
      regionLabel = text.state;
  }
  function isDisabledPartnerInput(field) {
    var _a;
    return states.isPartner && !!((_a = data$1.partnerData) === null || _a === void 0 ? void 0 : _a[field]);
  }
  function isDisabledUserInput(field) {
    var _a;
    return states.isUser && !!((_a = data$1.userData) === null || _a === void 0 ? void 0 : _a[field]);
  }
  return (index.h("sl-form", { class: classes.FormWrapper, "onSl-submit": callbacks.onSubmit, ref: (el) => (refs.formRef.current = el), novalidate: true },
    index.h("style", { type: "text/css" },
      styleString$1,
      vanillaStyle$1),
    states.loadingError && (index.h("div", null,
      index.h("sqm-form-message", { type: "error" },
        index.h("p", { part: "alert-title" }, text.error.loadingErrorAlertHeader),
        index.h("p", { part: "alert-description" }, global.intl.formatMessage({
          id: "loadingErrorAlertDescription",
          defaultMessage: text.error.loadingErrorAlertDescription,
        }, {
          supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
        }))))),
    states.loading ? (index.h(data.LoadingView, null)) : (index.h("div", null,
      index.h("div", { class: classes.TextContainer },
        index.h("div", null,
          !states.hideSteps && (index.h("p", null, global.intl.formatMessage({
            id: "formStep",
            defaultMessage: text.formStep,
          }, { step: states.step, count: data.FORM_STEPS }))),
          index.h("h3", null, text.personalInformation),
          index.h("p", { class: classes.PageDescriptionText }, text.taxAndPayoutsDescription))),
      ((_a = formState.errors) === null || _a === void 0 ? void 0 : _a.general) && (index.h("sqm-form-message", { type: "error" },
        index.h("p", { part: "alert-title" }, text.error.generalTitle),
        index.h("p", { part: "alert-description" }, global.intl.formatMessage({
          id: "generalDescription",
          defaultMessage: text.error.generalDescription,
        }, {
          supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
        })))),
      (states.isPartner || states.isUser) && (index.h("sqm-form-message", { loading: states.loading, type: "info" },
        index.h("p", { part: "alert-title" }, text.isPartnerAlertHeader),
        index.h("p", { part: "alert-description" }, global.intl.formatMessage({
          id: "isPartnerAlertDescription",
          defaultMessage: text.isPartnerAlertDescription,
        }, {
          supportLink: (index.h("a", { target: "_blank", href: `mailto:advocate-support@impact.com` }, text.supportLink)),
        })))),
      index.h("div", null,
        index.h("div", { class: classes.InputContainer },
          index.h("sl-input", Object.assign({ class: "ErrorInput", exportparts: "label: input-label, base: input-base", value: formState.firstName, label: text.firstName, disabled: states.disabled || isDisabledUserInput("firstName") }, (((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.firstName) ? {
            class: classes.ErrorInput,
            helpText: data.formatErrorMessage(text.firstName, formState.errors.firstName),
          }
            : {}), { id: "firstName", name: "/firstName", required: true })),
          index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", value: formState.lastName, label: text.lastName, disabled: states.disabled || isDisabledUserInput("lastName") }, (((_c = formState.errors) === null || _c === void 0 ? void 0 : _c.lastName) ? {
            class: classes.ErrorInput,
            helpText: data.formatErrorMessage(text.lastName, formState.errors.lastName),
          }
            : {}), { id: "lastName", name: "/lastName", required: true })),
          index.h("sl-input", { exportparts: "label: input-label, base: input-base", value: formState.email, label: text.email, disabled: true, id: "email", name: "/email", required: true }),
          index.h("sl-select", Object.assign({ id: "countryCode", exportparts: "label: input-label, base: input-base", name: "/countryCode", label: text.country, value: formState.countryCode, disabled: states.disabled || isDisabledPartnerInput("countryCode") }, (((_d = formState.errors) === null || _d === void 0 ? void 0 : _d.countryCode) ? {
            class: classes.ErrorInput,
            helpText: data.formatErrorMessage(text.country, formState.errors.countryCode),
          }
            : {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("countryCode", e) }),
            index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
                // Stop shoelace intercepting key presses
                e.stopPropagation();
              }, "onSl-input": (e) => {
                callbacks.setCountrySearch(e.target.value);
              } }), (_e = data$1 === null || data$1 === void 0 ? void 0 : data$1.countries) === null || _e === void 0 ? void 0 :
            _e.map((c) => (index.h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_f = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCountries) === null || _f === void 0 ? void 0 :
            _f.map((c) => (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
          index.h("div", { class: classes.PhoneInputsSection },
            index.h("p", null, text.phoneNumber),
            index.h("div", { class: classes.PhoneInputsContainer },
              index.h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", value: formState.phoneNumberCountryCode, disabled: states.disabled ||
                  isDisabledPartnerInput("phoneNumberCountryCode"), ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
                class: classes.ErrorInput,
              }
                : {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
                index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
                    // Stop shoelace intercepting key presses
                    e.stopPropagation();
                  }, "onSl-input": (e) => {
                    callbacks.setPhoneCountrySearch(e.target.value);
                  } }), (_h = data$1 === null || data$1 === void 0 ? void 0 : data$1.phoneCountries) === null || _h === void 0 ? void 0 :
                _h.map((c) => {
                  var _a, _b;
                  return (index.h("sl-menu-item", { value: c.countryCode },
                    index.h("div", { slot: "prefix" }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
                    _b.dial_code));
                }), (_j = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCountries) === null || _j === void 0 ? void 0 :
                _j.map((c) => {
                  var _a, _b;
                  return (index.h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
                    index.h("div", { slot: "prefix" }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
                    _b.dial_code));
                })),
              index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber, validationError: ({ value }) => {
                  // Naive phone number validation
                  data.validateBillingField(/[a-zA-Z]+/, value) &&
                    data.formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError);
                }, disabled: states.disabled || isDisabledPartnerInput("phoneNumber") }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
                class: classes.ErrorInput,
                helpText: data.formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
              }
                : {}), { required: true })))),
          index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) => 
            // Checks for non-ASCII characters
            !data.validateBillingField(/^[\x20-\xFF]+$/, value) &&
              data.formatErrorMessage(text.address, text.error.invalidCharacterError), disabled: states.disabled || isDisabledPartnerInput("billingAddress") }, (((_l = formState.errors) === null || _l === void 0 ? void 0 : _l.address) ? {
            class: classes.ErrorInput,
            helpText: data.formatErrorMessage(text.address, formState.errors.address),
          }
            : {}), { required: true })),
          index.h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.city, id: "city", name: "/city", value: formState.city, validationError: ({ value }) => 
            // Checks for non-ASCII characters
            !data.validateBillingField(/^[\x20-\xFF]+$/, value) &&
              data.formatErrorMessage(text.city, text.error.invalidCharacterError), disabled: states.disabled || isDisabledPartnerInput("billingCity") }, (((_m = formState.errors) === null || _m === void 0 ? void 0 : _m.city) ? {
            class: classes.ErrorInput,
            helpText: data.formatErrorMessage(text.city, formState.errors.city),
          }
            : {}), { required: true })),
          !states.hideState && (index.h("sl-select", Object.assign({ label: regionLabel, exportparts: "label: input-label, base: input-base", id: "state", name: "/state", value: formState.state, disabled: states.disabled || isDisabledPartnerInput("billingState") }, (((_o = formState.errors) === null || _o === void 0 ? void 0 : _o.state) ? {
            class: classes.ErrorInput,
            helpText: data.formatErrorMessage(text.state, formState.errors.state),
          }
            : {}), { required: true }), (_p = data$1.regions) === null || _p === void 0 ? void 0 : _p.map((r) => (index.h("sl-menu-item", { value: r.value }, r.label))))),
          index.h("sl-input", Object.assign({ label: text.postalCode, exportparts: "label: input-label, base: input-base", id: "postalCode", name: "/postalCode", value: formState.postalCode, disabled: states.disabled || isDisabledPartnerInput("billingPostalCode") }, (((_q = formState.errors) === null || _q === void 0 ? void 0 : _q.postalCode) ? {
            class: classes.ErrorInput,
            helpText: data.formatErrorMessage(text.postalCode, formState.errors.postalCode),
          }
            : {}), { required: true })),
          index.h("sl-select", Object.assign({ id: "currency", exportparts: "label: input-label, base: input-base", name: "/currency", label: text.currency, menu: true, value: formState.currency, disabled: states.disabled || isDisabledPartnerInput("currency"), helpText: text.currencyHelpText }, (((_r = formState.errors) === null || _r === void 0 ? void 0 : _r.currency) ? {
            class: classes.ErrorInput,
            helpText: data.formatErrorMessage(text.currency, formState.errors.currency),
          }
            : {}), { required: true, ref: (el) => (refs.currencyRef.current = el) }),
            index.h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCurrencyText, onKeyDown: (e) => {
                // Stop shoelace intercepting key presses
                e.stopPropagation();
              }, "onSl-input": (e) => {
                callbacks.setCurrencySearch(e.target.value);
              } }), (_s = data$1 === null || data$1 === void 0 ? void 0 : data$1.currencies) === null || _s === void 0 ? void 0 :
            _s.map((c) => (index.h("sl-menu-item", { value: c.currencyCode },
              c.currencyCode,
              " - ",
              c.displayName))), (_t = data$1 === null || data$1 === void 0 ? void 0 : data$1.allCurrencies) === null || _t === void 0 ? void 0 :
            _t.map((c) => (index.h("sl-menu-item", { value: c.currencyCode, style: { display: "none" } },
              c.currencyCode,
              " - ",
              c.displayName)))),
          index.h("div", { class: classes.CheckboxWrapper },
            index.h("sl-checkbox", { checked: formState.allowBankingCollection === true, "onSl-change": (e) => {
                e.target.value = e.target.checked;
              }, disabled: states.disabled, required: true, value: formState.allowBankingCollection, id: "allowBankingCollection", name: "/allowBankingCollection" }, bankingCollectionText),
            ((_u = formState.errors) === null || _u === void 0 ? void 0 : _u.allowBankingCollection) && (index.h("p", { class: classes.ErrorText }, data.formatErrorMessage(text.termsAndConditionsLabel, formState.errors.allowBankingCollection))))),
        index.h("sl-button", { type: "primary", disabled: states.disabled, submit: true, exportparts: "base: primarybutton-base" }, text.continueButton))))));
};

exports.ADDRESS_REGIONS = ADDRESS_REGIONS;
exports.INDIRECT_TAX_PROVINCES = INDIRECT_TAX_PROVINCES;
exports.INDIRECT_TAX_SPAIN_REGIONS = INDIRECT_TAX_SPAIN_REGIONS;
exports.InvoiceTableView = InvoiceTableView;
exports.OtherRegionSlotView = OtherRegionSlotView;
exports.UserInfoFormView = UserInfoFormView;
exports.vatLabels = vatLabels;
