Spaces:
Running
Running
Commit ·
f77a308
1
Parent(s): 2e55f36
update: export from starry-refactor 2026-02-18 15:23
Browse files- dist/assets/{Table-67d781d8.js → Table-cb37e8e0.js} +0 -0
- dist/assets/{Tags-08a40205.js → Tags-3c874079.js} +1 -1
- dist/assets/{_setToString-4a3d3b61.js → _setToString-1e1135c3.js} +0 -0
- dist/assets/{button-0e45694d.js → button-eba43326.js} +1 -1
- dist/assets/{confirm-6338cd87.js → confirm-c1024f99.js} +0 -0
- dist/assets/{font-6c830a10.js → font-dfbceec9.js} +1 -1
- dist/assets/{gauge-4606aaef.js → gauge-5ac462fb.js} +1 -1
- dist/assets/{index-5cf2d389.js → index-0bf6103c.js} +1 -1
- dist/assets/{index-c63774d4.js → index-0ccf2ddd.js} +2 -2
- dist/assets/index-209da080.js +0 -1
- dist/assets/{index-df1803a9.js → index-49aef8b5.js} +1 -1
- dist/assets/{index-077055d7.js → index-4e219cb7.js} +1 -1
- dist/assets/index-7584011d.js +1 -0
- dist/assets/{index-d6bbb942.js → index-7c2856f0.js} +1 -1
- dist/assets/{index-ada8c078.js → index-b66f8eba.js} +1 -1
- dist/assets/index-b6983081.js +1 -0
- dist/assets/{index-02a9660a.js → index-d19b5eaf.js} +1 -1
- dist/assets/index-dbf40634.js +0 -1
- dist/assets/{index-02743632.js → index-f9505f65.js} +1 -1
- dist/assets/{index-72c1f0f7.js → index-f9ab2910.js} +0 -0
- dist/assets/index.less_used_.module-ae8585e9.js +0 -0
- dist/assets/index.less_used_.module-be0d6d9a.js +0 -0
- dist/assets/{jszip.min-afb240b6.js → jszip.min-4f73c8ba.js} +1 -1
- dist/assets/possibleConstructorReturn-5d2155d0.js +0 -3
- dist/assets/{processCompressedAESFile-405b7aba.js → processCompressedAESFile-fac57b0a.js} +0 -0
- dist/assets/{umi-2cc549ef.js → umi-a044fd32.js} +0 -0
- dist/assets/{useAsync-a87a60de.js → useAsync-0af7a050.js} +1 -1
- dist/assets/{useDebounce-84d2d30c.js → useDebounce-51aac85c.js} +0 -0
- dist/assets/{useIntersection-d83075c4.js → useIntersection-970b9f71.js} +1 -1
- dist/index.html +1 -1
- dist/pdf.worker.min.js +0 -0
dist/assets/{Table-67d781d8.js → Table-cb37e8e0.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{Tags-08a40205.js → Tags-3c874079.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{A as L,g as E,V as b,a as J,W as G,X as H,o as X,c as q,f as K,r as T}from"./_setToString-
|
|
|
|
| 1 |
+
import{A as L,g as E,V as b,a as J,W as G,X as H,o as X,c as q,f as K,r as T}from"./_setToString-1e1135c3.js";import{r as s,_ as U,j as l}from"./umi-a044fd32.js";import{t as W,B as w}from"./button-eba43326.js";import{S as z,T as R,D as F,a as Q}from"./useDebounce-51aac85c.js";import{i as V,n as _,E as Y}from"./index-49aef8b5.js";var Z={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M696 480H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"plus-circle",theme:"outlined"};const ee=Z;var te=function(n,r){return s.createElement(L,E(E({},n),{},{ref:r,icon:ee}))},se=s.forwardRef(te);const xe=se;var ae={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M938 458.8l-29.6-312.6c-1.5-16.2-14.4-29-30.6-30.6L565.2 86h-.4c-3.2 0-5.7 1-7.6 2.9L88.9 557.2a9.96 9.96 0 000 14.1l363.8 363.8c1.9 1.9 4.4 2.9 7.1 2.9s5.2-1 7.1-2.9l468.3-468.3c2-2.1 3-5 2.8-8zM459.7 834.7L189.3 564.3 589 164.6 836 188l23.4 247-399.7 399.7zM680 256c-48.5 0-88 39.5-88 88s39.5 88 88 88 88-39.5 88-88-39.5-88-88-88zm0 120c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]},name:"tag",theme:"outlined"};const re=ae;var ne=function(n,r){return s.createElement(L,E(E({},n),{},{ref:r,icon:re}))},ie=s.forwardRef(ne);const ce=ie;var N=z.Option;function I(a){return a&&a.type&&(a.type.isSelectOption||a.type.isSelectOptGroup)}var le=function(n,r){var C=n.prefixCls,g=n.className,x=n.popupClassName,p=n.dropdownClassName,o=n.children,O=n.dataSource,u=W(o),i;if(u.length===1&&b(u[0])&&!I(u[0])){var f=J(u,1);i=f[0]}var c=i?function(){return i}:void 0,v;return u.length&&I(u[0])?v=o:v=O?O.map(function(d){if(b(d))return d;switch(G(d)){case"string":return s.createElement(N,{key:d,value:d},d);case"object":{var S=d.value;return s.createElement(N,{key:S,value:S},d.text)}default:return}}):[],s.createElement(H,null,function(d){var S=d.getPrefixCls,y=S("select",C);return s.createElement(z,U({ref:r},X(n,["dataSource"]),{prefixCls:y,popupClassName:x||p,className:q("".concat(y,"-auto-complete"),g),mode:z.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:c}),v)})},$=s.forwardRef(le);$.Option=N;const oe=$;var ue=function(a,n,r){if(!V)return[n,_,_];if(!a)throw new Error("useLocalStorage key may not be falsy");var C=r?r.raw?function(i){return i}:r.deserializer:JSON.parse,g=s.useRef(function(i){try{var f=r?r.raw?String:r.serializer:JSON.stringify,c=localStorage.getItem(i);return c!==null?C(c):(n&&localStorage.setItem(i,f(n)),n)}catch{return n}}),x=s.useState(function(){return g.current(a)}),p=x[0],o=x[1];s.useLayoutEffect(function(){return o(g.current(a))},[a]);var O=s.useCallback(function(i){try{var f=typeof i=="function"?i(p):i;if(typeof f>"u")return;var c=void 0;r?r.raw?typeof f=="string"?c=f:c=JSON.stringify(f):r.serializer?c=r.serializer(f):c=JSON.stringify(f):c=JSON.stringify(f),localStorage.setItem(a,c),o(C(c))}catch{}},[a,o]),u=s.useCallback(function(){try{localStorage.removeItem(a),o(void 0)}catch{}},[a,o]);return[p,O,u]};const fe=ue,de=({id:a,tagList:n,onChange:r,preview:C})=>{const[g,x]=s.useState(""),p=s.useRef(null),[o,O]=fe("TAG_PRIORITIES",{}),[u,i]=s.useState(!1),[f,c]=s.useState(null),[v,d]=s.useState(!1),[S,y]=K(async()=>T.get("/api/tags"),[]);s.useLayoutEffect(()=>{var e;u&&((e=p.current)==null||e.focus())},[u]);const h=f||n,A=s.useMemo(()=>{var e;return((e=S.value)==null?void 0:e.filter(t=>!h.some(m=>m.id===t.id)).sort((t,m)=>(o[m.id]||0)-(o[t.id]||0)).filter(t=>t.name.indexOf(g)>-1).map(t=>({value:t.name})))??[]},[h,S.value,o,g]),P=async e=>{const t=await T.post("/api/tags",{data:{name:e}});return{name:e,id:t.id}},B=async(e,t)=>{O({...o,[t]:Date.now()});const m=await T.post(`/api/musicSets/${e}/tags/${t}`);return!!(m!=null&&m.success)},M=async(e,t)=>{const m=await T.delete(`/api/musicSets/${e}/tags/${t}`);return!!(m!=null&&m.success)},D=async()=>{if(!g){i(!1);return}const e=await P(g);if(a&&await B(a,e.id),g&&!h.some(t=>t.id===e.id)){const t=[...h,e];c(t),r&&r(t)}i(!1),x("")},k=async e=>{a&&await M(a,e.id);const t=h.filter(m=>m.id!==e.id);c(t),r&&r(t)},j=s.useCallback(async()=>{await y(),d(!v)},[]);return l.jsxs(l.Fragment,{children:[C?l.jsx("div",{onClick:j,children:h.length?h.map(e=>l.jsx(R,{style:{display:"inline-block",fontSize:"12px",marginRight:"5px",marginBottom:"5px"},children:e.name},e.id)):l.jsx(w,{type:"dashed",icon:l.jsx(Y,{}),size:"small"})}):l.jsx(w,{title:"标签",icon:l.jsx(ce,{}),onClick:j}),l.jsx(F,{title:"标签管理",placement:"right",onClose:()=>d(!1),open:v,mask:!0,style:{marginTop:"64px",height:"calc(100vh - 64px)"},children:l.jsxs("div",{className:"score-tags",children:[l.jsx("div",{className:"list",children:h.map(e=>l.jsx(R,{closable:!0,onClose:()=>k(e),style:{display:"inline-block",marginRight:"5px",marginBottom:"5px"},children:e.name},e.id))}),u&&l.jsx(oe,{ref:p,size:"small",backfill:!0,options:A,style:{width:100},onChange:e=>{x(e)},placeholder:"输入",onBlur:()=>D(),onSelect:()=>{setTimeout(()=>{var e;(e=p.current)==null||e.blur()},0)},onKeyDown:e=>{e.key==="Enter"&&p.current.blur()}}),!u&&l.jsx(w,{className:"site-tag-plus",size:"small",onClick:()=>i(!0),children:l.jsx(Q,{})})]})})]})},Se=de;export{oe as A,xe as P,Se as S,ce as T,fe as u};
|
dist/assets/{_setToString-4a3d3b61.js → _setToString-1e1135c3.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{button-0e45694d.js → button-eba43326.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{R as S,r as i,_ as O}from"./umi-
|
| 2 |
[`.concat(b(""),"-click-animating-without-extra-node='true']::after, .").concat(b(""),`-click-animating-node {
|
| 3 |
--antd-wave-shadow-color: `).concat(r,`;
|
| 4 |
}`),"antd-wave",{csp:n.csp,attachTo:f})}l&&e.appendChild(g),["transition","animation"].forEach(function(m){e.addEventListener("".concat(m,"start"),n.onTransitionStart),e.addEventListener("".concat(m,"end"),n.onTransitionEnd)})}},n.onTransitionStart=function(e){if(!n.destroyed){var r=n.containerRef.current;!e||e.target!==r||n.animationStart||n.resetEffect(r)}},n.onTransitionEnd=function(e){!e||e.animationName!=="fadeEffect"||n.resetEffect(e.target)},n.bindAnimationEvent=function(e){if(!(!e||!e.getAttribute||e.getAttribute("disabled")||e.className.includes("disabled"))){var r=function(c){if(!(c.target.tagName==="INPUT"||Ce(c.target))){n.resetEffect(e);var s=getComputedStyle(e).getPropertyValue("border-top-color")||getComputedStyle(e).getPropertyValue("border-color")||getComputedStyle(e).getPropertyValue("background-color");n.clickWaveTimeoutId=window.setTimeout(function(){return n.onClick(e,s)},0),z.cancel(n.animationStartId),n.animationStart=!0,n.animationStartId=z(function(){n.animationStart=!1},10)}};return e.addEventListener("click",r,!0),{cancel:function(){e.removeEventListener("click",r,!0)}}}},n.renderWave=function(e){var r=e.csp,o=n.props.children;if(n.csp=r,!i.isValidElement(o))return o;var c=n.containerRef;return Be(o)&&(c=Fe(o.ref,n.containerRef)),be(o,{ref:c})},n}return Me(t,[{key:"componentDidMount",value:function(){this.destroyed=!1;var e=this.containerRef.current;!e||e.nodeType!==1||(this.instance=this.bindAnimationEvent(e))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var e=this.context.getPrefixCls,r=this.props.insertExtraNode;return r?"".concat(e(""),"-click-animating"):"".concat(e(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(e){var r=this;if(!(!e||e===this.extraNode||!(e instanceof Element))){var o=this.props.insertExtraNode,c=this.getAttributeName();e.setAttribute(c,"false"),F&&(F.innerHTML=""),o&&this.extraNode&&e.contains(this.extraNode)&&e.removeChild(this.extraNode),["transition","animation"].forEach(function(s){e.removeEventListener("".concat(s,"start"),r.onTransitionStart),e.removeEventListener("".concat(s,"end"),r.onTransitionEnd)})}}},{key:"render",value:function(){return i.createElement(Ge,null,this.renderWave)}}]),t}(i.Component);xe.contextType=w;const it=xe;var ot=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},Ne=i.createContext(void 0),ct=function(t){var n=i.useContext(w),e=n.getPrefixCls,r=n.direction,o=t.prefixCls,c=t.size,s=t.className,l=ot(t,["prefixCls","size","className"]),v=e("btn-group",o),p="";switch(c){case"large":p="lg";break;case"small":p="sm";break}var g=R(v,u(u({},"".concat(v,"-").concat(p),p),"".concat(v,"-rtl"),r==="rtl"),s);return i.createElement(Ne.Provider,{value:c},i.createElement("div",O({},l,{className:g})))};const st=ct;var M=function(){return{width:0,opacity:0,transform:"scale(0)"}},G=function(t){return{width:t.scrollWidth,opacity:1,transform:"scale(1)"}},lt=function(t){var n=t.prefixCls,e=t.loading,r=t.existIcon,o=!!e;return r?S.createElement("span",{className:"".concat(n,"-loading-icon")},S.createElement(pe,null)):S.createElement(He,{visible:o,motionName:"".concat(n,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:M,onAppearActive:G,onEnterStart:M,onEnterActive:G,onLeaveStart:G,onLeaveActive:M},function(c,s){var l=c.className,v=c.style;return S.createElement("span",{className:"".concat(n,"-loading-icon"),style:v,ref:s},S.createElement(pe,{className:l}))})};const ut=lt;var ft=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},he=/^[\u4e00-\u9fa5]{2}$/,q=he.test.bind(he);function dt(a){return typeof a=="string"}function U(a){return a==="text"||a==="link"}function mt(a,t){if(a!=null){var n=t?" ":"";return typeof a!="string"&&typeof a!="number"&&dt(a.type)&&q(a.props.children)?be(a,{children:a.props.children.split("").join(n)}):typeof a=="string"?q(a)?i.createElement("span",null,a.split("").join(n)):i.createElement("span",null,a):Ke(a)?i.createElement("span",null,a):a}}function vt(a,t){var n=!1,e=[];return i.Children.forEach(a,function(r){var o=Je(r),c=o==="string"||o==="number";if(n&&c){var s=e.length-1,l=e[s];e[s]="".concat(l).concat(r)}else e.push(r);n=c}),i.Children.map(e,function(r){return mt(r,t)})}Q("default","primary","ghost","dashed","link","text");Q("default","circle","round");Q("submit","button","reset");function yt(a){return a==="danger"?{danger:!0}:{type:a}}var pt=function(t,n){var e,r=t.loading,o=r===void 0?!1:r,c=t.prefixCls,s=t.type,l=s===void 0?"default":s,v=t.danger,p=t.shape,g=p===void 0?"default":p,b=t.size,C=t.disabled,x=t.className,f=t.children,m=t.icon,T=t.ghost,I=T===void 0?!1:T,N=t.block,L=N===void 0?!1:N,J=t.htmlType,Ee=J===void 0?"button":J,K=ft(t,["loading","prefixCls","type","danger","shape","size","disabled","className","children","icon","ghost","block","htmlType"]),Se=i.useContext(qe),ke=i.useContext(Qe),A=C??ke,Ie=i.useContext(Ne),_e=i.useState(!!o),Y=ge(_e,2),y=Y[0],Z=Y[1],Te=i.useState(!1),ee=ge(Te,2),W=ee[0],te=ee[1],D=i.useContext(w),Pe=D.getPrefixCls,ne=D.autoInsertSpaceInButton,ae=D.direction,E=n||i.createRef(),re=function(){return i.Children.count(f)===1&&!m&&!U(l)},Oe=function(){if(!(!E||!E.current||ne===!1)){var P=E.current.textContent;re()&&q(P)?W||te(!0):W&&te(!1)}},_=typeof o=="boolean"?o:(o==null?void 0:o.delay)||!0;i.useEffect(function(){var h=null;return typeof _=="number"?h=window.setTimeout(function(){h=null,Z(_)},_):Z(_),function(){h&&(window.clearTimeout(h),h=null)}},[_]),i.useEffect(Oe,[E]);var ie=function(P){var B=t.onClick;if(y||A){P.preventDefault();return}B==null||B(P)},d=Pe("btn",c),oe=ne!==!1,ce=Ye(d,ae),ze=ce.compactSize,we=ce.compactItemClassnames,Re={large:"lg",small:"sm",middle:void 0},se=ze||Ie||b||Se,le=se&&Re[se]||"",$e=y?"loading":m,j=Xe(K,["navigate"]),ue=R(d,(e={},u(u(u(u(u(u(u(u(u(u(e,"".concat(d,"-").concat(g),g!=="default"&&g),"".concat(d,"-").concat(l),l),"".concat(d,"-").concat(le),le),"".concat(d,"-icon-only"),!f&&f!==0&&!!$e),"".concat(d,"-background-ghost"),I&&!U(l)),"".concat(d,"-loading"),y),"".concat(d,"-two-chinese-chars"),W&&oe&&!y),"".concat(d,"-block"),L),"".concat(d,"-dangerous"),!!v),"".concat(d,"-rtl"),ae==="rtl"),u(e,"".concat(d,"-disabled"),j.href!==void 0&&A)),we,x),fe=m&&!y?m:i.createElement(ut,{existIcon:!!m,prefixCls:d,loading:!!y}),de=f||f===0?vt(f,re()&&oe):null;if(j.href!==void 0)return i.createElement("a",O({},j,{className:ue,onClick:ie,ref:E}),fe,de);var me=i.createElement("button",O({},K,{type:Ee,className:ue,onClick:ie,disabled:A,ref:E}),fe,de);return U(l)?me:i.createElement(it,{disabled:!!y},me)},X=i.forwardRef(pt);X.Group=st;X.__ANT_BUTTON=!0;const xt=X;export{xt as B,bt as C,ht as N,it as W,yt as c,H as t,Ye as u};
|
|
|
|
| 1 |
+
import{R as S,r as i,_ as O}from"./umi-a044fd32.js";import{bP as Le,C as w,c as R,b as u,w as V,a1 as Ae,a0 as We,a4 as De,bI as je,aq as Be,a7 as Fe,e as be,$ as Me,X as Ge,a2 as ve,a3 as Ue,bs as Ve,Q as pe,d as He,ak as Q,af as qe,ag as Qe,a as ge,o as Xe,W as Je,bH as Ke}from"./_setToString-1e1135c3.js";function H(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[];return S.Children.forEach(a,function(e){e==null&&!t.keepEmpty||(Array.isArray(e)?n=n.concat(H(e)):Le(e)&&e.props?n=n.concat(H(e.props.children,t)):n.push(e))}),n}var ye=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},$=i.createContext(null),Ye=function(t,n){var e=i.useContext($),r=i.useMemo(function(){if(!e)return"";var o=e.compactDirection,c=e.isFirstItem,s=e.isLastItem,l=o==="vertical"?"-vertical-":"-";return R(u(u(u(u({},"".concat(t,"-compact").concat(l,"item"),!0),"".concat(t,"-compact").concat(l,"first-item"),c),"".concat(t,"-compact").concat(l,"last-item"),s),"".concat(t,"-compact").concat(l,"item-rtl"),n==="rtl"))},[t,n,e]);return{compactSize:e==null?void 0:e.compactSize,compactDirection:e==null?void 0:e.compactDirection,compactItemClassnames:r}},ht=function(t){var n=t.children;return i.createElement($.Provider,{value:null},n)},Ze=function(t){var n=t.children,e=ye(t,["children"]);return i.createElement($.Provider,{value:e},n)},et=function(t){var n=i.useContext(w),e=n.getPrefixCls,r=n.direction,o=t.size,c=o===void 0?"middle":o,s=t.direction,l=t.block,v=t.prefixCls,p=t.className,g=t.children,b=ye(t,["size","direction","block","prefixCls","className","children"]),C=e("space-compact",v),x=R(C,u(u(u({},"".concat(C,"-rtl"),r==="rtl"),"".concat(C,"-block"),l),"".concat(C,"-vertical"),s==="vertical"),p),f=i.useContext($),m=H(g),T=i.useMemo(function(){return m.map(function(I,N){var L=I&&I.key||"".concat(C,"-item-").concat(N);return i.createElement(Ze,{key:L,compactSize:c,compactDirection:s,isFirstItem:N===0&&(!f||(f==null?void 0:f.isFirstItem)),isLastItem:N===m.length-1&&(!f||(f==null?void 0:f.isLastItem))},I)})},[c,m,f]);return m.length===0?null:i.createElement("div",O({className:x},b),T)};const bt=et;var tt=0,k={};function z(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,n=tt++,e=t;function r(){e-=1,e<=0?(a(),delete k[n]):k[n]=V(r)}return k[n]=V(r),n}z.cancel=function(t){t!==void 0&&(V.cancel(k[t]),delete k[t])};z.ids=k;function nt(a,t,n){return t=ve(t),Ue(a,Ve()?Reflect.construct(t,n||[],ve(a).constructor):t.apply(a,n))}var F;function Ce(a){return!a||a.offsetParent===null||a.hidden}function at(a){return a instanceof Document?a.body:Array.from(a.childNodes).find(function(t){return(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE})}function rt(a){var t=(a||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return t&&t[1]&&t[2]&&t[3]?!(t[1]===t[2]&&t[2]===t[3]):!0}var xe=function(a){Ae(t,a);function t(){var n;return We(this,t),n=nt(this,t,arguments),n.containerRef=i.createRef(),n.animationStart=!1,n.destroyed=!1,n.onClick=function(e,r){var o,c,s=n.props,l=s.insertExtraNode,v=s.disabled;if(!(v||!e||Ce(e)||e.className.includes("-leave"))){n.extraNode=document.createElement("div");var p=De(n),g=p.extraNode,b=n.context.getPrefixCls;g.className="".concat(b(""),"-click-animating-node");var C=n.getAttributeName();if(e.setAttribute(C,"true"),r&&r!=="#fff"&&r!=="#ffffff"&&r!=="rgb(255, 255, 255)"&&r!=="rgba(255, 255, 255, 1)"&&rt(r)&&!/rgba\((?:\d*, ){3}0\)/.test(r)&&r!=="transparent"){g.style.borderColor=r;var x=((o=e.getRootNode)===null||o===void 0?void 0:o.call(e))||e.ownerDocument,f=(c=at(x))!==null&&c!==void 0?c:x;F=je(`
|
| 2 |
[`.concat(b(""),"-click-animating-without-extra-node='true']::after, .").concat(b(""),`-click-animating-node {
|
| 3 |
--antd-wave-shadow-color: `).concat(r,`;
|
| 4 |
}`),"antd-wave",{csp:n.csp,attachTo:f})}l&&e.appendChild(g),["transition","animation"].forEach(function(m){e.addEventListener("".concat(m,"start"),n.onTransitionStart),e.addEventListener("".concat(m,"end"),n.onTransitionEnd)})}},n.onTransitionStart=function(e){if(!n.destroyed){var r=n.containerRef.current;!e||e.target!==r||n.animationStart||n.resetEffect(r)}},n.onTransitionEnd=function(e){!e||e.animationName!=="fadeEffect"||n.resetEffect(e.target)},n.bindAnimationEvent=function(e){if(!(!e||!e.getAttribute||e.getAttribute("disabled")||e.className.includes("disabled"))){var r=function(c){if(!(c.target.tagName==="INPUT"||Ce(c.target))){n.resetEffect(e);var s=getComputedStyle(e).getPropertyValue("border-top-color")||getComputedStyle(e).getPropertyValue("border-color")||getComputedStyle(e).getPropertyValue("background-color");n.clickWaveTimeoutId=window.setTimeout(function(){return n.onClick(e,s)},0),z.cancel(n.animationStartId),n.animationStart=!0,n.animationStartId=z(function(){n.animationStart=!1},10)}};return e.addEventListener("click",r,!0),{cancel:function(){e.removeEventListener("click",r,!0)}}}},n.renderWave=function(e){var r=e.csp,o=n.props.children;if(n.csp=r,!i.isValidElement(o))return o;var c=n.containerRef;return Be(o)&&(c=Fe(o.ref,n.containerRef)),be(o,{ref:c})},n}return Me(t,[{key:"componentDidMount",value:function(){this.destroyed=!1;var e=this.containerRef.current;!e||e.nodeType!==1||(this.instance=this.bindAnimationEvent(e))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var e=this.context.getPrefixCls,r=this.props.insertExtraNode;return r?"".concat(e(""),"-click-animating"):"".concat(e(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(e){var r=this;if(!(!e||e===this.extraNode||!(e instanceof Element))){var o=this.props.insertExtraNode,c=this.getAttributeName();e.setAttribute(c,"false"),F&&(F.innerHTML=""),o&&this.extraNode&&e.contains(this.extraNode)&&e.removeChild(this.extraNode),["transition","animation"].forEach(function(s){e.removeEventListener("".concat(s,"start"),r.onTransitionStart),e.removeEventListener("".concat(s,"end"),r.onTransitionEnd)})}}},{key:"render",value:function(){return i.createElement(Ge,null,this.renderWave)}}]),t}(i.Component);xe.contextType=w;const it=xe;var ot=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},Ne=i.createContext(void 0),ct=function(t){var n=i.useContext(w),e=n.getPrefixCls,r=n.direction,o=t.prefixCls,c=t.size,s=t.className,l=ot(t,["prefixCls","size","className"]),v=e("btn-group",o),p="";switch(c){case"large":p="lg";break;case"small":p="sm";break}var g=R(v,u(u({},"".concat(v,"-").concat(p),p),"".concat(v,"-rtl"),r==="rtl"),s);return i.createElement(Ne.Provider,{value:c},i.createElement("div",O({},l,{className:g})))};const st=ct;var M=function(){return{width:0,opacity:0,transform:"scale(0)"}},G=function(t){return{width:t.scrollWidth,opacity:1,transform:"scale(1)"}},lt=function(t){var n=t.prefixCls,e=t.loading,r=t.existIcon,o=!!e;return r?S.createElement("span",{className:"".concat(n,"-loading-icon")},S.createElement(pe,null)):S.createElement(He,{visible:o,motionName:"".concat(n,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:M,onAppearActive:G,onEnterStart:M,onEnterActive:G,onLeaveStart:G,onLeaveActive:M},function(c,s){var l=c.className,v=c.style;return S.createElement("span",{className:"".concat(n,"-loading-icon"),style:v,ref:s},S.createElement(pe,{className:l}))})};const ut=lt;var ft=globalThis&&globalThis.__rest||function(a,t){var n={};for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&t.indexOf(e)<0&&(n[e]=a[e]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,e=Object.getOwnPropertySymbols(a);r<e.length;r++)t.indexOf(e[r])<0&&Object.prototype.propertyIsEnumerable.call(a,e[r])&&(n[e[r]]=a[e[r]]);return n},he=/^[\u4e00-\u9fa5]{2}$/,q=he.test.bind(he);function dt(a){return typeof a=="string"}function U(a){return a==="text"||a==="link"}function mt(a,t){if(a!=null){var n=t?" ":"";return typeof a!="string"&&typeof a!="number"&&dt(a.type)&&q(a.props.children)?be(a,{children:a.props.children.split("").join(n)}):typeof a=="string"?q(a)?i.createElement("span",null,a.split("").join(n)):i.createElement("span",null,a):Ke(a)?i.createElement("span",null,a):a}}function vt(a,t){var n=!1,e=[];return i.Children.forEach(a,function(r){var o=Je(r),c=o==="string"||o==="number";if(n&&c){var s=e.length-1,l=e[s];e[s]="".concat(l).concat(r)}else e.push(r);n=c}),i.Children.map(e,function(r){return mt(r,t)})}Q("default","primary","ghost","dashed","link","text");Q("default","circle","round");Q("submit","button","reset");function yt(a){return a==="danger"?{danger:!0}:{type:a}}var pt=function(t,n){var e,r=t.loading,o=r===void 0?!1:r,c=t.prefixCls,s=t.type,l=s===void 0?"default":s,v=t.danger,p=t.shape,g=p===void 0?"default":p,b=t.size,C=t.disabled,x=t.className,f=t.children,m=t.icon,T=t.ghost,I=T===void 0?!1:T,N=t.block,L=N===void 0?!1:N,J=t.htmlType,Ee=J===void 0?"button":J,K=ft(t,["loading","prefixCls","type","danger","shape","size","disabled","className","children","icon","ghost","block","htmlType"]),Se=i.useContext(qe),ke=i.useContext(Qe),A=C??ke,Ie=i.useContext(Ne),_e=i.useState(!!o),Y=ge(_e,2),y=Y[0],Z=Y[1],Te=i.useState(!1),ee=ge(Te,2),W=ee[0],te=ee[1],D=i.useContext(w),Pe=D.getPrefixCls,ne=D.autoInsertSpaceInButton,ae=D.direction,E=n||i.createRef(),re=function(){return i.Children.count(f)===1&&!m&&!U(l)},Oe=function(){if(!(!E||!E.current||ne===!1)){var P=E.current.textContent;re()&&q(P)?W||te(!0):W&&te(!1)}},_=typeof o=="boolean"?o:(o==null?void 0:o.delay)||!0;i.useEffect(function(){var h=null;return typeof _=="number"?h=window.setTimeout(function(){h=null,Z(_)},_):Z(_),function(){h&&(window.clearTimeout(h),h=null)}},[_]),i.useEffect(Oe,[E]);var ie=function(P){var B=t.onClick;if(y||A){P.preventDefault();return}B==null||B(P)},d=Pe("btn",c),oe=ne!==!1,ce=Ye(d,ae),ze=ce.compactSize,we=ce.compactItemClassnames,Re={large:"lg",small:"sm",middle:void 0},se=ze||Ie||b||Se,le=se&&Re[se]||"",$e=y?"loading":m,j=Xe(K,["navigate"]),ue=R(d,(e={},u(u(u(u(u(u(u(u(u(u(e,"".concat(d,"-").concat(g),g!=="default"&&g),"".concat(d,"-").concat(l),l),"".concat(d,"-").concat(le),le),"".concat(d,"-icon-only"),!f&&f!==0&&!!$e),"".concat(d,"-background-ghost"),I&&!U(l)),"".concat(d,"-loading"),y),"".concat(d,"-two-chinese-chars"),W&&oe&&!y),"".concat(d,"-block"),L),"".concat(d,"-dangerous"),!!v),"".concat(d,"-rtl"),ae==="rtl"),u(e,"".concat(d,"-disabled"),j.href!==void 0&&A)),we,x),fe=m&&!y?m:i.createElement(ut,{existIcon:!!m,prefixCls:d,loading:!!y}),de=f||f===0?vt(f,re()&&oe):null;if(j.href!==void 0)return i.createElement("a",O({},j,{className:ue,onClick:ie,ref:E}),fe,de);var me=i.createElement("button",O({},K,{type:Ee,className:ue,onClick:ie,disabled:A,ref:E}),fe,de);return U(l)?me:i.createElement(it,{disabled:!!y},me)},X=i.forwardRef(pt);X.Group=st;X.__ANT_BUTTON=!0;const xt=X;export{xt as B,bt as C,ht as N,it as W,yt as c,H as t,Ye as u};
|
dist/assets/{confirm-6338cd87.js → confirm-c1024f99.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{font-6c830a10.js → font-dfbceec9.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as d,j as e}from"./umi-2cc549ef.js";const l={rests:[["rests-0","E000"],["rests-1","E001"],["rests-0o","E002"],["rests-1o","E003"],["rests-M3","E004"],["rests-M2","E005"],["rests-M1","E006"],["rests-M1o","E007"],["rests-2","E008"],["rests-2classical","E009"],["rests-2z","E00A"],["rests-3","E00B"],["rests-4","E00C"],["rests-5","E00D"],["rests-6","E00E"],["rests-7","E00F"],["rests-8","E010"],["rests-9","E011"],["rests-10","E012"],["rests-M3neomensural","E144"],["rests-M2neomensural","E145"],["rests-M1neomensural","E146"],["rests-0neomensural","E147"],["rests-1neomensural","E148"],["rests-2neomensural","E149"],["rests-3neomensural","E14A"],["rests-4neomensural","E14B"],["rests-M3mensural","E14C"],["rests-M2mensural","E14D"],["rests-M1mensural","E14E"],["rests-0mensural","E14F"],["rests-1mensural","E150"],["rests-2mensural","E151"],["rests-3mensural","E152"],["rests-4mensural","E153"]],accidentals:[["accidentals-sharp","E013"],["accidentals-sharp-arrowup","E014"],["accidentals-sharp-arrowdown","E015"],["accidentals-sharp-arrowboth","E016"],["accidentals-sharp-slashslash-stem","E017"],["accidentals-sharp-slashslashslash-stemstem","E018"],["accidentals-sharp-slashslashslash-stem","E019"],["accidentals-sharp-slash-stem","E01A"],["accidentals-sharp-slashslash-stemstemstem","E01B"],["accidentals-doublesharp","E01C"],["accidentals-natural","E01D"],["accidentals-natural-arrowup","E01E"],["accidentals-natural-arrowdown","E01F"],["accidentals-natural-arrowboth","E020"],["accidentals-flat","E021"],["accidentals-flat-arrowup","E022"],["accidentals-flat-arrowdown","E023"],["accidentals-flat-arrowboth","E024"],["accidentals-flat-slash","E025"],["accidentals-flat-slashslash","E026"],["accidentals-mirroredflat-flat","E027"],["accidentals-mirroredflat","E028"],["accidentals-mirroredflat-backslash","E029"],["accidentals-flatflat","E02A"],["accidentals-flatflat-slash","E02B"],["accidentals-rightparen","E02C"],["accidentals-leftparen","E02D"],["accidentals-medicaeaM1","E194"],["accidentals-vaticanaM1","E195"],["accidentals-vaticana0","E196"],["accidentals-mensural1","E197"],["accidentals-mensuralM1","E198"],["accidentals-hufnagelM1","E199"],["accidentals-kievan1","E19A"],["accidentals-kievanM1","E19B"]],arrowheads:[["arrowheads-open-01","E02E"],["arrowheads-open-0M1","E02F"],["arrowheads-open-11","E030"],["arrowheads-open-1M1","E031"],["arrowheads-close-01","E032"],["arrowheads-close-0M1","E033"],["arrowheads-close-11","E034"],["arrowheads-close-1M1","E035"]],dot:[["dot","E036"]],scripts:[["scripts-ufermata","E037"],["scripts-dfermata","E038"],["scripts-uhenzeshortfermata","E039"],["scripts-dhenzeshortfermata","E03A"],["scripts-uhenzelongfermata","E03B"],["scripts-dhenzelongfermata","E03C"],["scripts-ushortfermata","E03D"],["scripts-dshortfermata","E03E"],["scripts-uveryshortfermata","E03F"],["scripts-dveryshortfermata","E040"],["scripts-ulongfermata","E041"],["scripts-dlongfermata","E042"],["scripts-uverylongfermata","E043"],["scripts-dverylongfermata","E044"],["scripts-thumb","E045"],["scripts-sforzato","E046"],["scripts-espr","E047"],["scripts-staccato","E048"],["scripts-ustaccatissimo","E049"],["scripts-dstaccatissimo","E04A"],["scripts-tenuto","E04B"],["scripts-uportato","E04C"],["scripts-dportato","E04D"],["scripts-umarcato","E04E"],["scripts-dmarcato","E04F"],["scripts-open","E050"],["scripts-halfopen","E051"],["scripts-halfopenvertical","E052"],["scripts-stopped","E053"],["scripts-upbow","E054"],["scripts-downbow","E055"],["scripts-reverseturn","E056"],["scripts-turn","E057"],["scripts-slashturn","E058"],["scripts-haydnturn","E059"],["scripts-trill","E05A"],["scripts-upedalheel","E05B"],["scripts-dpedalheel","E05C"],["scripts-upedaltoe","E05D"],["scripts-dpedaltoe","E05E"],["scripts-flageolet","E05F"],["scripts-segno","E060"],["scripts-varsegno","E061"],["scripts-coda","E062"],["scripts-varcoda","E063"],["scripts-rcomma","E064"],["scripts-lcomma","E065"],["scripts-rvarcomma","E066"],["scripts-lvarcomma","E067"],["scripts-arpeggio","E068"],["scripts-trill_element","E069"],["scripts-arpeggio-arrow-M1","E06A"],["scripts-arpeggio-arrow-1","E06B"],["scripts-trillelement","E06C"],["scripts-prall","E06D"],["scripts-mordent","E06E"],["scripts-prallprall","E06F"],["scripts-prallmordent","E070"],["scripts-upprall","E071"],["scripts-upmordent","E072"],["scripts-prallup","E073"],["scripts-downprall","E074"],["scripts-downmordent","E075"],["scripts-pralldown","E076"],["scripts-lineprall","E077"],["scripts-caesura-curved","E078"],["scripts-caesura-straight","E079"],["scripts-tickmark","E07A"],["scripts-snappizzicato","E07B"],["scripts-ictus","E1CA"],["scripts-uaccentus","E1CB"],["scripts-daccentus","E1CC"],["scripts-usemicirculus","E1CD"],["scripts-dsemicirculus","E1CE"],["scripts-circulus","E1CF"],["scripts-augmentum","E1D0"],["scripts-usignumcongruentiae","E1D1"],["scripts-dsignumcongruentiae","E1D2"],["scripts-barline-kievan","E1D3"]],clefs:[["clefs-C","E07C"],["clefs-C_change","E07D"],["clefs-varC","E07E"],["clefs-varC_change","E07F"],["clefs-F","E080"],["clefs-F_change","E081"],["clefs-G","E082"],["clefs-G_change","E083"],["clefs-GG","E084"],["clefs-GG_change","E085"],["clefs-tenorG","E086"],["clefs-tenorG_change","E087"],["clefs-percussion","E088"],["clefs-percussion_change","E089"],["clefs-varpercussion","E08A"],["clefs-varpercussion_change","E08B"],["clefs-tab","E08C"],["clefs-tab_change","E08D"],["clefs-vaticana-do","E154"],["clefs-vaticana-do_change","E155"],["clefs-vaticana-fa","E156"],["clefs-vaticana-fa_change","E157"],["clefs-medicaea-do","E158"],["clefs-medicaea-do_change","E159"],["clefs-medicaea-fa","E15A"],["clefs-medicaea-fa_change","E15B"],["clefs-neomensural-c","E15C"],["clefs-neomensural-c_change","E15D"],["clefs-petrucci-c1","E15E"],["clefs-petrucci-c1_change","E15F"],["clefs-petrucci-c2","E160"],["clefs-petrucci-c2_change","E161"],["clefs-petrucci-c3","E162"],["clefs-petrucci-c3_change","E163"],["clefs-petrucci-c4","E164"],["clefs-petrucci-c4_change","E165"],["clefs-petrucci-c5","E166"],["clefs-petrucci-c5_change","E167"],["clefs-mensural-c","E168"],["clefs-mensural-c_change","E169"],["clefs-blackmensural-c","E16A"],["clefs-blackmensural-c_change","E16B"],["clefs-petrucci-f","E16C"],["clefs-petrucci-f_change","E16D"],["clefs-mensural-f","E16E"],["clefs-mensural-f_change","E16F"],["clefs-petrucci-g","E170"],["clefs-petrucci-g_change","E171"],["clefs-mensural-g","E172"],["clefs-mensural-g_change","E173"],["clefs-hufnagel-do","E174"],["clefs-hufnagel-do_change","E175"],["clefs-hufnagel-fa","E176"],["clefs-hufnagel-fa_change","E177"],["clefs-hufnagel-do-fa","E178"],["clefs-hufnagel-do-fa_change","E179"],["clefs-kievan-do","E17A"],["clefs-kievan-do_change","E17B"]],timesig:[["timesig-C44","E08E"],["timesig-C22","E08F"],["timesig-mensural44","E1B4"],["timesig-mensural22","E1B5"],["timesig-mensural32","E1B6"],["timesig-mensural64","E1B7"],["timesig-mensural94","E1B8"],["timesig-mensural34","E1B9"],["timesig-mensural68","E1BA"],["timesig-mensural98","E1BB"],["timesig-mensural48","E1BC"],["timesig-mensural68alt","E1BD"],["timesig-mensural24","E1BE"],["timesig-neomensural44","E1BF"],["timesig-neomensural22","E1C0"],["timesig-neomensural32","E1C1"],["timesig-neomensural64","E1C2"],["timesig-neomensural94","E1C3"],["timesig-neomensural34","E1C4"],["timesig-neomensural68","E1C5"],["timesig-neomensural98","E1C6"],["timesig-neomensural48","E1C7"],["timesig-neomensural68alt","E1C8"],["timesig-neomensural24","E1C9"]],pedal:[["pedal-star","E090"],["pedal-M","E091"],["pedal--","E092"],["pedal-P","E093"],["pedal-d","E094"],["pedal-e","E095"],["pedal-Ped","E096"]],brackettips:[["brackettips-up","E097"],["brackettips-down","E098"]],accordion:[["accordion-discant","E099"],["accordion-dot","E09A"],["accordion-freebass","E09B"],["accordion-stdbass","E09C"],["accordion-bayanbass","E09D"],["accordion-oldEE","E09E"],["accordion-push","E09F"],["accordion-pull","E0A0"]],ties:[["ties-lyric-short","E0A1"],["ties-lyric-default","E0A2"]],noteheads:[["noteheads-uM2","E0A3"],["noteheads-dM2","E0A4"],["noteheads-sM1","E0A5"],["noteheads-sM1double","E0A6"],["noteheads-s0","E0A7"],["noteheads-s1","E0A8"],["noteheads-s2","E0A9"],["noteheads-s0diamond","E0AA"],["noteheads-s1diamond","E0AB"],["noteheads-s2diamond","E0AC"],["noteheads-s0triangle","E0AD"],["noteheads-d1triangle","E0AE"],["noteheads-u1triangle","E0AF"],["noteheads-u2triangle","E0B0"],["noteheads-d2triangle","E0B1"],["noteheads-s0slash","E0B2"],["noteheads-s1slash","E0B3"],["noteheads-s2slash","E0B4"],["noteheads-s0cross","E0B5"],["noteheads-s1cross","E0B6"],["noteheads-s2cross","E0B7"],["noteheads-s2xcircle","E0B8"],["noteheads-s0do","E0B9"],["noteheads-d1do","E0BA"],["noteheads-u1do","E0BB"],["noteheads-d2do","E0BC"],["noteheads-u2do","E0BD"],["noteheads-s0doThin","E0BE"],["noteheads-d1doThin","E0BF"],["noteheads-u1doThin","E0C0"],["noteheads-d2doThin","E0C1"],["noteheads-u2doThin","E0C2"],["noteheads-s0re","E0C3"],["noteheads-u1re","E0C4"],["noteheads-d1re","E0C5"],["noteheads-u2re","E0C6"],["noteheads-d2re","E0C7"],["noteheads-s0reThin","E0C8"],["noteheads-u1reThin","E0C9"],["noteheads-d1reThin","E0CA"],["noteheads-u2reThin","E0CB"],["noteheads-d2reThin","E0CC"],["noteheads-s0mi","E0CD"],["noteheads-s1mi","E0CE"],["noteheads-s2mi","E0CF"],["noteheads-s0miMirror","E0D0"],["noteheads-s1miMirror","E0D1"],["noteheads-s2miMirror","E0D2"],["noteheads-s0miThin","E0D3"],["noteheads-s1miThin","E0D4"],["noteheads-s2miThin","E0D5"],["noteheads-u0fa","E0D6"],["noteheads-d0fa","E0D7"],["noteheads-u1fa","E0D8"],["noteheads-d1fa","E0D9"],["noteheads-u2fa","E0DA"],["noteheads-d2fa","E0DB"],["noteheads-u0faThin","E0DC"],["noteheads-d0faThin","E0DD"],["noteheads-u1faThin","E0DE"],["noteheads-d1faThin","E0DF"],["noteheads-u2faThin","E0E0"],["noteheads-d2faThin","E0E1"],["noteheads-s0sol","E0E2"],["noteheads-s1sol","E0E3"],["noteheads-s2sol","E0E4"],["noteheads-s0la","E0E5"],["noteheads-s1la","E0E6"],["noteheads-s2la","E0E7"],["noteheads-s0laThin","E0E8"],["noteheads-s1laThin","E0E9"],["noteheads-s2laThin","E0EA"],["noteheads-s0ti","E0EB"],["noteheads-u1ti","E0EC"],["noteheads-d1ti","E0ED"],["noteheads-u2ti","E0EE"],["noteheads-d2ti","E0EF"],["noteheads-s0tiThin","E0F0"],["noteheads-u1tiThin","E0F1"],["noteheads-d1tiThin","E0F2"],["noteheads-u2tiThin","E0F3"],["noteheads-d2tiThin","E0F4"],["noteheads-u0doFunk","E0F5"],["noteheads-d0doFunk","E0F6"],["noteheads-u1doFunk","E0F7"],["noteheads-d1doFunk","E0F8"],["noteheads-u2doFunk","E0F9"],["noteheads-d2doFunk","E0FA"],["noteheads-u0reFunk","E0FB"],["noteheads-d0reFunk","E0FC"],["noteheads-u1reFunk","E0FD"],["noteheads-d1reFunk","E0FE"],["noteheads-u2reFunk","E0FF"],["noteheads-d2reFunk","E100"],["noteheads-u0miFunk","E101"],["noteheads-d0miFunk","E102"],["noteheads-u1miFunk","E103"],["noteheads-d1miFunk","E104"],["noteheads-s2miFunk","E105"],["noteheads-u0faFunk","E106"],["noteheads-d0faFunk","E107"],["noteheads-u1faFunk","E108"],["noteheads-d1faFunk","E109"],["noteheads-u2faFunk","E10A"],["noteheads-d2faFunk","E10B"],["noteheads-s0solFunk","E10C"],["noteheads-s1solFunk","E10D"],["noteheads-s2solFunk","E10E"],["noteheads-s0laFunk","E10F"],["noteheads-s1laFunk","E110"],["noteheads-s2laFunk","E111"],["noteheads-u0tiFunk","E112"],["noteheads-d0tiFunk","E113"],["noteheads-u1tiFunk","E114"],["noteheads-d1tiFunk","E115"],["noteheads-u2tiFunk","E116"],["noteheads-d2tiFunk","E117"],["noteheads-s0doWalker","E118"],["noteheads-u1doWalker","E119"],["noteheads-d1doWalker","E11A"],["noteheads-u2doWalker","E11B"],["noteheads-d2doWalker","E11C"],["noteheads-s0reWalker","E11D"],["noteheads-u1reWalker","E11E"],["noteheads-d1reWalker","E11F"],["noteheads-u2reWalker","E120"],["noteheads-d2reWalker","E121"],["noteheads-s0miWalker","E122"],["noteheads-s1miWalker","E123"],["noteheads-s2miWalker","E124"],["noteheads-s0faWalker","E125"],["noteheads-u1faWalker","E126"],["noteheads-d1faWalker","E127"],["noteheads-u2faWalker","E128"],["noteheads-d2faWalker","E129"],["noteheads-s0laWalker","E12A"],["noteheads-s1laWalker","E12B"],["noteheads-s2laWalker","E12C"],["noteheads-s0tiWalker","E12D"],["noteheads-u1tiWalker","E12E"],["noteheads-d1tiWalker","E12F"],["noteheads-u2tiWalker","E130"],["noteheads-d2tiWalker","E131"],["noteheads-uM3neomensural","E1D6"],["noteheads-dM3neomensural","E1D7"],["noteheads-uM2neomensural","E1D8"],["noteheads-dM2neomensural","E1D9"],["noteheads-sM1neomensural","E1DA"],["noteheads-urM3neomensural","E1DB"],["noteheads-drM3neomensural","E1DC"],["noteheads-urM2neomensural","E1DD"],["noteheads-drM2neomensural","E1DE"],["noteheads-srM1neomensural","E1DF"],["noteheads-s0neomensural","E1E0"],["noteheads-s1neomensural","E1E1"],["noteheads-s2neomensural","E1E2"],["noteheads-s0harmonic","E1E3"],["noteheads-s2harmonic","E1E4"],["noteheads-uM3mensural","E1E5"],["noteheads-dM3mensural","E1E6"],["noteheads-sM3ligmensural","E1E7"],["noteheads-uM2mensural","E1E8"],["noteheads-dM2mensural","E1E9"],["noteheads-sM2ligmensural","E1EA"],["noteheads-sM1mensural","E1EB"],["noteheads-urM3mensural","E1EC"],["noteheads-drM3mensural","E1ED"],["noteheads-srM3ligmensural","E1EE"],["noteheads-urM2mensural","E1EF"],["noteheads-drM2mensural","E1F0"],["noteheads-srM2ligmensural","E1F1"],["noteheads-srM1mensural","E1F2"],["noteheads-uM3semimensural","E1F3"],["noteheads-dM3semimensural","E1F4"],["noteheads-sM3semiligmensural","E1F5"],["noteheads-uM2semimensural","E1F6"],["noteheads-dM2semimensural","E1F7"],["noteheads-sM2semiligmensural","E1F8"],["noteheads-sM1semimensural","E1F9"],["noteheads-urM3semimensural","E1FA"],["noteheads-drM3semimensural","E1FB"],["noteheads-srM3semiligmensural","E1FC"],["noteheads-urM2semimensural","E1FD"],["noteheads-drM2semimensural","E1FE"],["noteheads-srM2semiligmensural","E1FF"],["noteheads-srM1semimensural","E200"],["noteheads-uM3blackmensural","E201"],["noteheads-dM3blackmensural","E202"],["noteheads-sM3blackligmensural","E203"],["noteheads-uM2blackmensural","E204"],["noteheads-dM2blackmensural","E205"],["noteheads-sM2blackligmensural","E206"],["noteheads-sM1blackmensural","E207"],["noteheads-s0mensural","E208"],["noteheads-s1mensural","E209"],["noteheads-s2mensural","E20A"],["noteheads-s0blackmensural","E20B"],["noteheads-s0petrucci","E20C"],["noteheads-s1petrucci","E20D"],["noteheads-s2petrucci","E20E"],["noteheads-s0blackpetrucci","E20F"],["noteheads-s1blackpetrucci","E210"],["noteheads-s2blackpetrucci","E211"],["noteheads-svaticana-punctum","E212"],["noteheads-svaticana-punctum-cavum","E213"],["noteheads-svaticana-linea-punctum","E214"],["noteheads-svaticana-linea-punctum-cavum","E215"],["noteheads-svaticana-inclinatum","E216"],["noteheads-svaticana-lpes","E217"],["noteheads-svaticana-vlpes","E218"],["noteheads-svaticana-upes","E219"],["noteheads-svaticana-vupes","E21A"],["noteheads-svaticana-plica","E21B"],["noteheads-svaticana-vplica","E21C"],["noteheads-svaticana-epiphonus","E21D"],["noteheads-svaticana-vepiphonus","E21E"],["noteheads-svaticana-reverse-plica","E21F"],["noteheads-svaticana-reverse-vplica","E220"],["noteheads-svaticana-inner-cephalicus","E221"],["noteheads-svaticana-cephalicus","E222"],["noteheads-svaticana-quilisma","E223"],["noteheads-ssolesmes-incl-parvum","E224"],["noteheads-ssolesmes-auct-asc","E225"],["noteheads-ssolesmes-auct-desc","E226"],["noteheads-ssolesmes-incl-auctum","E227"],["noteheads-ssolesmes-stropha","E228"],["noteheads-ssolesmes-stropha-aucta","E229"],["noteheads-ssolesmes-oriscus","E22A"],["noteheads-smedicaea-inclinatum","E22B"],["noteheads-smedicaea-punctum","E22C"],["noteheads-smedicaea-rvirga","E22D"],["noteheads-smedicaea-virga","E22E"],["noteheads-shufnagel-punctum","E22F"],["noteheads-shufnagel-virga","E230"],["noteheads-shufnagel-lpes","E231"],["noteheads-sM2kievan","E232"],["noteheads-sM1kievan","E233"],["noteheads-s0kievan","E234"],["noteheads-d2kievan","E235"],["noteheads-u2kievan","E236"],["noteheads-s1kievan","E237"],["noteheads-sr1kievan","E238"],["noteheads-d3kievan","E239"],["noteheads-u3kievan","E23A"]],flags:[["flags-u3","E132"],["flags-u4","E133"],["flags-u5","E134"],["flags-u6","E135"],["flags-u7","E136"],["flags-u8","E137"],["flags-u9","E138"],["flags-u10","E139"],["flags-d3","E13A"],["flags-d4","E13B"],["flags-d5","E13C"],["flags-d6","E13D"],["flags-d7","E13E"],["flags-d8","E13F"],["flags-d9","E140"],["flags-d10","E141"],["flags-ugrace","E142"],["flags-dgrace","E143"],["flags-mensuralu03","E19C"],["flags-mensuralu13","E19D"],["flags-mensuralu23","E19E"],["flags-mensurald03","E19F"],["flags-mensurald13","E1A0"],["flags-mensurald23","E1A1"],["flags-mensuralu04","E1A2"],["flags-mensuralu14","E1A3"],["flags-mensuralu24","E1A4"],["flags-mensurald04","E1A5"],["flags-mensurald14","E1A6"],["flags-mensurald24","E1A7"],["flags-mensuralu05","E1A8"],["flags-mensuralu15","E1A9"],["flags-mensuralu25","E1AA"],["flags-mensurald05","E1AB"],["flags-mensurald15","E1AC"],["flags-mensurald25","E1AD"],["flags-mensuralu06","E1AE"],["flags-mensuralu16","E1AF"],["flags-mensuralu26","E1B0"],["flags-mensurald06","E1B1"],["flags-mensurald16","E1B2"],["flags-mensurald26","E1B3"]],custodes:[["custodes-hufnagel-u0","E17C"],["custodes-hufnagel-u1","E17D"],["custodes-hufnagel-u2","E17E"],["custodes-hufnagel-d0","E17F"],["custodes-hufnagel-d1","E180"],["custodes-hufnagel-d2","E181"],["custodes-medicaea-u0","E182"],["custodes-medicaea-u1","E183"],["custodes-medicaea-u2","E184"],["custodes-medicaea-d0","E185"],["custodes-medicaea-d1","E186"],["custodes-medicaea-d2","E187"],["custodes-vaticana-u0","E188"],["custodes-vaticana-u1","E189"],["custodes-vaticana-u2","E18A"],["custodes-vaticana-d0","E18B"],["custodes-vaticana-d1","E18C"],["custodes-vaticana-d2","E18D"],["custodes-mensural-u0","E18E"],["custodes-mensural-u1","E18F"],["custodes-mensural-u2","E190"],["custodes-mensural-d0","E191"],["custodes-mensural-d1","E192"],["custodes-mensural-d2","E193"]],dots:[["dots-dotvaticana","E1D4"],["dots-dotkievan","E1D5"]]},i={rests:"Rests",accidentals:"Accidentals",arrowheads:"Arrowheads",dot:"Dot",scripts:"Scripts & Articulations",clefs:"Clefs",timesig:"Time Signatures",pedal:"Pedal",brackettips:"Bracket Tips",accordion:"Accordion",ties:"Ties",noteheads:"Noteheads",flags:"Flags",custodes:"Custodes",dots:"Dots"};function f(){const[o,u]=d.useState(!1),[E,h]=d.useState(""),[r,m]=d.useState(40);d.useEffect(()=>{document.fonts.ready.then(()=>{u(document.fonts.check("40px Emmentaler-26"))})},[]);const c=Object.keys(l);return e.jsxs("div",{className:"font-test-page",children:[e.jsxs("div",{className:"font-test-header",children:[e.jsx("h1",{children:"Emmentaler-26 Font Glyphs"}),e.jsxs("div",{className:"font-test-status",children:["Font status: ",e.jsx("span",{className:o?"loaded":"not-loaded",children:o?"Loaded":"Not loaded"}),e.jsxs("span",{className:"glyph-count",children:[Object.values(l).reduce((s,n)=>s+n.length,0)," glyphs"]})]}),e.jsxs("div",{className:"font-test-controls",children:[e.jsx("input",{type:"text",placeholder:"Filter glyphs...",value:E,onChange:s=>h(s.target.value)}),e.jsxs("label",{children:["Size:",e.jsx("input",{type:"range",min:20,max:80,value:r,onChange:s=>m(Number(s.target.value))}),r,"px"]})]}),e.jsx("div",{className:"font-test-toc",children:c.map(s=>e.jsxs("a",{href:`#cat-${s}`,children:[i[s]||s," (",l[s].length,")"]},s))})]}),c.map(s=>{const n=l[s].filter(([a,t])=>!E||a.toLowerCase().includes(E.toLowerCase())||t.toLowerCase().includes(E.toLowerCase()));return n.length===0?null:e.jsxs("div",{id:`cat-${s}`,className:"font-test-category",children:[e.jsxs("h2",{children:[i[s]||s," ",e.jsxs("span",{children:["(",n.length,")"]})]}),e.jsx("div",{className:"glyph-grid",children:n.map(([a,t])=>e.jsxs("div",{className:"glyph-cell",title:a,children:[e.jsx("div",{className:"glyph-render",style:{fontSize:r},children:e.jsx("i",{className:`emmentaler glyph-${a}`})}),e.jsx("div",{className:"glyph-unicode",style:{fontSize:r},children:String.fromCodePoint(parseInt(t,16))}),e.jsx("div",{className:"glyph-name",children:a}),e.jsxs("div",{className:"glyph-code",children:["U+",t]})]},`${a}-${t}`))})]},s)})]})}export{f as default};
|
|
|
|
| 1 |
+
import{r as d,j as e}from"./umi-a044fd32.js";const l={rests:[["rests-0","E000"],["rests-1","E001"],["rests-0o","E002"],["rests-1o","E003"],["rests-M3","E004"],["rests-M2","E005"],["rests-M1","E006"],["rests-M1o","E007"],["rests-2","E008"],["rests-2classical","E009"],["rests-2z","E00A"],["rests-3","E00B"],["rests-4","E00C"],["rests-5","E00D"],["rests-6","E00E"],["rests-7","E00F"],["rests-8","E010"],["rests-9","E011"],["rests-10","E012"],["rests-M3neomensural","E144"],["rests-M2neomensural","E145"],["rests-M1neomensural","E146"],["rests-0neomensural","E147"],["rests-1neomensural","E148"],["rests-2neomensural","E149"],["rests-3neomensural","E14A"],["rests-4neomensural","E14B"],["rests-M3mensural","E14C"],["rests-M2mensural","E14D"],["rests-M1mensural","E14E"],["rests-0mensural","E14F"],["rests-1mensural","E150"],["rests-2mensural","E151"],["rests-3mensural","E152"],["rests-4mensural","E153"]],accidentals:[["accidentals-sharp","E013"],["accidentals-sharp-arrowup","E014"],["accidentals-sharp-arrowdown","E015"],["accidentals-sharp-arrowboth","E016"],["accidentals-sharp-slashslash-stem","E017"],["accidentals-sharp-slashslashslash-stemstem","E018"],["accidentals-sharp-slashslashslash-stem","E019"],["accidentals-sharp-slash-stem","E01A"],["accidentals-sharp-slashslash-stemstemstem","E01B"],["accidentals-doublesharp","E01C"],["accidentals-natural","E01D"],["accidentals-natural-arrowup","E01E"],["accidentals-natural-arrowdown","E01F"],["accidentals-natural-arrowboth","E020"],["accidentals-flat","E021"],["accidentals-flat-arrowup","E022"],["accidentals-flat-arrowdown","E023"],["accidentals-flat-arrowboth","E024"],["accidentals-flat-slash","E025"],["accidentals-flat-slashslash","E026"],["accidentals-mirroredflat-flat","E027"],["accidentals-mirroredflat","E028"],["accidentals-mirroredflat-backslash","E029"],["accidentals-flatflat","E02A"],["accidentals-flatflat-slash","E02B"],["accidentals-rightparen","E02C"],["accidentals-leftparen","E02D"],["accidentals-medicaeaM1","E194"],["accidentals-vaticanaM1","E195"],["accidentals-vaticana0","E196"],["accidentals-mensural1","E197"],["accidentals-mensuralM1","E198"],["accidentals-hufnagelM1","E199"],["accidentals-kievan1","E19A"],["accidentals-kievanM1","E19B"]],arrowheads:[["arrowheads-open-01","E02E"],["arrowheads-open-0M1","E02F"],["arrowheads-open-11","E030"],["arrowheads-open-1M1","E031"],["arrowheads-close-01","E032"],["arrowheads-close-0M1","E033"],["arrowheads-close-11","E034"],["arrowheads-close-1M1","E035"]],dot:[["dot","E036"]],scripts:[["scripts-ufermata","E037"],["scripts-dfermata","E038"],["scripts-uhenzeshortfermata","E039"],["scripts-dhenzeshortfermata","E03A"],["scripts-uhenzelongfermata","E03B"],["scripts-dhenzelongfermata","E03C"],["scripts-ushortfermata","E03D"],["scripts-dshortfermata","E03E"],["scripts-uveryshortfermata","E03F"],["scripts-dveryshortfermata","E040"],["scripts-ulongfermata","E041"],["scripts-dlongfermata","E042"],["scripts-uverylongfermata","E043"],["scripts-dverylongfermata","E044"],["scripts-thumb","E045"],["scripts-sforzato","E046"],["scripts-espr","E047"],["scripts-staccato","E048"],["scripts-ustaccatissimo","E049"],["scripts-dstaccatissimo","E04A"],["scripts-tenuto","E04B"],["scripts-uportato","E04C"],["scripts-dportato","E04D"],["scripts-umarcato","E04E"],["scripts-dmarcato","E04F"],["scripts-open","E050"],["scripts-halfopen","E051"],["scripts-halfopenvertical","E052"],["scripts-stopped","E053"],["scripts-upbow","E054"],["scripts-downbow","E055"],["scripts-reverseturn","E056"],["scripts-turn","E057"],["scripts-slashturn","E058"],["scripts-haydnturn","E059"],["scripts-trill","E05A"],["scripts-upedalheel","E05B"],["scripts-dpedalheel","E05C"],["scripts-upedaltoe","E05D"],["scripts-dpedaltoe","E05E"],["scripts-flageolet","E05F"],["scripts-segno","E060"],["scripts-varsegno","E061"],["scripts-coda","E062"],["scripts-varcoda","E063"],["scripts-rcomma","E064"],["scripts-lcomma","E065"],["scripts-rvarcomma","E066"],["scripts-lvarcomma","E067"],["scripts-arpeggio","E068"],["scripts-trill_element","E069"],["scripts-arpeggio-arrow-M1","E06A"],["scripts-arpeggio-arrow-1","E06B"],["scripts-trillelement","E06C"],["scripts-prall","E06D"],["scripts-mordent","E06E"],["scripts-prallprall","E06F"],["scripts-prallmordent","E070"],["scripts-upprall","E071"],["scripts-upmordent","E072"],["scripts-prallup","E073"],["scripts-downprall","E074"],["scripts-downmordent","E075"],["scripts-pralldown","E076"],["scripts-lineprall","E077"],["scripts-caesura-curved","E078"],["scripts-caesura-straight","E079"],["scripts-tickmark","E07A"],["scripts-snappizzicato","E07B"],["scripts-ictus","E1CA"],["scripts-uaccentus","E1CB"],["scripts-daccentus","E1CC"],["scripts-usemicirculus","E1CD"],["scripts-dsemicirculus","E1CE"],["scripts-circulus","E1CF"],["scripts-augmentum","E1D0"],["scripts-usignumcongruentiae","E1D1"],["scripts-dsignumcongruentiae","E1D2"],["scripts-barline-kievan","E1D3"]],clefs:[["clefs-C","E07C"],["clefs-C_change","E07D"],["clefs-varC","E07E"],["clefs-varC_change","E07F"],["clefs-F","E080"],["clefs-F_change","E081"],["clefs-G","E082"],["clefs-G_change","E083"],["clefs-GG","E084"],["clefs-GG_change","E085"],["clefs-tenorG","E086"],["clefs-tenorG_change","E087"],["clefs-percussion","E088"],["clefs-percussion_change","E089"],["clefs-varpercussion","E08A"],["clefs-varpercussion_change","E08B"],["clefs-tab","E08C"],["clefs-tab_change","E08D"],["clefs-vaticana-do","E154"],["clefs-vaticana-do_change","E155"],["clefs-vaticana-fa","E156"],["clefs-vaticana-fa_change","E157"],["clefs-medicaea-do","E158"],["clefs-medicaea-do_change","E159"],["clefs-medicaea-fa","E15A"],["clefs-medicaea-fa_change","E15B"],["clefs-neomensural-c","E15C"],["clefs-neomensural-c_change","E15D"],["clefs-petrucci-c1","E15E"],["clefs-petrucci-c1_change","E15F"],["clefs-petrucci-c2","E160"],["clefs-petrucci-c2_change","E161"],["clefs-petrucci-c3","E162"],["clefs-petrucci-c3_change","E163"],["clefs-petrucci-c4","E164"],["clefs-petrucci-c4_change","E165"],["clefs-petrucci-c5","E166"],["clefs-petrucci-c5_change","E167"],["clefs-mensural-c","E168"],["clefs-mensural-c_change","E169"],["clefs-blackmensural-c","E16A"],["clefs-blackmensural-c_change","E16B"],["clefs-petrucci-f","E16C"],["clefs-petrucci-f_change","E16D"],["clefs-mensural-f","E16E"],["clefs-mensural-f_change","E16F"],["clefs-petrucci-g","E170"],["clefs-petrucci-g_change","E171"],["clefs-mensural-g","E172"],["clefs-mensural-g_change","E173"],["clefs-hufnagel-do","E174"],["clefs-hufnagel-do_change","E175"],["clefs-hufnagel-fa","E176"],["clefs-hufnagel-fa_change","E177"],["clefs-hufnagel-do-fa","E178"],["clefs-hufnagel-do-fa_change","E179"],["clefs-kievan-do","E17A"],["clefs-kievan-do_change","E17B"]],timesig:[["timesig-C44","E08E"],["timesig-C22","E08F"],["timesig-mensural44","E1B4"],["timesig-mensural22","E1B5"],["timesig-mensural32","E1B6"],["timesig-mensural64","E1B7"],["timesig-mensural94","E1B8"],["timesig-mensural34","E1B9"],["timesig-mensural68","E1BA"],["timesig-mensural98","E1BB"],["timesig-mensural48","E1BC"],["timesig-mensural68alt","E1BD"],["timesig-mensural24","E1BE"],["timesig-neomensural44","E1BF"],["timesig-neomensural22","E1C0"],["timesig-neomensural32","E1C1"],["timesig-neomensural64","E1C2"],["timesig-neomensural94","E1C3"],["timesig-neomensural34","E1C4"],["timesig-neomensural68","E1C5"],["timesig-neomensural98","E1C6"],["timesig-neomensural48","E1C7"],["timesig-neomensural68alt","E1C8"],["timesig-neomensural24","E1C9"]],pedal:[["pedal-star","E090"],["pedal-M","E091"],["pedal--","E092"],["pedal-P","E093"],["pedal-d","E094"],["pedal-e","E095"],["pedal-Ped","E096"]],brackettips:[["brackettips-up","E097"],["brackettips-down","E098"]],accordion:[["accordion-discant","E099"],["accordion-dot","E09A"],["accordion-freebass","E09B"],["accordion-stdbass","E09C"],["accordion-bayanbass","E09D"],["accordion-oldEE","E09E"],["accordion-push","E09F"],["accordion-pull","E0A0"]],ties:[["ties-lyric-short","E0A1"],["ties-lyric-default","E0A2"]],noteheads:[["noteheads-uM2","E0A3"],["noteheads-dM2","E0A4"],["noteheads-sM1","E0A5"],["noteheads-sM1double","E0A6"],["noteheads-s0","E0A7"],["noteheads-s1","E0A8"],["noteheads-s2","E0A9"],["noteheads-s0diamond","E0AA"],["noteheads-s1diamond","E0AB"],["noteheads-s2diamond","E0AC"],["noteheads-s0triangle","E0AD"],["noteheads-d1triangle","E0AE"],["noteheads-u1triangle","E0AF"],["noteheads-u2triangle","E0B0"],["noteheads-d2triangle","E0B1"],["noteheads-s0slash","E0B2"],["noteheads-s1slash","E0B3"],["noteheads-s2slash","E0B4"],["noteheads-s0cross","E0B5"],["noteheads-s1cross","E0B6"],["noteheads-s2cross","E0B7"],["noteheads-s2xcircle","E0B8"],["noteheads-s0do","E0B9"],["noteheads-d1do","E0BA"],["noteheads-u1do","E0BB"],["noteheads-d2do","E0BC"],["noteheads-u2do","E0BD"],["noteheads-s0doThin","E0BE"],["noteheads-d1doThin","E0BF"],["noteheads-u1doThin","E0C0"],["noteheads-d2doThin","E0C1"],["noteheads-u2doThin","E0C2"],["noteheads-s0re","E0C3"],["noteheads-u1re","E0C4"],["noteheads-d1re","E0C5"],["noteheads-u2re","E0C6"],["noteheads-d2re","E0C7"],["noteheads-s0reThin","E0C8"],["noteheads-u1reThin","E0C9"],["noteheads-d1reThin","E0CA"],["noteheads-u2reThin","E0CB"],["noteheads-d2reThin","E0CC"],["noteheads-s0mi","E0CD"],["noteheads-s1mi","E0CE"],["noteheads-s2mi","E0CF"],["noteheads-s0miMirror","E0D0"],["noteheads-s1miMirror","E0D1"],["noteheads-s2miMirror","E0D2"],["noteheads-s0miThin","E0D3"],["noteheads-s1miThin","E0D4"],["noteheads-s2miThin","E0D5"],["noteheads-u0fa","E0D6"],["noteheads-d0fa","E0D7"],["noteheads-u1fa","E0D8"],["noteheads-d1fa","E0D9"],["noteheads-u2fa","E0DA"],["noteheads-d2fa","E0DB"],["noteheads-u0faThin","E0DC"],["noteheads-d0faThin","E0DD"],["noteheads-u1faThin","E0DE"],["noteheads-d1faThin","E0DF"],["noteheads-u2faThin","E0E0"],["noteheads-d2faThin","E0E1"],["noteheads-s0sol","E0E2"],["noteheads-s1sol","E0E3"],["noteheads-s2sol","E0E4"],["noteheads-s0la","E0E5"],["noteheads-s1la","E0E6"],["noteheads-s2la","E0E7"],["noteheads-s0laThin","E0E8"],["noteheads-s1laThin","E0E9"],["noteheads-s2laThin","E0EA"],["noteheads-s0ti","E0EB"],["noteheads-u1ti","E0EC"],["noteheads-d1ti","E0ED"],["noteheads-u2ti","E0EE"],["noteheads-d2ti","E0EF"],["noteheads-s0tiThin","E0F0"],["noteheads-u1tiThin","E0F1"],["noteheads-d1tiThin","E0F2"],["noteheads-u2tiThin","E0F3"],["noteheads-d2tiThin","E0F4"],["noteheads-u0doFunk","E0F5"],["noteheads-d0doFunk","E0F6"],["noteheads-u1doFunk","E0F7"],["noteheads-d1doFunk","E0F8"],["noteheads-u2doFunk","E0F9"],["noteheads-d2doFunk","E0FA"],["noteheads-u0reFunk","E0FB"],["noteheads-d0reFunk","E0FC"],["noteheads-u1reFunk","E0FD"],["noteheads-d1reFunk","E0FE"],["noteheads-u2reFunk","E0FF"],["noteheads-d2reFunk","E100"],["noteheads-u0miFunk","E101"],["noteheads-d0miFunk","E102"],["noteheads-u1miFunk","E103"],["noteheads-d1miFunk","E104"],["noteheads-s2miFunk","E105"],["noteheads-u0faFunk","E106"],["noteheads-d0faFunk","E107"],["noteheads-u1faFunk","E108"],["noteheads-d1faFunk","E109"],["noteheads-u2faFunk","E10A"],["noteheads-d2faFunk","E10B"],["noteheads-s0solFunk","E10C"],["noteheads-s1solFunk","E10D"],["noteheads-s2solFunk","E10E"],["noteheads-s0laFunk","E10F"],["noteheads-s1laFunk","E110"],["noteheads-s2laFunk","E111"],["noteheads-u0tiFunk","E112"],["noteheads-d0tiFunk","E113"],["noteheads-u1tiFunk","E114"],["noteheads-d1tiFunk","E115"],["noteheads-u2tiFunk","E116"],["noteheads-d2tiFunk","E117"],["noteheads-s0doWalker","E118"],["noteheads-u1doWalker","E119"],["noteheads-d1doWalker","E11A"],["noteheads-u2doWalker","E11B"],["noteheads-d2doWalker","E11C"],["noteheads-s0reWalker","E11D"],["noteheads-u1reWalker","E11E"],["noteheads-d1reWalker","E11F"],["noteheads-u2reWalker","E120"],["noteheads-d2reWalker","E121"],["noteheads-s0miWalker","E122"],["noteheads-s1miWalker","E123"],["noteheads-s2miWalker","E124"],["noteheads-s0faWalker","E125"],["noteheads-u1faWalker","E126"],["noteheads-d1faWalker","E127"],["noteheads-u2faWalker","E128"],["noteheads-d2faWalker","E129"],["noteheads-s0laWalker","E12A"],["noteheads-s1laWalker","E12B"],["noteheads-s2laWalker","E12C"],["noteheads-s0tiWalker","E12D"],["noteheads-u1tiWalker","E12E"],["noteheads-d1tiWalker","E12F"],["noteheads-u2tiWalker","E130"],["noteheads-d2tiWalker","E131"],["noteheads-uM3neomensural","E1D6"],["noteheads-dM3neomensural","E1D7"],["noteheads-uM2neomensural","E1D8"],["noteheads-dM2neomensural","E1D9"],["noteheads-sM1neomensural","E1DA"],["noteheads-urM3neomensural","E1DB"],["noteheads-drM3neomensural","E1DC"],["noteheads-urM2neomensural","E1DD"],["noteheads-drM2neomensural","E1DE"],["noteheads-srM1neomensural","E1DF"],["noteheads-s0neomensural","E1E0"],["noteheads-s1neomensural","E1E1"],["noteheads-s2neomensural","E1E2"],["noteheads-s0harmonic","E1E3"],["noteheads-s2harmonic","E1E4"],["noteheads-uM3mensural","E1E5"],["noteheads-dM3mensural","E1E6"],["noteheads-sM3ligmensural","E1E7"],["noteheads-uM2mensural","E1E8"],["noteheads-dM2mensural","E1E9"],["noteheads-sM2ligmensural","E1EA"],["noteheads-sM1mensural","E1EB"],["noteheads-urM3mensural","E1EC"],["noteheads-drM3mensural","E1ED"],["noteheads-srM3ligmensural","E1EE"],["noteheads-urM2mensural","E1EF"],["noteheads-drM2mensural","E1F0"],["noteheads-srM2ligmensural","E1F1"],["noteheads-srM1mensural","E1F2"],["noteheads-uM3semimensural","E1F3"],["noteheads-dM3semimensural","E1F4"],["noteheads-sM3semiligmensural","E1F5"],["noteheads-uM2semimensural","E1F6"],["noteheads-dM2semimensural","E1F7"],["noteheads-sM2semiligmensural","E1F8"],["noteheads-sM1semimensural","E1F9"],["noteheads-urM3semimensural","E1FA"],["noteheads-drM3semimensural","E1FB"],["noteheads-srM3semiligmensural","E1FC"],["noteheads-urM2semimensural","E1FD"],["noteheads-drM2semimensural","E1FE"],["noteheads-srM2semiligmensural","E1FF"],["noteheads-srM1semimensural","E200"],["noteheads-uM3blackmensural","E201"],["noteheads-dM3blackmensural","E202"],["noteheads-sM3blackligmensural","E203"],["noteheads-uM2blackmensural","E204"],["noteheads-dM2blackmensural","E205"],["noteheads-sM2blackligmensural","E206"],["noteheads-sM1blackmensural","E207"],["noteheads-s0mensural","E208"],["noteheads-s1mensural","E209"],["noteheads-s2mensural","E20A"],["noteheads-s0blackmensural","E20B"],["noteheads-s0petrucci","E20C"],["noteheads-s1petrucci","E20D"],["noteheads-s2petrucci","E20E"],["noteheads-s0blackpetrucci","E20F"],["noteheads-s1blackpetrucci","E210"],["noteheads-s2blackpetrucci","E211"],["noteheads-svaticana-punctum","E212"],["noteheads-svaticana-punctum-cavum","E213"],["noteheads-svaticana-linea-punctum","E214"],["noteheads-svaticana-linea-punctum-cavum","E215"],["noteheads-svaticana-inclinatum","E216"],["noteheads-svaticana-lpes","E217"],["noteheads-svaticana-vlpes","E218"],["noteheads-svaticana-upes","E219"],["noteheads-svaticana-vupes","E21A"],["noteheads-svaticana-plica","E21B"],["noteheads-svaticana-vplica","E21C"],["noteheads-svaticana-epiphonus","E21D"],["noteheads-svaticana-vepiphonus","E21E"],["noteheads-svaticana-reverse-plica","E21F"],["noteheads-svaticana-reverse-vplica","E220"],["noteheads-svaticana-inner-cephalicus","E221"],["noteheads-svaticana-cephalicus","E222"],["noteheads-svaticana-quilisma","E223"],["noteheads-ssolesmes-incl-parvum","E224"],["noteheads-ssolesmes-auct-asc","E225"],["noteheads-ssolesmes-auct-desc","E226"],["noteheads-ssolesmes-incl-auctum","E227"],["noteheads-ssolesmes-stropha","E228"],["noteheads-ssolesmes-stropha-aucta","E229"],["noteheads-ssolesmes-oriscus","E22A"],["noteheads-smedicaea-inclinatum","E22B"],["noteheads-smedicaea-punctum","E22C"],["noteheads-smedicaea-rvirga","E22D"],["noteheads-smedicaea-virga","E22E"],["noteheads-shufnagel-punctum","E22F"],["noteheads-shufnagel-virga","E230"],["noteheads-shufnagel-lpes","E231"],["noteheads-sM2kievan","E232"],["noteheads-sM1kievan","E233"],["noteheads-s0kievan","E234"],["noteheads-d2kievan","E235"],["noteheads-u2kievan","E236"],["noteheads-s1kievan","E237"],["noteheads-sr1kievan","E238"],["noteheads-d3kievan","E239"],["noteheads-u3kievan","E23A"]],flags:[["flags-u3","E132"],["flags-u4","E133"],["flags-u5","E134"],["flags-u6","E135"],["flags-u7","E136"],["flags-u8","E137"],["flags-u9","E138"],["flags-u10","E139"],["flags-d3","E13A"],["flags-d4","E13B"],["flags-d5","E13C"],["flags-d6","E13D"],["flags-d7","E13E"],["flags-d8","E13F"],["flags-d9","E140"],["flags-d10","E141"],["flags-ugrace","E142"],["flags-dgrace","E143"],["flags-mensuralu03","E19C"],["flags-mensuralu13","E19D"],["flags-mensuralu23","E19E"],["flags-mensurald03","E19F"],["flags-mensurald13","E1A0"],["flags-mensurald23","E1A1"],["flags-mensuralu04","E1A2"],["flags-mensuralu14","E1A3"],["flags-mensuralu24","E1A4"],["flags-mensurald04","E1A5"],["flags-mensurald14","E1A6"],["flags-mensurald24","E1A7"],["flags-mensuralu05","E1A8"],["flags-mensuralu15","E1A9"],["flags-mensuralu25","E1AA"],["flags-mensurald05","E1AB"],["flags-mensurald15","E1AC"],["flags-mensurald25","E1AD"],["flags-mensuralu06","E1AE"],["flags-mensuralu16","E1AF"],["flags-mensuralu26","E1B0"],["flags-mensurald06","E1B1"],["flags-mensurald16","E1B2"],["flags-mensurald26","E1B3"]],custodes:[["custodes-hufnagel-u0","E17C"],["custodes-hufnagel-u1","E17D"],["custodes-hufnagel-u2","E17E"],["custodes-hufnagel-d0","E17F"],["custodes-hufnagel-d1","E180"],["custodes-hufnagel-d2","E181"],["custodes-medicaea-u0","E182"],["custodes-medicaea-u1","E183"],["custodes-medicaea-u2","E184"],["custodes-medicaea-d0","E185"],["custodes-medicaea-d1","E186"],["custodes-medicaea-d2","E187"],["custodes-vaticana-u0","E188"],["custodes-vaticana-u1","E189"],["custodes-vaticana-u2","E18A"],["custodes-vaticana-d0","E18B"],["custodes-vaticana-d1","E18C"],["custodes-vaticana-d2","E18D"],["custodes-mensural-u0","E18E"],["custodes-mensural-u1","E18F"],["custodes-mensural-u2","E190"],["custodes-mensural-d0","E191"],["custodes-mensural-d1","E192"],["custodes-mensural-d2","E193"]],dots:[["dots-dotvaticana","E1D4"],["dots-dotkievan","E1D5"]]},i={rests:"Rests",accidentals:"Accidentals",arrowheads:"Arrowheads",dot:"Dot",scripts:"Scripts & Articulations",clefs:"Clefs",timesig:"Time Signatures",pedal:"Pedal",brackettips:"Bracket Tips",accordion:"Accordion",ties:"Ties",noteheads:"Noteheads",flags:"Flags",custodes:"Custodes",dots:"Dots"};function f(){const[o,u]=d.useState(!1),[E,h]=d.useState(""),[r,m]=d.useState(40);d.useEffect(()=>{document.fonts.ready.then(()=>{u(document.fonts.check("40px Emmentaler-26"))})},[]);const c=Object.keys(l);return e.jsxs("div",{className:"font-test-page",children:[e.jsxs("div",{className:"font-test-header",children:[e.jsx("h1",{children:"Emmentaler-26 Font Glyphs"}),e.jsxs("div",{className:"font-test-status",children:["Font status: ",e.jsx("span",{className:o?"loaded":"not-loaded",children:o?"Loaded":"Not loaded"}),e.jsxs("span",{className:"glyph-count",children:[Object.values(l).reduce((s,n)=>s+n.length,0)," glyphs"]})]}),e.jsxs("div",{className:"font-test-controls",children:[e.jsx("input",{type:"text",placeholder:"Filter glyphs...",value:E,onChange:s=>h(s.target.value)}),e.jsxs("label",{children:["Size:",e.jsx("input",{type:"range",min:20,max:80,value:r,onChange:s=>m(Number(s.target.value))}),r,"px"]})]}),e.jsx("div",{className:"font-test-toc",children:c.map(s=>e.jsxs("a",{href:`#cat-${s}`,children:[i[s]||s," (",l[s].length,")"]},s))})]}),c.map(s=>{const n=l[s].filter(([a,t])=>!E||a.toLowerCase().includes(E.toLowerCase())||t.toLowerCase().includes(E.toLowerCase()));return n.length===0?null:e.jsxs("div",{id:`cat-${s}`,className:"font-test-category",children:[e.jsxs("h2",{children:[i[s]||s," ",e.jsxs("span",{children:["(",n.length,")"]})]}),e.jsx("div",{className:"glyph-grid",children:n.map(([a,t])=>e.jsxs("div",{className:"glyph-cell",title:a,children:[e.jsx("div",{className:"glyph-render",style:{fontSize:r},children:e.jsx("i",{className:`emmentaler glyph-${a}`})}),e.jsx("div",{className:"glyph-unicode",style:{fontSize:r},children:String.fromCodePoint(parseInt(t,16))}),e.jsx("div",{className:"glyph-name",children:a}),e.jsxs("div",{className:"glyph-code",children:["U+",t]})]},`${a}-${t}`))})]},s)})]})}export{f as default};
|
dist/assets/{gauge-4606aaef.js → gauge-5ac462fb.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as e,j as r}from"./umi-
|
|
|
|
| 1 |
+
import{r as e,j as r}from"./umi-a044fd32.js";import{G as d}from"./gaugeRendererGL-9dc55e03.js";const a=[["source1.png","gauge1.png"],["source2.png","gauge2.png"]];function l(){const n=e.useRef(),t=e.useRef(),s=e.useRef(),[c,o]=e.useState(),[u,g]=e.useState(0);return e.useEffect(()=>{o(new d({source:n.current,gauge:t.current,canvas:s.current}))},[n.current,t.current,s.current]),r.jsxs("div",{children:[r.jsx("img",{ref:n,src:`/test.local/${a[u][0]}`}),r.jsx("img",{ref:t,src:`/test.local/${a[u][1]}`}),r.jsx("canvas",{ref:s}),r.jsx("button",{onClick:()=>g((u+1)%a.length),children:"change"}),r.jsx("button",{onClick:()=>{c.updateMaterial({width:t.current.width}),c.updateGeometry(),c.render()},children:"render"})]})}export{l as default};
|
dist/assets/{index-5cf2d389.js → index-0bf6103c.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as x,j as e}from"./umi-2cc549ef.js";const h=({layout:n,positions:t,nameDict:c={},...o})=>{const l=x.useMemo(()=>n.groups.filter(s=>t[s.range[0]]&&t[s.range[1]]).map(s=>{const d=t[s.range[0]],r=t[s.range[1]];return{key:s.key,type:s.group.type,level:s.group.level||0,top:d.y-d.radius,bottom:r.y+r.radius,name:c[s.key]}}),[n,t,c]);return e.jsx("g",{...o,className:"staff-brackets",onClick:()=>{debugger},children:l.map(s=>e.jsxs("g",{className:"group",transform:`translate(${s.level*-1.2}, 0)`,children:[s.type===2&&e.jsxs("g",{className:"bracket",children:[e.jsx("rect",{x:"-1.2",y:s.top,width:"0.45",height:s.bottom-s.top}),e.jsx("g",{transform:`translate(-1.2, ${s.top-.21})`,children:e.jsx("path",{transform:"scale(0.0040, -0.0040)",d:"M0 -56v91c0 12 10 21 22 21h43c164 0 281 136 377 272c10 14 32 -1 22 -15c-103 -145 -222 -369 -399 -369h-65z"})}),e.jsx("g",{transform:`translate(-1.2, ${s.bottom+.21})`,children:e.jsx("path",{transform:"scale(0.0040, -0.0040)",d:"M0 56h65c177 0 296 -224 399 -369c10 -14 -12 -29 -22 -15c-96 136 -213 272 -377 272h-43c-12 0 -22 9 -22 21v91z"})})]}),s.type===3&&e.jsxs("g",{className:"square",children:[e.jsx("line",{x1:"-0.9",x2:"-0.9",y1:s.top,y2:s.bottom,strokeWidth:"0.1"}),e.jsx("line",{x1:"-0.9",x2:"0",y1:s.top,y2:s.top,strokeWidth:"0.1"}),e.jsx("line",{x1:"-0.9",x2:"0",y1:s.bottom,y2:s.bottom,strokeWidth:"0.1"})]}),s.type===1&&e.jsx("g",{className:"brace",transform:`translate(-0.2, ${(s.top+s.bottom)/2})`,children:e.jsx("path",{transform:`scale(0.0040, ${-.004*(s.bottom-s.top)/15.1825})`,d:"M-208 -1336c0 312 124 616 124 912c0 156 -36 300 -144 416c0 4 -4 4 -4 8s4 4 4 8c108 116 144 260 144 416c0 296 -124 600 -124 912c0 212 52 420 196 576c16 16 40 -8 24 -24c-108 -120 -144 -264 -144 -420c0 -292 116 -588 116 -896c0 -212 -48 -416 -188 -572c140 -156 188 -360 188 -572c0 -308 -116 -604 -116 -896c0 -156 36 -300 144 -420c16 -16 -8 -40 -24 -24c-144 156 -196 364 -196 576z"})}),s.name&&e.jsx("g",{className:"name",transform:`translate(-2, ${(s.top+s.bottom)/2+1})`,children:e.jsx("text",{fontSize:2,children:s.name})})]},s.key))})};const i=()=>e.jsxs("defs",{className:"score-token-defs",children:[e.jsx("g",{id:"score-token-def-clefs-G",className:"token",children:e.jsx("text",{x:"-1.3",children:""})}),e.jsx("g",{id:"score-token-def-clefs-F",className:"token",children:e.jsx("text",{x:"-1.06",children:""})}),e.jsx("g",{id:"score-token-def-clefs-C",className:"token",children:e.jsx("text",{x:"-1.06",children:""})}),e.jsx("g",{id:"score-token-def-timesig-C44",className:"token",children:e.jsx("text",{x:"-0.9",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-timesig-C22",className:"token",children:e.jsx("text",{x:"-0.9",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-timesig0",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"0"})}),e.jsx("g",{id:"score-token-def-timesig1",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"1"})}),e.jsx("g",{id:"score-token-def-timesig2",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"2"})}),e.jsx("g",{id:"score-token-def-timesig3",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"3"})}),e.jsx("g",{id:"score-token-def-timesig4",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"4"})}),e.jsx("g",{id:"score-token-def-timesig5",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"5"})}),e.jsx("g",{id:"score-token-def-timesig6",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"6"})}),e.jsx("g",{id:"score-token-def-timesig7",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"7"})}),e.jsx("g",{id:"score-token-def-timesig8",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"8"})}),e.jsx("g",{id:"score-token-def-timesig9",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"9"})}),e.jsx("g",{id:"score-token-def-octave-a",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"𝄶---"})}),e.jsx("g",{id:"score-token-def-octave-b",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"𝄷---"})}),e.jsx("g",{id:"score-token-def-octave-0",className:"token",children:e.jsx("text",{x:"-0.7",y:"0.6",className:"plain",children:"┐"})}),e.jsx("g",{id:"score-token-def-octave-8",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"8-----"})}),e.jsx("g",{id:"score-token-def-n0",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"0"})})}),e.jsx("g",{id:"score-token-def-n1",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"1"})})}),e.jsx("g",{id:"score-token-def-n2",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"2"})})}),e.jsx("g",{id:"score-token-def-n3",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"3"})})}),e.jsx("g",{id:"score-token-def-n4",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"4"})})}),e.jsx("g",{id:"score-token-def-n5",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"5"})})}),e.jsx("g",{id:"score-token-def-n6",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"6"})})}),e.jsx("g",{id:"score-token-def-n7",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"7"})})}),e.jsx("g",{id:"score-token-def-n8",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"8"})})}),e.jsx("g",{id:"score-token-def-n9",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"9"})})}),e.jsx("g",{id:"score-token-def-accidentals-sharp",className:"token",children:e.jsx("text",{x:"-0.55",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-doublesharp",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-natural",className:"token",children:e.jsx("text",{x:"-0.3",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-flat",className:"token",children:e.jsx("text",{x:"-0.3",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-flatflat",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsxs("g",{id:"score-token-def-key-sharp",className:"token",children:[e.jsx("text",{x:"-0.55",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsxs("g",{id:"score-token-def-key-natural",className:"token",children:[e.jsx("text",{x:"-0.3",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsxs("g",{id:"score-token-def-key-flat",className:"token",children:[e.jsx("text",{x:"-0.3",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsx("g",{id:"score-token-def-noteheads-s0",className:"token",children:e.jsx("text",{x:"-0.913",children:""})}),e.jsx("g",{id:"score-token-def-noteheads-s1",className:"token",children:e.jsx("text",{x:"-0.632",children:""})}),e.jsx("g",{id:"score-token-def-noteheads-s2",className:"token",children:e.jsx("text",{x:"-0.599",children:""})}),e.jsxs("g",{id:"score-token-def-noteheads-s1-u",className:"token",children:[e.jsx("text",{x:"-1.264",children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"-0.06",y2:"-3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s2-u",className:"token",children:[e.jsx("text",{x:"-1.198",children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"-0.06",y2:"-3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s1-d",className:"token",children:[e.jsx("text",{children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"0.16",y2:"3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s2-d",className:"token",children:[e.jsx("text",{children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"0.16",y2:"3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsx("g",{id:"score-token-def-rests-M1",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-0",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-0o",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-1o",className:"token",children:e.jsx("text",{x:"-0.75",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-rests-2",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-3",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-4",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-5",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-6",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-flags-u3",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u4",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u5",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u6",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u7",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u8",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-slur-begin",className:"token",children:e.jsx("path",{d:"M0 0C0.5 -0.5 1 -0.6 1.5 -0.6L1.5 -0.4C1 -0.4 0.5 -0.4 0 0z"})}),e.jsx("g",{id:"score-token-def-slur-end",className:"token",children:e.jsx("path",{d:"M0 0C-0.5 -0.5 -1 -0.6 -1.5 -0.6L-1.5 -0.4C-1 -0.4 -0.5 -0.4 0 0z"})}),e.jsxs("g",{id:"score-token-def-volta-left",className:"token",children:[e.jsx("text",{x:"-0.25",y:"-0.5",children:""}),e.jsx("text",{x:"-0.25",y:"0.5",children:""}),e.jsx("line",{x1:"-0.5",x2:"-0.5",y1:"-2",y2:"2"})]}),e.jsxs("g",{id:"score-token-def-volta-right",className:"token",children:[e.jsx("text",{x:"-0.25",y:"-0.5",children:""}),e.jsx("text",{x:"-0.25",y:"0.5",children:""}),e.jsx("line",{x1:"0.5",x2:"0.5",y1:"-2",y2:"2"})]}),e.jsxs("g",{id:"score-token-def-bar-terminal",className:"token",children:[e.jsx("rect",{x:"-0.064",y:"-2",width:"0.128",height:"4"}),e.jsx("rect",{x:"0.27",y:"-2",width:"0.4",height:"4"})]}),e.jsxs("g",{id:"score-token-def-bar-segment",className:"token",children:[e.jsx("rect",{x:"-0.359",y:"-2",width:"0.128",height:"4"}),e.jsx("rect",{x:"0.231",y:"-2",width:"0.128",height:"4"})]}),e.jsx("g",{id:"score-token-def-dot",className:"token",children:e.jsx("text",{children:""})}),e.jsxs("g",{id:"score-token-def-dotdot",className:"token",children:[e.jsx("text",{children:""}),e.jsx("text",{x:"0.8",children:""})]}),e.jsx("g",{id:"score-token-def-f",className:"token",children:e.jsx("text",{x:"-0.6",y:"0.5",children:"f"})}),e.jsx("g",{id:"score-token-def-m",className:"token",children:e.jsx("text",{x:"-0.9",y:"0.5",children:"m"})}),e.jsx("g",{id:"score-token-def-n",className:"token",children:e.jsx("text",{x:"-0.9",y:"0.5",children:"n"})}),e.jsx("g",{id:"score-token-def-p",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"p"})}),e.jsx("g",{id:"score-token-def-r",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"r"})}),e.jsx("g",{id:"score-token-def-s",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"s"})}),e.jsx("g",{id:"score-token-def-z",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"z"})}),e.jsx("g",{id:"score-token-def-scripts-ufermata",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-ushortfermata",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-sforzato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-staccato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-ustaccatissimo",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-turn",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-trill",className:"token",children:e.jsx("text",{y:"0.5",children:""})}),e.jsx("g",{id:"score-token-def-scripts-segno",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-coda",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-arpeggio",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:""})}),e.jsx("g",{id:"score-token-def-scripts-prall",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-mordent",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-umarcato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-tenuto",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-uportato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-pedal-star",className:"token",children:e.jsx("text",{x:"-0.78",y:"0.78",children:""})}),e.jsx("g",{id:"score-token-def-pedal-Ped",className:"token",children:e.jsx("text",{x:"-1.6",y:"0.7",children:""})}),e.jsx("g",{id:"score-token-def-BOS",className:"token",children:e.jsx("text",{x:"-3",y:"1.04",children:"▶"})}),e.jsx("g",{id:"score-token-def-BeamLeft",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"├"})}),e.jsx("g",{id:"score-token-def-BeamContinue",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"┼"})}),e.jsx("g",{id:"score-token-def-BeamRight",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"┤"})}),e.jsx("g",{id:"score-token-def-GraceNotehead",className:"token",children:e.jsx("text",{x:"-0.36",className:"s-grace",children:""})})]}),j=x.memo(i);export{h as S,j as a};
|
|
|
|
| 1 |
+
import{r as x,j as e}from"./umi-a044fd32.js";const h=({layout:n,positions:t,nameDict:c={},...o})=>{const l=x.useMemo(()=>n.groups.filter(s=>t[s.range[0]]&&t[s.range[1]]).map(s=>{const d=t[s.range[0]],r=t[s.range[1]];return{key:s.key,type:s.group.type,level:s.group.level||0,top:d.y-d.radius,bottom:r.y+r.radius,name:c[s.key]}}),[n,t,c]);return e.jsx("g",{...o,className:"staff-brackets",onClick:()=>{debugger},children:l.map(s=>e.jsxs("g",{className:"group",transform:`translate(${s.level*-1.2}, 0)`,children:[s.type===2&&e.jsxs("g",{className:"bracket",children:[e.jsx("rect",{x:"-1.2",y:s.top,width:"0.45",height:s.bottom-s.top}),e.jsx("g",{transform:`translate(-1.2, ${s.top-.21})`,children:e.jsx("path",{transform:"scale(0.0040, -0.0040)",d:"M0 -56v91c0 12 10 21 22 21h43c164 0 281 136 377 272c10 14 32 -1 22 -15c-103 -145 -222 -369 -399 -369h-65z"})}),e.jsx("g",{transform:`translate(-1.2, ${s.bottom+.21})`,children:e.jsx("path",{transform:"scale(0.0040, -0.0040)",d:"M0 56h65c177 0 296 -224 399 -369c10 -14 -12 -29 -22 -15c-96 136 -213 272 -377 272h-43c-12 0 -22 9 -22 21v91z"})})]}),s.type===3&&e.jsxs("g",{className:"square",children:[e.jsx("line",{x1:"-0.9",x2:"-0.9",y1:s.top,y2:s.bottom,strokeWidth:"0.1"}),e.jsx("line",{x1:"-0.9",x2:"0",y1:s.top,y2:s.top,strokeWidth:"0.1"}),e.jsx("line",{x1:"-0.9",x2:"0",y1:s.bottom,y2:s.bottom,strokeWidth:"0.1"})]}),s.type===1&&e.jsx("g",{className:"brace",transform:`translate(-0.2, ${(s.top+s.bottom)/2})`,children:e.jsx("path",{transform:`scale(0.0040, ${-.004*(s.bottom-s.top)/15.1825})`,d:"M-208 -1336c0 312 124 616 124 912c0 156 -36 300 -144 416c0 4 -4 4 -4 8s4 4 4 8c108 116 144 260 144 416c0 296 -124 600 -124 912c0 212 52 420 196 576c16 16 40 -8 24 -24c-108 -120 -144 -264 -144 -420c0 -292 116 -588 116 -896c0 -212 -48 -416 -188 -572c140 -156 188 -360 188 -572c0 -308 -116 -604 -116 -896c0 -156 36 -300 144 -420c16 -16 -8 -40 -24 -24c-144 156 -196 364 -196 576z"})}),s.name&&e.jsx("g",{className:"name",transform:`translate(-2, ${(s.top+s.bottom)/2+1})`,children:e.jsx("text",{fontSize:2,children:s.name})})]},s.key))})};const i=()=>e.jsxs("defs",{className:"score-token-defs",children:[e.jsx("g",{id:"score-token-def-clefs-G",className:"token",children:e.jsx("text",{x:"-1.3",children:""})}),e.jsx("g",{id:"score-token-def-clefs-F",className:"token",children:e.jsx("text",{x:"-1.06",children:""})}),e.jsx("g",{id:"score-token-def-clefs-C",className:"token",children:e.jsx("text",{x:"-1.06",children:""})}),e.jsx("g",{id:"score-token-def-timesig-C44",className:"token",children:e.jsx("text",{x:"-0.9",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-timesig-C22",className:"token",children:e.jsx("text",{x:"-0.9",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-timesig0",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"0"})}),e.jsx("g",{id:"score-token-def-timesig1",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"1"})}),e.jsx("g",{id:"score-token-def-timesig2",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"2"})}),e.jsx("g",{id:"score-token-def-timesig3",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"3"})}),e.jsx("g",{id:"score-token-def-timesig4",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"4"})}),e.jsx("g",{id:"score-token-def-timesig5",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"5"})}),e.jsx("g",{id:"score-token-def-timesig6",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"6"})}),e.jsx("g",{id:"score-token-def-timesig7",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"7"})}),e.jsx("g",{id:"score-token-def-timesig8",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"8"})}),e.jsx("g",{id:"score-token-def-timesig9",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"9"})}),e.jsx("g",{id:"score-token-def-octave-a",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"𝄶---"})}),e.jsx("g",{id:"score-token-def-octave-b",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"𝄷---"})}),e.jsx("g",{id:"score-token-def-octave-0",className:"token",children:e.jsx("text",{x:"-0.7",y:"0.6",className:"plain",children:"┐"})}),e.jsx("g",{id:"score-token-def-octave-8",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"8-----"})}),e.jsx("g",{id:"score-token-def-n0",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"0"})})}),e.jsx("g",{id:"score-token-def-n1",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"1"})})}),e.jsx("g",{id:"score-token-def-n2",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"2"})})}),e.jsx("g",{id:"score-token-def-n3",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"3"})})}),e.jsx("g",{id:"score-token-def-n4",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"4"})})}),e.jsx("g",{id:"score-token-def-n5",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"5"})})}),e.jsx("g",{id:"score-token-def-n6",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"6"})})}),e.jsx("g",{id:"score-token-def-n7",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"7"})})}),e.jsx("g",{id:"score-token-def-n8",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"8"})})}),e.jsx("g",{id:"score-token-def-n9",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"9"})})}),e.jsx("g",{id:"score-token-def-accidentals-sharp",className:"token",children:e.jsx("text",{x:"-0.55",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-doublesharp",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-natural",className:"token",children:e.jsx("text",{x:"-0.3",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-flat",className:"token",children:e.jsx("text",{x:"-0.3",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-flatflat",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsxs("g",{id:"score-token-def-key-sharp",className:"token",children:[e.jsx("text",{x:"-0.55",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsxs("g",{id:"score-token-def-key-natural",className:"token",children:[e.jsx("text",{x:"-0.3",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsxs("g",{id:"score-token-def-key-flat",className:"token",children:[e.jsx("text",{x:"-0.3",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsx("g",{id:"score-token-def-noteheads-s0",className:"token",children:e.jsx("text",{x:"-0.913",children:""})}),e.jsx("g",{id:"score-token-def-noteheads-s1",className:"token",children:e.jsx("text",{x:"-0.632",children:""})}),e.jsx("g",{id:"score-token-def-noteheads-s2",className:"token",children:e.jsx("text",{x:"-0.599",children:""})}),e.jsxs("g",{id:"score-token-def-noteheads-s1-u",className:"token",children:[e.jsx("text",{x:"-1.264",children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"-0.06",y2:"-3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s2-u",className:"token",children:[e.jsx("text",{x:"-1.198",children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"-0.06",y2:"-3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s1-d",className:"token",children:[e.jsx("text",{children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"0.16",y2:"3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s2-d",className:"token",children:[e.jsx("text",{children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"0.16",y2:"3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsx("g",{id:"score-token-def-rests-M1",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-0",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-0o",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-1o",className:"token",children:e.jsx("text",{x:"-0.75",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-rests-2",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-3",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-4",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-5",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-6",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-flags-u3",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u4",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u5",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u6",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u7",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u8",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-slur-begin",className:"token",children:e.jsx("path",{d:"M0 0C0.5 -0.5 1 -0.6 1.5 -0.6L1.5 -0.4C1 -0.4 0.5 -0.4 0 0z"})}),e.jsx("g",{id:"score-token-def-slur-end",className:"token",children:e.jsx("path",{d:"M0 0C-0.5 -0.5 -1 -0.6 -1.5 -0.6L-1.5 -0.4C-1 -0.4 -0.5 -0.4 0 0z"})}),e.jsxs("g",{id:"score-token-def-volta-left",className:"token",children:[e.jsx("text",{x:"-0.25",y:"-0.5",children:""}),e.jsx("text",{x:"-0.25",y:"0.5",children:""}),e.jsx("line",{x1:"-0.5",x2:"-0.5",y1:"-2",y2:"2"})]}),e.jsxs("g",{id:"score-token-def-volta-right",className:"token",children:[e.jsx("text",{x:"-0.25",y:"-0.5",children:""}),e.jsx("text",{x:"-0.25",y:"0.5",children:""}),e.jsx("line",{x1:"0.5",x2:"0.5",y1:"-2",y2:"2"})]}),e.jsxs("g",{id:"score-token-def-bar-terminal",className:"token",children:[e.jsx("rect",{x:"-0.064",y:"-2",width:"0.128",height:"4"}),e.jsx("rect",{x:"0.27",y:"-2",width:"0.4",height:"4"})]}),e.jsxs("g",{id:"score-token-def-bar-segment",className:"token",children:[e.jsx("rect",{x:"-0.359",y:"-2",width:"0.128",height:"4"}),e.jsx("rect",{x:"0.231",y:"-2",width:"0.128",height:"4"})]}),e.jsx("g",{id:"score-token-def-dot",className:"token",children:e.jsx("text",{children:""})}),e.jsxs("g",{id:"score-token-def-dotdot",className:"token",children:[e.jsx("text",{children:""}),e.jsx("text",{x:"0.8",children:""})]}),e.jsx("g",{id:"score-token-def-f",className:"token",children:e.jsx("text",{x:"-0.6",y:"0.5",children:"f"})}),e.jsx("g",{id:"score-token-def-m",className:"token",children:e.jsx("text",{x:"-0.9",y:"0.5",children:"m"})}),e.jsx("g",{id:"score-token-def-n",className:"token",children:e.jsx("text",{x:"-0.9",y:"0.5",children:"n"})}),e.jsx("g",{id:"score-token-def-p",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"p"})}),e.jsx("g",{id:"score-token-def-r",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"r"})}),e.jsx("g",{id:"score-token-def-s",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"s"})}),e.jsx("g",{id:"score-token-def-z",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"z"})}),e.jsx("g",{id:"score-token-def-scripts-ufermata",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-ushortfermata",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-sforzato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-staccato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-ustaccatissimo",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-turn",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-trill",className:"token",children:e.jsx("text",{y:"0.5",children:""})}),e.jsx("g",{id:"score-token-def-scripts-segno",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-coda",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-arpeggio",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:""})}),e.jsx("g",{id:"score-token-def-scripts-prall",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-mordent",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-umarcato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-tenuto",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-uportato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-pedal-star",className:"token",children:e.jsx("text",{x:"-0.78",y:"0.78",children:""})}),e.jsx("g",{id:"score-token-def-pedal-Ped",className:"token",children:e.jsx("text",{x:"-1.6",y:"0.7",children:""})}),e.jsx("g",{id:"score-token-def-BOS",className:"token",children:e.jsx("text",{x:"-3",y:"1.04",children:"▶"})}),e.jsx("g",{id:"score-token-def-BeamLeft",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"├"})}),e.jsx("g",{id:"score-token-def-BeamContinue",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"┼"})}),e.jsx("g",{id:"score-token-def-BeamRight",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"┤"})}),e.jsx("g",{id:"score-token-def-GraceNotehead",className:"token",children:e.jsx("text",{x:"-0.36",className:"s-grace",children:""})})]}),j=x.memo(i);export{h as S,j as a};
|
dist/assets/{index-c63774d4.js → index-0ccf2ddd.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
import{r as W,j as c,a as We}from"./umi-
|
| 2 |
`+U.showPosition()+`
|
| 3 |
Expecting `+O.join(", ")+", got '"+(this.terminals_[z]||z)+"'":L="Parse error on line "+(P+1)+": Unexpected "+(z==oe?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(L,{text:U.match,token:this.terminals_[z]||z,line:U.yylineno,loc:ce,expected:O})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+z);switch(J[0]){case 1:g.push(z),y.push(U.yytext),j.push(U.yylloc),g.push(J[1]),z=null,pe=U.yyleng,ae=U.yytext,P=U.yylineno,ce=U.yylloc;break;case 2:if(C=this.productions_[J[1]][1],o.$=y[y.length-C],o._$={first_line:j[j.length-(C||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(C||1)].first_column,last_column:j[j.length-1].last_column},ue&&(o._$.range=[j[j.length-(C||1)].range[0],j[j.length-1].range[1]]),re=this.performAction.apply(o,[ae,pe,P,q.yy,J[1],y,j].concat(ke)),typeof re<"u")return re;C&&(g=g.slice(0,-1*C*2),y=y.slice(0,-1*C),j=j.slice(0,-1*C)),g.push(this.productions_[J[1]][0]),y.push(o.$),j.push(o._$),w=x[g[g.length-2]][g[g.length-1]],g.push(w);break;case 3:return!0}}return!0}};const m=S=>{const u=S.filter(y=>y!=="V"&&y.syllable!=="-");let p=0;for(let y of u)p+=y.ldiv,y.underline=p,p-=y.rdiv,y.grace&&(y.grace=m(y.grace)),y.postGrace&&(y.postGrace=m(y.postGrace)),delete y.ldiv,delete y.rdiv;let g=[];for(let y of u)y.ltuplet&&g.push(y),g.length>0&&!y.ltuplet&&!y.rtuplet&&g.push(y),y.rtuplet&&(g.push(y),g.forEach(j=>{const x=g.length;j.timeWarp={numerator:x-1,denominator:x}}),g=[]),delete y.ltuplet,delete y.rtuplet;return S},T=S=>{if(S.octaves=0,S.dots=0,S.ltuplet=0,S.rtuplet=0,S.decorators){for(let u=0;u<S.decorators.length;u++)switch(S.decorators[u]){case"'":S.octaves+=1;break;case",":S.octaves-=1;break;case".":S.dots+=1;break;case"[":S.ltuplet=1;break;case"]":S.rtuplet=1;break}delete S.decorators}return S.notations&&(S.notations=S.notations.map(u=>u.replace(/[^a-z]/g,""))),S};var R=function(){var S={EOF:1,parseError:function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},setInput:function(u,p){return this.yy=p||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var p=u.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var p=u.length,g=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var j=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===y.length?this.yylloc.first_column:0)+y[y.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[j[0],j[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
| 4 |
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),p=new Array(u.length+1).join("-");return u+this.upcomingInput()+`
|
| 5 |
`+p+"^"},test_match:function(u,p){var g,y,j;if(this.options.backtrack_lexer&&(j={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(j.yylloc.range=this.yylloc.range.slice(0))),y=u[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var x in j)this[x]=j[x];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,p,g,y;this._more||(this.yytext="",this.match="");for(var j=this._currentRules(),x=0;x<j.length;x++)if(g=this._input.match(this.rules[j[x]]),g&&(!p||g[0].length>p[0].length)){if(p=g,y=x,this.options.backtrack_lexer){if(u=this.test_match(g,j[x]),u!==!1)return u;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(u=this.test_match(p,j[y]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
| 6 |
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var p=this.next();return p||this.lex()},begin:function(p){this.conditionStack.push(p)},popState:function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},pushState:function(p){this.begin(p)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(p,g,y,j){switch(y){case 0:break;case 1:return g.yytext;case 2:return 26;case 3:return 29;case 4:return 27;case 5:return 28;case 6:return 4}},rules:[/^(?:\s+)/,/^(?:([<>\|V{}]))/,/^(?:([#bh]))/,/^(?:([0-7X-]))/,/^(?:([.,'\[\]]))/,/^(?:(\^\s?[a-z]+))/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return S}();I.lexer=R;function G(){this.yy={}}return G.prototype=I,I.Parser=G,new G}();ve.parser=xe;ve.Parser=xe.Parser;ve.parse=function(){return xe.parse.apply(xe,arguments)};var Ot=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,Tt=(s,e,r,t)=>{for(var i=t>1?void 0:t?Rt(e,r):e,a=s.length-1,n;a>=0;a--)(n=s[a])&&(i=(t?n(e,r,i):n(i))||i);return t&&i&&Ot(e,r,i),i},Le=(s=>(s.Title="Title",s.Author="Author",s.MeasureNumber="MeasureNumber",s.ArcLine="ArcLine",s.KeySignature="KeySignature",s.TempoNumeral="TempoNumeral",s.TimeSignature="TimeSignature",s.Lyric="Lyric",s.TextualMark="TextualMark",s.Other="Other",s.Instrument="Instrument",s.Times="Times",s.Alter="Alter",s.Signo="Signo",s.Repeat1="Repeat1",s.Repeat2="Repeat2",s.Jump="Jump",s.Emo_speed="Emo_speed",s.Dstaff="Dstaff",s.Res2="Res2",s.Res3="Res3",s))(Le||{});const De={C:0,G:1,D:2,A:3,E:4,B:5,bG:-6,bD:-5,bA:-4,bE:-3,bB:-2,F:-1,bC:-7,"#F":5,"#C":6};class Ve extends se{static className="NumberedScore";title;pageSize={width:794,height:1122};pages=[];constructor(e){super(),super.assign(e)}get measures(){return this.pages.reduce((e,r,t)=>[...e,...r.systems.reduce((i,a,n)=>{const l=[];return a.staves.forEach((f,k)=>{f.measures.forEach((d,b)=>{l[b]=l[b]||[],l[b][k]=d})}),[...i,...l]},[])],[])}async replaceImageKeys(e){await Promise.all(this.pages.map(async r=>{r.backgroundImage=await e(r.backgroundImage)}))}assemble(){var a;this.title=this.title||((a=this.pages)==null?void 0:a[0].titles.title);let e=0,r=null;const t=[],i=[];this.pages.forEach((n,l)=>{const f=n.accessories.filter(d=>d.semantic==="TimeSignature").sort((d,b)=>(d.box[3]-d.box[1])/2-(b.box[3]-b.box[1])/2).map(d=>{const b=d.text.replace(/[^0-9/]/g,"").split(/[^0-9]/);let v;return b.length===2&&(v={numerator:+b[0],denominator:+b[1]}),{token:d,value:v}}).filter(d=>d.value),k=n.accessories.filter(d=>d.semantic==="KeySignature").sort((d,b)=>(d.box[3]-d.box[1])/2-(b.box[3]-b.box[1])/2).map(d=>{let b=d.text.replace(/[\b]/g,"b").replace(/[^A-Ga-g]/g,"");return b.length===1&&(b=b.toUpperCase()),b.length===2&&(b=b[0]+b[1].toUpperCase()),{token:d,value:De[b]||0}});n.systems.forEach((d,b)=>{const v=[],N=[];for(;f.length!==0;){const m=f[0];if((m.token.box[3]-m.token.box[1])/2<d.top)v.push(f.shift());else break}for(v.sort((m,T)=>m.token.box[0]-T.token.box[0]);k.length!==0;){const m=k[0];if((m.token.box[3]-m.token.box[1])/2<d.top)N.push(k.shift());else break}N.sort((m,T)=>m.token.box[0]-T.token.box[0]);const F={},$={};if(b===0&&n.titles){if(v.length){const m=v.shift();F[0]=m.value}else F[0]={numerator:4,denominator:4};if(N.length){const m=N.shift();$[0]=m.value}else $[0]=0}v.forEach(m=>{const T=Re(K(m.token.box),d.staves[0].measures.map((R,G)=>({x:d.left+R.left,y:d.top+R.top,measureIndex:G})));T&&(F[T.measureIndex]=m.value)}),N.forEach(m=>{const T=Re(K(m.token.box),d.staves[0].measures.map((R,G)=>({x:d.left+R.left,y:d.top+R.top,measureIndex:G})));T&&($[T.measureIndex]=m.value)});let E=t.at(-1);const H=d.staves[0].measures.map((m,T)=>{const R=F[T];return R?(E=R,R):E});t.push(...H);let V=i.at(-1);const I=d.staves[0].measures.map((m,T)=>{const R=$[T];return R?(V=R,R):V});i.push(...I),d.staves.forEach((m,T)=>{m.measures.forEach((R,G)=>{R.measureIndex=e+G,R.timeSignature=t[R.measureIndex],R.keySignature=i[R.measureIndex],R.notes.forEach((S,u)=>{S.id=Ut(l,b,T,G,S.syllable,K(S.bbox||[0,0,0,0])),r&&(r.next=S,S.prev=r),r=S})})}),e+=Math.max(...d.staves.map(m=>m.measures.length))})})}makeVoiceStaves(){const e=[];let r=0;return this.pages.forEach((t,i)=>{t.systems.forEach((a,n)=>{a.staves.forEach((l,f)=>{e[f]=e[f]||{voices:[{measures:[]}]},l.measures.forEach((k,d)=>{if(!e[f].voices[0].measures[k.measureIndex]){const b=Object.fromEntries(k.notes.reduce((v,N)=>(N.tick=v.current,N.staff=f,N.system=r+n,{pairs:[...v.pairs,[v.current,N]],current:v.current+N.duration}),{pairs:[],current:0}).pairs);e[f].voices[0].measures[k.measureIndex]={tickMap:b,duration:k.duration,timeSignature:k.timeSignature,keySignature:k.keySignature,break:!1,pageBreak:!1,empty:k.notes.length===0,voiceIndex:f}}})})}),r+=t.systems.length}),e}perform(){this.assemble();const e=this.makeVoiceStaves();if(!e)return null;const r=new Map;let t=0;const i=this.pages.reduce((n,l)=>[...n,...l.systems.reduce((f,k)=>[...f,...k.staves[0].measures],[])],[]).filter(n=>n.notes.length>0).map(n=>{const l=e.map(v=>v.voices.map(N=>N.measures[n.measureIndex])).flat(),f=l[0],k=t;t+=f.duration;const d=l.map((v,N)=>Object.values(v.tickMap).map(E=>{let H=0,V=E.next;for(V!=null&&V.slurEnd&&(H+=V.duration,V=V.next);(V==null?void 0:V.syllable)==="-";)H+=V.duration,V=V.next;const I=Math.round(E.duration+H);return r.set(E.id,{system:E.system,measure:n.measureIndex,x:n.left+E.roundX,endX:n.left+n.right}),{tick:Math.round(E.tick),duration:I,pitches:[{note:E,value:E.toMidiPitch(v.keySignature)}],noteIds:[E.id],part:0,staff:E.staff}}).map(E=>{const H=E.pitches.reduce((I,m)=>(I[m.value]=m,I),{});return Object.values(H).sort((I,m)=>I.note.syllable>m.note.syllable?1:-1).filter(I=>{var m,T;return!(I.note.slurEnd&&((T=(m=I.note)==null?void 0:m.prev)==null?void 0:T.syllable)===I.note.syllable)&&I.note.syllable!=="-"}).map((I,m)=>{const T=E.noteIds&&E.noteIds[m];return{tick:E.tick,pitch:I.value,duration:E.duration,chordPosition:{index:m,count:E.pitches.length},tied:I.note.slurEnd||I.note.syllable==="-",id:T,ids:[T],track:E.part,staff:E.staff,channel:0,subNotes:[{startTick:0,endTick:E.duration,pitch:I.value,velocity:127}]}})}).flat()).flat(),b=[];return{tick:k,duration:n.duration,notes:d,events:b,timeSignature:n.timeSignature,keySignature:n.keySignature}});return i[0].events.push({track:0,ticks:0,data:{type:"meta",subtype:"setTempo",microsecondsPerBeat:5e5}}),{notation:new vt({measures:i}),tokenMap:r}}}class At extends se{static className="NumberedPage";imageSize;backgroundImage;accessories;systems;constructor(e){super(),super.assign(e)}get width(){return this.imageSize.width}get height(){return this.imageSize.height}get titles(){const e=this.accessories.filter(i=>i.semantic==="Title").sort((i,a)=>K(i.box).y-K(a.box).y).map(i=>i.text);if(e.length===0)return null;const r=e[0],t=e.slice(1).join(`
|
| 7 |
-
`);return{title:r,subtitle:t}}get authors(){return this.accessories.filter(e=>e.semantic==="Author")}get measureCount(){return this.systems.reduce((e,r)=>e+r.measureCount,0)}get syllableSize(){let e=[];return this.systems.forEach(r=>{r.staves.forEach(t=>{t.measures.forEach(i=>{i.noteBboxes.forEach(a=>{e.push(a[3]-a[1])})})})}),e.sort((r,t)=>t-r)[5]}}class $t extends se{static className="NumberedSystem";left;top;right;bottom;bracketsAppearance;staves;constructor(e){super(),super.assign(e)}get width(){return this.right-this.left}get noteRange(){return{top:0,bottom:this.staves.reduce((e,r)=>Math.max(e,Math.max(...r.accessories.map(t=>t.box[3])),r.measures.reduce((t,i)=>Math.max(t,i.bottom),0)),0)}}get measureCount(){return this.staves[0].measures.length}}class Bt extends se{static className="NumberedStaff";baseY;accessories;measures;voice;constructor(e){super(),super.assign(e)}get lyrics(){return this.accessories.filter(e=>e.semantic==="Lyric").reduce((e,r)=>{if(r.text.replace(/[^A-z-]/g,"").length/r.text.length>.5)return[...e,r];const[t,i,a,n]=r.box,l=(a-t)/r.text.length;let f=[];for(let k=0;k<r.text.length;k++){const d=ie(r.toJSON(),{NumberedAccessory:Fe});d.box=[t+k*l,i,t+(k+1)*l,n],d.text=r.text[k],f.push(d)}return[...e,...f]},[])}get slurs(){return this.accessories.filter(e=>e.semantic==="ArcLine")}get slurConnections(){const e=this.slurs.map(n=>[{slur:n,begin:!0,point:{x:n.box[0],y:n.box[3]}},{slur:n,end:!0,point:{x:n.box[2],y:n.box[3]}}]).flat();let r=0;const t=this.measures.map((n,l)=>{const f=e.reduce((k,d,b)=>[...k,...n.notes.filter(v=>v.bbox).map((v,N)=>{const F=K(v.bbox),$={x:n.left+F.x,y:n.top+F.y};return{note:v,slur:d,points:[$,d.point],angle:Me(d.point,$),distance:Math.sqrt(Math.pow(n.left+(v.bbox[2]-v.bbox[0])/2-d.point[0],2)+Math.pow(n.top+v.bbox[1]-d.point[1],2)),measureHeight:n.bottom-n.top,slurIndex:b,noteIndex:r+N}}).sort((v,N)=>v.angle-N.angle).slice(0,2)],[]);return r+=n.notes.length,f}).flat(1).sort((n,l)=>n.angle-l.angle),i=new Set,a=[];for(let n of t)i.has(n.slur)||(i.add(n.slur),a.push(n));return a.sort((n,l)=>n.noteIndex-l.noteIndex).map(n=>(n.note.slurBegin=n.slur.begin,n.note.slurEnd=n.slur.end,[n.note,n.slur.slur,n.points,n.angle]))}get lyricConnections(){const e=this.lyrics;let r=0;const t=this.measures.map((n,l)=>{const f=e.reduce((k,d,b)=>[...k,...n.notes.filter(v=>v.bbox).map((v,N)=>{const F=K(v.bbox),$={x:n.left+F.x,y:n.top+F.y},E=K(d.box);return{note:v,lyric:d,points:[$,E],angle:Me(E,$),lyricIndex:b,noteIndex:r+N}}).sort((v,N)=>v.angle-N.angle).slice(0,2)],[]);return r+=n.notes.length,f}).flat(1).sort((n,l)=>n.angle-l.angle),i=[],a=[];for(let n of t.filter(l=>l.angle<36))i.includes(n.lyric)||(i.push(n.lyric),a.push(n));return a.sort((n,l)=>n.noteIndex-l.noteIndex).map(n=>[n.note,n.lyric,n.points,n.angle])}}class Ue extends se{static className="NumberedMeasure";left;top;right;bottom;expression;noteBboxes;semantics;measureIndex;keySignature;timeSignature;constructor(e){super(),super.assign(e)}get duration(){return this.notes.reduce((e,r)=>e+r.duration,0)}get notes(){const e=this.expression.replace(/[(())]/g,"").replace(/<\s>/g,"").replace(/<+$/g,"").replace(/^\)$/g,"").replace(/_ { \. }/,",");let r=[];try{r=ve.parse(e)}catch(t){console.error(t)}return r?r.filter(t=>t!=="V").map((t,i)=>{var a,n;return t.syllable==="-"?new de({syllable:"-",accidental:"",octaves:0,dots:0,division:2,bbox:this.noteBboxes[i]||[0,0,0,0]}):new de({syllable:t.syllable,accidental:t.acc||"",octaves:t.octaves||0,dots:t.dots||0,division:t.underline+2,bbox:this.noteBboxes[i]||[0,0,0,0],breath:!!t.breath,timeWarp:t.timeWarp,grace:((a=t.grace)==null?void 0:a.map(l=>new de({syllable:l.syllable,accidental:t.acc||"",octaves:l.octaves||0,dots:t.dots||0,division:t.underline+2})))??null,postGrace:((n=t.postGrace)==null?void 0:n.map(l=>new de({syllable:l.syllable,accidental:t.acc||"",octaves:l.octaves||0,dots:t.dots||0,division:t.underline+2})))??null})}):[]}validate(){}}Tt([Vt],Ue.prototype,"notes",1);class Lt extends se{static className="NumberedSemantic";constructor(e){super(),super.assign(e)}}class Fe extends se{static className="NumberedAccessory";box;semantic;text;constructor(e){super(),super.assign(e)}}class de extends se{static className="NumberedNote";static blackKeys=["prev","next"];prev;next;syllable;accidental;octaves=0;dots=0;division;timeWarp;bbox;slurBegin;slurEnd;breath;grace;id;tick;system;staff;constructor(e){super(),super.assign(e)}get duration(){return kt*2**-this.division*(2-2**-this.dots)*(this.timeWarp?this.timeWarp.numerator/this.timeWarp.denominator:1)}get roundX(){return K(this.bbox||[0,0,0,0]).x}toMidiPitch(e){var t;let r=((t=this.accidental)==null?void 0:t.split("").reduce((i,a)=>i+{b:-1,"#":1,h:0}[a],0))??0;if(["X","0"].includes(this.syllable))return this.syllable;if(this.syllable==="-"){let i=this.prev;for(;!/^[1-7]$/g.test(i.syllable);)i=i.prev;return Oe(e)+Ne[+i.syllable-1]}if(/^[1-7]$/g.test(this.syllable))return Oe(e)+Ne[+this.syllable-1]+this.octaves*12+r}}function K(s,e){const[r,t,i,a]=s;return{x:((e==null?void 0:e.x)??0)+(r+i)/2,y:((e==null?void 0:e.y)??0)+(t+a)/2}}function Dt(s,e){const{x:r,y:t}=K(s),{x:i,y:a}=K(e);return Math.pow(i-r,2)+Math.pow(a-t,2)}function Me(s,e){const{x:r,y:t}=s,{x:i,y:a}=e;return Math.abs(Math.atan((i-r)/(a-t))*180/Math.PI)}function Vt(s,e,r){r.enumerable=!0;const t=r.get;r.get=function(){return this[`__${e}`]||(this[`__${e}`]=t.call(this)),this[`__${e}`]}}function Ut(s,e,r,t,i,a){const n=Math.round(a.x*10),l=Math.round(a.y*10),f=`${s}|${e}|${r}|${t}|${i}|${n}|${l}`,k=wt.array(f).slice(12);return globalThis.btoa(String.fromCharCode(...k)).substring(0,11)}function Oe(s){const r=["C","bD","D","bE","E","F","bG","G","bA","A","bB","B"].findIndex(i=>De[i]===s);let t=r<12-r?r:r-12;return St+t}function Re(s,e){let r=Number.MAX_SAFE_INTEGER,t=null;for(let i of e){const a=Math.pow(s.x-i.x,2)+Math.pow(s.y-i.y,2);a<r&&(r=a,t=i)}return t}const me=Object.freeze(Object.defineProperty({__proto__:null,AccessoryType:Le,NumberedAccessory:Fe,NumberedMeasure:Ue,NumberedNote:de,NumberedPage:At,NumberedScore:Ve,NumberedSemantic:Lt,NumberedStaff:Bt,NumberedSystem:$t,angleVertical:Me,getBoxCenter:K,squareDistance:Dt},Symbol.toStringTag,{value:"Module"})),Ft=({score:s,page:e,pageIndex:r,onSeekPosition:t})=>{const[i]=Be(),a=W.useRef(null);let n=0;if(i){let l=0;for(const[f,k]of s.pages.entries()){if(i.system>=l-1&&i.system<l+k.systems.length){n=+f;break}l+=k.systems.length}}return W.useEffect(()=>{a.current&&a.current.scrollIntoView({block:"center",behavior:"smooth"})},[a.current,n]),c.jsx("svg",{className:je("graph"),style:{objectFit:"contain",position:"absolute",top:0,left:0},viewBox:`0 0 ${e==null?void 0:e.width} ${e==null?void 0:e.height}`,children:e.systems.map((l,f)=>{const k=s.pages.slice(0,r).reduce((d,b)=>d+b.systems.length,0)+f;return c.jsxs("g",{className:je("system"),transform:`translate(${l.left}, ${l.top})`,children:[c.jsx("rect",{style:{opacity:0},x:0,y:l.noteRange.top,width:l.width,height:l.noteRange.bottom-l.noteRange.top,onClick:d=>{const b=d.target,v=b.getBoundingClientRect(),N=d.clientX-v.left,F=b.getBBox(),$=N/v.width*F.width;t({system:k,x:$})}}),(i==null?void 0:i.system)===k?c.jsx("line",{ref:a,transform:`translate(${i.x-e.syllableSize/4}, 0)`,x1:0,x2:0,y1:l.noteRange.top,y2:l.noteRange.bottom,style:{stroke:"rgba(173, 216, 230, 0.8)",strokeWidth:e.syllableSize/2}}):null]},f)})})},Wt=W.memo(Ft),Te=600;function Ae(s,e=0,r=0){return{x:e+s[0],y:r+s[1],width:s[2]-s[0],height:s[3]-s[1]}}function Gt(s){return[["root","NumberedPage"],["root.accessories[*]","NumberedAccessory"],["root.systems[*]","NumberedSystem"],["root.systems[*].staves[*]","NumberedStaff"],["root.systems[*].staves[*].accessories[*]","NumberedAccessory"],["root.systems[*].staves[*].measures[*]","NumberedMeasure"]].forEach(([r,t])=>{const a=r.split(/[.\[\]]/).filter(Boolean).reduce((n,l)=>l==="root"?n:Array.isArray(n)?l==="*"?n:[].concat(...n.map(f=>f[l])):n[l],s);a&&(Array.isArray(a)?a.forEach(n=>{n.__prototype=t}):a.__prototype=t)}),s}const $e=({begin:s,end:e,strokeWidth:r=2,stroke:t="#000",perturbation:i=!1})=>{const a=e.y-s.y,n=[s.x+a/6,s.y+a/6],l=[e.x+a/6,e.y-a/6];return c.jsxs("g",{children:[c.jsx("path",{d:`M${s.x} ${s.y} C ${n.join(" ")}, ${l.join(" ")}, ${e.x} ${e.y}`,strokeWidth:r,stroke:t,fill:"none"}),c.jsx("circle",{cx:s.x,cy:s.y,r:r*1.618,fill:t}),c.jsx("circle",{cx:e.x,cy:e.y,r:r*1.618,fill:t})]})},zt=({x:s,y:e,width:r,height:t,note:i,fontSize:a,...n})=>c.jsxs("g",{transform:`translate(${s}, ${e})`,...n,children:[c.jsx("text",{className:"measure-note",fontSize:a,children:i.syllable===null?"-":i.syllable}),new Array(Math.max(i.division-2,0)).fill(null).map((l,f)=>c.jsx("line",{x1:0,x2:r,y1:0,y2:0,transform:`translate(0, ${a*.1+f*a*.12})`,strokeWidth:a*.03,stroke:"#000"},f)),new Array(Math.abs(i.octaves)).fill(null).map((l,f)=>{const k=a*.1*i.division;return c.jsx("circle",{transform:`translate(${r/2}, ${i.octaves>0?-a-f*a*.15:k+f*a*.15})`,cx:0,cy:0,r:a*.07,fill:"#000"},f)}),new Array(Math.abs(i.dots)).fill(null).map((l,f)=>c.jsx("circle",{transform:`translate(${r*2+f*(a/2)}, ${-a*.382})`,cx:0,cy:0,r:a*.08,fill:"#000"},f)),i.accidental&&c.jsx("text",{className:"measure-note",transform:`translate(${-r*.6}, ${-a*.3})`,fontSize:a,children:i.accidental.replace(/b/g,"♭").replace(/#/g,"♯").replace(/h/g,"♮")})]}),rs=s=>{var z,Q,J,re;const e=jt(),r=We(),[t,i]=W.useState(new Ve({})),a=W.useRef(null),[n,l]=W.useState(""),[f,k]=W.useState(!1),d=Ge(),[b,v]=W.useState(!0),[N,F]=W.useState(!0),[$,E]=W.useState(!0),[H,V]=st(),I=W.useRef(null),m=W.useRef(null),T=W.useRef(new gt(performance)),R=W.useRef(!1),[G,S]=nt(),[u,p]=Be(),[g,{inc:y,dec:j,set:x,reset:ae}]=rt(90,300,10),[P,pe]=W.useState(null),X=W.useMemo(()=>{var _,C;const o=ze.parse(window.location.search);return(o==null?void 0:o.type)==="admin"?{type:"admin",env:o.env,id:o.id,edit:o.edit==="1"}:{type:"user",id:(r==null?void 0:r.id)||((C=(_=s==null?void 0:s.match)==null?void 0:_.params)==null?void 0:C.id)||P}},[s,P,r]);Ce(async()=>{var o;try{if(!X.id)return null;l(e.formatMessage({id:"common.loading"}));let _=[],C=null,w;if(X.type==="user"){const O=await be.get(`/api/musicSets/${X.id}`);C=Ee((o=O==null?void 0:O.content)==null?void 0:o.scoreURL),C&&(w=ie(await(await fetch(C)).text(),me),await w.replaceImageKeys(async L=>/https?:\/\/|data:/.test(L)?Ee(L):L!=null&&L.startsWith("md5:")?it((await Mt()).omrDomain,L.replace("md5:","")):L),w.assemble())}w?(window.score=w,i(w)):_e.error(e.formatMessage({id:"common.scoreNotFound"})),l("")}catch(_){console.error(_)}},[]);const oe=()=>{m.current.play({nextFrame:()=>(I.current&&p(I.current.lookupPosition(m.current.progressTicks)),new Promise(o=>setTimeout(o,0)))})},ke=async o=>{if(!o.pages.length)return;const{notation:_,tokenMap:C}=o.perform(),w=Array(_.measures.length).fill(null).map((M,Y)=>Y+1),O=_.toPerformingNotationWithEvents(w);O.scaleTempo({headTempo:6e7/g}),I.current=_t.createFromNotation(O,C);const L=m.current?m.current.progressTicks:0;m.current&&m.current.dispose(),m.current=new he.MidiPlayer(O,{cacheSpan:200,onMidi:(M,Y)=>{let h=null;switch(M.subtype){case"noteOn":he.MidiAudio.noteOn(M.channel,M.noteNumber,M.velocity,Y),h=()=>{var A;return(A=M==null?void 0:M.ids)==null?void 0:A.map(D=>{const B=document.getElementById(D);B&&B.classList.add("notePlayOn")})};break;case"noteOff":he.MidiAudio.noteOff(M.channel,M.noteNumber,Y),h=()=>{var A;return(A=M==null?void 0:M.ids)==null?void 0:A.map(D=>{const B=document.getElementById(D);B&&B.classList.remove("notePlayOn")})};break}h&&T.current.appendTask(Y,h)},onPlayFinish(){S(!1),m.current&&(m.current.progressTicks=0)},onTurnCursor(){m.current&&I.current&&p(I.current.lookupPosition(m.current.progressTicks))}}),m.current.progressTicks=L,R.current=!1};W.useEffect(()=>{G?(async()=>{var o;(!m.current||R.current)&&(R.current=!1,await ke(t)),(o=m.current)!=null&&o.isPlaying||oe()})():m.current&&m.current.pause()},[G,t]),Ce(()=>he.MidiAudio.WebAudio.empty()?he.MidiAudio.loadPlugin({soundfontUrl:"/soundfont/",api:"webaudio"}).then(()=>console.debug("Soundfont loaded.")):Promise.resolve());const U=W.useCallback(async o=>{var C;if(!(I!=null&&I.current)){console.log("scheduler is null:",I==null?void 0:I.current);return}const _=(C=m.current)==null?void 0:C.isPlaying;_&&(m.current.pause(),await new Promise(w=>setTimeout(w,0))),document.querySelectorAll(".notePlayOn").forEach(w=>w.classList.remove("notePlayOn")),m.current.progressTicks=I.current.lookupTick(o),_&&oe()},[]),[q,le]=Nt(async o=>{l(e.formatMessage({id:"common.savingScore"})),await o.replaceImageKeys(async O=>O&&await yt(O));const _=new Blob([JSON.stringify(o.toJSON())],{type:"application/json"}),C=Et(_,`${Date.now()}.json`),w=await Ie(C);await Pe(C,{key:w.key,uploadUrl:w.uploadUrl});try{let O=o.title;O=O||e.formatMessage({id:"common.untitledNumbered"});const L={name:O,content:{images:o.pages.map(Y=>({url:Y.backgroundImage})),scoreURL:w.url},tagIdList:[],type:"simple"};let M;X.id?M=await be.put(`/api/musicSets/${X.id}`,{data:L}):M=await be.post("/api/musicSets",{data:L}),String(M.id)!==X.id&&(pe(M.id),window.history.replaceState(null,"",`/numbered/${M.id}`)),i(ie(JSON.stringify(o),me)),It.success({placement:"bottomRight",message:e.formatMessage({id:"common.saveResult"}),description:e.formatMessage({id:"common.saveSuccess"})})}catch(O){console.log(O)}l("")},[P]);at(()=>{m.current&&m.current.dispose(),l(""),S(!1),V("edit"),p(null),ae()});const ce=ot({onFiles:async(o,_)=>{var w;const C=_.dataTransfer.items;if(C.length===1&&C[0].webkitGetAsEntry().isDirectory){const L=C[0].webkitGetAsEntry().createReader();async function M(Y){const h=await new Promise((A,D)=>{Y.readEntries(async B=>{A(await Promise.all(B.map(async Z=>new Promise(te=>Z.file(ne=>te(ne))))))},D)});return h.length>0?[...h,...await M(Y)]:h}l(e.formatMessage({id:"common.loading"})),await M(L),l("");return}switch(o[0].type){case"application/zip":case"application/x-zip-compressed":case"application/json":const O=o[0];l(e.formatMessage({id:"common.loading"}));const L=await xt(O);L&&i(L),l("");break;case"application/pdf":await((w=a.current)==null?void 0:w.onReceivePDF(o));break;default:console.debug("drop file type:",o[0].type),o[0].type.startsWith("image")&&await ue(o)}},onUri:o=>console.log("uri",o),onText:o=>console.log("text",o)}),ue=async o=>{l(e.formatMessage({id:"common.uploadingImages"}));const _=Array.from(o).map(async h=>{if(typeof h=="string"){const D=await new Promise(te=>{const ne=document.createElement("img");ne.src=h,ne.onload=()=>{te(ne)}}),B=document.createElement("canvas");B.width=D.naturalWidth,B.height=D.naturalHeight;const Z=Pt(B.toDataURL("image/png"),h.slice(h.lastIndexOf("/")+1));return Z.url=h,Z.dimensions={width:D.naturalWidth,height:D.naturalHeight},Z}const A=await Ie(h);return h.url=A.url,t.pages.find(D=>D.backgroundImage===A.url)?(_e.warn(e.formatMessage({id:"common.imageExists"},{name:h.name})),null):(await Pe(h,{key:A.key,uploadUrl:A.uploadUrl}),h)}),C=(await Promise.all(_)).filter(Boolean),w=await Promise.all(C.map(h=>new Promise(A=>{const D=new globalThis.Image;D.src=h.url,D.onload=()=>{h.dimensions={width:D.naturalWidth,height:D.naturalHeight},A(D.naturalHeight/D.naturalWidth)}}))),O=t.pageSize.height/t.pageSize.width;typeof O=="number"&&O&&w.push(O);const L=Math.max(...w);t.pageSize={width:794,height:Math.round(794*L)},l(e.formatMessage({id:"common.recognizingImages"}));const M=await be.post("/api/predict/jianpu",{data:{images:C.map(h=>h.url)}});t.pages.push(...M.map((h,A)=>ie(Gt({...h,backgroundImage:C[A].url}),me))),t.assemble();const Y=ie(JSON.stringify(t),me);window.score=Y,R.current=!0,i(Y),l("")};let ge=0;return c.jsx(Ct,{spinning:!!n,tip:n,style:{backgroundColor:ce.over?"red":"initial"},children:c.jsxs(He,{style:{height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:f?"#efe":"#eee"},onDragOver:o=>{o.preventDefault(),k(f)},onDragLeave:()=>k(!1),onPaste:o=>{const _=o.clipboardData.getData("text/plain");/^https?.*(png|jpe?g|gif|webp)$/.test(_)&&ue([_])},children:[c.jsx(Je,{className:"numbered-header",children:c.jsxs(Ye,{style:{width:"100%",display:"flex",justifyContent:"space-between"},gutter:16,children:[c.jsxs(we,{style:{display:"flex",alignItems:"center"},children:[c.jsx(Ke,{to:"/",className:"logo",children:"STARRY"}),c.jsx(lt,{placeholder:e.formatMessage({id:"numbered.titlePlaceholder"}),defaultValue:e.formatMessage({id:"numbered.defaultTitle"}),style:{height:"30px"},value:t==null?void 0:t.title,onChange:o=>{const _=ie(JSON.stringify(t),me);_.title=o.target.value,i(_)}})]}),c.jsxs(we,{children:[H==="edit"&&c.jsx(ee,{title:e.formatMessage({id:"numbered.switchToPlay"}),disabled:!((z=t==null?void 0:t.pages)!=null&&z.length),style:{verticalAlign:"middle",color:"#999999"},icon:c.jsx(ft,{}),onClick:()=>{if(!t.pages.some(o=>{var _;return((_=o.systems)==null?void 0:_.length)>0})){_e.warn(e.formatMessage({id:"numbered.recognizeFirst"}));return}V("play")}}),H==="play"&&c.jsx(ee,{title:e.formatMessage({id:"numbered.switchToEdit"}),disabled:!((Q=t==null?void 0:t.pages)!=null&&Q.length),style:{verticalAlign:"middle",color:"#999999"},icon:c.jsx(Xe,{}),onClick:()=>{V("edit"),S(!1)}})]}),H==="play"&&c.jsxs(ye,{style:{flex:1,paddingLeft:"10px"},children:[c.jsx(ct,{title:e.formatMessage({id:"numbered.goToStart"}),className:fe.playControlBtn,onClick:()=>{U({system:0,x:0})}}),G?c.jsx(bt,{title:e.formatMessage({id:"common.pause"}),className:je(fe.playControlBtn,{[fe.playControlBtnActive]:G}),onClick:()=>{S(!G)}}):c.jsx(ut,{title:e.formatMessage({id:"common.play"}),className:fe.playControlBtn,onClick:()=>{S(!G)}}),c.jsxs("div",{children:["𝅘𝅥 =",c.jsx("input",{value:g,style:{padding:"0 5px",display:"inline",border:"none",width:"50px"},type:"number",step:10,onChange:o=>{x(+o.target.value),R.current=!0}})]})]}),c.jsx(we,{style:{flex:1},children:c.jsx(ht,{ref:a,onChange:ue})}),c.jsxs(ye,{style:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[c.jsxs(ee,{icon:c.jsx(mt,{}),loading:q.loading,onClick:()=>le(t),disabled:!((J=t==null?void 0:t.pages)!=null&&J.length)&&(X.type!=="admin"||X.edit),children:[q.loading?e.formatMessage({id:"common.saving"}):e.formatMessage({id:"common.save"})," ",t.modified?"*":""]}),c.jsxs(ee.Group,{size:"small",children:[c.jsx(ee,{type:b?"primary":"ghost",onClick:()=>{v(!b)},children:e.formatMessage({id:"common.originalImage"})}),c.jsx(ee,{type:N?"primary":"ghost",onClick:()=>{F(!N)},children:e.formatMessage({id:"common.symbols"})}),c.jsx(ee,{type:$?"primary":"ghost",onClick:()=>{E(!$)},children:"BBox"})]}),c.jsx(qe,{})]})]})}),c.jsx(Qe,{className:"numbered-score",style:{flex:1,flexShrink:0,overflow:"scroll"},onWheel:o=>{},children:(re=t==null?void 0:t.pages)!=null&&re.length?c.jsx(ye,{wrap:!0,style:{padding:"8px"},children:t==null?void 0:t.pages.map((o,_)=>{const C={x:0,y:0,width:o.width,height:o.height};return c.jsxs("div",{className:"relative numbered-page bg-white",style:{boxShadow:"0 0 5px rgb(44 44 44 / 20%)"},children:[c.jsxs("svg",{width:o.width,height:o.height,viewBox:`0 0 ${o.width} ${o.height}`,style:{width:`${Te}px`,height:`${Te*o.height/o.width}px`},children:[b&&(o==null?void 0:o.backgroundImage)&&c.jsx("image",{className:"background",...C,href:o.backgroundImage}),$&&o.accessories.map((w,O)=>c.jsx(Se,{placement:"top",title:w.text,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsx("rect",{className:`page-acc-${w.semantic}`,...Ae(w.box),fill:"rgba(255, 0, 0, 0.2)",onClick:()=>console.log(w)})},O)),o.systems.map((w,O)=>{const L=ge;return ge+=w.measureCount,c.jsxs("g",{className:"numbered-system","data-system":O,transform:`translate(${w.left}, ${w.top})`,children:[$&&c.jsx("rect",{x:0,y:0,width:w.right-w.left,height:w.bottom-w.top,fill:"rgba(0, 0, 0, 0.2)"}),w.staves.map((M,Y)=>c.jsxs("g",{className:"numbered-staff",transform:"translate(0, 0)",children:[$&&M.accessories.map((h,A)=>c.jsx("rect",{className:`staff-acc-${h.semantic}`,x:h.box[0],y:h.box[1],width:h.box[2]-h.box[0],height:h.box[3]-h.box[1],fill:"rgba(255, 0, 0, 0.2)",onClick:()=>console.log(h)},A)),$&&M.lyrics.map((h,A)=>c.jsx(Se,{placement:"top",title:h.text,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsx("rect",{className:`staff-acc-${h.semantic}`,x:h.box[0],y:h.box[1],width:h.box[2]-h.box[0],height:h.box[3]-h.box[1],fill:"rgba(0, 0, 255, 0.2)","data-text":h.text,onClick:()=>console.log(h)})},A)),M.measures.map((h,A)=>{const D=h.notes.length===0;return c.jsx(Se,{placement:"top",title:h.expression,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsxs("g",{className:"numbered-measure",transform:`translate(${h.left}, ${h.top})`,onClick:()=>console.log(h),children:[$&&c.jsx("rect",{className:"measure-rect",x:0,y:0,width:h.right-h.left,height:h.bottom-h.top,fill:D?"rgba(255, 0, 0, 0.4)":"rgba(0, 255, 0, 0.2)"}),N&&c.jsx("line",{className:"measure-bar",x1:0,y1:0,x2:0,y2:h.bottom-h.top,stroke:"#000",strokeWidth:"2"}),N&&c.jsx("text",{className:"measure-number",x:0,y:-5,fontSize:o.width/80,children:L+A+1}),$&&h.noteBboxes.map((B,Z)=>{var te;return c.jsx("rect",{className:`syllable-${(te=h.notes[Z])==null?void 0:te.syllable}`,...Ae(B),fill:"rgba(255, 0, 0, 0.2)"},Z)}),N&&h.notes.map((B,Z)=>{const te=B.bbox[2]-B.bbox[0],ne=B.bbox[3]-B.bbox[1];return B.bbox?c.jsx(zt,{id:B.id,note:B,x:B.bbox[0],y:M.baseY-h.top-o.syllableSize*.2,width:te,height:ne,fontSize:o.syllableSize},Z):null})]})},A)}),N&&M.slurConnections.map((h,A)=>{const[,,[D,B]]=h;return c.jsx($e,{strokeWidth:o.width/600,stroke:"rgba(255, 0, 0, 0.8)",begin:D,end:B},A)}),N&&M.lyricConnections.map((h,A)=>{const[,,[D,B]]=h;return c.jsx($e,{strokeWidth:o.width/600,stroke:"rgba(0, 255, 0, 0.8)",begin:D,end:B,perturbation:!0},A)})]},Y))]},O)})]}),H==="play"&&c.jsx(Wt,{score:t,page:o,pageIndex:_,onSeekPosition:U}),c.jsxs(ye,{size:"small",className:"numbered-page-toolbar",children:[c.jsx(ee,{size:"small",title:e.formatMessage({id:"numbered.moveForward"}),disabled:_===0,icon:c.jsx(dt,{}),onClick:()=>{const w=t.pages.splice(_,1);t.pages.splice(_-1,0,w[0]),d()}}),c.jsx(ee,{size:"small",title:e.formatMessage({id:"numbered.moveBackward"}),disabled:_===t.pages.length-1,icon:c.jsx(pt,{}),onClick:()=>{const w=t.pages.splice(_,1);t.pages.splice(_+1,0,w[0]),d()}}),c.jsx(Ze,{title:e.formatMessage({id:"numbered.confirmDeletePage"}),okText:e.formatMessage({id:"common.confirm"}),cancelText:e.formatMessage({id:"common.cancel"}),icon:c.jsx(et,{}),onConfirm:async()=>{t.pages.splice(_,1),d()},children:c.jsx(ee,{title:e.formatMessage({id:"numbered.deletePage"}),type:"primary",size:"small",children:e.formatMessage({id:"numbered.deletePage"})})},"delete")]})]},_)})}):c.jsx(tt,{style:{marginTop:"200px"},description:e.formatMessage({id:"numbered.empty"})})})]})})};export{rs as default};
|
|
|
|
| 1 |
+
import{r as W,j as c,a as We}from"./umi-a044fd32.js";import{f as Ge,q as ze,b as He,H as Je,R as Ye,e as we,L as Ke,E as Xe,S as ye,c as qe,h as Qe,T as Se,P as Ze,Q as et,g as tt}from"./index-49aef8b5.js";import{e as Be,l as st,t as nt,v as rt,B as it,C as at,y as ot,E as lt,S as ct,D as fe,F as ut,G as ht,H as mt,A as dt,s as pt}from"./index.less_used_.module-ae8585e9.js";import{S as gt,u as yt,P as ft,a as bt,e as xt}from"./index-4e219cb7.js";import{F as se,M as vt,r as ie,W as kt,H as Ne,I as wt,J as St,m as he}from"./index-7c2856f0.js";import{S as _t}from"./scheduler-a7fa9c3c.js";import{c as je,u as jt,r as be,n as Ee,P as Mt,m as _e,f as Nt,U as Et,S as Ie,T as Pe,N as It,Y as Pt}from"./_setToString-1e1135c3.js";import{B as ee}from"./button-eba43326.js";import{S as Ct}from"./index-7584011d.js";import{u as Ce}from"./useAsync-0af7a050.js";import"./jszip.min-4f73c8ba.js";var ve={},xe=function(){var s=function(S,u,p,g){for(p=p||{},g=S.length;g--;p[S[g]]=u);return p},e=[19,26,29],r=[2,15],t=[1,12],i=[1,10],a=[4,13,19,25,26,29],n=[1,15],l=[4,12,13,19,25,26,29],f=[1,21],k=[1,23],d=[1,22],b=[19,25,26,29],v=[4,12,13,15,19,20,26,29],N=[1,31],F=[1,32],$=[1,33],E=[4,12,13,15,19,20,25,26,27,28,29],H=[25,26,29],V=[15,19,25,26,29],I={trace:function(){},yy:{},symbols_:{error:2,start_symbol:3,EOF:4,measure:5,music_events:6,music_event:7,event:8,music_breath:9,note:10,grace:11,"|":12,"{":13,note_list:14,"}":15,left_divisions:16,pitch:17,right_divisions:18,"<":19,">":20,syllable:21,accidental:22,decorators:23,notations:24,V:25,ACC:26,DECORATOR:27,NOTATION:28,N:29,$accept:0,$end:1},terminals_:{2:"error",4:"EOF",12:"|",13:"{",15:"}",19:"<",20:">",25:"V",26:"ACC",27:"DECORATOR",28:"NOTATION",29:"N"},productions_:[0,[3,1],[3,2],[5,1],[6,1],[6,2],[7,1],[7,1],[8,1],[8,3],[8,3],[11,3],[14,1],[14,2],[10,3],[16,0],[16,2],[18,0],[18,2],[17,1],[17,2],[17,2],[17,2],[17,2],[17,2],[22,1],[22,2],[23,1],[23,2],[24,1],[24,2],[21,1],[9,1]],performAction:function(u,p,g,y,j,x,ae){var P=x.length-1;switch(j){case 1:return null;case 2:return x[P-1];case 3:this.$=m(x[P]);break;case 4:case 12:case 27:case 29:this.$=[x[P]];break;case 5:case 13:case 28:case 30:this.$=[...x[P-1],x[P]];break;case 9:this.$={...x[P],grace:x[P-2]};break;case 10:this.$={...x[P-2],postGrace:x[P]};break;case 11:case 24:this.$=x[P-1];break;case 14:this.$={ldiv:x[P-2],...T(x[P-1]),rdiv:x[P]};break;case 15:case 17:this.$=0;break;case 16:case 18:this.$=x[P-1]+1;break;case 19:this.$={syllable:x[P]};break;case 20:this.$={acc:x[P-1],...x[P]};break;case 21:this.$={...x[P-1],decorators:[...x[P-1].decorators||[],...x[P]]};break;case 22:this.$={...x[P-1],notations:[...x[P-1].notations||[],...x[P]]};break;case 23:case 25:this.$=x[P];break;case 26:this.$=x[P-1]+x[P];break}},table:[s(e,r,{3:1,5:3,6:4,7:5,8:6,9:7,10:8,11:9,16:11,4:[1,2],13:t,25:i}),{1:[3]},{1:[2,1]},{4:[1,13]},s(e,r,{8:6,9:7,10:8,11:9,16:11,7:14,4:[2,3],13:t,25:i}),s(a,[2,4]),s(a,[2,6],{12:n}),s(a,[2,7]),s(l,[2,8]),{12:[1,16]},s(a,[2,32]),{17:17,19:[1,18],21:19,22:20,25:f,26:k,29:d},s(b,r,{16:11,14:24,10:25}),{1:[2,2]},s(a,[2,5]),{11:26,13:t},s(b,r,{10:8,11:9,16:11,8:27,13:t}),s(v,[2,17],{18:28,23:29,24:30,25:N,27:F,28:$}),s(b,[2,16]),s(E,[2,19]),{17:34,21:19,22:20,25:f,26:[1,35],29:d},{17:36,21:19,22:20,25:f,26:k,29:d},s(E,[2,31]),s(H,[2,25]),s(b,r,{16:11,10:38,15:[1,37]}),s(V,[2,12]),s(l,[2,10]),s(a,[2,9],{12:n}),s([4,12,13,15,19,25,26,29],[2,14],{20:[1,39]}),s([4,12,13,15,19,20,25,26,28,29],[2,21],{27:[1,40]}),s([4,12,13,15,19,20,25,26,27,29],[2,22],{28:[1,41]}),s(E,[2,24]),s(E,[2,27]),s(E,[2,29]),s(v,[2,20],{23:29,24:30,25:N,27:F,28:$}),s(H,[2,26]),s(v,[2,23],{23:29,24:30,25:N,27:F,28:$}),s(l,[2,11]),s(V,[2,13]),s([4,12,13,15,19,20,25,26,29],[2,18]),s(E,[2,28]),s(E,[2,30])],defaultActions:{2:[2,1],13:[2,2]},parseError:function(u,p){if(p.recoverable)this.trace(u);else{var g=new Error(u);throw g.hash=p,g}},parse:function(u){var p=this,g=[0],y=[null],j=[],x=this.table,ae="",P=0,pe=0,X=2,oe=1,ke=j.slice.call(arguments,1),U=Object.create(this.lexer),q={yy:{}};for(var le in this.yy)Object.prototype.hasOwnProperty.call(this.yy,le)&&(q.yy[le]=this.yy[le]);U.setInput(u,q.yy),q.yy.lexer=U,q.yy.parser=this,typeof U.yylloc>"u"&&(U.yylloc={});var ce=U.yylloc;j.push(ce);var ue=U.options&&U.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var ge=function(){var M;return M=U.lex()||oe,typeof M!="number"&&(M=p.symbols_[M]||M),M},z,Q,J,re,o={},_,C,w,O;;){if(Q=g[g.length-1],this.defaultActions[Q]?J=this.defaultActions[Q]:((z===null||typeof z>"u")&&(z=ge()),J=x[Q]&&x[Q][z]),typeof J>"u"||!J.length||!J[0]){var L="";O=[];for(_ in x[Q])this.terminals_[_]&&_>X&&O.push("'"+this.terminals_[_]+"'");U.showPosition?L="Parse error on line "+(P+1)+`:
|
| 2 |
`+U.showPosition()+`
|
| 3 |
Expecting `+O.join(", ")+", got '"+(this.terminals_[z]||z)+"'":L="Parse error on line "+(P+1)+": Unexpected "+(z==oe?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(L,{text:U.match,token:this.terminals_[z]||z,line:U.yylineno,loc:ce,expected:O})}if(J[0]instanceof Array&&J.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+z);switch(J[0]){case 1:g.push(z),y.push(U.yytext),j.push(U.yylloc),g.push(J[1]),z=null,pe=U.yyleng,ae=U.yytext,P=U.yylineno,ce=U.yylloc;break;case 2:if(C=this.productions_[J[1]][1],o.$=y[y.length-C],o._$={first_line:j[j.length-(C||1)].first_line,last_line:j[j.length-1].last_line,first_column:j[j.length-(C||1)].first_column,last_column:j[j.length-1].last_column},ue&&(o._$.range=[j[j.length-(C||1)].range[0],j[j.length-1].range[1]]),re=this.performAction.apply(o,[ae,pe,P,q.yy,J[1],y,j].concat(ke)),typeof re<"u")return re;C&&(g=g.slice(0,-1*C*2),y=y.slice(0,-1*C),j=j.slice(0,-1*C)),g.push(this.productions_[J[1]][0]),y.push(o.$),j.push(o._$),w=x[g[g.length-2]][g[g.length-1]],g.push(w);break;case 3:return!0}}return!0}};const m=S=>{const u=S.filter(y=>y!=="V"&&y.syllable!=="-");let p=0;for(let y of u)p+=y.ldiv,y.underline=p,p-=y.rdiv,y.grace&&(y.grace=m(y.grace)),y.postGrace&&(y.postGrace=m(y.postGrace)),delete y.ldiv,delete y.rdiv;let g=[];for(let y of u)y.ltuplet&&g.push(y),g.length>0&&!y.ltuplet&&!y.rtuplet&&g.push(y),y.rtuplet&&(g.push(y),g.forEach(j=>{const x=g.length;j.timeWarp={numerator:x-1,denominator:x}}),g=[]),delete y.ltuplet,delete y.rtuplet;return S},T=S=>{if(S.octaves=0,S.dots=0,S.ltuplet=0,S.rtuplet=0,S.decorators){for(let u=0;u<S.decorators.length;u++)switch(S.decorators[u]){case"'":S.octaves+=1;break;case",":S.octaves-=1;break;case".":S.dots+=1;break;case"[":S.ltuplet=1;break;case"]":S.rtuplet=1;break}delete S.decorators}return S.notations&&(S.notations=S.notations.map(u=>u.replace(/[^a-z]/g,""))),S};var R=function(){var S={EOF:1,parseError:function(p,g){if(this.yy.parser)this.yy.parser.parseError(p,g);else throw new Error(p)},setInput:function(u,p){return this.yy=p||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var p=u.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var p=u.length,g=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var j=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===y.length?this.yylloc.first_column:0)+y[y.length-g.length].length-g[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[j[0],j[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
| 4 |
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),p=new Array(u.length+1).join("-");return u+this.upcomingInput()+`
|
| 5 |
`+p+"^"},test_match:function(u,p){var g,y,j;if(this.options.backtrack_lexer&&(j={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(j.yylloc.range=this.yylloc.range.slice(0))),y=u[0].match(/(?:\r\n?|\n).*/g),y&&(this.yylineno+=y.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:y?y[y.length-1].length-y[y.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],g=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var x in j)this[x]=j[x];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,p,g,y;this._more||(this.yytext="",this.match="");for(var j=this._currentRules(),x=0;x<j.length;x++)if(g=this._input.match(this.rules[j[x]]),g&&(!p||g[0].length>p[0].length)){if(p=g,y=x,this.options.backtrack_lexer){if(u=this.test_match(g,j[x]),u!==!1)return u;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(u=this.test_match(p,j[y]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
| 6 |
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var p=this.next();return p||this.lex()},begin:function(p){this.conditionStack.push(p)},popState:function(){var p=this.conditionStack.length-1;return p>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(p){return p=this.conditionStack.length-1-Math.abs(p||0),p>=0?this.conditionStack[p]:"INITIAL"},pushState:function(p){this.begin(p)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(p,g,y,j){switch(y){case 0:break;case 1:return g.yytext;case 2:return 26;case 3:return 29;case 4:return 27;case 5:return 28;case 6:return 4}},rules:[/^(?:\s+)/,/^(?:([<>\|V{}]))/,/^(?:([#bh]))/,/^(?:([0-7X-]))/,/^(?:([.,'\[\]]))/,/^(?:(\^\s?[a-z]+))/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return S}();I.lexer=R;function G(){this.yy={}}return G.prototype=I,I.Parser=G,new G}();ve.parser=xe;ve.Parser=xe.Parser;ve.parse=function(){return xe.parse.apply(xe,arguments)};var Ot=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,Tt=(s,e,r,t)=>{for(var i=t>1?void 0:t?Rt(e,r):e,a=s.length-1,n;a>=0;a--)(n=s[a])&&(i=(t?n(e,r,i):n(i))||i);return t&&i&&Ot(e,r,i),i},Le=(s=>(s.Title="Title",s.Author="Author",s.MeasureNumber="MeasureNumber",s.ArcLine="ArcLine",s.KeySignature="KeySignature",s.TempoNumeral="TempoNumeral",s.TimeSignature="TimeSignature",s.Lyric="Lyric",s.TextualMark="TextualMark",s.Other="Other",s.Instrument="Instrument",s.Times="Times",s.Alter="Alter",s.Signo="Signo",s.Repeat1="Repeat1",s.Repeat2="Repeat2",s.Jump="Jump",s.Emo_speed="Emo_speed",s.Dstaff="Dstaff",s.Res2="Res2",s.Res3="Res3",s))(Le||{});const De={C:0,G:1,D:2,A:3,E:4,B:5,bG:-6,bD:-5,bA:-4,bE:-3,bB:-2,F:-1,bC:-7,"#F":5,"#C":6};class Ve extends se{static className="NumberedScore";title;pageSize={width:794,height:1122};pages=[];constructor(e){super(),super.assign(e)}get measures(){return this.pages.reduce((e,r,t)=>[...e,...r.systems.reduce((i,a,n)=>{const l=[];return a.staves.forEach((f,k)=>{f.measures.forEach((d,b)=>{l[b]=l[b]||[],l[b][k]=d})}),[...i,...l]},[])],[])}async replaceImageKeys(e){await Promise.all(this.pages.map(async r=>{r.backgroundImage=await e(r.backgroundImage)}))}assemble(){var a;this.title=this.title||((a=this.pages)==null?void 0:a[0].titles.title);let e=0,r=null;const t=[],i=[];this.pages.forEach((n,l)=>{const f=n.accessories.filter(d=>d.semantic==="TimeSignature").sort((d,b)=>(d.box[3]-d.box[1])/2-(b.box[3]-b.box[1])/2).map(d=>{const b=d.text.replace(/[^0-9/]/g,"").split(/[^0-9]/);let v;return b.length===2&&(v={numerator:+b[0],denominator:+b[1]}),{token:d,value:v}}).filter(d=>d.value),k=n.accessories.filter(d=>d.semantic==="KeySignature").sort((d,b)=>(d.box[3]-d.box[1])/2-(b.box[3]-b.box[1])/2).map(d=>{let b=d.text.replace(/[\b]/g,"b").replace(/[^A-Ga-g]/g,"");return b.length===1&&(b=b.toUpperCase()),b.length===2&&(b=b[0]+b[1].toUpperCase()),{token:d,value:De[b]||0}});n.systems.forEach((d,b)=>{const v=[],N=[];for(;f.length!==0;){const m=f[0];if((m.token.box[3]-m.token.box[1])/2<d.top)v.push(f.shift());else break}for(v.sort((m,T)=>m.token.box[0]-T.token.box[0]);k.length!==0;){const m=k[0];if((m.token.box[3]-m.token.box[1])/2<d.top)N.push(k.shift());else break}N.sort((m,T)=>m.token.box[0]-T.token.box[0]);const F={},$={};if(b===0&&n.titles){if(v.length){const m=v.shift();F[0]=m.value}else F[0]={numerator:4,denominator:4};if(N.length){const m=N.shift();$[0]=m.value}else $[0]=0}v.forEach(m=>{const T=Re(K(m.token.box),d.staves[0].measures.map((R,G)=>({x:d.left+R.left,y:d.top+R.top,measureIndex:G})));T&&(F[T.measureIndex]=m.value)}),N.forEach(m=>{const T=Re(K(m.token.box),d.staves[0].measures.map((R,G)=>({x:d.left+R.left,y:d.top+R.top,measureIndex:G})));T&&($[T.measureIndex]=m.value)});let E=t.at(-1);const H=d.staves[0].measures.map((m,T)=>{const R=F[T];return R?(E=R,R):E});t.push(...H);let V=i.at(-1);const I=d.staves[0].measures.map((m,T)=>{const R=$[T];return R?(V=R,R):V});i.push(...I),d.staves.forEach((m,T)=>{m.measures.forEach((R,G)=>{R.measureIndex=e+G,R.timeSignature=t[R.measureIndex],R.keySignature=i[R.measureIndex],R.notes.forEach((S,u)=>{S.id=Ut(l,b,T,G,S.syllable,K(S.bbox||[0,0,0,0])),r&&(r.next=S,S.prev=r),r=S})})}),e+=Math.max(...d.staves.map(m=>m.measures.length))})})}makeVoiceStaves(){const e=[];let r=0;return this.pages.forEach((t,i)=>{t.systems.forEach((a,n)=>{a.staves.forEach((l,f)=>{e[f]=e[f]||{voices:[{measures:[]}]},l.measures.forEach((k,d)=>{if(!e[f].voices[0].measures[k.measureIndex]){const b=Object.fromEntries(k.notes.reduce((v,N)=>(N.tick=v.current,N.staff=f,N.system=r+n,{pairs:[...v.pairs,[v.current,N]],current:v.current+N.duration}),{pairs:[],current:0}).pairs);e[f].voices[0].measures[k.measureIndex]={tickMap:b,duration:k.duration,timeSignature:k.timeSignature,keySignature:k.keySignature,break:!1,pageBreak:!1,empty:k.notes.length===0,voiceIndex:f}}})})}),r+=t.systems.length}),e}perform(){this.assemble();const e=this.makeVoiceStaves();if(!e)return null;const r=new Map;let t=0;const i=this.pages.reduce((n,l)=>[...n,...l.systems.reduce((f,k)=>[...f,...k.staves[0].measures],[])],[]).filter(n=>n.notes.length>0).map(n=>{const l=e.map(v=>v.voices.map(N=>N.measures[n.measureIndex])).flat(),f=l[0],k=t;t+=f.duration;const d=l.map((v,N)=>Object.values(v.tickMap).map(E=>{let H=0,V=E.next;for(V!=null&&V.slurEnd&&(H+=V.duration,V=V.next);(V==null?void 0:V.syllable)==="-";)H+=V.duration,V=V.next;const I=Math.round(E.duration+H);return r.set(E.id,{system:E.system,measure:n.measureIndex,x:n.left+E.roundX,endX:n.left+n.right}),{tick:Math.round(E.tick),duration:I,pitches:[{note:E,value:E.toMidiPitch(v.keySignature)}],noteIds:[E.id],part:0,staff:E.staff}}).map(E=>{const H=E.pitches.reduce((I,m)=>(I[m.value]=m,I),{});return Object.values(H).sort((I,m)=>I.note.syllable>m.note.syllable?1:-1).filter(I=>{var m,T;return!(I.note.slurEnd&&((T=(m=I.note)==null?void 0:m.prev)==null?void 0:T.syllable)===I.note.syllable)&&I.note.syllable!=="-"}).map((I,m)=>{const T=E.noteIds&&E.noteIds[m];return{tick:E.tick,pitch:I.value,duration:E.duration,chordPosition:{index:m,count:E.pitches.length},tied:I.note.slurEnd||I.note.syllable==="-",id:T,ids:[T],track:E.part,staff:E.staff,channel:0,subNotes:[{startTick:0,endTick:E.duration,pitch:I.value,velocity:127}]}})}).flat()).flat(),b=[];return{tick:k,duration:n.duration,notes:d,events:b,timeSignature:n.timeSignature,keySignature:n.keySignature}});return i[0].events.push({track:0,ticks:0,data:{type:"meta",subtype:"setTempo",microsecondsPerBeat:5e5}}),{notation:new vt({measures:i}),tokenMap:r}}}class At extends se{static className="NumberedPage";imageSize;backgroundImage;accessories;systems;constructor(e){super(),super.assign(e)}get width(){return this.imageSize.width}get height(){return this.imageSize.height}get titles(){const e=this.accessories.filter(i=>i.semantic==="Title").sort((i,a)=>K(i.box).y-K(a.box).y).map(i=>i.text);if(e.length===0)return null;const r=e[0],t=e.slice(1).join(`
|
| 7 |
+
`);return{title:r,subtitle:t}}get authors(){return this.accessories.filter(e=>e.semantic==="Author")}get measureCount(){return this.systems.reduce((e,r)=>e+r.measureCount,0)}get syllableSize(){let e=[];return this.systems.forEach(r=>{r.staves.forEach(t=>{t.measures.forEach(i=>{i.noteBboxes.forEach(a=>{e.push(a[3]-a[1])})})})}),e.sort((r,t)=>t-r)[5]}}class $t extends se{static className="NumberedSystem";left;top;right;bottom;bracketsAppearance;staves;constructor(e){super(),super.assign(e)}get width(){return this.right-this.left}get noteRange(){return{top:0,bottom:this.staves.reduce((e,r)=>Math.max(e,Math.max(...r.accessories.map(t=>t.box[3])),r.measures.reduce((t,i)=>Math.max(t,i.bottom),0)),0)}}get measureCount(){return this.staves[0].measures.length}}class Bt extends se{static className="NumberedStaff";baseY;accessories;measures;voice;constructor(e){super(),super.assign(e)}get lyrics(){return this.accessories.filter(e=>e.semantic==="Lyric").reduce((e,r)=>{if(r.text.replace(/[^A-z-]/g,"").length/r.text.length>.5)return[...e,r];const[t,i,a,n]=r.box,l=(a-t)/r.text.length;let f=[];for(let k=0;k<r.text.length;k++){const d=ie(r.toJSON(),{NumberedAccessory:Fe});d.box=[t+k*l,i,t+(k+1)*l,n],d.text=r.text[k],f.push(d)}return[...e,...f]},[])}get slurs(){return this.accessories.filter(e=>e.semantic==="ArcLine")}get slurConnections(){const e=this.slurs.map(n=>[{slur:n,begin:!0,point:{x:n.box[0],y:n.box[3]}},{slur:n,end:!0,point:{x:n.box[2],y:n.box[3]}}]).flat();let r=0;const t=this.measures.map((n,l)=>{const f=e.reduce((k,d,b)=>[...k,...n.notes.filter(v=>v.bbox).map((v,N)=>{const F=K(v.bbox),$={x:n.left+F.x,y:n.top+F.y};return{note:v,slur:d,points:[$,d.point],angle:Me(d.point,$),distance:Math.sqrt(Math.pow(n.left+(v.bbox[2]-v.bbox[0])/2-d.point[0],2)+Math.pow(n.top+v.bbox[1]-d.point[1],2)),measureHeight:n.bottom-n.top,slurIndex:b,noteIndex:r+N}}).sort((v,N)=>v.angle-N.angle).slice(0,2)],[]);return r+=n.notes.length,f}).flat(1).sort((n,l)=>n.angle-l.angle),i=new Set,a=[];for(let n of t)i.has(n.slur)||(i.add(n.slur),a.push(n));return a.sort((n,l)=>n.noteIndex-l.noteIndex).map(n=>(n.note.slurBegin=n.slur.begin,n.note.slurEnd=n.slur.end,[n.note,n.slur.slur,n.points,n.angle]))}get lyricConnections(){const e=this.lyrics;let r=0;const t=this.measures.map((n,l)=>{const f=e.reduce((k,d,b)=>[...k,...n.notes.filter(v=>v.bbox).map((v,N)=>{const F=K(v.bbox),$={x:n.left+F.x,y:n.top+F.y},E=K(d.box);return{note:v,lyric:d,points:[$,E],angle:Me(E,$),lyricIndex:b,noteIndex:r+N}}).sort((v,N)=>v.angle-N.angle).slice(0,2)],[]);return r+=n.notes.length,f}).flat(1).sort((n,l)=>n.angle-l.angle),i=[],a=[];for(let n of t.filter(l=>l.angle<36))i.includes(n.lyric)||(i.push(n.lyric),a.push(n));return a.sort((n,l)=>n.noteIndex-l.noteIndex).map(n=>[n.note,n.lyric,n.points,n.angle])}}class Ue extends se{static className="NumberedMeasure";left;top;right;bottom;expression;noteBboxes;semantics;measureIndex;keySignature;timeSignature;constructor(e){super(),super.assign(e)}get duration(){return this.notes.reduce((e,r)=>e+r.duration,0)}get notes(){const e=this.expression.replace(/[(())]/g,"").replace(/<\s>/g,"").replace(/<+$/g,"").replace(/^\)$/g,"").replace(/_ { \. }/,",");let r=[];try{r=ve.parse(e)}catch(t){console.error(t)}return r?r.filter(t=>t!=="V").map((t,i)=>{var a,n;return t.syllable==="-"?new de({syllable:"-",accidental:"",octaves:0,dots:0,division:2,bbox:this.noteBboxes[i]||[0,0,0,0]}):new de({syllable:t.syllable,accidental:t.acc||"",octaves:t.octaves||0,dots:t.dots||0,division:t.underline+2,bbox:this.noteBboxes[i]||[0,0,0,0],breath:!!t.breath,timeWarp:t.timeWarp,grace:((a=t.grace)==null?void 0:a.map(l=>new de({syllable:l.syllable,accidental:t.acc||"",octaves:l.octaves||0,dots:t.dots||0,division:t.underline+2})))??null,postGrace:((n=t.postGrace)==null?void 0:n.map(l=>new de({syllable:l.syllable,accidental:t.acc||"",octaves:l.octaves||0,dots:t.dots||0,division:t.underline+2})))??null})}):[]}validate(){}}Tt([Vt],Ue.prototype,"notes",1);class Lt extends se{static className="NumberedSemantic";constructor(e){super(),super.assign(e)}}class Fe extends se{static className="NumberedAccessory";box;semantic;text;constructor(e){super(),super.assign(e)}}class de extends se{static className="NumberedNote";static blackKeys=["prev","next"];prev;next;syllable;accidental;octaves=0;dots=0;division;timeWarp;bbox;slurBegin;slurEnd;breath;grace;id;tick;system;staff;constructor(e){super(),super.assign(e)}get duration(){return kt*2**-this.division*(2-2**-this.dots)*(this.timeWarp?this.timeWarp.numerator/this.timeWarp.denominator:1)}get roundX(){return K(this.bbox||[0,0,0,0]).x}toMidiPitch(e){var t;let r=((t=this.accidental)==null?void 0:t.split("").reduce((i,a)=>i+{b:-1,"#":1,h:0}[a],0))??0;if(["X","0"].includes(this.syllable))return this.syllable;if(this.syllable==="-"){let i=this.prev;for(;!/^[1-7]$/g.test(i.syllable);)i=i.prev;return Oe(e)+Ne[+i.syllable-1]}if(/^[1-7]$/g.test(this.syllable))return Oe(e)+Ne[+this.syllable-1]+this.octaves*12+r}}function K(s,e){const[r,t,i,a]=s;return{x:((e==null?void 0:e.x)??0)+(r+i)/2,y:((e==null?void 0:e.y)??0)+(t+a)/2}}function Dt(s,e){const{x:r,y:t}=K(s),{x:i,y:a}=K(e);return Math.pow(i-r,2)+Math.pow(a-t,2)}function Me(s,e){const{x:r,y:t}=s,{x:i,y:a}=e;return Math.abs(Math.atan((i-r)/(a-t))*180/Math.PI)}function Vt(s,e,r){r.enumerable=!0;const t=r.get;r.get=function(){return this[`__${e}`]||(this[`__${e}`]=t.call(this)),this[`__${e}`]}}function Ut(s,e,r,t,i,a){const n=Math.round(a.x*10),l=Math.round(a.y*10),f=`${s}|${e}|${r}|${t}|${i}|${n}|${l}`,k=wt.array(f).slice(12);return globalThis.btoa(String.fromCharCode(...k)).substring(0,11)}function Oe(s){const r=["C","bD","D","bE","E","F","bG","G","bA","A","bB","B"].findIndex(i=>De[i]===s);let t=r<12-r?r:r-12;return St+t}function Re(s,e){let r=Number.MAX_SAFE_INTEGER,t=null;for(let i of e){const a=Math.pow(s.x-i.x,2)+Math.pow(s.y-i.y,2);a<r&&(r=a,t=i)}return t}const me=Object.freeze(Object.defineProperty({__proto__:null,AccessoryType:Le,NumberedAccessory:Fe,NumberedMeasure:Ue,NumberedNote:de,NumberedPage:At,NumberedScore:Ve,NumberedSemantic:Lt,NumberedStaff:Bt,NumberedSystem:$t,angleVertical:Me,getBoxCenter:K,squareDistance:Dt},Symbol.toStringTag,{value:"Module"})),Ft=({score:s,page:e,pageIndex:r,onSeekPosition:t})=>{const[i]=Be(),a=W.useRef(null);let n=0;if(i){let l=0;for(const[f,k]of s.pages.entries()){if(i.system>=l-1&&i.system<l+k.systems.length){n=+f;break}l+=k.systems.length}}return W.useEffect(()=>{a.current&&a.current.scrollIntoView({block:"center",behavior:"smooth"})},[a.current,n]),c.jsx("svg",{className:je("graph"),style:{objectFit:"contain",position:"absolute",top:0,left:0},viewBox:`0 0 ${e==null?void 0:e.width} ${e==null?void 0:e.height}`,children:e.systems.map((l,f)=>{const k=s.pages.slice(0,r).reduce((d,b)=>d+b.systems.length,0)+f;return c.jsxs("g",{className:je("system"),transform:`translate(${l.left}, ${l.top})`,children:[c.jsx("rect",{style:{opacity:0},x:0,y:l.noteRange.top,width:l.width,height:l.noteRange.bottom-l.noteRange.top,onClick:d=>{const b=d.target,v=b.getBoundingClientRect(),N=d.clientX-v.left,F=b.getBBox(),$=N/v.width*F.width;t({system:k,x:$})}}),(i==null?void 0:i.system)===k?c.jsx("line",{ref:a,transform:`translate(${i.x-e.syllableSize/4}, 0)`,x1:0,x2:0,y1:l.noteRange.top,y2:l.noteRange.bottom,style:{stroke:"rgba(173, 216, 230, 0.8)",strokeWidth:e.syllableSize/2}}):null]},f)})})},Wt=W.memo(Ft),Te=600;function Ae(s,e=0,r=0){return{x:e+s[0],y:r+s[1],width:s[2]-s[0],height:s[3]-s[1]}}function Gt(s){return[["root","NumberedPage"],["root.accessories[*]","NumberedAccessory"],["root.systems[*]","NumberedSystem"],["root.systems[*].staves[*]","NumberedStaff"],["root.systems[*].staves[*].accessories[*]","NumberedAccessory"],["root.systems[*].staves[*].measures[*]","NumberedMeasure"]].forEach(([r,t])=>{const a=r.split(/[.\[\]]/).filter(Boolean).reduce((n,l)=>l==="root"?n:Array.isArray(n)?l==="*"?n:[].concat(...n.map(f=>f[l])):n[l],s);a&&(Array.isArray(a)?a.forEach(n=>{n.__prototype=t}):a.__prototype=t)}),s}const $e=({begin:s,end:e,strokeWidth:r=2,stroke:t="#000",perturbation:i=!1})=>{const a=e.y-s.y,n=[s.x+a/6,s.y+a/6],l=[e.x+a/6,e.y-a/6];return c.jsxs("g",{children:[c.jsx("path",{d:`M${s.x} ${s.y} C ${n.join(" ")}, ${l.join(" ")}, ${e.x} ${e.y}`,strokeWidth:r,stroke:t,fill:"none"}),c.jsx("circle",{cx:s.x,cy:s.y,r:r*1.618,fill:t}),c.jsx("circle",{cx:e.x,cy:e.y,r:r*1.618,fill:t})]})},zt=({x:s,y:e,width:r,height:t,note:i,fontSize:a,...n})=>c.jsxs("g",{transform:`translate(${s}, ${e})`,...n,children:[c.jsx("text",{className:"measure-note",fontSize:a,children:i.syllable===null?"-":i.syllable}),new Array(Math.max(i.division-2,0)).fill(null).map((l,f)=>c.jsx("line",{x1:0,x2:r,y1:0,y2:0,transform:`translate(0, ${a*.1+f*a*.12})`,strokeWidth:a*.03,stroke:"#000"},f)),new Array(Math.abs(i.octaves)).fill(null).map((l,f)=>{const k=a*.1*i.division;return c.jsx("circle",{transform:`translate(${r/2}, ${i.octaves>0?-a-f*a*.15:k+f*a*.15})`,cx:0,cy:0,r:a*.07,fill:"#000"},f)}),new Array(Math.abs(i.dots)).fill(null).map((l,f)=>c.jsx("circle",{transform:`translate(${r*2+f*(a/2)}, ${-a*.382})`,cx:0,cy:0,r:a*.08,fill:"#000"},f)),i.accidental&&c.jsx("text",{className:"measure-note",transform:`translate(${-r*.6}, ${-a*.3})`,fontSize:a,children:i.accidental.replace(/b/g,"♭").replace(/#/g,"♯").replace(/h/g,"♮")})]}),ns=s=>{var z,Q,J,re;const e=jt(),r=We(),[t,i]=W.useState(new Ve({})),a=W.useRef(null),[n,l]=W.useState(""),[f,k]=W.useState(!1),d=Ge(),[b,v]=W.useState(!0),[N,F]=W.useState(!0),[$,E]=W.useState(!0),[H,V]=st(),I=W.useRef(null),m=W.useRef(null),T=W.useRef(new gt(performance)),R=W.useRef(!1),[G,S]=nt(),[u,p]=Be(),[g,{inc:y,dec:j,set:x,reset:ae}]=rt(90,300,10),[P,pe]=W.useState(null),X=W.useMemo(()=>{var _,C;const o=ze.parse(window.location.search);return(o==null?void 0:o.type)==="admin"?{type:"admin",env:o.env,id:o.id,edit:o.edit==="1"}:{type:"user",id:(r==null?void 0:r.id)||((C=(_=s==null?void 0:s.match)==null?void 0:_.params)==null?void 0:C.id)||P}},[s,P,r]);Ce(async()=>{var o;try{if(!X.id)return null;l(e.formatMessage({id:"common.loading"}));let _=[],C=null,w;if(X.type==="user"){const O=await be.get(`/api/musicSets/${X.id}`);C=Ee((o=O==null?void 0:O.content)==null?void 0:o.scoreURL),C&&(w=ie(await(await fetch(C)).text(),me),await w.replaceImageKeys(async L=>/https?:\/\/|data:/.test(L)?Ee(L):L!=null&&L.startsWith("md5:")?it((await Mt()).omrDomain,L.replace("md5:","")):L),w.assemble())}w?(window.score=w,i(w)):_e.error(e.formatMessage({id:"common.scoreNotFound"})),l("")}catch(_){console.error(_)}},[]);const oe=()=>{m.current.play({nextFrame:()=>(I.current&&p(I.current.lookupPosition(m.current.progressTicks)),new Promise(o=>setTimeout(o,0)))})},ke=async o=>{if(!o.pages.length)return;const{notation:_,tokenMap:C}=o.perform(),w=Array(_.measures.length).fill(null).map((M,Y)=>Y+1),O=_.toPerformingNotationWithEvents(w);O.scaleTempo({headTempo:6e7/g}),I.current=_t.createFromNotation(O,C);const L=m.current?m.current.progressTicks:0;m.current&&m.current.dispose(),m.current=new he.MidiPlayer(O,{cacheSpan:200,onMidi:(M,Y)=>{let h=null;switch(M.subtype){case"noteOn":he.MidiAudio.noteOn(M.channel,M.noteNumber,M.velocity,Y),h=()=>{var A;return(A=M==null?void 0:M.ids)==null?void 0:A.map(D=>{const B=document.getElementById(D);B&&B.classList.add("notePlayOn")})};break;case"noteOff":he.MidiAudio.noteOff(M.channel,M.noteNumber,Y),h=()=>{var A;return(A=M==null?void 0:M.ids)==null?void 0:A.map(D=>{const B=document.getElementById(D);B&&B.classList.remove("notePlayOn")})};break}h&&T.current.appendTask(Y,h)},onPlayFinish(){S(!1),m.current&&(m.current.progressTicks=0)},onTurnCursor(){m.current&&I.current&&p(I.current.lookupPosition(m.current.progressTicks))}}),m.current.progressTicks=L,R.current=!1};W.useEffect(()=>{G?(async()=>{var o;(!m.current||R.current)&&(R.current=!1,await ke(t)),(o=m.current)!=null&&o.isPlaying||oe()})():m.current&&m.current.pause()},[G,t]),Ce(()=>he.MidiAudio.WebAudio.empty()?he.MidiAudio.loadPlugin({soundfontUrl:"/soundfont/",api:"webaudio"}).then(()=>console.debug("Soundfont loaded.")):Promise.resolve());const U=W.useCallback(async o=>{var C;if(!(I!=null&&I.current)){console.log("scheduler is null:",I==null?void 0:I.current);return}const _=(C=m.current)==null?void 0:C.isPlaying;_&&(m.current.pause(),await new Promise(w=>setTimeout(w,0))),document.querySelectorAll(".notePlayOn").forEach(w=>w.classList.remove("notePlayOn")),m.current.progressTicks=I.current.lookupTick(o),_&&oe()},[]),[q,le]=Nt(async o=>{l(e.formatMessage({id:"common.savingScore"})),await o.replaceImageKeys(async O=>O&&await yt(O));const _=new Blob([JSON.stringify(o.toJSON())],{type:"application/json"}),C=Et(_,`${Date.now()}.json`),w=await Ie(C);await Pe(C,{key:w.key,uploadUrl:w.uploadUrl});try{let O=o.title;O=O||e.formatMessage({id:"common.untitledNumbered"});const L={name:O,content:{images:o.pages.map(Y=>({url:Y.backgroundImage})),scoreURL:w.url},tagIdList:[],type:"simple"};let M;X.id?M=await be.put(`/api/musicSets/${X.id}`,{data:L}):M=await be.post("/api/musicSets",{data:L}),String(M.id)!==X.id&&(pe(M.id),window.history.replaceState(null,"",`/numbered/${M.id}`)),i(ie(JSON.stringify(o),me)),It.success({placement:"bottomRight",message:e.formatMessage({id:"common.saveResult"}),description:e.formatMessage({id:"common.saveSuccess"})})}catch(O){console.log(O)}l("")},[P]);at(()=>{m.current&&m.current.dispose(),l(""),S(!1),V("edit"),p(null),ae()});const ce=ot({onFiles:async(o,_)=>{var w;const C=_.dataTransfer.items;if(C.length===1&&C[0].webkitGetAsEntry().isDirectory){const L=C[0].webkitGetAsEntry().createReader();async function M(Y){const h=await new Promise((A,D)=>{Y.readEntries(async B=>{A(await Promise.all(B.map(async Z=>new Promise(te=>Z.file(ne=>te(ne))))))},D)});return h.length>0?[...h,...await M(Y)]:h}l(e.formatMessage({id:"common.loading"})),await M(L),l("");return}switch(o[0].type){case"application/zip":case"application/x-zip-compressed":case"application/json":const O=o[0];l(e.formatMessage({id:"common.loading"}));const L=await xt(O);L&&i(L),l("");break;case"application/pdf":await((w=a.current)==null?void 0:w.onReceivePDF(o));break;default:console.debug("drop file type:",o[0].type),o[0].type.startsWith("image")&&await ue(o)}},onUri:o=>console.log("uri",o),onText:o=>console.log("text",o)}),ue=async o=>{l(e.formatMessage({id:"common.uploadingImages"}));const _=Array.from(o).map(async h=>{if(typeof h=="string"){const D=await new Promise(te=>{const ne=document.createElement("img");ne.src=h,ne.onload=()=>{te(ne)}}),B=document.createElement("canvas");B.width=D.naturalWidth,B.height=D.naturalHeight;const Z=Pt(B.toDataURL("image/png"),h.slice(h.lastIndexOf("/")+1));return Z.url=h,Z.dimensions={width:D.naturalWidth,height:D.naturalHeight},Z}const A=await Ie(h);return h.url=A.url,t.pages.find(D=>D.backgroundImage===A.url)?(_e.warn(e.formatMessage({id:"common.imageExists"},{name:h.name})),null):(await Pe(h,{key:A.key,uploadUrl:A.uploadUrl}),h)}),C=(await Promise.all(_)).filter(Boolean),w=await Promise.all(C.map(h=>new Promise(A=>{const D=new globalThis.Image;D.src=h.url,D.onload=()=>{h.dimensions={width:D.naturalWidth,height:D.naturalHeight},A(D.naturalHeight/D.naturalWidth)}}))),O=t.pageSize.height/t.pageSize.width;typeof O=="number"&&O&&w.push(O);const L=Math.max(...w);t.pageSize={width:794,height:Math.round(794*L)},l(e.formatMessage({id:"common.recognizingImages"}));const M=await be.post("/api/predict/jianpu",{data:{images:C.map(h=>h.url)}});t.pages.push(...M.map((h,A)=>ie(Gt({...h,backgroundImage:C[A].url}),me))),t.assemble();const Y=ie(JSON.stringify(t),me);window.score=Y,R.current=!0,i(Y),l("")};let ge=0;return c.jsx(Ct,{spinning:!!n,tip:n,style:{backgroundColor:ce.over?"red":"initial"},children:c.jsxs(He,{style:{height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:f?"#efe":"#eee"},onDragOver:o=>{o.preventDefault(),k(f)},onDragLeave:()=>k(!1),onPaste:o=>{const _=o.clipboardData.getData("text/plain");/^https?.*(png|jpe?g|gif|webp)$/.test(_)&&ue([_])},children:[c.jsx(Je,{className:"numbered-header",children:c.jsxs(Ye,{style:{width:"100%",display:"flex",justifyContent:"space-between"},gutter:16,children:[c.jsxs(we,{style:{display:"flex",alignItems:"center"},children:[c.jsx(Ke,{to:"/",className:"logo",children:"STARRY"}),c.jsx(lt,{placeholder:e.formatMessage({id:"numbered.titlePlaceholder"}),defaultValue:e.formatMessage({id:"numbered.defaultTitle"}),style:{height:"30px"},value:t==null?void 0:t.title,onChange:o=>{const _=ie(JSON.stringify(t),me);_.title=o.target.value,i(_)}})]}),c.jsxs(we,{children:[H==="edit"&&c.jsx(ee,{title:e.formatMessage({id:"numbered.switchToPlay"}),disabled:!((z=t==null?void 0:t.pages)!=null&&z.length),style:{verticalAlign:"middle",color:"#999999"},icon:c.jsx(ft,{}),onClick:()=>{if(!t.pages.some(o=>{var _;return((_=o.systems)==null?void 0:_.length)>0})){_e.warn(e.formatMessage({id:"numbered.recognizeFirst"}));return}V("play")}}),H==="play"&&c.jsx(ee,{title:e.formatMessage({id:"numbered.switchToEdit"}),disabled:!((Q=t==null?void 0:t.pages)!=null&&Q.length),style:{verticalAlign:"middle",color:"#999999"},icon:c.jsx(Xe,{}),onClick:()=>{V("edit"),S(!1)}})]}),H==="play"&&c.jsxs(ye,{style:{flex:1,paddingLeft:"10px"},children:[c.jsx(ct,{title:e.formatMessage({id:"numbered.goToStart"}),className:fe.playControlBtn,onClick:()=>{U({system:0,x:0})}}),G?c.jsx(bt,{title:e.formatMessage({id:"common.pause"}),className:je(fe.playControlBtn,{[fe.playControlBtnActive]:G}),onClick:()=>{S(!G)}}):c.jsx(ut,{title:e.formatMessage({id:"common.play"}),className:fe.playControlBtn,onClick:()=>{S(!G)}}),c.jsxs("div",{children:["𝅘𝅥 =",c.jsx("input",{value:g,style:{padding:"0 5px",display:"inline",border:"none",width:"50px"},type:"number",step:10,onChange:o=>{x(+o.target.value),R.current=!0}})]})]}),c.jsx(we,{style:{flex:1},children:c.jsx(ht,{ref:a,onChange:ue})}),c.jsxs(ye,{style:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[c.jsxs(ee,{icon:c.jsx(mt,{}),loading:q.loading,onClick:()=>le(t),disabled:!((J=t==null?void 0:t.pages)!=null&&J.length)&&(X.type!=="admin"||X.edit),children:[q.loading?e.formatMessage({id:"common.saving"}):e.formatMessage({id:"common.save"})," ",t.modified?"*":""]}),c.jsxs(ee.Group,{size:"small",children:[c.jsx(ee,{type:b?"primary":"ghost",onClick:()=>{v(!b)},children:e.formatMessage({id:"common.originalImage"})}),c.jsx(ee,{type:N?"primary":"ghost",onClick:()=>{F(!N)},children:e.formatMessage({id:"common.symbols"})}),c.jsx(ee,{type:$?"primary":"ghost",onClick:()=>{E(!$)},children:"BBox"})]}),c.jsx(qe,{})]})]})}),c.jsx(Qe,{className:"numbered-score",style:{flex:1,flexShrink:0,overflow:"scroll"},onWheel:o=>{},children:(re=t==null?void 0:t.pages)!=null&&re.length?c.jsx(ye,{wrap:!0,style:{padding:"8px"},children:t==null?void 0:t.pages.map((o,_)=>{const C={x:0,y:0,width:o.width,height:o.height};return c.jsxs("div",{className:"relative numbered-page bg-white",style:{boxShadow:"0 0 5px rgb(44 44 44 / 20%)"},children:[c.jsxs("svg",{width:o.width,height:o.height,viewBox:`0 0 ${o.width} ${o.height}`,style:{width:`${Te}px`,height:`${Te*o.height/o.width}px`},children:[b&&(o==null?void 0:o.backgroundImage)&&c.jsx("image",{className:"background",...C,href:o.backgroundImage}),$&&o.accessories.map((w,O)=>c.jsx(Se,{placement:"top",title:w.text,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsx("rect",{className:`page-acc-${w.semantic}`,...Ae(w.box),fill:"rgba(255, 0, 0, 0.2)",onClick:()=>console.log(w)})},O)),o.systems.map((w,O)=>{const L=ge;return ge+=w.measureCount,c.jsxs("g",{className:"numbered-system","data-system":O,transform:`translate(${w.left}, ${w.top})`,children:[$&&c.jsx("rect",{x:0,y:0,width:w.right-w.left,height:w.bottom-w.top,fill:"rgba(0, 0, 0, 0.2)"}),w.staves.map((M,Y)=>c.jsxs("g",{className:"numbered-staff",transform:"translate(0, 0)",children:[$&&M.accessories.map((h,A)=>c.jsx("rect",{className:`staff-acc-${h.semantic}`,x:h.box[0],y:h.box[1],width:h.box[2]-h.box[0],height:h.box[3]-h.box[1],fill:"rgba(255, 0, 0, 0.2)",onClick:()=>console.log(h)},A)),$&&M.lyrics.map((h,A)=>c.jsx(Se,{placement:"top",title:h.text,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsx("rect",{className:`staff-acc-${h.semantic}`,x:h.box[0],y:h.box[1],width:h.box[2]-h.box[0],height:h.box[3]-h.box[1],fill:"rgba(0, 0, 255, 0.2)","data-text":h.text,onClick:()=>console.log(h)})},A)),M.measures.map((h,A)=>{const D=h.notes.length===0;return c.jsx(Se,{placement:"top",title:h.expression,overlayInnerStyle:{whiteSpace:"nowrap",width:"fit-content"},children:c.jsxs("g",{className:"numbered-measure",transform:`translate(${h.left}, ${h.top})`,onClick:()=>console.log(h),children:[$&&c.jsx("rect",{className:"measure-rect",x:0,y:0,width:h.right-h.left,height:h.bottom-h.top,fill:D?"rgba(255, 0, 0, 0.4)":"rgba(0, 255, 0, 0.2)"}),N&&c.jsx("line",{className:"measure-bar",x1:0,y1:0,x2:0,y2:h.bottom-h.top,stroke:"#000",strokeWidth:"2"}),N&&c.jsx("text",{className:"measure-number",x:0,y:-5,fontSize:o.width/80,children:L+A+1}),$&&h.noteBboxes.map((B,Z)=>{var te;return c.jsx("rect",{className:`syllable-${(te=h.notes[Z])==null?void 0:te.syllable}`,...Ae(B),fill:"rgba(255, 0, 0, 0.2)"},Z)}),N&&h.notes.map((B,Z)=>{const te=B.bbox[2]-B.bbox[0],ne=B.bbox[3]-B.bbox[1];return B.bbox?c.jsx(zt,{id:B.id,note:B,x:B.bbox[0],y:M.baseY-h.top-o.syllableSize*.2,width:te,height:ne,fontSize:o.syllableSize},Z):null})]})},A)}),N&&M.slurConnections.map((h,A)=>{const[,,[D,B]]=h;return c.jsx($e,{strokeWidth:o.width/600,stroke:"rgba(255, 0, 0, 0.8)",begin:D,end:B},A)}),N&&M.lyricConnections.map((h,A)=>{const[,,[D,B]]=h;return c.jsx($e,{strokeWidth:o.width/600,stroke:"rgba(0, 255, 0, 0.8)",begin:D,end:B,perturbation:!0},A)})]},Y))]},O)})]}),H==="play"&&c.jsx(Wt,{score:t,page:o,pageIndex:_,onSeekPosition:U}),c.jsxs(ye,{size:"small",className:"numbered-page-toolbar",children:[c.jsx(ee,{size:"small",title:e.formatMessage({id:"numbered.moveForward"}),disabled:_===0,icon:c.jsx(dt,{}),onClick:()=>{const w=t.pages.splice(_,1);t.pages.splice(_-1,0,w[0]),d()}}),c.jsx(ee,{size:"small",title:e.formatMessage({id:"numbered.moveBackward"}),disabled:_===t.pages.length-1,icon:c.jsx(pt,{}),onClick:()=>{const w=t.pages.splice(_,1);t.pages.splice(_+1,0,w[0]),d()}}),c.jsx(Ze,{title:e.formatMessage({id:"numbered.confirmDeletePage"}),okText:e.formatMessage({id:"common.confirm"}),cancelText:e.formatMessage({id:"common.cancel"}),icon:c.jsx(et,{}),onConfirm:async()=>{t.pages.splice(_,1),d()},children:c.jsx(ee,{title:e.formatMessage({id:"numbered.deletePage"}),type:"primary",size:"small",children:e.formatMessage({id:"numbered.deletePage"})})},"delete")]})]},_)})}):c.jsx(tt,{style:{marginTop:"200px"},description:e.formatMessage({id:"numbered.empty"})})})]})})};export{ns as default};
|
dist/assets/index-209da080.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{g as L,r as c,_}from"./umi-2cc549ef.js";import{aS as A,bO as M,at as B,ah as V,C as X,a as H,X as U,c as E,b as x,o as q,V as k,e as w}from"./_setToString-4a3d3b61.js";var G=/\s/;function J(e){for(var n=e.length;n--&&G.test(e.charAt(n)););return n}var K=J,Q=K,Y=/^\s+/;function Z(e){return e&&e.slice(0,Q(e)+1).replace(Y,"")}var ee=Z,ne=ee,R=A,te=M,W=0/0,re=/^[-+]0x[0-9a-f]+$/i,ae=/^0b[01]+$/i,ie=/^0o[0-7]+$/i,se=parseInt;function ce(e){if(typeof e=="number")return e;if(te(e))return W;if(R(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=R(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ne(e);var t=ae.test(e);return t||ie.test(e)?se(e.slice(2),t?2:8):re.test(e)?W:+e}var oe=ce,le=B,ue=function(){return le.Date.now()},de=ue,me=A,j=de,z=oe,fe="Expected a function",ve=Math.max,pe=Math.min;function ge(e,n,t){var r,i,o,l,s,u,m=0,h=!1,g=!1,y=!0;if(typeof e!="function")throw new TypeError(fe);n=z(n)||0,me(t)&&(h=!!t.leading,g="maxWait"in t,o=g?ve(z(t.maxWait)||0,n):o,y="trailing"in t?!!t.trailing:y);function C(a){var d=r,p=i;return r=i=void 0,m=a,l=e.apply(p,d),l}function P(a){return m=a,s=setTimeout(b,n),h?C(a):l}function T(a){var d=a-u,p=a-m,S=n-d;return g?pe(S,o-p):S}function N(a){var d=a-u,p=a-m;return u===void 0||d>=n||d<0||g&&p>=o}function b(){var a=j();if(N(a))return I(a);s=setTimeout(b,T(a))}function I(a){return s=void 0,y&&r?C(a):(r=i=void 0,l)}function $(){s!==void 0&&clearTimeout(s),m=0,r=u=i=s=void 0}function f(){return s===void 0?l:I(j())}function v(){var a=j(),d=N(a);if(r=arguments,i=this,u=a,d){if(s===void 0)return P(u);if(g)return clearTimeout(s),s=setTimeout(b,n),C(u)}return s===void 0&&(s=setTimeout(b,n)),l}return v.cancel=$,v.flush=f,v}var Ne=ge;const ye=L(Ne);var be=globalThis&&globalThis.__rest||function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]]);return t};V("small","default","large");var O=null;function xe(e,n){var t=n.indicator,r="".concat(e,"-dot");return t===null?null:k(t)?w(t,{className:E(t.props.className,r)}):k(O)?w(O,{className:E(O.props.className,r)}):c.createElement("span",{className:E(r,"".concat(e,"-dot-spin"))},c.createElement("i",{className:"".concat(e,"-dot-item")}),c.createElement("i",{className:"".concat(e,"-dot-item")}),c.createElement("i",{className:"".concat(e,"-dot-item")}),c.createElement("i",{className:"".concat(e,"-dot-item")}))}function Ee(e,n){return!!e&&!!n&&!isNaN(Number(n))}var Ce=function(n){var t=n.spinPrefixCls,r=n.spinning,i=r===void 0?!0:r,o=n.delay,l=n.className,s=n.size,u=s===void 0?"default":s,m=n.tip,h=n.wrapperClassName,g=n.style,y=n.children,C=be(n,["spinPrefixCls","spinning","delay","className","size","tip","wrapperClassName","style","children"]),P=c.useState(function(){return i&&!Ee(i,o)}),T=H(P,2),N=T[0],b=T[1];c.useEffect(function(){var f=ye(function(){b(i)},o);return f(),function(){var v;(v=f==null?void 0:f.cancel)===null||v===void 0||v.call(f)}},[o,i]);var I=function(){return typeof y<"u"},$=function(v){var a=v.direction,d=E(t,x(x(x(x(x({},"".concat(t,"-sm"),u==="small"),"".concat(t,"-lg"),u==="large"),"".concat(t,"-spinning"),N),"".concat(t,"-show-text"),!!m),"".concat(t,"-rtl"),a==="rtl"),l),p=q(C,["indicator","prefixCls"]),S=c.createElement("div",_({},p,{style:g,className:d,"aria-live":"polite","aria-busy":N}),xe(t,n),m?c.createElement("div",{className:"".concat(t,"-text")},m):null);if(I()){var D=E("".concat(t,"-container"),x({},"".concat(t,"-blur"),N));return c.createElement("div",_({},p,{className:E("".concat(t,"-nested-loading"),h)}),N&&c.createElement("div",{key:"loading"},S),c.createElement("div",{className:D,key:"container"},y))}return S};return c.createElement(U,null,$)},F=function(n){var t=n.prefixCls,r=c.useContext(X),i=r.getPrefixCls,o=i("spin",t),l=_(_({},n),{spinPrefixCls:o});return c.createElement(Ce,_({},l))};F.setDefaultIndicator=function(e){O=e};const he=F;export{he as S,Ne as a,ye as d};
|
|
|
|
|
|
dist/assets/{index-df1803a9.js → index-49aef8b5.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{r as l,o as ss,k as us,u as cs,q as fs,t as Ja,R as X,v as ds,x as vs,y as ms,z as gs,_ as T,e as Gn,d as pa,A as ps,j as xr,B as hs,C as ys,g as Cs}from"./umi-
|
| 2 |
* React Router DOM v6.3.0
|
| 3 |
*
|
| 4 |
* Copyright (c) Remix Software Inc.
|
|
|
|
| 1 |
+
import{r as l,o as ss,k as us,u as cs,q as fs,t as Ja,R as X,v as ds,x as vs,y as ms,z as gs,_ as T,e as Gn,d as pa,A as ps,j as xr,B as hs,C as ys,g as Cs}from"./umi-a044fd32.js";import{A as rt,g as V,a1 as xt,ac as En,a0 as at,$ as it,aq as ha,bE as bs,ae as ya,an as Wn,W as ve,a8 as Nt,bC as Yn,a as H,ad as hn,a5 as me,c as G,w as ke,d as Yt,ab as Ye,bF as Ht,a7 as Sn,aQ as Xt,aR as Ke,b as S,a4 as Y,C as ge,ah as ir,_ as ee,bG as dn,aP as pt,aS as gt,o as ot,ak as wt,V as yn,bH as xs,e as Qe,aa as ws,a2 as Kt,a3 as Ca,bs as ba,ag as xa,bI as co,bJ as Lr,af as wa,aj as fo,X as Es,bK as vo,R as Ss,aN as Ps,bL as Os,bM as Rs,bx as mo,aO as Ns,bv as Ms,bw as _s,bN as Ts,al as go,ap as Fs}from"./_setToString-1e1135c3.js";import{t as Pn,C as Is,u as Ea,B as Ct,N as Xn,c as Sa}from"./button-eba43326.js";/**
|
| 2 |
* React Router DOM v6.3.0
|
| 3 |
*
|
| 4 |
* Copyright (c) Remix Software Inc.
|
dist/assets/{index-077055d7.js → index-4e219cb7.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
import{A as ee,g as U,p as oe,T as ce,Y as le,S as ue,U as fe
|
| 2 |
`),r.title.s={size:h.reduce((l,x)=>l+x.fontSize,0)/h.length});const d=m.filter(l=>l.type===D.Text&&l.textType==="Author"&&l.x>e.pages[0].width/2);d.length>0&&(r.title.composer=d.map(l=>l.text).join(`
|
| 3 |
`),r.title.c={size:d.reduce((l,x)=>l+x.fontSize,0)/d.length})}if(r.page={w:e.pages[0].width,h:e.pages[0].height},r.pages=e.pages.map(i=>{const h=i.source.dimensions.width/i.source.interval,d=i.source.dimensions.height/i.source.interval,[l,x,C,s]=i.source.matrix;return{src:i.source.url,w:h,h:d,x:0,y:0,l1:e.systems.indexOf(i.systems[0]),ls:i.systems.length,matrix:[l,x,C,s,-1/2*l*h+-1/2*d*C+1/2*i.width||0,-1/2*x*h+-1/2*d*s+1/2*i.height||0]}}),r.parts=[],r.lines=[],g){const i=e.staffLayout.partGroups.map(s=>s.range[0]===s.range[1]?[s.range[0]]:s.range),h=e.getTokenMap(),d=[];for(const[s,O]of i.entries()){const E=i.slice(0,s).flat().length,o={measures:[]};e.systems.forEach((a,f)=>{const k=a.staves.slice(),T=i.flat().map(c=>1<<c&a.staffMask?k.shift():null),w=[0,...a.measureBars];for(let c=0;c<a.measureCount;c++){const M=e.spartito.measureIndexMapping[a.headMeasureIndex+c];if(!Number.isFinite(M)){w.length>c+1&&(w[c+1]=w[c]);continue}const N=[];for(const L of O){const z=T[L];z&&N.push(...z.measures[c].getChords().map(A=>({chord:A,staffIndexInPart:L-E})))}let B=0;const v=w[c],R=[];N.forEach(({staffIndexInPart:L,chord:z})=>{const A=[];let j=z.tip?z.tip.x:z.right-z.left/2;z.noteIds.forEach(($,Y)=>{const F=h.get($),u=`n_${i.length>1?s+"_":""}${M}_${B}`;B++,I.set(F.id,u),b.set(F.id,(F.left+F.right)/2-v),S.set(F.id,L+1),A.push({line:-z.ys[Y]*2,id:u,staff:L+1,x:(F.left+F.right)/2-j})}),d[M]=d[M]||[],d[M].push(j-v);const q=e.spartito.measures[a.headMeasureIndex+c].events.filter($=>$.noteIds.some(Y=>z.noteIds.includes(Y)));R.push({elems:A,x:j-v,type:2**z.division,...q.some($=>$.grace)?{grace:{}}:{}})}),o.measures[M]={w:w[c+1]-w[c],staves:O.length,notes:R}}});let y=null;e.spartito.measures.forEach((a,f)=>{const k=e.spartito.measureIndexMapping[f],w=a.contexts.flat().filter(M=>Q.includes(M.tokenType)&&O.includes(M.staff)).map(M=>{const N=i.find(B=>B.includes(M.staff));return{x:M.x,clef:Z(M),staff:N.indexOf(M.staff)+1,tick:M.tick}});w.length>0&&o.measures[k]&&(o.measures[k].clefs=w);const c=a.basics.filter((M,N)=>1<<N&a.staffMask)[0].keySignature;c!==y&&(o.measures[k]&&(o.measures[k].fifths={fifths:c}),y=c)}),o.measures.length>0&&(r.parts[s]=o)}e.systems.forEach((s,O)=>{var M;const E=[],o=s.staves[0],y=s.staves[s.staves.length-1],a=o.top+o.staffY-2,f=y.top+y.staffY-2,k=s.staves.slice(),T=i.flat().map(N=>1<<N&s.staffMask?k.shift():null);let w=null;for(const[N,B]of i.entries()){const v=B.map(u=>T.find(P=>(P==null?void 0:P.index)===u)||null),R=v.map((u,P)=>[P,!u]).filter(u=>u[1]);let L=null;R.length>0&&(L=Object.fromEntries(R.map(u=>[u[0]+1,{hide:u[1]}])));let z=0,A=0;const j=v.filter(u=>!!u);if(j.length>0){const u=j[0],P=j[j.length-1],_=u.top+u.staffY-2,ie=P.top+P.staffY-2;z=_-a,A=ie-_+4}const{list:q,last:$}=v.reduce((u,P,_)=>(u.last===null||P===null?_===0&&z>0?u.list.push(z-4):u.list.push(0):u.list.push(P.top+P.staffY-(u.last.top+u.last.staffY)-4),u.last=P||u.last,u),{last:w,list:[]});w=$;const Y=v.map(u=>{if(u!=null&&u.maskImage){const P=u.imagePosition;return{src:u.maskImage,x:P.x,y:s.top+u.top+P.y-(s.top+u.top+u.staffY-2),w:P.width,h:P.height}}return null}),F=e.spartito.measures[s.headMeasureIndex];E.push({distances:q,imgs:Y,y:z,staves:B.length,parti:N,height:A,...L?{details:L}:{},clef:Object.fromEntries((M=e.spartito.measures[s.headMeasureIndex])==null?void 0:M.contexts.flat().filter(u=>Q.includes(u.tokenType)&&B.includes(u.staff)).map(u=>[u.staff,Z(u)])),fifths:F.basics.filter((u,P)=>1<<P&F.staffMask)[0].keySignature})}const c=s.measureBars.map((N,B)=>e.spartito.measureIndexMapping[s.headMeasureIndex+B]).filter(N=>Number.isFinite(N));r.lines[O]={m1:c[0],m2:c.length>0?c[c.length-1]+1:void 0,x:s.left,y:s.top+a,w:s.measureBars[s.measureBars.length-1],h:f-a+4,lineStaves:E}});const l={0:"default",1:"brace",2:"bracket",3:"square"},x=te(e.staffLayoutCode),C=x.partGroups.map(s=>({sort:s.range[0],part:s})).sort((s,O)=>s.sort-O.sort).map(s=>s.part);r.groups=x.groups.filter(s=>s.group.type!==0).map((s,O)=>({type:l[s.group.type],p1:C.findIndex(E=>E.range.includes(s.range[0])),p2:C.findIndex(E=>E.range.includes(s.range[s.range.length-1]))})).filter(s=>s.type!=="default")}t&&(r.measInfo=t.notation.measures.map((i,h)=>{const d=new Map;return i.notes.forEach(l=>{d.set(l.tick,[...d.get(l.tick)||[],b.get(l.id)])}),Array.from(d.entries()).sort((l,x)=>+l[0]-x[0]).reduce((l,x,C)=>{const s=x[1].find(O=>O>l.last)||x[1][0];return l.list.push(s),l.last=s,l},{last:null,list:[]}).list.filter(Number.isFinite)}));let p;if(t){p={};const i=new Map;let h,d;t.notation.measures.forEach((o,y)=>{const{numerator:a,denominator:f}=o.timeSignature;!p.beats&&!p.beatsUnit&&(p.beats=a,p.beatsUnit=f,h=a,d=f),p.beatInfos=p.beatInfos||[],(h!==a||d!==f)&&(h=a,d=f,p.beatInfos.push({tick:o.tick,beats:a,beatsUnit:f})),p.tempos=p.tempos||[],o.events.forEach(k=>{k.data.type==="meta"&&k.data.subtype==="setTempo"&&p.tempos.push({tick:o.tick,tempo:k.data.microsecondsPerBeat})})}),p.measures=t.notation.measures.reduce((o,y,a)=>{const f=Array.from(new Set(y.notes.map(k=>k.tick))).sort((k,T)=>k-T);return y.notes.forEach(k=>{i.set(k.id,f.indexOf(k.tick))}),o[y.tick]={measure:a,duration:y.duration,note_ticks:f},o},{}),p.measureInfos=t.notation.measures.map((o,y)=>({number:String(y+1),fifths:o.keySignature,beats:o.timeSignature.numerator,beatUnit:o.timeSignature.denominator}));const x=t.notation.toPerformingMIDI(t.notation.measures.map((o,y)=>y+1)).tracks,{partGroups:C}=e.staffLayout;let s=x.map((o,y)=>{const a=C[y].key;let f;switch(a){case"vi":case"vi1":case"vi2":f=40;break;case"viola":f=42;break;case"vo":f=55;break;case"basso":f=71;break;default:f=0;break}return{program:f,channel:y,name:e.instrumentDict[a]??"Piano",track:o}});if(C.some(o=>o.group.grand)){const o=/l\.?h\.?|左手|left hand/i,y=/r\.?h\.?|右手|right hand/i,a=Object.entries(e.instrumentDict).filter(([T,w])=>o.test(w)||y.test(w)).map(([T,w])=>({key:T,hand:o.test(w)?"left":"right"}));let f=null,k;if(a.length===2&&a[0].hand!==a[1].hand){const T=a.find(c=>c.hand==="left"),w=a.find(c=>c.hand==="right");f=[e.staffLayout.staffIds.findIndex(c=>c===(w==null?void 0:w.key)),e.staffLayout.staffIds.findIndex(c=>c===(T==null?void 0:T.key))],k=C.findIndex(c=>c.range[0]<=Math.min(...f)&&c.range[1]>=Math.max(...f))}if(Number.isFinite(k)&&k>-1){const T=s[k],w=[];T.track.forEach(c=>{Number.isFinite(c.staff)&&(w[c.staff]||(w[c.staff]=[]),w[c.staff].push(c)),c.type==="meta"&&w.forEach(M=>{M.push(c)})}),s.splice(k,1,w.filter(Boolean).map(c=>({...T,track:c}))),s=s.flat(),p.rightHandTrack=f[0],p.leftHandTrack=f[1]}else s.sort((T,w)=>T===s[k]?-1:0)}p.tracks=s.map(({program:o,channel:y,name:a})=>({program:o,channel:y,name:a}));const O=s.map(({track:o})=>{const y=new Map;return o.map(a=>{if(a.subtype==="noteOn"&&y.set(a.noteNumber,a),a.subtype==="noteOff"){const f=y.get(a.noteNumber);(f==null?void 0:f.noteNumber)===a.noteNumber&&(f.duration=a.ticks-f.ticks)}return a})}),E=new Map(Object.entries(p.measures).map(([o,y])=>[y.measure,+o]));p.events=O.map((o,y)=>o.filter(a=>a.type==="channel").map(a=>{var k,T;(k=a==null?void 0:a.ids)!=null&&k[0]&&(a.numId=I.get(a.ids[0]));let f=[0,0,0];switch(a.subtype){case"noteOn":f=[144|a.channel,a.noteNumber,a.velocity];break;case"noteOff":f=[128|a.channel,a.noteNumber,a.velocity?a.velocity:0];break;case"noteAftertouch":f=[160|a.channel,a.noteNumber,a.amount];break;case"controller":f=[176|a.channel,a.controllerType,a.value];break;case"programChange":f=[192|a.channel,a.programNumber,0];break;case"channelAftertouch":f=[208|a.channel,a.amount,0];break;case"pitchBend":f=[224|a.channel,a.value&255,a.value>>7&255];break;default:throw new Error("unhandled event subtype:"+a.subtype)}return{...a.subtype==="noteOn"?{id:I.get((T=a==null?void 0:a.ids)==null?void 0:T[0])}:{},tick:a.ticks,channel:a.channel,duration:a.duration,track:y,event:f,elem_ids:a==null?void 0:a.ids.map(w=>I.get(w)),measure:a.measure-1,meas_start_tick:E.get(a.measure-1),staff:S.get(a.ids[0]),note:i.get(a.ids[0])}})).flat(1).sort((o,y)=>{for(const a of["tick","measure","track"])if(o[a]!==y[a])return o[a]-y[a];return 0})}return{scoreJson:r,midiJson:p}}var H={exports:{}};function Pe(e,t){var n=t&&t.cache?t.cache:Be,g=t&&t.serializer?t.serializer:Ne,r=t&&t.strategy?t.strategy:ze;return r(e,{cache:n,serializer:g})}function Oe(e){return e==null||typeof e=="number"||typeof e=="boolean"}function se(e,t,n,g){var r=Oe(g)?g:n(g),I=t.get(r);return typeof I>"u"&&(I=e.call(this,g),t.set(r,I)),I}function ne(e,t,n){var g=Array.prototype.slice.call(arguments,3),r=n(g),I=t.get(r);return typeof I>"u"&&(I=e.apply(this,g),t.set(r,I)),I}function X(e,t,n,g,r){return n.bind(t,e,g,r)}function ze(e,t){var n=e.length===1?se:ne;return X(e,this,n,t.cache.create(),t.serializer)}function Ce(e,t){var n=ne;return X(e,this,n,t.cache.create(),t.serializer)}function Ee(e,t){var n=se;return X(e,this,n,t.cache.create(),t.serializer)}function Ne(){return JSON.stringify(arguments)}function G(){this.cache=Object.create(null)}G.prototype.has=function(e){return e in this.cache};G.prototype.get=function(e){return this.cache[e]};G.prototype.set=function(e,t){this.cache[e]=t};var Be={create:function(){return new G}};H.exports=Pe;H.exports.strategies={variadic:Ce,monadic:Ee};var Fe=H.exports;const Le=pe(Fe),ve=oe(async({file:e,key:t,uploadUrl:n})=>(await ce(e,{key:t,uploadUrl:n}),t),{cacheKey:e=>e[0].key}),je=async e=>Promise.all(e.filter(Boolean).map(async t=>{const n=await ue(t);return await ve({file:t,key:n.key,uploadUrl:n.uploadUrl}),{key:n.key,url:n.url}}));async function We(e){var g;if(typeof e!="string"||e.startsWith("md5"))return null;if(e.startsWith("http")||e.startsWith("/uploads/"))return e;const t=le(e,"file");return t?((g=(await je([t]))[0])==null?void 0:g.url)??null:null}async function De(e){if(typeof e!="string")return null;if(e.startsWith("http")){const t=await(await fetch(e)).blob();return new Promise(n=>{const g=new FileReader;g.onloadend=function(){n(g.result)},g.readAsDataURL(t)})}return e}async function Ve(e){try{return await De(e)}catch(t){return console.warn("toDataUrl error:",t),e}}async function Ke(e){var r,I;const t=e.find(b=>b.name==="index.json");if(!t){console.warn("no index.json file found in package.");return}const n=W(await t.text(),V);n.settings=n.settings||{semanticConfidenceThreshold:1,enabledGauge:!1,pageLayoutMethod:K.ByLines},(I=(r=n.systems)==null?void 0:r.forEach)==null||I.call(r,b=>{var S,m;return(m=(S=b.staves)==null?void 0:S.forEach)==null?void 0:m.call(S,p=>{var i,h;return(h=(i=p.semantics)==null?void 0:i.forEach)==null?void 0:h.call(i,d=>{d.confidence=Number.isFinite(d.confidence)?d.confidence:1})})});const g=(await Promise.all(e.map(async b=>/^[0-9a-f]+\.?(png|gif)$/.test(b.name)?new Promise(S=>{let m=new FileReader;m.readAsDataURL(b),m.onload=function(){S({[b.name]:m.result})}}):{}))).reduce((b,S)=>({...b,...S}),{});return await n.replaceImageKeys(async b=>b&&/^md5:/.test(b)?g[b.replace("md5:","")]:b&&!/^\w+:/.test(b)?g[b]:b),n}async function He(e){var t,n;switch(e.type){case"application/zip":case"application/x-zip-compressed":{const g=await ae.loadAsync(e),r=g.files["index.json"];if(!r){console.warn("no index.json file found in package.");return}const I=await r.async("text"),b=W(I,V);b.settings=b.settings||{semanticConfidenceThreshold:1,enabledGauge:!1,pageLayoutMethod:K.ByLines},(n=(t=b.systems)==null?void 0:t.forEach)==null||n.call(t,m=>{var p,i;return(i=(p=m.staves)==null?void 0:p.forEach)==null?void 0:i.call(p,h=>{var d,l;return(l=(d=h.semantics)==null?void 0:d.forEach)==null?void 0:l.call(d,x=>{x.confidence=Number.isFinite(x.confidence)?x.confidence:1})})});const S=(await Promise.all(Object.keys(g.files).map(async m=>{if(/^[0-9a-f]+\.?(png|gif)$/.test(m)){const p=await g.files[m].async("arraybuffer"),i=new Blob([p],{type:"image/png"});return new Promise(h=>{const d=new FileReader;d.onload=()=>{h({[m]:d.result})},d.readAsDataURL(i)})}}))).reduce((m,p)=>({...m,...p}),{});return await b.replaceImageKeys(async m=>m&&/^md5:/.test(m)?S[m.replace("md5:","")]:m&&!/^\w+:/.test(m)?S[m]:m),b}case"application/json":return new Promise(g=>{const r=new FileReader;r.onload=()=>{g(W(r.result,V))},r.readAsText(e)});default:return console.warn("unsupported file type:",e.type),null}}function Xe(e){return new he({title:(e==null?void 0:e.title)||me().formatMessage({id:"playground.newScore"}),stavesCount:2,paperOptions:{raggedLast:!0,raggedLastBottom:!0},headers:{},instrumentDict:{},settings:{enabledGauge:!1,pageLayoutMethod:K.ByLines,semanticConfidenceThreshold:1}})}function Qe(e,t,n=1){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)<=n}function Ze(e,{modify:t=!1}={}){return!t&&!e.modified?delete e.modified:e.modified=e.modified||t,e.deepCopy()}const et=Le(te);function Ae(e,t){return t(e)?e:e.parentNode?Ae(e.parentNode,t):null}const tt=async e=>{const{scoreJson:t,midiJson:n}=Me(e);async function g(S,{type:m="image/webp",maxHeight:p=1680,quality:i=.8}={}){const h=await new Promise((o,y)=>{const a=new globalThis.Image;a.crossOrigin="anonymous",a.src=S,a.onload=()=>{o(a)},a.onerror=()=>{y(a)}}),{naturalWidth:d,naturalHeight:l}=h;let x=d,C=l;l>=p&&(C=p,x=d*p/l);const s=new globalThis.OffscreenCanvas(x,C),O=s.getContext("2d");O.imageSmoothingEnabled=!0,O.imageSmoothingQuality="high",O.drawImage(h,0,0,x,C);const E=await s.convertToBlob({type:m,quality:i});return{blob:E,md5:de.ArrayBuffer.hash(await E.arrayBuffer()),suffix:m.split("/")[1]}}const r=new ae;r.file("scoreimg_url.json",JSON.stringify(t,null,0)),await Promise.all([...t.pages.map(async S=>{const{blob:m,md5:p,suffix:i}=await g(S.src),h=`${p}.${i}`;S.src=h,await r.file("scoreimgs/"+h,m,{binary:!0,createFolders:!0})}),...t.lines.map(S=>S.lineStaves.map(m=>m.imgs)).flat(2).map(async S=>{const m=S==null?void 0:S.src;if(m){const{blob:p,md5:i,suffix:h}=await g(m),d=`${i}.${h}`;S.src=d,await r.file("scoreimgs/"+d,p,{binary:!0,createFolders:!0})}})]),r.file("scoreimg.json",JSON.stringify(t,null,0)),r.file("scoremidi.json",JSON.stringify(n,null,0));const I=await r.generateAsync({type:"blob"}),b=fe(I,`find-omr-${e.title}-${Date.now()}.zip`);ge(b,b.name,b.type)},re=(e,t)=>Number.isInteger(e)&&Number.isInteger(t)?t===0?e:re(t,e%t):NaN,$e=e=>e.reduce((t,n)=>re(t,n)),at=e=>{const t=e.map(r=>r.mainDuration),n=t.reduce((r,I)=>r+I,0),g=$e(t);return{sum:n,gcdDuration:g}};export{Ge as P,qe as S,Je as a,Ke as b,Ze as c,at as d,He as e,tt as f,Qe as i,Ae as m,Xe as n,et as p,Ve as s,De as t,We as u};
|
|
|
|
| 1 |
+
import{A as ee,g as U,p as oe,T as ce,Y as le,S as ue,U as fe,a6 as de}from"./_setToString-1e1135c3.js";import{r as J,g as pe,m as me}from"./umi-a044fd32.js";import{a as D,p as te,K as he,P as K,r as W,s as V}from"./index-7c2856f0.js";import{J as ae,d as ge}from"./jszip.min-4f73c8ba.js";var ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372zm-88-532h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8zm224 0h-48c-4.4 0-8 3.6-8 8v304c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V360c0-4.4-3.6-8-8-8z"}}]},name:"pause-circle",theme:"outlined"};const be=ye;var we=function(t,n){return J.createElement(ee,U(U({},t),{},{ref:n,icon:be}))},ke=J.forwardRef(we);const Je=ke;var xe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M442.3 677.6l199.4-156.7a11.3 11.3 0 000-17.7L442.3 346.4c-7.4-5.8-18.3-.6-18.3 8.8v313.5c0 9.4 10.9 14.7 18.3 8.9z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"play-square",theme:"outlined"};const Se=xe;var Ie=function(t,n){return J.createElement(ee,U(U({},t),{},{ref:n,icon:Se}))},Te=J.forwardRef(Ie);const Ge=Te;class qe{timer;tasks={};handlers={};constructor(t=Date){this.timer=t}clear(){Object.values(this.handlers).forEach(t=>clearTimeout(t)),this.tasks={},this.handlers={}}getTask(t){const n=Math.max(t-this.timer.now(),0);return this.tasks[t]||(this.tasks[t]=new Promise(g=>{this.handlers[t]=setTimeout(g,n)}).then(()=>{delete this.tasks[t],delete this.handlers[t]})),this.tasks[t]}appendTask(t,n){this.tasks[t]=this.getTask(t).then(n)}}const Q=[D.ClefG,D.ClefF,D.ClefC],Z=e=>{let t=null;switch(e.tokenType){case D.ClefG:t="Treble";break;case D.ClefF:t="Bass";break;case D.ClefC:e.y===-1?t="Tenor":t="Alto";break}return t};function Me(e){const t=e.spartito.perform(),n=e.systems.map(i=>i.staves.map(h=>h==null?void 0:h.maskImage)).flat(),g=n.filter(Boolean).length>n.length/2,r={},I=new Map,b=new Map,S=new Map;r.unitSize=e.unitSize,r.title={title:e.title};const m=e.pages[0].tokens;if(Array.isArray(m)&&m.length>0){const[i,...h]=m.filter(l=>l.type===D.Text&&l.textType==="Title").sort((l,x)=>x.fontSize-l.fontSize);i&&(r.title.title=i.text,r.title.t={size:i.fontSize}),(h==null?void 0:h.length)>0&&(h.sort((l,x)=>l.y-x.y),r.title.subtitle=h.map(l=>l.text).join(`
|
| 2 |
`),r.title.s={size:h.reduce((l,x)=>l+x.fontSize,0)/h.length});const d=m.filter(l=>l.type===D.Text&&l.textType==="Author"&&l.x>e.pages[0].width/2);d.length>0&&(r.title.composer=d.map(l=>l.text).join(`
|
| 3 |
`),r.title.c={size:d.reduce((l,x)=>l+x.fontSize,0)/d.length})}if(r.page={w:e.pages[0].width,h:e.pages[0].height},r.pages=e.pages.map(i=>{const h=i.source.dimensions.width/i.source.interval,d=i.source.dimensions.height/i.source.interval,[l,x,C,s]=i.source.matrix;return{src:i.source.url,w:h,h:d,x:0,y:0,l1:e.systems.indexOf(i.systems[0]),ls:i.systems.length,matrix:[l,x,C,s,-1/2*l*h+-1/2*d*C+1/2*i.width||0,-1/2*x*h+-1/2*d*s+1/2*i.height||0]}}),r.parts=[],r.lines=[],g){const i=e.staffLayout.partGroups.map(s=>s.range[0]===s.range[1]?[s.range[0]]:s.range),h=e.getTokenMap(),d=[];for(const[s,O]of i.entries()){const E=i.slice(0,s).flat().length,o={measures:[]};e.systems.forEach((a,f)=>{const k=a.staves.slice(),T=i.flat().map(c=>1<<c&a.staffMask?k.shift():null),w=[0,...a.measureBars];for(let c=0;c<a.measureCount;c++){const M=e.spartito.measureIndexMapping[a.headMeasureIndex+c];if(!Number.isFinite(M)){w.length>c+1&&(w[c+1]=w[c]);continue}const N=[];for(const L of O){const z=T[L];z&&N.push(...z.measures[c].getChords().map(A=>({chord:A,staffIndexInPart:L-E})))}let B=0;const v=w[c],R=[];N.forEach(({staffIndexInPart:L,chord:z})=>{const A=[];let j=z.tip?z.tip.x:z.right-z.left/2;z.noteIds.forEach(($,Y)=>{const F=h.get($),u=`n_${i.length>1?s+"_":""}${M}_${B}`;B++,I.set(F.id,u),b.set(F.id,(F.left+F.right)/2-v),S.set(F.id,L+1),A.push({line:-z.ys[Y]*2,id:u,staff:L+1,x:(F.left+F.right)/2-j})}),d[M]=d[M]||[],d[M].push(j-v);const q=e.spartito.measures[a.headMeasureIndex+c].events.filter($=>$.noteIds.some(Y=>z.noteIds.includes(Y)));R.push({elems:A,x:j-v,type:2**z.division,...q.some($=>$.grace)?{grace:{}}:{}})}),o.measures[M]={w:w[c+1]-w[c],staves:O.length,notes:R}}});let y=null;e.spartito.measures.forEach((a,f)=>{const k=e.spartito.measureIndexMapping[f],w=a.contexts.flat().filter(M=>Q.includes(M.tokenType)&&O.includes(M.staff)).map(M=>{const N=i.find(B=>B.includes(M.staff));return{x:M.x,clef:Z(M),staff:N.indexOf(M.staff)+1,tick:M.tick}});w.length>0&&o.measures[k]&&(o.measures[k].clefs=w);const c=a.basics.filter((M,N)=>1<<N&a.staffMask)[0].keySignature;c!==y&&(o.measures[k]&&(o.measures[k].fifths={fifths:c}),y=c)}),o.measures.length>0&&(r.parts[s]=o)}e.systems.forEach((s,O)=>{var M;const E=[],o=s.staves[0],y=s.staves[s.staves.length-1],a=o.top+o.staffY-2,f=y.top+y.staffY-2,k=s.staves.slice(),T=i.flat().map(N=>1<<N&s.staffMask?k.shift():null);let w=null;for(const[N,B]of i.entries()){const v=B.map(u=>T.find(P=>(P==null?void 0:P.index)===u)||null),R=v.map((u,P)=>[P,!u]).filter(u=>u[1]);let L=null;R.length>0&&(L=Object.fromEntries(R.map(u=>[u[0]+1,{hide:u[1]}])));let z=0,A=0;const j=v.filter(u=>!!u);if(j.length>0){const u=j[0],P=j[j.length-1],_=u.top+u.staffY-2,ie=P.top+P.staffY-2;z=_-a,A=ie-_+4}const{list:q,last:$}=v.reduce((u,P,_)=>(u.last===null||P===null?_===0&&z>0?u.list.push(z-4):u.list.push(0):u.list.push(P.top+P.staffY-(u.last.top+u.last.staffY)-4),u.last=P||u.last,u),{last:w,list:[]});w=$;const Y=v.map(u=>{if(u!=null&&u.maskImage){const P=u.imagePosition;return{src:u.maskImage,x:P.x,y:s.top+u.top+P.y-(s.top+u.top+u.staffY-2),w:P.width,h:P.height}}return null}),F=e.spartito.measures[s.headMeasureIndex];E.push({distances:q,imgs:Y,y:z,staves:B.length,parti:N,height:A,...L?{details:L}:{},clef:Object.fromEntries((M=e.spartito.measures[s.headMeasureIndex])==null?void 0:M.contexts.flat().filter(u=>Q.includes(u.tokenType)&&B.includes(u.staff)).map(u=>[u.staff,Z(u)])),fifths:F.basics.filter((u,P)=>1<<P&F.staffMask)[0].keySignature})}const c=s.measureBars.map((N,B)=>e.spartito.measureIndexMapping[s.headMeasureIndex+B]).filter(N=>Number.isFinite(N));r.lines[O]={m1:c[0],m2:c.length>0?c[c.length-1]+1:void 0,x:s.left,y:s.top+a,w:s.measureBars[s.measureBars.length-1],h:f-a+4,lineStaves:E}});const l={0:"default",1:"brace",2:"bracket",3:"square"},x=te(e.staffLayoutCode),C=x.partGroups.map(s=>({sort:s.range[0],part:s})).sort((s,O)=>s.sort-O.sort).map(s=>s.part);r.groups=x.groups.filter(s=>s.group.type!==0).map((s,O)=>({type:l[s.group.type],p1:C.findIndex(E=>E.range.includes(s.range[0])),p2:C.findIndex(E=>E.range.includes(s.range[s.range.length-1]))})).filter(s=>s.type!=="default")}t&&(r.measInfo=t.notation.measures.map((i,h)=>{const d=new Map;return i.notes.forEach(l=>{d.set(l.tick,[...d.get(l.tick)||[],b.get(l.id)])}),Array.from(d.entries()).sort((l,x)=>+l[0]-x[0]).reduce((l,x,C)=>{const s=x[1].find(O=>O>l.last)||x[1][0];return l.list.push(s),l.last=s,l},{last:null,list:[]}).list.filter(Number.isFinite)}));let p;if(t){p={};const i=new Map;let h,d;t.notation.measures.forEach((o,y)=>{const{numerator:a,denominator:f}=o.timeSignature;!p.beats&&!p.beatsUnit&&(p.beats=a,p.beatsUnit=f,h=a,d=f),p.beatInfos=p.beatInfos||[],(h!==a||d!==f)&&(h=a,d=f,p.beatInfos.push({tick:o.tick,beats:a,beatsUnit:f})),p.tempos=p.tempos||[],o.events.forEach(k=>{k.data.type==="meta"&&k.data.subtype==="setTempo"&&p.tempos.push({tick:o.tick,tempo:k.data.microsecondsPerBeat})})}),p.measures=t.notation.measures.reduce((o,y,a)=>{const f=Array.from(new Set(y.notes.map(k=>k.tick))).sort((k,T)=>k-T);return y.notes.forEach(k=>{i.set(k.id,f.indexOf(k.tick))}),o[y.tick]={measure:a,duration:y.duration,note_ticks:f},o},{}),p.measureInfos=t.notation.measures.map((o,y)=>({number:String(y+1),fifths:o.keySignature,beats:o.timeSignature.numerator,beatUnit:o.timeSignature.denominator}));const x=t.notation.toPerformingMIDI(t.notation.measures.map((o,y)=>y+1)).tracks,{partGroups:C}=e.staffLayout;let s=x.map((o,y)=>{const a=C[y].key;let f;switch(a){case"vi":case"vi1":case"vi2":f=40;break;case"viola":f=42;break;case"vo":f=55;break;case"basso":f=71;break;default:f=0;break}return{program:f,channel:y,name:e.instrumentDict[a]??"Piano",track:o}});if(C.some(o=>o.group.grand)){const o=/l\.?h\.?|左手|left hand/i,y=/r\.?h\.?|右手|right hand/i,a=Object.entries(e.instrumentDict).filter(([T,w])=>o.test(w)||y.test(w)).map(([T,w])=>({key:T,hand:o.test(w)?"left":"right"}));let f=null,k;if(a.length===2&&a[0].hand!==a[1].hand){const T=a.find(c=>c.hand==="left"),w=a.find(c=>c.hand==="right");f=[e.staffLayout.staffIds.findIndex(c=>c===(w==null?void 0:w.key)),e.staffLayout.staffIds.findIndex(c=>c===(T==null?void 0:T.key))],k=C.findIndex(c=>c.range[0]<=Math.min(...f)&&c.range[1]>=Math.max(...f))}if(Number.isFinite(k)&&k>-1){const T=s[k],w=[];T.track.forEach(c=>{Number.isFinite(c.staff)&&(w[c.staff]||(w[c.staff]=[]),w[c.staff].push(c)),c.type==="meta"&&w.forEach(M=>{M.push(c)})}),s.splice(k,1,w.filter(Boolean).map(c=>({...T,track:c}))),s=s.flat(),p.rightHandTrack=f[0],p.leftHandTrack=f[1]}else s.sort((T,w)=>T===s[k]?-1:0)}p.tracks=s.map(({program:o,channel:y,name:a})=>({program:o,channel:y,name:a}));const O=s.map(({track:o})=>{const y=new Map;return o.map(a=>{if(a.subtype==="noteOn"&&y.set(a.noteNumber,a),a.subtype==="noteOff"){const f=y.get(a.noteNumber);(f==null?void 0:f.noteNumber)===a.noteNumber&&(f.duration=a.ticks-f.ticks)}return a})}),E=new Map(Object.entries(p.measures).map(([o,y])=>[y.measure,+o]));p.events=O.map((o,y)=>o.filter(a=>a.type==="channel").map(a=>{var k,T;(k=a==null?void 0:a.ids)!=null&&k[0]&&(a.numId=I.get(a.ids[0]));let f=[0,0,0];switch(a.subtype){case"noteOn":f=[144|a.channel,a.noteNumber,a.velocity];break;case"noteOff":f=[128|a.channel,a.noteNumber,a.velocity?a.velocity:0];break;case"noteAftertouch":f=[160|a.channel,a.noteNumber,a.amount];break;case"controller":f=[176|a.channel,a.controllerType,a.value];break;case"programChange":f=[192|a.channel,a.programNumber,0];break;case"channelAftertouch":f=[208|a.channel,a.amount,0];break;case"pitchBend":f=[224|a.channel,a.value&255,a.value>>7&255];break;default:throw new Error("unhandled event subtype:"+a.subtype)}return{...a.subtype==="noteOn"?{id:I.get((T=a==null?void 0:a.ids)==null?void 0:T[0])}:{},tick:a.ticks,channel:a.channel,duration:a.duration,track:y,event:f,elem_ids:a==null?void 0:a.ids.map(w=>I.get(w)),measure:a.measure-1,meas_start_tick:E.get(a.measure-1),staff:S.get(a.ids[0]),note:i.get(a.ids[0])}})).flat(1).sort((o,y)=>{for(const a of["tick","measure","track"])if(o[a]!==y[a])return o[a]-y[a];return 0})}return{scoreJson:r,midiJson:p}}var H={exports:{}};function Pe(e,t){var n=t&&t.cache?t.cache:Be,g=t&&t.serializer?t.serializer:Ne,r=t&&t.strategy?t.strategy:ze;return r(e,{cache:n,serializer:g})}function Oe(e){return e==null||typeof e=="number"||typeof e=="boolean"}function se(e,t,n,g){var r=Oe(g)?g:n(g),I=t.get(r);return typeof I>"u"&&(I=e.call(this,g),t.set(r,I)),I}function ne(e,t,n){var g=Array.prototype.slice.call(arguments,3),r=n(g),I=t.get(r);return typeof I>"u"&&(I=e.apply(this,g),t.set(r,I)),I}function X(e,t,n,g,r){return n.bind(t,e,g,r)}function ze(e,t){var n=e.length===1?se:ne;return X(e,this,n,t.cache.create(),t.serializer)}function Ce(e,t){var n=ne;return X(e,this,n,t.cache.create(),t.serializer)}function Ee(e,t){var n=se;return X(e,this,n,t.cache.create(),t.serializer)}function Ne(){return JSON.stringify(arguments)}function G(){this.cache=Object.create(null)}G.prototype.has=function(e){return e in this.cache};G.prototype.get=function(e){return this.cache[e]};G.prototype.set=function(e,t){this.cache[e]=t};var Be={create:function(){return new G}};H.exports=Pe;H.exports.strategies={variadic:Ce,monadic:Ee};var Fe=H.exports;const Le=pe(Fe),ve=oe(async({file:e,key:t,uploadUrl:n})=>(await ce(e,{key:t,uploadUrl:n}),t),{cacheKey:e=>e[0].key}),je=async e=>Promise.all(e.filter(Boolean).map(async t=>{const n=await ue(t);return await ve({file:t,key:n.key,uploadUrl:n.uploadUrl}),{key:n.key,url:n.url}}));async function We(e){var g;if(typeof e!="string"||e.startsWith("md5"))return null;if(e.startsWith("http")||e.startsWith("/uploads/"))return e;const t=le(e,"file");return t?((g=(await je([t]))[0])==null?void 0:g.url)??null:null}async function De(e){if(typeof e!="string")return null;if(e.startsWith("http")){const t=await(await fetch(e)).blob();return new Promise(n=>{const g=new FileReader;g.onloadend=function(){n(g.result)},g.readAsDataURL(t)})}return e}async function Ve(e){try{return await De(e)}catch(t){return console.warn("toDataUrl error:",t),e}}async function Ke(e){var r,I;const t=e.find(b=>b.name==="index.json");if(!t){console.warn("no index.json file found in package.");return}const n=W(await t.text(),V);n.settings=n.settings||{semanticConfidenceThreshold:1,enabledGauge:!1,pageLayoutMethod:K.ByLines},(I=(r=n.systems)==null?void 0:r.forEach)==null||I.call(r,b=>{var S,m;return(m=(S=b.staves)==null?void 0:S.forEach)==null?void 0:m.call(S,p=>{var i,h;return(h=(i=p.semantics)==null?void 0:i.forEach)==null?void 0:h.call(i,d=>{d.confidence=Number.isFinite(d.confidence)?d.confidence:1})})});const g=(await Promise.all(e.map(async b=>/^[0-9a-f]+\.?(png|gif)$/.test(b.name)?new Promise(S=>{let m=new FileReader;m.readAsDataURL(b),m.onload=function(){S({[b.name]:m.result})}}):{}))).reduce((b,S)=>({...b,...S}),{});return await n.replaceImageKeys(async b=>b&&/^md5:/.test(b)?g[b.replace("md5:","")]:b&&!/^\w+:/.test(b)?g[b]:b),n}async function He(e){var t,n;switch(e.type){case"application/zip":case"application/x-zip-compressed":{const g=await ae.loadAsync(e),r=g.files["index.json"];if(!r){console.warn("no index.json file found in package.");return}const I=await r.async("text"),b=W(I,V);b.settings=b.settings||{semanticConfidenceThreshold:1,enabledGauge:!1,pageLayoutMethod:K.ByLines},(n=(t=b.systems)==null?void 0:t.forEach)==null||n.call(t,m=>{var p,i;return(i=(p=m.staves)==null?void 0:p.forEach)==null?void 0:i.call(p,h=>{var d,l;return(l=(d=h.semantics)==null?void 0:d.forEach)==null?void 0:l.call(d,x=>{x.confidence=Number.isFinite(x.confidence)?x.confidence:1})})});const S=(await Promise.all(Object.keys(g.files).map(async m=>{if(/^[0-9a-f]+\.?(png|gif)$/.test(m)){const p=await g.files[m].async("arraybuffer"),i=new Blob([p],{type:"image/png"});return new Promise(h=>{const d=new FileReader;d.onload=()=>{h({[m]:d.result})},d.readAsDataURL(i)})}}))).reduce((m,p)=>({...m,...p}),{});return await b.replaceImageKeys(async m=>m&&/^md5:/.test(m)?S[m.replace("md5:","")]:m&&!/^\w+:/.test(m)?S[m]:m),b}case"application/json":return new Promise(g=>{const r=new FileReader;r.onload=()=>{g(W(r.result,V))},r.readAsText(e)});default:return console.warn("unsupported file type:",e.type),null}}function Xe(e){return new he({title:(e==null?void 0:e.title)||me().formatMessage({id:"playground.newScore"}),stavesCount:2,paperOptions:{raggedLast:!0,raggedLastBottom:!0},headers:{},instrumentDict:{},settings:{enabledGauge:!1,pageLayoutMethod:K.ByLines,semanticConfidenceThreshold:1}})}function Qe(e,t,n=1){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)<=n}function Ze(e,{modify:t=!1}={}){return!t&&!e.modified?delete e.modified:e.modified=e.modified||t,e.deepCopy()}const et=Le(te);function Ae(e,t){return t(e)?e:e.parentNode?Ae(e.parentNode,t):null}const tt=async e=>{const{scoreJson:t,midiJson:n}=Me(e);async function g(S,{type:m="image/webp",maxHeight:p=1680,quality:i=.8}={}){const h=await new Promise((o,y)=>{const a=new globalThis.Image;a.crossOrigin="anonymous",a.src=S,a.onload=()=>{o(a)},a.onerror=()=>{y(a)}}),{naturalWidth:d,naturalHeight:l}=h;let x=d,C=l;l>=p&&(C=p,x=d*p/l);const s=new globalThis.OffscreenCanvas(x,C),O=s.getContext("2d");O.imageSmoothingEnabled=!0,O.imageSmoothingQuality="high",O.drawImage(h,0,0,x,C);const E=await s.convertToBlob({type:m,quality:i});return{blob:E,md5:de.ArrayBuffer.hash(await E.arrayBuffer()),suffix:m.split("/")[1]}}const r=new ae;r.file("scoreimg_url.json",JSON.stringify(t,null,0)),await Promise.all([...t.pages.map(async S=>{const{blob:m,md5:p,suffix:i}=await g(S.src),h=`${p}.${i}`;S.src=h,await r.file("scoreimgs/"+h,m,{binary:!0,createFolders:!0})}),...t.lines.map(S=>S.lineStaves.map(m=>m.imgs)).flat(2).map(async S=>{const m=S==null?void 0:S.src;if(m){const{blob:p,md5:i,suffix:h}=await g(m),d=`${i}.${h}`;S.src=d,await r.file("scoreimgs/"+d,p,{binary:!0,createFolders:!0})}})]),r.file("scoreimg.json",JSON.stringify(t,null,0)),r.file("scoremidi.json",JSON.stringify(n,null,0));const I=await r.generateAsync({type:"blob"}),b=fe(I,`find-omr-${e.title}-${Date.now()}.zip`);ge(b,b.name,b.type)},re=(e,t)=>Number.isInteger(e)&&Number.isInteger(t)?t===0?e:re(t,e%t):NaN,$e=e=>e.reduce((t,n)=>re(t,n)),at=e=>{const t=e.map(r=>r.mainDuration),n=t.reduce((r,I)=>r+I,0),g=$e(t);return{sum:n,gcdDuration:g}};export{Ge as P,qe as S,Je as a,Ke as b,Ze as c,at as d,He as e,tt as f,Qe as i,Ae as m,Xe as n,et as p,Ve as s,De as t,We as u};
|
dist/assets/index-7584011d.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{g as L,r as c,_ as S}from"./umi-a044fd32.js";import{aU as A,bO as M,av as B,ak as U,C as V,a as X,X as H,c as E,b as x,o as q,V as j,e as w}from"./_setToString-1e1135c3.js";var G=/\s/;function J(e){for(var n=e.length;n--&&G.test(e.charAt(n)););return n}var K=J,Q=K,Y=/^\s+/;function Z(e){return e&&e.slice(0,Q(e)+1).replace(Y,"")}var ee=Z,ne=ee,R=A,te=M,W=0/0,re=/^[-+]0x[0-9a-f]+$/i,ae=/^0b[01]+$/i,ie=/^0o[0-7]+$/i,se=parseInt;function ce(e){if(typeof e=="number")return e;if(te(e))return W;if(R(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=R(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=ne(e);var t=ae.test(e);return t||ie.test(e)?se(e.slice(2),t?2:8):re.test(e)?W:+e}var oe=ce,le=B,ue=function(){return le.Date.now()},de=ue,me=A,k=de,z=oe,fe="Expected a function",ve=Math.max,pe=Math.min;function ge(e,n,t){var r,i,o,l,s,u,m=0,h=!1,g=!1,y=!0;if(typeof e!="function")throw new TypeError(fe);n=z(n)||0,me(t)&&(h=!!t.leading,g="maxWait"in t,o=g?ve(z(t.maxWait)||0,n):o,y="trailing"in t?!!t.trailing:y);function C(a){var d=r,p=i;return r=i=void 0,m=a,l=e.apply(p,d),l}function P(a){return m=a,s=setTimeout(b,n),h?C(a):l}function T(a){var d=a-u,p=a-m,_=n-d;return g?pe(_,o-p):_}function N(a){var d=a-u,p=a-m;return u===void 0||d>=n||d<0||g&&p>=o}function b(){var a=k();if(N(a))return I(a);s=setTimeout(b,T(a))}function I(a){return s=void 0,y&&r?C(a):(r=i=void 0,l)}function $(){s!==void 0&&clearTimeout(s),m=0,r=u=i=s=void 0}function f(){return s===void 0?l:I(k())}function v(){var a=k(),d=N(a);if(r=arguments,i=this,u=a,d){if(s===void 0)return P(u);if(g)return clearTimeout(s),s=setTimeout(b,n),C(u)}return s===void 0&&(s=setTimeout(b,n)),l}return v.cancel=$,v.flush=f,v}var Ne=ge;const ye=L(Ne);var be=globalThis&&globalThis.__rest||function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)n.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(t[r[i]]=e[r[i]]);return t};U("small","default","large");var O=null;function xe(e,n){var t=n.indicator,r="".concat(e,"-dot");return t===null?null:j(t)?w(t,{className:E(t.props.className,r)}):j(O)?w(O,{className:E(O.props.className,r)}):c.createElement("span",{className:E(r,"".concat(e,"-dot-spin"))},c.createElement("i",{className:"".concat(e,"-dot-item")}),c.createElement("i",{className:"".concat(e,"-dot-item")}),c.createElement("i",{className:"".concat(e,"-dot-item")}),c.createElement("i",{className:"".concat(e,"-dot-item")}))}function Ee(e,n){return!!e&&!!n&&!isNaN(Number(n))}var Ce=function(n){var t=n.spinPrefixCls,r=n.spinning,i=r===void 0?!0:r,o=n.delay,l=n.className,s=n.size,u=s===void 0?"default":s,m=n.tip,h=n.wrapperClassName,g=n.style,y=n.children,C=be(n,["spinPrefixCls","spinning","delay","className","size","tip","wrapperClassName","style","children"]),P=c.useState(function(){return i&&!Ee(i,o)}),T=X(P,2),N=T[0],b=T[1];c.useEffect(function(){var f=ye(function(){b(i)},o);return f(),function(){var v;(v=f==null?void 0:f.cancel)===null||v===void 0||v.call(f)}},[o,i]);var I=function(){return typeof y<"u"},$=function(v){var a=v.direction,d=E(t,x(x(x(x(x({},"".concat(t,"-sm"),u==="small"),"".concat(t,"-lg"),u==="large"),"".concat(t,"-spinning"),N),"".concat(t,"-show-text"),!!m),"".concat(t,"-rtl"),a==="rtl"),l),p=q(C,["indicator","prefixCls"]),_=c.createElement("div",S({},p,{style:g,className:d,"aria-live":"polite","aria-busy":N}),xe(t,n),m?c.createElement("div",{className:"".concat(t,"-text")},m):null);if(I()){var D=E("".concat(t,"-container"),x({},"".concat(t,"-blur"),N));return c.createElement("div",S({},p,{className:E("".concat(t,"-nested-loading"),h)}),N&&c.createElement("div",{key:"loading"},_),c.createElement("div",{className:D,key:"container"},y))}return _};return c.createElement(H,null,$)},F=function(n){var t=n.prefixCls,r=c.useContext(V),i=r.getPrefixCls,o=i("spin",t),l=S(S({},n),{spinPrefixCls:o});return c.createElement(Ce,S({},l))};F.setDefaultIndicator=function(e){O=e};const he=F;export{he as S,Ne as a,ye as d};
|
dist/assets/{index-d6bbb942.js → index-7c2856f0.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{g as getDefaultExportFromCjs,c as commonjsGlobal,l as commonjsRequire}from"./umi-
|
| 2 |
* @license
|
| 3 |
* Lodash <https://lodash.com/>
|
| 4 |
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
|
|
| 1 |
+
import{g as getDefaultExportFromCjs,c as commonjsGlobal,l as commonjsRequire}from"./umi-a044fd32.js";import{a_ as _assignValue,bQ as _castPath,aF as _isIndex,aU as isObject_1,aY as _toKey,aV as _baseGet,aW as hasIn_1,aw as _Symbol,aE as isArguments_1,az as isArray_1,ay as _arrayPush,b0 as _overRest,b1 as _setToString,Z as require$$5}from"./_setToString-1e1135c3.js";var assignValue=_assignValue,castPath$1=_castPath,isIndex=_isIndex,isObject=isObject_1,toKey=_toKey;function baseSet$1(s,n,i,r){if(!isObject(s))return s;n=castPath$1(n,s);for(var a=-1,c=n.length,l=c-1,h=s;h!=null&&++a<c;){var u=toKey(n[a]),p=i;if(u==="__proto__"||u==="constructor"||u==="prototype")return s;if(a!=l){var f=h[u];p=r?r(f,u,h):void 0,p===void 0&&(p=isObject(f)?f:isIndex(n[a+1])?[]:{})}assignValue(h,u,p),h=h[u]}return s}var _baseSet=baseSet$1,baseGet=_baseGet,baseSet=_baseSet,castPath=_castPath;function basePickBy$1(s,n,i){for(var r=-1,a=n.length,c={};++r<a;){var l=n[r],h=baseGet(s,l);i(h,l)&&baseSet(c,castPath(l,s),h)}return c}var _basePickBy=basePickBy$1,basePickBy=_basePickBy,hasIn=hasIn_1;function basePick$1(s,n){return basePickBy(s,n,function(i,r){return hasIn(s,r)})}var _basePick=basePick$1,Symbol$1=_Symbol,isArguments=isArguments_1,isArray=isArray_1,spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable$1(s){return isArray(s)||isArguments(s)||!!(spreadableSymbol&&s&&s[spreadableSymbol])}var _isFlattenable=isFlattenable$1,arrayPush=_arrayPush,isFlattenable=_isFlattenable;function baseFlatten$1(s,n,i,r,a){var c=-1,l=s.length;for(i||(i=isFlattenable),a||(a=[]);++c<l;){var h=s[c];n>0&&i(h)?n>1?baseFlatten$1(h,n-1,i,r,a):arrayPush(a,h):r||(a[a.length]=h)}return a}var _baseFlatten=baseFlatten$1,baseFlatten=_baseFlatten;function flatten$1(s){var n=s==null?0:s.length;return n?baseFlatten(s,1):[]}var flatten_1=flatten$1,flatten=flatten_1,overRest=_overRest,setToString=_setToString;function flatRest$1(s){return setToString(overRest(s,void 0,flatten),s+"")}var _flatRest=flatRest$1,basePick=_basePick,flatRest=_flatRest,pick=flatRest(function(s,n){return s==null?{}:basePick(s,n)}),pick_1=pick;const pick$1=getDefaultExportFromCjs(pick_1);var musicWidgetsBrowser_umd={exports:{}};(function(s,n){(function(r,a){s.exports=a()})(typeof self<"u"?self:commonjsGlobal,function(){return function(i){var r={};function a(c){if(r[c])return r[c].exports;var l=r[c]={i:c,l:!1,exports:{}};return i[c].call(l.exports,l,l.exports,a),l.l=!0,l.exports}return a.m=i,a.c=r,a.d=function(c,l,h){a.o(c,l)||Object.defineProperty(c,l,{enumerable:!0,get:h})},a.r=function(c){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})},a.t=function(c,l){if(l&1&&(c=a(c)),l&8||l&4&&typeof c=="object"&&c&&c.__esModule)return c;var h=Object.create(null);if(a.r(h),Object.defineProperty(h,"default",{enumerable:!0,value:c}),l&2&&typeof c!="string")for(var u in c)a.d(h,u,function(p){return c[p]}.bind(null,u));return h},a.n=function(c){var l=c&&c.__esModule?function(){return c.default}:function(){return c};return a.d(l,"a",l),l},a.o=function(c,l){return Object.prototype.hasOwnProperty.call(c,l)},a.p="",a(a.s="fae3")}({"0241":function(i,r,a){const c=a("b37a"),l=a("33e9"),u=800*.24,p=m=>Math.tanh(m/u),f=function(m,T,{softIndexFactor:v=1}={}){T=Number(T);const M=m[T];if(T>0){const O=m[T-1];console.assert(M.start!=null,"note.start is null",M),console.assert(O.start!=null,"lastNote.start is null",O),M.deltaSi=p((M.start-O.start)*v),M.softIndex=O.softIndex+M.deltaSi,console.assert(!Number.isNaN(M.deltaSi),"note.deltaSi is NaN.",M.start,O.start)}else M.softIndex=0,M.deltaSi=0},g=function(m,T,v=c.zero()){m.matches=[];const M=T.pitchMap[m.pitch];if(M)for(const O of M){const k=new c(m,O);v&&k.evaluatePrev(v),m.matches.push(k)}},y=function(m,{softIndexFactor:T=1}={}){for(let v=0;v<m.notes.length;++v)f(m.notes,v,{softIndexFactor:T})},x=async function(m,T,v){const M=new l(m,T);M.resetCursor(-1);for(let O=0;O<T.notes.length;++O)if(M.step(O),await(v&&v(O,M))===Symbol.for("end")){console.log("Navigation interrupted.");return}return M};i.exports={normalizeInterval:p,makeNoteSoftIndex:f,makeMatchNodes:g,genNotationContext:y,runNavigation:x,Navigator:l,Node:c}},"0a40":function(i,r,a){const{Notation:c}=a("ee4f"),l=()=>new Promise(u=>requestAnimationFrame(u));class h{constructor(p,{cacheSpan:f=600,onMidi:g,onPlayFinish:y,onTurnCursor:x}={}){this.cacheSpan=f,this.onMidi=g,this.onPlayFinish=y,this.onTurnCursor=x;let m;p.notes&&Number.isFinite(p.endTime)?m=p:m=c.parseMidi(p),this.notation=m,this.events=m.events,this.isPlaying=!1,this.progressTime=0,this.startTime=performance.now(),this.duration=m.endTime,this.cursorTurnDelta=0,console.assert(m.tempos&&m.tempos.length,"[MidiPlayer] invalid notation, tempos is empty.")}dispose(){this.isPlaying=!1,this.progressTime=0}get progressTicks(){return this.notation.timeToTicks(this.progressTime)}set progressTicks(p){this.progressTime=this.notation.ticksToTime(p),this.onTurnCursor&&this.onTurnCursor(this.progressTime)}async play({nextFrame:p=l}={}){this.progressTime>=this.duration&&(this.progressTime=0);let f=performance.now();this.startTime=f-this.progressTime,this.isPlaying=!0;let g=this.events.findIndex(y=>y.time>=f-this.startTime);for(;this.isPlaying;){for(;g<this.events.length;++g){const y=this.events[g];if(!y||y.time>this.progressTime+this.cacheSpan)break;y.data.type==="channel"&&this.startTime+y.time>=f&&this.onMidi&&this.onMidi(y.data,this.startTime+y.time)}if(await p(),!this.isPlaying)break;if(this.cursorTurnDelta!==0){const y=this.cursorTurnDelta<0;if(this.startTime-=this.cursorTurnDelta,this.cursorTurnDelta=0,y)for(;g>0;--g){const x=this.events[g].time;if(this.startTime+x<f)break}}f=performance.now(),this.progressTime=f-this.startTime,this.progressTime>this.duration&&(this.isPlaying=!1,this.onPlayFinish&&this.onPlayFinish())}}pause(){this.isPlaying=!1}turnCursor(p){this.isPlaying?this.cursorTurnDelta+=p-this.progressTime:this.progressTime=p,this.onTurnCursor&&this.onTurnCursor(p)}}i.exports=h},"2ef0":function(i,r,a){(function(c,l){var h;/**
|
| 2 |
* @license
|
| 3 |
* Lodash <https://lodash.com/>
|
| 4 |
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
dist/assets/{index-ada8c078.js → index-b66f8eba.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as x,j as e,a as O}from"./umi-
|
|
|
|
| 1 |
+
import{r as x,j as e,a as O}from"./umi-a044fd32.js";import{T as E,S as F,a as V,r as Y,s as z,m as I,L as U}from"./index-7c2856f0.js";import{S as _}from"./scheduler-a7fa9c3c.js";import{c as S,u as q,r as D,n as W}from"./_setToString-1e1135c3.js";import{p as G,S as H,a as J,P as X}from"./index-4e219cb7.js";import{B as K}from"./button-eba43326.js";import{S as Q,a as Z}from"./index-0bf6103c.js";import{u as ee}from"./useAsync-0af7a050.js";import"./jszip.min-4f73c8ba.js";const te=({translateX:h=0,translateY:y,width:m,additionalLines:s,...o})=>e.jsxs("g",{...o,className:"staff-lines",transform:`translate(${h}, ${y})`,children:[new Array(5).fill(null).map((i,n)=>e.jsx("line",{x1:0,x2:m,y1:n-2,y2:n-2},n)),s&&s.map((i,n)=>e.jsx("g",{children:Array(Math.abs(i.n)).fill(null).map((d,r)=>e.jsx("line",{x1:i.left,x2:i.right,y1:i.n>0?3+r:-3-r,y2:i.n>0?3+r:-3-r},r))},n))]}),se=x.memo(te),C=({score:h,page:y,pageIndex:m,system:s,systemIndex:o,staff:i,staffIndex:n})=>{var d;return e.jsx(e.Fragment,{children:e.jsxs("g",{className:S("staff",{moving:!1}),transform:`translate(0, ${i.top})`,children:[e.jsxs("g",{children:[e.jsx(se,{translateY:i.staffY,width:s.width,additionalLines:i.additionalLines}),(d=i==null?void 0:i.measures)==null?void 0:d.map((r,c)=>{var t;return e.jsxs("g",{children:[n===0&&e.jsx("text",{x:r.left,y:Math.min(5,i.staffY-3),fontSize:c===0?1.4:.9,fill:"#e65019",children:s.headMeasureIndex+c+1}),e.jsx("g",{transform:`translate(0, ${i.staffY})`,children:e.jsx("g",{className:"tokens",children:(t=r==null?void 0:r.tokens)==null?void 0:t.filter(a=>E.includes(a.type)).map((a,l)=>e.jsxs("g",{className:S("token",{}),transform:`translate(${a.x}, ${a.y})`,id:a.id,onClick:()=>console.log(a),children:[a.voice?e.jsxs("title",{children:["voice-",a.voiceIndices.join(",")]}):null,e.jsx("use",{xlinkHref:`#score-token-def-${a.typeId}`})]},l))})})]},c)})]}),e.jsx("g",{className:"measure-bars",children:s.measureBars.map((r,c)=>e.jsx("g",{className:S("measure-bar"),transform:`translate(${r}, ${i.staffY-2})`,children:e.jsx("line",{x1:0,x2:0,y1:0,y2:4})},c))})]})})};x.memo(C);const ne=h=>{var n,d;const{score:y,pageIndex:m,system:s,systemIndex:o}=h;if(s.staves.length===0)return e.jsx("g",{},o);const i=G(y.staffLayoutCode);return e.jsxs("g",{className:S("system",{}),transform:`translate(${s.left}, ${s.top})`,children:[s.backgroundImage&&!((n=s.staves[0])!=null&&n.backgroundImage)&&!((d=s.staves[0])!=null&&d.maskImage)&&e.jsx("image",{className:"background",href:s.backgroundImage,...s.imagePosition||{}}),s.staves.length>=2&&e.jsx("line",{className:"connection",x1:0,x2:0,y1:s.connectionLine.top,y2:s.connectionLine.bottom}),s.staves.map((r,c)=>e.jsxs("g",{className:S("staff"),transform:`translate(0, ${r.top})`,children:[!r.maskImage&&r.backgroundImage&&e.jsx("image",{className:"background",href:r.backgroundImage,...r.imagePosition||{}}),r.maskImage&&e.jsx("image",{className:"background",href:r.maskImage,...r.imagePosition||{}})]},"staff-"+c)),s.staves.map((r,c)=>e.jsx(C,{...h,staff:r,staffIndex:c},c)),e.jsx("g",{className:"measure-bars",children:s.measureBars.map((r,c)=>e.jsx("g",{transform:`translate(${r}, 0)`,children:i.mask(s.staffMask).conjunctions.map((t,a)=>{const l=s.staves[a],f=s.staves[a+1];if(l&&f)return e.jsx("g",{transform:`translate(0, ${l.top+l.staffY+2})`,children:e.jsx("line",{className:S("staff-layout-measure-bar",{dashed:t===1,blank:t===0}),x1:"0",x2:"0",y1:0,y2:f.top+f.staffY-(l.top+l.staffY)-4})},a)})},c))}),e.jsx(Q,{layout:i.mask(s.staffMask),positions:s.staffPositions,nameDict:(!s.prev||s.staffMask!==s.prev.staffMask)&&y.instrumentDict})]},o)},re=x.memo(ne),ae=({score:h,pageIndex:y,cursorPosition:m,onSeekPosition:s})=>{var d,r,c;const o=h.pages[y],i=x.useRef(null);if(!o)return null;const n=x.useMemo(()=>{let t=0;if(m){let a=0;for(const[l,f]of h.pages.entries()){if(m.system>=a-1&&m.system<a+f.systems.length){t=+l;break}a+=f.systems.length}}return t},[m==null?void 0:m.system]);return x.useEffect(()=>{i.current&&i.current.scrollIntoView({block:"center",behavior:"smooth"})},[i.current,n]),e.jsx("div",{children:e.jsxs("svg",{className:S("graph",{}),style:{objectFit:"contain"},viewBox:`0 0 ${o.width} ${o.height}`,children:[e.jsx(Z,{}),(d=o==null?void 0:o.systems)==null?void 0:d.map((t,a)=>e.jsx(re,{score:h,page:o,pageIndex:y,system:t,systemIndex:a},a)),(o==null?void 0:o.semantics)&&e.jsx("g",{children:(r=o==null?void 0:o.semantics)==null?void 0:r.map((t,a)=>{var l,f,j,k,v,g;if(t.semantic===F.rect_Text)return e.jsx("g",{transform:`translate(${t.x}, ${t.y}) ${(l=t.extension)!=null&&l.theta?`rotate(${((f=t.extension)==null?void 0:f.theta)*180/Math.PI})`:""}`,color:"rgba(25, 175, 230, 0.6)",children:e.jsxs("text",{dominantBaseline:"hanging",x:0,y:-((j=t.extension)==null?void 0:j.height)/2,textAnchor:"middle",style:{fontSize:(k=t.extension)==null?void 0:k.height},children:[(v=t.extension)==null?void 0:v.text,e.jsx("title",{children:((g=t.extension)==null?void 0:g.type)||t.semantic})]})},a)})}),(o==null?void 0:o.tokens)&&e.jsx("g",{children:(c=o==null?void 0:o.tokens)==null?void 0:c.map((t,a)=>{if(t.type===V.Text)return e.jsx("g",{transform:`translate(${t.x}, ${t.y})`,color:"rgba(25, 175, 230, 0.6)",className:"token",children:e.jsxs("text",{dominantBaseline:"hanging",x:0,y:-t.fontSize/2,textAnchor:"middle",style:{fontSize:t.fontSize},className:S(t.textType),children:[t.text,e.jsx("title",{children:t.textType})]})},a)})}),o.systems.map((t,a)=>{const l=h.pages.slice(0,y).reduce((f,j)=>f+j.systems.length,0)+a;return e.jsxs("g",{className:S("system"),transform:`translate(${t.left}, ${t.top})`,children:[e.jsx("rect",{style:{opacity:0},x:0,y:t.noteRange.top,width:t.width,height:t.noteRange.bottom-t.noteRange.top,onClick:f=>{const j=f.target,k=j.getBoundingClientRect(),v=f.clientX-k.left,g=j.getBBox(),u=v/k.width*g.width;s({system:l,x:u})}}),(m==null?void 0:m.system)===l?e.jsx("line",{ref:i,transform:`translate(${m.x}, 0)`,x1:0,x2:0,y1:t.noteRange.top,y2:t.noteRange.bottom,style:{stroke:"lightblue",strokeWidth:1}}):null]},a)})]})})},oe=x.memo(ae),ie=h=>{var v;const y=q(),m=O(),s=x.useRef(new H(performance)),[o,i]=x.useState(),n=x.useRef(null),d=x.useRef(null),[r,c]=x.useState(!1),[t,a]=x.useState(!1),l=ee(async()=>{var b,L,w,P;const g=(m==null?void 0:m.id)||((L=(b=h==null?void 0:h.match)==null?void 0:b.params)==null?void 0:L.id),u=await D.get(`/api/musicSets/${g}`);if((w=u==null?void 0:u.content)!=null&&w.scoreURL){const R=await(await fetch(W(u.content.scoreURL))).json(),$=Y(R,z);return $.assemble(((P=$.settings)==null?void 0:P.semanticConfidenceThreshold)??1),$}return u},[]);x.useEffect(()=>{I.MidiAudio.WebAudio.empty()&&I.MidiAudio.loadPlugin({soundfontUrl:"/soundfont/",api:"webaudio"}).then(()=>{a(!0),console.debug("Soundfont loaded.")}),k()},[]);const f=x.useCallback(async g=>{if(!n.current){console.log("please create midi player first");return}const u=n.current.isPlaying;u&&(n.current.pause(),await new Promise(b=>setTimeout(b,0)),document.querySelectorAll(".notePlayOn").forEach(b=>b.classList.remove("notePlayOn"))),n.current.progressTicks=d.current.lookupTick(g),u&&j()},[]),j=()=>{var g;(g=n.current)!=null&&g.isPlaying?(n.current.pause(),c(!1)):(k(),n.current.play({nextFrame:()=>(d.current&&i(d.current.lookupPosition(n.current.progressTicks)),new Promise(u=>requestAnimationFrame(()=>u())))}),c(!0))},k=()=>{var R,$;if(!(($=(R=l.value)==null?void 0:R.systems)!=null&&$.length))return;const{notation:g,tokenMap:u}=l.value.spartito.perform(),b=l.value.getMeasureLayout(),L=b?b.serialize(U.Full):Array(g.measures.length).fill(null).map((p,N)=>N+1),w=g.toPerformingNotationWithEvents(L);Math.round(6e7/w.tempos[0].tempo),d.current=_.createFromNotation(w,u);const P=n.current?n.current.progressTicks:0;n.current&&n.current.dispose(),n.current=new I.MidiPlayer(w,{cacheSpan:200,onMidi:(p,N)=>{let B=null;switch(p.subtype){case"noteOn":I.MidiAudio.noteOn(p.channel,p.noteNumber,p.velocity,N),B=()=>{var M;return(M=p==null?void 0:p.ids)==null?void 0:M.map(A=>{const T=document.getElementById(A);T&&T.classList.add("notePlayOn")})};break;case"noteOff":I.MidiAudio.noteOff(p.channel,p.noteNumber,N),B=()=>{var M;return(M=p==null?void 0:p.ids)==null?void 0:M.map(A=>{const T=document.getElementById(A);T&&T.classList.remove("notePlayOn")})};break}B&&s.current.appendTask(N,B)},onPlayFinish(){n.current&&(n.current.progressTicks=0),c(!1)},onTurnCursor(){n.current&&d.current&&i(d.current.lookupPosition(n.current.progressTicks))}}),n.current.progressTicks=P};return e.jsxs("div",{className:"viewer",children:[e.jsx(K,{style:{position:"fixed",top:"10px",left:"10px"},icon:r?e.jsx(J,{}):e.jsx(X,{}),onClick:j,disabled:!((v=l.value)!=null&&v.spartito)||!t,children:r?y.formatMessage({id:"common.pause"}):y.formatMessage({id:"common.play"})}),!l.loading&&l.value.pages.map((g,u)=>e.jsx(oe,{score:l.value,pageIndex:u,cursorPosition:o,onSeekPosition:f},u))]})},pe=x.memo(ie);export{pe as default};
|
dist/assets/index-b6983081.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{r as h,u as te,j as s,h as E}from"./umi-a044fd32.js";import{i as se,q,E as ae,b as I,S as L,L as ne,c as ie,I as oe}from"./index-49aef8b5.js";import{D as M,c as X,a as $,S as re,r as ce,A as le}from"./confirm-c1024f99.js";import{r as U,s as H}from"./index-7c2856f0.js";import{A as de,g as W,i as R,M as me,u as Y,f as ue,r as _,m as x,Q as ge,U as P}from"./_setToString-1e1135c3.js";import{p as T}from"./processCompressedAESFile-fac57b0a.js";import{M as fe,P as pe}from"./Table-cb37e8e0.js";import{B as S}from"./button-eba43326.js";import{u as he,e as D,R as ye}from"./useDebounce-51aac85c.js";import{d as C,J as K}from"./jszip.min-4f73c8ba.js";import{u as xe}from"./useAsync-0af7a050.js";import"./index-7584011d.js";var we={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h360c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H184V184h656v320c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V144c0-17.7-14.3-32-32-32zM653.3 599.4l52.2-52.2a8.01 8.01 0 00-4.7-13.6l-179.4-21c-5.1-.6-9.5 3.7-8.9 8.9l21 179.4c.8 6.6 8.9 9.4 13.6 4.7l52.4-52.4 256.2 256.2c3.1 3.1 8.2 3.1 11.3 0l42.4-42.4c3.1-3.1 3.1-8.2 0-11.3L653.3 599.4z"}}]},name:"select",theme:"outlined"};const Se=we;var je=function(l,d){return h.createElement(de,W(W({},l),{},{ref:d,icon:Se}))},ve=h.forwardRef(je);const _e=ve;var Me=function(a){a===void 0&&(a={});var l=h.useState(a),d=l[0],n=l[1],p=h.useMemo(function(){return{set:function(o,m){n(function(j){var g;return R(R({},j),(g={},g[o]=m,g))})},setAll:function(o){n(o)},remove:function(o){n(function(m){var j=m,g=o;j[g];var v=me(j,[typeof g=="symbol"?g:g+""]);return v})},reset:function(){return n(a)}}},[n]),y=R({get:h.useCallback(function(o){return d[o]},[d])},p);return[d,y]};const Ie=Me;var be=function(a,l,d){if(!se)return[l,function(){}];var n=h.useState(function(){try{var o=sessionStorage.getItem(a);return typeof o!="string"?(sessionStorage.setItem(a,d?String(l):JSON.stringify(l)),l):d?o:JSON.parse(o||"null")}catch{return l}}),p=n[0],y=n[1];return h.useEffect(function(){try{var o=d?String(p):JSON.stringify(p);sessionStorage.setItem(a,o)}catch{}}),[p,y]};const $e=be;const Ce="_title_jd9ry_1",Oe="_header_jd9ry_4",ze="_logo_jd9ry_14",ke="_imageFastPreview_jd9ry_18",Ee="_list_jd9ry_53",G={title:Ce,header:Oe,logo:ze,imageFastPreview:ke,"site-tag-plus":"_site-tag-plus_jd9ry_34","ant-table-row":"_ant-table-row_jd9ry_38","ant-tag":"_ant-tag_jd9ry_44",delete:"_delete_jd9ry_47","score-tags":"_score-tags_jd9ry_50",list:Ee},Re={recognized:"#1890ff",completed:"green",manual:"red",recognizing:"orange"},De=({id:a,env:l})=>{var y;const d=Y(),n=xe(async()=>_(`/torch/musicSet/manage/${a}`,{params:{env:l}}),[]),p=async(o,m)=>{const j=await T(o),g=new Blob([j],{type:"application/json"}),v=P(g,`${m}-id_${a}-${Date.now()}.json`);C(v,`${m}-id_${a}-${Date.now()}.json`,v.type)};return n.loading?null:s.jsxs("div",{children:[n.value.preview?s.jsxs(L,{children:[s.jsx(S,{onClick:()=>p(n.value.preview,"preject"),icon:s.jsx(M,{}),children:"Starry Score"}),s.jsx(S,{onClick:()=>p(n.value.content,"score_json"),icon:s.jsx(M,{}),children:"Find Score"}),s.jsx(S,{onClick:()=>p(n.value.midi,"score_midi"),icon:s.jsx(M,{}),children:"Find MIDI"})]}):s.jsx("div",{children:d.formatMessage({id:"admin.noFiles"})}),n.value?s.jsx("div",{style:{width:"100%"},children:(y=n.value.sources)==null?void 0:y.map(o=>s.jsx("img",{src:o.url,style:{width:"100%"}},o.url))}):null]})};function We(){var F,J;const a=Y(),l=h.useRef(),d=h.useRef(null),[n,p]=$e("admin-env","prod"),[y,o]=Ie(),[m,j]=h.useState([]),g=h.useRef({}),v=te(),u=h.useMemo(()=>{try{const t=q.parse(v.search),e=JSON.parse(decodeURIComponent(t.search))||{};return Q(e)}catch{return{}}},[v.search]),[O,N]=ue(async()=>{try{const t=await _("/torch/musicSet/manage",{params:{limit:50,offset:0,...u,env:n}});return{data:t.rows,success:!0,total:t.count}}catch(t){console.error(t)}return{data:void 0,success:!1}},[u,n]);he(()=>{N()},1e3,[u,n]);const z=(t,e)=>{E.push({pathname:"/playground",search:q.stringify({type:"admin",edit:e?"1":"0",env:n,id:t})})},A=(t,e,i,r=1e3)=>{if(!t.spartito||!t.spartito.regulated)return x.loading({content:a.formatMessage({id:"admin.regulation"},{title:i,pct:0}),key:e}),ce(t,{policy:"equations",quota:r,solutionStore:new le,onProgress:c=>{x.loading({content:a.formatMessage({id:"admin.regulation"},{title:i,pct:c}),key:e}),c===100&&x.destroy(e)}})},B=async t=>{o.set(t.id,!0);const e=await _(`/torch/musicSet/manage/${t.id}`,{params:{env:n}}),i=await T(e.preview),r=U(i,H);await A(r,t.id,t.name);const c=new re({score:r,...r.makeMusicSheet(),workTitle:t.name}).toString();return o.set(t.id,!1),c},Z=async t=>{o.set(t.id,!0);const e=await _(`/torch/musicSet/manage/${t.id}`,{params:{env:n}}),i=await T(e.preview),r=U(i,H),c=_.get("/torch/musicSet/manage/issueMeasure",{params:{env:n,offset:0,limit:1e3,status:[-1],scoreId:t.id}});await A(r,t.id,t.name,100),(await c).rows.forEach(b=>{if(b.status<0){const k=r.spartito.measures.find(ee=>ee.measureIndex===b.measureIndex);k&&(k.events=[],k.voices=[])}}),r.spartito.measures.forEach(b=>r.assignBackgroundForMeasure(b));const w=JSON.stringify(r.spartito);return o.set(t.id,!1),w},V=[{title:"#",render:(t,e,i)=>i,hideInSearch:!0},{title:a.formatMessage({id:"admin.column.name"}),dataIndex:"name",sorter:!0,initialValue:u.search,sortOrder:u.sortedBy==="name"&&u.sortedType?{asc:"ascend",desc:"descend"}[u.sortedType]:null,render:(t,e,i)=>s.jsx("a",{onClick:async()=>{if(x.loading({content:a.formatMessage({id:"common.loadingDetail"}),key:e.id,duration:0}),!(await _(`/torch/musicSet/manage/${e.id}`,{params:{...u,env:n}})).preview){x.destroy(),x.warn(a.formatMessage({id:"common.noPreviewContent"}));return}z(e.id,!1),x.destroy()},children:e.name||s.jsx("span",{style:{color:"#999999"},children:a.formatMessage({id:"common.untitled"})})})},{title:a.formatMessage({id:"admin.column.status"}),dataIndex:"status",valueEnum:{waitUpload:"waitUpload",upload:"upload",recognizing:"recognizing",recognized:"recognized",manual:"manual",completed:"completed",completing:"completing",systemError:"systemError",queue:"queue"},render:(t,e)=>s.jsx("span",{style:{color:Re[e.status]},children:e.status})},{title:a.formatMessage({id:"admin.column.pages"}),render:(t,e)=>{var i;return(i=e.sources)==null?void 0:i.length},width:"4em",align:"center",hideInSearch:!0},{title:a.formatMessage({id:"admin.column.createTime"}),width:"12em",dataIndex:"createTime",sorter:!0,hideInSearch:!0},{title:"id",render:(t,e,i)=>e.id},{title:"userId",dataIndex:"userId",render:(t,e,i)=>e.userId},{title:a.formatMessage({id:"admin.column.quality"}),dataIndex:"quality",render:(t,e)=>Number.isFinite(e.quality)?`${(e.quality*100).toFixed(1)}%`:"N/A"},{title:a.formatMessage({id:"admin.column.actions"}),width:"8em",hideInSearch:!0,render:(t,e,i)=>[s.jsx(fe,{trigger:s.jsx(S,{className:"download",type:"link",icon:s.jsx(_e,{})}),children:s.jsx(De,{id:e.id,env:n})},1),s.jsx(S,{className:"download",type:"link",icon:s.jsx(ae,{}),onClick:async()=>{if(x.loading({content:a.formatMessage({id:"common.loadingDetail"}),key:e.id,duration:0}),!(await _(`/torch/musicSet/manage/${e.id}`,{params:{...u,env:n}})).preview){x.destroy(),x.warn(a.formatMessage({id:"common.noPreviewContent"}));return}z(e.id,!0),x.destroy()}},2),s.jsx(S,{disabled:e.status!=="recognized",icon:y[e.id]?s.jsx(ge,{}):s.jsx(M,{}),onClick:async r=>{if(!await new Promise(w=>{X($.withWarn($.withConfirm({title:a.formatMessage({id:"admin.musicXmlExport.title"}),content:a.formatMessage({id:"admin.musicXmlExport.confirm"}),okText:a.formatMessage({id:"common.confirm"}),cancelText:a.formatMessage({id:"common.cancel"}),onOk:()=>w(!0),onCancel:()=>w(!1)})))}))return;const f=await B(e);C(f,`${e.name}-id_${e.id}-${Date.now()}.xml`,"application/xml")}},3)]}];return s.jsxs(I,{children:[s.jsx(I.Header,{className:G.header,children:s.jsxs(L,{children:[s.jsx(ne,{className:G.logo,to:"/",children:"STARRY✨"}),s.jsx(ie,{})]})}),s.jsx(I,{style:{minHeight:"100vh"},children:s.jsxs(I.Content,{style:{padding:"0 50px 50px",marginTop:"66px",width:"unset"},children:[s.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",margin:"10px 0"},children:s.jsxs(L,{size:60,children:[s.jsxs(D.Group,{defaultValue:n,buttonStyle:"solid",onChange:t=>{p(t.target.value),l.current.clearSelected()},children:[s.jsx(D.Button,{value:"prod",children:a.formatMessage({id:"admin.env.prod"})}),s.jsx(D.Button,{value:"test",children:a.formatMessage({id:"admin.env.test"})})]}),s.jsx(S,{icon:s.jsx(ye,{}),onClick:N}),s.jsx(oe,{type:"number",step:1,min:256,style:{width:"8em"},placeholder:"ScoreID to go",onKeyDown:t=>{t.key==="Enter"&&z(t.target.value,!0)}})]})}),s.jsx(pe,{loading:O.loading,dataSource:(F=O.value)==null?void 0:F.data,style:{maxWidth:"100em",margin:"0 auto"},actionRef:l,formRef:d,columns:V,search:{filterType:"light"},size:"small",rowSelection:{onChange:(t,e)=>{j(e)}},pagination:{total:(J=O.value)==null?void 0:J.total,pageSize:50,current:+u.offset/+u.limit+1||1},onChange:(t,e,i,r)=>{var w;const c={ascend:"asc",descend:"desc"}[i.order],f={...u,offset:(t.current-1)*t.pageSize,limit:t.pageSize,tagIdList:e.tagIdList,search:u.search};i.order?(f.sortedBy=i.field,f.sortedType=c):(f.sortedBy=null,f.sortedType=null),((w=e.tagIdList)==null?void 0:w.length)>0?f.tagIdList=e.tagIdList:f.tagIdList=null,console.log("onChange"),E.push({search:`search=${encodeURIComponent(JSON.stringify(Q(f)))}`})},onSubmit:t=>{const e={...Object.fromEntries(Object.entries(u).filter(([i,r])=>!g.current[i])),...t};g.current=t,E.push({search:Object.values(e).filter(Boolean).length>0?`search=${encodeURIComponent(JSON.stringify(e))}`:""})},rowKey:"id",toolBarRender:()=>[s.jsx(S,{disabled:m.length===0,type:"primary",icon:s.jsx(M,{}),onClick:async()=>{if(!await new Promise(c=>{X($.withWarn($.withConfirm({title:a.formatMessage({id:"admin.musicXmlExport.title"}),content:(()=>{const f=m.filter(w=>w.status!=="recognized").length;return a.formatMessage({id:"admin.musicXmlExport.batchConfirm"},{count:m.length,skipped:f>0?a.formatMessage({id:"admin.musicXmlExport.skipped"},{count:f}):""})})(),okText:a.formatMessage({id:"common.confirm"}),cancelText:a.formatMessage({id:"common.cancel"}),onOk:()=>c(!0),onCancel:()=>c(!1)})))}))return;const e=new K;await Promise.all(m.filter(c=>c.status==="recognized").map(async c=>{e.file(`${c.name}-id_${c.id}-${Date.now()}.xml`,await B(c))}));const i=await e.generateAsync({type:"blob"}),r=P(i,`find-omr-pkg-${Date.now()}.zip`);C(r,r.name,r.type)},children:a.formatMessage({id:"admin.batchDownload.musicXml"})},"1"),s.jsx(S,{disabled:m.length===0,type:"primary",icon:s.jsx(M,{}),onClick:async()=>{const t=new K;await Promise.all(m.filter(r=>r.status==="recognized").map(async r=>Promise.race([t.file(`${r.id}.${r.name}-${Date.now()}.spartito.json`,await Z(r)),new Promise(c=>setTimeout(c,3e5))])));const e=await t.generateAsync({type:"blob"}),i=P(e,`StarrySpartito-${Date.now()}.zip`);C(i,i.name,i.type)},children:a.formatMessage({id:"admin.batchDownload.spartito"})},"2")]})]})}),s.jsx(I.Footer,{style:{textAlign:"center"},children:a.formatMessage({id:"common.footer"})})]})}function Q(a){return Object.entries(a).reduce((l,[d,n])=>{var y,o;return(d==="tagIdList"&&((o=(y=n==null?void 0:n.filter)==null?void 0:y.call(n,m=>/^\d+$/.test(String(n))))==null?void 0:o.length)>0||n)&&(l[d]=n),l},{})}export{We as default};
|
dist/assets/{index-02a9660a.js → index-d19b5eaf.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as d,j as e,a as _}from"./umi-2cc549ef.js";import{T as G,p as q,S as H,a as J,r as U,m as R,L as X,s as K}from"./index-d6bbb942.js";import{S as Q}from"./scheduler-a7fa9c3c.js";import{p as Z}from"./processCompressedAESFile-405b7aba.js";import{S as ee}from"./index-209da080.js";import{c as C,t as se,u as V}from"./_setToString-4a3d3b61.js";import{u as te}from"./useIntersection-d83075c4.js";import{u as ne}from"./useAsync-a87a60de.js";class re{timer;tasks={};handlers={};constructor(o=Date){this.timer=o}clear(){Object.values(this.handlers).forEach(o=>clearTimeout(o)),this.tasks={},this.handlers={}}getTask(o){const i=Math.max(o-this.timer.now(),0);return this.tasks[o]||(this.tasks[o]=new Promise(c=>{this.handlers[o]=setTimeout(c,i)}).then(()=>{delete this.tasks[o],delete this.handlers[o]})),this.tasks[o]}appendTask(o,i){this.tasks[o]=this.getTask(o).then(i)}}const ce=({translateX:l=0,translateY:o,width:i,additionalLines:c,...f})=>e.jsxs("g",{...f,className:"staff-lines",transform:`translate(${l}, ${o})`,children:[new Array(5).fill(null).map((s,r)=>e.jsx("line",{x1:0,x2:i,y1:r-2,y2:r-2},r)),c&&c.map((s,r)=>e.jsx("g",{children:Array(Math.abs(s.n)).fill(null).map((x,n)=>e.jsx("line",{x1:s.left,x2:s.right,y1:s.n>0?3+n:-3-n,y2:s.n>0?3+n:-3-n},n))},r))]}),ie=d.memo(ce),D=({score:l,page:o,pageIndex:i,system:c,systemIndex:f,staff:s,staffIndex:r,showSource:x})=>{var a;const n=l.pages.reduce((j,g,p)=>p<i?j+g.systems.reduce((m,k,T)=>{var M,$;return m+((($=(M=k.staves[0])==null?void 0:M.measures)==null?void 0:$.length)||0)},0):p===i?j+g.systems.reduce((m,k,T)=>{var M,$;return T<f?m+((($=(M=k.staves[0])==null?void 0:M.measures)==null?void 0:$.length)||0):m},0):j,0);return e.jsx(e.Fragment,{children:e.jsxs("g",{className:C("staff",{moving:!1}),transform:`translate(0, ${s.top})`,children:[e.jsxs("g",{children:[x?null:e.jsx(ie,{translateY:s.staffY,width:c.width,additionalLines:s.additionalLines}),(a=s==null?void 0:s.measures)==null?void 0:a.map((j,g)=>{var p;return e.jsxs("g",{children:[!x&&r===0&&g===0&&e.jsx("text",{x:j.left,y:Math.min(5,s.staffY-3),fontSize:g===0?1.4:.9,fill:"#e65019",children:n+g+1}),e.jsx("g",{transform:`translate(0, ${s.staffY})`,children:e.jsx("g",{className:"tokens",children:(p=j==null?void 0:j.tokens)==null?void 0:p.filter(m=>G.includes(m.type)).map((m,k)=>e.jsx("g",{className:C("token",{}),style:x?{color:"transparent"}:{},transform:`translate(${m.x}, ${m.y})`,id:m.id,onClick:()=>console.log(m),children:e.jsx("use",{xlinkHref:`#score-token-def-${m.typeId}`})},k))})})]},g)})]}),x?null:e.jsx("g",{className:"measure-bars",children:c.measureBars.map((j,g)=>e.jsx("g",{className:C("measure-bar"),transform:`translate(${j}, ${s.staffY-2})`,children:e.jsx("line",{x1:0,x2:0,y1:0,y2:4})},g))})]})})};d.memo(D);const oe=({layout:l,positions:o,nameDict:i={},...c})=>{const f=d.useMemo(()=>l.groups.map(s=>{const r=o[s.range[0]],x=o[s.range[1]];return{key:s.key,type:s.group.type,level:s.group.level||0,top:r.y-r.radius,bottom:x.y+x.radius,name:i[s.key]}}),[l,o,i]);return e.jsx("g",{...c,className:"staff-brackets",onClick:()=>{},children:f.map(s=>e.jsxs("g",{className:"group",transform:`translate(${s.level*-1.2}, 0)`,children:[s.type===2&&e.jsxs("g",{className:"bracket",children:[e.jsx("rect",{x:"-1.2",y:s.top,width:"0.45",height:s.bottom-s.top}),e.jsx("g",{transform:`translate(-1.2, ${s.top-.21})`,children:e.jsx("path",{transform:"scale(0.0040, -0.0040)",d:"M0 -56v91c0 12 10 21 22 21h43c164 0 281 136 377 272c10 14 32 -1 22 -15c-103 -145 -222 -369 -399 -369h-65z"})}),e.jsx("g",{transform:`translate(-1.2, ${s.bottom+.21})`,children:e.jsx("path",{transform:"scale(0.0040, -0.0040)",d:"M0 56h65c177 0 296 -224 399 -369c10 -14 -12 -29 -22 -15c-96 136 -213 272 -377 272h-43c-12 0 -22 9 -22 21v91z"})})]}),s.type===3&&e.jsxs("g",{className:"square",children:[e.jsx("line",{x1:"-0.9",x2:"-0.9",y1:s.top,y2:s.bottom,strokeWidth:"0.1"}),e.jsx("line",{x1:"-0.9",x2:"0",y1:s.top,y2:s.top,strokeWidth:"0.1"}),e.jsx("line",{x1:"-0.9",x2:"0",y1:s.bottom,y2:s.bottom,strokeWidth:"0.1"})]}),s.type===1&&e.jsx("g",{className:"brace",transform:`translate(-0.2, ${(s.top+s.bottom)/2})`,children:e.jsx("path",{transform:`scale(0.0040, ${-.004*(s.bottom-s.top)/15.1825})`,d:"M-208 -1336c0 312 124 616 124 912c0 156 -36 300 -144 416c0 4 -4 4 -4 8s4 4 4 8c108 116 144 260 144 416c0 296 -124 600 -124 912c0 212 52 420 196 576c16 16 40 -8 24 -24c-108 -120 -144 -264 -144 -420c0 -292 116 -588 116 -896c0 -212 -48 -416 -188 -572c140 -156 188 -360 188 -572c0 -308 -116 -604 -116 -896c0 -156 36 -300 144 -420c16 -16 -8 -40 -24 -24c-144 156 -196 364 -196 576z"})}),s.name&&e.jsx("g",{className:"name",transform:`translate(-2, ${(s.top+s.bottom)/2+1})`,children:e.jsx("text",{fontSize:2,children:s.name})})]},s.key))})},le=l=>{var x,n;const{score:o,pageIndex:i,system:c,systemIndex:f,showSource:s}=l;if(c.staves.length===0)return e.jsx("g",{},f);const r=q(o.staffLayoutCode);return e.jsxs("g",{className:C("system",{}),transform:`translate(${c.left}, ${c.top})`,children:[!s&&c.backgroundImage&&!((x=c.staves[0])!=null&&x.backgroundImage)&&!((n=c.staves[0])!=null&&n.maskImage)&&e.jsx("image",{className:"background",href:c.backgroundImage,...c.imagePosition||{}}),!s&&c.staves.length>=2&&e.jsx("line",{className:"connection",x1:0,x2:0,y1:c.connectionLine.top,y2:c.connectionLine.bottom}),!s&&c.staves.map((a,j)=>e.jsxs("g",{className:C("staff"),transform:`translate(0, ${a.top})`,children:[!s&&!a.maskImage&&a.backgroundImage&&e.jsx("image",{className:"background",href:a.backgroundImage,...a.imagePosition||{}}),!s&&a.maskImage&&e.jsx("image",{className:"background",href:a.maskImage,...a.imagePosition||{}})]},"staff-"+j)),c.staves.map((a,j)=>e.jsx(D,{...l,staff:a,staffIndex:j,showSource:s},j)),s?null:e.jsx("g",{className:"measure-bars",children:c.measureBars.map((a,j)=>e.jsx("g",{transform:`translate(${a}, 0)`,children:r.mask(c.staffMask).conjunctions.map((g,p)=>{const m=c.staves[p],k=c.staves[p+1];if(m&&k)return e.jsx("g",{transform:`translate(0, ${m.top+m.staffY+2})`,children:e.jsx("line",{className:C("staff-layout-measure-bar",{dashed:g===1,blank:g===0}),x1:"0",x2:"0",y1:0,y2:k.top+k.staffY-(m.top+m.staffY)-4})},p)})},j))}),s?null:e.jsx(oe,{layout:r.mask(c.staffMask),positions:c.staffPositions,nameDict:!c.prev||c.staffMask!==c.prev.staffMask?o.instrumentDict:{}})]},f)},ae=d.memo(le);const de=()=>e.jsxs("defs",{className:"score-token-defs",children:[e.jsx("g",{id:"score-token-def-clefs-G",className:"token",children:e.jsx("text",{x:"-1.3",children:""})}),e.jsx("g",{id:"score-token-def-clefs-F",className:"token",children:e.jsx("text",{x:"-1.06",children:""})}),e.jsx("g",{id:"score-token-def-clefs-C",className:"token",children:e.jsx("text",{x:"-1.06",children:""})}),e.jsx("g",{id:"score-token-def-timesig-C44",className:"token",children:e.jsx("text",{x:"-0.9",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-timesig-C22",className:"token",children:e.jsx("text",{x:"-0.9",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-timesig0",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"0"})}),e.jsx("g",{id:"score-token-def-timesig1",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"1"})}),e.jsx("g",{id:"score-token-def-timesig2",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"2"})}),e.jsx("g",{id:"score-token-def-timesig3",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"3"})}),e.jsx("g",{id:"score-token-def-timesig4",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"4"})}),e.jsx("g",{id:"score-token-def-timesig5",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"5"})}),e.jsx("g",{id:"score-token-def-timesig6",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"6"})}),e.jsx("g",{id:"score-token-def-timesig7",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"7"})}),e.jsx("g",{id:"score-token-def-timesig8",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"8"})}),e.jsx("g",{id:"score-token-def-timesig9",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"9"})}),e.jsx("g",{id:"score-token-def-octave-a",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"𝄶---"})}),e.jsx("g",{id:"score-token-def-octave-b",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"𝄷---"})}),e.jsx("g",{id:"score-token-def-octave-0",className:"token",children:e.jsx("text",{x:"-0.7",y:"0.6",className:"plain",children:"┐"})}),e.jsx("g",{id:"score-token-def-octave-8",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"8-----"})}),e.jsx("g",{id:"score-token-def-n0",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"0"})})}),e.jsx("g",{id:"score-token-def-n1",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"1"})})}),e.jsx("g",{id:"score-token-def-n2",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"2"})})}),e.jsx("g",{id:"score-token-def-n3",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"3"})})}),e.jsx("g",{id:"score-token-def-n4",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"4"})})}),e.jsx("g",{id:"score-token-def-n5",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"5"})})}),e.jsx("g",{id:"score-token-def-n6",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"6"})})}),e.jsx("g",{id:"score-token-def-n7",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"7"})})}),e.jsx("g",{id:"score-token-def-n8",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"8"})})}),e.jsx("g",{id:"score-token-def-n9",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"9"})})}),e.jsx("g",{id:"score-token-def-accidentals-sharp",className:"token",children:e.jsx("text",{x:"-0.55",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-doublesharp",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-natural",className:"token",children:e.jsx("text",{x:"-0.3",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-flat",className:"token",children:e.jsx("text",{x:"-0.3",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-flatflat",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsxs("g",{id:"score-token-def-key-sharp",className:"token",children:[e.jsx("text",{x:"-0.55",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsxs("g",{id:"score-token-def-key-natural",className:"token",children:[e.jsx("text",{x:"-0.3",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsxs("g",{id:"score-token-def-key-flat",className:"token",children:[e.jsx("text",{x:"-0.3",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsx("g",{id:"score-token-def-noteheads-s0",className:"token",children:e.jsx("text",{x:"-0.913",children:""})}),e.jsx("g",{id:"score-token-def-noteheads-s1",className:"token",children:e.jsx("text",{x:"-0.632",children:""})}),e.jsx("g",{id:"score-token-def-noteheads-s2",className:"token",children:e.jsx("text",{x:"-0.599",children:""})}),e.jsxs("g",{id:"score-token-def-noteheads-s1-u",className:"token",children:[e.jsx("text",{x:"-1.264",children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"-0.06",y2:"-3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s2-u",className:"token",children:[e.jsx("text",{x:"-1.198",children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"-0.06",y2:"-3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s1-d",className:"token",children:[e.jsx("text",{children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"0.16",y2:"3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s2-d",className:"token",children:[e.jsx("text",{children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"0.16",y2:"3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsx("g",{id:"score-token-def-rests-M1",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-0",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-0o",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-1o",className:"token",children:e.jsx("text",{x:"-0.75",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-rests-2",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-3",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-4",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-5",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-6",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-flags-u3",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u4",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u5",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u6",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u7",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u8",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-slur-begin",className:"token",children:e.jsx("path",{d:"M0 0C0.5 -0.5 1 -0.6 1.5 -0.6L1.5 -0.4C1 -0.4 0.5 -0.4 0 0z"})}),e.jsx("g",{id:"score-token-def-slur-end",className:"token",children:e.jsx("path",{d:"M0 0C-0.5 -0.5 -1 -0.6 -1.5 -0.6L-1.5 -0.4C-1 -0.4 -0.5 -0.4 0 0z"})}),e.jsxs("g",{id:"score-token-def-volta-left",className:"token",children:[e.jsx("text",{x:"-0.25",y:"-0.5",children:""}),e.jsx("text",{x:"-0.25",y:"0.5",children:""}),e.jsx("line",{x1:"-0.5",x2:"-0.5",y1:"-2",y2:"2"})]}),e.jsxs("g",{id:"score-token-def-volta-right",className:"token",children:[e.jsx("text",{x:"-0.25",y:"-0.5",children:""}),e.jsx("text",{x:"-0.25",y:"0.5",children:""}),e.jsx("line",{x1:"0.5",x2:"0.5",y1:"-2",y2:"2"})]}),e.jsxs("g",{id:"score-token-def-bar-terminal",className:"token",children:[e.jsx("rect",{x:"-0.064",y:"-2",width:"0.128",height:"4"}),e.jsx("rect",{x:"0.27",y:"-2",width:"0.4",height:"4"})]}),e.jsxs("g",{id:"score-token-def-bar-segment",className:"token",children:[e.jsx("rect",{x:"-0.359",y:"-2",width:"0.128",height:"4"}),e.jsx("rect",{x:"0.231",y:"-2",width:"0.128",height:"4"})]}),e.jsx("g",{id:"score-token-def-dot",className:"token",children:e.jsx("text",{children:""})}),e.jsxs("g",{id:"score-token-def-dotdot",className:"token",children:[e.jsx("text",{children:""}),e.jsx("text",{x:"0.8",children:""})]}),e.jsx("g",{id:"score-token-def-f",className:"token",children:e.jsx("text",{x:"-0.6",y:"0.5",children:"f"})}),e.jsx("g",{id:"score-token-def-m",className:"token",children:e.jsx("text",{x:"-0.9",y:"0.5",children:"m"})}),e.jsx("g",{id:"score-token-def-n",className:"token",children:e.jsx("text",{x:"-0.9",y:"0.5",children:"n"})}),e.jsx("g",{id:"score-token-def-p",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"p"})}),e.jsx("g",{id:"score-token-def-r",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"r"})}),e.jsx("g",{id:"score-token-def-s",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"s"})}),e.jsx("g",{id:"score-token-def-z",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"z"})}),e.jsx("g",{id:"score-token-def-scripts-ufermata",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-ushortfermata",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-sforzato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-staccato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-ustaccatissimo",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-turn",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-trill",className:"token",children:e.jsx("text",{y:"0.5",children:""})}),e.jsx("g",{id:"score-token-def-scripts-segno",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-coda",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-arpeggio",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:""})}),e.jsx("g",{id:"score-token-def-scripts-prall",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-mordent",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-umarcato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-tenuto",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-uportato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-pedal-star",className:"token",children:e.jsx("text",{x:"-0.78",y:"0.78",children:""})}),e.jsx("g",{id:"score-token-def-pedal-Ped",className:"token",children:e.jsx("text",{x:"-1.6",y:"0.7",children:""})}),e.jsx("g",{id:"score-token-def-BOS",className:"token",children:e.jsx("text",{x:"-3",y:"1.04",children:"▶"})}),e.jsx("g",{id:"score-token-def-BeamLeft",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"├"})}),e.jsx("g",{id:"score-token-def-BeamContinue",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"┼"})}),e.jsx("g",{id:"score-token-def-BeamRight",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"┤"})}),e.jsx("g",{id:"score-token-def-GraceNotehead",className:"token",children:e.jsx("text",{x:"-0.36",className:"s-grace",children:""})})]}),xe=d.memo(de),he=({score:l,pageIndex:o,cursorPosition:i,onSeekPosition:c,getPage:f,showSource:s})=>{var B,y,N;const r=d.useRef(null),x=te(r,{root:null,rootMargin:"100px",threshold:.1}),n=l.pages[o],a=d.useRef(null),[j]=d.useState(!1),[g,p]=d.useState(0),m=d.useMemo(()=>{let t=0;if(i){let u=0;for(const[v,b]of l.pages.entries()){if(i.system>=u-1&&i.system<u+b.systems.length){t=+v,t!=g&&p(t);break}u+=b.systems.length}}return t},[i==null?void 0:i.system]);d.useEffect(()=>{a.current&&a.current.scrollIntoView({block:"center",behavior:"smooth"})},[a.current,m]),d.useEffect(()=>{f&&f(g)},[g]);const k=n.source.dimensions.width/n.source.interval,T=n.source.dimensions.height/n.source.interval,M=n.width,$=n.height,[z,A,W,E,O,Y]=n.source.matrix,F=[z,A,W,E,-1/2*z*k+-1/2*W*T+1/2*M+O,-1/2*A*k+-1/2*E*T+1/2*$+Y];return n.systems.length>0?e.jsx("div",{ref:r,children:x!=null&&x.isIntersecting?e.jsxs("svg",{className:C("graph",{}),style:{objectFit:"contain"},viewBox:`0 0 ${n.width} ${n.height}`,children:[e.jsx(xe,{}),s?e.jsx("image",{x:0,y:0,width:k,height:T,href:se(n.source.url,{width:414}),transform:`matrix(${F.join(",")})`}):null,!s||s&&!l.pages.some(t=>t.source.needGauge)?(B=n==null?void 0:n.systems)==null?void 0:B.map((t,u)=>e.jsx(ae,{score:l,page:n,pageIndex:o,system:t,systemIndex:u,showSource:s},u)):null,j&&(n==null?void 0:n.semantics)&&e.jsx("g",{children:(y=n==null?void 0:n.semantics)==null?void 0:y.map((t,u)=>{var v,b,h,w,S;if(t.semantic===H.rect_Text)return e.jsx("g",{transform:`translate(${t.x}, ${t.y}) ${(v=t.extension)!=null&&v.theta?`rotate(${((b=t.extension)==null?void 0:b.theta)*180/Math.PI})`:""}`,color:"rgba(25, 175, 230, 0.6)",children:e.jsxs("text",{dominantBaseline:"hanging",x:0,y:-t.extension.height/2,textAnchor:"middle",style:{fontSize:(h=t.extension)==null?void 0:h.height},children:[(w=t.extension)==null?void 0:w.text,e.jsx("title",{children:((S=t.extension)==null?void 0:S.type)||t.semantic})]})},u)})}),!s&&(n==null?void 0:n.tokens)&&e.jsx("g",{children:(N=n==null?void 0:n.tokens)==null?void 0:N.map((t,u)=>{if(t.type===J.Text)return e.jsx("g",{transform:`translate(${t.x}, ${t.y})`,color:"rgba(25, 175, 230, 0.6)",className:"token",children:e.jsxs("text",{dominantBaseline:"hanging",x:0,y:-t.fontSize/2,textAnchor:"middle",style:{fontSize:t.fontSize},className:C(t.textType),children:[t.text,e.jsx("title",{children:t.textType})]})},u)})}),n.systems.map((t,u)=>{const v=l.pages.slice(0,o).reduce((b,h)=>b+h.systems.length,0)+u;return e.jsxs("g",{className:C("system"),transform:`translate(${t.left}, ${t.top})`,children:[e.jsx("rect",{style:{opacity:0},x:0,y:t.noteRange.top,width:t.width,height:t.noteRange.bottom-t.noteRange.top,onClick:b=>{const h=b.target,w=h.getBoundingClientRect(),S=b.clientX-w.left,L=h.getBBox(),I=S/w.width*L.width;c({system:v,x:I})}}),(i==null?void 0:i.system)===v?e.jsx("line",{ref:a,transform:`translate(${i.x}, 0)`,x1:0,x2:0,y1:t.noteRange.top,y2:t.noteRange.bottom,style:{stroke:"rgb(173 216 230 / 80%)",strokeWidth:1}}):null]},u)})]}):e.jsx("svg",{className:"graph",style:{objectFit:"contain"},viewBox:`0 0 ${n.width} ${n.height}`})}):e.jsx("img",{src:n.source.url,alt:n.source.name,style:{width:"100%"}})},me=d.memo(he),je=({score:l,bpmValue:o})=>{var F,B;const i=V(),c=d.useRef(new re(performance)),[f,s]=d.useState(null),r=d.useRef(null),x=d.useRef(null),[n,a]=d.useState(!1),[j,g]=d.useState(!1),[p,m]=d.useState(o||((F=l==null?void 0:l.spartito)==null?void 0:F.headBPM)),[k,T]=d.useState(!1),[M,$]=d.useState(1),[z,A]=d.useState(!0);d.useEffect(()=>{Number.isFinite(o)&&m(o)},[o]),d.useEffect(()=>(R.MidiAudio.WebAudio.empty()?R.MidiAudio.loadPlugin({soundfontUrl:"/soundfont/",api:"webaudio"}).then(()=>{g(!0),console.debug("Soundfont loaded.")}):g(!0),()=>{r.current&&r.current.dispose()}),[]);const W=d.useCallback(async y=>{(!r.current||!x.current)&&O();const N=r.current.isPlaying;N&&(r.current.pause(),await new Promise(t=>setTimeout(t,0)),document.querySelectorAll(".notePlayOn").forEach(t=>t.classList.remove("notePlayOn"))),r.current.progressTicks=x.current.lookupTick(y),N&&E()},[x.current]),E=()=>{var y,N;!((y=l.systems)!=null&&y.length)||!((N=l.spartito)!=null&&N.regulated)||!j||((!r.current||k)&&(T(!1),O()),r.current?r.current.isPlaying?(r.current.pause(),a(!1)):(r.current.play({nextFrame:()=>(r.current&&x.current&&s(x.current.lookupPosition(r.current.progressTicks)),new Promise(t=>requestAnimationFrame(()=>t())))}),a(!0)):console.log("暂时无法播放"))},O=()=>{const{notation:y,tokenMap:N}=l.spartito.perform(),t=l.getMeasureLayout(),u=t?t.serialize(X.Full):Array(y.measures.length).fill(null).map((h,w)=>w+1),v=y.toPerformingNotationWithEvents(u);v.scaleTempo({headTempo:6e7/p}),x.current=Q.createFromNotation(v,N);const b=r.current?r.current.progressTicks:0;r.current&&r.current.dispose(),r.current=new R.MidiPlayer(v,{cacheSpan:200,onMidi:(h,w)=>{let S=null;switch(h.subtype){case"noteOn":h.channel!=null&&h.noteNumber!=null&&h.velocity!=null&&R.MidiAudio.noteOn(h.channel,h.noteNumber,h.velocity,w),S=()=>{var L;return(L=h==null?void 0:h.ids)==null?void 0:L.map(I=>{const P=document.getElementById(I);P&&P.classList.add("notePlayOn")})};break;case"noteOff":h.channel!=null&&h.noteNumber!=null&&R.MidiAudio.noteOff(h.channel,h.noteNumber,w),S=()=>{var L;return(L=h==null?void 0:h.ids)==null?void 0:L.map(I=>{const P=document.getElementById(I);P&&P.classList.remove("notePlayOn")})};break}S&&c.current.appendTask(w,S)},onPlayFinish(){r.current&&(r.current.progressTicks=0),a(!1)},onTurnCursor(){r.current&&x.current&&s(x.current.lookupPosition(r.current.progressTicks))}}),r.current.progressTicks=b},Y=y=>{$(y+1)};return e.jsx("div",{className:"viewer-page",children:e.jsx("div",{style:{overflowY:"hidden"},children:e.jsxs("div",{className:"score-viewer",children:[(B=l==null?void 0:l.pages)==null?void 0:B.map((y,N)=>e.jsx("div",{className:"viewer-page-container",children:e.jsx(me,{score:l,pageIndex:N,cursorPosition:f,onSeekPosition:W,getPage:t=>Y(t),showSource:!z},N)},N)),e.jsx("div",{className:"checkOriginImg fz26 fw4 fc33",onClick:y=>{r.current&&r.current.pause(),a(!1)},children:i.formatMessage({id:"editor.viewOriginal"})})]})})})},ve=l=>{var r,x;const o=V(),i=_(),[c,f]=d.useState((i==null?void 0:i.id)||((x=(r=l==null?void 0:l.match)==null?void 0:r.params)==null?void 0:x.id));d.useEffect(()=>{i!=null&&i.id&&f(i.id)},[i==null?void 0:i.id]);const s=ne(async()=>{const n=JSON.parse(decodeURIComponent(c)),a=U(await Z(n.url),K);return a.assemble(1),a},[]);return s.loading?e.jsx(ee,{style:{width:"100vw",height:"100vh"},children:o.formatMessage({id:"common.loading"})}):e.jsx(je,{score:s.value})};export{ve as default};
|
|
|
|
| 1 |
+
import{r as d,j as e,a as _}from"./umi-a044fd32.js";import{T as G,p as q,S as H,a as J,r as U,m as R,L as X,s as K}from"./index-7c2856f0.js";import{S as Q}from"./scheduler-a7fa9c3c.js";import{p as Z}from"./processCompressedAESFile-fac57b0a.js";import{S as ee}from"./index-7584011d.js";import{c as C,t as se,u as V}from"./_setToString-1e1135c3.js";import{u as te}from"./useIntersection-970b9f71.js";import{u as ne}from"./useAsync-0af7a050.js";class re{timer;tasks={};handlers={};constructor(o=Date){this.timer=o}clear(){Object.values(this.handlers).forEach(o=>clearTimeout(o)),this.tasks={},this.handlers={}}getTask(o){const i=Math.max(o-this.timer.now(),0);return this.tasks[o]||(this.tasks[o]=new Promise(c=>{this.handlers[o]=setTimeout(c,i)}).then(()=>{delete this.tasks[o],delete this.handlers[o]})),this.tasks[o]}appendTask(o,i){this.tasks[o]=this.getTask(o).then(i)}}const ce=({translateX:l=0,translateY:o,width:i,additionalLines:c,...f})=>e.jsxs("g",{...f,className:"staff-lines",transform:`translate(${l}, ${o})`,children:[new Array(5).fill(null).map((s,r)=>e.jsx("line",{x1:0,x2:i,y1:r-2,y2:r-2},r)),c&&c.map((s,r)=>e.jsx("g",{children:Array(Math.abs(s.n)).fill(null).map((x,n)=>e.jsx("line",{x1:s.left,x2:s.right,y1:s.n>0?3+n:-3-n,y2:s.n>0?3+n:-3-n},n))},r))]}),ie=d.memo(ce),D=({score:l,page:o,pageIndex:i,system:c,systemIndex:f,staff:s,staffIndex:r,showSource:x})=>{var a;const n=l.pages.reduce((j,g,p)=>p<i?j+g.systems.reduce((m,k,T)=>{var M,$;return m+((($=(M=k.staves[0])==null?void 0:M.measures)==null?void 0:$.length)||0)},0):p===i?j+g.systems.reduce((m,k,T)=>{var M,$;return T<f?m+((($=(M=k.staves[0])==null?void 0:M.measures)==null?void 0:$.length)||0):m},0):j,0);return e.jsx(e.Fragment,{children:e.jsxs("g",{className:C("staff",{moving:!1}),transform:`translate(0, ${s.top})`,children:[e.jsxs("g",{children:[x?null:e.jsx(ie,{translateY:s.staffY,width:c.width,additionalLines:s.additionalLines}),(a=s==null?void 0:s.measures)==null?void 0:a.map((j,g)=>{var p;return e.jsxs("g",{children:[!x&&r===0&&g===0&&e.jsx("text",{x:j.left,y:Math.min(5,s.staffY-3),fontSize:g===0?1.4:.9,fill:"#e65019",children:n+g+1}),e.jsx("g",{transform:`translate(0, ${s.staffY})`,children:e.jsx("g",{className:"tokens",children:(p=j==null?void 0:j.tokens)==null?void 0:p.filter(m=>G.includes(m.type)).map((m,k)=>e.jsx("g",{className:C("token",{}),style:x?{color:"transparent"}:{},transform:`translate(${m.x}, ${m.y})`,id:m.id,onClick:()=>console.log(m),children:e.jsx("use",{xlinkHref:`#score-token-def-${m.typeId}`})},k))})})]},g)})]}),x?null:e.jsx("g",{className:"measure-bars",children:c.measureBars.map((j,g)=>e.jsx("g",{className:C("measure-bar"),transform:`translate(${j}, ${s.staffY-2})`,children:e.jsx("line",{x1:0,x2:0,y1:0,y2:4})},g))})]})})};d.memo(D);const oe=({layout:l,positions:o,nameDict:i={},...c})=>{const f=d.useMemo(()=>l.groups.map(s=>{const r=o[s.range[0]],x=o[s.range[1]];return{key:s.key,type:s.group.type,level:s.group.level||0,top:r.y-r.radius,bottom:x.y+x.radius,name:i[s.key]}}),[l,o,i]);return e.jsx("g",{...c,className:"staff-brackets",onClick:()=>{},children:f.map(s=>e.jsxs("g",{className:"group",transform:`translate(${s.level*-1.2}, 0)`,children:[s.type===2&&e.jsxs("g",{className:"bracket",children:[e.jsx("rect",{x:"-1.2",y:s.top,width:"0.45",height:s.bottom-s.top}),e.jsx("g",{transform:`translate(-1.2, ${s.top-.21})`,children:e.jsx("path",{transform:"scale(0.0040, -0.0040)",d:"M0 -56v91c0 12 10 21 22 21h43c164 0 281 136 377 272c10 14 32 -1 22 -15c-103 -145 -222 -369 -399 -369h-65z"})}),e.jsx("g",{transform:`translate(-1.2, ${s.bottom+.21})`,children:e.jsx("path",{transform:"scale(0.0040, -0.0040)",d:"M0 56h65c177 0 296 -224 399 -369c10 -14 -12 -29 -22 -15c-96 136 -213 272 -377 272h-43c-12 0 -22 9 -22 21v91z"})})]}),s.type===3&&e.jsxs("g",{className:"square",children:[e.jsx("line",{x1:"-0.9",x2:"-0.9",y1:s.top,y2:s.bottom,strokeWidth:"0.1"}),e.jsx("line",{x1:"-0.9",x2:"0",y1:s.top,y2:s.top,strokeWidth:"0.1"}),e.jsx("line",{x1:"-0.9",x2:"0",y1:s.bottom,y2:s.bottom,strokeWidth:"0.1"})]}),s.type===1&&e.jsx("g",{className:"brace",transform:`translate(-0.2, ${(s.top+s.bottom)/2})`,children:e.jsx("path",{transform:`scale(0.0040, ${-.004*(s.bottom-s.top)/15.1825})`,d:"M-208 -1336c0 312 124 616 124 912c0 156 -36 300 -144 416c0 4 -4 4 -4 8s4 4 4 8c108 116 144 260 144 416c0 296 -124 600 -124 912c0 212 52 420 196 576c16 16 40 -8 24 -24c-108 -120 -144 -264 -144 -420c0 -292 116 -588 116 -896c0 -212 -48 -416 -188 -572c140 -156 188 -360 188 -572c0 -308 -116 -604 -116 -896c0 -156 36 -300 144 -420c16 -16 -8 -40 -24 -24c-144 156 -196 364 -196 576z"})}),s.name&&e.jsx("g",{className:"name",transform:`translate(-2, ${(s.top+s.bottom)/2+1})`,children:e.jsx("text",{fontSize:2,children:s.name})})]},s.key))})},le=l=>{var x,n;const{score:o,pageIndex:i,system:c,systemIndex:f,showSource:s}=l;if(c.staves.length===0)return e.jsx("g",{},f);const r=q(o.staffLayoutCode);return e.jsxs("g",{className:C("system",{}),transform:`translate(${c.left}, ${c.top})`,children:[!s&&c.backgroundImage&&!((x=c.staves[0])!=null&&x.backgroundImage)&&!((n=c.staves[0])!=null&&n.maskImage)&&e.jsx("image",{className:"background",href:c.backgroundImage,...c.imagePosition||{}}),!s&&c.staves.length>=2&&e.jsx("line",{className:"connection",x1:0,x2:0,y1:c.connectionLine.top,y2:c.connectionLine.bottom}),!s&&c.staves.map((a,j)=>e.jsxs("g",{className:C("staff"),transform:`translate(0, ${a.top})`,children:[!s&&!a.maskImage&&a.backgroundImage&&e.jsx("image",{className:"background",href:a.backgroundImage,...a.imagePosition||{}}),!s&&a.maskImage&&e.jsx("image",{className:"background",href:a.maskImage,...a.imagePosition||{}})]},"staff-"+j)),c.staves.map((a,j)=>e.jsx(D,{...l,staff:a,staffIndex:j,showSource:s},j)),s?null:e.jsx("g",{className:"measure-bars",children:c.measureBars.map((a,j)=>e.jsx("g",{transform:`translate(${a}, 0)`,children:r.mask(c.staffMask).conjunctions.map((g,p)=>{const m=c.staves[p],k=c.staves[p+1];if(m&&k)return e.jsx("g",{transform:`translate(0, ${m.top+m.staffY+2})`,children:e.jsx("line",{className:C("staff-layout-measure-bar",{dashed:g===1,blank:g===0}),x1:"0",x2:"0",y1:0,y2:k.top+k.staffY-(m.top+m.staffY)-4})},p)})},j))}),s?null:e.jsx(oe,{layout:r.mask(c.staffMask),positions:c.staffPositions,nameDict:!c.prev||c.staffMask!==c.prev.staffMask?o.instrumentDict:{}})]},f)},ae=d.memo(le);const de=()=>e.jsxs("defs",{className:"score-token-defs",children:[e.jsx("g",{id:"score-token-def-clefs-G",className:"token",children:e.jsx("text",{x:"-1.3",children:""})}),e.jsx("g",{id:"score-token-def-clefs-F",className:"token",children:e.jsx("text",{x:"-1.06",children:""})}),e.jsx("g",{id:"score-token-def-clefs-C",className:"token",children:e.jsx("text",{x:"-1.06",children:""})}),e.jsx("g",{id:"score-token-def-timesig-C44",className:"token",children:e.jsx("text",{x:"-0.9",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-timesig-C22",className:"token",children:e.jsx("text",{x:"-0.9",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-timesig0",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"0"})}),e.jsx("g",{id:"score-token-def-timesig1",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"1"})}),e.jsx("g",{id:"score-token-def-timesig2",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"2"})}),e.jsx("g",{id:"score-token-def-timesig3",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"3"})}),e.jsx("g",{id:"score-token-def-timesig4",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"4"})}),e.jsx("g",{id:"score-token-def-timesig5",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"5"})}),e.jsx("g",{id:"score-token-def-timesig6",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"6"})}),e.jsx("g",{id:"score-token-def-timesig7",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"7"})}),e.jsx("g",{id:"score-token-def-timesig8",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"8"})}),e.jsx("g",{id:"score-token-def-timesig9",className:"token",children:e.jsx("text",{x:"-0.7",y:"1",children:"9"})}),e.jsx("g",{id:"score-token-def-octave-a",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"𝄶---"})}),e.jsx("g",{id:"score-token-def-octave-b",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"𝄷---"})}),e.jsx("g",{id:"score-token-def-octave-0",className:"token",children:e.jsx("text",{x:"-0.7",y:"0.6",className:"plain",children:"┐"})}),e.jsx("g",{id:"score-token-def-octave-8",className:"token",children:e.jsx("text",{y:"0.5",className:"plain",children:"8-----"})}),e.jsx("g",{id:"score-token-def-n0",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"0"})})}),e.jsx("g",{id:"score-token-def-n1",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"1"})})}),e.jsx("g",{id:"score-token-def-n2",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"2"})})}),e.jsx("g",{id:"score-token-def-n3",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"3"})})}),e.jsx("g",{id:"score-token-def-n4",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"4"})})}),e.jsx("g",{id:"score-token-def-n5",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"5"})})}),e.jsx("g",{id:"score-token-def-n6",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"6"})})}),e.jsx("g",{id:"score-token-def-n7",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"7"})})}),e.jsx("g",{id:"score-token-def-n8",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"8"})})}),e.jsx("g",{id:"score-token-def-n9",className:"token",children:e.jsx("g",{className:"number",children:e.jsx("text",{x:"-0.35",y:"0.5",children:"9"})})}),e.jsx("g",{id:"score-token-def-accidentals-sharp",className:"token",children:e.jsx("text",{x:"-0.55",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-doublesharp",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-natural",className:"token",children:e.jsx("text",{x:"-0.3",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-flat",className:"token",children:e.jsx("text",{x:"-0.3",children:""})}),e.jsx("g",{id:"score-token-def-accidentals-flatflat",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsxs("g",{id:"score-token-def-key-sharp",className:"token",children:[e.jsx("text",{x:"-0.55",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsxs("g",{id:"score-token-def-key-natural",className:"token",children:[e.jsx("text",{x:"-0.3",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsxs("g",{id:"score-token-def-key-flat",className:"token",children:[e.jsx("text",{x:"-0.3",children:""}),e.jsx("line",{x1:"-1",x2:"-1",y1:"-1",y2:"1",stroke:"black",strokeWidth:"0.08"})]}),e.jsx("g",{id:"score-token-def-noteheads-s0",className:"token",children:e.jsx("text",{x:"-0.913",children:""})}),e.jsx("g",{id:"score-token-def-noteheads-s1",className:"token",children:e.jsx("text",{x:"-0.632",children:""})}),e.jsx("g",{id:"score-token-def-noteheads-s2",className:"token",children:e.jsx("text",{x:"-0.599",children:""})}),e.jsxs("g",{id:"score-token-def-noteheads-s1-u",className:"token",children:[e.jsx("text",{x:"-1.264",children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"-0.06",y2:"-3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s2-u",className:"token",children:[e.jsx("text",{x:"-1.198",children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"-0.06",y2:"-3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s1-d",className:"token",children:[e.jsx("text",{children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"0.16",y2:"3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsxs("g",{id:"score-token-def-noteheads-s2-d",className:"token",children:[e.jsx("text",{children:""}),e.jsx("line",{x1:"0",x2:"0",y1:"0.16",y2:"3.5",stroke:"currentColor",strokeWidth:"0.12",strokeLinecap:"round",className:"stem"})]}),e.jsx("g",{id:"score-token-def-rests-M1",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-0",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-0o",className:"token",children:e.jsx("text",{x:"-0.75",y:"-1",children:""})}),e.jsx("g",{id:"score-token-def-rests-1o",className:"token",children:e.jsx("text",{x:"-0.75",y:"0",children:""})}),e.jsx("g",{id:"score-token-def-rests-2",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-3",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-4",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-5",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-rests-6",className:"token",children:e.jsx("text",{x:"-0.5",children:""})}),e.jsx("g",{id:"score-token-def-flags-u3",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u4",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u5",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u6",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u7",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-flags-u8",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-slur-begin",className:"token",children:e.jsx("path",{d:"M0 0C0.5 -0.5 1 -0.6 1.5 -0.6L1.5 -0.4C1 -0.4 0.5 -0.4 0 0z"})}),e.jsx("g",{id:"score-token-def-slur-end",className:"token",children:e.jsx("path",{d:"M0 0C-0.5 -0.5 -1 -0.6 -1.5 -0.6L-1.5 -0.4C-1 -0.4 -0.5 -0.4 0 0z"})}),e.jsxs("g",{id:"score-token-def-volta-left",className:"token",children:[e.jsx("text",{x:"-0.25",y:"-0.5",children:""}),e.jsx("text",{x:"-0.25",y:"0.5",children:""}),e.jsx("line",{x1:"-0.5",x2:"-0.5",y1:"-2",y2:"2"})]}),e.jsxs("g",{id:"score-token-def-volta-right",className:"token",children:[e.jsx("text",{x:"-0.25",y:"-0.5",children:""}),e.jsx("text",{x:"-0.25",y:"0.5",children:""}),e.jsx("line",{x1:"0.5",x2:"0.5",y1:"-2",y2:"2"})]}),e.jsxs("g",{id:"score-token-def-bar-terminal",className:"token",children:[e.jsx("rect",{x:"-0.064",y:"-2",width:"0.128",height:"4"}),e.jsx("rect",{x:"0.27",y:"-2",width:"0.4",height:"4"})]}),e.jsxs("g",{id:"score-token-def-bar-segment",className:"token",children:[e.jsx("rect",{x:"-0.359",y:"-2",width:"0.128",height:"4"}),e.jsx("rect",{x:"0.231",y:"-2",width:"0.128",height:"4"})]}),e.jsx("g",{id:"score-token-def-dot",className:"token",children:e.jsx("text",{children:""})}),e.jsxs("g",{id:"score-token-def-dotdot",className:"token",children:[e.jsx("text",{children:""}),e.jsx("text",{x:"0.8",children:""})]}),e.jsx("g",{id:"score-token-def-f",className:"token",children:e.jsx("text",{x:"-0.6",y:"0.5",children:"f"})}),e.jsx("g",{id:"score-token-def-m",className:"token",children:e.jsx("text",{x:"-0.9",y:"0.5",children:"m"})}),e.jsx("g",{id:"score-token-def-n",className:"token",children:e.jsx("text",{x:"-0.9",y:"0.5",children:"n"})}),e.jsx("g",{id:"score-token-def-p",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"p"})}),e.jsx("g",{id:"score-token-def-r",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"r"})}),e.jsx("g",{id:"score-token-def-s",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"s"})}),e.jsx("g",{id:"score-token-def-z",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:"z"})}),e.jsx("g",{id:"score-token-def-scripts-ufermata",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-ushortfermata",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-sforzato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-staccato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-ustaccatissimo",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-turn",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-trill",className:"token",children:e.jsx("text",{y:"0.5",children:""})}),e.jsx("g",{id:"score-token-def-scripts-segno",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-coda",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-arpeggio",className:"token",children:e.jsx("text",{x:"-0.5",y:"0.5",children:""})}),e.jsx("g",{id:"score-token-def-scripts-prall",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-mordent",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-umarcato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-tenuto",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-scripts-uportato",className:"token",children:e.jsx("text",{children:""})}),e.jsx("g",{id:"score-token-def-pedal-star",className:"token",children:e.jsx("text",{x:"-0.78",y:"0.78",children:""})}),e.jsx("g",{id:"score-token-def-pedal-Ped",className:"token",children:e.jsx("text",{x:"-1.6",y:"0.7",children:""})}),e.jsx("g",{id:"score-token-def-BOS",className:"token",children:e.jsx("text",{x:"-3",y:"1.04",children:"▶"})}),e.jsx("g",{id:"score-token-def-BeamLeft",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"├"})}),e.jsx("g",{id:"score-token-def-BeamContinue",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"┼"})}),e.jsx("g",{id:"score-token-def-BeamRight",className:"token",children:e.jsx("text",{x:"-0.73",y:"0.66",className:"s-beam",children:"┤"})}),e.jsx("g",{id:"score-token-def-GraceNotehead",className:"token",children:e.jsx("text",{x:"-0.36",className:"s-grace",children:""})})]}),xe=d.memo(de),he=({score:l,pageIndex:o,cursorPosition:i,onSeekPosition:c,getPage:f,showSource:s})=>{var B,y,N;const r=d.useRef(null),x=te(r,{root:null,rootMargin:"100px",threshold:.1}),n=l.pages[o],a=d.useRef(null),[j]=d.useState(!1),[g,p]=d.useState(0),m=d.useMemo(()=>{let t=0;if(i){let u=0;for(const[v,b]of l.pages.entries()){if(i.system>=u-1&&i.system<u+b.systems.length){t=+v,t!=g&&p(t);break}u+=b.systems.length}}return t},[i==null?void 0:i.system]);d.useEffect(()=>{a.current&&a.current.scrollIntoView({block:"center",behavior:"smooth"})},[a.current,m]),d.useEffect(()=>{f&&f(g)},[g]);const k=n.source.dimensions.width/n.source.interval,T=n.source.dimensions.height/n.source.interval,M=n.width,$=n.height,[z,A,W,E,O,Y]=n.source.matrix,F=[z,A,W,E,-1/2*z*k+-1/2*W*T+1/2*M+O,-1/2*A*k+-1/2*E*T+1/2*$+Y];return n.systems.length>0?e.jsx("div",{ref:r,children:x!=null&&x.isIntersecting?e.jsxs("svg",{className:C("graph",{}),style:{objectFit:"contain"},viewBox:`0 0 ${n.width} ${n.height}`,children:[e.jsx(xe,{}),s?e.jsx("image",{x:0,y:0,width:k,height:T,href:se(n.source.url,{width:414}),transform:`matrix(${F.join(",")})`}):null,!s||s&&!l.pages.some(t=>t.source.needGauge)?(B=n==null?void 0:n.systems)==null?void 0:B.map((t,u)=>e.jsx(ae,{score:l,page:n,pageIndex:o,system:t,systemIndex:u,showSource:s},u)):null,j&&(n==null?void 0:n.semantics)&&e.jsx("g",{children:(y=n==null?void 0:n.semantics)==null?void 0:y.map((t,u)=>{var v,b,h,w,S;if(t.semantic===H.rect_Text)return e.jsx("g",{transform:`translate(${t.x}, ${t.y}) ${(v=t.extension)!=null&&v.theta?`rotate(${((b=t.extension)==null?void 0:b.theta)*180/Math.PI})`:""}`,color:"rgba(25, 175, 230, 0.6)",children:e.jsxs("text",{dominantBaseline:"hanging",x:0,y:-t.extension.height/2,textAnchor:"middle",style:{fontSize:(h=t.extension)==null?void 0:h.height},children:[(w=t.extension)==null?void 0:w.text,e.jsx("title",{children:((S=t.extension)==null?void 0:S.type)||t.semantic})]})},u)})}),!s&&(n==null?void 0:n.tokens)&&e.jsx("g",{children:(N=n==null?void 0:n.tokens)==null?void 0:N.map((t,u)=>{if(t.type===J.Text)return e.jsx("g",{transform:`translate(${t.x}, ${t.y})`,color:"rgba(25, 175, 230, 0.6)",className:"token",children:e.jsxs("text",{dominantBaseline:"hanging",x:0,y:-t.fontSize/2,textAnchor:"middle",style:{fontSize:t.fontSize},className:C(t.textType),children:[t.text,e.jsx("title",{children:t.textType})]})},u)})}),n.systems.map((t,u)=>{const v=l.pages.slice(0,o).reduce((b,h)=>b+h.systems.length,0)+u;return e.jsxs("g",{className:C("system"),transform:`translate(${t.left}, ${t.top})`,children:[e.jsx("rect",{style:{opacity:0},x:0,y:t.noteRange.top,width:t.width,height:t.noteRange.bottom-t.noteRange.top,onClick:b=>{const h=b.target,w=h.getBoundingClientRect(),S=b.clientX-w.left,L=h.getBBox(),I=S/w.width*L.width;c({system:v,x:I})}}),(i==null?void 0:i.system)===v?e.jsx("line",{ref:a,transform:`translate(${i.x}, 0)`,x1:0,x2:0,y1:t.noteRange.top,y2:t.noteRange.bottom,style:{stroke:"rgb(173 216 230 / 80%)",strokeWidth:1}}):null]},u)})]}):e.jsx("svg",{className:"graph",style:{objectFit:"contain"},viewBox:`0 0 ${n.width} ${n.height}`})}):e.jsx("img",{src:n.source.url,alt:n.source.name,style:{width:"100%"}})},me=d.memo(he),je=({score:l,bpmValue:o})=>{var F,B;const i=V(),c=d.useRef(new re(performance)),[f,s]=d.useState(null),r=d.useRef(null),x=d.useRef(null),[n,a]=d.useState(!1),[j,g]=d.useState(!1),[p,m]=d.useState(o||((F=l==null?void 0:l.spartito)==null?void 0:F.headBPM)),[k,T]=d.useState(!1),[M,$]=d.useState(1),[z,A]=d.useState(!0);d.useEffect(()=>{Number.isFinite(o)&&m(o)},[o]),d.useEffect(()=>(R.MidiAudio.WebAudio.empty()?R.MidiAudio.loadPlugin({soundfontUrl:"/soundfont/",api:"webaudio"}).then(()=>{g(!0),console.debug("Soundfont loaded.")}):g(!0),()=>{r.current&&r.current.dispose()}),[]);const W=d.useCallback(async y=>{(!r.current||!x.current)&&O();const N=r.current.isPlaying;N&&(r.current.pause(),await new Promise(t=>setTimeout(t,0)),document.querySelectorAll(".notePlayOn").forEach(t=>t.classList.remove("notePlayOn"))),r.current.progressTicks=x.current.lookupTick(y),N&&E()},[x.current]),E=()=>{var y,N;!((y=l.systems)!=null&&y.length)||!((N=l.spartito)!=null&&N.regulated)||!j||((!r.current||k)&&(T(!1),O()),r.current?r.current.isPlaying?(r.current.pause(),a(!1)):(r.current.play({nextFrame:()=>(r.current&&x.current&&s(x.current.lookupPosition(r.current.progressTicks)),new Promise(t=>requestAnimationFrame(()=>t())))}),a(!0)):console.log("暂时无法播放"))},O=()=>{const{notation:y,tokenMap:N}=l.spartito.perform(),t=l.getMeasureLayout(),u=t?t.serialize(X.Full):Array(y.measures.length).fill(null).map((h,w)=>w+1),v=y.toPerformingNotationWithEvents(u);v.scaleTempo({headTempo:6e7/p}),x.current=Q.createFromNotation(v,N);const b=r.current?r.current.progressTicks:0;r.current&&r.current.dispose(),r.current=new R.MidiPlayer(v,{cacheSpan:200,onMidi:(h,w)=>{let S=null;switch(h.subtype){case"noteOn":h.channel!=null&&h.noteNumber!=null&&h.velocity!=null&&R.MidiAudio.noteOn(h.channel,h.noteNumber,h.velocity,w),S=()=>{var L;return(L=h==null?void 0:h.ids)==null?void 0:L.map(I=>{const P=document.getElementById(I);P&&P.classList.add("notePlayOn")})};break;case"noteOff":h.channel!=null&&h.noteNumber!=null&&R.MidiAudio.noteOff(h.channel,h.noteNumber,w),S=()=>{var L;return(L=h==null?void 0:h.ids)==null?void 0:L.map(I=>{const P=document.getElementById(I);P&&P.classList.remove("notePlayOn")})};break}S&&c.current.appendTask(w,S)},onPlayFinish(){r.current&&(r.current.progressTicks=0),a(!1)},onTurnCursor(){r.current&&x.current&&s(x.current.lookupPosition(r.current.progressTicks))}}),r.current.progressTicks=b},Y=y=>{$(y+1)};return e.jsx("div",{className:"viewer-page",children:e.jsx("div",{style:{overflowY:"hidden"},children:e.jsxs("div",{className:"score-viewer",children:[(B=l==null?void 0:l.pages)==null?void 0:B.map((y,N)=>e.jsx("div",{className:"viewer-page-container",children:e.jsx(me,{score:l,pageIndex:N,cursorPosition:f,onSeekPosition:W,getPage:t=>Y(t),showSource:!z},N)},N)),e.jsx("div",{className:"checkOriginImg fz26 fw4 fc33",onClick:y=>{r.current&&r.current.pause(),a(!1)},children:i.formatMessage({id:"editor.viewOriginal"})})]})})})},ve=l=>{var r,x;const o=V(),i=_(),[c,f]=d.useState((i==null?void 0:i.id)||((x=(r=l==null?void 0:l.match)==null?void 0:r.params)==null?void 0:x.id));d.useEffect(()=>{i!=null&&i.id&&f(i.id)},[i==null?void 0:i.id]);const s=ne(async()=>{const n=JSON.parse(decodeURIComponent(c)),a=U(await Z(n.url),K);return a.assemble(1),a},[]);return s.loading?e.jsx(ee,{style:{width:"100vw",height:"100vh"},children:o.formatMessage({id:"common.loading"})}):e.jsx(je,{score:s.value})};export{ve as default};
|
dist/assets/index-dbf40634.js
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
import{r as h,u as te,j as s,h as E}from"./umi-2cc549ef.js";import{i as se,q,E as ae,b as I,S as L,L as ne,c as ie,I as oe}from"./index-df1803a9.js";import{D as M,c as X,a as $,S as re,r as ce,A as le}from"./confirm-6338cd87.js";import{r as U,s as H}from"./index-d6bbb942.js";import{A as de,g as W,i as R,M as me,u as Y,f as ue,r as _,m as x,Q as ge,U as P}from"./_setToString-4a3d3b61.js";import{p as T}from"./processCompressedAESFile-405b7aba.js";import{M as fe,P as pe}from"./Table-67d781d8.js";import{B as S}from"./button-0e45694d.js";import{u as he,e as D,R as ye}from"./useDebounce-84d2d30c.js";import{d as C,J as K}from"./jszip.min-afb240b6.js";import{u as xe}from"./useAsync-a87a60de.js";import"./possibleConstructorReturn-5d2155d0.js";import"./index-209da080.js";var we={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h360c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H184V184h656v320c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V144c0-17.7-14.3-32-32-32zM653.3 599.4l52.2-52.2a8.01 8.01 0 00-4.7-13.6l-179.4-21c-5.1-.6-9.5 3.7-8.9 8.9l21 179.4c.8 6.6 8.9 9.4 13.6 4.7l52.4-52.4 256.2 256.2c3.1 3.1 8.2 3.1 11.3 0l42.4-42.4c3.1-3.1 3.1-8.2 0-11.3L653.3 599.4z"}}]},name:"select",theme:"outlined"};const Se=we;var je=function(l,d){return h.createElement(de,W(W({},l),{},{ref:d,icon:Se}))},ve=h.forwardRef(je);const _e=ve;var Me=function(a){a===void 0&&(a={});var l=h.useState(a),d=l[0],n=l[1],p=h.useMemo(function(){return{set:function(o,m){n(function(j){var g;return R(R({},j),(g={},g[o]=m,g))})},setAll:function(o){n(o)},remove:function(o){n(function(m){var j=m,g=o;j[g];var v=me(j,[typeof g=="symbol"?g:g+""]);return v})},reset:function(){return n(a)}}},[n]),y=R({get:h.useCallback(function(o){return d[o]},[d])},p);return[d,y]};const Ie=Me;var be=function(a,l,d){if(!se)return[l,function(){}];var n=h.useState(function(){try{var o=sessionStorage.getItem(a);return typeof o!="string"?(sessionStorage.setItem(a,d?String(l):JSON.stringify(l)),l):d?o:JSON.parse(o||"null")}catch{return l}}),p=n[0],y=n[1];return h.useEffect(function(){try{var o=d?String(p):JSON.stringify(p);sessionStorage.setItem(a,o)}catch{}}),[p,y]};const $e=be;const Ce="_title_jd9ry_1",Oe="_header_jd9ry_4",ze="_logo_jd9ry_14",ke="_imageFastPreview_jd9ry_18",Ee="_list_jd9ry_53",G={title:Ce,header:Oe,logo:ze,imageFastPreview:ke,"site-tag-plus":"_site-tag-plus_jd9ry_34","ant-table-row":"_ant-table-row_jd9ry_38","ant-tag":"_ant-tag_jd9ry_44",delete:"_delete_jd9ry_47","score-tags":"_score-tags_jd9ry_50",list:Ee},Re={recognized:"#1890ff",completed:"green",manual:"red",recognizing:"orange"},De=({id:a,env:l})=>{var y;const d=Y(),n=xe(async()=>_(`/torch/musicSet/manage/${a}`,{params:{env:l}}),[]),p=async(o,m)=>{const j=await T(o),g=new Blob([j],{type:"application/json"}),v=P(g,`${m}-id_${a}-${Date.now()}.json`);C(v,`${m}-id_${a}-${Date.now()}.json`,v.type)};return n.loading?null:s.jsxs("div",{children:[n.value.preview?s.jsxs(L,{children:[s.jsx(S,{onClick:()=>p(n.value.preview,"preject"),icon:s.jsx(M,{}),children:"Starry Score"}),s.jsx(S,{onClick:()=>p(n.value.content,"score_json"),icon:s.jsx(M,{}),children:"Find Score"}),s.jsx(S,{onClick:()=>p(n.value.midi,"score_midi"),icon:s.jsx(M,{}),children:"Find MIDI"})]}):s.jsx("div",{children:d.formatMessage({id:"admin.noFiles"})}),n.value?s.jsx("div",{style:{width:"100%"},children:(y=n.value.sources)==null?void 0:y.map(o=>s.jsx("img",{src:o.url,style:{width:"100%"}},o.url))}):null]})};function Ke(){var F,J;const a=Y(),l=h.useRef(),d=h.useRef(null),[n,p]=$e("admin-env","prod"),[y,o]=Ie(),[m,j]=h.useState([]),g=h.useRef({}),v=te(),u=h.useMemo(()=>{try{const t=q.parse(v.search),e=JSON.parse(decodeURIComponent(t.search))||{};return Q(e)}catch{return{}}},[v.search]),[O,N]=ue(async()=>{try{const t=await _("/torch/musicSet/manage",{params:{limit:50,offset:0,...u,env:n}});return{data:t.rows,success:!0,total:t.count}}catch(t){console.error(t)}return{data:void 0,success:!1}},[u,n]);he(()=>{N()},1e3,[u,n]);const z=(t,e)=>{E.push({pathname:"/playground",search:q.stringify({type:"admin",edit:e?"1":"0",env:n,id:t})})},A=(t,e,i,r=1e3)=>{if(!t.spartito||!t.spartito.regulated)return x.loading({content:a.formatMessage({id:"admin.regulation"},{title:i,pct:0}),key:e}),ce(t,{policy:"equations",quota:r,solutionStore:new le,onProgress:c=>{x.loading({content:a.formatMessage({id:"admin.regulation"},{title:i,pct:c}),key:e}),c===100&&x.destroy(e)}})},B=async t=>{o.set(t.id,!0);const e=await _(`/torch/musicSet/manage/${t.id}`,{params:{env:n}}),i=await T(e.preview),r=U(i,H);await A(r,t.id,t.name);const c=new re({score:r,...r.makeMusicSheet(),workTitle:t.name}).toString();return o.set(t.id,!1),c},Z=async t=>{o.set(t.id,!0);const e=await _(`/torch/musicSet/manage/${t.id}`,{params:{env:n}}),i=await T(e.preview),r=U(i,H),c=_.get("/torch/musicSet/manage/issueMeasure",{params:{env:n,offset:0,limit:1e3,status:[-1],scoreId:t.id}});await A(r,t.id,t.name,100),(await c).rows.forEach(b=>{if(b.status<0){const k=r.spartito.measures.find(ee=>ee.measureIndex===b.measureIndex);k&&(k.events=[],k.voices=[])}}),r.spartito.measures.forEach(b=>r.assignBackgroundForMeasure(b));const w=JSON.stringify(r.spartito);return o.set(t.id,!1),w},V=[{title:"#",render:(t,e,i)=>i,hideInSearch:!0},{title:a.formatMessage({id:"admin.column.name"}),dataIndex:"name",sorter:!0,initialValue:u.search,sortOrder:u.sortedBy==="name"&&u.sortedType?{asc:"ascend",desc:"descend"}[u.sortedType]:null,render:(t,e,i)=>s.jsx("a",{onClick:async()=>{if(x.loading({content:a.formatMessage({id:"common.loadingDetail"}),key:e.id,duration:0}),!(await _(`/torch/musicSet/manage/${e.id}`,{params:{...u,env:n}})).preview){x.destroy(),x.warn(a.formatMessage({id:"common.noPreviewContent"}));return}z(e.id,!1),x.destroy()},children:e.name||s.jsx("span",{style:{color:"#999999"},children:a.formatMessage({id:"common.untitled"})})})},{title:a.formatMessage({id:"admin.column.status"}),dataIndex:"status",valueEnum:{waitUpload:"waitUpload",upload:"upload",recognizing:"recognizing",recognized:"recognized",manual:"manual",completed:"completed",completing:"completing",systemError:"systemError",queue:"queue"},render:(t,e)=>s.jsx("span",{style:{color:Re[e.status]},children:e.status})},{title:a.formatMessage({id:"admin.column.pages"}),render:(t,e)=>{var i;return(i=e.sources)==null?void 0:i.length},width:"4em",align:"center",hideInSearch:!0},{title:a.formatMessage({id:"admin.column.createTime"}),width:"12em",dataIndex:"createTime",sorter:!0,hideInSearch:!0},{title:"id",render:(t,e,i)=>e.id},{title:"userId",dataIndex:"userId",render:(t,e,i)=>e.userId},{title:a.formatMessage({id:"admin.column.quality"}),dataIndex:"quality",render:(t,e)=>Number.isFinite(e.quality)?`${(e.quality*100).toFixed(1)}%`:"N/A"},{title:a.formatMessage({id:"admin.column.actions"}),width:"8em",hideInSearch:!0,render:(t,e,i)=>[s.jsx(fe,{trigger:s.jsx(S,{className:"download",type:"link",icon:s.jsx(_e,{})}),children:s.jsx(De,{id:e.id,env:n})},1),s.jsx(S,{className:"download",type:"link",icon:s.jsx(ae,{}),onClick:async()=>{if(x.loading({content:a.formatMessage({id:"common.loadingDetail"}),key:e.id,duration:0}),!(await _(`/torch/musicSet/manage/${e.id}`,{params:{...u,env:n}})).preview){x.destroy(),x.warn(a.formatMessage({id:"common.noPreviewContent"}));return}z(e.id,!0),x.destroy()}},2),s.jsx(S,{disabled:e.status!=="recognized",icon:y[e.id]?s.jsx(ge,{}):s.jsx(M,{}),onClick:async r=>{if(!await new Promise(w=>{X($.withWarn($.withConfirm({title:a.formatMessage({id:"admin.musicXmlExport.title"}),content:a.formatMessage({id:"admin.musicXmlExport.confirm"}),okText:a.formatMessage({id:"common.confirm"}),cancelText:a.formatMessage({id:"common.cancel"}),onOk:()=>w(!0),onCancel:()=>w(!1)})))}))return;const f=await B(e);C(f,`${e.name}-id_${e.id}-${Date.now()}.xml`,"application/xml")}},3)]}];return s.jsxs(I,{children:[s.jsx(I.Header,{className:G.header,children:s.jsxs(L,{children:[s.jsx(ne,{className:G.logo,to:"/",children:"STARRY✨"}),s.jsx(ie,{})]})}),s.jsx(I,{style:{minHeight:"100vh"},children:s.jsxs(I.Content,{style:{padding:"0 50px 50px",marginTop:"66px",width:"unset"},children:[s.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center",margin:"10px 0"},children:s.jsxs(L,{size:60,children:[s.jsxs(D.Group,{defaultValue:n,buttonStyle:"solid",onChange:t=>{p(t.target.value),l.current.clearSelected()},children:[s.jsx(D.Button,{value:"prod",children:a.formatMessage({id:"admin.env.prod"})}),s.jsx(D.Button,{value:"test",children:a.formatMessage({id:"admin.env.test"})})]}),s.jsx(S,{icon:s.jsx(ye,{}),onClick:N}),s.jsx(oe,{type:"number",step:1,min:256,style:{width:"8em"},placeholder:"ScoreID to go",onKeyDown:t=>{t.key==="Enter"&&z(t.target.value,!0)}})]})}),s.jsx(pe,{loading:O.loading,dataSource:(F=O.value)==null?void 0:F.data,style:{maxWidth:"100em",margin:"0 auto"},actionRef:l,formRef:d,columns:V,search:{filterType:"light"},size:"small",rowSelection:{onChange:(t,e)=>{j(e)}},pagination:{total:(J=O.value)==null?void 0:J.total,pageSize:50,current:+u.offset/+u.limit+1||1},onChange:(t,e,i,r)=>{var w;const c={ascend:"asc",descend:"desc"}[i.order],f={...u,offset:(t.current-1)*t.pageSize,limit:t.pageSize,tagIdList:e.tagIdList,search:u.search};i.order?(f.sortedBy=i.field,f.sortedType=c):(f.sortedBy=null,f.sortedType=null),((w=e.tagIdList)==null?void 0:w.length)>0?f.tagIdList=e.tagIdList:f.tagIdList=null,console.log("onChange"),E.push({search:`search=${encodeURIComponent(JSON.stringify(Q(f)))}`})},onSubmit:t=>{const e={...Object.fromEntries(Object.entries(u).filter(([i,r])=>!g.current[i])),...t};g.current=t,E.push({search:Object.values(e).filter(Boolean).length>0?`search=${encodeURIComponent(JSON.stringify(e))}`:""})},rowKey:"id",toolBarRender:()=>[s.jsx(S,{disabled:m.length===0,type:"primary",icon:s.jsx(M,{}),onClick:async()=>{if(!await new Promise(c=>{X($.withWarn($.withConfirm({title:a.formatMessage({id:"admin.musicXmlExport.title"}),content:(()=>{const f=m.filter(w=>w.status!=="recognized").length;return a.formatMessage({id:"admin.musicXmlExport.batchConfirm"},{count:m.length,skipped:f>0?a.formatMessage({id:"admin.musicXmlExport.skipped"},{count:f}):""})})(),okText:a.formatMessage({id:"common.confirm"}),cancelText:a.formatMessage({id:"common.cancel"}),onOk:()=>c(!0),onCancel:()=>c(!1)})))}))return;const e=new K;await Promise.all(m.filter(c=>c.status==="recognized").map(async c=>{e.file(`${c.name}-id_${c.id}-${Date.now()}.xml`,await B(c))}));const i=await e.generateAsync({type:"blob"}),r=P(i,`find-omr-pkg-${Date.now()}.zip`);C(r,r.name,r.type)},children:a.formatMessage({id:"admin.batchDownload.musicXml"})},"1"),s.jsx(S,{disabled:m.length===0,type:"primary",icon:s.jsx(M,{}),onClick:async()=>{const t=new K;await Promise.all(m.filter(r=>r.status==="recognized").map(async r=>Promise.race([t.file(`${r.id}.${r.name}-${Date.now()}.spartito.json`,await Z(r)),new Promise(c=>setTimeout(c,3e5))])));const e=await t.generateAsync({type:"blob"}),i=P(e,`StarrySpartito-${Date.now()}.zip`);C(i,i.name,i.type)},children:a.formatMessage({id:"admin.batchDownload.spartito"})},"2")]})]})}),s.jsx(I.Footer,{style:{textAlign:"center"},children:a.formatMessage({id:"common.footer"})})]})}function Q(a){return Object.entries(a).reduce((l,[d,n])=>{var y,o;return(d==="tagIdList"&&((o=(y=n==null?void 0:n.filter)==null?void 0:y.call(n,m=>/^\d+$/.test(String(n))))==null?void 0:o.length)>0||n)&&(l[d]=n),l},{})}export{Ke as default};
|
|
|
|
|
|
dist/assets/{index-02743632.js → index-f9505f65.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as A,_ as H,g as Z,u as _,j as i,h as w}from"./umi-2cc549ef.js";import{u as G,a as O,q,L as k,P as V,Q as X,b as S,S as W,c as $}from"./index-df1803a9.js";import{T as ee,S as te,P as R}from"./Tags-08a40205.js";import{w as L,_ as ae,a as ie,C as se,c as Y,b as ne,o as re,d as oe,e as le,u as ce,f as z,r as T,n as U,m as de}from"./_setToString-4a3d3b61.js";import{s as ge,V as Ae,g as ue,I as M,D as me,P as he}from"./Table-67d781d8.js";import{B as J}from"./button-0e45694d.js";import{u as Ee}from"./useDebounce-84d2d30c.js";import"./index-209da080.js";function fe(a){var e,o=function(l){return function(){e=null,a.apply(void 0,ae(l))}},n=function(){if(e==null){for(var l=arguments.length,d=new Array(l),u=0;u<l;u++)d[u]=arguments[u];e=L(o(d))}};return n.cancel=function(){L.cancel(e),e=null},n}var Qe=function(e){var o=e.prefixCls,n=e.rootPrefixCls,h=e.children,l=e.visible,d=A.createElement("div",{className:"".concat(o,"-content")},A.createElement("div",{className:"".concat(o,"-icon")},A.createElement(Ae,null)));return A.createElement(oe,{visible:l,motionName:"".concat(n,"-fade")},function(u){var v=u.className;return le(h||d,function(f){var r=f.className;return{className:Y(v,r)}})})},ve=function(e){var o=G(!1,{value:e.visible}),n=ie(o,2),h=n[0],l=n[1],d=A.createRef(),u=A.useRef(null),v=function(){return d.current&&d.current.ownerDocument?d.current.ownerDocument:window},f=fe(function(E){var x=e.visibilityHeight,C=x===void 0?400:x,I=ue(E.target,!0);l(I>C)}),r=function(){var x=e.target,C=x||v,I=C();u.current=O(I,"scroll",function(b){f(b)}),f({target:I})};A.useEffect(function(){return r(),function(){u.current&&u.current.remove(),f.cancel()}},[e.target]);var B=function(x){var C=e.onClick,I=e.target,b=e.duration,D=b===void 0?450:b;ge(0,{getContainer:I||v,duration:D}),typeof C=="function"&&C(x)},y=A.useContext(se),p=y.getPrefixCls,N=y.direction,j=e.prefixCls,s=e.className,t=s===void 0?"":s,c=p("back-top",j),g=p(),Q=Y(c,ne({},"".concat(c,"-rtl"),N==="rtl"),t),m=re(e,["prefixCls","className","children","visibilityHeight","target","visible"]);return A.createElement("div",H({},m,{className:Q,onClick:B,ref:d}),A.createElement(Qe,{prefixCls:c,rootPrefixCls:g,visible:h},e.children))};const Be=A.memo(ve),ye=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],xe=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ce=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ie=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],K=(a,e,o)=>{let n=a;return typeof e=="string"||Array.isArray(e)?n=a.toLocaleString(e,o):(e===!0||o!==void 0)&&(n=a.toLocaleString(void 0,o)),n};var Se=(a,e)=>{if(!Number.isFinite(a))throw new TypeError(`Expected a finite number, got ${typeof a}: ${a}`);e=Object.assign({bits:!1,binary:!1},e);const o=e.bits?e.binary?Ie:Ce:e.binary?xe:ye;if(e.signed&&a===0)return` 0 ${o[0]}`;const n=a<0,h=n?"-":e.signed?"+":"";n&&(a=-a);let l;if(e.minimumFractionDigits!==void 0&&(l={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(l=Object.assign({maximumFractionDigits:e.maximumFractionDigits},l)),a<1){const f=K(a,e.locale,l);return h+f+" "+o[0]}const d=Math.min(Math.floor(e.binary?Math.log(a)/Math.log(1024):Math.log10(a)/3),o.length-1);a/=Math.pow(e.binary?1024:1e3,d),l||(a=a.toPrecision(3));const u=K(Number(a),e.locale,l),v=o[d];return h+u+" "+v};const pe=Z(Se);const Ne="_title_jd9ry_1",je="_header_jd9ry_4",be="_logo_jd9ry_14",we="_imageFastPreview_jd9ry_18",Te="_list_jd9ry_53",P={title:Ne,header:je,logo:be,imageFastPreview:we,"site-tag-plus":"_site-tag-plus_jd9ry_34","ant-table-row":"_ant-table-row_jd9ry_38","ant-tag":"_ant-tag_jd9ry_44",delete:"_delete_jd9ry_47","score-tags":"_score-tags_jd9ry_50",list:Te},Me=i.jsx("svg",{style:{width:"1.4em",height:"1.4em",margin:"0 10px"},viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:i.jsx("path",{d:"M960 1024H64a64 64 0 0 1-64-64V64a64 64 0 0 1 64-64h896a64 64 0 0 1 64 64v896a64 64 0 0 1-64 64z m0-896a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64v768a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V128z m-128 640h-128a64 64 0 0 1 0-128h64V576h-64a64 64 0 0 1 0-128h64V384h-64a64 64 0 0 1 0-128h128a64 64 0 0 1 64 64v384a64 64 0 0 1-64 64z m-320-128a64 64 0 0 1 0 128H384a64 64 0 0 1-64-64V512a64 64 0 0 1 64-64h64V384H384a64 64 0 0 1 0-128h128a64 64 0 0 1 64 64v192a64 64 0 0 1-64 64H448v64h64z m-320 128a64 64 0 0 1-64-64V320a64 64 0 0 1 128 0v384a64 64 0 0 1-64 64z"})}),Je=i.jsxs("svg",{style:{width:"1.5em",height:"1.5em",margin:"0 10px"},viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:[i.jsx("path",{d:"M428.62 383.7l193.23-45.33v-31.94l-193.23 45.48zM374.7 656c-10.23-8.15-25.15-13.26-41.74-13.26-16.59 0-31.52 5.11-42.02 13.26-8.85 7.19-14.65 16.59-14.65 26.54 0 10.23 5.8 19.63 14.65 26.82 10.5 8.15 25.44 12.99 42.02 12.99 16.59 0 31.51-4.84 41.74-12.99 9.26-7.19 14.93-16.59 14.93-26.82 0.01-9.95-5.67-19.35-14.93-26.54zM607.2 602.65v-0.14c-10.5-8.15-25.44-13.14-42.02-13.14-16.59 0-31.51 4.98-42.02 13.14-8.85 7.05-14.65 16.59-14.65 26.68 0 9.95 5.8 19.49 14.65 26.54 10.52 8.29 25.44 13.26 42.02 13.26 16.59 0 31.52-4.97 42.02-13.26 8.85-6.78 14.38-16.32 14.65-25.99v-0.96c-0.14-9.97-5.8-19.22-14.65-26.13z",fill:"#000000"}),i.jsx("path",{d:"M512 64C264.58 64 64 264.58 64 512s200.58 448 448 448 448-200.58 448-448S759.42 64 512 64z m148.83 565.19v0.82c-0.28 22.26-11.61 42.3-29.85 56.4-17.14 13.55-40.37 21.56-65.8 21.56s-48.79-8.01-65.93-21.29c-18.39-14.51-29.72-34.69-29.72-57.49 0-22.67 11.34-42.86 29.72-57.23 17.14-13.4 40.35-21.57 65.93-21.57 21.02 0 40.64 5.68 56.67 15.34V362.27l-193.23 45.48V683.64c-0.28 22.13-11.75 42.03-29.87 56.41-17.14 13.26-40.35 21.43-65.79 21.43-25.43 0-48.79-8.17-65.8-21.43-18.51-14.65-29.99-34.69-29.99-57.51 0-22.39 11.48-42.84 29.99-57.23 17.01-13.26 40.37-21.29 65.8-21.29 21 0 40.78 5.53 56.67 15.07V333.94l0.27-0.68v-0.28l0.14-0.27V332.02l0.14-0.28 0.14-0.27v-0.55h0.13l0.14-0.7v-0.28c0.41-0.96 0.98-2.06 1.53-2.9v-0.27l0.27-0.14v-0.28l0.28-0.13 0.13-0.57 0.28-0.27 0.55-0.55v-0.55h0.28l0.13-0.28 0.28-0.27 0.27-0.14v-0.14l0.28-0.27 1.1-0.84v-0.27h0.14l0.41-0.28 0.14-0.27h0.14l0.82-0.84 0.28-0.14 0.27-0.14v-0.13l0.28-0.14 0.82-0.41v-0.14l0.69-0.41h0.14c0.84-0.42 1.66-0.7 2.63-0.98 0.82-0.55 1.78-0.82 2.9-0.82l230.83-54.32c10.23-2.35 20.18 3.6 23.23 13.26v0.28c0.82 2.07 1.1 4.15 1.1 6.49v346.11z",fill:"#000000"})]});function Ye(){var N,j;const a=ce(),e=A.useRef(),[o,n]=A.useState(null),h=A.useRef(null),[l,d]=A.useState([]),[u,v]=z(async()=>await T.get("/api/tags"),[]),f=_(),r=A.useMemo(()=>{try{const s=q.parse(f.search),t=JSON.parse(decodeURIComponent(s.search))||{};return F(t)}catch{return{}}},[f.search]);A.useEffect(()=>{v()},[]);const[B,y]=z(async()=>{var s;try{const t=await T("/api/musicSets",{params:{total:(s=B.value)==null?void 0:s.total,limit:50,offset:0,...r}});return{data:t.rows,success:!0,total:t.count}}catch(t){console.error(t)}return{data:void 0,success:!1}},[r]);Ee(()=>{y()},1e3,[r]);const p=[{title:a.formatMessage({id:"home.column.preview"}),dataIndex:"content",width:54,hideInSearch:!0,render:(s,t,c)=>i.jsx(M,{width:40,height:40,preview:!1,onMouseEnter:()=>{var Q,m;const g=(m=(Q=t.content)==null?void 0:Q.images)==null?void 0:m[0];n(g?{...g,url:U(g.url)}:null)},onMouseLeave:()=>n(null),onClick:()=>{n(null),d(t.content.images.map(g=>U(g.url)))},style:{cursor:"pointer"},src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="})},{title:a.formatMessage({id:"home.column.name"}),dataIndex:"name",sorter:!0,initialValue:r.search,sortOrder:r.sortedBy==="name"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,render:(s,t,c)=>i.jsx(k,{style:{display:"flex"},to:`/${{stave:"playground",simple:"numbered"}[t.type]}/${t.id}`,children:`${t.name||a.formatMessage({id:"common.untitled"})}`})},{title:a.formatMessage({id:"home.column.type"}),dataIndex:"type",width:"6em",sorter:!0,initialValue:r.search,sortOrder:r.sortedBy==="type"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,render:(s,t,c)=>({stave:Je,simple:Me})[t.type]},{title:i.jsx(ee,{}),dataIndex:"tagIdList",width:"2em",valueType:"select",filters:!0,hideInSearch:!0,filteredValue:(r==null?void 0:r.tagIdList)||[],valueEnum:()=>{var s;return((s=u.value)==null?void 0:s.reduce((t,c)=>({...t,[c.id]:{text:c.name||" "}}),{}))||{}},render:(s,t,c)=>i.jsx(te,{preview:!0,id:t.id,tagList:t.tagList,onChange:g=>{console.log("tags",g),t.tagList=g}},t.id)},{title:a.formatMessage({id:"home.column.pages"}),render:(s,t)=>{var c,g;return(g=(c=t.content)==null?void 0:c.images)==null?void 0:g.length},width:"4em",align:"center",hideInSearch:!0},{title:a.formatMessage({id:"home.column.size"}),width:"6em",render:(s,t)=>{var c,g,Q;return((c=t.content)==null?void 0:c.images)&&pe((Q=(g=t.content)==null?void 0:g.images)==null?void 0:Q.reduce((m,E)=>m+((E==null?void 0:E.size)??0),0))},align:"center",hideInSearch:!0},{title:a.formatMessage({id:"home.column.lastUpdate"}),width:"12em",dataIndex:"lastUpdateAt",sorter:!0,sortOrder:r.sortedBy==="lastUpdateAt"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,hideInSearch:!0},{title:a.formatMessage({id:"home.column.actions"}),width:"4em",hideInSearch:!0,render:(s,t,c)=>[(!t.tagList||!t.tagList.length)&&i.jsx(V,{title:a.formatMessage({id:"home.confirmDelete"}),okText:a.formatMessage({id:"common.confirm"}),cancelText:a.formatMessage({id:"common.cancel"}),icon:i.jsx(X,{}),onConfirm:async()=>{await T.delete(`/api/musicSets/${t.id}`)&&(de.success(a.formatMessage({id:"home.deleteSuccess"})),await y())},children:i.jsx(J,{className:"delete",type:"link",children:i.jsx(me,{})})},"delete")]}];return i.jsxs(S,{children:[i.jsx(S.Header,{className:P.header,children:i.jsxs(W,{children:[i.jsx(k,{className:P.logo,to:"/",children:"STARRY✨"}),i.jsxs(J,{onClick:()=>{w.push("/playground")},children:[i.jsx(R,{}),a.formatMessage({id:"home.createStave"})]}),i.jsxs(J,{onClick:()=>{w.push("/numbered")},children:[i.jsx(R,{}),a.formatMessage({id:"home.createNumbered"})]}),i.jsx($,{})]})}),i.jsx(S,{style:{minHeight:"100vh"},children:i.jsx(S.Content,{style:{padding:"0 50px 50px",marginTop:"104px",width:"unset"},children:i.jsx(he,{loading:B.loading,dataSource:(N=B.value)==null?void 0:N.data,style:{maxWidth:"100em",margin:"0 auto"},actionRef:e,formRef:h,columns:p,search:{filterType:"light"},size:"small",options:{density:!1,reload:y},pagination:{total:(j=B.value)==null?void 0:j.total,pageSize:50,current:+r.offset/+r.limit+1||1},onChange:(s,t,c,g)=>{var E;const Q={ascend:"asc",descend:"desc"}[c.order],m={...r,offset:(s.current-1)*s.pageSize,limit:s.pageSize,tagIdList:t.tagIdList,search:r.search};c.order?(m.sortedBy=c.field,m.sortedType=Q):(m.sortedBy=null,m.sortedType=null),((E=t.tagIdList)==null?void 0:E.length)>0?m.tagIdList=t.tagIdList:m.tagIdList=null,console.log("onChange"),w.push({search:`search=${encodeURIComponent(JSON.stringify(F(m)))}`})},beforeSearchSubmit:s=>{const t={...r,search:s.name};console.log("beforeSearchSubmit",t),w.push({search:Object.values(t).filter(Boolean).length>0?`search=${encodeURIComponent(JSON.stringify(t))}`:""})},rowKey:"id"})})}),i.jsx(S.Footer,{style:{textAlign:"center"},children:a.formatMessage({id:"common.footer"})}),o&&i.jsx("div",{className:P.imageFastPreview,children:i.jsx("img",{src:o.url,style:{objectFit:"contain",objectPosition:"center",maxHeight:"100%",maxWidth:"100%",backgroundColor:"#ffffff",boxShadow:"0 0 10px 0px rgba(0,0,0,0.5)"},alt:""})}),i.jsx(Be,{}),i.jsx(M.PreviewGroup,{preview:{open:l.length>0,destroyOnClose:!0,onOpenChange:s=>{s||d([])}},children:l.map((s,t)=>i.jsx(M,{wrapperStyle:{fontSize:"12px"},height:40,src:s},t))})]})}function F(a){return Object.entries(a).reduce((e,[o,n])=>{var l,d;return(o==="tagIdList"&&((d=(l=n==null?void 0:n.filter)==null?void 0:l.call(n,u=>/^\d+$/.test(String(n))))==null?void 0:d.length)>0||n)&&(e[o]=n),e},{})}export{Ye as default};
|
|
|
|
| 1 |
+
import{r as A,_ as H,g as Z,u as _,j as i,h as w}from"./umi-a044fd32.js";import{u as G,a as O,q,L as k,P as V,Q as X,b as S,S as W,c as $}from"./index-49aef8b5.js";import{T as ee,S as te,P as R}from"./Tags-3c874079.js";import{w as L,_ as ae,a as ie,C as se,c as Y,b as ne,o as re,d as oe,e as le,u as ce,f as z,r as T,n as U,m as de}from"./_setToString-1e1135c3.js";import{s as ge,V as Ae,g as ue,I as M,D as me,P as he}from"./Table-cb37e8e0.js";import{B as J}from"./button-eba43326.js";import{u as Ee}from"./useDebounce-51aac85c.js";import"./index-7584011d.js";function fe(a){var e,o=function(l){return function(){e=null,a.apply(void 0,ae(l))}},n=function(){if(e==null){for(var l=arguments.length,d=new Array(l),u=0;u<l;u++)d[u]=arguments[u];e=L(o(d))}};return n.cancel=function(){L.cancel(e),e=null},n}var Qe=function(e){var o=e.prefixCls,n=e.rootPrefixCls,h=e.children,l=e.visible,d=A.createElement("div",{className:"".concat(o,"-content")},A.createElement("div",{className:"".concat(o,"-icon")},A.createElement(Ae,null)));return A.createElement(oe,{visible:l,motionName:"".concat(n,"-fade")},function(u){var v=u.className;return le(h||d,function(f){var r=f.className;return{className:Y(v,r)}})})},ve=function(e){var o=G(!1,{value:e.visible}),n=ie(o,2),h=n[0],l=n[1],d=A.createRef(),u=A.useRef(null),v=function(){return d.current&&d.current.ownerDocument?d.current.ownerDocument:window},f=fe(function(E){var x=e.visibilityHeight,C=x===void 0?400:x,I=ue(E.target,!0);l(I>C)}),r=function(){var x=e.target,C=x||v,I=C();u.current=O(I,"scroll",function(b){f(b)}),f({target:I})};A.useEffect(function(){return r(),function(){u.current&&u.current.remove(),f.cancel()}},[e.target]);var B=function(x){var C=e.onClick,I=e.target,b=e.duration,D=b===void 0?450:b;ge(0,{getContainer:I||v,duration:D}),typeof C=="function"&&C(x)},y=A.useContext(se),p=y.getPrefixCls,N=y.direction,j=e.prefixCls,s=e.className,t=s===void 0?"":s,c=p("back-top",j),g=p(),Q=Y(c,ne({},"".concat(c,"-rtl"),N==="rtl"),t),m=re(e,["prefixCls","className","children","visibilityHeight","target","visible"]);return A.createElement("div",H({},m,{className:Q,onClick:B,ref:d}),A.createElement(Qe,{prefixCls:c,rootPrefixCls:g,visible:h},e.children))};const Be=A.memo(ve),ye=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],xe=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ce=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ie=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],K=(a,e,o)=>{let n=a;return typeof e=="string"||Array.isArray(e)?n=a.toLocaleString(e,o):(e===!0||o!==void 0)&&(n=a.toLocaleString(void 0,o)),n};var Se=(a,e)=>{if(!Number.isFinite(a))throw new TypeError(`Expected a finite number, got ${typeof a}: ${a}`);e=Object.assign({bits:!1,binary:!1},e);const o=e.bits?e.binary?Ie:Ce:e.binary?xe:ye;if(e.signed&&a===0)return` 0 ${o[0]}`;const n=a<0,h=n?"-":e.signed?"+":"";n&&(a=-a);let l;if(e.minimumFractionDigits!==void 0&&(l={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(l=Object.assign({maximumFractionDigits:e.maximumFractionDigits},l)),a<1){const f=K(a,e.locale,l);return h+f+" "+o[0]}const d=Math.min(Math.floor(e.binary?Math.log(a)/Math.log(1024):Math.log10(a)/3),o.length-1);a/=Math.pow(e.binary?1024:1e3,d),l||(a=a.toPrecision(3));const u=K(Number(a),e.locale,l),v=o[d];return h+u+" "+v};const pe=Z(Se);const Ne="_title_jd9ry_1",je="_header_jd9ry_4",be="_logo_jd9ry_14",we="_imageFastPreview_jd9ry_18",Te="_list_jd9ry_53",P={title:Ne,header:je,logo:be,imageFastPreview:we,"site-tag-plus":"_site-tag-plus_jd9ry_34","ant-table-row":"_ant-table-row_jd9ry_38","ant-tag":"_ant-tag_jd9ry_44",delete:"_delete_jd9ry_47","score-tags":"_score-tags_jd9ry_50",list:Te},Me=i.jsx("svg",{style:{width:"1.4em",height:"1.4em",margin:"0 10px"},viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:i.jsx("path",{d:"M960 1024H64a64 64 0 0 1-64-64V64a64 64 0 0 1 64-64h896a64 64 0 0 1 64 64v896a64 64 0 0 1-64 64z m0-896a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64v768a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V128z m-128 640h-128a64 64 0 0 1 0-128h64V576h-64a64 64 0 0 1 0-128h64V384h-64a64 64 0 0 1 0-128h128a64 64 0 0 1 64 64v384a64 64 0 0 1-64 64z m-320-128a64 64 0 0 1 0 128H384a64 64 0 0 1-64-64V512a64 64 0 0 1 64-64h64V384H384a64 64 0 0 1 0-128h128a64 64 0 0 1 64 64v192a64 64 0 0 1-64 64H448v64h64z m-320 128a64 64 0 0 1-64-64V320a64 64 0 0 1 128 0v384a64 64 0 0 1-64 64z"})}),Je=i.jsxs("svg",{style:{width:"1.5em",height:"1.5em",margin:"0 10px"},viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"200",height:"200",children:[i.jsx("path",{d:"M428.62 383.7l193.23-45.33v-31.94l-193.23 45.48zM374.7 656c-10.23-8.15-25.15-13.26-41.74-13.26-16.59 0-31.52 5.11-42.02 13.26-8.85 7.19-14.65 16.59-14.65 26.54 0 10.23 5.8 19.63 14.65 26.82 10.5 8.15 25.44 12.99 42.02 12.99 16.59 0 31.51-4.84 41.74-12.99 9.26-7.19 14.93-16.59 14.93-26.82 0.01-9.95-5.67-19.35-14.93-26.54zM607.2 602.65v-0.14c-10.5-8.15-25.44-13.14-42.02-13.14-16.59 0-31.51 4.98-42.02 13.14-8.85 7.05-14.65 16.59-14.65 26.68 0 9.95 5.8 19.49 14.65 26.54 10.52 8.29 25.44 13.26 42.02 13.26 16.59 0 31.52-4.97 42.02-13.26 8.85-6.78 14.38-16.32 14.65-25.99v-0.96c-0.14-9.97-5.8-19.22-14.65-26.13z",fill:"#000000"}),i.jsx("path",{d:"M512 64C264.58 64 64 264.58 64 512s200.58 448 448 448 448-200.58 448-448S759.42 64 512 64z m148.83 565.19v0.82c-0.28 22.26-11.61 42.3-29.85 56.4-17.14 13.55-40.37 21.56-65.8 21.56s-48.79-8.01-65.93-21.29c-18.39-14.51-29.72-34.69-29.72-57.49 0-22.67 11.34-42.86 29.72-57.23 17.14-13.4 40.35-21.57 65.93-21.57 21.02 0 40.64 5.68 56.67 15.34V362.27l-193.23 45.48V683.64c-0.28 22.13-11.75 42.03-29.87 56.41-17.14 13.26-40.35 21.43-65.79 21.43-25.43 0-48.79-8.17-65.8-21.43-18.51-14.65-29.99-34.69-29.99-57.51 0-22.39 11.48-42.84 29.99-57.23 17.01-13.26 40.37-21.29 65.8-21.29 21 0 40.78 5.53 56.67 15.07V333.94l0.27-0.68v-0.28l0.14-0.27V332.02l0.14-0.28 0.14-0.27v-0.55h0.13l0.14-0.7v-0.28c0.41-0.96 0.98-2.06 1.53-2.9v-0.27l0.27-0.14v-0.28l0.28-0.13 0.13-0.57 0.28-0.27 0.55-0.55v-0.55h0.28l0.13-0.28 0.28-0.27 0.27-0.14v-0.14l0.28-0.27 1.1-0.84v-0.27h0.14l0.41-0.28 0.14-0.27h0.14l0.82-0.84 0.28-0.14 0.27-0.14v-0.13l0.28-0.14 0.82-0.41v-0.14l0.69-0.41h0.14c0.84-0.42 1.66-0.7 2.63-0.98 0.82-0.55 1.78-0.82 2.9-0.82l230.83-54.32c10.23-2.35 20.18 3.6 23.23 13.26v0.28c0.82 2.07 1.1 4.15 1.1 6.49v346.11z",fill:"#000000"})]});function Ye(){var N,j;const a=ce(),e=A.useRef(),[o,n]=A.useState(null),h=A.useRef(null),[l,d]=A.useState([]),[u,v]=z(async()=>await T.get("/api/tags"),[]),f=_(),r=A.useMemo(()=>{try{const s=q.parse(f.search),t=JSON.parse(decodeURIComponent(s.search))||{};return F(t)}catch{return{}}},[f.search]);A.useEffect(()=>{v()},[]);const[B,y]=z(async()=>{var s;try{const t=await T("/api/musicSets",{params:{total:(s=B.value)==null?void 0:s.total,limit:50,offset:0,...r}});return{data:t.rows,success:!0,total:t.count}}catch(t){console.error(t)}return{data:void 0,success:!1}},[r]);Ee(()=>{y()},1e3,[r]);const p=[{title:a.formatMessage({id:"home.column.preview"}),dataIndex:"content",width:54,hideInSearch:!0,render:(s,t,c)=>i.jsx(M,{width:40,height:40,preview:!1,onMouseEnter:()=>{var Q,m;const g=(m=(Q=t.content)==null?void 0:Q.images)==null?void 0:m[0];n(g?{...g,url:U(g.url)}:null)},onMouseLeave:()=>n(null),onClick:()=>{n(null),d(t.content.images.map(g=>U(g.url)))},style:{cursor:"pointer"},src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="})},{title:a.formatMessage({id:"home.column.name"}),dataIndex:"name",sorter:!0,initialValue:r.search,sortOrder:r.sortedBy==="name"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,render:(s,t,c)=>i.jsx(k,{style:{display:"flex"},to:`/${{stave:"playground",simple:"numbered"}[t.type]}/${t.id}`,children:`${t.name||a.formatMessage({id:"common.untitled"})}`})},{title:a.formatMessage({id:"home.column.type"}),dataIndex:"type",width:"6em",sorter:!0,initialValue:r.search,sortOrder:r.sortedBy==="type"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,render:(s,t,c)=>({stave:Je,simple:Me})[t.type]},{title:i.jsx(ee,{}),dataIndex:"tagIdList",width:"2em",valueType:"select",filters:!0,hideInSearch:!0,filteredValue:(r==null?void 0:r.tagIdList)||[],valueEnum:()=>{var s;return((s=u.value)==null?void 0:s.reduce((t,c)=>({...t,[c.id]:{text:c.name||" "}}),{}))||{}},render:(s,t,c)=>i.jsx(te,{preview:!0,id:t.id,tagList:t.tagList,onChange:g=>{console.log("tags",g),t.tagList=g}},t.id)},{title:a.formatMessage({id:"home.column.pages"}),render:(s,t)=>{var c,g;return(g=(c=t.content)==null?void 0:c.images)==null?void 0:g.length},width:"4em",align:"center",hideInSearch:!0},{title:a.formatMessage({id:"home.column.size"}),width:"6em",render:(s,t)=>{var c,g,Q;return((c=t.content)==null?void 0:c.images)&&pe((Q=(g=t.content)==null?void 0:g.images)==null?void 0:Q.reduce((m,E)=>m+((E==null?void 0:E.size)??0),0))},align:"center",hideInSearch:!0},{title:a.formatMessage({id:"home.column.lastUpdate"}),width:"12em",dataIndex:"lastUpdateAt",sorter:!0,sortOrder:r.sortedBy==="lastUpdateAt"&&r.sortedType?{asc:"ascend",desc:"descend"}[r.sortedType]:null,hideInSearch:!0},{title:a.formatMessage({id:"home.column.actions"}),width:"4em",hideInSearch:!0,render:(s,t,c)=>[(!t.tagList||!t.tagList.length)&&i.jsx(V,{title:a.formatMessage({id:"home.confirmDelete"}),okText:a.formatMessage({id:"common.confirm"}),cancelText:a.formatMessage({id:"common.cancel"}),icon:i.jsx(X,{}),onConfirm:async()=>{await T.delete(`/api/musicSets/${t.id}`)&&(de.success(a.formatMessage({id:"home.deleteSuccess"})),await y())},children:i.jsx(J,{className:"delete",type:"link",children:i.jsx(me,{})})},"delete")]}];return i.jsxs(S,{children:[i.jsx(S.Header,{className:P.header,children:i.jsxs(W,{children:[i.jsx(k,{className:P.logo,to:"/",children:"STARRY✨"}),i.jsxs(J,{onClick:()=>{w.push("/playground")},children:[i.jsx(R,{}),a.formatMessage({id:"home.createStave"})]}),i.jsxs(J,{onClick:()=>{w.push("/numbered")},children:[i.jsx(R,{}),a.formatMessage({id:"home.createNumbered"})]}),i.jsx($,{})]})}),i.jsx(S,{style:{minHeight:"100vh"},children:i.jsx(S.Content,{style:{padding:"0 50px 50px",marginTop:"104px",width:"unset"},children:i.jsx(he,{loading:B.loading,dataSource:(N=B.value)==null?void 0:N.data,style:{maxWidth:"100em",margin:"0 auto"},actionRef:e,formRef:h,columns:p,search:{filterType:"light"},size:"small",options:{density:!1,reload:y},pagination:{total:(j=B.value)==null?void 0:j.total,pageSize:50,current:+r.offset/+r.limit+1||1},onChange:(s,t,c,g)=>{var E;const Q={ascend:"asc",descend:"desc"}[c.order],m={...r,offset:(s.current-1)*s.pageSize,limit:s.pageSize,tagIdList:t.tagIdList,search:r.search};c.order?(m.sortedBy=c.field,m.sortedType=Q):(m.sortedBy=null,m.sortedType=null),((E=t.tagIdList)==null?void 0:E.length)>0?m.tagIdList=t.tagIdList:m.tagIdList=null,console.log("onChange"),w.push({search:`search=${encodeURIComponent(JSON.stringify(F(m)))}`})},beforeSearchSubmit:s=>{const t={...r,search:s.name};console.log("beforeSearchSubmit",t),w.push({search:Object.values(t).filter(Boolean).length>0?`search=${encodeURIComponent(JSON.stringify(t))}`:""})},rowKey:"id"})})}),i.jsx(S.Footer,{style:{textAlign:"center"},children:a.formatMessage({id:"common.footer"})}),o&&i.jsx("div",{className:P.imageFastPreview,children:i.jsx("img",{src:o.url,style:{objectFit:"contain",objectPosition:"center",maxHeight:"100%",maxWidth:"100%",backgroundColor:"#ffffff",boxShadow:"0 0 10px 0px rgba(0,0,0,0.5)"},alt:""})}),i.jsx(Be,{}),i.jsx(M.PreviewGroup,{preview:{open:l.length>0,destroyOnClose:!0,onOpenChange:s=>{s||d([])}},children:l.map((s,t)=>i.jsx(M,{wrapperStyle:{fontSize:"12px"},height:40,src:s},t))})]})}function F(a){return Object.entries(a).reduce((e,[o,n])=>{var l,d;return(o==="tagIdList"&&((d=(l=n==null?void 0:n.filter)==null?void 0:l.call(n,u=>/^\d+$/.test(String(n))))==null?void 0:d.length)>0||n)&&(e[o]=n),e},{})}export{Ye as default};
|
dist/assets/{index-72c1f0f7.js → index-f9ab2910.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/index.less_used_.module-ae8585e9.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/index.less_used_.module-be0d6d9a.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{jszip.min-afb240b6.js → jszip.min-4f73c8ba.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import{g as St,c as _t,l as vt}from"./umi-
|
| 2 |
|
| 3 |
Use Save As... to download, then click back to return to this page.`)&&(location.href=E),!0;var O=document.createElement("iframe");document.body.appendChild(O),!P&&/^data:/.test(E)&&(E="data:"+E.replace(/^data:([\w\/\-\+]+)/,n)),O.src=E,setTimeout(function(){document.body.removeChild(O)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(r,d);if(o.URL)T(o.URL.createObjectURL(r),!0);else{if(typeof r=="string"||r.constructor===g)try{return T("data:"+h+";base64,"+o.btoa(r))}catch{return T("data:"+h+","+encodeURIComponent(r))}u=new FileReader,u.onload=function(E){T(this.result)},u.readAsDataURL(r)}return!0}})})(zt);var Bt=zt.exports;const Dt=St(Bt);var Ct={exports:{}};/*!
|
| 4 |
|
|
|
|
| 1 |
+
import{g as St,c as _t,l as vt}from"./umi-a044fd32.js";var zt={exports:{}};(function(yt,Et){(function(b,U){yt.exports=U()})(_t,function(){return function b(U,k,l){var o=window,n="application/octet-stream",h=l||n,m=U,v=!k&&!l&&m,p=document.createElement("a"),g=function(E){return String(E)},i=o.Blob||o.MozBlob||o.WebKitBlob||g,d=k||"download",r,u;if(i=i.call?i.bind(o):Blob,String(this)==="true"&&(m=[m,h],h=m[0],m=m[1]),v&&v.length<2048&&(d=v.split("/").pop().split("?")[0],p.href=v,p.href.indexOf(v)!==-1)){var a=new XMLHttpRequest;return a.open("GET",v,!0),a.responseType="blob",a.onload=function(E){b(E.target.response,d,n)},setTimeout(function(){a.send()},0),a}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(m))if(m.length>1024*1024*1.999&&i!==g)m=x(m),h=m.type||n;else return navigator.msSaveBlob?navigator.msSaveBlob(x(m),d):T(m);else if(/([\x80-\xff])/.test(m)){var c=0,y=new Uint8Array(m.length),S=y.length;for(c;c<S;++c)y[c]=m.charCodeAt(c);m=new i([y],{type:h})}r=m instanceof i?m:new i([m],{type:h});function x(E){var P=E.split(/[:;,]/),O=P[1],W=P[2]=="base64"?atob:decodeURIComponent,Y=W(P.pop()),_=Y.length,B=0,e=new Uint8Array(_);for(B;B<_;++B)e[B]=Y.charCodeAt(B);return new i([e],{type:O})}function T(E,P){if("download"in p)return p.href=E,p.setAttribute("download",d),p.className="download-js-link",p.innerHTML="downloading...",p.style.display="none",document.body.appendChild(p),setTimeout(function(){p.click(),document.body.removeChild(p),P===!0&&setTimeout(function(){o.URL.revokeObjectURL(p.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(E)&&(E="data:"+E.replace(/^data:([\w\/\-\+]+)/,n)),window.open(E)||confirm(`Displaying New Document
|
| 2 |
|
| 3 |
Use Save As... to download, then click back to return to this page.`)&&(location.href=E),!0;var O=document.createElement("iframe");document.body.appendChild(O),!P&&/^data:/.test(E)&&(E="data:"+E.replace(/^data:([\w\/\-\+]+)/,n)),O.src=E,setTimeout(function(){document.body.removeChild(O)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(r,d);if(o.URL)T(o.URL.createObjectURL(r),!0);else{if(typeof r=="string"||r.constructor===g)try{return T("data:"+h+";base64,"+o.btoa(r))}catch{return T("data:"+h+","+encodeURIComponent(r))}u=new FileReader,u.onload=function(E){T(this.result)},u.readAsDataURL(r)}return!0}})})(zt);var Bt=zt.exports;const Dt=St(Bt);var Ct={exports:{}};/*!
|
| 4 |
|
dist/assets/possibleConstructorReturn-5d2155d0.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
import{g as S}from"./umi-2cc549ef.js";var q={exports:{}};(function(r){function o(){return r.exports=o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)({}).hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r.exports.__esModule=!0,r.exports.default=r.exports,o.apply(null,arguments)}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(q);var Z=q.exports;const xr=S(Z);var R={exports:{}},W={exports:{}},L={exports:{}};(function(r){function o(e){"@babel/helpers - typeof";return r.exports=o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r.exports.__esModule=!0,r.exports.default=r.exports,o(e)}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(L);var d=L.exports,k={exports:{}};(function(r){var o=d.default;function e(t,s){if(o(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,s||"default");if(o(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(t)}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(k);var m=k.exports;(function(r){var o=d.default,e=m;function t(s){var n=e(s,"string");return o(n)=="symbol"?n:n+""}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports})(W);var H=W.exports;(function(r){var o=H;function e(t,s,n){return(s=o(s))in t?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,t}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(R);var rr=R.exports;const cr=S(rr);var z={exports:{}};(function(r){function o(e){return e&&e.__esModule?e:{default:e}}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(z);var lr=z.exports,D={exports:{}},K={exports:{}},G={exports:{}};(function(r){function o(e,t){(t==null||t>e.length)&&(t=e.length);for(var s=0,n=Array(t);s<t;s++)n[s]=e[s];return n}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(G);var $=G.exports;(function(r){var o=$;function e(t){if(Array.isArray(t))return o(t)}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(K);var tr=K.exports,F={exports:{}};(function(r){function o(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(F);var er=F.exports,N={exports:{}};(function(r){var o=$;function e(t,s){if(t){if(typeof t=="string")return o(t,s);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,s):void 0}}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(N);var U=N.exports,B={exports:{}};(function(r){function o(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
| 2 |
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(B);var or=B.exports;(function(r){var o=tr,e=er,t=U,s=or;function n(a){return o(a)||e(a)||t(a)||s()}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports})(D);var yr=D.exports,J={exports:{}},Q={exports:{}};(function(r){function o(e){if(Array.isArray(e))return e}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(Q);var sr=Q.exports,V={exports:{}};(function(r){function o(e,t){var s=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(s!=null){var n,a,p,i,f=[],u=!0,O=!1;try{if(p=(s=s.call(e)).next,t===0){if(Object(s)!==s)return;u=!1}else for(;!(u=(n=p.call(s)).done)&&(f.push(n.value),f.length!==t);u=!0);}catch(Y){O=!0,a=Y}finally{try{if(!u&&s.return!=null&&(i=s.return(),Object(i)!==i))return}finally{if(O)throw a}}return f}}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(V);var nr=V.exports,X={exports:{}};(function(r){function o(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
| 3 |
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports})(X);var ar=X.exports;(function(r){var o=sr,e=nr,t=U,s=ar;function n(a,p){return o(a)||e(a,p)||t(a,p)||s()}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports})(J);var vr=J.exports,x={exports:{}},c={exports:{}},A;function pr(){return A||(A=1,function(r){function o(e,t){if(e==null)return{};var s={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;s[n]=e[n]}return s}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports}(c)),c.exports}var j;function br(){return j||(j=1,function(r){var o=pr();function e(t,s){if(t==null)return{};var n,a,p=o(t,s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],s.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(p[n]=t[n])}return p}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(x)),x.exports}var l={exports:{}},T;function _r(){return T||(T=1,function(r){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports}(l)),l.exports}var y={exports:{}},M;function hr(){return M||(M=1,function(r){var o=H;function e(s,n){for(var a=0;a<n.length;a++){var p=n[a];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(s,o(p.key),p)}}function t(s,n,a){return n&&e(s.prototype,n),a&&e(s,a),Object.defineProperty(s,"prototype",{writable:!1}),s}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports}(y)),y.exports}var v={exports:{}},b={exports:{}},g;function ir(){return g||(g=1,function(r){function o(e,t){return r.exports=o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,n){return s.__proto__=n,s},r.exports.__esModule=!0,r.exports.default=r.exports,o(e,t)}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports}(b)),b.exports}var C;function Pr(){return C||(C=1,function(r){var o=ir();function e(t,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(s&&s.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),s&&o(t,s)}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports}(v)),v.exports}var _={exports:{}},I;function dr(){return I||(I=1,function(r){function o(e){return r.exports=o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r.exports.__esModule=!0,r.exports.default=r.exports,o(e)}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports}(_)),_.exports}var h={exports:{}},P={exports:{}},E;function ur(){return E||(E=1,function(r){function o(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.exports=o,r.exports.__esModule=!0,r.exports.default=r.exports}(P)),P.exports}var w;function Or(){return w||(w=1,function(r){var o=d.default,e=ur();function t(s,n){if(n&&(o(n)=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return e(s)}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports}(h)),h.exports}export{xr as _,cr as a,_r as b,hr as c,d,Z as e,br as f,Pr as g,Or as h,lr as i,dr as j,rr as k,sr as l,er as m,ar as n,ur as r,vr as s,yr as t,U as u};
|
|
|
|
|
|
|
|
|
|
|
|
dist/assets/{processCompressedAESFile-405b7aba.js → processCompressedAESFile-fac57b0a.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{umi-2cc549ef.js → umi-a044fd32.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{useAsync-a87a60de.js → useAsync-0af7a050.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as c}from"./umi-
|
|
|
|
| 1 |
+
import{r as c}from"./umi-a044fd32.js";import{f}from"./_setToString-1e1135c3.js";function e(o,r){r===void 0&&(r=[]);var t=f(o,r,{loading:!0}),n=t[0],a=t[1];return c.useEffect(function(){a()},[a]),n}export{e as u};
|
dist/assets/{useDebounce-84d2d30c.js → useDebounce-51aac85c.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{useIntersection-d83075c4.js → useIntersection-970b9f71.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{r as u}from"./umi-
|
|
|
|
| 1 |
+
import{r as u}from"./umi-a044fd32.js";var a=function(e,r){var t=u.useState(null),o=t[0],n=t[1];return u.useEffect(function(){if(e.current&&typeof IntersectionObserver=="function"){var s=function(i){n(i[0])},c=new IntersectionObserver(s,r);return c.observe(e.current),function(){n(null),c.disconnect()}}return function(){}},[e.current,r.threshold,r.root,r.rootMargin]),o};const v=a;export{v as u};
|
dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
| 6 |
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
| 7 |
<title>STARRY</title>
|
| 8 |
-
<script type="module" crossorigin src="/assets/umi-
|
| 9 |
<link rel="stylesheet" href="/assets/umi-cc99a795.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
| 6 |
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
| 7 |
<title>STARRY</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/umi-a044fd32.js"></script>
|
| 9 |
<link rel="stylesheet" href="/assets/umi-cc99a795.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
dist/pdf.worker.min.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|