@strapi/design-system 2.1.1 → 2.2.0
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.
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/Select/MultiSelect.d.ts +2 -2
- package/dist/components/Select/MultiSelect.d.ts.map +1 -1
- package/dist/components/Select/SelectParts.d.ts +5 -0
- package/dist/components/Select/SelectParts.d.ts.map +1 -1
- package/dist/components/Select/SingleSelect.d.ts +2 -2
- package/dist/components/Select/SingleSelect.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +213 -213
- package/dist/index.mjs +1902 -1879
- package/dist/primitives/Box/Box.d.ts +239 -6
- package/dist/primitives/Box/Box.d.ts.map +1 -1
- package/dist/styles/type.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("styled-components"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("styled-components"),xe=require("react"),po=require("@radix-ui/react-use-callback-ref"),J=require("@internationalized/date"),d=require("react/jsx-runtime"),mo=require("@radix-ui/react-tooltip"),ah=require("@radix-ui/react-dismissable-layer"),E=require("@strapi/ui-primitives"),hh=require("@radix-ui/react-accordion"),z=require("@strapi/icons"),ch=require("@radix-ui/react-avatar"),dh=require("@radix-ui/react-dropdown-menu"),uh=require("@radix-ui/react-checkbox"),bo=require("react-dom"),fh=require("@radix-ui/react-scroll-area"),gh=require("@radix-ui/react-alert-dialog"),Zt=require("@floating-ui/react-dom"),ph=require("@radix-ui/react-focus-guards"),mh=require("@radix-ui/react-focus-scope"),bh=require("react-remove-scroll"),Zr=require("@codemirror/lang-json"),xh=require("@uiw/react-codemirror"),yh=require("@radix-ui/react-dialog"),es=require("@internationalized/number"),wh=require("@radix-ui/react-popover"),vh=require("@radix-ui/react-progress"),Sh=require("@radix-ui/react-radio-group"),Ch=require("@radix-ui/react-switch"),kh=require("@radix-ui/react-tabs"),Di=require("lodash");function Se(i){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const t in i)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>i[t]})}}return e.default=i,Object.freeze(e)}const b=Se(xe),lt=Se(mo),$h=Se(ah),wi=Se(hh),br=Se(ch),Be=Se(dh),xo=Se(uh),on=Se(fh),it=Se(gh),kt=Se(yh),_t=Se(wh),yo=Se(vh),xr=Se(Sh),wo=Se(Ch),ln=Se(kh),Kt=(i,e)=>{const t=b.createContext(e),n=s=>{const{children:o,...l}=s,a=b.useMemo(()=>l,Object.values(l));return d.jsx(t.Provider,{value:a,children:o})};function r(s){const o=b.useContext(t);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${i}\``)}return n.displayName=`${i}Provider`,[n,r]};function Th(i,e){return typeof i=="string"?!1:e in i}function Mi(i){return i&&typeof i=="object"&&!Array.isArray(i)}function oi(i,e,t){return i&&e&&Th(i,e)?i[e]:t}const ts={padding:["padding-block-start","padding-inline-end","padding-block-end","padding-inline-start"],paddingTop:"padding-block-start",paddingRight:"padding-inline-end",paddingBottom:"padding-block-end",paddingLeft:"padding-inline-start",margin:["margin-block-start","margin-inline-end","margin-block-end","margin-inline-start"],marginLeft:"margin-inline-start",marginRight:"margin-inline-end",marginTop:"margin-block-start",marginBottom:"margin-block-end",borderRadius:"border-radius",borderStyle:"border-style",borderWidth:"border-width",borderColor:"border-color",fontSize:"font-size",fontWeight:"font-weight",lineHeight:"line-height",zIndex:"z-index",boxShadow:"box-shadow",pointerEvents:"pointer-events",textAlign:"text-align",textTransform:"text-transform",textDecoration:"text-decoration",flexGrow:"flex-grow",flexShrink:"flex-shrink",flexBasis:"flex-basis",minWidth:"min-width",maxWidth:"max-width",minHeight:"min-height",maxHeight:"max-height",order:"order",flexDirection:"flex-direction",flexWrap:"flex-wrap",justifyContent:"justify-content",alignItems:"align-items"},Ah=i=>{const[e,t,n,r]=i,s=t??e;return[e,s,n??e,r??s]};function Rh(i,e){switch(i){case"gap":case"padding":case"margin":case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":case"marginTop":case"marginLeft":case"marginRight":case"marginBottom":case"left":case"right":case"top":case"bottom":case"width":case"maxWidth":case"minWidth":case"height":case"maxHeight":case"minHeight":case"borderRadius":case"borderWidth":return e.spaces;case"color":case"background":case"borderColor":return e.colors;case"fontSize":return e.fontSizes;case"fontWeight":return e.fontWeights;case"lineHeight":return e.lineHeights;case"zIndex":return e.zIndices;case"boxShadow":return e.shadows;default:return null}}const xt=(i,e)=>{const t=Object.entries(i).reduce((n,r)=>{const[s,o]=r,l=Rh(s,e),a=Object.prototype.hasOwnProperty.call(ts,s)?ts[s]:s;return a&&(o||o===0)&&(typeof o=="object"&&!Array.isArray(o)?Object.entries(o).forEach(([c,h])=>{n[c]={...n[c],...is(a,h,l)}}):n.initial={...n.initial,...is(a,o,l)}),n},{initial:{},small:{},medium:{},large:{}});return Object.entries(t).reduce((n,[r,s])=>{if(s&&Object.keys(s).length>0){const o=Object.entries(s).reduce((l,[a,c])=>(l.push(`${a}: ${c};`),l),[]).join(`
|
|
2
2
|
`);r==="initial"?n.push(o):n.push(`${e.breakpoints[r]}{ ${o} }`)}return n},[]).join(`
|
|
3
|
-
`)},
|
|
4
|
-
${({theme:i,...e})=>
|
|
5
|
-
`,T=
|
|
6
|
-
${({theme:i,$display:e="flex",$alignItems:t="center",$direction:n="row",...r})=>
|
|
7
|
-
`,Oh="alpha",jh="beta",Eh="delta",Ih="epsilon",
|
|
3
|
+
`)},is=(i,e,t)=>{if(Array.isArray(i)&&Array.isArray(e)){const n=Ah(e);return i.reduce((r,s,o)=>(r[s]=oi(t,n[o],n[o]),r),{})}else return Array.isArray(i)&&!Array.isArray(e)?i.reduce((n,r)=>(n[r]=oi(t,e,e),n),{}):!Array.isArray(i)&&!Array.isArray(e)?{[i]:oi(t,e,e)}:(console.warn("You've passed an array of values to a property that does not support it. Please check the property and value you're passing."),{})},A=b.forwardRef(({animation:i,background:e,basis:t,borderColor:n,borderRadius:r,borderStyle:s,borderWidth:o,bottom:l,color:a,cursor:c,display:h,flex:u,fontSize:f,fontWeight:g,grow:p,hasRadius:x,height:w,left:y,lineHeight:v,margin:k,marginBottom:S,marginLeft:$,marginRight:C,marginTop:R,maxHeight:L,maxWidth:I,minHeight:P,minWidth:ne,order:_,overflow:K,padding:Q,paddingBottom:F,paddingLeft:ae,paddingRight:B,paddingTop:H,pointerEvents:me,position:oe,right:Te,shadow:he,shrink:be,tag:Z,textAlign:ce,textTransform:Fe,top:ht,transform:ct,transition:Ue,width:Tt,zIndex:dt,...Xt},Jt)=>{const ut=Z||"div",ee={$animation:i,$background:e,$basis:t,$borderColor:n,$borderRadius:r,$borderStyle:s,$borderWidth:o,$bottom:l,$color:a,$cursor:c,$display:h,$flex:u,$fontSize:f,$fontWeight:g,$grow:p,$hasRadius:x,$height:w,$left:y,$lineHeight:v,$margin:k,$marginBottom:S,$marginLeft:$,$marginRight:C,$marginTop:R,$maxHeight:L,$maxWidth:I,$minHeight:P,$minWidth:ne,$order:_,$overflow:K,$padding:Q,$paddingBottom:F,$paddingLeft:ae,$paddingRight:B,$paddingTop:H,$pointerEvents:me,$position:oe,$right:Te,$shadow:he,$shrink:be,$textAlign:ce,$textTransform:Fe,$top:ht,$transform:ct,$transition:Ue,$width:Tt,$zIndex:dt};return d.jsx(Dh,{as:ut,ref:Jt,...ee,...Xt})}),Dh=m.styled.div`
|
|
4
|
+
${({theme:i,...e})=>xt({animation:e.$animation,background:e.$background,borderColor:e.$borderColor,borderRadius:e.$hasRadius?i.borderRadius:e.$borderRadius,borderStyle:e.$borderColor&&!e.$borderStyle?"solid":e.$borderStyle,borderWidth:e.$borderColor&&!e.$borderWidth?"1px":e.$borderWidth,bottom:e.$bottom,boxShadow:e.$shadow,color:e.$color,cursor:e.$cursor,display:e.$display,flex:e.$flex,flexBasis:e.$basis,flexGrow:e.$grow,flexShrink:e.$shrink,fontSize:e.$fontSize,fontWeight:e.$fontWeight,height:e.$height,left:e.$left,lineHeight:e.$lineHeight,margin:e.$margin,marginBottom:e.$marginBottom,marginLeft:e.$marginLeft,marginRight:e.$marginRight,marginTop:e.$marginTop,maxHeight:e.$maxHeight,maxWidth:e.$maxWidth,minHeight:e.$minHeight,minWidth:e.$minWidth,order:e.$order,overflow:e.$overflow,padding:e.$padding,paddingBottom:e.$paddingBottom,paddingLeft:e.$paddingLeft,paddingRight:e.$paddingRight,paddingTop:e.$paddingTop,pointerEvents:e.$pointerEvents,position:e.$position,right:e.$right,textAlign:e.$textAlign,textTransform:e.$textTransform,top:e.$top,transform:e.$transform,transition:e.$transition,width:e.$width,zIndex:e.$zIndex},i)};
|
|
5
|
+
`,Ae=b.forwardRef,T=Ae((i,e)=>{const{className:t,alignItems:n,direction:r,inline:s,gap:o,justifyContent:l,wrap:a,...c}=i,h={$alignItems:n,$direction:r,$gap:o,$justifyContent:l,$wrap:a,$inline:s};return d.jsx(Mh,{className:t,ref:e,...h,...c})}),Mh=m.styled(A)`
|
|
6
|
+
${({theme:i,$display:e="flex",$alignItems:t="center",$direction:n="row",...r})=>xt({gap:r.$gap,alignItems:t,justifyContent:r.$justifyContent,flexWrap:r.$wrap,flexDirection:n,display:r.$inline?"inline-flex":e},i)};
|
|
7
|
+
`,Oh="alpha",jh="beta",Eh="delta",Ih="epsilon",ns="omega",Ph="pi",Lh="sigma",vo=m.css`
|
|
8
8
|
display: block;
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
overflow: hidden;
|
|
11
11
|
text-overflow: ellipsis;
|
|
12
|
-
`,Bh=({$variant:i=
|
|
12
|
+
`,Bh=({$variant:i=ns,theme:e,$fontSize:t,$lineHeight:n})=>{const r=t&&xt({fontSize:t},e),s=n&&xt({lineHeight:n},e);switch(i){case Oh:return m.css`
|
|
13
13
|
font-weight: ${e.fontWeights.bold};
|
|
14
14
|
|
|
15
15
|
/* -------------------------------------------------------------
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
line-height: ${e.lineHeights[6]};
|
|
115
115
|
}
|
|
116
116
|
`}
|
|
117
|
-
`;case
|
|
117
|
+
`;case ns:return m.css`
|
|
118
118
|
/* -------------------------------------------------------------
|
|
119
119
|
* Font Size
|
|
120
120
|
* -------------------------------------------------------------*/
|
|
@@ -188,12 +188,12 @@
|
|
|
188
188
|
font-size: ${e.fontSizes[2]};
|
|
189
189
|
}
|
|
190
190
|
`}
|
|
191
|
-
`}},O=
|
|
191
|
+
`}},O=Ae((i,e)=>{const{ellipsis:t,textColor:n="currentcolor",textDecoration:r,textTransform:s,variant:o,lineHeight:l,fontWeight:a,fontSize:c,...h}=i,u={$ellipsis:t,$textColor:n,$textDecoration:r,$textTransform:s,$variant:o,$lineHeight:l,$fontWeight:a,$fontSize:c};return d.jsx(zh,{ref:e,tag:"span",...u,...h})}),zh=m.styled(A)`
|
|
192
192
|
${({$variant:i,$fontSize:e,$lineHeight:t,theme:n})=>Bh({$variant:i,theme:n,$fontSize:e,$lineHeight:t})}
|
|
193
|
-
${({$ellipsis:i})=>i?
|
|
193
|
+
${({$ellipsis:i})=>i?vo:""}
|
|
194
194
|
|
|
195
|
-
${({theme:i,...e})=>
|
|
196
|
-
`,[Nh,
|
|
195
|
+
${({theme:i,...e})=>xt({color:e.$textColor,textDecoration:e.$textDecoration,textTransform:e.$textTransform,lineHeight:e.$lineHeight,fontWeight:e.$fontWeight,fontSize:e.$fontSize},i)}
|
|
196
|
+
`,[Nh,yr]=Kt("Accordion"),Fh=b.forwardRef(({children:i,size:e="S",...t},n)=>d.jsx(Wh,{ref:n,$size:e,collapsible:!0,...t,type:"single",children:d.jsx(Nh,{size:e,children:i})})),Wh=m.styled(wi.Root)`
|
|
197
197
|
background-color: ${i=>i.theme.colors.neutral0};
|
|
198
198
|
|
|
199
199
|
${i=>i.$size==="S"?m.css`
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
`:m.css`
|
|
203
203
|
|
|
204
204
|
`}
|
|
205
|
-
`,Hh=b.forwardRef((i,e)=>{const{size:t}=
|
|
205
|
+
`,Hh=b.forwardRef((i,e)=>{const{size:t}=yr("Item");return d.jsx(Vh,{$size:t,"data-size":t,ref:e,...i})}),Vh=m.styled(wi.Item)`
|
|
206
206
|
overflow: hidden;
|
|
207
207
|
margin: 1px 0;
|
|
208
208
|
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
transition: box-shadow ${i=>i.theme.motion.timings[120]}
|
|
244
244
|
${i=>i.theme.motion.easings.easeOutQuad};
|
|
245
245
|
}
|
|
246
|
-
`,qh=b.forwardRef(({caretPosition:i="left",description:e,icon:t,iconProps:n,children:r,...s},o)=>{const{size:l}=
|
|
246
|
+
`,qh=b.forwardRef(({caretPosition:i="left",description:e,icon:t,iconProps:n,children:r,...s},o)=>{const{size:l}=yr("Trigger");return d.jsxs(Co,{$caretPosition:i,$size:l,ref:o,...s,children:[i==="left"?d.jsx(Gi,{$size:l,children:d.jsx(z.CaretDown,{width:l==="S"?"1.2rem":"1.6rem",height:l==="S"?"1.2rem":"1.6rem"})}):null,d.jsxs(T,{tag:"span",gap:2,overflow:"hidden",children:[t&&l==="S"?d.jsx(So,{children:d.jsx(t,{...n})}):null,d.jsxs(T,{alignItems:"flex-start",direction:"column",tag:"span",ref:o,overflow:"hidden",children:[d.jsx(O,{fontWeight:l==="S"?"bold":void 0,ellipsis:!0,variant:l==="M"?"delta":void 0,textAlign:"left",width:"100%",children:r}),e&&l==="M"?d.jsx(O,{textAlign:"left",children:e}):null]})]}),i==="right"?d.jsx(Gi,{$size:l,children:d.jsx(z.CaretDown,{width:l==="S"?"1.2rem":"1.6rem",height:l==="S"?"1.2rem":"1.6rem"})}):null]})}),So=m.styled(A)`
|
|
247
247
|
color: ${i=>i.theme.colors.neutral500};
|
|
248
248
|
display: flex;
|
|
249
249
|
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
transform ${i=>i.theme.motion.timings[200]} ${i=>i.theme.motion.easings.authenticMotion},
|
|
264
264
|
${i=>i.theme.transitions.backgroundColor};
|
|
265
265
|
}
|
|
266
|
-
`,
|
|
266
|
+
`,Co=m.styled(wi.Trigger)`
|
|
267
267
|
display: flex;
|
|
268
268
|
align-items: center;
|
|
269
269
|
justify-content: ${i=>i.$caretPosition==="left"?"flex-start":"space-between"};
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
@media (prefers-reduced-motion: no-preference) {
|
|
293
293
|
transition: ${i=>i.theme.transitions.color};
|
|
294
294
|
}
|
|
295
|
-
`,_h=b.forwardRef((i,e)=>{const{size:t}=
|
|
295
|
+
`,_h=b.forwardRef((i,e)=>{const{size:t}=yr("Trigger");return d.jsx(ko,{$size:t,...i,ref:e})}),ko=m.styled(T).attrs(i=>({...i,tag:"span"}))`
|
|
296
296
|
padding-inline: ${i=>i.$size==="S"?i.theme.spaces[2]:i.theme.spaces[6]};
|
|
297
297
|
padding-block: ${i=>i.$size==="S"?i.theme.spaces[2]:i.theme.spaces[6]};
|
|
298
298
|
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
transition: ${i=>i.theme.transitions.color};
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
`,Kh=b.forwardRef(({variant:i="primary",...e},t)=>d.jsx(Uh,{$variant:i,ref:t,...e})),Uh=m.styled(
|
|
309
|
+
`,Kh=b.forwardRef(({variant:i="primary",...e},t)=>d.jsx(Uh,{$variant:i,ref:t,...e})),Uh=m.styled(wi.Header)`
|
|
310
310
|
display: flex;
|
|
311
311
|
align-items: center;
|
|
312
312
|
background-color: ${i=>i.$variant==="primary"?i.theme.colors.neutral0:i.theme.colors.neutral100};
|
|
@@ -320,10 +320,10 @@
|
|
|
320
320
|
&[data-state='open'] {
|
|
321
321
|
background-color: ${i=>i.theme.colors.primary100};
|
|
322
322
|
|
|
323
|
-
& > ${
|
|
323
|
+
& > ${Co} {
|
|
324
324
|
color: ${i=>i.theme.colors.primary600};
|
|
325
325
|
|
|
326
|
-
& ${
|
|
326
|
+
& ${So} {
|
|
327
327
|
color: ${i=>i.theme.colors.primary600};
|
|
328
328
|
}
|
|
329
329
|
|
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
& > ${
|
|
335
|
+
& > ${ko} > button {
|
|
336
336
|
color: ${i=>i.theme.colors.primary600};
|
|
337
337
|
}
|
|
338
338
|
}
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
to {
|
|
356
356
|
height: 0;
|
|
357
357
|
}
|
|
358
|
-
`,Jh=m.styled(
|
|
358
|
+
`,Jh=m.styled(wi.Content)`
|
|
359
359
|
overflow: hidden;
|
|
360
360
|
|
|
361
361
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
${i=>i.theme.motion.easings.authenticMotion};
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
`,Qh=Object.freeze(Object.defineProperty({__proto__:null,Actions:_h,Content:Gh,Header:Kh,Item:Hh,Root:Fh,Trigger:qh},Symbol.toStringTag,{value:"Module"})),
|
|
372
|
+
`,Qh=Object.freeze(Object.defineProperty({__proto__:null,Actions:_h,Content:Gh,Header:Kh,Item:Hh,Root:Fh,Trigger:qh},Symbol.toStringTag,{value:"Module"})),an=m.css`
|
|
373
373
|
position: relative;
|
|
374
374
|
outline: none;
|
|
375
375
|
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
border: 2px solid ${i=>i.theme.colors.primary600};
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
|
-
`,
|
|
403
|
+
`,nt=({tag:i,...e})=>{const t=i||"span";return d.jsx(Zh,{...e,as:t})},Zh=m.styled.span`
|
|
404
404
|
border: 0;
|
|
405
405
|
clip: rect(0 0 0 0);
|
|
406
406
|
height: 1px;
|
|
@@ -409,26 +409,26 @@
|
|
|
409
409
|
padding: 0;
|
|
410
410
|
position: absolute;
|
|
411
411
|
width: 1px;
|
|
412
|
-
`,
|
|
413
|
-
${
|
|
412
|
+
`,yt=({children:i,label:e})=>{const t=b.Children.only(i);return d.jsxs(d.Fragment,{children:[b.cloneElement(t,{"aria-hidden":"true",focusable:"false"}),d.jsx(nt,{children:e})]})};yt.displayName="AccessibleIcon";const $o=i=>{switch(i){case"danger":return"danger100";case"success":return"success100";case"warning":return"warning100";default:return"primary100"}},ec=i=>$o(i).replace("100","200"),jn=({theme:i,$variant:e})=>e==="danger"?i.colors.danger700:e==="success"?i.colors.success700:e==="warning"?i.colors.warning700:i.colors.primary700,tc=m.styled(A)`
|
|
413
|
+
${an};
|
|
414
414
|
`,ic=m.styled(T)`
|
|
415
415
|
svg {
|
|
416
416
|
height: 100%;
|
|
417
417
|
width: 100%;
|
|
418
418
|
|
|
419
419
|
path {
|
|
420
|
-
fill: ${
|
|
420
|
+
fill: ${jn};
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
`,nc=({variant:i,...e})=>i==="success"?d.jsx(
|
|
423
|
+
`,nc=({variant:i,...e})=>i==="success"?d.jsx(z.CheckCircle,{...e}):i==="danger"||i==="warning"?d.jsx(z.WarningCircle,{...e}):d.jsx(z.Information,{...e}),rc=m.styled(A)`
|
|
424
424
|
& a > span {
|
|
425
|
-
color: ${
|
|
425
|
+
color: ${jn};
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
svg path {
|
|
429
|
-
fill: ${
|
|
429
|
+
fill: ${jn};
|
|
430
430
|
}
|
|
431
|
-
`,sc=({title:i,children:e,variant:t="default",onClose:n,closeLabel:r,titleAs:s="p",action:o,...l})=>d.jsxs(T,{alignItems:"flex-start",background
|
|
431
|
+
`,sc=({title:i,children:e,variant:t="default",onClose:n,closeLabel:r,titleAs:s="p",action:o,...l})=>d.jsxs(T,{alignItems:"flex-start",background:$o(t),borderColor:ec(t),shadow:"filterShadow",gap:3,hasRadius:!0,padding:5,paddingRight:6,...l,children:[d.jsx(ic,{height:"2rem",shrink:0,$variant:t,width:"2rem",children:d.jsx(nc,{"aria-hidden":!0,variant:t})}),d.jsxs(T,{alignItems:"start",gap:o?2:1,wrap:"wrap",role:t==="danger"?"alert":"status",width:"100%",children:[i&&d.jsx(O,{fontWeight:"bold",textColor:"neutral800",tag:s,children:i}),d.jsx(O,{tag:"p",textColor:"neutral800",children:e}),o&&d.jsx(rc,{$variant:t,children:o})]}),d.jsx(tc,{tag:"button",background:"transparent",borderColor:void 0,height:"1.6rem",width:"1.6rem",marginTop:1,onClick:n,color:"neutral700",children:d.jsx(yt,{label:r,children:d.jsx(z.Cross,{})})})]});function Pe({prop:i,defaultProp:e,onChange:t=()=>{}}){const[n,r]=wr({defaultProp:e,onChange:t}),s=i!==void 0,o=s?i:n,l=po.useCallbackRef(t),a=b.useCallback(c=>{if(s){const u=typeof c=="function"?c(i):c;u!==i&&l(u)}else r(c)},[s,i,r,l]);return[o,a]}function wr({defaultProp:i,onChange:e}){const t=b.useState(i),[n]=t,r=b.useRef(n),s=po.useCallbackRef(e);return b.useEffect(()=>{r.current!==n&&(s(n),r.current=n)},[n,r,s]),t}const En={easeInSine:"cubic-bezier(0.47, 0, 0.745, 0.715)",easeOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInOutSine:"cubic-bezier(0.39, 0.575, 0.565, 1)",easeInQuad:"cubic-bezier(0.55, 0.085, 0.68, 0.53)",easeOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInOutQuad:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",easeInCubic:"cubic-bezier(0.55, 0.055, 0.675, 0.19)",easeOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInOutCubic:"cubic-bezier(0.215, 0.61, 0.355, 1)",easeInQuart:"cubic-bezier(0.895, 0.03, 0.685, 0.22)",easeOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInOutQuart:"cubic-bezier(0.165, 0.84, 0.44, 1)",easeInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",easeOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",easeInExpo:"cubic-bezier(0.95, 0.05, 0.795, 0.035)",easeOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInOutExpo:"cubic-bezier(0.19, 1, 0.22, 1)",easeInCirc:"cubic-bezier(0.6, 0.04, 0.98, 0.335)",easeOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInOutCirc:"cubic-bezier(0.075, 0.82, 0.165, 1)",easeInBack:"cubic-bezier(0.6, -0.28, 0.735, 0.045)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",easeInOutBack:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",easeInOutFast:"cubic-bezier(1,0,0,1)",authenticMotion:"cubic-bezier(.4,0,.2,1)"},In={320:"320ms",200:"200ms",120:"120ms"},oc={color:`color ${In[120]} ${En.easeOutQuad}`,backgroundColor:`background-color ${In[120]} ${En.easeOutQuad}`},ie={overlayFadeIn:m.keyframes`
|
|
432
432
|
from {
|
|
433
433
|
opacity: 0;
|
|
434
434
|
}
|
|
@@ -521,7 +521,7 @@
|
|
|
521
521
|
to {
|
|
522
522
|
opacity: 0;
|
|
523
523
|
}
|
|
524
|
-
`},
|
|
524
|
+
`},ui=32,rs=2,lc=b.forwardRef(({onLoadingStatusChange:i,delayMs:e=600,src:t,alt:n,fallback:r,preview:s=!1,...o},l)=>{const[a,c]=Pe({onChange:i}),[h,u]=b.useState(!1),f=s&&a==="loaded",g=p=>{f&&u(p)};return d.jsxs(lt.Root,{onOpenChange:g,children:[d.jsx(lt.Trigger,{asChild:!0,children:d.jsxs(Pn,{ref:l,...o,children:[f?d.jsx(ac,{width:"100%",height:"100%",position:"absolute",background:"neutral0",zIndex:"overlay",style:{opacity:h?.4:0}}):null,d.jsx(hc,{src:t,alt:n,onLoadingStatusChange:c}),d.jsx(br.Fallback,{delayMs:e,children:d.jsx(O,{fontWeight:"bold",textTransform:"uppercase",children:r})})]})}),f?d.jsx(lt.Portal,{children:d.jsx(cc,{side:"top",sideOffset:4,children:d.jsx(dc,{src:t,alt:n})})}):null]})}),To=m.css`
|
|
525
525
|
display: inline-flex;
|
|
526
526
|
align-items: center;
|
|
527
527
|
justify-content: center;
|
|
@@ -530,17 +530,17 @@
|
|
|
530
530
|
user-select: none;
|
|
531
531
|
overflow: hidden;
|
|
532
532
|
border-radius: 50%;
|
|
533
|
-
|
|
533
|
+
`,Ao=m.css`
|
|
534
534
|
width: 100%;
|
|
535
535
|
height: 100%;
|
|
536
536
|
object-fit: cover;
|
|
537
537
|
border-radius: inherit;
|
|
538
|
-
`,
|
|
538
|
+
`,Pn=m.styled(br.Root)`
|
|
539
539
|
position: relative;
|
|
540
540
|
z-index: 0;
|
|
541
|
-
${
|
|
542
|
-
width: ${
|
|
543
|
-
height: ${
|
|
541
|
+
${To}
|
|
542
|
+
width: ${ui/10}rem;
|
|
543
|
+
height: ${ui/10}rem;
|
|
544
544
|
/* TODO: we should get the user email & hash it to turn it into a hex-value so different emails can consistently get a different background */
|
|
545
545
|
background-color: ${i=>i.theme.colors.primary600};
|
|
546
546
|
color: ${i=>i.theme.colors.neutral0};
|
|
@@ -549,24 +549,24 @@
|
|
|
549
549
|
transition: opacity ${i=>i.theme.motion.timings[200]}
|
|
550
550
|
${i=>i.theme.motion.easings.authenticMotion};
|
|
551
551
|
}
|
|
552
|
-
`,hc=m.styled(
|
|
553
|
-
${
|
|
552
|
+
`,hc=m.styled(br.Image)`
|
|
553
|
+
${Ao}
|
|
554
554
|
`,cc=m.styled(lt.Content)`
|
|
555
|
-
${
|
|
556
|
-
width: ${
|
|
557
|
-
height: ${
|
|
555
|
+
${To}
|
|
556
|
+
width: ${ui*rs/10}rem;
|
|
557
|
+
height: ${ui*rs/10}rem;
|
|
558
558
|
|
|
559
559
|
@media (prefers-reduced-motion: no-preference) {
|
|
560
560
|
animation: ${ie.fadeIn} ${i=>i.theme.motion.timings[200]}
|
|
561
561
|
${i=>i.theme.motion.easings.authenticMotion};
|
|
562
562
|
}
|
|
563
563
|
`,dc=m.styled.img`
|
|
564
|
-
${
|
|
564
|
+
${Ao}
|
|
565
565
|
`,uc=b.forwardRef((i,e)=>d.jsx(fc,{...i,ref:e,tag:"div"})),fc=m.styled(T)`
|
|
566
|
-
& > ${
|
|
567
|
-
margin-left: -${
|
|
566
|
+
& > ${Pn} + ${Pn} {
|
|
567
|
+
margin-left: -${ui/10/2}rem;
|
|
568
568
|
}
|
|
569
|
-
`,gc=Object.freeze(Object.defineProperty({__proto__:null,Group:uc,Item:lc},Symbol.toStringTag,{value:"Module"})),
|
|
569
|
+
`,gc=Object.freeze(Object.defineProperty({__proto__:null,Group:uc,Item:lc},Symbol.toStringTag,{value:"Module"})),vr=({active:i=!1,size:e="M",textColor:t="neutral600",backgroundColor:n="neutral150",variant:r,children:s,minWidth:o=5,...l})=>{const a=e==="S"?1:2,c=r?{backgroundColor:`${r}200`,textColor:`${r}700`}:{backgroundColor:n,textColor:t};return d.jsx(pc,{inline:!0,alignItems:"center",justifyContent:"center",minWidth:o,paddingLeft:a,paddingRight:a,background:i?"primary200":c.backgroundColor,$size:e,...l,children:d.jsx(O,{variant:"sigma",textColor:i?"primary600":c.textColor,lineHeight:"1rem",children:s})})},pc=m.styled(T)`
|
|
570
570
|
border-radius: ${({theme:i,$size:e})=>e==="S"?"2px":i.borderRadius};
|
|
571
571
|
${({$size:i,theme:e})=>i==="S"?m.css`
|
|
572
572
|
padding-block: 0.3rem;
|
|
@@ -581,7 +581,7 @@
|
|
|
581
581
|
&:visited {
|
|
582
582
|
color: inherit;
|
|
583
583
|
}
|
|
584
|
-
`,Ut=
|
|
584
|
+
`,Ut=Ae(({href:i,disabled:e=!1,isExternal:t=!1,...n},r)=>d.jsx(mc,{tag:"a",ref:r,target:t?"_blank":void 0,rel:t?"noreferrer noopener":void 0,href:i,tabIndex:e?-1:void 0,"aria-disabled":e,pointerEvents:e?"none":void 0,cursor:e?void 0:"pointer",...n})),Ro=()=>d.jsx(A,{"aria-hidden":!0,paddingLeft:1,paddingRight:1,children:d.jsx(O,{variant:"pi",textColor:"neutral500",children:"/"})});Ro.displayName="Divider";const bc=m.styled(T)`
|
|
585
585
|
// CrumbLinks do have padding-x, because they need to have a
|
|
586
586
|
// interaction effect, which mis-aligns the breadcrumbs on the left.
|
|
587
587
|
// This normalizes the behavior by moving the first item to left by
|
|
@@ -589,7 +589,7 @@
|
|
|
589
589
|
& > *:first-child {
|
|
590
590
|
margin-left: ${({theme:i})=>`calc(-1*${i.spaces[2]})`};
|
|
591
591
|
}
|
|
592
|
-
`,
|
|
592
|
+
`,Do=b.forwardRef(({label:i,children:e,...t},n)=>{const r=b.Children.toArray(e);return d.jsx(A,{"aria-label":i,tag:"nav",...t,ref:n,children:d.jsx(bc,{tag:"ol",children:b.Children.map(r,(s,o)=>{const l=r.length>1&&o+1<r.length;return d.jsxs(T,{inline:!0,tag:"li",children:[s,l&&d.jsx(Ro,{})]})})})})});Do.displayName="Breadcrumbs";const Mo=b.forwardRef(({children:i,isCurrent:e=!1,...t},n)=>d.jsx(A,{paddingLeft:2,paddingRight:2,paddingTop:1,paddingBottom:1,ref:n,children:d.jsx(O,{variant:"pi",textColor:"neutral800",fontWeight:e?"bold":"regular","aria-current":e,...t,children:i})}));Mo.displayName="Crumb";const xc=m.styled(Ut)`
|
|
593
593
|
border-radius: ${({theme:i})=>i.borderRadius};
|
|
594
594
|
color: ${({theme:i})=>i.colors.neutral600};
|
|
595
595
|
font-size: ${({theme:i})=>i.fontSizes[1]};
|
|
@@ -602,41 +602,41 @@
|
|
|
602
602
|
background-color: ${({theme:i})=>i.colors.neutral200};
|
|
603
603
|
color: ${({theme:i})=>i.colors.neutral700};
|
|
604
604
|
}
|
|
605
|
-
`,
|
|
605
|
+
`,Oo=b.forwardRef(({children:i,...e},t)=>d.jsx(xc,{ref:t,...e,children:i}));Oo.displayName="CrumbLink";const Lt=i=>i.replaceAll(":","");function yc(i,e){typeof i=="function"?i(e):i!=null&&(i.current=e)}function Sr(...i){return e=>i.forEach(t=>yc(t,e))}function Ce(...i){return b.useCallback(Sr(...i),i)}const jo=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Le=jo()?xe.useEffect:xe.useLayoutEffect,wc=b.useId||(()=>{});let vc=0;const ke=i=>{const[e,t]=b.useState(wc());return Le(()=>{i||t(n=>n??String(vc++))},[i]),(i==null?void 0:i.toString())??(e||"")},vi=(i,e,{selectorToWatch:t,skipWhen:n=!1})=>{const r=E.useCallbackRef(e);b.useEffect(()=>{if(n||!i.current)return;const s={root:i.current,rootMargin:"0px"},o=c=>{c.forEach(h=>{h.isIntersecting&&i.current&&i.current.scrollHeight>i.current.clientHeight&&r(h)})},l=new IntersectionObserver(o,s),a=i.current.querySelector(t);return a&&l.observe(a),()=>{l.disconnect()}},[n,r,t,i])},Cr="success-light",kr="danger-light",hn="default",Si="tertiary",Ci="secondary",Eo="danger",Io="success",cn="ghost",$r=[Cr,kr],Sc=[hn,Si,Ci,Eo,Io,cn,...$r],Cc=["XS","S","M","L"],Ie=i=>i===Cr||i===kr?`${i.substring(0,i.lastIndexOf("-"))}`:i===Si?"neutral":i===hn||i===Ci||Sc.every(e=>e!==i)?"primary":`${i}`,Po=({theme:i})=>m.css`
|
|
606
606
|
border: 1px solid ${i.colors.neutral200};
|
|
607
607
|
background: ${i.colors.neutral150};
|
|
608
608
|
color: ${i.colors.neutral600};
|
|
609
609
|
cursor: default;
|
|
610
|
-
`,
|
|
610
|
+
`,Lo=({theme:i,$variant:e})=>[...$r,Ci].includes(e)?m.css`
|
|
611
611
|
background-color: ${i.colors.neutral0};
|
|
612
|
-
`:e===
|
|
612
|
+
`:e===Si?m.css`
|
|
613
613
|
background-color: ${i.colors.neutral100};
|
|
614
|
-
`:e===
|
|
614
|
+
`:e===cn?m.css`
|
|
615
615
|
background-color: ${i.colors.neutral100};
|
|
616
|
-
`:e===
|
|
616
|
+
`:e===hn?m.css`
|
|
617
617
|
border: 1px solid ${i.colors.buttonPrimary500};
|
|
618
618
|
background: ${i.colors.buttonPrimary500};
|
|
619
619
|
`:m.css`
|
|
620
|
-
border: 1px solid ${i.colors[`${
|
|
621
|
-
background: ${i.colors[`${
|
|
622
|
-
`,
|
|
620
|
+
border: 1px solid ${i.colors[`${Ie(e)}500`]};
|
|
621
|
+
background: ${i.colors[`${Ie(e)}500`]};
|
|
622
|
+
`,Bo=({theme:i,$variant:e})=>[...$r,Ci].includes(e)?m.css`
|
|
623
623
|
background-color: ${i.colors.neutral0};
|
|
624
|
-
border: 1px solid ${i.colors[`${
|
|
625
|
-
color: ${i.colors[`${
|
|
626
|
-
`:e===
|
|
624
|
+
border: 1px solid ${i.colors[`${Ie(e)}600`]};
|
|
625
|
+
color: ${i.colors[`${Ie(e)}600`]};
|
|
626
|
+
`:e===Si||e===cn?m.css`
|
|
627
627
|
background-color: ${i.colors.neutral150};
|
|
628
628
|
`:m.css`
|
|
629
|
-
border: 1px solid ${i.colors[`${
|
|
630
|
-
background: ${i.colors[`${
|
|
631
|
-
`,
|
|
632
|
-
border: 1px solid ${i.colors[`${
|
|
633
|
-
background: ${i.colors[`${
|
|
634
|
-
color: ${i.colors[`${
|
|
635
|
-
`;case
|
|
629
|
+
border: 1px solid ${i.colors[`${Ie(e)}600`]};
|
|
630
|
+
background: ${i.colors[`${Ie(e)}600`]};
|
|
631
|
+
`,zo=({theme:i,$variant:e})=>{switch(e){case kr:case Cr:case Ci:return m.css`
|
|
632
|
+
border: 1px solid ${i.colors[`${Ie(e)}200`]};
|
|
633
|
+
background: ${i.colors[`${Ie(e)}100`]};
|
|
634
|
+
color: ${i.colors[`${Ie(e)}700`]};
|
|
635
|
+
`;case Si:return m.css`
|
|
636
636
|
border: 1px solid ${i.colors.neutral200};
|
|
637
637
|
background: ${i.colors.neutral0};
|
|
638
638
|
color: ${i.colors.neutral800};
|
|
639
|
-
`;case
|
|
639
|
+
`;case cn:return m.css`
|
|
640
640
|
border: 1px solid transparent;
|
|
641
641
|
background: transparent;
|
|
642
642
|
color: ${i.colors.neutral800};
|
|
@@ -644,40 +644,40 @@
|
|
|
644
644
|
svg {
|
|
645
645
|
fill: ${i.colors.neutral500};
|
|
646
646
|
}
|
|
647
|
-
`;case
|
|
648
|
-
border: 1px solid ${i.colors[`${
|
|
649
|
-
background: ${i.colors[`${
|
|
647
|
+
`;case Io:case Eo:return m.css`
|
|
648
|
+
border: 1px solid ${i.colors[`${Ie(e)}600`]};
|
|
649
|
+
background: ${i.colors[`${Ie(e)}600`]};
|
|
650
650
|
color: ${i.colors.neutral0};
|
|
651
651
|
`;default:return m.css`
|
|
652
652
|
border: 1px solid ${i.colors.buttonPrimary600};
|
|
653
653
|
background: ${i.colors.buttonPrimary600};
|
|
654
654
|
color: ${i.colors.buttonNeutral0};
|
|
655
|
-
`}},Yi=
|
|
655
|
+
`}},Yi=Ae(({variant:i=hn,startIcon:e,endIcon:t,disabled:n=!1,children:r,onClick:s,size:o=Cc[1],loading:l=!1,fullWidth:a=!1,type:c="button",...h},u)=>{const f=n||l,g=w=>{!f&&s&&s(w)},p=h.tag??"button",x=p==="button"||p==="input"?c:void 0;return d.jsxs(Tc,{ref:u,"aria-disabled":f,disabled:f,$size:o,$variant:i,tag:"button",onClick:g,hasRadius:!0,gap:2,inline:!0,alignItems:"center",justifyContent:"center",width:a?"100%":void 0,paddingLeft:4,paddingRight:4,cursor:"pointer",type:x,...h,children:[(e||l)&&d.jsx(T,{tag:"span","aria-hidden":!0,children:l?d.jsx($c,{}):e}),d.jsx(O,{variant:o==="S"?"pi":void 0,fontWeight:"bold",children:r}),t&&d.jsx(T,{tag:"span","aria-hidden":!0,children:t})]})}),kc=m.keyframes`
|
|
656
656
|
from {
|
|
657
657
|
transform: rotate(0deg);
|
|
658
658
|
}
|
|
659
659
|
to {
|
|
660
660
|
transform: rotate(359deg);
|
|
661
661
|
}
|
|
662
|
-
`,$c=m.styled(
|
|
662
|
+
`,$c=m.styled(z.Loader)`
|
|
663
663
|
animation: ${kc} 2s infinite linear;
|
|
664
664
|
will-change: transform;
|
|
665
665
|
`,Tc=m.styled(T)`
|
|
666
666
|
${({theme:i,$size:e})=>{const t=i.sizes.button[e];if(typeof t=="string")return`height: ${t};`;const n=[];return Object.entries(t).forEach(([r,s])=>{if(s){if(r==="initial")n.push(`height: ${s};`);else if(r in i.breakpoints){const o=i.breakpoints[r];n.push(`${o} { height: ${s}; }`)}}}),n.join(`
|
|
667
667
|
`)}}
|
|
668
668
|
text-decoration: none;
|
|
669
|
-
${
|
|
669
|
+
${zo}
|
|
670
670
|
|
|
671
671
|
&:hover {
|
|
672
|
-
${
|
|
672
|
+
${Lo}
|
|
673
673
|
}
|
|
674
674
|
|
|
675
675
|
&:active {
|
|
676
|
-
${
|
|
676
|
+
${Bo}
|
|
677
677
|
}
|
|
678
678
|
|
|
679
679
|
&[aria-disabled='true'] {
|
|
680
|
-
${
|
|
680
|
+
${Po}
|
|
681
681
|
}
|
|
682
682
|
|
|
683
683
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -686,7 +686,7 @@
|
|
|
686
686
|
${i=>i.theme.transitions.color},
|
|
687
687
|
border-color ${i=>i.theme.motion.timings[200]} ${i=>i.theme.motion.easings.easeOutQuad};
|
|
688
688
|
}
|
|
689
|
-
`,
|
|
689
|
+
`,dn=b.forwardRef(({children:i,description:e,label:t,defaultOpen:n,open:r,onOpenChange:s,delayDuration:o=500,disableHoverableContent:l,...a},c)=>!t&&!e?i:d.jsxs(lt.Root,{defaultOpen:n,open:r,onOpenChange:s,delayDuration:o,disableHoverableContent:l,children:[d.jsx(lt.Trigger,{asChild:!0,children:i}),d.jsx(lt.Portal,{children:d.jsx(Ac,{ref:c,sideOffset:8,...a,children:d.jsx(O,{variant:"pi",fontWeight:"bold",children:t||e})})})]})),Ac=m.styled(lt.Content)`
|
|
690
690
|
background-color: ${i=>i.theme.colors.neutral900};
|
|
691
691
|
color: ${i=>i.theme.colors.neutral0};
|
|
692
692
|
padding-inline: ${i=>i.theme.spaces[2]};
|
|
@@ -700,7 +700,7 @@
|
|
|
700
700
|
animation: ${ie.fadeIn} ${i=>i.theme.motion.timings[200]}
|
|
701
701
|
${i=>i.theme.motion.easings.authenticMotion};
|
|
702
702
|
}
|
|
703
|
-
`,
|
|
703
|
+
`,et=Ae(({label:i,background:e,children:t,disabled:n=!1,onClick:r,size:s="S",variant:o="tertiary",withTooltip:l=!0,type:a="button",...c},h)=>{const u=g=>{!n&&r&&r(g)},f=d.jsx(ii,{"aria-disabled":n,background:n?"neutral150":e,tag:"button",display:"inline-flex",justifyContent:"center",hasRadius:!0,cursor:"pointer",...c,ref:h,$size:s,onClick:u,$variant:o,type:a,children:d.jsx(yt,{label:i,children:t})});return l?d.jsx(dn,{label:i,children:f}):f}),ii=m.styled(T)`
|
|
704
704
|
text-decoration: none;
|
|
705
705
|
|
|
706
706
|
${i=>{switch(i.$size){case"XS":return m.css`
|
|
@@ -736,24 +736,24 @@
|
|
|
736
736
|
padding-inline: 1.1rem;
|
|
737
737
|
}
|
|
738
738
|
`}}}
|
|
739
|
-
${
|
|
739
|
+
${zo}
|
|
740
740
|
${i=>i.$variant==="tertiary"?m.css`
|
|
741
741
|
color: ${i.theme.colors.neutral500};
|
|
742
742
|
`:""}
|
|
743
743
|
|
|
744
744
|
&:hover {
|
|
745
|
-
${
|
|
745
|
+
${Lo}
|
|
746
746
|
${i=>i.$variant==="tertiary"?m.css`
|
|
747
747
|
color: ${i.theme.colors.neutral600};
|
|
748
748
|
`:""}
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
&:active {
|
|
752
|
-
${
|
|
752
|
+
${Bo}
|
|
753
753
|
}
|
|
754
754
|
|
|
755
755
|
&[aria-disabled='true'] {
|
|
756
|
-
${
|
|
756
|
+
${Po}
|
|
757
757
|
}
|
|
758
758
|
|
|
759
759
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -778,7 +778,7 @@
|
|
|
778
778
|
border-left: none;
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
|
-
`,
|
|
781
|
+
`,No=Ae(({children:i,href:e,disabled:t=!1,startIcon:n,endIcon:r,isExternal:s=!1,color:o="primary600",activeColor:l="primary700",...a},c)=>d.jsxs(Dc,{ref:c,href:e,disabled:t,isExternal:s,$activeColor:l,$color:o,...a,children:[n,d.jsx(O,{textColor:t?"neutral600":o,children:i}),r,e&&!r&&s&&d.jsx(z.ExternalLink,{fill:o})]})),Dc=m.styled(Ut)`
|
|
782
782
|
display: inline-flex;
|
|
783
783
|
align-items: center;
|
|
784
784
|
text-decoration: none;
|
|
@@ -807,8 +807,8 @@
|
|
|
807
807
|
color: ${({theme:i,$activeColor:e})=>i.colors[e||"primary700"]};
|
|
808
808
|
}
|
|
809
809
|
|
|
810
|
-
${
|
|
811
|
-
`,Mc=i=>{switch(i){case"danger":return"danger100";default:return"primary100"}},
|
|
810
|
+
${an};
|
|
811
|
+
`,Mc=i=>{switch(i){case"danger":return"danger100";default:return"primary100"}},Ln=(i,e)=>{switch(i){case"danger":return e?"danger500":"danger700";default:return e?"neutral500":"neutral800"}},li=(i,e)=>{switch(i){case"danger":return e?"danger500":"danger700";default:return e?"neutral300":"neutral500"}},Oc=Be.Root,jc=b.forwardRef(({label:i,endIcon:e=d.jsx(z.CaretDown,{width:"1.2rem",height:"1.2rem","aria-hidden":!0}),tag:t=Yi,icon:n,...r},s)=>{const o={...r,ref:s,type:"button"};return d.jsx(Be.Trigger,{asChild:!0,disabled:o.disabled,children:t===et?d.jsx(et,{label:i,variant:"tertiary",...o,children:n}):d.jsx(Yi,{endIcon:e,variant:"ghost",...o})})}),Ec=b.forwardRef(({children:i,intersectionId:e,onCloseAutoFocus:t,popoverPlacement:n="bottom-start",...r},s)=>{const[o,l]=n.split("-");return d.jsx(Be.Portal,{children:d.jsx(Ic,{align:l,side:o,loop:!0,onCloseAutoFocus:t,asChild:!0,children:d.jsxs(Fo,{ref:s,direction:"column",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,marginTop:1,marginBottom:1,alignItems:"flex-start",position:"relative",overflow:"auto",...r,children:[i,d.jsx(A,{id:e,width:"100%",height:"1px"})]})})})}),Fo=m.styled(T)`
|
|
812
812
|
scrollbar-width: none;
|
|
813
813
|
-ms-overflow-style: none;
|
|
814
814
|
-webkit-overflow-scrolling: touch;
|
|
@@ -817,7 +817,7 @@
|
|
|
817
817
|
&::-webkit-scrollbar {
|
|
818
818
|
display: none;
|
|
819
819
|
}
|
|
820
|
-
`,Ic=m.styled(
|
|
820
|
+
`,Ic=m.styled(Be.Content)`
|
|
821
821
|
@media (prefers-reduced-motion: no-preference) {
|
|
822
822
|
animation-duration: ${i=>i.theme.motion.timings[200]};
|
|
823
823
|
|
|
@@ -833,7 +833,7 @@
|
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
`,Pc=({onSelect:i,disabled:e=!1,isLink:t,startIcon:n,endIcon:r,isExternal:s,variant:o="default",...l})=>d.jsx(
|
|
836
|
+
`,Pc=({onSelect:i,disabled:e=!1,isLink:t,startIcon:n,endIcon:r,isExternal:s,variant:o="default",...l})=>d.jsx(Be.Item,{asChild:!0,onSelect:i,disabled:e,children:t||s?d.jsx(Lc,{color:Ln(o,e),startIcon:n,endIcon:r,...l,isExternal:s??!1,$variant:o,children:l.children}):d.jsxs(Ho,{cursor:"pointer",color:Ln(o,e),background:"transparent",borderStyle:"none",gap:2,$variant:o,...l,children:[n&&d.jsx(T,{tag:"span",color:li(o,e),"aria-hidden":!0,children:n}),d.jsx(O,{grow:1,children:l.children}),r&&d.jsx(T,{tag:"span",color:li(o,e),"aria-hidden":!0,children:r})]})}),Wo=({theme:i,$variant:e})=>m.css`
|
|
837
837
|
text-align: left;
|
|
838
838
|
width: 100%;
|
|
839
839
|
border-radius: ${i.borderRadius};
|
|
@@ -855,12 +855,12 @@
|
|
|
855
855
|
}
|
|
856
856
|
}
|
|
857
857
|
|
|
858
|
-
color: ${i.colors[
|
|
859
|
-
`,
|
|
860
|
-
${({theme:i,$variant:e})=>
|
|
861
|
-
`,Lc=m.styled(
|
|
858
|
+
color: ${i.colors[Ln(e,!1)]};
|
|
859
|
+
`,Ho=m.styled(T)`
|
|
860
|
+
${({theme:i,$variant:e})=>Wo({theme:i,$variant:e})}
|
|
861
|
+
`,Lc=m.styled(No)`
|
|
862
862
|
/* We include this here again because typically when people use OptionLink they provide an as prop which cancels the Box props */
|
|
863
|
-
color: ${({theme:i,color:e})=>
|
|
863
|
+
color: ${({theme:i,color:e})=>oi(i.colors,e,void 0)};
|
|
864
864
|
text-decoration: none;
|
|
865
865
|
|
|
866
866
|
&:hover {
|
|
@@ -868,13 +868,13 @@
|
|
|
868
868
|
|
|
869
869
|
> svg {
|
|
870
870
|
path {
|
|
871
|
-
fill: ${({theme:i,$variant:e})=>i.colors[
|
|
871
|
+
fill: ${({theme:i,$variant:e})=>i.colors[li(e,!1)]};
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
> svg {
|
|
876
876
|
path {
|
|
877
|
-
fill: ${({theme:i,$variant:e})=>i.colors[
|
|
877
|
+
fill: ${({theme:i,$variant:e})=>i.colors[li(e,!1)]};
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
&[aria-disabled='true'] {
|
|
@@ -882,12 +882,12 @@
|
|
|
882
882
|
|
|
883
883
|
> svg {
|
|
884
884
|
path {
|
|
885
|
-
fill: ${({theme:i,$variant:e})=>i.colors[
|
|
885
|
+
fill: ${({theme:i,$variant:e})=>i.colors[li(e,!0)]};
|
|
886
886
|
}
|
|
887
887
|
}
|
|
888
888
|
}
|
|
889
889
|
|
|
890
|
-
${({theme:i,$variant:e})=>
|
|
890
|
+
${({theme:i,$variant:e})=>Wo({theme:i,$variant:e})}
|
|
891
891
|
`,Bc=m.styled(A)`
|
|
892
892
|
/* Negative horizontal margin to compensate Menu.Content's padding */
|
|
893
893
|
margin: ${({theme:i})=>i.spaces[1]} -${({theme:i})=>i.spaces[1]};
|
|
@@ -896,13 +896,13 @@
|
|
|
896
896
|
&:first-child {
|
|
897
897
|
display: none;
|
|
898
898
|
}
|
|
899
|
-
`,zc=b.forwardRef((i,e)=>d.jsx(
|
|
899
|
+
`,zc=b.forwardRef((i,e)=>d.jsx(Be.Separator,{...i,asChild:!0,children:d.jsx(Bc,{height:"1px",shrink:0,background:"neutral150",ref:e})})),Nc=b.forwardRef((i,e)=>d.jsx(Be.Label,{asChild:!0,children:d.jsx(Fc,{ref:e,variant:"sigma",textColor:"neutral600",...i})})),Fc=m.styled(O)`
|
|
900
900
|
padding: ${({theme:i})=>i.spaces[2]} ${({theme:i})=>i.spaces[4]};
|
|
901
|
-
`,Wc=
|
|
901
|
+
`,Wc=Be.Sub,Hc=b.forwardRef(({disabled:i=!1,...e},t)=>d.jsx(Be.SubTrigger,{asChild:!0,disabled:i,children:d.jsxs(Vc,{ref:t,color:"neutral800",tag:"button",type:"button",background:"transparent",borderStyle:"none",gap:5,...e,children:[d.jsx(O,{children:e.children}),d.jsx(z.ChevronRight,{fill:"neutral500",height:"1.2rem",width:"1.2rem"})]})})),Vc=m.styled(Ho)`
|
|
902
902
|
&[data-state='open'] {
|
|
903
903
|
background-color: ${({theme:i})=>i.colors.primary100};
|
|
904
904
|
}
|
|
905
|
-
`,qc=b.forwardRef((i,e)=>d.jsx(
|
|
905
|
+
`,qc=b.forwardRef((i,e)=>d.jsx(Be.Portal,{children:d.jsx(Be.SubContent,{sideOffset:8,asChild:!0,children:d.jsx(Fo,{ref:e,direction:"column",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",hasRadius:!0,background:"neutral0",shadow:"filterShadow",maxHeight:"15rem",padding:1,alignItems:"flex-start",overflow:"auto",...i})})})),Vo=Oc,qo=jc,_o=Ec,Ko=Pc,_c=zc,Kc=Nc,Uc=Wc,Gc=Hc,Yc=qc,Xc=Object.freeze(Object.defineProperty({__proto__:null,Content:_o,Item:Ko,Label:Kc,Root:Vo,Separator:_c,SubContent:Yc,SubRoot:Uc,SubTrigger:Gc,Trigger:qo},Symbol.toStringTag,{value:"Module"})),Uo=b.forwardRef(({children:i,onOpen:e,onClose:t,popoverPlacement:n,onReachEnd:r,...s},o)=>{const l=b.useRef(null),a=Ce(o,l),c=b.useRef(null),[h,u]=b.useState(!1),f=w=>{r&&r(w)},g=w=>{w&&typeof e=="function"?e():!w&&typeof t=="function"&&t(),u(w)},p=ke(),x=`intersection-${Lt(p)}`;return vi(c,f,{selectorToWatch:`#${x}`,skipWhen:!h}),d.jsxs(Vo,{onOpenChange:g,children:[d.jsx(qo,{ref:a,...s,children:s.label}),d.jsx(_o,{ref:c,intersectionId:x,popoverPlacement:n,children:i})]})}),Jc=Ko,Qc=m.styled(Uo)`
|
|
906
906
|
padding: ${({theme:i})=>`${i.spaces[1]} ${i.spaces[2]}`};
|
|
907
907
|
height: unset;
|
|
908
908
|
|
|
@@ -910,7 +910,7 @@
|
|
|
910
910
|
:focus {
|
|
911
911
|
background-color: ${({theme:i})=>i.colors.neutral200};
|
|
912
912
|
}
|
|
913
|
-
`,
|
|
913
|
+
`,Go=b.forwardRef(({children:i,...e},t)=>d.jsx(Qc,{ref:t,endIcon:null,size:"S",...e,children:i}));Go.displayName="CrumbSimpleMenu";const Yo=b.createContext({id:""}),Xo=()=>b.useContext(Yo),Zc=b.forwardRef(({id:i,...e},t)=>{const n=ke(i),r=b.useMemo(()=>({id:n}),[n]);return d.jsx(Yo.Provider,{value:r,children:d.jsx(A,{ref:t,id:i,tabIndex:0,hasRadius:!0,background:"neutral0",borderStyle:"solid",borderWidth:"1px",borderColor:"neutral150",shadow:"tableShadow",tag:"article","aria-labelledby":`${n}-title`,...e})})}),Jo=b.forwardRef(({position:i,...e},t)=>d.jsx(ed,{ref:t,$position:i,...e,direction:"row",gap:2})),ed=m.styled(T)`
|
|
914
914
|
position: absolute;
|
|
915
915
|
top: ${({theme:i})=>i.spaces[3]};
|
|
916
916
|
right: ${({$position:i,theme:e})=>{if(i==="end")return e.spaces[3]}};
|
|
@@ -936,9 +936,9 @@
|
|
|
936
936
|
`,rd=m.styled.div`
|
|
937
937
|
margin-left: auto;
|
|
938
938
|
flex-shrink: 0;
|
|
939
|
-
`,sd=m.styled(
|
|
939
|
+
`,sd=m.styled(vr)`
|
|
940
940
|
margin-left: ${({theme:i})=>i.spaces[1]};
|
|
941
|
-
`,od=i=>d.jsx(rd,{children:d.jsx(sd,{...i})}),ld=i=>d.jsx(A,{paddingLeft:3,paddingRight:3,paddingTop:2,paddingBottom:2,children:d.jsx(T,{...i,alignItems:"flex-start"})}),ad=({fill:i,...e})=>{const{colors:t}=m.useTheme();return d.jsx(A,{tag:"svg",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:i?t[i]:void 0,...e,children:d.jsx("path",{d:"M29.0613 10.0613L13.0613 26.0613C12.9219 26.2011 12.7563 26.3121 12.574 26.3878C12.3917 26.4635 12.1962 26.5024 11.9988 26.5024C11.8013 26.5024 11.6059 26.4635 11.4235 26.3878C11.2412 26.3121 11.0756 26.2011 10.9363 26.0613L3.93626 19.0613C3.79673 18.9217 3.68605 18.7561 3.61053 18.5738C3.53502 18.3915 3.49615 18.1961 3.49615 17.9988C3.49615 17.8014 3.53502 17.606 3.61053 17.4237C3.68605 17.2414 3.79673 17.0758 3.93626 16.9363C4.07579 16.7967 4.24143 16.686 4.42374 16.6105C4.60604 16.535 4.80143 16.4962 4.99876 16.4962C5.19608 16.4962 5.39147 16.535 5.57378 16.6105C5.75608 16.686 5.92173 16.7967 6.06126 16.9363L12 22.875L26.9388 7.93876C27.2205 7.65697 27.6027 7.49866 28.0013 7.49866C28.3998 7.49866 28.782 7.65697 29.0638 7.93876C29.3455 8.22055 29.5039 8.60274 29.5039 9.00126C29.5039 9.39977 29.3455 9.78197 29.0638 10.0638L29.0613 10.0613Z"})})},
|
|
941
|
+
`,od=i=>d.jsx(rd,{children:d.jsx(sd,{...i})}),ld=i=>d.jsx(A,{paddingLeft:3,paddingRight:3,paddingTop:2,paddingBottom:2,children:d.jsx(T,{...i,alignItems:"flex-start"})}),ad=({fill:i,...e})=>{const{colors:t}=m.useTheme();return d.jsx(A,{tag:"svg",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:i?t[i]:void 0,...e,children:d.jsx("path",{d:"M29.0613 10.0613L13.0613 26.0613C12.9219 26.2011 12.7563 26.3121 12.574 26.3878C12.3917 26.4635 12.1962 26.5024 11.9988 26.5024C11.8013 26.5024 11.6059 26.4635 11.4235 26.3878C11.2412 26.3121 11.0756 26.2011 10.9363 26.0613L3.93626 19.0613C3.79673 18.9217 3.68605 18.7561 3.61053 18.5738C3.53502 18.3915 3.49615 18.1961 3.49615 17.9988C3.49615 17.8014 3.53502 17.606 3.61053 17.4237C3.68605 17.2414 3.79673 17.0758 3.93626 16.9363C4.07579 16.7967 4.24143 16.686 4.42374 16.6105C4.60604 16.535 4.80143 16.4962 4.99876 16.4962C5.19608 16.4962 5.39147 16.535 5.57378 16.6105C5.75608 16.686 5.92173 16.7967 6.06126 16.9363L12 22.875L26.9388 7.93876C27.2205 7.65697 27.6027 7.49866 28.0013 7.49866C28.3998 7.49866 28.782 7.65697 29.0638 7.93876C29.3455 8.22055 29.5039 8.60274 29.5039 9.00126C29.5039 9.39977 29.3455 9.78197 29.0638 10.0638L29.0613 10.0613Z"})})},ss=b.forwardRef(({defaultChecked:i,checked:e,onCheckedChange:t,...n},r)=>{const s=b.useRef(null),[o,l]=Pe({defaultProp:i,prop:e,onChange:t}),a=Ce(s,r);return d.jsx(hd,{ref:a,checked:o,onCheckedChange:l,...n,children:d.jsxs(cd,{forceMount:!0,children:[o===!0?d.jsx(ad,{width:"1.6rem",fill:"neutral0"}):null,o==="indeterminate"?d.jsx(z.Minus,{fill:"neutral0"}):null]})})}),hd=m.styled(xo.Root)`
|
|
942
942
|
background: ${i=>i.theme.colors.neutral0};
|
|
943
943
|
width: 2rem;
|
|
944
944
|
height: 2rem;
|
|
@@ -975,7 +975,7 @@
|
|
|
975
975
|
min-width: 44px;
|
|
976
976
|
min-height: 44px;
|
|
977
977
|
}
|
|
978
|
-
`,cd=m.styled(
|
|
978
|
+
`,cd=m.styled(xo.Indicator)`
|
|
979
979
|
display: inline-flex;
|
|
980
980
|
pointer-events: auto !important;
|
|
981
981
|
width: 100%;
|
|
@@ -987,23 +987,23 @@
|
|
|
987
987
|
&[data-disabled] {
|
|
988
988
|
cursor: not-allowed;
|
|
989
989
|
}
|
|
990
|
-
`,
|
|
990
|
+
`,un=b.forwardRef(({children:i,...e},t)=>{const n=ke(e.id);return i?d.jsxs(T,{gap:2,children:[d.jsx(ss,{id:n,...e}),d.jsx(O,{tag:"label",textColor:"neutral800",htmlFor:n,children:i})]}):d.jsx(ss,{ref:t,...e})}),dd=b.forwardRef((i,e)=>{const{id:t}=Xo();return d.jsx(Jo,{position:"start",children:d.jsx(un,{"aria-labelledby":`${t}-title`,...i,ref:e})})}),ud=m.styled(A)`
|
|
991
991
|
word-break: break-all;
|
|
992
992
|
`,fd=({children:i,...e})=>d.jsx(ud,{...e,children:i}),gd=m.styled(T)`
|
|
993
993
|
border-bottom: 1px solid ${({theme:i})=>i.colors.neutral150};
|
|
994
|
-
`,pd=i=>d.jsx(gd,{position:"relative",justifyContent:"center",...i}),md=({children:i,...e})=>d.jsx(A,{tag:"time",background:"neutral800",bottom:1,right:1,color:"neutral0",hasRadius:!0,position:"absolute",padding:1,...e,children:d.jsx(O,{variant:"pi",textColor:"neutral0",children:i})}),bd=i=>{const{id:e}=
|
|
994
|
+
`,pd=i=>d.jsx(gd,{position:"relative",justifyContent:"center",...i}),md=({children:i,...e})=>d.jsx(A,{tag:"time",background:"neutral800",bottom:1,right:1,color:"neutral0",hasRadius:!0,position:"absolute",padding:1,...e,children:d.jsx(O,{variant:"pi",textColor:"neutral0",children:i})}),bd=i=>{const{id:e}=Xo();return d.jsx(O,{variant:"pi",id:`${e}-title`,textColor:"neutral800",fontWeight:"bold",tag:"div",...i})},xd=i=>d.jsx(O,{variant:"pi",...i,textColor:"neutral600",tag:"div"}),U={DOWN:"ArrowDown",UP:"ArrowUp",RIGHT:"ArrowRight",LEFT:"ArrowLeft",ESCAPE:"Escape",ENTER:"Enter",SPACE:" ",TAB:"Tab",END:"End",HOME:"Home",DELETE:"Delete",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",CLEAR:"Clear"},yd=m.styled(A)`
|
|
995
995
|
grid-template-columns: auto 1fr auto;
|
|
996
996
|
grid-template-areas: 'startAction slides endAction';
|
|
997
997
|
`,wd=m.styled(T)`
|
|
998
998
|
grid-area: slides;
|
|
999
|
-
`,
|
|
999
|
+
`,os=m.styled(A)`
|
|
1000
1000
|
grid-area: ${({$area:i})=>i};
|
|
1001
1001
|
|
|
1002
1002
|
&:focus svg path,
|
|
1003
1003
|
&:hover svg path {
|
|
1004
1004
|
fill: ${({theme:i})=>i.colors.neutral900};
|
|
1005
1005
|
}
|
|
1006
|
-
`,
|
|
1006
|
+
`,Qo=b.forwardRef(({actions:i,children:e,label:t,nextLabel:n,onNext:r,onPrevious:s,previousLabel:o,secondaryLabel:l,selectedSlide:a,...c},h)=>{const u=b.useRef(null),f=b.useRef(null),g=b.Children.map(e,(x,w)=>b.cloneElement(x,{selected:w===a})),p=x=>{switch(x.key){case U.RIGHT:{x.preventDefault(),f!=null&&f.current&&f.current.focus(),r&&r();break}case U.LEFT:{x.preventDefault(),u!=null&&u.current&&u.current.focus(),s&&s();break}}};return d.jsx(A,{ref:h,...c,onKeyDown:p,children:d.jsxs(A,{padding:2,borderColor:"neutral200",hasRadius:!0,background:"neutral100",children:[d.jsxs(yd,{tag:"section","aria-roledescription":"carousel","aria-label":t,display:"grid",position:"relative",children:[g&&g.length>1&&d.jsxs(d.Fragment,{children:[d.jsx(os,{tag:"button",onClick:s,$area:"startAction",ref:u,type:"button",children:d.jsx(yt,{label:o,children:d.jsx(z.ChevronLeft,{width:"1.6rem",height:"1.6rem",fill:"neutral600"})})}),d.jsx(os,{tag:"button",onClick:r,$area:"endAction",ref:f,type:"button",children:d.jsx(yt,{label:n,children:d.jsx(z.ChevronRight,{width:"1.6rem",height:"1.6rem",fill:"neutral600"})})})]}),d.jsx(wd,{"aria-live":"polite",paddingLeft:2,paddingRight:2,width:"100%",overflow:"hidden",children:g}),i]}),l&&d.jsx(A,{paddingTop:2,paddingLeft:4,paddingRight:4,children:d.jsx(dn,{label:l,children:d.jsx(T,{justifyContent:"center",children:d.jsx(O,{variant:"pi",textColor:"neutral600",ellipsis:!0,children:l})})})})]})})}),vd={accordions:{S:"4.8rem",M:"8.8rem"},button:{S:{initial:"4rem",medium:"3.2rem"},M:{initial:"4.4rem",medium:"3.6rem"},L:{initial:"4.8rem",medium:"4rem"}}},Zo={sizes:vd,zIndices:{navigation:100,overlay:300,modal:310,dialog:320,popover:500,notification:700,tooltip:1e3},spaces:["0px","4px","8px","12px","16px","20px","24px","32px","40px","48px","56px","64px"],borderRadius:"4px",breakpoints:{initial:"@media(min-width: 0px)",small:"@media(min-width: 520px)",medium:"@media(min-width: 768px)",large:"@media(min-width: 1080px)"},fontSizes:["1.1rem","1.2rem","1.4rem","1.6rem","1.8rem","2rem","2.8rem","3.2rem"],lineHeights:[1.14,1.22,1.25,1.33,1.43,1.45,1.5],fontWeights:{regular:400,semiBold:500,bold:600},transitions:oc,motion:{easings:En,timings:In}},Sd={color:{alternative100:"#f6ecfc",alternative200:"#e0c1f4",alternative500:"#ac73e6",alternative600:"#9736e8",alternative700:"#8312d1",buttonNeutral0:"#ffffff",buttonPrimary500:"#7b79ff",buttonPrimary600:"#4945ff",danger100:"#fcecea",danger200:"#f5c0b8",danger500:"#ee5e52",danger600:"#d02b20",danger700:"#b72b1a",neutral0:"#ffffff",neutral100:"#f6f6f9",neutral1000:"#181826",neutral150:"#eaeaef",neutral200:"#dcdce4",neutral300:"#c0c0cf",neutral400:"#a5a5ba",neutral500:"#8e8ea9",neutral600:"#666687",neutral700:"#4a4a6a",neutral800:"#32324d",neutral900:"#212134",primary100:"#f0f0ff",primary200:"#d9d8ff",primary500:"#7b79ff",primary600:"#4945ff",primary700:"#271fe0",secondary100:"#eaf5ff",secondary200:"#b8e1ff",secondary500:"#66b7f1",secondary600:"#0c75af",secondary700:"#006096",success100:"#eafbe7",success200:"#c6f0c2",success500:"#5cb176",success600:"#328048",success700:"#2f6846",warning100:"#fdf4dc",warning200:"#fae7b9",warning500:"#f29d41",warning600:"#d9822f",warning700:"#be5d01"}},Cd={shadow:{filterShadow:"0px 1px 4px rgba(33, 33, 52, 0.1)",focus:"inset 2px 0px 0px rgb(39, 31, 224), inset 0px 2px 0px rgb(39, 31, 224), inset -2px 0px 0px rgb(39, 31, 224), inset 0px -2px 0px rgb(39, 31, 224)",focusShadow:"0px 0px 6px rgba(76, 191, 255, 0.75)",popupShadow:"0px 2px 15px rgba(33, 33, 52, 0.1)",tableShadow:"0px 1px 4px rgba(33, 33, 52, 0.1)"}},Tr={colors:Sd.color,shadows:Cd.shadow,...Zo},kd={color:{alternative100:"#181826",alternative200:"#4a4a6a",alternative500:"#ac73e6",alternative600:"#ac73e6",alternative700:"#e0c1f4",buttonNeutral0:"#ffffff",buttonPrimary500:"#7b79ff",buttonPrimary600:"#4945ff",danger100:"#181826",danger200:"#4a4a6a",danger500:"#ee5e52",danger600:"#ee5e52",danger700:"#ee5e52",neutral0:"#212134",neutral100:"#181826",neutral1000:"#ffffff",neutral150:"#32324d",neutral200:"#4a4a6a",neutral300:"#666687",neutral400:"#a5a5ba",neutral500:"#c0c0cf",neutral600:"#a5a5ba",neutral700:"#eaeaef",neutral800:"#ffffff",neutral900:"#ffffff",primary100:"#181826",primary200:"#4a4a6a",primary500:"#4945ff",primary600:"#7b79ff",primary700:"#7b79ff",secondary100:"#181826",secondary200:"#4a4a6a",secondary500:"#66b7f1",secondary600:"#66b7f1",secondary700:"#b8e1ff",success100:"#181826",success200:"#4a4a6a",success500:"#5cb176",success600:"#5cb176",success700:"#c6f0c2",warning100:"#181826",warning200:"#4a4a6a",warning500:"#f29d41",warning600:"#f29d41",warning700:"#fae7b9"}},$d={shadow:{filterShadow:"1px 1px 10px rgba(3, 3, 5, 0.35)",focus:"inset 2px 0px 0px rgb(39, 31, 224), inset 0px 2px 0px rgb(39, 31, 224), inset -2px 0px 0px rgb(39, 31, 224), inset 0px -2px 0px rgb(39, 31, 224)",focusShadow:"0px 0px 6px rgba(76, 191, 255, 0.75)",popupShadow:"1px 1px 10px rgba(3, 3, 5, 0.35)",tableShadow:"1px 1px 10px rgba(3, 3, 5, 0.2)"}},Td={colors:kd.color,shadows:$d.shadow,...Zo},ls=i=>`
|
|
1007
1007
|
${i}
|
|
1008
1008
|
|
|
1009
1009
|
The following is an example:
|
|
@@ -1012,10 +1012,10 @@ The following is an example:
|
|
|
1012
1012
|
import { lightTheme, extendTheme } from '@strapi/design-system';
|
|
1013
1013
|
|
|
1014
1014
|
const myCustomTheme = extendTheme(lightTheme, {
|
|
1015
|
-
${Object.keys(
|
|
1015
|
+
${Object.keys(Tr).map(e=>`${e}: /* put the overrides for the ${e} key */,`).join(`
|
|
1016
1016
|
`)}
|
|
1017
1017
|
})
|
|
1018
|
-
`,Ad=(i,e)=>{if(!
|
|
1018
|
+
`,Ad=(i,e)=>{if(!Mi(i)){const s=ls("The first argument should be an object and corresponds to the theme you want to extend.");throw new Error(s)}if(!Mi(e)){const s=ls("The second argument should be an object and corresponds to the keys of the theme you want to override.");throw new Error(s)}function t(s,o){if(Array.isArray(s))return o;if(Mi(s)&&Mi(o))return Di.merge(s,o)}const n=Di.cloneDeep(i??{}),r=Di.cloneDeep(e??{});return Di.assignWith(n,r,t),n},Rd=i=>({theme:e,size:t})=>e.sizes[i][t],rt=(i="&")=>({theme:e,$hasError:t=!1})=>m.css`
|
|
1019
1019
|
outline: none;
|
|
1020
1020
|
box-shadow: none;
|
|
1021
1021
|
transition-property: border-color, box-shadow, fill;
|
|
@@ -1025,12 +1025,12 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1025
1025
|
border: 1px solid ${t?e.colors.danger600:e.colors.primary600};
|
|
1026
1026
|
box-shadow: ${t?e.colors.danger600:e.colors.primary600} 0px 0px 0px 2px;
|
|
1027
1027
|
}
|
|
1028
|
-
`,[Dd,$e]=Kt("Field",{}),
|
|
1028
|
+
`,[Dd,$e]=Kt("Field",{}),wt=b.forwardRef(({children:i,name:e,error:t=!1,hint:n,id:r,required:s=!1,...o},l)=>{const a=ke(r),[c,h]=b.useState();return d.jsx(Dd,{name:e,id:a,error:t,hint:n,required:s,labelNode:c,setLabelNode:h,children:d.jsx(T,{direction:"column",alignItems:"stretch",gap:1,ref:l,...o,children:i})})}),Ar=b.forwardRef(({children:i,action:e,...t},n)=>{const{id:r,required:s,setLabelNode:o}=$e("Label"),l=Ce(n,o);return i?d.jsxs(T,{alignItems:"center",children:[d.jsxs(Md,{ref:l,variant:"pi",textColor:"neutral800",fontWeight:"bold",...t,id:`${r}-label`,htmlFor:r,tag:"label",ellipsis:!0,children:[i,s&&d.jsx(O,{"aria-hidden":!0,lineHeight:"1em",textColor:"danger600",children:"*"})]}),e&&d.jsx(Od,{marginLeft:1,children:e})]}):null}),Md=m.styled(O)`
|
|
1029
1029
|
display: block;
|
|
1030
1030
|
`,Od=m.styled(T)`
|
|
1031
1031
|
line-height: 0;
|
|
1032
1032
|
color: ${({theme:i})=>i.colors.neutral500};
|
|
1033
|
-
`,
|
|
1033
|
+
`,fn=b.forwardRef(({endAction:i,startAction:e,disabled:t=!1,onChange:n,hasError:r,required:s,className:o,size:l="M",...a},c)=>{const{id:h,error:u,hint:f,name:g,required:p}=$e("Input");let x;u?x=`${h}-error`:f&&(x=`${h}-hint`);const w=!!u,y=b.useRef(null),v=b.useRef(null),k=Ce(v,c),S=$=>{!t&&n&&n($)};return b.useLayoutEffect(()=>{if(y.current&&v.current){const $=y.current.offsetWidth,C=v.current;if(C){const R=$+8+16;C.style.paddingRight=`${R}px`}}},[i]),d.jsxs(Id,{gap:2,justifyContent:"space-between",$hasError:w||r,$disabled:t,$size:l,$hasLeftAction:!!e,$hasRightAction:!!i,className:o,children:[e,d.jsx(jd,{id:h,name:g,ref:k,$size:l,"aria-describedby":x,"aria-invalid":w||r,"aria-disabled":t,disabled:t,"data-disabled":t?"":void 0,onChange:S,"aria-required":p||s,$hasLeftAction:!!e,$hasRightAction:!!i,...a}),i&&d.jsx(Ed,{ref:y,children:i})]})}),jd=m.styled.input`
|
|
1034
1034
|
border: none;
|
|
1035
1035
|
border-radius: ${({theme:i})=>i.borderRadius};
|
|
1036
1036
|
cursor: ${i=>i["aria-disabled"]?"not-allowed":void 0};
|
|
@@ -1092,19 +1092,19 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1092
1092
|
padding-inline-start: ${({$hasLeftAction:i,theme:e})=>i?e.spaces[4]:0};
|
|
1093
1093
|
position: relative;
|
|
1094
1094
|
|
|
1095
|
-
${
|
|
1095
|
+
${rt()}
|
|
1096
1096
|
${({theme:i,$disabled:e})=>e?m.css`
|
|
1097
1097
|
color: ${i.colors.neutral600};
|
|
1098
1098
|
background: ${i.colors.neutral150};
|
|
1099
1099
|
`:void 0};
|
|
1100
|
-
`,
|
|
1100
|
+
`,el=()=>{const{id:i,hint:e,error:t}=$e("Hint");return!e||t?null:d.jsx(O,{variant:"pi",tag:"p",id:`${i}-hint`,textColor:"neutral600",children:e})},tl=()=>{const{id:i,error:e}=$e("Error");return!e||typeof e!="string"?null:d.jsx(O,{variant:"pi",tag:"p",id:`${i}-error`,textColor:"danger600","data-strapi-field-error":!0,children:e})},Pd=b.forwardRef(({label:i,children:e,...t},n)=>d.jsx(Ld,{justifyContent:"unset",background:"transparent",borderStyle:"none",...t,type:"button",tag:"button",ref:n,children:d.jsx(yt,{label:i,children:e})})),Ld=m.styled(T)`
|
|
1101
1101
|
font-size: 1.6rem;
|
|
1102
1102
|
padding: 0;
|
|
1103
|
-
`,Bd=Object.freeze(Object.defineProperty({__proto__:null,Action:Pd,Error:
|
|
1104
|
-
${
|
|
1105
|
-
`,Fd=i=>{const[e,t]=b.useState(!1),n=()=>{t(!0)};return e?d.jsx(
|
|
1103
|
+
`,Bd=Object.freeze(Object.defineProperty({__proto__:null,Action:Pd,Error:tl,Hint:el,Input:fn,Label:Ar,Root:wt,useField:$e},Symbol.toStringTag,{value:"Module"})),zd=b.forwardRef(({actions:i,children:e,error:t,hint:n,label:r,labelAction:s,nextLabel:o,onNext:l,onPrevious:a,previousLabel:c,required:h,secondaryLabel:u,selectedSlide:f,id:g,...p},x)=>{const w=ke(g);return d.jsx(wt,{hint:n,error:t,id:w,required:h,children:d.jsxs(T,{direction:"column",alignItems:"stretch",gap:1,children:[r&&d.jsx(Ar,{action:s,children:r}),d.jsx(Qo,{ref:x,actions:i,label:r,nextLabel:o,onNext:l,onPrevious:a,previousLabel:c,secondaryLabel:u,selectedSlide:f,id:w,...p,children:e}),d.jsx(el,{}),d.jsx(tl,{})]})})}),Nd=({horizontal:i=!0,...e})=>d.jsx(T,{justifyContent:"center",direction:i?"row":"column",alignItems:i?"center":"stretch",position:"absolute",width:"100%",bottom:1,gap:1,...e}),as=m.styled(A)`
|
|
1104
|
+
${vo}
|
|
1105
|
+
`,Fd=i=>{const[e,t]=b.useState(!1),n=()=>{t(!0)};return e?d.jsx(dn,{label:i.alt??"",children:d.jsx(as,{tag:"img",height:"100%",maxWidth:"100%",...i})}):d.jsx(as,{tag:"img",height:"100%",maxWidth:"100%",...i,onError:n})},Wd=m.styled(T)`
|
|
1106
1106
|
display: ${({$selected:i})=>i?"flex":"none"};
|
|
1107
|
-
`,Hd=({label:i,children:e,selected:t=!1,...n})=>d.jsx(Wd,{$selected:t,alignItems:"center",role:"group","aria-roledescription":"slide","aria-label":i,justifyContent:"center",height:"124px",width:"100%",...n,children:e}),
|
|
1107
|
+
`,Hd=({label:i,children:e,selected:t=!1,...n})=>d.jsx(Wd,{$selected:t,alignItems:"center",role:"group","aria-roledescription":"slide","aria-label":i,justifyContent:"center",height:"124px",width:"100%",...n,children:e}),il=m.css`
|
|
1108
1108
|
font-size: 1.6rem;
|
|
1109
1109
|
line-height: 2.4rem;
|
|
1110
1110
|
|
|
@@ -1112,7 +1112,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1112
1112
|
font-size: 1.4rem;
|
|
1113
1113
|
line-height: 2.2rem;
|
|
1114
1114
|
}
|
|
1115
|
-
`,
|
|
1115
|
+
`,Rr=({$size:i="M",$hasValue:e=!1,$hasClear:t=!1,theme:n})=>{switch(i){case"S":return m.css`
|
|
1116
1116
|
padding-block: calc(
|
|
1117
1117
|
${e&&t?n.spaces[1]:n.spaces[2]} - 1px
|
|
1118
1118
|
); // 1px to compensate for the border
|
|
@@ -1128,14 +1128,14 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1128
1128
|
${n.breakpoints.medium} {
|
|
1129
1129
|
padding-block: ${n.spaces[2]};
|
|
1130
1130
|
}
|
|
1131
|
-
`}},
|
|
1131
|
+
`}},ki=b.forwardRef(({children:i,viewportRef:e,...t},n)=>d.jsxs(Vd,{ref:n,...t,children:[d.jsx(qd,{ref:e,children:i}),d.jsx(hs,{orientation:"vertical",children:d.jsx(cs,{})}),d.jsx(hs,{orientation:"horizontal",children:d.jsx(cs,{})})]})),Vd=m.styled(on.Root)`
|
|
1132
1132
|
width: 100%;
|
|
1133
1133
|
height: 100%;
|
|
1134
1134
|
overflow: hidden;
|
|
1135
1135
|
display: flex;
|
|
1136
|
-
`,qd=m.styled(
|
|
1136
|
+
`,qd=m.styled(on.Viewport)`
|
|
1137
1137
|
min-width: 100%;
|
|
1138
|
-
`,
|
|
1138
|
+
`,hs=m.styled(on.Scrollbar)`
|
|
1139
1139
|
display: flex;
|
|
1140
1140
|
/* ensures no selection */
|
|
1141
1141
|
user-select: none;
|
|
@@ -1152,7 +1152,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1152
1152
|
height: 0.4rem;
|
|
1153
1153
|
margin: 0.4rem;
|
|
1154
1154
|
}
|
|
1155
|
-
`,
|
|
1155
|
+
`,cs=m.styled(on.Thumb)`
|
|
1156
1156
|
position: relative;
|
|
1157
1157
|
flex: 1;
|
|
1158
1158
|
background-color: ${i=>i.theme.colors.neutral150};
|
|
@@ -1172,7 +1172,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1172
1172
|
min-height: 44px;
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
`,_d="data:image/svg+xml,%3csvg%20width='63'%20height='63'%20viewBox='0%200%2063%2063'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.5563%2011.9816C39.484%2010.3071%2035.8575%209.29097%2032.3354%209.13521C28.6443%208.92888%2024.8295%209.72318%2021.3336%2011.4129C20.9123%2011.5901%2020.5376%2011.8101%2020.1722%2012.0249L20.0108%2012.1179C19.8774%2012.1951%2019.7441%2012.2724%2019.608%2012.3536C19.3253%2012.5146%2019.0492%2012.6744%2018.7544%2012.8792C18.5463%2013.0329%2018.3395%2013.1759%2018.1301%2013.323C17.5658%2013.7208%2016.9868%2014.1317%2016.4983%2014.5979C14.8476%2015.9524%2013.5571%2017.6075%2012.6071%2018.9214C10.4365%2022.1566%209.08622%2025.9567%208.80702%2029.6143L8.7764%2030.1588C8.73328%2030.9196%208.68476%2031.7057%208.75353%2032.4555C8.76648%2032.6084%208.7661%2032.7638%208.77506%2032.914C8.78895%2033.229%208.80152%2033.5373%208.846%2033.8672L9.07396%2035.4221C9.09756%2035.5764%209.1198%2035.7413%209.1633%2035.9263L9.65919%2037.9272L10.138%2039.2823C10.2729%2039.6673%2010.4158%2040.0751%2010.6%2040.43C12.0292%2043.637%2014.1425%2046.4578%2016.7063%2048.585C19.0508%2050.5296%2021.824%2052.0023%2024.7491%2052.8452L26.2371%2053.2376C26.3781%2053.2693%2026.4926%2053.2889%2026.6031%2053.3058L26.7775%2053.3311C27.0052%2053.3636%2027.2195%2053.3986%2027.4445%2053.435C27.8598%2053.5076%2028.2672%2053.5748%2028.7079%2053.6183L30.5641%2053.7229C30.9516%2053.7249%2031.3352%2053.7068%2031.7081%2053.6874C31.9039%2053.681%2032.0984%2053.6681%2032.3288%2053.662C34.5253%2053.4772%2036.5106%2053.0634%2038.0516%2052.4652C38.1769%2052.4171%2038.3008%2052.3796%2038.4234%2052.3355C38.6727%2052.2499%2038.9259%2052.167%2039.1432%2052.0599L40.8591%2051.2626L42.5702%2050.266C42.9009%2050.0682%2043.0205%2049.6414%2042.8282%2049.2984C42.632%2048.9526%2042.2034%2048.8308%2041.8634%2049.0166L40.1792%2049.9218L38.4995%2050.6224C38.3169%2050.6953%2038.121%2050.7534%2037.9224%2050.8155C37.7838%2050.8489%2037.6518%2050.8983%2037.5012%2050.9408C36.0711%2051.435%2034.2445%2051.7425%2032.244%2051.8346C32.0442%2051.8383%2031.8471%2051.8379%2031.654%2051.8403C31.3051%2051.8414%2030.9602%2051.8451%2030.6392%2051.8305L28.9177%2051.6725C28.5476%2051.619%2028.1695%2051.5427%2027.7848%2051.4678C27.5639%2051.4167%2027.3376%2051.3737%2027.1299%2051.3374L26.9529%2051.2987C26.8704%2051.2834%2026.7772%2051.2667%2026.7333%2051.2543L25.3466%2050.8322C22.7651%2049.9789%2020.33%2048.5729%2018.2942%2046.7557C16.1056%2044.7951%2014.3339%2042.2335%2013.1742%2039.3582C12.0276%2036.6013%2011.5988%2033.2792%2011.9716%2030.0076C12.3145%2027.0213%2013.3948%2024.1635%2015.1858%2021.5083C15.3034%2021.3339%2015.421%2021.1596%2015.5212%2021.0196C16.4309%2019.8688%2017.5408%2018.5589%2018.9483%2017.496C19.3367%2017.1525%2019.7862%2016.856%2020.2611%2016.5478C20.4878%2016.4009%2020.7079%2016.2553%2020.8907%2016.1306C21.0974%2016.0048%2021.3188%2015.8831%2021.5348%2015.7694C21.6761%2015.6975%2021.8162%2015.619%2021.9388%2015.5576L22.1002%2015.4646C22.4002%2015.3037%2022.6749%2015.1546%2022.9908%2015.039L24.1186%2014.5715C24.3399%2014.4844%2024.5718%2014.4159%2024.7997%2014.3447C24.953%2014.2982%2025.0982%2014.2635%2025.2635%2014.2078C25.786%2014.0182%2026.3283%2013.9112%2026.9105%2013.7965C27.117%2013.7571%2027.3302%2013.7163%2027.5608%2013.6585C27.7553%2013.611%2027.9737%2013.5969%2028.2082%2013.5762C28.364%2013.5603%2028.5172%2013.5483%2028.6318%2013.5333C28.7876%2013.5173%2028.9342%2013.5066%2029.0927%2013.4867C29.3285%2013.4555%2029.5456%2013.4347%2029.7494%2013.4337C30.0237%2013.44%2030.2994%2013.4357%2030.5777%2013.4274C31.0811%2013.421%2031.5579%2013.4197%2032.0318%2013.4914C34.9664%2013.7352%2037.7144%2014.6085%2040.2052%2016.0868C42.3489%2017.3655%2044.2716%2019.1525%2045.7607%2021.264C47.0255%2023.0628%2047.9756%2025.0528%2048.4928%2027.0393C48.572%2027.3176%2048.6299%2027.5931%2048.6839%2027.8659C48.7154%2028.0428%2048.7563%2028.2145%2048.7892%2028.3636C48.8037%2028.4541%2048.8208%2028.5406%2048.8445%2028.6258C48.8749%2028.7443%2048.8986%2028.864%2048.9116%2028.9651L48.9793%2029.6047C48.9922%2029.7748%2049.0132%2029.9331%2049.0301%2030.0887C49.0668%2030.3268%2049.0889%2030.5608%2049.0964%2030.7561L49.1083%2031.9001C49.1312%2032.3307%2049.089%2032.7116%2049.0522%2033.0673C49.0384%2033.2598%2049.0126%2033.4443%2049.0123%2033.5824C48.9961%2033.6926%2048.9918%2033.7935%2048.9836%2033.8917C48.9753%2034.0072%2048.9724%2034.1148%2048.9414%2034.2554L48.5449%2036.3059C48.3134%2037.8623%2049.3793%2039.3365%2050.9488%2039.5822C52.0417%2039.7601%2053.1536%2039.2819%2053.7711%2038.3664C54.0063%2038.0176%2054.1604%2037.6257%2054.2227%2037.2064L54.5217%2035.2574C54.5514%2035.0756%2054.572%2034.83%2054.5846%2034.5791L54.6028%2034.2338C54.6098%2034.0598%2054.6223%2033.8779%2054.6347%2033.6788C54.6734%2033.1052%2054.7163%2032.4479%2054.6619%2031.8058L54.5867%2030.4289C54.5622%2030.0952%2054.5097%2029.76%2054.4559%2029.4181C54.431%2029.2572%2054.4048%2029.0896%2054.3826%2028.9074L54.2687%2028.104C54.2332%2027.9244%2054.1804%2027.7273%2054.1329%2027.5396L54.0643%2027.2454C54.0195%2027.071%2053.9773%2026.8927%2053.9338%2026.7076C53.8455%2026.3309%2053.7479%2025.9422%2053.613%2025.5571C52.84%2023.0292%2051.5383%2020.5194%2049.8338%2018.2799C47.8544%2015.682%2045.3333%2013.5087%2042.5563%2011.9816Z'%20fill='%234945FF'/%3e%3c/svg%3e",
|
|
1175
|
+
`,_d="data:image/svg+xml,%3csvg%20width='63'%20height='63'%20viewBox='0%200%2063%2063'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.5563%2011.9816C39.484%2010.3071%2035.8575%209.29097%2032.3354%209.13521C28.6443%208.92888%2024.8295%209.72318%2021.3336%2011.4129C20.9123%2011.5901%2020.5376%2011.8101%2020.1722%2012.0249L20.0108%2012.1179C19.8774%2012.1951%2019.7441%2012.2724%2019.608%2012.3536C19.3253%2012.5146%2019.0492%2012.6744%2018.7544%2012.8792C18.5463%2013.0329%2018.3395%2013.1759%2018.1301%2013.323C17.5658%2013.7208%2016.9868%2014.1317%2016.4983%2014.5979C14.8476%2015.9524%2013.5571%2017.6075%2012.6071%2018.9214C10.4365%2022.1566%209.08622%2025.9567%208.80702%2029.6143L8.7764%2030.1588C8.73328%2030.9196%208.68476%2031.7057%208.75353%2032.4555C8.76648%2032.6084%208.7661%2032.7638%208.77506%2032.914C8.78895%2033.229%208.80152%2033.5373%208.846%2033.8672L9.07396%2035.4221C9.09756%2035.5764%209.1198%2035.7413%209.1633%2035.9263L9.65919%2037.9272L10.138%2039.2823C10.2729%2039.6673%2010.4158%2040.0751%2010.6%2040.43C12.0292%2043.637%2014.1425%2046.4578%2016.7063%2048.585C19.0508%2050.5296%2021.824%2052.0023%2024.7491%2052.8452L26.2371%2053.2376C26.3781%2053.2693%2026.4926%2053.2889%2026.6031%2053.3058L26.7775%2053.3311C27.0052%2053.3636%2027.2195%2053.3986%2027.4445%2053.435C27.8598%2053.5076%2028.2672%2053.5748%2028.7079%2053.6183L30.5641%2053.7229C30.9516%2053.7249%2031.3352%2053.7068%2031.7081%2053.6874C31.9039%2053.681%2032.0984%2053.6681%2032.3288%2053.662C34.5253%2053.4772%2036.5106%2053.0634%2038.0516%2052.4652C38.1769%2052.4171%2038.3008%2052.3796%2038.4234%2052.3355C38.6727%2052.2499%2038.9259%2052.167%2039.1432%2052.0599L40.8591%2051.2626L42.5702%2050.266C42.9009%2050.0682%2043.0205%2049.6414%2042.8282%2049.2984C42.632%2048.9526%2042.2034%2048.8308%2041.8634%2049.0166L40.1792%2049.9218L38.4995%2050.6224C38.3169%2050.6953%2038.121%2050.7534%2037.9224%2050.8155C37.7838%2050.8489%2037.6518%2050.8983%2037.5012%2050.9408C36.0711%2051.435%2034.2445%2051.7425%2032.244%2051.8346C32.0442%2051.8383%2031.8471%2051.8379%2031.654%2051.8403C31.3051%2051.8414%2030.9602%2051.8451%2030.6392%2051.8305L28.9177%2051.6725C28.5476%2051.619%2028.1695%2051.5427%2027.7848%2051.4678C27.5639%2051.4167%2027.3376%2051.3737%2027.1299%2051.3374L26.9529%2051.2987C26.8704%2051.2834%2026.7772%2051.2667%2026.7333%2051.2543L25.3466%2050.8322C22.7651%2049.9789%2020.33%2048.5729%2018.2942%2046.7557C16.1056%2044.7951%2014.3339%2042.2335%2013.1742%2039.3582C12.0276%2036.6013%2011.5988%2033.2792%2011.9716%2030.0076C12.3145%2027.0213%2013.3948%2024.1635%2015.1858%2021.5083C15.3034%2021.3339%2015.421%2021.1596%2015.5212%2021.0196C16.4309%2019.8688%2017.5408%2018.5589%2018.9483%2017.496C19.3367%2017.1525%2019.7862%2016.856%2020.2611%2016.5478C20.4878%2016.4009%2020.7079%2016.2553%2020.8907%2016.1306C21.0974%2016.0048%2021.3188%2015.8831%2021.5348%2015.7694C21.6761%2015.6975%2021.8162%2015.619%2021.9388%2015.5576L22.1002%2015.4646C22.4002%2015.3037%2022.6749%2015.1546%2022.9908%2015.039L24.1186%2014.5715C24.3399%2014.4844%2024.5718%2014.4159%2024.7997%2014.3447C24.953%2014.2982%2025.0982%2014.2635%2025.2635%2014.2078C25.786%2014.0182%2026.3283%2013.9112%2026.9105%2013.7965C27.117%2013.7571%2027.3302%2013.7163%2027.5608%2013.6585C27.7553%2013.611%2027.9737%2013.5969%2028.2082%2013.5762C28.364%2013.5603%2028.5172%2013.5483%2028.6318%2013.5333C28.7876%2013.5173%2028.9342%2013.5066%2029.0927%2013.4867C29.3285%2013.4555%2029.5456%2013.4347%2029.7494%2013.4337C30.0237%2013.44%2030.2994%2013.4357%2030.5777%2013.4274C31.0811%2013.421%2031.5579%2013.4197%2032.0318%2013.4914C34.9664%2013.7352%2037.7144%2014.6085%2040.2052%2016.0868C42.3489%2017.3655%2044.2716%2019.1525%2045.7607%2021.264C47.0255%2023.0628%2047.9756%2025.0528%2048.4928%2027.0393C48.572%2027.3176%2048.6299%2027.5931%2048.6839%2027.8659C48.7154%2028.0428%2048.7563%2028.2145%2048.7892%2028.3636C48.8037%2028.4541%2048.8208%2028.5406%2048.8445%2028.6258C48.8749%2028.7443%2048.8986%2028.864%2048.9116%2028.9651L48.9793%2029.6047C48.9922%2029.7748%2049.0132%2029.9331%2049.0301%2030.0887C49.0668%2030.3268%2049.0889%2030.5608%2049.0964%2030.7561L49.1083%2031.9001C49.1312%2032.3307%2049.089%2032.7116%2049.0522%2033.0673C49.0384%2033.2598%2049.0126%2033.4443%2049.0123%2033.5824C48.9961%2033.6926%2048.9918%2033.7935%2048.9836%2033.8917C48.9753%2034.0072%2048.9724%2034.1148%2048.9414%2034.2554L48.5449%2036.3059C48.3134%2037.8623%2049.3793%2039.3365%2050.9488%2039.5822C52.0417%2039.7601%2053.1536%2039.2819%2053.7711%2038.3664C54.0063%2038.0176%2054.1604%2037.6257%2054.2227%2037.2064L54.5217%2035.2574C54.5514%2035.0756%2054.572%2034.83%2054.5846%2034.5791L54.6028%2034.2338C54.6098%2034.0598%2054.6223%2033.8779%2054.6347%2033.6788C54.6734%2033.1052%2054.7163%2032.4479%2054.6619%2031.8058L54.5867%2030.4289C54.5622%2030.0952%2054.5097%2029.76%2054.4559%2029.4181C54.431%2029.2572%2054.4048%2029.0896%2054.3826%2028.9074L54.2687%2028.104C54.2332%2027.9244%2054.1804%2027.7273%2054.1329%2027.5396L54.0643%2027.2454C54.0195%2027.071%2053.9773%2026.8927%2053.9338%2026.7076C53.8455%2026.3309%2053.7479%2025.9422%2053.613%2025.5571C52.84%2023.0292%2051.5383%2020.5194%2049.8338%2018.2799C47.8544%2015.682%2045.3333%2013.5087%2042.5563%2011.9816Z'%20fill='%234945FF'/%3e%3c/svg%3e",Xi=b.forwardRef(({children:i,small:e=!1,...t},n)=>d.jsxs("div",{role:"alert","aria-live":"assertive",ref:n,...t,children:[d.jsx(nt,{children:i}),d.jsx(Ud,{src:_d,"aria-hidden":!0,$small:e})]})),Kd=m.keyframes`
|
|
1176
1176
|
from {
|
|
1177
1177
|
transform: rotate(0deg);
|
|
1178
1178
|
}
|
|
@@ -1183,14 +1183,14 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1183
1183
|
animation: ${Kd} 1s infinite linear;
|
|
1184
1184
|
will-change: transform;
|
|
1185
1185
|
${({$small:i,theme:e})=>i&&`width: ${e.spaces[6]}; height: ${e.spaces[6]};`}
|
|
1186
|
-
`;function
|
|
1186
|
+
`;function Rt(i,e,t){let n=t.initialDeps??[],r;function s(){var o,l,a,c;let h;t.key&&((o=t.debug)!=null&&o.call(t))&&(h=Date.now());const u=i();if(!(u.length!==n.length||u.some((p,x)=>n[x]!==p)))return r;n=u;let g;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(g=Date.now()),r=e(...u),t.key&&((a=t.debug)!=null&&a.call(t))){const p=Math.round((Date.now()-h)*100)/100,x=Math.round((Date.now()-g)*100)/100,w=x/16,y=(v,k)=>{for(v=String(v);v.length<k;)v=" "+v;return v};console.info(`%c⏱ ${y(x,5)} /${y(p,5)} ms`,`
|
|
1187
1187
|
font-size: .6rem;
|
|
1188
1188
|
font-weight: bold;
|
|
1189
|
-
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(c=t==null?void 0:t.onChange)==null||c.call(t,r),r}return s.updateDeps=o=>{n=o},s}function hs(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Gd=(i,e)=>Math.abs(i-e)<1.01,Yd=(i,e,t)=>{let n;return function(...r){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,r),t)}},cs=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Xd=i=>i,Jd=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let r=e;r<=t;r++)n.push(r);return n},Qd=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const r=o=>{const{width:l,height:a}=o;e({width:Math.round(l),height:Math.round(a)})};if(r(cs(t)),!n.ResizeObserver)return()=>{};const s=new n.ResizeObserver(o=>{const l=()=>{const a=o[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(cs(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return s.observe(t,{box:"border-box"}),()=>{s.unobserve(t)}},ds={passive:!0},us=typeof window>"u"?!0:"onscrollend"in window,Zd=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let r=0;const s=i.options.useScrollendEvent&&us?()=>{}:Yd(n,()=>{e(r,!1)},i.options.isScrollingResetDelay),o=h=>()=>{const{horizontal:u,isRtl:f}=i.options;r=u?t.scrollLeft*(f&&-1||1):t.scrollTop,s(),e(r,h)},l=o(!0),a=o(!1);a(),t.addEventListener("scroll",l,ds);const c=i.options.useScrollendEvent&&us;return c&&t.addEventListener("scrollend",a,ds),()=>{t.removeEventListener("scroll",l),c&&t.removeEventListener("scrollend",a)}},eu=(i,e,t)=>{if(e!=null&&e.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},tu=(i,{adjustments:e=0,behavior:t},n)=>{var r,s;const o=i+e;(s=(r=n.scrollElement)==null?void 0:r.scrollTo)==null||s.call(r,{[n.options.horizontal?"left":"top"]:o,behavior:t})};class iu{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(s=>{const o=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var r;(r=n())==null||r.disconnect(),t=null},observe:r=>{var s;return(s=n())==null?void 0:s.observe(r,{box:"border-box"})},unobserve:r=>{var s;return(s=n())==null?void 0:s.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,r])=>{typeof r>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Xd,rangeExtractor:Jd,onChange:()=>{},measureElement:eu,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var n,r;(r=(n=this.options).onChange)==null||r.call(n,this,t)},this.maybeNotify=At(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const r=new Map,s=new Map;for(let o=n-1;o>=0;o--){const l=t[o];if(r.has(l.lane))continue;const a=s.get(l.lane);if(a==null||l.end>a.end?s.set(l.lane,l):l.end<a.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((o,l)=>o.end===l.end?o.index-l.index:o.end-l.end)[0]:void 0},this.getMeasurementOptions=At(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,n,r,s,o)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:r,getItemKey:s,enabled:o}),{key:!1}),this.getMeasurements=At(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:r,getItemKey:s,enabled:o},l)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,a);for(let h=a;h<t;h++){const u=s(h),f=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h),g=f?f.end+this.options.gap:n+r,p=l.get(u),x=typeof p=="number"?p:this.options.estimateSize(h),w=g+x,y=f?f.lane:h%this.options.lanes;c[h]={index:h,start:g,size:x,end:w,key:u,lane:y}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=At(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,r,s)=>this.range=t.length>0&&n>0?nu({measurements:t,outerSize:n,scrollOffset:r,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=At(()=>{let t=null,n=null;const r=this.calculateRange();return r&&(t=r.startIndex,n=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,r,s,o)=>s===null||o===null?[]:t({startIndex:s,endIndex:o,overscan:n,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,r=t.getAttribute(n);return r?parseInt(r,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(t,n)=>{const r=this.indexFromElement(t),s=this.measurementsCache[r];if(!s)return;const o=s.key,l=this.elementsCache.get(o);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(o,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,n,this))},this.resizeItem=(t,n)=>{const r=this.measurementsCache[t];if(!r)return;const s=this.itemSizeCache.get(r.key)??r.size,o=n-s;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",o),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,n)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((n,r)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=At(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const r=[];for(let s=0,o=t.length;s<o;s++){const l=t[s],a=n[l];r.push(a)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return hs(n[il(0,n.length-1,r=>hs(n[r]).start,t)])},this.getOffsetForAlignment=(t,n,r=0)=>{const s=this.getSize(),o=this.getScrollOffset();n==="auto"&&(n=t>=o+s?"end":"start"),n==="center"?t+=(r-s)/2:n==="end"&&(t-=s);const l=this.getTotalSize()+this.options.scrollMargin-s;return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const s=this.getSize(),o=this.getScrollOffset();if(n==="auto")if(r.end>=o+s-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];const l=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,n,r.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:n="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,n),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:n="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let s=0;const o=10,l=c=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(t,c);if(!h){console.warn("Failed to get offset for index:",t);return}const[u,f]=h;this._scrollToOffset(u,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const g=this.getScrollOffset(),p=this.getOffsetForIndex(t,f);if(!p){console.warn("Failed to get offset for index:",t);return}Gd(p[0],g)||a(f)})},a=c=>{this.targetWindow&&(s++,s<o?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,o),this.targetWindow.requestAnimationFrame(()=>l(c))):console.warn(`Failed to scroll to index ${t} after ${o} attempts.`))};l(n)},this.scrollBy=(t,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let r;if(n.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=n[n.length-1])==null?void 0:t.end)??0;else{const s=Array(this.options.lanes).fill(null);let o=n.length-1;for(;o>=0&&s.some(l=>l===null);){const l=n[o];s[l.lane]===null&&(s[l.lane]=l.end),o--}r=Math.max(...s.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const il=(i,e,t,n)=>{for(;i<=e;){const r=(i+e)/2|0,s=t(r);if(s<n)i=r+1;else if(s>n)e=r-1;else return r}return i>0?i-1:0};function nu({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const r=i.length-1,s=a=>i[a].start;if(i.length<=n)return{startIndex:0,endIndex:r};let o=il(0,r,s,t),l=o;if(n===1)for(;l<r&&i[l].end<t+e;)l++;else if(n>1){const a=Array(n).fill(0);for(;l<r&&a.some(h=>h<t+e);){const h=i[l];a[h.lane]=h.end,l++}const c=Array(n).fill(t+e);for(;o>=0&&c.some(h=>h>=t);){const h=i[o];c[h.lane]=h.start,o--}o=Math.max(0,o-o%n),l=Math.min(r,l+(n-1-l%n))}return{startIndex:o,endIndex:l}}const fs=typeof document<"u"?b.useLayoutEffect:b.useEffect;function ru(i){const e=b.useReducer(()=>({}),{})[1],t={...i,onChange:(r,s)=>{var o;s?po.flushSync(e):e(),(o=i.onChange)==null||o.call(i,r,s)}},[n]=b.useState(()=>new iu(t));return n.setOptions(t),fs(()=>n._didMount(),[]),fs(()=>n._willUpdate()),n}function su(i){return ru({observeElementRect:Qd,observeElementOffset:Zd,scrollToFn:tu,...i})}const ou=Se((i,e)=>{const{gap:t=0,gridCols:n=12,...r}=i;return d.jsx(lu,{ref:e,$gap:t,$gridCols:n,...r})}),lu=m.styled(A)`
|
|
1189
|
+
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(c=t==null?void 0:t.onChange)==null||c.call(t,r),r}return s.updateDeps=o=>{n=o},s}function ds(i,e){if(i===void 0)throw new Error("Unexpected undefined");return i}const Gd=(i,e)=>Math.abs(i-e)<1.01,Yd=(i,e,t)=>{let n;return function(...r){i.clearTimeout(n),n=i.setTimeout(()=>e.apply(this,r),t)}},us=i=>{const{offsetWidth:e,offsetHeight:t}=i;return{width:e,height:t}},Xd=i=>i,Jd=i=>{const e=Math.max(i.startIndex-i.overscan,0),t=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let r=e;r<=t;r++)n.push(r);return n},Qd=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;const r=o=>{const{width:l,height:a}=o;e({width:Math.round(l),height:Math.round(a)})};if(r(us(t)),!n.ResizeObserver)return()=>{};const s=new n.ResizeObserver(o=>{const l=()=>{const a=o[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(us(t))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return s.observe(t,{box:"border-box"}),()=>{s.unobserve(t)}},fs={passive:!0},gs=typeof window>"u"?!0:"onscrollend"in window,Zd=(i,e)=>{const t=i.scrollElement;if(!t)return;const n=i.targetWindow;if(!n)return;let r=0;const s=i.options.useScrollendEvent&&gs?()=>{}:Yd(n,()=>{e(r,!1)},i.options.isScrollingResetDelay),o=h=>()=>{const{horizontal:u,isRtl:f}=i.options;r=u?t.scrollLeft*(f&&-1||1):t.scrollTop,s(),e(r,h)},l=o(!0),a=o(!1);a(),t.addEventListener("scroll",l,fs);const c=i.options.useScrollendEvent&&gs;return c&&t.addEventListener("scrollend",a,fs),()=>{t.removeEventListener("scroll",l),c&&t.removeEventListener("scrollend",a)}},eu=(i,e,t)=>{if(e!=null&&e.borderBoxSize){const n=e.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}return i[t.options.horizontal?"offsetWidth":"offsetHeight"]},tu=(i,{adjustments:e=0,behavior:t},n)=>{var r,s;const o=i+e;(s=(r=n.scrollElement)==null?void 0:r.scrollTo)==null||s.call(r,{[n.options.horizontal?"left":"top"]:o,behavior:t})};class iu{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(s=>{const o=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var r;(r=n())==null||r.disconnect(),t=null},observe:r=>{var s;return(s=n())==null?void 0:s.observe(r,{box:"border-box"})},unobserve:r=>{var s;return(s=n())==null?void 0:s.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([n,r])=>{typeof r>"u"&&delete t[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Xd,rangeExtractor:Jd,onChange:()=>{},measureElement:eu,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var n,r;(r=(n=this.options).onChange)==null||r.call(n,this,t)},this.maybeNotify=Rt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,n)=>{const r=new Map,s=new Map;for(let o=n-1;o>=0;o--){const l=t[o];if(r.has(l.lane))continue;const a=s.get(l.lane);if(a==null||l.end>a.end?s.set(l.lane,l):l.end<a.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((o,l)=>o.end===l.end?o.index-l.index:o.end-l.end)[0]:void 0},this.getMeasurementOptions=Rt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,n,r,s,o)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:n,scrollMargin:r,getItemKey:s,enabled:o}),{key:!1}),this.getMeasurements=Rt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:n,scrollMargin:r,getItemKey:s,enabled:o},l)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,a);for(let h=a;h<t;h++){const u=s(h),f=this.options.lanes===1?c[h-1]:this.getFurthestMeasurement(c,h),g=f?f.end+this.options.gap:n+r,p=l.get(u),x=typeof p=="number"?p:this.options.estimateSize(h),w=g+x,y=f?f.lane:h%this.options.lanes;c[h]={index:h,start:g,size:x,end:w,key:u,lane:y}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Rt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,r,s)=>this.range=t.length>0&&n>0?nu({measurements:t,outerSize:n,scrollOffset:r,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Rt(()=>{let t=null,n=null;const r=this.calculateRange();return r&&(t=r.startIndex,n=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,r,s,o)=>s===null||o===null?[]:t({startIndex:s,endIndex:o,overscan:n,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,r=t.getAttribute(n);return r?parseInt(r,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(t,n)=>{const r=this.indexFromElement(t),s=this.measurementsCache[r];if(!s)return;const o=s.key,l=this.elementsCache.get(o);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(o,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,n,this))},this.resizeItem=(t,n)=>{const r=this.measurementsCache[t];if(!r)return;const s=this.itemSizeCache.get(r.key)??r.size,o=n-s;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",o),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,n)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((n,r)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=Rt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const r=[];for(let s=0,o=t.length;s<o;s++){const l=t[s],a=n[l];r.push(a)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length!==0)return ds(n[nl(0,n.length-1,r=>ds(n[r]).start,t)])},this.getOffsetForAlignment=(t,n,r=0)=>{const s=this.getSize(),o=this.getScrollOffset();n==="auto"&&(n=t>=o+s?"end":"start"),n==="center"?t+=(r-s)/2:n==="end"&&(t-=s);const l=this.getTotalSize()+this.options.scrollMargin-s;return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const s=this.getSize(),o=this.getScrollOffset();if(n==="auto")if(r.end>=o+s-this.options.scrollPaddingEnd)n="end";else if(r.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];const l=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,n,r.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:n="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,n),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:n="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let s=0;const o=10,l=c=>{if(!this.targetWindow)return;const h=this.getOffsetForIndex(t,c);if(!h){console.warn("Failed to get offset for index:",t);return}const[u,f]=h;this._scrollToOffset(u,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const g=this.getScrollOffset(),p=this.getOffsetForIndex(t,f);if(!p){console.warn("Failed to get offset for index:",t);return}Gd(p[0],g)||a(f)})},a=c=>{this.targetWindow&&(s++,s<o?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,o),this.targetWindow.requestAnimationFrame(()=>l(c))):console.warn(`Failed to scroll to index ${t} after ${o} attempts.`))};l(n)},this.scrollBy=(t,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let r;if(n.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=n[n.length-1])==null?void 0:t.end)??0;else{const s=Array(this.options.lanes).fill(null);let o=n.length-1;for(;o>=0&&s.some(l=>l===null);){const l=n[o];s[l.lane]===null&&(s[l.lane]=l.end),o--}r=Math.max(...s.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:n,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const nl=(i,e,t,n)=>{for(;i<=e;){const r=(i+e)/2|0,s=t(r);if(s<n)i=r+1;else if(s>n)e=r-1;else return r}return i>0?i-1:0};function nu({measurements:i,outerSize:e,scrollOffset:t,lanes:n}){const r=i.length-1,s=a=>i[a].start;if(i.length<=n)return{startIndex:0,endIndex:r};let o=nl(0,r,s,t),l=o;if(n===1)for(;l<r&&i[l].end<t+e;)l++;else if(n>1){const a=Array(n).fill(0);for(;l<r&&a.some(h=>h<t+e);){const h=i[l];a[h.lane]=h.end,l++}const c=Array(n).fill(t+e);for(;o>=0&&c.some(h=>h>=t);){const h=i[o];c[h.lane]=h.start,o--}o=Math.max(0,o-o%n),l=Math.min(r,l+(n-1-l%n))}return{startIndex:o,endIndex:l}}const ps=typeof document<"u"?b.useLayoutEffect:b.useEffect;function ru(i){const e=b.useReducer(()=>({}),{})[1],t={...i,onChange:(r,s)=>{var o;s?bo.flushSync(e):e(),(o=i.onChange)==null||o.call(i,r,s)}},[n]=b.useState(()=>new iu(t));return n.setOptions(t),ps(()=>n._didMount(),[]),ps(()=>n._willUpdate()),n}function su(i){return ru({observeElementRect:Qd,observeElementOffset:Zd,scrollToFn:tu,...i})}const ou=Ae((i,e)=>{const{gap:t=0,gridCols:n=12,...r}=i;return d.jsx(lu,{ref:e,$gap:t,$gridCols:n,...r})}),lu=m.styled(A)`
|
|
1190
1190
|
display: grid;
|
|
1191
1191
|
grid-template-columns: repeat(${({$gridCols:i})=>i}, 1fr);
|
|
1192
|
-
${({theme:i,$gap:e})=>
|
|
1193
|
-
`,au=
|
|
1192
|
+
${({theme:i,$gap:e})=>xt({gap:e},i)}
|
|
1193
|
+
`,au=Ae(({col:i,s:e,xs:t,m:n,...r},s)=>d.jsx(hu,{ref:s,$col:i,$s:e,$xs:t,$m:n,...r})),hu=m.styled(T)`
|
|
1194
1194
|
grid-column: span ${({$xs:i,$col:e})=>i??e??12};
|
|
1195
1195
|
max-width: 100%;
|
|
1196
1196
|
|
|
@@ -1205,7 +1205,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1205
1205
|
${({theme:i})=>i.breakpoints.large} {
|
|
1206
1206
|
grid-column: span ${({$col:i,$m:e,$s:t,$xs:n})=>i??e??t??n??12};
|
|
1207
1207
|
}
|
|
1208
|
-
`,cu=Object.freeze(Object.defineProperty({__proto__:null,Item:au,Root:ou},Symbol.toStringTag,{value:"Module"})),du=({children:i,estimatedItemSize:e=40,overscan:t=10,itemCount:n,renderItem:r})=>{const s=
|
|
1208
|
+
`,cu=Object.freeze(Object.defineProperty({__proto__:null,Item:au,Root:ou},Symbol.toStringTag,{value:"Module"})),du=({children:i,estimatedItemSize:e=40,overscan:t=10,itemCount:n,renderItem:r})=>{const s=xe.useRef(null),[o,l]=xe.useState(!1),a=xe.useRef(!0);xe.useEffect(()=>(a.current=!0,typeof xe.startTransition=="function"&&xe.startTransition(()=>{a.current&&l(!0)}),()=>{a.current=!1}),[]);const c=xe.useMemo(()=>r&&n!==void 0?[]:xe.Children.toArray(i),[i,r,n]),h=n??c.length,u=su({count:h,getScrollElement:()=>s.current??null,estimateSize:xe.useCallback(()=>e,[e]),overscan:t,scrollMargin:0,measureElement:void 0,lanes:1}),f=o&&a.current?u.getVirtualItems():[];return o?d.jsx(A,{ref:s,height:`${u.getTotalSize()>0?u.getTotalSize():0}px`,width:"100%",position:"relative","data-testid":"virtualized-list",style:{willChange:"transform"},children:f.map(g=>{const p=r?r(g.index):c[g.index];return d.jsx(A,{"data-index":g.index,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translate3d(0, ${g.start}px, 0)`},children:p},g.key)})}):d.jsx(A,{ref:s,height:"40px",width:"100%",position:"relative"})},rl=b.forwardRef(({allowCustomValue:i,autocomplete:e,children:t,className:n,clearLabel:r="Clear",creatable:s=!1,creatableDisabled:o=!1,creatableStartIcon:l,createMessage:a=be=>`Create "${be}"`,defaultFilterValue:c,defaultTextValue:h,defaultOpen:u=!1,open:f,onOpenChange:g,disabled:p=!1,hasError:x,id:w,filterValue:y,hasMoreItems:v=!1,isPrintableCharacter:k,loading:S=!1,loadingMessage:$="Loading content...",name:C,noOptionsMessage:R=()=>"No results found",onChange:L,onClear:I,onCreateOption:P,onFilterValueChange:ne,onInputChange:_,onTextValueChange:K,onLoadMore:Q,placeholder:F="Select or enter a value",required:ae=!1,size:B="M",startIcon:H,textValue:me,value:oe,...Te},he)=>{const[be,Z]=Pe({prop:f,defaultProp:u,onChange:g}),[ce,Fe]=Pe({prop:me,defaultProp:i&&!h?oe:h,onChange:K}),[ht,ct]=Pe({prop:y,defaultProp:c,onChange:ne}),Ue=b.useRef(null),Tt=b.useRef(null),dt=Ce(Ue,he),Xt=b.useRef(null),Jt=Re=>{I&&!p&&(Fe(""),ct(""),I(Re),Ue.current.focus())},ut=Re=>{Z(Re)},ee=Re=>{Fe(Re)},At=Re=>{ct(Re)},Qt=Re=>{_&&_(Re)},th=Re=>{L&&L(Re)},ih=Re=>{Q&&v&&!S&&Q(Re)},Xr=()=>{P&&ce&&s!=="visible"?P(ce):P&&s==="visible"&&(P(),Z(!1))},nh=ke(),Jr=`intersection-${Lt(nh)}`;vi(Tt,ih,{selectorToWatch:`#${Jr}`,skipWhen:!be});const{error:xn,...Ri}=$e("Combobox"),rh=!!xn||x,yn=Ri.id??w,sh=Ri.name??C,oh=Ri.required||ae,Qr=b.Children.toArray(t).filter(Boolean).length,lh=!!!(ce&&ce!==""||ht&&ht!=="")&&Qr>100;let wn;return xn?wn=`${yn}-error`:Ri.hint&&(wn=`${yn}-hint`),d.jsxs(E.Combobox.Root,{autocomplete:e||(s===!0?"list":"both"),onOpenChange:ut,open:be,onTextValueChange:ee,textValue:ce,allowCustomValue:!!s||i,disabled:p,required:oh,value:oe,onValueChange:th,filterValue:ht,onFilterValueChange:At,isPrintableCharacter:k,visible:s==="visible",children:[d.jsxs(uu,{$hasError:rh,$size:B,$hasTextValue:!!ce,$hasClear:!!(ce&&I),className:n,children:[d.jsxs(T,{flex:"1",tag:"span",gap:3,children:[H?d.jsx(T,{flex:"0 0 1.6rem",tag:"span","aria-hidden":!0,children:H}):null,d.jsx(fu,{placeholder:F,id:yn,"aria-invalid":!!xn,onChange:Qt,ref:dt,name:sh,"aria-describedby":wn,...Te})]}),d.jsxs(T,{tag:"span",gap:3,children:[ce&&I?d.jsx(et,{size:"XS",variant:"ghost",onClick:Jt,"aria-disabled":p,"aria-label":r,label:r,ref:Xt,children:d.jsx(z.Cross,{})}):null,S?d.jsx(Xi,{small:!0,children:"Loading"}):d.jsx(gu,{children:d.jsx(z.CaretDown,{fill:"neutral500"})})]})]}),d.jsx(E.Combobox.Portal,{children:d.jsxs(pu,{sideOffset:4,children:[d.jsx(ki,{viewportRef:Tt,children:d.jsx(E.Combobox.Viewport,{children:d.jsxs(A,{padding:1,children:[lh?d.jsx(du,{itemCount:Qr,children:t}):t,s!==!0&&!S?d.jsx(E.Combobox.NoValueFound,{asChild:!0,children:d.jsx(Bn,{$hasHover:!1,children:d.jsx(O,{children:R(ce??"")})})}):null,S?d.jsx(T,{justifyContent:"center",alignItems:"center",paddingTop:2,paddingBottom:2,children:d.jsx(Xi,{small:!0,children:$})}):null,d.jsx(A,{id:Jr,width:"100%",height:"1px"})]})})}),s?d.jsx(mu,{onPointerUp:Xr,onClick:Xr,disabled:o,asChild:!0,children:d.jsx(Bn,{children:d.jsxs(T,{gap:2,children:[l&&d.jsx(A,{tag:"span","aria-hidden":!0,display:"inline-flex",children:l}),d.jsx(O,{children:a(ce??"")})]})})}):null]})})]})}),uu=m.styled(E.Combobox.Trigger)`
|
|
1209
1209
|
position: relative;
|
|
1210
1210
|
border: 1px solid ${({theme:i,$hasError:e})=>e?i.colors.danger600:i.colors.neutral200};
|
|
1211
1211
|
border-radius: ${({theme:i})=>i.borderRadius};
|
|
@@ -1217,7 +1217,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1217
1217
|
gap: ${({theme:i})=>i.spaces[4]};
|
|
1218
1218
|
padding-inline-start: ${({theme:i})=>i.spaces[4]};
|
|
1219
1219
|
padding-inline-end: ${({theme:i})=>i.spaces[3]};
|
|
1220
|
-
${({$size:i,$hasTextValue:e,$hasClear:t,theme:n})=>
|
|
1220
|
+
${({$size:i,$hasTextValue:e,$hasClear:t,theme:n})=>Rr({$size:i||"M",$hasValue:e||!1,$hasClear:t||!1,theme:n})}
|
|
1221
1221
|
|
|
1222
1222
|
&[data-disabled] {
|
|
1223
1223
|
color: ${({theme:i})=>i.colors.neutral600};
|
|
@@ -1230,10 +1230,10 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1230
1230
|
outline: none;
|
|
1231
1231
|
}
|
|
1232
1232
|
|
|
1233
|
-
${({theme:i,$hasError:e})=>
|
|
1234
|
-
`,fu=m.styled(
|
|
1233
|
+
${({theme:i,$hasError:e})=>rt()({theme:i,$hasError:e})};
|
|
1234
|
+
`,fu=m.styled(E.Combobox.TextInput)`
|
|
1235
1235
|
width: 100%;
|
|
1236
|
-
${
|
|
1236
|
+
${il}
|
|
1237
1237
|
color: ${({theme:i})=>i.colors.neutral800};
|
|
1238
1238
|
padding: 0;
|
|
1239
1239
|
border: none;
|
|
@@ -1252,7 +1252,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1252
1252
|
&[aria-disabled='true'] {
|
|
1253
1253
|
cursor: inherit;
|
|
1254
1254
|
}
|
|
1255
|
-
`,gu=m.styled(
|
|
1255
|
+
`,gu=m.styled(E.Combobox.Icon)`
|
|
1256
1256
|
border: none;
|
|
1257
1257
|
background: transparent;
|
|
1258
1258
|
padding: 0;
|
|
@@ -1262,7 +1262,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1262
1262
|
&[aria-disabled='true'] {
|
|
1263
1263
|
cursor: inherit;
|
|
1264
1264
|
}
|
|
1265
|
-
`,pu=m.styled(
|
|
1265
|
+
`,pu=m.styled(E.Combobox.Content)`
|
|
1266
1266
|
background: ${({theme:i})=>i.colors.neutral0};
|
|
1267
1267
|
box-shadow: ${({theme:i})=>i.shadows.filterShadow};
|
|
1268
1268
|
border: 1px solid ${({theme:i})=>i.colors.neutral150};
|
|
@@ -1293,7 +1293,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1293
1293
|
}
|
|
1294
1294
|
}
|
|
1295
1295
|
}
|
|
1296
|
-
`,mu=m.styled(
|
|
1296
|
+
`,mu=m.styled(E.Combobox.CreateItem)`
|
|
1297
1297
|
&& {
|
|
1298
1298
|
border-top: 1px solid ${({theme:i})=>i.colors.neutral150};
|
|
1299
1299
|
border-top-left-radius: 0;
|
|
@@ -1327,7 +1327,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1327
1327
|
&&[data-disabled] > div {
|
|
1328
1328
|
background-color: inherit;
|
|
1329
1329
|
}
|
|
1330
|
-
`,
|
|
1330
|
+
`,sl=b.forwardRef(({children:i,value:e,disabled:t,textValue:n,...r},s)=>d.jsx(E.Combobox.ComboboxItem,{asChild:!0,value:e,disabled:t,textValue:n,children:d.jsx(Bn,{ref:s,...r,children:d.jsx(E.Combobox.ItemText,{asChild:!0,children:d.jsx(O,{children:i})})})})),Bn=m.styled.div`
|
|
1331
1331
|
width: 100%;
|
|
1332
1332
|
border: none;
|
|
1333
1333
|
text-align: left;
|
|
@@ -1353,8 +1353,8 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1353
1353
|
color: ${({theme:i})=>i.colors.primary600};
|
|
1354
1354
|
font-weight: bold;
|
|
1355
1355
|
}
|
|
1356
|
-
`,
|
|
1357
|
-
background: ${i=>
|
|
1356
|
+
`,Dr=(i,e)=>`${i}${Math.floor(e*255).toString(16).padStart(2,"0")}`,bu=it.Root,xu=b.forwardRef((i,e)=>d.jsx(it.Trigger,{...i,asChild:!0,ref:e})),yu=b.forwardRef((i,e)=>d.jsx(it.Portal,{children:d.jsx(wu,{children:d.jsx(vu,{ref:e,...i})})})),wu=m.styled(it.Overlay)`
|
|
1357
|
+
background: ${i=>Dr(i.theme.colors.neutral800,.2)};
|
|
1358
1358
|
position: fixed;
|
|
1359
1359
|
inset: 0;
|
|
1360
1360
|
z-index: ${i=>i.theme.zIndices.overlay};
|
|
@@ -1364,7 +1364,7 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1364
1364
|
animation: ${ie.overlayFadeIn} ${i=>i.theme.motion.timings[200]}
|
|
1365
1365
|
${i=>i.theme.motion.easings.authenticMotion};
|
|
1366
1366
|
}
|
|
1367
|
-
`,vu=m.styled(
|
|
1367
|
+
`,vu=m.styled(it.Content)`
|
|
1368
1368
|
max-width: 42rem;
|
|
1369
1369
|
height: min-content;
|
|
1370
1370
|
width: calc(100% - ${({theme:i})=>i.spaces[8]});
|
|
@@ -1396,14 +1396,14 @@ const myCustomTheme = extendTheme(lightTheme, {
|
|
|
1396
1396
|
animation-name: ${ie.modalPopOut};
|
|
1397
1397
|
}
|
|
1398
1398
|
}
|
|
1399
|
-
`,Su=b.forwardRef(({children:i,...e},t)=>d.jsx(
|
|
1399
|
+
`,Su=b.forwardRef(({children:i,...e},t)=>d.jsx(it.Title,{asChild:!0,children:d.jsx(Cu,{tag:"h2",variant:"beta",ref:t,padding:6,fontWeight:"bold",...e,children:i})})),Cu=m.styled(O)`
|
|
1400
1400
|
display: flex;
|
|
1401
1401
|
justify-content: center;
|
|
1402
1402
|
border-bottom: solid 1px ${i=>i.theme.colors.neutral150};
|
|
1403
|
-
`,ku=b.forwardRef(({children:i,icon:e,...t},n)=>d.jsx(T,{ref:n,gap:2,direction:"column",paddingTop:8,paddingBottom:8,paddingLeft:6,paddingRight:6,...t,children:typeof i=="string"?d.jsxs(d.Fragment,{children:[e?b.cloneElement(e,{width:24,height:24}):null,d.jsx(ol,{children:i})]}):i})),ol=b.forwardRef((i,e)=>d.jsx(
|
|
1403
|
+
`,ku=b.forwardRef(({children:i,icon:e,...t},n)=>d.jsx(T,{ref:n,gap:2,direction:"column",paddingTop:8,paddingBottom:8,paddingLeft:6,paddingRight:6,...t,children:typeof i=="string"?d.jsxs(d.Fragment,{children:[e?b.cloneElement(e,{width:24,height:24}):null,d.jsx(ol,{children:i})]}):i})),ol=b.forwardRef((i,e)=>d.jsx(it.Description,{asChild:!0,children:d.jsx(O,{ref:e,variant:"omega",...i,tag:"p"})})),$u=b.forwardRef((i,e)=>d.jsx(Tu,{ref:e,gap:2,padding:4,justifyContent:"space-between",...i,tag:"footer"})),Tu=m.styled(T)`
|
|
1404
1404
|
border-top: solid 1px ${i=>i.theme.colors.neutral150};
|
|
1405
1405
|
flex: 1;
|
|
1406
|
-
`,Au=b.forwardRef((i,e)=>d.jsx(
|
|
1406
|
+
`,Au=b.forwardRef((i,e)=>d.jsx(it.Cancel,{...i,asChild:!0,ref:e})),Ru=b.forwardRef((i,e)=>d.jsx(it.Action,{...i,asChild:!0,ref:e})),Du=Object.freeze(Object.defineProperty({__proto__:null,Action:Ru,Body:ku,Cancel:Au,Content:yu,Description:ol,Footer:$u,Header:Su,Root:bu,Trigger:xu},Symbol.toStringTag,{value:"Module"}));function He(i,e){const t=b.useRef(null);return e&&t.current&&Mu(e,t.current)&&(e=t.current),t.current=e??null,b.useMemo(()=>new J.DateFormatter(i,e),[i,e])}function Mu(i,e){if(i===e)return!0;const t=Object.keys(i),n=Object.keys(e);if(t.length!==n.length)return!1;for(const r of t)if(e[r]!==i[r])return!1;return!0}const jt={Log:"live-region-log",Status:"live-region-status",Alert:"live-region-alert"},ms=i=>{const e=document.querySelector(`#${jt.Log}`);e&&(e.innerText=i)},bs=i=>{const e=document.querySelector(`#${jt.Status}`);e&&(e.innerText=i)},xs=i=>{const e=document.querySelector(`#${jt.Alert}`);e&&(e.innerText=i)},Ou=()=>(b.useEffect(()=>()=>{ms(""),xs(""),bs("")},[]),{notifyLog:ms,notifyAlert:xs,notifyStatus:bs}),ll=()=>d.jsxs(nt,{children:[d.jsx("p",{role:"log","aria-live":"polite",id:jt.Log,"aria-relevant":"all"}),d.jsx("p",{role:"status","aria-live":"polite",id:jt.Status,"aria-relevant":"all"}),d.jsx("p",{role:"alert","aria-live":"assertive",id:jt.Alert,"aria-relevant":"all"})]}),ju=m.createGlobalStyle`
|
|
1407
1407
|
${m.css`
|
|
1408
1408
|
*,
|
|
1409
1409
|
*::before,
|
|
@@ -1502,7 +1502,7 @@ ${m.css`
|
|
|
1502
1502
|
overflow-y: hidden;
|
|
1503
1503
|
}
|
|
1504
1504
|
`}
|
|
1505
|
-
`,
|
|
1505
|
+
`,ys="en-EN",al=()=>typeof navigator>"u"?ys:navigator.language?navigator.language:ys,[Eu,$i]=Kt("StrapiDesignSystem",{locale:al()}),Iu=({children:i,locale:e=al(),theme:t=Tr,tooltipConfig:n})=>(Le(()=>{const r=document.createElement("style");r.type="text/css",r.appendChild(document.createTextNode(`
|
|
1506
1506
|
* {
|
|
1507
1507
|
-webkit-transition: none !important;
|
|
1508
1508
|
-moz-transition: none !important;
|
|
@@ -1511,7 +1511,7 @@ ${m.css`
|
|
|
1511
1511
|
transition: none !important;
|
|
1512
1512
|
animation: none !important;
|
|
1513
1513
|
}
|
|
1514
|
-
`)),document.head.appendChild(r),window.getComputedStyle(r).opacity,document.head.removeChild(r)},[t]),d.jsx(Eu,{locale:e,children:d.jsxs(m.ThemeProvider,{theme:t,children:[d.jsx(
|
|
1514
|
+
`)),document.head.appendChild(r),window.getComputedStyle(r).opacity,document.head.removeChild(r)},[t]),d.jsx(Eu,{locale:e,children:d.jsxs(m.ThemeProvider,{theme:t,children:[d.jsx(mo.Provider,{...n,children:i}),d.jsx(ll,{}),d.jsx(ju,{})]})})),hl=$h.Root,Mr=b.forwardRef(({container:i=(n=>(n=globalThis==null?void 0:globalThis.document)==null?void 0:n.body)(),...e},t)=>i?bo.createPortal(d.jsx(A,{ref:t,...e}),i):null);Mr.displayName="Portal";const Pu=b.forwardRef(({onClear:i,clearLabel:e="Clear",startIcon:t,disabled:n,hasError:r,loading:s,children:o,id:l,size:a="M",withTags:c,...h},u)=>{const f=b.useRef(null),g=w=>{i&&!n&&(i(w),f.current.focus())},{labelNode:p}=$e("SelectTrigger"),x=Ce(f,u);return d.jsx(E.Select.Trigger,{asChild:!0,children:d.jsxs(Lu,{"aria-disabled":n,$hasError:r,ref:x,alignItems:"center",justifyContent:"space-between",position:"relative",overflow:"hidden",hasRadius:!0,background:n?"neutral150":"neutral0",gap:4,cursor:"default","aria-labelledby":p?`${l}-label`:void 0,$size:a,$withTags:c,$hasClear:!!i,...h,children:[d.jsxs(T,{flex:"1",tag:"span",gap:3,overflow:"hidden",children:[t&&d.jsx(T,{tag:"span","aria-hidden":!0,children:t}),o]}),d.jsxs(T,{tag:"span",gap:3,children:[i?d.jsx(et,{size:"XS",variant:"ghost",onClick:g,"aria-disabled":n,"aria-label":e,label:e,children:d.jsx(z.Cross,{})}):null,s?d.jsx(Xi,{small:!0,children:"Loading"}):d.jsx(Bu,{children:d.jsx(z.CaretDown,{})})]})]})})}),Lu=m.styled(T)`
|
|
1515
1515
|
border: 1px solid ${({theme:i,$hasError:e})=>e?i.colors.danger600:i.colors.neutral200};
|
|
1516
1516
|
padding-inline-start: ${({theme:i})=>i.spaces[4]};
|
|
1517
1517
|
padding-inline-end: ${({theme:i})=>i.spaces[3]};
|
|
@@ -1524,7 +1524,7 @@ ${m.css`
|
|
|
1524
1524
|
padding-inline-start: 0.3rem;
|
|
1525
1525
|
padding-block: 0.3rem;
|
|
1526
1526
|
}
|
|
1527
|
-
`:
|
|
1527
|
+
`:Rr({$size:i||"M",$hasValue:e,$hasClear:e,theme:n})}
|
|
1528
1528
|
cursor: pointer;
|
|
1529
1529
|
|
|
1530
1530
|
&[aria-disabled='true'] {
|
|
@@ -1536,8 +1536,8 @@ ${m.css`
|
|
|
1536
1536
|
outline: none;
|
|
1537
1537
|
}
|
|
1538
1538
|
|
|
1539
|
-
${({theme:i,$hasError:e})=>
|
|
1540
|
-
`,Bu=m.styled(
|
|
1539
|
+
${({theme:i,$hasError:e})=>rt()({theme:i,$hasError:e})};
|
|
1540
|
+
`,Bu=m.styled(E.Select.Icon)`
|
|
1541
1541
|
display: flex;
|
|
1542
1542
|
& > svg {
|
|
1543
1543
|
fill: ${({theme:i})=>i.colors.neutral500};
|
|
@@ -1549,13 +1549,13 @@ ${m.css`
|
|
|
1549
1549
|
${({theme:i})=>i.breakpoints.medium} {
|
|
1550
1550
|
min-height: 2.2rem;
|
|
1551
1551
|
}
|
|
1552
|
-
`,Fu=m.styled(
|
|
1552
|
+
`,Fu=m.styled(E.Select.Value)`
|
|
1553
1553
|
${({$withTags:i})=>i?m.css`
|
|
1554
1554
|
display: flex;
|
|
1555
1555
|
flex-wrap: wrap;
|
|
1556
1556
|
gap: ${({theme:e})=>e.spaces[1]};
|
|
1557
1557
|
`:null};
|
|
1558
|
-
`,Wu=b.forwardRef((i,e)=>d.jsx(Hu,{ref:e,...i,children:d.jsx(
|
|
1558
|
+
`,Wu=b.forwardRef((i,e)=>d.jsx(Hu,{ref:e,...i,children:d.jsx(ki,{children:i.children})})),Hu=m.styled(E.Select.Content)`
|
|
1559
1559
|
background: ${({theme:i})=>i.colors.neutral0};
|
|
1560
1560
|
box-shadow: ${({theme:i})=>i.shadows.filterShadow};
|
|
1561
1561
|
border: 1px solid ${({theme:i})=>i.colors.neutral150};
|
|
@@ -1580,7 +1580,7 @@ ${m.css`
|
|
|
1580
1580
|
}
|
|
1581
1581
|
}
|
|
1582
1582
|
}
|
|
1583
|
-
`,Vu=m.styled(
|
|
1583
|
+
`,Vu=m.styled(E.Select.Viewport)`
|
|
1584
1584
|
padding: ${({theme:i})=>i.spaces[1]};
|
|
1585
1585
|
`,qu=b.forwardRef((i,e)=>d.jsx(Ku,{ref:e,...i})),_u=m.css`
|
|
1586
1586
|
width: 100%;
|
|
@@ -1603,18 +1603,18 @@ ${m.css`
|
|
|
1603
1603
|
background-color: ${({theme:i})=>i.colors.primary100};
|
|
1604
1604
|
cursor: pointer;
|
|
1605
1605
|
}
|
|
1606
|
-
`,Ku=m.styled(
|
|
1606
|
+
`,Ku=m.styled(E.Select.Item)`
|
|
1607
1607
|
${_u}
|
|
1608
1608
|
|
|
1609
1609
|
&:hover {
|
|
1610
1610
|
background-color: ${({theme:i})=>i.colors.primary100};
|
|
1611
1611
|
cursor: pointer;
|
|
1612
1612
|
}
|
|
1613
|
-
`,cl=
|
|
1613
|
+
`,cl=E.Select.Root,dl=Pu,ul=zu,fl=E.Select.Portal,gl=Wu,pl=Vu,Or=qu,ml=E.Select.ItemIndicator,bl=E.Select.ItemText,Uu=E.Select.Group,zn=b.forwardRef(({children:i,clearLabel:e="Clear",customizeContent:t,disabled:n,hasError:r,id:s,loading:o,name:l,onChange:a,onClear:c,onCloseAutoFocus:h,onReachEnd:u,placeholder:f,required:g,size:p,startIcon:x,value:w,...y},v)=>{const[k,S]=b.useState(),[$,C]=b.useState(!1),R=he=>{C(he)},L=he=>{c&&c(he),a||S("")},I=he=>{a?a(typeof w=="number"?Number(he):he):S(he)},P=b.useRef(null),ne=ke(),_=`intersection-${Lt(ne)}`;vi(P,he=>{u&&u(he)},{selectorToWatch:`#${_}`,skipWhen:!$});const{error:Q,required:F,...ae}=$e("SingleSelect"),B=!!Q||r,H=ae.id??s,me=ae.name??l;let oe;Q?oe=`${H}-error`:ae.hint&&(oe=`${H}-hint`);const Te=(typeof w<"u"&&w!==null?w.toString():k)??"";return d.jsxs(cl,{onOpenChange:R,disabled:n,required:F??g,onValueChange:I,value:Te,...y,children:[d.jsx(dl,{ref:v,id:H,name:me,startIcon:x,hasError:B,disabled:n,clearLabel:e,loading:o,onClear:Te&&c?L:void 0,"aria-label":y["aria-label"],"aria-describedby":oe??y["aria-describedby"],size:p,children:d.jsx(ul,{placeholder:f,textColor:Te?"neutral800":"neutral600",children:Te&&t?t(Te):void 0})}),d.jsx(fl,{children:d.jsx(gl,{position:"popper",sideOffset:4,onCloseAutoFocus:h,children:d.jsxs(pl,{ref:P,children:[i,d.jsx(A,{id:_,width:"100%",height:"1px"})]})})})]})}),Nn=b.forwardRef(({value:i,startIcon:e,children:t,...n},r)=>d.jsxs(Or,{ref:r,value:i.toString(),...n,children:[e&&d.jsx(T,{tag:"span","aria-hidden":!0,children:e}),d.jsx(O,{lineHeight:"20px",width:"100%",children:d.jsx(bl,{children:t})})]})),Gu=200,ws=15,[Yu,Gt]=Kt("DatePicker"),Xu=b.forwardRef(({calendarLabel:i,className:e,initialDate:t,locale:n,maxDate:r,minDate:s,monthSelectLabel:o="Month",onChange:l,value:a,yearSelectLabel:c="Year",hasError:h,id:u,name:f,disabled:g=!1,required:p=!1,onClear:x,clearLabel:w="Clear",size:y="M",...v},k)=>{const S=J.getLocalTimeZone(),$=$i("DatePicker"),C=n??$.locale,R=He(C,{day:"2-digit",month:"2-digit",year:"numeric"}),[L,I]=b.useState(!1),[P,ne]=b.useState(null),[_,K]=b.useState(null),[Q,F]=b.useState(null),[ae,B]=b.useState(),[H,me]=Pe({defaultProp:t?ft(t):void 0,prop:a?ft(a):void 0,onChange(ee){l&&l(ee==null?void 0:ee.toDate(S))}}),[oe,Te]=b.useMemo(()=>{const ee=t?ft(t):J.today("UTC"),At=s?ft(s):ee.set({day:1,month:1,year:ee.year-Gu});let Qt=r?ft(r):ee.set({day:31,month:12,year:ee.year+ws});return Qt.compare(At)<0&&(Qt=At.set({day:31,month:12,year:At.year+ws})),[At,Qt]},[s,r,t]),[he,be]=b.useState(Ju({currentValue:H,minDate:oe,maxDate:Te})),Z=ke(),ce=b.useRef(null),Fe=ee=>{x&&!g&&(B(""),me(void 0),x(ee),_==null||_.focus())},ht=b.useCallback(ee=>{ee&&H&&be(H),I(ee)},[H]);Le(()=>{if(a){const ee=ft(a);B(R.format(ee.toDate(S))),be(ee)}else B("")},[a,R,S]),Le(()=>{if(t&&ae===void 0){const ee=ft(t);B(R.format(ee.toDate(S)))}},[t,ae,R,S]);const{error:ct,...Ue}=$e("Combobox"),Tt=!!ct||h,dt=Ue.id??u,Xt=Ue.name??f,Jt=Ue.required||p;let ut;return ct?ut=`${dt}-error`:Ue.hint&&(ut=`${dt}-hint`),d.jsxs(Yu,{calendarDate:he,content:Q,contentId:Z,disabled:g,locale:C,minDate:oe,maxDate:Te,open:L,onCalendarDateChange:be,onContentChange:F,onOpenChange:ht,onTextInputChange:K,onTextValueChange:B,onTriggerChange:ne,onValueChange:me,onClear:x,required:Jt,textInput:_,textValue:ae,timeZone:S,trigger:P,value:H,children:[d.jsxs(Zu,{className:e,hasError:Tt,size:y,children:[d.jsx(z.Calendar,{fill:"neutral500","aria-hidden":!0}),d.jsx(nf,{ref:k,"aria-describedby":ut,id:dt,name:Xt,...v}),ae&&x?d.jsx(et,{size:"XS",variant:"ghost",onClick:Fe,"aria-disabled":g,"aria-label":w,label:w,ref:ce,children:d.jsx(z.Cross,{})}):null]}),d.jsx(Mr,{children:d.jsx(lf,{label:i,children:d.jsx(gf,{monthSelectLabel:o,yearSelectLabel:c})})})]})}),vs=i=>!!i.match(/^[^a-zA-Z]*$/),Ju=({currentValue:i,minDate:e,maxDate:t})=>{const n=J.today("UTC");return i||(J.minDate(e,n)===e&&J.maxDate(t,n)===t?n:J.minDate(e,n)===n?e:J.maxDate(t,n)===n?t:n)},Qu="DatePickerTrigger",Zu=b.forwardRef(({hasError:i,size:e,...t},n)=>{const r=Gt(Qu),s=Ce(n,l=>r.onTriggerChange(l)),o=()=>{r.disabled||r.onOpenChange(!0)};return d.jsx(mh.FocusScope,{asChild:!0,trapped:r.open,onMountAutoFocus:l=>{l.preventDefault()},onUnmountAutoFocus:l=>{var a;(a=document.getSelection())==null||a.empty(),l.preventDefault()},children:d.jsx(ef,{ref:s,$hasError:i,$hasTextValue:!!r.textValue,$size:e,$hasOnClear:!!r.onClear,...t,hasRadius:!0,gap:3,overflow:"hidden",background:r.disabled?"neutral150":"neutral0",onClick:E.composeEventHandlers(t.onClick,()=>{var l;(l=r.textInput)==null||l.focus()}),onPointerDown:E.composeEventHandlers(t.onPointerDown,l=>{var h;const a=l.target;a.hasPointerCapture(l.pointerId)&&a.releasePointerCapture(l.pointerId),(a.closest("button")??a.closest("div"))===l.currentTarget&&l.button===0&&l.ctrlKey===!1&&(o(),(h=r.textInput)==null||h.focus())})})})}),ef=m.styled(T)`
|
|
1614
1614
|
min-width: ${({$hasOnClear:i})=>i?"160px":"130px"};
|
|
1615
1615
|
border: 1px solid ${({theme:i,$hasError:e})=>e?i.colors.danger600:i.colors.neutral200};
|
|
1616
1616
|
padding-inline: ${({theme:i})=>i.spaces[3]};
|
|
1617
|
-
${({$size:i,$hasTextValue:e,$hasOnClear:t,theme:n})=>
|
|
1617
|
+
${({$size:i,$hasTextValue:e,$hasOnClear:t,theme:n})=>Rr({$size:i||"M",$hasValue:e||!1,$hasClear:t||!1,theme:n})}
|
|
1618
1618
|
|
|
1619
1619
|
& > svg {
|
|
1620
1620
|
flex: 1 0 auto;
|
|
@@ -1631,10 +1631,10 @@ ${m.css`
|
|
|
1631
1631
|
outline: none;
|
|
1632
1632
|
}
|
|
1633
1633
|
|
|
1634
|
-
${({theme:i,$hasError:e})=>
|
|
1635
|
-
`,tf="DatePickerTextInput",nf=b.forwardRef(({placeholder:i,...e},t)=>{const n=Gt(tf),{onTextValueChange:r,textValue:s,onTextInputChange:o,onOpenChange:l,disabled:a,locale:c}=n,h=Ce(t,y=>o(y)),u=()=>{a||l(!0)},f=
|
|
1634
|
+
${({theme:i,$hasError:e})=>rt()({theme:i,$hasError:e})};
|
|
1635
|
+
`,tf="DatePickerTextInput",nf=b.forwardRef(({placeholder:i,...e},t)=>{const n=Gt(tf),{onTextValueChange:r,textValue:s,onTextInputChange:o,onOpenChange:l,disabled:a,locale:c}=n,h=Ce(t,y=>o(y)),u=()=>{a||l(!0)},f=He(c,{year:"numeric",month:"2-digit",day:"2-digit"}),[g,p,x]=b.useMemo(()=>{var $;const y=f.formatToParts(new Date),v=y.filter(C=>C.type==="year"||C.type==="month"||C.type==="day"),k=v.map(C=>{switch(C.type){case"day":return"DD";case"month":return"MM";case"year":return"YYYY";default:return""}}),S=(($=y.find(C=>C.type==="literal"))==null?void 0:$.value)??"";return[k,S,v]},[f]),w=g.map(y=>`\\d{${y.length}}`).join(`\\${p}`);return d.jsx(sf,{role:"combobox",type:"text",inputMode:"numeric",ref:h,"aria-autocomplete":"none","aria-controls":n.contentId,"aria-disabled":n.disabled,"aria-expanded":n.open,"aria-required":n.required,"aria-haspopup":"dialog","data-state":n.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,pattern:w,placeholder:i??g.join(p),...e,value:s??"",onBlur:E.composeEventHandlers(e.onBlur,()=>{if(!n.textValue){n.onValueChange(void 0);return}n.onTextValueChange(f.format(n.calendarDate.toDate(n.timeZone))),n.onValueChange(n.calendarDate)}),onChange:E.composeEventHandlers(e.onChange,y=>{if(vs(y.target.value)){const v=y.target.value.split(p),[k,S,$]=x.map((K,Q)=>{const F=v[Q];return{...K,value:F}}).sort((K,Q)=>K.type==="year"?1:Q.type==="year"?-1:K.type==="month"?1:Q.type==="month"?-1:0).map(K=>K.value),C=n.calendarDate.year;let R=n.calendarDate.year;if($){const K=$.length===1?`0${$}`:$;R=$.length<3?Number(`${C}`.slice(0,4-K.length)+K):Number(K)}$&&$.length<3&&R>n.maxDate.year&&(R-=100);const L=n.calendarDate.set({year:R}),I=L.calendar.getMonthsInYear(L),P=L.set({month:S&&Number(S)<=I?Number(S):void 0}),ne=P.calendar.getDaysInMonth(P),_=P.set({day:k&&Number(k)<=ne?Number(k):void 0});n.onCalendarDateChange(rf(_,n.minDate,n.maxDate)),n.onTextValueChange(y.target.value)}}),onKeyDown:E.composeEventHandlers(e.onKeyDown,y=>{if(!n.open&&(vs(y.key)||["ArrowDown","Backspace"].includes(y.key)))u();else if(["Tab"].includes(y.key)&&n.open)y.preventDefault();else if(["Escape"].includes(y.key))n.open?n.onOpenChange(!1):(n.onValueChange(void 0),n.onTextValueChange("")),y.preventDefault();else if(n.open&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(y.key))switch(y.preventDefault(),y.key){case"ArrowDown":{const v=n.calendarDate.add({weeks:1});if(n.maxDate&&v.compare(n.maxDate)>0)return;n.onCalendarDateChange(v);return}case"ArrowRight":{const v=n.calendarDate.add({days:1});if(n.maxDate&&v.compare(n.maxDate)>0)return;n.onCalendarDateChange(v);return}case"ArrowUp":{const v=n.calendarDate.subtract({weeks:1});if(n.minDate&&v.compare(n.minDate)<0)return;n.onCalendarDateChange(v);return}case"ArrowLeft":{const v=n.calendarDate.subtract({days:1});if(n.minDate&&v.compare(n.minDate)<0)return;n.onCalendarDateChange(v)}}else n.open&&["Enter"].includes(y.key)&&(y.preventDefault(),r(f.format(n.calendarDate.toDate(n.timeZone))),n.onValueChange(n.calendarDate),n.onOpenChange(!1))})})});function rf(i,e,t){return e&&(i=J.maxDate(i,e)),t&&(i=J.minDate(i,t)),i}const sf=m.styled.input`
|
|
1636
1636
|
width: 100%;
|
|
1637
|
-
${
|
|
1637
|
+
${il}
|
|
1638
1638
|
color: ${({theme:i})=>i.colors.neutral800};
|
|
1639
1639
|
border: none;
|
|
1640
1640
|
background-color: transparent;
|
|
@@ -1671,7 +1671,7 @@ ${m.css`
|
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
1673
|
}
|
|
1674
|
-
`,df="DatePickerCalendar",[uf,ff]=Kt("DateFormatters"),gf=b.forwardRef(({monthSelectLabel:i,yearSelectLabel:e,...t},n)=>{const{locale:r,timeZone:s,minDate:o,maxDate:l,calendarDate:a,onCalendarDateChange:c}=Gt(df),h=J.startOfMonth(a),u=b.useMemo(()=>{const
|
|
1674
|
+
`,df="DatePickerCalendar",[uf,ff]=Kt("DateFormatters"),gf=b.forwardRef(({monthSelectLabel:i,yearSelectLabel:e,...t},n)=>{const{locale:r,timeZone:s,minDate:o,maxDate:l,calendarDate:a,onCalendarDateChange:c}=Gt(df),h=J.startOfMonth(a),u=b.useMemo(()=>{const C=o.year,R=l.year;return[...Array(R-C+1).keys()].map(L=>(C+L).toString())},[o,l]),f=He(r,{month:"long"}),g=b.useMemo(()=>[...Array(a.calendar.getMonthsInYear(a)).keys()].map(C=>f.format(a.set({month:C+1}).toDate(s))),[a,f,s]),p=He(r,{weekday:"short"}),x=b.useMemo(()=>{const C=J.startOfWeek(J.today(s),r);return[...new Array(7).keys()].map(R=>{const I=C.add({days:R}).toDate(s);return p.format(I)})},[s,r,p]),w=He(r,{weekday:"long",day:"numeric",month:"long",year:"numeric"}),y=He(r,{day:"numeric",calendar:a.calendar.identifier}),v=He(r,{day:"2-digit",month:"2-digit",year:"numeric"}),k=C=>{if(typeof C=="number")return;const R=a.set({month:g.indexOf(C)+1});c(R)},S=C=>{if(typeof C=="number")return;const R=a.set({year:parseInt(C,10)});c(R)},$=pf(h,r);return d.jsx(uf,{dateFormatter:w,cellDateFormatter:y,textValueFormatter:v,children:d.jsxs(T,{ref:n,direction:"column",alignItems:"stretch",padding:4,...t,children:[d.jsxs(mf,{justifyContent:"flex-start",paddingBottom:4,paddingLeft:2,paddingRight:2,gap:2,children:[d.jsx(wt,{children:d.jsx(zn,{"aria-label":i,value:g[a.month-1],onChange:k,children:g.map(C=>d.jsx(Nn,{value:C,children:C},C))})}),d.jsx(wt,{children:d.jsx(zn,{value:a.year.toString(),"aria-label":e,onChange:S,children:u.map(C=>d.jsx(Nn,{value:C,children:C},C))})})]}),d.jsxs("table",{role:"grid",children:[d.jsx("thead",{"aria-hidden":!0,children:d.jsx("tr",{"aria-rowindex":0,children:x.map((C,R)=>d.jsx(bf,{"aria-colindex":R,children:C},C))})}),d.jsx("tbody",{children:[...new Array(6).keys()].map(C=>d.jsx("tr",{"aria-rowindex":C+2,children:$(C).map((R,L)=>R?d.jsx(wf,{"aria-colindex":L+1,date:R,startDate:h,disabled:o.compare(R)>0||R.compare(l)>0},R.toString()):d.jsx(xl,{"aria-colindex":L+1},L+1))},C))})]})]})})}),pf=(i,e)=>t=>{let n=i.add({weeks:t});const r=[];n=J.startOfWeek(n,e);const s=J.getDayOfWeek(n,e);for(let o=0;o<s;o++)r.push(null);for(;r.length<7;){r.push(n);const o=n.add({days:1});if(J.isSameDay(n,o))break;n=o}for(;r.length<7;)r.push(null);return r},mf=m.styled(T)`
|
|
1675
1675
|
div[role='combobox'] {
|
|
1676
1676
|
border: 1px solid transparent;
|
|
1677
1677
|
background: transparent;
|
|
@@ -1688,7 +1688,7 @@ ${m.css`
|
|
|
1688
1688
|
`,bf=b.forwardRef(({children:i,...e},t)=>d.jsx(xf,{tag:"th",role:"gridcell",ref:t,...e,height:"2.4rem",width:"3.2rem",children:d.jsx(O,{variant:"pi",fontWeight:"bold",color:"neutral800",children:i.slice(0,2)})})),xf=m.styled(A)`
|
|
1689
1689
|
border-radius: ${({theme:i})=>i.borderRadius};
|
|
1690
1690
|
text-transform: capitalize;
|
|
1691
|
-
`,yf="DatePickerCalendarCell",wf=b.forwardRef(({date:i,startDate:e,disabled:t,...n},r)=>{const{timeZone:s,calendarDate:o,onValueChange:l,onOpenChange:a,onTextValueChange:c,onCalendarDateChange:h}=Gt(yf),{dateFormatter:u,cellDateFormatter:f,textValueFormatter:g}=ff("DatePickerCalendarCell"),p=J.isSameDay(o,i),x=b.useMemo(()=>u.format(i.toDate(s)),[u,i,s]),w=b.useMemo(()=>f.formatToParts(i.toDate(s)).find(
|
|
1691
|
+
`,yf="DatePickerCalendarCell",wf=b.forwardRef(({date:i,startDate:e,disabled:t,...n},r)=>{const{timeZone:s,calendarDate:o,onValueChange:l,onOpenChange:a,onTextValueChange:c,onCalendarDateChange:h}=Gt(yf),{dateFormatter:u,cellDateFormatter:f,textValueFormatter:g}=ff("DatePickerCalendarCell"),p=J.isSameDay(o,i),x=b.useMemo(()=>u.format(i.toDate(s)),[u,i,s]),w=b.useMemo(()=>f.formatToParts(i.toDate(s)).find(S=>S.type==="day").value,[f,i,s]),y=J.endOfMonth(e),v=i.compare(e)<0||i.compare(y)>0;let k="neutral900";return p?k="primary600":v&&(k="neutral600"),d.jsx(xl,{tag:"td",role:"gridcell",ref:r,"aria-selected":p,...n,hasRadius:!0,"aria-label":x,tabIndex:p?0:-1,background:p?"primary100":"neutral0",cursor:"pointer",onPointerDown:E.composeEventHandlers(n.onPointerDown,S=>{S.preventDefault(),h(i),l(i),c(g.format(i.toDate(s))),a(!1)}),"aria-disabled":t,children:d.jsx(O,{variant:"pi",textColor:k,children:w})})}),xl=m.styled(A)`
|
|
1692
1692
|
text-align: center;
|
|
1693
1693
|
padding: 0.7rem;
|
|
1694
1694
|
// Trick to prevent the outline from overflowing because of the general outline-offset
|
|
@@ -1704,9 +1704,9 @@ ${m.css`
|
|
|
1704
1704
|
color: ${({theme:i})=>i.colors.primary600};
|
|
1705
1705
|
}
|
|
1706
1706
|
}
|
|
1707
|
-
`,ft=i=>{const e=i.toISOString(),t=J.parseAbsolute(e,"UTC");return J.toCalendarDate(t)},yl=b.memo(Xu),
|
|
1707
|
+
`,ft=i=>{const e=i.toISOString(),t=J.parseAbsolute(e,"UTC");return J.toCalendarDate(t)},yl=b.memo(Xu),vn=i=>!!i.match(/^[^a-zA-Z]*$/);function vf(i=""){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Sf=m.styled(rl)`
|
|
1708
1708
|
min-width: ${({onClear:i})=>i?"160px":"130px"};
|
|
1709
|
-
`,wl=b.forwardRef(({step:i=15,value:e,defaultValue:t,onChange:n,...r},s)=>{const o
|
|
1709
|
+
`,wl=b.forwardRef(({step:i=15,value:e,defaultValue:t,onChange:n,...r},s)=>{const o=$i("TimePicker"),[l,a]=b.useState(""),[c,h]=Pe({prop:e,defaultProp:t,onChange:n}),u=He(o.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),f=b.useMemo(()=>{const S=u.formatToParts(new Date),{value:$}=S.find(C=>C.type==="literal");return $},[u]),g=b.useMemo(()=>{const S=60/i;return[...Array(24).keys()].flatMap($=>[...Array(S).keys()].map(C=>u.format(new Date(0,0,0,$,C*i))))},[i,u]),p=S=>{(!S||vn(S))&&a(S)},x=S=>{const[$,C]=S.split(f);if(!$&&!C)return;const R=Number($??"0"),L=Number(C??"0");if(!(R>23||L>59))return u.format(new Date(0,0,0,R,L))},w=S=>{const $=x(S.target.value);$?(a($),h($)):a(c)},y=S=>{if(typeof S<"u"){const $=x(S);h($)}else h(S)};b.useEffect(()=>{const S=typeof e>"u"?"":e;vn(S)&&a(S)},[e,a]);const k=`\\d{2}${vf(f)}\\d{2}`;return d.jsx(Sf,{...r,ref:s,value:c,onChange:y,isPrintableCharacter:vn,allowCustomValue:!0,placeholder:`--${f}--`,autocomplete:"none",startIcon:d.jsx(z.Clock,{fill:"neutral500"}),inputMode:"numeric",pattern:k,textValue:l,onTextValueChange:p,onBlur:w,children:g.map(S=>d.jsx(sl,{value:S,children:S},S))})}),Cf=b.forwardRef(({clearLabel:i="clear",dateLabel:e="Choose date",timeLabel:t="Choose time",disabled:n=!1,hasError:r,onChange:s,onClear:o,required:l=!1,step:a,value:c,initialDate:h,size:u,...f},g)=>{const p=b.useRef(null),[x,w]=b.useState(!1),y=c?Mt(c,!1):void 0,[v,k]=Pe({defaultProp:h?Mt(h,!1):void 0,prop:x?void 0:y,onChange(B){s&&s(B==null?void 0:B.toDate(J.getLocalTimeZone()))}}),S=$i("DateTimePicker"),$=He(S.locale,{hour:"2-digit",minute:"2-digit",hour12:!1}),C=v?$.format(v.toDate(J.getLocalTimeZone())):"",R=b.useRef(c);Le(()=>{x&&v&&k(void 0)},[x,v,k]),Le(()=>{const B=R.current;c==null&&B!=null&&v&&k(void 0),x&&c!==B&&w(!1),R.current=c},[c,v,x,k,w]),Le(()=>{x&&v===void 0&&c==null&&w(!1)},[x,v,c,w]);const L=B=>{let H=B?Mt(B):void 0;if(C&&H){const[me,oe]=C.split(":");H=H.set({hour:parseInt(me,10),minute:parseInt(oe,10)})}k(H)},I=B=>{if(!B)return;const[H,me]=B.split(":"),oe=v?v.set({hour:parseInt(H,10),minute:parseInt(me,10)}):Mt(new Date).set({hour:parseInt(H,10),minute:parseInt(me,10)});k(oe)},P=B=>{B.preventDefault(),w(!0),o&&o(B)},ne=()=>{const B=v?v.set({hour:0,minute:0}):Mt(new Date);k(B)},_=Ce(p,g),{error:K,id:Q,labelNode:F}=$e("DateTimePicker"),ae=!!K||r;return d.jsxs(T,{"aria-labelledby":F?`${Q}-label`:void 0,role:"group",flex:"1",gap:1,wrap:"wrap",children:[d.jsx(wt,{flex:"1",children:d.jsx(yl,{...f,hasError:ae,size:u,value:v==null?void 0:v.toDate("UTC"),onChange:L,required:l,onClear:o?P:void 0,clearLabel:`${i} date`,disabled:n,ref:_,"aria-label":e})}),d.jsx(wt,{flex:"1",children:d.jsx(wl,{size:u,hasError:ae,value:C,onChange:I,onClear:o&&C!==void 0&&C!=="00:00"?ne:void 0,clearLabel:`${i} time`,required:l,disabled:n,step:a,"aria-label":t})})]})}),Mt=(i,e=!0)=>{const t=i.toISOString();let n=J.parseAbsoluteToLocal(t);return e&&(n=n.set({hour:0,minute:0})),J.toCalendarDateTime(n)},jr=b.forwardRef((i,e)=>d.jsx(kf,{ref:e,background:"neutral150",...i,"data-orientation":"horizontal",role:"separator",tag:"div"})),kf=m.styled(A)`
|
|
1710
1710
|
height: 1px;
|
|
1711
1711
|
border: none;
|
|
1712
1712
|
/* If contained in a Flex parent we want to prevent the Divider to shink */
|
|
@@ -1715,16 +1715,16 @@ ${m.css`
|
|
|
1715
1715
|
svg {
|
|
1716
1716
|
height: 8.8rem;
|
|
1717
1717
|
}
|
|
1718
|
-
`,Tf=b.forwardRef(({icon:i,content:e,action:t,hasRadius:n=!0,shadow:r="tableShadow"},s)=>d.jsxs(T,{ref:s,alignItems:"center",direction:"column",padding:11,background:"neutral0",hasRadius:n,shadow:r,children:[i?d.jsx($f,{paddingBottom:6,"aria-hidden":!0,children:i}):null,d.jsx(A,{paddingBottom:4,children:d.jsx(O,{variant:"delta",tag:"p",textAlign:"center",textColor:"neutral600",children:e})}),t]}));let
|
|
1719
|
-
`){[e,t]=Bt(this,e,t);let r="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=n),e<a&&t>s&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new te(n,r)),n=[],r=-1);return r>-1&&t.push(new te(n,r)),t}}class
|
|
1720
|
-
`){[e,t]=Bt(this,e,t);let r="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=n),e<a&&t>o&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof
|
|
1721
|
-
`,this;e--}else if(r instanceof te){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof te?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class $l{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new li(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Tl{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(F.prototype[Symbol.iterator]=function(){return this.iter()},li.prototype[Symbol.iterator]=$l.prototype[Symbol.iterator]=Tl.prototype[Symbol.iterator]=function(){return this});class Of{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function Bt(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function Ge(i,e,t=!0,n=!0){return Rf(i,e,t,n)}const Fn=/\r\n?|\n/;var Re=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(Re||(Re={}));class Je{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRanges(e,t=!1){Wn(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new Je(e)}composeDesc(e){return this.empty?e:e.empty?this:Al(this,e)}mapDesc(e,t=!1){return e.empty?this:Hn(this,e,t)}mapPos(e,t=-1,n=Re.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(n!=Re.Simple&&c>=e&&(n==Re.TrackDel&&r<e&&c>e||n==Re.TrackBefore&&r<e||n==Re.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let s=this.sections[n++],o=this.sections[n++],l=r+s;if(o>=0&&r<=t&&l>=e)return r<e&&l>t?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Je(e)}static create(e){return new Je(e)}}class ce extends Je{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Wn(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return Hn(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r<t.length;r+=2){let o=t[r],l=t[r+1];if(l>=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(F.empty);n.push(o?e.slice(s,s+o):F.empty)}s+=o}return new ce(t,n)}compose(e){return this.empty?e:e.empty?this:Al(this,e,!0)}map(e,t=!1){return e.empty?this:Hn(this,e,t,!0)}iterChanges(e,t=!1){Wn(this,e,t)}get desc(){return Je.create(this.sections)}filter(e){let t=[],n=[],r=[],s=new ui(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,a-l);ge(r,h,-1);let u=s.ins==-1?-1:s.off==0?s.ins:0;ge(t,h,u),u>0&&st(n,t,s.text),s.forward(h),l+=h}let c=e[o++];for(;l<c;){if(s.done)break e;let h=Math.min(s.len,c-l);ge(t,h,-1),ge(r,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),l+=h}}return{changes:new ce(t,n),filtered:Je.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(h=!1){if(!h&&!r.length)return;o<t&&ge(r,t-o,-1);let u=new ce(r,s);l=l?l.compose(u.map(l)):u,r=[],s=[],o=0}function c(h){if(Array.isArray(h))for(let u of h)c(u);else if(h instanceof ce){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:u,to:f=u,insert:g}=h;if(u>f||u<0||f>t)throw new RangeError(`Invalid change range ${u} to ${f} (in doc of length ${t})`);let p=g?typeof g=="string"?F.of(g.split(n||Fn)):g:F.empty,x=p.length;if(u==f&&x==0)return;u<o&&a(),u>o&&ge(r,u-o,-1),ge(r,f-u,x),st(s,r,p),o=f}}return c(e),a(!l),l}static empty(e){return new ce(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<r;)n.push(F.empty);n[r]=F.of(s.slice(1)),t.push(s[0],n[r].length)}}}return new ce(t,n)}static createSet(e,t){return new ce(e,t)}}function ge(i,e,t,n=!1){if(e==0&&t<=0)return;let r=i.length-2;r>=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function st(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<i.length)i[i.length-1]=i[i.length-1].append(t);else{for(;i.length<n;)i.push(F.empty);i.push(t)}}function Wn(i,e,t){let n=i.inserted;for(let r=0,s=0,o=0;o<i.sections.length;){let l=i.sections[o++],a=i.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,h=s,u=F.empty;for(;c+=l,h+=a,a&&n&&(u=u.append(n[o-2>>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,c,s,h,u),r=c,s=h}}}function Hn(i,e,t,n=!1){let r=[],s=n?[]:null,o=new ui(i),l=new ui(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);ge(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let c=l.len;for(ge(r,l.ins,-1);c;){let h=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=h&&(ge(r,0,o.ins),s&&st(s,r,o.text),a=o.i),o.forward(h),c-=h}l.next()}else if(o.ins>=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let u=Math.min(h,l.len);c+=u,h-=u,l.forward(u)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;ge(r,c,a<o.i?o.ins:0),s&&a<o.i&&st(s,r,o.text),a=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return s?ce.createSet(r,s):Je.create(r);throw new Error("Mismatched change set lengths")}}}function Al(i,e,t=!1){let n=[],r=t?[]:null,s=new ui(i),o=new ui(e);for(let l=!1;;){if(s.done&&o.done)return r?ce.createSet(n,r):Je.create(n);if(s.ins==0)ge(n,s.len,0,l),s.next();else if(o.len==0&&!o.done)ge(n,0,o.ins,l),r&&st(r,n,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=n.length;if(s.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;ge(n,a,h,l),r&&h&&st(r,n,o.text)}else o.ins==-1?(ge(n,s.off?0:s.len,a,l),r&&st(r,n,s.textBit(a))):(ge(n,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&st(r,n,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||n.length>c),s.forward2(a),o.forward(a)}}}}class ui{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?F.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?F.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class mt{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new mt(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return M.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return M.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return M.range(e.anchor,e.head)}static create(e,t,n){return new mt(e,t,n)}}class M{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:M.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new M([this.main],0)}addRange(e,t=!0){return M.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,M.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new M(e.ranges.map(t=>mt.fromJSON(t)),e.main)}static single(e,t=e){return new M([M.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=n:s.from<n)return M.normalized(e.slice(),t);n=s.to}return new M(e,t)}static cursor(e,t=0,n,r){return mt.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r){let s=(n??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?mt.create(t,e,48|s):mt.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?M.range(a,l):M.range(l,a))}}return new M(e,t)}}function Rl(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Or=0;class j{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Or++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new j(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:jr),!!e.static,e.enables)}of(e){return new Vi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vi(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function jr(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class Vi{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Or++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let u of this.dependencies)u=="doc"?a=!0:u=="selection"?c=!0:((t=e[u.id])!==null&&t!==void 0?t:1)&1||h.push(e[u.id]);return{create(u){return u.values[o]=n(u),1},update(u,f){if(a&&f.docChanged||c&&(f.docChanged||f.selection)||Vn(u,h)){let g=n(u);if(l?!ks(g,u.values[o],r):!r(g,u.values[o]))return u.values[o]=g,1}return 0},reconfigure:(u,f)=>{let g,p=f.config.address[s];if(p!=null){let x=Ji(f,p);if(this.dependencies.every(w=>w instanceof j?f.facet(w)===u.facet(w):w instanceof kt?f.field(w,!1)==u.field(w,!1):!0)||(l?ks(g=n(u),x,r):r(g=n(u),x)))return u.values[o]=x,0}else g=n(u);return u.values[o]=g,1}}}}function ks(i,e,t){if(i.length!=e.length)return!1;for(let n=0;n<i.length;n++)if(!t(i[n],e[n]))return!1;return!0}function Vn(i,e){let t=!1;for(let n of e)ai(i,n)&1&&(t=!0);return t}function jf(i,e,t){let n=t.map(a=>i[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let c=[];for(let h=0;h<n.length;h++){let u=Ji(a,n[h]);if(r[h]==2)for(let f of u)c.push(f);else c.push(u)}return e.combine(c)}return{create(a){for(let c of n)ai(a,c);return a.values[o]=l(a),1},update(a,c){if(!Vn(a,s))return 0;let h=l(a);return e.compare(h,a.values[o])?0:(a.values[o]=h,1)},reconfigure(a,c){let h=Vn(a,n),u=c.config.facets[e.id],f=c.facet(e);if(u&&!h&&jr(t,u))return a.values[o]=f,0;let g=l(a);return e.compare(g,f)?(a.values[o]=f,0):(a.values[o]=g,1)}}}const Mi=j.define({static:!0});class kt{constructor(e,t,n,r,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new kt(Or++,e.create,e.update,e.compare||((n,r)=>n===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Mi).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(Mi),o=r.facet(Mi),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,Mi.of({field:this,create:e})]}get extension(){return this}}const gt={lowest:4,low:3,default:2,high:1,highest:0};function ei(i){return e=>new Dl(e,i)}const Ef={highest:ei(gt.highest),high:ei(gt.high),default:ei(gt.default),low:ei(gt.low),lowest:ei(gt.lowest)};class Dl{constructor(e,t){this.inner=e,this.prec=t}}class fn{of(e){return new qn(this,e)}reconfigure(e){return fn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class qn{constructor(e,t){this.compartment=e,this.inner=t}}class Xi{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of If(e,t,o))f instanceof kt?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],c=[];for(let f of r)l[f.id]=c.length<<1,c.push(g=>f.slot(g));let h=n==null?void 0:n.config.facets;for(let f in s){let g=s[f],p=g[0].facet,x=h&&h[f]||[];if(g.every(w=>w.type==0))if(l[p.id]=a.length<<1|1,jr(x,g))a.push(n.facet(p));else{let w=p.combine(g.map(y=>y.value));a.push(n&&p.compare(w,n.facet(p))?n.facet(p):w)}else{for(let w of g)w.type==0?(l[w.id]=a.length<<1|1,a.push(w.value)):(l[w.id]=c.length<<1,c.push(y=>w.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(w=>jf(w,p,g))}}let u=c.map(f=>f(l));return new Xi(e,o,u,l,a,s)}}function If(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=n[a].indexOf(o);c>-1&&n[a].splice(c,1),o instanceof qn&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof qn){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,l)}else if(o instanceof Dl)s(o.inner,o.prec);else if(o instanceof kt)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Vi)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,gt.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(i,gt.default),n.reduce((o,l)=>o.concat(l))}function ai(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Ji(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const Ml=j.define(),_n=j.define({combine:i=>i.some(e=>e),static:!0}),Ol=j.define({combine:i=>i.length?i[0]:void 0,static:!0}),jl=j.define(),El=j.define(),Il=j.define(),Pl=j.define({combine:i=>i.length?i[0]:!1});class Yt{constructor(e,t){this.type=e,this.value=t}static define(){return new Pf}}class Pf{of(e){return new Yt(this,e)}}class Lf{constructor(e){this.map=e}of(e){return new re(this,e)}}class re{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new re(this.type,t)}is(e){return this.type==e}static define(e={}){return new Lf(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}}re.reconfigure=re.define();re.appendConfig=re.define();class me{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&Rl(n,t.newLength),s.some(l=>l.type==me.time)||(this.annotations=s.concat(me.time.of(Date.now())))}static create(e,t,n,r,s,o){return new me(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(me.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}me.time=Yt.define();me.userEvent=Yt.define();me.addToHistory=Yt.define();me.remote=Yt.define();function Bf(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n<i.length&&(r==e.length||e[r]>=i[n]))s=i[n++],o=i[n++];else if(r<e.length)s=e[r++],o=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Ll(i,e,t){var n;let r,s,o;return t?(r=e.changes,s=ce.empty(e.changes.length),o=i.changes.compose(e.changes)):(r=e.changes.map(i.changes),s=i.changes.mapDesc(e.changes,!0),o=i.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(n=i.selection)===null||n===void 0?void 0:n.map(r),effects:re.mapEffects(i.effects,r).concat(re.mapEffects(e.effects,s)),annotations:i.annotations.length?i.annotations.concat(e.annotations):e.annotations,scrollIntoView:i.scrollIntoView||e.scrollIntoView}}function Kn(i,e,t){let n=e.selection,r=jt(e.annotations);return e.userEvent&&(r=r.concat(me.userEvent.of(e.userEvent))),{changes:e.changes instanceof ce?e.changes:ce.of(e.changes||[],t,i.facet(Ol)),selection:n&&(n instanceof M?n:M.single(n.anchor,n.head)),effects:jt(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function Bl(i,e,t){let n=Kn(i,e.length?e[0]:{},i.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;n=Ll(n,Kn(i,e[s],o?n.changes.newLength:i.doc.length),o)}let r=me.create(i,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return Nf(t?zf(r):r)}function zf(i){let e=i.startState,t=!0;for(let r of e.facet(jl)){let s=r(i);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:Bf(t,s))}if(t!==!0){let r,s;if(t===!1)s=i.changes.invertedDesc,r=ce.empty(e.doc.length);else{let o=i.changes.filter(t);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}i=me.create(e,r,i.selection&&i.selection.map(s),re.mapEffects(i.effects,s),i.annotations,i.scrollIntoView)}let n=e.facet(El);for(let r=n.length-1;r>=0;r--){let s=n[r](i);s instanceof me?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof me?i=s[0]:i=Bl(e,jt(s),!1)}return i}function Nf(i){let e=i.startState,t=e.facet(Il),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=Ll(n,Kn(e,s,i.changes.newLength),!0))}return n==i?i:me.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const Ff=[];function jt(i){return i==null?Ff:Array.isArray(i)?i:[i]}var Ye=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(Ye||(Ye={}));const Wf=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Un;try{Un=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Hf(i){if(Un)return Un.test(i);for(let e=0;e<i.length;e++){let t=i[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Wf.test(t)))return!0}return!1}function Vf(i){return e=>{if(!/\S/.test(e))return Ye.Space;if(Hf(e))return Ye.Word;for(let t=0;t<i.length;t++)if(e.indexOf(i[t])>-1)return Ye.Word;return Ye.Other}}class G{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)ai(this,l<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return ai(this,n),Ji(this,n)}update(...e){return Bl(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:r}=t;for(let l of e.effects)l.is(fn.reconfigure)?(t&&(r=new Map,t.compartments.forEach((a,c)=>r.set(c,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(re.reconfigure)?(t=null,n=l.value):l.is(re.appendConfig)&&(t=null,n=jt(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=Xi.resolve(n,r,this),s=new G(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(_n)?e.newSelection:e.newSelection.asSingle();new G(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:M.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=jt(n.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),c=this.changes(a.changes),h=c.map(r);for(let f=0;f<l;f++)s[f]=s[f].map(h);let u=r.mapDesc(c,!0);s.push(a.range.map(u)),r=r.compose(h),o=re.mapEffects(o,h).concat(re.mapEffects(jt(a.effects),u))}return{changes:r,selection:M.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof ce?e:ce.of(e,this.doc.length,this.facet(G.lineSeparator))}toText(e){return F.of(e.split(this.facet(G.lineSeparator)||Fn))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(ai(this,t),Ji(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof kt&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let o=n[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return G.create({doc:e.doc,selection:M.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Xi.resolve(e.extensions||[],new Map),n=e.doc instanceof F?e.doc:F.of((e.doc||"").split(t.staticFacet(G.lineSeparator)||Fn)),r=e.selection?e.selection instanceof M?e.selection:M.single(e.selection.anchor,e.selection.head):M.single(0);return Rl(r,n.length),t.staticFacet(_n)||(r=r.asSingle()),new G(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(G.tabSize)}get lineBreak(){return this.facet(G.lineSeparator)||`
|
|
1722
|
-
`}get readOnly(){return this.facet(Pl)}phrase(e,...t){for(let n of this.facet(G.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(Ml))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return Vf(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=Ge(t,o,!1);if(s(t.slice(a,o))!=Ye.Word)break;o=a}for(;l<r;){let a=Ge(t,l);if(s(t.slice(l,a))!=Ye.Word)break;l=a}return o==l?null:M.range(o+n,l+n)}}G.allowMultipleSelections=_n;G.tabSize=j.define({combine:i=>i.length?i[0]:4});G.lineSeparator=Ol;G.readOnly=Pl;G.phrases=j.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});G.languageData=Ml;G.changeFilter=jl;G.transactionFilter=El;G.transactionExtender=Il;fn.reconfigure=re.define();class zt{eq(e){return this==e}range(e,t=e){return fi.create(e,t,this)}}zt.prototype.startSide=zt.prototype.endSide=0;zt.prototype.point=!1;zt.prototype.mapMode=Re.TrackDel;class fi{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new fi(e,t,n)}}function Gn(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class Er{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],h=this.from[a]+e,u=this.to[a]+e,f,g;if(h==u){let p=t.mapPos(h,c.startSide,c.mapMode);if(p==null||(f=g=p,c.startSide!=c.endSide&&(g=t.mapPos(h,c.endSide),g<f)))continue}else if(f=t.mapPos(h,c.startSide),g=t.mapPos(u,c.endSide),f>g||f==g&&c.startSide>0&&c.endSide<=0)continue;(g-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(l=Math.max(l,g-f)),n.push(c),r.push(f-o),s.push(g-o))}return{mapped:n.length?new Er(r,s,n,l):null,pos:o}}}class X{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new X(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Gn)),this.isEmpty)return t.length?X.of(t):this;let l=new zl(this,null,-1).goto(0),a=0,c=[],h=new Qi;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let u=t[a++];h.addInner(u.from,u.to,u.value)||c.push(u)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||c.push(fi.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!c.length?X.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(l));else if(c===!0){let{mapped:h,pos:u}=a.map(l,e);h&&(r=Math.max(r,h.maxPoint),t.push(h),n.push(u))}}let s=this.nextLayer.map(e);return t.length==0?s:new X(n,t,s||X.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return gi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return gi.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),l=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),a=$s(o,l,n),c=new ti(o,a,s),h=new ti(l,a,s);n.iterGaps((u,f,g)=>Ts(c,u,h,f,g,r)),n.empty&&n.length==0&&Ts(c,0,h,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=$s(s,o),a=new ti(s,l,0).goto(n),c=new ti(o,l,0).goto(n);for(;;){if(a.to!=c.to||!Yn(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,t,n,r,s=-1){let o=new ti(e,null,s).goto(t),l=t,a=o.openStart;for(;;){let c=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),u=o.pointFrom<t?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,a);r.point(l,c,o.point,h,u,o.pointRank),a=Math.min(o.openEnd(c),h.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new Qi;for(let r of e instanceof fi?[e]:t?qf(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return X.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=X.empty;r=r.nextLayer)t=new X(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}X.empty=new X([],[],null,-1);function qf(i){if(i.length>1)for(let e=i[0],t=1;t<i.length;t++){let n=i[t];if(Gn(e,n)>0)return i.slice().sort(Gn);e=n}return i}X.empty.nextLayer=X.empty;class Qi{finishChunk(e){this.chunks.push(new Er(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Qi)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(X.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=X.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function $s(i,e,t){let n=new Map;for(let s of i)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&n.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=n.get(s.chunk[o]);l!=null&&(t?t.mapPos(l):l)==s.chunkPos[o]&&!(t!=null&&t.touchesRange(l,l+s.chunk[o].length))&&r.add(s.chunk[o])}return r}class zl{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class gi{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new zl(o,t,n,s));return r.length==1?r[0]:new gi(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)Sn(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)Sn(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Sn(this.heap,0)}}}function Sn(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1<i.length&&r.compare(i[n+1])>=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}class ti{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=gi.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Oi(this.active,e),Oi(this.activeTo,e),Oi(this.activeRank,e),this.minActive=As(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||r-this.activeTo[t])>0;)t++;ji(this.active,t,n),ji(this.activeTo,t,r),ji(this.activeRank,t,s),e&&ji(e,t,this.cursor.from),this.minActive=As(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&Oi(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let r=n.length-1;r>=0&&n[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Ts(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,l=n,a=n-e;for(;;){let c=i.to+a-t.to,h=c||i.endSide-t.endSide,u=h<0?i.to+a:t.to,f=Math.min(u,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Yn(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(l,f,i.point,t.point):f>l&&!Yn(i.active,t.active)&&s.compareRange(l,f,i.active,t.active),u>o)break;(c||i.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(u),l=u,h<=0&&i.next(),h>=0&&t.next()}}function Yn(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!=e[t]&&!i[t].eq(e[t]))return!1;return!0}function Oi(i,e){for(let t=e,n=i.length-1;t<n;t++)i[t]=i[t+1];i.pop()}function ji(i,e,t){for(let n=i.length-1;n>=e;n--)i[n+1]=i[n];i[e]=t}function As(i,e){let t=-1,n=1e9;for(let r=0;r<e.length;r++)(e[r]-n||i[r].endSide-i[t].endSide)<0&&(t=r,n=e[r]);return t}function _f(i,e,t,n){for(let r=0,s=0;;){if(s>=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=Ge(i,r)}return i.length}const Xn="ͼ",Rs=typeof Symbol>"u"?"__"+Xn:Symbol.for(Xn),Jn=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Ds=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Nt{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let h=[],u=/^@(\w+)\b/.exec(o[0]),f=u&&u[1]=="keyframes";if(u&&l==null)return a.push(o[0]+";");for(let g in l){let p=l[g];if(/&/.test(g))s(g.split(/,\s*/).map(x=>o.map(w=>x.replace(/&/,w))).reduce((x,w)=>x.concat(w)),p,a);else if(p&&typeof p=="object"){if(!u)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(r(g),p,h,f)}else p!=null&&h.push(g.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+p+";")}(h.length||f)&&a.push((n&&!u&&!c?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
1723
|
-
`)}static newName(){let e=
|
|
1724
|
-
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ft={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:"'"},Qn={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'};for(var ue=0;ue<10;ue++)Ft[48+ue]=Ft[96+ue]=String(ue);for(var ue=1;ue<=24;ue++)Ft[ue+111]="F"+ue;for(var ue=65;ue<=90;ue++)Ft[ue]=String.fromCharCode(ue+32),Qn[ue]=String.fromCharCode(ue);for(var Cn in Ft)Qn.hasOwnProperty(Cn)||(Qn[Cn]=Ft[Cn]);function pi(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Zn(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function qi(i,e){if(!e.anchorNode)return!1;try{return Zn(i,e.anchorNode)}catch{return!1}}function mi(i){return i.nodeType==3?vt(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function hi(i,e,t,n){return t?Os(i,e,t,n,-1)||Os(i,e,t,n,1):!1}function wt(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function Zi(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function Os(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:qe(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=wt(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?qe(i):0}else return!1}}function qe(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function gn(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function Uf(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Nl(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function Gf(i,e,t,n,r,s,o,l){let a=i.ownerDocument,c=a.defaultView||window;for(let h=i,u=!1;h&&!u;)if(h.nodeType==1){let f,g=h==a.body,p=1,x=1;if(g)f=Uf(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(u=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let v=h.getBoundingClientRect();({scaleX:p,scaleY:x}=Nl(h,v)),f={left:v.left,right:v.left+h.clientWidth*p,top:v.top,bottom:v.top+h.clientHeight*x}}let w=0,y=0;if(r=="nearest")e.top<f.top?(y=e.top-(f.top+o),t>0&&e.bottom>f.bottom+y&&(y=e.bottom-f.bottom+o)):e.bottom>f.bottom&&(y=e.bottom-f.bottom+o,t<0&&e.top-y<f.top&&(y=e.top-(f.top+o)));else{let v=e.bottom-e.top,k=f.bottom-f.top;y=(r=="center"&&v<=k?e.top+v/2-k/2:r=="start"||r=="center"&&t<0?e.top-o:e.bottom-k+o)-f.top}if(n=="nearest"?e.left<f.left?(w=e.left-(f.left+s),t>0&&e.right>f.right+w&&(w=e.right-f.right+s)):e.right>f.right&&(w=e.right-f.right+s,t<0&&e.left<f.left+w&&(w=e.left-(f.left+s))):w=(n=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:n=="start"==l?e.left-s:e.right-(f.right-f.left)+s)-f.left,w||y)if(g)c.scrollBy(w,y);else{let v=0,k=0;if(y){let C=h.scrollTop;h.scrollTop+=y/x,k=(h.scrollTop-C)*x}if(w){let C=h.scrollLeft;h.scrollLeft+=w/p,v=(h.scrollLeft-C)*p}e={left:e.left-v,top:e.top-k,right:e.right-v,bottom:e.bottom-k},v&&Math.abs(v-w)<1&&(n="nearest"),k&&Math.abs(k-y)<1&&(r="nearest")}if(g)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Yf(i){let e=i.ownerDocument,t,n;for(let r=i.parentNode;r&&!(r==e.body||t&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:n}}class Xf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?qe(t):0),n,Math.min(e.focusOffset,n?qe(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let Rt=null;function Fl(i){if(i.setActive)return i.setActive();if(Rt)return i.focus(Rt);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(Rt==null?{get preventScroll(){return Rt={preventScroll:!0},!0}}:void 0),!Rt){Rt=!1;for(let t=0;t<e.length;){let n=e[t++],r=e[t++],s=e[t++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let js;function vt(i,e,t=e){let n=js||(js=document.createRange());return n.setEnd(i,t),n.setStart(i,e),n}function Et(i,e,t,n){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,i.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,i.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function Jf(i){for(;i;){if(i&&(i.nodeType==9||i.nodeType==11&&i.host))return i;i=i.assignedSlot||i.parentNode}return null}function Wl(i){for(;i.attributes.length;)i.removeAttributeNode(i.attributes[0])}function Qf(i,e){let t=e.focusNode,n=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=n)return!1;for(n=Math.min(n,qe(t));;)if(n){if(t.nodeType!=1)return!1;let r=t.childNodes[n-1];r.contentEditable=="false"?n--:(t=r,n=qe(t))}else{if(t==i)return!0;n=wt(t),t=t.parentNode}}function Hl(i){return i.scrollTop>Math.max(1,i.scrollHeight-i.clientHeight-4)}function Vl(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=qe(t)}else if(t.parentNode&&!Zi(t))n=wt(t),t=t.parentNode;else return null}}function ql(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n<t.nodeValue.length)return{node:t,offset:n};if(t.nodeType==1&&n<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[n],n=0}else if(t.parentNode&&!Zi(t))n=wt(t)+1,t=t.parentNode;else return null}}class pe{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new pe(e.parentNode,wt(e),t)}static after(e,t){return new pe(e.parentNode,wt(e)+1,t)}}const Ir=[];class q{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,r=null,s;for(let o of this.children){if(o.flags&7){if(!o.dom&&(s=r?r.nextSibling:n.firstChild)){let l=q.get(s);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(s)}o.sync(e,t),o.flags&=-8}if(s=r?r.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&s!=o.dom&&(t.written=!0),o.dom.parentNode==n)for(;s&&s!=o.dom;)s=Es(s);else n.insertBefore(o.dom,s);r=o.dom}for(s=r?r.nextSibling:n.firstChild,s&&t&&t.node==n&&(t.written=!0);s;)s=Es(s)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let r=qe(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;r==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?r=-1:r=1),e=s}r<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!q.get(n);)n=n.nextSibling;if(!n)return this.length;for(let r=0,s=0;;r++){let o=this.children[r];if(o.dom==n)return s;s+=o.length+o.breakAfter}}domBoundsAround(e,t,n=0){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=n,h=n;a<this.children.length;a++){let u=this.children[a],f=c+u.length;if(c<e&&f>t)return u.domBoundsAround(e,t,c);if(f>=e&&r==-1&&(r=a,s=c),c>t&&u.dom.parentNode==this.dom){o=a,l=h;break}h=f,c=f+u.breakAfter}return{from:s,to:l<0?n+this.length:l,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Ir){this.markDirty();for(let r=e;r<t;r++){let s=this.children[r];s.parent==this&&n.indexOf(s)<0&&s.destroy()}n.length<250?this.children.splice(e,t-e,...n):this.children=[].concat(this.children.slice(0,e),n,this.children.slice(t));for(let r=0;r<n.length;r++)n[r].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new _l(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,r,s,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}q.prototype.breakAfter=0;function Es(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}class _l{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Kl(i,e,t,n,r,s,o,l,a){let{children:c}=i,h=c.length?c[e]:null,u=s.length?s[s.length-1]:null,f=u?u.breakAfter:o;if(!(e==n&&h&&!o&&!f&&s.length<2&&h.merge(t,r,s.length?u:null,t==0,l,a))){if(n<c.length){let g=c[n];g&&(r<g.length||g.breakAfter&&(u!=null&&u.breakAfter))?(e==n&&(g=g.split(r),r=0),!f&&u&&g.merge(0,r,u,!0,0,a)?s[s.length-1]=g:((r||g.children.length&&!g.children[0].length)&&g.merge(0,r,null,!1,0,a),s.push(g))):g!=null&&g.breakAfter&&(u?u.breakAfter=1:o=1),n++}for(h&&(h.breakAfter=o,t>0&&(!o&&s.length&&h.merge(t,h.length,s[0],!1,l,0)?h.breakAfter=s.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<n&&s.length;)if(c[n-1].become(s[s.length-1]))n--,s.pop(),a=s.length?0:l;else if(c[e].become(s[0]))e++,s.shift(),l=s.length?0:a;else break;!s.length&&e&&n<c.length&&!c[e-1].breakAfter&&c[n].merge(0,0,c[e-1],!1,l,a)&&e--,(e<n||s.length)&&i.replaceChildren(e,n,s)}}function Ul(i,e,t,n,r,s){let o=i.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),u=e-t;for(let f of n)u+=f.length;i.length+=u,Kl(i,c,h,l,a,n,0,r,s)}let De=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},er=typeof document<"u"?document:{documentElement:{style:{}}};const tr=/Edge\/(\d+)/.exec(De.userAgent),Gl=/MSIE \d/.test(De.userAgent),ir=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(De.userAgent),pn=!!(Gl||ir||tr),Is=!pn&&/gecko\/(\d+)/i.test(De.userAgent),kn=!pn&&/Chrome\/(\d+)/.exec(De.userAgent),Zf="webkitFontSmoothing"in er.documentElement.style,Yl=!pn&&/Apple Computer/.test(De.vendor),Ps=Yl&&(/Mobile\/\w+/.test(De.userAgent)||De.maxTouchPoints>2);var D={mac:Ps||/Mac/.test(De.platform),ie:pn,ie_version:Gl?er.documentMode||6:ir?+ir[1]:tr?+tr[1]:0,gecko:Is,gecko_version:Is?+(/Firefox\/(\d+)/.exec(De.userAgent)||[0,0])[1]:0,chrome:!!kn,chrome_version:kn?+kn[1]:0,ios:Ps,android:/Android\b/.test(De.userAgent),safari:Yl,webkit_version:Zf?+(/\bAppleWebKit\/(\d+)/.exec(De.userAgent)||[0,0])[1]:0,tabSize:er.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const eg=256;class Le extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof Le)||this.length-(t-e)+n.length>eg||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Le(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new pe(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return tg(this.dom,e,t)}}class et extends q{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(Wl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,s,o){return n&&(!(n instanceof et&&n.mark.eq(this.mark))||e&&s<=0||t<this.length&&o<=0)?!1:(Ul(this,e,t,n?n.children.slice():[],s-1,o-1),this.markDirty(),!0)}split(e){let t=[],n=0,r=-1,s=0;for(let l of this.children){let a=n+l.length;a>e&&t.push(n<e?l.split(e-n):l),r<0&&n>=e&&(r=s),n=a,s++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new et(this.mark,t,o)}domAtPos(e){return Xl(this,e)}coordsAt(e,t){return Ql(this,e,t)}}function tg(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?D.chrome||D.gecko||(e?(r--,o=1):s<n&&(s++,o=-1)):t<0?r--:s<n&&s++;let l=vt(i,r,s).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?gn(a,o<0):a||null}class bt extends q{static create(e,t,n){return new bt(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=bt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,s,o){return n&&(!(n instanceof bt)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}become(e){return e instanceof bt&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return F.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):F.empty}domAtPos(e){return(this.length?e==0:this.side>0)?pe.before(this.dom):pe.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?r.length-1:0;s=r[l],!(e>0?l==0:l==r.length-1||s.top<s.bottom);l+=o?-1:1);return gn(s,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Wt extends q{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Wt&&e.side==this.side}split(){return new Wt(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?pe.before(this.dom):pe.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return F.empty}get isHidden(){return!0}}Le.prototype.children=bt.prototype.children=Wt.prototype.children=Ir;function Xl(i,e){let t=i.dom,{children:n}=i,r=0;for(let s=0;r<n.length;r++){let o=n[r],l=s+o.length;if(!(l==s&&o.getSide()<=0)){if(e>s&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-s);if(e<=s)break;s=l}}for(let s=r;s>0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=r;s<n.length;s++){let o=n[s];if(o.dom.parentNode==t)return o.domAtPos(0)}return new pe(t,0)}function Jl(i,e,t){let n,{children:r}=i;t>0&&e instanceof et&&r.length&&(n=r[r.length-1])instanceof et&&n.mark.eq(e.mark)?Jl(n,e.children[0],t-1):(r.push(e),e.setParent(i)),i.length+=e.length}function Ql(i,e,t){let n=null,r=-1,s=null,o=-1;function l(c,h){for(let u=0,f=0;u<c.children.length&&f<=h;u++){let g=c.children[u],p=f+g.length;p>=h&&(g.children.length?l(g,h-f):(!s||s.isHidden&&(t>0||ng(s,g)))&&(p>h||f==p&&g.getSide()>0)?(s=g,o=h-f):(f<h||f==p&&g.getSide()<0&&!g.isHidden)&&(n=g,r=h-f)),f=p}}l(i,e);let a=(t<0?n:s)||n||s;return a?a.coordsAt(Math.max(0,a==n?r:o),t):ig(i)}function ig(i){let e=i.dom.lastChild;if(!e)return i.dom.getBoundingClientRect();let t=mi(e);return t[t.length-1]||null}function ng(i,e){let t=i.coordsAt(0,1),n=e.coordsAt(0,1);return t&&n&&n.top<t.bottom}function nr(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}const Ls=Object.create(null);function en(i,e,t){if(i==e)return!0;i||(i=Ls),e||(e=Ls);let n=Object.keys(i),r=Object.keys(e);if(n.length-(t&&n.indexOf(t)>-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function rr(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function rg(i){let e=Object.create(null);for(let t=0;t<i.attributes.length;t++){let n=i.attributes[t];e[n.name]=n.value}return e}class Pr{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Ve=function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i}(Ve||(Ve={}));class ye extends zt{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new $i(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new at(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=Zl(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new at(e,n,r,t,e.widget||null,!0)}static line(e){return new Ti(e)}static set(e,t=!1){return X.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ye.none=X.empty;class $i extends ye{constructor(e){let{start:t,end:n}=Zl(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof $i&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&en(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}$i.prototype.point=!1;class Ti extends ye{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ti&&this.spec.class==e.spec.class&&en(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ti.prototype.mapMode=Re.TrackBefore;Ti.prototype.point=!0;class at extends ye{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?Re.TrackBefore:Re.TrackAfter:Re.TrackDel}get type(){return this.startSide!=this.endSide?Ve.WidgetRange:this.startSide<=0?Ve.WidgetBefore:Ve.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof at&&sg(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}at.prototype.point=!0;function Zl(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function sg(i,e){return i==e||!!(i&&e&&i.compare(e))}function _i(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}class ne extends q{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,s,o){if(n){if(!(n instanceof ne))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),Ul(this,e,t,n?n.children.slice():[],s,o),!0}split(e){let t=new ne;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let s=n;s<this.children.length;s++)t.append(this.children[s],0);for(;n>0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){en(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Jl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=nr(t,this.attrs||{})),n&&(this.attrs=nr({class:n},this.attrs||{}))}domAtPos(e){return Xl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Wl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(rr(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&q.get(r)instanceof et;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=q.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!D.ios||!this.children.some(s=>s instanceof Le))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof Le)||/[^ -~]/.test(n.text))return null;let r=mi(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Ql(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight<s){let o=(s-r.textHeight)/2;return{top:n.top+o,bottom:n.bottom-o,left:n.left,right:n.left}}}return n}become(e){return e instanceof ne&&this.children.length==0&&e.children.length==0&&en(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,r=0;n<e.children.length;n++){let s=e.children[n],o=r+s.length;if(o>=t){if(s instanceof ne)return s;if(o>t)break}r=o+s.breakAfter}return null}}class Qe extends q{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,s,o){return n&&(!(n instanceof Qe)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?pe.before(this.dom):pe.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new Qe(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return Ir}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):F.empty}domBoundsAround(){return null}become(e){return e instanceof Qe&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);return n||(this.widget instanceof sr?null:gn(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t==n?!1:e<0?t<0:n>0}}class sr extends Pr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ci{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Qe&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ne),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ei(new Wt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Qe)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Ei(new Le(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof at){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof at)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Qe(n.widget||Ht.block,l,n));else{let a=bt.create(n.widget||Ht.inline,l,l?0:n.startSide),c=this.atCursorPos&&!a.isEditable&&s<=r.length&&(e<t||n.startSide>0),h=!a.isEditable&&(e<t||s>r.length||n.startSide<=0),u=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),c&&(u.append(Ei(new Wt(1),r),s),s=r.length+Math.max(0,s-r.length)),u.append(Ei(a,r),s),this.atCursorPos=h,this.pendingBuffer=h?e<t||s>r.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,n,r,s){let o=new ci(e,t,n,s);return o.openEnd=X.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ei(i,e){for(let t of e)i=new et(t,[i],i.length);return i}class Ht extends Pr{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ht.inline=new Ht("span");Ht.block=new Ht("div");var xe=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(xe||(xe={}));const St=xe.LTR,Lr=xe.RTL;function ea(i){let e=[];for(let t=0;t<i.length;t++)e.push(1<<+i[t]);return e}const og=ea("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),lg=ea("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),or=Object.create(null),Ne=[];for(let i of["()","[]","{}"]){let e=i.charCodeAt(0),t=i.charCodeAt(1);or[e]=t,or[t]=-e}function ta(i){return i<=247?og[i]:1424<=i&&i<=1524?2:1536<=i&&i<=1785?lg[i-1536]:1774<=i&&i<=2220?4:8192<=i&&i<=8204?256:64336<=i&&i<=65023?4:1}const ag=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ot{get dir(){return this.level%2?Lr:St}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==n)return o;(s<0||(r!=0?r<0?l.from<t:l.to>t:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function ia(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++){let n=i[t],r=e[t];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!ia(n.inner,r.inner))return!1}return!0}const V=[];function hg(i,e,t,n,r){for(let s=0;s<=n.length;s++){let o=s?n[s-1].to:e,l=s<n.length?n[s].from:t,a=s?256:r;for(let c=o,h=a,u=a;c<l;c++){let f=ta(i.charCodeAt(c));f==512?f=h:f==8&&u==4&&(f=16),V[c]=f==4?2:f,f&7&&(u=f),h=f}for(let c=o,h=a,u=a;c<l;c++){let f=V[c];if(f==128)c<l-1&&h==V[c+1]&&h&24?f=V[c]=h:V[c]=256;else if(f==64){let g=c+1;for(;g<l&&V[g]==64;)g++;let p=c&&h==8||g<t&&V[g]==8?u==1?1:8:256;for(let x=c;x<g;x++)V[x]=p;c=g-1}else f==8&&u==1&&(V[c]=1);h=f,f&7&&(u=f)}}}function cg(i,e,t,n,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=n.length;o++){let c=o?n[o-1].to:e,h=o<n.length?n[o].from:t;for(let u=c,f,g,p;u<h;u++)if(g=or[f=i.charCodeAt(u)])if(g<0){for(let x=l-3;x>=0;x-=3)if(Ne[x+1]==-g){let w=Ne[x+2],y=w&2?r:w&4?w&1?s:r:0;y&&(V[u]=V[Ne[x]]=y),l=x;break}}else{if(Ne.length==189)break;Ne[l++]=u,Ne[l++]=f,Ne[l++]=a}else if((p=V[u])==2||p==1){let x=p==r;a=x?0:1;for(let w=l-3;w>=0;w-=3){let y=Ne[w+2];if(y&2)break;if(x)Ne[w+2]|=2;else{if(y&4)break;Ne[w+2]|=4}}}}}function dg(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,l=r<t.length?t[r].from:e;for(let a=o;a<l;){let c=V[a];if(c==256){let h=a+1;for(;;)if(h==l){if(r==t.length)break;h=t[r++].to,l=r<t.length?t[r].from:e}else if(V[h]==256)h++;else break;let u=s==1,f=(h<e?V[h]:n)==1,g=u==f?u?1:2:n;for(let p=h,x=r,w=x?t[x-1].to:i;p>a;)p==w&&(p=t[--x].from,w=x?t[x-1].to:i),V[--p]=g;a=h}else s=c,a++}}}function lr(i,e,t,n,r,s,o){let l=n%2?2:1;if(n%2==r%2)for(let a=e,c=0;a<t;){let h=!0,u=!1;if(c==s.length||a<s[c].from){let x=V[a];x!=l&&(h=!1,u=x==16)}let f=!h&&l==1?[]:null,g=h?n:n+1,p=a;e:for(;;)if(c<s.length&&p==s[c].from){if(u)break e;let x=s[c];if(!h)for(let w=x.to,y=c+1;;){if(w==t)break e;if(y<s.length&&s[y].from==w)w=s[y++].to;else{if(V[w]==l)break e;break}}if(c++,f)f.push(x);else{x.from>a&&o.push(new ot(a,x.from,g));let w=x.direction==St!=!(g%2);ar(i,w?n+1:n,r,x.inner,x.from,x.to,o),a=x.to}p=x.to}else{if(p==t||(h?V[p]!=l:V[p]==l))break;p++}f?lr(i,a,p,n+1,r,f,o):a<p&&o.push(new ot(a,p,g)),a=p}else for(let a=t,c=s.length;a>e;){let h=!0,u=!1;if(!c||a>s[c-1].to){let x=V[a-1];x!=l&&(h=!1,u=x==16)}let f=!h&&l==1?[]:null,g=h?n:n+1,p=a;e:for(;;)if(c&&p==s[c-1].to){if(u)break e;let x=s[--c];if(!h)for(let w=x.from,y=c;;){if(w==e)break e;if(y&&s[y-1].to==w)w=s[--y].from;else{if(V[w-1]==l)break e;break}}if(f)f.push(x);else{x.to<a&&o.push(new ot(x.to,a,g));let w=x.direction==St!=!(g%2);ar(i,w?n+1:n,r,x.inner,x.from,x.to,o),a=x.from}p=x.from}else{if(p==e||(h?V[p-1]!=l:V[p-1]==l))break;p--}f?lr(i,p,a,n+1,r,f,o):p<a&&o.push(new ot(p,a,g)),a=p}}function ar(i,e,t,n,r,s,o){let l=e%2?2:1;hg(i,r,s,n,l),cg(i,r,s,n,l),dg(r,s,n,l),lr(i,r,s,e,t,n,o)}function ug(i,e,t){if(!i)return[new ot(0,0,e==Lr?1:0)];if(e==St&&!t.length&&!ag.test(i))return na(i.length);if(t.length)for(;i.length>V.length;)V[V.length]=256;let n=[],r=e==St?0:1;return ar(i,r,r,t,0,i.length,n),n}function na(i){return[new ot(0,i,0)]}let ra="";function fg(i,e,t,n,r){var s;let o=n.head-i.from,l=ot.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),a=e[l],c=a.side(r,t);if(o==c){let f=l+=r?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!r,t),c=a.side(r,t)}let h=Ge(i.text,o,a.forward(r,t));(h<a.from||h>a.to)&&(h=c),ra=i.text.slice(Math.min(o,h),Math.max(o,h));let u=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return u&&h==c&&u.level+(r?0:1)<a.level?M.cursor(u.side(!r,t)+i.from,u.forward(r,t)?1:-1,u.level):M.cursor(h+i.from,a.forward(r,t)?-1:1,a.level)}function gg(i,e,t){for(let n=e;n<t;n++){let r=ta(i.charCodeAt(n));if(r==1)return St;if(r==2||r==4)return Lr}return St}const sa=j.define(),oa=j.define(),la=j.define(),aa=j.define(),hr=j.define(),ha=j.define(),ca=j.define(),Br=j.define(),zr=j.define(),da=j.define({combine:i=>i.some(e=>e)}),pg=j.define({combine:i=>i.some(e=>e)}),ua=j.define();class It{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new It(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new It(M.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Ii=re.define({map:(i,e)=>i.map(e)}),fa=re.define();function Xe(i,e,t){let n=i.facet(aa);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Ue=j.define({combine:i=>i.length?i[0]:!0});let mg=0;const Mt=j.define({combine(i){return i.filter((e,t)=>{for(let n=0;n<t;n++)if(i[n].plugin==e.plugin)return!1;return!0})}});class bi{constructor(e,t,n,r,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Mt.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Mt.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:s,decorations:o}=t||{};return new bi(mg++,e,n,r,l=>{let a=[];return o&&a.push(xi.of(c=>{let h=c.plugin(l);return h?o(h):ye.none})),s&&a.push(s(l)),a})}static fromClass(e,t){return bi.define((n,r)=>new e(n,r),t)}}class $n{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Xe(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Xe(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){Xe(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const ga=j.define(),Nr=j.define(),xi=j.define(),pa=j.define(),Fr=j.define(),ma=j.define();function Bs(i,e){let t=i.state.facet(ma);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return X.spans(n,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,h=o-e.from,u=r;for(let f=l.length-1;f>=0;f--,a--){let g=l[f].spec.bidiIsolate,p;if(g==null&&(g=gg(e.text,c,h)),a>0&&u.length&&(p=u[u.length-1]).to==c&&p.direction==g)p.to=h,u=p.inner;else{let x={from:c,to:h,direction:g,inner:[]};u.push(x),u=x.inner}}}}),r}const ba=j.define();function xa(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(ba)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}const ni=j.define();class Me{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new Me(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(t.length==0)return e;let n=[];for(let r=0,s=0,o=0,l=0;;r++){let a=r==e.length?null:e[r],c=o-l,h=a?a.fromB:1e9;for(;s<t.length&&t[s]<h;){let u=t[s],f=t[s+1],g=Math.max(l,u),p=Math.min(h,f);if(g<=p&&new Me(g+c,p+c,g,p).addToSet(n),f>h)break;s+=2}if(!a)return n;new Me(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,l=a.toB}}}class tn{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=ce.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new Me(s,o,l,a))),this.changedRanges=r}static create(e,t,n){return new tn(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class zs extends q{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=ye.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new ne],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Me(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:h})=>h<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!Cg(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?xg(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;n=new Me(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(D.ie||D.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=vg(o,l,e.changes);return n=Me.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||r.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof Qe&&o.widget instanceof sr&&s.push(o.dom);r.updateGaps(s)}updateChildren(e,t,n){let r=n?n.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let o=r.length-1;;o--){let l=o>=0?r[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:u}=l,f,g,p,x;if(n&&n.range.fromB<u&&n.range.toB>h){let C=ci.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),$=ci.build(this.view.state.doc,n.range.toB,u,this.decorations,this.dynamicDecorationMap);g=C.breakAtStart,p=C.openStart,x=$.openEnd;let S=this.compositionView(n);$.breakAtStart?S.breakAfter=1:$.content.length&&S.merge(S.length,S.length,$.content[0],!1,$.openStart,0)&&(S.breakAfter=$.content[0].breakAfter,$.content.shift()),C.content.length&&S.merge(0,0,C.content[C.content.length-1],!0,0,C.openEnd)&&C.content.pop(),f=C.content.concat(S).concat($.content)}else({content:f,breakAtStart:g,openStart:p,openEnd:x}=ci.build(this.view.state.doc,h,u,this.decorations,this.dynamicDecorationMap));let{i:w,off:y}=s.findPos(c,1),{i:v,off:k}=s.findPos(a,-1);Kl(this,v,k,w,y,f,g,p,x)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(fa)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new Le(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new et(r,[t],t.length);let n=new ne;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=q.get(s);l&&l!=o&&(l.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)n=r.childPos(n.off,1),r=r.children[n.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,s=!r&&!(this.view.state.facet(Ue)||this.dom.tabIndex>-1)&&qi(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&bg(a)){let u=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(u,a.node.childNodes[a.offset]||null)),a=c=new pe(u,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!hi(a.node,a.offset,h.anchorNode,h.anchorOffset)||!hi(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&Sg(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let u=pi(this.view.root);if(u)if(l.empty){if(D.gecko){let f=yg(a.node,a.offset);if(f&&f!=3){let g=(f==1?Vl:ql)(a.node,a.offset);g&&(a=new pe(g.node,g.offset))}}u.collapse(a.node,a.offset),l.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=l.bidiLevel)}else if(u.extend){u.collapse(a.node,a.offset);try{u.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),f.setEnd(c.node,c.offset),f.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(f)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new pe(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new pe(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&hi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=pi(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=ne.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r<t.childNodes.length;r++){let s=q.get(t.childNodes[r]);s instanceof ne&&(n=s.domAtPos(0))}for(let r=e.offset-1;!n&&r>=0;r--){let s=q.get(t.childNodes[r]);s instanceof ne&&(n=s.domAtPos(s.length))}return n?new pe(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=q.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let r=this.children[t];if(n<r.length||r instanceof ne)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,r=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=s-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!n||l instanceof ne&&!(n instanceof ne&&t>=0)))n=l,r=c;else if(n&&c==e&&a==e&&l instanceof Qe&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(n=null)}s=c}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof ne))return null;for(;r.children.length;){let{i:l,off:a}=r.childPos(n,1);for(;;l++){if(l==r.children.length)return null;if((r=r.children[l]).length)break}n=a}if(!(r instanceof Le))return null;let s=Ge(r.text,n);if(s==n)return null;let o=vt(r.dom,n,s).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==xe.LTR;for(let c=0,h=0;h<this.children.length;h++){let u=this.children[h],f=c+u.length;if(f>r)break;if(c>=n){let g=u.dom.getBoundingClientRect();if(t.push(g.height),o){let p=u.dom.lastChild,x=p?mi(p):[];if(x.length){let w=x[x.length-1],y=a?w.right-g.left:g.right-w.left;y>l&&(l=y,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=f)}}}c=f+u.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?xe.RTL:xe.LTR}measureTextSize(){for(let s of this.children)if(s instanceof ne){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=mi(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new _l(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(ye.replace({widget:new sr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return ye.set(e)}updateDeco(){let e=1,t=this.view.state.facet(xi).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(pa).map((s,o)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(X.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(ua))try{if(c(this.view,e.range,e))return!0}catch(h){Xe(this.view.state,h,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=xa(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Gf(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==xe.LTR)}}function bg(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function ya(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let n=Vl(t.focusNode,t.focusOffset),r=ql(t.focusNode,t.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let l=q.get(r.node);if(!l||l instanceof Le&&l.text!=r.node.nodeValue)s=r;else if(i.docView.lastCompositionAfterCursor){let a=q.get(n.node);!a||a instanceof Le&&a.text!=n.node.nodeValue||(s=r)}}if(i.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function xg(i,e,t){let n=ya(i,t);if(!n)return null;let{node:r,from:s,to:o}=n,l=r.nodeValue;if(/[\n\r]/.test(l)||i.state.doc.sliceString(n.from,n.to)!=l)return null;let a=e.invertedDesc,c=new Me(a.mapPos(s),a.mapPos(o),s,o),h=[];for(let u=r.parentNode;;u=u.parentNode){let f=q.get(u);if(f instanceof et)h.push({node:u,deco:f.mark});else{if(f instanceof ne||u.nodeName=="DIV"&&u.parentNode==i.contentDOM)return{range:c,text:r,marks:h,line:u};if(u!=i.contentDOM)h.push({node:u,deco:new $i({inclusive:!0,attributes:rg(u),tagName:u.tagName.toLowerCase()})});else return null}}}function yg(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e<i.childNodes.length&&i.childNodes[e].contentEditable=="false"?2:0)}let wg=class{constructor(){this.changes=[]}compareRange(e,t){_i(e,t,this.changes)}comparePoint(e,t){_i(e,t,this.changes)}boundChange(e){_i(e,e,this.changes)}};function vg(i,e,t){let n=new wg;return X.compare(i,e,t,n),n.changes}function Sg(i,e){for(let t=i;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Cg(i,e){let t=!1;return e&&i.iterChangedRanges((n,r)=>{n<e.to&&r>e.from&&(t=!0)}),t}function kg(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return M.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,l=s;t<0?o=Ge(r.text,s,!1):l=Ge(r.text,s);let a=n(r.text.slice(o,l));for(;o>0;){let c=Ge(r.text,o,!1);if(n(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=Ge(r.text,l);if(n(r.text.slice(l,c))!=a)break;l=c}return M.range(o+r.from,l+r.from)}function $g(i,e){return e.left>i?e.left-i:Math.max(0,i-e.right)}function Tg(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function Tn(i,e){return i.top<e.bottom-1&&i.bottom>e.top+1}function Ns(i,e){return e<i.top?{top:e,left:i.left,right:i.right,bottom:i.bottom}:i}function Fs(i,e){return e>i.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function cr(i,e,t){let n,r,s,o,l=!1,a,c,h,u;for(let p=i.firstChild;p;p=p.nextSibling){let x=mi(p);for(let w=0;w<x.length;w++){let y=x[w];r&&Tn(r,y)&&(y=Ns(Fs(y,r.bottom),r.top));let v=$g(e,y),k=Tg(t,y);if(v==0&&k==0)return p.nodeType==3?Ws(p,e,t):cr(p,e,t);(!n||o>k||o==k&&s>v)&&(n=p,r=y,s=v,o=k,l=v?e<y.left?w>0:w<x.length-1:!0),v==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!u||u.top>y.top)&&(c=p,u=y):h&&Tn(h,y)?h=Fs(h,y.bottom):u&&Tn(u,y)&&(u=Ns(u,y.top))}}if(h&&h.bottom>=t?(n=a,r=h):u&&u.top<=t&&(n=c,r=u),!n)return{node:i,offset:0};let f=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return Ws(n,f,t);if(l&&n.contentEditable!="false")return cr(n,f,t);let g=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:i,offset:g}}function Ws(i,e,t){let n=i.nodeValue.length,r=-1,s=1e9,o=0;for(let l=0;l<n;l++){let a=vt(i,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let u=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&u<s){let f=e>=(h.left+h.right)/2,g=f;if((D.chrome||D.gecko)&&vt(i,l).getBoundingClientRect().left==h.right&&(g=!f),u<=0)return{node:i,offset:l+(g?1:0)};r=l+(g?1:0),s=u}}}return{node:i,offset:r>-1?r:o>0?i.nodeValue.length:0}}function wa(i,e,t,n=-1){var r,s;let o=i.contentDOM.getBoundingClientRect(),l=o.top+i.viewState.paddingTop,a,{docHeight:c}=i.viewState,{x:h,y:u}=e,f=u-l;if(f<0)return 0;if(f>c)return i.state.doc.length;for(let C=i.viewState.heightOracle.textHeight/2,$=!1;a=i.elementAtHeight(f),a.type!=Ve.Text;)for(;f=n>0?a.bottom+C:a.top-C,!(f>=0&&f<=c);){if($)return t?null:0;$=!0,n=-n}u=l+f;let g=a.from;if(g<i.viewport.from)return i.viewport.from==0?0:t?null:Hs(i,o,a,h,u);if(g>i.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:Hs(i,o,a,h,u);let p=i.dom.ownerDocument,x=i.root.elementFromPoint?i.root:p,w=x.elementFromPoint(h,u);w&&!i.contentDOM.contains(w)&&(w=null),w||(h=Math.max(o.left+1,Math.min(o.right-1,h)),w=x.elementFromPoint(h,u),w&&!i.contentDOM.contains(w)&&(w=null));let y,v=-1;if(w&&((r=i.docView.nearest(w))===null||r===void 0?void 0:r.isEditable)!=!1){if(p.caretPositionFromPoint){let C=p.caretPositionFromPoint(h,u);C&&({offsetNode:y,offset:v}=C)}else if(p.caretRangeFromPoint){let C=p.caretRangeFromPoint(h,u);C&&({startContainer:y,startOffset:v}=C,(!i.contentDOM.contains(y)||D.safari&&Ag(y,v,h)||D.chrome&&Rg(y,v,h))&&(y=void 0))}y&&(v=Math.min(qe(y),v))}if(!y||!i.docView.dom.contains(y)){let C=ne.find(i.docView,g);if(!C)return f>a.top+a.height/2?a.to:a.from;({node:y,offset:v}=cr(C.dom,h,u))}let k=i.docView.nearest(y);if(!k)return null;if(k.isWidget&&((s=k.dom)===null||s===void 0?void 0:s.nodeType)==1){let C=k.dom.getBoundingClientRect();return e.y<C.top||e.y<=C.bottom&&e.x<=(C.left+C.right)/2?k.posAtStart:k.posAtEnd}else return k.localPosFromDOM(y,v)+k.posAtStart}function Hs(i,e,t,n,r){let s=Math.round((n-e.left)*i.defaultCharacterWidth);if(i.lineWrapping&&t.height>i.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(i.defaultLineHeight-l)*.5)/l);s+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+_f(o,s,i.state.tabSize)}function Ag(i,e,t){let n,r=i;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(;;){let s=r.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=r.parentNode;if(!o||o.nodeName=="DIV")break;r=o}}return vt(i,n-1,n).getBoundingClientRect().right>t}function Rg(i,e,t){if(e!=0)return!1;for(let r=i;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let n=i.nodeType==1?i.getBoundingClientRect():vt(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Dg(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==Ve.Text&&(r.type!=s.type||(t<0?s.from<e:s.to>e)))&&(r=s)}}return r||n}return n}function Mg(i,e,t,n){let r=Dg(i,e.head,e.assoc||-1),s=!n||r.type!=Ve.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(r.from),a=i.posAtCoords({x:t==(l==xe.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return M.cursor(a,t?-1:1)}return M.cursor(t?r.to:r.from,t?-1:1)}function Vs(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let l=e,a=null;;){let c=fg(r,s,o,l,t),h=ra;if(!c){if(r.number==(t?i.state.doc.lines:1))return l;h=`
|
|
1725
|
-
`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),c=i.visualLineSide(r,!t)}if(a){if(!a(h))return l}else{if(!n)return c;a=n(h)}l=c}}function Og(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==
|
|
1726
|
-
`&&i.lineWrapping&&(n&&(n=M.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:F.of([" "])}),t)return Wr(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function Wr(i,e,t,n=-1){if(D.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(D.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Et(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Et(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Et(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=Lg(i,e,t));return i.state.facet(ha).some(a=>a(i,e.from,e.to,s,l))||i.dispatch(l()),!0}function Lg(i,e,t){let n,r=i.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.from<e.from?r.sliceDoc(s.from,e.from):"",a=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=r.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),h,u=t&&ya(i,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);h={from:u.from,to:u.to-p}}else h=i.state.doc.lineAt(s.head);let f=s.to-e.to,g=s.to-s.from;n=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:l,range:a||p.map(l)};let x=p.to-f,w=x-c.length;if(p.to-p.from!=g||i.state.sliceDoc(w,x)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=r.changes({from:w,to:x,insert:e.insert}),v=p.to-s.to;return{changes:y,range:a?M.range(Math.max(0,a.anchor+v),Math.max(0,a.head+v)):p.map(y)}})}else n={changes:l,selection:a&&r.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function Bg(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s<r&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&i.length==e.length)return null;let o=i.length,l=e.length;for(;o>0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o<s&&i.length<e.length){let a=t<=s&&t>=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=t<=s&&t>=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function zg(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new qs(t,n)),(r!=t||s!=n)&&e.push(new qs(r,s))),e}function Ng(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?M.single(t+e,n+e):null}class Fg{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,D.safari&&e.contentDOM.addEventListener("input",()=>null),D.gecko&&np(e.contentDOM.ownerDocument)}handleEvent(e){!Yg(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Wg(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Vg.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return D.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Sa.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||Hg.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Et(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function _s(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){Xe(t.state,r)}}}function Wg(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&t(l).handlers.push(_s(n.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(_s(n.value,a))}}for(let n in Be)t(n).handlers.push(Be[n]);for(let n in Oe)t(n).observers.push(Oe[n]);return e}const Sa=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Hg="dthko",Vg=[16,17,18,20,91,92,224,225],Pi=6;function Li(i){return Math.max(0,i)*.7+8}function qg(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}class _g{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Yf(e.contentDOM),this.atoms=e.state.facet(Fr).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(G.allowMultipleSelections)&&Kg(e,t),this.dragging=Gg(e,t)&&$a(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&qg(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=xa(this.view);e.clientX-a.left<=r+Pi?t=-Li(r-e.clientX):e.clientX+a.right>=o-Pi&&(t=Li(e.clientX-o)),e.clientY-a.top<=s+Pi?n=-Li(s-e.clientY):e.clientY+a.bottom>=l-Pi&&(n=Li(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let o=Ki(this.atoms,r.from,0);o!=r.from&&(s=M.cursor(o,-1))}else{let o=Ki(this.atoms,r.from,-1),l=Ki(this.atoms,r.to,1);(o!=r.from||l!=r.to)&&(s=M.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(t||(t=e.ranges.slice()),t[n]=s)}return t?M.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Kg(i,e){let t=i.state.facet(sa);return t.length?t[0](e):D.mac?e.metaKey:e.ctrlKey}function Ug(i,e){let t=i.state.facet(oa);return t.length?t[0](e):D.mac?!e.altKey:!e.ctrlKey}function Gg(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=pi(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Yg(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=q.get(t))&&n.ignoreEvent(e))return!1;return!0}const Be=Object.create(null),Oe=Object.create(null),Ca=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Xg(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),ka(i,t.value)},50)}function mn(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function ka(i,e){e=mn(i.state,Br,e);let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(dr!=null&&t.selection.ranges.every(a=>a.empty)&&dr==s.toString()){let a=-1;n=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let u=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:u},range:M.cursor(c.from+u.length)}})}else o?n=t.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:M.cursor(a.from+c.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Oe.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};Be.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Oe.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};Oe.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Be.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(la))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=Zg(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new _g(i,e,t,n)),n&&i.observer.ignore(()=>{Fl(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function Ks(i,e,t,n){if(n==1)return M.cursor(e,t);if(n==2)return kg(i.state,e,t);{let r=ne.find(i.docView,e),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<i.state.doc.length&&l==s.to&&l++,M.range(o,l)}}let Us=(i,e,t)=>e>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function Jg(i,e,t,n){let r=ne.find(i.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&Us(t,n,o))return-1;let l=r.coordsAt(s,1);return l&&Us(t,n,l)?1:o&&o.bottom>=n?-1:1}function Gs(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Jg(i,t,e.clientX,e.clientY)}}const Qg=D.ie&&D.ie_version<=11;let Ys=null,Xs=0,Js=0;function $a(i){if(!Qg)return i.detail;let e=Ys,t=Js;return Ys=i,Js=Date.now(),Xs=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(Xs+1)%3:1}function Zg(i,e){let t=Gs(i,e),n=$a(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,l){let a=Gs(i,s),c,h=Ks(i,a.pos,a.bias,n);if(t.pos!=a.pos&&!o){let u=Ks(i,t.pos,t.bias,n),f=Math.min(u.from,h.from),g=Math.max(u.to,h.to);h=f<h.from?M.range(f,g):M.range(g,f)}return o?r.replaceRange(r.main.extend(h.from,h.to)):l&&n==1&&r.ranges.length>1&&(c=ep(r,a.pos))?c:l?r.addRange(h):M.create([h])}}}function ep(i,e){for(let t=0;t<i.ranges.length;t++){let{from:n,to:r}=i.ranges[t];if(n<=e&&r>=e)return M.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}Be.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=M.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",mn(i.state,zr,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Be.dragend=i=>(i.inputState.draggedContent=null,!1);function Qs(i,e,t,n){if(t=mn(i.state,Br,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&Ug(i,e)?{from:s.from,to:s.to}:null,l={from:r,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}Be.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&Qs(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),s()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return Qs(i,e,n,!0),!0}return!1};Be.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=Ca?null:e.clipboardData;return t?(ka(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Xg(i),!1)};function tp(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function ip(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:mn(i,zr,e.join(i.lineBreak)),ranges:t,linewise:n}}let dr=null;Be.copy=Be.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=ip(i.state);if(!t&&!r)return!1;dr=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=Ca?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(tp(i,t),!1)};const Ta=Yt.define();function Aa(i,e){let t=[];for(let n of i.facet(ca)){let r=n(i,e);r&&t.push(r)}return t.length?i.update({effects:t,annotations:Ta.of(!0)}):null}function Ra(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=Aa(i.state,e);t?i.dispatch(t):i.update([])}},10)}Oe.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),Ra(i)};Oe.blur=i=>{i.observer.clearSelectionRange(),Ra(i)};Oe.compositionstart=Oe.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Oe.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,D.chrome&&D.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Oe.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};Be.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),c=i.posAtDOM(l.endContainer,l.endOffset);return Wr(i,{from:a,to:c,insert:i.state.toText(s)},null),!0}}let r;if(D.chrome&&D.android&&(r=Sa.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return D.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),D.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Oe.compositionend(i,e),20),!1};const Zs=new Set;function np(i){Zs.has(i)||(Zs.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}const eo=["pre-wrap","normal","pre-line","break-spaces"];let Vt=!1;function to(){Vt=!1}class rp{constructor(e){this.lineWrapping=e,this.doc=F.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return eo.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,s,o){let l=eo.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}}class sp{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class He{constructor(e,t,n,r,s){this.from=e,this.length=t,this.top=n,this.height=r,this._content=s}get type(){return typeof this._content=="number"?Ve.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof at?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new He(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var U=function(i){return i[i.ByPos=0]="ByPos",i[i.ByHeight=1]="ByHeight",i[i.ByPosNoHeight=2]="ByPosNoHeight",i}(U||(U={}));const Ui=.001;class we{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Ui&&(Vt=!0),this.height=e)}replace(e,t,n){return we.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:u}=r[l],f=s.lineAt(a,U.ByPosNoHeight,n.setDoc(t),0,0),g=f.to>=c?f:s.lineAt(c,U.ByPosNoHeight,n,0,0);for(u+=g.to-c,c=g.to;l>0&&f.from<=r[l-1].toA;)a=r[l-1].fromA,h=r[l-1].fromB,l--,a<f.from&&(f=s.lineAt(a,U.ByPosNoHeight,n,0,0));h+=f.from-a,a=f.from;let p=Hr.build(n.setDoc(o),e,h,u);s=nn(s,s.replace(a,c,p))}return s.updateHeight(n,0)}static empty(){return new Ae(0,0)}static of(e){if(e.length==1)return e[0];let t=0,n=e.length,r=0,s=0;for(;;)if(t==n)if(r>s*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[t++];l&&(r+=l.size)}else{let l=e[--n];l&&(s+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,n++),new op(we.of(e.slice(0,t)),o,we.of(e.slice(n)))}}function nn(i,e){return i==e?i:(i.constructor!=e.constructor&&(Vt=!0),e)}we.prototype.size=1;class Da extends we{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,r){return new He(r,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,r,s){return this.blockAt(0,n,r,s)}forEachLine(e,t,n,r,s,o){e<=s+this.length&&t>=s&&o(this.blockAt(0,n,r,s))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ae extends Da{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new He(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof Ae||r instanceof de&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof de?r=new Ae(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):we.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class de extends we{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:l}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let c=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),h=t.doc.lineAt(c),u=l+h.length*a,f=Math.max(n,e-u/2);return new He(h.from,h.length,f,u,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-n)/l))),{from:h,length:u}=t.doc.line(s+c);return new He(h,u,n+l*c,l,0)}}lineAt(e,t,n,r,s){if(t==U.ByHeight)return this.blockAt(e,n,r,s);if(t==U.ByPosNoHeight){let{from:g,to:p}=n.doc.lineAt(e);return new He(g,p-g,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(n,s),c=n.doc.lineAt(e),h=l+c.length*a,u=c.number-o,f=r+l*u+a*(c.from-s-u);return new He(c.from,c.length,Math.max(r,Math.min(f,r+this.height-h)),h,0)}forEachLine(e,t,n,r,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(n,s);for(let h=e,u=r;h<=t;){let f=n.doc.lineAt(h);if(h==e){let p=f.number-l;u+=a*p+c*(e-s-p)}let g=a+c*f.length;o(new He(f.from,f.length,u,g,0)),u+=g,h=f.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let s=n[n.length-1];s instanceof de?n[n.length-1]=new de(s.length+r):n.push(null,new de(r-1))}if(e>0){let s=n[0];s instanceof de?n[0]=new de(e+s.length):n.unshift(new de(e-1),null)}return we.of(n)}decomposeLeft(e,t){t.push(new de(e-1),null)}decomposeRight(e,t){t.push(null,new de(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],l=Math.max(t,r.from),a=-1;for(r.from>t&&o.push(new de(r.from-t-1).updateHeight(e,t));l<=s&&r.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let u=r.heights[r.index++];a==-1?a=u:Math.abs(u-a)>=Ui&&(a=-2);let f=new Ae(h,u);f.outdated=!1,o.push(f),l+=h+1}l<=s&&o.push(null,new de(s-l).updateHeight(e,l));let c=we.of(o);return(a<0||Math.abs(c.height-this.height)>=Ui||Math.abs(a-this.heightMetrics(e,t).perLine)>=Ui)&&(Vt=!0),nn(this,c)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class op extends we{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let s=n+this.left.height;return e<s?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,s,r+this.left.length+this.break)}lineAt(e,t,n,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=t==U.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,n,r,s):this.right.lineAt(e,t,n,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==U.ByPosNoHeight?U.ByPosNoHeight:U.ByPos;return a?c.join(this.right.lineAt(l,h,n,o,l)):this.left.lineAt(l,h,n,r,s).join(c)}forEachLine(e,t,n,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,r,s,o),t>=a&&this.right.forEachLine(e,t,n,l,a,o);else{let c=this.lineAt(a,U.ByPos,n,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,s,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,l,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of n)s.push(l);if(e>0&&io(s,o-1),t<this.length){let l=s.length;this.decomposeRight(t,s),io(s,l)}return we.of(s)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?we.of(this.break?[e,null,t]:[e,t]):(this.left=nn(this.left,e),this.right=nn(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:s,right:o}=this,l=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,n,r):o.updateHeight(e,l,n),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function io(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof de&&(n=i[e+1])instanceof de&&i.splice(e-1,3,new de(t.length+1+n.length))}const lp=5;class Hr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Ae?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Ae(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new Da(o,r,n)):(o||s||r>=lp)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ae(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new de(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ae)return e;let t=new Ae(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ae)&&!this.isCovered?this.nodes.push(new Ae(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let r of this.nodes)r instanceof Ae&&r.updateHeight(this.oracle,n),n+=r?r.length:1;return this.nodes}static build(e,t,n,r){let s=new Hr(n,e);return X.spans(t,n,r,s,0),s.finish(n)}}function ap(i,e,t){let n=new hp;return X.compare(i,e,t,n,0),n.changes}class hp{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&_i(e,t,this.changes,5)}}function cp(i,e){let t=i.getBoundingClientRect(),n=i.ownerDocument,r=n.defaultView||window,s=Math.max(0,t.left),o=Math.min(r.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(r.innerHeight,t.bottom);for(let c=i.parentNode;c&&c!=n.body;)if(c.nodeType==1){let h=c,u=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&u.overflow!="visible"){let f=h.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(c==i.parentNode?r.innerHeight:a,f.bottom)}c=u.position=="absolute"||u.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function dp(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function up(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Rn{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],s=t[n];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,t){return ye.replace({widget:new fp(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class fp extends Pr{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class no{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=ro,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=xe.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Nr).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new rp(t),this.stateDeco=e.facet(xi).filter(n=>typeof n!="function"),this.heightMap=we.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle.setDoc(e.doc),[new Me(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ye.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new Bi(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?ro:new Vr(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(si(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(xi).filter(h=>typeof h!="function");let r=e.changedRanges,s=Me.extendWithRanges(r,ap(n,this.stateDeco,e?e.changes:ce.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);to(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Vt)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(pg)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?xe.RTL:xe.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:C,scaleY:$}=Nl(t,l);(C>.005&&Math.abs(this.scaleX-C)>.005||$>.005&&Math.abs(this.scaleY-$)>.005)&&(this.scaleX=C,this.scaleY=$,c|=16,o=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=f)&&(this.paddingTop=u,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=Hl(e.scrollDOM);let p=(this.printing?up:cp)(t,this.paddingTop),x=p.top-this.pixelViewport.top,w=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!dp(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let C=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(C)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:$,charWidth:S,textHeight:R}=e.docView.measureTextSize();o=$>0&&r.refresh(s,$,S,R,Math.max(5,v/S),C),o&&(e.docView.minWidth=0,c|=16)}x>0&&w>0?h=Math.max(x,w):x<0&&w<0&&(h=Math.min(x,w)),to();for(let $ of this.viewports){let S=$.from==this.viewport.from?C:e.docView.measureVisibleLineHeights($);this.heightMap=(o?we.empty().applyChanges(this.stateDeco,F.empty,this.heightOracle,[new Me(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new sp($.from,S))}Vt&&(c|=2)}let k=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return k&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Bi(r.lineAt(o-n*1e3,U.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,U.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),u=r.lineAt(c,U.ByPos,s,0,0),f;t.y=="center"?f=(u.top+u.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?f=u.top:f=u.bottom-h,a=new Bi(r.lineAt(f-1e3/2,U.ByHeight,s,0,0).from,r.lineAt(f+h+1e3/2,U.ByHeight,s,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new Bi(this.heightMap.lineAt(n,U.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,U.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,U.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,U.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||s>=l+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new Rn(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=xe.LTR&&!n)return[];let l=[],a=(h,u,f,g)=>{if(u-h<s)return;let p=this.state.selection.main,x=[p.from];p.empty||x.push(p.to);for(let y of x)if(y>h&&y<u){a(h,y-10,f,g),a(y+10,u,f,g);return}let w=pp(e,y=>y.from>=f.from&&y.to<=f.to&&Math.abs(y.from-h)<s&&Math.abs(y.to-u)<s&&!x.some(v=>y.from<v&&y.to>v));if(!w){if(u<f.to&&t&&n&&t.visibleRanges.some(k=>k.from<=u&&k.to>=u)){let k=t.moveToLineBoundary(M.cursor(u),!1,!0).head;k>h&&(u=k)}let y=this.gapSize(f,h,u,g),v=n||y<2e6?y:2e6;w=new Rn(h,u,y,v)}l.push(w)},c=h=>{if(h.length<o||h.type!=Ve.Text)return;let u=gp(h.from,h.to,this.stateDeco);if(u.total<o)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,g,p;if(n){let x=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,y;if(f!=null){let v=Ni(u,f),k=((this.visibleBottom-this.visibleTop)/2+x)/h.height;w=v-k,y=v+k}else w=(this.visibleTop-h.top-x)/h.height,y=(this.visibleBottom-h.top+x)/h.height;g=zi(u,w),p=zi(u,y)}else{let x=u.total*this.heightOracle.charWidth,w=r*this.heightOracle.charWidth,y=0;if(x>2e6)for(let S of e)S.from>=h.from&&S.from<h.to&&S.size!=S.displaySize&&S.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=S.size-S.displaySize);let v=this.pixelViewport.left+y,k=this.pixelViewport.right+y,C,$;if(f!=null){let S=Ni(u,f),R=((k-v)/2+w)/x;C=S-R,$=S+R}else C=(v-w)/x,$=(k+w)/x;g=zi(u,C),p=zi(u,$)}g>h.from&&a(h.from,g,h,u),p<h.to&&a(p,h.to,h,u)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,n,r){let s=Ni(r,n)-Ni(r,t);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Rn.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ye.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];X.spans(t,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s<n.length&&!(r&8);s++){let o=this.visibleRanges[s],l=n[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||si(this.heightMap.lineAt(e,U.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||si(this.heightMap.lineAt(this.scaler.fromDOM(e),U.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return si(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Bi{constructor(e,t){this.from=e,this.to=t}}function gp(i,e,t){let n=[],r=i,s=0;return X.spans(t,i,e,{span(){},point(o,l){o>r&&(n.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(n.push({from:r,to:e}),s+=e-r),{total:s,ranges:n}}function zi({total:i,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(n<=l)return s+n;n-=l}}function Ni(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function pp(i,e){for(let t of i)if(e(t))return t}const ro={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};class Vr{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let c=t.lineAt(l,U.ByPos,e,0,0).top,h=t.lineAt(a,U.ByPos,e,0,0).bottom;return r+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return r+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,r=s.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return n+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,r=s.domBottom}}eq(e){return e instanceof Vr?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}}function si(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new He(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>si(r,e)):i._content)}const Fi=j.define({combine:i=>i.join(" ")}),ur=j.define({combine:i=>i.indexOf(!0)>-1}),fr=Nt.newName(),Ma=Nt.newName(),Oa=Nt.newName(),ja={"&light":"."+Ma,"&dark":"."+Oa};function gr(i,e,t){return new Nt(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}const mp=gr("."+fr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ja),bp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Dn=D.ie&&D.ie_version<=11;class xp{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Xf,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(D.ie&&D.ie_version<=11||D.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&D.android&&e.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new wp(e),e.state.facet(Ue)&&(e.contentDOM.editContext=this.editContext.editContext)),Dn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Ue)?n.root.activeElement!=this.dom:!qi(this.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!n.state.selection.main.empty&&r.focusNode&&hi(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=pi(e.root);if(!t)return!1;let n=D.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&yp(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=qi(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Qf(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=t)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,bp),Dn&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Dn&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Et(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&qi(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Pg(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=va(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=so(t,e.previousSibling||e.target.previousSibling,-1),r=so(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ue)!=e.state.facet(Ue)&&(e.view.contentDOM.editContext=e.state.facet(Ue)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function so(i,e,t){for(;e;){let n=q.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function oo(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return hi(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function yp(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return oo(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?oo(i,t):null}class wp{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let c={from:l,to:a,insert:F.of(n.text.split(`
|
|
1727
|
-
`))};if(c.from==this.from&&s<this.from?c.from=s:c.to==this.to&&s>this.to&&(c.to=s),c.from==c.to&&!c.insert.length){let h=M.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(r)||e.dispatch({selection:h,userEvent:"select"});return}if((D.mac||D.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:l,to:a,insert:F.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let h=this.to-this.from+(c.to-c.from+c.insert.length);Wr(e,c,M.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let h=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;r.push(ye.mark({attributes:{style:h}}).range(a,c))}}}e.dispatch({effects:fa.of(ye.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=pi(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(n)return;let h=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class W{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Jf(e.parent)||document,this.viewState=new no(e.state||G.create(e)),e.scrollTo&&e.scrollTo.is(Ii)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Mt).map(r=>new $n(r));for(let r of this.plugins)r.update(this);this.observer=new xp(this),this.inputState=new Fg(this),this.inputState.ensureHandlers(this.plugins),this.docView=new zs(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof me?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(Ta))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Aa(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(G.phrases)!=this.state.facet(G.phrases))return this.setState(s);r=tn.create(this,s,e),r.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(u&&(u=u.map(f.changes)),f.scrollIntoView){let{main:g}=f.state.selection;u=new It(g.empty?g:M.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of f.effects)g.is(Ii)&&(u=g.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=rn.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ni)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Fi)!=r.state.facet(Fi)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(hr))try{f(r)}catch(g){Xe(this.state,g,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!va(this,h)&&c.force&&Et(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new no(e),this.plugins=e.facet(Mt).map(n=>new $n(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new zs(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Mt),n=e.state.facet(Mt);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new $n(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(n){Xe(this.state,n,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Hl(n))s=-1,o=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(r);s=g.from,o=g.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(g=>{try{return g.read(this)}catch(p){return Xe(this.state,p),lo}}),u=tn.create(this,this.state,[]),f=!1;u.flags|=a,t?t.flags|=a:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),f=this.docView.update(u),f&&this.docViewUpdate());for(let g=0;g<c.length;g++)if(h[g]!=lo)try{let p=c[g];p.write&&p.write(h[g],this)}catch(p){Xe(this.state,p)}if(f&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(p>1||p<-1){r=r+p,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(hr))l(t)}get themeClasses(){return fr+" "+(this.state.facet(ur)?Oa:Ma)+" "+this.state.facet(Fi)}updateAttrs(){let e=ao(this,ga,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ue)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),ao(this,Nr,t);let n=this.observer.ignore(()=>{let r=rr(this.contentDOM,this.contentAttrs,t),s=rr(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(W.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(ni);let e=this.state.facet(W.cspNonce);Nt.mount(this.root,this.styleModules.concat(mp).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(n=>n.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return An(this,e,Vs(this,e,t,n))}moveByGroup(e,t){return An(this,e,Vs(this,e,t,n=>Og(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return M.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Mg(this,e,t,n)}moveVertically(e,t,n){return An(this,e,jg(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),wa(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[ot.find(s,e-r.from,-1,t)];return gn(n,o.dir==xe.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(da)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>vp)return na(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||ia(s.isolates,n=Bs(this,e))))return s.order;n||(n=Bs(this,e));let r=ug(e.text,t,n);return this.bidiCache.push(new rn(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||D.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Fl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Ii.of(new It(typeof e=="number"?M.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Ii.of(new It(M.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return bi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return bi.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Nt.newName(),r=[Fi.of(n),ni.of(gr(`.${n}`,e))];return t&&t.dark&&r.push(ur.of(!0)),r}static baseTheme(e){return Ef.lowest(ni.of(gr("."+fr,e,ja)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&q.get(n)||q.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}W.styleModule=ni;W.inputHandler=ha;W.clipboardInputFilter=Br;W.clipboardOutputFilter=zr;W.scrollHandler=ua;W.focusChangeEffect=ca;W.perLineTextDirection=da;W.exceptionSink=aa;W.updateListener=hr;W.editable=Ue;W.mouseSelectionStyle=la;W.dragMovesSelection=oa;W.clickAddsSelectionRange=sa;W.decorations=xi;W.outerDecorations=pa;W.atomicRanges=Fr;W.bidiIsolatedRanges=ma;W.scrollMargins=ba;W.darkTheme=ur;W.cspNonce=j.define({combine:i=>i.length?i[0]:""});W.contentAttributes=Nr;W.editorAttributes=ga;W.lineWrapping=W.contentAttributes.of({class:"cm-lineWrapping"});W.announce=re.define();const vp=4096,lo={};class rn{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:xe.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!t.touchesRange(o.from,o.to)&&n.push(new rn(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function ao(i,e,t){for(let n=i.state.facet(e),r=n.length-1;r>=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&nr(o,t)}return t}class qt extends zt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}qt.prototype.elementClass="";qt.prototype.toDOM=void 0;qt.prototype.mapMode=Re.TrackBefore;qt.prototype.startSide=qt.prototype.endSide=-1;qt.prototype.point=!0;const Ea=re.define(),Ia=re.define(),Sp=ye.mark({attributes:{style:"background-color: yellow; color: black"}}),Cp=kt.define({create(){return ye.none},update(i,e){return i=i.map(e.changes),e.effects.forEach(t=>{t.is(Ea)?i=i.update({add:t.value,sort:!0}):t.is(Ia)&&(i=i.update({filter:t.value}))}),i},provide:i=>W.decorations.from(i)}),kp=b.forwardRef(({hasError:i,required:e,id:t,value:n="",disabled:r=!1,onChange:s=()=>null,...o},l)=>{const a=b.useRef(),c=b.useRef(),h=b.useRef(),{error:u,...f}=$e("JsonInput"),g=!!u||i,p=f.id??t,x=f.required||e;let w;u?w=`${p}-error`:f.hint&&(w=`${p}-hint`);const y=L=>{var ee,K;const z=(ee=c.current)==null?void 0:ee.doc;if(z){const{text:_,to:E}=z.line(L),le=E-_.trimStart().length;E>le&&((K=h.current)==null||K.dispatch({effects:Ea.of([Sp.range(le,E)])}))}},v=()=>{var z,ee;const L=(z=c.current)==null?void 0:z.doc;if(L){const K=L.length||0;(ee=h.current)==null||ee.dispatch({effects:Ia.of((_,E)=>E<=0||_>=K)})}},k=({state:L,view:z})=>{h.current=z,c.current=L,v();const K=Jr.jsonParseLinter()(z);K.length&&y(L.doc.lineAt(K[0].from).number)},C=(L,z)=>{k(z),s(L)},$=(L,z)=>{h.current=L,c.current=z,k({view:L,state:z})},{setContainer:S,view:R}=xh.useCodeMirror({value:n,onCreateEditor:$,container:a.current,editable:!r,extensions:[Jr.json(),Cp],onChange:C,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),B=Ce(a,S);return b.useImperativeHandle(l,()=>({...R==null?void 0:R.dom,focus(){R&&R.focus()},scrollIntoView(L){R&&R.dom.scrollIntoView(L)}}),[R]),d.jsx($p,{ref:B,$disabled:r,$hasError:g,alignItems:"stretch",hasRadius:!0,"aria-required":x,id:p,"aria-describedby":w,...o})}),$p=m.styled(T)`
|
|
1718
|
+
`,Tf=b.forwardRef(({icon:i,content:e,action:t,hasRadius:n=!0,shadow:r="tableShadow"},s)=>d.jsxs(T,{ref:s,alignItems:"center",direction:"column",padding:11,background:"neutral0",hasRadius:n,shadow:r,children:[i?d.jsx($f,{paddingBottom:6,"aria-hidden":!0,children:i}):null,d.jsx(A,{paddingBottom:4,children:d.jsx(O,{variant:"delta",tag:"p",textAlign:"center",textColor:"neutral600",children:e})}),t]}));let Fn=[],vl=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<i.length;e++)(e%2?vl:Fn).push(t=t+i[e])})();function Af(i){if(i<768)return!1;for(let e=0,t=Fn.length;;){let n=e+t>>1;if(i<Fn[n])t=n;else if(i>=vl[n])e=n+1;else return!0;if(e==t)return!1}}function Ss(i){return i>=127462&&i<=127487}const Cs=8205;function Rf(i,e,t=!0,n=!0){return(t?Sl:Df)(i,e,n)}function Sl(i,e,t){if(e==i.length)return e;e&&Cl(i.charCodeAt(e))&&kl(i.charCodeAt(e-1))&&e--;let n=Sn(i,e);for(e+=ks(n);e<i.length;){let r=Sn(i,e);if(n==Cs||r==Cs||t&&Af(r))e+=ks(r),n=r;else if(Ss(r)){let s=0,o=e-2;for(;o>=0&&Ss(Sn(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Df(i,e,t){for(;e>0;){let n=Sl(i,e-2,t);if(n<e)return n;e--}return 0}function Sn(i,e){let t=i.charCodeAt(e);if(!kl(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Cl(n)?(t-55296<<10)+(n-56320)+65536:t}function Cl(i){return i>=56320&&i<57344}function kl(i){return i>=55296&&i<56320}function ks(i){return i<65536?1:2}class N{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Bt(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ve.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Bt(this,e,t);let n=[];return this.decompose(e,t,n,0),Ve.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new ai(this),s=new ai(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new ai(this,e)}iterRange(e,t=this.length){return new $l(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Tl(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?N.empty:e.length<=32?new te(e):Ve.from(te.split(e,[]))}}class te extends N{constructor(e,t=Mf(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new Of(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new te($s(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=Hi(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new te(l,o.length+s.length));else{let a=l.length>>1;n.push(new te(l.slice(0,a)),new te(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof te))return super.replace(e,t,n);[e,t]=Bt(this,e,t);let r=Hi(this.text,Hi(n.text,$s(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new te(r,s):Ve.from(te.split(r,[]),s)}sliceString(e,t=this.length,n=`
|
|
1719
|
+
`){[e,t]=Bt(this,e,t);let r="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=n),e<a&&t>s&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new te(n,r)),n=[],r=-1);return r>-1&&t.push(new te(n,r)),t}}class Ve extends N{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&t>=o){let c=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!c?n.push(l):l.decompose(e-o,t-o,n,c)}o=a+1}}replace(e,t,n){if([e,t]=Bt(this,e,t),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&t<=l){let a=o.replace(e-s,t-s,n),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let h=this.children.slice();return h[r]=a,new Ve(h,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
|
|
1720
|
+
`){[e,t]=Bt(this,e,t);let r="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=n),e<a&&t>o&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ve))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],c=e.children[s];if(a!=c)return n+a.scanIdentical(c,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let g of e)n+=g.lines;if(n<32){let g=[];for(let p of e)p.flatten(g);return new te(g,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,h=[];function u(g){let p;if(g.lines>s&&g instanceof Ve)for(let x of g.children)u(x);else g.lines>o&&(a>o||!a)?(f(),l.push(g)):g instanceof te&&a&&(p=h[h.length-1])instanceof te&&g.lines+p.lines<=32?(a+=g.lines,c+=g.length+1,h[h.length-1]=new te(p.text.concat(g.text),p.length+1+g.length)):(a+g.lines>r&&f(),a+=g.lines,c+=g.length+1,h.push(g))}function f(){a!=0&&(l.push(h.length==1?h[0]:Ve.from(h,c)),c=-1,a=h.length=0)}for(let g of e)u(g);return f(),l.length==1?l[0]:new Ve(l,t)}}N.empty=new te([""],0);function Mf(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Hi(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s<i.length&&r<=n;s++){let l=i[s],a=r+l.length;a>=t&&(a>n&&(l=l.slice(0,n-r)),r<t&&(l=l.slice(t-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function $s(i,e,t){return Hi(i,[""],e,t)}class ai{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof te?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof te?r.text.length:r.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
1721
|
+
`,this;e--}else if(r instanceof te){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof te?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class $l{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new ai(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Tl{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(N.prototype[Symbol.iterator]=function(){return this.iter()},ai.prototype[Symbol.iterator]=$l.prototype[Symbol.iterator]=Tl.prototype[Symbol.iterator]=function(){return this});class Of{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function Bt(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function Ye(i,e,t=!0,n=!0){return Rf(i,e,t,n)}const Wn=/\r\n?|\n/;var Me=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(Me||(Me={}));class Qe{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRanges(e,t=!1){Hn(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new Qe(e)}composeDesc(e){return this.empty?e:e.empty?this:Al(this,e)}mapDesc(e,t=!1){return e.empty?this:Vn(this,e,t)}mapPos(e,t=-1,n=Me.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(n!=Me.Simple&&c>=e&&(n==Me.TrackDel&&r<e&&c>e||n==Me.TrackBefore&&r<e||n==Me.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let s=this.sections[n++],o=this.sections[n++],l=r+s;if(o>=0&&r<=t&&l>=e)return r<e&&l>t?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qe(e)}static create(e){return new Qe(e)}}class le extends Qe{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Hn(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return Vn(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r<t.length;r+=2){let o=t[r],l=t[r+1];if(l>=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(N.empty);n.push(o?e.slice(s,s+o):N.empty)}s+=o}return new le(t,n)}compose(e){return this.empty?e:e.empty?this:Al(this,e,!0)}map(e,t=!1){return e.empty?this:Vn(this,e,t,!0)}iterChanges(e,t=!1){Hn(this,e,t)}get desc(){return Qe.create(this.sections)}filter(e){let t=[],n=[],r=[],s=new fi(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,a-l);fe(r,h,-1);let u=s.ins==-1?-1:s.off==0?s.ins:0;fe(t,h,u),u>0&&st(n,t,s.text),s.forward(h),l+=h}let c=e[o++];for(;l<c;){if(s.done)break e;let h=Math.min(s.len,c-l);fe(t,h,-1),fe(r,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),l+=h}}return{changes:new le(t,n),filtered:Qe.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(h=!1){if(!h&&!r.length)return;o<t&&fe(r,t-o,-1);let u=new le(r,s);l=l?l.compose(u.map(l)):u,r=[],s=[],o=0}function c(h){if(Array.isArray(h))for(let u of h)c(u);else if(h instanceof le){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:u,to:f=u,insert:g}=h;if(u>f||u<0||f>t)throw new RangeError(`Invalid change range ${u} to ${f} (in doc of length ${t})`);let p=g?typeof g=="string"?N.of(g.split(n||Wn)):g:N.empty,x=p.length;if(u==f&&x==0)return;u<o&&a(),u>o&&fe(r,u-o,-1),fe(r,f-u,x),st(s,r,p),o=f}}return c(e),a(!l),l}static empty(e){return new le(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<r;)n.push(N.empty);n[r]=N.of(s.slice(1)),t.push(s[0],n[r].length)}}}return new le(t,n)}static createSet(e,t){return new le(e,t)}}function fe(i,e,t,n=!1){if(e==0&&t<=0)return;let r=i.length-2;r>=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function st(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<i.length)i[i.length-1]=i[i.length-1].append(t);else{for(;i.length<n;)i.push(N.empty);i.push(t)}}function Hn(i,e,t){let n=i.inserted;for(let r=0,s=0,o=0;o<i.sections.length;){let l=i.sections[o++],a=i.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,h=s,u=N.empty;for(;c+=l,h+=a,a&&n&&(u=u.append(n[o-2>>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,c,s,h,u),r=c,s=h}}}function Vn(i,e,t,n=!1){let r=[],s=n?[]:null,o=new fi(i),l=new fi(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);fe(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let c=l.len;for(fe(r,l.ins,-1);c;){let h=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=h&&(fe(r,0,o.ins),s&&st(s,r,o.text),a=o.i),o.forward(h),c-=h}l.next()}else if(o.ins>=0){let c=0,h=o.len;for(;h;)if(l.ins==-1){let u=Math.min(h,l.len);c+=u,h-=u,l.forward(u)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;fe(r,c,a<o.i?o.ins:0),s&&a<o.i&&st(s,r,o.text),a=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return s?le.createSet(r,s):Qe.create(r);throw new Error("Mismatched change set lengths")}}}function Al(i,e,t=!1){let n=[],r=t?[]:null,s=new fi(i),o=new fi(e);for(let l=!1;;){if(s.done&&o.done)return r?le.createSet(n,r):Qe.create(n);if(s.ins==0)fe(n,s.len,0,l),s.next();else if(o.len==0&&!o.done)fe(n,0,o.ins,l),r&&st(r,n,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=n.length;if(s.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;fe(n,a,h,l),r&&h&&st(r,n,o.text)}else o.ins==-1?(fe(n,s.off?0:s.len,a,l),r&&st(r,n,s.textBit(a))):(fe(n,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&st(r,n,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||n.length>c),s.forward2(a),o.forward(a)}}}}class fi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?N.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?N.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class mt{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new mt(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return M.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return M.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return M.range(e.anchor,e.head)}static create(e,t,n){return new mt(e,t,n)}}class M{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:M.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new M([this.main],0)}addRange(e,t=!0){return M.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,M.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new M(e.ranges.map(t=>mt.fromJSON(t)),e.main)}static single(e,t=e){return new M([M.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=n:s.from<n)return M.normalized(e.slice(),t);n=s.to}return new M(e,t)}static cursor(e,t=0,n,r){return mt.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(r??16777215)<<6)}static range(e,t,n,r){let s=(n??16777215)<<6|(r==null?7:Math.min(6,r));return t<e?mt.create(t,e,48|s):mt.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?M.range(a,l):M.range(l,a))}}return new M(e,t)}}function Rl(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Er=0;class j{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Er++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new j(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:Ir),!!e.static,e.enables)}of(e){return new Vi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vi(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function Ir(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class Vi{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Er++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,h=[];for(let u of this.dependencies)u=="doc"?a=!0:u=="selection"?c=!0:((t=e[u.id])!==null&&t!==void 0?t:1)&1||h.push(e[u.id]);return{create(u){return u.values[o]=n(u),1},update(u,f){if(a&&f.docChanged||c&&(f.docChanged||f.selection)||qn(u,h)){let g=n(u);if(l?!Ts(g,u.values[o],r):!r(g,u.values[o]))return u.values[o]=g,1}return 0},reconfigure:(u,f)=>{let g,p=f.config.address[s];if(p!=null){let x=Qi(f,p);if(this.dependencies.every(w=>w instanceof j?f.facet(w)===u.facet(w):w instanceof $t?f.field(w,!1)==u.field(w,!1):!0)||(l?Ts(g=n(u),x,r):r(g=n(u),x)))return u.values[o]=x,0}else g=n(u);return u.values[o]=g,1}}}}function Ts(i,e,t){if(i.length!=e.length)return!1;for(let n=0;n<i.length;n++)if(!t(i[n],e[n]))return!1;return!0}function qn(i,e){let t=!1;for(let n of e)hi(i,n)&1&&(t=!0);return t}function jf(i,e,t){let n=t.map(a=>i[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let c=[];for(let h=0;h<n.length;h++){let u=Qi(a,n[h]);if(r[h]==2)for(let f of u)c.push(f);else c.push(u)}return e.combine(c)}return{create(a){for(let c of n)hi(a,c);return a.values[o]=l(a),1},update(a,c){if(!qn(a,s))return 0;let h=l(a);return e.compare(h,a.values[o])?0:(a.values[o]=h,1)},reconfigure(a,c){let h=qn(a,n),u=c.config.facets[e.id],f=c.facet(e);if(u&&!h&&Ir(t,u))return a.values[o]=f,0;let g=l(a);return e.compare(g,f)?(a.values[o]=f,0):(a.values[o]=g,1)}}}const Oi=j.define({static:!0});class $t{constructor(e,t,n,r,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new $t(Er++,e.create,e.update,e.compare||((n,r)=>n===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Oi).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(Oi),o=r.facet(Oi),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,Oi.of({field:this,create:e})]}get extension(){return this}}const gt={lowest:4,low:3,default:2,high:1,highest:0};function ei(i){return e=>new Dl(e,i)}const Ef={highest:ei(gt.highest),high:ei(gt.high),default:ei(gt.default),low:ei(gt.low),lowest:ei(gt.lowest)};class Dl{constructor(e,t){this.inner=e,this.prec=t}}class gn{of(e){return new _n(this,e)}reconfigure(e){return gn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class _n{constructor(e,t){this.compartment=e,this.inner=t}}class Ji{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of If(e,t,o))f instanceof $t?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],c=[];for(let f of r)l[f.id]=c.length<<1,c.push(g=>f.slot(g));let h=n==null?void 0:n.config.facets;for(let f in s){let g=s[f],p=g[0].facet,x=h&&h[f]||[];if(g.every(w=>w.type==0))if(l[p.id]=a.length<<1|1,Ir(x,g))a.push(n.facet(p));else{let w=p.combine(g.map(y=>y.value));a.push(n&&p.compare(w,n.facet(p))?n.facet(p):w)}else{for(let w of g)w.type==0?(l[w.id]=a.length<<1|1,a.push(w.value)):(l[w.id]=c.length<<1,c.push(y=>w.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(w=>jf(w,p,g))}}let u=c.map(f=>f(l));return new Ji(e,o,u,l,a,s)}}function If(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=n[a].indexOf(o);c>-1&&n[a].splice(c,1),o instanceof _n&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof _n){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,l)}else if(o instanceof Dl)s(o.inner,o.prec);else if(o instanceof $t)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Vi)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,gt.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(i,gt.default),n.reduce((o,l)=>o.concat(l))}function hi(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Qi(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const Ml=j.define(),Kn=j.define({combine:i=>i.some(e=>e),static:!0}),Ol=j.define({combine:i=>i.length?i[0]:void 0,static:!0}),jl=j.define(),El=j.define(),Il=j.define(),Pl=j.define({combine:i=>i.length?i[0]:!1});class Yt{constructor(e,t){this.type=e,this.value=t}static define(){return new Pf}}class Pf{of(e){return new Yt(this,e)}}class Lf{constructor(e){this.map=e}of(e){return new se(this,e)}}class se{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new se(this.type,t)}is(e){return this.type==e}static define(e={}){return new Lf(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}}se.reconfigure=se.define();se.appendConfig=se.define();class pe{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&Rl(n,t.newLength),s.some(l=>l.type==pe.time)||(this.annotations=s.concat(pe.time.of(Date.now())))}static create(e,t,n,r,s,o){return new pe(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(pe.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}pe.time=Yt.define();pe.userEvent=Yt.define();pe.addToHistory=Yt.define();pe.remote=Yt.define();function Bf(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n<i.length&&(r==e.length||e[r]>=i[n]))s=i[n++],o=i[n++];else if(r<e.length)s=e[r++],o=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Ll(i,e,t){var n;let r,s,o;return t?(r=e.changes,s=le.empty(e.changes.length),o=i.changes.compose(e.changes)):(r=e.changes.map(i.changes),s=i.changes.mapDesc(e.changes,!0),o=i.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(n=i.selection)===null||n===void 0?void 0:n.map(r),effects:se.mapEffects(i.effects,r).concat(se.mapEffects(e.effects,s)),annotations:i.annotations.length?i.annotations.concat(e.annotations):e.annotations,scrollIntoView:i.scrollIntoView||e.scrollIntoView}}function Un(i,e,t){let n=e.selection,r=Et(e.annotations);return e.userEvent&&(r=r.concat(pe.userEvent.of(e.userEvent))),{changes:e.changes instanceof le?e.changes:le.of(e.changes||[],t,i.facet(Ol)),selection:n&&(n instanceof M?n:M.single(n.anchor,n.head)),effects:Et(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function Bl(i,e,t){let n=Un(i,e.length?e[0]:{},i.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;n=Ll(n,Un(i,e[s],o?n.changes.newLength:i.doc.length),o)}let r=pe.create(i,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return Nf(t?zf(r):r)}function zf(i){let e=i.startState,t=!0;for(let r of e.facet(jl)){let s=r(i);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:Bf(t,s))}if(t!==!0){let r,s;if(t===!1)s=i.changes.invertedDesc,r=le.empty(e.doc.length);else{let o=i.changes.filter(t);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}i=pe.create(e,r,i.selection&&i.selection.map(s),se.mapEffects(i.effects,s),i.annotations,i.scrollIntoView)}let n=e.facet(El);for(let r=n.length-1;r>=0;r--){let s=n[r](i);s instanceof pe?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof pe?i=s[0]:i=Bl(e,Et(s),!1)}return i}function Nf(i){let e=i.startState,t=e.facet(Il),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=Ll(n,Un(e,s,i.changes.newLength),!0))}return n==i?i:pe.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const Ff=[];function Et(i){return i==null?Ff:Array.isArray(i)?i:[i]}var Xe=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(Xe||(Xe={}));const Wf=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Gn;try{Gn=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Hf(i){if(Gn)return Gn.test(i);for(let e=0;e<i.length;e++){let t=i[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||Wf.test(t)))return!0}return!1}function Vf(i){return e=>{if(!/\S/.test(e))return Xe.Space;if(Hf(e))return Xe.Word;for(let t=0;t<i.length;t++)if(e.indexOf(i[t])>-1)return Xe.Word;return Xe.Other}}class Y{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)hi(this,l<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return hi(this,n),Qi(this,n)}update(...e){return Bl(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:r}=t;for(let l of e.effects)l.is(gn.reconfigure)?(t&&(r=new Map,t.compartments.forEach((a,c)=>r.set(c,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(se.reconfigure)?(t=null,n=l.value):l.is(se.appendConfig)&&(t=null,n=Et(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=Ji.resolve(n,r,this),s=new Y(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(Kn)?e.newSelection:e.newSelection.asSingle();new Y(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:M.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Et(n.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),c=this.changes(a.changes),h=c.map(r);for(let f=0;f<l;f++)s[f]=s[f].map(h);let u=r.mapDesc(c,!0);s.push(a.range.map(u)),r=r.compose(h),o=se.mapEffects(o,h).concat(se.mapEffects(Et(a.effects),u))}return{changes:r,selection:M.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof le?e:le.of(e,this.doc.length,this.facet(Y.lineSeparator))}toText(e){return N.of(e.split(this.facet(Y.lineSeparator)||Wn))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(hi(this,t),Qi(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof $t&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let o=n[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return Y.create({doc:e.doc,selection:M.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Ji.resolve(e.extensions||[],new Map),n=e.doc instanceof N?e.doc:N.of((e.doc||"").split(t.staticFacet(Y.lineSeparator)||Wn)),r=e.selection?e.selection instanceof M?e.selection:M.single(e.selection.anchor,e.selection.head):M.single(0);return Rl(r,n.length),t.staticFacet(Kn)||(r=r.asSingle()),new Y(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Y.tabSize)}get lineBreak(){return this.facet(Y.lineSeparator)||`
|
|
1722
|
+
`}get readOnly(){return this.facet(Pl)}phrase(e,...t){for(let n of this.facet(Y.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(Ml))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return Vf(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=Ye(t,o,!1);if(s(t.slice(a,o))!=Xe.Word)break;o=a}for(;l<r;){let a=Ye(t,l);if(s(t.slice(l,a))!=Xe.Word)break;l=a}return o==l?null:M.range(o+n,l+n)}}Y.allowMultipleSelections=Kn;Y.tabSize=j.define({combine:i=>i.length?i[0]:4});Y.lineSeparator=Ol;Y.readOnly=Pl;Y.phrases=j.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});Y.languageData=Ml;Y.changeFilter=jl;Y.transactionFilter=El;Y.transactionExtender=Il;gn.reconfigure=se.define();class zt{eq(e){return this==e}range(e,t=e){return gi.create(e,t,this)}}zt.prototype.startSide=zt.prototype.endSide=0;zt.prototype.point=!1;zt.prototype.mapMode=Me.TrackDel;class gi{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new gi(e,t,n)}}function Yn(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class Pr{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],h=this.from[a]+e,u=this.to[a]+e,f,g;if(h==u){let p=t.mapPos(h,c.startSide,c.mapMode);if(p==null||(f=g=p,c.startSide!=c.endSide&&(g=t.mapPos(h,c.endSide),g<f)))continue}else if(f=t.mapPos(h,c.startSide),g=t.mapPos(u,c.endSide),f>g||f==g&&c.startSide>0&&c.endSide<=0)continue;(g-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(l=Math.max(l,g-f)),n.push(c),r.push(f-o),s.push(g-o))}return{mapped:n.length?new Pr(r,s,n,l):null,pos:o}}}class X{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new X(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Yn)),this.isEmpty)return t.length?X.of(t):this;let l=new zl(this,null,-1).goto(0),a=0,c=[],h=new Zi;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let u=t[a++];h.addInner(u.from,u.to,u.value)||c.push(u)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||c.push(gi.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!c.length?X.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),t.push(a),n.push(e.mapPos(l));else if(c===!0){let{mapped:h,pos:u}=a.map(l,e);h&&(r=Math.max(r,h.maxPoint),t.push(h),n.push(u))}}let s=this.nextLayer.map(e);return t.length==0?s:new X(n,t,s||X.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return pi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return pi.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),l=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),a=As(o,l,n),c=new ti(o,a,s),h=new ti(l,a,s);n.iterGaps((u,f,g)=>Rs(c,u,h,f,g,r)),n.empty&&n.length==0&&Rs(c,0,h,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=As(s,o),a=new ti(s,l,0).goto(n),c=new ti(o,l,0).goto(n);for(;;){if(a.to!=c.to||!Xn(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,t,n,r,s=-1){let o=new ti(e,null,s).goto(t),l=t,a=o.openStart;for(;;){let c=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),u=o.pointFrom<t?h.length+1:o.point.startSide<0?h.length:Math.min(h.length,a);r.point(l,c,o.point,h,u,o.pointRank),a=Math.min(o.openEnd(c),h.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new Zi;for(let r of e instanceof gi?[e]:t?qf(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return X.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=X.empty;r=r.nextLayer)t=new X(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}X.empty=new X([],[],null,-1);function qf(i){if(i.length>1)for(let e=i[0],t=1;t<i.length;t++){let n=i[t];if(Yn(e,n)>0)return i.slice().sort(Yn);e=n}return i}X.empty.nextLayer=X.empty;class Zi{finishChunk(e){this.chunks.push(new Pr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Zi)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(X.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=X.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function As(i,e,t){let n=new Map;for(let s of i)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&n.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=n.get(s.chunk[o]);l!=null&&(t?t.mapPos(l):l)==s.chunkPos[o]&&!(t!=null&&t.touchesRange(l,l+s.chunk[o].length))&&r.add(s.chunk[o])}return r}class zl{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class pi{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&r.push(new zl(o,t,n,s));return r.length==1?r[0]:new pi(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)Cn(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)Cn(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Cn(this.heap,0)}}}function Cn(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1<i.length&&r.compare(i[n+1])>=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}class ti{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pi.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ji(this.active,e),ji(this.activeTo,e),ji(this.activeRank,e),this.minActive=Ds(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||r-this.activeTo[t])>0;)t++;Ei(this.active,t,n),Ei(this.activeTo,t,r),Ei(this.activeRank,t,s),e&&Ei(e,t,this.cursor.from),this.minActive=Ds(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&ji(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let r=n.length-1;r>=0&&n[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function Rs(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,l=n,a=n-e;for(;;){let c=i.to+a-t.to,h=c||i.endSide-t.endSide,u=h<0?i.to+a:t.to,f=Math.min(u,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Xn(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(l,f,i.point,t.point):f>l&&!Xn(i.active,t.active)&&s.compareRange(l,f,i.active,t.active),u>o)break;(c||i.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(u),l=u,h<=0&&i.next(),h>=0&&t.next()}}function Xn(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++)if(i[t]!=e[t]&&!i[t].eq(e[t]))return!1;return!0}function ji(i,e){for(let t=e,n=i.length-1;t<n;t++)i[t]=i[t+1];i.pop()}function Ei(i,e,t){for(let n=i.length-1;n>=e;n--)i[n+1]=i[n];i[e]=t}function Ds(i,e){let t=-1,n=1e9;for(let r=0;r<e.length;r++)(e[r]-n||i[r].endSide-i[t].endSide)<0&&(t=r,n=e[r]);return t}function _f(i,e,t,n){for(let r=0,s=0;;){if(s>=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=Ye(i,r)}return i.length}const Jn="ͼ",Ms=typeof Symbol>"u"?"__"+Jn:Symbol.for(Jn),Qn=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Os=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Nt{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let h=[],u=/^@(\w+)\b/.exec(o[0]),f=u&&u[1]=="keyframes";if(u&&l==null)return a.push(o[0]+";");for(let g in l){let p=l[g];if(/&/.test(g))s(g.split(/,\s*/).map(x=>o.map(w=>x.replace(/&/,w))).reduce((x,w)=>x.concat(w)),p,a);else if(p&&typeof p=="object"){if(!u)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(r(g),p,h,f)}else p!=null&&h.push(g.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+p+";")}(h.length||f)&&a.push((n&&!u&&!c?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
1723
|
+
`)}static newName(){let e=Os[Ms]||1;return Os[Ms]=e+1,Jn+e.toString(36)}static mount(e,t,n){let r=e[Qn],s=n&&n.nonce;r?s&&r.setNonce(s):r=new Kf(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let js=new Map;class Kf{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=js.get(n);if(s)return e[Qn]=s;this.sheet=new r.CSSStyleSheet,js.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Qn]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let c=0;c<l.rules.length;c++)n.insertRule(l.rules[c],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
|
1724
|
+
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ft={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:"'"},Zn={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'};for(var ue=0;ue<10;ue++)Ft[48+ue]=Ft[96+ue]=String(ue);for(var ue=1;ue<=24;ue++)Ft[ue+111]="F"+ue;for(var ue=65;ue<=90;ue++)Ft[ue]=String.fromCharCode(ue+32),Zn[ue]=String.fromCharCode(ue);for(var kn in Ft)Zn.hasOwnProperty(kn)||(Zn[kn]=Ft[kn]);function mi(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function er(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function qi(i,e){if(!e.anchorNode)return!1;try{return er(i,e.anchorNode)}catch{return!1}}function bi(i){return i.nodeType==3?St(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function ci(i,e,t,n){return t?Es(i,e,t,n,-1)||Es(i,e,t,n,1):!1}function vt(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function en(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function Es(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:Ke(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=vt(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?Ke(i):0}else return!1}}function Ke(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function pn(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function Uf(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function Nl(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function Gf(i,e,t,n,r,s,o,l){let a=i.ownerDocument,c=a.defaultView||window;for(let h=i,u=!1;h&&!u;)if(h.nodeType==1){let f,g=h==a.body,p=1,x=1;if(g)f=Uf(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(u=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let v=h.getBoundingClientRect();({scaleX:p,scaleY:x}=Nl(h,v)),f={left:v.left,right:v.left+h.clientWidth*p,top:v.top,bottom:v.top+h.clientHeight*x}}let w=0,y=0;if(r=="nearest")e.top<f.top?(y=e.top-(f.top+o),t>0&&e.bottom>f.bottom+y&&(y=e.bottom-f.bottom+o)):e.bottom>f.bottom&&(y=e.bottom-f.bottom+o,t<0&&e.top-y<f.top&&(y=e.top-(f.top+o)));else{let v=e.bottom-e.top,k=f.bottom-f.top;y=(r=="center"&&v<=k?e.top+v/2-k/2:r=="start"||r=="center"&&t<0?e.top-o:e.bottom-k+o)-f.top}if(n=="nearest"?e.left<f.left?(w=e.left-(f.left+s),t>0&&e.right>f.right+w&&(w=e.right-f.right+s)):e.right>f.right&&(w=e.right-f.right+s,t<0&&e.left<f.left+w&&(w=e.left-(f.left+s))):w=(n=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:n=="start"==l?e.left-s:e.right-(f.right-f.left)+s)-f.left,w||y)if(g)c.scrollBy(w,y);else{let v=0,k=0;if(y){let S=h.scrollTop;h.scrollTop+=y/x,k=(h.scrollTop-S)*x}if(w){let S=h.scrollLeft;h.scrollLeft+=w/p,v=(h.scrollLeft-S)*p}e={left:e.left-v,top:e.top-k,right:e.right-v,bottom:e.bottom-k},v&&Math.abs(v-w)<1&&(n="nearest"),k&&Math.abs(k-y)<1&&(r="nearest")}if(g)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Yf(i){let e=i.ownerDocument,t,n;for(let r=i.parentNode;r&&!(r==e.body||t&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:n}}class Xf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Ke(t):0),n,Math.min(e.focusOffset,n?Ke(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let Dt=null;function Fl(i){if(i.setActive)return i.setActive();if(Dt)return i.focus(Dt);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(Dt==null?{get preventScroll(){return Dt={preventScroll:!0},!0}}:void 0),!Dt){Dt=!1;for(let t=0;t<e.length;){let n=e[t++],r=e[t++],s=e[t++];n.scrollTop!=r&&(n.scrollTop=r),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let Is;function St(i,e,t=e){let n=Is||(Is=document.createRange());return n.setEnd(i,t),n.setStart(i,e),n}function It(i,e,t,n){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};n&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=n);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,i.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,i.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function Jf(i){for(;i;){if(i&&(i.nodeType==9||i.nodeType==11&&i.host))return i;i=i.assignedSlot||i.parentNode}return null}function Wl(i){for(;i.attributes.length;)i.removeAttributeNode(i.attributes[0])}function Qf(i,e){let t=e.focusNode,n=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=n)return!1;for(n=Math.min(n,Ke(t));;)if(n){if(t.nodeType!=1)return!1;let r=t.childNodes[n-1];r.contentEditable=="false"?n--:(t=r,n=Ke(t))}else{if(t==i)return!0;n=vt(t),t=t.parentNode}}function Hl(i){return i.scrollTop>Math.max(1,i.scrollHeight-i.clientHeight-4)}function Vl(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Ke(t)}else if(t.parentNode&&!en(t))n=vt(t),t=t.parentNode;else return null}}function ql(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n<t.nodeValue.length)return{node:t,offset:n};if(t.nodeType==1&&n<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[n],n=0}else if(t.parentNode&&!en(t))n=vt(t)+1,t=t.parentNode;else return null}}class ge{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new ge(e.parentNode,vt(e),t)}static after(e,t){return new ge(e.parentNode,vt(e)+1,t)}}const Lr=[];class q{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,r=null,s;for(let o of this.children){if(o.flags&7){if(!o.dom&&(s=r?r.nextSibling:n.firstChild)){let l=q.get(s);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(s)}o.sync(e,t),o.flags&=-8}if(s=r?r.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&s!=o.dom&&(t.written=!0),o.dom.parentNode==n)for(;s&&s!=o.dom;)s=Ps(s);else n.insertBefore(o.dom,s);r=o.dom}for(s=r?r.nextSibling:n.firstChild,s&&t&&t.node==n&&(t.written=!0);s;)s=Ps(s)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let r=Ke(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;r==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?r=-1:r=1),e=s}r<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!q.get(n);)n=n.nextSibling;if(!n)return this.length;for(let r=0,s=0;;r++){let o=this.children[r];if(o.dom==n)return s;s+=o.length+o.breakAfter}}domBoundsAround(e,t,n=0){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=n,h=n;a<this.children.length;a++){let u=this.children[a],f=c+u.length;if(c<e&&f>t)return u.domBoundsAround(e,t,c);if(f>=e&&r==-1&&(r=a,s=c),c>t&&u.dom.parentNode==this.dom){o=a,l=h;break}h=f,c=f+u.breakAfter}return{from:s,to:l<0?n+this.length:l,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Lr){this.markDirty();for(let r=e;r<t;r++){let s=this.children[r];s.parent==this&&n.indexOf(s)<0&&s.destroy()}n.length<250?this.children.splice(e,t-e,...n):this.children=[].concat(this.children.slice(0,e),n,this.children.slice(t));for(let r=0;r<n.length;r++)n[r].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new _l(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,r,s,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}q.prototype.breakAfter=0;function Ps(i){let e=i.nextSibling;return i.parentNode.removeChild(i),e}class _l{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Kl(i,e,t,n,r,s,o,l,a){let{children:c}=i,h=c.length?c[e]:null,u=s.length?s[s.length-1]:null,f=u?u.breakAfter:o;if(!(e==n&&h&&!o&&!f&&s.length<2&&h.merge(t,r,s.length?u:null,t==0,l,a))){if(n<c.length){let g=c[n];g&&(r<g.length||g.breakAfter&&(u!=null&&u.breakAfter))?(e==n&&(g=g.split(r),r=0),!f&&u&&g.merge(0,r,u,!0,0,a)?s[s.length-1]=g:((r||g.children.length&&!g.children[0].length)&&g.merge(0,r,null,!1,0,a),s.push(g))):g!=null&&g.breakAfter&&(u?u.breakAfter=1:o=1),n++}for(h&&(h.breakAfter=o,t>0&&(!o&&s.length&&h.merge(t,h.length,s[0],!1,l,0)?h.breakAfter=s.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,l,0),e++));e<n&&s.length;)if(c[n-1].become(s[s.length-1]))n--,s.pop(),a=s.length?0:l;else if(c[e].become(s[0]))e++,s.shift(),l=s.length?0:a;else break;!s.length&&e&&n<c.length&&!c[e-1].breakAfter&&c[n].merge(0,0,c[e-1],!1,l,a)&&e--,(e<n||s.length)&&i.replaceChildren(e,n,s)}}function Ul(i,e,t,n,r,s){let o=i.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:h}=o.findPos(e,-1),u=e-t;for(let f of n)u+=f.length;i.length+=u,Kl(i,c,h,l,a,n,0,r,s)}let Oe=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},tr=typeof document<"u"?document:{documentElement:{style:{}}};const ir=/Edge\/(\d+)/.exec(Oe.userAgent),Gl=/MSIE \d/.test(Oe.userAgent),nr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Oe.userAgent),mn=!!(Gl||nr||ir),Ls=!mn&&/gecko\/(\d+)/i.test(Oe.userAgent),$n=!mn&&/Chrome\/(\d+)/.exec(Oe.userAgent),Zf="webkitFontSmoothing"in tr.documentElement.style,Yl=!mn&&/Apple Computer/.test(Oe.vendor),Bs=Yl&&(/Mobile\/\w+/.test(Oe.userAgent)||Oe.maxTouchPoints>2);var D={mac:Bs||/Mac/.test(Oe.platform),ie:mn,ie_version:Gl?tr.documentMode||6:nr?+nr[1]:ir?+ir[1]:0,gecko:Ls,gecko_version:Ls?+(/Firefox\/(\d+)/.exec(Oe.userAgent)||[0,0])[1]:0,chrome:!!$n,chrome_version:$n?+$n[1]:0,ios:Bs,android:/Android\b/.test(Oe.userAgent),safari:Yl,webkit_version:Zf?+(/\bAppleWebKit\/(\d+)/.exec(Oe.userAgent)||[0,0])[1]:0,tabSize:tr.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const eg=256;class ze extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof ze)||this.length-(t-e)+n.length>eg||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new ze(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ge(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return tg(this.dom,e,t)}}class tt extends q{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(Wl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,s,o){return n&&(!(n instanceof tt&&n.mark.eq(this.mark))||e&&s<=0||t<this.length&&o<=0)?!1:(Ul(this,e,t,n?n.children.slice():[],s-1,o-1),this.markDirty(),!0)}split(e){let t=[],n=0,r=-1,s=0;for(let l of this.children){let a=n+l.length;a>e&&t.push(n<e?l.split(e-n):l),r<0&&n>=e&&(r=s),n=a,s++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new tt(this.mark,t,o)}domAtPos(e){return Xl(this,e)}coordsAt(e,t){return Ql(this,e,t)}}function tg(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?D.chrome||D.gecko||(e?(r--,o=1):s<n&&(s++,o=-1)):t<0?r--:s<n&&s++;let l=St(i,r,s).getClientRects();if(!l.length)return null;let a=l[(o?o<0:t>=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?pn(a,o<0):a||null}class bt extends q{static create(e,t,n){return new bt(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=bt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,s,o){return n&&(!(n instanceof bt)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}become(e){return e instanceof bt&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return N.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,r=this.posAtStart;return n?n.slice(r,r+this.length):N.empty}domAtPos(e){return(this.length?e==0:this.side>0)?ge.before(this.dom):ge.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?r.length-1:0;s=r[l],!(e>0?l==0:l==r.length-1||s.top<s.bottom);l+=o?-1:1);return pn(s,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Wt extends q{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Wt&&e.side==this.side}split(){return new Wt(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?ge.before(this.dom):ge.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return N.empty}get isHidden(){return!0}}ze.prototype.children=bt.prototype.children=Wt.prototype.children=Lr;function Xl(i,e){let t=i.dom,{children:n}=i,r=0;for(let s=0;r<n.length;r++){let o=n[r],l=s+o.length;if(!(l==s&&o.getSide()<=0)){if(e>s&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-s);if(e<=s)break;s=l}}for(let s=r;s>0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=r;s<n.length;s++){let o=n[s];if(o.dom.parentNode==t)return o.domAtPos(0)}return new ge(t,0)}function Jl(i,e,t){let n,{children:r}=i;t>0&&e instanceof tt&&r.length&&(n=r[r.length-1])instanceof tt&&n.mark.eq(e.mark)?Jl(n,e.children[0],t-1):(r.push(e),e.setParent(i)),i.length+=e.length}function Ql(i,e,t){let n=null,r=-1,s=null,o=-1;function l(c,h){for(let u=0,f=0;u<c.children.length&&f<=h;u++){let g=c.children[u],p=f+g.length;p>=h&&(g.children.length?l(g,h-f):(!s||s.isHidden&&(t>0||ng(s,g)))&&(p>h||f==p&&g.getSide()>0)?(s=g,o=h-f):(f<h||f==p&&g.getSide()<0&&!g.isHidden)&&(n=g,r=h-f)),f=p}}l(i,e);let a=(t<0?n:s)||n||s;return a?a.coordsAt(Math.max(0,a==n?r:o),t):ig(i)}function ig(i){let e=i.dom.lastChild;if(!e)return i.dom.getBoundingClientRect();let t=bi(e);return t[t.length-1]||null}function ng(i,e){let t=i.coordsAt(0,1),n=e.coordsAt(0,1);return t&&n&&n.top<t.bottom}function rr(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}const zs=Object.create(null);function tn(i,e,t){if(i==e)return!0;i||(i=zs),e||(e=zs);let n=Object.keys(i),r=Object.keys(e);if(n.length-(t&&n.indexOf(t)>-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function sr(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function rg(i){let e=Object.create(null);for(let t=0;t<i.attributes.length;t++){let n=i.attributes[t];e[n.name]=n.value}return e}class Br{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var _e=function(i){return i[i.Text=0]="Text",i[i.WidgetBefore=1]="WidgetBefore",i[i.WidgetAfter=2]="WidgetAfter",i[i.WidgetRange=3]="WidgetRange",i}(_e||(_e={}));class we extends zt{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Ti(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new at(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=Zl(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new at(e,n,r,t,e.widget||null,!0)}static line(e){return new Ai(e)}static set(e,t=!1){return X.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}we.none=X.empty;class Ti extends we{constructor(e){let{start:t,end:n}=Zl(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof Ti&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&tn(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Ti.prototype.point=!1;class Ai extends we{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ai&&this.spec.class==e.spec.class&&tn(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ai.prototype.mapMode=Me.TrackBefore;Ai.prototype.point=!0;class at extends we{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?Me.TrackBefore:Me.TrackAfter:Me.TrackDel}get type(){return this.startSide!=this.endSide?_e.WidgetRange:this.startSide<=0?_e.WidgetBefore:_e.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof at&&sg(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}at.prototype.point=!0;function Zl(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function sg(i,e){return i==e||!!(i&&e&&i.compare(e))}function _i(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}class re extends q{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,s,o){if(n){if(!(n instanceof re))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),Ul(this,e,t,n?n.children.slice():[],s,o),!0}split(e){let t=new re;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let s=n;s<this.children.length;s++)t.append(this.children[s],0);for(;n>0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){tn(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Jl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=rr(t,this.attrs||{})),n&&(this.attrs=rr({class:n},this.attrs||{}))}domAtPos(e){return Xl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Wl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(sr(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&q.get(r)instanceof tt;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=q.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!D.ios||!this.children.some(s=>s instanceof ze))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof ze)||/[^ -~]/.test(n.text))return null;let r=bi(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Ql(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight<s){let o=(s-r.textHeight)/2;return{top:n.top+o,bottom:n.bottom-o,left:n.left,right:n.left}}}return n}become(e){return e instanceof re&&this.children.length==0&&e.children.length==0&&tn(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,r=0;n<e.children.length;n++){let s=e.children[n],o=r+s.length;if(o>=t){if(s instanceof re)return s;if(o>t)break}r=o+s.breakAfter}return null}}class Ze extends q{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,s,o){return n&&(!(n instanceof Ze)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?ge.before(this.dom):ge.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new Ze(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return Lr}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):N.empty}domBoundsAround(){return null}become(e){return e instanceof Ze&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);return n||(this.widget instanceof or?null:pn(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t==n?!1:e<0?t<0:n>0}}class or extends Br{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class di{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Ze&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new re),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ii(new Wt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Ze)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Ii(new ze(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof at){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof at)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ze(n.widget||Ht.block,l,n));else{let a=bt.create(n.widget||Ht.inline,l,l?0:n.startSide),c=this.atCursorPos&&!a.isEditable&&s<=r.length&&(e<t||n.startSide>0),h=!a.isEditable&&(e<t||s>r.length||n.startSide<=0),u=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),c&&(u.append(Ii(new Wt(1),r),s),s=r.length+Math.max(0,s-r.length)),u.append(Ii(a,r),s),this.atCursorPos=h,this.pendingBuffer=h?e<t||s>r.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,n,r,s){let o=new di(e,t,n,s);return o.openEnd=X.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ii(i,e){for(let t of e)i=new tt(t,[i],i.length);return i}class Ht extends Br{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ht.inline=new Ht("span");Ht.block=new Ht("div");var ye=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(ye||(ye={}));const Ct=ye.LTR,zr=ye.RTL;function ea(i){let e=[];for(let t=0;t<i.length;t++)e.push(1<<+i[t]);return e}const og=ea("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),lg=ea("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),lr=Object.create(null),We=[];for(let i of["()","[]","{}"]){let e=i.charCodeAt(0),t=i.charCodeAt(1);lr[e]=t,lr[t]=-e}function ta(i){return i<=247?og[i]:1424<=i&&i<=1524?2:1536<=i&&i<=1785?lg[i-1536]:1774<=i&&i<=2220?4:8192<=i&&i<=8204?256:64336<=i&&i<=65023?4:1}const ag=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ot{get dir(){return this.level%2?zr:Ct}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==n)return o;(s<0||(r!=0?r<0?l.from<t:l.to>t:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function ia(i,e){if(i.length!=e.length)return!1;for(let t=0;t<i.length;t++){let n=i[t],r=e[t];if(n.from!=r.from||n.to!=r.to||n.direction!=r.direction||!ia(n.inner,r.inner))return!1}return!0}const V=[];function hg(i,e,t,n,r){for(let s=0;s<=n.length;s++){let o=s?n[s-1].to:e,l=s<n.length?n[s].from:t,a=s?256:r;for(let c=o,h=a,u=a;c<l;c++){let f=ta(i.charCodeAt(c));f==512?f=h:f==8&&u==4&&(f=16),V[c]=f==4?2:f,f&7&&(u=f),h=f}for(let c=o,h=a,u=a;c<l;c++){let f=V[c];if(f==128)c<l-1&&h==V[c+1]&&h&24?f=V[c]=h:V[c]=256;else if(f==64){let g=c+1;for(;g<l&&V[g]==64;)g++;let p=c&&h==8||g<t&&V[g]==8?u==1?1:8:256;for(let x=c;x<g;x++)V[x]=p;c=g-1}else f==8&&u==1&&(V[c]=1);h=f,f&7&&(u=f)}}}function cg(i,e,t,n,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=n.length;o++){let c=o?n[o-1].to:e,h=o<n.length?n[o].from:t;for(let u=c,f,g,p;u<h;u++)if(g=lr[f=i.charCodeAt(u)])if(g<0){for(let x=l-3;x>=0;x-=3)if(We[x+1]==-g){let w=We[x+2],y=w&2?r:w&4?w&1?s:r:0;y&&(V[u]=V[We[x]]=y),l=x;break}}else{if(We.length==189)break;We[l++]=u,We[l++]=f,We[l++]=a}else if((p=V[u])==2||p==1){let x=p==r;a=x?0:1;for(let w=l-3;w>=0;w-=3){let y=We[w+2];if(y&2)break;if(x)We[w+2]|=2;else{if(y&4)break;We[w+2]|=4}}}}}function dg(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,l=r<t.length?t[r].from:e;for(let a=o;a<l;){let c=V[a];if(c==256){let h=a+1;for(;;)if(h==l){if(r==t.length)break;h=t[r++].to,l=r<t.length?t[r].from:e}else if(V[h]==256)h++;else break;let u=s==1,f=(h<e?V[h]:n)==1,g=u==f?u?1:2:n;for(let p=h,x=r,w=x?t[x-1].to:i;p>a;)p==w&&(p=t[--x].from,w=x?t[x-1].to:i),V[--p]=g;a=h}else s=c,a++}}}function ar(i,e,t,n,r,s,o){let l=n%2?2:1;if(n%2==r%2)for(let a=e,c=0;a<t;){let h=!0,u=!1;if(c==s.length||a<s[c].from){let x=V[a];x!=l&&(h=!1,u=x==16)}let f=!h&&l==1?[]:null,g=h?n:n+1,p=a;e:for(;;)if(c<s.length&&p==s[c].from){if(u)break e;let x=s[c];if(!h)for(let w=x.to,y=c+1;;){if(w==t)break e;if(y<s.length&&s[y].from==w)w=s[y++].to;else{if(V[w]==l)break e;break}}if(c++,f)f.push(x);else{x.from>a&&o.push(new ot(a,x.from,g));let w=x.direction==Ct!=!(g%2);hr(i,w?n+1:n,r,x.inner,x.from,x.to,o),a=x.to}p=x.to}else{if(p==t||(h?V[p]!=l:V[p]==l))break;p++}f?ar(i,a,p,n+1,r,f,o):a<p&&o.push(new ot(a,p,g)),a=p}else for(let a=t,c=s.length;a>e;){let h=!0,u=!1;if(!c||a>s[c-1].to){let x=V[a-1];x!=l&&(h=!1,u=x==16)}let f=!h&&l==1?[]:null,g=h?n:n+1,p=a;e:for(;;)if(c&&p==s[c-1].to){if(u)break e;let x=s[--c];if(!h)for(let w=x.from,y=c;;){if(w==e)break e;if(y&&s[y-1].to==w)w=s[--y].from;else{if(V[w-1]==l)break e;break}}if(f)f.push(x);else{x.to<a&&o.push(new ot(x.to,a,g));let w=x.direction==Ct!=!(g%2);hr(i,w?n+1:n,r,x.inner,x.from,x.to,o),a=x.from}p=x.from}else{if(p==e||(h?V[p-1]!=l:V[p-1]==l))break;p--}f?ar(i,p,a,n+1,r,f,o):p<a&&o.push(new ot(p,a,g)),a=p}}function hr(i,e,t,n,r,s,o){let l=e%2?2:1;hg(i,r,s,n,l),cg(i,r,s,n,l),dg(r,s,n,l),ar(i,r,s,e,t,n,o)}function ug(i,e,t){if(!i)return[new ot(0,0,e==zr?1:0)];if(e==Ct&&!t.length&&!ag.test(i))return na(i.length);if(t.length)for(;i.length>V.length;)V[V.length]=256;let n=[],r=e==Ct?0:1;return hr(i,r,r,t,0,i.length,n),n}function na(i){return[new ot(0,i,0)]}let ra="";function fg(i,e,t,n,r){var s;let o=n.head-i.from,l=ot.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),a=e[l],c=a.side(r,t);if(o==c){let f=l+=r?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!r,t),c=a.side(r,t)}let h=Ye(i.text,o,a.forward(r,t));(h<a.from||h>a.to)&&(h=c),ra=i.text.slice(Math.min(o,h),Math.max(o,h));let u=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return u&&h==c&&u.level+(r?0:1)<a.level?M.cursor(u.side(!r,t)+i.from,u.forward(r,t)?1:-1,u.level):M.cursor(h+i.from,a.forward(r,t)?-1:1,a.level)}function gg(i,e,t){for(let n=e;n<t;n++){let r=ta(i.charCodeAt(n));if(r==1)return Ct;if(r==2||r==4)return zr}return Ct}const sa=j.define(),oa=j.define(),la=j.define(),aa=j.define(),cr=j.define(),ha=j.define(),ca=j.define(),Nr=j.define(),Fr=j.define(),da=j.define({combine:i=>i.some(e=>e)}),pg=j.define({combine:i=>i.some(e=>e)}),ua=j.define();class Pt{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Pt(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Pt(M.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Pi=se.define({map:(i,e)=>i.map(e)}),fa=se.define();function Je(i,e,t){let n=i.facet(aa);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Ge=j.define({combine:i=>i.length?i[0]:!0});let mg=0;const Ot=j.define({combine(i){return i.filter((e,t)=>{for(let n=0;n<t;n++)if(i[n].plugin==e.plugin)return!1;return!0})}});class xi{constructor(e,t,n,r,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Ot.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Ot.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:s,decorations:o}=t||{};return new xi(mg++,e,n,r,l=>{let a=[];return o&&a.push(yi.of(c=>{let h=c.plugin(l);return h?o(h):we.none})),s&&a.push(s(l)),a})}static fromClass(e,t){return xi.define((n,r)=>new e(n,r),t)}}class Tn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Je(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Je(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){Je(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const ga=j.define(),Wr=j.define(),yi=j.define(),pa=j.define(),Hr=j.define(),ma=j.define();function Ns(i,e){let t=i.state.facet(ma);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return X.spans(n,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,h=o-e.from,u=r;for(let f=l.length-1;f>=0;f--,a--){let g=l[f].spec.bidiIsolate,p;if(g==null&&(g=gg(e.text,c,h)),a>0&&u.length&&(p=u[u.length-1]).to==c&&p.direction==g)p.to=h,u=p.inner;else{let x={from:c,to:h,direction:g,inner:[]};u.push(x),u=x.inner}}}}),r}const ba=j.define();function xa(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(ba)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}const ni=j.define();class je{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new je(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(t.length==0)return e;let n=[];for(let r=0,s=0,o=0,l=0;;r++){let a=r==e.length?null:e[r],c=o-l,h=a?a.fromB:1e9;for(;s<t.length&&t[s]<h;){let u=t[s],f=t[s+1],g=Math.max(l,u),p=Math.min(h,f);if(g<=p&&new je(g+c,p+c,g,p).addToSet(n),f>h)break;s+=2}if(!a)return n;new je(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,l=a.toB}}}class nn{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=le.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new je(s,o,l,a))),this.changedRanges=r}static create(e,t,n){return new nn(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class Fs extends q{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=we.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new re],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new je(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:h})=>h<this.minWidthFrom||c>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!Cg(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?xg(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;n=new je(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(D.ie||D.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=vg(o,l,e.changes);return n=je.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||r.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof Ze&&o.widget instanceof or&&s.push(o.dom);r.updateGaps(s)}updateChildren(e,t,n){let r=n?n.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let o=r.length-1;;o--){let l=o>=0?r[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:h,toB:u}=l,f,g,p,x;if(n&&n.range.fromB<u&&n.range.toB>h){let S=di.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),$=di.build(this.view.state.doc,n.range.toB,u,this.decorations,this.dynamicDecorationMap);g=S.breakAtStart,p=S.openStart,x=$.openEnd;let C=this.compositionView(n);$.breakAtStart?C.breakAfter=1:$.content.length&&C.merge(C.length,C.length,$.content[0],!1,$.openStart,0)&&(C.breakAfter=$.content[0].breakAfter,$.content.shift()),S.content.length&&C.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),f=S.content.concat(C).concat($.content)}else({content:f,breakAtStart:g,openStart:p,openEnd:x}=di.build(this.view.state.doc,h,u,this.decorations,this.dynamicDecorationMap));let{i:w,off:y}=s.findPos(c,1),{i:v,off:k}=s.findPos(a,-1);Kl(this,v,k,w,y,f,g,p,x)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(fa)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new ze(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new tt(r,[t],t.length);let n=new re;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=q.get(s);l&&l!=o&&(l.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)n=r.childPos(n.off,1),r=r.children[n.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,s=!r&&!(this.view.state.facet(Ge)||this.dom.tabIndex>-1)&&qi(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&bg(a)){let u=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(u,a.node.childNodes[a.offset]||null)),a=c=new ge(u,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!ci(a.node,a.offset,h.anchorNode,h.anchorOffset)||!ci(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(h.focusNode)&&Sg(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let u=mi(this.view.root);if(u)if(l.empty){if(D.gecko){let f=yg(a.node,a.offset);if(f&&f!=3){let g=(f==1?Vl:ql)(a.node,a.offset);g&&(a=new ge(g.node,g.offset))}}u.collapse(a.node,a.offset),l.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=l.bidiLevel)}else if(u.extend){u.collapse(a.node,a.offset);try{u.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),f.setEnd(c.node,c.offset),f.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(f)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new ge(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new ge(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ci(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=mi(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=re.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r<t.childNodes.length;r++){let s=q.get(t.childNodes[r]);s instanceof re&&(n=s.domAtPos(0))}for(let r=e.offset-1;!n&&r>=0;r--){let s=q.get(t.childNodes[r]);s instanceof re&&(n=s.domAtPos(s.length))}return n?new ge(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=q.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let r=this.children[t];if(n<r.length||r instanceof re)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,r=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=s-l.breakAfter,c=a-l.length;if(a<e)break;if(c<=e&&(c<e||l.covers(-1))&&(a>e||l.covers(1))&&(!n||l instanceof re&&!(n instanceof re&&t>=0)))n=l,r=c;else if(n&&c==e&&a==e&&l instanceof Ze&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(n=null)}s=c}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof re))return null;for(;r.children.length;){let{i:l,off:a}=r.childPos(n,1);for(;;l++){if(l==r.children.length)return null;if((r=r.children[l]).length)break}n=a}if(!(r instanceof ze))return null;let s=Ye(r.text,n);if(s==n)return null;let o=St(r.dom,n,s).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==ye.LTR;for(let c=0,h=0;h<this.children.length;h++){let u=this.children[h],f=c+u.length;if(f>r)break;if(c>=n){let g=u.dom.getBoundingClientRect();if(t.push(g.height),o){let p=u.dom.lastChild,x=p?bi(p):[];if(x.length){let w=x[x.length-1],y=a?w.right-g.left:g.right-w.left;y>l&&(l=y,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=f)}}}c=f+u.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?ye.RTL:ye.LTR}measureTextSize(){for(let s of this.children)if(s instanceof re){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=bi(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new _l(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(we.replace({widget:new or(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return we.set(e)}updateDeco(){let e=1,t=this.view.state.facet(yi).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(pa).map((s,o)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(X.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(ua))try{if(c(this.view,e.range,e))return!0}catch(h){Je(this.view.state,h,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=xa(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Gf(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==ye.LTR)}}function bg(i){return i.node.nodeType==1&&i.node.firstChild&&(i.offset==0||i.node.childNodes[i.offset-1].contentEditable=="false")&&(i.offset==i.node.childNodes.length||i.node.childNodes[i.offset].contentEditable=="false")}function ya(i,e){let t=i.observer.selectionRange;if(!t.focusNode)return null;let n=Vl(t.focusNode,t.focusOffset),r=ql(t.focusNode,t.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let l=q.get(r.node);if(!l||l instanceof ze&&l.text!=r.node.nodeValue)s=r;else if(i.docView.lastCompositionAfterCursor){let a=q.get(n.node);!a||a instanceof ze&&a.text!=n.node.nodeValue||(s=r)}}if(i.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function xg(i,e,t){let n=ya(i,t);if(!n)return null;let{node:r,from:s,to:o}=n,l=r.nodeValue;if(/[\n\r]/.test(l)||i.state.doc.sliceString(n.from,n.to)!=l)return null;let a=e.invertedDesc,c=new je(a.mapPos(s),a.mapPos(o),s,o),h=[];for(let u=r.parentNode;;u=u.parentNode){let f=q.get(u);if(f instanceof tt)h.push({node:u,deco:f.mark});else{if(f instanceof re||u.nodeName=="DIV"&&u.parentNode==i.contentDOM)return{range:c,text:r,marks:h,line:u};if(u!=i.contentDOM)h.push({node:u,deco:new Ti({inclusive:!0,attributes:rg(u),tagName:u.tagName.toLowerCase()})});else return null}}}function yg(i,e){return i.nodeType!=1?0:(e&&i.childNodes[e-1].contentEditable=="false"?1:0)|(e<i.childNodes.length&&i.childNodes[e].contentEditable=="false"?2:0)}let wg=class{constructor(){this.changes=[]}compareRange(e,t){_i(e,t,this.changes)}comparePoint(e,t){_i(e,t,this.changes)}boundChange(e){_i(e,e,this.changes)}};function vg(i,e,t){let n=new wg;return X.compare(i,e,t,n),n.changes}function Sg(i,e){for(let t=i;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Cg(i,e){let t=!1;return e&&i.iterChangedRanges((n,r)=>{n<e.to&&r>e.from&&(t=!0)}),t}function kg(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return M.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,l=s;t<0?o=Ye(r.text,s,!1):l=Ye(r.text,s);let a=n(r.text.slice(o,l));for(;o>0;){let c=Ye(r.text,o,!1);if(n(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=Ye(r.text,l);if(n(r.text.slice(l,c))!=a)break;l=c}return M.range(o+r.from,l+r.from)}function $g(i,e){return e.left>i?e.left-i:Math.max(0,i-e.right)}function Tg(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function An(i,e){return i.top<e.bottom-1&&i.bottom>e.top+1}function Ws(i,e){return e<i.top?{top:e,left:i.left,right:i.right,bottom:i.bottom}:i}function Hs(i,e){return e>i.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function dr(i,e,t){let n,r,s,o,l=!1,a,c,h,u;for(let p=i.firstChild;p;p=p.nextSibling){let x=bi(p);for(let w=0;w<x.length;w++){let y=x[w];r&&An(r,y)&&(y=Ws(Hs(y,r.bottom),r.top));let v=$g(e,y),k=Tg(t,y);if(v==0&&k==0)return p.nodeType==3?Vs(p,e,t):dr(p,e,t);(!n||o>k||o==k&&s>v)&&(n=p,r=y,s=v,o=k,l=v?e<y.left?w>0:w<x.length-1:!0),v==0?t>y.bottom&&(!h||h.bottom<y.bottom)?(a=p,h=y):t<y.top&&(!u||u.top>y.top)&&(c=p,u=y):h&&An(h,y)?h=Hs(h,y.bottom):u&&An(u,y)&&(u=Ws(u,y.top))}}if(h&&h.bottom>=t?(n=a,r=h):u&&u.top<=t&&(n=c,r=u),!n)return{node:i,offset:0};let f=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return Vs(n,f,t);if(l&&n.contentEditable!="false")return dr(n,f,t);let g=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:i,offset:g}}function Vs(i,e,t){let n=i.nodeValue.length,r=-1,s=1e9,o=0;for(let l=0;l<n;l++){let a=St(i,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let h=a[c];if(h.top==h.bottom)continue;o||(o=e-h.left);let u=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&u<s){let f=e>=(h.left+h.right)/2,g=f;if((D.chrome||D.gecko)&&St(i,l).getBoundingClientRect().left==h.right&&(g=!f),u<=0)return{node:i,offset:l+(g?1:0)};r=l+(g?1:0),s=u}}}return{node:i,offset:r>-1?r:o>0?i.nodeValue.length:0}}function wa(i,e,t,n=-1){var r,s;let o=i.contentDOM.getBoundingClientRect(),l=o.top+i.viewState.paddingTop,a,{docHeight:c}=i.viewState,{x:h,y:u}=e,f=u-l;if(f<0)return 0;if(f>c)return i.state.doc.length;for(let S=i.viewState.heightOracle.textHeight/2,$=!1;a=i.elementAtHeight(f),a.type!=_e.Text;)for(;f=n>0?a.bottom+S:a.top-S,!(f>=0&&f<=c);){if($)return t?null:0;$=!0,n=-n}u=l+f;let g=a.from;if(g<i.viewport.from)return i.viewport.from==0?0:t?null:qs(i,o,a,h,u);if(g>i.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:qs(i,o,a,h,u);let p=i.dom.ownerDocument,x=i.root.elementFromPoint?i.root:p,w=x.elementFromPoint(h,u);w&&!i.contentDOM.contains(w)&&(w=null),w||(h=Math.max(o.left+1,Math.min(o.right-1,h)),w=x.elementFromPoint(h,u),w&&!i.contentDOM.contains(w)&&(w=null));let y,v=-1;if(w&&((r=i.docView.nearest(w))===null||r===void 0?void 0:r.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(h,u);S&&({offsetNode:y,offset:v}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(h,u);S&&({startContainer:y,startOffset:v}=S,(!i.contentDOM.contains(y)||D.safari&&Ag(y,v,h)||D.chrome&&Rg(y,v,h))&&(y=void 0))}y&&(v=Math.min(Ke(y),v))}if(!y||!i.docView.dom.contains(y)){let S=re.find(i.docView,g);if(!S)return f>a.top+a.height/2?a.to:a.from;({node:y,offset:v}=dr(S.dom,h,u))}let k=i.docView.nearest(y);if(!k)return null;if(k.isWidget&&((s=k.dom)===null||s===void 0?void 0:s.nodeType)==1){let S=k.dom.getBoundingClientRect();return e.y<S.top||e.y<=S.bottom&&e.x<=(S.left+S.right)/2?k.posAtStart:k.posAtEnd}else return k.localPosFromDOM(y,v)+k.posAtStart}function qs(i,e,t,n,r){let s=Math.round((n-e.left)*i.defaultCharacterWidth);if(i.lineWrapping&&t.height>i.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(i.defaultLineHeight-l)*.5)/l);s+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+_f(o,s,i.state.tabSize)}function Ag(i,e,t){let n,r=i;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(;;){let s=r.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let o=r.parentNode;if(!o||o.nodeName=="DIV")break;r=o}}return St(i,n-1,n).getBoundingClientRect().right>t}function Rg(i,e,t){if(e!=0)return!1;for(let r=i;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let n=i.nodeType==1?i.getBoundingClientRect():St(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function Dg(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==_e.Text&&(r.type!=s.type||(t<0?s.from<e:s.to>e)))&&(r=s)}}return r||n}return n}function Mg(i,e,t,n){let r=Dg(i,e.head,e.assoc||-1),s=!n||r.type!=_e.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(r.from),a=i.posAtCoords({x:t==(l==ye.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return M.cursor(a,t?-1:1)}return M.cursor(t?r.to:r.from,t?-1:1)}function _s(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let l=e,a=null;;){let c=fg(r,s,o,l,t),h=ra;if(!c){if(r.number==(t?i.state.doc.lines:1))return l;h=`
|
|
1725
|
+
`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),c=i.visualLineSide(r,!t)}if(a){if(!a(h))return l}else{if(!n)return c;a=n(h)}l=c}}function Og(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==Xe.Space&&(r=o),r==o}}function jg(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return M.cursor(r,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),c=i.coordsAtPos(r,e.assoc||-1),h=i.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let g=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(r-g.from))),l=(s<0?g.top:g.bottom)+h}let u=a.left+o,f=n??i.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let p=l+(f+g)*s,x=wa(i,{x:u,y:p},!1,s);if(p<a.top||p>a.bottom||(s<0?x<r:x>r)){let w=i.docView.coordsForChar(x),y=!w||p<w.top?-1:1;return M.cursor(x,y,void 0,o)}}}function Ki(i,e,t){for(;;){let n=0;for(let r of i)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=n||t||(e-s<o-e?-1:1);e=a<0?s:o,n=a}});if(!n)return e}}function Rn(i,e,t){let n=Ki(i.state.facet(Hr).map(r=>r(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:M.cursor(n,n<t.from?1:-1)}const ri="";class Eg{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Y.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ri}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==t)break;let l=q.get(r),a=q.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:en(r))||en(o)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(t))&&(s=l.index,o=l[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Ig(e,n.node,n.offset)?t:0))}}function Ig(i,e,t){for(;;){if(!e||t<Ke(e))return!1;if(e==i)return!0;t=vt(e)+1,e=e.parentNode}}class Ks{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Pg{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let l=s||o?[]:zg(e),a=new Eg(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Ng(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!er(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!er(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((D.ios||D.chrome)&&e.state.selection.main.empty&&a!=c&&(h.from>0||h.to<e.state.doc.length)){let u=Math.min(a,c),f=Math.max(a,c),g=h.from-u,p=h.to-f;(g==0||g==1||u==0)&&(p==0||p==-1||f==e.state.doc.length)&&(a=0,c=e.state.doc.length)}this.newSel=M.single(c,a)}}}function va(i,e){let t,{newSel:n}=e,r=i.state.selection.main,s=i.inputState.lastKeyTime>Date.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=r.from,c=null;(s===8||D.android&&e.text.length<l-o)&&(a=r.to,c="end");let h=Bg(i.state.doc.sliceString(o,l,ri),e.text,a-o,c);h&&(D.chrome&&s==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==ri+ri&&h.toB--,t={from:o+h.from,to:o+h.toA,insert:N.of(e.text.slice(h.from,h.toB).split(ri))})}else n&&(!i.hasFocus&&i.state.facet(Ge)||n.main.eq(r))&&(n=null);if(!t&&!n)return!1;if(!t&&e.typeOver&&!r.empty&&n&&n.main.empty?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,r.to)}:(D.mac||D.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=M.single(n.main.anchor-1,n.main.head-1)),t={from:t.from,to:t.to,insert:N.of([t.insert.toString().replace("."," ")])}):t&&t.from>=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,r.to))}:D.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==`
|
|
1726
|
+
`&&i.lineWrapping&&(n&&(n=M.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:N.of([" "])}),t)return Vr(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function Vr(i,e,t,n=-1){if(D.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(D.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&It(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&It(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&It(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=Lg(i,e,t));return i.state.facet(ha).some(a=>a(i,e.from,e.to,s,l))||i.dispatch(l()),!0}function Lg(i,e,t){let n,r=i.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.from<e.from?r.sliceDoc(s.from,e.from):"",a=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=r.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),h,u=t&&ya(i,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);h={from:u.from,to:u.to-p}}else h=i.state.doc.lineAt(s.head);let f=s.to-e.to,g=s.to-s.from;n=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:l,range:a||p.map(l)};let x=p.to-f,w=x-c.length;if(p.to-p.from!=g||i.state.sliceDoc(w,x)!=c||p.to>=h.from&&p.from<=h.to)return{range:p};let y=r.changes({from:w,to:x,insert:e.insert}),v=p.to-s.to;return{changes:y,range:a?M.range(Math.max(0,a.anchor+v),Math.max(0,a.head+v)):p.map(y)}})}else n={changes:l,selection:a&&r.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function Bg(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s<r&&i.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&i.length==e.length)return null;let o=i.length,l=e.length;for(;o>0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o<s&&i.length<e.length){let a=t<=s&&t>=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=t<=s&&t>=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function zg(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new Ks(t,n)),(r!=t||s!=n)&&e.push(new Ks(r,s))),e}function Ng(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?M.single(t+e,n+e):null}class Fg{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,D.safari&&e.contentDOM.addEventListener("input",()=>null),D.gecko&&np(e.contentDOM.ownerDocument)}handleEvent(e){!Yg(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Wg(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Vg.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),D.android&&D.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return D.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Sa.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||Hg.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,It(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Us(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){Je(t.state,r)}}}function Wg(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&t(l).handlers.push(Us(n.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(Us(n.value,a))}}for(let n in Ne)t(n).handlers.push(Ne[n]);for(let n in Ee)t(n).observers.push(Ee[n]);return e}const Sa=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Hg="dthko",Vg=[16,17,18,20,91,92,224,225],Li=6;function Bi(i){return Math.max(0,i)*.7+8}function qg(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}class _g{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Yf(e.contentDOM),this.atoms=e.state.facet(Hr).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Y.allowMultipleSelections)&&Kg(e,t),this.dragging=Gg(e,t)&&$a(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&qg(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=xa(this.view);e.clientX-a.left<=r+Li?t=-Bi(r-e.clientX):e.clientX+a.right>=o-Li&&(t=Bi(e.clientX-o)),e.clientY-a.top<=s+Li?n=-Bi(s-e.clientY):e.clientY+a.bottom>=l-Li&&(n=Bi(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let o=Ki(this.atoms,r.from,0);o!=r.from&&(s=M.cursor(o,-1))}else{let o=Ki(this.atoms,r.from,-1),l=Ki(this.atoms,r.to,1);(o!=r.from||l!=r.to)&&(s=M.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(t||(t=e.ranges.slice()),t[n]=s)}return t?M.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Kg(i,e){let t=i.state.facet(sa);return t.length?t[0](e):D.mac?e.metaKey:e.ctrlKey}function Ug(i,e){let t=i.state.facet(oa);return t.length?t[0](e):D.mac?!e.altKey:!e.ctrlKey}function Gg(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=mi(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Yg(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=q.get(t))&&n.ignoreEvent(e))return!1;return!0}const Ne=Object.create(null),Ee=Object.create(null),Ca=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function Xg(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),ka(i,t.value)},50)}function bn(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function ka(i,e){e=bn(i.state,Nr,e);let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(ur!=null&&t.selection.ranges.every(a=>a.empty)&&ur==s.toString()){let a=-1;n=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let u=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:u},range:M.cursor(c.from+u.length)}})}else o?n=t.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:M.cursor(a.from+c.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Ee.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};Ne.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Ee.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};Ee.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Ne.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(la))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=Zg(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new _g(i,e,t,n)),n&&i.observer.ignore(()=>{Fl(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function Gs(i,e,t,n){if(n==1)return M.cursor(e,t);if(n==2)return kg(i.state,e,t);{let r=re.find(i.docView,e),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<i.state.doc.length&&l==s.to&&l++,M.range(o,l)}}let Ys=(i,e,t)=>e>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function Jg(i,e,t,n){let r=re.find(i.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&Ys(t,n,o))return-1;let l=r.coordsAt(s,1);return l&&Ys(t,n,l)?1:o&&o.bottom>=n?-1:1}function Xs(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Jg(i,t,e.clientX,e.clientY)}}const Qg=D.ie&&D.ie_version<=11;let Js=null,Qs=0,Zs=0;function $a(i){if(!Qg)return i.detail;let e=Js,t=Zs;return Js=i,Zs=Date.now(),Qs=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(Qs+1)%3:1}function Zg(i,e){let t=Xs(i,e),n=$a(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,l){let a=Xs(i,s),c,h=Gs(i,a.pos,a.bias,n);if(t.pos!=a.pos&&!o){let u=Gs(i,t.pos,t.bias,n),f=Math.min(u.from,h.from),g=Math.max(u.to,h.to);h=f<h.from?M.range(f,g):M.range(g,f)}return o?r.replaceRange(r.main.extend(h.from,h.to)):l&&n==1&&r.ranges.length>1&&(c=ep(r,a.pos))?c:l?r.addRange(h):M.create([h])}}}function ep(i,e){for(let t=0;t<i.ranges.length;t++){let{from:n,to:r}=i.ranges[t];if(n<=e&&r>=e)return M.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}Ne.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=M.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",bn(i.state,Fr,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ne.dragend=i=>(i.inputState.draggedContent=null,!1);function eo(i,e,t,n){if(t=bn(i.state,Nr,t),!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&Ug(i,e)?{from:s.from,to:s.to}:null,l={from:r,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}Ne.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&eo(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),s()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return eo(i,e,n,!0),!0}return!1};Ne.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=Ca?null:e.clipboardData;return t?(ka(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Xg(i),!1)};function tp(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function ip(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:bn(i,Fr,e.join(i.lineBreak)),ranges:t,linewise:n}}let ur=null;Ne.copy=Ne.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=ip(i.state);if(!t&&!r)return!1;ur=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=Ca?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(tp(i,t),!1)};const Ta=Yt.define();function Aa(i,e){let t=[];for(let n of i.facet(ca)){let r=n(i,e);r&&t.push(r)}return t.length?i.update({effects:t,annotations:Ta.of(!0)}):null}function Ra(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=Aa(i.state,e);t?i.dispatch(t):i.update([])}},10)}Ee.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),Ra(i)};Ee.blur=i=>{i.observer.clearSelectionRange(),Ra(i)};Ee.compositionstart=Ee.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Ee.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,D.chrome&&D.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Ee.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};Ne.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),c=i.posAtDOM(l.endContainer,l.endOffset);return Vr(i,{from:a,to:c,insert:i.state.toText(s)},null),!0}}let r;if(D.chrome&&D.android&&(r=Sa.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return D.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),D.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Ee.compositionend(i,e),20),!1};const to=new Set;function np(i){to.has(i)||(to.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}const io=["pre-wrap","normal","pre-line","break-spaces"];let Vt=!1;function no(){Vt=!1}class rp{constructor(e){this.lineWrapping=e,this.doc=N.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return io.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];r<0?n++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,n,r,s,o){let l=io.indexOf(e)>-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let h=o[c];h<0?c++:this.heightSamples[Math.floor(h*10)]=!0}}return a}}class sp{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class qe{constructor(e,t,n,r,s){this.from=e,this.length=t,this.top=n,this.height=r,this._content=s}get type(){return typeof this._content=="number"?_e.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof at?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new qe(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var G=function(i){return i[i.ByPos=0]="ByPos",i[i.ByHeight=1]="ByHeight",i[i.ByPosNoHeight=2]="ByPosNoHeight",i}(G||(G={}));const Ui=.001;class ve{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Ui&&(Vt=!0),this.height=e)}replace(e,t,n){return ve.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:h,toB:u}=r[l],f=s.lineAt(a,G.ByPosNoHeight,n.setDoc(t),0,0),g=f.to>=c?f:s.lineAt(c,G.ByPosNoHeight,n,0,0);for(u+=g.to-c,c=g.to;l>0&&f.from<=r[l-1].toA;)a=r[l-1].fromA,h=r[l-1].fromB,l--,a<f.from&&(f=s.lineAt(a,G.ByPosNoHeight,n,0,0));h+=f.from-a,a=f.from;let p=qr.build(n.setDoc(o),e,h,u);s=rn(s,s.replace(a,c,p))}return s.updateHeight(n,0)}static empty(){return new De(0,0)}static of(e){if(e.length==1)return e[0];let t=0,n=e.length,r=0,s=0;for(;;)if(t==n)if(r>s*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[t++];l&&(r+=l.size)}else{let l=e[--n];l&&(s+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,n++),new op(ve.of(e.slice(0,t)),o,ve.of(e.slice(n)))}}function rn(i,e){return i==e?i:(i.constructor!=e.constructor&&(Vt=!0),e)}ve.prototype.size=1;class Da extends ve{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,r){return new qe(r,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,r,s){return this.blockAt(0,n,r,s)}forEachLine(e,t,n,r,s,o){e<=s+this.length&&t>=s&&o(this.blockAt(0,n,r,s))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class De extends Da{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new qe(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof De||r instanceof de&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof de?r=new De(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):ve.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class de extends ve{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:l}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let c=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),h=t.doc.lineAt(c),u=l+h.length*a,f=Math.max(n,e-u/2);return new qe(h.from,h.length,f,u,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-n)/l))),{from:h,length:u}=t.doc.line(s+c);return new qe(h,u,n+l*c,l,0)}}lineAt(e,t,n,r,s){if(t==G.ByHeight)return this.blockAt(e,n,r,s);if(t==G.ByPosNoHeight){let{from:g,to:p}=n.doc.lineAt(e);return new qe(g,p-g,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(n,s),c=n.doc.lineAt(e),h=l+c.length*a,u=c.number-o,f=r+l*u+a*(c.from-s-u);return new qe(c.from,c.length,Math.max(r,Math.min(f,r+this.height-h)),h,0)}forEachLine(e,t,n,r,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(n,s);for(let h=e,u=r;h<=t;){let f=n.doc.lineAt(h);if(h==e){let p=f.number-l;u+=a*p+c*(e-s-p)}let g=a+c*f.length;o(new qe(f.from,f.length,u,g,0)),u+=g,h=f.to+1}}replace(e,t,n){let r=this.length-t;if(r>0){let s=n[n.length-1];s instanceof de?n[n.length-1]=new de(s.length+r):n.push(null,new de(r-1))}if(e>0){let s=n[0];s instanceof de?n[0]=new de(e+s.length):n.unshift(new de(e-1),null)}return ve.of(n)}decomposeLeft(e,t){t.push(new de(e-1),null)}decomposeRight(e,t){t.push(null,new de(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],l=Math.max(t,r.from),a=-1;for(r.from>t&&o.push(new de(r.from-t-1).updateHeight(e,t));l<=s&&r.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let u=r.heights[r.index++];a==-1?a=u:Math.abs(u-a)>=Ui&&(a=-2);let f=new De(h,u);f.outdated=!1,o.push(f),l+=h+1}l<=s&&o.push(null,new de(s-l).updateHeight(e,l));let c=ve.of(o);return(a<0||Math.abs(c.height-this.height)>=Ui||Math.abs(a-this.heightMetrics(e,t).perLine)>=Ui)&&(Vt=!0),rn(this,c)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class op extends ve{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let s=n+this.left.height;return e<s?this.left.blockAt(e,t,n,r):this.right.blockAt(e,t,s,r+this.left.length+this.break)}lineAt(e,t,n,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=t==G.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,n,r,s):this.right.lineAt(e,t,n,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let h=t==G.ByPosNoHeight?G.ByPosNoHeight:G.ByPos;return a?c.join(this.right.lineAt(l,h,n,o,l)):this.left.lineAt(l,h,n,r,s).join(c)}forEachLine(e,t,n,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,n,r,s,o),t>=a&&this.right.forEachLine(e,t,n,l,a,o);else{let c=this.lineAt(a,G.ByPos,n,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,n,r,s,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,l,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of n)s.push(l);if(e>0&&ro(s,o-1),t<this.length){let l=s.length;this.decomposeRight(t,s),ro(s,l)}return ve.of(s)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ve.of(this.break?[e,null,t]:[e,t]):(this.left=rn(this.left,e),this.right=rn(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:s,right:o}=this,l=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,n,r):o.updateHeight(e,l,n),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function ro(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof de&&(n=i[e+1])instanceof de&&i.splice(e-1,3,new de(t.length+1+n.length))}const lp=5;class qr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof De?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new De(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let r=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;n.block?this.addBlock(new Da(o,r,n)):(o||s||r>=lp)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new De(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new de(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof De)return e;let t=new De(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof De)&&!this.isCovered?this.nodes.push(new De(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let r of this.nodes)r instanceof De&&r.updateHeight(this.oracle,n),n+=r?r.length:1;return this.nodes}static build(e,t,n,r){let s=new qr(n,e);return X.spans(t,n,r,s,0),s.finish(n)}}function ap(i,e,t){let n=new hp;return X.compare(i,e,t,n,0),n.changes}class hp{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,r){(e<t||n&&n.heightRelevant||r&&r.heightRelevant)&&_i(e,t,this.changes,5)}}function cp(i,e){let t=i.getBoundingClientRect(),n=i.ownerDocument,r=n.defaultView||window,s=Math.max(0,t.left),o=Math.min(r.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(r.innerHeight,t.bottom);for(let c=i.parentNode;c&&c!=n.body;)if(c.nodeType==1){let h=c,u=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&u.overflow!="visible"){let f=h.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(c==i.parentNode?r.innerHeight:a,f.bottom)}c=u.position=="absolute"||u.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function dp(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function up(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Dn{constructor(e,t,n,r){this.from=e,this.to=t,this.size=n,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],s=t[n];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,t){return we.replace({widget:new fp(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class fp extends Br{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class so{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=oo,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ye.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Wr).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new rp(t),this.stateDeco=e.facet(yi).filter(n=>typeof n!="function"),this.heightMap=ve.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle.setDoc(e.doc),[new je(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=we.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new zi(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?oo:new _r(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(si(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(yi).filter(h=>typeof h!="function");let r=e.changedRanges,s=je.extendWithRanges(r,ap(n,this.stateDeco,e?e.changes:le.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);no(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Vt)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<a.from||t.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(pg)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?ye.RTL:ye.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,h=0;if(l.width&&l.height){let{scaleX:S,scaleY:$}=Nl(t,l);(S>.005&&Math.abs(this.scaleX-S)>.005||$>.005&&Math.abs(this.scaleY-$)>.005)&&(this.scaleX=S,this.scaleY=$,c|=16,o=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=f)&&(this.paddingTop=u,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=Hl(e.scrollDOM);let p=(this.printing?up:cp)(t,this.paddingTop),x=p.top-this.pixelViewport.top,w=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!dp(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let S=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(S)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:$,charWidth:C,textHeight:R}=e.docView.measureTextSize();o=$>0&&r.refresh(s,$,C,R,Math.max(5,v/C),S),o&&(e.docView.minWidth=0,c|=16)}x>0&&w>0?h=Math.max(x,w):x<0&&w<0&&(h=Math.min(x,w)),no();for(let $ of this.viewports){let C=$.from==this.viewport.from?S:e.docView.measureVisibleLineHeights($);this.heightMap=(o?ve.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle,[new je(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new sp($.from,C))}Vt&&(c|=2)}let k=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return k&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),c|=this.updateForViewport()),(c&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new zi(r.lineAt(o-n*1e3,G.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,G.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),u=r.lineAt(c,G.ByPos,s,0,0),f;t.y=="center"?f=(u.top+u.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c<a.from?f=u.top:f=u.bottom-h,a=new zi(r.lineAt(f-1e3/2,G.ByHeight,s,0,0).from,r.lineAt(f+h+1e3/2,G.ByHeight,s,0,0).to)}}return a}mapViewport(e,t){let n=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new zi(this.heightMap.lineAt(n,G.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,G.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,G.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,G.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||s>=l+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let r of e)t.touchesRange(r.from,r.to)||n.push(new Dn(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,r=n?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=ye.LTR&&!n)return[];let l=[],a=(h,u,f,g)=>{if(u-h<s)return;let p=this.state.selection.main,x=[p.from];p.empty||x.push(p.to);for(let y of x)if(y>h&&y<u){a(h,y-10,f,g),a(y+10,u,f,g);return}let w=pp(e,y=>y.from>=f.from&&y.to<=f.to&&Math.abs(y.from-h)<s&&Math.abs(y.to-u)<s&&!x.some(v=>y.from<v&&y.to>v));if(!w){if(u<f.to&&t&&n&&t.visibleRanges.some(k=>k.from<=u&&k.to>=u)){let k=t.moveToLineBoundary(M.cursor(u),!1,!0).head;k>h&&(u=k)}let y=this.gapSize(f,h,u,g),v=n||y<2e6?y:2e6;w=new Dn(h,u,y,v)}l.push(w)},c=h=>{if(h.length<o||h.type!=_e.Text)return;let u=gp(h.from,h.to,this.stateDeco);if(u.total<o)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,g,p;if(n){let x=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,y;if(f!=null){let v=Fi(u,f),k=((this.visibleBottom-this.visibleTop)/2+x)/h.height;w=v-k,y=v+k}else w=(this.visibleTop-h.top-x)/h.height,y=(this.visibleBottom-h.top+x)/h.height;g=Ni(u,w),p=Ni(u,y)}else{let x=u.total*this.heightOracle.charWidth,w=r*this.heightOracle.charWidth,y=0;if(x>2e6)for(let C of e)C.from>=h.from&&C.from<h.to&&C.size!=C.displaySize&&C.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=C.size-C.displaySize);let v=this.pixelViewport.left+y,k=this.pixelViewport.right+y,S,$;if(f!=null){let C=Fi(u,f),R=((k-v)/2+w)/x;S=C-R,$=C+R}else S=(v-w)/x,$=(k+w)/x;g=Ni(u,S),p=Ni(u,$)}g>h.from&&a(h.from,g,h,u),p<h.to&&a(p,h.to,h,u)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(c):c(h);return l}gapSize(e,t,n,r){let s=Fi(r,n)-Fi(r,t);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Dn.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=we.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];X.spans(t,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s<n.length&&!(r&8);s++){let o=this.visibleRanges[s],l=n[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=n,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||si(this.heightMap.lineAt(e,G.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||si(this.heightMap.lineAt(this.scaler.fromDOM(e),G.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return si(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class zi{constructor(e,t){this.from=e,this.to=t}}function gp(i,e,t){let n=[],r=i,s=0;return X.spans(t,i,e,{span(){},point(o,l){o>r&&(n.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(n.push({from:r,to:e}),s+=e-r),{total:s,ranges:n}}function Ni({total:i,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(n<=l)return s+n;n-=l}}function Fi(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function pp(i,e){for(let t of i)if(e(t))return t}const oo={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};class _r{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let c=t.lineAt(l,G.ByPos,e,0,0).top,h=t.lineAt(a,G.ByPos,e,0,0).bottom;return r+=h-c,{from:l,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return r+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,r=s.domBottom}}fromDOM(e){for(let t=0,n=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return n+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,r=s.domBottom}}eq(e){return e instanceof _r?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}}function si(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new qe(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>si(r,e)):i._content)}const Wi=j.define({combine:i=>i.join(" ")}),fr=j.define({combine:i=>i.indexOf(!0)>-1}),gr=Nt.newName(),Ma=Nt.newName(),Oa=Nt.newName(),ja={"&light":"."+Ma,"&dark":"."+Oa};function pr(i,e,t){return new Nt(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}const mp=pr("."+gr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ja),bp={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Mn=D.ie&&D.ie_version<=11;class xp{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Xf,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(D.ie&&D.ie_version<=11||D.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&D.android&&e.constructor.EDIT_CONTEXT!==!1&&!(D.chrome&&D.chrome_version<126)&&(this.editContext=new wp(e),e.state.facet(Ge)&&(e.contentDOM.editContext=this.editContext.editContext)),Mn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Ge)?n.root.activeElement!=this.dom:!qi(this.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!n.state.selection.main.empty&&r.focusNode&&ci(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=mi(e.root);if(!t)return!1;let n=D.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&yp(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=qi(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Qf(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=t)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,bp),Mn&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Mn&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&It(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&qi(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Pg(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=va(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=lo(t,e.previousSibling||e.target.previousSibling,-1),r=lo(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ge)!=e.state.facet(Ge)&&(e.view.contentDOM.editContext=e.state.facet(Ge)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function lo(i,e,t){for(;e;){let n=q.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function ao(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return ci(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function yp(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return ao(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?ao(i,t):null}class wp{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let c={from:l,to:a,insert:N.of(n.text.split(`
|
|
1727
|
+
`))};if(c.from==this.from&&s<this.from?c.from=s:c.to==this.to&&s>this.to&&(c.to=s),c.from==c.to&&!c.insert.length){let h=M.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(r)||e.dispatch({selection:h,userEvent:"select"});return}if((D.mac||D.android)&&c.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(c={from:l,to:a,insert:N.of([n.text.replace("."," ")])}),this.pendingContextChange=c,!e.state.readOnly){let h=this.to-this.from+(c.to-c.from+c.insert.length);Vr(e,c,M.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let h=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;r.push(we.mark({attributes:{style:h}}).range(a,c))}}}e.dispatch({effects:fa.of(we.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=mi(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(n)return;let h=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=h,this.to+=h;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=h}t+=h}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class W{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Jf(e.parent)||document,this.viewState=new so(e.state||Y.create(e)),e.scrollTo&&e.scrollTo.is(Pi)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ot).map(r=>new Tn(r));for(let r of this.plugins)r.update(this);this.observer=new xp(this),this.inputState=new Fg(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Fs(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof pe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(Ta))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Aa(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(Y.phrases)!=this.state.facet(Y.phrases))return this.setState(s);r=nn.create(this,s,e),r.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(u&&(u=u.map(f.changes)),f.scrollIntoView){let{main:g}=f.state.selection;u=new Pt(g.empty?g:M.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of f.effects)g.is(Pi)&&(u=g.value.clip(this.state))}this.viewState.update(r,u),this.bidiCache=sn.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(ni)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Wi)!=r.state.facet(Wi)&&(this.viewState.mustMeasureContent=!0),(t||n||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(cr))try{f(r)}catch(g){Je(this.state,g,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!va(this,h)&&c.force&&It(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new so(e),this.plugins=e.facet(Ot).map(n=>new Tn(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new Fs(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ot),n=e.state.facet(Ot);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new Tn(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(n){Je(this.state,n,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Hl(n))s=-1,o=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(r);s=g.from,o=g.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(g=>{try{return g.read(this)}catch(p){return Je(this.state,p),ho}}),u=nn.create(this,this.state,[]),f=!1;u.flags|=a,t?t.flags|=a:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),f=this.docView.update(u),f&&this.docViewUpdate());for(let g=0;g<c.length;g++)if(h[g]!=ho)try{let p=c[g];p.write&&p.write(h[g],this)}catch(p){Je(this.state,p)}if(f&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(p>1||p<-1){r=r+p,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(cr))l(t)}get themeClasses(){return gr+" "+(this.state.facet(fr)?Oa:Ma)+" "+this.state.facet(Wi)}updateAttrs(){let e=co(this,ga,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ge)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),co(this,Wr,t);let n=this.observer.ignore(()=>{let r=sr(this.contentDOM,this.contentAttrs,t),s=sr(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(W.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(ni);let e=this.state.facet(W.cspNonce);Nt.mount(this.root,this.styleModules.concat(mp).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(n=>n.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Rn(this,e,_s(this,e,t,n))}moveByGroup(e,t){return Rn(this,e,_s(this,e,t,n=>Og(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return M.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return Mg(this,e,t,n)}moveVertically(e,t,n){return Rn(this,e,jg(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),wa(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[ot.find(s,e-r.from,-1,t)];return pn(n,o.dir==ye.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(da)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>vp)return na(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||ia(s.isolates,n=Ns(this,e))))return s.order;n||(n=Ns(this,e));let r=ug(e.text,t,n);return this.bidiCache.push(new sn(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||D.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Fl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Pi.of(new Pt(typeof e=="number"?M.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Pi.of(new Pt(M.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return xi.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return xi.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=Nt.newName(),r=[Wi.of(n),ni.of(pr(`.${n}`,e))];return t&&t.dark&&r.push(fr.of(!0)),r}static baseTheme(e){return Ef.lowest(ni.of(pr("."+gr,e,ja)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&q.get(n)||q.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}W.styleModule=ni;W.inputHandler=ha;W.clipboardInputFilter=Nr;W.clipboardOutputFilter=Fr;W.scrollHandler=ua;W.focusChangeEffect=ca;W.perLineTextDirection=da;W.exceptionSink=aa;W.updateListener=cr;W.editable=Ge;W.mouseSelectionStyle=la;W.dragMovesSelection=oa;W.clickAddsSelectionRange=sa;W.decorations=yi;W.outerDecorations=pa;W.atomicRanges=Hr;W.bidiIsolatedRanges=ma;W.scrollMargins=ba;W.darkTheme=fr;W.cspNonce=j.define({combine:i=>i.length?i[0]:""});W.contentAttributes=Wr;W.editorAttributes=ga;W.lineWrapping=W.contentAttributes.of({class:"cm-lineWrapping"});W.announce=se.define();const vp=4096,ho={};class sn{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:ye.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!t.touchesRange(o.from,o.to)&&n.push(new sn(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function co(i,e,t){for(let n=i.state.facet(e),r=n.length-1;r>=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&rr(o,t)}return t}class qt extends zt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}qt.prototype.elementClass="";qt.prototype.toDOM=void 0;qt.prototype.mapMode=Me.TrackBefore;qt.prototype.startSide=qt.prototype.endSide=-1;qt.prototype.point=!0;const Ea=se.define(),Ia=se.define(),Sp=we.mark({attributes:{style:"background-color: yellow; color: black"}}),Cp=$t.define({create(){return we.none},update(i,e){return i=i.map(e.changes),e.effects.forEach(t=>{t.is(Ea)?i=i.update({add:t.value,sort:!0}):t.is(Ia)&&(i=i.update({filter:t.value}))}),i},provide:i=>W.decorations.from(i)}),kp=b.forwardRef(({hasError:i,required:e,id:t,value:n="",disabled:r=!1,onChange:s=()=>null,...o},l)=>{const a=b.useRef(),c=b.useRef(),h=b.useRef(),{error:u,...f}=$e("JsonInput"),g=!!u||i,p=f.id??t,x=f.required||e;let w;u?w=`${p}-error`:f.hint&&(w=`${p}-hint`);const y=I=>{var ne,_;const P=(ne=c.current)==null?void 0:ne.doc;if(P){const{text:K,to:Q}=P.line(I),F=Q-K.trimStart().length;Q>F&&((_=h.current)==null||_.dispatch({effects:Ea.of([Sp.range(F,Q)])}))}},v=()=>{var P,ne;const I=(P=c.current)==null?void 0:P.doc;if(I){const _=I.length||0;(ne=h.current)==null||ne.dispatch({effects:Ia.of((K,Q)=>Q<=0||K>=_)})}},k=({state:I,view:P})=>{h.current=P,c.current=I,v();const _=Zr.jsonParseLinter()(P);_.length&&y(I.doc.lineAt(_[0].from).number)},S=(I,P)=>{k(P),s(I)},$=(I,P)=>{h.current=I,c.current=P,k({view:I,state:P})},{setContainer:C,view:R}=xh.useCodeMirror({value:n,onCreateEditor:$,container:a.current,editable:!r,extensions:[Zr.json(),Cp],onChange:S,theme:"dark",basicSetup:{lineNumbers:!0,bracketMatching:!0,closeBrackets:!0,indentOnInput:!0,syntaxHighlighting:!0,highlightSelectionMatches:!0,tabSize:2}}),L=Ce(a,C);return b.useImperativeHandle(l,()=>({...R==null?void 0:R.dom,focus(){R&&R.focus()},scrollIntoView(I){R&&R.dom.scrollIntoView(I)}}),[R]),d.jsx($p,{ref:L,$disabled:r,$hasError:g,alignItems:"stretch",hasRadius:!0,"aria-required":x,id:p,"aria-describedby":w,...o})}),$p=m.styled(T)`
|
|
1728
1728
|
font-size: ${({theme:i})=>i.fontSizes[3]};
|
|
1729
1729
|
line-height: ${({theme:i})=>i.lineHeights[6]};
|
|
1730
1730
|
|
|
@@ -1746,7 +1746,7 @@ ${m.css`
|
|
|
1746
1746
|
.cm-scroller {
|
|
1747
1747
|
border: 1px solid ${({theme:i,$hasError:e})=>e?i.colors.danger600:i.colors.neutral200};
|
|
1748
1748
|
/* inputFocusStyle will receive hasError prop */
|
|
1749
|
-
${
|
|
1749
|
+
${rt()}
|
|
1750
1750
|
}
|
|
1751
1751
|
|
|
1752
1752
|
.cm-editor,
|
|
@@ -1762,7 +1762,7 @@ ${m.css`
|
|
|
1762
1762
|
*/
|
|
1763
1763
|
background-color: #4a4a6a;
|
|
1764
1764
|
}
|
|
1765
|
-
`,Tp=
|
|
1765
|
+
`,Tp=Ae(({disabled:i,...e},t)=>d.jsx(Yi,{ref:t,tag:Ut,tabIndex:i?-1:void 0,disabled:i,...e})),Ap=m.styled(A)`
|
|
1766
1766
|
// To prevent global outline on focus visible to force an outline when Main is focused
|
|
1767
1767
|
&:focus-visible {
|
|
1768
1768
|
outline: none;
|
|
@@ -1774,8 +1774,8 @@ ${m.css`
|
|
|
1774
1774
|
left: ${({theme:i})=>i.spaces[3]};
|
|
1775
1775
|
top: ${({theme:i})=>i.spaces[3]};
|
|
1776
1776
|
}
|
|
1777
|
-
`,Mp=({children:i})=>d.jsx(Dp,{tag:"a",href:"#main-content",background:"primary600",color:"neutral0",left:"-100%",padding:3,position:"absolute",top:"-100%",hasRadius:!0,zIndex:9999,children:i}),Op=
|
|
1778
|
-
background: ${i=>
|
|
1777
|
+
`,Mp=({children:i})=>d.jsx(Dp,{tag:"a",href:"#main-content",background:"primary600",color:"neutral0",left:"-100%",padding:3,position:"absolute",top:"-100%",hasRadius:!0,zIndex:9999,children:i}),Op=kt.Root,jp=b.forwardRef((i,e)=>d.jsx(kt.Trigger,{...i,asChild:!0,ref:e})),Ep=b.forwardRef((i,e)=>d.jsx(kt.Portal,{children:d.jsx(Ip,{children:d.jsx(Pp,{ref:e,...i})})})),Ip=m.styled(kt.Overlay)`
|
|
1778
|
+
background: ${i=>Dr(i.theme.colors.neutral800,.2)};
|
|
1779
1779
|
position: fixed;
|
|
1780
1780
|
inset: 0;
|
|
1781
1781
|
z-index: ${i=>i.theme.zIndices.overlay};
|
|
@@ -1785,7 +1785,7 @@ ${m.css`
|
|
|
1785
1785
|
animation: ${ie.overlayFadeIn} ${i=>i.theme.motion.timings[200]}
|
|
1786
1786
|
${i=>i.theme.motion.easings.authenticMotion};
|
|
1787
1787
|
}
|
|
1788
|
-
`,Pp=m.styled(
|
|
1788
|
+
`,Pp=m.styled(kt.Content)`
|
|
1789
1789
|
max-width: 83rem;
|
|
1790
1790
|
max-height: 90vh;
|
|
1791
1791
|
height: auto;
|
|
@@ -1826,9 +1826,9 @@ ${m.css`
|
|
|
1826
1826
|
animation-name: ${ie.modalPopOut};
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
|
-
`,Pa=b.forwardRef((i,e)=>d.jsx(
|
|
1829
|
+
`,Pa=b.forwardRef((i,e)=>d.jsx(kt.Close,{...i,asChild:!0,ref:e})),Lp=b.forwardRef(({children:i,closeLabel:e="Close modal",...t},n)=>d.jsxs(Bp,{ref:n,padding:4,paddingLeft:5,paddingRight:5,background:"neutral100",justifyContent:"space-between",...t,tag:"header",children:[i,d.jsx(Pa,{children:d.jsx(et,{withTooltip:!1,label:e,children:d.jsx(z.Cross,{})})})]})),Bp=m.styled(T)`
|
|
1830
1830
|
border-bottom: solid 1px ${i=>i.theme.colors.neutral150};
|
|
1831
|
-
`,zp=b.forwardRef((i,e)=>d.jsx(
|
|
1831
|
+
`,zp=b.forwardRef((i,e)=>d.jsx(kt.Title,{asChild:!0,children:d.jsx(O,{tag:"h2",variant:"omega",fontWeight:"bold",ref:e,...i})})),Np=b.forwardRef(({children:i,...e},t)=>d.jsx(Fp,{ref:t,...e,children:i})),Fp=m.styled(ki)`
|
|
1832
1832
|
padding-inline: ${i=>i.theme.spaces[7]};
|
|
1833
1833
|
|
|
1834
1834
|
& > div {
|
|
@@ -1846,7 +1846,7 @@ ${m.css`
|
|
|
1846
1846
|
`,Wp=b.forwardRef((i,e)=>d.jsx(Hp,{ref:e,padding:4,paddingLeft:5,paddingRight:5,background:"neutral100",justifyContent:"space-between",...i,tag:"footer"})),Hp=m.styled(T)`
|
|
1847
1847
|
border-top: solid 1px ${i=>i.theme.colors.neutral150};
|
|
1848
1848
|
flex: 1;
|
|
1849
|
-
`,Vp=Object.freeze(Object.defineProperty({__proto__:null,Body:Np,Close:Pa,Content:Ep,Footer:Wp,Header:Lp,Root:Op,Title:zp,Trigger:jp},Symbol.toStringTag,{value:"Module"})),qp="",_p=b.forwardRef(({startAction:i,locale:e,onValueChange:t,value:n,step:r=1,disabled:s=!1,...o},l)=>{const a
|
|
1849
|
+
`,Vp=Object.freeze(Object.defineProperty({__proto__:null,Body:Np,Close:Pa,Content:Ep,Footer:Wp,Header:Lp,Root:Op,Title:zp,Trigger:jp},Symbol.toStringTag,{value:"Module"})),qp="",_p=b.forwardRef(({startAction:i,locale:e,onValueChange:t,value:n,step:r=1,disabled:s=!1,...o},l)=>{const a=$i("NumberInput"),c=e||a.locale,h=b.useRef(new es.NumberParser(c,{style:"decimal"})),u=b.useRef(new es.NumberFormatter(c,{maximumFractionDigits:20})),[f,g]=Kp({prop(C){const R=String(n);return isNaN(Number(R))||R!==C&&C!==""?C:u.current.format(Number(n))},defaultProp:qp,onChange(C){if(!t)return;const R=h.current.parse(C??"");t(isNaN(R)?void 0:R)}}),p=C=>{g(String(C))},x=({target:{value:C}})=>{h.current.isValidPartialNumber(C)&&p(C)},y=(C=>{const R=C.toString();return R.includes(".")?R.split(".")[1].length:0})(r),v=()=>{if(!f){p(r);return}const C=h.current.parse(f),R=isNaN(C)?r:C+r,L=parseFloat(R.toFixed(y));p(u.current.format(L))},k=()=>{if(!f){p(-r);return}const C=h.current.parse(f),R=isNaN(C)?-r:C-r,L=parseFloat(R.toFixed(y));p(u.current.format(L))},S=C=>{if(!s)switch(C.key){case U.DOWN:{C.preventDefault(),k();break}case U.UP:{C.preventDefault(),v();break}}},$=()=>{if(f){const C=h.current.parse(f),R=isNaN(C)?"":u.current.format(C);p(R)}};return d.jsx(fn,{ref:l,startAction:i,disabled:s,type:"text",inputMode:"decimal",onChange:x,onKeyDown:S,onBlur:$,value:f,endAction:d.jsxs(T,{direction:"column",children:[d.jsx(uo,{disabled:s,"aria-hidden":!0,$reverse:!0,onClick:v,tabIndex:-1,type:"button","data-testid":"ArrowUp",children:d.jsx(z.CaretDown,{fill:"neutral500"})}),d.jsx(uo,{disabled:s,"aria-hidden":!0,onClick:k,tabIndex:-1,type:"button","data-testid":"ArrowDown",children:d.jsx(z.CaretDown,{fill:"neutral500"})})]}),...o})}),uo=m.styled.button`
|
|
1850
1850
|
display: flex;
|
|
1851
1851
|
justify-content: center;
|
|
1852
1852
|
align-items: center;
|
|
@@ -1858,14 +1858,14 @@ ${m.css`
|
|
|
1858
1858
|
width: 1.2rem;
|
|
1859
1859
|
transform: ${({$reverse:i})=>i?"rotateX(180deg)":void 0};
|
|
1860
1860
|
}
|
|
1861
|
-
`;function Kp({prop:i,defaultProp:e,onChange:t=()=>{}}){const[n,r]=
|
|
1861
|
+
`;function Kp({prop:i,defaultProp:e,onChange:t=()=>{}}){const[n,r]=wr({defaultProp:e,onChange:t}),s=i!==void 0,o=i instanceof Function?i(n):i,l=s?o:n,a=E.useCallbackRef(t),c=b.useCallback(h=>{if(s){const f=typeof h=="function"?h(o):h;f!==o&&(a(f),r(h))}else r(h)},[s,o,r,a]);return[l,c]}const La=b.createContext({activePage:1,pageCount:1}),Kr=()=>b.useContext(La),Up=({children:i,label:e="Pagination",activePage:t,pageCount:n})=>{const r=b.useMemo(()=>({activePage:t,pageCount:n}),[t,n]);return d.jsx(La.Provider,{value:r,children:d.jsx(A,{"aria-label":e,tag:"nav",children:d.jsx(T,{tag:"ol",gap:1,children:b.Children.map(i,(s,o)=>d.jsx("li",{children:s},o))})})})},Gp=Ae(({children:i,...e},t)=>{const{activePage:n}=Kr(),r=n===1;return d.jsxs(za,{ref:t,"aria-disabled":r,tabIndex:r?-1:void 0,...e,children:[d.jsx(nt,{children:i}),d.jsx(z.ChevronLeft,{"aria-hidden":!0})]})}),Yp=Ae(({children:i,...e},t)=>{const{activePage:n,pageCount:r}=Kr(),s=n===r;return d.jsxs(za,{ref:t,"aria-disabled":s,tabIndex:s?-1:void 0,...e,children:[d.jsx(nt,{children:i}),d.jsx(z.ChevronRight,{"aria-hidden":!0})]})}),Ba=m.styled(Ut)`
|
|
1862
1862
|
padding: ${({theme:i})=>i.spaces[3]};
|
|
1863
1863
|
border-radius: ${({theme:i})=>i.borderRadius};
|
|
1864
1864
|
box-shadow: ${({$active:i,theme:e})=>i?e.shadows.filterShadow:void 0};
|
|
1865
1865
|
text-decoration: none;
|
|
1866
1866
|
display: flex;
|
|
1867
1867
|
|
|
1868
|
-
${
|
|
1868
|
+
${an}
|
|
1869
1869
|
`,za=m.styled(Ba)`
|
|
1870
1870
|
font-size: 1.1rem;
|
|
1871
1871
|
|
|
@@ -1883,14 +1883,14 @@ ${m.css`
|
|
|
1883
1883
|
${i=>i["aria-disabled"]?`
|
|
1884
1884
|
pointer-events: none;
|
|
1885
1885
|
`:void 0}
|
|
1886
|
-
`,Xp=
|
|
1886
|
+
`,Xp=Ae(({number:i,children:e,...t},n)=>{const{activePage:r}=Kr(),s=r===i;return d.jsxs(Jp,{ref:n,...t,"aria-current":s,$active:s,children:[d.jsx(nt,{children:e}),d.jsx(O,{"aria-hidden":!0,fontWeight:s?"bold":void 0,lineHeight:"revert",variant:"pi",children:i})]})}),Jp=m.styled(Ba)`
|
|
1887
1887
|
color: ${({theme:i,$active:e})=>e?i.colors.primary700:i.colors.neutral800};
|
|
1888
1888
|
background: ${({theme:i,$active:e})=>e?i.colors.neutral0:void 0};
|
|
1889
1889
|
|
|
1890
1890
|
&:hover {
|
|
1891
1891
|
box-shadow: ${({theme:i})=>i.shadows.filterShadow};
|
|
1892
1892
|
}
|
|
1893
|
-
`,Qp=({children:i,...e})=>d.jsxs(A,{...e,children:[d.jsx(
|
|
1893
|
+
`,Qp=({children:i,...e})=>d.jsxs(A,{...e,children:[d.jsx(nt,{children:i}),d.jsx(O,{"aria-hidden":!0,lineHeight:"revert",textColor:"neutral800",variant:"pi",children:"…"})]}),Zp=_t.Root,e0=_t.Anchor,t0=_t.Arrow,i0=b.forwardRef((i,e)=>d.jsx(_t.Trigger,{...i,asChild:!0,ref:e})),n0=b.forwardRef((i,e)=>d.jsx(_t.Portal,{children:d.jsx(r0,{sideOffset:4,side:"bottom",align:"start",...i,ref:e})})),r0=m.styled(_t.Content)`
|
|
1894
1894
|
box-shadow: ${({theme:i})=>i.shadows.filterShadow};
|
|
1895
1895
|
z-index: ${({theme:i})=>i.zIndices.popover};
|
|
1896
1896
|
background-color: ${i=>i.theme.colors.neutral0};
|
|
@@ -1924,9 +1924,9 @@ ${m.css`
|
|
|
1924
1924
|
}
|
|
1925
1925
|
}
|
|
1926
1926
|
}
|
|
1927
|
-
`,s0=b.forwardRef(({children:i,intersectionId:e,onReachEnd:t,...n},r)=>{const s=b.useRef(null),o=Ce(s,r),l=ke();return
|
|
1927
|
+
`,s0=b.forwardRef(({children:i,intersectionId:e,onReachEnd:t,...n},r)=>{const s=b.useRef(null),o=Ce(s,r),l=ke();return vi(s,t??(()=>{}),{selectorToWatch:`#${Lt(l)}`,skipWhen:!e||!t}),d.jsxs(o0,{ref:o,...n,children:[i,e&&t&&d.jsx(A,{id:Lt(l),width:"100%",height:"1px"})]})}),o0=m.styled(ki)`
|
|
1928
1928
|
height: 20rem;
|
|
1929
|
-
`,l0=Object.freeze(Object.defineProperty({__proto__:null,Anchor:e0,Arrow:t0,Content:n0,Root:Zp,ScrollArea:s0,Trigger:i0},Symbol.toStringTag,{value:"Module"})),a0=b.forwardRef(({size:i="M",value:e,...t},n)=>d.jsx(h0,{ref:n,$size:i,...t,children:d.jsx(c0,{style:{transform:`translate3D(-${100-(e??0)}%, 0, 0)`}})})),h0=m.styled(
|
|
1929
|
+
`,l0=Object.freeze(Object.defineProperty({__proto__:null,Anchor:e0,Arrow:t0,Content:n0,Root:Zp,ScrollArea:s0,Trigger:i0},Symbol.toStringTag,{value:"Module"})),a0=b.forwardRef(({size:i="M",value:e,...t},n)=>d.jsx(h0,{ref:n,$size:i,...t,children:d.jsx(c0,{style:{transform:`translate3D(-${100-(e??0)}%, 0, 0)`}})})),h0=m.styled(yo.Root)`
|
|
1930
1930
|
position: relative;
|
|
1931
1931
|
overflow: hidden;
|
|
1932
1932
|
width: ${i=>i.$size==="S"?"7.8rem":"10.2rem"};
|
|
@@ -1937,7 +1937,7 @@ ${m.css`
|
|
|
1937
1937
|
/* Fix overflow clipping in Safari */
|
|
1938
1938
|
/* https://gist.github.com/domske/b66047671c780a238b51c51ffde8d3a0 */
|
|
1939
1939
|
transform: translateZ(0);
|
|
1940
|
-
`,c0=m.styled(
|
|
1940
|
+
`,c0=m.styled(yo.Indicator)`
|
|
1941
1941
|
background-color: ${({theme:i})=>i.colors.neutral0};
|
|
1942
1942
|
border-radius: ${({theme:i})=>i.borderRadius};
|
|
1943
1943
|
width: 100%;
|
|
@@ -1947,11 +1947,11 @@ ${m.css`
|
|
|
1947
1947
|
transition: transform ${i=>i.theme.motion.timings[320]}
|
|
1948
1948
|
${i=>i.theme.motion.easings.authenticMotion};
|
|
1949
1949
|
}
|
|
1950
|
-
`,d0=b.forwardRef((i,e)=>d.jsx(u0,{ref:e,...i})),u0=m.styled(
|
|
1950
|
+
`,d0=b.forwardRef((i,e)=>d.jsx(u0,{ref:e,...i})),u0=m.styled(xr.Root)`
|
|
1951
1951
|
display: flex;
|
|
1952
1952
|
flex-direction: column;
|
|
1953
1953
|
gap: ${i=>i.theme.spaces[3]};
|
|
1954
|
-
`,f0=b.forwardRef(({children:i,id:e,...t},n)=>{const r=ke(e);return d.jsxs(T,{gap:2,children:[d.jsx(g0,{id:r,ref:n,...t,children:d.jsx(p0,{})}),d.jsx(O,{tag:"label",htmlFor:r,children:i})]})}),g0=m.styled(
|
|
1954
|
+
`,f0=b.forwardRef(({children:i,id:e,...t},n)=>{const r=ke(e);return d.jsxs(T,{gap:2,children:[d.jsx(g0,{id:r,ref:n,...t,children:d.jsx(p0,{})}),d.jsx(O,{tag:"label",htmlFor:r,children:i})]})}),g0=m.styled(xr.Item)`
|
|
1955
1955
|
background: ${i=>i.theme.colors.neutral0};
|
|
1956
1956
|
width: 2rem;
|
|
1957
1957
|
height: 2rem;
|
|
@@ -1988,7 +1988,7 @@ ${m.css`
|
|
|
1988
1988
|
min-width: 44px;
|
|
1989
1989
|
min-height: 44px;
|
|
1990
1990
|
}
|
|
1991
|
-
`,p0=m.styled(
|
|
1991
|
+
`,p0=m.styled(xr.Indicator)`
|
|
1992
1992
|
display: flex;
|
|
1993
1993
|
align-items: center;
|
|
1994
1994
|
justify-content: center;
|
|
@@ -2010,12 +2010,12 @@ ${m.css`
|
|
|
2010
2010
|
border-radius: 50%;
|
|
2011
2011
|
background: ${i=>i.theme.colors.primary600};
|
|
2012
2012
|
}
|
|
2013
|
-
`,m0=Object.freeze(Object.defineProperty({__proto__:null,Group:d0,Item:f0},Symbol.toStringTag,{value:"Module"})),b0=i=>{const e=i.querySelector('[tabindex="0"]');e&&e.focus()},Na=b.createContext({rowIndex:0,colIndex:0,setTableValues(){throw new Error("setTableValues must be initialized via the RawTableContext.Provider")}}),x0=()=>b.useContext(Na),Fa=b.forwardRef(({colCount:i,rowCount:e,jumpStep:t=3,initialCol:n=0,initialRow:r=0,...s},o)=>{const l=b.useRef(null),a=b.useRef(!1),c=Ce(l,o),[h,u]=b.useState(r),[f,g]=b.useState(n),p=b.useCallback(({colIndex:y,rowIndex:v})=>{g(y),u(v)},[]);b.useEffect(()=>{a.current&&b0(l.current),a.current||(a.current=!0)},[f,h]);const x=y=>{switch(y.key){case
|
|
2013
|
+
`,m0=Object.freeze(Object.defineProperty({__proto__:null,Group:d0,Item:f0},Symbol.toStringTag,{value:"Module"})),b0=i=>{const e=i.querySelector('[tabindex="0"]');e&&e.focus()},Na=b.createContext({rowIndex:0,colIndex:0,setTableValues(){throw new Error("setTableValues must be initialized via the RawTableContext.Provider")}}),x0=()=>b.useContext(Na),Fa=b.forwardRef(({colCount:i,rowCount:e,jumpStep:t=3,initialCol:n=0,initialRow:r=0,...s},o)=>{const l=b.useRef(null),a=b.useRef(!1),c=Ce(l,o),[h,u]=b.useState(r),[f,g]=b.useState(n),p=b.useCallback(({colIndex:y,rowIndex:v})=>{g(y),u(v)},[]);b.useEffect(()=>{a.current&&b0(l.current),a.current||(a.current=!0)},[f,h]);const x=y=>{switch(y.key){case U.RIGHT:{y.preventDefault(),g(v=>v<i-1?v+1:v);break}case U.LEFT:{y.preventDefault(),g(v=>v>0?v-1:v);break}case U.UP:{y.preventDefault(),u(v=>v>0?v-1:v);break}case U.DOWN:{y.preventDefault(),u(v=>v<e-1?v+1:v);break}case U.HOME:{y.preventDefault(),y.ctrlKey&&u(0),g(0);break}case U.END:{y.preventDefault(),y.ctrlKey&&u(e-1),g(i-1);break}case U.PAGE_DOWN:{y.preventDefault(),u(v=>v+t<e?v+t:e-1);break}case U.PAGE_UP:{y.preventDefault(),u(v=>v-t>0?v-t:0);break}}},w=b.useMemo(()=>({rowIndex:h,colIndex:f,setTableValues:p}),[f,h,p]);return d.jsx(Na.Provider,{value:w,children:d.jsx("table",{role:"grid",ref:c,"aria-rowcount":e,"aria-colcount":i,onKeyDown:x,...s})})}),pt=(i,e)=>[...i.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(r=>r.hasAttribute("disabled")?!1:e?!0:r.getAttribute("tabindex")!=="-1"),On=i=>i.filter(e=>e.tagName==="INPUT"?e.type!=="checkbox"&&e.type!=="radio":!1),Ur=b.forwardRef(({coords:i={col:0,row:0},tag:e="td",...t},n)=>{const r=b.useRef(null),s=Ce(n,r),{rowIndex:o,colIndex:l,setTableValues:a}=x0(),[c,h]=b.useState(!1),u=p=>{var y;const x=pt(r.current,!0);if(x.length===0||x.length===1&&On(x).length===0)return;if(x.length>1&&!x.find(v=>v.tagName!=="BUTTON")){p.preventDefault();const v=x.findIndex(k=>k===document.activeElement);if(p.key===U.RIGHT){const k=x[v+1];k&&(p.stopPropagation(),k.focus())}else if(p.key===U.LEFT){const k=x[v-1];k&&(p.stopPropagation(),k.focus())}return}const w=p.key===U.ENTER;if(w&&!c)h(!0);else if((p.key===U.ESCAPE||w)&&c){if(w&&((y=document.activeElement)==null?void 0:y.tagName)==="A")return;h(!1),r.current.focus()}else c&&p.stopPropagation()},f=o===i.row-1&&l===i.col-1;Le(()=>{const p=pt(r.current,!0);p.length===0||p.length===1&&On(p).length!==0||p.length>1&&p.find(x=>x.tagName!=="BUTTON")?(r.current.setAttribute("tabIndex",!c&&f?"0":"-1"),p.forEach((x,w)=>{x.setAttribute("tabIndex",c?"0":"-1"),c&&w===0&&x.focus()})):p.forEach(x=>{x.setAttribute("tabIndex",f?"0":"-1")})},[c,f]);const g=b.useCallback(()=>{const p=pt(r.current,!0);p.length>=1&&(On(p).length!==0||!p.find(x=>x.tagName!=="BUTTON"))&&h(!0),a({rowIndex:i.row-1,colIndex:i.col-1})},[i,a]);return Le(()=>{const p=r.current;return pt(p,!0).forEach(w=>{w.addEventListener("focus",g)}),()=>{pt(p,!0).forEach(y=>{y.removeEventListener("focus",g)})}},[g]),d.jsx(A,{role:"gridcell",tag:e,ref:s,onKeyDown:u,...t})}),Wa=i=>d.jsx(Ur,{...i,tag:"th"}),Ha=({children:i,...e})=>{const t=b.Children.toArray(i).map(n=>b.isValidElement(n)?b.cloneElement(n,{"aria-rowindex":1}):n);return d.jsx("thead",{...e,children:t})},Va=({children:i,...e})=>{const t=b.Children.toArray(i).map((n,r)=>b.isValidElement(n)?b.cloneElement(n,{"aria-rowindex":r+2}):n);return d.jsx("tbody",{...e,children:t})},qa=({children:i,...e})=>{const t=b.Children.toArray(i).map((n,r)=>b.isValidElement(n)?b.cloneElement(n,{"aria-colindex":r+1,coords:{col:r+1,row:e["aria-rowindex"]}}):n);return d.jsx(A,{tag:"tr",...e,children:t})},y0=m.styled(z.Cross)`
|
|
2014
2014
|
font-size: 0.5rem;
|
|
2015
2015
|
path {
|
|
2016
2016
|
fill: ${({theme:i})=>i.colors.neutral500};
|
|
2017
2017
|
}
|
|
2018
|
-
`,_a=m.styled(
|
|
2018
|
+
`,_a=m.styled(z.Search)`
|
|
2019
2019
|
font-size: 1rem;
|
|
2020
2020
|
path {
|
|
2021
2021
|
fill: ${({theme:i})=>i.colors.neutral500};
|
|
@@ -2029,7 +2029,7 @@ ${m.css`
|
|
|
2029
2029
|
fill: ${({theme:i})=>i.colors.primary600};
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
|
-
`,v0=m.styled(
|
|
2032
|
+
`,v0=m.styled(fn)`
|
|
2033
2033
|
border: 1px solid ${({theme:i})=>i.colors.neutral150};
|
|
2034
2034
|
padding: 0 0 0 8px;
|
|
2035
2035
|
color: ${({theme:i})=>i.colors.neutral800};
|
|
@@ -2040,7 +2040,7 @@ ${m.css`
|
|
|
2040
2040
|
}
|
|
2041
2041
|
}
|
|
2042
2042
|
|
|
2043
|
-
${
|
|
2043
|
+
${rt()}
|
|
2044
2044
|
|
|
2045
2045
|
> input::-ms-clear {
|
|
2046
2046
|
display: none;
|
|
@@ -2060,7 +2060,7 @@ ${m.css`
|
|
|
2060
2060
|
> input::-webkit-search-results-decoration {
|
|
2061
2061
|
display: none;
|
|
2062
2062
|
}
|
|
2063
|
-
`,Ka=b.forwardRef(({name:i,children:e,value:t="",onClear:n,clearLabel:r="Clear",...s},o)=>{const l=b.useRef(null),a=t.length>0,c=u=>{n(u),l.current.focus()},h=
|
|
2063
|
+
`,Ka=b.forwardRef(({name:i,children:e,value:t="",onClear:n,clearLabel:r="Clear",...s},o)=>{const l=b.useRef(null),a=t.length>0,c=u=>{n(u),l.current.focus()},h=Sr(o,l);return d.jsx(w0,{children:d.jsxs(wt,{name:i,children:[d.jsx(nt,{children:d.jsx(Ar,{children:e})}),d.jsx(v0,{size:"S",type:"search",ref:h,value:t,startAction:d.jsx(_a,{"aria-hidden":!0}),onKeyDown:u=>{u.stopPropagation(),u.key==="Escape"&&a&&c(u)},endAction:a?d.jsx(et,{onClick:c,onMouseDown:u=>{u.preventDefault()},label:r,size:"XS",variant:"ghost",type:"button",children:d.jsx(y0,{})}):void 0,...s})]})})}),Ua=i=>d.jsx("form",{...i,role:"search"}),S0=m.styled(A)`
|
|
2064
2064
|
display: inline-flex;
|
|
2065
2065
|
border: none;
|
|
2066
2066
|
|
|
@@ -2080,7 +2080,7 @@ ${m.css`
|
|
|
2080
2080
|
color: inherit;
|
|
2081
2081
|
border-right: 1px solid ${({theme:i,$disabled:e})=>e?i.colors.neutral300:i.colors.primary200};
|
|
2082
2082
|
padding-right: ${({theme:i})=>i.spaces[2]};
|
|
2083
|
-
`,Ya=b.forwardRef(({children:i,clearLabel:e="Clear",customizeContent:t,disabled:n,hasError:r,id:s,
|
|
2083
|
+
`,Ya=b.forwardRef(({children:i,clearLabel:e="Clear",customizeContent:t,disabled:n,hasError:r,id:s,loading:o,name:l,onChange:a,onClear:c,onCloseAutoFocus:h,onReachEnd:u,placeholder:f,required:g,size:p,startIcon:x,value:w,withTags:y,...v},k)=>{const S=b.useRef(null),[$,C]=b.useState(),[R,L]=b.useState(!1),I=Z=>{a?a(Z):C(Z)},P=Z=>()=>{const ce=Array.isArray(w)?w.filter(Fe=>Fe!==Z):($??[]).filter(Fe=>Fe!==Z);a?a(ce):C(ce)},ne=Z=>{L(Z)},_=ke(),K=`intersection-${Lt(_)}`;vi(S,Z=>{u&&u(Z)},{selectorToWatch:`#${K}`,skipWhen:!R});const F=typeof w<"u"&&w!==null?w:$,ae=Z=>Z&&typeof Z=="object"&&Z.value?d.jsx(Ga,{tabIndex:-1,disabled:n,icon:d.jsx(z.Cross,{width:`${14/16}rem`,height:`${14/16}rem`}),onClick:P(Z.value),children:Z.textValue},Z.value):null,{error:B,...H}=$e("MultiSelect"),me=!!B||r,oe=H.id??s,Te=H.name??l,he=H.required??g;let be;return B?be=`${oe}-error`:H.hint&&(be=`${oe}-hint`),d.jsxs(cl,{onOpenChange:ne,disabled:n,required:he,onValueChange:I,value:F,...v,multi:!0,children:[d.jsx(dl,{ref:k,id:oe,name:Te,"aria-label":v["aria-label"],"aria-describedby":be??v["aria-describedby"],startIcon:x,hasError:me,disabled:n,clearLabel:e,loading:o,onClear:F!=null&&F.length?c:void 0,withTags:!!(y&&((F==null?void 0:F.length)??!1)),size:p,children:d.jsx(ul,{placeholder:f,textColor:F!=null&&F.length?"neutral800":"neutral600",withTags:y,children:F!=null&&F.length?y?ae:t?t(F):void 0:void 0})}),d.jsx(fl,{children:d.jsx(gl,{position:"popper",sideOffset:4,onCloseAutoFocus:h,children:d.jsxs(pl,{ref:S,children:[i,d.jsx(A,{id:K,width:"100%",height:"1px"})]})})})]})}),Gr=b.forwardRef(({value:i,children:e,startIcon:t,...n},r)=>d.jsxs(Or,{ref:r,value:i.toString(),...n,children:[t&&d.jsx(A,{tag:"span","aria-hidden":!0,children:t}),d.jsx(ml,{children:({isSelected:s,isIntermediate:o})=>d.jsx(un,{checked:o?"indeterminate":s})}),d.jsx(O,{children:d.jsx(bl,{children:e})})]})),Xa=b.forwardRef(({children:i,label:e,startIcon:t,values:n=[],...r},s)=>d.jsxs(Uu,{ref:s,children:[d.jsxs(Or,{value:n,...r,children:[t&&d.jsx(A,{tag:"span","aria-hidden":!0,children:t}),d.jsx(ml,{children:({isSelected:o,isIntermediate:l})=>d.jsx(un,{checked:l?"indeterminate":o})}),d.jsx(O,{children:e})]}),i]})),k0=({options:i,...e})=>d.jsx(Ya,{...e,children:i.map(t=>"children"in t?d.jsx(Xa,{label:t.label,values:t.children.map(n=>n.value.toString()),children:t.children.map(n=>d.jsx($0,{value:n.value,children:n.label},n.value))},t.label):d.jsx(Gr,{value:t.value,children:t.label},t.value))}),$0=m.styled(Gr)`
|
|
2084
2084
|
padding-left: ${({theme:i})=>i.spaces[7]};
|
|
2085
2085
|
`,T0=i=>i==="XS"?{paddingX:"0.6rem",paddingY:"0.2rem"}:i==="S"?{paddingX:2,paddingY:1}:{paddingX:5,paddingY:4},A0=({variant:i="primary",size:e="M",children:t,...n})=>{const r=`${i}100`,s=`${i}200`,o=`${i}600`,{paddingX:l,paddingY:a}=T0(e);return d.jsx(A,{borderColor:s,color:o,background:r,hasRadius:!0,paddingTop:a,paddingBottom:a,paddingLeft:l,paddingRight:l,...n,children:t})},R0="23.2rem",D0=b.forwardRef(({...i},e)=>d.jsx(M0,{ref:e,...i,tag:"nav"})),M0=m.styled(A)`
|
|
2086
2086
|
width: ${R0};
|
|
@@ -2091,10 +2091,10 @@ ${m.css`
|
|
|
2091
2091
|
overflow-y: auto;
|
|
2092
2092
|
border-right: 1px solid ${({theme:i})=>i.colors.neutral200};
|
|
2093
2093
|
z-index: 1;
|
|
2094
|
-
`,
|
|
2094
|
+
`,fo=m.styled(jr)`
|
|
2095
2095
|
width: 2.4rem;
|
|
2096
2096
|
background-color: ${({theme:i})=>i.colors.neutral200};
|
|
2097
|
-
`,O0=({tag:i="h2",label:e,searchLabel:t="",searchable:n=!1,onChange:r=()=>{},value:s="",onClear:o=()=>{},onSubmit:l=()=>{},id:a,placeholder:c})=>{const[h,u]=b.useState(!1),f=
|
|
2097
|
+
`,O0=({tag:i="h2",label:e,searchLabel:t="",searchable:n=!1,onChange:r=()=>{},value:s="",onClear:o=()=>{},onSubmit:l=()=>{},id:a,placeholder:c})=>{const[h,u]=b.useState(!1),f=E.usePrev(h),g=ke(a),p=b.useRef(void 0),x=b.useRef(void 0);b.useEffect(()=>{h&&p.current&&p.current.focus(),f&&!h&&x.current&&x.current.focus()},[h,f]);const w=()=>{u(S=>!S)},y=S=>{o(S),p.current.focus()},v=S=>{var $;(($=S.relatedTarget)==null?void 0:$.id)!==g&&u(!1)},k=S=>{S.key===U.ESCAPE&&u(!1)};return h?d.jsxs(A,{paddingLeft:4,paddingTop:5,paddingBottom:2,paddingRight:4,children:[d.jsx(Ua,{children:d.jsx(Ka,{name:"searchbar",value:s,onChange:r,placeholder:c,onKeyDown:k,ref:p,onBlur:v,onClear:y,onSubmit:l,clearLabel:"Clear",children:t})}),d.jsx(A,{paddingLeft:2,paddingTop:4,children:d.jsx(fo,{})})]}):d.jsxs(T,{direction:"column",alignItems:"flex-start",paddingLeft:6,paddingTop:6,paddingBottom:2,paddingRight:4,children:[d.jsxs(T,{justifyContent:"space-between",alignItems:"flex-start",width:"100%",gap:2,children:[d.jsx(O,{variant:"beta",tag:i,children:e}),n&&d.jsx(et,{ref:x,onClick:w,label:t,children:d.jsx(z.Search,{})})]}),d.jsx(A,{paddingTop:4,children:d.jsx(fo,{})})]})},j0=Ae(({active:i,children:e,icon:t=null,withBullet:n=!1,isSubSectionChild:r=!1,...s},o)=>d.jsxs(E0,{background:"neutral100",paddingLeft:r?9:7,paddingBottom:2,paddingTop:2,ref:o,...s,children:[d.jsxs(T,{children:[t?d.jsx(I0,{children:t}):d.jsx(mr,{$active:i}),d.jsx(O,{paddingLeft:2,children:e})]}),n&&d.jsx(T,{paddingRight:4,children:d.jsx(mr,{$active:!0})})]})),mr=m.styled.span`
|
|
2098
2098
|
width: 0.4rem;
|
|
2099
2099
|
height: 0.4rem;
|
|
2100
2100
|
background-color: ${({theme:i,$active:e})=>e?i.colors.primary600:i.colors.neutral600};
|
|
@@ -2117,7 +2117,7 @@ ${m.css`
|
|
|
2117
2117
|
font-weight: 500;
|
|
2118
2118
|
`}
|
|
2119
2119
|
|
|
2120
|
-
${
|
|
2120
|
+
${mr} {
|
|
2121
2121
|
background-color: ${({theme:i})=>i.colors.primary600};
|
|
2122
2122
|
}
|
|
2123
2123
|
}
|
|
@@ -2136,12 +2136,12 @@ ${m.css`
|
|
|
2136
2136
|
background: transparent;
|
|
2137
2137
|
display: flex;
|
|
2138
2138
|
align-items: center;
|
|
2139
|
-
`,L0=({label:i,children:e,id:t})=>{const[n,r]=b.useState(!0),s=ke(t),o=()=>{r(l=>!l)};return d.jsxs(A,{children:[d.jsx(A,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4,children:d.jsx(T,{justifyContent:"space-between",children:d.jsxs(P0,{onClick:o,"aria-expanded":n,"aria-controls":s,children:[d.jsx(
|
|
2139
|
+
`,L0=({label:i,children:e,id:t})=>{const[n,r]=b.useState(!0),s=ke(t),o=()=>{r(l=>!l)};return d.jsxs(A,{children:[d.jsx(A,{paddingLeft:7,paddingTop:2,paddingBottom:2,paddingRight:4,children:d.jsx(T,{justifyContent:"space-between",children:d.jsxs(P0,{onClick:o,"aria-expanded":n,"aria-controls":s,children:[d.jsx(z.CaretDown,{width:"1.2rem",height:"1.2rem","aria-hidden":!0,fill:"neutral700",style:{transform:`rotateX(${n?"0deg":"180deg"})`}}),d.jsx(A,{paddingLeft:2,children:d.jsx(O,{tag:"span",fontWeight:"semiBold",textColor:"neutral800",children:i})})]})})}),n&&d.jsx("ul",{id:s,children:b.Children.map(e,(l,a)=>d.jsx("li",{children:l},a))})]})},B0=({collapsable:i=!1,label:e,onClick:t=()=>{},ariaExpanded:n,ariaControls:r})=>i?d.jsxs(T,{tag:"button",onClick:t,"aria-expanded":n,"aria-controls":r,textAlign:"left",alignItems:"center",children:[d.jsx(A,{paddingRight:1,children:d.jsx(O,{variant:"sigma",textColor:"neutral600",children:e})}),i&&d.jsx(z.CaretDown,{width:"1.2rem","aria-hidden":!0,fill:"neutral500",style:{transform:n?"rotateX(0deg)":"rotateX(180deg)"}})]}):d.jsx(T,{children:d.jsx(A,{paddingRight:1,children:d.jsx(O,{variant:"sigma",textColor:"neutral600",children:e})})}),z0=m.styled(A)`
|
|
2140
2140
|
& > svg {
|
|
2141
2141
|
height: 0.4rem;
|
|
2142
2142
|
fill: ${({theme:i})=>i.colors.neutral500};
|
|
2143
2143
|
}
|
|
2144
|
-
`,N0=({collapsable:i=!1,label:e,badgeLabel:t,children:n,id:r})=>{const[s,o]=b.useState(!0),l=ke(r),a=()=>{o(c=>!c)};return d.jsxs(T,{direction:"column",alignItems:"stretch",gap:1,children:[d.jsx(z0,{paddingLeft:6,paddingTop:2,paddingBottom:2,paddingRight:4,children:d.jsxs(A,{position:"relative",paddingRight:t?6:0,children:[d.jsx(B0,{onClick:a,ariaExpanded:s,ariaControls:l,collapsable:i,label:e}),t&&d.jsx(
|
|
2144
|
+
`,N0=({collapsable:i=!1,label:e,badgeLabel:t,children:n,id:r})=>{const[s,o]=b.useState(!0),l=ke(r),a=()=>{o(c=>!c)};return d.jsxs(T,{direction:"column",alignItems:"stretch",gap:1,children:[d.jsx(z0,{paddingLeft:6,paddingTop:2,paddingBottom:2,paddingRight:4,children:d.jsxs(A,{position:"relative",paddingRight:t?6:0,children:[d.jsx(B0,{onClick:a,ariaExpanded:s,ariaControls:l,collapsable:i,label:e}),t&&d.jsx(vr,{backgroundColor:"neutral150",textColor:"neutral600",position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",children:t})]})}),(!i||s)&&d.jsx("ol",{id:l,children:b.Children.map(n,(c,h)=>d.jsx("li",{children:c},h))})]})},F0=({children:i,spacing:e=2,horizontal:t=!1,...n})=>d.jsx(A,{paddingTop:2,paddingBottom:4,children:d.jsx(T,{tag:"ol",gap:e,direction:t?"row":"column",alignItems:t?"center":"stretch",...n,children:b.Children.map(i,(r,s)=>d.jsx("li",{children:r},s))})}),W0=b.forwardRef(({visibleLabels:i,onLabel:e="On",offLabel:t="Off",onCheckedChange:n,checked:r,defaultChecked:s,disabled:o,...l},a)=>{const[c,h]=Pe({prop:r,defaultProp:s}),u=f=>{h(f)};return d.jsxs(T,{gap:3,children:[d.jsx(H0,{ref:a,onCheckedChange:E.composeEventHandlers(n,u),checked:c,disabled:o,...l,children:d.jsx(V0,{})}),i?d.jsx(q0,{"aria-hidden":!0,"data-disabled":o,"data-state":c?"checked":"unchecked",children:c?e:t}):null]})}),H0=m.styled(wo.Root)`
|
|
2145
2145
|
width: 4rem;
|
|
2146
2146
|
height: 2.4rem;
|
|
2147
2147
|
border-radius: 1.2rem;
|
|
@@ -2158,7 +2158,7 @@ ${m.css`
|
|
|
2158
2158
|
@media (prefers-reduced-motion: no-preference) {
|
|
2159
2159
|
transition: ${i=>i.theme.transitions.backgroundColor};
|
|
2160
2160
|
}
|
|
2161
|
-
`,V0=m.styled(
|
|
2161
|
+
`,V0=m.styled(wo.Thumb)`
|
|
2162
2162
|
display: block;
|
|
2163
2163
|
height: 1.6rem;
|
|
2164
2164
|
width: 1.6rem;
|
|
@@ -2184,15 +2184,15 @@ ${m.css`
|
|
|
2184
2184
|
&[data-disabled='true'] {
|
|
2185
2185
|
color: ${({theme:i})=>i.colors.neutral500};
|
|
2186
2186
|
}
|
|
2187
|
-
`,[_0,
|
|
2187
|
+
`,[_0,Yr]=Kt("Tabs"),K0=b.forwardRef(({disabled:i=!1,variant:e="regular",hasError:t,...n},r)=>d.jsx(_0,{disabled:i,hasError:t,variant:e,children:d.jsx(U0,{ref:r,...n})})),U0=m.styled(ln.Root)`
|
|
2188
2188
|
width: 100%;
|
|
2189
2189
|
position: relative;
|
|
2190
|
-
`,G0=b.forwardRef((i,e)=>{const{variant:t}=
|
|
2190
|
+
`,G0=b.forwardRef((i,e)=>{const{variant:t}=Yr("List");return d.jsx(Y0,{ref:e,...i,$variant:t})}),Y0=m.styled(ln.List)`
|
|
2191
2191
|
display: flex;
|
|
2192
2192
|
align-items: ${i=>i.$variant==="regular"?"flex-end":"unset"};
|
|
2193
2193
|
position: relative;
|
|
2194
2194
|
z-index: 0;
|
|
2195
|
-
`,X0=b.forwardRef(({children:i,disabled:e,...t},n)=>{const{disabled:r,variant:s,hasError:o}=
|
|
2195
|
+
`,X0=b.forwardRef(({children:i,disabled:e,...t},n)=>{const{disabled:r,variant:s,hasError:o}=Yr("Trigger"),l=r===!0||r===t.value||e,a=o===t.value;return d.jsxs(J0,{ref:n,...t,$hasError:a,$variant:s,disabled:l,children:[d.jsx(Qa,{fontWeight:"bold",variant:s==="simple"?"sigma":void 0,children:i}),s==="simple"?d.jsx(Ja,{}):null]})}),Ja=m.styled.span`
|
|
2196
2196
|
display: block;
|
|
2197
2197
|
width: 100%;
|
|
2198
2198
|
background-color: currentColor;
|
|
@@ -2201,7 +2201,7 @@ ${m.css`
|
|
|
2201
2201
|
left: 0;
|
|
2202
2202
|
opacity: 0;
|
|
2203
2203
|
height: 0.2rem;
|
|
2204
|
-
`,Qa=m.styled(O)``,J0=m.styled(
|
|
2204
|
+
`,Qa=m.styled(O)``,J0=m.styled(ln.Trigger)`
|
|
2205
2205
|
position: relative;
|
|
2206
2206
|
color: ${i=>i.$hasError?i.theme.colors.danger600:i.theme.colors.neutral600};
|
|
2207
2207
|
cursor: pointer;
|
|
@@ -2250,7 +2250,7 @@ ${m.css`
|
|
|
2250
2250
|
cursor: not-allowed;
|
|
2251
2251
|
color: ${i=>i.theme.colors.neutral400};
|
|
2252
2252
|
}
|
|
2253
|
-
`,Q0=b.forwardRef((i,e)=>{const{variant:t}=
|
|
2253
|
+
`,Q0=b.forwardRef((i,e)=>{const{variant:t}=Yr("Content");return d.jsx(Z0,{$variant:t,ref:e,...i})}),Z0=m.styled(ln.Content)`
|
|
2254
2254
|
${i=>i.$variant==="simple"?m.css`
|
|
2255
2255
|
|
|
2256
2256
|
`:m.css`
|
|
@@ -2316,7 +2316,7 @@ ${m.css`
|
|
|
2316
2316
|
padding-bottom: 0;
|
|
2317
2317
|
height: 5.6rem;
|
|
2318
2318
|
}
|
|
2319
|
-
`,dm=i=>d.jsx(cm,{...i}),Za=m.styled(
|
|
2319
|
+
`,dm=i=>d.jsx(cm,{...i}),Za=m.styled(Ur)`
|
|
2320
2320
|
vertical-align: middle;
|
|
2321
2321
|
text-align: left;
|
|
2322
2322
|
outline-offset: -4px;
|
|
@@ -2348,7 +2348,7 @@ ${m.css`
|
|
|
2348
2348
|
display: block;
|
|
2349
2349
|
width: 100%;
|
|
2350
2350
|
border: none;
|
|
2351
|
-
`,mm=({children:i,icon:e,...t})=>d.jsxs("div",{children:[d.jsx(
|
|
2351
|
+
`,mm=({children:i,icon:e,...t})=>d.jsxs("div",{children:[d.jsx(jr,{}),d.jsx(pm,{tag:"button",background:"primary100",padding:5,...t,children:d.jsxs(T,{children:[d.jsx(gm,{"aria-hidden":!0,background:"primary200",children:e}),d.jsx(A,{paddingLeft:3,children:d.jsx(O,{variant:"pi",fontWeight:"bold",textColor:"primary600",children:i})})]})})]}),bm=Ae(({children:i,startIcon:e,endIcon:t,disabled:n=!1,loading:r=!1,type:s="button",...o},l)=>{const a=n||r;return d.jsxs(wm,{ref:l,disabled:a,"aria-disabled":a,tag:"button",type:s,gap:2,...o,children:[r?d.jsx(ym,{"aria-hidden":!0,children:d.jsx(z.Loader,{})}):e,d.jsx(O,{variant:"pi",children:i}),t]})}),xm=m.keyframes`
|
|
2352
2352
|
from {
|
|
2353
2353
|
transform: rotate(0deg);
|
|
2354
2354
|
}
|
|
@@ -2370,9 +2370,9 @@ ${m.css`
|
|
|
2370
2370
|
color: ${i=>i.theme.colors.neutral600};
|
|
2371
2371
|
}
|
|
2372
2372
|
|
|
2373
|
-
${
|
|
2374
|
-
`,eh=b.forwardRef((i,e)=>d.jsx(
|
|
2375
|
-
${
|
|
2373
|
+
${an}
|
|
2374
|
+
`,eh=b.forwardRef((i,e)=>d.jsx(fn,{ref:e,...i}));eh.displayName="TextInput";const vm=b.forwardRef(({disabled:i,hasError:e,id:t,name:n,required:r,resizable:s=!0,...o},l)=>{const{error:a,...c}=$e("Textarea"),h=!!a||e,u=c.id??t,f=c.name??n,g=c.required||r;let p;return a?p=`${u}-error`:c.hint&&(p=`${u}-hint`),d.jsx(Sm,{borderColor:h?"danger600":"neutral200",$hasError:h,hasRadius:!0,children:d.jsx(Cm,{"aria-invalid":h,"aria-required":g,tag:"textarea",background:i?"neutral150":"neutral0",color:i?"neutral600":"neutral800",disabled:i,hasRadius:!0,ref:l,lineHeight:4,padding:4,width:"100%",height:"100%",id:u,name:f,"aria-describedby":p,$resizable:s,...o})})}),Sm=m.styled(A)`
|
|
2375
|
+
${rt()}
|
|
2376
2376
|
`,Cm=m.styled(A)`
|
|
2377
2377
|
display: block;
|
|
2378
2378
|
border: none;
|
|
@@ -2401,9 +2401,9 @@ ${m.css`
|
|
|
2401
2401
|
&:disabled {
|
|
2402
2402
|
cursor: not-allowed;
|
|
2403
2403
|
}
|
|
2404
|
-
`,km=b.forwardRef(({offLabel:i,onLabel:e,disabled:t,hasError:n,required:r,id:s,name:o,checked:l,onChange:a,...c},h)=>{const[u=!1,f]=
|
|
2405
|
-
${
|
|
2406
|
-
`,
|
|
2404
|
+
`,km=b.forwardRef(({offLabel:i,onLabel:e,disabled:t,hasError:n,required:r,id:s,name:o,checked:l,onChange:a,...c},h)=>{const[u=!1,f]=Pe({prop:l}),g=u!==null&&!u,{error:p,...x}=$e("Toggle"),w=!!p||n,y=x.id??s,v=x.name??o,k=x.required||r;let S;return p?S=`${y}-error`:x.hint&&(S=`${y}-hint`),d.jsxs($m,{position:"relative",hasRadius:!0,padding:1,background:t?"neutral150":"neutral100",borderStyle:"solid",borderWidth:"1px",borderColor:w?"danger600":"neutral200",wrap:"wrap",cursor:t?"not-allowed":"pointer",$hasError:w,children:[d.jsx(go,{hasRadius:!0,flex:"1 1 50%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,justifyContent:"center",background:t&&g?"neutral200":g?"neutral0":"transparent",borderColor:t&&g?"neutral300":g?"neutral200":t?"neutral150":"neutral100",children:d.jsx(O,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:t?"neutral700":g?"danger700":"neutral600",children:i})}),d.jsx(go,{hasRadius:!0,flex:"1 1 50%",paddingLeft:3,paddingRight:3,justifyContent:"center",background:t&&u?"neutral200":u?"neutral0":"transparent",borderColor:t&&u?"neutral300":u?"neutral200":t?"neutral150":"neutral100",children:d.jsx(O,{variant:"pi",fontWeight:"bold",textTransform:"uppercase",textColor:t?"neutral700":u?"primary600":"neutral600",children:e})}),d.jsx(Tm,{...c,id:y,name:v,ref:h,onChange:$=>{f($.currentTarget.checked),a==null||a($)},type:"checkbox","aria-required":k,disabled:t,"aria-disabled":t,checked:!!u,"aria-describedby":S})]})}),$m=m.styled(T)`
|
|
2405
|
+
${rt()}
|
|
2406
|
+
`,go=m.styled(T)`
|
|
2407
2407
|
padding-block: 0.6rem;
|
|
2408
2408
|
`,Tm=m.styled.input`
|
|
2409
2409
|
height: 100%;
|
|
@@ -2413,4 +2413,4 @@ ${m.css`
|
|
|
2413
2413
|
top: 0;
|
|
2414
2414
|
z-index: 0;
|
|
2415
2415
|
width: 100%;
|
|
2416
|
-
`,Am={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function Rm(){const[i,e]=
|
|
2416
|
+
`,Am={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function Rm(){const[i,e]=xe.useState(null),[t,n]=xe.useState(Am),r=xe.useMemo(()=>new ResizeObserver(s=>{if(s[0]){const{x:o,y:l,width:a,height:c,top:h,left:u,bottom:f,right:g}=s[0].contentRect;n({x:o,y:l,width:a,height:c,top:h,left:u,bottom:f,right:g})}}),[]);return Le(()=>{if(i)return r.observe(i),()=>{r.disconnect()}},[i,r]),[e,t]}const Dm=({onEscape:i,restoreFocus:e=!0,skipAutoFocus:t=!1,...n})=>{const r=b.useRef(null);b.useEffect(()=>{let o=null;return e&&(o=document.activeElement),()=>{o&&o.focus()}},[e]),b.useEffect(()=>{if(!r.current||t)return;const o=pt(r.current);o.length>0?o[0].focus():console.warn("[FocusTrap]: it seems there are no focusable elements in the focus trap tree. Make sure there s at least one.")},[t]);const s=o=>{if(o.key===U.ESCAPE&&i){i();return}if(o.key!==U.TAB)return;const l=pt(r.current);if(l.length>0){const a=l[0],c=l[l.length-1];o.shiftKey?a===document.activeElement&&(o.preventDefault(),c.focus()):c===document.activeElement&&(o.preventDefault(),a.focus())}};return d.jsx("div",{ref:r,onKeyDown:s,...n})},Mm=({tagName:i,attributeName:e="",...t})=>{const n=()=>{const o=document.activeElement;return o?i?o.tagName.toLowerCase()===i:o.hasAttribute(e):!1},r=o=>i?o.querySelectorAll(i):o.querySelectorAll(`[${e}]`),s=o=>{switch(o.key){case U.RIGHT:case U.DOWN:{if(n()){o.preventDefault();const l=document.activeElement,a=[...r(o.currentTarget)],c=a.findIndex(u=>u===l),h=c+1<a.length?c+1:0;a[h].focus()}break}case U.LEFT:case U.UP:{if(n()){o.preventDefault();const l=document.activeElement,a=[...r(o.currentTarget)],c=a.findIndex(u=>u===l),h=c-1>-1?c-1:a.length-1;a[h].focus()}break}case U.HOME:{n()&&(o.preventDefault(),r(o.currentTarget).item(0).focus());break}case U.END:{if(n()){o.preventDefault();const l=r(o.currentTarget);l.item(l.length-1).focus()}break}}};return d.jsx(A,{onKeyDown:s,...t})};Object.defineProperty(exports,"composeEventHandlers",{enumerable:!0,get:()=>E.composeEventHandlers});Object.defineProperty(exports,"useCallbackRef",{enumerable:!0,get:()=>E.useCallbackRef});Object.defineProperty(exports,"useCollator",{enumerable:!0,get:()=>E.useCollator});Object.defineProperty(exports,"useFilter",{enumerable:!0,get:()=>E.useFilter});exports.AccessibleIcon=yt;exports.Accordion=Qh;exports.Alert=sc;exports.Avatar=gc;exports.Badge=vr;exports.BaseLink=Ut;exports.Box=A;exports.Breadcrumbs=Do;exports.Button=Yi;exports.Card=Zc;exports.CardAction=Jo;exports.CardAsset=td;exports.CardBadge=od;exports.CardBody=ld;exports.CardCheckbox=dd;exports.CardContent=fd;exports.CardHeader=pd;exports.CardSubtitle=xd;exports.CardTimer=md;exports.CardTitle=bd;exports.Carousel=Qo;exports.CarouselActions=Nd;exports.CarouselImage=Fd;exports.CarouselInput=zd;exports.CarouselSlide=Hd;exports.Checkbox=un;exports.Combobox=rl;exports.ComboboxOption=sl;exports.Crumb=Mo;exports.CrumbLink=Oo;exports.CrumbSimpleMenu=Go;exports.DatePicker=yl;exports.DateTimePicker=Cf;exports.DesignSystemProvider=Iu;exports.Dialog=Du;exports.DismissibleLayer=hl;exports.Divider=jr;exports.Dots=Qp;exports.EmptyStateLayout=Tf;exports.Field=Bd;exports.Flex=T;exports.FocusTrap=Dm;exports.Grid=cu;exports.IconButton=et;exports.IconButtonGroup=Rc;exports.JSONInput=kp;exports.KeyboardKeys=U;exports.KeyboardNavigable=Mm;exports.Link=No;exports.LinkButton=Tp;exports.LiveRegions=ll;exports.Loader=Xi;exports.Main=Rp;exports.Menu=Xc;exports.MenuItem=Jc;exports.Modal=Vp;exports.MultiSelect=Ya;exports.MultiSelectGroup=Xa;exports.MultiSelectNested=k0;exports.MultiSelectOption=Gr;exports.NextLink=Yp;exports.NumberInput=_p;exports.PageLink=Xp;exports.Pagination=Up;exports.Popover=l0;exports.Portal=Mr;exports.PreviousLink=Gp;exports.ProgressBar=a0;exports.Radio=m0;exports.RawTable=Fa;exports.RawTbody=Va;exports.RawTd=Ur;exports.RawTh=Wa;exports.RawThead=Ha;exports.RawTr=qa;exports.ScrollArea=ki;exports.SearchForm=Ua;exports.Searchbar=Ka;exports.SimpleMenu=Uo;exports.SingleSelect=zn;exports.SingleSelectOption=Nn;exports.SkipToContent=Mp;exports.Status=A0;exports.SubNav=D0;exports.SubNavHeader=O0;exports.SubNavLink=j0;exports.SubNavLinkSection=L0;exports.SubNavSection=N0;exports.SubNavSections=F0;exports.Switch=W0;exports.TFooter=mm;exports.Table=sm;exports.Tabs=em;exports.Tag=Ga;exports.Tbody=lm;exports.Td=fm;exports.TextButton=bm;exports.TextInput=eh;exports.Textarea=vm;exports.Th=um;exports.Thead=hm;exports.TimePicker=wl;exports.Toggle=km;exports.Tooltip=dn;exports.Tr=dm;exports.Typography=O;exports.VisuallyHidden=nt;exports._internaluseUncontrolledState=wr;exports.composeRefs=Sr;exports.convertUTCDateToCalendarDateTime=Mt;exports.darkTheme=Td;exports.extendTheme=Ad;exports.extractStyleFromTheme=oi;exports.getThemeSize=Rd;exports.handleResponsiveValues=xt;exports.inputFocusStyle=rt;exports.isSSR=jo;exports.lightTheme=Tr;exports.setOpacity=Dr;exports.useComposedRefs=Ce;exports.useControllableState=Pe;exports.useDateFormatter=He;exports.useDesignSystem=$i;exports.useField=$e;exports.useId=ke;exports.useIsomorphicLayoutEffect=Le;exports.useMeasure=Rm;exports.useNotifyAT=Ou;
|