diff --git a/_app/immutable/assets/0.rBdhlCOg.css b/_app/immutable/assets/0.EfYT2wAc.css similarity index 98% rename from _app/immutable/assets/0.rBdhlCOg.css rename to _app/immutable/assets/0.EfYT2wAc.css index dc6d8a7..3d64ba8 100644 --- a/_app/immutable/assets/0.rBdhlCOg.css +++ b/_app/immutable/assets/0.EfYT2wAc.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 72.2% 50.6%;--destructive-foreground: 0 0% 98%;--ring: 240 10% 3.9%;--radius: .5rem}.dark{--background: 240 10% 3.9%;--foreground: 0 0% 98%;--muted: 240 3.7% 15.9%;--muted-foreground: 240 5% 64.9%;--popover: 240 10% 3.9%;--popover-foreground: 0 0% 98%;--card: 240 10% 3.9%;--card-foreground: 0 0% 98%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--primary: 0 0% 98%;--primary-foreground: 240 5.9% 10%;--secondary: 240 3.7% 15.9%;--secondary-foreground: 0 0% 98%;--accent: 240 3.7% 15.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--ring: 240 4.9% 83.9%}*{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity))}body{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.fixed{position:fixed}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.mt-12{margin-top:3rem}.block{display:block}.inline{display:inline}.inline-flex{display:inline-flex}.contents{display:contents}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-4{height:1rem}.h-8{height:2rem}.h-9{height:2.25rem}.w-10{width:2.5rem}.w-4{width:1rem}.w-full{width:100%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.whitespace-nowrap{white-space:nowrap}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.italic{font-style:italic}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}:is(.dark .dark\:bg-\[color\:hsl\(240\,10\%\,3\.9\%\)\]){--tw-bg-opacity: 1;background-color:hsl(240 10% 3.9% / var(--tw-bg-opacity))}@media not all and (min-width: 1024px){.max-lg\:hidden{display:none}.max-lg\:px-4{padding-left:1rem;padding-right:1rem}.max-lg\:text-left{text-align:left}}@media not all and (min-width: 768px){.max-md\:p-2{padding:.5rem}}@media (min-width: 768px){.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:mt-16{margin-top:4rem}.md\:w-\[708px\]{width:708px}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:py-16{padding-top:4rem;padding-bottom:4rem}} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 72.2% 50.6%;--destructive-foreground: 0 0% 98%;--ring: 240 10% 3.9%;--radius: .5rem}.dark{--background: 240 10% 3.9%;--foreground: 0 0% 98%;--muted: 240 3.7% 15.9%;--muted-foreground: 240 5% 64.9%;--popover: 240 10% 3.9%;--popover-foreground: 0 0% 98%;--card: 240 10% 3.9%;--card-foreground: 0 0% 98%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--primary: 0 0% 98%;--primary-foreground: 240 5.9% 10%;--secondary: 240 3.7% 15.9%;--secondary-foreground: 0 0% 98%;--accent: 240 3.7% 15.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--ring: 240 4.9% 83.9%}*{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity))}body{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.fixed{position:fixed}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.mt-12{margin-top:3rem}.block{display:block}.inline{display:inline}.inline-flex{display:inline-flex}.contents{display:contents}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-4{height:1rem}.h-8{height:2rem}.h-9{height:2.25rem}.w-10{width:2.5rem}.w-4{width:1rem}.w-full{width:100%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.whitespace-nowrap{white-space:nowrap}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.italic{font-style:italic}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}:is(.dark .dark\:bg-\[color\:hsl\(240\,10\%\,3\.9\%\)\]){--tw-bg-opacity: 1;background-color:hsl(240 10% 3.9% / var(--tw-bg-opacity))}@media not all and (min-width: 1024px){.max-lg\:hidden{display:none}.max-lg\:px-4{padding-left:1rem;padding-right:1rem}.max-lg\:text-left{text-align:left}}@media not all and (min-width: 768px){.max-md\:p-2{padding:.5rem}}@media (min-width: 768px){.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:mt-16{margin-top:4rem}.md\:w-\[708px\]{width:708px}.md\:px-0{padding-left:0;padding-right:0}.md\:py-16{padding-top:4rem;padding-bottom:4rem}} diff --git a/_app/immutable/assets/_layout.rBdhlCOg.css b/_app/immutable/assets/_layout.EfYT2wAc.css similarity index 98% rename from _app/immutable/assets/_layout.rBdhlCOg.css rename to _app/immutable/assets/_layout.EfYT2wAc.css index dc6d8a7..3d64ba8 100644 --- a/_app/immutable/assets/_layout.rBdhlCOg.css +++ b/_app/immutable/assets/_layout.EfYT2wAc.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 72.2% 50.6%;--destructive-foreground: 0 0% 98%;--ring: 240 10% 3.9%;--radius: .5rem}.dark{--background: 240 10% 3.9%;--foreground: 0 0% 98%;--muted: 240 3.7% 15.9%;--muted-foreground: 240 5% 64.9%;--popover: 240 10% 3.9%;--popover-foreground: 0 0% 98%;--card: 240 10% 3.9%;--card-foreground: 0 0% 98%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--primary: 0 0% 98%;--primary-foreground: 240 5.9% 10%;--secondary: 240 3.7% 15.9%;--secondary-foreground: 0 0% 98%;--accent: 240 3.7% 15.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--ring: 240 4.9% 83.9%}*{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity))}body{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.fixed{position:fixed}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.mt-12{margin-top:3rem}.block{display:block}.inline{display:inline}.inline-flex{display:inline-flex}.contents{display:contents}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-4{height:1rem}.h-8{height:2rem}.h-9{height:2.25rem}.w-10{width:2.5rem}.w-4{width:1rem}.w-full{width:100%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.whitespace-nowrap{white-space:nowrap}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.italic{font-style:italic}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}:is(.dark .dark\:bg-\[color\:hsl\(240\,10\%\,3\.9\%\)\]){--tw-bg-opacity: 1;background-color:hsl(240 10% 3.9% / var(--tw-bg-opacity))}@media not all and (min-width: 1024px){.max-lg\:hidden{display:none}.max-lg\:px-4{padding-left:1rem;padding-right:1rem}.max-lg\:text-left{text-align:left}}@media not all and (min-width: 768px){.max-md\:p-2{padding:.5rem}}@media (min-width: 768px){.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:mt-16{margin-top:4rem}.md\:w-\[708px\]{width:708px}.md\:px-2{padding-left:.5rem;padding-right:.5rem}.md\:py-16{padding-top:4rem;padding-bottom:4rem}} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background: 0 0% 100%;--foreground: 240 10% 3.9%;--muted: 240 4.8% 95.9%;--muted-foreground: 240 3.8% 46.1%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.9%;--card: 0 0% 100%;--card-foreground: 240 10% 3.9%;--border: 240 5.9% 90%;--input: 240 5.9% 90%;--primary: 240 5.9% 10%;--primary-foreground: 0 0% 98%;--secondary: 240 4.8% 95.9%;--secondary-foreground: 240 5.9% 10%;--accent: 240 4.8% 95.9%;--accent-foreground: 240 5.9% 10%;--destructive: 0 72.2% 50.6%;--destructive-foreground: 0 0% 98%;--ring: 240 10% 3.9%;--radius: .5rem}.dark{--background: 240 10% 3.9%;--foreground: 0 0% 98%;--muted: 240 3.7% 15.9%;--muted-foreground: 240 5% 64.9%;--popover: 240 10% 3.9%;--popover-foreground: 0 0% 98%;--card: 240 10% 3.9%;--card-foreground: 0 0% 98%;--border: 240 3.7% 15.9%;--input: 240 3.7% 15.9%;--primary: 0 0% 98%;--primary-foreground: 240 5.9% 10%;--secondary: 240 3.7% 15.9%;--secondary-foreground: 0 0% 98%;--accent: 240 3.7% 15.9%;--accent-foreground: 0 0% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 0% 98%;--ring: 240 4.9% 83.9%}*{--tw-border-opacity: 1;border-color:hsl(var(--border) / var(--tw-border-opacity))}body{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity));--tw-text-opacity: 1;color:hsl(var(--foreground) / var(--tw-text-opacity))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.fixed{position:fixed}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.mt-12{margin-top:3rem}.block{display:block}.inline{display:inline}.inline-flex{display:inline-flex}.contents{display:contents}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-4{height:1rem}.h-8{height:2rem}.h-9{height:2.25rem}.w-10{width:2.5rem}.w-4{width:1rem}.w-full{width:100%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.items-center{align-items:center}.justify-center{justify-content:center}.whitespace-nowrap{white-space:nowrap}.rounded-md{border-radius:calc(var(--radius) - 2px)}.border{border-width:1px}.border-input{--tw-border-opacity: 1;border-color:hsl(var(--input) / var(--tw-border-opacity))}.bg-background{--tw-bg-opacity: 1;background-color:hsl(var(--background) / var(--tw-bg-opacity))}.bg-destructive{--tw-bg-opacity: 1;background-color:hsl(var(--destructive) / var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity: 1;background-color:hsl(var(--primary) / var(--tw-bg-opacity))}.bg-secondary{--tw-bg-opacity: 1;background-color:hsl(var(--secondary) / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.italic{font-style:italic}.text-destructive-foreground{--tw-text-opacity: 1;color:hsl(var(--destructive-foreground) / var(--tw-text-opacity))}.text-primary{--tw-text-opacity: 1;color:hsl(var(--primary) / var(--tw-text-opacity))}.text-primary-foreground{--tw-text-opacity: 1;color:hsl(var(--primary-foreground) / var(--tw-text-opacity))}.text-secondary-foreground{--tw-text-opacity: 1;color:hsl(var(--secondary-foreground) / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background) / 1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:bg-accent:hover{--tw-bg-opacity: 1;background-color:hsl(var(--accent) / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{--tw-text-opacity: 1;color:hsl(var(--accent-foreground) / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: hsl(var(--ring) / var(--tw-ring-opacity))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}:is(.dark .dark\:bg-\[color\:hsl\(240\,10\%\,3\.9\%\)\]){--tw-bg-opacity: 1;background-color:hsl(240 10% 3.9% / var(--tw-bg-opacity))}@media not all and (min-width: 1024px){.max-lg\:hidden{display:none}.max-lg\:px-4{padding-left:1rem;padding-right:1rem}.max-lg\:text-left{text-align:left}}@media not all and (min-width: 768px){.max-md\:p-2{padding:.5rem}}@media (min-width: 768px){.md\:mx-auto{margin-left:auto;margin-right:auto}.md\:mt-16{margin-top:4rem}.md\:w-\[708px\]{width:708px}.md\:px-0{padding-left:0;padding-right:0}.md\:py-16{padding-top:4rem;padding-bottom:4rem}} diff --git a/_app/immutable/chunks/entry.s2OJZQGG.js b/_app/immutable/chunks/entry.KemuYrB9.js similarity index 92% rename from _app/immutable/chunks/entry.s2OJZQGG.js rename to _app/immutable/chunks/entry.KemuYrB9.js index e7b6a9e..42049cb 100644 --- a/_app/immutable/chunks/entry.s2OJZQGG.js +++ b/_app/immutable/chunks/entry.KemuYrB9.js @@ -1,3 +1,3 @@ -import{t as re}from"./scheduler.wibOmgHn.js";import{w as dt}from"./index.NY8kyXAF.js";new URL("sveltekit-internal://");function oe(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function se(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function st({href:t}){return t.split("#")[0]}const ce=["href","pathname","search","toString","toJSON"];function le(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ce)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const fe="/__data.json",ue=".html__data.json";function de(t){return t.endsWith(".html")?t.replace(/\.html$/,ue):t.replace(/\/$/,"")+fe}function he(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function pe(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&V.delete(ht(t)),Ot(t,n));const V=new Map;function ge(t,n){const e=ht(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&V.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=pe(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function me(t,n,e){if(V.size>0){const r=ht(t,e),a=V.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return it(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return it(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=_e.exec(c),[,h,g,d,m]=u;return n.push({name:d,matcher:m,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return it(c)}).join("")}).join("")}/?$`),params:n}}function we(t){return!/^\([^)]+\)$/.test(t)}function ve(t){return t.slice(1).split("/").filter(we)}function be(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function it(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ee({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ye(s),d={id:s,exec:m=>{const l=h.exec(m);if(l)return be(l,g,r)},errors:[1,...u||[]].map(m=>t[m]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function jt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function At(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}var xt;const I=((xt=globalThis.__sveltekit_j51elz)==null?void 0:xt.base)??"/note2";var Nt;const ke=((Nt=globalThis.__sveltekit_j51elz)==null?void 0:Nt.assets)??I,Se="1707108212975",Dt="sveltekit:snapshot",$t="sveltekit:scroll",Ct="sveltekit:states",Ae="sveltekit:pageurl",j="sveltekit:history",F="sveltekit:navigation",K={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},H=location.origin;function Vt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function pt(){return{x:pageXOffset,y:pageYOffset}}function N(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Rt={...K,"":K.hover};function Ft(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Gt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Ft(t)}}function lt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,a=!e||!!r||tt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===H&&t.hasAttribute("download");return{url:e,external:a,target:r,download:o}}function z(t){let n=null,e=null,r=null,a=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),e===null&&(e=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Ft(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Rt[r??"off"],preload_data:Rt[a??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function It(t){const n=dt(t);let e=!0;function r(){e=!0,n.update(i=>i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Re(){const{set:t,subscribe:n}=dt(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${ke}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Se;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function tt(t,n){return t.origin!==H||!t.pathname.startsWith(n)}const Ie=-1,Le=-2,Pe=-3,Te=-4,Ue=-5,xe=-6;function Ne(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ie)return;if(o===Pe)return NaN;if(o===Te)return 1/0;if(o===Ue)return-1/0;if(o===xe)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class et{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class qt{constructor(n,e){this.status=n,this.location=e}}class gt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",$e="x-sveltekit-trailing-slash";function Y(t){return t instanceof et||t instanceof gt?t.status:500}function Ce(t){return t instanceof gt?t.text:"Internal Error"}const x=jt($t)??{},G=jt(Dt)??{},T={url:It({}),page:It({}),navigating:dt(null),updated:Re()};function mt(t){x[t]=pt()}function Ve(t,n){let e=t+1;for(;x[e];)delete x[e],e+=1;for(e=n+1;G[e];)delete G[e],e+=1}function D(t){return location.href=t.href,new Promise(()=>{})}function Lt(){}let nt,ft,J,L,ut,$;const Ht=[],W=[];let P=null;const Bt=[],Fe=[];let O=[],w={branch:[],error:null,url:null},_t=!1,X=!1,Pt=!0,M=!1,C=!1,Kt=!1,yt=!1,wt,k,A,R,Z;async function Xe(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),$=t,nt=Ee(t),L=document.documentElement,ut=n,ft=t.nodes[0],J=t.nodes[1],ft(),J(),k=(a=history.state)==null?void 0:a[j],A=(o=history.state)==null?void 0:o[F],k||(k=A=Date.now(),history.replaceState({...history.state,[j]:k,[F]:A},""));const r=x[k];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await ze(ut,e):Be(location.href,{replaceState:!0}),Ke()}function zt(t){W.some(n=>n==null?void 0:n.snapshot)&&(G[t]=W.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function Yt(t){var n;(n=G[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=W[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function Tt(){mt(k),At($t,x),zt(A),At(Dt,G)}async function Jt(t,n,e,r){return B({type:"goto",url:Vt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(yt=!0)}})}async function Ge(t){return P={id:t.id,promise:Xt(t).then(n=>(n.type==="loaded"&&n.state.error&&(P=null),n))},P.promise}async function ct(t){const n=nt.find(e=>e.exec(Zt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function Wt(t,n){var a;w=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),R=t.props.page,wt=new $.root({target:n,props:{...t.props,stores:T,components:W},hydrate:!0}),Yt(A);const r={from:null,to:{params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(o=>o(r)),X=!0}async function Q({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(I&&(t.pathname===I||t.pathname===I+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=oe(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:je(e).map(d=>d.node.component),page:R}};i!==void 0&&(c.props.form=i);let f={},u=!R,h=0;for(let d=0;d(s&&(c.route=!0),l[_])}),params:new Proxy(r,{get:(l,_)=>(s&&c.params.add(_),l[_])}),data:(o==null?void 0:o.data)??null,url:le(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,_){let v;l instanceof Request?(v=l.url,_={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,..._}):v=l;const S=new URL(v,e);return s&&d(S.href),S.origin===e.origin&&(v=S.href.slice(e.origin.length)),X?me(v,S.href,_):ge(v,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,m)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Ut(t,n,e,r,a,o){if(yt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(Ht.some(s=>s(new URL(i))))return!0;return!1}function bt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function Me(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}async function Xt({id:t,invalidating:n,url:e,params:r,route:a}){if((P==null?void 0:P.id)===t)return P.promise;const{errors:o,layouts:i,leaf:s}=a,c=[...i,s];o.forEach(p=>p==null?void 0:p().catch(()=>{})),c.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let f=null;const u=w.url?t!==w.url.pathname+w.url.search:!1,h=w.route?a.id!==w.route.id:!1,g=Me(w.url,e);let d=!1;const m=c.map((p,y)=>{var U;const b=w.branch[y],E=!!(p!=null&&p[0])&&((b==null?void 0:b.loader)!==p[1]||Ut(d,h,u,g,(U=b.server)==null?void 0:U.uses,r));return E&&(d=!0),E});if(m.some(Boolean)){try{f=await ee(e,m)}catch(p){return at({status:Y(p),error:await q(p,{url:e,params:r,route:{id:a.id}}),url:e,route:a})}if(f.type==="redirect")return f}const l=f==null?void 0:f.nodes;let _=!1;const v=c.map(async(p,y)=>{var rt;if(!p)return;const b=w.branch[y],E=l==null?void 0:l[y];if((!E||E.type==="skip")&&p[1]===(b==null?void 0:b.loader)&&!Ut(_,h,u,g,(rt=b.universal)==null?void 0:rt.uses,r))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return vt({loader:p[1],url:e,params:r,route:a,parent:async()=>{var St;const kt={};for(let ot=0;ot{});const S=[];for(let p=0;pPromise.resolve({}),server_data_node:bt(o)}),c={node:await J(),loader:J,universal:null,server:null,data:null};return await Q({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function Et(t,n){if(!t||tt(t,I))return;let e;try{e=$.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=Zt(e);for(const a of nt){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:ie(o),url:t}}}function Zt(t){return se(t.slice(I.length)||"/")}function Qt({url:t,type:n,intent:e,delta:r}){let a=!1;const o=ae(w,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return M||Bt.forEach(s=>s(i)),a?null:o}async function B({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Lt,block:u=Lt}){const h=Et(n,!1),g=Qt({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=k,m=A;f(),M=!0,X&&T.navigating.set(g.navigation),Z=c;let l=h&&await Xt(h);if(!l){if(tt(n,I))return await D(n);l=await te(n,{id:null},await q(new gt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,Z!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await at({status:500,error:await q(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Jt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await T.updated.check()&&await D(n);if(Ht.length=0,yt=!1,mt(d),zt(m),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const p=o?0:1,y={[j]:k+=p,[F]:A+=p,[Ct]:i};(o?history.replaceState:history.pushState).call(history,y,"",n),o||Ve(k,A)}if(P=null,l.props.page.state=i,X){w=l.state,l.props.page&&(l.props.page.url=n);const p=(await Promise.all(Fe.map(y=>y(g.navigation)))).filter(y=>typeof y=="function");if(p.length>0){let y=function(){O=O.filter(b=>!p.includes(b))};p.push(y),O.push(...p)}wt.$set(l.props),Kt=!0}else Wt(l,ut);const{activeElement:_}=document;await re();const v=e?e.scroll:a?pt():null;if(Pt){const p=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));v?scrollTo(v.x,v.y):p?p.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==_&&document.activeElement!==document.body;!r&&!S&&Ye(),Pt=!0,l.props.page&&(R=l.props.page),M=!1,t==="popstate"&&Yt(A),g.fulfil(void 0),O.forEach(p=>p(g.navigation)),T.navigating.set(null)}async function te(t,n,e,r){return t.origin===H&&t.pathname===location.pathname&&!_t?await at({status:r,error:e,url:t,route:n}):await D(t)}function He(){let t;L.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}L.addEventListener("mousedown",n),L.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ct(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=Gt(o,L);if(!s)return;const{url:c,external:f,download:u}=lt(s,I);if(f||u)return;const h=z(s);if(!h.reload)if(i<=h.preload_data){const g=Et(c,!1);g&&Ge(g)}else i<=h.preload_code&&ct(c.pathname)}function a(){e.disconnect();for(const o of L.querySelectorAll("a")){const{url:i,external:s,download:c}=lt(o,I);if(s||c)continue;const f=z(o);f.reload||(f.preload_code===K.viewport&&e.observe(o),f.preload_code===K.eager&&ct(i.pathname))}}O.push(a),a()}function q(t,n){if(t instanceof et)return t.body;const e=Y(t),r=Ce(t);return $.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function Be(t,n={}){return t=Vt(t),t.origin!==H?Promise.reject(new Error("goto: invalid URL")):Jt(t,n,0)}function Ke(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Tt(),!M){const a=ae(w,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};Bt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Tt()}),(n=navigator.connection)!=null&&n.saveData||He(),L.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Gt(e.composedPath()[0],L);if(!r)return;const{url:a,external:o,target:i,download:s}=lt(r,I);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=z(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){Qt({url:a,type:"link"})?M=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===st(location)){const[,d]=w.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=r.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(C=!0,mt(k),t(a),!c.replace_state)return;C=!1}e.preventDefault(),B({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),L.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(tt(i,I))return;const s=e.target,c=z(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&f.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),B({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[j]){const a=e.state[j];if(Z={},a===k)return;const o=x[a],i=e.state[Ct]??{},s=new URL(e.state[Ae]??location.href),c=e.state[F],f=st(location)===st(w.url);if(c===A&&(Kt||f)){t(s),x[k]=pt(),o&&scrollTo(o.x,o.y),i!==R.state&&(R={...R,state:i},wt.$set({page:R})),k=a;return}const h=a-k;await B({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{k=a,A=c},block:()=>{history.go(-h)},nav_token:Z})}else if(!C){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[j]:++k,[F]:A},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&T.navigating.set(null)});function t(e){w.url=e,T.page.set({...R,url:e}),T.page.notify()}}async function ze(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){_t=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Et(c,!1)||{});let f;try{const u=r.map(async(d,m)=>{const l=i[m];return l!=null&&l.uses&&(l.uses=ne(l.uses)),vt({loader:$.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let v=0;vd===o.id);if(g){const d=g.layouts;for(let m=0;mo?"1":"0").join(""));const r=await Ot(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new et(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(g){return Ne(g,{Promise:d=>new Promise((m,l)=>{i.set(d,{fulfil:m,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` +import{t as re}from"./scheduler.wibOmgHn.js";import{w as dt}from"./index.NY8kyXAF.js";new URL("sveltekit-internal://");function oe(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function se(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function st({href:t}){return t.split("#")[0]}const ce=["href","pathname","search","toString","toJSON"];function le(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ce)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const fe="/__data.json",ue=".html__data.json";function de(t){return t.endsWith(".html")?t.replace(/\.html$/,ue):t.replace(/\/$/,"")+fe}function he(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function pe(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&V.delete(ht(t)),Ot(t,n));const V=new Map;function ge(t,n){const e=ht(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&V.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=pe(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function me(t,n,e){if(V.size>0){const r=ht(t,e),a=V.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return it(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return it(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=_e.exec(c),[,h,g,d,m]=u;return n.push({name:d,matcher:m,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return it(c)}).join("")}).join("")}/?$`),params:n}}function we(t){return!/^\([^)]+\)$/.test(t)}function ve(t){return t.slice(1).split("/").filter(we)}function be(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function it(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ee({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ye(s),d={id:s,exec:m=>{const l=h.exec(m);if(l)return be(l,g,r)},errors:[1,...u||[]].map(m=>t[m]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function jt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function At(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}var xt;const I=((xt=globalThis.__sveltekit_vpp47n)==null?void 0:xt.base)??"/note2";var Nt;const ke=((Nt=globalThis.__sveltekit_vpp47n)==null?void 0:Nt.assets)??I,Se="1707108298629",Dt="sveltekit:snapshot",$t="sveltekit:scroll",Ct="sveltekit:states",Ae="sveltekit:pageurl",j="sveltekit:history",F="sveltekit:navigation",K={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},H=location.origin;function Vt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function pt(){return{x:pageXOffset,y:pageYOffset}}function N(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Rt={...K,"":K.hover};function Ft(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Gt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Ft(t)}}function lt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,a=!e||!!r||tt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===H&&t.hasAttribute("download");return{url:e,external:a,target:r,download:o}}function Y(t){let n=null,e=null,r=null,a=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),e===null&&(e=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Ft(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Rt[r??"off"],preload_data:Rt[a??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function It(t){const n=dt(t);let e=!0;function r(){e=!0,n.update(i=>i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Re(){const{set:t,subscribe:n}=dt(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${ke}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Se;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function tt(t,n){return t.origin!==H||!t.pathname.startsWith(n)}const Ie=-1,Le=-2,Pe=-3,Te=-4,Ue=-5,xe=-6;function Ne(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ie)return;if(o===Pe)return NaN;if(o===Te)return 1/0;if(o===Ue)return-1/0;if(o===xe)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class et{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class qt{constructor(n,e){this.status=n,this.location=e}}class gt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",$e="x-sveltekit-trailing-slash";function J(t){return t instanceof et||t instanceof gt?t.status:500}function Ce(t){return t instanceof gt?t.text:"Internal Error"}const x=jt($t)??{},G=jt(Dt)??{},T={url:It({}),page:It({}),navigating:dt(null),updated:Re()};function mt(t){x[t]=pt()}function Ve(t,n){let e=t+1;for(;x[e];)delete x[e],e+=1;for(e=n+1;G[e];)delete G[e],e+=1}function D(t){return location.href=t.href,new Promise(()=>{})}function Lt(){}let nt,ft,W,L,ut,$;const Ht=[],z=[];let P=null;const Bt=[],Fe=[];let O=[],w={branch:[],error:null,url:null},_t=!1,X=!1,Pt=!0,M=!1,C=!1,Kt=!1,yt=!1,wt,k,A,R,Z;async function Xe(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),$=t,nt=Ee(t),L=document.documentElement,ut=n,ft=t.nodes[0],W=t.nodes[1],ft(),W(),k=(a=history.state)==null?void 0:a[j],A=(o=history.state)==null?void 0:o[F],k||(k=A=Date.now(),history.replaceState({...history.state,[j]:k,[F]:A},""));const r=x[k];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await Ye(ut,e):Be(location.href,{replaceState:!0}),Ke()}function Yt(t){z.some(n=>n==null?void 0:n.snapshot)&&(G[t]=z.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function Jt(t){var n;(n=G[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=z[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function Tt(){mt(k),At($t,x),Yt(A),At(Dt,G)}async function Wt(t,n,e,r){return B({type:"goto",url:Vt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(yt=!0)}})}async function Ge(t){return P={id:t.id,promise:Xt(t).then(n=>(n.type==="loaded"&&n.state.error&&(P=null),n))},P.promise}async function ct(t){const n=nt.find(e=>e.exec(Zt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function zt(t,n){var a;w=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),R=t.props.page,wt=new $.root({target:n,props:{...t.props,stores:T,components:z},hydrate:!0}),Jt(A);const r={from:null,to:{params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(o=>o(r)),X=!0}async function Q({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(I&&(t.pathname===I||t.pathname===I+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=oe(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:je(e).map(d=>d.node.component),page:R}};i!==void 0&&(c.props.form=i);let f={},u=!R,h=0;for(let d=0;d(s&&(c.route=!0),l[_])}),params:new Proxy(r,{get:(l,_)=>(s&&c.params.add(_),l[_])}),data:(o==null?void 0:o.data)??null,url:le(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,_){let v;l instanceof Request?(v=l.url,_={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,..._}):v=l;const S=new URL(v,e);return s&&d(S.href),S.origin===e.origin&&(v=S.href.slice(e.origin.length)),X?me(v,S.href,_):ge(v,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,m)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Ut(t,n,e,r,a,o){if(yt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(Ht.some(s=>s(new URL(i))))return!0;return!1}function bt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function Me(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}async function Xt({id:t,invalidating:n,url:e,params:r,route:a}){if((P==null?void 0:P.id)===t)return P.promise;const{errors:o,layouts:i,leaf:s}=a,c=[...i,s];o.forEach(p=>p==null?void 0:p().catch(()=>{})),c.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let f=null;const u=w.url?t!==w.url.pathname+w.url.search:!1,h=w.route?a.id!==w.route.id:!1,g=Me(w.url,e);let d=!1;const m=c.map((p,y)=>{var U;const b=w.branch[y],E=!!(p!=null&&p[0])&&((b==null?void 0:b.loader)!==p[1]||Ut(d,h,u,g,(U=b.server)==null?void 0:U.uses,r));return E&&(d=!0),E});if(m.some(Boolean)){try{f=await ee(e,m)}catch(p){return at({status:J(p),error:await q(p,{url:e,params:r,route:{id:a.id}}),url:e,route:a})}if(f.type==="redirect")return f}const l=f==null?void 0:f.nodes;let _=!1;const v=c.map(async(p,y)=>{var rt;if(!p)return;const b=w.branch[y],E=l==null?void 0:l[y];if((!E||E.type==="skip")&&p[1]===(b==null?void 0:b.loader)&&!Ut(_,h,u,g,(rt=b.universal)==null?void 0:rt.uses,r))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return vt({loader:p[1],url:e,params:r,route:a,parent:async()=>{var St;const kt={};for(let ot=0;ot{});const S=[];for(let p=0;pPromise.resolve({}),server_data_node:bt(o)}),c={node:await W(),loader:W,universal:null,server:null,data:null};return await Q({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function Et(t,n){if(!t||tt(t,I))return;let e;try{e=$.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=Zt(e);for(const a of nt){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:ie(o),url:t}}}function Zt(t){return se(t.slice(I.length)||"/")}function Qt({url:t,type:n,intent:e,delta:r}){let a=!1;const o=ae(w,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return M||Bt.forEach(s=>s(i)),a?null:o}async function B({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Lt,block:u=Lt}){const h=Et(n,!1),g=Qt({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=k,m=A;f(),M=!0,X&&T.navigating.set(g.navigation),Z=c;let l=h&&await Xt(h);if(!l){if(tt(n,I))return await D(n);l=await te(n,{id:null},await q(new gt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,Z!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await at({status:500,error:await q(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Wt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await T.updated.check()&&await D(n);if(Ht.length=0,yt=!1,mt(d),Yt(m),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const p=o?0:1,y={[j]:k+=p,[F]:A+=p,[Ct]:i};(o?history.replaceState:history.pushState).call(history,y,"",n),o||Ve(k,A)}if(P=null,l.props.page.state=i,X){w=l.state,l.props.page&&(l.props.page.url=n);const p=(await Promise.all(Fe.map(y=>y(g.navigation)))).filter(y=>typeof y=="function");if(p.length>0){let y=function(){O=O.filter(b=>!p.includes(b))};p.push(y),O.push(...p)}wt.$set(l.props),Kt=!0}else zt(l,ut);const{activeElement:_}=document;await re();const v=e?e.scroll:a?pt():null;if(Pt){const p=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));v?scrollTo(v.x,v.y):p?p.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==_&&document.activeElement!==document.body;!r&&!S&&Je(),Pt=!0,l.props.page&&(R=l.props.page),M=!1,t==="popstate"&&Jt(A),g.fulfil(void 0),O.forEach(p=>p(g.navigation)),T.navigating.set(null)}async function te(t,n,e,r){return t.origin===H&&t.pathname===location.pathname&&!_t?await at({status:r,error:e,url:t,route:n}):await D(t)}function He(){let t;L.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}L.addEventListener("mousedown",n),L.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ct(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=Gt(o,L);if(!s)return;const{url:c,external:f,download:u}=lt(s,I);if(f||u)return;const h=Y(s);if(!h.reload)if(i<=h.preload_data){const g=Et(c,!1);g&&Ge(g)}else i<=h.preload_code&&ct(c.pathname)}function a(){e.disconnect();for(const o of L.querySelectorAll("a")){const{url:i,external:s,download:c}=lt(o,I);if(s||c)continue;const f=Y(o);f.reload||(f.preload_code===K.viewport&&e.observe(o),f.preload_code===K.eager&&ct(i.pathname))}}O.push(a),a()}function q(t,n){if(t instanceof et)return t.body;const e=J(t),r=Ce(t);return $.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function Be(t,n={}){return t=Vt(t),t.origin!==H?Promise.reject(new Error("goto: invalid URL")):Wt(t,n,0)}function Ke(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Tt(),!M){const a=ae(w,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};Bt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Tt()}),(n=navigator.connection)!=null&&n.saveData||He(),L.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Gt(e.composedPath()[0],L);if(!r)return;const{url:a,external:o,target:i,download:s}=lt(r,I);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Y(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){Qt({url:a,type:"link"})?M=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===st(location)){const[,d]=w.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=r.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(C=!0,mt(k),t(a),!c.replace_state)return;C=!1}e.preventDefault(),B({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),L.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(tt(i,I))return;const s=e.target,c=Y(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&f.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),B({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[j]){const a=e.state[j];if(Z={},a===k)return;const o=x[a],i=e.state[Ct]??{},s=new URL(e.state[Ae]??location.href),c=e.state[F],f=st(location)===st(w.url);if(c===A&&(Kt||f)){t(s),x[k]=pt(),o&&scrollTo(o.x,o.y),i!==R.state&&(R={...R,state:i},wt.$set({page:R})),k=a;return}const h=a-k;await B({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{k=a,A=c},block:()=>{history.go(-h)},nav_token:Z})}else if(!C){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[j]:++k,[F]:A},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&T.navigating.set(null)});function t(e){w.url=e,T.page.set({...R,url:e}),T.page.notify()}}async function Ye(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){_t=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Et(c,!1)||{});let f;try{const u=r.map(async(d,m)=>{const l=i[m];return l!=null&&l.uses&&(l.uses=ne(l.uses)),vt({loader:$.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let v=0;vd===o.id);if(g){const d=g.layouts;for(let m=0;mo?"1":"0").join(""));const r=await Ot(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new et(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(g){return Ne(g,{Promise:d=>new Promise((m,l)=>{i.set(d,{fulfil:m,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` `:c.decode(d,{stream:!0});;){const m=u.indexOf(` -`);if(m===-1)break;const l=JSON.parse(u.slice(0,m));if(u=u.slice(m+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=ne(_.uses),_.data=f(_.data))}),o(l);else if(l.type==="chunk"){const{id:_,data:v,error:S}=l,p=i.get(_);i.delete(_),S?p.reject(f(S)):p.fulfil(f(v))}}}})}function ne(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Ye(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{Xe as a,T as s}; +`);if(m===-1)break;const l=JSON.parse(u.slice(0,m));if(u=u.slice(m+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=ne(_.uses),_.data=f(_.data))}),o(l);else if(l.type==="chunk"){const{id:_,data:v,error:S}=l,p=i.get(_);i.delete(_),S?p.reject(f(S)):p.fulfil(f(v))}}}})}function ne(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Je(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{Xe as a,T as s}; diff --git a/_app/immutable/entry/app.YaebcgCF.js b/_app/immutable/entry/app.9x3ajYAs.js similarity index 93% rename from _app/immutable/entry/app.YaebcgCF.js rename to _app/immutable/entry/app.9x3ajYAs.js index b13ef32..dc7b80a 100644 --- a/_app/immutable/entry/app.YaebcgCF.js +++ b/_app/immutable/entry/app.9x3ajYAs.js @@ -1,7 +1,7 @@ -import{a as A,b as B,o as U,d as L,t as j}from"../chunks/scheduler.wibOmgHn.js";import{S as M,i as W,s as z,k as d,f as F,g as b,l as p,m as R,n as w,d as g,e as G,c as H,a as J,o as N,p as h,t as K,b as Q,j as X,q as P,r as k,u as v,v as C,w as E,x as y}from"../chunks/index.C2QNc328.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},D={},S=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in D)return;D[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[10](null),e&&y(e,t)}}}function I(a){let e,n=a[6]&&O(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(g),this.h()},h(){N(e,"id","svelte-announcer"),N(e,"aria-live","assertive"),N(e,"aria-atomic","true"),h(e,"position","absolute"),h(e,"left","0"),h(e,"top","0"),h(e,"clip","rect(0 0 0 0)"),h(e,"clip-path","inset(50%)"),h(e,"overflow","hidden"),h(e,"white-space","nowrap"),h(e,"width","1px"),h(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=O(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function O(a){let e;return{c(){e=K(a[7])},l(n){e=Q(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&X(e,n[7])},d(n){n&&g(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&I(a);return{c(){n.c(),i=z(),u&&u.c(),s=d()},l(o){n.l(o),i=F(o),u&&u.l(o),s=d()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(P(),p(r[m],1,1,()=>{r[m]=null}),R(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),w(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=I(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(w(n),c=!0)},o(o){p(n),c=!1},d(o){o&&(g(i),g(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;B(i.page.notify);let o=!1,_=!1,m=null;U(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),j().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){L[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function q(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,T,V,q]}class oe extends M{constructor(e){super(),W(this,e,ne,te,A,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>S(()=>import("../nodes/0.K5yHyK3c.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),()=>S(()=>import("../nodes/1.zECsTmzx.js"),__vite__mapDeps([6,1,2,7,4]),import.meta.url),()=>S(()=>import("../nodes/2.2zQWowGQ.js"),__vite__mapDeps([8,1,2,4,3,9]),import.meta.url)],le=[],fe={"/":[2]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; +import{a as A,b as B,o as U,d as L,t as j}from"../chunks/scheduler.wibOmgHn.js";import{S as M,i as W,s as z,k as d,f as F,g as b,l as p,m as R,n as w,d as g,e as G,c as H,a as J,o as N,p as h,t as K,b as Q,j as X,q as P,r as k,u as v,v as C,w as E,x as y}from"../chunks/index.C2QNc328.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},D={},S=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in D)return;D[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[10](null),e&&y(e,t)}}}function I(a){let e,n=a[6]&&O(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(g),this.h()},h(){N(e,"id","svelte-announcer"),N(e,"aria-live","assertive"),N(e,"aria-atomic","true"),h(e,"position","absolute"),h(e,"left","0"),h(e,"top","0"),h(e,"clip","rect(0 0 0 0)"),h(e,"clip-path","inset(50%)"),h(e,"overflow","hidden"),h(e,"white-space","nowrap"),h(e,"width","1px"),h(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=O(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function O(a){let e;return{c(){e=K(a[7])},l(n){e=Q(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&X(e,n[7])},d(n){n&&g(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&I(a);return{c(){n.c(),i=z(),u&&u.c(),s=d()},l(o){n.l(o),i=F(o),u&&u.l(o),s=d()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(P(),p(r[m],1,1,()=>{r[m]=null}),R(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),w(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=I(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(w(n),c=!0)},o(o){p(n),c=!1},d(o){o&&(g(i),g(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;B(i.page.notify);let o=!1,_=!1,m=null;U(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),j().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){L[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function q(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,T,V,q]}class oe extends M{constructor(e){super(),W(this,e,ne,te,A,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>S(()=>import("../nodes/0.c2O-TvxA.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),()=>S(()=>import("../nodes/1.NahAXTPY.js"),__vite__mapDeps([6,1,2,7,4]),import.meta.url),()=>S(()=>import("../nodes/2.N87lVe3Q.js"),__vite__mapDeps([8,1,2,4,3,9]),import.meta.url)],le=[],fe={"/":[2]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["../nodes/0.K5yHyK3c.js","../chunks/scheduler.wibOmgHn.js","../chunks/index.C2QNc328.js","../chunks/mode.GmPMGUR4.js","../chunks/index.NY8kyXAF.js","../assets/0.rBdhlCOg.css","../nodes/1.zECsTmzx.js","../chunks/entry.s2OJZQGG.js","../nodes/2.2zQWowGQ.js","../assets/2.hDIsB4ti.css"] + __vite__mapDeps.viteFileDeps = ["../nodes/0.c2O-TvxA.js","../chunks/scheduler.wibOmgHn.js","../chunks/index.C2QNc328.js","../chunks/mode.GmPMGUR4.js","../chunks/index.NY8kyXAF.js","../assets/0.EfYT2wAc.css","../nodes/1.NahAXTPY.js","../chunks/entry.KemuYrB9.js","../nodes/2.N87lVe3Q.js","../assets/2.hDIsB4ti.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/_app/immutable/entry/start.mAqyyH5M.js b/_app/immutable/entry/start.mAqyyH5M.js deleted file mode 100644 index 6e0a94a..0000000 --- a/_app/immutable/entry/start.mAqyyH5M.js +++ /dev/null @@ -1 +0,0 @@ -import{a as t}from"../chunks/entry.s2OJZQGG.js";export{t as start}; diff --git a/_app/immutable/entry/start.u_GJ71OB.js b/_app/immutable/entry/start.u_GJ71OB.js new file mode 100644 index 0000000..2697fa5 --- /dev/null +++ b/_app/immutable/entry/start.u_GJ71OB.js @@ -0,0 +1 @@ +import{a as t}from"../chunks/entry.KemuYrB9.js";export{t as start}; diff --git a/_app/immutable/nodes/0.K5yHyK3c.js b/_app/immutable/nodes/0.c2O-TvxA.js similarity index 100% rename from _app/immutable/nodes/0.K5yHyK3c.js rename to _app/immutable/nodes/0.c2O-TvxA.js diff --git a/_app/immutable/nodes/1.zECsTmzx.js b/_app/immutable/nodes/1.NahAXTPY.js similarity index 93% rename from _app/immutable/nodes/1.zECsTmzx.js rename to _app/immutable/nodes/1.NahAXTPY.js index 9e92b7a..6736705 100644 --- a/_app/immutable/nodes/1.zECsTmzx.js +++ b/_app/immutable/nodes/1.NahAXTPY.js @@ -1 +1 @@ -import{a as S,n as _,c as x}from"../chunks/scheduler.wibOmgHn.js";import{S as j,i as q,e as f,t as d,s as y,c as g,a as h,b as v,d as u,f as C,g as m,h as $,j as E}from"../chunks/index.C2QNc328.js";import{s as H}from"../chunks/entry.s2OJZQGG.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return x(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,S,{})}};export{F as component}; +import{a as S,n as _,c as x}from"../chunks/scheduler.wibOmgHn.js";import{S as j,i as q,e as f,t as d,s as y,c as g,a as h,b as v,d as u,f as C,g as m,h as $,j as E}from"../chunks/index.C2QNc328.js";import{s as H}from"../chunks/entry.KemuYrB9.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return x(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,S,{})}};export{F as component}; diff --git a/_app/immutable/nodes/2.2zQWowGQ.js b/_app/immutable/nodes/2.N87lVe3Q.js similarity index 99% rename from _app/immutable/nodes/2.2zQWowGQ.js rename to _app/immutable/nodes/2.N87lVe3Q.js index e97ff76..bbb050b 100644 --- a/_app/immutable/nodes/2.2zQWowGQ.js +++ b/_app/immutable/nodes/2.N87lVe3Q.js @@ -133,4 +133,4 @@ See the LICENSE file in the root directory of this source tree. `)),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),xx=ht.create({name:"doc",topNode:!0,content:"block+"});function Ex(n={}){return new Qe({view(e){return new Tx(e,n)}})}class Tx{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=l?u.bottom:u.top;l&&a&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let i,o;if(!s||s==document.body&&getComputedStyle(s).position=="static")i=-pageXOffset,o=-pageYOffset;else{let l=s.getBoundingClientRect();i=l.left-s.scrollLeft,o=l.top-s.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-o+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,t,e):s;if(t&&!i){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=dm(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Ox=ft.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Ex(this.options)]}});class Ve extends oe{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return Ve.valid(r)?new Ve(r):oe.near(r)}content(){return B.empty}eq(e){return e instanceof Ve&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ve(e.resolve(t.pos))}getBookmark(){return new Sd(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!_x(e)||!Nx(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let s=t.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&Ve.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){i=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=t;let a=e.doc.resolve(s);if(Ve.valid(a))return a}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!Y.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*t),r=!1;continue e}break}i=o,s+=t;let l=e.doc.resolve(s);if(Ve.valid(l))return l}return null}}}Ve.prototype.visible=!1;Ve.findFrom=Ve.findGapCursorFrom;oe.jsonID("gapcursor",Ve);class Sd{constructor(e){this.pos=e}map(e){return new Sd(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Ve.valid(t)?new Ve(t):oe.near(t)}}function _x(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||s.isAtom||s.type.spec.isolating)return!0;if(s.inlineContent)return!1}}return!0}function Nx(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||s.isAtom||s.type.spec.isolating)return!0;if(s.inlineContent)return!1}}return!0}function Dx(){return new Qe({props:{decorations:Px,createSelectionBetween(n,e,t){return e.pos==t.pos&&Ve.valid(t)?new Ve(t):null},handleClick:Rx,handleKeyDown:Ix,handleDOMEvents:{beforeinput:Lx}}})}const Ix=Qm({ArrowLeft:Oo("horiz",-1),ArrowRight:Oo("horiz",1),ArrowUp:Oo("vert",-1),ArrowDown:Oo("vert",1)});function Oo(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof te){if(!i.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Ve.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new Ve(c))),!0):!1}}function Rx(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!Ve.valid(r))return!1;let s=n.posAtCoords({left:t.clientX,top:t.clientY});return s&&s.inside>-1&&Y.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Ve(r))),!0)}function Lx(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Ve))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let s=E.empty;for(let o=r.length-1;o>=0;o--)s=E.from(r[o].createAndFill(null,s));let i=n.state.tr.replace(t.pos,t.pos,new B(s,0,0));return i.setSelection(te.near(i.doc.resolve(t.pos+1))),n.dispatch(i),!1}function Px(n){if(!(n.selection instanceof Ve))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Je.create(n.doc,[Ht.widget(n.selection.head,e,{key:"gapcursor"})])}const Bx=ft.create({name:"gapCursor",addProseMirrorPlugins(){return[Dx()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=ie(q(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),zx=ht.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Fe(this.options.HTMLAttributes,n)]},renderText(){return` `},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:i}=t;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Vx=ht.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Fe(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Gc({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var ql=200,st=function(){};st.prototype.append=function(e){return e.length?(e=st.from(e),!this.length&&e||e.length=t?st.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};st.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};st.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};st.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},t,r),s};st.from=function(e){return e instanceof st?e:e&&e.length?new ly(e):st.empty};var ly=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=ql)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=ql)return new e(s.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(st);st.empty=new ly([]);var Fx=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(st);const Hx=500;class on{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;t&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,u.push(d);return}if(s){u.push(new lr(d.map));let h=d.step.map(s.slice(i)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new lr(p,void 0,void 0,c.length+u.length))),i--,p&&s.appendMap(p,i)}else o.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(i)):d.selection,a=new on(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;ujx&&(l=Ux(l,c),o-=c),new on(l.append(i),o)}remapping(e,t){let r=new Ms;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,t),r}addMaps(e){return this.eventCount==0?this:new on(this.items.append(e.map(t=>new lr(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},s);let a=t;this.items.forEach(f=>{let h=i.getMirror(--a);if(h==null)return;o=Math.min(o,h);let p=i.maps[h];if(f.step){let m=e.steps[h].invert(e.docs[h]),g=f.selection&&f.selection.map(i.slice(a+1,h));g&&l++,r.push(new lr(p,m,g))}else r.push(new lr(p))},s);let c=[];for(let f=t;fHx&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=o.selection&&o.selection.map(t.slice(r));u&&i++;let d=new lr(c.invert(),a,u),f,h=s.length-1;(f=s.length&&s[h].merge(d))?s[h]=f:s.push(d)}}else o.map&&r--},this.items.length,0),new on(st.from(s.reverse()),i)}}on.empty=new on(st.empty,0);function Ux(n,e){let t;return n.forEach((r,s)=>{if(r.selection&&e--==0)return t=s,!1}),n.slice(t)}let lr=class ay{constructor(e,t,r,s){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ay(t.getMap().invert(),t,this.selection)}}};class dr{constructor(e,t,r,s,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const jx=20;function Wx(n,e,t,r){let s=t.getMeta($r),i;if(s)return s.historyState;t.getMeta(Jx)&&(n=new dr(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta($r))return o.getMeta($r).redo?new dr(n.done.addTransform(t,void 0,r,Ho(e)),n.undone,qh(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new dr(n.done,n.undone.addTransform(t,void 0,r,Ho(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!qx(t,n.prevRanges)),c=o?hc(n.prevRanges,t.mapping):qh(t.mapping.maps[t.steps.length-1]);return new dr(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Ho(e)),on.empty,c,t.time,l??n.prevComposition)}else return(i=t.getMeta("rebased"))?new dr(n.done.rebased(t,i),n.undone.rebased(t,i),hc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new dr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),hc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function qx(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let i=0;i=e[i]&&(t=!0)}),t}function qh(n){let e=[];return n.forEach((t,r,s,i)=>e.push(s,i)),e}function hc(n,e){if(!n)return null;let t=[];for(let r=0;r{let t=$r.getState(n);return!t||t.done.eventCount==0?!1:(e&&cy(t,n,e,!1),!0)},dy=(n,e)=>{let t=$r.getState(n);return!t||t.undone.eventCount==0?!1:(e&&cy(t,n,e,!0),!0)},Gx=ft.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>uy(n,e),redo:()=>({state:n,dispatch:e})=>dy(n,e)}},addProseMirrorPlugins(){return[Kx(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Yx=ht.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Fe(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:s,dispatch:i})=>{var o;if(i){const{$to:l}=s.selection,a=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(te.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(Y.create(s.doc,l.pos)):s.setSelection(te.create(s.doc,l.pos));else{const c=(o=l.parent.type.contentMatch.defaultType)===null||o===void 0?void 0:o.create();c&&(s.insert(a,c),s.setSelection(te.create(s.doc,a+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[dg({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Xx=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Qx=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Zx=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,eE=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,tE=fn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Fe(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Vs({find:Xx,type:this.type}),Vs({find:Zx,type:this.type})]},addPasteRules(){return[ns({find:Qx,type:this.type}),ns({find:eE,type:this.type})]}}),nE=ht.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Fe(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),rE=ht.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Fe(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Kh=fn.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Fe(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ya(n,this.type);return Object.entries(t).some(([,s])=>!!s)?!0:e.unsetMark(this.name)}}}}),Gh=/^(\d+)\.\s$/,sE=ht.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Fe(this.options.HTMLAttributes,t),0]:["ol",Fe(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rE.name,this.editor.getAttributes(Kh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Hi({find:Gh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Hi({find:Gh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Kh.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),iE=ht.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Fe(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),oE=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,lE=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,aE=fn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Fe(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return td()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[Vs({find:oE,type:this.type})]},addPasteRules(){return[ns({find:lE,type:this.type})]}}),cE=ht.create({name:"text",group:"inline"}),fy=ft.create({name:"starterKit",addExtensions(){var n,e,t,r,s,i,o,l,a,c,u,d,f,h,p,m,g,y;const w=[];return this.options.blockquote!==!1&&w.push(hx.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&w.push(bx.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&w.push(vx.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&w.push(Cx.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&w.push(Mx.configure((s=this.options)===null||s===void 0?void 0:s.codeBlock)),this.options.document!==!1&&w.push(xx.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&w.push(Ox.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&w.push(Bx.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&w.push(zx.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&w.push(Vx.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&w.push(Gx.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&w.push(Yx.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&w.push(tE.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&w.push(nE.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&w.push(sE.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&w.push(iE.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&w.push(aE.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&w.push(cE.configure((y=this.options)===null||y===void 0?void 0:y.text)),w}}),uE=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,hy=ht.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",Fe(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[dg({find:uE,type:this.type,getAttributes:n=>{const[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}});function dE(n){return[fy,Qg.configure({element:n}),sy.configure({openOnClick:!1,autolink:!0}),hy.configure({inline:!0}),oy.configure({types:["heading","paragraph"]}),iy]}const fE=Math.floor,hE=(n,e)=>nn>e?n:e,py=128,Uo=127,mE=Number.MAX_SAFE_INTEGER,gE=n=>{const e=unescape(encodeURIComponent(n)),t=e.length,r=new Uint8Array(t);for(let s=0;sKi.encode(n),bE=Ki?yE:gE;let Oi=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Oi&&Oi.decode(new Uint8Array).length===1&&(Oi=null);const Jl=(n,e)=>{const t=n.cbuf.length;n.cpos===t&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(t*2),n.cpos=0),n.cbuf[n.cpos++]=e},ka=(n,e)=>{for(;e>Uo;)Jl(n,py|Uo&e),e=fE(e/128);Jl(n,Uo&e)},hu=new Uint8Array(3e4),wE=hu.length/3,vE=(n,e)=>{if(e.length{const t=unescape(encodeURIComponent(e)),r=t.length;ka(n,r);for(let s=0;s{const t=n.cbuf.length,r=n.cpos,s=hE(t-r,e.length),i=e.length-s;n.cbuf.set(e.subarray(0,s),r),n.cpos+=s,i>0&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(pE(t*2,i)),n.cbuf.set(e.subarray(s)),n.cpos=i)},$E=(n,e)=>{ka(n,e.byteLength),CE(n,e)},my=n=>new Error(n),AE=my("Unexpected end of array"),ME=my("Integer out of Range"),xE=(n,e)=>{const t=new Uint8Array(n.arr.buffer,n.pos+n.arr.byteOffset,e);return n.pos+=e,t},EE=n=>xE(n,Cd(n)),Yh=n=>n.arr[n.pos++],Cd=n=>{let e=0,t=1;const r=n.arr.length;for(;n.posmE)throw ME}throw AE},TE=n=>{let e=Cd(n);if(e===0)return"";{let t=String.fromCodePoint(Yh(n));if(--e<100)for(;e--;)t+=String.fromCodePoint(Yh(n));else for(;e>0;){const r=e<1e4?e:1e4,s=n.arr.subarray(n.pos,n.pos+r);n.pos+=r,t+=String.fromCodePoint.apply(null,s),e-=r}return decodeURIComponent(escape(t))}},OE=n=>Oi.decode(EE(n)),Xh=Oi?OE:TE;var Gi;(function(n){n[n.Token=0]="Token",n[n.PermissionDenied=1]="PermissionDenied",n[n.Authenticated=2]="Authenticated"})(Gi||(Gi={}));const _E=(n,e)=>{ka(n,Gi.Token),SE(n,e)},NE=(n,e,t)=>{switch(Cd(n)){case Gi.PermissionDenied:{e(Xh(n));break}case Gi.Authenticated:{t(Xh(n));break}}},DE={code:1009,reason:"Message Too Big"},Qh={code:4401,reason:"Unauthorized"},IE={code:4403,reason:"Forbidden"},Zh=n=>Array.from(n.entries()).map(([e,t])=>({clientId:e,...t}));var pu;(function(n){n[n.Connecting=0]="Connecting",n[n.Open=1]="Open",n[n.Closing=2]="Closing",n[n.Closed=3]="Closed"})(pu||(pu={}));const cn=()=>new Map,mu=n=>{const e=cn();return n.forEach((t,r)=>{e.set(r,t)}),e},Dr=(n,e,t)=>{let r=n.get(e);return r===void 0&&n.set(e,r=t()),r},RE=(n,e)=>{const t=[];for(const[r,s]of n)t.push(e(s,r));return t},LE=(n,e)=>{for(const[t,r]of n)if(e(r,t))return!0;return!1},ss=()=>new Set,mc=n=>n[n.length-1],PE=(n,e)=>{for(let t=0;t{for(let t=0;t{this.off(e,r),t(...s)};this.on(e,r)}off(e,t){const r=this._observers.get(e);r!==void 0&&(r.delete(t),r.size===0&&this._observers.delete(e))}emit(e,t){return Mr((this._observers.get(e)||cn()).values()).forEach(r=>r(...t))}destroy(){this._observers=cn()}};const Yn=Math.floor,jo=Math.abs,Sa=(n,e)=>nn>e?n:e,yy=n=>n!==0?n<0:1/n<0,ep=1,tp=2,gc=4,yc=8,Yi=32,qn=64,Ut=128,Ca=31,yu=63,Xr=127,zE=2147483647,by=Number.MAX_SAFE_INTEGER,VE=Number.isInteger||(n=>typeof n=="number"&&isFinite(n)&&Yn(n)===n),FE=n=>n.toLowerCase(),HE=/^\s*/g,UE=n=>n.replace(HE,""),jE=/([A-Z])/g,np=(n,e)=>UE(n.replace(jE,t=>`${e}${FE(t)}`)),WE=n=>{const e=unescape(encodeURIComponent(n)),t=e.length,r=new Uint8Array(t);for(let s=0;sXi.encode(n),JE=Xi?qE:WE;let _i=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});_i&&_i.decode(new Uint8Array).length===1&&(_i=null);let po=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}};const $a=()=>new po,KE=n=>{let e=n.cpos;for(let t=0;t{const e=new Uint8Array(KE(n));let t=0;for(let r=0;r{const t=n.cbuf.length;t-n.cpos{const t=n.cbuf.length;n.cpos===t&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(t*2),n.cpos=0),n.cbuf[n.cpos++]=e},bu=tt,he=(n,e)=>{for(;e>Xr;)tt(n,Ut|Xr&e),e=Yn(e/128);tt(n,Xr&e)},$d=(n,e)=>{const t=yy(e);for(t&&(e=-e),tt(n,(e>yu?Ut:0)|(t?qn:0)|yu&e),e=Yn(e/64);e>0;)tt(n,(e>Xr?Ut:0)|Xr&e),e=Yn(e/128)},wu=new Uint8Array(3e4),YE=wu.length/3,XE=(n,e)=>{if(e.length{const t=unescape(encodeURIComponent(e)),r=t.length;he(n,r);for(let s=0;s{const t=n.cbuf.length,r=n.cpos,s=Sa(t-r,e.length),i=e.length-s;n.cbuf.set(e.subarray(0,s),r),n.cpos+=s,i>0&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(ds(t*2,i)),n.cbuf.set(e.subarray(s)),n.cpos=i)},zt=(n,e)=>{he(n,e.byteLength),Aa(n,e)},Ad=(n,e)=>{GE(n,e);const t=new DataView(n.cbuf.buffer,n.cpos,e);return n.cpos+=e,t},ZE=(n,e)=>Ad(n,4).setFloat32(0,e,!1),eT=(n,e)=>Ad(n,8).setFloat64(0,e,!1),tT=(n,e)=>Ad(n,8).setBigInt64(0,e,!1),rp=new DataView(new ArrayBuffer(4)),nT=n=>(rp.setFloat32(0,n),rp.getFloat32(0)===n),Qi=(n,e)=>{switch(typeof e){case"string":tt(n,119),Os(n,e);break;case"number":VE(e)&&jo(e)<=zE?(tt(n,125),$d(n,e)):nT(e)?(tt(n,124),ZE(n,e)):(tt(n,123),eT(n,e));break;case"bigint":tt(n,122),tT(n,e);break;case"object":if(e===null)tt(n,126);else if(gu(e)){tt(n,117),he(n,e.length);for(let t=0;t0&&he(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const ip=n=>{n.count>0&&($d(n.encoder,n.count===1?n.s:-n.s),n.count>1&&he(n.encoder,n.count-2))};class Wo{constructor(){this.encoder=new po,this.s=0,this.count=0}write(e){this.s===e?this.count++:(ip(this),this.count=1,this.s=e)}toUint8Array(){return ip(this),En(this.encoder)}}const op=n=>{if(n.count>0){const e=n.diff*2+(n.count===1?0:1);$d(n.encoder,e),n.count>1&&he(n.encoder,n.count-2)}};class bc{constructor(){this.encoder=new po,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(op(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return op(this),En(this.encoder)}}class rT{constructor(){this.sarr=[],this.s="",this.lensE=new Wo}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new po;return this.sarr.push(this.s),this.s="",Os(e,this.sarr.join("")),Aa(e,this.lensE.toUint8Array()),En(e)}}const xr=n=>new Error(n),un=()=>{throw xr("Method unimplemented")},tn=()=>{throw xr("Unexpected case")},wy=xr("Unexpected end of array"),vy=xr("Integer out of Range");let Ma=class{constructor(e){this.arr=e,this.pos=0}};const ei=n=>new Ma(n),sT=n=>n.pos!==n.arr.length,iT=(n,e)=>{const t=new Uint8Array(n.arr.buffer,n.pos+n.arr.byteOffset,e);return n.pos+=e,t},Vt=n=>iT(n,ae(n)),qs=n=>n.arr[n.pos++],ae=n=>{let e=0,t=1;const r=n.arr.length;for(;n.posby)throw vy}throw wy},Md=n=>{let e=n.arr[n.pos++],t=e&yu,r=64;const s=(e&qn)>0?-1:1;if(!(e&Ut))return s*t;const i=n.arr.length;for(;n.posby)throw vy}throw wy},oT=n=>{let e=ae(n);if(e===0)return"";{let t=String.fromCodePoint(qs(n));if(--e<100)for(;e--;)t+=String.fromCodePoint(qs(n));else for(;e>0;){const r=e<1e4?e:1e4,s=n.arr.subarray(n.pos,n.pos+r);n.pos+=r,t+=String.fromCodePoint.apply(null,s),e-=r}return decodeURIComponent(escape(t))}},lT=n=>_i.decode(Vt(n)),_s=_i?lT:oT,xd=(n,e)=>{const t=new DataView(n.arr.buffer,n.arr.byteOffset+n.pos,e);return n.pos+=e,t},aT=n=>xd(n,4).getFloat32(0,!1),cT=n=>xd(n,8).getFloat64(0,!1),uT=n=>xd(n,8).getBigInt64(0,!1),dT=[n=>{},n=>null,Md,aT,cT,uT,n=>!1,n=>!0,_s,n=>{const e=ae(n),t={};for(let r=0;r{const e=ae(n),t=[];for(let r=0;rdT[127-qs(n)](n);class lp extends Ma{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),sT(this)?this.count=ae(this)+1:this.count=-1),this.count--,this.s}}class qo extends Ma{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=Md(this);const e=yy(this.s);this.count=1,e&&(this.s=-this.s,this.count=ae(this)+2)}return this.count--,this.s}}class wc extends Ma{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){const e=Md(this),t=e&1;this.diff=Yn(e/2),this.count=1,t&&(this.count=ae(this)+2)}return this.s+=this.diff,this.count--,this.s}}class fT{constructor(e){this.decoder=new qo(e),this.str=_s(this.decoder),this.spos=0}read(){const e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}const hT=crypto.getRandomValues.bind(crypto),pT=Math.random,ky=()=>hT(new Uint32Array(1))[0],mT=n=>n[Yn(pT()*n.length)],gT="10000000-1000-4000-8000"+-1e11,yT=()=>gT.replace(/[018]/g,n=>(n^ky()&15>>n/4).toString(16)),bT=Date.now,ap=n=>new Promise(n);Promise.all.bind(Promise);const cp=n=>n===void 0?null:n;let wT=class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},Sy=new wT,vT=!0;try{typeof localStorage<"u"&&localStorage&&(Sy=localStorage,vT=!1)}catch{}const kT=Sy,ST=Object.assign,Cy=Object.keys,CT=(n,e)=>{for(const t in n)e(n[t],t)},up=n=>Cy(n).length,$T=n=>{for(const e in n)return!1;return!0},AT=(n,e)=>{for(const t in n)if(!e(n[t],t))return!1;return!0},MT=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),xT=(n,e)=>n===e||up(n)===up(e)&&AT(n,(t,r)=>(t!==void 0||MT(e,r))&&e[r]===t),Ed=(n,e,t=0)=>{try{for(;tn,TT=(n,e)=>e.includes(n);var $y={};const Js=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",OT=typeof window<"u"&&typeof document<"u"&&!Js;let wn;const _T=()=>{if(wn===void 0)if(Js){wn=cn();const n=process.argv;let e=null;for(let t=0;t{if(n.length!==0){const[e,t]=n.split("=");wn.set(`--${np(e,"-")}`,t),wn.set(`-${np(e,"-")}`,t)}})):wn=cn();return wn},vu=n=>_T().has(n),ku=n=>cp(Js?$y[n.toUpperCase()]:kT.getItem(n)),NT=n=>vu("--"+n)||ku(n)!==null;NT("production");const dp=Js&&TT($y.FORCE_COLOR,["true","1","2"]),DT=!vu("no-colors")&&(!Js||process.stdout.isTTY||dp)&&(!Js||vu("color")||dp||ku("COLORTERM")!==null||(ku("TERM")||"").includes("color")),IT=n=>new Uint8Array(n),RT=n=>{const e=IT(n.byteLength);return e.set(n),e};class LT{constructor(e,t){this.left=e,this.right=t}}const Fn=(n,e)=>new LT(n,e),PT=typeof document<"u"?document:{};typeof DOMParser<"u"&&new DOMParser;const BT=n=>RE(n,(e,t)=>`${t}:${e};`).join(""),zT=n=>class{constructor(t){this._=t}destroy(){n(this._)}},VT=zT(clearTimeout),Su=(n,e)=>new VT(setTimeout(e,n)),Xn=Symbol,Ay=Xn(),My=Xn(),FT=Xn(),HT=Xn(),UT=Xn(),xy=Xn(),jT=Xn(),Td=Xn(),WT=Xn(),qT=n=>{const e=[];let t=0;for(;t{const e=[],t=[],r=cn();let s=[],i=0;for(;i0||a.length>0?(e.push("%c"+o),t.push(a)):e.push(o)}else break}for(i>0&&(s=t,s.unshift(e.join("")));i{console.log(...Ey(n)),Ty.forEach(e=>e.print(n))},YT=(...n)=>{console.warn(...Ey(n)),n.unshift(Td),Ty.forEach(e=>e.print(n))},Ty=ss(),Oy=n=>({[Symbol.iterator](){return this},next:n}),XT=(n,e)=>Oy(()=>{let t;do t=n.next();while(!t.done&&!e(t.value));return t}),vc=(n,e)=>Oy(()=>{const{done:t,value:r}=n.next();return{done:t,value:t?void 0:e(r)}});class Od{constructor(e,t){this.clock=e,this.len=t}}class ti{constructor(){this.clients=new Map}}const Er=(n,e,t)=>e.clients.forEach((r,s)=>{const i=n.doc.store.clients.get(s);for(let o=0;o{let t=0,r=n.length-1;for(;t<=r;){const s=Yn((t+r)/2),i=n[s],o=i.clock;if(o<=e){if(e{const t=n.clients.get(e.client);return t!==void 0&&QT(t,e.clock)!==null},_d=n=>{n.clients.forEach(e=>{e.sort((s,i)=>s.clock-i.clock);let t,r;for(t=1,r=1;t=i.clock?s.len=ds(s.len,i.clock+i.len-s.clock):(r{const e=new ti;for(let t=0;t{if(!e.clients.has(s)){const i=r.slice();for(let o=t+1;o{Dr(n.clients,e,()=>[]).push(new Od(t,r))},_y=()=>new ti,Ny=n=>{const e=_y();return n.clients.forEach((t,r)=>{const s=[];for(let i=0;i0&&e.clients.set(r,s)}),e},ri=(n,e)=>{he(n.restEncoder,e.clients.size),Mr(e.clients.entries()).sort((t,r)=>r[0]-t[0]).forEach(([t,r])=>{n.resetDsCurVal(),he(n.restEncoder,t);const s=r.length;he(n.restEncoder,s);for(let i=0;i{const e=new ti,t=ae(n.restDecoder);for(let r=0;r0){const o=Dr(e.clients,s,()=>[]);for(let l=0;l{const r=new ti,s=ae(n.restDecoder);for(let i=0;i0){const i=new is;return he(i.restEncoder,0),ri(i,r),i.toUint8Array()}return null},Dy=ky;class si extends gy{constructor({guid:e=yT(),collectionid:t=null,gc:r=!0,gcFilter:s=()=>!0,meta:i=null,autoLoad:o=!1,shouldLoad:l=!0}={}){super(),this.gc=r,this.gcFilter=s,this.clientID=Dy(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new Uy,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=l,this.autoLoad=o,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=ap(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const a=()=>ap(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=a()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[])}),this.whenSynced=a()}load(){const e=this._item;e!==null&&!this.shouldLoad&&De(e.parent.doc,t=>{t.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Mr(this.subdocs).map(e=>e.guid))}transact(e,t=null){return De(this,e,t)}get(e,t=dt){const r=Dr(this.share,e,()=>{const i=new t;return i._integrate(this,null),i}),s=r.constructor;if(t!==dt&&s!==t)if(s===dt){const i=new t;i._map=r._map,r._map.forEach(o=>{for(;o!==null;o=o.left)o.parent=i}),i._start=r._start;for(let o=i._start;o!==null;o=o.right)o.parent=i;return i._length=r._length,this.share.set(e,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,Ds)}getText(e=""){return this.get(e,ls)}getMap(e=""){return this.get(e,Gs)}getXmlFragment(e=""){return this.get(e,as)}toJSON(){const e={};return this.share.forEach((t,r)=>{e[r]=t.toJSON()}),e}destroy(){Mr(this.subdocs).forEach(t=>t.destroy());const e=this._item;if(e!==null){this._item=null;const t=e.content;t.doc=new si({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,De(e.parent.doc,r=>{const s=t.doc;e.deleted||r.subdocsAdded.add(s),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}on(e,t){super.on(e,t)}off(e,t){super.off(e,t)}}class Iy{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return ae(this.restDecoder)}readDsLen(){return ae(this.restDecoder)}}class Ry extends Iy{readLeftID(){return re(ae(this.restDecoder),ae(this.restDecoder))}readRightID(){return re(ae(this.restDecoder),ae(this.restDecoder))}readClient(){return ae(this.restDecoder)}readInfo(){return qs(this.restDecoder)}readString(){return _s(this.restDecoder)}readParentInfo(){return ae(this.restDecoder)===1}readTypeRef(){return ae(this.restDecoder)}readLen(){return ae(this.restDecoder)}readAny(){return Zi(this.restDecoder)}readBuf(){return RT(Vt(this.restDecoder))}readJSON(){return JSON.parse(_s(this.restDecoder))}readKey(){return _s(this.restDecoder)}}class ZT{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=ae(this.restDecoder),this.dsCurrVal}readDsLen(){const e=ae(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Ks extends ZT{constructor(e){super(e),this.keys=[],ae(e),this.keyClockDecoder=new wc(Vt(e)),this.clientDecoder=new qo(Vt(e)),this.leftClockDecoder=new wc(Vt(e)),this.rightClockDecoder=new wc(Vt(e)),this.infoDecoder=new lp(Vt(e),qs),this.stringDecoder=new fT(Vt(e)),this.parentInfoDecoder=new lp(Vt(e),qs),this.typeRefDecoder=new qo(Vt(e)),this.lenDecoder=new qo(Vt(e))}readLeftID(){return new Ns(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new Ns(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Zi(this.restDecoder)}readBuf(){return Vt(this.restDecoder)}readJSON(){return Zi(this.restDecoder)}readKey(){const e=this.keyClockDecoder.read();if(e{r=ds(r,e[0].id.clock);const s=In(e,r);he(n.restEncoder,e.length-s),n.writeClient(t),he(n.restEncoder,r);const i=e[s];i.write(n,r-i.id.clock);for(let o=s+1;o{const r=new Map;t.forEach((s,i)=>{Ue(e,i)>s&&r.set(i,s)}),go(e).forEach((s,i)=>{t.has(i)||r.set(i,0)}),he(n.restEncoder,r.size),Mr(r.entries()).sort((s,i)=>i[0]-s[0]).forEach(([s,i])=>{eO(n,e.clients.get(s),s,i)})},tO=(n,e)=>{const t=cn(),r=ae(n.restDecoder);for(let s=0;s{const r=[];let s=Mr(t.keys()).sort((h,p)=>h-p);if(s.length===0)return null;const i=()=>{if(s.length===0)return null;let h=t.get(s[s.length-1]);for(;h.refs.length===h.i;)if(s.pop(),s.length>0)h=t.get(s[s.length-1]);else return null;return h};let o=i();if(o===null)return null;const l=new Uy,a=new Map,c=(h,p)=>{const m=a.get(h);(m==null||m>p)&&a.set(h,p)};let u=o.refs[o.i++];const d=new Map,f=()=>{for(const h of r){const p=h.id.client,m=t.get(p);m?(m.i--,l.clients.set(p,m.refs.slice(m.i)),t.delete(p),m.i=0,m.refs=[]):l.clients.set(p,[h]),s=s.filter(g=>g!==p)}r.length=0};for(;;){if(u.constructor!==Yt){const p=Dr(d,u.id.client,()=>Ue(e,u.id.client))-u.id.clock;if(p<0)r.push(u),c(u.id.client,u.id.clock-1),f();else{const m=u.getMissing(n,e);if(m!==null){r.push(u);const g=t.get(m)||{refs:[],i:0};if(g.refs.length===g.i)c(m,Ue(e,m)),f();else{u=g.refs[g.i++];continue}}else(p===0||p0)u=r.pop();else if(o!==null&&o.i0){const h=new is;return Dd(h,l,new Map),he(h.restEncoder,0),{missing:a,update:h.toUint8Array()}}return null},rO=(n,e)=>Dd(n,e.doc.store,e.beforeState),sO=(n,e,t,r=new Ks(n))=>De(e,s=>{s.local=!1;let i=!1;const o=s.doc,l=o.store,a=tO(r,o),c=nO(s,l,a),u=l.pendingStructs;if(u){for(const[f,h]of u.missing)if(hh)&&u.missing.set(f,h)}u.update=Gl([u.update,c.update])}}else l.pendingStructs=c;const d=fp(r,s,l);if(l.pendingDs){const f=new Ks(ei(l.pendingDs));ae(f.restDecoder);const h=fp(f,s,l);d&&h?l.pendingDs=Gl([d,h]):l.pendingDs=d||h}else l.pendingDs=d;if(i){const f=l.pendingStructs.update;l.pendingStructs=null,By(s.doc,f)}},t,!1),By=(n,e,t,r=Ks)=>{const s=ei(e);sO(s,n,t,new r(s))},iO=(n,e,t)=>By(n,e,t,Ry),oO=(n,e,t=new Map)=>{Dd(n,e.store,t),ri(n,Ny(e.store))},lO=(n,e=new Uint8Array([0]),t=new is)=>{const r=zy(e);oO(t,n,r);const s=[t.toUint8Array()];if(n.store.pendingDs&&s.push(n.store.pendingDs),n.store.pendingStructs&&s.push(xO(n.store.pendingStructs.update,e)),s.length>1){if(t.constructor===mo)return AO(s.map((i,o)=>o===0?i:TO(i)));if(t.constructor===is)return Gl(s)}return s[0]},aO=(n,e)=>lO(n,e,new mo),cO=n=>{const e=new Map,t=ae(n.restDecoder);for(let r=0;rcO(new Iy(ei(n))),Vy=(n,e)=>(he(n.restEncoder,e.size),Mr(e.entries()).sort((t,r)=>r[0]-t[0]).forEach(([t,r])=>{he(n.restEncoder,t),he(n.restEncoder,r)}),n),uO=(n,e)=>Vy(n,go(e.store)),dO=(n,e=new Py)=>(n instanceof Map?Vy(e,n):uO(e,n),e.toUint8Array()),fO=n=>dO(n,new Ly);class hO{constructor(){this.l=[]}}const hp=()=>new hO,pp=(n,e)=>n.l.push(e),mp=(n,e)=>{const t=n.l,r=t.length;n.l=t.filter(s=>e!==s),r===n.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},Fy=(n,e,t)=>Ed(n.l,[e,t]);class Ns{constructor(e,t){this.client=e,this.clock=t}}const _o=(n,e)=>n===e||n!==null&&e!==null&&n.client===e.client&&n.clock===e.clock,re=(n,e)=>new Ns(n,e),to=n=>{for(const[e,t]of n.doc.share.entries())if(t===n)return e;throw tn()},no=(n,e)=>{for(;e!==null;){if(e.parent===n)return!0;e=e.parent._item}return!1};class Kl{constructor(e,t,r,s=0){this.type=e,this.tname=t,this.item=r,this.assoc=s}}class pO{constructor(e,t,r=0){this.type=e,this.index=t,this.assoc=r}}const mO=(n,e,t=0)=>new pO(n,e,t),No=(n,e,t)=>{let r=null,s=null;return n._item===null?s=to(n):r=re(n._item.id.client,n._item.id.clock),new Kl(r,s,e,t)},kc=(n,e,t=0)=>{let r=n._start;if(t<0){if(e===0)return No(n,null,t);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return No(n,re(r.id.client,r.id.clock+e),t);e-=r.length}if(r.right===null&&t<0)return No(n,r.lastId,t);r=r.right}return No(n,null,t)},gO=(n,e)=>{const t=e.store,r=n.item,s=n.type,i=n.tname,o=n.assoc;let l=null,a=0;if(r!==null){if(Ue(t,r.client)<=r.clock)return null;const c=xu(t,r),u=c.item;if(!(u instanceof Te))return null;if(l=u.parent,l._item===null||!l._item.deleted){a=u.deleted||!u.countable?0:c.diff+(o>=0?0:1);let d=u.left;for(;d!==null;)!d.deleted&&d.countable&&(a+=d.length),d=d.left}}else{if(i!==null)l=e.get(i);else if(s!==null){if(Ue(t,s.client)<=s.clock)return null;const{item:c}=xu(t,s);if(c instanceof Te&&c.content instanceof mn)l=c.content.type;else return null}else throw tn();o>=0?a=l._length:a=0}return mO(l,a,n.assoc)};class Id{constructor(e,t){this.ds=e,this.sv=t}}const Hy=(n,e)=>new Id(n,e),yO=n=>Hy(Ny(n.store),go(n.store)),zr=(n,e)=>e===void 0?!n.deleted:e.sv.has(n.id.client)&&(e.sv.get(n.id.client)||0)>n.id.clock&&!ni(e.ds,n.id),$u=(n,e)=>{const t=Dr(n.meta,$u,ss),r=n.doc.store;t.has(e)||(e.sv.forEach((s,i)=>{s{}),t.add(e))};class Uy{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const go=n=>{const e=new Map;return n.clients.forEach((t,r)=>{const s=t[t.length-1];e.set(r,s.id.clock+s.length)}),e},Ue=(n,e)=>{const t=n.clients.get(e);if(t===void 0)return 0;const r=t[t.length-1];return r.id.clock+r.length},jy=(n,e)=>{let t=n.clients.get(e.id.client);if(t===void 0)t=[],n.clients.set(e.id.client,t);else{const r=t[t.length-1];if(r.id.clock+r.length!==e.id.clock)throw tn()}t.push(e)},In=(n,e)=>{let t=0,r=n.length-1,s=n[r],i=s.id.clock;if(i===e)return r;let o=Yn(e/(i+s.length-1)*r);for(;t<=r;){if(s=n[o],i=s.id.clock,i<=e){if(e{const t=n.clients.get(e.client);return t[In(t,e.clock)]},Jo=bO,Au=(n,e,t)=>{const r=In(e,t),s=e[r];return s.id.clock{const t=n.doc.store.clients.get(e.client);return t[Au(n,t,e.clock)]},gp=(n,e,t)=>{const r=e.clients.get(t.client),s=In(r,t.clock),i=r[s];return t.clock!==i.id.clock+i.length-1&&i.constructor!==Gt&&r.splice(s+1,0,ea(n,i,t.clock-i.id.clock+1)),i},wO=(n,e,t)=>{const r=n.clients.get(e.id.client);r[In(r,e.id.clock)]=t},Wy=(n,e,t,r,s)=>{if(r===0)return;const i=t+r;let o=Au(n,e,t),l;do l=e[o++],ie.deleteSet.clients.size===0&&!LE(e.afterState,(t,r)=>e.beforeState.get(r)!==t)?!1:(_d(e.deleteSet),rO(n,e),ri(n,e.deleteSet),!0),bp=(n,e,t)=>{const r=e._item;(r===null||r.id.clock<(n.beforeState.get(r.id.client)||0)&&!r.deleted)&&Dr(n.changed,e,ss).add(t)},Ko=(n,e)=>{let t=n[e],r=n[e-1],s=e;for(;s>0;t=r,r=n[--s-1]){if(r.deleted===t.deleted&&r.constructor===t.constructor&&r.mergeWith(t)){t instanceof Te&&t.parentSub!==null&&t.parent._map.get(t.parentSub)===t&&t.parent._map.set(t.parentSub,r);continue}break}const i=e-s;return i&&n.splice(e+1-i,i),i},kO=(n,e,t)=>{for(const[r,s]of n.clients.entries()){const i=e.clients.get(r);for(let o=s.length-1;o>=0;o--){const l=s[o],a=l.clock+l.len;for(let c=In(i,l.clock),u=i[c];c{n.clients.forEach((t,r)=>{const s=e.clients.get(r);for(let i=t.length-1;i>=0;i--){const o=t[i],l=Sa(s.length-1,1+In(s,o.clock+o.len-1));for(let a=l,c=s[a];a>0&&c.id.clock>=o.clock;c=s[a])a-=1+Ko(s,a)}})},qy=(n,e)=>{if(el.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(t,a)})),l.push(()=>{t.changedParentTypes.forEach((a,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(a=a.filter(u=>u.target._item===null||!u.target._item.deleted),a.forEach(u=>{u.currentTarget=c,u._path=null}),a.sort((u,d)=>u.path.length-d.path.length),Fy(c._dEH,a,t))})}),l.push(()=>r.emit("afterTransaction",[t,r])),Ed(l,[]),t._needFormattingCleanup&&UO(t)}finally{r.gc&&kO(i,s,r.gcFilter),SO(i,s),t.afterState.forEach((u,d)=>{const f=t.beforeState.get(d)||0;if(f!==u){const h=s.clients.get(d),p=ds(In(h,f),1);for(let m=h.length-1;m>=p;)m-=1+Ko(h,m)}});for(let u=o.length-1;u>=0;u--){const{client:d,clock:f}=o[u].id,h=s.clients.get(d),p=In(h,f);p+11||p>0&&Ko(h,p)}if(!t.local&&t.afterState.get(r.clientID)!==t.beforeState.get(r.clientID)&&(GT(Td,Ay,"[yjs] ",My,xy,"Changed the client-id because another client seems to be using it."),r.clientID=Dy()),r.emit("afterTransactionCleanup",[t,r]),r._observers.has("update")){const u=new mo;yp(u,t)&&r.emit("update",[u.toUint8Array(),t.origin,r,t])}if(r._observers.has("updateV2")){const u=new is;yp(u,t)&&r.emit("updateV2",[u.toUint8Array(),t.origin,r,t])}const{subdocsAdded:l,subdocsLoaded:a,subdocsRemoved:c}=t;(l.size>0||c.size>0||a.size>0)&&(l.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:a,added:l,removed:c},r,t]),c.forEach(u=>u.destroy())),n.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,n])):qy(n,e+1)}}},De=(n,e,t=null,r=!0)=>{const s=n._transactionCleanups;let i=!1,o=null;n._transaction===null&&(i=!0,n._transaction=new vO(n,t,r),s.push(n._transaction),s.length===1&&n.emit("beforeAllTransactions",[n]),n.emit("beforeTransaction",[n._transaction,n]));try{o=e(n._transaction)}finally{if(i){const l=n._transaction===s[0];n._transaction=null,l&&qy(s,0)}}return o};class CO{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}}const wp=(n,e,t)=>{Er(n,t.deletions,r=>{r instanceof Te&&e.scope.some(s=>no(s,r))&&Hd(r,!1)})},vp=(n,e,t)=>{let r=null,s=null;const i=n.doc,o=n.scope;if(De(i,l=>{for(;e.length>0&&r===null;){const a=i.store,c=e.pop(),u=new Set,d=[];let f=!1;Er(l,c.insertions,h=>{if(h instanceof Te){if(h.redone!==null){let{item:p,diff:m}=xu(a,h.id);m>0&&(p=Nt(l,re(p.id.client,p.id.clock+m))),h=p}!h.deleted&&o.some(p=>no(p,h))&&d.push(h)}}),Er(l,c.deletions,h=>{h instanceof Te&&o.some(p=>no(p,h))&&!ni(c.insertions,h.id)&&u.add(h)}),u.forEach(h=>{f=fb(l,h,u,c.insertions,n.ignoreRemoteMapChanges,n)!==null||f});for(let h=d.length-1;h>=0;h--){const p=d[h];n.deleteFilter(p)&&(p.delete(l),f=!0)}r=f?c:null}l.changed.forEach((a,c)=>{a.has(null)&&c._searchMarker&&(c._searchMarker.length=0)}),s=l},n),r!=null){const l=s.changedParentTypes;n.emit("stack-item-popped",[{stackItem:r,type:t,changedParentTypes:l},n])}return r};class Jy extends gy{constructor(e,{captureTimeout:t=500,captureTransaction:r=a=>!0,deleteFilter:s=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:o=!1,doc:l=gu(e)?e[0].doc:e.doc}={}){super(),this.scope=[],this.doc=l,this.addToScope(e),this.deleteFilter=s,i.add(this),this.trackedOrigins=i,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.lastChange=0,this.ignoreRemoteMapChanges=o,this.captureTimeout=t,this.afterTransactionHandler=a=>{if(!this.captureTransaction(a)||!this.scope.some(g=>a.changedParentTypes.has(g))||!this.trackedOrigins.has(a.origin)&&(!a.origin||!this.trackedOrigins.has(a.origin.constructor)))return;const c=this.undoing,u=this.redoing,d=c?this.redoStack:this.undoStack;c?this.stopCapturing():u||this.clear(!1,!0);const f=new ti;a.afterState.forEach((g,y)=>{const w=a.beforeState.get(y)||0,x=g-w;x>0&&eo(f,y,w,x)});const h=bT();let p=!1;if(this.lastChange>0&&h-this.lastChange0&&!c&&!u){const g=d[d.length-1];g.deletions=Cu([g.deletions,a.deleteSet]),g.insertions=Cu([g.insertions,f])}else d.push(new CO(a.deleteSet,f)),p=!0;!c&&!u&&(this.lastChange=h),Er(a,a.deleteSet,g=>{g instanceof Te&&this.scope.some(y=>no(y,g))&&Hd(g,!0)});const m=[{stackItem:d[d.length-1],origin:a.origin,type:c?"redo":"undo",changedParentTypes:a.changedParentTypes},this];p?this.emit("stack-item-added",m):this.emit("stack-item-updated",m)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){e=gu(e)?e:[e],e.forEach(t=>{this.scope.every(r=>r!==t)&&(t.doc!==this.doc&&YT("[yjs#509] Not same Y.Doc"),this.scope.push(t))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(r=>{e&&(this.undoStack.forEach(s=>wp(r,this,s)),this.undoStack=[]),t&&(this.redoStack.forEach(s=>wp(r,this,s)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=vp(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=vp(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}function*$O(n){const e=ae(n.restDecoder);for(let t=0;tGl(n,Ry,mo),MO=(n,e)=>{if(n.constructor===Gt){const{client:t,clock:r}=n.id;return new Gt(re(t,r+e),n.length-e)}else if(n.constructor===Yt){const{client:t,clock:r}=n.id;return new Yt(re(t,r+e),n.length-e)}else{const t=n,{client:r,clock:s}=t.id;return new Te(re(r,s+e),null,re(r,s+e-1),null,t.rightOrigin,t.parent,t.parentSub,t.content.splice(e))}},Gl=(n,e=Ks,t=is)=>{if(n.length===1)return n[0];const r=n.map(u=>new e(ei(u)));let s=r.map(u=>new Rd(u,!0)),i=null;const o=new t,l=new Ld(o);for(;s=s.filter(f=>f.curr!==null),s.sort((f,h)=>{if(f.curr.id.client===h.curr.id.client){const p=f.curr.id.clock-h.curr.id.clock;return p===0?f.curr.constructor===h.curr.constructor?0:f.curr.constructor===Yt?1:-1:p}else return h.curr.id.client-f.curr.id.client}),s.length!==0;){const u=s[0],d=u.curr.id.client;if(i!==null){let f=u.curr,h=!1;for(;f!==null&&f.id.clock+f.length<=i.struct.id.clock+i.struct.length&&f.id.client>=i.struct.id.client;)f=u.next(),h=!0;if(f===null||f.id.client!==d||h&&f.id.clock>i.struct.id.clock+i.struct.length)continue;if(d!==i.struct.id.client)pr(l,i.struct,i.offset),i={struct:f,offset:0},u.next();else if(i.struct.id.clock+i.struct.length0&&(i.struct.constructor===Yt?i.struct.length-=p:f=MO(f,p)),i.struct.mergeWith(f)||(pr(l,i.struct,i.offset),i={struct:f,offset:0},u.next())}}else i={struct:u.curr,offset:0},u.next();for(let f=u.curr;f!==null&&f.id.client===d&&f.id.clock===i.struct.id.clock+i.struct.length&&f.constructor!==Yt;f=u.next())pr(l,i.struct,i.offset),i={struct:f,offset:0}}i!==null&&(pr(l,i.struct,i.offset),i=null),Pd(l);const a=r.map(u=>Nd(u)),c=Cu(a);return ri(o,c),o.toUint8Array()},xO=(n,e,t=Ks,r=is)=>{const s=zy(e),i=new r,o=new Ld(i),l=new t(ei(n)),a=new Rd(l,!1);for(;a.curr;){const u=a.curr,d=u.id.client,f=s.get(d)||0;if(a.curr.constructor===Yt){a.next();continue}if(u.id.clock+u.length>f)for(pr(o,u,ds(f-u.id.clock,0)),a.next();a.curr&&a.curr.id.client===d;)pr(o,a.curr,0),a.next();else for(;a.curr&&a.curr.id.client===d&&a.curr.id.clock+a.curr.length<=f;)a.next()}Pd(o);const c=Nd(l);return ri(i,c),i.toUint8Array()},Ky=n=>{n.written>0&&(n.clientStructs.push({written:n.written,restEncoder:En(n.encoder.restEncoder)}),n.encoder.restEncoder=$a(),n.written=0)},pr=(n,e,t)=>{n.written>0&&n.currClient!==e.id.client&&Ky(n),n.written===0&&(n.currClient=e.id.client,n.encoder.writeClient(e.id.client),he(n.encoder.restEncoder,e.id.clock+t)),e.write(n.encoder,t),n.written++},Pd=n=>{Ky(n);const e=n.encoder.restEncoder;he(e,n.clientStructs.length);for(let t=0;t{const s=new t(ei(n)),i=new Rd(s,!1),o=new r,l=new Ld(o);for(let c=i.curr;c!==null;c=i.next())pr(l,e(c),0);Pd(l);const a=Nd(s);return ri(o,a),o.toUint8Array()},TO=n=>EO(n,ET,Ks,mo),kp="You must not compute changes after the event-handler fired.";class xa{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=OO(this.currentTarget,this.target))}deletes(e){return ni(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw xr(kp);const e=new Map,t=this.target;this.transaction.changed.get(t).forEach(s=>{if(s!==null){const i=t._map.get(s);let o,l;if(this.adds(i)){let a=i.left;for(;a!==null&&this.adds(a);)a=a.left;if(this.deletes(i))if(a!==null&&this.deletes(a))o="delete",l=mc(a.content.getContent());else return;else a!==null&&this.deletes(a)?(o="update",l=mc(a.content.getContent())):(o="add",l=void 0)}else if(this.deletes(i))o="delete",l=mc(i.content.getContent());else return;e.set(s,{action:o,oldValue:l})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw xr(kp);const t=this.target,r=ss(),s=ss(),i=[];if(e={added:r,deleted:s,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let l=null;const a=()=>{l&&i.push(l)};for(let c=t._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((l===null||l.delete===void 0)&&(a(),l={delete:0}),l.delete+=c.length,s.add(c)):this.adds(c)?((l===null||l.insert===void 0)&&(a(),l={insert:[]}),l.insert=l.insert.concat(c.content.getContent()),r.add(c)):((l===null||l.retain===void 0)&&(a(),l={retain:0}),l.retain+=c.length);l!==null&&l.retain===void 0&&a()}this._changes=e}return e}}const OO=(n,e)=>{const t=[];for(;e._item!==null&&e!==n;){if(e._item.parentSub!==null)t.unshift(e._item.parentSub);else{let r=0,s=e._item.parent._start;for(;s!==e._item&&s!==null;)s.deleted||r++,s=s.right;t.unshift(r)}e=e._item.parent}return t},Gy=80;let Bd=0;class _O{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=Bd++}}const NO=n=>{n.timestamp=Bd++},Yy=(n,e,t)=>{n.p.marker=!1,n.p=e,e.marker=!0,n.index=t,n.timestamp=Bd++},DO=(n,e,t)=>{if(n.length>=Gy){const r=n.reduce((s,i)=>s.timestamp{if(n._start===null||e===0||n._searchMarker===null)return null;const t=n._searchMarker.length===0?null:n._searchMarker.reduce((i,o)=>jo(e-i.index)e;)r=r.left,!r.deleted&&r.countable&&(s-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(s-=r.length);return t!==null&&jo(t.index-s){for(let r=n.length-1;r>=0;r--){const s=n[r];if(t>0){let i=s.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(s.index-=i.length);if(i===null||i.marker===!0){n.splice(r,1);continue}s.p=i,i.marker=!0}(e0&&e===s.index)&&(s.index=ds(e,s.index+t))}},Ta=(n,e,t)=>{const r=n,s=e.changedParentTypes;for(;Dr(s,n,()=>[]).push(t),n._item!==null;)n=n._item.parent;Fy(r._eH,t,e)};class dt{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=hp(),this._dEH=hp(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw un()}clone(){throw un()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){pp(this._eH,e)}observeDeep(e){pp(this._dEH,e)}unobserve(e){mp(this._eH,e)}unobserveDeep(e){mp(this._dEH,e)}toJSON(){}}const Xy=(n,e,t)=>{e<0&&(e=n._length+e),t<0&&(t=n._length+t);let r=t-e;const s=[];let i=n._start;for(;i!==null&&r>0;){if(i.countable&&!i.deleted){const o=i.content.getContent();if(o.length<=e)e-=o.length;else{for(let l=e;l0;l++)s.push(o[l]),r--;e=0}}i=i.right}return s},Qy=n=>{const e=[];let t=n._start;for(;t!==null;){if(t.countable&&!t.deleted){const r=t.content.getContent();for(let s=0;s{const t=[];let r=n._start;for(;r!==null;){if(r.countable&&zr(r,e)){const s=r.content.getContent();for(let i=0;i{let t=0,r=n._start;for(;r!==null;){if(r.countable&&!r.deleted){const s=r.content.getContent();for(let i=0;i{const t=[];return so(n,(r,s)=>{t.push(e(r,s,n))}),t},IO=n=>{let e=n._start,t=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(t===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};t=e.content.getContent(),r=0,e=e.right}const s=t[r++];return t.length<=r&&(t=null),{done:!1,value:s}}}},tb=(n,e)=>{const t=Ea(n,e);let r=n._start;for(t!==null&&(r=t.p,e-=t.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e{let s=t;const i=n.doc,o=i.clientID,l=i.store,a=t===null?e._start:t.right;let c=[];const u=()=>{c.length>0&&(s=new Te(re(o,Ue(l,o)),s,s&&s.lastId,a,a&&a.id,e,null,new cs(c)),s.integrate(n,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:s=new Te(re(o,Ue(l,o)),s,s&&s.lastId,a,a&&a.id,e,null,new yo(new Uint8Array(d))),s.integrate(n,0);break;case si:s=new Te(re(o,Ue(l,o)),s,s&&s.lastId,a,a&&a.id,e,null,new bo(d)),s.integrate(n,0);break;default:if(d instanceof dt)s=new Te(re(o,Ue(l,o)),s,s&&s.lastId,a,a&&a.id,e,null,new mn(d)),s.integrate(n,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},nb=()=>xr("Length exceeded!"),rb=(n,e,t,r)=>{if(t>e._length)throw nb();if(t===0)return e._searchMarker&&ro(e._searchMarker,t,r.length),Yl(n,e,null,r);const s=t,i=Ea(e,t);let o=e._start;for(i!==null&&(o=i.p,t-=i.index,t===0&&(o=o.prev,t+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(t<=o.length){t{let s=(e._searchMarker||[]).reduce((i,o)=>o.index>i.index?o:i,{index:0,p:e._start}).p;if(s)for(;s.right;)s=s.right;return Yl(n,e,s,t)},sb=(n,e,t,r)=>{if(r===0)return;const s=t,i=r,o=Ea(e,t);let l=e._start;for(o!==null&&(l=o.p,t-=o.index);l!==null&&t>0;l=l.right)!l.deleted&&l.countable&&(t0&&l!==null;)l.deleted||(r0)throw nb();e._searchMarker&&ro(e._searchMarker,s,-i+r)},Xl=(n,e,t)=>{const r=e._map.get(t);r!==void 0&&r.delete(n)},zd=(n,e,t,r)=>{const s=e._map.get(t)||null,i=n.doc,o=i.clientID;let l;if(r==null)l=new cs([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:l=new cs([r]);break;case Uint8Array:l=new yo(r);break;case si:l=new bo(r);break;default:if(r instanceof dt)l=new mn(r);else throw new Error("Unexpected content type")}new Te(re(o,Ue(i.store,o)),s,s&&s.lastId,null,null,e,t,l).integrate(n,0)},Vd=(n,e)=>{const t=n._map.get(e);return t!==void 0&&!t.deleted?t.content.getContent()[t.length-1]:void 0},ib=n=>{const e={};return n._map.forEach((t,r)=>{t.deleted||(e[r]=t.content.getContent()[t.length-1])}),e},ob=(n,e)=>{const t=n._map.get(e);return t!==void 0&&!t.deleted},LO=(n,e)=>{const t={};return n._map.forEach((r,s)=>{let i=r;for(;i!==null&&(!e.sv.has(i.id.client)||i.id.clock>=(e.sv.get(i.id.client)||0));)i=i.left;i!==null&&zr(i,e)&&(t[s]=i.content.getContent()[i.length-1])}),t},Do=n=>XT(n.entries(),e=>!e[1].deleted);class PO extends xa{constructor(e,t){super(e,t),this._transaction=t}}class Ds extends dt{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const t=new Ds;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Ds}clone(){const e=new Ds;return e.insert(0,this.toArray().map(t=>t instanceof dt?t.clone():t)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,t){super._callObserver(e,t),Ta(this,e,new PO(this,e))}insert(e,t){this.doc!==null?De(this.doc,r=>{rb(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}push(e){this.doc!==null?De(this.doc,t=>{RO(t,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc!==null?De(this.doc,r=>{sb(r,this,e,t)}):this._prelimContent.splice(e,t)}get(e){return tb(this,e)}toArray(){return Qy(this)}slice(e=0,t=this.length){return Xy(this,e,t)}toJSON(){return this.map(e=>e instanceof dt?e.toJSON():e)}map(e){return eb(this,e)}forEach(e){so(this,e)}[Symbol.iterator](){return IO(this)}_write(e){e.writeTypeRef(l2)}}const BO=n=>new Ds;class zO extends xa{constructor(e,t,r){super(e,t),this.keysChanged=r}}class Gs extends dt{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((r,s)=>{this.set(s,r)}),this._prelimContent=null}_copy(){return new Gs}clone(){const e=new Gs;return this.forEach((t,r)=>{e.set(r,t instanceof dt?t.clone():t)}),e}_callObserver(e,t){Ta(this,e,new zO(this,e,t))}toJSON(){const e={};return this._map.forEach((t,r)=>{if(!t.deleted){const s=t.content.getContent()[t.length-1];e[r]=s instanceof dt?s.toJSON():s}}),e}get size(){return[...Do(this._map)].length}keys(){return vc(Do(this._map),e=>e[0])}values(){return vc(Do(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return vc(Do(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((t,r)=>{t.deleted||e(t.content.getContent()[t.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?De(this.doc,t=>{Xl(t,this,e)}):this._prelimContent.delete(e)}set(e,t){return this.doc!==null?De(this.doc,r=>{zd(r,this,e,t)}):this._prelimContent.set(e,t),t}get(e){return Vd(this,e)}has(e){return ob(this,e)}clear(){this.doc!==null?De(this.doc,e=>{this.forEach(function(t,r,s){Xl(e,s,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(a2)}}const VO=n=>new Gs,br=(n,e)=>n===e||typeof n=="object"&&typeof e=="object"&&n&&e&&xT(n,e);class Mu{constructor(e,t,r,s){this.left=e,this.right=t,this.index=r,this.currentAttributes=s}forward(){switch(this.right===null&&tn(),this.right.content.constructor){case Ge:this.right.deleted||ii(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const Sp=(n,e,t)=>{for(;e.right!==null&&t>0;){switch(e.right.content.constructor){case Ge:e.right.deleted||ii(e.currentAttributes,e.right.content);break;default:e.right.deleted||(t{const s=new Map,i=r?Ea(e,t):null;if(i){const o=new Mu(i.p.left,i.p,i.index,s);return Sp(n,o,t-i.index)}else{const o=new Mu(null,e._start,0,s);return Sp(n,o,t)}},lb=(n,e,t,r)=>{for(;t.right!==null&&(t.right.deleted===!0||t.right.content.constructor===Ge&&br(r.get(t.right.content.key),t.right.content.value));)t.right.deleted||r.delete(t.right.content.key),t.forward();const s=n.doc,i=s.clientID;r.forEach((o,l)=>{const a=t.left,c=t.right,u=new Te(re(i,Ue(s.store,i)),a,a&&a.lastId,c,c&&c.id,e,null,new Ge(l,o));u.integrate(n,0),t.right=u,t.forward()})},ii=(n,e)=>{const{key:t,value:r}=e;r===null?n.delete(t):n.set(t,r)},ab=(n,e)=>{for(;n.right!==null;){if(!(n.right.deleted||n.right.content.constructor===Ge&&br(e[n.right.content.key]||null,n.right.content.value)))break;n.forward()}},cb=(n,e,t,r)=>{const s=n.doc,i=s.clientID,o=new Map;for(const l in r){const a=r[l],c=t.currentAttributes.get(l)||null;if(!br(c,a)){o.set(l,c);const{left:u,right:d}=t;t.right=new Te(re(i,Ue(s.store,i)),u,u&&u.lastId,d,d&&d.id,e,null,new Ge(l,a)),t.right.integrate(n,0),t.forward()}}return o},Sc=(n,e,t,r,s)=>{t.currentAttributes.forEach((f,h)=>{s[h]===void 0&&(s[h]=null)});const i=n.doc,o=i.clientID;ab(t,s);const l=cb(n,e,t,s),a=r.constructor===String?new hn(r):r instanceof dt?new mn(r):new fs(r);let{left:c,right:u,index:d}=t;e._searchMarker&&ro(e._searchMarker,t.index,a.getLength()),u=new Te(re(o,Ue(i.store,o)),c,c&&c.lastId,u,u&&u.id,e,null,a),u.integrate(n,0),t.right=u,t.index=d,t.forward(),lb(n,e,t,l)},Cp=(n,e,t,r,s)=>{const i=n.doc,o=i.clientID;ab(t,s);const l=cb(n,e,t,s);e:for(;t.right!==null&&(r>0||l.size>0&&(t.right.deleted||t.right.content.constructor===Ge));){if(!t.right.deleted)switch(t.right.content.constructor){case Ge:{const{key:a,value:c}=t.right.content,u=s[a];if(u!==void 0){if(br(u,c))l.delete(a);else{if(r===0)break e;l.set(a,c)}t.right.delete(n)}else t.currentAttributes.set(a,c);break}default:r0){let a="";for(;r>0;r--)a+=` `;t.right=new Te(re(o,Ue(i.store,o)),t.left,t.left&&t.left.lastId,t.right,t.right&&t.right.id,e,null,new hn(a)),t.right.integrate(n,0),t.forward()}lb(n,e,t,l)},ub=(n,e,t,r,s)=>{let i=e;const o=cn();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===Ge){const c=i.content;o.set(c.key,c)}i=i.right}let l=0,a=!1;for(;e!==i;){if(t===e&&(a=!0),!e.deleted){const c=e.content;switch(c.constructor){case Ge:{const{key:u,value:d}=c,f=r.get(u)||null;(o.get(u)!==c||f===d)&&(e.delete(n),l++,!a&&(s.get(u)||null)===d&&f!==d&&(f===null?s.delete(u):s.set(u,f))),!a&&!e.deleted&&ii(s,c);break}}}e=e.right}return l},FO=(n,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const t=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===Ge){const r=e.content.key;t.has(r)?e.delete(n):t.add(r)}e=e.left}},HO=n=>{let e=0;return De(n.doc,t=>{let r=n._start,s=n._start,i=cn();const o=mu(i);for(;s;){if(s.deleted===!1)switch(s.content.constructor){case Ge:ii(o,s.content);break;default:e+=ub(t,r,s,i,o),i=mu(o),r=s;break}s=s.right}}),e},UO=n=>{const e=new Set,t=n.doc;for(const[r,s]of n.afterState.entries()){const i=n.beforeState.get(r)||0;s!==i&&Wy(n,t.store.clients.get(r),i,s,o=>{!o.deleted&&o.content.constructor===Ge&&o.constructor!==Gt&&e.add(o.parent)})}De(t,r=>{Er(n,n.deleteSet,s=>{if(s instanceof Gt||!s.parent._hasFormatting||e.has(s.parent))return;const i=s.parent;s.content.constructor===Ge?e.add(i):FO(r,s)});for(const s of e)HO(s)})},$p=(n,e,t)=>{const r=t,s=mu(e.currentAttributes),i=e.right;for(;t>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case mn:case fs:case hn:t{s===null?this.childListChanged=!0:this.keysChanged.add(s)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,t=[];De(e,r=>{const s=new Map,i=new Map;let o=this.target._start,l=null;const a={};let c="",u=0,d=0;const f=()=>{if(l!==null){let h=null;switch(l){case"delete":d>0&&(h={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(h={insert:c},s.size>0&&(h.attributes={},s.forEach((p,m)=>{p!==null&&(h.attributes[m]=p)}))),c="";break;case"retain":u>0&&(h={retain:u},$T(a)||(h.attributes=ST({},a))),u=0;break}h&&t.push(h),l=null}};for(;o!==null;){switch(o.content.constructor){case mn:case fs:this.adds(o)?this.deletes(o)||(f(),l="insert",c=o.content.getContent()[0],f()):this.deletes(o)?(l!=="delete"&&(f(),l="delete"),d+=1):o.deleted||(l!=="retain"&&(f(),l="retain"),u+=1);break;case hn:this.adds(o)?this.deletes(o)||(l!=="insert"&&(f(),l="insert"),c+=o.content.str):this.deletes(o)?(l!=="delete"&&(f(),l="delete"),d+=o.length):o.deleted||(l!=="retain"&&(f(),l="retain"),u+=o.length);break;case Ge:{const{key:h,value:p}=o.content;if(this.adds(o)){if(!this.deletes(o)){const m=s.get(h)||null;br(m,p)?p!==null&&o.delete(r):(l==="retain"&&f(),br(p,i.get(h)||null)?delete a[h]:a[h]=p)}}else if(this.deletes(o)){i.set(h,p);const m=s.get(h)||null;br(m,p)||(l==="retain"&&f(),a[h]=m)}else if(!o.deleted){i.set(h,p);const m=a[h];m!==void 0&&(br(m,p)?m!==null&&o.delete(r):(l==="retain"&&f(),p===null?delete a[h]:a[h]=p))}o.deleted||(l==="insert"&&f(),ii(s,o.content));break}}o=o.right}for(f();t.length>0;){const h=t[t.length-1];if(h.retain!==void 0&&h.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}}class ls extends dt{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new ls}clone(){const e=new ls;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);const r=new jO(this,e,t);Ta(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===hn&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc!==null?De(this.doc,r=>{const s=new Mu(null,this._start,0,new Map);for(let i=0;i0)&&Sc(r,this,s,l,o.attributes||{})}else o.retain!==void 0?Cp(r,this,s,o.retain,o.attributes||{}):o.delete!==void 0&&$p(r,s,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,r){const s=[],i=new Map,o=this.doc;let l="",a=this._start;function c(){if(l.length>0){const d={};let f=!1;i.forEach((p,m)=>{f=!0,d[m]=p});const h={insert:l};f&&(h.attributes=d),s.push(h),l=""}}const u=()=>{for(;a!==null;){if(zr(a,e)||t!==void 0&&zr(a,t))switch(a.content.constructor){case hn:{const d=i.get("ychange");e!==void 0&&!zr(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(c(),i.set("ychange",r?r("removed",a.id):{type:"removed"})):t!==void 0&&!zr(a,t)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(c(),i.set("ychange",r?r("added",a.id):{type:"added"})):d!==void 0&&(c(),i.delete("ychange")),l+=a.content.str;break}case mn:case fs:{c();const d={insert:a.content.getContent()[0]};if(i.size>0){const f={};d.attributes=f,i.forEach((h,p)=>{f[p]=h})}s.push(d);break}case Ge:zr(a,e)&&(c(),ii(i,a.content));break}a=a.right}c()};return e||t?De(o,d=>{e&&$u(d,e),t&&$u(d,t),u()},"cleanup"):u(),s}insert(e,t,r){if(t.length<=0)return;const s=this.doc;s!==null?De(s,i=>{const o=Io(i,this,e,!r);r||(r={},o.currentAttributes.forEach((l,a)=>{r[a]=l})),Sc(i,this,o,t,r)}):this._pending.push(()=>this.insert(e,t,r))}insertEmbed(e,t,r){const s=this.doc;s!==null?De(s,i=>{const o=Io(i,this,e,!r);Sc(i,this,o,t,r||{})}):this._pending.push(()=>this.insertEmbed(e,t,r||{}))}delete(e,t){if(t===0)return;const r=this.doc;r!==null?De(r,s=>{$p(s,Io(s,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,r){if(t===0)return;const s=this.doc;s!==null?De(s,i=>{const o=Io(i,this,e,!1);o.right!==null&&Cp(i,this,o,t,r)}):this._pending.push(()=>this.format(e,t,r))}removeAttribute(e){this.doc!==null?De(this.doc,t=>{Xl(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){this.doc!==null?De(this.doc,r=>{zd(r,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return Vd(this,e)}getAttributes(){return ib(this)}_write(e){e.writeTypeRef(c2)}}const WO=n=>new ls;class Cc{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===Dt||t.constructor===as)&&t._start!==null)e=t._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class as extends dt{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new as}clone(){const e=new as;return e.insert(0,this.toArray().map(t=>t instanceof dt?t.clone():t)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Cc(this,e)}querySelector(e){e=e.toUpperCase();const r=new Cc(this,s=>s.nodeName&&s.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Mr(new Cc(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){Ta(this,e,new KO(this,t,e))}toString(){return eb(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},r){const s=e.createDocumentFragment();return r!==void 0&&r._createAssociation(s,this),so(this,i=>{s.insertBefore(i.toDOM(e,t,r),null)}),s}insert(e,t){this.doc!==null?De(this.doc,r=>{rb(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(this.doc!==null)De(this.doc,r=>{const s=e&&e instanceof dt?e._item:e;Yl(r,this,s,t)});else{const r=this._prelimContent,s=e===null?0:r.findIndex(i=>i===e)+1;if(s===0&&e!==null)throw xr("Reference item not found");r.splice(s,0,...t)}}delete(e,t=1){this.doc!==null?De(this.doc,r=>{sb(r,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return Qy(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return tb(this,e)}slice(e=0,t=this.length){return Xy(this,e,t)}forEach(e){so(this,e)}_write(e){e.writeTypeRef(d2)}}const qO=n=>new as;class Dt extends as{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((r,s)=>{this.setAttribute(s,r)}),this._prelimAttrs=null}_copy(){return new Dt(this.nodeName)}clone(){const e=new Dt(this.nodeName),t=this.getAttributes();return CT(t,(r,s)=>{typeof r=="string"&&e.setAttribute(s,r)}),e.insert(0,this.toArray().map(r=>r instanceof dt?r.clone():r)),e}toString(){const e=this.getAttributes(),t=[],r=[];for(const l in e)r.push(l);r.sort();const s=r.length;for(let l=0;l0?" "+t.join(" "):"";return`<${i}${o}>${super.toString()}`}removeAttribute(e){this.doc!==null?De(this.doc,t=>{Xl(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){this.doc!==null?De(this.doc,r=>{zd(r,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return Vd(this,e)}hasAttribute(e){return ob(this,e)}getAttributes(e){return e?LO(this,e):ib(this)}toDOM(e=document,t={},r){const s=e.createElement(this.nodeName),i=this.getAttributes();for(const o in i){const l=i[o];typeof l=="string"&&s.setAttribute(o,l)}return so(this,o=>{s.appendChild(o.toDOM(e,t,r))}),r!==void 0&&r._createAssociation(s,this),s}_write(e){e.writeTypeRef(u2),e.writeKey(this.nodeName)}}const JO=n=>new Dt(n.readKey());class KO extends xa{constructor(e,t,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(s=>{s===null?this.childListChanged=!0:this.attributesChanged.add(s)})}}class Ql extends Gs{constructor(e){super(),this.hookName=e}_copy(){return new Ql(this.hookName)}clone(){const e=new Ql(this.hookName);return this.forEach((t,r)=>{e.set(r,t)}),e}toDOM(e=document,t={},r){const s=t[this.hookName];let i;return s!==void 0?i=s.createDom(this):i=document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(f2),e.writeKey(this.hookName)}}const GO=n=>new Ql(n.readKey());class jt extends ls{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new jt}clone(){const e=new jt;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,r){const s=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(s,this),s}toString(){return this.toDelta().map(e=>{const t=[];for(const s in e.attributes){const i=[];for(const o in e.attributes[s])i.push({key:o,value:e.attributes[s][o]});i.sort((o,l)=>o.keys.nodeName=0;s--)r+=``;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(h2)}}const YO=n=>new jt;class Fd{constructor(e,t){this.id=e,this.length=t}get deleted(){throw un()}mergeWith(e){return!1}write(e,t,r){throw un()}integrate(e,t){throw un()}}const XO=0;class Gt extends Fd{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),jy(e.doc.store,this)}write(e,t){e.writeInfo(XO),e.writeLen(this.length-t)}getMissing(e,t){return null}}class yo{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new yo(this.content)}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}const QO=n=>new yo(n.readBuf());class io{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new io(this.len)}splice(e){const t=new io(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){eo(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const ZO=n=>new io(n.readLen()),db=(n,e)=>new si({guid:n,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class bo{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new bo(db(this.doc.guid,this.opts))}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const e2=n=>new bo(db(n.readString(),n.readAny()));class fs{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new fs(this.embed)}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}const t2=n=>new fs(n.readJSON());class Ge{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Ge(this.key,this.value)}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){const r=t.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const n2=n=>new Ge(n.readKey(),n.readJSON());class Zl{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Zl(this.arr)}splice(e){const t=new Zl(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const r=this.arr.length;e.writeLen(r-t);for(let s=t;s{const e=n.readLen(),t=[];for(let r=0;r{const e=n.readLen(),t=[];for(let r=0;r=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}}const i2=n=>new hn(n.readString()),o2=[BO,VO,WO,JO,qO,GO,YO],l2=0,a2=1,c2=2,u2=3,d2=4,f2=5,h2=6;class mn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new mn(this.type._copy())}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const p2=n=>new mn(o2[n.readTypeRef()](n)),xu=(n,e)=>{let t=e,r=0,s;do r>0&&(t=re(t.client,t.clock+r)),s=Jo(n,t),r=t.clock-s.id.clock,t=s.redone;while(t!==null&&s instanceof Te);return{item:s,diff:r}},Hd=(n,e)=>{for(;n!==null&&n.keep!==e;)n.keep=e,n=n.parent._item},ea=(n,e,t)=>{const{client:r,clock:s}=e.id,i=new Te(re(r,s+t),e,re(r,s+t-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(t));return e.deleted&&i.markDeleted(),e.keep&&(i.keep=!0),e.redone!==null&&(i.redone=re(e.redone.client,e.redone.clock+t)),e.right=i,i.right!==null&&(i.right.left=i),n._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),e.length=t,i},Ap=(n,e)=>BE(n,t=>ni(t.deletions,e)),fb=(n,e,t,r,s,i)=>{const o=n.doc,l=o.store,a=o.clientID,c=e.redone;if(c!==null)return Nt(n,c);let u=e.parent._item,d=null,f;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!t.has(u)||fb(n,u,t,r,s,i)===null))return null;for(;u.redone!==null;)u=Nt(n,u.redone)}const h=u===null?e.parent:u.content.type;if(e.parentSub===null){for(d=e.left,f=e;d!==null;){let y=d;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:Nt(n,y.redone);if(y!==null&&y.parent._item===u){d=y;break}d=d.left}for(;f!==null;){let y=f;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:Nt(n,y.redone);if(y!==null&&y.parent._item===u){f=y;break}f=f.right}}else if(f=null,e.right&&!s){for(d=e;d!==null&&d.right!==null&&(d.right.redone||ni(r,d.right.id)||Ap(i.undoStack,d.right.id)||Ap(i.redoStack,d.right.id));)for(d=d.right;d.redone;)d=Nt(n,d.redone);if(d&&d.right!==null)return null}else d=h._map.get(e.parentSub)||null;const p=Ue(l,a),m=re(a,p),g=new Te(m,d,d&&d.lastId,f,f&&f.id,h,e.parentSub,e.content.copy());return e.redone=m,Hd(g,!0),g.integrate(n,0),g};class Te extends Fd{constructor(e,t,r,s,i,o,l,a){super(e,a.getLength()),this.origin=r,this.left=t,this.right=s,this.rightOrigin=i,this.parent=o,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?tp:0}set marker(e){(this.info&yc)>0!==e&&(this.info^=yc)}get marker(){return(this.info&yc)>0}get keep(){return(this.info&ep)>0}set keep(e){this.keep!==e&&(this.info^=ep)}get countable(){return(this.info&tp)>0}get deleted(){return(this.info&gc)>0}set deleted(e){this.deleted!==e&&(this.info^=gc)}markDeleted(){this.info|=gc}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Ue(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Ue(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Ns&&this.id.client!==this.parent.client&&this.parent.clock>=Ue(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=gp(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Nt(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Gt||this.right&&this.right.constructor===Gt)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Te&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===Te&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Ns){const r=Jo(t,this.parent);r.constructor===Gt?this.parent=null:this.parent=r.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=gp(e,e.doc.store,re(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,s;if(r!==null)s=r.right;else if(this.parentSub!==null)for(s=this.parent._map.get(this.parentSub)||null;s!==null&&s.left!==null;)s=s.left;else s=this.parent._start;const i=new Set,o=new Set;for(;s!==null&&s!==this.right;){if(o.add(s),i.add(s),_o(this.origin,s.origin)){if(s.id.client{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),eo(e.deleteSet,this.id.client,this.id.clock,this.length),bp(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw tn();this.content.gc(e),t?wO(e,this,new Gt(this.id,this.length)):this.content=new io(this.length)}write(e,t){const r=t>0?re(this.id.client,this.id.clock+t-1):this.origin,s=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&Ca|(r===null?0:Ut)|(s===null?0:qn)|(i===null?0:Yi);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),s!==null&&e.writeRightID(s),r===null&&s===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const c=to(l);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===Ns?(e.writeParentInfo(!1),e.writeLeftID(l)):tn();i!==null&&e.writeString(i)}this.content.write(e,t)}}const hb=(n,e)=>m2[e&Ca](n),m2=[()=>{tn()},ZO,r2,QO,i2,t2,n2,p2,s2,e2,()=>{tn()}],g2=10;class Yt extends Fd{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,t){tn()}write(e,t){e.writeInfo(g2),he(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const pb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},mb="__ $YJS$ __";pb[mb]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");pb[mb]=!0;function y2(n){return n||(n={}),{delay:n.delay===void 0?200:n.delay,initialDelay:n.initialDelay===void 0?0:n.initialDelay,minDelay:n.minDelay===void 0?0:n.minDelay,maxDelay:n.maxDelay===void 0?0:n.maxDelay,factor:n.factor===void 0?0:n.factor,maxAttempts:n.maxAttempts===void 0?3:n.maxAttempts,timeout:n.timeout===void 0?0:n.timeout,jitter:n.jitter===!0,handleError:n.handleError===void 0?null:n.handleError,handleTimeout:n.handleTimeout===void 0?null:n.handleTimeout,beforeAttempt:n.beforeAttempt===void 0?null:n.beforeAttempt,calculateDelay:n.calculateDelay===void 0?null:n.calculateDelay}}async function Mp(n){return new Promise((e,t)=>{setTimeout(e,n)})}function b2(n,e){let t=e.delay;if(t===0)return 0;if(e.factor&&(t*=Math.pow(e.factor,n.attemptNum-1),e.maxDelay!==0&&(t=Math.min(t,e.maxDelay))),e.jitter){const r=Math.ceil(e.minDelay),s=Math.floor(t);t=Math.floor(Math.random()*(s-r+1))+r}return Math.round(t)}async function w2(n,e){const t=y2(e);for(const l of["delay","initialDelay","minDelay","maxDelay","maxAttempts","timeout"]){const a=t[l];if(!Number.isInteger(a)||a<0)throw new Error(`Value for ${l} must be an integer greater than or equal to 0`)}if(t.factor.constructor!==Number||t.factor<0)throw new Error("Value for factor must be a number greater than or equal to 0");if(t.delay{if(t.handleError&&await t.handleError(a,r,t),r.aborted||r.attemptsRemaining===0)throw a;r.attemptNum++;const c=s(r,t);return c&&await Mp(c),i()};return r.attemptsRemaining>0&&r.attemptsRemaining--,t.timeout?new Promise((a,c)=>{const u=setTimeout(()=>{if(t.handleTimeout)try{a(t.handleTimeout(r,t))}catch(d){c(d)}else{const d=new Error(`Retry timeout (attemptNum: ${r.attemptNum}, timeout: ${t.timeout})`);d.code="ATTEMPT_TIMEOUT",c(d)}},t.timeout);n(r,t).then(d=>{clearTimeout(u),a(d)}).catch(d=>{clearTimeout(u),l(d).then(a).catch(c)})}):n(r,t).catch(l)}const o=t.calculateDelay?t.calculateDelay(r,t):t.initialDelay;return o&&await Mp(o),i()}var gb={};const Is=()=>new Map,yb=(n,e,t)=>{let r=n.get(e);return r===void 0&&n.set(e,r=t()),r},bb=()=>new Set,v2=Array.from,k2=String.fromCharCode,S2=n=>n.toLowerCase(),C2=/^\s*/g,$2=n=>n.replace(C2,""),A2=/([A-Z])/g,xp=(n,e)=>$2(n.replace(A2,t=>`${e}${S2(t)}`)),M2=n=>{const e=unescape(encodeURIComponent(n)),t=e.length,r=new Uint8Array(t);for(let s=0;soo.encode(n),E2=oo?x2:M2;let Ni=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ni&&Ni.decode(new Uint8Array).length===1&&(Ni=null);const Ep=n=>n===void 0?null:n;class T2{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let wb=new T2,Ud=!0;try{typeof localStorage<"u"&&localStorage&&(wb=localStorage,Ud=!1)}catch{}const vb=wb,O2=n=>Ud||addEventListener("storage",n),_2=n=>Ud||removeEventListener("storage",n),N2=Object.keys,D2=(n,e)=>{const t=[];for(const r in n)t.push(e(n[r],r));return t},Tp=n=>N2(n).length,I2=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),R2=(n,e)=>n===e,Di=(n,e)=>{if(n==null||e==null)return R2(n,e);if(n.constructor!==e.constructor)return!1;if(n===e)return!0;switch(n.constructor){case ArrayBuffer:n=new Uint8Array(n),e=new Uint8Array(e);case Uint8Array:{if(n.byteLength!==e.byteLength)return!1;for(let t=0;te.includes(n),Ys=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",kb=typeof window<"u"&&typeof document<"u"&&!Ys;let vn;const P2=()=>{if(vn===void 0)if(Ys){vn=Is();const n=process.argv;let e=null;for(let t=0;t{if(n.length!==0){const[e,t]=n.split("=");vn.set(`--${xp(e,"-")}`,t),vn.set(`-${xp(e,"-")}`,t)}})):vn=Is();return vn},Eu=n=>P2().has(n),Tu=n=>Ep(Ys?gb[n.toUpperCase()]:vb.getItem(n)),B2=n=>Eu("--"+n)||Tu(n)!==null;B2("production");const Op=Ys&&L2(gb.FORCE_COLOR,["true","1","2"]);!Eu("no-colors")&&(!Ys||process.stdout.isTTY||Op)&&(!Ys||Eu("color")||Op||Tu("COLORTERM")!==null||(Tu("TERM")||"").includes("color"));const Sb=Math.floor,z2=(n,e)=>nn>e?n:e,F2=64,ta=128,H2=63,Ii=127,Cb=Number.MAX_SAFE_INTEGER;class U2{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const jd=()=>new U2,$b=n=>{let e=n.cpos;for(let t=0;t{const e=new Uint8Array($b(n));let t=0;for(let r=0;r{const t=n.cbuf.length;n.cpos===t&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(t*2),n.cpos=0),n.cbuf[n.cpos++]=e},it=(n,e)=>{for(;e>Ii;)na(n,ta|Ii&e),e=Sb(e/128);na(n,Ii&e)},Ou=new Uint8Array(3e4),j2=Ou.length/3,W2=(n,e)=>{if(e.length{const t=unescape(encodeURIComponent(e)),r=t.length;it(n,r);for(let s=0;s{const t=n.cbuf.length,r=n.cpos,s=z2(t-r,e.length),i=e.length-s;n.cbuf.set(e.subarray(0,s),r),n.cpos+=s,i>0&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(V2(t*2,i)),n.cbuf.set(e.subarray(s)),n.cpos=i)},oi=(n,e)=>{it(n,e.byteLength),J2(n,e)},Ab=n=>new Error(n),Mb=Ab("Unexpected end of array"),xb=Ab("Integer out of Range");class K2{constructor(e){this.arr=e,this.pos=0}}const Eb=n=>new K2(n),G2=(n,e)=>{const t=new Uint8Array(n.arr.buffer,n.pos+n.arr.byteOffset,e);return n.pos+=e,t},Oa=n=>G2(n,Qr(n)),_p=n=>n.arr[n.pos++],Qr=n=>{let e=0,t=1;const r=n.arr.length;for(;n.posCb)throw xb}throw Mb},Y2=n=>{let e=n.arr[n.pos++],t=e&H2,r=64;const s=(e&F2)>0?-1:1;if(!(e&ta))return s*t;const i=n.arr.length;for(;n.posCb)throw xb}throw Mb},X2=n=>{let e=Qr(n);if(e===0)return"";{let t=String.fromCodePoint(_p(n));if(--e<100)for(;e--;)t+=String.fromCodePoint(_p(n));else for(;e>0;){const r=e<1e4?e:1e4,s=n.arr.subarray(n.pos,n.pos+r);n.pos+=r,t+=String.fromCodePoint.apply(null,s),e-=r}return decodeURIComponent(escape(t))}},Q2=n=>Ni.decode(Oa(n)),_a=Ni?Q2:X2,Z2=n=>{const e=n.pos,t=_a(n);return n.pos=e,t},e_=n=>new Uint8Array(n),t_=(n,e,t)=>new Uint8Array(n,e,t),n_=n=>new Uint8Array(n),r_=n=>{let e="";for(let t=0;tBuffer.from(n.buffer,n.byteOffset,n.byteLength).toString("base64"),i_=n=>{const e=atob(n),t=e_(e.length);for(let r=0;r{const e=Buffer.from(n,"base64");return t_(e.buffer,e.byteOffset,e.byteLength)},l_=kb?r_:s_,a_=kb?i_:o_,Tb=new Map;class c_{constructor(e){this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&this.onmessage!==null&&this.onmessage({data:a_(t.newValue||"")}),O2(this._onChange)}postMessage(e){vb.setItem(this.room,l_(n_(e)))}close(){_2(this._onChange)}}const u_=typeof BroadcastChannel>"u"?c_:BroadcastChannel,qd=n=>yb(Tb,n,()=>{const e=bb(),t=new u_(n);return t.onmessage=r=>e.forEach(s=>s(r.data,"broadcastchannel")),{bc:t,subs:e}}),d_=(n,e)=>(qd(n).subs.add(e),e),f_=(n,e)=>{const t=qd(n),r=t.subs.delete(e);return r&&t.subs.size===0&&(t.bc.close(),Tb.delete(n)),r},h_=(n,e,t=null)=>{const r=qd(n);r.bc.postMessage(e),r.subs.forEach(s=>s(e,t))},p_=()=>{let n=!0;return(e,t)=>{if(n){n=!1;try{e()}finally{n=!0}}else t!==void 0&&t()}},Xs=Date.now;class m_{constructor(){this._observers=Is()}on(e,t){yb(this._observers,e,bb).add(t)}once(e,t){const r=(...s)=>{this.off(e,r),t(...s)};this.on(e,r)}off(e,t){const r=this._observers.get(e);r!==void 0&&(r.delete(t),r.size===0&&this._observers.delete(e))}emit(e,t){return v2((this._observers.get(e)||Is()).values()).forEach(r=>r(...t))}destroy(){this._observers=Is()}}const $c=3e4;class g_ extends m_{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const t=Xs();this.getLocalState()!==null&&$c/2<=t-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const r=[];this.meta.forEach((s,i)=>{i!==this.clientID&&$c<=t-s.lastUpdated&&this.states.has(i)&&r.push(i)}),r.length>0&&Go(this,r,"timeout")},Sb($c/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,r=this.meta.get(t),s=r===void 0?0:r.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:s,lastUpdated:Xs()});const o=[],l=[],a=[],c=[];e===null?c.push(t):i==null?e!=null&&o.push(t):(l.push(t),Di(i,e)||a.push(t)),(o.length>0||a.length>0||c.length>0)&&this.emit("change",[{added:o,updated:a,removed:c},"local"]),this.emit("update",[{added:o,updated:l,removed:c},"local"])}setLocalStateField(e,t){const r=this.getLocalState();r!==null&&this.setLocalState({...r,[e]:t})}getStates(){return this.states}}const Go=(n,e,t)=>{const r=[];for(let s=0;s0&&(n.emit("change",[{added:[],updated:[],removed:r},t]),n.emit("update",[{added:[],updated:[],removed:r},t]))},_u=(n,e,t=n.states)=>{const r=e.length,s=jd();it(s,r);for(let i=0;i{const r=Eb(e),s=Xs(),i=[],o=[],l=[],a=[],c=Qr(r);for(let u=0;u0||l.length>0||a.length>0)&&n.emit("change",[{added:i,updated:l,removed:a},t]),(i.length>0||o.length>0||a.length>0)&&n.emit("update",[{added:i,updated:o,removed:a},t])};class Ob{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(s=>s.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(s=>s!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}const b_=n=>D2(n,(e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");var nt;(function(n){n[n.Sync=0]="Sync",n[n.Awareness=1]="Awareness",n[n.Auth=2]="Auth",n[n.QueryAwareness=3]="QueryAwareness",n[n.Stateless=5]="Stateless",n[n.CLOSE=7]="CLOSE",n[n.SyncStatus=8]="SyncStatus"})(nt||(nt={}));var et;(function(n){n.Connecting="connecting",n.Connected="connected",n.Disconnected="disconnected"})(et||(et={}));class Yo{constructor(e){this.data=e,this.encoder=jd(),this.decoder=Eb(new Uint8Array(this.data))}peekVarString(){return Z2(this.decoder)}readVarUint(){return Qr(this.decoder)}readVarString(){return _a(this.decoder)}readVarUint8Array(){return Oa(this.decoder)}writeVarUint(e){return it(this.encoder,e)}writeVarString(e){return pn(this.encoder,e)}writeVarUint8Array(e){return oi(this.encoder,e)}length(){return $b(this.encoder)}}class _b extends Ob{constructor(e){super(),this.messageQueue=[],this.configuration={url:"",document:void 0,WebSocketPolyfill:void 0,parameters:{},connect:!0,broadcast:!0,forceSyncInterval:!1,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,quiet:!1,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=et.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={forceSync:null,connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.receivedOnStatusPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on("open",this.configuration.onOpen),this.on("open",this.onOpen.bind(this)),this.on("connect",this.configuration.onConnect),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("status",this.configuration.onStatus),this.on("status",this.onStatus.bind(this)),this.on("disconnect",this.configuration.onDisconnect),this.on("close",this.configuration.onClose),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("close",this.onClose.bind(this)),this.on("message",this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),typeof e.connect<"u"&&(this.shouldConnect=e.connect),this.shouldConnect&&this.connect()}async onOpen(e){this.receivedOnOpenPayload=e}async onStatus(e){this.receivedOnStatusPayload=e}attach(e){this.configuration.providerMap.set(e.configuration.name,e),this.status===et.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&e.onOpen(this.receivedOnOpenPayload),this.receivedOnStatusPayload&&e.onStatus(this.receivedOnStatusPayload)}detach(e){this.configuration.providerMap.delete(e.configuration.name)}setConfiguration(e={}){this.configuration={...this.configuration,...e}}async connect(){if(this.status===et.Connected)return;this.cancelWebsocketRetry&&(this.cancelWebsocketRetry(),this.cancelWebsocketRetry=void 0),this.receivedOnOpenPayload=void 0,this.receivedOnStatusPayload=void 0,this.shouldConnect=!0;const e=()=>{let s=!1;return{retryPromise:w2(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,beforeAttempt:o=>{(!this.shouldConnect||s)&&o.abort()}}).catch(o=>{if(o&&o.code!=="ATTEMPT_ABORTED")throw o}),cancelFunc:()=>{s=!0}}},{retryPromise:t,cancelFunc:r}=e();return this.cancelWebsocketRetry=r,t}attachWebSocketListeners(e,t){const{identifier:r}=e,s=c=>this.emit("message",c),i=c=>this.emit("close",{event:c}),o=c=>this.emit("open",c),l=c=>{t(c)};this.webSocketHandlers[r]={message:s,close:i,open:o,error:l};const a=this.webSocketHandlers[e.identifier];Object.keys(a).forEach(c=>{e.addEventListener(c,a[c])})}cleanupWebSocket(){if(!this.webSocket)return;const{identifier:e}=this.webSocket,t=this.webSocketHandlers[e];Object.keys(t).forEach(r=>{var s;(s=this.webSocket)===null||s===void 0||s.removeEventListener(r,t[r]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,t)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;const r=new this.configuration.WebSocketPolyfill(this.url);r.binaryType="arraybuffer",r.identifier=this.identifier,this.attachWebSocketListeners(r,t),this.webSocket=r,this.status=et.Connecting,this.emit("status",{status:et.Connecting}),this.connectionAttempt={resolve:e,reject:t}})}onMessage(e){var t;this.resolveConnectionAttempt(),this.lastMessageReceived=Xs();const s=new Yo(e.data).peekVarString();(t=this.configuration.providerMap.get(s))===null||t===void 0||t.onMessage(e)}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=et.Connected,this.emit("status",{status:et.Connected}),this.emit("connect"),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){var e;(e=this.connectionAttempt)===null||e===void 0||e.reject(),this.connectionAttempt=null}checkConnection(){var e;this.status===et.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=Xs()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:"forced"}}),this.closeTries=0):((e=this.webSocket)===null||e===void 0||e.close(),this.messageQueue=[])))}get serverUrl(){for(;this.configuration.url[this.configuration.url.length-1]==="/";)return this.configuration.url.slice(0,this.configuration.url.length-1);return this.configuration.url}get url(){const e=b_(this.configuration.parameters);return`${this.serverUrl}${e.length===0?"":`?${e}`}`}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch{}}send(e){var t;((t=this.webSocket)===null||t===void 0?void 0:t.readyState)===pu.Open?this.webSocket.send(e):this.messageQueue.push(e)}onClose({event:e}){if(this.closeTries=0,this.cleanupWebSocket(),this.status===et.Connected&&(this.status=et.Disconnected,this.emit("status",{status:et.Disconnected}),this.emit("disconnect",{event:e})),e.code===Qh.code&&(e.reason===Qh.reason?console.warn("[HocuspocusProvider] An authentication token is required, but you didn’t send one. Try adding a `token` to your HocuspocusProvider configuration. Won’t try again."):console.warn(`[HocuspocusProvider] Connection closed with status Unauthorized: ${e.reason}`),this.shouldConnect=!1),e.code===IE.code&&!this.configuration.quiet){console.warn("[HocuspocusProvider] The provided authentication token isn’t allowed to connect to this server. Will try again.");return}e.code===DE.code&&(console.warn(`[HocuspocusProvider] Connection closed with status MessageTooBig: ${e.reason}`),this.shouldConnect=!1),this.connectionAttempt?this.rejectConnectionAttempt():this.shouldConnect&&this.connect(),!this.shouldConnect&&this.status!==et.Disconnected&&(this.status=et.Disconnected,this.emit("status",{status:et.Disconnected}),this.emit("disconnect",{event:e}))}destroy(){this.emit("destroy"),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}}const Nb=0,Jd=1,Db=2,w_=(n,e)=>{it(n,Nb);const t=fO(e);oi(n,t)},Ib=(n,e,t)=>{it(n,Jd),oi(n,aO(e,t))},v_=(n,e,t)=>Ib(e,t,Oa(n)),Rb=(n,e,t)=>{try{iO(e,Oa(n),t)}catch(r){console.error("Caught error while handling a Yjs update",r)}},k_=(n,e)=>{it(n,Db),oi(n,e)},S_=Rb,C_=(n,e,t,r)=>{const s=Qr(n);switch(s){case Nb:v_(n,e,t);break;case Jd:Rb(n,t,r);break;case Db:S_(n,t,r);break;default:throw new Error("Unknown message type")}return s};class Rn{constructor(){this.encoder=jd()}get(e){return e.encoder}toUint8Array(){return Wd(this.encoder)}}class Np{constructor(e){this.broadcasted=!1,this.message=e}setBroadcasted(e){return this.broadcasted=e,this}apply(e,t){const{message:r}=this,s=r.readVarUint(),i=r.length();switch(s){case nt.Sync:this.applySyncMessage(e,t);break;case nt.Awareness:this.applyAwarenessMessage(e);break;case nt.Auth:this.applyAuthMessage(e);break;case nt.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case nt.Stateless:e.receiveStateless(_a(r.decoder));break;case nt.SyncStatus:this.applySyncStatusMessage(e,Y2(r.decoder)===1);break;default:throw new Error(`Can’t apply message of unknown type: ${s}`)}r.length()>i+1&&(this.broadcasted?e.broadcast(Rn,{encoder:r.encoder}):e.send(Rn,{encoder:r.encoder}))}applySyncMessage(e,t){const{message:r}=this;r.writeVarUint(nt.Sync);const s=C_(r.decoder,r.encoder,e.document,e);t&&s===Jd&&(e.synced=!0)}applySyncStatusMessage(e,t){t&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;const{message:t}=this;y_(e.awareness,t.readVarUint8Array(),e)}applyAuthMessage(e){const{message:t}=this;NE(t.decoder,e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;const{message:t}=this;t.writeVarUint(nt.Awareness),t.writeVarUint8Array(_u(e.awareness,Array.from(e.awareness.getStates().keys())))}}class Dp{constructor(e,t={}){this.message=new e,this.encoder=this.message.get(t)}create(){return Wd(this.encoder)}send(e){e==null||e.send(this.create())}broadcast(e){h_(e,this.create())}}class $_ extends Rn{constructor(){super(...arguments),this.type=nt.Auth,this.description="Authentication"}get(e){if(typeof e.token>"u")throw new Error("The authentication message requires `token` as an argument.");return pn(this.encoder,e.documentName),it(this.encoder,this.type),_E(this.encoder,e.token),this.encoder}}class Ro extends Rn{constructor(){super(...arguments),this.type=nt.Awareness,this.description="Awareness states update"}get(e){if(typeof e.awareness>"u")throw new Error("The awareness message requires awareness as an argument");if(typeof e.clients>"u")throw new Error("The awareness message requires clients as an argument");pn(this.encoder,e.documentName),it(this.encoder,this.type);let t;return e.states===void 0?t=_u(e.awareness,e.clients):t=_u(e.awareness,e.clients,e.states),oi(this.encoder,t),this.encoder}}class A_ extends Rn{constructor(){super(...arguments),this.type=nt.CLOSE,this.description="Ask the server to close the connection"}get(e){return pn(this.encoder,e.documentName),it(this.encoder,this.type),this.encoder}}class M_ extends Rn{constructor(){super(...arguments),this.type=nt.QueryAwareness,this.description="Queries awareness states"}get(e){return pn(this.encoder,e.documentName),it(this.encoder,this.type),this.encoder}}class x_ extends Rn{constructor(){super(...arguments),this.type=nt.Stateless,this.description="A stateless message"}get(e){var t;return pn(this.encoder,e.documentName),it(this.encoder,this.type),pn(this.encoder,(t=e.payload)!==null&&t!==void 0?t:""),this.encoder}}class Ac extends Rn{constructor(){super(...arguments),this.type=nt.Sync,this.description="First sync step"}get(e){if(typeof e.document>"u")throw new Error("The sync step one message requires document as an argument");return pn(this.encoder,e.documentName),it(this.encoder,this.type),w_(this.encoder,e.document),this.encoder}}class E_ extends Rn{constructor(){super(...arguments),this.type=nt.Sync,this.description="Second sync step"}get(e){if(typeof e.document>"u")throw new Error("The sync step two message requires document as an argument");return pn(this.encoder,e.documentName),it(this.encoder,this.type),Ib(this.encoder,e.document),this.encoder}}class T_ extends Rn{constructor(){super(...arguments),this.type=nt.Sync,this.description="A document update"}get(e){return pn(this.encoder,e.documentName),it(this.encoder,this.type),k_(this.encoder,e.update),this.encoder}}class O_ extends Error{constructor(){super(...arguments),this.code=1001}}class __ extends Ob{constructor(e){var t,r,s;super(),this.configuration={name:"",document:void 0,awareness:void 0,token:null,parameters:{},broadcast:!0,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onSynced:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,quiet:!1,connect:!0,preserveConnection:!0},this.subscribedToBroadcastChannel=!1,this.isSynced=!1,this.unsyncedChanges=0,this.status=et.Disconnected,this.isAuthenticated=!1,this.authorizedScope=void 0,this.mux=p_(),this.intervals={forceSync:null},this.isConnected=!0,this.boundBroadcastChannelSubscriber=this.broadcastChannelSubscriber.bind(this),this.boundPageUnload=this.pageUnload.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.boundOnStatus=this.onStatus.bind(this),this.forwardConnect=i=>this.emit("connect",i),this.forwardOpen=i=>this.emit("open",i),this.forwardClose=i=>this.emit("close",i),this.forwardDisconnect=i=>this.emit("disconnect",i),this.forwardDestroy=i=>this.emit("destroy",i),this.setConfiguration(e),this.configuration.document=e.document?e.document:new si,this.configuration.awareness=e.awareness!==void 0?e.awareness:new g_(this.document),this.on("open",this.configuration.onOpen),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("synced",this.configuration.onSynced),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("stateless",this.configuration.onStateless),this.on("authenticated",this.configuration.onAuthenticated),this.on("authenticationFailed",this.configuration.onAuthenticationFailed),this.configuration.websocketProvider.on("connect",this.configuration.onConnect),this.configuration.websocketProvider.on("connect",this.forwardConnect),this.configuration.websocketProvider.on("open",this.boundOnOpen),this.configuration.websocketProvider.on("open",this.forwardOpen),this.configuration.websocketProvider.on("close",this.boundOnClose),this.configuration.websocketProvider.on("close",this.configuration.onClose),this.configuration.websocketProvider.on("close",this.forwardClose),this.configuration.websocketProvider.on("status",this.boundOnStatus),this.configuration.websocketProvider.on("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.on("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.on("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.on("destroy",this.forwardDestroy),(t=this.awareness)===null||t===void 0||t.on("update",()=>{this.emit("awarenessUpdate",{states:Zh(this.awareness.getStates())})}),(r=this.awareness)===null||r===void 0||r.on("change",()=>{this.emit("awarenessChange",{states:Zh(this.awareness.getStates())})}),this.document.on("update",this.documentUpdateHandler.bind(this)),(s=this.awareness)===null||s===void 0||s.on("update",this.awarenessUpdateHandler.bind(this)),this.registerEventListeners(),this.configuration.forceSyncInterval&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.configuration.websocketProvider.attach(this)}onStatus({status:e}){this.status=e,this.configuration.onStatus({status:e}),this.emit("status",{status:e})}setConfiguration(e={}){if(!e.websocketProvider&&e.url){const t=e;this.configuration.websocketProvider=new _b({url:t.url,connect:t.connect,parameters:t.parameters})}this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit("unsyncedChanges",this.unsyncedChanges)}decrementUnsyncedChanges(){this.unsyncedChanges-=1,this.unsyncedChanges===0&&(this.synced=!0),this.emit("unsyncedChanges",this.unsyncedChanges)}forceSync(){this.send(Ac,{document:this.document,documentName:this.configuration.name})}pageUnload(){this.awareness&&Go(this.awareness,[this.document.clientID],"window unload")}registerEventListeners(){typeof window>"u"||window.addEventListener("unload",this.boundPageUnload)}sendStateless(e){this.send(x_,{documentName:this.configuration.name,payload:e})}documentUpdateHandler(e,t){t!==this&&(this.incrementUnsyncedChanges(),this.send(T_,{update:e,documentName:this.configuration.name},!0))}awarenessUpdateHandler({added:e,updated:t,removed:r},s){const i=e.concat(t).concat(r);this.send(Ro,{awareness:this.awareness,clients:i,documentName:this.configuration.name},!0)}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,this.emit("synced",{state:e}),this.emit("sync",{state:e}))}receiveStateless(e){this.emit("stateless",{payload:e})}get isAuthenticationRequired(){return!!this.configuration.token&&!this.isAuthenticated}async connect(){return this.configuration.broadcast&&this.subscribeToBroadcastChannel(),this.configuration.websocketProvider.connect()}disconnect(){this.disconnectBroadcastChannel(),this.configuration.websocketProvider.detach(this),this.isConnected=!1,this.configuration.preserveConnection||this.configuration.websocketProvider.disconnect()}async onOpen(e){this.isAuthenticated=!1,this.isConnected=!0,this.emit("open",{event:e});let t;try{t=await this.getToken()}catch(r){this.permissionDeniedHandler(`Failed to get token: ${r}`);return}this.isAuthenticationRequired&&this.send($_,{token:t,documentName:this.configuration.name}),this.startSync()}async getToken(){return typeof this.configuration.token=="function"?await this.configuration.token():this.configuration.token}startSync(){this.incrementUnsyncedChanges(),this.send(Ac,{document:this.document,documentName:this.configuration.name}),this.awareness&&this.awareness.getLocalState()!==null&&this.send(Ro,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.configuration.name})}send(e,t,r=!1){if(!this.isConnected)return;r&&this.mux(()=>{this.broadcast(e,t)});const s=new Dp(e,t);this.emit("outgoingMessage",{message:s.message}),s.send(this.configuration.websocketProvider)}onMessage(e){const t=new Yo(e.data),r=t.readVarString();t.writeVarString(r),this.emit("message",{event:e,message:new Yo(e.data)}),new Np(t).apply(this,!0)}onClose(e){this.isAuthenticated=!1,this.synced=!1,this.awareness&&Go(this.awareness,Array.from(this.awareness.getStates().keys()).filter(t=>t!==this.document.clientID),this)}destroy(){this.emit("destroy"),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(Go(this.awareness,[this.document.clientID],"provider destroy"),this.awareness.off("update",this.awarenessUpdateHandler),this.awareness.destroy()),this.document.off("update",this.documentUpdateHandler),this.removeAllListeners(),this.configuration.websocketProvider.off("connect",this.configuration.onConnect),this.configuration.websocketProvider.off("connect",this.forwardConnect),this.configuration.websocketProvider.off("open",this.boundOnOpen),this.configuration.websocketProvider.off("open",this.forwardOpen),this.configuration.websocketProvider.off("close",this.boundOnClose),this.configuration.websocketProvider.off("close",this.configuration.onClose),this.configuration.websocketProvider.off("close",this.forwardClose),this.configuration.websocketProvider.off("status",this.boundOnStatus),this.configuration.websocketProvider.off("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.off("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.off("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.off("destroy",this.forwardDestroy),this.send(A_,{documentName:this.configuration.name}),this.disconnect(),!(typeof window>"u")&&window.removeEventListener("unload",this.boundPageUnload)}permissionDeniedHandler(e){this.emit("authenticationFailed",{reason:e}),this.isAuthenticated=!1,this.disconnect(),this.status=et.Disconnected}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit("authenticated")}get broadcastChannel(){return`${this.configuration.name}`}broadcastChannelSubscriber(e){this.mux(()=>{const t=new Yo(e),r=t.readVarString();t.writeVarString(r),new Np(t).setBroadcasted(!0).apply(this,!1)})}subscribeToBroadcastChannel(){this.subscribedToBroadcastChannel||(d_(this.broadcastChannel,this.boundBroadcastChannelSubscriber),this.subscribedToBroadcastChannel=!0),this.mux(()=>{this.broadcast(Ac,{document:this.document,documentName:this.configuration.name}),this.broadcast(E_,{document:this.document,documentName:this.configuration.name}),this.broadcast(M_,{document:this.document,documentName:this.configuration.name}),this.awareness&&this.broadcast(Ro,{awareness:this.awareness,clients:[this.document.clientID],document:this.document,documentName:this.configuration.name})})}disconnectBroadcastChannel(){this.awareness&&this.send(Ro,{awareness:this.awareness,clients:[this.document.clientID],states:new Map,documentName:this.configuration.name},!0),this.subscribedToBroadcastChannel&&(f_(this.broadcastChannel,this.boundBroadcastChannelSubscriber),this.subscribedToBroadcastChannel=!1)}broadcast(e,t){this.configuration.broadcast&&this.subscribedToBroadcastChannel&&new Dp(e,t).broadcast(this.broadcastChannel)}setAwarenessField(e,t){if(!this.awareness)throw new O_(`Cannot set awareness field "${e}" to ${JSON.stringify(t)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,t)}}const N_=()=>{let n=!0;return(e,t)=>{if(n){n=!1;try{e()}finally{n=!0}}else t!==void 0&&t()}},D_=/[\uD800-\uDBFF]/,I_=/[\uDC00-\uDFFF]/,R_=(n,e)=>{let t=0,r=0;for(;t0&&D_.test(n[t-1])&&t--;r+t0&&I_.test(n[n.length-r])&&r--,{index:t,remove:n.length-t-r,insert:e.slice(t,e.length-r)}},L_=R_,qe=new wt("y-sync"),Jn=new wt("y-undo");new wt("yjs-cursor");const ra=(n,e)=>e===void 0?!n.deleted:e.sv.has(n.id.client)&&e.sv.get(n.id.client)>n.id.clock&&!ni(e.ds,n.id),P_=[{light:"#ecd44433",dark:"#ecd444"}],B_=(n,e,t)=>{if(!n.has(t)){if(n.sizer.add(s)),e=e.filter(s=>!r.has(s))}n.set(t,mT(e))}return n.get(t)},z_=(n,{colors:e=P_,colorMapping:t=new Map,permanentUserData:r=null,onFirstRender:s=()=>{}}={})=>{let i=!1,o;const l=new Qe({props:{editable:a=>{const c=qe.getState(a);return c.snapshot==null&&c.prevSnapshot==null}},key:qe,state:{init:(a,c)=>({type:n,doc:n.doc,binding:null,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:t,permanentUserData:r}),apply:(a,c)=>{const u=a.getMeta(qe);if(u!==void 0){c=Object.assign({},c);for(const d in u)c[d]=u[d]}return c.addToHistory=a.getMeta("addToHistory")!==!1,c.isChangeOrigin=u!==void 0&&!!u.isChangeOrigin,c.isUndoRedoOperation=u!==void 0&&!!u.isChangeOrigin&&!!u.isUndoRedoOperation,c.binding!==null&&u!==void 0&&(u.snapshot!=null||u.prevSnapshot!=null)&&Su(0,()=>{c.binding==null||c.binding.isDestroyed||(u.restore==null?c.binding._renderSnapshot(u.snapshot,u.prevSnapshot,c):(c.binding._renderSnapshot(u.snapshot,u.snapshot,c),delete c.restore,delete c.snapshot,delete c.prevSnapshot,c.binding.mux(()=>{c.binding._prosemirrorChanged(c.binding.prosemirrorView.state.doc)})))}),c}},view:a=>{const c=new F_(n,a);return o!=null&&o.destroy(),o=Su(0,()=>{c._forceRerender(),a.dispatch(a.state.tr.setMeta(qe,{binding:c})),s()}),{update:()=>{const u=l.getState(a.state);if(u.snapshot==null&&u.prevSnapshot==null&&(i||a.state.doc.content.findDiffStart(a.state.doc.type.createAndFill().content)!==null)){if(i=!0,u.addToHistory===!1&&!u.isChangeOrigin){const d=Jn.getState(a.state),f=d&&d.undoManager;f&&f.stopCapturing()}c.mux(()=>{u.doc.transact(d=>{d.meta.set("addToHistory",u.addToHistory),c._prosemirrorChanged(a.state.doc)},qe)})}},destroy:()=>{o.destroy(),c.destroy()}}}});return l},V_=(n,e,t)=>{if(e!==null&&e.anchor!==null&&e.head!==null){const r=Pp(t.doc,t.type,e.anchor,t.mapping),s=Pp(t.doc,t.type,e.head,t.mapping);r!==null&&s!==null&&(n=n.setSelection(te.create(n.doc,r,s)))}},Nu=(n,e)=>({anchor:Lp(e.selection.anchor,n.type,n.mapping),head:Lp(e.selection.head,n.type,n.mapping)});class F_{constructor(e,t){this.type=e,this.prosemirrorView=t,this.mux=N_(),this.isDestroyed=!1,this.mapping=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&(this.beforeTransactionSelection=Nu(this,t.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),e.observeDeep(this._observeFunction),this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(OT&&this._domSelectionInView===null&&(Su(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection(),t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);const s=t.getBoundingClientRect(),i=PT.documentElement;return s.bottom>=0&&s.right>=0&&s.left<=(window.innerWidth||i.clientWidth||0)&&s.top<=(window.innerHeight||i.clientHeight||0)}renderSnapshot(e,t){t||(t=Hy(_y(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(qe,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>Xo(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new B(E.from(e),0,0));t.setMeta(qe,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>Xo(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new B(E.from(e),0,0));this.prosemirrorView.dispatch(t.setMeta(qe,{isChangeOrigin:!0}))})}_renderSnapshot(e,t,r){e||(e=yO(this.doc)),this.mapping=new Map,this.mux(()=>{this.doc.transact(s=>{const i=r.permanentUserData;i&&i.dss.forEach(c=>{Er(s,c,u=>{})});const o=(c,u)=>{const d=c==="added"?i.getUserByClientId(u.client):i.getUserByDeletedId(u);return{user:d,type:c,color:B_(r.colorMapping,r.colors,d)}},l=Zy(this.type,new Id(t.ds,e.sv)).map(c=>!c._item.deleted||ra(c._item,e)||ra(c._item,t)?Xo(c,this.prosemirrorView.state.schema,new Map,e,t,o):null).filter(c=>c!==null),a=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new B(E.from(l),0,0));this.prosemirrorView.dispatch(a.setMeta(qe,{isChangeOrigin:!0}))},qe)})}_typeChanged(e,t){const r=qe.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const s=(l,a)=>this.mapping.delete(a);Er(t,t.deleteSet,l=>{if(l.constructor===Te){const a=l.content.type;a&&this.mapping.delete(a)}}),t.changed.forEach(s),t.changedParentTypes.forEach(s);const i=this.type.toArray().map(l=>Lb(l,this.prosemirrorView.state.schema,this.mapping)).filter(l=>l!==null);let o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new B(E.from(i),0,0));V_(o,this.beforeTransactionSelection,this),o=o.setMeta(qe,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof Jy}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&o.scrollIntoView(),this.prosemirrorView.dispatch(o)})}_prosemirrorChanged(e){this.doc.transact(()=>{Iu(this.doc,this.type,e,this.mapping),this.beforeTransactionSelection=Nu(this,this.prosemirrorView.state)},qe)}destroy(){this.isDestroyed=!0,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions)}}const Lb=(n,e,t,r,s,i)=>{const o=t.get(n);if(o===void 0){if(n instanceof Dt)return Xo(n,e,t,r,s,i);throw un()}return o},Xo=(n,e,t,r,s,i)=>{const o=[],l=a=>{if(a.constructor===Dt){const c=Lb(a,e,t,r,s,i);c!==null&&o.push(c)}else{const c=H_(a,e,t,r,s,i);c!==null&&c.forEach(u=>{u!==null&&o.push(u)})}};r===void 0||s===void 0?n.toArray().forEach(l):Zy(n,new Id(s.ds,r.sv)).forEach(l);try{const a=n.getAttributes(r);r!==void 0&&(ra(n._item,r)?ra(n._item,s)||(a.ychange=i?i("added",n._item.id):{type:"added"}):a.ychange=i?i("removed",n._item.id):{type:"removed"});const c=e.node(n.nodeName,a,o);return t.set(n,c),c}catch{return n.doc.transact(c=>{n._item.delete(c)},qe),t.delete(n),null}},H_=(n,e,t,r,s,i)=>{const o=[],l=n.toDelta(r,s,i);try{for(let a=0;a{n._item.delete(c)},qe),null}return o},U_=(n,e)=>{const t=new jt,r=n.map(s=>({insert:s.text,attributes:Bb(s.marks)}));return t.applyDelta(r),e.set(t,n),t},j_=(n,e)=>{const t=new Dt(n.type.name);for(const r in n.attrs){const s=n.attrs[r];s!==null&&r!=="ychange"&&t.setAttribute(r,s)}return t.insert(0,Na(n).map(r=>Du(r,e))),e.set(t,n),t},Du=(n,e)=>n instanceof Array?U_(n,e):j_(n,e),Ip=n=>typeof n=="object"&&n!==null,Kd=(n,e)=>{const t=Object.keys(n).filter(s=>n[s]!==null);let r=t.length===Object.keys(e).filter(s=>e[s]!==null).length;for(let s=0;s{const e=n.content.content,t=[];for(let r=0;r{const t=n.toDelta();return t.length===e.length&&t.every((r,s)=>r.insert===e[s].text&&Cy(r.attributes||{}).length===e[s].marks.length&&e[s].marks.every(i=>Kd(r.attributes[i.type.name]||{},i.attrs)))},lo=(n,e)=>{if(n instanceof Dt&&!(e instanceof Array)&&Ru(n,e)){const t=Na(e);return n._length===t.length&&Kd(n.getAttributes(),e.attrs)&&n.toArray().every((r,s)=>lo(r,t[s]))}return n instanceof jt&&e instanceof Array&&Pb(n,e)},sa=(n,e)=>n===e||n instanceof Array&&e instanceof Array&&n.length===e.length&&n.every((t,r)=>e[r]===t),Rp=(n,e,t)=>{const r=n.toArray(),s=Na(e),i=s.length,o=r.length,l=Sa(o,i);let a=0,c=0,u=!1;for(;a{let e="",t=n._start;const r={};for(;t!==null;)t.deleted||(t.countable&&t.content instanceof hn?e+=t.content.str:t.content instanceof Ge&&(r[t.content.key]=null)),t=t.right;return{str:e,nAttrs:r}},q_=(n,e,t)=>{t.set(n,e);const{nAttrs:r,str:s}=W_(n),i=e.map(c=>({insert:c.text,attributes:Object.assign({},r,Bb(c.marks))})),{insert:o,remove:l,index:a}=L_(s,i.map(c=>c.insert).join(""));n.delete(a,l),n.insert(a,o),n.applyDelta(i.map(c=>({retain:c.insert.length,attributes:c.attributes})))},Bb=n=>{const e={};return n.forEach(t=>{t.type.name!=="ychange"&&(e[t.type.name]=t.attrs)}),e},Iu=(n,e,t,r)=>{if(e instanceof Dt&&e.nodeName!==t.type.name)throw new Error("node name mismatch!");if(r.set(e,t),e instanceof Dt){const d=e.getAttributes(),f=t.attrs;for(const h in f)f[h]!==null?d[h]!==f[h]&&h!=="ychange"&&e.setAttribute(h,f[h]):e.removeAttribute(h);for(const h in d)f[h]===void 0&&e.removeAttribute(h)}const s=Na(t),i=s.length,o=e.toArray(),l=o.length,a=Sa(i,l);let c=0,u=0;for(;c{for(;l-c-u>0&&i-c-u>0;){const f=o[c],h=s[c],p=o[l-u-1],m=s[i-u-1];if(f instanceof jt&&h instanceof Array)Pb(f,h)||q_(f,h,r),c+=1;else{let g=f instanceof Dt&&Ru(f,h),y=p instanceof Dt&&Ru(p,m);if(g&&y){const w=Rp(f,h,r),x=Rp(p,m,r);w.foundMappedChild&&!x.foundMappedChild?y=!1:!w.foundMappedChild&&x.foundMappedChild||w.equalityFactor0&&(e.slice(c,c+d).forEach(f=>r.delete(f)),e.delete(c,d)),c+u!(e instanceof Array)&&n.nodeName===e.type.name,Lp=(n,e,t)=>{if(n===0)return kc(e,0);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof jt){if(r._length>=n)return kc(r,n);if(n-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,n--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const s=(t.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&n1)return new Kl(r._item===null?null:r._item.id,r._item===null?to(r):null,null);if(n-=s,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(n===0)return r=r._item===null?r:r._item.parent,new Kl(r._item===null?null:r._item.id,r._item===null?to(r):null,null);do r=r._item.parent,n--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw tn();if(n===0&&r.constructor!==jt&&r!==e)return J_(r._item.parent,r._item)}return kc(e,e._length)},J_=(n,e)=>{let t=null,r=null;return n._item===null?r=to(n):t=re(n._item.id.client,n._item.id.clock),new Kl(t,r,e.id)},Pp=(n,e,t,r)=>{const s=gO(t,n);if(s===null||s.type!==e&&!no(e,s.type._item))return null;let i=s.type,o=0;if(i.constructor===jt)o=s.index;else if(i._item===null||!i._item.deleted){let l=i._first,a=0;for(;a{const e=Jn.getState(n).undoManager;if(e!=null)return e.undo(),!0},G_=n=>{const e=Jn.getState(n).undoManager;if(e!=null)return e.redo(),!0},Y_=new Set(["paragraph"]),X_=(n,e)=>!(n instanceof Te)||!(n.content instanceof mn)||!(n.content.type instanceof ls||n.content.type instanceof Dt&&e.has(n.content.type.nodeName))||n.content.type._length===0,Q_=({protectedNodes:n=Y_,trackedOrigins:e=[],undoManager:t=null}={})=>new Qe({key:Jn,state:{init:(r,s)=>{const i=qe.getState(s),o=t||new Jy(i.type,{trackedOrigins:new Set([qe].concat(e)),deleteFilter:l=>X_(l,n),captureTransaction:l=>l.meta.get("addToHistory")!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(r,s,i,o)=>{const l=qe.getState(o).binding,a=s.undoManager,c=a.undoStack.length>0,u=a.redoStack.length>0;return l?{undoManager:a,prevSel:Nu(l,i),hasUndoOps:c,hasRedoOps:u}:c!==s.hasUndoOps||u!==s.hasRedoOps?Object.assign({},s,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):s}},view:r=>{const s=qe.getState(r.state),i=Jn.getState(r.state).undoManager;return i.on("stack-item-added",({stackItem:o})=>{const l=s.binding;l&&o.meta.set(l,Jn.getState(r.state).prevSel)}),i.on("stack-item-popped",({stackItem:o})=>{const l=s.binding;l&&(l.beforeTransactionSelection=o.meta.get(l)||l.beforeTransactionSelection)}),{destroy:()=>{i.destroy()}}}}),Z_=ft.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},onCreate(){this.editor.extensionManager.extensions.find(n=>n.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:n,state:e,dispatch:t})=>(n.setMeta("preventDispatch",!0),Jn.getState(e).undoManager.undoStack.length===0?!1:t?K_(e):!0),redo:()=>({tr:n,state:e,dispatch:t})=>(n.setMeta("preventDispatch",!0),Jn.getState(e).undoManager.redoStack.length===0?!1:t?G_(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){const n=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),e=Q_(),t=e.spec.view;e.spec.view=o=>{const{undoManager:l}=Jn.getState(o.state);l.restore&&(l.restore(),l.restore=()=>{});const a=t?t(o):void 0;return{destroy:()=>{const c=l.trackedOrigins.has(l),u=l._observers;l.restore=()=>{c&&l.trackedOrigins.add(l),l.doc.on("afterTransaction",l.afterTransactionHandler),l._observers=u},a!=null&&a.destroy&&a.destroy()}}};const r=this.options.onFirstRender;return[z_(n,r?{onFirstRender:r}:{}),e]}});function eN(n,e){return[fy.configure({history:!1}),Z_.configure({document:n.document}),Qg.configure({element:e}),sy.configure({openOnClick:!1,autolink:!0}),hy.configure({inline:!0}),oy.configure({types:["heading","paragraph"]}),iy]}function Bp(n){let e,t,r,s,i,o,l,a,c,u,d,f,h,p,m,g,y,w,x,b,L,S,z,ee,$,Z,X,A,P,F,W,H,V,J,G,le,ce,pe,ue,Ye,Re,Oe,je,We,He,At,pt,Qn,Mt,Zn,xt,Ln,vt,er,Et,Pt,Ze,gn,nn,tr;return r=new Ce({props:{class:"h-8 px-2 max-lg:hidden",$$slots:{default:[tN]},$$scope:{ctx:n}}}),r.$on("click",n[6]),i=new Ce({props:{disabled:!n[1].can().chain().focus().toggleBold().run(),variant:n[1].isActive("bold")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[nN]},$$scope:{ctx:n}}}),i.$on("click",n[7]),l=new Ce({props:{disabled:!n[1].can().chain().focus().toggleItalic().run(),variant:n[1].isActive("italic")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[rN]},$$scope:{ctx:n}}}),l.$on("click",n[8]),c=new Ce({props:{disabled:!n[1].can().chain().focus().toggleStrike().run(),variant:n[1].isActive("strike")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[sN]},$$scope:{ctx:n}}}),c.$on("click",n[9]),d=new Ce({props:{disabled:!n[1].can().chain().focus().toggleCode().run(),variant:n[1].isActive("code")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[iN]},$$scope:{ctx:n}}}),d.$on("click",n[10]),h=new Ce({props:{variant:n[1].isActive("paragraph")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[oN]},$$scope:{ctx:n}}}),h.$on("click",n[11]),m=new Ce({props:{variant:n[1].isActive("heading",{level:1})?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[lN]},$$scope:{ctx:n}}}),m.$on("click",n[12]),y=new Ce({props:{variant:n[1].isActive("heading",{level:2})?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[aN]},$$scope:{ctx:n}}}),y.$on("click",n[13]),x=new Ce({props:{variant:n[1].isActive("heading",{level:3})?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[cN]},$$scope:{ctx:n}}}),x.$on("click",n[14]),L=new Ce({props:{class:"h-8 px-2 max-lg:hidden",variant:n[1].isActive({textAlign:"left"})?"default":"secondary",$$slots:{default:[uN]},$$scope:{ctx:n}}}),L.$on("click",n[15]),z=new Ce({props:{class:"h-8 px-2 max-lg:hidden",variant:n[1].isActive({textAlign:"center"})?"default":"secondary",$$slots:{default:[dN]},$$scope:{ctx:n}}}),z.$on("click",n[16]),$=new Ce({props:{class:"h-8 px-2 max-lg:hidden",variant:n[1].isActive({textAlign:"right"})?"default":"secondary",$$slots:{default:[fN]},$$scope:{ctx:n}}}),$.$on("click",n[17]),X=new Ce({props:{variant:n[1].isActive("bulletList")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[hN]},$$scope:{ctx:n}}}),X.$on("click",n[18]),P=new Ce({props:{variant:n[1].isActive("orderedList")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[pN]},$$scope:{ctx:n}}}),P.$on("click",n[19]),W=new Ce({props:{variant:n[1].isActive("codeBlock")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[mN]},$$scope:{ctx:n}}}),W.$on("click",n[20]),V=new Ce({props:{variant:n[1].isActive("blockquote")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[gN]},$$scope:{ctx:n}}}),V.$on("click",n[21]),G=new Ce({props:{class:"h-8 px-2 max-lg:hidden",$$slots:{default:[yN]},$$scope:{ctx:n}}}),G.$on("click",n[22]),ce=new Ce({props:{variant:n[1].isActive("link")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[bN]},$$scope:{ctx:n}}}),ce.$on("click",n[23]),ue=new Ce({props:{disabled:!n[1].isActive("link"),class:"h-8 px-2 max-lg:hidden",$$slots:{default:[wN]},$$scope:{ctx:n}}}),ue.$on("click",n[24]),Re=new Ce({props:{class:"h-8 px-2",$$slots:{default:[vN]},$$scope:{ctx:n}}}),Re.$on("click",n[25]),je=new Ce({props:{disabled:!n[1].can().chain().focus().undo().run(),class:"h-8 px-2",$$slots:{default:[kN]},$$scope:{ctx:n}}}),je.$on("click",n[26]),He=new Ce({props:{disabled:!n[1].can().chain().focus().redo().run(),class:"h-8 px-2",$$slots:{default:[SN]},$$scope:{ctx:n}}}),He.$on("click",n[27]),pt=new Ce({props:{class:"h-8 px-2",$$slots:{default:[CN]},$$scope:{ctx:n}}}),pt.$on("click",n[28]),xt=new Ce({props:{class:"h-8 px-2",$$slots:{default:[$N]},$$scope:{ctx:n}}}),xt.$on("click",n[31]),vt=new Ce({props:{class:"h-8 px-2",$$slots:{default:[AN]},$$scope:{ctx:n}}}),vt.$on("click",DN),Et=new Ce({props:{disabled:!n[4],class:"h-8 px-2",$$slots:{default:[MN]},$$scope:{ctx:n}}}),Et.$on("click",n[5]),Ze=new Ce({props:{class:"h-8 px-2",$$slots:{default:[xN]},$$scope:{ctx:n}}}),Ze.$on("click",jb),{c(){e=wr("div"),t=wr("nav"),O(r.$$.fragment),s=ye(),O(i.$$.fragment),o=ye(),O(l.$$.fragment),a=ye(),O(c.$$.fragment),u=ye(),O(d.$$.fragment),f=ye(),O(h.$$.fragment),p=ye(),O(m.$$.fragment),g=ye(),O(y.$$.fragment),w=ye(),O(x.$$.fragment),b=ye(),O(L.$$.fragment),S=ye(),O(z.$$.fragment),ee=ye(),O($.$$.fragment),Z=ye(),O(X.$$.fragment),A=ye(),O(P.$$.fragment),F=ye(),O(W.$$.fragment),H=ye(),O(V.$$.fragment),J=ye(),O(G.$$.fragment),le=ye(),O(ce.$$.fragment),pe=ye(),O(ue.$$.fragment),Ye=ye(),O(Re.$$.fragment),Oe=ye(),O(je.$$.fragment),We=ye(),O(He.$$.fragment),At=ye(),O(pt.$$.fragment),Qn=ye(),Mt=wr("input"),Zn=ye(),O(xt.$$.fragment),Ln=ye(),O(vt.$$.fragment),er=ye(),O(Et.$$.fragment),Pt=ye(),O(Ze.$$.fragment),this.h()},l(M){e=vr(M,"DIV",{});var I=Kn(e);t=vr(I,"NAV",{class:!0});var U=Kn(t);_(r.$$.fragment,U),s=be(U),_(i.$$.fragment,U),o=be(U),_(l.$$.fragment,U),a=be(U),_(c.$$.fragment,U),u=be(U),_(d.$$.fragment,U),f=be(U),_(h.$$.fragment,U),p=be(U),_(m.$$.fragment,U),g=be(U),_(y.$$.fragment,U),w=be(U),_(x.$$.fragment,U),b=be(U),_(L.$$.fragment,U),S=be(U),_(z.$$.fragment,U),ee=be(U),_($.$$.fragment,U),Z=be(U),_(X.$$.fragment,U),A=be(U),_(P.$$.fragment,U),F=be(U),_(W.$$.fragment,U),H=be(U),_(V.$$.fragment,U),J=be(U),_(G.$$.fragment,U),le=be(U),_(ce.$$.fragment,U),pe=be(U),_(ue.$$.fragment,U),Ye=be(U),_(Re.$$.fragment,U),Oe=be(U),_(je.$$.fragment,U),We=be(U),_(He.$$.fragment,U),At=be(U),_(pt.$$.fragment,U),Qn=be(U),Mt=vr(U,"INPUT",{type:!0,id:!0,style:!0}),Zn=be(U),_(xt.$$.fragment,U),Ln=be(U),_(vt.$$.fragment,U),er=be(U),_(Et.$$.fragment,U),Pt=be(U),_(Ze.$$.fragment,U),U.forEach(Le),I.forEach(Le),this.h()},h(){Lo(Mt,"type","file"),Lo(Mt,"id","selectedFile"),Ub(Mt,"display","none"),Lo(t,"class","fixed left-0 top-0 z-10 w-full bg-white py-4 text-center dark:bg-[color:hsl(240,10%,3.9%)] max-lg:px-4 max-lg:text-left max-md:p-2")},m(M,I){ut(M,e,I),Ee(e,t),N(r,t,null),Ee(t,s),N(i,t,null),Ee(t,o),N(l,t,null),Ee(t,a),N(c,t,null),Ee(t,u),N(d,t,null),Ee(t,f),N(h,t,null),Ee(t,p),N(m,t,null),Ee(t,g),N(y,t,null),Ee(t,w),N(x,t,null),Ee(t,b),N(L,t,null),Ee(t,S),N(z,t,null),Ee(t,ee),N($,t,null),Ee(t,Z),N(X,t,null),Ee(t,A),N(P,t,null),Ee(t,F),N(W,t,null),Ee(t,H),N(V,t,null),Ee(t,J),N(G,t,null),Ee(t,le),N(ce,t,null),Ee(t,pe),N(ue,t,null),Ee(t,Ye),N(Re,t,null),Ee(t,Oe),N(je,t,null),Ee(t,We),N(He,t,null),Ee(t,At),N(pt,t,null),Ee(t,Qn),Ee(t,Mt),Ee(t,Zn),N(xt,t,null),Ee(t,Ln),N(vt,t,null),Ee(t,er),N(Et,t,null),Ee(t,Pt),N(Ze,t,null),gn=!0,nn||(tr=[Ot(Mt,"change",n[29]),Ot(Mt,"change",n[30])],nn=!0)},p(M,I){const U={};I[1]&256&&(U.$$scope={dirty:I,ctx:M}),r.$set(U);const Pn={};I[0]&2&&(Pn.disabled=!M[1].can().chain().focus().toggleBold().run()),I[0]&2&&(Pn.variant=M[1].isActive("bold")?"default":"secondary"),I[1]&256&&(Pn.$$scope={dirty:I,ctx:M}),i.$set(Pn);const hs={};I[0]&2&&(hs.disabled=!M[1].can().chain().focus().toggleItalic().run()),I[0]&2&&(hs.variant=M[1].isActive("italic")?"default":"secondary"),I[1]&256&&(hs.$$scope={dirty:I,ctx:M}),l.$set(hs);const ps={};I[0]&2&&(ps.disabled=!M[1].can().chain().focus().toggleStrike().run()),I[0]&2&&(ps.variant=M[1].isActive("strike")?"default":"secondary"),I[1]&256&&(ps.$$scope={dirty:I,ctx:M}),c.$set(ps);const ms={};I[0]&2&&(ms.disabled=!M[1].can().chain().focus().toggleCode().run()),I[0]&2&&(ms.variant=M[1].isActive("code")?"default":"secondary"),I[1]&256&&(ms.$$scope={dirty:I,ctx:M}),d.$set(ms);const li={};I[0]&2&&(li.variant=M[1].isActive("paragraph")?"default":"secondary"),I[1]&256&&(li.$$scope={dirty:I,ctx:M}),h.$set(li);const ai={};I[0]&2&&(ai.variant=M[1].isActive("heading",{level:1})?"default":"secondary"),I[1]&256&&(ai.$$scope={dirty:I,ctx:M}),m.$set(ai);const C={};I[0]&2&&(C.variant=M[1].isActive("heading",{level:2})?"default":"secondary"),I[1]&256&&(C.$$scope={dirty:I,ctx:M}),y.$set(C);const j={};I[0]&2&&(j.variant=M[1].isActive("heading",{level:3})?"default":"secondary"),I[1]&256&&(j.$$scope={dirty:I,ctx:M}),x.$set(j);const Q={};I[0]&2&&(Q.variant=M[1].isActive({textAlign:"left"})?"default":"secondary"),I[1]&256&&(Q.$$scope={dirty:I,ctx:M}),L.$set(Q);const ge={};I[0]&2&&(ge.variant=M[1].isActive({textAlign:"center"})?"default":"secondary"),I[1]&256&&(ge.$$scope={dirty:I,ctx:M}),z.$set(ge);const de={};I[0]&2&&(de.variant=M[1].isActive({textAlign:"right"})?"default":"secondary"),I[1]&256&&(de.$$scope={dirty:I,ctx:M}),$.$set(de);const Xe={};I[0]&2&&(Xe.variant=M[1].isActive("bulletList")?"default":"secondary"),I[1]&256&&(Xe.$$scope={dirty:I,ctx:M}),X.$set(Xe);const mt={};I[0]&2&&(mt.variant=M[1].isActive("orderedList")?"default":"secondary"),I[1]&256&&(mt.$$scope={dirty:I,ctx:M}),P.$set(mt);const yn={};I[0]&2&&(yn.variant=M[1].isActive("codeBlock")?"default":"secondary"),I[1]&256&&(yn.$$scope={dirty:I,ctx:M}),W.$set(yn);const gs={};I[0]&2&&(gs.variant=M[1].isActive("blockquote")?"default":"secondary"),I[1]&256&&(gs.$$scope={dirty:I,ctx:M}),V.$set(gs);const bn={};I[1]&256&&(bn.$$scope={dirty:I,ctx:M}),G.$set(bn);const Ir={};I[0]&2&&(Ir.variant=M[1].isActive("link")?"default":"secondary"),I[1]&256&&(Ir.$$scope={dirty:I,ctx:M}),ce.$set(Ir);const nr={};I[0]&2&&(nr.disabled=!M[1].isActive("link")),I[1]&256&&(nr.$$scope={dirty:I,ctx:M}),ue.$set(nr);const Bn={};I[1]&256&&(Bn.$$scope={dirty:I,ctx:M}),Re.$set(Bn);const ci={};I[0]&2&&(ci.disabled=!M[1].can().chain().focus().undo().run()),I[1]&256&&(ci.$$scope={dirty:I,ctx:M}),je.$set(ci);const Rr={};I[0]&2&&(Rr.disabled=!M[1].can().chain().focus().redo().run()),I[1]&256&&(Rr.$$scope={dirty:I,ctx:M}),He.$set(Rr);const Lr={};I[1]&256&&(Lr.$$scope={dirty:I,ctx:M}),pt.$set(Lr);const Gd={};I[1]&256&&(Gd.$$scope={dirty:I,ctx:M}),xt.$set(Gd);const Yd={};I[1]&256&&(Yd.$$scope={dirty:I,ctx:M}),vt.$set(Yd);const Da={};I[0]&16&&(Da.disabled=!M[4]),I[1]&256&&(Da.$$scope={dirty:I,ctx:M}),Et.$set(Da);const Xd={};I[1]&256&&(Xd.$$scope={dirty:I,ctx:M}),Ze.$set(Xd)},i(M){gn||(v(r.$$.fragment,M),v(i.$$.fragment,M),v(l.$$.fragment,M),v(c.$$.fragment,M),v(d.$$.fragment,M),v(h.$$.fragment,M),v(m.$$.fragment,M),v(y.$$.fragment,M),v(x.$$.fragment,M),v(L.$$.fragment,M),v(z.$$.fragment,M),v($.$$.fragment,M),v(X.$$.fragment,M),v(P.$$.fragment,M),v(W.$$.fragment,M),v(V.$$.fragment,M),v(G.$$.fragment,M),v(ce.$$.fragment,M),v(ue.$$.fragment,M),v(Re.$$.fragment,M),v(je.$$.fragment,M),v(He.$$.fragment,M),v(pt.$$.fragment,M),v(xt.$$.fragment,M),v(vt.$$.fragment,M),v(Et.$$.fragment,M),v(Ze.$$.fragment,M),gn=!0)},o(M){k(r.$$.fragment,M),k(i.$$.fragment,M),k(l.$$.fragment,M),k(c.$$.fragment,M),k(d.$$.fragment,M),k(h.$$.fragment,M),k(m.$$.fragment,M),k(y.$$.fragment,M),k(x.$$.fragment,M),k(L.$$.fragment,M),k(z.$$.fragment,M),k($.$$.fragment,M),k(X.$$.fragment,M),k(P.$$.fragment,M),k(W.$$.fragment,M),k(V.$$.fragment,M),k(G.$$.fragment,M),k(ce.$$.fragment,M),k(ue.$$.fragment,M),k(Re.$$.fragment,M),k(je.$$.fragment,M),k(He.$$.fragment,M),k(pt.$$.fragment,M),k(xt.$$.fragment,M),k(vt.$$.fragment,M),k(Et.$$.fragment,M),k(Ze.$$.fragment,M),gn=!1},d(M){M&&Le(e),D(r),D(i),D(l),D(c),D(d),D(h),D(m),D(y),D(x),D(L),D(z),D($),D(X),D(P),D(W),D(V),D(G),D(ce),D(ue),D(Re),D(je),D(He),D(pt),D(xt),D(vt),D(Et),D(Ze),nn=!1,Lu(tr)}}}function tN(n){let e,t;return e=new EC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function nN(n){let e,t;return e=new Og({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function rN(n){let e,t;return e=new Ng({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function sN(n){let e,t;return e=new Dg({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function iN(n){let e,t;return e=new _g({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function oN(n){let e,t;return e=new E$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function lN(n){let e,t;return e=new JC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function aN(n){let e,t;return e=new XC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function cN(n){let e,t;return e=new t$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function uN(n){let e,t;return e=new yC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function dN(n){let e,t;return e=new hC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function fN(n){let e,t;return e=new kC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function hN(n){let e,t;return e=new $$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function pN(n){let e,t;return e=new v$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function mN(n){let e,t;return e=new NC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function gN(n){let e,t;return e=new tA({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function yN(n){let e,t;return e=new j$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function bN(n){let e,t;return e=new g$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function wN(n){let e,t;return e=new f$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function vN(n){let e,t;return e=new i$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function kN(n){let e,t;return e=new iA({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function SN(n){let e,t;return e=new N$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function CN(n){let e,t;return e=new zC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function $N(n){let e,t;return e=new UC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function AN(n){let e,t;return e=new V$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function MN(n){let e,t;return e=new L$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function xN(n){let e,t;return e=new X$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function zp(n){let e,t,r,s,i,o,l,a;return e=new Ce({props:{variant:n[1].isActive("bold")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[EN]},$$scope:{ctx:n}}}),e.$on("click",n[32]),r=new Ce({props:{variant:n[1].isActive("italic")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[TN]},$$scope:{ctx:n}}}),r.$on("click",n[33]),i=new Ce({props:{variant:n[1].isActive("strike")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[ON]},$$scope:{ctx:n}}}),i.$on("click",n[34]),l=new Ce({props:{variant:n[1].isActive("code")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[_N]},$$scope:{ctx:n}}}),l.$on("click",n[35]),{c(){O(e.$$.fragment),t=ye(),O(r.$$.fragment),s=ye(),O(i.$$.fragment),o=ye(),O(l.$$.fragment)},l(c){_(e.$$.fragment,c),t=be(c),_(r.$$.fragment,c),s=be(c),_(i.$$.fragment,c),o=be(c),_(l.$$.fragment,c)},m(c,u){N(e,c,u),ut(c,t,u),N(r,c,u),ut(c,s,u),N(i,c,u),ut(c,o,u),N(l,c,u),a=!0},p(c,u){const d={};u[0]&2&&(d.variant=c[1].isActive("bold")?"default":"secondary"),u[1]&256&&(d.$$scope={dirty:u,ctx:c}),e.$set(d);const f={};u[0]&2&&(f.variant=c[1].isActive("italic")?"default":"secondary"),u[1]&256&&(f.$$scope={dirty:u,ctx:c}),r.$set(f);const h={};u[0]&2&&(h.variant=c[1].isActive("strike")?"default":"secondary"),u[1]&256&&(h.$$scope={dirty:u,ctx:c}),i.$set(h);const p={};u[0]&2&&(p.variant=c[1].isActive("code")?"default":"secondary"),u[1]&256&&(p.$$scope={dirty:u,ctx:c}),l.$set(p)},i(c){a||(v(e.$$.fragment,c),v(r.$$.fragment,c),v(i.$$.fragment,c),v(l.$$.fragment,c),a=!0)},o(c){k(e.$$.fragment,c),k(r.$$.fragment,c),k(i.$$.fragment,c),k(l.$$.fragment,c),a=!1},d(c){c&&(Le(t),Le(s),Le(o)),D(e,c),D(r,c),D(i,c),D(l,c)}}}function EN(n){let e,t;return e=new Og({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function TN(n){let e,t;return e=new Ng({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function ON(n){let e,t;return e=new Dg({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function _N(n){let e,t;return e=new _g({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function NN(n){let e,t,r,s,i,o=n[1]&&Bp(n),l=n[1]&&zp(n);return{c(){o&&o.c(),e=ye(),t=wr("div"),l&&l.c(),r=ye(),s=wr("div"),this.h()},l(a){o&&o.l(a),e=be(a),t=vr(a,"DIV",{class:!0});var c=Kn(t);l&&l.l(c),c.forEach(Le),r=be(a),s=vr(a,"DIV",{}),Kn(s).forEach(Le),this.h()},h(){Lo(t,"class","bubble-menu rounded-md")},m(a,c){o&&o.m(a,c),ut(a,e,c),ut(a,t,c),l&&l.m(t,null),n[36](t),ut(a,r,c),ut(a,s,c),n[37](s),i=!0},p(a,c){a[1]?o?(o.p(a,c),c[0]&2&&v(o,1)):(o=Bp(a),o.c(),v(o,1),o.m(e.parentNode,e)):o&&(xc(),k(o,1,1,()=>{o=null}),Ec()),a[1]?l?(l.p(a,c),c[0]&2&&v(l,1)):(l=zp(a),l.c(),v(l,1),l.m(t,null)):l&&(xc(),k(l,1,1,()=>{l=null}),Ec())},i(a){i||(v(o),v(l),i=!0)},o(a){k(o),k(l),i=!1},d(a){a&&(Le(e),Le(t),Le(r),Le(s)),o&&o.d(a),l&&l.d(),n[36](null),n[37](null)}}}function DN(){const n=window.prompt("Please insert metadata for collaboration",'{"url":"ws://localhost:1234","name":"example-document"}');if(n)try{const{url:e,name:t}=JSON.parse(n);if(!e)throw new Error("url does not exist on meatadata");if(!t)throw new Error("name does not exist on meatadata");localStorage.setItem("collab",n),location.reload()}catch(e){console.error(e),window.alert("Invalid metadata format")}}function IN(n,e,t){let r,s,i,o,l="",a;Fb(async()=>{const Oe=localStorage.getItem("collab");let je;if(Oe)try{const{url:We,name:He}=JSON.parse(Oe),At=new _b({url:We,maxAttempts:2});t(4,a=new __({websocketProvider:At,name:He,onConnect(){window.alert(`Connected to ${We}/${He}`)},connect:!1})),await a.connect(),je=eN(a,i)}catch(We){window.alert(`Failed to start a collaboration with ${Oe}`),console.error(We),localStorage.removeItem("collab"),location.reload()}else je=dE(i),l=localStorage.getItem("auto-saved")??oA;t(1,s=new Pk({element:r,editorProps:{attributes:{class:"md:mt-16 mt-12 md:w-[708px] md:py-16 md:px-2 md:mx-auto p-4 outline-none"}},extensions:je,onUpdate({editor:We}){try{localStorage.setItem("auto-saved",We.getHTML())}catch(He){console.error(He)}},content:l,onTransaction:()=>{t(1,s)}})),s.commands.focus()});function c(){localStorage.removeItem("collab"),a&&(window.alert("Disconnecting..."),location.reload())}const u=()=>dA(s),d=()=>s.chain().focus().toggleBold().run(),f=()=>s.chain().focus().toggleItalic().run(),h=()=>s.chain().focus().toggleStrike().run(),p=()=>s.chain().focus().toggleCode().run(),m=()=>s.chain().focus().setParagraph().run(),g=()=>s.chain().focus().toggleHeading({level:1}).run(),y=()=>s.chain().focus().toggleHeading({level:2}).run(),w=()=>s.chain().focus().toggleHeading({level:3}).run(),x=()=>s.chain().focus().setTextAlign("left").run(),b=()=>s.chain().focus().setTextAlign("center").run(),L=()=>s.chain().focus().setTextAlign("right").run(),S=()=>s.chain().focus().toggleBulletList().run(),z=()=>s.chain().focus().toggleOrderedList().run(),ee=()=>s.chain().focus().toggleCodeBlock().run(),$=()=>s.chain().focus().toggleBlockquote().run(),Z=()=>s.chain().focus().setHorizontalRule().run(),X=()=>uA(s),A=()=>s.chain().focus().unsetLink().run(),P=()=>fA(s),F=()=>s.chain().focus().undo().run(),W=()=>s.chain().focus().redo().run(),H=()=>aA(s);function V(){o=this.files,t(3,o)}const J=()=>cA(s,o),G=()=>{var Oe;return(Oe=document.getElementById("selectedFile"))==null?void 0:Oe.click()},le=()=>s.chain().focus().toggleBold().run(),ce=()=>s.chain().focus().toggleItalic().run(),pe=()=>s.chain().focus().toggleStrike().run(),ue=()=>s.chain().focus().toggleCode().run();function Ye(Oe){Mc[Oe?"unshift":"push"](()=>{i=Oe,t(2,i)})}function Re(Oe){Mc[Oe?"unshift":"push"](()=>{r=Oe,t(0,r)})}return[r,s,i,o,a,c,u,d,f,h,p,m,g,y,w,x,b,L,S,z,ee,$,Z,X,A,P,F,W,H,V,J,G,le,ce,pe,ue,Ye,Re]}class RN extends ve{constructor(e){super(),ke(this,e,IN,NN,me,{},null,[-1,-1])}}function LN(n){let e,t,r;return t=new RN({}),{c(){e=wr("main"),O(t.$$.fragment)},l(s){e=vr(s,"MAIN",{});var i=Kn(e);_(t.$$.fragment,i),i.forEach(Le)},m(s,i){ut(s,e,i),N(t,e,null),r=!0},p:we,i(s){r||(v(t.$$.fragment,s),r=!0)},o(s){k(t.$$.fragment,s),r=!1},d(s){s&&Le(e),D(t)}}}class QN extends ve{constructor(e){super(),ke(this,e,null,LN,me,{})}}export{QN as component}; +`?o.insert.slice(0,-1):o.insert;(typeof l!="string"||l.length>0)&&Sc(r,this,s,l,o.attributes||{})}else o.retain!==void 0?Cp(r,this,s,o.retain,o.attributes||{}):o.delete!==void 0&&$p(r,s,o.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,r){const s=[],i=new Map,o=this.doc;let l="",a=this._start;function c(){if(l.length>0){const d={};let f=!1;i.forEach((p,m)=>{f=!0,d[m]=p});const h={insert:l};f&&(h.attributes=d),s.push(h),l=""}}const u=()=>{for(;a!==null;){if(zr(a,e)||t!==void 0&&zr(a,t))switch(a.content.constructor){case hn:{const d=i.get("ychange");e!==void 0&&!zr(a,e)?(d===void 0||d.user!==a.id.client||d.type!=="removed")&&(c(),i.set("ychange",r?r("removed",a.id):{type:"removed"})):t!==void 0&&!zr(a,t)?(d===void 0||d.user!==a.id.client||d.type!=="added")&&(c(),i.set("ychange",r?r("added",a.id):{type:"added"})):d!==void 0&&(c(),i.delete("ychange")),l+=a.content.str;break}case mn:case fs:{c();const d={insert:a.content.getContent()[0]};if(i.size>0){const f={};d.attributes=f,i.forEach((h,p)=>{f[p]=h})}s.push(d);break}case Ge:zr(a,e)&&(c(),ii(i,a.content));break}a=a.right}c()};return e||t?De(o,d=>{e&&$u(d,e),t&&$u(d,t),u()},"cleanup"):u(),s}insert(e,t,r){if(t.length<=0)return;const s=this.doc;s!==null?De(s,i=>{const o=Io(i,this,e,!r);r||(r={},o.currentAttributes.forEach((l,a)=>{r[a]=l})),Sc(i,this,o,t,r)}):this._pending.push(()=>this.insert(e,t,r))}insertEmbed(e,t,r){const s=this.doc;s!==null?De(s,i=>{const o=Io(i,this,e,!r);Sc(i,this,o,t,r||{})}):this._pending.push(()=>this.insertEmbed(e,t,r||{}))}delete(e,t){if(t===0)return;const r=this.doc;r!==null?De(r,s=>{$p(s,Io(s,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,r){if(t===0)return;const s=this.doc;s!==null?De(s,i=>{const o=Io(i,this,e,!1);o.right!==null&&Cp(i,this,o,t,r)}):this._pending.push(()=>this.format(e,t,r))}removeAttribute(e){this.doc!==null?De(this.doc,t=>{Xl(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){this.doc!==null?De(this.doc,r=>{zd(r,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return Vd(this,e)}getAttributes(){return ib(this)}_write(e){e.writeTypeRef(c2)}}const WO=n=>new ls;class Cc{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===Dt||t.constructor===as)&&t._start!==null)e=t._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class as extends dt{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new as}clone(){const e=new as;return e.insert(0,this.toArray().map(t=>t instanceof dt?t.clone():t)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Cc(this,e)}querySelector(e){e=e.toUpperCase();const r=new Cc(this,s=>s.nodeName&&s.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Mr(new Cc(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){Ta(this,e,new KO(this,t,e))}toString(){return eb(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},r){const s=e.createDocumentFragment();return r!==void 0&&r._createAssociation(s,this),so(this,i=>{s.insertBefore(i.toDOM(e,t,r),null)}),s}insert(e,t){this.doc!==null?De(this.doc,r=>{rb(r,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(this.doc!==null)De(this.doc,r=>{const s=e&&e instanceof dt?e._item:e;Yl(r,this,s,t)});else{const r=this._prelimContent,s=e===null?0:r.findIndex(i=>i===e)+1;if(s===0&&e!==null)throw xr("Reference item not found");r.splice(s,0,...t)}}delete(e,t=1){this.doc!==null?De(this.doc,r=>{sb(r,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return Qy(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return tb(this,e)}slice(e=0,t=this.length){return Xy(this,e,t)}forEach(e){so(this,e)}_write(e){e.writeTypeRef(d2)}}const qO=n=>new as;class Dt extends as{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((r,s)=>{this.setAttribute(s,r)}),this._prelimAttrs=null}_copy(){return new Dt(this.nodeName)}clone(){const e=new Dt(this.nodeName),t=this.getAttributes();return CT(t,(r,s)=>{typeof r=="string"&&e.setAttribute(s,r)}),e.insert(0,this.toArray().map(r=>r instanceof dt?r.clone():r)),e}toString(){const e=this.getAttributes(),t=[],r=[];for(const l in e)r.push(l);r.sort();const s=r.length;for(let l=0;l0?" "+t.join(" "):"";return`<${i}${o}>${super.toString()}`}removeAttribute(e){this.doc!==null?De(this.doc,t=>{Xl(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){this.doc!==null?De(this.doc,r=>{zd(r,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return Vd(this,e)}hasAttribute(e){return ob(this,e)}getAttributes(e){return e?LO(this,e):ib(this)}toDOM(e=document,t={},r){const s=e.createElement(this.nodeName),i=this.getAttributes();for(const o in i){const l=i[o];typeof l=="string"&&s.setAttribute(o,l)}return so(this,o=>{s.appendChild(o.toDOM(e,t,r))}),r!==void 0&&r._createAssociation(s,this),s}_write(e){e.writeTypeRef(u2),e.writeKey(this.nodeName)}}const JO=n=>new Dt(n.readKey());class KO extends xa{constructor(e,t,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(s=>{s===null?this.childListChanged=!0:this.attributesChanged.add(s)})}}class Ql extends Gs{constructor(e){super(),this.hookName=e}_copy(){return new Ql(this.hookName)}clone(){const e=new Ql(this.hookName);return this.forEach((t,r)=>{e.set(r,t)}),e}toDOM(e=document,t={},r){const s=t[this.hookName];let i;return s!==void 0?i=s.createDom(this):i=document.createElement(this.hookName),i.setAttribute("data-yjs-hook",this.hookName),r!==void 0&&r._createAssociation(i,this),i}_write(e){e.writeTypeRef(f2),e.writeKey(this.hookName)}}const GO=n=>new Ql(n.readKey());class jt extends ls{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new jt}clone(){const e=new jt;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,r){const s=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(s,this),s}toString(){return this.toDelta().map(e=>{const t=[];for(const s in e.attributes){const i=[];for(const o in e.attributes[s])i.push({key:o,value:e.attributes[s][o]});i.sort((o,l)=>o.keys.nodeName=0;s--)r+=``;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(h2)}}const YO=n=>new jt;class Fd{constructor(e,t){this.id=e,this.length=t}get deleted(){throw un()}mergeWith(e){return!1}write(e,t,r){throw un()}integrate(e,t){throw un()}}const XO=0;class Gt extends Fd{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),jy(e.doc.store,this)}write(e,t){e.writeInfo(XO),e.writeLen(this.length-t)}getMissing(e,t){return null}}class yo{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new yo(this.content)}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}const QO=n=>new yo(n.readBuf());class io{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new io(this.len)}splice(e){const t=new io(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){eo(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}const ZO=n=>new io(n.readLen()),db=(n,e)=>new si({guid:n,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class bo{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new bo(db(this.doc.guid,this.opts))}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}const e2=n=>new bo(db(n.readString(),n.readAny()));class fs{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new fs(this.embed)}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}const t2=n=>new fs(n.readJSON());class Ge{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new Ge(this.key,this.value)}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){const r=t.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}const n2=n=>new Ge(n.readKey(),n.readJSON());class Zl{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Zl(this.arr)}splice(e){const t=new Zl(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){const r=this.arr.length;e.writeLen(r-t);for(let s=t;s{const e=n.readLen(),t=[];for(let r=0;r{const e=n.readLen(),t=[];for(let r=0;r=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}}const i2=n=>new hn(n.readString()),o2=[BO,VO,WO,JO,qO,GO,YO],l2=0,a2=1,c2=2,u2=3,d2=4,f2=5,h2=6;class mn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new mn(this.type._copy())}splice(e){throw un()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}const p2=n=>new mn(o2[n.readTypeRef()](n)),xu=(n,e)=>{let t=e,r=0,s;do r>0&&(t=re(t.client,t.clock+r)),s=Jo(n,t),r=t.clock-s.id.clock,t=s.redone;while(t!==null&&s instanceof Te);return{item:s,diff:r}},Hd=(n,e)=>{for(;n!==null&&n.keep!==e;)n.keep=e,n=n.parent._item},ea=(n,e,t)=>{const{client:r,clock:s}=e.id,i=new Te(re(r,s+t),e,re(r,s+t-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(t));return e.deleted&&i.markDeleted(),e.keep&&(i.keep=!0),e.redone!==null&&(i.redone=re(e.redone.client,e.redone.clock+t)),e.right=i,i.right!==null&&(i.right.left=i),n._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),e.length=t,i},Ap=(n,e)=>BE(n,t=>ni(t.deletions,e)),fb=(n,e,t,r,s,i)=>{const o=n.doc,l=o.store,a=o.clientID,c=e.redone;if(c!==null)return Nt(n,c);let u=e.parent._item,d=null,f;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!t.has(u)||fb(n,u,t,r,s,i)===null))return null;for(;u.redone!==null;)u=Nt(n,u.redone)}const h=u===null?e.parent:u.content.type;if(e.parentSub===null){for(d=e.left,f=e;d!==null;){let y=d;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:Nt(n,y.redone);if(y!==null&&y.parent._item===u){d=y;break}d=d.left}for(;f!==null;){let y=f;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:Nt(n,y.redone);if(y!==null&&y.parent._item===u){f=y;break}f=f.right}}else if(f=null,e.right&&!s){for(d=e;d!==null&&d.right!==null&&(d.right.redone||ni(r,d.right.id)||Ap(i.undoStack,d.right.id)||Ap(i.redoStack,d.right.id));)for(d=d.right;d.redone;)d=Nt(n,d.redone);if(d&&d.right!==null)return null}else d=h._map.get(e.parentSub)||null;const p=Ue(l,a),m=re(a,p),g=new Te(m,d,d&&d.lastId,f,f&&f.id,h,e.parentSub,e.content.copy());return e.redone=m,Hd(g,!0),g.integrate(n,0),g};class Te extends Fd{constructor(e,t,r,s,i,o,l,a){super(e,a.getLength()),this.origin=r,this.left=t,this.right=s,this.rightOrigin=i,this.parent=o,this.parentSub=l,this.redone=null,this.content=a,this.info=this.content.isCountable()?tp:0}set marker(e){(this.info&yc)>0!==e&&(this.info^=yc)}get marker(){return(this.info&yc)>0}get keep(){return(this.info&ep)>0}set keep(e){this.keep!==e&&(this.info^=ep)}get countable(){return(this.info&tp)>0}get deleted(){return(this.info&gc)>0}set deleted(e){this.deleted!==e&&(this.info^=gc)}markDeleted(){this.info|=gc}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Ue(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Ue(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===Ns&&this.id.client!==this.parent.client&&this.parent.clock>=Ue(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=gp(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Nt(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Gt||this.right&&this.right.constructor===Gt)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===Te&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===Te&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===Ns){const r=Jo(t,this.parent);r.constructor===Gt?this.parent=null:this.parent=r.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=gp(e,e.doc.store,re(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,s;if(r!==null)s=r.right;else if(this.parentSub!==null)for(s=this.parent._map.get(this.parentSub)||null;s!==null&&s.left!==null;)s=s.left;else s=this.parent._start;const i=new Set,o=new Set;for(;s!==null&&s!==this.right;){if(o.add(s),i.add(s),_o(this.origin,s.origin)){if(s.id.client{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),eo(e.deleteSet,this.id.client,this.id.clock,this.length),bp(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw tn();this.content.gc(e),t?wO(e,this,new Gt(this.id,this.length)):this.content=new io(this.length)}write(e,t){const r=t>0?re(this.id.client,this.id.clock+t-1):this.origin,s=this.rightOrigin,i=this.parentSub,o=this.content.getRef()&Ca|(r===null?0:Ut)|(s===null?0:qn)|(i===null?0:Yi);if(e.writeInfo(o),r!==null&&e.writeLeftID(r),s!==null&&e.writeRightID(s),r===null&&s===null){const l=this.parent;if(l._item!==void 0){const a=l._item;if(a===null){const c=to(l);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(a.id)}else l.constructor===String?(e.writeParentInfo(!0),e.writeString(l)):l.constructor===Ns?(e.writeParentInfo(!1),e.writeLeftID(l)):tn();i!==null&&e.writeString(i)}this.content.write(e,t)}}const hb=(n,e)=>m2[e&Ca](n),m2=[()=>{tn()},ZO,r2,QO,i2,t2,n2,p2,s2,e2,()=>{tn()}],g2=10;class Yt extends Fd{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,t){tn()}write(e,t){e.writeInfo(g2),he(e.restEncoder,this.length-t)}getMissing(e,t){return null}}const pb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},mb="__ $YJS$ __";pb[mb]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");pb[mb]=!0;function y2(n){return n||(n={}),{delay:n.delay===void 0?200:n.delay,initialDelay:n.initialDelay===void 0?0:n.initialDelay,minDelay:n.minDelay===void 0?0:n.minDelay,maxDelay:n.maxDelay===void 0?0:n.maxDelay,factor:n.factor===void 0?0:n.factor,maxAttempts:n.maxAttempts===void 0?3:n.maxAttempts,timeout:n.timeout===void 0?0:n.timeout,jitter:n.jitter===!0,handleError:n.handleError===void 0?null:n.handleError,handleTimeout:n.handleTimeout===void 0?null:n.handleTimeout,beforeAttempt:n.beforeAttempt===void 0?null:n.beforeAttempt,calculateDelay:n.calculateDelay===void 0?null:n.calculateDelay}}async function Mp(n){return new Promise((e,t)=>{setTimeout(e,n)})}function b2(n,e){let t=e.delay;if(t===0)return 0;if(e.factor&&(t*=Math.pow(e.factor,n.attemptNum-1),e.maxDelay!==0&&(t=Math.min(t,e.maxDelay))),e.jitter){const r=Math.ceil(e.minDelay),s=Math.floor(t);t=Math.floor(Math.random()*(s-r+1))+r}return Math.round(t)}async function w2(n,e){const t=y2(e);for(const l of["delay","initialDelay","minDelay","maxDelay","maxAttempts","timeout"]){const a=t[l];if(!Number.isInteger(a)||a<0)throw new Error(`Value for ${l} must be an integer greater than or equal to 0`)}if(t.factor.constructor!==Number||t.factor<0)throw new Error("Value for factor must be a number greater than or equal to 0");if(t.delay{if(t.handleError&&await t.handleError(a,r,t),r.aborted||r.attemptsRemaining===0)throw a;r.attemptNum++;const c=s(r,t);return c&&await Mp(c),i()};return r.attemptsRemaining>0&&r.attemptsRemaining--,t.timeout?new Promise((a,c)=>{const u=setTimeout(()=>{if(t.handleTimeout)try{a(t.handleTimeout(r,t))}catch(d){c(d)}else{const d=new Error(`Retry timeout (attemptNum: ${r.attemptNum}, timeout: ${t.timeout})`);d.code="ATTEMPT_TIMEOUT",c(d)}},t.timeout);n(r,t).then(d=>{clearTimeout(u),a(d)}).catch(d=>{clearTimeout(u),l(d).then(a).catch(c)})}):n(r,t).catch(l)}const o=t.calculateDelay?t.calculateDelay(r,t):t.initialDelay;return o&&await Mp(o),i()}var gb={};const Is=()=>new Map,yb=(n,e,t)=>{let r=n.get(e);return r===void 0&&n.set(e,r=t()),r},bb=()=>new Set,v2=Array.from,k2=String.fromCharCode,S2=n=>n.toLowerCase(),C2=/^\s*/g,$2=n=>n.replace(C2,""),A2=/([A-Z])/g,xp=(n,e)=>$2(n.replace(A2,t=>`${e}${S2(t)}`)),M2=n=>{const e=unescape(encodeURIComponent(n)),t=e.length,r=new Uint8Array(t);for(let s=0;soo.encode(n),E2=oo?x2:M2;let Ni=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Ni&&Ni.decode(new Uint8Array).length===1&&(Ni=null);const Ep=n=>n===void 0?null:n;class T2{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}}let wb=new T2,Ud=!0;try{typeof localStorage<"u"&&localStorage&&(wb=localStorage,Ud=!1)}catch{}const vb=wb,O2=n=>Ud||addEventListener("storage",n),_2=n=>Ud||removeEventListener("storage",n),N2=Object.keys,D2=(n,e)=>{const t=[];for(const r in n)t.push(e(n[r],r));return t},Tp=n=>N2(n).length,I2=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),R2=(n,e)=>n===e,Di=(n,e)=>{if(n==null||e==null)return R2(n,e);if(n.constructor!==e.constructor)return!1;if(n===e)return!0;switch(n.constructor){case ArrayBuffer:n=new Uint8Array(n),e=new Uint8Array(e);case Uint8Array:{if(n.byteLength!==e.byteLength)return!1;for(let t=0;te.includes(n),Ys=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",kb=typeof window<"u"&&typeof document<"u"&&!Ys;let vn;const P2=()=>{if(vn===void 0)if(Ys){vn=Is();const n=process.argv;let e=null;for(let t=0;t{if(n.length!==0){const[e,t]=n.split("=");vn.set(`--${xp(e,"-")}`,t),vn.set(`-${xp(e,"-")}`,t)}})):vn=Is();return vn},Eu=n=>P2().has(n),Tu=n=>Ep(Ys?gb[n.toUpperCase()]:vb.getItem(n)),B2=n=>Eu("--"+n)||Tu(n)!==null;B2("production");const Op=Ys&&L2(gb.FORCE_COLOR,["true","1","2"]);!Eu("no-colors")&&(!Ys||process.stdout.isTTY||Op)&&(!Ys||Eu("color")||Op||Tu("COLORTERM")!==null||(Tu("TERM")||"").includes("color"));const Sb=Math.floor,z2=(n,e)=>nn>e?n:e,F2=64,ta=128,H2=63,Ii=127,Cb=Number.MAX_SAFE_INTEGER;class U2{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const jd=()=>new U2,$b=n=>{let e=n.cpos;for(let t=0;t{const e=new Uint8Array($b(n));let t=0;for(let r=0;r{const t=n.cbuf.length;n.cpos===t&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(t*2),n.cpos=0),n.cbuf[n.cpos++]=e},it=(n,e)=>{for(;e>Ii;)na(n,ta|Ii&e),e=Sb(e/128);na(n,Ii&e)},Ou=new Uint8Array(3e4),j2=Ou.length/3,W2=(n,e)=>{if(e.length{const t=unescape(encodeURIComponent(e)),r=t.length;it(n,r);for(let s=0;s{const t=n.cbuf.length,r=n.cpos,s=z2(t-r,e.length),i=e.length-s;n.cbuf.set(e.subarray(0,s),r),n.cpos+=s,i>0&&(n.bufs.push(n.cbuf),n.cbuf=new Uint8Array(V2(t*2,i)),n.cbuf.set(e.subarray(s)),n.cpos=i)},oi=(n,e)=>{it(n,e.byteLength),J2(n,e)},Ab=n=>new Error(n),Mb=Ab("Unexpected end of array"),xb=Ab("Integer out of Range");class K2{constructor(e){this.arr=e,this.pos=0}}const Eb=n=>new K2(n),G2=(n,e)=>{const t=new Uint8Array(n.arr.buffer,n.pos+n.arr.byteOffset,e);return n.pos+=e,t},Oa=n=>G2(n,Qr(n)),_p=n=>n.arr[n.pos++],Qr=n=>{let e=0,t=1;const r=n.arr.length;for(;n.posCb)throw xb}throw Mb},Y2=n=>{let e=n.arr[n.pos++],t=e&H2,r=64;const s=(e&F2)>0?-1:1;if(!(e&ta))return s*t;const i=n.arr.length;for(;n.posCb)throw xb}throw Mb},X2=n=>{let e=Qr(n);if(e===0)return"";{let t=String.fromCodePoint(_p(n));if(--e<100)for(;e--;)t+=String.fromCodePoint(_p(n));else for(;e>0;){const r=e<1e4?e:1e4,s=n.arr.subarray(n.pos,n.pos+r);n.pos+=r,t+=String.fromCodePoint.apply(null,s),e-=r}return decodeURIComponent(escape(t))}},Q2=n=>Ni.decode(Oa(n)),_a=Ni?Q2:X2,Z2=n=>{const e=n.pos,t=_a(n);return n.pos=e,t},e_=n=>new Uint8Array(n),t_=(n,e,t)=>new Uint8Array(n,e,t),n_=n=>new Uint8Array(n),r_=n=>{let e="";for(let t=0;tBuffer.from(n.buffer,n.byteOffset,n.byteLength).toString("base64"),i_=n=>{const e=atob(n),t=e_(e.length);for(let r=0;r{const e=Buffer.from(n,"base64");return t_(e.buffer,e.byteOffset,e.byteLength)},l_=kb?r_:s_,a_=kb?i_:o_,Tb=new Map;class c_{constructor(e){this.room=e,this.onmessage=null,this._onChange=t=>t.key===e&&this.onmessage!==null&&this.onmessage({data:a_(t.newValue||"")}),O2(this._onChange)}postMessage(e){vb.setItem(this.room,l_(n_(e)))}close(){_2(this._onChange)}}const u_=typeof BroadcastChannel>"u"?c_:BroadcastChannel,qd=n=>yb(Tb,n,()=>{const e=bb(),t=new u_(n);return t.onmessage=r=>e.forEach(s=>s(r.data,"broadcastchannel")),{bc:t,subs:e}}),d_=(n,e)=>(qd(n).subs.add(e),e),f_=(n,e)=>{const t=qd(n),r=t.subs.delete(e);return r&&t.subs.size===0&&(t.bc.close(),Tb.delete(n)),r},h_=(n,e,t=null)=>{const r=qd(n);r.bc.postMessage(e),r.subs.forEach(s=>s(e,t))},p_=()=>{let n=!0;return(e,t)=>{if(n){n=!1;try{e()}finally{n=!0}}else t!==void 0&&t()}},Xs=Date.now;class m_{constructor(){this._observers=Is()}on(e,t){yb(this._observers,e,bb).add(t)}once(e,t){const r=(...s)=>{this.off(e,r),t(...s)};this.on(e,r)}off(e,t){const r=this._observers.get(e);r!==void 0&&(r.delete(t),r.size===0&&this._observers.delete(e))}emit(e,t){return v2((this._observers.get(e)||Is()).values()).forEach(r=>r(...t))}destroy(){this._observers=Is()}}const $c=3e4;class g_ extends m_{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const t=Xs();this.getLocalState()!==null&&$c/2<=t-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const r=[];this.meta.forEach((s,i)=>{i!==this.clientID&&$c<=t-s.lastUpdated&&this.states.has(i)&&r.push(i)}),r.length>0&&Go(this,r,"timeout")},Sb($c/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,r=this.meta.get(t),s=r===void 0?0:r.clock+1,i=this.states.get(t);e===null?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:s,lastUpdated:Xs()});const o=[],l=[],a=[],c=[];e===null?c.push(t):i==null?e!=null&&o.push(t):(l.push(t),Di(i,e)||a.push(t)),(o.length>0||a.length>0||c.length>0)&&this.emit("change",[{added:o,updated:a,removed:c},"local"]),this.emit("update",[{added:o,updated:l,removed:c},"local"])}setLocalStateField(e,t){const r=this.getLocalState();r!==null&&this.setLocalState({...r,[e]:t})}getStates(){return this.states}}const Go=(n,e,t)=>{const r=[];for(let s=0;s0&&(n.emit("change",[{added:[],updated:[],removed:r},t]),n.emit("update",[{added:[],updated:[],removed:r},t]))},_u=(n,e,t=n.states)=>{const r=e.length,s=jd();it(s,r);for(let i=0;i{const r=Eb(e),s=Xs(),i=[],o=[],l=[],a=[],c=Qr(r);for(let u=0;u0||l.length>0||a.length>0)&&n.emit("change",[{added:i,updated:l,removed:a},t]),(i.length>0||o.length>0||a.length>0)&&n.emit("update",[{added:i,updated:o,removed:a},t])};class Ob{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(s=>s.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(s=>s!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}const b_=n=>D2(n,(e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");var nt;(function(n){n[n.Sync=0]="Sync",n[n.Awareness=1]="Awareness",n[n.Auth=2]="Auth",n[n.QueryAwareness=3]="QueryAwareness",n[n.Stateless=5]="Stateless",n[n.CLOSE=7]="CLOSE",n[n.SyncStatus=8]="SyncStatus"})(nt||(nt={}));var et;(function(n){n.Connecting="connecting",n.Connected="connected",n.Disconnected="disconnected"})(et||(et={}));class Yo{constructor(e){this.data=e,this.encoder=jd(),this.decoder=Eb(new Uint8Array(this.data))}peekVarString(){return Z2(this.decoder)}readVarUint(){return Qr(this.decoder)}readVarString(){return _a(this.decoder)}readVarUint8Array(){return Oa(this.decoder)}writeVarUint(e){return it(this.encoder,e)}writeVarString(e){return pn(this.encoder,e)}writeVarUint8Array(e){return oi(this.encoder,e)}length(){return $b(this.encoder)}}class _b extends Ob{constructor(e){super(),this.messageQueue=[],this.configuration={url:"",document:void 0,WebSocketPolyfill:void 0,parameters:{},connect:!0,broadcast:!0,forceSyncInterval:!1,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,quiet:!1,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=et.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={forceSync:null,connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.receivedOnStatusPayload=void 0,this.closeTries=0,this.setConfiguration(e),this.configuration.WebSocketPolyfill=e.WebSocketPolyfill?e.WebSocketPolyfill:WebSocket,this.on("open",this.configuration.onOpen),this.on("open",this.onOpen.bind(this)),this.on("connect",this.configuration.onConnect),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("status",this.configuration.onStatus),this.on("status",this.onStatus.bind(this)),this.on("disconnect",this.configuration.onDisconnect),this.on("close",this.configuration.onClose),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("close",this.onClose.bind(this)),this.on("message",this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),typeof e.connect<"u"&&(this.shouldConnect=e.connect),this.shouldConnect&&this.connect()}async onOpen(e){this.receivedOnOpenPayload=e}async onStatus(e){this.receivedOnStatusPayload=e}attach(e){this.configuration.providerMap.set(e.configuration.name,e),this.status===et.Disconnected&&this.shouldConnect&&this.connect(),this.receivedOnOpenPayload&&e.onOpen(this.receivedOnOpenPayload),this.receivedOnStatusPayload&&e.onStatus(this.receivedOnStatusPayload)}detach(e){this.configuration.providerMap.delete(e.configuration.name)}setConfiguration(e={}){this.configuration={...this.configuration,...e}}async connect(){if(this.status===et.Connected)return;this.cancelWebsocketRetry&&(this.cancelWebsocketRetry(),this.cancelWebsocketRetry=void 0),this.receivedOnOpenPayload=void 0,this.receivedOnStatusPayload=void 0,this.shouldConnect=!0;const e=()=>{let s=!1;return{retryPromise:w2(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,beforeAttempt:o=>{(!this.shouldConnect||s)&&o.abort()}}).catch(o=>{if(o&&o.code!=="ATTEMPT_ABORTED")throw o}),cancelFunc:()=>{s=!0}}},{retryPromise:t,cancelFunc:r}=e();return this.cancelWebsocketRetry=r,t}attachWebSocketListeners(e,t){const{identifier:r}=e,s=c=>this.emit("message",c),i=c=>this.emit("close",{event:c}),o=c=>this.emit("open",c),l=c=>{t(c)};this.webSocketHandlers[r]={message:s,close:i,open:o,error:l};const a=this.webSocketHandlers[e.identifier];Object.keys(a).forEach(c=>{e.addEventListener(c,a[c])})}cleanupWebSocket(){if(!this.webSocket)return;const{identifier:e}=this.webSocket,t=this.webSocketHandlers[e];Object.keys(t).forEach(r=>{var s;(s=this.webSocket)===null||s===void 0||s.removeEventListener(r,t[r]),delete this.webSocketHandlers[e]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((e,t)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;const r=new this.configuration.WebSocketPolyfill(this.url);r.binaryType="arraybuffer",r.identifier=this.identifier,this.attachWebSocketListeners(r,t),this.webSocket=r,this.status=et.Connecting,this.emit("status",{status:et.Connecting}),this.connectionAttempt={resolve:e,reject:t}})}onMessage(e){var t;this.resolveConnectionAttempt(),this.lastMessageReceived=Xs();const s=new Yo(e.data).peekVarString();(t=this.configuration.providerMap.get(s))===null||t===void 0||t.onMessage(e)}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=et.Connected,this.emit("status",{status:et.Connected}),this.emit("connect"),this.messageQueue.forEach(e=>this.send(e)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){var e;(e=this.connectionAttempt)===null||e===void 0||e.reject(),this.connectionAttempt=null}checkConnection(){var e;this.status===et.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=Xs()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:"forced"}}),this.closeTries=0):((e=this.webSocket)===null||e===void 0||e.close(),this.messageQueue=[])))}get serverUrl(){for(;this.configuration.url[this.configuration.url.length-1]==="/";)return this.configuration.url.slice(0,this.configuration.url.length-1);return this.configuration.url}get url(){const e=b_(this.configuration.parameters);return`${this.serverUrl}${e.length===0?"":`?${e}`}`}disconnect(){if(this.shouldConnect=!1,this.webSocket!==null)try{this.webSocket.close(),this.messageQueue=[]}catch{}}send(e){var t;((t=this.webSocket)===null||t===void 0?void 0:t.readyState)===pu.Open?this.webSocket.send(e):this.messageQueue.push(e)}onClose({event:e}){if(this.closeTries=0,this.cleanupWebSocket(),this.status===et.Connected&&(this.status=et.Disconnected,this.emit("status",{status:et.Disconnected}),this.emit("disconnect",{event:e})),e.code===Qh.code&&(e.reason===Qh.reason?console.warn("[HocuspocusProvider] An authentication token is required, but you didn’t send one. Try adding a `token` to your HocuspocusProvider configuration. Won’t try again."):console.warn(`[HocuspocusProvider] Connection closed with status Unauthorized: ${e.reason}`),this.shouldConnect=!1),e.code===IE.code&&!this.configuration.quiet){console.warn("[HocuspocusProvider] The provided authentication token isn’t allowed to connect to this server. Will try again.");return}e.code===DE.code&&(console.warn(`[HocuspocusProvider] Connection closed with status MessageTooBig: ${e.reason}`),this.shouldConnect=!1),this.connectionAttempt?this.rejectConnectionAttempt():this.shouldConnect&&this.connect(),!this.shouldConnect&&this.status!==et.Disconnected&&(this.status=et.Disconnected,this.emit("status",{status:et.Disconnected}),this.emit("disconnect",{event:e}))}destroy(){this.emit("destroy"),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}}const Nb=0,Jd=1,Db=2,w_=(n,e)=>{it(n,Nb);const t=fO(e);oi(n,t)},Ib=(n,e,t)=>{it(n,Jd),oi(n,aO(e,t))},v_=(n,e,t)=>Ib(e,t,Oa(n)),Rb=(n,e,t)=>{try{iO(e,Oa(n),t)}catch(r){console.error("Caught error while handling a Yjs update",r)}},k_=(n,e)=>{it(n,Db),oi(n,e)},S_=Rb,C_=(n,e,t,r)=>{const s=Qr(n);switch(s){case Nb:v_(n,e,t);break;case Jd:Rb(n,t,r);break;case Db:S_(n,t,r);break;default:throw new Error("Unknown message type")}return s};class Rn{constructor(){this.encoder=jd()}get(e){return e.encoder}toUint8Array(){return Wd(this.encoder)}}class Np{constructor(e){this.broadcasted=!1,this.message=e}setBroadcasted(e){return this.broadcasted=e,this}apply(e,t){const{message:r}=this,s=r.readVarUint(),i=r.length();switch(s){case nt.Sync:this.applySyncMessage(e,t);break;case nt.Awareness:this.applyAwarenessMessage(e);break;case nt.Auth:this.applyAuthMessage(e);break;case nt.QueryAwareness:this.applyQueryAwarenessMessage(e);break;case nt.Stateless:e.receiveStateless(_a(r.decoder));break;case nt.SyncStatus:this.applySyncStatusMessage(e,Y2(r.decoder)===1);break;default:throw new Error(`Can’t apply message of unknown type: ${s}`)}r.length()>i+1&&(this.broadcasted?e.broadcast(Rn,{encoder:r.encoder}):e.send(Rn,{encoder:r.encoder}))}applySyncMessage(e,t){const{message:r}=this;r.writeVarUint(nt.Sync);const s=C_(r.decoder,r.encoder,e.document,e);t&&s===Jd&&(e.synced=!0)}applySyncStatusMessage(e,t){t&&e.decrementUnsyncedChanges()}applyAwarenessMessage(e){if(!e.awareness)return;const{message:t}=this;y_(e.awareness,t.readVarUint8Array(),e)}applyAuthMessage(e){const{message:t}=this;NE(t.decoder,e.permissionDeniedHandler.bind(e),e.authenticatedHandler.bind(e))}applyQueryAwarenessMessage(e){if(!e.awareness)return;const{message:t}=this;t.writeVarUint(nt.Awareness),t.writeVarUint8Array(_u(e.awareness,Array.from(e.awareness.getStates().keys())))}}class Dp{constructor(e,t={}){this.message=new e,this.encoder=this.message.get(t)}create(){return Wd(this.encoder)}send(e){e==null||e.send(this.create())}broadcast(e){h_(e,this.create())}}class $_ extends Rn{constructor(){super(...arguments),this.type=nt.Auth,this.description="Authentication"}get(e){if(typeof e.token>"u")throw new Error("The authentication message requires `token` as an argument.");return pn(this.encoder,e.documentName),it(this.encoder,this.type),_E(this.encoder,e.token),this.encoder}}class Ro extends Rn{constructor(){super(...arguments),this.type=nt.Awareness,this.description="Awareness states update"}get(e){if(typeof e.awareness>"u")throw new Error("The awareness message requires awareness as an argument");if(typeof e.clients>"u")throw new Error("The awareness message requires clients as an argument");pn(this.encoder,e.documentName),it(this.encoder,this.type);let t;return e.states===void 0?t=_u(e.awareness,e.clients):t=_u(e.awareness,e.clients,e.states),oi(this.encoder,t),this.encoder}}class A_ extends Rn{constructor(){super(...arguments),this.type=nt.CLOSE,this.description="Ask the server to close the connection"}get(e){return pn(this.encoder,e.documentName),it(this.encoder,this.type),this.encoder}}class M_ extends Rn{constructor(){super(...arguments),this.type=nt.QueryAwareness,this.description="Queries awareness states"}get(e){return pn(this.encoder,e.documentName),it(this.encoder,this.type),this.encoder}}class x_ extends Rn{constructor(){super(...arguments),this.type=nt.Stateless,this.description="A stateless message"}get(e){var t;return pn(this.encoder,e.documentName),it(this.encoder,this.type),pn(this.encoder,(t=e.payload)!==null&&t!==void 0?t:""),this.encoder}}class Ac extends Rn{constructor(){super(...arguments),this.type=nt.Sync,this.description="First sync step"}get(e){if(typeof e.document>"u")throw new Error("The sync step one message requires document as an argument");return pn(this.encoder,e.documentName),it(this.encoder,this.type),w_(this.encoder,e.document),this.encoder}}class E_ extends Rn{constructor(){super(...arguments),this.type=nt.Sync,this.description="Second sync step"}get(e){if(typeof e.document>"u")throw new Error("The sync step two message requires document as an argument");return pn(this.encoder,e.documentName),it(this.encoder,this.type),Ib(this.encoder,e.document),this.encoder}}class T_ extends Rn{constructor(){super(...arguments),this.type=nt.Sync,this.description="A document update"}get(e){return pn(this.encoder,e.documentName),it(this.encoder,this.type),k_(this.encoder,e.update),this.encoder}}class O_ extends Error{constructor(){super(...arguments),this.code=1001}}class __ extends Ob{constructor(e){var t,r,s;super(),this.configuration={name:"",document:void 0,awareness:void 0,token:null,parameters:{},broadcast:!0,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onSynced:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,quiet:!1,connect:!0,preserveConnection:!0},this.subscribedToBroadcastChannel=!1,this.isSynced=!1,this.unsyncedChanges=0,this.status=et.Disconnected,this.isAuthenticated=!1,this.authorizedScope=void 0,this.mux=p_(),this.intervals={forceSync:null},this.isConnected=!0,this.boundBroadcastChannelSubscriber=this.broadcastChannelSubscriber.bind(this),this.boundPageUnload=this.pageUnload.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.boundOnStatus=this.onStatus.bind(this),this.forwardConnect=i=>this.emit("connect",i),this.forwardOpen=i=>this.emit("open",i),this.forwardClose=i=>this.emit("close",i),this.forwardDisconnect=i=>this.emit("disconnect",i),this.forwardDestroy=i=>this.emit("destroy",i),this.setConfiguration(e),this.configuration.document=e.document?e.document:new si,this.configuration.awareness=e.awareness!==void 0?e.awareness:new g_(this.document),this.on("open",this.configuration.onOpen),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("synced",this.configuration.onSynced),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("stateless",this.configuration.onStateless),this.on("authenticated",this.configuration.onAuthenticated),this.on("authenticationFailed",this.configuration.onAuthenticationFailed),this.configuration.websocketProvider.on("connect",this.configuration.onConnect),this.configuration.websocketProvider.on("connect",this.forwardConnect),this.configuration.websocketProvider.on("open",this.boundOnOpen),this.configuration.websocketProvider.on("open",this.forwardOpen),this.configuration.websocketProvider.on("close",this.boundOnClose),this.configuration.websocketProvider.on("close",this.configuration.onClose),this.configuration.websocketProvider.on("close",this.forwardClose),this.configuration.websocketProvider.on("status",this.boundOnStatus),this.configuration.websocketProvider.on("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.on("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.on("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.on("destroy",this.forwardDestroy),(t=this.awareness)===null||t===void 0||t.on("update",()=>{this.emit("awarenessUpdate",{states:Zh(this.awareness.getStates())})}),(r=this.awareness)===null||r===void 0||r.on("change",()=>{this.emit("awarenessChange",{states:Zh(this.awareness.getStates())})}),this.document.on("update",this.documentUpdateHandler.bind(this)),(s=this.awareness)===null||s===void 0||s.on("update",this.awarenessUpdateHandler.bind(this)),this.registerEventListeners(),this.configuration.forceSyncInterval&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.configuration.websocketProvider.attach(this)}onStatus({status:e}){this.status=e,this.configuration.onStatus({status:e}),this.emit("status",{status:e})}setConfiguration(e={}){if(!e.websocketProvider&&e.url){const t=e;this.configuration.websocketProvider=new _b({url:t.url,connect:t.connect,parameters:t.parameters})}this.configuration={...this.configuration,...e}}get document(){return this.configuration.document}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit("unsyncedChanges",this.unsyncedChanges)}decrementUnsyncedChanges(){this.unsyncedChanges-=1,this.unsyncedChanges===0&&(this.synced=!0),this.emit("unsyncedChanges",this.unsyncedChanges)}forceSync(){this.send(Ac,{document:this.document,documentName:this.configuration.name})}pageUnload(){this.awareness&&Go(this.awareness,[this.document.clientID],"window unload")}registerEventListeners(){typeof window>"u"||window.addEventListener("unload",this.boundPageUnload)}sendStateless(e){this.send(x_,{documentName:this.configuration.name,payload:e})}documentUpdateHandler(e,t){t!==this&&(this.incrementUnsyncedChanges(),this.send(T_,{update:e,documentName:this.configuration.name},!0))}awarenessUpdateHandler({added:e,updated:t,removed:r},s){const i=e.concat(t).concat(r);this.send(Ro,{awareness:this.awareness,clients:i,documentName:this.configuration.name},!0)}get synced(){return this.isSynced}set synced(e){this.isSynced!==e&&(this.isSynced=e,this.emit("synced",{state:e}),this.emit("sync",{state:e}))}receiveStateless(e){this.emit("stateless",{payload:e})}get isAuthenticationRequired(){return!!this.configuration.token&&!this.isAuthenticated}async connect(){return this.configuration.broadcast&&this.subscribeToBroadcastChannel(),this.configuration.websocketProvider.connect()}disconnect(){this.disconnectBroadcastChannel(),this.configuration.websocketProvider.detach(this),this.isConnected=!1,this.configuration.preserveConnection||this.configuration.websocketProvider.disconnect()}async onOpen(e){this.isAuthenticated=!1,this.isConnected=!0,this.emit("open",{event:e});let t;try{t=await this.getToken()}catch(r){this.permissionDeniedHandler(`Failed to get token: ${r}`);return}this.isAuthenticationRequired&&this.send($_,{token:t,documentName:this.configuration.name}),this.startSync()}async getToken(){return typeof this.configuration.token=="function"?await this.configuration.token():this.configuration.token}startSync(){this.incrementUnsyncedChanges(),this.send(Ac,{document:this.document,documentName:this.configuration.name}),this.awareness&&this.awareness.getLocalState()!==null&&this.send(Ro,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.configuration.name})}send(e,t,r=!1){if(!this.isConnected)return;r&&this.mux(()=>{this.broadcast(e,t)});const s=new Dp(e,t);this.emit("outgoingMessage",{message:s.message}),s.send(this.configuration.websocketProvider)}onMessage(e){const t=new Yo(e.data),r=t.readVarString();t.writeVarString(r),this.emit("message",{event:e,message:new Yo(e.data)}),new Np(t).apply(this,!0)}onClose(e){this.isAuthenticated=!1,this.synced=!1,this.awareness&&Go(this.awareness,Array.from(this.awareness.getStates().keys()).filter(t=>t!==this.document.clientID),this)}destroy(){this.emit("destroy"),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(Go(this.awareness,[this.document.clientID],"provider destroy"),this.awareness.off("update",this.awarenessUpdateHandler),this.awareness.destroy()),this.document.off("update",this.documentUpdateHandler),this.removeAllListeners(),this.configuration.websocketProvider.off("connect",this.configuration.onConnect),this.configuration.websocketProvider.off("connect",this.forwardConnect),this.configuration.websocketProvider.off("open",this.boundOnOpen),this.configuration.websocketProvider.off("open",this.forwardOpen),this.configuration.websocketProvider.off("close",this.boundOnClose),this.configuration.websocketProvider.off("close",this.configuration.onClose),this.configuration.websocketProvider.off("close",this.forwardClose),this.configuration.websocketProvider.off("status",this.boundOnStatus),this.configuration.websocketProvider.off("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.off("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.off("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.off("destroy",this.forwardDestroy),this.send(A_,{documentName:this.configuration.name}),this.disconnect(),!(typeof window>"u")&&window.removeEventListener("unload",this.boundPageUnload)}permissionDeniedHandler(e){this.emit("authenticationFailed",{reason:e}),this.isAuthenticated=!1,this.disconnect(),this.status=et.Disconnected}authenticatedHandler(e){this.isAuthenticated=!0,this.authorizedScope=e,this.emit("authenticated")}get broadcastChannel(){return`${this.configuration.name}`}broadcastChannelSubscriber(e){this.mux(()=>{const t=new Yo(e),r=t.readVarString();t.writeVarString(r),new Np(t).setBroadcasted(!0).apply(this,!1)})}subscribeToBroadcastChannel(){this.subscribedToBroadcastChannel||(d_(this.broadcastChannel,this.boundBroadcastChannelSubscriber),this.subscribedToBroadcastChannel=!0),this.mux(()=>{this.broadcast(Ac,{document:this.document,documentName:this.configuration.name}),this.broadcast(E_,{document:this.document,documentName:this.configuration.name}),this.broadcast(M_,{document:this.document,documentName:this.configuration.name}),this.awareness&&this.broadcast(Ro,{awareness:this.awareness,clients:[this.document.clientID],document:this.document,documentName:this.configuration.name})})}disconnectBroadcastChannel(){this.awareness&&this.send(Ro,{awareness:this.awareness,clients:[this.document.clientID],states:new Map,documentName:this.configuration.name},!0),this.subscribedToBroadcastChannel&&(f_(this.broadcastChannel,this.boundBroadcastChannelSubscriber),this.subscribedToBroadcastChannel=!1)}broadcast(e,t){this.configuration.broadcast&&this.subscribedToBroadcastChannel&&new Dp(e,t).broadcast(this.broadcastChannel)}setAwarenessField(e,t){if(!this.awareness)throw new O_(`Cannot set awareness field "${e}" to ${JSON.stringify(t)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(e,t)}}const N_=()=>{let n=!0;return(e,t)=>{if(n){n=!1;try{e()}finally{n=!0}}else t!==void 0&&t()}},D_=/[\uD800-\uDBFF]/,I_=/[\uDC00-\uDFFF]/,R_=(n,e)=>{let t=0,r=0;for(;t0&&D_.test(n[t-1])&&t--;r+t0&&I_.test(n[n.length-r])&&r--,{index:t,remove:n.length-t-r,insert:e.slice(t,e.length-r)}},L_=R_,qe=new wt("y-sync"),Jn=new wt("y-undo");new wt("yjs-cursor");const ra=(n,e)=>e===void 0?!n.deleted:e.sv.has(n.id.client)&&e.sv.get(n.id.client)>n.id.clock&&!ni(e.ds,n.id),P_=[{light:"#ecd44433",dark:"#ecd444"}],B_=(n,e,t)=>{if(!n.has(t)){if(n.sizer.add(s)),e=e.filter(s=>!r.has(s))}n.set(t,mT(e))}return n.get(t)},z_=(n,{colors:e=P_,colorMapping:t=new Map,permanentUserData:r=null,onFirstRender:s=()=>{}}={})=>{let i=!1,o;const l=new Qe({props:{editable:a=>{const c=qe.getState(a);return c.snapshot==null&&c.prevSnapshot==null}},key:qe,state:{init:(a,c)=>({type:n,doc:n.doc,binding:null,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:t,permanentUserData:r}),apply:(a,c)=>{const u=a.getMeta(qe);if(u!==void 0){c=Object.assign({},c);for(const d in u)c[d]=u[d]}return c.addToHistory=a.getMeta("addToHistory")!==!1,c.isChangeOrigin=u!==void 0&&!!u.isChangeOrigin,c.isUndoRedoOperation=u!==void 0&&!!u.isChangeOrigin&&!!u.isUndoRedoOperation,c.binding!==null&&u!==void 0&&(u.snapshot!=null||u.prevSnapshot!=null)&&Su(0,()=>{c.binding==null||c.binding.isDestroyed||(u.restore==null?c.binding._renderSnapshot(u.snapshot,u.prevSnapshot,c):(c.binding._renderSnapshot(u.snapshot,u.snapshot,c),delete c.restore,delete c.snapshot,delete c.prevSnapshot,c.binding.mux(()=>{c.binding._prosemirrorChanged(c.binding.prosemirrorView.state.doc)})))}),c}},view:a=>{const c=new F_(n,a);return o!=null&&o.destroy(),o=Su(0,()=>{c._forceRerender(),a.dispatch(a.state.tr.setMeta(qe,{binding:c})),s()}),{update:()=>{const u=l.getState(a.state);if(u.snapshot==null&&u.prevSnapshot==null&&(i||a.state.doc.content.findDiffStart(a.state.doc.type.createAndFill().content)!==null)){if(i=!0,u.addToHistory===!1&&!u.isChangeOrigin){const d=Jn.getState(a.state),f=d&&d.undoManager;f&&f.stopCapturing()}c.mux(()=>{u.doc.transact(d=>{d.meta.set("addToHistory",u.addToHistory),c._prosemirrorChanged(a.state.doc)},qe)})}},destroy:()=>{o.destroy(),c.destroy()}}}});return l},V_=(n,e,t)=>{if(e!==null&&e.anchor!==null&&e.head!==null){const r=Pp(t.doc,t.type,e.anchor,t.mapping),s=Pp(t.doc,t.type,e.head,t.mapping);r!==null&&s!==null&&(n=n.setSelection(te.create(n.doc,r,s)))}},Nu=(n,e)=>({anchor:Lp(e.selection.anchor,n.type,n.mapping),head:Lp(e.selection.head,n.type,n.mapping)});class F_{constructor(e,t){this.type=e,this.prosemirrorView=t,this.mux=N_(),this.isDestroyed=!1,this.mapping=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&(this.beforeTransactionSelection=Nu(this,t.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),e.observeDeep(this._observeFunction),this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(OT&&this._domSelectionInView===null&&(Su(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection(),t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);const s=t.getBoundingClientRect(),i=PT.documentElement;return s.bottom>=0&&s.right>=0&&s.left<=(window.innerWidth||i.clientWidth||0)&&s.top<=(window.innerHeight||i.clientHeight||0)}renderSnapshot(e,t){t||(t=Hy(_y(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(qe,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>Xo(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new B(E.from(e),0,0));t.setMeta(qe,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>Xo(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new B(E.from(e),0,0));this.prosemirrorView.dispatch(t.setMeta(qe,{isChangeOrigin:!0}))})}_renderSnapshot(e,t,r){e||(e=yO(this.doc)),this.mapping=new Map,this.mux(()=>{this.doc.transact(s=>{const i=r.permanentUserData;i&&i.dss.forEach(c=>{Er(s,c,u=>{})});const o=(c,u)=>{const d=c==="added"?i.getUserByClientId(u.client):i.getUserByDeletedId(u);return{user:d,type:c,color:B_(r.colorMapping,r.colors,d)}},l=Zy(this.type,new Id(t.ds,e.sv)).map(c=>!c._item.deleted||ra(c._item,e)||ra(c._item,t)?Xo(c,this.prosemirrorView.state.schema,new Map,e,t,o):null).filter(c=>c!==null),a=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new B(E.from(l),0,0));this.prosemirrorView.dispatch(a.setMeta(qe,{isChangeOrigin:!0}))},qe)})}_typeChanged(e,t){const r=qe.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const s=(l,a)=>this.mapping.delete(a);Er(t,t.deleteSet,l=>{if(l.constructor===Te){const a=l.content.type;a&&this.mapping.delete(a)}}),t.changed.forEach(s),t.changedParentTypes.forEach(s);const i=this.type.toArray().map(l=>Lb(l,this.prosemirrorView.state.schema,this.mapping)).filter(l=>l!==null);let o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new B(E.from(i),0,0));V_(o,this.beforeTransactionSelection,this),o=o.setMeta(qe,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof Jy}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&o.scrollIntoView(),this.prosemirrorView.dispatch(o)})}_prosemirrorChanged(e){this.doc.transact(()=>{Iu(this.doc,this.type,e,this.mapping),this.beforeTransactionSelection=Nu(this,this.prosemirrorView.state)},qe)}destroy(){this.isDestroyed=!0,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions)}}const Lb=(n,e,t,r,s,i)=>{const o=t.get(n);if(o===void 0){if(n instanceof Dt)return Xo(n,e,t,r,s,i);throw un()}return o},Xo=(n,e,t,r,s,i)=>{const o=[],l=a=>{if(a.constructor===Dt){const c=Lb(a,e,t,r,s,i);c!==null&&o.push(c)}else{const c=H_(a,e,t,r,s,i);c!==null&&c.forEach(u=>{u!==null&&o.push(u)})}};r===void 0||s===void 0?n.toArray().forEach(l):Zy(n,new Id(s.ds,r.sv)).forEach(l);try{const a=n.getAttributes(r);r!==void 0&&(ra(n._item,r)?ra(n._item,s)||(a.ychange=i?i("added",n._item.id):{type:"added"}):a.ychange=i?i("removed",n._item.id):{type:"removed"});const c=e.node(n.nodeName,a,o);return t.set(n,c),c}catch{return n.doc.transact(c=>{n._item.delete(c)},qe),t.delete(n),null}},H_=(n,e,t,r,s,i)=>{const o=[],l=n.toDelta(r,s,i);try{for(let a=0;a{n._item.delete(c)},qe),null}return o},U_=(n,e)=>{const t=new jt,r=n.map(s=>({insert:s.text,attributes:Bb(s.marks)}));return t.applyDelta(r),e.set(t,n),t},j_=(n,e)=>{const t=new Dt(n.type.name);for(const r in n.attrs){const s=n.attrs[r];s!==null&&r!=="ychange"&&t.setAttribute(r,s)}return t.insert(0,Na(n).map(r=>Du(r,e))),e.set(t,n),t},Du=(n,e)=>n instanceof Array?U_(n,e):j_(n,e),Ip=n=>typeof n=="object"&&n!==null,Kd=(n,e)=>{const t=Object.keys(n).filter(s=>n[s]!==null);let r=t.length===Object.keys(e).filter(s=>e[s]!==null).length;for(let s=0;s{const e=n.content.content,t=[];for(let r=0;r{const t=n.toDelta();return t.length===e.length&&t.every((r,s)=>r.insert===e[s].text&&Cy(r.attributes||{}).length===e[s].marks.length&&e[s].marks.every(i=>Kd(r.attributes[i.type.name]||{},i.attrs)))},lo=(n,e)=>{if(n instanceof Dt&&!(e instanceof Array)&&Ru(n,e)){const t=Na(e);return n._length===t.length&&Kd(n.getAttributes(),e.attrs)&&n.toArray().every((r,s)=>lo(r,t[s]))}return n instanceof jt&&e instanceof Array&&Pb(n,e)},sa=(n,e)=>n===e||n instanceof Array&&e instanceof Array&&n.length===e.length&&n.every((t,r)=>e[r]===t),Rp=(n,e,t)=>{const r=n.toArray(),s=Na(e),i=s.length,o=r.length,l=Sa(o,i);let a=0,c=0,u=!1;for(;a{let e="",t=n._start;const r={};for(;t!==null;)t.deleted||(t.countable&&t.content instanceof hn?e+=t.content.str:t.content instanceof Ge&&(r[t.content.key]=null)),t=t.right;return{str:e,nAttrs:r}},q_=(n,e,t)=>{t.set(n,e);const{nAttrs:r,str:s}=W_(n),i=e.map(c=>({insert:c.text,attributes:Object.assign({},r,Bb(c.marks))})),{insert:o,remove:l,index:a}=L_(s,i.map(c=>c.insert).join(""));n.delete(a,l),n.insert(a,o),n.applyDelta(i.map(c=>({retain:c.insert.length,attributes:c.attributes})))},Bb=n=>{const e={};return n.forEach(t=>{t.type.name!=="ychange"&&(e[t.type.name]=t.attrs)}),e},Iu=(n,e,t,r)=>{if(e instanceof Dt&&e.nodeName!==t.type.name)throw new Error("node name mismatch!");if(r.set(e,t),e instanceof Dt){const d=e.getAttributes(),f=t.attrs;for(const h in f)f[h]!==null?d[h]!==f[h]&&h!=="ychange"&&e.setAttribute(h,f[h]):e.removeAttribute(h);for(const h in d)f[h]===void 0&&e.removeAttribute(h)}const s=Na(t),i=s.length,o=e.toArray(),l=o.length,a=Sa(i,l);let c=0,u=0;for(;c{for(;l-c-u>0&&i-c-u>0;){const f=o[c],h=s[c],p=o[l-u-1],m=s[i-u-1];if(f instanceof jt&&h instanceof Array)Pb(f,h)||q_(f,h,r),c+=1;else{let g=f instanceof Dt&&Ru(f,h),y=p instanceof Dt&&Ru(p,m);if(g&&y){const w=Rp(f,h,r),x=Rp(p,m,r);w.foundMappedChild&&!x.foundMappedChild?y=!1:!w.foundMappedChild&&x.foundMappedChild||w.equalityFactor0&&(e.slice(c,c+d).forEach(f=>r.delete(f)),e.delete(c,d)),c+u!(e instanceof Array)&&n.nodeName===e.type.name,Lp=(n,e,t)=>{if(n===0)return kc(e,0);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof jt){if(r._length>=n)return kc(r,n);if(n-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,n--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const s=(t.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&n1)return new Kl(r._item===null?null:r._item.id,r._item===null?to(r):null,null);if(n-=s,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(n===0)return r=r._item===null?r:r._item.parent,new Kl(r._item===null?null:r._item.id,r._item===null?to(r):null,null);do r=r._item.parent,n--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw tn();if(n===0&&r.constructor!==jt&&r!==e)return J_(r._item.parent,r._item)}return kc(e,e._length)},J_=(n,e)=>{let t=null,r=null;return n._item===null?r=to(n):t=re(n._item.id.client,n._item.id.clock),new Kl(t,r,e.id)},Pp=(n,e,t,r)=>{const s=gO(t,n);if(s===null||s.type!==e&&!no(e,s.type._item))return null;let i=s.type,o=0;if(i.constructor===jt)o=s.index;else if(i._item===null||!i._item.deleted){let l=i._first,a=0;for(;a{const e=Jn.getState(n).undoManager;if(e!=null)return e.undo(),!0},G_=n=>{const e=Jn.getState(n).undoManager;if(e!=null)return e.redo(),!0},Y_=new Set(["paragraph"]),X_=(n,e)=>!(n instanceof Te)||!(n.content instanceof mn)||!(n.content.type instanceof ls||n.content.type instanceof Dt&&e.has(n.content.type.nodeName))||n.content.type._length===0,Q_=({protectedNodes:n=Y_,trackedOrigins:e=[],undoManager:t=null}={})=>new Qe({key:Jn,state:{init:(r,s)=>{const i=qe.getState(s),o=t||new Jy(i.type,{trackedOrigins:new Set([qe].concat(e)),deleteFilter:l=>X_(l,n),captureTransaction:l=>l.meta.get("addToHistory")!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(r,s,i,o)=>{const l=qe.getState(o).binding,a=s.undoManager,c=a.undoStack.length>0,u=a.redoStack.length>0;return l?{undoManager:a,prevSel:Nu(l,i),hasUndoOps:c,hasRedoOps:u}:c!==s.hasUndoOps||u!==s.hasRedoOps?Object.assign({},s,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):s}},view:r=>{const s=qe.getState(r.state),i=Jn.getState(r.state).undoManager;return i.on("stack-item-added",({stackItem:o})=>{const l=s.binding;l&&o.meta.set(l,Jn.getState(r.state).prevSel)}),i.on("stack-item-popped",({stackItem:o})=>{const l=s.binding;l&&(l.beforeTransactionSelection=o.meta.get(l)||l.beforeTransactionSelection)}),{destroy:()=>{i.destroy()}}}}),Z_=ft.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},onCreate(){this.editor.extensionManager.extensions.find(n=>n.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:n,state:e,dispatch:t})=>(n.setMeta("preventDispatch",!0),Jn.getState(e).undoManager.undoStack.length===0?!1:t?K_(e):!0),redo:()=>({tr:n,state:e,dispatch:t})=>(n.setMeta("preventDispatch",!0),Jn.getState(e).undoManager.redoStack.length===0?!1:t?G_(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){const n=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),e=Q_(),t=e.spec.view;e.spec.view=o=>{const{undoManager:l}=Jn.getState(o.state);l.restore&&(l.restore(),l.restore=()=>{});const a=t?t(o):void 0;return{destroy:()=>{const c=l.trackedOrigins.has(l),u=l._observers;l.restore=()=>{c&&l.trackedOrigins.add(l),l.doc.on("afterTransaction",l.afterTransactionHandler),l._observers=u},a!=null&&a.destroy&&a.destroy()}}};const r=this.options.onFirstRender;return[z_(n,r?{onFirstRender:r}:{}),e]}});function eN(n,e){return[fy.configure({history:!1}),Z_.configure({document:n.document}),Qg.configure({element:e}),sy.configure({openOnClick:!1,autolink:!0}),hy.configure({inline:!0}),oy.configure({types:["heading","paragraph"]}),iy]}function Bp(n){let e,t,r,s,i,o,l,a,c,u,d,f,h,p,m,g,y,w,x,b,L,S,z,ee,$,Z,X,A,P,F,W,H,V,J,G,le,ce,pe,ue,Ye,Re,Oe,je,We,He,At,pt,Qn,Mt,Zn,xt,Ln,vt,er,Et,Pt,Ze,gn,nn,tr;return r=new Ce({props:{class:"h-8 px-2 max-lg:hidden",$$slots:{default:[tN]},$$scope:{ctx:n}}}),r.$on("click",n[6]),i=new Ce({props:{disabled:!n[1].can().chain().focus().toggleBold().run(),variant:n[1].isActive("bold")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[nN]},$$scope:{ctx:n}}}),i.$on("click",n[7]),l=new Ce({props:{disabled:!n[1].can().chain().focus().toggleItalic().run(),variant:n[1].isActive("italic")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[rN]},$$scope:{ctx:n}}}),l.$on("click",n[8]),c=new Ce({props:{disabled:!n[1].can().chain().focus().toggleStrike().run(),variant:n[1].isActive("strike")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[sN]},$$scope:{ctx:n}}}),c.$on("click",n[9]),d=new Ce({props:{disabled:!n[1].can().chain().focus().toggleCode().run(),variant:n[1].isActive("code")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[iN]},$$scope:{ctx:n}}}),d.$on("click",n[10]),h=new Ce({props:{variant:n[1].isActive("paragraph")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[oN]},$$scope:{ctx:n}}}),h.$on("click",n[11]),m=new Ce({props:{variant:n[1].isActive("heading",{level:1})?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[lN]},$$scope:{ctx:n}}}),m.$on("click",n[12]),y=new Ce({props:{variant:n[1].isActive("heading",{level:2})?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[aN]},$$scope:{ctx:n}}}),y.$on("click",n[13]),x=new Ce({props:{variant:n[1].isActive("heading",{level:3})?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[cN]},$$scope:{ctx:n}}}),x.$on("click",n[14]),L=new Ce({props:{class:"h-8 px-2 max-lg:hidden",variant:n[1].isActive({textAlign:"left"})?"default":"secondary",$$slots:{default:[uN]},$$scope:{ctx:n}}}),L.$on("click",n[15]),z=new Ce({props:{class:"h-8 px-2 max-lg:hidden",variant:n[1].isActive({textAlign:"center"})?"default":"secondary",$$slots:{default:[dN]},$$scope:{ctx:n}}}),z.$on("click",n[16]),$=new Ce({props:{class:"h-8 px-2 max-lg:hidden",variant:n[1].isActive({textAlign:"right"})?"default":"secondary",$$slots:{default:[fN]},$$scope:{ctx:n}}}),$.$on("click",n[17]),X=new Ce({props:{variant:n[1].isActive("bulletList")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[hN]},$$scope:{ctx:n}}}),X.$on("click",n[18]),P=new Ce({props:{variant:n[1].isActive("orderedList")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[pN]},$$scope:{ctx:n}}}),P.$on("click",n[19]),W=new Ce({props:{variant:n[1].isActive("codeBlock")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[mN]},$$scope:{ctx:n}}}),W.$on("click",n[20]),V=new Ce({props:{variant:n[1].isActive("blockquote")?"default":"secondary",class:"h-8 px-2 max-lg:hidden",$$slots:{default:[gN]},$$scope:{ctx:n}}}),V.$on("click",n[21]),G=new Ce({props:{class:"h-8 px-2 max-lg:hidden",$$slots:{default:[yN]},$$scope:{ctx:n}}}),G.$on("click",n[22]),ce=new Ce({props:{variant:n[1].isActive("link")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[bN]},$$scope:{ctx:n}}}),ce.$on("click",n[23]),ue=new Ce({props:{disabled:!n[1].isActive("link"),class:"h-8 px-2 max-lg:hidden",$$slots:{default:[wN]},$$scope:{ctx:n}}}),ue.$on("click",n[24]),Re=new Ce({props:{class:"h-8 px-2",$$slots:{default:[vN]},$$scope:{ctx:n}}}),Re.$on("click",n[25]),je=new Ce({props:{disabled:!n[1].can().chain().focus().undo().run(),class:"h-8 px-2",$$slots:{default:[kN]},$$scope:{ctx:n}}}),je.$on("click",n[26]),He=new Ce({props:{disabled:!n[1].can().chain().focus().redo().run(),class:"h-8 px-2",$$slots:{default:[SN]},$$scope:{ctx:n}}}),He.$on("click",n[27]),pt=new Ce({props:{class:"h-8 px-2",$$slots:{default:[CN]},$$scope:{ctx:n}}}),pt.$on("click",n[28]),xt=new Ce({props:{class:"h-8 px-2",$$slots:{default:[$N]},$$scope:{ctx:n}}}),xt.$on("click",n[31]),vt=new Ce({props:{class:"h-8 px-2",$$slots:{default:[AN]},$$scope:{ctx:n}}}),vt.$on("click",DN),Et=new Ce({props:{disabled:!n[4],class:"h-8 px-2",$$slots:{default:[MN]},$$scope:{ctx:n}}}),Et.$on("click",n[5]),Ze=new Ce({props:{class:"h-8 px-2",$$slots:{default:[xN]},$$scope:{ctx:n}}}),Ze.$on("click",jb),{c(){e=wr("div"),t=wr("nav"),O(r.$$.fragment),s=ye(),O(i.$$.fragment),o=ye(),O(l.$$.fragment),a=ye(),O(c.$$.fragment),u=ye(),O(d.$$.fragment),f=ye(),O(h.$$.fragment),p=ye(),O(m.$$.fragment),g=ye(),O(y.$$.fragment),w=ye(),O(x.$$.fragment),b=ye(),O(L.$$.fragment),S=ye(),O(z.$$.fragment),ee=ye(),O($.$$.fragment),Z=ye(),O(X.$$.fragment),A=ye(),O(P.$$.fragment),F=ye(),O(W.$$.fragment),H=ye(),O(V.$$.fragment),J=ye(),O(G.$$.fragment),le=ye(),O(ce.$$.fragment),pe=ye(),O(ue.$$.fragment),Ye=ye(),O(Re.$$.fragment),Oe=ye(),O(je.$$.fragment),We=ye(),O(He.$$.fragment),At=ye(),O(pt.$$.fragment),Qn=ye(),Mt=wr("input"),Zn=ye(),O(xt.$$.fragment),Ln=ye(),O(vt.$$.fragment),er=ye(),O(Et.$$.fragment),Pt=ye(),O(Ze.$$.fragment),this.h()},l(M){e=vr(M,"DIV",{});var I=Kn(e);t=vr(I,"NAV",{class:!0});var U=Kn(t);_(r.$$.fragment,U),s=be(U),_(i.$$.fragment,U),o=be(U),_(l.$$.fragment,U),a=be(U),_(c.$$.fragment,U),u=be(U),_(d.$$.fragment,U),f=be(U),_(h.$$.fragment,U),p=be(U),_(m.$$.fragment,U),g=be(U),_(y.$$.fragment,U),w=be(U),_(x.$$.fragment,U),b=be(U),_(L.$$.fragment,U),S=be(U),_(z.$$.fragment,U),ee=be(U),_($.$$.fragment,U),Z=be(U),_(X.$$.fragment,U),A=be(U),_(P.$$.fragment,U),F=be(U),_(W.$$.fragment,U),H=be(U),_(V.$$.fragment,U),J=be(U),_(G.$$.fragment,U),le=be(U),_(ce.$$.fragment,U),pe=be(U),_(ue.$$.fragment,U),Ye=be(U),_(Re.$$.fragment,U),Oe=be(U),_(je.$$.fragment,U),We=be(U),_(He.$$.fragment,U),At=be(U),_(pt.$$.fragment,U),Qn=be(U),Mt=vr(U,"INPUT",{type:!0,id:!0,style:!0}),Zn=be(U),_(xt.$$.fragment,U),Ln=be(U),_(vt.$$.fragment,U),er=be(U),_(Et.$$.fragment,U),Pt=be(U),_(Ze.$$.fragment,U),U.forEach(Le),I.forEach(Le),this.h()},h(){Lo(Mt,"type","file"),Lo(Mt,"id","selectedFile"),Ub(Mt,"display","none"),Lo(t,"class","fixed left-0 top-0 z-10 w-full bg-white py-4 text-center dark:bg-[color:hsl(240,10%,3.9%)] max-lg:px-4 max-lg:text-left max-md:p-2")},m(M,I){ut(M,e,I),Ee(e,t),N(r,t,null),Ee(t,s),N(i,t,null),Ee(t,o),N(l,t,null),Ee(t,a),N(c,t,null),Ee(t,u),N(d,t,null),Ee(t,f),N(h,t,null),Ee(t,p),N(m,t,null),Ee(t,g),N(y,t,null),Ee(t,w),N(x,t,null),Ee(t,b),N(L,t,null),Ee(t,S),N(z,t,null),Ee(t,ee),N($,t,null),Ee(t,Z),N(X,t,null),Ee(t,A),N(P,t,null),Ee(t,F),N(W,t,null),Ee(t,H),N(V,t,null),Ee(t,J),N(G,t,null),Ee(t,le),N(ce,t,null),Ee(t,pe),N(ue,t,null),Ee(t,Ye),N(Re,t,null),Ee(t,Oe),N(je,t,null),Ee(t,We),N(He,t,null),Ee(t,At),N(pt,t,null),Ee(t,Qn),Ee(t,Mt),Ee(t,Zn),N(xt,t,null),Ee(t,Ln),N(vt,t,null),Ee(t,er),N(Et,t,null),Ee(t,Pt),N(Ze,t,null),gn=!0,nn||(tr=[Ot(Mt,"change",n[29]),Ot(Mt,"change",n[30])],nn=!0)},p(M,I){const U={};I[1]&256&&(U.$$scope={dirty:I,ctx:M}),r.$set(U);const Pn={};I[0]&2&&(Pn.disabled=!M[1].can().chain().focus().toggleBold().run()),I[0]&2&&(Pn.variant=M[1].isActive("bold")?"default":"secondary"),I[1]&256&&(Pn.$$scope={dirty:I,ctx:M}),i.$set(Pn);const hs={};I[0]&2&&(hs.disabled=!M[1].can().chain().focus().toggleItalic().run()),I[0]&2&&(hs.variant=M[1].isActive("italic")?"default":"secondary"),I[1]&256&&(hs.$$scope={dirty:I,ctx:M}),l.$set(hs);const ps={};I[0]&2&&(ps.disabled=!M[1].can().chain().focus().toggleStrike().run()),I[0]&2&&(ps.variant=M[1].isActive("strike")?"default":"secondary"),I[1]&256&&(ps.$$scope={dirty:I,ctx:M}),c.$set(ps);const ms={};I[0]&2&&(ms.disabled=!M[1].can().chain().focus().toggleCode().run()),I[0]&2&&(ms.variant=M[1].isActive("code")?"default":"secondary"),I[1]&256&&(ms.$$scope={dirty:I,ctx:M}),d.$set(ms);const li={};I[0]&2&&(li.variant=M[1].isActive("paragraph")?"default":"secondary"),I[1]&256&&(li.$$scope={dirty:I,ctx:M}),h.$set(li);const ai={};I[0]&2&&(ai.variant=M[1].isActive("heading",{level:1})?"default":"secondary"),I[1]&256&&(ai.$$scope={dirty:I,ctx:M}),m.$set(ai);const C={};I[0]&2&&(C.variant=M[1].isActive("heading",{level:2})?"default":"secondary"),I[1]&256&&(C.$$scope={dirty:I,ctx:M}),y.$set(C);const j={};I[0]&2&&(j.variant=M[1].isActive("heading",{level:3})?"default":"secondary"),I[1]&256&&(j.$$scope={dirty:I,ctx:M}),x.$set(j);const Q={};I[0]&2&&(Q.variant=M[1].isActive({textAlign:"left"})?"default":"secondary"),I[1]&256&&(Q.$$scope={dirty:I,ctx:M}),L.$set(Q);const ge={};I[0]&2&&(ge.variant=M[1].isActive({textAlign:"center"})?"default":"secondary"),I[1]&256&&(ge.$$scope={dirty:I,ctx:M}),z.$set(ge);const de={};I[0]&2&&(de.variant=M[1].isActive({textAlign:"right"})?"default":"secondary"),I[1]&256&&(de.$$scope={dirty:I,ctx:M}),$.$set(de);const Xe={};I[0]&2&&(Xe.variant=M[1].isActive("bulletList")?"default":"secondary"),I[1]&256&&(Xe.$$scope={dirty:I,ctx:M}),X.$set(Xe);const mt={};I[0]&2&&(mt.variant=M[1].isActive("orderedList")?"default":"secondary"),I[1]&256&&(mt.$$scope={dirty:I,ctx:M}),P.$set(mt);const yn={};I[0]&2&&(yn.variant=M[1].isActive("codeBlock")?"default":"secondary"),I[1]&256&&(yn.$$scope={dirty:I,ctx:M}),W.$set(yn);const gs={};I[0]&2&&(gs.variant=M[1].isActive("blockquote")?"default":"secondary"),I[1]&256&&(gs.$$scope={dirty:I,ctx:M}),V.$set(gs);const bn={};I[1]&256&&(bn.$$scope={dirty:I,ctx:M}),G.$set(bn);const Ir={};I[0]&2&&(Ir.variant=M[1].isActive("link")?"default":"secondary"),I[1]&256&&(Ir.$$scope={dirty:I,ctx:M}),ce.$set(Ir);const nr={};I[0]&2&&(nr.disabled=!M[1].isActive("link")),I[1]&256&&(nr.$$scope={dirty:I,ctx:M}),ue.$set(nr);const Bn={};I[1]&256&&(Bn.$$scope={dirty:I,ctx:M}),Re.$set(Bn);const ci={};I[0]&2&&(ci.disabled=!M[1].can().chain().focus().undo().run()),I[1]&256&&(ci.$$scope={dirty:I,ctx:M}),je.$set(ci);const Rr={};I[0]&2&&(Rr.disabled=!M[1].can().chain().focus().redo().run()),I[1]&256&&(Rr.$$scope={dirty:I,ctx:M}),He.$set(Rr);const Lr={};I[1]&256&&(Lr.$$scope={dirty:I,ctx:M}),pt.$set(Lr);const Gd={};I[1]&256&&(Gd.$$scope={dirty:I,ctx:M}),xt.$set(Gd);const Yd={};I[1]&256&&(Yd.$$scope={dirty:I,ctx:M}),vt.$set(Yd);const Da={};I[0]&16&&(Da.disabled=!M[4]),I[1]&256&&(Da.$$scope={dirty:I,ctx:M}),Et.$set(Da);const Xd={};I[1]&256&&(Xd.$$scope={dirty:I,ctx:M}),Ze.$set(Xd)},i(M){gn||(v(r.$$.fragment,M),v(i.$$.fragment,M),v(l.$$.fragment,M),v(c.$$.fragment,M),v(d.$$.fragment,M),v(h.$$.fragment,M),v(m.$$.fragment,M),v(y.$$.fragment,M),v(x.$$.fragment,M),v(L.$$.fragment,M),v(z.$$.fragment,M),v($.$$.fragment,M),v(X.$$.fragment,M),v(P.$$.fragment,M),v(W.$$.fragment,M),v(V.$$.fragment,M),v(G.$$.fragment,M),v(ce.$$.fragment,M),v(ue.$$.fragment,M),v(Re.$$.fragment,M),v(je.$$.fragment,M),v(He.$$.fragment,M),v(pt.$$.fragment,M),v(xt.$$.fragment,M),v(vt.$$.fragment,M),v(Et.$$.fragment,M),v(Ze.$$.fragment,M),gn=!0)},o(M){k(r.$$.fragment,M),k(i.$$.fragment,M),k(l.$$.fragment,M),k(c.$$.fragment,M),k(d.$$.fragment,M),k(h.$$.fragment,M),k(m.$$.fragment,M),k(y.$$.fragment,M),k(x.$$.fragment,M),k(L.$$.fragment,M),k(z.$$.fragment,M),k($.$$.fragment,M),k(X.$$.fragment,M),k(P.$$.fragment,M),k(W.$$.fragment,M),k(V.$$.fragment,M),k(G.$$.fragment,M),k(ce.$$.fragment,M),k(ue.$$.fragment,M),k(Re.$$.fragment,M),k(je.$$.fragment,M),k(He.$$.fragment,M),k(pt.$$.fragment,M),k(xt.$$.fragment,M),k(vt.$$.fragment,M),k(Et.$$.fragment,M),k(Ze.$$.fragment,M),gn=!1},d(M){M&&Le(e),D(r),D(i),D(l),D(c),D(d),D(h),D(m),D(y),D(x),D(L),D(z),D($),D(X),D(P),D(W),D(V),D(G),D(ce),D(ue),D(Re),D(je),D(He),D(pt),D(xt),D(vt),D(Et),D(Ze),nn=!1,Lu(tr)}}}function tN(n){let e,t;return e=new EC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function nN(n){let e,t;return e=new Og({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function rN(n){let e,t;return e=new Ng({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function sN(n){let e,t;return e=new Dg({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function iN(n){let e,t;return e=new _g({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function oN(n){let e,t;return e=new E$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function lN(n){let e,t;return e=new JC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function aN(n){let e,t;return e=new XC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function cN(n){let e,t;return e=new t$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function uN(n){let e,t;return e=new yC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function dN(n){let e,t;return e=new hC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function fN(n){let e,t;return e=new kC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function hN(n){let e,t;return e=new $$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function pN(n){let e,t;return e=new v$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function mN(n){let e,t;return e=new NC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function gN(n){let e,t;return e=new tA({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function yN(n){let e,t;return e=new j$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function bN(n){let e,t;return e=new g$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function wN(n){let e,t;return e=new f$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function vN(n){let e,t;return e=new i$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function kN(n){let e,t;return e=new iA({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function SN(n){let e,t;return e=new N$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function CN(n){let e,t;return e=new zC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function $N(n){let e,t;return e=new UC({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function AN(n){let e,t;return e=new V$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function MN(n){let e,t;return e=new L$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function xN(n){let e,t;return e=new X$({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function zp(n){let e,t,r,s,i,o,l,a;return e=new Ce({props:{variant:n[1].isActive("bold")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[EN]},$$scope:{ctx:n}}}),e.$on("click",n[32]),r=new Ce({props:{variant:n[1].isActive("italic")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[TN]},$$scope:{ctx:n}}}),r.$on("click",n[33]),i=new Ce({props:{variant:n[1].isActive("strike")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[ON]},$$scope:{ctx:n}}}),i.$on("click",n[34]),l=new Ce({props:{variant:n[1].isActive("code")?"default":"secondary",class:"h-8 px-2",$$slots:{default:[_N]},$$scope:{ctx:n}}}),l.$on("click",n[35]),{c(){O(e.$$.fragment),t=ye(),O(r.$$.fragment),s=ye(),O(i.$$.fragment),o=ye(),O(l.$$.fragment)},l(c){_(e.$$.fragment,c),t=be(c),_(r.$$.fragment,c),s=be(c),_(i.$$.fragment,c),o=be(c),_(l.$$.fragment,c)},m(c,u){N(e,c,u),ut(c,t,u),N(r,c,u),ut(c,s,u),N(i,c,u),ut(c,o,u),N(l,c,u),a=!0},p(c,u){const d={};u[0]&2&&(d.variant=c[1].isActive("bold")?"default":"secondary"),u[1]&256&&(d.$$scope={dirty:u,ctx:c}),e.$set(d);const f={};u[0]&2&&(f.variant=c[1].isActive("italic")?"default":"secondary"),u[1]&256&&(f.$$scope={dirty:u,ctx:c}),r.$set(f);const h={};u[0]&2&&(h.variant=c[1].isActive("strike")?"default":"secondary"),u[1]&256&&(h.$$scope={dirty:u,ctx:c}),i.$set(h);const p={};u[0]&2&&(p.variant=c[1].isActive("code")?"default":"secondary"),u[1]&256&&(p.$$scope={dirty:u,ctx:c}),l.$set(p)},i(c){a||(v(e.$$.fragment,c),v(r.$$.fragment,c),v(i.$$.fragment,c),v(l.$$.fragment,c),a=!0)},o(c){k(e.$$.fragment,c),k(r.$$.fragment,c),k(i.$$.fragment,c),k(l.$$.fragment,c),a=!1},d(c){c&&(Le(t),Le(s),Le(o)),D(e,c),D(r,c),D(i,c),D(l,c)}}}function EN(n){let e,t;return e=new Og({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function TN(n){let e,t;return e=new Ng({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function ON(n){let e,t;return e=new Dg({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function _N(n){let e,t;return e=new _g({props:{class:"h-4 w-4"}}),{c(){O(e.$$.fragment)},l(r){_(e.$$.fragment,r)},m(r,s){N(e,r,s),t=!0},p:we,i(r){t||(v(e.$$.fragment,r),t=!0)},o(r){k(e.$$.fragment,r),t=!1},d(r){D(e,r)}}}function NN(n){let e,t,r,s,i,o=n[1]&&Bp(n),l=n[1]&&zp(n);return{c(){o&&o.c(),e=ye(),t=wr("div"),l&&l.c(),r=ye(),s=wr("div"),this.h()},l(a){o&&o.l(a),e=be(a),t=vr(a,"DIV",{class:!0});var c=Kn(t);l&&l.l(c),c.forEach(Le),r=be(a),s=vr(a,"DIV",{}),Kn(s).forEach(Le),this.h()},h(){Lo(t,"class","bubble-menu rounded-md")},m(a,c){o&&o.m(a,c),ut(a,e,c),ut(a,t,c),l&&l.m(t,null),n[36](t),ut(a,r,c),ut(a,s,c),n[37](s),i=!0},p(a,c){a[1]?o?(o.p(a,c),c[0]&2&&v(o,1)):(o=Bp(a),o.c(),v(o,1),o.m(e.parentNode,e)):o&&(xc(),k(o,1,1,()=>{o=null}),Ec()),a[1]?l?(l.p(a,c),c[0]&2&&v(l,1)):(l=zp(a),l.c(),v(l,1),l.m(t,null)):l&&(xc(),k(l,1,1,()=>{l=null}),Ec())},i(a){i||(v(o),v(l),i=!0)},o(a){k(o),k(l),i=!1},d(a){a&&(Le(e),Le(t),Le(r),Le(s)),o&&o.d(a),l&&l.d(),n[36](null),n[37](null)}}}function DN(){const n=window.prompt("Please insert metadata for collaboration",'{"url":"ws://localhost:1234","name":"example-document"}');if(n)try{const{url:e,name:t}=JSON.parse(n);if(!e)throw new Error("url does not exist on meatadata");if(!t)throw new Error("name does not exist on meatadata");localStorage.setItem("collab",n),location.reload()}catch(e){console.error(e),window.alert("Invalid metadata format")}}function IN(n,e,t){let r,s,i,o,l="",a;Fb(async()=>{const Oe=localStorage.getItem("collab");let je;if(Oe)try{const{url:We,name:He}=JSON.parse(Oe),At=new _b({url:We,maxAttempts:2});t(4,a=new __({websocketProvider:At,name:He,onConnect(){window.alert(`Connected to ${We}/${He}`)},connect:!1})),await a.connect(),je=eN(a,i)}catch(We){window.alert(`Failed to start a collaboration with ${Oe}`),console.error(We),localStorage.removeItem("collab"),location.reload()}else je=dE(i),l=localStorage.getItem("auto-saved")??oA;t(1,s=new Pk({element:r,editorProps:{attributes:{class:"md:mt-16 mt-12 md:w-[708px] md:py-16 md:px-0 md:mx-auto p-4 outline-none"}},extensions:je,onUpdate({editor:We}){try{localStorage.setItem("auto-saved",We.getHTML())}catch(He){console.error(He)}},content:l,onTransaction:()=>{t(1,s)}})),s.commands.focus()});function c(){localStorage.removeItem("collab"),a&&(window.alert("Disconnecting..."),location.reload())}const u=()=>dA(s),d=()=>s.chain().focus().toggleBold().run(),f=()=>s.chain().focus().toggleItalic().run(),h=()=>s.chain().focus().toggleStrike().run(),p=()=>s.chain().focus().toggleCode().run(),m=()=>s.chain().focus().setParagraph().run(),g=()=>s.chain().focus().toggleHeading({level:1}).run(),y=()=>s.chain().focus().toggleHeading({level:2}).run(),w=()=>s.chain().focus().toggleHeading({level:3}).run(),x=()=>s.chain().focus().setTextAlign("left").run(),b=()=>s.chain().focus().setTextAlign("center").run(),L=()=>s.chain().focus().setTextAlign("right").run(),S=()=>s.chain().focus().toggleBulletList().run(),z=()=>s.chain().focus().toggleOrderedList().run(),ee=()=>s.chain().focus().toggleCodeBlock().run(),$=()=>s.chain().focus().toggleBlockquote().run(),Z=()=>s.chain().focus().setHorizontalRule().run(),X=()=>uA(s),A=()=>s.chain().focus().unsetLink().run(),P=()=>fA(s),F=()=>s.chain().focus().undo().run(),W=()=>s.chain().focus().redo().run(),H=()=>aA(s);function V(){o=this.files,t(3,o)}const J=()=>cA(s,o),G=()=>{var Oe;return(Oe=document.getElementById("selectedFile"))==null?void 0:Oe.click()},le=()=>s.chain().focus().toggleBold().run(),ce=()=>s.chain().focus().toggleItalic().run(),pe=()=>s.chain().focus().toggleStrike().run(),ue=()=>s.chain().focus().toggleCode().run();function Ye(Oe){Mc[Oe?"unshift":"push"](()=>{i=Oe,t(2,i)})}function Re(Oe){Mc[Oe?"unshift":"push"](()=>{r=Oe,t(0,r)})}return[r,s,i,o,a,c,u,d,f,h,p,m,g,y,w,x,b,L,S,z,ee,$,Z,X,A,P,F,W,H,V,J,G,le,ce,pe,ue,Ye,Re]}class RN extends ve{constructor(e){super(),ke(this,e,IN,NN,me,{},null,[-1,-1])}}function LN(n){let e,t,r;return t=new RN({}),{c(){e=wr("main"),O(t.$$.fragment)},l(s){e=vr(s,"MAIN",{});var i=Kn(e);_(t.$$.fragment,i),i.forEach(Le)},m(s,i){ut(s,e,i),N(t,e,null),r=!0},p:we,i(s){r||(v(t.$$.fragment,s),r=!0)},o(s){k(t.$$.fragment,s),r=!1},d(s){s&&Le(e),D(t)}}}class QN extends ve{constructor(e){super(),ke(this,e,null,LN,me,{})}}export{QN as component}; diff --git a/_app/version.json b/_app/version.json index 0dfca5c..4ad4a2a 100644 --- a/_app/version.json +++ b/_app/version.json @@ -1 +1 @@ -{"version":"1707108212975"} \ No newline at end of file +{"version":"1707108298629"} \ No newline at end of file diff --git a/index.html b/index.html index 4247b96..348d190 100644 --- a/index.html +++ b/index.html @@ -8,17 +8,17 @@ LightNote - + - - + + - + - + -