System.register(["./index-legacy-953bc201-1740456180783.js"],(function(e,t){"use strict";var s,r,a,i,n,u;return{setters:[e=>{s=e.ab,r=e.bi,a=e.aM,i=e.dt,n=e.du,u=e.dv}],execute:function(){const t=e("d",(e=>{if(null===e)return null;const s=Object.assign({},e);return Object.keys(s).forEach((r=>s[r]="object"==typeof e[r]?t(e[r]):e[r])),Array.isArray(e)?(s.length=e.length,Array.from(s)):s})),l=(e("m",(e=>s.post("/edu-app/material/queryPage",{data:e}))),e("f",(e=>s.post("/edu-app/material/favorite",{data:e}))),e("c",(e=>s.post("/edu-app/material/remove",{requestType:"form",data:e}))),e("h",(e=>s.post("/edu-app/lessonCourseware/save",{data:e}))),e("e",(e=>s.post("/edu-app/material/save",{data:e}))),e("b",(e=>s.post("/edu-app/material/updateAll",{data:e}))),e("a",(e=>s.post("/edu-app/material/removeMusic",{data:e}))),e("g",(e=>s.post("/edu-app/materialTag/page",{data:e}))));e("u",r("catch-store",{state:()=>({bookVersionList:[],musicTypeList:[],subjectList:[],musicInstrumentList:[],subjectInstruemnts:[],musicTagTree:[],materialTags:[]}),getters:{getBookVersion(){return this.bookVersionList},getMusicCategories(){return this.musicTypeList},getMusicInstruments(){return this.musicInstrumentList},getAllMusicCategories(){return[{name:"全部",id:null},...this.musicTypeList]},getSubjectList(){return this.subjectList},getSubjectAllList(){return[{name:"全部",id:null},...this.subjectList]},getEnableSubjects(){const e=[];return this.subjectList.forEach((t=>{if(t.enableFlag){const{instruments:s,...r}=t;if(s&&s.length>0){const t=[];s?.forEach((e=>{e.enableFlag&&t.push(e)})),t.length>0&&e.push({...r,instruments:t})}}})),e},getSubjectInstruments(){return[{name:"全部",id:null,label:"全部",value:null},...this.subjectInstruemnts]},getSubjectInstrumentOnly(){return this.subjectInstruemnts},getMusicTagTree(){return this.musicTagTree},getMaterialTags(){return this.materialTags},getAllMaterialTags(){return[{label:"全部",value:null},...this.materialTags]}},actions:{setBookVersion(e){this.bookVersionList=e},setMusicCategories(e){this.musicTypeList=e},setSubjects(e){this.subjectList=e},setSubjectInstruemnts(e){this.subjectInstruemnts=e},setMusicInstruments(e){this.musicInstrumentList=e},setMusicTagTree(e){this.musicTagTree=e},setMaterialTags(e){this.materialTags=e},async getSubjects(){try{if(this.getSubjectList&&this.getSubjectList.length>0)return Promise.resolve();const{data:e}=await a({delFlag:0,page:1,rows:999}),t=e||[],s=[];return t.forEach((e=>{if(e.instruments&&e.instruments.length>0){e.value=e.id,e.label=e.name,e.instruments.forEach((e=>{e.label=e.name,e.value=e.id}));const t={value:e.id,label:e.name,id:e.id,name:e.name,instruments:[]};e.instruments&&(1==e.instruments.length?(t.value=e.instruments[0].id,t.label=e.instruments[0].name,t.id=e.id,t.name=e.name):e.instruments.length>1&&e.instruments.forEach((e=>{e.label=e.name,e.value=e.id,t.instruments.push({label:e.name,value:e.id,id:e.id,name:e.name})}))),s.push(t)}})),this.setSubjects(t.filter((e=>e.instruments&&e.instruments.length>0))||0),this.setSubjectInstruemnts(s||[]),Promise.resolve()}catch(e){return Promise.reject(e)}},getEnableSingleAllSubjects(e){e=e||[];const s=[];this.getSubjectList.forEach((r=>{const a=t(r);Array.isArray(a.instruments)&&a.instruments.forEach((t=>{e.includes(t.id)&&(t.enableFlag=!0,a.enableFlag=!0)})),s.push(a)}));const r=[];return s.forEach((e=>{if(e.enableFlag){const{instruments:t,...s}=e,a=[];t?.forEach((e=>{e.enableFlag&&a.push(e)})),a.length>0&&r.push({...s,instruments:a})}})),r},async getMusicSheetCategory(e=!1){try{if(this.getMusicCategories&&this.getMusicCategories.length>0&&!e)return Promise.resolve();const{data:t}=await i({enable:!0,page:1,rows:999});return this.setMusicCategories(t.rows||[]),Promise.resolve()}catch(t){return Promise.reject(t)}},async getMusicInstrument(){try{if(this.getMusicInstruments&&this.getMusicInstruments.length>0)return Promise.resolve();const{data:e}=await n({enableFlag:!0});return console.log(e,"data"),this.setMusicInstruments(e||[]),Promise.resolve()}catch(e){return Promise.reject(e)}},async getMusicTagTreeApi(){try{if(this.getMusicTagTree&&this.getMusicTagTree.length>0)return Promise.resolve();const{data:e}=await u(),t=e||[];return this.setMusicTagTree(t||[]),Promise.resolve()}catch(e){return Promise.reject(e)}},async getMaterialTagsApi(){try{if(this.getMaterialTags&&this.getMaterialTags.length>0)return Promise.resolve();const{data:e}=await l({page:1,rows:100}),t=e.rows||[],s=[];return t.forEach((e=>{s.push({label:e.name,value:e.id})})),this.setMaterialTags(s||[]),Promise.resolve()}catch(e){return Promise.reject(e)}}}}))}}}));
