!function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function a(e,t,n,r,o,a,i){try{var s=e[a](i),c=s.value}catch(l){return void n(l)}s.done?t(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){a(i,r,o,s,c,"next",e)}function c(e){a(i,r,o,s,c,"throw",e)}s(void 0)}))}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,a=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(c){s=!0,o=c}finally{try{i||null==n.return||n.return()}finally{if(s)throw o}}return a}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:!o.showPopup,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e!==o.showPopup&&(o.showPopup=e,o.transition=!t.immediate,e&&(o.showWrapper=!0))},renderTitle:function(){if(r.title)return r.title();if(e.title)return e.title;var t=e.options.find((function(t){return t.value===e.modelValue}));return t?t.text:""}}),function(){return e.teleport?X(H,{to:e.teleport},{default:function(){return[v()]}}):v()}}}}),he=oe(fe),me=oe(de),ge=s($("search"),3),xe=ge[0],be=ge[1],ye=ge[2],je=E({name:xe,props:ae({},c,{label:String,clearable:Z,actionText:String,background:String,showAction:Boolean,shape:{type:String,default:"square"},leftIcon:{type:String,default:"search"}}),emits:["search","cancel","update:modelValue"],setup:function(e,t){var n=t.emit,r=t.slots,o=t.attrs,a=D(),i=function(){r.action||(n("update:modelValue",""),n("cancel"))},s=function(t){13===t.keyCode&&(V(t),n("search",e.modelValue))},u=function(){if(r.label||e.label)return X("div",{class:be("label")},[r.label?r.label():e.label])},d=function(){if(e.showAction){var t=e.actionText||ye("cancel");return X("div",{class:be("action"),role:"button",tabindex:0,onClick:i},[r.action?r.action():t])}},p=Object.keys(c);return R({focus:function(){var e;return null==(e=a.value)?void 0:e.focus()},blur:function(){var e;return null==(e=a.value)?void 0:e.blur()}}),function(){return X("div",{class:be({"show-action":e.showAction}),style:{background:e.background}},[null==r.left?void 0:r.left(),X("div",{class:be("content",e.shape)},[u(),(t=ae({},o,ie(e,p)),X(l,K({ref:a,type:"search",border:!1,onKeypress:s},t,{"onUpdate:modelValue":function(e){return n("update:modelValue",e)}}),ie(r,["left-icon","right-icon"])))]),d()]);var t}}}),we=oe(je),Ae={accompany:"_accompany_jdvsx_1","van-tab":"_van-tab_jdvsx_17","van-tab--active":"_van-tab--active_jdvsx_20",playIcon:"_playIcon_jdvsx_23",extra:"_extra_jdvsx_34",song:"_song_jdvsx_42","van-cell":"_van-cell_jdvsx_42",playing:"_playing_jdvsx_45",iconMusic:"_iconMusic_jdvsx_49",spin:"_spin_jdvsx_1",active:"_active_jdvsx_53",vipTip:"_vipTip_jdvsx_56",strong:"_strong_jdvsx_63",search:"_search_jdvsx_67","van-field__left-icon":"_van-field__left-icon_jdvsx_71","van-search__content":"_van-search__content_jdvsx_75","van-search__action":"_van-search__action_jdvsx_81",search_btn:"_search_btn_jdvsx_143",item:"_item_jdvsx_153",title:"_title_jdvsx_156",iconSearch:"_iconSearch_jdvsx_163","van-icon__image":"_van-icon__image_jdvsx_167","icon-status":"_icon-status_jdvsx_177","audio-container":"_audio-container_jdvsx_185",hidden:"_hidden_jdvsx_194",searchSelect:"_searchSelect_jdvsx_198",tags:"_tags_jdvsx_201",icon:"_icon_jdvsx_49",notice:"_notice_jdvsx_232"},Se=w.parse(location.search);e("default",E({name:"music-list",data:function(){return{show:!0,isFirstLoad:!1,userinfo:null,isApp:g().isApp,tempLevelId:0,chooseShow:!1,partNames:[],selectedPartName:"",selectedPartIndex:0,activeRow:null}},mounted:function(){var e=this;return i(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.initList();case 2:case"end":return t.stop()}}),t)})))()},methods:{initList:function(){var e=this;return i(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(r in x(["_trackEvent","云教练","切换页面","列表页面"]),n=z())Object.prototype.hasOwnProperty.call(n,r)&&(T[r]=n[r]);return T.parentId=e.$route.params.id||1,t.next=6,e.FetchLevel();case 6:return t.next=8,e.FetchList();case 8:case"end":return t.stop()}}),t)})))()},FetchLevel:function(){return i(regeneratorRuntime.mark((function e(){var t,n,a,i,s,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{t=sessionStorage.getItem("musicScoreList"),n=t?JSON.parse(t):[],a=[],i=o(n);try{for(i.s();!(s=i.n()).done;)(c=s.value).id==T.parentId&&(a=c.sysMusicScoreCategoriesList||[])}catch(d){i.e(d)}finally{i.f()}T.levelOptions=r(a.map((function(e){return{value:e.id,text:e.name,childs:e.sysMusicScoreCategoriesList}}))),T.levelOptions.length&&!T.levelId&&(T.levelId=T.levelOptions[0].value,(l=u.find(T.levelOptions,{value:T.levelId}))&&(l.childs?(console.log(l,"showInfo"),T.typeOptions=[{value:0,text:"全部"}].concat(r(l.childs.map((function(e){return{value:e.id,text:e.name}}))))):T.typeOptions=null))}catch(p){}case 1:case"end":return e.stop()}}),e)})))()},FetchCats:function(){var e=this;return i(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,B.get("/sysMusicScoreAccompaniment/querySubjectIds",{params:{categoriesId:e.$route.params.id||1}});case 3:n=t.sent,b.subjectOptions=[{value:0,text:"全部声部"}].concat(r(n.data.filter((function(e){return!!e})).map((function(e){return{value:e.id,text:e.name}})))),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})))()},FetchList:function(){var e=this;return i(regeneratorRuntime.mark((function n(){var o,a,i,s,c,l,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(T.error=!1,!T.loading){n.next=3;break}return n.abrupt("return");case 3:if(T.loading=!0,console.log(b.subjectOptions),"/api-student"===y()){n.next=8;break}return n.next=8,e.FetchCats();case 8:return"/api-student"===y()&&(b.subjectOptions=r(b.extSubjectIds.filter((function(e){return!!e})).map((function(e){return{value:e.id,text:e.name}})))),o=b.subjectOptions.map((function(e){return e.value})).filter((function(e){return e>0})),console.log(o,b.subjectId),o.includes(5)&&o.push(6),o.includes(b.subjectId)||(b.subjectId=0),console.log(b.subjectOptions),n.prev=14,T.subjectId=b.subjectId,a=T.params,i=e.$route.params.id,s=(0===(T.levelId||T.typeId)?void 0:T.typeId||T.levelId)||i,c=0===b.subjectId?void 0:b.subjectId,y(),n.next=23,B.get("/sysMusicScore/queryPage2",{params:t(t({},a),{},{clientType:"SMART_PRACTICE",subjectId:c,categoriesId:s,search:T.search})});case 23:if(l=n.sent,u=l.data,!(T.list.length>0&&1==u.pageNo)){n.next=27;break}return n.abrupt("return");case 27:T.list=[].concat(r(T.list),r(u.rows)),a.page>=Math.ceil(u.total/a.rows)&&(T.finished=!0),T.params.page=u.nextPage,T.list.length<=0&&(e.show=!1),n.next=36;break;case 33:n.prev=33,n.t0=n.catch(14),T.error=!0;case 36:T.loading=!1;case 37:case"end":return n.stop()}}),n,null,[[14,33]])})))()},getPartNames:function(e){return i(regeneratorRuntime.mark((function t(){var n,r,a,i,s,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],L({type:"loading",overlay:!0}),t.prev=2,t.next=5,M.get(e,{mode:"cors"});case 5:r=t.sent,a=(new DOMParser).parseFromString(r,"text/xml"),i=o(a.getElementsByTagName("part-name"));try{for(i.s();!(s=i.n()).done;)(c=s.value).textContent&&n.push(c.textContent)}catch(l){i.e(l)}finally{i.f()}L.clear(),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(2),L.clear(),L("读取分谱信息失败,请重试");case 16:return t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,null,[[2,12]])})))()},openDetail:function(){var e,n,r,o=this.activeRow,a=null===(e=o.rankIds)||void 0===e?void 0:e.split(","),i=String(null===(n=b.user)||void 0===n||null===(r=n.student)||void 0===r?void 0:r.memberRankSettingId);if(o.rankIds&&b.user&&!a.includes(i)&&"/api-student"===y())d.vipShow=!0;else if("select"!==Se.mode){var s="/detail/"+o.id+"?part-index="+this.selectedPartIndex;if(this.isApp)U({api:"openAccompanyWebView",content:{url:location.origin+"/accompany/#"+s,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0}});else{var c=j("#"+s,t({},this.$route.query));location.replace(c)}}else this.isApp&&U({api:"onAccompanySelectResult",content:{id:o.id,name:o.name,partIndex:this.selectedPartIndex}})},toDetail:function(e){var t=this;return i(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.activeRow=e,t.selectedPartName="",t.selectedPartIndex=0,n.next=5,t.getPartNames(e.xmlUrl);case 5:r=n.sent,t.partNames=r,r.length>1?t.chooseShow=!0:(t.selectedPartName=r[0],t.openDetail());case 8:case"end":return n.stop()}}),n)})))()},onSelectedPartName:function(e){this.selectedPartIndex=e,this.chooseShow=!1,this.openDetail()},onPayVideo:function(e,n){e.stopPropagation(),U({api:"recordHomeworkVideo",content:t(t({},n),{},{partIndex:this.selectedPartIndex})})},openRecordingWebview:function(e,t){e.stopPropagation(),U({api:"recordHomeworkVideo",content:{id:t.id,partIndex:this.selectedPartIndex}})},onSearch:function(){T.params.page=1,T.list=[],this.show=!0,T.finished=!1,this.FetchList()},subjectChange:function(e){b.subjectId=e,this.onSearch()},onClickLeft:function(){this.$router.replace("/")}},render:function(){var e,t=this;return X("div",{class:Ae.accompany},[X(P,{show:this.chooseShow,teleport:"body",closeable:!0,style:{borderRadius:"8px"},onClickOverlay:function(){return t.chooseShow=!1},onClickCloseIcon:function(){return t.chooseShow=!1}},{default:function(){return[X(F,{partNames:t.partNames,onSelectedPartName:t.onSelectedPartName},null)]}}),X(p,null,{default:function(){return[T.typeOptions||T.levelOptions&&T.levelOptions.length>0?X(me,{activeColor:"#01C1B5"},{default:function(){return[T.levelOptions&&T.levelOptions.length>0?X(he,{modelValue:T.levelId,options:T.levelOptions,onChange:function(e){T.levelId=e,T.typeId=0;var n=u.find(T.levelOptions,{value:e});n&&(n.childs?T.typeOptions=[{value:0,text:"全部"}].concat(r(n.childs.map((function(e){return{value:e.id,text:e.name}})))):T.typeOptions=null),t.onSearch()}},null):null,T.typeOptions?X(he,{class:Ae.searchSelect,"get-container":"#app",modelValue:T.typeId,options:T.typeOptions,onChange:function(e){T.typeId=e,t.onSearch()}},null):null]}}):null,X(we,{class:[Ae.search],placeholder:"请输入搜索关键词",modelValue:T.search,background:"#F8F9FC","onUpdate:model-value":function(e){return T.search=e},showAction:!0,onSearch:t.onSearch},{"left-icon":function(){return X("img",{class:Ae.iconSearch,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAqCAMAAAD26OlUAAAAdVBMVEUAAAAAwrYAwbQAw7QBwrUBwbYBwbYAwrYBwbUCwrYBwrYAwrcBwrYBwbUBwbUBwrUCwrUAw7cAwbgAwrcAwbUAxLsBwbUAwrYAwrUAwLQBwbQBwbUBwrYCwrYCwrYAw7YAwLUAwbUAv7gAv7cBwrYAysoBwbV4Ka+yAAAAJnRSTlMAQhMG8fv3guaojTnr3s/ImmtQRi0P1Xp2KPO+uKCTYllWJB65BHQbZOYAAAEHSURBVDjL7ZLLEoIwDEUphSIg74fiW9H+/yeaOIUpDWXYuOOu4M5pmpvG2fQnuc0KiN0SX0qRBvUylslR4cvOBVLXqbRxoSL2nvooluqFFYc4j18PfjXbnwTt4uH3LrC2OwNmyPXaQR+MyFIw1p0jGIKO9Ib9TRyegPUkILoVTZcTEDvitJszeV/MaHgdeK0JNmB6hleDl5KrcWzG1EqwLgRMwX1MrVwNkkbMpm3jkzMC1hJ0150rPhWf3x2hFTjY9ud1wn05cnUv1qM3q5CoJGBdXeZqJb14jix8achGVnudaSM76UZiwHYFxzwqOFXzzM9teokYH5P3jkXG8r6dVerYx9m0Rl+8riWqpDNy7wAAAABJRU5ErkJggg=="},null)},label:function(){return"/api-student"==y()&&b.subjectOptions&&1===b.subjectOptions.length?null:X(me,{activeColor:"#01C1B5",onClick:function(e){e.preventDefault()}},{default:function(){return[X(he,{class:Ae.searchSelect,"get-container":"#app",modelValue:b.subjectId,options:b.subjectOptions,onChange:function(e){b.subjectId=e,t.onSearch()}},null)]}})},action:function(){return X("span",{class:Ae.search_btn,onClick:t.onSearch},[G("搜索")])}})]}}),X("div",{class:_(Ae.accompanyList,Ae.song)},[this.show?X(v,{loading:T.loading,finishedText:"加载完毕",error:T.error,offset:100,finished:T.finished,immediateCheck:!1,onLoad:this.FetchList},{default:function(){return[X(f,null,(n=e=T.list.map((function(e){return X(a,{size:"large",onClick:function(){return t.toDetail(e)}},{icon:function(){return X("div",{class:Ae["icon-status"]},[X(ne,{class:Ae.iconMusic,name:Y},null),e.rankIds?X("div",{class:Ae.icon},[X("img",{src:N},null)]):null])},title:function(){return X(h,{background:"none",color:"#444",style:{paddingLeft:(e.rankIds?"4PX":"15PX")+"!important"},text:e.name,key:"notactive"},null)}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!Q(n)?e:{default:function(){return[e]}}))];var n},error:function(){return X("span",{onClick:t.FetchList},[G("加载失败,请点击重试")])}}):X(se,{description:"暂无数据"},null)])])}}))}}}))}();