/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@opentiny/vue-locales@3.30.0/lib/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{defineComponent,$prefix,setup}from"@opentiny/vue-common";import{renderless,api}from"@opentiny/vue-renderless/locales/vue";import{use,zhCN,enUS}from"@opentiny/vue-locale";import Popover from"@opentiny/vue-popover";import{IconChevronUp,IconChevronDown}from"@opentiny/vue-icon";import{resolveComponent,openBlock,createElementBlock,toDisplayString,createBlock,withCtx,createElementVNode,createTextVNode,withDirectives,createVNode,vShow,Fragment,renderList,normalizeClass}from"vue";import"@opentiny/vue-theme/locales/index.css";function _createForOfIteratorHelperLoose(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return(o=o.call(e)).next.bind(o);if(Array.isArray(e)||(o=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o<t;o++)n[o]=e[o];return n}var _export_sfc=function(e,t){for(var o,n=e.__vccOpts||e,r=_createForOfIteratorHelperLoose(t);!(o=r()).done;){var a=o.value,s=a[0],i=a[1];n[s]=i}return n},_sfc_main=defineComponent({name:$prefix+"Locales",components:{TinyPopover:Popover,IconChevronUp:IconChevronUp(),IconChevronDown:IconChevronDown()},props:{local:{type:Boolean,default:!1},changeLang:Function,getLocale:Function,getDomain:Function,getCurrentLocale:Function,getChangeLocaleUrl:Function,fetchSsoUpdate:Function,popperClass:String,popperAppendToBody:{type:Boolean,default:!0}},setup:function(e,t){return setup({props:e,context:t,renderless:renderless,api:api,mono:!0,extendOptions:{use:use,zhCN:zhCN,enUS:enUS,constants:{GLOBAL:"global"}}})}}),_hoisted_1={class:"tiny-locales"},_hoisted_2={key:0},_hoisted_3={class:"tiny-locales__text"},_hoisted_4={class:"tiny-locales__icon"},_hoisted_5={class:"poplist"},_hoisted_6=["onClick"];function _sfc_render(e,t,o,n,r,a){var s=resolveComponent("IconChevronDown"),i=resolveComponent("IconChevronUp"),l=resolveComponent("tiny-popover");return openBlock(),createElementBlock("div",_hoisted_1,[1===e.state.locales.length?(openBlock(),createElementBlock("span",_hoisted_2,toDisplayString(e.state.text&&e.t(e.state.text)),1)):2===e.state.locales.length?(openBlock(),createElementBlock("span",{key:1,onClick:t[0]||(t[0]=function(){return e.switchLanguage&&e.switchLanguage.apply(e,arguments)})},toDisplayString(e.state.text&&e.t(e.state.text)),1)):(openBlock(),createBlock(l,{key:2,trigger:"hover","visible-arrow":!1,onShow:t[1]||(t[1]=function(t){return e.state.visible=!0}),onHide:t[2]||(t[2]=function(t){return e.state.visible=!1}),placement:"bottom-start","popper-class":"tiny-locales__popper"+(e.popperClass?" "+e.popperClass:""),"append-to-body":e.popperAppendToBody},{reference:withCtx((function(){return[createElementVNode("span",_hoisted_3,[createTextVNode(toDisplayString(e.state.text&&e.t(e.state.text))+" ",1),createElementVNode("span",_hoisted_4,[withDirectives(createVNode(s,null,null,512),[[vShow,!e.state.visible]]),withDirectives(createVNode(i,{class:"chevron-up"},null,512),[[vShow,e.state.visible]])])])]})),default:withCtx((function(){return[createElementVNode("div",_hoisted_5,[(openBlock(!0),createElementBlock(Fragment,null,renderList(e.state.locales,(function(t){return openBlock(),createElementBlock("li",{key:t,class:normalizeClass({selected:e.state.current===t}),onClick:function(o){return e.switchLanguage(t)}},toDisplayString(e.t(t)),11,_hoisted_6)})),128))])]})),_:1},8,["popper-class","append-to-body"]))])}var Locales=_export_sfc(_sfc_main,[["render",_sfc_render]]),version="3.undefined";Locales.install=function(e){e.component(Locales.name,Locales)},Locales.version=version;export{Locales as default};
//# sourceMappingURL=/sm/907452ad7f83bf753e3d1d2d9cad5776b52a2a1f933d2484fb8bfd465a1da3de.map