colxiu-website-legacy.f530b17d.js 10 KB

1
  1. !function(){function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?e(Object(a),!0).forEach((function(e){r(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}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 i,u=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){c=!0,i=e},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw i}}}}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,o=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(c){u=!0,a=c}finally{try{i||null==r.return||r.return()}finally{if(u)throw a}}return o}(e,t)||o(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 o(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t,r,n,a,o,i){try{var u=e[o](i),c=u.value}catch(s){return void r(s)}u.done?t(c):Promise.resolve(c).then(n,a)}function c(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(e){u(o,n,a,i,c,"next",e)}function c(e){u(o,n,a,i,c,"throw",e)}i(void 0)}))}}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t,r){return t&&s(e.prototype,t),r&&s(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var f=document.createElement("style");f.innerHTML="._container_1fh7z_1{min-height:17.73333rem}._musicSheet_1fh7z_4{padding-top:.13333rem;background:#fff}._musicSheet_1fh7z_4 img{display:none!important}._btn_1fh7z_11{position:fixed;bottom:.4rem;z-index:9;left:50%;transform:translate(-50%)}._btn_1fh7z_11 ._btnCont_1fh7z_18{height:auto;padding:0;background-color:transparent;border:none}\n",document.head.appendChild(f),System.register(["./App-legacy.705693f7.js","./lib-flexible-legacy.e8ca3d6a.js","./index-legacy.f25f109a.js","./index-legacy.ed91066b.js"],(function(){"use strict";var e,o,i,u,s,f,p,v,d,b,h,m,g,y,x,w,k,S,_,O,j,R,P,M,z,C,E,T,F,A,D;return{setters:[function(t){e=t.a0,o=t.a1,i=t.u,u=t.d,s=t.r,f=t.w,p=t.h,v=t.a,d=t.i,b=t.j,h=t.S,m=t.E,g=t.M,y=t.U,x=t.B,w=t.k,k=t.o,S=t.l,_=t.a2,O=t.m,j=t.n,R=t.p,P=t.q,M=t.v,z=t.x,C=t.y,E=t.z,T=t.C,F=t.D,A=t.c},function(){},function(){},function(e){D=e.P}],execute:function(){var I={container:"_container_1fh7z_1",musicSheet:"_musicSheet_1fh7z_4",btn:"_btn_1fh7z_11",btnCont:"_btnCont_1fh7z_18"};window.OffscreenCanvas||(window.OffscreenCanvas=l((function e(t,r){var n=this;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.canvas=document.createElement("canvas"),this.canvas.width=t,this.canvas.height=r,this.canvas.convertToBlob=function(){return new Promise((function(e){n.canvas.toBlob(e)}))},this.canvas})));var B=e.offscreen();function L(e){return new Promise((function(t,r){var n=new FileReader;n.onloadend=function(){return t(n.result)},n.readAsDataURL(e)}))}function N(e,t,r){return U.apply(this,arguments)}function U(){return(U=c(regeneratorRuntime.mark((function e(t,r,n){var a,i,u,c,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=new OffscreenCanvas(r,n),(i=a.getContext("2d")).fillStyle="#FFFFFF",e.next=5,o.fromString(i,t,B);case 5:return(u=e.sent).resize(2*r,2*n,"xMidYMid meet"),e.next=9,u.start();case 9:return e.next=11,a.convertToBlob();case 11:return c=e.sent,e.next=14,L(c);case 14:return s=e.sent,e.abrupt("return",s);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var X=i();console.log(X,"search");var H=function(){var e=c(regeneratorRuntime.mark((function e(t,r){var n,a,o,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,P(t);case 2:return n=e.sent,a=s(""),o=M(n),a.value=z(o.parsedXML,{title:r.musicSheetName}),i=Number(X["part-index"])||0,a.value=C(a.value,i),e.abrupt("return",a);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),W=u({name:"ColexiuWebSite",setup:function(){var e=s(!0),o=s(!1),i=s(""),u=function(e){var t=s("loading"),r=s({}),n=s({});return k(c(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.value="loading",e.prev=1,e.next=4,S.get("/open/music/sheet/detail/".concat(X.id),{prefix:"/api-website"});case 4:n=e.sent,r.value=n.data,b.partIndex=0,t.value="success",e.next=14;break;case 10:e.prev=10,e.t0=e.catch(1),t.value="error",console.log(e.t0);case 14:case"end":return e.stop()}}),e,null,[[1,10]])})))),[t,r,n]}(X.id),l=a(u,3),P=l[0],M=l[1],z=l[2],C=new _(650,884);f(P,c(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("success"!==P.value||!M.value.xmlFileUrl){e.next=5;break}return e.next=3,H(M.value.xmlFileUrl,M.value);case 3:t=e.sent,i.value=t.value;case 5:case"end":return e.stop()}}),e)})))),p();var F=function(){var e=c(regeneratorRuntime.mark((function e(t){var r,a,o,i,u,c,s,l,f,p,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=22;break}r=n(t.Drawer.Backends),e.prev=2,r.s();case 4:if((a=r.n()).done){e.next=14;break}return o=a.value,i=o.ctx,u=i.state,c=i.width,s=i.height,l=u.scale,f=l.x,p=l.y,v=(new XMLSerializer).serializeToString(o.ctx.svg),e.next=11,N(v,c/f,s/p);case 11:return e.abrupt("return",e.sent);case 12:e.next=4;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(2),r.e(e.t0);case 19:return e.prev=19,r.f(),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[2,16,19,22]])})));return function(t){return e.apply(this,arguments)}}(),A=function(){var e=c(regeneratorRuntime.mark((function e(t){var r,n,a,o,i,u,c,s,l,f,p,v;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=18;break}if(r=[],!(t.Drawer.Backends.length>0)){e.next=18;break}n=0,a=t.Drawer.Backends.length;case 4:if(!(n<a)){e.next=17;break}return o=t.Drawer.Backends[n],i=o.ctx,u=i.state,c=i.width,s=i.height,l=u.scale,f=l.x,p=l.y,v=(new XMLSerializer).serializeToString(o.ctx.svg),e.t0=r,e.next=12,N(v,c/f,s/p);case 12:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 14:n++,e.next=4;break;case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),B=function(){var a=c(regeneratorRuntime.mark((function a(o){var i,u,c,s,l,f,p,v,d,h,m,g;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!window.parent){a.next=13;break}if("multiple"!==X.pageType){a.next=7;break}return a.next=4,A(o);case 4:a.t0=a.sent,a.next=10;break;case 7:return a.next=9,F(o);case 9:a.t0=a.sent;case 10:i=a.t0,console.log(i,"img"),window.parent.postMessage(i,"*");case 13:if(O.osmd=o,u=j(o),e.value=!1,c=function(e,n){var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=E(e);b.evaluatings=t(t({},b.evaluatings),{},r({},o.measureIndex,t(t(t({},o),T(n.score)),{},{score:n.score,dontTransition:a})))},!z.value.userMeasureScore){a.next=64;break}a.t1=regeneratorRuntime.keys(z.value.userMeasureScore);case 19:if((a.t2=a.t1()).done){a.next=64;break}if(s=a.t2.value,!Object.prototype.hasOwnProperty.call(z.value.userMeasureScore,s)){a.next=62;break}l=z.value.userMeasureScore[s],f=n(u),a.prev=24,f.s();case 26:if((p=f.n()).done){a.next=54;break}if(v=p.value,l.measureRenderIndex!=v.noteElement.sourceMeasure.MeasureNumberXML-1){a.next=52;break}if(v.noteElement.tie){a.next=33;break}c(v,l),a.next=52;break;case 33:d=n(v.noteElement.tie.notes),a.prev=34,d.s();case 36:if((h=d.n()).done){a.next=44;break}if(m=h.value,g=R(m)){a.next=41;break}return a.abrupt("continue",42);case 41:c(g,l,m!==v.noteElement.tie.StartNote);case 42:a.next=36;break;case 44:a.next=49;break;case 46:a.prev=46,a.t3=a.catch(34),d.e(a.t3);case 49:return a.prev=49,d.f(),a.finish(49);case 52:a.next=26;break;case 54:a.next=59;break;case 56:a.prev=56,a.t4=a.catch(24),f.e(a.t4);case 59:return a.prev=59,f.f(),a.finish(59);case 62:a.next=19;break;case 64:case"end":return a.stop()}}),a,null,[[24,56,59,62],[34,46,49,52]])})));return function(e){return a.apply(this,arguments)}}(),L=function(){o.value=!0,e.value=!1};return function(){var t,r,n=e.value||"loading"===P.value,a=o.value||"error"===P.value;return v("div",{class:[d.container,w.sett.eyeProtection&&"eyeProtection",w.sett.camera&&"openCamera"]},[v("div",{id:"colexiu-detail-music-sheet",class:[d.musicSheet,I.musicSheet],style:{paddingLeft:b.isSpecialShapedScreen?b.notchHeight/2+"px":"auto"}},[n&&!a&&v(h,{class:d.skeleton,rowWidth:"80%",title:!0,row:15},null),a&&v(m,null,null),i.value&&v(g,{score:i.value,opotions:{drawTitle:!1,drawComposer:!1,drawLyricist:!1,drawMetronomeMarks:!0,drawMeasureNumbers:!0},EngravingRules:"multiple"===X.pageType?{PageFormat:C}:{},onRerender:B,onRenderError:L},null)]),null!==(t=z.value)&&void 0!==t&&t.videoFilePath&&0===(null===(r=z.value)||void 0===r?void 0:r.expire)?v(D,y(z.value,{btnClass:I.btn,popupClass:I.popup}),{default:function(){return[v(x,{class:I.btnCont},{default:function(){return[v("img",{src:ReplayIcon},null)]}})]}}):null])}}});F(),A(W).mount("#app")}}}))}();