diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 91650aca..cc9dda31 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/packages/chord-chart-studio/build/assets/index-B0ChhUNb.js b/packages/chord-chart-studio/build/assets/index-B0ChhUNb.js deleted file mode 100644 index ff27e380..00000000 --- a/packages/chord-chart-studio/build/assets/index-B0ChhUNb.js +++ /dev/null @@ -1,60 +0,0 @@ -import{c as Ft,_ as Nt,a as Tt,d as St,b as wt,e as qe,f as L,g as k,p as J,h as _t,i as Et,j as qt,k as Pt,t as It,v as Pe,R as C,l as r,P as i,m as Ie,n as Mt,U as Ot,o as Lt,q as Me,u as Oe,r as R,s as ve,w as kt,x as T,y as Fe,z as Bt,A as At,B as Dt,C as Wt,D as Gt,F as Ht,E as $t,G as Ne,H as zt,I as Vt,J as Ut,S as Kt,K as Yt,L as Jt,M as Qt,N as Xt,O as Te,Q as Zt}from"./vendor-B9p68kIM.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();const en=()=>{try{const e=localStorage.getItem("state");return e?JSON.parse(e):void 0}catch{return}},tn=e=>{try{const t=JSON.stringify(e);localStorage.setItem("state",t)}catch{}};function Le(){return Date.now()}const B="db/files/Create",A="db/files/Delete",I="db/files/Import",Q="db/files/Update",X="db/options/setOptionValue",D="ui/layout/app/setEditorMode",ke="ui/layout/app/toggleLeftBar",Be="ui/layout/app/toggleRightBar",nn=e=>e.ui.layout.app.isLeftBarCollapsed,rn=e=>e.ui.layout.app.isRightBarCollapsed,E=e=>e.ui.layout.app.editorMode,S=e=>e.fileManager.selected,sn=e=>e.fileManager.renamed,on=e=>e.fileManager.defaultTitle,an=Ft(St,wt),Z=an(e=>Nt(e.db.files.allFiles,({title:t,id:n})=>({title:t,id:n})),e=>Tt(e,t=>t.title.toLowerCase())),ee=(e,t)=>e.db.files.allFiles[t],te=(e,t,n)=>{const s=e.db.files.allFiles[t];if(s&&(s.options||{})[n])return Object.keys(s.options[n]).length===0?void 0:qe(s.options[n])},Ae=(e,t)=>{const n=e.db.files.allFiles[t];if(!n)return;const s=n.options||{},o=[];if(s.edit&&o.push({...s.edit}),s.play&&o.push({...s.play}),s.print&&o.push({...s.print}),s.export&&o.push({...s.export}),!!o.length)return o.sort((a,l)=>a.updatedAt-l.updatedAt),o.reduce((a,l)=>Object.assign(a,l),{})},ne={edit:["theme","transposeValue","preferredAccidentals","symbolType"],play:["theme","transposeValue","preferredAccidentals","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy","columnsCount","fontSize"],print:["transposeValue","preferredAccidentals","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy","columnsCount","columnBreakOnSection","documentMargins","fontSize"],export:["chartFormat","transposeValue","preferredAccidentals","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy"]},ln={allFiles:{}};function cn(e,t){const{id:n,title:s,content:o}=t.payload,a={...e.allFiles};return a[n]={id:n,title:s,content:o},{...e,allFiles:a}}function dn(e,t){const{id:n,title:s,content:o}=t.payload;if(!s&&typeof o>"u"||!e.allFiles[n])return e;const a={...e.allFiles};return a[n]={...a[n]},s&&(a[n].title=s),typeof o<"u"&&(a[n].content=o),{...e,allFiles:a}}function un(e,t){const{id:n}=t.payload;if(!n||!e.allFiles[n])return e;const s={...e.allFiles};return delete s[n],{...e,allFiles:s}}function pn(e,t,n){const{context:s,key:o,value:a}=t.payload,l=S(n),c={...e.allFiles};if(["songFormatting","songPreferences"].includes(s)&&c[l]){const d=E(n),u=s==="songPreferences"?"preferences":d;return c[l]=mn(c[l],u,o,a),{...e,allFiles:c}}return e}function mn(e,t,n,s){return{...e,options:{...e.options,[t]:{...(e.options||{})[t],updatedAt:Le(),[n]:s}}}}function hn(e,t,n){const s=S(n),o=t.payload.mode;if(!!!te(n,s,o)){const l=L(Ae(n,s)||{},ne[o]);if(Object.keys(l).length){l.updatedAt=Le();const c={...e.allFiles};return c[s]={...c[s],options:{...c[s].options,[o]:l}},{...e,allFiles:c}}}return e}const gn=(e=ln,t={},n={})=>{switch(t.type){case B:case I:return cn(e,t);case Q:return dn(e,t);case A:return un(e,t);case X:return pn(e,t,n);case D:return hn(e,t,n)}return e},re="fileManager/select",De="fileManager/enableRename",p=(e,t,n)=>{if(!(!e.db.options[t]||!e.db.options[t].values||typeof e.db.options[t].values[n]>"u"))return e.db.options[t].values[n]},P=(e,t)=>{if(!(!e.db.options[t]||!e.db.options[t].defaults))return qe(e.db.options[t].defaults)},fn={};function yn(e,t){const{context:n,key:s,value:o}=t.payload;if(!e[n]||!e[n].values||typeof e[n].values[s]>"u")return e;const a={...e,[n]:{...e[n],values:{...e[n].values}}};return a[n].values[s]=o,a}function bn(e,t,n){const s=S(n),o=t.payload.mode,a=We(n,s,o);return{...e,songFormatting:{...e.songFormatting,values:{...a}}}}function We(e,t,n){const s=P(e,"songFormatting");let o=te(e,t,n);return o||(o=Ae(e,t)||{}),delete o.updatedAt,o=L(o,ne[n]),Object.assign(s,o)}function xn(e,t,n){const{id:s}=t.payload,o=E(n),a=We(n,s,o),l=te(n,s,"preferences")||{};delete l.updatedAt;const c=P(n,"songPreferences"),d=Object.assign(c,l);return{...e,songPreferences:{...e.songPreferences,values:{...d}},songFormatting:{...e.songFormatting,values:{...a}}}}const Cn=(e=fn,t={},n={})=>{switch(t.type){case X:return yn(e,t);case D:return bn(e,t,n);case re:return xn(e,t,n)}return e},jn=k({files:gn,options:Cn}),Rn={selected:"",renamed:"",defaultTitle:"[untitled]"};function vn(e=Rn,t={}){switch(t.type){case B:{const{id:n}=t.payload;return{...e,selected:n,renamed:n}}case I:{const{id:n}=t.payload;return{...e,selected:n,renamed:""}}case Q:return{...e,renamed:""};case A:return{...e,selected:"",renamed:""};case re:{const{id:n}=t.payload;return{...e,selected:n,renamed:n===e.renamed?n:""}}case De:{const{id:n}=t.payload;return{...e,renamed:n}}}return e}const Ge="songImporter/import/cancel",se="songImporter/import/start",He="songImporter/setContent",$e="songImporter/setInputFormat";function q(e){return J.sanitize(e,{ALLOWED_TAGS:["#text"],KEEP_CONTENT:!0})}const Fn={content:"",isFromWeb:!1,isImporting:!1,inputFormat:"auto",title:""};function Nn(e=Fn,t={}){switch(t.type){case He:{const{content:n,title:s=""}=t.payload;return{...e,content:q(n),title:s?q(s):e.title}}case $e:{const{inputFormat:n}=t.payload;return{...e,inputFormat:n}}case I:case Ge:return{...e,content:"",title:"",isImporting:!1};case se:{const{content:n,inputFormat:s,title:o,isFromWeb:a}=t.payload;return{...e,isImporting:!0,content:n?q(n):"",title:o?q(o):"",inputFormat:s||e.inputFormat,isFromWeb:a}}}return e}const Tn={isLeftBarCollapsed:!1,isRightBarCollapsed:!1,editorMode:"edit",activeModal:"none"};function Sn(e=Tn,t={}){switch(t.type){case ke:return{...e,isLeftBarCollapsed:!e.isLeftBarCollapsed};case Be:return{...e,isRightBarCollapsed:!e.isRightBarCollapsed};case D:{const{mode:n}=t.payload;return{...e,editorMode:n}}case A:case B:case I:return{...e,editorMode:"edit"}}return e}const wn=k({app:Sn}),_n=k({layout:wn}),En=k({db:jn,fileManager:vn,songImporter:Nn,ui:_n}),qn={editorPreferences:{values:{theme:"dark1",chartFormat:"chordmark"},defaults:{theme:"dark1",chartFormat:"chordmark"}},songPreferences:{values:{transposeValue:0,preferredAccidentals:"auto",symbolType:"chord"},defaults:{transposeValue:0,preferredAccidentals:"auto",symbolType:"chord"}},songFormatting:{values:{chartType:"all",alignChordsWithLyrics:!0,alignBars:!0,autoRepeatChords:!0,expandSectionCopy:!0,fontSize:0,columnsCount:1,columnBreakOnSection:!0,documentMargins:3},defaults:{chartType:"all",alignChordsWithLyrics:!0,alignBars:!0,autoRepeatChords:!0,expandSectionCopy:!0,fontSize:0,columnsCount:1,columnBreakOnSection:!0,documentMargins:3}}},Pn={options:qn},In={db:Pn};let O;function Mn(){const e=_t(Et(It)),t=en();t&&t.db&&t.db.options&&delete t.db.options.rendering;const n=qt(t,In);O=Pt(En,n,e),O.subscribe(()=>{tn(O.getState())})}function W(){return O}function v(e,t){if(!e)throw new TypeError("Cannot create an action without an action type");return{type:e,payload:t}}const On=(e,t)=>v(He,{content:e,title:t}),Ln=e=>v($e,{inputFormat:e}),kn=()=>v(se,{isFromWeb:!1}),Bn=(e,t,n)=>v(se,{content:t,inputFormat:e,title:n,isFromWeb:!0}),An=()=>v(Ge),Dn={"@CCS/IMPORT_TAB":e=>{const t=W(),n=Wn(e.title,e.artist);t.dispatch(Bn(e.inputFormat,e.chordChart,n))}},Wn=(e,t)=>"_"+(t?t+" - ":"")+e;function Gn(){return Dn}function Hn(){window.addEventListener("message",$n)}const $n=e=>{const t={...Gn()};if(e.source!==window||e.origin!==window.location.origin)return!1;const n=e.data;return typeof t[n.type]=="function"&&t[n.type](n.payload),!0},zn=(e,t="")=>{if(!e)throw new TypeError("Cannot create a file without title");const n={id:Pe(),title:e,content:t};return v(B,n)},U=(e,t="")=>{if(!e)throw new TypeError("Cannot import a file without title");const n={id:Pe(),title:e,content:t};return v(I,n)},ze=(e,{title:t,content:n}={})=>{if(!e)throw new TypeError("Cannot update a file without an id");return v(Q,{id:e,title:t,content:n})},Vn=e=>v(A,{id:e}),Un=`Welcome to Chord Chart Studio! - -Chord Chart Studio is the official editor of the ChordMark format. -You can use it to quickly write accurate transcription of songs made up of chords and lyrics. - -A % D7.. E7.. -_Just write _some chords, some _lyrics -% -_And see how it _looks: _terrific! - -Where to start? You can either: -- check the sample song on the left -- read the user guide, by clicking the big yellow button in the top right corner - -Have fun! -`,Kn=`#i -C.. Am.. % -% - -#v -C.. Am.. -I _heard there was a _secret chord -% -That _David played and it _pleased the lord -F... G. C.. G.. -But _you don't really care for _music, _do you? -C.. F. G. -Well it _goes like this the _fourth, the _fifth -Am.. F.. -The _minor fall and the _major lift -G.. E7.. Am -The _baffled king com_posing halle_lujah - -#c -F -Halle_lujah -Am -Halle_lujah -F -Halle_lujah -C.. G.. C.. Am.. -Halle_lu_u_jah - -#v -Well, your _faith was strong but you _needed proof -You _saw her bathing _on the roof -Her _beauty and the moonlight _over_threw you -She _tied you to her _kitchen _chair -She _broke your throne and she _cut your hair -And _from your lips she _drew the halle_lujah - -#c -`;function Yn(){const e=W(),t=e.getState();Z(t).length===0&&(e.dispatch(U("Hallelujah - Leonard Cohen",Kn)),e.dispatch(U("Getting started",Un)))}class Ve extends C.Component{constructor(t){super(t),this.state={error:null,errorInfo:null}}componentDidCatch(t,n){this.setState({error:t,errorInfo:n})}render(){return this.state.errorInfo?r.jsxs("div",{className:"ErrorBoundary",children:[r.jsx("h2",{children:"Something went wrong"}),r.jsxs("details",{style:{whiteSpace:"pre-wrap"},open:!0,children:[this.state.error&&this.state.error.toString(),r.jsx("br",{}),this.state.errorInfo.componentStack]})]}):this.props.children}}Ve.propTypes={children:i.any};let z;function Jn(e,t){const n=document.getElementById("app");z||(z=Ie(n)),z.render(r.jsx(Mt,{store:W(),children:r.jsx(C.StrictMode,{children:r.jsx(Ve,{children:r.jsx(e,{...t})})})}))}const Qn={base:"/app"};let K,Ue;const Xn={init(e){const t=e.map(n=>({...n,path:Qn.base+n.path,action:s=>({Controller:n.action,params:s.params})}));K=new Ot(t,{errorHandler(n,s){console.error(`Error: Cannot find route for path: ${s.pathname}`)}}),Ue=Lt(K,{stringifyQueryParams:Me.stringify})}};function G(e,t=!0){const n=new URL(e,window.location.origin);return K.resolve(n.pathname).then(({Controller:s,params:o}={})=>{if(s){t&&Zn(e);const a=Me.parse(n.search,{ignoreQueryPrefix:!0});Jn(s,{...o,...a})}})}function Ke(e,t){try{return Ue(e,t)}catch(n){console.error(n.toString())}}function Zn(e){window.history.pushState({url:e},null,e)}window.addEventListener("popstate",()=>{const e=window.location.pathname+window.location.search;G(e,!1)});const er="_button_6sdae_1",tr="_buttonContent_6sdae_5",Se={button:er,buttonContent:tr};function nr({children:e,onClick:t}){return r.jsx("div",{className:Se.button,onClick:t,children:r.jsx("div",{className:Se.buttonContent,children:e})})}function rr(){const t=Oe(Z).map(n=>r.jsx(sr,{song:n},n.id));return r.jsxs("div",{children:["Full Library",r.jsx("ul",{children:t}),r.jsx(nr,{children:"My Nice Button"})]})}const sr=({song:e})=>{const t=n=>{n.preventDefault(),G(Ke("songView",{songId:e.id}))};return r.jsx("li",{children:r.jsx("a",{href:`/song/${e.id}`,onClick:t,children:e.title})})},ir=[{name:"library",path:"/library",action:rr}];function or({songId:e}){const t=Oe(s=>ee(s,e)),n=s=>{s.preventDefault(),G(Ke("library"))};return r.jsxs("div",{children:[r.jsx("a",{href:"",onClick:n,children:"Go back to list"}),r.jsx("br",{}),r.jsx("b",{children:t.title}),r.jsx("p",{children:t.content})]})}const ar=[{name:"songView",path:"/songView/:songId",action:or}],Ye=e=>v(D,{mode:e}),lr=()=>v(ke),cr=()=>v(Be),dr="/app/assets/logo-D2B3txiq.svg";function ur(){return r.jsx("div",{className:"logo",children:r.jsx("div",{className:"logo-isExpanded",children:r.jsx("div",{className:"logo-img",children:r.jsxs("svg",{className:"stacked",children:[r.jsx("title",{children:"Chord Chart Studio"}),r.jsx("use",{href:dr+"#stacked"})]})})})})}const pr=C.memo(ur);function Je(e){const{iconName:t}=e,n=["icon","material-icons"];return r.jsx("i",{className:n.join(" "),children:t})}Je.propTypes={iconName:i.string.isRequired};const x=C.memo(Je);function Qe(e){const{label:t,icon:n,editorMode:s,setEditorMode:o,isActive:a,isDisabled:l}=e,c=["mainNavEntry"];a&&c.push("mainNavEntry-isActive"),l&&c.push("mainNavEntry-isDisabled");function d(){l||o(s)}return r.jsxs("li",{className:c.join(" "),onClick:d,children:[r.jsx("span",{className:"mainNavEntry-icon",children:r.jsx(x,{iconName:n})}),t]})}Qe.propTypes={label:i.string.isRequired,icon:i.string.isRequired,editorMode:i.string.isRequired,setEditorMode:i.func.isRequired,isActive:i.bool.isRequired,isDisabled:i.bool.isRequired};const mr=C.memo(Qe);function Xe(e){const{currentMode:t,allEntries:n,setEditorMode:s,selectedId:o}=e;return r.jsx("nav",{className:"mainNav",children:r.jsx("ul",{className:"mainNav-entries",children:n.map((a,l)=>r.jsx(mr,{isActive:!!o&&a.editorMode===t,isDisabled:!o,setEditorMode:s,...a},l))})})}Xe.propTypes={currentMode:i.string.isRequired,setEditorMode:i.func.isRequired,selectedId:i.string,allEntries:i.arrayOf(i.shape({id:i.string.isRequired,label:i.string.isRequired,icon:i.string.isRequired,editorMode:i.string.isRequired}))};const hr=C.memo(Xe),_=({children:e,isDisabled:t,buttonName:n,onClick:s,type:o})=>{const a=["Button"];return o==="primary"&&a.push("Button-primary"),o==="secondary"&&a.push("Button-secondary"),t&&a.push("Button-isDisabled"),r.jsx("button",{className:a.join(" "),disabled:t,type:"button",name:n,onClick:s,children:e})};_.propTypes={children:i.string.isRequired,isDisabled:i.bool,buttonName:i.string.isRequired,type:i.string.isRequired,onClick:i.func.isRequired};_.defaultProps={isDisabled:!1};const gr="https://chord-chart-studio.netlify.app",ie=()=>{const e=()=>{window.open(gr,"_blank").focus()};return r.jsxs("div",{className:"userGuide",children:[r.jsx("div",{className:"userGuide-isCollapsed",children:r.jsx(x,{iconName:"help_outline"})}),r.jsx("div",{className:"userGuide-isExpanded",children:r.jsx(_,{buttonName:"userGuide",type:"primary",onClick:e,children:"User Guide"})})]})};ie.propTypes={};ie.defaultProps={};const fr=C.memo(ie),yr=()=>({"chord-chart-studio":"v0.14.0","chord-symbol":"v4.0.0","chord-mark":"v0.16.2"});function br(){const e=yr();return r.jsx("div",{className:"versions",children:r.jsxs("div",{className:"versions-isExpanded",children:["Chord Chart Studio ",e["chord-chart-studio"],r.jsx("br",{}),"ChordSymbol ",e["chord-symbol"]," ",r.jsx("br",{}),"ChordMark ",e["chord-mark"]," ",r.jsx("br",{}),"Logo by"," ",r.jsx("a",{href:"https://spelling-bee-assistant.app/",target:"_blank",rel:"noreferrer",children:"Dieter Raber"})]})})}const xr=C.memo(br),Cr=e=>e.songImporter.content,jr=e=>e.songImporter.inputFormat,Rr=e=>e.songImporter.title,vr=e=>e.songImporter.isImporting,Fr=e=>e.songImporter.isFromWeb;function oe(e){const{children:t,closeModal:n}=e;return R.useEffect(()=>{const s=o=>{o.key==="Escape"&&n()};return window.addEventListener("keyup",s),()=>{window.removeEventListener("keyup",s)}}),r.jsxs("section",{className:"mod-ModalContainer",children:[r.jsx("div",{className:"mod-Overlay",onClick:n,"data-testid":"modal-overlay"}),r.jsx("div",{className:"mod-ContentContainer",children:t})]})}oe.propTypes={children:i.element.isRequired,closeModal:i.func.isRequired};const Ze=({cancelImport:e,chordMarkContent:t,importFile:n,title:s,content:o,error:a})=>{const l=s?'Import "'+s+'"':"Import song",c=()=>{n(s||"[untitled]",t)};return r.jsxs("div",{className:"sim-Header_Container",children:[r.jsx("div",{className:"sim-Header_Title",children:l}),r.jsxs("div",{className:"sim-Header_Actions",children:[r.jsx(_,{onClick:e,buttonName:"cancel",type:"secondary",children:"CANCEL"}),r.jsx(_,{onClick:c,buttonName:"import",type:"primary",isDisabled:o===""||a!=="",children:"IMPORT"})]})]})};Ze.propTypes={cancelImport:i.func.isRequired,chordMarkContent:i.string,content:i.string,error:i.string,importFile:i.func.isRequired,title:i.string};const et=50*1024,Nr=e=>new Promise((t,n)=>{if(e.length){const s=e[0];Sr(s)?n(_r(s.size)):wr(s)?s.text().then(o=>{t({content:o,title:Tr(s)})}).catch(o=>{n(o)}):n(Er(s))}else n(qr())}),Tr=e=>e.name.substr(0,e.name.lastIndexOf(".")),Sr=e=>e.size>et,wr=e=>e.type.indexOf("text")===0||e.type.length===0,_r=e=>"The selected file is too big: "+ve(e,{round:0})+" (maximum allowed file size is "+ve(et,{round:0})+").",Er=e=>"Cannot import file of type "+e.type+".",qr=()=>"No file selected.",Pr="text/*,.cho,.crd,.chopro,.chord,.pro,.txt,.md",tt=({setContent:e})=>{const t=n=>{Nr(n.target.files).then(s=>{e(s.content,s.title)}).catch(s=>{e(s)})};return r.jsxs("div",{children:[r.jsx("label",{htmlFor:"importSong-Input",className:"Button Button-primary",children:"Select File"}),r.jsx("input",{id:"importSong-Input",name:"importSong-Input",type:"file",className:"sim-InputFile_Input",onChange:t,accept:Pr})]})};tt.propTypes={setContent:i.func.isRequired};function ae(e){const{content:t,setContent:n,isDisabled:s}=e,o=l=>{n(l.target.value)},a=["sim-Input_Textarea"];return s&&a.push("sim-Input_Textarea-Disabled"),r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"sim-Input_Header",children:[r.jsx(x,{iconName:"arrow_drop_down"}),"Copy/paste below",r.jsx(x,{iconName:"arrow_drop_down"})]}),r.jsx("textarea",{className:a.join(" "),onChange:o,value:t,disabled:s,"data-testid":"sim-input"})]})}ae.propTypes={content:i.string.isRequired,isDisabled:i.bool.isRequired,setContent:i.func.isRequired};ae.defaultProps={};function le(e){const{inputFormat:t,error:n}=e;return r.jsxs("div",{className:"sim-Preview_Error",children:[r.jsxs("p",{children:["There was an error when trying to parse the song in the specified input format (",t,").",r.jsx("br",{}),"Please correct the input or try another format.",r.jsx("br",{}),"The error was:"]}),r.jsxs("p",{children:['"',n,'"']}),r.jsx("p",{children:'Hint: most of the time, this is related to an unclosed "[" or "{" or an unsupported ChordPro directive'})]})}le.propTypes={error:i.string,inputFormat:i.string.isRequired};le.defaultProps={};function ce(e){const{setInputFormat:t,inputFormat:n,id:s,label:o,isDisabled:a}=e,l=u=>{a||t(u.target.value)},c=["sim-InputFormat_Entry"],d=["sim-InputFormat_Label"];return a&&(c.push("sim-InputFormat_Entry-Disabled"),d.push("sim-InputFormat_Label-Disabled")),r.jsxs(r.Fragment,{children:[r.jsx("input",{className:c.join(" "),type:"radio",name:"inputFormat",id:s,value:s,onChange:l,checked:n===s}),r.jsx("label",{className:d.join(" "),htmlFor:s,children:o})]})}ce.propTypes={setInputFormat:i.func.isRequired,inputFormat:i.string.isRequired,id:i.string.isRequired,label:i.string.isRequired,isDisabled:i.bool.isRequired};ce.defaultProps={};const Ir=[{id:"auto",label:"Detect"},{id:"chordPro",label:"Bracketed chords (ChordPro)"},{id:"chordsOverLyrics",label:"Chords over lyrics (Ultimate Guitar...)"}];function de(e){const{setInputFormat:t,inputFormat:n,disableAll:s}=e,o=Ir.map(a=>r.jsx(ce,{setInputFormat:t,id:a.id,label:a.label,inputFormat:n,isDisabled:s},a.id));return r.jsxs("div",{className:"sim-InputFormat",children:["Input format:",o]})}de.propTypes={disableAll:i.bool.isRequired,setInputFormat:i.func.isRequired,inputFormat:i.string.isRequired};de.defaultProps={};function ue(e){const{cancelImport:t,content:n,importFile:s,isFromWeb:o,isImporting:a,setContent:l,setInputFormat:c,inputFormat:d,title:u}=e;if(!a)return null;let h="",m="";try{h=kt(n,{inputFormat:d})}catch(f){m=f.message}return r.jsx(oe,{closeModal:t,children:r.jsxs("div",{className:"sim-SongImporterModal_Container","data-testid":"song-importer",children:[r.jsx(Ze,{cancelImport:t,chordMarkContent:h,content:n,error:m,importFile:s,title:u}),r.jsxs("div",{className:"sim-TwoColumns_Container",children:[r.jsx("div",{className:"sim-Column_Container",children:r.jsx(tt,{setContent:l})}),r.jsx("div",{className:"sim-Column_Container",children:r.jsx(de,{inputFormat:d,setInputFormat:c,disableAll:o===!0})})]}),r.jsxs("div",{className:"sim-TwoColumns_Container sim-TwoColumns_Container-autoHeight",children:[r.jsx("div",{className:"sim-Column_Container",children:r.jsx(ae,{content:n,setContent:l,isDisabled:o})}),r.jsxs("div",{className:"sim-Column_Container",children:[r.jsxs("div",{className:"sim-Input_Header",children:[r.jsx(x,{iconName:"arrow_drop_down"}),"ChordMark preview",r.jsx(x,{iconName:"arrow_drop_down"})]}),r.jsx("div",{className:"sim-Preview_Container","data-testid":"sim-preview",children:m?r.jsx(le,{inputFormat:d,error:m}):h})]})]})]})})}ue.propTypes={cancelImport:i.func.isRequired,content:i.string.isRequired,importFile:i.func.isRequired,isFromWeb:i.bool.isRequired,isImporting:i.bool.isRequired,setContent:i.func.isRequired,setInputFormat:i.func.isRequired,inputFormat:i.string.isRequired,title:i.string};ue.defaultProps={};const Mr=T(e=>({content:Cr(e),isFromWeb:Fr(e),isImporting:vr(e),inputFormat:jr(e),title:Rr(e)}),{setContent:On,setInputFormat:Ln,cancelImport:An,importFile:U})(ue),Or=[{id:"edit",label:"Edit",icon:"create",editorMode:"edit"},{id:"play",label:"Screen view",icon:"music_note",editorMode:"play"},{id:"print",label:"Print/PDF Preview",icon:"print",editorMode:"print"},{id:"export",label:"Export Preview",icon:"save_alt",editorMode:"export"}];function pe(e){const{editorMode:t,isLeftBarCollapsed:n,isRightBarCollapsed:s,toggleLeftBar:o,toggleRightBar:a,setEditorMode:l,selectedId:c,leftBar:d,rightBar:u}=e,h=["leftBar"];n&&h.push("leftBar-isCollapsed");const m=["rightBar"];return s&&m.push("rightBar-isCollapsed"),r.jsxs("div",{className:"appLayout-wrapper",children:[r.jsx(Mr,{}),r.jsxs("section",{className:h.join(" "),children:[r.jsxs("div",{className:"leftBar-content",onClick:n?o:null,children:[r.jsx(pr,{}),d]}),r.jsx("div",{className:"leftBar-collapser",onClick:o,"data-testid":"leftBar-collapser",children:r.jsx("span",{className:"leftBar-collapserIcon",children:r.jsx(x,{iconName:"keyboard_arrow_left"})})})]}),r.jsxs("section",{className:"appLayout-main",children:[r.jsx("section",{className:"appLayout-header",children:r.jsx(hr,{allEntries:Or,currentMode:t,setEditorMode:l,selectedId:c})}),r.jsx("section",{className:"appLayout-content",children:e.children})]}),r.jsxs("section",{className:m.join(" "),children:[r.jsx("div",{className:"rightBar-collapser",onClick:a,"data-testid":"rightBar-collapser",children:r.jsx("span",{className:"rightBar-collapserIcon",children:r.jsx(x,{iconName:"keyboard_arrow_right"})})}),r.jsxs("div",{className:"rightBar-content",onClick:s?a:null,children:[r.jsx(fr,{}),u,r.jsx(xr,{})]})]})]})}pe.propTypes={children:i.element,isLeftBarCollapsed:i.bool,isRightBarCollapsed:i.bool,selectedId:i.string,toggleLeftBar:i.func.isRequired,toggleRightBar:i.func.isRequired,editorMode:i.string.isRequired,setEditorMode:i.func.isRequired,leftBar:i.element.isRequired,rightBar:i.element.isRequired};pe.defaultProps={isLeftBarCollapsed:!1,isRightBarCollapsed:!1};const Lr=T(e=>({editorMode:E(e),isLeftBarCollapsed:nn(e),isRightBarCollapsed:rn(e),selectedId:S(e)}),{toggleLeftBar:lr,toggleRightBar:cr,setEditorMode:Ye})(pe),kr=e=>v(re,{id:e}),Br=e=>v(De,{id:e});function Ar(e,t={},n=!1){return rt(e,t,n,"text")}function nt(e,t={},n=!1){return rt(e,t,n,"html")}function rt(e,t,n,s){if(n)switch(t.chartFormat){case"chordmark":{const a=M(e,t);return s==="html"?a:we(a)}case"chordmarkSrc":return s==="html"?V(e):e;case"chordpro":{t.customRenderer=Dt();const a=M(e,t);return s==="html"?V(a):a}case"ultimateGuitar":{t.customRenderer=Fe();const a=M(e,{...t,customRenderer:Fe(),printBarSeparators:"grids",printChordsDuration:"never",printSubBeatDelimiters:!1,printInlineTimeSignatures:!1,chordSymbolRenderer:Bt({customFilters:[At()],useShortNamings:!0,accidentalsType:t.accidentalsType==="auto"?"original":t.accidentalsType,...t})})+` - -Created with Chord Chart Studio (https://chord-chart-studio.netlify.app)`;return s==="html"?V(a):a}}const o=M(e,{...t,wrapChordLyricLines:!0});return s==="html"?o:we(o)}function M(e,t){try{const n=Wt(e);return Gt(n,{...t})}catch(n){return n.message}}function V(e){return e.split(` -`).map(t=>t===""?" ":t).map(t=>`${t}`).join("")}function we(e){return e.match(/(.*?<\/p>)/gm).map(n=>q(n)).map(n=>n===" "?"":n).join(` -`)}function Dr(){const t=W().getState(),n=S(t),s=ee(t,n),o={chartFormat:p(t,"editorPreferences","chartFormat"),transposeValue:p(t,"songPreferences","transposeValue"),accidentalsType:p(t,"songPreferences","accidentalsType"),symbolType:p(t,"songPreferences","symbolType"),chartType:p(t,"songFormatting","chartType"),alignChordsWithLyrics:p(t,"songFormatting","alignChordsWithLyrics"),alignBars:p(t,"songFormatting","alignBars"),autoRepeatChords:p(t,"songFormatting","autoRepeatChords"),expandSectionCopy:p(t,"songFormatting","expandSectionCopy")},a=Ar(s.content,o,!0),l=o.chartFormat==="chordpro"?"cho":"txt",c=`${s.title}.${l}`,d=new Blob([a],{type:"text/plain;charset=utf-8",endings:"native"});Ht.saveAs(d,c)}function st(e){const{confirmAction:t,confirmTitle:n="OK",cancelAction:s,cancelTitle:o="CANCEL",children:a}=e;return r.jsx(oe,{closeModal:s,children:r.jsxs("section",{className:"mod-ModalConfirmContainer",children:[r.jsx("div",{className:"mod-ModalConfirmMessage",children:a}),r.jsxs("div",{className:"mod-ModalConfirmButtons",children:[r.jsx(_,{onClick:s,type:"secondary",buttonName:"cancel",children:o}),r.jsx(_,{onClick:t,type:"primary",buttonName:"confirm",children:n})]})]})})}st.propTypes={confirmAction:i.func.isRequired,confirmTitle:i.string,cancelAction:i.func.isRequired,cancelTitle:i.string,children:i.node.isRequired};function it(e){const{selected:t,deleteFile:n,isDeleting:s,setIsDeleting:o}=e;if(!s)return null;const a=()=>o(!1),l=()=>{o(!1),n(t)};return r.jsxs(st,{confirmAction:l,confirmTitle:"DELETE",cancelAction:a,children:["Are you sure you want to delete this file?",r.jsx("br",{}),"This action cannot be undone."]})}it.propTypes={deleteFile:i.func.isRequired,isDeleting:i.bool.isRequired,selected:i.string.isRequired,setIsDeleting:i.func.isRequired};function ot(e){const{icon:t,text:n,action:s,isDisabled:o}=e,a=["fileManagerAction"];o&&a.push("fileManagerAction-isDisabled");const l=()=>{o||s()};return r.jsx("span",{className:a.join(" "),onClick:l,children:r.jsxs("span",{className:"fileManagerAction-icon",children:[r.jsx(x,{iconName:t})," ",n]})})}ot.propTypes={icon:i.string.isRequired,text:i.string.isRequired,action:i.func.isRequired,isDisabled:i.bool.isRequired};const Wr=C.memo(ot);function at(e){const{selected:t,createFile:n,deleteFile:s,enableRename:o,startImport:a,exportAsText:l,printFile:c}=e,d=[{icon:"upload",text:"Import",action:a,isDisabled:!1},{icon:"add_circle",text:"New",action:n,isDisabled:!1},{icon:"create",text:"Rename",action:o,isDisabled:!t},{icon:"delete",text:"Delete",action:s,isDisabled:!t},{icon:"print",text:"Print",action:c,isDisabled:!t},{icon:"download",text:"Export",action:l,isDisabled:!t}];return r.jsx("div",{className:"fileManager-actionsList",children:d.map((u,h)=>R.createElement(Wr,{...u,key:h}))})}at.propTypes={selected:i.string,createFile:i.func.isRequired,deleteFile:i.func.isRequired,enableRename:i.func.isRequired,exportAsText:i.func.isRequired,printFile:i.func.isRequired,startImport:i.func.isRequired};const Gr=C.memo(at);function lt(e){const[t,n]=R.useState(e.title),{fileId:s,isSelected:o,isRenamed:a,defaultTitle:l,selectFile:c,enableRename:d,updateFile:u}=e,h=["fileManagerEntry"];o&&h.push("fileManagerEntry-isSelected"),a&&h.push("fileManagerEntry-isRenamed");const m=C.createRef();R.useEffect(()=>{a&&m.current.focus()},[a,m]);function f(){o||c(s)}function g(b){a||(d(s),b.target.select())}function y(b){if(a&&b.which===13){b.preventDefault(),window.getSelection().removeAllRanges();const $=b.target.value;j($)}}function w(b){n(b.target.value)}function N(b){a&&b.target.select()}function F(b){if(a){const $=b.target.value;j($)}}function j(b){b=b||l,u(s,{title:b}),n(b),m.current.scrollLeft=0}return r.jsx("li",{className:h.join(" "),onClick:f,onDoubleClick:g,children:r.jsx("input",{className:"fileManagerEntry-input",ref:m,type:"text",value:t,readOnly:a?null:"readOnly",autoFocus:a?"autoFocus":null,onChange:w,onBlur:F,onFocus:N,onKeyPress:y})})}lt.propTypes={title:i.string.isRequired,fileId:i.string.isRequired,isSelected:i.bool.isRequired,isRenamed:i.bool.isRequired,defaultTitle:i.string.isRequired,selectFile:i.func.isRequired,enableRename:i.func.isRequired,updateFile:i.func.isRequired};function ct(e){const[t,n]=R.useState(!1),{allTitles:s,selected:o,renamed:a,defaultTitle:l,createFile:c,deleteFile:d,enableRename:u,startImport:h,selectFile:m,updateFile:f,setEditorMode:g}=e;return r.jsxs("div",{className:"fileManager",children:[r.jsx(it,{deleteFile:d,isDeleting:t,selected:o,setIsDeleting:n}),r.jsx("div",{className:"fileManager-isCollapsed",children:r.jsx("span",{className:"fileManager-icon",children:r.jsx(x,{iconName:"file_copy"})})}),r.jsxs("div",{className:"fileManager-isExpanded",children:[r.jsx(Gr,{selected:o,createFile:()=>c(l),deleteFile:()=>n(!0),enableRename:()=>u(o),startImport:()=>h(),exportAsText:()=>{g("export"),setTimeout(()=>Dr(),0)},printFile:()=>{g("print"),setTimeout(()=>window.print(),0)}}),r.jsx("ul",{className:"fileManager-entriesList",children:s.map(y=>r.jsx(lt,{title:y.title,defaultTitle:l,fileId:y.id,isSelected:o===y.id,isRenamed:a===y.id,selectFile:m,updateFile:f,enableRename:u},y.id))})]})]})}ct.propTypes={allTitles:i.arrayOf(i.shape({title:i.string.isRequired,id:i.string.isRequired})).isRequired,selected:i.string.isRequired,renamed:i.string.isRequired,defaultTitle:i.string.isRequired,selectFile:i.func.isRequired,createFile:i.func.isRequired,deleteFile:i.func.isRequired,enableRename:i.func.isRequired,startImport:i.func.isRequired,updateFile:i.func.isRequired,setEditorMode:i.func.isRequired};const Hr=T(e=>({selected:S(e),renamed:sn(e),defaultTitle:on(e),allTitles:Z(e)}),{selectFile:kr,createFile:zn,deleteFile:Vn,updateFile:ze,enableRename:Br,setEditorMode:Ye,startImport:kn})(ct);function dt(e){return J.sanitize(e)}function me(e){const{content:t,useChartFormat:n}=e,s=L(e,["chartFormat","transposeValue","accidentalsType","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy"]),o=nt(t,s,n);return r.jsx("div",{className:"songRenderer",children:r.jsx("div",{dangerouslySetInnerHTML:{__html:dt(o)}})})}me.propTypes={useChartFormat:i.bool.isRequired,chartFormat:i.string.isRequired,content:i.string};me.defaultProps={content:"",useChartFormat:!1};const he=T(e=>({transposeValue:p(e,"songPreferences","transposeValue"),accidentalsType:p(e,"songPreferences","preferredAccidentals"),symbolType:p(e,"songPreferences","symbolType"),chartFormat:p(e,"editorPreferences","chartFormat"),chartType:p(e,"songFormatting","chartType"),alignChordsWithLyrics:p(e,"songFormatting","alignChordsWithLyrics"),alignBars:p(e,"songFormatting","alignBars"),autoRepeatChords:p(e,"songFormatting","autoRepeatChords"),expandSectionCopy:p(e,"songFormatting","expandSectionCopy")}))(me);function ut(e){const{selectedFile:t}=e,n=["editorPreview"];return r.jsx("div",{className:n.join(" "),children:r.jsx(he,{content:t.content})})}ut.propTypes={selectedFile:i.object.isRequired};function $r(){return[$t(),Ne({"Mod-z":zt,"Mod-y":Vt}),Ne(Ut)]}const zr=new Kt({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}},text:{group:"inline"}}});function Vr(e){return e.toJSON().doc.content.map(n=>n.content?n.content.reduce((s,o)=>(s+=o.text||` -`,s),""):"").join(` -`)}function _e(e){const t={ALLOWED_TAGS:["p","#text"],KEEP_CONTENT:!1};return J.sanitize(e,t)}function Ur(e){const t=_e(e).split(` -`).map(s=>`

${s}

`).join(""),n=document.createElement("div");return n.innerHTML=_e(t),n}function Kr(e){return Yt.create({doc:Jt.fromSchema(zr).parse(Ur(e),{preserveWhitespace:"full"}),plugins:$r()})}function Yr(e,t,n){return new Qt(null,{state:e,dispatchTransaction:function(o){const{state:a,transactions:l}=this.state.applyTransaction(o);this.updateState(a),l.some(c=>c.docChanged)&&t(n,{content:Vr(a)})}})}function H(e){const{selectedFileId:t,editorContent:n,updateFile:s}=e,o=R.useRef(),a=R.useRef(),l=Jr(t);function c(){return t&&(!o.current||l!==t)}function d(){return u()&&!t}function u(){return o.current&&o.current.dom.parentNode}function h(){o.current.dom.parentNode.removeChild(o.current.dom)}return R.useEffect(()=>{if(c()){u()&&h();const m=Kr(n);o.current=Yr(m,s,t),a.current.appendChild(o.current.dom),H.editorView=o.current}else d()&&h()}),r.jsx("div",{className:"prosemirrorWrapper",ref:a})}H.defaultProps={selectedFileId:"",editorContent:""};H.propTypes={selectedFileId:i.string,editorContent:i.string,updateFile:i.func.isRequired};function Jr(e){const t=R.useRef();return R.useEffect(()=>{t.current=e}),t.current}function pt(e){const{selectedFile:t,updateFile:n,theme:s}=e,o=["songEditor-preview","cmTheme-"+s,"cmTheme-fadeRepeats"];return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"songEditor-headers",children:[r.jsxs("div",{className:"songEditor-sourceHeader",children:[r.jsx(x,{iconName:"arrow_drop_down"}),"ChordMark source (",r.jsx("a",{href:"https://chordmark.netlify.app/docs/getting-started",target:"_blank",rel:"noreferrer",className:"link1",children:"tutorial"}),")",r.jsx(x,{iconName:"arrow_drop_down"})]}),r.jsxs("div",{className:"songEditor-previewHeader",children:[r.jsx(x,{iconName:"arrow_drop_down"}),"Result preview",r.jsx(x,{iconName:"arrow_drop_down"})]})]}),r.jsx(Xt,{children:r.jsxs("div",{className:"songEditor",children:[r.jsx(Te,{group:"a",children:r.jsx("div",{className:"songEditor-source",children:r.jsx(H,{editorContent:t.content,updateFile:n,selectedFileId:t.id})})}),r.jsx(Te,{group:"a",children:r.jsx("div",{className:o.join(" "),children:r.jsx(ut,{selectedFile:t})})})]})})]})}pt.propTypes={selectedFile:i.object,theme:i.string.isRequired,updateFile:i.func.isRequired};const Qr=T(e=>({theme:p(e,"editorPreferences","theme")}))(pt);function mt(e){const{selectedFile:t}=e,n=C.createRef(),s=o=>{(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="a"&&(o.preventDefault(),window.getSelection().selectAllChildren(n.current))};return R.useEffect(()=>(window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)})),r.jsx("div",{className:"exportPreview exp-SongRenderer",ref:n,children:r.jsx(he,{content:t.content,useChartFormat:!0})})}mt.propTypes={selectedFile:i.object.isRequired};function ht(e){const{theme:t,selectedFile:n,fontSize:s,columnsCount:o}=e,a=["playRendererWrapper1"];a.push("cmTheme-"+t),a.push("cmSong--fontSize"+s);const l=["playRenderer"];return l.push("playRenderer--columns-"+o),r.jsx("div",{className:a.join(" "),"data-testid":"playRendererWrapper1",children:r.jsx("div",{className:"playRendererWrapper2",children:r.jsx("div",{className:l.join(" "),"data-testid":"playRenderer",children:r.jsx(he,{content:n.content})})})})}ht.propTypes={theme:i.string.isRequired,fontSize:i.number.isRequired,selectedFile:i.object.isRequired,columnsCount:i.number.isRequired};const Xr=T(e=>({theme:p(e,"editorPreferences","theme"),fontSize:p(e,"songFormatting","fontSize"),columnsCount:p(e,"songFormatting","columnsCount")}))(ht);function ge(e){const{pageHeader:t,allColumnsLines:n,documentSize:s,documentMargins:o,fontSize:a}=e,l=n.map((u,h)=>{const m=u.join("");return r.jsx("div",{className:"printPreview-pageColumn","data-testid":"printPreview-pageColumn",dangerouslySetInnerHTML:{__html:dt(m)}},h)}),c=["printPreview-page"];c.push("printPreview-page--"+s),c.push("cmSong--fontSize"+a),c.push("cmSong");const d=["printPreview-pageContentWrapper"];return d.push("printPreview-pageContentWrapper--padding"+o),r.jsx("div",{className:c.join(" "),"data-testid":"printPreview-page",children:r.jsx("div",{className:d.join(" "),"data-testid":"printPreview-pageContentWrapper",children:r.jsxs("div",{className:"printPreview-pageContent",children:[t,r.jsx("div",{className:"printPreview-pageColumnWrapper",children:l})]})})})}ge.defaultProps={allColumnsLines:[]};ge.propTypes={pageHeader:i.element,allColumnsLines:i.arrayOf(i.arrayOf(i.string)),documentSize:i.string.isRequired,documentMargins:i.number.isRequired,fontSize:i.number.isRequired};const fe=C.memo(ge);function ye(e){const{title:t}=e;return r.jsx("div",{className:"printPreview-pageHeader",children:t})}ye.defaultProps={allColumnsLines:[]};ye.propTypes={title:i.string.isRequired};const gt=C.memo(ye),be={emptyLine:"cmEmptyLine",chordLine:"cmChordLine",textLine:"cmLyricLine"};function Zr(e,{columnsCount:t,firstPageHeight:n,normalPageHeight:s,columnBreakOnSection:o,noEmptyLinesOnColumnStart:a=!0,noOrphanTextLine:l=!0}){const c=ss({columnsCount:t,firstPageHeight:n,normalPageHeight:s,noEmptyLinesOnColumnStart:a});let d=[],u=0;return(n||s)>0&&e.forEach((m,f)=>{es(c,m,d,a)&&(d.push(m),u+=m.height),d.length>0&&ts(m,e[f+1],{noOrphanTextLine:l,columnBreakOnSection:o})&&(c.fitsOnCurrentColumn(u)?c.insert(d):c.fitsOnNextColumn(u)?c.insertOnNextColumn(d):c.insert(d),d=[],u=0)}),c.get()}function es(e,t,n,s){return!(Y(t)&&!e.fitsOnCurrentColumn(t.height)&&n.length===0&&s===!0)}function ts(e,t,{noOrphanTextLine:n,columnBreakOnSection:s}){if(Y(e)||!t)return!0;const o=ns(e)&&rs(t);if(n===!0&&o)return!1;const a=Y(t);return!(s===!0&&!a)}function Y(e){return xe(e.content,be.emptyLine)}function ns(e){return xe(e.content,be.chordLine)}function rs(e){return xe(e.content,be.textLine)}function xe(e,t){return e.indexOf(t)>-1}function ss({firstPageHeight:e,normalPageHeight:t,columnsCount:n}){const s=[];let o=0,a=0,l=u(),c=0;s[o]=[],s[o][a]=[];function d(g){g.forEach(y=>{h(c+y.height)&&m(),s[o][a].push(y.content),c+=y.height})}function u(){return o===0&&e?e:t}function h(g){return g>l}function m(){f()?(o++,s[o]=[],a=0):a++,s[o][a]=[],c=0,l=u()}function f(){return a===n-1}return{insert(g){d(g)},insertOnNextColumn(g){m(),d(g)},fitsOnCurrentColumn(g){return c+g<=l},fitsOnNextColumn(g){const y=o===0&&a{const a=()=>(R.useLayoutEffect(()=>{const l=t(n);o(l)}),r.jsx("div",{children:e}));s.render(r.jsx(a,{}))}).then(o=>(s.unmount(),n.parentNode.removeChild(n),o))}function Ce(e,t=[]){for(let n=t.length||0;n{const d=[];return c.querySelectorAll(os.line).forEach(u=>{d.push(is(u))}),d})}async function ls(e,{columnsCount:t,documentSize:n,documentMargins:s,fontSize:o}){const a=r.jsx(fe,{pageHeader:r.jsx(gt,{title:e}),allColumnsLines:Ce(t),documentSize:n,documentMargins:s,fontSize:o});return await ft(a,c=>{const d=c.querySelector(".printPreview-pageContent"),u=c.querySelector(".printPreview-pageColumnWrapper");return{firstPageHeight:Ee(u),normalPageHeight:Ee(d)}})}function yt(e){const[t,n]=R.useState([]),{title:s,allLines:o,columnsCount:a,columnBreakOnSection:l,documentSize:c,documentMargins:d,fontSize:u}=e;R.useLayoutEffect(()=>{(async()=>{const f={columnsCount:a,documentSize:c,documentMargins:d,fontSize:u},g=await as(o,f),{normalPageHeight:y,firstPageHeight:w}=await ls(s,f),N=o.map((j,b)=>({content:j,height:g[b]})),F=Zr(N,{columnsCount:a,columnBreakOnSection:l,normalPageHeight:y,firstPageHeight:w});n(F)})()},[o,s,a,l,c,d,u]);const h=t.map((m,f)=>r.jsx(fe,{pageHeader:f===0?r.jsx(gt,{title:s}):null,allColumnsLines:Ce(a,m),documentSize:c,documentMargins:d,fontSize:u},f));return r.jsx(C.Fragment,{children:h})}yt.propTypes={title:i.string.isRequired,allLines:i.arrayOf(i.string).isRequired,columnsCount:i.number.isRequired,columnBreakOnSection:i.bool.isRequired,documentSize:i.string.isRequired,documentMargins:i.number.isRequired,fontSize:i.number.isRequired};function bt(e){const{selectedFile:t}=e,n=L(e,["transposeValue","accidentalsType","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy"]),o=nt(t.content||"",{...n}).match(/(.*?<\/p>)/gm),a=["printPreview","cmTheme-print"];return r.jsx("div",{className:a.join(" "),"data-testid":"printPreview",children:r.jsx(yt,{title:t.title||"",allLines:o,columnsCount:e.columnsCount,columnBreakOnSection:e.columnBreakOnSection,documentSize:e.documentSize||"a4",documentMargins:e.documentMargins,fontSize:e.fontSize})})}bt.propTypes={chartType:i.string.isRequired,selectedFile:i.object.isRequired,columnsCount:i.number.isRequired,columnBreakOnSection:i.bool.isRequired,documentSize:i.string,documentMargins:i.number.isRequired,fontSize:i.number.isRequired};const cs=T(e=>({accidentalsType:p(e,"songPreferences","preferredAccidentals"),transposeValue:p(e,"songPreferences","transposeValue"),symbolType:p(e,"songPreferences","symbolType"),chartType:p(e,"songFormatting","chartType"),alignChordsWithLyrics:p(e,"songFormatting","alignChordsWithLyrics"),alignBars:p(e,"songFormatting","alignBars"),autoRepeatChords:p(e,"songFormatting","autoRepeatChords"),expandSectionCopy:p(e,"songFormatting","expandSectionCopy"),columnsCount:p(e,"songFormatting","columnsCount"),columnBreakOnSection:p(e,"songFormatting","columnBreakOnSection"),documentMargins:p(e,"songFormatting","documentMargins"),fontSize:p(e,"songFormatting","fontSize")}))(bt);function xt(e){const{editorMode:t}=e;switch(t){case"edit":return r.jsx(Qr,{...e});case"play":return r.jsx(Xr,{...e});case"print":return r.jsx(cs,{...e});case"export":return r.jsx(mt,{...e})}}xt.propTypes={editorMode:i.string.isRequired};const ds=T(e=>({selectedFile:ee(e,S(e))||{},editorMode:E(e)}),{updateFile:ze})(xt);function Ct(e){const{id:t,allWidgets:n,nonInteractableWidgets:s,hiddenWidgets:o,setOption:a,getEntryComponent:l}=e,c=["optionsPanel","optionsPanel-"+t];let d,u,h,m,f,g,y;const w=n.widgetsOrder.filter(F=>!o.includes(F)).map(F=>(d=n.allWidgets[F],d.type==="optionsGroup"?(y=d.groupWidgetsOrder.filter(j=>!o.includes(j)).map(j=>(u=d.allGroupWidgets[j],g=!s.includes(F)&&!s.includes(j),N(j,u,g))),y.length===0?null:(m=l(d.type),f=!s.includes(F),r.jsx(m,{isInteractable:f,label:d.label,icon:d.icon,children:y},F))):N(F,d,!s.includes(F))));function N(F,j,b){return h=l(j.type),r.jsx(h,{isInteractable:b,optionContext:j.option.context,optionKey:j.option.key,optionValue:e[j.option.key],setOption:a,label:j.label,...j.typeOptions},F)}return r.jsx("div",{className:c.join(" "),children:w})}Ct.propTypes={id:i.string.isRequired,allWidgets:i.object.isRequired,nonInteractableWidgets:i.arrayOf(i.string).isRequired,hiddenWidgets:i.arrayOf(i.string).isRequired,setOption:i.func.isRequired,getEntryComponent:i.func.isRequired};function je(e){const{isInteractable:t,icon:n,label:s}=e,o=["sb-optionsGroup"];a()||o.push("sb-optionsGroup-isNotInteractable");function a(){return t&&e.children&&e.children.length>0}return r.jsxs("div",{className:o.join(" "),children:[r.jsxs("div",{className:"sb-optionsGroup-title",children:[r.jsx("span",{className:"sb-optionsGroup-iconTitle",children:r.jsx(x,{iconName:n})})," ",s]}),r.jsx("div",{className:"sb-optionsGroup-content",children:e.children})]})}je.propTypes={isInteractable:i.bool.isRequired,icon:i.string.isRequired,label:i.string.isRequired,children:i.arrayOf(i.element)};je.defaultProps={};function jt(e){const{isSelected:t,isInteractable:n,label:s,onClick:o}=e;let a;const l=["sb-optionSelectChoice"];t&&(l.push("sb-optionSelectChoice-isSelected"),a=r.jsx("span",{className:"sb-optionSelectChoice-checkIcon",children:r.jsx(x,{iconName:"check"})})),n||l.push("sb-optionSelectChoice-isNotInteractable");function c(){n&&o()}return r.jsxs("div",{className:l.join(" "),onClick:c,children:[r.jsx("div",{className:"sb-optionSelectChoice-check",children:t&&a}),r.jsx("div",{className:"sb-optionSelectChoice-label",children:s})]})}jt.propTypes={isSelected:i.bool.isRequired,isInteractable:i.bool.isRequired,label:i.string.isRequired,onClick:i.func.isRequired};const us=C.memo(jt);function Rt(e){const[t,n]=R.useState(!1),{isInteractable:s,label:o,allChoices:a,optionContext:l,optionKey:c,optionValue:d,setOption:u}=e,h=["sb-optionSelect"];s||h.push("sb-optionSelect-isNotInteractable");const m=t?"keyboard_arrow_down":"keyboard_arrow_right";function f(){n(!t)}const g=t?r.jsx("div",{className:"sb-optionSelect-choices",children:a.map(N=>r.jsx(us,{label:N.label,isSelected:d===N.value,isInteractable:s,onClick:()=>{u(l,c,N.value)}},N.value))}):null,y=a.find(N=>d===N.value).label,w=t?o:r.jsxs("span",{children:[r.jsx("span",{children:o+": "}),r.jsx("span",{className:"sb-optionSelectChoice-activeLabel",children:y})]});return r.jsxs("div",{className:h.join(" "),children:[r.jsxs("div",{className:"sb-optionSelect-title",onClick:s?f:null,children:[r.jsx("div",{className:"sb-optionSelect-desc","data-testid":"selectLabel",children:w}),r.jsx("div",{className:"sb-optionSelect-toggle",children:r.jsx("span",{className:"sb-optionSelect-icon",children:r.jsx(x,{iconName:m})})})]}),g]})}Rt.propTypes={isInteractable:i.bool.isRequired,label:i.string.isRequired,allChoices:i.array.isRequired,optionContext:i.string.isRequired,optionKey:i.string.isRequired,optionValue:i.string.isRequired,setOption:i.func.isRequired};function Re(e){const{isInteractable:t,label:n,min:s,max:o,showPlusSymbol:a,optionContext:l,optionKey:c,optionValue:d,setOption:u}=e,h=["sb-optionSlider"];t||h.push("sb-optionSlider-isNotInteractable");function m(g){u(l,c,Number.parseInt(g.target.value))}const f=d>0&&a?"+"+d:d;return r.jsxs("div",{className:h.join(" "),children:[r.jsx("div",{className:"sb-optionSlider-desc",children:n}),r.jsx("div",{className:"sb-optionSlider-value",children:f}),r.jsx("div",{className:"sb-optionSlider-range",children:r.jsx("input",{min:s,max:o,value:d,type:"range",onChange:t?m:null,disabled:!t})})]})}Re.propTypes={isInteractable:i.bool.isRequired,label:i.string.isRequired,min:i.number.isRequired,max:i.number.isRequired,showPlusSymbol:i.bool,optionContext:i.string.isRequired,optionKey:i.string.isRequired,optionValue:i.number.isRequired,setOption:i.func.isRequired};Re.defaultProps={showPlusSymbol:!0};const ps=C.memo(Re);function vt(e){const{isInteractable:t,label:n,optionContext:s,optionKey:o,optionValue:a,setOption:l}=e,c=["sb-optionToggle"];c.push(a===!0?"sb-optionToggle-isOn":"sb-optionToggle-isOff"),t||c.push("sb-optionToggle-isNotInteractable");function d(){l(s,o,!a)}return r.jsxs("div",{className:c.join(" "),onClick:t?d:null,children:[r.jsx("div",{className:"sb-optionToggle-desc",children:n}),r.jsx("div",{className:"sb-optionToggle-icon",children:r.jsx("span",{className:"sb-optionToggle-icon",children:r.jsx(x,{iconName:a===!0?"toggle_on":"toggle_off"})})})]})}vt.propTypes={isInteractable:i.bool.isRequired,label:i.string.isRequired,optionContext:i.string.isRequired,optionKey:i.string.isRequired,optionValue:i.bool.isRequired,setOption:i.func.isRequired};const ms=C.memo(vt);function hs(e){switch(e){case"optionsGroup":return je;case"select":return Rt;case"slider":return ps;case"toggle":return ms}}function gs(e){return r.jsx("div",{className:"sb-optionsPanel",children:r.jsx(Ct,{...e,getEntryComponent:hs})})}function fs(e){return r.jsxs("div",{className:"renderingOptionsPanel",children:[r.jsx("div",{className:"renderingOptionsPanel-isCollapsed",children:r.jsx("span",{className:"renderingOptionsPanel-icon",children:r.jsx(x,{iconName:"settings"})})}),r.jsx("div",{className:"renderingOptionsPanel-isExpanded",children:r.jsx(gs,{...e,id:"rendering"})})]})}const ys=(e,t,n)=>{if(!e)throw new TypeError("Cannot set an option without a context");if(!t)throw new TypeError("Cannot set an option without a key");return v(X,{context:e,key:t,value:n})};function bs(e,t,n,s){return T(o=>{const a={allWidgets:e,nonInteractableWidgets:t(o),hiddenWidgets:n(o)};let l,c;return e.widgetsOrder.forEach(d=>{l=e.allWidgets[d],l.groupWidgetsOrder.forEach(u=>{c=l.allGroupWidgets[u],a[c.option.key]=p(o,c.option.context,c.option.key)})}),a},{setOption:ys})(s)}const xs={widgetsOrder:["editorPreferences","key","preferences","layout"],allWidgets:{editorPreferences:{label:"Editor preferences",type:"optionsGroup",icon:"tune",groupWidgetsOrder:["theme","chartFormat"],allGroupWidgets:{theme:{label:"Theme",type:"select",typeOptions:{allChoices:[{id:"themeDark1",label:"Dark 1 (default)",value:"dark1"},{id:"themeDark2",label:"Dark 2",value:"dark2"},{id:"themeDark3",label:"Dark 3",value:"dark3"}]},option:{context:"editorPreferences",key:"theme"}},chartFormat:{label:"Export format",type:"select",typeOptions:{allChoices:[{id:"formatChordMark",label:"ChordMark",value:"chordmark"},{id:"formatChordMarkSrc",label:"ChordMark (Source)",value:"chordmarkSrc"},{id:"formatChordpro",label:"ChordPro",value:"chordpro"},{id:"formatUG",label:"UltimateGuitar",value:"ultimateGuitar"}]},option:{context:"editorPreferences",key:"chartFormat"}}}},key:{label:"Key",type:"optionsGroup",icon:"music_note",groupWidgetsOrder:["transposeValue","preferredAccidentals","symbolType"],allGroupWidgets:{transposeValue:{label:"Transpose",type:"slider",typeOptions:{min:-11,max:11,showPlusSymbol:!0},option:{context:"songPreferences",key:"transposeValue"}},preferredAccidentals:{label:"Preferred accidentals",type:"select",typeOptions:{allChoices:[{id:"preferredAccidentalsAuto",label:"Auto",value:"auto"},{id:"preferredAccidentalsSharp",label:"♯",value:"sharp"},{id:"preferredAccidentalsFlat",label:"♭",value:"flat"}]},option:{context:"songPreferences",key:"preferredAccidentals"}},symbolType:{label:"Symbols type",type:"select",typeOptions:{allChoices:[{id:"symbolTypeChord",label:"Chord symbols",value:"chord"},{id:"symbolTypeRoman",label:"Roman numerals",value:"roman"}]},option:{context:"songPreferences",key:"symbolType"}}}},preferences:{label:"Chart settings",type:"optionsGroup",icon:"tune",groupWidgetsOrder:["chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy"],allGroupWidgets:{chartType:{label:"Type",type:"select",typeOptions:{allChoices:[{id:"typedisplayAll",label:"Show everything",value:"all"},{id:"typedisplayLyrics",label:"Lyrics only",value:"lyrics"},{id:"typedisplayChords",label:"Chords only",value:"chords"},{id:"typedisplayChordsFirstLyricLine",label:"Chords + First lyric line",value:"chordsFirstLyricLine"}]},option:{context:"songFormatting",key:"chartType"}},alignChordsWithLyrics:{label:"Align chords with lyrics",type:"toggle",option:{context:"songFormatting",key:"alignChordsWithLyrics"}},alignBars:{label:"Align bars",type:"toggle",option:{context:"songFormatting",key:"alignBars"}},autoRepeatChords:{label:"Auto repeat chords",type:"toggle",option:{context:"songFormatting",key:"autoRepeatChords"}},expandSectionCopy:{label:"Expand copied sections",type:"toggle",option:{context:"songFormatting",key:"expandSectionCopy"}}}},layout:{type:"optionsGroup",label:"Layout",icon:"view_compact",groupWidgetsOrder:["fontSize","columnsCount","columnBreakOnSection","documentMargins"],allGroupWidgets:{fontSize:{label:"Font size",type:"slider",typeOptions:{min:-5,max:5,showPlusSymbol:!0},option:{context:"songFormatting",key:"fontSize"}},columnsCount:{label:"Columns",type:"slider",typeOptions:{min:1,max:4},option:{context:"songFormatting",key:"columnsCount"}},columnBreakOnSection:{label:"Column Break on section",type:"toggle",option:{context:"songFormatting",key:"columnBreakOnSection"}},documentMargins:{label:"Margins",type:"slider",typeOptions:{min:1,max:5},option:{context:"songFormatting",key:"documentMargins"}}}}}},Cs=e=>{const t=[],n=p(e,"songFormatting","chartType");n==="lyrics"?(t.push("alignChordsWithLyrics"),t.push("alignBars"),t.push("autoRepeatChords")):n==="chords"&&t.push("alignChordsWithLyrics");const s=p(e,"editorPreferences","chartFormat");return E(e)==="export"&&s==="chordmarkSrc"&&(t.push("chartType"),t.push("alignChordsWithLyrics"),t.push("alignBars"),t.push("autoRepeatChords"),t.push("expandSectionCopy")),t},js=e=>{const t=[],n=Object.keys({...P(e,"editorPreferences"),...P(e,"songFormatting"),...P(e,"songPreferences")});if(!S(e))return n;const o=E(e),a=Zt(n,ne[o]);return t.push(...a),t},Rs=bs(xs,Cs,js,fs);function vs(){const e=r.jsx(Hr,{}),t=r.jsx(Rs,{});return r.jsx(Lr,{leftBar:e,rightBar:t,children:r.jsx(ds,{})})}const Fs=[{name:"home",path:"",action:vs},...ir,...ar];Hn();function Ns(){Mn(),Yn();const e=window?window.location.pathname+window.location.search:"/";return Xn.init(Fs),G(e)}Ns(); diff --git a/packages/chord-chart-studio/build/assets/index-BmEYkRDe.css b/packages/chord-chart-studio/build/assets/index-BmEYkRDe.css deleted file mode 100644 index b1da6c97..00000000 --- a/packages/chord-chart-studio/build/assets/index-BmEYkRDe.css +++ /dev/null @@ -1 +0,0 @@ -:root{--space-xxs: 4px;--space-xs: 8px;--space-s: 12px;--space-m: 16px;--space-l: 24px;--space-xl: 32px;--space-xxl: 48px}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html{box-sizing:border-box;font-size:62.5%;font-size:.625em}body{font-size:1.6rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:1.5}.theme-dark .link1{color:#fabf2b}.theme-dark .link1:hover{color:#fbce5d}.theme-dark .link1:active{color:#fcdd8f}::-webkit-scrollbar{width:10px;height:10px}.theme-light ::-webkit-scrollbar{background-color:red}.theme-dark ::-webkit-scrollbar{background-color:red}.theme-dark ::-webkit-scrollbar-track,.theme-dark ::-webkit-scrollbar-corner{background-color:#293132}::-webkit-scrollbar-thumb{border-radius:100vw}.theme-light ::-webkit-scrollbar-thumb{border:3px solid}.theme-dark ::-webkit-scrollbar-thumb{background-color:#a8a8a8;border:3px solid rgb(41,49,50)}.theme-dark ::-webkit-scrollbar-thumb:hover{background-color:#c1c1c1}@supports (scrollbar-color: white black){*{scrollbar-width:thin}.theme-dark *{scrollbar-color:#a8a8a8 rgb(41,49,50)}}.cmTheme-dark1{background-color:#293132}.cmTheme-dark1 .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#f4f4f4}.cmTheme-dark1 .cmSong p{margin:0}.cmTheme-dark1 .cmSectionLabel{color:#67d3ff;font-weight:700}.cmTheme-dark1 .cmSectionMultiplier{color:#ed7bff}.cmTheme-dark1 .cmTimeSignature,.cmTheme-dark1 .cmKeyDeclaration{color:#a7ff7b;font-weight:700}.cmTheme-dark1 .cmChordLine{color:#fabf2b}.cmTheme-dark1 .cmBarSeparator{opacity:.5}.cmTheme-dark1 .cmChordDuration{opacity:.7}.cmTheme-dark1 .cmSubBeatGroupOpener,.cmTheme-dark1 .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.cmTheme-dark1 .cmChordLine-romanNumeral,.cmTheme-dark1 .cmRomanNumeral{color:#fabf2b}.cmTheme-dark1 .cmRomanNumeral-diatonic{font-weight:700;color:#303846;background-color:#fabf2b}.cmTheme-dark1 .cmRomanNumeral-borrowed{color:#303846;background-color:#fabf2bb3}.cmTheme-dark1 .cmRomanNumeral-unknown{opacity:.8}.cmTheme-dark2{background-color:#282a36}.cmTheme-dark2 .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#f8f8f2}.cmTheme-dark2 .cmSong p{margin:0}.cmTheme-dark2 .cmSectionLabel{color:#ffb86c;font-weight:700}.cmTheme-dark2 .cmSectionMultiplier{color:#f1fa8c}.cmTheme-dark2 .cmTimeSignature,.cmTheme-dark2 .cmKeyDeclaration{color:#f1fa8c;font-weight:700}.cmTheme-dark2 .cmChordLine{color:#8be9fd}.cmTheme-dark2 .cmBarSeparator{opacity:.5}.cmTheme-dark2 .cmChordDuration{opacity:.7}.cmTheme-dark2 .cmSubBeatGroupOpener,.cmTheme-dark2 .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.cmTheme-dark2 .cmChordLine-romanNumeral,.cmTheme-dark2 .cmRomanNumeral{color:#8be9fd}.cmTheme-dark2 .cmRomanNumeral-diatonic{font-weight:700;color:#303846;background-color:#8be9fd}.cmTheme-dark2 .cmRomanNumeral-borrowed{color:#303846;background-color:#8be9fdb3}.cmTheme-dark2 .cmRomanNumeral-unknown{opacity:.8}.cmTheme-dark3{background-color:#282a36}.cmTheme-dark3 .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#f8f8f2}.cmTheme-dark3 .cmSong p{margin:0}.cmTheme-dark3 .cmSectionLabel{color:#f55;font-weight:700}.cmTheme-dark3 .cmSectionMultiplier{color:#f1fa8c}.cmTheme-dark3 .cmTimeSignature,.cmTheme-dark3 .cmKeyDeclaration{color:#8be9fd;font-weight:700}.cmTheme-dark3 .cmChordLine{color:#50fa7b}.cmTheme-dark3 .cmBarSeparator{opacity:.5}.cmTheme-dark3 .cmChordDuration{opacity:.7}.cmTheme-dark3 .cmSubBeatGroupOpener,.cmTheme-dark3 .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.cmTheme-dark3 .cmChordLine-romanNumeral,.cmTheme-dark3 .cmRomanNumeral{color:#50fa7b}.cmTheme-dark3 .cmRomanNumeral-diatonic{font-weight:700;color:#303846;background-color:#50fa7b}.cmTheme-dark3 .cmRomanNumeral-borrowed{color:#303846;background-color:#50fa7bb3}.cmTheme-dark3 .cmRomanNumeral-unknown{opacity:.8}.cmTheme-text .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#333}.cmTheme-text .cmSong p{margin:0}.cmTheme-print{background-color:#fff}.cmTheme-print .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#333;font-size:12px}.cmTheme-print .cmSong p{margin:0}.cmTheme-print .cmSectionLabel{font-weight:700;text-decoration:underline}.cmTheme-print .cmSectionMultiplier{font-weight:400;text-decoration:none;text-decoration:initial}.cmTheme-print .cmTimeSignature,.cmTheme-print .cmKeyDeclaration{font-weight:700}.cmTheme-print .cmBarSeparator{opacity:.5}.cmTheme-print .cmChordDuration{opacity:.7}.cmTheme-print .cmSubBeatGroupOpener,.cmTheme-print .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.cmSong--fontSize-5 .cmLine{font-size:.5em;line-height:1.15em}.cmSong--fontSize-4 .cmLine{font-size:.6em;line-height:1.25em}.cmSong--fontSize-3 .cmLine{font-size:.7em;line-height:1.35em}.cmSong--fontSize-2 .cmLine{font-size:.8em;line-height:1.45em}.cmSong--fontSize-1 .cmLine{font-size:.9em;line-height:1.55em}.cmSong--fontSize1 .cmLine{font-size:1.1em;line-height:1.75em}.cmSong--fontSize2 .cmLine{font-size:1.2em;line-height:1.85em}.cmSong--fontSize3 .cmLine{font-size:1.3em;line-height:1.95em}.cmSong--fontSize4 .cmLine{font-size:1.4em;line-height:2.05em}.cmSong--fontSize5 .cmLine{font-size:1.5em;line-height:2.15em}.cmChordLyricLine{display:flex;flex-wrap:wrap}.cmChordLyricLine .cmChordLyricPair{flex:0 0 auto;display:flex;flex-direction:column}.cmChordLyricLine .cmChordLyricPair .cmChordLine,.cmChordLyricLine .cmChordLyricPair .cmLyricLine{flex:0 0 auto;white-space:pre}.cmTheme-print2{background-color:#fff}.cmTheme-print2 .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#333;font-size:14px;line-height:1.4em;font-family:Menlo,Courier New,Courier,monospace}.cmTheme-print2 .cmSong p{margin:0}.cmTheme-print2 .cmSection{border:1px solid black;border-radius:8px;padding:.4em;margin:.2em 0;page-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.cmTheme-print2 .cmSection-Chorus{background-color:#ededed}.cmTheme-print2 .cmSectionLabel{font-weight:700;font-size:.85em;text-transform:uppercase}.cmTheme-print2 .cmSectionMultiplier{text-decoration:none;text-decoration:initial;font-size:.95em}.cmTheme-print2 .cmTimeSignature,.cmTheme-print2 .cmKeyDeclaration{font-weight:700}.cmTheme-print2 .cmEmptyLine{display:none}.cmTheme-print2 .cmChordLine{font-weight:bolder}.cmTheme-print2 .cmBarSeparator{opacity:.5}.cmTheme-print2 .cmChordDuration{opacity:.7}.cmTheme-print2 .cmSubBeatGroupOpener,.cmTheme-print2 .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.ErrorBoundary{padding:2rem}._button_6sdae_1{font-weight:700;background-color:red}._button_6sdae_1 ._buttonContent_6sdae_5{background-color:#8a2be2;padding:var(--space-xxl)}html,body,#app{height:100%;padding:0}.appLayout-wrapper{width:100%;height:100%;display:flex;flex-direction:row;flex-wrap:nowrap}.leftBar{flex-shrink:0;width:15%;max-width:250px;display:flex;flex-direction:row;flex-wrap:nowrap}.leftBar.leftBar-isCollapsed{width:48px}.theme-light .leftBar.leftBar-isCollapsed{border-right:1px solid}.theme-dark .leftBar{color:#f4f4f4;background-color:#303846}.theme-dark .leftBar.leftBar-isCollapsed{border-right:1px solid #dbdbdb}.theme-dark .leftBar.leftBar-isCollapsed:hover{background-color:#455064}@media print{.leftBar{display:none}}.rightBar{flex-shrink:0;width:15%;max-width:250px;display:flex;flex-direction:row;flex-wrap:nowrap}.rightBar.rightBar-isCollapsed{width:48px}.theme-light .rightBar.rightBar-isCollapsed{border-left:1px solid}.theme-dark .rightBar{color:#f4f4f4;background-color:#303846}.theme-dark .rightBar.rightBar-isCollapsed{border-left:1px solid #dbdbdb}.theme-dark .rightBar.rightBar-isCollapsed:hover{background-color:#455064}@media print{.rightBar{display:none}}.leftBar-content{overflow-y:scroll;flex:1 1 auto}.leftBar-isCollapsed .leftBar-content{padding:.5rem 1rem;text-align:center;cursor:pointer;overflow:hidden}.rightBar-content{overflow-y:scroll;flex:1 1 auto}.rightBar-isCollapsed .rightBar-content{padding:.5rem 1rem;text-align:center;cursor:pointer;overflow:hidden}.leftBar-collapser{flex:0 0 12px;display:flex;cursor:pointer}.leftBar-isCollapsed .leftBar-collapser{display:none}.theme-light .leftBar-collapser{border-right:1px solid}.theme-dark .leftBar-collapser{background-color:#405a73;border-right:1px solid #a8a8a8}.theme-dark .leftBar-collapser:hover{background-color:#537393}.theme-dark .leftBar-collapser{color:#f4f4f4}.leftBar-collapserIcon{flex:1 1 auto;align-self:center;font-weight:700}.leftBar-collapserIcon .icon{font-size:1.2rem}.rightBar-collapser{flex:0 0 12px;display:flex;cursor:pointer}.rightBar-isCollapsed .rightBar-collapser{display:none}.theme-light .rightBar-collapser{border-left:1px solid}.theme-dark .rightBar-collapser{background-color:#405a73;border-left:1px solid #a8a8a8}.theme-dark .rightBar-collapser:hover{background-color:#537393}.theme-dark .rightBar-collapser{color:#f4f4f4}.rightBar-collapserIcon{flex:1 1 auto;align-self:center;font-weight:700}.rightBar-collapserIcon .icon{font-size:1.2rem}.appLayout-main{flex-grow:1;display:flex;flex-direction:column;flex-wrap:nowrap}.appLayout-header{flex-shrink:0}.theme-light .appLayout-header{border-bottom:3px solid}.theme-dark .appLayout-header{color:#f4f4f4b3;background-color:#303846;border-bottom:3px solid rgb(250,191,43)}@media print{.appLayout-header{display:none}}.appLayout-content{overflow-y:auto;flex-grow:1}@media print{.appLayout-content{overflow-y:visible}}.theme-dark .appLayout-footer{color:#a8a8a8}@media print{.appLayout-footer{display:none}}.logo-isExpanded{box-sizing:border-box;padding:1.5rem 0 1rem;width:100%}.leftBar-isCollapsed .logo-isExpanded{display:none}.logo-img{margin:0 auto;width:70%}.logo-img svg{fill:#fff;aspect-ratio:1.25/1;width:80%;margin:5px auto 10px;display:block}.mainNav-entries{margin:0;padding:0;display:flex;justify-content:center;list-style-type:none;font-size:1.6rem;font-family:Open Sans,sans-serif;font-weight:400;vertical-align:middle}.mainNavEntry{display:inline-block;padding:1rem 2rem;cursor:default;font-weight:700}.mainNavEntry:hover:not(.mainNavEntry-isActive){cursor:pointer}.theme-dark .mainNavEntry:hover:not(.mainNavEntry-isDisabled):not(.mainNavEntry-isActive){color:#1c2731;background-color:#fcdd8f}.theme-dark .mainNavEntry.mainNavEntry-isActive{color:#1c2731;background-color:#fabf2b}.mainNavEntry.mainNavEntry-isDisabled{-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-light .mainNavEntry.mainNavEntry-isDisabled{cursor:not-allowed}.theme-dark .mainNavEntry.mainNavEntry-isDisabled{color:#a8a8a8;background-color:#303846;cursor:not-allowed}.mainNavEntry-icon .icon{margin-right:.5rem;font-size:1.4rem}.icon{vertical-align:middle}.userGuide-isExpanded{margin-left:1rem}.rightBar-isCollapsed .userGuide-isExpanded{display:none}.userGuide-isCollapsed{padding:1rem 0}.rightBar:not(.rightBar-isCollapsed) .userGuide-isCollapsed{display:none}button{border:0;border-radius:0;background-color:transparent}.Button{display:inline-block;padding:10px 20px;font-weight:700;text-transform:capitalize;margin:10px 20px 10px 0}.Button:hover{cursor:pointer}.Button:last-of-type{margin-right:0}.theme-dark .Button-primary:not(.Button-isDisabled){background-color:#fabf2b;color:#1c2731}.theme-dark .Button-primary:not(.Button-isDisabled):hover{color:#000;background-color:#fcdd8f}.theme-dark .Button-primary:not(.Button-isDisabled):active{color:#2e4052;background-color:#feecc0}.Button-primary.Button-isDisabled{cursor:not-allowed}.theme-dark .Button-primary.Button-isDisabled{background-color:#57686a;color:#404c4e}.theme-dark .Button-secondary:not(.Button-isDisabled){background-color:#a8a8a8;color:#121616}.theme-dark .Button-secondary:not(.Button-isDisabled):hover{color:#000;background-color:#c1c1c1}.theme-dark .Button-secondary:not(.Button-isDisabled):active{color:#2e4052;background-color:#dbdbdb}.Button-secondary.Button-isDisabled{cursor:not-allowed}.theme-dark .Button-secondary.Button-isDisabled{background-color:#57686a;color:#404c4e}.versions-isExpanded{margin:4rem 0;padding:0 1rem;opacity:.5;font-size:1rem}.rightBar-isCollapsed .versions-isExpanded{display:none}.versions-isExpanded a{color:inherit}.versions-isExpanded a:hover{opacity:.7}.sim-SongImporterModal_Container{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:90%;height:90%;display:flex;flex-direction:column;align-items:stretch;align-content:stretch;flex-wrap:nowrap}.theme-light .sim-SongImporterModal_Container{border:1px solid}.theme-dark .sim-SongImporterModal_Container{background-color:#1e2324;border:1px solid #c1c1c1;color:#f4f4f4}.sim-Header_Container{flex:0 0 auto;display:flex}.theme-light .sim-Header_Container{border-bottom:1px solid}.theme-dark .sim-Header_Container{background-color:#303846;border-bottom:1px solid #c1c1c1;color:#f4f4f4b3}.sim-Header_Title{flex:1 1 auto;padding:20px;font-size:1.6rem;font-weight:bolder}.sim-Header_Actions{flex:0 0 auto;padding:0 10px}.sim-TwoColumns_Container{display:flex;align-self:stretch}.sim-TwoColumns_Container-autoHeight{flex:0 1 100%;min-height:0}.sim-Column_Container{flex:1 1 50%;align-self:stretch;padding:0 10px}.sim-Column_Container:first-child{padding-right:5px}.sim-Column_Container:last-child{padding-left:5px}.sim-Input_Header{height:20px;text-transform:uppercase;padding:2px;text-align:center;font-size:1.2rem}.theme-dark .sim-Input_Header{background-color:#404c4e;color:#f4f4f4b3}.sim-Input_Textarea{box-sizing:border-box;padding:10px;width:100%;height:calc(100% - 34px);max-height:calc(100% - 34px);overflow-y:scroll;resize:none;margin:0;background-color:transparent;border:0;outline:none;font-family:PT Mono,consolas,courier,monospace;font-size:1.2rem;line-height:1.5rem}.theme-dark .sim-Input_Textarea{background-color:#121616;color:#f4f4f4}.sim-Input_Textarea-Disabled{opacity:.5}.sim-Preview_Container{box-sizing:border-box;font-family:PT Mono,consolas,courier,monospace;font-size:1.2rem;white-space:pre-wrap;height:calc(100% - 34px);max-height:calc(100% - 34px);overflow-y:scroll;padding:10px}.theme-dark .sim-Preview_Container{background-color:#293132}.sim-Preview_Error{padding:10px}.theme-dark .sim-Preview_Error{color:#f4f4f4;background-color:#f91900}.sim-InputFile_Input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.sim-InputFormat{padding:10px 0}.sim-InputFormat_Entry{display:inline-block;margin:0 10px}.sim-InputFormat_Entry:hover,.sim-InputFormat_Label:hover{cursor:pointer}.sim-InputFormat_Entry-Disabled,.sim-InputFormat_Label-Disabled{opacity:.5}.sim-InputFormat_Entry-Disabled:hover,.sim-InputFormat_Label-Disabled:hover{cursor:not-allowed}.mod-ModalContainer{z-index:5000;height:100%;width:100%;position:absolute;top:0;left:0}.mod-Overlay{height:100%;width:100%;position:absolute;top:0;left:0;opacity:.7;background-color:#000}.mod-ModalConfirmContainer{z-index:5000;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:auto;height:auto;padding:10px 20px}.theme-light .mod-ModalConfirmContainer{border:1px solid}.theme-dark .mod-ModalConfirmContainer{background-color:#1e2324;border:1px solid #c1c1c1;color:#f4f4f4}.mod-ModalConfirmButtons{text-align:center}.fileManager-isExpanded{font-size:1.2rem}.leftBar-isCollapsed .fileManager-isExpanded{display:none}.fileManager-isCollapsed{padding:1rem 0}.leftBar:not(.leftBar-isCollapsed) .fileManager-isCollapsed{display:none}.fileManager-actionsList{padding:1rem;display:flex;flex-direction:row;flex-wrap:wrap}.theme-dark .fileManager-actionsList{background-color:#455064}.fileManagerAction{flex:0 1 auto;padding:.5rem;margin-right:.5rem;white-space:nowrap}.fileManagerAction:hover{cursor:not-allowed}.fileManagerAction:hover:not(.fileManagerAction-isDisabled){cursor:pointer}.theme-dark .fileManagerAction:hover:not(.fileManagerAction-isDisabled){background-color:#596883}.fileManagerAction-isDisabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:.5}.fileManagerAction-icon .icon{font-size:1.4rem}.fileManager-entriesList{padding-left:0;list-style:none}.fileManagerEntry{cursor:pointer;padding:.1rem 0}.theme-dark .fileManagerEntry:hover{background-color:#596883}.theme-dark .fileManagerEntry.fileManagerEntry-isSelected{background-color:#fabf2b}.fileManagerEntry-input{box-sizing:border-box;width:100%;padding:0 1rem;background-color:transparent;border:none;cursor:pointer;outline:none}.theme-dark .fileManagerEntry-input{color:#f4f4f4}.theme-dark .fileManagerEntry-isSelected .fileManagerEntry-input{color:#303846}.fileManagerEntry-isRenamed .fileManagerEntry-input{cursor:text}.theme-dark .fileManagerEntry-isRenamed .fileManagerEntry-input{background-color:#f4f4f4;color:#303846}.songEditor-headers{display:flex;height:20px;text-transform:uppercase;padding:3px 0;text-align:center;font-size:1.2rem}.theme-dark .songEditor-headers{background-color:#404c4e;color:#f4f4f4b3}.songEditor-sourceHeader,.songEditor-previewHeader{flex:0 1 50%}.songEditor{width:100%;height:calc(100% - 26px);display:flex;flex-direction:row;flex-wrap:nowrap}.songEditor-source{flex:0 1 50%;display:flex;overflow-y:scroll}.theme-dark .songEditor-source{background-color:#1e2324}.songEditor-preview{flex:0 1 50%;overflow-y:scroll}.editorPreview{box-sizing:border-box;padding:.5rem;min-height:100%}.cmTheme-fadeRepeats .cmLine--isFromAutoRepeatChords,.cmTheme-fadeRepeats .cmLine--isFromChordLineRepeater,.cmTheme-fadeRepeats .cmLine--isFromSectionCopy,.cmTheme-fadeRepeats .cmLine--isFromSectionMultiply{opacity:.5}.prosemirrorWrapper{flex:1 1 auto;padding:15px 0}.ProseMirror{height:100%;outline:none;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em}.theme-dark .ProseMirror{color:#dbdbdb}.ProseMirror p{margin:0;padding:0 1rem}.exportPreview{box-sizing:border-box;min-height:100%;padding:1rem}.theme-dark .exportPreview{background-color:#293132;color:#f4f4f4}.exp-SongRenderer{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:15px;white-space:pre-wrap;color:#333}.exp-SongRenderer p{margin:0}.exp-SongRenderer .txtLine{display:block}.theme-light .exp-SongRenderer{color:!important}.theme-dark .exp-SongRenderer{color:#f4f4f4!important}.playRendererWrapper1{position:relative;height:100%;overflow-y:scroll}.playRendererWrapper2{position:absolute;top:0;right:0;bottom:0;left:0}.playRenderer{box-sizing:border-box;min-height:100%}.playRenderer .cmSong{padding:0!important}.playRenderer--columns-1{-moz-column-count:1;column-count:1;padding:1rem}.playRenderer--columns-2{-moz-column-count:2;column-count:2;-moz-column-fill:auto;column-fill:auto;height:100%;padding:1rem}.playRenderer--columns-3{-moz-column-count:3;column-count:3;-moz-column-fill:auto;column-fill:auto;height:100%;padding:1rem}.playRenderer--columns-4{-moz-column-count:4;column-count:4;-moz-column-fill:auto;column-fill:auto;height:100%;padding:1rem}.printPreview{overflow:hidden;min-height:100%}.theme-dark .printPreview{background-color:#293132}@media print{.printPreview{background-color:#fff!important;overflow-y:auto}}.printPreview-page{position:relative;margin:2rem auto;background-color:#fff}@media print{.printPreview-page{margin:0;page-break-after:auto}}.printPreview-pageContentWrapper{position:absolute;top:0;left:0;bottom:0;right:0}.printPreview-pageContent{display:flex;flex-direction:column;flex-wrap:nowrap;height:100%}.printPreview-pageHeader{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;font-size:1.8rem;font-weight:700;margin-bottom:1rem}.printPreview-pageColumnWrapper{flex:1;display:flex;flex-direction:row;flex-wrap:nowrap}.printPreview-pageColumn{flex:1 1 0;margin:0 .7rem}.printPreview-pageColumn:first-of-type{margin-left:0}.printPreview-pageColumn:last-of-type{margin-right:0}.printPreview-page--a4{width:210mm;height:297mm}.printPreview-page--booxmax2pro{width:698px;height:930px}.printPreview-pageContentWrapper--padding1{padding:3mm}.printPreview-pageContentWrapper--padding2{padding:6mm}.printPreview-pageContentWrapper--padding3{padding:9mm}.printPreview-pageContentWrapper--padding4{padding:12mm}.printPreview-pageContentWrapper--padding5{padding:15mm}.cmTheme-print .cmSong{padding:0!important}.measuring-node{visibility:hidden;position:absolute;z-index:-1}.rightBar-isCollapsed .renderingOptionsPanel-isExpanded{display:none}.renderingOptionsPanel-isCollapsed{padding:1rem 0}.rightBar:not(.rightBar-isCollapsed) .renderingOptionsPanel-isCollapsed{display:none}.sb-optionsGroup{padding-top:2rem}.sb-optionsGroup:first-of-type{padding-top:0}.sb-optionsGroup-title{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:.5rem 1rem .5rem .5rem;font-size:1.4rem;font-weight:700}.theme-light .sb-optionsGroup-title{border-bottom:2px solid}.theme-dark .sb-optionsGroup-title{border-bottom:2px solid rgba(244,244,244,.7)}.theme-dark .sb-optionsGroup-isNotInteractable .sb-optionsGroup-title{color:#71819e}.sb-optionsGroup-iconTitle .icon{font-size:1.6rem}.sb-optionsGroup-iconToggle .icon{font-size:1.8rem}.sb-optionSelect{font-size:1.2rem;padding:.5rem 1.5rem .5rem 1rem}.theme-light .sb-optionSelect{border-bottom:1px dotted}.theme-dark .sb-optionSelect{border-bottom:1px dotted #71819e}.theme-dark .sb-optionsGroup .sb-optionSelect{background-color:#1b2028}.sb-optionSelect.sb-optionSelect-isNotInteractable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-dark .sb-optionSelect.sb-optionSelect-isNotInteractable{color:#71819e}.sb-optionSelect:hover{cursor:not-allowed}.sb-optionSelect:hover:not(.sb-optionSelect-isNotInteractable){cursor:pointer}.theme-dark .sb-optionSelect:hover:not(.sb-optionSelect-isNotInteractable){background-color:#596883}.sb-optionSelect-title{display:flex}.sb-optionSelect-desc{flex:1 1 auto}.sb-optionSelect-toggle{flex:0 0 auto}.sb-optionSelect-icon .icon{font-size:1.8rem}.sb-optionSelectChoice-activeLabel{opacity:.5}.sb-optionSelectChoice{padding-top:.5rem;display:flex}.sb-optionSelectChoice:hover:not(.sb-optionSelectChoice-isNotInteractable){text-decoration:underline;cursor:pointer}.sb-optionSelectChoice-isSelected{font-weight:700}.sb-optionSelectChoice-check{flex:0 0 20px}.sb-optionSelectChoice-checkIcon .icon{font-size:1.2rem}.sb-optionSelectChoice-label{flex:1 1 auto}.sb-optionSlider{display:flex;flex-wrap:wrap;font-size:1.2rem;padding:.5rem 1.5rem .5rem 1rem}.theme-light .sb-optionSlider{border-bottom:1px dotted}.theme-dark .sb-optionSlider{border-bottom:1px dotted #71819e}.theme-dark .sb-optionsGroup .sb-optionSlider{background-color:#1b2028}.sb-optionSlider.sb-optionSlider-isNotInteractable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-dark .sb-optionSlider.sb-optionSlider-isNotInteractable{color:#71819e}.sb-optionSlider:hover{cursor:not-allowed}.sb-optionSlider:hover:not(.sb-optionSlider-isNotInteractable){cursor:pointer}.theme-dark .sb-optionSlider:hover:not(.sb-optionSlider-isNotInteractable){background-color:#596883}.sb-optionSlider-desc{flex:1 1 auto}.sb-optionSlider-value{flex:0 0 auto;vertical-align:middle;font-size:1.2rem}.sb-optionSlider-range{flex:1 1 100%}.theme-light .sb-optionSlider-range input[type=range]{-webkit-appearance:none;width:100%;background:transparent}.theme-light .sb-optionSlider-range input[type=range]:focus{outline:none}.theme-light .sb-optionSlider-range input[type=range]::-webkit-slider-runnable-track{width:100%;height:10px;cursor:pointer;animation:.2s;border:0 solid black;border-radius:0;background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-webkit-slider-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#bb8704;-webkit-appearance:none;margin-top:-3.3333333333}.theme-light .sb-optionSlider-range input[type=range]:focus::-webkit-slider-runnable-track{background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-moz-range-track{width:100%;height:10px;cursor:pointer;animation:.2s;border:0 solid black;border-radius:0;background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-moz-range-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#bb8704}.theme-light .sb-optionSlider-range input[type=range]::-ms-track{width:100%;height:10px;cursor:pointer;animation:.2s;color:transparent;border-width:15px 0;border-color:transparent;background:transparent}.theme-light .sb-optionSlider-range input[type=range]::-ms-fill-lower{border:0 solid black;border-radius:0;background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-ms-fill-upper{border:0 solid black;border-radius:0;background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-ms-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#bb8704}.theme-light .sb-optionSlider-range input[type=range]:focus::-ms-fill-lower{background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]:focus::-ms-fill-upper{background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]:disabled::-moz-range-track,.theme-light .sb-optionSlider-range input[type=range]:disabled::-moz-range-thumb{cursor:default}.theme-light .sb-optionSlider-range input[type=range]:disabled::-webkit-slider-runnable-track,.theme-light .sb-optionSlider-range input[type=range]:disabled::-webkit-slider-thumb{cursor:default}.theme-light .sb-optionSlider-range input[type=range]:disabled::-ms-track,.theme-light .sb-optionSlider-range input[type=range]:disabled::-ms-thumb{cursor:default}.theme-dark .sb-optionSlider-range input[type=range]{-webkit-appearance:none;width:100%;background:transparent}.theme-dark .sb-optionSlider-range input[type=range]:focus{outline:none}.theme-dark .sb-optionSlider-range input[type=range]::-webkit-slider-runnable-track{width:100%;height:10px;cursor:pointer;animation:.2s;border:0 solid black;border-radius:0;background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-webkit-slider-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#070809;-webkit-appearance:none;margin-top:-3.3333333333}.theme-dark .sb-optionSlider-range input[type=range]:focus::-webkit-slider-runnable-track{background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-moz-range-track{width:100%;height:10px;cursor:pointer;animation:.2s;border:0 solid black;border-radius:0;background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-moz-range-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#070809}.theme-dark .sb-optionSlider-range input[type=range]::-ms-track{width:100%;height:10px;cursor:pointer;animation:.2s;color:transparent;border-width:15px 0;border-color:transparent;background:transparent}.theme-dark .sb-optionSlider-range input[type=range]::-ms-fill-lower{border:0 solid black;border-radius:0;background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-ms-fill-upper{border:0 solid black;border-radius:0;background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-ms-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#070809}.theme-dark .sb-optionSlider-range input[type=range]:focus::-ms-fill-lower{background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]:focus::-ms-fill-upper{background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]:disabled::-moz-range-track,.theme-dark .sb-optionSlider-range input[type=range]:disabled::-moz-range-thumb{cursor:default}.theme-dark .sb-optionSlider-range input[type=range]:disabled::-webkit-slider-runnable-track,.theme-dark .sb-optionSlider-range input[type=range]:disabled::-webkit-slider-thumb{cursor:default}.theme-dark .sb-optionSlider-range input[type=range]:disabled::-ms-track,.theme-dark .sb-optionSlider-range input[type=range]:disabled::-ms-thumb{cursor:default}.sb-optionSlider-range input[type=range]:disabled{opacity:.35;cursor:not-allowed!important}.sb-optionToggle{display:flex;font-size:1.2rem;padding:.5rem 1.5rem .5rem 1rem}.theme-light .sb-optionToggle{border-bottom:1px dotted}.theme-dark .sb-optionToggle{border-bottom:1px dotted #71819e}.theme-dark .sb-optionsGroup .sb-optionToggle{background-color:#1b2028}.sb-optionToggle.sb-optionToggle-isNotInteractable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-dark .sb-optionToggle.sb-optionToggle-isNotInteractable{color:#71819e}.sb-optionToggle:hover{cursor:not-allowed}.sb-optionToggle:hover:not(.sb-optionToggle-isNotInteractable){cursor:pointer}.theme-dark .sb-optionToggle:hover:not(.sb-optionToggle-isNotInteractable){background-color:#596883}.sb-optionToggle-desc{flex:1 1 auto}.sb-optionToggle-icon{flex:0 0 auto}.theme-dark .sb-optionToggle-isOff .icon{color:#a8a8a8}.sb-optionToggle-icon .icon{font-size:1.8rem}.theme-dark .sb-optionToggle-isOff .sb-optionToggle-icon .icon{color:#a8a8a8} diff --git a/packages/chord-chart-studio/build/assets/index-BwbBfjx-.js b/packages/chord-chart-studio/build/assets/index-BwbBfjx-.js new file mode 100644 index 00000000..3108d3d5 --- /dev/null +++ b/packages/chord-chart-studio/build/assets/index-BwbBfjx-.js @@ -0,0 +1,60 @@ +import{c as Nt,_ as Tt,a as St,d as wt,b as _t,e as Pe,f as k,g as B,p as Q,h as Et,i as qt,v as Ie,R as C,j as r,P as i,k as Me,l as Pt,U as It,m as Mt,q as Oe,I as Ot,n as Lt,$ as kt,u as Le,r as R,o as Fe,s as Bt,t as T,w as Ne,x as At,y as Dt,z as Wt,A as Gt,B as Ht,F as $t,C as zt,D as Te,E as Vt,G as Ut,H as Kt,S as Yt,J as Jt,K as Qt,L as Xt,M as Zt,N as Se,O as en}from"./vendor-BWYuIjsn.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();const tn=()=>{try{const e=localStorage.getItem("state");return e?JSON.parse(e):void 0}catch{return}},nn=e=>{try{const t=JSON.stringify(e);localStorage.setItem("state",t)}catch{}};function ke(){return Date.now()}const A="db/files/Create",D="db/files/Delete",M="db/files/Import",X="db/files/Update",Z="db/options/setOptionValue",W="ui/layout/app/setEditorMode",Be="ui/layout/app/toggleLeftBar",Ae="ui/layout/app/toggleRightBar",rn=e=>e.ui.layout.app.isLeftBarCollapsed,sn=e=>e.ui.layout.app.isRightBarCollapsed,q=e=>e.ui.layout.app.editorMode,S=e=>e.fileManager.selected,on=e=>e.fileManager.renamed,an=e=>e.fileManager.defaultTitle,ln=Nt(wt,_t),ee=ln(e=>Tt(e.db.files.allFiles,({title:t,id:n})=>({title:t,id:n})),e=>St(e,t=>t.title.toLowerCase())),te=(e,t)=>e.db.files.allFiles[t],ne=(e,t,n)=>{const s=e.db.files.allFiles[t];if(s&&(s.options||{})[n])return Object.keys(s.options[n]).length===0?void 0:Pe(s.options[n])},De=(e,t)=>{const n=e.db.files.allFiles[t];if(!n)return;const s=n.options||{},o=[];if(s.edit&&o.push({...s.edit}),s.play&&o.push({...s.play}),s.print&&o.push({...s.print}),s.export&&o.push({...s.export}),!!o.length)return o.sort((a,l)=>a.updatedAt-l.updatedAt),o.reduce((a,l)=>Object.assign(a,l),{})},re={edit:["theme","transposeValue","preferredAccidentals","symbolType"],play:["theme","transposeValue","preferredAccidentals","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy","columnsCount","fontSize"],print:["transposeValue","preferredAccidentals","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy","columnsCount","columnBreakOnSection","documentMargins","fontSize"],export:["chartFormat","transposeValue","preferredAccidentals","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy"]},cn={allFiles:{}};function dn(e,t){const{id:n,title:s,content:o}=t.payload,a={...e.allFiles};return a[n]={id:n,title:s,content:o},{...e,allFiles:a}}function un(e,t){const{id:n,title:s,content:o}=t.payload;if(!s&&typeof o>"u"||!e.allFiles[n])return e;const a={...e.allFiles};return a[n]={...a[n]},s&&(a[n].title=s),typeof o<"u"&&(a[n].content=o),{...e,allFiles:a}}function pn(e,t){const{id:n}=t.payload;if(!n||!e.allFiles[n])return e;const s={...e.allFiles};return delete s[n],{...e,allFiles:s}}function mn(e,t,n){const{context:s,key:o,value:a}=t.payload,l=S(n),c={...e.allFiles};if(["songFormatting","songPreferences"].includes(s)&&c[l]){const d=q(n),u=s==="songPreferences"?"preferences":d;return c[l]=hn(c[l],u,o,a),{...e,allFiles:c}}return e}function hn(e,t,n,s){return{...e,options:{...e.options,[t]:{...(e.options||{})[t],updatedAt:ke(),[n]:s}}}}function gn(e,t,n){const s=S(n),o=t.payload.mode;if(!!!ne(n,s,o)){const l=k(De(n,s)||{},re[o]);if(Object.keys(l).length){l.updatedAt=ke();const c={...e.allFiles};return c[s]={...c[s],options:{...c[s].options,[o]:l}},{...e,allFiles:c}}}return e}const fn=(e=cn,t={},n={})=>{switch(t.type){case A:case M:return dn(e,t);case X:return un(e,t);case D:return pn(e,t);case Z:return mn(e,t,n);case W:return gn(e,t,n)}return e},se="fileManager/select",We="fileManager/enableRename",p=(e,t,n)=>{if(!(!e.db.options[t]||!e.db.options[t].values||typeof e.db.options[t].values[n]>"u"))return e.db.options[t].values[n]},I=(e,t)=>{if(!(!e.db.options[t]||!e.db.options[t].defaults))return Pe(e.db.options[t].defaults)},yn={};function bn(e,t){const{context:n,key:s,value:o}=t.payload;if(!e[n]||!e[n].values||typeof e[n].values[s]>"u")return e;const a={...e,[n]:{...e[n],values:{...e[n].values}}};return a[n].values[s]=o,a}function xn(e,t,n){const s=S(n),o=t.payload.mode,a=Ge(n,s,o);return{...e,songFormatting:{...e.songFormatting,values:{...a}}}}function Ge(e,t,n){const s=I(e,"songFormatting");let o=ne(e,t,n);return o||(o=De(e,t)||{}),delete o.updatedAt,o=k(o,re[n]),Object.assign(s,o)}function Cn(e,t,n){const{id:s}=t.payload,o=q(n),a=Ge(n,s,o),l=ne(n,s,"preferences")||{};delete l.updatedAt;const c=I(n,"songPreferences"),d=Object.assign(c,l);return{...e,songPreferences:{...e.songPreferences,values:{...d}},songFormatting:{...e.songFormatting,values:{...a}}}}const jn=(e=yn,t={},n={})=>{switch(t.type){case Z:return bn(e,t);case W:return xn(e,t,n);case se:return Cn(e,t,n)}return e},Rn=B({files:fn,options:jn}),vn={selected:"",renamed:"",defaultTitle:"[untitled]"};function Fn(e=vn,t={}){switch(t.type){case A:{const{id:n}=t.payload;return{...e,selected:n,renamed:n}}case M:{const{id:n}=t.payload;return{...e,selected:n,renamed:""}}case X:return{...e,renamed:""};case D:return{...e,selected:"",renamed:""};case se:{const{id:n}=t.payload;return{...e,selected:n,renamed:n===e.renamed?n:""}}case We:{const{id:n}=t.payload;return{...e,renamed:n}}}return e}const He="songImporter/import/cancel",ie="songImporter/import/start",$e="songImporter/setContent",ze="songImporter/setInputFormat";function P(e){return Q.sanitize(e,{ALLOWED_TAGS:["#text"],KEEP_CONTENT:!0})}const Nn={content:"",isFromWeb:!1,isImporting:!1,inputFormat:"auto",title:""};function Tn(e=Nn,t={}){switch(t.type){case $e:{const{content:n,title:s=""}=t.payload;return{...e,content:P(n),title:s?P(s):e.title}}case ze:{const{inputFormat:n}=t.payload;return{...e,inputFormat:n}}case M:case He:return{...e,content:"",title:"",isImporting:!1};case ie:{const{content:n,inputFormat:s,title:o,isFromWeb:a}=t.payload;return{...e,isImporting:!0,content:n?P(n):"",title:o?P(o):"",inputFormat:s||e.inputFormat,isFromWeb:a}}}return e}const Sn={isLeftBarCollapsed:!1,isRightBarCollapsed:!1,editorMode:"edit",activeModal:"none"};function wn(e=Sn,t={}){switch(t.type){case Be:return{...e,isLeftBarCollapsed:!e.isLeftBarCollapsed};case Ae:return{...e,isRightBarCollapsed:!e.isRightBarCollapsed};case W:{const{mode:n}=t.payload;return{...e,editorMode:n}}case D:case A:case M:return{...e,editorMode:"edit"}}return e}const _n=B({app:wn}),En=B({layout:_n}),qn=B({db:Rn,fileManager:Fn,songImporter:Tn,ui:En}),Pn={editorPreferences:{values:{theme:"dark1",chartFormat:"chordmark"},defaults:{theme:"dark1",chartFormat:"chordmark"}},songPreferences:{values:{transposeValue:0,preferredAccidentals:"auto",symbolType:"chord"},defaults:{transposeValue:0,preferredAccidentals:"auto",symbolType:"chord"}},songFormatting:{values:{chartType:"all",alignChordsWithLyrics:!0,alignBars:!0,autoRepeatChords:!0,expandSectionCopy:!0,fontSize:0,columnsCount:1,columnBreakOnSection:!0,documentMargins:3},defaults:{chartType:"all",alignChordsWithLyrics:!0,alignBars:!0,autoRepeatChords:!0,expandSectionCopy:!0,fontSize:0,columnsCount:1,columnBreakOnSection:!0,documentMargins:3}}},In={options:Pn},Mn={db:In};let L;function On(){const e=tn();e&&e.db&&e.db.options&&delete e.db.options.rendering;const t=Et(e,Mn);L=qt({reducer:qn,preloadedState:t}),L.subscribe(()=>{nn(L.getState())})}function G(){return L}function v(e,t){if(!e)throw new TypeError("Cannot create an action without an action type");return{type:e,payload:t}}const Ln=(e,t)=>v($e,{content:e,title:t}),kn=e=>v(ze,{inputFormat:e}),Bn=()=>v(ie,{isFromWeb:!1}),An=(e,t,n)=>v(ie,{content:t,inputFormat:e,title:n,isFromWeb:!0}),Dn=()=>v(He),Wn={"@CCS/IMPORT_TAB":e=>{const t=G(),n=Gn(e.title,e.artist);t.dispatch(An(e.inputFormat,e.chordChart,n))}},Gn=(e,t)=>"_"+(t?t+" - ":"")+e;function Hn(){return Wn}function $n(){window.addEventListener("message",zn)}const zn=e=>{const t={...Hn()};if(e.source!==window||e.origin!==window.location.origin)return!1;const n=e.data;return typeof t[n.type]=="function"&&t[n.type](n.payload),!0},Vn=(e,t="")=>{if(!e)throw new TypeError("Cannot create a file without title");const n={id:Ie(),title:e,content:t};return v(A,n)},K=(e,t="")=>{if(!e)throw new TypeError("Cannot import a file without title");const n={id:Ie(),title:e,content:t};return v(M,n)},Ve=(e,{title:t,content:n}={})=>{if(!e)throw new TypeError("Cannot update a file without an id");return v(X,{id:e,title:t,content:n})},Un=e=>v(D,{id:e}),Kn=`Welcome to Chord Chart Studio! + +Chord Chart Studio is the official editor of the ChordMark format. +You can use it to quickly write accurate transcription of songs made up of chords and lyrics. + +A % D7.. E7.. +_Just write _some chords, some _lyrics +% +_And see how it _looks: _terrific! + +Where to start? You can either: +- check the sample song on the left +- read the user guide, by clicking the big yellow button in the top right corner + +Have fun! +`,Yn=`#i +C.. Am.. % +% + +#v +C.. Am.. +I _heard there was a _secret chord +% +That _David played and it _pleased the lord +F... G. C.. G.. +But _you don't really care for _music, _do you? +C.. F. G. +Well it _goes like this the _fourth, the _fifth +Am.. F.. +The _minor fall and the _major lift +G.. E7.. Am +The _baffled king com_posing halle_lujah + +#c +F +Halle_lujah +Am +Halle_lujah +F +Halle_lujah +C.. G.. C.. Am.. +Halle_lu_u_jah + +#v +Well, your _faith was strong but you _needed proof +You _saw her bathing _on the roof +Her _beauty and the moonlight _over_threw you +She _tied you to her _kitchen _chair +She _broke your throne and she _cut your hair +And _from your lips she _drew the halle_lujah + +#c +`;function Jn(){const e=G(),t=e.getState();ee(t).length===0&&(e.dispatch(K("Hallelujah - Leonard Cohen",Yn)),e.dispatch(K("Getting started",Kn)))}class Ue extends C.Component{constructor(t){super(t),this.state={error:null,errorInfo:null}}componentDidCatch(t,n){this.setState({error:t,errorInfo:n})}render(){return this.state.errorInfo?r.jsxs("div",{className:"ErrorBoundary",children:[r.jsx("h2",{children:"Something went wrong"}),r.jsxs("details",{style:{whiteSpace:"pre-wrap"},open:!0,children:[this.state.error&&this.state.error.toString(),r.jsx("br",{}),this.state.errorInfo.componentStack]})]}):this.props.children}}Ue.propTypes={children:i.any};let V;function Qn(e,t){const n=document.getElementById("app");V||(V=Me(n)),V.render(r.jsx(Pt,{store:G(),children:r.jsx(C.StrictMode,{children:r.jsx(Ue,{children:r.jsx(e,{...t})})})}))}const Xn={base:"/app"};let Y,Ke;const Zn={init(e){const t=e.map(n=>({...n,path:Xn.base+n.path,action:s=>({Controller:n.action,params:s.params})}));Y=new It(t,{errorHandler(n,s){console.error(`Error: Cannot find route for path: ${s.pathname}`)}}),Ke=Mt(Y,{stringifyQueryParams:Oe.stringify})}};function H(e,t=!0){const n=new URL(e,window.location.origin);return Y.resolve(n.pathname).then(({Controller:s,params:o}={})=>{if(s){t&&er(e);const a=Oe.parse(n.search,{ignoreQueryPrefix:!0});Qn(s,{...o,...a})}})}function Ye(e,t){try{return Ke(e,t)}catch(n){console.error(n.toString())}}function er(e){window.history.pushState({url:e},null,e)}window.addEventListener("popstate",()=>{const e=window.location.pathname+window.location.search;H(e,!1)});const tr="_button_18d4b_1",nr="_icon_18d4b_8",rr="_label_18d4b_8",sr="_primary_18d4b_41",ir="_secondary_18d4b_58",or="_tertiary_18d4b_76",E={button:tr,icon:nr,label:rr,primary:sr,secondary:ir,tertiary:or};function ar({id:e,size:t}){let n;switch(e){case"plus":n=Lt;break;case"import":n=Ot;break}return r.jsx(n,{size:t})}const we="primary";function lr({children:e,type:t=we,icon:n="",onPress:s}){const o=[E.button,E[t]?E[t]:E[we]],a=n?r.jsx("span",{className:E.icon,children:r.jsx(ar,{id:n,size:20})}):"";return r.jsxs(kt,{onPress:s,className:o.join(" "),children:[a,r.jsx("span",{className:E.label,children:e})]})}function cr(){const t=Le(ee).map(n=>r.jsx(dr,{song:n},n.id));return r.jsxs("div",{children:["Full Library",r.jsx("ul",{children:t}),r.jsx(lr,{children:"My Nice Button"})]})}const dr=({song:e})=>{const t=n=>{n.preventDefault(),H(Ye("songView",{songId:e.id}))};return r.jsx("li",{children:r.jsx("a",{href:`/song/${e.id}`,onClick:t,children:e.title})})},ur=[{name:"library",path:"/library",action:cr}];function pr({songId:e}){const t=Le(s=>te(s,e)),n=s=>{s.preventDefault(),H(Ye("library"))};return r.jsxs("div",{children:[r.jsx("a",{href:"",onClick:n,children:"Go back to list"}),r.jsx("br",{}),r.jsx("b",{children:t.title}),r.jsx("p",{children:t.content})]})}const mr=[{name:"songView",path:"/songView/:songId",action:pr}],Je=e=>v(W,{mode:e}),hr=()=>v(Be),gr=()=>v(Ae),fr="/app/assets/logo-D2B3txiq.svg";function yr(){return r.jsx("div",{className:"logo",children:r.jsx("div",{className:"logo-isExpanded",children:r.jsx("div",{className:"logo-img",children:r.jsxs("svg",{className:"stacked",children:[r.jsx("title",{children:"Chord Chart Studio"}),r.jsx("use",{href:fr+"#stacked"})]})})})})}const br=C.memo(yr);function Qe(e){const{iconName:t}=e,n=["icon","material-icons"];return r.jsx("i",{className:n.join(" "),children:t})}Qe.propTypes={iconName:i.string.isRequired};const x=C.memo(Qe);function Xe(e){const{label:t,icon:n,editorMode:s,setEditorMode:o,isActive:a,isDisabled:l}=e,c=["mainNavEntry"];a&&c.push("mainNavEntry-isActive"),l&&c.push("mainNavEntry-isDisabled");function d(){l||o(s)}return r.jsxs("li",{className:c.join(" "),onClick:d,children:[r.jsx("span",{className:"mainNavEntry-icon",children:r.jsx(x,{iconName:n})}),t]})}Xe.propTypes={label:i.string.isRequired,icon:i.string.isRequired,editorMode:i.string.isRequired,setEditorMode:i.func.isRequired,isActive:i.bool.isRequired,isDisabled:i.bool.isRequired};const xr=C.memo(Xe);function Ze(e){const{currentMode:t,allEntries:n,setEditorMode:s,selectedId:o}=e;return r.jsx("nav",{className:"mainNav",children:r.jsx("ul",{className:"mainNav-entries",children:n.map((a,l)=>r.jsx(xr,{isActive:!!o&&a.editorMode===t,isDisabled:!o,setEditorMode:s,...a},l))})})}Ze.propTypes={currentMode:i.string.isRequired,setEditorMode:i.func.isRequired,selectedId:i.string,allEntries:i.arrayOf(i.shape({id:i.string.isRequired,label:i.string.isRequired,icon:i.string.isRequired,editorMode:i.string.isRequired}))};const Cr=C.memo(Ze),_=({children:e,isDisabled:t,buttonName:n,onClick:s,type:o})=>{const a=["Button"];return o==="primary"&&a.push("Button-primary"),o==="secondary"&&a.push("Button-secondary"),t&&a.push("Button-isDisabled"),r.jsx("button",{className:a.join(" "),disabled:t,type:"button",name:n,onClick:s,children:e})};_.propTypes={children:i.string.isRequired,isDisabled:i.bool,buttonName:i.string.isRequired,type:i.string.isRequired,onClick:i.func.isRequired};_.defaultProps={isDisabled:!1};const jr="https://chord-chart-studio.netlify.app",oe=()=>{const e=()=>{window.open(jr,"_blank").focus()};return r.jsxs("div",{className:"userGuide",children:[r.jsx("div",{className:"userGuide-isCollapsed",children:r.jsx(x,{iconName:"help_outline"})}),r.jsx("div",{className:"userGuide-isExpanded",children:r.jsx(_,{buttonName:"userGuide",type:"primary",onClick:e,children:"User Guide"})})]})};oe.propTypes={};oe.defaultProps={};const Rr=C.memo(oe),vr=()=>({"chord-chart-studio":"v0.14.0","chord-symbol":"v4.0.0","chord-mark":"v0.16.2"});function Fr(){const e=vr();return r.jsx("div",{className:"versions",children:r.jsxs("div",{className:"versions-isExpanded",children:["Chord Chart Studio ",e["chord-chart-studio"],r.jsx("br",{}),"ChordSymbol ",e["chord-symbol"]," ",r.jsx("br",{}),"ChordMark ",e["chord-mark"]," ",r.jsx("br",{}),"Logo by"," ",r.jsx("a",{href:"https://spelling-bee-assistant.app/",target:"_blank",rel:"noreferrer",children:"Dieter Raber"})]})})}const Nr=C.memo(Fr),Tr=e=>e.songImporter.content,Sr=e=>e.songImporter.inputFormat,wr=e=>e.songImporter.title,_r=e=>e.songImporter.isImporting,Er=e=>e.songImporter.isFromWeb;function ae(e){const{children:t,closeModal:n}=e;return R.useEffect(()=>{const s=o=>{o.key==="Escape"&&n()};return window.addEventListener("keyup",s),()=>{window.removeEventListener("keyup",s)}}),r.jsxs("section",{className:"mod-ModalContainer",children:[r.jsx("div",{className:"mod-Overlay",onClick:n,"data-testid":"modal-overlay"}),r.jsx("div",{className:"mod-ContentContainer",children:t})]})}ae.propTypes={children:i.element.isRequired,closeModal:i.func.isRequired};const et=({cancelImport:e,chordMarkContent:t,importFile:n,title:s,content:o,error:a})=>{const l=s?'Import "'+s+'"':"Import song",c=()=>{n(s||"[untitled]",t)};return r.jsxs("div",{className:"sim-Header_Container",children:[r.jsx("div",{className:"sim-Header_Title",children:l}),r.jsxs("div",{className:"sim-Header_Actions",children:[r.jsx(_,{onClick:e,buttonName:"cancel",type:"secondary",children:"CANCEL"}),r.jsx(_,{onClick:c,buttonName:"import",type:"primary",isDisabled:o===""||a!=="",children:"IMPORT"})]})]})};et.propTypes={cancelImport:i.func.isRequired,chordMarkContent:i.string,content:i.string,error:i.string,importFile:i.func.isRequired,title:i.string};const tt=50*1024,qr=e=>new Promise((t,n)=>{if(e.length){const s=e[0];Ir(s)?n(Or(s.size)):Mr(s)?s.text().then(o=>{t({content:o,title:Pr(s)})}).catch(o=>{n(o)}):n(Lr(s))}else n(kr())}),Pr=e=>e.name.substr(0,e.name.lastIndexOf(".")),Ir=e=>e.size>tt,Mr=e=>e.type.indexOf("text")===0||e.type.length===0,Or=e=>"The selected file is too big: "+Fe(e,{round:0})+" (maximum allowed file size is "+Fe(tt,{round:0})+").",Lr=e=>"Cannot import file of type "+e.type+".",kr=()=>"No file selected.",Br="text/*,.cho,.crd,.chopro,.chord,.pro,.txt,.md",nt=({setContent:e})=>{const t=n=>{qr(n.target.files).then(s=>{e(s.content,s.title)}).catch(s=>{e(s)})};return r.jsxs("div",{children:[r.jsx("label",{htmlFor:"importSong-Input",className:"Button Button-primary",children:"Select File"}),r.jsx("input",{id:"importSong-Input",name:"importSong-Input",type:"file",className:"sim-InputFile_Input",onChange:t,accept:Br})]})};nt.propTypes={setContent:i.func.isRequired};function le(e){const{content:t,setContent:n,isDisabled:s}=e,o=l=>{n(l.target.value)},a=["sim-Input_Textarea"];return s&&a.push("sim-Input_Textarea-Disabled"),r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"sim-Input_Header",children:[r.jsx(x,{iconName:"arrow_drop_down"}),"Copy/paste below",r.jsx(x,{iconName:"arrow_drop_down"})]}),r.jsx("textarea",{className:a.join(" "),onChange:o,value:t,disabled:s,"data-testid":"sim-input"})]})}le.propTypes={content:i.string.isRequired,isDisabled:i.bool.isRequired,setContent:i.func.isRequired};le.defaultProps={};function ce(e){const{inputFormat:t,error:n}=e;return r.jsxs("div",{className:"sim-Preview_Error",children:[r.jsxs("p",{children:["There was an error when trying to parse the song in the specified input format (",t,").",r.jsx("br",{}),"Please correct the input or try another format.",r.jsx("br",{}),"The error was:"]}),r.jsxs("p",{children:['"',n,'"']}),r.jsx("p",{children:'Hint: most of the time, this is related to an unclosed "[" or "{" or an unsupported ChordPro directive'})]})}ce.propTypes={error:i.string,inputFormat:i.string.isRequired};ce.defaultProps={};function de(e){const{setInputFormat:t,inputFormat:n,id:s,label:o,isDisabled:a}=e,l=u=>{a||t(u.target.value)},c=["sim-InputFormat_Entry"],d=["sim-InputFormat_Label"];return a&&(c.push("sim-InputFormat_Entry-Disabled"),d.push("sim-InputFormat_Label-Disabled")),r.jsxs(r.Fragment,{children:[r.jsx("input",{className:c.join(" "),type:"radio",name:"inputFormat",id:s,value:s,onChange:l,checked:n===s}),r.jsx("label",{className:d.join(" "),htmlFor:s,children:o})]})}de.propTypes={setInputFormat:i.func.isRequired,inputFormat:i.string.isRequired,id:i.string.isRequired,label:i.string.isRequired,isDisabled:i.bool.isRequired};de.defaultProps={};const Ar=[{id:"auto",label:"Detect"},{id:"chordPro",label:"Bracketed chords (ChordPro)"},{id:"chordsOverLyrics",label:"Chords over lyrics (Ultimate Guitar...)"}];function ue(e){const{setInputFormat:t,inputFormat:n,disableAll:s}=e,o=Ar.map(a=>r.jsx(de,{setInputFormat:t,id:a.id,label:a.label,inputFormat:n,isDisabled:s},a.id));return r.jsxs("div",{className:"sim-InputFormat",children:["Input format:",o]})}ue.propTypes={disableAll:i.bool.isRequired,setInputFormat:i.func.isRequired,inputFormat:i.string.isRequired};ue.defaultProps={};function pe(e){const{cancelImport:t,content:n,importFile:s,isFromWeb:o,isImporting:a,setContent:l,setInputFormat:c,inputFormat:d,title:u}=e;if(!a)return null;let h="",m="";try{h=Bt(n,{inputFormat:d})}catch(f){m=f.message}return r.jsx(ae,{closeModal:t,children:r.jsxs("div",{className:"sim-SongImporterModal_Container","data-testid":"song-importer",children:[r.jsx(et,{cancelImport:t,chordMarkContent:h,content:n,error:m,importFile:s,title:u}),r.jsxs("div",{className:"sim-TwoColumns_Container",children:[r.jsx("div",{className:"sim-Column_Container",children:r.jsx(nt,{setContent:l})}),r.jsx("div",{className:"sim-Column_Container",children:r.jsx(ue,{inputFormat:d,setInputFormat:c,disableAll:o===!0})})]}),r.jsxs("div",{className:"sim-TwoColumns_Container sim-TwoColumns_Container-autoHeight",children:[r.jsx("div",{className:"sim-Column_Container",children:r.jsx(le,{content:n,setContent:l,isDisabled:o})}),r.jsxs("div",{className:"sim-Column_Container",children:[r.jsxs("div",{className:"sim-Input_Header",children:[r.jsx(x,{iconName:"arrow_drop_down"}),"ChordMark preview",r.jsx(x,{iconName:"arrow_drop_down"})]}),r.jsx("div",{className:"sim-Preview_Container","data-testid":"sim-preview",children:m?r.jsx(ce,{inputFormat:d,error:m}):h})]})]})]})})}pe.propTypes={cancelImport:i.func.isRequired,content:i.string.isRequired,importFile:i.func.isRequired,isFromWeb:i.bool.isRequired,isImporting:i.bool.isRequired,setContent:i.func.isRequired,setInputFormat:i.func.isRequired,inputFormat:i.string.isRequired,title:i.string};pe.defaultProps={};const Dr=T(e=>({content:Tr(e),isFromWeb:Er(e),isImporting:_r(e),inputFormat:Sr(e),title:wr(e)}),{setContent:Ln,setInputFormat:kn,cancelImport:Dn,importFile:K})(pe),Wr=[{id:"edit",label:"Edit",icon:"create",editorMode:"edit"},{id:"play",label:"Screen view",icon:"music_note",editorMode:"play"},{id:"print",label:"Print/PDF Preview",icon:"print",editorMode:"print"},{id:"export",label:"Export Preview",icon:"save_alt",editorMode:"export"}];function me(e){const{editorMode:t,isLeftBarCollapsed:n,isRightBarCollapsed:s,toggleLeftBar:o,toggleRightBar:a,setEditorMode:l,selectedId:c,leftBar:d,rightBar:u}=e,h=["leftBar"];n&&h.push("leftBar-isCollapsed");const m=["rightBar"];return s&&m.push("rightBar-isCollapsed"),r.jsxs("div",{className:"appLayout-wrapper",children:[r.jsx(Dr,{}),r.jsxs("section",{className:h.join(" "),children:[r.jsxs("div",{className:"leftBar-content",onClick:n?o:null,children:[r.jsx(br,{}),d]}),r.jsx("div",{className:"leftBar-collapser",onClick:o,"data-testid":"leftBar-collapser",children:r.jsx("span",{className:"leftBar-collapserIcon",children:r.jsx(x,{iconName:"keyboard_arrow_left"})})})]}),r.jsxs("section",{className:"appLayout-main",children:[r.jsx("section",{className:"appLayout-header",children:r.jsx(Cr,{allEntries:Wr,currentMode:t,setEditorMode:l,selectedId:c})}),r.jsx("section",{className:"appLayout-content",children:e.children})]}),r.jsxs("section",{className:m.join(" "),children:[r.jsx("div",{className:"rightBar-collapser",onClick:a,"data-testid":"rightBar-collapser",children:r.jsx("span",{className:"rightBar-collapserIcon",children:r.jsx(x,{iconName:"keyboard_arrow_right"})})}),r.jsxs("div",{className:"rightBar-content",onClick:s?a:null,children:[r.jsx(Rr,{}),u,r.jsx(Nr,{})]})]})]})}me.propTypes={children:i.element,isLeftBarCollapsed:i.bool,isRightBarCollapsed:i.bool,selectedId:i.string,toggleLeftBar:i.func.isRequired,toggleRightBar:i.func.isRequired,editorMode:i.string.isRequired,setEditorMode:i.func.isRequired,leftBar:i.element.isRequired,rightBar:i.element.isRequired};me.defaultProps={isLeftBarCollapsed:!1,isRightBarCollapsed:!1};const Gr=T(e=>({editorMode:q(e),isLeftBarCollapsed:rn(e),isRightBarCollapsed:sn(e),selectedId:S(e)}),{toggleLeftBar:hr,toggleRightBar:gr,setEditorMode:Je})(me),Hr=e=>v(se,{id:e}),$r=e=>v(We,{id:e});function zr(e,t={},n=!1){return st(e,t,n,"text")}function rt(e,t={},n=!1){return st(e,t,n,"html")}function st(e,t,n,s){if(n)switch(t.chartFormat){case"chordmark":{const a=O(e,t);return s==="html"?a:_e(a)}case"chordmarkSrc":return s==="html"?U(e):e;case"chordpro":{t.customRenderer=Wt();const a=O(e,t);return s==="html"?U(a):a}case"ultimateGuitar":{t.customRenderer=Ne();const a=O(e,{...t,customRenderer:Ne(),printBarSeparators:"grids",printChordsDuration:"never",printSubBeatDelimiters:!1,printInlineTimeSignatures:!1,chordSymbolRenderer:At({customFilters:[Dt()],useShortNamings:!0,accidentalsType:t.accidentalsType==="auto"?"original":t.accidentalsType,...t})})+` + +Created with Chord Chart Studio (https://chord-chart-studio.netlify.app)`;return s==="html"?U(a):a}}const o=O(e,{...t,wrapChordLyricLines:!0});return s==="html"?o:_e(o)}function O(e,t){try{const n=Gt(e);return Ht(n,{...t})}catch(n){return n.message}}function U(e){return e.split(` +`).map(t=>t===""?" ":t).map(t=>`${t}`).join("")}function _e(e){return e.match(/(.*?<\/p>)/gm).map(n=>P(n)).map(n=>n===" "?"":n).join(` +`)}function Vr(){const t=G().getState(),n=S(t),s=te(t,n),o={chartFormat:p(t,"editorPreferences","chartFormat"),transposeValue:p(t,"songPreferences","transposeValue"),accidentalsType:p(t,"songPreferences","accidentalsType"),symbolType:p(t,"songPreferences","symbolType"),chartType:p(t,"songFormatting","chartType"),alignChordsWithLyrics:p(t,"songFormatting","alignChordsWithLyrics"),alignBars:p(t,"songFormatting","alignBars"),autoRepeatChords:p(t,"songFormatting","autoRepeatChords"),expandSectionCopy:p(t,"songFormatting","expandSectionCopy")},a=zr(s.content,o,!0),l=o.chartFormat==="chordpro"?"cho":"txt",c=`${s.title}.${l}`,d=new Blob([a],{type:"text/plain;charset=utf-8",endings:"native"});$t.saveAs(d,c)}function it(e){const{confirmAction:t,confirmTitle:n="OK",cancelAction:s,cancelTitle:o="CANCEL",children:a}=e;return r.jsx(ae,{closeModal:s,children:r.jsxs("section",{className:"mod-ModalConfirmContainer",children:[r.jsx("div",{className:"mod-ModalConfirmMessage",children:a}),r.jsxs("div",{className:"mod-ModalConfirmButtons",children:[r.jsx(_,{onClick:s,type:"secondary",buttonName:"cancel",children:o}),r.jsx(_,{onClick:t,type:"primary",buttonName:"confirm",children:n})]})]})})}it.propTypes={confirmAction:i.func.isRequired,confirmTitle:i.string,cancelAction:i.func.isRequired,cancelTitle:i.string,children:i.node.isRequired};function ot(e){const{selected:t,deleteFile:n,isDeleting:s,setIsDeleting:o}=e;if(!s)return null;const a=()=>o(!1),l=()=>{o(!1),n(t)};return r.jsxs(it,{confirmAction:l,confirmTitle:"DELETE",cancelAction:a,children:["Are you sure you want to delete this file?",r.jsx("br",{}),"This action cannot be undone."]})}ot.propTypes={deleteFile:i.func.isRequired,isDeleting:i.bool.isRequired,selected:i.string.isRequired,setIsDeleting:i.func.isRequired};function at(e){const{icon:t,text:n,action:s,isDisabled:o}=e,a=["fileManagerAction"];o&&a.push("fileManagerAction-isDisabled");const l=()=>{o||s()};return r.jsx("span",{className:a.join(" "),onClick:l,children:r.jsxs("span",{className:"fileManagerAction-icon",children:[r.jsx(x,{iconName:t})," ",n]})})}at.propTypes={icon:i.string.isRequired,text:i.string.isRequired,action:i.func.isRequired,isDisabled:i.bool.isRequired};const Ur=C.memo(at);function lt(e){const{selected:t,createFile:n,deleteFile:s,enableRename:o,startImport:a,exportAsText:l,printFile:c}=e,d=[{icon:"upload",text:"Import",action:a,isDisabled:!1},{icon:"add_circle",text:"New",action:n,isDisabled:!1},{icon:"create",text:"Rename",action:o,isDisabled:!t},{icon:"delete",text:"Delete",action:s,isDisabled:!t},{icon:"print",text:"Print",action:c,isDisabled:!t},{icon:"download",text:"Export",action:l,isDisabled:!t}];return r.jsx("div",{className:"fileManager-actionsList",children:d.map((u,h)=>R.createElement(Ur,{...u,key:h}))})}lt.propTypes={selected:i.string,createFile:i.func.isRequired,deleteFile:i.func.isRequired,enableRename:i.func.isRequired,exportAsText:i.func.isRequired,printFile:i.func.isRequired,startImport:i.func.isRequired};const Kr=C.memo(lt);function ct(e){const[t,n]=R.useState(e.title),{fileId:s,isSelected:o,isRenamed:a,defaultTitle:l,selectFile:c,enableRename:d,updateFile:u}=e,h=["fileManagerEntry"];o&&h.push("fileManagerEntry-isSelected"),a&&h.push("fileManagerEntry-isRenamed");const m=C.createRef();R.useEffect(()=>{a&&m.current.focus()},[a,m]);function f(){o||c(s)}function g(b){a||(d(s),b.target.select())}function y(b){if(a&&b.which===13){b.preventDefault(),window.getSelection().removeAllRanges();const z=b.target.value;j(z)}}function w(b){n(b.target.value)}function N(b){a&&b.target.select()}function F(b){if(a){const z=b.target.value;j(z)}}function j(b){b=b||l,u(s,{title:b}),n(b),m.current.scrollLeft=0}return r.jsx("li",{className:h.join(" "),onClick:f,onDoubleClick:g,children:r.jsx("input",{className:"fileManagerEntry-input",ref:m,type:"text",value:t,readOnly:a?null:"readOnly",autoFocus:a?"autoFocus":null,onChange:w,onBlur:F,onFocus:N,onKeyPress:y})})}ct.propTypes={title:i.string.isRequired,fileId:i.string.isRequired,isSelected:i.bool.isRequired,isRenamed:i.bool.isRequired,defaultTitle:i.string.isRequired,selectFile:i.func.isRequired,enableRename:i.func.isRequired,updateFile:i.func.isRequired};function dt(e){const[t,n]=R.useState(!1),{allTitles:s,selected:o,renamed:a,defaultTitle:l,createFile:c,deleteFile:d,enableRename:u,startImport:h,selectFile:m,updateFile:f,setEditorMode:g}=e;return r.jsxs("div",{className:"fileManager",children:[r.jsx(ot,{deleteFile:d,isDeleting:t,selected:o,setIsDeleting:n}),r.jsx("div",{className:"fileManager-isCollapsed",children:r.jsx("span",{className:"fileManager-icon",children:r.jsx(x,{iconName:"file_copy"})})}),r.jsxs("div",{className:"fileManager-isExpanded",children:[r.jsx(Kr,{selected:o,createFile:()=>c(l),deleteFile:()=>n(!0),enableRename:()=>u(o),startImport:()=>h(),exportAsText:()=>{g("export"),setTimeout(()=>Vr(),0)},printFile:()=>{g("print"),setTimeout(()=>window.print(),0)}}),r.jsx("ul",{className:"fileManager-entriesList",children:s.map(y=>r.jsx(ct,{title:y.title,defaultTitle:l,fileId:y.id,isSelected:o===y.id,isRenamed:a===y.id,selectFile:m,updateFile:f,enableRename:u},y.id))})]})]})}dt.propTypes={allTitles:i.arrayOf(i.shape({title:i.string.isRequired,id:i.string.isRequired})).isRequired,selected:i.string.isRequired,renamed:i.string.isRequired,defaultTitle:i.string.isRequired,selectFile:i.func.isRequired,createFile:i.func.isRequired,deleteFile:i.func.isRequired,enableRename:i.func.isRequired,startImport:i.func.isRequired,updateFile:i.func.isRequired,setEditorMode:i.func.isRequired};const Yr=T(e=>({selected:S(e),renamed:on(e),defaultTitle:an(e),allTitles:ee(e)}),{selectFile:Hr,createFile:Vn,deleteFile:Un,updateFile:Ve,enableRename:$r,setEditorMode:Je,startImport:Bn})(dt);function ut(e){return Q.sanitize(e)}function he(e){const{content:t,useChartFormat:n}=e,s=k(e,["chartFormat","transposeValue","accidentalsType","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy"]),o=rt(t,s,n);return r.jsx("div",{className:"songRenderer",children:r.jsx("div",{dangerouslySetInnerHTML:{__html:ut(o)}})})}he.propTypes={useChartFormat:i.bool.isRequired,chartFormat:i.string.isRequired,content:i.string};he.defaultProps={content:"",useChartFormat:!1};const ge=T(e=>({transposeValue:p(e,"songPreferences","transposeValue"),accidentalsType:p(e,"songPreferences","preferredAccidentals"),symbolType:p(e,"songPreferences","symbolType"),chartFormat:p(e,"editorPreferences","chartFormat"),chartType:p(e,"songFormatting","chartType"),alignChordsWithLyrics:p(e,"songFormatting","alignChordsWithLyrics"),alignBars:p(e,"songFormatting","alignBars"),autoRepeatChords:p(e,"songFormatting","autoRepeatChords"),expandSectionCopy:p(e,"songFormatting","expandSectionCopy")}))(he);function pt(e){const{selectedFile:t}=e,n=["editorPreview"];return r.jsx("div",{className:n.join(" "),children:r.jsx(ge,{content:t.content})})}pt.propTypes={selectedFile:i.object.isRequired};function Jr(){return[zt(),Te({"Mod-z":Vt,"Mod-y":Ut}),Te(Kt)]}const Qr=new Yt({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}},text:{group:"inline"}}});function Xr(e){return e.toJSON().doc.content.map(n=>n.content?n.content.reduce((s,o)=>(s+=o.text||` +`,s),""):"").join(` +`)}function Ee(e){const t={ALLOWED_TAGS:["p","#text"],KEEP_CONTENT:!1};return Q.sanitize(e,t)}function Zr(e){const t=Ee(e).split(` +`).map(s=>`

${s}

`).join(""),n=document.createElement("div");return n.innerHTML=Ee(t),n}function es(e){return Jt.create({doc:Qt.fromSchema(Qr).parse(Zr(e),{preserveWhitespace:"full"}),plugins:Jr()})}function ts(e,t,n){return new Xt(null,{state:e,dispatchTransaction:function(o){const{state:a,transactions:l}=this.state.applyTransaction(o);this.updateState(a),l.some(c=>c.docChanged)&&t(n,{content:Xr(a)})}})}function $(e){const{selectedFileId:t,editorContent:n,updateFile:s}=e,o=R.useRef(),a=R.useRef(),l=ns(t);function c(){return t&&(!o.current||l!==t)}function d(){return u()&&!t}function u(){return o.current&&o.current.dom.parentNode}function h(){o.current.dom.parentNode.removeChild(o.current.dom)}return R.useEffect(()=>{if(c()){u()&&h();const m=es(n);o.current=ts(m,s,t),a.current.appendChild(o.current.dom),$.editorView=o.current}else d()&&h()}),r.jsx("div",{className:"prosemirrorWrapper",ref:a})}$.defaultProps={selectedFileId:"",editorContent:""};$.propTypes={selectedFileId:i.string,editorContent:i.string,updateFile:i.func.isRequired};function ns(e){const t=R.useRef();return R.useEffect(()=>{t.current=e}),t.current}function mt(e){const{selectedFile:t,updateFile:n,theme:s}=e,o=["songEditor-preview","cmTheme-"+s,"cmTheme-fadeRepeats"];return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"songEditor-headers",children:[r.jsxs("div",{className:"songEditor-sourceHeader",children:[r.jsx(x,{iconName:"arrow_drop_down"}),"ChordMark source (",r.jsx("a",{href:"https://chordmark.netlify.app/docs/getting-started",target:"_blank",rel:"noreferrer",className:"link1",children:"tutorial"}),")",r.jsx(x,{iconName:"arrow_drop_down"})]}),r.jsxs("div",{className:"songEditor-previewHeader",children:[r.jsx(x,{iconName:"arrow_drop_down"}),"Result preview",r.jsx(x,{iconName:"arrow_drop_down"})]})]}),r.jsx(Zt,{children:r.jsxs("div",{className:"songEditor",children:[r.jsx(Se,{group:"a",children:r.jsx("div",{className:"songEditor-source",children:r.jsx($,{editorContent:t.content,updateFile:n,selectedFileId:t.id})})}),r.jsx(Se,{group:"a",children:r.jsx("div",{className:o.join(" "),children:r.jsx(pt,{selectedFile:t})})})]})})]})}mt.propTypes={selectedFile:i.object,theme:i.string.isRequired,updateFile:i.func.isRequired};const rs=T(e=>({theme:p(e,"editorPreferences","theme")}))(mt);function ht(e){const{selectedFile:t}=e,n=C.createRef(),s=o=>{(o.metaKey||o.ctrlKey)&&o.key.toLowerCase()==="a"&&(o.preventDefault(),window.getSelection().selectAllChildren(n.current))};return R.useEffect(()=>(window.addEventListener("keydown",s),()=>{window.removeEventListener("keydown",s)})),r.jsx("div",{className:"exportPreview exp-SongRenderer",ref:n,children:r.jsx(ge,{content:t.content,useChartFormat:!0})})}ht.propTypes={selectedFile:i.object.isRequired};function gt(e){const{theme:t,selectedFile:n,fontSize:s,columnsCount:o}=e,a=["playRendererWrapper1"];a.push("cmTheme-"+t),a.push("cmSong--fontSize"+s);const l=["playRenderer"];return l.push("playRenderer--columns-"+o),r.jsx("div",{className:a.join(" "),"data-testid":"playRendererWrapper1",children:r.jsx("div",{className:"playRendererWrapper2",children:r.jsx("div",{className:l.join(" "),"data-testid":"playRenderer",children:r.jsx(ge,{content:n.content})})})})}gt.propTypes={theme:i.string.isRequired,fontSize:i.number.isRequired,selectedFile:i.object.isRequired,columnsCount:i.number.isRequired};const ss=T(e=>({theme:p(e,"editorPreferences","theme"),fontSize:p(e,"songFormatting","fontSize"),columnsCount:p(e,"songFormatting","columnsCount")}))(gt);function fe(e){const{pageHeader:t,allColumnsLines:n,documentSize:s,documentMargins:o,fontSize:a}=e,l=n.map((u,h)=>{const m=u.join("");return r.jsx("div",{className:"printPreview-pageColumn","data-testid":"printPreview-pageColumn",dangerouslySetInnerHTML:{__html:ut(m)}},h)}),c=["printPreview-page"];c.push("printPreview-page--"+s),c.push("cmSong--fontSize"+a),c.push("cmSong");const d=["printPreview-pageContentWrapper"];return d.push("printPreview-pageContentWrapper--padding"+o),r.jsx("div",{className:c.join(" "),"data-testid":"printPreview-page",children:r.jsx("div",{className:d.join(" "),"data-testid":"printPreview-pageContentWrapper",children:r.jsxs("div",{className:"printPreview-pageContent",children:[t,r.jsx("div",{className:"printPreview-pageColumnWrapper",children:l})]})})})}fe.defaultProps={allColumnsLines:[]};fe.propTypes={pageHeader:i.element,allColumnsLines:i.arrayOf(i.arrayOf(i.string)),documentSize:i.string.isRequired,documentMargins:i.number.isRequired,fontSize:i.number.isRequired};const ye=C.memo(fe);function be(e){const{title:t}=e;return r.jsx("div",{className:"printPreview-pageHeader",children:t})}be.defaultProps={allColumnsLines:[]};be.propTypes={title:i.string.isRequired};const ft=C.memo(be),xe={emptyLine:"cmEmptyLine",chordLine:"cmChordLine",textLine:"cmLyricLine"};function is(e,{columnsCount:t,firstPageHeight:n,normalPageHeight:s,columnBreakOnSection:o,noEmptyLinesOnColumnStart:a=!0,noOrphanTextLine:l=!0}){const c=ds({columnsCount:t,firstPageHeight:n,normalPageHeight:s,noEmptyLinesOnColumnStart:a});let d=[],u=0;return(n||s)>0&&e.forEach((m,f)=>{os(c,m,d,a)&&(d.push(m),u+=m.height),d.length>0&&as(m,e[f+1],{noOrphanTextLine:l,columnBreakOnSection:o})&&(c.fitsOnCurrentColumn(u)?c.insert(d):c.fitsOnNextColumn(u)?c.insertOnNextColumn(d):c.insert(d),d=[],u=0)}),c.get()}function os(e,t,n,s){return!(J(t)&&!e.fitsOnCurrentColumn(t.height)&&n.length===0&&s===!0)}function as(e,t,{noOrphanTextLine:n,columnBreakOnSection:s}){if(J(e)||!t)return!0;const o=ls(e)&&cs(t);if(n===!0&&o)return!1;const a=J(t);return!(s===!0&&!a)}function J(e){return Ce(e.content,xe.emptyLine)}function ls(e){return Ce(e.content,xe.chordLine)}function cs(e){return Ce(e.content,xe.textLine)}function Ce(e,t){return e.indexOf(t)>-1}function ds({firstPageHeight:e,normalPageHeight:t,columnsCount:n}){const s=[];let o=0,a=0,l=u(),c=0;s[o]=[],s[o][a]=[];function d(g){g.forEach(y=>{h(c+y.height)&&m(),s[o][a].push(y.content),c+=y.height})}function u(){return o===0&&e?e:t}function h(g){return g>l}function m(){f()?(o++,s[o]=[],a=0):a++,s[o][a]=[],c=0,l=u()}function f(){return a===n-1}return{insert(g){d(g)},insertOnNextColumn(g){m(),d(g)},fitsOnCurrentColumn(g){return c+g<=l},fitsOnNextColumn(g){const y=o===0&&a{const a=()=>(R.useLayoutEffect(()=>{const l=t(n);o(l)}),r.jsx("div",{children:e}));s.render(r.jsx(a,{}))}).then(o=>(s.unmount(),n.parentNode.removeChild(n),o))}function je(e,t=[]){for(let n=t.length||0;n{const d=[];return c.querySelectorAll(ps.line).forEach(u=>{d.push(us(u))}),d})}async function hs(e,{columnsCount:t,documentSize:n,documentMargins:s,fontSize:o}){const a=r.jsx(ye,{pageHeader:r.jsx(ft,{title:e}),allColumnsLines:je(t),documentSize:n,documentMargins:s,fontSize:o});return await yt(a,c=>{const d=c.querySelector(".printPreview-pageContent"),u=c.querySelector(".printPreview-pageColumnWrapper");return{firstPageHeight:qe(u),normalPageHeight:qe(d)}})}function bt(e){const[t,n]=R.useState([]),{title:s,allLines:o,columnsCount:a,columnBreakOnSection:l,documentSize:c,documentMargins:d,fontSize:u}=e;R.useLayoutEffect(()=>{(async()=>{const f={columnsCount:a,documentSize:c,documentMargins:d,fontSize:u},g=await ms(o,f),{normalPageHeight:y,firstPageHeight:w}=await hs(s,f),N=o.map((j,b)=>({content:j,height:g[b]})),F=is(N,{columnsCount:a,columnBreakOnSection:l,normalPageHeight:y,firstPageHeight:w});n(F)})()},[o,s,a,l,c,d,u]);const h=t.map((m,f)=>r.jsx(ye,{pageHeader:f===0?r.jsx(ft,{title:s}):null,allColumnsLines:je(a,m),documentSize:c,documentMargins:d,fontSize:u},f));return r.jsx(C.Fragment,{children:h})}bt.propTypes={title:i.string.isRequired,allLines:i.arrayOf(i.string).isRequired,columnsCount:i.number.isRequired,columnBreakOnSection:i.bool.isRequired,documentSize:i.string.isRequired,documentMargins:i.number.isRequired,fontSize:i.number.isRequired};function xt(e){const{selectedFile:t}=e,n=k(e,["transposeValue","accidentalsType","symbolType","chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy"]),o=rt(t.content||"",{...n}).match(/(.*?<\/p>)/gm),a=["printPreview","cmTheme-print"];return r.jsx("div",{className:a.join(" "),"data-testid":"printPreview",children:r.jsx(bt,{title:t.title||"",allLines:o,columnsCount:e.columnsCount,columnBreakOnSection:e.columnBreakOnSection,documentSize:e.documentSize||"a4",documentMargins:e.documentMargins,fontSize:e.fontSize})})}xt.propTypes={chartType:i.string.isRequired,selectedFile:i.object.isRequired,columnsCount:i.number.isRequired,columnBreakOnSection:i.bool.isRequired,documentSize:i.string,documentMargins:i.number.isRequired,fontSize:i.number.isRequired};const gs=T(e=>({accidentalsType:p(e,"songPreferences","preferredAccidentals"),transposeValue:p(e,"songPreferences","transposeValue"),symbolType:p(e,"songPreferences","symbolType"),chartType:p(e,"songFormatting","chartType"),alignChordsWithLyrics:p(e,"songFormatting","alignChordsWithLyrics"),alignBars:p(e,"songFormatting","alignBars"),autoRepeatChords:p(e,"songFormatting","autoRepeatChords"),expandSectionCopy:p(e,"songFormatting","expandSectionCopy"),columnsCount:p(e,"songFormatting","columnsCount"),columnBreakOnSection:p(e,"songFormatting","columnBreakOnSection"),documentMargins:p(e,"songFormatting","documentMargins"),fontSize:p(e,"songFormatting","fontSize")}))(xt);function Ct(e){const{editorMode:t}=e;switch(t){case"edit":return r.jsx(rs,{...e});case"play":return r.jsx(ss,{...e});case"print":return r.jsx(gs,{...e});case"export":return r.jsx(ht,{...e})}}Ct.propTypes={editorMode:i.string.isRequired};const fs=T(e=>({selectedFile:te(e,S(e))||{},editorMode:q(e)}),{updateFile:Ve})(Ct);function jt(e){const{id:t,allWidgets:n,nonInteractableWidgets:s,hiddenWidgets:o,setOption:a,getEntryComponent:l}=e,c=["optionsPanel","optionsPanel-"+t];let d,u,h,m,f,g,y;const w=n.widgetsOrder.filter(F=>!o.includes(F)).map(F=>(d=n.allWidgets[F],d.type==="optionsGroup"?(y=d.groupWidgetsOrder.filter(j=>!o.includes(j)).map(j=>(u=d.allGroupWidgets[j],g=!s.includes(F)&&!s.includes(j),N(j,u,g))),y.length===0?null:(m=l(d.type),f=!s.includes(F),r.jsx(m,{isInteractable:f,label:d.label,icon:d.icon,children:y},F))):N(F,d,!s.includes(F))));function N(F,j,b){return h=l(j.type),r.jsx(h,{isInteractable:b,optionContext:j.option.context,optionKey:j.option.key,optionValue:e[j.option.key],setOption:a,label:j.label,...j.typeOptions},F)}return r.jsx("div",{className:c.join(" "),children:w})}jt.propTypes={id:i.string.isRequired,allWidgets:i.object.isRequired,nonInteractableWidgets:i.arrayOf(i.string).isRequired,hiddenWidgets:i.arrayOf(i.string).isRequired,setOption:i.func.isRequired,getEntryComponent:i.func.isRequired};function Re(e){const{isInteractable:t,icon:n,label:s}=e,o=["sb-optionsGroup"];a()||o.push("sb-optionsGroup-isNotInteractable");function a(){return t&&e.children&&e.children.length>0}return r.jsxs("div",{className:o.join(" "),children:[r.jsxs("div",{className:"sb-optionsGroup-title",children:[r.jsx("span",{className:"sb-optionsGroup-iconTitle",children:r.jsx(x,{iconName:n})})," ",s]}),r.jsx("div",{className:"sb-optionsGroup-content",children:e.children})]})}Re.propTypes={isInteractable:i.bool.isRequired,icon:i.string.isRequired,label:i.string.isRequired,children:i.arrayOf(i.element)};Re.defaultProps={};function Rt(e){const{isSelected:t,isInteractable:n,label:s,onClick:o}=e;let a;const l=["sb-optionSelectChoice"];t&&(l.push("sb-optionSelectChoice-isSelected"),a=r.jsx("span",{className:"sb-optionSelectChoice-checkIcon",children:r.jsx(x,{iconName:"check"})})),n||l.push("sb-optionSelectChoice-isNotInteractable");function c(){n&&o()}return r.jsxs("div",{className:l.join(" "),onClick:c,children:[r.jsx("div",{className:"sb-optionSelectChoice-check",children:t&&a}),r.jsx("div",{className:"sb-optionSelectChoice-label",children:s})]})}Rt.propTypes={isSelected:i.bool.isRequired,isInteractable:i.bool.isRequired,label:i.string.isRequired,onClick:i.func.isRequired};const ys=C.memo(Rt);function vt(e){const[t,n]=R.useState(!1),{isInteractable:s,label:o,allChoices:a,optionContext:l,optionKey:c,optionValue:d,setOption:u}=e,h=["sb-optionSelect"];s||h.push("sb-optionSelect-isNotInteractable");const m=t?"keyboard_arrow_down":"keyboard_arrow_right";function f(){n(!t)}const g=t?r.jsx("div",{className:"sb-optionSelect-choices",children:a.map(N=>r.jsx(ys,{label:N.label,isSelected:d===N.value,isInteractable:s,onClick:()=>{u(l,c,N.value)}},N.value))}):null,y=a.find(N=>d===N.value).label,w=t?o:r.jsxs("span",{children:[r.jsx("span",{children:o+": "}),r.jsx("span",{className:"sb-optionSelectChoice-activeLabel",children:y})]});return r.jsxs("div",{className:h.join(" "),children:[r.jsxs("div",{className:"sb-optionSelect-title",onClick:s?f:null,children:[r.jsx("div",{className:"sb-optionSelect-desc","data-testid":"selectLabel",children:w}),r.jsx("div",{className:"sb-optionSelect-toggle",children:r.jsx("span",{className:"sb-optionSelect-icon",children:r.jsx(x,{iconName:m})})})]}),g]})}vt.propTypes={isInteractable:i.bool.isRequired,label:i.string.isRequired,allChoices:i.array.isRequired,optionContext:i.string.isRequired,optionKey:i.string.isRequired,optionValue:i.string.isRequired,setOption:i.func.isRequired};function ve(e){const{isInteractable:t,label:n,min:s,max:o,showPlusSymbol:a,optionContext:l,optionKey:c,optionValue:d,setOption:u}=e,h=["sb-optionSlider"];t||h.push("sb-optionSlider-isNotInteractable");function m(g){u(l,c,Number.parseInt(g.target.value))}const f=d>0&&a?"+"+d:d;return r.jsxs("div",{className:h.join(" "),children:[r.jsx("div",{className:"sb-optionSlider-desc",children:n}),r.jsx("div",{className:"sb-optionSlider-value",children:f}),r.jsx("div",{className:"sb-optionSlider-range",children:r.jsx("input",{min:s,max:o,value:d,type:"range",onChange:t?m:null,disabled:!t})})]})}ve.propTypes={isInteractable:i.bool.isRequired,label:i.string.isRequired,min:i.number.isRequired,max:i.number.isRequired,showPlusSymbol:i.bool,optionContext:i.string.isRequired,optionKey:i.string.isRequired,optionValue:i.number.isRequired,setOption:i.func.isRequired};ve.defaultProps={showPlusSymbol:!0};const bs=C.memo(ve);function Ft(e){const{isInteractable:t,label:n,optionContext:s,optionKey:o,optionValue:a,setOption:l}=e,c=["sb-optionToggle"];c.push(a===!0?"sb-optionToggle-isOn":"sb-optionToggle-isOff"),t||c.push("sb-optionToggle-isNotInteractable");function d(){l(s,o,!a)}return r.jsxs("div",{className:c.join(" "),onClick:t?d:null,children:[r.jsx("div",{className:"sb-optionToggle-desc",children:n}),r.jsx("div",{className:"sb-optionToggle-icon",children:r.jsx("span",{className:"sb-optionToggle-icon",children:r.jsx(x,{iconName:a===!0?"toggle_on":"toggle_off"})})})]})}Ft.propTypes={isInteractable:i.bool.isRequired,label:i.string.isRequired,optionContext:i.string.isRequired,optionKey:i.string.isRequired,optionValue:i.bool.isRequired,setOption:i.func.isRequired};const xs=C.memo(Ft);function Cs(e){switch(e){case"optionsGroup":return Re;case"select":return vt;case"slider":return bs;case"toggle":return xs}}function js(e){return r.jsx("div",{className:"sb-optionsPanel",children:r.jsx(jt,{...e,getEntryComponent:Cs})})}function Rs(e){return r.jsxs("div",{className:"renderingOptionsPanel",children:[r.jsx("div",{className:"renderingOptionsPanel-isCollapsed",children:r.jsx("span",{className:"renderingOptionsPanel-icon",children:r.jsx(x,{iconName:"settings"})})}),r.jsx("div",{className:"renderingOptionsPanel-isExpanded",children:r.jsx(js,{...e,id:"rendering"})})]})}const vs=(e,t,n)=>{if(!e)throw new TypeError("Cannot set an option without a context");if(!t)throw new TypeError("Cannot set an option without a key");return v(Z,{context:e,key:t,value:n})};function Fs(e,t,n,s){return T(o=>{const a={allWidgets:e,nonInteractableWidgets:t(o),hiddenWidgets:n(o)};let l,c;return e.widgetsOrder.forEach(d=>{l=e.allWidgets[d],l.groupWidgetsOrder.forEach(u=>{c=l.allGroupWidgets[u],a[c.option.key]=p(o,c.option.context,c.option.key)})}),a},{setOption:vs})(s)}const Ns={widgetsOrder:["editorPreferences","key","preferences","layout"],allWidgets:{editorPreferences:{label:"Editor preferences",type:"optionsGroup",icon:"tune",groupWidgetsOrder:["theme","chartFormat"],allGroupWidgets:{theme:{label:"Theme",type:"select",typeOptions:{allChoices:[{id:"themeDark1",label:"Dark 1 (default)",value:"dark1"},{id:"themeDark2",label:"Dark 2",value:"dark2"},{id:"themeDark3",label:"Dark 3",value:"dark3"}]},option:{context:"editorPreferences",key:"theme"}},chartFormat:{label:"Export format",type:"select",typeOptions:{allChoices:[{id:"formatChordMark",label:"ChordMark",value:"chordmark"},{id:"formatChordMarkSrc",label:"ChordMark (Source)",value:"chordmarkSrc"},{id:"formatChordpro",label:"ChordPro",value:"chordpro"},{id:"formatUG",label:"UltimateGuitar",value:"ultimateGuitar"}]},option:{context:"editorPreferences",key:"chartFormat"}}}},key:{label:"Key",type:"optionsGroup",icon:"music_note",groupWidgetsOrder:["transposeValue","preferredAccidentals","symbolType"],allGroupWidgets:{transposeValue:{label:"Transpose",type:"slider",typeOptions:{min:-11,max:11,showPlusSymbol:!0},option:{context:"songPreferences",key:"transposeValue"}},preferredAccidentals:{label:"Preferred accidentals",type:"select",typeOptions:{allChoices:[{id:"preferredAccidentalsAuto",label:"Auto",value:"auto"},{id:"preferredAccidentalsSharp",label:"♯",value:"sharp"},{id:"preferredAccidentalsFlat",label:"♭",value:"flat"}]},option:{context:"songPreferences",key:"preferredAccidentals"}},symbolType:{label:"Symbols type",type:"select",typeOptions:{allChoices:[{id:"symbolTypeChord",label:"Chord symbols",value:"chord"},{id:"symbolTypeRoman",label:"Roman numerals",value:"roman"}]},option:{context:"songPreferences",key:"symbolType"}}}},preferences:{label:"Chart settings",type:"optionsGroup",icon:"tune",groupWidgetsOrder:["chartType","alignChordsWithLyrics","alignBars","autoRepeatChords","expandSectionCopy"],allGroupWidgets:{chartType:{label:"Type",type:"select",typeOptions:{allChoices:[{id:"typedisplayAll",label:"Show everything",value:"all"},{id:"typedisplayLyrics",label:"Lyrics only",value:"lyrics"},{id:"typedisplayChords",label:"Chords only",value:"chords"},{id:"typedisplayChordsFirstLyricLine",label:"Chords + First lyric line",value:"chordsFirstLyricLine"}]},option:{context:"songFormatting",key:"chartType"}},alignChordsWithLyrics:{label:"Align chords with lyrics",type:"toggle",option:{context:"songFormatting",key:"alignChordsWithLyrics"}},alignBars:{label:"Align bars",type:"toggle",option:{context:"songFormatting",key:"alignBars"}},autoRepeatChords:{label:"Auto repeat chords",type:"toggle",option:{context:"songFormatting",key:"autoRepeatChords"}},expandSectionCopy:{label:"Expand copied sections",type:"toggle",option:{context:"songFormatting",key:"expandSectionCopy"}}}},layout:{type:"optionsGroup",label:"Layout",icon:"view_compact",groupWidgetsOrder:["fontSize","columnsCount","columnBreakOnSection","documentMargins"],allGroupWidgets:{fontSize:{label:"Font size",type:"slider",typeOptions:{min:-5,max:5,showPlusSymbol:!0},option:{context:"songFormatting",key:"fontSize"}},columnsCount:{label:"Columns",type:"slider",typeOptions:{min:1,max:4},option:{context:"songFormatting",key:"columnsCount"}},columnBreakOnSection:{label:"Column Break on section",type:"toggle",option:{context:"songFormatting",key:"columnBreakOnSection"}},documentMargins:{label:"Margins",type:"slider",typeOptions:{min:1,max:5},option:{context:"songFormatting",key:"documentMargins"}}}}}},Ts=e=>{const t=[],n=p(e,"songFormatting","chartType");n==="lyrics"?(t.push("alignChordsWithLyrics"),t.push("alignBars"),t.push("autoRepeatChords")):n==="chords"&&t.push("alignChordsWithLyrics");const s=p(e,"editorPreferences","chartFormat");return q(e)==="export"&&s==="chordmarkSrc"&&(t.push("chartType"),t.push("alignChordsWithLyrics"),t.push("alignBars"),t.push("autoRepeatChords"),t.push("expandSectionCopy")),t},Ss=e=>{const t=[],n=Object.keys({...I(e,"editorPreferences"),...I(e,"songFormatting"),...I(e,"songPreferences")});if(!S(e))return n;const o=q(e),a=en(n,re[o]);return t.push(...a),t},ws=Fs(Ns,Ts,Ss,Rs);function _s(){const e=r.jsx(Yr,{}),t=r.jsx(ws,{});return r.jsx(Gr,{leftBar:e,rightBar:t,children:r.jsx(fs,{})})}const Es=[{name:"home",path:"",action:_s},...ur,...mr];$n();function qs(){On(),Jn();const e=window?window.location.pathname+window.location.search:"/";return Zn.init(Es),H(e)}qs(); diff --git a/packages/chord-chart-studio/build/assets/index-s8b48HYU.css b/packages/chord-chart-studio/build/assets/index-s8b48HYU.css new file mode 100644 index 00000000..45144ec0 --- /dev/null +++ b/packages/chord-chart-studio/build/assets/index-s8b48HYU.css @@ -0,0 +1 @@ +/*! modern-normalize v2.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */*,:before,:after{box-sizing:border-box}html{font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";line-height:1.15;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}table{text-indent:0;border-color:inherit}::-moz-focus-inner{border-style:none;padding:0}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}legend{padding:0}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-search-decoration{-webkit-appearance:none}h1,h2,h3,h4,h5,figure,p,ol,ul{margin:0}ol,ul{list-style:none;padding-inline:0}h1,h2,h3,h4,h5{font-size:inherit;font-weight:inherit}img{display:block;max-inline-size:100%}:root{--space-xxxs: 4px;--space-xxs: 6px;--space-xs: 8px;--space-s: 12px;--space-m: 16px;--space-l: 24px;--space-xl: 32px;--space-xxl: 48px;--rounded-s: 4px;--rounded-m: 8px;--rounded-l: 16px;--font-family: "Cabin", sans-serif;--font-weight-regular: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--slate50: hsl(210, 40%, 98%);--slate100: hsl(210, 40%, 96%);--slate200: hsl(214, 32%, 91%);--slate300: hsl(213, 27%, 84%);--slate400: hsl(215, 20%, 65%);--slate500: hsl(215, 16%, 47%);--slate600: hsl(215, 19%, 35%);--slate700: hsl(215, 25%, 27%);--slate800: hsl(217, 33%, 17%);--slate900: hsl(222, 47%, 11%);--slate950: hsl(229, 84%, 5%);--sky50: hsl(205, 86%, 97%);--sky100: hsl(209, 86%, 94%);--sky200: hsl(203, 84%, 87%);--sky300: hsl(203, 88%, 78%);--sky400: hsl(204, 84%, 68%);--sky500: hsl(206, 72%, 60%);--sky600: hsl(208, 51%, 50%);--sky700: hsl(209, 52%, 40%);--sky800: hsl(208, 52%, 33%);--sky900: hsl(208, 51%, 28%);--sky950: hsl(209, 53%, 18%)}:root{font-family:Cabin,sans-serif;font-family:var(--font-family);line-height:1.5;color:#020617;color:var(--slate950)}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html{box-sizing:border-box;font-size:62.5%;font-size:.625em}body{font-size:1.6rem;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:1.5}.theme-dark .link1{color:#fabf2b}.theme-dark .link1:hover{color:#fbce5d}.theme-dark .link1:active{color:#fcdd8f}::-webkit-scrollbar{width:10px;height:10px}.theme-light ::-webkit-scrollbar{background-color:red}.theme-dark ::-webkit-scrollbar{background-color:red}.theme-dark ::-webkit-scrollbar-track,.theme-dark ::-webkit-scrollbar-corner{background-color:#293132}::-webkit-scrollbar-thumb{border-radius:100vw}.theme-light ::-webkit-scrollbar-thumb{border:3px solid}.theme-dark ::-webkit-scrollbar-thumb{background-color:#a8a8a8;border:3px solid rgb(41,49,50)}.theme-dark ::-webkit-scrollbar-thumb:hover{background-color:#c1c1c1}@supports (scrollbar-color: white black){*{scrollbar-width:thin}.theme-dark *{scrollbar-color:#a8a8a8 rgb(41,49,50)}}.cmTheme-dark1{background-color:#293132}.cmTheme-dark1 .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#f4f4f4}.cmTheme-dark1 .cmSong p{margin:0}.cmTheme-dark1 .cmSectionLabel{color:#67d3ff;font-weight:700}.cmTheme-dark1 .cmSectionMultiplier{color:#ed7bff}.cmTheme-dark1 .cmTimeSignature,.cmTheme-dark1 .cmKeyDeclaration{color:#a7ff7b;font-weight:700}.cmTheme-dark1 .cmChordLine{color:#fabf2b}.cmTheme-dark1 .cmBarSeparator{opacity:.5}.cmTheme-dark1 .cmChordDuration{opacity:.7}.cmTheme-dark1 .cmSubBeatGroupOpener,.cmTheme-dark1 .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.cmTheme-dark1 .cmChordLine-romanNumeral,.cmTheme-dark1 .cmRomanNumeral{color:#fabf2b}.cmTheme-dark1 .cmRomanNumeral-diatonic{font-weight:700;color:#303846;background-color:#fabf2b}.cmTheme-dark1 .cmRomanNumeral-borrowed{color:#303846;background-color:#fabf2bb3}.cmTheme-dark1 .cmRomanNumeral-unknown{opacity:.8}.cmTheme-dark2{background-color:#282a36}.cmTheme-dark2 .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#f8f8f2}.cmTheme-dark2 .cmSong p{margin:0}.cmTheme-dark2 .cmSectionLabel{color:#ffb86c;font-weight:700}.cmTheme-dark2 .cmSectionMultiplier{color:#f1fa8c}.cmTheme-dark2 .cmTimeSignature,.cmTheme-dark2 .cmKeyDeclaration{color:#f1fa8c;font-weight:700}.cmTheme-dark2 .cmChordLine{color:#8be9fd}.cmTheme-dark2 .cmBarSeparator{opacity:.5}.cmTheme-dark2 .cmChordDuration{opacity:.7}.cmTheme-dark2 .cmSubBeatGroupOpener,.cmTheme-dark2 .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.cmTheme-dark2 .cmChordLine-romanNumeral,.cmTheme-dark2 .cmRomanNumeral{color:#8be9fd}.cmTheme-dark2 .cmRomanNumeral-diatonic{font-weight:700;color:#303846;background-color:#8be9fd}.cmTheme-dark2 .cmRomanNumeral-borrowed{color:#303846;background-color:#8be9fdb3}.cmTheme-dark2 .cmRomanNumeral-unknown{opacity:.8}.cmTheme-dark3{background-color:#282a36}.cmTheme-dark3 .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#f8f8f2}.cmTheme-dark3 .cmSong p{margin:0}.cmTheme-dark3 .cmSectionLabel{color:#f55;font-weight:700}.cmTheme-dark3 .cmSectionMultiplier{color:#f1fa8c}.cmTheme-dark3 .cmTimeSignature,.cmTheme-dark3 .cmKeyDeclaration{color:#8be9fd;font-weight:700}.cmTheme-dark3 .cmChordLine{color:#50fa7b}.cmTheme-dark3 .cmBarSeparator{opacity:.5}.cmTheme-dark3 .cmChordDuration{opacity:.7}.cmTheme-dark3 .cmSubBeatGroupOpener,.cmTheme-dark3 .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.cmTheme-dark3 .cmChordLine-romanNumeral,.cmTheme-dark3 .cmRomanNumeral{color:#50fa7b}.cmTheme-dark3 .cmRomanNumeral-diatonic{font-weight:700;color:#303846;background-color:#50fa7b}.cmTheme-dark3 .cmRomanNumeral-borrowed{color:#303846;background-color:#50fa7bb3}.cmTheme-dark3 .cmRomanNumeral-unknown{opacity:.8}.cmTheme-text .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#333}.cmTheme-text .cmSong p{margin:0}.cmTheme-print{background-color:#fff}.cmTheme-print .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#333;font-size:12px}.cmTheme-print .cmSong p{margin:0}.cmTheme-print .cmSectionLabel{font-weight:700;text-decoration:underline}.cmTheme-print .cmSectionMultiplier{font-weight:400;text-decoration:none;text-decoration:initial}.cmTheme-print .cmTimeSignature,.cmTheme-print .cmKeyDeclaration{font-weight:700}.cmTheme-print .cmBarSeparator{opacity:.5}.cmTheme-print .cmChordDuration{opacity:.7}.cmTheme-print .cmSubBeatGroupOpener,.cmTheme-print .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.cmSong--fontSize-5 .cmLine{font-size:.5em;line-height:1.15em}.cmSong--fontSize-4 .cmLine{font-size:.6em;line-height:1.25em}.cmSong--fontSize-3 .cmLine{font-size:.7em;line-height:1.35em}.cmSong--fontSize-2 .cmLine{font-size:.8em;line-height:1.45em}.cmSong--fontSize-1 .cmLine{font-size:.9em;line-height:1.55em}.cmSong--fontSize1 .cmLine{font-size:1.1em;line-height:1.75em}.cmSong--fontSize2 .cmLine{font-size:1.2em;line-height:1.85em}.cmSong--fontSize3 .cmLine{font-size:1.3em;line-height:1.95em}.cmSong--fontSize4 .cmLine{font-size:1.4em;line-height:2.05em}.cmSong--fontSize5 .cmLine{font-size:1.5em;line-height:2.15em}.cmChordLyricLine{display:flex;flex-wrap:wrap}.cmChordLyricLine .cmChordLyricPair{flex:0 0 auto;display:flex;flex-direction:column}.cmChordLyricLine .cmChordLyricPair .cmChordLine,.cmChordLyricLine .cmChordLyricPair .cmLyricLine{flex:0 0 auto;white-space:pre}.cmTheme-print2{background-color:#fff}.cmTheme-print2 .cmSong{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:10px;white-space:pre-wrap;color:#333;font-size:14px;line-height:1.4em;font-family:Menlo,Courier New,Courier,monospace}.cmTheme-print2 .cmSong p{margin:0}.cmTheme-print2 .cmSection{border:1px solid black;border-radius:8px;padding:.4em;margin:.2em 0;page-break-inside:avoid;-moz-column-break-inside:avoid;break-inside:avoid}.cmTheme-print2 .cmSection-Chorus{background-color:#ededed}.cmTheme-print2 .cmSectionLabel{font-weight:700;font-size:.85em;text-transform:uppercase}.cmTheme-print2 .cmSectionMultiplier{text-decoration:none;text-decoration:initial;font-size:.95em}.cmTheme-print2 .cmTimeSignature,.cmTheme-print2 .cmKeyDeclaration{font-weight:700}.cmTheme-print2 .cmEmptyLine{display:none}.cmTheme-print2 .cmChordLine{font-weight:bolder}.cmTheme-print2 .cmBarSeparator{opacity:.5}.cmTheme-print2 .cmChordDuration{opacity:.7}.cmTheme-print2 .cmSubBeatGroupOpener,.cmTheme-print2 .cmSubBeatGroupCloser{opacity:.8;font-weight:700}.ErrorBoundary{padding:2rem}._button_18d4b_1{padding:var(--space-s) var(--space-m);display:flex;align-items:center;font-weight:var(--font-weight-bold);border:0;border-radius:var(--rounded-m);outline-offset:var(--space-xxs);outline-style:solid;outline-width:0}._button_18d4b_1 :is(._icon_18d4b_8,._label_18d4b_8){height:20px}._button_18d4b_1 ._icon_18d4b_8{margin-right:var(--space-xxs)}._button_18d4b_1[data-hovered]{cursor:pointer}._button_18d4b_1[data-focused]{outline-width:0}._button_18d4b_1[data-focus-visible]{outline-width:2px}._button_18d4b_1._primary_18d4b_41{background-color:var(--sky600);color:var(--sky50)}._button_18d4b_1._primary_18d4b_41[data-hovered]{background-color:var(--sky500)}._button_18d4b_1._primary_18d4b_41[data-pressed]{background-color:var(--sky400)}._button_18d4b_1._primary_18d4b_41[data-focus-visible]{outline-color:var(--sky500)}._button_18d4b_1._secondary_18d4b_58{background-color:var(--sky100);color:var(--sky700)}._button_18d4b_1._secondary_18d4b_58[data-hovered]{background-color:var(--sky50);color:var(--sky500)}._button_18d4b_1._secondary_18d4b_58[data-pressed]{color:var(--sky400)}._button_18d4b_1._secondary_18d4b_58[data-focus-visible]{outline-color:var(--sky500)}._button_18d4b_1._tertiary_18d4b_76{background-color:transparent;color:var(--slate700)}._button_18d4b_1._tertiary_18d4b_76[data-hovered]{background-color:var(--slate50)}._button_18d4b_1._tertiary_18d4b_76[data-pressed]{color:var(--slate500)}._button_18d4b_1._tertiary_18d4b_76[data-focus-visible]{outline-color:var(--slate600)}html,body,#app{height:100%;padding:0}.appLayout-wrapper{width:100%;height:100%;display:flex;flex-direction:row;flex-wrap:nowrap}.leftBar{flex-shrink:0;width:15%;max-width:250px;display:flex;flex-direction:row;flex-wrap:nowrap}.leftBar.leftBar-isCollapsed{width:48px}.theme-light .leftBar.leftBar-isCollapsed{border-right:1px solid}.theme-dark .leftBar{color:#f4f4f4;background-color:#303846}.theme-dark .leftBar.leftBar-isCollapsed{border-right:1px solid #dbdbdb}.theme-dark .leftBar.leftBar-isCollapsed:hover{background-color:#455064}@media print{.leftBar{display:none}}.rightBar{flex-shrink:0;width:15%;max-width:250px;display:flex;flex-direction:row;flex-wrap:nowrap}.rightBar.rightBar-isCollapsed{width:48px}.theme-light .rightBar.rightBar-isCollapsed{border-left:1px solid}.theme-dark .rightBar{color:#f4f4f4;background-color:#303846}.theme-dark .rightBar.rightBar-isCollapsed{border-left:1px solid #dbdbdb}.theme-dark .rightBar.rightBar-isCollapsed:hover{background-color:#455064}@media print{.rightBar{display:none}}.leftBar-content{overflow-y:scroll;flex:1 1 auto}.leftBar-isCollapsed .leftBar-content{padding:.5rem 1rem;text-align:center;cursor:pointer;overflow:hidden}.rightBar-content{overflow-y:scroll;flex:1 1 auto}.rightBar-isCollapsed .rightBar-content{padding:.5rem 1rem;text-align:center;cursor:pointer;overflow:hidden}.leftBar-collapser{flex:0 0 12px;display:flex;cursor:pointer}.leftBar-isCollapsed .leftBar-collapser{display:none}.theme-light .leftBar-collapser{border-right:1px solid}.theme-dark .leftBar-collapser{background-color:#405a73;border-right:1px solid #a8a8a8}.theme-dark .leftBar-collapser:hover{background-color:#537393}.theme-dark .leftBar-collapser{color:#f4f4f4}.leftBar-collapserIcon{flex:1 1 auto;align-self:center;font-weight:700}.leftBar-collapserIcon .icon{font-size:1.2rem}.rightBar-collapser{flex:0 0 12px;display:flex;cursor:pointer}.rightBar-isCollapsed .rightBar-collapser{display:none}.theme-light .rightBar-collapser{border-left:1px solid}.theme-dark .rightBar-collapser{background-color:#405a73;border-left:1px solid #a8a8a8}.theme-dark .rightBar-collapser:hover{background-color:#537393}.theme-dark .rightBar-collapser{color:#f4f4f4}.rightBar-collapserIcon{flex:1 1 auto;align-self:center;font-weight:700}.rightBar-collapserIcon .icon{font-size:1.2rem}.appLayout-main{flex-grow:1;display:flex;flex-direction:column;flex-wrap:nowrap}.appLayout-header{flex-shrink:0}.theme-light .appLayout-header{border-bottom:3px solid}.theme-dark .appLayout-header{color:#f4f4f4b3;background-color:#303846;border-bottom:3px solid rgb(250,191,43)}@media print{.appLayout-header{display:none}}.appLayout-content{overflow-y:auto;flex-grow:1}@media print{.appLayout-content{overflow-y:visible}}.theme-dark .appLayout-footer{color:#a8a8a8}@media print{.appLayout-footer{display:none}}.logo-isExpanded{box-sizing:border-box;padding:1.5rem 0 1rem;width:100%}.leftBar-isCollapsed .logo-isExpanded{display:none}.logo-img{margin:0 auto;width:70%}.logo-img svg{fill:#fff;aspect-ratio:1.25/1;width:80%;margin:5px auto 10px;display:block}.mainNav-entries{margin:0;padding:0;display:flex;justify-content:center;list-style-type:none;font-size:1.6rem;font-family:Open Sans,sans-serif;font-weight:400;vertical-align:middle}.mainNavEntry{display:inline-block;padding:1rem 2rem;cursor:default;font-weight:700}.mainNavEntry:hover:not(.mainNavEntry-isActive){cursor:pointer}.theme-dark .mainNavEntry:hover:not(.mainNavEntry-isDisabled):not(.mainNavEntry-isActive){color:#1c2731;background-color:#fcdd8f}.theme-dark .mainNavEntry.mainNavEntry-isActive{color:#1c2731;background-color:#fabf2b}.mainNavEntry.mainNavEntry-isDisabled{-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-light .mainNavEntry.mainNavEntry-isDisabled{cursor:not-allowed}.theme-dark .mainNavEntry.mainNavEntry-isDisabled{color:#a8a8a8;background-color:#303846;cursor:not-allowed}.mainNavEntry-icon .icon{margin-right:.5rem;font-size:1.4rem}.icon{vertical-align:middle}.userGuide-isExpanded{margin-left:1rem}.rightBar-isCollapsed .userGuide-isExpanded{display:none}.userGuide-isCollapsed{padding:1rem 0}.rightBar:not(.rightBar-isCollapsed) .userGuide-isCollapsed{display:none}button{border:0;border-radius:0;background-color:transparent}.Button{display:inline-block;padding:10px 20px;font-weight:700;text-transform:capitalize;margin:10px 20px 10px 0}.Button:hover{cursor:pointer}.Button:last-of-type{margin-right:0}.theme-dark .Button-primary:not(.Button-isDisabled){background-color:#fabf2b;color:#1c2731}.theme-dark .Button-primary:not(.Button-isDisabled):hover{color:#000;background-color:#fcdd8f}.theme-dark .Button-primary:not(.Button-isDisabled):active{color:#2e4052;background-color:#feecc0}.Button-primary.Button-isDisabled{cursor:not-allowed}.theme-dark .Button-primary.Button-isDisabled{background-color:#57686a;color:#404c4e}.theme-dark .Button-secondary:not(.Button-isDisabled){background-color:#a8a8a8;color:#121616}.theme-dark .Button-secondary:not(.Button-isDisabled):hover{color:#000;background-color:#c1c1c1}.theme-dark .Button-secondary:not(.Button-isDisabled):active{color:#2e4052;background-color:#dbdbdb}.Button-secondary.Button-isDisabled{cursor:not-allowed}.theme-dark .Button-secondary.Button-isDisabled{background-color:#57686a;color:#404c4e}.versions-isExpanded{margin:4rem 0;padding:0 1rem;opacity:.5;font-size:1rem}.rightBar-isCollapsed .versions-isExpanded{display:none}.versions-isExpanded a{color:inherit}.versions-isExpanded a:hover{opacity:.7}.sim-SongImporterModal_Container{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:90%;height:90%;display:flex;flex-direction:column;align-items:stretch;align-content:stretch;flex-wrap:nowrap}.theme-light .sim-SongImporterModal_Container{border:1px solid}.theme-dark .sim-SongImporterModal_Container{background-color:#1e2324;border:1px solid #c1c1c1;color:#f4f4f4}.sim-Header_Container{flex:0 0 auto;display:flex}.theme-light .sim-Header_Container{border-bottom:1px solid}.theme-dark .sim-Header_Container{background-color:#303846;border-bottom:1px solid #c1c1c1;color:#f4f4f4b3}.sim-Header_Title{flex:1 1 auto;padding:20px;font-size:1.6rem;font-weight:bolder}.sim-Header_Actions{flex:0 0 auto;padding:0 10px}.sim-TwoColumns_Container{display:flex;align-self:stretch}.sim-TwoColumns_Container-autoHeight{flex:0 1 100%;min-height:0}.sim-Column_Container{flex:1 1 50%;align-self:stretch;padding:0 10px}.sim-Column_Container:first-child{padding-right:5px}.sim-Column_Container:last-child{padding-left:5px}.sim-Input_Header{height:20px;text-transform:uppercase;padding:2px;text-align:center;font-size:1.2rem}.theme-dark .sim-Input_Header{background-color:#404c4e;color:#f4f4f4b3}.sim-Input_Textarea{box-sizing:border-box;padding:10px;width:100%;height:calc(100% - 34px);max-height:calc(100% - 34px);overflow-y:scroll;resize:none;margin:0;background-color:transparent;border:0;outline:none;font-family:PT Mono,consolas,courier,monospace;font-size:1.2rem;line-height:1.5rem}.theme-dark .sim-Input_Textarea{background-color:#121616;color:#f4f4f4}.sim-Input_Textarea-Disabled{opacity:.5}.sim-Preview_Container{box-sizing:border-box;font-family:PT Mono,consolas,courier,monospace;font-size:1.2rem;white-space:pre-wrap;height:calc(100% - 34px);max-height:calc(100% - 34px);overflow-y:scroll;padding:10px}.theme-dark .sim-Preview_Container{background-color:#293132}.sim-Preview_Error{padding:10px}.theme-dark .sim-Preview_Error{color:#f4f4f4;background-color:#f91900}.sim-InputFile_Input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}.sim-InputFormat{padding:10px 0}.sim-InputFormat_Entry{display:inline-block;margin:0 10px}.sim-InputFormat_Entry:hover,.sim-InputFormat_Label:hover{cursor:pointer}.sim-InputFormat_Entry-Disabled,.sim-InputFormat_Label-Disabled{opacity:.5}.sim-InputFormat_Entry-Disabled:hover,.sim-InputFormat_Label-Disabled:hover{cursor:not-allowed}.mod-ModalContainer{z-index:5000;height:100%;width:100%;position:absolute;top:0;left:0}.mod-Overlay{height:100%;width:100%;position:absolute;top:0;left:0;opacity:.7;background-color:#000}.mod-ModalConfirmContainer{z-index:5000;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:auto;height:auto;padding:10px 20px}.theme-light .mod-ModalConfirmContainer{border:1px solid}.theme-dark .mod-ModalConfirmContainer{background-color:#1e2324;border:1px solid #c1c1c1;color:#f4f4f4}.mod-ModalConfirmButtons{text-align:center}.fileManager-isExpanded{font-size:1.2rem}.leftBar-isCollapsed .fileManager-isExpanded{display:none}.fileManager-isCollapsed{padding:1rem 0}.leftBar:not(.leftBar-isCollapsed) .fileManager-isCollapsed{display:none}.fileManager-actionsList{padding:1rem;display:flex;flex-direction:row;flex-wrap:wrap}.theme-dark .fileManager-actionsList{background-color:#455064}.fileManagerAction{flex:0 1 auto;padding:.5rem;margin-right:.5rem;white-space:nowrap}.fileManagerAction:hover{cursor:not-allowed}.fileManagerAction:hover:not(.fileManagerAction-isDisabled){cursor:pointer}.theme-dark .fileManagerAction:hover:not(.fileManagerAction-isDisabled){background-color:#596883}.fileManagerAction-isDisabled{-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:.5}.fileManagerAction-icon .icon{font-size:1.4rem}.fileManager-entriesList{padding-left:0;list-style:none}.fileManagerEntry{cursor:pointer;padding:.1rem 0}.theme-dark .fileManagerEntry:hover{background-color:#596883}.theme-dark .fileManagerEntry.fileManagerEntry-isSelected{background-color:#fabf2b}.fileManagerEntry-input{box-sizing:border-box;width:100%;padding:0 1rem;background-color:transparent;border:none;cursor:pointer;outline:none}.theme-dark .fileManagerEntry-input{color:#f4f4f4}.theme-dark .fileManagerEntry-isSelected .fileManagerEntry-input{color:#303846}.fileManagerEntry-isRenamed .fileManagerEntry-input{cursor:text}.theme-dark .fileManagerEntry-isRenamed .fileManagerEntry-input{background-color:#f4f4f4;color:#303846}.songEditor-headers{display:flex;height:20px;text-transform:uppercase;padding:3px 0;text-align:center;font-size:1.2rem}.theme-dark .songEditor-headers{background-color:#404c4e;color:#f4f4f4b3}.songEditor-sourceHeader,.songEditor-previewHeader{flex:0 1 50%}.songEditor{width:100%;height:calc(100% - 26px);display:flex;flex-direction:row;flex-wrap:nowrap}.songEditor-source{flex:0 1 50%;display:flex;overflow-y:scroll}.theme-dark .songEditor-source{background-color:#1e2324}.songEditor-preview{flex:0 1 50%;overflow-y:scroll}.editorPreview{box-sizing:border-box;padding:.5rem;min-height:100%}.cmTheme-fadeRepeats .cmLine--isFromAutoRepeatChords,.cmTheme-fadeRepeats .cmLine--isFromChordLineRepeater,.cmTheme-fadeRepeats .cmLine--isFromSectionCopy,.cmTheme-fadeRepeats .cmLine--isFromSectionMultiply{opacity:.5}.prosemirrorWrapper{flex:1 1 auto;padding:15px 0}.ProseMirror{height:100%;outline:none;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em}.theme-dark .ProseMirror{color:#dbdbdb}.ProseMirror p{margin:0;padding:0 1rem}.exportPreview{box-sizing:border-box;min-height:100%;padding:1rem}.theme-dark .exportPreview{background-color:#293132;color:#f4f4f4}.exp-SongRenderer{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:13px;line-height:1.65em;padding:15px;white-space:pre-wrap;color:#333}.exp-SongRenderer p{margin:0}.exp-SongRenderer .txtLine{display:block}.theme-light .exp-SongRenderer{color:!important}.theme-dark .exp-SongRenderer{color:#f4f4f4!important}.playRendererWrapper1{position:relative;height:100%;overflow-y:scroll}.playRendererWrapper2{position:absolute;top:0;right:0;bottom:0;left:0}.playRenderer{box-sizing:border-box;min-height:100%}.playRenderer .cmSong{padding:0!important}.playRenderer--columns-1{-moz-column-count:1;column-count:1;padding:1rem}.playRenderer--columns-2{-moz-column-count:2;column-count:2;-moz-column-fill:auto;column-fill:auto;height:100%;padding:1rem}.playRenderer--columns-3{-moz-column-count:3;column-count:3;-moz-column-fill:auto;column-fill:auto;height:100%;padding:1rem}.playRenderer--columns-4{-moz-column-count:4;column-count:4;-moz-column-fill:auto;column-fill:auto;height:100%;padding:1rem}.printPreview{overflow:hidden;min-height:100%}.theme-dark .printPreview{background-color:#293132}@media print{.printPreview{background-color:#fff!important;overflow-y:auto}}.printPreview-page{position:relative;margin:2rem auto;background-color:#fff}@media print{.printPreview-page{margin:0;page-break-after:auto}}.printPreview-pageContentWrapper{position:absolute;top:0;left:0;bottom:0;right:0}.printPreview-pageContent{display:flex;flex-direction:column;flex-wrap:nowrap;height:100%}.printPreview-pageHeader{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;font-size:1.8rem;font-weight:700;margin-bottom:1rem}.printPreview-pageColumnWrapper{flex:1;display:flex;flex-direction:row;flex-wrap:nowrap}.printPreview-pageColumn{flex:1 1 0;margin:0 .7rem}.printPreview-pageColumn:first-of-type{margin-left:0}.printPreview-pageColumn:last-of-type{margin-right:0}.printPreview-page--a4{width:210mm;height:297mm}.printPreview-page--booxmax2pro{width:698px;height:930px}.printPreview-pageContentWrapper--padding1{padding:3mm}.printPreview-pageContentWrapper--padding2{padding:6mm}.printPreview-pageContentWrapper--padding3{padding:9mm}.printPreview-pageContentWrapper--padding4{padding:12mm}.printPreview-pageContentWrapper--padding5{padding:15mm}.cmTheme-print .cmSong{padding:0!important}.measuring-node{visibility:hidden;position:absolute;z-index:-1}.rightBar-isCollapsed .renderingOptionsPanel-isExpanded{display:none}.renderingOptionsPanel-isCollapsed{padding:1rem 0}.rightBar:not(.rightBar-isCollapsed) .renderingOptionsPanel-isCollapsed{display:none}.sb-optionsGroup{padding-top:2rem}.sb-optionsGroup:first-of-type{padding-top:0}.sb-optionsGroup-title{-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:.5rem 1rem .5rem .5rem;font-size:1.4rem;font-weight:700}.theme-light .sb-optionsGroup-title{border-bottom:2px solid}.theme-dark .sb-optionsGroup-title{border-bottom:2px solid rgba(244,244,244,.7)}.theme-dark .sb-optionsGroup-isNotInteractable .sb-optionsGroup-title{color:#71819e}.sb-optionsGroup-iconTitle .icon{font-size:1.6rem}.sb-optionsGroup-iconToggle .icon{font-size:1.8rem}.sb-optionSelect{font-size:1.2rem;padding:.5rem 1.5rem .5rem 1rem}.theme-light .sb-optionSelect{border-bottom:1px dotted}.theme-dark .sb-optionSelect{border-bottom:1px dotted #71819e}.theme-dark .sb-optionsGroup .sb-optionSelect{background-color:#1b2028}.sb-optionSelect.sb-optionSelect-isNotInteractable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-dark .sb-optionSelect.sb-optionSelect-isNotInteractable{color:#71819e}.sb-optionSelect:hover{cursor:not-allowed}.sb-optionSelect:hover:not(.sb-optionSelect-isNotInteractable){cursor:pointer}.theme-dark .sb-optionSelect:hover:not(.sb-optionSelect-isNotInteractable){background-color:#596883}.sb-optionSelect-title{display:flex}.sb-optionSelect-desc{flex:1 1 auto}.sb-optionSelect-toggle{flex:0 0 auto}.sb-optionSelect-icon .icon{font-size:1.8rem}.sb-optionSelectChoice-activeLabel{opacity:.5}.sb-optionSelectChoice{padding-top:.5rem;display:flex}.sb-optionSelectChoice:hover:not(.sb-optionSelectChoice-isNotInteractable){text-decoration:underline;cursor:pointer}.sb-optionSelectChoice-isSelected{font-weight:700}.sb-optionSelectChoice-check{flex:0 0 20px}.sb-optionSelectChoice-checkIcon .icon{font-size:1.2rem}.sb-optionSelectChoice-label{flex:1 1 auto}.sb-optionSlider{display:flex;flex-wrap:wrap;font-size:1.2rem;padding:.5rem 1.5rem .5rem 1rem}.theme-light .sb-optionSlider{border-bottom:1px dotted}.theme-dark .sb-optionSlider{border-bottom:1px dotted #71819e}.theme-dark .sb-optionsGroup .sb-optionSlider{background-color:#1b2028}.sb-optionSlider.sb-optionSlider-isNotInteractable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-dark .sb-optionSlider.sb-optionSlider-isNotInteractable{color:#71819e}.sb-optionSlider:hover{cursor:not-allowed}.sb-optionSlider:hover:not(.sb-optionSlider-isNotInteractable){cursor:pointer}.theme-dark .sb-optionSlider:hover:not(.sb-optionSlider-isNotInteractable){background-color:#596883}.sb-optionSlider-desc{flex:1 1 auto}.sb-optionSlider-value{flex:0 0 auto;vertical-align:middle;font-size:1.2rem}.sb-optionSlider-range{flex:1 1 100%}.theme-light .sb-optionSlider-range input[type=range]{-webkit-appearance:none;width:100%;background:transparent}.theme-light .sb-optionSlider-range input[type=range]:focus{outline:none}.theme-light .sb-optionSlider-range input[type=range]::-webkit-slider-runnable-track{width:100%;height:10px;cursor:pointer;animation:.2s;border:0 solid black;border-radius:0;background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-webkit-slider-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#bb8704;-webkit-appearance:none;margin-top:-3.3333333333}.theme-light .sb-optionSlider-range input[type=range]:focus::-webkit-slider-runnable-track{background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-moz-range-track{width:100%;height:10px;cursor:pointer;animation:.2s;border:0 solid black;border-radius:0;background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-moz-range-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#bb8704}.theme-light .sb-optionSlider-range input[type=range]::-ms-track{width:100%;height:10px;cursor:pointer;animation:.2s;color:transparent;border-width:15px 0;border-color:transparent;background:transparent}.theme-light .sb-optionSlider-range input[type=range]::-ms-fill-lower{border:0 solid black;border-radius:0;background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-ms-fill-upper{border:0 solid black;border-radius:0;background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]::-ms-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#bb8704}.theme-light .sb-optionSlider-range input[type=range]:focus::-ms-fill-lower{background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]:focus::-ms-fill-upper{background:#feecc0}.theme-light .sb-optionSlider-range input[type=range]:disabled::-moz-range-track,.theme-light .sb-optionSlider-range input[type=range]:disabled::-moz-range-thumb{cursor:default}.theme-light .sb-optionSlider-range input[type=range]:disabled::-webkit-slider-runnable-track,.theme-light .sb-optionSlider-range input[type=range]:disabled::-webkit-slider-thumb{cursor:default}.theme-light .sb-optionSlider-range input[type=range]:disabled::-ms-track,.theme-light .sb-optionSlider-range input[type=range]:disabled::-ms-thumb{cursor:default}.theme-dark .sb-optionSlider-range input[type=range]{-webkit-appearance:none;width:100%;background:transparent}.theme-dark .sb-optionSlider-range input[type=range]:focus{outline:none}.theme-dark .sb-optionSlider-range input[type=range]::-webkit-slider-runnable-track{width:100%;height:10px;cursor:pointer;animation:.2s;border:0 solid black;border-radius:0;background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-webkit-slider-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#070809;-webkit-appearance:none;margin-top:-3.3333333333}.theme-dark .sb-optionSlider-range input[type=range]:focus::-webkit-slider-runnable-track{background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-moz-range-track{width:100%;height:10px;cursor:pointer;animation:.2s;border:0 solid black;border-radius:0;background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-moz-range-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#070809}.theme-dark .sb-optionSlider-range input[type=range]::-ms-track{width:100%;height:10px;cursor:pointer;animation:.2s;color:transparent;border-width:15px 0;border-color:transparent;background:transparent}.theme-dark .sb-optionSlider-range input[type=range]::-ms-fill-lower{border:0 solid black;border-radius:0;background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-ms-fill-upper{border:0 solid black;border-radius:0;background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]::-ms-thumb{width:15px;height:10px;cursor:pointer;border:0 solid black;border-radius:0;background:#070809}.theme-dark .sb-optionSlider-range input[type=range]:focus::-ms-fill-lower{background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]:focus::-ms-fill-upper{background:#71819e}.theme-dark .sb-optionSlider-range input[type=range]:disabled::-moz-range-track,.theme-dark .sb-optionSlider-range input[type=range]:disabled::-moz-range-thumb{cursor:default}.theme-dark .sb-optionSlider-range input[type=range]:disabled::-webkit-slider-runnable-track,.theme-dark .sb-optionSlider-range input[type=range]:disabled::-webkit-slider-thumb{cursor:default}.theme-dark .sb-optionSlider-range input[type=range]:disabled::-ms-track,.theme-dark .sb-optionSlider-range input[type=range]:disabled::-ms-thumb{cursor:default}.sb-optionSlider-range input[type=range]:disabled{opacity:.35;cursor:not-allowed!important}.sb-optionToggle{display:flex;font-size:1.2rem;padding:.5rem 1.5rem .5rem 1rem}.theme-light .sb-optionToggle{border-bottom:1px dotted}.theme-dark .sb-optionToggle{border-bottom:1px dotted #71819e}.theme-dark .sb-optionsGroup .sb-optionToggle{background-color:#1b2028}.sb-optionToggle.sb-optionToggle-isNotInteractable{-webkit-user-select:none;-moz-user-select:none;user-select:none}.theme-dark .sb-optionToggle.sb-optionToggle-isNotInteractable{color:#71819e}.sb-optionToggle:hover{cursor:not-allowed}.sb-optionToggle:hover:not(.sb-optionToggle-isNotInteractable){cursor:pointer}.theme-dark .sb-optionToggle:hover:not(.sb-optionToggle-isNotInteractable){background-color:#596883}.sb-optionToggle-desc{flex:1 1 auto}.sb-optionToggle-icon{flex:0 0 auto}.theme-dark .sb-optionToggle-isOff .icon{color:#a8a8a8}.sb-optionToggle-icon .icon{font-size:1.8rem}.theme-dark .sb-optionToggle-isOff .sb-optionToggle-icon .icon{color:#a8a8a8} diff --git a/packages/chord-chart-studio/build/assets/vendor-B9p68kIM.js b/packages/chord-chart-studio/build/assets/vendor-B9p68kIM.js deleted file mode 100644 index e814ef93..00000000 --- a/packages/chord-chart-studio/build/assets/vendor-B9p68kIM.js +++ /dev/null @@ -1,117 +0,0 @@ -var Sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function v0(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}function Qx(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var S0=Qx;function Xx(t){return t}var fl=Xx,Zx=S0,eg=Math.max;function eO(t,e,n){return e=eg(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=eg(r.length-e,0),s=Array(o);++i0){if(++e>=lT)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var fT=cT,dT=sT,pT=fT,hT=pT(dT),T0=hT,mT=fl,gT=w0,yT=T0;function vT(t,e){return yT(gT(t,e,mT),t+"")}var Ao=vT;function ST(){this.__data__=[],this.size=0}var wT=ST;function ET(t,e){return t===e||t!==t&&e!==e}var dl=ET,CT=dl;function bT(t,e){for(var n=t.length;n--;)if(CT(t[n][0],e))return n;return-1}var Ou=bT,xT=Ou,OT=Array.prototype,TT=OT.splice;function kT(t){var e=this.__data__,n=xT(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():TT.call(e,n,1),--this.size,!0}var AT=kT,_T=Ou;function NT(t){var e=this.__data__,n=_T(e,t);return n<0?void 0:e[n][1]}var MT=NT,IT=Ou;function PT(t){return IT(this.__data__,t)>-1}var $T=PT,DT=Ou;function RT(t,e){var n=this.__data__,r=DT(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var LT=RT,FT=wT,BT=AT,zT=MT,jT=$T,UT=LT;function _o(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=qA}var Fp=YA,JA=Np,QA=Fp;function XA(t){return t!=null&&QA(t.length)&&!JA(t)}var vi=XA,ZA=vi,e_=kn;function t_(t){return e_(t)&&ZA(t)}var Mu=t_,Aa={exports:{}};function n_(){return!1}var r_=n_;Aa.exports;(function(t,e){var n=dn,r=r_,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,a=l?l.isBuffer:void 0,u=a||r;t.exports=u})(Aa,Aa.exports);var Iu=Aa.exports,i_=gi,o_=Dp,s_=kn,l_="[object Object]",a_=Function.prototype,u_=Object.prototype,R0=a_.toString,c_=u_.hasOwnProperty,f_=R0.call(Object);function d_(t){if(!s_(t)||i_(t)!=l_)return!1;var e=o_(t);if(e===null)return!0;var n=c_.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&R0.call(n)==f_}var L0=d_,p_=gi,h_=Fp,m_=kn,g_="[object Arguments]",y_="[object Array]",v_="[object Boolean]",S_="[object Date]",w_="[object Error]",E_="[object Function]",C_="[object Map]",b_="[object Number]",x_="[object Object]",O_="[object RegExp]",T_="[object Set]",k_="[object String]",A_="[object WeakMap]",__="[object ArrayBuffer]",N_="[object DataView]",M_="[object Float32Array]",I_="[object Float64Array]",P_="[object Int8Array]",$_="[object Int16Array]",D_="[object Int32Array]",R_="[object Uint8Array]",L_="[object Uint8ClampedArray]",F_="[object Uint16Array]",B_="[object Uint32Array]",Ee={};Ee[M_]=Ee[I_]=Ee[P_]=Ee[$_]=Ee[D_]=Ee[R_]=Ee[L_]=Ee[F_]=Ee[B_]=!0;Ee[g_]=Ee[y_]=Ee[__]=Ee[v_]=Ee[N_]=Ee[S_]=Ee[w_]=Ee[E_]=Ee[C_]=Ee[b_]=Ee[x_]=Ee[O_]=Ee[T_]=Ee[k_]=Ee[A_]=!1;function z_(t){return m_(t)&&h_(t.length)&&!!Ee[p_(t)]}var j_=z_;function U_(t){return function(e){return t(e)}}var Po=U_,_a={exports:{}};_a.exports;(function(t,e){var n=C0,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var a=i&&i.require&&i.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l})(_a,_a.exports);var Bp=_a.exports,V_=j_,W_=Po,dg=Bp,pg=dg&&dg.isTypedArray,H_=pg?W_(pg):V_,zp=H_;function G_(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var F0=G_,K_=Pp,q_=dl,Y_=Object.prototype,J_=Y_.hasOwnProperty;function Q_(t,e,n){var r=t[e];(!(J_.call(t,e)&&q_(r,n))||n===void 0&&!(e in t))&&K_(t,e,n)}var jp=Q_,X_=jp,Z_=Pp;function eN(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o-1&&t%1==0&&t1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&sM(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(He(1));return n(Up)(t,e)}if(typeof t!="function")throw new Error(He(2));var i=t,o=e,s=[],l=s,a=!1;function u(){l===s&&(l=s.slice())}function c(){if(a)throw new Error(He(3));return o}function f(v){if(typeof v!="function")throw new Error(He(4));if(a)throw new Error(He(5));var S=!0;return u(),l.push(v),function(){if(S){if(a)throw new Error(He(6));S=!1,u();var y=l.indexOf(v);l.splice(y,1),s=null}}}function d(v){if(!CM(v))throw new Error(He(7));if(typeof v.type>"u")throw new Error(He(8));if(a)throw new Error(He(9));try{a=!0,o=i(o,v)}finally{a=!1}for(var S=s=l,m=0;m"u")throw new Error(He(12));if(typeof n(void 0,{type:Ds.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(He(13))})}function OM(t){for(var e=Object.keys(t),n={},r=0;r"u")throw u&&u.type,new Error(He(14));f[p]=S,c=c||S!==v}return c=c||o.length!==Object.keys(a).length,c?f:a}}function Cg(t,e){return function(){return e(t.apply(this,arguments))}}function TM(t,e){if(typeof t=="function")return Cg(t,e);if(typeof t!="object"||t===null)throw new Error(He(16));var n={};for(var r in t){var i=t[r];typeof i=="function"&&(n[r]=Cg(i,e))}return n}function W0(){for(var t=arguments.length,e=new Array(t),n=0;n"u"){if(e)throw new Error("Reducer must return the initial state if the state is undefined.");return!1}return!0}Object.defineProperty(K0,"__esModule",{value:!0});var Yq=K0.default=DM,IM=Vp,PM=$M(IM);function $M(t){return t&&t.__esModule?t:{default:t}}function DM(t){var e=Object.keys(t),n=void 0;try{for(var r=0;r"u"?{}:Object.assign({},i);function u(c,f,d){for(var p=0;p"u"?u(function(c){},o,void 0):typeof s>"u"?u(function(c){return i[c]},o,i):u(function(c){return i[c]},o,s),l?a:i}}var RM=gi,LM=kn,FM="[object Symbol]";function BM(t){return typeof t=="symbol"||LM(t)&&RM(t)==FM}var hl=BM,zM=yt,jM=hl,UM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,VM=/^\w*$/;function WM(t,e){if(zM(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||jM(t)?!0:VM.test(t)||!UM.test(t)||e!=null&&t in Object(e)}var Wp=WM,q0=Ip,HM="Expected a function";function Hp(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(HM);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Hp.Cache||q0),n}Hp.Cache=q0;var GM=Hp,KM=GM,qM=500;function YM(t){var e=KM(t,function(r){return n.size===qM&&n.clear(),r}),n=e.cache;return e}var JM=YM,QM=JM,XM=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ZM=/\\(\\)?/g,eI=QM(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(XM,function(n,r,i,o){e.push(i?o.replace(ZM,"$1"):r||n)}),e}),tI=eI;function nI(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n0&&n(l)?e>1?X0(l,e-1,n,r,i):eP(i,l):r||(i[i.length]=l)}return i}var Kp=X0,nP=Kp;function rP(t){var e=t==null?0:t.length;return e?nP(t,1):[]}var iP=rP,oP=iP,sP=w0,lP=T0;function aP(t){return lP(sP(t,void 0,oP),t+"")}var Z0=aP,uP=qI,cP=Z0,fP=cP(function(t,e){return t==null?{}:uP(t,e)}),dP=fP;const Jq=xe(dP);var pP="__lodash_hash_undefined__";function hP(t){return this.__data__.set(t,pP),this}var mP=hP;function gP(t){return this.__data__.has(t)}var yP=gP,vP=Ip,SP=mP,wP=yP;function Na(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new vP;++el))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var f=-1,d=!0,p=n&AP?new xP:void 0;for(o.set(t,e),o.set(e,t);++fe||o&&s&&a&&!l&&!u||r&&s&&a||!n&&a||!i)return 1;if(!r&&!o&&!u&&t=l)return a;var u=n[r];return a*(u=="desc"?-1:1)}}return t.index-e.index}var oF=iF,Fc=Si,sF=ml,lF=Lu,aF=cS,uF=eF,cF=Po,fF=oF,dF=fl,pF=yt;function hF(t,e,n){e.length?e=Fc(e,function(o){return pF(o)?function(s){return sF(s,o.length===1?o[0]:o)}:o}):e=[dF];var r=-1;e=Fc(e,cF(lF));var i=aF(t,function(o,s,l){var a=Fc(e,function(u){return u(o)});return{criteria:a,index:++r,value:o}});return uF(i,function(o,s){return fF(o,s,n)})}var mF=hF,gF=Kp,yF=mF,vF=Ao,ty=V0,SF=vF(function(t,e){if(t==null)return[];var n=e.length;return n>1&&ty(t,e[0],e[1])?e=[]:n>2&&ty(e[0],e[1],e[2])&&(e=[e[0]]),yF(t,gF(e,1),[])}),wF=SF;const Xq=xe(wF);var Ma="NOT_FOUND";function EF(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:Ma},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function CF(t,e){var n=[];function r(l){var a=n.findIndex(function(c){return e(l,c.key)});if(a>-1){var u=n[a];return a>0&&(n.splice(a,1),n.unshift(u)),u.value}return Ma}function i(l,a){r(l)===Ma&&(n.unshift({key:l,value:a}),n.length>t&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var bF=function(e,n){return e===n};function xF(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?e-1:0),r=1;r1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:ua;ny&&ny(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(TF(e)||(e[r]=o),i=o)}t[i]=!0}return t}function PF(t){for(let e=0;e/gm),FF=un(/\${[\w\W]*}/gm),BF=un(/^data-[\-\w.\u00B7-\uFFFF]/),zF=un(/^aria-[\-\w]+$/),vS=un(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jF=un(/^(?:\w+script|data):/i),UF=un(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),SS=un(/^html$/i);var ay=Object.freeze({__proto__:null,MUSTACHE_EXPR:RF,ERB_EXPR:LF,TMPLIT_EXPR:FF,DATA_ATTR:BF,ARIA_ATTR:zF,IS_ALLOWED_URI:vS,IS_SCRIPT_OR_DATA:jF,ATTR_WHITESPACE:UF,DOCTYPE_NAME:SS});const VF=function(){return typeof window>"u"?null:window},WF=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function wS(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VF();const e=U=>wS(U);if(e.version="3.0.9",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:a,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:p}=t,h=a.prototype,v=Pl(h,"cloneNode"),S=Pl(h,"nextSibling"),m=Pl(h,"childNodes"),y=Pl(h,"parentNode");if(typeof s=="function"){const U=n.createElement("template");U.content&&U.content.ownerDocument&&(n=U.content.ownerDocument)}let g,w="";const{implementation:x,createNodeIterator:C,createDocumentFragment:O,getElementsByTagName:k}=n,{importNode:I}=r;let M={};e.isSupported=typeof gS=="function"&&typeof y=="function"&&x&&x.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:J,ERB_EXPR:T,TMPLIT_EXPR:B,DATA_ATTR:G,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:he,ATTR_WHITESPACE:De}=ay;let{IS_ALLOWED_URI:D}=ay,F=null;const W=Z({},[...iy,...zc,...jc,...Uc,...oy]);let K=null;const ue=Z({},[...sy,...Vc,...ly,...$l]);let P=Object.seal(yS(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Q=null,X=null,_e=!0,ge=!0,An=!1,pn=!0,_t=!1,Jn=!1,wt=!1,_n=!1,Ci=!1,kl=!1,Al=!1,$m=!0,Dm=!1;const Ux="user-content-";let Ac=!0,Wo=!1,bi={},xi=null;const Rm=Z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Lm=null;const Fm=Z({},["audio","video","img","source","image","track"]);let _c=null;const Bm=Z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),_l="http://www.w3.org/1998/Math/MathML",Nl="http://www.w3.org/2000/svg",Nn="http://www.w3.org/1999/xhtml";let Oi=Nn,Nc=!1,Mc=null;const Vx=Z({},[_l,Nl,Nn],Bc);let Ho=null;const Wx=["application/xhtml+xml","text/html"],Hx="text/html";let Re=null,Ti=null;const Gx=n.createElement("form"),zm=function(E){return E instanceof RegExp||E instanceof Function},Ic=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ti&&Ti===E)){if((!E||typeof E!="object")&&(E={}),E=jr(E),Ho=Wx.indexOf(E.PARSER_MEDIA_TYPE)===-1?Hx:E.PARSER_MEDIA_TYPE,Re=Ho==="application/xhtml+xml"?Bc:ua,F=Zt(E,"ALLOWED_TAGS")?Z({},E.ALLOWED_TAGS,Re):W,K=Zt(E,"ALLOWED_ATTR")?Z({},E.ALLOWED_ATTR,Re):ue,Mc=Zt(E,"ALLOWED_NAMESPACES")?Z({},E.ALLOWED_NAMESPACES,Bc):Vx,_c=Zt(E,"ADD_URI_SAFE_ATTR")?Z(jr(Bm),E.ADD_URI_SAFE_ATTR,Re):Bm,Lm=Zt(E,"ADD_DATA_URI_TAGS")?Z(jr(Fm),E.ADD_DATA_URI_TAGS,Re):Fm,xi=Zt(E,"FORBID_CONTENTS")?Z({},E.FORBID_CONTENTS,Re):Rm,Q=Zt(E,"FORBID_TAGS")?Z({},E.FORBID_TAGS,Re):{},X=Zt(E,"FORBID_ATTR")?Z({},E.FORBID_ATTR,Re):{},bi=Zt(E,"USE_PROFILES")?E.USE_PROFILES:!1,_e=E.ALLOW_ARIA_ATTR!==!1,ge=E.ALLOW_DATA_ATTR!==!1,An=E.ALLOW_UNKNOWN_PROTOCOLS||!1,pn=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,_t=E.SAFE_FOR_TEMPLATES||!1,Jn=E.WHOLE_DOCUMENT||!1,Ci=E.RETURN_DOM||!1,kl=E.RETURN_DOM_FRAGMENT||!1,Al=E.RETURN_TRUSTED_TYPE||!1,_n=E.FORCE_BODY||!1,$m=E.SANITIZE_DOM!==!1,Dm=E.SANITIZE_NAMED_PROPS||!1,Ac=E.KEEP_CONTENT!==!1,Wo=E.IN_PLACE||!1,D=E.ALLOWED_URI_REGEXP||vS,Oi=E.NAMESPACE||Nn,P=E.CUSTOM_ELEMENT_HANDLING||{},E.CUSTOM_ELEMENT_HANDLING&&zm(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(P.tagNameCheck=E.CUSTOM_ELEMENT_HANDLING.tagNameCheck),E.CUSTOM_ELEMENT_HANDLING&&zm(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(P.attributeNameCheck=E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(P.allowCustomizedBuiltInElements=E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),_t&&(ge=!1),kl&&(Ci=!0),bi&&(F=Z({},oy),K=[],bi.html===!0&&(Z(F,iy),Z(K,sy)),bi.svg===!0&&(Z(F,zc),Z(K,Vc),Z(K,$l)),bi.svgFilters===!0&&(Z(F,jc),Z(K,Vc),Z(K,$l)),bi.mathMl===!0&&(Z(F,Uc),Z(K,ly),Z(K,$l))),E.ADD_TAGS&&(F===W&&(F=jr(F)),Z(F,E.ADD_TAGS,Re)),E.ADD_ATTR&&(K===ue&&(K=jr(K)),Z(K,E.ADD_ATTR,Re)),E.ADD_URI_SAFE_ATTR&&Z(_c,E.ADD_URI_SAFE_ATTR,Re),E.FORBID_CONTENTS&&(xi===Rm&&(xi=jr(xi)),Z(xi,E.FORBID_CONTENTS,Re)),Ac&&(F["#text"]=!0),Jn&&Z(F,["html","head","body"]),F.table&&(Z(F,["tbody"]),delete Q.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw Jo('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Jo('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=E.TRUSTED_TYPES_POLICY,w=g.createHTML("")}else g===void 0&&(g=WF(p,i)),g!==null&&typeof w=="string"&&(w=g.createHTML(""));pt&&pt(E),Ti=E}},jm=Z({},["mi","mo","mn","ms","mtext"]),Um=Z({},["foreignobject","desc","title","annotation-xml"]),Kx=Z({},["title","style","font","a","script"]),Vm=Z({},[...zc,...jc,...$F]),Wm=Z({},[...Uc,...DF]),qx=function(E){let N=y(E);(!N||!N.tagName)&&(N={namespaceURI:Oi,tagName:"template"});const j=ua(E.tagName),ye=ua(N.tagName);return Mc[E.namespaceURI]?E.namespaceURI===Nl?N.namespaceURI===Nn?j==="svg":N.namespaceURI===_l?j==="svg"&&(ye==="annotation-xml"||jm[ye]):!!Vm[j]:E.namespaceURI===_l?N.namespaceURI===Nn?j==="math":N.namespaceURI===Nl?j==="math"&&Um[ye]:!!Wm[j]:E.namespaceURI===Nn?N.namespaceURI===Nl&&!Um[ye]||N.namespaceURI===_l&&!jm[ye]?!1:!Wm[j]&&(Kx[j]||!Vm[j]):!!(Ho==="application/xhtml+xml"&&Mc[E.namespaceURI]):!1},Lr=function(E){qo(e.removed,{element:E});try{E.parentNode.removeChild(E)}catch{E.remove()}},Pc=function(E,N){try{qo(e.removed,{attribute:N.getAttributeNode(E),from:N})}catch{qo(e.removed,{attribute:null,from:N})}if(N.removeAttribute(E),E==="is"&&!K[E])if(Ci||kl)try{Lr(N)}catch{}else try{N.setAttribute(E,"")}catch{}},Hm=function(E){let N=null,j=null;if(_n)E=""+E;else{const Xe=_F(E,/^[\r\n\t ]+/);j=Xe&&Xe[0]}Ho==="application/xhtml+xml"&&Oi===Nn&&(E=''+E+"");const ye=g?g.createHTML(E):E;if(Oi===Nn)try{N=new d().parseFromString(ye,Ho)}catch{}if(!N||!N.documentElement){N=x.createDocument(Oi,"template",null);try{N.documentElement.innerHTML=Nc?w:ye}catch{}}const Qe=N.body||N.documentElement;return E&&j&&Qe.insertBefore(n.createTextNode(j),Qe.childNodes[0]||null),Oi===Nn?k.call(N,Jn?"html":"body")[0]:Jn?N.documentElement:Qe},Gm=function(E){return C.call(E.ownerDocument||E,E,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null)},Yx=function(E){return E instanceof f&&(typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||!(E.attributes instanceof c)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function")},Km=function(E){return typeof l=="function"&&E instanceof l},Mn=function(E,N,j){M[E]&&Il(M[E],ye=>{ye.call(e,N,j,Ti)})},qm=function(E){let N=null;if(Mn("beforeSanitizeElements",E,null),Yx(E))return Lr(E),!0;const j=Re(E.nodeName);if(Mn("uponSanitizeElement",E,{tagName:j,allowedTags:F}),E.hasChildNodes()&&!Km(E.firstElementChild)&&Nt(/<[/\w]/g,E.innerHTML)&&Nt(/<[/\w]/g,E.textContent))return Lr(E),!0;if(!F[j]||Q[j]){if(!Q[j]&&Jm(j)&&(P.tagNameCheck instanceof RegExp&&Nt(P.tagNameCheck,j)||P.tagNameCheck instanceof Function&&P.tagNameCheck(j)))return!1;if(Ac&&!xi[j]){const ye=y(E)||E.parentNode,Qe=m(E)||E.childNodes;if(Qe&&ye){const Xe=Qe.length;for(let Et=Xe-1;Et>=0;--Et)ye.insertBefore(v(Qe[Et],!0),S(E))}}return Lr(E),!0}return E instanceof a&&!qx(E)||(j==="noscript"||j==="noembed"||j==="noframes")&&Nt(/<\/no(script|embed|frames)/i,E.innerHTML)?(Lr(E),!0):(_t&&E.nodeType===3&&(N=E.textContent,Il([J,T,B],ye=>{N=Yo(N,ye," ")}),E.textContent!==N&&(qo(e.removed,{element:E.cloneNode()}),E.textContent=N)),Mn("afterSanitizeElements",E,null),!1)},Ym=function(E,N,j){if($m&&(N==="id"||N==="name")&&(j in n||j in Gx))return!1;if(!(ge&&!X[N]&&Nt(G,N))){if(!(_e&&Nt(q,N))){if(!K[N]||X[N]){if(!(Jm(E)&&(P.tagNameCheck instanceof RegExp&&Nt(P.tagNameCheck,E)||P.tagNameCheck instanceof Function&&P.tagNameCheck(E))&&(P.attributeNameCheck instanceof RegExp&&Nt(P.attributeNameCheck,N)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(N))||N==="is"&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&Nt(P.tagNameCheck,j)||P.tagNameCheck instanceof Function&&P.tagNameCheck(j))))return!1}else if(!_c[N]){if(!Nt(D,Yo(j,De,""))){if(!((N==="src"||N==="xlink:href"||N==="href")&&E!=="script"&&NF(j,"data:")===0&&Lm[E])){if(!(An&&!Nt(he,Yo(j,De,"")))){if(j)return!1}}}}}}return!0},Jm=function(E){return E!=="annotation-xml"&&E.indexOf("-")>0},Qm=function(E){Mn("beforeSanitizeAttributes",E,null);const{attributes:N}=E;if(!N)return;const j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:K};let ye=N.length;for(;ye--;){const Qe=N[ye],{name:Xe,namespaceURI:Et,value:Fr}=Qe,Go=Re(Xe);let Ct=Xe==="value"?Fr:MF(Fr);if(j.attrName=Go,j.attrValue=Ct,j.keepAttr=!0,j.forceKeepAttr=void 0,Mn("uponSanitizeAttribute",E,j),Ct=j.attrValue,j.forceKeepAttr||(Pc(Xe,E),!j.keepAttr))continue;if(!pn&&Nt(/\/>/i,Ct)){Pc(Xe,E);continue}_t&&Il([J,T,B],Zm=>{Ct=Yo(Ct,Zm," ")});const Xm=Re(E.nodeName);if(Ym(Xm,Go,Ct)){if(Dm&&(Go==="id"||Go==="name")&&(Pc(Xe,E),Ct=Ux+Ct),g&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Et)switch(p.getAttributeType(Xm,Go)){case"TrustedHTML":{Ct=g.createHTML(Ct);break}case"TrustedScriptURL":{Ct=g.createScriptURL(Ct);break}}try{Et?E.setAttributeNS(Et,Xe,Ct):E.setAttribute(Xe,Ct),ry(e.removed)}catch{}}}Mn("afterSanitizeAttributes",E,null)},Jx=function U(E){let N=null;const j=Gm(E);for(Mn("beforeSanitizeShadowDOM",E,null);N=j.nextNode();)Mn("uponSanitizeShadowNode",N,null),!qm(N)&&(N.content instanceof o&&U(N.content),Qm(N));Mn("afterSanitizeShadowDOM",E,null)};return e.sanitize=function(U){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},N=null,j=null,ye=null,Qe=null;if(Nc=!U,Nc&&(U=""),typeof U!="string"&&!Km(U))if(typeof U.toString=="function"){if(U=U.toString(),typeof U!="string")throw Jo("dirty is not a string, aborting")}else throw Jo("toString is not a function");if(!e.isSupported)return U;if(wt||Ic(E),e.removed=[],typeof U=="string"&&(Wo=!1),Wo){if(U.nodeName){const Fr=Re(U.nodeName);if(!F[Fr]||Q[Fr])throw Jo("root node is forbidden and cannot be sanitized in-place")}}else if(U instanceof l)N=Hm(""),j=N.ownerDocument.importNode(U,!0),j.nodeType===1&&j.nodeName==="BODY"||j.nodeName==="HTML"?N=j:N.appendChild(j);else{if(!Ci&&!_t&&!Jn&&U.indexOf("<")===-1)return g&&Al?g.createHTML(U):U;if(N=Hm(U),!N)return Ci?null:Al?w:""}N&&_n&&Lr(N.firstChild);const Xe=Gm(Wo?U:N);for(;ye=Xe.nextNode();)qm(ye)||(ye.content instanceof o&&Jx(ye.content),Qm(ye));if(Wo)return U;if(Ci){if(kl)for(Qe=O.call(N.ownerDocument);N.firstChild;)Qe.appendChild(N.firstChild);else Qe=N;return(K.shadowroot||K.shadowrootmode)&&(Qe=I.call(r,Qe,!0)),Qe}let Et=Jn?N.outerHTML:N.innerHTML;return Jn&&F["!doctype"]&&N.ownerDocument&&N.ownerDocument.doctype&&N.ownerDocument.doctype.name&&Nt(SS,N.ownerDocument.doctype.name)&&(Et=" -`+Et),_t&&Il([J,T,B],Fr=>{Et=Yo(Et,Fr," ")}),g&&Al?g.createHTML(Et):Et},e.setConfig=function(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ic(U),wt=!0},e.clearConfig=function(){Ti=null,wt=!1},e.isValidAttribute=function(U,E,N){Ti||Ic({});const j=Re(U),ye=Re(E);return Ym(j,ye,N)},e.addHook=function(U,E){typeof E=="function"&&(M[U]=M[U]||[],qo(M[U],E))},e.removeHook=function(U){if(M[U])return ry(M[U])},e.removeHooks=function(U){M[U]&&(M[U]=[])},e.removeAllHooks=function(){M={}},e}var Fu=wS();let Dl;const HF=new Uint8Array(16);function GF(){if(!Dl&&(Dl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Dl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Dl(HF)}const We=[];for(let t=0;t<256;++t)We.push((t+256).toString(16).slice(1));function KF(t,e=0){return We[t[e+0]]+We[t[e+1]]+We[t[e+2]]+We[t[e+3]]+"-"+We[t[e+4]]+We[t[e+5]]+"-"+We[t[e+6]]+We[t[e+7]]+"-"+We[t[e+8]]+We[t[e+9]]+"-"+We[t[e+10]]+We[t[e+11]]+We[t[e+12]]+We[t[e+13]]+We[t[e+14]]+We[t[e+15]]}const qF=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),uy={randomUUID:qF};function tY(t,e,n){if(uy.randomUUID&&!e&&!t)return uy.randomUUID();t=t||{};const r=t.random||(t.rng||GF)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return KF(r)}function YF(t){for(var e=[],n=0;n=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||s===95){i+=t[o++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(n));e.push({type:"NAME",index:n,value:i}),n=o;continue}if(r==="("){var l=1,a="",o=n+1;if(t[o]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(o));for(;o)?(?!\?)/g,r=0,i=n.exec(t.source);i;)e.push({name:i[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),i=n.exec(t.source);return t}function e3(t,e,n){var r=t.map(function(i){return CS(i,e,n).source});return new RegExp("(?:".concat(r.join("|"),")"),Xp(n))}function t3(t,e,n){return n3(ES(t,n),e,n)}function n3(t,e,n){n===void 0&&(n={});for(var r=n.strict,i=r===void 0?!1:r,o=n.start,s=o===void 0?!0:o,l=n.end,a=l===void 0?!0:l,u=n.encode,c=u===void 0?function(M){return M}:u,f=n.delimiter,d=f===void 0?"/#?":f,p=n.endsWith,h=p===void 0?"":p,v="[".concat($i(h),"]|$"),S="[".concat($i(d),"]"),m=s?"^":"",y=0,g=t;y-1:k===void 0;i||(m+="(?:".concat(S,"(?=").concat(v,"))?")),I||(m+="(?=".concat(S,"|").concat(v,")"))}return new RegExp(m,Xp(n))}function CS(t,e,n){return t instanceof RegExp?ZF(t,e):Array.isArray(t)?e3(t,e,n):t3(t,e,n)}/*! Universal Router | MIT License | https://www.kriasoft.com/universal-router/ */function r3(t){try{return decodeURIComponent(t)}catch{return t}}function bS(t,e,n,r,i){var o,s,l=0;return{next:function(u){if(t===u)return{done:!0,value:!1};if(!o){var c=t,f=!c.children;if(c.match||(c.match=QF(c.path||"",Object.assign({end:f},n))),o=c.match(r),o){var d=o,p=d.path;return o.path=!f&&p.charAt(p.length-1)==="/"?p.substr(1):p,o.params=Object.assign({},i,o.params),{done:!1,value:{route:t,baseUrl:e,path:o.path,params:o.params}}}}if(o&&t.children)for(;l"u"||!Fe?ee:Fe(Uint8Array),Zr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ee:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ee:ArrayBuffer,"%ArrayIteratorPrototype%":ki&&Fe?Fe([][Symbol.iterator]()):ee,"%AsyncFromSyncIteratorPrototype%":ee,"%AsyncFunction%":Di,"%AsyncGenerator%":Di,"%AsyncGeneratorFunction%":Di,"%AsyncIteratorPrototype%":Di,"%Atomics%":typeof Atomics>"u"?ee:Atomics,"%BigInt%":typeof BigInt>"u"?ee:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ee:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ee:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ee:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":A3,"%eval%":eval,"%EvalError%":_3,"%Float32Array%":typeof Float32Array>"u"?ee:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ee:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ee:FinalizationRegistry,"%Function%":TS,"%GeneratorFunction%":Di,"%Int8Array%":typeof Int8Array>"u"?ee:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ee:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ee:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ki&&Fe?Fe(Fe([][Symbol.iterator]())):ee,"%JSON%":typeof JSON=="object"?JSON:ee,"%Map%":typeof Map>"u"?ee:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ki||!Fe?ee:Fe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ee:Promise,"%Proxy%":typeof Proxy>"u"?ee:Proxy,"%RangeError%":N3,"%ReferenceError%":M3,"%Reflect%":typeof Reflect>"u"?ee:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ee:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ki||!Fe?ee:Fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ee:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ki&&Fe?Fe(""[Symbol.iterator]()):ee,"%Symbol%":ki?Symbol:ee,"%SyntaxError%":uo,"%ThrowTypeError%":P3,"%TypedArray%":D3,"%TypeError%":Ji,"%Uint8Array%":typeof Uint8Array>"u"?ee:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ee:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ee:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ee:Uint32Array,"%URIError%":I3,"%WeakMap%":typeof WeakMap>"u"?ee:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ee:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ee:WeakSet};if(Fe)try{null.error}catch(t){var R3=Fe(Fe(t));Zr["%Error.prototype%"]=R3}var L3=function t(e){var n;if(e==="%AsyncFunction%")n=Hc("async function () {}");else if(e==="%GeneratorFunction%")n=Hc("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=Hc("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Fe&&(n=Fe(i.prototype))}return Zr[e]=n,n},dy={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},yl=Zp,Ia=k3,F3=yl.call(Function.call,Array.prototype.concat),B3=yl.call(Function.apply,Array.prototype.splice),py=yl.call(Function.call,String.prototype.replace),Pa=yl.call(Function.call,String.prototype.slice),z3=yl.call(Function.call,RegExp.prototype.exec),j3=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,U3=/\\(\\)?/g,V3=function(e){var n=Pa(e,0,1),r=Pa(e,-1);if(n==="%"&&r!=="%")throw new uo("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new uo("invalid intrinsic syntax, expected opening `%`");var i=[];return py(e,j3,function(o,s,l,a){i[i.length]=l?py(a,U3,"$1"):s||o}),i},W3=function(e,n){var r=e,i;if(Ia(dy,r)&&(i=dy[r],r="%"+i[0]+"%"),Ia(Zr,r)){var o=Zr[r];if(o===Di&&(o=L3(r)),typeof o>"u"&&!n)throw new Ji("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new uo("intrinsic "+e+" does not exist!")},Bo=function(e,n){if(typeof e!="string"||e.length===0)throw new Ji("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Ji('"allowMissing" argument must be a boolean');if(z3(/^%?[^%]*%?$/,e)===null)throw new uo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=V3(e),i=r.length>0?r[0]:"",o=W3("%"+i+"%",n),s=o.name,l=o.value,a=!1,u=o.alias;u&&(i=u[0],B3(r,F3([0,1],u)));for(var c=1,f=!0;c=r.length){var v=Xr(l,d);f=!!v,f&&"get"in v&&!("originalValue"in v.get)?l=v.get:l=l[d]}else f=Ia(l,d),l=l[d];f&&!a&&(Zr[s]=l)}}return l},kS={exports:{}},Kc,hy;function eh(){if(hy)return Kc;hy=1;var t=Bo,e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Kc=e,Kc}var H3=Bo,ca=H3("%Object.getOwnPropertyDescriptor%",!0);if(ca)try{ca([],"length")}catch{ca=null}var AS=ca,my=eh(),G3=OS,Ai=gl,gy=AS,K3=function(e,n,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Ai("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new Ai("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ai("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ai("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ai("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ai("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,a=!!gy&&gy(e,n);if(my)my(e,n,{configurable:s===null&&a?a.configurable:!s,enumerable:i===null&&a?a.enumerable:!i,value:r,writable:o===null&&a?a.writable:!o});else if(l||!i&&!o&&!s)e[n]=r;else throw new G3("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ld=eh(),_S=function(){return!!ld};_S.hasArrayLengthDefineBug=function(){if(!ld)return null;try{return ld([],"length",{value:1}).length!==1}catch{return!0}};var q3=_S,Y3=Bo,yy=K3,J3=q3(),vy=AS,Sy=gl,Q3=Y3("%Math.floor%"),X3=function(e,n){if(typeof e!="function")throw new Sy("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||Q3(n)!==n)throw new Sy("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&vy){var s=vy(e,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(o=!1)}return(i||o||!r)&&(J3?yy(e,"length",n,!0,!0):yy(e,"length",n)),e};(function(t){var e=Zp,n=Bo,r=X3,i=gl,o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||e.call(s,o),a=eh(),u=n("%Math.max%");t.exports=function(d){if(typeof d!="function")throw new i("a function is required");var p=l(e,s,arguments);return r(p,1+u(0,d.length-(arguments.length-1)),!0)};var c=function(){return l(e,o,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(kS);var Z3=kS.exports,NS=Bo,MS=Z3,eB=MS(NS("String.prototype.indexOf")),tB=function(e,n){var r=NS(e,!!n);return typeof r=="function"&&eB(e,".prototype.")>-1?MS(r):r};const nB={},rB=Object.freeze(Object.defineProperty({__proto__:null,default:nB},Symbol.toStringTag,{value:"Module"})),iB=v0(rB);var th=typeof Map=="function"&&Map.prototype,qc=Object.getOwnPropertyDescriptor&&th?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,$a=th&&qc&&typeof qc.get=="function"?qc.get:null,wy=th&&Map.prototype.forEach,nh=typeof Set=="function"&&Set.prototype,Yc=Object.getOwnPropertyDescriptor&&nh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Da=nh&&Yc&&typeof Yc.get=="function"?Yc.get:null,Ey=nh&&Set.prototype.forEach,oB=typeof WeakMap=="function"&&WeakMap.prototype,gs=oB?WeakMap.prototype.has:null,sB=typeof WeakSet=="function"&&WeakSet.prototype,ys=sB?WeakSet.prototype.has:null,lB=typeof WeakRef=="function"&&WeakRef.prototype,Cy=lB?WeakRef.prototype.deref:null,aB=Boolean.prototype.valueOf,uB=Object.prototype.toString,cB=Function.prototype.toString,fB=String.prototype.match,rh=String.prototype.slice,ar=String.prototype.replace,dB=String.prototype.toUpperCase,by=String.prototype.toLowerCase,IS=RegExp.prototype.test,xy=Array.prototype.concat,vn=Array.prototype.join,pB=Array.prototype.slice,Oy=Math.floor,ad=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Jc=Object.getOwnPropertySymbols,ud=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,co=typeof Symbol=="function"&&typeof Symbol.iterator=="object",st=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===co||!0)?Symbol.toStringTag:null,PS=Object.prototype.propertyIsEnumerable,Ty=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ky(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||IS.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-Oy(-t):Oy(t);if(r!==t){var i=String(r),o=rh.call(e,i.length+1);return ar.call(i,n,"$&_")+"."+ar.call(ar.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ar.call(e,n,"$&_")}var cd=iB,Ay=cd.custom,_y=DS(Ay)?Ay:null,hB=function t(e,n,r,i){var o=n||{};if(Zn(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Zn(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Zn(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Zn(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Zn(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return LS(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return l?ky(e,a):a}if(typeof e=="bigint"){var u=String(e)+"n";return l?ky(e,u):u}var c=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=c&&c>0&&typeof e=="object")return fd(e)?"[Array]":"[Object]";var f=IB(o,r);if(typeof i>"u")i=[];else if(RS(i,e)>=0)return"[Circular]";function d(B,G,q){if(G&&(i=pB.call(i),i.push(G)),q){var he={depth:o.depth};return Zn(o,"quoteStyle")&&(he.quoteStyle=o.quoteStyle),t(B,he,r+1,i)}return t(B,o,r+1,i)}if(typeof e=="function"&&!Ny(e)){var p=bB(e),h=Rl(e,d);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(h.length>0?" { "+vn.call(h,", ")+" }":"")}if(DS(e)){var v=co?ar.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ud.call(e);return typeof e=="object"&&!co?Qo(v):v}if(_B(e)){for(var S="<"+by.call(String(e.nodeName)),m=e.attributes||[],y=0;y",S}if(fd(e)){if(e.length===0)return"[]";var g=Rl(e,d);return f&&!MB(g)?"["+dd(g,f)+"]":"[ "+vn.call(g,", ")+" ]"}if(yB(e)){var w=Rl(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!PS.call(e,"cause")?"{ ["+String(e)+"] "+vn.call(xy.call("[cause]: "+d(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+vn.call(w,", ")+" }"}if(typeof e=="object"&&s){if(_y&&typeof e[_y]=="function"&&cd)return cd(e,{depth:c-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(xB(e)){var x=[];return wy&&wy.call(e,function(B,G){x.push(d(G,e,!0)+" => "+d(B,e))}),My("Map",$a.call(e),x,f)}if(kB(e)){var C=[];return Ey&&Ey.call(e,function(B){C.push(d(B,e))}),My("Set",Da.call(e),C,f)}if(OB(e))return Qc("WeakMap");if(AB(e))return Qc("WeakSet");if(TB(e))return Qc("WeakRef");if(SB(e))return Qo(d(Number(e)));if(EB(e))return Qo(d(ad.call(e)));if(wB(e))return Qo(aB.call(e));if(vB(e))return Qo(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===Sn)return"{ [object globalThis] }";if(!gB(e)&&!Ny(e)){var O=Rl(e,d),k=Ty?Ty(e)===Object.prototype:e instanceof Object||e.constructor===Object,I=e instanceof Object?"":"null prototype",M=!k&&st&&Object(e)===e&&st in e?rh.call(Ir(e),8,-1):I?"Object":"",J=k||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",T=J+(M||I?"["+vn.call(xy.call([],M||[],I||[]),": ")+"] ":"");return O.length===0?T+"{}":f?T+"{"+dd(O,f)+"}":T+"{ "+vn.call(O,", ")+" }"}return String(e)};function $S(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function mB(t){return ar.call(String(t),/"/g,""")}function fd(t){return Ir(t)==="[object Array]"&&(!st||!(typeof t=="object"&&st in t))}function gB(t){return Ir(t)==="[object Date]"&&(!st||!(typeof t=="object"&&st in t))}function Ny(t){return Ir(t)==="[object RegExp]"&&(!st||!(typeof t=="object"&&st in t))}function yB(t){return Ir(t)==="[object Error]"&&(!st||!(typeof t=="object"&&st in t))}function vB(t){return Ir(t)==="[object String]"&&(!st||!(typeof t=="object"&&st in t))}function SB(t){return Ir(t)==="[object Number]"&&(!st||!(typeof t=="object"&&st in t))}function wB(t){return Ir(t)==="[object Boolean]"&&(!st||!(typeof t=="object"&&st in t))}function DS(t){if(co)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!ud)return!1;try{return ud.call(t),!0}catch{}return!1}function EB(t){if(!t||typeof t!="object"||!ad)return!1;try{return ad.call(t),!0}catch{}return!1}var CB=Object.prototype.hasOwnProperty||function(t){return t in this};function Zn(t,e){return CB.call(t,e)}function Ir(t){return uB.call(t)}function bB(t){if(t.name)return t.name;var e=fB.call(cB.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function RS(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;ne.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return LS(rh.call(t,0,e.maxStringLength),e)+r}var i=ar.call(ar.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,NB);return $S(i,"single",e)}function NB(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+dB.call(e.toString(16))}function Qo(t){return"Object("+t+")"}function Qc(t){return t+" { ? }"}function My(t,e,n,r){var i=r?dd(n,r):vn.call(n,", ");return t+" ("+e+") {"+i+"}"}function MB(t){for(var e=0;e=0)return!1;return!0}function IB(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=vn.call(Array(t.indent+1)," ");else return null;return{base:n,prev:vn.call(Array(e+1),n)}}function dd(t,e){if(t.length===0)return"";var n=` -`+e.prev+e.base;return n+vn.call(t,","+n)+` -`+e.prev}function Rl(t,e){var n=fd(t),r=[];if(n){r.length=t.length;for(var i=0;i1;){var n=e.pop(),r=n.obj[n.prop];if(Hr(r)){for(var i=[],o=0;o=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===KB.RFC1738&&(u===40||u===41)){l+=s.charAt(a);continue}if(u<128){l=l+hn[u];continue}if(u<2048){l=l+(hn[192|u>>6]+hn[128|u&63]);continue}if(u<55296||u>=57344){l=l+(hn[224|u>>12]+hn[128|u>>6&63]+hn[128|u&63]);continue}a+=1,u=65536+((u&1023)<<10|s.charCodeAt(a)&1023),l+=hn[240|u>>18]+hn[128|u>>12&63]+hn[128|u>>6&63]+hn[128|u&63]}return l},ZB=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i"u"&&(g=0)}if(typeof a=="function"?m=a(n,m):m instanceof Date?m=f(m):r==="comma"&&Rn(m)&&(m=fa.maybeMap(m,function(he){return he instanceof Date?f(he):he})),m===null){if(o)return l&&!h?l(n,tt.encoder,v,"key",d):n;m=""}if(lz(m)||fa.isBuffer(m)){if(l){var C=h?n:l(n,tt.encoder,v,"key",d);return[p(C)+"="+p(l(m,tt.encoder,v,"value",d))]}return[p(n)+"="+p(String(m))]}var O=[];if(typeof m>"u")return O;var k;if(r==="comma"&&Rn(m))h&&l&&(m=fa.maybeMap(m,l)),k=[{value:m.length>0?m.join(",")||null:void 0}];else if(Rn(a))k=a;else{var I=Object.keys(m);k=u?I.sort(u):I}for(var M=i&&Rn(m)&&m.length===1?n+"[]":n,J=0;J"u"?tt.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:tt.charsetSentinel,delimiter:typeof e.delimiter>"u"?tt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:tt.encode,encoder:typeof e.encoder=="function"?e.encoder:tt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:tt.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:tt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:tt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:tt.strictNullHandling}},cz=function(t,e){var n=t,r=uz(e),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):Rn(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var l;e&&e.arrayFormat in Iy?l=e.arrayFormat:e&&"indices"in e?l=e.indices?"indices":"repeat":l="indices";var a=Iy[l];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=a==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var c=jS(),f=0;f0?h+p:""},fo=zS,pd=Object.prototype.hasOwnProperty,fz=Array.isArray,Le={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:fo.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},dz=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},VS=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},pz="utf8=%26%2310003%3B",hz="utf8=%E2%9C%93",mz=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),l=-1,a,u=n.charset;if(n.charsetSentinel)for(a=0;a-1&&(h=fz(h)?[h]:h),pd.call(r,p)?r[p]=fo.combine(r[p],h):r[p]=h}return r},gz=function(t,e,n,r){for(var i=r?e:VS(e,n),o=t.length-1;o>=0;--o){var s,l=t[o];if(l==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var a=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,u=parseInt(a,10);!n.parseArrays&&a===""?s={0:i}:!isNaN(u)&&l!==a&&String(u)===a&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(s=[],s[u]=i):a!=="__proto__"&&(s[a]=i)}i=s}return i},yz=function(e,n,r,i){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,a=r.depth>0&&s.exec(o),u=a?o.slice(0,a.index):o,c=[];if(u){if(!r.plainObjects&&pd.call(Object.prototype,u)&&!r.allowPrototypes)return;c.push(u)}for(var f=0;r.depth>0&&(a=l.exec(o))!==null&&f"u"?Le.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Le.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Le.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Le.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Le.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Le.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Le.comma,decoder:typeof e.decoder=="function"?e.decoder:Le.decoder,delimiter:typeof e.delimiter=="string"||fo.isRegExp(e.delimiter)?e.delimiter:Le.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Le.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Le.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Le.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Le.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Le.strictNullHandling}},Sz=function(t,e){var n=vz(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?mz(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s>>1,ue=D[K];if(0>>1;Ki(X,W))_ei(ge,X)?(D[K]=ge,D[_e]=W,K=_e):(D[K]=X,D[Q]=W,K=Q);else if(_ei(ge,W))D[K]=ge,D[_e]=W,K=_e;else break e}}return F}function i(D,F){var W=D.sortIndex-F.sortIndex;return W!==0?W:D.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,f=null,d=3,p=!1,h=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(D){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=D)r(u),F.sortIndex=F.expirationTime,e(a,F);else break;F=n(u)}}function w(D){if(v=!1,g(D),!h)if(n(a)!==null)h=!0,he(x);else{var F=n(u);F!==null&&De(w,F.startTime-D)}}function x(D,F){h=!1,v&&(v=!1,m(k),k=-1),p=!0;var W=d;try{for(g(F),f=n(a);f!==null&&(!(f.expirationTime>F)||D&&!J());){var K=f.callback;if(typeof K=="function"){f.callback=null,d=f.priorityLevel;var ue=K(f.expirationTime<=F);F=t.unstable_now(),typeof ue=="function"?f.callback=ue:f===n(a)&&r(a),g(F)}else r(a);f=n(a)}if(f!==null)var P=!0;else{var Q=n(u);Q!==null&&De(w,Q.startTime-F),P=!1}return P}finally{f=null,d=W,p=!1}}var C=!1,O=null,k=-1,I=5,M=-1;function J(){return!(t.unstable_now()-MD||125K?(D.sortIndex=W,e(u,D),n(a)===null&&D===n(u)&&(v?(m(k),k=-1):v=!0,De(w,W-K))):(D.sortIndex=ue,e(a,D),h||p||(h=!0,he(x))),D},t.unstable_shouldYield=J,t.unstable_wrapCallback=function(D){var F=d;return function(){var W=d;d=F;try{return D.apply(this,arguments)}finally{d=W}}}})(nw);tw.exports=nw;var Hz=tw.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var rw=H,Ft=Hz;function _(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hd=Object.prototype.hasOwnProperty,Gz=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ly={},Fy={};function Kz(t){return hd.call(Fy,t)?!0:hd.call(Ly,t)?!1:Gz.test(t)?Fy[t]=!0:(Ly[t]=!0,!1)}function qz(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Yz(t,e,n,r){if(e===null||typeof e>"u"||qz(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function St(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Je[t]=new St(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Je[e]=new St(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Je[t]=new St(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Je[t]=new St(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Je[t]=new St(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Je[t]=new St(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Je[t]=new St(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Je[t]=new St(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Je[t]=new St(t,5,!1,t.toLowerCase(),null,!1,!1)});var ch=/[\-:]([a-z])/g;function fh(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(ch,fh);Je[e]=new St(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(ch,fh);Je[e]=new St(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(ch,fh);Je[e]=new St(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Je[t]=new St(t,1,!1,t.toLowerCase(),null,!1,!1)});Je.xlinkHref=new St("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Je[t]=new St(t,1,!1,t.toLowerCase(),null,!0,!0)});function dh(t,e,n,r){var i=Je.hasOwnProperty(e)?Je[e]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var a=` -`+i[s].replace(" at new "," at ");return t.displayName&&a.includes("")&&(a=a.replace("",t.displayName)),a}while(1<=s&&0<=l);break}}}finally{rf=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?as(t):""}function Jz(t){switch(t.tag){case 5:return as(t.type);case 16:return as("Lazy");case 13:return as("Suspense");case 19:return as("SuspenseList");case 0:case 2:case 15:return t=of(t.type,!1),t;case 11:return t=of(t.type.render,!1),t;case 1:return t=of(t.type,!0),t;default:return""}}function vd(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Bi:return"Fragment";case Fi:return"Portal";case md:return"Profiler";case ph:return"StrictMode";case gd:return"Suspense";case yd:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case sw:return(t.displayName||"Context")+".Consumer";case ow:return(t._context.displayName||"Context")+".Provider";case hh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case mh:return e=t.displayName||null,e!==null?e:vd(t.type)||"Memo";case er:e=t._payload,t=t._init;try{return vd(t(e))}catch{}}return null}function Qz(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return vd(e);case 8:return e===ph?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ar(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function aw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Xz(t){var e=aw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function jl(t){t._valueTracker||(t._valueTracker=Xz(t))}function uw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=aw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function La(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Sd(t,e){var n=e.checked;return ke({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function zy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ar(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function cw(t,e){e=e.checked,e!=null&&dh(t,"checked",e,!1)}function wd(t,e){cw(t,e);var n=Ar(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Ed(t,e.type,n):e.hasOwnProperty("defaultValue")&&Ed(t,e.type,Ar(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function jy(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Ed(t,e,n){(e!=="number"||La(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var us=Array.isArray;function Qi(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Ul.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Fs(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Ss={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zz=["Webkit","ms","Moz","O"];Object.keys(Ss).forEach(function(t){Zz.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ss[e]=Ss[t]})});function hw(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Ss.hasOwnProperty(t)&&Ss[t]?(""+e).trim():e+"px"}function mw(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=hw(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var e4=ke({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xd(t,e){if(e){if(e4[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(_(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(_(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(_(61))}if(e.style!=null&&typeof e.style!="object")throw Error(_(62))}}function Od(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Td=null;function gh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var kd=null,Xi=null,Zi=null;function Wy(t){if(t=El(t)){if(typeof kd!="function")throw Error(_(280));var e=t.stateNode;e&&(e=Wu(e),kd(t.stateNode,t.type,e))}}function gw(t){Xi?Zi?Zi.push(t):Zi=[t]:Xi=t}function yw(){if(Xi){var t=Xi,e=Zi;if(Zi=Xi=null,Wy(t),e)for(t=0;t>>=0,t===0?32:31-(f4(t)/d4|0)|0}var Vl=64,Wl=4194304;function cs(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ja(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=cs(l):(o&=s,o!==0&&(r=cs(o)))}else s=n&~i,s!==0?r=cs(s):o!==0&&(r=cs(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Sl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ln(e),t[e]=n}function g4(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Es),Zy=" ",ev=!1;function Lw(t,e){switch(t){case"keyup":return W4.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var zi=!1;function G4(t,e){switch(t){case"compositionend":return Fw(e);case"keypress":return e.which!==32?null:(ev=!0,Zy);case"textInput":return t=e.data,t===Zy&&ev?null:t;default:return null}}function K4(t,e){if(zi)return t==="compositionend"||!xh&&Lw(t,e)?(t=Dw(),ma=Eh=ur=null,zi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=iv(n)}}function Uw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Uw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Vw(){for(var t=window,e=La();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=La(t.document)}return e}function Oh(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function n6(t){var e=Vw(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Uw(n.ownerDocument.documentElement,n)){if(r!==null&&Oh(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=ov(n,o);var s=ov(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ji=null,Pd=null,bs=null,$d=!1;function sv(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$d||ji==null||ji!==La(r)||(r=ji,"selectionStart"in r&&Oh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),bs&&Ws(bs,r)||(bs=r,r=Wa(Pd,"onSelect"),0Wi||(t.current=zd[Wi],zd[Wi]=null,Wi--)}function Se(t,e){Wi++,zd[Wi]=t.current,t.current=e}var _r={},lt=$r(_r),Ot=$r(!1),ai=_r;function ho(t,e){var n=t.type.contextTypes;if(!n)return _r;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Tt(t){return t=t.childContextTypes,t!=null}function Ga(){Ce(Ot),Ce(lt)}function pv(t,e,n){if(lt.current!==_r)throw Error(_(168));Se(lt,e),Se(Ot,n)}function Xw(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(_(108,Qz(t)||"Unknown",i));return ke({},n,r)}function Ka(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||_r,ai=lt.current,Se(lt,t),Se(Ot,Ot.current),!0}function hv(t,e,n){var r=t.stateNode;if(!r)throw Error(_(169));n?(t=Xw(t,e,ai),r.__reactInternalMemoizedMergedChildContext=t,Ce(Ot),Ce(lt),Se(lt,t)):Ce(Ot),Se(Ot,n)}var Ln=null,Hu=!1,Sf=!1;function Zw(t){Ln===null?Ln=[t]:Ln.push(t)}function h6(t){Hu=!0,Zw(t)}function Dr(){if(!Sf&&Ln!==null){Sf=!0;var t=0,e=fe;try{var n=Ln;for(fe=1;t>=s,i-=s,Bn=1<<32-ln(e)+i|n<k?(I=O,O=null):I=O.sibling;var M=d(m,O,g[k],w);if(M===null){O===null&&(O=I);break}t&&O&&M.alternate===null&&e(m,O),y=o(M,y,k),C===null?x=M:C.sibling=M,C=M,O=I}if(k===g.length)return n(m,O),be&&Ur(m,k),x;if(O===null){for(;kk?(I=O,O=null):I=O.sibling;var J=d(m,O,M.value,w);if(J===null){O===null&&(O=I);break}t&&O&&J.alternate===null&&e(m,O),y=o(J,y,k),C===null?x=J:C.sibling=J,C=J,O=I}if(M.done)return n(m,O),be&&Ur(m,k),x;if(O===null){for(;!M.done;k++,M=g.next())M=f(m,M.value,w),M!==null&&(y=o(M,y,k),C===null?x=M:C.sibling=M,C=M);return be&&Ur(m,k),x}for(O=r(m,O);!M.done;k++,M=g.next())M=p(O,m,k,M.value,w),M!==null&&(t&&M.alternate!==null&&O.delete(M.key===null?k:M.key),y=o(M,y,k),C===null?x=M:C.sibling=M,C=M);return t&&O.forEach(function(T){return e(m,T)}),be&&Ur(m,k),x}function S(m,y,g,w){if(typeof g=="object"&&g!==null&&g.type===Bi&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case zl:e:{for(var x=g.key,C=y;C!==null;){if(C.key===x){if(x=g.type,x===Bi){if(C.tag===7){n(m,C.sibling),y=i(C,g.props.children),y.return=m,m=y;break e}}else if(C.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===er&&Ev(x)===C.type){n(m,C.sibling),y=i(C,g.props),y.ref=rs(m,C,g),y.return=m,m=y;break e}n(m,C);break}else e(m,C);C=C.sibling}g.type===Bi?(y=ti(g.props.children,m.mode,w,g.key),y.return=m,m=y):(w=ba(g.type,g.key,g.props,null,m.mode,w),w.ref=rs(m,y,g),w.return=m,m=w)}return s(m);case Fi:e:{for(C=g.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(m,y.sibling),y=i(y,g.children||[]),y.return=m,m=y;break e}else{n(m,y);break}else e(m,y);y=y.sibling}y=kf(g,m.mode,w),y.return=m,m=y}return s(m);case er:return C=g._init,S(m,y,C(g._payload),w)}if(us(g))return h(m,y,g,w);if(Xo(g))return v(m,y,g,w);Ql(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(m,y.sibling),y=i(y,g),y.return=m,m=y):(n(m,y),y=Tf(g,m.mode,w),y.return=m,m=y),s(m)):n(m,y)}return S}var go=lE(!0),aE=lE(!1),Cl={},xn=$r(Cl),qs=$r(Cl),Ys=$r(Cl);function Yr(t){if(t===Cl)throw Error(_(174));return t}function $h(t,e){switch(Se(Ys,e),Se(qs,t),Se(xn,Cl),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:bd(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=bd(e,t)}Ce(xn),Se(xn,e)}function yo(){Ce(xn),Ce(qs),Ce(Ys)}function uE(t){Yr(Ys.current);var e=Yr(xn.current),n=bd(e,t.type);e!==n&&(Se(qs,t),Se(xn,n))}function Dh(t){qs.current===t&&(Ce(xn),Ce(qs))}var Oe=$r(0);function Za(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var wf=[];function Rh(){for(var t=0;tn?n:4,t(!0);var r=Ef.transition;Ef.transition={};try{t(!1),e()}finally{fe=n,Ef.transition=r}}function OE(){return Yt().memoizedState}function v6(t,e,n){var r=wr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},TE(t))kE(e,n);else if(n=rE(t,e,n,r),n!==null){var i=dt();an(n,t,r,i),AE(n,e,r)}}function S6(t,e,n){var r=wr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(TE(t))kE(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,cn(l,s)){var a=e.interleaved;a===null?(i.next=i,Ih(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}n=rE(t,e,i,r),n!==null&&(i=dt(),an(n,t,r,i),AE(n,e,r))}}function TE(t){var e=t.alternate;return t===Te||e!==null&&e===Te}function kE(t,e){xs=eu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function AE(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,vh(t,n)}}var tu={readContext:qt,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},w6={readContext:qt,useCallback:function(t,e){return gn().memoizedState=[t,e===void 0?null:e],t},useContext:qt,useEffect:bv,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Sa(4194308,4,wE.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Sa(4194308,4,t,e)},useInsertionEffect:function(t,e){return Sa(4,2,t,e)},useMemo:function(t,e){var n=gn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=gn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=v6.bind(null,Te,t),[r.memoizedState,t]},useRef:function(t){var e=gn();return t={current:t},e.memoizedState=t},useState:Cv,useDebugValue:jh,useDeferredValue:function(t){return gn().memoizedState=t},useTransition:function(){var t=Cv(!1),e=t[0];return t=y6.bind(null,t[1]),gn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Te,i=gn();if(be){if(n===void 0)throw Error(_(407));n=n()}else{if(n=e(),je===null)throw Error(_(349));ci&30||dE(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,bv(hE.bind(null,r,o,t),[t]),r.flags|=2048,Xs(9,pE.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=gn(),e=je.identifierPrefix;if(be){var n=zn,r=Bn;n=(r&~(1<<32-ln(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Js++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[wn]=e,t[Ks]=r,LE(t,e,!1,!1),e.stateNode=t;e:{switch(s=Od(n,r),n){case"dialog":we("cancel",t),we("close",t),i=r;break;case"iframe":case"object":case"embed":we("load",t),i=r;break;case"video":case"audio":for(i=0;iSo&&(e.flags|=128,r=!0,is(o,!1),e.lanes=4194304)}else{if(!r)if(t=Za(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),is(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!be)return et(e),null}else 2*Ne()-o.renderingStartTime>So&&n!==1073741824&&(e.flags|=128,r=!0,is(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Ne(),e.sibling=null,n=Oe.current,Se(Oe,r?n&1|2:n&1),e):(et(e),null);case 22:case 23:return Kh(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Mt&1073741824&&(et(e),e.subtreeFlags&6&&(e.flags|=8192)):et(e),null;case 24:return null;case 25:return null}throw Error(_(156,e.tag))}function A6(t,e){switch(kh(e),e.tag){case 1:return Tt(e.type)&&Ga(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return yo(),Ce(Ot),Ce(lt),Rh(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Dh(e),null;case 13:if(Ce(Oe),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(_(340));mo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ce(Oe),null;case 4:return yo(),null;case 10:return Mh(e.type._context),null;case 22:case 23:return Kh(),null;case 24:return null;default:return null}}var Zl=!1,rt=!1,_6=typeof WeakSet=="function"?WeakSet:Set,L=null;function qi(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ae(t,e,r)}else n.current=null}function Xd(t,e,n){try{n()}catch(r){Ae(t,e,r)}}var Iv=!1;function N6(t,e){if(Dd=Ua,t=Vw(),Oh(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,f=t,d=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(l=s+i),f!==o||r!==0&&f.nodeType!==3||(a=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===t)break t;if(d===n&&++u===i&&(l=s),d===o&&++c===r&&(a=s),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rd={focusedElem:t,selectionRange:n},Ua=!1,L=e;L!==null;)if(e=L,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,L=t;else for(;L!==null;){e=L;try{var h=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var v=h.memoizedProps,S=h.memoizedState,m=e.stateNode,y=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:en(e.type,v),S);m.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=e.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(w){Ae(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,L=t;break}L=e.return}return h=Iv,Iv=!1,h}function Os(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&Xd(e,n,o)}i=i.next}while(i!==r)}}function qu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Zd(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function zE(t){var e=t.alternate;e!==null&&(t.alternate=null,zE(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[wn],delete e[Ks],delete e[Bd],delete e[d6],delete e[p6])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function jE(t){return t.tag===5||t.tag===3||t.tag===4}function Pv(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||jE(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ep(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ha));else if(r!==4&&(t=t.child,t!==null))for(ep(t,e,n),t=t.sibling;t!==null;)ep(t,e,n),t=t.sibling}function tp(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(tp(t,e,n),t=t.sibling;t!==null;)tp(t,e,n),t=t.sibling}var Ge=null,tn=!1;function Qn(t,e,n){for(n=n.child;n!==null;)UE(t,e,n),n=n.sibling}function UE(t,e,n){if(bn&&typeof bn.onCommitFiberUnmount=="function")try{bn.onCommitFiberUnmount(zu,n)}catch{}switch(n.tag){case 5:rt||qi(n,e);case 6:var r=Ge,i=tn;Ge=null,Qn(t,e,n),Ge=r,tn=i,Ge!==null&&(tn?(t=Ge,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ge.removeChild(n.stateNode));break;case 18:Ge!==null&&(tn?(t=Ge,n=n.stateNode,t.nodeType===8?vf(t.parentNode,n):t.nodeType===1&&vf(t,n),Us(t)):vf(Ge,n.stateNode));break;case 4:r=Ge,i=tn,Ge=n.stateNode.containerInfo,tn=!0,Qn(t,e,n),Ge=r,tn=i;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Xd(n,e,s),i=i.next}while(i!==r)}Qn(t,e,n);break;case 1:if(!rt&&(qi(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ae(n,e,l)}Qn(t,e,n);break;case 21:Qn(t,e,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,Qn(t,e,n),rt=r):Qn(t,e,n);break;default:Qn(t,e,n)}}function $v(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new _6),e.forEach(function(r){var i=B6.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Xt(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*I6(r/1960))-r,10t?16:t,cr===null)var r=!1;else{if(t=cr,cr=null,iu=0,oe&6)throw Error(_(331));var i=oe;for(oe|=4,L=t.current;L!==null;){var o=L,s=o.child;if(L.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aNe()-Hh?ei(t,0):Wh|=n),kt(t,e)}function JE(t,e){e===0&&(t.mode&1?(e=Wl,Wl<<=1,!(Wl&130023424)&&(Wl=4194304)):e=1);var n=dt();t=Gn(t,e),t!==null&&(Sl(t,e,n),kt(t,n))}function F6(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),JE(t,n)}function B6(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(e),JE(t,n)}var QE;QE=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ot.current)xt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return xt=!1,T6(t,e,n);xt=!!(t.flags&131072)}else xt=!1,be&&e.flags&1048576&&eE(e,Ya,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;wa(t,e),t=e.pendingProps;var i=ho(e,lt.current);to(e,n),i=Fh(null,e,r,t,i,n);var o=Bh();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Tt(r)?(o=!0,Ka(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ph(e),i.updater=Gu,e.stateNode=i,i._reactInternals=e,Hd(e,r,t,n),e=qd(null,e,r,!0,o,n)):(e.tag=0,be&&o&&Th(e),ut(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(wa(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=j6(r),t=en(r,t),i){case 0:e=Kd(null,e,r,t,n);break e;case 1:e=_v(null,e,r,t,n);break e;case 11:e=kv(null,e,r,t,n);break e;case 14:e=Av(null,e,r,en(r.type,t),n);break e}throw Error(_(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:en(r,i),Kd(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:en(r,i),_v(t,e,r,i,n);case 3:e:{if($E(e),t===null)throw Error(_(387));r=e.pendingProps,o=e.memoizedState,i=o.element,iE(t,e),Xa(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=vo(Error(_(423)),e),e=Nv(t,e,r,n,i);break e}else if(r!==i){i=vo(Error(_(424)),e),e=Nv(t,e,r,n,i);break e}else for(Pt=yr(e.stateNode.containerInfo.firstChild),$t=e,be=!0,nn=null,n=aE(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(mo(),r===i){e=Kn(t,e,n);break e}ut(t,e,r,n)}e=e.child}return e;case 5:return uE(e),t===null&&Ud(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,Ld(r,i)?s=null:o!==null&&Ld(r,o)&&(e.flags|=32),PE(t,e),ut(t,e,s,n),e.child;case 6:return t===null&&Ud(e),null;case 13:return DE(t,e,n);case 4:return $h(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=go(e,null,r,n):ut(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:en(r,i),kv(t,e,r,i,n);case 7:return ut(t,e,e.pendingProps,n),e.child;case 8:return ut(t,e,e.pendingProps.children,n),e.child;case 12:return ut(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,Se(Ja,r._currentValue),r._currentValue=s,o!==null)if(cn(o.value,s)){if(o.children===i.children&&!Ot.current){e=Kn(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Un(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Vd(o.return,n,e),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(_(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Vd(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ut(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,to(e,n),i=qt(i),r=r(i),e.flags|=1,ut(t,e,r,n),e.child;case 14:return r=e.type,i=en(r,e.pendingProps),i=en(r.type,i),Av(t,e,r,i,n);case 15:return ME(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:en(r,i),wa(t,e),e.tag=1,Tt(r)?(t=!0,Ka(e)):t=!1,to(e,n),sE(e,r,i),Hd(e,r,i,n),qd(null,e,r,!0,t,n);case 19:return RE(t,e,n);case 22:return IE(t,e,n)}throw Error(_(156,e.tag))};function XE(t,e){return xw(t,e)}function z6(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(t,e,n,r){return new z6(t,e,n,r)}function Yh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function j6(t){if(typeof t=="function")return Yh(t)?1:0;if(t!=null){if(t=t.$$typeof,t===hh)return 11;if(t===mh)return 14}return 2}function Er(t,e){var n=t.alternate;return n===null?(n=Ht(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function ba(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")Yh(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Bi:return ti(n.children,i,o,e);case ph:s=8,i|=8;break;case md:return t=Ht(12,n,e,i|2),t.elementType=md,t.lanes=o,t;case gd:return t=Ht(13,n,e,i),t.elementType=gd,t.lanes=o,t;case yd:return t=Ht(19,n,e,i),t.elementType=yd,t.lanes=o,t;case lw:return Ju(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case ow:s=10;break e;case sw:s=9;break e;case hh:s=11;break e;case mh:s=14;break e;case er:s=16,r=null;break e}throw Error(_(130,t==null?t:typeof t,""))}return e=Ht(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function ti(t,e,n,r){return t=Ht(7,t,r,e),t.lanes=n,t}function Ju(t,e,n,r){return t=Ht(22,t,r,e),t.elementType=lw,t.lanes=n,t.stateNode={isHidden:!1},t}function Tf(t,e,n){return t=Ht(6,t,null,e),t.lanes=n,t}function kf(t,e,n){return e=Ht(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function U6(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lf(0),this.expirationTimes=lf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jh(t,e,n,r,i,o,s,l,a){return t=new U6(t,e,n,l,a),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Ht(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ph(o),t}function V6(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nC)}catch(t){console.error(t)}}nC(),ew.exports=Bt;var rC=ew.exports,q6,Uv=rC;q6=Uv.createRoot,Uv.hydrateRoot;var iC={exports:{}},oC={};/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var wo=H;function Y6(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var J6=typeof Object.is=="function"?Object.is:Y6,Q6=wo.useState,X6=wo.useEffect,Z6=wo.useLayoutEffect,ej=wo.useDebugValue;function tj(t,e){var n=e(),r=Q6({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return Z6(function(){i.value=n,i.getSnapshot=e,Af(i)&&o({inst:i})},[t,n,e]),X6(function(){return Af(i)&&o({inst:i}),t(function(){Af(i)&&o({inst:i})})},[t]),ej(n),n}function Af(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!J6(t,n)}catch{return!0}}function nj(t,e){return e()}var rj=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?nj:tj;oC.useSyncExternalStore=wo.useSyncExternalStore!==void 0?wo.useSyncExternalStore:rj;iC.exports=oC;var sC=iC.exports,lC={exports:{}},aC={};/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var tc=H,ij=sC;function oj(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var sj=typeof Object.is=="function"?Object.is:oj,lj=ij.useSyncExternalStore,aj=tc.useRef,uj=tc.useEffect,cj=tc.useMemo,fj=tc.useDebugValue;aC.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=aj(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=cj(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&s.hasValue){var h=s.value;if(i(h,p))return f=h}return f=p}if(h=f,sj(c,p))return h;var v=r(p);return i!==void 0&&i(h,v)?h:(c=p,f=v)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return a(e())},d===null?void 0:function(){return a(d())}]},[e,n,r,i]);var l=lj(t,o[0],o[1]);return uj(function(){s.hasValue=!0,s.value=l},[l]),fj(l),l};lC.exports=aC;var dj=lC.exports;function pj(t){t()}let uC=pj;const hj=t=>uC=t,mj=()=>uC,Vv=Symbol.for("react-redux-context"),Wv=typeof globalThis<"u"?globalThis:{};function gj(){var t;if(!H.createContext)return{};const e=(t=Wv[Vv])!=null?t:Wv[Vv]=new Map;let n=e.get(H.createContext);return n||(n=H.createContext(null),e.set(H.createContext,n)),n}const el=gj();function cC(t=el){return function(){return H.useContext(t)}}const yj=cC(),fC=()=>{throw new Error("uSES not initialized!")};let dC=fC;const vj=t=>{dC=t},Sj=(t,e)=>t===e;function wj(t=el){const e=t===el?yj:cC(t);return function(r,i={}){const{equalityFn:o=Sj,stabilityCheck:s=void 0,noopCheck:l=void 0}=typeof i=="function"?{equalityFn:i}:i,{store:a,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=e();H.useRef(!0);const p=H.useCallback({[r.name](v){return r(v)}}[r.name],[r,f,s]),h=dC(u.addNestedSub,a.getState,c||a.getState,p,o);return H.useDebugValue(h),h}}const sY=wj();function ro(){return ro=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var hC={exports:{}},de={};/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ve=typeof Symbol=="function"&&Symbol.for,em=Ve?Symbol.for("react.element"):60103,tm=Ve?Symbol.for("react.portal"):60106,nc=Ve?Symbol.for("react.fragment"):60107,rc=Ve?Symbol.for("react.strict_mode"):60108,ic=Ve?Symbol.for("react.profiler"):60114,oc=Ve?Symbol.for("react.provider"):60109,sc=Ve?Symbol.for("react.context"):60110,nm=Ve?Symbol.for("react.async_mode"):60111,lc=Ve?Symbol.for("react.concurrent_mode"):60111,ac=Ve?Symbol.for("react.forward_ref"):60112,uc=Ve?Symbol.for("react.suspense"):60113,Ej=Ve?Symbol.for("react.suspense_list"):60120,cc=Ve?Symbol.for("react.memo"):60115,fc=Ve?Symbol.for("react.lazy"):60116,Cj=Ve?Symbol.for("react.block"):60121,bj=Ve?Symbol.for("react.fundamental"):60117,xj=Ve?Symbol.for("react.responder"):60118,Oj=Ve?Symbol.for("react.scope"):60119;function jt(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case em:switch(t=t.type,t){case nm:case lc:case nc:case ic:case rc:case uc:return t;default:switch(t=t&&t.$$typeof,t){case sc:case ac:case fc:case cc:case oc:return t;default:return e}}case tm:return e}}}function mC(t){return jt(t)===lc}de.AsyncMode=nm;de.ConcurrentMode=lc;de.ContextConsumer=sc;de.ContextProvider=oc;de.Element=em;de.ForwardRef=ac;de.Fragment=nc;de.Lazy=fc;de.Memo=cc;de.Portal=tm;de.Profiler=ic;de.StrictMode=rc;de.Suspense=uc;de.isAsyncMode=function(t){return mC(t)||jt(t)===nm};de.isConcurrentMode=mC;de.isContextConsumer=function(t){return jt(t)===sc};de.isContextProvider=function(t){return jt(t)===oc};de.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===em};de.isForwardRef=function(t){return jt(t)===ac};de.isFragment=function(t){return jt(t)===nc};de.isLazy=function(t){return jt(t)===fc};de.isMemo=function(t){return jt(t)===cc};de.isPortal=function(t){return jt(t)===tm};de.isProfiler=function(t){return jt(t)===ic};de.isStrictMode=function(t){return jt(t)===rc};de.isSuspense=function(t){return jt(t)===uc};de.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===nc||t===lc||t===ic||t===rc||t===uc||t===Ej||typeof t=="object"&&t!==null&&(t.$$typeof===fc||t.$$typeof===cc||t.$$typeof===oc||t.$$typeof===sc||t.$$typeof===ac||t.$$typeof===bj||t.$$typeof===xj||t.$$typeof===Oj||t.$$typeof===Cj)};de.typeOf=jt;hC.exports=de;var Tj=hC.exports,rm=Tj,kj={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Aj={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},_j={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},gC={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},im={};im[rm.ForwardRef]=_j;im[rm.Memo]=gC;function Hv(t){return rm.isMemo(t)?gC:im[t.$$typeof]||kj}var Nj=Object.defineProperty,Mj=Object.getOwnPropertyNames,Gv=Object.getOwnPropertySymbols,Ij=Object.getOwnPropertyDescriptor,Pj=Object.getPrototypeOf,Kv=Object.prototype;function yC(t,e,n){if(typeof e!="string"){if(Kv){var r=Pj(e);r&&r!==Kv&&yC(t,r,n)}var i=Mj(e);Gv&&(i=i.concat(Gv(e)));for(var o=Hv(t),s=Hv(e),l=0;le(i(...o)))}return n}function sp(t){return function(n){const r=t(n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function Yv(t){return t.dependsOnOwnProps?!!t.dependsOnOwnProps:t.length!==1}function wC(t,e){return function(r,{displayName:i}){const o=function(l,a){return o.dependsOnOwnProps?o.mapToProps(l,a):o.mapToProps(l,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(l,a){o.mapToProps=t,o.dependsOnOwnProps=Yv(t);let u=o(l,a);return typeof u=="function"&&(o.mapToProps=u,o.dependsOnOwnProps=Yv(u),u=o(l,a)),u},o}}function lm(t,e){return(n,r)=>{throw new Error(`Invalid value of type ${typeof t} for ${e} argument when connecting component ${r.wrappedComponentName}.`)}}function Uj(t){return t&&typeof t=="object"?sp(e=>jj(t,e)):t?typeof t=="function"?wC(t):lm(t,"mapDispatchToProps"):sp(e=>({dispatch:e}))}function Vj(t){return t?typeof t=="function"?wC(t):lm(t,"mapStateToProps"):sp(()=>({}))}function Wj(t,e,n){return ro({},n,t,e)}function Hj(t){return function(n,{displayName:r,areMergedPropsEqual:i}){let o=!1,s;return function(a,u,c){const f=t(a,u,c);return o?i(f,s)||(s=f):(o=!0,s=f),s}}}function Gj(t){return t?typeof t=="function"?Hj(t):lm(t,"mergeProps"):()=>Wj}function Kj(){const t=mj();let e=null,n=null;return{clear(){e=null,n=null},notify(){t(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=e;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:e=o,function(){!i||e===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}const Jv={notify(){},get:()=>[]};function EC(t,e){let n,r=Jv,i=0,o=!1;function s(v){c();const S=r.subscribe(v);let m=!1;return()=>{m||(m=!0,S(),f())}}function l(){r.notify()}function a(){h.onStateChange&&h.onStateChange()}function u(){return o}function c(){i++,n||(n=e?e.addNestedSub(a):t.subscribe(a),r=Kj())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Jv)}function d(){o||(o=!0,c())}function p(){o&&(o=!1,f())}const h={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:a,isSubscribed:u,trySubscribe:d,tryUnsubscribe:p,getListeners:()=>r};return h}const qj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lu=qj?H.useLayoutEffect:H.useEffect;function Qv(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function _f(t,e){if(Qv(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let i=0;i{CC=t},Qj=[null,null];function Xj(t,e,n){lu(()=>t(...e),n)}function Zj(t,e,n,r,i,o){t.current=r,n.current=!1,i.current&&(i.current=null,o())}function eU(t,e,n,r,i,o,s,l,a,u,c){if(!t)return()=>{};let f=!1,d=null;const p=()=>{if(f||!l.current)return;const v=e.getState();let S,m;try{S=r(v,i.current)}catch(y){m=y,d=y}m||(d=null),S===o.current?s.current||u():(o.current=S,a.current=S,s.current=!0,c())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function tU(t,e){return t===e}function lY(t,e,n,{pure:r,areStatesEqual:i=tU,areOwnPropsEqual:o=_f,areStatePropsEqual:s=_f,areMergedPropsEqual:l=_f,forwardRef:a=!1,context:u=el}={}){const c=u,f=Vj(t),d=Uj(e),p=Gj(n),h=!!t;return S=>{const m=S.displayName||S.name||"Component",y=`Connect(${m})`,g={shouldHandleStateChanges:h,displayName:y,wrappedComponentName:m,WrappedComponent:S,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:p,areStatesEqual:i,areStatePropsEqual:s,areOwnPropsEqual:o,areMergedPropsEqual:l};function w(O){const[k,I,M]=H.useMemo(()=>{const{reactReduxForwardedRef:wt}=O,_n=pC(O,Yj);return[O.context,wt,_n]},[O]),J=H.useMemo(()=>k&&k.Consumer&&Lj.isContextConsumer(H.createElement(k.Consumer,null))?k:c,[k,c]),T=H.useContext(J),B=!!O.store&&!!O.store.getState&&!!O.store.dispatch,G=!!T&&!!T.store,q=B?O.store:T.store,he=G?T.getServerState:q.getState,De=H.useMemo(()=>zj(q.dispatch,g),[q]),[D,F]=H.useMemo(()=>{if(!h)return Qj;const wt=EC(q,B?void 0:T.subscription),_n=wt.notifyNestedSubs.bind(wt);return[wt,_n]},[q,B,T]),W=H.useMemo(()=>B?T:ro({},T,{subscription:D}),[B,T,D]),K=H.useRef(),ue=H.useRef(M),P=H.useRef(),Q=H.useRef(!1);H.useRef(!1);const X=H.useRef(!1),_e=H.useRef();lu(()=>(X.current=!0,()=>{X.current=!1}),[]);const ge=H.useMemo(()=>()=>P.current&&M===ue.current?P.current:De(q.getState(),M),[q,M]),An=H.useMemo(()=>_n=>D?eU(h,q,D,De,ue,K,Q,X,P,F,_n):()=>{},[D]);Xj(Zj,[ue,K,Q,M,P,F]);let pn;try{pn=CC(An,ge,he?()=>De(he(),M):ge)}catch(wt){throw _e.current&&(wt.message+=` -The error may be correlated with this previous error: -${_e.current.stack} - -`),wt}lu(()=>{_e.current=void 0,P.current=void 0,K.current=pn});const _t=H.useMemo(()=>H.createElement(S,ro({},pn,{ref:I})),[I,S,pn]);return H.useMemo(()=>h?H.createElement(J.Provider,{value:W},_t):_t,[J,_t,W])}const C=H.memo(w);if(C.WrappedComponent=S,C.displayName=w.displayName=y,a){const k=H.forwardRef(function(M,J){return H.createElement(C,ro({},M,{reactReduxForwardedRef:J}))});return k.displayName=y,k.WrappedComponent=S,qv(k,S)}return qv(C,S)}}function aY({store:t,context:e,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const s=H.useMemo(()=>{const u=EC(t);return{store:t,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:i,noopCheck:o}},[t,r,i,o]),l=H.useMemo(()=>t.getState(),[t]);lu(()=>{const{subscription:u}=s;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),l!==t.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[s,l]);const a=e||el;return H.createElement(a.Provider,{value:s},n)}vj(dj.useSyncExternalStoreWithSelector);Jj(sC.useSyncExternalStore);hj(rC.unstable_batchedUpdates);var bC={exports:{}},nU="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",rU=nU,iU=rU;function xC(){}function OC(){}OC.resetWarningCache=xC;var oU=function(){function t(r,i,o,s,l,a){if(a!==iU){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:OC,resetWarningCache:xC};return n.PropTypes=n,n};bC.exports=oU();var sU=bC.exports;const uY=xe(sU);function TC(t){return Fu.sanitize(t,{ALLOWED_TAGS:["#text"],KEEP_CONTENT:!0})}function bl(t,e){return t.reduce((n,r)=>n?r(n):null,e)}var lU=gi,aU=yt,uU=kn,cU="[object String]";function fU(t){return typeof t=="string"||!aU(t)&&uU(t)&&lU(t)==cU}var dU=fU;const Eo=xe(dU),kC=t=>{if(!Array.isArray(t))throw new TypeError("customFilters should be given as an array");if(t.some(e=>typeof e!="function"))throw new TypeError("The given filter is not a function");return!0};var pU=uS;function hU(t,e,n,r){return pU(t,function(i,o,s){e(r,n(i),o,s)}),r}var mU=hU,gU=mU;function yU(t,e){return function(n,r){return gU(n,t,e(r),{})}}var vU=yU,SU=E0,wU=vU,EU=fl,CU=Object.prototype,bU=CU.toString,xU=wU(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=bU.call(e)),t[e]=n},SU(EU)),OU=xU;const AC=xe(OU);function TU(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var _C=TU;const io=xe(_C);function kU(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r1),o}),GU(t,YU(t),n),r&&(n=VU(n,JU|QU|XU,KU));for(var i=e.length;i--;)WU(n,e[i]);return n}),e5=ZU;const lp=xe(e5),A={AFlat:"Ab",A:"A",ASharp:"A#",BFlat:"Bb",B:"B",C:"C",CSharp:"C#",DFlat:"Db",D:"D",DSharp:"D#",EFlat:"Eb",E:"E",F:"F",FSharp:"F#",GFlat:"Gb",G:"G",GSharp:"G#"},ap={Ab:A.AFlat,A:A.A,"A#":A.ASharp,Bb:A.BFlat,B:A.B,"B#":A.C,Cb:A.B,C:A.C,"C#":A.CSharp,Db:A.DFlat,D:A.D,"D#":A.DSharp,Eb:A.EFlat,E:A.E,"E#":A.F,Fb:A.E,F:A.F,"F#":A.FSharp,Gb:A.GFlat,G:A.G,"G#":A.GSharp},Xv={Lab:A.AFlat,La:A.A,"La#":A.ASharp,Sib:A.BFlat,Si:A.B,"Si#":A.C,Dob:A.B,Do:A.C,"Do#":A.CSharp,Reb:A.DFlat,Réb:A.DFlat,Re:A.D,Ré:A.D,"Re#":A.DSharp,"Ré#":A.DSharp,Mib:A.EFlat,Mi:A.E,"Mi#":A.F,Fab:A.E,Fa:A.F,"Fa#":A.FSharp,Solb:A.GFlat,Sol:A.G,"Sol#":A.GSharp},Zv={...lp(ap,["Bb","B","B#"]),As:A.AFlat,Ais:A.ASharp,Hb:A.BFlat,Hes:A.BFlat,H:A.B,His:A.C,"H#":A.C,Ces:A.B,Cis:A.CSharp,Des:A.DFlat,Dis:A.DSharp,Es:A.EFlat,Eis:A.F,Fes:A.E,Fis:A.FSharp,Ges:A.GFlat,Gis:A.GSharp};function am(t){let e;return Object.keys(t).reduce((n,r)=>(r.match(/.[b|#]$/)&&(e=r.replace("#","♯").replace("b","♭"),n[e]=t[r]),n),{})}const NC={...ap,...am(ap)},MC={...Xv,...am(Xv)},IC={...Zv,...am(Zv)},up={...NC,...MC,...IC};Object.keys(up).sort((t,e)=>e.length-t.length);const t5=Object.keys(NC).sort((t,e)=>e.length-t.length),n5=Object.keys(MC).sort((t,e)=>e.length-t.length),r5=Object.keys(IC).sort((t,e)=>e.length-t.length),i5=[{name:"english",notes:t5},{name:"german",notes:r5},{name:"latin",notes:n5}],tl=[A.A,A.ASharp,A.B,A.C,A.CSharp,A.D,A.DSharp,A.E,A.F,A.FSharp,A.G,A.GSharp],o5=[A.A,A.BFlat,A.B,A.C,A.DFlat,A.D,A.EFlat,A.E,A.F,A.GFlat,A.G,A.AFlat],PC={[A.CSharp]:A.DFlat,[A.DSharp]:A.EFlat,[A.FSharp]:A.GFlat,[A.GSharp]:A.AFlat,[A.ASharp]:A.BFlat},nl=AC(PC),s5=[...Object.values(A),...Object.values(A).map(t=>t+"m")];class l5 extends Error{constructor(){super("The given symbol is not a valid string"),this.name="InvalidInput"}}class a5 extends Error{constructor(){super("An unexpected error happened. Maybe a custom filter returned null instead of throwing an exception?"),this.name="UnexpectedError"}}class um extends Error{constructor(e,n,r){super(e),this.name=r,this.chord=n}}class $C extends um{constructor(e){const n=`"${e.input.symbol}" does not seems to be a chord`;super(n,e,"NoSymbolFound")}}class u5 extends um{constructor(e,n){const r=`The chord descriptor "${e.input.descriptor}" contains unknown or duplicated modifiers: "${n}"`;super(r,e,"InvalidModifier")}}class c5 extends um{constructor(e,n){const r=`"${e.input.symbol}" describes a chord with an invalid intervals combo: `+n.join(" and ");super(r,e,"InvalidIntervals")}}function xl(t,e){const n=Lp(e)?e:[e];return Rs(t,n)}function ae(t,e){return fm(t,e,"oneOf")}function cm(t,e){return fm(t,e,"all")}function Cr(t,e){return fm(t,e,"none")}function fm(t,e,n){return(Lp(e)?e:[e])[n==="oneOf"?"some":"every"](o=>n==="none"?!t.includes(o):t.includes(o))}const f5=[["2","3"],["2","9"],["3","b3"],["4","11"],["5","b5"],["5","#5"],["b6","#5"],["b6","6"],["b6","13"],["6","13"],["b7","bb7"],["7","b7"],["9","b9"],["9","#9"],["11","#11"],["13","b13"]];function d5(t){const e=t.normalized.intervals,n=f5.find(r=>cm(e,r));if(n)throw new c5(t,n);return t}function DC(t){const{rootNote:e,bassNote:n,descriptor:r,chordChanges:i}=t.formatted;let o=e;return r&&(o+=r),i&&i.length&&(o+="("+i.join(",")+")"),n&&(o+="/"+n),t.formatted.symbol=o,t}const R={ma:"major",ma6:"major6",ma7:"major7",dom7:"dominant7",mi:"minor",mi6:"minor6",mi7:"minor7",miMa7:"minorMajor7",aug:"augmented",dim:"diminished",dim7:"diminished7",power:"power",bass:"bass"},RC=[R.mi,R.mi6,R.mi7,R.miMa7,R.dim,R.dim7],p5={[R.ma]:()=>"",[R.ma6]:t=>t.normalized.intervals.includes("9")?"69":"6",[R.ma7]:t=>"ma"+na(t),[R.dom7]:t=>t.normalized.intents.alt?"7alt":na(t),[R.mi]:()=>"mi",[R.mi6]:t=>t.normalized.intervals.includes("9")?"mi69":"mi6",[R.mi7]:t=>"mi"+na(t),[R.miMa7]:t=>"miMa"+na(t),[R.aug]:()=>"+",[R.dim]:()=>"dim",[R.dim7]:()=>"dim7",[R.power]:()=>"5",[R.bass]:()=>" bass"},au={add:"add",add7:"Ma7",omit:"omit",sus:"sus"};function LC(t){return t.formatted={rootNote:t.normalized.rootNote,bassNote:t.normalized.bassNote,descriptor:h5(t),chordChanges:m5(t)},t}function h5(t){let e=p5[t.normalized.quality](t);return t.normalized.isSuspended&&(e+=au.sus),e}function na(t){const e=t.normalized.extensions;let n=e[e.length-1];return n==="11"&&t.normalized.intents.major&&(n=Cr(t.normalized.alterations,["b9","#9"])?"9":"7"),n||"7"}function m5(t){const e=v5(t.normalized.omits);if(g5(t))return e;const n=y5(t.normalized.quality,t.normalized.adds);return[...t.normalized.alterations,...n,...e]}function g5(t){return t.normalized.intents.alt&&t.normalized.quality===R.dom7}function y5(t,e){return e.filter(n=>!([R.ma6,R.mi6].includes(t)&&n==="9")).map((n,r)=>{let i="";return r===0&&(i+=au.add,["b","#"].includes(n[0])&&(i+=" ")),i+=n==="7"?au.add7:n,i})}function v5(t){return t.map((e,n)=>{let r="";return n===0&&(r+=au.omit),r+=e==="b3"?"3":e,r})}const Ni={flat:"♭",sharp:"♯"},S5={major:{0:"I",2:"II",3:`${Ni.flat}III`,4:"III",5:"IV",7:"V",8:`${Ni.flat}VI`,9:"VI",10:`${Ni.flat}VII`,11:"VII"},minor:{0:"I",2:"II",3:"III",4:`${Ni.sharp}III`,5:"IV",7:"V",8:"VI",9:`${Ni.sharp}VI`,10:"VII",11:`${Ni.sharp}VII`}},te={sup2:"²",sup4:"⁴",sup5:"⁵",sup6:"⁶",sup7:"⁷",sub3:"₃",sub4:"₄",sub5:"₅",flat:"♭",sharp:"♯"},ra={major:["I","ii","iii","IV","V","vi","vii°"],dom7:["IΔ",`ii${te.sup7}`,`iii${te.sup7}`,"IVΔ",`V${te.sup7}`,`vi${te.sup7}`,"viiø"],minor:["i","ii°","III","iv","v","VI","VII"],minor7:[`i${te.sup7}`,"iiø","IIIΔ",`iv${te.sup7}`,`v${te.sup7}`,"VIΔ","VIIΔ"]},ia={borrowedFromMinor:["i","ii°",`${te.flat}III`,"iv","v",`${te.flat}VI`,`${te.flat}VII`],borrowedFromMinor7:[`i${te.sup7}`,"iiø",`${te.flat}IIIΔ`,`iv${te.sup7}`,`v${te.sup7}`,`${te.flat}VIΔ`,`${te.flat}VIIΔ`],borrowedFromMajor:["I","ii",`${te.sharp}iii`,"IV","V",`${te.sharp}vi`,`${te.sharp}vii°`],borrowedFromDom7:["IΔ",`ii${te.sup7}`,`${te.sharp}iii${te.sup7}`,"IVΔ",`V${te.sup7}`,`${te.sharp}vi${te.sup7}`,`${te.sharp}viiø`]};function w5(t="",e){let n,r,i;t||(t=e.normalized.rootNote);const o=t.indexOf("m")>-1?"minor":"major",s=RC.includes(e.normalized.quality)?"minor":"major";n=E5(t,o,e,s);const l=T5(e),a=b5[e.normalized.quality](e,l);return r=`${n}${a}`,x5(o,r)?i="diatonic":O5(o,r)?i="borrowed":(i="unknown",n="?",r=`${n}${a}`),r+=l,e.numeral={symbol:r,degree:n,descriptor:a,inversion:l,type:i,thirdQuality:s},e}function E5(t,e,n,r){const i=t.replace("m",""),o=C5(i,n.normalized.rootNote),s=S5[e][o]||"?";return r==="minor"?s.toLowerCase():s}function C5(t,e){const n=tl.indexOf(nl[t]||t);return(tl.indexOf(nl[e]||e)-n+12)%12}const b5={[R.ma]:()=>"",[R.ma6]:()=>"",[R.ma7]:()=>"Δ",[R.dom7]:(t,e)=>e===""?`${te.sup7}`:"",[R.mi]:()=>"",[R.mi6]:()=>"",[R.mi7]:(t,e)=>t.normalized.intervals.includes("b5")?"ø":e===""?`${te.sup7}`:"",[R.miMa7]:()=>"mΔ",[R.aug]:()=>"+",[R.dim]:()=>"°",[R.dim7]:(t,e)=>e===""?`°${te.sup7}`:"°",[R.power]:()=>"",[R.bass]:()=>""};function x5(t,e){return t==="major"?ra.major.includes(e)||ra.dom7.includes(e):ra.minor.includes(e)||ra.minor7.includes(e)}function O5(t,e){return t==="major"?ia.borrowedFromMinor.includes(e)||ia.borrowedFromMinor7.includes(e):ia.borrowedFromMajor.includes(e)||ia.borrowedFromDom7.includes(e)}function T5(t){let e="";return t.normalized.bassNote&&(k5(t)?e=e1(t)?`${te.sup6}${te.sub5}`:`${te.sup6}`:A5(t)?e=e1(t)?`${te.sup4}${te.sub3}`:`${te.sup6}${te.sub4}`:_5(t)&&(e="²")),e}function e1(t){return[R.ma7,R.mi7,R.miMa7,R.dom7,R.dim7].includes(t.normalized.quality)}function k5(t){return br(t,"b3")||br(t,"3")}function A5(t){return br(t,"b5")||br(t,"5")||br(t,"#5")}function _5(t){return br(t,"bb7")||br(t,"b7")||br(t,"7")}function br(t,e){const n=t.normalized.intervals.indexOf(e);if(n===-1)return!1;const r=nl[t.normalized.bassNote]||t.normalized.bassNote,i=nl[t.normalized.notes[n]]||t.normalized.notes[n];return r===i}function N5(t){const e=[M5,I5,P5,$5];return t.input.descriptor&&(t.input.parsableDescriptor=bl(e,t.input.descriptor)),t}function M5(t){return t.replace(/[A-LN-Za-z]+/g,e=>e.toLowerCase()).replace("oMit","omit").replace("diM","dim").replace("augMented","augmented")}function I5(t){return t.replace(/ /g,"")}function P5(t){return t.replace(/(7?dim)(alt|add)/g,"$1 $2").replace(/([m|M])(alt|add)/g,"$1 $2").replace(/i(no[35])/g,"i $1").replace(/([b♭#♯]9)6/g,"$1 6").replace(/(9\/?6)/g," $1").replaceAll("+5","#5").replaceAll("-5","b5")}function $5(t){let e,n,r;return t.replace(/\((.*?)\)/g,(i,o)=>(e=[],n="",o.split(",").forEach(s=>{r=!0,s.startsWith("add")?n="add":s.startsWith("omit")?n="omit":s.startsWith("no")?n="no":r=!1,r?e.push(s):e.push(n+s)})," "+e.join(" ")+" "))}function D5(t={},e){return{input:{symbol:e},normalized:{},formatted:{},parserConfiguration:ie(t)}}const R5={C:"flat",D:"sharp",E:"sharp",F:"flat",G:"sharp",A:"sharp",B:"sharp",Cm:"flat",Dm:"flat",Em:"sharp",Fm:"flat",Gm:"flat",Am:"flat",Bm:"sharp"};function L5(t){return t.indexOf("#")>-1?"sharp":t.indexOf("b")>-1?"flat":R5[t]}function dm(t){const e=t.normalized.rootNote,n=t.normalized.semitones,r=t.normalized.quality;let i=e;RC.includes(r)&&(i+="m");const o=L5(i)==="sharp"?tl:o5,s=o.indexOf(e),l=[...o.slice(s),...o.slice(0,s),...o.slice(s),...o.slice(0,s)];return t.normalized.notes=n.map(a=>l[a]),t}function F5(t){return t.normalized.rootNote=up[t.input.rootNote],t.input.bassNote&&(t.normalized.bassNote=up[t.input.bassNote]),t}var B5=Qp,z5=4;function j5(t){return B5(t,z5)}var U5=j5;const pm=xe(U5);var V5=Lu,W5=vi,H5=Lo;function G5(t){return function(e,n,r){var i=Object(e);if(!W5(e)){var o=V5(n);e=H5(e),n=function(l){return o(i[l],l,i)}}var s=t(e,n,r);return s>-1?i[o?e[s]:s]:void 0}}var K5=G5;function q5(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o-1}var hm=L8;function F8(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=X8){var u=e?null:J8(t);if(u)return Q8(u);s=!1,i=Y8,a=new G8}else a=e?[]:l;e:for(;++r=cV&&(o=uV,s=!1,e=new iV(e));e:for(;++il.qualityIntervals.length-s.qualityIntervals.length);return T8(o,s=>cm(i,s.qualityIntervals))}function CV(t,e,n,r){const i=[bV.bind(null,r),xV.bind(null,n,e.normalized.intents.major),OV.bind(null,e.normalized.intents.alt),jC];return bl(i,pm(t))}function bV(t,e){const n=pm(e);return t.includes("3")?n.push("3"):t.includes("b3")&&n.push("b3"),n}function xV(t,e,n){if(t){const r=VC(n,"4");return r.push(e?"3":"b3"),r}return n}function OV(t,e){if(t){const n=VC(e,"b5","#5");return n.push("5"),n}return e}function TV(t,e){const n=[];return kV(e)&&(AV(t,e)?n.push("9","11","13"):_V(t,e)?n.push("9","13"):NV(t)?n.push("9","11"):MV(t)&&n.push("9")),n}function kV(t){return[R.ma7,R.dom7,R.mi7,R.miMa7].includes(t)}function HC(t){return[R.mi7,R.miMa7].includes(t)}function AV(t,e){return HC(e)&&ae(t,"13")&&ae(t,["11","#11"])&&ae(t,["b9","9","#9"])}function _V(t,e){return!HC(e)&&ae(t,"13")&&ae(t,["b9","9","#9"])}function NV(t){return ae(t,"11")&&ae(t,["b9","9","#9"])}function MV(t){return t.includes("9")}function IV(t,e,n){const r=[],i=[];return t.filter(o=>o!=="5"&&o!=="4").forEach(o=>{e.includes(o)||(PV(n,o)?i.push(o):r.push(o))}),$V(t)&&r.push("3"),{adds:i1(r),alterations:i1(i)}}function PV(t,e){return{[R.ma]:["b5","#5","#11","b13"],[R.ma6]:["b5","#5","#11","b13"],[R.ma7]:["b5","#5","#11","b13"],[R.dom7]:["b5","#5","b9","#9","#11","b13"],[R.mi]:["b5","#5","#11","b13"],[R.mi6]:["b5","#5","#11","b13"],[R.mi7]:["b5","#5","#11","b13"],[R.miMa7]:["b5","#5","#11","b13"],[R.aug]:[],[R.dim]:[],[R.dim7]:[]}[t].includes(e)}function $V(t){return cm(t,["3","4"])}function i1(t){return t.sort((e,n)=>{const r=Number.parseInt(e.replace(/[b#]/,"")),i=Number.parseInt(n.replace(/[b#]/,""));return r-i})}function DV(t,e){const{symbol:n}=e.input,r=t.join("|"),i=new RegExp("^("+r+")(.*?)(/("+r+"))?$"),o=n.match(i);if(o&&o[1])return e.input.rootNote=o[1],o[2]&&(e.input.descriptor=o[2]),o[4]&&(e.input.bassNote=o[4]),e;throw new $C(e)}const b={ma:"ma",mi:"mi",dim:"dim",halfDim:"halfDim",aug:"aug",seventh:"seventh",sus:"sus",sus2:"sus2",ninth:"ninth",eleventh:"eleventh",thirteenth:"thirteenth",fifthFlat:"b5",fifthSharp:"#5",ninthFlat:"b9",ninthSharp:"#9",eleventhSharp:"#11",thirteenthFlat:"b13",add3:"add3",add4:"add4",addb6:"addb6",add6:"add6",add69:"add69",add7:"add7",add9:"add9",add11:"add11",add13:"add13",bass:"bass",omit3:"omit3",omit5:"omit5",power:"power",alt:"alt"},gm={"^":[b.ma,b.add7],Δ:[b.ma,b.add7],M:b.ma,Ma:b.ma,Maj:b.ma,Major:b.ma,ma:b.ma,maj:b.ma,major:b.ma},RV=KC(gm,b.add7,t=>t+"7"),LV=KC(gm,b.add7,t=>"add"+t+"7"),GC={...gm,...RV,"-":b.mi,m:b.mi,Mi:b.mi,Min:b.mi,Minor:b.mi,mi:b.mi,min:b.mi,minor:b.mi,"°":b.dim,o:b.dim,0:b.dim,dim:b.dim,"dim.":b.dim,diminished:b.dim,Ø:b.halfDim,ø:b.halfDim,h:b.halfDim,"+":b.aug,aug:b.aug,augmented:b.aug,7:b.seventh,4:b.sus,sus:b.sus,sus4:b.sus,suspended:b.sus,suspended4:b.sus,sus2:b.sus2,suspended2:b.sus2,9:b.ninth,11:b.eleventh,13:b.thirteenth,b3:b.mi,b5:b.fifthFlat,"♭5":b.fifthFlat,"#5":b.fifthSharp,"♯5":b.fifthSharp,b9:b.ninthFlat,"♭9":b.ninthFlat,addb9:b.ninthFlat,"add♭9":b.ninthFlat,"#9":b.ninthSharp,"♯9":b.ninthSharp,"add#9":b.ninthSharp,"add♯9":b.ninthSharp,"#11":b.eleventhSharp,"♯11":b.eleventhSharp,"add#11":b.eleventhSharp,b13:b.thirteenthFlat,"♭13":b.thirteenthFlat,addb13:b.thirteenthFlat,"add♭13":b.thirteenthFlat,...LV,2:b.add9,add2:b.add9,add3:b.add3,add4:b.add4,addb6:b.addb6,b6:b.addb6,6:b.add6,add6:b.add6,"6/9":b.add69,69:b.add69,96:b.add69,"9/6":b.add69,add9:b.add9,add11:b.add11,add13:b.add13,bass:b.bass,omit3:b.omit3,no3:b.omit3,omit5:b.omit5,no5:b.omit5,5:b.power,alt:b.alt,"alt.":b.alt,altered:b.alt};function KC(t,e,n){return Object.keys(t).map(n).reduce((r,i)=>(r[i]=e,r),{})}const FV=Object.keys(GC).sort((t,e)=>e.length-t.length),uu={1:0,2:2,b3:3,3:4,4:5,b5:6,5:7,"#5":8,b6:8,6:9,bb7:9,b7:10,7:11,b9:13,9:14,"#9":15,11:17,"#11":18,b13:20,13:21};function BV(t,e){let n=[];return e.input.parsableDescriptor&&(n=zV(e)),e.input.modifiers=n,e.normalized.intervals=jV(n,t),e.normalized.semitones=QV(e.normalized.intervals),e.normalized.intents=XV(n),e}function zV(t){const{parsableDescriptor:e}=t.input,n=[],r=new RegExp(FV.map(JV).join("|"),"g"),i=e.match(r);let o=e,s;if(i&&i.forEach(l=>{s=GC[l],Array.isArray(s)||(s=[s]),s.forEach(a=>{n.includes(a)||(n.push(a),o=o.replace(l,""))})}),n.length===0)throw new $C(t);if(o.trim().length>0)throw new u5(t,o);return n}function jV(t,e){return t.includes(b.power)?["1","5"]:t.includes(b.bass)?["1"]:jC(["1",...UV(t),...VV(t),...WV(t,e),...HV(t),...GV(t),...KV(t,e),...qV(t,e),...YV(t,e)]).sort((n,r)=>uu[n]-uu[r])}function UV(t){const e=[];return t.includes(b.omit3)?[]:(ae(t,[b.sus,b.sus2])||(ym(t)?t.includes(b.eleventh)||e.push("3"):e.push("b3")),t.includes(b.add3)&&e.push("3"),e)}function VV(t){const e=[];return ae(t,[b.sus,b.add4])&&e.push("4"),e}function WV(t,e){const n=[];return t.includes(b.omit5)?[]:((ae(t,[b.dim,b.halfDim,b.fifthFlat])||Co(t,e,"b5"))&&n.push("b5"),(ae(t,[b.aug,b.fifthSharp])||Co(t,e,"#5"))&&n.push("#5"),!n.length&&!t.includes(b.thirteenthFlat)&&n.push("5"),n)}function HV(t){const e=[];return ae(t,[b.addb6])&&e.push("b6"),ae(t,[b.add6,b.add69])&&!qC(t)&&!ae(t,[b.halfDim])&&e.push("6"),e}function GV(t){const e=[];return ae(t,[b.alt])&&e.push("b7"),ae(t,[b.seventh,b.halfDim])?t.includes(b.dim)?e.push("bb7"):t.includes(b.halfDim)?e.push("b7"):e.push(o1(t)):ae(t,[b.ninth,b.eleventh,b.thirteenth])&&e.push(o1(t)),t.includes(b.add7)&&e.push("7"),e}function o1(t){return t.includes(b.ma)?"7":"b7"}function KV(t,e){const n=[];return ae(t,[b.add69,b.ninth,b.eleventh,b.thirteenth])&&Cr(t,[b.ninthFlat,b.ninthSharp])&&n.push("9"),ae(t,[b.sus2,b.add9])&&n.push("9"),(ae(t,[b.ninthFlat])||Co(t,e,"b9"))&&n.push("b9"),(ae(t,[b.ninthSharp])||Co(t,e,"#9"))&&n.push("#9"),n}function qV(t,e){const n=[];return(ae(t,[b.thirteenth])&&!ym(t)||ae(t,[b.eleventh,b.add11]))&&n.push("11"),(ae(t,[b.eleventhSharp])||Co(t,e,"#11"))&&n.push("#11"),n}function YV(t,e){const n=[];return(ae(t,[b.add13,b.thirteenth])||ae(t,[b.add6,b.add69])&&qC(t)||ae(t,[b.add6,b.add69])&&ae(t,[b.halfDim]))&&n.push("13"),(ae(t,[b.thirteenthFlat])||Co(t,e,"b13"))&&n.push("b13"),n}function Co(t,e,n){return t.includes(b.alt)&&e.includes(n)}function ym(t){return Cr(t,[b.mi,b.dim,b.dim7,b.halfDim])}function qC(t){return ae(t,[b.seventh,b.ninth,b.eleventh,b.thirteenth])}function JV(t){return t.replace(/[.\-*+?^${}()|[\]\\]/g,"\\$&")}function QV(t){return t.map(e=>uu[e]).sort((e,n)=>e-n)}function XV(t){return{major:ym(t),eleventh:t.includes(b.eleventh),alt:t.includes(b.alt)}}function Cc(t={}){const e=["b5","#5","b9","#9","#11","b13"],n=["english","german","latin"],{notationSystems:r=ie(n),altIntervals:i=ie(e),customFilters:o=[],key:s=""}=t;return ZV(i,e),e9(r,n),kC(o),t9(s),l;function l(a){const u=[];if(!n9(a)){const h=new l5;u.push(cp(h))}const c=ie(i5).filter(h=>r.includes(h.name));let f,d,p;if(!u.length)for(;c.length&&!f;){p=c.shift(),d=[D5.bind(null,t),DV.bind(null,p.notes),N5,BV.bind(null,i),d5,F5,WC,LC,DC,dm,w5.bind(null,s),...o];try{f=bl(d,a),f?f.input.notationSystem=p.name:u.push(r9(p.name))}catch(h){u.push(cp(h,p.name))}}return f||{error:u}}}function ZV(t,e){YC("altIntervals",t,e,!0)}function e9(t,e){YC("notationSystems",t,e)}function YC(t,e,n,r){if(!Array.isArray(e))throw new TypeError(`'${t}' should be an array`);if(!r&&e.length===0)throw new TypeError(`'${t}' cannot be empty`);e.forEach(i=>{if(!n.includes(i))throw new TypeError(`'${i}' is not a valid value for ${t}`)})}function t9(t){if(t!==""&&(!Eo(t)||!s5.includes(t)))throw new TypeError(`'${t}' is not a valid value for key`)}function n9(t){return typeof t=="string"&&t.length>0}function r9(t){const e=new a5;return cp(e,t)}function cp(t,e){return{type:t.name,chord:t.chord,message:t.message,notationSystem:e}}const In={sus2:"sus2",add2:"2",omit:"no",ma:"M",mi:"m",dim:"°",aug7:"7+",eleventh:"11"};function i9(t){let e,n=t.formatted.chordChanges;return o9(t)?(e=In.sus2,n=[]):s9(t)?(e=In.add2,n=[]):l9(t)?(e=In.aug7,n=[]):(e=t.formatted.descriptor.replace("mi",In.mi).replace(/[m|M]a/,In.ma).replace("dim",In.dim),a9(t)&&(e=e.replace(/7sus|9sus/,In.eleventh))),n=n.map(r=>r.replace(/[m|M]a/,In.ma).replace("omit",In.omit)),{...t,formatted:{...t.formatted,descriptor:e,chordChanges:n}}}function o9(t){return xl(t.normalized.intervals,["1","5","9"])}function s9(t){return xl(t.normalized.intervals,["1","3","5","9"])}function l9(t){return xl(t.normalized.intervals,["1","3","#5","b7"])}function a9(t){return t.normalized.intents.eleventh}var u9=UC,c9=Kp,f9=Ao,s1=Mu,d9=f9(function(t,e){return s1(t)?u9(t,c9(e,1,s1,!0)):[]}),p9=d9;const h9=xe(p9);function m9(t="none",e){if(t==="none")return e;const n={max:["4","b5","#5","6","bb7","b7","7","b9","9","#9","11","#11","b13","13"],core:["4","b9","9","#9","11","#11","b13","13"]},r=h9(e.normalized.intervals,n[t]);return Cr(r,["b3","3"])&&r.push(e.normalized.intents.major?"3":"b3"),Cr(r,["b5","5","#5"])&&r.push("5"),e.normalized.intervals=r,e.normalized.semitones=r.map(o=>uu[o]),e.normalized.intents.eleventh=!1,e.normalized.intents.alt=!1,t==="max"&&delete e.normalized.bassNote,bl([WC,LC,dm],e)}function g9(t,e,n){const{rootNote:r,bassNote:i}=n.normalized,o=a1(r);if(n.normalized.rootNote=l1(o,t,e),n.formatted.rootNote=n.normalized.rootNote,i){const s=a1(i);n.normalized.bassNote=l1(s,t,e),n.formatted.bassNote=n.normalized.bassNote}return dm(n)}function l1(t,e,n){const i=tl.indexOf(t)+e,o=Math.floor(i/12),s=i-o*12,l=tl[s];return n==="flat"&&PC[l]||l}function a1(t){return nl[t]||t}const fp={german:{Ab:"As",A:"A","A#":"Ais",Bb:"Hes",B:"H",C:"C","C#":"Cis",Db:"Des",D:"D","D#":"Dis",Eb:"Es",E:"E",F:"F","F#":"Fis",Gb:"Ges",G:"G","G#":"Gis"},latin:{Ab:"Lab",A:"La","A#":"La#",Bb:"Sib",B:"Si",C:"Do","C#":"Do#",Db:"Reb",D:"Re","D#":"Re#",Eb:"Mib",E:"Mi",F:"Fa","F#":"Fa#",Gb:"Solb",G:"Sol","G#":"Sol#"}},y9=Object.keys(fp);function v9(t="english",e){const n=t==="auto"?e.input.notationSystem:t;return n==="english"?e:y9.includes(n)?(e.formatted.rootNote=fp[n][e.formatted.rootNote],e.formatted.bassNote&&(e.formatted.bassNote=fp[n][e.formatted.bassNote]),e):null}function JC(t){return t&&t.formatted&&t.formatted.symbol?t.formatted.symbol:null}function S9(t){delete t.parserConfiguration.notationSystems;const e=ie(t),n=JC(t),i=Cc(t.parserConfiguration)(n);return e.input=i.input,e}function QC({accidental:t="original",customFilters:e=[],notationSystem:n="english",printer:r="text",simplify:i="none",transposeValue:o=0,useShortNamings:s=!1}={}){kC(e);const l=[];return["max","core"].includes(i)&&l.push(m9.bind(null,i)),(t!=="original"||o!==0)&&l.push(g9.bind(null,o,t)),s&&l.push(i9),l.push(v9.bind(null,n),DC,...e),a;function a(u){if(!w9(u))return null;const c=bl(l,ie(u));return r==="raw"?S9(c):JC(c)}}const w9=t=>t&&typeof t=="object"&&!t.error&&t.input,XC=/([^\s]+)/g,dp=/\[([^\]]*)]/g,ZC=t=>{const e=t.trim().match(XC);return e?e.every(tb):!1},eb=t=>{const e=t.trim().match(dp);return e?e.map(n=>n.replace(/[[\]]/g,"")).every(tb):!1};function tb(t){return!Cc()(t).error}const nb=(t,e)=>{for(;t.length&&e(t[0]);)t.shift();for(;t.length&&e(t[t.length-1]);)t.pop();return t},E9={adlib:"a","ad-lib":"a","ad.lib.":"a",bridge:"b",chorus:"c",intro:"i",introduction:"i",outro:"o",prechorus:"p","pre-chorus":"p","pre chorus":"p",solo:"s",interlude:"u",verse:"v"},rb=t=>{let e="#";const n="(.*?)",r="([\\s]+[0-9]{1,2})?",i="([\\s]+[x][0-9]{1,2})?",o=new RegExp(`^${n}${r}${i}$`),[,s,,l]=t.trim().match(o),a=s.trim().toLowerCase();return e+=E9[a]||s.trim(),l&&(e+=" "+l.trim()),e},ct={EMPTY:"empty",DIRECTIVE:"directive",COMMENT:"comment",LYRICS:"lyrics",CHORDS_LYRICS:"chordsLyrics",SECTION_START:"sectionStart",SECTION_CLOSE:"sectionClose",SECTION_REPEAT:"sectionRepeat"},C9=["chorus","verse","bridge","comment","comment_italic","comment_bold","c","ci","cb"],b9=["start_of_chorus","start_of_verse","start_of_bridge","start_of_part","soc","sov","sob","sop"],x9=["end_of_chorus","end_of_verse","end_of_bridge","end_of_part","eoc","eov","eob","sop"],O9={chorus:"c",verse:"v",bridge:"b",start_of_chorus:"c",start_of_verse:"v",start_of_bridge:"b",start_of_part:"v",soc:"c",sov:"v",sob:"b",sop:"v",c:"c",ci:"c",cb:"c",comment:"c",comment_italic:"c",comment_bold:"c"},T9=t=>{const e=[],n=t.map(i=>k9(i)).filter(i=>P9(i)),r=$9(n);return r.forEach((i,o)=>{e.push(i.label),i.allLines.forEach(s=>{e.push(s)}),o{const e={content:t};if(A9(t))e.type=ct.COMMENT;else if(_9(t))e.type=ct.EMPTY;else if(N9(t)){const[n,r]=M9(t);e.key=n,e.value=r,b9.includes(n)?e.type=ct.SECTION_START:x9.includes(n)?e.type=ct.SECTION_CLOSE:C9.includes(n)?e.type=ct.SECTION_REPEAT:e.type=ct.DIRECTIVE}else if(eb(t)){e.type=ct.CHORDS_LYRICS;const[n,r]=I9(t);e.chords=n,e.lyrics=r}else e.type=ct.LYRICS;return e},A9=t=>{const e=/^#.*$/;return t.trim().match(e)!==null},_9=t=>t.trim()==="",ib=/^{([^:]+):?(.*)?}$/,N9=t=>t.trim().match(ib)!==null,M9=t=>{const e=t.trim().match(ib),n=e[1].trim(),r=e[2]?e[2].trim():void 0;return[n,r]},I9=t=>{const n=t.trim().match(dp).map(i=>i.replace("[","").replace("]","")).join(" "),r=t.replace(dp,"_");return[n,r]},P9=t=>![ct.COMMENT,ct.DIRECTIVE].includes(t.type),$9=t=>{let e=[],n;const r=()=>{n&&(e.push(n),n=void 0)},i=o=>{n={label:o?D9(o):"#v",allLines:[]}};return t.forEach(o=>{o.type===ct.SECTION_START?(r(),i(o)):o.type===ct.SECTION_CLOSE?r():o.type===ct.SECTION_REPEAT?(r(),i(o),r()):o.type===ct.EMPTY?n&&n.allLines.push(o.content):(n||i(),o.type===ct.CHORDS_LYRICS?(n.allLines.push(o.chords),n.allLines.push(o.lyrics)):n.allLines.push(o.content))}),r(),e.map(o=>(o.allLines=nb(o.allLines,s=>s===""),o))},D9=t=>{let e;return t.value?e=rb(t.value):e="#"+O9[t.key],e},R9=t=>{let n=0;return t.replace(/\t/g,(i,o)=>{let s=4-(o+n)%4;return n+=s-1," ".repeat(s)}).length},ni=(t,e,n)=>(n>t.length&&(t+=" ".repeat(n-t.length)),t.slice(0,n)+e+t.slice(n)),L9=t=>{const e=[];let n=[];return t.forEach(r=>{ZC(r)?(e.push(z9(r)),n=j9(r)):(F9(r)?e.push(B9(r)):n.length&&r.trim()!==""?e.push(W9(r,n)):e.push(r),n=[])}),e.join(` -`)},ob=/^\[([^\]]+)]$/,F9=t=>{const e=t.trim().match(ob);return e!==null&&e[1].trim()!==""},B9=t=>{const e=t.trim().match(ob)[1];return rb(e)};function z9(t){return t.match(XC).join(" ")}function j9(t){const e=[];let n=0;const r=t.match(/([\s])+/g)||[],i=t.match(/([^\s])+/g);return U9(t)||r.unshift(""),V9(t)&&r.pop(),r.forEach((o,s)=>{const l=R9(" ".repeat(n)+o);e.push(l),n=l+i[s].length}),e}const U9=t=>sb(t.charAt(0)),V9=t=>sb(t.charAt(t.length-1)),sb=t=>t.match(/[\s]/),W9=(t,e)=>{const n="_";let r=t,i=0;return e.forEach(o=>{const s=Math.min(o+i,r.length+1);r=ni(r,n,s),i+=n.length}),r.replace(/[\s]+/g," ").trim()},Wr={AUTO:"auto",CP:"chordPro",COL:"chordsOverLyrics"},cY=(t,{inputFormat:e=Wr.AUTO}={})=>{H9(e);const n=G9(t);let r=e;e===Wr.AUTO&&(r=K9(n)?Wr.CP:Wr.COL);let i;switch(r){case Wr.CP:i=T9;break;case Wr.COL:i=L9;break}return i(n)},H9=t=>{if(!Object.values(Wr).includes(t))throw new Error("unknown input format: "+t)},G9=t=>TC(t).replace(/\r\n/g,` -`).replace(/\n\r/g,` -`).replace(/\r/g,` -`).replace(/\[\/?ch]/g,"").replace(/\[\/?tab]/g,"").split(` -`),K9=t=>{const e=t.filter(eb),n=t.filter(ZC);return e.length>n.length};function q9(t){return Fu.sanitize(t)}function lb(t){return Fu.sanitize(t,{ALLOWED_TAGS:["#text"],KEEP_CONTENT:!0})}const V={CHORD:"chord",EMPTY_LINE:"emptyLine",KEY_DECLARATION:"keyDeclaration",LYRIC:"lyric",SECTION_LABEL:"sectionLabel",TIME_SIGNATURE:"timeSignature"};var Y9=J0,ab=/[\\^$.*+?()[\]{}|]/g,J9=RegExp(ab.source);function Q9(t){return t=Y9(t),t&&J9.test(t)?t.replace(ab,"\\$&"):t}var X9=Q9;const Nr=xe(X9);function Yn(t){return t.replace(/\t+/g," ").replace(/ +/g," ").trim()}const Z9=["2/2","3/2","4/2","2/4","3/4","4/4","5/4","6/4","7/4","9/4","10/4","3/8","4/8","5/8","6/8","7/8","9/8","12/8"];function rl(t){return Z9.includes(t)}function cu(t){if(!rl(t))throw new TypeError("Expected time signature string, received: "+t);const e=t.split("/"),n=Number.parseInt(e[0],10),r=Number.parseInt(e[1],10);let i=n;return r===2?i=n*2:r===8&&(i=n/3),{string:t,count:n,value:r,beatCount:i}}const ce={barRepeat:"%",chordBeatCount:".",chordLineRepeat:"%",chordPositionMarker:"_",lyricLine:":",keyDeclarationPrefix:"key ",noChord:"NC",sectionLabel:"#",subBeatOpener:"[",subBeatCloser:"]"},ub=cu("4/4");function eW(t){return!Cc()(t).error}const tW=new RegExp(Nr(ce.chordBeatCount)+"*$","g"),nW=new RegExp("^"+Nr(ce.barRepeat)+"+$");function rW(t=""){return Yn(cb(t)).split(" ").every((e,n,r)=>{const i=fb(e);return eW(i)||e.match(nW)&&n>0||i===ce.noChord||rl(e)&&r.length>1})}const cb=t=>t.replaceAll("add ","add"),fb=t=>oW(iW(t)),iW=t=>t.replace(tW,""),oW=t=>{let e=t;return t.startsWith(ce.subBeatOpener)&&(e=e.substring(ce.subBeatOpener.length)),t.endsWith(ce.subBeatCloser)&&(e=e.substring(0,e.length-ce.subBeatCloser.length)),e};function sW(t){const e=Yn(t);return e===ce.chordLineRepeat||e===ce.chordLineRepeat.repeat(2)}function u1(t){return Yn(t)===""}const db=new RegExp("^"+Nr(ce.sectionLabel)+"([a-zA-Z]+)([1-9])?( x[1-9][0-9]?)?$");function fu(t){return Yn(t).match(db)!==null}function lW(t,e={}){return Cc({key:e.string})(t)}var aW=dn,uW=aW.isFinite;function cW(t){return typeof t=="number"&&uW(t)}var fW=cW;const oo=xe(fW);class dW extends Error{constructor({string:e,duration:n,currentBeatCount:r,beatCount:i}={}){if(!e||!Eo(e))throw new TypeError("InvalidBeatCountException cannot be created without chord string, received: "+e);if(!n||!oo(n))throw new TypeError("InvalidBeatCountException cannot be created without chord duration, received: "+n);if(!r||!oo(r))throw new TypeError("InvalidBeatCountException cannot be created without currentBeatCount, received: "+r);if(!i||!oo(i))throw new TypeError("InvalidBeatCountException cannot be created without beatCount, received: "+i);super(),this.name="InvalidBeatCountException",this.string=e,this.duration=n,this.currentBeatCount=r,this.beatCount=i}}class pW extends Error{constructor({string:e}={}){if(!e||!Eo(e))throw new TypeError("InvalidChordRepetitionException cannot be created without chord string, received: "+e);super(),this.name="InvalidChordRepetitionException",this.string=e}}class As extends Error{constructor({chordLine:e,symbol:n,position:r}={}){if(!e||!Eo(e))throw new TypeError("InvalidSubBeatGroupException cannot be created without a chordLine, received: "+e);if(!n||!Eo(n))throw new TypeError("InvalidSubBeatGroupException cannot be created without symbol, received: "+n);if(!oo(r))throw new TypeError("InvalidSubBeatGroupException cannot be created without symbol position, received: "+r);super(),this.name="InvalidSubBeatGroupException",this.chordLine=e,this.symbol=n,this.position=r}}class hW extends Error{constructor({string:e}={}){if(!e||!Eo(e))throw new TypeError("InvalidBarRepeatException cannot be created without chord string, received: "+e);super(),this.name="InvalidBarRepeatException",this.string=e}}const mW=new RegExp(Nr(ce.chordBeatCount),"g"),gW=new RegExp("^"+Nr(ce.barRepeat)+"+$");function yW(t,{timeSignature:e=ub,originalKey:n={}}={}){let{beatCount:r}=e;const i=[],o={allChords:[]},s={};let l=ie(o),a={},u,c=0,f,d=!1,p=0,h=!1;MW(t);const v=Yn(cb(t)).split(" ");return v.forEach((C,O)=>{C.match(gW)?S(C):rl(C)?m(C):(y(C),xW(c,r)?x():OW(a,c,r,v.length===O+1))}),NW(i,s),{allBars:i,originalKey:n};function S(C){if(c===0&&f&&Rs(e,f.timeSignature)){const O=ie(f);O.isRepeated=!0;for(let k=0;k4)throw new As({chordLine:t,symbol:C,position:0})}function x(){l.timeSignature=e,l.lineHadTimeSignatureChange=h,l.hasUnevenChordsDurations=_W(l);const C=ie(l);l.isRepeated=Rs(l,f),i.push(ie(l)),f=C,l=ie(o),c=0}}function vW(t,e){if(SW(e))throw new As({chordLine:t,symbol:e,position:0})}function SW(t){return t.indexOf(ce.chordBeatCount)>-1}function wW(t){return t===ce.noChord}function EW(t,e,n){return n?0:(t.match(mW)||[]).length||e}function CW(t,e){if(t.allChords.length>0){const n=t.allChords[t.allChords.length-1];if(Rs(n.model,e.model)&&!bW(n,e))throw new pW({string:e.string})}}function bW(t,e){return e.string.startsWith(ce.subBeatOpener)||t.string.endsWith(ce.subBeatCloser)&&!e.model.isInSubBeatGroup}function xW(t,e){return t===e}function OW(t,e,n,r){if(TW(e,n,r))throw new dW({string:t.string,duration:t.duration,currentBeatCount:e,beatCount:n})}function TW(t,e,n){return kW(t,e)||AW(t,e,n)}function kW(t,e){return t>e}function AW(t,e,n){return n&&tn.duration!==e)}function NW(t,e){let n=-1,r=0,i="";t.forEach((o,s)=>{o.allChords.forEach(l=>{if(l.isInSubBeatGroup){const a=s+l.beat;a!==i&&(n++,r=0);const u=(1/e[n]).toPrecision(2);l.duration=Number.parseFloat(u),l.isFirstOfSubBeat=r===0,l.isLastOfSubBeat=r===e[n]-1,i=a,r++}})})}function MW(t){const e={};let n=!1,r;const i=new RegExp(Nr(ce.subBeatOpener)+"|"+Nr(ce.subBeatCloser),"g");for(;r=i.exec(t);){const o=r[0];if(e.chordLine=t,e.symbol=o,e.position=i.lastIndex-1,r[0]===ce.subBeatOpener){if(n)throw new As(e);n=!0}else{if(!n)throw new As(e);n=!1}}if(n)throw new As(e)}const sr="A,A#,B,C,C#,D,D#,E,F,F#,G,G#".split(","),IW="Ab,Bb,Db,Eb,Gb".split(","),c1=[...sr,...IW],PW=[...c1,...c1.map(t=>t+"m")],du={Ab:"G#",Bb:"A#",Db:"C#",Eb:"D#",Gb:"F#"},$W=AC(du);function DW(t){return PW.includes(t)}function vm(t){return["G","Em","D","Bm","A","F#m","E","C#m","B","G#m","F#","D#m","C#","A#m","G#","D#","A#"].includes(t)?"sharp":"flat"}function f1(t,e,n){const r={"G#":"Ab","D#":"Eb","A#":"Bb",Dbm:"C#m",Gbm:"F#m"};let i;if(e===0&&n==="auto")i=t.string;else{const s=n==="auto"?e<0?"flat":"sharp":n;i=RW(t.string,e,s)}const o=n==="auto"&&r[i]?r[i]:i;return{string:o,accidental:vm(o)}}function RW(t,e,n){const r=t.endsWith("m"),i=t.replace("m",""),o=du[i]||i;let l=sr.indexOf(o)+e;l<0?l+=sr.length:l>=sr.length&&(l-=sr.length);const a=sr[l],u=n==="flat"&&$W[a]||a;return r?u+"m":u}function LW(t){const e=FW(t);return e?{string:e,accidental:vm(e)}:void 0}function FW(t){const e=BW(t);if(e.length===0)return;if(e.length===1)return e[0].keyString;const n=e.find(i=>i.isLast===!0);if(n)return n.keyString;const r=e.find(i=>i.isFirst===!0);return r?r.keyString:e[0].keyString}function BW(t){let e=0,n=[];const r=[];return ie(t).map(i=>(i.keyString=zW(i),i)).forEach(i=>{const o=zC(r,s=>s.keyString===i.keyString);o===-1?r.push(i):(r[o].duration+=i.duration,i.isLast&&(r[o].isLast=!0))}),r.map(i=>(i.isLast&&(i.duration*=1.25),i.isFirst&&(i.duration*=1.25),i)).forEach(i=>{i.duration>e?(n=[i],e=i.duration):i.duration===e&&n.push(i)}),n}function zW(t){const e=ie(t.model),n=["major","major6","major7","dominant7","augmented","power","bass"];let r=e.formatted.rootNote;return n.includes(e.normalized.quality)||(r+="m"),r}function jW(t,e){return!t||!e?0:UW(t.replace("m",""),e.replace("m",""))}function UW(t,e){const n=du[t]||t,r=du[e]||e,i=sr.indexOf(n),o=sr.indexOf(r);if(i===-1||o===-1)return 0;const s=o-i;return s<0?s+12:s}const pb=new RegExp("^"+Nr(ce.keyDeclarationPrefix)+"([ABCDEFG].*)$");function pp(t){const e=Yn(t).match(pb);return e===null?!1:DW(e[1])}function VW(t){if(!pp(t))throw new TypeError("Expected key declaration, received: "+t);const n=Yn(t).match(pb)[1];return{string:n,accidental:vm(n)}}function WW(t){const e=t.startsWith(ce.lyricLine)?t.substring(1):t,n=new RegExp(ce.chordPositionMarker,"g"),r=e.replace(n,""),i=[];let o=e,s;for(;(s=o.indexOf(ce.chordPositionMarker))!==-1;)i.includes(s)||i.push(s),o=o.replace(ce.chordPositionMarker,"");return{lyrics:r,chordPositions:i}}function HW(t){if(!fu(t))throw new TypeError("Expected section identifier string, received: "+t);const e=Yn(t).match(db);return{string:t,label:e[1],copyIndex:e[2]?Number.parseInt(e[2]):1,multiplyTimes:e[3]?Number.parseInt(e[3].replace(" x","")):0}}function GW(t,e){const n=ie(t);return n.forEach(r=>{r.type===V.CHORD&&r.model.allBars.forEach(i=>{i.allChords.forEach(o=>{e(o)})})}),n}function d1(t,e){const n=ie(t);return n.allBars.forEach((r,i)=>{r.allChords.forEach((o,s)=>{e(o,s,i)})}),n}function Mf(t,e,n){const r=[],i={};let o=!1,s="";for(t.forEach(l=>{l.type===V.SECTION_LABEL?(s=l.model.label,i[s]?i[s]++:i[s]=1,o=l.id===e+n):o&&r.push(l)});io(r)&&(io(r).type===V.KEY_DECLARATION||io(r).type===V.TIME_SIGNATURE);)r.pop();return r}const KW="4/4";function qW(){const t=[],e={};let n=cu(KW),r,i,o={};const s=2;let l=[],a,u=[],c=0,f=!1,d=!1;function p(T){return n=cu(T),{string:T,type:V.TIME_SIGNATURE,model:n}}function h(T){return o=VW(T),{string:T,type:V.KEY_DECLARATION,model:ie(o)}}function v(T,B,G){r=HW(T),x(r.label),i=C(r.label);const q={string:T,type:V.SECTION_LABEL,model:r,index:i.count,indexWithoutMultiply:i.withoutMultiply,id:r.label+i.count};return d=M(B,G)&&i.count>1,d&&(q.isFromSectionCopy=!0),f=r.multiplyTimes>0,a=ie(q),u=i.count>1?Mf(t,r.label,1):[],c=0,q}function S(T){return{string:T,type:V.EMPTY_LINE}}function m(T){let B;try{const G=yW(T,{timeSignature:n,originalKey:o});B={string:T,type:V.CHORD,model:G},y(B)}catch{B=w(T)}return B}function y(T){l.length>=s&&l.shift(),l.push(T)}function g(T){const B=Yn(T),G=-B.length,q=G<-1?G+1:void 0;return l.length>=B.length?{...ie(...l.slice(G,q)),isFromChordLineRepeater:!0}:w(T)}function w(T){return{string:T,type:V.LYRIC,model:WW(T)}}function x(T,B=!1){e[T]?(e[T].count++,B||e[T].withoutMultiply++):e[T]={count:1,withoutMultiply:1}}function C(T){return e[T]}function O(T){if(u.length&&T.type!==V.SECTION_LABEL){let B=u[c],G;for(;k(B,T);)B.type===V.CHORD&&y(ie(B)),G={...ie(B),isFromAutoRepeatChords:!0},t.push(G),c++,B=u[c];c++}}function k(T,B){const G=[V.LYRIC,V.EMPTY_LINE];return T&&!G.includes(T.type)&&T.type!==B.type&&B.type!==V.EMPTY_LINE}function I(){if(d){const T=Mf(t,r.label,r.copyIndex).map(B=>({...ie(B),isFromSectionCopy:!0}));if(!T.length)return;QW(T)&&T.pop(),t.push(...ie(T)),d=!1}}function M(T,B){const G=B.slice(T+1);let q=G.findIndex(De=>fu(De));return q===0?!0:G.slice(0,q!==-1?q:void 0).filter(De=>!(rl(De)||pp(De)||u1(De))).length===0}function J(T,B){if(f&&YW(T,B)){const G=Mf(t,r.label,i.count).map(he=>({...ie(he),isFromSectionMultiply:!0}));let q;for(let he=1;he{T=t[q+1],JW(G,T)?(B=0,G.model.hasPositionedChords=!0,G.model=d1(G.model,he=>{he.isPositioned=B{he.isPositioned=!1}))})}}}function YW(t,e){const n=e[t+1];return typeof n>"u"||fu(n)}function JW(t,e){return t.type===V.CHORD&&e&&e.type===V.LYRIC&&e.model.chordPositions.length>0}function QW(t){return t[t.length-1].type===V.EMPTY_LINE}function XW(t){const e=[];let n;return GW(t,r=>{r.model!==ce.noChord&&(n=zC(e,i=>Rs(lp(i.model,["numeral"]),lp(r.model,["numeral"]))),n===-1?(e.push({model:ie(r.model),occurrences:1,duration:r.duration}),n=e.length-1):(e[n].occurrences++,e[n].duration+=r.duration))}),e.length&&(e[0].isFirst=!0,e[n].isLast=!0),e}function ZW(t,e){const n={auto:void 0,explicit:[]};if(t.forEach(r=>{r.type===V.KEY_DECLARATION&&n.explicit.push(ie(r.model))}),n.explicit.length===0){const r=LW(e);r&&(n.auto=r)}return n}function fY(t){const e=Lp(t)?t:t.split(` -`),n=qW();e.map(q9).map(lb).forEach(n.addLine),n.flagPositionedChords();const r=n.asArray(),i=XW(r),o=ZW(r,i);return{allLines:r,allChords:i,allKeys:o}}const re={barRepeat:"%",barSeparator:"|",chordBeat:".",chordLineOffsetSpacer:" ",emptyBeatSpaces:1,keyDeclarationPrefix:"key: ",lyricsSpacer:" ",noChordSymbol:"NC",spacesAfterDefault:2,spacesAfterSubBeatDefault:1,spacesAfterTimeSignature:1,subBeatGroupOpener:"[",subBeatGroupCloser:"]"};function hb(t,e,{shouldPrintSubBeatDelimiters:n=!0,symbolType:r="chord"}={}){const i=t.allChords.filter(o=>o.beat===e);switch(i.length){case 0:return"";case 1:return hp(t,i[0],{shouldPrintSubBeatDelimiters:n,symbolType:r});default:return i.reduce((o,s,l)=>{const a=l>0?" ".repeat(re.spacesAfterSubBeatDefault):"";return o+a+hp(t,s,{shouldPrintSubBeatDelimiters:n,symbolType:r})},"")}}function hp(t,e,{shouldPrintSubBeatDelimiters:n,symbolType:r="chord"}){const o=r==="chord"||e.model===re.barRepeat||e.model===re.noChordSymbol?e.symbol:e.model.numeral.symbol;if(e.isInSubBeatGroup)return n&&e.isFirstOfSubBeat?re.subBeatGroupOpener+o:n&&e.isLastOfSubBeat?o+re.subBeatGroupCloser:o;{const s=t.shouldPrintChordsDuration?re.chordBeat.repeat(e.duration):"";return o+s}}function e7(t,{shouldAlignChordsWithLyrics:e,shouldPrintSubBeatDelimiters:n=!0,symbolType:r="chord"}){const i=[];return t.filter(o=>o.type===V.CHORD).filter(o=>!e(o)).forEach(o=>{o.model.allBars.filter(s=>!s.lineHadTimeSignatureChange).forEach((s,l)=>{if(!i[l]){i[l]={};for(let a=1;a<=s.timeSignature.beatCount;a++)i[l][a]=0}s.allChords.filter(a=>!a.isInSubBeatGroup||a.isLastOfSubBeat).forEach(a=>{const u=hb(s,a.beat,{shouldPrintSubBeatDelimiters:n,symbolType:r});i[l][a.beat]=Math.max(i[l][a.beat],u.length)})})}),i}function t7(t){const e=ie(t);return e.allBars.forEach(n=>{mb(n)}),e}function mb(t){t.allChords.forEach(e=>{e.spacesAfter=e.isInSubBeatGroup&&!e.isLastOfSubBeat?re.spacesAfterSubBeatDefault:re.spacesAfterDefault,e.spacesWithin=0})}function n7(t,e,{shouldPrintBarSeparators:n=!0,shouldPrintSubBeatDelimiters:r=!0,symbolType:i="chord"}){const o=ie(t);return o.allBars.forEach((s,l)=>{s.lineHadTimeSignatureChange?mb(s):s.allChords.forEach(a=>{const u=hb(s,a.beat,{shouldPrintSubBeatDelimiters:r,symbolType:i});a.isInSubBeatGroup&&!a.isLastOfSubBeat?(a.spacesWithin=0,a.spacesAfter=re.spacesAfterSubBeatDefault):(a.spacesWithin=e[l][a.beat]-u.length,a.spacesAfter=0),r7(s,a)&&(a.spacesAfter=re.spacesAfterDefault+i7(s,a,e[l])),o7(s,a,n)&&(a.spacesAfter=re.spacesAfterDefault)})}),o}const r7=(t,e)=>(!e.isInSubBeatGroup||e.isLastOfSubBeat)&&!gb(t,e),i7=(t,e,n)=>{let r=0;for(let i=e.beat+1;ie.beat===t.timeSignature.beatCount,o7=(t,e,n)=>!n&&gb(t,e)&&(!e.isInSubBeatGroup||e.isLastOfSubBeat),If=1;function s7(t,e,{shouldPrintBarSeparators:n=!0,shouldPrintSubBeatDelimiters:r=!0,shouldPrintInlineTimeSignatures:i=!0,symbolType:o="chord"}={}){if(l7(e))return{chordLine:t,lyricsLine:e};const s=ie(t),l=ie(e),a=l.chordPositions.map((m,y,g)=>l.lyrics.substring(m,g[y+1]));let u="",c="",f,d;if(s.allBars.forEach((m,y)=>{m.allChords.forEach((g,w,x)=>{if(d=a.shift(),d){u=w===0&&i&&m.shouldPrintBarTimeSignature?m.timeSignature.string+re.spacesAfterTimeSignature:"";const C=y===0&&w===0&&l.chordPositions[0]===0;f=p(m,g,C),d=h(C,g.isFirstOfSubBeat);const O=w===x.length-1,k=x[w+1]&&x[w+1].isFirstOfSubBeat;if(d.length-f.length>0){const I=a.length===0;g.spacesAfter=v(O,I,k)}else g.spacesAfter=If,d+=re.lyricsSpacer.repeat(S(O,k));c+=d}else g.spacesAfter=If;g.spacesWithin=0})}),a7(l)){const m=l.chordPositions[0];s.offset=m,n&&s.offset--,c=l.lyrics.substring(0,m)+c}return a.length&&(c+=a.join("")),l.lyrics=u7(c),{chordLine:s,lyricsLine:l};function p(m,y,g){let w=u+hp(m,y,{shouldPrintSubBeatDelimiters:y.isLastOfSubBeat&&r,symbolType:o});return g&&(r&&y.isFirstOfSubBeat&&(w=re.subBeatGroupOpener+w),n&&(w=re.barSeparator+w)),w}function h(m,y){let g=d;if(c7(g))g=re.lyricsSpacer.repeat(f.length-1)+g;else{if(m){let w=0;n&&w++,r&&y&&w++,g=re.lyricsSpacer.repeat(w)+g}u.length&&(g=" ".repeat(u.length)+g)}return g}function v(m,y,g){let w=d.length-f.length;return(m&&n&&!y||!m&&r&&g)&&(w>1?w-=1:d+=re.lyricsSpacer),w}function S(m,y){let g=f.length-d.length+If;return(m&&n||y)&&g++,g}}const l7=t=>t.chordPositions.length===0,a7=t=>t.chordPositions[0]>0,u7=t=>{const e=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/;return t.replace(e,"")},c7=t=>t.indexOf(" ")===0,f7=({chordLineOffset:t,chordLine:e,symbolType:n})=>{const r=["cmChordLine"];return n==="roman"&&r.push("cmChordLine-romanNumeral"),`${t?`${t}`:""}${e}`},d7=({chordSymbol:t,chordDuration:e,subBeatGroupOpener:n,subBeatGroupCloser:r,numeralType:i})=>{const o=n?`${n}`:"",s=r?`${r}`:"",l=["cmChordSymbol"];return i&&l.push("cmRomanNumeral",`cmRomanNumeral-${i}`),`${o}${t}${e?`${e}`:""}${s}`};function p7(t,{shouldPrintChordsDuration:e=!1,shouldPrintSubBeatOpener:n=!1,shouldPrintSubBeatCloser:r=!1,symbolType:i="chord"}){const o=i==="chord"||t.model===re.barRepeat||t.model===re.noChordSymbol,s=o?t.symbol:t.model.numeral.symbol;return d7({chordSymbol:s,chordDuration:e?re.chordBeat.repeat(t.duration):!1,subBeatGroupOpener:n?re.subBeatGroupOpener:"",subBeatGroupCloser:r?re.subBeatGroupCloser:"",numeralType:o?"":t.model.numeral.type})}const h7=({timeSignature:t})=>`${t}`;function yb(t){return h7({timeSignature:t.string})}const m7=({barContent:t})=>`${t}`,p1=" ",g7=0,y7=2;function v7(t,e=!1,{shouldPrintBarSeparators:n=!0,shouldPrintSubBeatDelimiters:r=!0,shouldPrintTimeSignature:i=!1,symbolType:o="chord"}={}){let s=0,l=0,a="";return i&&(a+=yb(t.timeSignature)+" ".repeat(re.spacesAfterTimeSignature)),a+=t.allChords.reduce((u,c,f)=>{s=oo(c.spacesWithin)?c.spacesWithin:g7,l=oo(c.spacesAfter)?c.spacesAfter:y7,u+=p7(c,{shouldPrintChordsDuration:c.isInSubBeatGroup?!1:t.shouldPrintChordsDuration,shouldPrintSubBeatOpener:r&&c.isFirstOfSubBeat,shouldPrintSubBeatCloser:r&&c.isLastOfSubBeat,symbolType:o}),d()&&(u+=p1.repeat(s)+p1.repeat(l));function d(){const p=S7(t,f)&&e;return!p||p&&n}return u},""),m7({barContent:a})}function S7(t,e){return!t.allChords[e+1]}const w7=({barSeparator:t})=>`${t}`;function E7(t,{shouldPrintBarSeparators:e=!0,shouldPrintSubBeatDelimiters:n=!0,shouldPrintInlineTimeSignatures:r=!0,symbolType:i="chord"}={}){const o=t.allBars.map((u,c)=>{const f=!t.allBars[c+1],d=r&&u.shouldPrintBarTimeSignature;return v7(u,f,{shouldPrintBarSeparators:e,shouldPrintSubBeatDelimiters:n,shouldPrintTimeSignature:d,symbolType:i})}),s=e?w7({barSeparator:re.barSeparator}):"",l=s+o.join(s)+s,a=re.chordLineOffsetSpacer.repeat(t.offset||0);return f7({chordLineOffset:a,chordLine:l,symbolType:i})}const C7=({chordLyricsPairs:t})=>{let e='';return t.forEach(n=>{e+=`${n.chords||" "}${n.lyrics}`}),e+="",e};var b7=$u,x7=hm,O7=mm,T7=Si,k7=Po,h1=Du,A7=Math.min;function _7(t,e,n){for(var r=n?O7:x7,i=t[0].length,o=t.length,s=o,l=Array(o),a=1/0,u=[];s--;){var c=t[s];s&&e&&(c=T7(c,k7(e))),a=A7(c.length,a),l[s]=!n&&(e||i>=120&&c.length>=120)?new b7(s&&c):void 0}c=t[0];var f=-1,d=l[0];e:for(;++f{if(r.nodeType===Node.TEXT_NODE){const i=r.textContent;for(const o of i)e.push(_s(o,n.i)),n.i++}else U7.includes(r.classList.value)?(e.push(_s(r.textContent,n.i,r.outerHTML)),n.i+=r.textContent.length):vb(r,e,n)})}function _s(t,e,n){return{text:t,textIndex:e,html:n}}function H7(t){const e=[],n=lb(t);let r="";return Array.from(n).forEach((i,o)=>{i===" "?(r&&(e.push(_s(r,o-r.length)),r=""),e.push(_s(" ",o))):r+=i}),e.push(_s(r,n.length-r.length)),e}function G7(t,e){const n=m1(t),r=m1(e),i=z7(n,r);let o,s;io(n)>io(r)?(s=n,o=r):(s=r,o=n);const l=s.filter(a=>a>io(o));return l.length&&i.push(...l),i.shift(),i}function m1(t){const e=t.map(r=>r.textIndex),n=t.reduce((r,i)=>r+i.text,"").length;return e.push(n),e}function K7(t,e,n){const r=[];return t.forEach(i=>{let o="",s="";for(;e.length&&e[0].textIndex' ';function Y7(){return q7()}const J7=({keyDeclarationPrefix:t,key:e})=>`${t}${e}`;function Q7(t){return J7({keyDeclarationPrefix:re.keyDeclarationPrefix,key:t.symbol})}const X7=({line:t,lineClasses:e,shouldOpenSection:n,sectionWrapperClasses:r,shouldClosePriorSection:i,shouldCloseFinalSection:o})=>{let s="";return i&&(s+=""),n&&(s+=`
`),s+=`

${t}

`,o&&(s+="
"),s};function Z7(t,{isFromAutoRepeatChords:e=!1,isFromChordLineRepeater:n=!1,isFromSectionCopy:r=!1,isFromSectionMultiply:i=!1,shouldOpenSection:o=!1,shouldClosePriorSection:s=!1,shouldCloseFinalSection:l=!1,sectionWrapperClasses:a=[]}={}){const u=["cmLine"];return e&&u.push("cmLine--isFromAutoRepeatChords"),n&&u.push("cmLine--isFromChordLineRepeater"),r&&u.push("cmLine--isFromSectionCopy"),i&&u.push("cmLine--isFromSectionMultiply"),X7({line:t,lineClasses:u.join(" "),shouldOpenSection:o,sectionWrapperClasses:a.join(" "),shouldClosePriorSection:s,shouldCloseFinalSection:l})}const eH=({lyricLine:t})=>`${t}`;function tH(t,{alignChordsWithLyrics:e=!1,chartType:n="all"}={}){const r=nH(e,n)?t.model.lyrics.trim():t.model.lyrics;return eH({lyricLine:r})}const nH=(t,e)=>!t||e==="lyrics",rH=({label:t,multiplier:e})=>`${t}${e?` ${e}`:""}`;function iH(t){return rH(t.model.rendered)}const oH=({song:t})=>`
${t}
`,g1={a:"adlib",b:"bridge",c:"chorus",i:"intro",o:"outro",p:"pre-chorus",s:"solo",u:"interlude",v:"verse"};function sH(t,{expandSectionMultiply:e}){const n=lH(t);return t.forEach(r=>{if(r.type===V.SECTION_LABEL){const{model:i,index:o,indexWithoutMultiply:s}=r,l=g1[i.label]?g1[i.label]:i.label;let a=l[0].toUpperCase()+l.substring(1),u;n[i.label]>1&&(a+=" ",a+=e?o:s),!e&&i.multiplyTimes&&(u="x"+i.multiplyTimes),r.model.rendered={label:a,multiplier:u}}}),t}function lH(t){const e={};return t.filter(n=>n.type===V.SECTION_LABEL).forEach(n=>{e[n.model.label]?e[n.model.label]++:e[n.model.label]=1}),e}const aH=QC();function uH(t,e=aH){switch(t){case ce.noChord:return re.noChordSymbol;case re.barRepeat:return re.barRepeat;default:return e(t)}}function cH(t,e,{transposeValue:n,accidentalsType:r,chordSymbolRenderer:i,simplifyChords:o,useShortNamings:s}){let l,a;e&&(l=f1(e,n,r));let u=d();function c(p){if(p.type===V.KEY_DECLARATION)l=f1(p.model,n,r),p.symbol=l.string,a||(a=l);else if(p.type===V.CHORD){let h=0;f(p)&&(h=jW(a&&a.string,l&&l.string)),u=d(h),p.model.allBars.forEach(v=>{v.allChords.forEach(S=>{S.symbol=uH(S.model,u)})})}return p}function f(p){const h=l&&p.model.originalKey&&p.model.originalKey.string===l.string;return(p.isFromAutoRepeatChords||p.isFromSectionCopy||p.isFromChordLineRepeater)&&!h}function d(p){if(typeof i=="function")return i;const h=r==="auto"?l?l.accidental:"sharp":r;return QC({simplify:o,useShortNamings:s,transposeValue:n+p,accidental:h})}return t.map(c)}const fH=(t,{alignChordsWithLyrics:e})=>(t.type===V.CHORD&&t.model.allBars.forEach(n=>{dH(t,n,e)&&(n.allChords=[{string:re.barRepeat,model:re.barRepeat,symbol:re.barRepeat,duration:n.timeSignature.beatCount,beat:1}],n.shouldPrintChordsDuration=!1)}),t),dH=(t,e,n)=>e.isRepeated&&!pH(t,e,n),pH=(t,e,n)=>n&&t.model.hasPositionedChords&&e.allChords.length>1&&e.allChords.some(r=>r.isPositioned);function dY(t,{accidentalsType:e="auto",alignBars:n=!0,alignChordsWithLyrics:r=!0,autoRepeatChords:i=!0,chartType:o="all",chordSymbolRenderer:s=!1,customRenderer:l=!1,expandSectionCopy:a=!0,expandSectionMultiply:u=!1,printChordsDuration:c="uneven",printBarSeparators:f="always",printSubBeatDelimiters:d=!0,printInlineTimeSignatures:p=!0,simplifyChords:h="none",symbolType:v="chord",transposeValue:S=0,useShortNamings:m=!0,wrapChordLyricLines:y=!1}={}){let{allLines:g,allKeys:w}=t,x=!1,C=ub.string,O;g=cH(g,w.auto,{transposeValue:S,accidentalsType:e,chordSymbolRenderer:s,simplifyChords:h,useShortNamings:m}).map(J).map(T).filter(G).map(P=>fH(P,{alignChordsWithLyrics:r}));const k=e7(g,{shouldAlignChordsWithLyrics:W,shouldPrintSubBeatDelimiters:d,symbolType:v});g=sH(g,{expandSectionMultiply:u}),g.forEach(D);const I=F();if(l)return l(g,I,{alignChordsWithLyrics:r,alignBars:n});return oH({song:I.join("")});function M(P){return["cmSection","cmSection-"+P.model.rendered.label.replace(/[\d\s]/gi,"")]}function J(P){return P.type===V.CHORD&&P.model.allBars.forEach(Q=>{Q.shouldPrintChordsDuration=B(Q)}),P}function T(P){return P.type===V.TIME_SIGNATURE?C=P.string:P.type===V.CHORD&&P.model.allBars.forEach((Q,X)=>{Q.shouldPrintBarTimeSignature=X===0&&Q.timeSignature.string!==C||X>0&&Q.timeSignature.string!==O,O=Q.timeSignature.string}),P}function B(P){return P.allChords.length>1&&(c==="uneven"&&P.hasUnevenChordsDurations||c==="always")}function G(P){return q(P)&&!De(P)}function q(P){const Q=!i&&(P.isFromAutoRepeatChords||P.type===V.CHORD&&P.isFromSectionCopy),X=P.isFromSectionMultiply&&!u,_e=P.type!==V.SECTION_LABEL&&P.isFromSectionCopy&&!a;return!X&&!Q&&!_e}function he(P){return g.length-1===P}function De(P){if(o==="chordsFirstLyricLine"){if(P.type===V.SECTION_LABEL)return x=!0,!1;if(x&&P.type===V.LYRIC)return x=!1,!1}return["chords","chordsFirstLyricLine"].includes(o)&&P.type===V.LYRIC||o==="lyrics"&&P.type===V.CHORD}function D(P,Q){if(P.type===V.CHORD){let X=n&&!W(P)?n7(P.model,k,{shouldPrintBarSeparators:ue(P.model),shouldPrintSubBeatDelimiters:d,symbolType:v}):t7(P.model);const _e=g[Q+1];if(W(P)){const{chordLine:ge,lyricsLine:An}=s7(X,_e.model,{shouldPrintBarSeparators:ue(P.model),shouldPrintSubBeatDelimiters:d,shouldPrintInlineTimeSignatures:p,symbolType:v});g[Q+1].model=An,X=ge}g[Q].model=X}}function F(){let P=!1,Q;return g.map((X,_e)=>{let ge,An=!1,pn=[],_t;return X.type===V.CHORD?(ge=E7(X.model,{symbolType:v,shouldPrintBarSeparators:ue(X.model),shouldPrintSubBeatDelimiters:d,shouldPrintInlineTimeSignatures:p}),K(X,g[_e+1])&&(Q=ge,ge=!1)):X.type===V.EMPTY_LINE?ge=Y7():X.type===V.SECTION_LABEL?(An=!0,_t=P,P=!0,pn=M(X),ge=iH(X)):X.type===V.TIME_SIGNATURE?ge=yb(X):X.type===V.KEY_DECLARATION?ge=Q7(X):(ge=tH(X,{alignChordsWithLyrics:r,chartType:o}),Q&&(ge=V7(Q,ge),Q="")),ge&&Z7(ge,{isFromSectionMultiply:X.isFromSectionMultiply,isFromAutoRepeatChords:X.isFromAutoRepeatChords,isFromChordLineRepeater:X.isFromChordLineRepeater,isFromSectionCopy:X.isFromSectionCopy,shouldOpenSection:An,shouldClosePriorSection:_t,shouldCloseFinalSection:he(_e)&&P,sectionWrapperClasses:pn})}).filter(Boolean)}function W(P){return o==="all"&&r&&P.model.hasPositionedChords}function K(P,Q){return Q&&Q.type===V.LYRIC&&y&&W(P)}function ue(P){return f==="always"||f==="grids"&&!P.hasPositionedChords}}const pY=(t={})=>hH.bind(null,t),hH=({showBarSeparators:t=!0},e,n,{alignBars:r,alignChordsWithLyrics:i})=>{const o=[];let s;return mH(e).forEach((l,a)=>{l.sectionLine&&(l.allLines.length>0?(a>0&&o.push(""),o.push(gH(l.sectionLine))):o.push(Eb(wb(l.sectionLine.model.rendered)))),l.allLines.forEach((u,c,f)=>{switch(u.type){case V.CHORD:vH(f,c)?s=u:o.push(SH(u));break;case V.LYRIC:o.push(wH(u,s,{showBarSeparators:t,alignChordsWithLyrics:i,alignBars:r})),s=void 0;break;case V.EMPTY_LINE:o.push(""),s=void 0;break}}),l.sectionLine&&l.allLines.length>0&&o.push(yH(l.sectionLine))}),o.join(` -`)},mH=t=>{const e=[];let n;const r=()=>{n&&(e.push(n),n=void 0)},i=o=>{n={sectionLine:o,allLines:[]}};return t.forEach(o=>{o.type===V.SECTION_LABEL?(r(),i(o)):(n||i(),n.allLines.push(o))}),r(),e.map(o=>(o.allLines=nb(o.allLines,s=>s.type===V.EMPTY_LINE),o))};function gH(t){return`{start_of_${Sb(t.model.label)}: ${wb(t.model.rendered)}}`}function yH(t){return`{end_of_${Sb(t.model.label)}}`}function Sb(t){switch(t){case"b":case"bridge":return"bridge";case"c":case"chorus":return"chorus";default:case"v":case"verse":return"verse"}}function wb({label:t,multiplier:e}){return e?`${t} ${e}`:t}function Eb(t){return`{c:${t}}`}function vH(t,e){const n=t[e+1];return n&&n.type===V.LYRIC}function SH(t){let e="";return t.model.allBars.map(n=>{e+="|",n.allChords.map(r=>{e+=r.symbol+" ".repeat(r.spacesWithin+r.spacesAfter)})}),e+="|",Eb(e.trim())}function wH(t,e,{alignChordsWithLyrics:n,alignBars:r,showBarSeparators:i}){let o=t.string.trim();return e&&e.type===V.CHORD&&(e.model.hasPositionedChords&&n?o=EH(o,e,{showBarSeparators:i}):o=CH(o,e,{showBarSeparators:i,alignBars:r})),o}const EH=(t,e,{showBarSeparators:n})=>{let r=t;return e.model.allBars.map(i=>{i.allChords.map((o,s)=>{let[l]=Cb(i,o);if(s===0&&n){const a=r.indexOf("_");a>-1?r=ni(r,"[|] ",a):r=ni(r,"[|]",r.length+1)}r.indexOf("_")>-1?r=r.replace("_",l):r=ni(r,l,r.length+1)})}),r=r.replace(/_/g,"").trim(),n&&(r+=" [|]"),r},CH=(t,e,{showBarSeparators:n,alignBars:r})=>{let i=t.replace(/_/g,""),o=0;return e.model.allBars.map(s=>{s.allChords.map((l,a)=>{let[u,c]=Cb(s,l);a===0&&n&&(i=ni(i,"[|]",o),o+=5),i=ni(i,u,o);const f=r&&!s.allChords[a+1]?1:0;o+=u.length+c.length+l.spacesAfter+l.spacesWithin+f})}),n&&(i=ni(i,"[|]",o)),i},Cb=(t,e)=>{const n=t.shouldPrintChordsDuration?e.symbol+".".repeat(e.duration):e.symbol;return[`[${n}]`,n]},hY=()=>bH.bind(null),bH=(t,e)=>e.map((n,r)=>{const i=t[r],o=TC(n);return i.type===V.SECTION_LABEL?`[${o}]`:i.type===V.CHORD?xH(i,o):o.replace(" ","")}).join(` -`),xH=(t,e)=>{const n=/([^\s.|]+)/g;return e.replace(n,"[ch]$1[/ch]")};/** - * filesize - * - * @copyright 2023 Jason Mulligan - * @license BSD-3-Clause - * @version 10.1.0 - */const OH="array",TH="bit",y1="bits",kH="byte",v1="bytes",Mi="",AH="exponent",_H="function",S1="iec",NH="Invalid number",MH="Invalid rounding method",Pf="jedec",IH="object",w1=".",PH="round",$H="s",DH="si",RH="kbit",LH="kB",FH=" ",BH="string",zH="0",$f={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function mY(t,{bits:e=!1,pad:n=!1,base:r=-1,round:i=2,locale:o=Mi,localeOptions:s={},separator:l=Mi,spacer:a=FH,symbols:u={},standard:c=Mi,output:f=BH,fullform:d=!1,fullforms:p=[],exponent:h=-1,roundingMethod:v=PH,precision:S=0}={}){let m=h,y=Number(t),g=[],w=0,x=Mi;c===DH?(r=10,c=Pf):c===S1||c===Pf?r=2:r===2?c=S1:(r=10,c=Pf);const C=r===10?1e3:1024,O=d===!0,k=y<0,I=Math[v];if(typeof t!="bigint"&&isNaN(t))throw new TypeError(NH);if(typeof I!==_H)throw new TypeError(MH);if(k&&(y=-y),(m===-1||isNaN(m))&&(m=Math.floor(Math.log(y)/Math.log(C)),m<0&&(m=0)),m>8&&(S>0&&(S+=8-m),m=8),f===AH)return m;if(y===0)g[0]=0,x=g[1]=$f.symbol[c][e?y1:v1][m];else{w=y/(r===2?Math.pow(2,m*10):Math.pow(1e3,m)),e&&(w=w*8,w>=C&&m<8&&(w=w/C,m++));const M=Math.pow(10,m>0?i:0);g[0]=I(w*M)/M,g[0]===C&&m<8&&h===-1&&(g[0]=1,m++),x=g[1]=r===10&&m===1?e?RH:LH:$f.symbol[c][e?y1:v1][m]}if(k&&(g[0]=-g[0]),S>0&&(g[0]=g[0].toPrecision(S)),g[1]=u[g[1]]||g[1],o===!0?g[0]=g[0].toLocaleString():o.length>0?g[0]=g[0].toLocaleString(o,s):l.length>0&&(g[0]=g[0].toString().replace(w1,l)),n&&Number.isInteger(g[0])===!1&&i>0){const M=l||w1,J=g[0].toString().split(M),T=J[1]||Mi,B=T.length,G=i-B;g[0]=`${J[0]}${M}${T.padEnd(B+G,zH)}`}return O&&(g[1]=p[m]?p[m]:$f.fullform[c][m]+(e?TH:kH)+(g[0]===1?Mi:$H)),f===OH?g:f===IH?{value:g[0],symbol:g[1],exponent:m,unit:x}:g.join(a)}var bb={exports:{}};(function(t,e){(function(n,r){r()})(Sn,function(){function n(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,f){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){a(d.response,c,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function o(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Sn=="object"&&Sn.global===Sn?Sn:void 0,l=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(u,c,f){var d=s.URL||s.webkitURL,p=document.createElement("a");c=c||u.name||"download",p.download=c,p.rel="noopener",typeof u=="string"?(p.href=u,p.origin===location.origin?o(p):i(p.href)?r(u,c,f):o(p,p.target="_blank")):(p.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(p.href)},4e4),setTimeout(function(){o(p)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,f){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(n(u,f),c);else if(i(u))r(u,c,f);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){o(d)})}}:function(u,c,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,f);var p=u.type==="application/octet-stream",h=/constructor/i.test(s.HTMLElement)||s.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||p&&h||l)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var g=S.result;g=v?g:g.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=g:location=g,d=null},S.readAsDataURL(u)}else{var m=s.URL||s.webkitURL,y=m.createObjectURL(u);d?d.location=y:location.href=y,d=null,setTimeout(function(){m.revokeObjectURL(y)},4e4)}});s.saveAs=a.saveAs=a,t.exports=a})})(bb);var gY=bb.exports;const yY=()=>t=>(t.formatted.symbol=t.formatted.symbol.replace(/[() ]/g,"").replace("mM","mMaj").replace("°","dim"),t);/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */var mp=function(){return mp=Object.assign||function(e){for(var n,r=1,i=arguments.length;r0||t.deltaX<0?"X":t.deltaY>0||t.deltaY<0?"Y":(t.deltaY>0||t.deltaY<0)&&(t.deltaX>0||t.deltaX<0)?"XY":null},VH=H.forwardRef(function(t,e){var n=t.children,r=t.group,i=r===void 0?"default":r,o=t.scroll,s=o===void 0?"two-way":o,l=t.selfLockAxis,a=l===void 0?null:l,u=t.onScroll,c=u===void 0?function(){}:u,f=H.useContext(xb),d=f.registerNode,p=f.unregisterNode,h=f.onScroll,v=n.ref,S=v!=null&&e!=null;S&&console.warn(`scroll-sync-react: -WARNING: ref used on both ScrollSyncNode and its direct child. -Using the ref from the ScrollSyncNode component.`);var m=v&&!e?v:H.useRef(null);H.useEffect(function(){typeof e=="function"&&e(m.current)},[]);var y=function(x){var C=UH(x);(a==="X"&&C==="X"||a==="Y"&&C==="Y"||a==="XY"&&(C==="XY"||C==="X"||C==="Y"))&&x.preventDefault()};H.useEffect(function(){var x,C={node:m.current,scroll:s};return C&&d(C,Br(i)),(x=m.current)===null||x===void 0||x.addEventListener("wheel",y,{passive:!1}),function(){var O;p(C,Br(i)),(O=m.current)===null||O===void 0||O.removeEventListener("wheel",y)}},[]),H.useEffect(function(){var x={node:m.current,scroll:s};return p(x,Br(i)),d(x,Br(i)),function(){return p(x,Br(i))}},[s,i]);var g=s==="syncer-only",w=s==="two-way";return Ra.cloneElement(n,{ref:m,onScroll:function(x){typeof n.props.onScroll=="function"&&n.props.onScroll(x),x.persist(),(g||w)&&(h(x,Br(i)),c(x))},onWheel:function(x){typeof n.props.onWheel=="function"&&n.props.onWheel(x),x.persist(),(g||w)&&(h(x,Br(i)),c(x))}})});VH.displayName="ScrollSyncNode";function Ke(t){this.content=t}Ke.prototype={constructor:Ke,find:function(t){for(var e=0;e>1}};Ke.from=function(t){if(t instanceof Ke)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ke(e)};function Ob(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=Ob(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Tb(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){n-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let u=0,c=Math.min(s.text.length,l.text.length);for(;ue&&r(a,i+l,o||null,s)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,n-c),r,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=a}return new $(r,i)}cutByIndex(e,n){return e==n?$.empty:e==0&&n==this.content.length?this:new $(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new $(i,o)}addToStart(e){return new $([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new $(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?oa(r+1,s):oa(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return $.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new $(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return $.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}}se.none=[];class hu extends Error{}class z{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Ab(this.content,e+this.openStart,n);return r&&new z(r,this.openStart,this.openEnd)}removeBetween(e,n){return new z(kb(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return z.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new z($.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new z(e,r,i)}}z.empty=new z($.empty,0,0);function kb(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(kb(o.content,e-i-1,n-i-1)))}function Ab(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=Ab(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function WH(t,e,n){if(n.openStart>t.depth)throw new hu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new hu("Inconsistent open depths");return _b(t,e,n,0)}function _b(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ns(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(ri(t.nodeAfter,r),o++));for(let l=o;li&&gp(t,e,i+1),s=r.depth>i&&gp(n,r,i+1),l=[];return Ns(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(Nb(o,s),ri(ii(o,Mb(t,e,n,r,i+1)),l)):(o&&ri(ii(o,mu(t,e,i+1)),l),Ns(e,n,i,l),s&&ri(ii(s,mu(n,r,i+1)),l)),Ns(r,null,i,l),new $(l)}function mu(t,e,n){let r=[];if(Ns(null,t,n,r),t.depth>n){let i=gp(t,e,n+1);ri(ii(i,mu(t,e,n+1)),r)}return Ns(e,null,n,r),new $(r)}function HH(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy($.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class il{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new KH(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),u=o-a;if(r.push(s,l,i+a),!u||(s=s.child(l),s.isText))break;o=u-1,i+=a+1}return new il(n,r,o)}static resolveCached(e,n){for(let i=0;ie&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ib(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=$.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=$.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};oi.prototype.text=void 0;class gu extends oi{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ib(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new gu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gu(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ib(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class pi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new YH(e,n);if(r.next==null)return pi.empty;let i=Pb(r);r.next&&r.err("Unexpected trailing text");let o=nG(tG(i));return rG(o,r),o}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` -`)}}pi.empty=new pi(!0);class YH{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Pb(t){let e=[];do e.push(JH(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function JH(t){let e=[];do e.push(QH(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function QH(t){let e=eG(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=XH(t,e);else break;return e}function E1(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function XH(t,e){let n=E1(t),r=n;return t.eat(",")&&(t.next!="}"?r=E1(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function ZH(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function eG(t){if(t.eat("(")){let e=Pb(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=ZH(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function tG(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let u={term:a,to:l};return e[s].push(u),u}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,u)=>a.concat(o(u,l)),[]);if(s.type=="seq")for(let a=0;;a++){let u=o(s.exprs[a],l);if(a==s.exprs.length-1)return u;i(u,l=n())}else if(s.type=="star"){let a=n();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let u=0;u{t[s].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||i.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new pi(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new Fb(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class iG{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class bc{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Lb(i.attrs),this.excluded=null;let o=Db(this.attrs);this.instance=o?new se(this,o):null}create(e=null){return!e&&this.instance?this.instance:new se(this,Rb(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new bc(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class vY{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Ke.from(e.nodes),n.marks=Ke.from(e.marks||{}),this.nodes=b1.compile(this.spec.nodes,this),this.marks=bc.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;o.contentMatch=r[s]||(r[s]=pi.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=l=="_"?null:l?x1(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:x1(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof b1){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new gu(r,r.defaultAttrs,e,se.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return oi.fromJSON(this,e)}markFromJSON(e){return se.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function x1(t,e){let n=[];for(let r=0;r-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class ol{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new T1(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new T1(this,n,!0);return r.addAll(e,n.from,n.to),z.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=k1(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=k1(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ol(e,ol.schemaRules(e)))}}const Bb={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},oG={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zb={ol:!0,ul:!0},yu=1,vu=2,Ms=4;function O1(t,e,n){return e!=null?(e?yu:0)|(e==="full"?vu:0):t&&t.whitespace=="pre"?yu|vu:n&~Ms}class sa{constructor(e,n,r,i,o,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=se.none,this.stashMarks=[],this.match=s||(l&Ms?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore($.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&yu)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=$.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore($.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=se.none,r=se.none;for(let i=0;i{s.clearMark(l)&&(r=l.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=cG(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function sG(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&zb.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function lG(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function aG(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function k1(t){let e={};for(let n in t)e[n]=t[n];return e}function uG(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&jn.renderSpec(Ff(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),a=n[1],u=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){u=2;for(let c in a)if(a[c]!=null){let f=c.indexOf(" ");f>0?l.setAttributeNS(c.slice(0,f),c.slice(f+1),a[c]):l.setAttribute(c,a[c])}}for(let c=u;cu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:d,contentDOM:p}=jn.renderSpec(e,f,r);if(l.appendChild(d),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new jn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=A1(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return A1(e.marks)}}function A1(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ff(t){return t.document||window.document}const jb=65535,Ub=Math.pow(2,16);function fG(t,e){return t+e*Ub}function _1(t){return t&jb}function dG(t){return(t-(t&jb))/Ub}const Vb=1,Wb=2,xa=4,Hb=8;class vp{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Hb)>0}get deletedBefore(){return(this.delInfo&(Vb|xa))>0}get deletedAfter(){return(this.delInfo&(Wb|xa))>0}get deletedAcross(){return(this.delInfo&xa)>0}}class It{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&It.empty)return It.empty}recover(e){let n=0,r=_1(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[l+o],c=this.ranges[l+s],f=a+u;if(e<=f){let d=u?e==a?-1:e==f?1:n:n,p=a+i+(d<0?0:c);if(r)return p;let h=e==(n<0?a:f)?null:fG(l/3,e-a),v=e==a?Wb:e==f?Vb:xa;return(n<0?e!=a:e!=f)&&(v|=Hb),new vp(p,v,h)}i+=c-u}return r?e+i:new vp(e+i,0,null)}touches(e,n){let r=0,i=_1(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let u=this.ranges[l+o],c=a+u;if(e<=c&&l==i*3)return!0;r+=this.ranges[l+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new so;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ie.fromReplace(e,this.from,this.to,o)}invert(){return new Cn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new fr(n.pos,r.pos,this.mark)}merge(e){return e instanceof fr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new fr(n.from,n.to,e.markFromJSON(n.mark))}}at.jsonID("addMark",fr);class Cn extends at{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new z(Sm(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ie.fromReplace(e,this.from,this.to,r)}invert(){return new fr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Cn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Cn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Cn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Cn(n.from,n.to,e.markFromJSON(n.mark))}}at.jsonID("removeMark",Cn);class dr extends at{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ie.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ie.fromReplace(e,this.pos,this.pos+1,new z($.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Dt(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Dt(n.from,n.to,n.gapFrom,n.gapTo,z.fromJSON(e,n.slice),n.insert,!!n.structure)}}at.jsonID("replaceAround",Dt);function Sp(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function pG(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(a,u,c)=>{if(!a.isInline)return;let f=a.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,e),p=Math.min(u+a.nodeSize,n),h=r.addToSet(f);for(let v=0;vt.step(a)),o.forEach(a=>t.step(a))}function hG(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof bc){let u=s.marks,c;for(;c=r.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let u=Math.min(l+s.nodeSize,n);for(let c=0;ct.step(new Cn(s.from,s.to,s.style)))}function mG(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)t.step(o[l])}function gG(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function wm(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;h--)v||r.index(h)>0?(v=!0,c=$.from(r.node(h).copy(c)),f++):a--;let d=$.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=$.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Dt(i,o,i,o,new z(r,0,0),n.length,!0))}function SG(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&wG(t.doc,t.mapping.slice(o).map(l),r)){t.clearIncompatible(t.mapping.slice(o).map(l,1),r);let a=t.mapping.slice(o),u=a.map(l,1),c=a.map(l+s.nodeSize,1);return t.step(new Dt(u,c,u+1,c-1,new z($.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function wG(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function EG(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Dt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new z($.from(s),0,0),1,!0))}function Oa(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let v=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function CG(t,e,n=1,r){let i=t.doc.resolve(e),o=$.empty,s=$.empty;for(let l=i.depth,a=i.depth-n,u=n-1;l>a;l--,u--){o=$.from(i.node(l).copy(o));let c=r&&r[u];s=$.from(c?c.type.create(c.attrs,s):i.node(l).copy(s))}t.step(new it(e,e,new z(o.append(s),n,n),!0))}function Gb(t,e){let n=t.resolve(e),r=n.index();return bG(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function bG(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function xG(t,e,n){let r=new it(e-n,e+n,z.empty,!0);t.step(r)}function OG(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),u=r.node(s),c=!1;if(o==1)c=u.canReplace(a,a,i);else{let f=u.contentMatchAt(a).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(a,a,f[0])}if(c)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Em(t,e,n=e,r=z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Kb(i,o,r)?new it(e,n,r):new kG(i,o,r).fit()}function Kb(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class kG{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=$.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=$.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new z(o,s,l);return e>-1?new Dt(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new it(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=zf(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore($.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=zf(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=zf(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new z(ds(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new z(ds(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v1||a==0||v.content.size)&&(f=S,c.push(qb(v.mark(d.allowedMarks(v.marks)),u==1?a:0,u==l.childCount?p:-1)))}let h=u==l.childCount;h||(p=-1),this.placed=ps(this.placed,n,$.from(c)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,S=l;v1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:a,type:u}=this.frontier[l],c=jf(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ps(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ps(this.placed,this.depth,$.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore($.empty,!0);n.childCount&&(this.placed=ps(this.placed,this.frontier.length,n))}}function ds(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ds(t.firstChild.content,e-1,n)))}function ps(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ps(t.lastChild.content,e-1,n)))}function zf(t,e){for(let n=0;n1&&(r=r.replaceChild(0,qb(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore($.empty,!0)))),t.copy(r)}function jf(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!AG(n,o.content,s)?l:null}function AG(t,e,n){for(let r=n;r0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(d)>-1?l=d:i.before(d)==p&&s.splice(1,0,-d)}let a=s.indexOf(l),u=[],c=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(u.push(h),p==r.openStart)break;d=h.content}for(let d=c-1;d>=0;d--){let p=u[d],h=_G(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(l)-1)))c=d;else if(h||!p.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+c+1)%(r.openStart+1),h=u[p];if(h)for(let v=0;v=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let p=s[d];p<0||(e=i.before(p),n=o.after(p))}}function Yb(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore($.empty,!0))}return t}function MG(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=OG(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new z($.from(r),0,0))}function IG(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Jb(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function Jb(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class lo extends at{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ie.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ie.fromReplace(e,this.pos,this.pos+1,new z($.from(i),0,n.isLeaf?0:1))}getMap(){return It.empty}invert(e){return new lo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new lo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new lo(n.pos,n.attr,n.value)}}at.jsonID("attr",lo);class sl extends at{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Ie.ok(r)}getMap(){return It.empty}invert(e){return new sl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new sl(n.attr,n.value)}}at.jsonID("docAttr",sl);let xo=class extends Error{};xo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};xo.prototype=Object.create(Error.prototype);xo.prototype.constructor=xo;xo.prototype.name="TransformError";class PG{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new so}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new xo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=z.empty){let i=Em(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new z($.from(r),0,0))}delete(e,n){return this.replace(e,n,z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return NG(this,e,n,r),this}replaceRangeWith(e,n,r){return MG(this,e,n,r),this}deleteRange(e,n){return IG(this,e,n),this}lift(e,n){return yG(this,e,n),this}join(e,n=1){return xG(this,e,n),this}wrap(e,n){return vG(this,e,n),this}setBlockType(e,n=e,r,i=null){return SG(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return EG(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new lo(e,n,r)),this}setDocAttribute(e,n){return this.step(new sl(e,n)),this}addNodeMark(e,n){return this.step(new dr(e,n)),this}removeNodeMark(e,n){if(!(n instanceof se)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new bo(e,n)),this}split(e,n=1,r){return CG(this,e,n,r),this}addMark(e,n,r){return pG(this,e,n,r),this}removeMark(e,n,r){return hG(this,e,n,r),this}clearIncompatible(e,n,r){return mG(this,e,n,r),this}}const Uf=Object.create(null);class le{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new $G(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?Ri(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Ri(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Rt(e.node(0))}static atStart(e){return Ri(e,e,0,0,1)||new Rt(e)}static atEnd(e){return Ri(e,e,e.content.size,e.childCount,-1)||new Rt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Uf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Uf)throw new RangeError("Duplicate use of selection JSON ID "+e);return Uf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return me.between(this.$anchor,this.$head).getBookmark()}}le.prototype.visible=!0;class $G{constructor(e,n){this.$from=e,this.$to=n}}let N1=!1;function M1(t){!N1&&!t.parent.inlineContent&&(N1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class me extends le{constructor(e,n=e){M1(e),M1(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return le.near(r);let i=e.resolve(n.map(this.anchor));return new me(i.parent.inlineContent?i:r,r)}replace(e,n=z.empty){if(super.replace(e,n),n==z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof me&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new xc(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new me(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=le.findFrom(n,r,!0)||le.findFrom(n,-r,!0);if(o)n=o.$head;else return le.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(le.findFrom(e,-r,!0)||le.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&Y.isSelectable(l))return Y.create(t,n-(i<0?l.nodeSize:0))}else{let a=Ri(t,l,n+i,i<0?l.childCount:0,i,o);if(a)return a}n+=l.nodeSize*i}return null}function I1(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=c)}),t.setSelection(le.near(t.doc.resolve(s),n))}const P1=1,la=2,$1=4;class RG extends PG{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=la,this}ensureMarks(e){return se.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&la)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~la,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||se.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(le.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=$1,this}get scrolledIntoView(){return(this.updated&$1)>0}}function D1(t,e){return!e||!t?t:t.bind(e)}class hs{constructor(e,n,r){this.name=e,this.init=D1(n.init,r),this.apply=D1(n.apply,r)}}const LG=[new hs("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new hs("selection",{init(t,e){return t.selection||le.atStart(e.doc)},apply(t){return t.selection}}),new hs("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new hs("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Vf{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=LG.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new hs(r.key,r.spec.state,r))})}}class ms{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Vf(e.schema,e.plugins),o=new ms(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=oi.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=le.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],u=a.spec.state;if(a.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=u.fromJSON.call(a,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function Qb(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Qb(i,e,{})),n[r]=i}return n}class Xb{constructor(e){this.spec=e,this.props={},e.props&&Qb(e.props,this,this.props),this.key=e.key?e.key.key:Zb("plugin")}getState(e){return e[this.key]}}const Wf=Object.create(null);function Zb(t){return t in Wf?t+"$"+ ++Wf[t]:(Wf[t]=0,t+"$")}class ex{constructor(e="key"){this.key=Zb(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ft=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ll=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let R1=null;const Dn=function(t,e,n){let r=R1||(R1=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},hi=function(t,e,n,r){return n&&(L1(t,e,n,r,-1)||L1(t,e,n,r,1))},FG=/^(img|br|input|textarea|hr)$/i;function L1(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:En(t))){let o=t.parentNode;if(!o||o.nodeType!=1||bm(t)||FG.test(t.nodeName)||t.contentEditable=="false")return!1;e=ft(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?En(t):0}else return!1}}function En(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function BG(t,e,n){for(let r=e==0,i=e==En(t);r||i;){if(t==n)return!0;let o=ft(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==En(t)}}function bm(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Oc=function(t){return t.focusNode&&hi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Gr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function zG(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jG(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const On=typeof navigator<"u"?navigator:null,F1=typeof document<"u"?document:null,Rr=On&&On.userAgent||"",wp=/Edge\/(\d+)/.exec(Rr),tx=/MSIE \d/.exec(Rr),Ep=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rr),At=!!(tx||Ep||wp),xr=tx?document.documentMode:Ep?+Ep[1]:wp?+wp[1]:0,fn=!At&&/gecko\/(\d+)/i.test(Rr);fn&&+(/Firefox\/(\d+)/.exec(Rr)||[0,0])[1];const Cp=!At&&/Chrome\/(\d+)/.exec(Rr),ot=!!Cp,UG=Cp?+Cp[1]:0,ht=!At&&!!On&&/Apple Computer/.test(On.vendor),Oo=ht&&(/Mobile\/\w+/.test(Rr)||!!On&&On.maxTouchPoints>2),Ut=Oo||(On?/Mac/.test(On.platform):!1),VG=On?/Win/.test(On.platform):!1,rn=/Android \d/.test(Rr),Ol=!!F1&&"webkitFontSmoothing"in F1.documentElement.style,WG=Ol?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function HG(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Pn(t,e){return typeof t=="number"?t:t[e]}function GG(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function B1(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=ll(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,u=a?HG(o):GG(l),c=0,f=0;if(e.topu.bottom-Pn(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+Pn(i,"top")-u.top:e.bottom-u.bottom+Pn(i,"bottom")),e.leftu.right-Pn(r,"right")&&(c=e.right-u.right+Pn(i,"right")),c||f)if(a)o.defaultView.scrollBy(c,f);else{let d=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),c&&(l.scrollLeft+=c);let h=l.scrollLeft-d,v=l.scrollTop-p;e={left:e.left-h,top:e.top-v,right:e.right-h,bottom:e.bottom-v}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function KG(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:nx(t.dom)}}function nx(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ll(r));return e}function qG({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;rx(n,r==0?0:r-e)}function rx(t,e){for(let n=0;n=l){s=Math.max(h.bottom,s),l=Math.min(h.top,l);let v=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=c,u={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=f+1)}}return!n&&a&&(n=a,i=u,r=0),n&&n.nodeType==3?JG(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:ix(n,i)}function JG(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function xm(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function QG(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function ZG(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,a.left>r.left||a.top>r.top?i=l.posBefore:(a.right-1?i:t.docView.posFromDOM(e,n,-1)}function ox(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let u;Ol&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=ZG(t,r,i,e))}l==null&&(l=XG(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function z1(t){return t.top=0&&i==r.nodeValue.length?(a--,c=1):n<0?a--:u++,ls(Xn(Dn(r,a,u),c),c<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==En(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Hf(a.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==En(r))){let a=r.childNodes[i-1],u=a.nodeType==3?Dn(a,En(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return ls(Xn(u,1),!1)}if(o==null&&i=0)}function ls(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Hf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function lx(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function nK(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return lx(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=sx(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Dn(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const rK=/[\u0590-\u08ac]/;function iK(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return!rK.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:lx(t,e,()=>{let{focusNode:a,focusOffset:u,anchorNode:c,anchorOffset:f}=t.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:v}=t.domSelectionRange(),S=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&u==v;try{l.collapse(c,f),a&&(a!=c||u!=f)&&l.extend&&l.extend(a,u)}catch{}return d!=null&&(l.caretBidiLevel=d),S})}let j1=null,U1=null,V1=!1;function oK(t,e,n){return j1==e&&U1==n?V1:(j1=e,U1=n,V1=n=="up"||n=="down"?nK(t,e,n):iK(t,e,n))}const Kt=0,W1=1,Jr=2,Tn=3;class Tl{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Kt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nft(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof ux){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof ax&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?ft(o.dom)+1:0}}else{let o,s=!0;for(;o=r=c&&n<=u-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,c);e=s;for(let f=l;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=ft(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||l==this.children.length-1)){n=u;for(let c=l+1;cp&&sn){let p=l;l=a,a=p}let d=document.createRange();d.setEnd(a.node,a.offset),d.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,a=s-o.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?Jr:W1,e==l&&n==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Tn:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Jr:Tn}r=s}this.dirty=Jr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Jr:W1;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Kt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class sK extends Tl{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class mi extends Tl{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=jn.renderSpec(document,n.type.spec.toDOM(n,r))),new mi(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Tn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Tn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Kt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Op(o,0,e,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=jn.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=dx(c,r,n),u?a=new lK(e,n,r,i,c,f||null,d,u,o,s+1):n.isText?new Tc(e,n,r,i,c,d,o):new Or(e,n,r,i,c,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>$.empty)}return e}matchesNode(e,n,r){return this.dirty==Kt&&e.eq(this.node)&&xp(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new uK(this,s&&s.node,e);dK(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?a.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!f&&a.syncToMarks(c==this.node.childCount?se.none:this.node.child(c).marks,r,e),a.placeWidget(u,e,i)},(u,c,f,d)=>{a.syncToMarks(u.marks,r,e);let p;a.findNodeMatch(u,c,f,d)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(u,c,f,p,e)||a.updateNextNode(u,c,f,e,d,i)||a.addNode(u,c,f,e,i),i+=u.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Jr)&&(s&&this.protectLocalComposition(e,s),cx(this.contentDOM,this.children,e),Oo&&pK(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof me)||rn+this.node.content.size)return null;let o=e.domSelectionRange(),s=hK(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,a=mK(this.node.content,l,r-n,i-n);return a<0?null:{node:s,pos:a,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new sK(this,o,n,i);e.input.compositionNodes.push(s),this.children=Op(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Tn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Kt}updateOuterDeco(e){if(xp(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=fx(this.dom,this.nodeDOM,bp(this.outerDeco,this.node,n),bp(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function H1(t,e,n,r,i){dx(r,e,t);let o=new Or(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Tc extends Or{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Tn||this.dirty!=Kt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Kt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Kt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Tc(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Tn)}get domAtom(){return!1}}class ux extends Tl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Kt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class lK extends Or{constructor(e,n,r,i,o,s,l,a,u,c){super(e,n,r,i,o,s,l,u,c),this.spec=a}update(e,n,r,i){if(this.dirty==Tn)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function cx(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=mi.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let u=n.children[r-1];if(u instanceof mi)n=u,r=u.children.length;else{l=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function fK(t,e){return t.type.side-e.type.side}function dK(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let u=0;uo;)l.push(i[s++]);let h=o+d.nodeSize;if(d.isText){let S=h;s!S.inline):l.slice();r(d,v,e.forChild(o,d),p),o=h}}function pK(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function hK(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=En(t)}else if(t.nodeType==1&&e=n){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let u=l=0&&u+e.length+l>=n)return l+u;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Op(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||c<=e?o.push(a):(un&&o.push(a.slice(n-u,a.size,r)))}return o}function Om(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,u;if(Oc(n)){for(a=l;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&Y.isSelectable(c)&&i.parent&&!(c.isInline&&BG(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;u=new Y(s==f?l:r.resolve(f))}}else{let c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null;a=r.resolve(c)}if(!u){let c=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!px(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function yK(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,ft(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&At&&xr<=11&&(r.disabled=!0,r.disabled=!1)}function hx(t,e){if(e instanceof Y){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(J1(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else J1(t)}function J1(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Tm(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||me.between(e,n,r)}function Q1(t){return t.editable&&!t.hasFocus()?!1:mx(t)}function mx(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function vK(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return hi(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Tp(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&le.findFrom(o,e)}function nr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function X1(t,e,n){let r=t.state.selection;if(r instanceof me)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return nr(t,new me(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Tp(t.state,e);return i&&i instanceof Y?nr(t,i):!1}else if(!(Ut&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?Y.isSelectable(o)?nr(t,new Y(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Ol?nr(t,new me(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Y&&r.node.isInline)return nr(t,new me(e>0?r.$to:r.$from));{let i=Tp(t.state,e);return i?nr(t,i):!1}}}function Su(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Ps(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Pi(t,e){return e<0?SK(t):wK(t)}function SK(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(fn&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Ps(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(gx(n))break;{let l=n.previousSibling;for(;l&&Ps(l,-1);)i=n.parentNode,o=ft(l),l=l.previousSibling;if(l)n=l,r=Su(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?kp(t,n,r):i&&kp(t,i,o)}function wK(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Su(n),o,s;for(;;)if(r{t.state==i&&Vn(t)},50)}function Z1(t,e){let n=t.state.doc.resolve(e);if(!(ot||VG)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function e0(t,e,n){let r=t.state.selection;if(r instanceof me&&!r.empty||n.indexOf("s")>-1||Ut&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Tp(t.state,e);if(s&&s instanceof Y)return nr(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Rt?le.near(s,e):le.findFrom(s,e);return l?nr(t,l):!1}return!1}function t0(t,e){if(!(t.state.selection instanceof me))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function n0(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function bK(t){if(!ht||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;n0(t,r,"true"),setTimeout(()=>n0(t,r,"false"),20)}return!1}function xK(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function OK(t,e){let n=e.keyCode,r=xK(e);if(n==8||Ut&&n==72&&r=="c")return t0(t,-1)||Pi(t,-1);if(n==46&&!e.shiftKey||Ut&&n==68&&r=="c")return t0(t,1)||Pi(t,1);if(n==13||n==27)return!0;if(n==37||Ut&&n==66&&r=="c"){let i=n==37?Z1(t,t.state.selection.from)=="ltr"?-1:1:-1;return X1(t,i,r)||Pi(t,i)}else if(n==39||Ut&&n==70&&r=="c"){let i=n==39?Z1(t,t.state.selection.from)=="ltr"?1:-1:1;return X1(t,i,r)||Pi(t,i)}else{if(n==38||Ut&&n==80&&r=="c")return e0(t,-1,r)||Pi(t,-1);if(n==40||Ut&&n==78&&r=="c")return bK(t)||e0(t,1,r)||Pi(t,1);if(r==(Ut?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function yx(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||jn.fromSchema(t.state.schema),l=bx(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let u=a.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=Cx[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=l.createElement(c[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),f++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` - -`);return{dom:a,text:d}}function vx(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=e&&(r||o||!n);if(a){if(t.someProp("transformPastedText",d=>{e=d(e,o||r,t)}),o)return e?new z($.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):z.empty;let f=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(f)l=f;else{let d=i.marks(),{schema:p}=t.state,h=jn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let S=s.appendChild(document.createElement("p"));v&&S.appendChild(h.serializeNode(p.text(v,d)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=AK(n),Ol&&_K(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||ol.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!TK.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)l=NK(r0(l,+c[1],+c[2]),c[4]);else if(l=z.maxOpen(kK(l.content,i),!0),l.openStart||l.openEnd){let f=0,d=0;for(let p=l.content.firstChild;f{l=f(l,t)}),l}const TK=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function kK(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),u;if(!a)return s=null;if(u=s.length&&o.length&&wx(a,o,l,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=Ex(s[s.length-1],o.length));let c=Sx(l,a);s.push(c),i=i.matchType(c.type),o=a}}),s)return $.from(s)}return t}function Sx(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,$.from(t));return t}function wx(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore($.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function r0(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=bx().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Cx[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=$.from(a.create(r[l+1],i)),o++,s++}return new z(i,o,s)}const mt={},gt={},MK={touchstart:!0,touchmove:!0};class IK{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function PK(t){for(let e in mt){let n=mt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{DK(t,r)&&!km(t,r)&&(t.editable||!(r.type in gt))&&n(t,r)},MK[e]?{passive:!0}:void 0)}ht&&t.dom.addEventListener("input",()=>null),_p(t)}function pr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function $K(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function _p(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>km(t,r))})}function km(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function DK(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function RK(t,e){!km(t,e)&&mt[e.type]&&(t.editable||!(e.type in gt))&&mt[e.type](t,e)}gt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Ox(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(rn&&ot&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Oo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,Gr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||OK(t,n)?n.preventDefault():pr(t,"key")};gt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};gt.keypress=(t,e)=>{let n=e;if(Ox(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ut&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof me)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function kc(t){return{left:t.clientX,top:t.clientY}}function LK(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Am(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ao(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function FK(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(ao(t,new Y(n),"pointer"),!0):!1}function BK(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof Y&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(Y.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(ao(t,Y.create(t.state.doc,i),"pointer"),!0):!1}function zK(t,e,n,r,i){return Am(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?BK(t,n):FK(t,n))}function jK(t,e,n,r){return Am(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function UK(t,e,n,r){return Am(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||VK(t,n,r)}function VK(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ao(t,me.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)ao(t,me.create(r,l+1,l+1+s.content.size),"pointer");else if(Y.isSelectable(s))ao(t,Y.create(r,l),"pointer");else continue;return!0}}function _m(t){return wu(t)}const xx=Ut?"metaKey":"ctrlKey";mt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=_m(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&LK(n,t.input.lastClick)&&!n[xx]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(kc(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new WK(t,s,n,!!r)):(o=="doubleClick"?jK:UK)(t,s.pos,s.inside,n)?n.preventDefault():pr(t,"pointer"))};class WK{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[xx],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof Y&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&fn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),pr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Vn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(kc(e))),this.updateAllowDefault(e),this.allowDefault||!n?pr(this.view,"pointer"):zK(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ht&&this.mightDrag&&!this.mightDrag.node.isAtom||ot&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ao(this.view,le.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):pr(this.view,"pointer")}move(e){this.updateAllowDefault(e),pr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}mt.touchstart=t=>{t.input.lastTouch=Date.now(),_m(t),pr(t,"pointer")};mt.touchmove=t=>{t.input.lastTouch=Date.now(),pr(t,"pointer")};mt.contextmenu=t=>_m(t);function Ox(t,e){return t.composing?!0:ht&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const HK=rn?5e3:-1;gt.compositionstart=gt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),wu(t,!0),t.markCursor=null;else if(wu(t),fn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}Tx(t,HK)};gt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Tx(t,20))};function Tx(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>wu(t),e))}function kx(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=GK());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function GK(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function wu(t,e=!1){if(!(rn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),kx(t),e||t.docView&&t.docView.dirty){let n=Om(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function KK(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const al=At&&xr<15||Oo&&WG<604;mt.copy=gt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=al?null:n.clipboardData,s=r.content(),{dom:l,text:a}=yx(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):KK(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function qK(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function YK(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ul(t,r.value,null,i,e):ul(t,r.textContent,r.innerHTML,i,e)},50)}function ul(t,e,n,r,i){let o=vx(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,i,o||z.empty)))return!0;if(!o)return!1;let s=qK(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Ax(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}gt.paste=(t,e)=>{let n=e;if(t.composing&&!rn)return;let r=al?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ul(t,Ax(r),r.getData("text/html"),i,n)?n.preventDefault():YK(t,n)};class _x{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Nx=Ut?"altKey":"ctrlKey";mt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(kc(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)s=Y.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let c=t.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=t.docView&&(s=Y.create(t.state.doc,c.posBefore))}}let l=(s||t.state.selection).content(),{dom:a,text:u}=yx(t,l);n.dataTransfer.clearData(),n.dataTransfer.setData(al?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",al||n.dataTransfer.setData("text/plain",u),t.dragging=new _x(l,!n[Nx],s)};mt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};gt.dragover=gt.dragenter=(t,e)=>e.preventDefault();gt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(kc(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=vx(t,Ax(n.dataTransfer),al?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[Nx]);if(t.someProp("handleDrop",h=>h(t,n,s||z.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?TG(t.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let u=t.state.tr;if(l){let{node:h}=r;h?h.replace(u):u.deleteSelection()}let c=u.mapping.map(a),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=u.doc;if(f?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(d))return;let p=u.doc.resolve(c);if(f&&Y.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new Y(p));else{let h=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((v,S,m,y)=>h=y),u.setSelection(Tm(t,p,u.doc.resolve(h)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))};mt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Vn(t)},20))};mt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};mt.beforeinput=(t,e)=>{if(ot&&rn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,Gr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in gt)mt[t]=gt[t];function cl(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Eu{constructor(e,n){this.toDOM=e,this.spec=n||si,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new sn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Eu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&cl(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Tr{constructor(e,n){this.attrs=e,this.spec=n||si}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new sn(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==nt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||si)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let u=a+r,c;if(c=Ix(n,l,u)){for(i||(i=this.children.slice());ol&&f.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&a.type instanceof Tr){let u=Math.max(o,a.from)-o,c=Math.min(s,a.to)-o;ui.map(e,n,si));return lr.from(r)}forChild(e,n){if(n.isLeaf)return ze.empty;let r=[];for(let i=0;in instanceof ze)?e:e.reduce((n,r)=>n.concat(r instanceof ze?r:r.members),[]))}}}function JK(t,e,n,r,i,o,s){let l=t.slice();for(let u=0,c=o;u{let S=v-h-(p-d);for(let m=0;my+c-f)continue;let g=l[m]+c-f;p>=g?l[m+1]=d<=g?-2:-1:d>=c&&S&&(l[m]+=S,l[m+1]+=S)}f+=S}),c=n.maps[u].map(c,-1)}let a=!1;for(let u=0;u=r.content.size){a=!0;continue}let d=n.map(t[u+1]+o,-1),p=d-i,{index:h,offset:v}=r.content.findIndex(f),S=r.maybeChild(h);if(S&&v==f&&v+S.nodeSize==p){let m=l[u+2].mapInner(n,S,c+1,t[u]+o+1,s);m!=nt?(l[u]=f,l[u+1]=p,l[u+2]=m):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=QK(l,t,e,n,i,o,s),c=Cu(u,r,0,s);e=c.local;for(let f=0;fn&&s.to{let u=Ix(t,l,a+n);if(u){o=!0;let c=Cu(u,l,n+a+1,r);c!=nt&&i.push(a,a+l.nodeSize,c)}});let s=Mx(o?Px(t):t,-n).sort(li);for(let l=0;l0;)e++;t.splice(e,0,n)}function Kf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=nt&&e.push(r)}),t.cursorWrapper&&e.push(ze.create(t.state.doc,[t.cursorWrapper.deco])),lr.from(e)}const XK={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ZK=At&&xr<=11;class eq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class tq{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eq,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),ZK&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,XK)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Q1(this.view)){if(this.suppressingSelectionUpdates)return Vn(this.view);if(At&&xr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&hi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=ll(o))n.add(o);for(let o=e.anchorNode;o;o=ll(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Q1(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let c=0;c1){let c=a.filter(f=>f.nodeName=="BR");if(c.length==2){let f=c[0],d=c[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),nq(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Vn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;ci;S--){let m=r.childNodes[S-1],y=m.pmViewDesc;if(m.nodeName=="BR"&&!y){o=S;break}if(!y||y.size)break}let f=t.state.doc,d=t.someProp("domParser")||ol.fromSchema(t.state.schema),p=f.resolve(s),h=null,v=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:oq,context:p});if(u&&u[0].pos!=null){let S=u[0].pos,m=u[1]&&u[1].pos;m==null&&(m=S),h={anchor:S+s,head:m+s}}return{doc:v,sel:h,from:s,to:l}}function oq(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ht&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||ht&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const sq=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function lq(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let I=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,M=Om(t,I);if(M&&!t.state.selection.eq(M)){if(ot&&rn&&t.input.lastKeyCode===13&&Date.now()-100T(t,Gr(13,"Enter"))))return;let J=t.state.tr.setSelection(M);I=="pointer"?J.setMeta("pointer",!0):I=="key"&&J.scrollIntoView(),o&&J.setMeta("composition",o),t.dispatch(J)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,u=iq(t,e,n),c=t.state.doc,f=c.slice(u.from,u.to),d,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||rn)&&i.some(I=>I.nodeType==1&&!sq.test(I.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",I=>I(t,Gr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof me&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(u.sel){let I=a0(t,t.state.doc,u.sel);if(I&&!I.eq(t.state.selection)){let M=t.state.tr.setSelection(I);o&&M.setMeta("composition",o),t.dispatch(M)}}return}if(ot&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let I=h.endB-h.start;u.sel={anchor:u.sel.anchor+I,head:u.sel.anchor+I}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?h.start=t.state.selection.from:h.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),At&&xr<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let v=u.doc.resolveNoCache(h.start-u.from),S=u.doc.resolveNoCache(h.endB-u.from),m=c.resolve(h.start),y=v.sameParent(S)&&v.parent.inlineContent&&m.end()>=h.endA,g;if((Oo&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!y&&v.posI(t,Gr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&uq(c,h.start,h.endA,v,S)&&t.someProp("handleKeyDown",I=>I(t,Gr(8,"Backspace")))){rn&&ot&&t.domObserver.suppressSelectionUpdates();return}ot&&rn&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),rn&&!y&&v.start()!=S.start()&&S.parentOffset==0&&v.depth==S.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,S=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(I){return I(t,Gr(13,"Enter"))})},20));let w=h.start,x=h.endA,C,O,k;if(y){if(v.pos==S.pos)At&&xr<=11&&v.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Vn(t),20)),C=t.state.tr.delete(w,x),O=c.resolve(h.start).marksAcross(c.resolve(h.endA));else if(h.endA==h.endB&&(k=aq(v.parent.content.cut(v.parentOffset,S.parentOffset),m.parent.content.cut(m.parentOffset,h.endA-m.start()))))C=t.state.tr,k.type=="add"?C.addMark(w,x,k.mark):C.removeMark(w,x,k.mark);else if(v.parent.child(v.index()).isText&&v.index()==S.index()-(S.textOffset?0:1)){let I=v.parent.textBetween(v.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",M=>M(t,w,x,I)))return;C=t.state.tr.insertText(I,w,x)}}if(C||(C=t.state.tr.replace(w,x,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let I=a0(t,C.doc,u.sel);I&&!(ot&&rn&&t.composing&&I.empty&&(h.start!=h.endB||t.input.lastAndroidDeletee.content.size?null:Tm(t,e.resolve(n.anchor),e.resolve(n.head))}function aq(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,a;for(let c=0;cc.mark(l.addToSet(c.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;cn||qf(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function cq(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}class SY{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new IK,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(h0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=d0(this),f0(this),this.nodeViews=p0(this),this.docView=H1(this.state.doc,c0(this),Kf(this),this.dom,this),this.domObserver=new tq(this,(r,i,o,s)=>lq(this,r,i,o,s)),this.domObserver.start(),PK(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&_p(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(h0),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(kx(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=p0(this);dq(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&_p(this),this.editable=d0(this),f0(this);let a=Kf(this),u=c0(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,u,a);(f||!e.selection.eq(i.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&KG(this);if(s){this.domObserver.stop();let p=f&&(At||ot)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&fq(i.selection,e.selection);if(f){let h=ot?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,u,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=H1(e.doc,u,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&vK(this))?Vn(this,p):(hx(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&qG(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Y){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&B1(this,n.getBoundingClientRect(),e)}else B1(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new _x(e.slice,e.move,i<0?void 0:Y.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return eK(this,e)}coordsAtPos(e,n=1){return sx(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return oK(this,n||this.state,e)}pasteHTML(e,n){return ul(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ul(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&($K(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Kf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return RK(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return ht&&this.root.nodeType===11&&zG(this.dom.ownerDocument)==this.dom?rq(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function c0(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[sn.node(0,t.state.doc.content.size,e)]}function f0(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:sn.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function d0(t){return!t.someProp("editable",e=>e(t.state)===!1)}function fq(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function p0(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function dq(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function h0(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Mr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},bu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pq=typeof navigator<"u"&&/Mac/.test(navigator.platform),hq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var qe=0;qe<10;qe++)Mr[48+qe]=Mr[96+qe]=String(qe);for(var qe=1;qe<=24;qe++)Mr[qe+111]="F"+qe;for(var qe=65;qe<=90;qe++)Mr[qe]=String.fromCharCode(qe+32),bu[qe]=String.fromCharCode(qe);for(var Yf in Mr)bu.hasOwnProperty(Yf)||(bu[Yf]=Mr[Yf]);function mq(t){var e=pq&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||hq&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?bu:Mr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const gq=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function yq(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=Mr[r.keyCode])&&o!=i){let l=e[Jf(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const $x=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function wq(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Eq=(t,e,n)=>{let r=wq(t,n);if(!r)return!1;let i=Dx(r);if(!i){let s=r.blockRange(),l=s&&wm(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Lx(t,i,e))return!0;if(r.parent.content.size==0&&(To(o,"end")||Y.isSelectable(o))){let s=Em(t.doc,r.before(),r.after(),z.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Dx(r)}let s=o&&o.nodeBefore;return!s||!Y.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Y.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Dx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function bq(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=bq(t,n);if(!r)return!1;let i=Rx(r);if(!i)return!1;let o=i.nodeAfter;if(Lx(t,i,e))return!0;if(r.parent.content.size==0&&(To(o,"start")||Y.isSelectable(o))){let s=Em(t.doc,r.before(),r.after(),z.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function Im(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Im(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(le.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},Aq=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Rt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Im(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Oa(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&wm(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function Nq(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Y&&e.selection.node.isBlock)return!r.parentOffset||!Oa(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let o=i.parentOffset==i.parent.content.size,s=e.tr;(e.selection instanceof me||e.selection instanceof Rt)&&s.deleteSelection();let l=r.depth==0?null:Im(r.node(-1).contentMatchAt(r.indexAfter(-1))),a=t&&t(i.parent,o),u=a?[a]:o&&l?[{type:l}]:void 0,c=Oa(s.doc,s.mapping.map(r.pos),1,u);if(!u&&!c&&Oa(s.doc,s.mapping.map(r.pos),1,l?[{type:l}]:void 0)&&(l&&(u=[{type:l}]),c=!0),c&&(s.split(s.mapping.map(r.pos),1,u),!o&&!r.parentOffset&&r.parent.type!=l)){let f=s.mapping.map(r.before()),d=s.doc.resolve(f);l&&r.node(-1).canReplaceWith(d.index(),d.index()+1,l)&&s.setNodeMarkup(s.mapping.map(r.before()),l)}n(s.scrollIntoView())}return!0}}const Mq=Nq(),Iq=(t,e)=>(e&&e(t.tr.setSelection(new Rt(t.doc))),!0);function Pq(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Gb(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Lx(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Pq(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=$.empty;for(let v=o.length-1;v>=0;v--)d=$.from(o[v].create(null,d));d=$.from(r.copy(d));let p=t.tr.step(new Dt(e.pos-1,f,e.pos,f,new z(d,1,0),o.length,!0)),h=f+2*o.length;Gb(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let a=le.findFrom(e,1),u=a&&a.$from.blockRange(a.$to),c=u&&wm(u);if(c!=null&&c>=e.depth)return n&&n(t.tr.lift(u,c).scrollIntoView()),!0;if(l&&To(i,"start",!0)&&To(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=$.empty;for(let m=d.length-1;m>=0;m--)v=$.from(d[m].copy(v));let S=t.tr.step(new Dt(e.pos-d.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new z(v,d.length,0),0,!0));n(S.scrollIntoView())}return!0}}return!1}function Fx(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(me.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const $q=Fx(-1),Dq=Fx(1);function Pm(...t){return function(e,n,r){for(let i=0;i=n?Ue.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Ue.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ue.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Ue.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};Ue.from=function(e){return e instanceof Ue?e:e&&e.length?new zx(e):Ue.empty};var zx=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=xu)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=xu)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ue);Ue.empty=new zx([]);var Lq=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ue);const Fq=500;class on{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,c.push(f);return}if(i){c.push(new yn(f.map));let p=f.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],u.push(new yn(h,void 0,void 0,u.length+c.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,a=new on(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let c=0;czq&&(l=Bq(l,u),s-=u),new on(l.append(o),s)}remapping(e,n){let r=new so;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new on(this.items.append(e.map(n=>new yn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(d=>{d.selection&&l--},i);let a=n;this.items.forEach(d=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(d.step){let v=e.steps[p].invert(e.docs[p]),S=d.selection&&d.selection.map(o.slice(a+1,p));S&&l++,r.push(new yn(h,v,S))}else r.push(new yn(h))},i);let u=[];for(let d=n;dFq&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(n.slice(r)),u=a&&a.getMap();if(r--,u&&n.appendMap(u,r),a){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let f=new yn(u.invert(),a,c),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new on(Ue.from(i.reverse()),o)}}on.empty=new on(Ue.empty,0);function Bq(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class yn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new yn(n.getMap().invert(),n,this.selection)}}}class rr{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const zq=20;function jq(t,e,n,r){let i=n.getMeta(kr),o;if(i)return i.historyState;n.getMeta(Vq)&&(t=new rr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(kr))return s.getMeta(kr).redo?new rr(t.done.addTransform(n,void 0,r,Ta(e)),t.undone,g0(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new rr(t.done,t.undone.addTransform(n,void 0,r,Ta(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!Uq(n,t.prevRanges)),u=s?Xf(t.prevRanges,n.mapping):g0(n.mapping.maps[n.steps.length-1]);return new rr(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,Ta(e)),on.empty,u,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new rr(t.done.rebased(n,o),t.undone.rebased(n,o),Xf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new rr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Xf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function Uq(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function g0(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Xf(t,e){if(!t)return null;let n=[];for(let r=0;r{let n=kr.getState(t);return!n||n.done.eventCount==0?!1:(e&&jx(n,t,e,!1),!0)},Hq=(t,e)=>{let n=kr.getState(t);return!n||n.undone.eventCount==0?!1:(e&&jx(n,t,e,!0),!0)};export{yY as A,pY as B,fY as C,dY as D,CY as E,gY as F,wY as G,Wq as H,Hq as I,EY as J,ms as K,ol as L,SY as M,jH as N,VH as O,uY as P,h9 as Q,Ra as R,vY as S,nY as U,Qq as _,Xq as a,Rs as b,eY as c,Zq as d,ie as e,Jq as f,Yq as g,Kq as h,kM as i,Gq as j,Up as k,oY as l,q6 as m,aY as n,rY as o,Fu as p,iY as q,H as r,mY as s,qq as t,sY as u,tY as v,cY as w,lY as x,hY as y,QC as z}; diff --git a/packages/chord-chart-studio/build/assets/vendor-BWYuIjsn.js b/packages/chord-chart-studio/build/assets/vendor-BWYuIjsn.js new file mode 100644 index 00000000..cad176af --- /dev/null +++ b/packages/chord-chart-studio/build/assets/vendor-BWYuIjsn.js @@ -0,0 +1,142 @@ +var Tn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function o$(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}function s$(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var XS=s$;function l$(t){return t}var Rl=l$,a$=XS,by=Math.max;function u$(t,e,n){return e=by(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=by(r.length-e,0),s=Array(o);++i0){if(++e>=gk)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var bk=Sk,wk=mk,Ek=bk,Ck=Ek(wk),ob=Ck,xk=Rl,Tk=ZS,Ok=ob;function $k(t,e){return Ok(Tk(t,e,xk),t+"")}var qo=$k;function kk(){this.__data__=[],this.size=0}var Ak=kk;function Pk(t,e){return t===e||t!==t&&e!==e}var Ll=Pk,_k=Ll;function Mk(t,e){for(var n=t.length;n--;)if(_k(t[n][0],e))return n;return-1}var cc=Mk,Nk=cc,Ik=Array.prototype,Dk=Ik.splice;function Rk(t){var e=this.__data__,n=Nk(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Dk.call(e,n,1),--this.size,!0}var Lk=Rk,Fk=cc;function Bk(t){var e=this.__data__,n=Fk(e,t);return n<0?void 0:e[n][1]}var zk=Bk,jk=cc;function Uk(t){return jk(this.__data__,t)>-1}var Wk=Uk,Vk=cc;function Hk(t,e){var n=this.__data__,r=Vk(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Kk=Hk,Gk=Ak,qk=Lk,Yk=zk,Jk=Wk,Qk=Kk;function Yo(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=r_}var qh=i_,o_=zh,s_=qh;function l_(t){return t!=null&&s_(t.length)&&!o_(t)}var Ni=l_,a_=Ni,u_=In;function c_(t){return u_(t)&&a_(t)}var gc=c_,su={exports:{}};function f_(){return!1}var d_=f_;su.exports;(function(t,e){var n=vn,r=d_,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,a=l?l.isBuffer:void 0,u=a||r;t.exports=u})(su,su.exports);var yc=su.exports,p_=_i,h_=Hh,m_=In,g_="[object Object]",y_=Function.prototype,v_=Object.prototype,mb=y_.toString,S_=v_.hasOwnProperty,b_=mb.call(Object);function w_(t){if(!m_(t)||p_(t)!=g_)return!1;var e=h_(t);if(e===null)return!0;var n=S_.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&mb.call(n)==b_}var gb=w_,E_=_i,C_=qh,x_=In,T_="[object Arguments]",O_="[object Array]",$_="[object Boolean]",k_="[object Date]",A_="[object Error]",P_="[object Function]",__="[object Map]",M_="[object Number]",N_="[object Object]",I_="[object RegExp]",D_="[object Set]",R_="[object String]",L_="[object WeakMap]",F_="[object ArrayBuffer]",B_="[object DataView]",z_="[object Float32Array]",j_="[object Float64Array]",U_="[object Int8Array]",W_="[object Int16Array]",V_="[object Int32Array]",H_="[object Uint8Array]",K_="[object Uint8ClampedArray]",G_="[object Uint16Array]",q_="[object Uint32Array]",we={};we[z_]=we[j_]=we[U_]=we[W_]=we[V_]=we[H_]=we[K_]=we[G_]=we[q_]=!0;we[T_]=we[O_]=we[F_]=we[$_]=we[B_]=we[k_]=we[A_]=we[P_]=we[__]=we[M_]=we[N_]=we[I_]=we[D_]=we[R_]=we[L_]=!1;function Y_(t){return x_(t)&&C_(t.length)&&!!we[E_(t)]}var J_=Y_;function Q_(t){return function(e){return t(e)}}var Zo=Q_,lu={exports:{}};lu.exports;(function(t,e){var n=tb,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var a=i&&i.require&&i.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l})(lu,lu.exports);var Yh=lu.exports,X_=J_,Z_=Zo,My=Yh,Ny=My&&My.isTypedArray,eM=Ny?Z_(Ny):X_,Jh=eM;function tM(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var yb=tM,nM=Wh,rM=Ll,iM=Object.prototype,oM=iM.hasOwnProperty;function sM(t,e,n){var r=t[e];(!(oM.call(t,e)&&rM(r,n))||n===void 0&&!(e in t))&&nM(t,e,n)}var Qh=sM,lM=Qh,aM=Wh;function uM(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o-1&&t%1==0&&t1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&mN(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++rMath.random().toString(36).substring(7).split("").join("."),AN={INIT:`@@redux/INIT${$f()}`,REPLACE:`@@redux/REPLACE${$f()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$f()}`},au=AN;function Xh(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function Cb(t,e,n){if(typeof t!="function")throw new Error(Ke(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ke(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ke(1));return n(Cb)(t,e)}let r=t,i=e,o=new Map,s=o,l=0,a=!1;function u(){s===o&&(s=new Map,o.forEach((S,m)=>{s.set(m,S)}))}function c(){if(a)throw new Error(Ke(3));return i}function f(S){if(typeof S!="function")throw new Error(Ke(4));if(a)throw new Error(Ke(5));let m=!0;u();const y=l++;return s.set(y,S),function(){if(m){if(a)throw new Error(Ke(6));m=!1,u(),s.delete(y),o=null}}}function d(S){if(!Xh(S))throw new Error(Ke(7));if(typeof S.type>"u")throw new Error(Ke(8));if(typeof S.type!="string")throw new Error(Ke(17));if(a)throw new Error(Ke(9));try{a=!0,i=r(i,S)}finally{a=!1}return(o=s).forEach(y=>{y()}),S}function p(S){if(typeof S!="function")throw new Error(Ke(10));r=S,d({type:au.REPLACE})}function h(){const S=f;return{subscribe(m){if(typeof m!="object"||m===null)throw new Error(Ke(11));function y(){const w=m;w.next&&w.next(c())}return y(),{unsubscribe:S(y)}},[By](){return this}}}return d({type:au.INIT}),{dispatch:d,subscribe:f,getState:c,replaceReducer:p,[By]:h}}function PN(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:au.INIT})>"u")throw new Error(Ke(12));if(typeof n(void 0,{type:au.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ke(13))})}function _N(t){const e=Object.keys(t),n={};for(let o=0;o"u")throw l&&l.type,new Error(Ke(14));u[f]=h,a=a||h!==p}return a=a||r.length!==Object.keys(s).length,a?u:s}}function uu(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...r)=>e(n(...r)))}function MN(...t){return e=>(n,r)=>{const i=e(n,r);let o=()=>{throw new Error(Ke(15))};const s={getState:i.getState,dispatch:(a,...u)=>o(a,...u)},l=t.map(a=>a(s));return o=uu(...l)(i.dispatch),{...i,dispatch:o}}}function NN(t){return Xh(t)&&"type"in t&&typeof t.type=="string"}var xb=Symbol.for("immer-nothing"),zy=Symbol.for("immer-draftable"),Ft=Symbol.for("immer-state");function cn(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Ao=Object.getPrototypeOf;function Si(t){return!!t&&!!t[Ft]}function bi(t){var e;return t?Tb(t)||Array.isArray(t)||!!t[zy]||!!((e=t.constructor)!=null&&e[zy])||bc(t)||wc(t):!1}var IN=Object.prototype.constructor.toString();function Tb(t){if(!t||typeof t!="object")return!1;const e=Ao(t);if(e===null)return!0;const n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===IN}function cu(t,e){Sc(t)===0?Reflect.ownKeys(t).forEach(n=>{e(n,t[n],t)}):t.forEach((n,r)=>e(r,n,t))}function Sc(t){const e=t[Ft];return e?e.type_:Array.isArray(t)?1:bc(t)?2:wc(t)?3:0}function Qd(t,e){return Sc(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Ob(t,e,n){const r=Sc(t);r===2?t.set(e,n):r===3?t.add(n):t[e]=n}function DN(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function bc(t){return t instanceof Map}function wc(t){return t instanceof Set}function Yr(t){return t.copy_||t.base_}function Xd(t,e){if(bc(t))return new Map(t);if(wc(t))return new Set(t);if(Array.isArray(t))return Array.prototype.slice.call(t);if(!e&&Tb(t))return Ao(t)?{...t}:Object.assign(Object.create(null),t);const n=Object.getOwnPropertyDescriptors(t);delete n[Ft];let r=Reflect.ownKeys(n);for(let i=0;i1&&(t.set=t.add=t.clear=t.delete=RN),Object.freeze(t),e&&Object.entries(t).forEach(([n,r])=>Zh(r,!0))),t}function RN(){cn(2)}function Ec(t){return Object.isFrozen(t)}var LN={};function wi(t){const e=LN[t];return e||cn(0,t),e}var rl;function $b(){return rl}function FN(t,e){return{drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function jy(t,e){e&&(wi("Patches"),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Zd(t){ep(t),t.drafts_.forEach(BN),t.drafts_=null}function ep(t){t===rl&&(rl=t.parent_)}function Uy(t){return rl=FN(rl,t)}function BN(t){const e=t[Ft];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function Wy(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];return t!==void 0&&t!==n?(n[Ft].modified_&&(Zd(e),cn(4)),bi(t)&&(t=fu(e,t),e.parent_||du(e,t)),e.patches_&&wi("Patches").generateReplacementPatches_(n[Ft].base_,t,e.patches_,e.inversePatches_)):t=fu(e,n,[]),Zd(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==xb?t:void 0}function fu(t,e,n){if(Ec(e))return e;const r=e[Ft];if(!r)return cu(e,(i,o)=>Vy(t,r,e,i,o,n)),e;if(r.scope_!==t)return e;if(!r.modified_)return du(t,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const i=r.copy_;let o=i,s=!1;r.type_===3&&(o=new Set(i),i.clear(),s=!0),cu(o,(l,a)=>Vy(t,r,i,l,a,n,s)),du(t,i,!1),n&&t.patches_&&wi("Patches").generatePatches_(r,n,t.patches_,t.inversePatches_)}return r.copy_}function Vy(t,e,n,r,i,o,s){if(Si(i)){const l=o&&e&&e.type_!==3&&!Qd(e.assigned_,r)?o.concat(r):void 0,a=fu(t,i,l);if(Ob(n,r,a),Si(a))t.canAutoFreeze_=!1;else return}else s&&n.add(i);if(bi(i)&&!Ec(i)){if(!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1)return;fu(t,i),(!e||!e.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&du(t,i)}}function du(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Zh(e,n)}function zN(t,e){const n=Array.isArray(t),r={type_:n?1:0,scope_:e?e.scope_:$b(),modified_:!1,finalized_:!1,assigned_:{},parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=em;n&&(i=[r],o=il);const{revoke:s,proxy:l}=Proxy.revocable(i,o);return r.draft_=l,r.revoke_=s,l}var em={get(t,e){if(e===Ft)return t;const n=Yr(t);if(!Qd(n,e))return jN(t,n,e);const r=n[e];return t.finalized_||!bi(r)?r:r===kf(t.base_,e)?(Af(t),t.copy_[e]=np(r,t)):r},has(t,e){return e in Yr(t)},ownKeys(t){return Reflect.ownKeys(Yr(t))},set(t,e,n){const r=kb(Yr(t),e);if(r!=null&&r.set)return r.set.call(t.draft_,n),!0;if(!t.modified_){const i=kf(Yr(t),e),o=i==null?void 0:i[Ft];if(o&&o.base_===n)return t.copy_[e]=n,t.assigned_[e]=!1,!0;if(DN(n,i)&&(n!==void 0||Qd(t.base_,e)))return!0;Af(t),tp(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_[e]=!0),!0},deleteProperty(t,e){return kf(t.base_,e)!==void 0||e in t.base_?(t.assigned_[e]=!1,Af(t),tp(t)):delete t.assigned_[e],t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=Yr(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.type_!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},defineProperty(){cn(11)},getPrototypeOf(t){return Ao(t.base_)},setPrototypeOf(){cn(12)}},il={};cu(em,(t,e)=>{il[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}});il.deleteProperty=function(t,e){return il.set.call(this,t,e,void 0)};il.set=function(t,e,n){return em.set.call(this,t[0],e,n,t[0])};function kf(t,e){const n=t[Ft];return(n?Yr(n):t)[e]}function jN(t,e,n){var i;const r=kb(e,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(t.draft_):void 0}function kb(t,e){if(!(e in t))return;let n=Ao(t);for(;n;){const r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Ao(n)}}function tp(t){t.modified_||(t.modified_=!0,t.parent_&&tp(t.parent_))}function Af(t){t.copy_||(t.copy_=Xd(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var UN=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,n,r)=>{if(typeof e=="function"&&typeof n!="function"){const o=n;n=e;const s=this;return function(a=o,...u){return s.produce(a,c=>n.call(this,c,...u))}}typeof n!="function"&&cn(6),r!==void 0&&typeof r!="function"&&cn(7);let i;if(bi(e)){const o=Uy(this),s=np(e,void 0);let l=!0;try{i=n(s),l=!1}finally{l?Zd(o):ep(o)}return jy(o,r),Wy(i,o)}else if(!e||typeof e!="object"){if(i=n(e),i===void 0&&(i=e),i===xb&&(i=void 0),this.autoFreeze_&&Zh(i,!0),r){const o=[],s=[];wi("Patches").generateReplacementPatches_(e,i,o,s),r(o,s)}return i}else cn(1,e)},this.produceWithPatches=(e,n)=>{if(typeof e=="function")return(s,...l)=>this.produceWithPatches(s,a=>e(a,...l));let r,i;return[this.produce(e,n,(s,l)=>{r=s,i=l}),r,i]},typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze),typeof(t==null?void 0:t.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}createDraft(t){bi(t)||cn(8),Si(t)&&(t=Ab(t));const e=Uy(this),n=np(t,void 0);return n[Ft].isManual_=!0,ep(e),n}finishDraft(t,e){const n=t&&t[Ft];(!n||!n.isManual_)&&cn(9);const{scope_:r}=n;return jy(r,e),Wy(void 0,r)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const i=e[n];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}n>-1&&(e=e.slice(n+1));const r=wi("Patches").applyPatches_;return Si(t)?r(t,e):this.produce(t,i=>r(i,e))}};function np(t,e){const n=bc(t)?wi("MapSet").proxyMap_(t,e):wc(t)?wi("MapSet").proxySet_(t,e):zN(t,e);return(e?e.scope_:$b()).drafts_.push(n),n}function Ab(t){return Si(t)||cn(10,t),Pb(t)}function Pb(t){if(!bi(t)||Ec(t))return t;const e=t[Ft];let n;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=Xd(t,e.scope_.immer_.useStrictShallowCopy_)}else n=Xd(t,!0);return cu(n,(r,i)=>{Ob(n,r,Pb(i))}),e&&(e.finalized_=!1),n}var Bt=new UN;Bt.produce;Bt.produceWithPatches.bind(Bt);Bt.setAutoFreeze.bind(Bt);Bt.setUseStrictShallowCopy.bind(Bt);Bt.applyPatches.bind(Bt);Bt.createDraft.bind(Bt);Bt.finishDraft.bind(Bt);function WN(t,e=`expected a function, instead received ${typeof t}`){if(typeof t!="function")throw new TypeError(e)}function VN(t,e=`expected an object, instead received ${typeof t}`){if(typeof t!="object")throw new TypeError(e)}function HN(t,e="expected all items to be functions, instead received the following types: "){if(!t.every(n=>typeof n=="function")){const n=t.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${e}[${n}]`)}}var Hy=t=>Array.isArray(t)?t:[t];function KN(t){const e=Array.isArray(t[0])?t[0]:t;return HN(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function GN(t,e){const n=[],{length:r}=t;for(let i=0;i{n=ra(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function _b(t,...e){const n=typeof t=="function"?{memoize:t,memoizeOptions:e}:t,r=(...i)=>{let o=0,s=0,l,a={},u=i.pop();typeof u=="object"&&(a=u,u=i.pop()),WN(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...n,...a},{memoize:f,memoizeOptions:d=[],argsMemoize:p=tm,argsMemoizeOptions:h=[],devModeChecks:v={}}=c,S=Hy(d),m=Hy(h),y=KN(i),g=f(function(){return o++,u.apply(null,arguments)},...S),w=p(function(){s++;const x=GN(y,arguments);return l=g.apply(null,x),l},...m);return Object.assign(w,{resultFunc:u,memoizedResultFunc:g,dependencies:y,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>l,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var QN=_b(tm),XN=Object.assign((t,e=QN)=>{VN(t,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`);const n=Object.keys(t),r=n.map(o=>t[o]);return e(r,(...o)=>o.reduce((s,l,a)=>(s[n[a]]=l,s),{}))},{withTypes:()=>XN});function Mb(t){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,t):i(o)}var ZN=Mb(),eI=Mb,tI=(...t)=>{const e=_b(...t),n=Object.assign((...r)=>{const i=e(...r),o=(s,...l)=>i(Si(s)?Ab(s):s,...l);return Object.assign(o,i),o},{withTypes:()=>n});return n};tI(tm);var nI=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?uu:uu.apply(null,arguments)};function Cc(t,e){function n(...r){if(e){let i=e(...r);if(!i)throw new Error(Bl(0));return{type:t,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:t,payload:r[0]}}return n.toString=()=>`${t}`,n.type=t,n.match=r=>NN(r)&&r.type===t,n}var Nb=class As extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,As.prototype)}static get[Symbol.species](){return As}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new As(...e[0].concat(this)):new As(...e.concat(this))}};function rI(t){return typeof t=="boolean"}var iI=()=>function(e){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=e??{};let s=new Nb;return n&&(rI(n)?s.push(ZN):s.push(eI(n.extraArgument))),s},oI="RTK_autoBatch",Ib=t=>e=>{setTimeout(e,t)},sI=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ib(10),lI=(t={type:"raf"})=>e=>(...n)=>{const r=e(...n);let i=!0,o=!1,s=!1;const l=new Set,a=t.type==="tick"?queueMicrotask:t.type==="raf"?sI:t.type==="callback"?t.queueNotification:Ib(t.timeout),u=()=>{s=!1,o&&(o=!1,l.forEach(c=>c()))};return Object.assign({},r,{subscribe(c){const f=()=>i&&c(),d=r.subscribe(f);return l.add(c),()=>{d(),l.delete(c)}},dispatch(c){var f;try{return i=!((f=c==null?void 0:c.meta)!=null&&f[oI]),o=!i,o&&(s||(s=!0,a(u))),r.dispatch(c)}finally{i=!0}}})},aI=t=>function(n){const{autoBatch:r=!0}=n??{};let i=new Nb(t);return r&&i.push(lI(typeof r=="object"?r:void 0)),i},uI=!0;function GX(t){const e=iI(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=t||{};let l;if(typeof n=="function")l=n;else if(Xh(n))l=_N(n);else throw new Error(Bl(1));let a;typeof r=="function"?a=r(e):a=e();let u=uu;i&&(u=nI({trace:!uI,...typeof i=="object"&&i}));const c=MN(...a),f=aI(c);let d=typeof s=="function"?s(f):f();const p=u(...d);return Cb(l,o,p)}var cI="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",fI=(t=21)=>{let e="",n=t;for(;n--;)e+=cI[Math.random()*64|0];return e},dI=(t,e)=>{if(typeof t!="function")throw new Error(Bl(32))},nm="listenerMiddleware",pI=t=>{let{type:e,actionCreator:n,matcher:r,predicate:i,effect:o}=t;if(e)i=Cc(e).match;else if(n)e=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Bl(21));return dI(o),{predicate:i,type:e,effect:o}},hI=Object.assign(t=>{const{type:e,predicate:n,effect:r}=pI(t);return{id:fI(),effect:r,type:e,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Bl(22))}}},{withTypes:()=>hI}),mI=Object.assign(Cc(`${nm}/add`),{withTypes:()=>mI});Cc(`${nm}/removeAll`);var gI=Object.assign(Cc(`${nm}/remove`),{withTypes:()=>gI});function Bl(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Db={},rm={};Object.defineProperty(rm,"__esModule",{value:!0});rm.default=vI;function yI(){return"@@is-valid-redux-reducer/"+Math.random().toString(36).substring(7).split("").join("\\")}function vI(t){var e=arguments.length<=1||arguments[1]===void 0?!1:arguments[1];if(typeof t!="function"){if(e)throw new Error("Reducer must be a function.");return!1}var n=t(void 0,{type:yI()});if(typeof n>"u"){if(e)throw new Error("Reducer must return the initial state if the state is undefined.");return!1}return!0}Object.defineProperty(Db,"__esModule",{value:!0});var qX=Db.default=EI,SI=rm,bI=wI(SI);function wI(t){return t&&t.__esModule?t:{default:t}}function EI(t){var e=Object.keys(t),n=void 0;try{for(var r=0;r"u"?{}:Object.assign({},i);function u(c,f,d){for(var p=0;p"u"?u(function(c){},o,void 0):typeof s>"u"?u(function(c){return i[c]},o,i):u(function(c){return i[c]},o,s),l?a:i}}var CI=_i,xI=In,TI="[object Symbol]";function OI(t){return typeof t=="symbol"||xI(t)&&CI(t)==TI}var zl=OI,$I=vt,kI=zl,AI=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,PI=/^\w*$/;function _I(t,e){if($I(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||kI(t)?!0:PI.test(t)||!AI.test(t)||e!=null&&t in Object(e)}var im=_I,Rb=Uh,MI="Expected a function";function om(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(MI);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(om.Cache||Rb),n}om.Cache=Rb;var NI=om,II=NI,DI=500;function RI(t){var e=II(t,function(r){return n.size===DI&&n.clear(),r}),n=e.cache;return e}var LI=RI,FI=LI,BI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zI=/\\(\\)?/g,jI=FI(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(BI,function(n,r,i,o){e.push(i?o.replace(zI,"$1"):r||n)}),e}),UI=jI;function WI(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n0&&n(l)?e>1?zb(l,e-1,n,r,i):jD(i,l):r||(i[i.length]=l)}return i}var lm=zb,WD=lm;function VD(t){var e=t==null?0:t.length;return e?WD(t,1):[]}var HD=VD,KD=HD,GD=ZS,qD=ob;function YD(t){return qD(GD(t,void 0,KD),t+"")}var jb=YD,JD=DD,QD=jb,XD=QD(function(t,e){return t==null?{}:JD(t,e)}),ZD=XD;const YX=xe(ZD);var eR="__lodash_hash_undefined__";function tR(t){return this.__data__.set(t,eR),this}var nR=tR;function rR(t){return this.__data__.has(t)}var iR=rR,oR=Uh,sR=nR,lR=iR;function pu(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new oR;++el))return!1;var u=o.get(t),c=o.get(e);if(u&&c)return u==e&&c==t;var f=-1,d=!0,p=n&mR?new fR:void 0;for(o.set(t,e),o.set(e,t);++fe||o&&s&&a&&!l&&!u||r&&s&&a||!n&&a||!i)return 1;if(!r&&!o&&!u&&t=l)return a;var u=n[r];return a*(u=="desc"?-1:1)}}return t.index-e.index}var KB=HB,Mf=Ii,GB=jl,qB=$c,YB=Xb,JB=jB,QB=Zo,XB=KB,ZB=Rl,ez=vt;function tz(t,e,n){e.length?e=Mf(e,function(o){return ez(o)?function(s){return GB(s,o.length===1?o[0]:o)}:o}):e=[ZB];var r=-1;e=Mf(e,QB(qB));var i=YB(t,function(o,s,l){var a=Mf(e,function(u){return u(o)});return{criteria:a,index:++r,value:o}});return JB(i,function(o,s){return XB(o,s,n)})}var nz=tz,rz=lm,iz=nz,oz=qo,xv=Eb,sz=oz(function(t,e){if(t==null)return[];var n=e.length;return n>1&&xv(t,e[0],e[1])?e=[]:n>2&&xv(e[0],e[1],e[2])&&(e=[e[0]]),iz(t,rz(e,1),[])}),lz=sz;const QX=xe(lz);var hu="NOT_FOUND";function az(t){var e;return{get:function(r){return e&&t(e.key,r)?e.value:hu},put:function(r,i){e={key:r,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function uz(t,e){var n=[];function r(l){var a=n.findIndex(function(c){return e(l,c.key)});if(a>-1){var u=n[a];return a>0&&(n.splice(a,1),n.unshift(u)),u.value}return hu}function i(l,a){r(l)===hu&&(n.unshift({key:l,value:a}),n.length>t&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var cz=function(e,n){return e===n};function fz(t){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?e-1:0),r=1;r1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:za;Tv&&Tv(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(pz(e)||(e[r]=o),i=o)}t[i]=!0}return t}function bz(t){for(let e=0;e/gm),Tz=mn(/\${[\w\W]*}/gm),Oz=mn(/^data-[\-\w.\u00B7-\uFFFF]/),$z=mn(/^aria-[\-\w]+$/),sw=mn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kz=mn(/^(?:\w+script|data):/i),Az=mn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lw=mn(/^html$/i);var _v=Object.freeze({__proto__:null,MUSTACHE_EXPR:Cz,ERB_EXPR:xz,TMPLIT_EXPR:Tz,DATA_ATTR:Oz,ARIA_ATTR:$z,IS_ALLOWED_URI:sw,IS_SCRIPT_OR_DATA:kz,ATTR_WHITESPACE:Az,DOCTYPE_NAME:lw});const Pz=function(){return typeof window>"u"?null:window},_z=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function aw(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pz();const e=K=>aw(K);if(e.version="3.0.9",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:a,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:p}=t,h=a.prototype,v=sa(h,"cloneNode"),S=sa(h,"nextSibling"),m=sa(h,"childNodes"),y=sa(h,"parentNode");if(typeof s=="function"){const K=n.createElement("template");K.content&&K.content.ownerDocument&&(n=K.content.ownerDocument)}let g,w="";const{implementation:C,createNodeIterator:x,createDocumentFragment:P,getElementsByTagName:b}=n,{importNode:A}=r;let I={};e.isSupported=typeof iw=="function"&&typeof y=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:M,ERB_EXPR:$,TMPLIT_EXPR:T,DATA_ATTR:k,ARIA_ATTR:U,IS_SCRIPT_OR_DATA:ie,ATTR_WHITESPACE:De}=_v;let{IS_ALLOWED_URI:B}=_v,W=null;const q=Z({},[...$v,...If,...Df,...Rf,...kv]);let Y=null;const ce=Z({},[...Av,...Lf,...Pv,...la]);let L=Object.seal(ow(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Q=null,X=null,Ae=!0,ge=!0,Dn=!1,Sn=!0,Pt=!1,ir=!1,wt=!1,Rn=!1,Li=!1,Zl=!1,ea=!1,ey=!0,ty=!1;const JO="user-content-";let bf=!0,ds=!1,Fi={},Bi=null;const ny=Z({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ry=null;const iy=Z({},["audio","video","img","source","image","track"]);let wf=null;const oy=Z({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ta="http://www.w3.org/1998/Math/MathML",na="http://www.w3.org/2000/svg",Ln="http://www.w3.org/1999/xhtml";let zi=Ln,Ef=!1,Cf=null;const QO=Z({},[ta,na,Ln],Nf);let ps=null;const XO=["application/xhtml+xml","text/html"],ZO="text/html";let Re=null,ji=null;const e$=n.createElement("form"),sy=function(E){return E instanceof RegExp||E instanceof Function},xf=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ji&&ji===E)){if((!E||typeof E!="object")&&(E={}),E=Qr(E),ps=XO.indexOf(E.PARSER_MEDIA_TYPE)===-1?ZO:E.PARSER_MEDIA_TYPE,Re=ps==="application/xhtml+xml"?Nf:za,W=on(E,"ALLOWED_TAGS")?Z({},E.ALLOWED_TAGS,Re):q,Y=on(E,"ALLOWED_ATTR")?Z({},E.ALLOWED_ATTR,Re):ce,Cf=on(E,"ALLOWED_NAMESPACES")?Z({},E.ALLOWED_NAMESPACES,Nf):QO,wf=on(E,"ADD_URI_SAFE_ATTR")?Z(Qr(oy),E.ADD_URI_SAFE_ATTR,Re):oy,ry=on(E,"ADD_DATA_URI_TAGS")?Z(Qr(iy),E.ADD_DATA_URI_TAGS,Re):iy,Bi=on(E,"FORBID_CONTENTS")?Z({},E.FORBID_CONTENTS,Re):ny,Q=on(E,"FORBID_TAGS")?Z({},E.FORBID_TAGS,Re):{},X=on(E,"FORBID_ATTR")?Z({},E.FORBID_ATTR,Re):{},Fi=on(E,"USE_PROFILES")?E.USE_PROFILES:!1,Ae=E.ALLOW_ARIA_ATTR!==!1,ge=E.ALLOW_DATA_ATTR!==!1,Dn=E.ALLOW_UNKNOWN_PROTOCOLS||!1,Sn=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pt=E.SAFE_FOR_TEMPLATES||!1,ir=E.WHOLE_DOCUMENT||!1,Li=E.RETURN_DOM||!1,Zl=E.RETURN_DOM_FRAGMENT||!1,ea=E.RETURN_TRUSTED_TYPE||!1,Rn=E.FORCE_BODY||!1,ey=E.SANITIZE_DOM!==!1,ty=E.SANITIZE_NAMED_PROPS||!1,bf=E.KEEP_CONTENT!==!1,ds=E.IN_PLACE||!1,B=E.ALLOWED_URI_REGEXP||sw,zi=E.NAMESPACE||Ln,L=E.CUSTOM_ELEMENT_HANDLING||{},E.CUSTOM_ELEMENT_HANDLING&&sy(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=E.CUSTOM_ELEMENT_HANDLING.tagNameCheck),E.CUSTOM_ELEMENT_HANDLING&&sy(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pt&&(ge=!1),Zl&&(Li=!0),Fi&&(W=Z({},kv),Y=[],Fi.html===!0&&(Z(W,$v),Z(Y,Av)),Fi.svg===!0&&(Z(W,If),Z(Y,Lf),Z(Y,la)),Fi.svgFilters===!0&&(Z(W,Df),Z(Y,Lf),Z(Y,la)),Fi.mathMl===!0&&(Z(W,Rf),Z(Y,Pv),Z(Y,la))),E.ADD_TAGS&&(W===q&&(W=Qr(W)),Z(W,E.ADD_TAGS,Re)),E.ADD_ATTR&&(Y===ce&&(Y=Qr(Y)),Z(Y,E.ADD_ATTR,Re)),E.ADD_URI_SAFE_ATTR&&Z(wf,E.ADD_URI_SAFE_ATTR,Re),E.FORBID_CONTENTS&&(Bi===ny&&(Bi=Qr(Bi)),Z(Bi,E.FORBID_CONTENTS,Re)),bf&&(W["#text"]=!0),ir&&Z(W,["html","head","body"]),W.table&&(Z(W,["tbody"]),delete Q.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw vs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');g=E.TRUSTED_TYPES_POLICY,w=g.createHTML("")}else g===void 0&&(g=_z(p,i)),g!==null&&typeof w=="string"&&(w=g.createHTML(""));ht&&ht(E),ji=E}},ly=Z({},["mi","mo","mn","ms","mtext"]),ay=Z({},["foreignobject","desc","title","annotation-xml"]),t$=Z({},["title","style","font","a","script"]),uy=Z({},[...If,...Df,...wz]),cy=Z({},[...Rf,...Ez]),n$=function(E){let R=y(E);(!R||!R.tagName)&&(R={namespaceURI:zi,tagName:"template"});const H=za(E.tagName),ye=za(R.tagName);return Cf[E.namespaceURI]?E.namespaceURI===na?R.namespaceURI===Ln?H==="svg":R.namespaceURI===ta?H==="svg"&&(ye==="annotation-xml"||ly[ye]):!!uy[H]:E.namespaceURI===ta?R.namespaceURI===Ln?H==="math":R.namespaceURI===na?H==="math"&&ay[ye]:!!cy[H]:E.namespaceURI===Ln?R.namespaceURI===na&&!ay[ye]||R.namespaceURI===ta&&!ly[ye]?!1:!cy[H]&&(t$[H]||!uy[H]):!!(ps==="application/xhtml+xml"&&Cf[E.namespaceURI]):!1},Kr=function(E){gs(e.removed,{element:E});try{E.parentNode.removeChild(E)}catch{E.remove()}},Tf=function(E,R){try{gs(e.removed,{attribute:R.getAttributeNode(E),from:R})}catch{gs(e.removed,{attribute:null,from:R})}if(R.removeAttribute(E),E==="is"&&!Y[E])if(Li||Zl)try{Kr(R)}catch{}else try{R.setAttribute(E,"")}catch{}},fy=function(E){let R=null,H=null;if(Rn)E=""+E;else{const Ze=gz(E,/^[\r\n\t ]+/);H=Ze&&Ze[0]}ps==="application/xhtml+xml"&&zi===Ln&&(E=''+E+"");const ye=g?g.createHTML(E):E;if(zi===Ln)try{R=new d().parseFromString(ye,ps)}catch{}if(!R||!R.documentElement){R=C.createDocument(zi,"template",null);try{R.documentElement.innerHTML=Ef?w:ye}catch{}}const Xe=R.body||R.documentElement;return E&&H&&Xe.insertBefore(n.createTextNode(H),Xe.childNodes[0]||null),zi===Ln?b.call(R,ir?"html":"body")[0]:ir?R.documentElement:Xe},dy=function(E){return x.call(E.ownerDocument||E,E,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null)},r$=function(E){return E instanceof f&&(typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||!(E.attributes instanceof c)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function")},py=function(E){return typeof l=="function"&&E instanceof l},Fn=function(E,R,H){I[E]&&oa(I[E],ye=>{ye.call(e,R,H,ji)})},hy=function(E){let R=null;if(Fn("beforeSanitizeElements",E,null),r$(E))return Kr(E),!0;const H=Re(E.nodeName);if(Fn("uponSanitizeElement",E,{tagName:H,allowedTags:W}),E.hasChildNodes()&&!py(E.firstElementChild)&&_t(/<[/\w]/g,E.innerHTML)&&_t(/<[/\w]/g,E.textContent))return Kr(E),!0;if(!W[H]||Q[H]){if(!Q[H]&&gy(H)&&(L.tagNameCheck instanceof RegExp&&_t(L.tagNameCheck,H)||L.tagNameCheck instanceof Function&&L.tagNameCheck(H)))return!1;if(bf&&!Bi[H]){const ye=y(E)||E.parentNode,Xe=m(E)||E.childNodes;if(Xe&&ye){const Ze=Xe.length;for(let Et=Ze-1;Et>=0;--Et)ye.insertBefore(v(Xe[Et],!0),S(E))}}return Kr(E),!0}return E instanceof a&&!n$(E)||(H==="noscript"||H==="noembed"||H==="noframes")&&_t(/<\/no(script|embed|frames)/i,E.innerHTML)?(Kr(E),!0):(Pt&&E.nodeType===3&&(R=E.textContent,oa([M,$,T],ye=>{R=ys(R,ye," ")}),E.textContent!==R&&(gs(e.removed,{element:E.cloneNode()}),E.textContent=R)),Fn("afterSanitizeElements",E,null),!1)},my=function(E,R,H){if(ey&&(R==="id"||R==="name")&&(H in n||H in e$))return!1;if(!(ge&&!X[R]&&_t(k,R))){if(!(Ae&&_t(U,R))){if(!Y[R]||X[R]){if(!(gy(E)&&(L.tagNameCheck instanceof RegExp&&_t(L.tagNameCheck,E)||L.tagNameCheck instanceof Function&&L.tagNameCheck(E))&&(L.attributeNameCheck instanceof RegExp&&_t(L.attributeNameCheck,R)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(R))||R==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&_t(L.tagNameCheck,H)||L.tagNameCheck instanceof Function&&L.tagNameCheck(H))))return!1}else if(!wf[R]){if(!_t(B,ys(H,De,""))){if(!((R==="src"||R==="xlink:href"||R==="href")&&E!=="script"&&yz(H,"data:")===0&&ry[E])){if(!(Dn&&!_t(ie,ys(H,De,"")))){if(H)return!1}}}}}}return!0},gy=function(E){return E!=="annotation-xml"&&E.indexOf("-")>0},yy=function(E){Fn("beforeSanitizeAttributes",E,null);const{attributes:R}=E;if(!R)return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};let ye=R.length;for(;ye--;){const Xe=R[ye],{name:Ze,namespaceURI:Et,value:Gr}=Xe,hs=Re(Ze);let Ct=Ze==="value"?Gr:vz(Gr);if(H.attrName=hs,H.attrValue=Ct,H.keepAttr=!0,H.forceKeepAttr=void 0,Fn("uponSanitizeAttribute",E,H),Ct=H.attrValue,H.forceKeepAttr||(Tf(Ze,E),!H.keepAttr))continue;if(!Sn&&_t(/\/>/i,Ct)){Tf(Ze,E);continue}Pt&&oa([M,$,T],Sy=>{Ct=ys(Ct,Sy," ")});const vy=Re(E.nodeName);if(my(vy,hs,Ct)){if(ty&&(hs==="id"||hs==="name")&&(Tf(Ze,E),Ct=JO+Ct),g&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Et)switch(p.getAttributeType(vy,hs)){case"TrustedHTML":{Ct=g.createHTML(Ct);break}case"TrustedScriptURL":{Ct=g.createScriptURL(Ct);break}}try{Et?E.setAttributeNS(Et,Ze,Ct):E.setAttribute(Ze,Ct),Ov(e.removed)}catch{}}}Fn("afterSanitizeAttributes",E,null)},i$=function K(E){let R=null;const H=dy(E);for(Fn("beforeSanitizeShadowDOM",E,null);R=H.nextNode();)Fn("uponSanitizeShadowNode",R,null),!hy(R)&&(R.content instanceof o&&K(R.content),yy(R));Fn("afterSanitizeShadowDOM",E,null)};return e.sanitize=function(K){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=null,H=null,ye=null,Xe=null;if(Ef=!K,Ef&&(K=""),typeof K!="string"&&!py(K))if(typeof K.toString=="function"){if(K=K.toString(),typeof K!="string")throw vs("dirty is not a string, aborting")}else throw vs("toString is not a function");if(!e.isSupported)return K;if(wt||xf(E),e.removed=[],typeof K=="string"&&(ds=!1),ds){if(K.nodeName){const Gr=Re(K.nodeName);if(!W[Gr]||Q[Gr])throw vs("root node is forbidden and cannot be sanitized in-place")}}else if(K instanceof l)R=fy(""),H=R.ownerDocument.importNode(K,!0),H.nodeType===1&&H.nodeName==="BODY"||H.nodeName==="HTML"?R=H:R.appendChild(H);else{if(!Li&&!Pt&&!ir&&K.indexOf("<")===-1)return g&&ea?g.createHTML(K):K;if(R=fy(K),!R)return Li?null:ea?w:""}R&&Rn&&Kr(R.firstChild);const Ze=dy(ds?K:R);for(;ye=Ze.nextNode();)hy(ye)||(ye.content instanceof o&&i$(ye.content),yy(ye));if(ds)return K;if(Li){if(Zl)for(Xe=P.call(R.ownerDocument);R.firstChild;)Xe.appendChild(R.firstChild);else Xe=R;return(Y.shadowroot||Y.shadowrootmode)&&(Xe=A.call(r,Xe,!0)),Xe}let Et=ir?R.outerHTML:R.innerHTML;return ir&&W["!doctype"]&&R.ownerDocument&&R.ownerDocument.doctype&&R.ownerDocument.doctype.name&&_t(lw,R.ownerDocument.doctype.name)&&(Et=" +`+Et),Pt&&oa([M,$,T],Gr=>{Et=ys(Et,Gr," ")}),g&&ea?g.createHTML(Et):Et},e.setConfig=function(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xf(K),wt=!0},e.clearConfig=function(){ji=null,wt=!1},e.isValidAttribute=function(K,E,R){ji||xf({});const H=Re(K),ye=Re(E);return my(H,ye,R)},e.addHook=function(K,E){typeof E=="function"&&(I[K]=I[K]||[],gs(I[K],E))},e.removeHook=function(K){if(I[K])return Ov(I[K])},e.removeHooks=function(K){I[K]&&(I[K]=[])},e.removeAllHooks=function(){I={}},e}var kc=aw();let aa;const Mz=new Uint8Array(16);function Nz(){if(!aa&&(aa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!aa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return aa(Mz)}const He=[];for(let t=0;t<256;++t)He.push((t+256).toString(16).slice(1));function Iz(t,e=0){return He[t[e+0]]+He[t[e+1]]+He[t[e+2]]+He[t[e+3]]+"-"+He[t[e+4]]+He[t[e+5]]+"-"+He[t[e+6]]+He[t[e+7]]+"-"+He[t[e+8]]+He[t[e+9]]+"-"+He[t[e+10]]+He[t[e+11]]+He[t[e+12]]+He[t[e+13]]+He[t[e+14]]+He[t[e+15]]}const Dz=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Mv={randomUUID:Dz};function eZ(t,e,n){if(Mv.randomUUID&&!e&&!t)return Mv.randomUUID();t=t||{};const r=t.random||(t.rng||Nz)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return Iz(r)}function Rz(t){for(var e=[],n=0;n=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||s===95){i+=t[o++];continue}break}if(!i)throw new TypeError("Missing parameter name at ".concat(n));e.push({type:"NAME",index:n,value:i}),n=o;continue}if(r==="("){var l=1,a="",o=n+1;if(t[o]==="?")throw new TypeError('Pattern cannot start with "?" at '.concat(o));for(;o)?(?!\?)/g,r=0,i=n.exec(t.source);i;)e.push({name:i[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),i=n.exec(t.source);return t}function jz(t,e,n){var r=t.map(function(i){return cw(i,e,n).source});return new RegExp("(?:".concat(r.join("|"),")"),dm(n))}function Uz(t,e,n){return Wz(uw(t,n),e,n)}function Wz(t,e,n){n===void 0&&(n={});for(var r=n.strict,i=r===void 0?!1:r,o=n.start,s=o===void 0?!0:o,l=n.end,a=l===void 0?!0:l,u=n.encode,c=u===void 0?function(I){return I}:u,f=n.delimiter,d=f===void 0?"/#?":f,p=n.endsWith,h=p===void 0?"":p,v="[".concat(Ji(h),"]|$"),S="[".concat(Ji(d),"]"),m=s?"^":"",y=0,g=t;y-1:b===void 0;i||(m+="(?:".concat(S,"(?=").concat(v,"))?")),A||(m+="(?=".concat(S,"|").concat(v,")"))}return new RegExp(m,dm(n))}function cw(t,e,n){return t instanceof RegExp?zz(t,e):Array.isArray(t)?jz(t,e,n):Uz(t,e,n)}/*! Universal Router | MIT License | https://www.kriasoft.com/universal-router/ */function Vz(t){try{return decodeURIComponent(t)}catch{return t}}function fw(t,e,n,r,i){var o,s,l=0;return{next:function(u){if(t===u)return{done:!0,value:!1};if(!o){var c=t,f=!c.children;if(c.match||(c.match=Fz(c.path||"",Object.assign({end:f},n))),o=c.match(r),o){var d=o,p=d.path;return o.path=!f&&p.charAt(p.length-1)==="/"?p.substr(1):p,o.params=Object.assign({},i,o.params),{done:!1,value:{route:t,baseUrl:e,path:o.path,params:o.params}}}}if(o&&t.children)for(;l"u"||!Fe?ee:Fe(Uint8Array),ci={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ee:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ee:ArrayBuffer,"%ArrayIteratorPrototype%":Ui&&Fe?Fe([][Symbol.iterator]()):ee,"%AsyncFromSyncIteratorPrototype%":ee,"%AsyncFunction%":Qi,"%AsyncGenerator%":Qi,"%AsyncGeneratorFunction%":Qi,"%AsyncIteratorPrototype%":Qi,"%Atomics%":typeof Atomics>"u"?ee:Atomics,"%BigInt%":typeof BigInt>"u"?ee:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ee:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ee:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ee:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":m6,"%eval%":eval,"%EvalError%":g6,"%Float32Array%":typeof Float32Array>"u"?ee:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ee:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ee:FinalizationRegistry,"%Function%":hw,"%GeneratorFunction%":Qi,"%Int8Array%":typeof Int8Array>"u"?ee:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ee:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ee:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ui&&Fe?Fe(Fe([][Symbol.iterator]())):ee,"%JSON%":typeof JSON=="object"?JSON:ee,"%Map%":typeof Map>"u"?ee:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ui||!Fe?ee:Fe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ee:Promise,"%Proxy%":typeof Proxy>"u"?ee:Proxy,"%RangeError%":y6,"%ReferenceError%":v6,"%Reflect%":typeof Reflect>"u"?ee:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ee:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ui||!Fe?ee:Fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ee:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ui&&Fe?Fe(""[Symbol.iterator]()):ee,"%Symbol%":Ui?Symbol:ee,"%SyntaxError%":Po,"%ThrowTypeError%":b6,"%TypedArray%":E6,"%TypeError%":go,"%Uint8Array%":typeof Uint8Array>"u"?ee:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ee:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ee:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ee:Uint32Array,"%URIError%":S6,"%WeakMap%":typeof WeakMap>"u"?ee:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ee:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ee:WeakSet};if(Fe)try{null.error}catch(t){var C6=Fe(Fe(t));ci["%Error.prototype%"]=C6}var x6=function t(e){var n;if(e==="%AsyncFunction%")n=Bf("async function () {}");else if(e==="%GeneratorFunction%")n=Bf("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=Bf("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Fe&&(n=Fe(i.prototype))}return ci[e]=n,n},Dv={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Wl=pm,mu=h6,T6=Wl.call(Function.call,Array.prototype.concat),O6=Wl.call(Function.apply,Array.prototype.splice),Rv=Wl.call(Function.call,String.prototype.replace),gu=Wl.call(Function.call,String.prototype.slice),$6=Wl.call(Function.call,RegExp.prototype.exec),k6=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A6=/\\(\\)?/g,P6=function(e){var n=gu(e,0,1),r=gu(e,-1);if(n==="%"&&r!=="%")throw new Po("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Po("invalid intrinsic syntax, expected opening `%`");var i=[];return Rv(e,k6,function(o,s,l,a){i[i.length]=l?Rv(a,A6,"$1"):s||o}),i},_6=function(e,n){var r=e,i;if(mu(Dv,r)&&(i=Dv[r],r="%"+i[0]+"%"),mu(ci,r)){var o=ci[r];if(o===Qi&&(o=x6(r)),typeof o>"u"&&!n)throw new go("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Po("intrinsic "+e+" does not exist!")},ss=function(e,n){if(typeof e!="string"||e.length===0)throw new go("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new go('"allowMissing" argument must be a boolean');if($6(/^%?[^%]*%?$/,e)===null)throw new Po("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=P6(e),i=r.length>0?r[0]:"",o=_6("%"+i+"%",n),s=o.name,l=o.value,a=!1,u=o.alias;u&&(i=u[0],O6(r,T6([0,1],u)));for(var c=1,f=!0;c=r.length){var v=ui(l,d);f=!!v,f&&"get"in v&&!("originalValue"in v.get)?l=v.get:l=l[d]}else f=mu(l,d),l=l[d];f&&!a&&(ci[s]=l)}}return l},mw={exports:{}},jf,Lv;function hm(){if(Lv)return jf;Lv=1;var t=ss,e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return jf=e,jf}var M6=ss,ja=M6("%Object.getOwnPropertyDescriptor%",!0);if(ja)try{ja([],"length")}catch{ja=null}var gw=ja,Fv=hm(),N6=pw,Wi=Ul,Bv=gw,I6=function(e,n,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Wi("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new Wi("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Wi("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Wi("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Wi("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Wi("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,a=!!Bv&&Bv(e,n);if(Fv)Fv(e,n,{configurable:s===null&&a?a.configurable:!s,enumerable:i===null&&a?a.enumerable:!i,value:r,writable:o===null&&a?a.writable:!o});else if(l||!i&&!o&&!s)e[n]=r;else throw new N6("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},cp=hm(),yw=function(){return!!cp};yw.hasArrayLengthDefineBug=function(){if(!cp)return null;try{return cp([],"length",{value:1}).length!==1}catch{return!0}};var D6=yw,R6=ss,zv=I6,L6=D6(),jv=gw,Uv=Ul,F6=R6("%Math.floor%"),B6=function(e,n){if(typeof e!="function")throw new Uv("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||F6(n)!==n)throw new Uv("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&jv){var s=jv(e,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(o=!1)}return(i||o||!r)&&(L6?zv(e,"length",n,!0,!0):zv(e,"length",n)),e};(function(t){var e=pm,n=ss,r=B6,i=Ul,o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||e.call(s,o),a=hm(),u=n("%Math.max%");t.exports=function(d){if(typeof d!="function")throw new i("a function is required");var p=l(e,s,arguments);return r(p,1+u(0,d.length-(arguments.length-1)),!0)};var c=function(){return l(e,o,arguments)};a?a(t.exports,"apply",{value:c}):t.exports.apply=c})(mw);var z6=mw.exports,vw=ss,Sw=z6,j6=Sw(vw("String.prototype.indexOf")),U6=function(e,n){var r=vw(e,!!n);return typeof r=="function"&&j6(e,".prototype.")>-1?Sw(r):r};const W6={},V6=Object.freeze(Object.defineProperty({__proto__:null,default:W6},Symbol.toStringTag,{value:"Module"})),H6=o$(V6);var mm=typeof Map=="function"&&Map.prototype,Uf=Object.getOwnPropertyDescriptor&&mm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,yu=mm&&Uf&&typeof Uf.get=="function"?Uf.get:null,Wv=mm&&Map.prototype.forEach,gm=typeof Set=="function"&&Set.prototype,Wf=Object.getOwnPropertyDescriptor&&gm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,vu=gm&&Wf&&typeof Wf.get=="function"?Wf.get:null,Vv=gm&&Set.prototype.forEach,K6=typeof WeakMap=="function"&&WeakMap.prototype,Fs=K6?WeakMap.prototype.has:null,G6=typeof WeakSet=="function"&&WeakSet.prototype,Bs=G6?WeakSet.prototype.has:null,q6=typeof WeakRef=="function"&&WeakRef.prototype,Hv=q6?WeakRef.prototype.deref:null,Y6=Boolean.prototype.valueOf,J6=Object.prototype.toString,Q6=Function.prototype.toString,X6=String.prototype.match,ym=String.prototype.slice,gr=String.prototype.replace,Z6=String.prototype.toUpperCase,Kv=String.prototype.toLowerCase,bw=RegExp.prototype.test,Gv=Array.prototype.concat,xn=Array.prototype.join,e4=Array.prototype.slice,qv=Math.floor,fp=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Vf=Object.getOwnPropertySymbols,dp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,_o=typeof Symbol=="function"&&typeof Symbol.iterator=="object",lt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===_o||!0)?Symbol.toStringTag:null,ww=Object.prototype.propertyIsEnumerable,Yv=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Jv(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||bw.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-qv(-t):qv(t);if(r!==t){var i=String(r),o=ym.call(e,i.length+1);return gr.call(i,n,"$&_")+"."+gr.call(gr.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return gr.call(e,n,"$&_")}var pp=H6,Qv=pp.custom,Xv=Cw(Qv)?Qv:null,t4=function t(e,n,r,i){var o=n||{};if(lr(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(lr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=lr(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(lr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(lr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Tw(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return l?Jv(e,a):a}if(typeof e=="bigint"){var u=String(e)+"n";return l?Jv(e,u):u}var c=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=c&&c>0&&typeof e=="object")return hp(e)?"[Array]":"[Object]";var f=S4(o,r);if(typeof i>"u")i=[];else if(xw(i,e)>=0)return"[Circular]";function d(T,k,U){if(k&&(i=e4.call(i),i.push(k)),U){var ie={depth:o.depth};return lr(o,"quoteStyle")&&(ie.quoteStyle=o.quoteStyle),t(T,ie,r+1,i)}return t(T,o,r+1,i)}if(typeof e=="function"&&!Zv(e)){var p=c4(e),h=ua(e,d);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(h.length>0?" { "+xn.call(h,", ")+" }":"")}if(Cw(e)){var v=_o?gr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):dp.call(e);return typeof e=="object"&&!_o?Ss(v):v}if(g4(e)){for(var S="<"+Kv.call(String(e.nodeName)),m=e.attributes||[],y=0;y",S}if(hp(e)){if(e.length===0)return"[]";var g=ua(e,d);return f&&!v4(g)?"["+mp(g,f)+"]":"[ "+xn.call(g,", ")+" ]"}if(i4(e)){var w=ua(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!ww.call(e,"cause")?"{ ["+String(e)+"] "+xn.call(Gv.call("[cause]: "+d(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+xn.call(w,", ")+" }"}if(typeof e=="object"&&s){if(Xv&&typeof e[Xv]=="function"&&pp)return pp(e,{depth:c-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(f4(e)){var C=[];return Wv&&Wv.call(e,function(T,k){C.push(d(k,e,!0)+" => "+d(T,e))}),e0("Map",yu.call(e),C,f)}if(h4(e)){var x=[];return Vv&&Vv.call(e,function(T){x.push(d(T,e))}),e0("Set",vu.call(e),x,f)}if(d4(e))return Hf("WeakMap");if(m4(e))return Hf("WeakSet");if(p4(e))return Hf("WeakRef");if(s4(e))return Ss(d(Number(e)));if(a4(e))return Ss(d(fp.call(e)));if(l4(e))return Ss(Y6.call(e));if(o4(e))return Ss(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===Tn)return"{ [object globalThis] }";if(!r4(e)&&!Zv(e)){var P=ua(e,d),b=Yv?Yv(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",I=!b&<&&Object(e)===e&< in e?ym.call(jr(e),8,-1):A?"Object":"",M=b||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",$=M+(I||A?"["+xn.call(Gv.call([],I||[],A||[]),": ")+"] ":"");return P.length===0?$+"{}":f?$+"{"+mp(P,f)+"}":$+"{ "+xn.call(P,", ")+" }"}return String(e)};function Ew(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function n4(t){return gr.call(String(t),/"/g,""")}function hp(t){return jr(t)==="[object Array]"&&(!lt||!(typeof t=="object"&< in t))}function r4(t){return jr(t)==="[object Date]"&&(!lt||!(typeof t=="object"&< in t))}function Zv(t){return jr(t)==="[object RegExp]"&&(!lt||!(typeof t=="object"&< in t))}function i4(t){return jr(t)==="[object Error]"&&(!lt||!(typeof t=="object"&< in t))}function o4(t){return jr(t)==="[object String]"&&(!lt||!(typeof t=="object"&< in t))}function s4(t){return jr(t)==="[object Number]"&&(!lt||!(typeof t=="object"&< in t))}function l4(t){return jr(t)==="[object Boolean]"&&(!lt||!(typeof t=="object"&< in t))}function Cw(t){if(_o)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!dp)return!1;try{return dp.call(t),!0}catch{}return!1}function a4(t){if(!t||typeof t!="object"||!fp)return!1;try{return fp.call(t),!0}catch{}return!1}var u4=Object.prototype.hasOwnProperty||function(t){return t in this};function lr(t,e){return u4.call(t,e)}function jr(t){return J6.call(t)}function c4(t){if(t.name)return t.name;var e=X6.call(Q6.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function xw(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;ne.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Tw(ym.call(t,0,e.maxStringLength),e)+r}var i=gr.call(gr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,y4);return Ew(i,"single",e)}function y4(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+Z6.call(e.toString(16))}function Ss(t){return"Object("+t+")"}function Hf(t){return t+" { ? }"}function e0(t,e,n,r){var i=r?mp(n,r):xn.call(n,", ");return t+" ("+e+") {"+i+"}"}function v4(t){for(var e=0;e=0)return!1;return!0}function S4(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=xn.call(Array(t.indent+1)," ");else return null;return{base:n,prev:xn.call(Array(e+1),n)}}function mp(t,e){if(t.length===0)return"";var n=` +`+e.prev+e.base;return n+xn.call(t,","+n)+` +`+e.prev}function ua(t,e){var n=hp(t),r=[];if(n){r.length=t.length;for(var i=0;i1;){var n=e.pop(),r=n.obj[n.prop];if(ti(r)){for(var i=[],o=0;o=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===I4.RFC1738&&(u===40||u===41)){l+=s.charAt(a);continue}if(u<128){l=l+bn[u];continue}if(u<2048){l=l+(bn[192|u>>6]+bn[128|u&63]);continue}if(u<55296||u>=57344){l=l+(bn[224|u>>12]+bn[128|u>>6&63]+bn[128|u&63]);continue}a+=1,u=65536+((u&1023)<<10|s.charCodeAt(a)&1023),l+=bn[240|u>>18]+bn[128|u>>12&63]+bn[128|u>>6&63]+bn[128|u&63]}return l},z4=function(e){for(var n=[{obj:{o:e},prop:"o"}],r=[],i=0;i"u"&&(g=0)}if(typeof a=="function"?m=a(n,m):m instanceof Date?m=f(m):r==="comma"&&Vn(m)&&(m=Ua.maybeMap(m,function(ie){return ie instanceof Date?f(ie):ie})),m===null){if(o)return l&&!h?l(n,nt.encoder,v,"key",d):n;m=""}if(q4(m)||Ua.isBuffer(m)){if(l){var x=h?n:l(n,nt.encoder,v,"key",d);return[p(x)+"="+p(l(m,nt.encoder,v,"value",d))]}return[p(n)+"="+p(String(m))]}var P=[];if(typeof m>"u")return P;var b;if(r==="comma"&&Vn(m))h&&l&&(m=Ua.maybeMap(m,l)),b=[{value:m.length>0?m.join(",")||null:void 0}];else if(Vn(a))b=a;else{var A=Object.keys(m);b=u?A.sort(u):A}for(var I=i&&Vn(m)&&m.length===1?n+"[]":n,M=0;M"u"?nt.allowDots:!!e.allowDots,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:nt.charsetSentinel,delimiter:typeof e.delimiter>"u"?nt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:nt.encode,encoder:typeof e.encoder=="function"?e.encoder:nt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:nt.encodeValuesOnly,filter:o,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:nt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:nt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:nt.strictNullHandling}},Q4=function(t,e){var n=t,r=J4(e),i,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):Vn(r.filter)&&(o=r.filter,i=o);var s=[];if(typeof n!="object"||n===null)return"";var l;e&&e.arrayFormat in t0?l=e.arrayFormat:e&&"indices"in e?l=e.indices?"indices":"repeat":l="indices";var a=t0[l];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=a==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(n)),r.sort&&i.sort(r.sort);for(var c=Aw(),f=0;f0?h+p:""},Mo=kw,gp=Object.prototype.hasOwnProperty,X4=Array.isArray,Le={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Mo.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Z4=function(t){return t.replace(/&#(\d+);/g,function(e,n){return String.fromCharCode(parseInt(n,10))})},_w=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},e5="utf8=%26%2310003%3B",t5="utf8=%E2%9C%93",n5=function(e,n){var r={__proto__:null},i=n.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=n.parameterLimit===1/0?void 0:n.parameterLimit,s=i.split(n.delimiter,o),l=-1,a,u=n.charset;if(n.charsetSentinel)for(a=0;a-1&&(h=X4(h)?[h]:h),gp.call(r,p)?r[p]=Mo.combine(r[p],h):r[p]=h}return r},r5=function(t,e,n,r){for(var i=r?e:_w(e,n),o=t.length-1;o>=0;--o){var s,l=t[o];if(l==="[]"&&n.parseArrays)s=[].concat(i);else{s=n.plainObjects?Object.create(null):{};var a=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,u=parseInt(a,10);!n.parseArrays&&a===""?s={0:i}:!isNaN(u)&&l!==a&&String(u)===a&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(s=[],s[u]=i):a!=="__proto__"&&(s[a]=i)}i=s}return i},i5=function(e,n,r,i){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,a=r.depth>0&&s.exec(o),u=a?o.slice(0,a.index):o,c=[];if(u){if(!r.plainObjects&&gp.call(Object.prototype,u)&&!r.allowPrototypes)return;c.push(u)}for(var f=0;r.depth>0&&(a=l.exec(o))!==null&&f"u"?Le.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Le.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Le.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Le.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Le.arrayLimit,charset:n,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Le.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Le.comma,decoder:typeof e.decoder=="function"?e.decoder:Le.decoder,delimiter:typeof e.delimiter=="string"||Mo.isRegExp(e.delimiter)?e.delimiter:Le.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Le.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Le.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Le.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Le.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Le.strictNullHandling}},s5=function(t,e){var n=o5(e);if(t===""||t===null||typeof t>"u")return n.plainObjects?Object.create(null):{};for(var r=typeof t=="string"?n5(t,n):t,i=n.plainObjects?Object.create(null):{},o=Object.keys(r),s=0;s>>1,ce=B[Y];if(0>>1;Yi(X,q))Aei(ge,X)?(B[Y]=ge,B[Ae]=q,Y=Ae):(B[Y]=X,B[Q]=q,Y=Q);else if(Aei(ge,q))B[Y]=ge,B[Ae]=q,Y=Ae;else break e}}return W}function i(B,W){var q=B.sortIndex-W.sortIndex;return q!==0?q:B.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,f=null,d=3,p=!1,h=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(B){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=B)r(u),W.sortIndex=W.expirationTime,e(a,W);else break;W=n(u)}}function w(B){if(v=!1,g(B),!h)if(n(a)!==null)h=!0,ie(C);else{var W=n(u);W!==null&&De(w,W.startTime-B)}}function C(B,W){h=!1,v&&(v=!1,m(b),b=-1),p=!0;var q=d;try{for(g(W),f=n(a);f!==null&&(!(f.expirationTime>W)||B&&!M());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,d=f.priorityLevel;var ce=Y(f.expirationTime<=W);W=t.unstable_now(),typeof ce=="function"?f.callback=ce:f===n(a)&&r(a),g(W)}else r(a);f=n(a)}if(f!==null)var L=!0;else{var Q=n(u);Q!==null&&De(w,Q.startTime-W),L=!1}return L}finally{f=null,d=q,p=!1}}var x=!1,P=null,b=-1,A=5,I=-1;function M(){return!(t.unstable_now()-IB||125Y?(B.sortIndex=q,e(u,B),n(a)===null&&B===n(u)&&(v?(m(b),b=-1):v=!0,De(w,q-Y))):(B.sortIndex=ce,e(a,B),h||p||(h=!0,ie(C))),B},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(B){var W=d;return function(){var q=d;d=W;try{return B.apply(this,arguments)}finally{d=q}}}})(Vw);Ww.exports=Vw;var M5=Ww.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Hw=_,jt=M5;function D(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yp=Object.prototype.hasOwnProperty,N5=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,s0={},l0={};function I5(t){return yp.call(l0,t)?!0:yp.call(s0,t)?!1:N5.test(t)?l0[t]=!0:(s0[t]=!0,!1)}function D5(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function R5(t,e,n,r){if(e===null||typeof e>"u"||D5(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function bt(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Qe[t]=new bt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Qe[e]=new bt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Qe[t]=new bt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Qe[t]=new bt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Qe[t]=new bt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Qe[t]=new bt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Qe[t]=new bt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Qe[t]=new bt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Qe[t]=new bt(t,5,!1,t.toLowerCase(),null,!1,!1)});var xm=/[\-:]([a-z])/g;function Tm(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(xm,Tm);Qe[e]=new bt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(xm,Tm);Qe[e]=new bt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(xm,Tm);Qe[e]=new bt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Qe[t]=new bt(t,1,!1,t.toLowerCase(),null,!1,!1)});Qe.xlinkHref=new bt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Qe[t]=new bt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Om(t,e,n,r){var i=Qe.hasOwnProperty(e)?Qe[e]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var a=` +`+i[s].replace(" at new "," at ");return t.displayName&&a.includes("")&&(a=a.replace("",t.displayName)),a}while(1<=s&&0<=l);break}}}finally{Qf=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ps(t):""}function L5(t){switch(t.tag){case 5:return Ps(t.type);case 16:return Ps("Lazy");case 13:return Ps("Suspense");case 19:return Ps("SuspenseList");case 0:case 2:case 15:return t=Xf(t.type,!1),t;case 11:return t=Xf(t.type.render,!1),t;case 1:return t=Xf(t.type,!0),t;default:return""}}function wp(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ro:return"Fragment";case no:return"Portal";case vp:return"Profiler";case $m:return"StrictMode";case Sp:return"Suspense";case bp:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case qw:return(t.displayName||"Context")+".Consumer";case Gw:return(t._context.displayName||"Context")+".Provider";case km:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Am:return e=t.displayName||null,e!==null?e:wp(t.type)||"Memo";case ar:e=t._payload,t=t._init;try{return wp(t(e))}catch{}}return null}function F5(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return wp(e);case 8:return e===$m?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Rr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Jw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function B5(t){var e=Jw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ha(t){t._valueTracker||(t._valueTracker=B5(t))}function Qw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Jw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Su(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Ep(t,e){var n=e.checked;return $e({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function u0(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Rr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Xw(t,e){e=e.checked,e!=null&&Om(t,"checked",e,!1)}function Cp(t,e){Xw(t,e);var n=Rr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?xp(t,e.type,n):e.hasOwnProperty("defaultValue")&&xp(t,e.type,Rr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function c0(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function xp(t,e,n){(e!=="number"||Su(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var _s=Array.isArray;function yo(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=ma.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function ll(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var js={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},z5=["Webkit","ms","Moz","O"];Object.keys(js).forEach(function(t){z5.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),js[e]=js[t]})});function nE(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||js.hasOwnProperty(t)&&js[t]?(""+e).trim():e+"px"}function rE(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=nE(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var j5=$e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $p(t,e){if(e){if(j5[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(D(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(D(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(D(61))}if(e.style!=null&&typeof e.style!="object")throw Error(D(62))}}function kp(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ap=null;function Pm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Pp=null,vo=null,So=null;function p0(t){if(t=Gl(t)){if(typeof Pp!="function")throw Error(D(280));var e=t.stateNode;e&&(e=Ic(e),Pp(t.stateNode,t.type,e))}}function iE(t){vo?So?So.push(t):So=[t]:vo=t}function oE(){if(vo){var t=vo,e=So;if(So=vo=null,p0(t),e)for(t=0;t>>=0,t===0?32:31-(X5(t)/Z5|0)|0}var ga=64,ya=4194304;function Ms(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Cu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Ms(l):(o&=s,o!==0&&(r=Ms(o)))}else s=n&~i,s!==0?r=Ms(s):o!==0&&(r=Ms(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Hl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-pn(e),t[e]=n}function r8(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Ws),E0=" ",C0=!1;function TE(t,e){switch(t){case"keyup":return _8.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function OE(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var io=!1;function N8(t,e){switch(t){case"compositionend":return OE(e);case"keypress":return e.which!==32?null:(C0=!0,E0);case"textInput":return t=e.data,t===E0&&C0?null:t;default:return null}}function I8(t,e){if(io)return t==="compositionend"||!Fm&&TE(t,e)?(t=CE(),Ka=Dm=yr=null,io=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$0(n)}}function PE(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?PE(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function _E(){for(var t=window,e=Su();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Su(t.document)}return e}function Bm(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function W8(t){var e=_E(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&PE(n.ownerDocument.documentElement,n)){if(r!==null&&Bm(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=k0(n,o);var s=k0(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,oo=null,Rp=null,Hs=null,Lp=!1;function A0(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lp||oo==null||oo!==Su(r)||(r=oo,"selectionStart"in r&&Bm(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hs&&pl(Hs,r)||(Hs=r,r=Ou(Rp,"onSelect"),0ao||(t.current=Wp[ao],Wp[ao]=null,ao--)}function Se(t,e){ao++,Wp[ao]=t.current,t.current=e}var Lr={},at=Wr(Lr),Ot=Wr(!1),Ei=Lr;function Io(t,e){var n=t.type.contextTypes;if(!n)return Lr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function $t(t){return t=t.childContextTypes,t!=null}function ku(){Ee(Ot),Ee(at)}function R0(t,e,n){if(at.current!==Lr)throw Error(D(168));Se(at,e),Se(Ot,n)}function zE(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(D(108,F5(t)||"Unknown",i));return $e({},n,r)}function Au(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Lr,Ei=at.current,Se(at,t),Se(Ot,Ot.current),!0}function L0(t,e,n){var r=t.stateNode;if(!r)throw Error(D(169));n?(t=zE(t,e,Ei),r.__reactInternalMemoizedMergedChildContext=t,Ee(Ot),Ee(at),Se(at,t)):Ee(Ot),Se(Ot,n)}var Hn=null,Dc=!1,dd=!1;function jE(t){Hn===null?Hn=[t]:Hn.push(t)}function t7(t){Dc=!0,jE(t)}function Vr(){if(!dd&&Hn!==null){dd=!0;var t=0,e=de;try{var n=Hn;for(de=1;t>=s,i-=s,Gn=1<<32-pn(e)+i|n<b?(A=P,P=null):A=P.sibling;var I=d(m,P,g[b],w);if(I===null){P===null&&(P=A);break}t&&P&&I.alternate===null&&e(m,P),y=o(I,y,b),x===null?C=I:x.sibling=I,x=I,P=A}if(b===g.length)return n(m,P),Ce&&Xr(m,b),C;if(P===null){for(;bb?(A=P,P=null):A=P.sibling;var M=d(m,P,I.value,w);if(M===null){P===null&&(P=A);break}t&&P&&M.alternate===null&&e(m,P),y=o(M,y,b),x===null?C=M:x.sibling=M,x=M,P=A}if(I.done)return n(m,P),Ce&&Xr(m,b),C;if(P===null){for(;!I.done;b++,I=g.next())I=f(m,I.value,w),I!==null&&(y=o(I,y,b),x===null?C=I:x.sibling=I,x=I);return Ce&&Xr(m,b),C}for(P=r(m,P);!I.done;b++,I=g.next())I=p(P,m,b,I.value,w),I!==null&&(t&&I.alternate!==null&&P.delete(I.key===null?b:I.key),y=o(I,y,b),x===null?C=I:x.sibling=I,x=I);return t&&P.forEach(function($){return e(m,$)}),Ce&&Xr(m,b),C}function S(m,y,g,w){if(typeof g=="object"&&g!==null&&g.type===ro&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case pa:e:{for(var C=g.key,x=y;x!==null;){if(x.key===C){if(C=g.type,C===ro){if(x.tag===7){n(m,x.sibling),y=i(x,g.props.children),y.return=m,m=y;break e}}else if(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ar&&V0(C)===x.type){n(m,x.sibling),y=i(x,g.props),y.ref=Ts(m,x,g),y.return=m,m=y;break e}n(m,x);break}else e(m,x);x=x.sibling}g.type===ro?(y=di(g.props.children,m.mode,w,g.key),y.return=m,m=y):(w=eu(g.type,g.key,g.props,null,m.mode,w),w.ref=Ts(m,y,g),w.return=m,m=w)}return s(m);case no:e:{for(x=g.key;y!==null;){if(y.key===x)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(m,y.sibling),y=i(y,g.children||[]),y.return=m,m=y;break e}else{n(m,y);break}else e(m,y);y=y.sibling}y=bd(g,m.mode,w),y.return=m,m=y}return s(m);case ar:return x=g._init,S(m,y,x(g._payload),w)}if(_s(g))return h(m,y,g,w);if(bs(g))return v(m,y,g,w);xa(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(m,y.sibling),y=i(y,g),y.return=m,m=y):(n(m,y),y=Sd(g,m.mode,w),y.return=m,m=y),s(m)):n(m,y)}return S}var Ro=YE(!0),JE=YE(!1),ql={},_n=Wr(ql),yl=Wr(ql),vl=Wr(ql);function oi(t){if(t===ql)throw Error(D(174));return t}function qm(t,e){switch(Se(vl,e),Se(yl,t),Se(_n,ql),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Op(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Op(e,t)}Ee(_n),Se(_n,e)}function Lo(){Ee(_n),Ee(yl),Ee(vl)}function QE(t){oi(vl.current);var e=oi(_n.current),n=Op(e,t.type);e!==n&&(Se(yl,t),Se(_n,n))}function Ym(t){yl.current===t&&(Ee(_n),Ee(yl))}var Te=Wr(0);function Du(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var pd=[];function Jm(){for(var t=0;tn?n:4,t(!0);var r=hd.transition;hd.transition={};try{t(!1),e()}finally{de=n,hd.transition=r}}function pC(){return en().memoizedState}function o7(t,e,n){var r=kr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},hC(t))mC(e,n);else if(n=HE(t,e,n,r),n!==null){var i=pt();hn(n,t,r,i),gC(n,e,r)}}function s7(t,e,n){var r=kr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(hC(t))mC(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,gn(l,s)){var a=e.interleaved;a===null?(i.next=i,Km(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}n=HE(t,e,i,r),n!==null&&(i=pt(),hn(n,t,r,i),gC(n,e,r))}}function hC(t){var e=t.alternate;return t===Oe||e!==null&&e===Oe}function mC(t,e){Ks=Ru=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function gC(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Mm(t,n)}}var Lu={readContext:Zt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},l7={readContext:Zt,useCallback:function(t,e){return En().memoizedState=[t,e===void 0?null:e],t},useContext:Zt,useEffect:K0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Ja(4194308,4,aC.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Ja(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ja(4,2,t,e)},useMemo:function(t,e){var n=En();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=En();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=o7.bind(null,Oe,t),[r.memoizedState,t]},useRef:function(t){var e=En();return t={current:t},e.memoizedState=t},useState:H0,useDebugValue:tg,useDeferredValue:function(t){return En().memoizedState=t},useTransition:function(){var t=H0(!1),e=t[0];return t=i7.bind(null,t[1]),En().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Oe,i=En();if(Ce){if(n===void 0)throw Error(D(407));n=n()}else{if(n=e(),je===null)throw Error(D(349));xi&30||eC(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,K0(nC.bind(null,r,o,t),[t]),r.flags|=2048,wl(9,tC.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=En(),e=je.identifierPrefix;if(Ce){var n=qn,r=Gn;n=(r&~(1<<32-pn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Sl++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[On]=e,t[gl]=r,TC(t,e,!1,!1),e.stateNode=t;e:{switch(s=kp(n,r),n){case"dialog":be("cancel",t),be("close",t),i=r;break;case"iframe":case"object":case"embed":be("load",t),i=r;break;case"video":case"audio":for(i=0;iBo&&(e.flags|=128,r=!0,Os(o,!1),e.lanes=4194304)}else{if(!r)if(t=Du(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Os(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ce)return tt(e),null}else 2*Pe()-o.renderingStartTime>Bo&&n!==1073741824&&(e.flags|=128,r=!0,Os(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Pe(),e.sibling=null,n=Te.current,Se(Te,r?n&1|2:n&1),e):(tt(e),null);case 22:case 23:return lg(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Mt&1073741824&&(tt(e),e.subtreeFlags&6&&(e.flags|=8192)):tt(e),null;case 24:return null;case 25:return null}throw Error(D(156,e.tag))}function m7(t,e){switch(jm(e),e.tag){case 1:return $t(e.type)&&ku(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Lo(),Ee(Ot),Ee(at),Jm(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Ym(e),null;case 13:if(Ee(Te),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(D(340));Do()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ee(Te),null;case 4:return Lo(),null;case 10:return Hm(e.type._context),null;case 22:case 23:return lg(),null;case 24:return null;default:return null}}var Oa=!1,it=!1,g7=typeof WeakSet=="function"?WeakSet:Set,j=null;function po(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ke(t,e,r)}else n.current=null}function th(t,e,n){try{n()}catch(r){ke(t,e,r)}}var t1=!1;function y7(t,e){if(Fp=xu,t=_E(),Bm(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,f=t,d=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(l=s+i),f!==o||r!==0&&f.nodeType!==3||(a=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===t)break t;if(d===n&&++u===i&&(l=s),d===o&&++c===r&&(a=s),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bp={focusedElem:t,selectionRange:n},xu=!1,j=e;j!==null;)if(e=j,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,j=t;else for(;j!==null;){e=j;try{var h=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var v=h.memoizedProps,S=h.memoizedState,m=e.stateNode,y=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:sn(e.type,v),S);m.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=e.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(w){ke(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,j=t;break}j=e.return}return h=t1,t1=!1,h}function Gs(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&th(e,n,o)}i=i.next}while(i!==r)}}function Fc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function nh(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function kC(t){var e=t.alternate;e!==null&&(t.alternate=null,kC(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[On],delete e[gl],delete e[Up],delete e[Z8],delete e[e7])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function AC(t){return t.tag===5||t.tag===3||t.tag===4}function n1(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||AC(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function rh(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=$u));else if(r!==4&&(t=t.child,t!==null))for(rh(t,e,n),t=t.sibling;t!==null;)rh(t,e,n),t=t.sibling}function ih(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(ih(t,e,n),t=t.sibling;t!==null;)ih(t,e,n),t=t.sibling}var Ge=null,ln=!1;function or(t,e,n){for(n=n.child;n!==null;)PC(t,e,n),n=n.sibling}function PC(t,e,n){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(Pc,n)}catch{}switch(n.tag){case 5:it||po(n,e);case 6:var r=Ge,i=ln;Ge=null,or(t,e,n),Ge=r,ln=i,Ge!==null&&(ln?(t=Ge,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ge.removeChild(n.stateNode));break;case 18:Ge!==null&&(ln?(t=Ge,n=n.stateNode,t.nodeType===8?fd(t.parentNode,n):t.nodeType===1&&fd(t,n),fl(t)):fd(Ge,n.stateNode));break;case 4:r=Ge,i=ln,Ge=n.stateNode.containerInfo,ln=!0,or(t,e,n),Ge=r,ln=i;break;case 0:case 11:case 14:case 15:if(!it&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&th(n,e,s),i=i.next}while(i!==r)}or(t,e,n);break;case 1:if(!it&&(po(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){ke(n,e,l)}or(t,e,n);break;case 21:or(t,e,n);break;case 22:n.mode&1?(it=(r=it)||n.memoizedState!==null,or(t,e,n),it=r):or(t,e,n);break;default:or(t,e,n)}}function r1(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new g7),e.forEach(function(r){var i=O7.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function rn(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Pe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*S7(r/1960))-r,10t?16:t,vr===null)var r=!1;else{if(t=vr,vr=null,zu=0,se&6)throw Error(D(331));var i=se;for(se|=4,j=t.current;j!==null;){var o=j,s=o.child;if(j.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aPe()-og?fi(t,0):ig|=n),kt(t,e)}function FC(t,e){e===0&&(t.mode&1?(e=ya,ya<<=1,!(ya&130023424)&&(ya=4194304)):e=1);var n=pt();t=er(t,e),t!==null&&(Hl(t,e,n),kt(t,n))}function T7(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),FC(t,n)}function O7(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(e),FC(t,n)}var BC;BC=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ot.current)Tt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Tt=!1,p7(t,e,n);Tt=!!(t.flags&131072)}else Tt=!1,Ce&&e.flags&1048576&&UE(e,_u,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Qa(t,e),t=e.pendingProps;var i=Io(e,at.current);wo(e,n),i=Xm(null,e,r,t,i,n);var o=Zm();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,$t(r)?(o=!0,Au(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Gm(e),i.updater=Rc,e.stateNode=i,i._reactInternals=e,qp(e,r,t,n),e=Qp(null,e,r,!0,o,n)):(e.tag=0,Ce&&o&&zm(e),ct(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Qa(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=k7(r),t=sn(r,t),i){case 0:e=Jp(null,e,r,t,n);break e;case 1:e=X0(null,e,r,t,n);break e;case 11:e=J0(null,e,r,t,n);break e;case 14:e=Q0(null,e,r,sn(r.type,t),n);break e}throw Error(D(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:sn(r,i),Jp(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:sn(r,i),X0(t,e,r,i,n);case 3:e:{if(EC(e),t===null)throw Error(D(387));r=e.pendingProps,o=e.memoizedState,i=o.element,KE(t,e),Iu(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Fo(Error(D(423)),e),e=Z0(t,e,r,n,i);break e}else if(r!==i){i=Fo(Error(D(424)),e),e=Z0(t,e,r,n,i);break e}else for(It=Tr(e.stateNode.containerInfo.firstChild),Dt=e,Ce=!0,an=null,n=JE(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Do(),r===i){e=tr(t,e,n);break e}ct(t,e,r,n)}e=e.child}return e;case 5:return QE(e),t===null&&Hp(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,zp(r,i)?s=null:o!==null&&zp(r,o)&&(e.flags|=32),wC(t,e),ct(t,e,s,n),e.child;case 6:return t===null&&Hp(e),null;case 13:return CC(t,e,n);case 4:return qm(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ro(e,null,r,n):ct(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:sn(r,i),J0(t,e,r,i,n);case 7:return ct(t,e,e.pendingProps,n),e.child;case 8:return ct(t,e,e.pendingProps.children,n),e.child;case 12:return ct(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,Se(Mu,r._currentValue),r._currentValue=s,o!==null)if(gn(o.value,s)){if(o.children===i.children&&!Ot.current){e=tr(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Jn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Kp(o.return,n,e),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(D(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Kp(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}ct(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,wo(e,n),i=Zt(i),r=r(i),e.flags|=1,ct(t,e,r,n),e.child;case 14:return r=e.type,i=sn(r,e.pendingProps),i=sn(r.type,i),Q0(t,e,r,i,n);case 15:return SC(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:sn(r,i),Qa(t,e),e.tag=1,$t(r)?(t=!0,Au(e)):t=!1,wo(e,n),qE(e,r,i),qp(e,r,i,n),Qp(null,e,r,!0,t,n);case 19:return xC(t,e,n);case 22:return bC(t,e,n)}throw Error(D(156,e.tag))};function zC(t,e){return dE(t,e)}function $7(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(t,e,n,r){return new $7(t,e,n,r)}function ug(t){return t=t.prototype,!(!t||!t.isReactComponent)}function k7(t){if(typeof t=="function")return ug(t)?1:0;if(t!=null){if(t=t.$$typeof,t===km)return 11;if(t===Am)return 14}return 2}function Ar(t,e){var n=t.alternate;return n===null?(n=Jt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function eu(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")ug(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case ro:return di(n.children,i,o,e);case $m:s=8,i|=8;break;case vp:return t=Jt(12,n,e,i|2),t.elementType=vp,t.lanes=o,t;case Sp:return t=Jt(13,n,e,i),t.elementType=Sp,t.lanes=o,t;case bp:return t=Jt(19,n,e,i),t.elementType=bp,t.lanes=o,t;case Yw:return zc(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Gw:s=10;break e;case qw:s=9;break e;case km:s=11;break e;case Am:s=14;break e;case ar:s=16,r=null;break e}throw Error(D(130,t==null?t:typeof t,""))}return e=Jt(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function di(t,e,n,r){return t=Jt(7,t,r,e),t.lanes=n,t}function zc(t,e,n,r){return t=Jt(22,t,r,e),t.elementType=Yw,t.lanes=n,t.stateNode={isHidden:!1},t}function Sd(t,e,n){return t=Jt(6,t,null,e),t.lanes=n,t}function bd(t,e,n){return e=Jt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function A7(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ed(0),this.expirationTimes=ed(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ed(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function cg(t,e,n,r,i,o,s,l,a){return t=new A7(t,e,n,l,a),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Jt(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gm(o),t}function P7(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VC)}catch(t){console.error(t)}}VC(),Uw.exports=Ut;var HC=Uw.exports,D7,f1=HC;D7=f1.createRoot,f1.hydrateRoot;var KC={exports:{}},GC={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var zo=_;function R7(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var L7=typeof Object.is=="function"?Object.is:R7,F7=zo.useState,B7=zo.useEffect,z7=zo.useLayoutEffect,j7=zo.useDebugValue;function U7(t,e){var n=e(),r=F7({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return z7(function(){i.value=n,i.getSnapshot=e,wd(i)&&o({inst:i})},[t,n,e]),B7(function(){return wd(i)&&o({inst:i}),t(function(){wd(i)&&o({inst:i})})},[t]),j7(n),n}function wd(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!L7(t,n)}catch{return!0}}function W7(t,e){return e()}var V7=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?W7:U7;GC.useSyncExternalStore=zo.useSyncExternalStore!==void 0?zo.useSyncExternalStore:V7;KC.exports=GC;var hg=KC.exports,qC={exports:{}},YC={};/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Hc=_,H7=hg;function K7(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var G7=typeof Object.is=="function"?Object.is:K7,q7=H7.useSyncExternalStore,Y7=Hc.useRef,J7=Hc.useEffect,Q7=Hc.useMemo,X7=Hc.useDebugValue;YC.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=Y7(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Q7(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&s.hasValue){var h=s.value;if(i(h,p))return f=h}return f=p}if(h=f,G7(c,p))return h;var v=r(p);return i!==void 0&&i(h,v)?h:(c=p,f=v)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return a(e())},d===null?void 0:function(){return a(d())}]},[e,n,r,i]);var l=q7(t,o[0],o[1]);return J7(function(){s.hasValue=!0,s.value=l},[l]),X7(l),l};qC.exports=YC;var Z7=qC.exports;function e9(t){t()}let JC=e9;const t9=t=>JC=t,n9=()=>JC,d1=Symbol.for("react-redux-context"),p1=typeof globalThis<"u"?globalThis:{};function r9(){var t;if(!_.createContext)return{};const e=(t=p1[d1])!=null?t:p1[d1]=new Map;let n=e.get(_.createContext);return n||(n=_.createContext(null),e.set(_.createContext,n)),n}const Cl=r9();function QC(t=Cl){return function(){return _.useContext(t)}}const i9=QC(),XC=()=>{throw new Error("uSES not initialized!")};let ZC=XC;const o9=t=>{ZC=t},s9=(t,e)=>t===e;function l9(t=Cl){const e=t===Cl?i9:QC(t);return function(r,i={}){const{equalityFn:o=s9,stabilityCheck:s=void 0,noopCheck:l=void 0}=typeof i=="function"?{equalityFn:i}:i,{store:a,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=e();_.useRef(!0);const p=_.useCallback({[r.name](v){return r(v)}}[r.name],[r,f,s]),h=ZC(u.addNestedSub,a.getState,c||a.getState,p,o);return _.useDebugValue(h),h}}const oZ=l9();function Co(){return Co=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}var tx={exports:{}},pe={};/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ve=typeof Symbol=="function"&&Symbol.for,mg=Ve?Symbol.for("react.element"):60103,gg=Ve?Symbol.for("react.portal"):60106,Kc=Ve?Symbol.for("react.fragment"):60107,Gc=Ve?Symbol.for("react.strict_mode"):60108,qc=Ve?Symbol.for("react.profiler"):60114,Yc=Ve?Symbol.for("react.provider"):60109,Jc=Ve?Symbol.for("react.context"):60110,yg=Ve?Symbol.for("react.async_mode"):60111,Qc=Ve?Symbol.for("react.concurrent_mode"):60111,Xc=Ve?Symbol.for("react.forward_ref"):60112,Zc=Ve?Symbol.for("react.suspense"):60113,a9=Ve?Symbol.for("react.suspense_list"):60120,ef=Ve?Symbol.for("react.memo"):60115,tf=Ve?Symbol.for("react.lazy"):60116,u9=Ve?Symbol.for("react.block"):60121,c9=Ve?Symbol.for("react.fundamental"):60117,f9=Ve?Symbol.for("react.responder"):60118,d9=Ve?Symbol.for("react.scope"):60119;function Vt(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case mg:switch(t=t.type,t){case yg:case Qc:case Kc:case qc:case Gc:case Zc:return t;default:switch(t=t&&t.$$typeof,t){case Jc:case Xc:case tf:case ef:case Yc:return t;default:return e}}case gg:return e}}}function nx(t){return Vt(t)===Qc}pe.AsyncMode=yg;pe.ConcurrentMode=Qc;pe.ContextConsumer=Jc;pe.ContextProvider=Yc;pe.Element=mg;pe.ForwardRef=Xc;pe.Fragment=Kc;pe.Lazy=tf;pe.Memo=ef;pe.Portal=gg;pe.Profiler=qc;pe.StrictMode=Gc;pe.Suspense=Zc;pe.isAsyncMode=function(t){return nx(t)||Vt(t)===yg};pe.isConcurrentMode=nx;pe.isContextConsumer=function(t){return Vt(t)===Jc};pe.isContextProvider=function(t){return Vt(t)===Yc};pe.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===mg};pe.isForwardRef=function(t){return Vt(t)===Xc};pe.isFragment=function(t){return Vt(t)===Kc};pe.isLazy=function(t){return Vt(t)===tf};pe.isMemo=function(t){return Vt(t)===ef};pe.isPortal=function(t){return Vt(t)===gg};pe.isProfiler=function(t){return Vt(t)===qc};pe.isStrictMode=function(t){return Vt(t)===Gc};pe.isSuspense=function(t){return Vt(t)===Zc};pe.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Kc||t===Qc||t===qc||t===Gc||t===Zc||t===a9||typeof t=="object"&&t!==null&&(t.$$typeof===tf||t.$$typeof===ef||t.$$typeof===Yc||t.$$typeof===Jc||t.$$typeof===Xc||t.$$typeof===c9||t.$$typeof===f9||t.$$typeof===d9||t.$$typeof===u9)};pe.typeOf=Vt;tx.exports=pe;var p9=tx.exports,vg=p9,h9={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},m9={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},g9={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},rx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Sg={};Sg[vg.ForwardRef]=g9;Sg[vg.Memo]=rx;function h1(t){return vg.isMemo(t)?rx:Sg[t.$$typeof]||h9}var y9=Object.defineProperty,v9=Object.getOwnPropertyNames,m1=Object.getOwnPropertySymbols,S9=Object.getOwnPropertyDescriptor,b9=Object.getPrototypeOf,g1=Object.prototype;function ix(t,e,n){if(typeof e!="string"){if(g1){var r=b9(e);r&&r!==g1&&ix(t,r,n)}var i=v9(e);m1&&(i=i.concat(m1(e)));for(var o=h1(t),s=h1(e),l=0;le(i(...o)))}return n}function uh(t){return function(n){const r=t(n);function i(){return r}return i.dependsOnOwnProps=!1,i}}function v1(t){return t.dependsOnOwnProps?!!t.dependsOnOwnProps:t.length!==1}function lx(t,e){return function(r,{displayName:i}){const o=function(l,a){return o.dependsOnOwnProps?o.mapToProps(l,a):o.mapToProps(l,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(l,a){o.mapToProps=t,o.dependsOnOwnProps=v1(t);let u=o(l,a);return typeof u=="function"&&(o.mapToProps=u,o.dependsOnOwnProps=v1(u),u=o(l,a)),u},o}}function Eg(t,e){return(n,r)=>{throw new Error(`Invalid value of type ${typeof t} for ${e} argument when connecting component ${r.wrappedComponentName}.`)}}function A9(t){return t&&typeof t=="object"?uh(e=>k9(t,e)):t?typeof t=="function"?lx(t):Eg(t,"mapDispatchToProps"):uh(e=>({dispatch:e}))}function P9(t){return t?typeof t=="function"?lx(t):Eg(t,"mapStateToProps"):uh(()=>({}))}function _9(t,e,n){return Co({},n,t,e)}function M9(t){return function(n,{displayName:r,areMergedPropsEqual:i}){let o=!1,s;return function(a,u,c){const f=t(a,u,c);return o?i(f,s)||(s=f):(o=!0,s=f),s}}}function N9(t){return t?typeof t=="function"?M9(t):Eg(t,"mergeProps"):()=>_9}function I9(){const t=n9();let e=null,n=null;return{clear(){e=null,n=null},notify(){t(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=e;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:e=o,function(){!i||e===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}const S1={notify(){},get:()=>[]};function ax(t,e){let n,r=S1,i=0,o=!1;function s(v){c();const S=r.subscribe(v);let m=!1;return()=>{m||(m=!0,S(),f())}}function l(){r.notify()}function a(){h.onStateChange&&h.onStateChange()}function u(){return o}function c(){i++,n||(n=e?e.addNestedSub(a):t.subscribe(a),r=I9())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=S1)}function d(){o||(o=!0,c())}function p(){o&&(o=!1,f())}const h={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:a,isSubscribed:u,trySubscribe:d,tryUnsubscribe:p,getListeners:()=>r};return h}const D9=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Wu=D9?_.useLayoutEffect:_.useEffect;function b1(t,e){return t===e?t!==0||e!==0||1/t===1/e:t!==t&&e!==e}function Ed(t,e){if(b1(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let i=0;i{ux=t},F9=[null,null];function B9(t,e,n){Wu(()=>t(...e),n)}function z9(t,e,n,r,i,o){t.current=r,n.current=!1,i.current&&(i.current=null,o())}function j9(t,e,n,r,i,o,s,l,a,u,c){if(!t)return()=>{};let f=!1,d=null;const p=()=>{if(f||!l.current)return;const v=e.getState();let S,m;try{S=r(v,i.current)}catch(y){m=y,d=y}m||(d=null),S===o.current?s.current||u():(o.current=S,a.current=S,s.current=!0,c())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function U9(t,e){return t===e}function sZ(t,e,n,{pure:r,areStatesEqual:i=U9,areOwnPropsEqual:o=Ed,areStatePropsEqual:s=Ed,areMergedPropsEqual:l=Ed,forwardRef:a=!1,context:u=Cl}={}){const c=u,f=P9(t),d=A9(e),p=N9(n),h=!!t;return S=>{const m=S.displayName||S.name||"Component",y=`Connect(${m})`,g={shouldHandleStateChanges:h,displayName:y,wrappedComponentName:m,WrappedComponent:S,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:p,areStatesEqual:i,areStatePropsEqual:s,areOwnPropsEqual:o,areMergedPropsEqual:l};function w(P){const[b,A,I]=_.useMemo(()=>{const{reactReduxForwardedRef:wt}=P,Rn=ex(P,R9);return[P.context,wt,Rn]},[P]),M=_.useMemo(()=>b&&b.Consumer&&x9.isContextConsumer(_.createElement(b.Consumer,null))?b:c,[b,c]),$=_.useContext(M),T=!!P.store&&!!P.store.getState&&!!P.store.dispatch,k=!!$&&!!$.store,U=T?P.store:$.store,ie=k?$.getServerState:U.getState,De=_.useMemo(()=>$9(U.dispatch,g),[U]),[B,W]=_.useMemo(()=>{if(!h)return F9;const wt=ax(U,T?void 0:$.subscription),Rn=wt.notifyNestedSubs.bind(wt);return[wt,Rn]},[U,T,$]),q=_.useMemo(()=>T?$:Co({},$,{subscription:B}),[T,$,B]),Y=_.useRef(),ce=_.useRef(I),L=_.useRef(),Q=_.useRef(!1);_.useRef(!1);const X=_.useRef(!1),Ae=_.useRef();Wu(()=>(X.current=!0,()=>{X.current=!1}),[]);const ge=_.useMemo(()=>()=>L.current&&I===ce.current?L.current:De(U.getState(),I),[U,I]),Dn=_.useMemo(()=>Rn=>B?j9(h,U,B,De,ce,Y,Q,X,L,W,Rn):()=>{},[B]);B9(z9,[ce,Y,Q,I,L,W]);let Sn;try{Sn=ux(Dn,ge,ie?()=>De(ie(),I):ge)}catch(wt){throw Ae.current&&(wt.message+=` +The error may be correlated with this previous error: +${Ae.current.stack} + +`),wt}Wu(()=>{Ae.current=void 0,L.current=void 0,Y.current=Sn});const Pt=_.useMemo(()=>_.createElement(S,Co({},Sn,{ref:A})),[A,S,Sn]);return _.useMemo(()=>h?_.createElement(M.Provider,{value:q},Pt):Pt,[M,Pt,q])}const x=_.memo(w);if(x.WrappedComponent=S,x.displayName=w.displayName=y,a){const b=_.forwardRef(function(I,M){return _.createElement(x,Co({},I,{reactReduxForwardedRef:M}))});return b.displayName=y,b.WrappedComponent=S,y1(b,S)}return y1(x,S)}}function lZ({store:t,context:e,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const s=_.useMemo(()=>{const u=ax(t);return{store:t,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:i,noopCheck:o}},[t,r,i,o]),l=_.useMemo(()=>t.getState(),[t]);Wu(()=>{const{subscription:u}=s;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),l!==t.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[s,l]);const a=e||Cl;return _.createElement(a.Provider,{value:s},n)}o9(Z7.useSyncExternalStoreWithSelector);L9(hg.useSyncExternalStore);t9(HC.unstable_batchedUpdates);var cx={exports:{}},W9="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",V9=W9,H9=V9;function fx(){}function dx(){}dx.resetWarningCache=fx;var K9=function(){function t(r,i,o,s,l,a){if(a!==H9){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:dx,resetWarningCache:fx};return n.PropTypes=n,n};cx.exports=K9();var G9=cx.exports;const aZ=xe(G9),Vu={prefix:String(Math.round(Math.random()*1e10)),current:0},px=We.createContext(Vu),q9=We.createContext(!1);let Y9=!!(typeof window<"u"&&window.document&&window.document.createElement),Cd=new WeakMap;function J9(t=!1){let e=_.useContext(px),n=_.useRef(null);if(n.current===null&&!t){var r,i;let o=(i=We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(o){let s=Cd.get(o);s==null?Cd.set(o,{id:e.current,state:o.memoizedState}):o.memoizedState!==s.state&&(e.current=s.id,Cd.delete(o))}n.current=++e.current}return n.current}function Q9(t){let e=_.useContext(px);e===Vu&&!Y9&&console.warn("When server rendering, you must wrap your application in an to ensure consistent ids are generated between the client and server.");let n=J9(!!t),r=`react-aria${e.prefix}`;return t||`${r}-${n}`}function X9(t){let e=We.useId(),[n]=_.useState(hx()),r=n?"react-aria":`react-aria${Vu.prefix}`;return t||`${r}-${e}`}We.useId;function Z9(){return!1}function ej(){return!0}function tj(t){return()=>{}}function hx(){return typeof We.useSyncExternalStore=="function"?We.useSyncExternalStore(tj,Z9,ej):_.useContext(q9)}function mx(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{};function Xi(t){const e=_.useRef(null);return Cg(()=>{e.current=t},[t]),_.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}let w1=new Map;function rj(t,e){if(t===e)return t;let n=w1.get(t);if(n)return n(e),e;let r=w1.get(e);return r?(r(t),t):e}function gx(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const Yt=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},kn=t=>t&&"window"in t&&t.window===t?t:Yt(t).defaultView||window;function Fr(...t){let e={...t[0]};for(let n=1;n=65&&i.charCodeAt(2)<=90?e[i]=gx(o,s):(i==="className"||i==="UNSAFE_className")&&typeof o=="string"&&typeof s=="string"?e[i]=nj(o,s):i==="id"&&o&&s?e.id=rj(o,s):e[i]=s!==void 0?s:o}}return e}function ij(...t){return t.length===1?t[0]:e=>{for(let n of t)typeof n=="function"?n(e):n!=null&&(n.current=e)}}const oj=new Set(["id"]),sj=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),lj=new Set(["href","target","rel","download","ping","referrerPolicy"]),aj=/^(data-.*)$/;function yx(t,e={}){let{labelable:n,isLink:r,propNames:i}=e,o={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(oj.has(s)||n&&sj.has(s)||r&&lj.has(s)||i!=null&&i.has(s)||aj.test(s))&&(o[s]=t[s]);return o}function si(t){if(uj())t.focus({preventScroll:!0});else{let e=cj(t);t.focus(),fj(e)}}let Aa=null;function uj(){if(Aa==null){Aa=!1;try{document.createElement("div").focus({get preventScroll(){return Aa=!0,!0}})}catch{}}return Aa}function cj(t){let e=t.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==r;)(e.offsetHeight"u"||window.navigator==null?!1:((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.brands.some(n=>t.test(n.brand)))||t.test(window.navigator.userAgent)}function xg(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function xl(){return xg(/^Mac/i)}function dj(){return xg(/^iPhone/i)}function vx(){return xg(/^iPad/i)||xl()&&navigator.maxTouchPoints>1}function Sx(){return dj()||vx()}function pj(){return pf(/AppleWebKit/i)&&!hj()}function hj(){return pf(/Chrome/i)}function bx(){return pf(/Android/i)}function mj(){return pf(/Firefox/i)}function Tl(t,e,n=!0){var r,i;let{metaKey:o,ctrlKey:s,altKey:l,shiftKey:a}=e;mj()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&t.target==="_blank"&&(xl()?o=!0:s=!0);let u=pj()&&xl()&&!vx()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:o,ctrlKey:s,altKey:l,shiftKey:a}):new MouseEvent("click",{metaKey:o,ctrlKey:s,altKey:l,shiftKey:a,bubbles:!0,cancelable:!0});Tl.isOpening=n,si(t),t.dispatchEvent(u),Tl.isOpening=!1}Tl.isOpening=!1;let Zi=new Map,ch=new Set;function E1(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{if(!t(r)||!r.target)return;let i=Zi.get(r.target);i||(i=new Set,Zi.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!t(r)||!r.target)return;let i=Zi.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),Zi.delete(r.target)),Zi.size===0)){for(let o of ch)o();ch.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?E1():document.addEventListener("DOMContentLoaded",E1));function wx(t){requestAnimationFrame(()=>{Zi.size===0?t():ch.add(t)})}function gj(){let t=_.useRef(new Map),e=_.useCallback((i,o,s,l)=>{let a=l!=null&&l.once?(...u)=>{t.current.delete(s),s(...u)}:s;t.current.set(s,{type:o,eventTarget:i,fn:a,options:l}),i.addEventListener(o,s,l)},[]),n=_.useCallback((i,o,s,l)=>{var a;let u=((a=t.current.get(s))===null||a===void 0?void 0:a.fn)||s;i.removeEventListener(o,u,l),t.current.delete(s)},[]),r=_.useCallback(()=>{t.current.forEach((i,o)=>{n(i.eventTarget,i.type,o,i.options)})},[n]);return _.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}}function yj(t){const e=_.useRef(null);return _.useMemo(()=>({get current(){return e.current},set current(n){e.current=n,typeof t=="function"?t(n):t&&(t.current=n)}}),[t])}function Ex(t,e){Cg(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function fh(t){return t.mozInputSource===0&&t.isTrusted?!0:bx()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function vj(t){return!bx()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}function Sj(t,e){return e.get?e.get.call(t):e.value}function Cx(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function bj(t,e){var n=Cx(t,e,"get");return Sj(t,n)}function wj(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ej(t,e,n){wj(t,e),e.set(t,n)}function Cj(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function C1(t,e,n){var r=Cx(t,e,"set");return Cj(t,r,n),n}let mo="default",dh="",tu=new WeakMap;function x1(t){if(Sx()){if(mo==="default"){const e=Yt(t);dh=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}mo="disabled"}else(t instanceof HTMLElement||t instanceof SVGElement)&&(tu.set(t,t.style.userSelect),t.style.userSelect="none")}function Pa(t){if(Sx()){if(mo!=="disabled")return;mo="restoring",setTimeout(()=>{wx(()=>{if(mo==="restoring"){const e=Yt(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=dh||""),dh="",mo="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&tu.has(t)){let e=tu.get(t);t.style.userSelect==="none"&&(t.style.userSelect=e),t.getAttribute("style")===""&&t.removeAttribute("style"),tu.delete(t)}}const xx=We.createContext({register:()=>{}});xx.displayName="PressResponderContext";function xj(t){let e=_.useContext(xx);if(e){let{register:n,...r}=e;t=Fr(r,t),n()}return Ex(e,t.ref),t}var _a=new WeakMap;class Ma{continuePropagation(){C1(this,_a,!1)}get shouldStopPropagation(){return bj(this,_a)}constructor(e,n,r){Ej(this,_a,{writable:!0,value:void 0}),C1(this,_a,!0),this.type=e,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey}}const T1=Symbol("linkClicked");function Tj(t){let{onPress:e,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:o,isDisabled:s,isPressed:l,preventFocusOnPress:a,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:c,ref:f,...d}=xj(t),[p,h]=_.useState(!1),v=_.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:S,removeAllGlobalListeners:m}=gj(),y=Xi((b,A)=>{let I=v.current;if(s||I.didFirePressStart)return!1;let M=!0;if(I.isTriggeringEvent=!0,r){let $=new Ma("pressstart",A,b);r($),M=$.shouldStopPropagation}return n&&n(!0),I.isTriggeringEvent=!1,I.didFirePressStart=!0,h(!0),M}),g=Xi((b,A,I=!0)=>{let M=v.current;if(!M.didFirePressStart)return!1;M.ignoreClickAfterPress=!0,M.didFirePressStart=!1,M.isTriggeringEvent=!0;let $=!0;if(i){let T=new Ma("pressend",A,b);i(T),$=T.shouldStopPropagation}if(n&&n(!1),h(!1),e&&I&&!s){let T=new Ma("press",A,b);e(T),$&&($=T.shouldStopPropagation)}return M.isTriggeringEvent=!1,$}),w=Xi((b,A)=>{let I=v.current;if(s)return!1;if(o){I.isTriggeringEvent=!0;let M=new Ma("pressup",A,b);return o(M),I.isTriggeringEvent=!1,M.shouldStopPropagation}return!0}),C=Xi(b=>{let A=v.current;A.isPressed&&A.target&&(A.isOverTarget&&A.pointerType!=null&&g(Bn(A.target,b),A.pointerType,!1),A.isPressed=!1,A.isOverTarget=!1,A.activePointerId=null,A.pointerType=null,m(),c||Pa(A.target))}),x=Xi(b=>{u&&C(b)}),P=_.useMemo(()=>{let b=v.current,A={onKeyDown(M){if(xd(M.nativeEvent,M.currentTarget)&&M.currentTarget.contains(M.target)){var $;$1(M.target,M.key)&&M.preventDefault();let T=!0;if(!b.isPressed&&!M.repeat){b.target=M.currentTarget,b.isPressed=!0,T=y(M,"keyboard");let k=M.currentTarget,U=ie=>{xd(ie,k)&&!ie.repeat&&k.contains(ie.target)&&b.target&&w(Bn(b.target,ie),"keyboard")};S(Yt(M.currentTarget),"keyup",gx(U,I),!0)}T&&M.stopPropagation(),M.metaKey&&xl()&&(($=b.metaKeyEvents)===null||$===void 0||$.set(M.key,M.nativeEvent))}else M.key==="Meta"&&(b.metaKeyEvents=new Map)},onClick(M){if(!(M&&!M.currentTarget.contains(M.target))&&M&&M.button===0&&!b.isTriggeringEvent&&!Tl.isOpening){let $=!0;if(s&&M.preventDefault(),!b.ignoreClickAfterPress&&!b.ignoreEmulatedMouseEvents&&!b.isPressed&&(b.pointerType==="virtual"||fh(M.nativeEvent))){!s&&!a&&si(M.currentTarget);let T=y(M,"virtual"),k=w(M,"virtual"),U=g(M,"virtual");$=T&&k&&U}b.ignoreEmulatedMouseEvents=!1,b.ignoreClickAfterPress=!1,$&&M.stopPropagation()}}},I=M=>{var $;if(b.isPressed&&b.target&&xd(M,b.target)){var T;$1(M.target,M.key)&&M.preventDefault();let U=M.target;g(Bn(b.target,M),"keyboard",b.target.contains(U)),m(),M.key!=="Enter"&&Tg(b.target)&&b.target.contains(U)&&!M[T1]&&(M[T1]=!0,Tl(b.target,M,!1)),b.isPressed=!1,(T=b.metaKeyEvents)===null||T===void 0||T.delete(M.key)}else if(M.key==="Meta"&&(!(($=b.metaKeyEvents)===null||$===void 0)&&$.size)){var k;let U=b.metaKeyEvents;b.metaKeyEvents=void 0;for(let ie of U.values())(k=b.target)===null||k===void 0||k.dispatchEvent(new KeyboardEvent("keyup",ie))}};if(typeof PointerEvent<"u"){A.onPointerDown=k=>{if(k.button!==0||!k.currentTarget.contains(k.target))return;if(vj(k.nativeEvent)){b.pointerType="virtual";return}Td(k.currentTarget)&&k.preventDefault(),b.pointerType=k.pointerType;let U=!0;b.isPressed||(b.isPressed=!0,b.isOverTarget=!0,b.activePointerId=k.pointerId,b.target=k.currentTarget,!s&&!a&&si(k.currentTarget),c||x1(b.target),U=y(k,b.pointerType),S(Yt(k.currentTarget),"pointermove",M,!1),S(Yt(k.currentTarget),"pointerup",$,!1),S(Yt(k.currentTarget),"pointercancel",T,!1)),U&&k.stopPropagation()},A.onMouseDown=k=>{k.currentTarget.contains(k.target)&&k.button===0&&(Td(k.currentTarget)&&k.preventDefault(),k.stopPropagation())},A.onPointerUp=k=>{!k.currentTarget.contains(k.target)||b.pointerType==="virtual"||k.button===0&&Hi(k,k.currentTarget)&&w(k,b.pointerType||k.pointerType)};let M=k=>{k.pointerId===b.activePointerId&&(b.target&&Hi(k,b.target)?!b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!0,y(Bn(b.target,k),b.pointerType)):b.target&&b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!1,g(Bn(b.target,k),b.pointerType,!1),x(k)))},$=k=>{k.pointerId===b.activePointerId&&b.isPressed&&k.button===0&&b.target&&(Hi(k,b.target)&&b.pointerType!=null?g(Bn(b.target,k),b.pointerType):b.isOverTarget&&b.pointerType!=null&&g(Bn(b.target,k),b.pointerType,!1),b.isPressed=!1,b.isOverTarget=!1,b.activePointerId=null,b.pointerType=null,m(),c||Pa(b.target))},T=k=>{C(k)};A.onDragStart=k=>{k.currentTarget.contains(k.target)&&C(k)}}else{A.onMouseDown=T=>{if(T.button!==0||!T.currentTarget.contains(T.target))return;if(Td(T.currentTarget)&&T.preventDefault(),b.ignoreEmulatedMouseEvents){T.stopPropagation();return}b.isPressed=!0,b.isOverTarget=!0,b.target=T.currentTarget,b.pointerType=fh(T.nativeEvent)?"virtual":"mouse",!s&&!a&&si(T.currentTarget),y(T,b.pointerType)&&T.stopPropagation(),S(Yt(T.currentTarget),"mouseup",M,!1)},A.onMouseEnter=T=>{if(!T.currentTarget.contains(T.target))return;let k=!0;b.isPressed&&!b.ignoreEmulatedMouseEvents&&b.pointerType!=null&&(b.isOverTarget=!0,k=y(T,b.pointerType)),k&&T.stopPropagation()},A.onMouseLeave=T=>{if(!T.currentTarget.contains(T.target))return;let k=!0;b.isPressed&&!b.ignoreEmulatedMouseEvents&&b.pointerType!=null&&(b.isOverTarget=!1,k=g(T,b.pointerType,!1),x(T)),k&&T.stopPropagation()},A.onMouseUp=T=>{T.currentTarget.contains(T.target)&&!b.ignoreEmulatedMouseEvents&&T.button===0&&w(T,b.pointerType||"mouse")};let M=T=>{if(T.button===0){if(b.isPressed=!1,m(),b.ignoreEmulatedMouseEvents){b.ignoreEmulatedMouseEvents=!1;return}b.target&&Hi(T,b.target)&&b.pointerType!=null?g(Bn(b.target,T),b.pointerType):b.target&&b.isOverTarget&&b.pointerType!=null&&g(Bn(b.target,T),b.pointerType,!1),b.isOverTarget=!1}};A.onTouchStart=T=>{if(!T.currentTarget.contains(T.target))return;let k=Oj(T.nativeEvent);if(!k)return;b.activePointerId=k.identifier,b.ignoreEmulatedMouseEvents=!0,b.isOverTarget=!0,b.isPressed=!0,b.target=T.currentTarget,b.pointerType="touch",!s&&!a&&si(T.currentTarget),c||x1(b.target),y(T,b.pointerType)&&T.stopPropagation(),S(kn(T.currentTarget),"scroll",$,!0)},A.onTouchMove=T=>{if(!T.currentTarget.contains(T.target))return;if(!b.isPressed){T.stopPropagation();return}let k=O1(T.nativeEvent,b.activePointerId),U=!0;k&&Hi(k,T.currentTarget)?!b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!0,U=y(T,b.pointerType)):b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!1,U=g(T,b.pointerType,!1),x(T)),U&&T.stopPropagation()},A.onTouchEnd=T=>{if(!T.currentTarget.contains(T.target))return;if(!b.isPressed){T.stopPropagation();return}let k=O1(T.nativeEvent,b.activePointerId),U=!0;k&&Hi(k,T.currentTarget)&&b.pointerType!=null?(w(T,b.pointerType),U=g(T,b.pointerType)):b.isOverTarget&&b.pointerType!=null&&(U=g(T,b.pointerType,!1)),U&&T.stopPropagation(),b.isPressed=!1,b.activePointerId=null,b.isOverTarget=!1,b.ignoreEmulatedMouseEvents=!0,b.target&&!c&&Pa(b.target),m()},A.onTouchCancel=T=>{T.currentTarget.contains(T.target)&&(T.stopPropagation(),b.isPressed&&C(T))};let $=T=>{b.isPressed&&T.target.contains(b.target)&&C({currentTarget:b.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};A.onDragStart=T=>{T.currentTarget.contains(T.target)&&C(T)}}return A},[S,s,a,m,c,C,x,g,y,w]);return _.useEffect(()=>()=>{var b;c||Pa((b=v.current.target)!==null&&b!==void 0?b:void 0)},[c]),{isPressed:l||p,pressProps:Fr(d,P)}}function Tg(t){return t.tagName==="A"&&t.hasAttribute("href")}function xd(t,e){const{key:n,code:r}=t,i=e,o=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof kn(i).HTMLInputElement&&!Tx(i,n)||i instanceof kn(i).HTMLTextAreaElement||i.isContentEditable)&&!((o==="link"||!o&&Tg(i))&&n!=="Enter")}function Oj(t){const{targetTouches:e}=t;return e.length>0?e[0]:null}function O1(t,e){const n=t.changedTouches;for(let r=0;re.right||e.left>t.right||t.top>e.bottom||e.top>t.bottom)}function Hi(t,e){let n=e.getBoundingClientRect(),r=$j(t);return kj(n,r)}function Td(t){return!(t instanceof HTMLElement)||!t.hasAttribute("draggable")}function $1(t,e){return t instanceof HTMLInputElement?!Tx(t,e):t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!Tg(t)}const Aj=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Tx(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":Aj.has(t.type)}class Pj{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=e}}function Ox(t){let e=_.useRef({isFocused:!1,observer:null});Cg(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Xi(r=>{t==null||t(r)});return _.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){e.current.isFocused=!0;let i=r.target,o=s=>{e.current.isFocused=!1,i.disabled&&n(new Pj("blur",s)),e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",o,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var s;(s=e.current.observer)===null||s===void 0||s.disconnect();let l=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function $x(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:i}=t;const o=_.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),i&&i(!1),!0},[r,i]),s=Ox(o),l=_.useCallback(a=>{a.target===a.currentTarget&&document.activeElement===a.target&&(n&&n(a),i&&i(!0),s(a))},[i,n,s]);return{focusProps:{onFocus:!e&&(n||i||r)?l:void 0,onBlur:!e&&(r||i)?o:void 0}}}let fs=null,ph=new Set,Js=new Map,$i=!1,hh=!1;const _j={Tab:!0,Escape:!0};function Og(t,e){for(let n of ph)n(t,e)}function Mj(t){return!(t.metaKey||!xl()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Hu(t){$i=!0,Mj(t)&&(fs="keyboard",Og("keyboard",t))}function qt(t){fs="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&($i=!0,Og("pointer",t))}function kx(t){fh(t)&&($i=!0,fs="virtual")}function Ax(t){t.target===window||t.target===document||(!$i&&!hh&&(fs="virtual",Og("virtual",t)),$i=!1,hh=!1)}function Px(){$i=!1,hh=!0}function mh(t){if(typeof window>"u"||Js.get(kn(t)))return;const e=kn(t),n=Yt(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){$i=!0,r.apply(this,arguments)},n.addEventListener("keydown",Hu,!0),n.addEventListener("keyup",Hu,!0),n.addEventListener("click",kx,!0),e.addEventListener("focus",Ax,!0),e.addEventListener("blur",Px,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",qt,!0),n.addEventListener("pointermove",qt,!0),n.addEventListener("pointerup",qt,!0)):(n.addEventListener("mousedown",qt,!0),n.addEventListener("mousemove",qt,!0),n.addEventListener("mouseup",qt,!0)),e.addEventListener("beforeunload",()=>{_x(t)},{once:!0}),Js.set(e,{focus:r})}const _x=(t,e)=>{const n=kn(t),r=Yt(t);e&&r.removeEventListener("DOMContentLoaded",e),Js.has(n)&&(n.HTMLElement.prototype.focus=Js.get(n).focus,r.removeEventListener("keydown",Hu,!0),r.removeEventListener("keyup",Hu,!0),r.removeEventListener("click",kx,!0),n.removeEventListener("focus",Ax,!0),n.removeEventListener("blur",Px,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",qt,!0),r.removeEventListener("pointermove",qt,!0),r.removeEventListener("pointerup",qt,!0)):(r.removeEventListener("mousedown",qt,!0),r.removeEventListener("mousemove",qt,!0),r.removeEventListener("mouseup",qt,!0)),Js.delete(n))};function Nj(t){const e=Yt(t);let n;return e.readyState!=="loading"?mh(t):(n=()=>{mh(t)},e.addEventListener("DOMContentLoaded",n)),()=>_x(t,n)}typeof document<"u"&&Nj();function Mx(){return fs!=="pointer"}function Ij(){return fs}const Dj=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Rj(t,e,n){var r;const i=typeof window<"u"?kn(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,o=typeof window<"u"?kn(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?kn(n==null?void 0:n.target).HTMLElement:HTMLElement,l=typeof window<"u"?kn(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return t=t||(n==null?void 0:n.target)instanceof i&&!Dj.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof o||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(t&&e==="keyboard"&&n instanceof l&&!_j[n.key])}function Lj(t,e,n){mh(),_.useEffect(()=>{let r=(i,o)=>{Rj(!!(n!=null&&n.isTextInput),i,o)&&t(Mx())};return ph.add(r),()=>{ph.delete(r)}},e)}function Fj(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=t,o=_.useRef({isFocusWithin:!1}),s=_.useCallback(u=>{o.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,o]),l=Ox(s),a=_.useCallback(u=>{!o.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),i&&i(!0),o.current.isFocusWithin=!0,l(u))},[r,i,l]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:a,onBlur:s}}}let Ku=!1,Od=0;function gh(){Ku=!0,setTimeout(()=>{Ku=!1},50)}function k1(t){t.pointerType==="touch"&&gh()}function Bj(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",k1):document.addEventListener("touchend",gh),Od++,()=>{Od--,!(Od>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",k1):document.removeEventListener("touchend",gh))}}function zj(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:i}=t,[o,s]=_.useState(!1),l=_.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;_.useEffect(Bj,[]);let{hoverProps:a,triggerHoverEnd:u}=_.useMemo(()=>{let c=(p,h)=>{if(l.pointerType=h,i||h==="touch"||l.isHovered||!p.currentTarget.contains(p.target))return;l.isHovered=!0;let v=p.currentTarget;l.target=v,e&&e({type:"hoverstart",target:v,pointerType:h}),n&&n(!0),s(!0)},f=(p,h)=>{if(l.pointerType="",l.target=null,h==="touch"||!l.isHovered)return;l.isHovered=!1;let v=p.currentTarget;r&&r({type:"hoverend",target:v,pointerType:h}),n&&n(!1),s(!1)},d={};return typeof PointerEvent<"u"?(d.onPointerEnter=p=>{Ku&&p.pointerType==="mouse"||c(p,p.pointerType)},d.onPointerLeave=p=>{!i&&p.currentTarget.contains(p.target)&&f(p,p.pointerType)}):(d.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},d.onMouseEnter=p=>{!l.ignoreEmulatedMouseEvents&&!Ku&&c(p,"mouse"),l.ignoreEmulatedMouseEvents=!1},d.onMouseLeave=p=>{!i&&p.currentTarget.contains(p.target)&&f(p,"mouse")}),{hoverProps:d,triggerHoverEnd:f}},[e,n,r,i,l]);return _.useEffect(()=>{i&&u({currentTarget:l.target},l.pointerType)},[i]),{hoverProps:a,isHovered:o}}function A1(t){if(!t)return;let e=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.")},continuePropagation(){e=!1}};t(r),e&&n.stopPropagation()}}function jj(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:A1(t.onKeyDown),onKeyUp:A1(t.onKeyUp)}}}function Uj(t){const e=Yt(t);if(Ij()==="virtual"){let n=e.activeElement;wx(()=>{e.activeElement===n&&t.isConnected&&si(t)})}else si(t)}function Wj(t,e){return!t||!e?!1:e.some(n=>n.contains(t))}class $g{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,n,r){let i=this.fastMap.get(n??null);if(!i)return;let o=new P1({scopeRef:e});i.addChild(o),o.parent=i,this.fastMap.set(e,o),r&&(o.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let n=this.fastMap.get(e);if(!n)return;let r=n.parent;for(let o of this.traverse())o!==n&&n.nodeToRestore&&o.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&Wj(o.nodeToRestore,n.scopeRef.current)&&(o.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(o=>r&&r.addChild(o))),this.fastMap.delete(n.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let n of e.children)yield*this.traverse(n)}clone(){var e;let n=new $g;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(e=i.parent)===null||e===void 0?void 0:e.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new P1({scopeRef:null}),this.fastMap.set(null,this.root)}}class P1{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}new $g;function Vj(t={}){let{autoFocus:e=!1,isTextInput:n,within:r}=t,i=_.useRef({isFocused:!1,isFocusVisible:e||Mx()}),[o,s]=_.useState(!1),[l,a]=_.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=_.useCallback(()=>a(i.current.isFocused&&i.current.isFocusVisible),[]),c=_.useCallback(p=>{i.current.isFocused=p,s(p),u()},[u]);Lj(p=>{i.current.isFocusVisible=p,u()},[],{isTextInput:n});let{focusProps:f}=$x({isDisabled:r,onFocusChange:c}),{focusWithinProps:d}=Fj({isDisabled:!r,onFocusWithinChange:c});return{isFocused:o,isFocusVisible:l,focusProps:r?d:f}}let Hj=We.createContext(null);function Kj(t){let e=_.useContext(Hj)||{};Ex(e,t);let{ref:n,...r}=e;return r}function Gj(t,e){let{focusProps:n}=$x(t),{keyboardProps:r}=jj(t),i=Fr(n,r),o=Kj(e),s=t.isDisabled?{}:o,l=_.useRef(t.autoFocus);return _.useEffect(()=>{l.current&&e.current&&Uj(e.current),l.current=!1},[e]),{focusableProps:Fr({...i,tabIndex:t.excludeFromTabOrder&&!t.isDisabled?-1:void 0},s)}}function qj(t,e){let{elementType:n="button",isDisabled:r,onPress:i,onPressStart:o,onPressEnd:s,onPressUp:l,onPressChange:a,preventFocusOnPress:u,allowFocusWhenDisabled:c,onClick:f,href:d,target:p,rel:h,type:v="button"}=t,S;n==="button"?S={type:v,disabled:r}:S={role:"button",tabIndex:r?void 0:0,href:n==="a"&&r?void 0:d,target:n==="a"?p:void 0,type:n==="input"?v:void 0,disabled:n==="input"?r:void 0,"aria-disabled":!r||n==="input"?void 0:r,rel:n==="a"?h:void 0};let{pressProps:m,isPressed:y}=Tj({onPressStart:o,onPressEnd:s,onPressChange:a,onPress:i,onPressUp:l,isDisabled:r,preventFocusOnPress:u,ref:e}),{focusableProps:g}=Gj(t,e);c&&(g.tabIndex=r?-1:g.tabIndex);let w=Fr(g,m,yx(t,{labelable:!0}));return{isPressed:y,buttonProps:Fr(S,w,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],onClick:C=>{f&&(f(C),console.warn("onClick is deprecated, please use onPress"))}})}}function Yj(t,e,n){let r=hx(),i=_.useRef(r);i.current=r;let o=_.useCallback(()=>i.current?n():e(),[e,n]);return hg.useSyncExternalStore(t,o)}typeof We.useSyncExternalStore=="function"&&We.useSyncExternalStore;const Jj=Symbol("callback"),_1=Symbol("default");function Qj(t){let{className:e,style:n,children:r,defaultClassName:i,defaultChildren:o,values:s}=t;return _.useMemo(()=>{let l,a,u;return typeof e=="function"?l=e(s):l=e,typeof n=="function"?a=n(s):a=n,typeof r=="function"?u=r(s):r==null?u=o:u=r,{className:l??i,style:a,children:u,"data-rac":""}},[e,n,r,i,o,s])}function Xj(t,e){let n=_.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(o=>`"${o}"`));if(!e&&!n.slots[_1])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let i=e||_1;if(!n.slots[i])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[i]}return n}function Zj(t,e,n){let r=Xj(n,t.slot)||{},{ref:i,[Jj]:o,...s}=r,l=yj(_.useMemo(()=>ij(e,i),[e,i])),a=Fr(s,t);return"style"in s&&s.style&&typeof s.style=="object"&&"style"in t&&t.style&&typeof t.style=="object"&&(a.style={...s.style,...t.style}),_.useEffect(()=>{o&&o(t)},[o,t]),[a,l]}if(typeof HTMLTemplateElement<"u"){const t=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild").get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:t.call(this)}})}const eU=_.createContext(!1);typeof DocumentFragment<"u"&&new DocumentFragment;function tU(t){let e=(n,r)=>_.useContext(eU)?null:t(n,r);return e.displayName=t.displayName||t.name,We.forwardRef(e)}const nU=new Set(["form","formAction","formEncType","formMethod","formNoValidate","formTarget","name","value"]),rU=_.createContext({});function iU(t,e){[t,e]=Zj(t,e,rU);let n=t,{buttonProps:r,isPressed:i}=qj(t,e),{focusProps:o,isFocused:s,isFocusVisible:l}=Vj(t),{hoverProps:a,isHovered:u}=zj(t),c=Qj({...t,values:{isHovered:u,isPressed:i,isFocused:s,isFocusVisible:l,isDisabled:t.isDisabled||!1},defaultClassName:"react-aria-Button"});return We.createElement("button",{...yx(t,{propNames:nU}),...Fr(r,o,a),...c,ref:e,slot:t.slot||void 0,"data-disabled":t.isDisabled||void 0,"data-pressed":n.isPressed||i||void 0,"data-hovered":u||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0})}const uZ=tU(iU);/** + * @license lucide-react v0.349.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var oU={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.349.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sU=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v0.349.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nx=(t,e)=>{const n=_.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:s,className:l="",children:a,...u},c)=>_.createElement("svg",{ref:c,...oU,width:i,height:i,stroke:r,strokeWidth:s?Number(o)*24/Number(i):o,className:["lucide",`lucide-${sU(t)}`,l].join(" "),...u},[...e.map(([f,d])=>_.createElement(f,d)),...Array.isArray(a)?a:[a]]));return n.displayName=`${t}`,n};/** + * @license lucide-react v0.349.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cZ=Nx("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/** + * @license lucide-react v0.349.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fZ=Nx("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);function Ix(t){return kc.sanitize(t,{ALLOWED_TAGS:["#text"],KEEP_CONTENT:!0})}function Yl(t,e){return t.reduce((n,r)=>n?r(n):null,e)}var lU=_i,aU=vt,uU=In,cU="[object String]";function fU(t){return typeof t=="string"||!aU(t)&&uU(t)&&lU(t)==cU}var dU=fU;const jo=xe(dU),Dx=t=>{if(!Array.isArray(t))throw new TypeError("customFilters should be given as an array");if(t.some(e=>typeof e!="function"))throw new TypeError("The given filter is not a function");return!0};var pU=Qb;function hU(t,e,n,r){return pU(t,function(i,o,s){e(r,n(i),o,s)}),r}var mU=hU,gU=mU;function yU(t,e){return function(n,r){return gU(n,t,e(r),{})}}var vU=yU,SU=eb,bU=vU,wU=Rl,EU=Object.prototype,CU=EU.toString,xU=bU(function(t,e,n){e!=null&&typeof e.toString!="function"&&(e=CU.call(e)),t[e]=n},SU(wU)),TU=xU;const Rx=xe(TU);function OU(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var Lx=OU;const xo=xe(Lx);function $U(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r1),o}),KU(t,YU(t),n),r&&(n=WU(n,JU|QU|XU,GU));for(var i=e.length;i--;)VU(n,e[i]);return n}),eW=ZU;const yh=xe(eW),N={AFlat:"Ab",A:"A",ASharp:"A#",BFlat:"Bb",B:"B",C:"C",CSharp:"C#",DFlat:"Db",D:"D",DSharp:"D#",EFlat:"Eb",E:"E",F:"F",FSharp:"F#",GFlat:"Gb",G:"G",GSharp:"G#"},vh={Ab:N.AFlat,A:N.A,"A#":N.ASharp,Bb:N.BFlat,B:N.B,"B#":N.C,Cb:N.B,C:N.C,"C#":N.CSharp,Db:N.DFlat,D:N.D,"D#":N.DSharp,Eb:N.EFlat,E:N.E,"E#":N.F,Fb:N.E,F:N.F,"F#":N.FSharp,Gb:N.GFlat,G:N.G,"G#":N.GSharp},M1={Lab:N.AFlat,La:N.A,"La#":N.ASharp,Sib:N.BFlat,Si:N.B,"Si#":N.C,Dob:N.B,Do:N.C,"Do#":N.CSharp,Reb:N.DFlat,Réb:N.DFlat,Re:N.D,Ré:N.D,"Re#":N.DSharp,"Ré#":N.DSharp,Mib:N.EFlat,Mi:N.E,"Mi#":N.F,Fab:N.E,Fa:N.F,"Fa#":N.FSharp,Solb:N.GFlat,Sol:N.G,"Sol#":N.GSharp},N1={...yh(vh,["Bb","B","B#"]),As:N.AFlat,Ais:N.ASharp,Hb:N.BFlat,Hes:N.BFlat,H:N.B,His:N.C,"H#":N.C,Ces:N.B,Cis:N.CSharp,Des:N.DFlat,Dis:N.DSharp,Es:N.EFlat,Eis:N.F,Fes:N.E,Fis:N.FSharp,Ges:N.GFlat,Gis:N.GSharp};function kg(t){let e;return Object.keys(t).reduce((n,r)=>(r.match(/.[b|#]$/)&&(e=r.replace("#","♯").replace("b","♭"),n[e]=t[r]),n),{})}const Fx={...vh,...kg(vh)},Bx={...M1,...kg(M1)},zx={...N1,...kg(N1)},Sh={...Fx,...Bx,...zx};Object.keys(Sh).sort((t,e)=>e.length-t.length);const tW=Object.keys(Fx).sort((t,e)=>e.length-t.length),nW=Object.keys(Bx).sort((t,e)=>e.length-t.length),rW=Object.keys(zx).sort((t,e)=>e.length-t.length),iW=[{name:"english",notes:tW},{name:"german",notes:rW},{name:"latin",notes:nW}],Ol=[N.A,N.ASharp,N.B,N.C,N.CSharp,N.D,N.DSharp,N.E,N.F,N.FSharp,N.G,N.GSharp],oW=[N.A,N.BFlat,N.B,N.C,N.DFlat,N.D,N.EFlat,N.E,N.F,N.GFlat,N.G,N.AFlat],jx={[N.CSharp]:N.DFlat,[N.DSharp]:N.EFlat,[N.FSharp]:N.GFlat,[N.GSharp]:N.AFlat,[N.ASharp]:N.BFlat},$l=Rx(jx),sW=[...Object.values(N),...Object.values(N).map(t=>t+"m")];class lW extends Error{constructor(){super("The given symbol is not a valid string"),this.name="InvalidInput"}}class aW extends Error{constructor(){super("An unexpected error happened. Maybe a custom filter returned null instead of throwing an exception?"),this.name="UnexpectedError"}}class Ag extends Error{constructor(e,n,r){super(e),this.name=r,this.chord=n}}class Ux extends Ag{constructor(e){const n=`"${e.input.symbol}" does not seems to be a chord`;super(n,e,"NoSymbolFound")}}class uW extends Ag{constructor(e,n){const r=`The chord descriptor "${e.input.descriptor}" contains unknown or duplicated modifiers: "${n}"`;super(r,e,"InvalidModifier")}}class cW extends Ag{constructor(e,n){const r=`"${e.input.symbol}" describes a chord with an invalid intervals combo: `+n.join(" and ");super(r,e,"InvalidIntervals")}}function Jl(t,e){const n=Gh(e)?e:[e];return ol(t,n)}function ue(t,e){return _g(t,e,"oneOf")}function Pg(t,e){return _g(t,e,"all")}function Pr(t,e){return _g(t,e,"none")}function _g(t,e,n){return(Gh(e)?e:[e])[n==="oneOf"?"some":"every"](o=>n==="none"?!t.includes(o):t.includes(o))}const fW=[["2","3"],["2","9"],["3","b3"],["4","11"],["5","b5"],["5","#5"],["b6","#5"],["b6","6"],["b6","13"],["6","13"],["b7","bb7"],["7","b7"],["9","b9"],["9","#9"],["11","#11"],["13","b13"]];function dW(t){const e=t.normalized.intervals,n=fW.find(r=>Pg(e,r));if(n)throw new cW(t,n);return t}function Wx(t){const{rootNote:e,bassNote:n,descriptor:r,chordChanges:i}=t.formatted;let o=e;return r&&(o+=r),i&&i.length&&(o+="("+i.join(",")+")"),n&&(o+="/"+n),t.formatted.symbol=o,t}const z={ma:"major",ma6:"major6",ma7:"major7",dom7:"dominant7",mi:"minor",mi6:"minor6",mi7:"minor7",miMa7:"minorMajor7",aug:"augmented",dim:"diminished",dim7:"diminished7",power:"power",bass:"bass"},Vx=[z.mi,z.mi6,z.mi7,z.miMa7,z.dim,z.dim7],pW={[z.ma]:()=>"",[z.ma6]:t=>t.normalized.intervals.includes("9")?"69":"6",[z.ma7]:t=>"ma"+Na(t),[z.dom7]:t=>t.normalized.intents.alt?"7alt":Na(t),[z.mi]:()=>"mi",[z.mi6]:t=>t.normalized.intervals.includes("9")?"mi69":"mi6",[z.mi7]:t=>"mi"+Na(t),[z.miMa7]:t=>"miMa"+Na(t),[z.aug]:()=>"+",[z.dim]:()=>"dim",[z.dim7]:()=>"dim7",[z.power]:()=>"5",[z.bass]:()=>" bass"},Gu={add:"add",add7:"Ma7",omit:"omit",sus:"sus"};function Hx(t){return t.formatted={rootNote:t.normalized.rootNote,bassNote:t.normalized.bassNote,descriptor:hW(t),chordChanges:mW(t)},t}function hW(t){let e=pW[t.normalized.quality](t);return t.normalized.isSuspended&&(e+=Gu.sus),e}function Na(t){const e=t.normalized.extensions;let n=e[e.length-1];return n==="11"&&t.normalized.intents.major&&(n=Pr(t.normalized.alterations,["b9","#9"])?"9":"7"),n||"7"}function mW(t){const e=vW(t.normalized.omits);if(gW(t))return e;const n=yW(t.normalized.quality,t.normalized.adds);return[...t.normalized.alterations,...n,...e]}function gW(t){return t.normalized.intents.alt&&t.normalized.quality===z.dom7}function yW(t,e){return e.filter(n=>!([z.ma6,z.mi6].includes(t)&&n==="9")).map((n,r)=>{let i="";return r===0&&(i+=Gu.add,["b","#"].includes(n[0])&&(i+=" ")),i+=n==="7"?Gu.add7:n,i})}function vW(t){return t.map((e,n)=>{let r="";return n===0&&(r+=Gu.omit),r+=e==="b3"?"3":e,r})}const Ki={flat:"♭",sharp:"♯"},SW={major:{0:"I",2:"II",3:`${Ki.flat}III`,4:"III",5:"IV",7:"V",8:`${Ki.flat}VI`,9:"VI",10:`${Ki.flat}VII`,11:"VII"},minor:{0:"I",2:"II",3:"III",4:`${Ki.sharp}III`,5:"IV",7:"V",8:"VI",9:`${Ki.sharp}VI`,10:"VII",11:`${Ki.sharp}VII`}},te={sup2:"²",sup4:"⁴",sup5:"⁵",sup6:"⁶",sup7:"⁷",sub3:"₃",sub4:"₄",sub5:"₅",flat:"♭",sharp:"♯"},Ia={major:["I","ii","iii","IV","V","vi","vii°"],dom7:["IΔ",`ii${te.sup7}`,`iii${te.sup7}`,"IVΔ",`V${te.sup7}`,`vi${te.sup7}`,"viiø"],minor:["i","ii°","III","iv","v","VI","VII"],minor7:[`i${te.sup7}`,"iiø","IIIΔ",`iv${te.sup7}`,`v${te.sup7}`,"VIΔ","VIIΔ"]},Da={borrowedFromMinor:["i","ii°",`${te.flat}III`,"iv","v",`${te.flat}VI`,`${te.flat}VII`],borrowedFromMinor7:[`i${te.sup7}`,"iiø",`${te.flat}IIIΔ`,`iv${te.sup7}`,`v${te.sup7}`,`${te.flat}VIΔ`,`${te.flat}VIIΔ`],borrowedFromMajor:["I","ii",`${te.sharp}iii`,"IV","V",`${te.sharp}vi`,`${te.sharp}vii°`],borrowedFromDom7:["IΔ",`ii${te.sup7}`,`${te.sharp}iii${te.sup7}`,"IVΔ",`V${te.sup7}`,`${te.sharp}vi${te.sup7}`,`${te.sharp}viiø`]};function bW(t="",e){let n,r,i;t||(t=e.normalized.rootNote);const o=t.indexOf("m")>-1?"minor":"major",s=Vx.includes(e.normalized.quality)?"minor":"major";n=wW(t,o,e,s);const l=OW(e),a=CW[e.normalized.quality](e,l);return r=`${n}${a}`,xW(o,r)?i="diatonic":TW(o,r)?i="borrowed":(i="unknown",n="?",r=`${n}${a}`),r+=l,e.numeral={symbol:r,degree:n,descriptor:a,inversion:l,type:i,thirdQuality:s},e}function wW(t,e,n,r){const i=t.replace("m",""),o=EW(i,n.normalized.rootNote),s=SW[e][o]||"?";return r==="minor"?s.toLowerCase():s}function EW(t,e){const n=Ol.indexOf($l[t]||t);return(Ol.indexOf($l[e]||e)-n+12)%12}const CW={[z.ma]:()=>"",[z.ma6]:()=>"",[z.ma7]:()=>"Δ",[z.dom7]:(t,e)=>e===""?`${te.sup7}`:"",[z.mi]:()=>"",[z.mi6]:()=>"",[z.mi7]:(t,e)=>t.normalized.intervals.includes("b5")?"ø":e===""?`${te.sup7}`:"",[z.miMa7]:()=>"mΔ",[z.aug]:()=>"+",[z.dim]:()=>"°",[z.dim7]:(t,e)=>e===""?`°${te.sup7}`:"°",[z.power]:()=>"",[z.bass]:()=>""};function xW(t,e){return t==="major"?Ia.major.includes(e)||Ia.dom7.includes(e):Ia.minor.includes(e)||Ia.minor7.includes(e)}function TW(t,e){return t==="major"?Da.borrowedFromMinor.includes(e)||Da.borrowedFromMinor7.includes(e):Da.borrowedFromMajor.includes(e)||Da.borrowedFromDom7.includes(e)}function OW(t){let e="";return t.normalized.bassNote&&($W(t)?e=I1(t)?`${te.sup6}${te.sub5}`:`${te.sup6}`:kW(t)?e=I1(t)?`${te.sup4}${te.sub3}`:`${te.sup6}${te.sub4}`:AW(t)&&(e="²")),e}function I1(t){return[z.ma7,z.mi7,z.miMa7,z.dom7,z.dim7].includes(t.normalized.quality)}function $W(t){return _r(t,"b3")||_r(t,"3")}function kW(t){return _r(t,"b5")||_r(t,"5")||_r(t,"#5")}function AW(t){return _r(t,"bb7")||_r(t,"b7")||_r(t,"7")}function _r(t,e){const n=t.normalized.intervals.indexOf(e);if(n===-1)return!1;const r=$l[t.normalized.bassNote]||t.normalized.bassNote,i=$l[t.normalized.notes[n]]||t.normalized.notes[n];return r===i}function PW(t){const e=[_W,MW,NW,IW];return t.input.descriptor&&(t.input.parsableDescriptor=Yl(e,t.input.descriptor)),t}function _W(t){return t.replace(/[A-LN-Za-z]+/g,e=>e.toLowerCase()).replace("oMit","omit").replace("diM","dim").replace("augMented","augmented")}function MW(t){return t.replace(/ /g,"")}function NW(t){return t.replace(/(7?dim)(alt|add)/g,"$1 $2").replace(/([m|M])(alt|add)/g,"$1 $2").replace(/i(no[35])/g,"i $1").replace(/([b♭#♯]9)6/g,"$1 6").replace(/(9\/?6)/g," $1").replaceAll("+5","#5").replaceAll("-5","b5")}function IW(t){let e,n,r;return t.replace(/\((.*?)\)/g,(i,o)=>(e=[],n="",o.split(",").forEach(s=>{r=!0,s.startsWith("add")?n="add":s.startsWith("omit")?n="omit":s.startsWith("no")?n="no":r=!1,r?e.push(s):e.push(n+s)})," "+e.join(" ")+" "))}function DW(t={},e){return{input:{symbol:e},normalized:{},formatted:{},parserConfiguration:oe(t)}}const RW={C:"flat",D:"sharp",E:"sharp",F:"flat",G:"sharp",A:"sharp",B:"sharp",Cm:"flat",Dm:"flat",Em:"sharp",Fm:"flat",Gm:"flat",Am:"flat",Bm:"sharp"};function LW(t){return t.indexOf("#")>-1?"sharp":t.indexOf("b")>-1?"flat":RW[t]}function Mg(t){const e=t.normalized.rootNote,n=t.normalized.semitones,r=t.normalized.quality;let i=e;Vx.includes(r)&&(i+="m");const o=LW(i)==="sharp"?Ol:oW,s=o.indexOf(e),l=[...o.slice(s),...o.slice(0,s),...o.slice(s),...o.slice(0,s)];return t.normalized.notes=n.map(a=>l[a]),t}function FW(t){return t.normalized.rootNote=Sh[t.input.rootNote],t.input.bassNote&&(t.normalized.bassNote=Sh[t.input.bassNote]),t}var BW=fm,zW=4;function jW(t){return BW(t,zW)}var UW=jW;const Ng=xe(UW);var WW=$c,VW=Ni,HW=rs;function KW(t){return function(e,n,r){var i=Object(e);if(!VW(e)){var o=WW(n);e=HW(e),n=function(l){return o(i[l],l,i)}}var s=t(e,n,r);return s>-1?i[o?e[s]:s]:void 0}}var GW=KW;function qW(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o-1}var Ig=LV;function FV(t,e,n){for(var r=-1,i=t==null?0:t.length;++r=XV){var u=e?null:JV(t);if(u)return QV(u);s=!1,i=YV,a=new KV}else a=e?[]:l;e:for(;++r=cH&&(o=uH,s=!1,e=new iH(e));e:for(;++il.qualityIntervals.length-s.qualityIntervals.length);return OV(o,s=>Pg(i,s.qualityIntervals))}function EH(t,e,n,r){const i=[CH.bind(null,r),xH.bind(null,n,e.normalized.intents.major),TH.bind(null,e.normalized.intents.alt),Yx];return Yl(i,Ng(t))}function CH(t,e){const n=Ng(e);return t.includes("3")?n.push("3"):t.includes("b3")&&n.push("b3"),n}function xH(t,e,n){if(t){const r=Qx(n,"4");return r.push(e?"3":"b3"),r}return n}function TH(t,e){if(t){const n=Qx(e,"b5","#5");return n.push("5"),n}return e}function OH(t,e){const n=[];return $H(e)&&(kH(t,e)?n.push("9","11","13"):AH(t,e)?n.push("9","13"):PH(t)?n.push("9","11"):_H(t)&&n.push("9")),n}function $H(t){return[z.ma7,z.dom7,z.mi7,z.miMa7].includes(t)}function Zx(t){return[z.mi7,z.miMa7].includes(t)}function kH(t,e){return Zx(e)&&ue(t,"13")&&ue(t,["11","#11"])&&ue(t,["b9","9","#9"])}function AH(t,e){return!Zx(e)&&ue(t,"13")&&ue(t,["b9","9","#9"])}function PH(t){return ue(t,"11")&&ue(t,["b9","9","#9"])}function _H(t){return t.includes("9")}function MH(t,e,n){const r=[],i=[];return t.filter(o=>o!=="5"&&o!=="4").forEach(o=>{e.includes(o)||(NH(n,o)?i.push(o):r.push(o))}),IH(t)&&r.push("3"),{adds:F1(r),alterations:F1(i)}}function NH(t,e){return{[z.ma]:["b5","#5","#11","b13"],[z.ma6]:["b5","#5","#11","b13"],[z.ma7]:["b5","#5","#11","b13"],[z.dom7]:["b5","#5","b9","#9","#11","b13"],[z.mi]:["b5","#5","#11","b13"],[z.mi6]:["b5","#5","#11","b13"],[z.mi7]:["b5","#5","#11","b13"],[z.miMa7]:["b5","#5","#11","b13"],[z.aug]:[],[z.dim]:[],[z.dim7]:[]}[t].includes(e)}function IH(t){return Pg(t,["3","4"])}function F1(t){return t.sort((e,n)=>{const r=Number.parseInt(e.replace(/[b#]/,"")),i=Number.parseInt(n.replace(/[b#]/,""));return r-i})}function DH(t,e){const{symbol:n}=e.input,r=t.join("|"),i=new RegExp("^("+r+")(.*?)(/("+r+"))?$"),o=n.match(i);if(o&&o[1])return e.input.rootNote=o[1],o[2]&&(e.input.descriptor=o[2]),o[4]&&(e.input.bassNote=o[4]),e;throw new Ux(e)}const O={ma:"ma",mi:"mi",dim:"dim",halfDim:"halfDim",aug:"aug",seventh:"seventh",sus:"sus",sus2:"sus2",ninth:"ninth",eleventh:"eleventh",thirteenth:"thirteenth",fifthFlat:"b5",fifthSharp:"#5",ninthFlat:"b9",ninthSharp:"#9",eleventhSharp:"#11",thirteenthFlat:"b13",add3:"add3",add4:"add4",addb6:"addb6",add6:"add6",add69:"add69",add7:"add7",add9:"add9",add11:"add11",add13:"add13",bass:"bass",omit3:"omit3",omit5:"omit5",power:"power",alt:"alt"},Rg={"^":[O.ma,O.add7],Δ:[O.ma,O.add7],M:O.ma,Ma:O.ma,Maj:O.ma,Major:O.ma,ma:O.ma,maj:O.ma,major:O.ma},RH=tT(Rg,O.add7,t=>t+"7"),LH=tT(Rg,O.add7,t=>"add"+t+"7"),eT={...Rg,...RH,"-":O.mi,m:O.mi,Mi:O.mi,Min:O.mi,Minor:O.mi,mi:O.mi,min:O.mi,minor:O.mi,"°":O.dim,o:O.dim,0:O.dim,dim:O.dim,"dim.":O.dim,diminished:O.dim,Ø:O.halfDim,ø:O.halfDim,h:O.halfDim,"+":O.aug,aug:O.aug,augmented:O.aug,7:O.seventh,4:O.sus,sus:O.sus,sus4:O.sus,suspended:O.sus,suspended4:O.sus,sus2:O.sus2,suspended2:O.sus2,9:O.ninth,11:O.eleventh,13:O.thirteenth,b3:O.mi,b5:O.fifthFlat,"♭5":O.fifthFlat,"#5":O.fifthSharp,"♯5":O.fifthSharp,b9:O.ninthFlat,"♭9":O.ninthFlat,addb9:O.ninthFlat,"add♭9":O.ninthFlat,"#9":O.ninthSharp,"♯9":O.ninthSharp,"add#9":O.ninthSharp,"add♯9":O.ninthSharp,"#11":O.eleventhSharp,"♯11":O.eleventhSharp,"add#11":O.eleventhSharp,b13:O.thirteenthFlat,"♭13":O.thirteenthFlat,addb13:O.thirteenthFlat,"add♭13":O.thirteenthFlat,...LH,2:O.add9,add2:O.add9,add3:O.add3,add4:O.add4,addb6:O.addb6,b6:O.addb6,6:O.add6,add6:O.add6,"6/9":O.add69,69:O.add69,96:O.add69,"9/6":O.add69,add9:O.add9,add11:O.add11,add13:O.add13,bass:O.bass,omit3:O.omit3,no3:O.omit3,omit5:O.omit5,no5:O.omit5,5:O.power,alt:O.alt,"alt.":O.alt,altered:O.alt};function tT(t,e,n){return Object.keys(t).map(n).reduce((r,i)=>(r[i]=e,r),{})}const FH=Object.keys(eT).sort((t,e)=>e.length-t.length),qu={1:0,2:2,b3:3,3:4,4:5,b5:6,5:7,"#5":8,b6:8,6:9,bb7:9,b7:10,7:11,b9:13,9:14,"#9":15,11:17,"#11":18,b13:20,13:21};function BH(t,e){let n=[];return e.input.parsableDescriptor&&(n=zH(e)),e.input.modifiers=n,e.normalized.intervals=jH(n,t),e.normalized.semitones=QH(e.normalized.intervals),e.normalized.intents=XH(n),e}function zH(t){const{parsableDescriptor:e}=t.input,n=[],r=new RegExp(FH.map(JH).join("|"),"g"),i=e.match(r);let o=e,s;if(i&&i.forEach(l=>{s=eT[l],Array.isArray(s)||(s=[s]),s.forEach(a=>{n.includes(a)||(n.push(a),o=o.replace(l,""))})}),n.length===0)throw new Ux(t);if(o.trim().length>0)throw new uW(t,o);return n}function jH(t,e){return t.includes(O.power)?["1","5"]:t.includes(O.bass)?["1"]:Yx(["1",...UH(t),...WH(t),...VH(t,e),...HH(t),...KH(t),...GH(t,e),...qH(t,e),...YH(t,e)]).sort((n,r)=>qu[n]-qu[r])}function UH(t){const e=[];return t.includes(O.omit3)?[]:(ue(t,[O.sus,O.sus2])||(Lg(t)?t.includes(O.eleventh)||e.push("3"):e.push("b3")),t.includes(O.add3)&&e.push("3"),e)}function WH(t){const e=[];return ue(t,[O.sus,O.add4])&&e.push("4"),e}function VH(t,e){const n=[];return t.includes(O.omit5)?[]:((ue(t,[O.dim,O.halfDim,O.fifthFlat])||Uo(t,e,"b5"))&&n.push("b5"),(ue(t,[O.aug,O.fifthSharp])||Uo(t,e,"#5"))&&n.push("#5"),!n.length&&!t.includes(O.thirteenthFlat)&&n.push("5"),n)}function HH(t){const e=[];return ue(t,[O.addb6])&&e.push("b6"),ue(t,[O.add6,O.add69])&&!nT(t)&&!ue(t,[O.halfDim])&&e.push("6"),e}function KH(t){const e=[];return ue(t,[O.alt])&&e.push("b7"),ue(t,[O.seventh,O.halfDim])?t.includes(O.dim)?e.push("bb7"):t.includes(O.halfDim)?e.push("b7"):e.push(B1(t)):ue(t,[O.ninth,O.eleventh,O.thirteenth])&&e.push(B1(t)),t.includes(O.add7)&&e.push("7"),e}function B1(t){return t.includes(O.ma)?"7":"b7"}function GH(t,e){const n=[];return ue(t,[O.add69,O.ninth,O.eleventh,O.thirteenth])&&Pr(t,[O.ninthFlat,O.ninthSharp])&&n.push("9"),ue(t,[O.sus2,O.add9])&&n.push("9"),(ue(t,[O.ninthFlat])||Uo(t,e,"b9"))&&n.push("b9"),(ue(t,[O.ninthSharp])||Uo(t,e,"#9"))&&n.push("#9"),n}function qH(t,e){const n=[];return(ue(t,[O.thirteenth])&&!Lg(t)||ue(t,[O.eleventh,O.add11]))&&n.push("11"),(ue(t,[O.eleventhSharp])||Uo(t,e,"#11"))&&n.push("#11"),n}function YH(t,e){const n=[];return(ue(t,[O.add13,O.thirteenth])||ue(t,[O.add6,O.add69])&&nT(t)||ue(t,[O.add6,O.add69])&&ue(t,[O.halfDim]))&&n.push("13"),(ue(t,[O.thirteenthFlat])||Uo(t,e,"b13"))&&n.push("b13"),n}function Uo(t,e,n){return t.includes(O.alt)&&e.includes(n)}function Lg(t){return Pr(t,[O.mi,O.dim,O.dim7,O.halfDim])}function nT(t){return ue(t,[O.seventh,O.ninth,O.eleventh,O.thirteenth])}function JH(t){return t.replace(/[.\-*+?^${}()|[\]\\]/g,"\\$&")}function QH(t){return t.map(e=>qu[e]).sort((e,n)=>e-n)}function XH(t){return{major:Lg(t),eleventh:t.includes(O.eleventh),alt:t.includes(O.alt)}}function hf(t={}){const e=["b5","#5","b9","#9","#11","b13"],n=["english","german","latin"],{notationSystems:r=oe(n),altIntervals:i=oe(e),customFilters:o=[],key:s=""}=t;return ZH(i,e),eK(r,n),Dx(o),tK(s),l;function l(a){const u=[];if(!nK(a)){const h=new lW;u.push(bh(h))}const c=oe(iW).filter(h=>r.includes(h.name));let f,d,p;if(!u.length)for(;c.length&&!f;){p=c.shift(),d=[DW.bind(null,t),DH.bind(null,p.notes),PW,BH.bind(null,i),dW,FW,Xx,Hx,Wx,Mg,bW.bind(null,s),...o];try{f=Yl(d,a),f?f.input.notationSystem=p.name:u.push(rK(p.name))}catch(h){u.push(bh(h,p.name))}}return f||{error:u}}}function ZH(t,e){rT("altIntervals",t,e,!0)}function eK(t,e){rT("notationSystems",t,e)}function rT(t,e,n,r){if(!Array.isArray(e))throw new TypeError(`'${t}' should be an array`);if(!r&&e.length===0)throw new TypeError(`'${t}' cannot be empty`);e.forEach(i=>{if(!n.includes(i))throw new TypeError(`'${i}' is not a valid value for ${t}`)})}function tK(t){if(t!==""&&(!jo(t)||!sW.includes(t)))throw new TypeError(`'${t}' is not a valid value for key`)}function nK(t){return typeof t=="string"&&t.length>0}function rK(t){const e=new aW;return bh(e,t)}function bh(t,e){return{type:t.name,chord:t.chord,message:t.message,notationSystem:e}}const zn={sus2:"sus2",add2:"2",omit:"no",ma:"M",mi:"m",dim:"°",aug7:"7+",eleventh:"11"};function iK(t){let e,n=t.formatted.chordChanges;return oK(t)?(e=zn.sus2,n=[]):sK(t)?(e=zn.add2,n=[]):lK(t)?(e=zn.aug7,n=[]):(e=t.formatted.descriptor.replace("mi",zn.mi).replace(/[m|M]a/,zn.ma).replace("dim",zn.dim),aK(t)&&(e=e.replace(/7sus|9sus/,zn.eleventh))),n=n.map(r=>r.replace(/[m|M]a/,zn.ma).replace("omit",zn.omit)),{...t,formatted:{...t.formatted,descriptor:e,chordChanges:n}}}function oK(t){return Jl(t.normalized.intervals,["1","5","9"])}function sK(t){return Jl(t.normalized.intervals,["1","3","5","9"])}function lK(t){return Jl(t.normalized.intervals,["1","3","#5","b7"])}function aK(t){return t.normalized.intents.eleventh}var uK=Jx,cK=lm,fK=qo,z1=gc,dK=fK(function(t,e){return z1(t)?uK(t,cK(e,1,z1,!0)):[]}),pK=dK;const hK=xe(pK);function mK(t="none",e){if(t==="none")return e;const n={max:["4","b5","#5","6","bb7","b7","7","b9","9","#9","11","#11","b13","13"],core:["4","b9","9","#9","11","#11","b13","13"]},r=hK(e.normalized.intervals,n[t]);return Pr(r,["b3","3"])&&r.push(e.normalized.intents.major?"3":"b3"),Pr(r,["b5","5","#5"])&&r.push("5"),e.normalized.intervals=r,e.normalized.semitones=r.map(o=>qu[o]),e.normalized.intents.eleventh=!1,e.normalized.intents.alt=!1,t==="max"&&delete e.normalized.bassNote,Yl([Xx,Hx,Mg],e)}function gK(t,e,n){const{rootNote:r,bassNote:i}=n.normalized,o=U1(r);if(n.normalized.rootNote=j1(o,t,e),n.formatted.rootNote=n.normalized.rootNote,i){const s=U1(i);n.normalized.bassNote=j1(s,t,e),n.formatted.bassNote=n.normalized.bassNote}return Mg(n)}function j1(t,e,n){const i=Ol.indexOf(t)+e,o=Math.floor(i/12),s=i-o*12,l=Ol[s];return n==="flat"&&jx[l]||l}function U1(t){return $l[t]||t}const wh={german:{Ab:"As",A:"A","A#":"Ais",Bb:"Hes",B:"H",C:"C","C#":"Cis",Db:"Des",D:"D","D#":"Dis",Eb:"Es",E:"E",F:"F","F#":"Fis",Gb:"Ges",G:"G","G#":"Gis"},latin:{Ab:"Lab",A:"La","A#":"La#",Bb:"Sib",B:"Si",C:"Do","C#":"Do#",Db:"Reb",D:"Re","D#":"Re#",Eb:"Mib",E:"Mi",F:"Fa","F#":"Fa#",Gb:"Solb",G:"Sol","G#":"Sol#"}},yK=Object.keys(wh);function vK(t="english",e){const n=t==="auto"?e.input.notationSystem:t;return n==="english"?e:yK.includes(n)?(e.formatted.rootNote=wh[n][e.formatted.rootNote],e.formatted.bassNote&&(e.formatted.bassNote=wh[n][e.formatted.bassNote]),e):null}function iT(t){return t&&t.formatted&&t.formatted.symbol?t.formatted.symbol:null}function SK(t){delete t.parserConfiguration.notationSystems;const e=oe(t),n=iT(t),i=hf(t.parserConfiguration)(n);return e.input=i.input,e}function oT({accidental:t="original",customFilters:e=[],notationSystem:n="english",printer:r="text",simplify:i="none",transposeValue:o=0,useShortNamings:s=!1}={}){Dx(e);const l=[];return["max","core"].includes(i)&&l.push(mK.bind(null,i)),(t!=="original"||o!==0)&&l.push(gK.bind(null,o,t)),s&&l.push(iK),l.push(vK.bind(null,n),Wx,...e),a;function a(u){if(!bK(u))return null;const c=Yl(l,oe(u));return r==="raw"?SK(c):iT(c)}}const bK=t=>t&&typeof t=="object"&&!t.error&&t.input,sT=/([^\s]+)/g,Eh=/\[([^\]]*)]/g,lT=t=>{const e=t.trim().match(sT);return e?e.every(uT):!1},aT=t=>{const e=t.trim().match(Eh);return e?e.map(n=>n.replace(/[[\]]/g,"")).every(uT):!1};function uT(t){return!hf()(t).error}const cT=(t,e)=>{for(;t.length&&e(t[0]);)t.shift();for(;t.length&&e(t[t.length-1]);)t.pop();return t},wK={adlib:"a","ad-lib":"a","ad.lib.":"a",bridge:"b",chorus:"c",intro:"i",introduction:"i",outro:"o",prechorus:"p","pre-chorus":"p","pre chorus":"p",solo:"s",interlude:"u",verse:"v"},fT=t=>{let e="#";const n="(.*?)",r="([\\s]+[0-9]{1,2})?",i="([\\s]+[x][0-9]{1,2})?",o=new RegExp(`^${n}${r}${i}$`),[,s,,l]=t.trim().match(o),a=s.trim().toLowerCase();return e+=wK[a]||s.trim(),l&&(e+=" "+l.trim()),e},ft={EMPTY:"empty",DIRECTIVE:"directive",COMMENT:"comment",LYRICS:"lyrics",CHORDS_LYRICS:"chordsLyrics",SECTION_START:"sectionStart",SECTION_CLOSE:"sectionClose",SECTION_REPEAT:"sectionRepeat"},EK=["chorus","verse","bridge","comment","comment_italic","comment_bold","c","ci","cb"],CK=["start_of_chorus","start_of_verse","start_of_bridge","start_of_part","soc","sov","sob","sop"],xK=["end_of_chorus","end_of_verse","end_of_bridge","end_of_part","eoc","eov","eob","sop"],TK={chorus:"c",verse:"v",bridge:"b",start_of_chorus:"c",start_of_verse:"v",start_of_bridge:"b",start_of_part:"v",soc:"c",sov:"v",sob:"b",sop:"v",c:"c",ci:"c",cb:"c",comment:"c",comment_italic:"c",comment_bold:"c"},OK=t=>{const e=[],n=t.map(i=>$K(i)).filter(i=>NK(i)),r=IK(n);return r.forEach((i,o)=>{e.push(i.label),i.allLines.forEach(s=>{e.push(s)}),o{const e={content:t};if(kK(t))e.type=ft.COMMENT;else if(AK(t))e.type=ft.EMPTY;else if(PK(t)){const[n,r]=_K(t);e.key=n,e.value=r,CK.includes(n)?e.type=ft.SECTION_START:xK.includes(n)?e.type=ft.SECTION_CLOSE:EK.includes(n)?e.type=ft.SECTION_REPEAT:e.type=ft.DIRECTIVE}else if(aT(t)){e.type=ft.CHORDS_LYRICS;const[n,r]=MK(t);e.chords=n,e.lyrics=r}else e.type=ft.LYRICS;return e},kK=t=>{const e=/^#.*$/;return t.trim().match(e)!==null},AK=t=>t.trim()==="",dT=/^{([^:]+):?(.*)?}$/,PK=t=>t.trim().match(dT)!==null,_K=t=>{const e=t.trim().match(dT),n=e[1].trim(),r=e[2]?e[2].trim():void 0;return[n,r]},MK=t=>{const n=t.trim().match(Eh).map(i=>i.replace("[","").replace("]","")).join(" "),r=t.replace(Eh,"_");return[n,r]},NK=t=>![ft.COMMENT,ft.DIRECTIVE].includes(t.type),IK=t=>{let e=[],n;const r=()=>{n&&(e.push(n),n=void 0)},i=o=>{n={label:o?DK(o):"#v",allLines:[]}};return t.forEach(o=>{o.type===ft.SECTION_START?(r(),i(o)):o.type===ft.SECTION_CLOSE?r():o.type===ft.SECTION_REPEAT?(r(),i(o),r()):o.type===ft.EMPTY?n&&n.allLines.push(o.content):(n||i(),o.type===ft.CHORDS_LYRICS?(n.allLines.push(o.chords),n.allLines.push(o.lyrics)):n.allLines.push(o.content))}),r(),e.map(o=>(o.allLines=cT(o.allLines,s=>s===""),o))},DK=t=>{let e;return t.value?e=fT(t.value):e="#"+TK[t.key],e},RK=t=>{let n=0;return t.replace(/\t/g,(i,o)=>{let s=4-(o+n)%4;return n+=s-1," ".repeat(s)}).length},pi=(t,e,n)=>(n>t.length&&(t+=" ".repeat(n-t.length)),t.slice(0,n)+e+t.slice(n)),LK=t=>{const e=[];let n=[];return t.forEach(r=>{lT(r)?(e.push(zK(r)),n=jK(r)):(FK(r)?e.push(BK(r)):n.length&&r.trim()!==""?e.push(VK(r,n)):e.push(r),n=[])}),e.join(` +`)},pT=/^\[([^\]]+)]$/,FK=t=>{const e=t.trim().match(pT);return e!==null&&e[1].trim()!==""},BK=t=>{const e=t.trim().match(pT)[1];return fT(e)};function zK(t){return t.match(sT).join(" ")}function jK(t){const e=[];let n=0;const r=t.match(/([\s])+/g)||[],i=t.match(/([^\s])+/g);return UK(t)||r.unshift(""),WK(t)&&r.pop(),r.forEach((o,s)=>{const l=RK(" ".repeat(n)+o);e.push(l),n=l+i[s].length}),e}const UK=t=>hT(t.charAt(0)),WK=t=>hT(t.charAt(t.length-1)),hT=t=>t.match(/[\s]/),VK=(t,e)=>{const n="_";let r=t,i=0;return e.forEach(o=>{const s=Math.min(o+i,r.length+1);r=pi(r,n,s),i+=n.length}),r.replace(/[\s]+/g," ").trim()},ei={AUTO:"auto",CP:"chordPro",COL:"chordsOverLyrics"},dZ=(t,{inputFormat:e=ei.AUTO}={})=>{HK(e);const n=KK(t);let r=e;e===ei.AUTO&&(r=GK(n)?ei.CP:ei.COL);let i;switch(r){case ei.CP:i=OK;break;case ei.COL:i=LK;break}return i(n)},HK=t=>{if(!Object.values(ei).includes(t))throw new Error("unknown input format: "+t)},KK=t=>Ix(t).replace(/\r\n/g,` +`).replace(/\n\r/g,` +`).replace(/\r/g,` +`).replace(/\[\/?ch]/g,"").replace(/\[\/?tab]/g,"").split(` +`),GK=t=>{const e=t.filter(aT),n=t.filter(lT);return e.length>n.length};function qK(t){return kc.sanitize(t)}function mT(t){return kc.sanitize(t,{ALLOWED_TAGS:["#text"],KEEP_CONTENT:!0})}const G={CHORD:"chord",EMPTY_LINE:"emptyLine",KEY_DECLARATION:"keyDeclaration",LYRIC:"lyric",SECTION_LABEL:"sectionLabel",TIME_SIGNATURE:"timeSignature"};var YK=Fb,gT=/[\\^$.*+?()[\]{}|]/g,JK=RegExp(gT.source);function QK(t){return t=YK(t),t&&JK.test(t)?t.replace(gT,"\\$&"):t}var XK=QK;const Br=xe(XK);function rr(t){return t.replace(/\t+/g," ").replace(/ +/g," ").trim()}const ZK=["2/2","3/2","4/2","2/4","3/4","4/4","5/4","6/4","7/4","9/4","10/4","3/8","4/8","5/8","6/8","7/8","9/8","12/8"];function kl(t){return ZK.includes(t)}function Yu(t){if(!kl(t))throw new TypeError("Expected time signature string, received: "+t);const e=t.split("/"),n=Number.parseInt(e[0],10),r=Number.parseInt(e[1],10);let i=n;return r===2?i=n*2:r===8&&(i=n/3),{string:t,count:n,value:r,beatCount:i}}const fe={barRepeat:"%",chordBeatCount:".",chordLineRepeat:"%",chordPositionMarker:"_",lyricLine:":",keyDeclarationPrefix:"key ",noChord:"NC",sectionLabel:"#",subBeatOpener:"[",subBeatCloser:"]"},yT=Yu("4/4");function eG(t){return!hf()(t).error}const tG=new RegExp(Br(fe.chordBeatCount)+"*$","g"),nG=new RegExp("^"+Br(fe.barRepeat)+"+$");function rG(t=""){return rr(vT(t)).split(" ").every((e,n,r)=>{const i=ST(e);return eG(i)||e.match(nG)&&n>0||i===fe.noChord||kl(e)&&r.length>1})}const vT=t=>t.replaceAll("add ","add"),ST=t=>oG(iG(t)),iG=t=>t.replace(tG,""),oG=t=>{let e=t;return t.startsWith(fe.subBeatOpener)&&(e=e.substring(fe.subBeatOpener.length)),t.endsWith(fe.subBeatCloser)&&(e=e.substring(0,e.length-fe.subBeatCloser.length)),e};function sG(t){const e=rr(t);return e===fe.chordLineRepeat||e===fe.chordLineRepeat.repeat(2)}function W1(t){return rr(t)===""}const bT=new RegExp("^"+Br(fe.sectionLabel)+"([a-zA-Z]+)([1-9])?( x[1-9][0-9]?)?$");function Ju(t){return rr(t).match(bT)!==null}function lG(t,e={}){return hf({key:e.string})(t)}var aG=vn,uG=aG.isFinite;function cG(t){return typeof t=="number"&&uG(t)}var fG=cG;const To=xe(fG);class dG extends Error{constructor({string:e,duration:n,currentBeatCount:r,beatCount:i}={}){if(!e||!jo(e))throw new TypeError("InvalidBeatCountException cannot be created without chord string, received: "+e);if(!n||!To(n))throw new TypeError("InvalidBeatCountException cannot be created without chord duration, received: "+n);if(!r||!To(r))throw new TypeError("InvalidBeatCountException cannot be created without currentBeatCount, received: "+r);if(!i||!To(i))throw new TypeError("InvalidBeatCountException cannot be created without beatCount, received: "+i);super(),this.name="InvalidBeatCountException",this.string=e,this.duration=n,this.currentBeatCount=r,this.beatCount=i}}class pG extends Error{constructor({string:e}={}){if(!e||!jo(e))throw new TypeError("InvalidChordRepetitionException cannot be created without chord string, received: "+e);super(),this.name="InvalidChordRepetitionException",this.string=e}}class Qs extends Error{constructor({chordLine:e,symbol:n,position:r}={}){if(!e||!jo(e))throw new TypeError("InvalidSubBeatGroupException cannot be created without a chordLine, received: "+e);if(!n||!jo(n))throw new TypeError("InvalidSubBeatGroupException cannot be created without symbol, received: "+n);if(!To(r))throw new TypeError("InvalidSubBeatGroupException cannot be created without symbol position, received: "+r);super(),this.name="InvalidSubBeatGroupException",this.chordLine=e,this.symbol=n,this.position=r}}class hG extends Error{constructor({string:e}={}){if(!e||!jo(e))throw new TypeError("InvalidBarRepeatException cannot be created without chord string, received: "+e);super(),this.name="InvalidBarRepeatException",this.string=e}}const mG=new RegExp(Br(fe.chordBeatCount),"g"),gG=new RegExp("^"+Br(fe.barRepeat)+"+$");function yG(t,{timeSignature:e=yT,originalKey:n={}}={}){let{beatCount:r}=e;const i=[],o={allChords:[]},s={};let l=oe(o),a={},u,c=0,f,d=!1,p=0,h=!1;_G(t);const v=rr(vT(t)).split(" ");return v.forEach((x,P)=>{x.match(gG)?S(x):kl(x)?m(x):(y(x),xG(c,r)?C():TG(a,c,r,v.length===P+1))}),PG(i,s),{allBars:i,originalKey:n};function S(x){if(c===0&&f&&ol(e,f.timeSignature)){const P=oe(f);P.isRepeated=!0;for(let b=0;b4)throw new Qs({chordLine:t,symbol:x,position:0})}function C(){l.timeSignature=e,l.lineHadTimeSignatureChange=h,l.hasUnevenChordsDurations=AG(l);const x=oe(l);l.isRepeated=ol(l,f),i.push(oe(l)),f=x,l=oe(o),c=0}}function vG(t,e){if(SG(e))throw new Qs({chordLine:t,symbol:e,position:0})}function SG(t){return t.indexOf(fe.chordBeatCount)>-1}function bG(t){return t===fe.noChord}function wG(t,e,n){return n?0:(t.match(mG)||[]).length||e}function EG(t,e){if(t.allChords.length>0){const n=t.allChords[t.allChords.length-1];if(ol(n.model,e.model)&&!CG(n,e))throw new pG({string:e.string})}}function CG(t,e){return e.string.startsWith(fe.subBeatOpener)||t.string.endsWith(fe.subBeatCloser)&&!e.model.isInSubBeatGroup}function xG(t,e){return t===e}function TG(t,e,n,r){if(OG(e,n,r))throw new dG({string:t.string,duration:t.duration,currentBeatCount:e,beatCount:n})}function OG(t,e,n){return $G(t,e)||kG(t,e,n)}function $G(t,e){return t>e}function kG(t,e,n){return n&&tn.duration!==e)}function PG(t,e){let n=-1,r=0,i="";t.forEach((o,s)=>{o.allChords.forEach(l=>{if(l.isInSubBeatGroup){const a=s+l.beat;a!==i&&(n++,r=0);const u=(1/e[n]).toPrecision(2);l.duration=Number.parseFloat(u),l.isFirstOfSubBeat=r===0,l.isLastOfSubBeat=r===e[n]-1,i=a,r++}})})}function _G(t){const e={};let n=!1,r;const i=new RegExp(Br(fe.subBeatOpener)+"|"+Br(fe.subBeatCloser),"g");for(;r=i.exec(t);){const o=r[0];if(e.chordLine=t,e.symbol=o,e.position=i.lastIndex-1,r[0]===fe.subBeatOpener){if(n)throw new Qs(e);n=!0}else{if(!n)throw new Qs(e);n=!1}}if(n)throw new Qs(e)}const hr="A,A#,B,C,C#,D,D#,E,F,F#,G,G#".split(","),MG="Ab,Bb,Db,Eb,Gb".split(","),V1=[...hr,...MG],NG=[...V1,...V1.map(t=>t+"m")],Qu={Ab:"G#",Bb:"A#",Db:"C#",Eb:"D#",Gb:"F#"},IG=Rx(Qu);function DG(t){return NG.includes(t)}function Fg(t){return["G","Em","D","Bm","A","F#m","E","C#m","B","G#m","F#","D#m","C#","A#m","G#","D#","A#"].includes(t)?"sharp":"flat"}function H1(t,e,n){const r={"G#":"Ab","D#":"Eb","A#":"Bb",Dbm:"C#m",Gbm:"F#m"};let i;if(e===0&&n==="auto")i=t.string;else{const s=n==="auto"?e<0?"flat":"sharp":n;i=RG(t.string,e,s)}const o=n==="auto"&&r[i]?r[i]:i;return{string:o,accidental:Fg(o)}}function RG(t,e,n){const r=t.endsWith("m"),i=t.replace("m",""),o=Qu[i]||i;let l=hr.indexOf(o)+e;l<0?l+=hr.length:l>=hr.length&&(l-=hr.length);const a=hr[l],u=n==="flat"&&IG[a]||a;return r?u+"m":u}function LG(t){const e=FG(t);return e?{string:e,accidental:Fg(e)}:void 0}function FG(t){const e=BG(t);if(e.length===0)return;if(e.length===1)return e[0].keyString;const n=e.find(i=>i.isLast===!0);if(n)return n.keyString;const r=e.find(i=>i.isFirst===!0);return r?r.keyString:e[0].keyString}function BG(t){let e=0,n=[];const r=[];return oe(t).map(i=>(i.keyString=zG(i),i)).forEach(i=>{const o=qx(r,s=>s.keyString===i.keyString);o===-1?r.push(i):(r[o].duration+=i.duration,i.isLast&&(r[o].isLast=!0))}),r.map(i=>(i.isLast&&(i.duration*=1.25),i.isFirst&&(i.duration*=1.25),i)).forEach(i=>{i.duration>e?(n=[i],e=i.duration):i.duration===e&&n.push(i)}),n}function zG(t){const e=oe(t.model),n=["major","major6","major7","dominant7","augmented","power","bass"];let r=e.formatted.rootNote;return n.includes(e.normalized.quality)||(r+="m"),r}function jG(t,e){return!t||!e?0:UG(t.replace("m",""),e.replace("m",""))}function UG(t,e){const n=Qu[t]||t,r=Qu[e]||e,i=hr.indexOf(n),o=hr.indexOf(r);if(i===-1||o===-1)return 0;const s=o-i;return s<0?s+12:s}const wT=new RegExp("^"+Br(fe.keyDeclarationPrefix)+"([ABCDEFG].*)$");function Ch(t){const e=rr(t).match(wT);return e===null?!1:DG(e[1])}function WG(t){if(!Ch(t))throw new TypeError("Expected key declaration, received: "+t);const n=rr(t).match(wT)[1];return{string:n,accidental:Fg(n)}}function VG(t){const e=t.startsWith(fe.lyricLine)?t.substring(1):t,n=new RegExp(fe.chordPositionMarker,"g"),r=e.replace(n,""),i=[];let o=e,s;for(;(s=o.indexOf(fe.chordPositionMarker))!==-1;)i.includes(s)||i.push(s),o=o.replace(fe.chordPositionMarker,"");return{lyrics:r,chordPositions:i}}function HG(t){if(!Ju(t))throw new TypeError("Expected section identifier string, received: "+t);const e=rr(t).match(bT);return{string:t,label:e[1],copyIndex:e[2]?Number.parseInt(e[2]):1,multiplyTimes:e[3]?Number.parseInt(e[3].replace(" x","")):0}}function KG(t,e){const n=oe(t);return n.forEach(r=>{r.type===G.CHORD&&r.model.allBars.forEach(i=>{i.allChords.forEach(o=>{e(o)})})}),n}function K1(t,e){const n=oe(t);return n.allBars.forEach((r,i)=>{r.allChords.forEach((o,s)=>{e(o,s,i)})}),n}function kd(t,e,n){const r=[],i={};let o=!1,s="";for(t.forEach(l=>{l.type===G.SECTION_LABEL?(s=l.model.label,i[s]?i[s]++:i[s]=1,o=l.id===e+n):o&&r.push(l)});xo(r)&&(xo(r).type===G.KEY_DECLARATION||xo(r).type===G.TIME_SIGNATURE);)r.pop();return r}const GG="4/4";function qG(){const t=[],e={};let n=Yu(GG),r,i,o={};const s=2;let l=[],a,u=[],c=0,f=!1,d=!1;function p($){return n=Yu($),{string:$,type:G.TIME_SIGNATURE,model:n}}function h($){return o=WG($),{string:$,type:G.KEY_DECLARATION,model:oe(o)}}function v($,T,k){r=HG($),C(r.label),i=x(r.label);const U={string:$,type:G.SECTION_LABEL,model:r,index:i.count,indexWithoutMultiply:i.withoutMultiply,id:r.label+i.count};return d=I(T,k)&&i.count>1,d&&(U.isFromSectionCopy=!0),f=r.multiplyTimes>0,a=oe(U),u=i.count>1?kd(t,r.label,1):[],c=0,U}function S($){return{string:$,type:G.EMPTY_LINE}}function m($){let T;try{const k=yG($,{timeSignature:n,originalKey:o});T={string:$,type:G.CHORD,model:k},y(T)}catch{T=w($)}return T}function y($){l.length>=s&&l.shift(),l.push($)}function g($){const T=rr($),k=-T.length,U=k<-1?k+1:void 0;return l.length>=T.length?{...oe(...l.slice(k,U)),isFromChordLineRepeater:!0}:w($)}function w($){return{string:$,type:G.LYRIC,model:VG($)}}function C($,T=!1){e[$]?(e[$].count++,T||e[$].withoutMultiply++):e[$]={count:1,withoutMultiply:1}}function x($){return e[$]}function P($){if(u.length&&$.type!==G.SECTION_LABEL){let T=u[c],k;for(;b(T,$);)T.type===G.CHORD&&y(oe(T)),k={...oe(T),isFromAutoRepeatChords:!0},t.push(k),c++,T=u[c];c++}}function b($,T){const k=[G.LYRIC,G.EMPTY_LINE];return $&&!k.includes($.type)&&$.type!==T.type&&T.type!==G.EMPTY_LINE}function A(){if(d){const $=kd(t,r.label,r.copyIndex).map(T=>({...oe(T),isFromSectionCopy:!0}));if(!$.length)return;QG($)&&$.pop(),t.push(...oe($)),d=!1}}function I($,T){const k=T.slice($+1);let U=k.findIndex(De=>Ju(De));return U===0?!0:k.slice(0,U!==-1?U:void 0).filter(De=>!(kl(De)||Ch(De)||W1(De))).length===0}function M($,T){if(f&&YG($,T)){const k=kd(t,r.label,i.count).map(ie=>({...oe(ie),isFromSectionMultiply:!0}));let U;for(let ie=1;ie{$=t[U+1],JG(k,$)?(T=0,k.model.hasPositionedChords=!0,k.model=K1(k.model,ie=>{ie.isPositioned=T<$.model.chordPositions.length,T++})):k.type===G.CHORD&&(k.model.hasPositionedChords=!1,k.model=K1(k.model,ie=>{ie.isPositioned=!1}))})}}}function YG(t,e){const n=e[t+1];return typeof n>"u"||Ju(n)}function JG(t,e){return t.type===G.CHORD&&e&&e.type===G.LYRIC&&e.model.chordPositions.length>0}function QG(t){return t[t.length-1].type===G.EMPTY_LINE}function XG(t){const e=[];let n;return KG(t,r=>{r.model!==fe.noChord&&(n=qx(e,i=>ol(yh(i.model,["numeral"]),yh(r.model,["numeral"]))),n===-1?(e.push({model:oe(r.model),occurrences:1,duration:r.duration}),n=e.length-1):(e[n].occurrences++,e[n].duration+=r.duration))}),e.length&&(e[0].isFirst=!0,e[n].isLast=!0),e}function ZG(t,e){const n={auto:void 0,explicit:[]};if(t.forEach(r=>{r.type===G.KEY_DECLARATION&&n.explicit.push(oe(r.model))}),n.explicit.length===0){const r=LG(e);r&&(n.auto=r)}return n}function pZ(t){const e=Gh(t)?t:t.split(` +`),n=qG();e.map(qK).map(mT).forEach(n.addLine),n.flagPositionedChords();const r=n.asArray(),i=XG(r),o=ZG(r,i);return{allLines:r,allChords:i,allKeys:o}}const re={barRepeat:"%",barSeparator:"|",chordBeat:".",chordLineOffsetSpacer:" ",emptyBeatSpaces:1,keyDeclarationPrefix:"key: ",lyricsSpacer:" ",noChordSymbol:"NC",spacesAfterDefault:2,spacesAfterSubBeatDefault:1,spacesAfterTimeSignature:1,subBeatGroupOpener:"[",subBeatGroupCloser:"]"};function ET(t,e,{shouldPrintSubBeatDelimiters:n=!0,symbolType:r="chord"}={}){const i=t.allChords.filter(o=>o.beat===e);switch(i.length){case 0:return"";case 1:return xh(t,i[0],{shouldPrintSubBeatDelimiters:n,symbolType:r});default:return i.reduce((o,s,l)=>{const a=l>0?" ".repeat(re.spacesAfterSubBeatDefault):"";return o+a+xh(t,s,{shouldPrintSubBeatDelimiters:n,symbolType:r})},"")}}function xh(t,e,{shouldPrintSubBeatDelimiters:n,symbolType:r="chord"}){const o=r==="chord"||e.model===re.barRepeat||e.model===re.noChordSymbol?e.symbol:e.model.numeral.symbol;if(e.isInSubBeatGroup)return n&&e.isFirstOfSubBeat?re.subBeatGroupOpener+o:n&&e.isLastOfSubBeat?o+re.subBeatGroupCloser:o;{const s=t.shouldPrintChordsDuration?re.chordBeat.repeat(e.duration):"";return o+s}}function eq(t,{shouldAlignChordsWithLyrics:e,shouldPrintSubBeatDelimiters:n=!0,symbolType:r="chord"}){const i=[];return t.filter(o=>o.type===G.CHORD).filter(o=>!e(o)).forEach(o=>{o.model.allBars.filter(s=>!s.lineHadTimeSignatureChange).forEach((s,l)=>{if(!i[l]){i[l]={};for(let a=1;a<=s.timeSignature.beatCount;a++)i[l][a]=0}s.allChords.filter(a=>!a.isInSubBeatGroup||a.isLastOfSubBeat).forEach(a=>{const u=ET(s,a.beat,{shouldPrintSubBeatDelimiters:n,symbolType:r});i[l][a.beat]=Math.max(i[l][a.beat],u.length)})})}),i}function tq(t){const e=oe(t);return e.allBars.forEach(n=>{CT(n)}),e}function CT(t){t.allChords.forEach(e=>{e.spacesAfter=e.isInSubBeatGroup&&!e.isLastOfSubBeat?re.spacesAfterSubBeatDefault:re.spacesAfterDefault,e.spacesWithin=0})}function nq(t,e,{shouldPrintBarSeparators:n=!0,shouldPrintSubBeatDelimiters:r=!0,symbolType:i="chord"}){const o=oe(t);return o.allBars.forEach((s,l)=>{s.lineHadTimeSignatureChange?CT(s):s.allChords.forEach(a=>{const u=ET(s,a.beat,{shouldPrintSubBeatDelimiters:r,symbolType:i});a.isInSubBeatGroup&&!a.isLastOfSubBeat?(a.spacesWithin=0,a.spacesAfter=re.spacesAfterSubBeatDefault):(a.spacesWithin=e[l][a.beat]-u.length,a.spacesAfter=0),rq(s,a)&&(a.spacesAfter=re.spacesAfterDefault+iq(s,a,e[l])),oq(s,a,n)&&(a.spacesAfter=re.spacesAfterDefault)})}),o}const rq=(t,e)=>(!e.isInSubBeatGroup||e.isLastOfSubBeat)&&!xT(t,e),iq=(t,e,n)=>{let r=0;for(let i=e.beat+1;ie.beat===t.timeSignature.beatCount,oq=(t,e,n)=>!n&&xT(t,e)&&(!e.isInSubBeatGroup||e.isLastOfSubBeat),Ad=1;function sq(t,e,{shouldPrintBarSeparators:n=!0,shouldPrintSubBeatDelimiters:r=!0,shouldPrintInlineTimeSignatures:i=!0,symbolType:o="chord"}={}){if(lq(e))return{chordLine:t,lyricsLine:e};const s=oe(t),l=oe(e),a=l.chordPositions.map((m,y,g)=>l.lyrics.substring(m,g[y+1]));let u="",c="",f,d;if(s.allBars.forEach((m,y)=>{m.allChords.forEach((g,w,C)=>{if(d=a.shift(),d){u=w===0&&i&&m.shouldPrintBarTimeSignature?m.timeSignature.string+re.spacesAfterTimeSignature:"";const x=y===0&&w===0&&l.chordPositions[0]===0;f=p(m,g,x),d=h(x,g.isFirstOfSubBeat);const P=w===C.length-1,b=C[w+1]&&C[w+1].isFirstOfSubBeat;if(d.length-f.length>0){const A=a.length===0;g.spacesAfter=v(P,A,b)}else g.spacesAfter=Ad,d+=re.lyricsSpacer.repeat(S(P,b));c+=d}else g.spacesAfter=Ad;g.spacesWithin=0})}),aq(l)){const m=l.chordPositions[0];s.offset=m,n&&s.offset--,c=l.lyrics.substring(0,m)+c}return a.length&&(c+=a.join("")),l.lyrics=uq(c),{chordLine:s,lyricsLine:l};function p(m,y,g){let w=u+xh(m,y,{shouldPrintSubBeatDelimiters:y.isLastOfSubBeat&&r,symbolType:o});return g&&(r&&y.isFirstOfSubBeat&&(w=re.subBeatGroupOpener+w),n&&(w=re.barSeparator+w)),w}function h(m,y){let g=d;if(cq(g))g=re.lyricsSpacer.repeat(f.length-1)+g;else{if(m){let w=0;n&&w++,r&&y&&w++,g=re.lyricsSpacer.repeat(w)+g}u.length&&(g=" ".repeat(u.length)+g)}return g}function v(m,y,g){let w=d.length-f.length;return(m&&n&&!y||!m&&r&&g)&&(w>1?w-=1:d+=re.lyricsSpacer),w}function S(m,y){let g=f.length-d.length+Ad;return(m&&n||y)&&g++,g}}const lq=t=>t.chordPositions.length===0,aq=t=>t.chordPositions[0]>0,uq=t=>{const e=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/;return t.replace(e,"")},cq=t=>t.indexOf(" ")===0,fq=({chordLineOffset:t,chordLine:e,symbolType:n})=>{const r=["cmChordLine"];return n==="roman"&&r.push("cmChordLine-romanNumeral"),`${t?`${t}`:""}${e}`},dq=({chordSymbol:t,chordDuration:e,subBeatGroupOpener:n,subBeatGroupCloser:r,numeralType:i})=>{const o=n?`${n}`:"",s=r?`${r}`:"",l=["cmChordSymbol"];return i&&l.push("cmRomanNumeral",`cmRomanNumeral-${i}`),`${o}${t}${e?`${e}`:""}${s}`};function pq(t,{shouldPrintChordsDuration:e=!1,shouldPrintSubBeatOpener:n=!1,shouldPrintSubBeatCloser:r=!1,symbolType:i="chord"}){const o=i==="chord"||t.model===re.barRepeat||t.model===re.noChordSymbol,s=o?t.symbol:t.model.numeral.symbol;return dq({chordSymbol:s,chordDuration:e?re.chordBeat.repeat(t.duration):!1,subBeatGroupOpener:n?re.subBeatGroupOpener:"",subBeatGroupCloser:r?re.subBeatGroupCloser:"",numeralType:o?"":t.model.numeral.type})}const hq=({timeSignature:t})=>`${t}`;function TT(t){return hq({timeSignature:t.string})}const mq=({barContent:t})=>`${t}`,G1=" ",gq=0,yq=2;function vq(t,e=!1,{shouldPrintBarSeparators:n=!0,shouldPrintSubBeatDelimiters:r=!0,shouldPrintTimeSignature:i=!1,symbolType:o="chord"}={}){let s=0,l=0,a="";return i&&(a+=TT(t.timeSignature)+" ".repeat(re.spacesAfterTimeSignature)),a+=t.allChords.reduce((u,c,f)=>{s=To(c.spacesWithin)?c.spacesWithin:gq,l=To(c.spacesAfter)?c.spacesAfter:yq,u+=pq(c,{shouldPrintChordsDuration:c.isInSubBeatGroup?!1:t.shouldPrintChordsDuration,shouldPrintSubBeatOpener:r&&c.isFirstOfSubBeat,shouldPrintSubBeatCloser:r&&c.isLastOfSubBeat,symbolType:o}),d()&&(u+=G1.repeat(s)+G1.repeat(l));function d(){const p=Sq(t,f)&&e;return!p||p&&n}return u},""),mq({barContent:a})}function Sq(t,e){return!t.allChords[e+1]}const bq=({barSeparator:t})=>`${t}`;function wq(t,{shouldPrintBarSeparators:e=!0,shouldPrintSubBeatDelimiters:n=!0,shouldPrintInlineTimeSignatures:r=!0,symbolType:i="chord"}={}){const o=t.allBars.map((u,c)=>{const f=!t.allBars[c+1],d=r&&u.shouldPrintBarTimeSignature;return vq(u,f,{shouldPrintBarSeparators:e,shouldPrintSubBeatDelimiters:n,shouldPrintTimeSignature:d,symbolType:i})}),s=e?bq({barSeparator:re.barSeparator}):"",l=s+o.join(s)+s,a=re.chordLineOffsetSpacer.repeat(t.offset||0);return fq({chordLineOffset:a,chordLine:l,symbolType:i})}const Eq=({chordLyricsPairs:t})=>{let e='';return t.forEach(n=>{e+=`${n.chords||" "}${n.lyrics}`}),e+="",e};var Cq=xc,xq=Ig,Tq=Dg,Oq=Ii,$q=Zo,q1=Tc,kq=Math.min;function Aq(t,e,n){for(var r=n?Tq:xq,i=t[0].length,o=t.length,s=o,l=Array(o),a=1/0,u=[];s--;){var c=t[s];s&&e&&(c=Oq(c,$q(e))),a=kq(c.length,a),l[s]=!n&&(e||i>=120&&c.length>=120)?new Cq(s&&c):void 0}c=t[0];var f=-1,d=l[0];e:for(;++f{if(r.nodeType===Node.TEXT_NODE){const i=r.textContent;for(const o of i)e.push(Xs(o,n.i)),n.i++}else Uq.includes(r.classList.value)?(e.push(Xs(r.textContent,n.i,r.outerHTML)),n.i+=r.textContent.length):OT(r,e,n)})}function Xs(t,e,n){return{text:t,textIndex:e,html:n}}function Hq(t){const e=[],n=mT(t);let r="";return Array.from(n).forEach((i,o)=>{i===" "?(r&&(e.push(Xs(r,o-r.length)),r=""),e.push(Xs(" ",o))):r+=i}),e.push(Xs(r,n.length-r.length)),e}function Kq(t,e){const n=Y1(t),r=Y1(e),i=zq(n,r);let o,s;xo(n)>xo(r)?(s=n,o=r):(s=r,o=n);const l=s.filter(a=>a>xo(o));return l.length&&i.push(...l),i.shift(),i}function Y1(t){const e=t.map(r=>r.textIndex),n=t.reduce((r,i)=>r+i.text,"").length;return e.push(n),e}function Gq(t,e,n){const r=[];return t.forEach(i=>{let o="",s="";for(;e.length&&e[0].textIndex' ';function Yq(){return qq()}const Jq=({keyDeclarationPrefix:t,key:e})=>`${t}${e}`;function Qq(t){return Jq({keyDeclarationPrefix:re.keyDeclarationPrefix,key:t.symbol})}const Xq=({line:t,lineClasses:e,shouldOpenSection:n,sectionWrapperClasses:r,shouldClosePriorSection:i,shouldCloseFinalSection:o})=>{let s="";return i&&(s+=""),n&&(s+=`
`),s+=`

${t}

`,o&&(s+="
"),s};function Zq(t,{isFromAutoRepeatChords:e=!1,isFromChordLineRepeater:n=!1,isFromSectionCopy:r=!1,isFromSectionMultiply:i=!1,shouldOpenSection:o=!1,shouldClosePriorSection:s=!1,shouldCloseFinalSection:l=!1,sectionWrapperClasses:a=[]}={}){const u=["cmLine"];return e&&u.push("cmLine--isFromAutoRepeatChords"),n&&u.push("cmLine--isFromChordLineRepeater"),r&&u.push("cmLine--isFromSectionCopy"),i&&u.push("cmLine--isFromSectionMultiply"),Xq({line:t,lineClasses:u.join(" "),shouldOpenSection:o,sectionWrapperClasses:a.join(" "),shouldClosePriorSection:s,shouldCloseFinalSection:l})}const eY=({lyricLine:t})=>`${t}`;function tY(t,{alignChordsWithLyrics:e=!1,chartType:n="all"}={}){const r=nY(e,n)?t.model.lyrics.trim():t.model.lyrics;return eY({lyricLine:r})}const nY=(t,e)=>!t||e==="lyrics",rY=({label:t,multiplier:e})=>`${t}${e?` ${e}`:""}`;function iY(t){return rY(t.model.rendered)}const oY=({song:t})=>`
${t}
`,J1={a:"adlib",b:"bridge",c:"chorus",i:"intro",o:"outro",p:"pre-chorus",s:"solo",u:"interlude",v:"verse"};function sY(t,{expandSectionMultiply:e}){const n=lY(t);return t.forEach(r=>{if(r.type===G.SECTION_LABEL){const{model:i,index:o,indexWithoutMultiply:s}=r,l=J1[i.label]?J1[i.label]:i.label;let a=l[0].toUpperCase()+l.substring(1),u;n[i.label]>1&&(a+=" ",a+=e?o:s),!e&&i.multiplyTimes&&(u="x"+i.multiplyTimes),r.model.rendered={label:a,multiplier:u}}}),t}function lY(t){const e={};return t.filter(n=>n.type===G.SECTION_LABEL).forEach(n=>{e[n.model.label]?e[n.model.label]++:e[n.model.label]=1}),e}const aY=oT();function uY(t,e=aY){switch(t){case fe.noChord:return re.noChordSymbol;case re.barRepeat:return re.barRepeat;default:return e(t)}}function cY(t,e,{transposeValue:n,accidentalsType:r,chordSymbolRenderer:i,simplifyChords:o,useShortNamings:s}){let l,a;e&&(l=H1(e,n,r));let u=d();function c(p){if(p.type===G.KEY_DECLARATION)l=H1(p.model,n,r),p.symbol=l.string,a||(a=l);else if(p.type===G.CHORD){let h=0;f(p)&&(h=jG(a&&a.string,l&&l.string)),u=d(h),p.model.allBars.forEach(v=>{v.allChords.forEach(S=>{S.symbol=uY(S.model,u)})})}return p}function f(p){const h=l&&p.model.originalKey&&p.model.originalKey.string===l.string;return(p.isFromAutoRepeatChords||p.isFromSectionCopy||p.isFromChordLineRepeater)&&!h}function d(p){if(typeof i=="function")return i;const h=r==="auto"?l?l.accidental:"sharp":r;return oT({simplify:o,useShortNamings:s,transposeValue:n+p,accidental:h})}return t.map(c)}const fY=(t,{alignChordsWithLyrics:e})=>(t.type===G.CHORD&&t.model.allBars.forEach(n=>{dY(t,n,e)&&(n.allChords=[{string:re.barRepeat,model:re.barRepeat,symbol:re.barRepeat,duration:n.timeSignature.beatCount,beat:1}],n.shouldPrintChordsDuration=!1)}),t),dY=(t,e,n)=>e.isRepeated&&!pY(t,e,n),pY=(t,e,n)=>n&&t.model.hasPositionedChords&&e.allChords.length>1&&e.allChords.some(r=>r.isPositioned);function hZ(t,{accidentalsType:e="auto",alignBars:n=!0,alignChordsWithLyrics:r=!0,autoRepeatChords:i=!0,chartType:o="all",chordSymbolRenderer:s=!1,customRenderer:l=!1,expandSectionCopy:a=!0,expandSectionMultiply:u=!1,printChordsDuration:c="uneven",printBarSeparators:f="always",printSubBeatDelimiters:d=!0,printInlineTimeSignatures:p=!0,simplifyChords:h="none",symbolType:v="chord",transposeValue:S=0,useShortNamings:m=!0,wrapChordLyricLines:y=!1}={}){let{allLines:g,allKeys:w}=t,C=!1,x=yT.string,P;g=cY(g,w.auto,{transposeValue:S,accidentalsType:e,chordSymbolRenderer:s,simplifyChords:h,useShortNamings:m}).map(M).map($).filter(k).map(L=>fY(L,{alignChordsWithLyrics:r}));const b=eq(g,{shouldAlignChordsWithLyrics:q,shouldPrintSubBeatDelimiters:d,symbolType:v});g=sY(g,{expandSectionMultiply:u}),g.forEach(B);const A=W();if(l)return l(g,A,{alignChordsWithLyrics:r,alignBars:n});return oY({song:A.join("")});function I(L){return["cmSection","cmSection-"+L.model.rendered.label.replace(/[\d\s]/gi,"")]}function M(L){return L.type===G.CHORD&&L.model.allBars.forEach(Q=>{Q.shouldPrintChordsDuration=T(Q)}),L}function $(L){return L.type===G.TIME_SIGNATURE?x=L.string:L.type===G.CHORD&&L.model.allBars.forEach((Q,X)=>{Q.shouldPrintBarTimeSignature=X===0&&Q.timeSignature.string!==x||X>0&&Q.timeSignature.string!==P,P=Q.timeSignature.string}),L}function T(L){return L.allChords.length>1&&(c==="uneven"&&L.hasUnevenChordsDurations||c==="always")}function k(L){return U(L)&&!De(L)}function U(L){const Q=!i&&(L.isFromAutoRepeatChords||L.type===G.CHORD&&L.isFromSectionCopy),X=L.isFromSectionMultiply&&!u,Ae=L.type!==G.SECTION_LABEL&&L.isFromSectionCopy&&!a;return!X&&!Q&&!Ae}function ie(L){return g.length-1===L}function De(L){if(o==="chordsFirstLyricLine"){if(L.type===G.SECTION_LABEL)return C=!0,!1;if(C&&L.type===G.LYRIC)return C=!1,!1}return["chords","chordsFirstLyricLine"].includes(o)&&L.type===G.LYRIC||o==="lyrics"&&L.type===G.CHORD}function B(L,Q){if(L.type===G.CHORD){let X=n&&!q(L)?nq(L.model,b,{shouldPrintBarSeparators:ce(L.model),shouldPrintSubBeatDelimiters:d,symbolType:v}):tq(L.model);const Ae=g[Q+1];if(q(L)){const{chordLine:ge,lyricsLine:Dn}=sq(X,Ae.model,{shouldPrintBarSeparators:ce(L.model),shouldPrintSubBeatDelimiters:d,shouldPrintInlineTimeSignatures:p,symbolType:v});g[Q+1].model=Dn,X=ge}g[Q].model=X}}function W(){let L=!1,Q;return g.map((X,Ae)=>{let ge,Dn=!1,Sn=[],Pt;return X.type===G.CHORD?(ge=wq(X.model,{symbolType:v,shouldPrintBarSeparators:ce(X.model),shouldPrintSubBeatDelimiters:d,shouldPrintInlineTimeSignatures:p}),Y(X,g[Ae+1])&&(Q=ge,ge=!1)):X.type===G.EMPTY_LINE?ge=Yq():X.type===G.SECTION_LABEL?(Dn=!0,Pt=L,L=!0,Sn=I(X),ge=iY(X)):X.type===G.TIME_SIGNATURE?ge=TT(X):X.type===G.KEY_DECLARATION?ge=Qq(X):(ge=tY(X,{alignChordsWithLyrics:r,chartType:o}),Q&&(ge=Wq(Q,ge),Q="")),ge&&Zq(ge,{isFromSectionMultiply:X.isFromSectionMultiply,isFromAutoRepeatChords:X.isFromAutoRepeatChords,isFromChordLineRepeater:X.isFromChordLineRepeater,isFromSectionCopy:X.isFromSectionCopy,shouldOpenSection:Dn,shouldClosePriorSection:Pt,shouldCloseFinalSection:ie(Ae)&&L,sectionWrapperClasses:Sn})}).filter(Boolean)}function q(L){return o==="all"&&r&&L.model.hasPositionedChords}function Y(L,Q){return Q&&Q.type===G.LYRIC&&y&&q(L)}function ce(L){return f==="always"||f==="grids"&&!L.hasPositionedChords}}const mZ=(t={})=>hY.bind(null,t),hY=({showBarSeparators:t=!0},e,n,{alignBars:r,alignChordsWithLyrics:i})=>{const o=[];let s;return mY(e).forEach((l,a)=>{l.sectionLine&&(l.allLines.length>0?(a>0&&o.push(""),o.push(gY(l.sectionLine))):o.push(AT(kT(l.sectionLine.model.rendered)))),l.allLines.forEach((u,c,f)=>{switch(u.type){case G.CHORD:vY(f,c)?s=u:o.push(SY(u));break;case G.LYRIC:o.push(bY(u,s,{showBarSeparators:t,alignChordsWithLyrics:i,alignBars:r})),s=void 0;break;case G.EMPTY_LINE:o.push(""),s=void 0;break}}),l.sectionLine&&l.allLines.length>0&&o.push(yY(l.sectionLine))}),o.join(` +`)},mY=t=>{const e=[];let n;const r=()=>{n&&(e.push(n),n=void 0)},i=o=>{n={sectionLine:o,allLines:[]}};return t.forEach(o=>{o.type===G.SECTION_LABEL?(r(),i(o)):(n||i(),n.allLines.push(o))}),r(),e.map(o=>(o.allLines=cT(o.allLines,s=>s.type===G.EMPTY_LINE),o))};function gY(t){return`{start_of_${$T(t.model.label)}: ${kT(t.model.rendered)}}`}function yY(t){return`{end_of_${$T(t.model.label)}}`}function $T(t){switch(t){case"b":case"bridge":return"bridge";case"c":case"chorus":return"chorus";default:case"v":case"verse":return"verse"}}function kT({label:t,multiplier:e}){return e?`${t} ${e}`:t}function AT(t){return`{c:${t}}`}function vY(t,e){const n=t[e+1];return n&&n.type===G.LYRIC}function SY(t){let e="";return t.model.allBars.map(n=>{e+="|",n.allChords.map(r=>{e+=r.symbol+" ".repeat(r.spacesWithin+r.spacesAfter)})}),e+="|",AT(e.trim())}function bY(t,e,{alignChordsWithLyrics:n,alignBars:r,showBarSeparators:i}){let o=t.string.trim();return e&&e.type===G.CHORD&&(e.model.hasPositionedChords&&n?o=wY(o,e,{showBarSeparators:i}):o=EY(o,e,{showBarSeparators:i,alignBars:r})),o}const wY=(t,e,{showBarSeparators:n})=>{let r=t;return e.model.allBars.map(i=>{i.allChords.map((o,s)=>{let[l]=PT(i,o);if(s===0&&n){const a=r.indexOf("_");a>-1?r=pi(r,"[|] ",a):r=pi(r,"[|]",r.length+1)}r.indexOf("_")>-1?r=r.replace("_",l):r=pi(r,l,r.length+1)})}),r=r.replace(/_/g,"").trim(),n&&(r+=" [|]"),r},EY=(t,e,{showBarSeparators:n,alignBars:r})=>{let i=t.replace(/_/g,""),o=0;return e.model.allBars.map(s=>{s.allChords.map((l,a)=>{let[u,c]=PT(s,l);a===0&&n&&(i=pi(i,"[|]",o),o+=5),i=pi(i,u,o);const f=r&&!s.allChords[a+1]?1:0;o+=u.length+c.length+l.spacesAfter+l.spacesWithin+f})}),n&&(i=pi(i,"[|]",o)),i},PT=(t,e)=>{const n=t.shouldPrintChordsDuration?e.symbol+".".repeat(e.duration):e.symbol;return[`[${n}]`,n]},gZ=()=>CY.bind(null),CY=(t,e)=>e.map((n,r)=>{const i=t[r],o=Ix(n);return i.type===G.SECTION_LABEL?`[${o}]`:i.type===G.CHORD?xY(i,o):o.replace(" ","")}).join(` +`),xY=(t,e)=>{const n=/([^\s.|]+)/g;return e.replace(n,"[ch]$1[/ch]")};/** + * filesize + * + * @copyright 2023 Jason Mulligan + * @license BSD-3-Clause + * @version 10.1.0 + */const TY="array",OY="bit",Q1="bits",$Y="byte",X1="bytes",Gi="",kY="exponent",AY="function",Z1="iec",PY="Invalid number",_Y="Invalid rounding method",Pd="jedec",MY="object",eS=".",NY="round",IY="s",DY="si",RY="kbit",LY="kB",FY=" ",BY="string",zY="0",_d={symbol:{iec:{bits:["bit","Kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["bit","Kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},fullform:{iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]}};function yZ(t,{bits:e=!1,pad:n=!1,base:r=-1,round:i=2,locale:o=Gi,localeOptions:s={},separator:l=Gi,spacer:a=FY,symbols:u={},standard:c=Gi,output:f=BY,fullform:d=!1,fullforms:p=[],exponent:h=-1,roundingMethod:v=NY,precision:S=0}={}){let m=h,y=Number(t),g=[],w=0,C=Gi;c===DY?(r=10,c=Pd):c===Z1||c===Pd?r=2:r===2?c=Z1:(r=10,c=Pd);const x=r===10?1e3:1024,P=d===!0,b=y<0,A=Math[v];if(typeof t!="bigint"&&isNaN(t))throw new TypeError(PY);if(typeof A!==AY)throw new TypeError(_Y);if(b&&(y=-y),(m===-1||isNaN(m))&&(m=Math.floor(Math.log(y)/Math.log(x)),m<0&&(m=0)),m>8&&(S>0&&(S+=8-m),m=8),f===kY)return m;if(y===0)g[0]=0,C=g[1]=_d.symbol[c][e?Q1:X1][m];else{w=y/(r===2?Math.pow(2,m*10):Math.pow(1e3,m)),e&&(w=w*8,w>=x&&m<8&&(w=w/x,m++));const I=Math.pow(10,m>0?i:0);g[0]=A(w*I)/I,g[0]===x&&m<8&&h===-1&&(g[0]=1,m++),C=g[1]=r===10&&m===1?e?RY:LY:_d.symbol[c][e?Q1:X1][m]}if(b&&(g[0]=-g[0]),S>0&&(g[0]=g[0].toPrecision(S)),g[1]=u[g[1]]||g[1],o===!0?g[0]=g[0].toLocaleString():o.length>0?g[0]=g[0].toLocaleString(o,s):l.length>0&&(g[0]=g[0].toString().replace(eS,l)),n&&Number.isInteger(g[0])===!1&&i>0){const I=l||eS,M=g[0].toString().split(I),$=M[1]||Gi,T=$.length,k=i-T;g[0]=`${M[0]}${I}${$.padEnd(T+k,zY)}`}return P&&(g[1]=p[m]?p[m]:_d.fullform[c][m]+(e?OY:$Y)+(g[0]===1?Gi:IY)),f===TY?g:f===MY?{value:g[0],symbol:g[1],exponent:m,unit:C}:g.join(a)}var _T={exports:{}};(function(t,e){(function(n,r){r()})(Tn,function(){function n(u,c){return typeof c>"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,f){var d=new XMLHttpRequest;d.open("GET",u),d.responseType="blob",d.onload=function(){a(d.response,c,f)},d.onerror=function(){console.error("could not download file")},d.send()}function i(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function o(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Tn=="object"&&Tn.global===Tn?Tn:void 0,l=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(u,c,f){var d=s.URL||s.webkitURL,p=document.createElement("a");c=c||u.name||"download",p.download=c,p.rel="noopener",typeof u=="string"?(p.href=u,p.origin===location.origin?o(p):i(p.href)?r(u,c,f):o(p,p.target="_blank")):(p.href=d.createObjectURL(u),setTimeout(function(){d.revokeObjectURL(p.href)},4e4),setTimeout(function(){o(p)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,f){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(n(u,f),c);else if(i(u))r(u,c,f);else{var d=document.createElement("a");d.href=u,d.target="_blank",setTimeout(function(){o(d)})}}:function(u,c,f,d){if(d=d||open("","_blank"),d&&(d.document.title=d.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,f);var p=u.type==="application/octet-stream",h=/constructor/i.test(s.HTMLElement)||s.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||p&&h||l)&&typeof FileReader<"u"){var S=new FileReader;S.onloadend=function(){var g=S.result;g=v?g:g.replace(/^data:[^;]*;/,"data:attachment/file;"),d?d.location.href=g:location=g,d=null},S.readAsDataURL(u)}else{var m=s.URL||s.webkitURL,y=m.createObjectURL(u);d?d.location=y:location.href=y,d=null,setTimeout(function(){m.revokeObjectURL(y)},4e4)}});s.saveAs=a.saveAs=a,t.exports=a})})(_T);var vZ=_T.exports;const SZ=()=>t=>(t.formatted.symbol=t.formatted.symbol.replace(/[() ]/g,"").replace("mM","mMaj").replace("°","dim"),t);/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */var Th=function(){return Th=Object.assign||function(e){for(var n,r=1,i=arguments.length;r0||t.deltaX<0?"X":t.deltaY>0||t.deltaY<0?"Y":(t.deltaY>0||t.deltaY<0)&&(t.deltaX>0||t.deltaX<0)?"XY":null},WY=_.forwardRef(function(t,e){var n=t.children,r=t.group,i=r===void 0?"default":r,o=t.scroll,s=o===void 0?"two-way":o,l=t.selfLockAxis,a=l===void 0?null:l,u=t.onScroll,c=u===void 0?function(){}:u,f=_.useContext(MT),d=f.registerNode,p=f.unregisterNode,h=f.onScroll,v=n.ref,S=v!=null&&e!=null;S&&console.warn(`scroll-sync-react: +WARNING: ref used on both ScrollSyncNode and its direct child. +Using the ref from the ScrollSyncNode component.`);var m=v&&!e?v:_.useRef(null);_.useEffect(function(){typeof e=="function"&&e(m.current)},[]);var y=function(C){var x=UY(C);(a==="X"&&x==="X"||a==="Y"&&x==="Y"||a==="XY"&&(x==="XY"||x==="X"||x==="Y"))&&C.preventDefault()};_.useEffect(function(){var C,x={node:m.current,scroll:s};return x&&d(x,qr(i)),(C=m.current)===null||C===void 0||C.addEventListener("wheel",y,{passive:!1}),function(){var P;p(x,qr(i)),(P=m.current)===null||P===void 0||P.removeEventListener("wheel",y)}},[]),_.useEffect(function(){var C={node:m.current,scroll:s};return p(C,qr(i)),d(C,qr(i)),function(){return p(C,qr(i))}},[s,i]);var g=s==="syncer-only",w=s==="two-way";return We.cloneElement(n,{ref:m,onScroll:function(C){typeof n.props.onScroll=="function"&&n.props.onScroll(C),C.persist(),(g||w)&&(h(C,qr(i)),c(C))},onWheel:function(C){typeof n.props.onWheel=="function"&&n.props.onWheel(C),C.persist(),(g||w)&&(h(C,qr(i)),c(C))}})});WY.displayName="ScrollSyncNode";function qe(t){this.content=t}qe.prototype={constructor:qe,find:function(t){for(var e=0;e>1}};qe.from=function(t){if(t instanceof qe)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new qe(e)};function NT(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=NT(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function IT(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){n-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let u=0,c=Math.min(s.text.length,l.text.length);for(;ue&&r(a,i+l,o||null,s)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,n-c),r,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=a}return new F(r,i)}cutByIndex(e,n){return e==n?F.empty:e==0&&n==this.content.length?this:new F(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new F(i,o)}addToStart(e){return new F([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new F(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Ra(r+1,s):Ra(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return F.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new F(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return F.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}}le.none=[];class Zu extends Error{}class V{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=RT(this.content,e+this.openStart,n);return r&&new V(r,this.openStart,this.openEnd)}removeBetween(e,n){return new V(DT(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return V.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new V(F.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new V(e,r,i)}}V.empty=new V(F.empty,0,0);function DT(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(DT(o.content,e-i-1,n-i-1)))}function RT(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=RT(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function VY(t,e,n){if(n.openStart>t.depth)throw new Zu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zu("Inconsistent open depths");return LT(t,e,n,0)}function LT(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Zs(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(hi(t.nodeAfter,r),o++));for(let l=o;li&&Oh(t,e,i+1),s=r.depth>i&&Oh(n,r,i+1),l=[];return Zs(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(FT(o,s),hi(mi(o,BT(t,e,n,r,i+1)),l)):(o&&hi(mi(o,ec(t,e,i+1)),l),Zs(e,n,i,l),s&&hi(mi(s,ec(n,r,i+1)),l)),Zs(r,null,i,l),new F(l)}function ec(t,e,n){let r=[];if(Zs(null,t,n,r),t.depth>n){let i=Oh(t,e,n+1);hi(mi(i,ec(t,e,n+1)),r)}return Zs(e,null,n,r),new F(r)}function HY(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(F.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Al{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new GY(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),u=o-a;if(r.push(s,l,i+a),!u||(s=s.child(l),s.isText))break;o=u-1,i+=a+1}return new Al(n,r,o)}static resolveCached(e,n){for(let i=0;ie&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),zT(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=F.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=F.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};gi.prototype.text=void 0;class tc extends gi{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):zT(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new tc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new tc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function zT(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ki{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new YY(e,n);if(r.next==null)return ki.empty;let i=jT(r);r.next&&r.err("Unexpected trailing text");let o=nJ(tJ(i));return rJ(o,r),o}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +`)}}ki.empty=new ki(!0);class YY{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function jT(t){let e=[];do e.push(JY(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function JY(t){let e=[];do e.push(QY(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function QY(t){let e=eJ(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=XY(t,e);else break;return e}function tS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function XY(t,e){let n=tS(t),r=n;return t.eat(",")&&(t.next!="}"?r=tS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function ZY(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function eJ(t){if(t.eat("(")){let e=jT(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=ZY(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function tJ(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let u={term:a,to:l};return e[s].push(u),u}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,u)=>a.concat(o(u,l)),[]);if(s.type=="seq")for(let a=0;;a++){let u=o(s.exprs[a],l);if(a==s.exprs.length-1)return u;i(u,l=n())}else if(s.type=="star"){let a=n();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let u=0;u{t[s].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||i.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let o=e[r.join(",")]=new ki(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new KT(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class iJ{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class mf{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=HT(i.attrs),this.excluded=null;let o=WT(this.attrs);this.instance=o?new le(this,o):null}create(e=null){return!e&&this.instance?this.instance:new le(this,VT(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new mf(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class bZ{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=qe.from(e.nodes),n.marks=qe.from(e.marks||{}),this.nodes=rS.compile(this.spec.nodes,this),this.marks=mf.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;o.contentMatch=r[s]||(r[s]=ki.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=l=="_"?null:l?iS(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:iS(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof rS){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new tc(r,r.defaultAttrs,e,le.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return gi.fromJSON(this,e)}markFromJSON(e){return le.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function iS(t,e){let n=[];for(let r=0;r-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class Pl{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new sS(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new sS(this,n,!0);return r.addAll(e,n.from,n.to),V.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=lS(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=lS(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Pl(e,Pl.schemaRules(e)))}}const GT={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},oJ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},qT={ol:!0,ul:!0},nc=1,rc=2,el=4;function oS(t,e,n){return e!=null?(e?nc:0)|(e==="full"?rc:0):t&&t.whitespace=="pre"?nc|rc:n&~el}class La{constructor(e,n,r,i,o,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=le.none,this.stashMarks=[],this.match=s||(l&el?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(F.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&nc)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=F.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;nthis.addAll(e)),s&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=le.none,r=le.none;for(let i=0;i{s.clearMark(l)&&(r=l.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=cJ(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function sJ(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&qT.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function lJ(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function aJ(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function lS(t){let e={};for(let n in t)e[n]=t[n];return e}function uJ(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Yn.renderSpec(Dd(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),a=n[1],u=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){u=2;for(let c in a)if(a[c]!=null){let f=c.indexOf(" ");f>0?l.setAttributeNS(c.slice(0,f),c.slice(f+1),a[c]):l.setAttribute(c,a[c])}}for(let c=u;cu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:d,contentDOM:p}=Yn.renderSpec(e,f,r);if(l.appendChild(d),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Yn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=aS(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return aS(e.marks)}}function aS(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Dd(t){return t.document||window.document}const YT=65535,JT=Math.pow(2,16);function fJ(t,e){return t+e*JT}function uS(t){return t&YT}function dJ(t){return(t-(t&YT))/JT}const QT=1,XT=2,nu=4,ZT=8;class kh{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&ZT)>0}get deletedBefore(){return(this.delInfo&(QT|nu))>0}get deletedAfter(){return(this.delInfo&(XT|nu))>0}get deletedAcross(){return(this.delInfo&nu)>0}}class Nt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Nt.empty)return Nt.empty}recover(e){let n=0,r=uS(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[l+o],c=this.ranges[l+s],f=a+u;if(e<=f){let d=u?e==a?-1:e==f?1:n:n,p=a+i+(d<0?0:c);if(r)return p;let h=e==(n<0?a:f)?null:fJ(l/3,e-a),v=e==a?XT:e==f?QT:nu;return(n<0?e!=a:e!=f)&&(v|=ZT),new kh(p,v,h)}i+=c-u}return r?e+i:new kh(e+i,0,null)}touches(e,n){let r=0,i=uS(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let u=this.ranges[l+o],c=a+u;if(e<=c&&l==i*3)return!0;r+=this.ranges[l+s]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Oo;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Me.fromReplace(e,this.from,this.to,o)}invert(){return new An(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Sr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Sr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Sr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Sr(n.from,n.to,e.markFromJSON(n.mark))}}ut.jsonID("addMark",Sr);class An extends ut{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new V(Bg(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Me.fromReplace(e,this.from,this.to,r)}invert(){return new Sr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new An(n.pos,r.pos,this.mark)}merge(e){return e instanceof An&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new An(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new An(n.from,n.to,e.markFromJSON(n.mark))}}ut.jsonID("removeMark",An);class br extends ut{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Me.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Me.fromReplace(e,this.pos,this.pos+1,new V(F.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Rt(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Rt(n.from,n.to,n.gapFrom,n.gapTo,V.fromJSON(e,n.slice),n.insert,!!n.structure)}}ut.jsonID("replaceAround",Rt);function Ah(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function pJ(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(a,u,c)=>{if(!a.isInline)return;let f=a.marks;if(!r.isInSet(f)&&c.type.allowsMarkType(r.type)){let d=Math.max(u,e),p=Math.min(u+a.nodeSize,n),h=r.addToSet(f);for(let v=0;vt.step(a)),o.forEach(a=>t.step(a))}function hJ(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof mf){let u=s.marks,c;for(;c=r.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let u=Math.min(l+s.nodeSize,n);for(let c=0;ct.step(new An(s.from,s.to,s.style)))}function mJ(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)t.step(o[l])}function gJ(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function zg(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;h--)v||r.index(h)>0?(v=!0,c=F.from(r.node(h).copy(c)),f++):a--;let d=F.empty,p=0;for(let h=o,v=!1;h>n;h--)v||i.after(h+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=F.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Rt(i,o,i,o,new V(r,0,0),n.length,!0))}function SJ(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&bJ(t.doc,t.mapping.slice(o).map(l),r)){t.clearIncompatible(t.mapping.slice(o).map(l,1),r);let a=t.mapping.slice(o),u=a.map(l,1),c=a.map(l+s.nodeSize,1);return t.step(new Rt(u,c,u+1,c-1,new V(F.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function bJ(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function wJ(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Rt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new V(F.from(s),0,0),1,!0))}function ru(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=n-2;u>o;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[c+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let v=r&&r[c]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function EJ(t,e,n=1,r){let i=t.doc.resolve(e),o=F.empty,s=F.empty;for(let l=i.depth,a=i.depth-n,u=n-1;l>a;l--,u--){o=F.from(i.node(l).copy(o));let c=r&&r[u];s=F.from(c?c.type.create(c.attrs,s):i.node(l).copy(s))}t.step(new ot(e,e,new V(o.append(s),n,n),!0))}function eO(t,e){let n=t.resolve(e),r=n.index();return CJ(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function CJ(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function xJ(t,e,n){let r=new ot(e-n,e+n,V.empty,!0);t.step(r)}function TJ(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),u=r.node(s),c=!1;if(o==1)c=u.canReplace(a,a,i);else{let f=u.contentMatchAt(a).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(a,a,f[0])}if(c)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function jg(t,e,n=e,r=V.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return tO(i,o,r)?new ot(e,n,r):new $J(i,o,r).fit()}function tO(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class $J{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=F.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=F.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new V(o,s,l);return e>-1?new Rt(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ot(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Ld(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,f=null;if(n==1&&(s?u.matchType(s.type)||(f=u.fillBefore(F.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Ld(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new V(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Ld(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new V(Is(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new V(Is(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let v=0;v1||a==0||v.content.size)&&(f=S,c.push(nO(v.mark(d.allowedMarks(v.marks)),u==1?a:0,u==l.childCount?p:-1)))}let h=u==l.childCount;h||(p=-1),this.placed=Ds(this.placed,n,F.from(c)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,S=l;v1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:a,type:u}=this.frontier[l],c=Fd(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ds(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ds(this.placed,this.depth,F.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(F.empty,!0);n.childCount&&(this.placed=Ds(this.placed,this.frontier.length,n))}}function Is(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Is(t.firstChild.content,e-1,n)))}function Ds(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ds(t.lastChild.content,e-1,n)))}function Ld(t,e){for(let n=0;n1&&(r=r.replaceChild(0,nO(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(F.empty,!0)))),t.copy(r)}function Fd(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!kJ(n,o.content,s)?l:null}function kJ(t,e,n){for(let r=n;r0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(d)>-1?l=d:i.before(d)==p&&s.splice(1,0,-d)}let a=s.indexOf(l),u=[],c=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(u.push(h),p==r.openStart)break;d=h.content}for(let d=c-1;d>=0;d--){let p=u[d],h=AJ(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(l)-1)))c=d;else if(h||!p.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+c+1)%(r.openStart+1),h=u[p];if(h)for(let v=0;v=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let p=s[d];p<0||(e=i.before(p),n=o.after(p))}}function rO(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(F.empty,!0))}return t}function _J(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=TJ(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new V(F.from(r),0,0))}function MJ(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=iO(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function iO(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class $o extends ut{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Me.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Me.fromReplace(e,this.pos,this.pos+1,new V(F.from(i),0,n.isLeaf?0:1))}getMap(){return Nt.empty}invert(e){return new $o(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new $o(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $o(n.pos,n.attr,n.value)}}ut.jsonID("attr",$o);class _l extends ut{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Me.ok(r)}getMap(){return Nt.empty}invert(e){return new _l(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new _l(n.attr,n.value)}}ut.jsonID("docAttr",_l);let Vo=class extends Error{};Vo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Vo.prototype=Object.create(Error.prototype);Vo.prototype.constructor=Vo;Vo.prototype.name="TransformError";class NJ{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Oo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Vo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=V.empty){let i=jg(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new V(F.from(r),0,0))}delete(e,n){return this.replace(e,n,V.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return PJ(this,e,n,r),this}replaceRangeWith(e,n,r){return _J(this,e,n,r),this}deleteRange(e,n){return MJ(this,e,n),this}lift(e,n){return yJ(this,e,n),this}join(e,n=1){return xJ(this,e,n),this}wrap(e,n){return vJ(this,e,n),this}setBlockType(e,n=e,r,i=null){return SJ(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return wJ(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new $o(e,n,r)),this}setDocAttribute(e,n){return this.step(new _l(e,n)),this}addNodeMark(e,n){return this.step(new br(e,n)),this}removeNodeMark(e,n){if(!(n instanceof le)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Wo(e,n)),this}split(e,n=1,r){return EJ(this,e,n,r),this}addMark(e,n,r){return pJ(this,e,n,r),this}removeMark(e,n,r){return hJ(this,e,n,r),this}clearIncompatible(e,n,r){return mJ(this,e,n,r),this}}const Bd=Object.create(null);class ae{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new IJ(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?eo(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):eo(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Lt(e.node(0))}static atStart(e){return eo(e,e,0,0,1)||new Lt(e)}static atEnd(e){return eo(e,e,e.content.size,e.childCount,-1)||new Lt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Bd[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Bd)throw new RangeError("Duplicate use of selection JSON ID "+e);return Bd[e]=n,n.prototype.jsonID=e,n}getBookmark(){return me.between(this.$anchor,this.$head).getBookmark()}}ae.prototype.visible=!0;class IJ{constructor(e,n){this.$from=e,this.$to=n}}let cS=!1;function fS(t){!cS&&!t.parent.inlineContent&&(cS=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class me extends ae{constructor(e,n=e){fS(e),fS(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ae.near(r);let i=e.resolve(n.map(this.anchor));return new me(i.parent.inlineContent?i:r,r)}replace(e,n=V.empty){if(super.replace(e,n),n==V.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof me&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new gf(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new me(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ae.findFrom(n,r,!0)||ae.findFrom(n,-r,!0);if(o)n=o.$head;else return ae.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ae.findFrom(e,-r,!0)||ae.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&J.isSelectable(l))return J.create(t,n-(i<0?l.nodeSize:0))}else{let a=eo(t,l,n+i,i<0?l.childCount:0,i,o);if(a)return a}n+=l.nodeSize*i}return null}function dS(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=c)}),t.setSelection(ae.near(t.doc.resolve(s),n))}const pS=1,Fa=2,hS=4;class RJ extends NJ{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Fa,this}ensureMarks(e){return le.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Fa)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Fa,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||le.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ae.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=hS,this}get scrolledIntoView(){return(this.updated&hS)>0}}function mS(t,e){return!e||!t?t:t.bind(e)}class Rs{constructor(e,n,r){this.name=e,this.init=mS(n.init,r),this.apply=mS(n.apply,r)}}const LJ=[new Rs("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Rs("selection",{init(t,e){return t.selection||ae.atStart(e.doc)},apply(t){return t.selection}}),new Rs("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Rs("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class zd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=LJ.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Rs(r.key,r.spec.state,r))})}}class Ls{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new zd(e.schema,e.plugins),o=new Ls(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=gi.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ae.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],u=a.spec.state;if(a.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=u.fromJSON.call(a,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function oO(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=oO(i,e,{})),n[r]=i}return n}class sO{constructor(e){this.spec=e,this.props={},e.props&&oO(e.props,this,this.props),this.key=e.key?e.key.key:lO("plugin")}getState(e){return e[this.key]}}const jd=Object.create(null);function lO(t){return t in jd?t+"$"+ ++jd[t]:(jd[t]=0,t+"$")}class aO{constructor(e="key"){this.key=lO(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const dt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Ml=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let gS=null;const Wn=function(t,e,n){let r=gS||(gS=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Ai=function(t,e,n,r){return n&&(yS(t,e,n,r,-1)||yS(t,e,n,r,1))},FJ=/^(img|br|input|textarea|hr)$/i;function yS(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:$n(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Wg(t)||FJ.test(t.nodeName)||t.contentEditable=="false")return!1;e=dt(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?$n(t):0}else return!1}}function $n(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function BJ(t,e,n){for(let r=e==0,i=e==$n(t);r||i;){if(t==n)return!0;let o=dt(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==$n(t)}}function Wg(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const yf=function(t){return t.focusNode&&Ai(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function ni(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function zJ(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jJ(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Mn=typeof navigator<"u"?navigator:null,vS=typeof document<"u"?document:null,Hr=Mn&&Mn.userAgent||"",Ph=/Edge\/(\d+)/.exec(Hr),uO=/MSIE \d/.exec(Hr),_h=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Hr),At=!!(uO||_h||Ph),Mr=uO?document.documentMode:_h?+_h[1]:Ph?+Ph[1]:0,yn=!At&&/gecko\/(\d+)/i.test(Hr);yn&&+(/Firefox\/(\d+)/.exec(Hr)||[0,0])[1];const Mh=!At&&/Chrome\/(\d+)/.exec(Hr),st=!!Mh,UJ=Mh?+Mh[1]:0,mt=!At&&!!Mn&&/Apple Computer/.test(Mn.vendor),Ho=mt&&(/Mobile\/\w+/.test(Hr)||!!Mn&&Mn.maxTouchPoints>2),Ht=Ho||(Mn?/Mac/.test(Mn.platform):!1),WJ=Mn?/Win/.test(Mn.platform):!1,un=/Android \d/.test(Hr),Ql=!!vS&&"webkitFontSmoothing"in vS.documentElement.style,VJ=Ql?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function HJ(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function jn(t,e){return typeof t=="number"?t:t[e]}function KJ(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function SS(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Ml(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,u=a?HJ(o):KJ(l),c=0,f=0;if(e.topu.bottom-jn(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+jn(i,"top")-u.top:e.bottom-u.bottom+jn(i,"bottom")),e.leftu.right-jn(r,"right")&&(c=e.right-u.right+jn(i,"right")),c||f)if(a)o.defaultView.scrollBy(c,f);else{let d=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),c&&(l.scrollLeft+=c);let h=l.scrollLeft-d,v=l.scrollTop-p;e={left:e.left-h,top:e.top-v,right:e.right-h,bottom:e.bottom-v}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function GJ(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:cO(t.dom)}}function cO(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Ml(r));return e}function qJ({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;fO(n,r==0?0:r-e)}function fO(t,e){for(let n=0;n=l){s=Math.max(h.bottom,s),l=Math.min(h.top,l);let v=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=c,u={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=f+1)}}return!n&&a&&(n=a,i=u,r=0),n&&n.nodeType==3?JJ(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:dO(n,i)}function JJ(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Vg(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function QJ(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function ZJ(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,a.left>r.left||a.top>r.top?i=l.posBefore:(a.right-1?i:t.docView.posFromDOM(e,n,-1)}function pO(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}let u;Ql&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=ZJ(t,r,i,e))}l==null&&(l=XJ(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function bS(t){return t.top=0&&i==r.nodeValue.length?(a--,c=1):n<0?a--:u++,ks(sr(Wn(r,a,u),c),c<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==$n(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return Ud(a.getBoundingClientRect(),!1)}if(o==null&&i<$n(r)){let a=r.childNodes[i];if(a.nodeType==1)return Ud(a.getBoundingClientRect(),!0)}return Ud(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==$n(r))){let a=r.childNodes[i-1],u=a.nodeType==3?Wn(a,$n(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return ks(sr(u,1),!1)}if(o==null&&i<$n(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let u=a?a.nodeType==3?Wn(a,0,s?0:1):a.nodeType==1?a:null:null;if(u)return ks(sr(u,-1),!0)}return ks(sr(r.nodeType==3?Wn(r):r,-n),n>=0)}function ks(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ud(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function mO(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function nQ(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return mO(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=hO(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Wn(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}const rQ=/[\u0590-\u08ac]/;function iQ(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return!rQ.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:mO(t,e,()=>{let{focusNode:a,focusOffset:u,anchorNode:c,anchorOffset:f}=t.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:v}=t.domSelectionRange(),S=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&u==v;try{l.collapse(c,f),a&&(a!=c||u!=f)&&l.extend&&l.extend(a,u)}catch{}return d!=null&&(l.caretBidiLevel=d),S})}let wS=null,ES=null,CS=!1;function oQ(t,e,n){return wS==e&&ES==n?CS:(wS=e,ES=n,CS=n=="up"||n=="down"?nQ(t,e,n):iQ(t,e,n))}const Xt=0,xS=1,li=2,Nn=3;class Xl{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Xt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;ndt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof yO){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof gO&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?dt(o.dom)+1:0}}else{let o,s=!0;for(;o=r=c&&n<=u-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,c);e=s;for(let f=l;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=dt(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>n||l==this.children.length-1)){n=u;for(let c=l+1;cp&&sn){let p=l;l=a,a=p}let d=document.createRange();d.setEnd(a.node,a.offset),d.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,a=s-o.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?li:xS,e==l&&n==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Nn:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?li:Nn}r=s}this.dirty=li}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?li:xS;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Xt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class sQ extends Xl{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Pi extends Xl{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Yn.renderSpec(document,n.type.spec.toDOM(n,r))),new Pi(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Nn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Nn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Xt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Dh(o,0,e,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),c=u&&u.dom,f=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=Yn.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let d=c;return c=bO(c,r,n),u?a=new lQ(e,n,r,i,c,f||null,d,u,o,s+1):n.isText?new vf(e,n,r,i,c,d,o):new Nr(e,n,r,i,c,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>F.empty)}return e}matchesNode(e,n,r){return this.dirty==Xt&&e.eq(this.node)&&Ih(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new uQ(this,s&&s.node,e);dQ(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?a.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!f&&a.syncToMarks(c==this.node.childCount?le.none:this.node.child(c).marks,r,e),a.placeWidget(u,e,i)},(u,c,f,d)=>{a.syncToMarks(u.marks,r,e);let p;a.findNodeMatch(u,c,f,d)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(u,c,f,p,e)||a.updateNextNode(u,c,f,e,d,i)||a.addNode(u,c,f,e,i),i+=u.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==li)&&(s&&this.protectLocalComposition(e,s),vO(this.contentDOM,this.children,e),Ho&&pQ(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof me)||rn+this.node.content.size)return null;let o=e.domSelectionRange(),s=hQ(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,a=mQ(this.node.content,l,r-n,i-n);return a<0?null:{node:s,pos:a,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new sQ(this,o,n,i);e.input.compositionNodes.push(s),this.children=Dh(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Nn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Xt}updateOuterDeco(e){if(Ih(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=SO(this.dom,this.nodeDOM,Nh(this.outerDeco,this.node,n),Nh(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function TS(t,e,n,r,i){bO(r,e,t);let o=new Nr(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class vf extends Nr{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Nn||this.dirty!=Xt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Xt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Xt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new vf(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Nn)}get domAtom(){return!1}}class yO extends Xl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Xt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class lQ extends Nr{constructor(e,n,r,i,o,s,l,a,u,c){super(e,n,r,i,o,s,l,u,c),this.spec=a}update(e,n,r,i){if(this.dirty==Nn)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function vO(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Pi.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let u=n.children[r-1];if(u instanceof Pi)n=u,r=u.children.length;else{l=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function fQ(t,e){return t.type.side-e.type.side}function dQ(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let u=0;uo;)l.push(i[s++]);let h=o+d.nodeSize;if(d.isText){let S=h;s!S.inline):l.slice();r(d,v,e.forChild(o,d),p),o=h}}function pQ(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function hQ(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=$n(t)}else if(t.nodeType==1&&e=n){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let u=l=0&&u+e.length+l>=n)return l+u;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Dh(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||c<=e?o.push(a):(un&&o.push(a.slice(n-u,a.size,r)))}return o}function Hg(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,u;if(yf(n)){for(a=l;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&J.isSelectable(c)&&i.parent&&!(c.isInline&&BJ(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;u=new J(s==f?l:r.resolve(f))}}else{let c=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null;a=r.resolve(c)}if(!u){let c=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!wO(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function yQ(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,dt(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&At&&Mr<=11&&(r.disabled=!0,r.disabled=!1)}function EO(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(PS(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else PS(t)}function PS(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Kg(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||me.between(e,n,r)}function _S(t){return t.editable&&!t.hasFocus()?!1:CO(t)}function CO(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function vQ(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Ai(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Rh(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ae.findFrom(o,e)}function cr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function MS(t,e,n){let r=t.state.selection;if(r instanceof me)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return cr(t,new me(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Rh(t.state,e);return i&&i instanceof J?cr(t,i):!1}else if(!(Ht&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?J.isSelectable(o)?cr(t,new J(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Ql?cr(t,new me(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return cr(t,new me(e>0?r.$to:r.$from));{let i=Rh(t.state,e);return i?cr(t,i):!1}}}function ic(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function nl(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Yi(t,e){return e<0?SQ(t):bQ(t)}function SQ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(yn&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(nl(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(xO(n))break;{let l=n.previousSibling;for(;l&&nl(l,-1);)i=n.parentNode,o=dt(l),l=l.previousSibling;if(l)n=l,r=ic(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Lh(t,n,r):i&&Lh(t,i,o)}function bQ(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=ic(n),o,s;for(;;)if(r{t.state==i&&Qn(t)},50)}function NS(t,e){let n=t.state.doc.resolve(e);if(!(st||WJ)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function IS(t,e,n){let r=t.state.selection;if(r instanceof me&&!r.empty||n.indexOf("s")>-1||Ht&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Rh(t.state,e);if(s&&s instanceof J)return cr(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Lt?ae.near(s,e):ae.findFrom(s,e);return l?cr(t,l):!1}return!1}function DS(t,e){if(!(t.state.selection instanceof me))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function RS(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function CQ(t){if(!mt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;RS(t,r,"true"),setTimeout(()=>RS(t,r,"false"),20)}return!1}function xQ(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function TQ(t,e){let n=e.keyCode,r=xQ(e);if(n==8||Ht&&n==72&&r=="c")return DS(t,-1)||Yi(t,-1);if(n==46&&!e.shiftKey||Ht&&n==68&&r=="c")return DS(t,1)||Yi(t,1);if(n==13||n==27)return!0;if(n==37||Ht&&n==66&&r=="c"){let i=n==37?NS(t,t.state.selection.from)=="ltr"?-1:1:-1;return MS(t,i,r)||Yi(t,i)}else if(n==39||Ht&&n==70&&r=="c"){let i=n==39?NS(t,t.state.selection.from)=="ltr"?1:-1:1;return MS(t,i,r)||Yi(t,i)}else{if(n==38||Ht&&n==80&&r=="c")return IS(t,-1,r)||Yi(t,-1);if(n==40||Ht&&n==78&&r=="c")return CQ(t)||IS(t,1,r)||Yi(t,1);if(r==(Ht?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function TO(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Yn.fromSchema(t.state.schema),l=_O(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let u=a.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=PO[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let h=l.createElement(c[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),f++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` + +`);return{dom:a,text:d}}function OO(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=e&&(r||o||!n);if(a){if(t.someProp("transformPastedText",d=>{e=d(e,o||r,t)}),o)return e?new V(F.from(t.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0):V.empty;let f=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(f)l=f;else{let d=i.marks(),{schema:p}=t.state,h=Yn.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let S=s.appendChild(document.createElement("p"));v&&S.appendChild(h.serializeNode(p.text(v,d)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=kQ(n),Ql&&AQ(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Pl.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!OQ.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)l=PQ(LS(l,+c[1],+c[2]),c[4]);else if(l=V.maxOpen($Q(l.content,i),!0),l.openStart||l.openEnd){let f=0,d=0;for(let p=l.content.firstChild;f{l=f(l,t)}),l}const OQ=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function $Q(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),u;if(!a)return s=null;if(u=s.length&&o.length&&kO(a,o,l,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=AO(s[s.length-1],o.length));let c=$O(l,a);s.push(c),i=i.matchType(c.type),o=a}}),s)return F.from(s)}return t}function $O(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,F.from(t));return t}function kO(t,e,n,r,i){if(i1&&(o=0),i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(F.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function LS(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=_O().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&PO[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=F.from(a.create(r[l+1],i)),o++,s++}return new V(i,o,s)}const gt={},yt={},_Q={touchstart:!0,touchmove:!0};class MQ{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function NQ(t){for(let e in gt){let n=gt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{DQ(t,r)&&!Gg(t,r)&&(t.editable||!(r.type in yt))&&n(t,r)},_Q[e]?{passive:!0}:void 0)}mt&&t.dom.addEventListener("input",()=>null),Bh(t)}function wr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function IQ(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Bh(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Gg(t,r))})}function Gg(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function DQ(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function RQ(t,e){!Gg(t,e)&>[e.type]&&(t.editable||!(e.type in yt))&>[e.type](t,e)}yt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!NO(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(un&&st&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Ho&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,ni(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||TQ(t,n)?n.preventDefault():wr(t,"key")};yt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};yt.keypress=(t,e)=>{let n=e;if(NO(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ht&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof me)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Sf(t){return{left:t.clientX,top:t.clientY}}function LQ(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function qg(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ko(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function FQ(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(ko(t,new J(n),"pointer"),!0):!1}function BQ(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof J&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(J.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(ko(t,J.create(t.state.doc,i),"pointer"),!0):!1}function zQ(t,e,n,r,i){return qg(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?BQ(t,n):FQ(t,n))}function jQ(t,e,n,r){return qg(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function UQ(t,e,n,r){return qg(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||WQ(t,n,r)}function WQ(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ko(t,me.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)ko(t,me.create(r,l+1,l+1+s.content.size),"pointer");else if(J.isSelectable(s))ko(t,J.create(r,l),"pointer");else continue;return!0}}function Yg(t){return oc(t)}const MO=Ht?"metaKey":"ctrlKey";gt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Yg(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&LQ(n,t.input.lastClick)&&!n[MO]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Sf(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new VQ(t,s,n,!!r)):(o=="doubleClick"?jQ:UQ)(t,s.pos,s.inside,n)?n.preventDefault():wr(t,"pointer"))};class VQ{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[MO],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let c=e.state.doc.resolve(n.pos);o=c.parent,s=c.depth?c.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof J&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&yn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),wr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Qn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Sf(e))),this.updateAllowDefault(e),this.allowDefault||!n?wr(this.view,"pointer"):zQ(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||mt&&this.mightDrag&&!this.mightDrag.node.isAtom||st&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ko(this.view,ae.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):wr(this.view,"pointer")}move(e){this.updateAllowDefault(e),wr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}gt.touchstart=t=>{t.input.lastTouch=Date.now(),Yg(t),wr(t,"pointer")};gt.touchmove=t=>{t.input.lastTouch=Date.now(),wr(t,"pointer")};gt.contextmenu=t=>Yg(t);function NO(t,e){return t.composing?!0:mt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const HQ=un?5e3:-1;yt.compositionstart=yt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),oc(t,!0),t.markCursor=null;else if(oc(t),yn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}IO(t,HQ)};yt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,IO(t,20))};function IO(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>oc(t),e))}function DO(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=KQ());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function KQ(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function oc(t,e=!1){if(!(un&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),DO(t),e||t.docView&&t.docView.dirty){let n=Hg(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function GQ(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Nl=At&&Mr<15||Ho&&VJ<604;gt.copy=yt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Nl?null:n.clipboardData,s=r.content(),{dom:l,text:a}=TO(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):GQ(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function qQ(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function YQ(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Il(t,r.value,null,i,e):Il(t,r.textContent,r.innerHTML,i,e)},50)}function Il(t,e,n,r,i){let o=OO(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,i,o||V.empty)))return!0;if(!o)return!1;let s=qQ(o),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function RO(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}yt.paste=(t,e)=>{let n=e;if(t.composing&&!un)return;let r=Nl?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Il(t,RO(r),r.getData("text/html"),i,n)?n.preventDefault():YQ(t,n)};class LO{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const FO=Ht?"altKey":"ctrlKey";gt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Sf(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof J?i.to-1:i.to))){if(r&&r.mightDrag)s=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let c=t.docView.nearestDesc(n.target,!0);c&&c.node.type.spec.draggable&&c!=t.docView&&(s=J.create(t.state.doc,c.posBefore))}}let l=(s||t.state.selection).content(),{dom:a,text:u}=TO(t,l);n.dataTransfer.clearData(),n.dataTransfer.setData(Nl?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Nl||n.dataTransfer.setData("text/plain",u),t.dragging=new LO(l,!n[FO],s)};gt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};yt.dragover=yt.dragenter=(t,e)=>e.preventDefault();yt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Sf(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=OO(t,RO(n.dataTransfer),Nl?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[FO]);if(t.someProp("handleDrop",h=>h(t,n,s||V.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?OJ(t.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let u=t.state.tr;if(l){let{node:h}=r;h?h.replace(u):u.deleteSelection()}let c=u.mapping.map(a),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=u.doc;if(f?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(d))return;let p=u.doc.resolve(c);if(f&&J.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new J(p));else{let h=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((v,S,m,y)=>h=y),u.setSelection(Kg(t,p,u.doc.resolve(h)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))};gt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Qn(t)},20))};gt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};gt.beforeinput=(t,e)=>{if(st&&un&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,ni(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in yt)gt[t]=yt[t];function Dl(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class sc{constructor(e,n){this.toDOM=e,this.spec=n||yi,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new dn(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof sc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Dl(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ir{constructor(e,n){this.attrs=e,this.spec=n||yi}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new dn(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==rt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||yi)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let u=a+r,c;if(c=zO(n,l,u)){for(i||(i=this.children.slice());ol&&f.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&a.type instanceof Ir){let u=Math.max(o,a.from)-o,c=Math.min(s,a.to)-o;ui.map(e,n,yi));return mr.from(r)}forChild(e,n){if(n.isLeaf)return ze.empty;let r=[];for(let i=0;in instanceof ze)?e:e.reduce((n,r)=>n.concat(r instanceof ze?r:r.members),[]))}}}function JQ(t,e,n,r,i,o,s){let l=t.slice();for(let u=0,c=o;u{let S=v-h-(p-d);for(let m=0;my+c-f)continue;let g=l[m]+c-f;p>=g?l[m+1]=d<=g?-2:-1:d>=c&&S&&(l[m]+=S,l[m+1]+=S)}f+=S}),c=n.maps[u].map(c,-1)}let a=!1;for(let u=0;u=r.content.size){a=!0;continue}let d=n.map(t[u+1]+o,-1),p=d-i,{index:h,offset:v}=r.content.findIndex(f),S=r.maybeChild(h);if(S&&v==f&&v+S.nodeSize==p){let m=l[u+2].mapInner(n,S,c+1,t[u]+o+1,s);m!=rt?(l[u]=f,l[u+1]=p,l[u+2]=m):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=QQ(l,t,e,n,i,o,s),c=lc(u,r,0,s);e=c.local;for(let f=0;fn&&s.to{let u=zO(t,l,a+n);if(u){o=!0;let c=lc(u,l,n+a+1,r);c!=rt&&i.push(a,a+l.nodeSize,c)}});let s=BO(o?jO(t):t,-n).sort(vi);for(let l=0;l0;)e++;t.splice(e,0,n)}function Vd(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=rt&&e.push(r)}),t.cursorWrapper&&e.push(ze.create(t.state.doc,[t.cursorWrapper.deco])),mr.from(e)}const XQ={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ZQ=At&&Mr<=11;class eX{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class tX{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eX,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),ZQ&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,XQ)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(_S(this.view)){if(this.suppressingSelectionUpdates)return Qn(this.view);if(At&&Mr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ai(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=Ml(o))n.add(o);for(let o=e.anchorNode;o;o=Ml(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&_S(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let c=0;c1){let c=a.filter(f=>f.nodeName=="BR");if(c.length==2){let f=c[0],d=c[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),nX(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Qn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;ci;S--){let m=r.childNodes[S-1],y=m.pmViewDesc;if(m.nodeName=="BR"&&!y){o=S;break}if(!y||y.size)break}let f=t.state.doc,d=t.someProp("domParser")||Pl.fromSchema(t.state.schema),p=f.resolve(s),h=null,v=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:oX,context:p});if(u&&u[0].pos!=null){let S=u[0].pos,m=u[1]&&u[1].pos;m==null&&(m=S),h={anchor:S+s,head:m+s}}return{doc:v,sel:h,from:s,to:l}}function oX(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(mt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||mt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const sX=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function lX(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,I=Hg(t,A);if(I&&!t.state.selection.eq(I)){if(st&&un&&t.input.lastKeyCode===13&&Date.now()-100$(t,ni(13,"Enter"))))return;let M=t.state.tr.setSelection(I);A=="pointer"?M.setMeta("pointer",!0):A=="key"&&M.scrollIntoView(),o&&M.setMeta("composition",o),t.dispatch(M)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,u=iX(t,e,n),c=t.state.doc,f=c.slice(u.from,u.to),d,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||un)&&i.some(A=>A.nodeType==1&&!sX.test(A.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",A=>A(t,ni(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof me&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(u.sel){let A=US(t,t.state.doc,u.sel);if(A&&!A.eq(t.state.selection)){let I=t.state.tr.setSelection(A);o&&I.setMeta("composition",o),t.dispatch(I)}}return}if(st&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let A=h.endB-h.start;u.sel={anchor:u.sel.anchor+A,head:u.sel.anchor+A}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?h.start=t.state.selection.from:h.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),At&&Mr<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>u.from&&u.doc.textBetween(h.start-u.from-1,h.start-u.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let v=u.doc.resolveNoCache(h.start-u.from),S=u.doc.resolveNoCache(h.endB-u.from),m=c.resolve(h.start),y=v.sameParent(S)&&v.parent.inlineContent&&m.end()>=h.endA,g;if((Ho&&t.input.lastIOSEnter>Date.now()-225&&(!y||i.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!y&&v.posA(t,ni(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&uX(c,h.start,h.endA,v,S)&&t.someProp("handleKeyDown",A=>A(t,ni(8,"Backspace")))){un&&st&&t.domObserver.suppressSelectionUpdates();return}st&&un&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),un&&!y&&v.start()!=S.start()&&S.parentOffset==0&&v.depth==S.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==h.endA&&(h.endB-=2,S=u.doc.resolveNoCache(h.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(A){return A(t,ni(13,"Enter"))})},20));let w=h.start,C=h.endA,x,P,b;if(y){if(v.pos==S.pos)At&&Mr<=11&&v.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Qn(t),20)),x=t.state.tr.delete(w,C),P=c.resolve(h.start).marksAcross(c.resolve(h.endA));else if(h.endA==h.endB&&(b=aX(v.parent.content.cut(v.parentOffset,S.parentOffset),m.parent.content.cut(m.parentOffset,h.endA-m.start()))))x=t.state.tr,b.type=="add"?x.addMark(w,C,b.mark):x.removeMark(w,C,b.mark);else if(v.parent.child(v.index()).isText&&v.index()==S.index()-(S.textOffset?0:1)){let A=v.parent.textBetween(v.parentOffset,S.parentOffset);if(t.someProp("handleTextInput",I=>I(t,w,C,A)))return;x=t.state.tr.insertText(A,w,C)}}if(x||(x=t.state.tr.replace(w,C,u.doc.slice(h.start-u.from,h.endB-u.from))),u.sel){let A=US(t,x.doc,u.sel);A&&!(st&&un&&t.composing&&A.empty&&(h.start!=h.endB||t.input.lastAndroidDeletee.content.size?null:Kg(t,e.resolve(n.anchor),e.resolve(n.head))}function aX(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,a;for(let c=0;cc.mark(l.addToSet(c.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;cn||Hd(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function cX(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&e<=57343&&n>=55296&&n<=56319}class wZ{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new MQ,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(qS),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=KS(this),HS(this),this.nodeViews=GS(this),this.docView=TS(this.state.doc,VS(this),Vd(this),this.dom,this),this.domObserver=new tX(this,(r,i,o,s)=>lX(this,r,i,o,s)),this.domObserver.start(),NQ(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Bh(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(qS),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(DO(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=GS(this);dX(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Bh(this),this.editable=KS(this),HS(this);let a=Vd(this),u=VS(this),c=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,u,a);(f||!e.selection.eq(i.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&GJ(this);if(s){this.domObserver.stop();let p=f&&(At||st)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&fX(i.selection,e.selection);if(f){let h=st?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,u,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=TS(e.doc,u,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&vQ(this))?Qn(this,p):(EO(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&qJ(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&SS(this,n.getBoundingClientRect(),e)}else SS(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new LO(e.slice,e.move,i<0?void 0:J.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return eQ(this,e)}coordsAtPos(e,n=1){return hO(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return oQ(this,n||this.state,e)}pasteHTML(e,n){return Il(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Il(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(IQ(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Vd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return RQ(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return mt&&this.root.nodeType===11&&zJ(this.dom.ownerDocument)==this.dom?rX(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function VS(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[dn.node(0,t.state.doc.content.size,e)]}function HS(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:dn.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function KS(t){return!t.someProp("editable",e=>e(t.state)===!1)}function fX(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function GS(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function dX(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function qS(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var zr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ac={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},pX=typeof navigator<"u"&&/Mac/.test(navigator.platform),hX=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ye=0;Ye<10;Ye++)zr[48+Ye]=zr[96+Ye]=String(Ye);for(var Ye=1;Ye<=24;Ye++)zr[Ye+111]="F"+Ye;for(var Ye=65;Ye<=90;Ye++)zr[Ye]=String.fromCharCode(Ye+32),ac[Ye]=String.fromCharCode(Ye);for(var Kd in zr)ac.hasOwnProperty(Kd)||(ac[Kd]=zr[Kd]);function mX(t){var e=pX&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||hX&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ac:zr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const gX=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function yX(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=zr[r.keyCode])&&o!=i){let l=e[Gd(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const UO=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function bX(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const wX=(t,e,n)=>{let r=bX(t,n);if(!r)return!1;let i=WO(r);if(!i){let s=r.blockRange(),l=s&&zg(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&HO(t,i,e))return!0;if(r.parent.content.size==0&&(Ko(o,"end")||J.isSelectable(o))){let s=jg(t.doc,r.before(),r.after(),V.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=WO(r)}let s=o&&o.nodeBefore;return!s||!J.isSelectable(s)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function WO(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function CX(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=CX(t,n);if(!r)return!1;let i=VO(r);if(!i)return!1;let o=i.nodeAfter;if(HO(t,i,e))return!0;if(r.parent.content.size==0&&(Ko(o,"start")||J.isSelectable(o))){let s=jg(t.doc,r.before(),r.after(),V.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function Xg(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Xg(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(ae.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},kX=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Lt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Xg(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(ru(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&zg(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function PX(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof J&&e.selection.node.isBlock)return!r.parentOffset||!ru(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let o=i.parentOffset==i.parent.content.size,s=e.tr;(e.selection instanceof me||e.selection instanceof Lt)&&s.deleteSelection();let l=r.depth==0?null:Xg(r.node(-1).contentMatchAt(r.indexAfter(-1))),a=t&&t(i.parent,o),u=a?[a]:o&&l?[{type:l}]:void 0,c=ru(s.doc,s.mapping.map(r.pos),1,u);if(!u&&!c&&ru(s.doc,s.mapping.map(r.pos),1,l?[{type:l}]:void 0)&&(l&&(u=[{type:l}]),c=!0),c&&(s.split(s.mapping.map(r.pos),1,u),!o&&!r.parentOffset&&r.parent.type!=l)){let f=s.mapping.map(r.before()),d=s.doc.resolve(f);l&&r.node(-1).canReplaceWith(d.index(),d.index()+1,l)&&s.setNodeMarkup(s.mapping.map(r.before()),l)}n(s.scrollIntoView())}return!0}}const _X=PX(),MX=(t,e)=>(e&&e(t.tr.setSelection(new Lt(t.doc))),!0);function NX(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||eO(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function HO(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(NX(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,d=F.empty;for(let v=o.length-1;v>=0;v--)d=F.from(o[v].create(null,d));d=F.from(r.copy(d));let p=t.tr.step(new Rt(e.pos-1,f,e.pos,f,new V(d,1,0),o.length,!0)),h=f+2*o.length;eO(p.doc,h)&&p.join(h),n(p.scrollIntoView())}return!0}let a=ae.findFrom(e,1),u=a&&a.$from.blockRange(a.$to),c=u&&zg(u);if(c!=null&&c>=e.depth)return n&&n(t.tr.lift(u,c).scrollIntoView()),!0;if(l&&Ko(i,"start",!0)&&Ko(r,"end")){let f=r,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=F.empty;for(let m=d.length-1;m>=0;m--)v=F.from(d[m].copy(v));let S=t.tr.step(new Rt(e.pos-d.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new V(v,d.length,0),0,!0));n(S.scrollIntoView())}return!0}}return!1}function KO(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(me.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const IX=KO(-1),DX=KO(1);function Zg(...t){return function(e,n,r){for(let i=0;i=n?Ue.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Ue.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ue.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Ue.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};Ue.from=function(e){return e instanceof Ue?e:e&&e.length?new qO(e):Ue.empty};var qO=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=uc)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=uc)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ue);Ue.empty=new qO([]);var LX=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ue);const FX=500;class fn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,c.push(f);return}if(i){c.push(new Cn(f.map));let p=f.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],u.push(new Cn(h,void 0,void 0,u.length+c.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,a=new fn(this.items.slice(0,r).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let c=0;czX&&(l=BX(l,u),s-=u),new fn(l.append(o),s)}remapping(e,n){let r=new Oo;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new fn(this.items.append(e.map(n=>new Cn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(d=>{d.selection&&l--},i);let a=n;this.items.forEach(d=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(d.step){let v=e.steps[p].invert(e.docs[p]),S=d.selection&&d.selection.map(o.slice(a+1,p));S&&l++,r.push(new Cn(h,v,S))}else r.push(new Cn(h))},i);let u=[];for(let d=n;dFX&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(n.slice(r)),u=a&&a.getMap();if(r--,u&&n.appendMap(u,r),a){let c=s.selection&&s.selection.map(n.slice(r));c&&o++;let f=new Cn(u.invert(),a,c),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new fn(Ue.from(i.reverse()),o)}}fn.empty=new fn(Ue.empty,0);function BX(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class Cn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Cn(n.getMap().invert(),n,this.selection)}}}class fr{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const zX=20;function jX(t,e,n,r){let i=n.getMeta(Dr),o;if(i)return i.historyState;n.getMeta(WX)&&(t=new fr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Dr))return s.getMeta(Dr).redo?new fr(t.done.addTransform(n,void 0,r,iu(e)),t.undone,JS(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new fr(t.done,t.undone.addTransform(n,void 0,r,iu(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!UX(n,t.prevRanges)),u=s?Yd(t.prevRanges,n.mapping):JS(n.mapping.maps[n.steps.length-1]);return new fr(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,iu(e)),fn.empty,u,n.time,l??t.prevComposition)}else return(o=n.getMeta("rebased"))?new fr(t.done.rebased(n,o),t.undone.rebased(n,o),Yd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new fr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Yd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function UX(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function JS(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Yd(t,e){if(!t)return null;let n=[];for(let r=0;r{let n=Dr.getState(t);return!n||n.done.eventCount==0?!1:(e&&YO(n,t,e,!1),!0)},HX=(t,e)=>{let n=Dr.getState(t);return!n||n.undone.eventCount==0?!1:(e&&YO(n,t,e,!0),!0)};export{uZ as $,pZ as A,hZ as B,xZ as C,EZ as D,VX as E,vZ as F,HX as G,CZ as H,cZ as I,Ls as J,Pl as K,wZ as L,jY as M,WY as N,hK as O,aZ as P,We as R,bZ as S,tZ as U,JX as _,QX as a,ol as b,ZX as c,XX as d,oe as e,YX as f,qX as g,KX as h,GX as i,iZ as j,D7 as k,lZ as l,nZ as m,fZ as n,yZ as o,kc as p,rZ as q,_ as r,dZ as s,sZ as t,oZ as u,eZ as v,gZ as w,oT as x,SZ as y,mZ as z}; diff --git a/packages/chord-chart-studio/build/index.html b/packages/chord-chart-studio/build/index.html index 80b7dee1..c0d5ea3a 100644 --- a/packages/chord-chart-studio/build/index.html +++ b/packages/chord-chart-studio/build/index.html @@ -12,12 +12,10 @@ name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> + + - @@ -39,10 +37,10 @@ gtag('config', 'G-EGKBT2J600'); - - + + - +
diff --git a/packages/chord-chart-studio/build/sw.js b/packages/chord-chart-studio/build/sw.js index c2c48be2..9d9ca3e2 100644 --- a/packages/chord-chart-studio/build/sw.js +++ b/packages/chord-chart-studio/build/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const n=(n,t)=>(n=new URL(n+".js",t).href,s[n]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()})).then((()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(t,o)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(s[i])return;let r={};const l=e=>n(e,i),c={module:{uri:i},exports:r,require:l};s[i]=Promise.all(t.map((e=>c[e]||l(e)))).then((e=>(o(...e),r)))}}define(["./workbox-f6d27052"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-B0ChhUNb.js",revision:null},{url:"assets/index-BmEYkRDe.css",revision:null},{url:"assets/logo-D2B3txiq.svg",revision:null},{url:"assets/vendor-B9p68kIM.js",revision:null},{url:"assets/vendor-BHpWJQ6D.css",revision:null},{url:"icon.svg",revision:"22be856a58b037f4d448a78f2fc6dee6"},{url:"index.html",revision:"4ae74fa07cc2b5b4dd4094bd13c114bb"},{url:"registerSW.js",revision:"6a7126f4909d378979bca200ff77879d"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"))),e.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),e.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new e.StaleWhileRevalidate({cacheName:"google-fonts-webfonts",plugins:[new e.CacheableResponsePlugin({statuses:[0,200]}),new e.ExpirationPlugin({maxAgeSeconds:31536e3,maxEntries:30})]}),"GET")})); +if(!self.define){let e,s={};const n=(n,t)=>(n=new URL(n+".js",t).href,s[n]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()})).then((()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(t,o)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(s[i])return;let r={};const l=e=>n(e,i),u={module:{uri:i},exports:r,require:l};s[i]=Promise.all(t.map((e=>u[e]||l(e)))).then((e=>(o(...e),r)))}}define(["./workbox-f6d27052"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"assets/index-BwbBfjx-.js",revision:null},{url:"assets/index-s8b48HYU.css",revision:null},{url:"assets/logo-D2B3txiq.svg",revision:null},{url:"assets/vendor-BHpWJQ6D.css",revision:null},{url:"assets/vendor-BWYuIjsn.js",revision:null},{url:"icon.svg",revision:"22be856a58b037f4d448a78f2fc6dee6"},{url:"index.html",revision:"51139fafcb542b538993efeed9eb8ebe"},{url:"registerSW.js",revision:"6a7126f4909d378979bca200ff77879d"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"))),e.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),e.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new e.StaleWhileRevalidate({cacheName:"google-fonts-webfonts",plugins:[new e.CacheableResponsePlugin({statuses:[0,200]}),new e.ExpirationPlugin({maxAgeSeconds:31536e3,maxEntries:30})]}),"GET")})); diff --git a/packages/chord-chart-studio/package.json b/packages/chord-chart-studio/package.json index 177e9796..377870d9 100644 --- a/packages/chord-chart-studio/package.json +++ b/packages/chord-chart-studio/package.json @@ -33,6 +33,7 @@ "storybook": "8.0.0-rc.0" }, "dependencies": { + "@reduxjs/toolkit": "^2.2.1", "chord-mark": "^0.16.2", "chord-mark-converters": "^0.16.2", "chord-mark-themes": "^0.16.2", @@ -61,9 +62,6 @@ "react-aria-components": "^1.1.1", "react-dom": "^18.2.0", "react-redux": "^8.1.3", - "redux": "^4.2.1", - "redux-devtools-extension": "^2.13.9", - "redux-thunk": "^2.4.2", "reselect": "^4.1.8", "scroll-sync-react": "^1.2.0", "universal-router": "^9.2.0", diff --git a/packages/chord-chart-studio/src/core/createAppSlice.js b/packages/chord-chart-studio/src/core/createAppSlice.js new file mode 100644 index 00000000..1626d6cf --- /dev/null +++ b/packages/chord-chart-studio/src/core/createAppSlice.js @@ -0,0 +1,7 @@ +import { buildCreateSlice, asyncThunkCreator } from '@reduxjs/toolkit'; + +const createAppSlice = buildCreateSlice({ + creators: { asyncThunk: asyncThunkCreator }, +}); + +export default createAppSlice; diff --git a/packages/chord-chart-studio/src/db/files/filesSlice.js b/packages/chord-chart-studio/src/db/files/filesSlice.js new file mode 100644 index 00000000..81346963 --- /dev/null +++ b/packages/chord-chart-studio/src/db/files/filesSlice.js @@ -0,0 +1,151 @@ +import { v4 as uuidv4 } from 'uuid'; +import _pick from 'lodash/pick'; + +import { createSlice } from '@reduxjs/toolkit'; +import clock from '../../core/clock'; + +import editorModeOptions from '../options/editorModeOptions'; +import { getCategoryOptions, getLatestModeOptions } from './selectors'; + +import { optionValueChanged } from '../options/optionsSlice'; +import { editorModeChanged } from '../../ui/layout/app/uiSlice'; + +const initialState = { + allFiles: {}, +}; + +function fileCreatedAction(title, content = '') { + if (!title) { + throw new TypeError('Cannot create a file without title'); + } + return { + payload: { + id: uuidv4(), + title, + content, + }, + }; +} + +function fileCreatedReducer(state, action) { + const { id, title, content } = action.payload; + state.allFiles[id] = { id, title, content }; +} + +function fileUpdatedAction(id, { title, content } = {}) { + if (!id) { + throw new TypeError('Cannot update a file without an id'); + } + return { + payload: { + id, + title, + content, + }, + }; +} + +function fileUpdatedReducer(state, action) { + const { id, title, content } = action.payload; + + if (state.allFiles[id] && !(!title && typeof content === 'undefined')) { + if (title) { + state.allFiles[id].title = title; + } + if (typeof content !== 'undefined') { + state.allFiles[id].content = content; + } + } +} + +function fileDeletedReducer(state, action) { + const id = action.payload; + + if (id && state.allFiles[id]) { + delete state.allFiles[id]; + } +} + +/** + * Whenever the user set an option, we save it in the song entity, either: + * - for the current editing mode if it is a formatting option + * - in the preferences otherwise + */ +function optionValueChangedReducer(state, action) { + const { context, key, value, fileId, editorMode } = action.payload; + + if ( + ['songFormatting', 'songPreferences'].includes(context) && + state.allFiles[fileId] + ) { + const optionCategory = + context === 'songPreferences' ? 'preferences' : editorMode; + + if (!state.allFiles[fileId].options) { + state.allFiles[fileId].options = {}; + } + if (!state.allFiles[fileId].options[optionCategory]) { + state.allFiles[fileId].options[optionCategory] = {}; + } + state.allFiles[fileId].options[optionCategory].updatedAt = clock(); + state.allFiles[fileId].options[optionCategory][key] = value; + } + return state; +} + +/** + * When a user switch mode and the target mode does not have any saved settings yet, + * we apply the latest saved settings (all modes merged) for a better user flow + */ +function editorModeChangedReducer(state, action) { + const { fileId, mode: nextMode } = action.payload; + + const hasOptionsForNextMode = !!getCategoryOptions(state, fileId, nextMode); + + if (!hasOptionsForNextMode) { + const previousModeOptions = _pick( + getLatestModeOptions(state, fileId) || {}, + editorModeOptions[nextMode] + ); + + if (Object.keys(previousModeOptions).length) { + previousModeOptions.updatedAt = clock(); + if (!state.allFiles[fileId].options) { + state.allFiles[fileId].options = {}; + } + + state.allFiles[fileId].options[nextMode] = previousModeOptions; + } + } + return state; +} + +const uiSlice = createSlice({ + name: 'files', + initialState, + reducers: (create) => ({ + fileCreated: create.preparedReducer( + fileCreatedAction, + fileCreatedReducer + ), + fileImported: create.preparedReducer( + fileCreatedAction, + fileCreatedReducer + ), + fileUpdated: create.preparedReducer( + fileUpdatedAction, + fileUpdatedReducer + ), + fileDeleted: create.reducer(fileDeletedReducer), + }), + extraReducers: (builder) => { + builder + .addCase(optionValueChanged.fulfilled, optionValueChangedReducer) + .addCase(editorModeChanged.fulfilled, editorModeChangedReducer); + }, +}); + +export const { fileCreated, fileImported, fileUpdated, fileDeleted } = + uiSlice.actions; + +export default uiSlice.reducer; diff --git a/packages/chord-chart-studio/src/db/files/reducers.js b/packages/chord-chart-studio/src/db/files/reducers.js index 412c6fca..195644c9 100644 --- a/packages/chord-chart-studio/src/db/files/reducers.js +++ b/packages/chord-chart-studio/src/db/files/reducers.js @@ -4,8 +4,7 @@ import clock from '../../core/clock'; import * as actionTypes from './actionsTypes'; import { DB_OPTION_SET_OPTION_VALUE } from '../options/actionsTypes'; -import { UI_LAYOUT_APP_SET_EDITOR_MODE } from '../../ui/layout/app/_state/actionsTypes'; -import { getEditorMode } from '../../ui/layout/app/_state/selectors'; +import { getEditorMode } from '../../ui/layout/app/uiSlice'; import { getSelectedId } from '../../fileManager/_state/selectors'; import { getLatestModeOptions, getCategoryOptions } from './selectors'; import editorModeOptions from '../options/editorModeOptions'; @@ -116,7 +115,7 @@ function addOption(fileState, category, key, value) { */ function setEditorMode(state, action, fullState) { const fileId = getSelectedId(fullState); - const nextMode = action.payload.mode; + const nextMode = action.payload; const hasOptionsForNextMode = !!getCategoryOptions( fullState, @@ -162,7 +161,7 @@ export default (state = initialState, action = {}, fullState = {}) => { return deleteFile(state, action); case DB_OPTION_SET_OPTION_VALUE: return updateFileOption(state, action, fullState); - case UI_LAYOUT_APP_SET_EDITOR_MODE: + case 'ui/editorModeChanged': return setEditorMode(state, action, fullState); } return state; diff --git a/packages/chord-chart-studio/src/db/files/selectors.js b/packages/chord-chart-studio/src/db/files/selectors.js index 5ef25415..5020c3e1 100644 --- a/packages/chord-chart-studio/src/db/files/selectors.js +++ b/packages/chord-chart-studio/src/db/files/selectors.js @@ -2,7 +2,9 @@ import _map from 'lodash/map'; import _cloneDeep from 'lodash/cloneDeep'; import _isEqual from 'lodash/isEqual'; import _sortBy from 'lodash/sortBy'; +import _pick from 'lodash/pick'; +import allEditorModeOptions from '../options/editorModeOptions'; //fixme: duh! import { createSelectorCreator, defaultMemoize } from 'reselect'; // create a "selector creator" that uses lodash.isEqual instead of === @@ -19,8 +21,23 @@ export const getOne = (state, id) => { return state.db.files.allFiles[id]; }; +// Get defined options for a mode, either because they exist for the given mode, +// or building them from options stored in the other modes +export function getModeOptions(state, fileId, mode) { + let editorModeOptions = getCategoryOptions(state.db.files, fileId, mode); + + if (!editorModeOptions) { + editorModeOptions = getLatestModeOptions(state.db.files, fileId) || {}; + } + delete editorModeOptions.updatedAt; + + // take only relevant options for the mode + return _pick(editorModeOptions, allEditorModeOptions[mode]); +} + +// todo: not a selector anymore! export const getCategoryOptions = (state, id, category) => { - const file = state.db.files.allFiles[id]; + const file = state.allFiles[id]; if (!file) return; @@ -33,8 +50,9 @@ export const getCategoryOptions = (state, id, category) => { } }; +// todo: not a selector anymore! export const getLatestModeOptions = (state, id) => { - const file = state.db.files.allFiles[id]; + const file = state.allFiles[id]; if (!file) return; diff --git a/packages/chord-chart-studio/src/db/options/optionsSlice.js b/packages/chord-chart-studio/src/db/options/optionsSlice.js new file mode 100644 index 00000000..4579a25f --- /dev/null +++ b/packages/chord-chart-studio/src/db/options/optionsSlice.js @@ -0,0 +1,127 @@ +import { v4 as uuidv4 } from 'uuid'; +import _pick from 'lodash/pick'; +import _cloneDeep from 'lodash/cloneDeep'; + +import createAppSlice from '../../core/createAppSlice'; +import clock from '../../core/clock'; + +import allEditorModeOptions from '../options/editorModeOptions'; +import { getCategoryOptions, getLatestModeOptions } from './selectors'; + +import { editorModeChanged, getEditorMode } from '../../ui/layout/app/uiSlice'; +import { getSelectedId } from '../../fileManager/_state/selectors'; +import { DB_OPTION_SET_OPTION_VALUE } from '../options/actionsTypes'; +import { FILE_MANAGER_SELECT_FILE } from '../../fileManager/_state/actionsTypes'; + +const initialState = {}; + +const sliceName = 'options'; + +export const optionValueChangedAction = ({ context, key, value }, thunkAPI) => { + if (!context) { + throw new TypeError('Cannot set an option without a context'); + } + if (!key) { + throw new TypeError('Cannot set an option without a key'); + } + const { getState } = thunkAPI; + const payload = { + context, + key, + value, + editorMode: getEditorMode(getState()), + fileId: getSelectedId(getState()), + }; + return Promise.resolve(payload); +}; + +function optionValueChangedReducer(state, action) { + const { context, key, value } = action.payload; + + if ( + !state[context] || + !state[context].values || + typeof state[context].values[key] === 'undefined' + ) { + return state; + } + + state[context].values[key] = value; +} + +function editorModeChangedReducer(state, action) { + const { modeOptions, optionsDefaults } = action.payload; + + if (!state.songFormatting) { + state.songFormatting = {}; + } + state.songFormatting.values = { ...optionsDefaults, ...modeOptions }; +} +/* +function selectFileReducer(state, action, fullState) { + const { id } = action.payload; + const editorMode = getEditorMode(fullState); + + const newOptions = getModeOptions(fullState, id, editorMode); + + const songPreferences = + getCategoryOptions(fullState, id, 'preferences') || {}; + delete songPreferences.updatedAt; + + const defaultPreferences = getOptionsDefaults(fullState, 'songPreferences'); + + const newPreferences = Object.assign(defaultPreferences, songPreferences); + + return { + ...state, + songPreferences: { + ...state.songPreferences, + values: { + ...newPreferences, + }, + }, + songFormatting: { + ...state.songFormatting, + values: { + ...newOptions, + }, + }, + }; +} +*/ + +const uiSlice = createAppSlice({ + name: sliceName, + initialState, + reducers: (create) => ({ + optionValueChanged: create.asyncThunk(optionValueChangedAction, { + fulfilled: optionValueChangedReducer, + }), + }), + /* + tmp: { + optionValueChanged: { + reducer: optionValueChangedReducer, + prepare: optionValueChangedAction, + }, + fileImported: { + reducer: fileCreatedReducer, + prepare: fileCreatedAction, + }, + fileUpdated: { + reducer: fileUpdatedReducer, + prepare: fileUpdatedAction, + }, + fileDeleted: fileDeletedReducer, + }, + */ + extraReducers: (builder) => { + builder + //.addCase(FILE_MANAGER_SELECT_FILE, selectFileReducer) + .addCase(editorModeChanged.fulfilled, editorModeChangedReducer); + }, +}); + +export const { optionValueChanged } = uiSlice.actions; + +export default uiSlice.reducer; diff --git a/packages/chord-chart-studio/src/db/options/reducers.js b/packages/chord-chart-studio/src/db/options/reducers.js index 4d38c7bb..cdf4f518 100644 --- a/packages/chord-chart-studio/src/db/options/reducers.js +++ b/packages/chord-chart-studio/src/db/options/reducers.js @@ -3,10 +3,9 @@ import _pick from 'lodash/pick'; import * as actionTypes from './actionsTypes'; import { getCategoryOptions, getLatestModeOptions } from '../files/selectors'; -import { UI_LAYOUT_APP_SET_EDITOR_MODE } from '../../ui/layout/app/_state/actionsTypes'; import { FILE_MANAGER_SELECT_FILE } from '../../fileManager/_state/actionsTypes'; import { getSelectedId } from '../../fileManager/_state/selectors'; -import { getEditorMode } from '../../ui/layout/app/_state/selectors'; +import { getEditorMode } from '../../ui/layout/app/uiSlice'; import { getOptionsDefaults } from './selectors'; import allEditorModeOptions from './editorModeOptions'; @@ -37,7 +36,7 @@ function setOptionValue(state, action) { function setEditorMode(state, action, fullState) { const fileId = getSelectedId(fullState); - const nextMode = action.payload.mode; + const nextMode = action.payload; const newOptions = getModeOptions(fullState, fileId, nextMode); @@ -105,7 +104,7 @@ export default (state = initialState, action = {}, fullState = {}) => { case actionTypes.DB_OPTION_SET_OPTION_VALUE: { return setOptionValue(state, action); } - case UI_LAYOUT_APP_SET_EDITOR_MODE: { + case 'ui/editorModeChanged': { return setEditorMode(state, action, fullState); } case FILE_MANAGER_SELECT_FILE: { diff --git a/packages/chord-chart-studio/src/editor/_containers/Editor.js b/packages/chord-chart-studio/src/editor/_containers/Editor.js index fd41df10..5691996f 100644 --- a/packages/chord-chart-studio/src/editor/_containers/Editor.js +++ b/packages/chord-chart-studio/src/editor/_containers/Editor.js @@ -1,7 +1,7 @@ import { connect } from 'react-redux'; import { getSelectedId } from '../../fileManager/_state/selectors'; -import { getEditorMode } from '../../ui/layout/app/_state/selectors'; +import { getEditorMode } from '../../ui/layout/app/reducers'; import { getOne } from '../../db/files/selectors'; import { updateFile } from '../../db/files/actions'; diff --git a/packages/chord-chart-studio/src/fileManager/_components/FileManager.jsx b/packages/chord-chart-studio/src/fileManager/_components/FileManager.jsx index 24fcc641..600190f9 100644 --- a/packages/chord-chart-studio/src/fileManager/_components/FileManager.jsx +++ b/packages/chord-chart-studio/src/fileManager/_components/FileManager.jsx @@ -25,7 +25,7 @@ function FileManager(props) { startImport, selectFile, updateFile, - setEditorMode, + editorModeChanged, } = props; return ( @@ -50,11 +50,11 @@ function FileManager(props) { enableRename={() => enableRename(selected)} startImport={() => startImport()} exportAsText={() => { - setEditorMode('export'); + editorModeChanged('export'); setTimeout(() => exportSelectedFileAsText(), 0); }} printFile={() => { - setEditorMode('print'); + editorModeChanged('print'); setTimeout(() => window.print(), 0); }} /> diff --git a/packages/chord-chart-studio/src/fileManager/_containers/FileManager.js b/packages/chord-chart-studio/src/fileManager/_containers/FileManager.js index d0e4ad93..593feb88 100644 --- a/packages/chord-chart-studio/src/fileManager/_containers/FileManager.js +++ b/packages/chord-chart-studio/src/fileManager/_containers/FileManager.js @@ -9,7 +9,7 @@ import { import { createFile, updateFile, deleteFile } from '../../db/files/actions'; import { startImport } from '../../songImporter/_state/actions'; -import { setEditorMode } from '../../ui/layout/app/_state/actions'; +import { editorModeChanged } from '../../ui/layout/app/reducers'; import { getAllTitles } from '../../db/files/selectors'; @@ -29,7 +29,7 @@ export default connect( deleteFile, updateFile, enableRename, - setEditorMode, + editorModeChanged, startImport, } )(FileManager); diff --git a/packages/chord-chart-studio/src/index.html b/packages/chord-chart-studio/src/index.html index a2b5f8d1..8a4fd50e 100755 --- a/packages/chord-chart-studio/src/index.html +++ b/packages/chord-chart-studio/src/index.html @@ -14,6 +14,11 @@ /> + + { saveState(store.getState()); diff --git a/packages/chord-chart-studio/src/ui/layout/app/_components/App.jsx b/packages/chord-chart-studio/src/ui/layout/app/_components/App.jsx index f41c2f1b..f3358517 100644 --- a/packages/chord-chart-studio/src/ui/layout/app/_components/App.jsx +++ b/packages/chord-chart-studio/src/ui/layout/app/_components/App.jsx @@ -17,9 +17,9 @@ function App(props) { editorMode, isLeftBarCollapsed, isRightBarCollapsed, - toggleLeftBar, - toggleRightBar, - setEditorMode, + leftBarToggled, + rightBarToggled, + editorModeChanged, selectedId, leftBar, @@ -42,14 +42,14 @@ function App(props) {
{leftBar}
@@ -62,7 +62,7 @@ function App(props) {
@@ -73,7 +73,7 @@ function App(props) {
@@ -82,7 +82,7 @@ function App(props) {
{rightBar} @@ -99,11 +99,11 @@ App.propTypes = { isLeftBarCollapsed: PropTypes.bool, isRightBarCollapsed: PropTypes.bool, selectedId: PropTypes.string, - toggleLeftBar: PropTypes.func.isRequired, - toggleRightBar: PropTypes.func.isRequired, + leftBarToggled: PropTypes.func.isRequired, + rightBarToggled: PropTypes.func.isRequired, editorMode: PropTypes.string.isRequired, - setEditorMode: PropTypes.func.isRequired, + editorModeChanged: PropTypes.func.isRequired, leftBar: PropTypes.element.isRequired, rightBar: PropTypes.element.isRequired, diff --git a/packages/chord-chart-studio/src/ui/layout/app/_components/Nav.jsx b/packages/chord-chart-studio/src/ui/layout/app/_components/Nav.jsx index 0b3a33f8..4af643e5 100644 --- a/packages/chord-chart-studio/src/ui/layout/app/_components/Nav.jsx +++ b/packages/chord-chart-studio/src/ui/layout/app/_components/Nav.jsx @@ -6,7 +6,7 @@ import PropTypes from 'prop-types'; import NavEntry from './NavEntry'; function Nav(props) { - const { currentMode, allEntries, setEditorMode, selectedId } = props; + const { currentMode, allEntries, editorModeChanged, selectedId } = props; return (