vue3-country-intl
Version:
A vue3-based mobile phone area code selection, nationality selection component(一个基于vue3的手机区号选择、国籍选择组件)
1 lines • 64.4 kB
JavaScript
"use strict";var e=require("vue");function t(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function o(e){for(var o=1;o<arguments.length;o++){var a=null!=arguments[o]?arguments[o]:{};o%2?t(Object(a),!0).forEach((function(t){n(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):t(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function n(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}for(var i=["阿富汗","阿尔巴尼亚","阿尔及利亚","美属萨摩亚群岛","安道尔","安哥拉共和国","安圭拉","安提瓜岛","阿根廷","亚美尼亚","阿鲁巴","澳大利亚","奥地利共和国","阿塞拜疆共和国","巴哈马国","巴林王国","孟加拉人民共和国","巴巴多斯","白俄罗斯共和国","比利时王国 (België)","伯利兹","贝宁共和国 (Bénin)","百慕大群岛","不丹王国","玻利维亚国","波斯尼亚和黑塞哥维那","博茨瓦纳","巴西联邦共和国","英属印度洋领地","英属维尔京群岛","文莱达鲁萨兰国","保加利亚共和国","布基纳法索","布隆迪共和国","柬埔寨王国","喀麦隆共和国","加拿大","佛得角共和国","荷兰王国","开曼群岛","中非共和国","乍得共和国","智利共和国","中国","圣诞岛","科科斯群岛","哥伦比亚共和国","科摩罗联盟","刚果民主共和国","刚果共和国","库克群岛","哥斯达黎加共和国","科特迪瓦","克罗地亚共和国","古巴共和国","库拉索","塞浦路斯","捷克共和国","丹麦","吉布提共和国","多米尼克国","多米尼加共和国","厄瓜多尔","埃及","萨尔瓦","赤道几内亚","厄立特里亚","爱沙尼亚共和国","埃塞俄比亚","马尔维纳斯群岛","法罗群岛","斐济共和国","芬兰","法国","法属圭亚那","法属波利尼西亚","加蓬","冈比亚","格鲁吉亚","德国","加纳","直布罗陀","希腊","格陵兰","格林纳达","瓜德罗普岛","关岛","危地马拉","根西","几内亚","几内亚比绍共和国","圭亚那","海地","洪都拉斯","中国香港","匈牙利","冰岛","印度","印度尼西亚","地拉那","伊拉克共和国","爱尔兰","马恩岛","以色列国","意大利","牙买加","日本","泽西","约旦哈希姆王国","哈萨克斯坦共和国","肯尼亚","基里巴斯","科索沃","科威特国","吉尔吉斯共和国","老挝人民民主共和国","拉脱维亚共和国","黎巴嫩共和国","莱索托","利比里亚","利比亚","列支敦士登","立陶宛共和国","卢森堡","中國澳門","马其顿","马达加斯加共和国","马拉维","马来西亚","马尔代夫","马里","马耳他","马绍尔群岛共和国","马提尼克岛","毛里塔尼亚","毛里求斯","马约特","墨西哥","密克罗尼西亚","摩尔多瓦共和国","摩纳哥","蒙古","黑山共和国","蒙特塞拉特岛","摩洛哥","莫桑比克","缅甸联邦共和国","纳米比亚","瑙鲁","尼泊尔","荷兰","新喀里多尼亚","新西兰","尼加拉瓜","尼日尔","尼日利亚","纽埃","诺福克岛","朝鲜 (조선 민주주의 인민 공화국)","北马里亚纳群岛","挪威","阿曼苏丹国","巴基斯坦","帕劳共和国","巴勒斯坦国","巴拿马","巴布亚新几内亚独立国","巴拉圭","秘鲁","菲律宾共和国","波兰","葡萄牙","波多黎各岛","卡塔尔国","留尼旺岛","罗马尼亚","俄罗斯","卢旺达","圣巴托洛缪岛","圣海伦娜岛","圣基茨和尼维斯联邦","圣卢西亚","圣马丁岛","圣皮埃尔岛和密克隆岛","圣文森特和格林纳丁斯","西萨摩亚","圣马利诺","圣多美和普林西比民主共和国 (São Tomé e Príncipe)","沙特阿拉伯王国","塞内加尔","塞尔维亚共和国","塞舌尔","塞拉利昂共和国","新加坡","圣马丁岛","斯洛伐克共和国","斯洛文尼亚","所罗门群岛","索马里","南非","韩国","南苏丹共和国","西班牙","斯里兰卡","苏丹","苏里南","斯瓦尔巴群岛","斯威士兰","瑞典","瑞士","阿拉伯叙利亚共和国","中国台灣","塔吉克斯坦共和国","坦桑尼亚","泰国","东帝汶民主共和国","多哥","托克劳群岛","汤加","特立尼达和多巴哥共和国","突尼斯","土耳其","土库曼斯坦","特克斯和凯科斯群岛","图瓦卢","美属维尔京群岛","乌干达共和国","乌克兰","阿拉伯联合酋长国","大不列颠联合王国","美国","乌拉圭","乌兹别克斯坦共和国","瓦努阿图","梵蒂冈","委内瑞拉","越南","瓦利斯群岛和富图纳群岛","阿拉伯撒哈拉民主共和国","也门共和国","赞比亚","津巴布韦","奥兰群岛","南极洲","布维岛","南乔治亚和南桑威奇群岛","赫德岛和麦克唐纳群岛","皮特凯恩群岛","法属南部和南极领地","美国本土外小岛屿"],r=[["Afghanistan (افغانستان)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (الجزائر)","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1242"],["Bahrain (البحرين)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1246"],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1441"],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros (جزر القمر)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (مصر)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["Gibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (中国香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (ایران)","ir","98"],["Iraq (العراق)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel (ישראל)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan (日本)","jp","81"],["Jersey","je","44",3],["Jordan (الأردن)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (الكويت)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (لبنان)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (ليبيا)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (中國澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (موريتانيا)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1664"],["Morocco (المغرب)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman (عُمان)","om","968"],["Pakistan (پاکستان)","pk","92"],["Palau","pw","680"],["Palestine (فلسطين)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (قطر)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (المملكة العربية السعودية)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (جنوب السودان)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්රී ලංකාව)","lk","94"],["Sudan (السودان)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Sweden (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (سوريا)","sy","963"],["Taiwan (中国台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia (تونس)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (الإمارات العربية المتحدة)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna (Wallis-et-Futuna)","wf","681"],["Western Sahara (الصحراء الغربية)","eh","212",1],["Yemen (اليمن)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1],["Antarctica","aq","672"],["Bouvet Island","bv","47"],["South Georgia and the South Sandwich Islands","gs","500"],["Heard Island and McDonald Islands","hm","672"],["Pitcairn","pn","64"],["French Southern Territories","tf","262"],["United States Minor Outlying Islands","um","1"]],s=0;s<r.length;s++){var u=r[s];r[s]={name:u[0],nameCN:i[s],iso2:u[1],dialCode:u[2],priority:u[3]||0,areaCodes:u[4]||null}}var d=r,c={modelValue:{type:[String,Number],default:""},type:{type:String,default:"phone"},iso2:{type:String,default:""},listZIndex:{type:Number,default:0},maxHeight:{type:Number,default:0},searchText:{type:[String,Number],default:""},showAreaCode:{type:Boolean,default:!0},selectedText:{type:String,default:"Selected"},showSelectedText:{type:Boolean,default:!0},searchAble:{type:Boolean,default:!0},disableCountry:{type:[String,Array],default:function(){return[]}},onlyCountry:{type:[String,Array],default:function(){return[]}},noDataText:{type:String,default:"未找到任何数据!"},useChinese:{type:Boolean,default:!1},sort:{type:Function,default:null},filter:{type:Function,default:null},transform:{type:Function,default:null},name:{type:String}};function f(e,t){var o=t.slots.default,n=e.outSlots,a=e.slotData,l=(n=n||{})[e.slotName];return l?l(a):o?o(a):void 0}f.props=["outSlots","slotData","slotName"];var h="update:modelValue",p="update:visible",m="onChange";function v(e,t){if(e===t)return!1;if(!e)return!1;if("function"==typeof e.contains)return e.contains(t);for(;;){if(!t)return!1;if(t===e)return!0;t=t.parentNode}return!1}function y(e,t,o,n){var a=e;if(0==(a+"").length)return{};var l="phone"===t.toLowerCase();"+"===(a+"").charAt(0)&&(a=a.substr(1));var i=n.filter((function(e){return l?o?e.iso2==o:e.dialCode==a||(1==e.dialCode&&e.areaCodes?e.areaCodes.some((function(e){return e==a})):void 0):e.iso2==a}));return i=i&&0!==i.length&&i[0]||{}}function g(e,t){if(!e||0==e.length||!t||"function"!=typeof t)return-1;if(e.findIndex)return e.findIndex(t);for(var o=e.length,n=0,a=-1;n<o;n++){if(!0===t(e[n],a,e)){a=n;break}}return a}function b(e,t){if(e&&e.nodeName){if(t){var o="";window.getComputedStyle?o=window.getComputedStyle(e,null)[t]:e.currentStyle&&(o=e.currentStyle[t]);var n=parseFloat(o);return isNaN(n)?o:n}console.error("cssAttribute 必须是一个字符串")}else console.error("ele 必须是一个dom元素")}function w(e){return e&&1==e.nodeType?function(e){var t={vertical:!1,horizontal:!1};if(!(e instanceof HTMLElement))return t;var o=["hidden","visible"];if(e.scrollTop>0)t.vertical=!0;else{var n=b(e,"overflow-y");t.vertical=!o.includes(n)&&e.scrollHeight>e.clientHeight}if(e.scrollLeft>0)t.horizontal=!0;else{var a=b(e,"overflow-x");t.horizontal=!o.includes(a)&&e.scrollWidth>e.clientWidth}return t}(e):{vertical:document.body.scrollHeight>window.innerHeight,horizontal:document.body.scrollWidth>window.innerWidth}}var C={name:"CountryList",props:o(o({},c),{},{rootSlots:{type:Object,default:function(){return{}}}}),components:{SlotRender:f},emits:[h,m],setup:function(t,o){var n=e.reactive({item:{}}),l=e.ref(""),i=e.computed((function(){var e=t.searchText||"",o=a(d),n="string"==typeof t.disableCountry?t.disableCountry.split(","):t.disableCountry,l="string"==typeof t.onlyCountry?t.onlyCountry.split(","):t.onlyCountry,i=t.sort,r=t.filter,s=t.transform;if(l.length>0&&(o=o.filter((function(e){return g(l,(function(t){var o=t+"";return"+"===o.charAt(0)&&(o=o.replace("+","")),e.name===t||e.nameCN===t||e.dialCode===o||e.iso2===t}))>-1}))),n.length>0&&(o=o.filter((function(e){return-1===g(n,(function(t){var o=t+"";return"+"===o.charAt(0)&&(o=o.replace("+","")),e.name===t||e.nameCN===t||e.dialCode===o||e.iso2===t}))}))),"function"==typeof r&&(o=o.filter(r)),"function"==typeof i&&o.sort(i),"function"==typeof s&&(o=s(o)),!t.searchAble||0===e.length)return o;return e=(e=e.replace("+","\\+")).replace("台湾","台灣").replace("臺灣","台灣").replace("澳门","澳門"),o=o.filter((function(t){var o=new RegExp(e,"gi"),n=o.test(t.name),a=o.test(t.nameCN);return!(!n&&!a)||(!!o.test(t.dialCode)||(!!o.test(t.iso2)||t.areaCodes&&t.areaCodes.some((function(t){return e.search(t)>-1}))))}))})),r=e.watch((function(){return t.modelValue}),(function(){if(l.value!=t.modelValue){var e=y(t.modelValue,t.type,t.iso2,i.value);if(e&&e!==n.item){n.item=e,l.value=t.modelValue;var a="";a="phone"===t.type.toLowerCase()?1==e.dialCode&&e.areaCodes?e.areaCodes[0]:e.dialCode||"":e.iso2||"",o.emit("onChange",e,a)}}}),{immediate:!0});return e.onMounted((function(){"phone"==t.type&&0==(t.iso2+"").length&&console.warn("当type=phone时最好传递iso2属性,否则当区号代码为212或358时会出现选择不正确问题!")})),e.onUnmounted((function(){r()})),{selected:n,countryList:i,clear:function(){o.emit("update:modelValue",""),o.emit("onChange",{},"")},areaCodeView:function(e,t){if(1==e&&t.areaCodes){var o=t.areaCodes.slice(0,5);return t.areaCodes[0]+" [".concat(o.join(", "),"]")}return e},countryItemClickEvt:function(e){(e=e||window.event).stopPropagation?e.stopPropagation():e.cancelBubble=!0;var a,r=e.target;if(!t.justRead){for(;r&&"LI"!==r.nodeName;)r=r.parentElement;if(r){e.currentTarget;for(var s=r.getAttribute("data-iso"),u=0,d=i.value.length;u<d;u++)if(i.value[u].iso2==s){a=i.value[u];break}if(a){n.item=a;var c="";c="phone"===t.type.toLowerCase()?1==a.dialCode&&a.areaCodes?a.areaCodes[0]:a.dialCode||"":a.iso2||"",l.value=c,o.emit("update:modelValue",c),o.emit("onChange",a,c)}}}}}}},S=["data-index","data-iso"],T={class:"vue-country-name"},x={class:"selected-text"},V={class:"vue-country-no-data"};C.render=function(t,o,n,a,l,i){var r=e.resolveComponent("SlotRender");return e.openBlock(),e.createElementBlock("div",{class:"vue-country-list-wrap",style:e.normalizeStyle({"z-index":0!=t.listZIndex?t.listZIndex:"","max-height":t.maxHeight>0?t.maxHeight+"px":""})},[e.createElementVNode("ul",{class:"vue-country-list",onMousedown:o[0]||(o[0]=function(){return a.countryItemClickEvt&&a.countryItemClickEvt.apply(a,arguments)})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.countryList,(function(o,l){return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["vue-country-item",{selected:o.iso2===a.selected.item.iso2}]),key:o.iso2+l,"data-index":l,"data-iso":o.iso2},[e.createVNode(r,{"slot-name":"countryItem","out-slots":n.rootSlots,"slot-data":o},{default:e.withCtx((function(){return[e.createElementVNode("span",{class:e.normalizeClass(["iti-flag",o.iso2])},null,2),e.createElementVNode("span",T,e.toDisplayString(t.useChinese?o.nameCN:o.name),1),e.withDirectives(e.createElementVNode("span",{class:"vue-country-areaCode"}," +"+e.toDisplayString(a.areaCodeView(o.dialCode,o)),513),[[e.vShow,t.showAreaCode]]),e.withDirectives(e.createElementVNode("span",x,[e.createVNode(r,{"slot-name":"selected","out-slots":n.rootSlots,"slot-data":o},{default:e.withCtx((function(){return[e.createTextVNode(e.toDisplayString(t.selectedText),1)]})),_:2},1032,["out-slots","slot-data"])],512),[[e.vShow,t.showSelectedText]])]})),_:2},1032,["out-slots","slot-data"])],10,S)})),128)),e.withDirectives(e.createElementVNode("li",V,[e.createVNode(r,{"slot-name":"emptyData","out-slots":n.rootSlots},{default:e.withCtx((function(){return[e.createTextVNode(e.toDisplayString(t.noDataText),1)]})),_:1},8,["out-slots"])],512),[[e.vShow,0===a.countryList.length]])],32)],4)},C.__file="src/components/country-list/CountryList.vue";const z=()=>{},B=e=>null!==e&&"object"==typeof e;var I=Object.defineProperty,E=Object.defineProperties,M=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,N=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable,O=(e,t,o)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,L=(e,t)=>{for(var o in t||(t={}))N.call(t,o)&&O(e,o,t[o]);if(k)for(var o of k(t))P.call(t,o)&&O(e,o,t[o]);return e},H=(e,t)=>E(e,M(t));function A(e){return"function"==typeof e}function W(e){return"string"==typeof e}function F(e){return W(e)?e.replace(/-(.)/g,(function(e,t){return t.toUpperCase()})):e}function D(e){return W(e)?e.replace(/(\w)([A-Z])/g,(function(e,t,o){return t+"-"+o.toLowerCase()})):e}function j(){var e=navigator.userAgent,t=e.indexOf("Android")>-1||e.indexOf("Linux")>-1,o=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return{android:t,ios:o,pc:!o&&!t}}function R(e){var t={top:0,left:0};if(!e||1!=e.nodeType)return t;var o=e.offsetParent;for(t.top=e.offsetTop,t.left=e.offsetLeft;null!=o;)t.top+=o.offsetTop,t.left+=o.offsetLeft,o=o.offsetParent;return t}function U(e){var t={vertical:!1,horizontal:!1};if(!(e instanceof HTMLElement))return t;var o=["hidden","visible"];if(e.scrollTop>0)t.vertical=!0;else{var n=$(e,"overflow-y");t.vertical=!o.includes(n)&&e.scrollHeight>e.clientHeight}if(e.scrollLeft>0)t.horizontal=!0;else{var a=$(e,"overflow-x");t.horizontal=!o.includes(a)&&e.scrollWidth>e.clientWidth}return t}function $(e,t){if(!e||!e.nodeName||!t)return;var o="";window.getComputedStyle?o=window.getComputedStyle(e,null)[t]:e.currentStyle&&(o=e.currentStyle[t]);let n=parseFloat(o);return isNaN(n)?o:n}function G(e){if(e)for(var t=e.parentElement;null!=t;){var o=U(t);if(o.vertical||o.horizontal)return t;t=t.parentElement}}function _(e){var t={x:0,y:0,z:0,rotate:0,scaleX:1,scaleY:1};if(!e||"none"==e)return t;var o=e.substring(6),n=o.match(/\(([^)]*)\)/),a=function(e){var t=Math.round(180*Math.asin(e[0])/Math.PI),o=Math.round(180*Math.acos(e[1])/Math.PI),n=Math.round(180*Math.asin(e[2])/Math.PI),a=Math.round(180*Math.acos(e[3])/Math.PI),l=0;return t==o||-t==o?l=a:-t+o==180?l=180+n:t+o==180&&(l=360-n||360-a),l>=360?0:l},l=n?n[1].split(","):o.split(",");return t.x=l.length>6?parseFloat(l[12]):parseFloat(l[4]),t.y=l.length>6?parseFloat(l[13]):parseFloat(l[5]),t.z=l.length>6?parseFloat(l[14]):0,t.rotate=l.length>6?a([parseFloat(l[0]),parseFloat(l[1]),parseFloat(l[4]),parseFloat(l[5])]):a(l),t.scaleX=parseFloat(l[0]),t.scaleY=parseFloat(l[3]),t}function K(e){return e&&1==e.nodeType?U(e):{vertical:document.body.scrollHeight>window.innerHeight,horizontal:document.body.scrollWidth>window.innerWidth}}function q(e){if(!e||1!=e.nodeType)return!1;for(var t=e.offsetParent,o=!1;null!=t&&!o;){if("fixed"===$(t,"position")){o=!0;break}t=t.offsetParent}return o}function Z(e){return e&&1==e.nodeType?e.scrollTop:window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0}function Y(e){return e&&1==e.nodeType?e.scrollLeft:window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0}function X(e){var t,o=document.createElement("div"),n={vertical:0,horizontal:0};return o.style.cssText="width: 200px;height: 200px",e&&1==e.nodeType?((t=e.cloneNode(!0)).style.cssText="width: 100px;height: 100px;opacity: 0;position:absolute;left: -100px;overflow:auto;",t.appendChild(o),document.body.appendChild(t),n.vertical=t.offsetWidth-t.clientWidth,n.horizontal=t.offsetHeight-t.clientHeight,document.body.removeChild(t),t=o=null,n):(n.vertical=window.innerWidth-document.documentElement.offsetWidth,n.horizontal=window.innerHeight-document.documentElement.clientHeight,n)}const J=/(\w+)End$/,Q=/(\w+)Center$/,ee=["HTML","BODY"];function te(e){let{ele:t,top:o,left:n,needSubtractScrollOffset:a,documentHasScroll:l,documentScrollInfo:i,bodyScrollVisible:r,referenceIsInFixedPosition:s,scrollParent:u,windowWH:d,targetIsInFixedPosition:c,targetIsInBody:f}=e,h=0,p=0,m=!0,v=!0;if(u&&!ee.includes(u.nodeName)){h=Z(u),p=Y(u);let e=o,d=n;s&&f&&(l.vertical&&!r.vertical&&(e-=i.top),l.horizontal&&!r.horizontal&&(d-=i.left));let c=function(e,t,o=0,n=0,a=!0){var l={horizontal:!0,vertical:!0};if(!e||!t)return l;var i=R(t),r=Z(t),s=Y(t),u=K(t),d=X(t),c={top:o,left:n};if(!o||!n){var f=R(e);o||(c.top=f.top),n||(c.left=f.left)}if(c.top-=r,c.left-=s,a){var h=Z(),p=Y();c.top-=h,c.left-=p,i.top-=h,i.left-=p}var m=i.left+t.offsetWidth-(u.vertical?d.vertical:0),v=i.top+t.offsetHeight-(u.horizontal?d.horizontal:0),y=c.left+e.offsetWidth,g=c.top+e.offsetHeight,b=c.left>=i.left&&c.left<m,w=y>i.left&&y<m,C=c.top>=i.top&&c.top<v,S=g>i.top&&g<v;return l.horizontal=b&&w,l.vertical=C&&S,l}(t,u,e,d,a);v=c.horizontal,m=c.vertical}if(!o||!n){var y=R(t);o||(o=y.top),n||(n=y.left)}c||(l.vertical&&(o-=i.top),l.horizontal&&(n-=i.left)),o-=h,n-=p;let g=t.offsetHeight+o,b=t.offsetWidth+n;l.vertical&&(d.width=d.width-X().vertical),l.horizontal&&(d.height=d.height-X().horizontal);let w=o>0&&o<d.height&&g>0&&g<=d.height,C=n>0&&n<d.width&&b>0&&b<=d.width,S=-1,T=-1;return w||(o<0?S=t.offsetHeight+o:g>d.height&&(S=g-d.height)),C||(n<0?T=t.offsetWidth+n:b>d.width&&(T=b-d.width)),{scrollParentHorizontal:v,scrollParentVertical:m,horizontalVisibleWidth:T,verticalVisibleHeight:S,vertical:w,horizontal:C}}function oe(e,t,o,n=!1,a=!0,l){if(!e||!t||!o)throw new Error("One of the parameters of referenceEl, targetEl, direction is missing!");let i=o=F(o),r=!1,s=!1;J.test(o)&&(o=RegExp.$1,r=!0),Q.test(o)&&(o=RegExp.$1,s=!0);let u={top:Z(),left:Y()};var d=R(e),c=q(e),f=q(t),h=e.getBoundingClientRect(),p=t.style.display,m=t.style.opacity,v=$(t,"display"),y="fixed"===$(t,"position");"none"===v&&(t.style.opacity="0",t.style.display="block");var g=!0;let b=t.offsetParent||document.body,w=!b||ee.includes(b.nodeName),C={top:0,left:0};w||(C=R(b));var S=$(document.body,"overflow-y"),T=$(document.body,"overflow-x");c&&(!y&&w&&("hidden"!=S&&(d.top=d.top+Z()),"hidden"!=T&&(d.left=d.left+Y())),!y&&!w&&(g=!0));let x=G(e),V=0,z=0;x&&!ee.includes(x.nodeName)&&(V=Z(x),z=Y(x));let B=ee.includes(b.nodeName),I=K(),E={vertical:!1,horizontal:!1};B&&(E={vertical:"hidden"!=S,horizontal:"hidden"!=T});let M=X(),k=j(),N={width:k.pc?window.innerWidth:Math.min(document.documentElement.clientWidth,window.innerWidth),height:k.pc?window.innerHeight:Math.min(document.documentElement.clientHeight,window.innerHeight)};var P=t.getBoundingClientRect(),O=_($(t,"transform"));P.width=Math.round(P.width/Math.abs(O.scaleX)),P.height=Math.round(P.height/Math.abs(O.scaleY));var A=(null==l?void 0:l.top)||0,W=(null==l?void 0:l.left)||0,D=null,U=[],oe=function(e,o){var n=d.top+h.height,a=e?Math.floor(d.left-(P.width-h.width)):d.left;!e&&o&&(a-=(P.width-h.width)/2);var l=null;n+=A,a+=W,B&&(I.vertical&&!E.vertical&&(n+=u.top),I.horizontal&&!E.horizontal&&(a+=u.left));var i=te({ele:t,top:n,left:a,needSubtractScrollOffset:g,bodyScrollVisible:E,targetIsInBody:B,referenceIsInFixedPosition:c,documentHasScroll:I,documentScrollInfo:u,scrollParent:x,windowWH:L({},N),targetIsInFixedPosition:f});n-=B?V:0,a-=B?z:0,B?(l=N.width-d.left+z-h.width,I.vertical&&E.vertical&&(l-=M.vertical),I.horizontal&&!E.horizontal&&(l-=u.left)):l=b.clientWidth-(d.left-C.left)-h.width;let r=n-C.top,s=a-C.left;return r-=A,s-=W,H(L({},i),{direction:!e&&o?"bottomCenter":e?"bottomEnd":"bottom",top:r,left:s,bottom:null,right:e?l:null})};let ne=function(e,o){var n=d.top-P.height,a=e?Math.floor(d.left-(P.width-h.width)):d.left;!e&&o&&(a-=(P.width-h.width)/2),n+=A,a+=W,B&&(I.vertical&&!E.vertical&&(n+=u.top),I.horizontal&&!E.horizontal&&(a+=u.left));var l=te({ele:t,top:n,left:a,needSubtractScrollOffset:g,bodyScrollVisible:E,targetIsInBody:B,referenceIsInFixedPosition:c,documentHasScroll:I,documentScrollInfo:u,scrollParent:x,windowWH:L({},N),targetIsInFixedPosition:f});n-=B?V:0,a-=B?z:0;var i=null,r=null;B?(i=N.height-d.top+V,r=N.width-d.left+z-h.width,I.vertical&&E.vertical&&(r-=M.vertical),I.horizontal&&!E.horizontal&&(r-=u.left),I.horizontal&&E.horizontal&&(i-=M.horizontal),I.vertical&&!E.vertical&&(i-=u.top)):(i=b.clientHeight-(d.top-C.top),r=b.clientWidth-(d.left-C.left)-h.width);let s=n-C.top,p=a-C.left;return s-=A,p-=W,H(L({},l),{direction:!e&&o?"topCenter":e?"topEnd":"top",bottom:i,right:e?r:null,top:s,left:p})},ae=function(e,o){var n=e?Math.floor(d.top-(P.height-h.height)):d.top,a=d.left-P.width;!e&&o&&(n-=(P.height-h.height)/2);var l=null,i=null;n+=A,a+=W,B?(I.vertical&&!E.vertical&&(n+=u.top),I.horizontal&&!E.horizontal&&(a+=u.left),e&&(l=N.height-(d.top+h.height)+V)):e&&(l=b.clientHeight-(d.top+h.height-C.top));var r=te({ele:t,top:n,left:a,needSubtractScrollOffset:g,bodyScrollVisible:E,targetIsInBody:B,referenceIsInFixedPosition:c,documentHasScroll:I,documentScrollInfo:u,scrollParent:x,windowWH:L({},N),targetIsInFixedPosition:f});n-=B?V:0,a-=B?z:0,B?(i=N.width-d.left+z,I.vertical&&E.vertical&&(i-=M.vertical),I.horizontal&&!E.horizontal&&(i-=u.left),e&&(I.horizontal&&E.horizontal&&(l-=M.horizontal),I.vertical&&!E.vertical&&(l-=u.top))):i=b.clientWidth-(d.left-C.left);let s=n-C.top,p=a-C.left;return s-=A,p-=W,H(L({},r),{right:i,bottom:l,direction:!e&&o?"leftCenter":e?"leftEnd":"left",top:s,left:p})},le=function(e,o){var n=e?Math.floor(d.top-(P.height-h.height)):d.top,a=d.left+h.width;!e&&o&&(n-=(P.height-h.height)/2),n+=A,a+=W,B&&(I.vertical&&!E.vertical&&(n+=u.top),I.horizontal&&!E.horizontal&&(a+=u.left));var l=null;e&&(l=B?N.height-(d.top+h.height)+V:b.clientHeight-(d.top+h.height-C.top));var i=te({ele:t,top:n,left:a,bodyScrollVisible:E,needSubtractScrollOffset:g,targetIsInBody:B,referenceIsInFixedPosition:c,documentHasScroll:I,documentScrollInfo:u,scrollParent:x,windowWH:L({},N),targetIsInFixedPosition:f});a-=B?z:0;let r=(n-=B?V:0)-C.top,s=a-C.left;return B&&e&&(I.vertical&&!E.vertical&&(l-=u.top),I.horizontal&&E.horizontal&&(l-=M.horizontal)),r-=A,s-=W,H(L({},i),{right:null,bottom:l,direction:!e&&o?"rightCenter":e?"rightEnd":"right",top:r,left:s})};switch(o){case"bottom":s&&U.push({isTail:!1,isCenter:!0,handler:oe}),U.push({isTail:r,handler:oe}),s&&U.push({isTail:!1,isCenter:!0,handler:ne}),U.push({isTail:r,handler:ne}),n&&(U.push({isTail:!1,handler:ae}),U.push({isTail:!1,handler:le}));break;case"top":s&&U.push({isTail:!1,isCenter:!0,handler:ne}),U.push({isTail:r,handler:ne}),s&&U.push({isTail:!1,isCenter:!0,handler:oe}),U.push({isTail:r,handler:oe}),n&&(U.push({isTail:!1,handler:ae}),U.push({isTail:!1,handler:le}));break;case"left":s&&U.push({isTail:!1,isCenter:!0,handler:ae}),U.push({isTail:r,handler:ae}),s&&U.push({isTail:!1,isCenter:!0,handler:le}),U.push({isTail:r,handler:le}),n&&(U.push({isTail:!1,handler:oe}),U.push({isTail:!1,handler:ne}));break;case"right":s&&U.push({isTail:!1,isCenter:!0,handler:le}),U.push({isTail:r,handler:le}),s&&U.push({isTail:!1,isCenter:!0,handler:ae}),U.push({isTail:r,handler:ae}),n&&(U.push({isTail:!1,handler:oe}),U.push({isTail:!1,handler:ne}))}let ie=[],re={},se=function(e=!1,t){let o=t.handler(a?!t.isTail:t.isTail,t.isCenter),n=o.vertical&&o.horizontal,l=o.scrollParentVertical&&o.scrollParentHorizontal,r=e?n&&l:n||l;return o.direction===i&&(re=o),ie.push(o),!!r&&(D=o,!0)};if(U.some((function(e){let t=e.handler(e.isTail,e.isCenter),o=t.vertical&&t.horizontal,n=t.scrollParentVertical&&t.scrollParentHorizontal;return t.direction===i&&(re=t),ie.push(t),o?n?(D=t,!0):e.isCenter?void 0:!!se(!0,e):e.isCenter?void 0:se(!0,e)})),!D){let e=null,t=null;ie.forEach((o=>{!e&&o.horizontal&&o.vertical&&(e=o),!t&&o.scrollParentHorizontal&&o.scrollParentVertical&&(t=o)})),t?D=t:e?D=e:(D=re).isRollback=!0}return t.style.opacity=m||"",t.style.display=p||"",D}function ne(e,t,o,n=!1,a=!0,l){if(!e||!t||!o)throw new Error("One of the parameters of virtualMouseEvt, targetEl, direction is missing!");let i=o=F(o),r=!1,s=!1;J.test(o)&&(o=RegExp.$1,r=!0),Q.test(o)&&(o=RegExp.$1,s=!0);let u={top:Z(),left:Y()};var d=e.clientX,c=e.clientY,f=e.contextElement,h=!!f&&1==f.nodeType&&!ee.includes(f.nodeName),p=R(f),m={top:p.top,left:p.left,bottom:p.top+(h?f.offsetHeight:0),right:p.left+(h?f.offsetWidth:0)},v=q(t),y=t.style.display,g=t.style.opacity;"none"===$(t,"display")&&(t.style.opacity="0",t.style.display="block");var b=!v;let w=t.offsetParent||document.body,C=!w||ee.includes(w.nodeName),S={top:0,left:0},T=w.getBoundingClientRect(),x={left:0,top:0};C||(S=R(w),x.top=w.scrollTop,x.left=w.scrollLeft);let V=ee.includes(w.nodeName),z=K(),B={vertical:!1,horizontal:!1};V&&(B={vertical:"hidden"!=$(document.body,"overflow-y"),horizontal:"hidden"!=$(document.body,"overflow-x")});let I=X(),E=j(),M={width:E.pc?window.innerWidth:Math.min(document.documentElement.clientWidth,window.innerWidth),height:E.pc?window.innerHeight:Math.min(document.documentElement.clientHeight,window.innerHeight)};var k=t.getBoundingClientRect(),N=_($(t,"transform"));k.width=Math.round(k.width/Math.abs(N.scaleX)),k.height=Math.round(k.height/Math.abs(N.scaleY));var P=(null==l?void 0:l.top)||0,O=(null==l?void 0:l.left)||0,A=null,W=[],D=function(e,o){var n=c,a=d;e&&(a-=k.width),o&&(n-=k.height/2);var l=null;v||(n+=u.top,a+=u.left),h&&V&&(n>=m.bottom||n+k.height>=m.bottom?n=m.bottom-k.height:n<m.top&&(n=m.top),e&&a+k.width>m.right||!e&&a>m.right?a=m.right-k.width:a<m.left&&(a=m.left)),n+=P,a+=O,V||(n+=x.top,a+=x.left);var i=te({ele:t,top:n,left:a,needSubtractScrollOffset:b,bodyScrollVisible:B,targetIsInBody:V,referenceIsInFixedPosition:!1,documentHasScroll:z,documentScrollInfo:u,scrollParent:h?f:w,windowWH:L({},M),targetIsInFixedPosition:v});let r=n,s=a;return v?(r-=T.top,s-=T.left):(r-=S.top,s-=S.left),V?(l=M.width-a,z.vertical&&B.vertical&&(l-=I.vertical),z.horizontal&&!B.horizontal&&(l-=u.left)):l=w.clientWidth-s,null!==l&&e&&(l-=k.width),r-=P,s-=O,H(L({},i),{direction:!e&&o?"bottomCenter":e?"bottomEnd":"bottom",top:r,left:s,bottom:null,right:e?l:null})};let U=function(e,o){var n=c-k.height,a=d;e&&(a-=k.width),o&&(n+=k.height/2),v||(n+=u.top,a+=u.left),h&&V&&(n+k.height>m.bottom?n=m.bottom-k.height:n<m.top&&(n=m.top),e&&a+k.width>m.right||!e&&a>m.right?a=m.right-k.width:a<m.left&&(a=m.left)),n+=P,a+=O,V||v||(n+=x.top,a+=x.left);var l=te({ele:t,top:n,left:a,needSubtractScrollOffset:b,bodyScrollVisible:B,targetIsInBody:V,referenceIsInFixedPosition:!1,documentHasScroll:z,documentScrollInfo:u,scrollParent:h?f:w,windowWH:L({},M),targetIsInFixedPosition:v}),i=null,r=null;let s=n,p=a;return v?(s-=T.top,p-=T.left):(s-=S.top,p-=S.left),V?(i=M.height-n-k.height,r=M.width-a,z.vertical&&B.vertical&&(r-=I.vertical),z.horizontal&&!B.horizontal&&(r-=u.left),z.horizontal&&B.horizontal&&(i-=I.horizontal),z.vertical&&!B.vertical&&(i-=u.top)):(i=w.clientHeight-s-k.height,r=w.clientWidth-p),null!==r&&e&&(r-=k.width),s-=P,p-=O,H(L({},l),{direction:!e&&o?"topCenter":e?"topEnd":"top",bottom:i,right:e?r:null,top:s,left:p})};switch(o){case"bottom":s&&W.push({isTail:!1,isCenter:!0,handler:D}),W.push({isTail:r,handler:D}),!s&&n&&W.push({isTail:!1,isCenter:!0,handler:D}),s&&W.push({isTail:!1,isCenter:!0,handler:U}),W.push({isTail:r,handler:U}),!s&&n&&W.push({isTail:!1,isCenter:!0,handler:U});break;case"top":s&&W.push({isTail:!1,isCenter:!0,handler:U}),W.push({isTail:r,handler:U}),!s&&n&&W.push({isTail:!1,isCenter:!0,handler:U}),s&&W.push({isTail:!1,isCenter:!0,handler:D}),W.push({isTail:r,handler:D}),!s&&n&&W.push({isTail:!1,isCenter:!0,handler:D})}let G=[],oe={},ne=function(e=!1,t){let o=t.handler(a?!t.isTail:t.isTail,t.isCenter),n=o.vertical&&o.horizontal,l=o.scrollParentVertical&&o.scrollParentHorizontal,r=e?n&&l:n||l;return o.direction===i&&(oe=o),G.push(o),!!r&&(A=o,!0)};if(W.some((function(e){let t=e.handler(e.isTail,e.isCenter),o=t.vertical&&t.horizontal,n=t.scrollParentVertical&&t.scrollParentHorizontal;return t.direction===i&&(oe=t),G.push(t),o?n?(A=t,!0):e.isCenter?void 0:!!ne(!0,e):e.isCenter?void 0:ne(!0,e)})),!A){let e=null,t=null;G.forEach((o=>{!e&&o.horizontal&&o.vertical&&(e=o),!t&&o.scrollParentHorizontal&&o.scrollParentVertical&&(t=o)})),t?A=t:e?A=e:(A=oe).isRollback=!0}return t.style.opacity=g||"",t.style.display=y||"",A}let ae={document:{},window:{}};const le=function(e,t,o){if(!e||"document"!=e&&"window"!=e)throw new Error("target只支持document、window");if(!t)throw new Error("缺少事件名称");if(!o)throw new Error("缺少事件函数");let n=ae[e][t],a="document"===e?document:window;n||(n=ae[e][t]=[],a.addEventListener(t,(function(e){let t=[];n.slice(0).forEach((o=>{try{o.call(this,e)}catch(e){t.push(e)}})),t.length>0&&t.forEach((e=>{setTimeout((function(){throw e}),0)}))}),!1)),n.includes(o)||n.push(o)},ie=function(e,t,o){let n=ae[e][t];if(!n)return;let a=n.indexOf(o);a>-1&&n.splice(a,1)},re={referenceRef:{type:Object,default:()=>({})},virtualMouseEvent:{type:Object,default:()=>({})},placement:{type:String,default:"bottom"},willVisible:{type:Boolean,default:!1},useZoomTransition:{type:Boolean,default:!1},tryAllPlacement:{type:Boolean,default:!0},tryEndPlacement:{type:Boolean,default:!0},position:{type:String,default:"absolute"},setWidth:{type:Boolean,default:!1},setMinWidth:{type:Boolean,default:!1},customTransitionName:{type:Function,default:null},customStyle:{type:Function,default:null},offset:{type:Object,default:null},contextMenu:{type:Boolean,default:!1}},se=["HTML","BODY"],ue={top:"0 100%",topEnd:"100% 100%",topCenter:"0 50%",bottom:"0 0",bottomEnd:"100% 0",bottomCenter:"0 50%",left:"100% 0",leftEnd:"100% 100%",leftCenter:"right center",right:"0 0",rightEnd:"0 100%",rightCenter:"0 center"},de="easyest-zoom",ce="easyest-slide-up",fe="easyest-slide-down",he=["top","topCenter","topEnd"],pe=["bottom","bottomCenter","bottomEnd"],me=e.defineComponent({name:"EasyestDropdownTransition",props:re,emits:["before-enter","enter","after-enter","before-leave","leave","after-leave","position-change"],setup(t,o){let n,a=e.reactive({direction:"bottom",width:0,left:0,top:0,bottom:null,right:null,horizontalFullInview:!1,verticalFullInview:!1}),l=null,i=e.ref(!1),r=e.ref(null),s=e.ref({}),u=function(){let e,{referenceRef:n,contextMenu:i,virtualMouseEvent:r}=t,u=null,h=null;if(!l)return;if(i)e=ne(r,l,t.placement,t.tryAllPlacement,t.tryEndPlacement,t.offset);else{if(n.nodeName?u=n:B(n)&&n.$el&&(u=n.$el),!u)return;h=u.getBoundingClientRect(),e=oe(u,l,t.placement,t.tryAllPlacement,t.tryEndPlacement,t.offset)}let p=e.bottom,m=e.right,v=e.direction;if(c(e),d.value==de){let e=ue[v];f.value={"transform-origin":e,"-ms-transform-origin":e,"-webkit-transform-origin":e}}else f.value={};let y=t.customStyle;if(A(y)){let t=y(e);t&&B(t)?s.value=t:s.value={}}a.horizontalFullInview=e.horizontal,a.verticalFullInview=e.vertical,a.direction=v,i||(a.width=h.width),a.top=e.top,a.left=e.left,a.bottom=null===p?null:e.bottom,a.right=null===m?null:e.right,o.emit("position-change",L({},a))},d=e.ref(""),c=function(e){let o=e.direction,n=t.customTransitionName;t.useZoomTransition?d.value=de:A(n)?d.value=n(e):he.includes(o)?d.value=ce:pe.includes(o)?d.value=fe:d.value=de},f=e.ref({});e.watch((()=>t.willVisible),(function(e){if(t.useZoomTransition)return void(d.value=de);if(!e)return;let o,{referenceRef:n,virtualMouseEvent:a,contextMenu:l}=t,i=null;if(l)o=ne(a,r.value,t.placement,t.tryAllPlacement);else{if(!n)return;n.nodeName?i=n:B(n)&&n.$el&&(i=n.$el),o=oe(i,r.value,t.placement,t.tryAllPlacement)}c(o)})),e.watch((()=>t.virtualMouseEvent),(function(){!t.contextMenu||!i.value||u()}),{deep:!0});let h=0,p="orientationchange"in window?"orientationchange":"resize",m=function(){if(!i.value)return;let e=(new Date).getTime();(0==h||e-h>=10)&&(u(),h=e)},v=0,y=function(e){if(!i.value||!l)return;let t=(new Date).getTime();if(0==v||t-v>=10){if("fixed"==$(l,"position"))return;let o=e.currentTarget;o===window||o===document?Z():o.scrollTop,u(),v=t}},g=e.computed((function(){let e=a.direction;return t.contextMenu?`easyest-contextmenu-placement-${D(e)}`:`easyest-placement-${D(e)}`}));return e.onBeforeMount((function(){ie("window",p,m),ie("window","scroll",y),l=null,n=void 0})),{dropdownStyle:a,transitionName:d,transitionOrigin:f,targetRef:r,styleCustom:s,isVisible:i,dynamicClassname:g,onEnter:function(e,a){let{referenceRef:r,virtualMouseEvent:s,contextMenu:d}=t,c=null;if(!((d||r&&(r.nodeName?c=r:B(r)&&r.$el&&(c=r.$el),c))&&e))return;i.value=!0,l=e,u();let f=function(){a(),e.removeEventListener("transitionend",f,!1),e.removeEventListener("transitioncancel",f,!1)};if(e.addEventListener("transitionend",f,!1),e.addEventListener("transitioncancel",f,!1),o.emit("enter",e,z),!d){n=G(c);let e=(null==n?void 0:n.nodeName)||"";n&&!se.includes(e)&&n.addEventListener("scroll",y,!1)}le("window","scroll",y),le("window",p,m)},onLeave:function(e){i.value=!1;let t=(null==n?void 0:n.nodeName)||"";n&&!se.includes(t)&&n.removeEventListener("scroll",y,!1),ie("window","scroll",y),ie("window",p,m),n=void 0,o.emit("after-leave",e)},refresh:u,camelCase2KebabCase:D}}});const ve=((e,t)=>{const o=e.__vccOpts||e;for(const[e,n]of t)o[e]=n;return o})(me,[["render",function(t,o,n,a,l,i){return e.openBlock(),e.createBlock(e.Transition,{ref:"targetRef",name:t.transitionName,onBeforeEnter:o[0]||(o[0]=e=>t.$emit("before-enter",e)),onEnter:t.onEnter,onAfterEnter:o[1]||(o[1]=e=>t.$emit("after-enter",e)),onBeforeLeave:o[2]||(o[2]=e=>t.$emit("before-leave",e)),onLeave:o[3]||(o[3]=e=>t.$emit("leave",e)),onAfterLeave:t.onLeave,class:e.normalizeClass(["easyest-dropdown-transition",[t.dynamicClassname,{"use-bottom-position":null!=t.dropdownStyle.bottom,"use-right-position":null!=t.dropdownStyle.right}]]),style:e.normalizeStyle(L(H(L(L(L({position:t.position},t.setWidth&&!t.contextMenu?{width:t.dropdownStyle.width+"px"}:{}),t.setMinWidth&&!t.contextMenu?{minWidth:t.dropdownStyle.width+"px"}:{}),t.transitionOrigin),{left:null==t.dropdownStyle.right?t.dropdownStyle.left+"px":"auto",right:null!=t.dropdownStyle.right?t.dropdownStyle.right+"px":"",top:null==t.dropdownStyle.bottom?t.dropdownStyle.top+"px":"auto",bottom:null!=t.dropdownStyle.bottom?t.dropdownStyle.bottom+"px":""}),t.styleCustom)),"data-horizontal-fullinview":t.isVisible?t.dropdownStyle.horizontalFullInview:null,"data-vertical-fullinview":t.isVisible?t.dropdownStyle.verticalFullInview:null},{default:e.withCtx((()=>[e.renderSlot(t.$slots,"default")])),_:3},8,["name","onEnter","onAfterLeave","class","style","data-horizontal-fullinview","data-vertical-fullinview"])}]]);ve.install=function(e){return e.component(ve.name,ve),e};var ye={name:"SchemaInput",components:{"country-list":C,EasyestDropdownTransition:ve,SlotRender:f},inheritAttrs:!1,props:o(o({},c),{},{placeholder:{type:String,default:"请选择国家"},showLabelImg:{type:Boolean,default:!0},onlyValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},iosMobileReadonly:{type:Boolean,default:!0},static:{type:Boolean,default:!1},transitionName:{type:String},rootSlots:{type:Object,default:function(){return{}}},appendToBody:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1}}),emits:[h,m],setup:function(t,n){var a=e.reactive({item:{}}),l=e.ref(null),i=e.ref(null),r=e.computed((function(){var e=a.item,o=t.useChinese?e.nameCN:e.name,n="+"==(t.modelValue+"").charAt(0)?t.modelValue.substr(1):t.modelValue;if("phone"===t.type.toLowerCase()){var l=e.dialCode;return t.onlyValue?1==l&&e.areaCodes?"+"+(n||e.areaCodes[0]):"+"+e.dialCode:t.showAreaCode?1==l&&e.areaCodes?"".concat(e.name,"(+").concat(n||e.areaCodes[0],")"):o+"(+"+e.dialCode+")":o}return t.onlyValue?e.iso2:o})),s=e.ref(""),u=e.ref(!1),c=e.ref(!0),f=e.ref(!1),h=e.ref(window.innerWidth),p=e.ref(null),m=e.ref(null),v=e.ref(!1),g=e.ref(!1),b=e.ref(!1),w=e.computed((function(){return t.static||g.value})),C=function(e){e.iso2,a.item.iso2,e.iso2!==a.item.iso2&&(a.item=e,n.emit("onChange",e))},S=function(e){n.emit("update:modelValue",e)};e.watch((function(){return t.modelValue}),(function(e){v.value||(a.item=y(t.modelValue,t.type,t.iso2,d))}),{immediate:!0});return e.onMounted((function(){t.static&&(v.value=!0)})),{searchText:s,countryListDisplay:v,countryListVisible:w,inputFocused:u,listOnBottom:c,isIos:f,deviceWidth:h,inputWrap:l,countryList:i,viewText:r,selected:a,searchInput:p,vueCountryIntlWrapper:m,countryListWillShow:b,onCountryChange:C,onModelValue:S,hide:function(){if(w.value&&!t.disabled&&!t.readonly)var e=setTimeout((function(){clearTimeout(e),s.value="",u.value=!1,b.value=!1,g.value=!1}),100)},show:function(){if(!t.disabled&&!t.readonly){if(t.static)return u.value=!0,void(s.value="");var e=function(){b.value=!0;var e=setTimeout((function(){if(clearTimeout(e),u.value=!0,g.value=!0,s.value="",!t.readonly)var o=setTimeout((function(){clearTimeout(o),p.value.focus()}),0)}),60)};if(v.value)e();else{v.value=!0;var o=setTimeout((function(){clearTimeout(o),e()}),0)}}},clear:function(){t.clearable&&!t.disabled&&(C({}),S(""))},getCountryInfo:function(e){var t=y(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"phone",arguments.length>2?arguments[2]:void 0,d);return t.iso2?o({},t):null},onPositionChange:function(e){c.value="bottom"==e.direction}}}},ge=["name","aria-readonly","aria-disabled","placeholder","readonly"],be={class:"country-intl-label"},we={class:"country-intl-label-text"},Ce=e.createElementVNode("label",{class:"dropdown-flag"},null,-1),Se=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 16 16",ariaHidden:"true",focusable:"false"},[e.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),e.createElementVNode("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})],-1),Te=e.createElementVNode("div",{class:"prevent-click"},null,-1);ye.render=function(t,o,n,a,l,i){var r=e.resolveComponent("SlotRender"),s=e.resolveComponent("country-list");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vue-country-intl-inputer",{"is-focused":t.inputFocused,"dropdown-list-on-bottom":t.listOnBottom,"dropdown-list-on-top":!t.listOnBottom,"vue-country-disabled":t.disabled,"vue-country-readonly":t.readonly,"is-static":t.static}]),ref:"vueCountryIntlWrapper"},[e.createElementVNode("div",{ref:"inputWrap",class:e.normalizeClass(["country-intl-input-wrap",{"no-data":!t.selected.item.name,"has-selected":t.selected.item.name}]),onClick:o[3]||(o[3]=function(){return t.show&&t.show.apply(t,arguments)})},[e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.searchText=e}),class:"country-intl-input",autocomplete:"off",ref:"searchInput",onBlur:o[1]||(o[1]=function(){return t.hide&&t.hide.apply(t,arguments)}),name:t.name,"aria-readonly":t.readonly,"aria-disabled":t.disabled,placeholder:t.placeholder,readonly:t.isIos&&t.deviceWidth<992&&t.iosMobileReadonly},null,40,ge),[[e.vModelText,t.searchText]]),e.createElementVNode("label",be,[e.withDirectives(e.createElementVNode("span",{class:e.normalizeClass(["iti-flag",t.selected.item.iso2])},null,2),[[e.vShow,t.showLabelImg]]),e.createVNode(r,{"slot-name":"customInputLabel","out-slots":t.rootSlots,"slot-data":Object.assign({},t.selected.item)},{default:e.withCtx((function(){return[e.createElementVNode("span",we,e.toDisplayString(t.viewText),1)]})),_:1},8,["out-slots","slot-data"])]),Ce,!t.disabled&&t.modelValue&&t.clearable?(e.openBlock(),e.createElementBlock("span",{key:0,class:"clear-button",onClick:o[2]||(o[2]=e.withModifiers((function(){return t.clear&&t.clear.apply(t,arguments)}),["stop"]))},[e.createVNode(r,{"slot-name":"clear","out-slots":t.rootSlots},{default:e.withCtx((function(){return[Se]})),_:1},8,["out-slots"])])):e.createCommentVNode("v-if",!0),Te],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:t.static||!t.appendToBody},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.static?"div":"EasyestDropdownTransition"),{"will-visible":t.countryListWillShow,"reference-ref":t.inputWrap,"try-end-placement":!1,"try-all-placement":!1,"set-width":!0,customTransitionName:t.transitionName?function(){return t.transitionName}:void 0,onPositionChange:t.onPositionChange},{default:e.withCtx((function(){return[t.countryListDisplay?e.withDirectives((e.openBlock(),e.createBlock(s,{key:0,class:"vue-country-intl-inputer-dropdown",ref:"countryList","model-value":t.modelValue,"search-text":t.searchText,selectedText:t.selectedText,"show-selected-text":t.showSelectedText,"show-area-code":t.showAreaCode,"list-z-index":t.listZIndex,type:t.type,iso2:t.iso2,"search-able":t.searchAble,"disable-country":t.disableCountry,"only-country":t.onlyCountry,"no-data-text":t.noDataText,"use-chinese":t.useChinese,"root-slots":t.rootSlots,sort:t.sort,filter:t.filter,transform:t.transform,onOnChange:t.onCountryChange,"onUpdate:modelValue":t.onModelValue},null,8,["model-value","search-text","selectedText","show-selected-text","show-area-code","list-z-index","type","iso2","search-able","disable-country","only-country","no-data-text","use-chinese","root-slots","sort","filter","transform","onOnChange","onUpdate:modelValue"])),[[e.vShow,t.countryListVisible]]):e.createCommentVNode("v-if",!0)]})),_:1},40,["will-visible","reference-ref","customTransitionName","onPositionChange"]))],8,["disabled"]))],2)},ye.__file="src/components/schema-input/SchemaInput.vue";var xe={name:"SchemaPopover",components:{"country-list":C,EasyestDropdownTransition:ve},inheritAttrs:!1,props:o(o({},c),{},{visible:{type:Boolean,default:!1},showLabelImg:{type:Boolean,default:!0},onlyValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},searchInputPlaceholder:{type:String,default:"输入国家名称、区号搜索"},popoverClass:{type:String,default:""},offset:{type:Array,default:function(){return[0,10]}},rightOffset:{type:Number,default:20},rootSlots:{type:Object,default:function(){return{}}},appendToBody:{type:Boolean,default:!0},transitionName:{type:String,default:"easyest-zoom"}}),emits:[p,h,m],setup:function(t,n){var a,l=e.reactive({item:{}}),i=e.ref(""),r=e.ref(!0),s=e.ref(null),u=e.ref(null),c=e.ref(!1),f=e.ref(!1),h=e.ref(!1),p=function(){f.value=!1,c.value=!1,n.emit("update:visible",!1)};e.watch((function(){return t.visible}),(function(e){var o=function(){f.value=!0,a=setTimeout((function(){clearTimeout(a),c.value=!0}),60)};if(e)if(h.value)clearTimeout(a),o();else{h.value=!0,l.item=y(t.modelValue,t.type,t.iso2,d),l.item;var n=setTimeout((function(){clearTimeout(n),clearTimeout(a),o()}),20)}else f.value=!1,c.value=!1}));var m=function(e){var o=(e=e||window.event).target;t.visible&&(v(s.value,o)||v(u.value,o)||p())};return e.onMounted((function(){document.documentElement.addEventListener("click",m,!1)})),e.onUnmounted((function(){document.documentElement.removeEventListener("click",m,!1)})),{selected:l,searchText:i,listOnBottom:r,popoverDisplay:h,popoverContainer:s,popover:u,popoverVisible:c,popoverWillVisible:f,onCountryChange:function(e){if(e.iso2!==l.item.iso2){l.item=e,n.emit("onChange",e);var