colonynote 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/client/assets/{arc-ZUytxQLt.js → arc-DLkoKlDx.js} +1 -1
  2. package/dist/client/assets/architecture-YZFGNWBL-CJ4F-aA8.js +1 -0
  3. package/dist/client/assets/{architectureDiagram-Q4EWVU46-DAs7Nxb1.js → architectureDiagram-Q4EWVU46-C6Mqm1k6.js} +1 -1
  4. package/dist/client/assets/{blockDiagram-DXYQGD6D-Ni-UtM9U.js → blockDiagram-DXYQGD6D-B5nX8SNN.js} +1 -1
  5. package/dist/client/assets/{c4Diagram-AHTNJAMY-BRGbLkKl.js → c4Diagram-AHTNJAMY-CgoOtJ8A.js} +1 -1
  6. package/dist/client/assets/channel-CoMASUlk.js +1 -0
  7. package/dist/client/assets/{chunk-2KRD3SAO-Bg9TL4pI.js → chunk-2KRD3SAO-CQtkUx0N.js} +1 -1
  8. package/dist/client/assets/{chunk-4BX2VUAB-B1Jo4ACq.js → chunk-4BX2VUAB-Bng5dyJg.js} +1 -1
  9. package/dist/client/assets/{chunk-4TB4RGXK-D1uSKsQk.js → chunk-4TB4RGXK-C_-1wb3q.js} +1 -1
  10. package/dist/client/assets/{chunk-55IACEB6-Isozlh3d.js → chunk-55IACEB6-BCcZeGEM.js} +1 -1
  11. package/dist/client/assets/{chunk-67CJDMHE-RkMdOmDg.js → chunk-67CJDMHE-BDVvaXJb.js} +1 -1
  12. package/dist/client/assets/{chunk-7N4EOEYR-CC1YthZ0.js → chunk-7N4EOEYR-8vUsLRKg.js} +1 -1
  13. package/dist/client/assets/{chunk-AA7GKIK3-DW1BUwzB.js → chunk-AA7GKIK3-BIxPLZHN.js} +1 -1
  14. package/dist/client/assets/{chunk-CIAEETIT-BztiXFX_.js → chunk-CIAEETIT-BRxfaKBe.js} +1 -1
  15. package/dist/client/assets/{chunk-EDXVE4YY-LvqpGf7R.js → chunk-EDXVE4YY-DeVp2ceg.js} +1 -1
  16. package/dist/client/assets/{chunk-FMBD7UC4-bHbbN2EH.js → chunk-FMBD7UC4-C_-o6F82.js} +1 -1
  17. package/dist/client/assets/{chunk-FOC6F5B3-BPe7a8B7.js → chunk-FOC6F5B3-BxCbOCy9.js} +1 -1
  18. package/dist/client/assets/{chunk-K5T4RW27-DXV4R6zX.js → chunk-K5T4RW27-CyIwCKRK.js} +1 -1
  19. package/dist/client/assets/{chunk-KGLVRYIC-CkvQkiyX.js → chunk-KGLVRYIC-Cvj0s9r5.js} +1 -1
  20. package/dist/client/assets/{chunk-LIHQZDEY-Bz5RHsud.js → chunk-LIHQZDEY-CqJaHms_.js} +1 -1
  21. package/dist/client/assets/{chunk-ORNJ4GCN-BXLJ-I9I.js → chunk-ORNJ4GCN-DyHoJOgm.js} +1 -1
  22. package/dist/client/assets/{chunk-OYMX7WX6-Bo-YaVq2.js → chunk-OYMX7WX6-BqJxbJiy.js} +1 -1
  23. package/dist/client/assets/chunk-QZHKN3VN-8AZg-jcM.js +1 -0
  24. package/dist/client/assets/{chunk-YZCP3GAM-CUjuqVjA.js → chunk-YZCP3GAM-DzGTdtcx.js} +1 -1
  25. package/dist/client/assets/classDiagram-6PBFFD2Q-CGH8dqTY.js +1 -0
  26. package/dist/client/assets/classDiagram-v2-HSJHXN6E-D3pU3FBM.js +1 -0
  27. package/dist/client/assets/clone-3uxLajDA.js +1 -0
  28. package/dist/client/assets/{cose-bilkent-S5V4N54A-DXGm3qlJ.js → cose-bilkent-S5V4N54A-DeGnTGlN.js} +1 -1
  29. package/dist/client/assets/{dagre-DLRHgKIB.js → dagre-Csg7jRrW.js} +1 -1
  30. package/dist/client/assets/{dagre-KV5264BT-DycDPLvk.js → dagre-KV5264BT-Cj7MMxfe.js} +1 -1
  31. package/dist/client/assets/{diagram-5BDNPKRD-BwHShOSK.js → diagram-5BDNPKRD-u7Q7eRkb.js} +1 -1
  32. package/dist/client/assets/{diagram-G4DWMVQ6-D26Y-K60.js → diagram-G4DWMVQ6--XWEw80E.js} +1 -1
  33. package/dist/client/assets/{diagram-MMDJMWI5-Aer2TE2o.js → diagram-MMDJMWI5-tWAGPBU1.js} +1 -1
  34. package/dist/client/assets/{diagram-TYMM5635-Cw5eaPxt.js → diagram-TYMM5635-BcdbggR5.js} +1 -1
  35. package/dist/client/assets/{erDiagram-SMLLAGMA-C0F2shsj.js → erDiagram-SMLLAGMA-C032vFav.js} +1 -1
  36. package/dist/client/assets/{flatten-259UzxGw.js → flatten-CbxQEokz.js} +1 -1
  37. package/dist/client/assets/{flowDiagram-DWJPFMVM-CojOtGGR.js → flowDiagram-DWJPFMVM-BVrEoz9w.js} +1 -1
  38. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-Ckrhb2jW.js → ganttDiagram-T4ZO3ILL-C-5won4J.js} +1 -1
  39. package/dist/client/assets/gitGraph-7Q5UKJZL-CgDWgtX6.js +1 -0
  40. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-DcMqSrzm.js → gitGraphDiagram-UUTBAWPF-UptxNUaS.js} +1 -1
  41. package/dist/client/assets/{graphlib-CP-xlbS-.js → graphlib-DAN6eVZg.js} +1 -1
  42. package/dist/client/assets/index-CsO6mGeN.js +576 -0
  43. package/dist/client/assets/index-H5VozHIA.css +1 -0
  44. package/dist/client/assets/info-OMHHGYJF-HU56ohFK.js +1 -0
  45. package/dist/client/assets/{infoDiagram-42DDH7IO-Bec012fF.js → infoDiagram-42DDH7IO-BBHIrMfH.js} +1 -1
  46. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-DCxCTNWg.js → ishikawaDiagram-UXIWVN3A-Dh5OKMNi.js} +1 -1
  47. package/dist/client/assets/{journeyDiagram-VCZTEJTY-BaNNdz_C.js → journeyDiagram-VCZTEJTY-B_BbvQNc.js} +1 -1
  48. package/dist/client/assets/{kanban-definition-6JOO6SKY-CF8ekLbq.js → kanban-definition-6JOO6SKY-DoHQ7qx-.js} +1 -1
  49. package/dist/client/assets/{linear--lYZPCym.js → linear-DnycKcgv.js} +1 -1
  50. package/dist/client/assets/{mermaid-parser.core-BiB98L-e.js → mermaid-parser.core-Qaz1NZbM.js} +2 -2
  51. package/dist/client/assets/{mindmap-definition-QFDTVHPH-BesPvEwN.js → mindmap-definition-QFDTVHPH-r10UBVF3.js} +1 -1
  52. package/dist/client/assets/packet-4T2RLAQJ-C45vViPI.js +1 -0
  53. package/dist/client/assets/pie-ZZUOXDRM-BgSJvdFN.js +1 -0
  54. package/dist/client/assets/{pieDiagram-DEJITSTG-CFOdV-Od.js → pieDiagram-DEJITSTG-BrV4ftE_.js} +1 -1
  55. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-BqkfwC_k.js → quadrantDiagram-34T5L4WZ-DeqodfnC.js} +1 -1
  56. package/dist/client/assets/radar-PYXPWWZC-B3gMqtzi.js +1 -0
  57. package/dist/client/assets/{reduce-Bv9KOHMM.js → reduce-DxjGlfDa.js} +1 -1
  58. package/dist/client/assets/{requirementDiagram-MS252O5E-DE2y_tGJ.js → requirementDiagram-MS252O5E-ChkdYRNA.js} +1 -1
  59. package/dist/client/assets/{sankeyDiagram-XADWPNL6-BlyRgjI6.js → sankeyDiagram-XADWPNL6-BAddewuC.js} +1 -1
  60. package/dist/client/assets/{sequenceDiagram-FGHM5R23-BvFb9l2D.js → sequenceDiagram-FGHM5R23-8COUmxfQ.js} +1 -1
  61. package/dist/client/assets/{stateDiagram-FHFEXIEX-CXoHchSk.js → stateDiagram-FHFEXIEX-_-4aujNp.js} +1 -1
  62. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-qtilh0zP.js +1 -0
  63. package/dist/client/assets/{timeline-definition-GMOUNBTQ-C98Wdp1r.js → timeline-definition-GMOUNBTQ-DJRm4qQU.js} +1 -1
  64. package/dist/client/assets/treeView-SZITEDCU-DH1-fppn.js +1 -0
  65. package/dist/client/assets/treemap-W4RFUUIX-C-GsccCC.js +1 -0
  66. package/dist/client/assets/{vennDiagram-DHZGUBPP-C31SdZnU.js → vennDiagram-DHZGUBPP-Bo9aJg-c.js} +1 -1
  67. package/dist/client/assets/wardley-RL74JXVD-Dzl1fb7W.js +1 -0
  68. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-BY9wpPZs.js → wardleyDiagram-NUSXRM2D-B4B1ob2l.js} +1 -1
  69. package/dist/client/assets/{xychartDiagram-5P7HB3ND-DMLeR5iW.js → xychartDiagram-5P7HB3ND-K6LS64rd.js} +1 -1
  70. package/dist/client/index.html +2 -2
  71. package/dist/server/api.js +155 -1
  72. package/package.json +1 -1
  73. package/dist/client/assets/architecture-YZFGNWBL-BTrOsuUM.js +0 -1
  74. package/dist/client/assets/channel-CSAMjJ-K.js +0 -1
  75. package/dist/client/assets/chunk-QZHKN3VN-CCSpvfnX.js +0 -1
  76. package/dist/client/assets/classDiagram-6PBFFD2Q-hHHRH44v.js +0 -1
  77. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DVELpVSz.js +0 -1
  78. package/dist/client/assets/clone-CnI8n-00.js +0 -1
  79. package/dist/client/assets/gitGraph-7Q5UKJZL-Cy9m9YL_.js +0 -1
  80. package/dist/client/assets/index-B3fIsvPY.js +0 -576
  81. package/dist/client/assets/index-BgJQzDzi.css +0 -1
  82. package/dist/client/assets/info-OMHHGYJF-Z2GUE1Ui.js +0 -1
  83. package/dist/client/assets/packet-4T2RLAQJ-Ca05trHp.js +0 -1
  84. package/dist/client/assets/pie-ZZUOXDRM-Ci9vQaCC.js +0 -1
  85. package/dist/client/assets/radar-PYXPWWZC-cGObd7Fe.js +0 -1
  86. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-BLHyyGW-.js +0 -1
  87. package/dist/client/assets/treeView-SZITEDCU-nhj6xl9u.js +0 -1
  88. package/dist/client/assets/treemap-W4RFUUIX-DlVm9AB2.js +0 -1
  89. package/dist/client/assets/wardley-RL74JXVD-B3ABBnYV.js +0 -1
@@ -0,0 +1,576 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-BAACGBI_.js","assets/chunk-Dlc7tRH4.js","assets/dagre-KV5264BT-Cj7MMxfe.js","assets/dagre-Csg7jRrW.js","assets/graphlib-DAN6eVZg.js","assets/identity-CQcu21F9.js","assets/reduce-DxjGlfDa.js","assets/flatten-CbxQEokz.js","assets/clone-3uxLajDA.js","assets/cose-bilkent-S5V4N54A-DeGnTGlN.js","assets/cytoscape.esm-DT0IEibP.js","assets/c4Diagram-AHTNJAMY-CgoOtJ8A.js","assets/chunk-YZCP3GAM-DzGTdtcx.js","assets/flowDiagram-DWJPFMVM-BVrEoz9w.js","assets/channel-CoMASUlk.js","assets/chunk-55IACEB6-BCcZeGEM.js","assets/chunk-EDXVE4YY-DeVp2ceg.js","assets/chunk-FMBD7UC4-C_-o6F82.js","assets/erDiagram-SMLLAGMA-C032vFav.js","assets/gitGraphDiagram-UUTBAWPF-UptxNUaS.js","assets/mermaid-parser.core-Qaz1NZbM.js","assets/chunk-K5T4RW27-CyIwCKRK.js","assets/chunk-2KRD3SAO-CQtkUx0N.js","assets/chunk-67CJDMHE-BDVvaXJb.js","assets/chunk-7N4EOEYR-8vUsLRKg.js","assets/chunk-AA7GKIK3-BIxPLZHN.js","assets/chunk-CIAEETIT-BRxfaKBe.js","assets/chunk-FOC6F5B3-BxCbOCy9.js","assets/chunk-KGLVRYIC-Cvj0s9r5.js","assets/chunk-LIHQZDEY-CqJaHms_.js","assets/chunk-ORNJ4GCN-DyHoJOgm.js","assets/chunk-4BX2VUAB-Bng5dyJg.js","assets/chunk-QZHKN3VN-8AZg-jcM.js","assets/ganttDiagram-T4ZO3ILL-C-5won4J.js","assets/linear-DnycKcgv.js","assets/defaultLocale-ClcAPJ5U.js","assets/init-TU6eJ00_.js","assets/infoDiagram-42DDH7IO-BBHIrMfH.js","assets/pieDiagram-DEJITSTG-BrV4ftE_.js","assets/path-yo4Xej8w.js","assets/ordinal-DCsgWfZW.js","assets/arc-DLkoKlDx.js","assets/array-C0548cPn.js","assets/quadrantDiagram-34T5L4WZ-DeqodfnC.js","assets/xychartDiagram-5P7HB3ND-K6LS64rd.js","assets/requirementDiagram-MS252O5E-ChkdYRNA.js","assets/sequenceDiagram-FGHM5R23-8COUmxfQ.js","assets/classDiagram-6PBFFD2Q-CGH8dqTY.js","assets/chunk-4TB4RGXK-C_-1wb3q.js","assets/classDiagram-v2-HSJHXN6E-D3pU3FBM.js","assets/stateDiagram-FHFEXIEX-_-4aujNp.js","assets/chunk-OYMX7WX6-BqJxbJiy.js","assets/stateDiagram-v2-QKLJ7IA2-qtilh0zP.js","assets/journeyDiagram-VCZTEJTY-B_BbvQNc.js","assets/timeline-definition-GMOUNBTQ-DJRm4qQU.js","assets/mindmap-definition-QFDTVHPH-r10UBVF3.js","assets/kanban-definition-6JOO6SKY-DoHQ7qx-.js","assets/sankeyDiagram-XADWPNL6-BAddewuC.js","assets/diagram-TYMM5635-BcdbggR5.js","assets/diagram-MMDJMWI5-tWAGPBU1.js","assets/blockDiagram-DXYQGD6D-B5nX8SNN.js","assets/diagram-5BDNPKRD-u7Q7eRkb.js","assets/architectureDiagram-Q4EWVU46-C6Mqm1k6.js","assets/ishikawaDiagram-UXIWVN3A-Dh5OKMNi.js","assets/rough.esm-DulVNktb.js","assets/vennDiagram-DHZGUBPP-Bo9aJg-c.js","assets/diagram-G4DWMVQ6--XWEw80E.js","assets/wardleyDiagram-NUSXRM2D-B4B1ob2l.js"])))=>i.map(i=>d[i]);
2
+ import{o as e,r as t,t as n}from"./chunk-Dlc7tRH4.js";import{n as r,t as i}from"./path-yo4Xej8w.js";import{t as a}from"./array-C0548cPn.js";import{C as o,E as s,O as c,S as l,T as u,_ as d,b as f,c as p,d as m,f as h,g,h as _,i as v,m as y,n as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as O}from"./identity-CQcu21F9.js";import{t as k}from"./rough.esm-DulVNktb.js";import{t as A}from"./katex-BAACGBI_.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ee=n((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=ee(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=ee(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M={current:null},ne={transition:null},N={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:ne,ReactCurrentOwner:C};function re(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,e.act=re,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=ne.transition;ne.transition={};try{e()}finally{ne.transition=t}},e.unstable_act=re,e.useCallback=function(e,t){return M.current.useCallback(e,t)},e.useContext=function(e){return M.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return M.current.useDeferredValue(e)},e.useEffect=function(e,t){return M.current.useEffect(e,t)},e.useId=function(){return M.current.useId()},e.useImperativeHandle=function(e,t,n){return M.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return M.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return M.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return M.current.useMemo(e,t)},e.useReducer=function(e,t,n){return M.current.useReducer(e,t,n)},e.useRef=function(e){return M.current.useRef(e)},e.useState=function(e){return M.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return M.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return M.current.useTransition()},e.version=`18.3.1`})),j=n(((e,t)=>{t.exports=ee()})),te=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,j(x);else{var t=n(l);t!==null&&te(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&te(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,ee=A.port2;A.port1.onmessage=O,k=function(){ee.postMessage(null)}}else k=function(){g(O,0)};function j(e){C=e,S||(S=!0,k())}function te(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,j(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,te(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,j(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),M=n(((e,t)=>{t.exports=te()})),ne=n((e=>{var t=j(),n=M();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,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(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[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(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),O=Symbol.for(`react.context`),k=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),N=Symbol.for(`react.offscreen`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Object.assign,oe;function se(e){if(oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||``}return`
3
+ `+oe+e}var ce=!1;function le(e,t){if(!e||ce)return``;ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
4
+ `),a=r.stack.split(`
5
+ `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
6
+ `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{ce=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?se(e):``}function P(e){switch(e.tag){case 5:return se(e.type);case 16:return se(`Lazy`);case 13:return se(`Suspense`);case 19:return se(`SuspenseList`);case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return``}}function ue(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case w:return`Fragment`;case C:return`Portal`;case E:return`Profiler`;case T:return`StrictMode`;case A:return`Suspense`;case ee:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case O:return(e.displayName||`Context`)+`.Consumer`;case D:return(e._context.displayName||`Context`)+`.Provider`;case k:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?ue(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function de(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ue(t);case 8:return t===T?`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 t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function fe(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function pe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function me(e){var t=pe(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function he(e){e._valueTracker||=me(e)}function ge(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=pe(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function _e(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function ve(e,t){var n=t.checked;return ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ye(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=fe(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function be(e,t){t=t.checked,t!=null&&b(e,`checked`,t,!1)}function xe(e,t){be(e,t);var n=fe(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Ce(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Ce(e,t.type,fe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Se(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Ce(e,t,n){(t!==`number`||_e(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var we=Array.isArray;function Te(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+fe(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ee(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return ae({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function De(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(we(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:fe(n)}}function Oe(e,t){var n=fe(t.value),r=fe(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function ke(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function Ae(e){switch(e){case`svg`:return`http://www.w3.org/2000/svg`;case`math`:return`http://www.w3.org/1998/Math/MathML`;default:return`http://www.w3.org/1999/xhtml`}}function je(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?Ae(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Me,Ne=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Me||=document.createElement(`div`),Me.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Me.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Pe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fe={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},Ie=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Fe).forEach(function(e){Ie.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fe[t]=Fe[e]})});function Le(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Fe.hasOwnProperty(e)&&Fe[e]?(``+t).trim():t+`px`}function Re(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Le(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var ze=ae({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 Be(e,t){if(t){if(ze[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Ve(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){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 He=null;function Ue(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var We=null,Ge=null,Ke=null;function qe(e){if(e=Wi(e)){if(typeof We!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ki(t),We(e.stateNode,e.type,t))}}function Je(e){Ge?Ke?Ke.push(e):Ke=[e]:Ge=e}function Ye(){if(Ge){var e=Ge,t=Ke;if(Ke=Ge=null,qe(e),t)for(e=0;e<t.length;e++)qe(t[e])}}function Xe(e,t){return e(t)}function Ze(){}var Qe=!1;function $e(e,t,n){if(Qe)return e(t,n);Qe=!0;try{return Xe(e,t,n)}finally{Qe=!1,(Ge!==null||Ke!==null)&&(Ze(),Ye())}}function et(e,t){var n=e.stateNode;if(n===null)return null;var i=Ki(n);if(i===null)return null;n=i[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(i=!i.disabled)||(e=e.type,i=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!i;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var tt=!1;if(c)try{var nt={};Object.defineProperty(nt,`passive`,{get:function(){tt=!0}}),window.addEventListener(`test`,nt,nt),window.removeEventListener(`test`,nt,nt)}catch{tt=!1}function rt(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var it=!1,at=null,ot=!1,st=null,ct={onError:function(e){it=!0,at=e}};function lt(e,t,n,r,i,a,o,s,c){it=!1,at=null,rt.apply(ct,arguments)}function ut(e,t,n,i,a,o,s,c,l){if(lt.apply(this,arguments),it){if(it){var u=at;it=!1,at=null}else throw Error(r(198));ot||(ot=!0,st=u)}}function dt(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ft(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function pt(e){if(dt(e)!==e)throw Error(r(188))}function mt(e){var t=e.alternate;if(!t){if(t=dt(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return pt(a),e;if(o===i)return pt(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function ht(e){return e=mt(e),e===null?null:gt(e)}function gt(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gt(e);if(t!==null)return t;e=e.sibling}return null}var _t=n.unstable_scheduleCallback,vt=n.unstable_cancelCallback,yt=n.unstable_shouldYield,bt=n.unstable_requestPaint,xt=n.unstable_now,St=n.unstable_getCurrentPriorityLevel,Ct=n.unstable_ImmediatePriority,wt=n.unstable_UserBlockingPriority,Tt=n.unstable_NormalPriority,Et=n.unstable_LowPriority,Dt=n.unstable_IdlePriority,Ot=null,kt=null;function At(e){if(kt&&typeof kt.onCommitFiberRoot==`function`)try{kt.onCommitFiberRoot(Ot,e,void 0,(e.current.flags&128)==128)}catch{}}var jt=Math.clz32?Math.clz32:Pt,Mt=Math.log,Nt=Math.LN2;function Pt(e){return e>>>=0,e===0?32:31-(Mt(e)/Nt|0)|0}var Ft=64,It=4194304;function Lt(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Lt(a))):r=Lt(s)}else o=n&~i,o===0?a!==0&&(r=Lt(a)):r=Lt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-jt(t),i=1<<n,r|=e[n],t&=~i;return r}function zt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Bt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-jt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=zt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Vt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Ht(){var e=Ft;return Ft<<=1,!(Ft&4194240)&&(Ft=64),e}function Ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Wt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function Gt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-jt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Kt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-jt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var qt=0;function Jt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Yt,Xt,Zt,Qt,$t,en=!1,tn=[],nn=null,rn=null,an=null,on=new Map,sn=new Map,cn=[],ln=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function un(e,t){switch(e){case`focusin`:case`focusout`:nn=null;break;case`dragenter`:case`dragleave`:rn=null;break;case`mouseover`:case`mouseout`:an=null;break;case`pointerover`:case`pointerout`:on.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:sn.delete(t.pointerId)}}function dn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Wi(t),t!==null&&Xt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function fn(e,t,n,r,i){switch(t){case`focusin`:return nn=dn(nn,e,t,n,r,i),!0;case`dragenter`:return rn=dn(rn,e,t,n,r,i),!0;case`mouseover`:return an=dn(an,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return on.set(a,dn(on.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,sn.set(a,dn(sn.get(a)||null,e,t,n,r,i)),!0}return!1}function pn(e){var t=Ui(e.target);if(t!==null){var n=dt(t);if(n!==null){if(t=n.tag,t===13){if(t=ft(n),t!==null){e.blockedOn=t,$t(e.priority,function(){Zt(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);He=r,n.target.dispatchEvent(r),He=null}else return t=Wi(n),t!==null&&Xt(t),e.blockedOn=n,!1;t.shift()}return!0}function hn(e,t,n){mn(e)&&n.delete(t)}function gn(){en=!1,nn!==null&&mn(nn)&&(nn=null),rn!==null&&mn(rn)&&(rn=null),an!==null&&mn(an)&&(an=null),on.forEach(hn),sn.forEach(hn)}function _n(e,t){e.blockedOn===t&&(e.blockedOn=null,en||(en=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,gn)))}function vn(e){function t(t){return _n(t,e)}if(0<tn.length){_n(tn[0],e);for(var n=1;n<tn.length;n++){var r=tn[n];r.blockedOn===e&&(r.blockedOn=null)}}for(nn!==null&&_n(nn,e),rn!==null&&_n(rn,e),an!==null&&_n(an,e),on.forEach(t),sn.forEach(t),n=0;n<cn.length;n++)r=cn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<cn.length&&(n=cn[0],n.blockedOn===null);)pn(n),n.blockedOn===null&&cn.shift()}var yn=x.ReactCurrentBatchConfig,bn=!0;function xn(e,t,n,r){var i=qt,a=yn.transition;yn.transition=null;try{qt=1,Cn(e,t,n,r)}finally{qt=i,yn.transition=a}}function Sn(e,t,n,r){var i=qt,a=yn.transition;yn.transition=null;try{qt=4,Cn(e,t,n,r)}finally{qt=i,yn.transition=a}}function Cn(e,t,n,r){if(bn){var i=Tn(e,t,n,r);if(i===null)hi(e,t,r,wn,n),un(e,r);else if(fn(i,e,t,n,r))r.stopPropagation();else if(un(e,r),t&4&&-1<ln.indexOf(e)){for(;i!==null;){var a=Wi(i);if(a!==null&&Yt(a),a=Tn(e,t,n,r),a===null&&hi(e,t,r,wn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else hi(e,t,r,null,n)}}var wn=null;function Tn(e,t,n,r){if(wn=null,e=Ue(r),e=Ui(e),e!==null)if(t=dt(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ft(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return wn=e,null}function En(e){switch(e){case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 1;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`toggle`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 4;case`message`:switch(St()){case Ct:return 1;case wt:return 4;case Tt:case Et:return 16;case Dt:return 536870912;default:return 16}default:return 16}}var Dn=null,On=null,kn=null;function F(){if(kn)return kn;var e,t=On,n=t.length,r,i=`value`in Dn?Dn.value:Dn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return kn=i.slice(e,1<r?1-r:void 0)}function An(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function jn(){return!0}function Mn(){return!1}function Nn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?jn:Mn,this.isPropagationStopped=Mn,this}return ae(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=jn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=jn)},persist:function(){},isPersistent:jn}),t}var Pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fn=Nn(Pn),In=ae({},Pn,{view:0,detail:0}),I=Nn(In),Ln,Rn,zn,Bn=ae({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Nn(Bn),Hn=Nn(ae({},Bn,{dataTransfer:0})),Un=Nn(ae({},In,{relatedTarget:0})),Wn=Nn(ae({},Pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Nn(ae({},Pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Nn(ae({},Pn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Nn(ae({},In,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=An(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?An(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?An(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Nn(ae({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Nn(ae({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),L=Nn(ae({},Pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),tr=Nn(ae({},Bn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),R=[9,13,27,32],nr=c&&`CompositionEvent`in window,rr=null;c&&`documentMode`in document&&(rr=document.documentMode);var ir=c&&`TextEvent`in window&&!rr,ar=c&&(!nr||rr&&8<rr&&11>=rr),or=` `,sr=!1;function cr(e,t){switch(e){case`keyup`:return R.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function lr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ur=!1;function dr(e,t){switch(e){case`compositionend`:return lr(t);case`keypress`:return t.which===32?(sr=!0,or):null;case`textInput`:return e=t.data,e===or&&sr?null:e;default:return null}}function fr(e,t){if(ur)return e===`compositionend`||!nr&&cr(e,t)?(e=F(),kn=On=Dn=null,ur=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return ar&&t.locale!==`ko`?null:t.data;default:return null}}var pr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!pr[e.type]:t===`textarea`}function hr(e,t,n,r){Je(r),t=_i(t,`onChange`),0<t.length&&(n=new Fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var gr=null,_r=null;function vr(e){li(e,0)}function yr(e){if(ge(Gi(e)))return e}function br(e,t){if(e===`change`)return t}var xr=!1;if(c){var Sr;if(c){var Cr=`oninput`in document;if(!Cr){var wr=document.createElement(`div`);wr.setAttribute(`oninput`,`return;`),Cr=typeof wr.oninput==`function`}Sr=Cr}else Sr=!1;xr=Sr&&(!document.documentMode||9<document.documentMode)}function Tr(){gr&&(gr.detachEvent(`onpropertychange`,Er),_r=gr=null)}function Er(e){if(e.propertyName===`value`&&yr(_r)){var t=[];hr(t,_r,e,Ue(e)),$e(vr,t)}}function Dr(e,t,n){e===`focusin`?(Tr(),gr=t,_r=n,gr.attachEvent(`onpropertychange`,Er)):e===`focusout`&&Tr()}function Or(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return yr(_r)}function kr(e,t){if(e===`click`)return yr(t)}function Ar(e,t){if(e===`input`||e===`change`)return yr(t)}function jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Mr=typeof Object.is==`function`?Object.is:jr;function Nr(e,t){if(Mr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!Mr(e[i],t[i]))return!1}return!0}function Pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fr(e,t){var n=Pr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Pr(n)}}function Ir(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ir(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lr(){for(var e=window,t=_e();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=_e(e.document)}return t}function Rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function zr(e){var t=Lr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ir(n.ownerDocument.documentElement,n)){if(r!==null&&Rr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Fr(n,a);var o=Fr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Br=c&&`documentMode`in document&&11>=document.documentMode,Vr=null,Hr=null,Ur=null,Wr=!1;function Gr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wr||Vr==null||Vr!==_e(r)||(r=Vr,`selectionStart`in r&&Rr(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}),Ur&&Nr(Ur,r)||(Ur=r,r=_i(Hr,`onSelect`),0<r.length&&(t=new Fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Vr)))}function Kr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var qr={animationend:Kr(`Animation`,`AnimationEnd`),animationiteration:Kr(`Animation`,`AnimationIteration`),animationstart:Kr(`Animation`,`AnimationStart`),transitionend:Kr(`Transition`,`TransitionEnd`)},Jr={},Yr={};c&&(Yr=document.createElement(`div`).style,`AnimationEvent`in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),`TransitionEvent`in window||delete qr.transitionend.transition);function Xr(e){if(Jr[e])return Jr[e];if(!qr[e])return e;var t=qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yr)return Jr[e]=t[n];return e}var Zr=Xr(`animationend`),Qr=Xr(`animationiteration`),$r=Xr(`animationstart`),ei=Xr(`transitionend`),ti=new Map,ni=`abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);function ri(e,t){ti.set(e,t),o(t,[e])}for(var ii=0;ii<ni.length;ii++){var ai=ni[ii];ri(ai.toLowerCase(),`on`+(ai[0].toUpperCase()+ai.slice(1)))}ri(Zr,`onAnimationEnd`),ri(Qr,`onAnimationIteration`),ri($r,`onAnimationStart`),ri(`dblclick`,`onDoubleClick`),ri(`focusin`,`onFocus`),ri(`focusout`,`onBlur`),ri(ei,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var oi=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),si=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(oi));function ci(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,ut(r,t,void 0,e),e.currentTarget=null}function li(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ci(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ci(i,s,l),a=c}}}if(ot)throw e=st,ot=!1,st=null,e}function ui(e,t){var n=t[Bi];n===void 0&&(n=t[Bi]=new Set);var r=e+`__bubble`;n.has(r)||(mi(t,e,2,!1),n.add(r))}function di(e,t,n){var r=0;t&&(r|=4),mi(n,e,r,t)}var fi=`_reactListening`+Math.random().toString(36).slice(2);function pi(e){if(!e[fi]){e[fi]=!0,i.forEach(function(t){t!==`selectionchange`&&(si.has(t)||di(t,!1,e),di(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fi]||(t[fi]=!0,di(`selectionchange`,!1,t))}}function mi(e,t,n,r){switch(En(t)){case 1:var i=xn;break;case 4:i=Sn;break;default:i=Cn}n=i.bind(null,t,n,e),i=void 0,!tt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function hi(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Ui(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}$e(function(){var r=a,i=Ue(n),o=[];a:{var s=ti.get(e);if(s!==void 0){var c=Fn,l=e;switch(e){case`keypress`:if(An(n)===0)break a;case`keydown`:case`keyup`:c=Qn;break;case`focusin`:l=`focus`,c=Un;break;case`focusout`:l=`blur`,c=Un;break;case`beforeblur`:case`afterblur`:c=Un;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=er;break;case Zr:case Qr:case $r:c=Wn;break;case ei:c=L;break;case`scroll`:c=I;break;case`wheel`:c=tr;break;case`copy`:case`cut`:case`paste`:c=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=$n}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=et(p,f),h!=null&&u.push(gi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==He&&(l=n.relatedTarget||n.fromElement)&&(Ui(l)||l[zi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ui(l):null,l!==null&&(d=dt(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Vn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=$n,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Gi(c),m=l==null?s:Gi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Ui(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=vi(m))p++;for(m=0,h=f;h;h=vi(h))m++;for(;0<p-m;)u=vi(u),p--;for(;0<m-p;)f=vi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=vi(u),f=vi(f)}u=null}else u=null;c!==null&&yi(o,s,c,u,!1),l!==null&&d!==null&&yi(o,d,l,u,!0)}}a:{if(s=r?Gi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=br;else if(mr(s))if(xr)g=Ar;else{g=Or;var _=Dr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=kr);if(g&&=g(e,r)){hr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&Ce(s,`number`,s.value)}switch(_=r?Gi(r):window,e){case`focusin`:(mr(_)||_.contentEditable===`true`)&&(Vr=_,Hr=r,Ur=null);break;case`focusout`:Ur=Hr=Vr=null;break;case`mousedown`:Wr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Wr=!1,Gr(o,n,i);break;case`selectionchange`:if(Br)break;case`keydown`:case`keyup`:Gr(o,n,i)}var v;if(nr)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else ur?cr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(ar&&n.locale!==`ko`&&(ur||y!==`onCompositionStart`?y===`onCompositionEnd`&&ur&&(v=F()):(Dn=i,On=`value`in Dn?Dn.value:Dn.textContent,ur=!0)),_=_i(r,y),0<_.length&&(y=new Kn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=lr(n),v!==null&&(y.data=v)))),(v=ir?dr(e,n):fr(e,n))&&(r=_i(r,`onBeforeInput`),0<r.length&&(i=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}li(o,t)})}function gi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _i(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=et(e,n),a!=null&&r.unshift(gi(e,a,i)),a=et(e,t),a!=null&&r.push(gi(e,a,i))),e=e.return}return r}function vi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yi(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=et(n,a),c!=null&&o.unshift(gi(n,c,s))):i||(c=et(n,a),c!=null&&o.push(gi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var bi=/\r\n?/g,xi=/\u0000|\uFFFD/g;function Si(e){return(typeof e==`string`?e:``+e).replace(bi,`
7
+ `).replace(xi,``)}function Ci(e,t,n){if(t=Si(t),Si(e)!==t&&n)throw Error(r(425))}function wi(){}var Ti=null,Ei=null;function Di(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Oi=typeof setTimeout==`function`?setTimeout:void 0,ki=typeof clearTimeout==`function`?clearTimeout:void 0,Ai=typeof Promise==`function`?Promise:void 0,ji=typeof queueMicrotask==`function`?queueMicrotask:Ai===void 0?Oi:function(e){return Ai.resolve(null).then(e).catch(Mi)};function Mi(e){setTimeout(function(){throw e})}function Ni(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),vn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);vn(t)}function Pi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`)break;if(t===`/$`)return null}}return e}function Fi(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`){if(t===0)return e;t--}else n===`/$`&&t++}e=e.previousSibling}return null}var Ii=Math.random().toString(36).slice(2),Li=`__reactFiber$`+Ii,Ri=`__reactProps$`+Ii,zi=`__reactContainer$`+Ii,Bi=`__reactEvents$`+Ii,Vi=`__reactListeners$`+Ii,Hi=`__reactHandles$`+Ii;function Ui(e){var t=e[Li];if(t)return t;for(var n=e.parentNode;n;){if(t=n[zi]||n[Li]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fi(e);e!==null;){if(n=e[Li])return n;e=Fi(e)}return t}e=n,n=e.parentNode}return null}function Wi(e){return e=e[Li]||e[zi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Gi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Ki(e){return e[Ri]||null}var qi=[],Ji=-1;function Yi(e){return{current:e}}function Xi(e){0>Ji||(e.current=qi[Ji],qi[Ji]=null,Ji--)}function Zi(e,t){Ji++,qi[Ji]=e.current,e.current=t}var Qi={},$i=Yi(Qi),ea=Yi(!1),ta=Qi;function na(e,t){var n=e.type.contextTypes;if(!n)return Qi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ra(e){return e=e.childContextTypes,e!=null}function ia(){Xi(ea),Xi($i)}function aa(e,t,n){if($i.current!==Qi)throw Error(r(168));Zi($i,t),Zi(ea,n)}function oa(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,de(e)||`Unknown`,a));return ae({},n,i)}function sa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qi,ta=$i.current,Zi($i,e),Zi(ea,ea.current),!0}function ca(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=oa(e,t,ta),i.__reactInternalMemoizedMergedChildContext=e,Xi(ea),Xi($i),Zi($i,e)):Xi(ea),Zi(ea,n)}var la=null,ua=!1,da=!1;function fa(e){la===null?la=[e]:la.push(e)}function pa(e){ua=!0,fa(e)}function ma(){if(!da&&la!==null){da=!0;var e=0,t=qt;try{var n=la;for(qt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}la=null,ua=!1}catch(t){throw la!==null&&(la=la.slice(e+1)),_t(Ct,ma),t}finally{qt=t,da=!1}}return null}var ha=[],ga=0,_a=null,va=0,ya=[],ba=0,xa=null,Sa=1,Ca=``;function wa(e,t){ha[ga++]=va,ha[ga++]=_a,_a=e,va=t}function Ta(e,t,n){ya[ba++]=Sa,ya[ba++]=Ca,ya[ba++]=xa,xa=e;var r=Sa;e=Ca;var i=32-jt(r)-1;r&=~(1<<i),n+=1;var a=32-jt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Sa=1<<32-jt(t)+i|n<<i|r,Ca=a+e}else Sa=1<<a|n<<i|r,Ca=e}function Ea(e){e.return!==null&&(wa(e,1),Ta(e,1,0))}function Da(e){for(;e===_a;)_a=ha[--ga],ha[ga]=null,va=ha[--ga],ha[ga]=null;for(;e===xa;)xa=ya[--ba],ya[ba]=null,Ca=ya[--ba],ya[ba]=null,Sa=ya[--ba],ya[ba]=null}var Oa=null,ka=null,Aa=!1,ja=null;function Ma(e,t){var n=au(5,null,null,0);n.elementType=`DELETED`,n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Na(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t===null?!1:(e.stateNode=t,Oa=e,ka=Pi(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,Oa=e,ka=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=xa===null?null:{id:Sa,overflow:Ca},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=au(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Oa=e,ka=null,!0);default:return!1}}function Pa(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Fa(e){if(Aa){var t=ka;if(t){var n=t;if(!Na(e,t)){if(Pa(e))throw Error(r(418));t=Pi(n.nextSibling);var i=Oa;t&&Na(e,t)?Ma(i,n):(e.flags=e.flags&-4097|2,Aa=!1,Oa=e)}}else{if(Pa(e))throw Error(r(418));e.flags=e.flags&-4097|2,Aa=!1,Oa=e}}}function Ia(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Oa=e}function La(e){if(e!==Oa)return!1;if(!Aa)return Ia(e),Aa=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Di(e.type,e.memoizedProps)),t&&=ka){if(Pa(e))throw Ra(),Error(r(418));for(;t;)Ma(e,t),t=Pi(t.nextSibling)}if(Ia(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){ka=Pi(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}ka=null}}else ka=Oa?Pi(e.stateNode.nextSibling):null;return!0}function Ra(){for(var e=ka;e;)e=Pi(e.nextSibling)}function za(){ka=Oa=null,Aa=!1}function Ba(e){ja===null?ja=[e]:ja.push(e)}var Va=x.ReactCurrentBatchConfig;function Ha(e,t,n){if(e=n.ref,e!==null&&typeof e!=`function`&&typeof e!=`object`){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Ua(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Wa(e){var t=e._init;return t(e._payload)}function Ga(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=cu(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=fu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===w?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&Wa(i)===t.type)?(r=a(t,n.props),r.ref=Ha(e,t,n),r.return=e,r):(r=lu(n.type,n.key,n.props,null,e.mode,r),r.ref=Ha(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=uu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=fu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case S:return n=lu(t.type,t.key,t.props,null,e.mode,n),n.ref=Ha(e,null,t),n.return=e,n;case C:return t=pu(t,e.mode,n),t.return=e,t;case ne:var r=t._init;return f(e,r(t._payload),n)}if(we(t)||ie(t))return t=uu(t,e.mode,n,null),t.return=e,t;Ua(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case S:return n.key===i?l(e,t,n,r):null;case C:return n.key===i?u(e,t,n,r):null;case ne:return i=n._init,p(e,t,i(n._payload),r)}if(we(n)||ie(n))return i===null?d(e,t,n,r,null):null;Ua(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case S:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case C:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:var a=r._init;return m(e,t,n,a(r._payload),i)}if(we(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);Ua(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Aa&&wa(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Aa&&wa(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Aa&&wa(r,h),l}function g(a,s,c,l){var u=ie(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Aa&&wa(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Aa&&wa(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Aa&&wa(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===w&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case S:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===w){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===ne&&Wa(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ha(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===w?(r=uu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=lu(i.type,i.key,i.props,null,e.mode,o),o.ref=Ha(e,r,i),o.return=e,e=o)}return s(e);case C:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=pu(i,e.mode,o),r.return=e,e=r}return s(e);case ne:return l=i._init,_(e,r,l(i._payload),o)}if(we(i))return h(e,r,i,o);if(ie(i))return g(e,r,i,o);Ua(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=fu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ka=Ga(!0),qa=Ga(!1),Ja=Yi(null),Ya=null,Xa=null,Za=null;function Qa(){Za=Xa=Ya=null}function $a(e){var t=Ja.current;Xi(Ja),e._currentValue=t}function eo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function to(e,t){Ya=e,Za=Xa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Ks=!0),e.firstContext=null)}function no(e){var t=e._currentValue;if(Za!==e)if(e={context:e,memoizedValue:t,next:null},Xa===null){if(Ya===null)throw Error(r(308));Xa=e,Ya.dependencies={lanes:0,firstContext:e}}else Xa=Xa.next=e;return t}var ro=null;function io(e){ro===null?ro=[e]:ro.push(e)}function ao(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,io(t)):(n.next=i.next,i.next=n),t.interleaved=n,oo(e,r)}function oo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var so=!1;function co(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function uo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$c&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,oo(e,n)}return i=r.interleaved,i===null?(t.next=t,io(r)):(t.next=i.next,i.next=t),r.interleaved=t,oo(e,n)}function po(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kt(e,n)}}function mo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ho(e,t,n,r){var i=e.updateQueue;so=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=ae({},d,f);break a;case 2:so=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);sl|=o,e.lanes=o,e.memoizedState=d}}function go(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var _o={},vo=Yi(_o),yo=Yi(_o),bo=Yi(_o);function xo(e){if(e===_o)throw Error(r(174));return e}function So(e,t){switch(Zi(bo,t),Zi(yo,e),Zi(vo,_o),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:je(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=je(t,e)}Xi(vo),Zi(vo,t)}function Co(){Xi(vo),Xi(yo),Xi(bo)}function wo(e){xo(bo.current);var t=xo(vo.current),n=je(t,e.type);t!==n&&(Zi(yo,e),Zi(vo,n))}function To(e){yo.current===e&&(Xi(vo),Xi(yo))}var Eo=Yi(0);function Do(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Oo=[];function ko(){for(var e=0;e<Oo.length;e++)Oo[e]._workInProgressVersionPrimary=null;Oo.length=0}var Ao=x.ReactCurrentDispatcher,jo=x.ReactCurrentBatchConfig,Mo=0,No=null,Po=null,Fo=null,Io=!1,Lo=!1,Ro=0,zo=0;function Bo(){throw Error(r(321))}function Vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mr(e[n],t[n]))return!1;return!0}function Ho(e,t,n,i,a,o){if(Mo=o,No=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ao.current=e===null||e.memoizedState===null?Es:Ds,e=n(i,a),Lo){o=0;do{if(Lo=!1,Ro=0,25<=o)throw Error(r(301));o+=1,Fo=Po=null,t.updateQueue=null,Ao.current=Os,e=n(i,a)}while(Lo)}if(Ao.current=Ts,t=Po!==null&&Po.next!==null,Mo=0,Fo=Po=No=null,Io=!1,t)throw Error(r(300));return e}function Uo(){var e=Ro!==0;return Ro=0,e}function Wo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e,Fo}function Go(){if(Po===null){var e=No.alternate;e=e===null?null:e.memoizedState}else e=Po.next;var t=Fo===null?No.memoizedState:Fo.next;if(t!==null)Fo=t,Po=e;else{if(e===null)throw Error(r(310));Po=e,e={memoizedState:Po.memoizedState,baseState:Po.baseState,baseQueue:Po.baseQueue,queue:Po.queue,next:null},Fo===null?No.memoizedState=Fo=e:Fo=Fo.next=e}return Fo}function Ko(e,t){return typeof t==`function`?t(e):t}function qo(e){var t=Go(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=Po,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Mo&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,No.lanes|=d,sl|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,Mr(i,t.memoizedState)||(Ks=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,No.lanes|=o,sl|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Jo(e){var t=Go(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Mr(o,t.memoizedState)||(Ks=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Yo(){}function Xo(e,t){var n=No,i=Go(),a=t(),o=!Mr(i.memoizedState,a);if(o&&(i.memoizedState=a,Ks=!0),i=i.queue,ls($o.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||Fo!==null&&Fo.memoizedState.tag&1){if(n.flags|=2048,rs(9,Qo.bind(null,n,i,a,t),void 0,null),el===null)throw Error(r(349));Mo&30||Zo(n,t,a)}return a}function Zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=No.updateQueue,t===null?(t={lastEffect:null,stores:null},No.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Qo(e,t,n,r){t.value=n,t.getSnapshot=r,es(t)&&ts(e)}function $o(e,t,n){return n(function(){es(t)&&ts(e)})}function es(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mr(e,n)}catch{return!0}}function ts(e){var t=oo(e,1);t!==null&&Dl(t,e,1,-1)}function ns(e){var t=Wo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:e},t.queue=e,e=e.dispatch=xs.bind(null,No,e),[t.memoizedState,e]}function rs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=No.updateQueue,t===null?(t={lastEffect:null,stores:null},No.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function is(){return Go().memoizedState}function as(e,t,n,r){var i=Wo();No.flags|=e,i.memoizedState=rs(1|t,n,void 0,r===void 0?null:r)}function ss(e,t,n,r){var i=Go();r=r===void 0?null:r;var a=void 0;if(Po!==null){var o=Po.memoizedState;if(a=o.destroy,r!==null&&Vo(r,o.deps)){i.memoizedState=rs(t,n,a,r);return}}No.flags|=e,i.memoizedState=rs(1|t,n,a,r)}function cs(e,t){return as(8390656,8,e,t)}function ls(e,t){return ss(2048,8,e,t)}function us(e,t){return ss(4,2,e,t)}function ds(e,t){return ss(4,4,e,t)}function fs(e,t){if(typeof t==`function`)return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){return n=n==null?null:n.concat([e]),ss(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Go();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Go();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Vo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function _s(e,t,n){return Mo&21?(Mr(n,t)||(n=Ht(),No.lanes|=n,sl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ks=!0),e.memoizedState=n)}function vs(e,t){var n=qt;qt=n!==0&&4>n?n:4,e(!0);var r=jo.transition;jo.transition={};try{e(!1),t()}finally{qt=n,jo.transition=r}}function ys(){return Go().memoizedState}function bs(e,t,n){var r=El(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ss(e))Cs(t,n);else if(n=ao(e,t,n,r),n!==null){var i=Tl();Dl(n,e,r,i),ws(n,t,r)}}function xs(e,t,n){var r=El(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ss(e))Cs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Mr(s,o)){var c=t.interleaved;c===null?(i.next=i,io(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=ao(e,t,i,r),n!==null&&(i=Tl(),Dl(n,e,r,i),ws(n,t,r))}}function Ss(e){var t=e.alternate;return e===No||t!==null&&t===No}function Cs(e,t){Lo=Io=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ws(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kt(e,n)}}var Ts={readContext:no,useCallback:Bo,useContext:Bo,useEffect:Bo,useImperativeHandle:Bo,useInsertionEffect:Bo,useLayoutEffect:Bo,useMemo:Bo,useReducer:Bo,useRef:Bo,useState:Bo,useDebugValue:Bo,useDeferredValue:Bo,useTransition:Bo,useMutableSource:Bo,useSyncExternalStore:Bo,useId:Bo,unstable_isNewReconciler:!1},Es={readContext:no,useCallback:function(e,t){return Wo().memoizedState=[e,t===void 0?null:t],e},useContext:no,useEffect:cs,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),as(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){return as(4,2,e,t)},useMemo:function(e,t){var n=Wo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=bs.bind(null,No,e),[r.memoizedState,e]},useRef:function(e){var t=Wo();return e={current:e},t.memoizedState=e},useState:ns,useDebugValue:ms,useDeferredValue:function(e){return Wo().memoizedState=e},useTransition:function(){var e=ns(!1),t=e[0];return e=vs.bind(null,e[1]),Wo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=No,a=Wo();if(Aa){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),el===null)throw Error(r(349));Mo&30||Zo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,cs($o.bind(null,i,o,e),[e]),i.flags|=2048,rs(9,Qo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Wo(),t=el.identifierPrefix;if(Aa){var n=Ca,r=Sa;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Ro++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=zo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},Ds={readContext:no,useCallback:hs,useContext:no,useEffect:ls,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:qo,useRef:is,useState:function(){return qo(Ko)},useDebugValue:ms,useDeferredValue:function(e){return _s(Go(),Po.memoizedState,e)},useTransition:function(){return[qo(Ko)[0],Go().memoizedState]},useMutableSource:Yo,useSyncExternalStore:Xo,useId:ys,unstable_isNewReconciler:!1},Os={readContext:no,useCallback:hs,useContext:no,useEffect:ls,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Jo,useRef:is,useState:function(){return Jo(Ko)},useDebugValue:ms,useDeferredValue:function(e){var t=Go();return Po===null?t.memoizedState=e:_s(t,Po.memoizedState,e)},useTransition:function(){return[Jo(Ko)[0],Go().memoizedState]},useMutableSource:Yo,useSyncExternalStore:Xo,useId:ys,unstable_isNewReconciler:!1};function ks(e,t){if(e&&e.defaultProps){for(var n in t=ae({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function As(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ae({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var js={isMounted:function(e){return(e=e._reactInternals)?dt(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tl(),i=El(e),a=uo(r,i);a.payload=t,n!=null&&(a.callback=n),t=fo(e,a,i),t!==null&&(Dl(t,e,i,r),po(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tl(),i=El(e),a=uo(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=fo(e,a,i),t!==null&&(Dl(t,e,i,r),po(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tl(),r=El(e),i=uo(n,r);i.tag=2,t!=null&&(i.callback=t),t=fo(e,i,r),t!==null&&(Dl(t,e,r,n),po(t,e,r))}};function Ms(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Nr(n,r)||!Nr(i,a):!0}function Ns(e,t,n){var r=!1,i=Qi,a=t.contextType;return typeof a==`object`&&a?a=no(a):(i=ra(t)?ta:$i.current,r=t.contextTypes,a=(r=r!=null)?na(e,i):Qi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=js,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Ps(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&js.enqueueReplaceState(t,t.state,null)}function Fs(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},co(e);var a=t.contextType;typeof a==`object`&&a?i.context=no(a):(a=ra(t)?ta:$i.current,i.context=na(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(As(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&js.enqueueReplaceState(i,i.state,null),ho(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Is(e,t){try{var n=``,r=t;do n+=P(r),r=r.return;while(r);var i=n}catch(e){i=`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ls(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Rs(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var zs=typeof WeakMap==`function`?WeakMap:Map;function Bs(e,t,n){n=uo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hl||(hl=!0,gl=r),Rs(e,t)},n}function Vs(e,t,n){n=uo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Rs(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Rs(e,t),typeof r!=`function`&&(_l===null?_l=new Set([this]):_l.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Hs(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zs;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Ql.bind(null,e,t,n),t.then(e,e))}function Us(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ws(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=uo(-1,1),t.tag=2,fo(n,t,1))),n.lanes|=1),e)}var Gs=x.ReactCurrentOwner,Ks=!1;function qs(e,t,n,r){t.child=e===null?qa(t,null,n,r):Ka(t,e.child,n,r)}function Js(e,t,n,r,i){n=n.render;var a=t.ref;return to(t,i),r=Ho(e,t,n,r,a,i),n=Uo(),e!==null&&!Ks?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,mc(e,t,i)):(Aa&&n&&Ea(t),t.flags|=1,qs(e,t,r,i),t.child)}function Ys(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ou(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Xs(e,t,a,r,i)):(e=lu(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Nr:n,n(o,r)&&e.ref===t.ref)return mc(e,t,i)}return t.flags|=1,e=cu(a,r),e.ref=t.ref,e.return=t,t.child=e}function Xs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Nr(a,r)&&e.ref===t.ref)if(Ks=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Ks=!0);else return t.lanes=e.lanes,mc(e,t,i)}return $s(e,t,n,r,i)}function Zs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zi(il,rl),rl|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Zi(il,rl),rl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Zi(il,rl),rl|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Zi(il,rl),rl|=r;return qs(e,t,i,n),t.child}function Qs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $s(e,t,n,r,i){var a=ra(n)?ta:$i.current;return a=na(t,a),to(t,i),n=Ho(e,t,n,r,a,i),r=Uo(),e!==null&&!Ks?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,mc(e,t,i)):(Aa&&r&&Ea(t),t.flags|=1,qs(e,t,n,i),t.child)}function ec(e,t,n,r,i){if(ra(n)){var a=!0;sa(t)}else a=!1;if(to(t,i),t.stateNode===null)pc(e,t),Ns(t,n,r),Fs(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=no(l):(l=ra(n)?ta:$i.current,l=na(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Ps(t,o,r,l),so=!1;var f=t.memoizedState;o.state=f,ho(t,r,o,i),c=t.memoizedState,s!==r||f!==c||ea.current||so?(typeof u==`function`&&(As(t,n,u,r),c=t.memoizedState),(s=so||Ms(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,lo(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:ks(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=no(c):(c=ra(n)?ta:$i.current,c=na(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Ps(t,o,r,c),so=!1,f=t.memoizedState,o.state=f,ho(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||ea.current||so?(typeof p==`function`&&(As(t,n,p,r),m=t.memoizedState),(l=so||Ms(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return tc(e,t,n,r,a,i)}function tc(e,t,n,r,i,a){Qs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&ca(t,n,!1),mc(e,t,a);r=t.stateNode,Gs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ka(t,e.child,null,a),t.child=Ka(t,null,s,a)):qs(e,t,s,a),t.memoizedState=r.state,i&&ca(t,n,!0),t.child}function nc(e){var t=e.stateNode;t.pendingContext?aa(e,t.pendingContext,t.pendingContext!==t.context):t.context&&aa(e,t.context,!1),So(e,t.containerInfo)}function rc(e,t,n,r,i){return za(),Ba(i),t.flags|=256,qs(e,t,n,r),t.child}var ic={dehydrated:null,treeContext:null,retryLane:0};function ac(e){return{baseLanes:e,cachePool:null,transitions:null}}function oc(e,t,n){var r=t.pendingProps,i=Eo.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Zi(Eo,i&1),e===null)return Fa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=du(o,r,0,null),e=uu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ac(n),t.memoizedState=ic,e):sc(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return lc(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=cu(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=uu(a,o,n,null),a.flags|=2):a=cu(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?ac(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=ic,r}return a=e.child,e=a.sibling,r=cu(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function sc(e,t){return t=du({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function cc(e,t,n,r){return r!==null&&Ba(r),Ka(t,e.child,null,n),e=sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lc(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Ls(Error(r(422))),cc(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=du({mode:`visible`,children:i.children},a,0,null),o=uu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Ka(t,e.child,null,s),t.child.memoizedState=ac(s),t.memoizedState=ic,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return cc(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Ls(o,i,void 0),cc(e,t,s,i)}if(c=(s&e.childLanes)!==0,Ks||c){if(i=el,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,oo(e,a),Dl(i,e,a,-1))}return Vl(),i=Ls(Error(r(421))),cc(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=eu.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,ka=Pi(a.nextSibling),Oa=t,Aa=!0,ja=null,e!==null&&(ya[ba++]=Sa,ya[ba++]=Ca,ya[ba++]=xa,Sa=e.id,Ca=e.overflow,xa=t),t=sc(t,i.children),t.flags|=4096,t)}function uc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),eo(e.return,t,n)}function dc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function fc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(qs(e,t,r.children,n),r=Eo.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uc(e,n,t);else if(e.tag===19)uc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Zi(Eo,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Do(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),dc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Do(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}dc(t,!0,n,null,a);break;case`together`:dc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function pc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sl|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=cu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hc(e,t,n){switch(t.tag){case 3:nc(t),za();break;case 5:wo(t);break;case 1:ra(t.type)&&sa(t);break;case 4:So(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Zi(Ja,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Zi(Eo,Eo.current&1),e=mc(e,t,n),e===null?null:e.sibling):oc(e,t,n):(Zi(Eo,Eo.current&1),t.flags|=128,null);Zi(Eo,Eo.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return fc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Zi(Eo,Eo.current),r)break;return null;case 22:case 23:return t.lanes=0,Zs(e,t,n)}return mc(e,t,n)}var gc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},z=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,xo(vo.current);var o=null;switch(n){case`input`:i=ve(e,i),r=ve(e,r),o=[];break;case`select`:i=ae({},i,{value:void 0}),r=ae({},r,{value:void 0}),o=[];break;case`textarea`:i=Ee(e,i),r=Ee(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=wi)}Be(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ui(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},_c=function(e,t,n,r){n!==r&&(t.flags|=4)};function vc(e,t){if(!Aa)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function yc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bc(e,t,n){var i=t.pendingProps;switch(Da(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yc(t),null;case 1:return ra(t.type)&&ia(),yc(t),null;case 3:return i=t.stateNode,Co(),Xi(ea),Xi($i),ko(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(La(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ja!==null&&(jl(ja),ja=null))),yc(t),null;case 5:To(t);var o=xo(bo.current);if(n=t.type,e!==null&&t.stateNode!=null)z(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return yc(t),null}if(e=xo(vo.current),La(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Li]=t,i[Ri]=s,e=(t.mode&1)!=0,n){case`dialog`:ui(`cancel`,i),ui(`close`,i);break;case`iframe`:case`object`:case`embed`:ui(`load`,i);break;case`video`:case`audio`:for(o=0;o<oi.length;o++)ui(oi[o],i);break;case`source`:ui(`error`,i);break;case`img`:case`image`:case`link`:ui(`error`,i),ui(`load`,i);break;case`details`:ui(`toggle`,i);break;case`input`:ye(i,s),ui(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},ui(`invalid`,i);break;case`textarea`:De(i,s),ui(`invalid`,i)}for(var c in Be(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&Ci(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&Ci(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ui(`scroll`,i)}switch(n){case`input`:he(i),Se(i,s,!0);break;case`textarea`:he(i),ke(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=wi)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=Ae(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Li]=t,e[Ri]=i,gc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ve(n,i),n){case`dialog`:ui(`cancel`,e),ui(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:ui(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<oi.length;o++)ui(oi[o],e);o=i;break;case`source`:ui(`error`,e),o=i;break;case`img`:case`image`:case`link`:ui(`error`,e),ui(`load`,e),o=i;break;case`details`:ui(`toggle`,e),o=i;break;case`input`:ye(e,i),o=ve(e,i),ui(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=ae({},i,{value:void 0}),ui(`invalid`,e);break;case`textarea`:De(e,i),o=Ee(e,i),ui(`invalid`,e);break;default:o=i}for(s in Be(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Re(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Ne(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Pe(e,u):typeof u==`number`&&Pe(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&ui(`scroll`,e):u!=null&&b(e,s,u,c))}switch(n){case`input`:he(e),Se(e,i,!1);break;case`textarea`:he(e),ke(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+fe(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&Te(e,!!i.multiple,i.defaultValue,!0):Te(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=wi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return yc(t),null;case 6:if(e&&t.stateNode!=null)_c(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=xo(bo.current),xo(vo.current),La(t)){if(i=t.stateNode,n=t.memoizedProps,i[Li]=t,(s=i.nodeValue!==n)&&(e=Oa,e!==null))switch(e.tag){case 3:Ci(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Ci(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Li]=t,t.stateNode=i}return yc(t),null;case 13:if(Xi(Eo),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Aa&&ka!==null&&t.mode&1&&!(t.flags&128))Ra(),za(),t.flags|=98560,s=!1;else if(s=La(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[Li]=t}else za(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yc(t),s=!1}else ja!==null&&(jl(ja),ja=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||Eo.current&1?al===0&&(al=3):Vl())),t.updateQueue!==null&&(t.flags|=4),yc(t),null);case 4:return Co(),e===null&&pi(t.stateNode.containerInfo),yc(t),null;case 10:return $a(t.type._context),yc(t),null;case 17:return ra(t.type)&&ia(),yc(t),null;case 19:if(Xi(Eo),s=t.memoizedState,s===null)return yc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)vc(s,!1);else{if(al!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Do(e),c!==null){for(t.flags|=128,vc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Zi(Eo,Eo.current&1|2),t.child}e=e.sibling}s.tail!==null&&xt()>pl&&(t.flags|=128,i=!0,vc(s,!1),t.lanes=4194304)}else{if(!i)if(e=Do(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),vc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Aa)return yc(t),null}else 2*xt()-s.renderingStartTime>pl&&n!==1073741824&&(t.flags|=128,i=!0,vc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(yc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=xt(),t.sibling=null,n=Eo.current,Zi(Eo,i?n&1|2:n&1),t);case 22:case 23:return Ll(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?rl&1073741824&&(yc(t),t.subtreeFlags&6&&(t.flags|=8192)):yc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function xc(e,t){switch(Da(t),t.tag){case 1:return ra(t.type)&&ia(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Co(),Xi(ea),Xi($i),ko(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return To(t),null;case 13:if(Xi(Eo),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Xi(Eo),null;case 4:return Co(),null;case 10:return $a(t.type._context),null;case 22:case 23:return Ll(),null;case 24:return null;default:return null}}var B=!1,Sc=!1,Cc=typeof WeakSet==`function`?WeakSet:Set,V=null;function wc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Zl(e,t,n)}else n.current=null}function Tc(e,t,n){try{n()}catch(n){Zl(e,t,n)}}var Ec=!1;function Dc(e,t){if(Ti=bn,e=Lr(),Rr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ei={focusedElem:e,selectionRange:n},bn=!1,V=t;V!==null;)if(t=V,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,V=e;else for(;V!==null;){t=V;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ks(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Zl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,V=e;break}V=t.return}return h=Ec,Ec=!1,h}function Oc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Tc(t,n,a)}i=i.next}while(i!==r)}}function kc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ac(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function jc(e){var t=e.alternate;t!==null&&(e.alternate=null,jc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Li],delete t[Ri],delete t[Bi],delete t[Vi],delete t[Hi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Mc(e){return e.tag===5||e.tag===3||e.tag===4}function Nc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Mc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=wi));else if(r!==4&&(e=e.child,e!==null))for(Pc(e,t,n),e=e.sibling;e!==null;)Pc(e,t,n),e=e.sibling}function Fc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fc(e,t,n),e=e.sibling;e!==null;)Fc(e,t,n),e=e.sibling}var Ic=null,Lc=!1;function Rc(e,t,n){for(n=n.child;n!==null;)zc(e,t,n),n=n.sibling}function zc(e,t,n){if(kt&&typeof kt.onCommitFiberUnmount==`function`)try{kt.onCommitFiberUnmount(Ot,n)}catch{}switch(n.tag){case 5:Sc||wc(n,t);case 6:var r=Ic,i=Lc;Ic=null,Rc(e,t,n),Ic=r,Lc=i,Ic!==null&&(Lc?(e=Ic,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ic.removeChild(n.stateNode));break;case 18:Ic!==null&&(Lc?(e=Ic,n=n.stateNode,e.nodeType===8?Ni(e.parentNode,n):e.nodeType===1&&Ni(e,n),vn(e)):Ni(Ic,n.stateNode));break;case 4:r=Ic,i=Lc,Ic=n.stateNode.containerInfo,Lc=!0,Rc(e,t,n),Ic=r,Lc=i;break;case 0:case 11:case 14:case 15:if(!Sc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Tc(n,t,o),i=i.next}while(i!==r)}Rc(e,t,n);break;case 1:if(!Sc&&(wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Zl(n,t,e)}Rc(e,t,n);break;case 21:Rc(e,t,n);break;case 22:n.mode&1?(Sc=(r=Sc)||n.memoizedState!==null,Rc(e,t,n),Sc=r):Rc(e,t,n);break;default:Rc(e,t,n)}}function Bc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Cc),t.forEach(function(t){var r=tu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Vc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Ic=c.stateNode,Lc=!1;break a;case 3:Ic=c.stateNode.containerInfo,Lc=!0;break a;case 4:Ic=c.stateNode.containerInfo,Lc=!0;break a}c=c.return}if(Ic===null)throw Error(r(160));zc(o,s,a),Ic=null,Lc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Zl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Hc(t,e),t=t.sibling}function Hc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Vc(t,e),Uc(e),i&4){try{Oc(3,e,e.return),kc(3,e)}catch(t){Zl(e,e.return,t)}try{Oc(5,e,e.return)}catch(t){Zl(e,e.return,t)}}break;case 1:Vc(t,e),Uc(e),i&512&&n!==null&&wc(n,n.return);break;case 5:if(Vc(t,e),Uc(e),i&512&&n!==null&&wc(n,n.return),e.flags&32){var a=e.stateNode;try{Pe(a,``)}catch(t){Zl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&be(a,o),Ve(c,s);var u=Ve(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Re(a,f):d===`dangerouslySetInnerHTML`?Ne(a,f):d===`children`?Pe(a,f):b(a,d,f,u)}switch(c){case`input`:xe(a,o);break;case`textarea`:Oe(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?Te(a,!!o.multiple,o.multiple?[]:``,!1):Te(a,!!o.multiple,o.defaultValue,!0)):Te(a,!!o.multiple,m,!1)}a[Ri]=o}catch(t){Zl(e,e.return,t)}}break;case 6:if(Vc(t,e),Uc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Zl(e,e.return,t)}}break;case 3:if(Vc(t,e),Uc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{vn(t.containerInfo)}catch(t){Zl(e,e.return,t)}break;case 4:Vc(t,e),Uc(e);break;case 13:Vc(t,e),Uc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(fl=xt())),i&4&&Bc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Sc=(u=Sc)||d,Vc(t,e),Sc=u):Vc(t,e),Uc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(V=e,d=e.child;d!==null;){for(f=V=d;V!==null;){switch(p=V,m=p.child,p.tag){case 0:case 11:case 14:case 15:Oc(4,p,p.return);break;case 1:wc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Zl(i,n,e)}}break;case 5:wc(p,p.return);break;case 22:if(p.memoizedState!==null){qc(f);continue}}m===null?qc(f):(m.return=p,V=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Le(`display`,s))}catch(t){Zl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Zl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Vc(t,e),Uc(e),i&4&&Bc(e);break;case 21:break;default:Vc(t,e),Uc(e)}}function Uc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Mc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Pe(a,``),i.flags&=-33),Fc(e,Nc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Pc(e,Nc(e),o);break;default:throw Error(r(161))}}catch(t){Zl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wc(e,t,n){V=e,Gc(e,t,n)}function Gc(e,t,n){for(var r=(e.mode&1)!=0;V!==null;){var i=V,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||B;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||Sc;s=B;var l=Sc;if(B=o,(Sc=c)&&!l)for(V=i;V!==null;)o=V,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Jc(i):(c.return=o,V=c);for(;a!==null;)V=a,Gc(a,t,n),a=a.sibling;V=i,B=s,Sc=l}Kc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,V=a):Kc(e,t,n)}}function Kc(e){for(;V!==null;){var t=V;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Sc||kc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Sc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:ks(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&go(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}go(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&vn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Sc||t.flags&512&&Ac(t)}catch(e){Zl(t,t.return,e)}}if(t===e){V=null;break}if(n=t.sibling,n!==null){n.return=t.return,V=n;break}V=t.return}}function qc(e){for(;V!==null;){var t=V;if(t===e){V=null;break}var n=t.sibling;if(n!==null){n.return=t.return,V=n;break}V=t.return}}function Jc(e){for(;V!==null;){var t=V;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{kc(4,t)}catch(e){Zl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Zl(t,i,e)}}var a=t.return;try{Ac(t)}catch(e){Zl(t,a,e)}break;case 5:var o=t.return;try{Ac(t)}catch(e){Zl(t,o,e)}}}catch(e){Zl(t,t.return,e)}if(t===e){V=null;break}var s=t.sibling;if(s!==null){s.return=t.return,V=s;break}V=t.return}}var Yc=Math.ceil,Xc=x.ReactCurrentDispatcher,Zc=x.ReactCurrentOwner,Qc=x.ReactCurrentBatchConfig,$c=0,el=null,tl=null,nl=0,rl=0,il=Yi(0),al=0,ol=null,sl=0,cl=0,ll=0,ul=null,dl=null,fl=0,pl=1/0,ml=null,hl=!1,gl=null,_l=null,vl=!1,yl=null,bl=0,xl=0,Sl=null,Cl=-1,wl=0;function Tl(){return $c&6?xt():Cl===-1?Cl=xt():Cl}function El(e){return e.mode&1?$c&2&&nl!==0?nl&-nl:Va.transition===null?(e=qt,e===0?(e=window.event,e=e===void 0?16:En(e.type),e):e):(wl===0&&(wl=Ht()),wl):1}function Dl(e,t,n,i){if(50<xl)throw xl=0,Sl=null,Error(r(185));Wt(e,n,i),(!($c&2)||e!==el)&&(e===el&&(!($c&2)&&(cl|=n),al===4&&Nl(e,nl)),Ol(e,i),n===1&&$c===0&&!(t.mode&1)&&(pl=xt()+500,ua&&ma()))}function Ol(e,t){var n=e.callbackNode;Bt(e,t);var r=Rt(e,e===el?nl:0);if(r===0)n!==null&&vt(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&vt(n),t===1)e.tag===0?pa(Pl.bind(null,e)):fa(Pl.bind(null,e)),ji(function(){!($c&6)&&ma()}),n=null;else{switch(Jt(r)){case 1:n=Ct;break;case 4:n=wt;break;case 16:n=Tt;break;case 536870912:n=Dt;break;default:n=Tt}n=ru(n,kl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function kl(e,t){if(Cl=-1,wl=0,$c&6)throw Error(r(327));var n=e.callbackNode;if(Yl()&&e.callbackNode!==n)return null;var i=Rt(e,e===el?nl:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Hl(e,i);else{t=i;var a=$c;$c|=2;var o=Bl();(el!==e||nl!==t)&&(ml=null,pl=xt()+500,Rl(e,t));do try{Wl();break}catch(t){zl(e,t)}while(1);Qa(),Xc.current=o,$c=a,tl===null?(el=null,nl=0,t=al):t=0}if(t!==0){if(t===2&&(a=Vt(e),a!==0&&(i=a,t=Al(e,a))),t===1)throw n=ol,Rl(e,0),Nl(e,i),Ol(e,xt()),n;if(t===6)Nl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Ml(a)&&(t=Hl(e,i),t===2&&(o=Vt(e),o!==0&&(i=o,t=Al(e,o))),t===1))throw n=ol,Rl(e,0),Nl(e,i),Ol(e,xt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:ql(e,dl,ml);break;case 3:if(Nl(e,i),(i&130023424)===i&&(t=fl+500-xt(),10<t)){if(Rt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){Tl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Oi(ql.bind(null,e,dl,ml),t);break}ql(e,dl,ml);break;case 4:if(Nl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-jt(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=xt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Yc(i/1960))-i,10<i){e.timeoutHandle=Oi(ql.bind(null,e,dl,ml),i);break}ql(e,dl,ml);break;case 5:ql(e,dl,ml);break;default:throw Error(r(329))}}}return Ol(e,xt()),e.callbackNode===n?kl.bind(null,e):null}function Al(e,t){var n=ul;return e.current.memoizedState.isDehydrated&&(Rl(e,t).flags|=256),e=Hl(e,t),e!==2&&(t=dl,dl=n,t!==null&&jl(t)),e}function jl(e){dl===null?dl=e:dl.push.apply(dl,e)}function Ml(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Mr(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Nl(e,t){for(t&=~ll,t&=~cl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-jt(t),r=1<<n;e[n]=-1,t&=~r}}function Pl(e){if($c&6)throw Error(r(327));Yl();var t=Rt(e,0);if(!(t&1))return Ol(e,xt()),null;var n=Hl(e,t);if(e.tag!==0&&n===2){var i=Vt(e);i!==0&&(t=i,n=Al(e,i))}if(n===1)throw n=ol,Rl(e,0),Nl(e,t),Ol(e,xt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ql(e,dl,ml),Ol(e,xt()),null}function Fl(e,t){var n=$c;$c|=1;try{return e(t)}finally{$c=n,$c===0&&(pl=xt()+500,ua&&ma())}}function Il(e){yl!==null&&yl.tag===0&&!($c&6)&&Yl();var t=$c;$c|=1;var n=Qc.transition,r=qt;try{if(Qc.transition=null,qt=1,e)return e()}finally{qt=r,Qc.transition=n,$c=t,!($c&6)&&ma()}}function Ll(){rl=il.current,Xi(il)}function Rl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ki(n)),tl!==null)for(n=tl.return;n!==null;){var r=n;switch(Da(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ia();break;case 3:Co(),Xi(ea),Xi($i),ko();break;case 5:To(r);break;case 4:Co();break;case 13:Xi(Eo);break;case 19:Xi(Eo);break;case 10:$a(r.type._context);break;case 22:case 23:Ll()}n=n.return}if(el=e,tl=e=cu(e.current,null),nl=rl=t,al=0,ol=null,ll=cl=sl=0,dl=ul=null,ro!==null){for(t=0;t<ro.length;t++)if(n=ro[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}ro=null}return e}function zl(e,t){do{var n=tl;try{if(Qa(),Ao.current=Ts,Io){for(var i=No.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Io=!1}if(Mo=0,Fo=Po=No=null,Lo=!1,Ro=0,Zc.current=null,n===null||n.return===null){al=1,ol=t,tl=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=nl,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Us(s);if(m!==null){m.flags&=-257,Ws(m,s,c,o,t),m.mode&1&&Hs(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){Hs(o,u,t),Vl();break a}l=Error(r(426))}}else if(Aa&&c.mode&1){var _=Us(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ws(_,s,c,o,t),Ba(Is(l,c));break a}}o=l=Is(l,c),al!==4&&(al=2),ul===null?ul=[o]:ul.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Bs(o,l,t);mo(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(_l===null||!_l.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Vs(o,c,t);mo(o,x);break a}}o=o.return}while(o!==null)}Kl(n)}catch(e){t=e,tl===n&&n!==null&&(tl=n=n.return);continue}break}while(1)}function Bl(){var e=Xc.current;return Xc.current=Ts,e===null?Ts:e}function Vl(){(al===0||al===3||al===2)&&(al=4),el===null||!(sl&268435455)&&!(cl&268435455)||Nl(el,nl)}function Hl(e,t){var n=$c;$c|=2;var i=Bl();(el!==e||nl!==t)&&(ml=null,Rl(e,t));do try{Ul();break}catch(t){zl(e,t)}while(1);if(Qa(),$c=n,Xc.current=i,tl!==null)throw Error(r(261));return el=null,nl=0,al}function Ul(){for(;tl!==null;)Gl(tl)}function Wl(){for(;tl!==null&&!yt();)Gl(tl)}function Gl(e){var t=nu(e.alternate,e,rl);e.memoizedProps=e.pendingProps,t===null?Kl(e):tl=t,Zc.current=null}function Kl(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=xc(n,t),n!==null){n.flags&=32767,tl=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{al=6,tl=null;return}}else if(n=bc(n,t,rl),n!==null){tl=n;return}if(t=t.sibling,t!==null){tl=t;return}tl=t=e}while(t!==null);al===0&&(al=5)}function ql(e,t,n){var r=qt,i=Qc.transition;try{Qc.transition=null,qt=1,Jl(e,t,n,r)}finally{Qc.transition=i,qt=r}return null}function Jl(e,t,n,i){do Yl();while(yl!==null);if($c&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Gt(e,o),e===el&&(tl=el=null,nl=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||vl||(vl=!0,ru(Tt,function(){return Yl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Qc.transition,Qc.transition=null;var s=qt;qt=1;var c=$c;$c|=4,Zc.current=null,Dc(e,n),Hc(n,e),zr(Ei),bn=!!Ti,Ei=Ti=null,e.current=n,Wc(n,e,a),bt(),$c=c,qt=s,Qc.transition=o}else e.current=n;if(vl&&(vl=!1,yl=e,bl=a),o=e.pendingLanes,o===0&&(_l=null),At(n.stateNode,i),Ol(e,xt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(hl)throw hl=!1,e=gl,gl=null,e;return bl&1&&e.tag!==0&&Yl(),o=e.pendingLanes,o&1?e===Sl?xl++:(xl=0,Sl=e):xl=0,ma(),null}function Yl(){if(yl!==null){var e=Jt(bl),t=Qc.transition,n=qt;try{if(Qc.transition=null,qt=16>e?16:e,yl===null)var i=!1;else{if(e=yl,yl=null,bl=0,$c&6)throw Error(r(331));var a=$c;for($c|=4,V=e.current;V!==null;){var o=V,s=o.child;if(V.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(V=u;V!==null;){var d=V;switch(d.tag){case 0:case 11:case 15:Oc(8,d,o)}var f=d.child;if(f!==null)f.return=d,V=f;else for(;V!==null;){d=V;var p=d.sibling,m=d.return;if(jc(d),d===u){V=null;break}if(p!==null){p.return=m,V=p;break}V=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}V=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,V=s;else b:for(;V!==null;){if(o=V,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Oc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,V=v;break b}V=o.return}}var y=e.current;for(V=y;V!==null;){s=V;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,V=b;else b:for(s=y;V!==null;){if(c=V,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:kc(9,c)}}catch(e){Zl(c,c.return,e)}if(c===s){V=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,V=x;break b}V=c.return}}if($c=a,ma(),kt&&typeof kt.onPostCommitFiberRoot==`function`)try{kt.onPostCommitFiberRoot(Ot,e)}catch{}i=!0}return i}finally{qt=n,Qc.transition=t}}return!1}function Xl(e,t,n){t=Is(n,t),t=Bs(e,t,1),e=fo(e,t,1),t=Tl(),e!==null&&(Wt(e,1,t),Ol(e,t))}function Zl(e,t,n){if(e.tag===3)Xl(e,e,n);else for(;t!==null;){if(t.tag===3){Xl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_l===null||!_l.has(r))){e=Is(n,e),e=Vs(t,e,1),t=fo(t,e,1),e=Tl(),t!==null&&(Wt(t,1,e),Ol(t,e));break}}t=t.return}}function Ql(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Tl(),e.pingedLanes|=e.suspendedLanes&n,el===e&&(nl&n)===n&&(al===4||al===3&&(nl&130023424)===nl&&500>xt()-fl?Rl(e,0):ll|=n),Ol(e,t)}function $l(e,t){t===0&&(e.mode&1?(t=It,It<<=1,!(It&130023424)&&(It=4194304)):t=1);var n=Tl();e=oo(e,t),e!==null&&(Wt(e,t,n),Ol(e,n))}function eu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$l(e,n)}function tu(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),$l(e,n)}var nu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ea.current)Ks=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Ks=!1,hc(e,t,n);Ks=!!(e.flags&131072)}else Ks=!1,Aa&&t.flags&1048576&&Ta(t,va,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;pc(e,t),e=t.pendingProps;var a=na(t,$i.current);to(t,n),a=Ho(null,t,i,e,a,n);var o=Uo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ra(i)?(o=!0,sa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,co(t),a.updater=js,t.stateNode=a,a._reactInternals=t,Fs(t,i,e,n),t=tc(null,t,i,!0,o,n)):(t.tag=0,Aa&&o&&Ea(t),qs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(pc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=su(i),e=ks(i,e),a){case 0:t=$s(null,t,i,e,n);break a;case 1:t=ec(null,t,i,e,n);break a;case 11:t=Js(null,t,i,e,n);break a;case 14:t=Ys(null,t,i,ks(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ks(i,a),$s(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ks(i,a),ec(e,t,i,a,n);case 3:a:{if(nc(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,lo(e,t),ho(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Is(Error(r(423)),t),t=rc(e,t,i,n,a);break a}else if(i!==a){a=Is(Error(r(424)),t),t=rc(e,t,i,n,a);break a}else for(ka=Pi(t.stateNode.containerInfo.firstChild),Oa=t,Aa=!0,ja=null,n=qa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(za(),i===a){t=mc(e,t,n);break a}qs(e,t,i,n)}t=t.child}return t;case 5:return wo(t),e===null&&Fa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Di(i,a)?s=null:o!==null&&Di(i,o)&&(t.flags|=32),Qs(e,t),qs(e,t,s,n),t.child;case 6:return e===null&&Fa(t),null;case 13:return oc(e,t,n);case 4:return So(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ka(t,null,i,n):qs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ks(i,a),Js(e,t,i,a,n);case 7:return qs(e,t,t.pendingProps,n),t.child;case 8:return qs(e,t,t.pendingProps.children,n),t.child;case 12:return qs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Zi(Ja,i._currentValue),i._currentValue=s,o!==null)if(Mr(o.value,s)){if(o.children===a.children&&!ea.current){t=mc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=uo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),eo(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),eo(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}qs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,to(t,n),a=no(a),i=i(a),t.flags|=1,qs(e,t,i,n),t.child;case 14:return i=t.type,a=ks(i,t.pendingProps),a=ks(i.type,a),Ys(e,t,i,a,n);case 15:return Xs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:ks(i,a),pc(e,t),t.tag=1,ra(i)?(e=!0,sa(t)):e=!1,to(t,n),Ns(t,i,a),Fs(t,i,a,n),tc(null,t,i,!0,e,n);case 19:return fc(e,t,n);case 22:return Zs(e,t,n)}throw Error(r(156,t.tag))};function ru(e,t){return _t(e,t)}function iu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 au(e,t,n,r){return new iu(e,t,n,r)}function ou(e){return e=e.prototype,!(!e||!e.isReactComponent)}function su(e){if(typeof e==`function`)return+!!ou(e);if(e!=null){if(e=e.$$typeof,e===k)return 11;if(e===te)return 14}return 2}function cu(e,t){var n=e.alternate;return n===null?(n=au(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function lu(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ou(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case w:return uu(n.children,a,o,t);case T:s=8,a|=8;break;case E:return e=au(12,n,t,a|2),e.elementType=E,e.lanes=o,e;case A:return e=au(13,n,t,a),e.elementType=A,e.lanes=o,e;case ee:return e=au(19,n,t,a),e.elementType=ee,e.lanes=o,e;case N:return du(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case D:s=10;break a;case O:s=9;break a;case k:s=11;break a;case te:s=14;break a;case ne:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=au(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function uu(e,t,n,r){return e=au(7,e,r,t),e.lanes=n,e}function du(e,t,n,r){return e=au(22,e,r,t),e.elementType=N,e.lanes=n,e.stateNode={isHidden:!1},e}function fu(e,t,n){return e=au(6,e,null,t),e.lanes=n,e}function pu(e,t,n){return t=au(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ut(0),this.expirationTimes=Ut(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function hu(e,t,n,r,i,a,o,s,c){return e=new mu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=au(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},co(a),e}function gu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:C,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function _u(e){if(!e)return Qi;e=e._reactInternals;a:{if(dt(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(ra(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(ra(n))return oa(e,n,t)}return t}function vu(e,t,n,r,i,a,o,s,c){return e=hu(n,r,!0,e,i,a,o,s,c),e.context=_u(null),n=e.current,r=Tl(),i=El(n),a=uo(r,i),a.callback=t??null,fo(n,a,i),e.current.lanes=i,Wt(e,i,r),Ol(e,r),e}function yu(e,t,n,r){var i=t.current,a=Tl(),o=El(i);return n=_u(n),t.context===null?t.context=n:t.pendingContext=n,t=uo(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=fo(i,t,o),e!==null&&(Dl(e,i,o,a),po(e,i,o)),o}function bu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Su(e,t){xu(e,t),(e=e.alternate)&&xu(e,t)}function Cu(){return null}var wu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Tu(e){this._internalRoot=e}Eu.prototype.render=Tu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));yu(e,t,null,null)},Eu.prototype.unmount=Tu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Il(function(){yu(null,e,null,null)}),t[zi]=null}};function Eu(e){this._internalRoot=e}Eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Qt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cn.length&&t!==0&&t<cn[n].priority;n++);cn.splice(n,0,e),n===0&&pn(e)}};function Du(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ou(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function ku(){}function Au(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=bu(o);a.call(e)}}var o=vu(t,r,e,0,null,!1,!1,``,ku);return e._reactRootContainer=o,e[zi]=o.current,pi(e.nodeType===8?e.parentNode:e),Il(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=bu(c);s.call(e)}}var c=hu(e,0,!1,null,null,!1,!1,``,ku);return e._reactRootContainer=c,e[zi]=c.current,pi(e.nodeType===8?e.parentNode:e),Il(function(){yu(t,c,n,r)}),c}function ju(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=bu(o);s.call(e)}}yu(t,o,e,i)}else o=Au(n,t,e,i,r);return bu(o)}Yt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Lt(t.pendingLanes);n!==0&&(Kt(t,n|1),Ol(t,xt()),!($c&6)&&(pl=xt()+500,ma()))}break;case 13:Il(function(){var t=oo(e,1);t!==null&&Dl(t,e,1,Tl())}),Su(e,1)}},Xt=function(e){if(e.tag===13){var t=oo(e,134217728);t!==null&&Dl(t,e,134217728,Tl()),Su(e,134217728)}},Zt=function(e){if(e.tag===13){var t=El(e),n=oo(e,t);n!==null&&Dl(n,e,t,Tl()),Su(e,t)}},Qt=function(){return qt},$t=function(e,t){var n=qt;try{return qt=e,t()}finally{qt=n}},We=function(e,t,n){switch(t){case`input`:if(xe(e,n),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name=`+JSON.stringify(``+t)+`][type="radio"]`),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=Ki(i);if(!a)throw Error(r(90));ge(i),xe(i,a)}}}break;case`textarea`:Oe(e,n);break;case`select`:t=n.value,t!=null&&Te(e,!!n.multiple,t,!1)}},Xe=Fl,Ze=Il;var Mu={usingClientEntryPoint:!1,Events:[Wi,Gi,Ki,Je,Ye,Fl]},Nu={findFiberByHostInstance:Ui,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},Pu={bundleType:Nu.bundleType,version:Nu.version,rendererPackageName:Nu.rendererPackageName,rendererConfig:Nu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ht(e),e===null?null:e.stateNode},findFiberByHostInstance:Nu.findFiberByHostInstance||Cu,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:`18.3.1-next-f1338f8080-20240426`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Fu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fu.isDisabled&&Fu.supportsFiber)try{Ot=Fu.inject(Pu),kt=Fu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Mu,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Du(t))throw Error(r(200));return gu(e,t,null,n)},e.createRoot=function(e,t){if(!Du(e))throw Error(r(299));var n=!1,i=``,a=wu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=hu(e,1,!1,null,null,n,!1,i,a),e[zi]=t.current,pi(e.nodeType===8?e.parentNode:e),new Tu(t)},e.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=ht(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Il(e)},e.hydrate=function(e,t,n){if(!Ou(t))throw Error(r(200));return ju(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!Du(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=wu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=vu(t,null,e,1,n??null,a,!1,o,s),e[zi]=t.current,pi(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new Eu(t)},e.render=function(e,t,n){if(!Ou(t))throw Error(r(200));return ju(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!Ou(e))throw Error(r(40));return e._reactRootContainer?(Il(function(){ju(null,null,e,!1,function(){e._reactRootContainer=null,e[zi]=null})}),!0):!1},e.unstable_batchedUpdates=Fl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Ou(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return ju(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),N=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ne()})),re=n((e=>{var t=N();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),ie=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ae=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),oe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),se=e=>{let t=oe(e);return t.charAt(0).toUpperCase()+t.slice(1)},ce={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`},le=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},P=e(j()),ue=(0,P.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,P.createElement)(`svg`,{ref:c,...ce,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ie(`lucide`,i),...!a&&!le(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,P.createElement)(e,t)),...Array.isArray(a)?a:[a]])),de=(e,t)=>{let n=(0,P.forwardRef)(({className:n,...r},i)=>(0,P.createElement)(ue,{ref:i,iconNode:t,className:ie(`lucide-${ae(se(e))}`,`lucide-${e}`,n),...r}));return n.displayName=se(e),n},fe=de(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),pe=de(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),me=de(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),he=de(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),ge=de(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),_e=de(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ve=de(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),ye=de(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),be=de(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),xe=de(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Se=de(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Ce=de(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),we=de(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Te=de(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Ee=de(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),De=de(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Oe=de(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),ke=de(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ae=de(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),je=de(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Me=de(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ne=de(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),Pe=de(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Fe=de(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Ie=de(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Le=de(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Re=de(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ze=de(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Be=de(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Ve=de(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),He=de(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Ue=de(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),We=de(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ge=de(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),Ke=de(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),qe=de(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Je=de(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ye=de(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Xe=de(`tags`,[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]),Ze=de(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Qe=de(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),$e=de(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),et=de(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),tt=de(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),nt=e(re(),1),rt=null,it=new Set,at=`disconnected`,ot=new Set,st=null,ct=null,lt=null,ut=!1,dt=!1,ft=25e3,pt=1e4,mt=3e3;function ht(e){at=e,ot.forEach(t=>t(e))}function gt(){st&&=(clearInterval(st),null),ct&&=(clearTimeout(ct),null)}function _t(){if(rt?.readyState===WebSocket.OPEN){try{rt.send(JSON.stringify({type:`ping`}))}catch{if(rt)try{rt.close()}catch{}return}ct&&clearTimeout(ct),ct=setTimeout(()=>{if(ct=null,rt)try{rt.close()}catch{}},pt)}}function vt(){gt(),st=setInterval(_t,ft)}function yt(){lt||=setTimeout(()=>{lt=null,bt()},mt)}function bt(){if(rt?.readyState===WebSocket.OPEN||rt?.readyState===WebSocket.CONNECTING)return;let e=`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`;ht(`connecting`);let t=new WebSocket(e);rt=t,t.onopen=()=>{ht(`connected`),vt(),dt&&window.dispatchEvent(new CustomEvent(`ws:reconnected`)),dt=!0},t.onclose=()=>{rt=null,gt(),ht(`disconnected`),yt()},t.onerror=()=>{try{t.close()}catch{}},t.onmessage=e=>{try{let t=JSON.parse(e.data);if(t.type===`pong`){ct&&=(clearTimeout(ct),null);return}if(t.type===`config:reload`){window.dispatchEvent(new CustomEvent(`config-changed`));return}it.forEach(e=>e(t))}catch{}}}function xt(){if(!rt){lt&&=(clearTimeout(lt),null),bt();return}let e=rt.readyState;if(e===WebSocket.CLOSING||e===WebSocket.CLOSED){lt&&=(clearTimeout(lt),null),bt();return}e===WebSocket.OPEN&&_t()}function St(){ut||typeof window>`u`||(ut=!0,document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&xt()}),window.addEventListener(`online`,()=>{xt()}))}function Ct(e){let[t,n]=(0,P.useState)(at);return(0,P.useEffect)(()=>(St(),it.add(e),ot.add(n),n(at),(!rt||rt.readyState!==WebSocket.OPEN&&rt.readyState!==WebSocket.CONNECTING)&&bt(),()=>{it.delete(e),ot.delete(n)}),[e]),{status:t,reconnect:(0,P.useCallback)(()=>{if(lt&&=(clearTimeout(lt),null),rt){try{rt.close()}catch{}rt=null}gt(),bt()},[])}}var wt=5e3,Tt=`colonynote:tabs`;function Et(e,t){return t?`${t}::${e}`:e}function Dt(e={}){let t=(0,P.useRef)(new Map),[n,r]=(0,P.useState)(0),[i,a]=(0,P.useState)([]),[o,s]=(0,P.useState)(null),c=(0,P.useRef)(e);c.current=e;let l=(0,P.useRef)(new Map),u=(0,P.useRef)(new Map),d=(0,P.useRef)(new Map),f=(0,P.useCallback)(()=>r(e=>e+1),[]),p=(0,P.useCallback)((e,t,n=``,r=``)=>({key:Et(e,t),path:e,rootPath:t,content:n,lastSavedContent:r,status:`idle`,saveSessionId:null,lastSelfSaveTime:null,isPinned:!1,isPreview:!1}),[]),m=(0,P.useCallback)(async(e,n)=>{let r=`${e.path}:${Date.now()}`,i=e.key,a=t.current.get(i);a&&t.current.set(i,{...a,status:`saving`,saveSessionId:r,lastSelfSaveTime:Date.now()}),f();let o=u.current.get(i)||new Set;o.add(r),u.current.set(i,o),d.current.set(i,Date.now()),c.current.onSaveStart?.(e.path,r);try{let r=n?`/api/files${e.path}?root=${encodeURIComponent(n)}`:`/api/files${e.path}`;if(!(await fetch(r,{method:`POST`,body:e.content})).ok)throw Error(`Failed to save`);let a=t.current.get(i);a&&t.current.set(i,{...a,status:`saved`,lastSavedContent:a.content}),f(),setTimeout(()=>{if(u.current.get(i)){let e=Date.now()-wt,t=d.current.get(i);t&&t<e&&(u.current.delete(i),d.current.delete(i))}},wt),c.current.onSave?.(e.path)}catch(n){let r=t.current.get(i);r&&t.current.set(i,{...r,status:`error`}),f(),u.current.delete(i),d.current.delete(i),c.current.onError?.(n instanceof Error?n:Error(`Unknown error`),e.path)}},[f]),h=(0,P.useCallback)((e,n,r)=>{let i=Et(e,n),o=r?.asPreview!==!1;if(n?window.location.hash=`${n}:${e}`:window.location.hash=e,t.current.has(i)){s(i);return}a(e=>{let n=e;if(o){let r=e.find(e=>{let n=t.current.get(e);return n?.isPreview&&n.content===n.lastSavedContent});if(r){let i=l.current.get(r);i&&(clearTimeout(i),l.current.delete(r)),u.current.delete(r),d.current.delete(r),t.current.delete(r),n=e.filter(e=>e!==r)}}if(n.includes(i))return n;let r=[...n,i];return s(i),r});let c=p(e,n);c.isPreview=o,t.current.set(i,c),f();let m=n?`/api/files${e}?root=${encodeURIComponent(n)}`:`/api/files${e}`;fetch(m).then(e=>{if(!e.ok)throw Error(`Failed to load file`);return e.text()}).then(e=>{let n=t.current.get(i);n&&(t.current.set(i,{...n,content:e,lastSavedContent:e}),f())}).catch(e=>{console.error(e)})},[p,f]),g=(0,P.useCallback)(e=>{let n=l.current.get(e);n&&(clearTimeout(n),l.current.delete(e)),u.current.delete(e),d.current.delete(e),t.current.delete(e)},[]),_=(0,P.useCallback)(e=>{g(e),a(n=>{let r=n.indexOf(e);if(r===-1)return n;let i=n.filter(t=>t!==e);return s(n=>{if(n!==e)return n;if(i.length===0)return window.location.hash=``,null;let a=i[Math.min(r,i.length-1)],o=t.current.get(a);return o?.rootPath?window.location.hash=`${o.rootPath}:${o.path}`:o&&(window.location.hash=o.path),a}),i}),f()},[g,f]),v=(0,P.useCallback)(e=>{a(n=>{let r=n.filter(t=>t!==e);for(let e of r)g(e);if(o!==e){s(e);let n=t.current.get(e);n?.rootPath?window.location.hash=`${n.rootPath}:${n.path}`:n&&(window.location.hash=n.path)}return[e]}),f()},[o,g,f]),y=(0,P.useCallback)(e=>{a(n=>{let r=n.indexOf(e);if(r===-1)return n;let i=n.slice(r+1);for(let e of i)g(e);let a=n.slice(0,r+1);if(o&&!a.includes(o)){s(e);let n=t.current.get(e);n?.rootPath?window.location.hash=`${n.rootPath}:${n.path}`:n&&(window.location.hash=n.path)}return a}),f()},[o,g,f]),b=(0,P.useCallback)(e=>{a(n=>{let r=n.indexOf(e);if(r===-1)return n;let i=n.slice(0,r);for(let e of i)g(e);let a=n.slice(r);if(o&&!a.includes(o)){s(e);let n=t.current.get(e);n?.rootPath?window.location.hash=`${n.rootPath}:${n.path}`:n&&(window.location.hash=n.path)}return a}),f()},[o,g,f]),x=(0,P.useCallback)(()=>{a(e=>{for(let t of e)g(t);return window.location.hash=``,[]}),s(null),f()},[g,f]),S=(0,P.useCallback)(e=>{a(n=>{let r=n.filter(n=>t.current.get(n)?.rootPath===e);for(let e of r)g(e);let i=n.filter(n=>t.current.get(n)?.rootPath!==e);if(o&&!i.includes(o)&&i.length>0){let e=i[0];s(e);let n=t.current.get(e);n?.rootPath?window.location.hash=`${n.rootPath}:${n.path}`:n&&(window.location.hash=n.path)}else i.length===0&&(s(null),window.location.hash=``);return i}),f()},[o,g,f]),C=(0,P.useCallback)(e=>{a(n=>{let r=n.filter(n=>t.current.get(n)?.rootPath!==e);for(let e of r)g(e);let i=n.filter(n=>t.current.get(n)?.rootPath===e);if(o&&!i.includes(o)&&i.length>0){let e=i[0];s(e);let n=t.current.get(e);n?.rootPath?window.location.hash=`${n.rootPath}:${n.path}`:n&&(window.location.hash=n.path)}else i.length===0&&(s(null),window.location.hash=``);return i}),f()},[o,g,f]),w=(0,P.useCallback)(e=>{let n=t.current.get(e);if(!n)return;let r=!n.isPinned,i=!r&&n.content===n.lastSavedContent;t.current.set(e,{...n,isPinned:r,isPreview:i}),f(),a(e=>{let n=e.filter(e=>t.current.get(e)?.isPinned),r=e.filter(e=>!t.current.get(e)?.isPinned);return[...n,...r]})},[f]),T=(0,P.useCallback)((e,n,r=300)=>{let i=t.current.get(e);if(i){let r={...i,content:n,status:i.status===`saved`?`idle`:i.status,isPreview:!1};t.current.set(e,r)}f();let a=l.current.get(e);a&&clearTimeout(a);let o=window.setTimeout(()=>{l.current.delete(e);let n=t.current.get(e);n&&m(n,n.rootPath)},r);l.current.set(e,o)},[m,f]),E=(0,P.useCallback)(e=>{let n=l.current.get(e);n&&(clearTimeout(n),l.current.delete(e));let r=t.current.get(e);r&&m(r,r.rootPath)},[m]),D=(0,P.useCallback)(()=>{new Map(t.current).forEach((e,t)=>{let n=l.current.get(t);n&&(clearTimeout(n),l.current.delete(t)),e.content!==e.lastSavedContent&&m(e,e.rootPath)})},[m]),O=(0,P.useCallback)(()=>o&&t.current.get(o)||null,[o]),k=(0,P.useCallback)((e,n,r)=>{let i=Date.now();for(let[r,a]of t.current){if(a.path!==e||n!==void 0&&a.rootPath!=null&&a.rootPath!==n)continue;let o=u.current.get(r),s=d.current.get(r);if(o&&o.size>0||s&&i-s<wt||a.content!==a.lastSavedContent)continue;let c=a.rootPath?`/api/files${e}?root=${encodeURIComponent(a.rootPath)}`:`/api/files${e}`;fetch(c).then(e=>{if(!e.ok)throw Error(`Failed to reload`);return e.text()}).then(e=>{let n=t.current.get(r);n&&(t.current.set(r,{...n,content:e,lastSavedContent:e}),f())}).catch(()=>{})}r()},[f]),A=(0,P.useRef)(!1),ee=(0,P.useRef)(!1);return(0,P.useEffect)(()=>{if(!A.current){A.current=!0,ee.current=!0;try{let e=localStorage.getItem(Tt);if(!e){ee.current=!1;return}let n=JSON.parse(e);if(!n.tabOrder?.length){ee.current=!1;return}let r=new Set(n.pinnedKeys||[]),i=[];for(let e of n.tabOrder){let n=e.split(`::`),a,o;n.length>=2?(o=n[0],a=n.slice(1).join(`::`)):(o=null,a=e);let s=Et(a,o);if(!t.current.has(s)){let n=p(a,o);n.isPreview=!1,n.isPinned=r.has(e),t.current.set(s,n);let i=o?`/api/files${a}?root=${encodeURIComponent(o)}`:`/api/files${a}`;fetch(i).then(e=>{if(!e.ok)throw Error(`Failed to load file`);return e.text()}).then(e=>{let n=t.current.get(s);n&&(t.current.set(s,{...n,content:e,lastSavedContent:e}),f())}).catch(()=>{})}i.push(s)}if(a(i),n.activeTabPath&&t.current.has(n.activeTabPath)){s(n.activeTabPath);let e=t.current.get(n.activeTabPath);e?.rootPath?window.location.hash=`${e.rootPath}:${e.path}`:e&&(window.location.hash=e.path)}f()}catch(e){console.error(`Failed to restore tabs:`,e)}finally{ee.current=!1}}},[p,f]),(0,P.useEffect)(()=>{let e=()=>{for(let[e,n]of t.current){if(n.content!==n.lastSavedContent)continue;let r=n.rootPath?`/api/files${n.path}?root=${encodeURIComponent(n.rootPath)}`:`/api/files${n.path}`;fetch(r).then(e=>{if(!e.ok)throw Error(`Failed to reload`);return e.text()}).then(n=>{let r=t.current.get(e);r&&(t.current.set(e,{...r,content:n,lastSavedContent:n}),f())}).catch(()=>{})}};return window.addEventListener(`ws:reconnected`,e),()=>window.removeEventListener(`ws:reconnected`,e)},[f]),(0,P.useEffect)(()=>{if(!ee.current)try{let e=i.filter(e=>{let n=t.current.get(e);return n&&!n.isPreview});if(e.length===0)localStorage.removeItem(Tt);else{let n=o&&t.current.get(o)?.isPreview?null:o,r=e.filter(e=>t.current.get(e)?.isPinned);localStorage.setItem(Tt,JSON.stringify({tabOrder:e,activeTabPath:n,pinnedKeys:r.length>0?r:void 0}))}}catch(e){console.error(`Failed to persist tabs:`,e)}},[i,o]),{tabs:t.current,tabOrder:i,activeTabPath:o,openTab:h,closeTab:_,updateTabContent:T,saveTab:E,saveAllTabs:D,isTabDirty:e=>{let n=t.current.get(e);return n?n.content!==n.lastSavedContent:!1},isTabPinned:e=>{let n=t.current.get(e);return n?n.isPinned:!1},getActiveTab:O,handleWsFileChange:k,togglePin:w,closeOtherTabs:v,closeRightTabs:y,closeLeftTabs:b,closeAllTabs:x,closeGroupTabs:S,closeOtherGroupTabs:C}}function Ot(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ot(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function kt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ot(e))&&(r&&(r+=` `),r+=t);return r}var At=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},jt=(e,t)=>({classGroupId:e,validator:t}),Mt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Nt=`-`,Pt=[],Ft=`arbitrary..`,It=e=>{let t=zt(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Rt(e);let n=e.split(Nt);return Lt(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?At(i,t):t:i||Pt}return n[e]||Pt}}},Lt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Lt(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Nt):e.slice(t).join(Nt),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Rt=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ft+r:void 0})(),zt=e=>{let{theme:t,classGroups:n}=e;return Bt(n,t)},Bt=(e,t)=>{let n=Mt();for(let r in e){let i=e[r];Vt(i,n,r,t)}return n},Vt=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ht(i,t,n,r)}},Ht=(e,t,n,r)=>{if(typeof e==`string`){Ut(e,t,n);return}if(typeof e==`function`){Wt(e,t,n,r);return}Gt(e,t,n,r)},Ut=(e,t,n)=>{let r=e===``?t:Kt(t,e);r.classGroupId=n},Wt=(e,t,n,r)=>{if(qt(e)){Vt(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(jt(n,e))},Gt=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Vt(o,Kt(t,a),n,r)}},Kt=(e,t)=>{let n=e,r=t.split(Nt),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Mt(),n.nextPart.set(t,i)),n=i}return n},qt=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Jt=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Yt=`!`,Xt=`:`,Zt=[],Qt=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),$t=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Xt){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Yt)?(c=s.slice(0,-1),l=!0):s.startsWith(Yt)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Qt(t,l,c,u)};if(t){let e=t+Xt,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Qt(Zt,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},en=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},tn=e=>({cache:Jt(e.cacheSize),parseClassName:$t(e),sortModifiers:en(e),...It(e)}),nn=/\s+/,rn=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(nn),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+Yt:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},an=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=on(n))&&(i&&(i+=` `),i+=r);return i},on=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=on(e[r]))&&(n&&(n+=` `),n+=t);return n},sn=(e,...t)=>{let n,r,i,a,o=o=>(n=tn(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=rn(e,n);return i(e,a),a};return a=o,(...e)=>a(an(...e))},cn=[],ln=e=>{let t=t=>t[e]||cn;return t.isThemeGetter=!0,t},un=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dn=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fn=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,pn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,hn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_n=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vn=e=>fn.test(e),yn=e=>!!e&&!Number.isNaN(Number(e)),bn=e=>!!e&&Number.isInteger(Number(e)),xn=e=>e.endsWith(`%`)&&yn(e.slice(0,-1)),Sn=e=>pn.test(e),Cn=()=>!0,wn=e=>mn.test(e)&&!hn.test(e),Tn=()=>!1,En=e=>gn.test(e),Dn=e=>_n.test(e),On=e=>!F(e)&&!I(e),kn=e=>Wn(e,Jn,Tn),F=e=>un.test(e),An=e=>Wn(e,Yn,wn),jn=e=>Wn(e,Xn,yn),Mn=e=>Wn(e,Qn,Cn),Nn=e=>Wn(e,Zn,Tn),Pn=e=>Wn(e,Kn,Tn),Fn=e=>Wn(e,qn,Dn),In=e=>Wn(e,$n,En),I=e=>dn.test(e),Ln=e=>Gn(e,Yn),Rn=e=>Gn(e,Zn),zn=e=>Gn(e,Kn),Bn=e=>Gn(e,Jn),Vn=e=>Gn(e,qn),Hn=e=>Gn(e,$n,!0),Un=e=>Gn(e,Qn,!0),Wn=(e,t,n)=>{let r=un.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Gn=(e,t,n=!1)=>{let r=dn.exec(e);return r?r[1]?t(r[1]):n:!1},Kn=e=>e===`position`||e===`percentage`,qn=e=>e===`image`||e===`url`,Jn=e=>e===`length`||e===`size`||e===`bg-size`,Yn=e=>e===`length`,Xn=e=>e===`number`,Zn=e=>e===`family-name`,Qn=e=>e===`number`||e===`weight`,$n=e=>e===`shadow`,er=sn(()=>{let e=ln(`color`),t=ln(`font`),n=ln(`text`),r=ln(`font-weight`),i=ln(`tracking`),a=ln(`leading`),o=ln(`breakpoint`),s=ln(`container`),c=ln(`spacing`),l=ln(`radius`),u=ln(`shadow`),d=ln(`inset-shadow`),f=ln(`text-shadow`),p=ln(`drop-shadow`),m=ln(`blur`),h=ln(`perspective`),g=ln(`aspect`),_=ln(`ease`),v=ln(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),I,F],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[I,F,c],T=()=>[vn,`full`,`auto`,...w()],E=()=>[bn,`none`,`subgrid`,I,F],D=()=>[`auto`,{span:[`full`,bn,I,F]},bn,I,F],O=()=>[bn,`auto`,I,F],k=()=>[`auto`,`min`,`max`,`fr`,I,F],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ee=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],te=()=>[vn,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[vn,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[vn,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,I,F],re=()=>[...b(),zn,Pn,{position:[I,F]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Bn,kn,{size:[I,F]}],oe=()=>[xn,Ln,An],se=()=>[``,`none`,`full`,l,I,F],ce=()=>[``,yn,Ln,An],le=()=>[`solid`,`dashed`,`dotted`,`double`],P=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ue=()=>[yn,xn,zn,Pn],de=()=>[``,`none`,m,I,F],fe=()=>[`none`,yn,I,F],pe=()=>[`none`,yn,I,F],me=()=>[yn,I,F],he=()=>[vn,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Sn],breakpoint:[Sn],color:[Cn],container:[Sn],"drop-shadow":[Sn],ease:[`in`,`out`,`in-out`],font:[On],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Sn],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Sn],shadow:[Sn],spacing:[`px`,yn],text:[Sn],"text-shadow":[Sn],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,vn,F,I,g]}],container:[`container`],columns:[{columns:[yn,F,I,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[bn,`auto`,I,F]}],basis:[{basis:[vn,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[yn,vn,`auto`,`initial`,`none`,F]}],grow:[{grow:[``,yn,I,F]}],shrink:[{shrink:[``,yn,I,F]}],order:[{order:[bn,`first`,`last`,`none`,I,F]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...ee(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ee()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...ee(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ee(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...ee(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ee()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:te()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...te()]}],"min-w":[{"min-w":[s,`screen`,`none`,...te()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...te()]}],h:[{h:[`screen`,`lh`,...te()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...te()]}],"max-h":[{"max-h":[`screen`,`lh`,...te()]}],"font-size":[{text:[`base`,n,Ln,An]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Un,Mn]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,xn,F]}],"font-family":[{font:[Rn,Nn,t]}],"font-features":[{"font-features":[F]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,I,F]}],"line-clamp":[{"line-clamp":[yn,`none`,I,jn]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,I,F]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,I,F]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[yn,`from-font`,`auto`,I,An]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[yn,`auto`,I,F]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,I,F]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,I,F]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},bn,I,F],radial:[``,I,F],conic:[bn,I,F]},Vn,Fn]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[yn,I,F]}],"outline-w":[{outline:[``,yn,Ln,An]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,Hn,In]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Hn,In]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[yn,An]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Hn,In]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[yn,I,F]}],"mix-blend":[{"mix-blend":[...P(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":P()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[yn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[I,F]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[yn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,I,F]}],filter:[{filter:[``,`none`,I,F]}],blur:[{blur:de()}],brightness:[{brightness:[yn,I,F]}],contrast:[{contrast:[yn,I,F]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Hn,In]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,yn,I,F]}],"hue-rotate":[{"hue-rotate":[yn,I,F]}],invert:[{invert:[``,yn,I,F]}],saturate:[{saturate:[yn,I,F]}],sepia:[{sepia:[``,yn,I,F]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,I,F]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[yn,I,F]}],"backdrop-contrast":[{"backdrop-contrast":[yn,I,F]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,yn,I,F]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[yn,I,F]}],"backdrop-invert":[{"backdrop-invert":[``,yn,I,F]}],"backdrop-opacity":[{"backdrop-opacity":[yn,I,F]}],"backdrop-saturate":[{"backdrop-saturate":[yn,I,F]}],"backdrop-sepia":[{"backdrop-sepia":[``,yn,I,F]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,I,F]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[yn,`initial`,I,F]}],ease:[{ease:[`linear`,`initial`,_,I,F]}],delay:[{delay:[yn,I,F]}],animate:[{animate:[`none`,v,I,F]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,I,F]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":[`scale-3d`],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[I,F,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":[`translate-none`],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,I,F]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,I,F]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[yn,Ln,An,jn]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function L(...e){return er(kt(e))}var tr=n((e=>{var t=j(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),R=n(((e,t)=>{t.exports=tr()}))(),nr=P.forwardRef(({className:e,type:t,...n},r)=>(0,R.jsx)(`input`,{type:t,className:L(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));nr.displayName=`Input`;function rr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ir(...e){return t=>{let n=!1,r=e.map(e=>{let r=rr(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rr(e[t],null)}}}}function ar(...e){return P.useCallback(ir(...e),e)}var or=Symbol.for(`react.lazy`),sr=P.use;function cr(e){return typeof e==`object`&&!!e&&`then`in e}function lr(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===or&&`_payload`in e&&cr(e._payload)}function ur(e){let t=fr(e),n=P.forwardRef((e,n)=>{let{children:r,...i}=e;lr(r)&&typeof sr==`function`&&(r=sr(r._payload));let a=P.Children.toArray(r),o=a.find(mr);if(o){let e=o.props.children,r=a.map(t=>t===o?P.Children.count(e)>1?P.Children.only(null):P.isValidElement(e)?e.props.children:null:t);return(0,R.jsx)(t,{...i,ref:n,children:P.isValidElement(e)?P.cloneElement(e,void 0,r):null})}return(0,R.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var dr=ur(`Slot`);function fr(e){let t=P.forwardRef((e,t)=>{let{children:n,...r}=e;if(lr(n)&&typeof sr==`function`&&(n=sr(n._payload)),P.isValidElement(n)){let e=gr(n),i=hr(r,n.props);return n.type!==P.Fragment&&(i.ref=t?ir(t,e):e),P.cloneElement(n,i)}return P.Children.count(n)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var pr=Symbol(`radix.slottable`);function mr(e){return P.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===pr}function hr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function gr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _r=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,vr=kt,yr=(e,t)=>n=>{if(t?.variants==null)return vr(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=_r(t)||_r(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return vr(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},br=yr(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function xr({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,R.jsx)(r?dr:`button`,{className:L(br({variant:t,size:n,className:e})),...i})}typeof window<`u`&&window.document&&window.document.createElement;function Sr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Cr(e,t){let n=P.createContext(t),r=e=>{let{children:t,...r}=e,i=P.useMemo(()=>r,Object.values(r));return(0,R.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=P.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function wr(e,t=[]){let n=[];function r(t,r){let i=P.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=P.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=P.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>P.createContext(e));return function(n){let r=n?.[e]||t;return P.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Tr(i,...t)]}function Tr(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Er=globalThis?.document?P.useLayoutEffect:()=>{},Dr=P.useInsertionEffect||Er;function Or({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=kr({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=P.useRef(e!==void 0);P.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,P.useCallback(t=>{if(s){let n=Ar(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function kr({defaultProp:e,onChange:t}){let[n,r]=P.useState(e),i=P.useRef(n),a=P.useRef(t);return Dr(()=>{a.current=t},[t]),P.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Ar(e){return typeof e==`function`}var jr=e(N(),1);function Mr(e){let t=Nr(e),n=P.forwardRef((e,n)=>{let{children:r,...i}=e,a=P.Children.toArray(r),o=a.find(Ir);if(o){let e=o.props.children,r=a.map(t=>t===o?P.Children.count(e)>1?P.Children.only(null):P.isValidElement(e)?e.props.children:null:t);return(0,R.jsx)(t,{...i,ref:n,children:P.isValidElement(e)?P.cloneElement(e,void 0,r):null})}return(0,R.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Nr(e){let t=P.forwardRef((e,t)=>{let{children:n,...r}=e;if(P.isValidElement(n)){let e=Rr(n),i=Lr(r,n.props);return n.type!==P.Fragment&&(i.ref=t?ir(t,e):e),P.cloneElement(n,i)}return P.Children.count(n)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pr=Symbol(`radix.slottable`);function Fr(e){let t=({children:e})=>(0,R.jsx)(R.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Pr,t}function Ir(e){return P.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Pr}function Lr(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Rr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zr=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Mr(`Primitive.${t}`),r=P.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Br(e,t){e&&jr.flushSync(()=>e.dispatchEvent(t))}function Vr(e,t){return P.useReducer((e,n)=>t[e][n]??e,e)}var Hr=e=>{let{present:t,children:n}=e,r=Ur(t),i=typeof n==`function`?n({present:r.isPresent}):P.Children.only(n),a=ar(r.ref,Gr(i));return typeof n==`function`||r.isPresent?P.cloneElement(i,{ref:a}):null};Hr.displayName=`Presence`;function Ur(e){let[t,n]=P.useState(),r=P.useRef(null),i=P.useRef(e),a=P.useRef(`none`),[o,s]=Vr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return P.useEffect(()=>{let e=Wr(r.current);a.current=o===`mounted`?e:`none`},[o]),Er(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Wr(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Er(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Wr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Wr(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:P.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Wr(e){return e?.animationName||`none`}function Gr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Kr=P.useId||(()=>void 0),qr=0;function Jr(e){let[t,n]=P.useState(Kr());return Er(()=>{e||n(e=>e??String(qr++))},[e]),e||(t?`radix-${t}`:``)}var Yr=`Collapsible`,[Xr,Zr]=wr(Yr),[Qr,$r]=Xr(Yr),ei=P.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Or({prop:r,defaultProp:i??!1,onChange:o,caller:Yr});return(0,R.jsx)(Qr,{scope:n,disabled:a,contentId:Jr(),open:c,onOpenToggle:P.useCallback(()=>l(e=>!e),[l]),children:(0,R.jsx)(zr.div,{"data-state":oi(c),"data-disabled":a?``:void 0,...s,ref:t})})});ei.displayName=Yr;var ti=`CollapsibleTrigger`,ni=P.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=$r(ti,n);return(0,R.jsx)(zr.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":oi(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Sr(e.onClick,i.onOpenToggle)})});ni.displayName=ti;var ri=`CollapsibleContent`,ii=P.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=$r(ri,e.__scopeCollapsible);return(0,R.jsx)(Hr,{present:n||i.open,children:({present:e})=>(0,R.jsx)(ai,{...r,ref:t,present:e})})});ii.displayName=ri;var ai=P.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=$r(ri,n),[s,c]=P.useState(r),l=P.useRef(null),u=ar(t,l),d=P.useRef(0),f=d.current,p=P.useRef(0),m=p.current,h=o.open||s,g=P.useRef(h),_=P.useRef(void 0);return P.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),Er(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,R.jsx)(zr.div,{"data-state":oi(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function oi(e){return e?`open`:`closed`}var si=ei,ci=ii,li=si,ui=ni,di=P.forwardRef(({className:e,children:t,...n},r)=>(0,R.jsx)(ci,{ref:r,className:L(`overflow-hidden`,`data-[state=closed]:h-0 data-[state=open]:h-auto`,`transition-[height] duration-200 ease-out`,e),...n,children:t}));di.displayName=ci.displayName,P.createContext(void 0);var fi=({className:e,...t})=>(0,R.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:L(`relative flex w-full min-w-0 flex-col p-2`,e),...t}),pi=({className:e,asChild:t=!1,...n})=>(0,R.jsx)(t?dr:`div`,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:L(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,e),...n}),mi=({className:e,...t})=>(0,R.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:L(`w-full text-sm`,e),...t}),hi=({className:e,...t})=>(0,R.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:L(`flex w-full min-w-0 flex-col gap-1`,e),...t}),gi=({className:e,...t})=>(0,R.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:L(`group/menu-item relative`,e),...t}),_i=yr(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--color-sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--color-sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}}),vi=({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o})=>(0,R.jsx)(e?dr:`button`,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:L(_i({variant:n,size:r}),a),...o}),yi=({className:e,...t})=>(0,R.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:L(`ml-3 flex min-w-0 flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t});function bi(e){let t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...e)=>t.current?.(...e),[])}function xi(e,t=globalThis?.document){let n=bi(e);P.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Si=`DismissableLayer`,Ci=`dismissableLayer.update`,wi=`dismissableLayer.pointerDownOutside`,Ti=`dismissableLayer.focusOutside`,Ei,Di=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Oi=P.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=P.useContext(Di),[u,d]=P.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=P.useState({}),m=ar(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=ji(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Mi(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return xi(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),P.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ei=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Ni(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ei)}},[u,f,n,l]),P.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Ni())},[u,l]),P.useEffect(()=>{let e=()=>p({});return document.addEventListener(Ci,e),()=>document.removeEventListener(Ci,e)},[]),(0,R.jsx)(zr.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:Sr(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Sr(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Sr(e.onPointerDownCapture,x.onPointerDownCapture)})});Oi.displayName=Si;var ki=`DismissableLayerBranch`,Ai=P.forwardRef((e,t)=>{let n=P.useContext(Di),r=P.useRef(null),i=ar(t,r);return P.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,R.jsx)(zr.div,{...e,ref:i})});Ai.displayName=ki;function ji(e,t=globalThis?.document){let n=bi(e),r=P.useRef(!1),i=P.useRef(()=>{});return P.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Pi(wi,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Mi(e,t=globalThis?.document){let n=bi(e),r=P.useRef(!1);return P.useEffect(()=>{let e=e=>{e.target&&!r.current&&Pi(Ti,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Ni(){let e=new CustomEvent(Ci);document.dispatchEvent(e)}function Pi(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Br(i,a):i.dispatchEvent(a)}var Fi=`focusScope.autoFocusOnMount`,Ii=`focusScope.autoFocusOnUnmount`,Li={bubbles:!1,cancelable:!0},Ri=`FocusScope`,zi=P.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=P.useState(null),l=bi(i),u=bi(a),d=P.useRef(null),f=ar(t,e=>c(e)),p=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Ki(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Ki(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Ki(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),P.useEffect(()=>{if(s){qi.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Fi,Li);s.addEventListener(Fi,l),s.dispatchEvent(t),t.defaultPrevented||(Bi(Xi(Hi(s)),{select:!0}),document.activeElement===e&&Ki(s))}return()=>{s.removeEventListener(Fi,l),setTimeout(()=>{let t=new CustomEvent(Ii,Li);s.addEventListener(Ii,u),s.dispatchEvent(t),t.defaultPrevented||Ki(e??document.body,{select:!0}),s.removeEventListener(Ii,u),qi.remove(p)},0)}}},[s,l,u,p]);let m=P.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Vi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Ki(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Ki(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(zr.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});zi.displayName=Ri;function Bi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Ki(r,{select:t}),document.activeElement!==n)return}function Vi(e){let t=Hi(e);return[Ui(t,e),Ui(t.reverse(),e)]}function Hi(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ui(e,t){for(let n of e)if(!Wi(n,{upTo:t}))return n}function Wi(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Gi(e){return e instanceof HTMLInputElement&&`select`in e}function Ki(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Gi(e)&&t&&e.select()}}var qi=Ji();function Ji(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Yi(e,t),e.unshift(t)},remove(t){e=Yi(e,t),e[0]?.resume()}}}function Yi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Xi(e){return e.filter(e=>e.tagName!==`A`)}var Zi=`Portal`,Qi=P.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=P.useState(!1);Er(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?jr.createPortal((0,R.jsx)(zr.div,{...r,ref:t}),o):null});Qi.displayName=Zi;var $i=0;function ea(){P.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ta()),document.body.insertAdjacentElement(`beforeend`,e[1]??ta()),$i++,()=>{$i===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),$i--}},[])}function ta(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var na=function(){return na=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},na.apply(this,arguments)};function ra(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ia(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var aa=`right-scroll-bar-position`,oa=`width-before-scroll-bar`,sa=`with-scroll-bars-hidden`,ca=`--removed-body-scroll-bar-size`;function la(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ua(e,t){var n=(0,P.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var da=typeof window<`u`?P.useLayoutEffect:P.useEffect,fa=new WeakMap;function pa(e,t){var n=ua(t||null,function(t){return e.forEach(function(e){return la(e,t)})});return da(function(){var t=fa.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||la(e,null)}),i.forEach(function(e){r.has(e)||la(e,a)})}fa.set(n,e)},[e]),n}function ma(e){return e}function ha(e,t){t===void 0&&(t=ma);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ga(e){e===void 0&&(e={});var t=ha(null);return t.options=na({async:!0,ssr:!1},e),t}var _a=function(e){var t=e.sideCar,n=ra(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return P.createElement(r,na({},n))};_a.isSideCarExport=!0;function va(e,t){return e.useMedium(t),_a}var ya=ga(),ba=function(){},xa=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:ba,onWheelCapture:ba,onTouchMoveCapture:ba}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=ra(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=pa([n,t]),C=na(na({},b),i);return P.createElement(P.Fragment,null,u&&P.createElement(x,{sideCar:ya,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?P.cloneElement(P.Children.only(s),na(na({},C),{ref:S})):P.createElement(v,na({},C,{className:c,ref:S}),s))});xa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},xa.classNames={fullWidth:oa,zeroRight:aa};var Sa,Ca=function(){if(Sa)return Sa;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function wa(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ca();return t&&e.setAttribute(`nonce`,t),e}function Ta(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ea(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Da=function(){var e=0,t=null;return{add:function(n){e==0&&(t=wa())&&(Ta(t,n),Ea(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Oa=function(){var e=Da();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ka=function(){var e=Oa();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Aa={left:0,top:0,right:0,gap:0},ja=function(e){return parseInt(e||``,10)||0},Ma=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ja(n),ja(r),ja(i)]},Na=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Aa;var t=Ma(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Pa=ka(),Fa=`data-scroll-locked`,Ia=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
10
+ .${sa} {
11
+ overflow: hidden ${r};
12
+ padding-right: ${s}px ${r};
13
+ }
14
+ body[${Fa}] {
15
+ overflow: hidden ${r};
16
+ overscroll-behavior: contain;
17
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
18
+ padding-left: ${i}px;
19
+ padding-top: ${a}px;
20
+ padding-right: ${o}px;
21
+ margin-left:0;
22
+ margin-top:0;
23
+ margin-right: ${s}px ${r};
24
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
25
+ }
26
+
27
+ .${aa} {
28
+ right: ${s}px ${r};
29
+ }
30
+
31
+ .${oa} {
32
+ margin-right: ${s}px ${r};
33
+ }
34
+
35
+ .${aa} .${aa} {
36
+ right: 0 ${r};
37
+ }
38
+
39
+ .${oa} .${oa} {
40
+ margin-right: 0 ${r};
41
+ }
42
+
43
+ body[${Fa}] {
44
+ ${ca}: ${s}px;
45
+ }
46
+ `},La=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ra=function(){P.useEffect(function(){return document.body.setAttribute(Fa,(La()+1).toString()),function(){var e=La()-1;e<=0?document.body.removeAttribute(Fa):document.body.setAttribute(Fa,e.toString())}},[])},za=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ra();var a=P.useMemo(function(){return Na(i)},[i]);return P.createElement(Pa,{styles:Ia(a,!t,i,n?``:`!important`)})},Ba=!1;if(typeof window<`u`)try{var Va=Object.defineProperty({},`passive`,{get:function(){return Ba=!0,!0}});window.addEventListener(`test`,Va,Va),window.removeEventListener(`test`,Va,Va)}catch{Ba=!1}var Ha=Ba?{passive:!1}:!1,Ua=function(e){return e.tagName===`TEXTAREA`},Wa=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ua(e)&&n[t]===`visible`)},Ga=function(e){return Wa(e,`overflowY`)},Ka=function(e){return Wa(e,`overflowX`)},qa=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Xa(e,r)){var i=Za(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ja=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ya=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Xa=function(e,t){return e===`v`?Ga(t):Ka(t)},Za=function(e,t){return e===`v`?Ja(t):Ya(t)},Qa=function(e,t){return e===`h`&&t===`rtl`?-1:1},$a=function(e,t,n,r,i){var a=Qa(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Za(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Xa(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},eo=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},to=function(e){return[e.deltaX,e.deltaY]},no=function(e){return e&&`current`in e?e.current:e},ro=function(e,t){return e[0]===t[0]&&e[1]===t[1]},io=function(e){return`
47
+ .block-interactivity-${e} {pointer-events: none;}
48
+ .allow-interactivity-${e} {pointer-events: all;}
49
+ `},ao=0,oo=[];function so(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),i=P.useState(ao++)[0],a=P.useState(ka)[0],o=P.useRef(e);P.useEffect(function(){o.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ia([e.lockRef.current],(e.shards||[]).map(no),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=P.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=eo(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=qa(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=qa(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return $a(h,t,e,h===`h`?s:c,!0)},[]),c=P.useCallback(function(e){var n=e;if(!(!oo.length||oo[oo.length-1]!==a)){var r=`deltaY`in n?to(n):eo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ro(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(no).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=P.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:co(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=P.useCallback(function(e){n.current=eo(e),r.current=void 0},[]),d=P.useCallback(function(t){l(t.type,to(t),t.target,s(t,e.lockRef.current))},[]),f=P.useCallback(function(t){l(t.type,eo(t),t.target,s(t,e.lockRef.current))},[]);P.useEffect(function(){return oo.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ha),document.addEventListener(`touchmove`,c,Ha),document.addEventListener(`touchstart`,u,Ha),function(){oo=oo.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ha),document.removeEventListener(`touchmove`,c,Ha),document.removeEventListener(`touchstart`,u,Ha)}},[]);var p=e.removeScrollBar,m=e.inert;return P.createElement(P.Fragment,null,m?P.createElement(a,{styles:io(i)}):null,p?P.createElement(za,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function co(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var lo=va(ya,so),uo=P.forwardRef(function(e,t){return P.createElement(xa,na({},e,{ref:t,sideCar:lo}))});uo.classNames=xa.classNames;var fo=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},po=new WeakMap,mo=new WeakMap,ho={},go=0,_o=function(e){return e&&(e.host||_o(e.parentNode))},vo=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=_o(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},yo=function(e,t,n,r){var i=vo(t,Array.isArray(e)?e:[e]);ho[n]||(ho[n]=new WeakMap);var a=ho[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(po.get(e)||0)+1,l=(a.get(e)||0)+1;po.set(e,c),a.set(e,l),o.push(e),c===1&&i&&mo.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),go++,function(){o.forEach(function(e){var t=po.get(e)-1,i=a.get(e)-1;po.set(e,t),a.set(e,i),t||(mo.has(e)||e.removeAttribute(r),mo.delete(e)),i||e.removeAttribute(n)}),go--,go||(po=new WeakMap,po=new WeakMap,mo=new WeakMap,ho={})}},bo=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||fo(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),yo(r,i,n,`aria-hidden`)):function(){return null}},xo=`Dialog`,[So,Co]=wr(xo),[wo,To]=So(xo),Eo=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=P.useRef(null),c=P.useRef(null),[l,u]=Or({prop:r,defaultProp:i??!1,onChange:a,caller:xo});return(0,R.jsx)(wo,{scope:t,triggerRef:s,contentRef:c,contentId:Jr(),titleId:Jr(),descriptionId:Jr(),open:l,onOpenChange:u,onOpenToggle:P.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Eo.displayName=xo;var Do=`DialogTrigger`,Oo=P.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=To(Do,n),a=ar(t,i.triggerRef);return(0,R.jsx)(zr.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Jo(i.open),...r,ref:a,onClick:Sr(e.onClick,i.onOpenToggle)})});Oo.displayName=Do;var ko=`DialogPortal`,[Ao,jo]=So(ko,{forceMount:void 0}),Mo=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=To(ko,t);return(0,R.jsx)(Ao,{scope:t,forceMount:n,children:P.Children.map(r,e=>(0,R.jsx)(Hr,{present:n||a.open,children:(0,R.jsx)(Qi,{asChild:!0,container:i,children:e})}))})};Mo.displayName=ko;var No=`DialogOverlay`,Po=P.forwardRef((e,t)=>{let n=jo(No,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=To(No,e.__scopeDialog);return a.modal?(0,R.jsx)(Hr,{present:r||a.open,children:(0,R.jsx)(Io,{...i,ref:t})}):null});Po.displayName=No;var Fo=Mr(`DialogOverlay.RemoveScroll`),Io=P.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=To(No,n);return(0,R.jsx)(uo,{as:Fo,allowPinchZoom:!0,shards:[i.contentRef],children:(0,R.jsx)(zr.div,{"data-state":Jo(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Lo=`DialogContent`,Ro=P.forwardRef((e,t)=>{let n=jo(Lo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=To(Lo,e.__scopeDialog);return(0,R.jsx)(Hr,{present:r||a.open,children:a.modal?(0,R.jsx)(zo,{...i,ref:t}):(0,R.jsx)(Bo,{...i,ref:t})})});Ro.displayName=Lo;var zo=P.forwardRef((e,t)=>{let n=To(Lo,e.__scopeDialog),r=P.useRef(null),i=ar(t,n.contentRef,r);return P.useEffect(()=>{let e=r.current;if(e)return bo(e)},[]),(0,R.jsx)(Vo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Sr(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Sr(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Sr(e.onFocusOutside,e=>e.preventDefault())})}),Bo=P.forwardRef((e,t)=>{let n=To(Lo,e.__scopeDialog),r=P.useRef(!1),i=P.useRef(!1);return(0,R.jsx)(Vo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Vo=P.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=To(Lo,n),c=P.useRef(null),l=ar(t,c);return ea(),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(zi,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(Oi,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Jo(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Qo,{titleId:s.titleId}),(0,R.jsx)(es,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Ho=`DialogTitle`,Uo=P.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=To(Ho,n);return(0,R.jsx)(zr.h2,{id:i.titleId,...r,ref:t})});Uo.displayName=Ho;var Wo=`DialogDescription`,Go=P.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=To(Wo,n);return(0,R.jsx)(zr.p,{id:i.descriptionId,...r,ref:t})});Go.displayName=Wo;var Ko=`DialogClose`,qo=P.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=To(Ko,n);return(0,R.jsx)(zr.button,{type:`button`,...r,ref:t,onClick:Sr(e.onClick,()=>i.onOpenChange(!1))})});qo.displayName=Ko;function Jo(e){return e?`open`:`closed`}var Yo=`DialogTitleWarning`,[Xo,Zo]=Cr(Yo,{contentName:Lo,titleName:Ho,docsSlug:`dialog`}),Qo=({titleId:e})=>{let t=Zo(Yo),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
50
+
51
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
52
+
53
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return P.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},$o=`DialogDescriptionWarning`,es=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Zo($o).contentName}}.`;return P.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},ts=Eo,ns=Oo,rs=Mo,is=Po,as=Ro,ss=Uo,cs=Go,ls=qo,us=ts,ds=yr(`fixed z-50 gap-4 bg-background p-6 shadow-lg`,{variants:{side:{top:`inset-x-0 top-0 border-b`,bottom:`inset-x-0 bottom-0 border-t`,left:`inset-y-0 left-0 h-full w-[280px] border-r`,right:`inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`}},defaultVariants:{side:`right`}}),fs=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(is,{className:L(`fixed inset-0 z-50 bg-black/80 animate-fade-in`,e),...t,ref:n}));fs.displayName=is.displayName;var ps=P.forwardRef(({side:e=`right`,className:t,children:n,noClose:r,...i},a)=>{let o=e===`bottom`?`animate-slide-in-bottom`:`animate-slide-in-right`;return(0,R.jsxs)(rs,{children:[(0,R.jsx)(fs,{}),(0,R.jsxs)(as,{ref:a,className:L(ds({side:e}),o,t),...i,children:[!r&&(0,R.jsxs)(ls,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,R.jsx)(Qe,{className:`size-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),n]})]})});ps.displayName=as.displayName;var ms=({className:e,...t})=>(0,R.jsx)(`div`,{className:L(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});ms.displayName=`SheetHeader`;var hs=({className:e,...t})=>(0,R.jsx)(`div`,{className:L(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});hs.displayName=`SheetFooter`;var gs=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(ss,{ref:n,className:L(`text-lg font-semibold text-foreground`,e),...t}));gs.displayName=ss.displayName;var _s=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(cs,{ref:n,className:L(`text-sm text-muted-foreground`,e),...t}));_s.displayName=cs.displayName;var vs=`AlertDialog`,[ys,bs]=wr(vs,[Co]),xs=Co(),Ss=e=>{let{__scopeAlertDialog:t,...n}=e,r=xs(t);return(0,R.jsx)(ts,{...r,...n,modal:!0})};Ss.displayName=vs;var Cs=`AlertDialogTrigger`,ws=P.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=xs(n);return(0,R.jsx)(ns,{...i,...r,ref:t})});ws.displayName=Cs;var Ts=`AlertDialogPortal`,Es=e=>{let{__scopeAlertDialog:t,...n}=e,r=xs(t);return(0,R.jsx)(rs,{...r,...n})};Es.displayName=Ts;var Ds=`AlertDialogOverlay`,Os=P.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=xs(n);return(0,R.jsx)(is,{...i,...r,ref:t})});Os.displayName=Ds;var ks=`AlertDialogContent`,[As,js]=ys(ks),Ms=Fr(`AlertDialogContent`),Ns=P.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=xs(n),o=P.useRef(null),s=ar(t,o),c=P.useRef(null);return(0,R.jsx)(Xo,{contentName:ks,titleName:Ps,docsSlug:`alert-dialog`,children:(0,R.jsx)(As,{scope:n,cancelRef:c,children:(0,R.jsxs)(as,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:Sr(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,R.jsx)(Ms,{children:r}),(0,R.jsx)(Hs,{contentRef:o})]})})})});Ns.displayName=ks;var Ps=`AlertDialogTitle`,Fs=P.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=xs(n);return(0,R.jsx)(ss,{...i,...r,ref:t})});Fs.displayName=Ps;var Is=`AlertDialogDescription`,Ls=P.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=xs(n);return(0,R.jsx)(cs,{...i,...r,ref:t})});Ls.displayName=Is;var Rs=`AlertDialogAction`,zs=P.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=xs(n);return(0,R.jsx)(ls,{...i,...r,ref:t})});zs.displayName=Rs;var Bs=`AlertDialogCancel`,Vs=P.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=js(Bs,n),a=xs(n),o=ar(t,i);return(0,R.jsx)(ls,{...a,...r,ref:o})});Vs.displayName=Bs;var Hs=({contentRef:e})=>{let t=`\`${ks}\` requires a description for the component to be accessible for screen reader users.
54
+
55
+ You can add a description to the \`${ks}\` by passing a \`${Is}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
56
+
57
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ks}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
58
+
59
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return P.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},Us=Ss,Ws=Es,Gs=Os,Ks=Ns,qs=zs,Js=Vs,Ys=Fs,Xs=Ls,Zs=Us,Qs=Ws,$s=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Gs,{className:L(`fixed inset-0 z-50 bg-black/80 animate-fade-in`,e),...t,ref:n}));$s.displayName=Gs.displayName;var ec=P.forwardRef(({className:e,...t},n)=>(0,R.jsxs)(Qs,{children:[(0,R.jsx)($s,{}),(0,R.jsx)(Ks,{ref:n,className:L(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 animate-zoom-in sm:rounded-lg`,e),...t})]}));ec.displayName=Ks.displayName;var tc=({className:e,...t})=>(0,R.jsx)(`div`,{className:L(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});tc.displayName=`AlertDialogHeader`;var nc=({className:e,...t})=>(0,R.jsx)(`div`,{className:L(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});nc.displayName=`AlertDialogFooter`;var rc=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Ys,{ref:n,className:L(`text-lg font-semibold`,e),...t}));rc.displayName=Ys.displayName;var ic=P.forwardRef(({className:e,id:t,...n},r)=>(0,R.jsx)(Xs,{ref:r,id:t,className:L(`text-sm text-muted-foreground`,e),...n}));ic.displayName=Xs.displayName;var ac=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(qs,{ref:n,className:L(br(),e),...t}));ac.displayName=qs.displayName;var oc=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Js,{ref:n,className:L(br({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));oc.displayName=Js.displayName;function sc({item:e,currentDir:t,onRenameRequest:n,onMoveRequest:r,onCopyRequest:i,onDelete:a,onCreateRequest:o}){let[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(!1),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(null);(0,P.useEffect)(()=>{let e=()=>f(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,P.useEffect)(()=>{c(!!e)},[e]);let h=()=>{c(!1)},g=()=>{u(!0)},_=()=>{e&&a(e.path,e.rootPath),u(!1),h()};if(!e)return null;let v=e.type===`directory`?e.path:t,y=()=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`flex justify-center pt-2.5 pb-1 md:hidden`,children:(0,R.jsx)(`div`,{className:`w-10 h-1 rounded-full bg-muted-foreground/25`})}),(0,R.jsx)(`div`,{className:`px-4 pt-1 pb-3 md:hidden`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-3 pt-3`,children:[(0,R.jsx)(`div`,{className:`size-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0`,children:e.type===`directory`?(0,R.jsx)(je,{className:`size-5 text-primary`}):(0,R.jsx)(Ee,{className:`size-5 text-primary`})}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium block truncate`,children:e.name}),(0,R.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.type===`directory`?`文件夹${e.childrenCount?` · ${e.childrenCount} 个项目`:``}`:`文件`})]})]})})]}),b=()=>(0,R.jsxs)(`div`,{className:`hidden md:flex items-center gap-3 px-4 py-3 border-b border-border`,children:[(0,R.jsx)(`div`,{className:`size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0`,children:e.type===`directory`?(0,R.jsx)(je,{className:`size-4 text-primary`}):(0,R.jsx)(Ee,{className:`size-4 text-primary`})}),(0,R.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,R.jsx)(`span`,{className:`text-sm font-medium block truncate`,children:e.name})})]}),x=[{icon:He,label:`重命名`,color:`bg-blue-500/10 text-blue-600 dark:text-blue-400`,onClick:()=>{n(e),h()}},{icon:Oe,label:`移动到`,color:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,onClick:()=>{r(e),h()}},{icon:Ce,label:`复制到`,color:`bg-purple-500/10 text-purple-600 dark:text-purple-400`,onClick:()=>{i?.(e),h()}}];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(us,{open:s,onOpenChange:h,children:(0,R.jsxs)(ps,{side:d?`bottom`:`right`,className:L(`p-0`,!d&&`w-[280px] sm:w-[300px]`),noClose:!0,children:[(0,R.jsx)(y,{}),(0,R.jsx)(b,{}),(0,R.jsxs)(`div`,{className:`px-3 py-2 flex gap-2`,children:[(0,R.jsxs)(`button`,{className:`flex-1 flex items-center justify-center gap-1.5 py-2 rounded-lg bg-primary text-primary-foreground text-xs font-medium hover:bg-primary/90 transition-colors shadow-sm`,onClick:()=>{o?.(!1,v),h()},children:[(0,R.jsx)(We,{className:`size-3.5`}),`新建文件`]}),(0,R.jsxs)(`button`,{className:`flex-1 flex items-center justify-center gap-1.5 py-2 rounded-lg bg-muted text-foreground text-xs font-medium hover:bg-muted/80 transition-colors border border-border`,onClick:()=>{o?.(!0,v),h()},children:[(0,R.jsx)(We,{className:`size-3.5`}),`新建文件夹`]})]}),(0,R.jsx)(`div`,{className:`px-3 pb-1.5 space-y-1.5`,children:x.map((e,t)=>(0,R.jsxs)(`button`,{onMouseEnter:()=>m(t),onMouseLeave:()=>m(null),onClick:e.onClick,className:L(`flex items-center gap-3 w-full px-3 py-2.5 rounded-xl text-sm transition-all`,p===t?`bg-muted shadow-sm scale-[1.01]`:`bg-card border border-border/60`),children:[(0,R.jsx)(`div`,{className:L(`size-7 rounded-lg flex items-center justify-center shrink-0`,e.color),children:(0,R.jsx)(e.icon,{className:`size-4`})}),(0,R.jsx)(`span`,{children:e.label})]},t))}),(0,R.jsx)(`div`,{className:`px-3 pb-4`,children:(0,R.jsxs)(`button`,{onClick:g,className:`flex items-center gap-3 w-full px-3 py-2.5 rounded-xl text-sm text-destructive bg-destructive/5 border border-destructive/10 hover:bg-destructive/10 transition-colors`,children:[(0,R.jsx)(`div`,{className:`size-7 rounded-lg bg-destructive/10 flex items-center justify-center shrink-0`,children:(0,R.jsx)(Ze,{className:`size-4`})}),(0,R.jsxs)(`span`,{children:[`删除`,e.type===`directory`?`此文件夹`:`此文件`]})]})})]})}),(0,R.jsx)(Zs,{open:l,onOpenChange:u,children:(0,R.jsxs)(ec,{children:[(0,R.jsxs)(tc,{children:[(0,R.jsx)(rc,{children:`确认删除`}),(0,R.jsx)(ic,{children:e.type===`directory`&&e.childrenCount&&e.childrenCount>0?(0,R.jsxs)(`span`,{className:`text-destructive font-medium`,children:[`文件夹「`,e.name,`」包含 `,e.childrenCount,` 个项目,删除后将全部删除且无法恢复。确定要继续吗?`]}):(0,R.jsxs)(R.Fragment,{children:[`确定要删除「`,e.name,`」吗?此操作无法撤销。`]})})]}),(0,R.jsxs)(nc,{children:[(0,R.jsx)(oc,{children:`取消`}),(0,R.jsx)(ac,{onClick:_,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:`删除`})]})]})})]})}var cc=(0,P.memo)(function e({node:t,activePath:n,expandedPaths:r,setExpandedPaths:i,onSelect:a,onDelete:o,onRenameRequest:s,onMoveRequest:c,onCopyRequest:l,onExpand:u,editingType:d,onEditingChange:f,onCreateSubmit:p,onCreateRequest:m,currentDir:h,activeRoot:g}){let[_,v]=(0,P.useState)(``),[y,b]=(0,P.useState)(null),x=(0,P.useRef)(null),S=t.type===`directory`,C=t.path===n&&t.rootPath===g,w=r.has(t.path);S&&t.children&&t.children.length;let T=t.children?.length||0;(0,P.useEffect)(()=>{d&&t.path===h&&(d===`file`?v(`.md`):_===`.md`&&v(``),setTimeout(()=>{x.current?.focus(),d===`file`&&x.current?.setSelectionRange(0,0)},50))},[d,h]);let E=()=>{_.trim()&&p&&(p(_.trim(),d===`directory`),v(``),f?.(null))};return S?(0,R.jsx)(gi,{className:`sidebar-menu-item`,children:(0,R.jsxs)(li,{className:`group/collapsible`,open:w,onOpenChange:e=>{e&&u&&u(t.path),i(n=>{let r=new Set(n);return e?r.add(t.path):r.delete(t.path),r})},children:[(0,R.jsxs)(`div`,{className:`flex items-center relative`,children:[(0,R.jsx)(ui,{asChild:!0,children:(0,R.jsxs)(vi,{isActive:C,className:`data-[active=true]:bg-transparent flex-1 pr-8`,children:[(0,R.jsx)(ve,{className:L(`size-4 shrink-0 transition-transform`,w&&`rotate-90`)}),(0,R.jsx)(je,{className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:t.name})]})}),(0,R.jsx)(`button`,{"data-sidebar":`menu-action`,onClick:()=>b({path:t.path,name:t.name,type:`directory`,rootPath:t.rootPath,childrenCount:T}),className:`sidebar-menu-item-action absolute right-1 top-1/2 -translate-y-1/2 size-6 flex items-center justify-center rounded-md hover:bg-accent z-10`,children:(0,R.jsx)(we,{className:`size-3.5`})})]}),(0,R.jsx)(sc,{item:y,currentDir:h,onRenameRequest:s,onMoveRequest:c,onCopyRequest:l,onDelete:o,onCreateRequest:m}),(0,R.jsx)(di,{children:(0,R.jsxs)(yi,{children:[t.children?.map(t=>(0,R.jsx)(e,{node:t,activePath:n,expandedPaths:r,setExpandedPaths:i,onSelect:a,onDelete:o,onRenameRequest:s,onMoveRequest:c,onCopyRequest:l,onExpand:u,editingType:d,onEditingChange:f,onCreateSubmit:p,onCreateRequest:m,currentDir:h,activeRoot:g},t.path)),d&&t.path===h&&(0,R.jsx)(gi,{className:`px-2`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[d===`directory`?(0,R.jsx)(je,{className:`size-4 shrink-0 text-muted-foreground`}):(0,R.jsx)(Ee,{className:`size-4 shrink-0 text-muted-foreground`}),(0,R.jsx)(nr,{ref:x,id:`create-input-${t.path}`,placeholder:d===`directory`?`文件夹名称`:`文件名称,如 note.md`,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`?E():e.key===`Escape`&&(v(``),f?.(null))},onBlur:()=>{_.trim()&&p?E():(v(``),f?.(null))},className:`h-7 text-sm`,autoFocus:!0})]})})]})})]})}):(0,R.jsxs)(gi,{className:`sidebar-menu-item`,children:[(0,R.jsxs)(vi,{isActive:C,className:`data-[active=true]:bg-sidebar-accent pr-8`,onClick:()=>a(t.path,`file`,g||void 0),children:[(0,R.jsx)(De,{className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`flex-1 whitespace-nowrap`,children:t.name})]}),(0,R.jsx)(`button`,{"data-sidebar":`menu-action`,onClick:e=>{e.stopPropagation(),b({path:t.path,name:t.name,type:`file`,rootPath:t.rootPath})},className:`sidebar-menu-item-action absolute right-1 top-1/2 -translate-y-1/2 size-6 flex items-center justify-center rounded-md hover:bg-accent z-10`,children:(0,R.jsx)(we,{className:`size-3.5`})}),(0,R.jsx)(sc,{item:y,currentDir:h,onRenameRequest:s,onMoveRequest:c,onCopyRequest:l,onDelete:o,onCreateRequest:m})]})}),lc=(0,P.memo)(({activeRoot:e,onCreateRequest:t,onEditDir:n})=>{let r=e?.split(`/`).pop()||`根目录`,[i,a]=(0,P.useState)(null);return(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-center p-6`,children:[(0,R.jsx)(`div`,{className:`mb-5 relative`,children:(0,R.jsxs)(`div`,{className:L(`size-16 rounded-xl flex items-center justify-center transition-colors duration-300`,i===`file`?`bg-primary/10`:i===`folder`?`bg-orange-500/10`:`bg-muted`),children:[i===`file`&&(0,R.jsx)(Ee,{className:`size-8 text-primary`}),i===`folder`&&(0,R.jsx)(je,{className:`size-8 text-orange-500`}),!i&&(0,R.jsx)(ke,{className:`size-8 text-muted-foreground/40`})]})}),(0,R.jsx)(`h3`,{className:`text-base font-semibold text-foreground mb-1.5`,children:`这个目录是空的`}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground mb-6 max-w-[220px]`,children:[`「`,r,`」里还没有任何内容,选择下面的操作来开始吧`]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 w-full max-w-[200px]`,children:[(0,R.jsxs)(xr,{size:`sm`,className:`w-full justify-between text-xs`,onMouseEnter:()=>a(`file`),onMouseLeave:()=>a(null),onClick:()=>t?.(!1,``),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Te,{className:`size-4`}),`新建 Markdown 文件`]}),(0,R.jsx)(pe,{className:`size-3.5 opacity-70`})]}),(0,R.jsxs)(xr,{variant:`secondary`,size:`sm`,className:`w-full justify-start text-xs`,onMouseEnter:()=>a(`folder`),onMouseLeave:()=>a(null),onClick:()=>t?.(!0,``),children:[(0,R.jsx)(Ae,{className:`size-4 mr-2`}),`新建文件夹`]}),(0,R.jsx)(`button`,{className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors mt-1`,onClick:()=>n?.(),children:`或者,打开目录设置`})]})]})}),uc=(0,P.memo)(function({files:e,activePath:t,activeRoot:n,currentDir:r,expandedPaths:i,setExpandedPaths:a,onSelect:o,onDelete:s,onRenameRequest:c,onMoveRequest:l,onCopyRequest:u,onExpand:d,editingType:f,onEditingChange:p,onCreateSubmit:m,onCreateRequest:h,onEditDir:g,onGitCommitRequest:_}){let[v,y]=(0,P.useState)(``),[b,x]=(0,P.useState)(!1),S=(0,P.useRef)(null);(0,P.useEffect)(()=>{if(!n){x(!1);return}let e=!1,t=()=>{fetch(`/api/files/git/status?root=${encodeURIComponent(n)}`).then(e=>e.json()).then(t=>{e||x(t.isGitRepo&&t.files?.length>0)}).catch(()=>{e||x(!1)})};t();let r=setInterval(t,5e3),i=e=>{let r=e.detail;(!r?.rootPath||r.rootPath===n)&&t()};return window.addEventListener(`git-commit-success`,i),()=>{e=!0,clearInterval(r),window.removeEventListener(`git-commit-success`,i)}},[n]),(0,P.useEffect)(()=>{f&&(f===`file`?y(`.md`):v===`.md`&&y(``),setTimeout(()=>{S.current?.focus(),f===`file`&&S.current?.setSelectionRange(0,0)},50))},[f]);let C=()=>{v.trim()&&m&&(m(v.trim(),f===`directory`),y(``),p&&p(null))},w=e=>{e.key===`Enter`?C():e.key===`Escape`&&(y(``),p&&p(null))},T=()=>{v.trim()&&m?C():(y(``),p&&p(null))},E=r?r.split(`/`).filter(Boolean).join(` / `):`根目录`;return e.length===0&&!f?(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,R.jsx)(lc,{activeRoot:n,onCreateRequest:h,onEditDir:g})}):(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto overflow-x-auto`,children:(0,R.jsxs)(`div`,{className:`min-w-max`,children:[(0,R.jsxs)(fi,{children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,R.jsx)(pi,{children:`Files`}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>h?.(!1,``),title:`新建文件`,children:(0,R.jsx)(Ee,{className:`size-4`})}),(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>h?.(!0,``),title:`新建文件夹`,children:(0,R.jsx)(je,{className:`size-4`})}),(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>g?.(),title:`目录设置`,children:(0,R.jsx)(He,{className:`size-4`})}),b&&(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,className:`size-6`,onClick:()=>_?.(),title:`Git 提交`,children:(0,R.jsx)(Me,{className:`size-4`})})]})]}),(0,R.jsx)(mi,{children:(0,R.jsxs)(hi,{children:[e.map(e=>(0,R.jsx)(cc,{node:e,activePath:t,expandedPaths:i,setExpandedPaths:a,onSelect:o,onDelete:s,onRenameRequest:c,onMoveRequest:l,onCopyRequest:u,onExpand:d,editingType:f,onEditingChange:p,onCreateSubmit:m,onCreateRequest:h,currentDir:r,activeRoot:n},e.path)),f&&(r===``||r===`/`)&&(0,R.jsx)(gi,{className:`sidebar-menu-item`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 w-full`,children:[f===`directory`?(0,R.jsx)(je,{className:`size-4 shrink-0 text-muted-foreground`}):(0,R.jsx)(Ee,{className:`size-4 shrink-0 text-muted-foreground`}),(0,R.jsx)(nr,{ref:S,id:`root-create-input`,placeholder:f===`directory`?`文件夹名称`:`文件名称,如 note.md`,value:v,onChange:e=>y(e.target.value),onKeyDown:w,onBlur:T,className:`h-7 text-sm`,autoFocus:!0})]})})]})})]}),f&&(0,R.jsxs)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground border-t`,children:[`位置: `,E]})]})})}),dc=n((e=>{var t=j();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),fc=n(((e,t)=>{t.exports=dc()})),pc=fc();function mc(e){this.content=e}mc.prototype={constructor:mc,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new mc(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new mc(n)},addToStart:function(e,t){return new mc([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new mc(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new mc(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=mc.from(e),e.size?new mc(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=mc.from(e),e.size?new mc(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=mc.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},mc.from=function(e){if(e instanceof mc)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new mc(t)};function hc(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=hc(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function gc(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=gc(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var z=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return hc(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return gc(this,e,t,n)}findIndex(e){if(e==0)return vc(0,e);if(e==this.size)return vc(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?vc(t+1,i):vc(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};z.empty=new z([],0);var _c={index:0,offset:0};function vc(e,t){return _c.index=e,_c.offset=t,_c}function yc(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!yc(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!yc(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var bc=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&yc(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};bc.none=[];var xc=class extends Error{},B=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Cc(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Sc(this.content,t+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(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(z.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};B.empty=new B(z.empty,0,0);function Sc(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Sc(a.content,t-i-1,n-i-1)))}function Cc(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Cc(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function V(e,t,n){if(n.openStart>e.depth)throw new xc(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new xc(`Inconsistent open depths`);return wc(e,t,n,0)}function wc(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=wc(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return kc(a,jc(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return kc(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Mc(n,e);return kc(a,Ac(e,i,o,t,r))}}function Tc(e,t){if(!t.type.compatibleContent(e.type))throw new xc(`Cannot join `+t.type.name+` onto `+e.type.name)}function Ec(e,t,n){let r=e.node(n);return Tc(r,t.node(n)),r}function Dc(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Oc(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Dc(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Dc(i.child(e),r);t&&t.depth==n&&t.textOffset&&Dc(t.nodeBefore,r)}function kc(e,t){return e.type.checkContent(t),e.copy(t)}function Ac(e,t,n,r,i){let a=e.depth>i&&Ec(e,t,i+1),o=r.depth>i&&Ec(n,r,i+1),s=[];return Oc(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Tc(a,o),Dc(kc(a,Ac(e,t,n,r,i+1)),s)):(a&&Dc(kc(a,jc(e,t,i+1)),s),Oc(t,n,i,s),o&&Dc(kc(o,jc(n,r,i+1)),s)),Oc(r,null,i,s),new z(s)}function jc(e,t,n){let r=[];return Oc(null,e,n,r),e.depth>n&&Dc(kc(Ec(e,t,n+1),jc(e,t,n+1)),r),Oc(t,null,n,r),new z(r)}function Mc(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(z.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Nc=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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 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 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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return bc.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Lc(this,e,n);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<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Ic.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Ic.set(t,r=new Pc);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Fc,i}},Pc=class{constructor(){this.elts=[],this.i=0}},Fc=12,Ic=new WeakMap,Lc=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Rc=Object.create(null),zc=class e{constructor(e,t,n,r=bc.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&yc(this.attrs,t||e.defaultAttrs||Rc)&&bc.sameSet(this.marks,n||bc.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return B.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new B(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return V(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Nc.resolveCached(this,e)}resolveNoCache(e){return Nc.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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()+`)`),Vc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=z.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=bc.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!bc.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t 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(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=z.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};zc.prototype.text=void 0;var Bc=class e extends zc{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Vc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Vc(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Hc=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Uc(t,n);if(r.next==null)return e.empty;let i=Wc(r);r.next&&r.err(`Unexpected trailing text`);let a=el(Zc(i));return tl(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return z.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
60
+ `)}};Hc.empty=new Hc(!0);var Uc=class{constructor(e,t){this.string=e,this.nodeTypes=t,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 SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Wc(e){let t=[];do t.push(Gc(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Gc(e){let t=[];do t.push(Kc(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Kc(e){let t=Xc(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Jc(e,t);else break;return t}function qc(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Jc(e,t){let n=qc(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:qc(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Yc(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Xc(e){if(e.eat(`(`)){let t=Wc(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Yc(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Zc(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Qc(e,t){return t-e}function $c(e,t){let n=[];return r(t),n.sort(Qc);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function el(e){let t=Object.create(null);return n($c(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);$c(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Hc(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Qc);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function tl(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function nl(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function rl(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function il(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function al(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new cl(e,r,t[r]);return n}var ol=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=al(e,n.attrs),this.defaultAttrs=nl(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Hc.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:rl(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new zc(this,this.computeAttrs(e),z.from(t),bc.setFrom(n))}createChecked(e=null,t,n){return t=z.from(t),this.checkContent(t),new zc(this,this.computeAttrs(e),t,bc.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=z.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(z.empty,!0);return i?new zc(this,e,t.append(i),bc.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){il(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:bc.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function sl(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var cl=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?sl(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},ll=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=al(e,r.attrs),this.excluded=null;let i=nl(this.attrs);this.instance=i?new bc(this,i):null}create(e=null){return!e&&this.instance?this.instance:new bc(this,rl(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){il(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},ul=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=mc.from(e.nodes),t.marks=mc.from(e.marks||{}),this.nodes=ol.compile(this.spec.nodes,this),this.marks=ll.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Hc.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?dl(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:dl(this,n.split(` `))}this.nodeFromJSON=e=>zc.fromJSON(this,e),this.markFromJSON=e=>bc.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof ol))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Bc(n,n.defaultAttrs,e,bc.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function dl(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function fl(e){return e.tag!=null}function pl(e){return e.style!=null}var ml=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(fl(e))this.tags.push(e);else if(pl(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Cl(this,t,!1);return n.addAll(e,bc.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Cl(this,t,!0);return n.addAll(e,bc.none,t.from,t.to),B.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Tl(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=El(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=El(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},hl={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},gl={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_l={ol:!0,ul:!0},vl=1,yl=2,bl=4;function xl(e,t,n){return t==null?e&&e.whitespace==`pre`?vl|yl:n&~bl:(t?vl:0)|(t===`full`?yl:0)}var Sl=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=bc.none,this.match=i||(a&bl?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(z.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&vl)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(z.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!hl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Cl=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=xl(null,t.preserveWhitespace,0)|(n?bl:0);i=r?new Sl(r.type,r.attrs,bc.none,!0,t.topMatch||r.type.contentMatch,a):n?new Sl(null,null,bc.none,!0,null,a):new Sl(e.schema.topNodeType,null,bc.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&yl?`full`:this.localPreserveWS||(r.options&vl)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
61
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;_l.hasOwnProperty(a)&&this.parser.normalizeLists&&wl(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:gl.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(hl.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
62
+ `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=bc.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Dl(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=xl(e,i,a.options);a.options&bl&&a.content.length==0&&(o|=bl);let s=bc.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):Dl(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new Sl(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=vl);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function wl(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&_l.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Tl(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function El(e){let t={};for(let n in e)t[n]=e[n];return t}function Dl(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Ol=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Al(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Pl(Al(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Pl(Al(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Pl(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=kl(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return kl(e.marks)}};function kl(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Al(e){return e.document||window.document}var jl=new WeakMap;function Ml(e){let t=jl.get(e);return t===void 0&&jl.set(e,t=Nl(e)),t}function Nl(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function Pl(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Ml(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=Pl(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Fl=65535,Il=2**16;function Ll(e,t){return e+t*Il}function Rl(e){return e&Fl}function zl(e){return(e-(e&Fl))/Il}var Bl=1,Vl=2,Hl=4,Ul=8,Wl=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Ul)>0}get deletedBefore(){return(this.delInfo&(Bl|Hl))>0}get deletedAfter(){return(this.delInfo&(Vl|Hl))>0}get deletedAcross(){return(this.delInfo&Hl)>0}},Gl=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Rl(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+zl(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Ll(o/3,e-s),f=e==s?Vl:e==u?Bl:Hl;return(t<0?e!=s:e!=u)&&(f|=Ul),new Wl(a,f,d)}r+=l-c}return n?e+r:new Wl(e+r,0,null)}touches(e,t){let n=0,r=Rl(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Gl.empty=new Gl([]);var Kl=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Wl(e,r,null)}},ql=Object.create(null),Jl=class{getMap(){return Gl.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=ql[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ql)throw RangeError(`Duplicate use of step JSON ID `+e);return ql[e]=t,t.prototype.jsonID=e,t}},Yl=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof xc)return e.fail(t.message);throw t}}};function Xl(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Xl(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return z.fromArray(r)}var Zl=class e extends Jl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new B(Xl(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Yl.fromReplace(e,this.from,this.to,i)}invert(){return new Ql(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Jl.jsonID(`addMark`,Zl);var Ql=class e extends Jl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new B(Xl(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Yl.fromReplace(e,this.from,this.to,n)}invert(){return new Zl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Jl.jsonID(`removeMark`,Ql);var $l=class e extends Jl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Yl.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Yl.fromReplace(e,this.pos,this.pos+1,new B(z.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new eu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Jl.jsonID(`addNodeMark`,$l);var eu=class e extends Jl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Yl.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Yl.fromReplace(e,this.pos,this.pos+1,new B(z.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new $l(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Jl.jsonID(`removeNodeMark`,eu);var tu=class e extends Jl{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&ru(e,this.from,this.to)?Yl.fail(`Structure replace would overwrite content`):Yl.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Gl([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?B.empty:new B(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?B.empty:new B(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,B.fromJSON(t,n.slice),!!n.structure)}};tu.MAP_BIAS=1,Jl.jsonID(`replace`,tu);var nu=class e extends Jl{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(ru(e,this.from,this.gapFrom)||ru(e,this.gapTo,this.to)))return Yl.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Yl.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Yl.fromReplace(e,this.from,this.to,n):Yl.fail(`Content does not fit in gap`)}getMap(){return new Gl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,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(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,B.fromJSON(t,n.slice),n.insert,!!n.structure)}};Jl.jsonID(`replaceAround`,nu);function ru(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function iu(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Ql(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Zl(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function au(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof ll){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Ql(t.from,t.to,t.style)))}function ou(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new tu(s,l,B.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Ql(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new B(z.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new tu(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(z.empty,!0);e.replace(s,s,new B(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function su(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function cu(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!su(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function lu(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=z.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=z.from(r.node(e).copy(u)),d++):c--;let f=z.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=z.from(i.node(e).copy(f)),p++):l++;e.step(new nu(c,l,o,s,new B(u.append(f),d,p),u.size-d,!0))}function uu(e,t,n=null,r=e){let i=fu(e,t),a=i&&pu(r,t);return a?i.map(du).concat({type:t,attrs:n}).concat(a.map(du)):null}function du(e){return{type:e,attrs:null}}function fu(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function pu(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function mu(e,t,n){let r=z.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=z.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new nu(i,a,i,a,new B(r,0,0),n.length,!0))}function hu(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&vu(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&_u(e,t,n,a),ou(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new nu(c,l,c+1,l-1,new B(z.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&gu(e,t,n,a),!1}})}function gu(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function _u(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
63
+ `))}})}function vu(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function yu(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new nu(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new B(z.from(o),0,0),1,!0))}function bu(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function xu(e,t,n=1,r){let i=e.doc.resolve(t),a=z.empty,o=z.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=z.from(i.node(e).copy(a));let t=r&&r[s];o=z.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new tu(t,t,new B(a.append(o),n,n),!0))}function Su(e,t){let n=e.resolve(t),r=n.index();return wu(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Cu(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function wu(e,t){return!!(e&&t&&!e.isLeaf&&Cu(e,t))}function Tu(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&wu(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Eu(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);_u(e,r.node(),r.before(),s)}o.inlineContent&&ou(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new tu(l,c.map(t+n,-1),B.empty,!0)),r===!0){let t=e.doc.resolve(l);gu(e,t.node(),t.before(),e.steps.length)}return e}function Du(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Ou(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function ku(e,t,n=t,r=B.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Au(i,a,r)?new tu(t,n,r):new ju(i,a,r).fit()}function Au(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var ju=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=z.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=z.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new B(i,a,o);return e>-1?new nu(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new tu(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Pu(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(z.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Pu(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new B(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Pu(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new B(Mu(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new B(Mu(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Fu(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Nu(this.placed,t,z.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?B.empty:new B(Mu(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new B(Mu(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Iu(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Iu(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Iu(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Nu(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Nu(this.placed,this.depth,z.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(z.empty,!0);e.childCount&&(this.placed=Nu(this.placed,this.frontier.length,e))}};function Mu(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Mu(e.firstChild.content,t-1,n)))}function Nu(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Nu(e.lastChild.content,t-1,n)))}function Pu(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Fu(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Fu(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(z.empty,!0)))),e.copy(r)}function Iu(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Lu(n,a.content,o)?s:null}function Lu(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Ru(e){return e.spec.defining||e.spec.definingForContent}function zu(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Au(i,a,r))return e.step(new tu(t,n,r));let o=Uu(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Ru(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new B(Bu(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Bu(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Bu(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(z.empty,!0))}return e}function Vu(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Du(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new B(z.from(r),0,0))}function Hu(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Uu(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Uu(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Wu=class e extends Jl{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Yl.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Yl.fromReplace(e,this.pos,this.pos+1,new B(z.from(r),0,+!t.isLeaf))}getMap(){return Gl.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};Jl.jsonID(`attr`,Wu);var Gu=class e extends Jl{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Yl.ok(n)}getMap(){return Gl.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};Jl.jsonID(`docAttr`,Gu);var Ku=class extends Error{};Ku=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Ku.prototype=Object.create(Error.prototype),Ku.prototype.constructor=Ku,Ku.prototype.name=`TransformError`;var qu=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Kl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ku(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=B.empty){let r=ku(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new B(z.from(n),0,0))}delete(e,t){return this.replace(e,t,B.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return zu(this,e,t,n),this}replaceRangeWith(e,t,n){return Vu(this,e,t,n),this}deleteRange(e,t){return Hu(this,e,t),this}lift(e,t){return lu(this,e,t),this}join(e,t=1){return Eu(this,e,t),this}wrap(e,t){return mu(this,e,t),this}setBlockType(e,t=e,n,r=null){return hu(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return yu(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Wu(e,t,n)),this}setDocAttribute(e,t){return this.step(new Gu(e,t)),this}addNodeMark(e,t){return this.step(new $l(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof bc)t.isInSet(n.marks)&&this.step(new eu(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new eu(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return xu(this,e,t,n),this}addMark(e,t,n){return iu(this,e,t,n),this}removeMark(e,t,n){return au(this,e,t,n),this}clearIncompatible(e,t,n){return ou(this,e,t,n),this}},Ju=Object.create(null),Yu=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Xu(e.min(t),e.max(t))]}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 t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=B.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?B.empty:t),o==0&&od(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),od(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new $u(e):ad(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?ad(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):ad(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new rd(e.node(0))}static atStart(e){return ad(e,e,0,0,1)||new rd(e)}static atEnd(e){return ad(e,e,e.content.size,e.childCount,-1)||new rd(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Ju[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Ju)throw RangeError(`Duplicate use of selection JSON ID `+e);return Ju[e]=t,t.prototype.jsonID=e,t}getBookmark(){return $u.between(this.$anchor,this.$head).getBookmark()}};Yu.prototype.visible=!0;var Xu=class{constructor(e,t){this.$from=e,this.$to=t}},Zu=!1;function Qu(e){!Zu&&!e.parent.inlineContent&&(Zu=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var $u=class e extends Yu{constructor(e,t=e){Qu(e),Qu(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Yu.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=B.empty){if(super.replace(e,t),t==B.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new ed(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=Yu.findFrom(n,r,!0)||Yu.findFrom(n,-r,!0);if(e)n=e.$head;else return Yu.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Yu.findFrom(t,-r,!0)||Yu.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};Yu.jsonID(`text`,$u);var ed=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return $u.between(e.resolve(this.anchor),e.resolve(this.head))}},td=class e extends Yu{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?Yu.near(a):new e(a)}content(){return new B(z.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new nd(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};td.prototype.visible=!1,Yu.jsonID(`node`,td);var nd=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new ed(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&td.isSelectable(n)?new td(t):Yu.near(t)}},rd=class e extends Yu{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=B.empty){if(t==B.empty){e.delete(0,e.doc.content.size);let t=Yu.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return id}};Yu.jsonID(`all`,rd);var id={map(){return this},resolve(e){return new rd(e)}};function ad(e,t,n,r,i,a=!1){if(t.inlineContent)return $u.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=ad(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&td.isSelectable(r))return td.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function od(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof tu||i instanceof nu))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(Yu.near(e.doc.resolve(o),n))}var sd=1,cd=2,ld=4,ud=class extends qu{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.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|sd)&~cd,this.storedMarks=null,this}get selectionSet(){return(this.updated&sd)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=cd,this}ensureMarks(e){return bc.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&cd)>0}addStep(e,t){super.addStep(e,t),this.updated&=~cd,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||bc.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(Yu.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,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|=ld,this}get scrolledIntoView(){return(this.updated&ld)>0}};function dd(e,t){return!t||!e?e:e.bind(t)}var fd=class{constructor(e,t,n){this.name=e,this.init=dd(t.init,n),this.apply=dd(t.apply,n)}},eee=[new fd(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new fd(`selection`,{init(e,t){return e.selection||Yu.atStart(t.doc)},apply(e){return e.selection}}),new fd(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new fd(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],pd=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=eee.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new fd(e.key,e.spec.state,e))})}},tee=class e{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,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new ud(this)}static create(t){let n=new pd(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new pd(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new pd(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=zc.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=Yu.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function md(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=md(i,t,{})),n[r]=i}return n}var hd=class{constructor(e){this.spec=e,this.props={},e.props&&md(e.props,this,this.props),this.key=e.key?e.key.key:_d(`plugin`)}getState(e){return e[this.key]}},gd=Object.create(null);function _d(e){return e in gd?e+`$`+ ++gd[e]:(gd[e]=0,e+`$`)}var vd=class{constructor(e=`key`){this.key=_d(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},yd=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function bd(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var xd=(e,t,n)=>{let r=bd(e,n);if(!r)return!1;let i=Ed(r);if(!i){let n=r.blockRange(),i=n&&cu(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Wd(e,i,t,-1))return!0;if(r.parent.content.size==0&&(wd(a,`end`)||td.isSelectable(a)))for(let n=r.depth;;n--){let o=ku(e.doc,r.before(n),r.after(n),B.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(wd(a,`end`)?Yu.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):td.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Sd=(e,t,n)=>{let r=bd(e,n);if(!r)return!1;let i=Ed(r);return i?Cd(e,i,t):!1},nee=(e,t,n)=>{let r=Dd(e,n);if(!r)return!1;let i=Ad(r);return i?Cd(e,i,t):!1};function Cd(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=ku(e.doc,i,o,B.empty);if(!s||s.from!=i||s instanceof tu&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection($u.create(t.doc,i)),n(t.scrollIntoView())}return!0}function wd(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Td=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Ed(r)}let o=a&&a.nodeBefore;return!o||!td.isSelectable(o)?!1:(t&&t(e.tr.setSelection(td.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Ed(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Dd(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Od=(e,t,n)=>{let r=Dd(e,n);if(!r)return!1;let i=Ad(r);if(!i)return!1;let a=i.nodeAfter;if(Wd(e,i,t,1))return!0;if(r.parent.content.size==0&&(wd(a,`start`)||td.isSelectable(a))){let n=ku(e.doc,r.before(),r.after(),B.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(wd(a,`start`)?Yu.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):td.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},kd=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Ad(r)}let o=a&&a.nodeAfter;return!o||!td.isSelectable(o)?!1:(t&&t(e.tr.setSelection(td.create(e.doc,a.pos)).scrollIntoView()),!0)};function Ad(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var jd=(e,t)=>{let n=e.selection,r=n instanceof td,i;if(r){if(n.node.isTextblock||!Su(e.doc,n.from))return!1;i=n.from}else if(i=Tu(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(td.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Md=(e,t)=>{let n=e.selection,r;if(n instanceof td){if(n.node.isTextblock||!Su(e.doc,n.to))return!1;r=n.to}else if(r=Tu(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Nd=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&cu(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Pd=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
64
+ `).scrollIntoView()),!0)};function Fd(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Id=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=Fd(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(Yu.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Ld=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof rd||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Fd(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection($u.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},Rd=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(bu(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&cu(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function zd(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof td&&t.selection.node.isBlock)return!r.parentOffset||!bu(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=Fd(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof $u||t.selection instanceof rd)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=bu(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,bu(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var Bd=zd(),Vd=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(td.create(e.doc,i))),!0)},Hd=(e,t)=>(t&&t(e.tr.setSelection(new rd(e.doc))),!0);function Ud(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Su(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Wd(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Ud(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=z.empty;for(let e=o.length-1;e>=0;e--)s=z.from(o[e].create(null,s));s=z.from(i.copy(s));let c=e.tr.step(new nu(t.pos-1,r,t.pos,r,new B(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Su(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:Yu.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&cu(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&wd(a,`start`,!0)&&wd(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=z.empty;for(let e=o.length-1;e>=0;e--)r=z.from(o[e].copy(r));n(e.tr.step(new nu(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new B(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Gd(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection($u.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Kd=Gd(-1),qd=Gd(1);function Jd(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&uu(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Yd(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Xd(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var Zd=Xd(yd,xd,Td),Qd=Xd(yd,Od,kd),$d={Enter:Xd(Pd,Ld,Rd,Bd),"Mod-Enter":Id,Backspace:Zd,"Mod-Backspace":Zd,"Shift-Backspace":Zd,Delete:Qd,"Mod-Delete":Qd,"Mod-a":Hd},ef={"Ctrl-h":$d.Backspace,"Alt-Backspace":$d[`Mod-Backspace`],"Ctrl-d":$d.Delete,"Ctrl-Alt-Backspace":$d[`Mod-Delete`],"Alt-Delete":$d[`Mod-Delete`],"Alt-d":$d[`Mod-Delete`],"Ctrl-a":Kd,"Ctrl-e":qd};for(let e in $d)ef[e]=$d[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function tf(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return nf(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function nf(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Lc(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Lc(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=uu(a,n,r,t);return s?(e&&rf(e,t,s,i,n),!0):!1}function rf(e,t,n,r,i){let a=z.empty;for(let e=n.length-1;e>=0;e--)a=z.from(n[e].type.create(n[e].attrs,a));e.step(new nu(t.start-(r?2:0),t.end,t.start,t.end,new B(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&bu(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function af(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?of(t,n,e,a):sf(t,n,a):!0:!1}}function of(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new nu(a-1,o,a,o,new B(z.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Lc(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=cu(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Su(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function sf(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?z.empty:z.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new nu(d-+!!s,f+ +!!c,d+1,f-1,new B((s?z.empty:z.from(i.copy(z.empty))).append(c?z.empty:z.from(i.copy(z.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function cf(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=z.from(r?e.create():null),o=new B(z.from(e.create(null,z.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new nu(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var lf=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},uf=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},df=null,ff=function(e,t,n){let r=df||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},pf=function(){df=null},mf=function(e,t,n,r){return n&&(gf(e,t,n,r,-1)||gf(e,t,n,r,1))},hf=/^(img|br|input|textarea|hr)$/i;function gf(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:_f(e))){let n=e.parentNode;if(!n||n.nodeType!=1||vf(e)||hf.test(e.nodeName)||e.contentEditable==`false`)return!1;t=lf(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?_f(e):0}else return!1}}function _f(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ree(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=_f(e)}else if(e.parentNode&&!vf(e))t=lf(e),e=e.parentNode;else return null}}function iee(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!vf(e))t=lf(e)+1,e=e.parentNode;else return null}}function aee(e,t,n){for(let r=t==0,i=t==_f(e);r||i;){if(e==n)return!0;let t=lf(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==_f(e)}}function vf(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var yf=function(e){return e.focusNode&&mf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function bf(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function oee(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function see(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(_f(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(_f(r.startContainer),r.startOffset)}}}var xf=typeof navigator<`u`?navigator:null,Sf=typeof document<`u`?document:null,Cf=xf&&xf.userAgent||``,wf=/Edge\/(\d+)/.exec(Cf),Tf=/MSIE \d/.exec(Cf),Ef=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Cf),Df=!!(Tf||Ef||wf),Of=Tf?document.documentMode:Ef?+Ef[1]:wf?+wf[1]:0,kf=!Df&&/gecko\/(\d+)/i.test(Cf);kf&&+(/Firefox\/(\d+)/.exec(Cf)||[0,0])[1];var Af=!Df&&/Chrome\/(\d+)/.exec(Cf),jf=!!Af,Mf=Af?+Af[1]:0,Nf=!Df&&!!xf&&/Apple Computer/.test(xf.vendor),Pf=Nf&&(/Mobile\/\w+/.test(Cf)||!!xf&&xf.maxTouchPoints>2),Ff=Pf||(xf?/Mac/.test(xf.platform):!1),If=xf?/Win/.test(xf.platform):!1,Lf=/Android \d/.test(Cf),Rf=!!Sf&&`webkitFontSmoothing`in Sf.documentElement.style,zf=Rf?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Bf(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Vf(e,t){return typeof e==`number`?e:e[t]}function Hf(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Uf(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=uf(o);continue}let e=o,n=e==a.body,s=n?Bf(a):Hf(e),c=0,l=0;if(t.top<s.top+Vf(r,`top`)?l=-(s.top-t.top+Vf(i,`top`)):t.bottom>s.bottom-Vf(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+Vf(i,`top`)-s.top:t.bottom-s.bottom+Vf(i,`bottom`)),t.left<s.left+Vf(r,`left`)?c=-(s.left-t.left+Vf(i,`left`)):t.right>s.right-Vf(r,`right`)&&(c=t.right-s.right+Vf(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:uf(o)}}function Wf(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Gf(e.dom)}}function Gf(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=uf(r));return t}function Kf({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;qf(n,r==0?0:r-t)}function qf(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Jf=null;function Yf(e){if(e.setActive)return e.setActive();if(Jf)return e.focus(Jf);let t=Gf(e);e.focus(Jf==null?{get preventScroll(){return Jf={preventScroll:!0},!0}}:void 0),Jf||(Jf=!1,qf(t,0))}function Xf(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=ff(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Zf(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Xf(n,i)}function Zf(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=ap(r,1);if(n.top!=n.bottom&&Qf(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Qf(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function $f(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function ep(e,t,n){let{node:r,offset:i}=Xf(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function tp(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function np(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Qf(t,i))return np(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function rp(e,t){let n=e.dom.ownerDocument,r,i=0,a=see(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Qf(t,n)||(o=np(e.dom,t,n),!o))return null}if(Nf)for(let e=o;r&&e;e=uf(e))e.draggable&&(r=void 0);if(o=$f(o,t),r){if(kf&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Rf&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=tp(e,r,i,t))}s??=ep(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function ip(e){return e.top<e.bottom||e.left<e.right}function ap(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(ip(e))return e}return Array.prototype.find.call(n,ip)||e.getBoundingClientRect()}var op=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function sp(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Rf||kf;if(r.nodeType==3)if(o&&(op.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=ap(ff(r,i,i),n);if(kf&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=ap(ff(r,i-1,i-1),-1);if(t.top==e.top){let n=ap(ff(r,i,i+1),-1);if(n.top!=e.top)return cp(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,cp(ap(ff(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==_f(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return lp(e.getBoundingClientRect(),!1)}if(a==null&&i<_f(r)){let e=r.childNodes[i];if(e.nodeType==1)return lp(e.getBoundingClientRect(),!0)}return lp(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==_f(r))){let e=r.childNodes[i-1],t=e.nodeType==3?ff(e,_f(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return cp(ap(t,1),!1)}if(a==null&&i<_f(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?ff(e,0,+!o):e.nodeType==1?e:null:null;if(t)return cp(ap(t,-1),!0)}return cp(ap(r.nodeType==3?ff(r):r,-n),n>=0)}function cp(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function lp(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function up(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function dp(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return up(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=sp(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=ff(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var fp=/[\u0590-\u08ac]/;function pp(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!fp.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:up(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var mp=null,hp=null,gp=!1;function _p(e,t,n){return mp==t&&hp==n?gp:(mp=t,hp=n,gp=n==`up`||n==`down`?dp(e,t,n):pp(e,t,n))}var vp=0,yp=1,bp=2,xp=3,Sp=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=vp,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>lf(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof kp){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Cp&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?lf(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?lf(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=lf(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=lf(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((kf||Nf)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
65
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:lf(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(kf&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Nf)&&mf(o.node,o.offset,l.anchorNode,l.anchorOffset)&&mf(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&kf)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?bp:yp,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=xp:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?bp:xp}n=a}this.dirty=bp}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?bp:yp;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Cp=class extends Sp{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==vp&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},wp=class extends Sp{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Tp=class e extends Sp{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=Ol.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&xp||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=xp&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=vp){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=vp}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Kp(a,n,o,r)),t>0&&(a=Kp(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Ep=class e extends Sp{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Ol.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Lp(u,r,n),l?c=new Ap(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Op(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+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 t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>z.empty)}return e}matchesNode(e,t,n){return this.dirty==vp&&e.eq(this.node)&&Rp(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Bp(this,a&&a.node,e);Up(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?bc.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==bp)&&(a&&this.protectLocalComposition(e,a),jp(this.contentDOM,this.children,e),Pf&&Wp(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof $u)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Gp(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new wp(this,i,t,r);e.input.compositionNodes.push(a),this.children=Kp(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==xp||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=vp}updateOuterDeco(e){if(Rp(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Fp(this.dom,this.nodeDOM,Pp(this.outerDeco,this.node,t),Pp(e,this.node,t)),this.dom!=n&&(n.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.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Dp(e,t,n,r,i){Lp(r,t,e);let a=new Ep(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Op=class e extends Ep{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==xp||this.dirty!=vp&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=vp||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=vp,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=xp)}get domAtom(){return!1}isText(e){return this.node.text==e}},kp=class extends Sp{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==vp&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Ap=class extends Ep{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==xp)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}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 jp(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=zp(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Tp){let t=r?r.previousSibling:e.lastChild;jp(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=zp(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Mp=function(e){e&&(this.nodeName=e)};Mp.prototype=Object.create(null);var Np=[new Mp];function Pp(e,t,n){if(e.length==0)return Np;let r=n?Np[0]:new Mp,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new Mp(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Mp(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function Fp(e,t,n,r){if(n==Np&&r==Np)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Np[0],i=t)}Ip(i,o||Np[0],a)}return i}function Ip(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Lp(e,t,n){return Fp(e,e,Np,Pp(t,n,e.nodeType!=1))}function Rp(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function zp(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Bp=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Vp(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=vp,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Tp.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==xp&&a.dom==a.contentDOM&&(a.dirty=bp),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Ep){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=xp&&Rp(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=bp,u.updateChildren(r,a+1),u.dirty=vp),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Rp(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Ep.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Ep.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Cp(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Tp;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Op)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Nf||jf)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new kp(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function Vp(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Tp)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Hp(e,t){return e.type.side-t.type.side}function Up(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Hp);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Wp(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Gp(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function Kp(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function qp(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(yf(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&td.isSelectable(e)&&i.parent&&!(e.isInline&&aee(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new td(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=im(e,u,s,n)}return l}function Jp(e){return e.editable?e.hasFocus():om(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Yp(e,t=!1){let n=e.state.selection;if(nm(e,n),Jp(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&jf){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&mf(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)tm(e);else{let{anchor:r,head:i}=n,a,o;Xp&&!(n instanceof $u)&&(n.$from.parent.inlineContent||(a=Zp(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Zp(e,n.to))),e.docView.setSelection(r,i,e,t),Xp&&(a&&$p(a),o&&$p(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&em(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var Xp=Nf||jf&&Mf<63;function Zp(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Nf&&i&&i.contentEditable==`false`)return Qp(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Qp(i);if(a)return Qp(a)}}function Qp(e){return e.contentEditable=`true`,Nf&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function $p(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function em(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Jp(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function tm(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,lf(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Df&&Of<=11&&(n.disabled=!0,n.disabled=!1)}function nm(e,t){if(t instanceof td){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(rm(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else rm(e)}function rm(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function im(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||$u.between(t,n,r)}function am(e){return e.editable&&!e.hasFocus()?!1:om(e)}function om(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function sm(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return mf(t.node,t.offset,n.anchorNode,n.anchorOffset)}function cm(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&Yu.findFrom(a,t)}function lm(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function um(e,t,n){let r=e.state.selection;if(r instanceof $u){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return lm(e,new $u(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=cm(e.state,t);return n&&n instanceof td?lm(e,n):!1}else if(!(Ff&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?td.isSelectable(i)?lm(e,new td(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Rf?lm(e,new $u(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof td&&r.node.isInline)return lm(e,new $u(t>0?r.$to:r.$from));else{let n=cm(e.state,t);return n?lm(e,n):!1}}function dm(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function fm(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function pm(e,t){return t<0?cee(e):lee(e)}function cee(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(kf&&n.nodeType==1&&r<dm(n)&&fm(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(fm(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(mm(n))break;else{let t=n.previousSibling;for(;t&&fm(t,-1);)i=n.parentNode,a=lf(t),t=t.previousSibling;if(t)n=t,r=dm(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?hm(e,n,r):i&&hm(e,i,a)}function lee(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=dm(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(fm(e,1))a=n,o=++r;else break}else if(mm(n))break;else{let t=n.nextSibling;for(;t&&fm(t,1);)a=t.parentNode,o=lf(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=dm(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&hm(e,a,o)}function mm(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function uee(e,t){for(;e&&t==e.childNodes.length&&!vf(e);)t=lf(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function dee(e,t){for(;e&&!t&&!vf(e);)t=lf(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function hm(e,t,n){if(t.nodeType!=3){let e,r;(r=uee(t,n))?(t=r,n=0):(e=dee(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(yf(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Yp(e)},50)}function gm(e,t){let n=e.state.doc.resolve(t);if(!(jf||If)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function _m(e,t,n){let r=e.state.selection;if(r instanceof $u&&!r.empty||n.indexOf(`s`)>-1||Ff&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=cm(e.state,t);if(n&&n instanceof td)return lm(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof rd?Yu.near(n,t):Yu.findFrom(n,t);return o?lm(e,o):!1}return!1}function vm(e,t){if(!(e.state.selection instanceof $u))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function ym(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function fee(e){if(!Nf||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;ym(e,n,`true`),setTimeout(()=>ym(e,n,`false`),20)}return!1}function pee(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function mee(e,t){let n=t.keyCode,r=pee(t);if(n==8||Ff&&n==72&&r==`c`)return vm(e,-1)||pm(e,-1);if(n==46&&!t.shiftKey||Ff&&n==68&&r==`c`)return vm(e,1)||pm(e,1);if(n==13||n==27)return!0;if(n==37||Ff&&n==66&&r==`c`){let t=n==37?gm(e,e.state.selection.from)==`ltr`?-1:1:-1;return um(e,t,r)||pm(e,t)}else if(n==39||Ff&&n==70&&r==`c`){let t=n==39?gm(e,e.state.selection.from)==`ltr`?1:-1:1;return um(e,t,r)||pm(e,t)}else if(n==38||Ff&&n==80&&r==`c`)return _m(e,-1,r)||pm(e,-1);else if(n==40||Ff&&n==78&&r==`c`)return fee(e)||_m(e,1,r)||pm(e,1);else if(r==(Ff?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function bm(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Ol.fromSchema(e.state.schema),s=Om(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Dm[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
66
+
67
+ `),slice:t}}function xm(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new B(z.from(e.state.schema.text(t.replace(/\r\n?/g,`
68
+ `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Ol.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=yee(n),Rf&&bee(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||ml.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!hee.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=xee(Em(s,+u[1],+u[2]),u[4]);else if(s=B.maxOpen(gee(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Em(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var hee=/^(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 gee(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Cm(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=wm(a[a.length-1],i.length));let n=Sm(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return z.from(a)}return e}function Sm(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,z.from(e));return e}function Cm(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Cm(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(z.from(Sm(n,e,i+1))))}}function wm(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,wm(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(z.empty,!0);return e.copy(n.append(r))}function Tm(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=Tm(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(z.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Em(e,t,n){return t<e.openStart&&(e=new B(Tm(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new B(Tm(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Dm={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},_ee=null;function Om(){return _ee||=document.implementation.createHTMLDocument(`title`)}var km=null;function vee(e){let t=window.trustedTypes;return t?(km||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),km.createHTML(e)):e}function yee(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Om().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Dm[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=vee(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function bee(e){let t=e.querySelectorAll(jf?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function xee(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=z.from(t.create(r[e+1],i)),a++,o++}return new B(i,a,o)}var Am={},jm={},See={touchstart:!0,touchmove:!0},Cee=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Mm(e){for(let t in Am){let n=Am[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Lm(e,t)&&!Im(e,t)&&(e.editable||!(t.type in jm))&&n(e,t)},See[t]?{passive:!0}:void 0)}Nf&&e.dom.addEventListener(`input`,()=>null),Fm(e)}function Nm(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Pm(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Fm(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Im(e,t))})}function Im(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Lm(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Rm(e,t){!Im(e,t)&&Am[t.type]&&(e.editable||!(t.type in jm))&&Am[t.type](e,t)}jm.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Jm(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Lf&&jf&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Pf&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,bf(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||mee(e,n)?n.preventDefault():Nm(e,`key`)},jm.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},jm.keypress=(e,t)=>{let n=t;if(Jm(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ff&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof $u)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function zm(e){return{left:e.clientX,top:e.clientY}}function wee(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Bm(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Vm(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function Tee(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&td.isSelectable(r)?(Vm(e,new td(n),`pointer`),!0):!1}function Eee(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof td&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(td.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(Vm(e,td.create(e.state.doc,i),`pointer`),!0)}function Dee(e,t,n,r,i){return Bm(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Eee(e,n):Tee(e,n))}function Hm(e,t,n,r){return Bm(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Um(e,t,n,r){return Bm(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Wm(e,n,r)}function Wm(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Vm(e,$u.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)Vm(e,$u.create(r,a+1,a+1+n.content.size),`pointer`);else if(td.isSelectable(n))Vm(e,td.create(r,a),`pointer`);else continue;return!0}}function Gm(e){return th(e)}var Km=Ff?`metaKey`:`ctrlKey`;Am.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Gm(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&wee(n,e.input.lastClick)&&!n[Km]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(zm(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new qm(e,o,n,!!r)):(a==`doubleClick`?Hm:Um)(e,o.pos,o.inside,n)?n.preventDefault():Nm(e,`pointer`))};var qm=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Km],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof td&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&kf&&!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)),Nm(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(()=>Yp(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(zm(e))),this.updateAllowDefault(e),this.allowDefault||!t?Nm(this.view,`pointer`):Dee(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Nf&&this.mightDrag&&!this.mightDrag.node.isAtom||jf&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Vm(this.view,Yu.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Nm(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Nm(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)}};Am.touchstart=e=>{e.input.lastTouch=Date.now(),Gm(e),Nm(e,`pointer`)},Am.touchmove=e=>{e.input.lastTouch=Date.now(),Nm(e,`pointer`)},Am.contextmenu=e=>Gm(e);function Jm(e,t){return e.composing?!0:Nf&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Ym=Lf?5e3:-1;jm.compositionstart=jm.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof $u&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||jf&&If&&Xm(e)))e.markCursor=e.state.storedMarks||n.marks(),th(e,!0),e.markCursor=null;else if(th(e,!t.selection.empty),kf&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}Zm(e,Ym)};function Xm(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}jm.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Zm(e,20))};function Zm(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>th(e),t))}function Qm(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=eh());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function $m(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=ree(t.focusNode,t.focusOffset),r=iee(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function eh(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function th(e,t=!1){if(!(Lf&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Qm(e),t||e.docView&&e.docView.dirty){let n=qp(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function nh(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var rh=Df&&Of<15||Pf&&zf<604;Am.copy=jm.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=rh?null:n.clipboardData,{dom:o,text:s}=bm(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):nh(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function ih(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function ah(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.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=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?oh(e,r.value,null,i,t):oh(e,r.textContent,r.innerHTML,i,t)},50)}function oh(e,t,n,r,i){let a=xm(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||B.empty)))return!0;if(!a)return!1;let o=ih(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function sh(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}jm.paste=(e,t)=>{let n=t;if(e.composing&&!Lf)return;let r=rh?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&oh(e,sh(r),r.getData(`text/html`),i,n)?n.preventDefault():ah(e,n)};var ch=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},lh=Ff?`altKey`:`ctrlKey`;function uh(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[lh]:!n}Am.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(zm(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof td?i.to-1:i.to))){if(r&&r.mightDrag)o=td.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=td.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=bm(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!jf||Mf>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(rh?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,rh||n.dataTransfer.setData(`text/plain`,c),e.dragging=new ch(l,uh(e,n),o)},Am.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},jm.dragover=jm.dragenter=(e,t)=>t.preventDefault(),jm.drop=(e,t)=>{try{dh(e,t,e.dragging)}finally{e.dragging=null}};function dh(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(zm(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=xm(e,sh(t.dataTransfer),rh?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&uh(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||B.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Ou(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&td.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new td(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(im(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Am.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Yp(e)},20))},Am.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},Am.beforeinput=(e,t)=>{if(jf&&Lf&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,bf(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in jm)Am[e]=jm[e];function fh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var ph=class e{constructor(e,t){this.toDOM=e,this.spec=t||vh,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new gh(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&fh(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},mh=class e{constructor(e,t){this.attrs=e,this.spec=t||vh}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new gh(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&fh(this.attrs,t.attrs)&&fh(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},hh=class e{constructor(e,t){this.attrs=e,this.spec=t||vh}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new gh(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&fh(this.attrs,t.attrs)&&fh(this.spec,t.spec)}destroy(){}},gh=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new ph(n,r))}static inline(t,n,r,i){return new e(t,n,new mh(r,i))}static node(t,n,r,i){return new e(t,n,new hh(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof mh}get widget(){return this.type instanceof ph}},_h=[],vh={},yh=class e{constructor(e,t){this.local=e.length?e:_h,this.children=t.length?t:_h}static create(e,t){return t.length?Th(t,e,0,vh):bh}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==bh||e.maps.length==0?this:this.mapInner(e,t,0,0,n||vh)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Oee(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Eh),_h):bh}add(t,n){return n.length?this==bh?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=Ch(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,Th(s,e,o+1,vh)),a+=3}});let o=Sh(a?wh(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Eh):this.local,i||this.children)}remove(e){return e.length==0||this==bh?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==bh?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):bh}forChild(t,n){if(this==bh)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof mh){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Eh),_h);return r?new xh([t,r]):t}return r||bh}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Dh(this.localsInner(e))}localsInner(e){if(this==bh)return _h;if(e.inlineContent||!this.local.some(mh.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof mh||t.push(this.local[e]);return t}forEachSet(e){e(this)}};yh.empty=new yh([],[]),yh.removeOverlap=Dh;var bh=yh.empty,xh=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,vh));return e.from(r)}forChild(t,n){if(n.isLeaf)return yh.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=bh&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?Dh(n?t:t.sort(Eh)):_h}static from(t){switch(t.length){case 0:return bh;case 1:return t[0];default:return new e(t.every(e=>e instanceof yh)?t:t.reduce((e,t)=>e.concat(t instanceof yh?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Oee(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==bh?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=Th(kee(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new yh(t.sort(Eh),s)}function Sh(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new gh(i.from+t,i.to+t,i.type))}return n}function kee(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function Ch(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function wh(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Th(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Ch(e,t,o+n);if(s){a=!0;let e=Th(s,t,n+o+1,r);e!=bh&&i.push(o,o+t.nodeSize,e)}});let o=Sh(a?wh(e):e,-n).sort(Eh);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new yh(o,i):bh}function Eh(e,t){return e.from-t.from||e.to-t.to}function Dh(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Oh(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Oh(t,i,r.copy(a.from,r.to)));break}}}return t}function Oh(e,t,n){for(;t<e.length&&Eh(n,e[t])>0;)t++;e.splice(t,0,n)}function kh(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=bh&&t.push(r)}),e.cursorWrapper&&t.push(yh.create(e.state.doc,[e.cursorWrapper.deco])),xh.from(t)}var Ah={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},jh=Df&&Of<=11,Mh=class{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}},Nh=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Mh,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Df&&Of<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Nf&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),jh&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.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,Ah)),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 t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.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(am(this.view)){if(this.suppressingSelectionUpdates)return Yp(this.view);if(Df&&Of<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&mf(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 t=new Set,n;for(let n=e.focusNode;n;n=uf(n))t.add(n);for(let r=e.anchorNode;r;r=uf(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))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 t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&am(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(kf&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||zh(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&yf(n)&&(c=qp(e))&&c.eq(Yu.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Yp(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Ih(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Bh(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Yp(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Df&&Of<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?lf(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?lf(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},Ph=new WeakMap,Fh=!1;function Ih(e){if(!Ph.has(e)&&(Ph.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=kf,Fh)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),Fh=!0}}function Lh(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return mf(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Rh(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Lh(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?Lh(e,n):null}function zh(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Bh(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Vh(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],yf(c)||l.push({node:c.focusNode,offset:c.focusOffset})),jf&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||ml.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:Hh,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Hh(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Nf&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Nf&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var Uh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Wh(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=qp(e,t);if(n&&!e.state.selection.eq(n)){if(jf&&Lf&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,bf(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Vh(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Yh(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Pf&&e.input.lastIOSEnter>Date.now()-225||Lf)&&i.some(e=>e.nodeType==1&&!Uh.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,bf(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof $u&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=Gh(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof $u&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Df&&Of<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Pf&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,bf(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&qh(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,bf(8,`Backspace`)))){Lf&&jf&&e.domObserver.suppressSelectionUpdates();return}jf&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Lf&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,bf(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=Gh(e,n.doc,l.sel);t&&!(jf&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Df&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){Df&&Of<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Yp(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=Kh(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function Gh(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:im(e,t.resolve(n.anchor),t.resolve(n.head))}function Kh(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(z.from(l).eq(e))return{mark:s,type:o}}function qh(e,t,n,r,i){if(n-t<=i.pos-r.pos||Jh(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Jh(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Jh(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Jh(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Yh(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&Xh(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&Xh(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function Xh(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}var Zh=class{constructor(e,t){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 Cee,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ig),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=eg(this),$h(this),this.nodeViews=ng(this),this.docView=Dp(this.state.doc,Qh(this),kh(this),this.dom,this),this.domObserver=new Nh(this,(e,t,n,r)=>Wh(this,e,t,n,r)),this.domObserver.start(),Mm(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 t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Fm(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ig),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Qm(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=ng(this);rg(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Fm(this),this.editable=eg(this),$h(this);let o=kh(this),s=Qh(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Wf(this);if(i){this.domObserver.stop();let t=l&&(Df||jf)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&tg(n.selection,e.selection);if(l){let n=jf?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=$m(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Dp(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&sm(this))?Yp(this,t):(nm(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&Kf(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof td){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Uf(this,t.getBoundingClientRect(),e)}else Uf(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 e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new ch(e.slice,e.move,r<0?void 0:td.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Df){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Yf(this.dom),Yp(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return rp(this,e)}coordsAtPos(e,t=1){return sp(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return _p(this,t||this.state,e)}pasteHTML(e,t){return oh(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return oh(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return bm(this,e)}destroy(){this.docView&&(Pm(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],kh(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,pf())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Rm(this,e)}domSelectionRange(){let e=this.domSelection();return e?Nf&&this.root.nodeType===11&&oee(this.dom.ownerDocument)==this.dom&&Rh(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Zh.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Qh(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[gh.node(0,e.state.doc.content.size,t)]}function $h(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:gh.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function eg(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function tg(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function ng(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function rg(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function ig(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var ag={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:`'`},og={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},sg=typeof navigator<`u`&&/Mac/.test(navigator.platform),cg=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),lg=0;lg<10;lg++)ag[48+lg]=ag[96+lg]=String(lg);for(var lg=1;lg<=24;lg++)ag[lg+111]=`F`+lg;for(var lg=65;lg<=90;lg++)ag[lg]=String.fromCharCode(lg+32),og[lg]=String.fromCharCode(lg);for(var ug in ag)og.hasOwnProperty(ug)||(og[ug]=ag[ug]);function dg(e){var t=!(sg&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||cg&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?og:ag)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var fg=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),pg=typeof navigator<`u`&&/Win/.test(navigator.platform);function mg(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))fg?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function hg(e){let t=Object.create(null);for(let n in e)t[mg(n)]=e[n];return t}function gg(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function _g(e){return new hd({props:{handleKeyDown:vg(e)}})}function vg(e){let t=hg(e);return function(e,n){let r=dg(n),i,a=t[gg(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[gg(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(pg&&n.ctrlKey&&n.altKey)&&(i=ag[n.keyCode])&&i!=r){let r=t[gg(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var yg=Object.defineProperty,bg=(e,t)=>{for(var n in t)yg(e,n,{get:t[n],enumerable:!0})};function xg(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var Sg=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:xg({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Cg={};bg(Cg,{blur:()=>wg,clearContent:()=>Tg,clearNodes:()=>Eg,command:()=>Dg,createParagraphNear:()=>Og,cut:()=>kg,deleteCurrentNode:()=>Ag,deleteNode:()=>Mg,deleteRange:()=>Ng,deleteSelection:()=>Pg,enter:()=>Fg,exitCode:()=>Ig,extendMarkRange:()=>Ug,first:()=>Wg,focus:()=>Zg,forEach:()=>Qg,insertContent:()=>$g,insertContentAt:()=>a_,joinBackward:()=>c_,joinDown:()=>s_,joinForward:()=>l_,joinItemBackward:()=>u_,joinItemForward:()=>d_,joinTextblockBackward:()=>f_,joinTextblockForward:()=>p_,joinUp:()=>o_,keyboardShortcut:()=>g_,lift:()=>v_,liftEmptyBlock:()=>y_,liftListItem:()=>b_,newlineInCode:()=>x_,resetAttributes:()=>w_,scrollIntoView:()=>T_,selectAll:()=>E_,selectNodeBackward:()=>D_,selectNodeForward:()=>O_,selectParentNode:()=>k_,selectTextblockEnd:()=>A_,selectTextblockStart:()=>j_,setContent:()=>N_,setMark:()=>Gee,setMeta:()=>Kee,setNode:()=>qee,setNodeSelection:()=>Jee,setTextDirection:()=>Yee,setTextSelection:()=>Xee,sinkListItem:()=>Zee,splitBlock:()=>Qee,splitListItem:()=>_v,toggleList:()=>xv,toggleMark:()=>Sv,toggleNode:()=>Cv,toggleWrap:()=>wv,undoInputRule:()=>Tv,unsetAllMarks:()=>Ev,unsetMark:()=>Dv,unsetTextDirection:()=>Ov,updateAttributes:()=>kv,wrapIn:()=>Av,wrapInList:()=>jv});var wg=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Tg=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Eg=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=cu(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Dg=e=>t=>e(t),Og=()=>({state:e,dispatch:t})=>Ld(e,t),kg=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new $u(r.doc.resolve(Math.max(o-1,0)))),!0},Ag=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function jg(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Mg=e=>({tr:t,state:n,dispatch:r})=>{let i=jg(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Ng=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Pg=()=>({state:e,dispatch:t})=>yd(e,t),Fg=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Ig=()=>({state:e,dispatch:t})=>Id(e,t);function Lg(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function Rg(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:Lg(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function zg(e,t,n={}){return e.find(e=>e.type===t&&Rg(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Bg(e,t,n={}){return!!zg(e,t,n)}function Vg(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!zg([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&Bg([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&Bg([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function Hg(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var Ug=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=Hg(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=Vg(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=$u.create(o,e.from,e.to);n.setSelection(t)}}return!0},Wg=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function Gg(e){return e instanceof $u}function Kg(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function qg(e,t=null){if(!t)return null;let n=Yu.atStart(e),r=Yu.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?$u.create(e,Kg(0,i,a),Kg(e.content.size,i,a)):$u.create(e,Kg(t,i,a),Kg(t,i,a))}function Jg(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function Yg(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function Xg(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Zg=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Yg()||Jg())&&r.dom.focus(),Xg()&&!Yg()&&!Jg()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!Gg(n.state.selection))return o(),!0;let s=qg(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Qg=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),$g=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),e_=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&e_(r)}return e};function t_(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return e_(n)}function n_(e,t,n){if(e instanceof zc||e instanceof z)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return z.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),n_(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new ul({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?ml.fromSchema(a).parseSlice(t_(e),n.parseOptions):ml.fromSchema(a).parse(t_(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=ml.fromSchema(t);return n.slice?r.parseSlice(t_(e),n.parseOptions).content:r.parse(t_(e),n.parseOptions)}return n_(``,t,n)}function r_(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof tu||i instanceof nu))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(Yu.near(e.doc.resolve(o),n))}var i_=e=>!(`type`in e),a_=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{n_(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=n_(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((i_(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof z){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&r_(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},o_=()=>({state:e,dispatch:t})=>jd(e,t),s_=()=>({state:e,dispatch:t})=>Md(e,t),c_=()=>({state:e,dispatch:t})=>xd(e,t),l_=()=>({state:e,dispatch:t})=>Od(e,t),u_=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Tu(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},d_=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Tu(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},f_=()=>({state:e,dispatch:t})=>Sd(e,t),p_=()=>({state:e,dispatch:t})=>nee(e,t);function m_(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function h_(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Yg()||m_()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var g_=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=h_(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function __(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?jg(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>Rg(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var v_=(e,t={})=>({state:n,dispatch:r})=>__(n,jg(e,n.schema),t)?Nd(n,r):!1,y_=()=>({state:e,dispatch:t})=>Rd(e,t),b_=e=>({state:t,dispatch:n})=>af(jg(e,t.schema))(t,n),x_=()=>({state:e,dispatch:t})=>Pd(e,t);function S_(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function C_(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var w_=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=S_(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=jg(e,r.schema)),s===`mark`&&(o=Hg(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,C_(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(C_(a.attrs,t))))})})}),c},T_=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),E_=()=>({tr:e,dispatch:t})=>{if(t){let t=new rd(e.doc);e.setSelection(t)}return!0},D_=()=>({state:e,dispatch:t})=>Td(e,t),O_=()=>({state:e,dispatch:t})=>kd(e,t),k_=()=>({state:e,dispatch:t})=>Vd(e,t),A_=()=>({state:e,dispatch:t})=>qd(e,t),j_=()=>({state:e,dispatch:t})=>Kd(e,t);function M_(e,t,n={},r={}){return n_(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var N_=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=M_(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function P_(e,t){let n=Hg(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function F_(e,t){let n=new qu(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function I_(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function L_(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function R_(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function z_(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function B_(e){return t=>z_(t.$from,e)}function H(e,t,n){return e.config[t]===void 0&&e.parent?H(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?H(e.parent,t,n):null}):e.config[t]}function V_(e){return e.map(e=>{let t=H(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...V_(t())]:e}).flat(10)}function H_(e,t){let n=Ol.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function U_(e){return typeof e==`function`}function W_(e,t=void 0,...n){return U_(e)?t?e.bind(t)(...n):e(...n):e}function G_(e={}){return Object.keys(e).length===0&&e.constructor===Object}function K_(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function q_(e){let t=[],{nodeExtensions:n,markExtensions:r}=K_(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=H(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=H(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function J_(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function Y_(e){let t=[],n=J_(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function X_(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Y_(n[e]),...Y_(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function Z_(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>X_(e,t),{})}function Aee(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Q_(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Aee(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function $_(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&G_(t)?!1:t!=null))}function ev(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function jee(e,t){let n=q_(e),{nodeExtensions:r,markExtensions:i}=K_(e);return new ul({topNode:r.find(e=>H(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=$_({...e.reduce((e,t)=>{let n=H(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:W_(H(r,`content`,a)),marks:W_(H(r,`marks`,a)),group:W_(H(r,`group`,a)),inline:W_(H(r,`inline`,a)),atom:W_(H(r,`atom`,a)),selectable:W_(H(r,`selectable`,a)),draggable:W_(H(r,`draggable`,a)),code:W_(H(r,`code`,a)),whitespace:W_(H(r,`whitespace`,a)),linebreakReplacement:W_(H(r,`linebreakReplacement`,a)),defining:W_(H(r,`defining`,a)),isolating:W_(H(r,`isolating`,a)),attrs:Object.fromEntries(i.map(ev))}),s=W_(H(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Q_(e,i)));let c=H(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:Z_(e,i)}));let l=H(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=$_({...e.reduce((e,t)=>{let n=H(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:W_(H(r,`inclusive`,a)),excludes:W_(H(r,`excludes`,a)),group:W_(H(r,`group`,a)),spanning:W_(H(r,`spanning`,a)),code:W_(H(r,`code`,a)),attrs:Object.fromEntries(i.map(ev))}),s=W_(H(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Q_(e,i)));let c=H(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:Z_(e,i)})),[r.name,o]}))})}function Mee(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function tv(e){return e.sort((e,t)=>{let n=H(e,`priority`)||100,r=H(t,`priority`)||100;return n>r?-1:+(n<r)})}function nv(e){let t=tv(V_(e)),n=Mee(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function rv(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
69
+
70
+ `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Nee(e,t){return rv(e,{from:0,to:e.content.size},t)}function iv(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Pee(e,t){let n=jg(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function av(e,t){let n=S_(typeof t==`string`?t:t.name,e.schema);return n===`node`?Pee(e,t):n===`mark`?P_(e,t):{}}function Fee(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Iee(e){let t=Fee(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function ov(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Iee(r)}function sv(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=Vg(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Lee=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function cv(e,t){return t.nodes[e]||t.marks[e]||null}function lv(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Ree=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function uv(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?Hg(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>Rg(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>Rg(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function zee(e,t,n={}){if(!t)return __(e,null,n)||uv(e,null,n);let r=S_(t,e.schema);return r===`node`?__(e,t,n):r===`mark`?uv(e,t,n):!1}var Bee=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=B_(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Vee=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function dv(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function fv(e,t){let{nodeExtensions:n}=K_(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=W_(H(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function pv(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(pv(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function mv(e){return e instanceof td}var hv=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Hee(e,t){let n=t.mapping.mapResult(e.position);return{position:new hv(n.pos),mapResult:n}}function Uee(e){return new hv(e)}function Wee(e,t,n){let{selection:r}=t,i=null;if(Gg(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var Gee=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=Hg(e,r.schema);if(i)if(o){let e=P_(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Wee(r,n,c)},Kee=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),qee=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=jg(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Yd(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Yd(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},Jee=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=Kg(e,0,n.content.size),i=td.create(n,r);t.setSelection(i)}return!0},Yee=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},Xee=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=$u.atStart(n).from,o=$u.atEnd(n).to,s=Kg(r,a,o),c=Kg(i,a,o),l=$u.create(n,s,c);t.setSelection(l)}return!0},Zee=e=>({state:t,dispatch:n})=>cf(jg(e,t.schema))(t,n);function gv(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var Qee=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=lv(l,s.node().type.name,s.node().attrs);if(a instanceof td&&a.node.isBlock)return!s.parentOffset||!bu(o,s.pos)?!1:(r&&(e&&gv(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:I_(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=bu(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&bu(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof $u&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&gv(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},_v=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=jg(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=z.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=z.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...lv(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(z.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new B(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection($u.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...lv(d,u.type.name,u.attrs),...t},m={...lv(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!bu(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},vv=(e,t)=>{let n=B_(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Su(e.doc,n.pos)&&e.join(n.pos),!0},yv=(e,t)=>{let n=B_(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Su(e.doc,r)&&e.join(r),!0};function bv(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return $u.create(t,1,r)}var xv=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=jg(e,o.schema),m=jg(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=B_(e=>fv(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&fv(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,O=!!T;if((D||O)&&E){if(E.node.type===p)return S&&O?c().command(({tr:e,dispatch:t})=>{let n=bv(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(fv(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>vv(a,p)).command(()=>yv(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>vv(a,p)).command(()=>yv(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>vv(a,p)).command(()=>yv(a,p)).run()},Sv=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=Hg(e,r.schema);return uv(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Cv=(e,t,n={})=>({state:r,commands:i})=>{let a=jg(e,r.schema),o=jg(t,r.schema),s=__(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},wv=(e,t={})=>({state:n,commands:r})=>{let i=jg(e,n.schema);return __(n,i,t)?r.lift(i):r.wrapIn(i,t)},Tv=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},Ev=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},Dv=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=Hg(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=Vg(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Ov=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},kv=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=S_(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=jg(e,r.schema)),s===`mark`&&(o=Hg(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Av=(e,t={})=>({state:n,dispatch:r})=>Jd(jg(e,n.schema),t)(n,r),jv=(e,t={})=>({state:n,dispatch:r})=>tf(jg(e,n.schema),t)(n,r),Mv=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Nv=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Pv=(e,t)=>{if(Lg(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function Fv(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Ree(c)+i;return a.forEach(e=>{if(l)return;let a=Pv(u,e.find);if(!a)return;let c=s.state.tr,d=xg({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new Sg({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function Iv(e){let{editor:t,rules:n}=e,r=new hd({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:H_(z.from(e),a.schema);let{from:i}=s;Fv({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return Fv({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Fv({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?Fv({editor:t,from:a.pos,to:a.pos,text:`
71
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Lv(e){return Object.prototype.toString.call(e).slice(8,-1)}function Rv(e){return Lv(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function zv(e,t){let n={...e};return Rv(e)&&Rv(t)&&Object.keys(t).forEach(r=>{Rv(t[r])&&Rv(e[r])?n[r]=zv(e[r],t[r]):n[r]=t[r]}),n}var Bv=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...W_(H(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...W_(H(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>zv(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},Vv=class e extends Bv{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Hv(e){return typeof e==`number`}var Uv=class{constructor(e){this.find=e.find,this.handler=e.handler}},Wv=(e,t,n)=>{if(Lg(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Gv(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Sg({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||Wv(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Kv=null,qv=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Jv(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!Gv({editor:t,state:xg({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new hd({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Kv=t)},i=()=>{Kv&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Kv;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:H_(z.from(t),r.schema);let{from:n}=d,i=n+t.length,a=qv(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Hv(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Yv=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=nv(e),this.schema=jee(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=H(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:cv(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return tv([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:cv(t.name,this.schema)},r=[],i=H(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&H(t,`exitable`,n)&&(a.ArrowRight=()=>Vv.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=_g(a);r.push(o);let s=H(t,`addInputRules`,n);if(dv(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Iv({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=H(t,`addPasteRules`,n);if(dv(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Jv({editor:e,rules:t});r.push(...n)}}let l=H(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return q_(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=K_(this.extensions);return Object.fromEntries(t.filter(e=>!!H(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=H(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:jg(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:Z_(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return tv([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:cv(n.name,this.schema)},i=H(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return tv([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:cv(n.name,this.schema)},i=H(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=K_(this.extensions);return Object.fromEntries(t.filter(e=>!!H(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=H(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Hg(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=Z_(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Ny(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:cv(e.name,this.schema)};e.type===`mark`&&(W_(H(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=H(e,`onBeforeCreate`,t),r=H(e,`onCreate`,t),i=H(e,`onUpdate`,t),a=H(e,`onSelectionUpdate`,t),o=H(e,`onTransaction`,t),s=H(e,`onFocus`,t),c=H(e,`onBlur`,t),l=H(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Yv.resolve=nv,Yv.sort=tv,Yv.flatten=V_;var Xv={};bg(Xv,{ClipboardTextSerializer:()=>Qv,Commands:()=>$v,Delete:()=>ey,Drop:()=>ty,Editable:()=>ny,FocusEvents:()=>iy,Keymap:()=>ay,Paste:()=>oy,Tabindex:()=>sy,TextDirection:()=>cy,focusEventsPluginKey:()=>ry});var Zv=class e extends Bv{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Qv=Zv.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new hd({key:new vd(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=iv(n);return rv(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),$v=Zv.create({name:`commands`,addCommands(){return{...Cg}}}),ey=Zv.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=F_(e.before,[e,...t]);ov(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Ql){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),ty=Zv.create({name:`drop`,addProseMirrorPlugins(){return[new hd({key:new vd(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),ny=Zv.create({name:`editable`,addProseMirrorPlugins(){return[new hd({key:new vd(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),ry=new vd(`focusEvents`),iy=Zv.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new hd({key:ry,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),ay=Zv.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:Yu.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Yg()||m_()?i:r},addProseMirrorPlugins(){return[new hd({key:new vd(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=Yu.atStart(t.doc).from,l=Yu.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!pv(n.doc))return;let u=n.tr,d=xg({state:n,transaction:u}),{commands:f}=new Sg({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),oy=Zv.create({name:`paste`,addProseMirrorPlugins(){return[new hd({key:new vd(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),sy=Zv.create({name:`tabindex`,addProseMirrorPlugins(){return[new hd({key:new vd(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),cy=Zv.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=K_(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new hd({key:new vd(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),ly=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},uy=`.ProseMirror {
72
+ position: relative;
73
+ }
74
+
75
+ .ProseMirror {
76
+ word-wrap: break-word;
77
+ white-space: pre-wrap;
78
+ white-space: break-spaces;
79
+ -webkit-font-variant-ligatures: none;
80
+ font-variant-ligatures: none;
81
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
82
+ }
83
+
84
+ .ProseMirror [contenteditable="false"] {
85
+ white-space: normal;
86
+ }
87
+
88
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
89
+ white-space: pre-wrap;
90
+ }
91
+
92
+ .ProseMirror pre {
93
+ white-space: pre-wrap;
94
+ }
95
+
96
+ img.ProseMirror-separator {
97
+ display: inline !important;
98
+ border: none !important;
99
+ margin: 0 !important;
100
+ width: 0 !important;
101
+ height: 0 !important;
102
+ }
103
+
104
+ .ProseMirror-gapcursor {
105
+ display: none;
106
+ pointer-events: none;
107
+ position: absolute;
108
+ margin: 0;
109
+ }
110
+
111
+ .ProseMirror-gapcursor:after {
112
+ content: "";
113
+ display: block;
114
+ position: absolute;
115
+ top: -2px;
116
+ width: 20px;
117
+ border-top: 1px solid black;
118
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
119
+ }
120
+
121
+ @keyframes ProseMirror-cursor-blink {
122
+ to {
123
+ visibility: hidden;
124
+ }
125
+ }
126
+
127
+ .ProseMirror-hideselection *::selection {
128
+ background: transparent;
129
+ }
130
+
131
+ .ProseMirror-hideselection *::-moz-selection {
132
+ background: transparent;
133
+ }
134
+
135
+ .ProseMirror-hideselection * {
136
+ caret-color: transparent;
137
+ }
138
+
139
+ .ProseMirror-focused .ProseMirror-gapcursor {
140
+ display: block;
141
+ }`;function dy(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var fy=class extends Mv{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Hee,createMappablePosition:Uee},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=qg(t,this.options.autofocus);this.editorState=tee.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=dy(uy,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=U_(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){let e=[...this.options.enableCoreExtensions?[ny,Qv.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),$v,iy,ay,sy,ty,oy,ey,cy.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new Yv(e,this)}createCommandManager(){this.commandManager=new Sg({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=M_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=M_(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Zh(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return av(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return zee(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return H_(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
142
+
143
+ `,textSerializers:n={}}=e||{};return Nee(this.state.doc,{blockSeparator:t,textSerializers:{...iv(this.schema),...n}})}get isEmpty(){return pv(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new ly(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function py(e){return new Nv({find:e.find,handler:({state:t,range:n,match:r})=>{let i=W_(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(sv(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function my(e){return new Nv({find:e.find,handler:({state:t,range:n,match:r})=>{let i=W_(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function hy(e){return new Nv({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=W_(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function gy(e){return new Nv({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,a=n.from,o=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),a+=e;let t=a-o;t>0&&(i=r[0].slice(e-t,e)+i,a=o)}t.tr.insertText(i,a,o)},undoable:e.undoable})}function _y(e){return new Nv({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=W_(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&uu(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Su(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var vy=e=>`touches`in e,yy=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,vy(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function by(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof td){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}bg({},{createAtomBlockMarkdownSpec:()=>Cy,createBlockMarkdownSpec:()=>wy,createInlineMarkdownSpec:()=>Dy,parseAttributes:()=>xy,parseIndentedBlocks:()=>Oy,renderNestedMarkdownContent:()=>ky,serializeAttributes:()=>Sy});function xy(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function Sy(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function Cy(e){let{nodeName:t,name:n,parseAttributes:r=xy,serializeAttributes:i=Sy,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function wy(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=xy,serializeAttributes:a=Sy,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
144
+
145
+ ${t.renderChildren(e.content||[],`
146
+
147
+ `)}
148
+
149
+ :::`}}}function Ty(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function Ey(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Dy(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Ty,serializeAttributes:a=Ey,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function Oy(e,t,n){let r=e.split(`
150
+ `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
151
+ `;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
152
+ `;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
153
+ `,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
154
+ `,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
155
+ `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function ky(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
156
+ `).map(e=>e?t.indent(e):t.indent(``)).join(`
157
+ `);s+=e.type===`paragraph`?`
158
+
159
+ ${n}`:`
160
+ ${n}`}}),s}var Ay=new WeakMap;function jy(e,t){let n=Ay.get(e);if(!n){let t={callbacks:new Set,rafId:null,handler:()=>{t.rafId!==null&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{t.rafId=null,t.callbacks.forEach(e=>e())})}};Ay.set(e,t),e.on(`update`,t.handler),n=t}n.callbacks.add(t)}function My(e,t){let n=Ay.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.rafId!==null&&cancelAnimationFrame(n.rafId),e.off(`update`,n.handler),Ay.delete(e)))}function Ny(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var Py=class e extends Bv{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Fy=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=td.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=td.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(Yg()||Jg())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function Iy(e){return new Uv({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=W_(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(sv(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:Ly,getOwnPropertySymbols:Ry}=Object,{hasOwnProperty:zy}=Object.prototype;function By(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Vy(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Hy(e){return e?.[Symbol.toStringTag]}function Uy(e){return Ly(e).concat(Ry(e))}var Wy=Object.hasOwn||((e,t)=>zy.call(e,t));function Gy(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var Ky=`__v`,qy=`__o`,Jy=`_owner`,{getOwnPropertyDescriptor:Yy,keys:Xy}=Object;function Zy(e,t){return e.byteLength===t.byteLength&&ub(new Uint8Array(e),new Uint8Array(t))}function Qy(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function $y(e,t){return e.byteLength===t.byteLength&&ub(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function eb(e,t){return Gy(e.getTime(),t.getTime())}function tb(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function nb(e,t){return e===t}function rb(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var ib=Gy;function ab(e,t,n){let r=Xy(e),i=r.length;if(Xy(t).length!==i)return!1;for(;i-- >0;)if(!fb(e,t,n,r[i]))return!1;return!0}function ob(e,t,n){let r=Uy(e),i=r.length;if(Uy(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!fb(e,t,n,a)||(o=Yy(e,a),s=Yy(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function sb(e,t){return Gy(e.valueOf(),t.valueOf())}function cb(e,t){return e.source===t.source&&e.flags===t.flags}function lb(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function ub(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function db(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function fb(e,t,n,r){return(r===Jy||r===qy||r===Ky)&&(e.$$typeof||t.$$typeof)?!0:Wy(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var pb=`[object ArrayBuffer]`,mb=`[object Arguments]`,hb=`[object Boolean]`,gb=`[object DataView]`,_b=`[object Date]`,vb=`[object Error]`,yb=`[object Map]`,bb=`[object Number]`,xb=`[object Object]`,Sb=`[object RegExp]`,Cb=`[object Set]`,wb=`[object String]`,Tb={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Eb=`[object URL]`,Db=Object.prototype.toString;function Ob({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=Db.call(h);if(b===_b)return r(h,g,_);if(b===Sb)return u(h,g,_);if(b===yb)return o(h,g,_);if(b===Cb)return d(h,g,_);if(b===xb)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Eb)return p(h,g,_);if(b===vb)return i(h,g,_);if(b===mb)return c(h,g,_);if(Tb[b])return f(h,g,_);if(b===pb)return e(h,g,_);if(b===gb)return n(h,g,_);if(b===hb||b===bb||b===wb)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Hy(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function kb({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Zy,areArraysEqual:n?ob:Qy,areDataViewsEqual:$y,areDatesEqual:eb,areErrorsEqual:tb,areFunctionsEqual:nb,areMapsEqual:n?By(rb,ob):rb,areNumbersEqual:ib,areObjectsEqual:n?ob:ab,arePrimitiveWrappersEqual:sb,areRegExpsEqual:cb,areSetsEqual:n?By(lb,ob):lb,areTypedArraysEqual:n?By(ub,ob):ub,areUrlsEqual:db,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Vy(r.areArraysEqual),t=Vy(r.areMapsEqual),n=Vy(r.areObjectsEqual),i=Vy(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function Ab(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function jb({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var Mb=Nb();Nb({strict:!0}),Nb({circular:!0}),Nb({circular:!0,strict:!0}),Nb({createInternalComparator:()=>Gy}),Nb({strict:!0,createInternalComparator:()=>Gy}),Nb({circular:!0,createInternalComparator:()=>Gy}),Nb({circular:!0,createInternalComparator:()=>Gy,strict:!0});function Nb(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=Ob(kb(e));return jb({circular:t,comparator:a,createState:r,equals:n?n(a):Ab(a),strict:i})}var Pb=n((e=>{var t=j(),n=fc();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Fb=n(((e,t)=>{t.exports=Pb()}))(),Ib=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Lb=({contentComponent:e})=>{let t=(0,pc.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,R.jsx)(R.Fragment,{children:Object.values(t)})};function Rb(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:jr.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var zb=class extends P.Component{constructor(e){super(e),this.editorContentRef=P.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=Rb(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{ref:Ib(t,this.editorContentRef),...n}),e?.contentComponent&&(0,R.jsx)(Lb,{contentComponent:e.contentComponent})]})}},Bb=(0,P.forwardRef)((e,t)=>{let n=P.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return P.createElement(zb,{key:n,innerRef:t,...e})}),Vb=P.memo(Bb),Hb=typeof window<`u`?P.useLayoutEffect:P.useEffect,Ub=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on(`transaction`,e),()=>{t.off(`transaction`,e)}}}};function Wb(e){let[t]=(0,P.useState)(()=>new Ub(e.editor)),n=(0,Fb.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??Mb);return Hb(()=>t.watch(e.editor),[e.editor,t]),(0,P.useDebugValue)(n),n}var Gb=!1,Kb=typeof window>`u`,qb=Kb||!!(typeof window<`u`&&window.next),Jb=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0){if(Kb||qb){if(Gb)throw Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&Kb&&Gb)throw Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){return new fy({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length?e.extensions.every((e,n)=>e===t.extensions?.[n]):!1:e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Yb(e={},t=[]){let n=(0,P.useRef)(e);n.current=e;let[r]=(0,P.useState)(()=>new Jb(n)),i=(0,pc.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,P.useDebugValue)(i),(0,P.useEffect)(r.onRender(t)),Wb({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var Xb=(0,P.createContext)({editor:null});Xb.Consumer;var Zb=(0,P.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Qb=()=>(0,P.useContext)(Zb);function $b({as:e=`div`,...t}){let{nodeViewContentRef:n,nodeViewContentChildren:r}=Qb();return(0,R.jsx)(e,{...t,ref:n,"data-node-view-content":``,style:{whiteSpace:`pre-wrap`,...t.style},children:r})}var ex=P.forwardRef((e,t)=>{let{onDragStart:n}=Qb();return(0,R.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function tx(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function nx(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.forward_ref)`||e.$$typeof.description===`react.forward_ref`))}function rx(e){return!!(typeof e==`object`&&e.$$typeof&&(e.$$typeof.toString()===`Symbol(react.memo)`||e.$$typeof.description===`react.memo`))}function ix(e){if(tx(e)||nx(e))return!0;if(rx(e)){let t=e.type;if(t)return tx(t)||nx(t)}return!1}function ax(){try{if(P.version)return parseInt(P.version.split(`.`)[0],10)>=19}catch{}return!1}var ox=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,jr.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=ax(),a=ix(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,R.jsx)(t,{...o}),(e=r?.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){this.destroyed||(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0,(e=this.editor?.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};P.createContext({markViewContentRef:()=>{}});var sx=class extends Fy{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);if(!e)return;e.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,P.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&(e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`),e.appendChild(this.contentDOMElement))}},n=this.component,r=(0,P.memo)(e=>(0,R.jsx)(Zb.Provider,{value:t,children:(0,P.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new ox(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},jy(this.editor,this.positionCheckCallback)}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;let{from:e,to:t}=this.editor.state.selection,n=this.currentPos;if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}let i=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?i===this.currentPos?!0:(this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()}),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove(`ProseMirror-selectednode`)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.positionCheckCallback&&=(My(this.editor,this.positionCheckCallback),null),this.contentDOMElement=null,this.selectionRafId&&=(cancelAnimationFrame(this.selectionRafId),null)}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=Z_(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function cx(e,t){return n=>n.editor.contentComponent?new sx(e,n,t):{}}var lx=(0,P.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});lx.displayName=`TiptapContext`;var ux=()=>(0,P.useContext)(lx);function dx({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,P.useMemo)(()=>({editor:r}),[r]),a=(0,P.useMemo)(()=>({editor:r}),[r]);return(0,R.jsx)(Xb.Provider,{value:a,children:(0,R.jsx)(lx.Provider,{value:i,children:n})})}dx.displayName=`Tiptap`;function fx({...e}){let{editor:t}=ux();return(0,R.jsx)(Vb,{editor:t,...e})}fx.displayName=`Tiptap.Content`,Object.assign(dx,{Content:fx});var px=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},mx=/^\s*>\s$/,hx=Py.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return px(`blockquote`,{...X_(this.options.HTMLAttributes,e),children:px(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
161
+ `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
162
+ `))}),n.join(`
163
+ >
164
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[_y({find:mx,type:this.type})]}}),gx=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_x=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,vx=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,yx=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,bx=Vv.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return px(`strong`,{...X_(this.options.HTMLAttributes,e),children:px(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[py({find:gx,type:this.type}),py({find:vx,type:this.type})]},addPasteRules(){return[Iy({find:_x,type:this.type}),Iy({find:yx,type:this.type})]}}),xx=/(^|[^`])`([^`]+)`(?!`)$/,Sx=/(^|[^`])`([^`]+)`(?!`)/g,Cx=Vv.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,X_(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[py({find:xx,type:this.type})]},addPasteRules(){return[Iy({find:Sx,type:this.type})]}}),wx=4,Tx=/^```([a-z]+)?[\s\n]$/,Ex=/^~~~([a-z]+)?[\s\n]$/,Dx=Py.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:wx,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,X_(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
165
+ `):`\`\`\`${r}
166
+
167
+ \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??wx,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
168
+ `,`
169
+ `).split(`
170
+ `).map(e=>o+e).join(`
171
+ `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??wx,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
172
+ `,`
173
+ `).split(`
174
+ `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection($u.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
175
+ `,`
176
+ `).split(`
177
+ `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
178
+ `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
179
+
180
+ `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(Yu.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[hy({find:Tx,type:this.type,getAttributes:e=>({language:e[1]})}),hy({find:Ex,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new hd({key:new vd(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
181
+ `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection($u.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),Ox=Py.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
182
+
183
+ `):``}),kx=Py.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,X_(this.options.HTMLAttributes,e)]},renderText(){return`
184
+ `},renderMarkdown:()=>`
185
+ `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ax=Py.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,X_(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>hy({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),jx=Py.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,X_(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!by(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return mv(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection($u.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(td.create(t.doc,n.pos)):t.setSelection($u.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection($u.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[my({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Mx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Nx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Px=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Fx=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ix=Vv.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,X_(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[py({find:Mx,type:this.type}),py({find:Px,type:this.type})]},addPasteRules(){return[Iy({find:Nx,type:this.type}),Iy({find:Fx,type:this.type})]}}),Lx=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Rx=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,zx=`numeric`,Bx=`ascii`,Vx=`alpha`,Hx=`asciinumeric`,Ux=`alphanumeric`,Wx=`domain`,Gx=`emoji`,Kx=`scheme`,qx=`slashscheme`,Jx=`whitespace`;function Yx(e,t){return e in t||(t[e]=[]),t[e]}function Xx(e,t,n){t[zx]&&(t[Hx]=!0,t[Ux]=!0),t[Bx]&&(t[Hx]=!0,t[Vx]=!0),t[Hx]&&(t[Ux]=!0),t[Vx]&&(t[Ux]=!0),t[Ux]&&(t[Wx]=!0),t[Gx]&&(t[Wx]=!0);for(let r in t){let t=Yx(r,n);t.indexOf(e)<0&&t.push(e)}}function Zx(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Qx(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Qx.groups={},Qx.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=Qx.groups;let i;return t&&t.j?i=t:(i=new Qx(t),n&&r&&Xx(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=Qx.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new Qx,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new Qx,a&&(r&&(o.t&&typeof o.t==`string`?Xx(a,Object.assign(Zx(o.t,r),n),r):n&&Xx(a,n,r)),o.t=a),i.j[e]=o,o}};var $x=(e,t,n,r,i)=>e.ta(t,n,r,i),eS=(e,t,n,r,i)=>e.tr(t,n,r,i),tS=(e,t,n,r,i)=>e.ts(t,n,r,i),U=(e,t,n,r,i)=>e.tt(t,n,r,i),nS=`WORD`,rS=`UWORD`,iS=`ASCIINUMERICAL`,aS=`ALPHANUMERICAL`,oS=`LOCALHOST`,sS=`TLD`,cS=`UTLD`,lS=`SCHEME`,uS=`SLASH_SCHEME`,dS=`NUM`,fS=`WS`,pS=`NL`,mS=`OPENBRACE`,hS=`CLOSEBRACE`,gS=`OPENBRACKET`,_S=`CLOSEBRACKET`,vS=`OPENPAREN`,yS=`CLOSEPAREN`,bS=`OPENANGLEBRACKET`,xS=`CLOSEANGLEBRACKET`,SS=`FULLWIDTHLEFTPAREN`,CS=`FULLWIDTHRIGHTPAREN`,wS=`LEFTCORNERBRACKET`,TS=`RIGHTCORNERBRACKET`,ES=`LEFTWHITECORNERBRACKET`,DS=`RIGHTWHITECORNERBRACKET`,OS=`FULLWIDTHLESSTHAN`,kS=`FULLWIDTHGREATERTHAN`,AS=`AMPERSAND`,jS=`APOSTROPHE`,MS=`ASTERISK`,NS=`AT`,PS=`BACKSLASH`,FS=`BACKTICK`,IS=`CARET`,LS=`COLON`,RS=`COMMA`,zS=`DOLLAR`,BS=`DOT`,VS=`EQUALS`,HS=`EXCLAMATION`,US=`HYPHEN`,WS=`PERCENT`,GS=`PIPE`,KS=`PLUS`,qS=`POUND`,JS=`QUERY`,YS=`QUOTE`,XS=`FULLWIDTHMIDDLEDOT`,ZS=`SEMI`,QS=`SLASH`,$S=`TILDE`,eC=`UNDERSCORE`,tC=`EMOJI`,nC=`SYM`,rC=Object.freeze({__proto__:null,ALPHANUMERICAL:aS,AMPERSAND:AS,APOSTROPHE:jS,ASCIINUMERICAL:iS,ASTERISK:MS,AT:NS,BACKSLASH:PS,BACKTICK:FS,CARET:IS,CLOSEANGLEBRACKET:xS,CLOSEBRACE:hS,CLOSEBRACKET:_S,CLOSEPAREN:yS,COLON:LS,COMMA:RS,DOLLAR:zS,DOT:BS,EMOJI:tC,EQUALS:VS,EXCLAMATION:HS,FULLWIDTHGREATERTHAN:kS,FULLWIDTHLEFTPAREN:SS,FULLWIDTHLESSTHAN:OS,FULLWIDTHMIDDLEDOT:XS,FULLWIDTHRIGHTPAREN:CS,HYPHEN:US,LEFTCORNERBRACKET:wS,LEFTWHITECORNERBRACKET:ES,LOCALHOST:oS,NL:pS,NUM:dS,OPENANGLEBRACKET:bS,OPENBRACE:mS,OPENBRACKET:gS,OPENPAREN:vS,PERCENT:WS,PIPE:GS,PLUS:KS,POUND:qS,QUERY:JS,QUOTE:YS,RIGHTCORNERBRACKET:TS,RIGHTWHITECORNERBRACKET:DS,SCHEME:lS,SEMI:ZS,SLASH:QS,SLASH_SCHEME:uS,SYM:nC,TILDE:$S,TLD:sS,UNDERSCORE:eC,UTLD:cS,UWORD:rS,WORD:nS,WS:fS}),iC=/[a-z]/,aC=/\p{L}/u,oC=/\p{Emoji}/u,sC=/\d/,cC=/\s/,lC=`\r`,uC=`
186
+ `,$ee=`️`,ete=`‍`,dC=``,fC=null,pC=null;function tte(e=[]){let t={};Qx.groups=t;let n=new Qx;fC??=gC(Lx),pC??=gC(Rx),U(n,`'`,jS),U(n,`{`,mS),U(n,`}`,hS),U(n,`[`,gS),U(n,`]`,_S),U(n,`(`,vS),U(n,`)`,yS),U(n,`<`,bS),U(n,`>`,xS),U(n,`(`,SS),U(n,`)`,CS),U(n,`「`,wS),U(n,`」`,TS),U(n,`『`,ES),U(n,`』`,DS),U(n,`<`,OS),U(n,`>`,kS),U(n,`&`,AS),U(n,`*`,MS),U(n,`@`,NS),U(n,"`",FS),U(n,`^`,IS),U(n,`:`,LS),U(n,`,`,RS),U(n,`$`,zS),U(n,`.`,BS),U(n,`=`,VS),U(n,`!`,HS),U(n,`-`,US),U(n,`%`,WS),U(n,`|`,GS),U(n,`+`,KS),U(n,`#`,qS),U(n,`?`,JS),U(n,`"`,YS),U(n,`/`,QS),U(n,`;`,ZS),U(n,`~`,$S),U(n,`_`,eC),U(n,`\\`,PS),U(n,`・`,XS);let r=eS(n,sC,dS,{[zx]:!0});eS(r,sC,r);let i=eS(r,iC,iS,{[Hx]:!0}),a=eS(r,aC,aS,{[Ux]:!0}),o=eS(n,iC,nS,{[Bx]:!0});eS(o,sC,i),eS(o,iC,o),eS(i,sC,i),eS(i,iC,i);let s=eS(n,aC,rS,{[Vx]:!0});eS(s,iC),eS(s,sC,a),eS(s,aC,s),eS(a,sC,a),eS(a,iC),eS(a,aC,a);let c=U(n,uC,pS,{[Jx]:!0}),l=U(n,lC,fS,{[Jx]:!0}),u=eS(n,cC,fS,{[Jx]:!0});U(n,dC,u),U(l,uC,c),U(l,dC,u),eS(l,cC,u),U(u,lC),U(u,uC),eS(u,cC,u),U(u,dC,u);let d=eS(n,oC,tC,{[Gx]:!0});U(d,`#`),eS(d,oC,d),U(d,$ee,d);let f=U(d,ete);U(f,`#`),eS(f,oC,d);let p=[[iC,o],[sC,i]],m=[[iC,null],[aC,s],[sC,a]];for(let e=0;e<fC.length;e++)hC(n,fC[e],sS,nS,p);for(let e=0;e<pC.length;e++)hC(n,pC[e],cS,rS,m);Xx(sS,{tld:!0,ascii:!0},t),Xx(cS,{utld:!0,alpha:!0},t),hC(n,`file`,lS,nS,p),hC(n,`mailto`,lS,nS,p),hC(n,`http`,uS,nS,p),hC(n,`https`,uS,nS,p),hC(n,`ftp`,uS,nS,p),hC(n,`ftps`,uS,nS,p),Xx(lS,{scheme:!0,ascii:!0},t),Xx(uS,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[Kx]:!0}:{[qx]:!0};r.indexOf(`-`)>=0?i[Wx]=!0:iC.test(r)?sC.test(r)?i[Hx]=!0:i[Bx]=!0:i[zx]=!0,tS(n,r,r,i)}return tS(n,`localhost`,oS,{ascii:!0}),n.jd=new Qx(nC),{start:n,tokens:Object.assign({groups:t},rC)}}function mC(e,t){let n=nte(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function nte(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function hC(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new Qx(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new Qx(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function gC(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var _C={defaultProtocol:`http`,events:null,format:yC,formatHref:yC,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function vC(e,t=null){let n=Object.assign({},_C);e&&(n=Object.assign(n,e instanceof vC?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}vC.prototype={o:_C,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:_C[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function yC(e){return e}function bC(e,t){this.t=`token`,this.v=e,this.tk=t}bC.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=_C.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function xC(e,t){class n extends bC{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var SC=xC(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),CC=xC(`text`),rte=xC(`nl`),wC=xC(`url`,{isLink:!0,toHref(e=_C.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==oS&&e[1].t===LS}}),TC=e=>new Qx(e);function ite({groups:e}){let t=e.domain.concat([AS,MS,NS,PS,FS,IS,zS,VS,US,dS,WS,GS,KS,qS,QS,nC,$S,eC]),n=[jS,LS,RS,BS,HS,WS,JS,YS,ZS,bS,xS,mS,hS,_S,gS,vS,yS,SS,CS,wS,TS,ES,DS,OS,kS],r=[AS,jS,MS,PS,FS,IS,zS,VS,US,mS,hS,WS,GS,KS,qS,JS,QS,nC,$S,eC],i=TC(),a=U(i,$S);$x(a,r,a),$x(a,e.domain,a);let o=TC(),s=TC(),c=TC();$x(i,e.domain,o),$x(i,e.scheme,s),$x(i,e.slashscheme,c),$x(o,r,a),$x(o,e.domain,o);let l=U(o,NS);U(a,NS,l),U(s,NS,l),U(c,NS,l);let u=U(a,BS);$x(u,r,a),$x(u,e.domain,a);let d=TC();$x(l,e.domain,d),$x(d,e.domain,d);let f=U(d,BS);$x(f,e.domain,d);let p=TC(SC);$x(f,e.tld,p),$x(f,e.utld,p),U(l,oS,p);let m=U(d,US);U(m,US,m),$x(m,e.domain,d),$x(p,e.domain,d),U(p,BS,f),U(p,US,m),$x(U(p,LS),e.numeric,SC);let h=U(o,US),g=U(o,BS);U(h,US,h),$x(h,e.domain,o),$x(g,r,a),$x(g,e.domain,o);let _=TC(wC);$x(g,e.tld,_),$x(g,e.utld,_),$x(_,e.domain,o),$x(_,r,a),U(_,BS,g),U(_,US,h),U(_,NS,l);let v=U(_,LS),y=TC(wC);$x(v,e.numeric,y);let b=TC(wC),x=TC();$x(b,t,b),$x(b,n,x),$x(x,t,b),$x(x,n,x),U(_,QS,b),U(y,QS,b);let S=U(s,LS),C=U(U(U(c,LS),QS),QS);$x(s,e.domain,o),U(s,BS,g),U(s,US,h),$x(c,e.domain,o),U(c,BS,g),U(c,US,h),$x(S,e.domain,b),U(S,QS,b),U(S,JS,b),$x(C,e.domain,b),$x(C,t,b),U(C,QS,b);let w=[[mS,hS],[gS,_S],[vS,yS],[bS,xS],[SS,CS],[wS,TS],[ES,DS],[OS,kS]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=U(b,r);U(x,r,a),U(a,i,b);let o=TC(wC);$x(a,t,o);let s=TC();$x(a,n),$x(o,t,o),$x(o,n,s),$x(s,t,o),$x(s,n,s),U(o,i,b),U(s,i,b)}return U(i,oS,_),U(i,pS,rte),{start:i,tokens:rC}}function ate(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(EC(CC,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(EC(e,t,r))}}return o.length>0&&a.push(EC(CC,t,o)),a}function EC(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var ote=typeof console<`u`&&console&&console.warn||(()=>{}),ste=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,DC={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function cte(){return Qx.groups={},DC.scanner=null,DC.parser=null,DC.tokenQueue=[],DC.pluginQueue=[],DC.customSchemes=[],DC.initialized=!1,DC}function OC(e,t=!1){if(DC.initialized&&ote(`linkifyjs: already initialized - will not register custom scheme "${e}" ${ste}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
187
+ 1. Must only contain digits, lowercase ASCII letters or "-"
188
+ 2. Cannot start or end with "-"
189
+ 3. "-" cannot repeat`);DC.customSchemes.push([e,t])}function lte(){DC.scanner=tte(DC.customSchemes);for(let e=0;e<DC.tokenQueue.length;e++)DC.tokenQueue[e][1]({scanner:DC.scanner});DC.parser=ite(DC.scanner.tokens);for(let e=0;e<DC.pluginQueue.length;e++)DC.pluginQueue[e][1]({scanner:DC.scanner,parser:DC.parser});return DC.initialized=!0,DC}function kC(e){return DC.initialized||lte(),ate(DC.parser.start,e,mC(DC.scanner.start,e))}kC.scan=mC;function AC(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new vC(n),i=kC(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var jC=`[\0- \xA0 ᠎ -\u2029  ]`,ute=new RegExp(jC),dte=RegExp(`${jC}$`),fte=new RegExp(jC,`g`);function pte(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function mte(e){return new hd({key:new vd(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(ov(F_(n.doc,[...t])).forEach(({newRange:t})=>{let n=R_(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!dte.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(ute).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=kC(n).map(t=>t.toObject(e.defaultProtocol));if(!pte(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{sv(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function hte(e){return new hd({key:new vd(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=av(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function gte(e){return new hd({key:new vd(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=AC(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function MC(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(fte,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var NC=Vv.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){OC(e);return}OC(e.scheme,e.optionalSlashes)})},onDestroy(){cte()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!MC(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!MC(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!MC(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,X_(this.options.HTMLAttributes,e),0]:[`a`,X_(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!MC(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!MC(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[Iy({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=AC(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!MC(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(mte({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!MC(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(hte({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(gte({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),_te=Object.defineProperty,vte=(e,t)=>{for(var n in t)_te(e,n,{get:t[n],enumerable:!0})},yte=`listItem`,PC=`textStyle`,FC=/^\s*([-+*])\s$/,IC=Py.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,X_(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
190
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yte,this.editor.getAttributes(PC)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=_y({find:FC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=_y({find:FC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(PC),editor:this.editor})),[e]}}),LC=Py.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,X_(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>ky(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});vte({},{findListItemPos:()=>RC,getNextListDepth:()=>zC,handleBackspace:()=>UC,handleDelete:()=>KC,hasListBefore:()=>BC,hasListItemAfter:()=>bte,hasListItemBefore:()=>VC,listItemHasSubList:()=>HC,nextListIsDeeper:()=>WC,nextListIsHigher:()=>GC});var RC=(e,t)=>{let{$from:n}=t.selection,r=jg(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},zC=(e,t)=>{let n=RC(e,t);if(!n)return!1;let[,r]=Lee(t,e,n.$pos.pos+4);return r},BC=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},VC=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},HC=(e,t,n)=>{if(!n)return!1;let r=jg(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},UC=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!__(e.state,t)&&BC(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!__(e.state,t)||!Vee(e.state))return!1;let r=RC(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=HC(t,e.state,i);return VC(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},WC=(e,t)=>{let n=zC(e,t),r=RC(e,t);return!r||!n?!1:n>r.depth},GC=(e,t)=>{let n=zC(e,t),r=RC(e,t);return!r||!n?!1:n<r.depth},KC=(e,t)=>{if(!__(e.state,t)||!Bee(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:WC(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():GC(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},bte=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},qC=Zv.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&KC(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&KC(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&UC(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&UC(e,n,r)&&(t=!0)}),t}}}}),JC=/^(\s*)(\d+)\.\s+(.*)$/,xte=/^\s/;function Ste(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(JC);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(JC))break;if(t.trim()===``)f.push(t),u+=`
191
+ `,d+=1;else if(t.match(xte))f.push(t),u+=`
192
+ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
193
+ `)}),r=d,n=d}return[t,r]}function YC(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
194
+ `),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
195
+ `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=YC(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
196
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function Cte(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var wte=`listItem`,XC=`textStyle`,ZC=/^(\d+)\.\s$/,QC=Py.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,X_(this.options.HTMLAttributes,n),0]:[`ol`,X_(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?Cte(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
197
+ `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
198
+ `),[i,a]=Ste(r);if(i.length===0)return;let o=YC(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
199
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wte,this.editor.getAttributes(XC)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=_y({find:ZC,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=_y({find:ZC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(XC)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),Tte=/^\s*(\[([( |x])?\])\s$/,$C=Py.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,X_(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>ky(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Z_(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[_y({find:Tte,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),ew=Py.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,X_(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
200
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Oy(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Oy(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Zv.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(IC.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(LC.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(qC.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(QC.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push($C.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(ew.configure(this.options.taskList)),e}});var tw=`&nbsp;`,nw=`\xA0`,Ete=Py.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,X_(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===tw||n[0].text===tw||n[0].raw===nw||n[0].text===nw)&&r.length===1&&r[0].type===`text`&&(r[0].text===tw||r[0].text===nw)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?tw:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Dte=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ote=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,kte=Vv.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,X_(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[py({find:Dte,type:this.type})]},addPasteRules(){return[Iy({find:Ote,type:this.type})]}}),Ate=Py.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),rw=Vv.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,X_(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function jte(e={}){return new hd({view(t){return new Mte(t,e)}})}var Mte=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Ou(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},iw=class e extends Yu{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):Yu.near(r)}content(){return B.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Nte(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Pte(e)||!Fte(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!td.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};iw.prototype.visible=!1,iw.findFrom=iw.findGapCursorFrom,Yu.jsonID(`gapcursor`,iw);var Nte=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return iw.valid(t)?new iw(t):Yu.near(t)}};function aw(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Pte(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||aw(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Fte(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||aw(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Ite(){return new hd({props:{decorations:Bte,createSelectionBetween(e,t,n){return t.pos==n.pos&&iw.valid(n)?new iw(n):null},handleClick:Rte,handleKeyDown:Lte,handleDOMEvents:{beforeinput:zte}}})}var Lte=vg({ArrowLeft:ow(`horiz`,-1),ArrowRight:ow(`horiz`,1),ArrowUp:ow(`vert`,-1),ArrowDown:ow(`vert`,1)});function ow(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof $u){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=iw.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new iw(c))),!0):!1}}function Rte(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!iw.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&td.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new iw(r))),!0)}function zte(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof iw))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=z.empty;for(let e=r.length-1;e>=0;e--)i=z.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new B(i,0,0));return a.setSelection($u.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Bte(e){if(!(e.selection instanceof iw))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,yh.create(e.doc,[gh.widget(e.selection.head,t,{key:`gapcursor`})])}var sw=200,cw=function(){};cw.prototype.append=function(e){return e.length?(e=cw.from(e),!this.length&&e||e.length<sw&&this.leafAppend(e)||this.length<sw&&e.leafPrepend(this)||this.appendInner(e)):this},cw.prototype.prepend=function(e){return e.length?cw.from(e).append(this):this},cw.prototype.appendInner=function(e){return new Vte(this,e)},cw.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?cw.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},cw.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},cw.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},cw.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},cw.from=function(e){return e instanceof cw?e:e&&e.length?new lw(e):cw.empty};var lw=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=sw)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=sw)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(cw);cw.empty=new lw([]);var Vte=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(cw),Hte=500,uw=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,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,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new dw(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new dw(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new dw(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Wte&&(s=Ute(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Kl;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new dw(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new dw(i,o,l))}else r.push(new dw(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new dw(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>Hte&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new dw(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(cw.from(i.reverse()),a)}};uw.empty=new uw(cw.empty,0);function Ute(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var dw=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},fw=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Wte=20;function Gte(e,t,n,r){let i=n.getMeta(vw),a;if(i)return i.historyState;n.getMeta(yw)&&(e=new fw(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(vw))return o.getMeta(vw).redo?new fw(e.done.addTransform(n,void 0,r,_w(t)),e.undone,pw(n.mapping.maps),e.prevTime,e.prevComposition):new fw(e.done,e.undone.addTransform(n,void 0,r,_w(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Kte(n,e.prevRanges)),s=o?mw(e.prevRanges,n.mapping):pw(n.mapping.maps);return new fw(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,_w(t)),uw.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new fw(e.done.rebased(n,a),e.undone.rebased(n,a),mw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new fw(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),mw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Kte(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function pw(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function mw(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function qte(e,t,n){let r=_w(t),i=vw.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new fw(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(vw,{redo:n,historyState:c})}var hw=!1,gw=null;function _w(e){let t=e.plugins;if(gw!=t){hw=!1,gw=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){hw=!0;break}}return hw}var vw=new vd(`history`),yw=new vd(`closeHistory`);function bw(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new hd({key:vw,state:{init(){return new fw(uw.empty,uw.empty,null,0,-1)},apply(t,n,r){return Gte(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Sw:n==`historyRedo`?Cw:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function xw(e,t){return(n,r)=>{let i=vw.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=qte(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Sw=xw(!1,!0),Cw=xw(!0,!0);Zv.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new hd({key:new vd(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var Jte=Zv.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[jte(this.options)]}});Zv.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new hd({key:new vd(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return yh.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(gh.node(t,t+e.nodeSize,{class:this.options.className}))}),yh.create(e,a)}}})]}});var ww=Zv.create({name:`gapCursor`,addProseMirrorPlugins(){return[Ite()]},extendNodeSchema(e){return{allowGapCursor:W_(H(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),Tw=`placeholder`;function Ew(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var Dw=Zv.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:Tw,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${Ew(this.options.dataAttribute)}`:`data-${Tw}`;return[new hd({key:new vd(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&pv(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=gh.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),yh.create(t,a)}}})]}});Zv.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new hd({key:new vd(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||mv(n.selection)||e.view.dragging?null:yh.create(n.doc,[gh.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function Ow({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var kw=Zv.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new vd(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new hd({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!Ow({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!Ow({node:r,types:n})}}})]}}),Aw=Zv.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Sw(e,t),redo:()=>({state:e,dispatch:t})=>Cw(e,t)}},addProseMirrorPlugins(){return[bw(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),jw=Zv.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(bx.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(hx.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(IC.configure(this.options.bulletList)),this.options.code!==!1&&e.push(Cx.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Dx.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Ox.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Jte.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(ww.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(kx.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Ax.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(Aw.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(jx.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Ix.configure(this.options.italic)),this.options.listItem!==!1&&e.push(LC.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(qC.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(NC.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(QC.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Ete.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(kte.configure(this.options.strike)),this.options.text!==!1&&e.push(Ate.configure(this.options.text)),this.options.underline!==!1&&e.push(rw.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(kw.configure(this.options?.trailingNode)),e}}),Mw=e(n(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,ee=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},j={begin:`\\\\[\\s\\S]`,relevance:0},te={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[j]},M={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[j]},ne={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},N=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},re=N(`//`,`$`),ie=N(`/\\*`,`\\*/`),ae=N(`#`,`$`),oe={scope:`number`,begin:D,relevance:0},se={scope:`number`,begin:O,relevance:0},ce={scope:`number`,begin:k,relevance:0},le={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[j,{begin:/\[/,end:/\]/,relevance:0,contains:[j]}]},P={scope:`title`,begin:T,relevance:0},ue={scope:`title`,begin:E,relevance:0},de={begin:`\\.\\s*`+E,relevance:0},fe=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:j,BINARY_NUMBER_MODE:ce,BINARY_NUMBER_RE:k,COMMENT:N,C_BLOCK_COMMENT_MODE:ie,C_LINE_COMMENT_MODE:re,C_NUMBER_MODE:se,C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ae,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:de,NUMBER_MODE:oe,NUMBER_RE:D,PHRASAL_WORDS_MODE:ne,QUOTE_STRING_MODE:M,REGEXP_MODE:le,RE_STARTERS_RE:A,SHEBANG:ee,TITLE_MODE:P,UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:ue});function pe(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function me(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function he(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=pe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ge(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function _e(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ve(e,t){e.relevance===void 0&&(e.relevance=1)}var ye=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},be=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],xe=`keyword`;function Se(e,t,n=xe){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,Se(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,Ce(n[0],n[1])]})}}function Ce(e,t){return t?Number(t):+!we(e)}function we(e){return be.includes(e.toLowerCase())}var Te={},Ee=e=>{console.error(e)},De=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Oe=(e,t)=>{Te[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Te[`${e}/${t}`]=!0)},ke=Error();function Ae(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function je(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ee(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ke;if(typeof e.beginScope!=`object`||e.beginScope===null)throw Ee(`beginScope must be object`),ke;Ae(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Me(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ee(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ke;if(typeof e.endScope!=`object`||e.endScope===null)throw Ee(`endScope must be object`),ke;Ae(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Ne(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Pe(e){Ne(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),je(e),Me(e)}function Fe(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[me,_e,Pe,ye].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[he,ge,ve].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=Se(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Le(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Ie(e){return e?e.endsWithParent||Ie(e.starts):!1}function Le(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Ie(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Re=`11.11.1`,ze=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Be=i,Ve=a,He=Symbol(`nomatch`),Ue=7,We=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=te(n[1]);return t||(De(s.replace(`{}`,n[1])),De(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||te(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Oe(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Oe(`10.7.0`,`Please use highlight(code, options) instead.
201
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ae(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ae(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){j.addText(M);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(M),n=``;for(;t;){n+=M.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(j.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ue&&(ne+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(M)}n+=M.substring(e),j.addText(n)}function f(){if(M===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){j.addText(M);return}e=v(A.subLanguage,M,!0,ee[A.subLanguage]),ee[A.subLanguage]=e._top}else e=S(M,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(ne+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),M=``}function m(e,t){e!==``&&(j.startScope(t),j.addText(e),j.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(M=i,d(),M=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&j.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(M,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=``):e.beginScope._multi&&(h(e.beginScope,t),M=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(M+=e[0],1):(ie=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?M+=t:(n.excludeBegin&&(M+=t),p(),!n.returnBegin&&!n.excludeBegin&&(M=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return He;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?M+=t:(a.returnEnd||a.excludeEnd||(M+=t),p(),a.excludeEnd&&(M=t));do A.scope&&j.closeNode(),!A.skip&&!A.subLanguage&&(ne+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(M+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(M+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==He)return e}if(r.type===`illegal`&&a===``)return M+=`
202
+ `,1;if(re>1e5&&re>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return M+=a,a.length}let D=te(e);if(!D)throw Ee(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=Fe(D),k=``,A=a||O,ee={},j=new l.__emitter(l);w();let M=``,ne=0,N=0,re=0,ie=!1;try{if(D.__emitTokens)D.__emitTokens(n,j);else{for(A.matcher.considerAll();;){re++,ie?ie=!1:A.matcher.considerAll(),A.matcher.lastIndex=N;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(N,e.index),e);N=e.index+t}E(n.substring(N))}return j.finalize(),k=j.toHTML(),{language:e,value:k,relevance:ne,illegal:!1,_emitter:j,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Be(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:k},_emitter:j};if(o)return{language:e,value:Be(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:A};throw t}}function b(e){let t={value:Be(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(te).filter(ne).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(te(e.language).supersetOf===t.language)return 1;if(te(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ae(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new ze(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ae(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ve(l,e)}let E=()=>{k(),Oe(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),Oe(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(Ee(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)Ee(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&M(i.aliases,{languageName:n})}function ee(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function j(){return Object.keys(t)}function te(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function M(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function ne(e){let t=te(e);return t&&!t.disableAutodetect}function N(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function re(e){N(e),a.push(e)}function ie(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ae(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function oe(e){return Oe(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Oe(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:oe,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:ee,listLanguages:j,getLanguage:te,registerAliases:M,autoDetection:ne,inherit:Ve,addPlugin:re,removePlugin:ie}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Re,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in fe)typeof fe[e]==`object`&&n(fe[e]);return Object.assign(e,fe),e},Ge=We({});Ge.newInstance=()=>We({}),t.exports=Ge,Ge.HighlightJS=Ge,Ge.default=Ge}))()).default;function Nw(e,t=[]){return e.flatMap(e=>{let n=[...t,...e.properties?e.properties.className:[]];return e.children?Nw(e.children,n):{text:e.value,classes:n}})}function Pw(e){return e.value||e.children||[]}function Fw(e){return!!Mw.getLanguage(e)}function Iw({doc:e,name:t,lowlight:n,defaultLanguage:r}){let i=[];return L_(e,e=>e.type.name===t).forEach(e=>{let t=e.pos+1,a=e.node.attrs.language||r,o=n.listLanguages();Nw(a&&(o.includes(a)||Fw(a)||n.registered?.call(n,a))?Pw(n.highlight(a,e.node.textContent)):Pw(n.highlightAuto(e.node.textContent))).forEach(e=>{let n=t+e.text.length;if(e.classes.length){let r=gh.inline(t,n,{class:e.classes.join(` `)});i.push(r)}t=n})}),yh.create(e,i)}function Lw(e){return typeof e==`function`}function Rw({name:e,lowlight:t,defaultLanguage:n}){if(![`highlight`,`highlightAuto`,`listLanguages`].every(e=>Lw(t[e])))throw Error(`You should provide an instance of lowlight to use the code-block-lowlight extension`);let r=new hd({key:new vd(`lowlight`),state:{init:(r,{doc:i})=>Iw({doc:i,name:e,lowlight:t,defaultLanguage:n}),apply:(r,i,a,o)=>{let s=a.selection.$head.parent.type.name,c=o.selection.$head.parent.type.name,l=L_(a.doc,t=>t.type.name===e),u=L_(o.doc,t=>t.type.name===e);return r.docChanged&&([s,c].includes(e)||u.length!==l.length||r.steps.some(e=>e.from!==void 0&&e.to!==void 0&&l.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?Iw({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations(e){return r.getState(e)}}});return r}var zw=Dx.extend({addOptions(){return{...this.parent?.call(this),lowlight:{},languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}},addProseMirrorPlugins(){return[...this.parent?.call(this)||[],Rw({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Bw=Dw,Vw={};function Hw(e){let t=Vw[e];if(t)return t;t=Vw[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function Uw(e,t){typeof t!=`string`&&(t=Uw.defaultChars);let n=Hw(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;e<128?t+=`��`:t+=String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;e<2048||e>=55296&&e<=57343?t+=`���`:t+=String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}Uw.defaultChars=`;/?:@&=+$,#`,Uw.componentChars=``;var Ww={};function Gw(e){let t=Ww[e];if(t)return t;t=Ww[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Kw(e,t,n){typeof t!=`string`&&(n=t,t=Kw.defaultChars),n===void 0&&(n=!0);let r=Gw(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}Kw.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Kw.componentChars=`-_.!~*'()`;function qw(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function Jw(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Yte=/^([a-z0-9.+-]+:)/i,Yw=/:[0-9]*$/,Xw=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Zw=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
203
+ `,` `],Qw=[`/`,`?`,`#`],$w=255,eT=/^[+a-z0-9A-Z_-]{0,63}$/,tT=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,nT={javascript:!0,"javascript:":!0},rT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function iT(e,t){if(e&&e instanceof Jw)return e;let n=new Jw;return n.parse(e,t),n}Jw.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Xw.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=Yte.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&nT[o])&&(a=a.substr(2),this.slashes=!0)),!nT[o]&&(i||o&&!rT[o])){let e=-1;for(let t=0;t<Qw.length;t++)r=a.indexOf(Qw[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<Zw.length;t++)r=a.indexOf(Zw[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(eT)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(eT)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(tT);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>$w&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),rT[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Jw.prototype.parseHost=function(e){let t=Yw.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var aT=t({decode:()=>Uw,encode:()=>Kw,format:()=>qw,parse:()=>iT}),oT=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,sT=/[\0-\x1F\x7F-\x9F]/,cT=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,lT=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,uT=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,dT=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,fT=t({Any:()=>oT,Cc:()=>sT,Cf:()=>cT,P:()=>lT,S:()=>uT,Z:()=>dT}),pT=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),mT=new Uint16Array(`Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢`.split(``).map(e=>e.charCodeAt(0))),hT=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),gT=String.fromCodePoint??function(e){let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function _T(e){return e>=55296&&e<=57343||e>1114111?65533:hT.get(e)??e}var vT;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(vT||={});var yT=32,bT;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(bT||={});function xT(e){return e>=vT.ZERO&&e<=vT.NINE}function ST(e){return e>=vT.UPPER_A&&e<=vT.UPPER_F||e>=vT.LOWER_A&&e<=vT.LOWER_F}function CT(e){return e>=vT.UPPER_A&&e<=vT.UPPER_Z||e>=vT.LOWER_A&&e<=vT.LOWER_Z||xT(e)}function wT(e){return e===vT.EQUALS||CT(e)}var TT;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(TT||={});var ET;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(ET||={});var DT=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=TT.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ET.Strict}startEntity(e){this.decodeMode=e,this.state=TT.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case TT.EntityStart:return e.charCodeAt(t)===vT.NUM?(this.state=TT.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=TT.NamedEntity,this.stateNamedEntity(e,t));case TT.NumericStart:return this.stateNumericStart(e,t);case TT.NumericDecimal:return this.stateNumericDecimal(e,t);case TT.NumericHex:return this.stateNumericHex(e,t);case TT.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|yT)===vT.LOWER_X?(this.state=TT.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=TT.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(xT(r)||ST(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(xT(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===vT.SEMI)this.consumed+=1;else if(this.decodeMode===ET.Strict)return 0;return this.emitCodePoint(_T(this.result),this.consumed),this.errors&&(e!==vT.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&bT.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=kT(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===ET.Attribute&&(i===0||wT(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&bT.VALUE_LENGTH)>>14,i!==0){if(a===vT.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==ET.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&bT.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~bT.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case TT.NamedEntity:return this.result!==0&&(this.decodeMode!==ET.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case TT.NumericDecimal:return this.emitNumericEntity(0,2);case TT.NumericHex:return this.emitNumericEntity(0,3);case TT.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case TT.EntityStart:return 0}}};function OT(e){let t=``,n=new DT(e,e=>t+=gT(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function kT(e,t,n,r){let i=(t&bT.BRANCH_LENGTH)>>7,a=t&bT.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var AT=OT(pT);OT(mT);function jT(e,t=ET.Legacy){return AT(e,t)}var MT=t({arrayReplaceAt:()=>FT,assign:()=>PT,escapeHtml:()=>BT,escapeRE:()=>cne,fromCodePoint:()=>LT,has:()=>Qte,isMdAsciiPunct:()=>WT,isPunctChar:()=>UT,isSpace:()=>VT,isString:()=>NT,isValidEntityCode:()=>IT,isWhiteSpace:()=>HT,lib:()=>KT,normalizeReference:()=>GT,unescapeAll:()=>zT,unescapeMd:()=>nne});function Xte(e){return Object.prototype.toString.call(e)}function NT(e){return Xte(e)===`[object String]`}var Zte=Object.prototype.hasOwnProperty;function Qte(e,t){return Zte.call(e,t)}function PT(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function FT(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function IT(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function LT(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var RT=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,$te=RegExp(RT.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),ene=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function tne(e,t){if(t.charCodeAt(0)===35&&ene.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return IT(n)?LT(n):e}let n=jT(e);return n===e?e:n}function nne(e){return e.indexOf(`\\`)<0?e:e.replace(RT,`$1`)}function zT(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace($te,function(e,t,n){return t||tne(e,n)})}var rne=/[&<>"]/,ine=/[&<>"]/g,ane={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function one(e){return ane[e]}function BT(e){return rne.test(e)?e.replace(ine,one):e}var sne=/[.?*+^$[\]\\(){}|-]/g;function cne(e){return e.replace(sne,`\\$&`)}function VT(e){switch(e){case 9:case 32:return!0}return!1}function HT(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function UT(e){return lT.test(e)||uT.test(e)}function WT(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function GT(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}var KT={mdurl:aT,ucmicro:fT};function qT(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function JT(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=zT(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=zT(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function YT(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=zT(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=zT(e.slice(t,a)),o}var XT=t({parseLinkDestination:()=>JT,parseLinkLabel:()=>qT,parseLinkTitle:()=>YT}),ZT={};ZT.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+BT(a.content)+`</code>`},ZT.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+BT(e[t].content)+`</code></pre>
204
+ `},ZT.fence=function(e,t,n,r,i){let a=e[t],o=a.info?zT(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||BT(a.content),l.indexOf(`<pre`)===0)return l+`
205
+ `;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},ZT.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},ZT.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
206
+ `:`<br>
207
+ `},ZT.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
208
+ `:`<br>
209
+ `:`
210
+ `},ZT.text=function(e,t){return BT(e[t].content)},ZT.html_block=function(e,t){return e[t].content},ZT.html_inline=function(e,t){return e[t].content};function QT(){this.rules=PT({},ZT)}QT.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+BT(e.attrs[t][0])+`="`+BT(e.attrs[t][1])+`"`;return r},QT.prototype.renderToken=function(e,t,n){let r=e[t],i=``;if(r.hidden)return``;r.block&&r.nesting!==-1&&t&&e[t-1].hidden&&(i+=`
211
+ `),i+=(r.nesting===-1?`</`:`<`)+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=` /`);let a=!1;if(r.block&&(a=!0,r.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===r.tag)&&(a=!1)}return i+=a?`>
212
+ `:`>`,i},QT.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},QT.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=`
213
+ `;break;default:}return r},QT.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};function $T(){this.__rules__=[],this.__cache__=null}$T.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},$T.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},$T.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},$T.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},$T.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},$T.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},$T.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},$T.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},$T.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},$T.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function eE(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}eE.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},eE.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},eE.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},eE.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},eE.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};function tE(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}tE.prototype.Token=eE;var nE=/\r\n?|\n/g,rE=/\0/g;function iE(e){let t;t=e.src.replace(nE,`
214
+ `),t=t.replace(rE,`�`),e.src=t}function aE(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function oE(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function sE(e){return/^<a[>\s]/i.test(e)}function cE(e){return/^<\/a\s*>/i.test(e)}function lE(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(sE(o.content)&&i>0&&i--,cE(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=FT(r,a,c)}}}}var uE=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,dE=/\((c|tm|r)\)/i,fE=/\((c|tm|r)\)/gi,pE={c:`©`,r:`®`,tm:`™`};function mE(e,t){return pE[t.toLowerCase()]}function hE(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(fE,mE)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function gE(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&uE.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function _E(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(dE.test(e.tokens[t].content)&&hE(e.tokens[t].children),uE.test(e.tokens[t].content)&&gE(e.tokens[t].children))}var vE=/['"]/,yE=/['"]/g,bE=`’`;function xE(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function SE(e,t){let n,r=[];for(let i=0;i<e.length;i++){let a=e[i],o=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,a.type!==`text`)continue;let s=a.content,c=0,l=s.length;OUTER:for(;c<l;){yE.lastIndex=c;let u=yE.exec(s);if(!u)break;let d=!0,f=!0;c=u.index+1;let p=u[0]===`'`,m=32;if(u.index-1>=0)m=s.charCodeAt(u.index-1);else for(n=i-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(c<l)h=s.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=WT(m)||UT(String.fromCharCode(m)),_=WT(h)||UT(String.fromCharCode(h)),v=HT(m),y=HT(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&u[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&(a.content=xE(a.content,u.index,bE));continue}if(f)for(n=r.length-1;n>=0;n--){let d=r[n];if(r[n].level<o)break;if(d.single===p&&r[n].level===o){d=r[n];let o,f;p?(o=t.md.options.quotes[2],f=t.md.options.quotes[3]):(o=t.md.options.quotes[0],f=t.md.options.quotes[1]),a.content=xE(a.content,u.index,f),e[d.token].content=xE(e[d.token].content,d.pos,o),c+=f.length-1,d.token===i&&(c+=o.length-1),s=a.content,l=s.length,r.length=n;continue OUTER}}d?r.push({token:i,pos:u.index,single:p,level:o}):f&&p&&(a.content=xE(a.content,u.index,bE))}}}function CE(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!vE.test(e.tokens[t].content)||SE(e.tokens[t].children,e)}function wE(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var TE=[[`normalize`,iE],[`block`,aE],[`inline`,oE],[`linkify`,lE],[`replacements`,_E],[`smartquotes`,CE],[`text_join`,wE]];function EE(){this.ruler=new $T;for(let e=0;e<TE.length;e++)this.ruler.push(TE[e][0],TE[e][1])}EE.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},EE.prototype.State=tE;function DE(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if(VT(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}DE.prototype.push=function(e,t,n){let r=new eE(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},DE.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},DE.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},DE.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&VT(this.src.charCodeAt(e));e++);return e},DE.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!VT(this.src.charCodeAt(--e)))return e+1;return e},DE.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},DE.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},DE.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(VT(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},DE.prototype.Token=eE;var OE=65536;function kE(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function AE(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function jE(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!VT(s)||o===45&&VT(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!VT(t))return!1;a++}let c=kE(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=kE(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=AE(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=kE(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=AE(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>OE))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function ME(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+`
215
+ `,a.map=[t,e.line],!0}function NE(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function PE(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(VT(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function FE(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!VT(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function IE(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!VT(e.src.charCodeAt(r))?-1:r}function LE(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!VT(a))?-1:i}function RE(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function zE(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=LE(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=IE(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=LE(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=IE(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&RE(e,h),!0}function BE(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!VT(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!VT(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&VT(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&VT(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=GT(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var VE=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),HE=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,UE=RegExp(`^(?:`+HE+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),WE=RegExp(`^(?:`+HE+`|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),GE=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+VE.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(WE.source+`\\s*$`),/^$/,!1]];function KE(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<GE.length&&!GE[s][0].test(o);s++);if(s===GE.length)return!1;if(r)return GE[s][2];let c=t+1;if(!GE[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),GE[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function qE(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!VT(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&VT(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=e.src.slice(i,a).trim(),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function JE(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return!1;let c=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function YE(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=e.getLines(t,a,e.blkIndent,!1).trim();e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var XE=[[`table`,jE,[`paragraph`,`reference`]],[`code`,ME],[`fence`,NE,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,PE,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,FE,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,zE,[`paragraph`,`reference`,`blockquote`]],[`reference`,BE],[`html_block`,KE,[`paragraph`,`reference`,`blockquote`]],[`heading`,qE,[`paragraph`,`reference`,`blockquote`]],[`lheading`,JE],[`paragraph`,YE]];function ZE(){this.ruler=new $T;for(let e=0;e<XE.length;e++)this.ruler.push(XE[e][0],XE[e][1],{alt:(XE[e][2]||[]).slice()})}ZE.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},ZE.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},ZE.prototype.State=DE;function QE(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}QE.prototype.pushPending=function(){let e=new eE(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},QE.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new eE(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},QE.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32,a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32,c=WT(i)||UT(String.fromCharCode(i)),l=WT(s)||UT(String.fromCharCode(s)),u=HT(i),d=HT(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},QE.prototype.Token=eE;function $E(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function eD(e,t){let n=e.pos;for(;n<e.posMax&&!$E(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var tD=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function nD(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(tD);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function rD(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&VT(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var iD=[];for(let e=0;e<256;e++)iD.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){iD[e.charCodeAt(0)]=1});function aD(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),VT(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&iD[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function oD(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function sD(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function cD(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function lD(e){let t=e.tokens_meta,n=e.tokens_meta.length;cD(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&cD(e,t[r].delimiters)}var uD={tokenize:sD,postProcess:lD};function dD(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function fD(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function pD(e){let t=e.tokens_meta,n=e.tokens_meta.length;fD(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&fD(e,t[r].delimiters)}var mD={tokenize:dD,postProcess:pD};function hD(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!VT(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!VT(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!VT(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[GT(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function gD(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!VT(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!VT(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!VT(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[GT(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var _D=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,vD=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function yD(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(vD.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(_D.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function bD(e){return/^<a[>\s]/i.test(e)}function xD(e){return/^<\/a\s*>/i.test(e)}function SD(e){let t=e|32;return t>=97&&t<=122}function CD(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!SD(i))return!1;let a=e.src.slice(r).match(UE);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],bD(t.content)&&e.linkLevel++,xD(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var wD=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,TD=/^&([a-z][a-z0-9]{1,31});/i;function ED(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(wD);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=IT(t)?LT(t):LT(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(TD);if(r){let n=jT(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function DD(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function OD(e){let t=e.tokens_meta,n=e.tokens_meta.length;DD(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&DD(t[e].delimiters)}function kD(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var AD=[[`text`,eD],[`linkify`,nD],[`newline`,rD],[`escape`,aD],[`backticks`,oD],[`strikethrough`,uD.tokenize],[`emphasis`,mD.tokenize],[`link`,hD],[`image`,gD],[`autolink`,yD],[`html_inline`,CD],[`entity`,ED]],jD=[[`balance_pairs`,OD],[`strikethrough`,uD.postProcess],[`emphasis`,mD.postProcess],[`fragments_join`,kD]];function MD(){this.ruler=new $T;for(let e=0;e<AD.length;e++)this.ruler.push(AD[e][0],AD[e][1]);this.ruler2=new $T;for(let e=0;e<jD.length;e++)this.ruler2.push(jD[e][0],jD[e][1])}MD.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},MD.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},MD.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},MD.prototype.State=QE;function ND(e){let t={};e||={},t.src_Any=oT.source,t.src_Cc=sT.source,t.src_Z=dT.source,t.src_P=lT.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!`+n+`|`+t.src_ZPCc+`)`+t.src_Any+`)`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!`+t.src_ZCc+`|[@/\\[\\]()]).)+@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|`+n+`|`+t.src_ZPCc+`)(?!`+(e[`---`]?`-(?!--)|`:`-|`)+`_|:\\d|\\.-|\\.(?!$|`+t.src_ZPCc+`))`,t.src_path=`(?:[/?#](?:(?!`+t.src_ZCc+`|[><|]|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+`|\\]).)*\\]|\\((?:(?!`+t.src_ZCc+`|[)]).)*\\)|\\{(?:(?!`+t.src_ZCc+`|[}]).)*\\}|\\"(?:(?!`+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+`|[']).)+\\'|\\'(?=`+t.src_pseudo_letter+`|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!`+t.src_ZCc+`|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!`+t.src_ZCc+`|$)|;(?!`+t.src_ZCc+`|$)|\\!+(?!`+t.src_ZCc+`|[!]|$)|\\?(?!`+t.src_ZCc+`|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|`+t.src_pseudo_letter+`{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:`+t.src_pseudo_letter+`)|(?:`+t.src_pseudo_letter+`(?:-|`+t.src_pseudo_letter+`){0,61}`+t.src_pseudo_letter+`))`,t.src_host=`(?:(?:(?:(?:`+t.src_domain+`)\\.)*`+t.src_domain+`))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:`+t.src_domain+`)\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:`+t.src_ZPCc+`|>|$))`,t.tpl_email_fuzzy=`(^|`+n+`|"|\\(|`+t.src_ZCc+`)(`+t.src_email_name+`@`+t.tpl_host_fuzzy_strict+`)`,t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+`)`,t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+`)`,t}function PD(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function FD(e){return Object.prototype.toString.call(e)}function ID(e){return FD(e)===`[object String]`}function LD(e){return FD(e)===`[object Object]`}function RD(e){return FD(e)===`[object RegExp]`}function zD(e){return FD(e)===`[object Function]`}function BD(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var VD={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function HD(e){return Object.keys(e||{}).reduce(function(e,t){return e||VD.hasOwnProperty(t)},!1)}var UD={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/`+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:`+n.re.src_domain+`)\\.)+`+n.re.src_domain_root+`)`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^`+n.re.src_email_name+`@`+n.re.src_host_strict,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},WD=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,GD=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function KD(e){e.__index__=-1,e.__text_cache__=``}function qD(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function JD(){return function(e,t){t.normalize(e)}}function YD(e){let t=e.re=ND(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(WD),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "`+e+`": `+t)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,LD(n)){RD(n.validate)?r.validate=qD(n.validate):zD(n.validate)?r.validate=n.validate:a(t,n),zD(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=JD();return}if(ID(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:JD()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(BD).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|`+t.src_ZPCc+`))(`+o+`)`,`ig`),e.re.schema_at_start=RegExp(`^`+e.re.schema_search.source,`i`),e.re.pretest=RegExp(`(`+e.re.schema_test.source+`)|(`+e.re.host_fuzzy_test.source+`)|@`,`i`),KD(e)}function XD(e,t){let n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function ZD(e,t){let n=new XD(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function QD(e,t){if(!(this instanceof QD))return new QD(e,t);t||HD(e)&&(t=e,e={}),this.__opts__=PD({},VD,t),this.__index__=-1,this.__last_index__=-1,this.__schema__=``,this.__text_cache__=``,this.__schemas__=PD({},UD,e),this.__compiled__={},this.__tlds__=GD,this.__tlds_replaced__=!1,this.re={},YD(this)}QD.prototype.add=function(e,t){return this.__schemas__[e]=t,YD(this),this},QD.prototype.set=function(e){return this.__opts__=PD(this.__opts__,e),this},QD.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,n,r,i,a,o,s,c,l;if(this.re.schema_test.test(e)){for(s=this.re.schema_search,s.lastIndex=0;(t=s.exec(e))!==null;)if(i=this.testSchemaAt(e,t[2],s.lastIndex),i){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&(c=e.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=n.index+n[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__=``,this.__index__=a,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&(l=e.indexOf(`@`),l>=0&&(r=e.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&o>this.__last_index__)&&(this.__schema__=`mailto:`,this.__index__=a,this.__last_index__=o))),this.__index__>=0},QD.prototype.pretest=function(e){return this.re.pretest.test(e)},QD.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},QD.prototype.match=function(e){let t=[],n=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(ZD(this,n)),n=this.__last_index__);let r=n?e.slice(n):e;for(;this.test(r);)t.push(ZD(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return t.length?t:null},QD.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,ZD(this,0)):null},QD.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),YD(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,YD(this),this)},QD.prototype.normalize=function(e){e.schema||(e.url=`http://`+e.url),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:`+e.url)},QD.prototype.onCompile=function(){};var $D=2147483647,eO=36,tO=1,nO=26,rO=38,iO=700,aO=72,oO=128,sO=`-`,cO=/^xn--/,lO=/[^\0-\x7F]/,uO=/[\x2E\u3002\uFF0E\uFF61]/g,dO={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},fO=eO-tO,pO=Math.floor,mO=String.fromCharCode;function hO(e){throw RangeError(dO[e])}function gO(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function _O(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(uO,`.`);let i=gO(e.split(`.`),t).join(`.`);return r+i}function vO(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var lne=e=>String.fromCodePoint(...e),une=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:eO},yO=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},bO=function(e,t,n){let r=0;for(e=n?pO(e/iO):e>>1,e+=pO(e/t);e>fO*nO>>1;r+=eO)e=pO(e/fO);return pO(r+(fO+1)*e/(e+rO))},xO=function(e){let t=[],n=e.length,r=0,i=oO,a=aO,o=e.lastIndexOf(sO);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&hO(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=eO;;i+=eO){s>=n&&hO(`invalid-input`);let o=une(e.charCodeAt(s++));o>=eO&&hO(`invalid-input`),o>pO(($D-r)/t)&&hO(`overflow`),r+=o*t;let c=i<=a?tO:i>=a+nO?nO:i-a;if(o<c)break;let l=eO-c;t>pO($D/l)&&hO(`overflow`),t*=l}let c=t.length+1;a=bO(r-o,c,o==0),pO(r/c)>$D-i&&hO(`overflow`),i+=pO(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},SO=function(e){let t=[];e=vO(e);let n=e.length,r=oO,i=0,a=aO;for(let n of e)n<128&&t.push(mO(n));let o=t.length,s=o;for(o&&t.push(sO);s<n;){let n=$D;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>pO(($D-i)/c)&&hO(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>$D&&hO(`overflow`),n===r){let e=i;for(let n=eO;;n+=eO){let r=n<=a?tO:n>=a+nO?nO:n-a;if(e<r)break;let i=e-r,o=eO-r;t.push(mO(yO(r+i%o,0))),e=pO(i/o)}t.push(mO(yO(e,0))),a=bO(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},CO={version:`2.3.1`,ucs2:{decode:vO,encode:lne},decode:xO,encode:SO,toASCII:function(e){return _O(e,function(e){return lO.test(e)?`xn--`+SO(e):e})},toUnicode:function(e){return _O(e,function(e){return cO.test(e)?xO(e.slice(4).toLowerCase()):e})}},dne={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},fne=/^(vbscript|javascript|file|data):/,pne=/^data:image\/(gif|png|jpeg|webp);/;function mne(e){let t=e.trim().toLowerCase();return fne.test(t)?pne.test(t):!0}var wO=[`http:`,`https:`,`mailto:`];function hne(e){let t=iT(e,!0);if(t.hostname&&(!t.protocol||wO.indexOf(t.protocol)>=0))try{t.hostname=CO.toASCII(t.hostname)}catch{}return Kw(qw(t))}function gne(e){let t=iT(e,!0);if(t.hostname&&(!t.protocol||wO.indexOf(t.protocol)>=0))try{t.hostname=CO.toUnicode(t.hostname)}catch{}return Uw(qw(t),Uw.defaultChars+`%`)}function TO(e,t){if(!(this instanceof TO))return new TO(e,t);t||NT(e)||(t=e||{},e=`default`),this.inline=new MD,this.block=new ZE,this.core=new EE,this.renderer=new QT,this.linkify=new QD,this.validateLink=mne,this.normalizeLink=hne,this.normalizeLinkText=gne,this.utils=MT,this.helpers=PT({},XT),this.options={},this.configure(e),t&&this.set(t)}TO.prototype.set=function(e){return PT(this.options,e),this},TO.prototype.configure=function(e){let t=this;if(NT(e)){let t=e;if(e=dne[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},TO.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},TO.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},TO.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},TO.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},TO.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},TO.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},TO.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var _ne=new ul({nodes:{doc:{content:`block+`},paragraph:{content:`inline*`,group:`block`,parseDOM:[{tag:`p`}],toDOM(){return[`p`,0]}},blockquote:{content:`block+`,group:`block`,parseDOM:[{tag:`blockquote`}],toDOM(){return[`blockquote`,0]}},horizontal_rule:{group:`block`,parseDOM:[{tag:`hr`}],toDOM(){return[`div`,[`hr`]]}},heading:{attrs:{level:{default:1}},content:`(text | image)*`,group:`block`,defining:!0,parseDOM:[{tag:`h1`,attrs:{level:1}},{tag:`h2`,attrs:{level:2}},{tag:`h3`,attrs:{level:3}},{tag:`h4`,attrs:{level:4}},{tag:`h5`,attrs:{level:5}},{tag:`h6`,attrs:{level:6}}],toDOM(e){return[`h`+e.attrs.level,0]}},code_block:{content:`text*`,group:`block`,code:!0,defining:!0,marks:``,attrs:{params:{default:``}},parseDOM:[{tag:`pre`,preserveWhitespace:`full`,getAttrs:e=>({params:e.getAttribute(`data-params`)||``})}],toDOM(e){return[`pre`,e.attrs.params?{"data-params":e.attrs.params}:{},[`code`,0]]}},ordered_list:{content:`list_item+`,group:`block`,attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:`ol`,getAttrs(e){return{order:e.hasAttribute(`start`)?+e.getAttribute(`start`):1,tight:e.hasAttribute(`data-tight`)}}}],toDOM(e){return[`ol`,{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?`true`:null},0]}},bullet_list:{content:`list_item+`,group:`block`,attrs:{tight:{default:!1}},parseDOM:[{tag:`ul`,getAttrs:e=>({tight:e.hasAttribute(`data-tight`)})}],toDOM(e){return[`ul`,{"data-tight":e.attrs.tight?`true`:null},0]}},list_item:{content:`block+`,defining:!0,parseDOM:[{tag:`li`}],toDOM(){return[`li`,0]}},text:{group:`inline`},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:`inline`,draggable:!0,parseDOM:[{tag:`img[src]`,getAttrs(e){return{src:e.getAttribute(`src`),title:e.getAttribute(`title`),alt:e.getAttribute(`alt`)}}}],toDOM(e){return[`img`,e.attrs]}},hard_break:{inline:!0,group:`inline`,selectable:!1,parseDOM:[{tag:`br`}],toDOM(){return[`br`]}}},marks:{em:{parseDOM:[{tag:`i`},{tag:`em`},{style:`font-style=italic`},{style:`font-style=normal`,clearMark:e=>e.type.name==`em`}],toDOM(){return[`em`]}},strong:{parseDOM:[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!=`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name==`strong`},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return[`strong`]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:`a[href]`,getAttrs(e){return{href:e.getAttribute(`href`),title:e.getAttribute(`title`)}}}],toDOM(e){return[`a`,e.attrs]}},code:{code:!0,parseDOM:[{tag:`code`}],toDOM(){return[`code`]}}}});function vne(e,t){if(e.isText&&t.isText&&bc.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}var yne=class{constructor(e,t){this.schema=e,this.tokenHandlers=t,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:bc.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let t=this.top(),n=t.content,r=n[n.length-1],i=this.schema.text(e,t.marks),a;r&&(a=vne(r,i))?n[n.length-1]=a:n.push(i)}openMark(e){let t=this.top();t.marks=e.addToSet(t.marks)}closeMark(e){let t=this.top();t.marks=e.removeFromSet(t.marks)}parseTokens(e){for(let t=0;t<e.length;t++){let n=e[t],r=this.tokenHandlers[n.type];if(!r)throw Error("Token type `"+n.type+"` not supported by Markdown parser");r(this,n,e,t)}}addNode(e,t,n){let r=this.top(),i=e.createAndFill(t,n,r?r.marks:[]);return i?(this.push(i),i):null}openNode(e,t){this.stack.push({type:e,attrs:t,content:[],marks:bc.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}};function EO(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function DO(e,t){return e.noCloseToken||t==`code_inline`||t==`code_block`||t==`fence`}function OO(e){return e[e.length-1]==`
216
+ `?e.slice(0,e.length-1):e}function kO(){}function bne(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let t=e.nodeType(i.block);DO(i,r)?n[r]=(e,n,r,a)=>{e.openNode(t,EO(i,n,r,a)),e.addText(OO(n.content)),e.closeNode()}:(n[r+`_open`]=(e,n,r,a)=>e.openNode(t,EO(i,n,r,a)),n[r+`_close`]=e=>e.closeNode())}else if(i.node){let t=e.nodeType(i.node);n[r]=(e,n,r,a)=>e.addNode(t,EO(i,n,r,a))}else if(i.mark){let t=e.marks[i.mark];DO(i,r)?n[r]=(e,n,r,a)=>{e.openMark(t.create(EO(i,n,r,a))),e.addText(OO(n.content)),e.closeMark(t)}:(n[r+`_open`]=(e,n,r,a)=>e.openMark(t.create(EO(i,n,r,a))),n[r+`_close`]=e=>e.closeMark(t))}else if(i.ignore)DO(i,r)?n[r]=kO:(n[r+`_open`]=kO,n[r+`_close`]=kO);else throw RangeError(`Unrecognized parsing spec `+JSON.stringify(i))}return n.text=(e,t)=>e.addText(t.content),n.inline=(e,t)=>e.parseTokens(t.children),n.softbreak=n.softbreak||(e=>e.addText(` `)),n}var xne=class{constructor(e,t,n){this.schema=e,this.tokenizer=t,this.tokens=n,this.tokenHandlers=bne(e,n)}parse(e,t={}){let n=new yne(this.schema,this.tokenHandlers),r;n.parseTokens(this.tokenizer.parse(e,t));do r=n.closeNode();while(n.stack.length);return r||this.schema.topNodeType.createAndFill()}};function AO(e,t){for(;++t<e.length;)if(e[t].type!=`list_item_open`)return e[t].hidden;return!1}new xne(_ne,TO(`commonmark`,{html:!1}),{blockquote:{block:`blockquote`},paragraph:{block:`paragraph`},list_item:{block:`list_item`},bullet_list:{block:`bullet_list`,getAttrs:(e,t,n)=>({tight:AO(t,n)})},ordered_list:{block:`ordered_list`,getAttrs:(e,t,n)=>({order:+e.attrGet(`start`)||1,tight:AO(t,n)})},heading:{block:`heading`,getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:`code_block`,noCloseToken:!0},fence:{block:`code_block`,getAttrs:e=>({params:e.info||``}),noCloseToken:!0},hr:{node:`horizontal_rule`},image:{node:`image`,getAttrs:e=>({src:e.attrGet(`src`),title:e.attrGet(`title`)||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:`hard_break`},em:{mark:`em`},strong:{mark:`strong`},link:{mark:`link`,getAttrs:e=>({href:e.attrGet(`href`),title:e.attrGet(`title`)||null})},code_inline:{mark:`code`,noCloseToken:!0}});var Sne={open:``,close:``,mixable:!0},jO=new class{constructor(e,t,n={}){this.nodes=e,this.marks=t,this.options=n}serialize(e,t={}){t=Object.assign({},this.options,t);let n=new NO(this.nodes,this.marks,t);return n.renderContent(e),n.out}}({blockquote(e,t){e.wrapBlock(`> `,null,t,()=>e.renderContent(t))},code_block(e,t){let n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||``)+`
217
+ `),e.text(t.textContent,!1),e.write(`
218
+ `),e.write(r),e.closeBlock(t)},heading(e,t){e.write(e.repeat(`#`,t.attrs.level)+` `),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||`---`),e.closeBlock(t)},bullet_list(e,t){e.renderList(t,` `,()=>(t.attrs.bullet||`*`)+` `)},ordered_list(e,t){let n=t.attrs.order||1,r=String(n+t.childCount-1).length,i=e.repeat(` `,r+2);e.renderList(t,i,t=>{let i=String(n+t);return e.repeat(` `,r-i.length)+i+`. `})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write(`![`+e.esc(t.attrs.alt||``)+`](`+t.attrs.src.replace(/[\(\)]/g,`\\$&`)+(t.attrs.title?` "`+t.attrs.title.replace(/"/g,`\\"`)+`"`:``)+`)`)},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(`\\
219
+ `);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:`*`,close:`*`,mixable:!0,expelEnclosingWhitespace:!0},strong:{open:`**`,close:`**`,mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,r){return e.inAutolink=Cne(t,n,r),e.inAutolink?`<`:`[`},close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?`>`:`](`+t.attrs.href.replace(/[\(\)"]/g,`\\$&`)+(t.attrs.title?` "${t.attrs.title.replace(/"/g,`\\"`)}"`:``)+`)`},mixable:!0},code:{open(e,t,n,r){return MO(n.child(r),-1)},close(e,t,n,r){return MO(n.child(r-1),1)},escape:!1}});function MO(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let a=i>0&&t>0?" `":"`";for(let e=0;e<i;e++)a+="`";return i>0&&t<0&&(a+=` `),a}function Cne(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!r.isText||r.text!=e.attrs.href||r.marks[r.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}var NO=class{constructor(e,t,n){this.nodes=e,this.marks=t,this.options=n,this.delim=``,this.out=``,this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,this.options.tightLists===void 0&&(this.options.tightLists=!1),this.options.hardBreakNodeName===void 0&&(this.options.hardBreakNodeName=`hard_break`)}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
220
+ `),e>1){let t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(let n=1;n<e;n++)this.out+=t+`
221
+ `}this.closed=null}}getMark(e){let t=this.marks[e];if(!t){if(this.options.strict!==!1)throw Error(`Mark type \`${e}\` not supported by Markdown renderer`);t=Sne}return t}wrapBlock(e,t,n,r){let i=this.delim;this.write(t??e),this.delim+=e,r(),this.delim=i,this.closeBlock(n)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
222
+ `)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,t=!0){let n=e.split(`
223
+ `);for(let e=0;e<n.length;e++)this.write(),!t&&n[e][0]==`[`&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+`\\!`),this.out+=t?this.esc(n[e],this.atBlockStart):n[e],e!=n.length-1&&(this.out+=`
224
+ `)}render(e,t,n){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,t,n);else if(this.options.strict!==!1)throw Error("Token type `"+e.type.name+"` not supported by Markdown renderer");else e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}renderContent(e){e.forEach((t,n,r)=>this.render(t,e,r))}renderInline(e,t=!0){this.atBlockStart=t;let n=[],r=``,i=(t,i,a)=>{let o=t?t.marks:[];t&&t.type.name===this.options.hardBreakNodeName&&(o=o.filter(t=>{if(a+1==e.childCount)return!1;let n=e.child(a+1);return t.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text))}));let s=r;if(r=``,t&&t.isText&&o.some(e=>{let t=this.getMark(e.type.name);return t&&t.expelEnclosingWhitespace&&!e.isInSet(n)})){let[e,r,i]=/^(\s*)(.*)$/m.exec(t.text);r&&(s+=r,t=i?t.withText(i):null,t||(o=n))}if(t&&t.isText&&o.some(t=>{let n=this.getMark(t.type.name);return n&&n.expelEnclosingWhitespace&&!this.isMarkAhead(e,a+1,t)})){let[e,i,a]=/^(.*?)(\s*)$/m.exec(t.text);a&&(r=a,t=i?t.withText(i):null,t||(o=n))}let c=o.length?o[o.length-1]:null,l=c&&this.getMark(c.type.name).escape===!1,u=o.length-+!!l;outer:for(let e=0;e<u;e++){let t=o[e];if(!this.getMark(t.type.name).mixable)break;for(let r=0;r<n.length;r++){let i=n[r];if(!this.getMark(i.type.name).mixable)break;if(t.eq(i)){e>r?o=o.slice(0,r).concat(t).concat(o.slice(r,e)).concat(o.slice(e+1,u)):r>e&&(o=o.slice(0,e).concat(o.slice(e+1,r)).concat(t).concat(o.slice(r,u)));continue outer}}}let d=0;for(;d<Math.min(n.length,u)&&o[d].eq(n[d]);)++d;for(;d<n.length;)this.text(this.markString(n.pop(),!1,e,a),!1);if(s&&this.text(s),t){for(;n.length<u;){let t=o[n.length];n.push(t),this.text(this.markString(t,!0,e,a),!1),this.atBlockStart=!1}l&&t.isText?this.text(this.markString(c,!0,e,a)+t.text+this.markString(c,!1,e,a+1),!1):this.render(t,e,a),this.atBlockStart=!1}t?.isText&&t.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(i),i(null,0,e.childCount),this.atBlockStart=!1}renderList(e,t,n){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=e.attrs.tight===void 0?this.options.tightLists:e.attrs.tight,i=this.inTightList;this.inTightList=r,e.forEach((i,a,o)=>{o&&r&&this.flushClose(1),this.wrapBlock(t,n(o),e,()=>this.render(i,e,o))}),this.inTightList=i}esc(e,t=!1){return e=e.replace(/[`*\\~\[\]_]/g,(t,n)=>t==`_`&&n>0&&n+1<e.length&&e[n-1].match(/\w/)&&e[n+1].match(/\w/)?t:`\\`+t),t&&(e=e.replace(/^(\+[ ]|[\-*>])/,`\\$&`).replace(/^(\s*)(#{1,6})(\s|$)/,`$1\\$2$3`).replace(/^(\s*\d+)\.\s/,`$1\\. `)),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,`\\$&`)),e}quote(e){let t=e.indexOf(`"`)==-1?`""`:e.indexOf(`'`)==-1?`''`:`()`;return t[0]+e+t[1]}repeat(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}markString(e,t,n,r){let i=this.getMark(e.type.name),a=t?i.open:i.close;return typeof a==`string`?a:a(this,e,n,r)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(e,t,n){for(;;t++){if(t>=e.childCount)return!1;let r=e.child(t);if(r.type.name!=this.options.hardBreakNodeName)return n.isInSet(r.marks);t++}}},wne=e(n(((e,t)=>{var n=!0,r=!1,i=!1;t.exports=function(e,t){t&&(n=!t.enabled,r=!!t.label,i=!!t.labelAfter),e.core.ruler.after(`inline`,`github-task-lists`,function(e){for(var t=e.tokens,r=2;r<t.length;r++)s(t,r)&&(c(t[r],e.Token),a(t[r-2],`class`,`task-list-item`+(n?``:` enabled`)),a(t[o(t,r-2)],`class`,`contains-task-list`))})};function a(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}function o(e,t){for(var n=e[t].level-1,r=t-1;r>=0;r--)if(e[r].level===n)return r;return-1}function s(e,t){return p(e[t])&&m(e[t-1])&&h(e[t-2])&&g(e[t])}function c(e,t){if(e.children.unshift(l(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),r)if(i){e.children.pop();var n=`task-item-`+Math.ceil(1e4*1e3*Math.random()-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+` id="`+n+`">`,e.children.push(f(e.content,n,t))}else e.children.unshift(u(t)),e.children.push(d(t))}function l(e,t){var r=new t(`html_inline`,``,0),i=n?` disabled="" `:``;return e.content.indexOf(`[ ] `)===0?r.content=`<input class="task-list-item-checkbox"`+i+`type="checkbox">`:(e.content.indexOf(`[x] `)===0||e.content.indexOf(`[X] `)===0)&&(r.content=`<input class="task-list-item-checkbox" checked=""`+i+`type="checkbox">`),r}function u(e){var t=new e(`html_inline`,``,0);return t.content=`<label>`,t}function d(e){var t=new e(`html_inline`,``,0);return t.content=`</label>`,t}function f(e,t,n){var r=new n(`html_inline`,``,0);return r.content=`<label class="task-list-item-label" for="`+t+`">`+e+`</label>`,r.attrs=[{for:t}],r}function p(e){return e.type===`inline`}function m(e){return e.type===`paragraph_open`}function h(e){return e.type===`list_item_open`}function g(e){return e.content.indexOf(`[ ] `)===0||e.content.indexOf(`[x] `)===0||e.content.indexOf(`[X] `)===0}}))(),1),Tne=Object.defineProperty,Ene=(e,t,n)=>t in e?Tne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PO=(e,t,n)=>(Ene(e,typeof t==`symbol`?t:t+``,n),n),Dne=Zv.create({name:`markdownTightLists`,addOptions:()=>({tight:!0,tightClass:`tight`,listTypes:[`bulletList`,`orderedList`]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute(`data-tight`)===`true`||!e.querySelector(`p`),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?`true`:null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function a(e){if(!r.isActive(e))return!1;let n=r.getAttributes(e);return i.updateAttributes(e,{tight:t??!(n!=null&&n.tight)})}return e.options.listTypes.some(e=>a(e))}}}}}),FO=TO();function IO(e,t){return FO.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new FO.inline.State(e,null,null,[]).scanDelims(t,!0)}function LO(e,t,n,r){let i=e.substring(0,n)+e.substring(n+t.length);return i=i.substring(0,n+r)+t+i.substring(n+r),i}function One(e,t,n,r){let i=n,a=e;for(;i<r&&!IO(a,i).can_open;)a=LO(a,t,i,1),i++;return{text:a,from:i,to:r}}function kne(e,t,n,r){let i=r,a=e;for(;i>n&&!IO(a,i).can_close;)a=LO(a,t,i,-1),i--;return{text:a,from:n,to:i}}function Ane(e,t,n,r){let i={text:e,from:n,to:r};return i=One(i.text,t,i.from,i.to),i=kne(i.text,t,i.from,i.to),i.to-i.from<t.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+t.length)),i.text}var jne=class extends NO{constructor(e,t,n){super(e,t,n??{}),PO(this,`inTable`,!1),this.inlines=[]}render(e,t,n){super.render(e,t,n);let r=this.inlines[this.inlines.length-1];if(r!=null&&r.start&&r!=null&&r.end){let{delimiter:e,start:t,end:n}=this.normalizeInline(r);this.out=Ane(this.out,e,t,n),this.inlines.pop()}}markString(e,t,n,r){let i=this.marks[e.type.name];if(i.expelEnclosingWhitespace)if(t)this.inlines.push({start:this.out.length,delimiter:i.open});else{let e=this.inlines.pop();this.inlines.push({...e,end:this.out.length})}return super.markString(e,t,n,r)}normalizeInline(e){let{start:t,end:n}=e;for(;this.out.charAt(t).match(/\s/);)t++;return{...e,start:t}}},RO=Vv.create({name:`markdownHTMLMark`,addStorage(){return{markdown:{serialize:{open(e,t){return this.editor.storage.markdown.options.html?zO(t)?.[0]??``:(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),``)},close(e,t){return this.editor.storage.markdown.options.html?zO(t)?.[1]??``:``}},parse:{}}}}});function zO(e){let t=e.type.schema,n=t.text(` `,[e]),r=H_(z.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function BO(e){let t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,`text/html`).body}function Mne(e){return e?.replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Nne(e){let t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function Pne(e){let t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}var VO=Py.create({name:`markdownHTMLNode`,addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(Fne(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function Fne(e,t){let n=e.type.schema,r=H_(z.from(e),n);return e.isBlock&&(t instanceof z||t.type.name===n.topNodeType.name)?Ine(r):r}function Ine(e){let t=BO(e).firstElementChild;return t.innerHTML=t.innerHTML.trim()?`
225
+ ${t.innerHTML}
226
+ `:`
227
+ `,t.outerHTML}var Lne=Py.create({name:`blockquote`}).extend({addStorage(){return{markdown:{serialize:jO.nodes.blockquote,parse:{}}}}}),HO=Py.create({name:`bulletList`}).extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t,` `,()=>(this.editor.storage.markdown.options.bulletListMarker||`-`)+` `)},parse:{}}}}}),UO=Py.create({name:`codeBlock`}).extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||``)+`
228
+ `),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){e.set({langPrefix:this.options.languageClassPrefix??`language-`})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,`</code></pre>`)}}}}}}),WO=Py.create({name:`hardBreak`}).extend({addStorage(){return{markdown:{serialize(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(e.inTable?VO.storage.markdown.serialize.call(this,e,t,n):`\\
229
+ `);return}},parse:{}}}}}),GO=Py.create({name:`heading`}).extend({addStorage(){return{markdown:{serialize:jO.nodes.heading,parse:{}}}}}),KO=Py.create({name:`horizontalRule`}).extend({addStorage(){return{markdown:{serialize:jO.nodes.horizontal_rule,parse:{}}}}}),qO=Py.create({name:`image`}).extend({addStorage(){return{markdown:{serialize:jO.nodes.image,parse:{}}}}}),JO=Py.create({name:`listItem`}).extend({addStorage(){return{markdown:{serialize:jO.nodes.list_item,parse:{}}}}}),YO=Py.create({name:`orderedList`});function XO(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}var ZO=YO.extend({addStorage(){return{markdown:{serialize(e,t,n,r){let i=t.attrs.start||1,a=String(i+t.childCount-1).length,o=e.repeat(` `,a+2),s=XO(t,n,r)%2?`) `:`. `;e.renderList(t,o,t=>{let n=String(i+t);return e.repeat(` `,a-n.length)+n+s})},parse:{}}}}}),QO=Py.create({name:`paragraph`}).extend({addStorage(){return{markdown:{serialize:jO.nodes.paragraph,parse:{}}}}});function $O(e){var t;return(e==null||(t=e.content)==null?void 0:t.content)??[]}var ek=Py.create({name:`table`}).extend({addStorage(){return{markdown:{serialize(e,t,n){if(!nk(t)){VO.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((t,n,r)=>{if(e.write(`| `),t.forEach((t,n,r)=>{r&&e.write(` | `);let i=t.firstChild;i.textContent.trim()&&e.renderInline(i)}),e.write(` |`),e.ensureNewLine(),!r){let n=Array.from({length:t.childCount}).map(()=>`---`).join(` | `);e.write(`| ${n} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function tk(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function nk(e){let t=$O(e),n=t[0],r=t.slice(1);return!($O(n).some(e=>e.type.name!==`tableHeader`||tk(e)||e.childCount>1)||r.some(e=>$O(e).some(e=>e.type.name===`tableHeader`||tk(e)||e.childCount>1)))}var rk=[Lne,HO,UO,WO,GO,KO,VO,qO,JO,ZO,QO,ek,Py.create({name:`taskItem`}).extend({addStorage(){return{markdown:{serialize(e,t){let n=t.attrs.checked?`[x]`:`[ ]`;e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(`.task-list-item`)].forEach(e=>{let t=e.querySelector(`input`);e.setAttribute(`data-type`,`taskItem`),t&&(e.setAttribute(`data-checked`,t.checked),t.remove())})}}}}}}),Py.create({name:`taskList`}).extend({addStorage(){return{markdown:{serialize:HO.storage.markdown.serialize,parse:{setup(e){e.use(wne.default)},updateDOM(e){[...e.querySelectorAll(`.contains-task-list`)].forEach(e=>{e.setAttribute(`data-type`,`taskList`)})}}}}}}),Py.create({name:`text`}).extend({addStorage(){return{markdown:{serialize(e,t){e.text(Mne(t.text))},parse:{}}}}}),Vv.create({name:`bold`}).extend({addStorage(){return{markdown:{serialize:jO.marks.strong,parse:{}}}}}),Vv.create({name:`code`}).extend({addStorage(){return{markdown:{serialize:jO.marks.code,parse:{}}}}}),RO,Vv.create({name:`italic`}).extend({addStorage(){return{markdown:{serialize:jO.marks.em,parse:{}}}}}),Vv.create({name:`link`}).extend({addStorage(){return{markdown:{serialize:jO.marks.link,parse:{}}}}}),Vv.create({name:`strike`}).extend({addStorage(){return{markdown:{serialize:{open:`~~`,close:`~~`,expelEnclosingWhitespace:!0},parse:{}}}}})];function ik(e){let t=e.storage?.markdown,n=rk.find(t=>t.name===e.name)?.storage.markdown;return t||n?{...n,...t}:null}var ak=class{constructor(e){PO(this,`editor`,null),this.editor=e}serialize(e){let t=new jne(this.nodes,this.marks,{hardBreakNodeName:WO.name});return t.renderContent(e),t.out}get nodes(){return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(e=>[e,this.serializeNode(VO)])),...Object.fromEntries(this.editor.extensionManager.extensions.filter(e=>e.type===`node`&&this.serializeNode(e)).map(e=>[e.name,this.serializeNode(e)])??[])}}get marks(){return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(e=>[e,this.serializeMark(RO)])),...Object.fromEntries(this.editor.extensionManager.extensions.filter(e=>e.type===`mark`&&this.serializeMark(e)).map(e=>[e.name,this.serializeMark(e)])??[])}}serializeNode(e){var t;return(t=ik(e))==null||(t=t.serialize)==null?void 0:t.bind({editor:this.editor,options:e.options})}serializeMark(e){let t=ik(e)?.serialize;return t?{...t,open:typeof t.open==`function`?t.open.bind({editor:this.editor,options:e.options}):t.open,close:typeof t.close==`function`?t.close.bind({editor:this.editor,options:e.options}):t.close}:null}},ok=class{constructor(e,t){PO(this,`editor`,null),PO(this,`md`,null);let{html:n,linkify:r,breaks:i}=t;this.editor=e,this.md=this.withPatchedRenderer(TO({html:n,linkify:r,breaks:i}))}parse(e){let{inline:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e==`string`){this.editor.extensionManager.extensions.forEach(e=>{var t;return(t=ik(e))==null||(t=t.parse)==null||(t=t.setup)==null?void 0:t.call({editor:this.editor,options:e.options},this.md)});let n=BO(this.md.render(e));return this.editor.extensionManager.extensions.forEach(e=>{var t;return(t=ik(e))==null||(t=t.parse)==null||(t=t.updateDOM)==null?void 0:t.call({editor:this.editor,options:e.options},n)}),this.normalizeDOM(n,{inline:t,content:e}),n.innerHTML}return e}normalizeDOM(e,t){let{inline:n,content:r}=t;return this.normalizeBlocks(e),e.querySelectorAll(`*`).forEach(e=>{e.nextSibling?.nodeType===Node.TEXT_NODE&&!e.closest(`pre`)&&(e.nextSibling.textContent=e.nextSibling.textContent.replace(/^\n/,``))}),n&&this.normalizeInline(e,r),e}normalizeBlocks(e){let t=Object.values(this.editor.schema.nodes).filter(e=>e.isBlock).map(e=>e.spec.parseDOM?.map(e=>e.tag)).flat().filter(Boolean).join(`,`);t&&[...e.querySelectorAll(t)].forEach(e=>{e.parentElement.matches(`p`)&&Nne(e)})}normalizeInline(e,t){var n;if((n=e.firstElementChild)!=null&&n.matches(`p`)){let n=e.firstElementChild,{nextElementSibling:r}=n,i=t.match(/^\s+/)?.[0]??``,a=r?``:t.match(/\s+$/)?.[0]??``;if(t.match(/^\n\n/)){n.innerHTML=`${n.innerHTML}${a}`;return}Pne(n),e.innerHTML=`${i}${e.innerHTML}${a}`}}withPatchedRenderer(e){let t=e=>function(){let t=e(...arguments);return t===`
230
+ `?t:t[t.length-1]===`
231
+ `?t.slice(0,-1):t};return e.renderer.rules.hardbreak=t(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=t(e.renderer.rules.softbreak),e.renderer.rules.fence=t(e.renderer.rules.fence),e.renderer.rules.code_block=t(e.renderer.rules.code_block),e.renderer.renderToken=t(e.renderer.renderToken.bind(e.renderer)),e}},sk=Zv.create({name:`markdownClipboard`,addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new hd({key:new vd(`markdownClipboard`),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;let r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return ml.fromSchema(this.editor.schema).parseSlice(BO(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),ck=Zv.create({name:`markdown`,priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:`tight`,bulletListMarker:`-`,linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){let e=Xv.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new ok(this.editor,this.options),serializer:new ak(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[Dne.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),sk.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),lk,uk;if(typeof WeakMap<`u`){let e=new WeakMap;lk=t=>e.get(t),uk=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;lk=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},uk=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var dk=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return lk(e)||uk(e,fk(e))}};function fk(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=pk(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new dk(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&mk(s,o,e),s}function pk(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function mk(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=hk(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function hk(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function gk(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var _k=new vd(`selectingCells`);function vk(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function yk(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function bk(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function xk(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=vk(t.$head)||Sk(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Sk(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Ck(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function wk(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Tk(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Ek(e,t,n){let r=e.node(-1),i=dk.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function Dk(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Ok(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function kk(e,t,n){let r=gk(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var Ak=class e extends Yu{constructor(e,t=e){let n=e.node(-1),r=dk.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Xu(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Ck(r)&&Ck(i)&&Tk(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return $u.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=dk.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=Dk(e,0,l)),u>0&&(e=Dk(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(z.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new B(z.from(o),1,1)}replace(e,t=B.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?B.empty:t)}let i=Yu.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new B(z.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=dk.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=dk.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=dk.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=dk.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new jk(this.$anchorCell.pos,this.$headCell.pos)}};Ak.prototype.visible=!1,Yu.jsonID(`cell`,Ak);var jk=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Tk(t,n)?new Ak(t,n):Yu.near(n,1)}};function Mk(e){if(!(e.selection instanceof Ak))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(gh.node(n,n+e.nodeSize,{class:`selectedCell`}))}),yh.create(e.doc,t)}function Nk({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Pk({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Fk(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof td&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=Ak.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=Ak.rowSelection(e,e)}else if(!n){let e=dk.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=Ak.create(i,t+1,n)}}else r instanceof $u&&Nk(r)?a=$u.create(i,r.from):r instanceof $u&&Pk(r)&&(a=$u.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Ik=new vd(`fix-tables`);function Lk(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?Lk(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Rk(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=zk(e,t,r,n))};return t?t.doc!=e.doc&&Lk(t.doc,e.doc,0,r):e.doc.descendants(r),n}function zk(e,t,n,r){let i=dk.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,Dk(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=gk(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(Ik,{fixTables:!0})}function Bk(e){let t=e.selection,n=xk(e),r=n.node(-1),i=n.start(-1),a=dk.get(r);return{...t instanceof Ak?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function Vk(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;kk(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Ok(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?gk(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Hk(e,t){if(!bk(e))return!1;if(t){let n=Bk(e);t(Vk(e.tr,n,n.left))}return!0}function Uk(e,t){if(!bk(e))return!1;if(t){let n=Bk(e);t(Vk(e.tr,n,n.right))}return!0}function Wk(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,Dk(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function Gk(e,t){if(!bk(e))return!1;if(t){let n=Bk(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Wk(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=dk.get(e)}t(r)}return!0}function Kk(e,t,n){let r=gk(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function qk(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;Kk(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?gk(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,gk(r.type.schema).row.create(null,o)),e}function Jk(e,t){if(!bk(e))return!1;if(t){let n=Bk(e);t(qk(e.tr,n,n.top))}return!0}function Yk(e,t){if(!bk(e))return!1;if(t){let n=Bk(e);t(qk(e.tr,n,n.bottom))}return!0}function Xk(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function Zk(e,t){if(!bk(e))return!1;if(t){let n=Bk(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Xk(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=dk.get(n.table)}t(r)}return!0}function Qk(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function $k({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function eA(e,t){let n=e.selection;if(!(n instanceof Ak)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Bk(e),{map:i}=r;if($k(i,r))return!1;if(t){let n=e.tr,a={},o=z.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{Qk(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Ok(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=Qk(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new Ak(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function tA(e,t){let n=gk(e.schema);return nA(({node:e})=>n[e.type.spec.tableRole])(e,t)}function nA(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof Ak){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=yk(r.$from),!i)return!1;a=vk(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=Bk(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof Ak&&u.setSelection(new Ak(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function rA(e,t){return function(n,r){if(!bk(n))return!1;let i=xk(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof Ak?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function iA(e){return function(t,n){if(!bk(t))return!1;if(n){let r=gk(t.schema),i=Bk(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function aA(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function oA(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?iA(e):function(t,n){if(!bk(t))return!1;if(n){let r=gk(t.schema),i=Bk(t),a=t.tr,o=aA(`row`,i,r),s=aA(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}oA(`row`,{useDeprecatedLogic:!0}),oA(`column`,{useDeprecatedLogic:!0});var sA=oA(`cell`,{useDeprecatedLogic:!0});function cA(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function lA(e){return function(t,n){if(!bk(t))return!1;let r=cA(xk(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection($u.between(e,wk(e))).scrollIntoView())}return!0}}function uA(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function dA(e,t){let n=e.selection;if(!(n instanceof Ak))return!1;if(t){let r=e.tr,i=gk(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new B(i,0,0))}),r.docChanged&&t(r)}return!0}function fA(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=mA(gk(o).row,new B(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?mA(gk(o).row,new B(t,n,r)).content:t);else return null;return pA(o,s)}function pA(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(z.empty),n[i]<r){let a=gk(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(z.from(o))}return{height:t.length,width:r,rows:t}}function mA(e,t){let n=e.createAndFill();return new qu(n).replace(0,n.content.size,t).doc}function hA({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Dk(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(z.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(z.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function gA(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=gk(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,z.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function _A(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function vA(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,Dk(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Dk(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function yA(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=dk.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=dk.get(a),f=d.mapping.maps.length}gA(d,o,a,n,l,u,f)&&p(),_A(d,o,a,n,c,l,s,f)&&p(),_A(d,o,a,n,c,l,u,f)&&p(),vA(d,o,a,n,s,u,c,f)&&p(),vA(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new B(i.rows[e-s],0,0))}p(),d.setSelection(new Ak(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var bA=vg({ArrowLeft:SA(`horiz`,-1),ArrowRight:SA(`horiz`,1),ArrowUp:SA(`vert`,-1),ArrowDown:SA(`vert`,1),"Shift-ArrowLeft":CA(`horiz`,-1),"Shift-ArrowRight":CA(`horiz`,1),"Shift-ArrowUp":CA(`vert`,-1),"Shift-ArrowDown":CA(`vert`,1),Backspace:dA,"Mod-Backspace":dA,Delete:dA,"Mod-Delete":dA});function xA(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function SA(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof Ak)return xA(n,r,Yu.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=DA(i,e,t);if(o==null)return!1;if(e==`horiz`)return xA(n,r,Yu.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Ek(i,e,t),s;return s=a?Yu.near(a,1):t<0?Yu.near(n.doc.resolve(i.before(-1)),-1):Yu.near(n.doc.resolve(i.after(-1)),1),xA(n,r,s)}}}function CA(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof Ak)o=a;else{let r=DA(i,e,t);if(r==null)return!1;o=new Ak(n.doc.resolve(r))}let s=Ek(o.$headCell,e,t);return s?xA(n,r,new Ak(o.$anchorCell,s)):!1}}function wA(e,t){let n=e.state.doc,r=vk(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Ak(r))),!0):!1}function TA(e,t,n){if(!bk(e.state))return!1;let r=fA(n),i=e.state.selection;if(i instanceof Ak){r||={width:1,height:1,rows:[z.from(mA(gk(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=dk.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=hA(r,o.right-o.left,o.bottom-o.top),yA(e.state,e.dispatch,a,o,r),!0}else if(r){let t=xk(e.state),n=t.start(-1);return yA(e.state,e.dispatch,n,dk.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function EA(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=OA(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof Ak)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=vk(e.state.selection.$anchor))!=null&&kA(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=kA(e,n),i=_k.getState(e.state)==null;if(!r||!Tk(t,r))if(i)r=t;else return;let a=new Ak(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(_k,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),_k.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(_k,-1))}function o(r){let o=r,s=_k.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(OA(e,o.target)!=n&&(c=kA(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function DA(e,t,n){if(!(e.state.selection instanceof $u))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function OA(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function kA(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&vk(e.state.doc.resolve(r))||vk(e.state.doc.resolve(i))}var AA=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),jA(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,jA(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function jA(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var MA=new vd(`tableColumnResizing`);function NA({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=AA,lastColumnResizable:i=!0}={}){let a=new hd({key:MA,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=gk(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new PA(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=MA.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{FA(t,n,e,i)},mouseleave:e=>{IA(e)},mousedown:(e,r)=>{LA(e,r,t,n)}},decorations:e=>{let t=MA.getState(e);if(t&&t.activeHandle>-1)return KA(e,t.activeHandle)},nodeViews:{}}});return a}var PA=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(MA);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Ck(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function FA(e,t,n,r){if(!e.editable)return;let i=MA.getState(e.state);if(i&&!i.dragging){let a=zA(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=BA(e,t,`left`,n):i-t.clientX<=n&&(o=BA(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=dk.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}HA(e,o)}}}function IA(e){if(!e.editable)return;let t=MA.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&HA(e,-1)}function LA(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=MA.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=RA(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(MA,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=MA.getState(e.state);r?.dragging&&(UA(e,r.activeHandle,VA(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(MA,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=MA.getState(e.state);if(i&&i.dragging){let a=VA(i.dragging,t,n);WA(e,i.activeHandle,a,r)}}return WA(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function RA(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function zA(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function BA(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=vk(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=dk.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function VA(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function HA(e,t){e.dispatch(e.state.tr.setMeta(MA,{setHandle:t}))}function UA(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=dk.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():GA(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function WA(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=dk.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&jA(a,c.firstChild,c,r,s,n)}function GA(e){return Array(e).fill(0)}function KA(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return yh.empty;let a=dk.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,MA.getState(e)?.dragging&&n.push(gh.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(gh.widget(s,c))}}return yh.create(e.doc,n)}function qA({allowTableNodeSelection:e=!1}={}){return new hd({key:_k,state:{init(){return null},apply(e,t){let n=e.getMeta(_k);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Mk,handleDOMEvents:{mousedown:EA},createSelectionBetween(e){return _k.getState(e.state)==null?null:e.state.selection},handleTripleClick:wA,handleKeyDown:bA,handlePaste:TA},appendTransaction(t,n,r){return Fk(r,Rk(r,n),e)}})}function JA(e){return e===`left`||e===`right`||e===`center`?e:null}function YA(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return JA(t||n)}function XA(e){return JA(e?.align)}function ZA(){return{default:null,parseHTML:e=>YA(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var QA=Py.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:ZA()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,X_(this.options.HTMLAttributes,e),0]}}),$A=Py.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:ZA()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,X_(this.options.HTMLAttributes,e),0]}}),ej=Py.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,X_(this.options.HTMLAttributes,e),0]}});function tj(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function nj(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=tj(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=tj(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var rj=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),nj(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,nj(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function ij(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=tj(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function aj(e,t){return t?e.createChecked(null,t):e.createAndFill()}function oj(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function sj(e,t,n,r,i){let a=oj(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=aj(a.cell,i);if(e&&s.push(e),r){let e=aj(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function cj(e){return e instanceof Ak}var lj=({editor:e})=>{let{selection:t}=e.state;if(!cj(t))return!1;let n=0;return z_(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function uj(e){return(e||``).replace(/\s+/g,` `).trim()}function dj(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=uj(i),o=e.type===`tableHeader`,s=XA(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
232
+ `,f=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
233
+ `,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
234
+ `,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
235
+ `}),d}var fj=dj,pj=Py.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:rj,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=ij(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,X_(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=JA(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=JA(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>fj(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=sj(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection($u.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Hk(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Uk(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Gk(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Jk(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Yk(e,t),deleteRow:()=>({state:e,dispatch:t})=>Zk(e,t),deleteTable:()=>({state:e,dispatch:t})=>uA(e,t),mergeCells:()=>({state:e,dispatch:t})=>eA(e,t),splitCell:()=>({state:e,dispatch:t})=>tA(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>oA(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>oA(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>sA(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>eA(e,t)?!0:tA(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>rA(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>lA(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>lA(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Rk(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=Ak.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:lj,"Mod-Backspace":lj,Delete:lj,"Mod-Delete":lj}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[NA({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],qA({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:W_(H(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});Zv.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(pj.configure(this.options.table)),this.options.tableCell!==!1&&e.push(QA.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push($A.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(ej.configure(this.options.tableRow)),e}});var mj=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,hj=Py.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,X_(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new yy({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[my({find:mj,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),gj=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,_j=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,vj=Vv.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,X_(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[py({find:gj,type:this.type})]},addPasteRules(){return[Iy({find:_j,type:this.type})]}}),yj=e=>gy({find:/--$/,replace:e??`—`}),bj=e=>gy({find:/\.\.\.$/,replace:e??`…`}),xj=e=>gy({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:e??`“`}),Sj=e=>gy({find:/"$/,replace:e??`”`}),Cj=e=>gy({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:e??`‘`}),wj=e=>gy({find:/'$/,replace:e??`’`}),Tj=e=>gy({find:/<-$/,replace:e??`←`}),Ej=e=>gy({find:/->$/,replace:e??`→`}),Dj=e=>gy({find:/\(c\)$/,replace:e??`©`}),Oj=e=>gy({find:/\(tm\)$/,replace:e??`™`}),kj=e=>gy({find:/\(sm\)$/,replace:e??`℠`}),Aj=e=>gy({find:/\(r\)$/,replace:e??`®`}),jj=e=>gy({find:/(?:^|\s)(1\/2)\s$/,replace:e??`½`}),Mj=e=>gy({find:/\+\/-$/,replace:e??`±`}),Nj=e=>gy({find:/!=$/,replace:e??`≠`}),Pj=e=>gy({find:/<<$/,replace:e??`«`}),Fj=e=>gy({find:/>>$/,replace:e??`»`}),Ij=e=>gy({find:/\d+\s?([*x])\s?\d+$/,replace:e??`×`}),Lj=e=>gy({find:/\^2$/,replace:e??`²`}),Rj=e=>gy({find:/\^3$/,replace:e??`³`}),zj=e=>gy({find:/(?:^|\s)(1\/4)\s$/,replace:e??`¼`}),Bj=e=>gy({find:/(?:^|\s)(3\/4)\s$/,replace:e??`¾`}),Vj=Zv.create({name:`typography`,addOptions(){return{closeDoubleQuote:`”`,closeSingleQuote:`’`,copyright:`©`,ellipsis:`…`,emDash:`—`,laquo:`«`,leftArrow:`←`,multiplication:`×`,notEqual:`≠`,oneHalf:`½`,oneQuarter:`¼`,openDoubleQuote:`“`,openSingleQuote:`‘`,plusMinus:`±`,raquo:`»`,registeredTrademark:`®`,rightArrow:`→`,servicemark:`℠`,superscriptThree:`³`,superscriptTwo:`²`,threeQuarters:`¾`,trademark:`™`}},addInputRules(){let e=[];this.options.emDash!==!1&&e.push(yj(this.options.emDash)),this.options.ellipsis!==!1&&e.push(bj(this.options.ellipsis));let t=this.editor.options.textDirection===`rtl`;if(this.options.doubleQuotes?.rtl){let{open:t,close:n}=this.options.doubleQuotes.rtl;e.push(xj(t)),e.push(Sj(n))}else t?(e.push(xj(`”`)),e.push(Sj(`“`))):(this.options.openDoubleQuote!==!1&&e.push(xj(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&e.push(Sj(this.options.closeDoubleQuote)));if(this.options.singleQuotes?.rtl){let{open:t,close:n}=this.options.singleQuotes.rtl;e.push(Cj(t)),e.push(wj(n))}else t?(e.push(Cj(`’`)),e.push(wj(`‘`))):(this.options.openSingleQuote!==!1&&e.push(Cj(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&e.push(wj(this.options.closeSingleQuote)));return this.options.leftArrow!==!1&&e.push(Tj(this.options.leftArrow)),this.options.rightArrow!==!1&&e.push(Ej(this.options.rightArrow)),this.options.copyright!==!1&&e.push(Dj(this.options.copyright)),this.options.trademark!==!1&&e.push(Oj(this.options.trademark)),this.options.servicemark!==!1&&e.push(kj(this.options.servicemark)),this.options.registeredTrademark!==!1&&e.push(Aj(this.options.registeredTrademark)),this.options.oneHalf!==!1&&e.push(jj(this.options.oneHalf)),this.options.plusMinus!==!1&&e.push(Mj(this.options.plusMinus)),this.options.notEqual!==!1&&e.push(Nj(this.options.notEqual)),this.options.laquo!==!1&&e.push(Pj(this.options.laquo)),this.options.raquo!==!1&&e.push(Fj(this.options.raquo)),this.options.multiplication!==!1&&e.push(Ij(this.options.multiplication)),this.options.superscriptTwo!==!1&&e.push(Lj(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&e.push(Rj(this.options.superscriptThree)),this.options.oneQuarter!==!1&&e.push(zj(this.options.oneQuarter)),this.options.threeQuarters!==!1&&e.push(Bj(this.options.threeQuarters)),e}});function Hj(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(?!struct)(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),p=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],m=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),h=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),g={type:p,keyword:f,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:m},_={className:`function.dispatch`,relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},v=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:g,contains:v.concat([{begin:/\(/,end:/\)/,keywords:g,contains:v.concat([`self`]),relevance:0}]),relevance:0},b={className:`function`,begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:g,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(y,b,_,v,[l,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:g,contains:[`self`,o]},{begin:e.IDENT_RE+`::`,keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function Uj(e){let t={type:[`boolean`,`byte`,`word`,`String`],built_in:`KeyboardController.MouseController.SoftwareSerial.EthernetServer.EthernetClient.LiquidCrystal.RobotControl.GSMVoiceCall.EthernetUDP.EsploraTFT.HttpClient.RobotMotor.WiFiClient.GSMScanner.FileSystem.Scheduler.GSMServer.YunClient.YunServer.IPAddress.GSMClient.GSMModem.Keyboard.Ethernet.Console.GSMBand.Esplora.Stepper.Process.WiFiUDP.GSM_SMS.Mailbox.USBHost.Firmata.PImage.Client.Server.GSMPIN.FileIO.Bridge.Serial.EEPROM.Stream.Mouse.Audio.Servo.File.Task.GPRS.WiFi.Wire.TFT.GSM.SPI.SD`.split(`.`),_hints:`setup.loop.runShellCommandAsynchronously.analogWriteResolution.retrieveCallingNumber.printFirmwareVersion.analogReadResolution.sendDigitalPortPair.noListenOnLocalhost.readJoystickButton.setFirmwareVersion.readJoystickSwitch.scrollDisplayRight.getVoiceCallStatus.scrollDisplayLeft.writeMicroseconds.delayMicroseconds.beginTransmission.getSignalStrength.runAsynchronously.getAsynchronously.listenOnLocalhost.getCurrentCarrier.readAccelerometer.messageAvailable.sendDigitalPorts.lineFollowConfig.countryNameWrite.runShellCommand.readStringUntil.rewindDirectory.readTemperature.setClockDivider.readLightSensor.endTransmission.analogReference.detachInterrupt.countryNameRead.attachInterrupt.encryptionType.readBytesUntil.robotNameWrite.readMicrophone.robotNameRead.cityNameWrite.userNameWrite.readJoystickY.readJoystickX.mouseReleased.openNextFile.scanNetworks.noInterrupts.digitalWrite.beginSpeaker.mousePressed.isActionDone.mouseDragged.displayLogos.noAutoscroll.addParameter.remoteNumber.getModifiers.keyboardRead.userNameRead.waitContinue.processInput.parseCommand.printVersion.readNetworks.writeMessage.blinkVersion.cityNameRead.readMessage.setDataMode.parsePacket.isListening.setBitOrder.beginPacket.isDirectory.motorsWrite.drawCompass.digitalRead.clearScreen.serialEvent.rightToLeft.setTextSize.leftToRight.requestFrom.keyReleased.compassRead.analogWrite.interrupts.WiFiServer.disconnect.playMelody.parseFloat.autoscroll.getPINUsed.setPINUsed.setTimeout.sendAnalog.readSlider.analogRead.beginWrite.createChar.motorsStop.keyPressed.tempoWrite.readButton.subnetMask.debugPrint.macAddress.writeGreen.randomSeed.attachGPRS.readString.sendString.remotePort.releaseAll.mouseMoved.background.getXChange.getYChange.answerCall.getResult.voiceCall.endPacket.constrain.getSocket.writeJSON.getButton.available.connected.findUntil.readBytes.exitValue.readGreen.writeBlue.startLoop.IPAddress.isPressed.sendSysex.pauseMode.gatewayIP.setCursor.getOemKey.tuneWrite.noDisplay.loadImage.switchPIN.onRequest.onReceive.changePIN.playFile.noBuffer.parseInt.overflow.checkPIN.knobRead.beginTFT.bitClear.updateIR.bitWrite.position.writeRGB.highByte.writeRed.setSpeed.readBlue.noStroke.remoteIP.transfer.shutdown.hangCall.beginSMS.endWrite.attached.maintain.noCursor.checkReg.checkPUK.shiftOut.isValid.shiftIn.pulseIn.connect.println.localIP.pinMode.getIMEI.display.noBlink.process.getBand.running.beginSD.drawBMP.lowByte.setBand.release.bitRead.prepare.pointTo.readRed.setMode.noFill.remove.listen.stroke.detach.attach.noTone.exists.buffer.height.bitSet.circle.config.cursor.random.IRread.setDNS.endSMS.getKey.micros.millis.begin.print.write.ready.flush.width.isPIN.blink.clear.press.mkdir.rmdir.close.point.yield.image.BSSID.click.delay.read.text.move.peek.beep.rect.line.open.seek.fill.size.turn.stop.home.find.step.tone.sqrt.RSSI.SSID.end.bit.tan.cos.sin.pow.map.abs.max.min.get.run.put`.split(`.`),literal:[`DIGITAL_MESSAGE`,`FIRMATA_STRING`,`ANALOG_MESSAGE`,`REPORT_DIGITAL`,`REPORT_ANALOG`,`INPUT_PULLUP`,`SET_PIN_MODE`,`INTERNAL2V56`,`SYSTEM_RESET`,`LED_BUILTIN`,`INTERNAL1V1`,`SYSEX_START`,`INTERNAL`,`EXTERNAL`,`DEFAULT`,`OUTPUT`,`INPUT`,`HIGH`,`LOW`]},n=Hj(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name=`Arduino`,n.aliases=[`ino`],n.supersetOf=`cpp`,n}function Wj(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function Gj(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},p=[l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:f,contains:p.concat([{begin:/\(/,end:/\)/,keywords:f,contains:p.concat([`self`]),relevance:0}]),relevance:0},h={begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:f,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:f,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C`,aliases:[`h`],keywords:f,disableAutodetect:!0,illegal:`</`,contains:[].concat(m,h,p,[l,{begin:e.IDENT_RE+`::`,keywords:f},{className:`class`,beginKeywords:`enum class struct union`,end:/[{;:<>=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:s,keywords:f}}}function Kj(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`decltype\\(auto\\)`,i=`[a-zA-Z_]\\w*::`,a=`(?!struct)(`+r+`|`+t.optional(i)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,o={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},s={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},l={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:`title`,begin:t.optional(i)+e.IDENT_RE,relevance:0},d=t.optional(i)+e.IDENT_RE+`\\s*\\(`,f=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),p=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],m=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),h=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),g={type:p,keyword:f,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:m},_={className:`function.dispatch`,relevance:0,keywords:{_hint:h},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},v=[_,l,o,n,e.C_BLOCK_COMMENT_MODE,c,s],y={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:g,contains:v.concat([{begin:/\(/,end:/\)/,keywords:g,contains:v.concat([`self`]),relevance:0}]),relevance:0},b={className:`function`,begin:`(`+a+`[\\*&\\s]+)+`+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,c]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,c,o,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,s,c,o]}]},o,n,e.C_BLOCK_COMMENT_MODE,l]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:g,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(y,b,_,v,[l,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:g,contains:[`self`,o]},{begin:e.IDENT_RE+`::`,keywords:g},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function qj(e){let t=[`bool`,`byte`,`char`,`decimal`,`delegate`,`double`,`dynamic`,`enum`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`ulong`,`uint`,`ushort`],n=[`public`,`private`,`protected`,`static`,`internal`,`protected`,`abstract`,`async`,`extern`,`override`,`unsafe`,`virtual`,`new`,`sealed`,`partial`],r={keyword:`abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while`.split(`.`).concat(`add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield`.split(`.`)),built_in:t,literal:[`default`,`false`,`null`,`true`]},i=e.inherit(e.TITLE_MODE,{begin:`[a-zA-Z](\\.?\\w)*`}),a={className:`number`,variants:[{begin:`\\b(0b[01']+)`},{begin:`(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)`},{begin:`(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)`}],relevance:0},o={className:`string`,begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:`string`,begin:`@"`,end:`"`,contains:[{begin:`""`}]},c=e.inherit(s,{illegal:/\n/}),l={className:`subst`,begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:`string`,begin:/\$"/,end:`"`,illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:`string`,begin:/\$@"/,end:`"`,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:`<`,end:`>`,contains:[{beginKeywords:`in out`},i]},g=e.IDENT_RE+`(<`+e.IDENT_RE+`(\\s*,\\s*`+e.IDENT_RE+`)*>)?(\\[\\])?`,_={begin:`@`+e.IDENT_RE,relevance:0};return{name:`C#`,aliases:[`cs`,`c#`],keywords:r,illegal:/::/,contains:[e.COMMENT(`///`,`$`,{returnBegin:!0,contains:[{className:`doctag`,variants:[{begin:`///`,relevance:0},{begin:`<!--|-->`},{begin:`</?`,end:`>`}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`meta`,begin:`#`,end:`$`,keywords:{keyword:`if else elif endif define undef warning error line region endregion pragma checksum`}},m,a,{beginKeywords:`class interface`,relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:`where class`},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`namespace`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`record`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:`^\\s*\\[(?=[\\w])`,excludeBegin:!0,end:`\\]`,excludeEnd:!0,contains:[{className:`string`,begin:/"/,end:/"/}]},{beginKeywords:`new return throw await else`,relevance:0},{className:`function`,begin:`(`+g+`\\s+)+`+e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(` `),relevance:0},{begin:e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:`params`,begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}var Jj=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Yj=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Xj=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),Zj=[...Yj,...Xj],Qj=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),$j=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),eM=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),tM=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function nM(e){let t=e.regex,n=Jj(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+$j.join(`|`)+`)`},{begin:`:(:)?(`+eM.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+tM.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Qj.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Zj.join(`|`)+`)\\b`}]}}function rM(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function iM(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}function aM(e){let t=e.regex;return{name:`GraphQL`,aliases:[`gql`],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:[`query`,`mutation`,`subscription`,`type`,`input`,`schema`,`directive`,`interface`,`union`,`scalar`,`fragment`,`enum`,`on`],literal:[`true`,`false`,`null`]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:`punctuation`,match:/[.]{3}/,relevance:0},{scope:`punctuation`,begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:`variable`,begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:`meta`,match:/@\w+/,excludeEnd:!0},{scope:`symbol`,begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function oM(e){let t=e.regex,n={className:`number`,relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:`variable`,variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:`literal`,begin:/\bon|off|true|false|yes|no\b/},o={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:`'''`,end:`'''`,relevance:10},{begin:`"""`,end:`"""`,relevance:10},{begin:`"`,end:`"`},{begin:`'`,end:`'`}]},s={begin:/\[/,end:/\]/,contains:[r,a,i,o,n,`self`],relevance:0},c=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:`TOML, also INI`,aliases:[`toml`],case_insensitive:!0,illegal:/\S/,contains:[r,{className:`section`,begin:/\[+/,end:/\]+/},{begin:t.concat(c,`(\\s*\\.\\s*`,c,`)*`,t.lookahead(/\s*=\s*[^#\s]/)),className:`attr`,starts:{end:/$/,contains:[r,s,a,i,o,n]}}]}}var sM=`[0-9](_*[0-9])*`,cM=`\\.(${sM})`,lM=`[0-9a-fA-F](_*[0-9a-fA-F])*`,uM={className:`number`,variants:[{begin:`(\\b(${sM})((${cM})|\\.)?|(${cM}))[eE][+-]?(${sM})[fFdD]?\\b`},{begin:`\\b(${sM})((${cM})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${cM})[fFdD]?\\b`},{begin:`\\b(${sM})[fFdD]\\b`},{begin:`\\b0[xX]((${lM})\\.?|(${lM})?\\.(${lM}))[pP][+-]?(${sM})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${lM})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function dM(e,t,n){return n===-1?``:e.replace(t,r=>dM(e,t,n-1))}function fM(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+dM(`(?:<`+n+`~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?`,/~~~/g,2),i={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},a={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},o={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,uM,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},uM,a]}}var pM=`[A-Za-z$_][0-9A-Za-z$_]*`,mM=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),hM=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],gM=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),_M=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],vM=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],yM=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],bM=[].concat(vM,gM,_M);function xM(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=pM,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:pM,keyword:mM,literal:hM,built_in:bM,"variable.language":yM},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...gM,..._M]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...vM,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ee=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ee,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function SM(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}var CM=`[0-9](_*[0-9])*`,wM=`\\.(${CM})`,TM=`[0-9a-fA-F](_*[0-9a-fA-F])*`,EM={className:`number`,variants:[{begin:`(\\b(${CM})((${wM})|\\.)?|(${wM}))[eE][+-]?(${CM})[fFdD]?\\b`},{begin:`\\b(${CM})((${wM})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${wM})[fFdD]?\\b`},{begin:`\\b(${CM})[fFdD]\\b`},{begin:`\\b0[xX]((${TM})\\.?|(${TM})?\\.(${TM}))[pP][+-]?(${CM})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${TM})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function DM(e){let t={keyword:`abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual`,built_in:`Byte Short Char Int Long Boolean Float Double Void Unit Nothing`,literal:`true false null`},n={className:`keyword`,begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:`symbol`,begin:/@\w+/}]}},r={className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`@`},i={className:`subst`,begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:`variable`,begin:`\\$`+e.UNDERSCORE_IDENT_RE},o={className:`string`,variants:[{begin:`"""`,end:`"""(?=[^"])`,contains:[a,i]},{begin:`'`,end:`'`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(o);let s={className:`meta`,begin:`@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*`+e.UNDERSCORE_IDENT_RE+`)?`},c={className:`meta`,begin:`@`+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:`string`}),`self`]}]},l=EM,u=e.COMMENT(`/\\*`,`\\*/`,{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:`type`,begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:`Kotlin`,aliases:[`kt`,`kts`],keywords:t,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`}]}),e.C_LINE_COMMENT_MODE,u,n,r,s,c,{className:`function`,beginKeywords:`fun`,end:`[(]|$`,returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+`\\s*\\(`,returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:`type`,begin:/</,end:/>/,keywords:`reified`,relevance:0},{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,c,o,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:`title.class`},keywords:`class interface trait`,end:/[:\{(]|$/,excludeEnd:!0,illegal:`extends implements`,contains:[{beginKeywords:`public protected internal private constructor`},e.UNDERSCORE_TITLE_MODE,{className:`type`,begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,c]},o,{className:`meta`,begin:`^#!/usr/bin/env`,end:`$`,illegal:`
236
+ `},l]}}var OM=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),kM=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),AM=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),jM=[...kM,...AM],MM=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),NM=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),PM=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),FM=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),IM=NM.concat(PM).sort().reverse();function LM(e){let t=OM(e),n=IM,r=`[\\w-]+`,i=`(`+r+`|@\\{[\\w-]+\\})`,a=[],o=[],s=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},c=function(e,t,n){return{className:e,begin:t,relevance:n}},l={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:MM.join(` `)},u={begin:`\\(`,end:`\\)`,contains:o,keywords:l,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s(`'`),s(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,u,c(`variable`,`@@?`+r,10),c(`variable`,`@\\{`+r+`\\}`),c(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:r+`\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let d=o.concat({begin:/\{/,end:/\}/,contains:a}),f={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(o)},p={begin:i+`\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+FM.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:o}}]},m={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:l,returnEnd:!0,contains:o,relevance:0}},h={className:`variable`,variants:[{begin:`@`+r+`\\s*:`,relevance:15},{begin:`@`+r}],starts:{end:`[;}]`,returnEnd:!0,contains:d}},g={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c(`keyword`,`all\\b`),c(`variable`,`@\\{`+r+`\\}`),{begin:`\\b(`+jM.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,c(`selector-tag`,i,0),c(`selector-id`,`#`+i),c(`selector-class`,`\\.`+i,0),c(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+NM.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+PM.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:`!important`},t.FUNCTION_DISPATCH]},_={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,h,_,p,g,f,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function RM(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!`+t+`)`,`$`),e.COMMENT(`--`+t,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function zM(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}function BM(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function VM(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function HM(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function UM(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
237
+ ]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function WM(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function GM(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function KM(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function qM(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function JM(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function YM(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:[`alias`,`and`,`begin`,`BEGIN`,`break`,`case`,`class`,`defined`,`do`,`else`,`elsif`,`end`,`END`,`ensure`,`for`,`if`,`in`,`module`,`next`,`not`,`or`,`redo`,`require`,`rescue`,`retry`,`return`,`then`,`undef`,`unless`,`until`,`when`,`while`,`yield`,...[`include`,`extend`,`prepend`,`public`,`private`,`protected`,`raise`,`throw`]],built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}function XM(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(32|64))?`,s=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{className:`punctuation`,begin:`->`},a]}}var ZM=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),QM=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),$M=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),eN=[...QM,...$M],tN=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),nN=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),rN=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),iN=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function aN(e){let t=ZM(e),n=rN,r=nN,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+eN.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+iN.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:tN.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function oN(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function sN(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function cN(e){return e?typeof e==`string`?e:e.source:null}function lN(e){return uN(`(?=`,e,`)`)}function uN(...e){return e.map(e=>cN(e)).join(``)}function dN(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function fN(...e){return`(`+(dN(e).capture?``:`?:`)+e.map(e=>cN(e)).join(`|`)+`)`}var pN=e=>uN(/\b/,e,/\w$/.test(e)?/\b/:/\B/),mN=[`Protocol`,`Type`].map(pN),hN=[`init`,`self`].map(pN),gN=[`Any`,`Self`],_N=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],vN=[`false`,`nil`,`true`],yN=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],bN=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],xN=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),SN=fN(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),CN=fN(SN,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),wN=uN(SN,CN,`*`),TN=fN(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),EN=fN(TN,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),DN=uN(TN,EN,`*`),ON=uN(/[A-Z]/,EN,`*`),kN=[`attached`,`autoclosure`,uN(/convention\(/,fN(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,uN(/objc\(/,DN,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],AN=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function jN(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,fN(...mN,...hN)],className:{2:`keyword`}},a={match:uN(/\./,fN(..._N)),relevance:0},o=_N.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:fN(..._N.filter(e=>typeof e!=`string`).concat(gN).map(pN),...hN)}]},c={$pattern:fN(/\b\w+/,/#\w+/),keyword:o.concat(bN),literal:vN},l=[i,a,s],u=[{match:uN(/\./,fN(...xN)),relevance:0},{className:`built_in`,match:uN(/\b/,fN(...xN),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:wN},{match:`\\.(\\.|${CN})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:uN(/\\/,e,/[0\\tnr"']/)},{match:uN(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:uN(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:uN(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:uN(e,/"""/),end:uN(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:uN(e,/"/),end:uN(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=uN(e,/\//),n=uN(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:uN(/`/,DN,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${EN}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:AN,contains:[...f,h,x]}]}},{scope:`keyword`,match:uN(/@/,fN(...kN),lN(fN(/\(/,/\s+/)))},{scope:`meta`,match:uN(/@/,DN)}],k={match:lN(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:uN(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,EN,`+`)},{className:`type`,match:ON,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:uN(/\s+&\s+/,lN(ON)),relevance:0}]},A={begin:/</,end:/>/,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let ee={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:uN(DN,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},j={begin:/</,end:/>/,keywords:`repeat each`,contains:[...r,k]},te={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:fN(lN(uN(DN,/\s*:/)),lN(uN(DN,/\s+/,DN,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:DN}]},...r,...l,...f,h,x,...O,k,ee],endsParent:!0,illegal:/["']/},M={match:[/(func|macro)/,/\s+/,fN(E.match,DN,wN)],className:{1:`keyword`,3:`title.function`},contains:[j,te,t],illegal:[/\[/,/%/]},ne={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[j,te,t],illegal:/\[|%/},N={match:[/operator/,/\s+/,wN],className:{1:`keyword`,3:`title`}},re={begin:[/precedencegroup/,/\s+/,ON],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...yN,...vN],end:/}/},ie={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},ae={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},oe={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,DN,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[j,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:ON},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,M,ne,ie,ae,oe,N,re,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,ee]}}var MN=`[A-Za-z$_][0-9A-Za-z$_]*`,NN=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),PN=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],FN=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),IN=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],LN=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],RN=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],zN=[].concat(LN,FN,IN);function BN(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=MN,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:MN,keyword:NN,literal:PN,built_in:zN,"variable.language":RN},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...FN,...IN]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...LN,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ee=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ee)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ee,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function VN(e){let t=e.regex,n=BN(e),r=MN,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:MN,keyword:NN.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:PN,built_in:zN.concat(i),"variable.language":RN},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function HN(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function UN(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}function WN(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function GN(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var KN={arduino:Uj,bash:Wj,c:Gj,cpp:Kj,csharp:qj,css:nM,diff:rM,go:iM,graphql:aM,ini:oM,java:fM,javascript:xM,json:SM,kotlin:DM,less:LM,lua:RM,makefile:zM,markdown:BM,objectivec:VM,perl:HM,php:UM,"php-template":WM,plaintext:GM,python:KM,"python-repl":qM,r:JM,ruby:YM,rust:XM,scss:aN,shell:oN,sql:sN,swift:jN,typescript:VN,vbnet:HN,wasm:UN,xml:WN,yaml:GN},qN={},JN=`hljs-`;function YN(e){let t=Mw.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||qN,a=typeof i.prefix==`string`?i.prefix:JN;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:XN,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||qN).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var XN=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},ZN=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),QN=e(ZN(),1),$N=Object.defineProperty,W=(e,t)=>$N(e,`name`,{value:t,configurable:!0}),eP=(e,t)=>{for(var n in t)$N(e,n,{get:t[n],enumerable:!0})},tP={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},G={trace:W((...e)=>{},`trace`),debug:W((...e)=>{},`debug`),info:W((...e)=>{},`info`),warn:W((...e)=>{},`warn`),error:W((...e)=>{},`error`),fatal:W((...e)=>{},`fatal`)},nP=W(function(e=`fatal`){let t=tP.fatal;typeof e==`string`?e.toLowerCase()in tP&&(t=tP[e]):typeof e==`number`&&(t=e),G.trace=()=>{},G.debug=()=>{},G.info=()=>{},G.warn=()=>{},G.error=()=>{},G.fatal=()=>{},t<=tP.fatal&&(G.fatal=console.error?console.error.bind(console,rP(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,rP(`FATAL`))),t<=tP.error&&(G.error=console.error?console.error.bind(console,rP(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,rP(`ERROR`))),t<=tP.warn&&(G.warn=console.warn?console.warn.bind(console,rP(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,rP(`WARN`))),t<=tP.info&&(G.info=console.info?console.info.bind(console,rP(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,rP(`INFO`))),t<=tP.debug&&(G.debug=console.debug?console.debug.bind(console,rP(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,rP(`DEBUG`))),t<=tP.trace&&(G.trace=console.debug?console.debug.bind(console,rP(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,rP(`TRACE`)))},`setLogLevel`),rP=W(e=>`%c${(0,QN.default)().format(`ss.SSS`)} : ${e} : `,`format`),iP={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{let t=e/255;return e>.03928?((t+.055)/1.055)**2.4:t/12.92},hue2rgb:(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),hsl2rgb:({h:e,s:t,l:n},r)=>{if(!t)return n*2.55;e/=360,t/=100,n/=100;let i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;switch(r){case`r`:return iP.hue2rgb(a,i,e+1/3)*255;case`g`:return iP.hue2rgb(a,i,e)*255;case`b`:return iP.hue2rgb(a,i,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:n},r)=>{e/=255,t/=255,n/=255;let i=Math.max(e,t,n),a=Math.min(e,t,n),o=(i+a)/2;if(r===`l`)return o*100;if(i===a)return 0;let s=i-a,c=o>.5?s/(2-i-a):s/(i+a);if(r===`s`)return c*100;switch(i){case e:return((t-n)/s+(t<n?6:0))*60;case t:return((n-e)/s+2)*60;case n:return((e-t)/s+4)*60;default:return-1}}},aP={channel:iP,lang:{clamp:(e,t,n)=>t>n?Math.min(t,Math.max(n,e)):Math.min(n,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},unit:{dec2hex:e=>{let t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}}},oP={};for(let e=0;e<=255;e++)oP[e]=aP.unit.dec2hex(e);var sP={ALL:0,RGB:1,HSL:2},cP=class{constructor(){this.type=sP.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw Error(`Cannot change both RGB and HSL channels at the same time`);this.type=e}reset(){this.type=sP.ALL}is(e){return this.type===e}},lP=new class{constructor(e,t){this.color=t,this.changed=!1,this.data=e,this.type=new cP}set(e,t){return this.color=t,this.changed=!1,this.data=e,this.type.type=sP.ALL,this}_ensureHSL(){let e=this.data,{h:t,s:n,l:r}=e;t===void 0&&(e.h=aP.channel.rgb2hsl(e,`h`)),n===void 0&&(e.s=aP.channel.rgb2hsl(e,`s`)),r===void 0&&(e.l=aP.channel.rgb2hsl(e,`l`))}_ensureRGB(){let e=this.data,{r:t,g:n,b:r}=e;t===void 0&&(e.r=aP.channel.hsl2rgb(e,`r`)),n===void 0&&(e.g=aP.channel.hsl2rgb(e,`g`)),r===void 0&&(e.b=aP.channel.hsl2rgb(e,`b`))}get r(){let e=this.data,t=e.r;return!this.type.is(sP.HSL)&&t!==void 0?t:(this._ensureHSL(),aP.channel.hsl2rgb(e,`r`))}get g(){let e=this.data,t=e.g;return!this.type.is(sP.HSL)&&t!==void 0?t:(this._ensureHSL(),aP.channel.hsl2rgb(e,`g`))}get b(){let e=this.data,t=e.b;return!this.type.is(sP.HSL)&&t!==void 0?t:(this._ensureHSL(),aP.channel.hsl2rgb(e,`b`))}get h(){let e=this.data,t=e.h;return!this.type.is(sP.RGB)&&t!==void 0?t:(this._ensureRGB(),aP.channel.rgb2hsl(e,`h`))}get s(){let e=this.data,t=e.s;return!this.type.is(sP.RGB)&&t!==void 0?t:(this._ensureRGB(),aP.channel.rgb2hsl(e,`s`))}get l(){let e=this.data,t=e.l;return!this.type.is(sP.RGB)&&t!==void 0?t:(this._ensureRGB(),aP.channel.rgb2hsl(e,`l`))}get a(){return this.data.a}set r(e){this.type.set(sP.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(sP.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(sP.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(sP.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(sP.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(sP.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}({r:0,g:0,b:0,a:0},`transparent`),uP={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;let t=e.match(uP.re);if(!t)return;let n=t[1],r=parseInt(n,16),i=n.length,a=i%4==0,o=i>4,s=o?1:17,c=o?8:4,l=a?0:-1,u=o?255:15;return lP.set({r:(r>>c*(l+3)&u)*s,g:(r>>c*(l+2)&u)*s,b:(r>>c*(l+1)&u)*s,a:a?(r&u)*s/255:1},e)},stringify:e=>{let{r:t,g:n,b:r,a:i}=e;return i<1?`#${oP[Math.round(t)]}${oP[Math.round(n)]}${oP[Math.round(r)]}${oP[Math.round(i*255)]}`:`#${oP[Math.round(t)]}${oP[Math.round(n)]}${oP[Math.round(r)]}`}},dP={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{let t=e.match(dP.hueRe);if(t){let[,e,n]=t;switch(n){case`grad`:return aP.channel.clamp.h(parseFloat(e)*.9);case`rad`:return aP.channel.clamp.h(parseFloat(e)*180/Math.PI);case`turn`:return aP.channel.clamp.h(parseFloat(e)*360)}}return aP.channel.clamp.h(parseFloat(e))},parse:e=>{let t=e.charCodeAt(0);if(t!==104&&t!==72)return;let n=e.match(dP.re);if(!n)return;let[,r,i,a,o,s]=n;return lP.set({h:dP._hue2deg(r),s:aP.channel.clamp.s(parseFloat(i)),l:aP.channel.clamp.l(parseFloat(a)),a:o?aP.channel.clamp.a(s?parseFloat(o)/100:parseFloat(o)):1},e)},stringify:e=>{let{h:t,s:n,l:r,a:i}=e;return i<1?`hsla(${aP.lang.round(t)}, ${aP.lang.round(n)}%, ${aP.lang.round(r)}%, ${i})`:`hsl(${aP.lang.round(t)}, ${aP.lang.round(n)}%, ${aP.lang.round(r)}%)`}},fP={colors:{aliceblue:`#f0f8ff`,antiquewhite:`#faebd7`,aqua:`#00ffff`,aquamarine:`#7fffd4`,azure:`#f0ffff`,beige:`#f5f5dc`,bisque:`#ffe4c4`,black:`#000000`,blanchedalmond:`#ffebcd`,blue:`#0000ff`,blueviolet:`#8a2be2`,brown:`#a52a2a`,burlywood:`#deb887`,cadetblue:`#5f9ea0`,chartreuse:`#7fff00`,chocolate:`#d2691e`,coral:`#ff7f50`,cornflowerblue:`#6495ed`,cornsilk:`#fff8dc`,crimson:`#dc143c`,cyanaqua:`#00ffff`,darkblue:`#00008b`,darkcyan:`#008b8b`,darkgoldenrod:`#b8860b`,darkgray:`#a9a9a9`,darkgreen:`#006400`,darkgrey:`#a9a9a9`,darkkhaki:`#bdb76b`,darkmagenta:`#8b008b`,darkolivegreen:`#556b2f`,darkorange:`#ff8c00`,darkorchid:`#9932cc`,darkred:`#8b0000`,darksalmon:`#e9967a`,darkseagreen:`#8fbc8f`,darkslateblue:`#483d8b`,darkslategray:`#2f4f4f`,darkslategrey:`#2f4f4f`,darkturquoise:`#00ced1`,darkviolet:`#9400d3`,deeppink:`#ff1493`,deepskyblue:`#00bfff`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1e90ff`,firebrick:`#b22222`,floralwhite:`#fffaf0`,forestgreen:`#228b22`,fuchsia:`#ff00ff`,gainsboro:`#dcdcdc`,ghostwhite:`#f8f8ff`,gold:`#ffd700`,goldenrod:`#daa520`,gray:`#808080`,green:`#008000`,greenyellow:`#adff2f`,grey:`#808080`,honeydew:`#f0fff0`,hotpink:`#ff69b4`,indianred:`#cd5c5c`,indigo:`#4b0082`,ivory:`#fffff0`,khaki:`#f0e68c`,lavender:`#e6e6fa`,lavenderblush:`#fff0f5`,lawngreen:`#7cfc00`,lemonchiffon:`#fffacd`,lightblue:`#add8e6`,lightcoral:`#f08080`,lightcyan:`#e0ffff`,lightgoldenrodyellow:`#fafad2`,lightgray:`#d3d3d3`,lightgreen:`#90ee90`,lightgrey:`#d3d3d3`,lightpink:`#ffb6c1`,lightsalmon:`#ffa07a`,lightseagreen:`#20b2aa`,lightskyblue:`#87cefa`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#b0c4de`,lightyellow:`#ffffe0`,lime:`#00ff00`,limegreen:`#32cd32`,linen:`#faf0e6`,magenta:`#ff00ff`,maroon:`#800000`,mediumaquamarine:`#66cdaa`,mediumblue:`#0000cd`,mediumorchid:`#ba55d3`,mediumpurple:`#9370db`,mediumseagreen:`#3cb371`,mediumslateblue:`#7b68ee`,mediumspringgreen:`#00fa9a`,mediumturquoise:`#48d1cc`,mediumvioletred:`#c71585`,midnightblue:`#191970`,mintcream:`#f5fffa`,mistyrose:`#ffe4e1`,moccasin:`#ffe4b5`,navajowhite:`#ffdead`,navy:`#000080`,oldlace:`#fdf5e6`,olive:`#808000`,olivedrab:`#6b8e23`,orange:`#ffa500`,orangered:`#ff4500`,orchid:`#da70d6`,palegoldenrod:`#eee8aa`,palegreen:`#98fb98`,paleturquoise:`#afeeee`,palevioletred:`#db7093`,papayawhip:`#ffefd5`,peachpuff:`#ffdab9`,peru:`#cd853f`,pink:`#ffc0cb`,plum:`#dda0dd`,powderblue:`#b0e0e6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#ff0000`,rosybrown:`#bc8f8f`,royalblue:`#4169e1`,saddlebrown:`#8b4513`,salmon:`#fa8072`,sandybrown:`#f4a460`,seagreen:`#2e8b57`,seashell:`#fff5ee`,sienna:`#a0522d`,silver:`#c0c0c0`,skyblue:`#87ceeb`,slateblue:`#6a5acd`,slategray:`#708090`,slategrey:`#708090`,snow:`#fffafa`,springgreen:`#00ff7f`,tan:`#d2b48c`,teal:`#008080`,thistle:`#d8bfd8`,transparent:`#00000000`,turquoise:`#40e0d0`,violet:`#ee82ee`,wheat:`#f5deb3`,white:`#ffffff`,whitesmoke:`#f5f5f5`,yellow:`#ffff00`,yellowgreen:`#9acd32`},parse:e=>{e=e.toLowerCase();let t=fP.colors[e];if(t)return uP.parse(t)},stringify:e=>{let t=uP.stringify(e);for(let e in fP.colors)if(fP.colors[e]===t)return e}},pP={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{let t=e.charCodeAt(0);if(t!==114&&t!==82)return;let n=e.match(pP.re);if(!n)return;let[,r,i,a,o,s,c,l,u]=n;return lP.set({r:aP.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:aP.channel.clamp.g(o?parseFloat(a)*2.55:parseFloat(a)),b:aP.channel.clamp.b(c?parseFloat(s)*2.55:parseFloat(s)),a:l?aP.channel.clamp.a(u?parseFloat(l)/100:parseFloat(l)):1},e)},stringify:e=>{let{r:t,g:n,b:r,a:i}=e;return i<1?`rgba(${aP.lang.round(t)}, ${aP.lang.round(n)}, ${aP.lang.round(r)}, ${aP.lang.round(i)})`:`rgb(${aP.lang.round(t)}, ${aP.lang.round(n)}, ${aP.lang.round(r)})`}},mP={format:{keyword:fP,hex:uP,rgb:pP,rgba:pP,hsl:dP,hsla:dP},parse:e=>{if(typeof e!=`string`)return e;let t=uP.parse(e)||pP.parse(e)||dP.parse(e)||fP.parse(e);if(t)return t;throw Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(sP.HSL)||e.data.r===void 0?dP.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?pP.stringify(e):uP.stringify(e)},hP=(e,t)=>{let n=mP.parse(e);for(let e in t)n[e]=aP.channel.clamp[e](t[e]);return mP.stringify(n)},gP=(e,t,n=0,r=1)=>{if(typeof e!=`number`)return hP(e,{a:t});let i=lP.set({r:aP.channel.clamp.r(e),g:aP.channel.clamp.g(t),b:aP.channel.clamp.b(n),a:aP.channel.clamp.a(r)});return mP.stringify(i)},_P=e=>{let{r:t,g:n,b:r}=mP.parse(e),i=.2126*aP.channel.toLinear(t)+.7152*aP.channel.toLinear(n)+.0722*aP.channel.toLinear(r);return aP.lang.round(i)},vP=e=>_P(e)>=.5,yP=e=>!vP(e),bP=(e,t,n)=>{let r=mP.parse(e),i=r[t],a=aP.channel.clamp[t](i+n);return i!==a&&(r[t]=a),mP.stringify(r)},K=(e,t)=>bP(e,`l`,t),q=(e,t)=>bP(e,`l`,-t),J=(e,t)=>{let n=mP.parse(e),r={};for(let e in t)t[e]&&(r[e]=n[e]+t[e]);return hP(e,r)},xP=(e,t,n=50)=>{let{r,g:i,b:a,a:o}=mP.parse(e),{r:s,g:c,b:l,a:u}=mP.parse(t),d=n/100,f=d*2-1,p=o-u,m=((f*p===-1?f:(f+p)/(1+f*p))+1)/2,h=1-m;return gP(r*m+s*h,i*m+c*h,a*m+l*h,o*d+u*(1-d))},Y=(e,t=100)=>{let n=mP.parse(e);return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,xP(n,e,t)},{entries:SP,setPrototypeOf:CP,isFrozen:wP,getPrototypeOf:TP,getOwnPropertyDescriptor:EP}=Object,{freeze:DP,seal:OP,create:kP}=Object,{apply:AP,construct:jP}=typeof Reflect<`u`&&Reflect;DP||=function(e){return e},OP||=function(e){return e},AP||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},jP||=function(e){return new e(...[...arguments].slice(1))};var MP=QP(Array.prototype.forEach),NP=QP(Array.prototype.lastIndexOf),PP=QP(Array.prototype.pop),FP=QP(Array.prototype.push),IP=QP(Array.prototype.splice),LP=Array.isArray,RP=QP(String.prototype.toLowerCase),zP=QP(String.prototype.toString),BP=QP(String.prototype.match),VP=QP(String.prototype.replace),HP=QP(String.prototype.indexOf),UP=QP(String.prototype.trim),WP=QP(Number.prototype.toString),GP=QP(Boolean.prototype.toString),KP=typeof BigInt>`u`?null:QP(BigInt.prototype.toString),qP=typeof Symbol>`u`?null:QP(Symbol.prototype.toString),JP=QP(Object.prototype.hasOwnProperty),YP=QP(Object.prototype.toString),XP=QP(RegExp.prototype.test),ZP=$P(TypeError);function QP(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return AP(e,t,n)}}function $P(e){return function(){return jP(e,[...arguments])}}function eF(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:RP;if(CP&&CP(e,null),!LP(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(wP(t)||(t[r]=e),i=e)}e[i]=!0}return e}function tF(e){for(let t=0;t<e.length;t++)JP(e,t)||(e[t]=null);return e}function nF(e){let t=kP(null);for(let[n,r]of SP(e))JP(e,n)&&(LP(r)?t[n]=tF(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=nF(r):t[n]=r);return t}function rF(e){switch(typeof e){case`string`:return e;case`number`:return WP(e);case`boolean`:return GP(e);case`bigint`:return KP?KP(e):`0`;case`symbol`:return qP?qP(e):`Symbol()`;case`undefined`:return YP(e);case`function`:case`object`:{if(e===null)return YP(e);let t=e,n=iF(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:YP(e)}return YP(e)}default:return YP(e)}}function iF(e,t){for(;e!==null;){let n=EP(e,t);if(n){if(n.get)return QP(n.get);if(typeof n.value==`function`)return QP(n.value)}e=TP(e)}function n(){return null}return n}function aF(e){try{return XP(e,``),!0}catch{return!1}}var oF=DP(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),sF=DP(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),cF=DP([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),lF=DP([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),uF=DP(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),dF=DP([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),fF=DP([`#text`]),pF=DP(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),mF=DP(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),hF=DP(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),gF=DP([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),_F=OP(/\{\{[\w\W]*|[\w\W]*\}\}/gm),vF=OP(/<%[\w\W]*|[\w\W]*%>/gm),yF=OP(/\$\{[\w\W]*/gm),bF=OP(/^data-[\-\w.\u00B7-\uFFFF]+$/),xF=OP(/^aria-[\-\w]+$/),SF=OP(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),CF=OP(/^(?:\w+script|data):/i),wF=OP(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),TF=OP(/^html$/i),EF=OP(/^[a-z][.\w]*(-[.\w]+)+$/i),DF=Object.freeze({__proto__:null,ARIA_ATTR:xF,ATTR_WHITESPACE:wF,CUSTOM_ELEMENT:EF,DATA_ATTR:bF,DOCTYPE_NAME:TF,ERB_EXPR:vF,IS_ALLOWED_URI:SF,IS_SCRIPT_OR_DATA:CF,MUSTACHE_EXPR:_F,TMPLIT_EXPR:yF}),OF={element:1,text:3,progressingInstruction:7,comment:8,document:9},kF=function(){return typeof window>`u`?null:window},AF=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},jF=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function MF(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kF(),t=e=>MF(e);if(t.version=`3.4.1`,t.removed=[],!e||!e.document||e.document.nodeType!==OF.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=iF(m,`cloneNode`),g=iF(m,`remove`),_=iF(m,`nextSibling`),v=iF(m,`childNodes`),y=iF(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=jF();t.isSupported=typeof SP==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:O,ERB_EXPR:k,TMPLIT_EXPR:A,DATA_ATTR:ee,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:te,ATTR_WHITESPACE:M,CUSTOM_ELEMENT:ne}=DF,{IS_ALLOWED_URI:N}=DF,re=null,ie=eF({},[...oF,...sF,...cF,...uF,...fF]),ae=null,oe=eF({},[...pF,...mF,...hF,...gF]),se=Object.seal(kP(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}})),ce=null,le=null,P=Object.seal(kP(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ue=!0,de=!0,fe=!1,pe=!0,me=!1,he=!0,ge=!1,_e=!1,ve=!1,ye=!1,be=!1,xe=!1,Se=!0,Ce=!1,we=`user-content-`,Te=!0,Ee=!1,De={},Oe=null,ke=eF({},[`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`]),Ae=null,je=eF({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Me=null,Ne=eF({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Pe=`http://www.w3.org/1998/Math/MathML`,Fe=`http://www.w3.org/2000/svg`,Ie=`http://www.w3.org/1999/xhtml`,Le=Ie,Re=!1,ze=null,Be=eF({},[Pe,Fe,Ie],zP),Ve=eF({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),He=eF({},[`annotation-xml`]),Ue=eF({},[`title`,`style`,`font`,`a`,`script`]),We=null,Ge=[`application/xhtml+xml`,`text/html`],Ke=null,qe=null,Je=n.createElement(`form`),Ye=function(e){return e instanceof RegExp||e instanceof Function},Xe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qe&&qe===e)return;(!e||typeof e!=`object`)&&(e={}),e=nF(e),We=Ge.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Ke=We===`application/xhtml+xml`?zP:RP,re=JP(e,`ALLOWED_TAGS`)&&LP(e.ALLOWED_TAGS)?eF({},e.ALLOWED_TAGS,Ke):ie,ae=JP(e,`ALLOWED_ATTR`)&&LP(e.ALLOWED_ATTR)?eF({},e.ALLOWED_ATTR,Ke):oe,ze=JP(e,`ALLOWED_NAMESPACES`)&&LP(e.ALLOWED_NAMESPACES)?eF({},e.ALLOWED_NAMESPACES,zP):Be,Me=JP(e,`ADD_URI_SAFE_ATTR`)&&LP(e.ADD_URI_SAFE_ATTR)?eF(nF(Ne),e.ADD_URI_SAFE_ATTR,Ke):Ne,Ae=JP(e,`ADD_DATA_URI_TAGS`)&&LP(e.ADD_DATA_URI_TAGS)?eF(nF(je),e.ADD_DATA_URI_TAGS,Ke):je,Oe=JP(e,`FORBID_CONTENTS`)&&LP(e.FORBID_CONTENTS)?eF({},e.FORBID_CONTENTS,Ke):ke,ce=JP(e,`FORBID_TAGS`)&&LP(e.FORBID_TAGS)?eF({},e.FORBID_TAGS,Ke):nF({}),le=JP(e,`FORBID_ATTR`)&&LP(e.FORBID_ATTR)?eF({},e.FORBID_ATTR,Ke):nF({}),De=JP(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?nF(e.USE_PROFILES):e.USE_PROFILES:!1,ue=e.ALLOW_ARIA_ATTR!==!1,de=e.ALLOW_DATA_ATTR!==!1,fe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=e.SAFE_FOR_TEMPLATES||!1,he=e.SAFE_FOR_XML!==!1,ge=e.WHOLE_DOCUMENT||!1,ye=e.RETURN_DOM||!1,be=e.RETURN_DOM_FRAGMENT||!1,xe=e.RETURN_TRUSTED_TYPE||!1,ve=e.FORCE_BODY||!1,Se=e.SANITIZE_DOM!==!1,Ce=e.SANITIZE_NAMED_PROPS||!1,Te=e.KEEP_CONTENT!==!1,Ee=e.IN_PLACE||!1,N=aF(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:SF,Le=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ie,Ve=JP(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?nF(e.MATHML_TEXT_INTEGRATION_POINTS):eF({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),He=JP(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?nF(e.HTML_INTEGRATION_POINTS):eF({},[`annotation-xml`]);let t=JP(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?nF(e.CUSTOM_ELEMENT_HANDLING):kP(null);if(se=kP(null),JP(t,`tagNameCheck`)&&Ye(t.tagNameCheck)&&(se.tagNameCheck=t.tagNameCheck),JP(t,`attributeNameCheck`)&&Ye(t.attributeNameCheck)&&(se.attributeNameCheck=t.attributeNameCheck),JP(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(se.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),me&&(de=!1),be&&(ye=!0),De&&(re=eF({},fF),ae=kP(null),De.html===!0&&(eF(re,oF),eF(ae,pF)),De.svg===!0&&(eF(re,sF),eF(ae,mF),eF(ae,gF)),De.svgFilters===!0&&(eF(re,cF),eF(ae,mF),eF(ae,gF)),De.mathMl===!0&&(eF(re,uF),eF(ae,hF),eF(ae,gF))),P.tagCheck=null,P.attributeCheck=null,JP(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?P.tagCheck=e.ADD_TAGS:LP(e.ADD_TAGS)&&(re===ie&&(re=nF(re)),eF(re,e.ADD_TAGS,Ke))),JP(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?P.attributeCheck=e.ADD_ATTR:LP(e.ADD_ATTR)&&(ae===oe&&(ae=nF(ae)),eF(ae,e.ADD_ATTR,Ke))),JP(e,`ADD_URI_SAFE_ATTR`)&&LP(e.ADD_URI_SAFE_ATTR)&&eF(Me,e.ADD_URI_SAFE_ATTR,Ke),JP(e,`FORBID_CONTENTS`)&&LP(e.FORBID_CONTENTS)&&(Oe===ke&&(Oe=nF(Oe)),eF(Oe,e.FORBID_CONTENTS,Ke)),JP(e,`ADD_FORBID_CONTENTS`)&&LP(e.ADD_FORBID_CONTENTS)&&(Oe===ke&&(Oe=nF(Oe)),eF(Oe,e.ADD_FORBID_CONTENTS,Ke)),Te&&(re[`#text`]=!0),ge&&eF(re,[`html`,`head`,`body`]),re.table&&(eF(re,[`tbody`]),delete ce.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ZP(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ZP(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=AF(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));DP&&DP(e),qe=e},Ze=eF({},[...sF,...cF,...lF]),Qe=eF({},[...uF,...dF]),$e=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Le,tagName:`template`});let n=RP(e.tagName),r=RP(t.tagName);return ze[e.namespaceURI]?e.namespaceURI===Fe?t.namespaceURI===Ie?n===`svg`:t.namespaceURI===Pe?n===`svg`&&(r===`annotation-xml`||Ve[r]):!!Ze[n]:e.namespaceURI===Pe?t.namespaceURI===Ie?n===`math`:t.namespaceURI===Fe?n===`math`&&He[r]:!!Qe[n]:e.namespaceURI===Ie?t.namespaceURI===Fe&&!He[r]||t.namespaceURI===Pe&&!Ve[r]?!1:!Qe[n]&&(Ue[n]||!Ze[n]):!!(We===`application/xhtml+xml`&&ze[e.namespaceURI]):!1},et=function(e){FP(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},tt=function(e,n){try{FP(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{FP(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(ye||be)try{et(n)}catch{}else try{n.setAttribute(e,``)}catch{}},nt=function(e){let t=null,r=null;if(ve)e=`<remove></remove>`+e;else{let t=BP(e,/^[\r\n\t ]+/);r=t&&t[0]}We===`application/xhtml+xml`&&Le===Ie&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Le===Ie)try{t=new f().parseFromString(i,We)}catch{}if(!t||!t.documentElement){t=S.createDocument(Le,`template`,null);try{t.documentElement.innerHTML=Re?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Le===Ie?T.call(t,ge?`html`:`body`)[0]:ge?t.documentElement:a},rt=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},it=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},at=function(e){return typeof s==`function`&&e instanceof s};function ot(e,n,r){MP(e,e=>{e.call(t,n,r,qe)})}let st=function(e){let n=null;if(ot(D.beforeSanitizeElements,e,null),it(e))return et(e),!0;let r=Ke(e.nodeName);if(ot(D.uponSanitizeElement,e,{tagName:r,allowedTags:re}),he&&e.hasChildNodes()&&!at(e.firstElementChild)&&XP(/<[/\w!]/g,e.innerHTML)&&XP(/<[/\w!]/g,e.textContent)||he&&e.namespaceURI===Ie&&r===`style`&&at(e.firstElementChild)||e.nodeType===OF.progressingInstruction||he&&e.nodeType===OF.comment&&XP(/<[/\w]/g,e.data))return et(e),!0;if(ce[r]||!(P.tagCheck instanceof Function&&P.tagCheck(r))&&!re[r]){if(!ce[r]&&ut(r)&&(se.tagNameCheck instanceof RegExp&&XP(se.tagNameCheck,r)||se.tagNameCheck instanceof Function&&se.tagNameCheck(r)))return!1;if(Te&&!Oe[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);t.insertBefore(r,_(e))}}}return et(e),!0}return e instanceof c&&!$e(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&XP(/<\/no(script|embed|frames)/i,e.innerHTML)?(et(e),!0):(me&&e.nodeType===OF.text&&(n=e.textContent,MP([O,k,A],e=>{n=VP(n,e,` `)}),e.textContent!==n&&(FP(t.removed,{element:e.cloneNode()}),e.textContent=n)),ot(D.afterSanitizeElements,e,null),!1)},ct=function(e,t,r){if(le[t]||Se&&(t===`id`||t===`name`)&&(r in n||r in Je))return!1;if(!(de&&!le[t]&&XP(ee,t))&&!(ue&&XP(j,t))&&!(P.attributeCheck instanceof Function&&P.attributeCheck(t,e))){if(!ae[t]||le[t]){if(!(ut(e)&&(se.tagNameCheck instanceof RegExp&&XP(se.tagNameCheck,e)||se.tagNameCheck instanceof Function&&se.tagNameCheck(e))&&(se.attributeNameCheck instanceof RegExp&&XP(se.attributeNameCheck,t)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(t,e))||t===`is`&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&XP(se.tagNameCheck,r)||se.tagNameCheck instanceof Function&&se.tagNameCheck(r))))return!1}else if(!Me[t]&&!XP(N,VP(r,M,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&HP(r,`data:`)===0&&Ae[e])&&!(fe&&!XP(te,VP(r,M,``)))&&r)return!1}return!0},lt=eF({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),ut=function(e){return!lt[RP(e)]&&XP(ne,e)},dt=function(e){ot(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||it(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=Ke(a),l=s,u=a===`value`?l:UP(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,ot(D.uponSanitizeAttribute,e,r),u=r.attrValue,Ce&&(c===`id`||c===`name`)&&HP(u,we)!==0&&(tt(a,e),u=we+u),he&&XP(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){tt(a,e);continue}if(c===`attributename`&&BP(u,`href`)){tt(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){tt(a,e);continue}if(!pe&&XP(/\/>/i,u)){tt(a,e);continue}me&&MP([O,k,A],e=>{u=VP(u,e,` `)});let d=Ke(e.nodeName);if(!ct(d,c,u)){tt(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),it(e)?et(e):PP(t.removed)}catch{tt(a,e)}}ot(D.afterSanitizeAttributes,e,null)},ft=function(e){let t=null,n=rt(e);for(ot(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)ot(D.uponSanitizeShadowNode,t,null),st(t),dt(t),t.content instanceof a&&ft(t.content);ot(D.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Re=!e,Re&&(e=`<!-->`),typeof e!=`string`&&!at(e)&&(e=rF(e),typeof e!=`string`))throw ZP(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(_e||Xe(n),t.removed=[],typeof e==`string`&&(Ee=!1),Ee){let t=e.nodeName;if(typeof t==`string`){let e=Ke(t);if(!re[e]||ce[e])throw ZP(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=nt(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===OF.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!ye&&!me&&!ge&&e.indexOf(`<`)===-1)return b&&xe?b.createHTML(e):e;if(i=nt(e),!i)return ye?null:xe?x:``}i&&ve&&et(i.firstChild);let u=rt(Ee?e:i);for(;c=u.nextNode();)st(c),dt(c),c.content instanceof a&&ft(c.content);if(Ee)return e;if(ye){if(me){i.normalize();let e=i.innerHTML;MP([O,k,A],t=>{e=VP(e,t,` `)}),i.innerHTML=e}if(be)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(ae.shadowroot||ae.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=ge?i.outerHTML:i.innerHTML;return ge&&re[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&XP(TF,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
238
+ `+d),me&&MP([O,k,A],e=>{d=VP(d,e,` `)}),b&&xe?b.createHTML(d):d},t.setConfig=function(){Xe(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),_e=!0},t.clearConfig=function(){qe=null,_e=!1},t.isValidAttribute=function(e,t,n){return qe||Xe({}),ct(Ke(e),Ke(t),n)},t.addHook=function(e,t){typeof t==`function`&&FP(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=NP(D[e],t);return n===-1?void 0:IP(D[e],n,1)[0]}return PP(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=jF()},t}var NF=MF(),PF=`modulepreload`,FF=function(e){return`/`+e},IF={},LF=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=FF(t,n),t in IF)return;IF[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:PF,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},RF=/^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s,zF=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,BF=/\s*%%.*\n/gm,VF=class extends Error{static{W(this,`UnknownDiagramError`)}constructor(e){super(e),this.name=`UnknownDiagramError`}},HF={},UF=W(function(e,t){e=e.replace(RF,``).replace(zF,``).replace(BF,`
239
+ `);for(let[n,{detector:r}]of Object.entries(HF))if(r(e,t))return n;throw new VF(`No diagram type detected matching given configuration for text: ${e}`)},`detectType`),WF=W((...e)=>{for(let{id:t,detector:n,loader:r}of e)GF(t,n,r)},`registerLazyLoadedDiagrams`),GF=W((e,t,n)=>{HF[e]&&G.warn(`Detector with key ${e} already exists. Overwriting.`),HF[e]={detector:t,loader:n},G.debug(`Detector with key ${e} added${n?` with loader`:``}`)},`addDetector`),KF=W(e=>HF[e].loader,`getDiagramLoader`),qF=W((e,t,{depth:n=2,clobber:r=!1}={})=>{let i={depth:n,clobber:r};return Array.isArray(t)&&!Array.isArray(e)?(t.forEach(t=>qF(e,t,i)),e):Array.isArray(t)&&Array.isArray(e)?(t.forEach(t=>{e.includes(t)||e.push(t)}),e):e===void 0||n<=0?typeof e==`object`&&e&&typeof t==`object`?Object.assign(e,t):t:(t!==void 0&&typeof e==`object`&&typeof t==`object`&&Object.keys(t).forEach(i=>{typeof t[i]==`object`&&t[i]!==null&&(e[i]===void 0||typeof e[i]==`object`)?(e[i]===void 0&&(e[i]=Array.isArray(t[i])?[]:{}),e[i]=qF(e[i],t[i],{depth:n-1,clobber:r})):(r||typeof e[i]!=`object`&&typeof t[i]!=`object`)&&(e[i]=t[i])}),e)},`assignWithDepth`),JF=qF,YF=`#ffffff`,XF=`#f2f2f2`,ZF=W((e,t)=>t?J(e,{s:-40,l:10}):J(e,{s:-40,l:-10}),`mkBorder`),QF=class{static{W(this,`Theme`)}constructor(){this.background=`#f4f4f4`,this.primaryColor=`#fff4dd`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#333`,this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.useGradient=!0,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,1))`}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#333`),this.secondaryColor=this.secondaryColor||J(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||J(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ZF(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ZF(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#333`,this.secondaryTextColor=this.secondaryTextColor||Y(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Y(this.tertiaryColor),this.lineColor=this.lineColor||Y(this.background),this.arrowheadColor=this.arrowheadColor||Y(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||q(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Y(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||K(this.primaryColor,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.vertLineColor=this.vertLineColor||`navy`,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.noteFontWeight=this.noteFontWeight||`normal`,this.fontWeight=this.fontWeight||`normal`,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||q(this.mainBkg,5)||`#ffffff`,this.rowEven=this.rowEven||q(this.mainBkg,10)):(this.rowOdd=this.rowOdd||K(this.mainBkg,75)||`#ffffff`,this.rowEven=this.rowEven||K(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this[`surface`+t]=this[`surface`+t]||J(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this[`surfacePeer`+t]=this[`surfacePeer`+t]||J(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||J(this.primaryColor,{h:64}),this.fillType3=this.fillType3||J(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||J(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||J(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||J(this.primaryColor,{h:128}),this.fillType7=this.fillType7||J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||J(this.primaryColor,{l:-10}),this.pie5=this.pie5||J(this.secondaryColor,{l:-10}),this.pie6=this.pie6||J(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||J(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.venn1=this.venn1??J(this.primaryColor,{l:-30}),this.venn2=this.venn2??J(this.secondaryColor,{l:-30}),this.venn3=this.venn3??J(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??J(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??J(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??J(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??J(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??J(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.archEdgeColor=this.archEdgeColor||`#777`,this.archEdgeArrowColor=this.archEdgeArrowColor||`#777`,this.archEdgeWidth=this.archEdgeWidth||`3`,this.archGroupBorderColor=this.archGroupBorderColor||`#000`,this.archGroupBorderWidth=this.archGroupBorderWidth||`2px`,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||J(this.primaryColor,{h:-30}),this.git4=this.git4||J(this.primaryColor,{h:-60}),this.git5=this.git5||J(this.primaryColor,{h:-90}),this.git6=this.git6||J(this.primaryColor,{h:60}),this.git7=this.git7||J(this.primaryColor,{h:120}),this.darkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},$F=W(e=>{let t=new QF;return t.calculate(e),t},`getThemeVariables`),eI=class{static{W(this,`Theme`)}constructor(){this.background=`#333`,this.primaryColor=`#1f2020`,this.secondaryColor=K(this.primaryColor,16),this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=Y(this.background),this.secondaryBorderColor=ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ZF(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.lineColor=Y(this.background),this.textColor=Y(this.background),this.mainBkg=`#1f2020`,this.secondBkg=`calculated`,this.mainContrastColor=`lightgrey`,this.darkTextColor=K(Y(`#323D47`),10),this.lineColor=`calculated`,this.border1=`#ccc`,this.border2=gP(255,255,255,.25),this.arrowheadColor=`calculated`,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.labelBackground=`#181818`,this.textColor=`#ccc`,this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg=`calculated`,this.nodeBorder=`calculated`,this.clusterBkg=`calculated`,this.clusterBorder=`calculated`,this.defaultLinkColor=`calculated`,this.titleColor=`#F9FFFE`,this.edgeLabelBackground=`calculated`,this.actorBorder=`calculated`,this.actorBkg=`calculated`,this.actorTextColor=`calculated`,this.actorLineColor=`calculated`,this.signalColor=`calculated`,this.signalTextColor=`calculated`,this.labelBoxBkgColor=`calculated`,this.labelBoxBorderColor=`calculated`,this.labelTextColor=`calculated`,this.loopTextColor=`calculated`,this.noteBorderColor=`calculated`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`calculated`,this.activationBorderColor=`calculated`,this.activationBkgColor=`calculated`,this.sequenceNumberColor=`black`,this.clusterBkg=`#302F3D`,this.sectionBkgColor=q(`#EAE8D9`,30),this.altSectionBkgColor=`calculated`,this.sectionBkgColor2=`#EAE8D9`,this.excludeBkgColor=q(this.sectionBkgColor,10),this.taskBorderColor=gP(255,255,255,70),this.taskBkgColor=`calculated`,this.taskTextColor=`calculated`,this.taskTextLightColor=`calculated`,this.taskTextOutsideColor=`calculated`,this.taskTextClickableColor=`#003163`,this.activeTaskBorderColor=gP(255,255,255,50),this.activeTaskBkgColor=`#81B1DB`,this.gridColor=`calculated`,this.doneTaskBkgColor=`calculated`,this.doneTaskBorderColor=`grey`,this.critBorderColor=`#E83737`,this.critBkgColor=`#E83737`,this.taskTextDarkColor=`calculated`,this.todayLineColor=`#DB5757`,this.vertLineColor=`#00BFFF`,this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.rowOdd=this.rowOdd||K(this.mainBkg,5)||`#ffffff`,this.rowEven=this.rowEven||q(this.mainBkg,10),this.labelColor=`calculated`,this.errorBkgColor=`#a44141`,this.errorTextColor=`#ddd`,this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,1))`,this.noteFontWeight=this.noteFontWeight||`normal`,this.fontWeight=this.fontWeight||`normal`}updateColors(){this.secondBkg=K(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=K(this.labelBackground,25),this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.altSectionBkgColor=this.background,this.taskBkgColor=K(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=Y(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#555`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=`#f4f4f4`,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=J(this.primaryColor,{h:64}),this.fillType3=J(this.secondaryColor,{h:64}),this.fillType4=J(this.primaryColor,{h:-64}),this.fillType5=J(this.secondaryColor,{h:-64}),this.fillType6=J(this.primaryColor,{h:128}),this.fillType7=J(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||`#0b0000`,this.cScale2=this.cScale2||`#4d1037`,this.cScale3=this.cScale3||`#3f5258`,this.cScale4=this.cScale4||`#4f2f1b`,this.cScale5=this.cScale5||`#6e0a0a`,this.cScale6=this.cScale6||`#3b0048`,this.cScale7=this.cScale7||`#995a01`,this.cScale8=this.cScale8||`#154706`,this.cScale9=this.cScale9||`#161722`,this.cScale10=this.cScale10||`#00296f`,this.cScale11=this.cScale11||`#01629c`,this.cScale12=this.cScale12||`#010029`,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10);for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||J(this.mainBkg,{h:30,s:-30,l:-(-10+e*4)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||J(this.mainBkg,{h:30,s:-30,l:-(-7+e*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?`black`:this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`pie`+e]=this[`cScale`+e];this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`;for(let e=0;e<8;e++)this[`venn`+(e+1)]=this[`venn`+(e+1)]??K(this[`cScale`+e],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22`},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=K(this.secondaryColor,20),this.git1=K(this.pie2||this.secondaryColor,20),this.git2=K(this.pie3||this.tertiaryColor,20),this.git3=K(this.pie4||J(this.primaryColor,{h:-30}),20),this.git4=K(this.pie5||J(this.primaryColor,{h:-60}),20),this.git5=K(this.pie6||J(this.primaryColor,{h:-90}),10),this.git6=K(this.pie7||J(this.primaryColor,{h:60}),10),this.git7=K(this.pie8||J(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Y(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Y(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||K(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||K(this.background,2),this.nodeBorder=this.nodeBorder||`#999`}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},tI=W(e=>{let t=new eI;return t.calculate(e),t},`getThemeVariables`),nI=class{static{W(this,`Theme`)}constructor(){this.background=`#f4f4f4`,this.primaryColor=`#ECECFF`,this.secondaryColor=J(this.primaryColor,{h:120}),this.secondaryColor=`#ffffde`,this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ZF(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.lineColor=Y(this.background),this.textColor=Y(this.background),this.background=`white`,this.mainBkg=`#ECECFF`,this.secondBkg=`#ffffde`,this.lineColor=`#333333`,this.border1=`#9370DB`,this.primaryBorderColor=ZF(this.primaryColor,this.darkMode),this.border2=`#aaaa33`,this.arrowheadColor=`#333333`,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.labelBackground=`rgba(232,232,232, 0.8)`,this.textColor=`#333`,this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg=`calculated`,this.nodeBorder=`calculated`,this.clusterBkg=`calculated`,this.clusterBorder=`calculated`,this.defaultLinkColor=`calculated`,this.titleColor=`calculated`,this.edgeLabelBackground=`calculated`,this.actorBorder=`calculated`,this.actorBkg=`calculated`,this.actorTextColor=`black`,this.actorLineColor=`calculated`,this.signalColor=`calculated`,this.signalTextColor=`calculated`,this.labelBoxBkgColor=`calculated`,this.labelBoxBorderColor=`calculated`,this.labelTextColor=`calculated`,this.loopTextColor=`calculated`,this.noteBorderColor=`calculated`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`calculated`,this.activationBorderColor=`#666`,this.activationBkgColor=`#f4f4f4`,this.sequenceNumberColor=`white`,this.clusterBkg=`#FBFBFF`,this.sectionBkgColor=`calculated`,this.altSectionBkgColor=`calculated`,this.sectionBkgColor2=`calculated`,this.excludeBkgColor=`#eeeeee`,this.taskBorderColor=`calculated`,this.taskBkgColor=`calculated`,this.taskTextLightColor=`calculated`,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=`calculated`,this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor=`calculated`,this.activeTaskBorderColor=`calculated`,this.activeTaskBkgColor=`calculated`,this.gridColor=`calculated`,this.doneTaskBkgColor=`calculated`,this.doneTaskBorderColor=`calculated`,this.critBorderColor=`calculated`,this.critBkgColor=`calculated`,this.todayLineColor=`calculated`,this.vertLineColor=`calculated`,this.sectionBkgColor=gP(102,102,255,.49),this.altSectionBkgColor=`white`,this.sectionBkgColor2=`#fff400`,this.taskBorderColor=`#534fbc`,this.taskBkgColor=`#8a90dd`,this.taskTextLightColor=`white`,this.taskTextColor=`calculated`,this.taskTextDarkColor=`black`,this.taskTextOutsideColor=`calculated`,this.taskTextClickableColor=`#003163`,this.activeTaskBorderColor=`#534fbc`,this.activeTaskBkgColor=`#bfc7ff`,this.gridColor=`lightgrey`,this.doneTaskBkgColor=`lightgrey`,this.doneTaskBorderColor=`grey`,this.critBorderColor=`#ff8888`,this.critBkgColor=`red`,this.todayLineColor=`red`,this.vertLineColor=`navy`,this.noteFontWeight=this.noteFontWeight||`normal`,this.fontWeight=this.fontWeight||`normal`,this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.rowOdd=`calculated`,this.rowEven=`calculated`,this.labelColor=`black`,this.errorBkgColor=`#552222`,this.errorTextColor=`#552222`,this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow=`drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))`,this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||q(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||q(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],10),this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||J(this[`cScale`+e],{h:180});for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||J(this.mainBkg,{h:30,l:-(5+e*5)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||J(this.mainBkg,{h:30,l:-(7+e*5)});if(this.scaleLabelColor=this.scaleLabelColor!==`calculated`&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!==`calculated`){this.cScaleLabel0=this.cScaleLabel0||Y(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||Y(this.labelTextColor);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||K(this.primaryColor,75)||`#ffffff`,this.rowEven=this.rowEven||K(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=J(this.primaryColor,{h:64}),this.fillType3=J(this.secondaryColor,{h:64}),this.fillType4=J(this.primaryColor,{h:-64}),this.fillType5=J(this.secondaryColor,{h:-64}),this.fillType6=J(this.primaryColor,{h:128}),this.fillType7=J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||J(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||J(this.primaryColor,{l:-10}),this.pie5=this.pie5||J(this.secondaryColor,{l:-30}),this.pie6=this.pie6||J(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||J(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.venn1=this.venn1??J(this.primaryColor,{l:-30}),this.venn2=this.venn2??J(this.secondaryColor,{l:-30}),this.venn3=this.venn3??J(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??J(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??J(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??J(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??J(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??J(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||J(this.primaryColor,{h:-30}),this.git4=this.git4||J(this.primaryColor,{h:-60}),this.git5=this.git5||J(this.primaryColor,{h:-90}),this.git6=this.git6||J(this.primaryColor,{h:60}),this.git7=this.git7||J(this.primaryColor,{h:120}),this.darkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||q(Y(this.git0),25),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Y(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Y(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(Object.keys(this).forEach(e=>{this[e]===`calculated`&&(this[e]=void 0)}),typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},rI=W(e=>{let t=new nI;return t.calculate(e),t},`getThemeVariables`),iI=class{static{W(this,`Theme`)}constructor(){this.background=`#f4f4f4`,this.primaryColor=`#cde498`,this.secondaryColor=`#cdffb2`,this.background=`white`,this.mainBkg=`#cde498`,this.secondBkg=`#cdffb2`,this.lineColor=`green`,this.border1=`#13540c`,this.border2=`#6eaa49`,this.arrowheadColor=`green`,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.tertiaryColor=K(`#cde498`,10),this.primaryBorderColor=ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ZF(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.primaryColor),this.lineColor=Y(this.background),this.textColor=Y(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg=`calculated`,this.nodeBorder=`calculated`,this.clusterBkg=`calculated`,this.clusterBorder=`calculated`,this.defaultLinkColor=`calculated`,this.titleColor=`#333`,this.edgeLabelBackground=`#e8e8e8`,this.actorBorder=`calculated`,this.actorBkg=`calculated`,this.actorTextColor=`black`,this.actorLineColor=`calculated`,this.signalColor=`#333`,this.signalTextColor=`#333`,this.labelBoxBkgColor=`calculated`,this.labelBoxBorderColor=`#326932`,this.labelTextColor=`calculated`,this.loopTextColor=`calculated`,this.noteBorderColor=`calculated`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`calculated`,this.activationBorderColor=`#666`,this.activationBkgColor=`#f4f4f4`,this.sequenceNumberColor=`white`,this.sectionBkgColor=`#6eaa49`,this.altSectionBkgColor=`white`,this.sectionBkgColor2=`#6eaa49`,this.excludeBkgColor=`#eeeeee`,this.taskBorderColor=`calculated`,this.taskBkgColor=`#487e3a`,this.taskTextLightColor=`white`,this.taskTextColor=`calculated`,this.taskTextDarkColor=`black`,this.taskTextOutsideColor=`calculated`,this.taskTextClickableColor=`#003163`,this.activeTaskBorderColor=`calculated`,this.activeTaskBkgColor=`calculated`,this.gridColor=`lightgrey`,this.doneTaskBkgColor=`lightgrey`,this.doneTaskBorderColor=`grey`,this.critBorderColor=`#ff8888`,this.critBkgColor=`red`,this.todayLineColor=`red`,this.vertLineColor=`#00BFFF`,this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.noteFontWeight=`normal`,this.fontWeight=`normal`,this.labelColor=`black`,this.errorBkgColor=`#552222`,this.errorTextColor=`#552222`,this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))`}updateColors(){this.actorBorder=q(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||q(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||q(this.tertiaryColor,40);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],10),this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||J(this[`cScale`+e],{h:180});this.scaleLabelColor=this.scaleLabelColor!==`calculated`&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||J(this.mainBkg,{h:30,s:-30,l:-(5+e*5)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||J(this.mainBkg,{h:30,s:-30,l:-(8+e*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||K(this.mainBkg,75)||`#ffffff`,this.rowEven=this.rowEven||K(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=J(this.primaryColor,{h:64}),this.fillType3=J(this.secondaryColor,{h:64}),this.fillType4=J(this.primaryColor,{h:-64}),this.fillType5=J(this.secondaryColor,{h:-64}),this.fillType6=J(this.primaryColor,{h:128}),this.fillType7=J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||J(this.primaryColor,{l:-30}),this.pie5=this.pie5||J(this.secondaryColor,{l:-30}),this.pie6=this.pie6||J(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||J(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.venn1=this.venn1??J(this.primaryColor,{l:-30}),this.venn2=this.venn2??J(this.secondaryColor,{l:-30}),this.venn3=this.venn3??J(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??J(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??J(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??J(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??J(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??J(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||J(this.primaryColor,{h:-30}),this.git4=this.git4||J(this.primaryColor,{h:-60}),this.git5=this.git5||J(this.primaryColor,{h:-90}),this.git6=this.git6||J(this.primaryColor,{h:60}),this.git7=this.git7||J(this.primaryColor,{h:120}),this.darkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||Y(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||Y(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},aI=W(e=>{let t=new iI;return t.calculate(e),t},`getThemeVariables`),oI=class{static{W(this,`Theme`)}constructor(){this.primaryColor=`#eee`,this.contrast=`#707070`,this.secondaryColor=K(this.contrast,55),this.background=`#ffffff`,this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ZF(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.lineColor=Y(this.background),this.textColor=Y(this.background),this.mainBkg=`#eee`,this.secondBkg=`calculated`,this.lineColor=`#666`,this.border1=`#999`,this.border2=`calculated`,this.note=`#ffa`,this.text=`#333`,this.critical=`#d42`,this.done=`#bbb`,this.arrowheadColor=`#333333`,this.fontFamily=`"trebuchet ms", verdana, arial, sans-serif`,this.fontSize=`16px`,this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg=`calculated`,this.nodeBorder=`calculated`,this.clusterBkg=`calculated`,this.clusterBorder=`calculated`,this.defaultLinkColor=`calculated`,this.titleColor=`calculated`,this.edgeLabelBackground=`white`,this.actorBorder=`calculated`,this.actorBkg=`calculated`,this.actorTextColor=`calculated`,this.actorLineColor=this.actorBorder,this.signalColor=`calculated`,this.signalTextColor=`calculated`,this.labelBoxBkgColor=`calculated`,this.labelBoxBorderColor=`calculated`,this.labelTextColor=`calculated`,this.loopTextColor=`calculated`,this.noteBorderColor=`calculated`,this.noteBkgColor=`calculated`,this.noteTextColor=`calculated`,this.activationBorderColor=`#666`,this.activationBkgColor=`#f4f4f4`,this.sequenceNumberColor=`white`,this.sectionBkgColor=`calculated`,this.altSectionBkgColor=`white`,this.sectionBkgColor2=`calculated`,this.excludeBkgColor=`#eeeeee`,this.taskBorderColor=`calculated`,this.taskBkgColor=`calculated`,this.taskTextLightColor=`white`,this.taskTextColor=`calculated`,this.taskTextDarkColor=`calculated`,this.taskTextOutsideColor=`calculated`,this.taskTextClickableColor=`#003163`,this.activeTaskBorderColor=`calculated`,this.activeTaskBkgColor=`calculated`,this.gridColor=`calculated`,this.doneTaskBkgColor=`calculated`,this.doneTaskBorderColor=`calculated`,this.critBkgColor=`calculated`,this.critBorderColor=`calculated`,this.todayLineColor=`calculated`,this.vertLineColor=`calculated`,this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.noteFontWeight=`normal`,this.fontWeight=`normal`,this.rowOdd=this.rowOdd||K(this.mainBkg,75)||`#ffffff`,this.rowEven=this.rowEven||`#f4f4f4`,this.labelColor=`black`,this.errorBkgColor=`#552222`,this.errorTextColor=`#552222`,this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,1))`}updateColors(){this.secondBkg=K(this.contrast,55),this.border2=this.contrast,this.actorBorder=K(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor=`#999`,this.noteBkgColor=`#666`,this.noteTextColor=`#fff`,this.cScale0=this.cScale0||`#555`,this.cScale1=this.cScale1||`#F4F4F4`,this.cScale2=this.cScale2||`#555`,this.cScale3=this.cScale3||`#BBB`,this.cScale4=this.cScale4||`#777`,this.cScale5=this.cScale5||`#999`,this.cScale6=this.cScale6||`#DDD`,this.cScale7=this.cScale7||`#FFF`,this.cScale8=this.cScale8||`#DDD`,this.cScale9=this.cScale9||`#BBB`,this.cScale10=this.cScale10||`#999`,this.cScale11=this.cScale11||`#777`;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?`black`:this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||J(this.mainBkg,{l:-(5+e*5)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||J(this.mainBkg,{l:-(8+e*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.sectionBkgColor=K(this.contrast,30),this.sectionBkgColor2=K(this.contrast,30),this.taskBorderColor=q(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=K(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=q(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||`#000`,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f4f4f4`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||`#000`,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=`#222`,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=J(this.primaryColor,{h:64}),this.fillType3=J(this.secondaryColor,{h:64}),this.fillType4=J(this.primaryColor,{h:-64}),this.fillType5=J(this.secondaryColor,{h:-64}),this.fillType6=J(this.primaryColor,{h:128}),this.fillType7=J(this.secondaryColor,{h:128});for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`pie`+e]=this[`cScale`+e];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`;for(let e=0;e<8;e++)this[`venn`+(e+1)]=this[`venn`+(e+1)]??this[`cScale`+e];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0`},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||`#DEDEDE`,graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=q(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||J(this.primaryColor,{h:-30}),this.git4=this.pie5||J(this.primaryColor,{h:-60}),this.git5=this.pie6||J(this.primaryColor,{h:-90}),this.git6=this.pie7||J(this.primaryColor,{h:60}),this.git7=this.pie8||J(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1=`white`,this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3=`white`,this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},sI=W(e=>{let t=new oI;return t.calculate(e),t},`getThemeVariables`),cI=class{static{W(this,`Theme`)}constructor(){this.background=`#ffffff`,this.primaryColor=`#cccccc`,this.mainBkg=`#ffffff`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#333`,this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=ZF(this.primaryColor,this.darkMode),this.fontFamily=`arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#000000`,this.stateBorder=`#000000`,this.useGradient=!0,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));`,this.tertiaryColor=`#ffffff`,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.noteFontWeight=`normal`,this.fontWeight=`normal`}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#333`),this.secondaryColor=this.secondaryColor||J(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||J(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ZF(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ZF(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#333`,this.secondaryTextColor=this.secondaryTextColor||Y(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Y(this.tertiaryColor),this.lineColor=this.lineColor||Y(this.background),this.arrowheadColor=this.arrowheadColor||Y(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||q(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Y(this.lineColor);let e=`#ECECFE`,t=`#E9E9F1`,n=J(e,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||K(e,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||e,this.cScale1=this.cScale1||t,this.cScale2=this.cScale2||n,this.cScale3=this.cScale3||J(e,{h:30}),this.cScale4=this.cScale4||J(e,{h:60}),this.cScale5=this.cScale5||J(e,{h:90}),this.cScale6=this.cScale6||J(e,{h:120}),this.cScale7=this.cScale7||J(e,{h:150}),this.cScale8=this.cScale8||J(e,{h:210,l:150}),this.cScale9=this.cScale9||J(e,{h:270}),this.cScale10=this.cScale10||J(e,{h:300}),this.cScale11=this.cScale11||J(e,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let r=this.darkMode?-4:-1;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||J(this.mainBkg,{h:180,s:-15,l:r*(5+e*3)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||J(this.mainBkg,{h:180,s:-15,l:r*(8+e*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||J(e,{h:64}),this.fillType3=this.fillType3||J(t,{h:64}),this.fillType4=this.fillType4||J(e,{h:-64}),this.fillType5=this.fillType5||J(t,{h:-64}),this.fillType6=this.fillType6||J(e,{h:128}),this.fillType7=this.fillType7||J(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||n,this.pie4=this.pie4||J(e,{l:-10}),this.pie5=this.pie5||J(t,{l:-10}),this.pie6=this.pie6||J(n,{l:-10}),this.pie7=this.pie7||J(e,{h:60,l:-10}),this.pie8=this.pie8||J(e,{h:-60,l:-10}),this.pie9=this.pie9||J(e,{h:120,l:0}),this.pie10=this.pie10||J(e,{h:60,l:-20}),this.pie11=this.pie11||J(e,{h:-60,l:-20}),this.pie12=this.pie12||J(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||J(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||n,this.git3=this.git3||J(e,{h:-30}),this.git4=this.git4||J(e,{h:-60}),this.git5=this.git5||J(e,{h:-90}),this.git6=this.git6||J(e,{h:60}),this.git7=this.git7||J(e,{h:120}),this.darkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},lI=W(e=>{let t=new cI;return t.calculate(e),t},`getThemeVariables`),uI=class{static{W(this,`Theme`)}constructor(){this.background=`#333`,this.primaryColor=`#1f2020`,this.secondaryColor=K(this.primaryColor,16),this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=Y(this.background),this.secondaryBorderColor=ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ZF(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.mainBkg=`#2a2020`,this.secondBkg=`calculated`,this.mainContrastColor=`lightgrey`,this.darkTextColor=K(Y(`#323D47`),10),this.border1=`#ccc`,this.border2=gP(255,255,255,.25),this.arrowheadColor=Y(this.background),this.fontFamily=`arial, sans-serif`,this.fontSize=`14px`,this.labelBackground=`#181818`,this.textColor=`#ccc`,this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#333`,this.THEME_COLOR_LIMIT=12,this.fontFamily=`arial, sans-serif`,this.fontSize=`14px`,this.useGradient=!0,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))`,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.noteFontWeight=`normal`,this.fontWeight=`normal`}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#333`),this.secondaryColor=this.secondaryColor||J(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||J(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ZF(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ZF(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#333`,this.secondaryTextColor=this.secondaryTextColor||Y(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Y(this.tertiaryColor),this.lineColor=this.lineColor||Y(this.background),this.arrowheadColor=this.arrowheadColor||Y(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||q(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Y(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||K(this.primaryColor,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this[`surface`+t]=this[`surface`+t]||J(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this[`surfacePeer`+t]=this[`surfacePeer`+t]||J(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||J(this.primaryColor,{h:64}),this.fillType3=this.fillType3||J(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||J(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||J(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||J(this.primaryColor,{h:128}),this.fillType7=this.fillType7||J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||J(this.primaryColor,{l:-10}),this.pie5=this.pie5||J(this.secondaryColor,{l:-10}),this.pie6=this.pie6||J(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||J(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||`#0b0000`,this.git1=this.git1||`#4d1037`,this.git2=this.git2||`#3f5258`,this.git3=this.git3||`#4f2f1b`,this.git4=this.git4||`#6e0a0a`,this.git5=this.git5||`#3b0048`,this.git6=this.git6||`#995a01`,this.git7=this.git7||`#154706`,this.gitDarkMode=!0,this.gitDarkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},dI=W(e=>{let t=new uI;return t.calculate(e),t},`getThemeVariables`),fI=class{static{W(this,`Theme`)}constructor(){this.background=`#ffffff`,this.primaryColor=`#cccccc`,this.mainBkg=`#ffffff`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#28253D`,this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ZF(`#28253D`,this.darkMode),this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#28253D`,this.stateBorder=`#28253D`,this.useGradient=!1,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`url(#drop-shadow)`,this.nodeShadow=!0,this.tertiaryColor=`#ffffff`,this.clusterBkg=`#F9F9FB`,this.clusterBorder=`#BDBCCC`,this.noteBorderColor=`#FACC15`,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.actorBorder=`#28253D`,this.filterColor=`#000000`}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#28253D`),this.secondaryColor=this.secondaryColor||J(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||J(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ZF(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ZF(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#FEF9C3`,this.noteTextColor=this.noteTextColor||`#28253D`,this.secondaryTextColor=this.secondaryTextColor||Y(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Y(this.tertiaryColor),this.lineColor=this.lineColor||Y(this.background),this.arrowheadColor=this.arrowheadColor||Y(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||q(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Y(this.lineColor);let e=`#ECECFE`,t=`#E9E9F1`,n=J(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||K(e,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground=`#F9F9FB`,this.altBackground=`#F9F9FB`,this.stateEdgeLabelBackground=`#FFFFFF`,this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=this.mainBkg;if(this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let r=this.darkMode?-4:-1;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||J(this.mainBkg,{h:180,s:-15,l:r*(5+e*3)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||J(this.mainBkg,{h:180,s:-15,l:r*(8+e*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||J(e,{h:64}),this.fillType3=this.fillType3||J(t,{h:64}),this.fillType4=this.fillType4||J(e,{h:-64}),this.fillType5=this.fillType5||J(t,{h:-64}),this.fillType6=this.fillType6||J(e,{h:128}),this.fillType7=this.fillType7||J(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||n,this.pie4=this.pie4||J(e,{l:-10}),this.pie5=this.pie5||J(t,{l:-10}),this.pie6=this.pie6||J(n,{l:-10}),this.pie7=this.pie7||J(e,{h:60,l:-10}),this.pie8=this.pie8||J(e,{h:-60,l:-10}),this.pie9=this.pie9||J(e,{h:120,l:0}),this.pie10=this.pie10||J(e,{h:60,l:-20}),this.pie11=this.pie11||J(e,{h:-60,l:-20}),this.pie12=this.pie12||J(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||J(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground=`#FFFFFF`,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||n,this.git3=this.git3||J(e,{h:-30}),this.git4=this.git4||J(e,{h:-60}),this.git5=this.git5||J(e,{h:-90}),this.git6=this.git6||J(e,{h:60}),this.git7=this.git7||J(e,{h:120}),this.darkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.commitLineColor=this.commitLineColor??`#BDBCCC`,this.erEdgeLabelBackground=`#FFFFFF`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},pI=W(e=>{let t=new fI;return t.calculate(e),t},`getThemeVariables`),mI=class{static{W(this,`Theme`)}constructor(){this.background=`#333`,this.primaryColor=`#1f2020`,this.secondaryColor=K(this.primaryColor,16),this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=Y(this.background),this.secondaryBorderColor=ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ZF(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.mainBkg=`#111113`,this.secondBkg=`calculated`,this.mainContrastColor=`lightgrey`,this.darkTextColor=K(Y(`#323D47`),10),this.border1=`#ccc`,this.border2=gP(255,255,255,.25),this.arrowheadColor=Y(this.background),this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.labelBackground=`#111113`,this.textColor=`#ccc`,this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??`#FEF9C3`,this.noteTextColor=this.noteTextColor??`#28253D`,this.THEME_COLOR_LIMIT=12,this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#FFFFFF`,this.stateBorder=`#FFFFFF`,this.useGradient=!1,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`url(#drop-shadow)`,this.nodeShadow=!0,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.clusterBkg=`#1E1A2E`,this.clusterBorder=`#BDBCCC`,this.noteBorderColor=`#FACC15`,this.noteFontWeight=600,this.filterColor=`#FFFFFF`}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#FFFFFF`),this.secondaryColor=this.secondaryColor||J(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||J(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ZF(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ZF(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#FFFFFF`,this.secondaryTextColor=this.secondaryTextColor||Y(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Y(this.tertiaryColor),this.lineColor=this.lineColor||Y(this.background),this.arrowheadColor=this.arrowheadColor||Y(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=`#FFFFFF`,this.signalColor=`#FFFFFF`,this.labelBoxBorderColor=`#BDBCCC`,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||q(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Y(this.lineColor),this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||K(this.primaryColor,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground=`#16141F`,this.altBackground=`#16141F`,this.compositeTitleBackground=`#16141F`,this.stateEdgeLabelBackground=`#16141F`,this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||J(this.primaryColor,{h:30}),this.cScale4=this.cScale4||J(this.primaryColor,{h:60}),this.cScale5=this.cScale5||J(this.primaryColor,{h:90}),this.cScale6=this.cScale6||J(this.primaryColor,{h:120}),this.cScale7=this.cScale7||J(this.primaryColor,{h:150}),this.cScale8=this.cScale8||J(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||J(this.primaryColor,{h:270}),this.cScale10=this.cScale10||J(this.primaryColor,{h:300}),this.cScale11=this.cScale11||J(this.primaryColor,{h:330}),this.darkMode)for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],75);else for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScale`+e]=q(this[`cScale`+e],25);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this[`surface`+t]=this[`surface`+t]||J(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this[`surfacePeer`+t]=this[`surfacePeer`+t]||J(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||J(this.primaryColor,{h:64}),this.fillType3=this.fillType3||J(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||J(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||J(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||J(this.primaryColor,{h:128}),this.fillType7=this.fillType7||J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||J(this.primaryColor,{l:-10}),this.pie5=this.pie5||J(this.secondaryColor,{l:-10}),this.pie6=this.pie6||J(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||J(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground=`#16141F`,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||J(this.primaryColor,{h:-30}),this.git4=this.git4||J(this.primaryColor,{h:-60}),this.git5=this.git5||J(this.primaryColor,{h:-90}),this.git6=this.git6||J(this.primaryColor,{h:60}),this.git7=this.git7||J(this.primaryColor,{h:120}),this.darkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.commitLineColor=this.commitLineColor??`#BDBCCC`,this.erEdgeLabelBackground=`#16141F`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},hI=W(e=>{let t=new mI;return t.calculate(e),t},`getThemeVariables`),gI=class{static{W(this,`Theme`)}constructor(){this.background=`#ffffff`,this.primaryColor=`#cccccc`,this.mainBkg=`#ffffff`,this.noteBkgColor=`#fff5ad`,this.noteTextColor=`#28253D`,this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=ZF(this.primaryColor,this.darkMode),this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#28253D`,this.stateBorder=`#28253D`,this.useGradient=!1,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`url(#drop-shadow)`,this.nodeShadow=!0,this.tertiaryColor=`#ffffff`,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.actorBorder=`#28253D`,this.noteBorderColor=`#FACC15`,this.noteFontWeight=600,this.borderColorArray=[`#E879F9`,`#2DD4BF`,`#FB923C`,`#22D3EE`,`#4ADE80`,`#A78BFA`,`#F87171`,`#FACC15`,`#818CF8`,`#A3E635 `,`#38BDF8`,`#FB7185`],this.bkgColorArray=[`#FDF4FF`,`#F0FDFA`,`#FFF7ED`,`#ECFEFF`,`#F0FDF4`,`#F5F3FF`,`#FEF2F2`,`#FEFCE8`,`#EEF2FF`,`#F7FEE7`,`#F0F9FF`,`#FFF1F2`],this.filterColor=`#000000`}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#28253D`),this.secondaryColor=this.secondaryColor||J(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||J(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ZF(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ZF(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#28253D`,this.secondaryTextColor=this.secondaryTextColor||Y(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Y(this.tertiaryColor),this.lineColor=this.lineColor||Y(this.background),this.arrowheadColor=this.arrowheadColor||Y(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||q(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Y(this.lineColor);let e=`#ECECFE`,t=`#E9E9F1`,n=J(e,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||n,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||t,this.sectionBkgColor2=this.sectionBkgColor2||e,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||e,this.activeTaskBorderColor=this.activeTaskBorderColor||e,this.activeTaskBkgColor=this.activeTaskBkgColor||K(e,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||`#f4a8ff`,this.cScale1=this.cScale1||`#46ecd5`,this.cScale2=this.cScale2||`#ffb86a`,this.cScale3=this.cScale3||`#dab2ff`,this.cScale4=this.cScale4||`#7bf1a8`,this.cScale5=this.cScale5||`#c4b4ff`,this.cScale6=this.cScale6||`#ffa2a2`,this.cScale7=this.cScale7||`#ffdf20`,this.cScale8=this.cScale8||`#a3b3ff`,this.cScale9=this.cScale9||`#bbf451`,this.cScale10=this.cScale10||`#74d4ff`,this.cScale11=this.cScale11||`#ffa1ad`;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=this[`cScaleLabel`+e]||this.scaleLabelColor;let r=this.darkMode?-4:-1;for(let e=0;e<5;e++)this[`surface`+e]=this[`surface`+e]||J(this.mainBkg,{h:180,s:-15,l:r*(5+e*3)}),this[`surfacePeer`+e]=this[`surfacePeer`+e]||J(this.mainBkg,{h:180,s:-15,l:r*(8+e*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||e,this.fillType1=this.fillType1||t,this.fillType2=this.fillType2||J(e,{h:64}),this.fillType3=this.fillType3||J(t,{h:64}),this.fillType4=this.fillType4||J(e,{h:-64}),this.fillType5=this.fillType5||J(t,{h:-64}),this.fillType6=this.fillType6||J(e,{h:128}),this.fillType7=this.fillType7||J(t,{h:128}),this.pie1=this.pie1||e,this.pie2=this.pie2||t,this.pie3=this.pie3||n,this.pie4=this.pie4||J(e,{l:-10}),this.pie5=this.pie5||J(t,{l:-10}),this.pie6=this.pie6||J(n,{l:-10}),this.pie7=this.pie7||J(e,{h:60,l:-10}),this.pie8=this.pie8||J(e,{h:-60,l:-10}),this.pie9=this.pie9||J(e,{h:120,l:0}),this.pie10=this.pie10||J(e,{h:60,l:-20}),this.pie11=this.pie11||J(e,{h:-60,l:-20}),this.pie12=this.pie12||J(e,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||e,this.quadrant2Fill=this.quadrant2Fill||J(e,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(e,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(e,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||e,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||e,this.git1=this.git1||t,this.git2=this.git2||n,this.git3=this.git3||J(e,{h:-30}),this.git4=this.git4||J(e,{h:-60}),this.git5=this.git5||J(e,{h:-90}),this.git6=this.git6||J(e,{h:60}),this.git7=this.git7||J(e,{h:120}),this.darkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??`#BDBCCC`,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.fontWeight=600,this.erEdgeLabelBackground=`#FFFFFF`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},_I=W(e=>{let t=new gI;return t.calculate(e),t},`getThemeVariables`),vI=class{static{W(this,`Theme`)}constructor(){this.background=`#333`,this.primaryColor=`#1f2020`,this.secondaryColor=K(this.primaryColor,16),this.tertiaryColor=J(this.primaryColor,{h:-160}),this.primaryBorderColor=Y(this.background),this.secondaryBorderColor=ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=ZF(this.tertiaryColor,this.darkMode),this.primaryTextColor=Y(this.primaryColor),this.secondaryTextColor=Y(this.secondaryColor),this.tertiaryTextColor=Y(this.tertiaryColor),this.mainBkg=`#111113`,this.secondBkg=`calculated`,this.mainContrastColor=`lightgrey`,this.darkTextColor=K(Y(`#323D47`),10),this.border1=`#ccc`,this.border2=gP(255,255,255,.25),this.arrowheadColor=Y(this.background),this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.labelBackground=`#111113`,this.textColor=`#ccc`,this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??`#FEF9C3`,this.noteTextColor=this.noteTextColor??`#28253D`,this.THEME_COLOR_LIMIT=12,this.fontFamily=`"Recursive Variable", arial, sans-serif`,this.fontSize=`14px`,this.nodeBorder=`#FFFFFF`,this.stateBorder=`#FFFFFF`,this.useGradient=!1,this.gradientStart=`#0042eb`,this.gradientStop=`#eb0042`,this.dropShadow=`url(#drop-shadow)`,this.nodeShadow=!0,this.archEdgeColor=`calculated`,this.archEdgeArrowColor=`calculated`,this.archEdgeWidth=`3`,this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth=`2px`,this.clusterBkg=`#1E1A2E`,this.clusterBorder=`#BDBCCC`,this.noteBorderColor=`#FACC15`,this.noteFontWeight=600,this.borderColorArray=[`#E879F9`,`#2DD4BF`,`#FB923C`,`#22D3EE`,`#4ADE80`,`#A78BFA`,`#F87171`,`#FACC15`,`#818CF8`,`#A3E635 `,`#38BDF8`,`#FB7185`],this.bkgColorArray=[],this.filterColor=`#FFFFFF`}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?`#eee`:`#FFFFFF`),this.secondaryColor=this.secondaryColor||J(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||J(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||ZF(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||ZF(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||ZF(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||ZF(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||`#fff5ad`,this.noteTextColor=this.noteTextColor||`#FFFFFF`,this.secondaryTextColor=this.secondaryTextColor||Y(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||Y(this.tertiaryColor),this.lineColor=this.lineColor||Y(this.background),this.arrowheadColor=this.arrowheadColor||Y(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=`#FFFFFF`,this.signalColor=`#FFFFFF`,this.labelBoxBorderColor=`#BDBCCC`,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||q(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||Y(this.lineColor),this.rootLabelColor=`#FFFFFF`,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||`white`,this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||`#eeeeee`,this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||K(this.primaryColor,23),this.gridColor=this.gridColor||`lightgrey`,this.doneTaskBkgColor=this.doneTaskBkgColor||`lightgrey`,this.doneTaskBorderColor=this.doneTaskBorderColor||`grey`,this.critBorderColor=this.critBorderColor||`#ff8888`,this.critBkgColor=this.critBkgColor||`red`,this.todayLineColor=this.todayLineColor||`red`,this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||`#003163`,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||`#f0f0f0`,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||`#f4a8ff`,this.cScale1=this.cScale1||`#46ecd5`,this.cScale2=this.cScale2||`#ffb86a`,this.cScale3=this.cScale3||`#dab2ff`,this.cScale4=this.cScale4||`#7bf1a8`,this.cScale5=this.cScale5||`#c4b4ff`,this.cScale6=this.cScale6||`#ffa2a2`,this.cScale7=this.cScale7||`#ffdf20`,this.cScale8=this.cScale8||`#a3b3ff`,this.cScale9=this.cScale9||`#bbf451`,this.cScale10=this.cScale10||`#74d4ff`,this.cScale11=this.cScale11||`#ffa1ad`;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleInv`+e]=this[`cScaleInv`+e]||Y(this[`cScale`+e]);for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this.darkMode?this[`cScalePeer`+e]=this[`cScalePeer`+e]||K(this[`cScale`+e],10):this[`cScalePeer`+e]=this[`cScalePeer`+e]||q(this[`cScale`+e],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let e=0;e<this.THEME_COLOR_LIMIT;e++)this[`cScaleLabel`+e]=q(this[`cScale`+e],75);let e=this.darkMode?-4:-1;for(let t=0;t<5;t++)this[`surface`+t]=this[`surface`+t]||J(this.mainBkg,{h:180,s:-15,l:e*(5+t*3)}),this[`surfacePeer`+t]=this[`surfacePeer`+t]||J(this.mainBkg,{h:180,s:-15,l:e*(8+t*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||J(this.primaryColor,{h:64}),this.fillType3=this.fillType3||J(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||J(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||J(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||J(this.primaryColor,{h:128}),this.fillType7=this.fillType7||J(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||J(this.primaryColor,{l:-10}),this.pie5=this.pie5||J(this.secondaryColor,{l:-10}),this.pie6=this.pie6||J(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||J(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||J(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||J(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||J(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||J(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||J(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||`25px`,this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||`17px`,this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||`17px`,this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||`black`,this.pieStrokeWidth=this.pieStrokeWidth||`2px`,this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||`2px`,this.pieOuterStrokeColor=this.pieOuterStrokeColor||`black`,this.pieOpacity=this.pieOpacity||`0.7`,this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||J(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||J(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||J(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||J(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||J(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||J(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||yP(this.quadrant1Fill)?K(this.quadrant1Fill):q(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||`#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0`},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||`1`,this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?q(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||J(this.primaryColor,{h:-30}),this.git4=this.git4||J(this.primaryColor,{h:-60}),this.git5=this.git5||J(this.primaryColor,{h:-90}),this.git6=this.git6||J(this.primaryColor,{h:60}),this.git7=this.git7||J(this.primaryColor,{h:120}),this.darkMode?(this.git0=K(this.git0,25),this.git1=K(this.git1,25),this.git2=K(this.git2,25),this.git3=K(this.git3,25),this.git4=K(this.git4,25),this.git5=K(this.git5,25),this.git6=K(this.git6,25),this.git7=K(this.git7,25)):(this.git0=q(this.git0,25),this.git1=q(this.git1,25),this.git2=q(this.git2,25),this.git3=q(this.git3,25),this.git4=q(this.git4,25),this.git5=q(this.git5,25),this.git6=q(this.git6,25),this.git7=q(this.git7,25)),this.gitInv0=this.gitInv0||Y(this.git0),this.gitInv1=this.gitInv1||Y(this.git1),this.gitInv2=this.gitInv2||Y(this.git2),this.gitInv3=this.gitInv3||Y(this.git3),this.gitInv4=this.gitInv4||Y(this.git4),this.gitInv5=this.gitInv5||Y(this.git5),this.gitInv6=this.gitInv6||Y(this.git6),this.gitInv7=this.gitInv7||Y(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?`black`:this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||`10px`,this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||`10px`,this.commitLineColor=this.commitLineColor??`#BDBCCC`,this.fontWeight=600,this.erEdgeLabelBackground=`#16141F`,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||YF,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||XF}calculate(e){if(typeof e!=`object`){this.updateColors();return}let t=Object.keys(e);t.forEach(t=>{this[t]=e[t]}),this.updateColors(),t.forEach(t=>{this[t]=e[t]})}},yI={base:{getThemeVariables:$F},dark:{getThemeVariables:tI},default:{getThemeVariables:rI},forest:{getThemeVariables:aI},neutral:{getThemeVariables:sI},neo:{getThemeVariables:lI},"neo-dark":{getThemeVariables:dI},redux:{getThemeVariables:pI},"redux-dark":{getThemeVariables:hI},"redux-color":{getThemeVariables:_I},"redux-dark-color":{getThemeVariables:W(e=>{let t=new vI;return t.calculate(e),t},`getThemeVariables`)}},bI={flowchart:{useMaxWidth:!0,titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:`basis`,padding:15,defaultRenderer:`dagre-wrapper`,wrappingWidth:200,inheritDir:!1},sequence:{useMaxWidth:!0,hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:`center`,mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:`"Open Sans", sans-serif`,actorFontWeight:400,noteFontSize:14,noteFontFamily:`"trebuchet ms", verdana, arial, sans-serif`,noteFontWeight:400,noteAlign:`center`,messageFontSize:16,messageFontFamily:`"trebuchet ms", verdana, arial, sans-serif`,messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:`%Y-%m-%d`,topAxis:!1,displayMode:``,weekday:`sunday`},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:`center`,bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:`"Open Sans", sans-serif`,taskMargin:50,activationWidth:10,textPlacement:`fo`,actorColours:[`#8FBC8F`,`#7CFC00`,`#00FFFF`,`#20B2AA`,`#B0E0E6`,`#FFFFE0`],sectionFills:[`#191970`,`#8B008B`,`#4B0082`,`#2F4F4F`,`#800000`,`#8B4513`,`#00008B`],sectionColours:[`#fff`],titleColor:``,titleFontFamily:`"trebuchet ms", verdana, arial, sans-serif`,titleFontSize:`4ex`},class:{useMaxWidth:!0,titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,defaultRenderer:`dagre-wrapper`,htmlLabels:!1,hideEmptyMembersBox:!1},state:{useMaxWidth:!0,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:`20`,compositTitleSize:35,radius:5,defaultRenderer:`dagre-wrapper`},er:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:20,layoutDirection:`TB`,minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:`gray`,fill:`honeydew`,fontSize:12},pie:{useMaxWidth:!0,textPosition:.75},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:`top`,yAxisPosition:`left`,quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,xAxis:{$ref:`#/$defs/XYChartAxisConfig`,showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},yAxis:{$ref:`#/$defs/XYChartAxisConfig`,showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2},chartOrientation:`vertical`,plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,rect_fill:`#f9f9f9`,text_color:`#333`,rect_border_size:`0.5px`,rect_border_color:`#bbb`,rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,padding:10,maxNodeWidth:200,layoutAlgorithm:`cose-bilkent`},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:``},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:`center`,bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:`"Open Sans", sans-serif`,taskMargin:50,activationWidth:10,textPlacement:`fo`,actorColours:[`#8FBC8F`,`#7CFC00`,`#00FFFF`,`#20B2AA`,`#B0E0E6`,`#FFFFE0`],sectionFills:[`#191970`,`#8B008B`,`#4B0082`,`#2F4F4F`,`#800000`,`#8B4513`,`#00008B`],sectionColours:[`#fff`],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:`main`,mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:`"Open Sans", sans-serif`,personFontWeight:`normal`,external_personFontSize:14,external_personFontFamily:`"Open Sans", sans-serif`,external_personFontWeight:`normal`,systemFontSize:14,systemFontFamily:`"Open Sans", sans-serif`,systemFontWeight:`normal`,external_systemFontSize:14,external_systemFontFamily:`"Open Sans", sans-serif`,external_systemFontWeight:`normal`,system_dbFontSize:14,system_dbFontFamily:`"Open Sans", sans-serif`,system_dbFontWeight:`normal`,external_system_dbFontSize:14,external_system_dbFontFamily:`"Open Sans", sans-serif`,external_system_dbFontWeight:`normal`,system_queueFontSize:14,system_queueFontFamily:`"Open Sans", sans-serif`,system_queueFontWeight:`normal`,external_system_queueFontSize:14,external_system_queueFontFamily:`"Open Sans", sans-serif`,external_system_queueFontWeight:`normal`,boundaryFontSize:14,boundaryFontFamily:`"Open Sans", sans-serif`,boundaryFontWeight:`normal`,messageFontSize:12,messageFontFamily:`"Open Sans", sans-serif`,messageFontWeight:`normal`,containerFontSize:14,containerFontFamily:`"Open Sans", sans-serif`,containerFontWeight:`normal`,external_containerFontSize:14,external_containerFontFamily:`"Open Sans", sans-serif`,external_containerFontWeight:`normal`,container_dbFontSize:14,container_dbFontFamily:`"Open Sans", sans-serif`,container_dbFontWeight:`normal`,external_container_dbFontSize:14,external_container_dbFontFamily:`"Open Sans", sans-serif`,external_container_dbFontWeight:`normal`,container_queueFontSize:14,container_queueFontFamily:`"Open Sans", sans-serif`,container_queueFontWeight:`normal`,external_container_queueFontSize:14,external_container_queueFontFamily:`"Open Sans", sans-serif`,external_container_queueFontWeight:`normal`,componentFontSize:14,componentFontFamily:`"Open Sans", sans-serif`,componentFontWeight:`normal`,external_componentFontSize:14,external_componentFontFamily:`"Open Sans", sans-serif`,external_componentFontWeight:`normal`,component_dbFontSize:14,component_dbFontFamily:`"Open Sans", sans-serif`,component_dbFontWeight:`normal`,external_component_dbFontSize:14,external_component_dbFontFamily:`"Open Sans", sans-serif`,external_component_dbFontWeight:`normal`,component_queueFontSize:14,component_queueFontFamily:`"Open Sans", sans-serif`,component_queueFontWeight:`normal`,external_component_queueFontSize:14,external_component_queueFontFamily:`"Open Sans", sans-serif`,external_component_queueFontWeight:`normal`,wrap:!0,wrapPadding:10,person_bg_color:`#08427B`,person_border_color:`#073B6F`,external_person_bg_color:`#686868`,external_person_border_color:`#8A8A8A`,system_bg_color:`#1168BD`,system_border_color:`#3C7FC0`,system_db_bg_color:`#1168BD`,system_db_border_color:`#3C7FC0`,system_queue_bg_color:`#1168BD`,system_queue_border_color:`#3C7FC0`,external_system_bg_color:`#999999`,external_system_border_color:`#8A8A8A`,external_system_db_bg_color:`#999999`,external_system_db_border_color:`#8A8A8A`,external_system_queue_bg_color:`#999999`,external_system_queue_border_color:`#8A8A8A`,container_bg_color:`#438DD5`,container_border_color:`#3C7FC0`,container_db_bg_color:`#438DD5`,container_db_border_color:`#3C7FC0`,container_queue_bg_color:`#438DD5`,container_queue_border_color:`#3C7FC0`,external_container_bg_color:`#B3B3B3`,external_container_border_color:`#A6A6A6`,external_container_db_bg_color:`#B3B3B3`,external_container_db_border_color:`#A6A6A6`,external_container_queue_bg_color:`#B3B3B3`,external_container_queue_border_color:`#A6A6A6`,component_bg_color:`#85BBF0`,component_border_color:`#78A8D8`,component_db_bg_color:`#85BBF0`,component_db_border_color:`#78A8D8`,component_queue_bg_color:`#85BBF0`,component_queue_border_color:`#78A8D8`,external_component_bg_color:`#CCCCCC`,external_component_border_color:`#BFBFBF`,external_component_db_bg_color:`#CCCCCC`,external_component_db_border_color:`#BFBFBF`,external_component_queue_bg_color:`#CCCCCC`,external_component_queue_border_color:`#BFBFBF`},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:`gradient`,nodeAlignment:`justify`,showValues:!0,prefix:``,suffix:``},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},venn:{useMaxWidth:!0,width:800,height:450,padding:8,useDebugLayout:!1},theme:`default`,look:`classic`,handDrawnSeed:0,layout:`dagre`,maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:`"trebuchet ms", verdana, arial, sans-serif;`,logLevel:5,securityLevel:`strict`,startOnLoad:!0,arrowMarkerAbsolute:!1,secure:[`secure`,`securityLevel`,`startOnLoad`,`maxTextSize`,`suppressErrorRendering`,`maxEdges`],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},xI={...bI,deterministicIDSeed:void 0,elk:{mergeEdges:!1,nodePlacementStrategy:`BRANDES_KOEPF`,forceNodeModelOrder:!1,considerModelOrder:`NODES_AND_EDGES`},themeCSS:void 0,themeVariables:yI.default.getThemeVariables(),sequence:{...bI.sequence,messageFont:W(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},`messageFont`),noteFont:W(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},`noteFont`),actorFont:W(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},`actorFont`)},class:{hideEmptyMembersBox:!1},gantt:{...bI.gantt,tickInterval:void 0,useWidth:void 0},c4:{...bI.c4,useWidth:void 0,personFont:W(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},`personFont`),flowchart:{...bI.flowchart,inheritDir:!1},external_personFont:W(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},`external_personFont`),systemFont:W(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},`systemFont`),external_systemFont:W(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},`external_systemFont`),system_dbFont:W(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},`system_dbFont`),external_system_dbFont:W(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},`external_system_dbFont`),system_queueFont:W(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},`system_queueFont`),external_system_queueFont:W(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},`external_system_queueFont`),containerFont:W(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},`containerFont`),external_containerFont:W(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},`external_containerFont`),container_dbFont:W(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},`container_dbFont`),external_container_dbFont:W(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},`external_container_dbFont`),container_queueFont:W(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},`container_queueFont`),external_container_queueFont:W(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},`external_container_queueFont`),componentFont:W(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},`componentFont`),external_componentFont:W(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},`external_componentFont`),component_dbFont:W(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},`component_dbFont`),external_component_dbFont:W(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},`external_component_dbFont`),component_queueFont:W(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},`component_queueFont`),external_component_queueFont:W(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},`external_component_queueFont`),boundaryFont:W(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},`boundaryFont`),messageFont:W(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},`messageFont`)},pie:{...bI.pie,useWidth:984},xyChart:{...bI.xyChart,useWidth:void 0},requirement:{...bI.requirement,useWidth:void 0},packet:{...bI.packet},treeView:{...bI.treeView,useWidth:void 0},radar:{...bI.radar},ishikawa:{...bI.ishikawa},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:`,`},venn:{...bI.venn}},SI=W((e,t=``)=>Object.keys(e).reduce((n,r)=>Array.isArray(e[r])?n:typeof e[r]==`object`&&e[r]!==null?[...n,t+r,...SI(e[r],``)]:[...n,t+r],[]),`keyify`),CI=new Set(SI(xI,``)),wI=xI,TI=W(e=>{if(G.debug(`sanitizeDirective called with`,e),!(typeof e!=`object`||!e)){if(Array.isArray(e)){e.forEach(e=>TI(e));return}for(let t of Object.keys(e)){if(G.debug(`Checking key`,t),t.startsWith(`__`)||t.includes(`proto`)||t.includes(`constr`)||!CI.has(t)||e[t]==null){G.debug(`sanitize deleting key: `,t),delete e[t];continue}if(typeof e[t]==`object`){G.debug(`sanitizing object`,t),TI(e[t]);continue}for(let n of[`themeCSS`,`fontFamily`,`altFontFamily`])t.includes(n)&&(G.debug(`sanitizing css option`,t),e[t]=EI(e[t]))}if(e.themeVariables)for(let t of Object.keys(e.themeVariables)){let n=e.themeVariables[t];n?.match&&!n.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]=``)}G.debug(`After sanitization`,e)}},`sanitizeDirective`),EI=W(e=>{let t=0,n=0;for(let r of e){if(t<n)return`{ /* ERROR: Unbalanced CSS */ }`;r===`{`?t++:r===`}`&&n++}return t===n?e:`{ /* ERROR: Unbalanced CSS */ }`},`sanitizeCss`),DI=Object.freeze(wI),OI=W(e=>!(e===!1||[`false`,`null`,`0`].includes(String(e).trim().toLowerCase())),`evaluate`),kI=JF({},DI),AI,jI=[],MI=JF({},DI),NI=W((e,t)=>{let n=JF({},e),r={};for(let e of t)zI(e),r=JF(r,e);if(n=JF(n,r),r.theme&&r.theme in yI){let e=JF(JF({},AI).themeVariables||{},r.themeVariables);n.theme&&n.theme in yI&&(n.themeVariables=yI[n.theme].getThemeVariables(e))}return MI=n,GI(MI),MI},`updateCurrentConfig`),Rne=W(e=>(kI=JF({},DI),kI=JF(kI,e),e.theme&&yI[e.theme]&&(kI.themeVariables=yI[e.theme].getThemeVariables(e.themeVariables)),NI(kI,jI),kI),`setSiteConfig`),PI=W(e=>{AI=JF({},e)},`saveConfigFromInitialize`),FI=W(e=>(kI=JF(kI,e),NI(kI,jI),kI),`updateSiteConfig`),II=W(()=>JF({},kI),`getSiteConfig`),LI=W(e=>(GI(e),JF(MI,e),RI()),`setConfig`),RI=W(()=>JF({},MI),`getConfig`),zI=W(e=>{e&&([`secure`,...kI.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(G.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith(`__`)&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]==`string`&&(e[t].includes(`<`)||e[t].includes(`>`)||e[t].includes(`url(data:`))&&delete e[t],typeof e[t]==`object`&&zI(e[t])}))},`sanitize`),BI=W(e=>{TI(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),jI.push(e),NI(kI,jI)},`addDirective`),VI=W((e=kI)=>{jI=[],NI(e,jI)},`reset`),HI={LAZY_LOAD_DEPRECATED:`The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.`,FLOWCHART_HTML_LABELS_DEPRECATED:`flowchart.htmlLabels is deprecated. Please use global htmlLabels instead.`},UI={},WI=W(e=>{UI[e]||(G.warn(HI[e]),UI[e]=!0)},`issueWarning`),GI=W(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&WI(`LAZY_LOAD_DEPRECATED`)},`checkConfig`),KI=W(()=>{let e={};AI&&(e=JF(e,AI));for(let t of jI)e=JF(e,t);return e},`getUserDefinedConfig`),qI=W(e=>(e.flowchart?.htmlLabels!=null&&WI(`FLOWCHART_HTML_LABELS_DEPRECATED`),OI(e.htmlLabels??e.flowchart?.htmlLabels??!0)),`getEffectiveHtmlLabels`),JI=/<br\s*\/?>/gi,YI=W(e=>e?aL(e).replace(/\\n/g,`#br#`).split(`#br#`):[``],`getRows`),XI=(()=>{let e=!1;return()=>{e||=(ZI(),!0)}})();function ZI(){let e=`data-temp-href-target`;NF.addHook(`beforeSanitizeAttributes`,t=>{t.tagName===`A`&&t.hasAttribute(`target`)&&t.setAttribute(e,t.getAttribute(`target`)??``)}),NF.addHook(`afterSanitizeAttributes`,t=>{t.tagName===`A`&&t.hasAttribute(e)&&(t.setAttribute(`target`,t.getAttribute(e)??``),t.removeAttribute(e),t.getAttribute(`target`)===`_blank`&&t.setAttribute(`rel`,`noopener`))})}W(ZI,`setupDompurifyHooks`);var QI=W(e=>(XI(),NF.sanitize(e)),`removeScript`),$I=W((e,t)=>{if(qI(t)){let n=t.securityLevel;n===`antiscript`||n===`strict`||n===`sandbox`?e=QI(e):n!==`loose`&&(e=aL(e),e=e.replace(/</g,`&lt;`).replace(/>/g,`&gt;`),e=e.replace(/=/g,`&equals;`),e=iL(e))}return e},`sanitizeMore`),eL=W((e,t)=>e&&(e=t.dompurifyConfig?NF.sanitize($I(e,t),t.dompurifyConfig).toString():NF.sanitize($I(e,t),{FORBID_TAGS:[`style`]}).toString(),e),`sanitizeText`),tL=W((e,t)=>typeof e==`string`?eL(e,t):e.flat().map(e=>eL(e,t)),`sanitizeTextOrArray`),nL=W(e=>JI.test(e),`hasBreaks`),rL=W(e=>e.split(JI),`splitBreaks`),iL=W(e=>e.replace(/#br#/g,`<br/>`),`placeholderToBreak`),aL=W(e=>e.replace(JI,`#br#`),`breakToPlaceholder`),oL=W(e=>{let t=``;return e&&(t=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},`getUrl`),sL=W(function(...e){let t=e.filter(e=>!isNaN(e));return Math.max(...t)},`getMax`),cL=W(function(...e){let t=e.filter(e=>!isNaN(e));return Math.min(...t)},`getMin`),lL=W(function(e){let t=e.split(/(,)/),n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r===`,`&&e>0&&e+1<t.length){let i=t[e-1],a=t[e+1];dL(i,a)&&(r=i+`,`+a,e++,n.pop())}n.push(fL(r))}return n.join(``)},`parseGenericTypes`),uL=W((e,t)=>Math.max(0,e.split(t).length-1),`countOccurrence`),dL=W((e,t)=>{let n=uL(e,`~`),r=uL(t,`~`);return n===1&&r===1},`shouldCombineSets`),fL=W(e=>{let t=uL(e,`~`),n=!1;if(t<=1)return e;t%2!=0&&e.startsWith(`~`)&&(e=e.substring(1),n=!0);let r=[...e],i=r.indexOf(`~`),a=r.lastIndexOf(`~`);for(;i!==-1&&a!==-1&&i!==a;)r[i]=`<`,r[a]=`>`,i=r.indexOf(`~`),a=r.lastIndexOf(`~`);return n&&r.unshift(`~`),r.join(``)},`processSet`),pL=W(()=>window.MathMLElement!==void 0,`isMathMLSupported`),mL=/\$\$(.*)\$\$/g,hL=W(e=>(e.match(mL)?.length??0)>0,`hasKatex`),gL=W(async(e,t)=>{let n=document.createElement(`div`);n.innerHTML=await vL(e,t),n.id=`katex-temp`,n.style.visibility=`hidden`,n.style.position=`absolute`,n.style.top=`0`,document.querySelector(`body`)?.insertAdjacentElement(`beforeend`,n);let r={width:n.clientWidth,height:n.clientHeight};return n.remove(),r},`calculateMathMLDimensions`),_L=W(async(e,t)=>{if(!hL(e))return e;if(!(pL()||t.legacyMathML||t.forceLegacyMathML))return e.replace(mL,`MathML is unsupported in this environment.`);{let{default:n}=await LF(async()=>{let{default:e}=await import(`./katex-BAACGBI_.js`).then(e=>e.n);return{default:e}},__vite__mapDeps([0,1])),r=t.forceLegacyMathML||!pL()&&t.legacyMathML?`htmlAndMathml`:`mathml`;return e.split(JI).map(e=>hL(e)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${e}</div>`:`<div>${e}</div>`).join(``).replace(mL,(e,t)=>n.renderToString(t,{throwOnError:!0,displayMode:!0,output:r}).replace(/\n/g,` `).replace(/<annotation.*<\/annotation>/g,``))}return e.replace(mL,`Katex is not supported in @mermaid-js/tiny. Please use the full mermaid library.`)},`renderKatexUnsanitized`),vL=W(async(e,t)=>eL(await _L(e,t),t),`renderKatexSanitized`),yL={getRows:YI,sanitizeText:eL,sanitizeTextOrArray:tL,hasBreaks:nL,splitBreaks:rL,lineBreakRegex:JI,removeScript:QI,getUrl:oL,evaluate:OI,getMax:sL,getMin:cL},bL=W(function(e,t){for(let n of t)e.attr(n[0],n[1])},`d3Attrs`),xL=W(function(e,t,n){let r=new Map;return n?(r.set(`width`,`100%`),r.set(`style`,`max-width: ${t}px;`)):(r.set(`height`,e),r.set(`width`,t)),r},`calculateSvgSizeAttrs`),SL=W(function(e,t,n,r){bL(e,xL(t,n,r))},`configureSvgSize`),CL=W(function(e,t,n,r){let i=t.node().getBBox(),a=i.width,o=i.height;G.info(`SVG bounds: ${a}x${o}`,i);let s=0,c=0;G.info(`Graph bounds: ${s}x${c}`,e),s=a+n*2,c=o+n*2,G.info(`Calculated bounds: ${s}x${c}`),SL(t,c,s,r);let l=`${i.x-n} ${i.y-n} ${i.width+2*n} ${i.height+2*n}`;t.attr(`viewBox`,l)},`setupGraphViewbox`),wL={},TL=W((e,t,n,r)=>{let i=``;return e in wL&&wL[e]?i=wL[e]({...n,svgId:r}):G.warn(`No theme found for ${e}`),` & {
240
+ font-family: ${n.fontFamily};
241
+ font-size: ${n.fontSize};
242
+ fill: ${n.textColor}
243
+ }
244
+ @keyframes edge-animation-frame {
245
+ from {
246
+ stroke-dashoffset: 0;
247
+ }
248
+ }
249
+ @keyframes dash {
250
+ to {
251
+ stroke-dashoffset: 0;
252
+ }
253
+ }
254
+ & .edge-animation-slow {
255
+ stroke-dasharray: 9,5 !important;
256
+ stroke-dashoffset: 900;
257
+ animation: dash 50s linear infinite;
258
+ stroke-linecap: round;
259
+ }
260
+ & .edge-animation-fast {
261
+ stroke-dasharray: 9,5 !important;
262
+ stroke-dashoffset: 900;
263
+ animation: dash 20s linear infinite;
264
+ stroke-linecap: round;
265
+ }
266
+ /* Classes common for multiple diagrams */
267
+
268
+ & .error-icon {
269
+ fill: ${n.errorBkgColor};
270
+ }
271
+ & .error-text {
272
+ fill: ${n.errorTextColor};
273
+ stroke: ${n.errorTextColor};
274
+ }
275
+
276
+ & .edge-thickness-normal {
277
+ stroke-width: ${n.strokeWidth??1}px;
278
+ }
279
+ & .edge-thickness-thick {
280
+ stroke-width: 3.5px
281
+ }
282
+ & .edge-pattern-solid {
283
+ stroke-dasharray: 0;
284
+ }
285
+ & .edge-thickness-invisible {
286
+ stroke-width: 0;
287
+ fill: none;
288
+ }
289
+ & .edge-pattern-dashed{
290
+ stroke-dasharray: 3;
291
+ }
292
+ .edge-pattern-dotted {
293
+ stroke-dasharray: 2;
294
+ }
295
+
296
+ & .marker {
297
+ fill: ${n.lineColor};
298
+ stroke: ${n.lineColor};
299
+ }
300
+ & .marker.cross {
301
+ stroke: ${n.lineColor};
302
+ }
303
+
304
+ & svg {
305
+ font-family: ${n.fontFamily};
306
+ font-size: ${n.fontSize};
307
+ }
308
+ & p {
309
+ margin: 0
310
+ }
311
+
312
+ ${i}
313
+ .node .neo-node {
314
+ stroke: ${n.nodeBorder};
315
+ }
316
+
317
+ [data-look="neo"].node rect, [data-look="neo"].cluster rect, [data-look="neo"].node polygon {
318
+ stroke: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};
319
+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};
320
+ }
321
+
322
+
323
+ [data-look="neo"].node path {
324
+ stroke: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};
325
+ stroke-width: ${n.strokeWidth??1}px;
326
+ }
327
+
328
+ [data-look="neo"].node .outer-path {
329
+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};
330
+ }
331
+
332
+ [data-look="neo"].node .neo-line path {
333
+ stroke: ${n.nodeBorder};
334
+ filter: none;
335
+ }
336
+
337
+ [data-look="neo"].node circle{
338
+ stroke: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};
339
+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};
340
+ }
341
+
342
+ [data-look="neo"].node circle .state-start{
343
+ fill: #000000;
344
+ }
345
+
346
+ [data-look="neo"].icon-shape .icon {
347
+ fill: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};
348
+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};
349
+ }
350
+
351
+ [data-look="neo"].icon-shape .icon-neo path {
352
+ stroke: ${n.useGradient?`url(`+r+`-gradient)`:n.nodeBorder};
353
+ filter: ${n.dropShadow?n.dropShadow.replace(`url(#drop-shadow)`,`url(${r}-drop-shadow)`):`none`};
354
+ }
355
+
356
+ ${t}
357
+ `},`getStyles`),EL=W((e,t)=>{t!==void 0&&(wL[e]=t)},`addStylesForDiagram`),DL=TL,OL={};eP(OL,{clear:()=>NL,getAccDescription:()=>LL,getAccTitle:()=>FL,getDiagramTitle:()=>zL,setAccDescription:()=>IL,setAccTitle:()=>PL,setDiagramTitle:()=>RL});var kL=``,AL=``,jL=``,ML=W(e=>eL(e,RI()),`sanitizeText`),NL=W(()=>{kL=``,jL=``,AL=``},`clear`),PL=W(e=>{kL=ML(e).replace(/^\s+/g,``)},`setAccTitle`),FL=W(()=>kL,`getAccTitle`),IL=W(e=>{jL=ML(e).replace(/\n\s+/g,`
358
+ `)},`setAccDescription`),LL=W(()=>jL,`getAccDescription`),RL=W(e=>{AL=ML(e)},`setDiagramTitle`),zL=W(()=>AL,`getDiagramTitle`),BL=G,zne=nP,VL=RI,Bne=LI,Vne=DI,HL=W(e=>eL(e,VL()),`sanitizeText`),UL=CL,Hne=W(()=>OL,`getCommonDb`),WL={},GL=W((e,t,n)=>{WL[e]&&BL.warn(`Diagram with id ${e} already registered. Overwriting.`),WL[e]=t,n&&GF(e,n),EL(e,t.styles),t.injectUtils?.(BL,zne,VL,HL,UL,Hne(),()=>{})},`registerDiagram`),KL=W(e=>{if(e in WL)return WL[e];throw new Une(e)},`getDiagram`),Une=class extends Error{static{W(this,`DiagramNotFoundError`)}constructor(e){super(`Diagram ${e} not found.`)}},Wne={value:()=>{}};function qL(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new JL(n)}function JL(e){this._=e}function Gne(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}JL.prototype=qL.prototype={constructor:JL,on:function(e,t){var n=this._,r=Gne(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Kne(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=YL(n[i],e.name,t);else if(t==null)for(i in n)n[i]=YL(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new JL(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Kne(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function YL(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Wne,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var XL={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function ZL(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),XL.hasOwnProperty(t)?{space:XL[t],local:e}:e}function qne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Jne(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function QL(e){var t=ZL(e);return(t.local?Jne:qne)(t)}function Yne(){}function $L(e){return e==null?Yne:function(){return this.querySelector(e)}}function Xne(e){typeof e!=`function`&&(e=$L(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new mR(r,this._parents)}function Zne(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Qne(){return[]}function eR(e){return e==null?Qne:function(){return this.querySelectorAll(e)}}function $ne(e){return function(){return Zne(e.apply(this,arguments))}}function ere(e){e=typeof e==`function`?$ne(e):eR(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new mR(r,i)}function tR(e){return function(){return this.matches(e)}}function nR(e){return function(t){return t.matches(e)}}var tre=Array.prototype.find;function nre(e){return function(){return tre.call(this.children,e)}}function rre(){return this.firstElementChild}function ire(e){return this.select(e==null?rre:nre(typeof e==`function`?e:nR(e)))}var are=Array.prototype.filter;function ore(){return Array.from(this.children)}function sre(e){return function(){return are.call(this.children,e)}}function cre(e){return this.selectAll(e==null?ore:sre(typeof e==`function`?e:nR(e)))}function lre(e){typeof e!=`function`&&(e=tR(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new mR(r,this._parents)}function rR(e){return Array(e.length)}function ure(){return new mR(this._enter||this._groups.map(rR),this._parents)}function iR(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}iR.prototype={constructor:iR,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function dre(e){return function(){return e}}function fre(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new iR(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function pre(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new iR(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function mre(e){return e.__data__}function hre(e,t){if(!arguments.length)return Array.from(this,mre);var n=t?pre:fre,r=this._parents,i=this._groups;typeof e!=`function`&&(e=dre(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=gre(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new mR(o,r),o._enter=s,o._exit=c,o}function gre(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function _re(){return new mR(this._exit||this._groups.map(rR),this._parents)}function vre(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function yre(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new mR(s,this._parents)}function bre(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function xre(e){e||=Sre;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new mR(i,this._parents).order()}function Sre(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Cre(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wre(){return Array.from(this)}function Tre(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Ere(){let e=0;for(let t of this)++e;return e}function Dre(){return!this.node()}function Ore(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function kre(e){return function(){this.removeAttribute(e)}}function Are(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jre(e,t){return function(){this.setAttribute(e,t)}}function Mre(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Nre(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Pre(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Fre(e,t){var n=ZL(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Are:kre:typeof t==`function`?n.local?Pre:Nre:n.local?Mre:jre)(n,t))}function aR(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ire(e){return function(){this.style.removeProperty(e)}}function Lre(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Rre(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function zre(e,t,n){return arguments.length>1?this.each((t==null?Ire:typeof t==`function`?Rre:Lre)(e,t,n??``)):oR(this.node(),e)}function oR(e,t){return e.style.getPropertyValue(t)||aR(e).getComputedStyle(e,null).getPropertyValue(t)}function Bre(e){return function(){delete this[e]}}function Vre(e,t){return function(){this[e]=t}}function Hre(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Ure(e,t){return arguments.length>1?this.each((t==null?Bre:typeof t==`function`?Hre:Vre)(e,t)):this.node()[e]}function sR(e){return e.trim().split(/^|\s+/)}function cR(e){return e.classList||new lR(e)}function lR(e){this._node=e,this._names=sR(e.getAttribute(`class`)||``)}lR.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function uR(e,t){for(var n=cR(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function dR(e,t){for(var n=cR(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Wre(e){return function(){uR(this,e)}}function Gre(e){return function(){dR(this,e)}}function Kre(e,t){return function(){(t.apply(this,arguments)?uR:dR)(this,e)}}function qre(e,t){var n=sR(e+``);if(arguments.length<2){for(var r=cR(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Kre:t?Wre:Gre)(n,t))}function Jre(){this.textContent=``}function Yre(e){return function(){this.textContent=e}}function Xre(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Zre(e){return arguments.length?this.each(e==null?Jre:(typeof e==`function`?Xre:Yre)(e)):this.node().textContent}function Qre(){this.innerHTML=``}function $re(e){return function(){this.innerHTML=e}}function eie(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function tie(e){return arguments.length?this.each(e==null?Qre:(typeof e==`function`?eie:$re)(e)):this.node().innerHTML}function nie(){this.nextSibling&&this.parentNode.appendChild(this)}function rie(){return this.each(nie)}function iie(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function aie(){return this.each(iie)}function oie(e){var t=typeof e==`function`?e:QL(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sie(){return null}function cie(e,t){var n=typeof e==`function`?e:QL(e),r=t==null?sie:typeof t==`function`?t:$L(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function lie(){var e=this.parentNode;e&&e.removeChild(this)}function uie(){return this.each(lie)}function die(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fie(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pie(e){return this.select(e?fie:die)}function mie(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function hie(e){return function(t){e.call(this,t,this.__data__)}}function gie(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function _ie(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function vie(e,t,n){return function(){var r=this.__on,i,a=hie(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function yie(e,t,n){var r=gie(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?vie:_ie,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function fR(e,t,n){var r=aR(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function bie(e,t){return function(){return fR(this,e,t)}}function xie(e,t){return function(){return fR(this,e,t.apply(this,arguments))}}function Sie(e,t){return this.each((typeof t==`function`?xie:bie)(e,t))}function*Cie(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var pR=[null];function mR(e,t){this._groups=e,this._parents=t}function hR(){return new mR([[document.documentElement]],pR)}function wie(){return this}mR.prototype=hR.prototype={constructor:mR,select:Xne,selectAll:ere,selectChild:ire,selectChildren:cre,filter:lre,data:hre,enter:ure,exit:_re,join:vre,merge:yre,selection:wie,order:bre,sort:xre,call:Cre,nodes:wre,node:Tre,size:Ere,empty:Dre,each:Ore,attr:Fre,style:zre,property:Ure,classed:qre,text:Zre,html:tie,raise:rie,lower:aie,append:oie,insert:cie,remove:uie,clone:pie,datum:mie,on:yie,dispatch:Sie,[Symbol.iterator]:Cie};function gR(e){return typeof e==`string`?new mR([[document.querySelector(e)]],[document.documentElement]):new mR([[e]],pR)}function _R(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vR(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yR(){}var bR=.7,xR=1/bR,SR=`\\s*([+-]?\\d+)\\s*`,CR=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,wR=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Tie=/^#([0-9a-f]{3,8})$/,Eie=RegExp(`^rgb\\(${SR},${SR},${SR}\\)$`),Die=RegExp(`^rgb\\(${wR},${wR},${wR}\\)$`),Oie=RegExp(`^rgba\\(${SR},${SR},${SR},${CR}\\)$`),kie=RegExp(`^rgba\\(${wR},${wR},${wR},${CR}\\)$`),Aie=RegExp(`^hsl\\(${CR},${wR},${wR}\\)$`),jie=RegExp(`^hsla\\(${CR},${wR},${wR},${CR}\\)$`),TR={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};_R(yR,OR,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ER,formatHex:ER,formatHex8:Mie,formatHsl:Nie,formatRgb:DR,toString:DR});function ER(){return this.rgb().formatHex()}function Mie(){return this.rgb().formatHex8()}function Nie(){return BR(this).formatHsl()}function DR(){return this.rgb().formatRgb()}function OR(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Tie.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?kR(t):n===3?new NR(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?AR(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?AR(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Eie.exec(e))?new NR(t[1],t[2],t[3],1):(t=Die.exec(e))?new NR(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Oie.exec(e))?AR(t[1],t[2],t[3],t[4]):(t=kie.exec(e))?AR(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Aie.exec(e))?zR(t[1],t[2]/100,t[3]/100,1):(t=jie.exec(e))?zR(t[1],t[2]/100,t[3]/100,t[4]):TR.hasOwnProperty(e)?kR(TR[e]):e===`transparent`?new NR(NaN,NaN,NaN,0):null}function kR(e){return new NR(e>>16&255,e>>8&255,e&255,1)}function AR(e,t,n,r){return r<=0&&(e=t=n=NaN),new NR(e,t,n,r)}function jR(e){return e instanceof yR||(e=OR(e)),e?(e=e.rgb(),new NR(e.r,e.g,e.b,e.opacity)):new NR}function MR(e,t,n,r){return arguments.length===1?jR(e):new NR(e,t,n,r??1)}function NR(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}_R(NR,MR,vR(yR,{brighter(e){return e=e==null?xR:xR**+e,new NR(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bR:bR**+e,new NR(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new NR(LR(this.r),LR(this.g),LR(this.b),IR(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PR,formatHex:PR,formatHex8:Pie,formatRgb:FR,toString:FR}));function PR(){return`#${RR(this.r)}${RR(this.g)}${RR(this.b)}`}function Pie(){return`#${RR(this.r)}${RR(this.g)}${RR(this.b)}${RR((isNaN(this.opacity)?1:this.opacity)*255)}`}function FR(){let e=IR(this.opacity);return`${e===1?`rgb(`:`rgba(`}${LR(this.r)}, ${LR(this.g)}, ${LR(this.b)}${e===1?`)`:`, ${e})`}`}function IR(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function LR(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function RR(e){return e=LR(e),(e<16?`0`:``)+e.toString(16)}function zR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new VR(e,t,n,r)}function BR(e){if(e instanceof VR)return new VR(e.h,e.s,e.l,e.opacity);if(e instanceof yR||(e=OR(e)),!e)return new VR;if(e instanceof VR)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new VR(o,s,c,e.opacity)}function Fie(e,t,n,r){return arguments.length===1?BR(e):new VR(e,t,n,r??1)}function VR(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_R(VR,Fie,vR(yR,{brighter(e){return e=e==null?xR:xR**+e,new VR(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bR:bR**+e,new VR(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new NR(WR(e>=240?e-240:e+120,i,r),WR(e,i,r),WR(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new VR(HR(this.h),UR(this.s),UR(this.l),IR(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=IR(this.opacity);return`${e===1?`hsl(`:`hsla(`}${HR(this.h)}, ${UR(this.s)*100}%, ${UR(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function HR(e){return e=(e||0)%360,e<0?e+360:e}function UR(e){return Math.max(0,Math.min(1,e||0))}function WR(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var GR=e=>()=>e;function KR(e,t){return function(n){return e+n*t}}function Iie(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Lie(e,t){var n=t-e;return n?KR(e,n>180||n<-180?n-360*Math.round(n/360):n):GR(isNaN(e)?t:e)}function Rie(e){return(e=+e)==1?qR:function(t,n){return n-t?Iie(t,n,e):GR(isNaN(t)?n:t)}}function qR(e,t){var n=t-e;return n?KR(e,n):GR(isNaN(e)?t:e)}var JR=(function e(t){var n=Rie(t);function r(e,t){var r=n((e=MR(e)).r,(t=MR(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=qR(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function YR(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var XR=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ZR=new RegExp(XR.source,`g`);function zie(e){return function(){return e}}function Bie(e){return function(t){return e(t)+``}}function QR(e,t){var n=XR.lastIndex=ZR.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=XR.exec(e))&&(i=ZR.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:YR(r,i)})),n=ZR.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Bie(c[0].x):zie(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var $R=180/Math.PI,ez={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tz(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*$R,skewX:Math.atan(c)*$R,scaleX:o,scaleY:s}}var nz;function Vie(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?ez:tz(t.a,t.b,t.c,t.d,t.e,t.f)}function Hie(e){return e==null||(nz||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),nz.setAttribute(`transform`,e),!(e=nz.transform.baseVal.consolidate()))?ez:(e=e.matrix,tz(e.a,e.b,e.c,e.d,e.e,e.f))}function rz(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:YR(e,i)},{i:c-2,x:YR(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:YR(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:YR(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:YR(e,n)},{i:s-2,x:YR(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Uie=rz(Vie,`px, `,`px)`,`deg)`),Wie=rz(Hie,`, `,`)`,`)`),iz=0,az=0,oz=0,sz=1e3,cz,lz,uz=0,dz=0,fz=0,pz=typeof performance==`object`&&performance.now?performance:Date,mz=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function hz(){return dz||=(mz(gz),pz.now()+fz)}function gz(){dz=0}function _z(){this._call=this._time=this._next=null}_z.prototype=vz.prototype={constructor:_z,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?hz():+n)+(t==null?0:+t),!this._next&&lz!==this&&(lz?lz._next=this:cz=this,lz=this),this._call=e,this._time=n,Cz()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cz())}};function vz(e,t,n){var r=new _z;return r.restart(e,t,n),r}function yz(){hz(),++iz;for(var e=cz,t;e;)(t=dz-e._time)>=0&&e._call.call(void 0,t),e=e._next;--iz}function bz(){dz=(uz=pz.now())+fz,iz=az=0;try{yz()}finally{iz=0,Sz(),dz=0}}function xz(){var e=pz.now(),t=e-uz;t>sz&&(fz-=t,uz=e)}function Sz(){for(var e,t=cz,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:cz=n);lz=e,Cz(r)}function Cz(e){iz||(az&&=clearTimeout(az),e-dz>24?(e<1/0&&(az=setTimeout(bz,e-pz.now()-fz)),oz&&=clearInterval(oz)):(oz||=(uz=pz.now(),setInterval(xz,sz)),iz=1,mz(bz)))}function wz(e,t,n){var r=new _z;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Tz=qL(`start`,`end`,`cancel`,`interrupt`),Ez=[];function Dz(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;jz(e,n,{name:t,index:r,group:i,on:Tz,tween:Ez,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Oz(e,t){var n=Az(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function kz(e,t){var n=Az(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Az(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function jz(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=vz(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return wz(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(wz(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Mz(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Nz(e){return this.each(function(){Mz(this,e)})}function Pz(e,t){var n,r;return function(){var i=kz(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Fz(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=kz(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Iz(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Az(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Pz:Fz)(n,e,t))}function Lz(e,t,n){var r=e._id;return e.each(function(){var e=kz(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Az(e,r).value[t]}}function Rz(e,t){var n;return(typeof t==`number`?YR:t instanceof OR?JR:(n=OR(t))?(t=n,JR):QR)(e,t)}function zz(e){return function(){this.removeAttribute(e)}}function Bz(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vz(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function Hz(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function Uz(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Wz(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function Gz(e,t){var n=ZL(e),r=n===`transform`?Wie:Rz;return this.attrTween(e,typeof t==`function`?(n.local?Wz:Uz)(n,r,Lz(this,`attr.`+e,t)):t==null?(n.local?Bz:zz)(n):(n.local?Hz:Vz)(n,r,t))}function Kz(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function qz(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Jz(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&qz(e,i)),n}return i._value=t,i}function Yz(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Kz(e,i)),n}return i._value=t,i}function Xz(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=ZL(e);return this.tween(n,(r.local?Jz:Yz)(r,t))}function Zz(e,t){return function(){Oz(this,e).delay=+t.apply(this,arguments)}}function Qz(e,t){return t=+t,function(){Oz(this,e).delay=t}}function $z(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Zz:Qz)(t,e)):Az(this.node(),t).delay}function eB(e,t){return function(){kz(this,e).duration=+t.apply(this,arguments)}}function tB(e,t){return t=+t,function(){kz(this,e).duration=t}}function nB(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?eB:tB)(t,e)):Az(this.node(),t).duration}function rB(e,t){if(typeof t!=`function`)throw Error();return function(){kz(this,e).ease=t}}function iB(e){var t=this._id;return arguments.length?this.each(rB(t,e)):Az(this.node(),t).ease}function aB(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();kz(this,e).ease=n}}function oB(e){if(typeof e!=`function`)throw Error();return this.each(aB(this._id,e))}function sB(e){typeof e!=`function`&&(e=tR(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new IB(r,this._parents,this._name,this._id)}function cB(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new IB(o,this._parents,this._name,this._id)}function lB(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function uB(e,t,n){var r,i,a=lB(t)?Oz:kz;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function dB(e,t){var n=this._id;return arguments.length<2?Az(this.node(),n).on.on(e):this.each(uB(n,e,t))}function fB(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function pB(){return this.on(`end.remove`,fB(this._id))}function mB(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=$L(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Dz(l[f],t,n,f,l,Az(u,n)));return new IB(a,this._parents,t,n)}function hB(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=eR(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Az(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Dz(p,t,n,h,f,m);a.push(f),o.push(u)}return new IB(a,o,t,n)}var gB=hR.prototype.constructor;function _B(){return new gB(this._groups,this._parents)}function vB(e,t){var n,r,i;return function(){var a=oR(this,e),o=(this.style.removeProperty(e),oR(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function yB(e){return function(){this.style.removeProperty(e)}}function bB(e,t,n){var r,i=n+``,a;return function(){var o=oR(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function xB(e,t,n){var r,i,a;return function(){var o=oR(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),oR(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function SB(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=kz(this,e),l=c.on,u=c.value[a]==null?s||=yB(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function CB(e,t,n){var r=(e+=``)==`transform`?Uie:Rz;return t==null?this.styleTween(e,vB(e,r)).on(`end.style.`+e,yB(e)):typeof t==`function`?this.styleTween(e,xB(e,r,Lz(this,`style.`+e,t))).each(SB(this._id,e)):this.styleTween(e,bB(e,r,t),n).on(`end.style.`+e,null)}function wB(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function TB(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&wB(e,a,n)),r}return a._value=t,a}function EB(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,TB(e,t,n??``))}function DB(e){return function(){this.textContent=e}}function OB(e){return function(){var t=e(this);this.textContent=t??``}}function kB(e){return this.tween(`text`,typeof e==`function`?OB(Lz(this,`text`,e)):DB(e==null?``:e+``))}function AB(e){return function(t){this.textContent=e.call(this,t)}}function jB(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&AB(r)),t}return r._value=e,r}function MB(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,jB(e))}function NB(){for(var e=this._name,t=this._id,n=RB(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Az(c,t);Dz(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new IB(r,this._parents,e,n)}function PB(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=kz(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var FB=0;function IB(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function LB(e){return hR().transition(e)}function RB(){return++FB}var zB=hR.prototype;IB.prototype=LB.prototype={constructor:IB,select:mB,selectAll:hB,selectChild:zB.selectChild,selectChildren:zB.selectChildren,filter:sB,merge:cB,selection:_B,transition:NB,call:zB.call,nodes:zB.nodes,node:zB.node,size:zB.size,empty:zB.empty,each:zB.each,on:dB,attr:Gz,attrTween:Xz,style:CB,styleTween:EB,text:kB,textTween:MB,remove:pB,tween:Iz,delay:$z,duration:nB,ease:iB,easeVarying:oB,end:PB,[Symbol.iterator]:zB[Symbol.iterator]};function BB(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var VB={time:null,delay:0,duration:250,ease:BB};function HB(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function UB(e){var t,n;e instanceof IB?(t=e._id,e=e._name):(t=RB(),(n=VB).time=hz(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Dz(c,e,t,l,o,n||HB(c,t));return new IB(r,this._parents,e,t)}hR.prototype.interrupt=Nz,hR.prototype.transition=UB;var{abs:Gie,max:Kie,min:qie}=Math;[`w`,`e`].map(WB),[`n`,`s`].map(WB),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(WB);function WB(e){return{type:e}}var GB=Math.abs,KB=Math.atan2,qB=Math.cos,JB=Math.max,YB=Math.min,XB=Math.sin,ZB=Math.sqrt,QB=1e-12,$B=Math.PI,eV=$B/2,tV=2*$B;function nV(e){return e>1?0:e<-1?$B:Math.acos(e)}function rV(e){return e>=1?eV:e<=-1?-eV:Math.asin(e)}function iV(e){this._context=e}iV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function aV(e){return new iV(e)}function oV(e){return e[0]}function sV(e){return e[1]}function cV(e,t){var n=r(!0),o=null,s=aV,c=null,l=i(u);e=typeof e==`function`?e:e===void 0?oV:r(e),t=typeof t==`function`?t:t===void 0?sV:r(t);function u(r){var i,u=(r=a(r)).length,d,f=!1,p;for(o??(c=s(p=l())),i=0;i<=u;++i)!(i<u&&n(d=r[i],i,r))===f&&((f=!f)?c.lineStart():c.lineEnd()),f&&c.point(+e(d,i,r),+t(d,i,r));if(p)return c=null,p+``||null}return u.x=function(t){return arguments.length?(e=typeof t==`function`?t:r(+t),u):e},u.y=function(e){return arguments.length?(t=typeof e==`function`?e:r(+e),u):t},u.defined=function(e){return arguments.length?(n=typeof e==`function`?e:r(!!e),u):n},u.curve=function(e){return arguments.length?(s=e,o!=null&&(c=s(o)),u):s},u.context=function(e){return arguments.length?(e==null?o=c=null:c=s(o=e),u):o},u}var lV=class{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function uV(e){return new lV(e,!0)}function dV(e){return new lV(e,!1)}function fV(){}function pV(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function mV(e){this._context=e}mV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:pV(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:pV(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hV(e){return new mV(e)}function gV(e){this._context=e}gV.prototype={areaStart:fV,areaEnd:fV,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:pV(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _V(e){return new gV(e)}function vV(e){this._context=e}vV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:pV(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yV(e){return new vV(e)}function bV(e,t){this._basis=new mV(e),this._beta=t}bV.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var xV=(function e(t){function n(e){return t===1?new mV(e):new bV(e,t)}return n.beta=function(t){return e(+t)},n})(.85);function SV(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function CV(e,t){this._context=e,this._k=(1-t)/6}CV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:SV(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:SV(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var wV=(function e(t){function n(e){return new CV(e,t)}return n.tension=function(t){return e(+t)},n})(0);function TV(e,t){this._context=e,this._k=(1-t)/6}TV.prototype={areaStart:fV,areaEnd:fV,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:SV(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var EV=(function e(t){function n(e){return new TV(e,t)}return n.tension=function(t){return e(+t)},n})(0);function DV(e,t){this._context=e,this._k=(1-t)/6}DV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:SV(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var OV=(function e(t){function n(e){return new DV(e,t)}return n.tension=function(t){return e(+t)},n})(0);function kV(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}function AV(e,t){this._context=e,this._alpha=t}AV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:kV(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var jV=(function e(t){function n(e){return t?new AV(e,t):new CV(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function MV(e,t){this._context=e,this._alpha=t}MV.prototype={areaStart:fV,areaEnd:fV,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:kV(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var NV=(function e(t){function n(e){return t?new MV(e,t):new TV(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function PV(e,t){this._context=e,this._alpha=t}PV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:kV(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var FV=(function e(t){function n(e){return t?new PV(e,t):new DV(e,0)}return n.alpha=function(t){return e(+t)},n})(.5);function IV(e){this._context=e}IV.prototype={areaStart:fV,areaEnd:fV,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function LV(e){return new IV(e)}function RV(e){return e<0?-1:1}function zV(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(RV(a)+RV(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function BV(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function VV(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function HV(e){this._context=e}HV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:VV(this,this._t0,BV(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,VV(this,BV(this,n=zV(this,e,t)),n);break;default:VV(this,this._t0,n=zV(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function UV(e){this._context=new WV(e)}(UV.prototype=Object.create(HV.prototype)).point=function(e,t){HV.prototype.point.call(this,t,e)};function WV(e){this._context=e}WV.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function GV(e){return new HV(e)}function KV(e){return new UV(e)}function qV(e){this._context=e}qV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=JV(e),i=JV(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function JV(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function YV(e){return new qV(e)}function XV(e,t){this._context=e,this._t=t}XV.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}};function ZV(e){return new XV(e,.5)}function QV(e){return new XV(e,0)}function $V(e){return new XV(e,1)}function eH(e,t,n){this.k=e,this.x=t,this.y=n}eH.prototype={constructor:eH,scale:function(e){return e===1?this:new eH(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new eH(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var tH=new eH(1,0,0);nH.prototype=eH.prototype;function nH(e){for(;!e.__zoom;)if(!(e=e.parentNode))return tH;return e.__zoom}var rH=W(e=>{let{securityLevel:t}=VL(),n=gR(`body`);return t===`sandbox`&&(n=gR((gR(`#i${e}`).node()?.contentDocument??document).body)),n.select(`#${e}`)},`selectSvgElement`);function iH(e){return e==null}W(iH,`isNothing`);function aH(e){return typeof e==`object`&&!!e}W(aH,`isObject`);function oH(e){return Array.isArray(e)?e:iH(e)?[]:[e]}W(oH,`toArray`);function sH(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}W(sH,`extend`);function cH(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}W(cH,`repeat`);function lH(e){return e===0&&1/e==-1/0}W(lH,`isNegativeZero`);var uH={isNothing:iH,isObject:aH,toArray:oH,repeat:cH,isNegativeZero:lH,extend:sH};function dH(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
359
+
360
+ `+e.mark.snippet),r+` `+n):r}W(dH,`formatError`);function fH(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=dH(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}W(fH,`YAMLException$1`),fH.prototype=Object.create(Error.prototype),fH.prototype.constructor=fH,fH.prototype.toString=W(function(e){return this.name+`: `+dH(this,e)},`toString`);var pH=fH;function mH(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}W(mH,`getLine`);function hH(e,t){return uH.repeat(` `,t-e.length)+e}W(hH,`padStart`);function gH(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,o=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var s=``,c,l,u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)l=mH(e.buffer,r[o-c],i[o-c],e.position-(r[o]-r[o-c]),d),s=uH.repeat(` `,t.indent)+hH((e.line-c+1).toString(),u)+` | `+l.str+`
361
+ `+s;for(l=mH(e.buffer,r[o],i[o],e.position,d),s+=uH.repeat(` `,t.indent)+hH((e.line+1).toString(),u)+` | `+l.str+`
362
+ `,s+=uH.repeat(`-`,t.indent+u+3+l.pos)+`^
363
+ `,c=1;c<=t.linesAfter&&!(o+c>=i.length);c++)l=mH(e.buffer,r[o+c],i[o+c],e.position-(r[o]-r[o+c]),d),s+=uH.repeat(` `,t.indent)+hH((e.line+c+1).toString(),u)+` | `+l.str+`
364
+ `;return s.replace(/\n$/,``)}W(gH,`makeSnippet`);var _H=gH,vH=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],yH=[`scalar`,`sequence`,`mapping`];function bH(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}W(bH,`compileStyleAliases`);function xH(e,t){if(t||={},Object.keys(t).forEach(function(t){if(vH.indexOf(t)===-1)throw new pH(`Unknown option "`+t+`" is met in definition of "`+e+`" YAML type.`)}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=bH(t.styleAliases||null),yH.indexOf(this.kind)===-1)throw new pH(`Unknown kind "`+this.kind+`" is specified for "`+e+`" YAML type.`)}W(xH,`Type$1`);var SH=xH;function CH(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}W(CH,`compileList`);function wH(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(W(r,`collectType`),t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}W(wH,`compileMap`);function TH(e){return this.extend(e)}W(TH,`Schema$1`),TH.prototype.extend=W(function(e){var t=[],n=[];if(e instanceof SH)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new pH(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);t.forEach(function(e){if(!(e instanceof SH))throw new pH(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(e.loadKind&&e.loadKind!==`scalar`)throw new pH(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(e.multi)throw new pH(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),n.forEach(function(e){if(!(e instanceof SH))throw new pH(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});var r=Object.create(TH.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=CH(r,`implicit`),r.compiledExplicit=CH(r,`explicit`),r.compiledTypeMap=wH(r.compiledImplicit,r.compiledExplicit),r},`extend`);var EH=new TH({explicit:[new SH(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:W(function(e){return e===null?``:e},`construct`)}),new SH(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:W(function(e){return e===null?[]:e},`construct`)}),new SH(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:W(function(e){return e===null?{}:e},`construct`)})]});function DH(e){if(e===null)return!0;var t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}W(DH,`resolveYamlNull`);function OH(){return null}W(OH,`constructYamlNull`);function kH(e){return e===null}W(kH,`isNull`);var AH=new SH(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:DH,construct:OH,predicate:kH,represent:{canonical:W(function(){return`~`},`canonical`),lowercase:W(function(){return`null`},`lowercase`),uppercase:W(function(){return`NULL`},`uppercase`),camelcase:W(function(){return`Null`},`camelcase`),empty:W(function(){return``},`empty`)},defaultStyle:`lowercase`});function jH(e){if(e===null)return!1;var t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}W(jH,`resolveYamlBoolean`);function MH(e){return e===`true`||e===`True`||e===`TRUE`}W(MH,`constructYamlBoolean`);function NH(e){return Object.prototype.toString.call(e)===`[object Boolean]`}W(NH,`isBoolean`);var PH=new SH(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:jH,construct:MH,predicate:NH,represent:{lowercase:W(function(e){return e?`true`:`false`},`lowercase`),uppercase:W(function(e){return e?`TRUE`:`FALSE`},`uppercase`),camelcase:W(function(e){return e?`True`:`False`},`camelcase`)},defaultStyle:`lowercase`});function FH(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}W(FH,`isHexCode`);function IH(e){return 48<=e&&e<=55}W(IH,`isOctCode`);function LH(e){return 48<=e&&e<=57}W(LH,`isDecCode`);function RH(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i===`-`||i===`+`)&&(i=e[++n]),i===`0`){if(n+1===t)return!0;if(i=e[++n],i===`b`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(i!==`0`&&i!==`1`)return!1;r=!0}return r&&i!==`_`}if(i===`x`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!FH(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}if(i===`o`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!IH(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}}if(i===`_`)return!1;for(;n<t;n++)if(i=e[n],i!==`_`){if(!LH(e.charCodeAt(n)))return!1;r=!0}return!(!r||i===`_`)}W(RH,`resolveYamlInteger`);function zH(e){var t=e,n=1,r;if(t.indexOf(`_`)!==-1&&(t=t.replace(/_/g,``)),r=t[0],(r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}W(zH,`constructYamlInteger`);function BH(e){return Object.prototype.toString.call(e)===`[object Number]`&&e%1==0&&!uH.isNegativeZero(e)}W(BH,`isInteger`);var VH=new SH(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:RH,construct:zH,predicate:BH,represent:{binary:W(function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},`binary`),octal:W(function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},`octal`),decimal:W(function(e){return e.toString(10)},`decimal`),hexadecimal:W(function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)},`hexadecimal`)},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),HH=RegExp(`^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function UH(e){return!(e===null||!HH.test(e)||e[e.length-1]===`_`)}W(UH,`resolveYamlFloat`);function WH(e){var t=e.replace(/_/g,``).toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}W(WH,`constructYamlFloat`);var GH=/^[-+]?[0-9]+e/;function KH(e,t){var n;if(isNaN(e))switch(t){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(e===1/0)switch(t){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(e===-1/0)switch(t){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(uH.isNegativeZero(e))return`-0.0`;return n=e.toString(10),GH.test(n)?n.replace(`e`,`.e`):n}W(KH,`representYamlFloat`);function qH(e){return Object.prototype.toString.call(e)===`[object Number]`&&(e%1!=0||uH.isNegativeZero(e))}W(qH,`isFloat`);var JH=new SH(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:UH,construct:WH,predicate:qH,represent:KH,defaultStyle:`lowercase`}),YH=EH.extend({implicit:[AH,PH,VH,JH]}),XH=YH,ZH=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),QH=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function $H(e){return e===null?!1:ZH.exec(e)!==null||QH.exec(e)!==null}W($H,`resolveYamlTimestamp`);function eU(e){var t,n,r,i,a,o,s,c=0,l=null,u,d,f;if(t=ZH.exec(e),t===null&&(t=QH.exec(e)),t===null)throw Error(`Date resolve error`);if(n=+t[1],r=t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+=`0`;c=+c}return t[9]&&(u=+t[10],d=+(t[11]||0),l=(u*60+d)*6e4,t[9]===`-`&&(l=-l)),f=new Date(Date.UTC(n,r,i,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}W(eU,`constructYamlTimestamp`);function tU(e){return e.toISOString()}W(tU,`representYamlTimestamp`);var nU=new SH(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:$H,construct:eU,instanceOf:Date,represent:tU});function rU(e){return e===`<<`||e===null}W(rU,`resolveYamlMerge`);var iU=new SH(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:rU}),aU=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
365
+ \r`;function oU(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=aU;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8==0}W(oU,`resolveYamlBinary`);function sU(e){var t,n,r=e.replace(/[\r\n=]/g,``),i=r.length,a=aU,o=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}W(sU,`constructYamlBinary`);function cU(e){var t=``,n=0,r,i,a=e.length,o=aU;for(r=0;r<a;r++)r%3==0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}W(cU,`representYamlBinary`);function lU(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}W(lU,`isBinary`);var uU=new SH(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:oU,construct:sU,predicate:lU,represent:cU}),dU=Object.prototype.hasOwnProperty,fU=Object.prototype.toString;function pU(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,fU.call(i)!==`[object Object]`)return!1;for(a in i)if(dU.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}W(pU,`resolveYamlOmap`);function mU(e){return e===null?[]:e}W(mU,`constructYamlOmap`);var hU=new SH(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:pU,construct:mU}),gU=Object.prototype.toString;function _U(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],gU.call(r)!==`[object Object]`||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}W(_U,`resolveYamlPairs`);function vU(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}W(vU,`constructYamlPairs`);var yU=new SH(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:_U,construct:vU}),bU=Object.prototype.hasOwnProperty;function xU(e){if(e===null)return!0;var t,n=e;for(t in n)if(bU.call(n,t)&&n[t]!==null)return!1;return!0}W(xU,`resolveYamlSet`);function SU(e){return e===null?{}:e}W(SU,`constructYamlSet`);var CU=new SH(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:xU,construct:SU}),wU=XH.extend({implicit:[nU,iU],explicit:[uU,hU,yU,CU]}),TU=Object.prototype.hasOwnProperty,EU=1,DU=2,OU=3,kU=4,AU=1,jU=2,MU=3,NU=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PU=/[\x85\u2028\u2029]/,FU=/[,\[\]\{\}]/,IU=/^(?:!|!!|![a-z\-]+!)$/i,LU=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function RU(e){return Object.prototype.toString.call(e)}W(RU,`_class`);function zU(e){return e===10||e===13}W(zU,`is_EOL`);function BU(e){return e===9||e===32}W(BU,`is_WHITE_SPACE`);function VU(e){return e===9||e===32||e===10||e===13}W(VU,`is_WS_OR_EOL`);function HU(e){return e===44||e===91||e===93||e===123||e===125}W(HU,`is_FLOW_INDICATOR`);function UU(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}W(UU,`fromHexCode`);function WU(e){return e===120?2:e===117?4:e===85?8:0}W(WU,`escapedHexLen`);function GU(e){return 48<=e&&e<=57?e-48:-1}W(GU,`fromDecimalCode`);function KU(e){return e===48?`\0`:e===97?`\x07`:e===98?`\b`:e===116||e===9?` `:e===110?`
366
+ `:e===118?`\v`:e===102?`\f`:e===114?`\r`:e===101?`\x1B`:e===32?` `:e===34?`"`:e===47?`/`:e===92?`\\`:e===78?`…`:e===95?`\xA0`:e===76?`\u2028`:e===80?`\u2029`:``}W(KU,`simpleEscapeSequence`);function qU(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}W(qU,`charFromCodepoint`);function JU(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}W(JU,`setProperty`);var YU=Array(256),XU=Array(256);for(ZU=0;ZU<256;ZU++)YU[ZU]=+!!KU(ZU),XU[ZU]=KU(ZU);var ZU;function QU(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||wU,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}W(QU,`State$1`);function $U(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=_H(n),new pH(t,n)}W($U,`generateError`);function eW(e,t){throw $U(e,t)}W(eW,`throwError`);function tW(e,t){e.onWarning&&e.onWarning.call(null,$U(e,t))}W(tW,`throwWarning`);var nW={YAML:W(function(e,t,n){var r,i,a;e.version!==null&&eW(e,`duplication of %YAML directive`),n.length!==1&&eW(e,`YAML directive accepts exactly one argument`),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&eW(e,`ill-formed argument of the YAML directive`),i=parseInt(r[1],10),a=parseInt(r[2],10),i!==1&&eW(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&tW(e,`unsupported YAML version of the document`)},`handleYamlDirective`),TAG:W(function(e,t,n){var r,i;n.length!==2&&eW(e,`TAG directive accepts exactly two arguments`),r=n[0],i=n[1],IU.test(r)||eW(e,`ill-formed tag handle (first argument) of the TAG directive`),TU.call(e.tagMap,r)&&eW(e,`there is a previously declared suffix for "`+r+`" tag handle`),LU.test(i)||eW(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{i=decodeURIComponent(i)}catch{eW(e,`tag prefix is malformed: `+i)}e.tagMap[r]=i},`handleTagDirective`)};function rW(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||eW(e,`expected valid JSON character`);else NU.test(s)&&eW(e,`the stream contains non-printable characters`);e.result+=s}}W(rW,`captureSegment`);function iW(e,t,n,r){var i,a,o,s;for(uH.isObject(n)||eW(e,`cannot merge mappings; the provided source object is unacceptable`),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],TU.call(t,a)||(JU(t,a,n[a]),r[a]=!0)}W(iW,`mergeMappings`);function aW(e,t,n,r,i,a,o,s,c){var l,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,u=i.length;l<u;l+=1)Array.isArray(i[l])&&eW(e,`nested arrays are not supported inside keys`),typeof i==`object`&&RU(i[l])===`[object Object]`&&(i[l]=`[object Object]`);if(typeof i==`object`&&RU(i)===`[object Object]`&&(i=`[object Object]`),i=String(i),t===null&&(t={}),r===`tag:yaml.org,2002:merge`)if(Array.isArray(a))for(l=0,u=a.length;l<u;l+=1)iW(e,t,a[l],n);else iW(e,t,a,n);else !e.json&&!TU.call(n,i)&&TU.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,eW(e,`duplicated mapping key`)),JU(t,i,a),delete n[i];return t}W(aW,`storeMappingPair`);function oW(e){var t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):eW(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}W(oW,`readLineBreak`);function sW(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;BU(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(zU(i))for(oW(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&tW(e,`deficient indentation`),r}W(sW,`skipSeparationSpace`);function cW(e){var t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||VU(n)))}W(cW,`testDocumentSeparator`);function lW(e,t){t===1?e.result+=` `:t>1&&(e.result+=uH.repeat(`
367
+ `,t-1))}W(lW,`writeFoldedLines`);function uW(e,t,n){var r,i,a,o,s,c,l,u,d=e.kind,f=e.result,p=e.input.charCodeAt(e.position);if(VU(p)||HU(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),VU(i)||n&&HU(i)))return!1;for(e.kind=`scalar`,e.result=``,a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),VU(i)||n&&HU(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),VU(r))break}else if(e.position===e.lineStart&&cW(e)||n&&HU(p))break;else if(zU(p))if(c=e.line,l=e.lineStart,u=e.lineIndent,sW(e,!1,-1),e.lineIndent>=t){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=u;break}s&&=(rW(e,a,o,!1),lW(e,e.line-c),a=o=e.position,!1),BU(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return rW(e,a,o,!1),e.result?!0:(e.kind=d,e.result=f,!1)}W(uW,`readPlainScalar`);function dW(e,t){var n=e.input.charCodeAt(e.position),r,i;if(n!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(rW(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else zU(n)?(rW(e,r,i,!0),lW(e,sW(e,!1,t)),r=i=e.position):e.position===e.lineStart&&cW(e)?eW(e,`unexpected end of the document within a single quoted scalar`):(e.position++,i=e.position);eW(e,`unexpected end of the stream within a single quoted scalar`)}W(dW,`readSingleQuotedScalar`);function fW(e,t){var n,r,i,a,o,s=e.input.charCodeAt(e.position);if(s!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===34)return rW(e,n,e.position,!0),e.position++,!0;else if(s===92){if(rW(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),zU(s))sW(e,!1,t);else if(s<256&&YU[s])e.result+=XU[s],e.position++;else if((o=WU(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=UU(s))>=0?a=(a<<4)+o:eW(e,`expected hexadecimal character`);e.result+=qU(a),e.position++}else eW(e,`unknown escape sequence`);n=r=e.position}else zU(s)?(rW(e,n,r,!0),lW(e,sW(e,!1,t)),n=r=e.position):e.position===e.lineStart&&cW(e)?eW(e,`unexpected end of the document within a double quoted scalar`):(e.position++,r=e.position);eW(e,`unexpected end of the stream within a double quoted scalar`)}W(fW,`readDoubleQuotedScalar`);function pW(e,t){var n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,p,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)u=93,p=!1,s=[];else if(v===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(sW(e,!0,t),v=e.input.charCodeAt(e.position),v===u)return e.position++,e.tag=o,e.anchor=c,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?v===44&&eW(e,`expected the node content, but found ','`):eW(e,`missed comma between flow collection entries`),g=h=_=null,d=f=!1,v===63&&(l=e.input.charCodeAt(e.position+1),VU(l)&&(d=f=!0,e.position++,sW(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,bW(e,t,EU,!1,!0),g=e.tag,h=e.result,sW(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),sW(e,!0,t),bW(e,t,EU,!1,!0),_=e.result),p?aW(e,s,m,g,h,_,r,i,a):d?s.push(aW(e,null,m,g,h,_,r,i,a)):s.push(h),sW(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}eW(e,`unexpected end of the stream within a flow collection`)}W(pW,`readFlowCollection`);function mW(e,t){var n,r,i=AU,a=!1,o=!1,s=t,c=0,l=!1,u,d=e.input.charCodeAt(e.position);if(d===124)r=!1;else if(d===62)r=!0;else return!1;for(e.kind=`scalar`,e.result=``;d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)AU===i?i=d===43?MU:jU:eW(e,`repeat of a chomping mode identifier`);else if((u=GU(d))>=0)u===0?eW(e,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?eW(e,`repeat of an indentation width identifier`):(s=t+u-1,o=!0);else break;if(BU(d)){do d=e.input.charCodeAt(++e.position);while(BU(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!zU(d)&&d!==0)}for(;d!==0;){for(oW(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),zU(d)){c++;continue}if(e.lineIndent<s){i===MU?e.result+=uH.repeat(`
368
+ `,a?1+c:c):i===AU&&a&&(e.result+=`
369
+ `);break}for(r?BU(d)?(l=!0,e.result+=uH.repeat(`
370
+ `,a?1+c:c)):l?(l=!1,e.result+=uH.repeat(`
371
+ `,c+1)):c===0?a&&(e.result+=` `):e.result+=uH.repeat(`
372
+ `,c):e.result+=uH.repeat(`
373
+ `,a?1+c:c),a=!0,o=!0,c=0,n=e.position;!zU(d)&&d!==0;)d=e.input.charCodeAt(++e.position);rW(e,n,e.position,!1)}return!0}W(mW,`readBlockScalar`);function hW(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,eW(e,`tab characters must not be used in indentation`)),!(c!==45||(o=e.input.charCodeAt(e.position+1),!VU(o))));){if(s=!0,e.position++,sW(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,bW(e,t,OU,!1,!0),a.push(e.result),sW(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)eW(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind=`sequence`,e.result=a,!0):!1}W(hW,`readBlockSequence`);function gW(e,t,n){var r,i,a,o,s,c,l=e.tag,u=e.anchor,d={},f=Object.create(null),p=null,m=null,h=null,g=!1,_=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,eW(e,`tab characters must not be used in indentation`)),r=e.input.charCodeAt(e.position+1),a=e.line,(v===63||v===58)&&VU(r))v===63?(g&&(aW(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!0,i=!0):g?(g=!1,i=!0):eW(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=r;else{if(o=e.line,s=e.lineStart,c=e.position,!bW(e,n,DU,!1,!0))break;if(e.line===a){for(v=e.input.charCodeAt(e.position);BU(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),VU(v)||eW(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(aW(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!1,i=!1,p=e.tag,m=e.result;else if(_)eW(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=l,e.anchor=u,!0}else if(_)eW(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=l,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(g&&(o=e.line,s=e.lineStart,c=e.position),bW(e,t,kU,!0,i)&&(g?m=e.result:h=e.result),g||(aW(e,d,f,p,m,h,o,s,c),p=m=h=null),sW(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&v!==0)eW(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&aW(e,d,f,p,m,null,o,s,c),_&&(e.tag=l,e.anchor=u,e.kind=`mapping`,e.result=d),_}W(gW,`readBlockMapping`);function _W(e){var t,n=!1,r=!1,i,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;if(e.tag!==null&&eW(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i=`!!`,o=e.input.charCodeAt(++e.position)):i=`!`,t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):eW(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!VU(o);)o===33&&(r?eW(e,`tag suffix cannot contain exclamation marks`):(i=e.input.slice(t-1,e.position+1),IU.test(i)||eW(e,`named tag handle cannot contain such characters`),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),FU.test(a)&&eW(e,`tag suffix cannot contain flow indicator characters`)}a&&!LU.test(a)&&eW(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{eW(e,`tag name is malformed: `+a)}return n?e.tag=a:TU.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i===`!`?e.tag=`!`+a:i===`!!`?e.tag=`tag:yaml.org,2002:`+a:eW(e,`undeclared tag handle "`+i+`"`),!0}W(_W,`readTagProperty`);function vW(e){var t,n=e.input.charCodeAt(e.position);if(n!==38)return!1;for(e.anchor!==null&&eW(e,`duplication of an anchor property`),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!VU(n)&&!HU(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&eW(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(t,e.position),!0}W(vW,`readAnchorProperty`);function yW(e){var t,n,r=e.input.charCodeAt(e.position);if(r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!VU(r)&&!HU(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&eW(e,`name of an alias node must contain at least one character`),n=e.input.slice(t,e.position),TU.call(e.anchorMap,n)||eW(e,`unidentified alias "`+n+`"`),e.result=e.anchorMap[n],sW(e,!0,-1),!0}W(yW,`readAlias`);function bW(e,t,n,r,i){var a,o,s,c=1,l=!1,u=!1,d,f,p,m,h,g;if(e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=kU===n||OU===n,r&&sW(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;_W(e)||vW(e);)sW(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&=l||i,(c===1||kU===n)&&(h=EU===n||DU===n?t:t+1,g=e.position-e.lineStart,c===1?s&&(hW(e,g)||gW(e,g,h))||pW(e,h)?u=!0:(o&&mW(e,h)||dW(e,h)||fW(e,h)?u=!0:yW(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&eW(e,`alias node should not have any properties`)):uW(e,h,EU===n)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=s&&hW(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag===`?`){for(e.result!==null&&e.kind!==`scalar`&&eW(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`),d=0,f=e.implicitTypes.length;d<f;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!==`!`){if(TU.call(e.typeMap[e.kind||`fallback`],e.tag))m=e.typeMap[e.kind||`fallback`][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||`fallback`],d=0,f=p.length;d<f;d+=1)if(e.tag.slice(0,p[d].tag.length)===p[d].tag){m=p[d];break}m||eW(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&m.kind!==e.kind&&eW(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+m.kind+`", not "`+e.kind+`"`),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):eW(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),e.tag!==null||e.anchor!==null||u}W(bW,`composeNode`);function xW(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(sW(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!VU(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&eW(e,`directive name must not be less than one character in length`);o!==0;){for(;BU(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!zU(o));break}if(zU(o))break;for(n=e.position;o!==0&&!VU(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&oW(e),TU.call(nW,r)?nW[r](e,r,i):tW(e,`unknown document directive "`+r+`"`)}if(sW(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,sW(e,!0,-1)):a&&eW(e,`directives end mark is expected`),bW(e,e.lineIndent-1,kU,!1,!0),sW(e,!0,-1),e.checkLineBreaks&&PU.test(e.input.slice(t,e.position))&&tW(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&cW(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,sW(e,!0,-1));return}if(e.position<e.length-1)eW(e,`end of the stream or a document separator is expected`);else return}W(xW,`readDocument`);function SW(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
374
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new QU(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,eW(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)xW(n);return n.documents}W(SW,`loadDocuments`);function CW(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);var r=SW(e,n);if(typeof t!=`function`)return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}W(CW,`loadAll$1`);function wW(e,t){var n=SW(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new pH(`expected a single document in the stream, but found more`)}}W(wW,`load$1`);var TW={loadAll:CW,load:wW},EW=Object.prototype.toString,DW=Object.prototype.hasOwnProperty,OW=65279,kW=9,AW=10,jW=13,MW=32,NW=33,PW=34,FW=35,IW=37,LW=38,RW=39,zW=42,BW=44,VW=45,HW=58,UW=61,WW=62,GW=63,KW=64,qW=91,JW=93,YW=96,XW=123,ZW=124,QW=125,$W={};$W[0]=`\\0`,$W[7]=`\\a`,$W[8]=`\\b`,$W[9]=`\\t`,$W[10]=`\\n`,$W[11]=`\\v`,$W[12]=`\\f`,$W[13]=`\\r`,$W[27]=`\\e`,$W[34]=`\\"`,$W[92]=`\\\\`,$W[133]=`\\N`,$W[160]=`\\_`,$W[8232]=`\\L`,$W[8233]=`\\P`;var eG=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],tG=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function nG(e,t){var n,r,i,a,o,s,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&DW.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s;return n}W(nG,`compileStyleMap`);function rG(e){var t=e.toString(16).toUpperCase(),n,r;if(e<=255)n=`x`,r=2;else if(e<=65535)n=`u`,r=4;else if(e<=4294967295)n=`U`,r=8;else throw new pH(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+n+uH.repeat(`0`,r-t.length)+t}W(rG,`encodeHex`);var iG=1,aG=2;function oG(e){this.schema=e.schema||wU,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=uH.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=nG(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType===`"`?aG:iG,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==`function`?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}W(oG,`State`);function sG(e,t){for(var n=uH.repeat(` `,t),r=0,i=-1,a=``,o,s=e.length;r<s;)i=e.indexOf(`
375
+ `,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
376
+ `&&(a+=n),a+=o;return a}W(sG,`indentString`);function cG(e,t){return`
377
+ `+uH.repeat(` `,e.indent*t)}W(cG,`generateNextLine`);function lG(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}W(lG,`testImplicitResolving`);function uG(e){return e===MW||e===kW}W(uG,`isWhitespace`);function dG(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==OW||65536<=e&&e<=1114111}W(dG,`isPrintable`);function fG(e){return dG(e)&&e!==OW&&e!==jW&&e!==AW}W(fG,`isNsCharOrWhitespace`);function pG(e,t,n){var r=fG(e),i=r&&!uG(e);return(n?r:r&&e!==BW&&e!==qW&&e!==JW&&e!==XW&&e!==QW)&&e!==FW&&!(t===HW&&!i)||fG(t)&&!uG(t)&&e===FW||t===HW&&i}W(pG,`isPlainSafe`);function mG(e){return dG(e)&&e!==OW&&!uG(e)&&e!==VW&&e!==GW&&e!==HW&&e!==BW&&e!==qW&&e!==JW&&e!==XW&&e!==QW&&e!==FW&&e!==LW&&e!==zW&&e!==NW&&e!==ZW&&e!==UW&&e!==WW&&e!==RW&&e!==PW&&e!==IW&&e!==KW&&e!==YW}W(mG,`isPlainSafeFirst`);function hG(e){return!uG(e)&&e!==HW}W(hG,`isPlainSafeLast`);function gG(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}W(gG,`codePointAt`);function _G(e){return/^\n* /.test(e)}W(_G,`needIndentIndicator`);var vG=1,yG=2,bG=3,xG=4,SG=5;function CG(e,t,n,r,i,a,o,s){var c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=mG(gG(e,0))&&hG(gG(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=gG(e,c),!dG(l))return SG;h&&=pG(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=gG(e,c),l===AW)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!dG(l))return SG;h&&=pG(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?vG:a===aG?SG:yG:n>9&&_G(e)?SG:o?a===aG?SG:yG:f?xG:bG}W(CG,`chooseScalarStyle`);function wG(e,t,n,r,i){e.dump=(function(){if(t.length===0)return e.quotingType===aG?`""`:`''`;if(!e.noCompatMode&&(eG.indexOf(t)!==-1||tG.test(t)))return e.quotingType===aG?`"`+t+`"`:`'`+t+`'`;var a=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function c(t){return lG(e,t)}switch(W(c,`testAmbiguity`),CG(t,s,e.indent,o,c,e.quotingType,e.forceQuotes&&!r,i)){case vG:return t;case yG:return`'`+t.replace(/'/g,`''`)+`'`;case bG:return`|`+TG(t,e.indent)+EG(sG(t,a));case xG:return`>`+TG(t,e.indent)+EG(sG(DG(t,o),a));case SG:return`"`+kG(t)+`"`;default:throw new pH(`impossible error: invalid scalar style`)}})()}W(wG,`writeScalar`);function TG(e,t){var n=_G(e)?String(t):``,r=e[e.length-1]===`
378
+ `;return n+(r&&(e[e.length-2]===`
379
+ `||e===`
380
+ `)?`+`:r?``:`-`)+`
381
+ `}W(TG,`blockHeader`);function EG(e){return e[e.length-1]===`
382
+ `?e.slice(0,-1):e}W(EG,`dropEndingNewline`);function DG(e,t){for(var n=/(\n+)([^\n]*)/g,r=(function(){var r=e.indexOf(`
383
+ `);return r=r===-1?e.length:r,n.lastIndex=r,OG(e.slice(0,r),t)})(),i=e[0]===`
384
+ `||e[0]===` `,a,o;o=n.exec(e);){var s=o[1],c=o[2];a=c[0]===` `,r+=s+(!i&&!a&&c!==``?`
385
+ `:``)+OG(c,t),i=a}return r}W(DG,`foldString`);function OG(e,t){if(e===``||e[0]===` `)return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
386
+ `+e.slice(i,a),i=a+1),o=s;return c+=`
387
+ `,e.length-i>t&&o>i?c+=e.slice(i,o)+`
388
+ `+e.slice(o+1):c+=e.slice(i),c.slice(1)}W(OG,`foldLine`);function kG(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=gG(e,i),r=$W[n],!r&&dG(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||rG(n);return t}W(kG,`escapeString`);function AG(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(FG(e,t,s,!1,!1)||s===void 0&&FG(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}W(AG,`writeFlowSequence`);function jG(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(FG(e,t+1,c,!0,!0,!1,!0)||c===void 0&&FG(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=cG(e,t)),e.dump&&AW===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}W(jG,`writeBlockSequence`);function MG(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),FG(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),FG(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}W(MG,`writeFlowMapping`);function NG(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,u,d,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new pH(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)f=``,(!r||i!==``)&&(f+=cG(e,t)),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),FG(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,d&&(e.dump&&AW===e.dump.charCodeAt(0)?f+=`?`:f+=`? `),f+=e.dump,d&&(f+=cG(e,t)),FG(e,t+1,u,!0,d)&&(e.dump&&AW===e.dump.charCodeAt(0)?f+=`:`:f+=`: `,f+=e.dump,i+=f));e.tag=a,e.dump=i||`{}`}W(NG,`writeBlockMapping`);function PG(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,EW.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(DW.call(s.represent,c))r=s.represent[c](t,c);else throw new pH(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}W(PG,`detectType`);function FG(e,t,n,r,i,a,o){e.tag=null,e.dump=n,PG(e,n,!1)||PG(e,n,!0);var s=EW.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var u=s===`[object Object]`||s===`[object Array]`,d,f;if(u&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!==`?`||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump=`*ref_`+d;else{if(u&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(NG(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(MG(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?jG(e,t-1,e.dump,i):jG(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(AG(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&wG(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new pH(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}W(FG,`writeNode`);function IG(e,t){var n=[],r=[],i,a;for(LG(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}W(IG,`getDuplicateReferences`);function LG(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)LG(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)LG(e[r[i]],t,n)}W(LG,`inspectNode`);function RG(e,t){t||={};var n=new oG(t);n.noRefs||IG(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),FG(n,0,r,!0,!0)?n.dump+`
389
+ `:``}W(RG,`dump$1`);var zG={dump:RG};function BG(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}W(BG,`renamed`);var VG=YH,HG=TW.load;TW.loadAll,zG.dump;var UG=W((e,t)=>{if(t)return`translate(`+-e.width/2+`, `+-e.height/2+`)`;let n=e.x??0,r=e.y??0;return`translate(`+-(n+e.width/2)+`, `+-(r+e.height/2)+`)`},`computeLabelTransform`),WG={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},GG={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5};function KG(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=qG(e),t=qG(t);let[n,r]=[e.x,e.y],[i,a]=[t.x,t.y],o=i-n,s=a-r;return{angle:Math.atan(s/o),deltaX:o,deltaY:s}}W(KG,`calculateDeltaAndAngle`);var qG=W(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,`pointTransformer`),JG=W(e=>({x:W(function(t,n,r){let i=0,a=qG(r[0]).x<qG(r[r.length-1]).x?`left`:`right`;if(n===0&&Object.hasOwn(WG,e.arrowTypeStart)){let{angle:t,deltaX:n}=KG(r[0],r[1]);i=WG[e.arrowTypeStart]*Math.cos(t)*(n>=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(WG,e.arrowTypeEnd)){let{angle:t,deltaX:n}=KG(r[r.length-1],r[r.length-2]);i=WG[e.arrowTypeEnd]*Math.cos(t)*(n>=0?1:-1)}let o=Math.abs(qG(t).x-qG(r[r.length-1]).x),s=Math.abs(qG(t).y-qG(r[r.length-1]).y),c=Math.abs(qG(t).x-qG(r[0]).x),l=Math.abs(qG(t).y-qG(r[0]).y),u=WG[e.arrowTypeStart],d=WG[e.arrowTypeEnd];if(o<d&&o>0&&s<d){let e=d+1-o;e*=a===`right`?-1:1,i-=e}if(c<u&&c>0&&l<u){let e=u+1-c;e*=a===`right`?-1:1,i+=e}return qG(t).x+i},`x`),y:W(function(t,n,r){let i=0,a=qG(r[0]).y<qG(r[r.length-1]).y?`down`:`up`;if(n===0&&Object.hasOwn(WG,e.arrowTypeStart)){let{angle:t,deltaY:n}=KG(r[0],r[1]);i=WG[e.arrowTypeStart]*Math.abs(Math.sin(t))*(n>=0?1:-1)}else if(n===r.length-1&&Object.hasOwn(WG,e.arrowTypeEnd)){let{angle:t,deltaY:n}=KG(r[r.length-1],r[r.length-2]);i=WG[e.arrowTypeEnd]*Math.abs(Math.sin(t))*(n>=0?1:-1)}let o=Math.abs(qG(t).y-qG(r[r.length-1]).y),s=Math.abs(qG(t).x-qG(r[r.length-1]).x),c=Math.abs(qG(t).y-qG(r[0]).y),l=Math.abs(qG(t).x-qG(r[0]).x),u=WG[e.arrowTypeStart],d=WG[e.arrowTypeEnd];if(o<d&&o>0&&s<d){let e=d+1-o;e*=a===`up`?-1:1,i-=e}if(c<u&&c>0&&l<u){let e=u+1-c;e*=a===`up`?-1:1,i+=e}return qG(t).y+i},`y`)}),`getLineFunctionsWithOffset`),YG=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|&colon;)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[`.`,`/`],e.BLANK_URL=`about:blank`})),XG=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.sanitizeUrl=o;var t=YG();function n(e){return t.relativeFirstCharacters.indexOf(e[0])>-1}function r(e){return e.replace(t.ctrlCharactersRegex,``).replace(t.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}function i(e){return URL.canParse(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e){if(!e)return t.BLANK_URL;var o,s=a(e.trim());do s=r(s).replace(t.htmlCtrlEntityRegex,``).replace(t.ctrlCharactersRegex,``).replace(t.whitespaceEscapeCharsRegex,``).trim(),s=a(s),o=s.match(t.ctrlCharactersRegex)||s.match(t.htmlEntitiesRegex)||s.match(t.htmlCtrlEntityRegex)||s.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var c=s;if(!c)return t.BLANK_URL;if(n(c))return c;var l=c.trimStart(),u=l.match(t.urlSchemeRegex);if(!u)return c;var d=u[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(d))return t.BLANK_URL;var f=l.replace(/\\/g,`/`);if(d===`mailto:`||d.includes(`://`))return f;if(d===`http:`||d===`https:`){if(!i(f))return t.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}})),ZG=XG(),QG=function(){try{var e=l(Object,`defineProperty`);return e({},``,{}),e}catch{}}();function $G(e,t,n){t==`__proto__`&&QG?QG(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function eK(e,t,n){(n!==void 0&&!O(e[t],n)||n===void 0&&!(t in e))&&$G(e,t,n)}var tK=typeof exports==`object`&&exports&&!exports.nodeType&&exports,nK=tK&&typeof module==`object`&&module&&!module.nodeType&&module,rK=nK&&nK.exports===tK?c.Buffer:void 0,iK=rK?rK.allocUnsafe:void 0;function aK(e,t){if(t)return e.slice();var n=e.length,r=iK?iK(n):new e.constructor(n);return e.copy(r),r}function oK(e){var t=new e.constructor(e.byteLength);return new _(t).set(new _(e)),t}function sK(e,t){var n=t?oK(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function cK(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var lK=Object.create,uK=function(){function e(){}return function(t){if(!u(t))return{};if(lK)return lK(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),dK=y(Object.getPrototypeOf,Object);function fK(e){return typeof e.constructor==`function`&&!x(e)?uK(dK(e)):{}}function pK(e){return h(e)&&p(e)}var mK=`[object Object]`,hK=Function.prototype,gK=Object.prototype,_K=hK.toString,vK=gK.hasOwnProperty,yK=_K.call(Object);function bK(e){if(!h(e)||s(e)!=mK)return!1;var t=dK(e);if(t===null)return!0;var n=vK.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&_K.call(n)==yK}function xK(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var SK=Object.prototype.hasOwnProperty;function CK(e,t,n){var r=e[t];(!(SK.call(e,t)&&O(r,n))||n===void 0&&!(t in e))&&$G(e,t,n)}function wK(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?$G(n,s,c):CK(n,s,c)}return n}function TK(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var EK=Object.prototype.hasOwnProperty;function DK(e){if(!u(e))return TK(e);var t=x(e),n=[];for(var r in e)r==`constructor`&&(t||!EK.call(e,r))||n.push(r);return n}function OK(e){return p(e)?b(e,!0):DK(e)}function kK(e){return wK(e,OK(e))}function AK(e,t,n,r,i,a,o){var s=xK(e,n),c=xK(t,n),l=o.get(c);if(l){eK(e,n,l);return}var d=a?a(s,c,n+``,e,t,o):void 0,f=d===void 0;if(f){var p=T(c),h=!p&&C(c),g=!p&&!h&&v(c);d=c,p||h||g?T(s)?d=s:pK(s)?d=cK(s):h?(f=!1,d=aK(c,!0)):g?(f=!1,d=sK(c,!0)):d=[]:bK(c)||m(c)?(d=s,m(s)?d=kK(s):(!u(s)||D(s))&&(d=fK(c))):f=!1}f&&(o.set(c,d),i(d,c,r,a,o),o.delete(c)),eK(e,n,d)}function jK(e,t,n,r,i){e!==t&&g(t,function(a,o){if(i||=new d,u(a))AK(e,t,o,n,jK,r,i);else{var s=r?r(xK(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),eK(e,o,s)}},OK)}function MK(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var NK=Math.max;function PK(e,t,n){return t=NK(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=NK(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),MK(e,this,s)}}function FK(e){return function(){return e}}var IK=QG?function(e,t){return QG(e,`toString`,{configurable:!0,enumerable:!1,value:FK(t),writable:!0})}:w,LK=800,RK=16,zK=Date.now;function BK(e){var t=0,n=0;return function(){var r=zK(),i=RK-(r-n);if(n=r,i>0){if(++t>=LK)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var VK=BK(IK);function HK(e,t){return VK(PK(e,t,w),e+``)}function UK(e,t,n){if(!u(n))return!1;var r=typeof t;return(r==`number`?p(n)&&S(t,n.length):r==`string`&&t in n)?O(n[t],e):!1}function WK(e){return HK(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&UK(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var GK=WK(function(e,t,n){jK(e,t,n)}),KK={curveBasis:hV,curveBasisClosed:_V,curveBasisOpen:yV,curveBumpX:uV,curveBumpY:dV,curveBundle:xV,curveCardinalClosed:EV,curveCardinalOpen:OV,curveCardinal:wV,curveCatmullRomClosed:NV,curveCatmullRomOpen:FV,curveCatmullRom:jV,curveLinear:aV,curveLinearClosed:LV,curveMonotoneX:GV,curveMonotoneY:KV,curveNatural:YV,curveStep:ZV,curveStepAfter:$V,curveStepBefore:QV},qK=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,JK=W(function(e,t){let n=YK(e,/(?:init\b)|(?:initialize\b)/),r={};if(Array.isArray(n)){let e=n.map(e=>e.args);TI(e),r=JF(r,[...e])}else r=n.args;if(!r)return;let i=UF(e,t),a=`config`;return r[a]!==void 0&&(i===`flowchart-v2`&&(i=`flowchart`),r[i]=r[a],delete r[a]),r},`detectInit`),YK=W(function(e,t=null){try{let n=RegExp(`[%]{2}(?![{]${qK.source})(?=[}][%]{2}).*
390
+ `,`ig`);e=e.trim().replace(n,``).replace(/'/gm,`"`),G.debug(`Detecting diagram directive${t===null?``:` type:`+t} based on the text:${e}`);let r,i=[];for(;(r=zF.exec(e))!==null;)if(r.index===zF.lastIndex&&zF.lastIndex++,r&&!t||t&&r[1]?.match(t)||t&&r[2]?.match(t)){let e=r[1]?r[1]:r[2],t=r[3]?r[3].trim():r[4]?JSON.parse(r[4].trim()):null;i.push({type:e,args:t})}return i.length===0?{type:e,args:null}:i.length===1?i[0]:i}catch(n){return G.error(`ERROR: ${n.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},`detectDirective`),XK=W(function(e){return e.replace(zF,``)},`removeDirectives`),ZK=W(function(e,t){for(let[n,r]of t.entries())if(r.match(e))return n;return-1},`isSubstringInArray`);function QK(e,t){return e?KK[`curve${e.charAt(0).toUpperCase()+e.slice(1)}`]??t:t}W(QK,`interpolateToCurve`);function $K(e,t){let n=e.trim();if(n)return t.securityLevel===`loose`?n:(0,ZG.sanitizeUrl)(n)}W($K,`formatUrl`);var eq=W((e,...t)=>{let n=e.split(`.`),r=n.length-1,i=n[r],a=window;for(let t=0;t<r;t++)if(a=a[n[t]],!a){G.error(`Function name: ${e} not found in window`);return}a[i](...t)},`runFunc`);function tq(e,t){return!e||!t?0:Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}W(tq,`distance`);function nq(e){let t,n=0;return e.forEach(e=>{n+=tq(e,t),t=e}),aq(e,n/2)}W(nq,`traverseEdge`);function rq(e){return e.length===1?e[0]:nq(e)}W(rq,`calcLabelPosition`);var iq=W((e,t=2)=>{let n=10**t;return Math.round(e*n)/n},`roundNumber`),aq=W((e,t)=>{let n,r=t;for(let t of e){if(n){let e=tq(t,n);if(e===0)return n;if(e<r)r-=e;else{let i=r/e;if(i<=0)return n;if(i>=1)return{x:t.x,y:t.y};if(i>0&&i<1)return{x:iq((1-i)*n.x+i*t.x,5),y:iq((1-i)*n.y+i*t.y,5)}}}n=t}throw Error(`Could not find a suitable point for the given distance`)},`calculatePoint`),oq=W((e,t,n)=>{G.info(`our points ${JSON.stringify(t)}`),t[0]!==n&&(t=t.reverse());let r=aq(t,25),i=e?10:5,a=Math.atan2(t[0].y-r.y,t[0].x-r.x),o={x:0,y:0};return o.x=Math.sin(a)*i+(t[0].x+r.x)/2,o.y=-Math.cos(a)*i+(t[0].y+r.y)/2,o},`calcCardinalityPosition`);function sq(e,t,n){let r=structuredClone(n);G.info(`our points`,r),t!==`start_left`&&t!==`start_right`&&r.reverse();let i=aq(r,25+e),a=10+e*.5,o=Math.atan2(r[0].y-i.y,r[0].x-i.x),s={x:0,y:0};return t===`start_left`?(s.x=Math.sin(o+Math.PI)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o+Math.PI)*a+(r[0].y+i.y)/2):t===`end_right`?(s.x=Math.sin(o-Math.PI)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o-Math.PI)*a+(r[0].y+i.y)/2-5):t===`end_left`?(s.x=Math.sin(o)*a+(r[0].x+i.x)/2-5,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2-5):(s.x=Math.sin(o)*a+(r[0].x+i.x)/2,s.y=-Math.cos(o)*a+(r[0].y+i.y)/2),s}W(sq,`calcTerminalLabelPosition`);function cq(e){let t=``,n=``;for(let r of e)r!==void 0&&(r.startsWith(`color:`)||r.startsWith(`text-align:`)?n=n+r+`;`:t=t+r+`;`);return{style:t,labelStyle:n}}W(cq,`getStylesFromArray`);var lq=0,uq=W(()=>(lq++,`id-`+Math.random().toString(36).substr(2,12)+`-`+lq),`generateId`);function dq(e){let t=``;for(let n=0;n<e;n++)t+=`0123456789abcdef`.charAt(Math.floor(Math.random()*16));return t}W(dq,`makeRandomHex`);var fq=W(e=>dq(e.length),`random`),pq=W(function(){return{x:0,y:0,fill:void 0,anchor:`start`,style:`#666`,width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:``}},`getTextObj`),mq=W(function(e,t){let n=t.text.replace(yL.lineBreakRegex,` `),[,r]=Tq(t.fontSize),i=e.append(`text`);i.attr(`x`,t.x),i.attr(`y`,t.y),i.style(`text-anchor`,t.anchor),i.style(`font-family`,t.fontFamily),i.style(`font-size`,r),i.style(`font-weight`,t.fontWeight),i.attr(`fill`,t.fill),t.class!==void 0&&i.attr(`class`,t.class);let a=i.append(`tspan`);return a.attr(`x`,t.x+t.textMargin*2),a.attr(`fill`,t.fill),a.text(n),i},`drawSimpleText`),hq=E((e,t,n)=>{if(!e||(n=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,joinWith:`<br/>`},n),yL.lineBreakRegex.test(e)))return e;let r=e.split(` `).filter(Boolean),i=[],a=``;return r.forEach((e,o)=>{let s=vq(`${e} `,n),c=vq(a,n);if(s>t){let{hyphenatedStrings:r,remainingWord:o}=gq(e,t,`-`,n);i.push(a,...r),a=o}else c+s>=t?(i.push(a),a=e):a=[a,e].filter(Boolean).join(` `);o+1===r.length&&i.push(a)}),i.filter(e=>e!==``).join(n.joinWith)},(e,t,n)=>`${e}${t}${n.fontSize}${n.fontWeight}${n.fontFamily}${n.joinWith}`),gq=E((e,t,n=`-`,r)=>{r=Object.assign({fontSize:12,fontWeight:400,fontFamily:`Arial`,margin:0},r);let i=[...e],a=[],o=``;return i.forEach((e,s)=>{let c=`${o}${e}`;if(vq(c,r)>=t){let e=s+1,t=i.length===e,r=`${c}${n}`;a.push(t?c:r),o=``}else o=c}),{hyphenatedStrings:a,remainingWord:o}},(e,t,n=`-`,r)=>`${e}${t}${n}${r.fontSize}${r.fontWeight}${r.fontFamily}`);function _q(e,t){return yq(e,t).height}W(_q,`calculateTextHeight`);function vq(e,t){return yq(e,t).width}W(vq,`calculateTextWidth`);var yq=E((e,t)=>{let{fontSize:n=12,fontFamily:r=`Arial`,fontWeight:i=400}=t;if(!e)return{width:0,height:0};let[,a]=Tq(n),o=[`sans-serif`,r],s=e.split(yL.lineBreakRegex),c=[],l=gR(`body`);if(!l.remove)return{width:0,height:0,lineHeight:0};let u=l.append(`svg`);for(let e of o){let t=0,n={width:0,height:0,lineHeight:0};for(let r of s){let o=pq();o.text=r||`​`;let s=mq(u,o).style(`font-size`,a).style(`font-weight`,i).style(`font-family`,e),c=(s._groups||s)[0][0].getBBox();if(c.width===0&&c.height===0)throw Error(`svg element not in render tree`);n.width=Math.round(Math.max(n.width,c.width)),t=Math.round(c.height),n.height+=t,n.lineHeight=Math.round(Math.max(n.lineHeight,t))}c.push(n)}return u.remove(),c[isNaN(c[1].height)||isNaN(c[1].width)||isNaN(c[1].lineHeight)||c[0].height>c[1].height&&c[0].width>c[1].width&&c[0].lineHeight>c[1].lineHeight?0:1]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),bq=class{constructor(e=!1,t){this.count=0,this.count=t?t.length:0,this.next=e?()=>this.count++:()=>Date.now()}static{W(this,`InitIDGenerator`)}},xq,Sq=W(function(e){return xq||=document.createElement(`div`),e=escape(e).replace(/%26/g,`&`).replace(/%23/g,`#`).replace(/%3B/g,`;`),xq.innerHTML=e,unescape(xq.textContent)},`entityDecode`);function Cq(e){return`str`in e}W(Cq,`isDetailedError`);var wq=W((e,t,n,r)=>{if(!r)return;let i=e.node()?.getBBox();i&&e.append(`text`).text(r).attr(`text-anchor`,`middle`).attr(`x`,i.x+i.width/2).attr(`y`,-n).attr(`class`,t)},`insertTitle`),Tq=W(e=>{if(typeof e==`number`)return[e,e+`px`];let t=parseInt(e??``,10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+`px`]:[t,e]},`parseFontSize`);function Eq(e,t){return GK({},e,t)}W(Eq,`cleanAndMerge`);var Dq={assignWithDepth:JF,wrapLabel:hq,calculateTextHeight:_q,calculateTextWidth:vq,calculateTextDimensions:yq,cleanAndMerge:Eq,detectInit:JK,detectDirective:YK,isSubstringInArray:ZK,interpolateToCurve:QK,calcLabelPosition:rq,calcCardinalityPosition:oq,calcTerminalLabelPosition:sq,formatUrl:$K,getStylesFromArray:cq,generateId:uq,random:fq,runFunc:eq,entityDecode:Sq,insertTitle:wq,isLabelCoordinateInPath:Mq,parseFontSize:Tq,InitIDGenerator:bq},Oq=W(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(e){return e.substring(0,e.length-1)}),t=t.replace(/#\w+;/g,function(e){let t=e.substring(1,e.length-1);return/^\+?\d+$/.test(t)?`fl°°`+t+`¶ß`:`fl°`+t+`¶ß`}),t},`encodeEntities`),kq=W(function(e){return e.replace(/fl°°/g,`&#`).replace(/fl°/g,`&`).replace(/¶ß/g,`;`)},`decodeEntities`),Aq=W((e,t,{counter:n=0,prefix:r,suffix:i},a)=>a||`${r?`${r}_`:``}${e}_${t}_${n}${i?`_${i}`:``}`,`getEdgeId`);function jq(e){return e??null}W(jq,`handleUndefinedAttr`);function Mq(e,t){let n=Math.round(e.x),r=Math.round(e.y),i=t.replace(/(\d+\.\d+)/g,e=>Math.round(parseFloat(e)).toString());return i.includes(n.toString())||i.includes(r.toString())}W(Mq,`isLabelCoordinateInPath`);var Nq=W(({flowchart:e})=>{let t=e?.subGraphTitleMargin?.top??0,n=e?.subGraphTitleMargin?.bottom??0;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:n,subGraphTitleTotalMargin:t+n}},`getSubGraphTitleMargins`);async function Pq(e,t){let n=e.getElementsByTagName(`img`);if(!n||n.length===0)return;let r=t.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...n].map(e=>new Promise(t=>{function n(){if(e.style.display=`flex`,e.style.flexDirection=`column`,r){let[t=wI.fontSize]=Tq(VL().fontSize?VL().fontSize:window.getComputedStyle(document.body).fontSize),n=t*5+`px`;e.style.minWidth=n,e.style.maxWidth=n}else e.style.width=`100%`;t(e)}W(n,`setupImage`),setTimeout(()=>{e.complete&&n()}),e.addEventListener(`error`,n),e.addEventListener(`load`,n)})))}W(Pq,`configureLabelImages`);var Fq=W(e=>{let{handDrawnSeed:t}=VL();return{fill:e,hachureAngle:120,hachureGap:4,fillWeight:2,roughness:.7,stroke:e,seed:t}},`solidStateFill`),Iq=W(e=>{let t=Lq([...e.cssCompiledStyles||[],...e.cssStyles||[],...e.labelStyle||[]]);return{stylesMap:t,stylesArray:[...t]}},`compileStyles`),Lq=W(e=>{let t=new Map;return e.forEach(e=>{let[n,r]=e.split(`:`);t.set(n.trim(),r?.trim())}),t},`styles2Map`),Rq=W(e=>e===`color`||e===`font-size`||e===`font-family`||e===`font-weight`||e===`font-style`||e===`text-decoration`||e===`text-align`||e===`text-transform`||e===`line-height`||e===`letter-spacing`||e===`word-spacing`||e===`text-shadow`||e===`text-overflow`||e===`white-space`||e===`word-wrap`||e===`word-break`||e===`overflow-wrap`||e===`hyphens`,`isLabelStyle`),X=W(e=>{let{stylesArray:t}=Iq(e),n=[],r=[],i=[],a=[];return t.forEach(e=>{let t=e[0];Rq(t)?n.push(e.join(`:`)+` !important`):(r.push(e.join(`:`)+` !important`),t.includes(`stroke`)&&i.push(e.join(`:`)+` !important`),t===`fill`&&a.push(e.join(`:`)+` !important`))}),{labelStyles:n.join(`;`),nodeStyles:r.join(`;`),stylesArray:t,borderStyles:i,backgroundStyles:a}},`styles2String`),Z=W((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=VL(),{nodeBorder:i,mainBkg:a}=n,{stylesMap:o}=Iq(e);return Object.assign({roughness:.7,fill:o.get(`fill`)||a,fillStyle:`hachure`,fillWeight:4,hachureGap:5.2,stroke:o.get(`stroke`)||i,seed:r,strokeWidth:o.get(`stroke-width`)?.replace(`px`,``)||1.3,fillLineDash:[0,0],strokeLineDash:zq(o.get(`stroke-dasharray`))},t)},`userNodeOverrides`),zq=W(e=>{if(!e)return[0,0];let t=e.trim().split(/\s+/).map(Number);if(t.length===1){let e=isNaN(t[0])?0:t[0];return[e,e]}return[isNaN(t[0])?0:t[0],isNaN(t[1])?0:t[1]]},`getStrokeDashArray`),Bq=Object.freeze({left:0,top:0,width:16,height:16}),Vq=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Hq=Object.freeze({...Bq,...Vq}),Uq=Object.freeze({...Hq,body:``,hidden:!1}),Wq=Object.freeze({width:null,height:null}),Gq=Object.freeze({...Wq,...Vq}),Kq=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!qq(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!qq(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!qq(e,n)?null:e}return null},qq=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1;function Jq(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Yq(e,t){let n=Jq(e,t);for(let r in Uq)r in Vq?r in e&&!(r in n)&&(n[r]=Vq[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Xq(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return(t||Object.keys(n).concat(Object.keys(r))).forEach(a),i}function Zq(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=Yq(r[e]||i[e],a)}return o(t),n.forEach(o),Yq(e,a)}function Qq(e,t){if(e.icons[t])return Zq(e,t,[]);let n=Xq(e,[t])[t];return n?Zq(e,t,n):null}var $q=/(-?[0-9.]*[0-9]+[0-9.]*)/g,eJ=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function tJ(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split($q);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=eJ.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function nJ(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function rJ(e,t){return e?`<defs>`+e+`</defs>`+t:t}function iJ(e,t,n){let r=nJ(e);return rJ(r.defs,t+r.content+n)}var aJ=e=>e===`unset`||e===`undefined`||e===`none`;function oJ(e,t){let n={...Hq,...e},r={...Gq,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=iJ(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=tJ(d,c/l)):(u=o===`auto`?c:o,d=s===null?tJ(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{aJ(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var sJ=/\sid="(\S+)"/g,cJ=new Map;function lJ(e){e=e.replace(/[0-9]+$/,``)||`a`;let t=cJ.get(e)||0;return cJ.set(e,t+1),t?`${e}${t}`:e}function uJ(e){let t=[],n;for(;n=sJ.exec(e);)t.push(n[1]);if(!t.length)return e;let r=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(t=>{let n=lJ(t),i=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+i+`)([")]|\\.[a-z])`,`g`),`$1`+n+r+`$3`)}),e=e.replace(new RegExp(r,`g`),``),e}function dJ(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function fJ(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pJ=fJ();function mJ(e){pJ=e}var hJ={exec:()=>null};function gJ(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(vJ.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var _J=(()=>{try{return!0}catch{return!1}})(),vJ={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},yJ=/^(?:[ \t]*(?:\n|$))+/,bJ=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xJ=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,SJ=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,CJ=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wJ=/(?:[*+-]|\d{1,9}[.)])/,TJ=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,EJ=gJ(TJ).replace(/bull/g,wJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),DJ=gJ(TJ).replace(/bull/g,wJ).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),OJ=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,kJ=/^[^\n]+/,AJ=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,jJ=gJ(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,AJ).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),MJ=gJ(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wJ).getRegex(),NJ=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,PJ=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,FJ=gJ(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,PJ).replace(`tag`,NJ).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),IJ=gJ(OJ).replace(`hr`,SJ).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,NJ).getRegex(),LJ={blockquote:gJ(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,IJ).getRegex(),code:bJ,def:jJ,fences:xJ,heading:CJ,hr:SJ,html:FJ,lheading:EJ,list:MJ,newline:yJ,paragraph:IJ,table:hJ,text:kJ},RJ=gJ(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,SJ).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,NJ).getRegex(),zJ={...LJ,lheading:DJ,table:RJ,paragraph:gJ(OJ).replace(`hr`,SJ).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,RJ).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,NJ).getRegex()},BJ={...LJ,html:gJ(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,PJ).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:hJ,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:gJ(OJ).replace(`hr`,SJ).replace(`heading`,` *#{1,6} *[^
391
+ ]`).replace(`lheading`,EJ).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},VJ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HJ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,UJ=/^( {2,}|\\)\n(?!\s*$)/,WJ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,GJ=/[\p{P}\p{S}]/u,KJ=/[\s\p{P}\p{S}]/u,qJ=/[^\s\p{P}\p{S}]/u,JJ=gJ(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,KJ).getRegex(),YJ=/(?!~)[\p{P}\p{S}]/u,XJ=/(?!~)[\s\p{P}\p{S}]/u,ZJ=/(?:[^\s\p{P}\p{S}]|~)/u,QJ=gJ(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,_J?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),$J=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,eY=gJ($J,`u`).replace(/punct/g,GJ).getRegex(),tY=gJ($J,`u`).replace(/punct/g,YJ).getRegex(),nY=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,rY=gJ(nY,`gu`).replace(/notPunctSpace/g,qJ).replace(/punctSpace/g,KJ).replace(/punct/g,GJ).getRegex(),iY=gJ(nY,`gu`).replace(/notPunctSpace/g,ZJ).replace(/punctSpace/g,XJ).replace(/punct/g,YJ).getRegex(),aY=gJ(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,qJ).replace(/punctSpace/g,KJ).replace(/punct/g,GJ).getRegex(),oY=gJ(/\\(punct)/,`gu`).replace(/punct/g,GJ).getRegex(),sY=gJ(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),cY=gJ(PJ).replace(`(?:-->|$)`,`-->`).getRegex(),lY=gJ(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,cY).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),uY=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,dY=gJ(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,uY).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),fY=gJ(/^!?\[(label)\]\[(ref)\]/).replace(`label`,uY).replace(`ref`,AJ).getRegex(),pY=gJ(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,AJ).getRegex(),mY=gJ(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,fY).replace(`nolink`,pY).getRegex(),hY=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gY={_backpedal:hJ,anyPunctuation:oY,autolink:sY,blockSkip:QJ,br:UJ,code:HJ,del:hJ,emStrongLDelim:eY,emStrongRDelimAst:rY,emStrongRDelimUnd:aY,escape:VJ,link:dY,nolink:pY,punctuation:JJ,reflink:fY,reflinkSearch:mY,tag:lY,text:WJ,url:hJ},_Y={...gY,link:gJ(/^!?\[(label)\]\((.*?)\)/).replace(`label`,uY).getRegex(),reflink:gJ(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,uY).getRegex()},vY={...gY,emStrongRDelimAst:iY,emStrongLDelim:tY,url:gJ(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,hY).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:gJ(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,hY).getRegex()},yY={...vY,br:gJ(UJ).replace(`{2,}`,`*`).getRegex(),text:gJ(vY.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},bY={normal:LJ,gfm:zJ,pedantic:BJ},xY={normal:gY,gfm:vY,breaks:yY,pedantic:_Y},SY={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},CY=e=>SY[e];function wY(e,t){if(t){if(vJ.escapeTest.test(e))return e.replace(vJ.escapeReplace,CY)}else if(vJ.escapeTestNoEncode.test(e))return e.replace(vJ.escapeReplaceNoEncode,CY);return e}function TY(e){try{e=encodeURI(e).replace(vJ.percentDecode,`%`)}catch{return null}return e}function EY(e,t){let n=e.replace(vJ.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(vJ.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(vJ.slashPipe,`|`);return n}function DY(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function OY(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function kY(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function AY(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
392
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
393
+ `)}var jY=class{options;rules;lexer;constructor(e){this.options=e||pJ}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:DY(e,`
394
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=AY(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=DY(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:DY(t[0],`
395
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=DY(t[0],`
396
+ `).split(`
397
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
398
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
399
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
400
+ ${s}`:s,r=r?`${r}
401
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
402
+ `+e.join(`
403
+ `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
404
+ `+e.join(`
405
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
406
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
407
+ `,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
408
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
409
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
410
+ `,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
411
+ `+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
412
+ `+l}!u&&!l.trim()&&(u=!0),r+=f+`
413
+ `,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=EY(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
414
+ `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(EY(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
415
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=DY(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=OY(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),kY(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return kY(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},MY=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||pJ,this.options.tokenizer=this.options.tokenizer||new jY,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:vJ,block:bY.normal,inline:xY.normal};this.options.pedantic?(t.block=bY.pedantic,t.inline=xY.pedantic):this.options.gfm&&(t.block=bY.gfm,this.options.breaks?t.inline=xY.breaks:t.inline=xY.gfm),this.tokenizer.rules=t}static get rules(){return{block:bY,inline:xY}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(vJ.carriageReturn,`
416
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(vJ.tabCharGlobal,` `).replace(vJ.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
417
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
418
+ `)?``:`
419
+ `)+r.raw,n.text+=`
420
+ `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
421
+ `)?``:`
422
+ `)+r.raw,n.text+=`
423
+ `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
424
+ `)?``:`
425
+ `)+r.raw,a.text+=`
426
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
427
+ `)?``:`
428
+ `)+r.raw,n.text+=`
429
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},NY=class{options;parser;constructor(e){this.options=e||pJ}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(vJ.notSpaceStart)?.[0],i=e.replace(vJ.endingNewline,``)+`
430
+ `;return r?`<pre><code class="language-`+wY(r)+`">`+(n?i:wY(i,!0))+`</code></pre>
431
+ `:`<pre><code>`+(n?i:wY(i,!0))+`</code></pre>
432
+ `}blockquote({tokens:e}){return`<blockquote>
433
+ ${this.parser.parse(e)}</blockquote>
434
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
435
+ `}hr(e){return`<hr>
436
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
437
+ `+r+`</`+i+`>
438
+ `}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+wY(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
439
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
440
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
441
+ <thead>
442
+ `+t+`</thead>
443
+ `+r+`</table>
444
+ `}tablerow({text:e}){return`<tr>
445
+ ${e}</tr>
446
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
447
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${wY(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=TY(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+wY(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=TY(e);if(i===null)return wY(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${wY(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:wY(e.text)}},PY=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},FY=class e{options;renderer;textRenderer;constructor(e){this.options=e||pJ,this.options.renderer=this.options.renderer||new NY,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new PY}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`def`:n+=this.renderer.def(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
448
+ `+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},IY=class{options;block;constructor(e){this.options=e||pJ}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?MY.lex:MY.lexInline}provideParser(){return this.block?FY.parse:FY.parseInline}},LY=new class{defaults=fJ();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=FY;Renderer=NY;TextRenderer=PY;Lexer=MY;Tokenizer=jY;Hooks=IY;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new NY(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new jY(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new IY;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];IY.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&IY.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return MY.lex(e,t??this.defaults)}parser(e,t){return FY.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?MY.lex:MY.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?FY.parse:FY.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?MY.lex:MY.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?FY.parse:FY.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
449
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+wY(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function RY(e,t){return LY.parse(e,t)}RY.options=RY.setOptions=function(e){return LY.setOptions(e),RY.defaults=LY.defaults,mJ(RY.defaults),RY},RY.getDefaults=fJ,RY.defaults=pJ,RY.use=function(...e){return LY.use(...e),RY.defaults=LY.defaults,mJ(RY.defaults),RY},RY.walkTokens=function(e,t){return LY.walkTokens(e,t)},RY.parseInline=LY.parseInline,RY.Parser=FY,RY.parser=FY.parse,RY.Renderer=NY,RY.TextRenderer=PY,RY.Lexer=MY,RY.lexer=MY.lex,RY.Tokenizer=jY,RY.Hooks=IY,RY.parse=RY,RY.options,RY.setOptions,RY.use,RY.walkTokens,RY.parseInline,FY.parse,MY.lex;function zY(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
450
+ [ ]{`+Math.min.apply(Math,r)+`}`,`g`);n=n.map(function(e){return e.replace(i,`
451
+ `)})}n[0]=n[0].replace(/^\r?\n/,``);var a=n[0];return t.forEach(function(e,t){var r=a.match(/(?:^|\n)( *)$/),i=r?r[1]:``,o=e;typeof e==`string`&&e.includes(`
452
+ `)&&(o=String(e).split(`
453
+ `).map(function(e,t){return t===0?e:``+i+e}).join(`
454
+ `)),a+=o+n[t+1]}),a}var BY={body:`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>`,height:80,width:80},VY=new Map,HY=new Map,UY=W(e=>{for(let t of e){if(!t.name)throw Error(`Invalid icon loader. Must have a "name" property with non-empty string value.`);if(G.debug(`Registering icon pack:`,t.name),`loader`in t)HY.set(t.name,t.loader);else if(`icons`in t)VY.set(t.name,t.icons);else throw G.error(`Invalid icon loader:`,t),Error(`Invalid icon loader. Must have either "icons" or "loader" property.`)}},`registerIconPacks`),WY=W(async(e,t)=>{let n=Kq(e,!0,t!==void 0);if(!n)throw Error(`Invalid icon name: ${e}`);let r=n.prefix||t;if(!r)throw Error(`Icon name must contain a prefix: ${e}`);let i=VY.get(r);if(!i){let e=HY.get(r);if(!e)throw Error(`Icon set not found: ${n.prefix}`);try{i={...await e(),prefix:r},VY.set(r,i)}catch(e){throw G.error(e),Error(`Failed to load icon set: ${n.prefix}`)}}let a=Qq(i,n.name);if(!a)throw Error(`Icon not found: ${e}`);return a},`getRegisteredIconData`),GY=W(async e=>{try{return await WY(e),!0}catch{return!1}},`isIconAvailable`),KY=W(async(e,t,n)=>{let r;try{r=await WY(e,t?.fallbackPrefix)}catch(e){G.error(e),r=BY}let i=oJ(r,t);return eL(dJ(uJ(i.body),{...i.attributes,...n}),RI())},`getIconSVG`);function qY(e,{markdownAutoWrap:t}){return zY(e.replace(/<br\/>/g,`
455
+ `).replace(/\n{2,}/g,`
456
+ `))}W(qY,`preprocessMarkdown`);function JY(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(e=>({content:e,type:`normal`}))??[])}W(JY,`nonMarkdownToLines`);function YY(e,t={}){let n=qY(e,t),r=RY.lexer(n),i=[[]],a=0;function o(e,t=`normal`){e.type===`text`?e.text.split(`
457
+ `).forEach((e,n)=>{n!==0&&(a++,i.push([])),e.split(` `).forEach(e=>{e=e.replace(/&#39;/g,`'`),e&&i[a].push({content:e,type:t})})}):e.type===`strong`||e.type===`em`?e.tokens.forEach(t=>{o(t,e.type)}):e.type===`html`&&i[a].push({content:e.text,type:`normal`})}return W(o,`processNode`),r.forEach(e=>{e.type===`paragraph`?e.tokens?.forEach(e=>{o(e)}):e.type===`html`?i[a].push({content:e.text,type:`normal`}):i[a].push({content:e.raw,type:`normal`})}),i}W(YY,`markdownToLines`);function XY(e){return e?`<p>${e.replace(/\\n|\n/g,`<br />`)}</p>`:``}W(XY,`nonMarkdownToHTML`);function ZY(e,{markdownAutoWrap:t}={}){let n=RY.lexer(e);function r(e){return e.type===`text`?t===!1?e.text.replace(/\n */g,`<br/>`).replace(/ /g,`&nbsp;`):e.text.replace(/\n */g,`<br/>`):e.type===`strong`?`<strong>${e.tokens?.map(r).join(``)}</strong>`:e.type===`em`?`<em>${e.tokens?.map(r).join(``)}</em>`:e.type===`paragraph`?`<p>${e.tokens?.map(r).join(``)}</p>`:e.type===`space`?``:e.type===`html`?`${e.text}`:e.type===`escape`?e.text:(G.warn(`Unsupported markdown: ${e.type}`),e.raw)}return W(r,`output`),n.map(r).join(``)}W(ZY,`markdownToHTML`);function QY(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(e=>e.segment):[...e]}W(QY,`splitTextToChars`);function $Y(e,t){return eX(e,[],QY(t.content),t.type)}W($Y,`splitWordToFitWidth`);function eX(e,t,n,r){if(n.length===0)return[{content:t.join(``),type:r},{content:``,type:r}];let[i,...a]=n,o=[...t,i];return e([{content:o.join(``),type:r}])?eX(e,o,a,r):(t.length===0&&i&&(t.push(i),n.shift()),[{content:t.join(``),type:r},{content:n.join(``),type:r}])}W(eX,`splitWordToFitWidthRecursion`);function tX(e,t){if(e.some(({content:e})=>e.includes(`
458
+ `)))throw Error(`splitLineToFitWidth does not support newlines in the line`);return nX(e,t)}W(tX,`splitLineToFitWidth`);function nX(e,t,n=[],r=[]){if(e.length===0)return r.length>0&&n.push(r),n.length>0?n:[];let i=``;e[0].content===` `&&(i=` `,e.shift());let a=e.shift()??{content:` `,type:`normal`},o=[...r];if(i!==``&&o.push({content:i,type:`normal`}),o.push(a),t(o))return nX(e,t,n,o);if(r.length>0)n.push(r),e.unshift(a);else if(a.content){let[r,i]=$Y(t,a);n.push([r]),i.content&&e.unshift(i)}return nX(e,t,n)}W(nX,`splitLineToFitWidthRecursion`);function rX(e,t){t&&e.attr(`style`,t)}W(rX,`applyStyle`);var iX=16384;async function aX(e,t,n,r,i=!1,a=RI()){let o=e.append(`foreignObject`);o.attr(`width`,`${Math.min(10*n,iX)}px`),o.attr(`height`,`${Math.min(10*n,iX)}px`);let s=o.append(`xhtml:div`),c=hL(t.label)?await vL(t.label.replace(yL.lineBreakRegex,`
459
+ `),a):eL(t.label,a),l=t.isNode?`nodeLabel`:`edgeLabel`,u=s.append(`span`);u.html(c),rX(u,t.labelStyle),u.attr(`class`,`${l} ${r}`),rX(s,t.labelStyle),s.style(`display`,`table-cell`),s.style(`white-space`,`nowrap`),s.style(`line-height`,`1.5`),n!==1/0&&(s.style(`max-width`,n+`px`),s.style(`text-align`,`center`)),s.attr(`xmlns`,`http://www.w3.org/1999/xhtml`),i&&s.attr(`class`,`labelBkg`);let d=s.node().getBoundingClientRect();return d.width===n&&(s.style(`display`,`table`),s.style(`white-space`,`break-spaces`),s.style(`width`,n+`px`),d=s.node().getBoundingClientRect()),o.node()}W(aX,`addHtmlSpan`);function oX(e,t,n,r=!1){let i=e.append(`tspan`).attr(`class`,`text-outer-tspan`).attr(`x`,0).attr(`y`,t*n-.1+`em`).attr(`dy`,n+`em`);return r&&i.attr(`text-anchor`,`middle`),i}W(oX,`createTspan`);function sX(e,t,n){let r=e.append(`text`),i=oX(r,1,t);dX(i,n);let a=i.node().getComputedTextLength();return r.remove(),a}W(sX,`computeWidthOfText`);function cX(e,t,n){let r=e.append(`text`),i=oX(r,1,t);dX(i,[{content:n,type:`normal`}]);let a=i.node()?.getBoundingClientRect();return a&&r.remove(),a}W(cX,`computeDimensionOfText`);function lX(e,t,n,r=!1,i=!1){let a=1.1,o=t.append(`g`),s=o.insert(`rect`).attr(`class`,`background`).attr(`style`,`stroke: none`),c=o.append(`text`).attr(`y`,`-10.1`);i&&c.attr(`text-anchor`,`middle`);let l=0;for(let t of n){let n=W(t=>sX(o,a,t)<=e,`checkWidth`),r=n(t)?[t]:tX(t,n);for(let e of r)dX(oX(c,l,a,i),e),l++}if(r){let e=c.node().getBBox();return s.attr(`x`,e.x-2).attr(`y`,e.y-2).attr(`width`,e.width+4).attr(`height`,e.height+4),o.node()}else return c.node()}W(lX,`createFormattedText`);function uX(e){return e.replace(/&(amp|lt|gt);/g,(e,t)=>{switch(t){case`amp`:return`&`;case`lt`:return`<`;case`gt`:return`>`;default:return e}})}W(uX,`decodeHTMLEntities`);function dX(e,t){e.text(``),t.forEach((t,n)=>{let r=e.append(`tspan`).attr(`font-style`,t.type===`em`?`italic`:`normal`).attr(`class`,`text-inner-tspan`).attr(`font-weight`,t.type===`strong`?`bold`:`normal`);n===0?r.text(uX(t.content)):r.text(` `+uX(t.content))})}W(dX,`updateTextContentAndStyles`);async function fX(e,t={}){let n=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(e,r,i)=>(n.push((async()=>{let n=`${r}:${i}`;return await GY(n)?await KY(n,void 0,{class:`label-icon`}):`<i class='${eL(e,t).replace(`:`,` `)}'></i>`})()),e));let r=await Promise.all(n);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>r.shift()??``)}W(fX,`replaceIconSubstring`);var pX=W(async(e,t=``,{style:n=``,isTitle:r=!1,classes:i=``,useHtmlLabels:a=!0,markdown:o=!0,isNode:s=!0,width:c=200,addSvgBackground:l=!1}={},u)=>{if(G.debug(`XYZ createText`,t,n,r,i,a,s,`addSvgBackground: `,l),a){let r=await fX(kq(o?ZY(t,u):XY(t)),u),a=t.replace(/\\\\/g,`\\`);return await aX(e,{isNode:s,label:hL(t)?a:r,labelStyle:n.replace(`fill:`,`color:`)},c,i,l,u)}else{let i=kq(t.replace(/<br\s*\/?>/g,`<br/>`)),a=lX(c,e,o?YY(i.replace(`<br>`,`<br/>`),u):JY(i),t?l:!1,!s);if(s){/stroke:/.exec(n)&&(n=n.replace(`stroke:`,`lineColor:`));let e=n.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/color:/g,`fill:`);gR(a).attr(`style`,e)}else{let e=n.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/background:/g,`fill:`);gR(a).select(`rect`).attr(`style`,e.replace(/background:/g,`fill:`));let t=n.replace(/stroke:[^;]+;?/g,``).replace(/stroke-width:[^;]+;?/g,``).replace(/fill:[^;]+;?/g,``).replace(/color:/g,`fill:`);gR(a).select(`text`).attr(`style`,t)}return r?gR(a).selectAll(`tspan.text-outer-tspan`).classed(`title-row`,!0):gR(a).selectAll(`tspan.text-outer-tspan`).classed(`row`,!0),a}},`createText`),mX=W(async(e,t,n)=>{let r,i=t.useHtmlLabels||OI(VL()?.htmlLabels);r=n||`node default`;let a=e.insert(`g`).attr(`class`,r).attr(`id`,t.domId||t.id),o=a.insert(`g`).attr(`class`,`label`).attr(`style`,jq(t.labelStyle)),s;s=t.label===void 0?``:typeof t.label==`string`?t.label:t.label[0];let c=!!t.icon||!!t.img,l=t.labelType===`markdown`,u=await pX(o,eL(kq(s),VL()),{useHtmlLabels:i,width:t.width||VL().flowchart?.wrappingWidth,classes:l?`markdown-node-label`:``,style:t.labelStyle,addSvgBackground:c,markdown:l},VL()),d=u.getBBox(),f=(t?.padding??0)/2;if(i){let e=u.children[0],t=gR(u);await Pq(e,s),d=e.getBoundingClientRect(),t.attr(`width`,d.width),t.attr(`height`,d.height)}return i?o.attr(`transform`,`translate(`+-d.width/2+`, `+-d.height/2+`)`):o.attr(`transform`,`translate(0, `+-d.height/2+`)`),t.centerLabel&&o.attr(`transform`,`translate(`+-d.width/2+`, `+-d.height/2+`)`),o.insert(`rect`,`:first-child`),{shapeSvg:a,bbox:d,halfPadding:f,label:o}},`labelHelper`),hX=W(async(e,t,n)=>{let r=n.useHtmlLabels??qI(VL()),i=e.insert(`g`).attr(`class`,`label`).attr(`style`,n.labelStyle||``),a=await pX(i,eL(kq(t),VL()),{useHtmlLabels:r,width:n.width||VL()?.flowchart?.wrappingWidth,style:n.labelStyle,addSvgBackground:!!n.icon||!!n.img}),o=a.getBBox(),s=n.padding/2;if(qI(VL())){let e=a.children[0],t=gR(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}return r?i.attr(`transform`,`translate(`+-o.width/2+`, `+-o.height/2+`)`):i.attr(`transform`,`translate(0, `+-o.height/2+`)`),n.centerLabel&&i.attr(`transform`,`translate(`+-o.width/2+`, `+-o.height/2+`)`),i.insert(`rect`,`:first-child`),{shapeSvg:e,bbox:o,halfPadding:s,label:i}},`insertLabel`),Q=W((e,t)=>{let n=t.node().getBBox();e.width=n.width,e.height=n.height},`updateNodeBounds`),gX=W((e,t)=>(e.look===`handDrawn`?`rough-node`:`node`)+` `+e.cssClasses+` `+(t||``),`getNodeClasses`);function _X(e){let t=e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`);return t.push(`Z`),t.join(` `)}W(_X,`createPathFromPoints`);function vX(e,t,n,r,i,a){let o=[],s=n-e,c=r-t,l=s/a,u=2*Math.PI/l,d=t+c/2;for(let t=0;t<=50;t++){let n=e+t/50*s,r=d+i*Math.sin(u*(n-e));o.push({x:n,y:r})}return o}W(vX,`generateFullSineWavePoints`);function yX(e,t,n,r,i,a){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}W(yX,`generateCirclePoints`);function bX(e){let t=Array.from(e.childNodes).filter(e=>e.tagName===`path`),n=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),r=t.map(e=>e.getAttribute(`d`)).filter(e=>e!==null).join(` `);n.setAttribute(`d`,r);let i=t.find(e=>e.getAttribute(`fill`)!==`none`),a=t.find(e=>e.getAttribute(`stroke`)!==`none`),o=W((e,t)=>e?.getAttribute(t)??void 0,`getAttr`);if(i){let e={fill:o(i,`fill`),"fill-opacity":o(i,`fill-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&n.setAttribute(e,t)})}if(a){let e={stroke:o(a,`stroke`),"stroke-width":o(a,`stroke-width`)??`1`,"stroke-opacity":o(a,`stroke-opacity`)??`1`};Object.entries(e).forEach(([e,t])=>{t&&n.setAttribute(e,t)})}let s=document.createElementNS(`http://www.w3.org/2000/svg`,`g`);return s.appendChild(n),s}W(bX,`mergePaths`);var xX=W((e,t)=>{var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2,c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=a===0?0:s*i/a,l=s):(i<0&&(o=-o),c=o,l=i===0?0:o*a/i),{x:n+c,y:r+l}},`intersectRect`),SX=W(async(e,t,n,r=!1,i=!1)=>{let a=t||``;typeof a==`object`&&(a=a[0]);let o=VL(),s=qI(o);return await pX(e,a,{style:n,isTitle:r,useHtmlLabels:s,markdown:!1,isNode:i,width:1/0},o)},`createLabel`),CX=W((e,t,n,r,i)=>[`M`,e+i,t,`H`,e+n-i,`A`,i,i,0,0,1,e+n,t+i,`V`,t+r-i,`A`,i,i,0,0,1,e+n-i,t+r,`H`,e+i,`A`,i,i,0,0,1,e,t+r-i,`V`,t+i,`A`,i,i,0,0,1,e+i,t,`Z`].join(` `),`createRoundedRectPathD`),wX=W(async(e,t)=>{G.info(`Creating subgraph rect for `,t.id,t);let n=VL(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,{labelStyles:s,nodeStyles:c,borderStyles:l,backgroundStyles:u}=X(t),d=e.insert(`g`).attr(`class`,`cluster `+t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),f=qI(n),p=d.insert(`g`).attr(`class`,`cluster-label `),m;m=t.labelType===`markdown`?await pX(p,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}):await SX(p,t.label,t.labelStyle||``,!1,!0);let h=m.getBBox();if(qI(n)){let e=m.children[0],t=gR(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}let g=t.width<=h.width+t.padding?h.width+t.padding:t.width;t.width<=h.width+t.padding?t.diff=(g-t.width)/2-t.padding:t.diff=-t.padding;let _=t.height,v=t.x-g/2,y=t.y-_/2;G.trace(`Data `,t,JSON.stringify(t));let b;if(t.look===`handDrawn`){let e=k.svg(d),n=Z(t,{roughness:.7,fill:a,stroke:o,fillWeight:3,seed:i}),r=e.path(CX(v,y,g,_,0),n);b=d.insert(()=>(G.debug(`Rough node insert CXC`,r),r),`:first-child`),b.select(`path:nth-child(2)`).attr(`style`,l.join(`;`)),b.select(`path`).attr(`style`,u.join(`;`).replace(`fill`,`stroke`))}else b=d.insert(`rect`,`:first-child`),b.attr(`style`,c).attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,v).attr(`y`,y).attr(`width`,g).attr(`height`,_);let{subGraphTitleTopMargin:x}=Nq(n);if(p.attr(`transform`,`translate(${t.x-h.width/2}, ${t.y-t.height/2+x})`),s){let e=p.select(`span`);e&&e.attr(`style`,s)}let S=b.node().getBBox();return t.offsetX=0,t.width=S.width,t.height=S.height,t.offsetY=h.height-t.padding/2,t.intersect=function(e){return xX(t,e)},{cluster:d,labelBBox:h}},`rect`),TX={rect:wX,squareRect:wX,roundedWithTitle:W(async(e,t)=>{let n=VL(),{themeVariables:r,handDrawnSeed:i}=n,{altBackground:a,compositeBackground:o,compositeTitleBackground:s,nodeBorder:c}=r,l=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-id`,t.id).attr(`data-look`,t.look),u=l.insert(`g`,`:first-child`),d=l.insert(`g`).attr(`class`,`cluster-label`),f=l.append(`rect`),p=await SX(d,t.label,t.labelStyle,void 0,!0),m=p.getBBox();if(qI(n)){let e=p.children[0],t=gR(p);m=e.getBoundingClientRect(),t.attr(`width`,m.width),t.attr(`height`,m.height)}let h=0*t.padding,g=h/2,_=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+h;t.width<=m.width+t.padding?t.diff=(_-t.width)/2-t.padding:t.diff=-t.padding;let v=t.height+h,y=t.height+h-m.height-6,b=t.x-_/2,x=t.y-v/2;t.width=_;let S=t.y-t.height/2-g+m.height+2,C;if(t.look===`handDrawn`){let e=t.cssClasses.includes(`statediagram-cluster-alt`),n=k.svg(l),r=t.rx||t.ry?n.path(CX(b,x,_,v,10),{roughness:.7,fill:s,fillStyle:`solid`,stroke:c,seed:i}):n.rectangle(b,x,_,v,{seed:i});C=l.insert(()=>r,`:first-child`);let u=n.rectangle(b,S,_,y,{fill:e?a:o,fillStyle:e?`hachure`:`solid`,stroke:c,seed:i});C=l.insert(()=>r,`:first-child`),f=l.insert(()=>u)}else C=u.insert(`rect`,`:first-child`),C.attr(`class`,`outer`).attr(`x`,b).attr(`y`,x).attr(`width`,_).attr(`height`,v).attr(`data-look`,t.look),f.attr(`class`,`inner`).attr(`x`,b).attr(`y`,S).attr(`width`,_).attr(`height`,y);return d.attr(`transform`,`translate(${t.x-m.width/2}, ${x+1-(qI(n)?0:3)})`),t.height=C.node().getBBox().height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(e){return xX(t,e)},{cluster:l,labelBBox:m}},`roundedWithTitle`),noteGroup:W((e,t)=>{let n=e.insert(`g`).attr(`class`,`note-cluster`).attr(`id`,t.domId),r=n.insert(`rect`,`:first-child`),i=0*t.padding,a=i/2;r.attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,t.x-t.width/2-a).attr(`y`,t.y-t.height/2-a).attr(`width`,t.width+i).attr(`height`,t.height+i).attr(`fill`,`none`);let o=r.node().getBBox();return t.width=o.width,t.height=o.height,t.intersect=function(e){return xX(t,e)},{cluster:n,labelBBox:{width:0,height:0}}},`noteGroup`),divider:W((e,t)=>{let{themeVariables:n,handDrawnSeed:r}=VL(),{nodeBorder:i}=n,a=e.insert(`g`).attr(`class`,t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),o=a.insert(`g`,`:first-child`),s=0*t.padding,c=t.width+s;t.diff=-t.padding;let l=t.height+s,u=t.x-c/2,d=t.y-l/2;t.width=c;let f;if(t.look===`handDrawn`){let e=k.svg(a).rectangle(u,d,c,l,{fill:`lightgrey`,roughness:.5,strokeLineDash:[5],stroke:i,seed:r});f=a.insert(()=>e,`:first-child`)}else{f=o.insert(`rect`,`:first-child`);let e=`outer`;e=(t.look,`divider`),f.attr(`class`,e).attr(`x`,u).attr(`y`,d).attr(`width`,c).attr(`height`,l).attr(`data-look`,t.look)}return t.height=f.node().getBBox().height,t.offsetX=0,t.offsetY=0,t.intersect=function(e){return xX(t,e)},{cluster:a,labelBBox:{}}},`divider`),kanbanSection:W(async(e,t)=>{G.info(`Creating subgraph rect for `,t.id,t);let n=VL(),{themeVariables:r,handDrawnSeed:i}=n,{clusterBkg:a,clusterBorder:o}=r,{labelStyles:s,nodeStyles:c,borderStyles:l,backgroundStyles:u}=X(t),d=e.insert(`g`).attr(`class`,`cluster `+t.cssClasses).attr(`id`,t.domId).attr(`data-look`,t.look),f=qI(n),p=d.insert(`g`).attr(`class`,`cluster-label `),m=await pX(p,t.label,{style:t.labelStyle,useHtmlLabels:f,isNode:!0,width:t.width}),h=m.getBBox();if(qI(n)){let e=m.children[0],t=gR(m);h=e.getBoundingClientRect(),t.attr(`width`,h.width),t.attr(`height`,h.height)}let g=t.width<=h.width+t.padding?h.width+t.padding:t.width;t.width<=h.width+t.padding?t.diff=(g-t.width)/2-t.padding:t.diff=-t.padding;let _=t.height,v=t.x-g/2,y=t.y-_/2;G.trace(`Data `,t,JSON.stringify(t));let b;if(t.look===`handDrawn`){let e=k.svg(d),n=Z(t,{roughness:.7,fill:a,stroke:o,fillWeight:4,seed:i}),r=e.path(CX(v,y,g,_,t.rx),n);b=d.insert(()=>(G.debug(`Rough node insert CXC`,r),r),`:first-child`),b.select(`path:nth-child(2)`).attr(`style`,l.join(`;`)),b.select(`path`).attr(`style`,u.join(`;`).replace(`fill`,`stroke`))}else b=d.insert(`rect`,`:first-child`),b.attr(`style`,c).attr(`rx`,t.rx).attr(`ry`,t.ry).attr(`x`,v).attr(`y`,y).attr(`width`,g).attr(`height`,_);let{subGraphTitleTopMargin:x}=Nq(n);if(p.attr(`transform`,`translate(${t.x-h.width/2}, ${t.y-t.height/2+x})`),s){let e=p.select(`span`);e&&e.attr(`style`,s)}let S=b.node().getBBox();return t.offsetX=0,t.width=S.width,t.height=S.height,t.offsetY=h.height-t.padding/2,t.intersect=function(e){return xX(t,e)},{cluster:d,labelBBox:h}},`kanbanSection`)},EX=new Map,DX=W(async(e,t)=>{let n=await TX[t.shape||`rect`](e,t);return EX.set(t.id,n),n},`insertCluster`),OX=W(()=>{EX=new Map},`clear`);function kX(e,t){return e.intersect(t)}W(kX,`intersectNode`);var AX=kX;function jX(e,t,n,r){var i=e.x,a=e.y,o=i-r.x,s=a-r.y,c=Math.sqrt(t*t*s*s+n*n*o*o),l=Math.abs(t*n*o/c);r.x<i&&(l=-l);var u=Math.abs(t*n*s/c);return r.y<a&&(u=-u),{x:i+l,y:a+u}}W(jX,`intersectEllipse`);var MX=jX;function NX(e,t,n){return MX(e,t,t,n)}W(NX,`intersectCircle`);var PX=NX;function FX(e,t,n,r){{let i=t.y-e.y,a=e.x-t.x,o=t.x*e.y-e.x*t.y,s=i*n.x+a*n.y+o,c=i*r.x+a*r.y+o,l=1e-6;if(s!==0&&c!==0&&IX(s,c))return;let u=r.y-n.y,d=n.x-r.x,f=r.x*n.y-n.x*r.y,p=u*e.x+d*e.y+f,m=u*t.x+d*t.y+f;if(Math.abs(p)<l&&Math.abs(m)<l&&IX(p,m))return;let h=i*d-u*a;if(h===0)return;let g=Math.abs(h/2),_=a*f-d*o,v=_<0?(_-g)/h:(_+g)/h;return _=u*o-i*f,{x:v,y:_<0?(_-g)/h:(_+g)/h}}}W(FX,`intersectLine`);function IX(e,t){return e*t>0}W(IX,`sameSign`);var LX=FX;function RX(e,t,n){let r=e.x,i=e.y,a=[],o=1/0,s=1/0;typeof t.forEach==`function`?t.forEach(function(e){o=Math.min(o,e.x),s=Math.min(s,e.y)}):(o=Math.min(o,t.x),s=Math.min(s,t.y));let c=r-e.width/2-o,l=i-e.height/2-s;for(let r=0;r<t.length;r++){let i=t[r],o=t[r<t.length-1?r+1:0],s=LX(e,n,{x:c+i.x,y:l+i.y},{x:c+o.x,y:l+o.y});s&&a.push(s)}return a.length?(a.length>1&&a.sort(function(e,t){let r=e.x-n.x,i=e.y-n.y,a=Math.sqrt(r*r+i*i),o=t.x-n.x,s=t.y-n.y,c=Math.sqrt(o*o+s*s);return a<c?-1:a===c?0:1}),a[0]):e}W(RX,`intersectPolygon`);var $={node:AX,circle:PX,ellipse:MX,polygon:RX,rect:xX};function zX(e,t){let{labelStyles:n}=X(t);t.labelStyle=n;let r=gX(t),i=r;r||(i=`anchor`);let a=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),{cssStyles:o}=t,s=k.svg(a),c=Z(t,{fill:`black`,stroke:`none`,fillStyle:`solid`});t.look!==`handDrawn`&&(c.roughness=0);let l=s.circle(0,0,2,c),u=a.insert(()=>l,`:first-child`);return u.attr(`class`,`anchor`).attr(`style`,jq(o)),Q(t,u),t.intersect=function(e){return G.info(`Circle intersect`,t,1,e),$.circle(t,1,e)},a}W(zX,`anchor`);function BX(e,t,n,r,i,a,o){let s=(e+n)/2,c=(t+r)/2,l=Math.atan2(r-t,n-e),u=(n-e)/2,d=(r-t)/2,f=u/i,p=d/a,m=Math.sqrt(f**2+p**2);if(m>1)throw Error(`The given radii are too small to create an arc between the points.`);let h=Math.sqrt(1-m**2),g=s+h*a*Math.sin(l)*(o?-1:1),_=c-h*i*Math.cos(l)*(o?-1:1),v=Math.atan2((t-_)/a,(e-g)/i),y=Math.atan2((r-_)/a,(n-g)/i)-v;o&&y<0&&(y+=2*Math.PI),!o&&y>0&&(y-=2*Math.PI);let b=[];for(let e=0;e<20;e++){let t=v+e/19*y,n=g+i*Math.cos(t),r=_+a*Math.sin(t);b.push({x:n,y:r})}return b}W(BX,`generateArcPoints`);function VX(e,t,n){let[r,i]=[t,n].sort((e,t)=>t-e);return i*(1-Math.sqrt(1-(e/r/2)**2))}W(VX,`calculateArcSagitta`);async function HX(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=W(e=>e+o,`calcTotalHeight`),c=W(e=>{let t=e/2;return[t/(2.5+e/50),t]},`calcEllipseRadius`),{shapeSvg:l,bbox:u}=await mX(e,t,gX(t)),d=s(t?.height?t?.height:u.height),[f,p]=c(d),m=VX(d,f,p),h=(t?.width?t?.width:u.width)+a*2+m-m,g=d,{cssStyles:_}=t,v=[{x:h/2,y:-g/2},{x:-h/2,y:-g/2},...BX(-h/2,-g/2,-h/2,g/2,f,p,!1),{x:h/2,y:g/2},...BX(h/2,g/2,h/2,-g/2,f,p,!0)],y=k.svg(l),b=Z(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=_X(v),S=y.path(x,b),C=l.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(${f/2}, 0)`),Q(t,C),t.intersect=function(e){return $.polygon(t,v,e)},l}W(HX,`bowTieRect`);function UX(e,t,n,r){return e.insert(`polygon`,`:first-child`).attr(`points`,r.map(function(e){return e.x+`,`+e.y}).join(` `)).attr(`class`,`label-container`).attr(`transform`,`translate(`+-t/2+`,`+n/2+`)`)}W(UX,`insertPolygonShape`);var WX=12;async function GX(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?28:i,o=t.look===`neo`?24:i,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.width??c.width)+(t.look===`neo`?a*2:a+WX),u=(t?.height??c.height)+(t.look===`neo`?o*2:o),d=l,f=-u,p=[{x:0+WX,y:f},{x:d,y:f},{x:d,y:0},{x:0,y:0},{x:0,y:f+WX},{x:0+WX,y:f}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=k.svg(s),n=Z(t,{}),r=_X(p),i=e.path(r,n);m=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=UX(s,l,u,p);return r&&m.attr(`style`,r),Q(t,m),t.intersect=function(e){return $.polygon(t,p,e)},s}W(GX,`card`);function KX(e,t){let{nodeStyles:n}=X(t);t.label=``;let r=e.insert(`g`).attr(`class`,gX(t)).attr(`id`,t.domId??t.id),{cssStyles:i}=t,a=Math.max(28,t.width??0),o=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],s=k.svg(r),c=Z(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=_X(o),u=s.path(l,c),d=r.insert(()=>u,`:first-child`);return i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),n&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,n),t.width=28,t.height=28,t.intersect=function(e){return $.polygon(t,o,e)},r}W(KX,`choice`);async function qX(e,t,n){let{labelStyles:r,nodeStyles:i}=X(t);t.labelStyle=r;let{shapeSvg:a,bbox:o,halfPadding:s}=await mX(e,t,gX(t)),c=n?.padding??s,l=t.look===`neo`?o.width/2+32:o.width/2+c,u,{cssStyles:d}=t;if(t.look===`handDrawn`){let e=k.svg(a),n=Z(t,{}),r=e.circle(0,0,l*2,n);u=a.insert(()=>r,`:first-child`),u.attr(`class`,`basic label-container`).attr(`style`,jq(d))}else u=a.insert(`circle`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,i).attr(`r`,l).attr(`cx`,0).attr(`cy`,0);return Q(t,u),t.calcIntersect=function(e,t){let n=e.width/2;return $.circle(e,n,t)},t.intersect=function(e){return G.info(`Circle intersect`,t,l,e),$.circle(t,l,e)},a}W(qX,`circle`);function JX(e){let t=Math.cos(Math.PI/4),n=Math.sin(Math.PI/4),r=e*2,i={x:r/2*t,y:r/2*n},a={x:-(r/2)*t,y:r/2*n},o={x:-(r/2)*t,y:-(r/2)*n},s={x:r/2*t,y:-(r/2)*n};return`M ${a.x},${a.y} L ${s.x},${s.y}
460
+ M ${i.x},${i.y} L ${o.x},${o.y}`}W(JX,`createLine`);function YX(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n,t.label=``;let i=e.insert(`g`).attr(`class`,gX(t)).attr(`id`,t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:o}=t,s=k.svg(i),c=Z(t,{});t.look!==`handDrawn`&&(c.roughness=0,c.fillStyle=`solid`);let l=s.circle(0,0,a*2,c),u=JX(a),d=s.path(u,c),f=i.insert(()=>l,`:first-child`);return f.insert(()=>d),f.attr(`class`,`outer-path`),o&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,o),r&&t.look!==`handDrawn`&&f.selectAll(`path`).attr(`style`,r),Q(t,f),t.intersect=function(e){return G.info(`crossedCircle intersect`,t,{radius:a,point:e}),$.circle(t,a,e)},i}W(YX,`crossedCircle`);function XX(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}W(XX,`generateCirclePoints`);async function ZX(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await mX(e,t,gX(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+s,u=a.height+c,d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...XX(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...XX(l/2+d*2,-d,d,20,-180,-270),...XX(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...XX(l/2,u/2,d,20,0,90)],m=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...XX(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...XX(l/2+l*.1,-d,d,20,-180,-270),...XX(l/2+l*.1,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...XX(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2,y:u/2+d}],h=k.svg(i),g=Z(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=_X(p).replace(`Z`,``),v=h.path(_,g),y=_X(m),b=h.path(y,{...g}),x=i.insert(`g`,`:first-child`);return x.insert(()=>b,`:first-child`).attr(`stroke-opacity`,0),x.insert(()=>v,`:first-child`),x.attr(`class`,`text`),f&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(${d}, 0)`),o.attr(`transform`,`translate(${-l/2+d-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Q(t,x),t.intersect=function(e){return $.polygon(t,m,e)},i}W(ZX,`curlyBraceLeft`);function QX(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:a,y:l})}return o}W(QX,`generateCirclePoints`);async function $X(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await mX(e,t,gX(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...QX(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...QX(l/2+d*2,-d,d,20,-180,-270),...QX(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...QX(l/2,u/2,d,20,0,90)],m=[{x:-l/2,y:-u/2-d},{x:l/2,y:-u/2-d},...QX(l/2,-u/2,d,20,-90,0),{x:l/2+d,y:-d},...QX(l/2+d*2,-d,d,20,-180,-270),...QX(l/2+d*2,d,d,20,-90,-180),{x:l/2+d,y:u/2},...QX(l/2,u/2,d,20,0,90),{x:l/2,y:u/2+d},{x:-l/2,y:u/2+d}],h=k.svg(i),g=Z(t,{fill:`none`});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=_X(p).replace(`Z`,``),v=h.path(_,g),y=_X(m),b=h.path(y,{...g}),x=i.insert(`g`,`:first-child`);return x.insert(()=>b,`:first-child`).attr(`stroke-opacity`,0),x.insert(()=>v,`:first-child`),x.attr(`class`,`text`),f&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(${-d}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Q(t,x),t.intersect=function(e){return $.polygon(t,m,e)},i}W($X,`curlyBraceRight`);function eZ(e,t,n,r=100,i=0,a=180){let o=[],s=i*Math.PI/180,c=(a*Math.PI/180-s)/(r-1);for(let i=0;i<r;i++){let r=s+i*c,a=e+n*Math.cos(r),l=t+n*Math.sin(r);o.push({x:-a,y:-l})}return o}W(eZ,`generateCirclePoints`);async function tZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await mX(e,t,gX(t)),s=t.look===`neo`?18:t.padding??0,c=t.look===`neo`?12:t.padding??0,l=a.width+(t.look===`neo`?s*2:s),u=a.height+(t.look===`neo`?c*2:c),d=Math.max(5,u*.1),{cssStyles:f}=t,p=[...eZ(l/2,-u/2,d,30,-90,0),{x:-l/2-d,y:d},...eZ(l/2+d*2,-d,d,20,-180,-270),...eZ(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:-u/2},...eZ(l/2,u/2,d,20,0,90)],m=[...eZ(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...eZ(-l/2-d/2,-d,d,20,0,90),...eZ(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...eZ(-l/2+d+d/2,u/2,d,30,-180,-270)],h=[{x:l/2,y:-u/2-d},{x:-l/2,y:-u/2-d},...eZ(l/2,-u/2,d,20,-90,0),{x:-l/2-d,y:-d},...eZ(l/2+d*2,-d,d,20,-180,-270),...eZ(l/2+d*2,d,d,20,-90,-180),{x:-l/2-d,y:u/2},...eZ(l/2,u/2,d,20,0,90),{x:-l/2,y:u/2+d},{x:l/2-d-d/2,y:u/2+d},...eZ(-l/2+d+d/2,-u/2,d,20,-90,-180),{x:l/2-d/2,y:d},...eZ(-l/2-d/2,-d,d,20,0,90),...eZ(-l/2-d/2,d,d,20,-90,0),{x:l/2-d/2,y:-d},...eZ(-l/2+d+d/2,u/2,d,30,-180,-270)],g=k.svg(i),_=Z(t,{fill:`none`});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=_X(p).replace(`Z`,``),y=g.path(v,_),b=_X(m).replace(`Z`,``),x=g.path(b,_),S=_X(h),C=g.path(S,{..._}),w=i.insert(`g`,`:first-child`);return w.insert(()=>C,`:first-child`).attr(`stroke-opacity`,0),w.insert(()=>y,`:first-child`),w.insert(()=>x,`:first-child`),w.attr(`class`,`text`),f&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(${d-d/4}, 0)`),o.attr(`transform`,`translate(${-l/2+(t.padding??0)/2-(a.x-(a.left??0))},${-u/2+(t.padding??0)/2-(a.y-(a.top??0))})`),Q(t,w),t.intersect=function(e){return $.polygon(t,h,e)},i}W(tZ,`curlyBraces`);async function nZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=Math.max(20,(c.width+a*2)*1.25,t?.width??0),u=Math.max(5,c.height+o*2,t?.height??0),d=u/2,{cssStyles:f}=t,p=k.svg(s),m=Z(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=l,g=u,_=h-d,v=g/4,y=[{x:_,y:0},{x:v,y:0},{x:0,y:g/2},{x:v,y:g},{x:_,y:g},...yX(-_,-g/2,d,50,270,90)],b=_X(y),x=p.path(b,m),S=s.insert(()=>x,`:first-child`);return S.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,r),S.attr(`transform`,`translate(${-l/2}, ${-u/2})`),Q(t,S),t.intersect=function(e){return $.polygon(t,y,e)},s}W(nZ,`curvedTrapezoid`);var rZ=W((e,t,n,r,i,a)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createCylinderPathD`),iZ=W((e,t,n,r,i,a)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`].join(` `),`createOuterCylinderPathD`),aZ=W((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),oZ=8,sZ=8;async function cZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?24:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-o,t.width<sZ&&(t.width=sZ);let n=e/2/(2.5+e/50);t.height=(t.height??0)-a-n*3,t.height<oZ&&(t.height=oZ)}let{shapeSvg:s,bbox:c,label:l}=await mX(e,t,gX(t)),u=(t.width?t.width:c.width)+o,d=u/2,f=d/(2.5+u/50),p=(t.height?t.height:c.height)+a+f,m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=k.svg(s),n=iZ(0,0,u,p,d,f),r=aZ(0,f,u,p,d,f),i=Z(t,{}),a=e.path(n,i),o=e.path(r,Z(t,{fill:`none`}));m=s.insert(()=>o,`:first-child`),m=s.insert(()=>a,`:first-child`),m.attr(`class`,`basic label-container`),h&&m.attr(`style`,h)}else{let e=rZ(0,0,u,p,d,f);m=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,jq(h)).attr(`style`,r)}return m.attr(`label-offset-y`,f),m.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),Q(t,m),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(e){let n=$.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}W(cZ,`cylinder`);async function lZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?16:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await mX(e,t,gX(t)),l=s.width+i,u=s.height+a,d=u*.2,f=-l/2,p=-u/2-d/2,{cssStyles:m}=t,h=k.svg(o),g=Z(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:f,y:p+d},{x:-f,y:p+d},{x:-f,y:-p},{x:f,y:-p},{x:f,y:p},{x:-f,y:p},{x:-f,y:p+d}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=o.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${f+(t.padding??0)/2-(s.x-(s.left??0))}, ${p+d+(t.padding??0)/2-(s.y-(s.top??0))})`),Q(t,y),t.intersect=function(e){return $.rect(t,e)},o}W(lZ,`dividedRectangle`);async function uZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t),i=t.look===`neo`?12:5;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?16:a,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.width?t?.width/2:c.width/2)+(o??0),u=l-i,d,{cssStyles:f}=t;if(t.look===`handDrawn`){let e=k.svg(s),n=Z(t,{roughness:.2,strokeWidth:2.5}),r=Z(t,{roughness:.2,strokeWidth:1.5}),i=e.circle(0,0,l*2,n),a=e.circle(0,0,u*2,r);d=s.insert(`g`,`:first-child`),d.attr(`class`,jq(t.cssClasses)).attr(`style`,jq(f)),d.node()?.appendChild(i),d.node()?.appendChild(a)}else{d=s.insert(`g`,`:first-child`);let e=d.insert(`circle`,`:first-child`),t=d.insert(`circle`);d.attr(`class`,`basic label-container`).attr(`style`,r),e.attr(`class`,`outer-circle`).attr(`style`,r).attr(`r`,l).attr(`cx`,0).attr(`cy`,0),t.attr(`class`,`inner-circle`).attr(`style`,r).attr(`r`,u).attr(`cx`,0).attr(`cy`,0)}return Q(t,d),t.intersect=function(e){return G.info(`DoubleCircle intersect`,t,l,e),$.circle(t,l,e)},s}W(uZ,`doublecircle`);function dZ(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=X(t);t.label=``,t.labelStyle=r;let a=e.insert(`g`).attr(`class`,gX(t)).attr(`id`,t.domId??t.id),{cssStyles:o}=t,s=k.svg(a),{nodeBorder:c}=n,l=Z(t,{fillStyle:`solid`});t.look!==`handDrawn`&&(l.roughness=0);let u=s.circle(0,0,14,l),d=a.insert(()=>u,`:first-child`);return d.selectAll(`path`).attr(`style`,`fill: ${c} !important;`),o&&o.length>0&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,o),i&&t.look!==`handDrawn`&&d.selectAll(`path`).attr(`style`,i),Q(t,d),t.intersect=function(e){return G.info(`filledCircle intersect`,t,{radius:7,point:e}),$.circle(t,7,e)},a}W(dZ,`filledCircle`);var fZ=10,pZ=10;async function mZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?i*2:i;(t.width||t.height)&&(t.height=t?.height??0,t.height<fZ&&(t.height=fZ),t.width=(t?.width??0)-a-a/2,t.width<pZ&&(t.width=pZ));let{shapeSvg:o,bbox:s,label:c}=await mX(e,t,gX(t)),l=(t?.width?t?.width:s.width)+(a??0),u=t?.height?t?.height:l+s.height,d=u,f=[{x:0,y:-u},{x:d,y:-u},{x:d/2,y:0}],{cssStyles:p}=t,m=k.svg(o),h=Z(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=_X(f),_=m.path(g,h),v=o.insert(()=>_,`:first-child`).attr(`transform`,`translate(${-u/2}, ${u/2})`).attr(`class`,`outer-path`);return p&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),t.width=l,t.height=u,Q(t,v),c.attr(`transform`,`translate(${-s.width/2-(s.x-(s.left??0))}, ${-u/2+(t.padding??0)/2+(s.y-(s.top??0))})`),t.intersect=function(e){return G.info(`Triangle intersect`,t,f,e),$.polygon(t,f,e)},o}W(mZ,`flippedTriangle`);function hZ(e,t,{dir:n,config:{state:r,themeVariables:i}}){let{nodeStyles:a}=X(t);t.label=``;let o=e.insert(`g`).attr(`class`,gX(t)).attr(`id`,t.domId??t.id),{cssStyles:s}=t,c=Math.max(70,t?.width??0),l=Math.max(10,t?.height??0);n===`LR`&&(c=Math.max(10,t?.width??0),l=Math.max(70,t?.height??0));let u=-1*c/2,d=-1*l/2,f=k.svg(o),p=Z(t,{stroke:i.lineColor,fill:i.lineColor});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=f.rectangle(u,d,c,l,p),h=o.insert(()=>m,`:first-child`);s&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,s),a&&t.look!==`handDrawn`&&h.selectAll(`path`).attr(`style`,a),Q(t,h);let g=r?.padding??0;return t.width&&t.height&&(t.width+=g/2||0,t.height+=g/2||0),t.intersect=function(e){return $.rect(t,e)},o}W(hZ,`forkJoin`);async function gZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-a*2,t.height<10&&(t.height=10),t.width=(t?.width??0)-i*2,t.width<15&&(t.width=15));let{shapeSvg:o,bbox:s}=await mX(e,t,gX(t)),c=(t?.width?t?.width:Math.max(15,s.width))+i*2,l=(t?.height?t?.height:Math.max(10,s.height))+a*2,u=l/2,{cssStyles:d}=t,f=k.svg(o),p=Z(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-c/2,y:-l/2},{x:c/2-u,y:-l/2},...yX(-c/2+u,0,u,50,90,270),{x:c/2-u,y:l/2},{x:-c/2,y:l/2}],h=_X(m),g=f.path(h,p),_=o.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,r),Q(t,_),t.intersect=function(e){return G.info(`Pill intersect`,t,{radius:u,point:e}),$.polygon(t,m,e)},o}W(gZ,`halfRoundedRectangle`);var _Z=W((e,t,n,r,i)=>[`M${e+i},${t}`,`L${e+n-i},${t}`,`L${e+n},${t-r/2}`,`L${e+n-i},${t-r}`,`L${e+i},${t-r}`,`L${e},${t-r/2}`,`Z`].join(` `),`createHexagonPathD`);async function vZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t),i=t.look===`neo`?3.5:4;t.labelStyle=n;let a=t.padding??0,o=t.look===`neo`?70:a,s=t.look===`neo`?32:a;if(t.width||t.height){let e=(t.height??0)/i;t.width=(t?.width??0)-2*e-s,t.height=(t.height??0)-o}let{shapeSvg:c,bbox:l}=await mX(e,t,gX(t)),u=(t?.height?t?.height:l.height)+o,d=u/i,f=(t?.width?t?.width:l.width)+2*d+s,p=[{x:d,y:0},{x:f-d,y:0},{x:f,y:-u/2},{x:f-d,y:-u},{x:d,y:-u},{x:0,y:-u/2}],m,{cssStyles:h}=t;if(t.look===`handDrawn`){let e=k.svg(c),n=Z(t,{}),r=_Z(0,0,f,u,d),i=e.path(r,n);m=c.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-f/2}, ${u/2})`),h&&m.attr(`style`,h)}else m=UX(c,f,u,p);return r&&m.attr(`style`,r),t.width=f,t.height=u,Q(t,m),t.intersect=function(e){return $.polygon(t,p,e)},c}W(vZ,`hexagon`);async function yZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.label=``,t.labelStyle=n;let{shapeSvg:i}=await mX(e,t,gX(t)),a=Math.max(30,t?.width??0),o=Math.max(30,t?.height??0),{cssStyles:s}=t,c=k.svg(i),l=Z(t,{});t.look!==`handDrawn`&&(l.roughness=0,l.fillStyle=`solid`);let u=[{x:0,y:0},{x:a,y:0},{x:0,y:o},{x:a,y:o}],d=_X(u),f=c.path(d,l),p=i.insert(()=>f,`:first-child`);return p.attr(`class`,`basic label-container outer-path`),s&&t.look!==`handDrawn`&&p.selectChildren(`path`).attr(`style`,s),r&&t.look!==`handDrawn`&&p.selectChildren(`path`).attr(`style`,r),p.attr(`transform`,`translate(${-a/2}, ${-o/2})`),Q(t,p),t.intersect=function(e){return G.info(`Pill intersect`,t,{points:u}),$.polygon(t,u,e)},i}W(yZ,`hourglass`);async function bZ(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=X(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=r?.wrappingWidth;t.width=Math.max(s,c??0);let{shapeSvg:l,bbox:u,label:d}=await mX(e,t,`icon-shape default`),f=t.pos===`t`,p=s,m=s,{nodeBorder:h}=n,{stylesMap:g}=Iq(t),_=-m/2,v=-p/2,y=t.label?8:0,b=k.svg(l),x=Z(t,{stroke:`none`,fill:`none`});t.look!==`handDrawn`&&(x.roughness=0,x.fillStyle=`solid`);let S=b.rectangle(_,v,m,p,x),C=Math.max(m,u.width),w=p+u.height+y,T=b.rectangle(-C/2,-w/2,C,w,{...x,fill:`transparent`,stroke:`none`}),E=l.insert(()=>S,`:first-child`),D=l.insert(()=>T);if(t.icon){let e=l.append(`g`);e.html(`<g>${await KY(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${f?u.height/2+y/2-i/2-o:-u.height/2-y/2-i/2-o})`),e.attr(`style`,`color: ${g.get(`stroke`)??h};`)}return d.attr(`transform`,`translate(${-u.width/2-(u.x-(u.left??0))},${f?-w/2:w/2-u.height})`),E.attr(`transform`,`translate(0,${f?u.height/2+y/2:-u.height/2-y/2})`),Q(t,D),t.intersect=function(e){if(G.info(`iconSquare intersect`,t,e),!t.label)return $.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=f?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+y},{x:n+m/2,y:r-i/2+u.height+y},{x:n+m/2,y:r+i/2},{x:n-m/2,y:r+i/2},{x:n-m/2,y:r-i/2+u.height+y},{x:n-u.width/2,y:r-i/2+u.height+y}]:[{x:n-m/2,y:r-i/2},{x:n+m/2,y:r-i/2},{x:n+m/2,y:r-i/2+p},{x:n+u.width/2,y:r-i/2+p},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+p},{x:n-m/2,y:r-i/2+p}],$.polygon(t,a,e)},l}W(bZ,`icon`);async function xZ(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=X(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=r?.wrappingWidth;t.width=Math.max(s,c??0);let{shapeSvg:l,bbox:u,label:d}=await mX(e,t,`icon-shape default`),f=t.label?8:0,p=t.pos===`t`,{nodeBorder:m,mainBkg:h}=n,{stylesMap:g}=Iq(t),_=k.svg(l),v=Z(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`),v.stroke=g.get(`fill`)??h;let y=l.append(`g`);t.icon&&y.html(`<g>${await KY(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let b=y.node().getBBox(),x=b.width,S=b.height,C=b.x,w=b.y,T=Math.max(x,S)*Math.SQRT2+40,E=_.circle(0,0,T,v),D=Math.max(T,u.width),O=T+u.height+f,A=_.rectangle(-D/2,-O/2,D,O,{...v,fill:`transparent`,stroke:`none`}),ee=l.insert(()=>E,`:first-child`),j=l.insert(()=>A);return y.attr(`transform`,`translate(${-x/2-C},${p?u.height/2+f/2-S/2-w:-u.height/2-f/2-S/2-w})`),y.attr(`style`,`color: ${g.get(`stroke`)??m};`),d.attr(`transform`,`translate(${-u.width/2-(u.x-(u.left??0))},${p?-O/2:O/2-u.height})`),ee.attr(`transform`,`translate(0,${p?u.height/2+f/2:-u.height/2-f/2})`),Q(t,j),t.intersect=function(e){return G.info(`iconSquare intersect`,t,e),$.rect(t,e)},l}W(xZ,`iconCircle`);async function SZ(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=X(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=r?.wrappingWidth;t.width=Math.max(s,c??0);let{shapeSvg:l,bbox:u,halfPadding:d,label:f}=await mX(e,t,`icon-shape default`),p=t.pos===`t`,m=s+d*2,h=s+d*2,{nodeBorder:g,mainBkg:_}=n,{stylesMap:v}=Iq(t),y=-h/2,b=-m/2,x=t.label?8:0,S=k.svg(l),C=Z(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`),C.stroke=v.get(`fill`)??_;let w=S.path(CX(y,b,h,m,5),C),T=Math.max(h,u.width),E=m+u.height+x,D=S.rectangle(-T/2,-E/2,T,E,{...C,fill:`transparent`,stroke:`none`}),O=l.insert(()=>w,`:first-child`).attr(`class`,`icon-shape2`),A=l.insert(()=>D);if(t.icon){let e=l.append(`g`);e.html(`<g>${await KY(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${p?u.height/2+x/2-i/2-o:-u.height/2-x/2-i/2-o})`),e.attr(`style`,`color: ${v.get(`stroke`)??g};`)}return f.attr(`transform`,`translate(${-u.width/2-(u.x-(u.left??0))},${p?-E/2:E/2-u.height})`),O.attr(`transform`,`translate(0,${p?u.height/2+x/2:-u.height/2-x/2})`),Q(t,A),t.intersect=function(e){if(G.info(`iconSquare intersect`,t,e),!t.label)return $.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=p?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+x},{x:n+h/2,y:r-i/2+u.height+x},{x:n+h/2,y:r+i/2},{x:n-h/2,y:r+i/2},{x:n-h/2,y:r-i/2+u.height+x},{x:n-u.width/2,y:r-i/2+u.height+x}]:[{x:n-h/2,y:r-i/2},{x:n+h/2,y:r-i/2},{x:n+h/2,y:r-i/2+m},{x:n+u.width/2,y:r-i/2+m},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+m},{x:n-h/2,y:r-i/2+m}],$.polygon(t,a,e)},l}W(SZ,`iconRounded`);async function CZ(e,t,{config:{themeVariables:n,flowchart:r}}){let{labelStyles:i}=X(t);t.labelStyle=i;let a=t.assetHeight??48,o=t.assetWidth??48,s=Math.max(a,o),c=r?.wrappingWidth;t.width=Math.max(s,c??0);let{shapeSvg:l,bbox:u,halfPadding:d,label:f}=await mX(e,t,`icon-shape default`),p=t.pos===`t`,m=s+d*2,h=s+d*2,{nodeBorder:g,mainBkg:_}=n,{stylesMap:v}=Iq(t),y=-h/2,b=-m/2,x=t.label?8:0,S=k.svg(l),C=Z(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`),C.stroke=v.get(`fill`)??_;let w=S.path(CX(y,b,h,m,.1),C),T=Math.max(h,u.width),E=m+u.height+x,D=S.rectangle(-T/2,-E/2,T,E,{...C,fill:`transparent`,stroke:`none`}),O=l.insert(()=>w,`:first-child`),A=l.insert(()=>D);if(t.icon){let e=l.append(`g`);e.html(`<g>${await KY(t.icon,{height:s,width:s,fallbackPrefix:``})}</g>`);let n=e.node().getBBox(),r=n.width,i=n.height,a=n.x,o=n.y;e.attr(`transform`,`translate(${-r/2-a},${p?u.height/2+x/2-i/2-o:-u.height/2-x/2-i/2-o})`),e.attr(`style`,`color: ${v.get(`stroke`)??g};`)}return f.attr(`transform`,`translate(${-u.width/2-(u.x-(u.left??0))},${p?-E/2:E/2-u.height})`),O.attr(`transform`,`translate(0,${p?u.height/2+x/2:-u.height/2-x/2})`),Q(t,A),t.intersect=function(e){if(G.info(`iconSquare intersect`,t,e),!t.label)return $.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=p?[{x:n-u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2},{x:n+u.width/2,y:r-i/2+u.height+x},{x:n+h/2,y:r-i/2+u.height+x},{x:n+h/2,y:r+i/2},{x:n-h/2,y:r+i/2},{x:n-h/2,y:r-i/2+u.height+x},{x:n-u.width/2,y:r-i/2+u.height+x}]:[{x:n-h/2,y:r-i/2},{x:n+h/2,y:r-i/2},{x:n+h/2,y:r-i/2+m},{x:n+u.width/2,y:r-i/2+m},{x:n+u.width/2/2,y:r+i/2},{x:n-u.width/2,y:r+i/2},{x:n-u.width/2,y:r-i/2+m},{x:n-h/2,y:r-i/2+m}],$.polygon(t,a,e)},l}W(CZ,`iconSquare`);async function wZ(e,t,{config:{flowchart:n}}){let r=new Image;r.src=t?.img??``,await r.decode();let i=Number(r.naturalWidth.toString().replace(`px`,``)),a=Number(r.naturalHeight.toString().replace(`px`,``));t.imageAspectRatio=i/a;let{labelStyles:o}=X(t);t.labelStyle=o;let s=n?.wrappingWidth;t.defaultWidth=n?.wrappingWidth;let c=Math.max(t.label?s??0:0,t?.assetWidth??i),l=t.constraint===`on`&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:c,u=t.constraint===`on`?l/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(l,s??0);let{shapeSvg:d,bbox:f,label:p}=await mX(e,t,`image-shape default`),m=t.pos===`t`,h=-l/2,g=-u/2,_=t.label?8:0,v=k.svg(d),y=Z(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=v.rectangle(h,g,l,u,y),x=Math.max(l,f.width),S=u+f.height+_,C=v.rectangle(-x/2,-S/2,x,S,{...y,fill:`none`,stroke:`none`}),w=d.insert(()=>b,`:first-child`),T=d.insert(()=>C);if(t.img){let e=d.append(`image`);e.attr(`href`,t.img),e.attr(`width`,l),e.attr(`height`,u),e.attr(`preserveAspectRatio`,`none`),e.attr(`transform`,`translate(${-l/2},${m?S/2-u:-S/2})`)}return p.attr(`transform`,`translate(${-f.width/2-(f.x-(f.left??0))},${m?-u/2-f.height/2-_/2:u/2-f.height/2+_/2})`),w.attr(`transform`,`translate(0,${m?f.height/2+_/2:-f.height/2-_/2})`),Q(t,T),t.intersect=function(e){if(G.info(`iconSquare intersect`,t,e),!t.label)return $.rect(t,e);let n=t.x??0,r=t.y??0,i=t.height??0,a=[];return a=m?[{x:n-f.width/2,y:r-i/2},{x:n+f.width/2,y:r-i/2},{x:n+f.width/2,y:r-i/2+f.height+_},{x:n+l/2,y:r-i/2+f.height+_},{x:n+l/2,y:r+i/2},{x:n-l/2,y:r+i/2},{x:n-l/2,y:r-i/2+f.height+_},{x:n-f.width/2,y:r-i/2+f.height+_}]:[{x:n-l/2,y:r-i/2},{x:n+l/2,y:r-i/2},{x:n+l/2,y:r-i/2+u},{x:n+f.width/2,y:r-i/2+u},{x:n+f.width/2/2,y:r+i/2},{x:n-f.width/2,y:r+i/2},{x:n-f.width/2,y:r-i/2+u},{x:n-l/2,y:r-i/2+u}],$.polygon(t,a,e)},d}W(wZ,`imageSquare`);async function TZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=Math.max(c.width+(o??0)*2,t?.width??0),u=Math.max(c.height+(a??0)*2,t?.height??0),d=[{x:0,y:0},{x:l,y:0},{x:l+3*u/6,y:-u},{x:-3*u/6,y:-u}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=k.svg(s),n=Z(t,{}),r=_X(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-l/2}, ${u/2})`),p&&f.attr(`style`,p)}else f=UX(s,l,u,d);return r&&f.attr(`style`,r),t.width=l,t.height=u,Q(t,f),t.intersect=function(e){return $.polygon(t,d,e)},s}W(TZ,`inv_trapezoid`);async function EZ(e,t,n){let{labelStyles:r,nodeStyles:i}=X(t);t.labelStyle=r;let{shapeSvg:a,bbox:o}=await mX(e,t,gX(t)),s=Math.max(o.width+n.labelPaddingX*2,t?.width||0),c=Math.max(o.height+n.labelPaddingY*2,t?.height||0),l=-s/2,u=-c/2,d,{rx:f,ry:p}=t,{cssStyles:m}=t;if(n?.rx&&n.ry&&(f=n.rx,p=n.ry),t.look===`handDrawn`){let e=k.svg(a),n=Z(t,{}),r=f||p?e.path(CX(l,u,s,c,f||0),n):e.rectangle(l,u,s,c,n);d=a.insert(()=>r,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,jq(m))}else d=a.insert(`rect`,`:first-child`),d.attr(`class`,`basic label-container`).attr(`style`,i).attr(`rx`,jq(f)).attr(`ry`,jq(p)).attr(`x`,l).attr(`y`,u).attr(`width`,s).attr(`height`,c);return Q(t,d),t.calcIntersect=function(e,t){return $.rect(e,t)},t.intersect=function(e){return $.rect(t,e)},a}W(EZ,`drawRect`);async function DZ(e,t){let{shapeSvg:n,bbox:r,label:i}=await mX(e,t,`label`),a=n.insert(`rect`,`:first-child`);return a.attr(`width`,.1).attr(`height`,.1),n.attr(`class`,`label edgeLabel`),i.attr(`transform`,`translate(${-(r.width/2)-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),Q(t,a),t.intersect=function(e){return $.rect(t,e)},n}W(DZ,`labelRect`);async function OZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:0,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:-(3*l)/6,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=k.svg(s),n=Z(t,{}),r=_X(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=UX(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,Q(t,f),t.intersect=function(e){return $.polygon(t,d,e)},s}W(OZ,`lean_left`);async function kZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=i,o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u,y:0},{x:u+3*l/6,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=k.svg(s),n=Z(t,{}),r=_X(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=UX(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,Q(t,f),t.intersect=function(e){return $.polygon(t,d,e)},s}W(kZ,`lean_right`);function AZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.label=``,t.labelStyle=n;let i=e.insert(`g`).attr(`class`,gX(t)).attr(`id`,t.domId??t.id),{cssStyles:a}=t,o=Math.max(35,t?.width??0),s=Math.max(35,t?.height??0),c=[{x:o,y:0},{x:0,y:s+7/2},{x:o-14,y:s+7/2},{x:0,y:2*s},{x:o,y:s-7/2},{x:14,y:s-7/2}],l=k.svg(i),u=Z(t,{});t.look!==`handDrawn`&&(u.roughness=0,u.fillStyle=`solid`);let d=_X(c),f=l.path(d,u),p=i.insert(()=>f,`:first-child`);return p.attr(`class`,`outer-path`),a&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,a),r&&t.look!==`handDrawn`&&p.selectAll(`path`).attr(`style`,r),p.attr(`transform`,`translate(-${o/2},${-s})`),Q(t,p),t.intersect=function(e){return G.info(`lightningBolt intersect`,t,e),$.polygon(t,c,e)},i}W(AZ,`lightningBolt`);var jZ=W((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`a${i},${a} 0,0,0 ${n},0`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createCylinderPathD`),MZ=W((e,t,n,r,i,a,o)=>[`M${e},${t+a}`,`M${e+n},${t+a}`,`a${i},${a} 0,0,0 ${-n},0`,`l0,${r}`,`a${i},${a} 0,0,0 ${n},0`,`l0,${-r}`,`M${e},${t+a+o}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createOuterCylinderPathD`),NZ=W((e,t,n,r,i,a)=>[`M${e-n/2},${-r/2}`,`a${i},${a} 0,0,0 ${n},0`].join(` `),`createInnerCylinderPathD`),PZ=10,FZ=10;async function IZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?24:i;if(t.width||t.height){let e=t.width??0;t.width=(t.width??0)-a,t.width<FZ&&(t.width=FZ);let n=e/2/(2.5+e/50);t.height=(t.height??0)-o-n*3,t.height<PZ&&(t.height=PZ)}let{shapeSvg:s,bbox:c,label:l}=await mX(e,t,gX(t)),u=(t?.width?t?.width:c.width)+a*2,d=u/2,f=d/(2.5+u/50),p=(t?.height?t?.height:c.height)+f+o*2,m=p*.1,h,{cssStyles:g}=t;if(t.look===`handDrawn`){let e=k.svg(s),n=MZ(0,0,u,p,d,f,m),r=NZ(0,f,u,p,d,f),i=Z(t,{}),a=e.path(n,i),o=e.path(r,i);s.insert(()=>o,`:first-child`).attr(`class`,`line`),h=s.insert(()=>a,`:first-child`),h.attr(`class`,`basic label-container`),g&&h.attr(`style`,g)}else{let e=jZ(0,0,u,p,d,f,m);h=s.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container outer-path`).attr(`style`,jq(g)).attr(`style`,r)}return h.attr(`label-offset-y`,f),h.attr(`transform`,`translate(${-u/2}, ${-(p/2+f)})`),Q(t,h),l.attr(`transform`,`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+f-(c.y-(c.top??0))})`),t.intersect=function(e){let n=$.rect(t,e),r=n.x-(t.x??0);if(d!=0&&(Math.abs(r)<(t.width??0)/2||Math.abs(r)==(t.width??0)/2&&Math.abs(n.y-(t.y??0))>(t.height??0)/2-f)){let i=f*f*(1-r*r/(d*d));i>0&&(i=Math.sqrt(i)),i=f-i,e.y-(t.y??0)>0&&(i=-i),n.y+=i}return n},s}W(IZ,`linedCylinder`);async function LZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=(t.width??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:s,bbox:c,label:l}=await mX(e,t,gX(t)),u=(t?.width?t?.width:c.width)+(a??0)*2,d=(t?.height?t?.height:c.height)+(o??0)*2,f=t.look===`neo`?d/4:d/8,p=d+f,{cssStyles:m}=t,h=k.svg(s),g=Z(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=[{x:-u/2-u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:p/2},...vX(-u/2-u/2*.1,p/2,u/2+u/2*.1,p/2,f,.8),{x:u/2+u/2*.1,y:-p/2},{x:-u/2-u/2*.1,y:-p/2},{x:-u/2,y:-p/2},{x:-u/2,y:p/2*1.1},{x:-u/2,y:-p/2}],v=h.polygon(_.map(e=>[e.x,e.y]),g),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container outer-path`),m&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),y.attr(`transform`,`translate(0,${-f/2})`),l.attr(`transform`,`translate(${-u/2+(t.padding??0)+u/2*.1/2-(c.x-(c.left??0))},${-d/2+(t.padding??0)-f/2-(c.y-(c.top??0))})`),Q(t,y),t.intersect=function(e){return $.polygon(t,_,e)},s}W(LZ,`linedWaveEdgedRect`);async function RZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=t.look===`neo`?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*s,10),t.height=Math.max((t?.height??0)-o*2-2*s,10));let{shapeSvg:c,bbox:l,label:u}=await mX(e,t,gX(t)),d=(t?.width?t?.width:l.width)+a*2+2*s,f=(t?.height?t?.height:l.height)+o*2+2*s,p=d-2*s,m=f-2*s,h=-p/2,g=-m/2,{cssStyles:_}=t,v=k.svg(c),y=Z(t,{}),b=[{x:h-s,y:g+s},{x:h-s,y:g+m+s},{x:h+p-s,y:g+m+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g+m-s},{x:h+p+s,y:g+m-s},{x:h+p+s,y:g-s},{x:h+s,y:g-s},{x:h+s,y:g},{x:h,y:g},{x:h,y:g+s}],x=[{x:h,y:g+s},{x:h+p-s,y:g+s},{x:h+p-s,y:g+m},{x:h+p,y:g+m},{x:h+p,y:g},{x:h,y:g}];t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let S=_X(b),C=v.path(S,y),w=_X(x),T=v.path(w,y);t.look!==`handDrawn`&&(C=bX(C),T=bX(T));let E=c.insert(`g`,`:first-child`);return E.insert(()=>C),E.insert(()=>T),E.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&E.selectAll(`path`).attr(`style`,r),u.attr(`transform`,`translate(${-(l.width/2)-s-(l.x-(l.left??0))}, ${-(l.height/2)+s-(l.y-(l.top??0))})`),Q(t,E),t.intersect=function(e){return $.polygon(t,b,e)},c}W(RZ,`multiRect`);async function zZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await mX(e,t,gX(t)),s=t.padding??0,c=t.look===`neo`?16:s,l=t.look===`neo`?12:s,u=!0;(t.width||t.height)&&(u=!1,t.width=(t?.width??0)-c*2,t.height=(t?.height??0)-l*3);let d=Math.max(a.width,t?.width??0)+c*2,f=Math.max(a.height,t?.height??0)+l*3,p=t.look===`neo`?f/4:f/8,m=f+(u?p/2:-p/2),h=-d/2,g=-m/2,{cssStyles:_}=t,v=vX(h-10,g+m+10,h+d-10,g+m+10,p,.8),y=v?.[v.length-1],b=[{x:h-10,y:g+10},{x:h-10,y:g+m+10},...v,{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:y.y-20},{x:h+d+10,y:y.y-20},{x:h+d+10,y:g-10},{x:h+10,y:g-10},{x:h+10,y:g},{x:h,y:g},{x:h,y:g+10}],x=[{x:h,y:g+10},{x:h+d-10,y:g+10},{x:h+d-10,y:y.y-10},{x:h+d,y:y.y-10},{x:h+d,y:g},{x:h,y:g}],S=k.svg(i),C=Z(t,{});t.look!==`handDrawn`&&(C.roughness=0,C.fillStyle=`solid`);let w=_X(b),T=S.path(w,C),E=_X(x),D=S.path(E,C),O=i.insert(()=>T,`:first-child`);return O.insert(()=>D),O.attr(`class`,`basic label-container outer-path`),_&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,_),r&&t.look!==`handDrawn`&&O.selectAll(`path`).attr(`style`,r),O.attr(`transform`,`translate(0,${-p/2})`),o.attr(`transform`,`translate(${-(a.width/2)-10-(a.x-(a.left??0))}, ${-(a.height/2)+10-p/2-(a.y-(a.top??0))})`),Q(t,O),t.intersect=function(e){return $.polygon(t,b,e)},i}W(zZ,`multiWaveEdgedRectangle`);async function BZ(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=X(t);t.labelStyle=r,t.useHtmlLabels||qI(RI())||(t.centerLabel=!0);let{shapeSvg:a,bbox:o,label:s}=await mX(e,t,gX(t)),c=Math.max(o.width+(t.padding??0)*2,t?.width??0),l=Math.max(o.height+(t.padding??0)*2,t?.height??0),u=-c/2,d=-l/2,{cssStyles:f}=t,p=k.svg(a),m=Z(t,{fill:n.noteBkgColor,stroke:n.noteBorderColor});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=p.rectangle(u,d,c,l,m),g=a.insert(()=>h,`:first-child`);return g.attr(`class`,`basic label-container outer-path`),s.attr(`class`,`label noteLabel`),f&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,f),i&&t.look!==`handDrawn`&&g.selectAll(`path`).attr(`style`,i),s.attr(`transform`,`translate(${-o.width/2-(o.x-(o.left??0))}, ${-(o.height/2)-(o.y-(o.top??0))})`),Q(t,g),t.intersect=function(e){return $.rect(t,e)},a}W(BZ,`note`);var VZ=W((e,t,n)=>[`M${e+n/2},${t}`,`L${e+n},${t-n/2}`,`L${e+n/2},${t-n}`,`L${e},${t-n/2}`,`Z`].join(` `),`createDecisionBoxPathD`);async function HZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await mX(e,t,gX(t)),o=a.width+(t.padding??0)+(a.height+(t.padding??0)),s=.5,c=[{x:o/2,y:0},{x:o,y:-o/2},{x:o/2,y:-o},{x:0,y:-o/2}],l,{cssStyles:u}=t;if(t.look===`handDrawn`){let e=k.svg(i),n=Z(t,{}),r=VZ(0,0,o),a=e.path(r,n);l=i.insert(()=>a,`:first-child`).attr(`transform`,`translate(${-o/2+s}, ${o/2})`),u&&l.attr(`style`,u)}else l=UX(i,o,o,c),l.attr(`transform`,`translate(${-o/2+s}, ${o/2})`);return r&&l.attr(`style`,r),Q(t,l),t.calcIntersect=function(e,t){let n=e.width,r=[{x:n/2,y:0},{x:n,y:-n/2},{x:n/2,y:-n},{x:0,y:-n/2}],i=$.polygon(e,r,t);return{x:i.x-.5,y:i.y-.5}},t.intersect=function(e){return this.calcIntersect(t,e)},i}W(HZ,`question`);async function UZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?21:i??0,o=t.look===`neo`?12:i??0,{shapeSvg:s,bbox:c,label:l}=await mX(e,t,gX(t)),u=(t?.width??c.width)+(t.look===`neo`?a*2:a),d=(t?.height??c.height)+(t.look===`neo`?o*2:o),f=-u/2,p=-d/2,m=p/2,h=[{x:f+m,y:p},{x:f,y:0},{x:f+m,y:-p},{x:-f,y:-p},{x:-f,y:p}],{cssStyles:g}=t,_=k.svg(s),v=Z(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=_X(h),b=_.path(y,v),x=s.insert(()=>b,`:first-child`);return x.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),x.attr(`transform`,`translate(${-m/2},0)`),l.attr(`transform`,`translate(${-m/2-c.width/2-(c.x-(c.left??0))}, ${-(c.height/2)-(c.y-(c.top??0))})`),Q(t,x),t.intersect=function(e){return $.polygon(t,h,e)},s}W(UZ,`rect_left_inv_arrow`);async function WZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i;i=t.cssClasses?`node `+t.cssClasses:`node default`;let a=e.insert(`g`).attr(`class`,i).attr(`id`,t.domId||t.id),o=a.insert(`g`),s=a.insert(`g`).attr(`class`,`label`).attr(`style`,r),c=t.description,l=t.label,u=await SX(s,l,t.labelStyle,!0,!0),d={width:0,height:0};if(qI(VL())){let e=u.children[0],t=gR(u);d=e.getBoundingClientRect(),t.attr(`width`,d.width),t.attr(`height`,d.height)}G.info(`Text 2`,c);let f=c||[],p=u.getBBox(),m=await SX(s,Array.isArray(f)?f.join(`<br/>`):f,t.labelStyle,!0,!0),h=m.children[0],g=gR(m);d=h.getBoundingClientRect(),g.attr(`width`,d.width),g.attr(`height`,d.height);let _=(t.padding||0)/2;gR(m).attr(`transform`,`translate( `+(d.width>p.width?0:(p.width-d.width)/2)+`, `+(p.height+_+5)+`)`),gR(u).attr(`transform`,`translate( `+(d.width<p.width?0:-(p.width-d.width)/2)+`, 0)`),d=s.node().getBBox(),s.attr(`transform`,`translate(`+-d.width/2+`, `+(-d.height/2-_+3)+`)`);let v=d.width+(t.padding||0),y=d.height+(t.padding||0),b=-d.width/2-_,x=-d.height/2-_,S,C;if(t.look===`handDrawn`){let e=k.svg(a),n=Z(t,{}),r=e.path(CX(b,x,v,y,t.rx||0),n),i=e.line(-d.width/2-_,-d.height/2-_+p.height+_,d.width/2+_,-d.height/2-_+p.height+_,n);C=a.insert(()=>(G.debug(`Rough node insert CXC`,r),i),`:first-child`),S=a.insert(()=>(G.debug(`Rough node insert CXC`,r),r),`:first-child`)}else S=o.insert(`rect`,`:first-child`),C=o.insert(`line`),S.attr(`class`,`outer title-state`).attr(`style`,r).attr(`x`,-d.width/2-_).attr(`y`,-d.height/2-_).attr(`width`,d.width+(t.padding||0)).attr(`height`,d.height+(t.padding||0)),C.attr(`class`,`divider`).attr(`x1`,-d.width/2-_).attr(`x2`,d.width/2+_).attr(`y1`,-d.height/2-_+p.height+_).attr(`y2`,-d.height/2-_+p.height+_);return Q(t,S),t.intersect=function(e){return $.rect(t,e)},a}W(WZ,`rectWithTitle`);async function GZ(e,t,{config:{themeVariables:n}}){let r=n?.radius??5;return EZ(e,t,{rx:r,ry:r,classes:``,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1})}W(GZ,`roundedRect`);var KZ=8;async function qZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0,{shapeSvg:o,bbox:s,label:c}=await mX(e,t,gX(t)),l=(t?.width??s.width)+i*2+(t.look===`neo`?KZ:KZ*2),u=(t?.height??s.height)+a*2,d=l-KZ,f=u,p=KZ-l/2,m=-u/2,{cssStyles:h}=t,g=k.svg(o),_=Z(t,{});t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let v=[{x:p,y:m},{x:p+d,y:m},{x:p+d,y:m+f},{x:p-KZ,y:m+f},{x:p-KZ,y:m},{x:p,y:m},{x:p,y:m+f}],y=g.polygon(v.map(e=>[e.x,e.y]),_),b=o.insert(()=>y,`:first-child`);return b.attr(`class`,`basic label-container outer-path`).attr(`style`,jq(h)),r&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,r),h&&t.look!==`handDrawn`&&b.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${KZ/2-s.width/2-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Q(t,b),t.intersect=function(e){return $.rect(t,e)},o}W(qZ,`shadedProcess`);async function JZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-o*2,10));let{shapeSvg:s,bbox:c,label:l}=await mX(e,t,gX(t)),u=(t?.width?t?.width:c.width)+a*2,d=((t?.height?t?.height:c.height)+o*2)*1.5,f=u,p=d/1.5,m=-f/2,h=-p/2,{cssStyles:g}=t,_=k.svg(s),v=Z(t,{});t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let y=[{x:m,y:h},{x:m,y:h+p},{x:m+f,y:h+p},{x:m+f,y:h-p/2}],b=_X(y),x=_.path(b,v),S=s.insert(()=>x,`:first-child`);return S.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&S.selectChildren(`path`).attr(`style`,r),S.attr(`transform`,`translate(0, ${p/4})`),l.attr(`transform`,`translate(${-f/2+(t.padding??0)-(c.x-(c.left??0))}, ${-p/4+(t.padding??0)-(c.y-(c.top??0))})`),Q(t,S),t.intersect=function(e){return $.polygon(t,y,e)},s}W(JZ,`slopedRect`);async function YZ(e,t){let n=t.padding??0,r=t.look===`neo`?16:n*2,i=t.look===`neo`?12:n;return EZ(e,t,{rx:0,ry:0,classes:``,labelPaddingX:t.labelPaddingX??r,labelPaddingY:i})}W(YZ,`squareRect`);async function XZ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?20:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=c.height+(t.look===`neo`?o*2:o),u=c.width+l/4+(t.look===`neo`?a*2:a),d=l/2,{cssStyles:f}=t,p=k.svg(s),m=Z(t,{});t.look!==`handDrawn`&&(m.roughness=0,m.fillStyle=`solid`);let h=[{x:-u/2+d,y:-l/2},{x:u/2-d,y:-l/2},...yX(-u/2+d,0,d,50,90,270),{x:u/2-d,y:l/2},...yX(u/2-d,0,d,50,270,450)],g=_X(h),_=p.path(g,m),v=s.insert(()=>_,`:first-child`);return v.attr(`class`,`basic label-container outer-path`),f&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,f),r&&t.look!==`handDrawn`&&v.selectChildren(`path`).attr(`style`,r),Q(t,v),t.intersect=function(e){return $.polygon(t,h,e)},s}W(XZ,`stadium`);async function ZZ(e,t){return EZ(e,t,{rx:t.look===`neo`?3:5,ry:t.look===`neo`?3:5,classes:`flowchart-node`})}W(ZZ,`state`);function QZ(e,t,{config:{themeVariables:n}}){let{labelStyles:r,nodeStyles:i}=X(t);t.labelStyle=r;let{cssStyles:a}=t,{lineColor:o,stateBorder:s,nodeBorder:c,nodeShadow:l}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let u=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId??t.id),d=k.svg(u),f=Z(t,{});t.look!==`handDrawn`&&(f.roughness=0,f.fillStyle=`solid`);let p=d.circle(0,0,t.width,{...f,stroke:o,strokeWidth:2}),m=s??c,h=(t.width??0)*5/14,g=d.circle(0,0,h,{...f,fill:m,stroke:m,strokeWidth:2,fillStyle:`solid`}),_=u.insert(()=>p,`:first-child`);if(_.insert(()=>g),t.look!==`handDrawn`&&_.attr(`class`,`outer-path`),a&&_.selectAll(`path`).attr(`style`,a),i&&_.selectAll(`path`).attr(`style`,i),t.width<25&&l&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;_.attr(`style`,`filter:url(#${n})`)}return Q(t,_),t.intersect=function(e){return $.circle(t,(t.width??0)/2,e)},u}W(QZ,`stateEnd`);function $Z(e,t,{config:{themeVariables:n}}){let{lineColor:r,nodeShadow:i}=n;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||=14,t.height||=14;let a=e.insert(`g`).attr(`class`,`node default`).attr(`id`,t.domId||t.id),o;if(t.look===`handDrawn`){let e=k.svg(a).circle(0,0,t.width,Fq(r));o=a.insert(()=>e),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14)}else o=a.insert(`circle`,`:first-child`),o.attr(`class`,`state-start`).attr(`r`,(t.width??7)/2).attr(`width`,t.width??14).attr(`height`,t.height??14);if(t.width<25&&i&&t.look!==`handDrawn`){let t=e.node()?.ownerSVGElement?.id??``,n=t?`${t}-drop-shadow-small`:`drop-shadow-small`;o.attr(`style`,`filter:url(#${n})`)}return Q(t,o),t.intersect=function(e){return $.circle(t,(t.width??7)/2,e)},a}W($Z,`stateStart`);var eQ=8;async function tQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t?.padding??8,a=t.look===`neo`?28:i,o=t.look===`neo`?12:i,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.width??c.width)+2*eQ+a,u=(t?.height??c.height)+o,d=l-2*eQ,f=u,p=-l/2,m=-u/2,h=[{x:0,y:0},{x:d,y:0},{x:d,y:-f},{x:0,y:-f},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-f},{x:-8,y:-f},{x:-8,y:0}];if(t.look===`handDrawn`){let e=k.svg(s),n=Z(t,{}),r=e.rectangle(p,m,d+16,f,n),i=e.line(p+eQ,m,p+eQ,m+f,n),a=e.line(p+eQ+d,m,p+eQ+d,m+f,n);s.insert(()=>i,`:first-child`),s.insert(()=>a,`:first-child`);let o=s.insert(()=>r,`:first-child`),{cssStyles:c}=t;o.attr(`class`,`basic label-container`).attr(`style`,jq(c)),Q(t,o)}else{let e=UX(s,d,f,h);r&&e.attr(`style`,r),Q(t,e)}return t.intersect=function(e){return $.polygon(t,h,e)},s}W(tQ,`subroutine`);var nQ=.2;async function rQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-o*2,10),t.width=Math.max((t?.width??0)-a*2-nQ*(t.height+o*2),10));let{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.height?t?.height:c.height)+o*2,u=nQ*l,d=nQ*l,f=(t?.width?t?.width:c.width)+a*2+u-u,p=l,m=-f/2,h=-p/2,{cssStyles:g}=t,_=k.svg(s),v=Z(t,{}),y=[{x:m-u/2,y:h},{x:m+f+u/2,y:h},{x:m+f+u/2,y:h+p},{x:m-u/2,y:h+p}],b=[{x:m+f-u/2,y:h+p},{x:m+f+u/2,y:h+p},{x:m+f+u/2,y:h+p-d}];t.look!==`handDrawn`&&(v.roughness=0,v.fillStyle=`solid`);let x=_X(y),S=_.path(x,v),C=_X(b),w=_.path(C,{...v,fillStyle:`solid`}),T=s.insert(()=>w,`:first-child`);return T.insert(()=>S,`:first-child`),T.attr(`class`,`basic label-container outer-path`),g&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,g),r&&t.look!==`handDrawn`&&T.selectAll(`path`).attr(`style`,r),Q(t,T),t.intersect=function(e){return $.polygon(t,y,e)},s}W(rQ,`taggedRect`);async function iQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,label:o}=await mX(e,t,gX(t)),s=Math.max(a.width+(t.padding??0)*2,t?.width??0),c=Math.max(a.height+(t.padding??0)*2,t?.height??0),l=c/8,u=.2*s,d=.2*c,f=c+l,{cssStyles:p}=t,m=k.svg(i),h=Z(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-s/2-s/2*.1,y:f/2},...vX(-s/2-s/2*.1,f/2,s/2+s/2*.1,f/2,l,.8),{x:s/2+s/2*.1,y:-f/2},{x:-s/2-s/2*.1,y:-f/2}],_=-s/2+s/2*.1,v=-f/2-d*.4,y=[{x:_+s-u,y:(v+c)*1.3},{x:_+s,y:v+c-d},{x:_+s,y:(v+c)*.9},...vX(_+s,(v+c)*1.25,_+s-u,(v+c)*1.3,-c*.02,.5)],b=_X(g),x=m.path(b,h),S=_X(y),C=m.path(S,{...h,fillStyle:`solid`}),w=i.insert(()=>C,`:first-child`);return w.insert(()=>x,`:first-child`),w.attr(`class`,`basic label-container outer-path`),p&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&w.selectAll(`path`).attr(`style`,r),w.attr(`transform`,`translate(0,${-l/2})`),o.attr(`transform`,`translate(${-s/2+(t.padding??0)-(a.x-(a.left??0))},${-c/2+(t.padding??0)-l/2-(a.y-(a.top??0))})`),Q(t,w),t.intersect=function(e){return $.polygon(t,g,e)},i}W(iQ,`taggedWaveEdgedRectangle`);async function aQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a}=await mX(e,t,gX(t)),o=Math.max(a.width+(t.padding??0),t?.width||0),s=Math.max(a.height+(t.padding??0),t?.height||0),c=-o/2,l=-s/2,u=i.insert(`rect`,`:first-child`);return u.attr(`class`,`text`).attr(`style`,r).attr(`rx`,0).attr(`ry`,0).attr(`x`,c).attr(`y`,l).attr(`width`,o).attr(`height`,s),Q(t,u),t.intersect=function(e){return $.rect(t,e)},i}W(aQ,`text`);var oQ=W((e,t,n,r,i,a)=>`M${e},${t}
461
+ a${i},${a} 0,0,1 0,${-r}
462
+ l${n},0
463
+ a${i},${a} 0,0,1 0,${r}
464
+ M${n},${-r}
465
+ a${i},${a} 0,0,0 0,${r}
466
+ l${-n},0`,`createCylinderPathD`),sQ=W((e,t,n,r,i,a)=>[`M${e},${t}`,`M${e+n},${t}`,`a${i},${a} 0,0,0 0,${-r}`,`l${-n},0`,`a${i},${a} 0,0,0 0,${r}`,`l${n},0`].join(` `),`createOuterCylinderPathD`),cQ=W((e,t,n,r,i,a)=>[`M${e+n/2},${-r/2}`,`a${i},${a} 0,0,0 0,${r}`].join(` `),`createInnerCylinderPathD`),lQ=5,uQ=10;async function dQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?12:i/2;if(t.width||t.height){let e=t.height??0;t.height=(t.height??0)-a,t.height<lQ&&(t.height=lQ);let n=e/2/(2.5+e/50);t.width=(t.width??0)-a-n*3,t.width<uQ&&(t.width=uQ)}let{shapeSvg:o,bbox:s,label:c}=await mX(e,t,gX(t)),l=(t.height?t.height:s.height)+a,u=l/2,d=u/(2.5+l/50),f=(t.width?t.width:s.width)+d+a,{cssStyles:p}=t,m;if(t.look===`handDrawn`){let e=k.svg(o),n=sQ(0,0,f,l,d,u),r=cQ(0,0,f,l,d,u),i=e.path(n,Z(t,{})),a=e.path(r,Z(t,{fill:`none`}));m=o.insert(()=>a,`:first-child`),m=o.insert(()=>i,`:first-child`),m.attr(`class`,`basic label-container`),p&&m.attr(`style`,p)}else{let e=oQ(0,0,f,l,d,u);m=o.insert(`path`,`:first-child`).attr(`d`,e).attr(`class`,`basic label-container`).attr(`style`,jq(p)).attr(`style`,r),m.attr(`class`,`basic label-container outer-path`),p&&m.selectAll(`path`).attr(`style`,p),r&&m.selectAll(`path`).attr(`style`,r)}return m.attr(`label-offset-x`,d),m.attr(`transform`,`translate(${-f/2}, ${l/2} )`),c.attr(`transform`,`translate(${-(s.width/2)-d-(s.x-(s.left??0))}, ${-(s.height/2)-(s.y-(s.top??0))})`),Q(t,m),t.intersect=function(e){let n=$.rect(t,e),r=n.y-(t.y??0);if(u!=0&&(Math.abs(r)<(t.height??0)/2||Math.abs(r)==(t.height??0)/2&&Math.abs(n.x-(t.x??0))>(t.width??0)/2-d)){let i=d*d*(1-r*r/(u*u));i!=0&&(i=Math.sqrt(Math.abs(i))),i=d-i,e.x-(t.x??0)>0&&(i=-i),n.x+=i}return n},o}W(dQ,`tiltedCylinder`);async function fQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=(t.look,i),o=t.look===`neo`?i*2:i,{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.height??c.height)+a,u=(t?.width??c.width)+o,d=[{x:-3*l/6,y:0},{x:u+3*l/6,y:0},{x:u,y:-l},{x:0,y:-l}],f,{cssStyles:p}=t;if(t.look===`handDrawn`){let e=k.svg(s),n=Z(t,{}),r=_X(d),i=e.path(r,n);f=s.insert(()=>i,`:first-child`).attr(`transform`,`translate(${-u/2}, ${l/2})`),p&&f.attr(`style`,p)}else f=UX(s,u,l,d);return r&&f.attr(`style`,r),t.width=u,t.height=l,Q(t,f),t.intersect=function(e){return $.polygon(t,d,e)},s}W(fQ,`trapezoid`);async function pQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i;(t.width||t.height)&&(t.height=(t.height??0)-o*2,t.height<5&&(t.height=5),t.width=(t.width??0)-a*2,t.width<15&&(t.width=15));let{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o*2,{cssStyles:d}=t,f=k.svg(s),p=Z(t,{});t.look!==`handDrawn`&&(p.roughness=0,p.fillStyle=`solid`);let m=[{x:-l/2*.8,y:-u/2},{x:l/2*.8,y:-u/2},{x:l/2,y:-u/2*.6},{x:l/2,y:u/2},{x:-l/2,y:u/2},{x:-l/2,y:-u/2*.6}],h=_X(m),g=f.path(h,p),_=s.insert(()=>g,`:first-child`);return _.attr(`class`,`basic label-container outer-path`),d&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,d),r&&t.look!==`handDrawn`&&_.selectChildren(`path`).attr(`style`,r),Q(t,_),t.intersect=function(e){return $.polygon(t,m,e)},s}W(pQ,`trapezoidalPentagon`);var mQ=10,hQ=10;async function gQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?i*2:i;(t.width||t.height)&&(t.width=((t?.width??0)-a)/2,t.width<hQ&&(t.width=hQ),t.height=t?.height??0,t.height<mQ&&(t.height=mQ));let{shapeSvg:o,bbox:s,label:c}=await mX(e,t,gX(t)),l=OI(VL().flowchart?.htmlLabels),u=(t?.width?t?.width:s.width)+a,d=t?.height?t?.height:u+s.height,f=d,p=[{x:0,y:0},{x:f,y:0},{x:f/2,y:-d}],{cssStyles:m}=t,h=k.svg(o),g=Z(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=_X(p),v=h.path(_,g),y=o.insert(()=>v,`:first-child`).attr(`transform`,`translate(${-d/2}, ${d/2})`).attr(`class`,`outer-path`);return m&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,m),r&&t.look!==`handDrawn`&&y.selectChildren(`path`).attr(`style`,r),t.width=u,t.height=d,Q(t,y),c.attr(`transform`,`translate(${-s.width/2-(s.x-(s.left??0))}, ${d/2-(s.height+(t.padding??0)/(l?2:1)-(s.y-(s.top??0)))})`),t.intersect=function(e){return G.info(`Triangle intersect`,t,p,e),$.polygon(t,p,e)},o}W(gQ,`triangle`);async function _Q(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?12:i,s=!0;(t.width||t.height)&&(s=!1,t.width=(t?.width??0)-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-o*2,t.height<10&&(t.height=10));let{shapeSvg:c,bbox:l,label:u}=await mX(e,t,gX(t)),d=(t?.width?t?.width:l.width)+(a??0)*2,f=(t?.height?t?.height:l.height)+(o??0)*2,p=t.look===`neo`?f/4:f/8,m=f+(s?p:-p),{cssStyles:h}=t,g=14-d,_=g>0?g/2:0,v=k.svg(c),y=Z(t,{});t.look!==`handDrawn`&&(y.roughness=0,y.fillStyle=`solid`);let b=[{x:-d/2-_,y:m/2},...vX(-d/2-_,m/2,d/2+_,m/2,p,.8),{x:d/2+_,y:-m/2},{x:-d/2-_,y:-m/2}],x=_X(b),S=v.path(x,y),C=c.insert(()=>S,`:first-child`);return C.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&C.selectAll(`path`).attr(`style`,r),C.attr(`transform`,`translate(0,${-p/2})`),u.attr(`transform`,`translate(${-d/2+(t.padding??0)-(l.x-(l.left??0))},${-f/2+(t.padding??0)-p-(l.y-(l.top??0))})`),Q(t,C),t.intersect=function(e){return $.polygon(t,b,e)},c}W(_Q,`waveEdgedRectangle`);async function vQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.padding??0,a=t.look===`neo`?16:i,o=t.look===`neo`?20:i;if(t.width||t.height){t.width=t?.width??0,t.width<20&&(t.width=20),t.height=t?.height??0,t.height<10&&(t.height=10);let e=Math.min(t.height*.2,t.height/4);t.height=Math.ceil(t.height-o-20/9*e),t.width-=a*2}let{shapeSvg:s,bbox:c}=await mX(e,t,gX(t)),l=(t?.width?t?.width:c.width)+a*2,u=(t?.height?t?.height:c.height)+o,d=u/8,f=u+d*2,{cssStyles:p}=t,m=k.svg(s),h=Z(t,{});t.look!==`handDrawn`&&(h.roughness=0,h.fillStyle=`solid`);let g=[{x:-l/2,y:f/2},...vX(-l/2,f/2,l/2,f/2,d,1),{x:l/2,y:-f/2},...vX(l/2,-f/2,-l/2,-f/2,d,-1)],_=_X(g),v=m.path(_,h),y=s.insert(()=>v,`:first-child`);return y.attr(`class`,`basic label-container`),p&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,p),r&&t.look!==`handDrawn`&&y.selectAll(`path`).attr(`style`,r),Q(t,y),t.intersect=function(e){return $.polygon(t,g,e)},s}W(vQ,`waveRectangle`);var yQ=10;async function bQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t.look===`neo`?16:t.padding??0,a=t.look===`neo`?12:t.padding??0;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-i*2-yQ,10),t.height=Math.max((t?.height??0)-a*2-yQ,10));let{shapeSvg:o,bbox:s,label:c}=await mX(e,t,gX(t)),l=(t?.width?t?.width:s.width)+i*2+yQ,u=(t?.height?t?.height:s.height)+a*2+yQ,d=l-yQ,f=u-yQ,p=-d/2,m=-f/2,{cssStyles:h}=t,g=k.svg(o),_=Z(t,{}),v=[{x:p-yQ,y:m-yQ},{x:p-yQ,y:m+f},{x:p+d,y:m+f},{x:p+d,y:m-yQ}],y=`M${p-yQ},${m-yQ} L${p+d},${m-yQ} L${p+d},${m+f} L${p-yQ},${m+f} L${p-yQ},${m-yQ}
467
+ M${p-yQ},${m} L${p+d},${m}
468
+ M${p},${m-yQ} L${p},${m+f}`;t.look!==`handDrawn`&&(_.roughness=0,_.fillStyle=`solid`);let b=g.path(y,_),x=o.insert(()=>b,`:first-child`);return x.attr(`transform`,`translate(${yQ/2}, ${yQ/2})`),x.attr(`class`,`basic label-container outer-path`),h&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,h),r&&t.look!==`handDrawn`&&x.selectAll(`path`).attr(`style`,r),c.attr(`transform`,`translate(${-(s.width/2)+yQ/2-(s.x-(s.left??0))}, ${-(s.height/2)+yQ/2-(s.y-(s.top??0))})`),Q(t,x),t.intersect=function(e){return $.polygon(t,v,e)},o}W(bQ,`windowPane`);var xQ=new Set([`redux-color`,`redux-dark-color`]),SQ=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]);async function CQ(e,t){let n=t;n.alias&&(t.label=n.alias);let{theme:r,themeVariables:i}=RI(),{rowEven:a,rowOdd:o,nodeBorder:s,borderColorArray:c}=i;if(t.look===`handDrawn`){let{themeVariables:n}=RI(),{background:r}=n;await CQ(e,{...t,id:t.id+`-background`,domId:(t.domId||t.id)+`-background`,look:`default`,cssStyles:[`stroke: none`,`fill: ${r}`]})}let l=RI();t.useHtmlLabels=l.htmlLabels;let u=l.er?.diagramPadding??10,d=l.er?.entityPadding??6,{cssStyles:f}=t,{labelStyles:p,nodeStyles:m}=X(t);if(n.attributes.length===0&&t.label){let i={rx:0,ry:0,labelPaddingX:u,labelPaddingY:u*1.5,classes:``};vq(t.label,l)+i.labelPaddingX*2<l.er.minEntityWidth&&(t.width=l.er.minEntityWidth);let a=await EZ(e,t,i);if(r!=null&&xQ.has(r)){let e=n.colorIndex??0;a.attr(`data-color-id`,`color-${e%c.length}`)}if(!OI(l.htmlLabels)){let e=a.select(`text`),t=e.node()?.getBBox();e.attr(`transform`,`translate(${-t.width/2}, 0)`)}return a}l.htmlLabels||(u*=1.25,d*=1.25);let h=gX(t);h||=`node default`;let g=e.insert(`g`).attr(`class`,h).attr(`id`,t.domId||t.id),_=await wQ(g,t.label??``,l,0,0,[`name`],p);_.height+=d;let v=0,y=[],b=[],x=0,S=0,C=0,w=0,T=!0,E=!0;for(let e of n.attributes){let t=await wQ(g,e.type,l,0,v,[`attribute-type`],p);x=Math.max(x,t.width+u);let n=await wQ(g,e.name,l,0,v,[`attribute-name`],p);S=Math.max(S,n.width+u);let r=await wQ(g,e.keys.join(),l,0,v,[`attribute-keys`],p);C=Math.max(C,r.width+u);let i=await wQ(g,e.comment,l,0,v,[`attribute-comment`],p);w=Math.max(w,i.width+u);let a=Math.max(t.height,n.height,r.height,i.height)+d;b.push({yOffset:v,rowHeight:a}),v+=a}let D=4;C<=u&&(T=!1,C=0,D--),w<=u&&(E=!1,w=0,D--);let O=g.node().getBBox();if(_.width+u*2-(x+S+C+w)>0){let e=_.width+u*2-(x+S+C+w);x+=e/D,S+=e/D,C>0&&(C+=e/D),w>0&&(w+=e/D)}let A=x+S+C+w,ee=k.svg(g),j=Z(t,{});t.look!==`handDrawn`&&(j.roughness=0,j.fillStyle=`solid`);let te=0;b.length>0&&(te=b.reduce((e,t)=>e+(t?.rowHeight??0),0));let M=Math.max(O.width+u*2,t?.width||0,A),ne=Math.max((te??0)+_.height,t?.height||0),N=-M/2,re=-ne/2;if(g.selectAll(`g:not(:first-child)`).each((e,t,n)=>{let r=gR(n[t]),i=r.attr(`transform`),a=0,o=0;if(i){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);e&&(a=parseFloat(e[1]),o=parseFloat(e[2]),r.attr(`class`).includes(`attribute-name`)?a+=x:r.attr(`class`).includes(`attribute-keys`)?a+=x+S:r.attr(`class`).includes(`attribute-comment`)&&(a+=x+S+C))}r.attr(`transform`,`translate(${N+u/2+a}, ${o+re+_.height+d/2})`)}),g.select(`.name`).attr(`transform`,`translate(`+-_.width/2+`, `+(re+d/2)+`)`),r!=null&&xQ.has(r)){let e=n.colorIndex??0;g.attr(`data-color-id`,`color-${e%c.length}`)}let ie=ee.rectangle(N,re,M,ne,j),ae=g.insert(()=>ie,`:first-child`).attr(`class`,`outer-path`).attr(`style`,f.join(``));y.push(0);for(let[e,t]of b.entries()){let n=(e+1)%2==0&&t.yOffset!==0,r=ee.rectangle(N,_.height+re+t?.yOffset,M,t?.rowHeight,{...j,fill:n?a:o,stroke:s});g.insert(()=>r,`g.label`).attr(`style`,f.join(``)).attr(`class`,`row-rect-${n?`even`:`odd`}`)}let oe=1e-4,se=TQ(N,_.height+re,M+N,_.height+re,oe),ce=ee.polygon(se.map(e=>[e.x,e.y]),j);if(g.insert(()=>ce).attr(`class`,`divider`),se=TQ(x+N,_.height+re,x+N,ne+re,oe),ce=ee.polygon(se.map(e=>[e.x,e.y]),j),g.insert(()=>ce).attr(`class`,`divider`),T){let e=x+S+N;se=TQ(e,_.height+re,e,ne+re,oe),ce=ee.polygon(se.map(e=>[e.x,e.y]),j),g.insert(()=>ce).attr(`class`,`divider`)}if(E){let e=x+S+C+N;se=TQ(e,_.height+re,e,ne+re,oe),ce=ee.polygon(se.map(e=>[e.x,e.y]),j),g.insert(()=>ce).attr(`class`,`divider`)}for(let e of y){let t=_.height+re+e;se=TQ(N,t,M+N,t,oe),ce=ee.polygon(se.map(e=>[e.x,e.y]),j),g.insert(()=>ce).attr(`class`,`divider`)}if(Q(t,ae),m&&t.look!==`handDrawn`)if(r!=null&&SQ.has(r))g.selectAll(`path`).attr(`style`,m);else{let e=m.split(`;`)?.filter(e=>e.includes(`stroke`))?.map(e=>`${e}`).join(`; `);g.selectAll(`path`).attr(`style`,e??``),g.selectAll(`.row-rect-even path`).attr(`style`,m)}return t.intersect=function(e){return $.rect(t,e)},g}W(CQ,`erBox`);async function wQ(e,t,n,r=0,i=0,a=[],o=``){let s=e.insert(`g`).attr(`class`,`label ${a.join(` `)}`).attr(`transform`,`translate(${r}, ${i})`).attr(`style`,o);t!==lL(t)&&(t=lL(t),t=t.replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`));let c=s.node().appendChild(await pX(s,t,{width:vq(t,n)+100,style:o,useHtmlLabels:n.htmlLabels},n));if(t.includes(`&lt;`)||t.includes(`&gt;`)){let e=c.children[0];for(e.textContent=e.textContent.replaceAll(`&lt;`,`<`).replaceAll(`&gt;`,`>`);e.childNodes[0];)e=e.childNodes[0],e.textContent=e.textContent.replaceAll(`&lt;`,`<`).replaceAll(`&gt;`,`>`)}let l=c.getBBox();if(OI(n.htmlLabels)){let e=c.children[0];e.style.textAlign=`start`;let t=gR(c);l=e.getBoundingClientRect(),t.attr(`width`,l.width),t.attr(`height`,l.height)}return l}W(wQ,`addText`);function TQ(e,t,n,r,i){return e===n?[{x:e-i/2,y:t},{x:e+i/2,y:t},{x:n+i/2,y:r},{x:n-i/2,y:r}]:[{x:e,y:t-i/2},{x:e,y:t+i/2},{x:n,y:r+i/2},{x:n,y:r-i/2}]}W(TQ,`lineToPolygon`);async function EQ(e,t,n,r,i=n.class.padding??12){let a=r?0:3,o=e.insert(`g`).attr(`class`,gX(t)).attr(`id`,t.domId||t.id),s=null,c=null,l=null,u=null,d=0,f=0,p=0;if(s=o.insert(`g`).attr(`class`,`annotation-group text`),t.annotations.length>0){let e=t.annotations[0];await DQ(s,{text:`\xAB${e}\xBB`},0),d=s.node().getBBox().height}c=o.insert(`g`).attr(`class`,`label-group text`),await DQ(c,t,0,[`font-weight: bolder`]);let m=c.node().getBBox();f=m.height,l=o.insert(`g`).attr(`class`,`members-group text`);let h=0;for(let e of t.members){let t=await DQ(l,e,h,[e.parseClassifier()]);h+=t+a}p=l.node().getBBox().height,p<=0&&(p=i/2),u=o.insert(`g`).attr(`class`,`methods-group text`);let g=0;for(let e of t.methods){let t=await DQ(u,e,g,[e.parseClassifier()]);g+=t+a}let _=o.node().getBBox();if(s!==null){let e=s.node().getBBox();s.attr(`transform`,`translate(${-e.width/2})`)}return c.attr(`transform`,`translate(${-m.width/2}, ${d})`),_=o.node().getBBox(),l.attr(`transform`,`translate(0, ${d+f+i*2})`),_=o.node().getBBox(),u.attr(`transform`,`translate(0, ${d+f+(p?p+i*4:i*2)})`),_=o.node().getBBox(),{shapeSvg:o,bbox:_}}W(EQ,`textHelper`);async function DQ(e,t,n,r=[]){let i=e.insert(`g`).attr(`class`,`label`).attr(`style`,r.join(`; `)),a=RI(),o=`useHtmlLabels`in t?t.useHtmlLabels:OI(a.htmlLabels)??!0,s=``;s=`text`in t?t.text:t.label,!o&&s.startsWith(`\\`)&&(s=s.substring(1)),hL(s)&&(o=!0);let c=await pX(i,HL(kq(s)),{width:vq(s,a)+50,classes:`markdown-node-label`,useHtmlLabels:o},a),l,u=1;if(o){let e=c.children[0],t=gR(c);u=e.innerHTML.split(`<br>`).length,e.innerHTML.includes(`</math>`)&&(u+=e.innerHTML.split(`<mrow>`).length-1);let n=e.getElementsByTagName(`img`);if(n){let e=s.replace(/<img[^>]*>/g,``).trim()===``;await Promise.all([...n].map(t=>new Promise(n=>{function r(){if(t.style.display=`flex`,t.style.flexDirection=`column`,e){let e=a.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,n=parseInt(e,10)*5+`px`;t.style.minWidth=n,t.style.maxWidth=n}else t.style.width=`100%`;n(t)}W(r,`setupImage`),setTimeout(()=>{t.complete&&r()}),t.addEventListener(`error`,r),t.addEventListener(`load`,r)})))}l=e.getBoundingClientRect(),t.attr(`width`,l.width),t.attr(`height`,l.height)}else{r.includes(`font-weight: bolder`)&&gR(c).selectAll(`tspan`).attr(`font-weight`,``),u=c.children.length;let e=c.children[0];(c.textContent===``||c.textContent.includes(`&gt`))&&(e.textContent=s[0]+s.substring(1).replaceAll(`&gt;`,`>`).replaceAll(`&lt;`,`<`).trim(),s[1]===` `&&(e.textContent=e.textContent[0]+` `+e.textContent.substring(1))),e.textContent===`undefined`&&(e.textContent=``),l=c.getBBox()}return i.attr(`transform`,`translate(0,`+(-l.height/(2*u)+n)+`)`),l.height}W(DQ,`addText`);async function OQ(e,t){let n=VL(),{themeVariables:r}=n,{useGradient:i}=r,a=n.class.padding??12,o=a,s=t.useHtmlLabels??OI(n.htmlLabels)??!0,c=t;c.annotations=c.annotations??[],c.members=c.members??[],c.methods=c.methods??[];let{shapeSvg:l,bbox:u}=await EQ(e,t,n,s,o),{labelStyles:d,nodeStyles:f}=X(t);t.labelStyle=d,t.cssStyles=c.styles||``;let p=c.styles?.join(`;`)||f||``;t.cssStyles||=p.replaceAll(`!important`,``).split(`;`);let m=c.members.length===0&&c.methods.length===0&&!n.class?.hideEmptyMembersBox,h=k.svg(l),g=Z(t,{});t.look!==`handDrawn`&&(g.roughness=0,g.fillStyle=`solid`);let _=Math.max(t.width??0,u.width),v=Math.max(t.height??0,u.height),y=(t.height??0)>u.height;c.members.length===0&&c.methods.length===0?v+=o:c.members.length>0&&c.methods.length===0&&(v+=o*2);let b=-_/2,x=-v/2,S=m?a*2:c.members.length===0&&c.methods.length===0?-a:0;y&&(S=a*2);let C=h.rectangle(b-a,x-a-(m?a:c.members.length===0&&c.methods.length===0?-a/2:0),_+2*a,v+2*a+S,g),w=l.insert(()=>C,`:first-child`);w.attr(`class`,`basic label-container outer-path`);let T=w.node().getBBox(),E=l.select(`.annotation-group`).node().getBBox().height-(m?a/2:0)||0,D=l.select(`.label-group`).node().getBBox().height-(m?a/2:0)||0,O=l.select(`.members-group`).node().getBBox().height-(m?a/2:0)||0,A=(E+D+x+a-(x-a-(m?a:c.members.length===0&&c.methods.length===0?-a/2:0)))/2;if(l.selectAll(`.text`).each((e,t,r)=>{let i=gR(r[t]),u=i.attr(`transform`),d=0;if(u){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(u);e&&(d=parseFloat(e[2]))}let f=d+x+a-(m?a:c.members.length===0&&c.methods.length===0?-a/2:0);if(i.attr(`class`).includes(`methods-group`)){let e=Math.max(O,o/2);f=y?Math.max(A,E+D+e+x+o*2+a)+o*2:E+D+e+x+o*4+a}c.members.length===0&&c.methods.length===0&&n.class?.hideEmptyMembersBox&&(f=c.annotations.length>0?d-o:d),s||(f-=4);let p=b;(i.attr(`class`).includes(`label-group`)||i.attr(`class`).includes(`annotation-group`))&&(p=-i.node()?.getBBox().width/2||0,l.selectAll(`text`).each(function(e,t,n){window.getComputedStyle(n[t]).textAnchor===`middle`&&(p=0)})),i.attr(`transform`,`translate(${p}, ${f})`)}),c.members.length>0||c.methods.length>0||m){let e=E+D+x+a,n=h.line(T.x,e,T.x+T.width,e+.001,g);l.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!i?` neo-line`:``}`).attr(`style`,p)}if(m||c.members.length>0||c.methods.length>0){let e=E+D+O+x+o*2+a,n=h.line(T.x,y?Math.max(A,e):e,T.x+T.width,(y?Math.max(A,e):e)+.001,g);l.insert(()=>n).attr(`class`,`divider${t.look===`neo`&&!i?` neo-line`:``}`).attr(`style`,p)}if(c.look!==`handDrawn`&&l.selectAll(`path`).attr(`style`,p),w.select(`:nth-child(2)`).attr(`style`,p),l.selectAll(`.divider`).select(`path`).attr(`style`,p),t.labelStyle?l.selectAll(`span`).attr(`style`,t.labelStyle):l.selectAll(`span`).attr(`style`,p),!s){let e=RegExp(/color\s*:\s*([^;]*)/),t=e.exec(p);if(t){let e=t[0].replace(`color`,`fill`);l.selectAll(`tspan`).attr(`style`,e)}else if(d){let t=e.exec(d);if(t){let e=t[0].replace(`color`,`fill`);l.selectAll(`tspan`).attr(`style`,e)}}}return Q(t,w),t.intersect=function(e){return $.rect(t,e)},l}W(OQ,`classBox`);async function kQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let i=t,a=t,o=`verifyMethod`in t,s=gX(t),{themeVariables:c}=VL(),{borderColorArray:l,requirementEdgeLabelBackground:u}=c,d=e.insert(`g`).attr(`class`,s).attr(`id`,t.domId??t.id),f;f=o?await AQ(d,`&lt;&lt;${i.type}&gt;&gt;`,0,t.labelStyle):await AQ(d,`&lt;&lt;Element&gt;&gt;`,0,t.labelStyle);let p=f,m=await AQ(d,i.name,p,t.labelStyle+`; font-weight: bold;`);if(p+=m+20,o){let e=await AQ(d,`${i.requirementId?`ID: ${i.requirementId}`:``}`,p,t.labelStyle);p+=e;let n=await AQ(d,`${i.text?`Text: ${i.text}`:``}`,p,t.labelStyle);p+=n;let r=await AQ(d,`${i.risk?`Risk: ${i.risk}`:``}`,p,t.labelStyle);p+=r,await AQ(d,`${i.verifyMethod?`Verification: ${i.verifyMethod}`:``}`,p,t.labelStyle)}else{let e=await AQ(d,`${a.type?`Type: ${a.type}`:``}`,p,t.labelStyle);p+=e,await AQ(d,`${a.docRef?`Doc Ref: ${a.docRef}`:``}`,p,t.labelStyle)}let h=(d.node()?.getBBox().width??200)+20,g=(d.node()?.getBBox().height??200)+20,_=-h/2,v=-g/2,y=k.svg(d),b=Z(t,{});t.look!==`handDrawn`&&(b.roughness=0,b.fillStyle=`solid`);let x=y.rectangle(_,v,h,g,b),S=d.insert(()=>x,`:first-child`);if(S.attr(`class`,`basic label-container outer-path`).attr(`style`,r),l?.length){let e=t.colorIndex??0;d.attr(`data-color-id`,`color-${e%l.length}`)}if(d.selectAll(`.label`).each((e,t,n)=>{let r=gR(n[t]),i=r.attr(`transform`),a=0,o=0;if(i){let e=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);e&&(a=parseFloat(e[1]),o=parseFloat(e[2]))}let s=o-g/2,c=_+20/2;(t===0||t===1)&&(c=a),r.attr(`transform`,`translate(${c}, ${s+20})`)}),p>f+m+20){let e=v+f+m+20,n;if(t.look===`neo`){let t=.001,r=[[_,e],[_+h,e],[_+h,e+t],[_,e+t]];n=y.polygon(r,b)}else n=y.line(_,e,_+h,e,b);d.insert(()=>n).attr(`class`,`divider`)}return Q(t,S),t.intersect=function(e){return $.rect(t,e)},r&&t.look!==`handDrawn`&&(u||l?.length)&&d.selectAll(`path`).attr(`style`,r),d}W(kQ,`requirementBox`);async function AQ(e,t,n,r=``){if(t===``)return 0;let i=e.insert(`g`).attr(`class`,`label`).attr(`style`,r),a=VL(),o=a.htmlLabels??!0,s=await pX(i,HL(kq(t)),{width:vq(t,a)+50,classes:`markdown-node-label`,useHtmlLabels:o,style:r},a),c;if(o){let e=s.children[0],t=gR(s);c=e.getBoundingClientRect(),t.attr(`width`,c.width),t.attr(`height`,c.height)}else{let e=s.children[0];for(let t of e.children)r&&t.setAttribute(`style`,r);c=s.getBBox(),c.height+=6}return i.attr(`transform`,`translate(${-c.width/2},${-c.height/2+n})`),c.height}W(AQ,`addText`);var jQ=W(e=>{switch(e){case`Very High`:return`red`;case`High`:return`orange`;case`Medium`:return null;case`Low`:return`blue`;case`Very Low`:return`lightblue`}},`colorFromPriority`);async function MQ(e,t,{config:n}){let{labelStyles:r,nodeStyles:i}=X(t);t.labelStyle=r||``;let a=t.width;t.width=(t.width??200)-10;let{shapeSvg:o,bbox:s,label:c}=await mX(e,t,gX(t)),l=t.padding||10,u=``,d;`ticket`in t&&t.ticket&&n?.kanban?.ticketBaseUrl&&(u=n?.kanban?.ticketBaseUrl.replace(`#TICKET#`,t.ticket),d=o.insert(`svg:a`,`:first-child`).attr(`class`,`kanban-ticket-link`).attr(`xlink:href`,u).attr(`target`,`_blank`));let f={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||``,width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},p,m;d?{label:p,bbox:m}=await hX(d,`ticket`in t&&t.ticket||``,f):{label:p,bbox:m}=await hX(o,`ticket`in t&&t.ticket||``,f);let{label:h,bbox:g}=await hX(o,`assigned`in t&&t.assigned||``,f);t.width=a;let _=t?.width||0,v=Math.max(m.height,g.height)/2,y=Math.max(s.height+20,t?.height||0)+v,b=-_/2,x=-y/2;c.attr(`transform`,`translate(`+(l-_/2)+`, `+(-v-s.height/2)+`)`),p.attr(`transform`,`translate(`+(l-_/2)+`, `+(-v+s.height/2)+`)`),h.attr(`transform`,`translate(`+(l+_/2-g.width-20)+`, `+(-v+s.height/2)+`)`);let S,{rx:C,ry:w}=t,{cssStyles:T}=t;if(t.look===`handDrawn`){let e=k.svg(o),n=Z(t,{}),r=C||w?e.path(CX(b,x,_,y,C||0),n):e.rectangle(b,x,_,y,n);S=o.insert(()=>r,`:first-child`),S.attr(`class`,`basic label-container`).attr(`style`,T||null)}else{S=o.insert(`rect`,`:first-child`),S.attr(`class`,`basic label-container __APA__`).attr(`style`,i).attr(`rx`,C??5).attr(`ry`,w??5).attr(`x`,b).attr(`y`,x).attr(`width`,_).attr(`height`,y);let e=`priority`in t&&t.priority;if(e){let t=o.append(`line`),n=b+2,r=x+Math.floor((C??0)/2),i=x+y-Math.floor((C??0)/2);t.attr(`x1`,n).attr(`y1`,r).attr(`x2`,n).attr(`y2`,i).attr(`stroke-width`,`4`).attr(`stroke`,jQ(e))}}return Q(t,S),t.height=y,t.intersect=function(e){return $.rect(t,e)},o}W(MQ,`kanbanItem`);async function NQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await mX(e,t,gX(t)),c=a.width+10*o,l=a.height+8*o,u=.15*c,{cssStyles:d}=t,f=a.width+20,p=a.height+20,m=Math.max(c,f),h=Math.max(l,p);s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`);let g,_=`M0 0
469
+ a${u},${u} 1 0,0 ${m*.25},${-1*h*.1}
470
+ a${u},${u} 1 0,0 ${m*.25},0
471
+ a${u},${u} 1 0,0 ${m*.25},0
472
+ a${u},${u} 1 0,0 ${m*.25},${h*.1}
473
+
474
+ a${u},${u} 1 0,0 ${m*.15},${h*.33}
475
+ a${u*.8},${u*.8} 1 0,0 0,${h*.34}
476
+ a${u},${u} 1 0,0 ${-1*m*.15},${h*.33}
477
+
478
+ a${u},${u} 1 0,0 ${-1*m*.25},${h*.15}
479
+ a${u},${u} 1 0,0 ${-1*m*.25},0
480
+ a${u},${u} 1 0,0 ${-1*m*.25},0
481
+ a${u},${u} 1 0,0 ${-1*m*.25},${-1*h*.15}
482
+
483
+ a${u},${u} 1 0,0 ${-1*m*.1},${-1*h*.33}
484
+ a${u*.8},${u*.8} 1 0,0 0,${-1*h*.34}
485
+ a${u},${u} 1 0,0 ${m*.1},${-1*h*.33}
486
+ H0 V0 Z`;if(t.look===`handDrawn`){let e=k.svg(i),n=Z(t,{}),r=e.path(_,n);g=i.insert(()=>r,`:first-child`),g.attr(`class`,`basic label-container`).attr(`style`,jq(d))}else g=i.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`d`,_);return g.attr(`transform`,`translate(${-m/2}, ${-h/2})`),Q(t,g),t.calcIntersect=function(e,t){return $.rect(e,t)},t.intersect=function(e){return G.info(`Bang intersect`,t,e),$.rect(t,e)},i}W(NQ,`bang`);async function PQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await mX(e,t,gX(t)),c=a.width+2*o,l=a.height+2*o,u=.15*c,d=.25*c,f=.35*c,p=.2*c,{cssStyles:m}=t,h,g=`M0 0
487
+ a${u},${u} 0 0,1 ${c*.25},${-1*c*.1}
488
+ a${f},${f} 1 0,1 ${c*.4},${-1*c*.1}
489
+ a${d},${d} 1 0,1 ${c*.35},${c*.2}
490
+
491
+ a${u},${u} 1 0,1 ${c*.15},${l*.35}
492
+ a${p},${p} 1 0,1 ${-1*c*.15},${l*.65}
493
+
494
+ a${d},${u} 1 0,1 ${-1*c*.25},${c*.15}
495
+ a${f},${f} 1 0,1 ${-1*c*.5},0
496
+ a${u},${u} 1 0,1 ${-1*c*.25},${-1*c*.15}
497
+
498
+ a${u},${u} 1 0,1 ${-1*c*.1},${-1*l*.35}
499
+ a${p},${p} 1 0,1 ${c*.1},${-1*l*.65}
500
+ H0 V0 Z`;if(t.look===`handDrawn`){let e=k.svg(i),n=Z(t,{}),r=e.path(g,n);h=i.insert(()=>r,`:first-child`),h.attr(`class`,`basic label-container`).attr(`style`,jq(m))}else h=i.insert(`path`,`:first-child`).attr(`class`,`basic label-container`).attr(`style`,r).attr(`d`,g);return s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),h.attr(`transform`,`translate(${-c/2}, ${-l/2})`),Q(t,h),t.calcIntersect=function(e,t){return $.rect(e,t)},t.intersect=function(e){return G.info(`Cloud intersect`,t,e),$.rect(t,e)},i}W(PQ,`cloud`);async function FQ(e,t){let{labelStyles:n,nodeStyles:r}=X(t);t.labelStyle=n;let{shapeSvg:i,bbox:a,halfPadding:o,label:s}=await mX(e,t,gX(t)),c=a.width+8*o,l=a.height+2*o,u=t.look===`neo`?`
501
+ M${-c/2} ${l/2-5}
502
+ v${-l+10}
503
+ q0,-5 5,-5
504
+ h${c-10}
505
+ q5,0 5,5
506
+ v${l-5}
507
+ H${-c/2}
508
+ Z
509
+ `:`
510
+ M${-c/2} ${l/2-5}
511
+ v${-l+10}
512
+ q0,-5 5,-5
513
+ h${c-10}
514
+ q5,0 5,5
515
+ v${l-10}
516
+ q0,5 -5,5
517
+ h${-(c-10)}
518
+ q-5,0 -5,-5
519
+ Z
520
+ `;if(!t.domId)throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);let d=i.append(`path`).attr(`id`,t.domId).attr(`class`,`node-bkg node-`+t.type).attr(`style`,r).attr(`d`,u);return i.append(`line`).attr(`class`,`node-line-`).attr(`x1`,-c/2).attr(`y1`,l/2).attr(`x2`,c/2).attr(`y2`,l/2),s.attr(`transform`,`translate(${-a.width/2}, ${-a.height/2})`),i.append(()=>s.node()),Q(t,d),t.calcIntersect=function(e,t){return $.rect(e,t)},t.intersect=function(e){return $.rect(t,e)},i}W(FQ,`defaultMindmapNode`);async function IQ(e,t){return qX(e,t,{padding:t.padding??0})}W(IQ,`mindmapCircle`);var LQ=[{semanticName:`Process`,name:`Rectangle`,shortName:`rect`,description:`Standard process shape`,aliases:[`proc`,`process`,`rectangle`],internalAliases:[`squareRect`],handler:YZ},{semanticName:`Event`,name:`Rounded Rectangle`,shortName:`rounded`,description:`Represents an event`,aliases:[`event`],internalAliases:[`roundedRect`],handler:GZ},{semanticName:`Terminal Point`,name:`Stadium`,shortName:`stadium`,description:`Terminal point`,aliases:[`terminal`,`pill`],handler:XZ},{semanticName:`Subprocess`,name:`Framed Rectangle`,shortName:`fr-rect`,description:`Subprocess`,aliases:[`subprocess`,`subproc`,`framed-rectangle`,`subroutine`],handler:tQ},{semanticName:`Database`,name:`Cylinder`,shortName:`cyl`,description:`Database storage`,aliases:[`db`,`database`,`cylinder`],handler:cZ},{semanticName:`Start`,name:`Circle`,shortName:`circle`,description:`Starting point`,aliases:[`circ`],handler:qX},{semanticName:`Bang`,name:`Bang`,shortName:`bang`,description:`Bang`,aliases:[`bang`],handler:NQ},{semanticName:`Cloud`,name:`Cloud`,shortName:`cloud`,description:`cloud`,aliases:[`cloud`],handler:PQ},{semanticName:`Decision`,name:`Diamond`,shortName:`diam`,description:`Decision-making step`,aliases:[`decision`,`diamond`,`question`],handler:HZ},{semanticName:`Prepare Conditional`,name:`Hexagon`,shortName:`hex`,description:`Preparation or condition step`,aliases:[`hexagon`,`prepare`],handler:vZ},{semanticName:`Data Input/Output`,name:`Lean Right`,shortName:`lean-r`,description:`Represents input or output`,aliases:[`lean-right`,`in-out`],internalAliases:[`lean_right`],handler:kZ},{semanticName:`Data Input/Output`,name:`Lean Left`,shortName:`lean-l`,description:`Represents output or input`,aliases:[`lean-left`,`out-in`],internalAliases:[`lean_left`],handler:OZ},{semanticName:`Priority Action`,name:`Trapezoid Base Bottom`,shortName:`trap-b`,description:`Priority action`,aliases:[`priority`,`trapezoid-bottom`,`trapezoid`],handler:fQ},{semanticName:`Manual Operation`,name:`Trapezoid Base Top`,shortName:`trap-t`,description:`Represents a manual task`,aliases:[`manual`,`trapezoid-top`,`inv-trapezoid`],internalAliases:[`inv_trapezoid`],handler:TZ},{semanticName:`Stop`,name:`Double Circle`,shortName:`dbl-circ`,description:`Represents a stop point`,aliases:[`double-circle`],internalAliases:[`doublecircle`],handler:uZ},{semanticName:`Text Block`,name:`Text Block`,shortName:`text`,description:`Text block`,handler:aQ},{semanticName:`Card`,name:`Notched Rectangle`,shortName:`notch-rect`,description:`Represents a card`,aliases:[`card`,`notched-rectangle`],handler:GX},{semanticName:`Lined/Shaded Process`,name:`Lined Rectangle`,shortName:`lin-rect`,description:`Lined process shape`,aliases:[`lined-rectangle`,`lined-process`,`lin-proc`,`shaded-process`],handler:qZ},{semanticName:`Start`,name:`Small Circle`,shortName:`sm-circ`,description:`Small starting point`,aliases:[`start`,`small-circle`],internalAliases:[`stateStart`],handler:$Z},{semanticName:`Stop`,name:`Framed Circle`,shortName:`fr-circ`,description:`Stop point`,aliases:[`stop`,`framed-circle`],internalAliases:[`stateEnd`],handler:QZ},{semanticName:`Fork/Join`,name:`Filled Rectangle`,shortName:`fork`,description:`Fork or join in process flow`,aliases:[`join`],internalAliases:[`forkJoin`],handler:hZ},{semanticName:`Collate`,name:`Hourglass`,shortName:`hourglass`,description:`Represents a collate operation`,aliases:[`hourglass`,`collate`],handler:yZ},{semanticName:`Comment`,name:`Curly Brace`,shortName:`brace`,description:`Adds a comment`,aliases:[`comment`,`brace-l`],handler:ZX},{semanticName:`Comment Right`,name:`Curly Brace`,shortName:`brace-r`,description:`Adds a comment`,handler:$X},{semanticName:`Comment with braces on both sides`,name:`Curly Braces`,shortName:`braces`,description:`Adds a comment`,handler:tZ},{semanticName:`Com Link`,name:`Lightning Bolt`,shortName:`bolt`,description:`Communication link`,aliases:[`com-link`,`lightning-bolt`],handler:AZ},{semanticName:`Document`,name:`Document`,shortName:`doc`,description:`Represents a document`,aliases:[`doc`,`document`],handler:_Q},{semanticName:`Delay`,name:`Half-Rounded Rectangle`,shortName:`delay`,description:`Represents a delay`,aliases:[`half-rounded-rectangle`],handler:gZ},{semanticName:`Direct Access Storage`,name:`Horizontal Cylinder`,shortName:`h-cyl`,description:`Direct access storage`,aliases:[`das`,`horizontal-cylinder`],handler:dQ},{semanticName:`Disk Storage`,name:`Lined Cylinder`,shortName:`lin-cyl`,description:`Disk storage`,aliases:[`disk`,`lined-cylinder`],handler:IZ},{semanticName:`Display`,name:`Curved Trapezoid`,shortName:`curv-trap`,description:`Represents a display`,aliases:[`curved-trapezoid`,`display`],handler:nZ},{semanticName:`Divided Process`,name:`Divided Rectangle`,shortName:`div-rect`,description:`Divided process shape`,aliases:[`div-proc`,`divided-rectangle`,`divided-process`],handler:lZ},{semanticName:`Extract`,name:`Triangle`,shortName:`tri`,description:`Extraction process`,aliases:[`extract`,`triangle`],handler:gQ},{semanticName:`Internal Storage`,name:`Window Pane`,shortName:`win-pane`,description:`Internal storage`,aliases:[`internal-storage`,`window-pane`],handler:bQ},{semanticName:`Junction`,name:`Filled Circle`,shortName:`f-circ`,description:`Junction point`,aliases:[`junction`,`filled-circle`],handler:dZ},{semanticName:`Loop Limit`,name:`Trapezoidal Pentagon`,shortName:`notch-pent`,description:`Loop limit step`,aliases:[`loop-limit`,`notched-pentagon`],handler:pQ},{semanticName:`Manual File`,name:`Flipped Triangle`,shortName:`flip-tri`,description:`Manual file operation`,aliases:[`manual-file`,`flipped-triangle`],handler:mZ},{semanticName:`Manual Input`,name:`Sloped Rectangle`,shortName:`sl-rect`,description:`Manual input step`,aliases:[`manual-input`,`sloped-rectangle`],handler:JZ},{semanticName:`Multi-Document`,name:`Stacked Document`,shortName:`docs`,description:`Multiple documents`,aliases:[`documents`,`st-doc`,`stacked-document`],handler:zZ},{semanticName:`Multi-Process`,name:`Stacked Rectangle`,shortName:`st-rect`,description:`Multiple processes`,aliases:[`procs`,`processes`,`stacked-rectangle`],handler:RZ},{semanticName:`Stored Data`,name:`Bow Tie Rectangle`,shortName:`bow-rect`,description:`Stored data`,aliases:[`stored-data`,`bow-tie-rectangle`],handler:HX},{semanticName:`Summary`,name:`Crossed Circle`,shortName:`cross-circ`,description:`Summary`,aliases:[`summary`,`crossed-circle`],handler:YX},{semanticName:`Tagged Document`,name:`Tagged Document`,shortName:`tag-doc`,description:`Tagged document`,aliases:[`tag-doc`,`tagged-document`],handler:iQ},{semanticName:`Tagged Process`,name:`Tagged Rectangle`,shortName:`tag-rect`,description:`Tagged process`,aliases:[`tagged-rectangle`,`tag-proc`,`tagged-process`],handler:rQ},{semanticName:`Paper Tape`,name:`Flag`,shortName:`flag`,description:`Paper tape`,aliases:[`paper-tape`],handler:vQ},{semanticName:`Odd`,name:`Odd`,shortName:`odd`,description:`Odd shape`,internalAliases:[`rect_left_inv_arrow`],handler:UZ},{semanticName:`Lined Document`,name:`Lined Document`,shortName:`lin-doc`,description:`Lined document`,aliases:[`lined-document`],handler:LZ}],RQ=W(()=>{let e=[...Object.entries({state:ZZ,choice:KX,note:BZ,rectWithTitle:WZ,labelRect:DZ,iconSquare:CZ,iconCircle:xZ,icon:bZ,iconRounded:SZ,imageSquare:wZ,anchor:zX,kanbanItem:MQ,mindmapCircle:IQ,defaultMindmapNode:FQ,classBox:OQ,erBox:CQ,requirementBox:kQ}),...LQ.flatMap(e=>[e.shortName,...`aliases`in e?e.aliases:[],...`internalAliases`in e?e.internalAliases:[]].map(t=>[t,e.handler]))];return Object.fromEntries(e)},`generateShapeMap`)();function zQ(e){return e in RQ}W(zQ,`isValidShape`);var BQ=new Map;async function VQ(e,t,n){let r,i;t.shape===`rect`&&(t.rx&&t.ry?t.shape=`roundedRect`:t.shape=`squareRect`);let a=t.shape?RQ[t.shape]:void 0;if(!a)throw Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let o;n.config.securityLevel===`sandbox`?o=`_top`:t.linkTarget&&(o=t.linkTarget||`_blank`),r=e.insert(`svg:a`).attr(`xlink:href`,t.link).attr(`target`,o??null),i=await a(r,t,n)}else i=await a(e,t,n),r=i;return r.attr(`data-look`,jq(t.look)),t.tooltip&&i.attr(`title`,t.tooltip),BQ.set(t.id,r),t.haveCallback&&r.attr(`class`,r.attr(`class`)+` clickable`),r}W(VQ,`insertNode`);var HQ=W((e,t)=>{BQ.set(t.id,e)},`setNodeElem`),UQ=W(()=>{BQ.clear()},`clear`),WQ=W(e=>{let t=BQ.get(e.id);G.trace(`Transforming node`,e.diff,e,`translate(`+(e.x-e.width/2-5)+`, `+e.width/2+`)`);let n=e.diff||0;return e.clusterNode?t.attr(`transform`,`translate(`+(e.x+n-e.width/2)+`, `+(e.y-e.height/2-8)+`)`):t.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`),n},`positionNode`),GQ=W((e,t,n,r,i,a=!1,o)=>{t.arrowTypeStart&&JQ(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&JQ(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),KQ={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},qQ=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],JQ=W((e,t,n,r,i,a,o=!1,s)=>{let c=KQ[n],l=c&&qQ.includes(c.type);if(!c){G.warn(`Unknown arrow type: ${n}`);return}let u=`${i}_${a}-${c.type}${t===`start`?`Start`:`End`}${o&&l?`-margin`:``}`;if(s&&s.trim()!==``){let n=`${u}_${s.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(n)){let e=document.getElementById(u);if(e){let t=e.cloneNode(!0);t.id=n,t.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,s),c.fill&&e.setAttribute(`fill`,s)}),e.parentNode?.appendChild(t)}}e.attr(`marker-${t}`,`url(${r}#${n})`)}else e.attr(`marker-${t}`,`url(${r}#${u})`)},`addEdgeMarker`),YQ=W(e=>typeof e==`string`?e:VL()?.flowchart?.curve,`resolveEdgeCurveType`),XQ=new Map,ZQ=new Map,QQ=W(()=>{XQ.clear(),ZQ.clear()},`clear`),$Q=W(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),e$=W(async(e,t)=>{let n=VL(),r=qI(n),{labelStyles:i}=X(t);t.labelStyle=i;let a=e.insert(`g`).attr(`class`,`edgeLabel`),o=a.insert(`g`).attr(`class`,`label`).attr(`data-id`,t.id),s=t.labelType===`markdown`,c=await pX(e,t.label,{style:$Q(t.labelStyle),useHtmlLabels:r,addSvgBackground:!0,isNode:!1,markdown:s,width:void 0},n);o.node().appendChild(c),G.info(`abc82`,t,t.labelType);let l=c.getBBox(),u=l;if(r){let e=c.children[0],t=gR(c);l=e.getBoundingClientRect(),u=l,t.attr(`width`,l.width),t.attr(`height`,l.height)}else{let e=gR(c).select(`text`).node();e&&typeof e.getBBox==`function`&&(u=e.getBBox())}o.attr(`transform`,UG(u,r)),XQ.set(t.id,a),t.width=l.width,t.height=l.height;let d;if(t.startLabelLeft){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),i=n.insert(`g`).attr(`class`,`inner`),a=await SX(i,t.startLabelLeft,$Q(t.labelStyle)||``,!1,!1);d=a;let o=a.getBBox();if(r){let e=a.children[0],t=gR(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}i.attr(`transform`,UG(o,r)),ZQ.get(t.id)||ZQ.set(t.id,{}),ZQ.get(t.id).startLeft=n,t$(d,t.startLabelLeft)}if(t.startLabelRight){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),i=n.insert(`g`).attr(`class`,`inner`),a=await SX(i,t.startLabelRight,$Q(t.labelStyle)||``,!1,!1);d=a,i.node().appendChild(a);let o=a.getBBox();if(r){let e=a.children[0],t=gR(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}i.attr(`transform`,UG(o,r)),ZQ.get(t.id)||ZQ.set(t.id,{}),ZQ.get(t.id).startRight=n,t$(d,t.startLabelRight)}if(t.endLabelLeft){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),i=n.insert(`g`).attr(`class`,`inner`),a=await SX(i,t.endLabelLeft,$Q(t.labelStyle)||``,!1,!1);d=a;let o=a.getBBox();if(r){let e=a.children[0],t=gR(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}i.attr(`transform`,UG(o,r)),n.node().appendChild(a),ZQ.get(t.id)||ZQ.set(t.id,{}),ZQ.get(t.id).endLeft=n,t$(d,t.endLabelLeft)}if(t.endLabelRight){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),i=n.insert(`g`).attr(`class`,`inner`),a=await SX(i,t.endLabelRight,$Q(t.labelStyle)||``,!1,!1);d=a;let o=a.getBBox();if(r){let e=a.children[0],t=gR(a);o=e.getBoundingClientRect(),t.attr(`width`,o.width),t.attr(`height`,o.height)}i.attr(`transform`,UG(o,r)),n.node().appendChild(a),ZQ.get(t.id)||ZQ.set(t.id,{}),ZQ.get(t.id).endRight=n,t$(d,t.endLabelRight)}return c},`insertEdgeLabel`);function t$(e,t){qI(VL())&&e&&(e.style.width=t.length*9+`px`,e.style.height=`12px`)}W(t$,`setTerminalWidth`);var n$=W((e,t)=>{G.debug(`Moving label abc88 `,e.id,e.label,XQ.get(e.id),t);let n=t.updatedPath?t.updatedPath:t.originalPath,{subGraphTitleTotalMargin:r}=Nq(VL());if(e.label){let i=XQ.get(e.id),a=e.x,o=e.y;if(n){let r=Dq.calcLabelPosition(n);G.debug(`Moving label `+e.label+` from (`,a,`,`,o,`) to (`,r.x,`,`,r.y,`) abc88`),t.updatedPath&&(a=r.x,o=r.y)}i.attr(`transform`,`translate(${a}, ${o+r/2})`)}if(e.startLabelLeft){let t=ZQ.get(e.id).startLeft,r=e.x,i=e.y;if(n){let t=Dq.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.startLabelRight){let t=ZQ.get(e.id).startRight,r=e.x,i=e.y;if(n){let t=Dq.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.endLabelLeft){let t=ZQ.get(e.id).endLeft,r=e.x,i=e.y;if(n){let t=Dq.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}if(e.endLabelRight){let t=ZQ.get(e.id).endRight,r=e.x,i=e.y;if(n){let t=Dq.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,n);r=t.x,i=t.y}t.attr(`transform`,`translate(${r}, ${i})`)}},`positionEdgeLabel`),r$=W((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),i$=W((e,t,n)=>{G.debug(`intersection calc abc89:
521
+ outsidePoint: ${JSON.stringify(t)}
522
+ insidePoint : ${JSON.stringify(n)}
523
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let r=e.x,i=e.y,a=Math.abs(r-n.x),o=e.width/2,s=n.x<t.x?o-a:o+a,c=e.height/2,l=Math.abs(t.y-n.y),u=Math.abs(t.x-n.x);if(Math.abs(i-t.y)*o>Math.abs(r-t.x)*c){let e=n.y<t.y?t.y-c-i:i-c-t.y;s=u*e/l;let r={x:n.x<t.x?n.x+s:n.x-u+s,y:n.y<t.y?n.y+l-e:n.y-l+e};return s===0&&(r.x=t.x,r.y=t.y),u===0&&(r.x=t.x),l===0&&(r.y=t.y),G.debug(`abc89 top/bottom calc, Q ${l}, q ${e}, R ${u}, r ${s}`,r),r}else{s=n.x<t.x?t.x-o-r:r-o-t.x;let e=l*s/u,i=n.x<t.x?n.x+u-s:n.x-u+s,a=n.y<t.y?n.y+e:n.y-e;return G.debug(`sides calc abc89, Q ${l}, q ${e}, R ${u}, r ${s}`,{_x:i,_y:a}),s===0&&(i=t.x,a=t.y),u===0&&(i=t.x),l===0&&(a=t.y),{x:i,y:a}}},`intersection`),a$=W((e,t)=>{G.warn(`abc88 cutPathAtIntersect`,e,t);let n=[],r=e[0],i=!1;return e.forEach(e=>{if(G.info(`abc88 checking point`,e,t),!r$(t,e)&&!i){let a=i$(t,r,e);G.debug(`abc88 inside`,e,r,a),G.debug(`abc88 intersection`,a,t);let o=!1;n.forEach(e=>{o||=e.x===a.x&&e.y===a.y}),n.some(e=>e.x===a.x&&e.y===a.y)?G.warn(`abc88 no intersect`,a,n):n.push(a),i=!0}else G.warn(`abc88 outside`,e,r),r=e,i||n.push(e)}),G.debug(`returning points`,n),n},`cutPathAtIntersect`);function o$(e){let t=[],n=[];for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1];(i.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}W(o$,`extractCornerPoints`);var s$=W(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),c$=W(function(e){let{cornerPointPositions:t}=o$(e),n=[];for(let r=0;r<e.length;r++)if(t.includes(r)){let t=e[r-1],i=e[r+1],a=e[r],o=s$(t,a,5),s=s$(i,a,5),c=s.x-o.x,l=s.y-o.y;n.push(o);let u=Math.sqrt(2)*2,d={x:a.x,y:a.y};Math.abs(i.x-t.x)>10&&Math.abs(i.y-t.y)>=10?(G.debug(`Corner point fixing`,Math.abs(i.x-t.x),Math.abs(i.y-t.y)),d=a.x===o.x?{x:c<0?o.x-5+u:o.x+5-u,y:l<0?o.y-u:o.y+u}:{x:c<0?o.x-u:o.x+u,y:l<0?o.y-5+u:o.y+5-u}):G.debug(`Corner point skipping fixing`,Math.abs(i.x-t.x),Math.abs(i.y-t.y)),n.push(d,s)}else n.push(e[r]);return n},`fixCorners`),l$=W((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(i).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),u$=W(function(e,t,n,r,i,a,o,s=!1){if(!o)throw Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:c}=VL(),l=t.points,u=!1,d=i;var f=a;let p=[];for(let e in t.cssCompiledStyles)Rq(e)||p.push(t.cssCompiledStyles[e]);G.debug(`UIO intersect check`,t.points,f.x,d.x),f.intersect&&d.intersect&&!s&&(l=l.slice(1,t.points.length-1),l.unshift(d.intersect(l[0])),G.debug(`Last point UIO`,t.start,`-->`,t.end,l[l.length-1],f,f.intersect(l[l.length-1])),l.push(f.intersect(l[l.length-1])));let m=btoa(JSON.stringify(l));t.toCluster&&(G.info(`to cluster abc88`,n.get(t.toCluster)),l=a$(t.points,n.get(t.toCluster).node),u=!0),t.fromCluster&&(G.debug(`from cluster abc88`,n.get(t.fromCluster),JSON.stringify(l,null,2)),l=a$(l.reverse(),n.get(t.fromCluster).node).reverse(),u=!0);let h=l.filter(e=>!Number.isNaN(e.y)),g=YQ(t.curve);g!==`rounded`&&(h=c$(h));let _=aV;switch(g){case`linear`:_=aV;break;case`basis`:_=hV;break;case`cardinal`:_=wV;break;case`bumpX`:_=uV;break;case`bumpY`:_=dV;break;case`catmullRom`:_=jV;break;case`monotoneX`:_=GV;break;case`monotoneY`:_=KV;break;case`natural`:_=YV;break;case`step`:_=ZV;break;case`stepAfter`:_=$V;break;case`stepBefore`:_=QV;break;case`rounded`:_=aV;break;default:_=hV}let{x:v,y}=JG(t),b=cV().x(v).y(y).curve(_),x;switch(t.thickness){case`normal`:x=`edge-thickness-normal`;break;case`thick`:x=`edge-thickness-thick`;break;case`invisible`:x=`edge-thickness-invisible`;break;default:x=`edge-thickness-normal`}switch(t.pattern){case`solid`:x+=` edge-pattern-solid`;break;case`dotted`:x+=` edge-pattern-dotted`;break;case`dashed`:x+=` edge-pattern-dashed`;break;default:x+=` edge-pattern-solid`}let S,C=g===`rounded`?d$(p$(h,t),5):b(h),w=Array.isArray(t.style)?t.style:[t.style],T=w.find(e=>e?.startsWith(`stroke:`)),E=``;t.animate&&(E=`edge-animation-fast`),t.animation&&(E=`edge-animation-`+t.animation);let D=!1;if(t.look===`handDrawn`){let n=k.svg(e);Object.assign([],h);let r=n.path(C,{roughness:.3,seed:c});x+=` transition`,S=gR(r).select(`path`).attr(`id`,`${o}-${t.id}`).attr(`class`,` `+x+(t.classes?` `+t.classes:``)+(E?` `+E:``)).attr(`style`,w?w.reduce((e,t)=>e+`;`+t,``):``);let i=S.attr(`d`);S.attr(`d`,i),e.node().appendChild(S.node())}else{let n=p.join(`;`),r=w?w.reduce((e,t)=>e+t+`;`,``):``,i=(n?n+`;`+r+`;`:r)+`;`+(w?w.reduce((e,t)=>e+`;`+t,``):``);S=e.append(`path`).attr(`d`,C).attr(`id`,`${o}-${t.id}`).attr(`class`,` `+x+(t.classes?` `+t.classes:``)+(E?` `+E:``)).attr(`style`,i),T=i.match(/stroke:([^;]+)/)?.[1],D=t.animate===!0||!!t.animation||n.includes(`animation`);let a=S.node(),s=typeof a.getTotalLength==`function`?a.getTotalLength():0,c=GG[t.arrowTypeStart]||0,l=GG[t.arrowTypeEnd]||0;if(t.look===`neo`&&!D){let e=`stroke-dasharray: ${t.pattern===`dotted`||t.pattern===`dashed`?l$(s,c,l):`0 ${c} ${s-c-l} ${l}`}; stroke-dashoffset: 0;`;S.attr(`style`,e+S.attr(`style`))}}S.attr(`data-edge`,!0),S.attr(`data-et`,`edge`),S.attr(`data-id`,t.id),S.attr(`data-points`,m),S.attr(`data-look`,jq(t.look)),t.showPoints&&h.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let O=``;(VL().flowchart.arrowMarkerAbsolute||VL().state.arrowMarkerAbsolute)&&(O=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,O=O.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),G.info(`arrowTypeStart`,t.arrowTypeStart),G.info(`arrowTypeEnd`,t.arrowTypeEnd);let A=!D&&t?.look===`neo`;GQ(S,t,O,o,r,A,T);let ee=Math.floor(l.length/2),j=l[ee];Dq.isLabelCoordinateInPath(j,S.attr(`d`))||(u=!0);let te={};return u&&(te.updatedPath=l),te.originalPath=t.points,te},`insertEdge`);function d$(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a<r;a++){let o=e[a],s=e[a-1],c=e[a+1];if(a===0)n+=`M${o.x},${o.y}`;else if(a===r-1)n+=`L${o.x},${o.y}`;else{let e=o.x-s.x,r=o.y-s.y,a=c.x-o.x,l=c.y-o.y,u=Math.hypot(e,r),d=Math.hypot(a,l);if(u<i||d<i){n+=`L${o.x},${o.y}`;continue}let f=e/u,p=r/u,m=a/d,h=l/d,g=f*m+p*h,_=Math.acos(Math.max(-1,Math.min(1,g)));if(_<i||Math.abs(Math.PI-_)<i){n+=`L${o.x},${o.y}`;continue}let v=Math.min(t/Math.sin(_/2),u/2,d/2),y=o.x-f*v,b=o.y-p*v,x=o.x+m*v,S=o.y+h*v;n+=`L${y},${b}`,n+=`Q${o.x},${o.y} ${x},${S}`}}return n}W(d$,`generateRoundedPath`);function f$(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};let n=t.x-e.x,r=t.y-e.y;return{angle:Math.atan2(r,n),deltaX:n,deltaY:r}}W(f$,`calculateDeltaAndAngle`);function p$(e,t){let n=e.map(e=>({...e}));if(e.length>=2&&WG[t.arrowTypeStart]){let r=WG[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=f$(i,a),s=r*Math.cos(o),c=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+c}let r=e.length;if(r>=2&&WG[t.arrowTypeEnd]){let i=WG[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=f$(o,a),c=i*Math.cos(s),l=i*Math.sin(s);n[r-1].x=a.x-c,n[r-1].y=a.y-l}return n}W(p$,`applyMarkerOffsetsToPoints`);var m$=W((e,t,n,r)=>{t.forEach(t=>{h$[t](e,n,r)})},`insertMarkers`),h$={extension:W((e,t,n)=>{G.trace(`Making markers for `,n),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-extensionStart`).attr(`class`,`marker extension `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-extensionEnd`).attr(`class`,`marker extension `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,n+`_`+t+`-extensionStart-margin`).attr(`class`,`marker extension `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-extensionEnd-margin`).attr(`class`,`marker extension `+t).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:W((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:W((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:W((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:W((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:W((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:W((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:W((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:W((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:W((e,t,n)=>{let{themeVariables:r}=RI(),{transitionColor:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${i}`)},`barbNeo`),only_one:W((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:W((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:W((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:W((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:W((e,t,n)=>{let{themeVariables:r}=RI(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${i}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${i}`)},`only_one_neo`),zero_or_one_neo:W((e,t,n)=>{let{themeVariables:r}=RI(),{strokeWidth:i,mainBkg:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);o.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${i}`).attr(`r`,6),o.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${i}`);let s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${i}`).attr(`r`,6),s.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${i}`)},`zero_or_one_neo`),one_or_more_neo:W((e,t,n)=>{let{themeVariables:r}=RI(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${i}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${i}`)},`one_or_more_neo`),zero_or_more_neo:W((e,t,n)=>{let{themeVariables:r}=RI(),{strokeWidth:i,mainBkg:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);o.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${i}`),o.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${i}`);let s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${i}`),s.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${i}`)},`zero_or_more_neo`),requirement_arrow:W((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0
524
+ L20,10
525
+ M20,10
526
+ L0,20`)},`requirement_arrow`),requirement_contains:W((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`g`);r.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),r.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),r.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10)},`requirement_contains`),requirement_arrow_neo:W((e,t,n)=>{let{themeVariables:r}=RI(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`stroke-width`,`${i}`).attr(`viewBox`,`0 0 25 20`).append(`path`).attr(`d`,`M0,0
527
+ L20,10
528
+ M20,10
529
+ L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:W((e,t,n)=>{let{themeVariables:r}=RI(),{strokeWidth:i}=r,a=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);a.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),a.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),a.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),a.selectAll(`*`).attr(`stroke-width`,`${i}`)},`requirement_contains_neo`)},g$=m$,_$={common:yL,getConfig:RI,insertCluster:DX,insertEdge:u$,insertEdgeLabel:e$,insertMarkers:g$,insertNode:VQ,interpolateToCurve:QK,labelHelper:mX,log:G,positionEdgeLabel:n$},v$={},y$=W(e=>{for(let t of e)v$[t.name]=t},`registerLayoutLoaders`);W(()=>{y$([{name:`dagre`,loader:W(async()=>await LF(()=>import(`./dagre-KV5264BT-Cj7MMxfe.js`),__vite__mapDeps([2,3,4,5,6,7,8])),`loader`)},...[{name:`cose-bilkent`,loader:W(async()=>await LF(()=>import(`./cose-bilkent-S5V4N54A-DeGnTGlN.js`),__vite__mapDeps([9,1,10])),`loader`)}]])},`registerDefaultLayoutLoaders`)();var b$=W(async(e,t)=>{if(!(e.layoutAlgorithm in v$))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=v$[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,_$,{algorithm:n.algorithm})},`render`),x$=W((e=``,{fallback:t=`dagre`}={})=>{if(e in v$)return e;if(t in v$)return G.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`),S$=`comm`,C$=`rule`,w$=`decl`,T$=`@import`,E$=`@namespace`,D$=`@keyframes`,O$=`@layer`,k$=Math.abs,A$=String.fromCharCode;function j$(e){return e.trim()}function M$(e,t,n){return e.replace(t,n)}function N$(e,t){return e.charCodeAt(t)|0}function P$(e,t,n){return e.slice(t,n)}function F$(e){return e.length}function I$(e){return e.length}function L$(e,t){return t.push(e),e}var R$=1,z$=1,B$=0,V$=0,H$=0,U$=``;function W$(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:R$,column:z$,length:o,return:``,siblings:s}}function G$(){return H$}function K$(){return H$=V$>0?N$(U$,--V$):0,z$--,H$===10&&(z$=1,R$--),H$}function q$(){return H$=V$<B$?N$(U$,V$++):0,z$++,H$===10&&(z$=1,R$++),H$}function J$(){return N$(U$,V$)}function Y$(){return V$}function X$(e,t){return P$(U$,e,t)}function Z$(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Q$(e){return R$=z$=1,B$=F$(U$=e),V$=0,[]}function $$(e){return U$=``,e}function e1(e){return j$(X$(V$-1,r1(e===91?e+2:e===40?e+1:e)))}function t1(e){for(;(H$=J$())&&H$<33;)q$();return Z$(e)>2||Z$(H$)>3?``:` `}function n1(e,t){for(;--t&&q$()&&!(H$<48||H$>102||H$>57&&H$<65||H$>70&&H$<97););return X$(e,Y$()+(t<6&&J$()==32&&q$()==32))}function r1(e){for(;q$();)switch(H$){case e:return V$;case 34:case 39:e!==34&&e!==39&&r1(H$);break;case 40:e===41&&r1(e);break;case 92:q$();break}return V$}function i1(e,t){for(;q$()&&e+H$!==57&&!(e+H$===84&&J$()===47););return`/*`+X$(t,V$-1)+`*`+A$(e===47?e:q$())}function a1(e){for(;!Z$(J$());)q$();return X$(e,V$)}function o1(e){return $$(s1(``,null,null,null,[``],e=Q$(e),0,[0],e))}function s1(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=q$()){case 40:m!=108&&N$(w,d-1)==58?(v++,w+=`(`):w+=e1(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=e1(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=A$(y);break}w+=t1(m);break;case 92:w+=n1(Y$()-1,7);continue;case 47:switch(J$()){case 42:case 47:L$(l1(i1(q$(),Y$()),t,n,c),c),(Z$(m||1)==5||Z$(J$()||1)==5)&&F$(w)&&P$(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=F$(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=A$(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=M$(w,/\f/g,``)),p>0&&(F$(w)-d||h===0)&&L$(p>32?u1(w+`;`,r,n,d-1,c):u1(M$(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(L$(C=c1(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)s1(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(N$(w,3)===110)break;case 108:if(N$(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?s1(e,C,C,r&&L$(c1(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):s1(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+F$(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&K$()==125)continue}switch(w+=A$(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(F$(w)-1)*_,_=1;break;case 64:J$()===45&&(w+=e1(q$())),f=J$(),u=d=F$(b=w+=a1(Y$())),y++;break;case 45:m===45&&F$(w)==2&&(h=0)}}return a}function c1(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=I$(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=P$(e,f+1,f=k$(g=o[h])),b=e;v<m;++v)(b=j$(g>0?p[v]+` `+y:M$(y,/&\f/g,p[v])))&&(c[_++]=b);return W$(e,t,n,i===0?C$:s,c,l,u,d)}function l1(e,t,n,r){return W$(e,t,n,S$,A$(G$()),P$(e,2,-2),0,r)}function u1(e,t,n,r,i){return W$(e,t,n,w$,P$(e,0,r),P$(e,r+1,-1),r,i)}function d1(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function f1(e,t,n,r){switch(e.type){case O$:if(e.children.length)break;case T$:case E$:case w$:return e.return=e.return||e.value;case S$:return``;case D$:return e.return=e.value+`{`+d1(e.children,r)+`}`;case C$:if(!F$(e.value=e.props.join(`,`)))return``}return F$(n=d1(e.children,r))?e.return=e.value+`{`+n+`}`:``}var p1=y(Object.keys,Object),m1=Object.prototype.hasOwnProperty;function h1(e){if(!x(e))return p1(e);var t=[];for(var n in Object(e))m1.call(e,n)&&n!=`constructor`&&t.push(n);return t}var g1=l(c,`DataView`),_1=l(c,`Promise`),v1=l(c,`Set`),y1=l(c,`WeakMap`),b1=`[object Map]`,x1=`[object Object]`,S1=`[object Promise]`,C1=`[object Set]`,w1=`[object WeakMap]`,T1=`[object DataView]`,E1=o(g1),D1=o(f),O1=o(_1),k1=o(v1),A1=o(y1),j1=s;(g1&&j1(new g1(new ArrayBuffer(1)))!=T1||f&&j1(new f)!=b1||_1&&j1(_1.resolve())!=S1||v1&&j1(new v1)!=C1||y1&&j1(new y1)!=w1)&&(j1=function(e){var t=s(e),n=t==x1?e.constructor:void 0,r=n?o(n):``;if(r)switch(r){case E1:return T1;case D1:return b1;case O1:return S1;case k1:return C1;case A1:return w1}return t});var M1=j1,N1=`[object Map]`,P1=`[object Set]`,F1=Object.prototype.hasOwnProperty;function I1(e){if(e==null)return!0;if(p(e)&&(T(e)||typeof e==`string`||typeof e.splice==`function`||C(e)||v(e)||m(e)))return!e.length;var t=M1(e);if(t==N1||t==P1)return!e.size;if(x(e))return!h1(e).length;for(var n in e)if(F1.call(e,n))return!1;return!0}var L1=`c4`,R1={id:L1,detector:W(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./c4Diagram-AHTNJAMY-CgoOtJ8A.js`);return{diagram:e}},__vite__mapDeps([11,12]));return{id:L1,diagram:e}},`loader`)},z1=`flowchart`,B1={id:z1,detector:W((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-BVrEoz9w.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:z1,diagram:e}},`loader`)},V1=`flowchart-v2`,H1={id:V1,detector:W((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-BVrEoz9w.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:V1,diagram:e}},`loader`)},U1=`er`,W1={id:U1,detector:W(e=>/^\s*erDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./erDiagram-SMLLAGMA-C032vFav.js`);return{diagram:e}},__vite__mapDeps([18,14,15,16]));return{id:U1,diagram:e}},`loader`)},G1=`gitGraph`,K1={id:G1,detector:W(e=>/^\s*gitGraph/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-UUTBAWPF-UptxNUaS.js`);return{diagram:e}},__vite__mapDeps([19,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31,32]));return{id:G1,diagram:e}},`loader`)},q1=`gantt`,J1={id:q1,detector:W(e=>/^\s*gantt/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./ganttDiagram-T4ZO3ILL-C-5won4J.js`);return{diagram:e}},__vite__mapDeps([33,1,34,35,36]));return{id:q1,diagram:e}},`loader`)},Y1=`info`,X1={id:Y1,detector:W(e=>/^\s*info/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./infoDiagram-42DDH7IO-BBHIrMfH.js`);return{diagram:e}},__vite__mapDeps([37,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30]));return{id:Y1,diagram:e}},`loader`)},Z1=`pie`,Q1={id:Z1,detector:W(e=>/^\s*pie/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./pieDiagram-DEJITSTG-BrV4ftE_.js`);return{diagram:e}},__vite__mapDeps([38,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,39,40,36,41,42,31]));return{id:Z1,diagram:e}},`loader`)},$1=`quadrantChart`,e0={id:$1,detector:W(e=>/^\s*quadrantChart/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./quadrantDiagram-34T5L4WZ-DeqodfnC.js`);return{diagram:e}},__vite__mapDeps([43,34,35,36]));return{id:$1,diagram:e}},`loader`)},t0=`xychart`,n0={id:t0,detector:W(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./xychartDiagram-5P7HB3ND-K6LS64rd.js`);return{diagram:e}},__vite__mapDeps([44,34,35,36,40]));return{id:t0,diagram:e}},`loader`)},r0=`requirement`,i0={id:r0,detector:W(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./requirementDiagram-MS252O5E-ChkdYRNA.js`);return{diagram:e}},__vite__mapDeps([45,15,16]));return{id:r0,diagram:e}},`loader`)},a0=`sequence`,o0={id:a0,detector:W(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./sequenceDiagram-FGHM5R23-8COUmxfQ.js`);return{diagram:e}},__vite__mapDeps([46,32,12]));return{id:a0,diagram:e}},`loader`)},s0=`class`,c0={id:s0,detector:W((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./classDiagram-6PBFFD2Q-CGH8dqTY.js`);return{diagram:e}},__vite__mapDeps([47,48,15,16,17,12]));return{id:s0,diagram:e}},`loader`)},l0=`classDiagram`,u0={id:l0,detector:W((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./classDiagram-v2-HSJHXN6E-D3pU3FBM.js`);return{diagram:e}},__vite__mapDeps([49,48,15,16,17,12]));return{id:l0,diagram:e}},`loader`)},d0=`state`,f0={id:d0,detector:W((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./stateDiagram-FHFEXIEX-_-4aujNp.js`);return{diagram:e}},__vite__mapDeps([50,3,4,5,6,7,15,16,51]));return{id:d0,diagram:e}},`loader`)},p0=`stateDiagram`,m0={id:p0,detector:W((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-QKLJ7IA2-qtilh0zP.js`);return{diagram:e}},__vite__mapDeps([52,15,16,51]));return{id:p0,diagram:e}},`loader`)},h0=`journey`,g0={id:h0,detector:W(e=>/^\s*journey/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./journeyDiagram-VCZTEJTY-B_BbvQNc.js`);return{diagram:e}},__vite__mapDeps([53,41,39,17,12]));return{id:h0,diagram:e}},`loader`)},_0={draw:W((e,t,n)=>{G.debug(`rendering svg for syntax error
530
+ `);let r=rH(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),SL(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},v0=_0,y0={db:{},renderer:_0,parser:{parse:W(()=>{},`parse`)}},b0=`flowchart-elk`,x0={id:b0,detector:W((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-BVrEoz9w.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:b0,diagram:e}},`loader`)},S0=`timeline`,C0={id:S0,detector:W(e=>/^\s*timeline/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./timeline-definition-GMOUNBTQ-DJRm4qQU.js`);return{diagram:e}},__vite__mapDeps([54,41,39]));return{id:S0,diagram:e}},`loader`)},w0=`mindmap`,T0={id:w0,detector:W(e=>/^\s*mindmap/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./mindmap-definition-QFDTVHPH-r10UBVF3.js`);return{diagram:e}},__vite__mapDeps([55,15,16]));return{id:w0,diagram:e}},`loader`)},E0=`kanban`,D0={id:E0,detector:W(e=>/^\s*kanban/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./kanban-definition-6JOO6SKY-DoHQ7qx-.js`);return{diagram:e}},__vite__mapDeps([56,17]));return{id:E0,diagram:e}},`loader`)},O0=`sankey`,k0={id:O0,detector:W(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./sankeyDiagram-XADWPNL6-BAddewuC.js`);return{diagram:e}},__vite__mapDeps([57,40,36]));return{id:O0,diagram:e}},`loader`)},A0=`packet`,j0={id:A0,detector:W(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./diagram-TYMM5635-BcdbggR5.js`);return{diagram:e}},__vite__mapDeps([58,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:A0,diagram:e}},`loader`)},M0=`radar`,N0={id:M0,detector:W(e=>/^\s*radar-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./diagram-MMDJMWI5-tWAGPBU1.js`);return{diagram:e}},__vite__mapDeps([59,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:M0,diagram:e}},`loader`)},P0=`block`,F0={id:P0,detector:W(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./blockDiagram-DXYQGD6D-B5nX8SNN.js`);return{diagram:e}},__vite__mapDeps([60,4,5,6,14,8,17]));return{id:P0,diagram:e}},`loader`)},I0=`treeView`,L0={id:I0,detector:W(e=>/^\s*treeView-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./diagram-5BDNPKRD-u7Q7eRkb.js`);return{diagram:e}},__vite__mapDeps([61,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31,32]));return{id:I0,diagram:e}},`loader`)},R0=`architecture`,z0={id:R0,detector:W(e=>/^\s*architecture/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./architectureDiagram-Q4EWVU46-C6Mqm1k6.js`);return{diagram:e}},__vite__mapDeps([62,1,20,21,6,5,7,22,23,24,25,26,27,28,29,30,10,31]));return{id:R0,diagram:e}},`loader`)},B0=`ishikawa`,V0={id:B0,detector:W(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-UXIWVN3A-Dh5OKMNi.js`);return{diagram:e}},__vite__mapDeps([63,64]));return{id:B0,diagram:e}},`loader`)},H0=`venn`,U0={id:H0,detector:W(e=>/^\s*venn-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./vennDiagram-DHZGUBPP-Bo9aJg-c.js`);return{diagram:e}},__vite__mapDeps([65,64]));return{id:H0,diagram:e}},`loader`)},W0=`treemap`,G0={id:W0,detector:W(e=>/^\s*treemap/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./diagram-G4DWMVQ6--XWEw80E.js`);return{diagram:e}},__vite__mapDeps([66,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,35,40,36,31,16]));return{id:W0,diagram:e}},`loader`)},K0=`wardley-beta`,q0={id:K0,detector:W(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await LF(async()=>{let{diagram:e}=await import(`./wardleyDiagram-NUSXRM2D-B4B1ob2l.js`);return{diagram:e}},__vite__mapDeps([67,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:K0,diagram:e}},`loader`)},J0=!1,Y0=W(()=>{J0||(J0=!0,GL(`error`,y0,e=>e.toLowerCase().trim()===`error`),GL(`---`,{db:{clear:W(()=>{},`clear`)},styles:{},renderer:{draw:W(()=>{},`draw`)},parser:{parse:W(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:W(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),WF(x0,T0,z0),WF(R1,D0,u0,c0,W1,J1,X1,Q1,i0,o0,H1,B1,C0,K1,m0,f0,g0,e0,k0,j0,n0,F0,L0,N0,V0,G0,U0,q0))},`addDiagrams`),X0=W(async()=>{G.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(HF).map(async([e,{detector:t,loader:n}])=>{if(n)try{KL(e)}catch{try{let{diagram:e,id:r}=await n();GL(r,e,t)}catch(t){throw G.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete HF[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){G.error(`Failed to load ${e.length} external diagrams`);for(let t of e)G.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),Z0=`graphics-document document`;function Q0(e,t){e.attr(`role`,Z0),t!==``&&e.attr(`aria-roledescription`,t)}W(Q0,`setA11yDiagramInfo`);function $0(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}W($0,`addSVGa11yTitleDescription`);var e2=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{W(this,`Diagram`)}static async fromText(t,n={}){let r=RI(),i=UF(t,r);t=Oq(t)+`
531
+ `;try{KL(i)}catch{let e=KF(i);if(!e)throw new VF(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();GL(t,n)}let{db:a,parser:o,renderer:s,init:c}=KL(i);return o.parser&&(o.parser.yy=a),a.clear?.(),c?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},t2=[],n2=W(()=>{t2.forEach(e=>{e()}),t2=[]},`attachFunctions`),r2=W(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function i2(e){let t=e.match(RF);if(!t)return{text:e,metadata:{}};let n=HG(t[1],{schema:VG})??{};n=typeof n==`object`&&!Array.isArray(n)?n:{};let r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}W(i2,`extractFrontMatter`);var a2=W(e=>e.replace(/\r\n?/g,`
532
+ `).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),o2=W(e=>{let{text:t,metadata:n}=i2(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),s2=W(e=>{let t=Dq.detectInit(e)??{},n=Dq.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:XK(e),directive:t}},`processDirectives`);function c2(e){let t=o2(a2(e)),n=s2(t.text),r=Eq(t.config,n.directive);return e=r2(n.text),{code:e,title:t.title,config:r}}W(c2,`preprocessDiagram`);function l2(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}W(l2,`toBase64`);var u2=5e4,d2=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,f2=`sandbox`,p2=`loose`,m2=`http://www.w3.org/2000/svg`,h2=`http://www.w3.org/1999/xlink`,g2=`http://www.w3.org/1999/xhtml`,_2=`100%`,v2=`100%`,y2=`border:0;margin:0;`,b2=`margin:0`,x2=`allow-top-navigation-by-user-activation allow-popups`,S2=`The "iframe" tag is not supported by your browser.`,C2=[`foreignobject`],w2=[`dominant-baseline`];function T2(e){let t=c2(e);return VI(),BI(t.config??{}),t}W(T2,`processAndSetConfigs`);async function E2(e,t){Y0();try{let{code:t,config:n}=T2(e);return{diagramType:(await L2(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}W(E2,`parse`);var D2=W((e,t,n=[])=>`
533
+ .${e} ${t} { ${n.join(` !important; `)} !important; }`,`cssImportantStyles`),O2=W((e,t=new Map)=>{let n=``;if(e.themeCSS!==void 0&&(n+=`
534
+ ${e.themeCSS}`),e.fontFamily!==void 0&&(n+=`
535
+ :root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(n+=`
536
+ :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){let r=qI(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{I1(e.styles)||r.forEach(t=>{n+=D2(e.id,t,e.styles)}),I1(e.textStyles)||(n+=D2(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))))})}return n},`createCssStyles`),k2=W((e,t,n,r)=>d1(o1(`${r}{${DL(t,O2(e,n),{...e.themeVariables,theme:e.theme,look:e.look},r)}}`),f1),`createUserStyles`),A2=W((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=kq(r),r=r.replace(/<br>/g,`<br/>`),r},`cleanUpSvgCode`),j2=W((e=``,t)=>`<iframe style="width:${_2};height:${t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+`px`:v2};${y2}" src="data:text/html;charset=UTF-8;base64,${l2(`<body style="${b2}">${e}</body>`)}" sandbox="${x2}">
537
+ ${S2}
538
+ </iframe>`,`putIntoIFrame`),M2=W((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,m2);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function N2(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}W(N2,`sandboxedIframe`);var P2=W((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),F2=W(async function(e,t,n){Y0();let r=T2(t);t=r.code;let i=RI();G.debug(i),t.length>(i?.maxTextSize??u2)&&(t=d2);let a=`#`+e,o=`i`+e,s=`#`+o,c=`d`+e,l=`#`+c,u=W(()=>{let e=gR(f?s:l).node();e&&`remove`in e&&e.remove()},`removeTempElements`),d=gR(`body`),f=i.securityLevel===f2,p=i.securityLevel===p2,m=i.fontFamily;n===void 0?(P2(document,e,c,o),f?(d=gR(N2(gR(`body`),o).nodes()[0].contentDocument.body),d.node().style.margin=0):d=gR(`body`),M2(d,e,c)):(n&&(n.innerHTML=``),f?(d=gR(N2(gR(n),o).nodes()[0].contentDocument.body),d.node().style.margin=0):d=gR(n),M2(d,e,c,`font-family: ${m}`,h2));let h,g;try{h=await e2.fromText(t,{title:r.title})}catch(e){if(i.suppressErrorRendering)throw u(),e;h=await e2.fromText(`error`),g=e}let _=d.select(l).node(),v=h.type,y=_.firstChild,b=y.firstChild,x=h.renderer.getClasses?.(t,h),S=k2(i,v,x,a),C=document.createElement(`style`);C.innerHTML=S,y.insertBefore(C,b);try{await h.renderer.draw(t,e,`11.14.0`,h)}catch(n){throw i.suppressErrorRendering?u():v0.draw(t,e,`11.14.0`),n}let w=d.select(`${l} svg`),T=h.db.getAccTitle?.(),E=h.db.getAccDescription?.();R2(v,w,T,E),d.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,g2);let D=d.select(l).node().innerHTML;if(G.debug(`config.arrowMarkerAbsolute`,i.arrowMarkerAbsolute),D=A2(D,f,OI(i.arrowMarkerAbsolute)),f){let e=d.select(l+` svg`).node();D=j2(D,e)}else p||(D=NF.sanitize(D,{ADD_TAGS:C2,ADD_ATTR:w2,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(n2(),g)throw g;return u(),{diagramType:v,svg:D,bindFunctions:h.db.bindFunctions}},`render`);function I2(e={}){let t=JF({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),PI(t),t?.theme&&t.theme in yI?t.themeVariables=yI[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=yI.default.getThemeVariables(t.themeVariables)),nP((typeof t==`object`?Rne(t):II()).logLevel),Y0()}W(I2,`initialize`);var L2=W((e,t={})=>{let{code:n}=c2(e);return e2.fromText(n,t)},`getDiagramFromText`);function R2(e,t,n,r){Q0(t,e),$0(t,n,r,t.attr(`id`))}W(R2,`addA11yInfo`);var z2=Object.freeze({render:F2,parse:E2,getDiagramFromText:L2,initialize:I2,getConfig:RI,setConfig:LI,getSiteConfig:II,updateSiteConfig:FI,reset:W(()=>{VI()},`reset`),globalReset:W(()=>{VI(DI)},`globalReset`),defaultConfig:DI});nP(RI().logLevel),VI(RI());var B2=W((e,t,n)=>{G.warn(e),Cq(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),V2=W(async function(e={querySelector:`.mermaid`}){try{await H2(e)}catch(t){if(Cq(t)&&G.error(t.str),$2.parseError&&$2.parseError(t),!e.suppressErrors)throw G.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),H2=W(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=z2.getConfig();G.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);G.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(G.debug(`Start On Load: `+r?.startOnLoad),z2.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new Dq.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(G.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=zY(Dq.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,`<br/>`);let r=Dq.detectInit(o);r&&G.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await Q2(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){B2(e,s,$2.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),U2=W(function(e){z2.initialize(e)},`initialize`),W2=W(async function(e,t,n){G.warn(`mermaid.init is deprecated. Please use run instead.`),e&&U2(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(t instanceof HTMLElement?r.nodes=[t]:r.nodes=t),await V2(r)},`init`),G2=W(async(e,{lazyLoad:t=!0}={})=>{Y0(),WF(...e),t===!1&&await X0()},`registerExternalDiagrams`),K2=W(function(){if($2.startOnLoad){let{startOnLoad:e}=z2.getConfig();e&&$2.run().catch(e=>G.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,K2,!1);var q2=W(function(e){$2.parseError=e},`setParseErrorHandler`),J2=[],Y2=!1,X2=W(async()=>{if(!Y2){for(Y2=!0;J2.length>0;){let e=J2.shift();if(e)try{await e()}catch(e){G.error(`Error executing queue`,e)}}Y2=!1}},`executeQueue`),Z2=W(async(e,t)=>new Promise((n,r)=>{let i=W(()=>new Promise((i,a)=>{z2.parse(e,t).then(e=>{i(e),n(e)},e=>{G.error(`Error parsing`,e),$2.parseError?.(e),a(e),r(e)})}),`performCall`);J2.push(i),X2().catch(r)}),`parse`),Q2=W((e,t,n)=>new Promise((r,i)=>{let a=W(()=>new Promise((a,o)=>{z2.render(e,t,n).then(e=>{a(e),r(e)},e=>{G.error(`Error parsing`,e),$2.parseError?.(e),o(e),i(e)})}),`performCall`);J2.push(a),X2().catch(i)}),`render`),$2={startOnLoad:!0,mermaidAPI:z2,parse:Z2,render:Q2,init:W2,run:V2,registerExternalDiagrams:G2,registerLayoutLoaders:y$,initialize:U2,parseError:void 0,contentLoaded:K2,setParseErrorHandler:q2,detectType:UF,registerIconPacks:UY,getRegisteredDiagramsMetadata:W(()=>Object.keys(HF).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},e4=$2,t4=()=>document.documentElement.classList.contains(`dark`);e4.initialize({startOnLoad:!1,theme:t4()?`dark`:`default`,suppressErrorRendering:!0});var n4=(0,P.memo)(function({svgContent:e,error:t,isLoading:n}){return(0,R.jsx)(`div`,{className:`mermaid-fullscreen-chart`,children:t?(0,R.jsx)(`div`,{className:`mermaid-error`,children:t}):n?(0,R.jsx)(`div`,{className:`mermaid-loading`,children:`渲染中...`}):e?(0,R.jsx)(`div`,{className:`mermaid-fullscreen-svg-container`,dangerouslySetInnerHTML:{__html:e}}):null})});function r4({source:e,open:t,onOpenChange:n,onSourceChange:r}){let[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(``),[u,d]=(0,P.useState)(!1),[f,p]=(0,P.useState)(0),[m,h]=(0,P.useState)(1),[g,_]=(0,P.useState)({x:0,y:0}),[v,y]=(0,P.useState)(!1),b=(0,P.useRef)({x:0,y:0,posX:0,posY:0}),[x,S]=(0,P.useState)(null),C=(0,P.useRef)(null),w=(0,P.useRef)(null),T=(0,P.useRef)(`mermaid-fullscreen-${Math.random().toString(36).substr(2,9)}`),E=(0,P.useRef)(null),D=(0,P.useRef)(i);D.current=i;let O=(0,P.useRef)(null);(0,P.useEffect)(()=>{let e=()=>{p(e=>e+1)};return window.addEventListener(`theme-change`,e),()=>window.removeEventListener(`theme-change`,e)},[]);let k=(0,P.useCallback)(()=>{O.current&&=(clearTimeout(O.current),null),d(!1)},[]);(0,P.useEffect)(()=>{if(!t)return;h(1),_({x:0,y:0}),d(!0),l(``);let n=t4()?`dark`:`default`;e4.initialize({startOnLoad:!1,theme:n,suppressErrorRendering:!0}),T.current=`mermaid-fullscreen-${Math.random().toString(36).substr(2,9)}`,e4.render(T.current,e).then(({svg:e})=>{s(e),d(!1)}).catch(e=>{l(e.message||`Mermaid render error`),d(!1)})},[t,f]),(0,P.useEffect)(()=>{if(i)return k(),O.current=setTimeout(()=>{let t=E.current?.value??e;d(!0),T.current=`mermaid-fullscreen-${Math.random().toString(36).substr(2,9)}`,e4.render(T.current,t).then(({svg:e})=>{s(e),d(!1)}).catch(e=>{l(e.message||`Mermaid render error`),d(!1)})},800),()=>k()},[i,e,k,f]);let A=e=>{let t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+n*n)},ee=(0,P.useCallback)(e=>{e.preventDefault();let t=e.deltaY>0?-.1:.1;h(e=>Math.min(Math.max(e+t,.5),5))},[]),j=(0,P.useCallback)(e=>{m<=1||(y(!0),b.current={x:e.clientX,y:e.clientY,posX:g.x,posY:g.y})},[m,g]),te=(0,P.useCallback)(e=>{if(!v)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y;_({x:b.current.posX+t,y:b.current.posY+n})},[v]),M=(0,P.useCallback)(()=>{y(!1)},[]),ne=(0,P.useCallback)(()=>{h(1),_({x:0,y:0})},[]),N=(0,P.useCallback)(e=>{e.touches.length===2?(e.preventDefault(),S({x:0,y:0,distance:A(e.touches)})):e.touches.length===1&&m>1&&(y(!0),C.current={x:e.touches[0].clientX,y:e.touches[0].clientY})},[m]),re=(0,P.useCallback)(e=>{if(e.touches.length===2&&x){e.preventDefault();let t=A(e.touches),n=(t-x.distance)/200;h(e=>Math.min(Math.max(e+n,.5),5)),S({x:0,y:0,distance:t})}else if(e.touches.length===1&&v&&C.current){let t=e.touches[0].clientX-C.current.x,n=e.touches[0].clientY-C.current.y;_(e=>({x:e.x+t,y:e.y+n})),C.current={x:e.touches[0].clientX,y:e.touches[0].clientY}}},[x,v]),ie=(0,P.useCallback)(e=>{e.touches.length<2&&S(null),e.touches.length===0&&(y(!1),C.current=null)},[]),ae=(0,P.useCallback)(()=>{h(e=>Math.min(e+.25,5))},[]),oe=(0,P.useCallback)(()=>{h(e=>Math.max(e-.25,.5))},[]),se=(0,P.useCallback)(()=>{h(1),_({x:0,y:0})},[]);return(0,R.jsx)(ts,{open:t,onOpenChange:n,children:(0,R.jsxs)(rs,{children:[(0,R.jsx)(is,{className:`fixed inset-0 z-50 bg-black/80 animate-fade-in`}),(0,R.jsxs)(as,{className:`mermaid-fullscreen-dialog`,style:{position:`fixed`,left:0,top:0,right:0,bottom:0,width:`100vw`,height:`100vh`,maxWidth:`100vw`,maxHeight:`100vh`,transform:`none`,borderRadius:0,margin:0,padding:0,zIndex:51},children:[(0,R.jsx)(ss,{className:`sr-only`,children:`Mermaid 图表全屏预览`}),(0,R.jsxs)(`div`,{className:`mermaid-fullscreen-header`,children:[(0,R.jsx)(`div`,{className:`mermaid-fullscreen-controls`,children:(0,R.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm hover:bg-accent hover:text-accent-foreground transition-colors`,onClick:()=>{if(D.current){k();let t=E.current?.value??e;d(!0),l(``),T.current=`mermaid-fullscreen-${Math.random().toString(36).substr(2,9)}`;let n=t4()?`dark`:`default`;e4.initialize({startOnLoad:!1,theme:n,suppressErrorRendering:!0}),e4.render(T.current,t).then(({svg:n})=>{s(n),d(!1),t!==e&&r?.(t)}).catch(e=>{l(e.message||`Mermaid render error`),d(!1)}),a(!1)}else a(!0)},children:[i?(0,R.jsx)(ze,{className:`size-4`}):(0,R.jsx)(Re,{className:`size-4`}),i?`预览图表`:`查看源码`]})}),(0,R.jsxs)(ls,{className:`rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,R.jsx)(Qe,{className:`size-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`关闭`})]})]}),(0,R.jsxs)(`div`,{className:`mermaid-fullscreen-body`,children:[(0,R.jsxs)(`div`,{ref:w,className:`mermaid-fullscreen-content`,style:{cursor:m>1?v?`grabbing`:`grab`:`default`,width:`100%`,height:`100%`,touchAction:`none`},onWheel:ee,onMouseDown:j,onMouseMove:te,onMouseUp:M,onMouseLeave:M,onDoubleClick:ne,onTouchStart:N,onTouchMove:re,onTouchEnd:ie,children:[(0,R.jsx)(`div`,{style:{transform:`translate(${g.x}px, ${g.y}px) scale(${m})`,transformOrigin:`center center`,transition:v?`none`:`transform 0.1s ease-out`,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,R.jsx)(n4,{svgContent:o,error:c,isLoading:u})}),(0,R.jsxs)(`div`,{className:`mermaid-fullscreen-zoom-controls`,children:[(0,R.jsx)(`button`,{onClick:ae,title:`放大`,children:(0,R.jsx)(et,{className:`size-4`})}),(0,R.jsx)(`button`,{onClick:oe,title:`缩小`,children:(0,R.jsx)(tt,{className:`size-4`})}),(0,R.jsx)(`button`,{onClick:se,title:`重置`,children:(0,R.jsx)(Ke,{className:`size-4`})})]})]}),i&&(0,R.jsx)(`div`,{className:`mermaid-fullscreen-source-panel source-edit-mode`,children:(0,R.jsx)(`textarea`,{ref:E,defaultValue:e,className:`mermaid-fullscreen-source-editor`,spellCheck:!1,onChange:()=>{k(),O.current=setTimeout(()=>{let e=E.current?.value??``;d(!0),T.current=`mermaid-fullscreen-${Math.random().toString(36).substr(2,9)}`,e4.render(T.current,e).then(({svg:e})=>{s(e),d(!1)}).catch(e=>{l(e.message||`Mermaid render error`),d(!1)})},800)}},e)})]})]})]})})}var i4=[{level:0,label:`正文`},{level:1,label:`H1`},{level:2,label:`H2`},{level:3,label:`H3`},{level:4,label:`H4`},{level:5,label:`H5`},{level:6,label:`H6`}];function a4({editor:e,variant:t=`desktop`}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null),a=(()=>{for(let t=1;t<=6;t++)if(e.isActive(`heading`,{level:t}))return t;return 0})(),o=i4.find(e=>e.level===a)?.label||`正文`;(0,P.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&r(!1)};return n&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]);let s=t=>{t===0?e.chain().focus().setParagraph().run():e.chain().focus().toggleHeading({level:t}).run(),r(!1)};return(0,R.jsxs)(`div`,{className:`editor-toolbar-heading`,ref:i,children:[(0,R.jsxs)(`button`,{type:`button`,contentEditable:!1,className:`editor-toolbar-btn editor-toolbar-btn-heading ${n?`open`:``} ${a>0?`active`:``}`,onClick:()=>r(!n),title:`标题`,"aria-expanded":n,children:[(0,R.jsx)(`span`,{className:`editor-toolbar-btn-heading-label`,children:o}),(0,R.jsx)(_e,{className:`size-3`})]}),n&&(0,R.jsx)(`div`,{className:`editor-toolbar-dropdown-menu ${t===`mobile`?`editor-toolbar-dropdown-menu-mobile`:``}`,children:i4.map(e=>(0,R.jsx)(`button`,{type:`button`,contentEditable:!1,className:`editor-toolbar-dropdown-item ${e.level===a?`active`:``}`,onClick:()=>s(e.level),children:(0,R.jsx)(`span`,{className:`heading-label heading-${e.level}`,children:e.label})},e.level))})]})}var o4=[{icon:me,label:`粗体`,isActive:e=>e.isActive(`bold`),action:e=>e.chain().focus().toggleBold().run()},{icon:Ne,label:`斜体`,isActive:e=>e.isActive(`italic`),action:e=>e.chain().focus().toggleItalic().run()},{icon:Ie,label:`无序列表`,isActive:e=>e.isActive(`bulletList`),action:e=>e.chain().focus().toggleBulletList().run()},{icon:Pe,label:`有序列表`,isActive:e=>e.isActive(`orderedList`),action:e=>e.chain().focus().toggleOrderedList().run()},{icon:Fe,label:`任务列表`,isActive:e=>e.isActive(`taskList`),action:e=>e.chain().focus().toggleTaskList().run()},{icon:Ge,label:`引用`,isActive:e=>e.isActive(`blockquote`),action:e=>e.chain().focus().toggleBlockquote().run()},{icon:Se,label:`代码块`,isActive:e=>e.isActive(`codeBlock`),action:e=>e.chain().focus().toggleCodeBlock().run()}];function s4({editor:e,variant:t=`mobile`}){if(!e)return null;let[n,r]=(0,P.useState)(!1),i=(0,P.useCallback)(async()=>{let{from:t,to:n}=e.state.selection,i=t===n?e.getText():e.state.doc.textBetween(t,n,`
539
+ `);if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(i);else{let e=document.createElement(`textarea`);e.value=i,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e)}r(!0),setTimeout(()=>r(!1),1500)},[e]);return(0,R.jsxs)(`div`,{className:`editor-toolbar editor-toolbar-${t}`,children:[(0,R.jsx)(a4,{editor:e,variant:t}),o4.map(t=>{let n=t.icon,r=t.isActive(e);return(0,R.jsx)(`button`,{type:`button`,contentEditable:!1,className:`editor-toolbar-btn ${r?`active`:``}`,onClick:()=>t.action(e),title:t.label,"aria-label":t.label,"aria-pressed":r,children:(0,R.jsx)(n,{className:`size-5`})},t.label)}),(0,R.jsx)(`div`,{className:`editor-toolbar-separator`}),(0,R.jsx)(`button`,{type:`button`,contentEditable:!1,className:`editor-toolbar-btn ${n?`active`:``}`,onClick:i,title:`复制纯文本`,"aria-label":`复制纯文本`,children:(0,R.jsx)(Ce,{className:`size-5`})})]})}function c4(e){return e==null}function l4(e){return typeof e==`object`&&!!e}function u4(e){return Array.isArray(e)?e:c4(e)?[]:[e]}function d4(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function f4(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function p4(e){return e===0&&1/e==-1/0}var m4={isNothing:c4,isObject:l4,toArray:u4,repeat:f4,isNegativeZero:p4,extend:d4};function h4(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
540
+
541
+ `+e.mark.snippet),r+` `+n):r}function g4(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=h4(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}g4.prototype=Object.create(Error.prototype),g4.prototype.constructor=g4,g4.prototype.toString=function(e){return this.name+`: `+h4(this,e)};var _4=g4;function v4(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function y4(e,t){return m4.repeat(` `,t-e.length)+e}function b4(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,o=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var s=``,c,l,u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)l=v4(e.buffer,r[o-c],i[o-c],e.position-(r[o]-r[o-c]),d),s=m4.repeat(` `,t.indent)+y4((e.line-c+1).toString(),u)+` | `+l.str+`
542
+ `+s;for(l=v4(e.buffer,r[o],i[o],e.position,d),s+=m4.repeat(` `,t.indent)+y4((e.line+1).toString(),u)+` | `+l.str+`
543
+ `,s+=m4.repeat(`-`,t.indent+u+3+l.pos)+`^
544
+ `,c=1;c<=t.linesAfter&&!(o+c>=i.length);c++)l=v4(e.buffer,r[o+c],i[o+c],e.position-(r[o]-r[o+c]),d),s+=m4.repeat(` `,t.indent)+y4((e.line+c+1).toString(),u)+` | `+l.str+`
545
+ `;return s.replace(/\n$/,``)}var x4=b4,S4=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],C4=[`scalar`,`sequence`,`mapping`];function w4(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function T4(e,t){if(t||={},Object.keys(t).forEach(function(t){if(S4.indexOf(t)===-1)throw new _4(`Unknown option "`+t+`" is met in definition of "`+e+`" YAML type.`)}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=w4(t.styleAliases||null),C4.indexOf(this.kind)===-1)throw new _4(`Unknown kind "`+this.kind+`" is specified for "`+e+`" YAML type.`)}var E4=T4;function D4(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function O4(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function k4(e){return this.extend(e)}k4.prototype.extend=function(e){var t=[],n=[];if(e instanceof E4)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new _4(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);t.forEach(function(e){if(!(e instanceof E4))throw new _4(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(e.loadKind&&e.loadKind!==`scalar`)throw new _4(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(e.multi)throw new _4(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),n.forEach(function(e){if(!(e instanceof E4))throw new _4(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});var r=Object.create(k4.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=D4(r,`implicit`),r.compiledExplicit=D4(r,`explicit`),r.compiledTypeMap=O4(r.compiledImplicit,r.compiledExplicit),r};var A4=new k4({explicit:[new E4(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:function(e){return e===null?``:e}}),new E4(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:function(e){return e===null?[]:e}}),new E4(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:function(e){return e===null?{}:e}})]});function j4(e){if(e===null)return!0;var t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}function M4(){return null}function N4(e){return e===null}var P4=new E4(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:j4,construct:M4,predicate:N4,represent:{canonical:function(){return`~`},lowercase:function(){return`null`},uppercase:function(){return`NULL`},camelcase:function(){return`Null`},empty:function(){return``}},defaultStyle:`lowercase`});function F4(e){if(e===null)return!1;var t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}function I4(e){return e===`true`||e===`True`||e===`TRUE`}function L4(e){return Object.prototype.toString.call(e)===`[object Boolean]`}var R4=new E4(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:F4,construct:I4,predicate:L4,represent:{lowercase:function(e){return e?`true`:`false`},uppercase:function(e){return e?`TRUE`:`FALSE`},camelcase:function(e){return e?`True`:`False`}},defaultStyle:`lowercase`});function z4(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function B4(e){return 48<=e&&e<=55}function V4(e){return 48<=e&&e<=57}function H4(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i===`-`||i===`+`)&&(i=e[++n]),i===`0`){if(n+1===t)return!0;if(i=e[++n],i===`b`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(i!==`0`&&i!==`1`)return!1;r=!0}return r&&i!==`_`}if(i===`x`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!z4(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}if(i===`o`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!B4(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}}if(i===`_`)return!1;for(;n<t;n++)if(i=e[n],i!==`_`){if(!V4(e.charCodeAt(n)))return!1;r=!0}return!(!r||i===`_`)}function U4(e){var t=e,n=1,r;if(t.indexOf(`_`)!==-1&&(t=t.replace(/_/g,``)),r=t[0],(r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function W4(e){return Object.prototype.toString.call(e)===`[object Number]`&&e%1==0&&!m4.isNegativeZero(e)}var G4=new E4(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:H4,construct:U4,predicate:W4,represent:{binary:function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},octal:function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)}},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),K4=RegExp(`^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function q4(e){return!(e===null||!K4.test(e)||e[e.length-1]===`_`)}function J4(e){var t=e.replace(/_/g,``).toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}var Y4=/^[-+]?[0-9]+e/;function X4(e,t){var n;if(isNaN(e))switch(t){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(e===1/0)switch(t){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(e===-1/0)switch(t){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(m4.isNegativeZero(e))return`-0.0`;return n=e.toString(10),Y4.test(n)?n.replace(`e`,`.e`):n}function Z4(e){return Object.prototype.toString.call(e)===`[object Number]`&&(e%1!=0||m4.isNegativeZero(e))}var Q4=new E4(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:q4,construct:J4,predicate:Z4,represent:X4,defaultStyle:`lowercase`}),$4=A4.extend({implicit:[P4,R4,G4,Q4]}),e3=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),t3=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function n3(e){return e===null?!1:e3.exec(e)!==null||t3.exec(e)!==null}function r3(e){var t,n,r,i,a,o,s,c=0,l=null,u,d,f;if(t=e3.exec(e),t===null&&(t=t3.exec(e)),t===null)throw Error(`Date resolve error`);if(n=+t[1],r=t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+=`0`;c=+c}return t[9]&&(u=+t[10],d=+(t[11]||0),l=(u*60+d)*6e4,t[9]===`-`&&(l=-l)),f=new Date(Date.UTC(n,r,i,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}function i3(e){return e.toISOString()}var a3=new E4(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:n3,construct:r3,instanceOf:Date,represent:i3});function o3(e){return e===`<<`||e===null}var s3=new E4(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:o3}),c3=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
546
+ \r`;function l3(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=c3;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8==0}function u3(e){var t,n,r=e.replace(/[\r\n=]/g,``),i=r.length,a=c3,o=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}function d3(e){var t=``,n=0,r,i,a=e.length,o=c3;for(r=0;r<a;r++)r%3==0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function f3(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}var p3=new E4(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:l3,construct:u3,predicate:f3,represent:d3}),m3=Object.prototype.hasOwnProperty,h3=Object.prototype.toString;function g3(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,h3.call(i)!==`[object Object]`)return!1;for(a in i)if(m3.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function _3(e){return e===null?[]:e}var v3=new E4(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:g3,construct:_3}),y3=Object.prototype.toString;function b3(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],y3.call(r)!==`[object Object]`||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function x3(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var S3=new E4(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:b3,construct:x3}),C3=Object.prototype.hasOwnProperty;function w3(e){if(e===null)return!0;var t,n=e;for(t in n)if(C3.call(n,t)&&n[t]!==null)return!1;return!0}function T3(e){return e===null?{}:e}var E3=new E4(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:w3,construct:T3}),D3=$4.extend({implicit:[a3,s3],explicit:[p3,v3,S3,E3]}),O3=Object.prototype.hasOwnProperty,k3=1,A3=2,j3=3,M3=4,N3=1,P3=2,F3=3,I3=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,L3=/[\x85\u2028\u2029]/,R3=/[,\[\]\{\}]/,z3=/^(?:!|!!|![a-z\-]+!)$/i,B3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function V3(e){return Object.prototype.toString.call(e)}function H3(e){return e===10||e===13}function U3(e){return e===9||e===32}function W3(e){return e===9||e===32||e===10||e===13}function G3(e){return e===44||e===91||e===93||e===123||e===125}function K3(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function q3(e){return e===120?2:e===117?4:e===85?8:0}function J3(e){return 48<=e&&e<=57?e-48:-1}function Y3(e){return e===48?`\0`:e===97?`\x07`:e===98?`\b`:e===116||e===9?` `:e===110?`
547
+ `:e===118?`\v`:e===102?`\f`:e===114?`\r`:e===101?`\x1B`:e===32?` `:e===34?`"`:e===47?`/`:e===92?`\\`:e===78?`…`:e===95?`\xA0`:e===76?`\u2028`:e===80?`\u2029`:``}function X3(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Z3(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var Q3=Array(256),$3=Array(256),e6=0;e6<256;e6++)Q3[e6]=+!!Y3(e6),$3[e6]=Y3(e6);function t6(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||D3,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function n6(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=x4(n),new _4(t,n)}function r6(e,t){throw n6(e,t)}function i6(e,t){e.onWarning&&e.onWarning.call(null,n6(e,t))}var a6={YAML:function(e,t,n){var r,i,a;e.version!==null&&r6(e,`duplication of %YAML directive`),n.length!==1&&r6(e,`YAML directive accepts exactly one argument`),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&r6(e,`ill-formed argument of the YAML directive`),i=parseInt(r[1],10),a=parseInt(r[2],10),i!==1&&r6(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&i6(e,`unsupported YAML version of the document`)},TAG:function(e,t,n){var r,i;n.length!==2&&r6(e,`TAG directive accepts exactly two arguments`),r=n[0],i=n[1],z3.test(r)||r6(e,`ill-formed tag handle (first argument) of the TAG directive`),O3.call(e.tagMap,r)&&r6(e,`there is a previously declared suffix for "`+r+`" tag handle`),B3.test(i)||r6(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{i=decodeURIComponent(i)}catch{r6(e,`tag prefix is malformed: `+i)}e.tagMap[r]=i}};function o6(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||r6(e,`expected valid JSON character`);else I3.test(s)&&r6(e,`the stream contains non-printable characters`);e.result+=s}}function s6(e,t,n,r){var i,a,o,s;for(m4.isObject(n)||r6(e,`cannot merge mappings; the provided source object is unacceptable`),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],O3.call(t,a)||(Z3(t,a,n[a]),r[a]=!0)}function c6(e,t,n,r,i,a,o,s,c){var l,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,u=i.length;l<u;l+=1)Array.isArray(i[l])&&r6(e,`nested arrays are not supported inside keys`),typeof i==`object`&&V3(i[l])===`[object Object]`&&(i[l]=`[object Object]`);if(typeof i==`object`&&V3(i)===`[object Object]`&&(i=`[object Object]`),i=String(i),t===null&&(t={}),r===`tag:yaml.org,2002:merge`)if(Array.isArray(a))for(l=0,u=a.length;l<u;l+=1)s6(e,t,a[l],n);else s6(e,t,a,n);else !e.json&&!O3.call(n,i)&&O3.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,r6(e,`duplicated mapping key`)),Z3(t,i,a),delete n[i];return t}function l6(e){var t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):r6(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function u6(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;U3(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(H3(i))for(l6(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&i6(e,`deficient indentation`),r}function d6(e){var t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||W3(n)))}function f6(e,t){t===1?e.result+=` `:t>1&&(e.result+=m4.repeat(`
548
+ `,t-1))}function Jie(e,t,n){var r,i,a,o,s,c,l,u,d=e.kind,f=e.result,p=e.input.charCodeAt(e.position);if(W3(p)||G3(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),W3(i)||n&&G3(i)))return!1;for(e.kind=`scalar`,e.result=``,a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),W3(i)||n&&G3(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),W3(r))break}else if(e.position===e.lineStart&&d6(e)||n&&G3(p))break;else if(H3(p))if(c=e.line,l=e.lineStart,u=e.lineIndent,u6(e,!1,-1),e.lineIndent>=t){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=u;break}s&&=(o6(e,a,o,!1),f6(e,e.line-c),a=o=e.position,!1),U3(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return o6(e,a,o,!1),e.result?!0:(e.kind=d,e.result=f,!1)}function Yie(e,t){var n=e.input.charCodeAt(e.position),r,i;if(n!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(o6(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else H3(n)?(o6(e,r,i,!0),f6(e,u6(e,!1,t)),r=i=e.position):e.position===e.lineStart&&d6(e)?r6(e,`unexpected end of the document within a single quoted scalar`):(e.position++,i=e.position);r6(e,`unexpected end of the stream within a single quoted scalar`)}function Xie(e,t){var n,r,i,a,o,s=e.input.charCodeAt(e.position);if(s!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===34)return o6(e,n,e.position,!0),e.position++,!0;else if(s===92){if(o6(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),H3(s))u6(e,!1,t);else if(s<256&&Q3[s])e.result+=$3[s],e.position++;else if((o=q3(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=K3(s))>=0?a=(a<<4)+o:r6(e,`expected hexadecimal character`);e.result+=X3(a),e.position++}else r6(e,`unknown escape sequence`);n=r=e.position}else H3(s)?(o6(e,n,r,!0),f6(e,u6(e,!1,t)),n=r=e.position):e.position===e.lineStart&&d6(e)?r6(e,`unexpected end of the document within a double quoted scalar`):(e.position++,r=e.position);r6(e,`unexpected end of the stream within a double quoted scalar`)}function Zie(e,t){var n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,p,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)u=93,p=!1,s=[];else if(v===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(u6(e,!0,t),v=e.input.charCodeAt(e.position),v===u)return e.position++,e.tag=o,e.anchor=c,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?v===44&&r6(e,`expected the node content, but found ','`):r6(e,`missed comma between flow collection entries`),g=h=_=null,d=f=!1,v===63&&(l=e.input.charCodeAt(e.position+1),W3(l)&&(d=f=!0,e.position++,u6(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,m6(e,t,k3,!1,!0),g=e.tag,h=e.result,u6(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),u6(e,!0,t),m6(e,t,k3,!1,!0),_=e.result),p?c6(e,s,m,g,h,_,r,i,a):d?s.push(c6(e,null,m,g,h,_,r,i,a)):s.push(h),u6(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}r6(e,`unexpected end of the stream within a flow collection`)}function Qie(e,t){var n,r,i=N3,a=!1,o=!1,s=t,c=0,l=!1,u,d=e.input.charCodeAt(e.position);if(d===124)r=!1;else if(d===62)r=!0;else return!1;for(e.kind=`scalar`,e.result=``;d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)N3===i?i=d===43?F3:P3:r6(e,`repeat of a chomping mode identifier`);else if((u=J3(d))>=0)u===0?r6(e,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?r6(e,`repeat of an indentation width identifier`):(s=t+u-1,o=!0);else break;if(U3(d)){do d=e.input.charCodeAt(++e.position);while(U3(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!H3(d)&&d!==0)}for(;d!==0;){for(l6(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),H3(d)){c++;continue}if(e.lineIndent<s){i===F3?e.result+=m4.repeat(`
549
+ `,a?1+c:c):i===N3&&a&&(e.result+=`
550
+ `);break}for(r?U3(d)?(l=!0,e.result+=m4.repeat(`
551
+ `,a?1+c:c)):l?(l=!1,e.result+=m4.repeat(`
552
+ `,c+1)):c===0?a&&(e.result+=` `):e.result+=m4.repeat(`
553
+ `,c):e.result+=m4.repeat(`
554
+ `,a?1+c:c),a=!0,o=!0,c=0,n=e.position;!H3(d)&&d!==0;)d=e.input.charCodeAt(++e.position);o6(e,n,e.position,!1)}return!0}function p6(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,r6(e,`tab characters must not be used in indentation`)),!(c!==45||(o=e.input.charCodeAt(e.position+1),!W3(o))));){if(s=!0,e.position++,u6(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,m6(e,t,j3,!1,!0),a.push(e.result),u6(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)r6(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind=`sequence`,e.result=a,!0):!1}function $ie(e,t,n){var r,i,a,o,s,c,l=e.tag,u=e.anchor,d={},f=Object.create(null),p=null,m=null,h=null,g=!1,_=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,r6(e,`tab characters must not be used in indentation`)),r=e.input.charCodeAt(e.position+1),a=e.line,(v===63||v===58)&&W3(r))v===63?(g&&(c6(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!0,i=!0):g?(g=!1,i=!0):r6(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=r;else{if(o=e.line,s=e.lineStart,c=e.position,!m6(e,n,A3,!1,!0))break;if(e.line===a){for(v=e.input.charCodeAt(e.position);U3(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),W3(v)||r6(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(c6(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!1,i=!1,p=e.tag,m=e.result;else if(_)r6(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=l,e.anchor=u,!0}else if(_)r6(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=l,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(g&&(o=e.line,s=e.lineStart,c=e.position),m6(e,t,M3,!0,i)&&(g?m=e.result:h=e.result),g||(c6(e,d,f,p,m,h,o,s,c),p=m=h=null),u6(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&v!==0)r6(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&c6(e,d,f,p,m,null,o,s,c),_&&(e.tag=l,e.anchor=u,e.kind=`mapping`,e.result=d),_}function eae(e){var t,n=!1,r=!1,i,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;if(e.tag!==null&&r6(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i=`!!`,o=e.input.charCodeAt(++e.position)):i=`!`,t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):r6(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!W3(o);)o===33&&(r?r6(e,`tag suffix cannot contain exclamation marks`):(i=e.input.slice(t-1,e.position+1),z3.test(i)||r6(e,`named tag handle cannot contain such characters`),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),R3.test(a)&&r6(e,`tag suffix cannot contain flow indicator characters`)}a&&!B3.test(a)&&r6(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{r6(e,`tag name is malformed: `+a)}return n?e.tag=a:O3.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i===`!`?e.tag=`!`+a:i===`!!`?e.tag=`tag:yaml.org,2002:`+a:r6(e,`undeclared tag handle "`+i+`"`),!0}function tae(e){var t,n=e.input.charCodeAt(e.position);if(n!==38)return!1;for(e.anchor!==null&&r6(e,`duplication of an anchor property`),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!W3(n)&&!G3(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&r6(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(t,e.position),!0}function nae(e){var t,n,r=e.input.charCodeAt(e.position);if(r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!W3(r)&&!G3(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&r6(e,`name of an alias node must contain at least one character`),n=e.input.slice(t,e.position),O3.call(e.anchorMap,n)||r6(e,`unidentified alias "`+n+`"`),e.result=e.anchorMap[n],u6(e,!0,-1),!0}function m6(e,t,n,r,i){var a,o,s,c=1,l=!1,u=!1,d,f,p,m,h,g;if(e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=M3===n||j3===n,r&&u6(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;eae(e)||tae(e);)u6(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&=l||i,(c===1||M3===n)&&(h=k3===n||A3===n?t:t+1,g=e.position-e.lineStart,c===1?s&&(p6(e,g)||$ie(e,g,h))||Zie(e,h)?u=!0:(o&&Qie(e,h)||Yie(e,h)||Xie(e,h)?u=!0:nae(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&r6(e,`alias node should not have any properties`)):Jie(e,h,k3===n)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=s&&p6(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag===`?`){for(e.result!==null&&e.kind!==`scalar`&&r6(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`),d=0,f=e.implicitTypes.length;d<f;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!==`!`){if(O3.call(e.typeMap[e.kind||`fallback`],e.tag))m=e.typeMap[e.kind||`fallback`][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||`fallback`],d=0,f=p.length;d<f;d+=1)if(e.tag.slice(0,p[d].tag.length)===p[d].tag){m=p[d];break}m||r6(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&m.kind!==e.kind&&r6(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+m.kind+`", not "`+e.kind+`"`),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):r6(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),e.tag!==null||e.anchor!==null||u}function rae(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(u6(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!W3(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&r6(e,`directive name must not be less than one character in length`);o!==0;){for(;U3(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!H3(o));break}if(H3(o))break;for(n=e.position;o!==0&&!W3(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&l6(e),O3.call(a6,r)?a6[r](e,r,i):i6(e,`unknown document directive "`+r+`"`)}if(u6(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,u6(e,!0,-1)):a&&r6(e,`directives end mark is expected`),m6(e,e.lineIndent-1,M3,!1,!0),u6(e,!0,-1),e.checkLineBreaks&&L3.test(e.input.slice(t,e.position))&&i6(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&d6(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,u6(e,!0,-1));return}if(e.position<e.length-1)r6(e,`end of the stream or a document separator is expected`);else return}function h6(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
555
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new t6(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,r6(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)rae(n);return n.documents}function iae(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);var r=h6(e,n);if(typeof t!=`function`)return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function aae(e,t){var n=h6(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new _4(`expected a single document in the stream, but found more`)}}var g6={loadAll:iae,load:aae},_6=Object.prototype.toString,v6=Object.prototype.hasOwnProperty,y6=65279,oae=9,b6=10,sae=13,cae=32,lae=33,uae=34,x6=35,dae=37,fae=38,pae=39,mae=42,S6=44,hae=45,C6=58,gae=61,_ae=62,vae=63,yae=64,w6=91,T6=93,bae=96,E6=123,xae=124,D6=125,O6={};O6[0]=`\\0`,O6[7]=`\\a`,O6[8]=`\\b`,O6[9]=`\\t`,O6[10]=`\\n`,O6[11]=`\\v`,O6[12]=`\\f`,O6[13]=`\\r`,O6[27]=`\\e`,O6[34]=`\\"`,O6[92]=`\\\\`,O6[133]=`\\N`,O6[160]=`\\_`,O6[8232]=`\\L`,O6[8233]=`\\P`;var Sae=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],Cae=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function wae(e,t){var n,r,i,a,o,s,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&v6.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s;return n}function Tae(e){var t=e.toString(16).toUpperCase(),n,r;if(e<=255)n=`x`,r=2;else if(e<=65535)n=`u`,r=4;else if(e<=4294967295)n=`U`,r=8;else throw new _4(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+n+m4.repeat(`0`,r-t.length)+t}var Eae=1,k6=2;function Dae(e){this.schema=e.schema||D3,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=m4.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=wae(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType===`"`?k6:Eae,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==`function`?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}function A6(e,t){for(var n=m4.repeat(` `,t),r=0,i=-1,a=``,o,s=e.length;r<s;)i=e.indexOf(`
556
+ `,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
557
+ `&&(a+=n),a+=o;return a}function j6(e,t){return`
558
+ `+m4.repeat(` `,e.indent*t)}function Oae(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function M6(e){return e===cae||e===oae}function N6(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==y6||65536<=e&&e<=1114111}function P6(e){return N6(e)&&e!==y6&&e!==sae&&e!==b6}function F6(e,t,n){var r=P6(e),i=r&&!M6(e);return(n?r:r&&e!==S6&&e!==w6&&e!==T6&&e!==E6&&e!==D6)&&e!==x6&&!(t===C6&&!i)||P6(t)&&!M6(t)&&e===x6||t===C6&&i}function kae(e){return N6(e)&&e!==y6&&!M6(e)&&e!==hae&&e!==vae&&e!==C6&&e!==S6&&e!==w6&&e!==T6&&e!==E6&&e!==D6&&e!==x6&&e!==fae&&e!==mae&&e!==lae&&e!==xae&&e!==gae&&e!==_ae&&e!==pae&&e!==uae&&e!==dae&&e!==yae&&e!==bae}function Aae(e){return!M6(e)&&e!==C6}function I6(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function L6(e){return/^\n* /.test(e)}var R6=1,z6=2,B6=3,V6=4,H6=5;function jae(e,t,n,r,i,a,o,s){var c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=kae(I6(e,0))&&Aae(I6(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=I6(e,c),!N6(l))return H6;h&&=F6(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=I6(e,c),l===b6)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!N6(l))return H6;h&&=F6(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?R6:a===k6?H6:z6:n>9&&L6(e)?H6:o?a===k6?H6:z6:f?V6:B6}function Mae(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===k6?`""`:`''`;if(!e.noCompatMode&&(Sae.indexOf(t)!==-1||Cae.test(t)))return e.quotingType===k6?`"`+t+`"`:`'`+t+`'`;var a=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function c(t){return Oae(e,t)}switch(jae(t,s,e.indent,o,c,e.quotingType,e.forceQuotes&&!r,i)){case R6:return t;case z6:return`'`+t.replace(/'/g,`''`)+`'`;case B6:return`|`+U6(t,e.indent)+W6(A6(t,a));case V6:return`>`+U6(t,e.indent)+W6(A6(Nae(t,o),a));case H6:return`"`+Pae(t)+`"`;default:throw new _4(`impossible error: invalid scalar style`)}}()}function U6(e,t){var n=L6(e)?String(t):``,r=e[e.length-1]===`
559
+ `;return n+(r&&(e[e.length-2]===`
560
+ `||e===`
561
+ `)?`+`:r?``:`-`)+`
562
+ `}function W6(e){return e[e.length-1]===`
563
+ `?e.slice(0,-1):e}function Nae(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var r=e.indexOf(`
564
+ `);return r=r===-1?e.length:r,n.lastIndex=r,G6(e.slice(0,r),t)}(),i=e[0]===`
565
+ `||e[0]===` `,a,o;o=n.exec(e);){var s=o[1],c=o[2];a=c[0]===` `,r+=s+(!i&&!a&&c!==``?`
566
+ `:``)+G6(c,t),i=a}return r}function G6(e,t){if(e===``||e[0]===` `)return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
567
+ `+e.slice(i,a),i=a+1),o=s;return c+=`
568
+ `,e.length-i>t&&o>i?c+=e.slice(i,o)+`
569
+ `+e.slice(o+1):c+=e.slice(i),c.slice(1)}function Pae(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=I6(e,i),r=O6[n],!r&&N6(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||Tae(n);return t}function Fae(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(J6(e,t,s,!1,!1)||s===void 0&&J6(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}function K6(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(J6(e,t+1,c,!0,!0,!1,!0)||c===void 0&&J6(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=j6(e,t)),e.dump&&b6===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}function Iae(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),J6(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),J6(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}function Lae(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,u,d,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new _4(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)f=``,(!r||i!==``)&&(f+=j6(e,t)),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),J6(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,d&&(e.dump&&b6===e.dump.charCodeAt(0)?f+=`?`:f+=`? `),f+=e.dump,d&&(f+=j6(e,t)),J6(e,t+1,u,!0,d)&&(e.dump&&b6===e.dump.charCodeAt(0)?f+=`:`:f+=`: `,f+=e.dump,i+=f));e.tag=a,e.dump=i||`{}`}function q6(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,_6.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(v6.call(s.represent,c))r=s.represent[c](t,c);else throw new _4(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}function J6(e,t,n,r,i,a,o){e.tag=null,e.dump=n,q6(e,n,!1)||q6(e,n,!0);var s=_6.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var u=s===`[object Object]`||s===`[object Array]`,d,f;if(u&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!==`?`||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump=`*ref_`+d;else{if(u&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(Lae(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Iae(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?K6(e,t-1,e.dump,i):K6(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Fae(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&Mae(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new _4(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}function Rae(e,t){var n=[],r=[],i,a;for(Y6(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}function Y6(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)Y6(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)Y6(e[r[i]],t,n)}function zae(e,t){t||={};var n=new Dae(t);n.noRefs||Rae(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),J6(n,0,r,!0,!0)?n.dump+`
570
+ `:``}var Bae={dump:zae},Vae=g6.load;g6.loadAll;var Hae=Bae.dump;function Uae({value:e,onChange:t,placeholder:n,className:r}){let i=(0,P.useRef)(null);return(0,P.useEffect)(()=>{let e=i.current;e&&(e.style.height=`auto`,e.style.height=e.scrollHeight+`px`)},[e]),(0,R.jsx)(`textarea`,{ref:i,className:r,value:e,onChange:e=>t(e.target.value),placeholder:n,rows:1})}function Wae(e){return Object.entries(e).map(([e,t])=>({key:e,value:t instanceof Date?t.toISOString().split(`T`)[0]:Array.isArray(t)?t.map(e=>String(e??``)).join(`, `):typeof t==`object`&&t?JSON.stringify(t):String(t??``)}))}function Gae(e){let t={};for(let n of e)n.key&&(t[n.key]=n.value);return t}function Kae(e){try{let t=Vae(e);if(typeof t==`object`&&t)return t}catch{}return{}}function qae({rawFrontmatter:e,onFrontmatterChange:t}){let[n,r]=(0,P.useState)([]),[i,a]=(0,P.useState)(null);(0,P.useEffect)(()=>{if(!e){r([]);return}r(Wae(Kae(e)))},[e]);let o=(0,P.useCallback)(e=>{let n=Gae(e);Object.keys(n).length>0?t(Hae(n,{lineWidth:-1}).trim()):t(null)},[t]),s=(0,P.useCallback)((e,t)=>{r(n=>{let r=n.map((n,r)=>r===e?{...n,key:t}:n);return o(r),r})},[o]),c=(0,P.useCallback)((e,t)=>{r(n=>{let r=n.map((n,r)=>r===e?{...n,value:t}:n);return o(r),r})},[o]),l=(0,P.useCallback)(()=>{r(e=>{let t=[...e,{key:``,value:``}];return o(t),t})},[o]),u=(0,P.useCallback)(e=>{r(t=>{let n=t.filter((t,n)=>n!==e);return o(n),n})},[o]);return(0,R.jsxs)(`div`,{className:`frontmatter-panel`,children:[(0,R.jsxs)(`div`,{className:`frontmatter-panel-header`,children:[(0,R.jsxs)(`div`,{className:`frontmatter-panel-header-left`,children:[(0,R.jsx)(Xe,{className:`frontmatter-panel-header-icon`}),(0,R.jsx)(`span`,{className:`frontmatter-panel-header-title`,children:`文档属性`})]}),(0,R.jsxs)(`span`,{className:`frontmatter-panel-header-count`,children:[n.length,` 项`]})]}),(0,R.jsxs)(`div`,{className:`frontmatter-table-header`,children:[(0,R.jsx)(`div`,{className:`frontmatter-table-header-cell frontmatter-table-header-key`,children:`属性`}),(0,R.jsx)(`div`,{className:`frontmatter-table-header-cell frontmatter-table-header-value`,children:`值`}),(0,R.jsx)(`div`,{className:`frontmatter-table-header-cell frontmatter-table-header-action`})]}),(0,R.jsx)(`div`,{className:`frontmatter-table-body`,children:n.length===0?(0,R.jsx)(`div`,{className:`frontmatter-empty-state`,children:`暂无属性,点击下方添加`}):n.map((e,t)=>(0,R.jsxs)(`div`,{className:`frontmatter-table-row`,onMouseEnter:()=>a(t),onMouseLeave:()=>a(null),children:[(0,R.jsx)(`div`,{className:`frontmatter-table-cell frontmatter-table-cell-key ${i===t?`hovered`:``}`,children:(0,R.jsx)(`input`,{className:`frontmatter-key-input`,value:e.key,onChange:e=>s(t,e.target.value),placeholder:`key`})}),(0,R.jsx)(`div`,{className:`frontmatter-table-cell frontmatter-table-cell-value ${i===t?`hovered`:``}`,children:(0,R.jsx)(Uae,{className:`frontmatter-value-input`,value:e.value,onChange:e=>c(t,e),placeholder:`value`})}),(0,R.jsx)(`div`,{className:`frontmatter-table-cell frontmatter-table-cell-action ${i===t?`hovered`:``}`,children:(0,R.jsx)(`button`,{className:`frontmatter-remove-btn`,onClick:()=>u(t),title:`删除字段`,style:{opacity:+(i===t)},children:(0,R.jsx)(Qe,{className:`size-3`})})})]},t))}),(0,R.jsxs)(`button`,{className:`frontmatter-add-btn`,onClick:l,children:[(0,R.jsx)(We,{className:`size-3`}),`添加字段`]})]})}var Jae=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function X6(e){let t=e.match(Jae);return t?{frontmatter:t[1].trim(),body:e.slice(t[0].length)}:{frontmatter:null,body:e}}function Z6(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function Q6(e){let t=[],n=[],r=e.replace(/```[\s\S]*?```/g,e=>(t.push(e),`\0CODEBLOCK${t.length-1}\0`));return r=r.replace(/`[^`]+`/g,e=>(n.push(e),`\0INLINECODE${n.length-1}\0`)),r=r.replace(/^\$\$([\s\S]*?)\$\$$/gm,(e,t)=>`<div data-type="mathBlock" data-latex="${Z6(t.trim())}"></div>`),r=r.replace(/(?<!\$)\$([^$\n]+?)\$(?!\$)/g,(e,t)=>`<span data-type="mathInline" data-latex="${Z6(t.trim())}"></span>`),r=r.replace(/\0CODEBLOCK(\d+)\0/g,(e,n)=>t[+n]),r=r.replace(/\0INLINECODE(\d+)\0/g,(e,t)=>n[+t]),r}var Yae=Py.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{latex:{default:``,parseHTML:e=>e.getAttribute(`data-latex`)||``,renderHTML:e=>e.latex?{"data-latex":e.latex}:{}}}},parseHTML(){return[{tag:`span[data-type="mathInline"]`,getAttrs:e=>({latex:e.getAttribute(`data-latex`)||``})}]},renderHTML({node:e,HTMLAttributes:t}){return[`span`,X_({"data-type":`mathInline`},t),e.attrs.latex||``]},addNodeView(){return({node:e})=>{let t=document.createElement(`span`);t.className=`math-inline`,t.contentEditable=`false`;let n=e=>{if(e)try{A.render(e,t,{throwOnError:!1,displayMode:!1}),t.classList.remove(`math-error`)}catch{t.textContent=`$${e}$`,t.classList.add(`math-error`)}else t.textContent=`$$`};return n(e.attrs.latex),{dom:t,update:e=>e.type.name===`mathInline`?(n(e.attrs.latex),!0):!1}}},addStorage(){return{markdown:{serialize(e,t){e.write(`$${t.attrs.latex}$`)}}}}}),Xae=Py.create({name:`mathBlock`,group:`block`,atom:!0,addAttributes(){return{latex:{default:``,parseHTML:e=>e.getAttribute(`data-latex`)||``,renderHTML:e=>e.latex?{"data-latex":e.latex}:{}}}},parseHTML(){return[{tag:`div[data-type="mathBlock"]`,getAttrs:e=>({latex:e.getAttribute(`data-latex`)||``})}]},renderHTML({node:e,HTMLAttributes:t}){return[`div`,X_({"data-type":`mathBlock`},t),e.attrs.latex||``]},addNodeView(){return({node:e})=>{let t=document.createElement(`div`);t.className=`math-block`,t.contentEditable=`false`;let n=e=>{if(e)try{A.render(e,t,{throwOnError:!1,displayMode:!0}),t.classList.remove(`math-error`)}catch{t.textContent=`$$${e}$$`,t.classList.add(`math-error`)}else t.textContent=`$$$$`};return n(e.attrs.latex),{dom:t,update:e=>e.type.name===`mathBlock`?(n(e.attrs.latex),!0):!1}}},addStorage(){return{markdown:{serialize(e,t){e.write(`$$
571
+ `),e.write(t.attrs.latex),e.write(`
572
+ $$`),e.closeBlock(t)}}}}}),$6=class e{static instance=null;queue=[];running=new Set;cache=new Map;MAX_CONCURRENT=2;MAX_CACHE_SIZE=50;static getInstance(){return e.instance||=new e,e.instance}request(e,t,n,r){let i=this.getCacheKey(t,n),a=this.cache.get(i);if(a){r(a);return}this.cancel(e),this.queue.push({id:e,source:t,theme:n,callback:r}),this.processQueue()}cancel(e){let t=this.queue.findIndex(t=>t.id===e);t!==-1&&this.queue.splice(t,1),this.running.delete(e)}getCacheKey(e,t){return`${t}::${e}`}getFromCache(e,t){let n=this.getCacheKey(e,t),r=this.cache.get(n);return r?(this.cache.delete(n),this.cache.set(n,r),r):null}setCache(e,t,n){let r=this.getCacheKey(e,t);for(this.cache.has(r)&&this.cache.delete(r);this.cache.size>=this.MAX_CACHE_SIZE;){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(r,n)}processQueue(){if(this.running.size>=this.MAX_CONCURRENT||this.queue.length===0)return;let e=this.queue.shift();e&&(this.running.add(e.id),this.runRender(e))}async runRender(e){let t=this.getFromCache(e.source,e.theme);if(t){this.running.has(e.id)&&(this.running.delete(e.id),e.callback(t)),this.processQueue();return}try{e4.initialize({startOnLoad:!1,theme:e.theme,suppressErrorRendering:!0});let t=`mermaid-queued-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,{svg:n}=await e4.render(t,e.source),r={svg:n,error:``};this.setCache(e.source,e.theme,r),this.running.has(e.id)&&(this.running.delete(e.id),e.callback(r))}catch(t){let n={svg:``,error:t.message||`Mermaid render error`};this.setCache(e.source,e.theme,n),this.running.has(e.id)&&(this.running.delete(e.id),e.callback(n))}finally{this.processQueue()}}}.getInstance(),Zae=YN(KN);function Qae(e,t){let n=t.substring(0,t.lastIndexOf(`/`)),r=e;if(e.startsWith(`./`))r=n+e.slice(1);else if(e.startsWith(`../`)){let t=n,i=e.slice(3);for(;i.startsWith(`../`);){let e=t.lastIndexOf(`/`);if(e<=0)break;t=t.substring(0,e),i=i.slice(3)}r=i.startsWith(`../`)?e:t+`/`+i}else e.startsWith(`/`)||(r=n+`/`+e);return decodeURIComponent(r)}function $ae(e,t,n){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||!t||!n)return e;let r;return r=e.startsWith(`/`)?e:Qae(e,t),`/api/files${r}?root=${encodeURIComponent(n)}`}var e8={path:null,rootPath:null};function eoe({node:e,updateAttributes:t,selected:n,editor:r,getPos:i}){let a=e.attrs.language===`mermaid`,[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(``),[u,d]=(0,P.useState)(!1),[f,p]=(0,P.useState)(0),[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(!1),b=(0,P.useRef)(null),x=(0,P.useRef)(`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`),S=(0,P.useCallback)(async()=>{let t=e.textContent;if(t){if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement(`textarea`);e.value=t,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e)}h(!0),setTimeout(()=>h(!1),1500)}},[e.textContent]),C=e.textContent;return(0,P.useEffect)(()=>{let e=()=>{p(e=>e+1)};return window.addEventListener(`theme-change`,e),()=>window.removeEventListener(`theme-change`,e)},[]),(0,P.useEffect)(()=>{if(!a)return;let e=b.current;if(!e)return;let t=new IntersectionObserver(([e])=>{_(e.isIntersecting)},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[a]),(0,P.useEffect)(()=>{if(!a){s(``),l(``),y(!1);return}if(!C){s(``),l(``),y(!1);return}if(!g){o||y(!1);return}let e=document.documentElement.classList.contains(`dark`)?`dark`:`default`;return y(!0),x.current=`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,$6.request(x.current,C,e,e=>{s(e.svg),l(e.error),y(!1)}),()=>{$6.cancel(x.current)}},[a,C,g,f]),(0,R.jsxs)(ex,{className:`code-block-wrapper ${n?`selected`:``}`,children:[(0,R.jsxs)(`div`,{className:`code-block-header`,children:[(0,R.jsxs)(`select`,{contentEditable:!1,value:e.attrs.language||``,onChange:e=>t({language:e.target.value}),children:[(0,R.jsx)(`option`,{value:``,children:`Plain Text`}),(0,R.jsx)(`option`,{value:`mermaid`,children:`Mermaid`}),(0,R.jsx)(`option`,{value:`javascript`,children:`JavaScript`}),(0,R.jsx)(`option`,{value:`typescript`,children:`TypeScript`}),(0,R.jsx)(`option`,{value:`html`,children:`HTML`}),(0,R.jsx)(`option`,{value:`css`,children:`CSS`}),(0,R.jsx)(`option`,{value:`python`,children:`Python`}),(0,R.jsx)(`option`,{value:`java`,children:`Java`}),(0,R.jsx)(`option`,{value:`cpp`,children:`C++`}),(0,R.jsx)(`option`,{value:`go`,children:`Go`}),(0,R.jsx)(`option`,{value:`rust`,children:`Rust`}),(0,R.jsx)(`option`,{value:`json`,children:`JSON`}),(0,R.jsx)(`option`,{value:`markdown`,children:`Markdown`}),(0,R.jsx)(`option`,{value:`bash`,children:`Bash`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(`button`,{className:`code-block-copy-btn`,contentEditable:!1,onClick:S,title:m?`已复制`:`复制代码`,children:m?(0,R.jsx)(ge,{className:`size-4`}):(0,R.jsx)(Ce,{className:`size-4`})}),a&&(0,R.jsx)(`button`,{className:`mermaid-fullscreen-btn`,contentEditable:!1,onClick:()=>d(!0),title:`全屏预览`,children:(0,R.jsx)(Re,{className:`size-4`})})]})]}),a?(0,R.jsx)(`div`,{ref:b,className:`mermaid-preview`,contentEditable:!1,children:c?(0,R.jsxs)(`div`,{className:`mermaid-error`,children:[`Mermaid Error: `,c]}):o?(0,R.jsx)(`div`,{className:`mermaid-svg-container`,dangerouslySetInnerHTML:{__html:o}}):v?(0,R.jsx)(`div`,{className:`mermaid-loading`,children:`渲染中...`}):(0,R.jsx)(`div`,{className:`mermaid-placeholder`,children:`滚动查看图表`})}):(0,R.jsx)(`pre`,{className:`code-block`,children:(0,R.jsx)(`code`,{children:(0,R.jsx)($b,{})})}),a&&(0,R.jsx)(r4,{source:C,open:u,onOpenChange:e=>d(e),onSourceChange:e=>{let t=typeof i==`function`?i():i;t!=null&&r.commands.command(({tr:n})=>{let r=t+1,i=r+e.length;return n.replaceWith(r,i,n.doc.type.schema.text(e)),!0})}})]})}var toe=zw.extend({addNodeView(){return cx(eoe)}}).configure({lowlight:Zae});function noe({value:e,onChange:t,mode:n,placeholder:r,readOnly:i,path:a,rootPath:o,scrollPosition:s,onLinkClick:c}){e8.path=a??null,e8.rootPath=o??null;let l=(0,P.useRef)(!1),u=(0,P.useRef)(e),d=(0,P.useRef)(null),f=(0,P.useRef)(e),p=(0,P.useRef)(null),[m,h]=(0,P.useState)(()=>typeof window>`u`?!1:window.innerWidth<768),{frontmatter:g,body:_}=X6(e),v=Q6(_),[y,b]=(0,P.useState)(g);p.current=y;let x=(0,P.useRef)(null);(0,P.useEffect)(()=>{b(g)},[g]);let S=(0,P.useCallback)(e=>{b(e),p.current=e;let n=x.current;if(n)try{let r=n.storage.markdown,i=r&&typeof r.getMarkdown==`function`?r.getMarkdown():n.getText(),a=i;e&&(a=`---\n${e}\n---\n${i}`),a!==u.current&&(u.current=a,t(a))}catch(e){console.error(`Failed to rebuild content with frontmatter:`,e)}},[t]);(0,P.useEffect)(()=>{let e=()=>h(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let C=Yb({extensions:[jw.configure({codeBlock:!1,link:!1,underline:!1}),toe,Bw.configure({placeholder:r||`在这里输入 Markdown...`}),ck.configure({html:!0,transformPastedText:!0,transformCopiedText:!0}),pj.configure({resizable:!0}),ej,$A,QA,ew,$C.configure({nested:!0}),NC.configure({openOnClick:!1}),hj.extend({addAttributes(){return{...this.parent?.(),style:{default:null},class:{default:null},htmlAttrs:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`,getAttrs:e=>{let t=e,n=[`src`,`alt`,`title`,`width`,`height`,`style`,`class`,`htmlAttrs`,`draggable`],r={};for(let e of t.attributes)n.includes(e.name)||(r[e.name]=e.value);return{src:t.getAttribute(`src`),alt:t.getAttribute(`alt`),title:t.getAttribute(`title`),width:t.getAttribute(`width`),height:t.getAttribute(`height`),style:t.getAttribute(`style`),class:t.getAttribute(`class`),htmlAttrs:Object.keys(r).length>0?JSON.stringify(r):null}}}]},addStorage(){return{markdown:{serialize(e,t){if(t.attrs.width||t.attrs.height||t.attrs.style||t.attrs.class||t.attrs.htmlAttrs){let n={src:t.attrs.src};if(t.attrs.alt&&(n.alt=t.attrs.alt),t.attrs.title&&(n.title=t.attrs.title),t.attrs.width&&(n.width=String(t.attrs.width)),t.attrs.height&&(n.height=String(t.attrs.height)),t.attrs.style&&(n.style=t.attrs.style),t.attrs.class&&(n.class=t.attrs.class),t.attrs.htmlAttrs)try{let e=JSON.parse(t.attrs.htmlAttrs);Object.assign(n,e)}catch{}let r=Object.entries(n).map(([e,t])=>`${e}="${t.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`)}"`).join(` `);e.write(`<img ${r}>`)}else{let n=e.esc(t.attrs.alt||``),r=e.esc(t.attrs.src||``),i=t.attrs.title?` "${e.esc(t.attrs.title)}"`:``;e.write(`![${n}](${r}${i})`)}e.closeBlock(t)}}}},addNodeView(){return({node:e})=>{let t=document.createElement(`img`),n=(n=e)=>{t.src=$ae(n.attrs.src,e8.path,e8.rootPath),n.attrs.alt?t.alt=n.attrs.alt:t.removeAttribute(`alt`),n.attrs.title?t.title=n.attrs.title:t.removeAttribute(`title`),n.attrs.width?t.setAttribute(`width`,String(n.attrs.width)):t.removeAttribute(`width`),n.attrs.height?t.setAttribute(`height`,String(n.attrs.height)):t.removeAttribute(`height`),t.className=n.attrs.class||``,t.style.cssText=n.attrs.style||``;let r=[`src`,`alt`,`title`,`width`,`height`,`style`,`class`,`contenteditable`,`draggable`];for(let e of Array.from(t.attributes))r.includes(e.name)||t.removeAttribute(e.name);if(n.attrs.htmlAttrs)try{let e=JSON.parse(n.attrs.htmlAttrs);for(let[n,r]of Object.entries(e))r!=null&&t.setAttribute(n,String(r))}catch{}};return n(),{dom:t,update:e=>e.type.name===`image`?(n(e),!0):!1}}}}).configure({allowBase64:!0}),vj.configure({multicolor:!0}),rw,Vj,Yae,Xae],content:v,editable:!i&&n===`wysiwyg`,autofocus:n!==`read`,onUpdate:({editor:e})=>{if(!l.current)try{let n=e.storage.markdown,r=n&&typeof n.getMarkdown==`function`?n.getMarkdown():e.getText(),i=p.current,a=r;i&&(a=`---\n${i}\n---\n${r}`),a!==u.current&&(u.current=a,t(a))}catch(n){console.error(`Failed to get markdown:`,n);let r=e.getText();r!==u.current&&(u.current=r,t(r))}}});x.current=C,(0,P.useEffect)(()=>{C&&C.view.updateState(C.state)},[a,o,C]),(0,P.useEffect)(()=>{if(!C||l.current)return;let t=d.current!==a;d.current=a||null;let{frontmatter:n,body:r}=X6(e);p.current=n;let i=Q6(r),o=``;try{let e=C.storage.markdown;o=e&&typeof e.getMarkdown==`function`?e.getMarkdown():C.getText()}catch{o=C.getText()}if(o===r&&!t){u.current=e;return}let{from:c,to:m}=C.state.selection;l.current=!0,C.commands.setContent(i),u.current=e,requestAnimationFrame(()=>{l.current=!1;try{let e=C.state.doc.content.size,t=Math.min(c,e),n=Math.min(m,e);t>=0&&n>=0&&C.commands.setTextSelection({from:t,to:n})}catch{C.commands.setTextSelection({from:0,to:0})}if(t){let e=s||0;if(e>0){let t=document.querySelector(`.tiptap-editor-scroll-area`);t&&(t.scrollTop=e)}}});let h=f.current===``&&e.length>0;if(f.current=e,t||h){let e=s||0;e>0&&setTimeout(()=>{let t=document.querySelector(`.tiptap-editor-scroll-area`);t&&(t.scrollTop=e)},100)}},[C,e,a,s]),(0,P.useEffect)(()=>{C&&C.setEditable(!i&&n===`wysiwyg`)},[C,i,n]),(0,P.useEffect)(()=>{if(!C||n!==`read`)return;let e=C.view,t=e.dom,r=t=>{t.preventDefault(),e.dom.blur()};return t.addEventListener(`focusin`,r),()=>t.removeEventListener(`focusin`,r)},[C,n]),(0,P.useEffect)(()=>{if(!a||!c)return;let e=e=>{let t=e.target.closest(`a`);if(!t)return;let n=document.querySelector(`.tiptap-editor`);if(!n||!n.contains(t))return;e.preventDefault(),e.stopPropagation();let r=t.getAttribute(`href`);if(!r)return;if(r.startsWith(`http://`)||r.startsWith(`https://`)||r.startsWith(`mailto:`)||r.startsWith(`#`)){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=a.substring(0,a.lastIndexOf(`/`)),o=r;if(r.startsWith(`./`))o=i+r.slice(1);else if(r.startsWith(`../`)){let e=i,t=r.slice(3);for(;t.startsWith(`../`);){let n=e.lastIndexOf(`/`);if(n<=0)break;e=e.substring(0,n),t=t.slice(3)}o=t.startsWith(`../`)?r:e+`/`+t}else r.startsWith(`/`)||(o=i+`/`+r);o=decodeURIComponent(o),c(o)};return document.addEventListener(`click`,e,!0),()=>document.removeEventListener(`click`,e,!0)},[a,c]);let w=(0,P.useRef)(n);if((0,P.useEffect)(()=>{let e=w.current;if(w.current=n,e===n)return;let t=s||0;t<=0||e===`read`&&n===`wysiwyg`||(n===`source`?setTimeout(()=>{let e=document.querySelector(`.editor-textarea`);e&&(e.scrollTop=t)},100):n===`wysiwyg`&&setTimeout(()=>{let e=document.querySelector(`.tiptap-editor-scroll-area`);e&&(e.scrollTop=t)},100))},[n,s]),(0,P.useEffect)(()=>{if(!a)return;let e=`colonynote:scroll-positions`,t=o?`${o}::${a}`:a,r,i=n=>{try{let r=localStorage.getItem(e),i=r?JSON.parse(r):{};i[t]=n,localStorage.setItem(e,JSON.stringify(i))}catch{}};if(n===`source`){let e=document.querySelector(`.editor-textarea`);if(!e)return;let t=()=>{clearTimeout(r),r=window.setTimeout(()=>i(e.scrollTop),500)};return e.addEventListener(`scroll`,t),()=>{e.removeEventListener(`scroll`,t),clearTimeout(r)}}else{let e=document.querySelector(`.tiptap-editor-scroll-area`);if(!e)return;let t=()=>{clearTimeout(r),r=window.setTimeout(()=>i(e.scrollTop),500)};return e.addEventListener(`scroll`,t),()=>{e.removeEventListener(`scroll`,t),clearTimeout(r)}}},[n,a,o]),n===`source`)return(0,R.jsx)(`textarea`,{className:`editor-textarea`,value:e,onChange:e=>t(e.target.value),placeholder:r||`在这里输入 Markdown...`,readOnly:i,spellCheck:!1});let T=n===`read`;return(0,R.jsxs)(`div`,{className:`tiptap-editor-root tiptap-editor`,children:[(0,R.jsx)(`div`,{className:`tiptap-editor-toolbar-area`,children:!T&&!m&&(0,R.jsx)(s4,{editor:C,variant:`desktop`})}),(0,R.jsxs)(`div`,{className:`tiptap-editor-scroll-area`,children:[!T&&(0,R.jsx)(`div`,{className:`frontmatter-panel-wrapper`,children:(0,R.jsx)(qae,{rawFrontmatter:y,onFrontmatterChange:S})}),(0,R.jsx)(Vb,{editor:C,className:`tiptap-editor-content`})]}),m&&!T&&(0,R.jsx)(s4,{editor:C,variant:`mobile`})]})}function t8(e){let t=e+`CollectionProvider`,[n,r]=wr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=P.useRef(null),a=P.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Mr(s),l=P.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:ar(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Mr(u),p=P.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=P.useRef(null),s=ar(t,o),c=a(u,n);return P.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return P.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var roe=P.createContext(void 0);function n8(e){let t=P.useContext(roe);return e||t||`ltr`}var ioe=[`top`,`right`,`bottom`,`left`],r8=Math.min,i8=Math.max,a8=Math.round,o8=Math.floor,s8=e=>({x:e,y:e}),aoe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function c8(e,t,n){return i8(e,r8(t,n))}function l8(e,t){return typeof e==`function`?e(t):e}function u8(e){return e.split(`-`)[0]}function d8(e){return e.split(`-`)[1]}function f8(e){return e===`x`?`y`:`x`}function p8(e){return e===`y`?`height`:`width`}function m8(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function h8(e){return f8(m8(e))}function ooe(e,t,n){n===void 0&&(n=!1);let r=d8(e),i=h8(e),a=p8(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=y8(o)),[o,y8(o)]}function soe(e){let t=y8(e);return[g8(e),t,g8(t)]}function g8(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var _8=[`left`,`right`],v8=[`right`,`left`],coe=[`top`,`bottom`],loe=[`bottom`,`top`];function uoe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?v8:_8:t?_8:v8;case`left`:case`right`:return t?coe:loe;default:return[]}}function doe(e,t,n,r){let i=d8(e),a=uoe(u8(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(g8)))),a}function y8(e){let t=u8(e);return aoe[t]+e.slice(t.length)}function foe(e){return{top:0,right:0,bottom:0,left:0,...e}}function b8(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:foe(e)}function x8(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function S8(e,t,n){let{reference:r,floating:i}=e,a=m8(t),o=h8(t),s=p8(o),c=u8(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(d8(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function poe(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=l8(t,e),p=b8(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=x8(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=x8(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var moe=50,hoe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:poe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=S8(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<moe&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=S8(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},goe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=l8(e,t)||{};if(l==null)return{};let d=b8(u),f={x:n,y:r},p=h8(i),m=p8(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=r8(d[_],T),D=r8(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,ee=c8(O,A,k),j=!c.arrow&&d8(i)!=null&&A!==ee&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,te=j?A<O?A-O:A-k:0;return{[p]:f[p]+te,data:{[p]:ee,centerOffset:A-ee-te,...j&&{alignmentOffset:te}},reset:j}}}),_oe=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=l8(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=u8(r),_=m8(o),v=u8(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[y8(o)]:soe(o)),x=p!==`none`;!d&&x&&b.push(...doe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ooe(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==m8(t))||T.every(e=>m8(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=m8(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function C8(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function w8(e){return ioe.some(t=>e[t]>=0)}var voe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=l8(e,t);switch(i){case`referenceHidden`:{let e=C8(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:w8(e)}}}case`escaped`:{let e=C8(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:w8(e)}}}default:return{}}}}},T8=new Set([`left`,`top`]);async function yoe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=u8(n),s=d8(n),c=m8(n)===`y`,l=T8.has(o)?-1:1,u=a&&c?-1:1,d=l8(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var boe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await yoe(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},xoe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=l8(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=m8(u8(i)),p=f8(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=c8(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=c8(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Soe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=l8(e,t),u={x:n,y:r},d=m8(i),f=f8(d),p=u[f],m=u[d],h=l8(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=T8.has(u8(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Coe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=l8(e,t),u=await o.detectOverflow(t,l),d=u8(i),f=d8(i),p=m8(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=r8(h-u[g],v),x=r8(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=i8(u.left,0),t=i8(u.right,0),n=i8(u.top,0),r=i8(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:i8(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:i8(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function E8(){return typeof window<`u`}function D8(e){return A8(e)?(e.nodeName||``).toLowerCase():`#document`}function O8(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function k8(e){return((A8(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function A8(e){return E8()?e instanceof Node||e instanceof O8(e).Node:!1}function j8(e){return E8()?e instanceof Element||e instanceof O8(e).Element:!1}function M8(e){return E8()?e instanceof HTMLElement||e instanceof O8(e).HTMLElement:!1}function N8(e){return!E8()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof O8(e).ShadowRoot}function P8(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=V8(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function woe(e){return/^(table|td|th)$/.test(D8(e))}function F8(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Toe=/transform|translate|scale|rotate|perspective|filter/,Eoe=/paint|layout|strict|content/,I8=e=>!!e&&e!==`none`,L8;function R8(e){let t=j8(e)?V8(e):e;return I8(t.transform)||I8(t.translate)||I8(t.scale)||I8(t.rotate)||I8(t.perspective)||!z8()&&(I8(t.backdropFilter)||I8(t.filter))||Toe.test(t.willChange||``)||Eoe.test(t.contain||``)}function Doe(e){let t=U8(e);for(;M8(t)&&!B8(t);){if(R8(t))return t;if(F8(t))return null;t=U8(t)}return null}function z8(){return L8??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),L8}function B8(e){return/^(html|body|#document)$/.test(D8(e))}function V8(e){return O8(e).getComputedStyle(e)}function H8(e){return j8(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function U8(e){if(D8(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||N8(e)&&e.host||k8(e);return N8(t)?t.host:t}function W8(e){let t=U8(e);return B8(t)?e.ownerDocument?e.ownerDocument.body:e.body:M8(t)&&P8(t)?t:W8(t)}function G8(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=W8(e),i=r===e.ownerDocument?.body,a=O8(r);if(i){let e=K8(a);return t.concat(a,a.visualViewport||[],P8(r)?r:[],e&&n?G8(e):[])}else return t.concat(r,G8(r,[],n))}function K8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q8(e){let t=V8(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=M8(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=a8(n)!==a||a8(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function J8(e){return j8(e)?e:e.contextElement}function Y8(e){let t=J8(e);if(!M8(t))return s8(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=q8(t),o=(a?a8(n.width):n.width)/r,s=(a?a8(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ooe=s8(0);function X8(e){let t=O8(e);return!z8()||!t.visualViewport?Ooe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function koe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==O8(e)?!1:t}function Z8(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=J8(e),o=s8(1);t&&(r?j8(r)&&(o=Y8(r)):o=Y8(e));let s=koe(a,n,r)?X8(a):s8(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=O8(a),t=r&&j8(r)?O8(r):r,n=e,i=K8(n);for(;i&&r&&t!==n;){let e=Y8(i),t=i.getBoundingClientRect(),r=V8(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=O8(i),i=K8(n)}}return x8({width:u,height:d,x:c,y:l})}function Q8(e,t){let n=H8(e).scrollLeft;return t?t.left+n:Z8(k8(e)).left+n}function $8(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Q8(e,n),y:n.top+t.scrollTop}}function Aoe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=k8(r),s=t?F8(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=s8(1),u=s8(0),d=M8(r);if((d||!d&&!a)&&((D8(r)!==`body`||P8(o))&&(c=H8(r)),d)){let e=Z8(r);l=Y8(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$8(o,c):s8(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function joe(e){return Array.from(e.getClientRects())}function Moe(e){let t=k8(e),n=H8(e),r=e.ownerDocument.body,i=i8(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=i8(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Q8(e),s=-n.scrollTop;return V8(r).direction===`rtl`&&(o+=i8(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var e5=25;function Noe(e,t){let n=O8(e),r=k8(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=z8();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Q8(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=e5&&(a-=o)}else l<=e5&&(a+=l);return{width:a,height:o,x:s,y:c}}function Poe(e,t){let n=Z8(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=M8(e)?Y8(e):s8(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function t5(e,t,n){let r;if(t===`viewport`)r=Noe(e,n);else if(t===`document`)r=Moe(k8(e));else if(j8(t))r=Poe(t,n);else{let n=X8(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return x8(r)}function n5(e,t){let n=U8(e);return n===t||!j8(n)||B8(n)?!1:V8(n).position===`fixed`||n5(n,t)}function Foe(e,t){let n=t.get(e);if(n)return n;let r=G8(e,[],!1).filter(e=>j8(e)&&D8(e)!==`body`),i=null,a=V8(e).position===`fixed`,o=a?U8(e):e;for(;j8(o)&&!B8(o);){let t=V8(o),n=R8(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||P8(o)&&!n&&n5(e,o))?r=r.filter(e=>e!==o):i=t,o=U8(o)}return t.set(e,r),r}function Ioe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?F8(t)?[]:Foe(t,this._c):[].concat(n),r],o=t5(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=t5(t,a[e],i);s=i8(n.top,s),c=r8(n.right,c),l=r8(n.bottom,l),u=i8(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Loe(e){let{width:t,height:n}=q8(e);return{width:t,height:n}}function Roe(e,t,n){let r=M8(t),i=k8(t),a=n===`fixed`,o=Z8(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=s8(0);function l(){c.x=Q8(i)}if(r||!r&&!a)if((D8(t)!==`body`||P8(i))&&(s=H8(t)),r){let e=Z8(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?$8(i,s):s8(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function r5(e){return V8(e).position===`static`}function i5(e,t){if(!M8(e)||V8(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return k8(e)===n&&(n=n.ownerDocument.body),n}function a5(e,t){let n=O8(e);if(F8(e))return n;if(!M8(e)){let t=U8(e);for(;t&&!B8(t);){if(j8(t)&&!r5(t))return t;t=U8(t)}return n}let r=i5(e,t);for(;r&&woe(r)&&r5(r);)r=i5(r,t);return r&&B8(r)&&r5(r)&&!R8(r)?n:r||Doe(e)||n}var zoe=async function(e){let t=this.getOffsetParent||a5,n=this.getDimensions,r=await n(e.floating);return{reference:Roe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Boe(e){return V8(e).direction===`rtl`}var Voe={convertOffsetParentRelativeRectToViewportRelativeRect:Aoe,getDocumentElement:k8,getClippingRect:Ioe,getOffsetParent:a5,getElementRects:zoe,getClientRects:joe,getDimensions:Loe,getScale:Y8,isElement:j8,isRTL:Boe};function o5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hoe(e,t){let n=null,r,i=k8(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=o8(d),h=o8(i.clientWidth-(u+f)),g=o8(i.clientHeight-(d+p)),_=o8(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:i8(0,r8(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!o5(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Uoe(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=J8(e),u=i||a?[...l?G8(l):[],...t?G8(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Hoe(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Z8(e):null;c&&g();function g(){let t=Z8(e);h&&!o5(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Woe=boe,Goe=xoe,Koe=_oe,qoe=Coe,Joe=voe,s5=goe,Yoe=Soe,Xoe=(e,t,n)=>{let r=new Map,i={platform:Voe,...n},a={...i.platform,_c:r};return hoe(e,t,{...i,platform:a})},c5=typeof document<`u`?P.useLayoutEffect:function(){};function l5(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!l5(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!l5(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function u5(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function d5(e,t){let n=u5(e);return Math.round(t*n)/n}function f5(e){let t=P.useRef(e);return c5(()=>{t.current=e}),t}function Zoe(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=P.useState(r);l5(f,r)||p(r);let[m,h]=P.useState(null),[g,_]=P.useState(null),v=P.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=P.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=P.useRef(null),C=P.useRef(null),w=P.useRef(u),T=c!=null,E=f5(c),D=f5(i),O=f5(l),k=P.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Xoe(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!l5(w.current,t)&&(w.current=t,jr.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);c5(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=P.useRef(!1);c5(()=>(A.current=!0,()=>{A.current=!1}),[]),c5(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let ee=P.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=P.useMemo(()=>({reference:b,floating:x}),[b,x]),te=P.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=d5(j.floating,u.x),r=d5(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...u5(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:k,refs:ee,elements:j,floatingStyles:te}),[u,k,ee,j,te])}var Qoe=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:s5({element:r.current,padding:i}).fn(n):r?s5({element:r,padding:i}).fn(n):{}}}},$oe=(e,t)=>{let n=Woe(e);return{name:n.name,fn:n.fn,options:[e,t]}},ese=(e,t)=>{let n=Goe(e);return{name:n.name,fn:n.fn,options:[e,t]}},tse=(e,t)=>({fn:Yoe(e).fn,options:[e,t]}),nse=(e,t)=>{let n=Koe(e);return{name:n.name,fn:n.fn,options:[e,t]}},rse=(e,t)=>{let n=qoe(e);return{name:n.name,fn:n.fn,options:[e,t]}},ise=(e,t)=>{let n=Joe(e);return{name:n.name,fn:n.fn,options:[e,t]}},ase=(e,t)=>{let n=Qoe(e);return{name:n.name,fn:n.fn,options:[e,t]}},ose=`Arrow`,p5=P.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(zr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});p5.displayName=ose;var sse=p5;function cse(e){let[t,n]=P.useState(void 0);return Er(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var m5=`Popper`,[h5,g5]=wr(m5),[lse,_5]=h5(m5),v5=e=>{let{__scopePopper:t,children:n}=e,[r,i]=P.useState(null);return(0,R.jsx)(lse,{scope:t,anchor:r,onAnchorChange:i,children:n})};v5.displayName=m5;var y5=`PopperAnchor`,b5=P.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=_5(y5,n),o=P.useRef(null),s=ar(t,o),c=P.useRef(null);return P.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,R.jsx)(zr.div,{...i,ref:s})});b5.displayName=y5;var x5=`PopperContent`,[use,dse]=h5(x5),S5=P.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=_5(x5,n),[_,v]=P.useState(null),y=ar(t,e=>v(e)),[b,x]=P.useState(null),S=cse(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(pse),altBoundary:O},{refs:A,floatingStyles:ee,placement:j,isPositioned:te,middlewareData:M}=Zoe({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Uoe(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[$oe({mainAxis:i+w,alignmentAxis:o}),c&&ese({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?tse():void 0,...k}),c&&nse({...k}),rse({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&ase({element:b,padding:s}),mse({arrowWidth:C,arrowHeight:w}),f&&ise({strategy:`referenceHidden`,...k})]}),[ne,N]=T5(j),re=bi(m);Er(()=>{te&&re?.()},[te,re]);let ie=M.arrow?.x,ae=M.arrow?.y,oe=M.arrow?.centerOffset!==0,[se,ce]=P.useState();return Er(()=>{_&&ce(window.getComputedStyle(_).zIndex)},[_]),(0,R.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:te?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(use,{scope:n,placedSide:ne,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,R.jsx)(zr.div,{"data-side":ne,"data-align":N,...h,ref:y,style:{...h.style,animation:te?void 0:`none`}})})})});S5.displayName=x5;var C5=`PopperArrow`,fse={top:`bottom`,right:`left`,bottom:`top`,left:`right`},w5=P.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=dse(C5,n),a=fse[i.placedSide];return(0,R.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,R.jsx)(sse,{...r,ref:t,style:{...r.style,display:`block`}})})});w5.displayName=C5;function pse(e){return e!==null}var mse=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=T5(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function T5(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var E5=v5,hse=b5,gse=S5,_se=w5,D5=`rovingFocusGroup.onEntryFocus`,vse={bubbles:!1,cancelable:!0},O5=`RovingFocusGroup`,[k5,A5,yse]=t8(O5),[bse,j5]=wr(O5,[yse]),[xse,Sse]=bse(O5),M5=P.forwardRef((e,t)=>(0,R.jsx)(k5.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(k5.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(Cse,{...e,ref:t})})}));M5.displayName=O5;var Cse=P.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=P.useRef(null),p=ar(t,f),m=n8(a),[h,g]=Or({prop:o,defaultProp:s??null,onChange:c,caller:O5}),[_,v]=P.useState(!1),y=bi(l),b=A5(n),x=P.useRef(!1),[S,C]=P.useState(0);return P.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(D5,y),()=>e.removeEventListener(D5,y)},[y]),(0,R.jsx)(xse,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:P.useCallback(e=>g(e),[g]),onItemShiftTab:P.useCallback(()=>v(!0),[]),onFocusableItemAdd:P.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:P.useCallback(()=>C(e=>e-1),[]),children:(0,R.jsx)(zr.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Sr(e.onMouseDown,()=>{x.current=!0}),onFocus:Sr(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(D5,vse);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);F5([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:Sr(e.onBlur,()=>v(!1))})})}),N5=`RovingFocusGroupItem`,P5=P.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Jr(),l=a||c,u=Sse(N5,n),d=u.currentTabStopId===l,f=A5(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return P.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,R.jsx)(k5.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(zr.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Sr(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Sr(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Sr(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ese(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Dse(n,r+1):n.slice(r+1)}setTimeout(()=>F5(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});P5.displayName=N5;var wse={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Tse(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Ese(e,t,n){let r=Tse(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return wse[r]}function F5(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Dse(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ose=M5,kse=P5,I5=[`Enter`,` `],Ase=[`ArrowDown`,`PageUp`,`Home`],L5=[`ArrowUp`,`PageDown`,`End`],jse=[...Ase,...L5],Mse={ltr:[...I5,`ArrowRight`],rtl:[...I5,`ArrowLeft`]},Nse={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},R5=`Menu`,[z5,Pse,Fse]=t8(R5),[B5,V5]=wr(R5,[Fse,g5,j5]),H5=g5(),U5=j5(),[W5,G5]=B5(R5),[Ise,K5]=B5(R5),q5=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=H5(t),[c,l]=P.useState(null),u=P.useRef(!1),d=bi(a),f=n8(i);return P.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,R.jsx)(E5,{...s,children:(0,R.jsx)(W5,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,R.jsx)(Ise,{scope:t,onClose:P.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};q5.displayName=R5;var Lse=`MenuAnchor`,J5=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H5(n);return(0,R.jsx)(hse,{...i,...r,ref:t})});J5.displayName=Lse;var Y5=`MenuPortal`,[Rse,X5]=B5(Y5,{forceMount:void 0}),Z5=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=G5(Y5,t);return(0,R.jsx)(Rse,{scope:t,forceMount:n,children:(0,R.jsx)(Hr,{present:n||a.open,children:(0,R.jsx)(Qi,{asChild:!0,container:i,children:r})})})};Z5.displayName=Y5;var Q5=`MenuContent`,[zse,$5]=B5(Q5),e7=P.forwardRef((e,t)=>{let n=X5(Q5,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=G5(Q5,e.__scopeMenu),o=K5(Q5,e.__scopeMenu);return(0,R.jsx)(z5.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(Hr,{present:r||a.open,children:(0,R.jsx)(z5.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(Bse,{...i,ref:t}):(0,R.jsx)(Vse,{...i,ref:t})})})})}),Bse=P.forwardRef((e,t)=>{let n=G5(Q5,e.__scopeMenu),r=P.useRef(null),i=ar(t,r);return P.useEffect(()=>{let e=r.current;if(e)return bo(e)},[]),(0,R.jsx)(t7,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Sr(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Vse=P.forwardRef((e,t)=>{let n=G5(Q5,e.__scopeMenu);return(0,R.jsx)(t7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Hse=Mr(`MenuContent.ScrollLock`),t7=P.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=G5(Q5,n),_=K5(Q5,n),v=H5(n),y=U5(n),b=Pse(n),[x,S]=P.useState(null),C=P.useRef(null),w=ar(t,C,g.onContentChange),T=P.useRef(0),E=P.useRef(``),D=P.useRef(0),O=P.useRef(null),k=P.useRef(`right`),A=P.useRef(0),ee=m?uo:P.Fragment,j=m?{as:Hse,allowPinchZoom:!0}:void 0,te=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ece(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};P.useEffect(()=>()=>window.clearTimeout(T.current),[]),ea();let M=P.useCallback(e=>k.current===O.current?.side&&nce(e,O.current?.area),[]);return(0,R.jsx)(zse,{scope:n,searchRef:E,onItemEnter:P.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:P.useCallback(e=>{M(e)||(C.current?.focus(),S(null))},[M]),onTriggerLeave:P.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:D,onPointerGraceIntentChange:P.useCallback(e=>{O.current=e},[]),children:(0,R.jsx)(ee,{...j,children:(0,R.jsx)(zi,{asChild:!0,trapped:i,onMountAutoFocus:Sr(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,R.jsx)(Oi,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,R.jsx)(Ose,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:Sr(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(gse,{role:`menu`,"aria-orientation":`vertical`,"data-state":T7(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:Sr(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=C.current;if(e.target!==i||!jse.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);L5.includes(e.key)&&a.reverse(),Qse(a)}),onBlur:Sr(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:Sr(e.onPointerMove,O7(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});e7.displayName=Q5;var Use=`MenuGroup`,n7=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(zr.div,{role:`group`,...r,ref:t})});n7.displayName=Use;var Wse=`MenuLabel`,r7=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(zr.div,{...r,ref:t})});r7.displayName=Wse;var i7=`MenuItem`,a7=`menu.itemSelect`,o7=P.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=P.useRef(null),o=K5(i7,e.__scopeMenu),s=$5(i7,e.__scopeMenu),c=ar(t,a),l=P.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(a7,{bubbles:!0,cancelable:!0});e.addEventListener(a7,e=>r?.(e),{once:!0}),Br(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,R.jsx)(s7,{...i,ref:c,disabled:n,onClick:Sr(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Sr(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Sr(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||I5.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});o7.displayName=i7;var s7=P.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=$5(i7,n),s=U5(n),c=P.useRef(null),l=ar(t,c),[u,d]=P.useState(!1),[f,p]=P.useState(``);return P.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,R.jsx)(z5.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,R.jsx)(kse,{asChild:!0,...s,focusable:!r,children:(0,R.jsx)(zr.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Sr(e.onPointerMove,O7(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Sr(e.onPointerLeave,O7(e=>o.onItemLeave(e))),onFocus:Sr(e.onFocus,()=>d(!0)),onBlur:Sr(e.onBlur,()=>d(!1))})})})}),Gse=`MenuCheckboxItem`,c7=P.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,R.jsx)(m7,{scope:e.__scopeMenu,checked:n,children:(0,R.jsx)(o7,{role:`menuitemcheckbox`,"aria-checked":E7(n)?`mixed`:n,...i,ref:t,"data-state":D7(n),onSelect:Sr(i.onSelect,()=>r?.(E7(n)?!0:!n),{checkForDefaultPrevented:!1})})})});c7.displayName=Gse;var l7=`MenuRadioGroup`,[Kse,qse]=B5(l7,{value:void 0,onValueChange:()=>{}}),u7=P.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=bi(r);return(0,R.jsx)(Kse,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,R.jsx)(n7,{...i,ref:t})})});u7.displayName=l7;var d7=`MenuRadioItem`,f7=P.forwardRef((e,t)=>{let{value:n,...r}=e,i=qse(d7,e.__scopeMenu),a=n===i.value;return(0,R.jsx)(m7,{scope:e.__scopeMenu,checked:a,children:(0,R.jsx)(o7,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":D7(a),onSelect:Sr(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});f7.displayName=d7;var p7=`MenuItemIndicator`,[m7,Jse]=B5(p7,{checked:!1}),h7=P.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Jse(p7,n);return(0,R.jsx)(Hr,{present:r||E7(a.checked)||a.checked===!0,children:(0,R.jsx)(zr.span,{...i,ref:t,"data-state":D7(a.checked)})})});h7.displayName=p7;var Yse=`MenuSeparator`,g7=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(zr.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});g7.displayName=Yse;var Xse=`MenuArrow`,_7=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H5(n);return(0,R.jsx)(_se,{...i,...r,ref:t})});_7.displayName=Xse;var v7=`MenuSub`,[Zse,y7]=B5(v7),b7=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=G5(v7,t),o=H5(t),[s,c]=P.useState(null),[l,u]=P.useState(null),d=bi(i);return P.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,R.jsx)(E5,{...o,children:(0,R.jsx)(W5,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,R.jsx)(Zse,{scope:t,contentId:Jr(),triggerId:Jr(),trigger:s,onTriggerChange:c,children:n})})})};b7.displayName=v7;var x7=`MenuSubTrigger`,S7=P.forwardRef((e,t)=>{let n=G5(x7,e.__scopeMenu),r=K5(x7,e.__scopeMenu),i=y7(x7,e.__scopeMenu),a=$5(x7,e.__scopeMenu),o=P.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=P.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return P.useEffect(()=>u,[u]),P.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,R.jsx)(J5,{asChild:!0,...l,children:(0,R.jsx)(s7,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":T7(n.open),...e,ref:ir(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Sr(e.onPointerMove,O7(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Sr(e.onPointerLeave,O7(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Sr(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Mse[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});S7.displayName=x7;var C7=`MenuSubContent`,w7=P.forwardRef((e,t)=>{let n=X5(Q5,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=G5(Q5,e.__scopeMenu),o=K5(Q5,e.__scopeMenu),s=y7(C7,e.__scopeMenu),c=P.useRef(null),l=ar(t,c);return(0,R.jsx)(z5.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(Hr,{present:r||a.open,children:(0,R.jsx)(z5.Slot,{scope:e.__scopeMenu,children:(0,R.jsx)(t7,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Sr(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Sr(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:Sr(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Nse[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});w7.displayName=C7;function T7(e){return e?`open`:`closed`}function E7(e){return e===`indeterminate`}function D7(e){return E7(e)?`indeterminate`:e?`checked`:`unchecked`}function Qse(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $se(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ece(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=$se(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function tce(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function nce(e,t){return t?tce({x:e.clientX,y:e.clientY},t):!1}function O7(e){return t=>t.pointerType===`mouse`?e(t):void 0}var rce=q5,ice=J5,ace=Z5,oce=e7,sce=n7,cce=r7,lce=o7,uce=c7,dce=u7,fce=f7,pce=h7,mce=g7,hce=_7,gce=b7,_ce=S7,vce=w7,k7=`ContextMenu`,[yce,bce]=wr(k7,[V5]),A7=V5(),[xce,j7]=yce(k7),M7=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=P.useState(!1),c=A7(t),l=bi(r),u=P.useCallback(e=>{s(e),l(e)},[l]);return(0,R.jsx)(xce,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,R.jsx)(rce,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};M7.displayName=k7;var N7=`ContextMenuTrigger`,P7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=j7(N7,n),o=A7(n),s=P.useRef({x:0,y:0}),c=P.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=P.useRef(0),u=P.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return P.useEffect(()=>u,[u]),P.useEffect(()=>void(r&&u()),[r,u]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ice,{...o,virtualRef:c}),(0,R.jsx)(zr.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:Sr(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:Sr(e.onPointerDown,q7(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:Sr(e.onPointerMove,q7(u)),onPointerCancel:r?e.onPointerCancel:Sr(e.onPointerCancel,q7(u)),onPointerUp:r?e.onPointerUp:Sr(e.onPointerUp,q7(u))})]})});P7.displayName=N7;var Sce=`ContextMenuPortal`,F7=e=>{let{__scopeContextMenu:t,...n}=e,r=A7(t);return(0,R.jsx)(ace,{...r,...n})};F7.displayName=Sce;var I7=`ContextMenuContent`,L7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=j7(I7,n),a=A7(n),o=P.useRef(!1);return(0,R.jsx)(oce,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});L7.displayName=I7;var Cce=`ContextMenuGroup`,wce=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(sce,{...i,...r,ref:t})});wce.displayName=Cce;var Tce=`ContextMenuLabel`,R7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(cce,{...i,...r,ref:t})});R7.displayName=Tce;var Ece=`ContextMenuItem`,z7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(lce,{...i,...r,ref:t})});z7.displayName=Ece;var Dce=`ContextMenuCheckboxItem`,B7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(uce,{...i,...r,ref:t})});B7.displayName=Dce;var Oce=`ContextMenuRadioGroup`,kce=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(dce,{...i,...r,ref:t})});kce.displayName=Oce;var Ace=`ContextMenuRadioItem`,V7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(fce,{...i,...r,ref:t})});V7.displayName=Ace;var jce=`ContextMenuItemIndicator`,H7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(pce,{...i,...r,ref:t})});H7.displayName=jce;var Mce=`ContextMenuSeparator`,U7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(mce,{...i,...r,ref:t})});U7.displayName=Mce;var Nce=`ContextMenuArrow`,Pce=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(hce,{...i,...r,ref:t})});Pce.displayName=Nce;var W7=`ContextMenuSub`,Fce=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=A7(t),[s,c]=Or({prop:i,defaultProp:a??!1,onChange:r,caller:W7});return(0,R.jsx)(gce,{...o,open:s,onOpenChange:c,children:n})};Fce.displayName=W7;var Ice=`ContextMenuSubTrigger`,G7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(_ce,{...i,...r,ref:t})});G7.displayName=Ice;var Lce=`ContextMenuSubContent`,K7=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=A7(n);return(0,R.jsx)(vce,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});K7.displayName=Lce;function q7(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var Rce=M7,zce=P7,Bce=F7,J7=L7,Y7=R7,X7=z7,Z7=B7,Q7=V7,$7=H7,e9=U7,t9=G7,n9=K7,r9=Rce,i9=zce,Vce=P.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,R.jsx)(t9,{ref:i,className:L(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:n}));Vce.displayName=t9.displayName;var Hce=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(n9,{ref:n,className:L(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));Hce.displayName=n9.displayName;var a9=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(Bce,{children:(0,R.jsx)(J7,{ref:n,className:L(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t})}));a9.displayName=J7.displayName;var o9=P.forwardRef(({className:e,inset:t,...n},r)=>(0,R.jsx)(X7,{ref:r,className:L(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));o9.displayName=X7.displayName;var Uce=P.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,R.jsxs)(Z7,{ref:i,className:L(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,R.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,R.jsx)($7,{children:(0,R.jsx)(`svg`,{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`,className:`size-4`,children:(0,R.jsx)(`path`,{d:`M20 6 9 17l-5-5`})})})}),t]}));Uce.displayName=Z7.displayName;var Wce=P.forwardRef(({className:e,children:t,...n},r)=>(0,R.jsxs)(Q7,{ref:r,className:L(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,R.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,R.jsx)($7,{children:(0,R.jsx)(`div`,{className:`size-2 rounded-full bg-current`})})}),t]}));Wce.displayName=Q7.displayName;var Gce=P.forwardRef(({className:e,inset:t,...n},r)=>(0,R.jsx)(Y7,{ref:r,className:L(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));Gce.displayName=Y7.displayName;var s9=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(e9,{ref:n,className:L(`-mx-1 my-1 h-px bg-border`,e),...t}));s9.displayName=e9.displayName;var Kce=({className:e,...t})=>(0,R.jsx)(`span`,{className:L(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});Kce.displayName=`ContextMenuShortcut`;function qce(e,t){return e?t?.find(t=>t.path===e)?.name||e.split(`/`).pop()||e:``}var c9=[`#2563eb`,`#059669`,`#d97706`,`#7c3aed`,`#e11d48`,`#0891b2`];function Jce(e){return c9[e%c9.length]}var Yce=(0,P.memo)(function({tabOrder:e,tabs:t,activeTabKey:n,onActivate:r,onCloseRequest:i,onTogglePin:a,onCloseOtherTabs:o,onCloseRightTabs:s,onCloseLeftTabs:c,onCloseAllTabs:l,onCloseGroupTabs:u,onCloseOtherGroupTabs:d,isMobile:f,rightContent:p,dirs:m}){if(e.length===0)return null;let h=(0,P.useMemo)(()=>{let n=new Map;for(let r of e){let e=t.get(r);if(!e)continue;let i=e.rootPath;n.has(i)||n.set(i,[]),n.get(i).push(r)}return n},[e,t]),g=h.size>1,_=(0,P.useMemo)(()=>{let e=new Map,t=0;for(let[n]of h.entries())e.set(n,t++);return e},[h]),v=Array.from(h.entries()).map(([e,p],h)=>{let v=Jce(_.get(e)??0);return(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[g&&h>0&&(0,R.jsx)(`div`,{className:L(`flex items-center self-stretch shrink-0`,f?`px-0.5`:`px-1`),children:(0,R.jsx)(`div`,{className:L(`rounded-full`,f?`w-[1.5px] h-4`:`w-[2px] h-5`),style:{backgroundColor:v}})}),g&&(0,R.jsxs)(r9,{children:[(0,R.jsx)(i9,{asChild:!0,children:(0,R.jsx)(`span`,{className:`px-2 py-1 text-[10px] font-medium text-muted-foreground bg-muted/40 rounded shrink-0 select-none cursor-pointer`,style:{color:v},children:qce(e,m)})}),(0,R.jsxs)(a9,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,R.jsx)(o9,{onClick:()=>u(e),children:`关闭分组`}),(0,R.jsx)(o9,{onClick:()=>d(e),children:`关闭分组其他`})]})]}),p.map(e=>{let u=t.get(e);if(!u)return null;let d=u.path.split(`/`).pop()||u.path,p=e===n,m=u.content!==u.lastSavedContent,h=u.isPinned,_=u.isPreview;return(0,R.jsxs)(r9,{children:[(0,R.jsx)(i9,{asChild:!0,children:(0,R.jsxs)(`div`,{className:L(`group flex items-center gap-1.5 text-xs cursor-pointer rounded-lg border shrink-0 select-none transition-all duration-150`,f?`px-1.5 py-[3px] gap-0.5 min-w-[52px] text-[10px]`:`px-3 py-1.5 gap-1.5 min-w-[100px] max-w-[200px]`,p?`bg-background text-foreground border-border shadow-sm translate-y-[-1px]`:`bg-transparent text-muted-foreground border-transparent hover:bg-muted/50`),onClick:()=>r(e),onDoubleClick:()=>a(e),children:[f&&p&&(0,R.jsx)(`button`,{className:L(`shrink-0 flex items-center justify-center rounded-sm opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),a(e)},title:h?`取消固定`:`固定标签`,children:(0,R.jsx)(Ue,{className:L(`size-2.5`,h&&`fill-muted-foreground`)})}),g&&!h&&(0,R.jsx)(`span`,{className:L(`rounded-full shrink-0`,f?`size-1`:`size-1.5`),style:{backgroundColor:v}}),m&&!h&&(0,R.jsx)(`span`,{className:L(`rounded-full bg-primary shrink-0`,f?`size-1`:`size-1.5`)}),(0,R.jsx)(`span`,{className:L(f?`flex-1`:`truncate flex-1`,_&&`italic opacity-80`),children:d}),f?(0,R.jsx)(`button`,{className:L(`shrink-0 flex items-center justify-center rounded-sm opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),i(e)},title:`关闭标签`,children:(0,R.jsx)(Qe,{className:`size-2.5`})}):(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,className:L(`shrink-0 rounded-sm size-5 min-w-5 min-h-5 opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),i(e)},title:`关闭标签`,children:(0,R.jsx)(Qe,{className:`size-3`})})]})}),(0,R.jsxs)(a9,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,R.jsx)(o9,{onClick:()=>i(e),children:`关闭标签`}),(0,R.jsx)(o9,{onClick:()=>o(e),children:`关闭其他标签`}),(0,R.jsx)(o9,{onClick:()=>s(e),children:`关闭右侧标签`}),(0,R.jsx)(o9,{onClick:()=>c(e),children:`关闭左侧标签`}),(0,R.jsx)(s9,{}),(0,R.jsx)(o9,{onClick:()=>a(e),children:h?`取消固定`:`固定标签`}),(0,R.jsx)(s9,{}),(0,R.jsx)(o9,{onClick:()=>l(),children:`关闭所有标签`})]})]},e)})]},e??`null`)});return(0,R.jsxs)(`div`,{className:`flex items-center bg-muted/20 border-b border-border shrink-0`,children:[f?(0,R.jsx)(`div`,{className:`flex items-center gap-0.5 px-1.5 py-1 overflow-x-auto overflow-y-hidden flex-1 tabbar-scroll-hide`,style:{WebkitOverflowScrolling:`touch`},children:v}):(0,R.jsxs)(r9,{children:[(0,R.jsx)(i9,{asChild:!0,children:(0,R.jsx)(`div`,{className:`flex items-center gap-1.5 px-3 py-2 overflow-x-auto overflow-y-hidden flex-1 tabbar-scroll-hide`,style:{WebkitOverflowScrolling:`touch`},children:v})}),(0,R.jsx)(a9,{onOpenAutoFocus:e=>e.preventDefault(),children:(0,R.jsx)(o9,{onClick:()=>l(),children:`关闭所有标签`})})]}),p&&(0,R.jsx)(`div`,{className:`flex items-center gap-2 px-3 h-9 shrink-0 text-xs text-muted-foreground`,children:p})]})}),Xce=(0,P.memo)(function({visible:e,onClose:t,onCreate:n,currentDir:r}){let[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(!1),c=(0,P.useRef)(null);(0,P.useEffect)(()=>{e&&(s(!1),a(`.md`),setTimeout(()=>{c.current?.setSelectionRange(0,0),c.current?.focus()},50))},[e]);let l=()=>{i.trim()&&(n(i.trim(),o,r),a(``),t())},u=e=>{e||t()},d=e=>{e.key===`Enter`&&l()},f=r?r.split(`/`).filter(Boolean).join(` / `):`目录`;return(0,R.jsx)(us,{open:e,onOpenChange:u,children:(0,R.jsxs)(ps,{side:`bottom`,className:`rounded-t-2xl`,noClose:!0,children:[(0,R.jsxs)(ms,{className:`text-left`,children:[(0,R.jsx)(gs,{children:`新建`}),(0,R.jsxs)(_s,{children:[`位置: `,f]})]}),(0,R.jsxs)(`div`,{className:`space-y-4 mt-4`,children:[(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsxs)(xr,{variant:o?`outline`:`default`,onClick:()=>{s(!1),i||(a(`.md`),setTimeout(()=>{c.current?.setSelectionRange(0,0),c.current?.focus()},0))},className:`flex-1 h-11`,children:[(0,R.jsx)(Ee,{className:`size-4 mr-2`}),`Markdown`]}),(0,R.jsxs)(xr,{variant:o?`default`:`outline`,onClick:()=>{s(!0),i===`.md`&&a(``)},className:`flex-1 h-11`,children:[(0,R.jsx)(je,{className:`size-4 mr-2`}),`文件夹`]})]}),(0,R.jsx)(nr,{ref:c,placeholder:o?`文件夹名称`:`文件名称,如 note.md`,value:i,onChange:e=>a(e.target.value),onKeyDown:d,className:`h-11`,autoFocus:!0}),(0,R.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,R.jsx)(xr,{variant:`outline`,onClick:t,children:`取消`}),(0,R.jsx)(xr,{onClick:l,children:`创建`})]})]})]})})});function Zce(e,t){return t||e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()||e}function Qce({open:e,onOpenChange:t,onSelect:n,activeRoot:r,groups:i}){let[a,o]=(0,P.useState)(``),[s,c]=(0,P.useState)([]),[l,u]=(0,P.useState)(0),[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(!1),[h,g]=(0,P.useState)(`all`),_=(0,P.useRef)(null);(0,P.useEffect)(()=>{m(window.innerWidth<768)},[]),(0,P.useEffect)(()=>{e&&r?g(r):e&&g(`all`)},[e,r]),(0,P.useEffect)(()=>{e?setTimeout(()=>_.current?.focus(),100):(o(``),c([]),u(0))},[e]),(0,P.useEffect)(()=>{if(!a.trim()){c([]),u(0);return}let e=setTimeout(()=>{f(!0);let e=new URL(`/api/files/search`,window.location.origin);e.searchParams.set(`q`,a),e.searchParams.set(`limit`,`50`),h!==`all`&&e.searchParams.set(`root`,h),fetch(e.toString()).then(e=>e.json()).then(e=>{c(e.results||[]),u(0)}).catch(console.error).finally(()=>f(!1))},200);return()=>clearTimeout(e)},[a,h]);let v=(0,P.useCallback)((e,r)=>{n(e,r),t(!1)},[n,t]),y=(0,P.useCallback)(e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,s.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`&&s.length>0){e.preventDefault();let t=s[l];v(t.path,t.rootPath)}else e.key===`Escape`&&t(!1)},[s,l,v,t]);return(0,P.useEffect)(()=>{let n=n=>{n.key===`Escape`&&e&&t(!1)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,R.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur-sm`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-border`,children:[p&&(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:()=>t(!1),children:(0,R.jsx)(fe,{className:`size-5`})}),(0,R.jsxs)(`div`,{className:`relative flex-1`,children:[(0,R.jsx)(qe,{className:`absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),(0,R.jsx)(nr,{ref:_,type:`text`,placeholder:`搜索文件或内容...`,value:a,onChange:e=>o(e.target.value),onKeyDown:y,className:`pl-9 pr-20`}),!a&&(0,R.jsx)(`span`,{className:`absolute right-10 top-1/2 -translate-y-1/2 text-xs text-muted-foreground pointer-events-none`,children:`⌘K`}),a&&(0,R.jsx)(`button`,{onClick:()=>o(``),className:`absolute right-3 top-1/2 -translate-y-1/2`,children:(0,R.jsx)(Qe,{className:`size-4 text-muted-foreground hover:text-foreground`})})]}),(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:()=>t(!1),children:(0,R.jsx)(Qe,{className:`size-5`})})]}),i&&i.length>0&&(0,R.jsxs)(`div`,{className:`flex items-center gap-1 px-4 py-2 border-b border-border overflow-x-auto`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0 mr-1`,children:`搜索范围:`}),(0,R.jsx)(xr,{variant:h===`all`?`default`:`ghost`,size:`sm`,className:`text-xs h-7 shrink-0`,onClick:()=>g(`all`),children:`全部`}),i.map(e=>(0,R.jsx)(xr,{variant:h===e.root.path?`default`:`ghost`,size:`sm`,className:`text-xs h-7 shrink-0`,onClick:()=>g(e.root.path),children:Zce(e.root.path,e.root.name)},e.root.path))]}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[d&&(0,R.jsxs)(`div`,{className:`flex items-center justify-center py-12 text-muted-foreground`,children:[(0,R.jsx)(Le,{className:`size-5 mr-2 animate-spin`}),(0,R.jsx)(`span`,{className:`text-sm`,children:`搜索中...`})]}),!d&&a&&s.length===0&&(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,R.jsx)(qe,{className:`size-10 mb-3 opacity-50`}),(0,R.jsx)(`span`,{className:`text-sm`,children:`未找到相关结果`})]}),!d&&!a&&(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,R.jsx)(qe,{className:`size-10 mb-3 opacity-50`}),(0,R.jsx)(`span`,{className:`text-sm`,children:`输入关键词搜索文件名或内容`})]}),s.length>0&&(0,R.jsx)(`div`,{className:`py-2`,children:s.map((e,t)=>(0,R.jsxs)(`button`,{onClick:()=>v(e.path,e.rootPath),className:L(`w-full px-4 py-3 flex items-start gap-3 text-left hover:bg-accent transition-colors`,t===l&&`bg-accent`),children:[(0,R.jsx)(Ee,{className:`size-5 mt-0.5 text-muted-foreground shrink-0`}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,R.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),e.rootName&&(0,R.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:e.rootName})]}),e.matchedLine&&(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.matchedLine}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 truncate`,children:e.path})]})]},`${e.rootPath}:${e.path}`))})]}),s.length>0&&(0,R.jsxs)(`div`,{className:`px-4 py-2 border-t border-border text-xs text-muted-foreground flex items-center justify-between`,children:[(0,R.jsxs)(`span`,{children:[s.length,` 个结果`]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-accent`,children:`↑↓`}),(0,R.jsx)(`span`,{children:`选择`}),(0,R.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-accent`,children:`Enter`}),(0,R.jsx)(`span`,{children:`打开`})]})]})]}):null}var l9=ts,$ce=rs,u9=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(is,{ref:n,className:L(`fixed inset-0 z-50 bg-black/80 animate-fade-in`,e),...t}));u9.displayName=is.displayName;var d9=P.forwardRef(({className:e,children:t,...n},r)=>(0,R.jsxs)($ce,{children:[(0,R.jsx)(u9,{}),(0,R.jsxs)(as,{ref:r,className:L(`fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 animate-zoom-in rounded-lg max-h-[calc(100vh-2rem)] overflow-y-auto`,e),...n,children:[t,(0,R.jsxs)(ls,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,R.jsx)(Qe,{className:`size-4`}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));d9.displayName=as.displayName;var f9=({className:e,...t})=>(0,R.jsx)(`div`,{className:L(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});f9.displayName=`DialogHeader`;var p9=({className:e,...t})=>(0,R.jsx)(`div`,{className:L(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});p9.displayName=`DialogFooter`;var m9=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(ss,{ref:n,className:L(`text-lg font-semibold leading-none tracking-tight`,e),...t}));m9.displayName=ss.displayName;var h9=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(cs,{ref:n,className:L(`text-sm text-muted-foreground`,e),...t}));h9.displayName=cs.displayName;function ele({open:e,onOpenChange:t,item:n,onRename:r}){let[i,a]=(0,P.useState)(``),o=(0,P.useRef)(null);(0,P.useEffect)(()=>{if(n&&(a(n.name),n.type===`file`)){let e=n.name.lastIndexOf(`.`);e>0&&setTimeout(()=>{o.current?.setSelectionRange(e,e)},0)}},[n]);let s=()=>{n&&i.trim()&&(r(n.path,i.trim(),n.rootPath,n.type===`directory`),t(!1))};return n?(0,R.jsx)(l9,{open:e,onOpenChange:t,children:(0,R.jsxs)(d9,{className:`sm:max-w-[400px]`,children:[(0,R.jsxs)(f9,{children:[(0,R.jsx)(m9,{children:`重命名`}),(0,R.jsxs)(h9,{children:[`输入新的名称来重命名「`,n.name,`」`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 py-2`,children:[n.type===`directory`?(0,R.jsx)(je,{className:`size-5 shrink-0 text-muted-foreground`}):(0,R.jsx)(De,{className:`size-5 shrink-0 text-muted-foreground`}),(0,R.jsx)(nr,{ref:o,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s()},autoFocus:!0})]}),(0,R.jsxs)(p9,{children:[(0,R.jsx)(xr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,R.jsx)(xr,{onClick:s,disabled:!i.trim(),children:`确定`})]})]})}):null}function tle(e,[t,n]){return Math.min(n,Math.max(t,e))}function nle(e,t){return P.useReducer((e,n)=>t[e][n]??e,e)}var g9=`ScrollArea`,[_9,rle]=wr(g9),[ile,v9]=_9(g9),y9=P.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=P.useState(null),[l,u]=P.useState(null),[d,f]=P.useState(null),[p,m]=P.useState(null),[h,g]=P.useState(null),[_,v]=P.useState(0),[y,b]=P.useState(0),[x,S]=P.useState(!1),[C,w]=P.useState(!1),T=ar(t,e=>c(e)),E=n8(i);return(0,R.jsx)(ile,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,R.jsx)(zr.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});y9.displayName=g9;var b9=`ScrollAreaViewport`,x9=P.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=v9(b9,n),s=ar(t,P.useRef(null),o.onViewportChange);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,R.jsx)(zr.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,R.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});x9.displayName=b9;var S9=`ScrollAreaScrollbar`,C9=P.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=v9(S9,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return P.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,R.jsx)(ale,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,R.jsx)(ole,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,R.jsx)(w9,{...r,ref:t,forceMount:n}):i.type===`always`?(0,R.jsx)(T9,{...r,ref:t}):null});C9.displayName=S9;var ale=P.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=v9(S9,e.__scopeScrollArea),[a,o]=P.useState(!1);return P.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,R.jsx)(Hr,{present:n||a,children:(0,R.jsx)(w9,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),ole=P.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=v9(S9,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=R9(()=>c(`SCROLL_END`),100),[s,c]=nle(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return P.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),P.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,R.jsx)(Hr,{present:n||s!==`hidden`,children:(0,R.jsx)(T9,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Sr(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Sr(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),w9=P.forwardRef((e,t)=>{let n=v9(S9,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=P.useState(!1),s=e.orientation===`horizontal`,c=R9(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return z9(n.viewport,c),z9(n.content,c),(0,R.jsx)(Hr,{present:r||a,children:(0,R.jsx)(T9,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),T9=P.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=v9(S9,e.__scopeScrollArea),a=P.useRef(null),o=P.useRef(0),[s,c]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=N9(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return fle(e,o.current,s,t)}return n===`horizontal`?(0,R.jsx)(sle,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=F9(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,R.jsx)(cle,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=F9(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),sle=P.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=v9(S9,e.__scopeScrollArea),[o,s]=P.useState(),c=P.useRef(null),l=ar(t,c,a.onScrollbarXChange);return P.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(D9,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":P9(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),L9(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:M9(o.paddingLeft),paddingEnd:M9(o.paddingRight)}})}})}),cle=P.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=v9(S9,e.__scopeScrollArea),[o,s]=P.useState(),c=P.useRef(null),l=ar(t,c,a.onScrollbarYChange);return P.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,R.jsx)(D9,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":P9(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),L9(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:M9(o.paddingTop),paddingEnd:M9(o.paddingBottom)}})}})}),[lle,E9]=_9(S9),D9=P.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=v9(S9,n),[m,h]=P.useState(null),g=ar(t,e=>h(e)),_=P.useRef(null),v=P.useRef(``),y=p.viewport,b=r.content-r.viewport,x=bi(u),S=bi(c),C=R9(d,10);function w(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return P.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),P.useEffect(S,[r,S]),z9(m,C),z9(p.content,C),(0,R.jsx)(lle,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:bi(a),onThumbPointerUp:bi(o),onThumbPositionChange:S,onThumbPointerDown:bi(s),children:(0,R.jsx)(zr.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:Sr(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:Sr(e.onPointerMove,w),onPointerUp:Sr(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),O9=`ScrollAreaThumb`,k9=P.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=E9(O9,e.__scopeScrollArea);return(0,R.jsx)(Hr,{present:n||i.hasThumb,children:(0,R.jsx)(ule,{ref:t,...r})})}),ule=P.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=v9(O9,n),o=E9(O9,n),{onThumbPositionChange:s}=o,c=ar(t,e=>o.onThumbChange(e)),l=P.useRef(void 0),u=R9(()=>{l.current&&=(l.current(),void 0)},100);return P.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=ple(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,R.jsx)(zr.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Sr(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Sr(e.onPointerUp,o.onThumbPointerUp)})});k9.displayName=O9;var A9=`ScrollAreaCorner`,j9=P.forwardRef((e,t)=>{let n=v9(A9,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,R.jsx)(dle,{...e,ref:t}):null});j9.displayName=A9;var dle=P.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=v9(A9,n),[a,o]=P.useState(0),[s,c]=P.useState(0),l=!!(a&&s);return z9(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),z9(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,R.jsx)(zr.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function M9(e){return e?parseInt(e,10):0}function N9(e,t){let n=e/t;return isNaN(n)?0:n}function P9(e){let t=N9(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function fle(e,t,n,r=`ltr`){let i=P9(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return I9([c,l],d)(e)}function F9(e,t,n=`ltr`){let r=P9(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=tle(e,n===`ltr`?[0,o]:[o*-1,0]);return I9([0,o],[0,s])(c)}function I9(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function L9(e,t){return e>0&&e<t}var ple=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function R9(e,t){let n=bi(e),r=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),P.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function z9(e,t){let n=bi(t);Er(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var B9=y9,mle=x9,hle=j9,V9=P.forwardRef(({className:e,children:t,...n},r)=>(0,R.jsxs)(B9,{ref:r,className:L(`relative overflow-hidden`,e),...n,children:[(0,R.jsx)(mle,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,R.jsx)(H9,{}),(0,R.jsx)(hle,{})]}));V9.displayName=B9.displayName;var H9=P.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,R.jsx)(C9,{ref:r,orientation:t,className:L(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,R.jsx)(k9,{className:`relative flex-1 rounded-full bg-border`})}));H9.displayName=C9.displayName;function U9({node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o}){if(e.type!==`directory`)return null;let s=r.has(e.path),c=t===e.path,l=e.path===a||a.startsWith(e.path+`/`),u=e.children&&e.children.length>0;return(0,R.jsxs)(`div`,{className:`select-none`,children:[(0,R.jsxs)(`div`,{className:L(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,c&&`bg-accent`,l&&`opacity-50 pointer-events-none`),onClick:()=>!l&&n(e.path),children:[(0,R.jsx)(`button`,{onClick:t=>{t.stopPropagation(),u&&!l&&i(e.path)},className:L(`size-5 flex items-center justify-center rounded hover:bg-accent`,(!u||l)&&`invisible`),children:(0,R.jsx)(ve,{className:L(`size-3.5 transition-transform`,s&&`rotate-90`)})}),s?(0,R.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}):(0,R.jsx)(je,{className:`size-4 shrink-0 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`text-sm truncate flex-1`,children:e.name}),c&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`移动到这里`})]}),s&&u&&(0,R.jsx)(`div`,{className:`ml-4`,children:e.children.map(e=>(0,R.jsx)(U9,{node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o},e.path))})]})}function gle({open:e,onOpenChange:t,item:n,groups:r,onMove:i}){let[a,o]=(0,P.useState)(``),[s,c]=(0,P.useState)(null),[l,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(new Set);(0,P.useEffect)(()=>{n&&e&&(o(n.path.substring(0,n.path.lastIndexOf(`/`))||`/`),c(n.rootPath),u(n.rootPath))},[n,e]);let p=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},m=()=>{if(n&&a!==null&&s!==null&&l!==null){let e=n.path.split(`/`).pop()||``,r=a===`/`?`/${e}`:`${a}/${e}`;(r!==n.path||l!==s)&&i(n.path,r,l,s),t(!1)}};if(!n)return null;let h=r.find(e=>e.root.path===s)?.files||[],g=a?a===`/`?`目录`:a.split(`/`).filter(Boolean).join(` / `):``;return(0,R.jsx)(l9,{open:e,onOpenChange:t,children:(0,R.jsxs)(d9,{className:`sm:max-w-[480px] max-h-[80vh] flex flex-col`,children:[(0,R.jsxs)(f9,{children:[(0,R.jsx)(m9,{children:`移动到`}),(0,R.jsxs)(h9,{children:[`选择要将「`,n.name,`」移动到的目标位置`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(Ee,{className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:n.name})]}),r.length>1&&(0,R.jsxs)(`div`,{className:`mb-3`,children:[(0,R.jsx)(`label`,{className:`text-xs text-muted-foreground mb-1.5 block`,children:`目标目录`}),(0,R.jsx)(`select`,{value:s||``,onChange:e=>{c(e.target.value),o(`/`),f(new Set)},className:`w-full px-3 py-2 text-sm border rounded-md bg-background`,children:r.map(e=>(0,R.jsx)(`option`,{value:e.root.path,children:e.root.path.split(`/`).pop()||e.root.path},e.root.path))})]}),(0,R.jsx)(V9,{className:`h-[300px] border rounded-md`,children:(0,R.jsxs)(`div`,{className:`p-2 space-y-0.5`,children:[(0,R.jsxs)(`div`,{className:L(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,a===`/`&&`bg-accent`),onClick:()=>o(`/`),children:[(0,R.jsx)(je,{className:`size-4 shrink-0 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`text-sm`,children:`目录`}),a===`/`&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:`移动到这里`})]}),h.map(e=>(0,R.jsx)(U9,{node:e,selectedPath:a,onSelect:o,expandedPaths:d,onToggleExpand:p,currentItemPath:n.path,rootPath:s||``},e.path))]})}),(0,R.jsxs)(`div`,{className:`text-xs text-muted-foreground py-2`,children:[`目标位置: `,(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:g})]}),(0,R.jsxs)(p9,{children:[(0,R.jsx)(xr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,R.jsx)(xr,{onClick:m,disabled:a===null,children:`移动`})]})]})})}function W9({node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o}){if(e.type!==`directory`)return null;let s=r.has(e.path),c=t===e.path,l=e.path===a||a.startsWith(e.path+`/`),u=e.children&&e.children.length>0;return(0,R.jsxs)(`div`,{className:`select-none`,children:[(0,R.jsxs)(`div`,{className:L(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,c&&`bg-accent`,l&&`opacity-50 pointer-events-none`),onClick:()=>!l&&n(e.path),children:[(0,R.jsx)(`button`,{onClick:t=>{t.stopPropagation(),u&&!l&&i(e.path)},className:L(`size-5 flex items-center justify-center rounded hover:bg-accent`,(!u||l)&&`invisible`),children:(0,R.jsx)(ve,{className:L(`size-3.5 transition-transform`,s&&`rotate-90`)})}),s?(0,R.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}):(0,R.jsx)(je,{className:`size-4 shrink-0 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`text-sm truncate flex-1`,children:e.name}),c&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`复制到这里`})]}),s&&u&&(0,R.jsx)(`div`,{className:`ml-4`,children:e.children.map(e=>(0,R.jsx)(W9,{node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o},e.path))})]})}function _le({open:e,onOpenChange:t,item:n,groups:r,onCopy:i}){let[a,o]=(0,P.useState)(``),[s,c]=(0,P.useState)(null),[l,u]=(0,P.useState)(null),[d,f]=(0,P.useState)(new Set);(0,P.useEffect)(()=>{n&&e&&(o(n.path.substring(0,n.path.lastIndexOf(`/`))||`/`),c(n.rootPath),u(n.rootPath))},[n,e]);let p=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},m=()=>{if(n&&a!==null&&s!==null&&l!==null){let e=n.path.split(`/`).pop()||``,r=a===`/`?`/${e}`:`${a}/${e}`;i(n.path,r,l,s),t(!1)}};if(!n)return null;let h=r.find(e=>e.root.path===s)?.files||[],g=a?a===`/`?`目录`:a.split(`/`).filter(Boolean).join(` / `):``;return(0,R.jsx)(l9,{open:e,onOpenChange:t,children:(0,R.jsxs)(d9,{className:`sm:max-w-[480px] max-h-[80vh] flex flex-col`,children:[(0,R.jsxs)(f9,{children:[(0,R.jsx)(m9,{children:`复制到`}),(0,R.jsxs)(h9,{children:[`选择要将「`,n.name,`」复制到的目标位置`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(Ee,{className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:n.name})]}),r.length>1&&(0,R.jsxs)(`div`,{className:`mb-3`,children:[(0,R.jsx)(`label`,{className:`text-xs text-muted-foreground mb-1.5 block`,children:`目标目录`}),(0,R.jsx)(`select`,{value:s||``,onChange:e=>{c(e.target.value),o(`/`),f(new Set)},className:`w-full px-3 py-2 text-sm border rounded-md bg-background`,children:r.map(e=>(0,R.jsx)(`option`,{value:e.root.path,children:e.root.path.split(`/`).pop()||e.root.path},e.root.path))})]}),(0,R.jsx)(V9,{className:`h-[300px] border rounded-md`,children:(0,R.jsxs)(`div`,{className:`p-2 space-y-0.5`,children:[(0,R.jsxs)(`div`,{className:L(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,a===`/`&&`bg-accent`),onClick:()=>o(`/`),children:[(0,R.jsx)(je,{className:`size-4 shrink-0 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`text-sm`,children:`目录`}),a===`/`&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:`复制到这里`})]}),h.map(e=>(0,R.jsx)(W9,{node:e,selectedPath:a,onSelect:o,expandedPaths:d,onToggleExpand:p,currentItemPath:n.path,rootPath:s||``},e.path))]})}),(0,R.jsxs)(`div`,{className:`text-xs text-muted-foreground py-2`,children:[`目标位置: `,(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:g})]}),(0,R.jsxs)(p9,{children:[(0,R.jsx)(xr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,R.jsx)(xr,{onClick:m,disabled:a===null,children:`复制`})]})]})})}var G9=P.forwardRef(({className:e,checked:t,onCheckedChange:n,onClick:r,...i},a)=>(0,R.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,ref:a,onClick:e=>{r?.(e),n&&n(!t)},className:L(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,`data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...i,children:(0,R.jsx)(`span`,{"data-state":t?`checked`:`unchecked`,className:L(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform`,`data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));G9.displayName=`Switch`;function vle({open:e,onOpenChange:t}){let[n,r]=P.useState({showHiddenFiles:!1,allowedExtensions:`.md,.markdown,.mdown,.mkdn,.mkd,.mdwn,.mkdown,.ron`,ignore:{patterns:``}}),[i,a]=P.useState(!1),[o,s]=P.useState(null),[c,l]=P.useState(()=>typeof window>`u`?!1:window.innerWidth<768);P.useEffect(()=>{let e=()=>l(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),P.useEffect(()=>{e&&fetch(`/api/files/config`).then(e=>e.json()).then(e=>{r({showHiddenFiles:e.showHiddenFiles??!1,allowedExtensions:(e.allowedExtensions||[]).join(`,`),ignore:{patterns:(e.ignore?.patterns||[]).join(`
573
+ `)}}),s(null)}).catch(()=>{s(`Failed to load settings`)})},[e]);let u=P.useCallback(async()=>{a(!0),s(null);try{let e=n.allowedExtensions.split(`,`).map(e=>e.trim()).filter(e=>e.startsWith(`.`)),r=n.ignore.patterns.split(`
574
+ `).map(e=>e.trim()).filter(Boolean);if(!(await fetch(`/api/files/config`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({showHiddenFiles:n.showHiddenFiles,allowedExtensions:e,ignore:{patterns:r}})})).ok)throw Error(`Failed to save settings`);t(!1),window.dispatchEvent(new CustomEvent(`config-changed`))}catch{s(`Failed to save settings`)}finally{a(!1)}},[n,t]),d=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`grid gap-6 py-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,R.jsx)(`label`,{htmlFor:`show-hidden`,className:`text-sm font-medium leading-none`,children:`显示隐藏文件`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`显示以 . 开头的文件和文件夹`})]}),(0,R.jsx)(G9,{id:`show-hidden`,checked:n.showHiddenFiles,onCheckedChange:e=>r(t=>({...t,showHiddenFiles:e}))})]}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`label`,{htmlFor:`extensions`,className:`text-sm font-medium leading-none`,children:`文件扩展名`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`允许的文件扩展名,用逗号分隔`}),(0,R.jsx)(`textarea`,{id:`extensions`,value:n.allowedExtensions,onChange:e=>r(t=>({...t,allowedExtensions:e.target.value})),placeholder:`.md,.markdown,.mdown,.mkdn,.mkd,.mdwn,.mkdown,.ron`,rows:3,className:`flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`})]}),(0,R.jsxs)(`div`,{className:`border-t border-border pt-4 space-y-4`,children:[(0,R.jsx)(`div`,{className:`text-sm font-medium`,children:`忽略设置`}),(0,R.jsxs)(`div`,{className:`space-y-2`,children:[(0,R.jsx)(`label`,{htmlFor:`ignore-patterns`,className:`text-sm font-medium leading-none`,children:`全局忽略模式`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`每行一个模式,支持 glob 语法(如 node_modules/, *.log)`}),(0,R.jsx)(`textarea`,{id:`ignore-patterns`,value:n.ignore.patterns,onChange:e=>r(t=>({...t,ignore:{...t.ignore,patterns:e.target.value}})),placeholder:`node_modules/
575
+ dist/
576
+ *.log`,rows:4,className:`flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`})]})]}),o&&(0,R.jsx)(`p`,{className:`text-sm text-destructive`,children:o})]}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,R.jsx)(xr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,R.jsx)(xr,{onClick:u,disabled:i,children:i?`保存中...`:`保存`})]})]});return c?(0,R.jsx)(us,{open:e,onOpenChange:t,children:(0,R.jsxs)(ps,{side:`bottom`,className:`h-[85vh] flex flex-col`,children:[(0,R.jsxs)(ms,{className:`flex-shrink-0`,children:[(0,R.jsxs)(gs,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Je,{className:`size-5`}),`设置`]}),(0,R.jsx)(_s,{children:`配置编辑器显示选项。修改后页面将刷新。`})]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:d})]})}):(0,R.jsx)(l9,{open:e,onOpenChange:t,children:(0,R.jsxs)(d9,{className:`sm:max-w-[600px]`,children:[(0,R.jsxs)(f9,{children:[(0,R.jsxs)(m9,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Je,{className:`size-5`}),`设置`]}),(0,R.jsx)(h9,{children:`配置编辑器显示选项。修改后页面将刷新。`})]}),d]})})}function yle(e){let t=e.trim();if(!t)return{mode:`fuzzy`,root:`~`,query:``};if(t.includes(`/`)){let e=t.lastIndexOf(`/`),n=t.slice(0,e),r=t.slice(e+1);return r?{mode:`prefix`,root:n||(t.startsWith(`/`)?`/`:``),query:r}:{mode:`browse`,root:n||`/`,query:``}}return t===`~`?{mode:`browse`,root:`~`,query:``}:t===`/`?{mode:`browse`,root:`/`,query:``}:{mode:`fuzzy`,root:`~`,query:t}}var K9=`colonynote-recent-dirs`,q9=5,J9=null;function Y9(e){return J9&&e.startsWith(J9)?`~`+e.slice(J9.length):e}function ble(e){return e===`~`?J9||`/`:e.startsWith(`~/`)&&J9?xle(J9,e.slice(2)):e}function xle(e,t){if(!e)return t;if(!t)return e;let n=e.includes(`\\`)?`\\`:`/`,r=e.endsWith(n)?e.slice(0,-1):e,i=t.startsWith(n)?t.slice(1):t;return r+n+i}function Sle({path:e,query:t}){if(!t.trim())return(0,R.jsx)(`span`,{className:`truncate`,children:e});let n=e.toLowerCase(),r=t.toLowerCase().trim(),i=new Set,a=n.indexOf(r);for(;a!==-1;){for(let e=a;e<a+r.length;e++)i.add(e);a=n.indexOf(r,a+r.length)}if(i.size===0)return(0,R.jsx)(`span`,{className:`truncate`,children:e});let o=[],s=``,c=!1;for(let t=0;t<e.length;t++){let n=i.has(t);n===c?s+=e[t]:(s&&o.push(c?(0,R.jsx)(`mark`,{className:`bg-transparent font-semibold text-primary`,children:s},t):(0,R.jsx)(`span`,{children:s},t)),s=e[t],c=n)}return s&&o.push(c?(0,R.jsx)(`mark`,{className:`bg-transparent font-semibold text-primary`,children:s},`last`):(0,R.jsx)(`span`,{children:s},`last`)),(0,R.jsx)(`span`,{className:`truncate`,children:o})}var Cle=new Set([`home`,`yuexiaoliang`,`users`,`usr`,`var`,`opt`,`tmp`]);function wle(e){let t=new Map;for(let n of e){let e=n.path.split(/[\\/]/).filter(Boolean);for(let n=1;n<e.length-1&&n<=4;n++){let r=e[n];r&&r.length>1&&!Cle.has(r.toLowerCase())&&t.set(r,(t.get(r)||0)+1)}}return Array.from(t.entries()).filter(([,e])=>e>=2).sort((e,t)=>t[1]-e[1]).slice(0,4).map(([e])=>e)}var Tle=(0,P.memo)(function({open:e,onOpenChange:t}){let[n,r]=(0,P.useState)(()=>typeof window>`u`?!1:window.innerWidth<768),[i,a]=(0,P.useState)(``),[o,s]=(0,P.useState)([]),[c,l]=(0,P.useState)([]),[u,d]=(0,P.useState)([]),[f,p]=(0,P.useState)(null),[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(!1),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(null),S=(0,P.useRef)(null),C=(0,P.useRef)(null);(0,P.useEffect)(()=>{let e=()=>r(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,P.useEffect)(()=>{if(e){try{let e=localStorage.getItem(K9);if(e){let t=JSON.parse(e);d(Array.isArray(t)?t.slice(0,q9):[])}else d([])}catch{d([])}a(``),s([]),l([]),p(null),h(!1),y(!1),x(null)}},[e]),(0,P.useEffect)(()=>{if(e)return C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(async()=>{let e=i.trim();_(!0);try{if(e){y(!0);let t=yle(e),n=new URL(`/api/files/dirs/search`,window.location.origin);n.searchParams.set(`q`,t.query),t.root&&n.searchParams.set(`root`,t.root),n.searchParams.set(`mode`,t.mode),l((await(await fetch(n.toString())).json()).matches||[]),s([])}else{y(!1);let e=(await(await fetch(`/api/files/dirs/browse?path=~`)).json()).dirs||[];if(!J9&&e.length>0){let t=e[0],n=t.split(/[\\/]/).pop()||``;n&&(J9=t.slice(0,t.length-n.length-1))}s(e),l([])}}catch{s([]),l([])}finally{_(!1)}},150),()=>{C.current&&window.clearTimeout(C.current)}},[i,e]);let w=(0,P.useCallback)(e=>{try{let t=localStorage.getItem(K9),n=t?JSON.parse(t):[];n=n.filter(t=>t!==e),n.unshift(e),n.length>q9&&(n=n.slice(0,q9)),localStorage.setItem(K9,JSON.stringify(n))}catch{}},[]),T=(0,P.useCallback)(async e=>{let n=ble(e);if(n.trim()){h(!0),p(null);try{let r=await fetch(`/api/files/dirs`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n.trim()})}),i=await r.json();if(!r.ok){i.conflictWith?p(`${{child:`此目录是已添加目录的子目录`,parent:`此目录是已添加目录的父目录`,duplicate:`此目录已经添加`}[i.reason]||`路径冲突`}:${i.conflictWith}`):i.error===`Sensitive path not allowed`?p(`不允许添加敏感路径`):i.error===`Path does not exist`?p(`路径不存在`):i.error===`Path must be a directory`?p(`路径必须是目录`):p(`添加目录失败:${i.error||`未知错误`}`);return}w(e),t(!1),window.dispatchEvent(new CustomEvent(`config-changed`))}catch{p(`添加目录失败:网络错误`)}finally{h(!1)}}},[t,w]),E=(0,P.useCallback)(e=>{a(e),p(null)},[]),D=(0,P.useCallback)(()=>{a(``),p(null),S.current?.focus()},[]),O=o.map(e=>({fullPath:e,displayPath:Y9(e),name:e.split(/[\\/]/).pop()||e})),k=c.map(e=>({fullPath:e.path,displayPath:Y9(e.path),name:e.path.split(/[\\/]/).pop()||e.path})),A=u.map(e=>({fullPath:e,displayPath:e,name:e.split(/[\\/]/).pop()||e})),ee=(0,P.useMemo)(()=>wle(c),[c]),j=(0,P.useCallback)(e=>{let t=b===e?null:e;x(t),a(t?`${t}/${i.trim().replace(/^[\w-]+\//,``)}`:i.replace(/^[\w-]+\//,``)),S.current?.focus()},[b,i]),te=(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)(`div`,{className:`space-y-2 py-4`,children:[(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(qe,{className:`absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground pointer-events-none`}),(0,R.jsx)(nr,{ref:S,value:i,onChange:e=>E(e.target.value),placeholder:`输入路径或搜索目录...`,disabled:m,className:L(`pl-9 pr-8 rounded-xl`,n&&`h-12 text-base`)}),i&&(0,R.jsx)(`button`,{type:`button`,onClick:D,className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground rounded`,disabled:m,children:(0,R.jsx)(Qe,{className:`size-3.5`})})]}),v&&ee.length>0&&(0,R.jsx)(`div`,{className:`flex gap-1.5 overflow-x-auto pb-1 scrollbar-none`,children:ee.map(e=>(0,R.jsx)(`button`,{type:`button`,onClick:()=>j(e),className:L(`shrink-0 px-3 py-1 rounded-full text-xs font-medium transition-colors`,b===e?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-muted/80`),children:e},e))}),f&&(0,R.jsx)(`p`,{className:`text-sm text-destructive px-1`,children:f}),(0,R.jsx)(V9,{className:L(`border rounded-xl bg-background`,n?`h-[45vh]`:`h-[320px]`),children:(0,R.jsxs)(`div`,{className:`p-2`,children:[A.length>0&&(0,R.jsxs)(`div`,{className:`mb-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1 mb-1.5`,children:[(0,R.jsx)(xe,{className:`size-3 text-muted-foreground/50`}),(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground/60 uppercase tracking-wider`,children:`最近项目`})]}),(0,R.jsx)(`div`,{className:`space-y-0.5`,children:A.map(e=>{let t=e.displayPath.slice(0,-e.name.length);return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>T(e.fullPath),disabled:m,className:`w-full flex items-start gap-2 px-2 py-2.5 rounded-lg hover:bg-accent text-left transition-colors disabled:opacity-50`,children:[(0,R.jsx)(ke,{className:`size-4 shrink-0 text-primary/60 mt-0.5`}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-foreground truncate`,children:e.name}),t&&(0,R.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 truncate`,children:t})]})]},e.fullPath)})})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1 mb-1.5`,children:[v?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($e,{className:`size-3 text-muted-foreground/50`}),(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground/60 uppercase tracking-wider`,children:`搜索结果`})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(je,{className:`size-3 text-muted-foreground/50`}),(0,R.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground/60 uppercase tracking-wider`,children:`打开项目`})]}),g&&(0,R.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 normal-case ml-auto`,children:`加载中...`})]}),v?k.length===0&&!g?(0,R.jsx)(`div`,{className:`px-2 py-6 text-center text-sm text-muted-foreground`,children:`未找到匹配的目录`}):(0,R.jsx)(`div`,{className:`space-y-0.5`,children:k.map(e=>{let t=e.displayPath.slice(0,-e.name.length);return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>T(e.fullPath),disabled:m,className:`w-full flex items-start gap-2 px-2 py-2.5 rounded-lg hover:bg-accent text-left transition-colors disabled:opacity-50`,children:[(0,R.jsx)(je,{className:`size-4 shrink-0 text-muted-foreground/40 mt-0.5`}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm truncate`,children:(0,R.jsx)(Sle,{path:e.name,query:i.replace(/^[\w-]+\//,``)})}),t&&(0,R.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 truncate`,children:t})]})]},e.fullPath)})}):O.length===0&&!g?(0,R.jsx)(`div`,{className:`px-2 py-6 text-center text-sm text-muted-foreground`,children:`该目录下没有子文件夹`}):(0,R.jsx)(`div`,{className:`space-y-0.5`,children:O.map(e=>{let t=e.displayPath.slice(0,-e.name.length);return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>T(e.fullPath),disabled:m,className:`w-full flex items-start gap-2 px-2 py-2.5 rounded-lg hover:bg-accent text-left transition-colors disabled:opacity-50`,children:[(0,R.jsx)(je,{className:`size-4 shrink-0 text-muted-foreground/40 mt-0.5`}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`p`,{className:`text-sm font-medium text-foreground truncate`,children:e.name}),t&&(0,R.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 truncate`,children:t})]})]},e.fullPath)})})]})]})})]})});return n?(0,R.jsx)(us,{open:e,onOpenChange:t,children:(0,R.jsxs)(ps,{side:`bottom`,className:`rounded-t-2xl h-[85vh] flex flex-col`,children:[(0,R.jsx)(ms,{className:`flex-shrink-0`,children:(0,R.jsx)(gs,{children:`打开项目`})}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:te})]})}):(0,R.jsx)(l9,{open:e,onOpenChange:t,children:(0,R.jsxs)(d9,{className:`sm:max-w-[520px]`,children:[(0,R.jsx)(f9,{children:(0,R.jsx)(m9,{children:`打开项目`})}),te]})})}),Ele=(0,P.memo)(function({open:e,onOpenChange:t,dirPath:n,isCli:r}){let[i,a]=(0,P.useState)(()=>typeof window>`u`?!1:window.innerWidth<768),[o,s]=(0,P.useState)(``),[c,l]=(0,P.useState)(null),[u,d]=(0,P.useState)(!1),[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(!1);(0,P.useEffect)(()=>{let e=()=>a(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,P.useEffect)(()=>{e&&n&&(s(n.split(`/`).pop()||n),l(null),d(!1),p(!1),h(!1))},[e,n]);let g=(0,P.useCallback)(async()=>{if(n){d(!0),l(null);try{let e=await fetch(`/api/files/dirs`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n,name:o})}),r=await e.json();if(!e.ok){l(`保存失败:${r.error||`未知错误`}`);return}t(!1),window.dispatchEvent(new CustomEvent(`config-changed`))}catch{l(`保存失败:网络错误`)}finally{d(!1)}}},[n,o,t]),_=(0,P.useCallback)(async()=>{if(n){h(!0),l(null);try{let e=await fetch(`/api/files/dirs?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await e.json();if(!e.ok){l(`删除失败:${r.error||`未知错误`}`),p(!1);return}p(!1),t(!1),window.dispatchEvent(new CustomEvent(`config-changed`))}catch{l(`删除失败:网络错误`),p(!1)}finally{h(!1)}}},[n,t]),v=(0,R.jsxs)(`div`,{className:`space-y-4`,children:[n&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded-lg bg-muted/30 border border-border/40`,children:[(0,R.jsx)(`div`,{className:`size-2 rounded-full bg-emerald-500 shrink-0`}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:n})]}),(0,R.jsx)(`div`,{className:`space-y-3`,children:(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`text-xs font-medium text-foreground mb-1.5 block`,children:`显示名称`}),(0,R.jsx)(nr,{value:o,onChange:e=>s(e.target.value),placeholder:n?n.split(`/`).pop()||n:`输入显示名称`,disabled:u}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground/60 mt-1.5`,children:`此名称将显示在目录切换器中`})]})}),c&&(0,R.jsx)(`p`,{className:`text-sm text-destructive`,children:c}),(0,R.jsx)(`div`,{className:`rounded-xl border border-destructive/15 bg-destructive/[0.03] p-3.5`,children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs font-medium text-foreground mb-0.5`,children:`从列表中移除`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:`文件不会被删除`})]}),(0,R.jsxs)(xr,{variant:`outline`,size:`sm`,onClick:()=>p(!0),disabled:u||m||r,title:r?`CLI启动的目录无法删除`:void 0,className:`shrink-0 border-destructive/30 text-destructive hover:bg-destructive/10 hover:text-destructive text-xs`,children:[(0,R.jsx)(Ze,{className:`size-3.5 mr-1`}),`移除`]})]})}),(0,R.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,R.jsx)(xr,{variant:`outline`,className:`flex-1`,onClick:()=>t(!1),disabled:u,children:`取消`}),(0,R.jsx)(xr,{className:`flex-1`,onClick:g,disabled:u,children:u?`保存中...`:`保存`})]})]}),y=(0,R.jsx)(Zs,{open:f,onOpenChange:p,children:(0,R.jsxs)(ec,{children:[(0,R.jsxs)(tc,{children:[(0,R.jsx)(rc,{children:`确定要移除目录吗?`}),(0,R.jsx)(ic,{children:`文件不会被删除,只是从列表中移除。`})]}),(0,R.jsxs)(nc,{children:[(0,R.jsx)(oc,{disabled:m,children:`取消`}),(0,R.jsx)(ac,{onClick:_,disabled:m,children:m?`删除中...`:`确认移除`})]})]})});return i?(0,R.jsx)(us,{open:e,onOpenChange:t,children:(0,R.jsxs)(ps,{side:`bottom`,className:`rounded-t-2xl h-[85vh] flex flex-col`,children:[(0,R.jsxs)(ms,{className:`flex-shrink-0`,children:[(0,R.jsx)(gs,{children:`目录设置`}),(0,R.jsx)(_s,{children:`修改显示名称或删除目录`})]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto py-4`,children:v}),y]})}):(0,R.jsx)(l9,{open:e,onOpenChange:t,children:(0,R.jsxs)(d9,{className:`sm:max-w-[425px]`,children:[(0,R.jsxs)(f9,{children:[(0,R.jsx)(m9,{children:`目录设置`}),(0,R.jsx)(h9,{children:`修改显示名称或删除目录`})]}),(0,R.jsx)(`div`,{className:`py-2`,children:v}),y]})})}),X9=P.forwardRef(({className:e,...t},n)=>(0,R.jsx)(`textarea`,{className:L(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,e),ref:n,...t}));X9.displayName=`Textarea`;var Z9=`chore: 更新文档内容`;function Dle({open:e,onOpenChange:t,rootPath:n}){let[r,i]=(0,P.useState)(null),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(Z9),[d,f]=(0,P.useState)(null),[p,m]=(0,P.useState)(null),[h,g]=(0,P.useState)(new Set),_=(0,P.useRef)(null),[v,y]=(0,P.useState)(()=>typeof window>`u`?!1:window.innerWidth<768);(0,P.useEffect)(()=>{let e=()=>y(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,P.useEffect)(()=>{e&&b()},[e]),(0,P.useEffect)(()=>{e&&r?.isGitRepo&&setTimeout(()=>_.current?.focus(),100)},[e,r]);let b=async()=>{o(!0),f(null);try{let e=n?`/api/files/git/status?root=${encodeURIComponent(n)}`:`/api/files/git/status`,t=await(await fetch(e)).json();t.error?f(t.error):(i(t),g(new Set(t.files.map(e=>e.path))))}catch(e){f(e instanceof Error?e.message:`Failed to fetch git status`)}finally{o(!1)}},x=async()=>{if(l.trim()&&h.size!==0){c(!0),f(null),m(null);try{let e=n?`/api/files/git/commit?root=${encodeURIComponent(n)}`:`/api/files/git/commit`,t=await(await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({message:l.trim(),files:Array.from(h)})})).json();if(t.error){f(t.error);return}let r=n?`/api/files/git/push?root=${encodeURIComponent(n)}`:`/api/files/git/push`,i=await(await fetch(r,{method:`POST`})).json();i.error?m(`已提交,推送失败:`+i.error):m(`提交成功`),window.dispatchEvent(new CustomEvent(`git-commit-success`,{detail:{rootPath:n}})),u(Z9),await b()}catch(e){f(e instanceof Error?e.message:`Failed to commit`)}finally{c(!1)}}},S=e=>{let t=e.trim();return t===`A `||t===`AM`?`新增`:t===`??`?`未跟踪`:t===`M `||t===`MM`?`已修改`:t===` D`||t===`D `?`已删除`:t===`R `||t===`RM`?`已重命名`:t===`C `?`已复制`:t},C=e=>{let t=e.trim();return t===`A `||t===`AM`||t===`??`?(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-green-500 shrink-0`}):t===`M `||t===`MM`?(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-yellow-500 shrink-0`}):t===` D`||t===`D `?(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-red-500 shrink-0`}):(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground shrink-0`})},w=e=>{e||(f(null),m(null),g(new Set)),t(e)};if(!r?.isGitRepo&&!a&&r)return null;let T=(0,R.jsxs)(R.Fragment,{children:[a&&(0,R.jsxs)(`div`,{className:`flex items-center justify-center py-12`,children:[(0,R.jsx)(Le,{className:`size-6 animate-spin text-muted-foreground`}),(0,R.jsx)(`span`,{className:`ml-2 text-sm text-muted-foreground`,children:`加载 Git 状态...`})]}),d&&!a&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2 p-3 rounded-md bg-destructive/10 text-destructive text-sm`,children:[(0,R.jsx)(ye,{className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{children:d})]}),p&&(0,R.jsxs)(`div`,{className:`flex items-center gap-2 p-3 rounded-md bg-green-500/10 text-green-600 dark:text-green-400 text-sm`,children:[(0,R.jsx)(be,{className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{children:p})]}),!a&&r?.isGitRepo&&(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,R.jsxs)(`h3`,{className:`text-sm font-medium`,children:[`变更 (`,r.files.length,`)`]}),r.files.length>0&&(0,R.jsx)(`button`,{type:`button`,className:`text-xs text-primary hover:underline`,onClick:()=>{h.size===r.files.length?g(new Set):g(new Set(r.files.map(e=>e.path)))},children:h.size===r.files.length?`取消全选`:`全选`})]}),(0,R.jsx)(V9,{className:L(`border rounded-md`,v?`h-40`:`h-48`),children:r.files.length===0?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:`没有未提交的变更`}):(0,R.jsx)(`div`,{className:`p-2 space-y-1`,children:r.files.map((e,t)=>{let n=h.has(e.path);return(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 rounded-md text-sm hover:bg-muted/50 cursor-pointer select-none`,onClick:()=>{let t=new Set(h);t.has(e.path)?t.delete(e.path):t.add(e.path),g(t)},children:[(0,R.jsx)(`div`,{className:L(`size-4 rounded border flex items-center justify-center shrink-0 transition-colors`,n?`bg-primary border-primary text-primary-foreground`:`border-input bg-background`),children:n&&(0,R.jsx)(ge,{className:`size-3`})}),C(e.status),(0,R.jsx)(`span`,{className:`flex-1 truncate font-mono text-xs`,title:e.path,children:e.path}),(0,R.jsx)(`span`,{className:`text-[11px] text-muted-foreground shrink-0`,children:S(e.status)})]},t)})})})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`label`,{className:`text-sm font-medium mb-1.5 block`,children:`提交消息`}),(0,R.jsx)(X9,{ref:_,value:l,onChange:e=>u(e.target.value),placeholder:`输入提交消息...`,className:L(`resize-none`,v?`h-16`:`h-20`)})]}),r.recentCommits.length>0&&(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,R.jsx)(xe,{className:`size-3.5 text-muted-foreground`}),(0,R.jsx)(`h3`,{className:`text-sm font-medium`,children:`最近提交`})]}),(0,R.jsx)(V9,{className:L(`border rounded-md`,v?`h-28`:`h-32`),children:(0,R.jsx)(`div`,{className:`p-2 space-y-1`,children:r.recentCommits.map(e=>(0,R.jsxs)(`div`,{className:`px-2 py-1.5 rounded-md text-sm hover:bg-muted/50`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:e.hash.slice(0,7)}),(0,R.jsx)(`span`,{className:`flex-1 truncate`,children:e.message})]}),(0,R.jsxs)(`div`,{className:`text-[11px] text-muted-foreground mt-0.5`,children:[e.author,` · `,e.date]})]},e.hash))})})]})]})]}),E=h.size,D=(0,R.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,R.jsx)(xr,{variant:`outline`,className:`flex-1`,onClick:()=>w(!1),children:`取消`}),(0,R.jsxs)(xr,{className:`flex-1`,disabled:s||E===0,onClick:()=>x(),children:[s?(0,R.jsx)(Le,{className:`size-4 animate-spin mr-1`}):null,`提交`,E>0?` (${E})`:``]})]});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l9,{open:!v&&e,onOpenChange:w,children:(0,R.jsxs)(d9,{className:`sm:max-w-[520px] grid-cols-[minmax(0,1fr)]`,children:[(0,R.jsxs)(f9,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Me,{className:`size-5 text-muted-foreground`}),(0,R.jsx)(m9,{children:`Git 提交`})]}),(0,R.jsx)(h9,{children:r?.gitRoot&&(0,R.jsx)(`span`,{className:`truncate block font-mono text-xs`,title:r.gitRoot,children:r.gitRoot})})]}),T,r&&r.files.length>0&&(0,R.jsxs)(p9,{className:`sm:justify-end gap-2`,children:[(0,R.jsx)(xr,{variant:`outline`,onClick:()=>w(!1),children:`取消`}),(0,R.jsxs)(xr,{disabled:s||E===0,onClick:()=>x(),children:[s?(0,R.jsx)(Le,{className:`size-4 animate-spin mr-1`}):null,`提交`,E>0?` (${E})`:``]})]})]})}),(0,R.jsx)(us,{open:v&&e,onOpenChange:w,children:(0,R.jsxs)(ps,{side:`bottom`,className:`rounded-t-2xl h-[85vh] flex flex-col pb-8`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-4 shrink-0`,children:[(0,R.jsx)(Me,{className:`size-5 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`text-base font-semibold`,children:`Git 提交`})]}),r?.gitRoot&&(0,R.jsx)(`div`,{className:`text-xs text-muted-foreground font-mono truncate mb-4 shrink-0`,title:r.gitRoot,children:r.gitRoot}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto space-y-4`,children:T}),r&&r.files.length>0&&(0,R.jsx)(`div`,{className:`shrink-0`,children:D})]})})]})}var Q9=[`#2563eb`,`#059669`,`#d97706`,`#7c3aed`,`#e11d48`,`#0891b2`],$9=(0,P.memo)(function({groups:e,activePath:t,activeRoot:n,currentDir:r,expandedPaths:i,setExpandedPaths:a,onSelect:o,onDelete:s,onRenameRequest:c,onMoveRequest:l,onCopyRequest:u,onExpand:d,editingType:f,onEditingChange:p,onCreateSubmit:m,onCreateRequest:h,onSettingsOpen:g,onClose:_,onDirChange:v,onAddDir:y,onEditDir:b,onGitCommitRequest:x,onToggleTheme:S,themeMode:C}){let w=e.find(e=>e.root.path===n)?.files||[];return(0,R.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border shrink-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`img`,{src:`/logo.png`,alt:`logo`,className:`size-8 shrink-0`}),(0,R.jsx)(`span`,{className:`font-semibold text-sm`,children:`ColonyNote`})]}),(0,R.jsxs)(`div`,{className:`flex gap-1`,children:[S&&(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:S,title:C===`light`?`切换到深色主题`:C===`dark`?`切换到跟随系统`:`切换到浅色主题`,children:C===`dark`?(0,R.jsx)(Ye,{className:`size-4`}):C===`system`?(0,R.jsx)(Be,{className:`size-4`}):(0,R.jsx)(Ve,{className:`size-4`})}),_&&(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:_,title:`关闭`,className:`md:hidden`,children:(0,R.jsx)(Qe,{className:`size-4`})}),!1,(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:g,title:`设置`,children:(0,R.jsx)(Je,{className:`size-4`})})]})]}),e.length===0?(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 px-4 text-center border-b border-border`,children:[(0,R.jsx)(ke,{className:`size-12 mb-3 text-muted-foreground/50`}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground mb-4`,children:`暂无目录`}),(0,R.jsxs)(xr,{variant:`outline`,size:`sm`,onClick:()=>y?.(),children:[(0,R.jsx)(We,{className:`size-4 mr-1`}),`添加目录`]})]}):(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 px-4 py-2 border-b border-border shrink-0 overflow-x-auto dir-tabs-scroll`,style:{WebkitOverflowScrolling:`touch`},children:[e.map((e,t)=>{let r=n===e.root.path,i=Q9[t%Q9.length];return(0,R.jsxs)(`button`,{onClick:()=>v?.(e.root.path),className:L(`relative group flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium transition-all duration-150 shrink-0`,r?`bg-primary text-primary-foreground shadow-sm`:`text-muted-foreground hover:bg-muted hover:text-foreground`,e.error&&!r&&`text-destructive/70 hover:text-destructive`),title:e.error||e.root.path,children:[(0,R.jsx)(`span`,{className:L(`size-1.5 rounded-full shrink-0`,r?`bg-primary-foreground/60`:``),style:{backgroundColor:r?void 0:i}}),e.error&&(0,R.jsx)(ye,{className:`size-3 text-destructive shrink-0`}),(0,R.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.root.name||e.root.path.split(`/`).pop()||e.root.path}),(0,R.jsx)(`span`,{className:`hidden md:block absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-popover text-popover-foreground text-xs rounded shadow-lg opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap z-50`,children:e.error?`${e.root.path} (${e.error})`:e.root.path})]},e.root.path)}),(0,R.jsx)(`button`,{onClick:()=>y?.(),className:`flex items-center justify-center size-7 rounded-full border border-dashed border-border text-muted-foreground hover:text-foreground hover:border-foreground/30 transition-colors shrink-0`,title:`添加目录`,children:(0,R.jsx)(We,{className:`size-3.5`})})]}),(0,R.jsx)(uc,{files:w,activePath:t,activeRoot:n,currentDir:r,expandedPaths:i,setExpandedPaths:a,onSelect:o,onDelete:s,onRenameRequest:c,onMoveRequest:l,onCopyRequest:u,onExpand:d,editingType:f,onEditingChange:p,onCreateSubmit:m,onCreateRequest:h,onEditDir:b,onGitCommitRequest:x})]})});function Ole(){let[e,t]=(0,P.useState)([]),[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(!1),[o,s]=(0,P.useState)(!1),[c,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(!1),[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(!1),[g,_]=(0,P.useState)(null),[v,y]=(0,P.useState)(null),[b,x]=(0,P.useState)(null),[S,C]=(0,P.useState)(()=>typeof window>`u`?!1:window.innerWidth<768),[w,T]=(0,P.useState)(`wysiwyg`),[E,D]=(0,P.useState)(``),[O,k]=(0,P.useState)(new Set),A=(0,P.useRef)(new Map),[ee,j]=(0,P.useState)(null),[te,M]=(0,P.useState)(!1),[ne,N]=(0,P.useState)(!1),[re,ie]=(0,P.useState)(!1),[ae,oe]=(0,P.useState)(null),[se,ce]=(0,P.useState)(!1),[le,ue]=(0,P.useState)(()=>{let e=localStorage.getItem(`colonynote-theme`);return e===`light`||e===`dark`||e===`system`?e:`system`}),[de,fe]=(0,P.useState)(`editor`),[pe,me]=(0,P.useState)(null),[ge,_e]=(0,P.useState)(()=>{if(typeof window>`u`)return 260;let e=localStorage.getItem(`sidebar-width`);return e?parseInt(e,10):260}),ve=(0,P.useRef)(!1),ye=(0,P.useRef)(!1),be=(0,P.useRef)(null),xe=(0,P.useRef)(new Map),Ce=`colonynote:scroll-positions`;(0,P.useEffect)(()=>{try{let e=localStorage.getItem(Ce);if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t))xe.current.set(e,n)}}catch{}},[]);let{tabs:we,tabOrder:Te,activeTabPath:De,openTab:Oe,closeTab:ke,updateTabContent:Ae,saveTab:je,saveAllTabs:Me,isTabDirty:Ne,isTabPinned:Pe,getActiveTab:Fe,handleWsFileChange:Le,togglePin:Re,closeOtherTabs:ze,closeRightTabs:Be,closeLeftTabs:Ve,closeAllTabs:Ue,closeGroupTabs:We,closeOtherGroupTabs:Ge}=Dt({onSaveStart:()=>{},onSave:()=>{},onError:e=>console.error(e)}),Ke=(0,P.useCallback)(()=>{if(!De)return;let e=document.querySelector(`.tiptap-editor-scroll-area`)||document.querySelector(`.editor-textarea`);if(e){xe.current.set(De,e.scrollTop);try{localStorage.setItem(Ce,JSON.stringify(Object.fromEntries(xe.current)))}catch{}}},[De]);(0,P.useEffect)(()=>{},[]),(0,P.useEffect)(()=>{let e=()=>C(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,P.useEffect)(()=>{let e=e=>{let t=e===`dark`||e===`system`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;t!==document.documentElement.classList.contains(`dark`)&&(t?document.documentElement.classList.add(`dark`):document.documentElement.classList.remove(`dark`),window.dispatchEvent(new CustomEvent(`theme-change`))),localStorage.setItem(`colonynote-theme`,e)};e(le);let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{le===`system`&&e(`system`)};t.addEventListener(`change`,n);let r=()=>{let e=localStorage.getItem(`colonynote-theme`);(e===`light`||e===`dark`||e===`system`)&&ue(e)};return window.addEventListener(`theme-change`,r),()=>{t.removeEventListener(`change`,n),window.removeEventListener(`theme-change`,r)}},[le]),(0,P.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),l(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,P.useEffect)(()=>{let e=Fe();if(!e)return;let t=e.path.split(`/`).filter(Boolean),n=[];for(let e=0;e<t.length-1;e++)n.push(`/`+t.slice(0,e+1).join(`/`));n.length>0&&k(e=>{let t=new Set(e);return n.forEach(e=>t.add(e)),t})},[De,Fe]);let Je=(0,P.useCallback)(async()=>{if(!ye.current){ye.current=!0;try{let e=await(await fetch(`/api/files/`)).json();if(t(e.groups||[]),!n&&e.groups?.length>0){let t=decodeURIComponent(window.location.hash.slice(1)),n=t.indexOf(`:`),i=n>0?t.substring(0,n):null;r(i&&e.groups.some(e=>e.root.path===i)?i:e.groups[0].root.path)}}catch(e){console.error(`Failed to fetch files:`,e)}finally{ye.current=!1}}},[n]);(0,P.useEffect)(()=>{Je()},[Je]),(0,P.useEffect)(()=>{let e=async()=>{try{let e=await(await fetch(`/api/files/`)).json();t(e.groups||[]),!e.groups?.some(e=>e.root.path===n)&&n?(Te.forEach(e=>ke(e)),r(e.groups?.[0]?.root.path||null)):!n&&e.groups?.length>0&&r(e.groups[0].root.path)}catch(e){console.error(`Failed to fetch files on config change:`,e)}};return window.addEventListener(`config-changed`,e),()=>window.removeEventListener(`config-changed`,e)},[n,Te,ke]),Ct((0,P.useCallback)(e=>{if(e.type===`file:change`){let t=e.path,n=e.rootPath;if(!t)return;Le(t,n,Je)}},[Je,n,Le])),(0,P.useEffect)(()=>{let e=()=>{Je()};return window.addEventListener(`ws:reconnected`,e),()=>window.removeEventListener(`ws:reconnected`,e)},[Je]);let Ye=(0,P.useCallback)((e,t,r)=>{if(t===`file`){let t=e.split(`/`).filter(Boolean),i=[];for(let e=0;e<t.length-1;e++)i.push(`/`+t.slice(0,e+1).join(`/`));i.length>0&&k(e=>{let t=new Set(e);return i.forEach(e=>t.add(e)),t}),Ke(),Oe(e,r||n),D(e.substring(0,e.lastIndexOf(`/`))),a(!1)}else D(e)},[Oe,n,Ke]),Xe=(0,P.useCallback)(e=>{D(e)},[]),Ze=(0,P.useCallback)(e=>{if(j(e),E){let e=E.split(`/`).filter(Boolean),t=new Set;for(let n=0;n<e.length;n++)t.add(`/`+e.slice(0,n+1).join(`/`));k(e=>{let n=new Set(e);return t.forEach(e=>n.add(e)),n})}},[E]),Qe=(0,P.useCallback)(async(e,t)=>{try{let r=t||e.includes(`.`)?e:`${e}.md`;await fetch(`/api/files`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:`create`,parentPath:E,name:r,isDirectory:t,root:n})}),j(null),Je()}catch(e){console.error(`Failed to create:`,e)}},[n,E,Je]),$e=(0,P.useCallback)((e,t)=>{j(e?`directory`:`file`),D(t);let n=t.split(`/`).filter(Boolean),r=new Set;for(let e=0;e<n.length;e++)r.add(`/`+n.slice(0,e+1).join(`/`));k(e=>{let t=new Set(e);return r.forEach(e=>t.add(e)),t})},[]);(0,P.useEffect)(()=>{let e=()=>{let e=decodeURIComponent(window.location.hash.slice(1));if(e&&be.current!==e){be.current=e;let t=e.indexOf(`:`),n=null,i;if(t>0?(n=e.substring(0,t),i=e.substring(t+1)):i=e,!i||i===`/`){be.current=null;return}Ke(),Oe(i,n),n&&r(n),D(i.substring(0,i.lastIndexOf(`/`)));let a=[],o=i;for(;o.includes(`/`);)o=o.substring(0,o.lastIndexOf(`/`)),o&&a.push(o);k(e=>{let t=new Set(e);return a.forEach(e=>t.add(e)),t})}};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[Oe]);let et=(0,P.useCallback)(async(e,t)=>{try{let n=`/api/files${e}?root=${encodeURIComponent(t)}`;await fetch(n,{method:`DELETE`});for(let[n,r]of we)r.path===e&&r.rootPath===t&&ke(n);Je()}catch(e){console.error(`Failed to delete:`,e)}},[Je,we,ke]),tt=(0,P.useCallback)(async(e,t,n,r)=>{try{let i=e.substring(0,e.lastIndexOf(`/`)),a=e,o=t,s=i?`${i}/${o}`:`/${o}`;await fetch(`/api/files`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({oldPath:a,newPath:s,isDirectory:r,sourceRoot:n,targetRoot:n})});let c=(()=>{for(let[t,r]of we)if(r.path===e&&r.rootPath===n)return t;return null})();if(c){let e=De===c;ke(c),e&&Oe(s,n)}Je()}catch(e){console.error(`Failed to rename:`,e)}},[we,De,ke,Oe,Je]),nt=(0,P.useCallback)(async(e,t,n,r)=>{try{let i=e.split(`/`).pop()||``;e.substring(0,e.lastIndexOf(`/`));let a=!i.includes(`.`);await fetch(`/api/files`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({oldPath:e,newPath:t,isDirectory:a,sourceRoot:n,targetRoot:r})});let o=(()=>{for(let[t,r]of we)if(r.path===e&&r.rootPath===n)return t;return null})();if(o){let e=De===o;ke(o),e&&Oe(t,r)}Je()}catch(e){console.error(`Failed to move:`,e)}},[we,De,ke,Oe,Je]),rt=(0,P.useCallback)(async(e,t,n,r)=>{try{await fetch(`/api/files/copy`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sourcePath:e,targetPath:t,sourceRoot:n,targetRoot:r})}),Je()}catch(e){console.error(`Failed to copy:`,e)}},[Je]),it=(0,P.useCallback)(async(e,t,r)=>{try{let i=t||e.includes(`.`)?e:`${e}.md`;await fetch(`/api/files`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:`create`,parentPath:r,name:i,isDirectory:t,root:n})}),Je()}catch(e){console.error(`Failed to create:`,e)}},[n,Je]);(0,P.useCallback)(()=>{Me()},[Me]),(0,P.useCallback)(e=>{T(t=>{if(t===e)return t;let n=document.querySelector(`.tiptap-editor-scroll-area`)||document.querySelector(`.editor-textarea`);return n&&De&&xe.current.set(De,n.scrollTop),e})},[De]);let at=(0,P.useCallback)(()=>{T(e=>{let t=e===`read`?`wysiwyg`:`read`,n=document.querySelector(`.tiptap-editor-scroll-area`)||document.querySelector(`.editor-textarea`);return n&&De&&xe.current.set(De,n.scrollTop),t})},[De]),ot=(0,P.useCallback)(()=>{T(e=>{let t=e===`source`?`wysiwyg`:`source`,n=document.querySelector(`.tiptap-editor-scroll-area`)||document.querySelector(`.editor-textarea`);return n&&De&&xe.current.set(De,n.scrollTop),t})},[De]),st=(0,P.useCallback)(()=>{ue(e=>e===`light`?`dark`:e===`dark`?`system`:`light`)},[]),ct=(0,P.useCallback)(e=>{n&&A.current.set(n,new Set(O)),r(e),k(A.current.get(e)??new Set),D(``)},[n,O]),lt=(0,P.useCallback)(e=>{e.preventDefault(),ve.current=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`},[]),ut=(0,P.useCallback)(()=>{ve.current&&(ve.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``,_e(e=>(localStorage.setItem(`sidebar-width`,e.toString()),e)))},[]);(0,P.useEffect)(()=>{let e=e=>{ve.current&&_e(Math.max(200,Math.min(600,e.clientX)))};return window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,ut),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,ut)}},[ut]);let dt=Fe(),ft=dt?dt.path.split(`/`).pop():null;return e.flatMap(e=>e.files),(0,P.useEffect)(()=>{document.title=ft?`${ft} - ColonyNote`:`ColonyNote`},[ft]),(0,P.useEffect)(()=>{let e=e=>{Te.some(e=>Ne(e))&&(e.preventDefault(),e.returnValue=``)};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[Te,Ne]),(0,R.jsxs)(`div`,{className:`flex flex-col h-full`,children:[S&&(0,R.jsxs)(`header`,{className:`flex items-center px-4 py-3 border-b border-border bg-background md:hidden`,children:[(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:()=>a(!0),className:`size-11 min-h-11 min-w-11`,children:(0,R.jsx)(Ie,{className:`size-5`})}),(0,R.jsx)(`div`,{className:`flex-1 text-base font-semibold text-center truncate mx-4`,children:ft||`ColonyNote`}),(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:()=>l(!0),className:`size-11 min-h-11 min-w-11`,children:(0,R.jsx)(qe,{className:`size-5`})}),(0,R.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:at,title:w===`read`?`切换到编辑模式`:`切换到阅读模式`,className:L(`flex items-center justify-center size-9 rounded-lg transition-all duration-150 border`,w===`read`?`bg-primary/10 text-primary border-primary/20 hover:bg-primary/15 hover:text-primary`:`bg-muted text-muted-foreground border-border hover:text-foreground`),children:w===`read`?(0,R.jsx)(he,{className:`size-4`}):(0,R.jsx)(He,{className:`size-4`})}),(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,onClick:ot,title:`源码模式`,className:L(`flex items-center justify-center size-9 rounded-lg transition-all duration-150 border`,w===`source`?`bg-primary text-primary-foreground border-primary shadow-sm hover:bg-primary hover:text-primary-foreground`:`bg-muted text-muted-foreground border-border hover:text-foreground`),children:(0,R.jsx)(Se,{className:`size-4`})})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[S&&(0,R.jsxs)(R.Fragment,{children:[i&&(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/80 animate-fade-in`,onClick:()=>a(!1)}),(0,R.jsx)(`aside`,{className:L(`fixed z-50 inset-0 w-full bg-sidebar p-0 transition-transform duration-150`,i?`translate-x-0`:`-translate-x-full`),children:(0,R.jsx)($9,{groups:e,activePath:dt?.path||null,activeRoot:n,currentDir:E,expandedPaths:O,setExpandedPaths:k,onSelect:Ye,onDelete:et,onRenameRequest:e=>{_(e),d(!0)},onMoveRequest:e=>{y(e),p(!0)},onCopyRequest:e=>{x(e),h(!0)},onExpand:Xe,editingType:ee,onEditingChange:Ze,onCreateSubmit:Qe,onCreateRequest:$e,onSettingsOpen:()=>M(!0),onClose:()=>a(!1),onDirChange:ct,onAddDir:()=>N(!0),onEditDir:()=>{oe(n),ie(!0)},onGitCommitRequest:()=>ce(!0),onToggleTheme:st,themeMode:le})})]}),!S&&(0,R.jsxs)(`div`,{className:`hidden md:flex shrink-0`,children:[(0,R.jsx)(`aside`,{style:{width:ge},className:`flex flex-col border-r border-border bg-sidebar`,children:(0,R.jsx)($9,{groups:e,activePath:dt?.path||null,activeRoot:n,currentDir:E,expandedPaths:O,setExpandedPaths:k,onSelect:Ye,onDelete:et,onRenameRequest:e=>{_(e),d(!0)},onMoveRequest:e=>{y(e),p(!0)},onCopyRequest:e=>{x(e),h(!0)},onExpand:Xe,editingType:ee,onEditingChange:Ze,onCreateSubmit:Qe,onCreateRequest:$e,onSettingsOpen:()=>M(!0),onDirChange:ct,onAddDir:()=>N(!0),onEditDir:()=>{oe(n),ie(!0)},onGitCommitRequest:()=>ce(!0),onToggleTheme:st,themeMode:le})}),(0,R.jsx)(`div`,{onMouseDown:lt,className:`w-4 -ml-2 cursor-col-resize flex items-center justify-center group z-10`,title:`拖动调整侧边栏宽度`,children:(0,R.jsx)(`div`,{className:`w-1 h-8 rounded-full bg-border group-hover:bg-primary/50 transition-colors`})})]}),(0,R.jsxs)(`main`,{className:`flex-1 flex flex-col overflow-hidden`,children:[Te.length>0&&(0,R.jsx)(Yce,{tabOrder:Te,tabs:we,activeTabKey:De,onActivate:e=>{Ke();let t=we.get(e);t&&Oe(t.path,t.rootPath)},onCloseRequest:e=>{Ne(e)?me(e):ke(e)},onTogglePin:Re,onCloseOtherTabs:ze,onCloseRightTabs:Be,onCloseLeftTabs:Ve,onCloseAllTabs:Ue,onCloseGroupTabs:We,onCloseOtherGroupTabs:Ge,isMobile:S,dirs:e.map(e=>e.root),rightContent:!S&&De?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:L(`px-2 py-0.5 rounded`,dt?.status===`saving`&&`text-muted-foreground bg-muted`,dt?.status===`saved`&&`text-primary bg-primary/10`,dt?.status===`error`&&`text-destructive bg-destructive/10`),children:dt?.status===`saving`?`保存中...`:dt?.status===`saved`?`已保存`:dt?.status===`error`?`保存失败`:``}),(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,className:`size-7 min-h-7 min-w-7`,onClick:()=>l(!0),title:`搜索`,children:(0,R.jsx)(qe,{className:`size-3.5`})}),(0,R.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,className:L(`flex items-center justify-center size-6 rounded-md transition-all duration-150 border`,w===`read`?`bg-primary/10 text-primary border-primary/20 hover:bg-primary/15 hover:text-primary`:`bg-muted text-muted-foreground border-border hover:text-foreground`),onClick:at,title:w===`read`?`切换到编辑模式`:`切换到阅读模式`,children:w===`read`?(0,R.jsx)(he,{className:`size-3`}):(0,R.jsx)(He,{className:`size-3`})}),(0,R.jsx)(xr,{variant:`ghost`,size:`icon`,className:L(`flex items-center justify-center size-6 rounded-md transition-all duration-150 border`,w===`source`?`bg-primary text-primary-foreground border-primary shadow-sm hover:bg-primary hover:text-primary-foreground`:`bg-muted text-muted-foreground border-border hover:text-foreground`),onClick:ot,title:`源码模式`,children:(0,R.jsx)(Se,{className:`size-3`})})]})]}):void 0}),(0,R.jsx)(`div`,{className:`flex flex-1 overflow-hidden`,children:De?dt&&(0,R.jsxs)(`div`,{className:`flex flex-col flex-1 min-w-0`,children:[S&&(0,R.jsxs)(`header`,{className:`flex items-center justify-between px-4 py-2 bg-muted/30 border-b border-border text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:w===`wysiwyg`?`所见即所得`:w===`source`?`源码`:`阅读模式`}),(0,R.jsx)(`span`,{className:L(`px-2 py-0.5 rounded text-xs`,dt.status===`saving`&&`text-muted-foreground bg-muted`,dt.status===`saved`&&`text-primary bg-primary/10`),children:dt.status===`saving`?`保存中...`:dt.status===`saved`?`已保存`:``})]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:(0,R.jsx)(noe,{value:dt.content,onChange:e=>Ae(dt.key,e),mode:w,path:dt.path,rootPath:dt.rootPath,scrollPosition:xe.current.get(dt.key)||0,onLinkClick:e=>{Ke(),Oe(e,dt.rootPath)}})})]}):(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-muted-foreground text-sm text-center p-6 flex-1`,children:[(0,R.jsx)(Ee,{className:`size-12 mb-4 opacity-50`}),(0,R.jsx)(`div`,{children:`选择一个文件开始编辑`})]})})]})]}),(0,R.jsx)(Xce,{visible:o,onClose:()=>{s(!1),j(null)},onCreate:it,currentDir:E}),(0,R.jsx)(Qce,{open:c,onOpenChange:l,activeRoot:n,groups:e,onSelect:(e,t)=>{t&&n!==t&&r(t),Ye(e,`file`,t)}}),(0,R.jsx)(ele,{open:u,onOpenChange:d,item:g,onRename:(e,t,n,r)=>{_(null),d(!1),tt(e,t,n,r)}}),(0,R.jsx)(gle,{open:f,onOpenChange:p,item:v,groups:e,onMove:(e,t,n,r)=>{y(null),p(!1),nt(e,t,n,r)}}),(0,R.jsx)(_le,{open:m,onOpenChange:h,item:b,groups:e,onCopy:(e,t,n,r)=>{x(null),h(!1),rt(e,t,n,r)}}),(0,R.jsx)(Zs,{open:pe!==null,onOpenChange:e=>{e||me(null)},children:(0,R.jsxs)(ec,{children:[(0,R.jsxs)(tc,{children:[(0,R.jsx)(rc,{children:`未保存的更改`}),(0,R.jsx)(ic,{children:`此文件有未保存的更改。确定要关闭吗?`})]}),(0,R.jsxs)(nc,{children:[(0,R.jsx)(oc,{onClick:()=>me(null),children:`取消`}),(0,R.jsx)(ac,{onClick:()=>{pe&&(ke(pe),me(null))},children:`直接关闭`}),(0,R.jsx)(ac,{onClick:()=>{pe&&(je(pe),setTimeout(()=>{ke(pe),me(null)},500))},children:`保存并关闭`})]})]})}),(0,R.jsx)(vle,{open:te,onOpenChange:M}),(0,R.jsx)(Tle,{open:ne,onOpenChange:N}),(0,R.jsx)(Ele,{open:re,onOpenChange:ie,dirPath:ae,isCli:e.find(e=>e.root.path===ae)?.root.isCli}),(0,R.jsx)(Dle,{open:se,onOpenChange:ce,rootPath:n||void 0})]})}nt.createRoot(document.getElementById(`root`)).render((0,R.jsx)(P.StrictMode,{children:(0,R.jsx)(Ole,{})}));export{sK as $,KI as $t,vq as A,yR as At,GK as B,OL as Bt,UY as C,ZN as Cn,tV as Ct,Pq as D,Lie as Dt,X as E,JR as Et,cq as F,vR as Ft,PK as G,LL as Gt,HK as H,SL as Ht,Tq as I,gR as It,CK as J,VL as Jt,OK as K,FL as Kt,fq as L,JF as Lt,kq as M,OR as Mt,uq as N,jR as Nt,Nq as O,qR as Ot,Aq as P,_R as Pt,cK as Q,oL as Qt,Dq as R,gL as Rt,KY as S,G as Sn,ZB as St,Rq as T,YR as Tt,VK as U,Vne as Ut,UK as V,yL as Vt,FK as W,wI as Wt,fK as X,qI as Xt,pK as Y,zL as Yt,dK as Z,rI as Zt,WQ as _,gP as _n,eV as _t,x$ as a,IL as an,JG as at,cX as b,eP as bn,$B as bt,u$ as c,RL as cn,rH as ct,n$ as d,LF as dn,GB as dt,hL as en,oK as et,OX as f,NF as fn,nV as ft,zQ as g,yP as gn,QB as gt,VQ as h,bP as hn,qB as ht,h1 as i,eL as in,UG as it,Eq as j,NR as jt,_q as k,GR as kt,e$ as l,CL as ln,hV as lt,DX as m,K as mn,KB as mt,M1 as n,lL as nn,$G as nt,b$ as o,PL as on,VG as ot,UQ as p,q as pn,rV as pt,wK as q,RI as qt,v1 as r,vL as rn,XG as rt,QQ as s,Bne as sn,HG as st,I1 as t,JI as tn,aK as tt,g$ as u,UL as un,cV as ut,HQ as v,mP as vn,JB as vt,BY as w,QR as wt,pX as x,W as xn,XB as xt,Q as y,aP as yn,YB as yt,hq as z,NL as zt};