;(function(){System.register(['./index-legacy.2d78ae68.js','./index-legacy.4dcff286.js','./index-legacy.1588182e.js','./header-legacy.9096b935.js','./vendor-legacy.09f20d09.js','./music-legacy.6d4924e4.js','./hooks-legacy.b91b3b59.js','./index-legacy.f25f109a3.js','./index-legacy.f25f109a6.js','./index-legacy.f72eae88.js','./index-legacy.f25f109a.js','./index-legacy.f25f109a5.js','./index-legacy.595c24c3.js','./item-legacy.c5048c92.js','./index-legacy.f25f109a2.js','./select-tag-legacy.4972aa0d.js','./index-legacy.f25f109a10.js','./index-legacy.f25f109a13.js','./index-legacy.f25f109a14.js','./index-legacy.6e10cd37.js','./select-subject-legacy.1290af03.js','./index.module-legacy.9051c853.js','./index-legacy.a92ed534.js','./index-legacy.f25f109a4.js','./index-legacy.92ff7530.js','./index-legacy.637f3556.js','./code-down-load-legacy.66a01c5d.js','./logo-legacy.cf4b3bd2.js','./browser-legacy.5a92c2a9.js','./icon_teacher-legacy.e765b7f7.js','./music-icon-legacy.a161f8f1.js','./orderStatus-legacy.6131dfb6.js','./index-legacy.c75fe8a2.js','./index-legacy.637f35562.js'],function(exports){'use strict';var useLocalStorage,AlbumList,MusicList,mitter,styles,defineComponent,useRoute,useRouter,ref,onMounted,onUnmounted,createVNode,getRandomKey,musicBuy,useSubjectId,SubjectEnum;return{setters:[function(module){useLocalStorage=module.c;},function(module){AlbumList=module["default"];},function(module){MusicList=module["default"];},function(module){mitter=module.m;styles=module.s;},function(module){defineComponent=module.d;useRoute=module.u;useRouter=module.k;ref=module.l;onMounted=module.m;onUnmounted=module.aB;createVNode=module.a;},function(module){getRandomKey=module.g;musicBuy=module.m;},function(module){useSubjectId=module.u;SubjectEnum=module.S;},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function execute(){var index=exports('default',defineComponent({name:'MusicSearch',emits:['confirm'],setup:function setup(){localStorage.setItem('behaviorId',getRandomKey());var route=useRoute();useRouter();var keyword=ref(route.query.keyword||'');var tagids=ref(route.query.tagids||'');var subject=ref();var tagVisibility=ref(false);var words=useLocalStorage('music-search',[]);var activeTab=ref('songe');var getSubject=useSubjectId(SubjectEnum.SEARCH);subject.value=getSubject.id;var onSearch=function onSearch(val){var _activeRef$value$onSe,_activeRef$value;keyword.value=val;var indexOf=words.value.indexOf(val);if(indexOf>-1){words.value.splice(indexOf,1);}if(val){words.value.unshift(val);words.value.length=Math.min(words.value.length,5);}var activeRef=activeTab.value==='album'?albumList:musicList;(_activeRef$value$onSe=(_activeRef$value=activeRef.value).onSearch)===null||_activeRef$value$onSe===void 0?void 0:_activeRef$value$onSe.call(_activeRef$value,val);};var onComfirm=function onComfirm(tags){var _activeRef$value$onCo,_activeRef$value2;var data=Object.values(tags).flat().filter(Boolean).join(',');tagids.value=data;var activeRef=activeTab.value==='album'?albumList:musicList;(_activeRef$value$onCo=(_activeRef$value2=activeRef.value).onComfirm)===null||_activeRef$value$onCo===void 0?void 0:_activeRef$value$onCo.call(_activeRef$value2,tags);tagVisibility.value=false;};var onConfirmSubject=function onConfirmSubject(item){var _activeRef$value$onCo2,_activeRef$value3;subject.value=item.id;var activeRef=activeTab.value==='album'?albumList:musicList;(_activeRef$value$onCo2=(_activeRef$value3=activeRef.value).onComfirmSubject)===null||_activeRef$value$onCo2===void 0?void 0:_activeRef$value$onCo2.call(_activeRef$value3,item);};var albumList=ref(null);var musicList=ref(null);var changeTab=function changeTab(val){activeTab.value=val;};onMounted(function(){mitter.on('changeTab',changeTab);mitter.on('search',onSearch);mitter.on('confirm',onComfirm);mitter.on('confirmSubject',onConfirmSubject);});onUnmounted(function(){mitter.off('changeTab',changeTab);mitter.off('search',onSearch);mitter.off('confirm',onComfirm);mitter.off('confirmSubject',onConfirmSubject);});return function(){return createVNode("div",{"class":styles.search},[activeTab.value==='album'?createVNode(AlbumList,{"hideSearch":true,"ref":albumList,"defauleParams":{search:keyword.value,tagids:tagids.value,albumTagIds:tagids.value,subjectIds:subject.value}},null):createVNode(MusicList,{"hideSearch":true,"ref":musicList,"onItemClick":function onItemClick(item){musicBuy(item);},"defauleParams":{search:keyword.value,tagids:tagids.value,musicTagIds:tagids.value,subjectIds:subject.value}},null)]);};}}));}};});})();
