@ingestro/importer-react 4.8.4 → 4.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-VGA4QZVR.js → chunk-DHGB4FGN.js} +1 -1
- package/chunk-REPANPD5.js +1 -0
- package/chunk-RHL57REG.js +1 -0
- package/{chunk-BVFFBQFD.js → chunk-XTL7TWAP.js} +1 -1
- package/index.js +64 -64
- package/package.json +1 -1
- package/workers/hooks/index.js +1 -1
- package/workers/matchValues/index.js +1 -1
- package/workers/searchAndReplace/index.js +1 -1
- package/chunk-AAZKUHPZ.js +0 -1
- package/chunk-SKUCMMIT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as I,h as E,i as u,m as N,r as B}from"./chunk-SKUCMMIT.js";import{isNil as F}from"lodash";var D=[{label:"AFN",value:"AFN",type:"string",alternativeMatches:["Af","Afghanistan"]},{label:"ARS",value:"ARS",type:"string",alternativeMatches:["AR$","Argentina"]},{label:"AWG",value:"AWG",type:"string",alternativeMatches:["Aruba"]},{label:"AUD",value:"AUD",type:"string",alternativeMatches:["AU$","Australia"]},{label:"AZN",value:"AZN",type:"string",alternativeMatches:["man.","Azerbaijan"]},{label:"BSD",value:"BSD",type:"string",alternativeMatches:["Bahamas"]},{label:"BBD",value:"BBD",type:"string",alternativeMatches:["Barbados"]},{label:"BYN",value:"BYN",type:"string",alternativeMatches:["Br"]},{label:"BZD",value:"BZD",type:"string",alternativeMatches:["BZ$","Belize"]},{label:"BMD",value:"BMD",type:"string",alternativeMatches:["Bermuda"]},{label:"BOB",value:"BOB",type:"string",alternativeMatches:["Bs","Bolivia"]},{label:"BAM",value:"BAM",type:"string",alternativeMatches:["KM","Bosnia and Herzegovina"]},{label:"BWP",value:"BWP",type:"string",alternativeMatches:["BWP","Botswana"]},{label:"BGN",value:"BGN",type:"string",alternativeMatches:["BGN","Bulgaria"]},{label:"BRL",value:"BRL",type:"string",alternativeMatches:["R$","Brazil"]},{label:"BND",value:"BND",type:"string",alternativeMatches:["BN$","Brunei"]},{label:"KHR",value:"KHR",type:"string",alternativeMatches:["KHR","Cambodia"]},{label:"CAD",value:"CAD",type:"string",alternativeMatches:["CA$","Canada"]},{label:"KYD",value:"KYD",type:"string",alternativeMatches:["Cayman Islands"]},{label:"CLP",value:"CLP",type:"string",alternativeMatches:["CL$","Chile"]},{label:"CNY",value:"CNY",type:"string",alternativeMatches:["CN\xA5","China"]},{label:"COP",value:"COP",type:"string",alternativeMatches:["CO$","Colombia"]},{label:"CRC",value:"CRC",type:"string",alternativeMatches:["\u20A1","Costa Rica"]},{label:"HRK",value:"HRK",type:"string",alternativeMatches:["kn","Croatia"]},{label:"CUP",value:"CUP",type:"string",alternativeMatches:["Cuba"]},{label:"CZK",value:"CZK",type:"string",alternativeMatches:["K\u010D","Czech Republic"]},{label:"DKK",value:"DKK",type:"string",alternativeMatches:["Dkr","Denmark"]},{label:"DOP",value:"DOP",type:"string",alternativeMatches:["RD$","Dominican Republic"]},{label:"XCD",value:"XCD",type:"string",alternativeMatches:["Anguilla"]},{label:"EGP",value:"EGP",type:"string",alternativeMatches:["EGP","Egypt"]},{label:"SVC",value:"SVC",type:"string",alternativeMatches:["El Salvador"]},{label:"EUR",value:"EUR",type:"string",alternativeMatches:["\u20AC","Germany"]},{label:"FKP",value:"FKP",type:"string",alternativeMatches:["Falkland Islands"]},{label:"FJD",value:"FJD",type:"string",alternativeMatches:["Fiji Islands"]},{label:"GHS",value:"GHS",type:"string",alternativeMatches:["GH\u20B5","Ghana"]},{label:"GIP",value:"GIP",type:"string",alternativeMatches:["Gibraltar"]},{label:"GTQ",value:"GTQ",type:"string",alternativeMatches:["GTQ"]},{label:"GGP",value:"GGP",type:"string",alternativeMatches:[]},{label:"GYD",value:"GYD",type:"string",alternativeMatches:["Guyana"]},{label:"HNL",value:"HNL",type:"string",alternativeMatches:["HNL","Honduras"]},{label:"HKD",value:"HKD",type:"string",alternativeMatches:["HK$","Hong Kong"]},{label:"HUF",value:"HUF",type:"string",alternativeMatches:["Ft","Hungary"]},{label:"ISK",value:"ISK",type:"string",alternativeMatches:["Ikr","Iceland"]},{label:"INR",value:"INR",type:"string",alternativeMatches:["\u20B9","India"]},{label:"IDR",value:"IDR",type:"string",alternativeMatches:["Rp","Indonesia"]},{label:"IRR",value:"IRR",type:"string",alternativeMatches:["IRR","Iran"]},{label:"IMP",value:"IMP",type:"string",alternativeMatches:[]},{label:"ILS",value:"ILS",type:"string",alternativeMatches:["\u20AA","Israel"]},{label:"JMD",value:"JMD",type:"string",alternativeMatches:["J$","Jamaica"]},{label:"JPY",value:"JPY",type:"string",alternativeMatches:["\xA5","Japan"]},{label:"JEP",value:"JEP",type:"string",alternativeMatches:[]},{label:"KZT",value:"KZT",type:"string",alternativeMatches:["KZT","Kazakhstan"]},{label:"KPW",value:"KPW",type:"string",alternativeMatches:["North Korea"]},{label:"KRW",value:"KRW",type:"string",alternativeMatches:["\u20A9","South Korea"]},{label:"KGS",value:"KGS",type:"string",alternativeMatches:["Kyrgyzstan"]},{label:"LAK",value:"LAK",type:"string",alternativeMatches:["Laos"]},{label:"LBP",value:"LBP",type:"string",alternativeMatches:["L.L.","Lebanon"]},{label:"LRD",value:"LRD",type:"string",alternativeMatches:["Liberia"]},{label:"MKD",value:"MKD",type:"string",alternativeMatches:["MKD","North Macedonia"]},{label:"MYR",value:"MYR",type:"string",alternativeMatches:["RM","Malaysia"]},{label:"MUR",value:"MUR",type:"string",alternativeMatches:["MURs","Mauritius"]},{label:"MXN",value:"MXN",type:"string",alternativeMatches:["MX$","Mexico"]},{label:"MNT",value:"MNT",type:"string",alternativeMatches:["Mongolia"]},{label:"MZN",value:"MZN",type:"string",alternativeMatches:["MTn","Mozambique"]},{label:"NAD",value:"NAD",type:"string",alternativeMatches:["N$","Namibia"]},{label:"NPR",value:"NPR",type:"string",alternativeMatches:["NPRs","Nepal"]},{label:"ANG",value:"ANG",type:"string",alternativeMatches:["Netherlands Antilles"]},{label:"NZD",value:"NZD",type:"string",alternativeMatches:["NZ$","Cook Islands"]},{label:"NIO",value:"NIO",type:"string",alternativeMatches:["C$","Nicaragua"]},{label:"NGN",value:"NGN",type:"string",alternativeMatches:["\u20A6","Nigeria"]},{label:"NOK",value:"NOK",type:"string",alternativeMatches:["Nkr","Bouvet Island"]},{label:"OMR",value:"OMR",type:"string",alternativeMatches:["OMR","Oman"]},{label:"PKR",value:"PKR",type:"string",alternativeMatches:["PKRs","Pakistan"]},{label:"PAB",value:"PAB",type:"string",alternativeMatches:["B/.","Panama"]},{label:"PYG",value:"PYG",type:"string",alternativeMatches:["\u20B2","Paraguay"]},{label:"PEN",value:"PEN",type:"string",alternativeMatches:["S/.","Peru"]},{label:"PHP",value:"PHP",type:"string",alternativeMatches:["\u20B1","Philippines"]},{label:"PLN",value:"PLN",type:"string",alternativeMatches:["z\u0142","Poland"]},{label:"QAR",value:"QAR",type:"string",alternativeMatches:["QR","Qatar"]},{label:"RON",value:"RON",type:"string",alternativeMatches:["RON","Romania"]},{label:"RUB",value:"RUB",type:"string",alternativeMatches:["RUB","Russian Federation"]},{label:"SHP",value:"SHP",type:"string",alternativeMatches:["Saint Helena"]},{label:"SAR",value:"SAR",type:"string",alternativeMatches:["SR","Saudi Arabia"]},{label:"RSD",value:"RSD",type:"string",alternativeMatches:["din.","Serbia"]},{label:"SCR",value:"SCR",type:"string",alternativeMatches:["Seychelles"]},{label:"SGD",value:"SGD",type:"string",alternativeMatches:["S$","Singapore"]},{label:"SBD",value:"SBD",type:"string",alternativeMatches:["Solomon Islands"]},{label:"SOS",value:"SOS",type:"string",alternativeMatches:["Ssh","Somalia"]},{label:"ZAR",value:"ZAR",type:"string",alternativeMatches:["R","South Africa"]},{label:"LKR",value:"LKR",type:"string",alternativeMatches:["SLRs","Sri Lanka"]},{label:"SEK",value:"SEK",type:"string",alternativeMatches:["Skr","Sweden"]},{label:"CHF",value:"CHF",type:"string",alternativeMatches:["CHF","Liechtenstein"]},{label:"SRD",value:"SRD",type:"string",alternativeMatches:["Suriname"]},{label:"SYP",value:"SYP",type:"string",alternativeMatches:["SY\xA3","Syria"]},{label:"TWD",value:"TWD",type:"string",alternativeMatches:["NT$"]},{label:"THB",value:"THB",type:"string",alternativeMatches:["\u0E3F","Thailand"]},{label:"TTD",value:"TTD",type:"string",alternativeMatches:["TT$","Trinidad and Tobago"]},{label:"TRY",value:"TRY",type:"string",alternativeMatches:["TL","Turkey"]},{label:"TVD",value:"TVD",type:"string",alternativeMatches:[]},{label:"UAH",value:"UAH",type:"string",alternativeMatches:["\u20B4","Ukraine"]},{label:"GBP",value:"GBP",type:"string",alternativeMatches:["\xA3","England"]},{label:"USD",value:"USD",type:"string",alternativeMatches:["$","USA"]},{label:"UYU",value:"UYU",type:"string",alternativeMatches:["$U","Uruguay"]},{label:"UZS",value:"UZS",type:"string",alternativeMatches:["UZS","Uzbekistan"]},{label:"VEF",value:"VEF",type:"string",alternativeMatches:["Bs.F.","Venezuela"]},{label:"VND",value:"VND",type:"string",alternativeMatches:["\u20AB","Vietnam"]},{label:"YER",value:"YER",type:"string",alternativeMatches:["YR","Yemen"]},{label:"ZWD",value:"ZWD",type:"string",alternativeMatches:["Zimbabwe"]},{label:"XOF",value:"XOF",type:"string",alternativeMatches:["CFA Franc","West Africa"]},{label:"BDT",value:"BDT",type:"string",alternativeMatches:["\u09F3","Bangladesh"]},{label:"UGX",value:"UGX",type:"string",alternativeMatches:["USh","Uganda"]},{label:"KES",value:"KES",type:"string",alternativeMatches:["KSh","Kenya"]},{label:"LSL",value:"LSL",type:"string",alternativeMatches:["Loti","Lesotho"]},{label:"MWK",value:"MWK",type:"string",alternativeMatches:["K","Malawi"]},{label:"TZS",value:"TZS",type:"string",alternativeMatches:["TSh","Tanzania"]},{label:"ETB",value:"ETB",type:"string",alternativeMatches:["Br","Ethiopia"]},{label:"VEB",value:"VEB",type:"string",alternativeMatches:["Bs","Venezuela"]},{label:"XAF",value:"XAF",type:"string",alternativeMatches:["CFA Franc","Central Africa"]}],P=[{value:"AF",label:"AF",type:"string",alternativeMatches:["Afghanistan"]},{value:"AX",label:"AX",type:"string",alternativeMatches:["\xC5land Islands"]},{value:"AL",label:"AL",type:"string",alternativeMatches:["Albania"]},{value:"DZ",label:"DZ",type:"string",alternativeMatches:["Algeria"]},{value:"AS",label:"AS",type:"string",alternativeMatches:["American Samoa"]},{value:"AD",label:"AD",type:"string",alternativeMatches:["Andorra"]},{value:"AO",label:"AO",type:"string",alternativeMatches:["Angola"]},{value:"AI",label:"AI",type:"string",alternativeMatches:["Anguilla"]},{value:"AQ",label:"AQ",type:"string",alternativeMatches:["Antarctica"]},{value:"AG",label:"AG",type:"string",alternativeMatches:["Antigua and Barbuda","Antigua","Barbuda"]},{value:"AR",label:"AR",type:"string",alternativeMatches:["Argentina"]},{value:"AM",label:"AM",type:"string",alternativeMatches:["Armenia"]},{value:"AW",label:"AW",type:"string",alternativeMatches:["Aruba"]},{value:"AU",label:"AU",type:"string",alternativeMatches:["Australia"]},{value:"AT",label:"AT",type:"string",alternativeMatches:["Austria"]},{value:"AZ",label:"AZ",type:"string",alternativeMatches:["Azerbaijan"]},{value:"BS",label:"BS",type:"string",alternativeMatches:["Bahamas"]},{value:"BH",label:"BH",type:"string",alternativeMatches:["Bahrain"]},{value:"BD",label:"BD",type:"string",alternativeMatches:["Bangladesh"]},{value:"BB",label:"BB",type:"string",alternativeMatches:["Barbados"]},{value:"BY",label:"BY",type:"string",alternativeMatches:["Belarus"]},{value:"BE",label:"BE",type:"string",alternativeMatches:["Belgium"]},{value:"BZ",label:"BZ",type:"string",alternativeMatches:["Belize"]},{value:"BJ",label:"BJ",type:"string",alternativeMatches:["Benin"]},{value:"BM",label:"BM",type:"string",alternativeMatches:["Bermuda"]},{value:"BT",label:"BT",type:"string",alternativeMatches:["Bhutan"]},{value:"BO",label:"BO",type:"string",alternativeMatches:["Bolivia (Plurinational State of)","Bolivia"]},{value:"BQ",label:"BQ",type:"string",alternativeMatches:["Bonaire, Sint Eustatius and Saba"]},{value:"BA",label:"BA",type:"string",alternativeMatches:["Bosnia and Herzegovina"]},{value:"BW",label:"BW",type:"string",alternativeMatches:["Botswana"]},{value:"BV",label:"BV",type:"string",alternativeMatches:["Bouvet Island"]},{value:"BR",label:"BR",type:"string",alternativeMatches:["Brazil"]},{value:"IO",label:"IO",type:"string",alternativeMatches:["British Indian Ocean Territory"]},{value:"BN",label:"BN",type:"string",alternativeMatches:["Brunei Darussalam"]},{value:"BG",label:"BG",type:"string",alternativeMatches:["Bulgaria"]},{value:"BF",label:"BF",type:"string",alternativeMatches:["Burkina Faso"]},{value:"BI",label:"BI",type:"string",alternativeMatches:["Burundi"]},{value:"KH",label:"KH",type:"string",alternativeMatches:["Cambodia"]},{value:"CM",label:"CM",type:"string",alternativeMatches:["Cameroon"]},{value:"CA",label:"CA",type:"string",alternativeMatches:["Canada"]},{value:"CV",label:"CV",type:"string",alternativeMatches:["Cape Verde"]},{value:"KY",label:"KY",type:"string",alternativeMatches:["Cayman Islands"]},{value:"CF",label:"CF",type:"string",alternativeMatches:["Central African Republic"]},{value:"TD",label:"TD",type:"string",alternativeMatches:["Chad"]},{value:"CL",label:"CL",type:"string",alternativeMatches:["Chile"]},{value:"CN",label:"CN",type:"string",alternativeMatches:["China"]},{value:"CX",label:"CX",type:"string",alternativeMatches:["Christmas Island"]},{value:"CC",label:"CC",type:"string",alternativeMatches:["Cocos (Keeling) Islands","Cocos Islands"]},{value:"CO",label:"CO",type:"string",alternativeMatches:["Colombia"]},{value:"KM",label:"KM",type:"string",alternativeMatches:["Comoros"]},{value:"CG",label:"CG",type:"string",alternativeMatches:["Congo"]},{value:"CD",label:"CD",type:"string",alternativeMatches:["Congo (the Democratic Republic of the)","Congo"]},{value:"CK",label:"CK",type:"string",alternativeMatches:["Cook Islands"]},{value:"CR",label:"CR",type:"string",alternativeMatches:["Costa Rica"]},{value:"CI",label:"CI",type:"string",alternativeMatches:["C\xF4te d'Ivoire","Cote d Ivoire"]},{value:"HR",label:"HR",type:"string",alternativeMatches:["Croatia"]},{value:"CU",label:"CU",type:"string",alternativeMatches:["Cuba"]},{value:"CW",label:"CW",type:"string",alternativeMatches:["Cura\xE7ao","Curacao"]},{value:"CY",label:"CY",type:"string",alternativeMatches:["Cyprus"]},{value:"CZ",label:"CZ",type:"string",alternativeMatches:["Czechia","Czech Republic"]},{value:"DK",label:"DK",type:"string",alternativeMatches:["Denmark"]},{value:"DJ",label:"DJ",type:"string",alternativeMatches:["Djibouti"]},{value:"DM",label:"DM",type:"string",alternativeMatches:["Dominica"]},{value:"DO",label:"DO",type:"string",alternativeMatches:["Dominican Republic"]},{value:"EC",label:"EC",type:"string",alternativeMatches:["Ecuador"]},{value:"EG",label:"EG",type:"string",alternativeMatches:["Egypt"]},{value:"SV",label:"SV",type:"string",alternativeMatches:["El Salvador"]},{value:"GQ",label:"GQ",type:"string",alternativeMatches:["Equatorial Guinea"]},{value:"ER",label:"ER",type:"string",alternativeMatches:["Eritrea"]},{value:"EE",label:"EE",type:"string",alternativeMatches:["Estonia"]},{value:"ET",label:"ET",type:"string",alternativeMatches:["Ethiopia"]},{value:"FK",label:"FK",type:"string",alternativeMatches:["Falkland Islands (Malvinas)"]},{value:"FO",label:"FO",type:"string",alternativeMatches:["Faroe Islands"]},{value:"FJ",label:"FJ",type:"string",alternativeMatches:["Fiji"]},{value:"FI",label:"FI",type:"string",alternativeMatches:["Finland"]},{value:"FR",label:"FR",type:"string",alternativeMatches:["France"]},{value:"GF",label:"GF",type:"string",alternativeMatches:["French Guiana"]},{value:"PF",label:"PF",type:"string",alternativeMatches:["French Polynesia"]},{value:"TF",label:"TF",type:"string",alternativeMatches:["French Southern Territories"]},{value:"GA",label:"GA",type:"string",alternativeMatches:["Gabon"]},{value:"GM",label:"GM",type:"string",alternativeMatches:["Gambia"]},{value:"GE",label:"GE",type:"string",alternativeMatches:["Georgia"]},{value:"DE",label:"DE",type:"string",alternativeMatches:["Germany"]},{value:"GH",label:"GH",type:"string",alternativeMatches:["Ghana"]},{value:"GI",label:"GI",type:"string",alternativeMatches:["Gibraltar"]},{value:"GR",label:"GR",type:"string",alternativeMatches:["Greece"]},{value:"GL",label:"GL",type:"string",alternativeMatches:["Greenland"]},{value:"GD",label:"GD",type:"string",alternativeMatches:["Grenada"]},{value:"GP",label:"GP",type:"string",alternativeMatches:["Guadeloupe"]},{value:"GU",label:"GU",type:"string",alternativeMatches:["Guam"]},{value:"GT",label:"GT",type:"string",alternativeMatches:["Guatemala"]},{value:"GG",label:"GG",type:"string",alternativeMatches:["Guernsey"]},{value:"GN",label:"GN",type:"string",alternativeMatches:["Guinea"]},{value:"GW",label:"GW",type:"string",alternativeMatches:["Guinea-Bissau"]},{value:"GY",label:"GY",type:"string",alternativeMatches:["Guyana"]},{value:"HT",label:"HT",type:"string",alternativeMatches:["Haiti"]},{value:"HM",label:"HM",type:"string",alternativeMatches:["Heard Island and McDonald Islands","Heard Island","McDonald Islands"]},{value:"VA",label:"VA",type:"string",alternativeMatches:["Holy See (Vatican City State)"]},{value:"HN",label:"HN",type:"string",alternativeMatches:["Honduras"]},{value:"HK",label:"HK",type:"string",alternativeMatches:["Hong Kong"]},{value:"HU",label:"HU",type:"string",alternativeMatches:["Hungary"]},{value:"IS",label:"IS",type:"string",alternativeMatches:["Iceland"]},{value:"IN",label:"IN",type:"string",alternativeMatches:["India"]},{value:"ID",label:"ID",type:"string",alternativeMatches:["Indonesia"]},{value:"IR",label:"IR",type:"string",alternativeMatches:["Iran (Islamic Republic of) ","Iran"]},{value:"IQ",label:"IQ",type:"string",alternativeMatches:["Iraq"]},{value:"IE",label:"IE",type:"string",alternativeMatches:["Ireland"]},{value:"IM",label:"IM",type:"string",alternativeMatches:["Isle of Man"]},{value:"IL",label:"IL",type:"string",alternativeMatches:["Israel"]},{value:"IT",label:"IT",type:"string",alternativeMatches:["Italy"]},{value:"JM",label:"JM",type:"string",alternativeMatches:["Jamaica"]},{value:"JP",label:"JP",type:"string",alternativeMatches:["Japan"]},{value:"JE",label:"JE",type:"string",alternativeMatches:["Jersey"]},{value:"JO",label:"JO",type:"string",alternativeMatches:["Jordan"]},{value:"KZ",label:"KZ",type:"string",alternativeMatches:["Kazakhstan"]},{value:"KE",label:"KE",type:"string",alternativeMatches:["Kenya"]},{value:"KI",label:"KI",type:"string",alternativeMatches:["Kiribati"]},{value:"KP",label:"KP",type:"string",alternativeMatches:["Democratic People's Republic of Korea","North Korea"]},{value:"KR",label:"KR",type:"string",alternativeMatches:["Korea, Republic of Korea","South Korea"]},{value:"KW",label:"KW",type:"string",alternativeMatches:["Kuwait"]},{value:"KG",label:"KG",type:"string",alternativeMatches:["Kyrgyzstan"]},{value:"LA",label:"LA",type:"string",alternativeMatches:["Lao People's Democratic Republic"]},{value:"LV",label:"LV",type:"string",alternativeMatches:["Latvia"]},{value:"LB",label:"LB",type:"string",alternativeMatches:["Lebanon"]},{value:"LS",label:"LS",type:"string",alternativeMatches:["Lesotho"]},{value:"LR",label:"LR",type:"string",alternativeMatches:["Liberia"]},{value:"LY",label:"LY",type:"string",alternativeMatches:["Libya"]},{value:"LI",label:"LI",type:"string",alternativeMatches:["Liechtenstein"]},{value:"LT",label:"LT",type:"string",alternativeMatches:["Lithuania"]},{value:"LU",label:"LU",type:"string",alternativeMatches:["Luxembourg"]},{value:"MO",label:"MO",type:"string",alternativeMatches:["Macao"]},{value:"MK",label:"MK",type:"string",alternativeMatches:["Republic of North Macedonia","North Macedonia"]},{value:"MG",label:"MG",type:"string",alternativeMatches:["Madagascar"]},{value:"MW",label:"MW",type:"string",alternativeMatches:["Malawi"]},{value:"MY",label:"MY",type:"string",alternativeMatches:["Malaysia"]},{value:"MV",label:"MV",type:"string",alternativeMatches:["Maldives"]},{value:"ML",label:"ML",type:"string",alternativeMatches:["Mali"]},{value:"MT",label:"MT",type:"string",alternativeMatches:["Malta"]},{value:"MH",label:"MH",type:"string",alternativeMatches:["Marshall Islands"]},{value:"MQ",label:"MQ",type:"string",alternativeMatches:["Martinique"]},{value:"MR",label:"MR",type:"string",alternativeMatches:["Mauritania"]},{value:"MU",label:"MU",type:"string",alternativeMatches:["Mauritius"]},{value:"YT",label:"YT",type:"string",alternativeMatches:["Mayotte"]},{value:"MX",label:"MX",type:"string",alternativeMatches:["Mexico"]},{value:"FM",label:"FM",type:"string",alternativeMatches:["Micronesia (Federated States of)"]},{value:"MD",label:"MD",type:"string",alternativeMatches:["Moldova (the Republic of)"]},{value:"MC",label:"MC",type:"string",alternativeMatches:["Monaco"]},{value:"MN",label:"MN",type:"string",alternativeMatches:["Mongolia"]},{value:"ME",label:"ME",type:"string",alternativeMatches:["Montenegro"]},{value:"MS",label:"MS",type:"string",alternativeMatches:["Montserrat"]},{value:"MA",label:"MA",type:"string",alternativeMatches:["Morocco"]},{value:"MZ",label:"MZ",type:"string",alternativeMatches:["Mozambique"]},{value:"MM",label:"MM",type:"string",alternativeMatches:["Myanmar"]},{value:"NA",label:"NA",type:"string",alternativeMatches:["Namibia"]},{value:"NR",label:"NR",type:"string",alternativeMatches:["Nauru"]},{value:"NP",label:"NP",type:"string",alternativeMatches:["Nepal"]},{value:"NL",label:"NL",type:"string",alternativeMatches:["Netherlands"]},{value:"NC",label:"NC",type:"string",alternativeMatches:["New Caledonia"]},{value:"NZ",label:"NZ",type:"string",alternativeMatches:["New Zealand"]},{value:"NI",label:"NI",type:"string",alternativeMatches:["Nicaragua"]},{value:"NE",label:"NE",type:"string",alternativeMatches:["Niger"]},{value:"NG",label:"NG",type:"string",alternativeMatches:["Nigeria"]},{value:"NU",label:"NU",type:"string",alternativeMatches:["Niue"]},{value:"NF",label:"NF",type:"string",alternativeMatches:["Norfolk Island"]},{value:"MP",label:"MP",type:"string",alternativeMatches:["Northern Mariana Islands"]},{value:"NO",label:"NO",type:"string",alternativeMatches:["Norway"]},{value:"OM",label:"OM",type:"string",alternativeMatches:["Oman"]},{value:"PK",label:"PK",type:"string",alternativeMatches:["Pakistan"]},{value:"PW",label:"PW",type:"string",alternativeMatches:["Palau"]},{value:"PS",label:"PS",type:"string",alternativeMatches:["Palestinian Territory, Occupied"]},{value:"PA",label:"PA",type:"string",alternativeMatches:["Panama"]},{value:"PG",label:"PG",type:"string",alternativeMatches:["Papua New Guinea"]},{value:"PY",label:"PY",type:"string",alternativeMatches:["Paraguay"]},{value:"PE",label:"PE",type:"string",alternativeMatches:["Peru"]},{value:"PH",label:"PH",type:"string",alternativeMatches:["Philippines"]},{value:"PN",label:"PN",type:"string",alternativeMatches:["Pitcairn"]},{value:"PL",label:"PL",type:"string",alternativeMatches:["Poland"]},{value:"PT",label:"PT",type:"string",alternativeMatches:["Portugal"]},{value:"PR",label:"PR",type:"string",alternativeMatches:["Puerto Rico"]},{value:"QA",label:"QA",type:"string",alternativeMatches:["Qatar"]},{value:"RE",label:"RE",type:"string",alternativeMatches:["R\xE9union"]},{value:"RO",label:"RO",type:"string",alternativeMatches:["Romania"]},{value:"RU",label:"RU",type:"string",alternativeMatches:["Russian Federation"]},{value:"RW",label:"RW",type:"string",alternativeMatches:["Rwanda"]},{value:"BL",label:"BL",type:"string",alternativeMatches:["Saint Barth\xE9lemy"]},{value:"SH",label:"SH",type:"string",alternativeMatches:["Saint Helena, Ascension and Tristan da Cunha"]},{value:"KN",label:"KN",type:"string",alternativeMatches:["Saint Kitts and Nevis","Saint Kitts","Nevis"]},{value:"LC",label:"LC",type:"string",alternativeMatches:["Saint Lucia"]},{value:"MF",label:"MF",type:"string",alternativeMatches:["Saint Martin (French part)"]},{value:"PM",label:"PM",type:"string",alternativeMatches:["Saint Pierre and Miquelon","Saint Pierre","Miquelon"]},{value:"VC",label:"VC",type:"string",alternativeMatches:["Saint Vincent and the Grenadines","Saint Vincent","Grenadines"]},{value:"WS",label:"WS",type:"string",alternativeMatches:["Samoa"]},{value:"SM",label:"SM",type:"string",alternativeMatches:["San Marino"]},{value:"ST",label:"ST",type:"string",alternativeMatches:["Sao Tome and Principe","Sao Tome","Principe"]},{value:"SA",label:"SA",type:"string",alternativeMatches:["Saudi Arabia"]},{value:"SN",label:"SN",type:"string",alternativeMatches:["Senegal"]},{value:"RS",label:"RS",type:"string",alternativeMatches:["Serbia"]},{value:"SC",label:"SC",type:"string",alternativeMatches:["Seychelles"]},{value:"SL",label:"SL",type:"string",alternativeMatches:["Sierra Leone"]},{value:"SG",label:"SG",type:"string",alternativeMatches:["Singapore"]},{value:"SX",label:"SX",type:"string",alternativeMatches:["Sint Maarten"]},{value:"SK",label:"SK",type:"string",alternativeMatches:["Slovakia"]},{value:"SI",label:"SI",type:"string",alternativeMatches:["Slovenia"]},{value:"SB",label:"SB",type:"string",alternativeMatches:["Solomon Islands"]},{value:"SO",label:"SO",type:"string",alternativeMatches:["Somalia"]},{value:"ZA",label:"ZA",type:"string",alternativeMatches:["South Africa"]},{value:"GS",label:"GS",type:"string",alternativeMatches:["South Georgia and the South Sandwich Islands","South Georgia","South Sandwich Islands"]},{value:"SS",label:"SS",type:"string",alternativeMatches:["South Sudan"]},{value:"ES",label:"ES",type:"string",alternativeMatches:["Spain"]},{value:"LK",label:"LK",type:"string",alternativeMatches:["Sri Lanka"]},{value:"SD",label:"SD",type:"string",alternativeMatches:["Sudan"]},{value:"SR",label:"SR",type:"string",alternativeMatches:["Suriname"]},{value:"SJ",label:"SJ",type:"string",alternativeMatches:["Svalbard and Jan Mayen","Svalbard","Jan Mayen"]},{value:"SZ",label:"SZ",type:"string",alternativeMatches:["Swaziland","Eswatini"]},{value:"SE",label:"SE",type:"string",alternativeMatches:["Sweden"]},{value:"CH",label:"CH",type:"string",alternativeMatches:["Switzerland"]},{value:"SY",label:"SY",type:"string",alternativeMatches:["Syrian Arab Republic"]},{value:"TW",label:"TW",type:"string",alternativeMatches:["Taiwan, Province of China"]},{value:"TJ",label:"TJ",type:"string",alternativeMatches:["Tajikistan"]},{value:"TZ",label:"TZ",type:"string",alternativeMatches:["Tanzania, United Republic of","Tanzania"]},{value:"TH",label:"TH",type:"string",alternativeMatches:["Thailand"]},{value:"TL",label:"TL",type:"string",alternativeMatches:["Timor-Leste"]},{value:"TG",label:"TG",type:"string",alternativeMatches:["Togo"]},{value:"TK",label:"TK",type:"string",alternativeMatches:["Tokelau"]},{value:"TO",label:"TO",type:"string",alternativeMatches:["Tonga"]},{value:"TT",label:"TT",type:"string",alternativeMatches:["Trinidad and Tobago","Trinidad","Tobago"]},{value:"TN",label:"TN",type:"string",alternativeMatches:["Tunisia"]},{value:"TR",label:"TR",type:"string",alternativeMatches:["Turkey"]},{value:"TM",label:"TM",type:"string",alternativeMatches:["Turkmenistan"]},{value:"TC",label:"TC",type:"string",alternativeMatches:["Turks and Caicos Islands"]},{value:"TV",label:"TV",type:"string",alternativeMatches:["Tuvalu"]},{value:"UG",label:"UG",type:"string",alternativeMatches:["Uganda"]},{value:"UA",label:"UA",type:"string",alternativeMatches:["Ukraine"]},{value:"AE",label:"AE",type:"string",alternativeMatches:["United Arab Emirates","UAE"]},{value:"GB",label:"GB",type:"string",alternativeMatches:["United Kingdom"]},{value:"US",label:"US",type:"string",alternativeMatches:["United States"]},{value:"UM",label:"UM",type:"string",alternativeMatches:["United States Minor Outlying Islands"]},{value:"UY",label:"UY",type:"string",alternativeMatches:["Uruguay"]},{value:"UZ",label:"UZ",type:"string",alternativeMatches:["Uzbekistan"]},{value:"VU",label:"VU",type:"string",alternativeMatches:["Vanuatu"]},{value:"VE",label:"VE",type:"string",alternativeMatches:["Venezuela (Bolivarian Republic of)","Venezuela","Bolivarian"]},{value:"VN",label:"VN",type:"string",alternativeMatches:["Viet Nam"]},{value:"VG",label:"VG",type:"string",alternativeMatches:["Virgin Islands (British)","British"]},{value:"VI",label:"VI",type:"string",alternativeMatches:["Virgin Islands (U.S.)"]},{value:"WF",label:"WF",type:"string",alternativeMatches:["Wallis and Futuna"]},{value:"EH",label:"EH",type:"string",alternativeMatches:["Western Sahara"]},{value:"YE",label:"YE",type:"string",alternativeMatches:["Yemen"]},{value:"ZM",label:"ZM",type:"string",alternativeMatches:["Zambia"]},{value:"ZW",label:"ZW",type:"string",alternativeMatches:["Zimbabwe"]}],m=[{value:"AFG",label:"AFG",type:"string",alternativeMatches:["Afghanistan"]},{value:"ALA",label:"ALA",type:"string",alternativeMatches:["\xC5land Islands"]},{value:"ALB",label:"ALB",type:"string",alternativeMatches:["Albania"]},{value:"DZA",label:"DZA",type:"string",alternativeMatches:["Algeria"]},{value:"ASM",label:"ASM",type:"string",alternativeMatches:["American Samoa"]},{value:"AND",label:"AND",type:"string",alternativeMatches:["Andorra"]},{value:"AGO",label:"AGO",type:"string",alternativeMatches:["Angola"]},{value:"AIA",label:"AIA",type:"string",alternativeMatches:["Anguilla"]},{value:"ATA",label:"ATA",type:"string",alternativeMatches:["Antarctica"]},{value:"ATG",label:"ATG",type:"string",alternativeMatches:["Antigua and Barbuda","Antigua","Barbuda"]},{value:"ARG",label:"ARG",type:"string",alternativeMatches:["Argentina"]},{value:"ARM",label:"ARM",type:"string",alternativeMatches:["Armenia"]},{value:"ABW",label:"ABW",type:"string",alternativeMatches:["Aruba"]},{value:"AUS",label:"AUS",type:"string",alternativeMatches:["Australia"]},{value:"AUT",label:"AUT",type:"string",alternativeMatches:["Austria"]},{value:"AZE",label:"AZE",type:"string",alternativeMatches:["Azerbaijan"]},{value:"BHS",label:"BHS",type:"string",alternativeMatches:["Bahamas"]},{value:"BHR",label:"BHR",type:"string",alternativeMatches:["Bahrain"]},{value:"BGD",label:"BGD",type:"string",alternativeMatches:["Bangladesh"]},{value:"BRB",label:"BRB",type:"string",alternativeMatches:["Barbados"]},{value:"BLR",label:"BLR",type:"string",alternativeMatches:["Belarus"]},{value:"BEL",label:"BEL",type:"string",alternativeMatches:["Belgium"]},{value:"BLZ",label:"BLZ",type:"string",alternativeMatches:["Belize"]},{value:"BEN",label:"BEN",type:"string",alternativeMatches:["Benin"]},{value:"BMU",label:"BMU",type:"string",alternativeMatches:["Bermuda"]},{value:"BTN",label:"BTN",type:"string",alternativeMatches:["Bhutan"]},{value:"BOL",label:"BOL",type:"string",alternativeMatches:["Bolivia (Plurinational State of)","Bolivia"]},{value:"BES",label:"BES",type:"string",alternativeMatches:["Bonaire, Sint Eustatius and Saba"]},{value:"BIH",label:"BIH",type:"string",alternativeMatches:["Bosnia and Herzegovina"]},{value:"BWA",label:"BWA",type:"string",alternativeMatches:["Botswana"]},{value:"BVT",label:"BVT",type:"string",alternativeMatches:["Bouvet Island"]},{value:"BRA",label:"BRA",type:"string",alternativeMatches:["Brazil"]},{value:"IOT",label:"IOT",type:"string",alternativeMatches:["British Indian Ocean Territory"]},{value:"BRN",label:"BRN",type:"string",alternativeMatches:["Brunei Darussalam"]},{value:"BGR",label:"BGR",type:"string",alternativeMatches:["Bulgaria"]},{value:"BFA",label:"BFA",type:"string",alternativeMatches:["Burkina Faso"]},{value:"BDI",label:"BDI",type:"string",alternativeMatches:["Burundi"]},{value:"KHM",label:"KHM",type:"string",alternativeMatches:["Cambodia"]},{value:"CMR",label:"CMR",type:"string",alternativeMatches:["Cameroon"]},{value:"CAN",label:"CAN",type:"string",alternativeMatches:["Canada"]},{value:"CPV",label:"CPV",type:"string",alternativeMatches:["Cape Verde"]},{value:"CYM",label:"CYM",type:"string",alternativeMatches:["Cayman Islands"]},{value:"CAF",label:"CAF",type:"string",alternativeMatches:["Central African Republic"]},{value:"TCD",label:"TCD",type:"string",alternativeMatches:["Chad"]},{value:"CHL",label:"CHL",type:"string",alternativeMatches:["Chile"]},{value:"CHN",label:"CHN",type:"string",alternativeMatches:["China"]},{value:"CXR",label:"CXR",type:"string",alternativeMatches:["Christmas Island"]},{value:"CCK",label:"CCK",type:"string",alternativeMatches:["Cocos (Keeling) Islands"]},{value:"COL",label:"COL",type:"string",alternativeMatches:["Colombia"]},{value:"COM",label:"COM",type:"string",alternativeMatches:["Comoros"]},{value:"COG",label:"COG",type:"string",alternativeMatches:["Congo"]},{value:"COD",label:"COD",type:"string",alternativeMatches:["Congo (the Democratic Republic of the)"]},{value:"COK",label:"COK",type:"string",alternativeMatches:["Cook Islands"]},{value:"CRI",label:"CRI",type:"string",alternativeMatches:["Costa Rica"]},{value:"CIV",label:"CIV",type:"string",alternativeMatches:["C\xF4te d'Ivoire"]},{value:"HRV",label:"HRV",type:"string",alternativeMatches:["Croatia"]},{value:"CUB",label:"CUB",type:"string",alternativeMatches:["Cuba"]},{value:"CUW",label:"CUW",type:"string",alternativeMatches:["Cura\xE7ao"]},{value:"CYP",label:"CYP",type:"string",alternativeMatches:["Cyprus"]},{value:"CZE",label:"CZE",type:"string",alternativeMatches:["Czechia","Czech Republic"]},{value:"DNK",label:"DNK",type:"string",alternativeMatches:["Denmark"]},{value:"DJI",label:"DJI",type:"string",alternativeMatches:["Djibouti"]},{value:"DMA",label:"DMA",type:"string",alternativeMatches:["Dominica"]},{value:"DOM",label:"DOM",type:"string",alternativeMatches:["Dominican Republic"]},{value:"ECU",label:"ECU",type:"string",alternativeMatches:["Ecuador"]},{value:"EGY",label:"EGY",type:"string",alternativeMatches:["Egypt"]},{value:"SLV",label:"SLV",type:"string",alternativeMatches:["El Salvador"]},{value:"GNQ",label:"GNQ",type:"string",alternativeMatches:["Equatorial Guinea"]},{value:"ERI",label:"ERI",type:"string",alternativeMatches:["Eritrea"]},{value:"EST",label:"EST",type:"string",alternativeMatches:["Estonia"]},{value:"ETH",label:"ETH",type:"string",alternativeMatches:["Ethiopia"]},{value:"FLK",label:"FLK",type:"string",alternativeMatches:["Falkland Islands (Malvinas)"]},{value:"FRO",label:"FRO",type:"string",alternativeMatches:["Faroe Islands"]},{value:"FJI",label:"FJI",type:"string",alternativeMatches:["Fiji"]},{value:"FIN",label:"FIN",type:"string",alternativeMatches:["Finland"]},{value:"FRA",label:"FRA",type:"string",alternativeMatches:["France"]},{value:"GUF",label:"GUF",type:"string",alternativeMatches:["French Guiana"]},{value:"PYF",label:"PYF",type:"string",alternativeMatches:["French Polynesia"]},{value:"ATF",label:"ATF",type:"string",alternativeMatches:["French Southern Territories"]},{value:"GAB",label:"GAB",type:"string",alternativeMatches:["Gabon"]},{value:"GMB",label:"GMB",type:"string",alternativeMatches:["Gambia"]},{value:"GEO",label:"GEO",type:"string",alternativeMatches:["Georgia"]},{value:"DEU",label:"DEU",type:"string",alternativeMatches:["Germany"]},{value:"GHA",label:"GHA",type:"string",alternativeMatches:["Ghana"]},{value:"GIB",label:"GIB",type:"string",alternativeMatches:["Gibraltar"]},{value:"GRC",label:"GRC",type:"string",alternativeMatches:["Greece"]},{value:"GRL",label:"GRL",type:"string",alternativeMatches:["Greenland"]},{value:"GRD",label:"GRD",type:"string",alternativeMatches:["Grenada"]},{value:"GLP",label:"GLP",type:"string",alternativeMatches:["Guadeloupe"]},{value:"GUM",label:"GUM",type:"string",alternativeMatches:["Guam"]},{value:"GTM",label:"GTM",type:"string",alternativeMatches:["Guatemala"]},{value:"GGY",label:"GGY",type:"string",alternativeMatches:["Guernsey"]},{value:"GIN",label:"GIN",type:"string",alternativeMatches:["Guinea"]},{value:"GNB",label:"GNB",type:"string",alternativeMatches:["Guinea-Bissau"]},{value:"GUY",label:"GUY",type:"string",alternativeMatches:["Guyana"]},{value:"HTI",label:"HTI",type:"string",alternativeMatches:["Haiti"]},{value:"HMD",label:"HMD",type:"string",alternativeMatches:["Heard Island and McDonald Islands","Heard Island","McDonald Islands"]},{value:"VAT",label:"VAT",type:"string",alternativeMatches:["Holy See (Vatican City State)"]},{value:"HND",label:"HND",type:"string",alternativeMatches:["Honduras"]},{value:"HKG",label:"HKG",type:"string",alternativeMatches:["Hong Kong"]},{value:"HUN",label:"HUN",type:"string",alternativeMatches:["Hungary"]},{value:"ISL",label:"ISL",type:"string",alternativeMatches:["Iceland"]},{value:"IND",label:"IND",type:"string",alternativeMatches:["India"]},{value:"IDN",label:"IDN",type:"string",alternativeMatches:["Indonesia"]},{value:"IRN",label:"IRN",type:"string",alternativeMatches:["Iran (Islamic Republic of) ","Iran"]},{value:"IRQ",label:"IRQ",type:"string",alternativeMatches:["Iraq"]},{value:"IRL",label:"IRL",type:"string",alternativeMatches:["Ireland"]},{value:"IMN",label:"IMN",type:"string",alternativeMatches:["Isle of Man"]},{value:"ISR",label:"ISR",type:"string",alternativeMatches:["Israel"]},{value:"ITA",label:"ITA",type:"string",alternativeMatches:["Italy"]},{value:"JAM",label:"JAM",type:"string",alternativeMatches:["Jamaica"]},{value:"JPN",label:"JPN",type:"string",alternativeMatches:["Japan"]},{value:"JEY",label:"JEY",type:"string",alternativeMatches:["Jersey"]},{value:"JOR",label:"JOR",type:"string",alternativeMatches:["Jordan"]},{value:"KAZ",label:"KAZ",type:"string",alternativeMatches:["Kazakhstan"]},{value:"KEN",label:"KEN",type:"string",alternativeMatches:["Kenya"]},{value:"KIR",label:"KIR",type:"string",alternativeMatches:["Kiribati"]},{value:"PRK",label:"PRK",type:"string",alternativeMatches:["Democratic People's Republic of Korea","North Korea"]},{value:"KOR",label:"KOR",type:"string",alternativeMatches:["Korea, Republic of Korea","South Korea"]},{value:"KWT",label:"KWT",type:"string",alternativeMatches:["Kuwait"]},{value:"KGZ",label:"KGZ",type:"string",alternativeMatches:["Kyrgyzstan"]},{value:"LAO",label:"LAO",type:"string",alternativeMatches:["Lao People's Democratic Republic"]},{value:"LVA",label:"LVA",type:"string",alternativeMatches:["Latvia"]},{value:"LBN",label:"LBN",type:"string",alternativeMatches:["Lebanon"]},{value:"LSO",label:"LSO",type:"string",alternativeMatches:["Lesotho"]},{value:"LBR",label:"LBR",type:"string",alternativeMatches:["Liberia"]},{value:"LBY",label:"LBY",type:"string",alternativeMatches:["Libya"]},{value:"LIE",label:"LIE",type:"string",alternativeMatches:["Liechtenstein"]},{value:"LTU",label:"LTU",type:"string",alternativeMatches:["Lithuania"]},{value:"LUX",label:"LUX",type:"string",alternativeMatches:["Luxembourg"]},{value:"MAC",label:"MAC",type:"string",alternativeMatches:["Macao"]},{value:"MKD",label:"MKD",type:"string",alternativeMatches:["Republic of North Macedonia","North Macedonia"]},{value:"MDG",label:"MDG",type:"string",alternativeMatches:["Madagascar"]},{value:"MWI",label:"MWI",type:"string",alternativeMatches:["Malawi"]},{value:"MYS",label:"MYS",type:"string",alternativeMatches:["Malaysia"]},{value:"MDV",label:"MDV",type:"string",alternativeMatches:["Maldives"]},{value:"MLI",label:"MLI",type:"string",alternativeMatches:["Mali"]},{value:"MLT",label:"MLT",type:"string",alternativeMatches:["Malta"]},{value:"MHL",label:"MHL",type:"string",alternativeMatches:["Marshall Islands"]},{value:"MTQ",label:"MTQ",type:"string",alternativeMatches:["Martinique"]},{value:"MRT",label:"MRT",type:"string",alternativeMatches:["Mauritania"]},{value:"MUS",label:"MUS",type:"string",alternativeMatches:["Mauritius"]},{value:"MYT",label:"MYT",type:"string",alternativeMatches:["Mayotte"]},{value:"MEX",label:"MEX",type:"string",alternativeMatches:["Mexico"]},{value:"FSM",label:"FSM",type:"string",alternativeMatches:["Micronesia (Federated States of)"]},{value:"MDA",label:"MDA",type:"string",alternativeMatches:["Moldova (the Republic of)"]},{value:"MCO",label:"MCO",type:"string",alternativeMatches:["Monaco"]},{value:"MNG",label:"MNG",type:"string",alternativeMatches:["Mongolia"]},{value:"MNE",label:"MNE",type:"string",alternativeMatches:["Montenegro"]},{value:"MSR",label:"MSR",type:"string",alternativeMatches:["Montserrat"]},{value:"MAR",label:"MAR",type:"string",alternativeMatches:["Morocco"]},{value:"MOZ",label:"MOZ",type:"string",alternativeMatches:["Mozambique"]},{value:"MMR",label:"MMR",type:"string",alternativeMatches:["Myanmar"]},{value:"NAM",label:"NAM",type:"string",alternativeMatches:["Namibia"]},{value:"NRU",label:"NRU",type:"string",alternativeMatches:["Nauru"]},{value:"NPL",label:"NPL",type:"string",alternativeMatches:["Nepal"]},{value:"NLD",label:"NLD",type:"string",alternativeMatches:["Netherlands"]},{value:"NCL",label:"NCL",type:"string",alternativeMatches:["New Caledonia"]},{value:"NZL",label:"NZL",type:"string",alternativeMatches:["New Zealand"]},{value:"NIC",label:"NIC",type:"string",alternativeMatches:["Nicaragua"]},{value:"NER",label:"NER",type:"string",alternativeMatches:["Niger"]},{value:"NGA",label:"NGA",type:"string",alternativeMatches:["Nigeria"]},{value:"NIU",label:"NIU",type:"string",alternativeMatches:["Niue"]},{value:"NFK",label:"NFK",type:"string",alternativeMatches:["Norfolk Island"]},{value:"MNP",label:"MNP",type:"string",alternativeMatches:["Northern Mariana Islands"]},{value:"NOR",label:"NOR",type:"string",alternativeMatches:["Norway"]},{value:"OMN",label:"OMN",type:"string",alternativeMatches:["Oman"]},{value:"PAK",label:"PAK",type:"string",alternativeMatches:["Pakistan"]},{value:"PLW",label:"PLW",type:"string",alternativeMatches:["Palau"]},{value:"PSE",label:"PSE",type:"string",alternativeMatches:["Palestinian Territory, Occupied"]},{value:"PAN",label:"PAN",type:"string",alternativeMatches:["Panama"]},{value:"PNG",label:"PNG",type:"string",alternativeMatches:["Papua New Guinea"]},{value:"PRY",label:"PRY",type:"string",alternativeMatches:["Paraguay"]},{value:"PER",label:"PER",type:"string",alternativeMatches:["Peru"]},{value:"PHL",label:"PHL",type:"string",alternativeMatches:["Philippines"]},{value:"PCN",label:"PCN",type:"string",alternativeMatches:["Pitcairn"]},{value:"POL",label:"POL",type:"string",alternativeMatches:["Poland"]},{value:"PRT",label:"PRT",type:"string",alternativeMatches:["Portugal"]},{value:"PRI",label:"PRI",type:"string",alternativeMatches:["Puerto Rico"]},{value:"QAT",label:"QAT",type:"string",alternativeMatches:["Qatar"]},{value:"REU",label:"REU",type:"string",alternativeMatches:["R\xE9union"]},{value:"ROU",label:"ROU",type:"string",alternativeMatches:["Romania"]},{value:"RUS",label:"RUS",type:"string",alternativeMatches:["Russian Federation"]},{value:"RWA",label:"RWA",type:"string",alternativeMatches:["Rwanda"]},{value:"BLM",label:"BLM",type:"string",alternativeMatches:["Saint Barth\xE9lemy"]},{value:"SHN",label:"SHN",type:"string",alternativeMatches:["Saint Helena, Ascension and Tristan da Cunha"]},{value:"KNA",label:"KNA",type:"string",alternativeMatches:["Saint Kitts and Nevis","Saint Kitts","Nevis"]},{value:"LCA",label:"LCA",type:"string",alternativeMatches:["Saint Lucia"]},{value:"MAF",label:"MAF",type:"string",alternativeMatches:["Saint Martin (French part)"]},{value:"SPM",label:"SPM",type:"string",alternativeMatches:["Saint Pierre and Miquelon","Saint Pierre","Miquelon"]},{value:"VCT",label:"VCT",type:"string",alternativeMatches:["Saint Vincent and the Grenadines","Saint Vincent","Grenadines"]},{value:"WSM",label:"WSM",type:"string",alternativeMatches:["Samoa"]},{value:"SMR",label:"SMR",type:"string",alternativeMatches:["San Marino"]},{value:"STP",label:"STP",type:"string",alternativeMatches:["Sao Tome and Principe","Sao Tome","Principe"]},{value:"SAU",label:"SAU",type:"string",alternativeMatches:["Saudi Arabia"]},{value:"SEN",label:"SEN",type:"string",alternativeMatches:["Senegal"]},{value:"SRB",label:"SRB",type:"string",alternativeMatches:["Serbia"]},{value:"SYC",label:"SYC",type:"string",alternativeMatches:["Seychelles"]},{value:"SLE",label:"SLE",type:"string",alternativeMatches:["Sierra Leone"]},{value:"SGP",label:"SGP",type:"string",alternativeMatches:["Singapore"]},{value:"SXM",label:"SXM",type:"string",alternativeMatches:["Sint Maarten (Dutch part)"]},{value:"SVK",label:"SVK",type:"string",alternativeMatches:["Slovakia"]},{value:"SVN",label:"SVN",type:"string",alternativeMatches:["Slovenia"]},{value:"SLB",label:"SLB",type:"string",alternativeMatches:["Solomon Islands"]},{value:"SOM",label:"SOM",type:"string",alternativeMatches:["Somalia"]},{value:"ZAF",label:"ZAF",type:"string",alternativeMatches:["South Africa"]},{value:"SGS",label:"SGS",type:"string",alternativeMatches:["South Georgia and the South Sandwich Islands","South Georgia","South Sandwich Islands"]},{value:"SSD",label:"SSD",type:"string",alternativeMatches:["South Sudan"]},{value:"ESP",label:"ESP",type:"string",alternativeMatches:["Spain"]},{value:"LKA",label:"LKA",type:"string",alternativeMatches:["Sri Lanka"]},{value:"SDN",label:"SDN",type:"string",alternativeMatches:["Sudan"]},{value:"SUR",label:"SUR",type:"string",alternativeMatches:["Suriname"]},{value:"SJM",label:"SJM",type:"string",alternativeMatches:["Svalbard and Jan Mayen","Svalbard","Jan Mayen"]},{value:"SWZ",label:"SWZ",type:"string",alternativeMatches:["Swaziland","Eswatini"]},{value:"SWE",label:"SWE",type:"string",alternativeMatches:["Sweden"]},{value:"CHE",label:"CHE",type:"string",alternativeMatches:["Switzerland"]},{value:"SYR",label:"SYR",type:"string",alternativeMatches:["Syrian Arab Republic"]},{value:"TWN",label:"TWN",type:"string",alternativeMatches:["Taiwan, Province of China"]},{value:"TJK",label:"TJK",type:"string",alternativeMatches:["Tajikistan"]},{value:"TZA",label:"TZA",type:"string",alternativeMatches:["Tanzania, United Republic of"]},{value:"THA",label:"THA",type:"string",alternativeMatches:["Thailand"]},{value:"TLS",label:"TLS",type:"string",alternativeMatches:["Timor-Leste"]},{value:"TGO",label:"TGO",type:"string",alternativeMatches:["Togo"]},{value:"TKL",label:"TKL",type:"string",alternativeMatches:["Tokelau"]},{value:"TON",label:"TON",type:"string",alternativeMatches:["Tonga"]},{value:"TTO",label:"TTO",type:"string",alternativeMatches:["Trinidad and Tobago","Trinidad","Tobago"]},{value:"TUN",label:"TUN",type:"string",alternativeMatches:["Tunisia"]},{value:"TUR",label:"TUR",type:"string",alternativeMatches:["Turkey"]},{value:"TKM",label:"TKM",type:"string",alternativeMatches:["Turkmenistan"]},{value:"TCA",label:"TCA",type:"string",alternativeMatches:["Turks and Caicos Islands"]},{value:"TUV",label:"TUV",type:"string",alternativeMatches:["Tuvalu"]},{value:"UGA",label:"UGA",type:"string",alternativeMatches:["Uganda"]},{value:"UKR",label:"UKR",type:"string",alternativeMatches:["Ukraine"]},{value:"ARE",label:"ARE",type:"string",alternativeMatches:["United Arab Emirates"]},{value:"GBR",label:"GBR",type:"string",alternativeMatches:["United Kingdom"]},{value:"USA",label:"USA",type:"string",alternativeMatches:["United States"]},{value:"UMI",label:"UMI",type:"string",alternativeMatches:["United States Minor Outlying Islands"]},{value:"URY",label:"URY",type:"string",alternativeMatches:["Uruguay"]},{value:"UZB",label:"UZB",type:"string",alternativeMatches:["Uzbekistan"]},{value:"VUT",label:"VUT",type:"string",alternativeMatches:["Vanuatu"]},{value:"VEN",label:"VEN",type:"string",alternativeMatches:["Venezuela (Bolivarian Republic of)","Venezuela","Bolivarian"]},{value:"VNM",label:"VNM",type:"string",alternativeMatches:["Viet Nam"]},{value:"VGB",label:"VGB",type:"string",alternativeMatches:["Virgin Islands (British)","British"]},{value:"VIR",label:"VIR",type:"string",alternativeMatches:["Virgin Islands (U.S.)"]},{value:"WLF",label:"WLF",type:"string",alternativeMatches:["Wallis and Futuna"]},{value:"ESH",label:"ESH",type:"string",alternativeMatches:["Western Sahara"]},{value:"YEM",label:"YEM",type:"string",alternativeMatches:["Yemen"]},{value:"ZMB",label:"ZMB",type:"string",alternativeMatches:["Zambia"]},{value:"ZWE",label:"ZWE",type:"string",alternativeMatches:["Zimbabwe"]}];import{isArray as V}from"lodash";var o=class i{constructor(a,e){this.dataModels=[];this.mapValidation=a=>{switch(a){case"regex":return"REGEX";case"required":return"REQUIRED";case"required_with":return"REQUIRED_WITH";case"required_with_all":return"REQUIRED_WITH_ALL";case"required_with_all_values":return"REQUIRED_WITH_ALL_VALUES";case"required_with_values":return"REQUIRED_WITH_VALUES";case"required_without":return"REQUIRED_WITHOUT";case"required_without_all":return"REQUIRED_WITHOUT_ALL";case"required_without_all_values":return"REQUIRED_WITHOUT_ALL_VALUES";case"required_without_values":return"REQUIRED_WITHOUT_VALUES";case"unique":return"UNIQUE";case"compare":return"COMPARE";default:throw new Error(`validation "${a}" isn't in available options`)}};this.getValidator=(a,e)=>new E({validation:this.mapValidation(a.validate),regex:a.regex??void 0,fields:a.columnValues?.map(t=>({key:t.key,value:t.value??[],type:this.findDataModelTypeByKey(t.key,e),label:this.findDataModelLabelByKey(t.key,e)}))??[],errorMessage:a.errorMessage,operator:a.operator,value:a.value});this.findDataModel=a=>this.columns.find(e=>e.key===a);this.findDataModelTypeByKey=(a,e)=>{let t=this.findDataModel(a);if(t)return i.mapDataModelType({columnType:t.columnType});if(e.checkValidation)throw new Error(`validation key "${a}" isn't found.`);return"string"};this.findDataModelLabelByKey=(a,e)=>{let t=this.findDataModel(a);if(t)return t.label;if(e.checkValidation)throw new Error(`validation key "${a}" isn't found.`);return""};this.validatorParser=a=>{let e=a.validate.toUpperCase(),t=a.columnValues??{},r=a.columns??[];return e==="REQUIRED_WITH_VALUES"||e==="REQUIRED_WITH_ALL_VALUES"||e==="REQUIRED_WITHOUT_VALUES"||e==="REQUIRED_WITHOUT_ALL_VALUES"?Object.keys(t).map(l=>({key:l,value:V(t[l])?t[l]:[t[l]]})):e==="REQUIRED_WITH"||e==="REQUIRED_WITHOUT"||e==="REQUIRED_WITHOUT_ALL"||e==="REQUIRED_WITH_ALL"?r.map(l=>({key:l})):[]};this.setDataModels=a=>{this.dataModels=this.columns.map(e=>{let t=i.mapDataModelType({columnType:e.columnType});e.numberFormat===void 0&&t==="currency_usd"&&(e.numberFormat="us");let r=e.optionMappingConfiguration?.processingMode??"browser",l=e.optionMappingConfiguration?.layers&&e.optionMappingConfiguration?.layers.length>0?e.optionMappingConfiguration?.layers:["smart","historic","fuzzy","exact"];a.enableNodeProcessing||(r="browser",l=l.filter(n=>n!=="historic"&&n!=="smart")),a.enableReuseMapping||(l=l.filter(n=>n!=="historic"));let M={layers:l,processingMode:r,threshold:e.optionMappingConfiguration?.threshold??.6},s={description:e.description??"",example:e.example??"",key:e.key,label:e.label,type:t,isRequired:!1,outputFormat:e.outputFormat??"",inputFormat:t==="date"?I(e.inputFormat):null,validators:e.validations?.map(n=>this.getValidator({...n,columnValues:this.validatorParser(n)},a)),mappingValidation:e.mappingValidation,alternativeMatches:e.alternativeMatches,columnSize:1,columnWidth:e.columnWidth,numberFormat:e.numberFormat||"eu",hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:M,excludeFromAutoMatching:e.excludeFromAutoMatching};return u.isTypeCategory(t)?new B({...s,type:t,options:i.createDropdownOptions(e),isMultiSelection:e.isMultiSelect??!1,allowCustomOptions:e.allowCustomOptions,allowedCustomOptionTypes:e.allowedCustomOptionTypes,preserveUnmappedOptions:i.sanitizePreserveUnmappedOptions(e.preserveUnmappedOptions)}):new u(s)})};this.getDataModels=()=>this.dataModels;this.hasDateType=()=>{let a=!1;for(let e=0;e<this.dataModels.length;++e)if(["date","datetime","date_dmy","date_iso","date_mdy"].includes(this.dataModels?.[e].getType())){a=!0;break}return a};this.columns=a,this.setDataModels(e)}static{this.mapDataModelType=({columnType:a})=>{switch(a){case"boolean":return"boolean";case"int":return"int";case"float":return"float";case"category":return"single-select";case"date":return"date";case"date_dmy":return"date_dmy";case"date_mdy":return"date_mdy";case"date_iso":return"date_iso";case"datetime":return"datetime";case"time_hms":return"time_hms";case"time_hms_24":return"time_hms_24";case"time_hm":return"time_hm";case"time_hm_24":return"time_hm_24";case"email":return"email";case"url_www":return"url_www";case"url_https":return"url_https";case"url":return"url";case"phone":return"phone";case"zip_code_de":return"zip_code_de";case"percentage":return"percentage";case"country_code_alpha_2":return"country_code_alpha_2";case"country_code_alpha_3":return"country_code_alpha_3";case"currency_code":return"currency_code";case"currency_eur":return"currency_eur";case"currency_usd":return"currency_usd";case"bic":return"bic";case"vat_eu":return"vat_eu";case"gtin":return"gtin";case"iban":return"iban";default:return"string"}}}static{this.mapColumnType=({dataType:a})=>{switch(a){case"boolean":return"boolean";case"int":return"int";case"float":return"float";case"single-select":return"category";case"date":return"date";case"date_dmy":return"date_dmy";case"date_mdy":return"date_mdy";case"date_iso":return"date_iso";case"datetime":return"datetime";case"time_hms":return"time_hms";case"time_hms_24":return"time_hms_24";case"time_hm":return"time_hm";case"time_hm_24":return"time_hm_24";case"email":return"email";case"url_www":return"url_www";case"url_https":return"url_https";case"url":return"url";case"phone":return"phone";case"zip_code_de":return"zip_code_de";case"percentage":return"percentage";case"country_code_alpha_2":return"country_code_alpha_2";case"country_code_alpha_3":return"country_code_alpha_3";case"currency_code":return"currency_code";case"currency_eur":return"currency_eur";case"currency_usd":return"currency_usd";case"bic":return"bic";case"vat_eu":return"vat_eu";case"gtin":return"gtin";case"iban":return"iban";default:return"string"}}}static{this.VALID_PRESERVE_UNMAPPED_OPTIONS=["none","optional-off","optional-on","always"]}static{this.sanitizePreserveUnmappedOptions=a=>{if(typeof a=="string"&&i.VALID_PRESERVE_UNMAPPED_OPTIONS.includes(a))return a}}static{this.createDropdownOptions=a=>a.columnType==="category"?a.dropdownOptions?.map(e=>({label:`${e.label}`,value:`${e.value}`,type:e.type,alternativeMatches:e.alternativeMatches??[],validations:e.validations??[],description:e.description??""}))??[]:a.columnType==="currency_code"?D:a.columnType==="country_code_alpha_2"?P:a.columnType==="country_code_alpha_3"?m:[]}},L=o;var be=(i,a,e,t,r,l)=>{let M=0,s=0,n=0,d=!1,S=!1,{value:G,columns:A,isExact:U,isEmptyValues:h}=a,y=G?.trim();if(!h&&(F(y)||y.length===0))return;let O=h?i.length-1:i.length;for(let c=0;c<O;c++){let T=i[c],g=Object.keys(T);for(let p=0;p<g.length;p++){let R=A.findIndex(v=>v.key===g[p]),b=R>=0?A[R]:void 0;if(b===void 0)continue;let K=T[g[p]];if(N(K,{value:y??"",columns:[b],isExact:U,isEmptyValues:h})){M++;let v=l.findIndex(_=>_.key===b.key),C=l[v];(e.includes(v)||t.includes(c))&&s++,r.includes(v)&&n++,C.disabled&&(S=!0),u.isTypeCategory(L.mapDataModelType({columnType:C.columnType}))&&(d=!0)}}}return{counter:M,hidden:s,skip:n,matchedCategoryType:d,matchedDisabledColumn:S}};export{D as a,P as b,m as c,L as d,be as e};
|
|
1
|
+
import{e as I,h as E,i as u,m as N,r as B}from"./chunk-RHL57REG.js";import{isNil as F}from"lodash";var D=[{label:"AFN",value:"AFN",type:"string",alternativeMatches:["Af","Afghanistan"]},{label:"ARS",value:"ARS",type:"string",alternativeMatches:["AR$","Argentina"]},{label:"AWG",value:"AWG",type:"string",alternativeMatches:["Aruba"]},{label:"AUD",value:"AUD",type:"string",alternativeMatches:["AU$","Australia"]},{label:"AZN",value:"AZN",type:"string",alternativeMatches:["man.","Azerbaijan"]},{label:"BSD",value:"BSD",type:"string",alternativeMatches:["Bahamas"]},{label:"BBD",value:"BBD",type:"string",alternativeMatches:["Barbados"]},{label:"BYN",value:"BYN",type:"string",alternativeMatches:["Br"]},{label:"BZD",value:"BZD",type:"string",alternativeMatches:["BZ$","Belize"]},{label:"BMD",value:"BMD",type:"string",alternativeMatches:["Bermuda"]},{label:"BOB",value:"BOB",type:"string",alternativeMatches:["Bs","Bolivia"]},{label:"BAM",value:"BAM",type:"string",alternativeMatches:["KM","Bosnia and Herzegovina"]},{label:"BWP",value:"BWP",type:"string",alternativeMatches:["BWP","Botswana"]},{label:"BGN",value:"BGN",type:"string",alternativeMatches:["BGN","Bulgaria"]},{label:"BRL",value:"BRL",type:"string",alternativeMatches:["R$","Brazil"]},{label:"BND",value:"BND",type:"string",alternativeMatches:["BN$","Brunei"]},{label:"KHR",value:"KHR",type:"string",alternativeMatches:["KHR","Cambodia"]},{label:"CAD",value:"CAD",type:"string",alternativeMatches:["CA$","Canada"]},{label:"KYD",value:"KYD",type:"string",alternativeMatches:["Cayman Islands"]},{label:"CLP",value:"CLP",type:"string",alternativeMatches:["CL$","Chile"]},{label:"CNY",value:"CNY",type:"string",alternativeMatches:["CN\xA5","China"]},{label:"COP",value:"COP",type:"string",alternativeMatches:["CO$","Colombia"]},{label:"CRC",value:"CRC",type:"string",alternativeMatches:["\u20A1","Costa Rica"]},{label:"HRK",value:"HRK",type:"string",alternativeMatches:["kn","Croatia"]},{label:"CUP",value:"CUP",type:"string",alternativeMatches:["Cuba"]},{label:"CZK",value:"CZK",type:"string",alternativeMatches:["K\u010D","Czech Republic"]},{label:"DKK",value:"DKK",type:"string",alternativeMatches:["Dkr","Denmark"]},{label:"DOP",value:"DOP",type:"string",alternativeMatches:["RD$","Dominican Republic"]},{label:"XCD",value:"XCD",type:"string",alternativeMatches:["Anguilla"]},{label:"EGP",value:"EGP",type:"string",alternativeMatches:["EGP","Egypt"]},{label:"SVC",value:"SVC",type:"string",alternativeMatches:["El Salvador"]},{label:"EUR",value:"EUR",type:"string",alternativeMatches:["\u20AC","Germany"]},{label:"FKP",value:"FKP",type:"string",alternativeMatches:["Falkland Islands"]},{label:"FJD",value:"FJD",type:"string",alternativeMatches:["Fiji Islands"]},{label:"GHS",value:"GHS",type:"string",alternativeMatches:["GH\u20B5","Ghana"]},{label:"GIP",value:"GIP",type:"string",alternativeMatches:["Gibraltar"]},{label:"GTQ",value:"GTQ",type:"string",alternativeMatches:["GTQ"]},{label:"GGP",value:"GGP",type:"string",alternativeMatches:[]},{label:"GYD",value:"GYD",type:"string",alternativeMatches:["Guyana"]},{label:"HNL",value:"HNL",type:"string",alternativeMatches:["HNL","Honduras"]},{label:"HKD",value:"HKD",type:"string",alternativeMatches:["HK$","Hong Kong"]},{label:"HUF",value:"HUF",type:"string",alternativeMatches:["Ft","Hungary"]},{label:"ISK",value:"ISK",type:"string",alternativeMatches:["Ikr","Iceland"]},{label:"INR",value:"INR",type:"string",alternativeMatches:["\u20B9","India"]},{label:"IDR",value:"IDR",type:"string",alternativeMatches:["Rp","Indonesia"]},{label:"IRR",value:"IRR",type:"string",alternativeMatches:["IRR","Iran"]},{label:"IMP",value:"IMP",type:"string",alternativeMatches:[]},{label:"ILS",value:"ILS",type:"string",alternativeMatches:["\u20AA","Israel"]},{label:"JMD",value:"JMD",type:"string",alternativeMatches:["J$","Jamaica"]},{label:"JPY",value:"JPY",type:"string",alternativeMatches:["\xA5","Japan"]},{label:"JEP",value:"JEP",type:"string",alternativeMatches:[]},{label:"KZT",value:"KZT",type:"string",alternativeMatches:["KZT","Kazakhstan"]},{label:"KPW",value:"KPW",type:"string",alternativeMatches:["North Korea"]},{label:"KRW",value:"KRW",type:"string",alternativeMatches:["\u20A9","South Korea"]},{label:"KGS",value:"KGS",type:"string",alternativeMatches:["Kyrgyzstan"]},{label:"LAK",value:"LAK",type:"string",alternativeMatches:["Laos"]},{label:"LBP",value:"LBP",type:"string",alternativeMatches:["L.L.","Lebanon"]},{label:"LRD",value:"LRD",type:"string",alternativeMatches:["Liberia"]},{label:"MKD",value:"MKD",type:"string",alternativeMatches:["MKD","North Macedonia"]},{label:"MYR",value:"MYR",type:"string",alternativeMatches:["RM","Malaysia"]},{label:"MUR",value:"MUR",type:"string",alternativeMatches:["MURs","Mauritius"]},{label:"MXN",value:"MXN",type:"string",alternativeMatches:["MX$","Mexico"]},{label:"MNT",value:"MNT",type:"string",alternativeMatches:["Mongolia"]},{label:"MZN",value:"MZN",type:"string",alternativeMatches:["MTn","Mozambique"]},{label:"NAD",value:"NAD",type:"string",alternativeMatches:["N$","Namibia"]},{label:"NPR",value:"NPR",type:"string",alternativeMatches:["NPRs","Nepal"]},{label:"ANG",value:"ANG",type:"string",alternativeMatches:["Netherlands Antilles"]},{label:"NZD",value:"NZD",type:"string",alternativeMatches:["NZ$","Cook Islands"]},{label:"NIO",value:"NIO",type:"string",alternativeMatches:["C$","Nicaragua"]},{label:"NGN",value:"NGN",type:"string",alternativeMatches:["\u20A6","Nigeria"]},{label:"NOK",value:"NOK",type:"string",alternativeMatches:["Nkr","Bouvet Island"]},{label:"OMR",value:"OMR",type:"string",alternativeMatches:["OMR","Oman"]},{label:"PKR",value:"PKR",type:"string",alternativeMatches:["PKRs","Pakistan"]},{label:"PAB",value:"PAB",type:"string",alternativeMatches:["B/.","Panama"]},{label:"PYG",value:"PYG",type:"string",alternativeMatches:["\u20B2","Paraguay"]},{label:"PEN",value:"PEN",type:"string",alternativeMatches:["S/.","Peru"]},{label:"PHP",value:"PHP",type:"string",alternativeMatches:["\u20B1","Philippines"]},{label:"PLN",value:"PLN",type:"string",alternativeMatches:["z\u0142","Poland"]},{label:"QAR",value:"QAR",type:"string",alternativeMatches:["QR","Qatar"]},{label:"RON",value:"RON",type:"string",alternativeMatches:["RON","Romania"]},{label:"RUB",value:"RUB",type:"string",alternativeMatches:["RUB","Russian Federation"]},{label:"SHP",value:"SHP",type:"string",alternativeMatches:["Saint Helena"]},{label:"SAR",value:"SAR",type:"string",alternativeMatches:["SR","Saudi Arabia"]},{label:"RSD",value:"RSD",type:"string",alternativeMatches:["din.","Serbia"]},{label:"SCR",value:"SCR",type:"string",alternativeMatches:["Seychelles"]},{label:"SGD",value:"SGD",type:"string",alternativeMatches:["S$","Singapore"]},{label:"SBD",value:"SBD",type:"string",alternativeMatches:["Solomon Islands"]},{label:"SOS",value:"SOS",type:"string",alternativeMatches:["Ssh","Somalia"]},{label:"ZAR",value:"ZAR",type:"string",alternativeMatches:["R","South Africa"]},{label:"LKR",value:"LKR",type:"string",alternativeMatches:["SLRs","Sri Lanka"]},{label:"SEK",value:"SEK",type:"string",alternativeMatches:["Skr","Sweden"]},{label:"CHF",value:"CHF",type:"string",alternativeMatches:["CHF","Liechtenstein"]},{label:"SRD",value:"SRD",type:"string",alternativeMatches:["Suriname"]},{label:"SYP",value:"SYP",type:"string",alternativeMatches:["SY\xA3","Syria"]},{label:"TWD",value:"TWD",type:"string",alternativeMatches:["NT$"]},{label:"THB",value:"THB",type:"string",alternativeMatches:["\u0E3F","Thailand"]},{label:"TTD",value:"TTD",type:"string",alternativeMatches:["TT$","Trinidad and Tobago"]},{label:"TRY",value:"TRY",type:"string",alternativeMatches:["TL","Turkey"]},{label:"TVD",value:"TVD",type:"string",alternativeMatches:[]},{label:"UAH",value:"UAH",type:"string",alternativeMatches:["\u20B4","Ukraine"]},{label:"GBP",value:"GBP",type:"string",alternativeMatches:["\xA3","England"]},{label:"USD",value:"USD",type:"string",alternativeMatches:["$","USA"]},{label:"UYU",value:"UYU",type:"string",alternativeMatches:["$U","Uruguay"]},{label:"UZS",value:"UZS",type:"string",alternativeMatches:["UZS","Uzbekistan"]},{label:"VEF",value:"VEF",type:"string",alternativeMatches:["Bs.F.","Venezuela"]},{label:"VND",value:"VND",type:"string",alternativeMatches:["\u20AB","Vietnam"]},{label:"YER",value:"YER",type:"string",alternativeMatches:["YR","Yemen"]},{label:"ZWD",value:"ZWD",type:"string",alternativeMatches:["Zimbabwe"]},{label:"XOF",value:"XOF",type:"string",alternativeMatches:["CFA Franc","West Africa"]},{label:"BDT",value:"BDT",type:"string",alternativeMatches:["\u09F3","Bangladesh"]},{label:"UGX",value:"UGX",type:"string",alternativeMatches:["USh","Uganda"]},{label:"KES",value:"KES",type:"string",alternativeMatches:["KSh","Kenya"]},{label:"LSL",value:"LSL",type:"string",alternativeMatches:["Loti","Lesotho"]},{label:"MWK",value:"MWK",type:"string",alternativeMatches:["K","Malawi"]},{label:"TZS",value:"TZS",type:"string",alternativeMatches:["TSh","Tanzania"]},{label:"ETB",value:"ETB",type:"string",alternativeMatches:["Br","Ethiopia"]},{label:"VEB",value:"VEB",type:"string",alternativeMatches:["Bs","Venezuela"]},{label:"XAF",value:"XAF",type:"string",alternativeMatches:["CFA Franc","Central Africa"]}],P=[{value:"AF",label:"AF",type:"string",alternativeMatches:["Afghanistan"]},{value:"AX",label:"AX",type:"string",alternativeMatches:["\xC5land Islands"]},{value:"AL",label:"AL",type:"string",alternativeMatches:["Albania"]},{value:"DZ",label:"DZ",type:"string",alternativeMatches:["Algeria"]},{value:"AS",label:"AS",type:"string",alternativeMatches:["American Samoa"]},{value:"AD",label:"AD",type:"string",alternativeMatches:["Andorra"]},{value:"AO",label:"AO",type:"string",alternativeMatches:["Angola"]},{value:"AI",label:"AI",type:"string",alternativeMatches:["Anguilla"]},{value:"AQ",label:"AQ",type:"string",alternativeMatches:["Antarctica"]},{value:"AG",label:"AG",type:"string",alternativeMatches:["Antigua and Barbuda","Antigua","Barbuda"]},{value:"AR",label:"AR",type:"string",alternativeMatches:["Argentina"]},{value:"AM",label:"AM",type:"string",alternativeMatches:["Armenia"]},{value:"AW",label:"AW",type:"string",alternativeMatches:["Aruba"]},{value:"AU",label:"AU",type:"string",alternativeMatches:["Australia"]},{value:"AT",label:"AT",type:"string",alternativeMatches:["Austria"]},{value:"AZ",label:"AZ",type:"string",alternativeMatches:["Azerbaijan"]},{value:"BS",label:"BS",type:"string",alternativeMatches:["Bahamas"]},{value:"BH",label:"BH",type:"string",alternativeMatches:["Bahrain"]},{value:"BD",label:"BD",type:"string",alternativeMatches:["Bangladesh"]},{value:"BB",label:"BB",type:"string",alternativeMatches:["Barbados"]},{value:"BY",label:"BY",type:"string",alternativeMatches:["Belarus"]},{value:"BE",label:"BE",type:"string",alternativeMatches:["Belgium"]},{value:"BZ",label:"BZ",type:"string",alternativeMatches:["Belize"]},{value:"BJ",label:"BJ",type:"string",alternativeMatches:["Benin"]},{value:"BM",label:"BM",type:"string",alternativeMatches:["Bermuda"]},{value:"BT",label:"BT",type:"string",alternativeMatches:["Bhutan"]},{value:"BO",label:"BO",type:"string",alternativeMatches:["Bolivia (Plurinational State of)","Bolivia"]},{value:"BQ",label:"BQ",type:"string",alternativeMatches:["Bonaire, Sint Eustatius and Saba"]},{value:"BA",label:"BA",type:"string",alternativeMatches:["Bosnia and Herzegovina"]},{value:"BW",label:"BW",type:"string",alternativeMatches:["Botswana"]},{value:"BV",label:"BV",type:"string",alternativeMatches:["Bouvet Island"]},{value:"BR",label:"BR",type:"string",alternativeMatches:["Brazil"]},{value:"IO",label:"IO",type:"string",alternativeMatches:["British Indian Ocean Territory"]},{value:"BN",label:"BN",type:"string",alternativeMatches:["Brunei Darussalam"]},{value:"BG",label:"BG",type:"string",alternativeMatches:["Bulgaria"]},{value:"BF",label:"BF",type:"string",alternativeMatches:["Burkina Faso"]},{value:"BI",label:"BI",type:"string",alternativeMatches:["Burundi"]},{value:"KH",label:"KH",type:"string",alternativeMatches:["Cambodia"]},{value:"CM",label:"CM",type:"string",alternativeMatches:["Cameroon"]},{value:"CA",label:"CA",type:"string",alternativeMatches:["Canada"]},{value:"CV",label:"CV",type:"string",alternativeMatches:["Cape Verde"]},{value:"KY",label:"KY",type:"string",alternativeMatches:["Cayman Islands"]},{value:"CF",label:"CF",type:"string",alternativeMatches:["Central African Republic"]},{value:"TD",label:"TD",type:"string",alternativeMatches:["Chad"]},{value:"CL",label:"CL",type:"string",alternativeMatches:["Chile"]},{value:"CN",label:"CN",type:"string",alternativeMatches:["China"]},{value:"CX",label:"CX",type:"string",alternativeMatches:["Christmas Island"]},{value:"CC",label:"CC",type:"string",alternativeMatches:["Cocos (Keeling) Islands","Cocos Islands"]},{value:"CO",label:"CO",type:"string",alternativeMatches:["Colombia"]},{value:"KM",label:"KM",type:"string",alternativeMatches:["Comoros"]},{value:"CG",label:"CG",type:"string",alternativeMatches:["Congo"]},{value:"CD",label:"CD",type:"string",alternativeMatches:["Congo (the Democratic Republic of the)","Congo"]},{value:"CK",label:"CK",type:"string",alternativeMatches:["Cook Islands"]},{value:"CR",label:"CR",type:"string",alternativeMatches:["Costa Rica"]},{value:"CI",label:"CI",type:"string",alternativeMatches:["C\xF4te d'Ivoire","Cote d Ivoire"]},{value:"HR",label:"HR",type:"string",alternativeMatches:["Croatia"]},{value:"CU",label:"CU",type:"string",alternativeMatches:["Cuba"]},{value:"CW",label:"CW",type:"string",alternativeMatches:["Cura\xE7ao","Curacao"]},{value:"CY",label:"CY",type:"string",alternativeMatches:["Cyprus"]},{value:"CZ",label:"CZ",type:"string",alternativeMatches:["Czechia","Czech Republic"]},{value:"DK",label:"DK",type:"string",alternativeMatches:["Denmark"]},{value:"DJ",label:"DJ",type:"string",alternativeMatches:["Djibouti"]},{value:"DM",label:"DM",type:"string",alternativeMatches:["Dominica"]},{value:"DO",label:"DO",type:"string",alternativeMatches:["Dominican Republic"]},{value:"EC",label:"EC",type:"string",alternativeMatches:["Ecuador"]},{value:"EG",label:"EG",type:"string",alternativeMatches:["Egypt"]},{value:"SV",label:"SV",type:"string",alternativeMatches:["El Salvador"]},{value:"GQ",label:"GQ",type:"string",alternativeMatches:["Equatorial Guinea"]},{value:"ER",label:"ER",type:"string",alternativeMatches:["Eritrea"]},{value:"EE",label:"EE",type:"string",alternativeMatches:["Estonia"]},{value:"ET",label:"ET",type:"string",alternativeMatches:["Ethiopia"]},{value:"FK",label:"FK",type:"string",alternativeMatches:["Falkland Islands (Malvinas)"]},{value:"FO",label:"FO",type:"string",alternativeMatches:["Faroe Islands"]},{value:"FJ",label:"FJ",type:"string",alternativeMatches:["Fiji"]},{value:"FI",label:"FI",type:"string",alternativeMatches:["Finland"]},{value:"FR",label:"FR",type:"string",alternativeMatches:["France"]},{value:"GF",label:"GF",type:"string",alternativeMatches:["French Guiana"]},{value:"PF",label:"PF",type:"string",alternativeMatches:["French Polynesia"]},{value:"TF",label:"TF",type:"string",alternativeMatches:["French Southern Territories"]},{value:"GA",label:"GA",type:"string",alternativeMatches:["Gabon"]},{value:"GM",label:"GM",type:"string",alternativeMatches:["Gambia"]},{value:"GE",label:"GE",type:"string",alternativeMatches:["Georgia"]},{value:"DE",label:"DE",type:"string",alternativeMatches:["Germany"]},{value:"GH",label:"GH",type:"string",alternativeMatches:["Ghana"]},{value:"GI",label:"GI",type:"string",alternativeMatches:["Gibraltar"]},{value:"GR",label:"GR",type:"string",alternativeMatches:["Greece"]},{value:"GL",label:"GL",type:"string",alternativeMatches:["Greenland"]},{value:"GD",label:"GD",type:"string",alternativeMatches:["Grenada"]},{value:"GP",label:"GP",type:"string",alternativeMatches:["Guadeloupe"]},{value:"GU",label:"GU",type:"string",alternativeMatches:["Guam"]},{value:"GT",label:"GT",type:"string",alternativeMatches:["Guatemala"]},{value:"GG",label:"GG",type:"string",alternativeMatches:["Guernsey"]},{value:"GN",label:"GN",type:"string",alternativeMatches:["Guinea"]},{value:"GW",label:"GW",type:"string",alternativeMatches:["Guinea-Bissau"]},{value:"GY",label:"GY",type:"string",alternativeMatches:["Guyana"]},{value:"HT",label:"HT",type:"string",alternativeMatches:["Haiti"]},{value:"HM",label:"HM",type:"string",alternativeMatches:["Heard Island and McDonald Islands","Heard Island","McDonald Islands"]},{value:"VA",label:"VA",type:"string",alternativeMatches:["Holy See (Vatican City State)"]},{value:"HN",label:"HN",type:"string",alternativeMatches:["Honduras"]},{value:"HK",label:"HK",type:"string",alternativeMatches:["Hong Kong"]},{value:"HU",label:"HU",type:"string",alternativeMatches:["Hungary"]},{value:"IS",label:"IS",type:"string",alternativeMatches:["Iceland"]},{value:"IN",label:"IN",type:"string",alternativeMatches:["India"]},{value:"ID",label:"ID",type:"string",alternativeMatches:["Indonesia"]},{value:"IR",label:"IR",type:"string",alternativeMatches:["Iran (Islamic Republic of) ","Iran"]},{value:"IQ",label:"IQ",type:"string",alternativeMatches:["Iraq"]},{value:"IE",label:"IE",type:"string",alternativeMatches:["Ireland"]},{value:"IM",label:"IM",type:"string",alternativeMatches:["Isle of Man"]},{value:"IL",label:"IL",type:"string",alternativeMatches:["Israel"]},{value:"IT",label:"IT",type:"string",alternativeMatches:["Italy"]},{value:"JM",label:"JM",type:"string",alternativeMatches:["Jamaica"]},{value:"JP",label:"JP",type:"string",alternativeMatches:["Japan"]},{value:"JE",label:"JE",type:"string",alternativeMatches:["Jersey"]},{value:"JO",label:"JO",type:"string",alternativeMatches:["Jordan"]},{value:"KZ",label:"KZ",type:"string",alternativeMatches:["Kazakhstan"]},{value:"KE",label:"KE",type:"string",alternativeMatches:["Kenya"]},{value:"KI",label:"KI",type:"string",alternativeMatches:["Kiribati"]},{value:"KP",label:"KP",type:"string",alternativeMatches:["Democratic People's Republic of Korea","North Korea"]},{value:"KR",label:"KR",type:"string",alternativeMatches:["Korea, Republic of Korea","South Korea"]},{value:"KW",label:"KW",type:"string",alternativeMatches:["Kuwait"]},{value:"KG",label:"KG",type:"string",alternativeMatches:["Kyrgyzstan"]},{value:"LA",label:"LA",type:"string",alternativeMatches:["Lao People's Democratic Republic"]},{value:"LV",label:"LV",type:"string",alternativeMatches:["Latvia"]},{value:"LB",label:"LB",type:"string",alternativeMatches:["Lebanon"]},{value:"LS",label:"LS",type:"string",alternativeMatches:["Lesotho"]},{value:"LR",label:"LR",type:"string",alternativeMatches:["Liberia"]},{value:"LY",label:"LY",type:"string",alternativeMatches:["Libya"]},{value:"LI",label:"LI",type:"string",alternativeMatches:["Liechtenstein"]},{value:"LT",label:"LT",type:"string",alternativeMatches:["Lithuania"]},{value:"LU",label:"LU",type:"string",alternativeMatches:["Luxembourg"]},{value:"MO",label:"MO",type:"string",alternativeMatches:["Macao"]},{value:"MK",label:"MK",type:"string",alternativeMatches:["Republic of North Macedonia","North Macedonia"]},{value:"MG",label:"MG",type:"string",alternativeMatches:["Madagascar"]},{value:"MW",label:"MW",type:"string",alternativeMatches:["Malawi"]},{value:"MY",label:"MY",type:"string",alternativeMatches:["Malaysia"]},{value:"MV",label:"MV",type:"string",alternativeMatches:["Maldives"]},{value:"ML",label:"ML",type:"string",alternativeMatches:["Mali"]},{value:"MT",label:"MT",type:"string",alternativeMatches:["Malta"]},{value:"MH",label:"MH",type:"string",alternativeMatches:["Marshall Islands"]},{value:"MQ",label:"MQ",type:"string",alternativeMatches:["Martinique"]},{value:"MR",label:"MR",type:"string",alternativeMatches:["Mauritania"]},{value:"MU",label:"MU",type:"string",alternativeMatches:["Mauritius"]},{value:"YT",label:"YT",type:"string",alternativeMatches:["Mayotte"]},{value:"MX",label:"MX",type:"string",alternativeMatches:["Mexico"]},{value:"FM",label:"FM",type:"string",alternativeMatches:["Micronesia (Federated States of)"]},{value:"MD",label:"MD",type:"string",alternativeMatches:["Moldova (the Republic of)"]},{value:"MC",label:"MC",type:"string",alternativeMatches:["Monaco"]},{value:"MN",label:"MN",type:"string",alternativeMatches:["Mongolia"]},{value:"ME",label:"ME",type:"string",alternativeMatches:["Montenegro"]},{value:"MS",label:"MS",type:"string",alternativeMatches:["Montserrat"]},{value:"MA",label:"MA",type:"string",alternativeMatches:["Morocco"]},{value:"MZ",label:"MZ",type:"string",alternativeMatches:["Mozambique"]},{value:"MM",label:"MM",type:"string",alternativeMatches:["Myanmar"]},{value:"NA",label:"NA",type:"string",alternativeMatches:["Namibia"]},{value:"NR",label:"NR",type:"string",alternativeMatches:["Nauru"]},{value:"NP",label:"NP",type:"string",alternativeMatches:["Nepal"]},{value:"NL",label:"NL",type:"string",alternativeMatches:["Netherlands"]},{value:"NC",label:"NC",type:"string",alternativeMatches:["New Caledonia"]},{value:"NZ",label:"NZ",type:"string",alternativeMatches:["New Zealand"]},{value:"NI",label:"NI",type:"string",alternativeMatches:["Nicaragua"]},{value:"NE",label:"NE",type:"string",alternativeMatches:["Niger"]},{value:"NG",label:"NG",type:"string",alternativeMatches:["Nigeria"]},{value:"NU",label:"NU",type:"string",alternativeMatches:["Niue"]},{value:"NF",label:"NF",type:"string",alternativeMatches:["Norfolk Island"]},{value:"MP",label:"MP",type:"string",alternativeMatches:["Northern Mariana Islands"]},{value:"NO",label:"NO",type:"string",alternativeMatches:["Norway"]},{value:"OM",label:"OM",type:"string",alternativeMatches:["Oman"]},{value:"PK",label:"PK",type:"string",alternativeMatches:["Pakistan"]},{value:"PW",label:"PW",type:"string",alternativeMatches:["Palau"]},{value:"PS",label:"PS",type:"string",alternativeMatches:["Palestinian Territory, Occupied"]},{value:"PA",label:"PA",type:"string",alternativeMatches:["Panama"]},{value:"PG",label:"PG",type:"string",alternativeMatches:["Papua New Guinea"]},{value:"PY",label:"PY",type:"string",alternativeMatches:["Paraguay"]},{value:"PE",label:"PE",type:"string",alternativeMatches:["Peru"]},{value:"PH",label:"PH",type:"string",alternativeMatches:["Philippines"]},{value:"PN",label:"PN",type:"string",alternativeMatches:["Pitcairn"]},{value:"PL",label:"PL",type:"string",alternativeMatches:["Poland"]},{value:"PT",label:"PT",type:"string",alternativeMatches:["Portugal"]},{value:"PR",label:"PR",type:"string",alternativeMatches:["Puerto Rico"]},{value:"QA",label:"QA",type:"string",alternativeMatches:["Qatar"]},{value:"RE",label:"RE",type:"string",alternativeMatches:["R\xE9union"]},{value:"RO",label:"RO",type:"string",alternativeMatches:["Romania"]},{value:"RU",label:"RU",type:"string",alternativeMatches:["Russian Federation"]},{value:"RW",label:"RW",type:"string",alternativeMatches:["Rwanda"]},{value:"BL",label:"BL",type:"string",alternativeMatches:["Saint Barth\xE9lemy"]},{value:"SH",label:"SH",type:"string",alternativeMatches:["Saint Helena, Ascension and Tristan da Cunha"]},{value:"KN",label:"KN",type:"string",alternativeMatches:["Saint Kitts and Nevis","Saint Kitts","Nevis"]},{value:"LC",label:"LC",type:"string",alternativeMatches:["Saint Lucia"]},{value:"MF",label:"MF",type:"string",alternativeMatches:["Saint Martin (French part)"]},{value:"PM",label:"PM",type:"string",alternativeMatches:["Saint Pierre and Miquelon","Saint Pierre","Miquelon"]},{value:"VC",label:"VC",type:"string",alternativeMatches:["Saint Vincent and the Grenadines","Saint Vincent","Grenadines"]},{value:"WS",label:"WS",type:"string",alternativeMatches:["Samoa"]},{value:"SM",label:"SM",type:"string",alternativeMatches:["San Marino"]},{value:"ST",label:"ST",type:"string",alternativeMatches:["Sao Tome and Principe","Sao Tome","Principe"]},{value:"SA",label:"SA",type:"string",alternativeMatches:["Saudi Arabia"]},{value:"SN",label:"SN",type:"string",alternativeMatches:["Senegal"]},{value:"RS",label:"RS",type:"string",alternativeMatches:["Serbia"]},{value:"SC",label:"SC",type:"string",alternativeMatches:["Seychelles"]},{value:"SL",label:"SL",type:"string",alternativeMatches:["Sierra Leone"]},{value:"SG",label:"SG",type:"string",alternativeMatches:["Singapore"]},{value:"SX",label:"SX",type:"string",alternativeMatches:["Sint Maarten"]},{value:"SK",label:"SK",type:"string",alternativeMatches:["Slovakia"]},{value:"SI",label:"SI",type:"string",alternativeMatches:["Slovenia"]},{value:"SB",label:"SB",type:"string",alternativeMatches:["Solomon Islands"]},{value:"SO",label:"SO",type:"string",alternativeMatches:["Somalia"]},{value:"ZA",label:"ZA",type:"string",alternativeMatches:["South Africa"]},{value:"GS",label:"GS",type:"string",alternativeMatches:["South Georgia and the South Sandwich Islands","South Georgia","South Sandwich Islands"]},{value:"SS",label:"SS",type:"string",alternativeMatches:["South Sudan"]},{value:"ES",label:"ES",type:"string",alternativeMatches:["Spain"]},{value:"LK",label:"LK",type:"string",alternativeMatches:["Sri Lanka"]},{value:"SD",label:"SD",type:"string",alternativeMatches:["Sudan"]},{value:"SR",label:"SR",type:"string",alternativeMatches:["Suriname"]},{value:"SJ",label:"SJ",type:"string",alternativeMatches:["Svalbard and Jan Mayen","Svalbard","Jan Mayen"]},{value:"SZ",label:"SZ",type:"string",alternativeMatches:["Swaziland","Eswatini"]},{value:"SE",label:"SE",type:"string",alternativeMatches:["Sweden"]},{value:"CH",label:"CH",type:"string",alternativeMatches:["Switzerland"]},{value:"SY",label:"SY",type:"string",alternativeMatches:["Syrian Arab Republic"]},{value:"TW",label:"TW",type:"string",alternativeMatches:["Taiwan, Province of China"]},{value:"TJ",label:"TJ",type:"string",alternativeMatches:["Tajikistan"]},{value:"TZ",label:"TZ",type:"string",alternativeMatches:["Tanzania, United Republic of","Tanzania"]},{value:"TH",label:"TH",type:"string",alternativeMatches:["Thailand"]},{value:"TL",label:"TL",type:"string",alternativeMatches:["Timor-Leste"]},{value:"TG",label:"TG",type:"string",alternativeMatches:["Togo"]},{value:"TK",label:"TK",type:"string",alternativeMatches:["Tokelau"]},{value:"TO",label:"TO",type:"string",alternativeMatches:["Tonga"]},{value:"TT",label:"TT",type:"string",alternativeMatches:["Trinidad and Tobago","Trinidad","Tobago"]},{value:"TN",label:"TN",type:"string",alternativeMatches:["Tunisia"]},{value:"TR",label:"TR",type:"string",alternativeMatches:["Turkey"]},{value:"TM",label:"TM",type:"string",alternativeMatches:["Turkmenistan"]},{value:"TC",label:"TC",type:"string",alternativeMatches:["Turks and Caicos Islands"]},{value:"TV",label:"TV",type:"string",alternativeMatches:["Tuvalu"]},{value:"UG",label:"UG",type:"string",alternativeMatches:["Uganda"]},{value:"UA",label:"UA",type:"string",alternativeMatches:["Ukraine"]},{value:"AE",label:"AE",type:"string",alternativeMatches:["United Arab Emirates","UAE"]},{value:"GB",label:"GB",type:"string",alternativeMatches:["United Kingdom"]},{value:"US",label:"US",type:"string",alternativeMatches:["United States"]},{value:"UM",label:"UM",type:"string",alternativeMatches:["United States Minor Outlying Islands"]},{value:"UY",label:"UY",type:"string",alternativeMatches:["Uruguay"]},{value:"UZ",label:"UZ",type:"string",alternativeMatches:["Uzbekistan"]},{value:"VU",label:"VU",type:"string",alternativeMatches:["Vanuatu"]},{value:"VE",label:"VE",type:"string",alternativeMatches:["Venezuela (Bolivarian Republic of)","Venezuela","Bolivarian"]},{value:"VN",label:"VN",type:"string",alternativeMatches:["Viet Nam"]},{value:"VG",label:"VG",type:"string",alternativeMatches:["Virgin Islands (British)","British"]},{value:"VI",label:"VI",type:"string",alternativeMatches:["Virgin Islands (U.S.)"]},{value:"WF",label:"WF",type:"string",alternativeMatches:["Wallis and Futuna"]},{value:"EH",label:"EH",type:"string",alternativeMatches:["Western Sahara"]},{value:"YE",label:"YE",type:"string",alternativeMatches:["Yemen"]},{value:"ZM",label:"ZM",type:"string",alternativeMatches:["Zambia"]},{value:"ZW",label:"ZW",type:"string",alternativeMatches:["Zimbabwe"]}],m=[{value:"AFG",label:"AFG",type:"string",alternativeMatches:["Afghanistan"]},{value:"ALA",label:"ALA",type:"string",alternativeMatches:["\xC5land Islands"]},{value:"ALB",label:"ALB",type:"string",alternativeMatches:["Albania"]},{value:"DZA",label:"DZA",type:"string",alternativeMatches:["Algeria"]},{value:"ASM",label:"ASM",type:"string",alternativeMatches:["American Samoa"]},{value:"AND",label:"AND",type:"string",alternativeMatches:["Andorra"]},{value:"AGO",label:"AGO",type:"string",alternativeMatches:["Angola"]},{value:"AIA",label:"AIA",type:"string",alternativeMatches:["Anguilla"]},{value:"ATA",label:"ATA",type:"string",alternativeMatches:["Antarctica"]},{value:"ATG",label:"ATG",type:"string",alternativeMatches:["Antigua and Barbuda","Antigua","Barbuda"]},{value:"ARG",label:"ARG",type:"string",alternativeMatches:["Argentina"]},{value:"ARM",label:"ARM",type:"string",alternativeMatches:["Armenia"]},{value:"ABW",label:"ABW",type:"string",alternativeMatches:["Aruba"]},{value:"AUS",label:"AUS",type:"string",alternativeMatches:["Australia"]},{value:"AUT",label:"AUT",type:"string",alternativeMatches:["Austria"]},{value:"AZE",label:"AZE",type:"string",alternativeMatches:["Azerbaijan"]},{value:"BHS",label:"BHS",type:"string",alternativeMatches:["Bahamas"]},{value:"BHR",label:"BHR",type:"string",alternativeMatches:["Bahrain"]},{value:"BGD",label:"BGD",type:"string",alternativeMatches:["Bangladesh"]},{value:"BRB",label:"BRB",type:"string",alternativeMatches:["Barbados"]},{value:"BLR",label:"BLR",type:"string",alternativeMatches:["Belarus"]},{value:"BEL",label:"BEL",type:"string",alternativeMatches:["Belgium"]},{value:"BLZ",label:"BLZ",type:"string",alternativeMatches:["Belize"]},{value:"BEN",label:"BEN",type:"string",alternativeMatches:["Benin"]},{value:"BMU",label:"BMU",type:"string",alternativeMatches:["Bermuda"]},{value:"BTN",label:"BTN",type:"string",alternativeMatches:["Bhutan"]},{value:"BOL",label:"BOL",type:"string",alternativeMatches:["Bolivia (Plurinational State of)","Bolivia"]},{value:"BES",label:"BES",type:"string",alternativeMatches:["Bonaire, Sint Eustatius and Saba"]},{value:"BIH",label:"BIH",type:"string",alternativeMatches:["Bosnia and Herzegovina"]},{value:"BWA",label:"BWA",type:"string",alternativeMatches:["Botswana"]},{value:"BVT",label:"BVT",type:"string",alternativeMatches:["Bouvet Island"]},{value:"BRA",label:"BRA",type:"string",alternativeMatches:["Brazil"]},{value:"IOT",label:"IOT",type:"string",alternativeMatches:["British Indian Ocean Territory"]},{value:"BRN",label:"BRN",type:"string",alternativeMatches:["Brunei Darussalam"]},{value:"BGR",label:"BGR",type:"string",alternativeMatches:["Bulgaria"]},{value:"BFA",label:"BFA",type:"string",alternativeMatches:["Burkina Faso"]},{value:"BDI",label:"BDI",type:"string",alternativeMatches:["Burundi"]},{value:"KHM",label:"KHM",type:"string",alternativeMatches:["Cambodia"]},{value:"CMR",label:"CMR",type:"string",alternativeMatches:["Cameroon"]},{value:"CAN",label:"CAN",type:"string",alternativeMatches:["Canada"]},{value:"CPV",label:"CPV",type:"string",alternativeMatches:["Cape Verde"]},{value:"CYM",label:"CYM",type:"string",alternativeMatches:["Cayman Islands"]},{value:"CAF",label:"CAF",type:"string",alternativeMatches:["Central African Republic"]},{value:"TCD",label:"TCD",type:"string",alternativeMatches:["Chad"]},{value:"CHL",label:"CHL",type:"string",alternativeMatches:["Chile"]},{value:"CHN",label:"CHN",type:"string",alternativeMatches:["China"]},{value:"CXR",label:"CXR",type:"string",alternativeMatches:["Christmas Island"]},{value:"CCK",label:"CCK",type:"string",alternativeMatches:["Cocos (Keeling) Islands"]},{value:"COL",label:"COL",type:"string",alternativeMatches:["Colombia"]},{value:"COM",label:"COM",type:"string",alternativeMatches:["Comoros"]},{value:"COG",label:"COG",type:"string",alternativeMatches:["Congo"]},{value:"COD",label:"COD",type:"string",alternativeMatches:["Congo (the Democratic Republic of the)"]},{value:"COK",label:"COK",type:"string",alternativeMatches:["Cook Islands"]},{value:"CRI",label:"CRI",type:"string",alternativeMatches:["Costa Rica"]},{value:"CIV",label:"CIV",type:"string",alternativeMatches:["C\xF4te d'Ivoire"]},{value:"HRV",label:"HRV",type:"string",alternativeMatches:["Croatia"]},{value:"CUB",label:"CUB",type:"string",alternativeMatches:["Cuba"]},{value:"CUW",label:"CUW",type:"string",alternativeMatches:["Cura\xE7ao"]},{value:"CYP",label:"CYP",type:"string",alternativeMatches:["Cyprus"]},{value:"CZE",label:"CZE",type:"string",alternativeMatches:["Czechia","Czech Republic"]},{value:"DNK",label:"DNK",type:"string",alternativeMatches:["Denmark"]},{value:"DJI",label:"DJI",type:"string",alternativeMatches:["Djibouti"]},{value:"DMA",label:"DMA",type:"string",alternativeMatches:["Dominica"]},{value:"DOM",label:"DOM",type:"string",alternativeMatches:["Dominican Republic"]},{value:"ECU",label:"ECU",type:"string",alternativeMatches:["Ecuador"]},{value:"EGY",label:"EGY",type:"string",alternativeMatches:["Egypt"]},{value:"SLV",label:"SLV",type:"string",alternativeMatches:["El Salvador"]},{value:"GNQ",label:"GNQ",type:"string",alternativeMatches:["Equatorial Guinea"]},{value:"ERI",label:"ERI",type:"string",alternativeMatches:["Eritrea"]},{value:"EST",label:"EST",type:"string",alternativeMatches:["Estonia"]},{value:"ETH",label:"ETH",type:"string",alternativeMatches:["Ethiopia"]},{value:"FLK",label:"FLK",type:"string",alternativeMatches:["Falkland Islands (Malvinas)"]},{value:"FRO",label:"FRO",type:"string",alternativeMatches:["Faroe Islands"]},{value:"FJI",label:"FJI",type:"string",alternativeMatches:["Fiji"]},{value:"FIN",label:"FIN",type:"string",alternativeMatches:["Finland"]},{value:"FRA",label:"FRA",type:"string",alternativeMatches:["France"]},{value:"GUF",label:"GUF",type:"string",alternativeMatches:["French Guiana"]},{value:"PYF",label:"PYF",type:"string",alternativeMatches:["French Polynesia"]},{value:"ATF",label:"ATF",type:"string",alternativeMatches:["French Southern Territories"]},{value:"GAB",label:"GAB",type:"string",alternativeMatches:["Gabon"]},{value:"GMB",label:"GMB",type:"string",alternativeMatches:["Gambia"]},{value:"GEO",label:"GEO",type:"string",alternativeMatches:["Georgia"]},{value:"DEU",label:"DEU",type:"string",alternativeMatches:["Germany"]},{value:"GHA",label:"GHA",type:"string",alternativeMatches:["Ghana"]},{value:"GIB",label:"GIB",type:"string",alternativeMatches:["Gibraltar"]},{value:"GRC",label:"GRC",type:"string",alternativeMatches:["Greece"]},{value:"GRL",label:"GRL",type:"string",alternativeMatches:["Greenland"]},{value:"GRD",label:"GRD",type:"string",alternativeMatches:["Grenada"]},{value:"GLP",label:"GLP",type:"string",alternativeMatches:["Guadeloupe"]},{value:"GUM",label:"GUM",type:"string",alternativeMatches:["Guam"]},{value:"GTM",label:"GTM",type:"string",alternativeMatches:["Guatemala"]},{value:"GGY",label:"GGY",type:"string",alternativeMatches:["Guernsey"]},{value:"GIN",label:"GIN",type:"string",alternativeMatches:["Guinea"]},{value:"GNB",label:"GNB",type:"string",alternativeMatches:["Guinea-Bissau"]},{value:"GUY",label:"GUY",type:"string",alternativeMatches:["Guyana"]},{value:"HTI",label:"HTI",type:"string",alternativeMatches:["Haiti"]},{value:"HMD",label:"HMD",type:"string",alternativeMatches:["Heard Island and McDonald Islands","Heard Island","McDonald Islands"]},{value:"VAT",label:"VAT",type:"string",alternativeMatches:["Holy See (Vatican City State)"]},{value:"HND",label:"HND",type:"string",alternativeMatches:["Honduras"]},{value:"HKG",label:"HKG",type:"string",alternativeMatches:["Hong Kong"]},{value:"HUN",label:"HUN",type:"string",alternativeMatches:["Hungary"]},{value:"ISL",label:"ISL",type:"string",alternativeMatches:["Iceland"]},{value:"IND",label:"IND",type:"string",alternativeMatches:["India"]},{value:"IDN",label:"IDN",type:"string",alternativeMatches:["Indonesia"]},{value:"IRN",label:"IRN",type:"string",alternativeMatches:["Iran (Islamic Republic of) ","Iran"]},{value:"IRQ",label:"IRQ",type:"string",alternativeMatches:["Iraq"]},{value:"IRL",label:"IRL",type:"string",alternativeMatches:["Ireland"]},{value:"IMN",label:"IMN",type:"string",alternativeMatches:["Isle of Man"]},{value:"ISR",label:"ISR",type:"string",alternativeMatches:["Israel"]},{value:"ITA",label:"ITA",type:"string",alternativeMatches:["Italy"]},{value:"JAM",label:"JAM",type:"string",alternativeMatches:["Jamaica"]},{value:"JPN",label:"JPN",type:"string",alternativeMatches:["Japan"]},{value:"JEY",label:"JEY",type:"string",alternativeMatches:["Jersey"]},{value:"JOR",label:"JOR",type:"string",alternativeMatches:["Jordan"]},{value:"KAZ",label:"KAZ",type:"string",alternativeMatches:["Kazakhstan"]},{value:"KEN",label:"KEN",type:"string",alternativeMatches:["Kenya"]},{value:"KIR",label:"KIR",type:"string",alternativeMatches:["Kiribati"]},{value:"PRK",label:"PRK",type:"string",alternativeMatches:["Democratic People's Republic of Korea","North Korea"]},{value:"KOR",label:"KOR",type:"string",alternativeMatches:["Korea, Republic of Korea","South Korea"]},{value:"KWT",label:"KWT",type:"string",alternativeMatches:["Kuwait"]},{value:"KGZ",label:"KGZ",type:"string",alternativeMatches:["Kyrgyzstan"]},{value:"LAO",label:"LAO",type:"string",alternativeMatches:["Lao People's Democratic Republic"]},{value:"LVA",label:"LVA",type:"string",alternativeMatches:["Latvia"]},{value:"LBN",label:"LBN",type:"string",alternativeMatches:["Lebanon"]},{value:"LSO",label:"LSO",type:"string",alternativeMatches:["Lesotho"]},{value:"LBR",label:"LBR",type:"string",alternativeMatches:["Liberia"]},{value:"LBY",label:"LBY",type:"string",alternativeMatches:["Libya"]},{value:"LIE",label:"LIE",type:"string",alternativeMatches:["Liechtenstein"]},{value:"LTU",label:"LTU",type:"string",alternativeMatches:["Lithuania"]},{value:"LUX",label:"LUX",type:"string",alternativeMatches:["Luxembourg"]},{value:"MAC",label:"MAC",type:"string",alternativeMatches:["Macao"]},{value:"MKD",label:"MKD",type:"string",alternativeMatches:["Republic of North Macedonia","North Macedonia"]},{value:"MDG",label:"MDG",type:"string",alternativeMatches:["Madagascar"]},{value:"MWI",label:"MWI",type:"string",alternativeMatches:["Malawi"]},{value:"MYS",label:"MYS",type:"string",alternativeMatches:["Malaysia"]},{value:"MDV",label:"MDV",type:"string",alternativeMatches:["Maldives"]},{value:"MLI",label:"MLI",type:"string",alternativeMatches:["Mali"]},{value:"MLT",label:"MLT",type:"string",alternativeMatches:["Malta"]},{value:"MHL",label:"MHL",type:"string",alternativeMatches:["Marshall Islands"]},{value:"MTQ",label:"MTQ",type:"string",alternativeMatches:["Martinique"]},{value:"MRT",label:"MRT",type:"string",alternativeMatches:["Mauritania"]},{value:"MUS",label:"MUS",type:"string",alternativeMatches:["Mauritius"]},{value:"MYT",label:"MYT",type:"string",alternativeMatches:["Mayotte"]},{value:"MEX",label:"MEX",type:"string",alternativeMatches:["Mexico"]},{value:"FSM",label:"FSM",type:"string",alternativeMatches:["Micronesia (Federated States of)"]},{value:"MDA",label:"MDA",type:"string",alternativeMatches:["Moldova (the Republic of)"]},{value:"MCO",label:"MCO",type:"string",alternativeMatches:["Monaco"]},{value:"MNG",label:"MNG",type:"string",alternativeMatches:["Mongolia"]},{value:"MNE",label:"MNE",type:"string",alternativeMatches:["Montenegro"]},{value:"MSR",label:"MSR",type:"string",alternativeMatches:["Montserrat"]},{value:"MAR",label:"MAR",type:"string",alternativeMatches:["Morocco"]},{value:"MOZ",label:"MOZ",type:"string",alternativeMatches:["Mozambique"]},{value:"MMR",label:"MMR",type:"string",alternativeMatches:["Myanmar"]},{value:"NAM",label:"NAM",type:"string",alternativeMatches:["Namibia"]},{value:"NRU",label:"NRU",type:"string",alternativeMatches:["Nauru"]},{value:"NPL",label:"NPL",type:"string",alternativeMatches:["Nepal"]},{value:"NLD",label:"NLD",type:"string",alternativeMatches:["Netherlands"]},{value:"NCL",label:"NCL",type:"string",alternativeMatches:["New Caledonia"]},{value:"NZL",label:"NZL",type:"string",alternativeMatches:["New Zealand"]},{value:"NIC",label:"NIC",type:"string",alternativeMatches:["Nicaragua"]},{value:"NER",label:"NER",type:"string",alternativeMatches:["Niger"]},{value:"NGA",label:"NGA",type:"string",alternativeMatches:["Nigeria"]},{value:"NIU",label:"NIU",type:"string",alternativeMatches:["Niue"]},{value:"NFK",label:"NFK",type:"string",alternativeMatches:["Norfolk Island"]},{value:"MNP",label:"MNP",type:"string",alternativeMatches:["Northern Mariana Islands"]},{value:"NOR",label:"NOR",type:"string",alternativeMatches:["Norway"]},{value:"OMN",label:"OMN",type:"string",alternativeMatches:["Oman"]},{value:"PAK",label:"PAK",type:"string",alternativeMatches:["Pakistan"]},{value:"PLW",label:"PLW",type:"string",alternativeMatches:["Palau"]},{value:"PSE",label:"PSE",type:"string",alternativeMatches:["Palestinian Territory, Occupied"]},{value:"PAN",label:"PAN",type:"string",alternativeMatches:["Panama"]},{value:"PNG",label:"PNG",type:"string",alternativeMatches:["Papua New Guinea"]},{value:"PRY",label:"PRY",type:"string",alternativeMatches:["Paraguay"]},{value:"PER",label:"PER",type:"string",alternativeMatches:["Peru"]},{value:"PHL",label:"PHL",type:"string",alternativeMatches:["Philippines"]},{value:"PCN",label:"PCN",type:"string",alternativeMatches:["Pitcairn"]},{value:"POL",label:"POL",type:"string",alternativeMatches:["Poland"]},{value:"PRT",label:"PRT",type:"string",alternativeMatches:["Portugal"]},{value:"PRI",label:"PRI",type:"string",alternativeMatches:["Puerto Rico"]},{value:"QAT",label:"QAT",type:"string",alternativeMatches:["Qatar"]},{value:"REU",label:"REU",type:"string",alternativeMatches:["R\xE9union"]},{value:"ROU",label:"ROU",type:"string",alternativeMatches:["Romania"]},{value:"RUS",label:"RUS",type:"string",alternativeMatches:["Russian Federation"]},{value:"RWA",label:"RWA",type:"string",alternativeMatches:["Rwanda"]},{value:"BLM",label:"BLM",type:"string",alternativeMatches:["Saint Barth\xE9lemy"]},{value:"SHN",label:"SHN",type:"string",alternativeMatches:["Saint Helena, Ascension and Tristan da Cunha"]},{value:"KNA",label:"KNA",type:"string",alternativeMatches:["Saint Kitts and Nevis","Saint Kitts","Nevis"]},{value:"LCA",label:"LCA",type:"string",alternativeMatches:["Saint Lucia"]},{value:"MAF",label:"MAF",type:"string",alternativeMatches:["Saint Martin (French part)"]},{value:"SPM",label:"SPM",type:"string",alternativeMatches:["Saint Pierre and Miquelon","Saint Pierre","Miquelon"]},{value:"VCT",label:"VCT",type:"string",alternativeMatches:["Saint Vincent and the Grenadines","Saint Vincent","Grenadines"]},{value:"WSM",label:"WSM",type:"string",alternativeMatches:["Samoa"]},{value:"SMR",label:"SMR",type:"string",alternativeMatches:["San Marino"]},{value:"STP",label:"STP",type:"string",alternativeMatches:["Sao Tome and Principe","Sao Tome","Principe"]},{value:"SAU",label:"SAU",type:"string",alternativeMatches:["Saudi Arabia"]},{value:"SEN",label:"SEN",type:"string",alternativeMatches:["Senegal"]},{value:"SRB",label:"SRB",type:"string",alternativeMatches:["Serbia"]},{value:"SYC",label:"SYC",type:"string",alternativeMatches:["Seychelles"]},{value:"SLE",label:"SLE",type:"string",alternativeMatches:["Sierra Leone"]},{value:"SGP",label:"SGP",type:"string",alternativeMatches:["Singapore"]},{value:"SXM",label:"SXM",type:"string",alternativeMatches:["Sint Maarten (Dutch part)"]},{value:"SVK",label:"SVK",type:"string",alternativeMatches:["Slovakia"]},{value:"SVN",label:"SVN",type:"string",alternativeMatches:["Slovenia"]},{value:"SLB",label:"SLB",type:"string",alternativeMatches:["Solomon Islands"]},{value:"SOM",label:"SOM",type:"string",alternativeMatches:["Somalia"]},{value:"ZAF",label:"ZAF",type:"string",alternativeMatches:["South Africa"]},{value:"SGS",label:"SGS",type:"string",alternativeMatches:["South Georgia and the South Sandwich Islands","South Georgia","South Sandwich Islands"]},{value:"SSD",label:"SSD",type:"string",alternativeMatches:["South Sudan"]},{value:"ESP",label:"ESP",type:"string",alternativeMatches:["Spain"]},{value:"LKA",label:"LKA",type:"string",alternativeMatches:["Sri Lanka"]},{value:"SDN",label:"SDN",type:"string",alternativeMatches:["Sudan"]},{value:"SUR",label:"SUR",type:"string",alternativeMatches:["Suriname"]},{value:"SJM",label:"SJM",type:"string",alternativeMatches:["Svalbard and Jan Mayen","Svalbard","Jan Mayen"]},{value:"SWZ",label:"SWZ",type:"string",alternativeMatches:["Swaziland","Eswatini"]},{value:"SWE",label:"SWE",type:"string",alternativeMatches:["Sweden"]},{value:"CHE",label:"CHE",type:"string",alternativeMatches:["Switzerland"]},{value:"SYR",label:"SYR",type:"string",alternativeMatches:["Syrian Arab Republic"]},{value:"TWN",label:"TWN",type:"string",alternativeMatches:["Taiwan, Province of China"]},{value:"TJK",label:"TJK",type:"string",alternativeMatches:["Tajikistan"]},{value:"TZA",label:"TZA",type:"string",alternativeMatches:["Tanzania, United Republic of"]},{value:"THA",label:"THA",type:"string",alternativeMatches:["Thailand"]},{value:"TLS",label:"TLS",type:"string",alternativeMatches:["Timor-Leste"]},{value:"TGO",label:"TGO",type:"string",alternativeMatches:["Togo"]},{value:"TKL",label:"TKL",type:"string",alternativeMatches:["Tokelau"]},{value:"TON",label:"TON",type:"string",alternativeMatches:["Tonga"]},{value:"TTO",label:"TTO",type:"string",alternativeMatches:["Trinidad and Tobago","Trinidad","Tobago"]},{value:"TUN",label:"TUN",type:"string",alternativeMatches:["Tunisia"]},{value:"TUR",label:"TUR",type:"string",alternativeMatches:["Turkey"]},{value:"TKM",label:"TKM",type:"string",alternativeMatches:["Turkmenistan"]},{value:"TCA",label:"TCA",type:"string",alternativeMatches:["Turks and Caicos Islands"]},{value:"TUV",label:"TUV",type:"string",alternativeMatches:["Tuvalu"]},{value:"UGA",label:"UGA",type:"string",alternativeMatches:["Uganda"]},{value:"UKR",label:"UKR",type:"string",alternativeMatches:["Ukraine"]},{value:"ARE",label:"ARE",type:"string",alternativeMatches:["United Arab Emirates"]},{value:"GBR",label:"GBR",type:"string",alternativeMatches:["United Kingdom"]},{value:"USA",label:"USA",type:"string",alternativeMatches:["United States"]},{value:"UMI",label:"UMI",type:"string",alternativeMatches:["United States Minor Outlying Islands"]},{value:"URY",label:"URY",type:"string",alternativeMatches:["Uruguay"]},{value:"UZB",label:"UZB",type:"string",alternativeMatches:["Uzbekistan"]},{value:"VUT",label:"VUT",type:"string",alternativeMatches:["Vanuatu"]},{value:"VEN",label:"VEN",type:"string",alternativeMatches:["Venezuela (Bolivarian Republic of)","Venezuela","Bolivarian"]},{value:"VNM",label:"VNM",type:"string",alternativeMatches:["Viet Nam"]},{value:"VGB",label:"VGB",type:"string",alternativeMatches:["Virgin Islands (British)","British"]},{value:"VIR",label:"VIR",type:"string",alternativeMatches:["Virgin Islands (U.S.)"]},{value:"WLF",label:"WLF",type:"string",alternativeMatches:["Wallis and Futuna"]},{value:"ESH",label:"ESH",type:"string",alternativeMatches:["Western Sahara"]},{value:"YEM",label:"YEM",type:"string",alternativeMatches:["Yemen"]},{value:"ZMB",label:"ZMB",type:"string",alternativeMatches:["Zambia"]},{value:"ZWE",label:"ZWE",type:"string",alternativeMatches:["Zimbabwe"]}];import{isArray as V}from"lodash";var o=class i{constructor(a,e){this.dataModels=[];this.mapValidation=a=>{switch(a){case"regex":return"REGEX";case"required":return"REQUIRED";case"required_with":return"REQUIRED_WITH";case"required_with_all":return"REQUIRED_WITH_ALL";case"required_with_all_values":return"REQUIRED_WITH_ALL_VALUES";case"required_with_values":return"REQUIRED_WITH_VALUES";case"required_without":return"REQUIRED_WITHOUT";case"required_without_all":return"REQUIRED_WITHOUT_ALL";case"required_without_all_values":return"REQUIRED_WITHOUT_ALL_VALUES";case"required_without_values":return"REQUIRED_WITHOUT_VALUES";case"unique":return"UNIQUE";case"compare":return"COMPARE";default:throw new Error(`validation "${a}" isn't in available options`)}};this.getValidator=(a,e)=>new E({validation:this.mapValidation(a.validate),regex:a.regex??void 0,fields:a.columnValues?.map(t=>({key:t.key,value:t.value??[],type:this.findDataModelTypeByKey(t.key,e),label:this.findDataModelLabelByKey(t.key,e)}))??[],errorMessage:a.errorMessage,operator:a.operator,value:a.value});this.findDataModel=a=>this.columns.find(e=>e.key===a);this.findDataModelTypeByKey=(a,e)=>{let t=this.findDataModel(a);if(t)return i.mapDataModelType({columnType:t.columnType});if(e.checkValidation)throw new Error(`validation key "${a}" isn't found.`);return"string"};this.findDataModelLabelByKey=(a,e)=>{let t=this.findDataModel(a);if(t)return t.label;if(e.checkValidation)throw new Error(`validation key "${a}" isn't found.`);return""};this.validatorParser=a=>{let e=a.validate.toUpperCase(),t=a.columnValues??{},r=a.columns??[];return e==="REQUIRED_WITH_VALUES"||e==="REQUIRED_WITH_ALL_VALUES"||e==="REQUIRED_WITHOUT_VALUES"||e==="REQUIRED_WITHOUT_ALL_VALUES"?Object.keys(t).map(l=>({key:l,value:V(t[l])?t[l]:[t[l]]})):e==="REQUIRED_WITH"||e==="REQUIRED_WITHOUT"||e==="REQUIRED_WITHOUT_ALL"||e==="REQUIRED_WITH_ALL"?r.map(l=>({key:l})):[]};this.setDataModels=a=>{this.dataModels=this.columns.map(e=>{let t=i.mapDataModelType({columnType:e.columnType});e.numberFormat===void 0&&t==="currency_usd"&&(e.numberFormat="us");let r=e.optionMappingConfiguration?.processingMode??"browser",l=e.optionMappingConfiguration?.layers&&e.optionMappingConfiguration?.layers.length>0?e.optionMappingConfiguration?.layers:["smart","historic","fuzzy","exact"];a.enableNodeProcessing||(r="browser",l=l.filter(n=>n!=="historic"&&n!=="smart")),a.enableReuseMapping||(l=l.filter(n=>n!=="historic"));let M={layers:l,processingMode:r,threshold:e.optionMappingConfiguration?.threshold??.6},s={description:e.description??"",example:e.example??"",key:e.key,label:e.label,type:t,isRequired:!1,outputFormat:e.outputFormat??"",inputFormat:t==="date"?I(e.inputFormat):null,validators:e.validations?.map(n=>this.getValidator({...n,columnValues:this.validatorParser(n)},a)),mappingValidation:e.mappingValidation,alternativeMatches:e.alternativeMatches,columnSize:1,columnWidth:e.columnWidth,numberFormat:e.numberFormat||"eu",hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:M,excludeFromAutoMatching:e.excludeFromAutoMatching};return u.isTypeCategory(t)?new B({...s,type:t,options:i.createDropdownOptions(e),isMultiSelection:e.isMultiSelect??!1,allowCustomOptions:e.allowCustomOptions,allowedCustomOptionTypes:e.allowedCustomOptionTypes,preserveUnmappedOptions:i.sanitizePreserveUnmappedOptions(e.preserveUnmappedOptions)}):new u(s)})};this.getDataModels=()=>this.dataModels;this.hasDateType=()=>{let a=!1;for(let e=0;e<this.dataModels.length;++e)if(["date","datetime","date_dmy","date_iso","date_mdy"].includes(this.dataModels?.[e].getType())){a=!0;break}return a};this.columns=a,this.setDataModels(e)}static{this.mapDataModelType=({columnType:a})=>{switch(a){case"boolean":return"boolean";case"int":return"int";case"float":return"float";case"category":return"single-select";case"date":return"date";case"date_dmy":return"date_dmy";case"date_mdy":return"date_mdy";case"date_iso":return"date_iso";case"datetime":return"datetime";case"time_hms":return"time_hms";case"time_hms_24":return"time_hms_24";case"time_hm":return"time_hm";case"time_hm_24":return"time_hm_24";case"email":return"email";case"url_www":return"url_www";case"url_https":return"url_https";case"url":return"url";case"phone":return"phone";case"zip_code_de":return"zip_code_de";case"percentage":return"percentage";case"country_code_alpha_2":return"country_code_alpha_2";case"country_code_alpha_3":return"country_code_alpha_3";case"currency_code":return"currency_code";case"currency_eur":return"currency_eur";case"currency_usd":return"currency_usd";case"bic":return"bic";case"vat_eu":return"vat_eu";case"gtin":return"gtin";case"iban":return"iban";default:return"string"}}}static{this.mapColumnType=({dataType:a})=>{switch(a){case"boolean":return"boolean";case"int":return"int";case"float":return"float";case"single-select":return"category";case"date":return"date";case"date_dmy":return"date_dmy";case"date_mdy":return"date_mdy";case"date_iso":return"date_iso";case"datetime":return"datetime";case"time_hms":return"time_hms";case"time_hms_24":return"time_hms_24";case"time_hm":return"time_hm";case"time_hm_24":return"time_hm_24";case"email":return"email";case"url_www":return"url_www";case"url_https":return"url_https";case"url":return"url";case"phone":return"phone";case"zip_code_de":return"zip_code_de";case"percentage":return"percentage";case"country_code_alpha_2":return"country_code_alpha_2";case"country_code_alpha_3":return"country_code_alpha_3";case"currency_code":return"currency_code";case"currency_eur":return"currency_eur";case"currency_usd":return"currency_usd";case"bic":return"bic";case"vat_eu":return"vat_eu";case"gtin":return"gtin";case"iban":return"iban";default:return"string"}}}static{this.VALID_PRESERVE_UNMAPPED_OPTIONS=["none","optional-off","optional-on","always"]}static{this.sanitizePreserveUnmappedOptions=a=>{if(typeof a=="string"&&i.VALID_PRESERVE_UNMAPPED_OPTIONS.includes(a))return a}}static{this.createDropdownOptions=a=>a.columnType==="category"?a.dropdownOptions?.map(e=>({label:`${e.label}`,value:`${e.value}`,type:e.type,alternativeMatches:e.alternativeMatches??[],validations:e.validations??[],description:e.description??""}))??[]:a.columnType==="currency_code"?D:a.columnType==="country_code_alpha_2"?P:a.columnType==="country_code_alpha_3"?m:[]}},L=o;var be=(i,a,e,t,r,l)=>{let M=0,s=0,n=0,d=!1,S=!1,{value:G,columns:A,isExact:U,isEmptyValues:h}=a,y=G?.trim();if(!h&&(F(y)||y.length===0))return;let O=h?i.length-1:i.length;for(let c=0;c<O;c++){let T=i[c],g=Object.keys(T);for(let p=0;p<g.length;p++){let R=A.findIndex(v=>v.key===g[p]),b=R>=0?A[R]:void 0;if(b===void 0)continue;let K=T[g[p]];if(N(K,{value:y??"",columns:[b],isExact:U,isEmptyValues:h})){M++;let v=l.findIndex(_=>_.key===b.key),C=l[v];(e.includes(v)||t.includes(c))&&s++,r.includes(v)&&n++,C.disabled&&(S=!0),u.isTypeCategory(L.mapDataModelType({columnType:C.columnType}))&&(d=!0)}}}return{counter:M,hidden:s,skip:n,matchedCategoryType:d,matchedDisabledColumn:S}};export{D as a,P as b,m as c,L as d,be as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=r=>r.trim()?.replace(/[-!$%^&*()+|~=`{}\[\]:";'<>?,.\/]/g,"")?.replace(/^_+/,"")?.replace(/_+$/,"")?.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g,"")?.replace(/ /g,"_")?.replace(/ß/g,"ss")?.replace(/ä/g,"ae")?.replace(/ö/g,"oe")?.replace(/ü/g,"ue")?.toLowerCase(),l=r=>r?.replace(/[-!$%^&*()_+|~=`{}\\[\]:";'<>?,.\\/]/g," ")?.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g," ")?.toLowerCase();import{isNil as b}from"lodash";var p=class r{static{this.currencySymbol={eu:"\u20AC",us:"$"}}static{this.percentageSymbol="%"}static{this.maxSafeNumberLength=Number.MAX_SAFE_INTEGER}static{this.CURRENCY_CODE_RE=/(?<![A-Za-z])(?:EUR|USD)(?![A-Za-z])/gi}static{this.ADORNMENT_SYMBOL_RE=new RegExp(`[${Object.values(r.currencySymbol).join("")}${r.percentageSymbol}]`,"g")}static{this.SCIENTIFIC_NOTATION_RE=/^([+-]?)(?:(\d+)(?:\.(\d*))?|\.(\d+))[eE]([+-]?\d+)$/}static stripCurrencyAdornment(e){return e.replace(r.CURRENCY_CODE_RE,"").replace(r.ADORNMENT_SYMBOL_RE,"").replace(/\s+/g,"")}static isScientificNotation(e){return r.SCIENTIFIC_NOTATION_RE.test(e)}static convertToFormat(e,n){if(e==null||e===""||typeof e=="string"&&e.trim()==="")return"";let t="";if(typeof e=="string"){let a=this.convertStringToNumber(e,{targetFormat:n?.targetFormat});if(a===null)return e;t=a}else if(typeof e=="number"){let a=e;n?.adornment==="percentage"&&(a=e*100,a=Number(a.toFixed(10))),t=a.toString()}else throw new Error(`[convertToFormat] unsupported type of the "value" - ${typeof e}`);r.isScientificNotation(t)&&(t=r.expandScientificNotation(t));let[i,o]=t.split("."),s=n?.decimalDigits||o?.length||0,u="";try{let a=Number(t);if(!isFinite(a))return t;u=r.formatUS(a,s)}catch{return t}if(n?.targetFormat==="eu"){let a=u.replace(/,/g,"$").replace(/\./g,",").replace(/\$/g,".");return this.appendAdornment(a,n)}return this.appendAdornment(u,n)}static detectNumberFormat(e,n){let t=[];for(let u=0;u<e.length;u++)(e[u]===","||e[u]===".")&&t.push(e[u]);if(t.length===0)return;let i=r.stripCurrencyAdornment(e).replace(/[+-]/g,"");if(t.length===1){let[u,a]=i.split(t[0]);return u.length>3?t[0]===","?"eu":"us":u.replace(/0/g,"")===""?t[0]===","?"eu":"us":/^\d{3}$/.test(a)?n?.targetFormat?n?.targetFormat:n?.resolveUncertainty===!1?void 0:t[0]===","?"us":"eu":t[0]===","?"eu":"us"}let o=/^([1-9]\d{0,2})(\.\d{3})*(,\d+)?$/,s=/^([1-9]\d{0,2})(,\d{3})*(\.\d+)?$/;return o.test(i)?"eu":s.test(i)?"us":null}static convertToUsWithDecimal(e,n){let t=r.stripCurrencyAdornment(e.trim());if(r.isScientificNotation(t))return t;let i=e,o=r.getDelimiters(e),s=t.replace(/[+-]/g,"");if(o.length===1){let[u,a]=s.split(o[0]);if(/^\d{3}$/.test(a))return n==="us"?i=`${e}`?.replace(/,/g,""):i=`${e}`?.replace(/\./g,"$")?.replace(/,/,".").replace(/\$/g,""),i}return this.replaceDelimiter(e)}static{this.convertStringToNumber=(e,n)=>{if(typeof e=="number")return`${e}`;if(typeof e!="string")return null;let t=r.stripCurrencyAdornment(e.trim());if(t==="")return e;if(r.isScientificNotation(t)){if(!Number.isFinite(Number(t)))return null;let s=t;return n?.adornment==="percentage"&&e.includes(r.percentageSymbol)&&(s=Number((Number(s)/100).toFixed(10)).toString()),s}let i=this.detectNumberFormat(t,{targetFormat:n?.format??n?.targetFormat}),o="";if(i===null||(i==="us"||b(i)?o=t.replace(/,/g,""):o=t.replace(/\./g,"$").replace(/,/,".").replace(/\$/g,""),o.length>r.maxSafeNumberLength&&(o=o.slice(0,r.maxSafeNumberLength),o.at(-1)==="."&&(o=o.slice(0,r.maxSafeNumberLength-1))),isNaN(Number(o))))return null;if(n?.adornment==="percentage"&&e.includes(r.percentageSymbol)){let s=Number(o)/100;o=Number(s.toFixed(10)).toString()}return o}}static hasDecimalPart(e,n){if(typeof e=="number")return e%1!==0;let t=e.trim(),i=n||this.detectNumberFormat(t);return i===null?!1:i==="us"?e.includes("."):e.includes(",")}static appendAdornment(e,n){return n?.adornment==="currency"?n.symbol==="us"?`${this.currencySymbol.us}${e}`:`${e} ${this.currencySymbol[n.symbol??"eu"]}`:n?.adornment==="percentage"?`${e} ${this.percentageSymbol}`:e}static getDelimiters(e){let n=[];for(let t=0;t<e.length;t++)(e[t]===","||e[t]===".")&&n.push(e[t]);return n}static expandScientificNotation(e){let n=e.match(r.SCIENTIFIC_NOTATION_RE);if(!n)return e;let[,t,i="",o="",s="",u]=n,a=s||o,f=parseInt(u,10),m=i+a,c=i.length+f;return(c<=0?-c:c>=m.length?c-m.length:0)>1e3?e:c<=0?`${t}0.${"0".repeat(-c)}${m}`:c>=m.length?`${t}${m}${"0".repeat(c-m.length)}`:`${t}${m.slice(0,c)}.${m.slice(c)}`}static formatUS(e,n){return new Intl.NumberFormat("en-US",{useGrouping:!0,minimumFractionDigits:n,maximumFractionDigits:n}).format(e)}static replaceDelimiter(e){let n=e,t=r.detectNumberFormat(`${e}`);return b(t)?null:(t==="eu"?n=`${e}`?.replace(/\./g,"$")?.replace(/,/,".").replace(/\$/g,""):n=`${e}`?.replace(/,/g,""),n)}};import{isInteger as N,isNumber as O,isString as _}from"lodash";var d=r=>{if(_(r)){let e=r.trimEnd();return e===""?null:e}return r},T=(r,e,n)=>{for(let t=0;t<r.length;t++){let i=r[t].getKey(),o=e;if(n&&(i=l(i),o=l(o)),i===o)return r[t]}return null},P=(r,e)=>{for(let n=0;n<e.length;n++)if(e[n].getKey()===r)return n;return-1},R=(r,e)=>`${r.value}`==`${e}`,E=(r,e)=>{let n=0;for(let t=0;t<e.length;t++){let i=e[t],o="baseKeyCounter";i?.[o]&&r===i?.["baseKey"]&&n<(i?.[o]??0)&&(n=i?.[o]||0)}return n},h=(r,e)=>!r.some(n=>n.baseKey===e),K=(r,e,n=!0)=>{let t=n?g(r):r,i=E(t,e)+1,o=t;return h(e,t)?i--:i>0&&(o=`${t}_${i}`),{key:{value:o,baseKey:t,baseKeyCounter:i}}},L=({value:r,dataModel:e,isTrim:n})=>{let t=e.getOptionTypeMap(),i=r!==void 0?t.get(r):void 0;if(!i&&typeof r=="number"&&(i=t.get(String(r))),!i&&typeof r=="string"){let o=Number(r);isNaN(o)||(i=t.get(o))}if(i=i??"string",r===""&&t.has(r))return r;if(i==="int"){let o=Number(r);return!isNaN(o)&&N(o)?o:n?d(`${r}`):`${r}`}else if(i==="float"){if(O(r))return r;let o=`${r}`.replace(/,/,"."),s=p.convertStringToNumber(`${o}`,{format:"us"});return s===null?n?d(`${r}`):`${r}`:Number(s)}else return n?d(`${r}`):`${r}`};export{p as a,l as b,d as c,T as d,P as e,R as f,K as g,L as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as T,C as V,a as G,b as q,c as Z,d as J,e as j,f as ee,h as te,l as re,m as f}from"./chunk-TS3BDFZ6.js";import{a as u,c as a,f as x,h as b}from"./chunk-REPANPD5.js";import{a as g}from"./chunk-J5WOZVPO.js";var U=class{constructor({validation:e,regex:t,fields:i,errorMessage:o,operator:n,value:s}){this.getValidation=()=>this.validation;this.getRegex=()=>this.regex;this.getFields=()=>this.fields;this.getErrorMessage=()=>this.errorMessage;this.getOperator=()=>this.operator;this.getValue=()=>this.value;this.serialize=()=>({validation:this.getValidation(),fields:this.getFields(),regex:this.getRegex(),errorMessage:this.getErrorMessage(),operator:this.getOperator(),value:this.getValue()});this.validation=e,this.regex=t,this.fields=i??[],this.errorMessage=o,this.operator=n,this.value=s}},ht=U;var h=class r{constructor({description:e,key:t,example:i,label:o,type:n,validators:s,mappingValidation:y,alternativeMatches:c,columnSize:l,creator:p,baseKey:m,baseKeyCounter:E,outputFormat:M,inputFormat:O,numberFormat:D,hidden:S,disabled:P,optionMappingConfiguration:R,columnWidth:I,excludeFromAutoMatching:_}){this.getDescription=()=>this.description;this.getKey=()=>this.key;this.getExample=()=>this.example;this.getLabel=()=>this.label;this.setLabel=e=>{this.label=e};this.getType=()=>this.type;this.getOutputFormat=()=>r.getOutputFormat(this.outputFormat);this.getInputFormat=()=>this.inputFormat;this.getValidators=()=>this.validators;this.getColumnSize=()=>this.columnSize;this.getColumnWidth=()=>this.columnWidth;this.getIsRequired=()=>!!this.validators.find(t=>t.getValidation()==="REQUIRED");this.getIsUnique=()=>!!this.validators.find(t=>t.getValidation()==="UNIQUE");this.getIsUniqueAndRequired=()=>this.getIsRequired()===!0&&this.getIsUnique()===!0;this.hasMappingValidation=()=>!!(this.mappingValidation&&this.mappingValidation.logic&&this.mappingValidation.logic.trim().length>0);this.getMappingValidation=()=>this.mappingValidation||void 0;this.getAlternativeMatches=()=>this.alternativeMatches.filter(e=>!!e);this.getCreator=()=>this.creator;this.getBaseKey=()=>this.baseKey;this.getBaseKeyCounter=()=>this.baseKeyCounter;this.setCustomKey=({key:e,baseKey:t,baseKeyCounter:i,creator:o})=>{this.baseKey=t,this.key=e,this.baseKeyCounter=i,this.creator=o};this.isDropdown=()=>r.isTypeDropdown(this.getType());this.isCategoryType=()=>r.isTypeCategory(this.getType());this.isBooleanType=()=>this.type==="boolean";this.serialize=()=>({description:this.getDescription(),example:this.getExample(),key:this.getKey(),label:this.getLabel(),type:this.getType(),validators:[],alternativeMatches:this.getAlternativeMatches(),columnSize:this.getColumnSize(),columnWidth:this.getColumnWidth(),outputFormat:this.getOutputFormat(),inputFormat:this.getInputFormat(),isMultiSelection:this.getIsMultiSelection(),numberFormat:this.getNumberFormat(),baseKey:this.getBaseKey(),baseKeyCounter:this.getBaseKeyCounter(),creator:this.getCreator(),hidden:this.isHidden(),disabled:this.isDisabled(),optionMappingConfiguration:this.getOptionMappingConfiguration(),excludeFromAutoMatching:this.isExcludedFromAutoMatching()});this.getIsMultiSelection=()=>!1;this.getNumberFormat=()=>this.numberFormat;this.isDisabled=()=>this.disabled;this.isNumeric=()=>this.type==="int"||this.type==="float"||this.type==="currency_eur"||this.type==="currency_usd"||this.type==="percentage";this.isCurrency=()=>this.type==="currency_eur"||this.type==="currency_usd";this.baseClone=()=>{let e=this.serialize();return new r({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,validators:this.getValidators(),alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,columnWidth:e.columnWidth,baseKey:e.baseKey,baseKeyCounter:e.baseKeyCounter,creator:e.creator,numberFormat:e.numberFormat,outputFormat:e.outputFormat,inputFormat:e.inputFormat,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration,excludeFromAutoMatching:e.excludeFromAutoMatching})};this.isHidden=()=>this.hidden;this.isExcludedFromAutoMatching=()=>this.excludeFromAutoMatching;this.getOptionMappingConfiguration=()=>this.optionMappingConfiguration;this.description=e,this.key=t,this.example=i,this.label=o,this.type=n,this.validators=s??[],this.mappingValidation=y,this.alternativeMatches=c?[...c.filter(d=>d!==o&&d!==t)?.map(d=>d?.toString())]:[],this.columnSize=l,this.creator=p,this.baseKey=m||t,this.baseKeyCounter=E||0,this.outputFormat=M||"",this.inputFormat=O??null,this.numberFormat=D||"eu",this.hidden=S??!1,this.disabled=P??!1,this.optionMappingConfiguration=R,this.columnWidth=I,this.excludeFromAutoMatching=_??!1}static{this.getOutputFormat=e=>(e||"DD.MM.YYYY").replace(/d/g,"D").replace(/e|E/g,"")}static{this.isTypeDropdown=e=>r.isTypeCategory(e)||e==="boolean"}static{this.isTypeCategory=e=>e==="single-select"||e==="currency_code"||e==="country_code_alpha_2"||e==="country_code_alpha_3"}};import{isNil as z,escapeRegExp as Mt,isArray as gt}from"lodash";var N=()=>g.getInstance().getTruthyWords(),L=()=>g.getInstance().getFalsyWords(),Rt=()=>g.getInstance().getBooleanOptionToRender(),It=[...N(),...L()];import{isArray as Ae,isNil as Oe,isObject as De}from"lodash";var H=class{constructor(){this.parse=(e,t)=>Oe(e)||Ae(e)||De(e)?null:N().includes(`${e}`.toLowerCase())?!0:L().includes(`${e}`.toLowerCase())?!1:e===""?null:`${e}`}},oe=H;import{isArray as ne,isBoolean as se,isNil as ae,isObject as le}from"lodash";var Y=class{constructor(){this.parseSingle=(e,t)=>ae(e)||le(e)||ne(e)?null:se(e)?JSON.stringify(e):b({value:e,dataModel:t.dataModel,isTrim:!0});this.parseMultiple=(e,t)=>ne(e)?e.map(i=>b({value:i,dataModel:t.dataModel,isTrim:!0})):ae(e)||le(e)||e===""?null:se(e)?[JSON.stringify(e)]:[b({value:e,dataModel:t.dataModel,isTrim:!0})];this.parse=(e,t)=>t.dataModel.getIsMultiSelection()&&!t.forceSingle?this.parseMultiple(e,t):this.parseSingle(e,t)}},pe=Y;import{isArray as Se,isBoolean as Pe,isNil as Re,isObject as Ie}from"lodash";var w=class{constructor(){this.parse=(e,t)=>{if(Re(e)||Se(e)||Ie(e))return null;if(Pe(e))return JSON.stringify(e);if(e==="")return null;if(typeof e=="number"){let i=`${e}`;return a(u.isScientificNotation(i)?u.expandScientificNotation(i):i)}return a(`${e}`)}}},ue=w;import{isArray as _e,isBoolean as xe,isNil as Ve,isObject as Ue}from"lodash";var $=class{constructor(){this.parse=(e,t)=>Ve(e)?null:xe(e)?e?"1":"0":Ue(e)||_e(e)||e===""||a(e)===null?null:this.valueParser(e,t)}},C=$;var v=class extends C{constructor(){super(...arguments);this.valueParser=(t,i)=>{let o=u.convertStringToNumber(t,{format:i?.numberFormat});return o===null?a(`${t}`):Number(o)}}},me=v;var W=class extends C{constructor(){super(...arguments);this.valueParser=(t,i)=>{let o=u.convertStringToNumber(t,{format:i?.numberFormat});return o===null?a(`${t}`):Number(o)}}},de=W;import{isArray as Fe,isBoolean as Ne,isNil as Le,isNumber as He,isObject as Ye}from"lodash";var K=class{constructor(){this.parse=(e,t)=>{if(Le(e)||Ye(e)||Fe(e))return null;if(Ne(e))return JSON.stringify(e);if(He(e))return e;if(e===""||a(e)===null)return null;let i=u.convertStringToNumber(e,{adornment:"percentage"});return i===null?a(`${e}`):Number(i)}}},ye=K;import{isArray as we,isBoolean as $e,isNil as ve,isObject as We}from"lodash";var X=class{constructor(){this.parse=(e,t)=>{if(ve(e)||we(e)||We(e))return null;if($e(e))return JSON.stringify(e);if(e===""||a(e)===null)return null;let i=u.convertStringToNumber(e,{format:t?.numberFormat});return i===null?a(`${e}`):Number(i)}}},ce=X;var Me=["dd.MM.yyyy HH:mm","dd.MM.yyyy","dd/MM/yyyy HH:mm:ss","dd/MM/yyyy HH:mm","dd/MM/yyyy","dd-MM-yyyy HH:mm:ss","dd-MM-yyyy HH:mm","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd","yyyy-dd-MM","yyyy-MM-dd HH:mm:ss","dd-MM-yyyy","MM-dd-yyyy","MM/dd/yyyy","MM.dd.yyyy","yyyy/MM/dd","yyyyMMdd","dd MMM yyyy","dd MMMM yyyy","MM-dd-yyyy HH:mm:ss","MM/dd/yyyy HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd-yyyy HH:mm","MM/dd/yyyy HH:mm","dd-MMM-yyyy","MMM yyyy","MMMM yyyy","MMMM d, yyyy","MMM d, yyyy","MM dd yyyy","yyyy-MM-dd'T'HH:mm:ss.SSS","yyyy-MM-dd'T'HH:mm:ss.SSSxxx","yyyy.MM.dd","yyyy MM dd","yyyy/dd/MM","yyyy.dd.MM","dd yyyy MM","dd.yyyy.MM","dd-yyyy-MM","yyyy dd MM","MM yyyy dd","dd/yyyy/MM","MM/yyyy/dd"],Ke=["dd.MM.yyyy","dd/MM/yyyy","dd-MM-yyyy","MM.dd.yyyy","MM/dd/yyyy","MM-dd-yyyy","yyyy.MM.dd","yyyy/MM/dd","yyyy-MM-dd","yyyy.dd.MM","yyyy/dd/MM","yyyy-dd-MM","dd MMM yyyy","dd MMMM yyyy","MMM dd, yyyy","MMMM dd, yyyy","MMM dd yyyy","yyyy MMM dd"],Xe=["ddMMyyyy","MMddyyyy","yyyyMMdd"],Be=[""," HH:mm"," HH:mm:ss"],ke=["yyyy-MM-dd","yyyy-dd-MM"],ze=["'T'HH:mm:ss","'T'HH:mm:ss.SSS","'T'HH:mm:ss.SSSxxx"],Qe=[...Ke.flatMap(r=>Be.map(e=>`${r}${e}`)),...Xe,...ke.flatMap(r=>ze.map(e=>`${r}${e}`))],Ge=new Set(Me),ge=new Set([...Me,...Qe.filter(r=>!Ge.has(r))]);var qe={YYYY:"yyyy",YY:"yy",MMMM:"MMMM",MMM:"MMM",MM:"MM",M:"M",DD:"dd",D:"d",HH:"HH",H:"H",hh:"hh",h:"h",mm:"mm",m:"m",ss:"ss",s:"s",SSS:"SSS",SS:"SS",S:"S",A:"a",a:"a",XXXXX:"XXXXX",XXXX:"XXXX",XXX:"XXX",XX:"XX",X:"X",xxxxx:"xxxxx",xxxx:"xxxx",xxx:"xxx",xx:"xx",x:"x",ZZ:"xxx",Z:"X"},fe=r=>r.replace(/'/g,"''"),Ze=r=>{let e="",t=0;for(;t<r.length;){let i=r[t];if(i==="'"){t+=1;let o="";for(;t<r.length;)if(r[t]==="'")if(r[t+1]==="'")o+="'",t+=2;else{t+=1;break}else o+=r[t],t+=1;e+=`'${fe(o)}'`;continue}if(i==="["){t+=1;let o="";for(;t<r.length;)if(r[t]==="]")if(r[t+1]==="]")o+="]",t+=2;else{t+=1;break}else o+=r[t],t+=1;e+=`'${fe(o)}'`;continue}if(i==="T"){e+="'T'",t+=1;continue}if(/[A-Za-z]/.test(i)){let o=1;for(;r[t+o]===i;)o++;let n=r.slice(t,t+o);e+=qe[n]??n,t+=o}else e+=i,t+=1}return e},Je=r=>{if(!f(r))return!1;let e=Ze(r.trim());return ge.has(e)},cr=r=>{if(!f(r))return null;let e=r.trim();return Je(e)?e:null},je=({sourceRows:r,inputFormat:e})=>{let t=e.trim(),i=0,o=0;for(let n=0;n<r.length;n++){let s=r[n];re(s)&&(o+=1,T(s.trim(),t)||(i+=1))}return{mismatchCount:i,totalCount:o}},Mr=(r,e)=>{let t=e.trim();if(T(r,t))return!1;let i=r.trim();return/^\d{4}-\d{2}-\d{2}/.test(i)?!!(t.includes("/")||t.includes(".")&&!t.includes("/")):!1},gr=({columnKey:r,sourceRows:e,inputFormat:t})=>{let{mismatchCount:i,totalCount:o}=je({sourceRows:e,inputFormat:t});i!==0&&console.warn(`Ingestro: Column '${r}': ${i} of ${o} cells did not match inputFormat '${t.trim()}'.`)};import{parse as et,format as tt}from"date-fns";import{isArray as rt,isBoolean as it,isNil as ot,isObject as nt}from"lodash";import A from"moment";var Te=/([+-](?:0\d|1[0-4]):?[0-5]\d|Z)$/i,he=(r,e)=>{let o=!!r.match(Te)?A.parseZone(r,e,!0):A(r,e,!0);return o.isValid()&&o.format(e)===r},B=class{constructor(){this.parse=(e,t)=>{if(ot(e)||rt(e)||nt(e))return null;if(it(e))return JSON.stringify(e);let i=t?.dataModel?.getType();if(!i)return a(`${e}`);if(typeof e=="string"){if(e==="")return null;try{if(t?.dataModel?.getType()==="date"){let o=t?.dataModel?.getOutputFormat(),n=t?.dataModel?.getInputFormat(),s=`${e}`,y=!1;if(f(n)&&!t?.skipDeclaredInputFormatNormalization){let m=J(s);if(T(s,n)||m)m||(s=`${V([s],n)[0]}`),y=!0;else{let M=V([s],n)[0];if(M===s)return he(s,o)?s:a(s);s=`${M}`,y=!0}}if(!y&&he(s,o))return s;let p=!!s.match(Te)?A.parseZone(s,Z):A(s,q);if(p.isValid())return p.format(o);throw new Error("invalid date")}else{let o=j[i];if(!o)return a(`${e}`);let n=et(e,G,new Date);return tt(n,o)}}catch{let n=ee[i];return n?a(te(e,n)):a(`${e}`)}}else return a(`${e}`)}}},Ee=B;import{isArray as st}from"lodash";var at=new me,lt=new de,pt=new ce,ut=new ye,mt=new oe,dt=new pe,yt=new ue,ct=new Ee,k=class{static{this.parse=(e,t)=>{let i;switch(t?.dataModel?.getType()){case"int":i=at;break;case"float":i=lt;break;case"boolean":i=mt;break;case"single-select":case"currency_code":case"country_code_alpha_2":case"country_code_alpha_3":i=dt;break;case"percentage":i=ut;break;case"currency_eur":case"currency_usd":i=pt;break;case"date":case"date_dmy":case"date_mdy":case"date_iso":case"datetime":case"time_hms":case"time_hms_24":case"time_hm":case"time_hm_24":i=ct;break;case"email":case"url_www":case"url_https":case"url":case"phone":case"zip_code_de":case"bic":case"vat_eu":case"gtin":case"iban":default:i=yt;break}return i.parse(e,t)}}static{this.parseRawValueToDisplayValue=(e,t)=>{let i=e;if(t.isNumeric)i=u.convertToFormat(e,{targetFormat:t.numberFormat||"eu",adornment:t.type==="percentage"?"percentage":void 0}),["currency_eur","currency_usd"].includes(t.type)&&(t.type==="currency_usd"?i=`$${i}`:i=`${i} \u20AC`);else if(t.type==="boolean"){let n=g.getInstance().getOptionsForReviewEntries().find(s=>`${s.value}`.includes(`${e}`));n&&(i=`${n.label}`)}else if(h.isTypeCategory(t.type))if(t.isMultiSelection){if(st(e)){let o=t.options?.filter(n=>e.some(s=>x(n,s)));o&&(i=o.map(n=>n.label).join(", "))}}else{let o=t.options?.find(n=>x(n,e));o&&(i=`${o?.label}`)}return`${i}`}}static{this.parseDisplayValueToRawValue=(e,t)=>{if(t.isNumeric){let i=u.convertToUsWithDecimal(`${e}`,t.numberFormat??"eu");if(i===null)return e;let o=u.convertStringToNumber(i,{format:"us"});return o!==null?Number(o):e}else return e}}},be=k;var Zr=(r,e)=>Number(r).toLocaleString(e??"de-DE"),ft={de:"de-DE",en:"en-US",es:"es-ES",fr:"fr-FR",it:"it-IT",nl:"nl-NL",pl:"pl-PL",pt:"pt-PT",sv:"sv-SE",cz:"cs-CZ",dk:"da-DK",hu:"hu-HU",lt:"lt-LT",no:"nb-NO",ru:"ru-RU",sk:"sk-SK",zh:"zh-CN"},Jr=r=>r?ft[r]??"de-DE":"de-DE",jr=(r,e)=>{let{value:t,isExact:i,columns:o,isEmptyValues:n}=e;if(n)return z(r)||r==="";if(gt(r)&&o[0]?.isMultiSelection){let y=o[0],c=r.map(l=>{let p=y.options?.find(m=>`${m.value}`==`${l}`);return p?p.label:`${l}`}).join(", ");return i?c===t:c.toLowerCase().includes(t.toLowerCase())}let s=be.parseRawValueToDisplayValue(r,o[0]);return i&&!z(r)&&s===t?!0:!!(!i&&!z(r)&&s?.toLowerCase()?.includes(t?.toLowerCase()))},ei=(r,e,t,i)=>{let o=r.map(l=>{let p=i.options?.find(m=>`${m.value}`==`${l}`);return p?p.label:`${l}`}),n=e.split(",").map(l=>l.trim()).filter(Boolean);if(n.length===0)return r;let s=-1;for(let l=0;l<=o.length-n.length;l++){let p=!0;for(let m=0;m<n.length;m++)if(o[l+m].toLowerCase()!==n[m].toLowerCase()){p=!1;break}if(p){s=l;break}}if(s===-1)return r;let y=[...r.slice(0,s),...t,...r.slice(s+n.length)],c=new Set;return y.filter(l=>{let p=`${l}`;return c.has(p)?!1:(c.add(p),!0)})},ti=(r,e,t)=>{let i=new RegExp(Mt(e),"gi");return`${r}`.replace(i,t)},ri=r=>typeof r=="string"?r.replace(/(\r\n|\n|\r)/gm,""):r,ii=(r,e)=>e?e.map((t,i)=>r.map(o=>({rowIndex:i,valid:!0,key:o.key,value:t[o.key]}))):[];var Q=class r extends h{constructor({description:t,key:i,example:o,label:n,type:s,options:y,validators:c,alternativeMatches:l,columnSize:p,isMultiSelection:m,allowCustomOptions:E,allowedCustomOptionTypes:M,preserveUnmappedOptions:O,creator:D,baseKey:S,baseKeyCounter:P,hidden:R,optionMappingConfiguration:I,..._}){super({description:t,key:i,example:o,label:n,type:s,validators:c,alternativeMatches:l,columnSize:p,creator:D,baseKey:S,baseKeyCounter:P,hidden:R,optionMappingConfiguration:I,..._});this.optionTypeMap=null;this.getOptions=()=>this.options;this.getOptionTypeMap=()=>{if(!this.optionTypeMap){this.optionTypeMap=new Map;for(let t=0;t<this.options.length;t++){let i=this.options[t];this.optionTypeMap.set(i.value,i.type??"string")}}return this.optionTypeMap};this.setOptions=t=>{this.options=t,this.optionTypeMap=null};this.serialize=()=>{let t={description:this.getDescription(),example:this.getExample(),isRequired:this.getIsRequired(),key:this.getKey(),label:this.getLabel(),type:this.getType(),validators:this.getValidators().map(o=>o.serialize()),alternativeMatches:this.getAlternativeMatches(),columnSize:this.getColumnSize(),columnWidth:this.getColumnWidth(),outputFormat:this.getOutputFormat(),inputFormat:this.getInputFormat(),numberFormat:this.getNumberFormat(),baseKey:this.getBaseKey(),baseKeyCounter:this.getBaseKeyCounter(),creator:this.getCreator(),hidden:this.isHidden(),disabled:this.isDisabled(),optionMappingConfiguration:this.getOptionMappingConfiguration(),excludeFromAutoMatching:this.isExcludedFromAutoMatching()},i=this.getOptions();return{...t,options:i,isMultiSelection:this.isMultiSelection,allowCustomOptions:this.allowCustomOptions,allowedCustomOptionTypes:this.allowedCustomOptionTypes?[...this.allowedCustomOptionTypes]:void 0,preserveUnmappedOptions:this.preserveUnmappedOptions}};this.getIsMultiSelection=()=>this.isMultiSelection;this.getAllowCustomOptions=()=>this.allowCustomOptions;this.getAllowedCustomOptionTypes=()=>this.allowedCustomOptionTypes?[...this.allowedCustomOptionTypes]:void 0;this.getPreserveUnmappedOptions=()=>this.preserveUnmappedOptions;this.options=y?.map(d=>({...d,baseKey:d?.baseKey||d.value,baseKeyCounter:d.baseKeyCounter||0,alternativeMatches:d.alternativeMatches.filter(Ce=>Ce!==d.label),validations:d.validations||[]})),this.isMultiSelection=m,this.allowCustomOptions=E,this.allowedCustomOptionTypes=M?[...M]:void 0,this.preserveUnmappedOptions=O}clone(){let t=this.serialize();return new r({description:t.description,example:t.example,key:t.key,label:t.label,type:t.type,options:t.options,validators:this.getValidators(),alternativeMatches:t.alternativeMatches,columnSize:t.columnSize,columnWidth:t.columnWidth,isMultiSelection:t.isMultiSelection,allowCustomOptions:t.allowCustomOptions,allowedCustomOptionTypes:t.allowedCustomOptionTypes,preserveUnmappedOptions:t.preserveUnmappedOptions,hidden:t.hidden,disabled:t.disabled,optionMappingConfiguration:t.optionMappingConfiguration,excludeFromAutoMatching:t.excludeFromAutoMatching})}},pi=Q;export{N as a,L as b,Rt as c,It as d,cr as e,Mr as f,gr as g,ht as h,h as i,be as j,Zr as k,Jr as l,jr as m,ei as n,ti as o,ri as p,ii as q,pi as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as F,i as y,j as c,r as w}from"./chunk-SKUCMMIT.js";import{B as J,C as P,d as O,k as A,m as T}from"./chunk-TS3BDFZ6.js";import{b as p}from"./chunk-AAZKUHPZ.js";import{isEmpty as Q,uniq as X}from"lodash";var H=0,I=class{constructor({sheet:e,columnKey:t,rows:s,id:o,label:r,refJoinSheetColum:a}){this.removed=!1;this.label="";this.rawRowsBeforeDateParse=null;this.dateRowsByInputFormat=new Map;this.getColumnKey=()=>this.columnKey;this.getId=()=>this.id;this.getSheet=()=>this.sheet;this.getRows=()=>this.rows;this.getUniqueRows=()=>(this.uniques===void 0&&(this.uniques=X(this.getRows())),this.uniques);this.remove=()=>{this.removed=!0};this.unRemove=()=>{this.removed=!1};this.isRemoved=()=>this.removed;this.getType=()=>0;this.getFileName=()=>this.sheet.getSheetFileName();this.toJSON=()=>({columnKey:this.columnKey,id:this.id,rows:this.rows,type:this.getType()});this.equal=e=>this.getId()===e.getId();this.keyEqual=e=>this.columnKey===e.columnKey;this.setIndex=e=>{this.index=e};this.getIndex=()=>this.index;this.normalizeInputFormatKey=e=>{let t=typeof e=="string"?e.trim():"";return t!==""?t:null};this.dateInputFormatCacheKey=e=>this.normalizeInputFormatKey(e)??"\0auto";this.needsDateFormatParse=e=>!this.dateRowsByInputFormat.has(this.dateInputFormatCacheKey(e));this.hasParsedDateForInputFormat=e=>!this.needsDateFormatParse(e);this.getParsedRowsForInputFormat=e=>this.dateRowsByInputFormat.get(this.dateInputFormatCacheKey(e));this.getRowsForDateInputFormatParse=()=>this.rawRowsBeforeDateParse??this.rows;this.applyDateInputFormatParse=(e,t)=>{let s=this.getRowsForDateInputFormatParse();if(e.length!==s.length)throw new Error(`SheetColumn.applyDateInputFormatParse: parsed row count (${e.length}) must match source row count (${s.length}) for column "${this.columnKey}".`);this.dateRowsByInputFormat.set(this.dateInputFormatCacheKey(t),e)};this.getRefJoinSheetColum=()=>this.refJoinSheetColum;this.columnKey=t.trim(),this.sheet=e,Object.defineProperty(this,"sheet",{value:e,enumerable:!1,writable:!0,configurable:!0}),this.rows=Q(s)?[""]:s,this.rawRowsBeforeDateParse=[...this.rows],typeof o>"u"?(H++,this.id=`${t}-${H}`):this.id=o,r&&(this.label=r),Object.defineProperty(this,"refJoinSheetColum",{value:a,enumerable:!1,writable:!0,configurable:!0})}setRows(e){this.rows=e,this.uniques=void 0}},f=I;var b=class extends f{constructor({sheet:t,sheetColumns:s,rows:o,id:r,columnKey:a}){super({columnKey:a,rows:o,sheet:t,id:r});this.getType=()=>1;this.getJoinedSheetColumns=()=>this.sheetColumns;this.toJSON=()=>({columnKey:this.columnKey,id:this.id,rows:this.rows,sheetColumns:this.sheetColumns.map(t=>t.toJSON()),type:this.getType()});this.sheetColumns=s}},B=b;var _=["?",",","@"];import{isNaN as ee,minBy as te,isString as se,isEqual as oe,isEmpty as L,isNil as re}from"lodash";var x=class{constructor({sheets:e,filename:t,type:s,fileSize:o}){this.globalNumberFormat="eu";this.columnsNumberFormat=[];this.addSheet=e=>{this.sheets.push(e)};this.isSelected=()=>{for(let e=0;e<this.sheets.length;e++)if(this.sheets[e].isSelected())return!0;return!1};this.getSheets=()=>this.sheets;this.getSelectedSheets=()=>this.sheets.filter(e=>e.isSelected());this.getFilename=()=>this.filename;this.selectAllSheet=e=>this.sheets.forEach(t=>{t.setSelected(e)});this.getType=()=>this.type;this.getFileSize=()=>{let e=this.fileSize/1e6;return Number(parseFloat(`${e}`).toFixed(4))};this.sheets=e,this.filename=t,this.type=s,this.fileSize=o??0,this.sheets.forEach(r=>{r.setSpreadSheet(this)})}setNumberFormat(e){this.globalNumberFormat=e.global,this.columnsNumberFormat=e.columns}getNumberFormat(){return{global:this.globalNumberFormat,columns:this.columnsNumberFormat}}},z=x;var $=0,R=class{constructor({data:e,name:t,isNotSetColumn:s,id:o}){this.selected=!1;this.isManualSelectHeader=!1;this.columns=[];this.columnsInitialized=!1;this.headerRowIndex=0;this.transposed=!1;this.headerRowIndexes=[];this.addedColumns=[];this.usedSourceCells=new Set;this.mergedHeadersActive=!1;this.mergedRowsBackup=null;this.availableRows=null;this.spreadSheet=new z({filename:"",sheets:[],type:"xlsx",fileSize:0});this.getId=()=>this.id;this.setSpreadSheet=e=>{this.spreadSheet=e};this.getSpreadSheet=()=>this.spreadSheet;this.setSelected=e=>{this.selected=e};this.isSelected=()=>this.selected;this.setHeaderRowIndex=e=>{this.headerRowIndex=e,this.columnsInitialized=!1,this.mergedHeadersActive||(this.headerRowIndexes=[e])};this.setTransposed=e=>{this.transposed=e};this.getTransposed=()=>this.transposed;this.setHeaderRowIndexes=e=>{this.headerRowIndexes=[...e]};this.getHeaderRowIndexes=()=>this.headerRowIndexes.length>0?this.headerRowIndexes:[this.headerRowIndex];this.addAddedColumn=e=>{if(this.addedColumns.push(e),e.sourceCell){let o=`${e.sourceCell.row},${e.sourceCell.col}`;this.usedSourceCells.add(o)}let t=this.data[this.headerRowIndex],s=this.data.length>0?Math.max(...this.data.map(o=>o.length)):0;t&&t.push(e.columnName);for(let o=0;o<this.data.length;o++)if(o!==this.headerRowIndex){for(;this.data[o].length<s;)this.data[o].push("");o<this.headerRowIndex?this.data[o].push(""):this.data[o].push(e.value)}this.setColumns()};this.removeAddedColumn=e=>{let s=(this.data[this.headerRowIndex]?.length||0)-this.addedColumns.length,o=e-s;if(o<0||o>=this.addedColumns.length)return;let r=this.addedColumns[o];if(r?.sourceCell){let a=`${r.sourceCell.row},${r.sourceCell.col}`;this.usedSourceCells.delete(a)}for(let a=0;a<this.data.length;a++)this.data[a].splice(e,1);this.addedColumns.splice(o,1),this.setColumns()};this.removeColumnFromData=e=>{if(!(e<0))for(let t=0;t<this.data.length;t++)this.data[t].length>e&&this.data[t].splice(e,1)};this.clearAddedColumns=()=>{if(this.addedColumns.length>0){let t=(this.data[this.headerRowIndex]?.length||0)-this.addedColumns.length;for(let s=this.addedColumns.length-1;s>=0;s--){let o=t+s;for(let r=0;r<this.data.length;r++)this.data[r].length>o&&this.data[r].splice(o,1)}}this.addedColumns=[],this.usedSourceCells.clear(),this.setColumns()};this.isSourceCellUsed=(e,t)=>{let s=`${e},${t}`;return this.usedSourceCells.has(s)};this.getAddedColumnBySourceCell=(e,t)=>this.addedColumns.find(s=>s.sourceCell&&s.sourceCell.row===e&&s.sourceCell.col===t);this.getAddedColumns=()=>this.addedColumns;this.setMergedHeadersActive=e=>{this.mergedHeadersActive=e};this.isMergedHeadersActive=()=>this.mergedHeadersActive;this.setMergedRowsBackup=e=>{this.mergedRowsBackup=e};this.getMergedRowsBackup=()=>this.mergedRowsBackup;this.setAvailableRows=e=>{this.availableRows=e};this.getAvailableRows=()=>this.availableRows;this.isLoneWhitelistCharacter=e=>{let t=e.toString()?.trim()??"";return _.some(s=>t===s)};this.isSignificantCell=e=>!L(e)&&!this.isLoneWhitelistCharacter(e);this.collapseAdjacentDuplicates=e=>e.filter((t,s)=>s===0||`${t}`!=`${e[s-1]}`);this.getSignificantCells=e=>{let t=(e??[]).filter(this.isSignificantCell);return this.collapseAdjacentDuplicates(t)};this.getDataTransform=()=>this.data.map((e,t)=>({data:e,index:t,length:this.getSignificantCells(e).length}));this.getMaxLengthColumns=()=>this.getDataTransform().reduce((t,s)=>Math.max(t,s.length),0);this.isHeaderLikeCell=e=>!F.includes(se(e)?e.toLowerCase():e)&&ee(Number(e));this.countHeaderLikeCells=e=>this.getSignificantCells(e).filter(this.isHeaderLikeCell).length;this.setHeaderByAutoDetection=()=>{let t=this.getMaxLengthColumns(),s=this.getDataTransform().slice(0,50).filter(r=>r.length===t&&this.countHeaderLikeCells(r.data)===t),o=s.length===1?s[0].index:te(s,r=>r.length)?.index??0;this.setHeaderRowIndex(o)};this.getHeaderRowIndex=()=>this.headerRowIndex;this.getHeaderRow=()=>this.data[this.headerRowIndex]?.filter(e=>!!e);this.getColumns=()=>(this.ensureColumnsBuilt(),this.columns.filter(e=>!e.isRemoved()));this.getSortedColumns=()=>[...this.getColumns()].sort((e,t)=>p(e.getColumnKey())<p(t.getColumnKey())?-1:p(e.getColumnKey())>p(t.getColumnKey())?1:0);this.getColumnsWithRemoved=()=>(this.ensureColumnsBuilt(),this.columns.filter(e=>e.getType()!==1));this.getColumn=(e,t)=>(this.ensureColumnsBuilt(),this.columns.find(s=>t?p(s.getColumnKey())===p(`${e}`):s.getColumnKey()===e));this.getColumnsByKey=(e,t)=>(this.ensureColumnsBuilt(),this.columns.filter(s=>t?p(s.getColumnKey())===p(`${e}`):s.getColumnKey()===e));this.getValues=()=>{let e=this.data.filter((s,o)=>o>this.headerRowIndex);if(L(e))return[[]];let t=[];for(let s=0;s<e.length;s++){let o=[];for(let r=0;r<this.data[this.headerRowIndex].length;r++)re(this.data[this.headerRowIndex][r])||o.push(this.parseValue(e[s][r]));t.push(o)}return t};this.getData=()=>this.data;this.getName=()=>this.name;this.getDisplayName=({t:e})=>{if(this.getName()?.length>0)return this.getName();switch(this.spreadSheet.getType()){case"json":return`${e("txt_default_sheet_prefix_name")} 1`;case"csv":return`${e("txt_default_sheet_prefix_name")} 1`;default:return""}};this.getSheetFileName=()=>`${this.spreadSheet.getFilename()}`;this.getIsManualSelectHeader=()=>this.isManualSelectHeader;this.setIsManualSelectHeader=()=>{this.isManualSelectHeader=!0};this.clearIsManualSelectHeader=()=>{this.isManualSelectHeader=!1};this.addColumn=e=>{this.ensureColumnsBuilt(),this.columns.push(new f({columnKey:`${e}`,sheet:this,rows:this.getRowsByColumnIndex(this.getColumnIndex(e))}))};this.removeColumn=e=>{this.ensureColumnsBuilt(),this.columns.find(t=>t.getColumnKey()===e)?.remove()};this.removeColumnByIndex=e=>{this.ensureColumnsBuilt(),this.columns.find((t,s)=>s===e)?.remove()};this.setData=e=>{this.data=e};this.toJSON=()=>({name:this.name,id:this.id,type:this.getType(),values:this.getValues(),headerRow:this.getHeaderRow()});this.equal=e=>this.id===e.getId();this.getType=()=>0;this.getRowsByColumnIndex=e=>{if(e===-1)return[];let t=[];for(let s=0;s<this.data.length;s++){let o=this.data[s];if(s>this.headerRowIndex){let r=o[e]??"";t.push(this.parseValue(r))}}return t};this.ensureColumnsBuilt=()=>{this.columnsInitialized||this.setColumns()};this.setColumns=()=>{let e=this.data[this.headerRowIndex];if(e){let t=[];for(let s=0;s<e.length;++s){let o=e[s];o&&t.push(new f({columnKey:`${o}`,sheet:this,rows:this.getRowsByColumnIndex(s)}))}this.columns=t}else this.columns=[];this.columnsInitialized=!0};this.getColumnIndex=e=>this.data[this.headerRowIndex].findIndex(o=>oe(`${o}`,`${e}`));this.parseValue=e=>typeof e=="string"?e.trim():e;this.data=e,this.name=t,typeof o>"u"?($++,this.id=`${t}-${$}`):this.id=o,this.columnsInitialized=!!s}},E=R;var V=class extends E{constructor({joinedData:t,sheets:s,mappings:o,mappingIndexes:r}){super({data:t.data,name:"join-sheet",isNotSetColumn:!0});this.sheets=[];this.joinHistory=[];this.findRefJoinSheetColumn=t=>{let s=this.sheets.length===2?this.sheets[0]:this,o=this.sheets[this.sheets.length-1];if(t<s.getColumns().length)return s.getColumns()[t];let r=t-s.getColumns().length;return o.getColumns().filter((a,l)=>this.joinHistory[this.joinHistory.length-1].mappingIndexes.every(i=>i.target!==l))[r]};this.setJoinColumns=(t,s)=>{let o=this.data[this.headerRowIndex];if(!o){this.columns=[];return}let r=[];for(let a=0;a<o.length;++a){let l=o[a],i=s.findIndex(u=>u.source===a),h=this.columns[a]&&this.columns[a].getType()===1;if(i>=0||h){let u=t[i],d;h&&i>=0?d=[...this.columns[a].getJoinedSheetColumns(),u.target]:h?d=this.columns[a].getJoinedSheetColumns():d=[u.source.getRefJoinSheetColum()??u.source,u.target],r.push(new B({columnKey:`${l}`,sheetColumns:d,sheet:this,rows:this.getRowsByColumnIndex(a)}))}else{let u=this.columns[a]?this.columns[a].getRefJoinSheetColum()??this.columns[a]:this.findRefJoinSheetColumn(a);r.push(new f({columnKey:`${l}`,sheet:u.getSheet(),rows:this.getRowsByColumnIndex(a),refJoinSheetColum:u}))}}this.columns=r};this.getJoinedSheets=()=>this.sheets;this.getType=()=>1;this.joinSheet=(t,s,o,r)=>{this.setData(t.data),this.sheets.push(s),this.joinHistory.push({mappingIndexes:r,type:t.type,row:t.data.length,col:this.data[this.headerRowIndex]?.length??0}),this.setJoinColumns(o,r)};this.getJoinColumns=()=>this.columns.filter(t=>t.getType()===1);this.getJoinHistory=()=>this.joinHistory;this.headerRowIndex=0,this.joinHistory.push({mappingIndexes:r,type:t.type,row:t.data.length,col:this.data[this.headerRowIndex]?.length??0}),this.sheets=s,this.setJoinColumns(o,r)}},Je=V;var j=({rowA:n,rowB:e},t)=>t.every(s=>{let o=`${n[s.source]??""}`,r=`${e[s.target]??""}`;return o===r&&o!==""&&r!==""}),ae=(n,e,t)=>{let s=[],o=n.headerRow,r=e.headerRow;for(let a=0;a<o.length;++a)s.push(o[a]);for(let a=0;a<r.length;++a)t.every(l=>l.target!==a)&&s.push(r[a]);return s},Ke=async(n,e)=>{let t=n.values,s=e.values,o=n.headerRow,r=e.headerRow,a=[...o,...r],l=[];l.push(a);for(let i=0;i<t.length;++i)l.push([...t[i],...s[0]]);return{data:l,type:"ADD_TO_ALL_ROWS"}},ze=async(n,e)=>{let t=n.values,s=e.values,o=n.headerRow,r=e.headerRow,a=[...o,...r],l=[];l.push(a);for(let i=0;i<t.length;++i)l.push([...t[i],...r.map(()=>"")]);for(let i=0;i<s.length;++i)l.push([...o.map(()=>""),...s[i]]);return{data:l,type:"JOIN_WITHOUT_COLUMNS"}},Le=async(n,e,t)=>{let s=n.values,o=e.values,r=[],a=[],l={},i=ae(n,e,t);r.push(i);for(let h=0;h<s.length;++h){let u=!1,d=s[h];for(let m=0;m<o.length;++m){let g=o[m];j({rowA:d,rowB:g},t)&&(l[m]=!0,u=!0,r.push([...d,...g.filter((M,Y)=>t.every(G=>G.target!==Y))]))}u||a.push([...d,...e.headerRow.filter((m,g)=>t.every(M=>M.target!==g)).map(()=>"")])}for(let h=0;h<o.length;++h){if(l[h])continue;let u=o[h],d=n.headerRow.map(()=>"");t.forEach(m=>{d[m.source]=u[m.target]}),a.push([...d,...u.filter((m,g)=>t.every(M=>M.target!==g))])}return a.forEach(h=>{r.push(h)}),{data:r,type:"JOIN_ON_COLUMNS"}},$e=async(n,e,t)=>{let s=e.headerRow.filter((l,i)=>t.every(h=>h.target!==i)),r=[[...n.headerRow,...s]];for(let l=0;l<n.values.length;++l){let i=[...n.values[l],...s.map(()=>"")];r.push(i)}let a=e.values;for(let l=0;l<a.length;++l){let i=n.headerRow.map(()=>""),h=[];for(let u=0;u<e.headerRow.length;++u){let d=t.find(m=>m.target===u);d?i[d.source]=a[l][u]:h.push(a[l][u])}r.push([...i,...h])}return{data:r,type:"APPEND_TO_COLUMNS"}},Ee=async(n,e,t)=>{let s=n.values,o=e.values,r=s.length+o.length,a=0,l={};for(let i=0;i<s.length;i++){let h=s[i],u=null,d=0;for(let m=0;m<o.length;m++){let g=o[m];if(j({rowA:h,rowB:g},t)&&(u=m,d++,d===2))break}d===1&&u!==null&&(a+=1,l[u]=!0)}for(let i=0;i<o.length;i++)l[i]&&(a+=1);return{count:a,total:r}};import{isNil as ie}from"lodash";var k=(n,e)=>{if(e.getType()!=="date")return c.parse(n,{dataModel:e});if(A(n))return null;let t=`${n}`,s=e.getInputFormat();return T(s)?O(t)?c.parse(t,{dataModel:e}):J(t,s)?c.parse(P([t],s)[0],{dataModel:e}):t:c.parse(t,{dataModel:e})};var N=class{constructor({sheetColumn:e,matchedDataModel:t,detectedNumberFormats:s}){this.parseSheetValue=(e,t)=>t.dataModel.getType()==="date"?k(e,t.dataModel):c.parse(e,t);this.getOptionValue=(e,t)=>{if(!t)if(this.matchedDataModel.dataModel){let s=this.sheetColumn.columnKey,r=this.detectedNumberFormats.columns.find(a=>a.column===s)?.numberFormat||this.detectedNumberFormats.global;return this.parseSheetValue(e,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0,numberFormat:r})}else return e;for(let s=0;s<t.length;s++)if(`${t[s]?.sheetOption}`==`${e}`){let o=!ie(t[s]?.dataModelOptions)&&(t[s]?.dataModelOptions?.length??0)>0;if(t[s]?.autoPreserved===!0&&t[s]?.dataModelOption==null&&!o){if(this.matchedDataModel.dataModel instanceof w){let r=`${e}`,a=this.matchedDataModel.dataModel.getOptions().find(l=>l.label===r||l.value===r);if(a)return c.parse(a.value,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0})}return e}return this.matchedDataModel.dataModel&&this.matchedDataModel.dataModel.getIsMultiSelection()?c.parse(t[s]?.dataModelOptions,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0}):this.matchedDataModel.dataModel?c.parse(t[s]?.dataModelOption,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0}):t[s]?.dataModelOption}};this.getValues=()=>{let e=this.sheetColumn.rows,t=[];for(let s=0;s<e.length;s++){let o=e[s],r=this.getOptionValue(o,this.matchedOptions);t.push(r)}return t};if(this.sheetColumn=e,this.matchedDataModel=t,this.matchedOptions=void 0,this.detectedNumberFormats=s||{global:"eu",columns:[]},this.matchedDataModel.matchedOptions){this.matchedOptions=[];for(let o=0;o<(this.matchedDataModel.matchedOptions?.length??0);o++){let r=this.matchedDataModel.matchedOptions[o];this.matchedDataModel.dataModel?.getIsMultiSelection()?r.dataModelOptions&&this.matchedOptions.push(r):r.dataModelOption!==void 0&&r.dataModelOption!==null?this.matchedOptions.push(r):r.autoPreserved===!0&&!r.userCleared&&this.matchedOptions.push(r)}}}},U=N;var v=class{constructor(e){this.matchedColumns=[];this.parseValues=()=>{let e=[];this.matchedColumns.forEach(t=>{let s=t.matchedDataModel,r=new U({sheetColumn:t.sheetColumn,matchedDataModel:s,detectedNumberFormats:this.detectedNumberFormats}).getValues(),a=s.dataModel.getKey();r.forEach((l,i)=>{e[i]?e[i][a]=l:e[i]={[a]:l}})});for(let t=0;t<e.length;++t)for(let s=0;s<this.columns.length;++s){let r=this.columns[s].key;e[t][r]===void 0&&(e[t][r]=null)}return e};this.getValues=()=>(this.matchedColumns=[],this.matching.filter(t=>t.matchedDataModel?.dataModel).forEach(t=>{this.matchedColumns.push({sheetColumn:t.sheetColumn,matchedDataModel:t.matchedDataModel})}),this.parseValues());let{matching:t,detectedNumberFormats:s}=e;this.matching=t,this.detectedNumberFormats=s||{global:"eu",columns:[]},this.columns=e.columns??[]}},W=v;var pt=({matching:n,detectedNumberFormats:e,columns:t})=>new W({matching:n,detectedNumberFormats:e,columns:t}).getValues();import*as q from"comlink";var C=class{static{this.serialize=e=>e.serialize()}static{this.deSerialize=e=>y.isTypeCategory(e.type)?new w({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,options:e.options,validators:[],alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,isMultiSelection:e.isMultiSelection??!1,allowCustomOptions:e.allowCustomOptions,allowedCustomOptionTypes:e.allowedCustomOptionTypes,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration}):new y({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,validators:[],alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,outputFormat:e.outputFormat,inputFormat:e.inputFormat,numberFormat:e.numberFormat,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration})}};var S=class{static{this.serialize=e=>{let t={matching:[],detectedNumberFormats:e.detectedNumberFormats,columns:e.columns};return t.matching=e.matching.map(s=>({sheetColumn:s.sheetColumn,matchedDataModel:s.matchedDataModel?{dataModel:s.matchedDataModel.dataModel?C.serialize(s.matchedDataModel.dataModel):s.matchedDataModel.dataModel,matchedOptions:s.matchedDataModel.matchedOptions}:s.matchedDataModel})),[t,[]]}}static{this.deserialize=e=>({matching:e.matching.map(t=>({sheetColumn:t.sheetColumn,matchedDataModel:t.matchedDataModel?{dataModel:t.matchedDataModel.dataModel?C.deSerialize(t.matchedDataModel.dataModel):t.matchedDataModel.dataModel,matchedOptions:t.matchedDataModel.matchedOptions}:t.matchedDataModel})),detectedNumberFormats:e.detectedNumberFormats,columns:e.columns})}};q.transferHandlers.set("Matching",{canHandle:n=>!!(n!==null&&typeof n=="object"&&n.matching),serialize:n=>S.serialize(n),deserialize:n=>S.deserialize(n)});export{f as a,z as b,E as c,Je as d,Ke as e,ze as f,Le as g,$e as h,Ee as i,pt as j,C as k};
|
|
1
|
+
import{d as F,i as y,j as c,r as w}from"./chunk-RHL57REG.js";import{B as J,C as P,d as O,k as A,m as T}from"./chunk-TS3BDFZ6.js";import{b as p}from"./chunk-REPANPD5.js";import{isEmpty as Q,uniq as X}from"lodash";var H=0,I=class{constructor({sheet:e,columnKey:t,rows:s,id:o,label:r,refJoinSheetColum:a}){this.removed=!1;this.label="";this.rawRowsBeforeDateParse=null;this.dateRowsByInputFormat=new Map;this.getColumnKey=()=>this.columnKey;this.getId=()=>this.id;this.getSheet=()=>this.sheet;this.getRows=()=>this.rows;this.getUniqueRows=()=>(this.uniques===void 0&&(this.uniques=X(this.getRows())),this.uniques);this.remove=()=>{this.removed=!0};this.unRemove=()=>{this.removed=!1};this.isRemoved=()=>this.removed;this.getType=()=>0;this.getFileName=()=>this.sheet.getSheetFileName();this.toJSON=()=>({columnKey:this.columnKey,id:this.id,rows:this.rows,type:this.getType()});this.equal=e=>this.getId()===e.getId();this.keyEqual=e=>this.columnKey===e.columnKey;this.setIndex=e=>{this.index=e};this.getIndex=()=>this.index;this.normalizeInputFormatKey=e=>{let t=typeof e=="string"?e.trim():"";return t!==""?t:null};this.dateInputFormatCacheKey=e=>this.normalizeInputFormatKey(e)??"\0auto";this.needsDateFormatParse=e=>!this.dateRowsByInputFormat.has(this.dateInputFormatCacheKey(e));this.hasParsedDateForInputFormat=e=>!this.needsDateFormatParse(e);this.getParsedRowsForInputFormat=e=>this.dateRowsByInputFormat.get(this.dateInputFormatCacheKey(e));this.getRowsForDateInputFormatParse=()=>this.rawRowsBeforeDateParse??this.rows;this.applyDateInputFormatParse=(e,t)=>{let s=this.getRowsForDateInputFormatParse();if(e.length!==s.length)throw new Error(`SheetColumn.applyDateInputFormatParse: parsed row count (${e.length}) must match source row count (${s.length}) for column "${this.columnKey}".`);this.dateRowsByInputFormat.set(this.dateInputFormatCacheKey(t),e)};this.getRefJoinSheetColum=()=>this.refJoinSheetColum;this.columnKey=t.trim(),this.sheet=e,Object.defineProperty(this,"sheet",{value:e,enumerable:!1,writable:!0,configurable:!0}),this.rows=Q(s)?[""]:s,this.rawRowsBeforeDateParse=[...this.rows],typeof o>"u"?(H++,this.id=`${t}-${H}`):this.id=o,r&&(this.label=r),Object.defineProperty(this,"refJoinSheetColum",{value:a,enumerable:!1,writable:!0,configurable:!0})}setRows(e){this.rows=e,this.uniques=void 0}},f=I;var b=class extends f{constructor({sheet:t,sheetColumns:s,rows:o,id:r,columnKey:a}){super({columnKey:a,rows:o,sheet:t,id:r});this.getType=()=>1;this.getJoinedSheetColumns=()=>this.sheetColumns;this.toJSON=()=>({columnKey:this.columnKey,id:this.id,rows:this.rows,sheetColumns:this.sheetColumns.map(t=>t.toJSON()),type:this.getType()});this.sheetColumns=s}},B=b;var _=["?",",","@"];import{isNaN as ee,minBy as te,isString as se,isEqual as oe,isEmpty as L,isNil as re}from"lodash";var x=class{constructor({sheets:e,filename:t,type:s,fileSize:o}){this.globalNumberFormat="eu";this.columnsNumberFormat=[];this.addSheet=e=>{this.sheets.push(e)};this.isSelected=()=>{for(let e=0;e<this.sheets.length;e++)if(this.sheets[e].isSelected())return!0;return!1};this.getSheets=()=>this.sheets;this.getSelectedSheets=()=>this.sheets.filter(e=>e.isSelected());this.getFilename=()=>this.filename;this.selectAllSheet=e=>this.sheets.forEach(t=>{t.setSelected(e)});this.getType=()=>this.type;this.getFileSize=()=>{let e=this.fileSize/1e6;return Number(parseFloat(`${e}`).toFixed(4))};this.sheets=e,this.filename=t,this.type=s,this.fileSize=o??0,this.sheets.forEach(r=>{r.setSpreadSheet(this)})}setNumberFormat(e){this.globalNumberFormat=e.global,this.columnsNumberFormat=e.columns}getNumberFormat(){return{global:this.globalNumberFormat,columns:this.columnsNumberFormat}}},z=x;var $=0,R=class{constructor({data:e,name:t,isNotSetColumn:s,id:o}){this.selected=!1;this.isManualSelectHeader=!1;this.columns=[];this.columnsInitialized=!1;this.headerRowIndex=0;this.transposed=!1;this.headerRowIndexes=[];this.addedColumns=[];this.usedSourceCells=new Set;this.mergedHeadersActive=!1;this.mergedRowsBackup=null;this.availableRows=null;this.spreadSheet=new z({filename:"",sheets:[],type:"xlsx",fileSize:0});this.getId=()=>this.id;this.setSpreadSheet=e=>{this.spreadSheet=e};this.getSpreadSheet=()=>this.spreadSheet;this.setSelected=e=>{this.selected=e};this.isSelected=()=>this.selected;this.setHeaderRowIndex=e=>{this.headerRowIndex=e,this.columnsInitialized=!1,this.mergedHeadersActive||(this.headerRowIndexes=[e])};this.setTransposed=e=>{this.transposed=e};this.getTransposed=()=>this.transposed;this.setHeaderRowIndexes=e=>{this.headerRowIndexes=[...e]};this.getHeaderRowIndexes=()=>this.headerRowIndexes.length>0?this.headerRowIndexes:[this.headerRowIndex];this.addAddedColumn=e=>{if(this.addedColumns.push(e),e.sourceCell){let o=`${e.sourceCell.row},${e.sourceCell.col}`;this.usedSourceCells.add(o)}let t=this.data[this.headerRowIndex],s=this.data.length>0?Math.max(...this.data.map(o=>o.length)):0;t&&t.push(e.columnName);for(let o=0;o<this.data.length;o++)if(o!==this.headerRowIndex){for(;this.data[o].length<s;)this.data[o].push("");o<this.headerRowIndex?this.data[o].push(""):this.data[o].push(e.value)}this.setColumns()};this.removeAddedColumn=e=>{let s=(this.data[this.headerRowIndex]?.length||0)-this.addedColumns.length,o=e-s;if(o<0||o>=this.addedColumns.length)return;let r=this.addedColumns[o];if(r?.sourceCell){let a=`${r.sourceCell.row},${r.sourceCell.col}`;this.usedSourceCells.delete(a)}for(let a=0;a<this.data.length;a++)this.data[a].splice(e,1);this.addedColumns.splice(o,1),this.setColumns()};this.removeColumnFromData=e=>{if(!(e<0))for(let t=0;t<this.data.length;t++)this.data[t].length>e&&this.data[t].splice(e,1)};this.clearAddedColumns=()=>{if(this.addedColumns.length>0){let t=(this.data[this.headerRowIndex]?.length||0)-this.addedColumns.length;for(let s=this.addedColumns.length-1;s>=0;s--){let o=t+s;for(let r=0;r<this.data.length;r++)this.data[r].length>o&&this.data[r].splice(o,1)}}this.addedColumns=[],this.usedSourceCells.clear(),this.setColumns()};this.isSourceCellUsed=(e,t)=>{let s=`${e},${t}`;return this.usedSourceCells.has(s)};this.getAddedColumnBySourceCell=(e,t)=>this.addedColumns.find(s=>s.sourceCell&&s.sourceCell.row===e&&s.sourceCell.col===t);this.getAddedColumns=()=>this.addedColumns;this.setMergedHeadersActive=e=>{this.mergedHeadersActive=e};this.isMergedHeadersActive=()=>this.mergedHeadersActive;this.setMergedRowsBackup=e=>{this.mergedRowsBackup=e};this.getMergedRowsBackup=()=>this.mergedRowsBackup;this.setAvailableRows=e=>{this.availableRows=e};this.getAvailableRows=()=>this.availableRows;this.isLoneWhitelistCharacter=e=>{let t=e.toString()?.trim()??"";return _.some(s=>t===s)};this.isSignificantCell=e=>!L(e)&&!this.isLoneWhitelistCharacter(e);this.collapseAdjacentDuplicates=e=>e.filter((t,s)=>s===0||`${t}`!=`${e[s-1]}`);this.getSignificantCells=e=>{let t=(e??[]).filter(this.isSignificantCell);return this.collapseAdjacentDuplicates(t)};this.getDataTransform=()=>this.data.map((e,t)=>({data:e,index:t,length:this.getSignificantCells(e).length}));this.getMaxLengthColumns=()=>this.getDataTransform().reduce((t,s)=>Math.max(t,s.length),0);this.isHeaderLikeCell=e=>!F.includes(se(e)?e.toLowerCase():e)&&ee(Number(e));this.countHeaderLikeCells=e=>this.getSignificantCells(e).filter(this.isHeaderLikeCell).length;this.setHeaderByAutoDetection=()=>{let t=this.getMaxLengthColumns(),s=this.getDataTransform().slice(0,50).filter(r=>r.length===t&&this.countHeaderLikeCells(r.data)===t),o=s.length===1?s[0].index:te(s,r=>r.length)?.index??0;this.setHeaderRowIndex(o)};this.getHeaderRowIndex=()=>this.headerRowIndex;this.getHeaderRow=()=>this.data[this.headerRowIndex]?.filter(e=>!!e);this.getColumns=()=>(this.ensureColumnsBuilt(),this.columns.filter(e=>!e.isRemoved()));this.getSortedColumns=()=>[...this.getColumns()].sort((e,t)=>p(e.getColumnKey())<p(t.getColumnKey())?-1:p(e.getColumnKey())>p(t.getColumnKey())?1:0);this.getColumnsWithRemoved=()=>(this.ensureColumnsBuilt(),this.columns.filter(e=>e.getType()!==1));this.getColumn=(e,t)=>(this.ensureColumnsBuilt(),this.columns.find(s=>t?p(s.getColumnKey())===p(`${e}`):s.getColumnKey()===e));this.getColumnsByKey=(e,t)=>(this.ensureColumnsBuilt(),this.columns.filter(s=>t?p(s.getColumnKey())===p(`${e}`):s.getColumnKey()===e));this.getValues=()=>{let e=this.data.filter((s,o)=>o>this.headerRowIndex);if(L(e))return[[]];let t=[];for(let s=0;s<e.length;s++){let o=[];for(let r=0;r<this.data[this.headerRowIndex].length;r++)re(this.data[this.headerRowIndex][r])||o.push(this.parseValue(e[s][r]));t.push(o)}return t};this.getData=()=>this.data;this.getName=()=>this.name;this.getDisplayName=({t:e})=>{if(this.getName()?.length>0)return this.getName();switch(this.spreadSheet.getType()){case"json":return`${e("txt_default_sheet_prefix_name")} 1`;case"csv":return`${e("txt_default_sheet_prefix_name")} 1`;default:return""}};this.getSheetFileName=()=>`${this.spreadSheet.getFilename()}`;this.getIsManualSelectHeader=()=>this.isManualSelectHeader;this.setIsManualSelectHeader=()=>{this.isManualSelectHeader=!0};this.clearIsManualSelectHeader=()=>{this.isManualSelectHeader=!1};this.addColumn=e=>{this.ensureColumnsBuilt(),this.columns.push(new f({columnKey:`${e}`,sheet:this,rows:this.getRowsByColumnIndex(this.getColumnIndex(e))}))};this.removeColumn=e=>{this.ensureColumnsBuilt(),this.columns.find(t=>t.getColumnKey()===e)?.remove()};this.removeColumnByIndex=e=>{this.ensureColumnsBuilt(),this.columns.find((t,s)=>s===e)?.remove()};this.setData=e=>{this.data=e};this.toJSON=()=>({name:this.name,id:this.id,type:this.getType(),values:this.getValues(),headerRow:this.getHeaderRow()});this.equal=e=>this.id===e.getId();this.getType=()=>0;this.getRowsByColumnIndex=e=>{if(e===-1)return[];let t=[];for(let s=0;s<this.data.length;s++){let o=this.data[s];if(s>this.headerRowIndex){let r=o[e]??"";t.push(this.parseValue(r))}}return t};this.ensureColumnsBuilt=()=>{this.columnsInitialized||this.setColumns()};this.setColumns=()=>{let e=this.data[this.headerRowIndex];if(e){let t=[];for(let s=0;s<e.length;++s){let o=e[s];o&&t.push(new f({columnKey:`${o}`,sheet:this,rows:this.getRowsByColumnIndex(s)}))}this.columns=t}else this.columns=[];this.columnsInitialized=!0};this.getColumnIndex=e=>this.data[this.headerRowIndex].findIndex(o=>oe(`${o}`,`${e}`));this.parseValue=e=>typeof e=="string"?e.trim():e;this.data=e,this.name=t,typeof o>"u"?($++,this.id=`${t}-${$}`):this.id=o,this.columnsInitialized=!!s}},E=R;var V=class extends E{constructor({joinedData:t,sheets:s,mappings:o,mappingIndexes:r}){super({data:t.data,name:"join-sheet",isNotSetColumn:!0});this.sheets=[];this.joinHistory=[];this.findRefJoinSheetColumn=t=>{let s=this.sheets.length===2?this.sheets[0]:this,o=this.sheets[this.sheets.length-1];if(t<s.getColumns().length)return s.getColumns()[t];let r=t-s.getColumns().length;return o.getColumns().filter((a,l)=>this.joinHistory[this.joinHistory.length-1].mappingIndexes.every(i=>i.target!==l))[r]};this.setJoinColumns=(t,s)=>{let o=this.data[this.headerRowIndex];if(!o){this.columns=[];return}let r=[];for(let a=0;a<o.length;++a){let l=o[a],i=s.findIndex(u=>u.source===a),h=this.columns[a]&&this.columns[a].getType()===1;if(i>=0||h){let u=t[i],d;h&&i>=0?d=[...this.columns[a].getJoinedSheetColumns(),u.target]:h?d=this.columns[a].getJoinedSheetColumns():d=[u.source.getRefJoinSheetColum()??u.source,u.target],r.push(new B({columnKey:`${l}`,sheetColumns:d,sheet:this,rows:this.getRowsByColumnIndex(a)}))}else{let u=this.columns[a]?this.columns[a].getRefJoinSheetColum()??this.columns[a]:this.findRefJoinSheetColumn(a);r.push(new f({columnKey:`${l}`,sheet:u.getSheet(),rows:this.getRowsByColumnIndex(a),refJoinSheetColum:u}))}}this.columns=r};this.getJoinedSheets=()=>this.sheets;this.getType=()=>1;this.joinSheet=(t,s,o,r)=>{this.setData(t.data),this.sheets.push(s),this.joinHistory.push({mappingIndexes:r,type:t.type,row:t.data.length,col:this.data[this.headerRowIndex]?.length??0}),this.setJoinColumns(o,r)};this.getJoinColumns=()=>this.columns.filter(t=>t.getType()===1);this.getJoinHistory=()=>this.joinHistory;this.headerRowIndex=0,this.joinHistory.push({mappingIndexes:r,type:t.type,row:t.data.length,col:this.data[this.headerRowIndex]?.length??0}),this.sheets=s,this.setJoinColumns(o,r)}},Je=V;var j=({rowA:n,rowB:e},t)=>t.every(s=>{let o=`${n[s.source]??""}`,r=`${e[s.target]??""}`;return o===r&&o!==""&&r!==""}),ae=(n,e,t)=>{let s=[],o=n.headerRow,r=e.headerRow;for(let a=0;a<o.length;++a)s.push(o[a]);for(let a=0;a<r.length;++a)t.every(l=>l.target!==a)&&s.push(r[a]);return s},Ke=async(n,e)=>{let t=n.values,s=e.values,o=n.headerRow,r=e.headerRow,a=[...o,...r],l=[];l.push(a);for(let i=0;i<t.length;++i)l.push([...t[i],...s[0]]);return{data:l,type:"ADD_TO_ALL_ROWS"}},ze=async(n,e)=>{let t=n.values,s=e.values,o=n.headerRow,r=e.headerRow,a=[...o,...r],l=[];l.push(a);for(let i=0;i<t.length;++i)l.push([...t[i],...r.map(()=>"")]);for(let i=0;i<s.length;++i)l.push([...o.map(()=>""),...s[i]]);return{data:l,type:"JOIN_WITHOUT_COLUMNS"}},Le=async(n,e,t)=>{let s=n.values,o=e.values,r=[],a=[],l={},i=ae(n,e,t);r.push(i);for(let h=0;h<s.length;++h){let u=!1,d=s[h];for(let m=0;m<o.length;++m){let g=o[m];j({rowA:d,rowB:g},t)&&(l[m]=!0,u=!0,r.push([...d,...g.filter((M,Y)=>t.every(G=>G.target!==Y))]))}u||a.push([...d,...e.headerRow.filter((m,g)=>t.every(M=>M.target!==g)).map(()=>"")])}for(let h=0;h<o.length;++h){if(l[h])continue;let u=o[h],d=n.headerRow.map(()=>"");t.forEach(m=>{d[m.source]=u[m.target]}),a.push([...d,...u.filter((m,g)=>t.every(M=>M.target!==g))])}return a.forEach(h=>{r.push(h)}),{data:r,type:"JOIN_ON_COLUMNS"}},$e=async(n,e,t)=>{let s=e.headerRow.filter((l,i)=>t.every(h=>h.target!==i)),r=[[...n.headerRow,...s]];for(let l=0;l<n.values.length;++l){let i=[...n.values[l],...s.map(()=>"")];r.push(i)}let a=e.values;for(let l=0;l<a.length;++l){let i=n.headerRow.map(()=>""),h=[];for(let u=0;u<e.headerRow.length;++u){let d=t.find(m=>m.target===u);d?i[d.source]=a[l][u]:h.push(a[l][u])}r.push([...i,...h])}return{data:r,type:"APPEND_TO_COLUMNS"}},Ee=async(n,e,t)=>{let s=n.values,o=e.values,r=s.length+o.length,a=0,l={};for(let i=0;i<s.length;i++){let h=s[i],u=null,d=0;for(let m=0;m<o.length;m++){let g=o[m];if(j({rowA:h,rowB:g},t)&&(u=m,d++,d===2))break}d===1&&u!==null&&(a+=1,l[u]=!0)}for(let i=0;i<o.length;i++)l[i]&&(a+=1);return{count:a,total:r}};import{isNil as ie}from"lodash";var k=(n,e)=>{if(e.getType()!=="date")return c.parse(n,{dataModel:e});if(A(n))return null;let t=`${n}`,s=e.getInputFormat();return T(s)?O(t)?c.parse(t,{dataModel:e}):J(t,s)?c.parse(P([t],s)[0],{dataModel:e}):t:c.parse(t,{dataModel:e})};var N=class{constructor({sheetColumn:e,matchedDataModel:t,detectedNumberFormats:s}){this.parseSheetValue=(e,t)=>t.dataModel.getType()==="date"?k(e,t.dataModel):c.parse(e,t);this.getOptionValue=(e,t)=>{if(!t)if(this.matchedDataModel.dataModel){let s=this.sheetColumn.columnKey,r=this.detectedNumberFormats.columns.find(a=>a.column===s)?.numberFormat||this.detectedNumberFormats.global;return this.parseSheetValue(e,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0,numberFormat:r})}else return e;for(let s=0;s<t.length;s++)if(`${t[s]?.sheetOption}`==`${e}`){let o=!ie(t[s]?.dataModelOptions)&&(t[s]?.dataModelOptions?.length??0)>0;if(t[s]?.autoPreserved===!0&&t[s]?.dataModelOption==null&&!o){if(this.matchedDataModel.dataModel instanceof w){let r=`${e}`,a=this.matchedDataModel.dataModel.getOptions().find(l=>l.label===r||l.value===r);if(a)return c.parse(a.value,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0})}return e}return this.matchedDataModel.dataModel&&this.matchedDataModel.dataModel.getIsMultiSelection()?c.parse(t[s]?.dataModelOptions,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0}):this.matchedDataModel.dataModel?c.parse(t[s]?.dataModelOption,{dataModel:this.matchedDataModel.dataModel,isParseFromSheet:!0}):t[s]?.dataModelOption}};this.getValues=()=>{let e=this.sheetColumn.rows,t=[];for(let s=0;s<e.length;s++){let o=e[s],r=this.getOptionValue(o,this.matchedOptions);t.push(r)}return t};if(this.sheetColumn=e,this.matchedDataModel=t,this.matchedOptions=void 0,this.detectedNumberFormats=s||{global:"eu",columns:[]},this.matchedDataModel.matchedOptions){this.matchedOptions=[];for(let o=0;o<(this.matchedDataModel.matchedOptions?.length??0);o++){let r=this.matchedDataModel.matchedOptions[o];this.matchedDataModel.dataModel?.getIsMultiSelection()?r.dataModelOptions&&this.matchedOptions.push(r):r.dataModelOption!==void 0&&r.dataModelOption!==null?this.matchedOptions.push(r):r.autoPreserved===!0&&!r.userCleared&&this.matchedOptions.push(r)}}}},U=N;var v=class{constructor(e){this.matchedColumns=[];this.parseValues=()=>{let e=[];this.matchedColumns.forEach(t=>{let s=t.matchedDataModel,r=new U({sheetColumn:t.sheetColumn,matchedDataModel:s,detectedNumberFormats:this.detectedNumberFormats}).getValues(),a=s.dataModel.getKey();r.forEach((l,i)=>{e[i]?e[i][a]=l:e[i]={[a]:l}})});for(let t=0;t<e.length;++t)for(let s=0;s<this.columns.length;++s){let r=this.columns[s].key;e[t][r]===void 0&&(e[t][r]=null)}return e};this.getValues=()=>(this.matchedColumns=[],this.matching.filter(t=>t.matchedDataModel?.dataModel).forEach(t=>{this.matchedColumns.push({sheetColumn:t.sheetColumn,matchedDataModel:t.matchedDataModel})}),this.parseValues());let{matching:t,detectedNumberFormats:s}=e;this.matching=t,this.detectedNumberFormats=s||{global:"eu",columns:[]},this.columns=e.columns??[]}},W=v;var pt=({matching:n,detectedNumberFormats:e,columns:t})=>new W({matching:n,detectedNumberFormats:e,columns:t}).getValues();import*as q from"comlink";var C=class{static{this.serialize=e=>e.serialize()}static{this.deSerialize=e=>y.isTypeCategory(e.type)?new w({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,options:e.options,validators:[],alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,isMultiSelection:e.isMultiSelection??!1,allowCustomOptions:e.allowCustomOptions,allowedCustomOptionTypes:e.allowedCustomOptionTypes,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration}):new y({description:e.description,example:e.example,key:e.key,label:e.label,type:e.type,validators:[],alternativeMatches:e.alternativeMatches,columnSize:e.columnSize,outputFormat:e.outputFormat,inputFormat:e.inputFormat,numberFormat:e.numberFormat,hidden:e.hidden,disabled:e.disabled,optionMappingConfiguration:e.optionMappingConfiguration})}};var S=class{static{this.serialize=e=>{let t={matching:[],detectedNumberFormats:e.detectedNumberFormats,columns:e.columns};return t.matching=e.matching.map(s=>({sheetColumn:s.sheetColumn,matchedDataModel:s.matchedDataModel?{dataModel:s.matchedDataModel.dataModel?C.serialize(s.matchedDataModel.dataModel):s.matchedDataModel.dataModel,matchedOptions:s.matchedDataModel.matchedOptions}:s.matchedDataModel})),[t,[]]}}static{this.deserialize=e=>({matching:e.matching.map(t=>({sheetColumn:t.sheetColumn,matchedDataModel:t.matchedDataModel?{dataModel:t.matchedDataModel.dataModel?C.deSerialize(t.matchedDataModel.dataModel):t.matchedDataModel.dataModel,matchedOptions:t.matchedDataModel.matchedOptions}:t.matchedDataModel})),detectedNumberFormats:e.detectedNumberFormats,columns:e.columns})}};q.transferHandlers.set("Matching",{canHandle:n=>!!(n!==null&&typeof n=="object"&&n.matching),serialize:n=>S.serialize(n),deserialize:n=>S.deserialize(n)});export{f as a,z as b,E as c,Je as d,Ke as e,ze as f,Le as g,$e as h,Ee as i,pt as j,C as k};
|