diff --git a/front/dist/assets/main-BVNnoznq.css b/front/dist/assets/main-BVNnoznq.css deleted file mode 100644 index 910bac9..0000000 --- a/front/dist/assets/main-BVNnoznq.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";:root{--p10: #f4f9ff;--p20: #eaf1f9;--p30: #b3ceff;--p40: #8db5ff;--p50: #70a2ff;--p60: #679cff;--p70: #4284ff;--p80: #1c6bff;--p90: #002b7a;--p100: #000C23;--suc10: #d1ffb8;--suc20: #d1ffb8;--suc30: #b5ff8d;--suc40: #a2ff70;--suc50: #82cc5a;--suc80: #71b34e;--suc90: #314c22;--err10: #ffb9d0;--err20: #ff9bb3;--err30: #fe7e97;--err40: #de617b;--err50: #be4461;--err80: #61001a;--err90: #560012;--grey-dark: #424656;--grey-light: #a6abbd;--text: var(--p100);--text-light: var(--grey-dark);--text-error: var(--err50);--main-font: ‘Open Sans‘, Arial, Helvetica, sans-serif}*,*:before,*:after{box-sizing:border-box}*{margin:0}body{line-height:1.5;-webkit-font-smoothing:antialiased}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}#root,#__next{isolation:isolate}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.pt-1{padding-top:4px}.pt-2{padding-top:8px}.pt-3{padding-top:12px}.pt-4{padding-top:16px}.pt-5{padding-top:20px}.pb-1{padding-bottom:4px}.pb-2{padding-bottom:8px}.pb-3{padding-bottom:12px}.pb-4{padding-bottom:16px}.pb-5{padding-bottom:20px}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-5{gap:20px}.hide{display:none!important}.hidden{visibility:hidden}.d-block{display:block}.d-inline-block{display:inline-block}.is-bold{font-weight:700}.in-place{padding:36px}.notice{background-color:var(--p20);padding:14px;margin:2rem 0;position:relative;font-size:16px;line-height:24px;border-radius:12px}.notice .title{content:"NOTE";border-radius:12px;display:block;font-weight:700}.notice.notice-success{background:var(--suc20)}.notice.notice-error{background:var(--err10)}.scope-login{display:flex;height:100vh}.scope-login .bg-image{width:50%;background:url(/vendor/lucent/public/art.jpg);background-size:cover;background-repeat:no-repeat;background-position:center center}.scope-login .login-form{width:50%;height:100vh;display:flex;align-items:center;justify-content:center}.content{font-size:16px;line-height:20px;font-family:var(--main-font);color:var(--text)}.content p{margin-bottom:14px}.content p:last-child{margin-bottom:0}.content h1{font-size:24px;line-height:34px}.content h2{font-size:20px;line-height:30px}.content h3{font-size:18px;line-height:28px}.content ul{padding:0 0 0 16px;list-style:none outside none}.content ul li:before{content:"—";opacity:.5;font-size:12px;padding-right:6px;vertical-align:10%}.content ul li{list-style:none;padding:0}.content code{background:var(--p30);padding:0 6px;border-radius:12px}.content img{margin-bottom:14px}.content blockquote{border:1px solid var(--p30);border-radius:12px;padding:12px 40px;position:relative}.content blockquote:before{content:"“";color:var(--p60);font-size:4em;position:absolute;left:10px;top:20px}.content blockquote:after{content:""}.content pre{background:var(--grey-light);border-radius:.5rem;color:var(--white);font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.content pre code{background:none;color:inherit;font-size:.8rem;padding:0}.lx-small-text{font-size:12px;line-height:15px}.light-text{color:var(--text-light)}.sidebar-top{border:0px solid var(--p30);font-size:18px;padding:20px;display:flex;align-items:center;justify-content:space-between;background:var(--p20);margin-bottom:15px;border-radius:12px}.sidebar{border-radius:12px;font-size:15px;line-height:28px;padding:20px;background:var(--p20);display:flex;flex-direction:column;gap:3px}.sidebar-header{display:flex;cursor:pointer;justify-content:space-between;align-items:center;background:var(--p30);font-size:16px;padding:3px 12px;color:var(--text);border:none;border-radius:12px}.sidebar-header:focus{box-shadow:none}.sidebar-header:hover{background:var(--p40)}.sidebar-header:last-child{border-bottom:none}.sidebar-item{color:var(--text);display:block;font-size:14px;padding:3px 12px;text-decoration:none;transition:.6s;border-radius:12px}.sidebar-item:last-child{border-bottom:none}.sidebar-item:hover{background:var(--p30)}.sidebar-item.active{background:var(--p40)}.top-nav{display:flex;justify-content:end;align-items:center;gap:10px}.top-nav-item{border-radius:12px;font-size:14px;background:var(--p20);padding:3px 10px}.top-nav-item:hover{background:var(--p30)}label{display:block;font-weight:700;margin-bottom:4px}input[type=text],input[type=number],input[type=search],input[type=email],textarea{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:5px;padding:5px 7px;font-size:16px}input[type=text]:focus,input[type=number]:focus,input[type=search]:focus,input[type=email]:focus,textarea:focus{background:var(--p10)}textarea{resize:none}select{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:5px;padding:5px 7px;font-size:16px}select:focus{background:var(--p10)}.htmx-indicator{display:none}.htmx-request .htmx-indicator,.htmx-request.htmx-indicator{display:inline}.bt{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#000;background-image:none;border:1px solid #000;border-radius:4px;box-shadow:#fff 4px 4px,#000 4px 4px 0 1px;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:ITCAvantGardeStd-Bk,Arial,sans-serif;font-size:16px;font-weight:400;line-height:20px;margin:0 5px 10px 0;overflow:visible;padding:8px 40px;text-align:center;text-transform:none;touch-action:manipulation;user-select:none;-webkit-user-select:none;vertical-align:middle;white-space:nowrap}.bt:focus{text-decoration:none}.bt:hover{text-decoration:none}.bt:active{box-shadow:#00000020 0 3px 5px inset;outline:0}.bt:not([disabled]):active{box-shadow:#fff 2px 2px,#000 2px 2px 0 1px;transform:translate(2px,2px)}.table{min-width:600px;overflow:auto;background:var(--p20);padding:1px;font-size:14px;border-radius:12px}.table table{background:var(--p20);width:100%;border-collapse:separate;border:none;border-spacing:0}.table thead,.table thead tr{border-radius:12px}.table th{font-size:14px;font-weight:400;white-space:nowrap;max-width:400px;border:none;background:var(--p20);text-align:left;padding:8px 16px}.table th.is-sort{font-weight:700}.table th:first-child{border-radius:12px 0 0}.table th:last-child{border-radius:0 12px 0 0}.table td{font-weight:400;white-space:nowrap;max-width:400px;height:48px;padding:4px 16px;border:none;overflow:hidden}.table td .status{color:var(--text);font-size:80%}.table td .row-name{display:flex;align-items:center;gap:6px}.table td .title-td-contents{display:flex;align-items:center;gap:6px;font-size:14px;line-height:14px}.table tbody tr{border-radius:12px;background:var(--p10);border:none}.table tbody tr:has(input:checked){background:var(--p30)}.table tbody tr:hover{background:var(--p20)}.table .field-ui-number{text-align:right}.table .references{display:flex;gap:4px}.table .references .reference{font-size:13px;border-radius:12px;background:var(--p30);padding:1px 5px}.file-table-row{display:flex;align-items:center;gap:5px}.file-table-row>div{display:flex;flex-flow:column;gap:5px}.avatar{display:inline-block;vertical-align:middle;position:relative;color:#fff;border-radius:50%}.avatar__letters{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.avatars-compact{position:relative}.avatars-compact .avatar{margin-left:-9px}.is-editable-false .cm-content{background-color:var(--p10)}.cm-focused .cm-content{background-color:var(--p10);color:var(--p100)}.cm-content{background-color:var(--p20)}.ͼ4 .cm-line ::selection,.ͼ4 .cm-line::selection{background:var(--p40)!important}.cm-activeLine{background-color:var(--p20)!important}.tiptap{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:0 0 5px 5px;padding:15px;font-size:16px}.tiptap :first-child{margin-top:0}.tiptap:focus{background:var(--p10)}.tiptap img.ProseMirror-selectednode{box-shadow:0 0 1px 2px var(--p70)}.editor-field .editor-toolbar{display:flex;gap:4px;background:var(--p30);border-radius:5px 5px 0 0;padding:5px 7px}.editor-field .editor-toolbar .button:not(.primary){font-weight:700}.editor-field .editor-toolbar .button:not(.primary).active{background:var(--p40)}.content .tiptap li>p{display:inline}trix-editor{background:var(--p20)!important;border:1px solid var(--p50)!important;border-radius:0 0 5px 5px!important;padding:15px!important}trix-editor>div{margin-bottom:14px;font-size:16px;line-height:23px}trix-editor:focus{background:var(--p10)!important}trix-editor figure.attachment{display:flex!important;flex-direction:column!important;justify-content:center;align-items:center;gap:10px}trix-editor .attachment{background:var(--p20);padding:12px 0;text-align:center;display:flex;justify-content:center}trix-editor .attachment img{margin-bottom:0}trix-editor [data-trix-mutable].attachment img{box-shadow:0 0 1px 2px var(--p70)!important}trix-editor .trix-button--remove{box-shadow:none!important;border:2px solid var(--p40)!important}trix-editor .trix-button--remove:hover{border:2px solid var(--p40)}trix-editor a{color:var(--p80)}trix-toolbar .trix-button-row{display:flex}trix-toolbar .trix-button-group{background:transparent!important;border:none!important;display:flex!important;gap:4px}trix-toolbar .trix-button-group--history-tools,trix-toolbar .trix-button-group--file-tools{display:none!important}trix-toolbar .trix-button{border-radius:6px!important;background:var(--p30)!important;padding:14px 22px!important;margin:0!important;cursor:pointer;border:0px solid var(--p30)!important;font-size:14px!important;min-height:27px!important;display:flex!important;align-items:center!important;gap:4px;color:var(--text)!important}trix-toolbar .trix-button:before{background-size:22px!important}trix-toolbar .trix-button:hover{background:var(--p40)!important}trix-toolbar .trix-button.trix-active{background:var(--p50)!important}.sidebar-content{min-width:300px;max-width:400px;position:relative}.main-content{position:relative;width:fit-content;min-width:900px}.main-wrapper{display:flex;justify-content:center;gap:40px;padding:20px;position:relative}.wrapper-tiny{background-color:var(--p20);border-radius:12px;margin:44px auto;width:600px;padding:44px}.common-wrapper{background-color:var(--p20);margin:20px 0;padding:20px;border-radius:12px}.wrapper-normal{background-color:#fff;border-radius:32px;margin:44px auto;width:1000px;padding:44px}.wrapper-normal.transparent{margin:0 auto;padding:0;background-color:transparent}.wrapper-large{background-color:#fff;border-radius:32px;margin:44px auto;max-width:1920px;min-width:1000px;padding:44px;width:fit-content}.wrapper-large.transparent{padding:0;margin:0 auto;background-color:transparent}@media only screen and (max-width: 1800px){.wrapper-normal{margin:0 0 0 auto;padding:20px}.wrapper-normal.transparent{margin:0 0 0 auto;padding:40px}.wrapper-large{margin:44px 0 0 auto;padding:44px}.wrapper-large.transparent{margin:0 0 0 auto;padding:40px}}@media only screen and (max-width: 1390px){.wrapper-normal{margin:0 auto;padding:20px}.wrapper-normal.transparent{margin:0 auto;padding:40px}.wrapper-large{margin:44px 0 0 auto;padding:44px}.wrapper-large.transparent{margin:0 0 0 auto;padding:40px}}.section-actions{text-align:center;padding:32px 0}.header-normal,.header-small{text-align:left;font-weight:400;font-size:20px}.toolbar{display:flex;align-items:center;gap:5px;justify-content:space-between}.toolbar input.search{border-radius:12px;background:var(--p20);padding:4px 10px;cursor:pointer;border:none;font-size:14px}.toolbar .selected-filter{font-size:13px;border-radius:12px;margin:2px 0;background:var(--p30);padding:3px 10px;display:flex;gap:4px;line-height:22px}.toolbar .filter-input{margin:10px 0}.toolbar .filter-input input{font-size:13px}.toolbar .applied-filter{background:var(--p30)}.toolbar-filters{display:flex;align-items:center;gap:5px}.applied-filters{display:flex;gap:4px;margin-top:10px}.applied-filters .applied-filter{font-size:13px;border-radius:12px;background:var(--p20);padding:3px 10px;display:flex;justify-content:center;gap:4px;line-height:22px}.applied-filters .applied-filter:hover{background-color:var(--p30)}.dropdown{position:relative;overflow:visible}.dropdown-button>div{display:flex;align-items:center;gap:3px}.dropdown-menu{display:flex;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:22;background:var(--p20);transition:.6s;flex-grow:1;top:35px;min-width:max-content;border:1px solid var(--p30)}.dropdown-menu.orientation-right{right:0}.dropdown-menu.orientation-left{left:0}.dropdown-header,.dropdown-item{display:flex;align-items:center;gap:3px;text-wrap:nowrap}.dropdown-header{padding:10px}.dropdown-item{font-size:14px;padding:3px 10px}.dropdown-item:hover{background:var(--p30);border-radius:12px}.dropdown-item:hover button{background:var(--p30)}.dropdown-item .button-icon{flex-shrink:0}.editor-field .dropdown-menu{background:var(--p30)}.button{border-radius:12px;background:var(--p20);padding:3px 10px;cursor:pointer;border:0px solid var(--p30);font-size:14px;min-height:27px;display:flex;align-items:center;gap:4px;color:var(--text)}.button:hover{background:var(--p30)}.button:active{background:var(--p50)!important;box-shadow:none}.button.active,.button.secondary{background:var(--p30)}.button.secondary:hover{background:var(--p40)}.button.primary{background:var(--p70);color:var(--p10)}.button.primary:hover{background:var(--p90)}.button[disabled]{pointer-events:none;opacity:.7;color:var(--text)}.upload-button{padding:0;border:none}.upload-button label{font-size:14px;line-height:14px;font-weight:400;background:var(--p80)!important;color:var(--p10)}.button-text{border:none;padding:0;background:transparent;cursor:pointer}.spinner-border{width:12px;height:12px;border:2px solid var(--p10);border-bottom-color:var(--p30);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@supports (-webkit-appearance: none) or (-moz-appearance: none){.checkbox-wrapper input[type=checkbox]{--active-inner: var(--p10);--focus: 2px var(--p30);--border-hover: var(--p30);--disabled: #F6F8FF;--disabled-inner: #E1E6F9;-webkit-appearance:none;-moz-appearance:none;height:21px;outline:none;display:inline-block;vertical-align:top;position:relative;margin:0;cursor:pointer;border:1px solid var(--bc, var(--p30));background:var(--b, var(--p10));transition:background .3s,border-color .3s,box-shadow .2s}.checkbox-wrapper input[type=checkbox]:after{content:"";display:block;left:0;top:0;position:absolute;transition:transform var(--d-t, .3s) var(--d-t-e, ease),opacity var(--d-o, .2s)}.checkbox-wrapper input[type=checkbox]:checked{--b: var(--p40);--bc: var(--p40);--d-o: .3s;--d-t: .6s;--d-t-e: cubic-bezier(.2, .85, .32, 1.2)}.checkbox-wrapper input[type=checkbox]:disabled{--b: var(--disabled);cursor:not-allowed;opacity:.9}.checkbox-wrapper input[type=checkbox]:disabled:checked{--b: var(--disabled-inner);--bc: var(--p40)}.checkbox-wrapper input[type=checkbox]:disabled+label{cursor:not-allowed}.checkbox-wrapper input[type=checkbox]:hover:not(:checked):not(:disabled){--bc: var(--border-hover)}.checkbox-wrapper input[type=checkbox]:focus{box-shadow:0 0 0 var(--focus)}.checkbox-wrapper input[type=checkbox]:not(.switch){width:21px}.checkbox-wrapper input[type=checkbox]:not(.switch):after{opacity:var(--o, 0)}.checkbox-wrapper input[type=checkbox]:not(.switch):checked{--o: 1}.checkbox-wrapper input[type=checkbox]+label{display:inline-block;vertical-align:middle;cursor:pointer;margin-left:4px}.checkbox-wrapper input[type=checkbox]:not(.switch){border-radius:7px}.checkbox-wrapper input[type=checkbox]:not(.switch):after{width:5px;height:9px;border:2px solid var(--active-inner);border-top:0;border-left:0;left:7px;top:4px;transform:rotate(var(--r, 20deg))}.checkbox-wrapper input[type=checkbox]:not(.switch):checked{--r: 43deg}}.checkbox-wrapper *{box-sizing:inherit}.checkbox-wrapper *:before,.checkbox-wrapper *:after{box-sizing:inherit}.checkbox-wrapper input[type=checkbox]:indeterminate{--b: var(--p40);--bc: var(--p40);--d-o: .3s;--d-t: .6s;--d-t-e: cubic-bezier(.2, .85, .32, 1.2)}.pagination{margin:20px auto 10px;display:flex;justify-content:center;align-items:center;gap:4px;list-style:none;padding:0}.pagination li a,.pagination li span{font-size:14px;border-radius:12px;padding:4px 18px;background:var(--p20)}.pagination li a:hover,.pagination li span:hover{background:var(--p30)}.pagination li.disabled{pointer-events:none;opacity:.7}.pagination li.active span{background:var(--p30)}.record-edit{position:relative;max-width:900px}.record-edit .invalid-feedback{color:var(--text-error);font-size:15px;line-height:20px;margin-top:10px}.record-header{margin:10px 0 0}.record-header .schema-name{font-size:14px}.record-header .record-title{font-size:18px;display:block}.tools-header{margin:30px 0 0;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;position:relative;z-index:20;padding:10px;border-radius:12px;background:var(--p20)}.editor-field{background:var(--p20);padding:18px;position:relative;border-radius:12px;margin:6px 0;border-color:transparent}.editor-field .button:not(.primary){background:var(--p30)}.editor-field .button:not(.primary):hover{background:var(--p40)}.editor-field dialog .button:not(.primary){background:var(--p20)}.editor-field dialog .button:not(.primary):hover{background:var(--p30)}.field-header{margin-bottom:4px;position:relative}.field-header .labels{display:flex;justify-content:space-between;align-items:center}.field-header .label-and-help{display:flex;align-items:center;gap:6px}.field-header label{font-size:14px;line-height:14px;margin:0;font-weight:700}.field-header .help-text{font-size:14px;line-height:14px}.system-help-text{font-size:14px;line-height:14px;margin-top:10px}.field-checkbox{display:flex;gap:20px;align-items:center}.field-checkbox .form-check-inline{display:flex;align-items:center;gap:4px}.field-checkbox .form-check-label{font-size:14px;line-height:14px}.record-edit-file-preview{display:flex;gap:20px}.record-edit-file-preview .file-details{width:50%;display:flex;flex-direction:column;gap:5px}.record-edit-file-preview .file-details-item .text-muted{color:var(--grey-dark)}.tabs{padding:0;margin:20px 0;display:flex;gap:4px;flex-wrap:wrap}.tabs .tab{list-style:none}input.switch{-webkit-appearance:none;width:34px;height:18px;border:1px solid var(--p40);position:relative;border-radius:50px;box-sizing:content-box;cursor:pointer;transition:background .15s ease-in-out;background:#fff}input.switch:after{top:2px;left:2px;transition:left .15s ease-in-out;content:" ";width:14px;height:14px;background:var(--p40);box-shadow:inset 0 0 0 1px var(--p40);position:absolute;border-radius:50px}input.switch:checked{background:var(--p50)}input.switch:checked:after{left:calc(100% - 17px);background:var(--p10)}.preview-file,.preview-reference{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--p10);border-radius:12px}.preview-file .image,.preview-reference .image{display:flex}.preview-file .reference-action,.preview-reference .reference-action{display:none}.preview-file:hover,.preview-reference:hover{background:var(--p30)}.preview-file:hover .reference-action,.preview-reference:hover .reference-action{display:block}.file-preview-small{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;border-radius:12px;padding:4px}.preview-reference{background:var(--p10);padding:10px 20px}.sortable-container{display:flex;flex-direction:column;gap:5px}.sortable-ghost{border:2px dashed var(--p60)}.sortable-drag{opacity:0!important}.sortable-ghost{opacity:1!important}body:has(dialog[open]){overflow:hidden}dialog{margin:2vh auto;background-color:var(--p10);padding:34px;border:none;border-radius:12px;overflow:auto;max-height:96vh;box-shadow:none!important}dialog .close{position:absolute;top:10px;right:0}dialog .dialog-body{width:fit-content}dialog::backdrop{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.dialog-header{margin-bottom:20px;display:flex;align-items:center;gap:8px;position:sticky;top:-34px;z-index:999;background-color:var(--p10);padding:10px 0}.autocomplete{position:relative;z-index:1000;overflow:visible}.autocomplete .autocomplete-option{cursor:pointer;font-size:14px;padding:3px 10px}.autocomplete .autocomplete-option:hover{background:var(--p40);border-radius:12px}.autocomplete:focus-within .autocomplete-results{display:flex}.autocomplete-selected-value{font-size:13px;margin-top:10px;border-radius:12px;background:var(--p30);padding:3px 10px;display:inline-flex;justify-content:center;gap:4px;line-height:22px}.autocomplete-selected-value:hover{background:var(--p40)}.autocomplete-results{display:none;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:20;background:var(--p30);transition:.6s;flex-grow:1;top:45px;width:100%}.reference-tags{position:relative;z-index:20}.reference-tags .reference-tags-option{cursor:pointer;font-size:14px;padding:3px 10px}.reference-tags .reference-tags-option:hover{background:var(--p40);border-radius:12px}.reference-tags:focus-within .reference-tags-results{display:flex}.reference-tags-selected-value{font-size:13px;margin-top:10px;border-radius:12px;background:var(--p30);padding:3px 10px;display:inline-flex;justify-content:center;gap:4px;line-height:22px}.reference-tags-selected-value:hover{background:var(--p40)}.reference-tags-results{display:none;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:20;background:var(--p30);transition:.6s;flex-grow:1;top:45px;width:100%}.reference-tags-results .start-typing{font-style:italic;font-size:13px}.member-list{display:flex;flex-direction:column;gap:5px}.member-item{background:var(--p30);border-radius:12px;padding:12px;display:flex;justify-content:space-between;align-items:center}.member-item .member-name{display:flex;align-items:center;gap:10px}.revisions{display:flex;flex-direction:column;gap:5px}.revisions .revision{justify-content:space-between;display:flex;gap:20px;align-items:center;background:var(--p20);padding:12px;border-radius:12px}.revisions .revision .version{display:flex;gap:10px}.revisions .revision.active{background:var(--p30)}.selected-revision{margin-top:30px;align-items:center;background:var(--p20);padding:12px;border-radius:12px}.selected-revision .button{background:var(--p30)}.selected-revision .revision-field{display:flex;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--p30);flex:1}.selected-revision .revision-field .compare-left,.selected-revision .revision-field .compare-right{width:45%;border-radius:12px;padding:20px;background:var(--p30)}.selected-revision .revision-field .compare-center{width:10%;height:100%;display:flex;gap:20px;align-items:center}.reference-field{width:100px}.revision-references{display:flex;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--p30)}.reference-compare{width:45%;border-radius:12px;padding:20px;background:var(--p30)}.flatpickr-wrapper{display:block!important}.editor-field .flatpickr-calendar{border-radius:12px!important}.editor-field .flatpickr-months .flatpickr-month{background:var(--p30);color:var(--text);font-size:12px}.editor-field .flatpickr-current-month .flatpickr-monthDropdown-months{background:var(--p30)}.editor-field .flatpickr-weekdays,.editor-field .flatpickr-weekdaycontainer .flatpickr-weekday{background:var(--p30);color:var(--text)}.editor-field .flatpickr-days,.editor-field .flatpickr-time{background:var(--p10);color:var(--text)}body{background-color:var(--p10);font-family:var(--main-font),sans-serif;color:var(--text)}body :focus{outline:none;box-shadow:0 0 1px 2px var(--p70)}.btn-spinner .spinner-border{display:none}.btn-spinner.spinner-on .spinner-border{display:inline-block}.cursor-pointer{cursor:pointer}a{color:var(--text);text-decoration:none}.lucent-component{position:relative}.status-removed.svelte-1jo1k1d{opacity:.5}svg.svelte-r4pd9j{vertical-align:text-top}img.svelte-sv092r{border-radius:12px;padding:4px}.color.svelte-78o2k4{width:18px;height:18px;display:inline-block;position:relative;top:3px}a.svelte-nbbgyi{max-width:200px;overflow:hidden;text-overflow:ellipsis;font-size:13px;color:#333}a.svelte-nbbgyi:hover{opacity:.5}div.references.svelte-15ilpfz{max-height:48px;overflow-x:hidden;overflow-y:hidden}div.svelte-1ft053t{max-height:24px;text-overflow:ellipsis;overflow:hidden}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 #e6e6e6,-1px 0 #e6e6e6,0 1px #e6e6e6,0 -1px #e6e6e6,0 3px 13px #00000014}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-months .flatpickr-month{background:transparent;color:#000000e6;fill:#000000e6;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#000000e6;fill:#000000e6}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg path{fill:#00000080}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:#000000e6}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:#000000e6}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:#00000080;background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:#0000008a;line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 #569ff7}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:#3939394d;background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:#3939391a}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 #569ff7,5px 0 #569ff7}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 #e6e6e6}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:#3939394d;background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-box-shadow:0 3px 13px rgba(0,0,0,.08);box-shadow:0 3px 13px #00000014}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #eceef1}.flatpickr-calendar.hasTime .flatpickr-innerContainer{border-bottom:0}.flatpickr-calendar.hasTime .flatpickr-time{border:1px solid #eceef1}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#eceef1}.flatpickr-calendar.arrowTop:after{border-bottom-color:#eceef1}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#eceef1}.flatpickr-calendar.arrowBottom:after{border-top-color:#eceef1}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{border-radius:5px 5px 0 0;background:#eceef1;color:#5a6171;fill:#5a6171;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#5a6171;fill:#5a6171}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#bbb}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(72,72,72,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:#0000001a}.numInputWrapper span:active{background:#0003}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(72,72,72,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(72,72,72,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:#5a617180}.numInputWrapper:hover{background:#0000000d}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0px,0px,0px);transform:translateZ(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:#0000000d}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch�;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:#5a6171}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:#5a6171}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:#5a617180;background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:#eceef1;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:#0000000d}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:#eceef1;outline:none;padding:0}.flatpickr-weekdays{background:#eceef1;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:#eceef1;color:#5a6171;line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px;border-left:1px solid #eceef1;border-right:1px solid #eceef1}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0px,0px,0px);transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #eceef1;box-shadow:-1px 0 #eceef1}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#484848;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e2e2e2;border-color:#e2e2e2}.flatpickr-day.today{border-color:#bbb}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#bbb;background:#bbb;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#ff5a5f;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#ff5a5f}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #ff5a5f;box-shadow:-10px 0 #ff5a5f}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e2e2e2,5px 0 0 #e2e2e2;box-shadow:-5px 0 #e2e2e2,5px 0 #e2e2e2}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:#4848484d;background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:#4848481a}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #ff5a5f,5px 0 0 #ff5a5f;box-shadow:-5px 0 #ff5a5f,5px 0 #ff5a5f}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;border-left:1px solid #eceef1}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:#4848484d;background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;background:#fff;border-bottom:1px solid #eceef1}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;background:#fff;border-radius:0 0 5px 5px}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#484848}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#484848}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#484848;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#484848;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eaeaea}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}span.flatpickr-day.selected{font-weight:700}textarea.svelte-1er4ovm{resize:none}trix-editor{border:1px solid #bbb;border-radius:3px;margin:0;padding:.4em .6em;min-height:5em;outline:none}trix-toolbar *{box-sizing:border-box}trix-toolbar .trix-button-row{display:flex;flex-wrap:nowrap;justify-content:space-between;overflow-x:auto}trix-toolbar .trix-button-group{display:flex;margin-bottom:10px;border:1px solid #bbb;border-top-color:#ccc;border-bottom-color:#888;border-radius:3px}trix-toolbar .trix-button-group:not(:first-child){margin-left:1.5vw}@media (max-width: 768px){trix-toolbar .trix-button-group:not(:first-child){margin-left:0}}trix-toolbar .trix-button-group-spacer{flex-grow:1}@media (max-width: 768px){trix-toolbar .trix-button-group-spacer{display:none}}trix-toolbar .trix-button{position:relative;float:left;color:#0009;font-size:.75em;font-weight:600;white-space:nowrap;padding:0 .5em;margin:0;outline:none;border:none;border-bottom:1px solid #ddd;border-radius:0;background:transparent}trix-toolbar .trix-button:not(:first-child){border-left:1px solid #ccc}trix-toolbar .trix-button.trix-active{background:#cbeefa;color:#000}trix-toolbar .trix-button:not(:disabled){cursor:pointer}trix-toolbar .trix-button:disabled{color:#00000020}@media (max-width: 768px){trix-toolbar .trix-button{letter-spacing:-.01em;padding:0 .3em}}trix-toolbar .trix-button--icon{font-size:inherit;width:2.6em;height:1.6em;max-width:calc(.8em + 4vw);text-indent:-9999px}@media (max-width: 768px){trix-toolbar .trix-button--icon{height:2em;max-width:calc(.8em + 3.5vw)}}trix-toolbar .trix-button--icon:before{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;opacity:.6;content:"";background-position:center;background-repeat:no-repeat;background-size:contain}@media (max-width: 768px){trix-toolbar .trix-button--icon:before{right:6%;left:6%}}trix-toolbar .trix-button--icon.trix-active:before{opacity:1}trix-toolbar .trix-button--icon:disabled:before{opacity:.125}trix-toolbar .trix-button--icon-attach:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E);top:8%;bottom:4%}trix-toolbar .trix-button--icon-bold:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-italic:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-link:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-strike:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-quote:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-heading-1:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-code:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-bullet-list:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-number-list:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-undo:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-redo:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-decrease-nesting-level:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-increase-nesting-level:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-dialogs{position:relative}trix-toolbar .trix-dialog{position:absolute;top:0;left:0;right:0;font-size:.75em;padding:15px 10px;background:#fff;box-shadow:0 .3em 1em #ccc;border-top:2px solid #888;border-radius:5px;z-index:5}trix-toolbar .trix-input--dialog{font-size:inherit;font-weight:400;padding:.5em .8em;margin:0 10px 0 0;border-radius:3px;border:1px solid #bbb;background-color:#fff;box-shadow:none;outline:none;-webkit-appearance:none;-moz-appearance:none}trix-toolbar .trix-input--dialog.validate:invalid{box-shadow:red 0 0 1.5px 1px}trix-toolbar .trix-button--dialog{font-size:inherit;padding:.5em;border-bottom:none}trix-toolbar .trix-dialog--link{max-width:600px}trix-toolbar .trix-dialog__link-fields{display:flex;align-items:baseline}trix-toolbar .trix-dialog__link-fields .trix-input{flex:1}trix-toolbar .trix-dialog__link-fields .trix-button-group{flex:0 0 content;margin:0}trix-editor [data-trix-mutable]:not(.attachment__caption-editor){-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}trix-editor [data-trix-mutable] ::-moz-selection,trix-editor [data-trix-mutable]::-moz-selection,trix-editor [data-trix-cursor-target]::-moz-selection{background:none}trix-editor [data-trix-mutable] ::selection,trix-editor [data-trix-mutable]::selection,trix-editor [data-trix-cursor-target]::selection{background:none}trix-editor [data-trix-mutable].attachment__caption-editor:focus::-moz-selection{background:highlight}trix-editor [data-trix-mutable].attachment__caption-editor:focus::selection{background:highlight}trix-editor [data-trix-mutable].attachment.attachment--file{box-shadow:0 0 0 2px highlight;border-color:transparent}trix-editor [data-trix-mutable].attachment img{box-shadow:0 0 0 2px highlight}trix-editor .attachment{position:relative}trix-editor .attachment:hover{cursor:default}trix-editor .attachment--preview .attachment__caption:hover{cursor:text}trix-editor .attachment__progress{position:absolute;z-index:1;height:20px;top:calc(50% - 10px);left:5%;width:90%;opacity:.9;transition:opacity .2s ease-in}trix-editor .attachment__progress[value="100"]{opacity:0}trix-editor .attachment__caption-editor{display:inline-block;width:100%;margin:0;padding:0;font-size:inherit;font-family:inherit;line-height:inherit;color:inherit;text-align:center;vertical-align:top;border:none;outline:none;-webkit-appearance:none;-moz-appearance:none}trix-editor .attachment__toolbar{position:absolute;z-index:1;top:-.9em;left:0;width:100%;text-align:center}trix-editor .trix-button-group{display:inline-flex}trix-editor .trix-button{position:relative;float:left;color:#666;white-space:nowrap;font-size:80%;padding:0 .8em;margin:0;outline:none;border:none;border-radius:0;background:transparent}trix-editor .trix-button:not(:first-child){border-left:1px solid #ccc}trix-editor .trix-button.trix-active{background:#cbeefa}trix-editor .trix-button:not(:disabled){cursor:pointer}trix-editor .trix-button--remove{text-indent:-9999px;display:inline-block;padding:0;outline:none;width:1.8em;height:1.8em;line-height:1.8em;border-radius:50%;background-color:#fff;border:2px solid highlight;box-shadow:1px 1px 6px #00000040}trix-editor .trix-button--remove:before{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;opacity:.7;content:"";background-image:url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E);background-position:center;background-repeat:no-repeat;background-size:90%}trix-editor .trix-button--remove:hover{border-color:#333}trix-editor .trix-button--remove:hover:before{opacity:1}trix-editor .attachment__metadata-container{position:relative}trix-editor .attachment__metadata{position:absolute;left:50%;top:2em;transform:translate(-50%);max-width:90%;padding:.1em .6em;font-size:.8em;color:#fff;background-color:#000000b3;border-radius:3px}trix-editor .attachment__metadata .attachment__name{display:inline-block;max-width:100%;vertical-align:bottom;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}trix-editor .attachment__metadata .attachment__size{margin-left:.2em;white-space:nowrap}.trix-content{line-height:1.5;overflow-wrap:break-word;word-break:break-word}.trix-content *{box-sizing:border-box;margin:0;padding:0}.trix-content h1{font-size:1.2em;line-height:1.2}.trix-content blockquote{border:0 solid #ccc;border-left-width:.3em;margin-left:.3em;padding-left:.6em}.trix-content [dir=rtl] blockquote,.trix-content blockquote[dir=rtl]{border-width:0;border-right-width:.3em;margin-right:.3em;padding-right:.6em}.trix-content li{margin-left:1em}.trix-content [dir=rtl] li{margin-right:1em}.trix-content pre{display:inline-block;width:100%;vertical-align:top;font-family:monospace;font-size:.9em;padding:.5em;white-space:pre;background-color:#eee;overflow-x:auto}.trix-content img{max-width:100%;height:auto}.trix-content .attachment{display:inline-block;position:relative;max-width:100%}.trix-content .attachment a{color:inherit;text-decoration:none}.trix-content .attachment a:hover,.trix-content .attachment a:visited:hover{color:inherit}.trix-content .attachment__caption{text-align:center}.trix-content .attachment__caption .attachment__name+.attachment__size:before{content:" •"}.trix-content .attachment--preview{width:100%;text-align:center}.trix-content .attachment--preview .attachment__caption{color:#666;font-size:.9em;line-height:1.2}.trix-content .attachment--file{color:#333;line-height:1;margin:0 2px 2px;padding:.4em 1em;border:1px solid #bbb;border-radius:5px}.trix-content .attachment-gallery{display:flex;flex-wrap:wrap;position:relative}.trix-content .attachment-gallery .attachment{flex:1 0 33%;padding:0 .5em;max-width:33%}.trix-content .attachment-gallery.attachment-gallery--2 .attachment,.trix-content .attachment-gallery.attachment-gallery--4 .attachment{flex-basis:50%;max-width:50%}.field-content.svelte-s7tjhg{max-height:200px;overflow-y:scroll}.logs.svelte-16mig2w{max-height:70vh;overflow:scroll;background:var(--p90);color:var(--p10);padding:10px} diff --git a/front/dist/assets/main-BadhVKbO.css b/front/dist/assets/main-BadhVKbO.css new file mode 100644 index 0000000..e4dc7fd --- /dev/null +++ b/front/dist/assets/main-BadhVKbO.css @@ -0,0 +1 @@ +@charset "UTF-8";:root{--p10: #f4f9ff;--p20: #eaf1f9;--p30: #b3ceff;--p40: #8db5ff;--p50: #70a2ff;--p60: #679cff;--p70: #4284ff;--p80: #1c6bff;--p90: #002b7a;--p100: #000C23;--suc10: #d1ffb8;--suc20: #d1ffb8;--suc30: #b5ff8d;--suc40: #a2ff70;--suc50: #82cc5a;--suc80: #71b34e;--suc90: #314c22;--err10: #ffb9d0;--err20: #ff9bb3;--err30: #fe7e97;--err40: #de617b;--err50: #be4461;--err80: #61001a;--err90: #560012;--grey-dark: #424656;--grey-light: #a6abbd;--text: var(--p100);--text-light: var(--grey-dark);--text-error: var(--err50);--main-font: ‘Open Sans‘, Arial, Helvetica, sans-serif}*,*:before,*:after{box-sizing:border-box}*{margin:0}body{line-height:1.5;-webkit-font-smoothing:antialiased}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}#root,#__next{isolation:isolate}.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.pt-1{padding-top:4px}.pt-2{padding-top:8px}.pt-3{padding-top:12px}.pt-4{padding-top:16px}.pt-5{padding-top:20px}.pb-1{padding-bottom:4px}.pb-2{padding-bottom:8px}.pb-3{padding-bottom:12px}.pb-4{padding-bottom:16px}.pb-5{padding-bottom:20px}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-5{gap:20px}.hide{display:none!important}.hidden{visibility:hidden}.d-block{display:block}.d-inline-block{display:inline-block}.is-bold{font-weight:700}.in-place{padding:36px}.notice{background-color:var(--p20);padding:14px;margin:2rem 0;position:relative;font-size:16px;line-height:24px;border-radius:12px}.notice .title{content:"NOTE";border-radius:12px;display:block;font-weight:700}.notice.notice-success{background:var(--suc20)}.notice.notice-error{background:var(--err10)}.scope-login{display:flex;height:100vh}.scope-login .bg-image{width:50%;background:url(/vendor/lucent/public/art.jpg);background-size:cover;background-repeat:no-repeat;background-position:center center}.scope-login .login-form{width:50%;height:100vh;display:flex;align-items:center;justify-content:center}.content{font-size:16px;line-height:20px;font-family:var(--main-font);color:var(--text)}.content p{margin-bottom:14px}.content p:last-child{margin-bottom:0}.content h1{font-size:24px;line-height:34px}.content h2{font-size:20px;line-height:30px}.content h3{font-size:18px;line-height:28px}.content ul{padding:0 0 0 16px;list-style:none outside none}.content ul li:before{content:"—";opacity:.5;font-size:12px;padding-right:6px;vertical-align:10%}.content ul li{list-style:none;padding:0}.content code{background:var(--p30);padding:0 6px;border-radius:12px}.content img{margin-bottom:14px}.content blockquote{border:1px solid var(--p30);border-radius:12px;padding:12px 40px;position:relative}.content blockquote:before{content:"“";color:var(--p60);font-size:4em;position:absolute;left:10px;top:20px}.content blockquote:after{content:""}.content pre{background:var(--grey-light);border-radius:.5rem;color:var(--white);font-family:JetBrainsMono,monospace;margin:1.5rem 0;padding:.75rem 1rem}.content pre code{background:none;color:inherit;font-size:.8rem;padding:0}.lx-small-text{font-size:12px;line-height:15px}.light-text{color:var(--text-light)}.sidebar-top{border:0px solid var(--p30);font-size:18px;padding:20px;display:flex;align-items:center;justify-content:space-between;background:var(--p20);margin-bottom:15px;border-radius:12px}.sidebar{border-radius:12px;font-size:15px;line-height:28px;padding:20px;background:var(--p20);display:flex;flex-direction:column;gap:3px}.sidebar-header{display:flex;cursor:pointer;justify-content:space-between;align-items:center;background:var(--p30);font-size:16px;padding:3px 12px;color:var(--text);border:none;border-radius:12px}.sidebar-header:focus{box-shadow:none}.sidebar-header:hover{background:var(--p40)}.sidebar-header:last-child{border-bottom:none}.sidebar-item{color:var(--text);display:block;font-size:14px;padding:3px 12px;text-decoration:none;transition:.6s;border-radius:12px}.sidebar-item:last-child{border-bottom:none}.sidebar-item:hover{background:var(--p30)}.sidebar-item.active{background:var(--p40)}.top-nav{display:flex;justify-content:end;align-items:center;gap:10px}.top-nav-item{border-radius:12px;font-size:14px;background:var(--p20);padding:3px 10px}.top-nav-item:hover{background:var(--p30)}label{display:block;font-weight:700;margin-bottom:4px}input[type=text],input[type=number],input[type=search],input[type=email],textarea{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:5px;padding:5px 7px;font-size:16px}input[type=text]:focus,input[type=number]:focus,input[type=search]:focus,input[type=email]:focus,textarea:focus{background:var(--p10)}textarea{resize:none}select{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:5px;padding:5px 7px;font-size:16px}select:focus{background:var(--p10)}.htmx-indicator{display:none}.htmx-request .htmx-indicator,.htmx-request.htmx-indicator{display:inline}.bt{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#000;background-image:none;border:1px solid #000;border-radius:4px;box-shadow:#fff 4px 4px,#000 4px 4px 0 1px;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:ITCAvantGardeStd-Bk,Arial,sans-serif;font-size:16px;font-weight:400;line-height:20px;margin:0 5px 10px 0;overflow:visible;padding:8px 40px;text-align:center;text-transform:none;touch-action:manipulation;user-select:none;-webkit-user-select:none;vertical-align:middle;white-space:nowrap}.bt:focus{text-decoration:none}.bt:hover{text-decoration:none}.bt:active{box-shadow:#00000020 0 3px 5px inset;outline:0}.bt:not([disabled]):active{box-shadow:#fff 2px 2px,#000 2px 2px 0 1px;transform:translate(2px,2px)}.table{min-width:600px;overflow:auto;background:var(--p20);padding:1px;font-size:14px;border-radius:12px}.table table{background:var(--p20);width:100%;border-collapse:separate;border:none;border-spacing:0}.table thead,.table thead tr{border-radius:12px}.table th{font-size:14px;font-weight:400;white-space:nowrap;max-width:400px;border:none;background:var(--p20);text-align:left;padding:8px 16px}.table th.is-sort{font-weight:700}.table th:first-child{border-radius:12px 0 0}.table th:last-child{border-radius:0 12px 0 0}.table td{font-weight:400;white-space:nowrap;max-width:400px;height:48px;padding:4px 16px;border:none;overflow:hidden}.table td .status{color:var(--text);font-size:80%}.table td .row-name{display:flex;align-items:center;gap:6px}.table td .title-td-contents{display:flex;align-items:center;gap:6px;font-size:14px;line-height:14px}.table tbody tr{border-radius:12px;background:var(--p10);border:none}.table tbody tr:has(input:checked){background:var(--p30)}.table tbody tr:hover{background:var(--p20)}.table .field-ui-number{text-align:right}.table .references{display:flex;gap:4px}.table .references .reference{font-size:13px;border-radius:12px;background:var(--p30);padding:1px 5px}.file-table-row{display:flex;align-items:center;gap:5px}.file-table-row>div{display:flex;flex-flow:column;gap:5px}.avatar{display:inline-block;vertical-align:middle;position:relative;color:#fff;border-radius:50%}.avatar__letters{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.avatars-compact{position:relative}.avatars-compact .avatar{margin-left:-9px}.is-editable-false .cm-content{background-color:var(--p10)}.cm-focused .cm-content{background-color:var(--p10);color:var(--p100)}.cm-content{background-color:var(--p20)}.ͼ4 .cm-line ::selection,.ͼ4 .cm-line::selection{background:var(--p40)!important}.cm-activeLine{background-color:var(--p20)!important}.tiptap{width:100%;background:var(--p20);border:1px solid var(--p50);border-radius:0 0 5px 5px;padding:15px;font-size:16px}.tiptap :first-child{margin-top:0}.tiptap:focus{background:var(--p10)}.tiptap img.ProseMirror-selectednode{box-shadow:0 0 1px 2px var(--p70)}.editor-field .editor-toolbar{display:flex;gap:4px;background:var(--p30);border-radius:5px 5px 0 0;padding:5px 7px}.editor-field .editor-toolbar .button:not(.primary){font-weight:700}.editor-field .editor-toolbar .button:not(.primary).active{background:var(--p40)}.content .tiptap li>p{display:inline}trix-editor{background:var(--p20)!important;border:1px solid var(--p50)!important;border-radius:0 0 5px 5px!important;padding:15px!important}trix-editor>div{margin-bottom:14px;font-size:16px;line-height:23px}trix-editor:focus{background:var(--p10)!important}trix-editor figure.attachment{display:flex!important;flex-direction:column!important;justify-content:center;align-items:center;gap:10px}trix-editor .attachment{background:var(--p20);padding:12px 0;text-align:center;display:flex;justify-content:center}trix-editor .attachment img{margin-bottom:0}trix-editor [data-trix-mutable].attachment img{box-shadow:0 0 1px 2px var(--p70)!important}trix-editor .trix-button--remove{box-shadow:none!important;border:2px solid var(--p40)!important}trix-editor .trix-button--remove:hover{border:2px solid var(--p40)}trix-editor a{color:var(--p80)}trix-toolbar .trix-button-row{display:flex}trix-toolbar .trix-button-group{background:transparent!important;border:none!important;display:flex!important;gap:4px}trix-toolbar .trix-button-group--history-tools,trix-toolbar .trix-button-group--file-tools{display:none!important}trix-toolbar .trix-button{border-radius:6px!important;background:var(--p30)!important;padding:14px 22px!important;margin:0!important;cursor:pointer;border:0px solid var(--p30)!important;font-size:14px!important;min-height:27px!important;display:flex!important;align-items:center!important;gap:4px;color:var(--text)!important}trix-toolbar .trix-button:before{background-size:22px!important}trix-toolbar .trix-button:hover{background:var(--p40)!important}trix-toolbar .trix-button.trix-active{background:var(--p50)!important}.sidebar-content{min-width:300px;max-width:400px;position:relative}.main-content{position:relative;width:fit-content;min-width:900px}.main-wrapper{display:flex;justify-content:center;gap:40px;padding:20px;position:relative}.wrapper-tiny{background-color:var(--p20);border-radius:12px;margin:44px auto;width:600px;padding:44px}.common-wrapper{background-color:var(--p20);margin:20px 0;padding:20px;border-radius:12px}.wrapper-normal{background-color:#fff;border-radius:32px;margin:44px auto;width:1000px;padding:44px}.wrapper-normal.transparent{margin:0 auto;padding:0;background-color:transparent}.wrapper-large{background-color:#fff;border-radius:32px;margin:44px auto;max-width:1920px;min-width:1000px;padding:44px;width:fit-content}.wrapper-large.transparent{padding:0;margin:0 auto;background-color:transparent}@media only screen and (max-width: 1800px){.wrapper-normal{margin:0 0 0 auto;padding:20px}.wrapper-normal.transparent{margin:0 0 0 auto;padding:40px}.wrapper-large{margin:44px 0 0 auto;padding:44px}.wrapper-large.transparent{margin:0 0 0 auto;padding:40px}}@media only screen and (max-width: 1390px){.wrapper-normal{margin:0 auto;padding:20px}.wrapper-normal.transparent{margin:0 auto;padding:40px}.wrapper-large{margin:44px 0 0 auto;padding:44px}.wrapper-large.transparent{margin:0 0 0 auto;padding:40px}}.section-actions{text-align:center;padding:32px 0}.header-normal,.header-small{text-align:left;font-weight:400;font-size:20px}.toolbar{display:flex;align-items:center;gap:5px;justify-content:space-between}.toolbar input.search{border-radius:12px;background:var(--p20);padding:4px 10px;cursor:pointer;border:none;font-size:14px}.toolbar .selected-filter{font-size:13px;border-radius:12px;margin:2px 0;background:var(--p30);padding:3px 10px;display:flex;gap:4px;line-height:22px}.toolbar .filter-input{margin:10px 0}.toolbar .filter-input input{font-size:13px}.toolbar .applied-filter{background:var(--p30)}.toolbar-filters{display:flex;align-items:center;gap:5px}.applied-filters{display:flex;gap:4px;margin-top:10px}.applied-filters .applied-filter{font-size:13px;border-radius:12px;background:var(--p20);padding:3px 10px;display:flex;justify-content:center;gap:4px;line-height:22px}.applied-filters .applied-filter:hover{background-color:var(--p30)}.dropdown{position:relative;overflow:visible}.dropdown-button>div{display:flex;align-items:center;gap:3px}.dropdown-menu{display:flex;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:22;background:var(--p20);transition:.6s;flex-grow:1;top:35px;min-width:max-content;border:1px solid var(--p30)}.dropdown-menu.orientation-right{right:0}.dropdown-menu.orientation-left{left:0}.dropdown-header,.dropdown-item{display:flex;align-items:center;gap:3px;text-wrap:nowrap}.dropdown-header{padding:10px}.dropdown-item{font-size:14px;padding:3px 10px}.dropdown-item:hover{background:var(--p30);border-radius:12px}.dropdown-item:hover button{background:var(--p30)}.dropdown-item .button-icon{flex-shrink:0}.editor-field .dropdown-menu{background:var(--p30)}.button{border-radius:12px;background:var(--p20);padding:3px 10px;cursor:pointer;border:0px solid var(--p30);font-size:14px;min-height:27px;display:flex;align-items:center;gap:4px;color:var(--text)}.button:hover{background:var(--p30)}.button:active{background:var(--p50)!important;box-shadow:none}.button.active,.button.secondary{background:var(--p30)}.button.secondary:hover{background:var(--p40)}.button.primary{background:var(--p70);color:var(--p10)}.button.primary:hover{background:var(--p90)}.button[disabled]{pointer-events:none;opacity:.7;color:var(--text)}.upload-button{padding:0;border:none}.upload-button label{margin:0;font-size:14px;line-height:14px;font-weight:400;background:var(--p80)!important;color:var(--p10)}.button-text{border:none;padding:0;background:transparent;cursor:pointer}.spinner-border{width:12px;height:12px;border:2px solid var(--p10);border-bottom-color:var(--p30);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@supports (-webkit-appearance: none) or (-moz-appearance: none){.checkbox-wrapper input[type=checkbox]{--active-inner: var(--p10);--focus: 2px var(--p30);--border-hover: var(--p30);--disabled: #F6F8FF;--disabled-inner: #E1E6F9;-webkit-appearance:none;-moz-appearance:none;height:21px;outline:none;display:inline-block;vertical-align:top;position:relative;margin:0;cursor:pointer;border:1px solid var(--bc, var(--p30));background:var(--b, var(--p10));transition:background .3s,border-color .3s,box-shadow .2s}.checkbox-wrapper input[type=checkbox]:after{content:"";display:block;left:0;top:0;position:absolute;transition:transform var(--d-t, .3s) var(--d-t-e, ease),opacity var(--d-o, .2s)}.checkbox-wrapper input[type=checkbox]:checked{--b: var(--p40);--bc: var(--p40);--d-o: .3s;--d-t: .6s;--d-t-e: cubic-bezier(.2, .85, .32, 1.2)}.checkbox-wrapper input[type=checkbox]:disabled{--b: var(--disabled);cursor:not-allowed;opacity:.9}.checkbox-wrapper input[type=checkbox]:disabled:checked{--b: var(--disabled-inner);--bc: var(--p40)}.checkbox-wrapper input[type=checkbox]:disabled+label{cursor:not-allowed}.checkbox-wrapper input[type=checkbox]:hover:not(:checked):not(:disabled){--bc: var(--border-hover)}.checkbox-wrapper input[type=checkbox]:focus{box-shadow:0 0 0 var(--focus)}.checkbox-wrapper input[type=checkbox]:not(.switch){width:21px}.checkbox-wrapper input[type=checkbox]:not(.switch):after{opacity:var(--o, 0)}.checkbox-wrapper input[type=checkbox]:not(.switch):checked{--o: 1}.checkbox-wrapper input[type=checkbox]+label{display:inline-block;vertical-align:middle;cursor:pointer;margin-left:4px}.checkbox-wrapper input[type=checkbox]:not(.switch){border-radius:7px}.checkbox-wrapper input[type=checkbox]:not(.switch):after{width:5px;height:9px;border:2px solid var(--active-inner);border-top:0;border-left:0;left:7px;top:4px;transform:rotate(var(--r, 20deg))}.checkbox-wrapper input[type=checkbox]:not(.switch):checked{--r: 43deg}}.checkbox-wrapper *{box-sizing:inherit}.checkbox-wrapper *:before,.checkbox-wrapper *:after{box-sizing:inherit}.checkbox-wrapper input[type=checkbox]:indeterminate{--b: var(--p40);--bc: var(--p40);--d-o: .3s;--d-t: .6s;--d-t-e: cubic-bezier(.2, .85, .32, 1.2)}.pagination{margin:20px auto 10px;display:flex;justify-content:center;align-items:center;gap:4px;list-style:none;padding:0}.pagination li a,.pagination li span{font-size:14px;border-radius:12px;padding:4px 18px;background:var(--p20)}.pagination li a:hover,.pagination li span:hover{background:var(--p30)}.pagination li.disabled{pointer-events:none;opacity:.7}.pagination li.active span{background:var(--p30)}.record-edit{position:relative;max-width:900px}.record-edit .invalid-feedback{color:var(--text-error);font-size:15px;line-height:20px;margin-top:10px}.record-header{margin:10px 0 0}.record-header .schema-name{font-size:14px}.record-header .record-title{font-size:18px;display:block}.tools-header{margin:30px 0 0;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;position:relative;z-index:20;padding:10px;border-radius:12px;background:var(--p20)}.editor-field{background:var(--p20);padding:18px;position:relative;border-radius:12px;margin:6px 0;border-color:transparent}.editor-field .button:not(.primary){background:var(--p30)}.editor-field .button:not(.primary):hover{background:var(--p40)}.editor-field dialog .button:not(.primary){background:var(--p20)}.editor-field dialog .button:not(.primary):hover{background:var(--p30)}.field-header{margin-bottom:4px;position:relative}.field-header .labels{display:flex;justify-content:space-between;align-items:center}.field-header .label-and-help{display:flex;align-items:center;gap:6px}.field-header label{font-size:14px;line-height:14px;margin:0;font-weight:700}.field-header .help-text{font-size:14px;line-height:14px}.system-help-text{font-size:14px;line-height:14px;margin-top:10px}.field-checkbox{display:flex;gap:20px;align-items:center}.field-checkbox .form-check-inline{display:flex;align-items:center;gap:4px}.field-checkbox .form-check-label{font-size:14px;line-height:14px}.record-edit-file-preview{display:flex;gap:20px}.record-edit-file-preview .file-details{width:50%;display:flex;flex-direction:column;gap:5px}.record-edit-file-preview .file-details-item .text-muted{color:var(--grey-dark)}.tabs{padding:0;margin:20px 0;display:flex;gap:4px;flex-wrap:wrap}.tabs .tab{list-style:none}input.switch{-webkit-appearance:none;width:34px;height:18px;border:1px solid var(--p40);position:relative;border-radius:50px;box-sizing:content-box;cursor:pointer;transition:background .15s ease-in-out;background:#fff}input.switch:after{top:2px;left:2px;transition:left .15s ease-in-out;content:" ";width:14px;height:14px;background:var(--p40);box-shadow:inset 0 0 0 1px var(--p40);position:absolute;border-radius:50px}input.switch:checked{background:var(--p50)}input.switch:checked:after{left:calc(100% - 17px);background:var(--p10)}.preview-file,.preview-reference{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--p10);border-radius:12px}.preview-file .image,.preview-reference .image{display:flex}.preview-file .reference-action,.preview-reference .reference-action{display:none}.preview-file:hover,.preview-reference:hover{background:var(--p30)}.preview-file:hover .reference-action,.preview-reference:hover .reference-action{display:block}.file-preview-small{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;border-radius:12px;padding:4px}.preview-reference{background:var(--p10);padding:10px 20px}.sortable-container{display:flex;flex-direction:column;gap:5px}.sortable-ghost{border:2px dashed var(--p60)}.sortable-drag{opacity:0!important}.sortable-ghost{opacity:1!important}body:has(dialog[open]){overflow:hidden}dialog{margin:2vh auto;background-color:var(--p10);padding:34px;border:none;border-radius:12px;overflow:auto;max-height:96vh;box-shadow:none!important}dialog .close{position:absolute;top:10px;right:0}dialog .dialog-body{width:fit-content}dialog::backdrop{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.dialog-header{margin-bottom:20px;display:flex;align-items:center;gap:8px;position:sticky;top:-34px;z-index:999;background-color:var(--p10);padding:10px 0}.autocomplete{z-index:1000;overflow:visible}.autocomplete .autocomplete-option{cursor:pointer;font-size:14px;padding:3px 10px}.autocomplete .autocomplete-option:hover{background:var(--p40);border-radius:12px}.autocomplete:focus-within .autocomplete-results{display:flex}.autocomplete-selected-value{font-size:13px;margin-top:10px;border-radius:12px;background:var(--p30);padding:3px 10px;display:inline-flex;justify-content:center;gap:4px;line-height:22px}.autocomplete-selected-value:hover{background:var(--p40)}.autocomplete-results{display:none;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:20;background:var(--p30);transition:.6s;flex-grow:1;top:45px;width:100%}.reference-tags{position:relative;z-index:20}.reference-tags .reference-tags-option{cursor:pointer;font-size:14px;padding:3px 10px}.reference-tags .reference-tags-option:hover{background:var(--p40);border-radius:12px}.reference-tags:focus-within .reference-tags-results{display:flex}.reference-tags-selected-value{font-size:13px;margin-top:10px;border-radius:12px;background:var(--p30);padding:3px 10px;display:inline-flex;justify-content:center;gap:4px;line-height:22px}.reference-tags-selected-value:hover{background:var(--p40)}.reference-tags-results{display:none;flex-direction:column;padding:10px;overflow:visible;position:absolute;border-radius:12px;z-index:20;background:var(--p30);transition:.6s;flex-grow:1;top:45px;width:100%}.reference-tags-results .start-typing{font-style:italic;font-size:13px}.member-list{display:flex;flex-direction:column;gap:5px}.member-item{background:var(--p30);border-radius:12px;padding:12px;display:flex;justify-content:space-between;align-items:center}.member-item .member-name{display:flex;align-items:center;gap:10px}.revisions{display:flex;flex-direction:column;gap:5px}.revisions .revision{justify-content:space-between;display:flex;gap:20px;align-items:center;background:var(--p20);padding:12px;border-radius:12px}.revisions .revision .version{display:flex;gap:10px}.revisions .revision.active{background:var(--p30)}.selected-revision{margin-top:30px;align-items:center;background:var(--p20);padding:12px;border-radius:12px}.selected-revision .button{background:var(--p30)}.selected-revision .revision-field{display:flex;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--p30);flex:1}.selected-revision .revision-field .compare-left,.selected-revision .revision-field .compare-right{width:45%;border-radius:12px;padding:20px;background:var(--p30)}.selected-revision .revision-field .compare-center{width:10%;height:100%;display:flex;gap:20px;align-items:center}.reference-field{width:100px}.revision-references{display:flex;gap:20px;align-items:center;padding:20px 0;border-bottom:1px solid var(--p30)}.reference-compare{width:45%;border-radius:12px;padding:20px;background:var(--p30)}.flatpickr-wrapper{display:block!important}.editor-field .flatpickr-calendar{border-radius:12px!important}.editor-field .flatpickr-months .flatpickr-month{background:var(--p30);color:var(--text);font-size:12px}.editor-field .flatpickr-current-month .flatpickr-monthDropdown-months{background:var(--p30)}.editor-field .flatpickr-weekdays,.editor-field .flatpickr-weekdaycontainer .flatpickr-weekday{background:var(--p30);color:var(--text)}.editor-field .flatpickr-days,.editor-field .flatpickr-time{background:var(--p10);color:var(--text)}body{background-color:var(--p10);font-family:var(--main-font),sans-serif;color:var(--text)}body :focus{outline:none;box-shadow:0 0 1px 2px var(--p70)}.btn-spinner .spinner-border{display:none}.btn-spinner.spinner-on .spinner-border{display:inline-block}.cursor-pointer{cursor:pointer}a{color:var(--text);text-decoration:none}.lucent-component{position:relative}.status-removed.svelte-1jo1k1d{opacity:.5}svg.svelte-1coky4l{vertical-align:text-top}img.svelte-sv092r{border-radius:12px;padding:4px}.color.svelte-78o2k4{width:18px;height:18px;display:inline-block;position:relative;top:3px}a.svelte-nbbgyi{max-width:200px;overflow:hidden;text-overflow:ellipsis;font-size:13px;color:#333}a.svelte-nbbgyi:hover{opacity:.5}div.references.svelte-15ilpfz{max-height:48px;overflow-x:hidden;overflow-y:hidden}div.svelte-1ft053t{max-height:24px;text-overflow:ellipsis;overflow:hidden}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 #e6e6e6,-1px 0 #e6e6e6,0 1px #e6e6e6,0 -1px #e6e6e6,0 3px 13px #00000014}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-months .flatpickr-month{background:transparent;color:#000000e6;fill:#000000e6;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#000000e6;fill:#000000e6}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg path{fill:#00000080}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:#000000e6}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:#000000e6}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:#00000080;background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:transparent;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}span.flatpickr-weekday{cursor:default;font-size:90%;background:transparent;color:#0000008a;line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #e6e6e6;box-shadow:-1px 0 #e6e6e6}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#569ff7;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #569ff7;box-shadow:-10px 0 #569ff7}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-5px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:#3939394d;background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:#3939391a}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7;box-shadow:-5px 0 #569ff7,5px 0 #569ff7}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 #e6e6e6;box-shadow:1px 0 #e6e6e6}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:#3939394d;background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eee}.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-box-shadow:0 3px 13px rgba(0,0,0,.08);box-shadow:0 3px 13px #00000014}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #eceef1}.flatpickr-calendar.hasTime .flatpickr-innerContainer{border-bottom:0}.flatpickr-calendar.hasTime .flatpickr-time{border:1px solid #eceef1}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#eceef1}.flatpickr-calendar.arrowTop:after{border-bottom-color:#eceef1}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#eceef1}.flatpickr-calendar.arrowBottom:after{border-top-color:#eceef1}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{border-radius:5px 5px 0 0;background:#eceef1;color:#5a6171;fill:#5a6171;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#5a6171;fill:#5a6171}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#bbb}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(72,72,72,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.numInputWrapper span:hover{background:#0000001a}.numInputWrapper span:active{background:#0003}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(72,72,72,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(72,72,72,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:#5a617180}.numInputWrapper:hover{background:#0000000d}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0px,0px,0px);transform:translateZ(0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:#0000000d}.flatpickr-current-month .numInputWrapper{width:6ch;width:7ch�;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:#5a6171}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:#5a6171}.flatpickr-current-month input.cur-year{background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:#5a617180;background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:#eceef1;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0;outline:none;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:#0000000d}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:#eceef1;outline:none;padding:0}.flatpickr-weekdays{background:#eceef1;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:#eceef1;color:#5a6171;line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;width:307.875px;border-left:1px solid #eceef1;border-right:1px solid #eceef1}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;display:-ms-flexbox;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-wrap:wrap;-ms-flex-pack:justify;-webkit-justify-content:space-around;justify-content:space-around;-webkit-transform:translate3d(0px,0px,0px);transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 #eceef1;box-shadow:-1px 0 #eceef1}.flatpickr-day{background:none;border:1px solid transparent;border-radius:150px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#484848;cursor:pointer;font-weight:400;width:14.2857143%;-webkit-flex-basis:14.2857143%;-ms-flex-preferred-size:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:#e2e2e2;border-color:#e2e2e2}.flatpickr-day.today{border-color:#bbb}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:#bbb;background:#bbb;color:#fff}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:#ff5a5f;-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:#ff5a5f}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 #ff5a5f;box-shadow:-10px 0 #ff5a5f}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;-webkit-box-shadow:-5px 0 0 #e2e2e2,5px 0 0 #e2e2e2;box-shadow:-5px 0 #e2e2e2,5px 0 #e2e2e2}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:#4848484d;background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:#4848481a}.flatpickr-day.week.selected{border-radius:0;-webkit-box-shadow:-5px 0 0 #ff5a5f,5px 0 0 #ff5a5f;box-shadow:-5px 0 #ff5a5f,5px 0 #ff5a5f}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;border-left:1px solid #eceef1}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:#4848484d;background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;background:#fff;border-bottom:1px solid #eceef1}.flatpickr-rContainer{display:inline-block;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;background:#fff;border-radius:0 0 5px 5px}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#484848}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#484848}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#484848;font-size:14px;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:#484848;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:#eaeaea}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}@keyframes fpFadeInDown{0%{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}span.flatpickr-day.selected{font-weight:700}textarea.svelte-1er4ovm{resize:none}trix-editor{border:1px solid #bbb;border-radius:3px;margin:0;padding:.4em .6em;min-height:5em;outline:none}trix-toolbar *{box-sizing:border-box}trix-toolbar .trix-button-row{display:flex;flex-wrap:nowrap;justify-content:space-between;overflow-x:auto}trix-toolbar .trix-button-group{display:flex;margin-bottom:10px;border:1px solid #bbb;border-top-color:#ccc;border-bottom-color:#888;border-radius:3px}trix-toolbar .trix-button-group:not(:first-child){margin-left:1.5vw}@media (max-width: 768px){trix-toolbar .trix-button-group:not(:first-child){margin-left:0}}trix-toolbar .trix-button-group-spacer{flex-grow:1}@media (max-width: 768px){trix-toolbar .trix-button-group-spacer{display:none}}trix-toolbar .trix-button{position:relative;float:left;color:#0009;font-size:.75em;font-weight:600;white-space:nowrap;padding:0 .5em;margin:0;outline:none;border:none;border-bottom:1px solid #ddd;border-radius:0;background:transparent}trix-toolbar .trix-button:not(:first-child){border-left:1px solid #ccc}trix-toolbar .trix-button.trix-active{background:#cbeefa;color:#000}trix-toolbar .trix-button:not(:disabled){cursor:pointer}trix-toolbar .trix-button:disabled{color:#00000020}@media (max-width: 768px){trix-toolbar .trix-button{letter-spacing:-.01em;padding:0 .3em}}trix-toolbar .trix-button--icon{font-size:inherit;width:2.6em;height:1.6em;max-width:calc(.8em + 4vw);text-indent:-9999px}@media (max-width: 768px){trix-toolbar .trix-button--icon{height:2em;max-width:calc(.8em + 3.5vw)}}trix-toolbar .trix-button--icon:before{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;opacity:.6;content:"";background-position:center;background-repeat:no-repeat;background-size:contain}@media (max-width: 768px){trix-toolbar .trix-button--icon:before{right:6%;left:6%}}trix-toolbar .trix-button--icon.trix-active:before{opacity:1}trix-toolbar .trix-button--icon:disabled:before{opacity:.125}trix-toolbar .trix-button--icon-attach:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.5%2018V7.5c0-2.25%203-2.25%203%200V18c0%204.125-6%204.125-6%200V7.5c0-6.375%209-6.375%209%200V18%22%20stroke%3D%22%23000%22%20stroke-width%3D%222%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E);top:8%;bottom:4%}trix-toolbar .trix-button--icon-bold:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.522%2019.242a.5.5%200%200%201-.5-.5V5.35a.5.5%200%200%201%20.5-.5h5.783c1.347%200%202.46.345%203.24.982.783.64%201.216%201.562%201.216%202.683%200%201.13-.587%202.129-1.476%202.71a.35.35%200%200%200%20.049.613c1.259.56%202.101%201.742%202.101%203.22%200%201.282-.483%202.334-1.363%203.063-.876.726-2.132%201.12-3.66%201.12h-5.89ZM9.27%207.347v3.362h1.97c.766%200%201.347-.17%201.733-.464.38-.291.587-.716.587-1.27%200-.53-.183-.928-.513-1.198-.334-.273-.838-.43-1.505-.43H9.27Zm0%205.606v3.791h2.389c.832%200%201.448-.177%201.853-.497.399-.315.614-.786.614-1.423%200-.62-.22-1.077-.63-1.385-.418-.313-1.053-.486-1.905-.486H9.27Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-italic:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9%205h6.5v2h-2.23l-2.31%2010H13v2H6v-2h2.461l2.306-10H9V5Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-link:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M18.948%205.258a4.337%204.337%200%200%200-6.108%200L11.217%206.87a.993.993%200%200%200%200%201.41c.392.39%201.027.39%201.418%200l1.623-1.613a2.323%202.323%200%200%201%203.271%200%202.29%202.29%200%200%201%200%203.251l-2.393%202.38a3.021%203.021%200%200%201-4.255%200l-.05-.049a1.007%201.007%200%200%200-1.418%200%20.993.993%200%200%200%200%201.41l.05.049a5.036%205.036%200%200%200%207.091%200l2.394-2.38a4.275%204.275%200%200%200%200-6.072Zm-13.683%2013.6a4.337%204.337%200%200%200%206.108%200l1.262-1.255a.993.993%200%200%200%200-1.41%201.007%201.007%200%200%200-1.418%200L9.954%2017.45a2.323%202.323%200%200%201-3.27%200%202.29%202.29%200%200%201%200-3.251l2.344-2.331a2.579%202.579%200%200%201%203.631%200c.392.39%201.027.39%201.419%200a.993.993%200%200%200%200-1.41%204.593%204.593%200%200%200-6.468%200l-2.345%202.33a4.275%204.275%200%200%200%200%206.072Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-strike:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6%2014.986c.088%202.647%202.246%204.258%205.635%204.258%203.496%200%205.713-1.728%205.713-4.463%200-.275-.02-.536-.062-.781h-3.461c.398.293.573.654.573%201.123%200%201.035-1.074%201.787-2.646%201.787-1.563%200-2.773-.762-2.91-1.924H6ZM6.432%2010h3.763c-.632-.314-.914-.715-.914-1.273%200-1.045.977-1.739%202.432-1.739%201.475%200%202.52.723%202.617%201.914h2.764c-.05-2.548-2.11-4.238-5.39-4.238-3.145%200-5.392%201.719-5.392%204.316%200%20.363.04.703.12%201.02ZM4%2011a1%201%200%201%200%200%202h15a1%201%200%201%200%200-2H4Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-quote:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.581%208.471c.44-.5%201.056-.834%201.758-.995C8.074%207.17%209.201%207.822%2010%208.752c1.354%201.578%201.33%203.555.394%205.277-.941%201.731-2.788%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.121-.49.16-.764.294-.286.567-.566.791-.835.222-.266.413-.54.524-.815.113-.28.156-.597.026-.908-.128-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.674-2.7c0-.905.283-1.59.72-2.088Zm9.419%200c.44-.5%201.055-.834%201.758-.995%201.734-.306%202.862.346%203.66%201.276%201.355%201.578%201.33%203.555.395%205.277-.941%201.731-2.789%203.163-4.988%203.56a.622.622%200%200%201-.653-.317c-.113-.205-.122-.49.16-.764.294-.286.567-.566.791-.835.222-.266.412-.54.523-.815.114-.28.157-.597.026-.908-.127-.303-.39-.524-.72-.69a3.02%203.02%200%200%201-1.672-2.701c0-.905.283-1.59.72-2.088Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-heading-1:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.5%207.5v-3h-12v3H14v13h3v-13h4.5ZM9%2013.5h3.5v-3h-10v3H6v7h3v-7Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-code:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.293%2011.293a1%201%200%200%200%200%201.414l4%204a1%201%200%201%200%201.414-1.414L5.414%2012l3.293-3.293a1%201%200%200%200-1.414-1.414l-4%204Zm13.414%205.414%204-4a1%201%200%200%200%200-1.414l-4-4a1%201%200%201%200-1.414%201.414L18.586%2012l-3.293%203.293a1%201%200%200%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-bullet-list:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%207.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203ZM8%206a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-2.5-5a1.5%201.5%200%201%201-3%200%201.5%201.5%200%200%201%203%200ZM5%2019.5a1.5%201.5%200%201%200%200-3%201.5%201.5%200%200%200%200%203Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-number-list:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%204h2v4H4V5H3V4Zm5%202a1%201%200%200%201%201-1h11a1%201%200%201%201%200%202H9a1%201%200%200%201-1-1Zm1%205a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm0%206a1%201%200%201%200%200%202h11a1%201%200%201%200%200-2H9Zm-3.5-7H6v1l-1.5%202H6v1H3v-1l1.667-2H3v-1h2.5ZM3%2017v-1h3v4H3v-1h2v-.5H4v-1h1V17H3Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-undo:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3%2014a1%201%200%200%200%201%201h6a1%201%200%201%200%200-2H6.257c2.247-2.764%205.151-3.668%207.579-3.264%202.589.432%204.739%202.356%205.174%205.405a1%201%200%200%200%201.98-.283c-.564-3.95-3.415-6.526-6.825-7.095C11.084%207.25%207.63%208.377%205%2011.39V8a1%201%200%200%200-2%200v6Zm2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-redo:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21%2014a1%201%200%200%201-1%201h-6a1%201%200%201%201%200-2h3.743c-2.247-2.764-5.151-3.668-7.579-3.264-2.589.432-4.739%202.356-5.174%205.405a1%201%200%200%201-1.98-.283c.564-3.95%203.415-6.526%206.826-7.095%203.08-.513%206.534.614%209.164%203.626V8a1%201%200%201%201%202%200v6Zm-2-1Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-decrease-nesting-level:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-3.707-5.707a1%201%200%200%200%200%201.414l2%202a1%201%200%201%200%201.414-1.414L4.414%2012l1.293-1.293a1%201%200%200%200-1.414-1.414l-2%202Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-button--icon-increase-nesting-level:before{background-image:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M5%206a1%201%200%200%201%201-1h12a1%201%200%201%201%200%202H6a1%201%200%200%201-1-1Zm4%205a1%201%200%201%200%200%202h9a1%201%200%201%200%200-2H9Zm-3%206a1%201%200%201%200%200%202h12a1%201%200%201%200%200-2H6Zm-2.293-2.293%202-2a1%201%200%200%200%200-1.414l-2-2a1%201%200%201%200-1.414%201.414L3.586%2012l-1.293%201.293a1%201%200%201%200%201.414%201.414Z%22%20fill%3D%22%23000%22%2F%3E%3C%2Fsvg%3E)}trix-toolbar .trix-dialogs{position:relative}trix-toolbar .trix-dialog{position:absolute;top:0;left:0;right:0;font-size:.75em;padding:15px 10px;background:#fff;box-shadow:0 .3em 1em #ccc;border-top:2px solid #888;border-radius:5px;z-index:5}trix-toolbar .trix-input--dialog{font-size:inherit;font-weight:400;padding:.5em .8em;margin:0 10px 0 0;border-radius:3px;border:1px solid #bbb;background-color:#fff;box-shadow:none;outline:none;-webkit-appearance:none;-moz-appearance:none}trix-toolbar .trix-input--dialog.validate:invalid{box-shadow:red 0 0 1.5px 1px}trix-toolbar .trix-button--dialog{font-size:inherit;padding:.5em;border-bottom:none}trix-toolbar .trix-dialog--link{max-width:600px}trix-toolbar .trix-dialog__link-fields{display:flex;align-items:baseline}trix-toolbar .trix-dialog__link-fields .trix-input{flex:1}trix-toolbar .trix-dialog__link-fields .trix-button-group{flex:0 0 content;margin:0}trix-editor [data-trix-mutable]:not(.attachment__caption-editor){-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}trix-editor [data-trix-mutable] ::-moz-selection,trix-editor [data-trix-mutable]::-moz-selection,trix-editor [data-trix-cursor-target]::-moz-selection{background:none}trix-editor [data-trix-mutable] ::selection,trix-editor [data-trix-mutable]::selection,trix-editor [data-trix-cursor-target]::selection{background:none}trix-editor [data-trix-mutable].attachment__caption-editor:focus::-moz-selection{background:highlight}trix-editor [data-trix-mutable].attachment__caption-editor:focus::selection{background:highlight}trix-editor [data-trix-mutable].attachment.attachment--file{box-shadow:0 0 0 2px highlight;border-color:transparent}trix-editor [data-trix-mutable].attachment img{box-shadow:0 0 0 2px highlight}trix-editor .attachment{position:relative}trix-editor .attachment:hover{cursor:default}trix-editor .attachment--preview .attachment__caption:hover{cursor:text}trix-editor .attachment__progress{position:absolute;z-index:1;height:20px;top:calc(50% - 10px);left:5%;width:90%;opacity:.9;transition:opacity .2s ease-in}trix-editor .attachment__progress[value="100"]{opacity:0}trix-editor .attachment__caption-editor{display:inline-block;width:100%;margin:0;padding:0;font-size:inherit;font-family:inherit;line-height:inherit;color:inherit;text-align:center;vertical-align:top;border:none;outline:none;-webkit-appearance:none;-moz-appearance:none}trix-editor .attachment__toolbar{position:absolute;z-index:1;top:-.9em;left:0;width:100%;text-align:center}trix-editor .trix-button-group{display:inline-flex}trix-editor .trix-button{position:relative;float:left;color:#666;white-space:nowrap;font-size:80%;padding:0 .8em;margin:0;outline:none;border:none;border-radius:0;background:transparent}trix-editor .trix-button:not(:first-child){border-left:1px solid #ccc}trix-editor .trix-button.trix-active{background:#cbeefa}trix-editor .trix-button:not(:disabled){cursor:pointer}trix-editor .trix-button--remove{text-indent:-9999px;display:inline-block;padding:0;outline:none;width:1.8em;height:1.8em;line-height:1.8em;border-radius:50%;background-color:#fff;border:2px solid highlight;box-shadow:1px 1px 6px #00000040}trix-editor .trix-button--remove:before{display:inline-block;position:absolute;top:0;right:0;bottom:0;left:0;opacity:.7;content:"";background-image:url(data:image/svg+xml,%3Csvg%20height%3D%2224%22%20width%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M19%206.41%2017.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22%2F%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E);background-position:center;background-repeat:no-repeat;background-size:90%}trix-editor .trix-button--remove:hover{border-color:#333}trix-editor .trix-button--remove:hover:before{opacity:1}trix-editor .attachment__metadata-container{position:relative}trix-editor .attachment__metadata{position:absolute;left:50%;top:2em;transform:translate(-50%);max-width:90%;padding:.1em .6em;font-size:.8em;color:#fff;background-color:#000000b3;border-radius:3px}trix-editor .attachment__metadata .attachment__name{display:inline-block;max-width:100%;vertical-align:bottom;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}trix-editor .attachment__metadata .attachment__size{margin-left:.2em;white-space:nowrap}.trix-content{line-height:1.5;overflow-wrap:break-word;word-break:break-word}.trix-content *{box-sizing:border-box;margin:0;padding:0}.trix-content h1{font-size:1.2em;line-height:1.2}.trix-content blockquote{border:0 solid #ccc;border-left-width:.3em;margin-left:.3em;padding-left:.6em}.trix-content [dir=rtl] blockquote,.trix-content blockquote[dir=rtl]{border-width:0;border-right-width:.3em;margin-right:.3em;padding-right:.6em}.trix-content li{margin-left:1em}.trix-content [dir=rtl] li{margin-right:1em}.trix-content pre{display:inline-block;width:100%;vertical-align:top;font-family:monospace;font-size:.9em;padding:.5em;white-space:pre;background-color:#eee;overflow-x:auto}.trix-content img{max-width:100%;height:auto}.trix-content .attachment{display:inline-block;position:relative;max-width:100%}.trix-content .attachment a{color:inherit;text-decoration:none}.trix-content .attachment a:hover,.trix-content .attachment a:visited:hover{color:inherit}.trix-content .attachment__caption{text-align:center}.trix-content .attachment__caption .attachment__name+.attachment__size:before{content:" •"}.trix-content .attachment--preview{width:100%;text-align:center}.trix-content .attachment--preview .attachment__caption{color:#666;font-size:.9em;line-height:1.2}.trix-content .attachment--file{color:#333;line-height:1;margin:0 2px 2px;padding:.4em 1em;border:1px solid #bbb;border-radius:5px}.trix-content .attachment-gallery{display:flex;flex-wrap:wrap;position:relative}.trix-content .attachment-gallery .attachment{flex:1 0 33%;padding:0 .5em;max-width:33%}.trix-content .attachment-gallery.attachment-gallery--2 .attachment,.trix-content .attachment-gallery.attachment-gallery--4 .attachment{flex-basis:50%;max-width:50%}.field-content.svelte-s7tjhg{max-height:200px;overflow-y:scroll}.logs.svelte-16mig2w{max-height:70vh;overflow:scroll;background:var(--p90);color:var(--p10);padding:10px} diff --git a/front/dist/assets/main-DH0OAeUr.js b/front/dist/assets/main-DtbuHUXl.js similarity index 63% rename from front/dist/assets/main-DH0OAeUr.js rename to front/dist/assets/main-DtbuHUXl.js index 0933d68..2855cfd 100644 --- a/front/dist/assets/main-DH0OAeUr.js +++ b/front/dist/assets/main-DtbuHUXl.js @@ -1,39 +1,39 @@ -var bP=Object.defineProperty;var vP=(i,e,t)=>e in i?bP(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Qh=(i,e,t)=>(vP(i,typeof e!="symbol"?e+"":e,t),t);function U(){}const wP=i=>i;function Cs(i,e){for(const t in e)i[t]=e[t];return i}function ty(i){return i()}function tg(){return Object.create(null)}function ut(i){i.forEach(ty)}function nh(i){return typeof i=="function"}function re(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let qa;function ad(i,e){return i===e?!0:(qa||(qa=document.createElement("a")),qa.href=e,i===qa.href)}function yP(i){return Object.keys(i).length===0}function Gl(i,e,t,n){if(i){const r=ny(i,e,t,n);return i[0](r)}}function ny(i,e,t,n){return i[1]&&n?Cs(t.ctx.slice(),i[1](n(e))):t.ctx}function Hl(i,e,t,n){if(i[2]&&n){const r=i[2](n(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(e.dirty.length,r.length);for(let l=0;l32){const e=[],t=i.ctx.length/32;for(let n=0;nwindow.performance.now():()=>Date.now(),Xm=iy?i=>requestAnimationFrame(i):U;const oo=new Set;function ry(i){oo.forEach(e=>{e.c(i)||(oo.delete(e),e.f())}),oo.size!==0&&Xm(ry)}function _P(i){let e;return oo.size===0&&Xm(ry),{promise:new Promise(t=>{oo.add(e={c:i,f:t})}),abort(){oo.delete(e)}}}const CP=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function v(i,e){i.appendChild(e)}function sy(i){if(!i)return document;const e=i.getRootNode?i.getRootNode():i.ownerDocument;return e&&e.host?e:i.ownerDocument}function PP(i){const e=y("style");return e.textContent="/* empty */",AP(sy(i),e),e.sheet}function AP(i,e){return v(i.head||i,e),e.sheet}function A(i,e,t){i.insertBefore(e,t||null)}function P(i){i.parentNode&&i.parentNode.removeChild(i)}function mt(i,e){for(let t=0;ti.removeEventListener(e,t,n)}function Ln(i){return function(e){return e.preventDefault(),i.call(this,e)}}function O(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Ko(i,e,t){const n=e.toLowerCase();n in i?i[n]=typeof i[n]=="boolean"&&t===""?!0:t:e in i?i[e]=typeof i[e]=="boolean"&&t===""?!0:t:O(i,e,t)}function oy(i){let e;return{p(...t){e=t,e.forEach(n=>i.push(n))},r(){e.forEach(t=>i.splice(i.indexOf(t),1))}}}function ly(i){return i===""?null:+i}function TP(i){return Array.from(i.childNodes)}function K(i,e){e=""+e,i.data!==e&&(i.data=e)}function Ie(i,e){i.value=e??""}function fe(i,e,t,n){t==null?i.style.removeProperty(e):i.style.setProperty(e,t,"")}function ig(i,e,t){for(let n=0;n>>0}function EP(i,e){const t={stylesheet:PP(e),rules:{}};return su.set(i,t),t}function rg(i,e,t,n,r,s,o,l=0){const a=16.666/n;let c=`{ -`;for(let g=0;g<=1;g+=a){const b=e+(t-e)*s(g);c+=g*100+`%{${o(b,1-b)}} +var uP=Object.defineProperty;var hP=(i,e,t)=>e in i?uP(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Qh=(i,e,t)=>(hP(i,typeof e!="symbol"?e+"":e,t),t);function U(){}const fP=i=>i;function Ps(i,e){for(const t in e)i[t]=e[t];return i}function Yw(i){return i()}function Jp(){return Object.create(null)}function ht(i){i.forEach(Yw)}function nh(i){return typeof i=="function"}function re(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}let qa;function ad(i,e){return i===e?!0:(qa||(qa=document.createElement("a")),qa.href=e,i===qa.href)}function dP(i){return Object.keys(i).length===0}function Hl(i,e,t,n){if(i){const r=zw(i,e,t,n);return i[0](r)}}function zw(i,e,t,n){return i[1]&&n?Ps(t.ctx.slice(),i[1](n(e))):t.ctx}function Kl(i,e,t,n){if(i[2]&&n){const r=i[2](n(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],o=Math.max(e.dirty.length,r.length);for(let l=0;l32){const e=[],t=i.ctx.length/32;for(let n=0;nwindow.performance.now():()=>Date.now(),Xm=Vw?i=>requestAnimationFrame(i):U;const lo=new Set;function Uw(i){lo.forEach(e=>{e.c(i)||(lo.delete(e),e.f())}),lo.size!==0&&Xm(Uw)}function gP(i){let e;return lo.size===0&&Xm(Uw),{promise:new Promise(t=>{lo.add(e={c:i,f:t})}),abort(){lo.delete(e)}}}const OP=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function b(i,e){i.appendChild(e)}function jw(i){if(!i)return document;const e=i.getRootNode?i.getRootNode():i.ownerDocument;return e&&e.host?e:i.ownerDocument}function bP(i){const e=y("style");return e.textContent="/* empty */",vP(jw(i),e),e.sheet}function vP(i,e){return b(i.head||i,e),e.sheet}function x(i,e,t){i.insertBefore(e,t||null)}function P(i){i.parentNode&&i.parentNode.removeChild(i)}function Ot(i,e){for(let t=0;ti.removeEventListener(e,t,n)}function Ln(i){return function(e){return e.preventDefault(),i.call(this,e)}}function O(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function Jo(i,e,t){const n=e.toLowerCase();n in i?i[n]=typeof i[n]=="boolean"&&t===""?!0:t:e in i?i[e]=typeof i[e]=="boolean"&&t===""?!0:t:O(i,e,t)}function qw(i){let e;return{p(...t){e=t,e.forEach(n=>i.push(n))},r(){e.forEach(t=>i.splice(i.indexOf(t),1))}}}function Gw(i){return i===""?null:+i}function yP(i){return Array.from(i.childNodes)}function K(i,e){e=""+e,i.data!==e&&(i.data=e)}function Le(i,e){i.value=e??""}function le(i,e,t,n){t==null?i.style.removeProperty(e):i.style.setProperty(e,t,"")}function tg(i,e,t){for(let n=0;n>>0}function _P(i,e){const t={stylesheet:bP(e),rules:{}};return su.set(i,t),t}function ng(i,e,t,n,r,s,o,l=0){const a=16.666/n;let c=`{ +`;for(let g=0;g<=1;g+=a){const v=e+(t-e)*s(g);c+=g*100+`%{${o(v,1-v)}} `}const u=c+`100% {${o(t,1-t)}} -}`,h=`__svelte_${MP(u)}_${l}`,f=sy(i),{stylesheet:d,rules:m}=su.get(f)||EP(f,i);m[h]||(m[h]=!0,d.insertRule(`@keyframes ${h} ${u}`,d.cssRules.length));const p=i.style.animation||"";return i.style.animation=`${p?`${p}, `:""}${h} ${n}ms linear ${r}ms 1 both`,ou+=1,h}function RP(i,e){const t=(i.style.animation||"").split(", "),n=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),r=t.length-n.length;r&&(i.style.animation=n.join(", "),ou-=r,ou||DP())}function DP(){Xm(()=>{ou||(su.forEach(i=>{const{ownerNode:e}=i.stylesheet;e&&P(e)}),su.clear())})}let ea;function xl(i){ea=i}function Zo(){if(!ea)throw new Error("Function called outside component initialization");return ea}function Ti(i){Zo().$$.on_mount.push(i)}function cy(i){Zo().$$.after_update.push(i)}function uy(i){Zo().$$.on_destroy.push(i)}function nn(){const i=Zo();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const s=ay(e,t,{cancelable:n});return r.slice().forEach(o=>{o.call(i,s)}),!s.defaultPrevented}return!0}}function Tl(i,e){return Zo().$$.context.set(i,e),e}function je(i){return Zo().$$.context.get(i)}function Lr(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Gs=[],Se=[];let lo=[];const cd=[],$P=Promise.resolve();let ud=!1;function LP(){ud||(ud=!0,$P.then(hy))}function Ps(i){lo.push(i)}function nt(i){cd.push(i)}const Mh=new Set;let zs=0;function hy(){if(zs!==0)return;const i=ea;do{try{for(;zsi.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),lo=e}let Jo;function ZP(){return Jo||(Jo=Promise.resolve(),Jo.then(()=>{Jo=null})),Jo}function Eh(i,e,t){i.dispatchEvent(ay(`${e?"intro":"outro"}${t}`))}const Lc=new Set;let sr;function me(){sr={r:0,c:[],p:sr}}function pe(){sr.r||ut(sr.c),sr=sr.p}function T(i,e){i&&i.i&&(Lc.delete(i),i.i(e))}function R(i,e,t,n){if(i&&i.o){if(Lc.has(i))return;Lc.add(i),sr.c.push(()=>{Lc.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}const BP={duration:0};function lu(i,e,t,n){let s=e(i,t,{direction:"both"}),o=n?0:1,l=null,a=null,c=null,u;function h(){c&&RP(i,c)}function f(m,p){const g=m.b-o;return p*=Math.abs(g),{a:o,b:m.b,d:g,duration:p,start:m.start,end:m.start+p,group:m.group}}function d(m){const{delay:p=0,duration:g=300,easing:b=wP,tick:w=U,css:S}=s||BP,_={start:SP()+p,b:m};m||(_.group=sr,sr.r+=1),"inert"in i&&(m?u!==void 0&&(i.inert=u):(u=i.inert,i.inert=!0)),l||a?a=_:(S&&(h(),c=rg(i,o,m,g,p,b,S)),m&&w(0,1),l=f(_,g),Ps(()=>Eh(i,m,"start")),_P(k=>{if(a&&k>a.start&&(l=f(a,g),a=null,Eh(i,l.b,"start"),S&&(h(),c=rg(i,o,l.b,l.duration,0,b,s.css))),l){if(k>=l.end)w(o=l.b,1-o),Eh(i,l.b,"end"),a||(l.b?h():--l.group.r||ut(l.group.c)),l=null;else if(k>=l.start){const Q=k-l.start;o=l.a+l.d*b(Q/l.duration),w(o,1-o)}}return!!(l||a)}))}return{run(m){nh(s)?ZP().then(()=>{s=s({direction:m?"in":"out"}),d(m)}):d(m)},end(){h(),l=a=null}}}function ue(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Fm(i,e){i.d(1),e.delete(i.key)}function mr(i,e){R(i,1,1,()=>{e.delete(i.key)})}function di(i,e,t,n,r,s,o,l,a,c,u,h){let f=i.length,d=s.length,m=f;const p={};for(;m--;)p[i[m].key]=m;const g=[],b=new Map,w=new Map,S=[];for(m=d;m--;){const x=h(r,s,m),C=t(x);let M=o.get(C);M?S.push(()=>M.p(x,e)):(M=c(C,x),M.c()),b.set(C,g[m]=M),C in p&&w.set(C,Math.abs(m-p[C]))}const _=new Set,k=new Set;function Q(x){T(x,1),x.m(l,u),o.set(x.key,x),u=x.first,d--}for(;f&&d;){const x=g[d-1],C=i[f-1],M=x.key,$=C.key;x===C?(u=x.first,f--,d--):b.has($)?!o.has(M)||_.has(M)?Q(x):k.has($)?f--:w.get(M)>w.get($)?(k.add(M),Q(x)):(_.add($),f--):(a(C,o),f--)}for(;f--;){const x=i[f];b.has(x.key)||a(x,o)}for(;d;)Q(g[d-1]);return ut(S),g}function So(i,e){const t={},n={},r={$$scope:1};let s=i.length;for(;s--;){const o=i[s],l=e[s];if(l){for(const a in o)a in l||(n[a]=1);for(const a in l)r[a]||(t[a]=l[a],r[a]=1);i[s]=l}else for(const a in o)r[a]=1}for(const o in n)o in t||(t[o]=void 0);return t}function _o(i){return typeof i=="object"&&i!==null?i:{}}function He(i,e,t){const n=i.$$.props[e];n!==void 0&&(i.$$.bound[n]=t,t(i.$$.ctx[n]))}function V(i){i&&i.c()}function Y(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),Ps(()=>{const s=i.$$.on_mount.map(ty).filter(nh);i.$$.on_destroy?i.$$.on_destroy.push(...s):ut(s),i.$$.on_mount=[]}),r.forEach(Ps)}function z(i,e){const t=i.$$;t.fragment!==null&&(NP(t.after_update),ut(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function WP(i,e){i.$$.dirty[0]===-1&&(Gs.push(i),LP(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<{const m=d.length?d[0]:f;return c.ctx&&r(c.ctx[h],c.ctx[h]=m)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](m),u&&WP(i,h)),f}):[],c.update(),u=!0,ut(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const h=TP(e.target);c.fragment&&c.fragment.l(h),h.forEach(P)}else c.fragment&&c.fragment.c();e.intro&&T(i.$$.fragment),Y(i,e.target,e.anchor),hy()}xl(a)}class oe{constructor(){Qh(this,"$$");Qh(this,"$$set")}$destroy(){z(this,1),this.$destroy=U}$on(e,t){if(!nh(t))return U;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!yP(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const XP="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(XP);function _t(i){const e=Object.prototype.toString.call(i);return i instanceof Date||typeof i=="object"&&e==="[object Date]"?new i.constructor(+i):typeof i=="number"||e==="[object Number]"||typeof i=="string"||e==="[object String]"?new Date(i):new Date(NaN)}function Yr(i,e){return i instanceof Date?new i.constructor(e):new Date(e)}const fy=6048e5,FP=864e5,Ga=43200,sg=1440;let YP={};function Ta(){return YP}function ta(i,e){var l,a,c,u;const t=Ta(),n=(e==null?void 0:e.weekStartsOn)??((a=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:a.weekStartsOn)??t.weekStartsOn??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,r=_t(i),s=r.getDay(),o=(s=r.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function og(i){const e=_t(i);return e.setHours(0,0,0,0),e}function cu(i){const e=_t(i),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+i-+t}function zP(i,e){const t=og(i),n=og(e),r=+t-cu(t),s=+n-cu(n);return Math.round((r-s)/FP)}function VP(i){const e=dy(i),t=Yr(i,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),au(t)}function Ic(i,e){const t=_t(i),n=_t(e),r=t.getTime()-n.getTime();return r<0?-1:r>0?1:r}function UP(i){return Yr(i,Date.now())}function jP(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function qP(i){if(!jP(i)&&typeof i!="number")return!1;const e=_t(i);return!isNaN(Number(e))}function GP(i,e){const t=_t(i),n=_t(e),r=t.getFullYear()-n.getFullYear(),s=t.getMonth()-n.getMonth();return r*12+s}function HP(i){return e=>{const n=(i?Math[i]:Math.trunc)(e);return n===0?0:n}}function KP(i,e){return+_t(i)-+_t(e)}function JP(i){const e=_t(i);return e.setHours(23,59,59,999),e}function eA(i){const e=_t(i),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function tA(i){const e=_t(i);return+JP(e)==+eA(e)}function nA(i,e){const t=_t(i),n=_t(e),r=Ic(t,n),s=Math.abs(GP(t,n));let o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-r*s);let l=Ic(t,n)===-r;tA(_t(i))&&s===1&&Ic(i,n)===1&&(l=!1),o=r*(s-Number(l))}return o===0?0:o}function iA(i,e,t){const n=KP(i,e)/1e3;return HP(t==null?void 0:t.roundingMethod)(n)}function rA(i){const e=_t(i),t=Yr(i,0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}const sA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},oA=(i,e,t)=>{let n;const r=sA[i];return typeof r=="string"?n=r:e===1?n=r.one:n=r.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function Rh(i){return(e={})=>{const t=e.width?String(e.width):i.defaultWidth;return i.formats[t]||i.formats[i.defaultWidth]}}const lA={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},aA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uA={date:Rh({formats:lA,defaultWidth:"full"}),time:Rh({formats:aA,defaultWidth:"full"}),dateTime:Rh({formats:cA,defaultWidth:"full"})},hA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fA=(i,e,t,n)=>hA[i];function el(i){return(e,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let r;if(n==="formatting"&&i.formattingValues){const o=i.defaultFormattingWidth||i.defaultWidth,l=t!=null&&t.width?String(t.width):o;r=i.formattingValues[l]||i.formattingValues[o]}else{const o=i.defaultWidth,l=t!=null&&t.width?String(t.width):i.defaultWidth;r=i.values[l]||i.values[o]}const s=i.argumentCallback?i.argumentCallback(e):e;return r[s]}}const dA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pA={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gA={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},OA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},bA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vA=(i,e)=>{const t=Number(i),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},wA={ordinalNumber:vA,era:el({values:dA,defaultWidth:"wide"}),quarter:el({values:mA,defaultWidth:"wide",argumentCallback:i=>i-1}),month:el({values:pA,defaultWidth:"wide"}),day:el({values:gA,defaultWidth:"wide"}),dayPeriod:el({values:OA,defaultWidth:"wide",formattingValues:bA,defaultFormattingWidth:"wide"})};function tl(i){return(e,t={})=>{const n=t.width,r=n&&i.matchPatterns[n]||i.matchPatterns[i.defaultMatchWidth],s=e.match(r);if(!s)return null;const o=s[0],l=n&&i.parsePatterns[n]||i.parsePatterns[i.defaultParseWidth],a=Array.isArray(l)?kA(l,h=>h.test(o)):yA(l,h=>h.test(o));let c;c=i.valueCallback?i.valueCallback(a):a,c=t.valueCallback?t.valueCallback(c):c;const u=e.slice(o.length);return{value:c,rest:u}}}function yA(i,e){for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&e(i[t]))return t}function kA(i,e){for(let t=0;t{const n=e.match(i.matchPattern);if(!n)return null;const r=n[0],s=e.match(i.parsePattern);if(!s)return null;let o=i.valueCallback?i.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const l=e.slice(r.length);return{value:o,rest:l}}}const _A=/^(\d+)(th|st|nd|rd)?/i,CA=/\d+/i,PA={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},AA={any:[/^b/i,/^(a|c)/i]},xA={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},TA={any:[/1/i,/2/i,/3/i,/4/i]},QA={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},MA={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},EA={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},RA={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},DA={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},$A={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},LA={ordinalNumber:SA({matchPattern:_A,parsePattern:CA,valueCallback:i=>parseInt(i,10)}),era:tl({matchPatterns:PA,defaultMatchWidth:"wide",parsePatterns:AA,defaultParseWidth:"any"}),quarter:tl({matchPatterns:xA,defaultMatchWidth:"wide",parsePatterns:TA,defaultParseWidth:"any",valueCallback:i=>i+1}),month:tl({matchPatterns:QA,defaultMatchWidth:"wide",parsePatterns:MA,defaultParseWidth:"any"}),day:tl({matchPatterns:EA,defaultMatchWidth:"wide",parsePatterns:RA,defaultParseWidth:"any"}),dayPeriod:tl({matchPatterns:DA,defaultMatchWidth:"any",parsePatterns:$A,defaultParseWidth:"any"})},my={code:"en-US",formatDistance:oA,formatLong:uA,formatRelative:fA,localize:wA,match:LA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function IA(i){const e=_t(i);return zP(e,rA(e))+1}function NA(i){const e=_t(i),t=+au(e)-+VP(e);return Math.round(t/fy)+1}function py(i,e){var u,h,f,d;const t=_t(i),n=t.getFullYear(),r=Ta(),s=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(f=r.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,o=Yr(i,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const l=ta(o,e),a=Yr(i,0);a.setFullYear(n,0,s),a.setHours(0,0,0,0);const c=ta(a,e);return t.getTime()>=l.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function ZA(i,e){var l,a,c,u;const t=Ta(),n=(e==null?void 0:e.firstWeekContainsDate)??((a=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:a.firstWeekContainsDate)??t.firstWeekContainsDate??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,r=py(i,e),s=Yr(i,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),ta(s,e)}function BA(i,e){const t=_t(i),n=+ta(t,e)-+ZA(t,e);return Math.round(n/fy)+1}function vt(i,e){const t=i<0?"-":"",n=Math.abs(i).toString().padStart(e,"0");return t+n}const _r={y(i,e){const t=i.getFullYear(),n=t>0?t:1-t;return vt(e==="yy"?n%100:n,e.length)},M(i,e){const t=i.getMonth();return e==="M"?String(t+1):vt(t+1,2)},d(i,e){return vt(i.getDate(),e.length)},a(i,e){const t=i.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(i,e){return vt(i.getHours()%12||12,e.length)},H(i,e){return vt(i.getHours(),e.length)},m(i,e){return vt(i.getMinutes(),e.length)},s(i,e){return vt(i.getSeconds(),e.length)},S(i,e){const t=e.length,n=i.getMilliseconds(),r=Math.trunc(n*Math.pow(10,t-3));return vt(r,e.length)}},Vs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lg={G:function(i,e,t){const n=i.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(i,e,t){if(e==="yo"){const n=i.getFullYear(),r=n>0?n:1-n;return t.ordinalNumber(r,{unit:"year"})}return _r.y(i,e)},Y:function(i,e,t,n){const r=py(i,n),s=r>0?r:1-r;if(e==="YY"){const o=s%100;return vt(o,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):vt(s,e.length)},R:function(i,e){const t=dy(i);return vt(t,e.length)},u:function(i,e){const t=i.getFullYear();return vt(t,e.length)},Q:function(i,e,t){const n=Math.ceil((i.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return vt(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(i,e,t){const n=Math.ceil((i.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return vt(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(i,e,t){const n=i.getMonth();switch(e){case"M":case"MM":return _r.M(i,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(i,e,t){const n=i.getMonth();switch(e){case"L":return String(n+1);case"LL":return vt(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(i,e,t,n){const r=BA(i,n);return e==="wo"?t.ordinalNumber(r,{unit:"week"}):vt(r,e.length)},I:function(i,e,t){const n=NA(i);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):vt(n,e.length)},d:function(i,e,t){return e==="do"?t.ordinalNumber(i.getDate(),{unit:"date"}):_r.d(i,e)},D:function(i,e,t){const n=IA(i);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):vt(n,e.length)},E:function(i,e,t){const n=i.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(i,e,t,n){const r=i.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return vt(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(r,{width:"short",context:"formatting"});case"eeee":default:return t.day(r,{width:"wide",context:"formatting"})}},c:function(i,e,t,n){const r=i.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return vt(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(r,{width:"narrow",context:"standalone"});case"cccccc":return t.day(r,{width:"short",context:"standalone"});case"cccc":default:return t.day(r,{width:"wide",context:"standalone"})}},i:function(i,e,t){const n=i.getDay(),r=n===0?7:n;switch(e){case"i":return String(r);case"ii":return vt(r,e.length);case"io":return t.ordinalNumber(r,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(i,e,t){const r=i.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(i,e,t){const n=i.getHours();let r;switch(n===12?r=Vs.noon:n===0?r=Vs.midnight:r=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(i,e,t){const n=i.getHours();let r;switch(n>=17?r=Vs.evening:n>=12?r=Vs.afternoon:n>=4?r=Vs.morning:r=Vs.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(i,e,t){if(e==="ho"){let n=i.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return _r.h(i,e)},H:function(i,e,t){return e==="Ho"?t.ordinalNumber(i.getHours(),{unit:"hour"}):_r.H(i,e)},K:function(i,e,t){const n=i.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):vt(n,e.length)},k:function(i,e,t){let n=i.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):vt(n,e.length)},m:function(i,e,t){return e==="mo"?t.ordinalNumber(i.getMinutes(),{unit:"minute"}):_r.m(i,e)},s:function(i,e,t){return e==="so"?t.ordinalNumber(i.getSeconds(),{unit:"second"}):_r.s(i,e)},S:function(i,e){return _r.S(i,e)},X:function(i,e,t){const n=i.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return cg(n);case"XXXX":case"XX":return fs(n);case"XXXXX":case"XXX":default:return fs(n,":")}},x:function(i,e,t){const n=i.getTimezoneOffset();switch(e){case"x":return cg(n);case"xxxx":case"xx":return fs(n);case"xxxxx":case"xxx":default:return fs(n,":")}},O:function(i,e,t){const n=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ag(n,":");case"OOOO":default:return"GMT"+fs(n,":")}},z:function(i,e,t){const n=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ag(n,":");case"zzzz":default:return"GMT"+fs(n,":")}},t:function(i,e,t){const n=Math.trunc(i.getTime()/1e3);return vt(n,e.length)},T:function(i,e,t){const n=i.getTime();return vt(n,e.length)}};function ag(i,e=""){const t=i>0?"-":"+",n=Math.abs(i),r=Math.trunc(n/60),s=n%60;return s===0?t+String(r):t+String(r)+e+vt(s,2)}function cg(i,e){return i%60===0?(i>0?"-":"+")+vt(Math.abs(i)/60,2):fs(i,e)}function fs(i,e=""){const t=i>0?"-":"+",n=Math.abs(i),r=vt(Math.trunc(n/60),2),s=vt(n%60,2);return t+r+e+s}const ug=(i,e)=>{switch(i){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},gy=(i,e)=>{switch(i){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},WA=(i,e)=>{const t=i.match(/(P+)(p+)?/)||[],n=t[1],r=t[2];if(!r)return ug(i,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",ug(n,e)).replace("{{time}}",gy(r,e))},XA={p:gy,P:WA},FA=/^D+$/,YA=/^Y+$/,zA=["D","DD","YY","YYYY"];function VA(i){return FA.test(i)}function UA(i){return YA.test(i)}function jA(i,e,t){const n=qA(i,e,t);if(console.warn(n),zA.includes(i))throw new RangeError(n)}function qA(i,e,t){const n=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,HA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,KA=/^'([^]*?)'?$/,JA=/''/g,ex=/[a-zA-Z]/;function Oy(i,e,t){var u,h,f,d;const n=Ta(),r=n.locale??my,s=n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,l=_t(i);if(!qP(l))throw new RangeError("Invalid time value");let a=e.match(HA).map(m=>{const p=m[0];if(p==="p"||p==="P"){const g=XA[p];return g(m,r.formatLong)}return m}).join("").match(GA).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:tx(m)};if(lg[p])return{isToken:!0,value:m};if(p.match(ex))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});r.localize.preprocessor&&(a=r.localize.preprocessor(l,a));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:r};return a.map(m=>{if(!m.isToken)return m.value;const p=m.value;(UA(p)||VA(p))&&jA(p,e,String(i));const g=lg[p[0]];return g(l,p,r.localize,c)}).join("")}function tx(i){const e=i.match(KA);return e?e[1].replace(JA,"'"):i}function nx(i,e,t){const n=Ta(),r=(t==null?void 0:t.locale)??n.locale??my,s=2520,o=Ic(i,e);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let a,c;o>0?(a=_t(e),c=_t(i)):(a=_t(i),c=_t(e));const u=iA(c,a),h=(cu(c)-cu(a))/1e3,f=Math.round((u-h)/60);let d;if(f<2)return t!=null&&t.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,l):u<10?r.formatDistance("lessThanXSeconds",10,l):u<20?r.formatDistance("lessThanXSeconds",20,l):u<40?r.formatDistance("halfAMinute",0,l):u<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):f===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",f,l);if(f<45)return r.formatDistance("xMinutes",f,l);if(f<90)return r.formatDistance("aboutXHours",1,l);if(f{i&&!i.contains(t.target)&&!t.defaultPrevented&&i.dispatchEvent(new CustomEvent("click_outside",i))};return document.addEventListener("click",e,!0),{destroy(){document.removeEventListener("click",e,!0)}}}function Jn(i,e,t={}){return fetch(i,{...t,method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content,...t.headers}}).then(n=>n.json())}function Qa(i,e={}){return fetch(i,{...e,method:"GET",headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content,"X-Requested-With":"XMLHttpRequest",...e.headers}}).then(t=>t.json())}function na(i,e){let t=l=>typeof l=="object"&&!Array.isArray(l)&&l!==null,n=l=>(l==null?void 0:l.constructor)===Array,r=l=>l==null||l==[];const s=i??null,o=e??null;return t(s)?Object.keys(s).reduce((a,c)=>a===!1?!1:na(s==null?void 0:s[c],o==null?void 0:o[c]),!0):n(s)?s.reduce((l,a,c)=>l===!1?!1:na(a,o==null?void 0:o[c]),!0):!!(r(s)&&r(o)||s==o)}function rx(i,e){let t;return(...n)=>{clearTimeout(t),t=setTimeout(()=>i(...n),e)}}function dg(i,e){const t=new Set;return i.filter(n=>{const r=e(n);return t.has(r)?!1:(t.add(r),!0)})}function mg(i){let e,t,n,r,s;return{c(){e=y("div"),t=y("div"),t.textContent="Submission Errors",n=D(),r=y("div"),s=W(i[0]),O(t,"class","title"),O(r,"class","content"),O(e,"class","notice notice-error"),O(e,"role","alert")},m(o,l){A(o,e,l),v(e,t),v(e,n),v(e,r),v(r,s)},p(o,l){l&1&&K(s,o[0])},d(o){o&&P(e)}}}function sx(i){let e,t=i[0]&&mg(i);return{c(){t&&t.c(),e=De()},m(n,r){t&&t.m(n,r),A(n,e,r)},p(n,[r]){n[0]?t?t.p(n,r):(t=mg(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(n){n&&P(e),t&&t.d(n)}}}function ox(i,e,t){let{message:n=""}=e;return i.$$set=r=>{"message"in r&&t(0,n=r.message)},[n]}class Ma extends oe{constructor(e){super(),se(this,e,ox,sx,re,{message:0})}}function lx(i){let e,t,n,r;return{c(){e=y("button"),t=y("span"),n=D(),r=W(i[0]),O(t,"class","spinner-border spinner-border-sm"),O(t,"role","status"),O(t,"aria-hidden","true"),O(e,"type","submit"),O(e,"class","button secondary btn-spinner"),e.disabled=i[1]},m(s,o){A(s,e,o),v(e,t),v(e,n),v(e,r)},p(s,[o]){o&1&&K(r,s[0]),o&2&&(e.disabled=s[1])},i:U,o:U,d(s){s&&P(e)}}}function ax(i,e,t){let{label:n=""}=e,{disabled:r=!1}=e;return i.$$set=s=>{"label"in s&&t(0,n=s.label),"disabled"in s&&t(1,r=s.disabled)},[n,r]}class uu extends oe{constructor(e){super(),se(this,e,ax,lx,re,{label:0,disabled:1})}}function cx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S;return t=new Ma({props:{message:i[2]}}),g=new uu({props:{label:"Register"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),r=y("form"),s=y("div"),o=y("label"),o.textContent="Name",l=D(),a=y("input"),c=D(),u=y("div"),h=y("label"),h.textContent="Email address",f=D(),d=y("input"),m=D(),p=y("div"),V(g.$$.fragment),O(o,"for","name"),O(o,"class","form-label"),O(a,"type","text"),O(a,"class","form-control"),O(a,"id","name"),O(s,"class","mb-3"),O(h,"for","email"),O(h,"class","form-label"),O(d,"type","email"),O(d,"class","form-control"),O(d,"id","email"),O(u,"class","mb-3"),O(p,"class","text-center mt-5 d-block"),O(e,"class","wrapper-tiny")},m(_,k){A(_,e,k),Y(t,e,null),v(e,n),v(e,r),v(r,s),v(s,o),v(s,l),v(s,a),Ie(a,i[1]),v(r,c),v(r,u),v(u,h),v(u,f),v(u,d),Ie(d,i[0]),v(r,m),v(r,p),Y(g,p,null),b=!0,w||(S=[G(a,"input",i[4]),G(d,"input",i[5]),G(r,"submit",i[3])],w=!0)},p(_,[k]){const Q={};k&4&&(Q.message=_[2]),t.$set(Q),k&2&&a.value!==_[1]&&Ie(a,_[1]),k&1&&d.value!==_[0]&&Ie(d,_[0])},i(_){b||(T(t.$$.fragment,_),T(g.$$.fragment,_),b=!0)},o(_){R(t.$$.fragment,_),R(g.$$.fragment,_),b=!1},d(_){_&&P(e),z(t),z(g),w=!1,ut(S)}}}function ux(i,e,t){const n=je("channel");let r="",{email:s=""}=e,o="";function l(u){u.preventDefault(),t(2,o=""),Jn(n.lucentUrl+"/register",{name:r,email:s}).then(()=>{window.location=n.lucentUrl+"/login"}).catch(h=>{var f;t(2,o=(f=h.response)==null?void 0:f.data.error),console.log({errorMessage:o})})}function a(){r=this.value,t(1,r)}function c(){s=this.value,t(0,s)}return i.$$set=u=>{"email"in u&&t(0,s=u.email)},[s,r,o,l,a,c]}class hx extends oe{constructor(e){super(),se(this,e,ux,cx,re,{email:0})}}function fx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g;return{c(){e=y("div"),t=y("h2"),t.textContent="Enter Lucent",n=D(),r=y("form"),s=y("p"),s.innerHTML="Submit your email address and you will receive a login link to your email",o=D(),l=y("p"),l.textContent="Don't forget to check your spam folder",a=D(),c=y("div"),u=y("label"),u.textContent="Email address",h=D(),f=y("input"),d=D(),m=y("button"),m.innerHTML=`Send email - indicator`,O(t,"class","mb-5"),O(u,"for","emailaddress"),O(u,"class","form-label"),O(f,"type","email"),O(f,"class","form-control"),O(f,"id","emailaddress"),f.required=!0,O(c,"class","mt-5 mb-3"),O(m,"class","bt bt-primary"),O(e,"class","form")},m(b,w){A(b,e,w),v(e,t),v(e,n),v(e,r),v(r,s),v(r,o),v(r,l),v(r,a),v(r,c),v(c,u),v(c,h),v(c,f),Ie(f,i[0]),v(r,d),v(r,m),p||(g=[G(f,"input",i[3]),G(r,"submit",i[2])],p=!0)},p(b,w){w&1&&f.value!==b[0]&&Ie(f,b[0])},d(b){b&&P(e),p=!1,ut(g)}}}function dx(i){let e,t,n,r,s,o,l,a;return{c(){e=y("div"),t=y("p"),n=W("You will receive an email with a login link at "),r=y("b"),s=W(i[0]),o=W("."),l=D(),a=y("p"),a.textContent="Check your spam folder",O(e,"class","alert alert-info"),O(e,"role","alert")},m(c,u){A(c,e,u),v(e,t),v(t,n),v(t,r),v(r,s),v(t,o),v(e,l),v(e,a)},p(c,u){u&1&&K(s,c[0])},d(c){c&&P(e)}}}function mx(i){let e,t,n,r;function s(a,c){return a[1]?dx:fx}let o=s(i),l=o(i);return{c(){e=y("div"),t=y("div"),n=D(),r=y("div"),l.c(),O(t,"class","bg-image"),O(r,"class","login-form"),O(e,"class","scope-login")},m(a,c){A(a,e,c),v(e,t),v(e,n),v(e,r),l.m(r,null)},p(a,[c]){o===(o=s(a))&&l?l.p(a,c):(l.d(1),l=o(a),l&&(l.c(),l.m(r,null)))},i:U,o:U,d(a){a&&P(e),l.d()}}}function px(i,e,t){const n=je("channel");let r="",s=!1;function o(a){a.preventDefault(),Jn(n.lucentUrl+"/login",{email:r}).then(()=>{t(1,s=!0)}).catch(()=>{})}function l(){r=this.value,t(0,r)}return[r,s,o,l]}class gx extends oe{constructor(e){super(),se(this,e,px,mx,re,{})}}function Ox(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w;return{c(){e=y("div"),t=y("div"),n=D(),r=y("div"),s=y("div"),o=y("h2"),o.textContent="Welcome to Lucent",l=D(),a=y("form"),c=y("button"),u=W("Enter as "),h=W(i[0]),f=D(),d=y("img"),p=D(),g=y("div"),O(t,"class","bg-image"),O(o,"class","mb-5"),O(d,"alt","indicator"),O(d,"id","indicator"),O(d,"class","htmx-indicator"),ad(d.src,m="/img/spinner.svg")||O(d,"src",m),O(c,"class","bt bt-primary"),O(g,"class","form-errors"),O(s,"class","form"),O(r,"class","login-form"),O(e,"class","scope-login")},m(S,_){A(S,e,_),v(e,t),v(e,n),v(e,r),v(r,s),v(s,o),v(s,l),v(s,a),v(a,c),v(c,u),v(c,h),v(c,f),v(c,d),v(s,p),v(s,g),b||(w=G(a,"submit",i[1]),b=!0)},p(S,[_]){_&1&&K(h,S[0])},i:U,o:U,d(S){S&&P(e),b=!1,w()}}}function bx(i,e,t){const n=je("channel");let{email:r}=e,{token:s}=e;function o(l){l.preventDefault(),Jn(n.lucentUrl+"/verify",{email:r,token:s}).then(a=>{window.location=n.lucentUrl}).catch(a=>{})}return i.$$set=l=>{"email"in l&&t(0,r=l.email),"token"in l&&t(2,s=l.token)},[r,o,s]}class vx extends oe{constructor(e){super(),se(this,e,bx,Ox,re,{email:0,token:2})}}function wx(i){let e,t,n;return{c(){e=y("div"),t=y("div"),n=W(i[2]),O(t,"class","avatar__letters"),O(e,"class","avatar"),O(e,"title",i[0]),fe(e,"background-color",i[3][i[4]]),fe(e,"height",i[1]+"px"),fe(e,"width",i[1]+"px"),fe(e,"font-size",i[1]/2+"px")},m(r,s){A(r,e,s),v(e,t),v(t,n)},p(r,[s]){s&4&&K(n,r[2]),s&1&&O(e,"title",r[0]),s&2&&fe(e,"height",r[1]+"px"),s&2&&fe(e,"width",r[1]+"px"),s&2&&fe(e,"font-size",r[1]/2+"px")},i:U,o:U,d(r){r&&P(e)}}}function yx(i,e,t){let{name:n}=e,{side:r=48}=e;const s=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let o="";n.split(" ").length>1?o=n.split(" ")[0].charAt(0).toUpperCase()+n.split(" ")[1].charAt(0).toUpperCase():o=n.split(" ")[0].charAt(0).toUpperCase()+n.split(" ")[0].charAt(1).toUpperCase();let a=(n.charCodeAt(1)+n.length)%19;return i.$$set=c=>{"name"in c&&t(0,n=c.name),"side"in c&&t(1,r=c.side)},[n,r,o,s,a]}class Ci extends oe{constructor(e){super(),se(this,e,yx,wx,re,{name:0,side:1})}}function kx(i){const e=i-1;return e*e*e+1}function hu(i,{delay:e=0,duration:t=400,easing:n=kx,x:r=0,y:s=0,opacity:o=0}={}){const l=getComputedStyle(i),a=+l.opacity,c=l.transform==="none"?"":l.transform,u=a*(1-o),[h,f]=ng(r),[d,m]=ng(s);return{delay:e,duration:t,easing:n,css:(p,g)=>` +}`,h=`__svelte_${SP(u)}_${l}`,f=jw(i),{stylesheet:d,rules:m}=su.get(f)||_P(f,i);m[h]||(m[h]=!0,d.insertRule(`@keyframes ${h} ${u}`,d.cssRules.length));const p=i.style.animation||"";return i.style.animation=`${p?`${p}, `:""}${h} ${n}ms linear ${r}ms 1 both`,ou+=1,h}function CP(i,e){const t=(i.style.animation||"").split(", "),n=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),r=t.length-n.length;r&&(i.style.animation=n.join(", "),ou-=r,ou||PP())}function PP(){Xm(()=>{ou||(su.forEach(i=>{const{ownerNode:e}=i.stylesheet;e&&P(e)}),su.clear())})}let ta;function Tl(i){ta=i}function Bo(){if(!ta)throw new Error("Function called outside component initialization");return ta}function xi(i){Bo().$$.on_mount.push(i)}function Kw(i){Bo().$$.after_update.push(i)}function Jw(i){Bo().$$.on_destroy.push(i)}function nn(){const i=Bo();return(e,t,{cancelable:n=!1}={})=>{const r=i.$$.callbacks[e];if(r){const s=Hw(e,t,{cancelable:n});return r.slice().forEach(o=>{o.call(i,s)}),!s.defaultPrevented}return!0}}function Ql(i,e){return Bo().$$.context.set(i,e),e}function Ue(i){return Bo().$$.context.get(i)}function vs(i,e){const t=i.$$.callbacks[e.type];t&&t.slice().forEach(n=>n.call(this,e))}const Hs=[],Ce=[];let ao=[];const cd=[],AP=Promise.resolve();let ud=!1;function xP(){ud||(ud=!0,AP.then(ey))}function As(i){ao.push(i)}function st(i){cd.push(i)}const Mh=new Set;let Vs=0;function ey(){if(Vs!==0)return;const i=ta;do{try{for(;Vsi.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),ao=e}let el;function MP(){return el||(el=Promise.resolve(),el.then(()=>{el=null})),el}function Eh(i,e,t){i.dispatchEvent(Hw(`${e?"intro":"outro"}${t}`))}const Lc=new Set;let sr;function Oe(){sr={r:0,c:[],p:sr}}function be(){sr.r||ht(sr.c),sr=sr.p}function T(i,e){i&&i.i&&(Lc.delete(i),i.i(e))}function R(i,e,t,n){if(i&&i.o){if(Lc.has(i))return;Lc.add(i),sr.c.push(()=>{Lc.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}const EP={duration:0};function lu(i,e,t,n){let s=e(i,t,{direction:"both"}),o=n?0:1,l=null,a=null,c=null,u;function h(){c&&CP(i,c)}function f(m,p){const g=m.b-o;return p*=Math.abs(g),{a:o,b:m.b,d:g,duration:p,start:m.start,end:m.start+p,group:m.group}}function d(m){const{delay:p=0,duration:g=300,easing:v=fP,tick:w=U,css:S}=s||EP,_={start:pP()+p,b:m};m||(_.group=sr,sr.r+=1),"inert"in i&&(m?u!==void 0&&(i.inert=u):(u=i.inert,i.inert=!0)),l||a?a=_:(S&&(h(),c=ng(i,o,m,g,p,v,S)),m&&w(0,1),l=f(_,g),As(()=>Eh(i,m,"start")),gP(k=>{if(a&&k>a.start&&(l=f(a,g),a=null,Eh(i,l.b,"start"),S&&(h(),c=ng(i,o,l.b,l.duration,0,v,s.css))),l){if(k>=l.end)w(o=l.b,1-o),Eh(i,l.b,"end"),a||(l.b?h():--l.group.r||ht(l.group.c)),l=null;else if(k>=l.start){const A=k-l.start;o=l.a+l.d*v(A/l.duration),w(o,1-o)}}return!!(l||a)}))}return{run(m){nh(s)?MP().then(()=>{s=s({direction:m?"in":"out"}),d(m)}):d(m)},end(){h(),l=a=null}}}function fe(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Fm(i,e){i.d(1),e.delete(i.key)}function Jr(i,e){R(i,1,1,()=>{e.delete(i.key)})}function Ti(i,e,t,n,r,s,o,l,a,c,u,h){let f=i.length,d=s.length,m=f;const p={};for(;m--;)p[i[m].key]=m;const g=[],v=new Map,w=new Map,S=[];for(m=d;m--;){const C=h(r,s,m),Q=t(C);let M=o.get(Q);M?S.push(()=>M.p(C,e)):(M=c(Q,C),M.c()),v.set(Q,g[m]=M),Q in p&&w.set(Q,Math.abs(m-p[Q]))}const _=new Set,k=new Set;function A(C){T(C,1),C.m(l,u),o.set(C.key,C),u=C.first,d--}for(;f&&d;){const C=g[d-1],Q=i[f-1],M=C.key,L=Q.key;C===Q?(u=C.first,f--,d--):v.has(L)?!o.has(M)||_.has(M)?A(C):k.has(L)?f--:w.get(M)>w.get(L)?(k.add(M),A(C)):(_.add(L),f--):(a(Q,o),f--)}for(;f--;){const C=i[f];v.has(C.key)||a(C,o)}for(;d;)A(g[d-1]);return ht(S),g}function _o(i,e){const t={},n={},r={$$scope:1};let s=i.length;for(;s--;){const o=i[s],l=e[s];if(l){for(const a in o)a in l||(n[a]=1);for(const a in l)r[a]||(t[a]=l[a],r[a]=1);i[s]=l}else for(const a in o)r[a]=1}for(const o in n)o in t||(t[o]=void 0);return t}function Co(i){return typeof i=="object"&&i!==null?i:{}}function nt(i,e,t){const n=i.$$.props[e];n!==void 0&&(i.$$.bound[n]=t,t(i.$$.ctx[n]))}function V(i){i&&i.c()}function Y(i,e,t){const{fragment:n,after_update:r}=i.$$;n&&n.m(e,t),As(()=>{const s=i.$$.on_mount.map(Yw).filter(nh);i.$$.on_destroy?i.$$.on_destroy.push(...s):ht(s),i.$$.on_mount=[]}),r.forEach(As)}function z(i,e){const t=i.$$;t.fragment!==null&&(QP(t.after_update),ht(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function RP(i,e){i.$$.dirty[0]===-1&&(Hs.push(i),xP(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<{const m=d.length?d[0]:f;return c.ctx&&r(c.ctx[h],c.ctx[h]=m)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](m),u&&RP(i,h)),f}):[],c.update(),u=!0,ht(c.before_update),c.fragment=n?n(c.ctx):!1,e.target){if(e.hydrate){const h=yP(e.target);c.fragment&&c.fragment.l(h),h.forEach(P)}else c.fragment&&c.fragment.c();e.intro&&T(i.$$.fragment),Y(i,e.target,e.anchor),ey()}Tl(a)}class oe{constructor(){Qh(this,"$$");Qh(this,"$$set")}$destroy(){z(this,1),this.$destroy=U}$on(e,t){if(!nh(t))return U;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)}}$set(e){this.$$set&&!dP(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const DP="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(DP);function _t(i){const e=Object.prototype.toString.call(i);return i instanceof Date||typeof i=="object"&&e==="[object Date]"?new i.constructor(+i):typeof i=="number"||e==="[object Number]"||typeof i=="string"||e==="[object String]"?new Date(i):new Date(NaN)}function Fr(i,e){return i instanceof Date?new i.constructor(e):new Date(e)}const ty=6048e5,$P=864e5,Ga=43200,ig=1440;let LP={};function Ta(){return LP}function na(i,e){var l,a,c,u;const t=Ta(),n=(e==null?void 0:e.weekStartsOn)??((a=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:a.weekStartsOn)??t.weekStartsOn??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,r=_t(i),s=r.getDay(),o=(s=r.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function rg(i){const e=_t(i);return e.setHours(0,0,0,0),e}function cu(i){const e=_t(i),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+i-+t}function IP(i,e){const t=rg(i),n=rg(e),r=+t-cu(t),s=+n-cu(n);return Math.round((r-s)/$P)}function NP(i){const e=ny(i),t=Fr(i,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),au(t)}function Ic(i,e){const t=_t(i),n=_t(e),r=t.getTime()-n.getTime();return r<0?-1:r>0?1:r}function ZP(i){return Fr(i,Date.now())}function BP(i){return i instanceof Date||typeof i=="object"&&Object.prototype.toString.call(i)==="[object Date]"}function WP(i){if(!BP(i)&&typeof i!="number")return!1;const e=_t(i);return!isNaN(Number(e))}function XP(i,e){const t=_t(i),n=_t(e),r=t.getFullYear()-n.getFullYear(),s=t.getMonth()-n.getMonth();return r*12+s}function FP(i){return e=>{const n=(i?Math[i]:Math.trunc)(e);return n===0?0:n}}function YP(i,e){return+_t(i)-+_t(e)}function zP(i){const e=_t(i);return e.setHours(23,59,59,999),e}function VP(i){const e=_t(i),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function UP(i){const e=_t(i);return+zP(e)==+VP(e)}function jP(i,e){const t=_t(i),n=_t(e),r=Ic(t,n),s=Math.abs(XP(t,n));let o;if(s<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-r*s);let l=Ic(t,n)===-r;UP(_t(i))&&s===1&&Ic(i,n)===1&&(l=!1),o=r*(s-Number(l))}return o===0?0:o}function qP(i,e,t){const n=YP(i,e)/1e3;return FP(t==null?void 0:t.roundingMethod)(n)}function GP(i){const e=_t(i),t=Fr(i,0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}const HP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},KP=(i,e,t)=>{let n;const r=HP[i];return typeof r=="string"?n=r:e===1?n=r.one:n=r.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function Rh(i){return(e={})=>{const t=e.width?String(e.width):i.defaultWidth;return i.formats[t]||i.formats[i.defaultWidth]}}const JP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eA={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},tA={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nA={date:Rh({formats:JP,defaultWidth:"full"}),time:Rh({formats:eA,defaultWidth:"full"}),dateTime:Rh({formats:tA,defaultWidth:"full"})},iA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rA=(i,e,t,n)=>iA[i];function tl(i){return(e,t)=>{const n=t!=null&&t.context?String(t.context):"standalone";let r;if(n==="formatting"&&i.formattingValues){const o=i.defaultFormattingWidth||i.defaultWidth,l=t!=null&&t.width?String(t.width):o;r=i.formattingValues[l]||i.formattingValues[o]}else{const o=i.defaultWidth,l=t!=null&&t.width?String(t.width):i.defaultWidth;r=i.values[l]||i.values[o]}const s=i.argumentCallback?i.argumentCallback(e):e;return r[s]}}const sA={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},oA={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lA={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},aA={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},cA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},uA={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hA=(i,e)=>{const t=Number(i),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},fA={ordinalNumber:hA,era:tl({values:sA,defaultWidth:"wide"}),quarter:tl({values:oA,defaultWidth:"wide",argumentCallback:i=>i-1}),month:tl({values:lA,defaultWidth:"wide"}),day:tl({values:aA,defaultWidth:"wide"}),dayPeriod:tl({values:cA,defaultWidth:"wide",formattingValues:uA,defaultFormattingWidth:"wide"})};function nl(i){return(e,t={})=>{const n=t.width,r=n&&i.matchPatterns[n]||i.matchPatterns[i.defaultMatchWidth],s=e.match(r);if(!s)return null;const o=s[0],l=n&&i.parsePatterns[n]||i.parsePatterns[i.defaultParseWidth],a=Array.isArray(l)?mA(l,h=>h.test(o)):dA(l,h=>h.test(o));let c;c=i.valueCallback?i.valueCallback(a):a,c=t.valueCallback?t.valueCallback(c):c;const u=e.slice(o.length);return{value:c,rest:u}}}function dA(i,e){for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&e(i[t]))return t}function mA(i,e){for(let t=0;t{const n=e.match(i.matchPattern);if(!n)return null;const r=n[0],s=e.match(i.parsePattern);if(!s)return null;let o=i.valueCallback?i.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const l=e.slice(r.length);return{value:o,rest:l}}}const gA=/^(\d+)(th|st|nd|rd)?/i,OA=/\d+/i,bA={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},vA={any:[/^b/i,/^(a|c)/i]},wA={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yA={any:[/1/i,/2/i,/3/i,/4/i]},kA={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},SA={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},_A={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},CA={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},PA={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},AA={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xA={ordinalNumber:pA({matchPattern:gA,parsePattern:OA,valueCallback:i=>parseInt(i,10)}),era:nl({matchPatterns:bA,defaultMatchWidth:"wide",parsePatterns:vA,defaultParseWidth:"any"}),quarter:nl({matchPatterns:wA,defaultMatchWidth:"wide",parsePatterns:yA,defaultParseWidth:"any",valueCallback:i=>i+1}),month:nl({matchPatterns:kA,defaultMatchWidth:"wide",parsePatterns:SA,defaultParseWidth:"any"}),day:nl({matchPatterns:_A,defaultMatchWidth:"wide",parsePatterns:CA,defaultParseWidth:"any"}),dayPeriod:nl({matchPatterns:PA,defaultMatchWidth:"any",parsePatterns:AA,defaultParseWidth:"any"})},iy={code:"en-US",formatDistance:KP,formatLong:nA,formatRelative:rA,localize:fA,match:xA,options:{weekStartsOn:0,firstWeekContainsDate:1}};function TA(i){const e=_t(i);return IP(e,GP(e))+1}function QA(i){const e=_t(i),t=+au(e)-+NP(e);return Math.round(t/ty)+1}function ry(i,e){var u,h,f,d;const t=_t(i),n=t.getFullYear(),r=Ta(),s=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(f=r.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,o=Fr(i,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const l=na(o,e),a=Fr(i,0);a.setFullYear(n,0,s),a.setHours(0,0,0,0);const c=na(a,e);return t.getTime()>=l.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function MA(i,e){var l,a,c,u;const t=Ta(),n=(e==null?void 0:e.firstWeekContainsDate)??((a=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:a.firstWeekContainsDate)??t.firstWeekContainsDate??((u=(c=t.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,r=ry(i,e),s=Fr(i,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),na(s,e)}function EA(i,e){const t=_t(i),n=+na(t,e)-+MA(t,e);return Math.round(n/ty)+1}function vt(i,e){const t=i<0?"-":"",n=Math.abs(i).toString().padStart(e,"0");return t+n}const _r={y(i,e){const t=i.getFullYear(),n=t>0?t:1-t;return vt(e==="yy"?n%100:n,e.length)},M(i,e){const t=i.getMonth();return e==="M"?String(t+1):vt(t+1,2)},d(i,e){return vt(i.getDate(),e.length)},a(i,e){const t=i.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(i,e){return vt(i.getHours()%12||12,e.length)},H(i,e){return vt(i.getHours(),e.length)},m(i,e){return vt(i.getMinutes(),e.length)},s(i,e){return vt(i.getSeconds(),e.length)},S(i,e){const t=e.length,n=i.getMilliseconds(),r=Math.trunc(n*Math.pow(10,t-3));return vt(r,e.length)}},Us={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sg={G:function(i,e,t){const n=i.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(i,e,t){if(e==="yo"){const n=i.getFullYear(),r=n>0?n:1-n;return t.ordinalNumber(r,{unit:"year"})}return _r.y(i,e)},Y:function(i,e,t,n){const r=ry(i,n),s=r>0?r:1-r;if(e==="YY"){const o=s%100;return vt(o,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):vt(s,e.length)},R:function(i,e){const t=ny(i);return vt(t,e.length)},u:function(i,e){const t=i.getFullYear();return vt(t,e.length)},Q:function(i,e,t){const n=Math.ceil((i.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return vt(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(i,e,t){const n=Math.ceil((i.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return vt(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(i,e,t){const n=i.getMonth();switch(e){case"M":case"MM":return _r.M(i,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(i,e,t){const n=i.getMonth();switch(e){case"L":return String(n+1);case"LL":return vt(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(i,e,t,n){const r=EA(i,n);return e==="wo"?t.ordinalNumber(r,{unit:"week"}):vt(r,e.length)},I:function(i,e,t){const n=QA(i);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):vt(n,e.length)},d:function(i,e,t){return e==="do"?t.ordinalNumber(i.getDate(),{unit:"date"}):_r.d(i,e)},D:function(i,e,t){const n=TA(i);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):vt(n,e.length)},E:function(i,e,t){const n=i.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(i,e,t,n){const r=i.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return vt(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(r,{width:"short",context:"formatting"});case"eeee":default:return t.day(r,{width:"wide",context:"formatting"})}},c:function(i,e,t,n){const r=i.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return vt(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(r,{width:"narrow",context:"standalone"});case"cccccc":return t.day(r,{width:"short",context:"standalone"});case"cccc":default:return t.day(r,{width:"wide",context:"standalone"})}},i:function(i,e,t){const n=i.getDay(),r=n===0?7:n;switch(e){case"i":return String(r);case"ii":return vt(r,e.length);case"io":return t.ordinalNumber(r,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(i,e,t){const r=i.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(i,e,t){const n=i.getHours();let r;switch(n===12?r=Us.noon:n===0?r=Us.midnight:r=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(i,e,t){const n=i.getHours();let r;switch(n>=17?r=Us.evening:n>=12?r=Us.afternoon:n>=4?r=Us.morning:r=Us.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(i,e,t){if(e==="ho"){let n=i.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return _r.h(i,e)},H:function(i,e,t){return e==="Ho"?t.ordinalNumber(i.getHours(),{unit:"hour"}):_r.H(i,e)},K:function(i,e,t){const n=i.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):vt(n,e.length)},k:function(i,e,t){let n=i.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):vt(n,e.length)},m:function(i,e,t){return e==="mo"?t.ordinalNumber(i.getMinutes(),{unit:"minute"}):_r.m(i,e)},s:function(i,e,t){return e==="so"?t.ordinalNumber(i.getSeconds(),{unit:"second"}):_r.s(i,e)},S:function(i,e){return _r.S(i,e)},X:function(i,e,t){const n=i.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return lg(n);case"XXXX":case"XX":return fs(n);case"XXXXX":case"XXX":default:return fs(n,":")}},x:function(i,e,t){const n=i.getTimezoneOffset();switch(e){case"x":return lg(n);case"xxxx":case"xx":return fs(n);case"xxxxx":case"xxx":default:return fs(n,":")}},O:function(i,e,t){const n=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+og(n,":");case"OOOO":default:return"GMT"+fs(n,":")}},z:function(i,e,t){const n=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+og(n,":");case"zzzz":default:return"GMT"+fs(n,":")}},t:function(i,e,t){const n=Math.trunc(i.getTime()/1e3);return vt(n,e.length)},T:function(i,e,t){const n=i.getTime();return vt(n,e.length)}};function og(i,e=""){const t=i>0?"-":"+",n=Math.abs(i),r=Math.trunc(n/60),s=n%60;return s===0?t+String(r):t+String(r)+e+vt(s,2)}function lg(i,e){return i%60===0?(i>0?"-":"+")+vt(Math.abs(i)/60,2):fs(i,e)}function fs(i,e=""){const t=i>0?"-":"+",n=Math.abs(i),r=vt(Math.trunc(n/60),2),s=vt(n%60,2);return t+r+e+s}const ag=(i,e)=>{switch(i){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},sy=(i,e)=>{switch(i){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},RA=(i,e)=>{const t=i.match(/(P+)(p+)?/)||[],n=t[1],r=t[2];if(!r)return ag(i,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",ag(n,e)).replace("{{time}}",sy(r,e))},DA={p:sy,P:RA},$A=/^D+$/,LA=/^Y+$/,IA=["D","DD","YY","YYYY"];function NA(i){return $A.test(i)}function ZA(i){return LA.test(i)}function BA(i,e,t){const n=WA(i,e,t);if(console.warn(n),IA.includes(i))throw new RangeError(n)}function WA(i,e,t){const n=i[0]==="Y"?"years":"days of the month";return`Use \`${i.toLowerCase()}\` instead of \`${i}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const XA=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FA=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,YA=/^'([^]*?)'?$/,zA=/''/g,VA=/[a-zA-Z]/;function oy(i,e,t){var u,h,f,d;const n=Ta(),r=n.locale??iy,s=n.firstWeekContainsDate??((h=(u=n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((d=(f=n.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,l=_t(i);if(!WP(l))throw new RangeError("Invalid time value");let a=e.match(FA).map(m=>{const p=m[0];if(p==="p"||p==="P"){const g=DA[p];return g(m,r.formatLong)}return m}).join("").match(XA).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const p=m[0];if(p==="'")return{isToken:!1,value:UA(m)};if(sg[p])return{isToken:!0,value:m};if(p.match(VA))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:m}});r.localize.preprocessor&&(a=r.localize.preprocessor(l,a));const c={firstWeekContainsDate:s,weekStartsOn:o,locale:r};return a.map(m=>{if(!m.isToken)return m.value;const p=m.value;(ZA(p)||NA(p))&&BA(p,e,String(i));const g=sg[p[0]];return g(l,p,r.localize,c)}).join("")}function UA(i){const e=i.match(YA);return e?e[1].replace(zA,"'"):i}function jA(i,e,t){const n=Ta(),r=(t==null?void 0:t.locale)??n.locale??iy,s=2520,o=Ic(i,e);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let a,c;o>0?(a=_t(e),c=_t(i)):(a=_t(i),c=_t(e));const u=qP(c,a),h=(cu(c)-cu(a))/1e3,f=Math.round((u-h)/60);let d;if(f<2)return t!=null&&t.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,l):u<10?r.formatDistance("lessThanXSeconds",10,l):u<20?r.formatDistance("lessThanXSeconds",20,l):u<40?r.formatDistance("halfAMinute",0,l):u<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):f===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",f,l);if(f<45)return r.formatDistance("xMinutes",f,l);if(f<90)return r.formatDistance("aboutXHours",1,l);if(f{i&&!i.contains(t.target)&&!t.defaultPrevented&&i.dispatchEvent(new CustomEvent("click_outside",i))};return document.addEventListener("click",e,!0),{destroy(){document.removeEventListener("click",e,!0)}}}function Jn(i,e,t={}){return fetch(i,{...t,method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content,...t.headers}}).then(n=>n.json())}function Qa(i,e={}){return fetch(i,{...e,method:"GET",headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content,"X-Requested-With":"XMLHttpRequest",...e.headers}}).then(t=>t.json())}function ia(i,e){let t=l=>typeof l=="object"&&!Array.isArray(l)&&l!==null,n=l=>(l==null?void 0:l.constructor)===Array,r=l=>l==null;const s=i??null,o=e??null;return t(s)?Object.keys(s).reduce((a,c)=>a===!1?!1:ia(s==null?void 0:s[c],o==null?void 0:o[c]),!0):n(s)?!n(o)||s.length!==o.length?!1:s.reduce((l,a,c)=>l===!1?!1:ia(a,o[c]),!0):!!(r(s)&&r(o)||s==o)}function GA(i,e){let t;return(...n)=>{clearTimeout(t),t=setTimeout(()=>i(...n),e)}}function hg(i,e){const t=new Set;return i.filter(n=>{const r=e(n);return t.has(r)?!1:(t.add(r),!0)})}function fg(i){let e,t,n,r,s;return{c(){e=y("div"),t=y("div"),t.textContent="Submission Errors",n=D(),r=y("div"),s=W(i[0]),O(t,"class","title"),O(r,"class","content"),O(e,"class","notice notice-error"),O(e,"role","alert")},m(o,l){x(o,e,l),b(e,t),b(e,n),b(e,r),b(r,s)},p(o,l){l&1&&K(s,o[0])},d(o){o&&P(e)}}}function HA(i){let e,t=i[0]&&fg(i);return{c(){t&&t.c(),e=Ie()},m(n,r){t&&t.m(n,r),x(n,e,r)},p(n,[r]){n[0]?t?t.p(n,r):(t=fg(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(n){n&&P(e),t&&t.d(n)}}}function KA(i,e,t){let{message:n=""}=e;return i.$$set=r=>{"message"in r&&t(0,n=r.message)},[n]}class Ma extends oe{constructor(e){super(),se(this,e,KA,HA,re,{message:0})}}function JA(i){let e,t,n,r;return{c(){e=y("button"),t=y("span"),n=D(),r=W(i[0]),O(t,"class","spinner-border spinner-border-sm"),O(t,"role","status"),O(t,"aria-hidden","true"),O(e,"type","submit"),O(e,"class","button secondary btn-spinner"),e.disabled=i[1]},m(s,o){x(s,e,o),b(e,t),b(e,n),b(e,r)},p(s,[o]){o&1&&K(r,s[0]),o&2&&(e.disabled=s[1])},i:U,o:U,d(s){s&&P(e)}}}function ex(i,e,t){let{label:n=""}=e,{disabled:r=!1}=e;return i.$$set=s=>{"label"in s&&t(0,n=s.label),"disabled"in s&&t(1,r=s.disabled)},[n,r]}class uu extends oe{constructor(e){super(),se(this,e,ex,JA,re,{label:0,disabled:1})}}function tx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S;return t=new Ma({props:{message:i[2]}}),g=new uu({props:{label:"Register"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),r=y("form"),s=y("div"),o=y("label"),o.textContent="Name",l=D(),a=y("input"),c=D(),u=y("div"),h=y("label"),h.textContent="Email address",f=D(),d=y("input"),m=D(),p=y("div"),V(g.$$.fragment),O(o,"for","name"),O(o,"class","form-label"),O(a,"type","text"),O(a,"class","form-control"),O(a,"id","name"),O(s,"class","mb-3"),O(h,"for","email"),O(h,"class","form-label"),O(d,"type","email"),O(d,"class","form-control"),O(d,"id","email"),O(u,"class","mb-3"),O(p,"class","text-center mt-5 d-block"),O(e,"class","wrapper-tiny")},m(_,k){x(_,e,k),Y(t,e,null),b(e,n),b(e,r),b(r,s),b(s,o),b(s,l),b(s,a),Le(a,i[1]),b(r,c),b(r,u),b(u,h),b(u,f),b(u,d),Le(d,i[0]),b(r,m),b(r,p),Y(g,p,null),v=!0,w||(S=[G(a,"input",i[4]),G(d,"input",i[5]),G(r,"submit",i[3])],w=!0)},p(_,[k]){const A={};k&4&&(A.message=_[2]),t.$set(A),k&2&&a.value!==_[1]&&Le(a,_[1]),k&1&&d.value!==_[0]&&Le(d,_[0])},i(_){v||(T(t.$$.fragment,_),T(g.$$.fragment,_),v=!0)},o(_){R(t.$$.fragment,_),R(g.$$.fragment,_),v=!1},d(_){_&&P(e),z(t),z(g),w=!1,ht(S)}}}function nx(i,e,t){const n=Ue("channel");let r="",{email:s=""}=e,o="";function l(u){u.preventDefault(),t(2,o=""),Jn(n.lucentUrl+"/register",{name:r,email:s}).then(()=>{window.location=n.lucentUrl+"/login"}).catch(h=>{var f;t(2,o=(f=h.response)==null?void 0:f.data.error),console.log({errorMessage:o})})}function a(){r=this.value,t(1,r)}function c(){s=this.value,t(0,s)}return i.$$set=u=>{"email"in u&&t(0,s=u.email)},[s,r,o,l,a,c]}class ix extends oe{constructor(e){super(),se(this,e,nx,tx,re,{email:0})}}function rx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g;return{c(){e=y("div"),t=y("h2"),t.textContent="Enter Lucent",n=D(),r=y("form"),s=y("p"),s.innerHTML="Submit your email address and you will receive a login link to your email",o=D(),l=y("p"),l.textContent="Don't forget to check your spam folder",a=D(),c=y("div"),u=y("label"),u.textContent="Email address",h=D(),f=y("input"),d=D(),m=y("button"),m.innerHTML=`Send email + indicator`,O(t,"class","mb-5"),O(u,"for","emailaddress"),O(u,"class","form-label"),O(f,"type","email"),O(f,"class","form-control"),O(f,"id","emailaddress"),f.required=!0,O(c,"class","mt-5 mb-3"),O(m,"class","bt bt-primary"),O(e,"class","form")},m(v,w){x(v,e,w),b(e,t),b(e,n),b(e,r),b(r,s),b(r,o),b(r,l),b(r,a),b(r,c),b(c,u),b(c,h),b(c,f),Le(f,i[0]),b(r,d),b(r,m),p||(g=[G(f,"input",i[3]),G(r,"submit",i[2])],p=!0)},p(v,w){w&1&&f.value!==v[0]&&Le(f,v[0])},d(v){v&&P(e),p=!1,ht(g)}}}function sx(i){let e,t,n,r,s,o,l,a;return{c(){e=y("div"),t=y("p"),n=W("You will receive an email with a login link at "),r=y("b"),s=W(i[0]),o=W("."),l=D(),a=y("p"),a.textContent="Check your spam folder",O(e,"class","alert alert-info"),O(e,"role","alert")},m(c,u){x(c,e,u),b(e,t),b(t,n),b(t,r),b(r,s),b(t,o),b(e,l),b(e,a)},p(c,u){u&1&&K(s,c[0])},d(c){c&&P(e)}}}function ox(i){let e,t,n,r;function s(a,c){return a[1]?sx:rx}let o=s(i),l=o(i);return{c(){e=y("div"),t=y("div"),n=D(),r=y("div"),l.c(),O(t,"class","bg-image"),O(r,"class","login-form"),O(e,"class","scope-login")},m(a,c){x(a,e,c),b(e,t),b(e,n),b(e,r),l.m(r,null)},p(a,[c]){o===(o=s(a))&&l?l.p(a,c):(l.d(1),l=o(a),l&&(l.c(),l.m(r,null)))},i:U,o:U,d(a){a&&P(e),l.d()}}}function lx(i,e,t){const n=Ue("channel");let r="",s=!1;function o(a){a.preventDefault(),Jn(n.lucentUrl+"/login",{email:r}).then(()=>{t(1,s=!0)}).catch(()=>{})}function l(){r=this.value,t(0,r)}return[r,s,o,l]}class ax extends oe{constructor(e){super(),se(this,e,lx,ox,re,{})}}function cx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w;return{c(){e=y("div"),t=y("div"),n=D(),r=y("div"),s=y("div"),o=y("h2"),o.textContent="Welcome to Lucent",l=D(),a=y("form"),c=y("button"),u=W("Enter as "),h=W(i[0]),f=D(),d=y("img"),p=D(),g=y("div"),O(t,"class","bg-image"),O(o,"class","mb-5"),O(d,"alt","indicator"),O(d,"id","indicator"),O(d,"class","htmx-indicator"),ad(d.src,m="/img/spinner.svg")||O(d,"src",m),O(c,"class","bt bt-primary"),O(g,"class","form-errors"),O(s,"class","form"),O(r,"class","login-form"),O(e,"class","scope-login")},m(S,_){x(S,e,_),b(e,t),b(e,n),b(e,r),b(r,s),b(s,o),b(s,l),b(s,a),b(a,c),b(c,u),b(c,h),b(c,f),b(c,d),b(s,p),b(s,g),v||(w=G(a,"submit",i[1]),v=!0)},p(S,[_]){_&1&&K(h,S[0])},i:U,o:U,d(S){S&&P(e),v=!1,w()}}}function ux(i,e,t){const n=Ue("channel");let{email:r}=e,{token:s}=e;function o(l){l.preventDefault(),Jn(n.lucentUrl+"/verify",{email:r,token:s}).then(a=>{window.location=n.lucentUrl}).catch(a=>{})}return i.$$set=l=>{"email"in l&&t(0,r=l.email),"token"in l&&t(2,s=l.token)},[r,o,s]}class hx extends oe{constructor(e){super(),se(this,e,ux,cx,re,{email:0,token:2})}}function fx(i){let e,t,n;return{c(){e=y("div"),t=y("div"),n=W(i[2]),O(t,"class","avatar__letters"),O(e,"class","avatar"),O(e,"title",i[0]),le(e,"background-color",i[3][i[4]]),le(e,"height",i[1]+"px"),le(e,"width",i[1]+"px"),le(e,"font-size",i[1]/2+"px")},m(r,s){x(r,e,s),b(e,t),b(t,n)},p(r,[s]){s&4&&K(n,r[2]),s&1&&O(e,"title",r[0]),s&2&&le(e,"height",r[1]+"px"),s&2&&le(e,"width",r[1]+"px"),s&2&&le(e,"font-size",r[1]/2+"px")},i:U,o:U,d(r){r&&P(e)}}}function dx(i,e,t){let{name:n}=e,{side:r=48}=e;const s=["#00AA55","#009FD4","#B381B3","#939393","#E3BC00","#D47500","#DC2A2A","#3ede91","#377dd4","#0256b0","#053d82","#3d026e","#b378e3","#c4065c","#543208","#d97811","#0c6b40"];let o="";n.split(" ").length>1?o=n.split(" ")[0].charAt(0).toUpperCase()+n.split(" ")[1].charAt(0).toUpperCase():o=n.split(" ")[0].charAt(0).toUpperCase()+n.split(" ")[0].charAt(1).toUpperCase();let a=(n.charCodeAt(1)+n.length)%19;return i.$$set=c=>{"name"in c&&t(0,n=c.name),"side"in c&&t(1,r=c.side)},[n,r,o,s,a]}class _i extends oe{constructor(e){super(),se(this,e,dx,fx,re,{name:0,side:1})}}function mx(i){const e=i-1;return e*e*e+1}function hu(i,{delay:e=0,duration:t=400,easing:n=mx,x:r=0,y:s=0,opacity:o=0}={}){const l=getComputedStyle(i),a=+l.opacity,c=l.transform==="none"?"":l.transform,u=a*(1-o),[h,f]=eg(r),[d,m]=eg(s);return{delay:e,duration:t,easing:n,css:(p,g)=>` transform: ${c} translate(${(1-p)*h}${f}, ${(1-p)*d}${m}); - opacity: ${a-u*g}`}}function pg(i){let e,t,n,r,s,o,l;return{c(){e=y("div"),t=y("div"),t.textContent="Success",n=D(),r=y("div"),s=W(i[1]),O(t,"class","title"),O(r,"class","content"),O(e,"class","notice notice-success"),O(e,"role","alert")},m(a,c){A(a,e,c),v(e,t),v(e,n),v(e,r),v(r,s),l=!0},p(a,c){(!l||c&2)&&K(s,a[1])},i(a){l||(a&&Ps(()=>{l&&(o||(o=lu(e,hu,{duration:500},!0)),o.run(1))}),l=!0)},o(a){a&&(o||(o=lu(e,hu,{duration:500},!1)),o.run(0)),l=!1},d(a){a&&P(e),a&&o&&o.end()}}}function Sx(i){let e,t=i[0]&&pg(i);return{c(){t&&t.c(),e=De()},m(n,r){t&&t.m(n,r),A(n,e,r)},p(n,[r]){n[0]?t?(t.p(n,r),r&1&&T(t,1)):(t=pg(n),t.c(),T(t,1),t.m(e.parentNode,e)):t&&(me(),R(t,1,1,()=>{t=null}),pe())},i(n){T(t)},o(n){R(t)},d(n){n&&P(e),t&&t.d(n)}}}function _x(i,e,t){let n,r;function s(o="Saved"){t(1,n=o),t(0,r=!0),setTimeout(function(){t(0,r=!1)},2e3)}return t(1,n="Saved"),t(0,r=!1),[r,n,s]}class vy extends oe{constructor(e){super(),se(this,e,_x,Sx,re,{show:2})}get show(){return this.$$.ctx[2]}}function Cx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k,Q,x,C,M,$;t=new Ma({props:{message:i[2]}});let N={};return r=new vy({props:N}),i[8](r),l=new Ci({props:{name:i[4].name}}),d=new uu({props:{label:"Update Name"}}),S=new uu({props:{label:"Update Email"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),V(r.$$.fragment),s=D(),o=y("h3"),V(l.$$.fragment),a=D(),c=y("form"),u=y("div"),h=y("input"),f=D(),V(d.$$.fragment),m=D(),p=y("form"),g=y("div"),b=y("input"),w=D(),V(S.$$.fragment),_=D(),k=y("div"),Q=y("a"),x=W("Logout from this device"),O(o,"class","header-small mb-5"),O(h,"type","text"),O(h,"class","form-control mb-3"),O(h,"placeholder","Name"),h.required=!0,O(u,"class","input-group mb-5"),O(b,"type","email"),O(b,"class","form-control mb-3"),O(b,"placeholder","Email"),b.required=!0,O(g,"class","input-group mb-5"),O(Q,"class","list-group-item list-group-item-action"),O(Q,"href",i[5].lucentUrl+"/logout"),O(k,"class","list-group"),O(e,"class","wrapper-tiny")},m(B,J){A(B,e,J),Y(t,e,null),v(e,n),Y(r,e,null),v(e,s),v(e,o),Y(l,o,null),v(e,a),v(e,c),v(c,u),v(u,h),Ie(h,i[0]),v(u,f),Y(d,u,null),v(e,m),v(e,p),v(p,g),v(g,b),Ie(b,i[1]),v(g,w),Y(S,g,null),v(e,_),v(e,k),v(k,Q),v(Q,x),C=!0,M||($=[G(h,"input",i[9]),G(c,"submit",i[6]),G(b,"input",i[10]),G(p,"submit",i[7])],M=!0)},p(B,[J]){const te={};J&4&&(te.message=B[2]),t.$set(te);const ie={};r.$set(ie),J&1&&h.value!==B[0]&&Ie(h,B[0]),J&2&&b.value!==B[1]&&Ie(b,B[1])},i(B){C||(T(t.$$.fragment,B),T(r.$$.fragment,B),T(l.$$.fragment,B),T(d.$$.fragment,B),T(S.$$.fragment,B),C=!0)},o(B){R(t.$$.fragment,B),R(r.$$.fragment,B),R(l.$$.fragment,B),R(d.$$.fragment,B),R(S.$$.fragment,B),C=!1},d(B){B&&P(e),z(t),i[8](null),z(r),z(l),z(d),z(S),M=!1,ut($)}}}function Px(i,e,t){const n=je("user"),r=je("channel");let s=n.name,o=n.email,l="",a;function c(m){m.preventDefault(),t(2,l=""),Jn(r.lucentUrl+"/account/update-name",{name:s}).then(p=>{a.show()}).catch(p=>{var g;t(2,l=(g=p.response)==null?void 0:g.data.error),console.log({errorMessage:l})})}function u(m){m.preventDefault(),t(2,l=""),Jn(r.lucentUrl+"/account/update-email",{email:o}).then(p=>{a.show()}).catch(p=>{var g;t(2,l=(g=p.response)==null?void 0:g.data.error),console.log({errorMessage:l})})}function h(m){Se[m?"unshift":"push"](()=>{a=m,t(3,a)})}function f(){s=this.value,t(0,s)}function d(){o=this.value,t(1,o)}return[s,o,l,a,n,r,c,u,h,f,d]}class Ax extends oe{constructor(e){super(),se(this,e,Px,Cx,re,{})}}function xx(i){let e,t,n;const r=[{channel:i[3]},{title:i[0]},i[2]];var s=i[4][i[1]];function o(l,a){let c={};for(let u=0;u{z(c,1)}),pe()}s?(t=Fr(s,o(l,a)),V(t.$$.fragment),T(t.$$.fragment,1),Y(t,e,null)):t=null}else if(s){const c=a&13?So(r,[a&8&&{channel:l[3]},a&1&&{title:l[0]},a&4&&_o(l[2])]):{};t.$set(c)}},i(l){n||(t&&T(t.$$.fragment,l),n=!0)},o(l){t&&R(t.$$.fragment,l),n=!1},d(l){l&&P(e),t&&z(t)}}}function Tx(i,e,t){const n={register:hx,login:gx,verify:vx,profile:Ax};let{title:r}=e,{view:s}=e,{user:o}=e,{data:l}=e,{channel:a}=e;return Tl("channel",a),Tl("user",o),i.$$set=c=>{"title"in c&&t(0,r=c.title),"view"in c&&t(1,s=c.view),"user"in c&&t(5,o=c.user),"data"in c&&t(2,l=c.data),"channel"in c&&t(3,a=c.channel)},[r,s,l,a,n,o]}class Qx extends oe{constructor(e){super(),se(this,e,Tx,xx,re,{title:0,view:1,user:5,data:2,channel:3})}}const Mx=i=>({}),gg=i=>({});function Ex(i){let e;return{c(){e=W("Dropdown")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function Rx(i){let e,t,n,r,s,o,l,a;const c=i[6].button,u=Gl(c,i,i[5],gg),h=u||Ex(),f=i[6].default,d=Gl(f,i,i[5],null);return{c(){e=y("div"),t=y("button"),h&&h.c(),n=D(),r=y("div"),d&&d.c(),O(t,"class","button dropdown-button"),O(t,"type","button"),O(t,"aria-expanded","false"),O(r,"class",s="dropdown-menu hide orientation-"+i[0]),O(e,"class","dropdown")},m(m,p){A(m,e,p),v(e,t),h&&h.m(t,null),v(e,n),v(e,r),d&&d.m(r,null),i[7](r),o=!0,l||(a=[G(t,"click",i[1]),kP(ix.call(null,r)),G(r,"click_outside",i[3])],l=!0)},p(m,[p]){u&&u.p&&(!o||p&32)&&Kl(u,c,m,m[5],o?Hl(c,m[5],p,Mx):Jl(m[5]),gg),d&&d.p&&(!o||p&32)&&Kl(d,f,m,m[5],o?Hl(f,m[5],p,null):Jl(m[5]),null),(!o||p&1&&s!==(s="dropdown-menu hide orientation-"+m[0]))&&O(r,"class",s)},i(m){o||(T(h,m),T(d,m),o=!0)},o(m){R(h,m),R(d,m),o=!1},d(m){m&&P(e),h&&h.d(m),d&&d.d(m),i[7](null),l=!1,ut(a)}}}function Dx(i,e,t){let{$$slots:n={},$$scope:r}=e,s,{orientation:o="left"}=e;function l(){s.classList.remove("hide")}function a(){s.classList.add("hide")}function c(){s.classList.add("hide")}function u(h){Se[h?"unshift":"push"](()=>{s=h,t(2,s)})}return i.$$set=h=>{"orientation"in h&&t(0,o=h.orientation),"$$scope"in h&&t(5,r=h.$$scope)},[o,l,s,c,a,r,n,u]}class Gi extends oe{constructor(e){super(),se(this,e,Dx,Rx,re,{orientation:0,open:1,close:4})}get open(){return this.$$.ctx[1]}get close(){return this.$$.ctx[4]}}function Og(i,e,t){const n=i.slice();return n[7]=e[t],n}function bg(i,e,t){const n=i.slice();return n[7]=e[t],n}function vg(i){let e,t=i[7]+"",n,r,s;function o(...l){return i[4](i[7],...l)}return{c(){e=y("button"),n=W(t),O(e,"class","dropdown-item button")},m(l,a){A(l,e,a),v(e,n),r||(s=G(e,"click",o),r=!0)},p(l,a){i=l,a&2&&t!==(t=i[7]+"")&&K(n,t)},d(l){l&&P(e),r=!1,s()}}}function wg(i){let e=i[0].roles.includes(i[7]),t,n=e&&vg(i);return{c(){n&&n.c(),t=De()},m(r,s){n&&n.m(r,s),A(r,t,s)},p(r,s){s&3&&(e=r[0].roles.includes(r[7])),e?n?n.p(r,s):(n=vg(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(r){r&&P(t),n&&n.d(r)}}}function yg(i){let e,t=i[7]+"",n,r,s,o;function l(...a){return i[5](i[7],...a)}return{c(){e=y("button"),n=W(t),r=D(),O(e,"class","dropdown-item button")},m(a,c){A(a,e,c),v(e,n),v(e,r),s||(o=G(e,"click",l),s=!0)},p(a,c){i=a,c&2&&t!==(t=i[7]+"")&&K(n,t)},d(a){a&&P(e),s=!1,o()}}}function kg(i){let e=!i[0].roles.includes(i[7]),t,n=e&&yg(i);return{c(){n&&n.c(),t=De()},m(r,s){n&&n.m(r,s),A(r,t,s)},p(r,s){s&3&&(e=!r[0].roles.includes(r[7])),e?n?n.p(r,s):(n=yg(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(r){r&&P(t),n&&n.d(r)}}}function $x(i){let e,t,n,r,s,o,l=ue(i[1]),a=[];for(let h=0;h{b&&(g||(g=lu(e,hu,{duration:200},!0)),g.run(1))}),b=!0)},o(w){R(n.$$.fragment,w),R(p.$$.fragment,w),w&&(g||(g=lu(e,hu,{duration:200},!1)),g.run(0)),b=!1},d(w){w&&P(e),z(n),z(p),w&&g&&g.end()}}}function Nx(i,e,t){const n=nn();let{member:r}=e,{roles:s}=e;function o(u,h){u.preventDefault();let f=r.roles.filter(d=>d!==h);n("update",{user:r.id,roles:f})}function l(u,h){u.preventDefault();let f=[...r.roles,h];console.log(r.roles),console.log(h),console.log(f),n("update",{user:r.id,roles:f})}const a=(u,h)=>o(h,u),c=(u,h)=>l(h,u);return i.$$set=u=>{"member"in u&&t(0,r=u.member),"roles"in u&&t(1,s=u.roles)},[r,s,o,l,a,c]}class Zx extends oe{constructor(e){super(),se(this,e,Nx,Ix,re,{member:0,roles:1})}}function Sg(i,e,t){const n=i.slice();return n[15]=e[t],n}function _g(i,e,t){const n=i.slice();return n[18]=e[t],n}function Cg(i){let e,t=i[18]+"",n;return{c(){e=y("option"),n=W(t),e.__value=i[18],Ie(e,e.__value)},m(r,s){A(r,e,s),v(e,n)},p:U,d(r){r&&P(e)}}}function Pg(i){let e,t;return e=new Zx({props:{member:i[15],roles:i[6].roles}}),e.$on("update",i[9]),e.$on("reinvite",i[14]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.member=n[15]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function Bx(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k,Q,x,C,M,$,N,B,J,te,ie;s=new Ma({props:{message:i[4]}});let le={};l=new vy({props:le}),i[10](l);let X=ue(i[6].roles.filter(Ag)),ee=[];for(let ne=0;neR(ve[ne],1,1,()=>{ve[ne]=null});return{c(){e=y("div"),t=y("div"),n=y("h3"),n.textContent="Invite people",r=D(),V(s.$$.fragment),o=D(),V(l.$$.fragment),a=D(),c=y("form"),u=y("div"),h=y("label"),h.textContent="Invitee Name",f=D(),d=y("input"),m=D(),p=y("div"),g=y("label"),g.textContent="Invitee Email Address",b=D(),w=y("input"),S=D(),_=y("div"),k=y("select");for(let ne=0;nei[13].call(k)),O(_,"class","me-3"),O(x,"class","mt-5 d-block text-center"),O(t,"class","lx-card mt-5"),O(N,"class","header-small mb-5 mt-5"),O($,"class","member-list"),O(e,"class","common-wrapper")},m(ne,Ee){A(ne,e,Ee),v(e,t),v(t,n),v(t,r),Y(s,t,null),v(t,o),Y(l,t,null),v(t,a),v(t,c),v(c,u),v(u,h),v(u,f),v(u,d),Ie(d,i[1]),v(c,m),v(c,p),v(p,g),v(p,b),v(p,w),Ie(w,i[2]),v(c,S),v(c,_),v(_,k);for(let Re=0;Rei!=="removed";function Wx(i,e,t){const n=je("channel");let{users:r}=e,s,o,l,a="",c;function u(w){w.preventDefault(),h(s,o,l)}function h(w,S,_){t(4,a=""),Jn(n.lucentUrl+"/members/invite",{name:w,email:S,roles:[_]}).then(k=>{c.show("User was invited"),t(0,r=[...r,k.user]),t(1,s=null),t(2,o=null),t(3,l=null)}).catch(k=>{var Q,x;t(4,a=((x=(Q=k.response)==null?void 0:Q.data)==null?void 0:x.error)??"")})}function f(w){w.preventDefault(),t(4,a=""),Jn(n.lucentUrl+"/members/update",{id:w.detail.user,roles:w.detail.roles}).then(S=>{c.show("Users updated"),t(0,r=S.users)}).catch(S=>{var _,k;t(4,a=((k=(_=S.response)==null?void 0:_.data)==null?void 0:k.error)??"")})}function d(w){Se[w?"unshift":"push"](()=>{c=w,t(5,c)})}function m(){s=this.value,t(1,s)}function p(){o=this.value,t(2,o)}function g(){l=QP(this),t(3,l),t(6,n)}const b=w=>h(w.detail.email,w.detail.role);return i.$$set=w=>{"users"in w&&t(0,r=w.users)},[r,s,o,l,a,c,n,u,h,f,d,m,p,g,b]}class Xx extends oe{constructor(e){super(),se(this,e,Wx,Bx,re,{users:0})}}function Fx(i){let e,t,n;return{c(){e=y("div"),t=y("div"),n=W(i[0]),O(t,"class","header-normal"),O(e,"class","wrapper-normal ")},m(r,s){A(r,e,s),v(e,t),v(t,n)},p(r,[s]){s&1&&K(n,r[0])},i:U,o:U,d(r){r&&P(e)}}}function Yx(i,e,t){let{title:n}=e;return i.$$set=r=>{"title"in r&&t(0,n=r.title)},[n]}class zx extends oe{constructor(e){super(),se(this,e,Yx,Fx,re,{title:0})}}function Vx(i){let e,t=i[5].path+"";return{c(){e=xP("svg"),O(e,"class","bi svelte-r4pd9j"),O(e,"xmlns","http://www.w3.org/2000/svg"),O(e,"width",i[0]),O(e,"height",i[1]),O(e,"viewBox",i[5].viewBox),O(e,"aria-labelledby",i[2]),O(e,"role","presentation"),O(e,"stroke",i[4]),O(e,"fill",i[3])},m(n,r){A(n,e,r),e.innerHTML=t},p(n,[r]){r&1&&O(e,"width",n[0]),r&2&&O(e,"height",n[1]),r&4&&O(e,"aria-labelledby",n[2]),r&16&&O(e,"stroke",n[4]),r&8&&O(e,"fill",n[3])},i:U,o:U,d(n){n&&P(e)}}}function Ux(i,e,t){const n={"trash-can":{path:'',viewBox:"0 0 448 512"},"circle-chevron-down":{path:'',viewBox:"0 0 512 512"},"circle-chevron-up":{path:'',viewBox:"0 0 512 512"},ellipsis:{path:'',viewBox:"0 0 448 512"},"ellipsis-vertical":{path:'',viewBox:"0 0 128 512"},"angles-down":{path:'',viewBox:"0 0 384 512"},"angle-right":{path:'',viewBox:"0 0 256 512"},"photo-film":{path:'',viewBox:"0 0 640 512"},file:{path:'',viewBox:"0 0 384 512"},"circle-info":{path:'',viewBox:"0 0 512 512"},"table-columns":{path:'',viewBox:"0 0 512 512"},"arrow-down-a-z":{path:'',viewBox:"0 0 512 512"},"arrow-up-short-wide":{path:'',viewBox:"0 0 576 512"},"arrow-down-wide-short":{path:'',viewBox:"0 0 576 512"},filter:{path:'',viewBox:"0 0 512 512"},calendar:{path:'',viewBox:"0 0 448 512"},pencil:{path:'',viewBox:"0 0 512 512"},database:{path:'',viewBox:"0 0 448 512"},dice:{path:'',viewBox:"0 0 640 512"},"triangle-exclamation":{path:'',viewBox:"0 0 512 512"},eye:{path:'',viewBox:"0 0 576 512"},"circle-plus":{path:'',viewBox:"0 0 512 512"},"magnifying-glass":{path:'',viewBox:"0 0 512 512"},expand:{path:'',viewBox:"0 0 448 512"},compress:{path:'',viewBox:"0 0 448 512"},check:{path:'',viewBox:"0 0 448 512"},close:{path:'',viewBox:"0 0 24 24"},"arrow-left":{path:'',viewBox:"0 0 24 24"},list:{path:'',viewBox:"0 0 24 24"},"ordered-list":{path:'',viewBox:"0 0 24 24"},italic:{path:'',viewBox:"0 0 24 24"}};let{width:r=16}=e,{height:s=16}=e,{icon:o=""}=e,{fill:l="currentColor"}=e,{stroke:a="currentColor"}=e,c=n[o];return i.$$set=u=>{"width"in u&&t(0,r=u.width),"height"in u&&t(1,s=u.height),"icon"in u&&t(2,o=u.icon),"fill"in u&&t(3,l=u.fill),"stroke"in u&&t(4,a=u.stroke)},[r,s,o,l,a,c]}class Ot extends oe{constructor(e){super(),se(this,e,Ux,Vx,re,{width:0,height:1,icon:2,fill:3,stroke:4})}}function jx(i){let e,t,n;return{c(){e=y("input"),O(e,"type","checkbox"),e.value=i[0],O(e,"class","switch"),e.checked=i[1]},m(r,s){A(r,e,s),t||(n=G(e,"change",i[2]),t=!0)},p(r,[s]){s&1&&(e.value=r[0]),s&2&&(e.checked=r[1])},i:U,o:U,d(r){r&&P(e),t=!1,n()}}}function qx(i,e,t){let{value:n}=e,{checked:r=!1}=e;function s(o){Lr.call(this,i,o)}return i.$$set=o=>{"value"in o&&t(0,n=o.value),"checked"in o&&t(1,r=o.checked)},[n,r,s]}class Gx extends oe{constructor(e){super(),se(this,e,qx,jx,re,{value:0,checked:1})}}function xg(i){let e,t;return e=new Gx({props:{value:"published",checked:i[0].status==="published"}}),e.$on("change",i[1]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.checked=n[0].status==="published"),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function Hx(i){let e;return{c(){e=W("Trashed")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function Kx(i){let e;return{c(){e=W("Draft")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function Jx(i){let e;return{c(){e=W("Published")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function e3(i){let e,t,n,r=i[0].status!=="trashed"&&xg(i);function s(a,c){if(a[0].status==="published")return Jx;if(a[0].status==="draft")return Kx;if(a[0].status==="trashed")return Hx}let o=s(i),l=o&&o(i);return{c(){r&&r.c(),e=D(),l&&l.c(),t=De()},m(a,c){r&&r.m(a,c),A(a,e,c),l&&l.m(a,c),A(a,t,c),n=!0},p(a,[c]){a[0].status!=="trashed"?r?(r.p(a,c),c&1&&T(r,1)):(r=xg(a),r.c(),T(r,1),r.m(e.parentNode,e)):r&&(me(),R(r,1,1,()=>{r=null}),pe()),o!==(o=s(a))&&(l&&l.d(1),l=o&&o(a),l&&(l.c(),l.m(t.parentNode,t)))},i(a){n||(T(r),n=!0)},o(a){R(r),n=!1},d(a){a&&(P(e),P(t)),r&&r.d(a),l&&l.d(a)}}}function t3(i,e,t){let{status:n="draft"}=e,{record:r}=e;function s(o){o.target.checked?t(2,n="published"):t(2,n="draft")}return i.$$set=o=>{"status"in o&&t(2,n=o.status),"record"in o&&t(0,r=o.record)},[r,s,n]}class n3 extends oe{constructor(e){super(),se(this,e,t3,e3,re,{status:2,record:0})}}function Tg(i){let e,t;return e=new Gi({props:{$$slots:{button:[r3],default:[i3]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&270&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function Qg(i){let e,t,n,r;return{c(){e=y("a"),t=W("Clone"),O(e,"class","dropdown-item"),O(e,"href",i[4].lucentUrl)},m(s,o){A(s,e,o),v(e,t),n||(r=G(e,"click",i[5]),n=!0)},p:U,d(s){s&&P(e),n=!1,r()}}}function i3(i){let e,t,n,r,s,o,l,a,c,u,h,f=!i[3]&&Qg(i);return{c(){e=y("h6"),e.textContent="Record Actions",t=D(),n=y("a"),r=W("Create new"),o=D(),f&&f.c(),l=D(),a=y("a"),c=W("Revisions"),O(e,"class","dropdown-header"),O(n,"class","dropdown-item"),O(n,"href",s=i[4].lucentUrl+"/records/new?schema="+i[2].name),O(a,"class","dropdown-item"),O(a,"href",i[4].lucentUrl)},m(d,m){A(d,e,m),A(d,t,m),A(d,n,m),v(n,r),A(d,o,m),f&&f.m(d,m),A(d,l,m),A(d,a,m),v(a,c),u||(h=G(a,"click",Ln(i[6])),u=!0)},p(d,m){m&4&&s!==(s=d[4].lucentUrl+"/records/new?schema="+d[2].name)&&O(n,"href",s),d[3]?f&&(f.d(1),f=null):f?f.p(d,m):(f=Qg(d),f.c(),f.m(l.parentNode,l))},d(d){d&&(P(e),P(t),P(n),P(o),P(l),P(a)),f&&f.d(d),u=!1,h()}}}function r3(i){let e,t,n;return t=new Ot({props:{icon:"ellipsis"}}),{c(){e=y("div"),V(t.$$.fragment),O(e,"slot","button")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function s3(i){let e,t,n,r,s,o=!i[3]&&Tg(i);function l(c){i[7](c)}let a={record:i[0]};return i[0].status!==void 0&&(a.status=i[0].status),n=new n3({props:a}),Se.push(()=>He(n,"status",l)),{c(){e=y("div"),o&&o.c(),t=D(),V(n.$$.fragment),fe(e,"display","flex"),fe(e,"align-items","center"),fe(e,"gap","10px")},m(c,u){A(c,e,u),o&&o.m(e,null),v(e,t),Y(n,e,null),s=!0},p(c,[u]){c[3]?o&&(me(),R(o,1,1,()=>{o=null}),pe()):o?(o.p(c,u),u&8&&T(o,1)):(o=Tg(c),o.c(),T(o,1),o.m(e,t));const h={};u&1&&(h.record=c[0]),!r&&u&1&&(r=!0,h.status=c[0].status,nt(()=>r=!1)),n.$set(h)},i(c){s||(T(o),T(n.$$.fragment,c),s=!0)},o(c){R(o),R(n.$$.fragment,c),s=!1},d(c){c&&P(e),o&&o.d(),z(n)}}}function o3(i,e,t){const n=je("channel");let{schema:r}=e,{record:s}=e,{isCreateMode:o}=e,{activeContentTab:l}=e;function a(h){h.preventDefault(),Jn(n.lucentUrl+"/records/clone/"+s.id).then(f=>{window.location=n.lucentUrl+"/records/"+f.id}).catch(f=>{})}const c=h=>t(1,l="_info");function u(h){i.$$.not_equal(s.status,h)&&(s.status=h,t(0,s))}return i.$$set=h=>{"schema"in h&&t(2,r=h.schema),"record"in h&&t(0,s=h.record),"isCreateMode"in h&&t(3,o=h.isCreateMode),"activeContentTab"in h&&t(1,l=h.activeContentTab)},[s,l,r,o,n,a,c,u]}class wy extends oe{constructor(e){super(),se(this,e,o3,s3,re,{schema:2,record:0,isCreateMode:3,activeContentTab:1})}}function Mg(i,e,t){const n=i.slice();return n[9]=e[t],n}function Eg(i){let e,t=ue(i[1]),n=[];for(let r=0;r1&&Eg(i);return{c(){t&&t.c(),e=De()},m(n,r){t&&t.m(n,r),A(n,e,r)},p(n,[r]){n[1].length>1?t?t.p(n,r):(t=Eg(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(n){n&&P(e),t&&t.d(n)}}}function a3(i,e,t){var f;let{schema:n}=e,{isCreateMode:r}=e,{active:s=""}=e,o=((f=n.groups)==null?void 0:f.map(d=>({label:d,name:d})))??[],l={label:"Main",name:""},a={label:"Backlinks",name:"_graph"};r?o=[l,...o]:o=[l,...o,a];function c(d){d.preventDefault(),t(0,s="_graph")}function u(d,m){d.preventDefault(),m=="_graph"?c(d):t(0,s=m)}const h=(d,m)=>u(m,d.name);return i.$$set=d=>{"schema"in d&&t(3,n=d.schema),"isCreateMode"in d&&t(4,r=d.isCreateMode),"active"in d&&t(0,s=d.active)},[s,o,u,n,r,h]}class yy extends oe{constructor(e){super(),se(this,e,a3,l3,re,{schema:3,isCreateMode:4,active:0})}}function In(i,e){return i&&i[e]?i[e].message:null}function ur(i){return Array.isArray?Array.isArray(i):_y(i)==="[object Array]"}function c3(i){if(typeof i=="string")return i;let e=i+"";return e=="0"&&1/i==-1/0?"-0":e}function u3(i){return i==null?"":c3(i)}function Wi(i){return typeof i=="string"}function ky(i){return typeof i=="number"}function h3(i){return i===!0||i===!1||f3(i)&&_y(i)=="[object Boolean]"}function Sy(i){return typeof i=="object"}function f3(i){return Sy(i)&&i!==null}function Un(i){return i!=null}function Dh(i){return!i.trim().length}function _y(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(i)}const d3="Incorrect 'index' type",m3=i=>`Invalid value for key ${i}`,p3=i=>`Pattern length exceeds max of ${i}.`,g3=i=>`Missing ${i} property in key`,O3=i=>`Property 'weight' in key '${i}' must be a positive integer`,Dg=Object.prototype.hasOwnProperty;class b3{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{let r=Cy(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Cy(i){let e=null,t=null,n=null,r=1,s=null;if(Wi(i)||ur(i))n=i,e=$g(i),t=hd(i);else{if(!Dg.call(i,"name"))throw new Error(g3("name"));const o=i.name;if(n=o,Dg.call(i,"weight")&&(r=i.weight,r<=0))throw new Error(O3(o));e=$g(o),t=hd(o),s=i.getFn}return{path:e,id:t,weight:r,src:n,getFn:s}}function $g(i){return ur(i)?i:i.split(".")}function hd(i){return ur(i)?i.join("."):i}function v3(i,e){let t=[],n=!1;const r=(s,o,l)=>{if(Un(s))if(!o[l])t.push(s);else{let a=o[l];const c=s[a];if(!Un(c))return;if(l===o.length-1&&(Wi(c)||ky(c)||h3(c)))t.push(u3(c));else if(ur(c)){n=!0;for(let u=0,h=c.length;ui.score===e.score?i.idx{this._keysMap[t.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Wi(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const t=this.size();Wi(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t{let o=r.getFn?r.getFn(e):this.getFn(e,r.path);if(Un(o)){if(ur(o)){let l=[];const a=[{nestedArrIndex:-1,value:o}];for(;a.length;){const{nestedArrIndex:c,value:u}=a.pop();if(Un(u))if(Wi(u)&&!Dh(u)){let h={v:u,i:c,n:this.norm.get(u)};l.push(h)}else ur(u)&&u.forEach((h,f)=>{a.push({nestedArrIndex:f,value:h})})}n.$[s]=l}else if(Wi(o)&&!Dh(o)){let l={v:o,n:this.norm.get(o)};n.$[s]=l}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Py(i,e,{getFn:t=Be.getFn,fieldNormWeight:n=Be.fieldNormWeight}={}){const r=new Ym({getFn:t,fieldNormWeight:n});return r.setKeys(i.map(Cy)),r.setSources(e),r.create(),r}function P3(i,{getFn:e=Be.getFn,fieldNormWeight:t=Be.fieldNormWeight}={}){const{keys:n,records:r}=i,s=new Ym({getFn:e,fieldNormWeight:t});return s.setKeys(n),s.setIndexRecords(r),s}function Ha(i,{errors:e=0,currentLocation:t=0,expectedLocation:n=0,distance:r=Be.distance,ignoreLocation:s=Be.ignoreLocation}={}){const o=e/i.length;if(s)return o;const l=Math.abs(n-t);return r?o+l/r:l?1:o}function A3(i=[],e=Be.minMatchCharLength){let t=[],n=-1,r=-1,s=0;for(let o=i.length;s=e&&t.push([n,r]),n=-1)}return i[s-1]&&s-n>=e&&t.push([n,s-1]),t}const ms=32;function x3(i,e,t,{location:n=Be.location,distance:r=Be.distance,threshold:s=Be.threshold,findAllMatches:o=Be.findAllMatches,minMatchCharLength:l=Be.minMatchCharLength,includeMatches:a=Be.includeMatches,ignoreLocation:c=Be.ignoreLocation}={}){if(e.length>ms)throw new Error(p3(ms));const u=e.length,h=i.length,f=Math.max(0,Math.min(n,h));let d=s,m=f;const p=l>1||a,g=p?Array(h):[];let b;for(;(b=i.indexOf(e,m))>-1;){let x=Ha(e,{currentLocation:b,expectedLocation:f,distance:r,ignoreLocation:c});if(d=Math.min(x,d),m=b+u,p){let C=0;for(;C=$;te-=1){let ie=te-1,le=t[i.charAt(ie)];if(p&&(g[ie]=+!!le),B[te]=(B[te+1]<<1|1)&le,x&&(B[te]|=(w[te+1]|w[te])<<1|1|w[te+1]),B[te]&k&&(S=Ha(e,{errors:x,currentLocation:ie,expectedLocation:f,distance:r,ignoreLocation:c}),S<=d)){if(d=S,m=ie,m<=f)break;$=Math.max(1,2*f-m)}}if(Ha(e,{errors:x+1,currentLocation:f,expectedLocation:f,distance:r,ignoreLocation:c})>d)break;w=B}const Q={isMatch:m>=0,score:Math.max(.001,S)};if(p){const x=A3(g,l);x.length?a&&(Q.indices=x):Q.isMatch=!1}return Q}function T3(i){let e={};for(let t=0,n=i.length;t{this.chunks.push({pattern:f,alphabet:T3(f),startIndex:d})},h=this.pattern.length;if(h>ms){let f=0;const d=h%ms,m=h-d;for(;f{const{isMatch:b,score:w,indices:S}=x3(e,m,p,{location:r+g,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,includeMatches:n,ignoreLocation:c});b&&(f=!0),h+=w,b&&S&&(u=[...u,...S])});let d={isMatch:f,score:f?h/this.chunks.length:1};return f&&n&&(d.indices=u),d}}class es{constructor(e){this.pattern=e}static isMultiMatch(e){return Lg(e,this.multiRegex)}static isSingleMatch(e){return Lg(e,this.singleRegex)}search(){}}function Lg(i,e){const t=i.match(e);return t?t[1]:null}class Q3 extends es{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class M3 extends es{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class E3 extends es{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class R3 extends es{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class D3 extends es{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class $3 extends es{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class xy extends es{constructor(e,{location:t=Be.location,threshold:n=Be.threshold,distance:r=Be.distance,includeMatches:s=Be.includeMatches,findAllMatches:o=Be.findAllMatches,minMatchCharLength:l=Be.minMatchCharLength,isCaseSensitive:a=Be.isCaseSensitive,ignoreLocation:c=Be.ignoreLocation}={}){super(e),this._bitapSearch=new Ay(e,{location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Ty extends es{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,n;const r=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,t))>-1;)t=n+s,r.push([n,t-1]);const o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}const fd=[Q3,Ty,E3,R3,$3,D3,M3,xy],Ig=fd.length,L3=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,I3="|";function N3(i,e={}){return i.split(I3).map(t=>{let n=t.trim().split(L3).filter(s=>s&&!!s.trim()),r=[];for(let s=0,o=n.length;s!!(i[fu.AND]||i[fu.OR]),X3=i=>!!i[pd.PATH],F3=i=>!ur(i)&&Sy(i)&&!gd(i),Ng=i=>({[fu.AND]:Object.keys(i).map(e=>({[e]:i[e]}))});function Qy(i,e,{auto:t=!0}={}){const n=r=>{let s=Object.keys(r);const o=X3(r);if(!o&&s.length>1&&!gd(r))return n(Ng(r));if(F3(r)){const a=o?r[pd.PATH]:s[0],c=o?r[pd.PATTERN]:r[a];if(!Wi(c))throw new Error(m3(a));const u={keyId:hd(a),pattern:c};return t&&(u.searcher=md(c,e)),u}let l={children:[],operator:s[0]};return s.forEach(a=>{const c=r[a];ur(c)&&c.forEach(u=>{l.children.push(n(u))})}),l};return gd(i)||(i=Ng(i)),n(i)}function Y3(i,{ignoreFieldNorm:e=Be.ignoreFieldNorm}){i.forEach(t=>{let n=1;t.matches.forEach(({key:r,norm:s,score:o})=>{const l=r?r.weight:null;n*=Math.pow(o===0&&l?Number.EPSILON:o,(l||1)*(e?1:s))}),t.score=n})}function z3(i,e){const t=i.matches;e.matches=[],Un(t)&&t.forEach(n=>{if(!Un(n.indices)||!n.indices.length)return;const{indices:r,value:s}=n;let o={indices:r,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function V3(i,e){e.score=i.score}function U3(i,e,{includeMatches:t=Be.includeMatches,includeScore:n=Be.includeScore}={}){const r=[];return t&&r.push(z3),n&&r.push(V3),i.map(s=>{const{idx:o}=s,l={item:e[o],refIndex:o};return r.length&&r.forEach(a=>{a(s,l)}),l})}class Bo{constructor(e,t={},n){this.options={...Be,...t},this.options.useExtendedSearch,this._keyStore=new b3(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Ym))throw new Error(d3);this._myIndex=t||Py(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Un(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let n=0,r=this._docs.length;n-1&&(a=a.slice(0,t)),U3(a,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){const t=md(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:s,i:o,n:l})=>{if(!Un(s))return;const{isMatch:a,score:c,indices:u}=t.searchIn(s);a&&r.push({item:s,idx:o,matches:[{score:c,value:s,norm:l,indices:u}]})}),r}_searchLogical(e){const t=Qy(e,this.options),n=(l,a,c)=>{if(!l.children){const{keyId:h,searcher:f}=l,d=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(a,h),searcher:f});return d&&d.length?[{idx:c,item:a,matches:d}]:[]}const u=[];for(let h=0,f=l.children.length;h{if(Un(l)){let c=n(t,l,a);c.length&&(s[a]||(s[a]={idx:a,item:l,matches:[]},o.push(s[a])),c.forEach(({matches:u})=>{s[a].matches.push(...u)}))}}),o}_searchObjectList(e){const t=md(e,this.options),{keys:n,records:r}=this._myIndex,s=[];return r.forEach(({$:o,i:l})=>{if(!Un(o))return;let a=[];n.forEach((c,u)=>{a.push(...this._findMatches({key:c,value:o[u],searcher:t}))}),a.length&&s.push({idx:l,item:o,matches:a})}),s}_findMatches({key:e,value:t,searcher:n}){if(!Un(t))return[];let r=[];if(ur(t))t.forEach(({v:s,i:o,n:l})=>{if(!Un(s))return;const{isMatch:a,score:c,indices:u}=n.searchIn(s);a&&r.push({score:c,key:e,value:s,idx:o,norm:l,indices:u})});else{const{v:s,n:o}=t,{isMatch:l,score:a,indices:c}=n.searchIn(s);l&&r.push({score:a,key:e,value:s,norm:o,indices:c})}return r}}Bo.version="7.0.0";Bo.createIndex=Py;Bo.parseIndex=P3;Bo.config=Be;Bo.parseQuery=Qy;W3(B3);function Zg(i,e,t){const n=i.slice();return n[10]=e[t],n}function Bg(i){let e=[],t=new Map,n,r=ue(i[0]);const s=o=>o[10].value;for(let o=0;o({value:e,label:e})):Object.entries(i).map(([e,t])=>({value:e,label:t}))}function G3(i,e,t){let n,{field:r}=e,{value:s}=e,{search:o=""}=e;const l=nn();function a(d,m){d.preventDefault(),t(3,s=m.value),t(2,o=""),l("selected",{option:m})}let c=q3(r.selectOptions);const u=new Bo(c,{includeScore:!1,keys:["value","label"]}),h=(d,m)=>a(m,d),f=(d,m)=>a(m,d);return i.$$set=d=>{"field"in d&&t(4,r=d.field),"value"in d&&t(3,s=d.value),"search"in d&&t(2,o=d.search)},i.$$.update=()=>{i.$$.dirty&4&&t(0,n=o===""?c:u.search(o).map(d=>d.item))},[n,a,o,s,r,h,f]}class H3 extends oe{constructor(e){super(),se(this,e,G3,j3,re,{field:4,value:3,search:2})}}function Xg(i){let e,t,n,r,s,o,l,a;function c(f,d){return d&2&&(t=null),t==null&&(t=!!Array.isArray(f[1].selectOptions)),t?J3:K3}let u=c(i,-1),h=u(i);return s=new Ot({props:{width:12,height:12,icon:"close"}}),{c(){e=y("div"),h.c(),n=D(),r=y("button"),V(s.$$.fragment),O(r,"type","button"),O(r,"class","button-text"),O(r,"aria-label","Close"),O(e,"class","autocomplete-selected-value")},m(f,d){A(f,e,d),h.m(e,null),v(e,n),v(e,r),Y(s,r,null),o=!0,l||(a=G(r,"click",Ln(i[9])),l=!0)},p(f,d){u===(u=c(f,d))&&h?h.p(f,d):(h.d(1),h=u(f),h&&(h.c(),h.m(e,n)))},i(f){o||(T(s.$$.fragment,f),o=!0)},o(f){R(s.$$.fragment,f),o=!1},d(f){f&&P(e),h.d(),z(s),l=!1,a()}}}function K3(i){let e=i[1].selectOptions[i[0]]+"",t;return{c(){t=W(e)},m(n,r){A(n,t,r)},p(n,r){r&3&&e!==(e=n[1].selectOptions[n[0]]+"")&&K(t,e)},d(n){n&&P(t)}}}function J3(i){let e;return{c(){e=W(i[0])},m(t,n){A(t,e,n)},p(t,n){n&1&&K(e,t[0])},d(t){t&&P(e)}}}function eT(i){let e,t,n,r,s,o,l,a,c,u,h,f;function d(b){i[7](b)}function m(b){i[8](b)}let p={field:i[1]};i[0]!==void 0&&(p.value=i[0]),i[3]!==void 0&&(p.search=i[3]),s=new H3({props:p}),Se.push(()=>He(s,"value",d)),Se.push(()=>He(s,"search",m)),s.$on("selected",i[4]);let g=i[0]&&Xg(i);return{c(){e=y("div"),t=y("input"),n=D(),r=y("div"),V(s.$$.fragment),a=D(),g&&g.c(),c=De(),O(t,"type","search"),O(t,"placeholder","Search for options"),O(t,"autocomplete","off"),O(r,"class","autocomplete-results"),O(e,"class","autocomplete")},m(b,w){A(b,e,w),v(e,t),Ie(t,i[3]),i[6](t),v(e,n),v(e,r),Y(s,r,null),A(b,a,w),g&&g.m(b,w),A(b,c,w),u=!0,h||(f=G(t,"input",i[5]),h=!0)},p(b,[w]){w&8&&t.value!==b[3]&&Ie(t,b[3]);const S={};w&2&&(S.field=b[1]),!o&&w&1&&(o=!0,S.value=b[0],nt(()=>o=!1)),!l&&w&8&&(l=!0,S.search=b[3],nt(()=>l=!1)),s.$set(S),b[0]?g?(g.p(b,w),w&1&&T(g,1)):(g=Xg(b),g.c(),T(g,1),g.m(c.parentNode,c)):g&&(me(),R(g,1,1,()=>{g=null}),pe())},i(b){u||(T(s.$$.fragment,b),T(g),u=!0)},o(b){R(s.$$.fragment,b),R(g),u=!1},d(b){b&&(P(e),P(a),P(c)),i[6](null),z(s),g&&g.d(b),h=!1,f()}}}function tT(i,e,t){let n,r,{value:s}=e,{field:o}=e;function l(){n.focus(),n.blur()}function a(){r=this.value,t(3,r)}function c(d){Se[d?"unshift":"push"](()=>{n=d,t(2,n)})}function u(d){s=d,t(0,s)}function h(d){r=d,t(3,r)}const f=d=>t(0,s="");return i.$$set=d=>{"value"in d&&t(0,s=d.value),"field"in d&&t(1,o=d.field)},[s,o,n,r,l,a,c,u,h,f]}class nT extends oe{constructor(e){super(),se(this,e,tT,eT,re,{value:0,field:1})}}function iT(i){let e,t,n,r;return{c(){e=y("input"),O(e,"type","text"),O(e,"id",i[3]),O(e,"class","form-control"),O(e,"autocomplete","off"),e.readOnly=t=i[1].readonly&&!i[2],Ae(e,"is-invalid",i[4])},m(s,o){A(s,e,o),Ie(e,i[0]),n||(r=G(e,"input",i[7]),n=!0)},p(s,o){o&8&&O(e,"id",s[3]),o&6&&t!==(t=s[1].readonly&&!s[2])&&(e.readOnly=t),o&1&&e.value!==s[0]&&Ie(e,s[0]),o&16&&Ae(e,"is-invalid",s[4])},i:U,o:U,d(s){s&&P(e),n=!1,r()}}}function rT(i){let e,t,n;function r(o){i[6](o)}let s={field:i[1]};return i[0]!==void 0&&(s.value=i[0]),e=new nT({props:s}),Se.push(()=>He(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&2&&(a.field=o[1]),!t&&l&1&&(t=!0,a.value=o[0],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function Fg(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function sT(i){let e,t,n,r,s;const o=[rT,iT],l=[];function a(u,h){return u[1].selectOptions?0:1}t=a(i),n=l[t]=o[t](i);let c=i[4]&&Fg(i);return{c(){e=y("div"),n.c(),r=D(),c&&c.c(),fe(e,"position","relative")},m(u,h){A(u,e,h),l[t].m(e,null),v(e,r),c&&c.m(e,null),s=!0},p(u,[h]){let f=t;t=a(u),t===f?l[t].p(u,h):(me(),R(l[f],1,1,()=>{l[f]=null}),pe(),n=l[t],n?n.p(u,h):(n=l[t]=o[t](u),n.c()),T(n,1),n.m(e,r)),u[4]?c?c.p(u,h):(c=Fg(u),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i(u){s||(T(n),s=!0)},o(u){R(n),s=!1},d(u){u&&P(e),l[t].d(),c&&c.d()}}}function oT(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,{id:a}=e;function c(h){s=h,t(0,s)}function u(){s=this.value,t(0,s)}return i.$$set=h=>{"field"in h&&t(1,r=h.field),"value"in h&&t(0,s=h.value),"isCreateMode"in h&&t(2,o=h.isCreateMode),"validationErrors"in h&&t(5,l=h.validationErrors),"id"in h&&t(3,a=h.id)},i.$$.update=()=>{i.$$.dirty&34&&t(4,n=In(l,r.name))},[s,r,o,a,n,l,c,u]}let My=class extends oe{constructor(e){super(),se(this,e,oT,sT,re,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}};function Yg(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function lT(i){let e,t,n,r,s,o,l,a=i[1].source+"",c,u,h,f,d=i[4]&&Yg(i);return{c(){e=y("div"),t=y("input"),r=D(),s=y("div"),o=W("Leave this empty to autogenerate from "),l=y("i"),c=W(a),u=D(),d&&d.c(),O(t,"type","text"),O(t,"id",i[3]),O(t,"class","form-control"),O(t,"autocomplete","off"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[4]),O(s,"class","system-help-text light-text"),O(e,"class","mb-0")},m(m,p){A(m,e,p),v(e,t),Ie(t,i[0]),v(e,r),v(e,s),v(s,o),v(s,l),v(l,c),v(e,u),d&&d.m(e,null),h||(f=G(t,"input",i[6]),h=!0)},p(m,[p]){p&8&&O(t,"id",m[3]),p&6&&n!==(n=m[1].readonly&&!m[2])&&(t.readOnly=n),p&1&&t.value!==m[0]&&Ie(t,m[0]),p&16&&Ae(t,"is-invalid",m[4]),p&2&&a!==(a=m[1].source+"")&&K(c,a),m[4]?d?d.p(m,p):(d=Yg(m),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},i:U,o:U,d(m){m&&P(e),d&&d.d(),h=!1,f()}}}function aT(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,{id:a}=e;function c(){s=this.value,t(0,s)}return i.$$set=u=>{"field"in u&&t(1,r=u.field),"value"in u&&t(0,s=u.value),"isCreateMode"in u&&t(2,o=u.isCreateMode),"validationErrors"in u&&t(5,l=u.validationErrors),"id"in u&&t(3,a=u.id)},i.$$.update=()=>{i.$$.dirty&34&&t(4,n=In(l,r.name))},[s,r,o,a,n,l,c]}class Ey extends oe{constructor(e){super(),se(this,e,aT,lT,re,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function zm(i,e,t,n,r=""){let s=t.map(l=>({target:l.id,source:e.id,sourceSchema:e.schema,targetSchema:l.schema,field:n,depth:1,rank:""})),o=i.edges;return r==="replace"&&(o=o.filter(l=>l.field!==field.name)),i.records=dg([...i.records,...t],l=>l.id),i.edges=dg([...o,...s],l=>l.source+l.target+l.field+l.depth),i}function cT(i,e,t,n,r){if(i===e)return t;let s=r.map(a=>a.id),o=(t==null?void 0:t.filter(a=>a.field===n&&a.depth===1&&s.includes(a.target)))??[],l=(t==null?void 0:t.filter(a=>!(a.field===n&&a.depth===1)))??[];return o=Ry(o,i,e),[...l,...o]}function Ry(i,e,t){if(t>=i.length)for(var n=t-i.length+1;n--;)i.push(void 0);return i.splice(t,0,i.splice(e,1)[0]),i}function zg(i,e){return e.mime==="image/svg+xml"?ia(i,e):i.filesUrl+`/thumbs/${e.path}`}function ia(i,e){return i.filesUrl+`/${e.path}`}function Vg(i){let e,t,n,r,s;const o=[hT,uT],l=[];function a(c,u){return u&1&&(e=null),e==null&&(e=!!c[0].mime.startsWith("image")),e?0:1}return t=a(i,-1),n=l[t]=o[t](i),{c(){n.c(),r=De()},m(c,u){l[t].m(c,u),A(c,r,u),s=!0},p(c,u){let h=t;t=a(c,u),t===h?l[t].p(c,u):(me(),R(l[h],1,1,()=>{l[h]=null}),pe(),n=l[t],n?n.p(c,u):(n=l[t]=o[t](c),n.c()),T(n,1),n.m(r.parentNode,r))},i(c){s||(T(n),s=!0)},o(c){R(n),s=!1},d(c){c&&P(r),l[t].d(c)}}}function uT(i){let e,t,n,r,s,o=i[0].path.split(".").pop().toLowerCase()+"",l,a,c,u;return t=new Ot({props:{icon:"file",width:i[3],height:i[3]}}),{c(){e=y("a"),V(t.$$.fragment),n=D(),r=y("span"),s=W("."),l=W(o),O(r,"class","ms-2"),O(e,"href",a=i[4].lucentUrl+"/files/"+i[0].id),O(e,"title",c=i[0].path),O(e,"class","file-preview-small"),fe(e,"width",i[2]+"px"),fe(e,"height",i[2]+"px")},m(h,f){A(h,e,f),Y(t,e,null),v(e,n),v(e,r),v(r,s),v(r,l),u=!0},p(h,f){const d={};f&8&&(d.width=h[3]),f&8&&(d.height=h[3]),t.$set(d),(!u||f&1)&&o!==(o=h[0].path.split(".").pop().toLowerCase()+"")&&K(l,o),(!u||f&1&&a!==(a=h[4].lucentUrl+"/files/"+h[0].id))&&O(e,"href",a),(!u||f&1&&c!==(c=h[0].path))&&O(e,"title",c),(!u||f&4)&&fe(e,"width",h[2]+"px"),(!u||f&4)&&fe(e,"height",h[2]+"px")},i(h){u||(T(t.$$.fragment,h),u=!0)},o(h){R(t.$$.fragment,h),u=!1},d(h){h&&P(e),z(t)}}}function hT(i){let e,t,n,r,s,o;return{c(){e=y("a"),t=y("img"),O(t,"class","rounded w-100 svelte-sv092r"),ad(t.src,n=zg(i[4],i[0]))||O(t,"src",n),O(t,"alt",r=i[0].path),O(e,"href",s=i[4].lucentUrl+"/files/"+i[0].id),O(e,"title",o=i[0].filename),fe(e,"width",i[2]+"px"),fe(e,"height",i[2]+"px")},m(l,a){A(l,e,a),v(e,t)},p(l,a){a&1&&!ad(t.src,n=zg(l[4],l[0]))&&O(t,"src",n),a&1&&r!==(r=l[0].path)&&O(t,"alt",r),a&1&&s!==(s=l[4].lucentUrl+"/files/"+l[0].id)&&O(e,"href",s),a&1&&o!==(o=l[0].filename)&&O(e,"title",o),a&4&&fe(e,"width",l[2]+"px"),a&4&&fe(e,"height",l[2]+"px")},i:U,o:U,d(l){l&&P(e)}}}function Ug(i){let e,t=i[0].path+"",n,r,s;return{c(){e=y("a"),n=W(t),O(e,"href",r=i[4].lucentUrl+"/files/"+i[0].id),O(e,"title",s=i[0].path),O(e,"class","preview-file-filename lx-small-text text-decoration-none")},m(o,l){A(o,e,l),v(e,n)},p(o,l){l&1&&t!==(t=o[0].path+"")&&K(n,t),l&1&&r!==(r=o[4].lucentUrl+"/files/"+o[0].id)&&O(e,"href",r),l&1&&s!==(s=o[0].path)&&O(e,"title",s)},d(o){o&&P(e)}}}function fT(i){let e,t,n,r=i[0]&&Vg(i),s=i[1]&&Ug(i);return{c(){e=y("div"),r&&r.c(),t=D(),s&&s.c(),fe(e,"display","flex"),fe(e,"align-items","center"),fe(e,"gap","5px")},m(o,l){A(o,e,l),r&&r.m(e,null),v(e,t),s&&s.m(e,null),n=!0},p(o,[l]){o[0]?r?(r.p(o,l),l&1&&T(r,1)):(r=Vg(o),r.c(),T(r,1),r.m(e,t)):r&&(me(),R(r,1,1,()=>{r=null}),pe()),o[1]?s?s.p(o,l):(s=Ug(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},i(o){n||(T(r),n=!0)},o(o){R(r),n=!1},d(o){o&&P(e),r&&r.d(),s&&s.d()}}}function dT(i,e,t){let{file:n}=e;const r=je("channel");let{size:s="small"}=e,{showFilename:o=!1}=e,l,a;return console.log({channel:r}),s=="large"?(l=256,a=32):s=="medium"?(l=128,a=12):s=="small"?(l=64,a=12):s=="tiny"&&(l=42,a=12),i.$$set=c=>{"file"in c&&t(0,n=c.file),"size"in c&&t(5,s=c.size),"showFilename"in c&&t(1,o=c.showFilename)},[n,o,l,a,r,s]}class Wo extends oe{constructor(e){super(),se(this,e,dT,fT,re,{file:0,size:5,showFilename:1})}}function jg(i){let e,t,n,r,s,o,l,a,c,u=i[0]._file.path+"",h,f,d,m,p,g,b=i[0]._file.originalName+"",w,S,_,k,Q,x,C=i[0]._file.mime+"",M,$,N,B,J,te,ie,le=(i[0]._file.size/1024).toFixed(1)+"",X,ee,Te,ve,Ue,ne,Ee,Re=i[0]._file.checksum+"",xt,H,Pe,Ye,Tt,yt,wt;n=new Wo({props:{record:i[0],size:"large"}});let Qt=i[0]._file.width&&qg(i);return{c(){e=y("div"),t=y("div"),V(n.$$.fragment),r=D(),s=y("div"),o=y("div"),l=y("span"),l.textContent="Filename",a=D(),c=y("span"),h=W(u),f=D(),d=y("div"),m=y("span"),m.textContent="Original name",p=D(),g=y("span"),w=W(b),S=D(),_=y("div"),k=y("span"),k.textContent="Mime type",Q=D(),x=y("span"),M=W(C),$=D(),Qt&&Qt.c(),N=D(),B=y("div"),J=y("span"),J.textContent="File size",te=D(),ie=y("span"),X=W(le),ee=W("kB"),Te=D(),ve=y("div"),Ue=y("span"),Ue.textContent="Checksum",ne=D(),Ee=y("span"),xt=W(Re),H=D(),Pe=y("div"),Ye=y("a"),Tt=W("Download"),O(l,"class","text-muted"),O(o,"class","file-details-item"),O(m,"class","text-muted"),O(d,"class","file-details-item"),O(k,"class","text-muted"),O(_,"class","file-details-item"),O(J,"class","text-muted"),O(B,"class","file-details-item"),O(Ue,"class","text-muted"),O(ve,"class","file-details-item"),O(Ye,"class","button primary"),O(Ye,"target","_blank"),fe(Ye,"display","inline-flex"),O(Ye,"href",yt=ia(i[2],i[0])),O(Pe,"class","file-details-item"),O(s,"class","file-details"),O(e,"class","record-edit-file-preview")},m(Ke,Ut){A(Ke,e,Ut),v(e,t),Y(n,t,null),v(e,r),v(e,s),v(s,o),v(o,l),v(o,a),v(o,c),v(c,h),v(s,f),v(s,d),v(d,m),v(d,p),v(d,g),v(g,w),v(s,S),v(s,_),v(_,k),v(_,Q),v(_,x),v(x,M),v(s,$),Qt&&Qt.m(s,null),v(s,N),v(s,B),v(B,J),v(B,te),v(B,ie),v(ie,X),v(ie,ee),v(s,Te),v(s,ve),v(ve,Ue),v(ve,ne),v(ve,Ee),v(Ee,xt),v(s,H),v(s,Pe),v(Pe,Ye),v(Ye,Tt),wt=!0},p(Ke,Ut){const ct={};Ut&1&&(ct.record=Ke[0]),n.$set(ct),(!wt||Ut&1)&&u!==(u=Ke[0]._file.path+"")&&K(h,u),(!wt||Ut&1)&&b!==(b=Ke[0]._file.originalName+"")&&K(w,b),(!wt||Ut&1)&&C!==(C=Ke[0]._file.mime+"")&&K(M,C),Ke[0]._file.width?Qt?Qt.p(Ke,Ut):(Qt=qg(Ke),Qt.c(),Qt.m(s,N)):Qt&&(Qt.d(1),Qt=null),(!wt||Ut&1)&&le!==(le=(Ke[0]._file.size/1024).toFixed(1)+"")&&K(X,le),(!wt||Ut&1)&&Re!==(Re=Ke[0]._file.checksum+"")&&K(xt,Re),(!wt||Ut&1&&yt!==(yt=ia(Ke[2],Ke[0])))&&O(Ye,"href",yt)},i(Ke){wt||(T(n.$$.fragment,Ke),wt=!0)},o(Ke){R(n.$$.fragment,Ke),wt=!1},d(Ke){Ke&&P(e),z(n),Qt&&Qt.d()}}}function qg(i){let e,t,n,r,s=i[0]._file.width+"",o,l,a=i[0]._file.height+"",c;return{c(){e=y("div"),t=y("span"),t.textContent="Dimensions",n=D(),r=y("span"),o=W(s),l=W("x"),c=W(a),O(t,"class","text-muted"),O(e,"class","file-details-item")},m(u,h){A(u,e,h),v(e,t),v(e,n),v(e,r),v(r,o),v(r,l),v(r,c)},p(u,h){h&1&&s!==(s=u[0]._file.width+"")&&K(o,s),h&1&&a!==(a=u[0]._file.height+"")&&K(c,a)},d(u){u&&P(e)}}}function mT(i){let e,t,n=i[1].type==="files"&&jg(i);return{c(){n&&n.c(),e=De()},m(r,s){n&&n.m(r,s),A(r,e,s),t=!0},p(r,[s]){r[1].type==="files"?n?(n.p(r,s),s&2&&T(n,1)):(n=jg(r),n.c(),T(n,1),n.m(e.parentNode,e)):n&&(me(),R(n,1,1,()=>{n=null}),pe())},i(r){t||(T(n),t=!0)},o(r){R(n),t=!1},d(r){r&&P(e),n&&n.d(r)}}}function pT(i,e,t){const n=je("channel");let{record:r}=e,{schema:s}=e;return i.$$set=o=>{"record"in o&&t(0,r=o.record),"schema"in o&&t(1,s=o.schema)},[r,s,n]}class gT extends oe{constructor(e){super(),se(this,e,pT,mT,re,{record:0,schema:1})}}function OT(i){let e;return{c(){e=W("New Record")},m(t,n){A(t,e,n)},p:U,d(t){t&&P(e)}}}function bT(i){let e=i[1].data.name+"",t;return{c(){t=W(e)},m(n,r){A(n,t,r)},p(n,r){r&2&&e!==(e=n[1].data.name+"")&&K(t,e)},d(n){n&&P(t)}}}function vT(i){let e,t,n=i[0].label.toUpperCase()+"",r,s,o,l;function a(h,f){return h[2]?OT:bT}let c=a(i),u=c(i);return{c(){e=y("div"),t=y("a"),r=W(n),o=D(),l=y("span"),u.c(),O(t,"class","schema-name"),O(t,"href",s=i[3].lucentUrl+"/content/"+i[0].name),O(l,"class","record-title"),O(e,"class","record-header")},m(h,f){A(h,e,f),v(e,t),v(t,r),v(e,o),v(e,l),u.m(l,null)},p(h,[f]){f&1&&n!==(n=h[0].label.toUpperCase()+"")&&K(r,n),f&1&&s!==(s=h[3].lucentUrl+"/content/"+h[0].name)&&O(t,"href",s),c===(c=a(h))&&u?u.p(h,f):(u.d(1),u=c(h),u&&(u.c(),u.m(l,null)))},i:U,o:U,d(h){h&&P(e),u.d()}}}function wT(i,e,t){const n=je("channel");let{schema:r}=e,{record:s}=e,{isCreateMode:o}=e;return i.$$set=l=>{"schema"in l&&t(0,r=l.schema),"record"in l&&t(1,s=l.record),"isCreateMode"in l&&t(2,o=l.isCreateMode)},[r,s,o,n]}class Dy extends oe{constructor(e){super(),se(this,e,wT,vT,re,{schema:0,record:1,isCreateMode:2})}}function Gg(i,e,t){const n=i.slice();return n[24]=e[t],n}function yT(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=` - Save`,O(e,"type","button"),O(e,"class","button primary ms-2 btn btn-primary btn-spinner")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[10]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function kT(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=` - Create`,O(e,"class","button primary btn-spinner")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[10]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function Hg(i){let e,t,n,r;function s(a){i[14](a)}function o(a){i[15](a)}let l={field:i[24],schema:i[2],record:i[0],validationErrors:i[4],isCreateMode:i[3]};return i[0].data!==void 0&&(l.data=i[0].data),i[1]!==void 0&&(l.graph=i[1]),e=new gP({props:l}),Se.push(()=>He(e,"data",s)),Se.push(()=>He(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&4&&(u.schema=a[2]),c&1&&(u.record=a[0]),c&16&&(u.validationErrors=a[4]),c&8&&(u.isCreateMode=a[3]),!t&&c&1&&(t=!0,u.data=a[0].data,nt(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],nt(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function Kg(i,e){let t,n,r,s=e[5]===e[24].group&&Hg(e);return{key:i,first:null,c(){t=De(),s&&s.c(),n=De(),this.first=t},m(o,l){A(o,t,l),s&&s.m(o,l),A(o,n,l),r=!0},p(o,l){e=o,e[5]===e[24].group?s?(s.p(e,l),l&32&&T(s,1)):(s=Hg(e),s.c(),T(s,1),s.m(n.parentNode,n)):s&&(me(),R(s,1,1,()=>{s=null}),pe())},i(o){r||(T(s),r=!0)},o(o){R(s),r=!1},d(o){o&&(P(t),P(n)),s&&s.d(o)}}}function ST(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w=[],S=new Map,_,k,Q;function x(X){i[11](X)}function C(X){i[12](X)}let M={schema:i[2],isCreateMode:i[3]};i[0]!==void 0&&(M.record=i[0]),i[5]!==void 0&&(M.activeContentTab=i[5]),n=new wy({props:M}),Se.push(()=>He(n,"record",x)),Se.push(()=>He(n,"activeContentTab",C));function $(X,ee){if(X[3])return kT;if(X[6])return yT}let N=$(i),B=N&&N(i);a=new Dy({props:{schema:i[2],record:i[0],isCreateMode:i[3]}}),u=new Ma({props:{message:i[7]}});function J(X){i[13](X)}let te={schema:i[2],isCreateMode:i[3]};i[5]!==void 0&&(te.active=i[5]),d=new yy({props:te}),Se.push(()=>He(d,"active",J)),g=new gT({props:{record:i[0],schema:i[2]}});let ie=ue(i[8]);const le=X=>X[24].name;for(let X=0;Xr=!1)),!s&&ee&32&&(s=!0,Te.activeContentTab=X[5],nt(()=>s=!1)),n.$set(Te),N===(N=$(X))&&B?B.p(X,ee):(B&&B.d(1),B=N&&N(X),B&&(B.c(),B.m(t,null)));const ve={};ee&4&&(ve.schema=X[2]),ee&1&&(ve.record=X[0]),ee&8&&(ve.isCreateMode=X[3]),a.$set(ve);const Ue={};ee&128&&(Ue.message=X[7]),u.$set(Ue);const ne={};ee&4&&(ne.schema=X[2]),ee&8&&(ne.isCreateMode=X[3]),!m&&ee&32&&(m=!0,ne.active=X[5],nt(()=>m=!1)),d.$set(ne);const Ee={};ee&1&&(Ee.record=X[0]),ee&4&&(Ee.schema=X[2]),g.$set(Ee),ee&319&&(ie=ue(X[8]),me(),w=di(w,ee,le,1,X,ie,S,f,mr,Kg,null,Gg),pe())},i(X){if(!_){T(n.$$.fragment,X),T(a.$$.fragment,X),T(u.$$.fragment,X),T(d.$$.fragment,X),T(g.$$.fragment,X);for(let ee=0;eeM.name!=="id"),p="_default";l.fields.reduce((M,$)=>$.ui==="tab"?(p=$.name,M):(M[p]=[...M[p]??[],$.name],M),[]),Ti(()=>{g()});function g(){h={data:JSON.parse(JSON.stringify(a.data)),schema:a.schema,status:a.status,edges:JSON.parse(JSON.stringify(c.edges))}}cy(()=>{t(6,d=w())});function b(M){return d?M.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete M.returnValue,"...")}function w(){return u?!1:!na(h,{data:a.data,schema:a.schema,status:a.status,edges:c.edges})}function S(M){return M.preventDefault(),console.log("SAVE: Attempt"),t(4,n=null),t(7,r=""),new Promise(function($,N){var B;if(!d&&!u){$(null);return}if(!a){$(null);return}t(1,c.edges=((B=c.edges)==null?void 0:B.filter(J=>!J._isTrashed&&J.source===a.id))??[],c),Jn(s.lucentUrl+"/records",{record:a,edges:c.edges,isCreateMode:u}).then(function(J){console.log("SAVE: SAVED INLINE"),t(0,a=J.records[0]),t(1,c=J),u||g(),o("inlinesaved",{records:[a]}),$(null)}).catch(function(J){J.response&&(typeof J.response.data.error=="string"?t(7,r=J.response.data.error):t(4,n=J.response.data.error)),$(null)})})}function _(M){a=M,t(0,a)}function k(M){f=M,t(5,f)}function Q(M){f=M,t(5,f)}function x(M){i.$$.not_equal(a.data,M)&&(a.data=M,t(0,a))}function C(M){c=M,t(1,c)}return i.$$set=M=>{"schema"in M&&t(2,l=M.schema),"record"in M&&t(0,a=M.record),"graph"in M&&t(1,c=M.graph),"isCreateMode"in M&&t(3,u=M.isCreateMode)},i.$$.update=()=>{i.$$.dirty&16&&t(7,r=n?`Record submission failed. ${Object.entries(n).length} error(s)`:null)},t(4,n=null),[a,c,l,u,n,f,d,r,m,b,S,_,k,Q,x,C]}class CT extends oe{constructor(e){super(),se(this,e,_T,ST,re,{schema:2,record:0,graph:1,isCreateMode:3})}}function Jg(i,e,t){const n=i.slice();return n[11]=e[t],n}function eO(i){let e=[],t=new Map,n,r=ue(i[2]);const s=l=>l[11].id;for(let l=0;l{Qa(r.lucentUrl+"/records/suggestions",{params:{schema:l.collections[0],field:"search",value:a,ui:"search"}}).then(p=>{t(2,n=p)}).catch(p=>{t(2,n=[]),console.log(p)})},500);function u(m,p){m.preventDefault(),t(5,o=p.id),s("addFilter"),t(5,o="")}function h(){a=this.value,t(1,a)}const f=(m,p)=>u(p,m),d=(m,p)=>u(p,m);return i.$$set=m=>{"value"in m&&t(5,o=m.value),"field"in m&&t(0,l=m.field)},t(2,n=[]),[l,a,n,c,u,o,h,f,d]}class xT extends oe{constructor(e){super(),se(this,e,AT,PT,re,{value:5,field:0})}}function iO(i,e,t){const n=i.slice();return n[39]=e[t],n}function rO(i,e,t){const n=i.slice();return n[42]=e[t],n}function sO(i,e,t){const n=i.slice();return n[39]=e[t],n}function oO(i){let e,t,n,r,s,o,l,a;t=new Ot({props:{icon:"arrow-left"}});let c=ue(i[9]),u=[];for(let h=0;hHe(h,"value",g)),h.$on("addFilter",i[14]),{c(){e=y("button"),V(t.$$.fragment),n=W(` - Back`),r=D(),s=y("div"),o=W("field: "),a=W(l),c=D(),u=y("div"),V(h.$$.fragment),O(e,"class","dropdown-item button"),O(s,"class","selected-filter"),O(u,"class","mt-2")},m(w,S){A(w,e,S),Y(t,e,null),v(e,n),A(w,r,S),A(w,s,S),v(s,o),v(s,a),A(w,c,S),A(w,u,S),Y(h,u,null),d=!0,m||(p=G(e,"click",i[31]),m=!0)},p(w,S){(!d||S[0]&16)&&l!==(l=w[4].label+"")&&K(a,l);const _={};S[0]&16&&(_.field=w[4]),!f&&S[0]&4&&(f=!0,_.value=w[2],nt(()=>f=!1)),h.$set(_)},i(w){d||(T(t.$$.fragment,w),T(h.$$.fragment,w),d=!0)},o(w){R(t.$$.fragment,w),R(h.$$.fragment,w),d=!1},d(w){w&&(P(e),P(r),P(s),P(c),P(u)),z(t),z(h),m=!1,p()}}}function TT(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k,Q,x,C,M,$,N=!i[3]&&oO(i),B=i[3]&&!i[5]&&aO(i),J=i[3]&&i[5]&&uO(i),te=!i[4]&&hO(i),ie=i[4]&&dO(i);return b=new Ot({props:{icon:"arrow-left"}}),{c(){e=y("div"),t=y("button"),t.textContent="Filter by field",n=D(),r=y("button"),r.textContent="Filter by Reference",s=D(),o=y("button"),o.textContent="Advanced filter",l=D(),a=y("div"),N&&N.c(),c=D(),B&&B.c(),u=D(),J&&J.c(),h=D(),f=y("div"),te&&te.c(),d=D(),ie&&ie.c(),m=D(),p=y("div"),g=y("button"),V(b.$$.fragment),w=W(` - Back`),S=D(),_=y("form"),k=y("input"),Q=D(),x=y("button"),x.textContent="Submit",O(t,"class","dropdown-item button"),O(r,"class","dropdown-item button"),O(o,"class","dropdown-item button"),Ae(e,"hide",i[6]!=="main"),Ae(a,"hide",i[6]!=="byField"),Ae(f,"hide",i[6]!=="byReference"),O(g,"class","dropdown-item button"),O(k,"type","search"),O(k,"class","mb-2 mt-2"),O(k,"placeholder","Advanced filters"),k.required=!0,O(x,"class","button applied-filter"),Ae(p,"hide",i[6]!=="advanced")},m(le,X){A(le,e,X),v(e,t),v(e,n),v(e,r),v(e,s),v(e,o),A(le,l,X),A(le,a,X),N&&N.m(a,null),v(a,c),B&&B.m(a,null),v(a,u),J&&J.m(a,null),A(le,h,X),A(le,f,X),te&&te.m(f,null),v(f,d),ie&&ie.m(f,null),A(le,m,X),A(le,p,X),v(p,g),Y(b,g,null),v(g,w),v(p,S),v(p,_),v(_,k),Ie(k,i[1]),v(_,Q),v(_,x),C=!0,M||($=[G(t,"click",i[20]),G(r,"click",i[21]),G(o,"click",i[22]),G(g,"click",i[33]),G(k,"input",i[34]),G(_,"submit",i[8])],M=!0)},p(le,X){(!C||X[0]&64)&&Ae(e,"hide",le[6]!=="main"),le[3]?N&&(me(),R(N,1,1,()=>{N=null}),pe()):N?(N.p(le,X),X[0]&8&&T(N,1)):(N=oO(le),N.c(),T(N,1),N.m(a,c)),le[3]&&!le[5]?B?(B.p(le,X),X[0]&40&&T(B,1)):(B=aO(le),B.c(),T(B,1),B.m(a,u)):B&&(me(),R(B,1,1,()=>{B=null}),pe()),le[3]&&le[5]?J?(J.p(le,X),X[0]&40&&T(J,1)):(J=uO(le),J.c(),T(J,1),J.m(a,null)):J&&(me(),R(J,1,1,()=>{J=null}),pe()),(!C||X[0]&64)&&Ae(a,"hide",le[6]!=="byField"),le[4]?te&&(me(),R(te,1,1,()=>{te=null}),pe()):te?(te.p(le,X),X[0]&16&&T(te,1)):(te=hO(le),te.c(),T(te,1),te.m(f,d)),le[4]?ie?(ie.p(le,X),X[0]&16&&T(ie,1)):(ie=dO(le),ie.c(),T(ie,1),ie.m(f,null)):ie&&(me(),R(ie,1,1,()=>{ie=null}),pe()),(!C||X[0]&64)&&Ae(f,"hide",le[6]!=="byReference"),X[0]&2&&k.value!==le[1]&&Ie(k,le[1]),(!C||X[0]&64)&&Ae(p,"hide",le[6]!=="advanced")},i(le){C||(T(N),T(B),T(J),T(te),T(ie),T(b.$$.fragment,le),C=!0)},o(le){R(N),R(B),R(J),R(te),R(ie),R(b.$$.fragment,le),C=!1},d(le){le&&(P(e),P(l),P(a),P(h),P(f),P(m),P(p)),N&&N.d(),B&&B.d(),J&&J.d(),te&&te.d(),ie&&ie.d(),z(b),M=!1,ut($)}}}function QT(i){let e,t,n,r,s;return t=new Ot({props:{icon:"filter"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),r=y("span"),r.textContent="Filter",O(r,"class","ms-1"),O(e,"slot","button")},m(o,l){A(o,e,l),Y(t,e,null),v(e,n),v(e,r),s=!0},p:U,i(o){s||(T(t.$$.fragment,o),s=!0)},o(o){R(t.$$.fragment,o),s=!1},d(o){o&&P(e),z(t)}}}function MT(i){let e,t,n,r={$$slots:{button:[QT],default:[TT]},$$scope:{ctx:i}};return t=new Gi({props:r}),i[35](t),{c(){e=y("div"),V(t.$$.fragment)},m(s,o){A(s,e,o),Y(t,e,null),n=!0},p(s,o){const l={};o[0]&254|o[1]&65536&&(l.$$scope={dirty:o,ctx:s}),t.$set(l)},i(s){n||(T(t.$$.fragment,s),n=!0)},o(s){R(t.$$.fragment,s),n=!1},d(s){s&&P(e),i[35](null),z(t)}}}function ET(i,e,t){const n=nn();let{schema:r}=e,{systemFields:s=[]}=e,{operators:o}=e,{inModal:l}=e,{modalUrl:a}=e,c,u="",h=s;r.type==="collection"&&(h=s.filter(H=>H.files===!1));function f(H){H.preventDefault();let Pe=u.split("=")[0]??"";if(!Pe)return;let Ye=`filter[${Pe}]`,Tt=u.split("=")[1]??"";if(!Tt)return;const yt=new URL(a??window.location.href);yt.searchParams.set("skip","0"),yt.searchParams.set(Ye,Tt),l?n("refresh",yt):window.location.replace(yt),M()}let d=null,m=null,p=null,g=null,b="main",w=null,S=[...r.fields,...h].filter(H=>{var Pe;return!["file","json","reference"].includes(((Pe=H.info)==null?void 0:Pe.name)??H.ui)}),_=[...r.fields].filter(H=>{var Pe;return["reference"].includes(((Pe=H.info)==null?void 0:Pe.name)??H.ui)});function k(H,Pe){t(3,m=Pe),t(7,w=o.filter(Ye=>{var Tt;return Ye.uis.includes((Tt=m==null?void 0:m.info)==null?void 0:Tt.name)||Ye.uis[0]==="*"}))}function Q(H,Pe){t(4,p=Pe),t(5,g=o.find(Ye=>Ye.name==="eq"))}function x(H,Pe){t(5,g=Pe),Pe.hasValue||C(H)}function C(H){H.preventDefault();let Pe="",Ye,Tt=m??p;r.fields.find(wt=>wt.name===Tt.name)&&(Tt.info.name==="reference"&&g.name==="eq"?(Pe="children."+Tt.name+".id",Ye=`filter[${Pe}]`):(Pe="data.",Ye=`filter[${Pe+Tt.name}_${g.name}]`));const yt=new URL(a??window.location.href);yt.searchParams.set("skip","0"),yt.searchParams.set(Ye,d),l?(n("refresh",yt),c.close()):window.location.href=yt.toString(),M()}function M(){t(3,m=null),t(5,g=null),t(6,b="main"),t(4,p=null)}const $=H=>t(6,b="byField"),N=H=>t(6,b="byReference"),B=H=>t(6,b="advanced"),J=H=>t(6,b="main"),te=(H,Pe)=>k(Pe,H),ie=H=>t(3,m=null),le=(H,Pe)=>x(Pe,H),X=H=>t(5,g=null);function ee(){d=this.value,t(2,d)}const Te=H=>t(6,b="main"),ve=(H,Pe)=>Q(Pe,H),Ue=H=>t(4,p=null);function ne(H){d=H,t(2,d)}const Ee=H=>t(6,b="main");function Re(){u=this.value,t(1,u)}function xt(H){Se[H?"unshift":"push"](()=>{c=H,t(0,c)})}return i.$$set=H=>{"schema"in H&&t(15,r=H.schema),"systemFields"in H&&t(16,s=H.systemFields),"operators"in H&&t(17,o=H.operators),"inModal"in H&&t(18,l=H.inModal),"modalUrl"in H&&t(19,a=H.modalUrl)},[c,u,d,m,p,g,b,w,f,S,_,k,Q,x,C,r,s,o,l,a,$,N,B,J,te,ie,le,X,ee,Te,ve,Ue,ne,Ee,Re,xt]}class RT extends oe{constructor(e){super(),se(this,e,ET,MT,re,{schema:15,systemFields:16,operators:17,inModal:18,modalUrl:19},null,[-1,-1])}}function mO(i,e,t){const n=i.slice();return n[18]=e[t],n}function pO(i,e,t){const n=i.slice();return n[18]=e[t],n}function gO(i){let e,t,n,r,s,o,l,a,c,u,h=i[18].label+"",f,d,m,p;n=new Ot({props:{icon:"arrow-up-short-wide"}});function g(...S){return i[10](i[18],...S)}l=new Ot({props:{icon:"arrow-down-wide-short"}});function b(...S){return i[11](i[18],...S)}function w(...S){return i[12](i[18],...S)}return{c(){e=y("div"),t=y("button"),V(n.$$.fragment),s=D(),o=y("button"),V(l.$$.fragment),c=D(),u=y("button"),f=W(h),O(t,"title","Sort Ascending"),O(t,"class",r="button button-icon "+(i[18].name==i[1].name&&!i[0].startsWith("-")?"active":"")),O(o,"title","Sort Descending"),O(o,"class",a="button button-icon "+(i[18].name==i[1].name&&i[0].startsWith("-")?"active":"")),O(u,"title","Sort Ascending"),O(u,"class","button"),O(e,"class","dropdown-item")},m(S,_){A(S,e,_),v(e,t),Y(n,t,null),v(e,s),v(e,o),Y(l,o,null),v(e,c),v(e,u),v(u,f),d=!0,m||(p=[G(t,"click",g),G(o,"click",b),G(u,"click",w)],m=!0)},p(S,_){i=S,(!d||_&11&&r!==(r="button button-icon "+(i[18].name==i[1].name&&!i[0].startsWith("-")?"active":"")))&&O(t,"class",r),(!d||_&11&&a!==(a="button button-icon "+(i[18].name==i[1].name&&i[0].startsWith("-")?"active":"")))&&O(o,"class",a),(!d||_&8)&&h!==(h=i[18].label+"")&&K(f,h)},i(S){d||(T(n.$$.fragment,S),T(l.$$.fragment,S),d=!0)},o(S){R(n.$$.fragment,S),R(l.$$.fragment,S),d=!1},d(S){S&&P(e),z(n),z(l),m=!1,ut(p)}}}function OO(i){let e,t,n,r,s,o,l,a,c,u,h=i[18].label+"",f,d,m,p,g;n=new Ot({props:{icon:"arrow-up-short-wide"}});function b(..._){return i[13](i[18],..._)}l=new Ot({props:{icon:"arrow-down-wide-short"}});function w(..._){return i[14](i[18],..._)}function S(..._){return i[15](i[18],..._)}return{c(){e=y("div"),t=y("button"),V(n.$$.fragment),s=D(),o=y("button"),V(l.$$.fragment),c=D(),u=y("button"),f=W(h),d=D(),O(t,"title","Sort Ascending"),O(t,"class",r="button button-icon "+(i[18].name==i[0]?"active":"")),O(o,"title","Sort Descending"),O(o,"class",a="button button-icon "+("-"+i[18].name==i[0]?"active":"")),O(u,"title","Sort Ascending"),O(u,"class","button"),O(e,"class","dropdown-item")},m(_,k){A(_,e,k),v(e,t),Y(n,t,null),v(e,s),v(e,o),Y(l,o,null),v(e,c),v(e,u),v(u,f),v(e,d),m=!0,p||(g=[G(t,"click",b),G(o,"click",w),G(u,"click",S)],p=!0)},p(_,k){i=_,(!m||k&5&&r!==(r="button button-icon "+(i[18].name==i[0]?"active":"")))&&O(t,"class",r),(!m||k&5&&a!==(a="button button-icon "+("-"+i[18].name==i[0]?"active":"")))&&O(o,"class",a),(!m||k&4)&&h!==(h=i[18].label+"")&&K(f,h)},i(_){m||(T(n.$$.fragment,_),T(l.$$.fragment,_),m=!0)},o(_){R(n.$$.fragment,_),R(l.$$.fragment,_),m=!1},d(_){_&&P(e),z(n),z(l),p=!1,ut(g)}}}function DT(i){let e,t,n,r,s,o=ue(i[3]),l=[];for(let f=0;fR(l[f],1,1,()=>{l[f]=null});let c=ue(i[2]),u=[];for(let f=0;fR(u[f],1,1,()=>{u[f]=null});return{c(){e=y("div");for(let f=0;f{h[p]=null}),pe(),r=h[n],r||(r=h[n]=u[n](d),r.c()),T(r,1),r.m(e,s)),(!c||m&2)&&l!==(l=d[1].label+"")&&K(a,l)},i(d){c||(T(r),c=!0)},o(d){R(r),c=!1},d(d){d&&P(e),h[n].d()}}}function NT(i){let e,t;return e=new Gi({props:{$$slots:{button:[IT],default:[DT]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,[r]){const s={};r&8388623&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function ZT(i,e,t){let n,r;const s=nn();let{schema:o}=e,{sortParam:l}=e,{sortField:a}=e,{inModal:c}=e,{modalUrl:u}=e,{systemFields:h=[]}=e;function f(k){const Q=new URL(u??window.location.href);Q.searchParams.set("sort",k),c?s("refresh",Q):window.location=Q}function d(k,Q){k.preventDefault();let x=h.map(C=>C.name).includes(Q.name)?"":"data.";return f(x+Q.name)}function m(k,Q){k.preventDefault();let x=h.map(C=>C.name).includes(Q.name)?"":"data.";return f("-"+x+Q.name)}const p=(k,Q)=>d(Q,k),g=(k,Q)=>m(Q,k),b=(k,Q)=>d(Q,k),w=(k,Q)=>d(Q,k),S=(k,Q)=>m(Q,k),_=(k,Q)=>d(Q,k);return i.$$set=k=>{"schema"in k&&t(6,o=k.schema),"sortParam"in k&&t(0,l=k.sortParam),"sortField"in k&&t(1,a=k.sortField),"inModal"in k&&t(7,c=k.inModal),"modalUrl"in k&&t(8,u=k.modalUrl),"systemFields"in k&&t(9,h=k.systemFields)},i.$$.update=()=>{i.$$.dirty&64&&t(3,n=o.fields.filter(k=>!["reference","file","json","id","rich","markdown","block"].includes(k.info.name))),i.$$.dirty&512&&t(2,r=h),i.$$.dirty&576&&o.type==="collection"&&t(2,r=h.filter(k=>k.files===!1))},[l,a,r,n,d,m,o,c,u,h,p,g,b,w,S,_]}class BT extends oe{constructor(e){super(),se(this,e,ZT,NT,re,{schema:6,sortParam:0,sortField:1,inModal:7,modalUrl:8,systemFields:9})}}function WT(i){var c,u;let e=i[3].label+"",t,n,r=(((c=i[0].find(i[10]))==null?void 0:c.symbol)??"")+"",s,o,l=((u=i[0].find(i[11]))!=null&&u.hasValue?i[2]:"")+"",a;return{c(){t=W(e),n=D(),s=W(r),o=D(),a=W(l)},m(h,f){A(h,t,f),A(h,n,f),A(h,s,f),A(h,o,f),A(h,a,f)},p(h,f){var d,m;f&8&&e!==(e=h[3].label+"")&&K(t,e),f&9&&r!==(r=(((d=h[0].find(h[10]))==null?void 0:d.symbol)??"")+"")&&K(s,r),f&13&&l!==(l=((m=h[0].find(h[11]))!=null&&m.hasValue?h[2]:"")+"")&&K(a,l)},d(h){h&&(P(t),P(n),P(s),P(o),P(a))}}}function XT(i){let e=i[3].label+"",t,n,r=i[4].data.name+"",s;return{c(){t=W(e),n=W(" is "),s=W(r)},m(o,l){A(o,t,l),A(o,n,l),A(o,s,l)},p(o,l){l&8&&e!==(e=o[3].label+"")&&K(t,e)},d(o){o&&(P(t),P(n),P(s))}}}function FT(i){let e,t,n,r,s,o,l;function a(h,f){return h[3].isReference&&h[4]?XT:WT}let c=a(i),u=c(i);return r=new Ot({props:{width:12,height:12,icon:"close"}}),{c(){e=y("span"),u.c(),t=D(),n=y("button"),V(r.$$.fragment),O(n,"type","button"),O(n,"class","button-text"),O(n,"aria-label","Close"),O(e,"class","applied-filter")},m(h,f){A(h,e,f),u.m(e,null),v(e,t),v(e,n),Y(r,n,null),s=!0,o||(l=G(n,"click",Ln(i[12])),o=!0)},p(h,[f]){c===(c=a(h))&&u?u.p(h,f):(u.d(1),u=c(h),u&&(u.c(),u.m(e,t)))},i(h){s||(T(r.$$.fragment,h),s=!0)},o(h){R(r.$$.fragment,h),s=!1},d(h){h&&P(e),u.d(),z(r),o=!1,l()}}}function YT(i){return e=>{if(e.isReference)return e.operator="eq",e;const t=i.split("_");return e.operator=t[t.length-1]??"eq",e}}function zT(i,e){return t=>{let n="";t.isReference?n=e.split(".")[1]:n=e.replace("_"+t.operator,"");const r=i.fields.find(s=>s.name===n);return t.label=(r==null?void 0:r.label)??n,t}}function VT(i,e,t){const n=nn();let{schema:r}=e,{operators:s}=e,{key:o}=e,{value:l}=e,{inModal:a}=e,{modalUrl:c}=e,{graph:u}=e,h={label:"",operator:"",value:l,isReference:o.startsWith("children")};h=[YT(o),zT(r,o)].reduce((w,S)=>S(w),h);const f=d(u,l);function d(w,S){return h.isReference?w.records.find(_=>_.id===S):null}function m(w){let S=`filter[${w}]`;const _=new URL(c??window.location.href);_.searchParams.set("skip","0"),_.searchParams.delete(S),a?n("refresh",_):window.location.replace(_)}const p=w=>w.name===h.operator,g=w=>w.name===h.operator,b=()=>m(o);return i.$$set=w=>{"schema"in w&&t(6,r=w.schema),"operators"in w&&t(0,s=w.operators),"key"in w&&t(1,o=w.key),"value"in w&&t(2,l=w.value),"inModal"in w&&t(7,a=w.inModal),"modalUrl"in w&&t(8,c=w.modalUrl),"graph"in w&&t(9,u=w.graph)},[s,o,l,h,f,m,r,a,c,u,p,g,b]}class UT extends oe{constructor(e){super(),se(this,e,VT,FT,re,{schema:6,operators:0,key:1,value:2,inModal:7,modalUrl:8,graph:9})}}function jT(i){let e,t,n,r,s,o,l;return r=new Ot({props:{width:12,height:12,icon:"close"}}),{c(){e=y("span"),t=W(`Not linked + opacity: ${a-u*g}`}}function dg(i){let e,t,n,r,s,o,l;return{c(){e=y("div"),t=y("div"),t.textContent="Success",n=D(),r=y("div"),s=W(i[1]),O(t,"class","title"),O(r,"class","content"),O(e,"class","notice notice-success"),O(e,"role","alert")},m(a,c){x(a,e,c),b(e,t),b(e,n),b(e,r),b(r,s),l=!0},p(a,c){(!l||c&2)&&K(s,a[1])},i(a){l||(a&&As(()=>{l&&(o||(o=lu(e,hu,{duration:500},!0)),o.run(1))}),l=!0)},o(a){a&&(o||(o=lu(e,hu,{duration:500},!1)),o.run(0)),l=!1},d(a){a&&P(e),a&&o&&o.end()}}}function px(i){let e,t=i[0]&&dg(i);return{c(){t&&t.c(),e=Ie()},m(n,r){t&&t.m(n,r),x(n,e,r)},p(n,[r]){n[0]?t?(t.p(n,r),r&1&&T(t,1)):(t=dg(n),t.c(),T(t,1),t.m(e.parentNode,e)):t&&(Oe(),R(t,1,1,()=>{t=null}),be())},i(n){T(t)},o(n){R(t)},d(n){n&&P(e),t&&t.d(n)}}}function gx(i,e,t){let n,r;function s(o="Saved"){t(1,n=o),t(0,r=!0),setTimeout(function(){t(0,r=!1)},2e3)}return t(1,n="Saved"),t(0,r=!1),[r,n,s]}class ay extends oe{constructor(e){super(),se(this,e,gx,px,re,{show:2})}get show(){return this.$$.ctx[2]}}function Ox(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S,_,k,A,C,Q,M,L;t=new Ma({props:{message:i[2]}});let N={};return r=new ay({props:N}),i[8](r),l=new _i({props:{name:i[4].name}}),d=new uu({props:{label:"Update Name"}}),S=new uu({props:{label:"Update Email"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),V(r.$$.fragment),s=D(),o=y("h3"),V(l.$$.fragment),a=D(),c=y("form"),u=y("div"),h=y("input"),f=D(),V(d.$$.fragment),m=D(),p=y("form"),g=y("div"),v=y("input"),w=D(),V(S.$$.fragment),_=D(),k=y("div"),A=y("a"),C=W("Logout from this device"),O(o,"class","header-small mb-5"),O(h,"type","text"),O(h,"class","form-control mb-3"),O(h,"placeholder","Name"),h.required=!0,O(u,"class","input-group mb-5"),O(v,"type","email"),O(v,"class","form-control mb-3"),O(v,"placeholder","Email"),v.required=!0,O(g,"class","input-group mb-5"),O(A,"class","list-group-item list-group-item-action"),O(A,"href",i[5].lucentUrl+"/logout"),O(k,"class","list-group"),O(e,"class","wrapper-tiny")},m(B,J){x(B,e,J),Y(t,e,null),b(e,n),Y(r,e,null),b(e,s),b(e,o),Y(l,o,null),b(e,a),b(e,c),b(c,u),b(u,h),Le(h,i[0]),b(u,f),Y(d,u,null),b(e,m),b(e,p),b(p,g),b(g,v),Le(v,i[1]),b(g,w),Y(S,g,null),b(e,_),b(e,k),b(k,A),b(A,C),Q=!0,M||(L=[G(h,"input",i[9]),G(c,"submit",i[6]),G(v,"input",i[10]),G(p,"submit",i[7])],M=!0)},p(B,[J]){const te={};J&4&&(te.message=B[2]),t.$set(te);const ie={};r.$set(ie),J&1&&h.value!==B[0]&&Le(h,B[0]),J&2&&v.value!==B[1]&&Le(v,B[1])},i(B){Q||(T(t.$$.fragment,B),T(r.$$.fragment,B),T(l.$$.fragment,B),T(d.$$.fragment,B),T(S.$$.fragment,B),Q=!0)},o(B){R(t.$$.fragment,B),R(r.$$.fragment,B),R(l.$$.fragment,B),R(d.$$.fragment,B),R(S.$$.fragment,B),Q=!1},d(B){B&&P(e),z(t),i[8](null),z(r),z(l),z(d),z(S),M=!1,ht(L)}}}function bx(i,e,t){const n=Ue("user"),r=Ue("channel");let s=n.name,o=n.email,l="",a;function c(m){m.preventDefault(),t(2,l=""),Jn(r.lucentUrl+"/account/update-name",{name:s}).then(p=>{a.show()}).catch(p=>{var g;t(2,l=(g=p.response)==null?void 0:g.data.error),console.log({errorMessage:l})})}function u(m){m.preventDefault(),t(2,l=""),Jn(r.lucentUrl+"/account/update-email",{email:o}).then(p=>{a.show()}).catch(p=>{var g;t(2,l=(g=p.response)==null?void 0:g.data.error),console.log({errorMessage:l})})}function h(m){Ce[m?"unshift":"push"](()=>{a=m,t(3,a)})}function f(){s=this.value,t(0,s)}function d(){o=this.value,t(1,o)}return[s,o,l,a,n,r,c,u,h,f,d]}class vx extends oe{constructor(e){super(),se(this,e,bx,Ox,re,{})}}function wx(i){let e,t,n;const r=[{channel:i[3]},{title:i[0]},i[2]];var s=i[4][i[1]];function o(l,a){let c={};for(let u=0;u{z(c,1)}),be()}s?(t=Xr(s,o(l,a)),V(t.$$.fragment),T(t.$$.fragment,1),Y(t,e,null)):t=null}else if(s){const c=a&13?_o(r,[a&8&&{channel:l[3]},a&1&&{title:l[0]},a&4&&Co(l[2])]):{};t.$set(c)}},i(l){n||(t&&T(t.$$.fragment,l),n=!0)},o(l){t&&R(t.$$.fragment,l),n=!1},d(l){l&&P(e),t&&z(t)}}}function yx(i,e,t){const n={register:ix,login:ax,verify:hx,profile:vx};let{title:r}=e,{view:s}=e,{user:o}=e,{data:l}=e,{channel:a}=e;return Ql("channel",a),Ql("user",o),i.$$set=c=>{"title"in c&&t(0,r=c.title),"view"in c&&t(1,s=c.view),"user"in c&&t(5,o=c.user),"data"in c&&t(2,l=c.data),"channel"in c&&t(3,a=c.channel)},[r,s,l,a,n,o]}class kx extends oe{constructor(e){super(),se(this,e,yx,wx,re,{title:0,view:1,user:5,data:2,channel:3})}}const Sx=i=>({}),mg=i=>({});function _x(i){let e;return{c(){e=W("Dropdown")},m(t,n){x(t,e,n)},d(t){t&&P(e)}}}function Cx(i){let e,t,n,r,s,o,l,a;const c=i[6].button,u=Hl(c,i,i[5],mg),h=u||_x(),f=i[6].default,d=Hl(f,i,i[5],null);return{c(){e=y("div"),t=y("button"),h&&h.c(),n=D(),r=y("div"),d&&d.c(),O(t,"class","button dropdown-button"),O(t,"type","button"),O(t,"aria-expanded","false"),O(r,"class",s="dropdown-menu hide orientation-"+i[0]),O(e,"class","dropdown")},m(m,p){x(m,e,p),b(e,t),h&&h.m(t,null),b(e,n),b(e,r),d&&d.m(r,null),i[7](r),o=!0,l||(a=[G(t,"click",i[1]),mP(qA.call(null,r)),G(r,"click_outside",i[3])],l=!0)},p(m,[p]){u&&u.p&&(!o||p&32)&&Jl(u,c,m,m[5],o?Kl(c,m[5],p,Sx):ea(m[5]),mg),d&&d.p&&(!o||p&32)&&Jl(d,f,m,m[5],o?Kl(f,m[5],p,null):ea(m[5]),null),(!o||p&1&&s!==(s="dropdown-menu hide orientation-"+m[0]))&&O(r,"class",s)},i(m){o||(T(h,m),T(d,m),o=!0)},o(m){R(h,m),R(d,m),o=!1},d(m){m&&P(e),h&&h.d(m),d&&d.d(m),i[7](null),l=!1,ht(a)}}}function Px(i,e,t){let{$$slots:n={},$$scope:r}=e,s,{orientation:o="left"}=e;function l(){s.classList.remove("hide")}function a(){s.classList.add("hide")}function c(){s.classList.add("hide")}function u(h){Ce[h?"unshift":"push"](()=>{s=h,t(2,s)})}return i.$$set=h=>{"orientation"in h&&t(0,o=h.orientation),"$$scope"in h&&t(5,r=h.$$scope)},[o,l,s,c,a,r,n,u]}class ur extends oe{constructor(e){super(),se(this,e,Px,Cx,re,{orientation:0,open:1,close:4})}get open(){return this.$$.ctx[1]}get close(){return this.$$.ctx[4]}}function pg(i,e,t){const n=i.slice();return n[7]=e[t],n}function gg(i,e,t){const n=i.slice();return n[7]=e[t],n}function Og(i){let e,t=i[7]+"",n,r,s;function o(...l){return i[4](i[7],...l)}return{c(){e=y("button"),n=W(t),O(e,"class","dropdown-item button")},m(l,a){x(l,e,a),b(e,n),r||(s=G(e,"click",o),r=!0)},p(l,a){i=l,a&2&&t!==(t=i[7]+"")&&K(n,t)},d(l){l&&P(e),r=!1,s()}}}function bg(i){let e=i[0].roles.includes(i[7]),t,n=e&&Og(i);return{c(){n&&n.c(),t=Ie()},m(r,s){n&&n.m(r,s),x(r,t,s)},p(r,s){s&3&&(e=r[0].roles.includes(r[7])),e?n?n.p(r,s):(n=Og(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(r){r&&P(t),n&&n.d(r)}}}function vg(i){let e,t=i[7]+"",n,r,s,o;function l(...a){return i[5](i[7],...a)}return{c(){e=y("button"),n=W(t),r=D(),O(e,"class","dropdown-item button")},m(a,c){x(a,e,c),b(e,n),b(e,r),s||(o=G(e,"click",l),s=!0)},p(a,c){i=a,c&2&&t!==(t=i[7]+"")&&K(n,t)},d(a){a&&P(e),s=!1,o()}}}function wg(i){let e=!i[0].roles.includes(i[7]),t,n=e&&vg(i);return{c(){n&&n.c(),t=Ie()},m(r,s){n&&n.m(r,s),x(r,t,s)},p(r,s){s&3&&(e=!r[0].roles.includes(r[7])),e?n?n.p(r,s):(n=vg(r),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(r){r&&P(t),n&&n.d(r)}}}function Ax(i){let e,t,n,r,s,o,l=fe(i[1]),a=[];for(let h=0;h{v&&(g||(g=lu(e,hu,{duration:200},!0)),g.run(1))}),v=!0)},o(w){R(n.$$.fragment,w),R(p.$$.fragment,w),w&&(g||(g=lu(e,hu,{duration:200},!1)),g.run(0)),v=!1},d(w){w&&P(e),z(n),z(p),w&&g&&g.end()}}}function Qx(i,e,t){const n=nn();let{member:r}=e,{roles:s}=e;function o(u,h){u.preventDefault();let f=r.roles.filter(d=>d!==h);n("update",{user:r.id,roles:f})}function l(u,h){u.preventDefault();let f=[...r.roles,h];console.log(r.roles),console.log(h),console.log(f),n("update",{user:r.id,roles:f})}const a=(u,h)=>o(h,u),c=(u,h)=>l(h,u);return i.$$set=u=>{"member"in u&&t(0,r=u.member),"roles"in u&&t(1,s=u.roles)},[r,s,o,l,a,c]}class Mx extends oe{constructor(e){super(),se(this,e,Qx,Tx,re,{member:0,roles:1})}}function yg(i,e,t){const n=i.slice();return n[15]=e[t],n}function kg(i,e,t){const n=i.slice();return n[18]=e[t],n}function Sg(i){let e,t=i[18]+"",n;return{c(){e=y("option"),n=W(t),e.__value=i[18],Le(e,e.__value)},m(r,s){x(r,e,s),b(e,n)},p:U,d(r){r&&P(e)}}}function _g(i){let e,t;return e=new Mx({props:{member:i[15],roles:i[6].roles}}),e.$on("update",i[9]),e.$on("reinvite",i[14]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.member=n[15]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function Ex(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S,_,k,A,C,Q,M,L,N,B,J,te,ie;s=new Ma({props:{message:i[4]}});let ae={};l=new ay({props:ae}),i[10](l);let X=fe(i[6].roles.filter(Cg)),ee=[];for(let ne=0;neR(ve[ne],1,1,()=>{ve[ne]=null});return{c(){e=y("div"),t=y("div"),n=y("h3"),n.textContent="Invite people",r=D(),V(s.$$.fragment),o=D(),V(l.$$.fragment),a=D(),c=y("form"),u=y("div"),h=y("label"),h.textContent="Invitee Name",f=D(),d=y("input"),m=D(),p=y("div"),g=y("label"),g.textContent="Invitee Email Address",v=D(),w=y("input"),S=D(),_=y("div"),k=y("select");for(let ne=0;nei[13].call(k)),O(_,"class","me-3"),O(C,"class","mt-5 d-block text-center"),O(t,"class","lx-card mt-5"),O(N,"class","header-small mb-5 mt-5"),O(L,"class","member-list"),O(e,"class","common-wrapper")},m(ne,Ee){x(ne,e,Ee),b(e,t),b(t,n),b(t,r),Y(s,t,null),b(t,o),Y(l,t,null),b(t,a),b(t,c),b(c,u),b(u,h),b(u,f),b(u,d),Le(d,i[1]),b(c,m),b(c,p),b(p,g),b(p,v),b(p,w),Le(w,i[2]),b(c,S),b(c,_),b(_,k);for(let Re=0;Rei!=="removed";function Rx(i,e,t){const n=Ue("channel");let{users:r}=e,s,o,l,a="",c;function u(w){w.preventDefault(),h(s,o,l)}function h(w,S,_){t(4,a=""),Jn(n.lucentUrl+"/members/invite",{name:w,email:S,roles:[_]}).then(k=>{c.show("User was invited"),t(0,r=[...r,k.user]),t(1,s=null),t(2,o=null),t(3,l=null)}).catch(k=>{var A,C;t(4,a=((C=(A=k.response)==null?void 0:A.data)==null?void 0:C.error)??"")})}function f(w){w.preventDefault(),t(4,a=""),Jn(n.lucentUrl+"/members/update",{id:w.detail.user,roles:w.detail.roles}).then(S=>{c.show("Users updated"),t(0,r=S.users)}).catch(S=>{var _,k;t(4,a=((k=(_=S.response)==null?void 0:_.data)==null?void 0:k.error)??"")})}function d(w){Ce[w?"unshift":"push"](()=>{c=w,t(5,c)})}function m(){s=this.value,t(1,s)}function p(){o=this.value,t(2,o)}function g(){l=kP(this),t(3,l),t(6,n)}const v=w=>h(w.detail.email,w.detail.role);return i.$$set=w=>{"users"in w&&t(0,r=w.users)},[r,s,o,l,a,c,n,u,h,f,d,m,p,g,v]}class Dx extends oe{constructor(e){super(),se(this,e,Rx,Ex,re,{users:0})}}function $x(i){let e,t,n;return{c(){e=y("div"),t=y("div"),n=W(i[0]),O(t,"class","header-normal"),O(e,"class","wrapper-normal ")},m(r,s){x(r,e,s),b(e,t),b(t,n)},p(r,[s]){s&1&&K(n,r[0])},i:U,o:U,d(r){r&&P(e)}}}function Lx(i,e,t){let{title:n}=e;return i.$$set=r=>{"title"in r&&t(0,n=r.title)},[n]}class Ix extends oe{constructor(e){super(),se(this,e,Lx,$x,re,{title:0})}}function Nx(i){let e,t=i[5].path+"";return{c(){e=wP("svg"),O(e,"class","bi svelte-1coky4l"),O(e,"xmlns","http://www.w3.org/2000/svg"),O(e,"width",i[0]),O(e,"height",i[1]),O(e,"viewBox",i[5].viewBox),O(e,"aria-labelledby",i[2]),O(e,"role","presentation"),O(e,"stroke",i[4]),O(e,"fill",i[3])},m(n,r){x(n,e,r),e.innerHTML=t},p(n,[r]){r&1&&O(e,"width",n[0]),r&2&&O(e,"height",n[1]),r&4&&O(e,"aria-labelledby",n[2]),r&16&&O(e,"stroke",n[4]),r&8&&O(e,"fill",n[3])},i:U,o:U,d(n){n&&P(e)}}}function Zx(i,e,t){const n={"trash-can":{path:'',viewBox:"0 0 448 512"},"circle-chevron-down":{path:'',viewBox:"0 0 512 512"},"circle-chevron-up":{path:'',viewBox:"0 0 512 512"},ellipsis:{path:'',viewBox:"0 0 448 512"},"ellipsis-vertical":{path:'',viewBox:"0 0 128 512"},"angles-down":{path:'',viewBox:"0 0 384 512"},"angle-right":{path:'',viewBox:"0 0 256 512"},"photo-film":{path:'',viewBox:"0 0 640 512"},file:{path:'',viewBox:"0 0 384 512"},"circle-info":{path:'',viewBox:"0 0 512 512"},"table-columns":{path:'',viewBox:"0 0 512 512"},"arrow-down-a-z":{path:'',viewBox:"0 0 512 512"},"arrow-up-short-wide":{path:'',viewBox:"0 0 576 512"},"arrow-down-wide-short":{path:'',viewBox:"0 0 576 512"},filter:{path:'',viewBox:"0 0 512 512"},calendar:{path:'',viewBox:"0 0 448 512"},pencil:{path:'',viewBox:"0 0 512 512"},database:{path:'',viewBox:"0 0 448 512"},dice:{path:'',viewBox:"0 0 640 512"},"triangle-exclamation":{path:'',viewBox:"0 0 512 512"},eye:{path:'',viewBox:"0 0 576 512"},"circle-plus":{path:'',viewBox:"0 0 512 512"},"magnifying-glass":{path:'',viewBox:"0 0 512 512"},expand:{path:'',viewBox:"0 0 448 512"},compress:{path:'',viewBox:"0 0 448 512"},check:{path:'',viewBox:"0 0 448 512"},close:{path:'',viewBox:"0 0 24 24"},"arrow-left":{path:'',viewBox:"0 0 24 24"},list:{path:'',viewBox:"0 0 24 24"},"ordered-list":{path:'',viewBox:"0 0 24 24"},italic:{path:'',viewBox:"0 0 24 24"},upload:{path:' ',viewBox:"0 0 16 16"}};let{width:r=16}=e,{height:s=16}=e,{icon:o=""}=e,{fill:l="currentColor"}=e,{stroke:a="currentColor"}=e,c=n[o];return i.$$set=u=>{"width"in u&&t(0,r=u.width),"height"in u&&t(1,s=u.height),"icon"in u&&t(2,o=u.icon),"fill"in u&&t(3,l=u.fill),"stroke"in u&&t(4,a=u.stroke)},[r,s,o,l,a,c]}class ut extends oe{constructor(e){super(),se(this,e,Zx,Nx,re,{width:0,height:1,icon:2,fill:3,stroke:4})}}function Bx(i){let e,t,n;return{c(){e=y("input"),O(e,"type","checkbox"),e.value=i[0],O(e,"class","switch"),e.checked=i[1]},m(r,s){x(r,e,s),t||(n=G(e,"change",i[2]),t=!0)},p(r,[s]){s&1&&(e.value=r[0]),s&2&&(e.checked=r[1])},i:U,o:U,d(r){r&&P(e),t=!1,n()}}}function Wx(i,e,t){let{value:n}=e,{checked:r=!1}=e;function s(o){vs.call(this,i,o)}return i.$$set=o=>{"value"in o&&t(0,n=o.value),"checked"in o&&t(1,r=o.checked)},[n,r,s]}class Xx extends oe{constructor(e){super(),se(this,e,Wx,Bx,re,{value:0,checked:1})}}function Pg(i){let e,t;return e=new Xx({props:{value:"published",checked:i[0].status==="published"}}),e.$on("change",i[1]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.checked=n[0].status==="published"),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function Fx(i){let e;return{c(){e=W("Trashed")},m(t,n){x(t,e,n)},d(t){t&&P(e)}}}function Yx(i){let e;return{c(){e=W("Draft")},m(t,n){x(t,e,n)},d(t){t&&P(e)}}}function zx(i){let e;return{c(){e=W("Published")},m(t,n){x(t,e,n)},d(t){t&&P(e)}}}function Vx(i){let e,t,n,r=i[0].status!=="trashed"&&Pg(i);function s(a,c){if(a[0].status==="published")return zx;if(a[0].status==="draft")return Yx;if(a[0].status==="trashed")return Fx}let o=s(i),l=o&&o(i);return{c(){r&&r.c(),e=D(),l&&l.c(),t=Ie()},m(a,c){r&&r.m(a,c),x(a,e,c),l&&l.m(a,c),x(a,t,c),n=!0},p(a,[c]){a[0].status!=="trashed"?r?(r.p(a,c),c&1&&T(r,1)):(r=Pg(a),r.c(),T(r,1),r.m(e.parentNode,e)):r&&(Oe(),R(r,1,1,()=>{r=null}),be()),o!==(o=s(a))&&(l&&l.d(1),l=o&&o(a),l&&(l.c(),l.m(t.parentNode,t)))},i(a){n||(T(r),n=!0)},o(a){R(r),n=!1},d(a){a&&(P(e),P(t)),r&&r.d(a),l&&l.d(a)}}}function Ux(i,e,t){let{status:n="draft"}=e,{record:r}=e;function s(o){o.target.checked?t(2,n="published"):t(2,n="draft")}return i.$$set=o=>{"status"in o&&t(2,n=o.status),"record"in o&&t(0,r=o.record)},[r,s,n]}class jx extends oe{constructor(e){super(),se(this,e,Ux,Vx,re,{status:2,record:0})}}function Ag(i){let e,t;return e=new ur({props:{$$slots:{button:[Gx],default:[qx]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&270&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function xg(i){let e,t,n,r;return{c(){e=y("a"),t=W("Clone"),O(e,"class","dropdown-item"),O(e,"href",i[4].lucentUrl)},m(s,o){x(s,e,o),b(e,t),n||(r=G(e,"click",i[5]),n=!0)},p:U,d(s){s&&P(e),n=!1,r()}}}function qx(i){let e,t,n,r,s,o,l,a,c,u,h,f=!i[3]&&xg(i);return{c(){e=y("h6"),e.textContent="Record Actions",t=D(),n=y("a"),r=W("Create new"),o=D(),f&&f.c(),l=D(),a=y("a"),c=W("Revisions"),O(e,"class","dropdown-header"),O(n,"class","dropdown-item"),O(n,"href",s=i[4].lucentUrl+"/records/new?schema="+i[2].name),O(a,"class","dropdown-item"),O(a,"href",i[4].lucentUrl)},m(d,m){x(d,e,m),x(d,t,m),x(d,n,m),b(n,r),x(d,o,m),f&&f.m(d,m),x(d,l,m),x(d,a,m),b(a,c),u||(h=G(a,"click",Ln(i[6])),u=!0)},p(d,m){m&4&&s!==(s=d[4].lucentUrl+"/records/new?schema="+d[2].name)&&O(n,"href",s),d[3]?f&&(f.d(1),f=null):f?f.p(d,m):(f=xg(d),f.c(),f.m(l.parentNode,l))},d(d){d&&(P(e),P(t),P(n),P(o),P(l),P(a)),f&&f.d(d),u=!1,h()}}}function Gx(i){let e,t,n;return t=new ut({props:{icon:"ellipsis"}}),{c(){e=y("div"),V(t.$$.fragment),O(e,"slot","button")},m(r,s){x(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function Hx(i){let e,t,n,r,s,o=!i[3]&&Ag(i);function l(c){i[7](c)}let a={record:i[0]};return i[0].status!==void 0&&(a.status=i[0].status),n=new jx({props:a}),Ce.push(()=>nt(n,"status",l)),{c(){e=y("div"),o&&o.c(),t=D(),V(n.$$.fragment),le(e,"display","flex"),le(e,"align-items","center"),le(e,"gap","10px")},m(c,u){x(c,e,u),o&&o.m(e,null),b(e,t),Y(n,e,null),s=!0},p(c,[u]){c[3]?o&&(Oe(),R(o,1,1,()=>{o=null}),be()):o?(o.p(c,u),u&8&&T(o,1)):(o=Ag(c),o.c(),T(o,1),o.m(e,t));const h={};u&1&&(h.record=c[0]),!r&&u&1&&(r=!0,h.status=c[0].status,st(()=>r=!1)),n.$set(h)},i(c){s||(T(o),T(n.$$.fragment,c),s=!0)},o(c){R(o),R(n.$$.fragment,c),s=!1},d(c){c&&P(e),o&&o.d(),z(n)}}}function Kx(i,e,t){const n=Ue("channel");let{schema:r}=e,{record:s}=e,{isCreateMode:o}=e,{activeContentTab:l}=e;function a(h){h.preventDefault(),Jn(n.lucentUrl+"/records/clone/"+s.id).then(f=>{window.location=n.lucentUrl+"/records/"+f.id}).catch(f=>{})}const c=h=>t(1,l="_info");function u(h){i.$$.not_equal(s.status,h)&&(s.status=h,t(0,s))}return i.$$set=h=>{"schema"in h&&t(2,r=h.schema),"record"in h&&t(0,s=h.record),"isCreateMode"in h&&t(3,o=h.isCreateMode),"activeContentTab"in h&&t(1,l=h.activeContentTab)},[s,l,r,o,n,a,c,u]}class cy extends oe{constructor(e){super(),se(this,e,Kx,Hx,re,{schema:2,record:0,isCreateMode:3,activeContentTab:1})}}function Tg(i,e,t){const n=i.slice();return n[9]=e[t],n}function Qg(i){let e,t=fe(i[1]),n=[];for(let r=0;r1&&Qg(i);return{c(){t&&t.c(),e=Ie()},m(n,r){t&&t.m(n,r),x(n,e,r)},p(n,[r]){n[1].length>1?t?t.p(n,r):(t=Qg(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(n){n&&P(e),t&&t.d(n)}}}function e3(i,e,t){var f;let{schema:n}=e,{isCreateMode:r}=e,{active:s=""}=e,o=((f=n.groups)==null?void 0:f.map(d=>({label:d,name:d})))??[],l={label:"Main",name:""},a={label:"Backlinks",name:"_graph"};r?o=[l,...o]:o=[l,...o,a];function c(d){d.preventDefault(),t(0,s="_graph")}function u(d,m){d.preventDefault(),m=="_graph"?c(d):t(0,s=m)}const h=(d,m)=>u(m,d.name);return i.$$set=d=>{"schema"in d&&t(3,n=d.schema),"isCreateMode"in d&&t(4,r=d.isCreateMode),"active"in d&&t(0,s=d.active)},[s,o,u,n,r,h]}class uy extends oe{constructor(e){super(),se(this,e,e3,Jx,re,{schema:3,isCreateMode:4,active:0})}}function In(i,e){return i&&i[e]?i[e].message:null}function hr(i){return Array.isArray?Array.isArray(i):dy(i)==="[object Array]"}function t3(i){if(typeof i=="string")return i;let e=i+"";return e=="0"&&1/i==-1/0?"-0":e}function n3(i){return i==null?"":t3(i)}function Wi(i){return typeof i=="string"}function hy(i){return typeof i=="number"}function i3(i){return i===!0||i===!1||r3(i)&&dy(i)=="[object Boolean]"}function fy(i){return typeof i=="object"}function r3(i){return fy(i)&&i!==null}function Un(i){return i!=null}function Dh(i){return!i.trim().length}function dy(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(i)}const s3="Incorrect 'index' type",o3=i=>`Invalid value for key ${i}`,l3=i=>`Pattern length exceeds max of ${i}.`,a3=i=>`Missing ${i} property in key`,c3=i=>`Property 'weight' in key '${i}' must be a positive integer`,Eg=Object.prototype.hasOwnProperty;class u3{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{let r=my(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function my(i){let e=null,t=null,n=null,r=1,s=null;if(Wi(i)||hr(i))n=i,e=Rg(i),t=hd(i);else{if(!Eg.call(i,"name"))throw new Error(a3("name"));const o=i.name;if(n=o,Eg.call(i,"weight")&&(r=i.weight,r<=0))throw new Error(c3(o));e=Rg(o),t=hd(o),s=i.getFn}return{path:e,id:t,weight:r,src:n,getFn:s}}function Rg(i){return hr(i)?i:i.split(".")}function hd(i){return hr(i)?i.join("."):i}function h3(i,e){let t=[],n=!1;const r=(s,o,l)=>{if(Un(s))if(!o[l])t.push(s);else{let a=o[l];const c=s[a];if(!Un(c))return;if(l===o.length-1&&(Wi(c)||hy(c)||i3(c)))t.push(n3(c));else if(hr(c)){n=!0;for(let u=0,h=c.length;ui.score===e.score?i.idx{this._keysMap[t.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Wi(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){const t=this.size();Wi(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t{let o=r.getFn?r.getFn(e):this.getFn(e,r.path);if(Un(o)){if(hr(o)){let l=[];const a=[{nestedArrIndex:-1,value:o}];for(;a.length;){const{nestedArrIndex:c,value:u}=a.pop();if(Un(u))if(Wi(u)&&!Dh(u)){let h={v:u,i:c,n:this.norm.get(u)};l.push(h)}else hr(u)&&u.forEach((h,f)=>{a.push({nestedArrIndex:f,value:h})})}n.$[s]=l}else if(Wi(o)&&!Dh(o)){let l={v:o,n:this.norm.get(o)};n.$[s]=l}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function py(i,e,{getFn:t=Be.getFn,fieldNormWeight:n=Be.fieldNormWeight}={}){const r=new Ym({getFn:t,fieldNormWeight:n});return r.setKeys(i.map(my)),r.setSources(e),r.create(),r}function b3(i,{getFn:e=Be.getFn,fieldNormWeight:t=Be.fieldNormWeight}={}){const{keys:n,records:r}=i,s=new Ym({getFn:e,fieldNormWeight:t});return s.setKeys(n),s.setIndexRecords(r),s}function Ha(i,{errors:e=0,currentLocation:t=0,expectedLocation:n=0,distance:r=Be.distance,ignoreLocation:s=Be.ignoreLocation}={}){const o=e/i.length;if(s)return o;const l=Math.abs(n-t);return r?o+l/r:l?1:o}function v3(i=[],e=Be.minMatchCharLength){let t=[],n=-1,r=-1,s=0;for(let o=i.length;s=e&&t.push([n,r]),n=-1)}return i[s-1]&&s-n>=e&&t.push([n,s-1]),t}const ms=32;function w3(i,e,t,{location:n=Be.location,distance:r=Be.distance,threshold:s=Be.threshold,findAllMatches:o=Be.findAllMatches,minMatchCharLength:l=Be.minMatchCharLength,includeMatches:a=Be.includeMatches,ignoreLocation:c=Be.ignoreLocation}={}){if(e.length>ms)throw new Error(l3(ms));const u=e.length,h=i.length,f=Math.max(0,Math.min(n,h));let d=s,m=f;const p=l>1||a,g=p?Array(h):[];let v;for(;(v=i.indexOf(e,m))>-1;){let C=Ha(e,{currentLocation:v,expectedLocation:f,distance:r,ignoreLocation:c});if(d=Math.min(C,d),m=v+u,p){let Q=0;for(;Q=L;te-=1){let ie=te-1,ae=t[i.charAt(ie)];if(p&&(g[ie]=+!!ae),B[te]=(B[te+1]<<1|1)&ae,C&&(B[te]|=(w[te+1]|w[te])<<1|1|w[te+1]),B[te]&k&&(S=Ha(e,{errors:C,currentLocation:ie,expectedLocation:f,distance:r,ignoreLocation:c}),S<=d)){if(d=S,m=ie,m<=f)break;L=Math.max(1,2*f-m)}}if(Ha(e,{errors:C+1,currentLocation:f,expectedLocation:f,distance:r,ignoreLocation:c})>d)break;w=B}const A={isMatch:m>=0,score:Math.max(.001,S)};if(p){const C=v3(g,l);C.length?a&&(A.indices=C):A.isMatch=!1}return A}function y3(i){let e={};for(let t=0,n=i.length;t{this.chunks.push({pattern:f,alphabet:y3(f),startIndex:d})},h=this.pattern.length;if(h>ms){let f=0;const d=h%ms,m=h-d;for(;f{const{isMatch:v,score:w,indices:S}=w3(e,m,p,{location:r+g,distance:s,threshold:o,findAllMatches:l,minMatchCharLength:a,includeMatches:n,ignoreLocation:c});v&&(f=!0),h+=w,v&&S&&(u=[...u,...S])});let d={isMatch:f,score:f?h/this.chunks.length:1};return f&&n&&(d.indices=u),d}}class es{constructor(e){this.pattern=e}static isMultiMatch(e){return Dg(e,this.multiRegex)}static isSingleMatch(e){return Dg(e,this.singleRegex)}search(){}}function Dg(i,e){const t=i.match(e);return t?t[1]:null}class k3 extends es{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class S3 extends es{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class _3 extends es{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class C3 extends es{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class P3 extends es{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class A3 extends es{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class Oy extends es{constructor(e,{location:t=Be.location,threshold:n=Be.threshold,distance:r=Be.distance,includeMatches:s=Be.includeMatches,findAllMatches:o=Be.findAllMatches,minMatchCharLength:l=Be.minMatchCharLength,isCaseSensitive:a=Be.isCaseSensitive,ignoreLocation:c=Be.ignoreLocation}={}){super(e),this._bitapSearch=new gy(e,{location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:a,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class by extends es{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t=0,n;const r=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,t))>-1;)t=n+s,r.push([n,t-1]);const o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}const fd=[k3,by,_3,C3,A3,P3,S3,Oy],$g=fd.length,x3=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,T3="|";function Q3(i,e={}){return i.split(T3).map(t=>{let n=t.trim().split(x3).filter(s=>s&&!!s.trim()),r=[];for(let s=0,o=n.length;s!!(i[fu.AND]||i[fu.OR]),D3=i=>!!i[pd.PATH],$3=i=>!hr(i)&&fy(i)&&!gd(i),Lg=i=>({[fu.AND]:Object.keys(i).map(e=>({[e]:i[e]}))});function vy(i,e,{auto:t=!0}={}){const n=r=>{let s=Object.keys(r);const o=D3(r);if(!o&&s.length>1&&!gd(r))return n(Lg(r));if($3(r)){const a=o?r[pd.PATH]:s[0],c=o?r[pd.PATTERN]:r[a];if(!Wi(c))throw new Error(o3(a));const u={keyId:hd(a),pattern:c};return t&&(u.searcher=md(c,e)),u}let l={children:[],operator:s[0]};return s.forEach(a=>{const c=r[a];hr(c)&&c.forEach(u=>{l.children.push(n(u))})}),l};return gd(i)||(i=Lg(i)),n(i)}function L3(i,{ignoreFieldNorm:e=Be.ignoreFieldNorm}){i.forEach(t=>{let n=1;t.matches.forEach(({key:r,norm:s,score:o})=>{const l=r?r.weight:null;n*=Math.pow(o===0&&l?Number.EPSILON:o,(l||1)*(e?1:s))}),t.score=n})}function I3(i,e){const t=i.matches;e.matches=[],Un(t)&&t.forEach(n=>{if(!Un(n.indices)||!n.indices.length)return;const{indices:r,value:s}=n;let o={indices:r,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function N3(i,e){e.score=i.score}function Z3(i,e,{includeMatches:t=Be.includeMatches,includeScore:n=Be.includeScore}={}){const r=[];return t&&r.push(I3),n&&r.push(N3),i.map(s=>{const{idx:o}=s,l={item:e[o],refIndex:o};return r.length&&r.forEach(a=>{a(s,l)}),l})}class Wo{constructor(e,t={},n){this.options={...Be,...t},this.options.useExtendedSearch,this._keyStore=new u3(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Ym))throw new Error(s3);this._myIndex=t||py(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Un(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const t=[];for(let n=0,r=this._docs.length;n-1&&(a=a.slice(0,t)),Z3(a,this._docs,{includeMatches:n,includeScore:r})}_searchStringList(e){const t=md(e,this.options),{records:n}=this._myIndex,r=[];return n.forEach(({v:s,i:o,n:l})=>{if(!Un(s))return;const{isMatch:a,score:c,indices:u}=t.searchIn(s);a&&r.push({item:s,idx:o,matches:[{score:c,value:s,norm:l,indices:u}]})}),r}_searchLogical(e){const t=vy(e,this.options),n=(l,a,c)=>{if(!l.children){const{keyId:h,searcher:f}=l,d=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(a,h),searcher:f});return d&&d.length?[{idx:c,item:a,matches:d}]:[]}const u=[];for(let h=0,f=l.children.length;h{if(Un(l)){let c=n(t,l,a);c.length&&(s[a]||(s[a]={idx:a,item:l,matches:[]},o.push(s[a])),c.forEach(({matches:u})=>{s[a].matches.push(...u)}))}}),o}_searchObjectList(e){const t=md(e,this.options),{keys:n,records:r}=this._myIndex,s=[];return r.forEach(({$:o,i:l})=>{if(!Un(o))return;let a=[];n.forEach((c,u)=>{a.push(...this._findMatches({key:c,value:o[u],searcher:t}))}),a.length&&s.push({idx:l,item:o,matches:a})}),s}_findMatches({key:e,value:t,searcher:n}){if(!Un(t))return[];let r=[];if(hr(t))t.forEach(({v:s,i:o,n:l})=>{if(!Un(s))return;const{isMatch:a,score:c,indices:u}=n.searchIn(s);a&&r.push({score:c,key:e,value:s,idx:o,norm:l,indices:u})});else{const{v:s,n:o}=t,{isMatch:l,score:a,indices:c}=n.searchIn(s);l&&r.push({score:a,key:e,value:s,norm:o,indices:c})}return r}}Wo.version="7.0.0";Wo.createIndex=py;Wo.parseIndex=b3;Wo.config=Be;Wo.parseQuery=vy;R3(E3);function Ig(i,e,t){const n=i.slice();return n[10]=e[t],n}function Ng(i){let e=[],t=new Map,n,r=fe(i[0]);const s=o=>o[10].value;for(let o=0;o({value:e,label:e})):Object.entries(i).map(([e,t])=>({value:e,label:t}))}function X3(i,e,t){let n,{field:r}=e,{value:s}=e,{search:o=""}=e;const l=nn();function a(d,m){d.preventDefault(),t(3,s=m.value),t(2,o=""),l("selected",{option:m})}let c=W3(r.selectOptions);const u=new Wo(c,{includeScore:!1,keys:["value","label"]}),h=(d,m)=>a(m,d),f=(d,m)=>a(m,d);return i.$$set=d=>{"field"in d&&t(4,r=d.field),"value"in d&&t(3,s=d.value),"search"in d&&t(2,o=d.search)},i.$$.update=()=>{i.$$.dirty&4&&t(0,n=o===""?c:u.search(o).map(d=>d.item))},[n,a,o,s,r,h,f]}class F3 extends oe{constructor(e){super(),se(this,e,X3,B3,re,{field:4,value:3,search:2})}}function Bg(i){let e,t,n,r,s,o,l,a;function c(f,d){return d&2&&(t=null),t==null&&(t=!!Array.isArray(f[1].selectOptions)),t?z3:Y3}let u=c(i,-1),h=u(i);return s=new ut({props:{width:12,height:12,icon:"close"}}),{c(){e=y("div"),h.c(),n=D(),r=y("button"),V(s.$$.fragment),O(r,"type","button"),O(r,"class","button-text"),O(r,"aria-label","Close"),O(e,"class","autocomplete-selected-value")},m(f,d){x(f,e,d),h.m(e,null),b(e,n),b(e,r),Y(s,r,null),o=!0,l||(a=G(r,"click",Ln(i[9])),l=!0)},p(f,d){u===(u=c(f,d))&&h?h.p(f,d):(h.d(1),h=u(f),h&&(h.c(),h.m(e,n)))},i(f){o||(T(s.$$.fragment,f),o=!0)},o(f){R(s.$$.fragment,f),o=!1},d(f){f&&P(e),h.d(),z(s),l=!1,a()}}}function Y3(i){let e=i[1].selectOptions[i[0]]+"",t;return{c(){t=W(e)},m(n,r){x(n,t,r)},p(n,r){r&3&&e!==(e=n[1].selectOptions[n[0]]+"")&&K(t,e)},d(n){n&&P(t)}}}function z3(i){let e;return{c(){e=W(i[0])},m(t,n){x(t,e,n)},p(t,n){n&1&&K(e,t[0])},d(t){t&&P(e)}}}function V3(i){let e,t,n,r,s,o,l,a,c,u,h,f;function d(v){i[7](v)}function m(v){i[8](v)}let p={field:i[1]};i[0]!==void 0&&(p.value=i[0]),i[3]!==void 0&&(p.search=i[3]),s=new F3({props:p}),Ce.push(()=>nt(s,"value",d)),Ce.push(()=>nt(s,"search",m)),s.$on("selected",i[4]);let g=i[0]&&Bg(i);return{c(){e=y("div"),t=y("input"),n=D(),r=y("div"),V(s.$$.fragment),a=D(),g&&g.c(),c=Ie(),O(t,"type","search"),O(t,"placeholder","Search for options"),O(t,"autocomplete","off"),O(r,"class","autocomplete-results"),O(e,"class","autocomplete")},m(v,w){x(v,e,w),b(e,t),Le(t,i[3]),i[6](t),b(e,n),b(e,r),Y(s,r,null),x(v,a,w),g&&g.m(v,w),x(v,c,w),u=!0,h||(f=G(t,"input",i[5]),h=!0)},p(v,[w]){w&8&&t.value!==v[3]&&Le(t,v[3]);const S={};w&2&&(S.field=v[1]),!o&&w&1&&(o=!0,S.value=v[0],st(()=>o=!1)),!l&&w&8&&(l=!0,S.search=v[3],st(()=>l=!1)),s.$set(S),v[0]?g?(g.p(v,w),w&1&&T(g,1)):(g=Bg(v),g.c(),T(g,1),g.m(c.parentNode,c)):g&&(Oe(),R(g,1,1,()=>{g=null}),be())},i(v){u||(T(s.$$.fragment,v),T(g),u=!0)},o(v){R(s.$$.fragment,v),R(g),u=!1},d(v){v&&(P(e),P(a),P(c)),i[6](null),z(s),g&&g.d(v),h=!1,f()}}}function U3(i,e,t){let n,r,{value:s}=e,{field:o}=e;function l(){n.focus(),n.blur()}function a(){r=this.value,t(3,r)}function c(d){Ce[d?"unshift":"push"](()=>{n=d,t(2,n)})}function u(d){s=d,t(0,s)}function h(d){r=d,t(3,r)}const f=d=>t(0,s="");return i.$$set=d=>{"value"in d&&t(0,s=d.value),"field"in d&&t(1,o=d.field)},[s,o,n,r,l,a,c,u,h,f]}class j3 extends oe{constructor(e){super(),se(this,e,U3,V3,re,{value:0,field:1})}}function q3(i){let e,t,n,r;return{c(){e=y("input"),O(e,"type","text"),O(e,"id",i[3]),O(e,"class","form-control"),O(e,"autocomplete","off"),e.readOnly=t=i[1].readonly&&!i[2],Ae(e,"is-invalid",i[4])},m(s,o){x(s,e,o),Le(e,i[0]),n||(r=G(e,"input",i[7]),n=!0)},p(s,o){o&8&&O(e,"id",s[3]),o&6&&t!==(t=s[1].readonly&&!s[2])&&(e.readOnly=t),o&1&&e.value!==s[0]&&Le(e,s[0]),o&16&&Ae(e,"is-invalid",s[4])},i:U,o:U,d(s){s&&P(e),n=!1,r()}}}function G3(i){let e,t,n;function r(o){i[6](o)}let s={field:i[1]};return i[0]!==void 0&&(s.value=i[0]),e=new j3({props:s}),Ce.push(()=>nt(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&2&&(a.field=o[1]),!t&&l&1&&(t=!0,a.value=o[0],st(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function Wg(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function H3(i){let e,t,n,r,s;const o=[G3,q3],l=[];function a(u,h){return u[1].selectOptions?0:1}t=a(i),n=l[t]=o[t](i);let c=i[4]&&Wg(i);return{c(){e=y("div"),n.c(),r=D(),c&&c.c(),le(e,"position","relative")},m(u,h){x(u,e,h),l[t].m(e,null),b(e,r),c&&c.m(e,null),s=!0},p(u,[h]){let f=t;t=a(u),t===f?l[t].p(u,h):(Oe(),R(l[f],1,1,()=>{l[f]=null}),be(),n=l[t],n?n.p(u,h):(n=l[t]=o[t](u),n.c()),T(n,1),n.m(e,r)),u[4]?c?c.p(u,h):(c=Wg(u),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i(u){s||(T(n),s=!0)},o(u){R(n),s=!1},d(u){u&&P(e),l[t].d(),c&&c.d()}}}function K3(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,{id:a}=e;function c(h){s=h,t(0,s)}function u(){s=this.value,t(0,s)}return i.$$set=h=>{"field"in h&&t(1,r=h.field),"value"in h&&t(0,s=h.value),"isCreateMode"in h&&t(2,o=h.isCreateMode),"validationErrors"in h&&t(5,l=h.validationErrors),"id"in h&&t(3,a=h.id)},i.$$.update=()=>{i.$$.dirty&34&&t(4,n=In(l,r.name))},[s,r,o,a,n,l,c,u]}let wy=class extends oe{constructor(e){super(),se(this,e,K3,H3,re,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}};function Xg(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function J3(i){let e,t,n,r,s,o,l,a=i[1].source+"",c,u,h,f,d=i[4]&&Xg(i);return{c(){e=y("div"),t=y("input"),r=D(),s=y("div"),o=W("Leave this empty to autogenerate from "),l=y("i"),c=W(a),u=D(),d&&d.c(),O(t,"type","text"),O(t,"id",i[3]),O(t,"class","form-control"),O(t,"autocomplete","off"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[4]),O(s,"class","system-help-text light-text"),O(e,"class","mb-0")},m(m,p){x(m,e,p),b(e,t),Le(t,i[0]),b(e,r),b(e,s),b(s,o),b(s,l),b(l,c),b(e,u),d&&d.m(e,null),h||(f=G(t,"input",i[6]),h=!0)},p(m,[p]){p&8&&O(t,"id",m[3]),p&6&&n!==(n=m[1].readonly&&!m[2])&&(t.readOnly=n),p&1&&t.value!==m[0]&&Le(t,m[0]),p&16&&Ae(t,"is-invalid",m[4]),p&2&&a!==(a=m[1].source+"")&&K(c,a),m[4]?d?d.p(m,p):(d=Xg(m),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},i:U,o:U,d(m){m&&P(e),d&&d.d(),h=!1,f()}}}function eT(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,{id:a}=e;function c(){s=this.value,t(0,s)}return i.$$set=u=>{"field"in u&&t(1,r=u.field),"value"in u&&t(0,s=u.value),"isCreateMode"in u&&t(2,o=u.isCreateMode),"validationErrors"in u&&t(5,l=u.validationErrors),"id"in u&&t(3,a=u.id)},i.$$.update=()=>{i.$$.dirty&34&&t(4,n=In(l,r.name))},[s,r,o,a,n,l,c]}class yy extends oe{constructor(e){super(),se(this,e,eT,J3,re,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function ky(i,e,t,n,r=""){let s=t.map(l=>({target:l.id,source:e.id,sourceSchema:e.schema,targetSchema:l.schema,field:n,depth:1,rank:""})),o=i.edges;return r==="replace"&&(o=o.filter(l=>l.field!==field.name)),i.records=hg([...i.records,...t],l=>l.id),i.edges=hg([...o,...s],l=>l.source+l.target+l.field+l.depth),i}function tT(i,e,t,n,r){if(i===e)return t;let s=r.map(a=>a.id),o=(t==null?void 0:t.filter(a=>a.field===n&&a.depth===1&&s.includes(a.target)))??[],l=(t==null?void 0:t.filter(a=>!(a.field===n&&a.depth===1)))??[];return o=Sy(o,i,e),[...l,...o]}function Sy(i,e,t){if(t>=i.length)for(var n=t-i.length+1;n--;)i.push(void 0);return i.splice(t,0,i.splice(e,1)[0]),i}function Fg(i,e){if(e.mime==="image/svg+xml")return Gi(i,e);const t=e.path.slice(0,e.path.lastIndexOf("."))+".webp";return i.filesUrl+`/thumbs/${t}`}function nT(i,e,t){if(e.mime==="image/svg+xml")return Gi(i,e);const n=e.path.slice(0,e.path.lastIndexOf("."))+".webp";return i.filesUrl+`/templates/${t}/${n}`}function Gi(i,e){return i.filesUrl+`/${e.path}`}function iT(i,e,t){let n="",r=Gi(i,e);if(e.width>0){let s=r;if(t){const o=e.path.slice(0,e.path.lastIndexOf("."))+".webp";s=i.filesUrl+`/templates/${t}/${o}`}n=`${e.path}`}else e.mime==="image/svg+xml"?n=`${e.path}`:n=`${e.filename}`;return n}function Yg(i){let e,t,n,r,s;const o=[sT,rT],l=[];function a(c,u){return u&1&&(e=null),e==null&&(e=!!c[0].mime.startsWith("image")),e?0:1}return t=a(i,-1),n=l[t]=o[t](i),{c(){n.c(),r=Ie()},m(c,u){l[t].m(c,u),x(c,r,u),s=!0},p(c,u){let h=t;t=a(c,u),t===h?l[t].p(c,u):(Oe(),R(l[h],1,1,()=>{l[h]=null}),be(),n=l[t],n?n.p(c,u):(n=l[t]=o[t](c),n.c()),T(n,1),n.m(r.parentNode,r))},i(c){s||(T(n),s=!0)},o(c){R(n),s=!1},d(c){c&&P(r),l[t].d(c)}}}function rT(i){let e,t,n,r,s,o=i[0].path.split(".").pop().toLowerCase()+"",l,a,c,u;return t=new ut({props:{icon:"file",width:i[3],height:i[3]}}),{c(){e=y("a"),V(t.$$.fragment),n=D(),r=y("span"),s=W("."),l=W(o),O(r,"class","ms-2"),O(e,"href",a=i[4].lucentUrl+"/files/"+i[0].id),O(e,"title",c=i[0].path),O(e,"class","file-preview-small"),le(e,"width",i[2]+"px"),le(e,"height",i[2]+"px")},m(h,f){x(h,e,f),Y(t,e,null),b(e,n),b(e,r),b(r,s),b(r,l),u=!0},p(h,f){const d={};f&8&&(d.width=h[3]),f&8&&(d.height=h[3]),t.$set(d),(!u||f&1)&&o!==(o=h[0].path.split(".").pop().toLowerCase()+"")&&K(l,o),(!u||f&1&&a!==(a=h[4].lucentUrl+"/files/"+h[0].id))&&O(e,"href",a),(!u||f&1&&c!==(c=h[0].path))&&O(e,"title",c),(!u||f&4)&&le(e,"width",h[2]+"px"),(!u||f&4)&&le(e,"height",h[2]+"px")},i(h){u||(T(t.$$.fragment,h),u=!0)},o(h){R(t.$$.fragment,h),u=!1},d(h){h&&P(e),z(t)}}}function sT(i){let e,t,n,r,s,o;return{c(){e=y("a"),t=y("img"),O(t,"class","rounded w-100 svelte-sv092r"),ad(t.src,n=Fg(i[4],i[0]))||O(t,"src",n),O(t,"alt",r=i[0].path),O(e,"target","_blank"),O(e,"href",s=Gi(i[4],i[0])),O(e,"title",o=i[0].filename),le(e,"width",i[2]+"px"),le(e,"height",i[2]+"px")},m(l,a){x(l,e,a),b(e,t)},p(l,a){a&1&&!ad(t.src,n=Fg(l[4],l[0]))&&O(t,"src",n),a&1&&r!==(r=l[0].path)&&O(t,"alt",r),a&1&&s!==(s=Gi(l[4],l[0]))&&O(e,"href",s),a&1&&o!==(o=l[0].filename)&&O(e,"title",o),a&4&&le(e,"width",l[2]+"px"),a&4&&le(e,"height",l[2]+"px")},i:U,o:U,d(l){l&&P(e)}}}function zg(i){let e,t=i[0].path+"",n,r,s;return{c(){e=y("a"),n=W(t),O(e,"href",r=i[4].lucentUrl+"/files/"+i[0].id),O(e,"title",s=i[0].path),O(e,"class","preview-file-filename lx-small-text text-decoration-none")},m(o,l){x(o,e,l),b(e,n)},p(o,l){l&1&&t!==(t=o[0].path+"")&&K(n,t),l&1&&r!==(r=o[4].lucentUrl+"/files/"+o[0].id)&&O(e,"href",r),l&1&&s!==(s=o[0].path)&&O(e,"title",s)},d(o){o&&P(e)}}}function oT(i){let e,t,n,r=i[0]&&Yg(i),s=i[1]&&zg(i);return{c(){e=y("div"),r&&r.c(),t=D(),s&&s.c(),le(e,"display","flex"),le(e,"align-items","center"),le(e,"gap","5px")},m(o,l){x(o,e,l),r&&r.m(e,null),b(e,t),s&&s.m(e,null),n=!0},p(o,[l]){o[0]?r?(r.p(o,l),l&1&&T(r,1)):(r=Yg(o),r.c(),T(r,1),r.m(e,t)):r&&(Oe(),R(r,1,1,()=>{r=null}),be()),o[1]?s?s.p(o,l):(s=zg(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},i(o){n||(T(r),n=!0)},o(o){R(r),n=!1},d(o){o&&P(e),r&&r.d(),s&&s.d()}}}function lT(i,e,t){let{file:n}=e;const r=Ue("channel");let{size:s="small"}=e,{showFilename:o=!1}=e,l,a;return s=="large"?(l=256,a=32):s=="medium"?(l=128,a=12):s=="small"?(l=64,a=12):s=="tiny"&&(l=42,a=12),i.$$set=c=>{"file"in c&&t(0,n=c.file),"size"in c&&t(5,s=c.size),"showFilename"in c&&t(1,o=c.showFilename)},[n,o,l,a,r,s]}class Xo extends oe{constructor(e){super(),se(this,e,lT,oT,re,{file:0,size:5,showFilename:1})}}function Vg(i){let e,t,n,r,s,o,l,a,c,u=i[0]._file.path+"",h,f,d,m,p,g,v=i[0]._file.originalName+"",w,S,_,k,A,C,Q=i[0]._file.mime+"",M,L,N,B,J,te,ie,ae=(i[0]._file.size/1024).toFixed(1)+"",X,ee,Te,ve,je,ne,Ee,Re=i[0]._file.checksum+"",xt,H,Pe,Ye,Tt,yt,wt;n=new Xo({props:{record:i[0],size:"large"}});let Qt=i[0]._file.width&&Ug(i);return{c(){e=y("div"),t=y("div"),V(n.$$.fragment),r=D(),s=y("div"),o=y("div"),l=y("span"),l.textContent="Filename",a=D(),c=y("span"),h=W(u),f=D(),d=y("div"),m=y("span"),m.textContent="Original name",p=D(),g=y("span"),w=W(v),S=D(),_=y("div"),k=y("span"),k.textContent="Mime type",A=D(),C=y("span"),M=W(Q),L=D(),Qt&&Qt.c(),N=D(),B=y("div"),J=y("span"),J.textContent="File size",te=D(),ie=y("span"),X=W(ae),ee=W("kB"),Te=D(),ve=y("div"),je=y("span"),je.textContent="Checksum",ne=D(),Ee=y("span"),xt=W(Re),H=D(),Pe=y("div"),Ye=y("a"),Tt=W("Download"),O(l,"class","text-muted"),O(o,"class","file-details-item"),O(m,"class","text-muted"),O(d,"class","file-details-item"),O(k,"class","text-muted"),O(_,"class","file-details-item"),O(J,"class","text-muted"),O(B,"class","file-details-item"),O(je,"class","text-muted"),O(ve,"class","file-details-item"),O(Ye,"class","button primary"),O(Ye,"target","_blank"),le(Ye,"display","inline-flex"),O(Ye,"href",yt=Gi(i[2],i[0])),O(Pe,"class","file-details-item"),O(s,"class","file-details"),O(e,"class","record-edit-file-preview")},m(He,Ut){x(He,e,Ut),b(e,t),Y(n,t,null),b(e,r),b(e,s),b(s,o),b(o,l),b(o,a),b(o,c),b(c,h),b(s,f),b(s,d),b(d,m),b(d,p),b(d,g),b(g,w),b(s,S),b(s,_),b(_,k),b(_,A),b(_,C),b(C,M),b(s,L),Qt&&Qt.m(s,null),b(s,N),b(s,B),b(B,J),b(B,te),b(B,ie),b(ie,X),b(ie,ee),b(s,Te),b(s,ve),b(ve,je),b(ve,ne),b(ve,Ee),b(Ee,xt),b(s,H),b(s,Pe),b(Pe,Ye),b(Ye,Tt),wt=!0},p(He,Ut){const ct={};Ut&1&&(ct.record=He[0]),n.$set(ct),(!wt||Ut&1)&&u!==(u=He[0]._file.path+"")&&K(h,u),(!wt||Ut&1)&&v!==(v=He[0]._file.originalName+"")&&K(w,v),(!wt||Ut&1)&&Q!==(Q=He[0]._file.mime+"")&&K(M,Q),He[0]._file.width?Qt?Qt.p(He,Ut):(Qt=Ug(He),Qt.c(),Qt.m(s,N)):Qt&&(Qt.d(1),Qt=null),(!wt||Ut&1)&&ae!==(ae=(He[0]._file.size/1024).toFixed(1)+"")&&K(X,ae),(!wt||Ut&1)&&Re!==(Re=He[0]._file.checksum+"")&&K(xt,Re),(!wt||Ut&1&&yt!==(yt=Gi(He[2],He[0])))&&O(Ye,"href",yt)},i(He){wt||(T(n.$$.fragment,He),wt=!0)},o(He){R(n.$$.fragment,He),wt=!1},d(He){He&&P(e),z(n),Qt&&Qt.d()}}}function Ug(i){let e,t,n,r,s=i[0]._file.width+"",o,l,a=i[0]._file.height+"",c;return{c(){e=y("div"),t=y("span"),t.textContent="Dimensions",n=D(),r=y("span"),o=W(s),l=W("x"),c=W(a),O(t,"class","text-muted"),O(e,"class","file-details-item")},m(u,h){x(u,e,h),b(e,t),b(e,n),b(e,r),b(r,o),b(r,l),b(r,c)},p(u,h){h&1&&s!==(s=u[0]._file.width+"")&&K(o,s),h&1&&a!==(a=u[0]._file.height+"")&&K(c,a)},d(u){u&&P(e)}}}function aT(i){let e,t,n=i[1].type==="files"&&Vg(i);return{c(){n&&n.c(),e=Ie()},m(r,s){n&&n.m(r,s),x(r,e,s),t=!0},p(r,[s]){r[1].type==="files"?n?(n.p(r,s),s&2&&T(n,1)):(n=Vg(r),n.c(),T(n,1),n.m(e.parentNode,e)):n&&(Oe(),R(n,1,1,()=>{n=null}),be())},i(r){t||(T(n),t=!0)},o(r){R(n),t=!1},d(r){r&&P(e),n&&n.d(r)}}}function cT(i,e,t){const n=Ue("channel");let{record:r}=e,{schema:s}=e;return i.$$set=o=>{"record"in o&&t(0,r=o.record),"schema"in o&&t(1,s=o.schema)},[r,s,n]}class uT extends oe{constructor(e){super(),se(this,e,cT,aT,re,{record:0,schema:1})}}function hT(i){let e;return{c(){e=W("New Record")},m(t,n){x(t,e,n)},p:U,d(t){t&&P(e)}}}function fT(i){let e=i[1].data.name+"",t;return{c(){t=W(e)},m(n,r){x(n,t,r)},p(n,r){r&2&&e!==(e=n[1].data.name+"")&&K(t,e)},d(n){n&&P(t)}}}function dT(i){let e,t,n=i[0].label.toUpperCase()+"",r,s,o,l;function a(h,f){return h[2]?hT:fT}let c=a(i),u=c(i);return{c(){e=y("div"),t=y("a"),r=W(n),o=D(),l=y("span"),u.c(),O(t,"class","schema-name"),O(t,"href",s=i[3].lucentUrl+"/content/"+i[0].name),O(l,"class","record-title"),O(e,"class","record-header")},m(h,f){x(h,e,f),b(e,t),b(t,r),b(e,o),b(e,l),u.m(l,null)},p(h,[f]){f&1&&n!==(n=h[0].label.toUpperCase()+"")&&K(r,n),f&1&&s!==(s=h[3].lucentUrl+"/content/"+h[0].name)&&O(t,"href",s),c===(c=a(h))&&u?u.p(h,f):(u.d(1),u=c(h),u&&(u.c(),u.m(l,null)))},i:U,o:U,d(h){h&&P(e),u.d()}}}function mT(i,e,t){const n=Ue("channel");let{schema:r}=e,{record:s}=e,{isCreateMode:o}=e;return i.$$set=l=>{"schema"in l&&t(0,r=l.schema),"record"in l&&t(1,s=l.record),"isCreateMode"in l&&t(2,o=l.isCreateMode)},[r,s,o,n]}class _y extends oe{constructor(e){super(),se(this,e,mT,dT,re,{schema:0,record:1,isCreateMode:2})}}function jg(i,e,t){const n=i.slice();return n[24]=e[t],n}function pT(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=` + Save`,O(e,"type","button"),O(e,"class","button primary ms-2 btn btn-primary btn-spinner")},m(r,s){x(r,e,s),t||(n=G(e,"click",i[10]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function gT(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=` + Create`,O(e,"class","button primary btn-spinner")},m(r,s){x(r,e,s),t||(n=G(e,"click",i[10]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function qg(i){let e,t,n,r;function s(a){i[14](a)}function o(a){i[15](a)}let l={field:i[24],schema:i[2],record:i[0],validationErrors:i[4],isCreateMode:i[3]};return i[0].data!==void 0&&(l.data=i[0].data),i[1]!==void 0&&(l.graph=i[1]),e=new aP({props:l}),Ce.push(()=>nt(e,"data",s)),Ce.push(()=>nt(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&4&&(u.schema=a[2]),c&1&&(u.record=a[0]),c&16&&(u.validationErrors=a[4]),c&8&&(u.isCreateMode=a[3]),!t&&c&1&&(t=!0,u.data=a[0].data,st(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],st(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function Gg(i,e){let t,n,r,s=e[5]===e[24].group&&qg(e);return{key:i,first:null,c(){t=Ie(),s&&s.c(),n=Ie(),this.first=t},m(o,l){x(o,t,l),s&&s.m(o,l),x(o,n,l),r=!0},p(o,l){e=o,e[5]===e[24].group?s?(s.p(e,l),l&32&&T(s,1)):(s=qg(e),s.c(),T(s,1),s.m(n.parentNode,n)):s&&(Oe(),R(s,1,1,()=>{s=null}),be())},i(o){r||(T(s),r=!0)},o(o){R(s),r=!1},d(o){o&&(P(t),P(n)),s&&s.d(o)}}}function OT(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w=[],S=new Map,_,k,A;function C(X){i[11](X)}function Q(X){i[12](X)}let M={schema:i[2],isCreateMode:i[3]};i[0]!==void 0&&(M.record=i[0]),i[5]!==void 0&&(M.activeContentTab=i[5]),n=new cy({props:M}),Ce.push(()=>nt(n,"record",C)),Ce.push(()=>nt(n,"activeContentTab",Q));function L(X,ee){if(X[3])return gT;if(X[6])return pT}let N=L(i),B=N&&N(i);a=new _y({props:{schema:i[2],record:i[0],isCreateMode:i[3]}}),u=new Ma({props:{message:i[7]}});function J(X){i[13](X)}let te={schema:i[2],isCreateMode:i[3]};i[5]!==void 0&&(te.active=i[5]),d=new uy({props:te}),Ce.push(()=>nt(d,"active",J)),g=new uT({props:{record:i[0],schema:i[2]}});let ie=fe(i[8]);const ae=X=>X[24].name;for(let X=0;Xr=!1)),!s&&ee&32&&(s=!0,Te.activeContentTab=X[5],st(()=>s=!1)),n.$set(Te),N===(N=L(X))&&B?B.p(X,ee):(B&&B.d(1),B=N&&N(X),B&&(B.c(),B.m(t,null)));const ve={};ee&4&&(ve.schema=X[2]),ee&1&&(ve.record=X[0]),ee&8&&(ve.isCreateMode=X[3]),a.$set(ve);const je={};ee&128&&(je.message=X[7]),u.$set(je);const ne={};ee&4&&(ne.schema=X[2]),ee&8&&(ne.isCreateMode=X[3]),!m&&ee&32&&(m=!0,ne.active=X[5],st(()=>m=!1)),d.$set(ne);const Ee={};ee&1&&(Ee.record=X[0]),ee&4&&(Ee.schema=X[2]),g.$set(Ee),ee&319&&(ie=fe(X[8]),Oe(),w=Ti(w,ee,ae,1,X,ie,S,f,Jr,Gg,null,jg),be())},i(X){if(!_){T(n.$$.fragment,X),T(a.$$.fragment,X),T(u.$$.fragment,X),T(d.$$.fragment,X),T(g.$$.fragment,X);for(let ee=0;eeM.name!=="id"),p="_default";l.fields.reduce((M,L)=>L.ui==="tab"?(p=L.name,M):(M[p]=[...M[p]??[],L.name],M),[]),xi(()=>{g()});function g(){h={data:JSON.parse(JSON.stringify(a.data)),schema:a.schema,status:a.status,edges:JSON.parse(JSON.stringify(c.edges))}}Kw(()=>{t(6,d=w())});function v(M){return d?M.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete M.returnValue,"...")}function w(){return u?!1:!ia(h,{data:a.data,schema:a.schema,status:a.status,edges:c.edges})}function S(M){return M.preventDefault(),console.log("SAVE: Attempt"),t(4,n=null),t(7,r=""),new Promise(function(L,N){var B;if(!d&&!u){L(null);return}if(!a){L(null);return}t(1,c.edges=((B=c.edges)==null?void 0:B.filter(J=>!J._isTrashed&&J.source===a.id))??[],c),Jn(s.lucentUrl+"/records",{record:a,edges:c.edges,isCreateMode:u}).then(function(J){console.log("SAVE: SAVED INLINE"),t(0,a=J.records[0]),t(1,c=J),u||g(),o("inlinesaved",{records:[a]}),L(null)}).catch(function(J){J.response&&(typeof J.response.data.error=="string"?t(7,r=J.response.data.error):t(4,n=J.response.data.error)),L(null)})})}function _(M){a=M,t(0,a)}function k(M){f=M,t(5,f)}function A(M){f=M,t(5,f)}function C(M){i.$$.not_equal(a.data,M)&&(a.data=M,t(0,a))}function Q(M){c=M,t(1,c)}return i.$$set=M=>{"schema"in M&&t(2,l=M.schema),"record"in M&&t(0,a=M.record),"graph"in M&&t(1,c=M.graph),"isCreateMode"in M&&t(3,u=M.isCreateMode)},i.$$.update=()=>{i.$$.dirty&16&&t(7,r=n?`Record submission failed. ${Object.entries(n).length} error(s)`:null)},t(4,n=null),[a,c,l,u,n,f,d,r,m,v,S,_,k,A,C,Q]}class vT extends oe{constructor(e){super(),se(this,e,bT,OT,re,{schema:2,record:0,graph:1,isCreateMode:3})}}function Hg(i,e,t){const n=i.slice();return n[11]=e[t],n}function Kg(i){let e=[],t=new Map,n,r=fe(i[2]);const s=l=>l[11].id;for(let l=0;l{Qa(r.lucentUrl+"/records/suggestions",{params:{schema:l.collections[0],field:"search",value:a,ui:"search"}}).then(p=>{t(2,n=p)}).catch(p=>{t(2,n=[]),console.log(p)})},500);function u(m,p){m.preventDefault(),t(5,o=p.id),s("addFilter"),t(5,o="")}function h(){a=this.value,t(1,a)}const f=(m,p)=>u(p,m),d=(m,p)=>u(p,m);return i.$$set=m=>{"value"in m&&t(5,o=m.value),"field"in m&&t(0,l=m.field)},t(2,n=[]),[l,a,n,c,u,o,h,f,d]}class kT extends oe{constructor(e){super(),se(this,e,yT,wT,re,{value:5,field:0})}}function tO(i,e,t){const n=i.slice();return n[39]=e[t],n}function nO(i,e,t){const n=i.slice();return n[42]=e[t],n}function iO(i,e,t){const n=i.slice();return n[39]=e[t],n}function rO(i){let e,t,n,r,s,o,l,a;t=new ut({props:{icon:"arrow-left"}});let c=fe(i[9]),u=[];for(let h=0;hnt(h,"value",g)),h.$on("addFilter",i[14]),{c(){e=y("button"),V(t.$$.fragment),n=W(` + Back`),r=D(),s=y("div"),o=W("field: "),a=W(l),c=D(),u=y("div"),V(h.$$.fragment),O(e,"class","dropdown-item button"),O(s,"class","selected-filter"),O(u,"class","mt-2")},m(w,S){x(w,e,S),Y(t,e,null),b(e,n),x(w,r,S),x(w,s,S),b(s,o),b(s,a),x(w,c,S),x(w,u,S),Y(h,u,null),d=!0,m||(p=G(e,"click",i[31]),m=!0)},p(w,S){(!d||S[0]&16)&&l!==(l=w[4].label+"")&&K(a,l);const _={};S[0]&16&&(_.field=w[4]),!f&&S[0]&4&&(f=!0,_.value=w[2],st(()=>f=!1)),h.$set(_)},i(w){d||(T(t.$$.fragment,w),T(h.$$.fragment,w),d=!0)},o(w){R(t.$$.fragment,w),R(h.$$.fragment,w),d=!1},d(w){w&&(P(e),P(r),P(s),P(c),P(u)),z(t),z(h),m=!1,p()}}}function ST(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S,_,k,A,C,Q,M,L,N=!i[3]&&rO(i),B=i[3]&&!i[5]&&oO(i),J=i[3]&&i[5]&&aO(i),te=!i[4]&&cO(i),ie=i[4]&&hO(i);return v=new ut({props:{icon:"arrow-left"}}),{c(){e=y("div"),t=y("button"),t.textContent="Filter by field",n=D(),r=y("button"),r.textContent="Filter by Reference",s=D(),o=y("button"),o.textContent="Advanced filter",l=D(),a=y("div"),N&&N.c(),c=D(),B&&B.c(),u=D(),J&&J.c(),h=D(),f=y("div"),te&&te.c(),d=D(),ie&&ie.c(),m=D(),p=y("div"),g=y("button"),V(v.$$.fragment),w=W(` + Back`),S=D(),_=y("form"),k=y("input"),A=D(),C=y("button"),C.textContent="Submit",O(t,"class","dropdown-item button"),O(r,"class","dropdown-item button"),O(o,"class","dropdown-item button"),Ae(e,"hide",i[6]!=="main"),Ae(a,"hide",i[6]!=="byField"),Ae(f,"hide",i[6]!=="byReference"),O(g,"class","dropdown-item button"),O(k,"type","search"),O(k,"class","mb-2 mt-2"),O(k,"placeholder","Advanced filters"),k.required=!0,O(C,"class","button applied-filter"),Ae(p,"hide",i[6]!=="advanced")},m(ae,X){x(ae,e,X),b(e,t),b(e,n),b(e,r),b(e,s),b(e,o),x(ae,l,X),x(ae,a,X),N&&N.m(a,null),b(a,c),B&&B.m(a,null),b(a,u),J&&J.m(a,null),x(ae,h,X),x(ae,f,X),te&&te.m(f,null),b(f,d),ie&&ie.m(f,null),x(ae,m,X),x(ae,p,X),b(p,g),Y(v,g,null),b(g,w),b(p,S),b(p,_),b(_,k),Le(k,i[1]),b(_,A),b(_,C),Q=!0,M||(L=[G(t,"click",i[20]),G(r,"click",i[21]),G(o,"click",i[22]),G(g,"click",i[33]),G(k,"input",i[34]),G(_,"submit",i[8])],M=!0)},p(ae,X){(!Q||X[0]&64)&&Ae(e,"hide",ae[6]!=="main"),ae[3]?N&&(Oe(),R(N,1,1,()=>{N=null}),be()):N?(N.p(ae,X),X[0]&8&&T(N,1)):(N=rO(ae),N.c(),T(N,1),N.m(a,c)),ae[3]&&!ae[5]?B?(B.p(ae,X),X[0]&40&&T(B,1)):(B=oO(ae),B.c(),T(B,1),B.m(a,u)):B&&(Oe(),R(B,1,1,()=>{B=null}),be()),ae[3]&&ae[5]?J?(J.p(ae,X),X[0]&40&&T(J,1)):(J=aO(ae),J.c(),T(J,1),J.m(a,null)):J&&(Oe(),R(J,1,1,()=>{J=null}),be()),(!Q||X[0]&64)&&Ae(a,"hide",ae[6]!=="byField"),ae[4]?te&&(Oe(),R(te,1,1,()=>{te=null}),be()):te?(te.p(ae,X),X[0]&16&&T(te,1)):(te=cO(ae),te.c(),T(te,1),te.m(f,d)),ae[4]?ie?(ie.p(ae,X),X[0]&16&&T(ie,1)):(ie=hO(ae),ie.c(),T(ie,1),ie.m(f,null)):ie&&(Oe(),R(ie,1,1,()=>{ie=null}),be()),(!Q||X[0]&64)&&Ae(f,"hide",ae[6]!=="byReference"),X[0]&2&&k.value!==ae[1]&&Le(k,ae[1]),(!Q||X[0]&64)&&Ae(p,"hide",ae[6]!=="advanced")},i(ae){Q||(T(N),T(B),T(J),T(te),T(ie),T(v.$$.fragment,ae),Q=!0)},o(ae){R(N),R(B),R(J),R(te),R(ie),R(v.$$.fragment,ae),Q=!1},d(ae){ae&&(P(e),P(l),P(a),P(h),P(f),P(m),P(p)),N&&N.d(),B&&B.d(),J&&J.d(),te&&te.d(),ie&&ie.d(),z(v),M=!1,ht(L)}}}function _T(i){let e,t,n,r,s;return t=new ut({props:{icon:"filter"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),r=y("span"),r.textContent="Filter",O(r,"class","ms-1"),O(e,"slot","button")},m(o,l){x(o,e,l),Y(t,e,null),b(e,n),b(e,r),s=!0},p:U,i(o){s||(T(t.$$.fragment,o),s=!0)},o(o){R(t.$$.fragment,o),s=!1},d(o){o&&P(e),z(t)}}}function CT(i){let e,t,n,r={$$slots:{button:[_T],default:[ST]},$$scope:{ctx:i}};return t=new ur({props:r}),i[35](t),{c(){e=y("div"),V(t.$$.fragment)},m(s,o){x(s,e,o),Y(t,e,null),n=!0},p(s,o){const l={};o[0]&254|o[1]&65536&&(l.$$scope={dirty:o,ctx:s}),t.$set(l)},i(s){n||(T(t.$$.fragment,s),n=!0)},o(s){R(t.$$.fragment,s),n=!1},d(s){s&&P(e),i[35](null),z(t)}}}function PT(i,e,t){const n=nn();let{schema:r}=e,{systemFields:s=[]}=e,{operators:o}=e,{inModal:l}=e,{modalUrl:a}=e,c,u="",h=s;r.type==="collection"&&(h=s.filter(H=>H.files===!1));function f(H){H.preventDefault();let Pe=u.split("=")[0]??"";if(!Pe)return;let Ye=`filter[${Pe}]`,Tt=u.split("=")[1]??"";if(!Tt)return;const yt=new URL(a??window.location.href);yt.searchParams.set("skip","0"),yt.searchParams.set(Ye,Tt),l?n("refresh",yt):window.location.replace(yt),M()}let d=null,m=null,p=null,g=null,v="main",w=null,S=[...r.fields,...h].filter(H=>{var Pe;return!["file","json","reference"].includes(((Pe=H.info)==null?void 0:Pe.name)??H.ui)}),_=[...r.fields].filter(H=>{var Pe;return["reference"].includes(((Pe=H.info)==null?void 0:Pe.name)??H.ui)});function k(H,Pe){t(3,m=Pe),t(7,w=o.filter(Ye=>{var Tt;return Ye.uis.includes((Tt=m==null?void 0:m.info)==null?void 0:Tt.name)||Ye.uis[0]==="*"}))}function A(H,Pe){t(4,p=Pe),t(5,g=o.find(Ye=>Ye.name==="eq"))}function C(H,Pe){t(5,g=Pe),Pe.hasValue||Q(H)}function Q(H){H.preventDefault();let Pe="",Ye,Tt=m??p;r.fields.find(wt=>wt.name===Tt.name)&&(Tt.info.name==="reference"&&g.name==="eq"?(Pe="children."+Tt.name+".id",Ye=`filter[${Pe}]`):(Pe="data.",Ye=`filter[${Pe+Tt.name}_${g.name}]`));const yt=new URL(a??window.location.href);yt.searchParams.set("skip","0"),yt.searchParams.set(Ye,d),l?(n("refresh",yt),c.close()):window.location.href=yt.toString(),M()}function M(){t(3,m=null),t(5,g=null),t(6,v="main"),t(4,p=null)}const L=H=>t(6,v="byField"),N=H=>t(6,v="byReference"),B=H=>t(6,v="advanced"),J=H=>t(6,v="main"),te=(H,Pe)=>k(Pe,H),ie=H=>t(3,m=null),ae=(H,Pe)=>C(Pe,H),X=H=>t(5,g=null);function ee(){d=this.value,t(2,d)}const Te=H=>t(6,v="main"),ve=(H,Pe)=>A(Pe,H),je=H=>t(4,p=null);function ne(H){d=H,t(2,d)}const Ee=H=>t(6,v="main");function Re(){u=this.value,t(1,u)}function xt(H){Ce[H?"unshift":"push"](()=>{c=H,t(0,c)})}return i.$$set=H=>{"schema"in H&&t(15,r=H.schema),"systemFields"in H&&t(16,s=H.systemFields),"operators"in H&&t(17,o=H.operators),"inModal"in H&&t(18,l=H.inModal),"modalUrl"in H&&t(19,a=H.modalUrl)},[c,u,d,m,p,g,v,w,f,S,_,k,A,C,Q,r,s,o,l,a,L,N,B,J,te,ie,ae,X,ee,Te,ve,je,ne,Ee,Re,xt]}class AT extends oe{constructor(e){super(),se(this,e,PT,CT,re,{schema:15,systemFields:16,operators:17,inModal:18,modalUrl:19},null,[-1,-1])}}function fO(i,e,t){const n=i.slice();return n[18]=e[t],n}function dO(i,e,t){const n=i.slice();return n[18]=e[t],n}function mO(i){let e,t,n,r,s,o,l,a,c,u,h=i[18].label+"",f,d,m,p;n=new ut({props:{icon:"arrow-up-short-wide"}});function g(...S){return i[10](i[18],...S)}l=new ut({props:{icon:"arrow-down-wide-short"}});function v(...S){return i[11](i[18],...S)}function w(...S){return i[12](i[18],...S)}return{c(){e=y("div"),t=y("button"),V(n.$$.fragment),s=D(),o=y("button"),V(l.$$.fragment),c=D(),u=y("button"),f=W(h),O(t,"title","Sort Ascending"),O(t,"class",r="button button-icon "+(i[18].name==i[1].name&&!i[0].startsWith("-")?"active":"")),O(o,"title","Sort Descending"),O(o,"class",a="button button-icon "+(i[18].name==i[1].name&&i[0].startsWith("-")?"active":"")),O(u,"title","Sort Ascending"),O(u,"class","button"),O(e,"class","dropdown-item")},m(S,_){x(S,e,_),b(e,t),Y(n,t,null),b(e,s),b(e,o),Y(l,o,null),b(e,c),b(e,u),b(u,f),d=!0,m||(p=[G(t,"click",g),G(o,"click",v),G(u,"click",w)],m=!0)},p(S,_){i=S,(!d||_&11&&r!==(r="button button-icon "+(i[18].name==i[1].name&&!i[0].startsWith("-")?"active":"")))&&O(t,"class",r),(!d||_&11&&a!==(a="button button-icon "+(i[18].name==i[1].name&&i[0].startsWith("-")?"active":"")))&&O(o,"class",a),(!d||_&8)&&h!==(h=i[18].label+"")&&K(f,h)},i(S){d||(T(n.$$.fragment,S),T(l.$$.fragment,S),d=!0)},o(S){R(n.$$.fragment,S),R(l.$$.fragment,S),d=!1},d(S){S&&P(e),z(n),z(l),m=!1,ht(p)}}}function pO(i){let e,t,n,r,s,o,l,a,c,u,h=i[18].label+"",f,d,m,p,g;n=new ut({props:{icon:"arrow-up-short-wide"}});function v(..._){return i[13](i[18],..._)}l=new ut({props:{icon:"arrow-down-wide-short"}});function w(..._){return i[14](i[18],..._)}function S(..._){return i[15](i[18],..._)}return{c(){e=y("div"),t=y("button"),V(n.$$.fragment),s=D(),o=y("button"),V(l.$$.fragment),c=D(),u=y("button"),f=W(h),d=D(),O(t,"title","Sort Ascending"),O(t,"class",r="button button-icon "+(i[18].name==i[0]?"active":"")),O(o,"title","Sort Descending"),O(o,"class",a="button button-icon "+("-"+i[18].name==i[0]?"active":"")),O(u,"title","Sort Ascending"),O(u,"class","button"),O(e,"class","dropdown-item")},m(_,k){x(_,e,k),b(e,t),Y(n,t,null),b(e,s),b(e,o),Y(l,o,null),b(e,c),b(e,u),b(u,f),b(e,d),m=!0,p||(g=[G(t,"click",v),G(o,"click",w),G(u,"click",S)],p=!0)},p(_,k){i=_,(!m||k&5&&r!==(r="button button-icon "+(i[18].name==i[0]?"active":"")))&&O(t,"class",r),(!m||k&5&&a!==(a="button button-icon "+("-"+i[18].name==i[0]?"active":"")))&&O(o,"class",a),(!m||k&4)&&h!==(h=i[18].label+"")&&K(f,h)},i(_){m||(T(n.$$.fragment,_),T(l.$$.fragment,_),m=!0)},o(_){R(n.$$.fragment,_),R(l.$$.fragment,_),m=!1},d(_){_&&P(e),z(n),z(l),p=!1,ht(g)}}}function xT(i){let e,t,n,r,s,o=fe(i[3]),l=[];for(let f=0;fR(l[f],1,1,()=>{l[f]=null});let c=fe(i[2]),u=[];for(let f=0;fR(u[f],1,1,()=>{u[f]=null});return{c(){e=y("div");for(let f=0;f{h[p]=null}),be(),r=h[n],r||(r=h[n]=u[n](d),r.c()),T(r,1),r.m(e,s)),(!c||m&2)&&l!==(l=d[1].label+"")&&K(a,l)},i(d){c||(T(r),c=!0)},o(d){R(r),c=!1},d(d){d&&P(e),h[n].d()}}}function ET(i){let e,t;return e=new ur({props:{$$slots:{button:[MT],default:[xT]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,[r]){const s={};r&8388623&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function RT(i,e,t){let n,r;const s=nn();let{schema:o}=e,{sortParam:l}=e,{sortField:a}=e,{inModal:c}=e,{modalUrl:u}=e,{systemFields:h=[]}=e;function f(k){const A=new URL(u??window.location.href);A.searchParams.set("sort",k),c?s("refresh",A):window.location=A}function d(k,A){k.preventDefault();let C=h.map(Q=>Q.name).includes(A.name)?"":"data.";return f(C+A.name)}function m(k,A){k.preventDefault();let C=h.map(Q=>Q.name).includes(A.name)?"":"data.";return f("-"+C+A.name)}const p=(k,A)=>d(A,k),g=(k,A)=>m(A,k),v=(k,A)=>d(A,k),w=(k,A)=>d(A,k),S=(k,A)=>m(A,k),_=(k,A)=>d(A,k);return i.$$set=k=>{"schema"in k&&t(6,o=k.schema),"sortParam"in k&&t(0,l=k.sortParam),"sortField"in k&&t(1,a=k.sortField),"inModal"in k&&t(7,c=k.inModal),"modalUrl"in k&&t(8,u=k.modalUrl),"systemFields"in k&&t(9,h=k.systemFields)},i.$$.update=()=>{i.$$.dirty&64&&t(3,n=o.fields.filter(k=>!["reference","file","json","id","rich","markdown","block"].includes(k.info.name))),i.$$.dirty&512&&t(2,r=h),i.$$.dirty&576&&o.type==="collection"&&t(2,r=h.filter(k=>k.files===!1))},[l,a,r,n,d,m,o,c,u,h,p,g,v,w,S,_]}class DT extends oe{constructor(e){super(),se(this,e,RT,ET,re,{schema:6,sortParam:0,sortField:1,inModal:7,modalUrl:8,systemFields:9})}}function $T(i){var c,u;let e=i[3].label+"",t,n,r=(((c=i[0].find(i[10]))==null?void 0:c.symbol)??"")+"",s,o,l=((u=i[0].find(i[11]))!=null&&u.hasValue?i[2]:"")+"",a;return{c(){t=W(e),n=D(),s=W(r),o=D(),a=W(l)},m(h,f){x(h,t,f),x(h,n,f),x(h,s,f),x(h,o,f),x(h,a,f)},p(h,f){var d,m;f&8&&e!==(e=h[3].label+"")&&K(t,e),f&9&&r!==(r=(((d=h[0].find(h[10]))==null?void 0:d.symbol)??"")+"")&&K(s,r),f&13&&l!==(l=((m=h[0].find(h[11]))!=null&&m.hasValue?h[2]:"")+"")&&K(a,l)},d(h){h&&(P(t),P(n),P(s),P(o),P(a))}}}function LT(i){let e=i[3].label+"",t,n,r=i[4].data.name+"",s;return{c(){t=W(e),n=W(" is "),s=W(r)},m(o,l){x(o,t,l),x(o,n,l),x(o,s,l)},p(o,l){l&8&&e!==(e=o[3].label+"")&&K(t,e)},d(o){o&&(P(t),P(n),P(s))}}}function IT(i){let e,t,n,r,s,o,l;function a(h,f){return h[3].isReference&&h[4]?LT:$T}let c=a(i),u=c(i);return r=new ut({props:{width:12,height:12,icon:"close"}}),{c(){e=y("span"),u.c(),t=D(),n=y("button"),V(r.$$.fragment),O(n,"type","button"),O(n,"class","button-text"),O(n,"aria-label","Close"),O(e,"class","applied-filter")},m(h,f){x(h,e,f),u.m(e,null),b(e,t),b(e,n),Y(r,n,null),s=!0,o||(l=G(n,"click",Ln(i[12])),o=!0)},p(h,[f]){c===(c=a(h))&&u?u.p(h,f):(u.d(1),u=c(h),u&&(u.c(),u.m(e,t)))},i(h){s||(T(r.$$.fragment,h),s=!0)},o(h){R(r.$$.fragment,h),s=!1},d(h){h&&P(e),u.d(),z(r),o=!1,l()}}}function NT(i){return e=>{if(e.isReference)return e.operator="eq",e;const t=i.split("_");return e.operator=t[t.length-1]??"eq",e}}function ZT(i,e){return t=>{let n="";t.isReference?n=e.split(".")[1]:n=e.replace("_"+t.operator,"");const r=i.fields.find(s=>s.name===n);return t.label=(r==null?void 0:r.label)??n,t}}function BT(i,e,t){const n=nn();let{schema:r}=e,{operators:s}=e,{key:o}=e,{value:l}=e,{inModal:a}=e,{modalUrl:c}=e,{graph:u}=e,h={label:"",operator:"",value:l,isReference:o.startsWith("children")};h=[NT(o),ZT(r,o)].reduce((w,S)=>S(w),h);const f=d(u,l);function d(w,S){return h.isReference?w.records.find(_=>_.id===S):null}function m(w){let S=`filter[${w}]`;const _=new URL(c??window.location.href);_.searchParams.set("skip","0"),_.searchParams.delete(S),a?n("refresh",_):window.location.replace(_)}const p=w=>w.name===h.operator,g=w=>w.name===h.operator,v=()=>m(o);return i.$$set=w=>{"schema"in w&&t(6,r=w.schema),"operators"in w&&t(0,s=w.operators),"key"in w&&t(1,o=w.key),"value"in w&&t(2,l=w.value),"inModal"in w&&t(7,a=w.inModal),"modalUrl"in w&&t(8,c=w.modalUrl),"graph"in w&&t(9,u=w.graph)},[s,o,l,h,f,m,r,a,c,u,p,g,v]}class WT extends oe{constructor(e){super(),se(this,e,BT,IT,re,{schema:6,operators:0,key:1,value:2,inModal:7,modalUrl:8,graph:9})}}function XT(i){let e,t,n,r,s,o,l;return r=new ut({props:{width:12,height:12,icon:"close"}}),{c(){e=y("span"),t=W(`Not linked - `),n=y("button"),V(r.$$.fragment),O(n,"type","button"),O(n,"class","button-text"),O(n,"aria-label","Close"),O(e,"class","applied-filter")},m(a,c){A(a,e,c),v(e,t),v(e,n),Y(r,n,null),s=!0,o||(l=G(n,"click",Ln(i[4])),o=!0)},p:U,i(a){s||(T(r.$$.fragment,a),s=!0)},o(a){R(r.$$.fragment,a),s=!1},d(a){a&&P(e),z(r),o=!1,l()}}}function qT(i){let e=i[0].searchParams.get("notlinked"),t,n,r=e&&jT(i);return{c(){r&&r.c(),t=De()},m(s,o){r&&r.m(s,o),A(s,t,o),n=!0},p(s,[o]){e&&r.p(s,o)},i(s){n||(T(r),n=!0)},o(s){R(r),n=!1},d(s){s&&P(t),r&&r.d(s)}}}function GT(i,e,t){je("channel");const n=nn();let{inModal:r}=e,{modalUrl:s}=e;const o=new URL(s??window.location.href);function l(c){const u=new URL(s??window.location.href);u.searchParams.set("skip","0"),u.searchParams.delete("notlinked"),r?n("refresh",u):window.location.replace(u)}const a=()=>l();return i.$$set=c=>{"inModal"in c&&t(2,r=c.inModal),"modalUrl"in c&&t(3,s=c.modalUrl)},[o,l,r,s,a]}class HT extends oe{constructor(e){super(),se(this,e,GT,qT,re,{inModal:2,modalUrl:3})}}function bO(i,e,t){const n=i.slice();return n[21]=e[t][0],n[22]=e[t][1],n}function vO(i){let e,t,n;return{c(){e=y("a"),t=W("New Record"),O(e,"href",n=i[10].lucentUrl+"/records/new?schema="+i[0].name),O(e,"class","button")},m(r,s){A(r,e,s),v(e,t)},p(r,s){s&1&&n!==(n=r[10].lucentUrl+"/records/new?schema="+r[0].name)&&O(e,"href",n)},d(r){r&&P(e)}}}function wO(i){let e,t;return e=new Gi({props:{orientation:"right",$$slots:{button:[tQ],default:[eQ]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&33554577&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function KT(i){let e,t,n,r,s,o,l,a,c,u;return{c(){e=y("a"),t=W("Export to CSV"),n=D(),r=y("a"),s=W("View trashed records"),l=D(),a=y("a"),c=W("View unlinked records"),O(e,"class","dropdown-item"),O(e,"href",i[11]),O(r,"class","dropdown-item"),O(r,"href",o=i[10].lucentUrl+"/content/"+i[0].name+"?filter[status_in]=trashed"),O(a,"class","dropdown-item"),O(a,"href",u=i[10].lucentUrl+"/content/"+i[0].name+"?notlinked=*")},m(h,f){A(h,e,f),v(e,t),A(h,n,f),A(h,r,f),v(r,s),A(h,l,f),A(h,a,f),v(a,c)},p(h,f){f&1&&o!==(o=h[10].lucentUrl+"/content/"+h[0].name+"?filter[status_in]=trashed")&&O(r,"href",o),f&1&&u!==(u=h[10].lucentUrl+"/content/"+h[0].name+"?notlinked=*")&&O(a,"href",u)},d(h){h&&(P(e),P(n),P(r),P(l),P(a))}}}function JT(i){let e,t=i[7]&&yO(i);return{c(){t&&t.c(),e=De()},m(n,r){t&&t.m(n,r),A(n,e,r)},p(n,r){n[7]?t?t.p(n,r):(t=yO(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&P(e),t&&t.d(n)}}}function yO(i){let e,t,n;return{c(){e=y("a"),t=W("Empty trash"),O(e,"class","dropdown-item"),O(e,"href",n=i[10].lucentUrl+"/content/"+i[0].name+"/emptyTrash")},m(r,s){A(r,e,s),v(e,t)},p(r,s){s&1&&n!==(n=r[10].lucentUrl+"/content/"+r[0].name+"/emptyTrash")&&O(e,"href",n)},d(r){r&&P(e)}}}function eQ(i){let e;function t(s,o){return s[4].status_in==="trashed"?JT:KT}let n=t(i),r=n(i);return{c(){r.c(),e=De()},m(s,o){r.m(s,o),A(s,e,o)},p(s,o){n===(n=t(s))&&r?r.p(s,o):(r.d(1),r=n(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){s&&P(e),r.d(s)}}}function tQ(i){let e,t,n;return t=new Ot({props:{icon:"ellipsis-vertical"}}),{c(){e=y("div"),V(t.$$.fragment),O(e,"slot","button")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function kO(i){let e,t,n=ue(Object.entries(i[4])),r=[];for(let o=0;oR(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o0,b,w,S;n=new BT({props:{schema:i[0],sortParam:i[1],sortField:i[2],systemFields:i[9],inModal:i[5],modalUrl:i[6]}}),n.$on("refresh",i[14]);function _(M){i[15](M)}let k={systemFields:i[9],operators:i[3],filter:i[4],inModal:i[5],modalUrl:i[6]};i[0]!==void 0&&(k.schema=i[0]),s=new RT({props:k}),Se.push(()=>He(s,"schema",_)),s.$on("refresh",i[16]);let Q=!i[5]&&i[7]&&vO(i),x=!i[5]&&wO(i);m=new HT({props:{inModal:i[5],modalUrl:i[6]}}),m.$on("refresh",i[17]);let C=g&&kO(i);return{c(){e=y("div"),t=y("div"),V(n.$$.fragment),r=D(),V(s.$$.fragment),l=D(),a=y("form"),a.innerHTML='',c=D(),u=y("div"),Q&&Q.c(),h=D(),x&&x.c(),f=D(),d=y("div"),V(m.$$.fragment),p=D(),C&&C.c(),O(a,"method","GET"),O(t,"class","toolbar-filters"),fe(u,"display","flex"),fe(u,"align-items","center"),fe(u,"gap","4px"),O(e,"class","toolbar"),O(d,"class","applied-filters")},m(M,$){A(M,e,$),v(e,t),Y(n,t,null),v(t,r),Y(s,t,null),v(t,l),v(t,a),v(e,c),v(e,u),Q&&Q.m(u,null),v(u,h),x&&x.m(u,null),A(M,f,$),A(M,d,$),Y(m,d,null),v(d,p),C&&C.m(d,null),b=!0,w||(S=G(a,"submit",i[12]),w=!0)},p(M,[$]){const N={};$&1&&(N.schema=M[0]),$&2&&(N.sortParam=M[1]),$&4&&(N.sortField=M[2]),$&512&&(N.systemFields=M[9]),$&32&&(N.inModal=M[5]),$&64&&(N.modalUrl=M[6]),n.$set(N);const B={};$&512&&(B.systemFields=M[9]),$&8&&(B.operators=M[3]),$&16&&(B.filter=M[4]),$&32&&(B.inModal=M[5]),$&64&&(B.modalUrl=M[6]),!o&&$&1&&(o=!0,B.schema=M[0],nt(()=>o=!1)),s.$set(B),!M[5]&&M[7]?Q?Q.p(M,$):(Q=vO(M),Q.c(),Q.m(u,h)):Q&&(Q.d(1),Q=null),M[5]?x&&(me(),R(x,1,1,()=>{x=null}),pe()):x?(x.p(M,$),$&32&&T(x,1)):(x=wO(M),x.c(),T(x,1),x.m(u,null));const J={};$&32&&(J.inModal=M[5]),$&64&&(J.modalUrl=M[6]),m.$set(J),$&16&&(g=Object.entries(M[4]).length>0),g?C?(C.p(M,$),$&16&&T(C,1)):(C=kO(M),C.c(),T(C,1),C.m(d,null)):C&&(me(),R(C,1,1,()=>{C=null}),pe())},i(M){b||(T(n.$$.fragment,M),T(s.$$.fragment,M),T(x),T(m.$$.fragment,M),T(C),b=!0)},o(M){R(n.$$.fragment,M),R(s.$$.fragment,M),R(x),R(m.$$.fragment,M),R(C),b=!1},d(M){M&&(P(e),P(f),P(d)),z(n),z(s),Q&&Q.d(),x&&x.d(),z(m),C&&C.d(),w=!1,S()}}}function iQ(i,e,t){const n=je("channel"),r=nn();let{sortParam:s}=e,{sortField:o}=e,{schema:l}=e,{operators:a}=e,{filter:c}=e,{inModal:u}=e,{modalUrl:h}=e,{isWritable:f}=e,{records:d}=e,{graph:m}=e,{systemFields:p=[]}=e,g=new URL(window.location.href),b=g.pathname+"/csv?"+g.searchParams.toString();function w(C){C.preventDefault();const M=new FormData(C.target);let $=M.keys().next().value,N=M.values().next().value;const B=new URL(h??window.location.href);B.searchParams.set("skip","0"),B.searchParams.set($,N),u?r("refresh",B):window.location=B}function S(C){Lr.call(this,i,C)}function _(C){l=C,t(0,l)}function k(C){Lr.call(this,i,C)}function Q(C){Lr.call(this,i,C)}function x(C){Lr.call(this,i,C)}return i.$$set=C=>{"sortParam"in C&&t(1,s=C.sortParam),"sortField"in C&&t(2,o=C.sortField),"schema"in C&&t(0,l=C.schema),"operators"in C&&t(3,a=C.operators),"filter"in C&&t(4,c=C.filter),"inModal"in C&&t(5,u=C.inModal),"modalUrl"in C&&t(6,h=C.modalUrl),"isWritable"in C&&t(7,f=C.isWritable),"records"in C&&t(13,d=C.records),"graph"in C&&t(8,m=C.graph),"systemFields"in C&&t(9,p=C.systemFields)},[l,s,o,a,c,u,h,f,m,p,n,b,w,d,S,_,k,Q,x]}class rQ extends oe{constructor(e){super(),se(this,e,iQ,nQ,re,{sortParam:1,sortField:2,schema:0,operators:3,filter:4,inModal:5,modalUrl:6,isWritable:7,records:13,graph:8,systemFields:9})}}function _O(i,e,t){const n=i.slice();return n[9]=e[t],n}function sQ(i){let e,t=i[9]+"",n,r,s,o;function l(...a){return i[7](i[9],...a)}return{c(){e=y("a"),n=W(t),O(e,"class","page-link"),O(e,"href",r=i[2](i[9]))},m(a,c){A(a,e,c),v(e,n),s||(o=G(e,"click",l),s=!0)},p(a,c){i=a,c&1&&t!==(t=i[9]+"")&&K(n,t),c&1&&r!==(r=i[2](i[9]))&&O(e,"href",r)},d(a){a&&P(e),s=!1,o()}}}function oQ(i){let e,t=i[9]+"",n;return{c(){e=y("span"),n=W(t),O(e,"class","page-link active")},m(r,s){A(r,e,s),v(e,n)},p(r,s){s&1&&t!==(t=r[9]+"")&&K(n,t)},d(r){r&&P(e)}}}function CO(i){let e,t;function n(o,l){return o[1]===o[9]?oQ:sQ}let r=n(i),s=r(i);return{c(){e=y("li"),s.c(),t=D(),O(e,"class","page-item"),Ae(e,"active",i[1]===i[9])},m(o,l){A(o,e,l),s.m(e,null),v(e,t)},p(o,l){r===(r=n(o))&&s?s.p(o,l):(s.d(1),s=r(o),s&&(s.c(),s.m(e,t))),l&3&&Ae(e,"active",o[1]===o[9])},d(o){o&&P(e),s.d()}}}function lQ(i){let e,t=ue(i[0]),n=[];for(let r=0;ru(d,f);return i.$$set=f=>{"pages"in f&&t(0,r=f.pages),"limit"in f&&t(4,s=f.limit),"currentPage"in f&&t(1,o=f.currentPage),"inModal"in f&&t(5,l=f.inModal),"modalUrl"in f&&t(6,a=f.modalUrl)},[r,o,c,u,s,l,a,h]}class cQ extends oe{constructor(e){super(),se(this,e,aQ,lQ,re,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function PO(i){let e,t,n,r,s,o,l,a,c,u;return r=new cQ({props:{pages:i[7],currentPage:i[6],limit:i[2],inModal:i[0],modalUrl:i[1]}}),r.$on("refresh",i[10]),{c(){e=y("li"),t=y("a"),t.textContent="First",n=D(),V(r.$$.fragment),s=D(),o=y("li"),l=y("a"),l.textContent="Last",O(t,"href","/"),O(t,"class","page-link"),O(e,"class","page-item disabled"),Ae(e,"disabled",i[6]===1),O(l,"class","page-link"),O(l,"href","/"),Ae(l,"disabled",i[6]===i[5]),O(o,"class","page-item")},m(h,f){A(h,e,f),v(e,t),A(h,n,f),Y(r,h,f),A(h,s,f),A(h,o,f),v(o,l),a=!0,c||(u=[G(t,"click",i[9]),G(l,"click",i[8])],c=!0)},p(h,f){(!a||f&64)&&Ae(e,"disabled",h[6]===1);const d={};f&128&&(d.pages=h[7]),f&64&&(d.currentPage=h[6]),f&4&&(d.limit=h[2]),f&1&&(d.inModal=h[0]),f&2&&(d.modalUrl=h[1]),r.$set(d),(!a||f&96)&&Ae(l,"disabled",h[6]===h[5])},i(h){a||(T(r.$$.fragment,h),a=!0)},o(h){R(r.$$.fragment,h),a=!1},d(h){h&&(P(e),P(n),P(s),P(o)),z(r,h),c=!1,ut(u)}}}function uQ(i){let e,t,n,r,s,o,l=+i[3]+1+"",a,c,u,h=(+i[3]+i[2]>i[4]?i[4]:+i[3]+i[2])+"",f,d,m,p,g,b,w=i[5]>1&&PO(i);return{c(){e=y("nav"),t=y("ul"),w&&w.c(),n=D(),r=y("p"),s=W(`Showing + `),n=y("button"),V(r.$$.fragment),O(n,"type","button"),O(n,"class","button-text"),O(n,"aria-label","Close"),O(e,"class","applied-filter")},m(a,c){x(a,e,c),b(e,t),b(e,n),Y(r,n,null),s=!0,o||(l=G(n,"click",Ln(i[4])),o=!0)},p:U,i(a){s||(T(r.$$.fragment,a),s=!0)},o(a){R(r.$$.fragment,a),s=!1},d(a){a&&P(e),z(r),o=!1,l()}}}function FT(i){let e=i[0].searchParams.get("notlinked"),t,n,r=e&&XT(i);return{c(){r&&r.c(),t=Ie()},m(s,o){r&&r.m(s,o),x(s,t,o),n=!0},p(s,[o]){e&&r.p(s,o)},i(s){n||(T(r),n=!0)},o(s){R(r),n=!1},d(s){s&&P(t),r&&r.d(s)}}}function YT(i,e,t){Ue("channel");const n=nn();let{inModal:r}=e,{modalUrl:s}=e;const o=new URL(s??window.location.href);function l(c){const u=new URL(s??window.location.href);u.searchParams.set("skip","0"),u.searchParams.delete("notlinked"),r?n("refresh",u):window.location.replace(u)}const a=()=>l();return i.$$set=c=>{"inModal"in c&&t(2,r=c.inModal),"modalUrl"in c&&t(3,s=c.modalUrl)},[o,l,r,s,a]}class zT extends oe{constructor(e){super(),se(this,e,YT,FT,re,{inModal:2,modalUrl:3})}}function gO(i,e,t){const n=i.slice();return n[21]=e[t][0],n[22]=e[t][1],n}function OO(i){let e,t,n;return{c(){e=y("a"),t=W("New Record"),O(e,"href",n=i[10].lucentUrl+"/records/new?schema="+i[0].name),O(e,"class","button")},m(r,s){x(r,e,s),b(e,t)},p(r,s){s&1&&n!==(n=r[10].lucentUrl+"/records/new?schema="+r[0].name)&&O(e,"href",n)},d(r){r&&P(e)}}}function bO(i){let e,t;return e=new ur({props:{orientation:"right",$$slots:{button:[qT],default:[jT]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&33554577&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function VT(i){let e,t,n,r,s,o,l,a,c,u;return{c(){e=y("a"),t=W("Export to CSV"),n=D(),r=y("a"),s=W("View trashed records"),l=D(),a=y("a"),c=W("View unlinked records"),O(e,"class","dropdown-item"),O(e,"href",i[11]),O(r,"class","dropdown-item"),O(r,"href",o=i[10].lucentUrl+"/content/"+i[0].name+"?filter[status_in]=trashed"),O(a,"class","dropdown-item"),O(a,"href",u=i[10].lucentUrl+"/content/"+i[0].name+"?notlinked=*")},m(h,f){x(h,e,f),b(e,t),x(h,n,f),x(h,r,f),b(r,s),x(h,l,f),x(h,a,f),b(a,c)},p(h,f){f&1&&o!==(o=h[10].lucentUrl+"/content/"+h[0].name+"?filter[status_in]=trashed")&&O(r,"href",o),f&1&&u!==(u=h[10].lucentUrl+"/content/"+h[0].name+"?notlinked=*")&&O(a,"href",u)},d(h){h&&(P(e),P(n),P(r),P(l),P(a))}}}function UT(i){let e,t=i[7]&&vO(i);return{c(){t&&t.c(),e=Ie()},m(n,r){t&&t.m(n,r),x(n,e,r)},p(n,r){n[7]?t?t.p(n,r):(t=vO(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&P(e),t&&t.d(n)}}}function vO(i){let e,t,n;return{c(){e=y("a"),t=W("Empty trash"),O(e,"class","dropdown-item"),O(e,"href",n=i[10].lucentUrl+"/content/"+i[0].name+"/emptyTrash")},m(r,s){x(r,e,s),b(e,t)},p(r,s){s&1&&n!==(n=r[10].lucentUrl+"/content/"+r[0].name+"/emptyTrash")&&O(e,"href",n)},d(r){r&&P(e)}}}function jT(i){let e;function t(s,o){return s[4].status_in==="trashed"?UT:VT}let n=t(i),r=n(i);return{c(){r.c(),e=Ie()},m(s,o){r.m(s,o),x(s,e,o)},p(s,o){n===(n=t(s))&&r?r.p(s,o):(r.d(1),r=n(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){s&&P(e),r.d(s)}}}function qT(i){let e,t,n;return t=new ut({props:{icon:"ellipsis-vertical"}}),{c(){e=y("div"),V(t.$$.fragment),O(e,"slot","button")},m(r,s){x(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function wO(i){let e,t,n=fe(Object.entries(i[4])),r=[];for(let o=0;oR(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o0,v,w,S;n=new DT({props:{schema:i[0],sortParam:i[1],sortField:i[2],systemFields:i[9],inModal:i[5],modalUrl:i[6]}}),n.$on("refresh",i[14]);function _(M){i[15](M)}let k={systemFields:i[9],operators:i[3],filter:i[4],inModal:i[5],modalUrl:i[6]};i[0]!==void 0&&(k.schema=i[0]),s=new AT({props:k}),Ce.push(()=>nt(s,"schema",_)),s.$on("refresh",i[16]);let A=!i[5]&&i[7]&&OO(i),C=!i[5]&&bO(i);m=new zT({props:{inModal:i[5],modalUrl:i[6]}}),m.$on("refresh",i[17]);let Q=g&&wO(i);return{c(){e=y("div"),t=y("div"),V(n.$$.fragment),r=D(),V(s.$$.fragment),l=D(),a=y("form"),a.innerHTML='',c=D(),u=y("div"),A&&A.c(),h=D(),C&&C.c(),f=D(),d=y("div"),V(m.$$.fragment),p=D(),Q&&Q.c(),O(a,"method","GET"),O(t,"class","toolbar-filters"),le(u,"display","flex"),le(u,"align-items","center"),le(u,"gap","4px"),O(e,"class","toolbar"),O(d,"class","applied-filters")},m(M,L){x(M,e,L),b(e,t),Y(n,t,null),b(t,r),Y(s,t,null),b(t,l),b(t,a),b(e,c),b(e,u),A&&A.m(u,null),b(u,h),C&&C.m(u,null),x(M,f,L),x(M,d,L),Y(m,d,null),b(d,p),Q&&Q.m(d,null),v=!0,w||(S=G(a,"submit",i[12]),w=!0)},p(M,[L]){const N={};L&1&&(N.schema=M[0]),L&2&&(N.sortParam=M[1]),L&4&&(N.sortField=M[2]),L&512&&(N.systemFields=M[9]),L&32&&(N.inModal=M[5]),L&64&&(N.modalUrl=M[6]),n.$set(N);const B={};L&512&&(B.systemFields=M[9]),L&8&&(B.operators=M[3]),L&16&&(B.filter=M[4]),L&32&&(B.inModal=M[5]),L&64&&(B.modalUrl=M[6]),!o&&L&1&&(o=!0,B.schema=M[0],st(()=>o=!1)),s.$set(B),!M[5]&&M[7]?A?A.p(M,L):(A=OO(M),A.c(),A.m(u,h)):A&&(A.d(1),A=null),M[5]?C&&(Oe(),R(C,1,1,()=>{C=null}),be()):C?(C.p(M,L),L&32&&T(C,1)):(C=bO(M),C.c(),T(C,1),C.m(u,null));const J={};L&32&&(J.inModal=M[5]),L&64&&(J.modalUrl=M[6]),m.$set(J),L&16&&(g=Object.entries(M[4]).length>0),g?Q?(Q.p(M,L),L&16&&T(Q,1)):(Q=wO(M),Q.c(),T(Q,1),Q.m(d,null)):Q&&(Oe(),R(Q,1,1,()=>{Q=null}),be())},i(M){v||(T(n.$$.fragment,M),T(s.$$.fragment,M),T(C),T(m.$$.fragment,M),T(Q),v=!0)},o(M){R(n.$$.fragment,M),R(s.$$.fragment,M),R(C),R(m.$$.fragment,M),R(Q),v=!1},d(M){M&&(P(e),P(f),P(d)),z(n),z(s),A&&A.d(),C&&C.d(),z(m),Q&&Q.d(),w=!1,S()}}}function HT(i,e,t){const n=Ue("channel"),r=nn();let{sortParam:s}=e,{sortField:o}=e,{schema:l}=e,{operators:a}=e,{filter:c}=e,{inModal:u}=e,{modalUrl:h}=e,{isWritable:f}=e,{records:d}=e,{graph:m}=e,{systemFields:p=[]}=e,g=new URL(window.location.href),v=g.pathname+"/csv?"+g.searchParams.toString();function w(Q){Q.preventDefault();const M=new FormData(Q.target);let L=M.keys().next().value,N=M.values().next().value;const B=new URL(h??window.location.href);B.searchParams.set("skip","0"),B.searchParams.set(L,N),u?r("refresh",B):window.location=B}function S(Q){vs.call(this,i,Q)}function _(Q){l=Q,t(0,l)}function k(Q){vs.call(this,i,Q)}function A(Q){vs.call(this,i,Q)}function C(Q){vs.call(this,i,Q)}return i.$$set=Q=>{"sortParam"in Q&&t(1,s=Q.sortParam),"sortField"in Q&&t(2,o=Q.sortField),"schema"in Q&&t(0,l=Q.schema),"operators"in Q&&t(3,a=Q.operators),"filter"in Q&&t(4,c=Q.filter),"inModal"in Q&&t(5,u=Q.inModal),"modalUrl"in Q&&t(6,h=Q.modalUrl),"isWritable"in Q&&t(7,f=Q.isWritable),"records"in Q&&t(13,d=Q.records),"graph"in Q&&t(8,m=Q.graph),"systemFields"in Q&&t(9,p=Q.systemFields)},[l,s,o,a,c,u,h,f,m,p,n,v,w,d,S,_,k,A,C]}class KT extends oe{constructor(e){super(),se(this,e,HT,GT,re,{sortParam:1,sortField:2,schema:0,operators:3,filter:4,inModal:5,modalUrl:6,isWritable:7,records:13,graph:8,systemFields:9})}}function kO(i,e,t){const n=i.slice();return n[9]=e[t],n}function JT(i){let e,t=i[9]+"",n,r,s,o;function l(...a){return i[7](i[9],...a)}return{c(){e=y("a"),n=W(t),O(e,"class","page-link"),O(e,"href",r=i[2](i[9]))},m(a,c){x(a,e,c),b(e,n),s||(o=G(e,"click",l),s=!0)},p(a,c){i=a,c&1&&t!==(t=i[9]+"")&&K(n,t),c&1&&r!==(r=i[2](i[9]))&&O(e,"href",r)},d(a){a&&P(e),s=!1,o()}}}function eQ(i){let e,t=i[9]+"",n;return{c(){e=y("span"),n=W(t),O(e,"class","page-link active")},m(r,s){x(r,e,s),b(e,n)},p(r,s){s&1&&t!==(t=r[9]+"")&&K(n,t)},d(r){r&&P(e)}}}function SO(i){let e,t;function n(o,l){return o[1]===o[9]?eQ:JT}let r=n(i),s=r(i);return{c(){e=y("li"),s.c(),t=D(),O(e,"class","page-item"),Ae(e,"active",i[1]===i[9])},m(o,l){x(o,e,l),s.m(e,null),b(e,t)},p(o,l){r===(r=n(o))&&s?s.p(o,l):(s.d(1),s=r(o),s&&(s.c(),s.m(e,t))),l&3&&Ae(e,"active",o[1]===o[9])},d(o){o&&P(e),s.d()}}}function tQ(i){let e,t=fe(i[0]),n=[];for(let r=0;ru(d,f);return i.$$set=f=>{"pages"in f&&t(0,r=f.pages),"limit"in f&&t(4,s=f.limit),"currentPage"in f&&t(1,o=f.currentPage),"inModal"in f&&t(5,l=f.inModal),"modalUrl"in f&&t(6,a=f.modalUrl)},[r,o,c,u,s,l,a,h]}class iQ extends oe{constructor(e){super(),se(this,e,nQ,tQ,re,{pages:0,limit:4,currentPage:1,inModal:5,modalUrl:6})}}function _O(i){let e,t,n,r,s,o,l,a,c,u;return r=new iQ({props:{pages:i[7],currentPage:i[6],limit:i[2],inModal:i[0],modalUrl:i[1]}}),r.$on("refresh",i[10]),{c(){e=y("li"),t=y("a"),t.textContent="First",n=D(),V(r.$$.fragment),s=D(),o=y("li"),l=y("a"),l.textContent="Last",O(t,"href","/"),O(t,"class","page-link"),O(e,"class","page-item disabled"),Ae(e,"disabled",i[6]===1),O(l,"class","page-link"),O(l,"href","/"),Ae(l,"disabled",i[6]===i[5]),O(o,"class","page-item")},m(h,f){x(h,e,f),b(e,t),x(h,n,f),Y(r,h,f),x(h,s,f),x(h,o,f),b(o,l),a=!0,c||(u=[G(t,"click",i[9]),G(l,"click",i[8])],c=!0)},p(h,f){(!a||f&64)&&Ae(e,"disabled",h[6]===1);const d={};f&128&&(d.pages=h[7]),f&64&&(d.currentPage=h[6]),f&4&&(d.limit=h[2]),f&1&&(d.inModal=h[0]),f&2&&(d.modalUrl=h[1]),r.$set(d),(!a||f&96)&&Ae(l,"disabled",h[6]===h[5])},i(h){a||(T(r.$$.fragment,h),a=!0)},o(h){R(r.$$.fragment,h),a=!1},d(h){h&&(P(e),P(n),P(s),P(o)),z(r,h),c=!1,ht(u)}}}function rQ(i){let e,t,n,r,s,o,l=+i[3]+1+"",a,c,u,h=(+i[3]+i[2]>i[4]?i[4]:+i[3]+i[2])+"",f,d,m,p,g,v,w=i[5]>1&&_O(i);return{c(){e=y("nav"),t=y("ul"),w&&w.c(),n=D(),r=y("p"),s=W(`Showing `),o=y("span"),a=W(l),c=W(` to `),u=y("span"),f=W(h),d=W(` of `),m=y("span"),p=W(i[4]),g=W(` - total`),O(t,"class","pagination"),O(o,"class","font-medium"),O(u,"class","font-medium"),O(m,"class","font-medium"),fe(r,"display","flex"),fe(r,"justify-content","center"),fe(r,"gap","4px")},m(S,_){A(S,e,_),v(e,t),w&&w.m(t,null),A(S,n,_),A(S,r,_),v(r,s),v(r,o),v(o,a),v(r,c),v(r,u),v(u,f),v(r,d),v(r,m),v(m,p),v(r,g),b=!0},p(S,[_]){S[5]>1?w?(w.p(S,_),_&32&&T(w,1)):(w=PO(S),w.c(),T(w,1),w.m(t,null)):w&&(me(),R(w,1,1,()=>{w=null}),pe()),(!b||_&8)&&l!==(l=+S[3]+1+"")&&K(a,l),(!b||_&28)&&h!==(h=(+S[3]+S[2]>S[4]?S[4]:+S[3]+S[2])+"")&&K(f,h),(!b||_&16)&&K(p,S[4])},i(S){b||(T(w),b=!0)},o(S){R(w),b=!1},d(S){S&&(P(e),P(n),P(r)),w&&w.d()}}}function hQ(i,e,t){let n,r,s;const o=nn();let{inModal:l}=e,{modalUrl:a}=e,{limit:c}=e,{skip:u}=e,{total:h}=e;const f=(b,w,S=1)=>Array.from({length:Math.ceil((w-b)/S)},(_,k)=>b+k*S);function d(b){b.preventDefault(),p(n)}function m(b){b.preventDefault(),p(1)}function p(b){const w=new URL(a??window.location.href);let S=b*c-c;w.searchParams.set("skip",S),l?o("refresh",w):window.location=w}function g(b){Lr.call(this,i,b)}return i.$$set=b=>{"inModal"in b&&t(0,l=b.inModal),"modalUrl"in b&&t(1,a=b.modalUrl),"limit"in b&&t(2,c=b.limit),"skip"in b&&t(3,u=b.skip),"total"in b&&t(4,h=b.total)},i.$$.update=()=>{i.$$.dirty&20&&t(5,n=Math.ceil(h/c)),i.$$.dirty&12&&t(6,r=Math.ceil((u-1)/c)+1),i.$$.dirty&96&&t(7,s=f(r-3,r+4).filter(b=>b>0&&b<=n))},[l,a,c,u,h,n,r,s,d,m,g]}class fQ extends oe{constructor(e){super(),se(this,e,hQ,uQ,re,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function dQ(i){let e,t,n;return{c(){e=y("button"),e.textContent="Move to trash",O(e,"type","button"),O(e,"class","button")},m(r,s){A(r,e,s),t||(n=G(e,"click",Ln(i[9])),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function mQ(i){let e,t,n,r,s,o,l=i[1].hasDrafts&&AO(i);return{c(){e=y("button"),e.textContent="Publish",t=D(),l&&l.c(),n=D(),r=y("button"),r.textContent="Delete forever",O(e,"type","button"),O(e,"class","button"),O(r,"type","button"),O(r,"class","button")},m(a,c){A(a,e,c),A(a,t,c),l&&l.m(a,c),A(a,n,c),A(a,r,c),s||(o=[G(e,"click",Ln(i[7])),G(r,"click",Ln(i[3]))],s=!0)},p(a,c){a[1].hasDrafts?l?l.p(a,c):(l=AO(a),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(a){a&&(P(e),P(t),P(n),P(r)),l&&l.d(a),s=!1,ut(o)}}}function AO(i){let e,t,n;return{c(){e=y("button"),e.textContent="Make Draft",O(e,"type","button"),O(e,"class","button")},m(r,s){A(r,e,s),t||(n=G(e,"click",Ln(i[8])),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function pQ(i){let e,t,n=i[0].length+"",r,s,o,l,a,c,u,h,f;function d(g,b){return g[2].status_in==="trashed"?mQ:dQ}let m=d(i),p=m(i);return{c(){e=y("div"),t=y("span"),r=W(n),s=W(" records selected"),o=D(),l=y("button"),l.textContent="Publish",a=D(),c=y("button"),c.textContent="Make Draft",u=D(),p.c(),O(t,"class","me-2"),O(l,"type","button"),O(l,"class","button"),O(c,"type","button"),O(c,"class","button"),fe(e,"display","flex"),fe(e,"align-items","center"),fe(e,"gap","8px")},m(g,b){A(g,e,b),v(e,t),v(t,r),v(t,s),v(e,o),v(e,l),v(e,a),v(e,c),v(e,u),p.m(e,null),h||(f=[G(l,"click",Ln(i[5])),G(c,"click",Ln(i[6]))],h=!0)},p(g,[b]){b&1&&n!==(n=g[0].length+"")&&K(r,n),m===(m=d(g))&&p?p.p(g,b):(p.d(1),p=m(g),p&&(p.c(),p.m(e,null)))},i:U,o:U,d(g){g&&P(e),p.d(),h=!1,ut(f)}}}function gQ(i,e,t){const n=je("channel");let{selected:r}=e,{schema:s}=e,{filter:o}=e;function l(m){m.preventDefault(),Jn(n.lucentUrl+"/records/delete",{ids:r.map(p=>p.id)}).then(p=>{window.location.reload()}).catch(p=>{console.log(p)})}function a(m,p){Jn(n.lucentUrl+"/records/status/"+p,{schemaName:s.name,records:r}).then(g=>{window.location.reload()}).catch(g=>{console.log(g)})}const c=m=>a(m,"published"),u=m=>a(m,"draft"),h=m=>a(m,"published"),f=m=>a(m,"draft"),d=m=>a(m,"trashed");return i.$$set=m=>{"selected"in m&&t(0,r=m.selected),"schema"in m&&t(1,s=m.schema),"filter"in m&&t(2,o=m.filter)},[r,s,o,l,a,c,u,h,f,d]}class OQ extends oe{constructor(e){super(),se(this,e,gQ,pQ,re,{selected:0,schema:1,filter:2})}}function bQ(i){let e;return{c(){e=W(i[0])},m(t,n){A(t,e,n)},p(t,[n]){n&1&&K(e,t[0])},i:U,o:U,d(t){t&&P(e)}}}function vQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let wQ=class extends oe{constructor(e){super(),se(this,e,vQ,bQ,re,{value:0})}};function xO(i){let e,t,n,r;return{c(){e=y("div"),t=y("span"),n=D(),r=W(i[0]),O(t,"class","color border border-2 svelte-78o2k4"),fe(t,"background",i[0]),O(e,"class","d-inline-flex")},m(s,o){A(s,e,o),v(e,t),v(e,n),v(e,r)},p(s,o){o&1&&fe(t,"background",s[0]),o&1&&K(r,s[0])},d(s){s&&P(e)}}}function yQ(i){let e,t=i[0]&&xO(i);return{c(){t&&t.c(),e=De()},m(n,r){t&&t.m(n,r),A(n,e,r)},p(n,[r]){n[0]?t?t.p(n,r):(t=xO(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(n){n&&P(e),t&&t.d(n)}}}function kQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let SQ=class extends oe{constructor(e){super(),se(this,e,kQ,yQ,re,{value:0})}};function TO(i){let e,t,n;return{c(){e=y("a"),t=W(i[1]),O(e,"href",n=i[2].lucentUrl+"/records/"+i[0].id),O(e,"title",i[1]),O(e,"class","reference svelte-nbbgyi")},m(r,s){A(r,e,s),v(e,t)},p(r,s){s&2&&K(t,r[1]),s&1&&n!==(n=r[2].lucentUrl+"/records/"+r[0].id)&&O(e,"href",n),s&2&&O(e,"title",r[1])},d(r){r&&P(e)}}}function _Q(i){var n;let e,t=((n=i[0])==null?void 0:n.data)&&TO(i);return{c(){t&&t.c(),e=De()},m(r,s){t&&t.m(r,s),A(r,e,s)},p(r,[s]){var o;(o=r[0])!=null&&o.data?t?t.p(r,s):(t=TO(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(r){r&&P(e),t&&t.d(r)}}}function CQ(i,e,t){let n;const r=je("channel");let{record:s}=e;return i.$$set=o=>{"record"in o&&t(0,s=o.record)},i.$$.update=()=>{i.$$.dirty&1&&t(1,n=s.data.name)},[s,n,r]}class $y extends oe{constructor(e){super(),se(this,e,CQ,_Q,re,{record:0})}}function QO(i,e,t){const n=i.slice();return n[5]=e[t],n}function MO(i){let e,t,n,r;return t=new $y({props:{schemas:i[0],graph:i[1],record:i[5]}}),{c(){e=y("span"),V(t.$$.fragment),n=D(),O(e,"class","reference")},m(s,o){A(s,e,o),Y(t,e,null),v(e,n),r=!0},p(s,o){const l={};o&1&&(l.schemas=s[0]),o&2&&(l.graph=s[1]),o&4&&(l.record=s[5]),t.$set(l)},i(s){r||(T(t.$$.fragment,s),r=!0)},o(s){R(t.$$.fragment,s),r=!1},d(s){s&&P(e),z(t)}}}function PQ(i){let e,t,n=ue(i[2]),r=[];for(let o=0;oR(r[o],1,1,()=>{r[o]=null});return{c(){e=y("div");for(let o=0;o{"record"in a&&t(3,r=a.record),"field"in a&&t(4,s=a.field),"schemas"in a&&t(0,o=a.schemas),"graph"in a&&t(1,l=a.graph)},i.$$.update=()=>{var a;i.$$.dirty&26&&t(2,n=((a=l.edges)==null?void 0:a.filter(c=>c.field===s.name&&c.source===r.id).map(c=>l.records.find(u=>u.id===c.target)).filter(c=>!!c))??[])},[o,l,n,r,s]}let xQ=class extends oe{constructor(e){super(),se(this,e,AQ,PQ,re,{record:3,field:4,schemas:0,graph:1})}};function TQ(i){let e;return{c(){e=W(i[0])},m(t,n){A(t,e,n)},p(t,[n]){n&1&&K(e,t[0])},i:U,o:U,d(t){t&&P(e)}}}function QQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let MQ=class extends oe{constructor(e){super(),se(this,e,QQ,TQ,re,{value:0})}};function EQ(i){let e,t;return{c(){e=y("div"),t=W(i[0]),O(e,"title",i[0]),O(e,"data-bs-toggle","tooltip"),O(e,"data-bs-placement","top"),O(e,"class","svelte-1ft053t")},m(n,r){A(n,e,r),v(e,t)},p(n,[r]){r&1&&K(t,n[0]),r&1&&O(e,"title",n[0])},i:U,o:U,d(n){n&&P(e)}}}function RQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let $h=class extends oe{constructor(e){super(),se(this,e,RQ,EQ,re,{value:0})}};function DQ(i){let e,t;return{c(){e=y("a"),t=W(i[0]),O(e,"href",i[0]),O(e,"target","_blank")},m(n,r){A(n,e,r),v(e,t)},p(n,[r]){r&1&&K(t,n[0]),r&1&&O(e,"href",n[0])},i:U,o:U,d(n){n&&P(e)}}}function $Q(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let LQ=class extends oe{constructor(e){super(),se(this,e,$Q,DQ,re,{value:0})}};function IQ(i){let e,t;return{c(){e=y("div"),t=W(i[0]),O(e,"title",i[0]),O(e,"data-bs-toggle","tooltip"),O(e,"data-bs-placement","top")},m(n,r){A(n,e,r),v(e,t)},p(n,[r]){r&1&&K(t,n[0]),r&1&&O(e,"title",n[0])},i:U,o:U,d(n){n&&P(e)}}}function NQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let ZQ=class extends oe{constructor(e){super(),se(this,e,NQ,IQ,re,{value:0})}};function BQ(i){let e,t=hg(i[0])+"",n,r;return{c(){e=y("div"),n=W(t),O(e,"title",r=fg(i[0])),O(e,"data-bs-toggle","tooltip"),O(e,"data-bs-placement","top")},m(s,o){A(s,e,o),v(e,n)},p(s,[o]){o&1&&t!==(t=hg(s[0])+"")&&K(n,t),o&1&&r!==(r=fg(s[0]))&&O(e,"title",r)},i:U,o:U,d(s){s&&P(e)}}}function WQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let XQ=class extends oe{constructor(e){super(),se(this,e,WQ,BQ,re,{value:0})}};function EO(i,e,t){const n=i.slice();return n[4]=e[t],n}function RO(i){let e,t,n,r;return t=new Wo({props:{record:i[4],size:"tiny"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),O(e,"class","me-1")},m(s,o){A(s,e,o),Y(t,e,null),v(e,n),r=!0},p:U,i(s){r||(T(t.$$.fragment,s),r=!0)},o(s){R(t.$$.fragment,s),r=!1},d(s){s&&P(e),z(t)}}}function FQ(i){let e,t,n=ue(i[0]),r=[];for(let o=0;oR(r[o],1,1,()=>{r[o]=null});return{c(){e=y("div");for(let o=0;oa.field===r.name&&a.source===n.id).map(a=>s.records.find(c=>c.id===a.target));return i.$$set=a=>{"record"in a&&t(1,n=a.record),"field"in a&&t(2,r=a.field),"graph"in a&&t(3,s=a.graph)},[o,n,r,s]}let zQ=class extends oe{constructor(e){super(),se(this,e,YQ,FQ,re,{record:1,field:2,graph:3})}};function VQ(i){let e,t;return{c(){e=y("span"),t=W(i[0]),O(e,"class","badge rounded-pill bg-primary bg-opacity-75"),fe(e,"max-width","64px"),fe(e,"overflow","hidden"),fe(e,"white-space","nowrap"),fe(e,"text-overflow","ellipsis"),O(e,"title",i[0]),O(e,"data-bs-toggle","tooltip")},m(n,r){A(n,e,r),v(e,t)},p(n,[r]){r&1&&K(t,n[0]),r&1&&O(e,"title",n[0])},i:U,o:U,d(n){n&&P(e)}}}function UQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let jQ=class extends oe{constructor(e){super(),se(this,e,UQ,VQ,re,{value:0})}};function qQ(i){let e,t;return{c(){e=y("div"),t=W(i[0]),O(e,"class","svelte-1ft053t")},m(n,r){A(n,e,r),v(e,t)},p(n,[r]){r&1&&K(t,n[0])},i:U,o:U,d(n){n&&P(e)}}}function GQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}class HQ extends oe{constructor(e){super(),se(this,e,GQ,qQ,re,{value:0})}}function KQ(i){let e,t,n;var r=i[4][i[0].info.name];function s(o,l){return{props:{value:o[2].data[o[0].name],record:o[2],graph:o[3],schema:o[1],field:o[0]}}}return r&&(e=Fr(r,s(i))),{c(){e&&V(e.$$.fragment),t=De()},m(o,l){e&&Y(e,o,l),A(o,t,l),n=!0},p(o,[l]){if(l&1&&r!==(r=o[4][o[0].info.name])){if(e){me();const a=e;R(a.$$.fragment,1,0,()=>{z(a,1)}),pe()}r?(e=Fr(r,s(o)),V(e.$$.fragment),T(e.$$.fragment,1),Y(e,t.parentNode,t)):e=null}else if(r){const a={};l&5&&(a.value=o[2].data[o[0].name]),l&4&&(a.record=o[2]),l&8&&(a.graph=o[3]),l&2&&(a.schema=o[1]),l&1&&(a.field=o[0]),e.$set(a)}},i(o){n||(e&&T(e.$$.fragment,o),n=!0)},o(o){e&&R(e.$$.fragment,o),n=!1},d(o){o&&P(t),e&&z(e,o)}}}function JQ(i,e,t){const n={text:$h,slug:$h,rich:HQ,textarea:$h,color:SQ,checkbox:wQ,reference:xQ,number:MQ,url:LQ,date:ZQ,datetime:XQ,uuid:jQ,file:zQ};let{field:r}=e,{schema:s}=e,{record:o}=e,{graph:l}=e;return i.$$set=a=>{"field"in a&&t(0,r=a.field),"schema"in a&&t(1,s=a.schema),"record"in a&&t(2,o=a.record),"graph"in a&&t(3,l=a.graph)},[r,s,o,l,n]}class eM extends oe{constructor(e){super(),se(this,e,JQ,KQ,re,{field:0,schema:1,record:2,graph:3})}}function tM(i){return nM()[i]}function nM(){return{published:{value:"published",text:"Published",bg:"success",color:"white"},trashed:{value:"trashed",text:"Trashed",bg:"danger",color:"white"},draft:{value:"draft",text:"Draft",bg:"warning",color:"dark"}}}function iM(i){let e,t=i[0].text+"",n;return{c(){e=y("span"),n=W(t),O(e,"class","badge text-bg-"+i[0].bg),fe(e,"max-width","84px")},m(r,s){A(r,e,s),v(e,n)},p:U,i:U,o:U,d(r){r&&P(e)}}}function rM(i,e,t){let{status:n}=e,r=tM(n);return i.$$set=s=>{"status"in s&&t(1,n=s.status)},[r,n]}class Ly extends oe{constructor(e){super(),se(this,e,rM,iM,re,{status:1})}}function Dn(i,e){var t;return i?((t=i.find(n=>n.id===e))==null?void 0:t.name)??e:e}function DO(i,e,t){const n=i.slice();return n[7]=e[t],n[9]=t,n}function $O(i){let e,t,n,r;return t=new eM({props:{record:i[3],schema:i[0],graph:i[2],field:i[7]}}),{c(){e=y("td"),V(t.$$.fragment),O(e,"class",n="field-ui-"+i[7].info.name),Ae(e,"is-sort",i[7].name===i[5].name)},m(s,o){A(s,e,o),Y(t,e,null),r=!0},p(s,o){const l={};o&8&&(l.record=s[3]),o&1&&(l.schema=s[0]),o&4&&(l.graph=s[2]),o&64&&(l.field=s[7]),t.$set(l),(!r||o&64&&n!==(n="field-ui-"+s[7].info.name))&&O(e,"class",n),(!r||o&96)&&Ae(e,"is-sort",s[7].name===s[5].name)},i(s){r||(T(t.$$.fragment,s),r=!0)},o(s){R(t.$$.fragment,s),r=!1},d(s){s&&P(e),z(t)}}}function LO(i){let e,t,n;return t=new Ly({props:{status:i[3].status}}),{c(){e=y("td"),V(t.$$.fragment),O(e,"class","text-center"),Ae(e,"is-sort",i[4]=="-status"||i[4]=="status")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p(r,s){const o={};s&8&&(o.status=r[3].status),t.$set(o),(!n||s&16)&&Ae(e,"is-sort",r[4]=="-status"||r[4]=="status")},i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function IO(i){let e,t,n;return t=new Ci({props:{name:Dn(i[1],i[3].createdBy),side:24}}),{c(){e=y("td"),V(t.$$.fragment),O(e,"class","text-center"),Ae(e,"is-sort",i[4]=="-_sys.createdBy"||i[4]=="_sys.createdBy")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p(r,s){const o={};s&10&&(o.name=Dn(r[1],r[3].createdBy)),t.$set(o),(!n||s&16)&&Ae(e,"is-sort",r[4]=="-_sys.createdBy"||r[4]=="_sys.createdBy")},i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function NO(i){let e,t,n;return t=new Ci({props:{name:Dn(i[1],i[3].updatedBy),side:24}}),{c(){e=y("td"),V(t.$$.fragment),O(e,"class","text-center"),Ae(e,"is-sort",i[4]=="-_sys.updatedBy"||i[4]=="_sys.updatedBy")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p(r,s){const o={};s&10&&(o.name=Dn(r[1],r[3].updatedBy)),t.$set(o),(!n||s&16)&&Ae(e,"is-sort",r[4]=="-_sys.updatedBy"||r[4]=="_sys.updatedBy")},i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function ZO(i){let e,t=Bi(i[3].createdAt)+"",n;return{c(){e=y("td"),n=W(t),Ae(e,"is-sort",i[4]=="-_sys.createdAt"||i[4]=="_sys.createdAt")},m(r,s){A(r,e,s),v(e,n)},p(r,s){s&8&&t!==(t=Bi(r[3].createdAt)+"")&&K(n,t),s&16&&Ae(e,"is-sort",r[4]=="-_sys.createdAt"||r[4]=="_sys.createdAt")},d(r){r&&P(e)}}}function BO(i){let e,t=Bi(i[3].updatedAt)+"",n;return{c(){e=y("td"),n=W(t),Ae(e,"is-sort",i[4]=="-_sys.updatedAt"||i[4]=="_sys.updatedAt")},m(r,s){A(r,e,s),v(e,n)},p(r,s){s&8&&t!==(t=Bi(r[3].updatedAt)+"")&&K(n,t),s&16&&Ae(e,"is-sort",r[4]=="-_sys.updatedAt"||r[4]=="_sys.updatedAt")},d(r){r&&P(e)}}}function sM(i){var k,Q,x,C,M;let e,t=(k=i[0].visible)==null?void 0:k.includes("_sys.status"),n,r=(Q=i[0].visible)==null?void 0:Q.includes("_sys.createdBy"),s,o=(x=i[0].visible)==null?void 0:x.includes("_sys.updatedBy"),l,a=(C=i[0].visible)==null?void 0:C.includes("_sys.createdAt"),c,u=(M=i[0].visible)==null?void 0:M.includes("_sys.updatedAt"),h,f,d=ue(i[6]),m=[];for(let $=0;$R(m[$],1,1,()=>{m[$]=null});let g=t&&LO(i),b=r&&IO(i),w=o&&NO(i),S=a&&ZO(i),_=u&&BO(i);return{c(){for(let $=0;${g=null}),pe()),N&1&&(r=(J=$[0].visible)==null?void 0:J.includes("_sys.createdBy")),r?b?(b.p($,N),N&1&&T(b,1)):(b=IO($),b.c(),T(b,1),b.m(s.parentNode,s)):b&&(me(),R(b,1,1,()=>{b=null}),pe()),N&1&&(o=(te=$[0].visible)==null?void 0:te.includes("_sys.updatedBy")),o?w?(w.p($,N),N&1&&T(w,1)):(w=NO($),w.c(),T(w,1),w.m(l.parentNode,l)):w&&(me(),R(w,1,1,()=>{w=null}),pe()),N&1&&(a=(ie=$[0].visible)==null?void 0:ie.includes("_sys.createdAt")),a?S?S.p($,N):(S=ZO($),S.c(),S.m(c.parentNode,c)):S&&(S.d(1),S=null),N&1&&(u=(le=$[0].visible)==null?void 0:le.includes("_sys.updatedAt")),u?_?_.p($,N):(_=BO($),_.c(),_.m(h.parentNode,h)):_&&(_.d(1),_=null)},i($){if(!f){for(let N=0;N{"schema"in u&&t(0,n=u.schema),"users"in u&&t(1,r=u.users),"graph"in u&&t(2,s=u.graph),"record"in u&&t(3,o=u.record),"sortParam"in u&&t(4,l=u.sortParam),"sortField"in u&&t(5,a=u.sortField),"visibleColumns"in u&&t(6,c=u.visibleColumns)},[n,r,s,o,l,a,c]}let lM=class extends oe{constructor(e){super(),se(this,e,oM,sM,re,{schema:0,users:1,graph:2,record:3,sortParam:4,sortField:5,visibleColumns:6})}};const aM=(i,e,t)=>t.length===e.length?[]:(i.currentTarget.checked=t.length>0,e),cM=(i,e)=>e.find(n=>n.id===i.id)?e.filter(n=>n.id!==i.id):[...e,i];function uM(i){let e,t,n,r;return{c(){e=y("div"),t=y("input"),O(t,"id","c1-13"),O(t,"type","checkbox"),t.value=i[1],t.indeterminate=i[0],t.checked=i[2],O(e,"class","checkbox-wrapper")},m(s,o){A(s,e,o),v(e,t),i[5](t),n||(r=G(t,"change",i[4]),n=!0)},p(s,[o]){o&2&&(t.value=s[1]),o&1&&(t.indeterminate=s[0]),o&4&&(t.checked=s[2])},i:U,o:U,d(s){s&&P(e),i[5](null),n=!1,r()}}}function hM(i,e,t){let n=null,{indeterminate:r=!1}=e,{value:s}=e,{checked:o=!1}=e;function l(c){Lr.call(this,i,c)}function a(c){Se[c?"unshift":"push"](()=>{n=c,t(3,n)})}return i.$$set=c=>{"indeterminate"in c&&t(0,r=c.indeterminate),"value"in c&&t(1,s=c.value),"checked"in c&&t(2,o=c.checked)},[r,s,o,n,l,a]}let rh=class extends oe{constructor(e){super(),se(this,e,hM,uM,re,{indeterminate:0,value:1,checked:2})}};function WO(i,e,t){const n=i.slice();return n[17]=e[t],n}function XO(i,e,t){const n=i.slice();return n[20]=e[t],n}function FO(i,e,t){const n=i.slice();return n[23]=e[t],n}function YO(i){let e,t,n;return t=new rh({props:{value:"",indeterminate:i[0].length>0&&i[0].length0&&r[0].length{S=null}),pe()),e[17].status==="draft"?_?_.p(e,Q):(_=jO(e),_.c(),_.m(o,l)):_&&(_.d(1),_=null),(!w||Q&8)&&a!==(a=e[17].data.name+"")&&K(c,a),(!w||Q&8&&u!==(u=e[11].lucentUrl+"/records/"+e[17].id))&&O(o,"href",u),(!w||Q&256&&h!==(h=e[8]?"_blank":"_self"))&&O(o,"target",h);const x={};Q&8&&(x.record=e[17]),Q&16&&(x.graph=e[4]),Q&2&&(x.schema=e[1]),Q&1024&&(x.visibleColumns=e[10]),Q&64&&(x.sortParam=e[6]),Q&128&&(x.sortField=e[7]),Q&4&&(x.users=e[2]),d.$set(x);const C={};Q&12&&(C.name=Dn(e[2],e[17].updatedBy)),g.$set(C)},i(k){w||(T(S),T(d.$$.fragment,k),T(g.$$.fragment,k),w=!0)},o(k){R(S),R(d.$$.fragment,k),R(g.$$.fragment,k),w=!1},d(k){k&&P(t),S&&S.d(),_&&_.d(),z(d),z(g)}}}function fM(i){let e,t,n,r,s,o,l,a,c,u,h=[],f=new Map,d,m=i[9]&&YO(i),p=ue(i[10]),g=[];for(let k=0;kk[17].id;for(let k=0;k{m=null}),pe()),Q&1152){p=ue(k[10]);let x;for(x=0;x{var k;return(k=s.visible)==null?void 0:k.includes(_.name)},w=(_,k)=>k.id===_.id,S=_=>g(_);return i.$$set=_=>{"schema"in _&&t(1,s=_.schema),"users"in _&&t(2,o=_.users),"records"in _&&t(3,l=_.records),"graph"in _&&t(4,a=_.graph),"systemFields"in _&&t(5,c=_.systemFields),"sortParam"in _&&t(6,u=_.sortParam),"sortField"in _&&t(7,h=_.sortField),"inModal"in _&&t(8,f=_.inModal),"isWritable"in _&&t(9,d=_.isWritable),"selected"in _&&t(0,m=_.selected)},i.$$.update=()=>{i.$$.dirty&2&&t(10,n=s.fields.filter(_=>{var k;return((k=s.visible)==null?void 0:k.includes(_.name))??[]}))},[m,s,o,l,a,c,u,h,f,d,n,r,p,g,b,w,S]}let mM=class extends oe{constructor(e){super(),se(this,e,dM,fM,re,{schema:1,users:2,records:3,graph:4,systemFields:5,sortParam:6,sortField:7,inModal:8,isWritable:9,selected:0})}};function pM(i){let e,t,n,r;function s(a){i[17](a)}function o(a){i[18](a)}let l={systemFields:i[13],sortParam:i[2],sortField:i[3],operators:i[4],filter:i[5],graph:i[12],inModal:i[14],modalUrl:i[9],isWritable:i[15]};return i[0]!==void 0&&(l.schema=i[0]),i[1]!==void 0&&(l.records=i[1]),e=new rQ({props:l}),Se.push(()=>He(e,"schema",s)),Se.push(()=>He(e,"records",o)),e.$on("refresh",i[16]),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&8192&&(u.systemFields=a[13]),c&4&&(u.sortParam=a[2]),c&8&&(u.sortField=a[3]),c&16&&(u.operators=a[4]),c&32&&(u.filter=a[5]),c&4096&&(u.graph=a[12]),c&16384&&(u.inModal=a[14]),c&512&&(u.modalUrl=a[9]),c&32768&&(u.isWritable=a[15]),!t&&c&1&&(t=!0,u.schema=a[0],nt(()=>t=!1)),!n&&c&2&&(n=!0,u.records=a[1],nt(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function gM(i){let e,t;return e=new OQ({props:{schema:i[0],selected:i[10],filter:i[5]}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.schema=n[0]),r&1024&&(s.selected=n[10]),r&32&&(s.filter=n[5]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function OM(i){let e,t,n,r=i[0].label+"",s,o,l,a,c,u,h,f,d,m,p;const g=[gM,pM],b=[];function w(k,Q){return k[10].length>0&&!k[14]&&k[15]?0:1}l=w(i),a=b[l]=g[l](i);function S(k){i[19](k)}let _={records:i[1],graph:i[12],schema:i[0],sortParam:i[2],sortField:i[3],systemFields:i[13],inModal:i[14],users:i[11],isWritable:i[15]};return i[10]!==void 0&&(_.selected=i[10]),u=new mM({props:_}),Se.push(()=>He(u,"selected",S)),m=new fQ({props:{limit:i[6],skip:i[7],total:i[8],inModal:i[14],modalUrl:i[9]}}),m.$on("refresh",i[16]),{c(){e=y("div"),t=y("div"),n=y("h3"),s=W(r),o=D(),a.c(),c=D(),V(u.$$.fragment),d=D(),V(m.$$.fragment),O(n,"class","header-normal mb-5"),O(t,"class",f=i[14]?"mt-0":"mt-5"),O(e,"class","")},m(k,Q){A(k,e,Q),v(e,t),v(t,n),v(n,s),v(t,o),b[l].m(t,null),v(t,c),Y(u,t,null),v(e,d),Y(m,e,null),p=!0},p(k,[Q]){(!p||Q&1)&&r!==(r=k[0].label+"")&&K(s,r);let x=l;l=w(k),l===x?b[l].p(k,Q):(me(),R(b[x],1,1,()=>{b[x]=null}),pe(),a=b[l],a?a.p(k,Q):(a=b[l]=g[l](k),a.c()),T(a,1),a.m(t,c));const C={};Q&2&&(C.records=k[1]),Q&4096&&(C.graph=k[12]),Q&1&&(C.schema=k[0]),Q&4&&(C.sortParam=k[2]),Q&8&&(C.sortField=k[3]),Q&8192&&(C.systemFields=k[13]),Q&16384&&(C.inModal=k[14]),Q&2048&&(C.users=k[11]),Q&32768&&(C.isWritable=k[15]),!h&&Q&1024&&(h=!0,C.selected=k[10],nt(()=>h=!1)),u.$set(C),(!p||Q&16384&&f!==(f=k[14]?"mt-0":"mt-5"))&&O(t,"class",f);const M={};Q&64&&(M.limit=k[6]),Q&128&&(M.skip=k[7]),Q&256&&(M.total=k[8]),Q&16384&&(M.inModal=k[14]),Q&512&&(M.modalUrl=k[9]),m.$set(M)},i(k){p||(T(a),T(u.$$.fragment,k),T(m.$$.fragment,k),p=!0)},o(k){R(a),R(u.$$.fragment,k),R(m.$$.fragment,k),p=!1},d(k){k&&P(e),b[l].d(),z(u),z(m)}}}function bM(i,e,t){let{schema:n}=e,{users:r}=e,{records:s}=e,{graph:o}=e,{systemFields:l}=e,{sortParam:a}=e,{sortField:c}=e,{operators:u}=e,{filter:h}=e,{limit:f}=e,{skip:d}=e,{total:m}=e,{inModal:p}=e,{modalUrl:g}=e,{selected:b=[]}=e,{isWritable:w=!1}=e;function S(x){const C=x.detail;Qa(C).then(M=>{t(1,s=M.records),t(2,a=M.sortParam),t(3,c=M.sortField),t(4,u=M.operators),t(5,h=M.filter),t(7,d=M.skip),t(6,f=M.limit),t(8,m=M.total),t(9,g=M.modalUrl),document.querySelector("dialog h3").scrollIntoView()}).catch(M=>{console.log(M)})}function _(x){n=x,t(0,n)}function k(x){s=x,t(1,s)}function Q(x){b=x,t(10,b)}return i.$$set=x=>{"schema"in x&&t(0,n=x.schema),"users"in x&&t(11,r=x.users),"records"in x&&t(1,s=x.records),"graph"in x&&t(12,o=x.graph),"systemFields"in x&&t(13,l=x.systemFields),"sortParam"in x&&t(2,a=x.sortParam),"sortField"in x&&t(3,c=x.sortField),"operators"in x&&t(4,u=x.operators),"filter"in x&&t(5,h=x.filter),"limit"in x&&t(6,f=x.limit),"skip"in x&&t(7,d=x.skip),"total"in x&&t(8,m=x.total),"inModal"in x&&t(14,p=x.inModal),"modalUrl"in x&&t(9,g=x.modalUrl),"selected"in x&&t(10,b=x.selected),"isWritable"in x&&t(15,w=x.isWritable)},[n,s,a,c,u,h,f,d,m,g,b,r,o,l,p,w,S,_,k,Q]}let Iy=class extends oe{constructor(e){super(),se(this,e,bM,OM,re,{schema:0,users:11,records:1,graph:12,systemFields:13,sortParam:2,sortField:3,operators:4,filter:5,limit:6,skip:7,total:8,inModal:14,modalUrl:9,selected:10,isWritable:15})}};function GO(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_=i[2].length>0&&HO(i);f=new Ot({props:{icon:"close"}});const k=[i[3]];function Q(C){i[7](C)}let x={};for(let C=0;CHe(p,"selected",Q)),{c(){e=y("div"),t=y("button"),n=W("Insert"),s=D(),o=y("button"),l=W("Replace"),c=D(),_&&_.c(),u=D(),h=y("button"),V(f.$$.fragment),d=D(),m=y("div"),V(p.$$.fragment),O(t,"type","button"),O(t,"class","button"),t.disabled=r=i[2].length===0,O(o,"type","button"),O(o,"class","button"),o.disabled=a=i[2].length===0,O(h,"type","button"),O(h,"class","button close"),O(h,"aria-label","Close"),O(e,"class","dialog-header"),O(m,"class","dialog-body")},m(C,M){A(C,e,M),v(e,t),v(t,n),v(e,s),v(e,o),v(o,l),v(e,c),_&&_.m(e,null),v(e,u),v(e,h),Y(f,h,null),A(C,d,M),A(C,m,M),Y(p,m,null),b=!0,w||(S=[G(t,"click",i[4]),G(o,"click",i[5]),G(h,"click",Ln(i[0]))],w=!0)},p(C,M){(!b||M&4&&r!==(r=C[2].length===0))&&(t.disabled=r),(!b||M&4&&a!==(a=C[2].length===0))&&(o.disabled=a),C[2].length>0?_?_.p(C,M):(_=HO(C),_.c(),_.m(e,u)):_&&(_.d(1),_=null);const $=M&8?So(k,[_o(C[3])]):{};!g&&M&4&&(g=!0,$.selected=C[2],nt(()=>g=!1)),p.$set($)},i(C){b||(T(f.$$.fragment,C),T(p.$$.fragment,C),b=!0)},o(C){R(f.$$.fragment,C),R(p.$$.fragment,C),b=!1},d(C){C&&(P(e),P(d),P(m)),_&&_.d(),z(f),z(p),w=!1,ut(S)}}}function HO(i){let e,t=i[2].length+"",n,r;return{c(){e=y("span"),n=W(t),r=W(" records selected"),O(e,"class","")},m(s,o){A(s,e,o),v(e,n),v(e,r)},p(s,o){o&4&&t!==(t=s[2].length+"")&&K(n,t)},d(s){s&&P(e)}}}function vM(i){let e,t,n=i[3].schema&&GO(i);return{c(){e=y("dialog"),n&&n.c()},m(r,s){A(r,e,s),n&&n.m(e,null),i[8](e),t=!0},p(r,[s]){r[3].schema?n?(n.p(r,s),s&8&&T(n,1)):(n=GO(r),n.c(),T(n,1),n.m(e,null)):n&&(me(),R(n,1,1,()=>{n=null}),pe())},i(r){t||(T(n),t=!0)},o(r){R(n),t=!1},d(r){r&&P(e),n&&n.d(),i[8](null)}}}function wM(i,e,t){let n,r;const s=nn(),o=je("channel");let l=[];function a(p){p&&p.preventDefault(),r.close(),t(2,l=[])}function c(p){Qa(o.lucentUrl+"/content/"+p).then(g=>{t(3,n=g)}).catch(g=>console.log(g))}function u(p){p.preventDefault(),s("insert",{records:l,action:"insert",schema:n.schema.name})}function h(p){p.preventDefault(),s("insert",{records:l,action:"replace"})}function f(p){r.showModal(),c(p)}function d(p){l=p,t(2,l)}function m(p){Se[p?"unshift":"push"](()=>{r=p,t(1,r)})}return t(3,n={}),[a,r,l,n,u,h,f,d,m]}class Ny extends oe{constructor(e){super(),se(this,e,wM,vM,re,{close:0,open:6})}get close(){return this.$$.ctx[0]}get open(){return this.$$.ctx[6]}}function yM(i){let e,t,n,r,s,o,l,a,c;r=new Ot({props:{icon:"close"}});const u=i[4].default,h=Gl(u,i,i[3],null);return{c(){e=y("dialog"),t=y("div"),n=y("button"),V(r.$$.fragment),s=D(),o=y("div"),h&&h.c(),O(n,"type","button"),O(n,"class","button close"),O(n,"aria-label","Close"),O(t,"class","dialog-header"),O(o,"class","dialog-body"),fe(o,"min-width","900px")},m(f,d){A(f,e,d),v(e,t),v(t,n),Y(r,n,null),v(e,s),v(e,o),h&&h.m(o,null),i[5](e),l=!0,a||(c=G(n,"click",Ln(i[0])),a=!0)},p(f,[d]){h&&h.p&&(!l||d&8)&&Kl(h,u,f,f[3],l?Hl(u,f[3],d,null):Jl(f[3]),null)},i(f){l||(T(r.$$.fragment,f),T(h,f),l=!0)},o(f){R(r.$$.fragment,f),R(h,f),l=!1},d(f){f&&P(e),z(r),h&&h.d(f),i[5](null),a=!1,c()}}}function kM(i,e,t){let{$$slots:n={},$$scope:r}=e,s;function o(c){c&&c.preventDefault(),s.close()}function l(){s.showModal()}function a(c){Se[c?"unshift":"push"](()=>{s=c,t(1,s)})}return i.$$set=c=>{"$$scope"in c&&t(3,r=c.$$scope)},[o,s,l,r,n,a]}class SM extends oe{constructor(e){super(),se(this,e,kM,yM,re,{close:0,open:2})}get close(){return this.$$.ctx[0]}get open(){return this.$$.ctx[2]}}function KO(i,e,t){const n=i.slice();return n[18]=e[t],n}function JO(i,e,t){const n=i.slice();return n[18]=e[t],n}function _M(i){let e,t,n,r,s,o,l,a;return s=new Ot({props:{icon:"magnifying-glass"}}),{c(){e=y("div"),t=y("button"),t.textContent="New",n=D(),r=y("button"),V(s.$$.fragment),O(t,"class","button"),O(r,"class","button"),fe(e,"display","flex"),fe(e,"align-items","center"),fe(e,"gap","4px")},m(c,u){A(c,e,u),v(e,t),v(e,n),v(e,r),Y(s,r,null),o=!0,l||(a=[G(t,"click",i[11]),G(r,"click",i[12])],l=!0)},p:U,i(c){o||(T(s.$$.fragment,c),o=!0)},o(c){R(s.$$.fragment,c),o=!1},d(c){c&&P(e),z(s),l=!1,ut(a)}}}function CM(i){let e,t,n,r,s;return t=new Gi({props:{$$slots:{button:[AM],default:[PM]},$$scope:{ctx:i}}}),r=new Gi({props:{$$slots:{button:[TM],default:[xM]},$$scope:{ctx:i}}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),V(r.$$.fragment),fe(e,"display","flex"),fe(e,"align-items","center"),fe(e,"gap","4px")},m(o,l){A(o,e,l),Y(t,e,null),v(e,n),Y(r,e,null),s=!0},p(o,l){const a={};l&8388609&&(a.$$scope={dirty:l,ctx:o}),t.$set(a);const c={};l&8388609&&(c.$$scope={dirty:l,ctx:o}),r.$set(c)},i(o){s||(T(t.$$.fragment,o),T(r.$$.fragment,o),s=!0)},o(o){R(t.$$.fragment,o),R(r.$$.fragment,o),s=!1},d(o){o&&P(e),z(t),z(r)}}}function e1(i){let e,t=i[18].label+"",n,r,s,o;function l(...a){return i[9](i[18],...a)}return{c(){e=y("button"),n=W(t),r=D(),O(e,"class","button")},m(a,c){A(a,e,c),v(e,n),v(e,r),s||(o=G(e,"click",l),s=!0)},p(a,c){i=a,c&1&&t!==(t=i[18].label+"")&&K(n,t)},d(a){a&&P(e),s=!1,o()}}}function PM(i){let e,t=ue(i[0]),n=[];for(let r=0;r{n=null}),pe())},i(r){t||(T(n),t=!0)},o(r){R(n),t=!1},d(r){r&&P(e),n&&n.d(r)}}}function MM(i){let e,t,n,r,s,o,l;const a=[CM,_M],c=[];function u(d,m){return d[0].length>1?0:1}e=u(i),t=c[e]=a[e](i);let h={$$slots:{default:[QM]},$$scope:{ctx:i}};r=new SM({props:h}),i[14](r);let f={};return o=new Ny({props:f}),i[15](o),o.$on("insert",i[6]),{c(){t.c(),n=D(),V(r.$$.fragment),s=D(),V(o.$$.fragment)},m(d,m){c[e].m(d,m),A(d,n,m),Y(r,d,m),A(d,s,m),Y(o,d,m),l=!0},p(d,[m]){let p=e;e=u(d),e===p?c[e].p(d,m):(me(),R(c[p],1,1,()=>{c[p]=null}),pe(),t=c[e],t?t.p(d,m):(t=c[e]=a[e](d),t.c()),T(t,1),t.m(n.parentNode,n));const g={};m&8388616&&(g.$$scope={dirty:m,ctx:d}),r.$set(g);const b={};o.$set(b)},i(d){l||(T(t),T(r.$$.fragment,d),T(o.$$.fragment,d),l=!0)},o(d){R(t),R(r.$$.fragment,d),R(o.$$.fragment,d),l=!1},d(d){d&&(P(n),P(s)),c[e].d(d),i[14](null),z(r,d),i[15](null),z(o,d)}}}function EM(i,e,t){const n=nn(),r=je("channel");let{schemas:s}=e,{recordId:o}=e,l,a,c;function u(k,Q){k.preventDefault(),l.open(Q)}function h(k){k.preventDefault(),console.log("Save inline"),t(3,c=null),a.close(),n("save",{records:k.detail.records,after:o})}function f(k){k.preventDefault(),l.close(),n("insert",{records:k.detail.records,schema:k.detail.schema,after:o})}function d(k,Q){k.preventDefault(),t(3,c=null),Qa(r.lucentUrl+"/records/newInline?schema="+Q).then(x=>{t(3,c=x),a.open()}).catch(x=>{console.log(x)})}const m=(k,Q)=>d(Q,k.name),p=(k,Q)=>u(Q,k.name),g=k=>d(k,s[0].name),b=k=>u(k,s[0].name),w=k=>t(3,c=null);function S(k){Se[k?"unshift":"push"](()=>{a=k,t(2,a)})}function _(k){Se[k?"unshift":"push"](()=>{l=k,t(1,l)})}return i.$$set=k=>{"schemas"in k&&t(0,s=k.schemas),"recordId"in k&&t(8,o=k.recordId)},[s,l,a,c,u,h,f,d,o,m,p,g,b,w,S,_]}class RM extends oe{constructor(e){super(),se(this,e,EM,MM,re,{schemas:0,recordId:8})}}/**! + total`),O(t,"class","pagination"),O(o,"class","font-medium"),O(u,"class","font-medium"),O(m,"class","font-medium"),le(r,"display","flex"),le(r,"justify-content","center"),le(r,"gap","4px")},m(S,_){x(S,e,_),b(e,t),w&&w.m(t,null),x(S,n,_),x(S,r,_),b(r,s),b(r,o),b(o,a),b(r,c),b(r,u),b(u,f),b(r,d),b(r,m),b(m,p),b(r,g),v=!0},p(S,[_]){S[5]>1?w?(w.p(S,_),_&32&&T(w,1)):(w=_O(S),w.c(),T(w,1),w.m(t,null)):w&&(Oe(),R(w,1,1,()=>{w=null}),be()),(!v||_&8)&&l!==(l=+S[3]+1+"")&&K(a,l),(!v||_&28)&&h!==(h=(+S[3]+S[2]>S[4]?S[4]:+S[3]+S[2])+"")&&K(f,h),(!v||_&16)&&K(p,S[4])},i(S){v||(T(w),v=!0)},o(S){R(w),v=!1},d(S){S&&(P(e),P(n),P(r)),w&&w.d()}}}function sQ(i,e,t){let n,r,s;const o=nn();let{inModal:l}=e,{modalUrl:a}=e,{limit:c}=e,{skip:u}=e,{total:h}=e;const f=(v,w,S=1)=>Array.from({length:Math.ceil((w-v)/S)},(_,k)=>v+k*S);function d(v){v.preventDefault(),p(n)}function m(v){v.preventDefault(),p(1)}function p(v){const w=new URL(a??window.location.href);let S=v*c-c;w.searchParams.set("skip",S),l?o("refresh",w):window.location=w}function g(v){vs.call(this,i,v)}return i.$$set=v=>{"inModal"in v&&t(0,l=v.inModal),"modalUrl"in v&&t(1,a=v.modalUrl),"limit"in v&&t(2,c=v.limit),"skip"in v&&t(3,u=v.skip),"total"in v&&t(4,h=v.total)},i.$$.update=()=>{i.$$.dirty&20&&t(5,n=Math.ceil(h/c)),i.$$.dirty&12&&t(6,r=Math.ceil((u-1)/c)+1),i.$$.dirty&96&&t(7,s=f(r-3,r+4).filter(v=>v>0&&v<=n))},[l,a,c,u,h,n,r,s,d,m,g]}class oQ extends oe{constructor(e){super(),se(this,e,sQ,rQ,re,{inModal:0,modalUrl:1,limit:2,skip:3,total:4})}}function lQ(i){let e,t,n;return{c(){e=y("button"),e.textContent="Move to trash",O(e,"type","button"),O(e,"class","button")},m(r,s){x(r,e,s),t||(n=G(e,"click",Ln(i[9])),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function aQ(i){let e,t,n,r,s,o,l=i[1].hasDrafts&&CO(i);return{c(){e=y("button"),e.textContent="Publish",t=D(),l&&l.c(),n=D(),r=y("button"),r.textContent="Delete forever",O(e,"type","button"),O(e,"class","button"),O(r,"type","button"),O(r,"class","button")},m(a,c){x(a,e,c),x(a,t,c),l&&l.m(a,c),x(a,n,c),x(a,r,c),s||(o=[G(e,"click",Ln(i[7])),G(r,"click",Ln(i[3]))],s=!0)},p(a,c){a[1].hasDrafts?l?l.p(a,c):(l=CO(a),l.c(),l.m(n.parentNode,n)):l&&(l.d(1),l=null)},d(a){a&&(P(e),P(t),P(n),P(r)),l&&l.d(a),s=!1,ht(o)}}}function CO(i){let e,t,n;return{c(){e=y("button"),e.textContent="Make Draft",O(e,"type","button"),O(e,"class","button")},m(r,s){x(r,e,s),t||(n=G(e,"click",Ln(i[8])),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function cQ(i){let e,t,n=i[0].length+"",r,s,o,l,a,c,u,h,f;function d(g,v){return g[2].status_in==="trashed"?aQ:lQ}let m=d(i),p=m(i);return{c(){e=y("div"),t=y("span"),r=W(n),s=W(" records selected"),o=D(),l=y("button"),l.textContent="Publish",a=D(),c=y("button"),c.textContent="Make Draft",u=D(),p.c(),O(t,"class","me-2"),O(l,"type","button"),O(l,"class","button"),O(c,"type","button"),O(c,"class","button"),le(e,"display","flex"),le(e,"align-items","center"),le(e,"gap","8px")},m(g,v){x(g,e,v),b(e,t),b(t,r),b(t,s),b(e,o),b(e,l),b(e,a),b(e,c),b(e,u),p.m(e,null),h||(f=[G(l,"click",Ln(i[5])),G(c,"click",Ln(i[6]))],h=!0)},p(g,[v]){v&1&&n!==(n=g[0].length+"")&&K(r,n),m===(m=d(g))&&p?p.p(g,v):(p.d(1),p=m(g),p&&(p.c(),p.m(e,null)))},i:U,o:U,d(g){g&&P(e),p.d(),h=!1,ht(f)}}}function uQ(i,e,t){const n=Ue("channel");let{selected:r}=e,{schema:s}=e,{filter:o}=e;function l(m){m.preventDefault(),Jn(n.lucentUrl+"/records/delete",{ids:r.map(p=>p.id)}).then(p=>{window.location.reload()}).catch(p=>{console.log(p)})}function a(m,p){Jn(n.lucentUrl+"/records/status/"+p,{schemaName:s.name,records:r}).then(g=>{window.location.reload()}).catch(g=>{console.log(g)})}const c=m=>a(m,"published"),u=m=>a(m,"draft"),h=m=>a(m,"published"),f=m=>a(m,"draft"),d=m=>a(m,"trashed");return i.$$set=m=>{"selected"in m&&t(0,r=m.selected),"schema"in m&&t(1,s=m.schema),"filter"in m&&t(2,o=m.filter)},[r,s,o,l,a,c,u,h,f,d]}class hQ extends oe{constructor(e){super(),se(this,e,uQ,cQ,re,{selected:0,schema:1,filter:2})}}function fQ(i){let e;return{c(){e=W(i[0])},m(t,n){x(t,e,n)},p(t,[n]){n&1&&K(e,t[0])},i:U,o:U,d(t){t&&P(e)}}}function dQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let mQ=class extends oe{constructor(e){super(),se(this,e,dQ,fQ,re,{value:0})}};function PO(i){let e,t,n,r;return{c(){e=y("div"),t=y("span"),n=D(),r=W(i[0]),O(t,"class","color border border-2 svelte-78o2k4"),le(t,"background",i[0]),O(e,"class","d-inline-flex")},m(s,o){x(s,e,o),b(e,t),b(e,n),b(e,r)},p(s,o){o&1&&le(t,"background",s[0]),o&1&&K(r,s[0])},d(s){s&&P(e)}}}function pQ(i){let e,t=i[0]&&PO(i);return{c(){t&&t.c(),e=Ie()},m(n,r){t&&t.m(n,r),x(n,e,r)},p(n,[r]){n[0]?t?t.p(n,r):(t=PO(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(n){n&&P(e),t&&t.d(n)}}}function gQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let OQ=class extends oe{constructor(e){super(),se(this,e,gQ,pQ,re,{value:0})}};function AO(i){let e,t,n;return{c(){e=y("a"),t=W(i[1]),O(e,"href",n=i[2].lucentUrl+"/records/"+i[0].id),O(e,"title",i[1]),O(e,"class","reference svelte-nbbgyi")},m(r,s){x(r,e,s),b(e,t)},p(r,s){s&2&&K(t,r[1]),s&1&&n!==(n=r[2].lucentUrl+"/records/"+r[0].id)&&O(e,"href",n),s&2&&O(e,"title",r[1])},d(r){r&&P(e)}}}function bQ(i){var n;let e,t=((n=i[0])==null?void 0:n.data)&&AO(i);return{c(){t&&t.c(),e=Ie()},m(r,s){t&&t.m(r,s),x(r,e,s)},p(r,[s]){var o;(o=r[0])!=null&&o.data?t?t.p(r,s):(t=AO(r),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:U,o:U,d(r){r&&P(e),t&&t.d(r)}}}function vQ(i,e,t){let n;const r=Ue("channel");let{record:s}=e;return i.$$set=o=>{"record"in o&&t(0,s=o.record)},i.$$.update=()=>{i.$$.dirty&1&&t(1,n=s.data.name)},[s,n,r]}class Cy extends oe{constructor(e){super(),se(this,e,vQ,bQ,re,{record:0})}}function xO(i,e,t){const n=i.slice();return n[5]=e[t],n}function TO(i){let e,t,n,r;return t=new Cy({props:{schemas:i[0],graph:i[1],record:i[5]}}),{c(){e=y("span"),V(t.$$.fragment),n=D(),O(e,"class","reference")},m(s,o){x(s,e,o),Y(t,e,null),b(e,n),r=!0},p(s,o){const l={};o&1&&(l.schemas=s[0]),o&2&&(l.graph=s[1]),o&4&&(l.record=s[5]),t.$set(l)},i(s){r||(T(t.$$.fragment,s),r=!0)},o(s){R(t.$$.fragment,s),r=!1},d(s){s&&P(e),z(t)}}}function wQ(i){let e,t,n=fe(i[2]),r=[];for(let o=0;oR(r[o],1,1,()=>{r[o]=null});return{c(){e=y("div");for(let o=0;o{"record"in a&&t(3,r=a.record),"field"in a&&t(4,s=a.field),"schemas"in a&&t(0,o=a.schemas),"graph"in a&&t(1,l=a.graph)},i.$$.update=()=>{var a;i.$$.dirty&26&&t(2,n=((a=l.edges)==null?void 0:a.filter(c=>c.field===s.name&&c.source===r.id).map(c=>l.records.find(u=>u.id===c.target)).filter(c=>!!c))??[])},[o,l,n,r,s]}let kQ=class extends oe{constructor(e){super(),se(this,e,yQ,wQ,re,{record:3,field:4,schemas:0,graph:1})}};function SQ(i){let e;return{c(){e=W(i[0])},m(t,n){x(t,e,n)},p(t,[n]){n&1&&K(e,t[0])},i:U,o:U,d(t){t&&P(e)}}}function _Q(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let CQ=class extends oe{constructor(e){super(),se(this,e,_Q,SQ,re,{value:0})}};function PQ(i){let e,t;return{c(){e=y("div"),t=W(i[0]),O(e,"title",i[0]),O(e,"data-bs-toggle","tooltip"),O(e,"data-bs-placement","top"),O(e,"class","svelte-1ft053t")},m(n,r){x(n,e,r),b(e,t)},p(n,[r]){r&1&&K(t,n[0]),r&1&&O(e,"title",n[0])},i:U,o:U,d(n){n&&P(e)}}}function AQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let $h=class extends oe{constructor(e){super(),se(this,e,AQ,PQ,re,{value:0})}};function xQ(i){let e,t;return{c(){e=y("a"),t=W(i[0]),O(e,"href",i[0]),O(e,"target","_blank")},m(n,r){x(n,e,r),b(e,t)},p(n,[r]){r&1&&K(t,n[0]),r&1&&O(e,"href",n[0])},i:U,o:U,d(n){n&&P(e)}}}function TQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let QQ=class extends oe{constructor(e){super(),se(this,e,TQ,xQ,re,{value:0})}};function MQ(i){let e,t;return{c(){e=y("div"),t=W(i[0]),O(e,"title",i[0]),O(e,"data-bs-toggle","tooltip"),O(e,"data-bs-placement","top")},m(n,r){x(n,e,r),b(e,t)},p(n,[r]){r&1&&K(t,n[0]),r&1&&O(e,"title",n[0])},i:U,o:U,d(n){n&&P(e)}}}function EQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let RQ=class extends oe{constructor(e){super(),se(this,e,EQ,MQ,re,{value:0})}};function DQ(i){let e,t=cg(i[0])+"",n,r;return{c(){e=y("div"),n=W(t),O(e,"title",r=ug(i[0])),O(e,"data-bs-toggle","tooltip"),O(e,"data-bs-placement","top")},m(s,o){x(s,e,o),b(e,n)},p(s,[o]){o&1&&t!==(t=cg(s[0])+"")&&K(n,t),o&1&&r!==(r=ug(s[0]))&&O(e,"title",r)},i:U,o:U,d(s){s&&P(e)}}}function $Q(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let LQ=class extends oe{constructor(e){super(),se(this,e,$Q,DQ,re,{value:0})}};function QO(i,e,t){const n=i.slice();return n[4]=e[t],n}function MO(i){let e,t,n,r;return t=new Xo({props:{record:i[4],size:"tiny"}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),O(e,"class","me-1")},m(s,o){x(s,e,o),Y(t,e,null),b(e,n),r=!0},p:U,i(s){r||(T(t.$$.fragment,s),r=!0)},o(s){R(t.$$.fragment,s),r=!1},d(s){s&&P(e),z(t)}}}function IQ(i){let e,t,n=fe(i[0]),r=[];for(let o=0;oR(r[o],1,1,()=>{r[o]=null});return{c(){e=y("div");for(let o=0;oa.field===r.name&&a.source===n.id).map(a=>s.records.find(c=>c.id===a.target));return i.$$set=a=>{"record"in a&&t(1,n=a.record),"field"in a&&t(2,r=a.field),"graph"in a&&t(3,s=a.graph)},[o,n,r,s]}let ZQ=class extends oe{constructor(e){super(),se(this,e,NQ,IQ,re,{record:1,field:2,graph:3})}};function BQ(i){let e,t;return{c(){e=y("span"),t=W(i[0]),O(e,"class","badge rounded-pill bg-primary bg-opacity-75"),le(e,"max-width","64px"),le(e,"overflow","hidden"),le(e,"white-space","nowrap"),le(e,"text-overflow","ellipsis"),O(e,"title",i[0]),O(e,"data-bs-toggle","tooltip")},m(n,r){x(n,e,r),b(e,t)},p(n,[r]){r&1&&K(t,n[0]),r&1&&O(e,"title",n[0])},i:U,o:U,d(n){n&&P(e)}}}function WQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}let XQ=class extends oe{constructor(e){super(),se(this,e,WQ,BQ,re,{value:0})}};function FQ(i){let e,t;return{c(){e=y("div"),t=W(i[0]),O(e,"class","svelte-1ft053t")},m(n,r){x(n,e,r),b(e,t)},p(n,[r]){r&1&&K(t,n[0])},i:U,o:U,d(n){n&&P(e)}}}function YQ(i,e,t){let{value:n}=e;return i.$$set=r=>{"value"in r&&t(0,n=r.value)},[n]}class zQ extends oe{constructor(e){super(),se(this,e,YQ,FQ,re,{value:0})}}function VQ(i){let e,t,n;var r=i[4][i[0].info.name];function s(o,l){return{props:{value:o[2].data[o[0].name],record:o[2],graph:o[3],schema:o[1],field:o[0]}}}return r&&(e=Xr(r,s(i))),{c(){e&&V(e.$$.fragment),t=Ie()},m(o,l){e&&Y(e,o,l),x(o,t,l),n=!0},p(o,[l]){if(l&1&&r!==(r=o[4][o[0].info.name])){if(e){Oe();const a=e;R(a.$$.fragment,1,0,()=>{z(a,1)}),be()}r?(e=Xr(r,s(o)),V(e.$$.fragment),T(e.$$.fragment,1),Y(e,t.parentNode,t)):e=null}else if(r){const a={};l&5&&(a.value=o[2].data[o[0].name]),l&4&&(a.record=o[2]),l&8&&(a.graph=o[3]),l&2&&(a.schema=o[1]),l&1&&(a.field=o[0]),e.$set(a)}},i(o){n||(e&&T(e.$$.fragment,o),n=!0)},o(o){e&&R(e.$$.fragment,o),n=!1},d(o){o&&P(t),e&&z(e,o)}}}function UQ(i,e,t){const n={text:$h,slug:$h,rich:zQ,textarea:$h,color:OQ,checkbox:mQ,reference:kQ,number:CQ,url:QQ,date:RQ,datetime:LQ,uuid:XQ,file:ZQ};let{field:r}=e,{schema:s}=e,{record:o}=e,{graph:l}=e;return i.$$set=a=>{"field"in a&&t(0,r=a.field),"schema"in a&&t(1,s=a.schema),"record"in a&&t(2,o=a.record),"graph"in a&&t(3,l=a.graph)},[r,s,o,l,n]}class jQ extends oe{constructor(e){super(),se(this,e,UQ,VQ,re,{field:0,schema:1,record:2,graph:3})}}function qQ(i){return GQ()[i]}function GQ(){return{published:{value:"published",text:"Published",bg:"success",color:"white"},trashed:{value:"trashed",text:"Trashed",bg:"danger",color:"white"},draft:{value:"draft",text:"Draft",bg:"warning",color:"dark"}}}function HQ(i){let e,t=i[0].text+"",n;return{c(){e=y("span"),n=W(t),O(e,"class","badge text-bg-"+i[0].bg),le(e,"max-width","84px")},m(r,s){x(r,e,s),b(e,n)},p:U,i:U,o:U,d(r){r&&P(e)}}}function KQ(i,e,t){let{status:n}=e,r=qQ(n);return i.$$set=s=>{"status"in s&&t(1,n=s.status)},[r,n]}class Py extends oe{constructor(e){super(),se(this,e,KQ,HQ,re,{status:1})}}function Dn(i,e){var t;return i?((t=i.find(n=>n.id===e))==null?void 0:t.name)??e:e}function EO(i,e,t){const n=i.slice();return n[7]=e[t],n[9]=t,n}function RO(i){let e,t,n,r;return t=new jQ({props:{record:i[3],schema:i[0],graph:i[2],field:i[7]}}),{c(){e=y("td"),V(t.$$.fragment),O(e,"class",n="field-ui-"+i[7].info.name),Ae(e,"is-sort",i[7].name===i[5].name)},m(s,o){x(s,e,o),Y(t,e,null),r=!0},p(s,o){const l={};o&8&&(l.record=s[3]),o&1&&(l.schema=s[0]),o&4&&(l.graph=s[2]),o&64&&(l.field=s[7]),t.$set(l),(!r||o&64&&n!==(n="field-ui-"+s[7].info.name))&&O(e,"class",n),(!r||o&96)&&Ae(e,"is-sort",s[7].name===s[5].name)},i(s){r||(T(t.$$.fragment,s),r=!0)},o(s){R(t.$$.fragment,s),r=!1},d(s){s&&P(e),z(t)}}}function DO(i){let e,t,n;return t=new Py({props:{status:i[3].status}}),{c(){e=y("td"),V(t.$$.fragment),O(e,"class","text-center"),Ae(e,"is-sort",i[4]=="-status"||i[4]=="status")},m(r,s){x(r,e,s),Y(t,e,null),n=!0},p(r,s){const o={};s&8&&(o.status=r[3].status),t.$set(o),(!n||s&16)&&Ae(e,"is-sort",r[4]=="-status"||r[4]=="status")},i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function $O(i){let e,t,n;return t=new _i({props:{name:Dn(i[1],i[3].createdBy),side:24}}),{c(){e=y("td"),V(t.$$.fragment),O(e,"class","text-center"),Ae(e,"is-sort",i[4]=="-_sys.createdBy"||i[4]=="_sys.createdBy")},m(r,s){x(r,e,s),Y(t,e,null),n=!0},p(r,s){const o={};s&10&&(o.name=Dn(r[1],r[3].createdBy)),t.$set(o),(!n||s&16)&&Ae(e,"is-sort",r[4]=="-_sys.createdBy"||r[4]=="_sys.createdBy")},i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function LO(i){let e,t,n;return t=new _i({props:{name:Dn(i[1],i[3].updatedBy),side:24}}),{c(){e=y("td"),V(t.$$.fragment),O(e,"class","text-center"),Ae(e,"is-sort",i[4]=="-_sys.updatedBy"||i[4]=="_sys.updatedBy")},m(r,s){x(r,e,s),Y(t,e,null),n=!0},p(r,s){const o={};s&10&&(o.name=Dn(r[1],r[3].updatedBy)),t.$set(o),(!n||s&16)&&Ae(e,"is-sort",r[4]=="-_sys.updatedBy"||r[4]=="_sys.updatedBy")},i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function IO(i){let e,t=Bi(i[3].createdAt)+"",n;return{c(){e=y("td"),n=W(t),Ae(e,"is-sort",i[4]=="-_sys.createdAt"||i[4]=="_sys.createdAt")},m(r,s){x(r,e,s),b(e,n)},p(r,s){s&8&&t!==(t=Bi(r[3].createdAt)+"")&&K(n,t),s&16&&Ae(e,"is-sort",r[4]=="-_sys.createdAt"||r[4]=="_sys.createdAt")},d(r){r&&P(e)}}}function NO(i){let e,t=Bi(i[3].updatedAt)+"",n;return{c(){e=y("td"),n=W(t),Ae(e,"is-sort",i[4]=="-_sys.updatedAt"||i[4]=="_sys.updatedAt")},m(r,s){x(r,e,s),b(e,n)},p(r,s){s&8&&t!==(t=Bi(r[3].updatedAt)+"")&&K(n,t),s&16&&Ae(e,"is-sort",r[4]=="-_sys.updatedAt"||r[4]=="_sys.updatedAt")},d(r){r&&P(e)}}}function JQ(i){var k,A,C,Q,M;let e,t=(k=i[0].visible)==null?void 0:k.includes("_sys.status"),n,r=(A=i[0].visible)==null?void 0:A.includes("_sys.createdBy"),s,o=(C=i[0].visible)==null?void 0:C.includes("_sys.updatedBy"),l,a=(Q=i[0].visible)==null?void 0:Q.includes("_sys.createdAt"),c,u=(M=i[0].visible)==null?void 0:M.includes("_sys.updatedAt"),h,f,d=fe(i[6]),m=[];for(let L=0;LR(m[L],1,1,()=>{m[L]=null});let g=t&&DO(i),v=r&&$O(i),w=o&&LO(i),S=a&&IO(i),_=u&&NO(i);return{c(){for(let L=0;L{g=null}),be()),N&1&&(r=(J=L[0].visible)==null?void 0:J.includes("_sys.createdBy")),r?v?(v.p(L,N),N&1&&T(v,1)):(v=$O(L),v.c(),T(v,1),v.m(s.parentNode,s)):v&&(Oe(),R(v,1,1,()=>{v=null}),be()),N&1&&(o=(te=L[0].visible)==null?void 0:te.includes("_sys.updatedBy")),o?w?(w.p(L,N),N&1&&T(w,1)):(w=LO(L),w.c(),T(w,1),w.m(l.parentNode,l)):w&&(Oe(),R(w,1,1,()=>{w=null}),be()),N&1&&(a=(ie=L[0].visible)==null?void 0:ie.includes("_sys.createdAt")),a?S?S.p(L,N):(S=IO(L),S.c(),S.m(c.parentNode,c)):S&&(S.d(1),S=null),N&1&&(u=(ae=L[0].visible)==null?void 0:ae.includes("_sys.updatedAt")),u?_?_.p(L,N):(_=NO(L),_.c(),_.m(h.parentNode,h)):_&&(_.d(1),_=null)},i(L){if(!f){for(let N=0;N{"schema"in u&&t(0,n=u.schema),"users"in u&&t(1,r=u.users),"graph"in u&&t(2,s=u.graph),"record"in u&&t(3,o=u.record),"sortParam"in u&&t(4,l=u.sortParam),"sortField"in u&&t(5,a=u.sortField),"visibleColumns"in u&&t(6,c=u.visibleColumns)},[n,r,s,o,l,a,c]}let tM=class extends oe{constructor(e){super(),se(this,e,eM,JQ,re,{schema:0,users:1,graph:2,record:3,sortParam:4,sortField:5,visibleColumns:6})}};const nM=(i,e,t)=>t.length===e.length?[]:(i.currentTarget.checked=t.length>0,e),iM=(i,e)=>e.find(n=>n.id===i.id)?e.filter(n=>n.id!==i.id):[...e,i];function rM(i){let e,t,n,r;return{c(){e=y("div"),t=y("input"),O(t,"id","c1-13"),O(t,"type","checkbox"),t.value=i[1],t.indeterminate=i[0],t.checked=i[2],O(e,"class","checkbox-wrapper")},m(s,o){x(s,e,o),b(e,t),i[5](t),n||(r=G(t,"change",i[4]),n=!0)},p(s,[o]){o&2&&(t.value=s[1]),o&1&&(t.indeterminate=s[0]),o&4&&(t.checked=s[2])},i:U,o:U,d(s){s&&P(e),i[5](null),n=!1,r()}}}function sM(i,e,t){let n=null,{indeterminate:r=!1}=e,{value:s}=e,{checked:o=!1}=e;function l(c){vs.call(this,i,c)}function a(c){Ce[c?"unshift":"push"](()=>{n=c,t(3,n)})}return i.$$set=c=>{"indeterminate"in c&&t(0,r=c.indeterminate),"value"in c&&t(1,s=c.value),"checked"in c&&t(2,o=c.checked)},[r,s,o,n,l,a]}let rh=class extends oe{constructor(e){super(),se(this,e,sM,rM,re,{indeterminate:0,value:1,checked:2})}};function ZO(i,e,t){const n=i.slice();return n[17]=e[t],n}function BO(i,e,t){const n=i.slice();return n[20]=e[t],n}function WO(i,e,t){const n=i.slice();return n[23]=e[t],n}function XO(i){let e,t,n;return t=new rh({props:{value:"",indeterminate:i[0].length>0&&i[0].length0&&r[0].length{S=null}),be()),e[17].status==="draft"?_?_.p(e,A):(_=VO(e),_.c(),_.m(o,l)):_&&(_.d(1),_=null),(!w||A&8)&&a!==(a=e[17].data.name+"")&&K(c,a),(!w||A&8&&u!==(u=e[11].lucentUrl+"/records/"+e[17].id))&&O(o,"href",u),(!w||A&256&&h!==(h=e[8]?"_blank":"_self"))&&O(o,"target",h);const C={};A&8&&(C.record=e[17]),A&16&&(C.graph=e[4]),A&2&&(C.schema=e[1]),A&1024&&(C.visibleColumns=e[10]),A&64&&(C.sortParam=e[6]),A&128&&(C.sortField=e[7]),A&4&&(C.users=e[2]),d.$set(C);const Q={};A&12&&(Q.name=Dn(e[2],e[17].updatedBy)),g.$set(Q)},i(k){w||(T(S),T(d.$$.fragment,k),T(g.$$.fragment,k),w=!0)},o(k){R(S),R(d.$$.fragment,k),R(g.$$.fragment,k),w=!1},d(k){k&&P(t),S&&S.d(),_&&_.d(),z(d),z(g)}}}function oM(i){let e,t,n,r,s,o,l,a,c,u,h=[],f=new Map,d,m=i[9]&&XO(i),p=fe(i[10]),g=[];for(let k=0;kk[17].id;for(let k=0;k{m=null}),be()),A&1152){p=fe(k[10]);let C;for(C=0;C{var k;return(k=s.visible)==null?void 0:k.includes(_.name)},w=(_,k)=>k.id===_.id,S=_=>g(_);return i.$$set=_=>{"schema"in _&&t(1,s=_.schema),"users"in _&&t(2,o=_.users),"records"in _&&t(3,l=_.records),"graph"in _&&t(4,a=_.graph),"systemFields"in _&&t(5,c=_.systemFields),"sortParam"in _&&t(6,u=_.sortParam),"sortField"in _&&t(7,h=_.sortField),"inModal"in _&&t(8,f=_.inModal),"isWritable"in _&&t(9,d=_.isWritable),"selected"in _&&t(0,m=_.selected)},i.$$.update=()=>{i.$$.dirty&2&&t(10,n=s.fields.filter(_=>{var k;return((k=s.visible)==null?void 0:k.includes(_.name))??[]}))},[m,s,o,l,a,c,u,h,f,d,n,r,p,g,v,w,S]}let aM=class extends oe{constructor(e){super(),se(this,e,lM,oM,re,{schema:1,users:2,records:3,graph:4,systemFields:5,sortParam:6,sortField:7,inModal:8,isWritable:9,selected:0})}};function cM(i){let e,t,n,r;function s(a){i[17](a)}function o(a){i[18](a)}let l={systemFields:i[13],sortParam:i[2],sortField:i[3],operators:i[4],filter:i[5],graph:i[12],inModal:i[14],modalUrl:i[9],isWritable:i[15]};return i[0]!==void 0&&(l.schema=i[0]),i[1]!==void 0&&(l.records=i[1]),e=new KT({props:l}),Ce.push(()=>nt(e,"schema",s)),Ce.push(()=>nt(e,"records",o)),e.$on("refresh",i[16]),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&8192&&(u.systemFields=a[13]),c&4&&(u.sortParam=a[2]),c&8&&(u.sortField=a[3]),c&16&&(u.operators=a[4]),c&32&&(u.filter=a[5]),c&4096&&(u.graph=a[12]),c&16384&&(u.inModal=a[14]),c&512&&(u.modalUrl=a[9]),c&32768&&(u.isWritable=a[15]),!t&&c&1&&(t=!0,u.schema=a[0],st(()=>t=!1)),!n&&c&2&&(n=!0,u.records=a[1],st(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function uM(i){let e,t;return e=new hQ({props:{schema:i[0],selected:i[10],filter:i[5]}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.schema=n[0]),r&1024&&(s.selected=n[10]),r&32&&(s.filter=n[5]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function hM(i){let e,t,n,r=i[0].label+"",s,o,l,a,c,u,h,f,d,m,p;const g=[uM,cM],v=[];function w(k,A){return k[10].length>0&&!k[14]&&k[15]?0:1}l=w(i),a=v[l]=g[l](i);function S(k){i[19](k)}let _={records:i[1],graph:i[12],schema:i[0],sortParam:i[2],sortField:i[3],systemFields:i[13],inModal:i[14],users:i[11],isWritable:i[15]};return i[10]!==void 0&&(_.selected=i[10]),u=new aM({props:_}),Ce.push(()=>nt(u,"selected",S)),m=new oQ({props:{limit:i[6],skip:i[7],total:i[8],inModal:i[14],modalUrl:i[9]}}),m.$on("refresh",i[16]),{c(){e=y("div"),t=y("div"),n=y("h3"),s=W(r),o=D(),a.c(),c=D(),V(u.$$.fragment),d=D(),V(m.$$.fragment),O(n,"class","header-normal mb-5"),O(t,"class",f=i[14]?"mt-0":"mt-5"),O(e,"class","")},m(k,A){x(k,e,A),b(e,t),b(t,n),b(n,s),b(t,o),v[l].m(t,null),b(t,c),Y(u,t,null),b(e,d),Y(m,e,null),p=!0},p(k,[A]){(!p||A&1)&&r!==(r=k[0].label+"")&&K(s,r);let C=l;l=w(k),l===C?v[l].p(k,A):(Oe(),R(v[C],1,1,()=>{v[C]=null}),be(),a=v[l],a?a.p(k,A):(a=v[l]=g[l](k),a.c()),T(a,1),a.m(t,c));const Q={};A&2&&(Q.records=k[1]),A&4096&&(Q.graph=k[12]),A&1&&(Q.schema=k[0]),A&4&&(Q.sortParam=k[2]),A&8&&(Q.sortField=k[3]),A&8192&&(Q.systemFields=k[13]),A&16384&&(Q.inModal=k[14]),A&2048&&(Q.users=k[11]),A&32768&&(Q.isWritable=k[15]),!h&&A&1024&&(h=!0,Q.selected=k[10],st(()=>h=!1)),u.$set(Q),(!p||A&16384&&f!==(f=k[14]?"mt-0":"mt-5"))&&O(t,"class",f);const M={};A&64&&(M.limit=k[6]),A&128&&(M.skip=k[7]),A&256&&(M.total=k[8]),A&16384&&(M.inModal=k[14]),A&512&&(M.modalUrl=k[9]),m.$set(M)},i(k){p||(T(a),T(u.$$.fragment,k),T(m.$$.fragment,k),p=!0)},o(k){R(a),R(u.$$.fragment,k),R(m.$$.fragment,k),p=!1},d(k){k&&P(e),v[l].d(),z(u),z(m)}}}function fM(i,e,t){let{schema:n}=e,{users:r}=e,{records:s}=e,{graph:o}=e,{systemFields:l}=e,{sortParam:a}=e,{sortField:c}=e,{operators:u}=e,{filter:h}=e,{limit:f}=e,{skip:d}=e,{total:m}=e,{inModal:p}=e,{modalUrl:g}=e,{selected:v=[]}=e,{isWritable:w=!1}=e;function S(C){const Q=C.detail;Qa(Q).then(M=>{t(1,s=M.records),t(2,a=M.sortParam),t(3,c=M.sortField),t(4,u=M.operators),t(5,h=M.filter),t(7,d=M.skip),t(6,f=M.limit),t(8,m=M.total),t(9,g=M.modalUrl),document.querySelector("dialog h3").scrollIntoView()}).catch(M=>{console.log(M)})}function _(C){n=C,t(0,n)}function k(C){s=C,t(1,s)}function A(C){v=C,t(10,v)}return i.$$set=C=>{"schema"in C&&t(0,n=C.schema),"users"in C&&t(11,r=C.users),"records"in C&&t(1,s=C.records),"graph"in C&&t(12,o=C.graph),"systemFields"in C&&t(13,l=C.systemFields),"sortParam"in C&&t(2,a=C.sortParam),"sortField"in C&&t(3,c=C.sortField),"operators"in C&&t(4,u=C.operators),"filter"in C&&t(5,h=C.filter),"limit"in C&&t(6,f=C.limit),"skip"in C&&t(7,d=C.skip),"total"in C&&t(8,m=C.total),"inModal"in C&&t(14,p=C.inModal),"modalUrl"in C&&t(9,g=C.modalUrl),"selected"in C&&t(10,v=C.selected),"isWritable"in C&&t(15,w=C.isWritable)},[n,s,a,c,u,h,f,d,m,g,v,r,o,l,p,w,S,_,k,A]}let Ay=class extends oe{constructor(e){super(),se(this,e,fM,hM,re,{schema:0,users:11,records:1,graph:12,systemFields:13,sortParam:2,sortField:3,operators:4,filter:5,limit:6,skip:7,total:8,inModal:14,modalUrl:9,selected:10,isWritable:15})}};function jO(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S,_=i[2].length>0&&qO(i);f=new ut({props:{icon:"close"}});const k=[i[3]];function A(Q){i[7](Q)}let C={};for(let Q=0;Qnt(p,"selected",A)),{c(){e=y("div"),t=y("button"),n=W("Insert"),s=D(),o=y("button"),l=W("Replace"),c=D(),_&&_.c(),u=D(),h=y("button"),V(f.$$.fragment),d=D(),m=y("div"),V(p.$$.fragment),O(t,"type","button"),O(t,"class","button"),t.disabled=r=i[2].length===0,O(o,"type","button"),O(o,"class","button"),o.disabled=a=i[2].length===0,O(h,"type","button"),O(h,"class","button close"),O(h,"aria-label","Close"),O(e,"class","dialog-header"),O(m,"class","dialog-body")},m(Q,M){x(Q,e,M),b(e,t),b(t,n),b(e,s),b(e,o),b(o,l),b(e,c),_&&_.m(e,null),b(e,u),b(e,h),Y(f,h,null),x(Q,d,M),x(Q,m,M),Y(p,m,null),v=!0,w||(S=[G(t,"click",i[4]),G(o,"click",i[5]),G(h,"click",Ln(i[0]))],w=!0)},p(Q,M){(!v||M&4&&r!==(r=Q[2].length===0))&&(t.disabled=r),(!v||M&4&&a!==(a=Q[2].length===0))&&(o.disabled=a),Q[2].length>0?_?_.p(Q,M):(_=qO(Q),_.c(),_.m(e,u)):_&&(_.d(1),_=null);const L=M&8?_o(k,[Co(Q[3])]):{};!g&&M&4&&(g=!0,L.selected=Q[2],st(()=>g=!1)),p.$set(L)},i(Q){v||(T(f.$$.fragment,Q),T(p.$$.fragment,Q),v=!0)},o(Q){R(f.$$.fragment,Q),R(p.$$.fragment,Q),v=!1},d(Q){Q&&(P(e),P(d),P(m)),_&&_.d(),z(f),z(p),w=!1,ht(S)}}}function qO(i){let e,t=i[2].length+"",n,r;return{c(){e=y("span"),n=W(t),r=W(" records selected"),O(e,"class","")},m(s,o){x(s,e,o),b(e,n),b(e,r)},p(s,o){o&4&&t!==(t=s[2].length+"")&&K(n,t)},d(s){s&&P(e)}}}function dM(i){let e,t,n=i[3].schema&&jO(i);return{c(){e=y("dialog"),n&&n.c()},m(r,s){x(r,e,s),n&&n.m(e,null),i[8](e),t=!0},p(r,[s]){r[3].schema?n?(n.p(r,s),s&8&&T(n,1)):(n=jO(r),n.c(),T(n,1),n.m(e,null)):n&&(Oe(),R(n,1,1,()=>{n=null}),be())},i(r){t||(T(n),t=!0)},o(r){R(n),t=!1},d(r){r&&P(e),n&&n.d(),i[8](null)}}}function mM(i,e,t){let n,r;const s=nn(),o=Ue("channel");let l=[];function a(p){p&&p.preventDefault(),r.close(),t(2,l=[])}function c(p){Qa(o.lucentUrl+"/content/"+p).then(g=>{t(3,n=g)}).catch(g=>console.log(g))}function u(p){p.preventDefault(),s("insert",{records:l,action:"insert",schema:n.schema.name})}function h(p){p.preventDefault(),s("insert",{records:l,action:"replace"})}function f(p){r.showModal(),c(p)}function d(p){l=p,t(2,l)}function m(p){Ce[p?"unshift":"push"](()=>{r=p,t(1,r)})}return t(3,n={}),[a,r,l,n,u,h,f,d,m]}class pM extends oe{constructor(e){super(),se(this,e,mM,dM,re,{close:0,open:6})}get close(){return this.$$.ctx[0]}get open(){return this.$$.ctx[6]}}function gM(i){let e,t,n,r,s,o,l,a,c;r=new ut({props:{icon:"close"}});const u=i[4].default,h=Hl(u,i,i[3],null);return{c(){e=y("dialog"),t=y("div"),n=y("button"),V(r.$$.fragment),s=D(),o=y("div"),h&&h.c(),O(n,"type","button"),O(n,"class","button close"),O(n,"aria-label","Close"),O(t,"class","dialog-header"),O(o,"class","dialog-body"),le(o,"min-width","900px")},m(f,d){x(f,e,d),b(e,t),b(t,n),Y(r,n,null),b(e,s),b(e,o),h&&h.m(o,null),i[5](e),l=!0,a||(c=G(n,"click",Ln(i[0])),a=!0)},p(f,[d]){h&&h.p&&(!l||d&8)&&Jl(h,u,f,f[3],l?Kl(u,f[3],d,null):ea(f[3]),null)},i(f){l||(T(r.$$.fragment,f),T(h,f),l=!0)},o(f){R(r.$$.fragment,f),R(h,f),l=!1},d(f){f&&P(e),z(r),h&&h.d(f),i[5](null),a=!1,c()}}}function OM(i,e,t){let{$$slots:n={},$$scope:r}=e,s;function o(c){c&&c.preventDefault(),s.close()}function l(){s.showModal()}function a(c){Ce[c?"unshift":"push"](()=>{s=c,t(1,s)})}return i.$$set=c=>{"$$scope"in c&&t(3,r=c.$$scope)},[o,s,l,r,n,a]}class bM extends oe{constructor(e){super(),se(this,e,OM,gM,re,{close:0,open:2})}get close(){return this.$$.ctx[0]}get open(){return this.$$.ctx[2]}}function GO(i,e,t){const n=i.slice();return n[18]=e[t],n}function HO(i,e,t){const n=i.slice();return n[18]=e[t],n}function vM(i){let e,t,n,r,s,o,l,a;return s=new ut({props:{icon:"magnifying-glass"}}),{c(){e=y("div"),t=y("button"),t.textContent="New",n=D(),r=y("button"),V(s.$$.fragment),O(t,"class","button"),O(r,"class","button"),le(e,"display","flex"),le(e,"align-items","center"),le(e,"gap","4px")},m(c,u){x(c,e,u),b(e,t),b(e,n),b(e,r),Y(s,r,null),o=!0,l||(a=[G(t,"click",i[11]),G(r,"click",i[12])],l=!0)},p:U,i(c){o||(T(s.$$.fragment,c),o=!0)},o(c){R(s.$$.fragment,c),o=!1},d(c){c&&P(e),z(s),l=!1,ht(a)}}}function wM(i){let e,t,n,r,s;return t=new ur({props:{$$slots:{button:[kM],default:[yM]},$$scope:{ctx:i}}}),r=new ur({props:{$$slots:{button:[_M],default:[SM]},$$scope:{ctx:i}}}),{c(){e=y("div"),V(t.$$.fragment),n=D(),V(r.$$.fragment),le(e,"display","flex"),le(e,"align-items","center"),le(e,"gap","4px")},m(o,l){x(o,e,l),Y(t,e,null),b(e,n),Y(r,e,null),s=!0},p(o,l){const a={};l&8388609&&(a.$$scope={dirty:l,ctx:o}),t.$set(a);const c={};l&8388609&&(c.$$scope={dirty:l,ctx:o}),r.$set(c)},i(o){s||(T(t.$$.fragment,o),T(r.$$.fragment,o),s=!0)},o(o){R(t.$$.fragment,o),R(r.$$.fragment,o),s=!1},d(o){o&&P(e),z(t),z(r)}}}function KO(i){let e,t=i[18].label+"",n,r,s,o;function l(...a){return i[9](i[18],...a)}return{c(){e=y("button"),n=W(t),r=D(),O(e,"class","button")},m(a,c){x(a,e,c),b(e,n),b(e,r),s||(o=G(e,"click",l),s=!0)},p(a,c){i=a,c&1&&t!==(t=i[18].label+"")&&K(n,t)},d(a){a&&P(e),s=!1,o()}}}function yM(i){let e,t=fe(i[0]),n=[];for(let r=0;r{n=null}),be())},i(r){t||(T(n),t=!0)},o(r){R(n),t=!1},d(r){r&&P(e),n&&n.d(r)}}}function PM(i){let e,t,n,r,s,o,l;const a=[wM,vM],c=[];function u(d,m){return d[0].length>1?0:1}e=u(i),t=c[e]=a[e](i);let h={$$slots:{default:[CM]},$$scope:{ctx:i}};r=new bM({props:h}),i[14](r);let f={};return o=new pM({props:f}),i[15](o),o.$on("insert",i[6]),{c(){t.c(),n=D(),V(r.$$.fragment),s=D(),V(o.$$.fragment)},m(d,m){c[e].m(d,m),x(d,n,m),Y(r,d,m),x(d,s,m),Y(o,d,m),l=!0},p(d,[m]){let p=e;e=u(d),e===p?c[e].p(d,m):(Oe(),R(c[p],1,1,()=>{c[p]=null}),be(),t=c[e],t?t.p(d,m):(t=c[e]=a[e](d),t.c()),T(t,1),t.m(n.parentNode,n));const g={};m&8388616&&(g.$$scope={dirty:m,ctx:d}),r.$set(g);const v={};o.$set(v)},i(d){l||(T(t),T(r.$$.fragment,d),T(o.$$.fragment,d),l=!0)},o(d){R(t),R(r.$$.fragment,d),R(o.$$.fragment,d),l=!1},d(d){d&&(P(n),P(s)),c[e].d(d),i[14](null),z(r,d),i[15](null),z(o,d)}}}function AM(i,e,t){const n=nn(),r=Ue("channel");let{schemas:s}=e,{recordId:o}=e,l,a,c;function u(k,A){k.preventDefault(),l.open(A)}function h(k){k.preventDefault(),console.log("Save inline"),t(3,c=null),a.close(),n("save",{records:k.detail.records,after:o})}function f(k){k.preventDefault(),l.close(),n("insert",{records:k.detail.records,schema:k.detail.schema,after:o})}function d(k,A){k.preventDefault(),t(3,c=null),Qa(r.lucentUrl+"/records/newInline?schema="+A).then(C=>{t(3,c=C),a.open()}).catch(C=>{console.log(C)})}const m=(k,A)=>d(A,k.name),p=(k,A)=>u(A,k.name),g=k=>d(k,s[0].name),v=k=>u(k,s[0].name),w=k=>t(3,c=null);function S(k){Ce[k?"unshift":"push"](()=>{a=k,t(2,a)})}function _(k){Ce[k?"unshift":"push"](()=>{l=k,t(1,l)})}return i.$$set=k=>{"schemas"in k&&t(0,s=k.schemas),"recordId"in k&&t(8,o=k.recordId)},[s,l,a,c,u,h,f,d,o,m,p,g,v,w,S,_]}class xM extends oe{constructor(e){super(),se(this,e,AM,PM,re,{schemas:0,recordId:8})}}/**! * Sortable 1.15.2 * @author RubaXa * @author owenm * @license MIT - */function i1(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(i,r).enumerable})),t.push.apply(t,n)}return t}function Hi(i){for(var e=1;e=0)&&(t[r]=i[r]);return t}function LM(i,e){if(i==null)return{};var t=$M(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}var IM="1.15.2";function lr(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}var pr=lr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ea=lr(/Edge/i),r1=lr(/firefox/i),Ql=lr(/safari/i)&&!lr(/chrome/i)&&!lr(/android/i),Zy=lr(/iP(ad|od|hone)/i),By=lr(/chrome/i)&&lr(/android/i),Wy={capture:!1,passive:!1};function dt(i,e,t){i.addEventListener(e,t,!pr&&Wy)}function lt(i,e,t){i.removeEventListener(e,t,!pr&&Wy)}function du(i,e){if(e){if(e[0]===">"&&(e=e.substring(1)),i)try{if(i.matches)return i.matches(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e)}catch{return!1}return!1}}function NM(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function Si(i,e,t,n){if(i){t=t||document;do{if(e!=null&&(e[0]===">"?i.parentNode===t&&du(i,e):du(i,e))||n&&i===t)return i;if(i===t)break}while(i=NM(i))}return null}var s1=/\s+/g;function Fn(i,e,t){if(i&&e)if(i.classList)i.classList[t?"add":"remove"](e);else{var n=(" "+i.className+" ").replace(s1," ").replace(" "+e+" "," ");i.className=(n+(t?" "+e:"")).replace(s1," ")}}function $e(i,e,t){var n=i&&i.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(t=i.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function ao(i,e){var t="";if(typeof i=="string")t=i;else do{var n=$e(i,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(i=i.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function Xy(i,e,t){if(i){var n=i.getElementsByTagName(e),r=0,s=n.length;if(t)for(;r=s,!o)return n;if(n===Ui())break;n=Ir(n,!1)}return!1}function Co(i,e,t,n){for(var r=0,s=0,o=i.children;s2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,s=LM(n,VM);Ra.pluginEvent.bind(Le)(e,t,Hi({dragEl:he,parentEl:Bt,ghostEl:Xe,rootEl:Dt,nextEl:ds,lastDownEl:Zc,cloneEl:It,cloneHidden:Er,dragStarted:bl,putSortable:sn,activeSortable:Le.active,originalEvent:r,oldIndex:no,oldDraggableIndex:El,newIndex:zn,newDraggableIndex:xr,hideGhostForTarget:Gy,unhideGhostForTarget:Hy,cloneNowHidden:function(){Er=!0},cloneNowShown:function(){Er=!1},dispatchSortableEvent:function(l){yn({sortable:t,name:l,originalEvent:r})}},s))};function yn(i){zM(Hi({putSortable:sn,cloneEl:It,targetEl:he,rootEl:Dt,oldIndex:no,oldDraggableIndex:El,newIndex:zn,newDraggableIndex:xr},i))}var he,Bt,Xe,Dt,ds,Zc,It,Er,no,zn,El,xr,Ka,sn,Hs=!1,mu=!1,pu=[],ls,wi,Nh,Zh,a1,c1,bl,js,Rl,Dl=!1,Ja=!1,Bc,fn,Bh=[],Od=!1,gu=[],sh=typeof document<"u",ec=Zy,u1=Ea||pr?"cssFloat":"float",UM=sh&&!By&&!Zy&&"draggable"in document.createElement("div"),Uy=function(){if(sh){if(pr)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}}(),jy=function(e,t){var n=$e(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),s=Co(e,0,t),o=Co(e,1,t),l=s&&$e(s),a=o&&$e(o),c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Gt(s).width,u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Gt(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&l.float&&l.float!=="none"){var h=l.float==="left"?"left":"right";return o&&(a.clear==="both"||a.clear===h)?"vertical":"horizontal"}return s&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||c>=r&&n[u1]==="none"||o&&n[u1]==="none"&&c+u>r)?"vertical":"horizontal"},jM=function(e,t,n){var r=n?e.left:e.top,s=n?e.right:e.bottom,o=n?e.width:e.height,l=n?t.left:t.top,a=n?t.right:t.bottom,c=n?t.width:t.height;return r===l||s===a||r+o/2===l+c/2},qM=function(e,t){var n;return pu.some(function(r){var s=r[qn].options.emptyInsertThreshold;if(!(!s||Vm(r))){var o=Gt(r),l=e>=o.left-s&&e<=o.right+s,a=t>=o.top-s&&t<=o.bottom+s;if(l&&a)return n=r}}),n},qy=function(e){function t(s,o){return function(l,a,c,u){var h=l.options.group.name&&a.options.group.name&&l.options.group.name===a.options.group.name;if(s==null&&(o||h))return!0;if(s==null||s===!1)return!1;if(o&&s==="clone")return s;if(typeof s=="function")return t(s(l,a,c,u),o)(l,a,c,u);var f=(o?l:a).options.group.name;return s===!0||typeof s=="string"&&s===f||s.join&&s.indexOf(f)>-1}}var n={},r=e.group;(!r||Nc(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Gy=function(){!Uy&&Xe&&$e(Xe,"display","none")},Hy=function(){!Uy&&Xe&&$e(Xe,"display","")};sh&&!By&&document.addEventListener("click",function(i){if(mu)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),mu=!1,!1},!0);var as=function(e){if(he){e=e.touches?e.touches[0]:e;var t=qM(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[qn]._onDragOver(n)}}},GM=function(e){he&&he.parentNode[qn]._isOutsideThisEl(e.target)};function Le(i,e){if(!(i&&i.nodeType&&i.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(i));this.el=i,this.options=e=hr({},e),i[qn]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(i.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return jy(i,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,l){o.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Le.supportPointer!==!1&&"PointerEvent"in window&&!Ql,emptyInsertThreshold:5};Ra.initializePlugins(this,i,t);for(var n in t)!(n in e)&&(e[n]=t[n]);qy(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:UM,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?dt(i,"pointerdown",this._onTapStart):(dt(i,"mousedown",this._onTapStart),dt(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(dt(i,"dragover",this),dt(i,"dragenter",this)),pu.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),hr(this,XM())}Le.prototype={constructor:Le,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(js=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,he):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,s=r.preventOnFilter,o=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,a=(l||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,u=r.filter;if(rE(n),!he&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Ql&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=Si(a,r.draggable,n,!1),!(a&&a.animated)&&Zc!==a)){if(no=ii(a),El=ii(a,r.draggable),typeof u=="function"){if(u.call(this,e,a,this)){yn({sortable:t,rootEl:c,name:"filter",targetEl:a,toEl:n,fromEl:n}),Tn("filter",t,{evt:e}),s&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(h){if(h=Si(c,h.trim(),n,!1),h)return yn({sortable:t,rootEl:h,name:"filter",targetEl:a,fromEl:n,toEl:n}),Tn("filter",t,{evt:e}),!0}),u)){s&&e.cancelable&&e.preventDefault();return}r.handle&&!Si(c,r.handle,n,!1)||this._prepareDragStart(e,l,a)}}},_prepareDragStart:function(e,t,n){var r=this,s=r.el,o=r.options,l=s.ownerDocument,a;if(n&&!he&&n.parentNode===s){var c=Gt(n);if(Dt=s,he=n,Bt=he.parentNode,ds=he.nextSibling,Zc=n,Ka=o.group,Le.dragged=he,ls={target:he,clientX:(t||e).clientX,clientY:(t||e).clientY},a1=ls.clientX-c.left,c1=ls.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,he.style["will-change"]="all",a=function(){if(Tn("delayEnded",r,{evt:e}),Le.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!r1&&r.nativeDraggable&&(he.draggable=!0),r._triggerDragStart(e,t),yn({sortable:r,name:"choose",originalEvent:e}),Fn(he,o.chosenClass,!0)},o.ignore.split(",").forEach(function(u){Xy(he,u.trim(),Wh)}),dt(l,"dragover",as),dt(l,"mousemove",as),dt(l,"touchmove",as),dt(l,"mouseup",r._onDrop),dt(l,"touchend",r._onDrop),dt(l,"touchcancel",r._onDrop),r1&&this.nativeDraggable&&(this.options.touchStartThreshold=4,he.draggable=!0),Tn("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Ea||pr))){if(Le.eventCanceled){this._onDrop();return}dt(l,"mouseup",r._disableDelayedDrag),dt(l,"touchend",r._disableDelayedDrag),dt(l,"touchcancel",r._disableDelayedDrag),dt(l,"mousemove",r._delayedDragTouchMoveHandler),dt(l,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&dt(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(a,o.delay)}else a()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){he&&Wh(he),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;lt(e,"mouseup",this._disableDelayedDrag),lt(e,"touchend",this._disableDelayedDrag),lt(e,"touchcancel",this._disableDelayedDrag),lt(e,"mousemove",this._delayedDragTouchMoveHandler),lt(e,"touchmove",this._delayedDragTouchMoveHandler),lt(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?dt(document,"pointermove",this._onTouchMove):t?dt(document,"touchmove",this._onTouchMove):dt(document,"mousemove",this._onTouchMove):(dt(he,"dragend",this),dt(Dt,"dragstart",this._onDragStart));try{document.selection?Wc(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Hs=!1,Dt&&he){Tn("dragStarted",this,{evt:t}),this.nativeDraggable&&dt(document,"dragover",GM);var n=this.options;!e&&Fn(he,n.dragClass,!1),Fn(he,n.ghostClass,!0),Le.active=this,e&&this._appendGhost(),yn({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(wi){this._lastX=wi.clientX,this._lastY=wi.clientY,Gy();for(var e=document.elementFromPoint(wi.clientX,wi.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(wi.clientX,wi.clientY),e!==t);)t=e;if(he.parentNode[qn]._isOutsideThisEl(e),t)do{if(t[qn]){var n=void 0;if(n=t[qn]._onDragOver({clientX:wi.clientX,clientY:wi.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Hy()}},_onTouchMove:function(e){if(ls){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,s=e.touches?e.touches[0]:e,o=Xe&&ao(Xe,!0),l=Xe&&o&&o.a,a=Xe&&o&&o.d,c=ec&&fn&&l1(fn),u=(s.clientX-ls.clientX+r.x)/(l||1)+(c?c[0]-Bh[0]:0)/(l||1),h=(s.clientY-ls.clientY+r.y)/(a||1)+(c?c[1]-Bh[1]:0)/(a||1);if(!Le.active&&!Hs){if(n&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))=0&&(yn({rootEl:Bt,name:"add",toEl:Bt,fromEl:Dt,originalEvent:e}),yn({sortable:this,name:"remove",toEl:Bt,originalEvent:e}),yn({rootEl:Bt,name:"sort",toEl:Bt,fromEl:Dt,originalEvent:e}),yn({sortable:this,name:"sort",toEl:Bt,originalEvent:e})),sn&&sn.save()):zn!==no&&zn>=0&&(yn({sortable:this,name:"update",toEl:Bt,originalEvent:e}),yn({sortable:this,name:"sort",toEl:Bt,originalEvent:e})),Le.active&&((zn==null||zn===-1)&&(zn=no,xr=El),yn({sortable:this,name:"end",toEl:Bt,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Tn("nulling",this),Dt=he=Bt=Xe=ds=It=Zc=Er=ls=wi=bl=zn=xr=no=El=js=Rl=sn=Ka=Le.dragged=Le.ghost=Le.clone=Le.active=null,gu.forEach(function(e){e.checked=!0}),gu.length=Nh=Zh=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":he&&(this._onDragOver(e),HM(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,s=n.length,o=this.options;rr.right+s||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>r.bottom+s||i.clientX>n.right&&i.clientY>n.top}function tE(i,e,t,n,r,s,o,l){var a=n?i.clientY:i.clientX,c=n?t.height:t.width,u=n?t.top:t.left,h=n?t.bottom:t.right,f=!1;if(!o){if(l&&Bcu+c*s/2:ah-Bc)return-Rl}else if(a>u+c*(1-r)/2&&ah-c*s/2)?a>u+c/2?1:-1:0}function nE(i){return ii(he){o[u]=null}),pe(),t=o[e],t?t.p(a,c):(t=o[e]=s[e](a),t.c()),T(t,1),t.m(n.parentNode,n))},i(a){r||(T(t),r=!0)},o(a){R(t),r=!1},d(a){a&&P(n),o[e].d(a)}}}function cE(i,e,t){let{$$slots:n={},$$scope:r}=e,{sortableClass:s=""}=e,{isTable:o=!1}=e,{sortableInstance:l}=e;const a=nn();let c;Ti(()=>{let f={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",direction:"vertical",onUpdate(d){a("update",{source:d.oldIndex,target:d.newIndex})}};t(3,l=Le.create(c,f))});function u(f){Se[f?"unshift":"push"](()=>{c=f,t(2,c)})}function h(f){Se[f?"unshift":"push"](()=>{c=f,t(2,c)})}return i.$$set=f=>{"sortableClass"in f&&t(0,s=f.sortableClass),"isTable"in f&&t(1,o=f.isTable),"sortableInstance"in f&&t(3,l=f.sortableInstance),"$$scope"in f&&t(4,r=f.$$scope)},[s,o,c,l,r,n,u,h]}class Jy extends oe{constructor(e){super(),se(this,e,cE,aE,re,{sortableClass:0,isTable:1,sortableInstance:3})}}function uE(i){let e,t,n;return t=new Wo({props:{record:i[4],size:"small"}}),{c(){e=y("div"),V(t.$$.fragment),O(e,"class","image")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function f1(i){let e,t;return e=new Ly({props:{status:i[0].status}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.status=n[0].status),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function d1(i){let e,t,n,r,s,o;return n=new Ot({props:{icon:"trash-can"}}),{c(){e=y("div"),t=y("button"),V(n.$$.fragment),O(t,"class","button"),O(e,"class","reference-action")},m(l,a){A(l,e,a),v(e,t),Y(n,t,null),r=!0,s||(o=G(t,"click",i[5]),s=!0)},p:U,i(l){r||(T(n.$$.fragment,l),r=!0)},o(l){R(n.$$.fragment,l),r=!1},d(l){l&&P(e),z(n),s=!1,o()}}}function hE(i){let e,t,n,r,s,o,l=i[0].data.name+"",a,c,u,h,f,d=i[3].label+"",m,p,g,b,w=i[4]&&uE(i),S=i[0].status==="draft"&&f1(i),_=i[1]&&d1(i);return{c(){e=y("div"),t=y("div"),w&&w.c(),n=D(),r=y("div"),s=y("div"),o=y("a"),a=W(l),u=D(),h=y("small"),f=W("from "),m=W(d),p=D(),S&&S.c(),g=D(),_&&_.c(),O(o,"class","record-title"),O(o,"href",c=i[2].lucentUrl+"/records/"+i[0].id),O(h,"class","d-block"),O(r,"class","title"),fe(t,"display","flex"),fe(t,"align-items","center"),fe(t,"gap","10px"),O(e,"class","preview-reference")},m(k,Q){A(k,e,Q),v(e,t),w&&w.m(t,null),v(t,n),v(t,r),v(r,s),v(s,o),v(o,a),v(s,u),v(s,h),v(h,f),v(h,m),v(h,p),S&&S.m(h,null),v(e,g),_&&_.m(e,null),b=!0},p(k,[Q]){k[4]&&w.p(k,Q),(!b||Q&1)&&l!==(l=k[0].data.name+"")&&K(a,l),(!b||Q&1&&c!==(c=k[2].lucentUrl+"/records/"+k[0].id))&&O(o,"href",c),k[0].status==="draft"?S?(S.p(k,Q),Q&1&&T(S,1)):(S=f1(k),S.c(),T(S,1),S.m(h,null)):S&&(me(),R(S,1,1,()=>{S=null}),pe()),k[1]?_?(_.p(k,Q),Q&2&&T(_,1)):(_=d1(k),_.c(),T(_,1),_.m(e,null)):_&&(me(),R(_,1,1,()=>{_=null}),pe())},i(k){b||(T(w),T(S),T(_),b=!0)},o(k){R(w),R(S),R(_),b=!1},d(k){k&&P(e),w&&w.d(),S&&S.d(),_&&_.d()}}}function fE(i,e,t){const n=nn(),r=je("channel");let{graph:s}=e,{record:o}=e,{hasDelete:l=!1}=e,a=r.schemas.find(f=>f.name===o.schema);const c=s.edges.find(f=>f.source===o.id&&f.field===a.cardImage);let u=s.records.find(f=>f.id===(c==null?void 0:c.target));function h(f){f.preventDefault(),n("remove",o.id)}return i.$$set=f=>{"graph"in f&&t(6,s=f.graph),"record"in f&&t(0,o=f.record),"hasDelete"in f&&t(1,l=f.hasDelete)},[o,l,r,a,u,h,s]}class ek extends oe{constructor(e){super(),se(this,e,fE,hE,re,{graph:6,record:0,hasDelete:1})}}function m1(i,e,t){const n=i.slice();return n[11]=e[t],n}function p1(i){let e,t;return{c(){e=y("div"),t=W(i[2]),O(e,"class","invalid-feedback d-block mb-3")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&4&&K(t,n[2])},d(n){n&&P(e)}}}function g1(i){let e,t;return e=new Jy({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[dE]},$$scope:{ctx:i}}}),e.$on("update",i[5]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&16387&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function O1(i,e){let t,n,r,s;return n=new ek({props:{graph:e[0],record:e[11],hasDelete:!0}}),n.$on("remove",e[4]),{key:i,first:null,c(){t=y("div"),V(n.$$.fragment),r=D(),this.first=t},m(o,l){A(o,t,l),Y(n,t,null),v(t,r),s=!0},p(o,l){e=o;const a={};l&1&&(a.graph=e[0]),l&2&&(a.record=e[11]),n.$set(a)},i(o){s||(T(n.$$.fragment,o),s=!0)},o(o){R(n.$$.fragment,o),s=!1},d(o){o&&P(t),z(n)}}}function dE(i){let e=[],t=new Map,n,r,s=ue(i[1]);const o=l=>l[11].id;for(let l=0;l0&&g1(i);return{c(){l&&l.c(),e=D(),t=y("div"),V(n.$$.fragment),r=D(),a&&a.c(),s=De(),O(t,"class","inline-card-wrapper")},m(c,u){l&&l.m(c,u),A(c,e,u),A(c,t,u),Y(n,t,null),A(c,r,u),a&&a.m(c,u),A(c,s,u),o=!0},p(c,[u]){c[2]?l?l.p(c,u):(l=p1(c),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),c[1].length>0?a?(a.p(c,u),u&2&&T(a,1)):(a=g1(c),a.c(),T(a,1),a.m(s.parentNode,s)):a&&(me(),R(a,1,1,()=>{a=null}),pe())},i(c){o||(T(n.$$.fragment,c),T(a),o=!0)},o(c){R(n.$$.fragment,c),R(a),o=!1},d(c){c&&(P(e),P(t),P(r),P(s)),l&&l.d(c),z(n),a&&a.d(c)}}}function pE(i,e,t){let n,r;const s=je("channel");let{record:o}=e,{field:l}=e,{graph:a}=e,{validationErrors:c}=e,u=s.schemas.filter(m=>l.collections.includes(m.name));function h(m){m.preventDefault(),t(0,a.edges=a.edges.filter(p=>!(p.target===m.detail&&p.field===l.name)),a)}function f(m){t(0,a.edges=cT(m.detail.source,m.detail.target,a.edges,l.name,r),a)}function d(m){m.preventDefault(),t(0,a=zm(a,o,m.detail.records,l.name,m.detail.action))}return i.$$set=m=>{"record"in m&&t(7,o=m.record),"field"in m&&t(8,l=m.field),"graph"in m&&t(0,a=m.graph),"validationErrors"in m&&t(9,c=m.validationErrors)},i.$$.update=()=>{i.$$.dirty&768&&t(2,n=In(c,l.name)),i.$$.dirty&385&&t(1,r=a.edges.filter(m=>m.field===l.name).map(m=>a.records.find(p=>p.id===m.target&&o.id===m.source)).filter(m=>!!(m!=null&&m.id))??[])},[a,r,n,u,h,f,d,o,l,c]}class gE extends oe{constructor(e){super(),se(this,e,pE,mE,re,{record:7,field:8,graph:0,validationErrors:9})}}function b1(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function OE(i){let e,t,n,r,s,o,l,a,c,u,h=i[4]&&b1(i);return{c(){e=y("div"),t=y("div"),n=y("input"),s=D(),o=y("input"),a=D(),h&&h.c(),O(n,"type","color"),O(n,"id",i[3]),fe(n,"border","none"),fe(n,"background","transparent"),fe(n,"padding","0"),fe(n,"width","64px"),n.disabled=r=i[1].readonly&&!i[2],O(o,"type","text"),O(o,"id",i[3]),O(o,"class","form-control"),o.readOnly=l=i[1].readonly&&!i[2],Ae(o,"is-invalid",i[4]),fe(t,"display","flex"),fe(t,"align-items","center"),fe(t,"gap","10px"),O(e,"class","mb-0")},m(f,d){A(f,e,d),v(e,t),v(t,n),Ie(n,i[0]),v(t,s),v(t,o),Ie(o,i[0]),v(e,a),h&&h.m(e,null),c||(u=[G(n,"input",i[6]),G(o,"input",i[7])],c=!0)},p(f,[d]){d&8&&O(n,"id",f[3]),d&6&&r!==(r=f[1].readonly&&!f[2])&&(n.disabled=r),d&1&&Ie(n,f[0]),d&8&&O(o,"id",f[3]),d&6&&l!==(l=f[1].readonly&&!f[2])&&(o.readOnly=l),d&1&&o.value!==f[0]&&Ie(o,f[0]),d&16&&Ae(o,"is-invalid",f[4]),f[4]?h?h.p(f,d):(h=b1(f),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i:U,o:U,d(f){f&&P(e),h&&h.d(),c=!1,ut(u)}}}function bE(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,{id:a}=e;function c(){s=this.value,t(0,s)}function u(){s=this.value,t(0,s)}return i.$$set=h=>{"field"in h&&t(1,r=h.field),"value"in h&&t(0,s=h.value),"isCreateMode"in h&&t(2,o=h.isCreateMode),"validationErrors"in h&&t(5,l=h.validationErrors),"id"in h&&t(3,a=h.id)},i.$$.update=()=>{i.$$.dirty&34&&t(4,n=In(l,r.name))},[s,r,o,a,n,l,c,u]}class vE extends oe{constructor(e){super(),se(this,e,bE,OE,re,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function v1(i){let e,t,n,r,s,o,l,a,c,u,h;return c=oy(i[7][0]),{c(){e=y("div"),t=y("input"),s=D(),o=y("label"),l=W("Don't Know"),O(t,"class","form-check-input"),O(t,"id",n=i[1]+"-3"),O(t,"type","radio"),t.__value=null,Ie(t,t.__value),t.disabled=r=i[2].readonly&&!i[3],Ae(t,"is-invalid",i[4]),O(o,"class","form-check-label"),O(o,"for",a=i[1]+"-3"),O(e,"class","form-check form-check-inline"),c.p(t)},m(f,d){A(f,e,d),v(e,t),t.checked=t.__value===i[0],v(e,s),v(e,o),v(o,l),u||(h=G(t,"change",i[9]),u=!0)},p(f,d){d&2&&n!==(n=f[1]+"-3")&&O(t,"id",n),d&12&&r!==(r=f[2].readonly&&!f[3])&&(t.disabled=r),d&1&&(t.checked=t.__value===f[0]),d&16&&Ae(t,"is-invalid",f[4]),d&2&&a!==(a=f[1]+"-3")&&O(o,"for",a)},d(f){f&&P(e),c.r(),u=!1,h()}}}function w1(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function wE(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k,Q,x,C,M=i[2].nullable&&v1(i),$=i[4]&&w1(i);return Q=oy(i[7][0]),{c(){e=y("div"),t=y("div"),n=y("input"),o=D(),l=y("label"),a=W("Yes"),u=D(),h=y("div"),f=y("input"),p=D(),g=y("label"),b=W("No"),S=D(),M&&M.c(),_=D(),$&&$.c(),k=De(),O(n,"class","form-check-input"),O(n,"type","radio"),O(n,"id",r=i[1]+"-1"),n.__value=!0,Ie(n,n.__value),n.disabled=s=i[2].readonly&&!i[3],Ae(n,"is-invalid",i[4]),O(l,"class","form-check-label"),O(l,"for",c=i[1]+"-1"),O(t,"class","form-check form-check-inline"),O(f,"class","form-check-input"),O(f,"type","radio"),O(f,"id",d=i[1]+"-2"),f.__value=!1,Ie(f,f.__value),f.disabled=m=i[2].readonly&&!i[3],Ae(f,"is-invalid",i[4]),O(g,"class","form-check-label"),O(g,"for",w=i[1]+"-2"),O(h,"class","form-check form-check-inline"),O(e,"class","field-checkbox"),Q.p(n,f)},m(N,B){A(N,e,B),v(e,t),v(t,n),n.checked=n.__value===i[0],v(t,o),v(t,l),v(l,a),v(e,u),v(e,h),v(h,f),f.checked=f.__value===i[0],v(h,p),v(h,g),v(g,b),v(e,S),M&&M.m(e,null),A(N,_,B),$&&$.m(N,B),A(N,k,B),x||(C=[G(n,"change",i[6]),G(f,"change",i[8])],x=!0)},p(N,[B]){B&2&&r!==(r=N[1]+"-1")&&O(n,"id",r),B&12&&s!==(s=N[2].readonly&&!N[3])&&(n.disabled=s),B&1&&(n.checked=n.__value===N[0]),B&16&&Ae(n,"is-invalid",N[4]),B&2&&c!==(c=N[1]+"-1")&&O(l,"for",c),B&2&&d!==(d=N[1]+"-2")&&O(f,"id",d),B&12&&m!==(m=N[2].readonly&&!N[3])&&(f.disabled=m),B&1&&(f.checked=f.__value===N[0]),B&16&&Ae(f,"is-invalid",N[4]),B&2&&w!==(w=N[1]+"-2")&&O(g,"for",w),N[2].nullable?M?M.p(N,B):(M=v1(N),M.c(),M.m(e,null)):M&&(M.d(1),M=null),N[4]?$?$.p(N,B):($=w1(N),$.c(),$.m(k.parentNode,k)):$&&($.d(1),$=null)},i:U,o:U,d(N){N&&(P(e),P(_),P(k)),M&&M.d(),$&&$.d(N),Q.r(),x=!1,ut(C)}}}function yE(i,e,t){let n,{id:r}=e,{field:s}=e,{value:o}=e,{isCreateMode:l}=e,{validationErrors:a}=e;const c=[[]];function u(){o=this.__value,t(0,o)}function h(){o=this.__value,t(0,o)}function f(){o=this.__value,t(0,o)}return i.$$set=d=>{"id"in d&&t(1,r=d.id),"field"in d&&t(2,s=d.field),"value"in d&&t(0,o=d.value),"isCreateMode"in d&&t(3,l=d.isCreateMode),"validationErrors"in d&&t(5,a=d.validationErrors)},i.$$.update=()=>{i.$$.dirty&36&&t(4,n=In(a,s.name))},[o,r,s,l,n,a,u,c,h,f]}class kE extends oe{constructor(e){super(),se(this,e,yE,wE,re,{id:1,field:2,value:0,isCreateMode:3,validationErrors:5})}}function y1(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function SE(i){let e,t,n,r,s,o,l=i[4]&&y1(i);return{c(){e=y("div"),t=y("input"),r=D(),l&&l.c(),O(t,"type","number"),O(t,"id",i[3]),O(t,"class","form-control"),O(t,"autocomplete","off"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[4]),O(e,"class","mb-0")},m(a,c){A(a,e,c),v(e,t),Ie(t,i[0]),v(e,r),l&&l.m(e,null),s||(o=[G(t,"change",i[5]),G(t,"input",i[7])],s=!0)},p(a,[c]){c&8&&O(t,"id",a[3]),c&6&&n!==(n=a[1].readonly&&!a[2])&&(t.readOnly=n),c&1&&ly(t.value)!==a[0]&&Ie(t,a[0]),c&16&&Ae(t,"is-invalid",a[4]),a[4]?l?l.p(a,c):(l=y1(a),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},i:U,o:U,d(a){a&&P(e),l&&l.d(),s=!1,ut(o)}}}function _E(i,e,t){let n,{field:r}=e,{value:s}=e,{validationErrors:o}=e,{isCreateMode:l}=e,{id:a}=e;function c(f){const d=f.currentTarget.value,m=u(d);t(0,s=isNaN(m)?null:m)}function u(f){return parseFloat(f).toFixed(r.decimals)}function h(){s=ly(this.value),t(0,s)}return i.$$set=f=>{"field"in f&&t(1,r=f.field),"value"in f&&t(0,s=f.value),"validationErrors"in f&&t(6,o=f.validationErrors),"isCreateMode"in f&&t(2,l=f.isCreateMode),"id"in f&&t(3,a=f.id)},i.$$.update=()=>{i.$$.dirty&66&&t(4,n=In(o,r.name))},[s,r,l,a,n,c,o,h]}let CE=class extends oe{constructor(e){super(),se(this,e,_E,SE,re,{field:1,value:0,validationErrors:6,isCreateMode:2,id:3})}};function k1(i){let e,t=i[1].help+"",n;return{c(){e=y("small"),n=W(t),O(e,"class","text-primary opacity-50")},m(r,s){A(r,e,s),v(e,n)},p(r,s){s&2&&t!==(t=r[1].help+"")&&K(n,t)},d(r){r&&P(e)}}}function PE(i){let e,t,n,r=i[1].label+"",s,o,l,a,c=i[1].name+"",u,h,f,d,m,p,g,b=i[1].help&&k1(i);return{c(){e=y("div"),t=y("div"),n=y("label"),s=W(r),o=D(),l=y("a"),a=y("code"),u=W(c),f=D(),d=y("input"),m=D(),b&&b.c(),O(n,"for",i[4]),O(n,"class","form-label"),O(a,"class","text-primary opacity-50"),O(l,"class","text-decoration-none"),O(l,"href",h=i[3]+"/schemas/"+i[2].name+"/fields/edit/"+i[1].name),O(t,"class","d-flex justify-content-between"),O(d,"type","url"),O(d,"id",i[4]),O(d,"class","form-control"),O(d,"placeholder","https://www.example.com"),O(e,"class","mb-0")},m(w,S){A(w,e,S),v(e,t),v(t,n),v(n,s),v(t,o),v(t,l),v(l,a),v(a,u),v(e,f),v(e,d),Ie(d,i[0]),v(e,m),b&&b.m(e,null),p||(g=G(d,"input",i[5]),p=!0)},p(w,[S]){S&2&&r!==(r=w[1].label+"")&&K(s,r),S&2&&c!==(c=w[1].name+"")&&K(u,c),S&6&&h!==(h=w[3]+"/schemas/"+w[2].name+"/fields/edit/"+w[1].name)&&O(l,"href",h),S&1&&d.value!==w[0]&&Ie(d,w[0]),w[1].help?b?b.p(w,S):(b=k1(w),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i:U,o:U,d(w){w&&P(e),b&&b.d(),p=!1,g()}}}function AE(i,e,t){const n=je("channelurl");let{field:r}=e,{value:s}=e,{schema:o}=e,l=self.crypto.randomUUID();function a(){s=this.value,t(0,s)}return i.$$set=c=>{"field"in c&&t(1,r=c.field),"value"in c&&t(0,s=c.value),"schema"in c&&t(2,o=c.schema)},[s,r,o,n,l,a]}class xE extends oe{constructor(e){super(),se(this,e,AE,PE,re,{field:1,value:0,schema:2})}}var zh=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],co={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(i){return typeof console<"u"&&console.warn(i)},getWeek:function(i){var e=new Date(i.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ra={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(i){var e=i%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Mn=function(i,e){return e===void 0&&(e=2),("000"+i).slice(e*-1)},ni=function(i){return i===!0?1:0};function S1(i,e){var t;return function(){var n=this,r=arguments;clearTimeout(t),t=setTimeout(function(){return i.apply(n,r)},e)}}var Vh=function(i){return i instanceof Array?i:[i]};function vn(i,e,t){if(t===!0)return i.classList.add(e);i.classList.remove(e)}function ft(i,e,t){var n=window.document.createElement(i);return e=e||"",t=t||"",n.className=e,t!==void 0&&(n.textContent=t),n}function nc(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function tk(i,e){if(e(i))return i;if(i.parentNode)return tk(i.parentNode,e)}function ic(i,e){var t=ft("div","numInputWrapper"),n=ft("input","numInput "+i),r=ft("span","arrowUp"),s=ft("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?n.type="number":(n.type="text",n.pattern="\\d*"),e!==void 0)for(var o in e)n.setAttribute(o,e[o]);return t.appendChild(n),t.appendChild(r),t.appendChild(s),t}function Zn(i){try{if(typeof i.composedPath=="function"){var e=i.composedPath();return e[0]}return i.target}catch{return i.target}}var Uh=function(){},bu=function(i,e,t){return t.months[e?"shorthand":"longhand"][i]},TE={D:Uh,F:function(i,e,t){i.setMonth(t.months.longhand.indexOf(e))},G:function(i,e){i.setHours((i.getHours()>=12?12:0)+parseFloat(e))},H:function(i,e){i.setHours(parseFloat(e))},J:function(i,e){i.setDate(parseFloat(e))},K:function(i,e,t){i.setHours(i.getHours()%12+12*ni(new RegExp(t.amPM[1],"i").test(e)))},M:function(i,e,t){i.setMonth(t.months.shorthand.indexOf(e))},S:function(i,e){i.setSeconds(parseFloat(e))},U:function(i,e){return new Date(parseFloat(e)*1e3)},W:function(i,e,t){var n=parseInt(e),r=new Date(i.getFullYear(),0,2+(n-1)*7,0,0,0,0);return r.setDate(r.getDate()-r.getDay()+t.firstDayOfWeek),r},Y:function(i,e){i.setFullYear(parseFloat(e))},Z:function(i,e){return new Date(e)},d:function(i,e){i.setDate(parseFloat(e))},h:function(i,e){i.setHours((i.getHours()>=12?12:0)+parseFloat(e))},i:function(i,e){i.setMinutes(parseFloat(e))},j:function(i,e){i.setDate(parseFloat(e))},l:Uh,m:function(i,e){i.setMonth(parseFloat(e)-1)},n:function(i,e){i.setMonth(parseFloat(e)-1)},s:function(i,e){i.setSeconds(parseFloat(e))},u:function(i,e){return new Date(parseFloat(e))},w:Uh,y:function(i,e){i.setFullYear(2e3+parseFloat(e))}},ps={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},$l={Z:function(i){return i.toISOString()},D:function(i,e,t){return e.weekdays.shorthand[$l.w(i,e,t)]},F:function(i,e,t){return bu($l.n(i,e,t)-1,!1,e)},G:function(i,e,t){return Mn($l.h(i,e,t))},H:function(i){return Mn(i.getHours())},J:function(i,e){return e.ordinal!==void 0?i.getDate()+e.ordinal(i.getDate()):i.getDate()},K:function(i,e){return e.amPM[ni(i.getHours()>11)]},M:function(i,e){return bu(i.getMonth(),!0,e)},S:function(i){return Mn(i.getSeconds())},U:function(i){return i.getTime()/1e3},W:function(i,e,t){return t.getWeek(i)},Y:function(i){return Mn(i.getFullYear(),4)},d:function(i){return Mn(i.getDate())},h:function(i){return i.getHours()%12?i.getHours()%12:12},i:function(i){return Mn(i.getMinutes())},j:function(i){return i.getDate()},l:function(i,e){return e.weekdays.longhand[i.getDay()]},m:function(i){return Mn(i.getMonth()+1)},n:function(i){return i.getMonth()+1},s:function(i){return i.getSeconds()},u:function(i){return i.getTime()},w:function(i){return i.getDay()},y:function(i){return String(i.getFullYear()).substring(2)}},nk=function(i){var e=i.config,t=e===void 0?co:e,n=i.l10n,r=n===void 0?ra:n,s=i.isMobile,o=s===void 0?!1:s;return function(l,a,c){var u=c||r;return t.formatDate!==void 0&&!o?t.formatDate(l,a,u):a.split("").map(function(h,f,d){return $l[h]&&d[f-1]!=="\\"?$l[h](l,u,t):h!=="\\"?h:""}).join("")}},yd=function(i){var e=i.config,t=e===void 0?co:e,n=i.l10n,r=n===void 0?ra:n;return function(s,o,l,a){if(!(s!==0&&!s)){var c=a||r,u,h=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var f=o||(t||co).dateFormat,d=String(s).trim();if(d==="today")u=new Date,l=!0;else if(t&&t.parseDate)u=t.parseDate(s,f);else if(/Z$/.test(d)||/GMT$/.test(d))u=new Date(s);else{for(var m=void 0,p=[],g=0,b=0,w="";gMath.min(e,t)&&i=0?new Date:new Date(t.config.minDate.getTime()),F=qh(t.config);L.setHours(F.hours,F.minutes,F.seconds,L.getMilliseconds()),t.selectedDates=[L],t.latestSelectedDateObj=L}E!==void 0&&E.type!=="blur"&&Ah(E);var j=t._input.value;h(),bi(),t._input.value!==j&&t._debouncedChange()}function c(E,L){return E%12+12*ni(L===t.l10n.amPM[1])}function u(E){switch(E%24){case 0:case 12:return 12;default:return E%12}}function h(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var E=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,L=(parseInt(t.minuteElement.value,10)||0)%60,F=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(E=c(E,t.amPM.textContent));var j=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Yn(t.latestSelectedDateObj,t.config.minDate,!0)===0,ae=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Yn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var be=jh(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),We=jh(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),we=jh(E,L,F);if(we>We&&we=12)]),t.secondElement!==void 0&&(t.secondElement.value=Mn(F)))}function m(E){var L=Zn(E),F=parseInt(L.value)+(E.delta||0);(F/1e3>1||E.key==="Enter"&&!/[^\d]/.test(F.toString()))&&Pe(F)}function p(E,L,F,j){if(L instanceof Array)return L.forEach(function(ae){return p(E,ae,F,j)});if(E instanceof Array)return E.forEach(function(ae){return p(ae,L,F,j)});E.addEventListener(L,F,j),t._handlers.push({remove:function(){return E.removeEventListener(L,F,j)}})}function g(){pt("onChange")}function b(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(F){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+F+"]"),function(j){return p(j,"click",t[F])})}),t.isMobile){Fs();return}var E=S1(Ke,50);if(t._debouncedChange=S1(g,RE),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&p(t.daysContainer,"mouseover",function(F){t.config.mode==="range"&&Qt(Zn(F))}),p(t._input,"keydown",wt),t.calendarContainer!==void 0&&p(t.calendarContainer,"keydown",wt),!t.config.inline&&!t.config.static&&p(window,"resize",E),window.ontouchstart!==void 0?p(window.document,"touchstart",H):p(window.document,"mousedown",H),p(window.document,"focus",H,{capture:!0}),t.config.clickOpens===!0&&(p(t._input,"focus",t.open),p(t._input,"click",t.open)),t.daysContainer!==void 0&&(p(t.monthNav,"click",os),p(t.monthNav,["keyup","increment"],m),p(t.daysContainer,"click",vr)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var L=function(F){return Zn(F).select()};p(t.timeContainer,["increment"],a),p(t.timeContainer,"blur",a,{capture:!0}),p(t.timeContainer,"click",S),p([t.hourElement,t.minuteElement],["focus","click"],L),t.secondElement!==void 0&&p(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&p(t.amPM,"click",function(F){a(F)})}t.config.allowInput&&p(t._input,"blur",yt)}function w(E,L){var F=E!==void 0?t.parseDate(E):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(E);var ae=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!ae&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var be=ft("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(be,t.element),be.appendChild(t.element),t.altInput&&be.appendChild(t.altInput),be.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function Q(E,L,F,j){var ae=Ye(L,!0),be=ft("span",E,L.getDate().toString());return be.dateObj=L,be.$i=j,be.setAttribute("aria-label",t.formatDate(L,t.config.ariaDateFormat)),E.indexOf("hidden")===-1&&Yn(L,t.now)===0&&(t.todayDateElem=be,be.classList.add("today"),be.setAttribute("aria-current","date")),ae?(be.tabIndex=-1,ss(L)&&(be.classList.add("selected"),t.selectedDateElem=be,t.config.mode==="range"&&(vn(be,"startRange",t.selectedDates[0]&&Yn(L,t.selectedDates[0],!0)===0),vn(be,"endRange",t.selectedDates[1]&&Yn(L,t.selectedDates[1],!0)===0),E==="nextMonthDay"&&be.classList.add("inRange")))):be.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Ph(L)&&!ss(L)&&be.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&E!=="prevMonthDay"&&j%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(L)+""),pt("onDayCreate",be),be}function x(E){E.focus(),t.config.mode==="range"&&Qt(E)}function C(E){for(var L=E>0?0:t.config.showMonths-1,F=E>0?t.config.showMonths:-1,j=L;j!=F;j+=E)for(var ae=t.daysContainer.children[j],be=E>0?0:ae.children.length-1,We=E>0?ae.children.length:-1,we=be;we!=We;we+=E){var Ne=ae.children[we];if(Ne.className.indexOf("hidden")===-1&&Ye(Ne.dateObj))return Ne}}function M(E,L){for(var F=E.className.indexOf("Month")===-1?E.dateObj.getMonth():t.currentMonth,j=L>0?t.config.showMonths:-1,ae=L>0?1:-1,be=F-t.currentMonth;be!=j;be+=ae)for(var We=t.daysContainer.children[be],we=F-t.currentMonth===be?E.$i+L:L<0?We.children.length-1:0,Ne=We.children.length,_e=we;_e>=0&&_e0?Ne:-1);_e+=ae){var Me=We.children[_e];if(Me.className.indexOf("hidden")===-1&&Ye(Me.dateObj)&&Math.abs(E.$i-_e)>=Math.abs(L))return x(Me)}t.changeMonth(ae),$(C(ae),0)}function $(E,L){var F=s(),j=Tt(F||document.body),ae=E!==void 0?E:j?F:t.selectedDateElem!==void 0&&Tt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Tt(t.todayDateElem)?t.todayDateElem:C(L>0?1:-1);ae===void 0?t._input.focus():j?M(ae,L):x(ae)}function N(E,L){for(var F=(new Date(E,L,1).getDay()-t.l10n.firstDayOfWeek+7)%7,j=t.utils.getDaysInMonth((L-1+12)%12,E),ae=t.utils.getDaysInMonth(L,E),be=window.document.createDocumentFragment(),We=t.config.showMonths>1,we=We?"prevMonthDay hidden":"prevMonthDay",Ne=We?"nextMonthDay hidden":"nextMonthDay",_e=j+1-F,Me=0;_e<=j;_e++,Me++)be.appendChild(Q("flatpickr-day "+we,new Date(E,L-1,_e),_e,Me));for(_e=1;_e<=ae;_e++,Me++)be.appendChild(Q("flatpickr-day",new Date(E,L,_e),_e,Me));for(var ht=ae+1;ht<=42-F&&(t.config.showMonths===1||Me%7!==0);ht++,Me++)be.appendChild(Q("flatpickr-day "+Ne,new Date(E,L+1,ht%ae),ht,Me));var Nn=ft("div","dayContainer");return Nn.appendChild(be),Nn}function B(){if(t.daysContainer!==void 0){nc(t.daysContainer),t.weekNumbers&&nc(t.weekNumbers);for(var E=document.createDocumentFragment(),L=0;L1||t.config.monthSelectorType!=="dropdown")){var E=function(j){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&jt.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var L=0;L<12;L++)if(E(L)){var F=ft("option","flatpickr-monthDropdown-month");F.value=new Date(t.currentYear,L).getMonth().toString(),F.textContent=bu(L,t.config.shorthandCurrentMonth,t.l10n),F.tabIndex=-1,t.currentMonth===L&&(F.selected=!0),t.monthsDropdownContainer.appendChild(F)}}}function te(){var E=ft("div","flatpickr-month"),L=window.document.createDocumentFragment(),F;t.config.showMonths>1||t.config.monthSelectorType==="static"?F=ft("span","cur-month"):(t.monthsDropdownContainer=ft("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),p(t.monthsDropdownContainer,"change",function(We){var we=Zn(We),Ne=parseInt(we.value,10);t.changeMonth(Ne-t.currentMonth),pt("onMonthChange")}),J(),F=t.monthsDropdownContainer);var j=ic("cur-year",{tabindex:"-1"}),ae=j.getElementsByTagName("input")[0];ae.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&ae.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(ae.setAttribute("max",t.config.maxDate.getFullYear().toString()),ae.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var be=ft("div","flatpickr-current-month");return be.appendChild(F),be.appendChild(j),L.appendChild(be),E.appendChild(L),{container:E,yearElement:ae,monthElement:F}}function ie(){nc(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var E=t.config.showMonths;E--;){var L=te();t.yearElements.push(L.yearElement),t.monthElements.push(L.monthElement),t.monthNav.appendChild(L.container)}t.monthNav.appendChild(t.nextMonthNav)}function le(){return t.monthNav=ft("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ft("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ft("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,ie(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(E){t.__hidePrevMonthArrow!==E&&(vn(t.prevMonthNav,"flatpickr-disabled",E),t.__hidePrevMonthArrow=E)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(E){t.__hideNextMonthArrow!==E&&(vn(t.nextMonthNav,"flatpickr-disabled",E),t.__hideNextMonthArrow=E)}}),t.currentYearElement=t.yearElements[0],er(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var E=qh(t.config);t.timeContainer=ft("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var L=ft("span","flatpickr-time-separator",":"),F=ic("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=F.getElementsByTagName("input")[0];var j=ic("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=j.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?E.hours:u(E.hours)),t.minuteElement.value=Mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():E.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(F),t.timeContainer.appendChild(L),t.timeContainer.appendChild(j),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var ae=ic("flatpickr-second");t.secondElement=ae.getElementsByTagName("input")[0],t.secondElement.value=Mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():E.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ft("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(ae)}return t.config.time_24hr||(t.amPM=ft("span","flatpickr-am-pm",t.l10n.amPM[ni((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function ee(){t.weekdayContainer?nc(t.weekdayContainer):t.weekdayContainer=ft("div","flatpickr-weekdays");for(var E=t.config.showMonths;E--;){var L=ft("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(L)}return Te(),t.weekdayContainer}function Te(){if(t.weekdayContainer){var E=t.l10n.firstDayOfWeek,L=_1(t.l10n.weekdays.shorthand);E>0&&E=0)&&(t[r]=i[r]);return t}function MM(i,e){if(i==null)return{};var t=QM(i,e),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,n)&&(t[n]=i[n])}return t}var EM="1.15.2";function lr(i){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(i)}var pr=lr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ea=lr(/Edge/i),n1=lr(/firefox/i),Ml=lr(/safari/i)&&!lr(/chrome/i)&&!lr(/android/i),xy=lr(/iP(ad|od|hone)/i),Ty=lr(/chrome/i)&&lr(/android/i),Qy={capture:!1,passive:!1};function mt(i,e,t){i.addEventListener(e,t,!pr&&Qy)}function lt(i,e,t){i.removeEventListener(e,t,!pr&&Qy)}function du(i,e){if(e){if(e[0]===">"&&(e=e.substring(1)),i)try{if(i.matches)return i.matches(e);if(i.msMatchesSelector)return i.msMatchesSelector(e);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(e)}catch{return!1}return!1}}function RM(i){return i.host&&i!==document&&i.host.nodeType?i.host:i.parentNode}function ki(i,e,t,n){if(i){t=t||document;do{if(e!=null&&(e[0]===">"?i.parentNode===t&&du(i,e):du(i,e))||n&&i===t)return i;if(i===t)break}while(i=RM(i))}return null}var i1=/\s+/g;function Fn(i,e,t){if(i&&e)if(i.classList)i.classList[t?"add":"remove"](e);else{var n=(" "+i.className+" ").replace(i1," ").replace(" "+e+" "," ");i.className=(n+(t?" "+e:"")).replace(i1," ")}}function De(i,e,t){var n=i&&i.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(i,""):i.currentStyle&&(t=i.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function co(i,e){var t="";if(typeof i=="string")t=i;else do{var n=De(i,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(i=i.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(t)}function My(i,e,t){if(i){var n=i.getElementsByTagName(e),r=0,s=n.length;if(t)for(;r=s,!o)return n;if(n===Ui())break;n=Lr(n,!1)}return!1}function Po(i,e,t,n){for(var r=0,s=0,o=i.children;s2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,s=MM(n,WM);Ra.pluginEvent.bind($e)(e,t,Hi({dragEl:he,parentEl:Bt,ghostEl:Xe,rootEl:Dt,nextEl:ds,lastDownEl:Zc,cloneEl:It,cloneHidden:Er,dragStarted:vl,putSortable:sn,activeSortable:$e.active,originalEvent:r,oldIndex:io,oldDraggableIndex:Rl,newIndex:zn,newDraggableIndex:xr,hideGhostForTarget:Zy,unhideGhostForTarget:By,cloneNowHidden:function(){Er=!0},cloneNowShown:function(){Er=!1},dispatchSortableEvent:function(l){yn({sortable:t,name:l,originalEvent:r})}},s))};function yn(i){BM(Hi({putSortable:sn,cloneEl:It,targetEl:he,rootEl:Dt,oldIndex:io,oldDraggableIndex:Rl,newIndex:zn,newDraggableIndex:xr},i))}var he,Bt,Xe,Dt,ds,Zc,It,Er,io,zn,Rl,xr,Ka,sn,Ks=!1,mu=!1,pu=[],ls,vi,Nh,Zh,o1,l1,vl,qs,Dl,$l=!1,Ja=!1,Bc,fn,Bh=[],Od=!1,gu=[],sh=typeof document<"u",ec=xy,a1=Ea||pr?"cssFloat":"float",XM=sh&&!Ty&&!xy&&"draggable"in document.createElement("div"),Ly=function(){if(sh){if(pr)return!1;var i=document.createElement("x");return i.style.cssText="pointer-events:auto",i.style.pointerEvents==="auto"}}(),Iy=function(e,t){var n=De(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),s=Po(e,0,t),o=Po(e,1,t),l=s&&De(s),a=o&&De(o),c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Gt(s).width,u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Gt(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&l.float&&l.float!=="none"){var h=l.float==="left"?"left":"right";return o&&(a.clear==="both"||a.clear===h)?"vertical":"horizontal"}return s&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||c>=r&&n[a1]==="none"||o&&n[a1]==="none"&&c+u>r)?"vertical":"horizontal"},FM=function(e,t,n){var r=n?e.left:e.top,s=n?e.right:e.bottom,o=n?e.width:e.height,l=n?t.left:t.top,a=n?t.right:t.bottom,c=n?t.width:t.height;return r===l||s===a||r+o/2===l+c/2},YM=function(e,t){var n;return pu.some(function(r){var s=r[qn].options.emptyInsertThreshold;if(!(!s||zm(r))){var o=Gt(r),l=e>=o.left-s&&e<=o.right+s,a=t>=o.top-s&&t<=o.bottom+s;if(l&&a)return n=r}}),n},Ny=function(e){function t(s,o){return function(l,a,c,u){var h=l.options.group.name&&a.options.group.name&&l.options.group.name===a.options.group.name;if(s==null&&(o||h))return!0;if(s==null||s===!1)return!1;if(o&&s==="clone")return s;if(typeof s=="function")return t(s(l,a,c,u),o)(l,a,c,u);var f=(o?l:a).options.group.name;return s===!0||typeof s=="string"&&s===f||s.join&&s.indexOf(f)>-1}}var n={},r=e.group;(!r||Nc(r)!="object")&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Zy=function(){!Ly&&Xe&&De(Xe,"display","none")},By=function(){!Ly&&Xe&&De(Xe,"display","")};sh&&!Ty&&document.addEventListener("click",function(i){if(mu)return i.preventDefault(),i.stopPropagation&&i.stopPropagation(),i.stopImmediatePropagation&&i.stopImmediatePropagation(),mu=!1,!1},!0);var as=function(e){if(he){e=e.touches?e.touches[0]:e;var t=YM(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[qn]._onDragOver(n)}}},zM=function(e){he&&he.parentNode[qn]._isOutsideThisEl(e.target)};function $e(i,e){if(!(i&&i.nodeType&&i.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(i));this.el=i,this.options=e=fr({},e),i[qn]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(i.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Iy(i,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,l){o.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:$e.supportPointer!==!1&&"PointerEvent"in window&&!Ml,emptyInsertThreshold:5};Ra.initializePlugins(this,i,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Ny(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:XM,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?mt(i,"pointerdown",this._onTapStart):(mt(i,"mousedown",this._onTapStart),mt(i,"touchstart",this._onTapStart)),this.nativeDraggable&&(mt(i,"dragover",this),mt(i,"dragenter",this)),pu.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),fr(this,IM())}$e.prototype={constructor:$e,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(qs=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,he):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,s=r.preventOnFilter,o=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,a=(l||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,u=r.filter;if(JM(n),!he&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Ml&&a&&a.tagName.toUpperCase()==="SELECT")&&(a=ki(a,r.draggable,n,!1),!(a&&a.animated)&&Zc!==a)){if(io=ii(a),Rl=ii(a,r.draggable),typeof u=="function"){if(u.call(this,e,a,this)){yn({sortable:t,rootEl:c,name:"filter",targetEl:a,toEl:n,fromEl:n}),Tn("filter",t,{evt:e}),s&&e.cancelable&&e.preventDefault();return}}else if(u&&(u=u.split(",").some(function(h){if(h=ki(c,h.trim(),n,!1),h)return yn({sortable:t,rootEl:h,name:"filter",targetEl:a,fromEl:n,toEl:n}),Tn("filter",t,{evt:e}),!0}),u)){s&&e.cancelable&&e.preventDefault();return}r.handle&&!ki(c,r.handle,n,!1)||this._prepareDragStart(e,l,a)}}},_prepareDragStart:function(e,t,n){var r=this,s=r.el,o=r.options,l=s.ownerDocument,a;if(n&&!he&&n.parentNode===s){var c=Gt(n);if(Dt=s,he=n,Bt=he.parentNode,ds=he.nextSibling,Zc=n,Ka=o.group,$e.dragged=he,ls={target:he,clientX:(t||e).clientX,clientY:(t||e).clientY},o1=ls.clientX-c.left,l1=ls.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,he.style["will-change"]="all",a=function(){if(Tn("delayEnded",r,{evt:e}),$e.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!n1&&r.nativeDraggable&&(he.draggable=!0),r._triggerDragStart(e,t),yn({sortable:r,name:"choose",originalEvent:e}),Fn(he,o.chosenClass,!0)},o.ignore.split(",").forEach(function(u){My(he,u.trim(),Wh)}),mt(l,"dragover",as),mt(l,"mousemove",as),mt(l,"touchmove",as),mt(l,"mouseup",r._onDrop),mt(l,"touchend",r._onDrop),mt(l,"touchcancel",r._onDrop),n1&&this.nativeDraggable&&(this.options.touchStartThreshold=4,he.draggable=!0),Tn("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Ea||pr))){if($e.eventCanceled){this._onDrop();return}mt(l,"mouseup",r._disableDelayedDrag),mt(l,"touchend",r._disableDelayedDrag),mt(l,"touchcancel",r._disableDelayedDrag),mt(l,"mousemove",r._delayedDragTouchMoveHandler),mt(l,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&mt(l,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(a,o.delay)}else a()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){he&&Wh(he),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;lt(e,"mouseup",this._disableDelayedDrag),lt(e,"touchend",this._disableDelayedDrag),lt(e,"touchcancel",this._disableDelayedDrag),lt(e,"mousemove",this._delayedDragTouchMoveHandler),lt(e,"touchmove",this._delayedDragTouchMoveHandler),lt(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?mt(document,"pointermove",this._onTouchMove):t?mt(document,"touchmove",this._onTouchMove):mt(document,"mousemove",this._onTouchMove):(mt(he,"dragend",this),mt(Dt,"dragstart",this._onDragStart));try{document.selection?Wc(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Ks=!1,Dt&&he){Tn("dragStarted",this,{evt:t}),this.nativeDraggable&&mt(document,"dragover",zM);var n=this.options;!e&&Fn(he,n.dragClass,!1),Fn(he,n.ghostClass,!0),$e.active=this,e&&this._appendGhost(),yn({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(vi){this._lastX=vi.clientX,this._lastY=vi.clientY,Zy();for(var e=document.elementFromPoint(vi.clientX,vi.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(vi.clientX,vi.clientY),e!==t);)t=e;if(he.parentNode[qn]._isOutsideThisEl(e),t)do{if(t[qn]){var n=void 0;if(n=t[qn]._onDragOver({clientX:vi.clientX,clientY:vi.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);By()}},_onTouchMove:function(e){if(ls){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,s=e.touches?e.touches[0]:e,o=Xe&&co(Xe,!0),l=Xe&&o&&o.a,a=Xe&&o&&o.d,c=ec&&fn&&s1(fn),u=(s.clientX-ls.clientX+r.x)/(l||1)+(c?c[0]-Bh[0]:0)/(l||1),h=(s.clientY-ls.clientY+r.y)/(a||1)+(c?c[1]-Bh[1]:0)/(a||1);if(!$e.active&&!Ks){if(n&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))=0&&(yn({rootEl:Bt,name:"add",toEl:Bt,fromEl:Dt,originalEvent:e}),yn({sortable:this,name:"remove",toEl:Bt,originalEvent:e}),yn({rootEl:Bt,name:"sort",toEl:Bt,fromEl:Dt,originalEvent:e}),yn({sortable:this,name:"sort",toEl:Bt,originalEvent:e})),sn&&sn.save()):zn!==io&&zn>=0&&(yn({sortable:this,name:"update",toEl:Bt,originalEvent:e}),yn({sortable:this,name:"sort",toEl:Bt,originalEvent:e})),$e.active&&((zn==null||zn===-1)&&(zn=io,xr=Rl),yn({sortable:this,name:"end",toEl:Bt,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Tn("nulling",this),Dt=he=Bt=Xe=ds=It=Zc=Er=ls=vi=vl=zn=xr=io=Rl=qs=Dl=sn=Ka=$e.dragged=$e.ghost=$e.clone=$e.active=null,gu.forEach(function(e){e.checked=!0}),gu.length=Nh=Zh=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":he&&(this._onDragOver(e),VM(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,s=n.length,o=this.options;rr.right+s||i.clientY>n.bottom&&i.clientX>n.left:i.clientY>r.bottom+s||i.clientX>n.right&&i.clientY>n.top}function GM(i,e,t,n,r,s,o,l){var a=n?i.clientY:i.clientX,c=n?t.height:t.width,u=n?t.top:t.left,h=n?t.bottom:t.right,f=!1;if(!o){if(l&&Bcu+c*s/2:ah-Bc)return-Dl}else if(a>u+c*(1-r)/2&&ah-c*s/2)?a>u+c/2?1:-1:0}function HM(i){return ii(he){o[u]=null}),be(),t=o[e],t?t.p(a,c):(t=o[e]=s[e](a),t.c()),T(t,1),t.m(n.parentNode,n))},i(a){r||(T(t),r=!0)},o(a){R(t),r=!1},d(a){a&&P(n),o[e].d(a)}}}function rE(i,e,t){let{$$slots:n={},$$scope:r}=e,{sortableClass:s=""}=e,{isTable:o=!1}=e,{sortableInstance:l}=e;const a=nn();let c;xi(()=>{let f={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",direction:"vertical",onUpdate(d){a("update",{source:d.oldIndex,target:d.newIndex})}};t(3,l=$e.create(c,f))});function u(f){Ce[f?"unshift":"push"](()=>{c=f,t(2,c)})}function h(f){Ce[f?"unshift":"push"](()=>{c=f,t(2,c)})}return i.$$set=f=>{"sortableClass"in f&&t(0,s=f.sortableClass),"isTable"in f&&t(1,o=f.isTable),"sortableInstance"in f&&t(3,l=f.sortableInstance),"$$scope"in f&&t(4,r=f.$$scope)},[s,o,c,l,r,n,u,h]}class Xy extends oe{constructor(e){super(),se(this,e,rE,iE,re,{sortableClass:0,isTable:1,sortableInstance:3})}}function sE(i){let e,t,n;return t=new Xo({props:{record:i[4],size:"small"}}),{c(){e=y("div"),V(t.$$.fragment),O(e,"class","image")},m(r,s){x(r,e,s),Y(t,e,null),n=!0},p:U,i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function u1(i){let e,t;return e=new Py({props:{status:i[0].status}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.status=n[0].status),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function h1(i){let e,t,n,r,s,o;return n=new ut({props:{icon:"trash-can"}}),{c(){e=y("div"),t=y("button"),V(n.$$.fragment),O(t,"class","button"),O(e,"class","reference-action")},m(l,a){x(l,e,a),b(e,t),Y(n,t,null),r=!0,s||(o=G(t,"click",i[5]),s=!0)},p:U,i(l){r||(T(n.$$.fragment,l),r=!0)},o(l){R(n.$$.fragment,l),r=!1},d(l){l&&P(e),z(n),s=!1,o()}}}function oE(i){let e,t,n,r,s,o,l=i[0].data.name+"",a,c,u,h,f,d=i[3].label+"",m,p,g,v,w=i[4]&&sE(i),S=i[0].status==="draft"&&u1(i),_=i[1]&&h1(i);return{c(){e=y("div"),t=y("div"),w&&w.c(),n=D(),r=y("div"),s=y("div"),o=y("a"),a=W(l),u=D(),h=y("small"),f=W("from "),m=W(d),p=D(),S&&S.c(),g=D(),_&&_.c(),O(o,"class","record-title"),O(o,"href",c=i[2].lucentUrl+"/records/"+i[0].id),O(h,"class","d-block"),O(r,"class","title"),le(t,"display","flex"),le(t,"align-items","center"),le(t,"gap","10px"),O(e,"class","preview-reference")},m(k,A){x(k,e,A),b(e,t),w&&w.m(t,null),b(t,n),b(t,r),b(r,s),b(s,o),b(o,a),b(s,u),b(s,h),b(h,f),b(h,m),b(h,p),S&&S.m(h,null),b(e,g),_&&_.m(e,null),v=!0},p(k,[A]){k[4]&&w.p(k,A),(!v||A&1)&&l!==(l=k[0].data.name+"")&&K(a,l),(!v||A&1&&c!==(c=k[2].lucentUrl+"/records/"+k[0].id))&&O(o,"href",c),k[0].status==="draft"?S?(S.p(k,A),A&1&&T(S,1)):(S=u1(k),S.c(),T(S,1),S.m(h,null)):S&&(Oe(),R(S,1,1,()=>{S=null}),be()),k[1]?_?(_.p(k,A),A&2&&T(_,1)):(_=h1(k),_.c(),T(_,1),_.m(e,null)):_&&(Oe(),R(_,1,1,()=>{_=null}),be())},i(k){v||(T(w),T(S),T(_),v=!0)},o(k){R(w),R(S),R(_),v=!1},d(k){k&&P(e),w&&w.d(),S&&S.d(),_&&_.d()}}}function lE(i,e,t){const n=nn(),r=Ue("channel");let{graph:s}=e,{record:o}=e,{hasDelete:l=!1}=e,a=r.schemas.find(f=>f.name===o.schema);const c=s.edges.find(f=>f.source===o.id&&f.field===a.cardImage);let u=s.records.find(f=>f.id===(c==null?void 0:c.target));function h(f){f.preventDefault(),n("remove",o.id)}return i.$$set=f=>{"graph"in f&&t(6,s=f.graph),"record"in f&&t(0,o=f.record),"hasDelete"in f&&t(1,l=f.hasDelete)},[o,l,r,a,u,h,s]}class Fy extends oe{constructor(e){super(),se(this,e,lE,oE,re,{graph:6,record:0,hasDelete:1})}}function f1(i,e,t){const n=i.slice();return n[11]=e[t],n}function d1(i){let e,t;return{c(){e=y("div"),t=W(i[2]),O(e,"class","invalid-feedback d-block mb-3")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&4&&K(t,n[2])},d(n){n&&P(e)}}}function m1(i){let e,t;return e=new Xy({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[aE]},$$scope:{ctx:i}}}),e.$on("update",i[5]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&16387&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function p1(i,e){let t,n,r,s;return n=new Fy({props:{graph:e[0],record:e[11],hasDelete:!0}}),n.$on("remove",e[4]),{key:i,first:null,c(){t=y("div"),V(n.$$.fragment),r=D(),this.first=t},m(o,l){x(o,t,l),Y(n,t,null),b(t,r),s=!0},p(o,l){e=o;const a={};l&1&&(a.graph=e[0]),l&2&&(a.record=e[11]),n.$set(a)},i(o){s||(T(n.$$.fragment,o),s=!0)},o(o){R(n.$$.fragment,o),s=!1},d(o){o&&P(t),z(n)}}}function aE(i){let e=[],t=new Map,n,r,s=fe(i[1]);const o=l=>l[11].id;for(let l=0;l0&&m1(i);return{c(){l&&l.c(),e=D(),t=y("div"),V(n.$$.fragment),r=D(),a&&a.c(),s=Ie(),O(t,"class","inline-card-wrapper")},m(c,u){l&&l.m(c,u),x(c,e,u),x(c,t,u),Y(n,t,null),x(c,r,u),a&&a.m(c,u),x(c,s,u),o=!0},p(c,[u]){c[2]?l?l.p(c,u):(l=d1(c),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),c[1].length>0?a?(a.p(c,u),u&2&&T(a,1)):(a=m1(c),a.c(),T(a,1),a.m(s.parentNode,s)):a&&(Oe(),R(a,1,1,()=>{a=null}),be())},i(c){o||(T(n.$$.fragment,c),T(a),o=!0)},o(c){R(n.$$.fragment,c),R(a),o=!1},d(c){c&&(P(e),P(t),P(r),P(s)),l&&l.d(c),z(n),a&&a.d(c)}}}function uE(i,e,t){let n,r;const s=Ue("channel");let{record:o}=e,{field:l}=e,{graph:a}=e,{validationErrors:c}=e,u=s.schemas.filter(m=>l.collections.includes(m.name));function h(m){m.preventDefault(),t(0,a.edges=a.edges.filter(p=>!(p.target===m.detail&&p.field===l.name)),a)}function f(m){t(0,a.edges=tT(m.detail.source,m.detail.target,a.edges,l.name,r),a)}function d(m){m.preventDefault(),t(0,a=ky(a,o,m.detail.records,l.name,m.detail.action))}return i.$$set=m=>{"record"in m&&t(7,o=m.record),"field"in m&&t(8,l=m.field),"graph"in m&&t(0,a=m.graph),"validationErrors"in m&&t(9,c=m.validationErrors)},i.$$.update=()=>{i.$$.dirty&768&&t(2,n=In(c,l.name)),i.$$.dirty&385&&t(1,r=a.edges.filter(m=>m.field===l.name).map(m=>a.records.find(p=>p.id===m.target&&o.id===m.source)).filter(m=>!!(m!=null&&m.id))??[])},[a,r,n,u,h,f,d,o,l,c]}class hE extends oe{constructor(e){super(),se(this,e,uE,cE,re,{record:7,field:8,graph:0,validationErrors:9})}}function g1(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function fE(i){let e,t,n,r,s,o,l,a,c,u,h=i[4]&&g1(i);return{c(){e=y("div"),t=y("div"),n=y("input"),s=D(),o=y("input"),a=D(),h&&h.c(),O(n,"type","color"),O(n,"id",i[3]),le(n,"border","none"),le(n,"background","transparent"),le(n,"padding","0"),le(n,"width","64px"),n.disabled=r=i[1].readonly&&!i[2],O(o,"type","text"),O(o,"id",i[3]),O(o,"class","form-control"),o.readOnly=l=i[1].readonly&&!i[2],Ae(o,"is-invalid",i[4]),le(t,"display","flex"),le(t,"align-items","center"),le(t,"gap","10px"),O(e,"class","mb-0")},m(f,d){x(f,e,d),b(e,t),b(t,n),Le(n,i[0]),b(t,s),b(t,o),Le(o,i[0]),b(e,a),h&&h.m(e,null),c||(u=[G(n,"input",i[6]),G(o,"input",i[7])],c=!0)},p(f,[d]){d&8&&O(n,"id",f[3]),d&6&&r!==(r=f[1].readonly&&!f[2])&&(n.disabled=r),d&1&&Le(n,f[0]),d&8&&O(o,"id",f[3]),d&6&&l!==(l=f[1].readonly&&!f[2])&&(o.readOnly=l),d&1&&o.value!==f[0]&&Le(o,f[0]),d&16&&Ae(o,"is-invalid",f[4]),f[4]?h?h.p(f,d):(h=g1(f),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i:U,o:U,d(f){f&&P(e),h&&h.d(),c=!1,ht(u)}}}function dE(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,{id:a}=e;function c(){s=this.value,t(0,s)}function u(){s=this.value,t(0,s)}return i.$$set=h=>{"field"in h&&t(1,r=h.field),"value"in h&&t(0,s=h.value),"isCreateMode"in h&&t(2,o=h.isCreateMode),"validationErrors"in h&&t(5,l=h.validationErrors),"id"in h&&t(3,a=h.id)},i.$$.update=()=>{i.$$.dirty&34&&t(4,n=In(l,r.name))},[s,r,o,a,n,l,c,u]}class mE extends oe{constructor(e){super(),se(this,e,dE,fE,re,{field:1,value:0,isCreateMode:2,validationErrors:5,id:3})}}function O1(i){let e,t,n,r,s,o,l,a,c,u,h;return c=qw(i[7][0]),{c(){e=y("div"),t=y("input"),s=D(),o=y("label"),l=W("Don't Know"),O(t,"class","form-check-input"),O(t,"id",n=i[1]+"-3"),O(t,"type","radio"),t.__value=null,Le(t,t.__value),t.disabled=r=i[2].readonly&&!i[3],Ae(t,"is-invalid",i[4]),O(o,"class","form-check-label"),O(o,"for",a=i[1]+"-3"),O(e,"class","form-check form-check-inline"),c.p(t)},m(f,d){x(f,e,d),b(e,t),t.checked=t.__value===i[0],b(e,s),b(e,o),b(o,l),u||(h=G(t,"change",i[9]),u=!0)},p(f,d){d&2&&n!==(n=f[1]+"-3")&&O(t,"id",n),d&12&&r!==(r=f[2].readonly&&!f[3])&&(t.disabled=r),d&1&&(t.checked=t.__value===f[0]),d&16&&Ae(t,"is-invalid",f[4]),d&2&&a!==(a=f[1]+"-3")&&O(o,"for",a)},d(f){f&&P(e),c.r(),u=!1,h()}}}function b1(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function pE(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S,_,k,A,C,Q,M=i[2].nullable&&O1(i),L=i[4]&&b1(i);return A=qw(i[7][0]),{c(){e=y("div"),t=y("div"),n=y("input"),o=D(),l=y("label"),a=W("Yes"),u=D(),h=y("div"),f=y("input"),p=D(),g=y("label"),v=W("No"),S=D(),M&&M.c(),_=D(),L&&L.c(),k=Ie(),O(n,"class","form-check-input"),O(n,"type","radio"),O(n,"id",r=i[1]+"-1"),n.__value=!0,Le(n,n.__value),n.disabled=s=i[2].readonly&&!i[3],Ae(n,"is-invalid",i[4]),O(l,"class","form-check-label"),O(l,"for",c=i[1]+"-1"),O(t,"class","form-check form-check-inline"),O(f,"class","form-check-input"),O(f,"type","radio"),O(f,"id",d=i[1]+"-2"),f.__value=!1,Le(f,f.__value),f.disabled=m=i[2].readonly&&!i[3],Ae(f,"is-invalid",i[4]),O(g,"class","form-check-label"),O(g,"for",w=i[1]+"-2"),O(h,"class","form-check form-check-inline"),O(e,"class","field-checkbox"),A.p(n,f)},m(N,B){x(N,e,B),b(e,t),b(t,n),n.checked=n.__value===i[0],b(t,o),b(t,l),b(l,a),b(e,u),b(e,h),b(h,f),f.checked=f.__value===i[0],b(h,p),b(h,g),b(g,v),b(e,S),M&&M.m(e,null),x(N,_,B),L&&L.m(N,B),x(N,k,B),C||(Q=[G(n,"change",i[6]),G(f,"change",i[8])],C=!0)},p(N,[B]){B&2&&r!==(r=N[1]+"-1")&&O(n,"id",r),B&12&&s!==(s=N[2].readonly&&!N[3])&&(n.disabled=s),B&1&&(n.checked=n.__value===N[0]),B&16&&Ae(n,"is-invalid",N[4]),B&2&&c!==(c=N[1]+"-1")&&O(l,"for",c),B&2&&d!==(d=N[1]+"-2")&&O(f,"id",d),B&12&&m!==(m=N[2].readonly&&!N[3])&&(f.disabled=m),B&1&&(f.checked=f.__value===N[0]),B&16&&Ae(f,"is-invalid",N[4]),B&2&&w!==(w=N[1]+"-2")&&O(g,"for",w),N[2].nullable?M?M.p(N,B):(M=O1(N),M.c(),M.m(e,null)):M&&(M.d(1),M=null),N[4]?L?L.p(N,B):(L=b1(N),L.c(),L.m(k.parentNode,k)):L&&(L.d(1),L=null)},i:U,o:U,d(N){N&&(P(e),P(_),P(k)),M&&M.d(),L&&L.d(N),A.r(),C=!1,ht(Q)}}}function gE(i,e,t){let n,{id:r}=e,{field:s}=e,{value:o}=e,{isCreateMode:l}=e,{validationErrors:a}=e;const c=[[]];function u(){o=this.__value,t(0,o)}function h(){o=this.__value,t(0,o)}function f(){o=this.__value,t(0,o)}return i.$$set=d=>{"id"in d&&t(1,r=d.id),"field"in d&&t(2,s=d.field),"value"in d&&t(0,o=d.value),"isCreateMode"in d&&t(3,l=d.isCreateMode),"validationErrors"in d&&t(5,a=d.validationErrors)},i.$$.update=()=>{i.$$.dirty&36&&t(4,n=In(a,s.name))},[o,r,s,l,n,a,u,c,h,f]}class OE extends oe{constructor(e){super(),se(this,e,gE,pE,re,{id:1,field:2,value:0,isCreateMode:3,validationErrors:5})}}function v1(i){let e,t;return{c(){e=y("div"),t=W(i[4]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&16&&K(t,n[4])},d(n){n&&P(e)}}}function bE(i){let e,t,n,r,s,o,l=i[4]&&v1(i);return{c(){e=y("div"),t=y("input"),r=D(),l&&l.c(),O(t,"type","number"),O(t,"id",i[3]),O(t,"class","form-control"),O(t,"autocomplete","off"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[4]),O(e,"class","mb-0")},m(a,c){x(a,e,c),b(e,t),Le(t,i[0]),b(e,r),l&&l.m(e,null),s||(o=[G(t,"change",i[5]),G(t,"input",i[7])],s=!0)},p(a,[c]){c&8&&O(t,"id",a[3]),c&6&&n!==(n=a[1].readonly&&!a[2])&&(t.readOnly=n),c&1&&Gw(t.value)!==a[0]&&Le(t,a[0]),c&16&&Ae(t,"is-invalid",a[4]),a[4]?l?l.p(a,c):(l=v1(a),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},i:U,o:U,d(a){a&&P(e),l&&l.d(),s=!1,ht(o)}}}function vE(i,e,t){let n,{field:r}=e,{value:s}=e,{validationErrors:o}=e,{isCreateMode:l}=e,{id:a}=e;function c(f){const d=f.currentTarget.value,m=u(d);t(0,s=isNaN(m)?null:m)}function u(f){return parseFloat(f).toFixed(r.decimals)}function h(){s=Gw(this.value),t(0,s)}return i.$$set=f=>{"field"in f&&t(1,r=f.field),"value"in f&&t(0,s=f.value),"validationErrors"in f&&t(6,o=f.validationErrors),"isCreateMode"in f&&t(2,l=f.isCreateMode),"id"in f&&t(3,a=f.id)},i.$$.update=()=>{i.$$.dirty&66&&t(4,n=In(o,r.name))},[s,r,l,a,n,c,o,h]}let wE=class extends oe{constructor(e){super(),se(this,e,vE,bE,re,{field:1,value:0,validationErrors:6,isCreateMode:2,id:3})}};function w1(i){let e,t=i[1].help+"",n;return{c(){e=y("small"),n=W(t),O(e,"class","text-primary opacity-50")},m(r,s){x(r,e,s),b(e,n)},p(r,s){s&2&&t!==(t=r[1].help+"")&&K(n,t)},d(r){r&&P(e)}}}function yE(i){let e,t,n,r=i[1].label+"",s,o,l,a,c=i[1].name+"",u,h,f,d,m,p,g,v=i[1].help&&w1(i);return{c(){e=y("div"),t=y("div"),n=y("label"),s=W(r),o=D(),l=y("a"),a=y("code"),u=W(c),f=D(),d=y("input"),m=D(),v&&v.c(),O(n,"for",i[4]),O(n,"class","form-label"),O(a,"class","text-primary opacity-50"),O(l,"class","text-decoration-none"),O(l,"href",h=i[3]+"/schemas/"+i[2].name+"/fields/edit/"+i[1].name),O(t,"class","d-flex justify-content-between"),O(d,"type","url"),O(d,"id",i[4]),O(d,"class","form-control"),O(d,"placeholder","https://www.example.com"),O(e,"class","mb-0")},m(w,S){x(w,e,S),b(e,t),b(t,n),b(n,s),b(t,o),b(t,l),b(l,a),b(a,u),b(e,f),b(e,d),Le(d,i[0]),b(e,m),v&&v.m(e,null),p||(g=G(d,"input",i[5]),p=!0)},p(w,[S]){S&2&&r!==(r=w[1].label+"")&&K(s,r),S&2&&c!==(c=w[1].name+"")&&K(u,c),S&6&&h!==(h=w[3]+"/schemas/"+w[2].name+"/fields/edit/"+w[1].name)&&O(l,"href",h),S&1&&d.value!==w[0]&&Le(d,w[0]),w[1].help?v?v.p(w,S):(v=w1(w),v.c(),v.m(e,null)):v&&(v.d(1),v=null)},i:U,o:U,d(w){w&&P(e),v&&v.d(),p=!1,g()}}}function kE(i,e,t){const n=Ue("channelurl");let{field:r}=e,{value:s}=e,{schema:o}=e,l=self.crypto.randomUUID();function a(){s=this.value,t(0,s)}return i.$$set=c=>{"field"in c&&t(1,r=c.field),"value"in c&&t(0,s=c.value),"schema"in c&&t(2,o=c.schema)},[s,r,o,n,l,a]}class SE extends oe{constructor(e){super(),se(this,e,kE,yE,re,{field:1,value:0,schema:2})}}var zh=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],uo={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(i){return typeof console<"u"&&console.warn(i)},getWeek:function(i){var e=new Date(i.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ra={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(i){var e=i%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Mn=function(i,e){return e===void 0&&(e=2),("000"+i).slice(e*-1)},ni=function(i){return i===!0?1:0};function y1(i,e){var t;return function(){var n=this,r=arguments;clearTimeout(t),t=setTimeout(function(){return i.apply(n,r)},e)}}var Vh=function(i){return i instanceof Array?i:[i]};function vn(i,e,t){if(t===!0)return i.classList.add(e);i.classList.remove(e)}function dt(i,e,t){var n=window.document.createElement(i);return e=e||"",t=t||"",n.className=e,t!==void 0&&(n.textContent=t),n}function nc(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function Yy(i,e){if(e(i))return i;if(i.parentNode)return Yy(i.parentNode,e)}function ic(i,e){var t=dt("div","numInputWrapper"),n=dt("input","numInput "+i),r=dt("span","arrowUp"),s=dt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?n.type="number":(n.type="text",n.pattern="\\d*"),e!==void 0)for(var o in e)n.setAttribute(o,e[o]);return t.appendChild(n),t.appendChild(r),t.appendChild(s),t}function Zn(i){try{if(typeof i.composedPath=="function"){var e=i.composedPath();return e[0]}return i.target}catch{return i.target}}var Uh=function(){},bu=function(i,e,t){return t.months[e?"shorthand":"longhand"][i]},_E={D:Uh,F:function(i,e,t){i.setMonth(t.months.longhand.indexOf(e))},G:function(i,e){i.setHours((i.getHours()>=12?12:0)+parseFloat(e))},H:function(i,e){i.setHours(parseFloat(e))},J:function(i,e){i.setDate(parseFloat(e))},K:function(i,e,t){i.setHours(i.getHours()%12+12*ni(new RegExp(t.amPM[1],"i").test(e)))},M:function(i,e,t){i.setMonth(t.months.shorthand.indexOf(e))},S:function(i,e){i.setSeconds(parseFloat(e))},U:function(i,e){return new Date(parseFloat(e)*1e3)},W:function(i,e,t){var n=parseInt(e),r=new Date(i.getFullYear(),0,2+(n-1)*7,0,0,0,0);return r.setDate(r.getDate()-r.getDay()+t.firstDayOfWeek),r},Y:function(i,e){i.setFullYear(parseFloat(e))},Z:function(i,e){return new Date(e)},d:function(i,e){i.setDate(parseFloat(e))},h:function(i,e){i.setHours((i.getHours()>=12?12:0)+parseFloat(e))},i:function(i,e){i.setMinutes(parseFloat(e))},j:function(i,e){i.setDate(parseFloat(e))},l:Uh,m:function(i,e){i.setMonth(parseFloat(e)-1)},n:function(i,e){i.setMonth(parseFloat(e)-1)},s:function(i,e){i.setSeconds(parseFloat(e))},u:function(i,e){return new Date(parseFloat(e))},w:Uh,y:function(i,e){i.setFullYear(2e3+parseFloat(e))}},ps={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Ll={Z:function(i){return i.toISOString()},D:function(i,e,t){return e.weekdays.shorthand[Ll.w(i,e,t)]},F:function(i,e,t){return bu(Ll.n(i,e,t)-1,!1,e)},G:function(i,e,t){return Mn(Ll.h(i,e,t))},H:function(i){return Mn(i.getHours())},J:function(i,e){return e.ordinal!==void 0?i.getDate()+e.ordinal(i.getDate()):i.getDate()},K:function(i,e){return e.amPM[ni(i.getHours()>11)]},M:function(i,e){return bu(i.getMonth(),!0,e)},S:function(i){return Mn(i.getSeconds())},U:function(i){return i.getTime()/1e3},W:function(i,e,t){return t.getWeek(i)},Y:function(i){return Mn(i.getFullYear(),4)},d:function(i){return Mn(i.getDate())},h:function(i){return i.getHours()%12?i.getHours()%12:12},i:function(i){return Mn(i.getMinutes())},j:function(i){return i.getDate()},l:function(i,e){return e.weekdays.longhand[i.getDay()]},m:function(i){return Mn(i.getMonth()+1)},n:function(i){return i.getMonth()+1},s:function(i){return i.getSeconds()},u:function(i){return i.getTime()},w:function(i){return i.getDay()},y:function(i){return String(i.getFullYear()).substring(2)}},zy=function(i){var e=i.config,t=e===void 0?uo:e,n=i.l10n,r=n===void 0?ra:n,s=i.isMobile,o=s===void 0?!1:s;return function(l,a,c){var u=c||r;return t.formatDate!==void 0&&!o?t.formatDate(l,a,u):a.split("").map(function(h,f,d){return Ll[h]&&d[f-1]!=="\\"?Ll[h](l,u,t):h!=="\\"?h:""}).join("")}},yd=function(i){var e=i.config,t=e===void 0?uo:e,n=i.l10n,r=n===void 0?ra:n;return function(s,o,l,a){if(!(s!==0&&!s)){var c=a||r,u,h=s;if(s instanceof Date)u=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)u=new Date(s);else if(typeof s=="string"){var f=o||(t||uo).dateFormat,d=String(s).trim();if(d==="today")u=new Date,l=!0;else if(t&&t.parseDate)u=t.parseDate(s,f);else if(/Z$/.test(d)||/GMT$/.test(d))u=new Date(s);else{for(var m=void 0,p=[],g=0,v=0,w="";gMath.min(e,t)&&i=0?new Date:new Date(t.config.minDate.getTime()),F=qh(t.config);$.setHours(F.hours,F.minutes,F.seconds,$.getMilliseconds()),t.selectedDates=[$],t.latestSelectedDateObj=$}E!==void 0&&E.type!=="blur"&&Ah(E);var j=t._input.value;h(),Oi(),t._input.value!==j&&t._debouncedChange()}function c(E,$){return E%12+12*ni($===t.l10n.amPM[1])}function u(E){switch(E%24){case 0:case 12:return 12;default:return E%12}}function h(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var E=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,$=(parseInt(t.minuteElement.value,10)||0)%60,F=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(E=c(E,t.amPM.textContent));var j=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&Yn(t.latestSelectedDateObj,t.config.minDate,!0)===0,ce=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&Yn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var ge=jh(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),We=jh(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),we=jh(E,$,F);if(we>We&&we=12)]),t.secondElement!==void 0&&(t.secondElement.value=Mn(F)))}function m(E){var $=Zn(E),F=parseInt($.value)+(E.delta||0);(F/1e3>1||E.key==="Enter"&&!/[^\d]/.test(F.toString()))&&Pe(F)}function p(E,$,F,j){if($ instanceof Array)return $.forEach(function(ce){return p(E,ce,F,j)});if(E instanceof Array)return E.forEach(function(ce){return p(ce,$,F,j)});E.addEventListener($,F,j),t._handlers.push({remove:function(){return E.removeEventListener($,F,j)}})}function g(){pt("onChange")}function v(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(F){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+F+"]"),function(j){return p(j,"click",t[F])})}),t.isMobile){Ys();return}var E=y1(He,50);if(t._debouncedChange=y1(g,xE),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&p(t.daysContainer,"mouseover",function(F){t.config.mode==="range"&&Qt(Zn(F))}),p(t._input,"keydown",wt),t.calendarContainer!==void 0&&p(t.calendarContainer,"keydown",wt),!t.config.inline&&!t.config.static&&p(window,"resize",E),window.ontouchstart!==void 0?p(window.document,"touchstart",H):p(window.document,"mousedown",H),p(window.document,"focus",H,{capture:!0}),t.config.clickOpens===!0&&(p(t._input,"focus",t.open),p(t._input,"click",t.open)),t.daysContainer!==void 0&&(p(t.monthNav,"click",os),p(t.monthNav,["keyup","increment"],m),p(t.daysContainer,"click",vr)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var $=function(F){return Zn(F).select()};p(t.timeContainer,["increment"],a),p(t.timeContainer,"blur",a,{capture:!0}),p(t.timeContainer,"click",S),p([t.hourElement,t.minuteElement],["focus","click"],$),t.secondElement!==void 0&&p(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&p(t.amPM,"click",function(F){a(F)})}t.config.allowInput&&p(t._input,"blur",yt)}function w(E,$){var F=E!==void 0?t.parseDate(E):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(E);var ce=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!ce&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var ge=dt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(ge,t.element),ge.appendChild(t.element),t.altInput&&ge.appendChild(t.altInput),ge.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function A(E,$,F,j){var ce=Ye($,!0),ge=dt("span",E,$.getDate().toString());return ge.dateObj=$,ge.$i=j,ge.setAttribute("aria-label",t.formatDate($,t.config.ariaDateFormat)),E.indexOf("hidden")===-1&&Yn($,t.now)===0&&(t.todayDateElem=ge,ge.classList.add("today"),ge.setAttribute("aria-current","date")),ce?(ge.tabIndex=-1,ss($)&&(ge.classList.add("selected"),t.selectedDateElem=ge,t.config.mode==="range"&&(vn(ge,"startRange",t.selectedDates[0]&&Yn($,t.selectedDates[0],!0)===0),vn(ge,"endRange",t.selectedDates[1]&&Yn($,t.selectedDates[1],!0)===0),E==="nextMonthDay"&&ge.classList.add("inRange")))):ge.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Ph($)&&!ss($)&&ge.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&E!=="prevMonthDay"&&j%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek($)+""),pt("onDayCreate",ge),ge}function C(E){E.focus(),t.config.mode==="range"&&Qt(E)}function Q(E){for(var $=E>0?0:t.config.showMonths-1,F=E>0?t.config.showMonths:-1,j=$;j!=F;j+=E)for(var ce=t.daysContainer.children[j],ge=E>0?0:ce.children.length-1,We=E>0?ce.children.length:-1,we=ge;we!=We;we+=E){var Ne=ce.children[we];if(Ne.className.indexOf("hidden")===-1&&Ye(Ne.dateObj))return Ne}}function M(E,$){for(var F=E.className.indexOf("Month")===-1?E.dateObj.getMonth():t.currentMonth,j=$>0?t.config.showMonths:-1,ce=$>0?1:-1,ge=F-t.currentMonth;ge!=j;ge+=ce)for(var We=t.daysContainer.children[ge],we=F-t.currentMonth===ge?E.$i+$:$<0?We.children.length-1:0,Ne=We.children.length,Se=we;Se>=0&&Se0?Ne:-1);Se+=ce){var Me=We.children[Se];if(Me.className.indexOf("hidden")===-1&&Ye(Me.dateObj)&&Math.abs(E.$i-Se)>=Math.abs($))return C(Me)}t.changeMonth(ce),L(Q(ce),0)}function L(E,$){var F=s(),j=Tt(F||document.body),ce=E!==void 0?E:j?F:t.selectedDateElem!==void 0&&Tt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Tt(t.todayDateElem)?t.todayDateElem:Q($>0?1:-1);ce===void 0?t._input.focus():j?M(ce,$):C(ce)}function N(E,$){for(var F=(new Date(E,$,1).getDay()-t.l10n.firstDayOfWeek+7)%7,j=t.utils.getDaysInMonth(($-1+12)%12,E),ce=t.utils.getDaysInMonth($,E),ge=window.document.createDocumentFragment(),We=t.config.showMonths>1,we=We?"prevMonthDay hidden":"prevMonthDay",Ne=We?"nextMonthDay hidden":"nextMonthDay",Se=j+1-F,Me=0;Se<=j;Se++,Me++)ge.appendChild(A("flatpickr-day "+we,new Date(E,$-1,Se),Se,Me));for(Se=1;Se<=ce;Se++,Me++)ge.appendChild(A("flatpickr-day",new Date(E,$,Se),Se,Me));for(var ft=ce+1;ft<=42-F&&(t.config.showMonths===1||Me%7!==0);ft++,Me++)ge.appendChild(A("flatpickr-day "+Ne,new Date(E,$+1,ft%ce),ft,Me));var Nn=dt("div","dayContainer");return Nn.appendChild(ge),Nn}function B(){if(t.daysContainer!==void 0){nc(t.daysContainer),t.weekNumbers&&nc(t.weekNumbers);for(var E=document.createDocumentFragment(),$=0;$1||t.config.monthSelectorType!=="dropdown")){var E=function(j){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&jt.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var $=0;$<12;$++)if(E($)){var F=dt("option","flatpickr-monthDropdown-month");F.value=new Date(t.currentYear,$).getMonth().toString(),F.textContent=bu($,t.config.shorthandCurrentMonth,t.l10n),F.tabIndex=-1,t.currentMonth===$&&(F.selected=!0),t.monthsDropdownContainer.appendChild(F)}}}function te(){var E=dt("div","flatpickr-month"),$=window.document.createDocumentFragment(),F;t.config.showMonths>1||t.config.monthSelectorType==="static"?F=dt("span","cur-month"):(t.monthsDropdownContainer=dt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),p(t.monthsDropdownContainer,"change",function(We){var we=Zn(We),Ne=parseInt(we.value,10);t.changeMonth(Ne-t.currentMonth),pt("onMonthChange")}),J(),F=t.monthsDropdownContainer);var j=ic("cur-year",{tabindex:"-1"}),ce=j.getElementsByTagName("input")[0];ce.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&ce.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(ce.setAttribute("max",t.config.maxDate.getFullYear().toString()),ce.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var ge=dt("div","flatpickr-current-month");return ge.appendChild(F),ge.appendChild(j),$.appendChild(ge),E.appendChild($),{container:E,yearElement:ce,monthElement:F}}function ie(){nc(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var E=t.config.showMonths;E--;){var $=te();t.yearElements.push($.yearElement),t.monthElements.push($.monthElement),t.monthNav.appendChild($.container)}t.monthNav.appendChild(t.nextMonthNav)}function ae(){return t.monthNav=dt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=dt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=dt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,ie(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(E){t.__hidePrevMonthArrow!==E&&(vn(t.prevMonthNav,"flatpickr-disabled",E),t.__hidePrevMonthArrow=E)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(E){t.__hideNextMonthArrow!==E&&(vn(t.nextMonthNav,"flatpickr-disabled",E),t.__hideNextMonthArrow=E)}}),t.currentYearElement=t.yearElements[0],er(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var E=qh(t.config);t.timeContainer=dt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var $=dt("span","flatpickr-time-separator",":"),F=ic("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=F.getElementsByTagName("input")[0];var j=ic("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=j.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=Mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?E.hours:u(E.hours)),t.minuteElement.value=Mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():E.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(F),t.timeContainer.appendChild($),t.timeContainer.appendChild(j),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var ce=ic("flatpickr-second");t.secondElement=ce.getElementsByTagName("input")[0],t.secondElement.value=Mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():E.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(dt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(ce)}return t.config.time_24hr||(t.amPM=dt("span","flatpickr-am-pm",t.l10n.amPM[ni((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function ee(){t.weekdayContainer?nc(t.weekdayContainer):t.weekdayContainer=dt("div","flatpickr-weekdays");for(var E=t.config.showMonths;E--;){var $=dt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild($)}return Te(),t.weekdayContainer}function Te(){if(t.weekdayContainer){var E=t.l10n.firstDayOfWeek,$=k1(t.l10n.weekdays.shorthand);E>0&&E<$.length&&($=k1($.splice(E,$.length),$.splice(0,E)));for(var F=t.config.showMonths;F--;)t.weekdayContainer.children[F].innerHTML=` - `+L.join("")+` + `+$.join("")+` - `}}function ve(){t.calendarContainer.classList.add("hasWeeks");var E=ft("div","flatpickr-weekwrapper");E.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var L=ft("div","flatpickr-weeks");return E.appendChild(L),{weekWrapper:E,weekNumbers:L}}function Ue(E,L){L===void 0&&(L=!0);var F=L?E:E-t.currentMonth;F<0&&t._hidePrevMonthArrow===!0||F>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=F,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,pt("onYearChange"),J()),B(),pt("onMonthChange"),er())}function ne(E,L){if(E===void 0&&(E=!0),L===void 0&&(L=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,L===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var F=qh(t.config),j=F.hours,ae=F.minutes,be=F.seconds;d(j,ae,be)}t.redraw(),E&&pt("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),pt("onClose")}function Re(){t.config!==void 0&&pt("onDestroy");for(var E=t._handlers.length;E--;)t._handlers[E].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var L=t.calendarContainer.parentNode;if(L.lastChild&&L.removeChild(L.lastChild),L.parentNode){for(;L.firstChild;)L.parentNode.insertBefore(L.firstChild,L);L.parentNode.removeChild(L)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(F){try{delete t[F]}catch{}})}function xt(E){return t.calendarContainer.contains(E)}function H(E){if(t.isOpen&&!t.config.inline){var L=Zn(E),F=xt(L),j=L===t.input||L===t.altInput||t.element.contains(L)||E.path&&E.path.indexOf&&(~E.path.indexOf(t.input)||~E.path.indexOf(t.altInput)),ae=!j&&!F&&!xt(E.relatedTarget),be=!t.config.ignoredFocusElements.some(function(We){return We.contains(L)});ae&&be&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function Pe(E){if(!(!E||t.config.minDate&&Et.config.maxDate.getFullYear())){var L=E,F=t.currentYear!==L;t.currentYear=L||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),F&&(t.redraw(),pt("onYearChange"),J())}}function Ye(E,L){var F;L===void 0&&(L=!0);var j=t.parseDate(E,void 0,L);if(t.config.minDate&&j&&Yn(j,t.config.minDate,L!==void 0?L:!t.minDateHasTime)<0||t.config.maxDate&&j&&Yn(j,t.config.maxDate,L!==void 0?L:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(j===void 0)return!1;for(var ae=!!t.config.enable,be=(F=t.config.enable)!==null&&F!==void 0?F:t.config.disable,We=0,we=void 0;We=we.from.getTime()&&j.getTime()<=we.to.getTime())return ae}return!ae}function Tt(E){return t.daysContainer!==void 0?E.className.indexOf("hidden")===-1&&E.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(E):!1}function yt(E){var L=E.target===t._input,F=t._input.value.trimEnd()!==yr();L&&F&&!(E.relatedTarget&&xt(E.relatedTarget))&&t.setDate(t._input.value,!0,E.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function wt(E){var L=Zn(E),F=t.config.wrap?i.contains(L):L===t._input,j=t.config.allowInput,ae=t.isOpen&&(!j||!F),be=t.config.inline&&F&&!j;if(E.keyCode===13&&F){if(j)return t.setDate(t._input.value,!0,L===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),L.blur();t.open()}else if(xt(L)||ae||be){var We=!!t.timeContainer&&t.timeContainer.contains(L);switch(E.keyCode){case 13:We?(E.preventDefault(),a(),ns()):vr(E);break;case 27:E.preventDefault(),ns();break;case 8:case 46:F&&!t.config.allowInput&&(E.preventDefault(),t.clear());break;case 37:case 39:if(!We&&!F){E.preventDefault();var we=s();if(t.daysContainer!==void 0&&(j===!1||we&&Tt(we))){var Ne=E.keyCode===39?1:-1;E.ctrlKey?(E.stopPropagation(),Ue(Ne),$(C(1),0)):$(void 0,Ne)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:E.preventDefault();var _e=E.keyCode===40?1:-1;t.daysContainer&&L.$i!==void 0||L===t.input||L===t.altInput?E.ctrlKey?(E.stopPropagation(),Pe(t.currentYear-_e),$(C(1),0)):We||$(void 0,_e*7):L===t.currentYearElement?Pe(t.currentYear-_e):t.config.enableTime&&(!We&&t.hourElement&&t.hourElement.focus(),a(E),t._debouncedChange());break;case 9:if(We){var Me=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Lt){return Lt}),ht=Me.indexOf(L);if(ht!==-1){var Nn=Me[ht+(E.shiftKey?-1:1)];E.preventDefault(),(Nn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(L)&&E.shiftKey&&(E.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&L===t.amPM)switch(E.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],h(),bi();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],h(),bi();break}(F||xt(L))&&pt("onKeyDown",E)}function Qt(E,L){if(L===void 0&&(L="flatpickr-day"),!(t.selectedDates.length!==1||E&&(!E.classList.contains(L)||E.classList.contains("flatpickr-disabled")))){for(var F=E?E.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),j=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),ae=Math.min(F,t.selectedDates[0].getTime()),be=Math.max(F,t.selectedDates[0].getTime()),We=!1,we=0,Ne=0,_e=ae;_eae&&_ewe)?we=_e:_e>j&&(!Ne||_e ."+L));Me.forEach(function(ht){var Nn=ht.dateObj,Lt=Nn.getTime(),kr=we>0&&Lt0&&Lt>Ne;if(kr){ht.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(tr){ht.classList.remove(tr)});return}else if(We&&!kr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(tr){ht.classList.remove(tr)}),E!==void 0&&(E.classList.add(F<=t.selectedDates[0].getTime()?"startRange":"endRange"),jF&&Lt===j&&ht.classList.add("endRange"),Lt>=we&&(Ne===0||Lt<=Ne)&&QE(Lt,j,F)&&ht.classList.add("inRange"))})}}function Ke(){t.isOpen&&!t.config.static&&!t.config.inline&&ti()}function Ut(E,L){if(L===void 0&&(L=t._positionElement),t.isMobile===!0){if(E){E.preventDefault();var F=Zn(E);F&&F.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),pt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var j=t.isOpen;t.isOpen=!0,j||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),pt("onOpen"),ti(L)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(E===void 0||!t.timeContainer.contains(E.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ct(E){return function(L){var F=t.config["_"+E+"Date"]=t.parseDate(L,t.config.dateFormat),j=t.config["_"+(E==="min"?"max":"min")+"Date"];F!==void 0&&(t[E==="min"?"minDateHasTime":"maxDateHasTime"]=F.getHours()>0||F.getMinutes()>0||F.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(ae){return Ye(ae)}),!t.selectedDates.length&&E==="min"&&f(F),bi()),t.daysContainer&&(jo(),F!==void 0?t.currentYearElement[E]=F.getFullYear().toString():t.currentYearElement.removeAttribute(E),t.currentYearElement.disabled=!!j&&F!==void 0&&j.getFullYear()===F.getFullYear())}}function qe(){var E=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],L=dn(dn({},JSON.parse(JSON.stringify(i.dataset||{}))),e),F={};t.config.parseDate=L.parseDate,t.config.formatDate=L.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Me){t.config._enable=Go(Me)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Me){t.config._disable=Go(Me)}});var j=L.mode==="time";if(!L.dateFormat&&(L.enableTime||j)){var ae=Yt.defaultConfig.dateFormat||co.dateFormat;F.dateFormat=L.noCalendar||j?"H:i"+(L.enableSeconds?":S":""):ae+" H:i"+(L.enableSeconds?":S":"")}if(L.altInput&&(L.enableTime||j)&&!L.altFormat){var be=Yt.defaultConfig.altFormat||co.altFormat;F.altFormat=L.noCalendar||j?"h:i"+(L.enableSeconds?":S K":" K"):be+(" h:i"+(L.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ct("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ct("max")});var We=function(Me){return function(ht){t.config[Me==="min"?"_minTime":"_maxTime"]=t.parseDate(ht,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:We("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:We("max")}),L.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,F,L);for(var we=0;we-1?t.config[_e]=Vh(Ne[_e]).map(o).concat(t.config[_e]):typeof L[_e]>"u"&&(t.config[_e]=Ne[_e])}L.altInputClass||(t.config.altInputClass=Mt().className+" "+t.config.altInputClass),pt("onParseConfig")}function Mt(){return t.config.wrap?i.querySelector("[data-input]"):i}function ei(){typeof t.config.locale!="object"&&typeof Yt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=dn(dn({},Yt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Yt.l10ns[t.config.locale]:void 0),ps.D="("+t.l10n.weekdays.shorthand.join("|")+")",ps.l="("+t.l10n.weekdays.longhand.join("|")+")",ps.M="("+t.l10n.months.shorthand.join("|")+")",ps.F="("+t.l10n.months.longhand.join("|")+")",ps.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var E=dn(dn({},e),JSON.parse(JSON.stringify(i.dataset||{})));E.time_24hr===void 0&&Yt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=nk(t),t.parseDate=yd({config:t.config,l10n:t.l10n})}function ti(E){if(typeof t.config.position=="function")return void t.config.position(t,E);if(t.calendarContainer!==void 0){pt("onPreCalendarPosition");var L=E||t._positionElement,F=Array.prototype.reduce.call(t.calendarContainer.children,function(ze,Wt){return ze+Wt.offsetHeight},0),j=t.calendarContainer.offsetWidth,ae=t.config.position.split(" "),be=ae[0],We=ae.length>1?ae[1]:null,we=L.getBoundingClientRect(),Ne=window.innerHeight-we.bottom,_e=be==="above"||be!=="below"&&NeF,Me=window.pageYOffset+we.top+(_e?-F-2:L.offsetHeight+2);if(vn(t.calendarContainer,"arrowTop",!_e),vn(t.calendarContainer,"arrowBottom",_e),!t.config.inline){var ht=window.pageXOffset+we.left,Nn=!1,Lt=!1;We==="center"?(ht-=(j-we.width)/2,Nn=!0):We==="right"&&(ht-=j-we.width,Lt=!0),vn(t.calendarContainer,"arrowLeft",!Nn&&!Lt),vn(t.calendarContainer,"arrowCenter",Nn),vn(t.calendarContainer,"arrowRight",Lt);var kr=window.document.body.offsetWidth-(window.pageXOffset+we.right),tr=ht+j>window.document.body.offsetWidth,ja=kr+j>window.document.body.offsetWidth;if(vn(t.calendarContainer,"rightMost",tr),!t.config.static)if(t.calendarContainer.style.top=Me+"px",!tr)t.calendarContainer.style.left=ht+"px",t.calendarContainer.style.right="auto";else if(!ja)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=kr+"px";else{var Ys=Ri();if(Ys===void 0)return;var xh=window.document.body.offsetWidth,Z=Math.max(0,xh/2-j/2),Ce=".flatpickr-calendar.centerMost:before",ge=".flatpickr-calendar.centerMost:after",Je=Ys.cssRules.length,ot="{left:"+we.left+"px;right:auto;}";vn(t.calendarContainer,"rightMost",!1),vn(t.calendarContainer,"centerMost",!0),Ys.insertRule(Ce+","+ge+ot,Je),t.calendarContainer.style.left=Z+"px",t.calendarContainer.style.right="auto"}}}}function Ri(){for(var E=null,L=0;Lt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=j,t.config.mode==="single")t.selectedDates=[ae];else if(t.config.mode==="multiple"){var We=ss(ae);We?t.selectedDates.splice(parseInt(We),1):t.selectedDates.push(ae)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=ae,t.selectedDates.push(ae),Yn(ae,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Me,ht){return Me.getTime()-ht.getTime()}));if(h(),be){var we=t.currentYear!==ae.getFullYear();t.currentYear=ae.getFullYear(),t.currentMonth=ae.getMonth(),we&&(pt("onYearChange"),J()),pt("onMonthChange")}if(er(),B(),bi(),!be&&t.config.mode!=="range"&&t.config.showMonths===1?x(j):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Ne=t.config.mode==="single"&&!t.config.enableTime,_e=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ne||_e)&&ns()}g()}}var gi={locale:[ei,Te],showMonths:[ie,l,ee],minDate:[w],maxDate:[w],positionElement:[is],clickOpens:[function(){t.config.clickOpens===!0?(p(t._input,"focus",t.open),p(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function wr(E,L){if(E!==null&&typeof E=="object"){Object.assign(t.config,E);for(var F in E)gi[F]!==void 0&&gi[F].forEach(function(j){return j()})}else t.config[E]=L,gi[E]!==void 0?gi[E].forEach(function(j){return j()}):zh.indexOf(E)>-1&&(t.config[E]=Vh(L));t.redraw(),bi(!0)}function qo(E,L){var F=[];if(E instanceof Array)F=E.map(function(j){return t.parseDate(j,L)});else if(E instanceof Date||typeof E=="number")F=[t.parseDate(E,L)];else if(typeof E=="string")switch(t.config.mode){case"single":case"time":F=[t.parseDate(E,L)];break;case"multiple":F=E.split(t.config.conjunction).map(function(j){return t.parseDate(j,L)});break;case"range":F=E.split(t.l10n.rangeSeparator).map(function(j){return t.parseDate(j,L)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(E)));t.selectedDates=t.config.allowInvalidPreload?F:F.filter(function(j){return j instanceof Date&&Ye(j,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(j,ae){return j.getTime()-ae.getTime()})}function Va(E,L,F){if(L===void 0&&(L=!1),F===void 0&&(F=t.config.dateFormat),E!==0&&!E||E instanceof Array&&E.length===0)return t.clear(L);qo(E,F),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),w(void 0,L),f(),t.selectedDates.length===0&&t.clear(!1),bi(L),L&&pt("onChange")}function Go(E){return E.slice().map(function(L){return typeof L=="string"||typeof L=="number"||L instanceof Date?t.parseDate(L,void 0,!0):L&&typeof L=="object"&&L.from&&L.to?{from:t.parseDate(L.from,void 0),to:t.parseDate(L.to,void 0)}:L}).filter(function(L){return L})}function Ho(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var E=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);E&&qo(E,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Ua(){if(t.input=Mt(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ft(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),is()}function is(){t._positionElement=t.config.positionElement||t._input}function Fs(){var E=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ft("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=E,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=E==="datetime-local"?"Y-m-d\\TH:i:S":E==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}p(t.mobileInput,"change",function(L){t.setDate(Zn(L).value,!1,t.mobileFormatStr),pt("onChange"),pt("onClose")})}function Oi(E){if(t.isOpen===!0)return t.close();t.open(E)}function pt(E,L){if(t.config!==void 0){var F=t.config[E];if(F!==void 0&&F.length>0)for(var j=0;F[j]&&j=0&&Yn(E,t.selectedDates[1])<=0}function er(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(E,L){var F=new Date(t.currentYear,t.currentMonth,1);F.setMonth(t.currentMonth+L),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[L].textContent=bu(F.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=F.getMonth().toString(),E.value=F.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function yr(E){var L=E||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(F){return t.formatDate(F,L)}).filter(function(F,j,ae){return t.config.mode!=="range"||t.config.enableTime||ae.indexOf(F)===j}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function bi(E){E===void 0&&(E=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=yr(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=yr(t.config.altFormat)),E!==!1&&pt("onValueUpdate")}function os(E){var L=Zn(E),F=t.prevMonthNav.contains(L),j=t.nextMonthNav.contains(L);F||j?Ue(F?-1:1):t.yearElements.indexOf(L)>=0?L.select():L.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):L.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Ah(E){E.preventDefault();var L=E.type==="keydown",F=Zn(E),j=F;t.amPM!==void 0&&F===t.amPM&&(t.amPM.textContent=t.l10n.amPM[ni(t.amPM.textContent===t.l10n.amPM[0])]);var ae=parseFloat(j.getAttribute("min")),be=parseFloat(j.getAttribute("max")),We=parseFloat(j.getAttribute("step")),we=parseInt(j.value,10),Ne=E.delta||(L?E.which===38?1:-1:0),_e=we+We*Ne;if(typeof j.value<"u"&&j.value.length===2){var Me=j===t.hourElement,ht=j===t.minuteElement;_ebe&&(_e=j===t.hourElement?_e-be-ni(!t.amPM):ae,ht&&_(void 0,1,t.hourElement)),t.amPM&&Me&&(We===1?_e+we===23:Math.abs(_e-we)>We)&&(t.amPM.textContent=t.l10n.amPM[ni(t.amPM.textContent===t.l10n.amPM[0])]),j.value=Mn(_e)}}return r(),t}function uo(i,e){for(var t=Array.prototype.slice.call(i).filter(function(o){return o instanceof HTMLElement}),n=[],r=0;r{(!r.readonly||l)&&Yt(c,u)});function h(){s=this.value,t(0,s)}function f(d){Se[d?"unshift":"push"](()=>{c=d,t(4,c)})}return i.$$set=d=>{"field"in d&&t(1,r=d.field),"value"in d&&t(0,s=d.value),"id"in d&&t(2,o=d.id),"isCreateMode"in d&&t(3,l=d.isCreateMode),"validationErrors"in d&&t(6,a=d.validationErrors)},i.$$.update=()=>{i.$$.dirty&66&&t(5,n=In(a,r.name))},[s,r,o,l,c,n,a,h,f]}let IE=class extends oe{constructor(e){super(),se(this,e,LE,$E,re,{field:1,value:0,id:2,isCreateMode:3,validationErrors:6})}};function NE(i){let e,t,n,r,s;return t=new Ot({props:{icon:"dice"}}),{c(){e=y("button"),V(t.$$.fragment),O(e,"class","btn btn-primary ms-2"),O(e,"title","Generate a new UUIDv4")},m(o,l){A(o,e,l),Y(t,e,null),n=!0,r||(s=G(e,"click",i[4]),r=!0)},p:U,i(o){n||(T(t.$$.fragment,o),n=!0)},o(o){R(t.$$.fragment,o),n=!1},d(o){o&&P(e),z(t),r=!1,s()}}}function P1(i){let e,t;return{c(){e=y("div"),t=W(i[2]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&4&&K(t,n[2])},d(n){n&&P(e)}}}function ZE(i){let e,t,n,r,s,o,l,a,c=!i[3]&&NE(i),u=i[2]&&P1(i);return{c(){e=y("div"),t=y("div"),n=y("input"),r=D(),c&&c.c(),s=D(),u&&u.c(),O(n,"type","text"),O(n,"id",i[1]),O(n,"class","form-control"),O(n,"autocomplete","off"),n.readOnly=i[3],Ae(n,"is-invalid",i[2]),O(t,"class","d-flex justify-content-between"),O(e,"class","mb-0")},m(h,f){A(h,e,f),v(e,t),v(t,n),Ie(n,i[0]),v(t,r),c&&c.m(t,null),v(e,s),u&&u.m(e,null),o=!0,l||(a=G(n,"input",i[8]),l=!0)},p(h,[f]){(!o||f&2)&&O(n,"id",h[1]),f&1&&n.value!==h[0]&&Ie(n,h[0]),(!o||f&4)&&Ae(n,"is-invalid",h[2]),h[3]||c.p(h,f),h[2]?u?u.p(h,f):(u=P1(h),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(h){o||(T(c),o=!0)},o(h){R(c),o=!1},d(h){h&&P(e),c&&c.d(),u&&u.d(),l=!1,a()}}}function BE(i,e,t){let n;je("channelurl");let{validationErrors:r}=e,{field:s}=e,{value:o}=e,{id:l}=e,{isCreateMode:a}=e,c=s.readonly&&!a;function u(f){f.preventDefault(),t(0,o=self.crypto.randomUUID())}function h(){o=this.value,t(0,o)}return i.$$set=f=>{"validationErrors"in f&&t(5,r=f.validationErrors),"field"in f&&t(6,s=f.field),"value"in f&&t(0,o=f.value),"id"in f&&t(1,l=f.id),"isCreateMode"in f&&t(7,a=f.isCreateMode)},i.$$.update=()=>{i.$$.dirty&96&&t(2,n=In(r,s.name))},[o,l,n,c,u,r,s,a,h]}class WE extends oe{constructor(e){super(),se(this,e,BE,ZE,re,{validationErrors:5,field:6,value:0,id:1,isCreateMode:7})}}function A1(i,e,t){const n=i.slice();return n[9]=e[t],n}function x1(i){let e,t,n;return t=new Gi({props:{$$slots:{button:[FE],default:[XE]},$$scope:{ctx:i}}}),{c(){e=y("div"),V(t.$$.fragment),O(e,"class","reference-action")},m(r,s){A(r,e,s),Y(t,e,null),n=!0},p(r,s){const o={};s&4096&&(o.$$scope={dirty:s,ctx:r}),t.$set(o)},i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){R(t.$$.fragment,r),n=!1},d(r){r&&P(e),z(t)}}}function T1(i){let e,t,n;function r(...s){return i[6](i[9],...s)}return{c(){e=y("button"),e.textContent=`${i[9]}`,O(e,"class","dropdown-item button")},m(s,o){A(s,e,o),t||(n=G(e,"click",r),t=!0)},p(s,o){i=s},d(s){s&&P(e),t=!1,n()}}}function XE(i){let e,t,n,r,s,o=ue(i[3]),l=[];for(let a=0;a{m=null}),pe()),g[1]?p?(p.p(g,b),b&2&&T(p,1)):(p=Q1(g),p.c(),T(p,1),p.m(h,null)):p&&(me(),R(p,1,1,()=>{p=null}),pe())},i(g){d||(T(r.$$.fragment,g),T(m),T(p),d=!0)},o(g){R(r.$$.fragment,g),R(m),R(p),d=!1},d(g){g&&P(e),z(r),m&&m.d(),p&&p.d()}}}function M1(i,e){i.preventDefault()}function zE(i,e,t){const n=nn(),r=je("channel");let{file:s}=e,{hasDelete:o=!1}=e,{hasInsert:l=!1}=e,a=Object.keys(r.imageFilters);function c(f){f.preventDefault(),n("remove_file",s.id)}const u=f=>M1(f),h=(f,d)=>M1(d);return i.$$set=f=>{"file"in f&&t(0,s=f.file),"hasDelete"in f&&t(1,o=f.hasDelete),"hasInsert"in f&&t(2,l=f.hasInsert)},[s,o,l,a,c,u,h]}class qm extends oe{constructor(e){super(),se(this,e,zE,YE,re,{file:0,hasDelete:1,hasInsert:2})}}function E1(i,e,t){const n=i.slice();return n[10]=e[t],n}function R1(i){let e,t,n;return t=new rh({props:{value:"",indeterminate:i[0].length>0&&i[0].length0&&r[0].length0?"medium":"small"}});let M=e[10].width>0&&$1(e);return{key:i,first:null,c(){t=y("tr"),n=y("td"),r=y("div"),C&&C.c(),s=D(),o=y("div"),V(l.$$.fragment),a=D(),c=y("div"),h=W(u),f=D(),d=y("span"),p=W(m),g=W("kB"),b=D(),M&&M.c(),w=D(),S=y("a"),_=W("Download"),Q=D(),O(S,"href",k=ia(e[3],e[10])),O(S,"target","_blank"),O(o,"class","file-table-row"),O(r,"class","title-td-contents"),O(n,"class","title-td"),this.first=t},m($,N){A($,t,N),v(t,n),v(n,r),C&&C.m(r,null),v(r,s),v(r,o),Y(l,o,null),v(o,a),v(o,c),v(c,h),v(c,f),v(c,d),v(d,p),v(d,g),v(c,b),M&&M.m(c,null),v(c,w),v(c,S),v(S,_),v(t,Q),x=!0},p($,N){e=$,e[2]?C?(C.p(e,N),N&4&&T(C,1)):(C=D1(e),C.c(),T(C,1),C.m(r,s)):C&&(me(),R(C,1,1,()=>{C=null}),pe());const B={};N&2&&(B.file=e[10]),N&2&&(B.size=e[10].width>0?"medium":"small"),l.$set(B),(!x||N&2)&&u!==(u=e[10].filename+"")&&K(h,u),(!x||N&2)&&m!==(m=(e[10].size/1024).toFixed(1)+"")&&K(p,m),e[10].width>0?M?M.p(e,N):(M=$1(e),M.c(),M.m(c,w)):M&&(M.d(1),M=null),(!x||N&2&&k!==(k=ia(e[3],e[10])))&&O(S,"href",k)},i($){x||(T(C),T(l.$$.fragment,$),x=!0)},o($){R(C),R(l.$$.fragment,$),x=!1},d($){$&&P(t),C&&C.d(),z(l),M&&M.d()}}}function VE(i){let e,t,n,r,s,o,l,a,c=[],u=new Map,h,f=i[2]&&R1(i),d=ue(i[1]);const m=p=>p[10].id;for(let p=0;p{f=null}),pe()),g&47&&(d=ue(p[1]),me(),c=di(c,g,m,1,p,d,u,a,mr,L1,null,E1),pe())},i(p){if(!h){T(f);for(let g=0;gp.length===m.length?[]:(d.currentTarget.checked=p.length>0,m),u=(d,m)=>m.find(g=>g.id===d.id)?m.filter(g=>g.id!==d.id):[...m,d],h=(d,m)=>m.id===d.id,f=d=>a(d);return i.$$set=d=>{"files"in d&&t(1,r=d.files),"selected"in d&&t(0,s=d.selected),"isWritable"in d&&t(2,o=d.isWritable)},[s,r,o,n,l,a,c,u,h,f]}class jE extends oe{constructor(e){super(),se(this,e,UE,VE,re,{files:1,selected:0,isWritable:2,toggleAll:6,selectFile:7})}get toggleAll(){return this.$$.ctx[6]}get selectFile(){return this.$$.ctx[7]}}function I1(i){let e,t=i[2].length+"",n,r;return{c(){e=y("span"),n=W(t),r=W(" records selected"),O(e,"class","")},m(s,o){A(s,e,o),v(e,n),v(e,r)},p(s,o){o&4&&t!==(t=s[2].length+"")&&K(n,t)},d(s){s&&P(e)}}}function qE(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k=i[2].length>0&&I1(i);d=new Ot({props:{icon:"close"}});function Q(C){i[7](C)}let x={files:i[3]};return i[2]!==void 0&&(x.selected=i[2]),g=new jE({props:x}),Se.push(()=>He(g,"selected",Q)),{c(){e=y("dialog"),t=y("div"),n=y("button"),r=W("Insert"),o=D(),l=y("button"),a=W("Replace"),u=D(),k&&k.c(),h=D(),f=y("button"),V(d.$$.fragment),m=D(),p=y("div"),V(g.$$.fragment),O(n,"type","button"),O(n,"class","button"),n.disabled=s=i[2].length===0,O(l,"type","button"),O(l,"class","button"),l.disabled=c=i[2].length===0,O(f,"type","button"),O(f,"class","button close"),O(f,"aria-label","Close"),O(t,"class","dialog-header"),O(p,"class","dialog-body")},m(C,M){A(C,e,M),v(e,t),v(t,n),v(n,r),v(t,o),v(t,l),v(l,a),v(t,u),k&&k.m(t,null),v(t,h),v(t,f),Y(d,f,null),v(e,m),v(e,p),Y(g,p,null),i[8](e),w=!0,S||(_=[G(n,"click",i[4]),G(l,"click",i[5]),G(f,"click",Ln(i[0]))],S=!0)},p(C,[M]){(!w||M&4&&s!==(s=C[2].length===0))&&(n.disabled=s),(!w||M&4&&c!==(c=C[2].length===0))&&(l.disabled=c),C[2].length>0?k?k.p(C,M):(k=I1(C),k.c(),k.m(t,h)):k&&(k.d(1),k=null);const $={};M&8&&($.files=C[3]),!b&&M&4&&(b=!0,$.selected=C[2],nt(()=>b=!1)),g.$set($)},i(C){w||(T(d.$$.fragment,C),T(g.$$.fragment,C),w=!0)},o(C){R(d.$$.fragment,C),R(g.$$.fragment,C),w=!1},d(C){C&&P(e),k&&k.d(),z(d),z(g),i[8](null),S=!1,ut(_)}}}function GE(i,e,t){let n,r,s;const o=nn(),l=je("channel");function a(p){p&&p.preventDefault(),s.close(),t(2,r=[])}function c(p){fetch(l.lucentUrl+"/records/files/?recordId="+p).then(g=>g.json()).then(g=>{t(3,n=g)}).catch(g=>console.log(g))}function u(p){p.preventDefault(),o("insert_files",r)}function h(p){p.preventDefault(),o("replace_files",r)}function f(p){s.showModal(),c(p)}function d(p){r=p,t(2,r)}function m(p){Se[p?"unshift":"push"](()=>{s=p,t(1,s)})}return t(3,n=[]),t(2,r=[]),[a,s,r,n,u,h,f,d,m]}class HE extends oe{constructor(e){super(),se(this,e,GE,qE,re,{close:0,open:6})}get close(){return this.$$.ctx[0]}get open(){return this.$$.ctx[6]}}function KE(i){let e,t,n,r,s,o,l;return{c(){e=y("fieldset"),t=y("label"),n=y("span"),r=W(` + `}}function ve(){t.calendarContainer.classList.add("hasWeeks");var E=dt("div","flatpickr-weekwrapper");E.appendChild(dt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var $=dt("div","flatpickr-weeks");return E.appendChild($),{weekWrapper:E,weekNumbers:$}}function je(E,$){$===void 0&&($=!0);var F=$?E:E-t.currentMonth;F<0&&t._hidePrevMonthArrow===!0||F>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=F,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,pt("onYearChange"),J()),B(),pt("onMonthChange"),er())}function ne(E,$){if(E===void 0&&(E=!0),$===void 0&&($=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,$===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var F=qh(t.config),j=F.hours,ce=F.minutes,ge=F.seconds;d(j,ce,ge)}t.redraw(),E&&pt("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),pt("onClose")}function Re(){t.config!==void 0&&pt("onDestroy");for(var E=t._handlers.length;E--;)t._handlers[E].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var $=t.calendarContainer.parentNode;if($.lastChild&&$.removeChild($.lastChild),$.parentNode){for(;$.firstChild;)$.parentNode.insertBefore($.firstChild,$);$.parentNode.removeChild($)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(F){try{delete t[F]}catch{}})}function xt(E){return t.calendarContainer.contains(E)}function H(E){if(t.isOpen&&!t.config.inline){var $=Zn(E),F=xt($),j=$===t.input||$===t.altInput||t.element.contains($)||E.path&&E.path.indexOf&&(~E.path.indexOf(t.input)||~E.path.indexOf(t.altInput)),ce=!j&&!F&&!xt(E.relatedTarget),ge=!t.config.ignoredFocusElements.some(function(We){return We.contains($)});ce&&ge&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function Pe(E){if(!(!E||t.config.minDate&&Et.config.maxDate.getFullYear())){var $=E,F=t.currentYear!==$;t.currentYear=$||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),F&&(t.redraw(),pt("onYearChange"),J())}}function Ye(E,$){var F;$===void 0&&($=!0);var j=t.parseDate(E,void 0,$);if(t.config.minDate&&j&&Yn(j,t.config.minDate,$!==void 0?$:!t.minDateHasTime)<0||t.config.maxDate&&j&&Yn(j,t.config.maxDate,$!==void 0?$:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(j===void 0)return!1;for(var ce=!!t.config.enable,ge=(F=t.config.enable)!==null&&F!==void 0?F:t.config.disable,We=0,we=void 0;We=we.from.getTime()&&j.getTime()<=we.to.getTime())return ce}return!ce}function Tt(E){return t.daysContainer!==void 0?E.className.indexOf("hidden")===-1&&E.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(E):!1}function yt(E){var $=E.target===t._input,F=t._input.value.trimEnd()!==yr();$&&F&&!(E.relatedTarget&&xt(E.relatedTarget))&&t.setDate(t._input.value,!0,E.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function wt(E){var $=Zn(E),F=t.config.wrap?i.contains($):$===t._input,j=t.config.allowInput,ce=t.isOpen&&(!j||!F),ge=t.config.inline&&F&&!j;if(E.keyCode===13&&F){if(j)return t.setDate(t._input.value,!0,$===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),$.blur();t.open()}else if(xt($)||ce||ge){var We=!!t.timeContainer&&t.timeContainer.contains($);switch(E.keyCode){case 13:We?(E.preventDefault(),a(),ns()):vr(E);break;case 27:E.preventDefault(),ns();break;case 8:case 46:F&&!t.config.allowInput&&(E.preventDefault(),t.clear());break;case 37:case 39:if(!We&&!F){E.preventDefault();var we=s();if(t.daysContainer!==void 0&&(j===!1||we&&Tt(we))){var Ne=E.keyCode===39?1:-1;E.ctrlKey?(E.stopPropagation(),je(Ne),L(Q(1),0)):L(void 0,Ne)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:E.preventDefault();var Se=E.keyCode===40?1:-1;t.daysContainer&&$.$i!==void 0||$===t.input||$===t.altInput?E.ctrlKey?(E.stopPropagation(),Pe(t.currentYear-Se),L(Q(1),0)):We||L(void 0,Se*7):$===t.currentYearElement?Pe(t.currentYear-Se):t.config.enableTime&&(!We&&t.hourElement&&t.hourElement.focus(),a(E),t._debouncedChange());break;case 9:if(We){var Me=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Lt){return Lt}),ft=Me.indexOf($);if(ft!==-1){var Nn=Me[ft+(E.shiftKey?-1:1)];E.preventDefault(),(Nn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains($)&&E.shiftKey&&(E.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&$===t.amPM)switch(E.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],h(),Oi();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],h(),Oi();break}(F||xt($))&&pt("onKeyDown",E)}function Qt(E,$){if($===void 0&&($="flatpickr-day"),!(t.selectedDates.length!==1||E&&(!E.classList.contains($)||E.classList.contains("flatpickr-disabled")))){for(var F=E?E.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),j=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),ce=Math.min(F,t.selectedDates[0].getTime()),ge=Math.max(F,t.selectedDates[0].getTime()),We=!1,we=0,Ne=0,Se=ce;Sece&&Sewe)?we=Se:Se>j&&(!Ne||Se ."+$));Me.forEach(function(ft){var Nn=ft.dateObj,Lt=Nn.getTime(),kr=we>0&&Lt0&&Lt>Ne;if(kr){ft.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(tr){ft.classList.remove(tr)});return}else if(We&&!kr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(tr){ft.classList.remove(tr)}),E!==void 0&&(E.classList.add(F<=t.selectedDates[0].getTime()?"startRange":"endRange"),jF&&Lt===j&&ft.classList.add("endRange"),Lt>=we&&(Ne===0||Lt<=Ne)&&CE(Lt,j,F)&&ft.classList.add("inRange"))})}}function He(){t.isOpen&&!t.config.static&&!t.config.inline&&ti()}function Ut(E,$){if($===void 0&&($=t._positionElement),t.isMobile===!0){if(E){E.preventDefault();var F=Zn(E);F&&F.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),pt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var j=t.isOpen;t.isOpen=!0,j||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),pt("onOpen"),ti($)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(E===void 0||!t.timeContainer.contains(E.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ct(E){return function($){var F=t.config["_"+E+"Date"]=t.parseDate($,t.config.dateFormat),j=t.config["_"+(E==="min"?"max":"min")+"Date"];F!==void 0&&(t[E==="min"?"minDateHasTime":"maxDateHasTime"]=F.getHours()>0||F.getMinutes()>0||F.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(ce){return Ye(ce)}),!t.selectedDates.length&&E==="min"&&f(F),Oi()),t.daysContainer&&(qo(),F!==void 0?t.currentYearElement[E]=F.getFullYear().toString():t.currentYearElement.removeAttribute(E),t.currentYearElement.disabled=!!j&&F!==void 0&&j.getFullYear()===F.getFullYear())}}function qe(){var E=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],$=dn(dn({},JSON.parse(JSON.stringify(i.dataset||{}))),e),F={};t.config.parseDate=$.parseDate,t.config.formatDate=$.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Me){t.config._enable=Ho(Me)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Me){t.config._disable=Ho(Me)}});var j=$.mode==="time";if(!$.dateFormat&&($.enableTime||j)){var ce=Yt.defaultConfig.dateFormat||uo.dateFormat;F.dateFormat=$.noCalendar||j?"H:i"+($.enableSeconds?":S":""):ce+" H:i"+($.enableSeconds?":S":"")}if($.altInput&&($.enableTime||j)&&!$.altFormat){var ge=Yt.defaultConfig.altFormat||uo.altFormat;F.altFormat=$.noCalendar||j?"h:i"+($.enableSeconds?":S K":" K"):ge+(" h:i"+($.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ct("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ct("max")});var We=function(Me){return function(ft){t.config[Me==="min"?"_minTime":"_maxTime"]=t.parseDate(ft,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:We("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:We("max")}),$.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,F,$);for(var we=0;we-1?t.config[Se]=Vh(Ne[Se]).map(o).concat(t.config[Se]):typeof $[Se]>"u"&&(t.config[Se]=Ne[Se])}$.altInputClass||(t.config.altInputClass=Mt().className+" "+t.config.altInputClass),pt("onParseConfig")}function Mt(){return t.config.wrap?i.querySelector("[data-input]"):i}function ei(){typeof t.config.locale!="object"&&typeof Yt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=dn(dn({},Yt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Yt.l10ns[t.config.locale]:void 0),ps.D="("+t.l10n.weekdays.shorthand.join("|")+")",ps.l="("+t.l10n.weekdays.longhand.join("|")+")",ps.M="("+t.l10n.months.shorthand.join("|")+")",ps.F="("+t.l10n.months.longhand.join("|")+")",ps.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var E=dn(dn({},e),JSON.parse(JSON.stringify(i.dataset||{})));E.time_24hr===void 0&&Yt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=zy(t),t.parseDate=yd({config:t.config,l10n:t.l10n})}function ti(E){if(typeof t.config.position=="function")return void t.config.position(t,E);if(t.calendarContainer!==void 0){pt("onPreCalendarPosition");var $=E||t._positionElement,F=Array.prototype.reduce.call(t.calendarContainer.children,function(ze,Wt){return ze+Wt.offsetHeight},0),j=t.calendarContainer.offsetWidth,ce=t.config.position.split(" "),ge=ce[0],We=ce.length>1?ce[1]:null,we=$.getBoundingClientRect(),Ne=window.innerHeight-we.bottom,Se=ge==="above"||ge!=="below"&&NeF,Me=window.pageYOffset+we.top+(Se?-F-2:$.offsetHeight+2);if(vn(t.calendarContainer,"arrowTop",!Se),vn(t.calendarContainer,"arrowBottom",Se),!t.config.inline){var ft=window.pageXOffset+we.left,Nn=!1,Lt=!1;We==="center"?(ft-=(j-we.width)/2,Nn=!0):We==="right"&&(ft-=j-we.width,Lt=!0),vn(t.calendarContainer,"arrowLeft",!Nn&&!Lt),vn(t.calendarContainer,"arrowCenter",Nn),vn(t.calendarContainer,"arrowRight",Lt);var kr=window.document.body.offsetWidth-(window.pageXOffset+we.right),tr=ft+j>window.document.body.offsetWidth,ja=kr+j>window.document.body.offsetWidth;if(vn(t.calendarContainer,"rightMost",tr),!t.config.static)if(t.calendarContainer.style.top=Me+"px",!tr)t.calendarContainer.style.left=ft+"px",t.calendarContainer.style.right="auto";else if(!ja)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=kr+"px";else{var zs=Ri();if(zs===void 0)return;var xh=window.document.body.offsetWidth,Z=Math.max(0,xh/2-j/2),_e=".flatpickr-calendar.centerMost:before",me=".flatpickr-calendar.centerMost:after",Ke=zs.cssRules.length,ot="{left:"+we.left+"px;right:auto;}";vn(t.calendarContainer,"rightMost",!1),vn(t.calendarContainer,"centerMost",!0),zs.insertRule(_e+","+me+ot,Ke),t.calendarContainer.style.left=Z+"px",t.calendarContainer.style.right="auto"}}}}function Ri(){for(var E=null,$=0;$t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=j,t.config.mode==="single")t.selectedDates=[ce];else if(t.config.mode==="multiple"){var We=ss(ce);We?t.selectedDates.splice(parseInt(We),1):t.selectedDates.push(ce)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=ce,t.selectedDates.push(ce),Yn(ce,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Me,ft){return Me.getTime()-ft.getTime()}));if(h(),ge){var we=t.currentYear!==ce.getFullYear();t.currentYear=ce.getFullYear(),t.currentMonth=ce.getMonth(),we&&(pt("onYearChange"),J()),pt("onMonthChange")}if(er(),B(),Oi(),!ge&&t.config.mode!=="range"&&t.config.showMonths===1?C(j):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Ne=t.config.mode==="single"&&!t.config.enableTime,Se=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Ne||Se)&&ns()}g()}}var pi={locale:[ei,Te],showMonths:[ie,l,ee],minDate:[w],maxDate:[w],positionElement:[is],clickOpens:[function(){t.config.clickOpens===!0?(p(t._input,"focus",t.open),p(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function wr(E,$){if(E!==null&&typeof E=="object"){Object.assign(t.config,E);for(var F in E)pi[F]!==void 0&&pi[F].forEach(function(j){return j()})}else t.config[E]=$,pi[E]!==void 0?pi[E].forEach(function(j){return j()}):zh.indexOf(E)>-1&&(t.config[E]=Vh($));t.redraw(),Oi(!0)}function Go(E,$){var F=[];if(E instanceof Array)F=E.map(function(j){return t.parseDate(j,$)});else if(E instanceof Date||typeof E=="number")F=[t.parseDate(E,$)];else if(typeof E=="string")switch(t.config.mode){case"single":case"time":F=[t.parseDate(E,$)];break;case"multiple":F=E.split(t.config.conjunction).map(function(j){return t.parseDate(j,$)});break;case"range":F=E.split(t.l10n.rangeSeparator).map(function(j){return t.parseDate(j,$)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(E)));t.selectedDates=t.config.allowInvalidPreload?F:F.filter(function(j){return j instanceof Date&&Ye(j,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(j,ce){return j.getTime()-ce.getTime()})}function Va(E,$,F){if($===void 0&&($=!1),F===void 0&&(F=t.config.dateFormat),E!==0&&!E||E instanceof Array&&E.length===0)return t.clear($);Go(E,F),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),w(void 0,$),f(),t.selectedDates.length===0&&t.clear(!1),Oi($),$&&pt("onChange")}function Ho(E){return E.slice().map(function($){return typeof $=="string"||typeof $=="number"||$ instanceof Date?t.parseDate($,void 0,!0):$&&typeof $=="object"&&$.from&&$.to?{from:t.parseDate($.from,void 0),to:t.parseDate($.to,void 0)}:$}).filter(function($){return $})}function Ko(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var E=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);E&&Go(E,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Ua(){if(t.input=Mt(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=dt(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),is()}function is(){t._positionElement=t.config.positionElement||t._input}function Ys(){var E=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=dt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=E,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=E==="datetime-local"?"Y-m-d\\TH:i:S":E==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}p(t.mobileInput,"change",function($){t.setDate(Zn($).value,!1,t.mobileFormatStr),pt("onChange"),pt("onClose")})}function gi(E){if(t.isOpen===!0)return t.close();t.open(E)}function pt(E,$){if(t.config!==void 0){var F=t.config[E];if(F!==void 0&&F.length>0)for(var j=0;F[j]&&j=0&&Yn(E,t.selectedDates[1])<=0}function er(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(E,$){var F=new Date(t.currentYear,t.currentMonth,1);F.setMonth(t.currentMonth+$),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[$].textContent=bu(F.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=F.getMonth().toString(),E.value=F.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function yr(E){var $=E||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(F){return t.formatDate(F,$)}).filter(function(F,j,ce){return t.config.mode!=="range"||t.config.enableTime||ce.indexOf(F)===j}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Oi(E){E===void 0&&(E=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=yr(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=yr(t.config.altFormat)),E!==!1&&pt("onValueUpdate")}function os(E){var $=Zn(E),F=t.prevMonthNav.contains($),j=t.nextMonthNav.contains($);F||j?je(F?-1:1):t.yearElements.indexOf($)>=0?$.select():$.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):$.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Ah(E){E.preventDefault();var $=E.type==="keydown",F=Zn(E),j=F;t.amPM!==void 0&&F===t.amPM&&(t.amPM.textContent=t.l10n.amPM[ni(t.amPM.textContent===t.l10n.amPM[0])]);var ce=parseFloat(j.getAttribute("min")),ge=parseFloat(j.getAttribute("max")),We=parseFloat(j.getAttribute("step")),we=parseInt(j.value,10),Ne=E.delta||($?E.which===38?1:-1:0),Se=we+We*Ne;if(typeof j.value<"u"&&j.value.length===2){var Me=j===t.hourElement,ft=j===t.minuteElement;Sege&&(Se=j===t.hourElement?Se-ge-ni(!t.amPM):ce,ft&&_(void 0,1,t.hourElement)),t.amPM&&Me&&(We===1?Se+we===23:Math.abs(Se-we)>We)&&(t.amPM.textContent=t.l10n.amPM[ni(t.amPM.textContent===t.l10n.amPM[0])]),j.value=Mn(Se)}}return r(),t}function ho(i,e){for(var t=Array.prototype.slice.call(i).filter(function(o){return o instanceof HTMLElement}),n=[],r=0;r{(!r.readonly||l)&&Yt(c,u)});function h(){s=this.value,t(0,s)}function f(d){Ce[d?"unshift":"push"](()=>{c=d,t(4,c)})}return i.$$set=d=>{"field"in d&&t(1,r=d.field),"value"in d&&t(0,s=d.value),"id"in d&&t(2,o=d.id),"isCreateMode"in d&&t(3,l=d.isCreateMode),"validationErrors"in d&&t(6,a=d.validationErrors)},i.$$.update=()=>{i.$$.dirty&66&&t(5,n=In(a,r.name))},[s,r,o,l,c,n,a,h,f]}let EE=class extends oe{constructor(e){super(),se(this,e,ME,QE,re,{field:1,value:0,id:2,isCreateMode:3,validationErrors:6})}};function RE(i){let e,t,n,r,s;return t=new ut({props:{icon:"dice"}}),{c(){e=y("button"),V(t.$$.fragment),O(e,"class","btn btn-primary ms-2"),O(e,"title","Generate a new UUIDv4")},m(o,l){x(o,e,l),Y(t,e,null),n=!0,r||(s=G(e,"click",i[4]),r=!0)},p:U,i(o){n||(T(t.$$.fragment,o),n=!0)},o(o){R(t.$$.fragment,o),n=!1},d(o){o&&P(e),z(t),r=!1,s()}}}function _1(i){let e,t;return{c(){e=y("div"),t=W(i[2]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&4&&K(t,n[2])},d(n){n&&P(e)}}}function DE(i){let e,t,n,r,s,o,l,a,c=!i[3]&&RE(i),u=i[2]&&_1(i);return{c(){e=y("div"),t=y("div"),n=y("input"),r=D(),c&&c.c(),s=D(),u&&u.c(),O(n,"type","text"),O(n,"id",i[1]),O(n,"class","form-control"),O(n,"autocomplete","off"),n.readOnly=i[3],Ae(n,"is-invalid",i[2]),O(t,"class","d-flex justify-content-between"),O(e,"class","mb-0")},m(h,f){x(h,e,f),b(e,t),b(t,n),Le(n,i[0]),b(t,r),c&&c.m(t,null),b(e,s),u&&u.m(e,null),o=!0,l||(a=G(n,"input",i[8]),l=!0)},p(h,[f]){(!o||f&2)&&O(n,"id",h[1]),f&1&&n.value!==h[0]&&Le(n,h[0]),(!o||f&4)&&Ae(n,"is-invalid",h[2]),h[3]||c.p(h,f),h[2]?u?u.p(h,f):(u=_1(h),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(h){o||(T(c),o=!0)},o(h){R(c),o=!1},d(h){h&&P(e),c&&c.d(),u&&u.d(),l=!1,a()}}}function $E(i,e,t){let n;Ue("channelurl");let{validationErrors:r}=e,{field:s}=e,{value:o}=e,{id:l}=e,{isCreateMode:a}=e,c=s.readonly&&!a;function u(f){f.preventDefault(),t(0,o=self.crypto.randomUUID())}function h(){o=this.value,t(0,o)}return i.$$set=f=>{"validationErrors"in f&&t(5,r=f.validationErrors),"field"in f&&t(6,s=f.field),"value"in f&&t(0,o=f.value),"id"in f&&t(1,l=f.id),"isCreateMode"in f&&t(7,a=f.isCreateMode)},i.$$.update=()=>{i.$$.dirty&96&&t(2,n=In(r,s.name))},[o,l,n,c,u,r,s,a,h]}class LE extends oe{constructor(e){super(),se(this,e,$E,DE,re,{validationErrors:5,field:6,value:0,id:1,isCreateMode:7})}}function C1(i){let e,t,n,r,s,o;return n=new ut({props:{icon:"trash-can"}}),{c(){e=y("div"),t=y("button"),V(n.$$.fragment),O(t,"class","button"),O(e,"class","reference-action")},m(l,a){x(l,e,a),b(e,t),Y(n,t,null),r=!0,s||(o=G(t,"click",i[2]),s=!0)},p:U,i(l){r||(T(n.$$.fragment,l),r=!0)},o(l){R(n.$$.fragment,l),r=!1},d(l){l&&P(e),z(n),s=!1,o()}}}function IE(i){let e,t,n,r,s,o,l,a=i[0].filename+"",c,u,h,f;r=new Xo({props:{file:i[0],size:"small"}});let d=i[1]&&C1(i);return{c(){e=y("div"),t=y("div"),n=y("div"),V(r.$$.fragment),s=D(),o=y("div"),l=y("div"),c=W(a),u=D(),h=y("div"),d&&d.c(),O(n,"class","image"),O(o,"class","title"),le(t,"display","flex"),le(t,"align-items","center"),le(t,"gap","10px"),le(h,"display","flex"),le(h,"gap","4px"),le(h,"align-items","center"),le(h,"margin-right","10px"),O(e,"class","preview-file")},m(m,p){x(m,e,p),b(e,t),b(t,n),Y(r,n,null),b(t,s),b(t,o),b(o,l),b(l,c),b(e,u),b(e,h),d&&d.m(h,null),f=!0},p(m,[p]){const g={};p&1&&(g.file=m[0]),r.$set(g),(!f||p&1)&&a!==(a=m[0].filename+"")&&K(c,a),m[1]?d?(d.p(m,p),p&2&&T(d,1)):(d=C1(m),d.c(),T(d,1),d.m(h,null)):d&&(Oe(),R(d,1,1,()=>{d=null}),be())},i(m){f||(T(r.$$.fragment,m),T(d),f=!0)},o(m){R(r.$$.fragment,m),R(d),f=!1},d(m){m&&P(e),z(r),d&&d.d()}}}function NE(i,e,t){const n=nn();let{file:r}=e,{hasDelete:s=!1}=e;function o(l){l.preventDefault(),n("remove_file",r.id)}return i.$$set=l=>{"file"in l&&t(0,r=l.file),"hasDelete"in l&&t(1,s=l.hasDelete)},[r,s,o]}class Vy extends oe{constructor(e){super(),se(this,e,NE,IE,re,{file:0,hasDelete:1})}}function P1(i,e,t){const n=i.slice();return n[10]=e[t],n}function A1(i){let e,t,n;return t=new rh({props:{value:"",indeterminate:i[0].length>0&&i[0].length0&&r[0].length0?"medium":"small"}});let M=e[10].width>0&&T1(e);return{key:i,first:null,c(){t=y("tr"),n=y("td"),r=y("div"),Q&&Q.c(),s=D(),o=y("div"),V(l.$$.fragment),a=D(),c=y("div"),h=W(u),f=D(),d=y("span"),p=W(m),g=W("kB"),v=D(),M&&M.c(),w=D(),S=y("a"),_=W("Download"),A=D(),O(S,"href",k=Gi(e[3],e[10])),O(S,"target","_blank"),O(o,"class","file-table-row"),O(r,"class","title-td-contents"),O(n,"class","title-td"),this.first=t},m(L,N){x(L,t,N),b(t,n),b(n,r),Q&&Q.m(r,null),b(r,s),b(r,o),Y(l,o,null),b(o,a),b(o,c),b(c,h),b(c,f),b(c,d),b(d,p),b(d,g),b(c,v),M&&M.m(c,null),b(c,w),b(c,S),b(S,_),b(t,A),C=!0},p(L,N){e=L,e[2]?Q?(Q.p(e,N),N&4&&T(Q,1)):(Q=x1(e),Q.c(),T(Q,1),Q.m(r,s)):Q&&(Oe(),R(Q,1,1,()=>{Q=null}),be());const B={};N&2&&(B.file=e[10]),N&2&&(B.size=e[10].width>0?"medium":"small"),l.$set(B),(!C||N&2)&&u!==(u=e[10].filename+"")&&K(h,u),(!C||N&2)&&m!==(m=(e[10].size/1024).toFixed(1)+"")&&K(p,m),e[10].width>0?M?M.p(e,N):(M=T1(e),M.c(),M.m(c,w)):M&&(M.d(1),M=null),(!C||N&2&&k!==(k=Gi(e[3],e[10])))&&O(S,"href",k)},i(L){C||(T(Q),T(l.$$.fragment,L),C=!0)},o(L){R(Q),R(l.$$.fragment,L),C=!1},d(L){L&&P(t),Q&&Q.d(),z(l),M&&M.d()}}}function ZE(i){let e,t,n,r,s,o,l,a,c=[],u=new Map,h,f=i[2]&&A1(i),d=fe(i[1]);const m=p=>p[10].id;for(let p=0;p{f=null}),be()),g&47&&(d=fe(p[1]),Oe(),c=Ti(c,g,m,1,p,d,u,a,Jr,Q1,null,P1),be())},i(p){if(!h){T(f);for(let g=0;gp.length===m.length?[]:(d.currentTarget.checked=p.length>0,m),u=(d,m)=>m.find(g=>g.id===d.id)?m.filter(g=>g.id!==d.id):[...m,d],h=(d,m)=>m.id===d.id,f=d=>a(d);return i.$$set=d=>{"files"in d&&t(1,r=d.files),"selected"in d&&t(0,s=d.selected),"isWritable"in d&&t(2,o=d.isWritable)},[s,r,o,n,l,a,c,u,h,f]}class WE extends oe{constructor(e){super(),se(this,e,BE,ZE,re,{files:1,selected:0,isWritable:2,toggleAll:6,selectFile:7})}get toggleAll(){return this.$$.ctx[6]}get selectFile(){return this.$$.ctx[7]}}function M1(i,e,t){const n=i.slice();return n[14]=e[t],n}function XE(i){let e,t,n,r,s,o,l,a,c;return{c(){e=y("button"),t=W("Insert"),r=D(),s=y("button"),o=W("Replace"),O(e,"type","button"),O(e,"class","button"),e.disabled=n=i[3].length===0,O(s,"type","button"),O(s,"class","button"),s.disabled=l=i[3].length===0},m(u,h){x(u,e,h),b(e,t),x(u,r,h),x(u,s,h),b(s,o),a||(c=[G(e,"click",i[6]),G(s,"click",i[7])],a=!0)},p(u,h){h&8&&n!==(n=u[3].length===0)&&(e.disabled=n),h&8&&l!==(l=u[3].length===0)&&(s.disabled=l)},i:U,o:U,d(u){u&&(P(e),P(r),P(s)),a=!1,ht(c)}}}function FE(i){let e,t;return e=new ur({props:{$$slots:{button:[zE],default:[YE]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&131072&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function E1(i){let e,t,n;function r(...s){return i[9](i[14],...s)}return{c(){e=y("button"),e.textContent=`${i[14].name}`,O(e,"class","dropdown-item button")},m(s,o){x(s,e,o),t||(n=G(e,"click",r),t=!0)},p(s,o){i=s},d(s){s&&P(e),t=!1,n()}}}function YE(i){let e,t=fe(i[5].imagePresets),n=[];for(let r=0;r0&&R1(i);a=new ut({props:{icon:"close"}});function _(A){i[10](A)}let k={files:i[4]};return i[3]!==void 0&&(k.selected=i[3]),h=new WE({props:k}),Ce.push(()=>nt(h,"selected",_)),{c(){e=y("dialog"),t=y("div"),r.c(),s=D(),S&&S.c(),o=D(),l=y("button"),V(a.$$.fragment),c=D(),u=y("div"),V(h.$$.fragment),O(l,"type","button"),O(l,"class","button close"),O(l,"aria-label","Close"),O(t,"class","dialog-header"),O(u,"class","dialog-body")},m(A,C){x(A,e,C),b(e,t),v[n].m(t,null),b(t,s),S&&S.m(t,null),b(t,o),b(t,l),Y(a,l,null),b(e,c),b(e,u),Y(h,u,null),i[11](e),d=!0,m||(p=G(l,"click",Ln(i[1])),m=!0)},p(A,[C]){let Q=n;n=w(A),n===Q?v[n].p(A,C):(Oe(),R(v[Q],1,1,()=>{v[Q]=null}),be(),r=v[n],r?r.p(A,C):(r=v[n]=g[n](A),r.c()),T(r,1),r.m(t,s)),A[3].length>0?S?S.p(A,C):(S=R1(A),S.c(),S.m(t,o)):S&&(S.d(1),S=null);const M={};C&16&&(M.files=A[4]),!f&&C&8&&(f=!0,M.selected=A[3],st(()=>f=!1)),h.$set(M)},i(A){d||(T(r),T(a.$$.fragment,A),T(h.$$.fragment,A),d=!0)},o(A){R(r),R(a.$$.fragment,A),R(h.$$.fragment,A),d=!1},d(A){A&&P(e),v[n].d(),S&&S.d(),z(a),z(h),i[11](null),m=!1,p()}}}function UE(i,e,t){let n,r,s,{presetMode:o=!1}=e;const l=nn(),a=Ue("channel");function c(v){v&&v.preventDefault(),s.close(),t(3,r=[])}function u(v){fetch(a.lucentUrl+"/records/files/?recordId="+v).then(w=>w.json()).then(w=>{t(4,n=w)}).catch(w=>console.log(w))}function h(v,w){v.preventDefault(),l("insert_files",{files:r,preset:w})}function f(v){v.preventDefault(),l("replace_files",r)}function d(v){s.showModal(),u(v)}const m=(v,w)=>h(w,v);function p(v){r=v,t(3,r)}function g(v){Ce[v?"unshift":"push"](()=>{s=v,t(2,s)})}return i.$$set=v=>{"presetMode"in v&&t(0,o=v.presetMode)},t(4,n=[]),t(3,r=[]),[o,c,s,r,n,a,h,f,d,m,p,g]}class Uy extends oe{constructor(e){super(),se(this,e,UE,VE,re,{presetMode:0,close:1,open:8})}get close(){return this.$$.ctx[1]}get open(){return this.$$.ctx[8]}}function jE(i){let e,t,n,r,s,o,l,a,c,u;return n=new ut({props:{icon:"upload"}}),{c(){e=y("fieldset"),t=y("label"),V(n.$$.fragment),r=D(),s=y("span"),o=W(` Upload file - `),s=y("input"),O(n,"class","spinner-border spinner-border-sm"),O(n,"role","status"),O(n,"aria-hidden","true"),O(s,"class","form-control"),O(s,"type","file"),O(s,"id","formFile"),s.multiple=!0,O(s,"accept",JE),s.disabled=i[0],s.hidden=!0,O(t,"class","button primary btn-spinner"),O(e,"class","upload-button"),e.disabled=i[0]},m(a,c){A(a,e,c),v(e,t),v(t,n),v(t,r),v(t,s),o||(l=G(s,"input",i[1]),o=!0)},p(a,[c]){c&1&&(s.disabled=a[0]),c&1&&(e.disabled=a[0])},i:U,o:U,d(a){a&&P(e),o=!1,l()}}}let JE="";function eR(i,e,t){const n=nn(),r=je("channel");let{recordId:s}=e,o=[],l=!1;function a(c){t(0,l=!0),o=c.target.files?[...c.target.files]:[];let u=new FormData;u.append("recordId",s),Array.from(o).forEach(function(h){u.append("files[]",h)}),n("beforeUpload",o),fetch(r.lucentUrl+"/files/upload",{method:"POST",body:u,headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content}}).then(h=>h.json()).then(h=>{h.error?n("uploadError",h.error):n("uploadComplete",h),t(0,l=!1)})}return i.$$set=c=>{"recordId"in c&&t(2,s=c.recordId)},[l,a,s]}class tR extends oe{constructor(e){super(),se(this,e,eR,KE,re,{recordId:2})}}function N1(i,e,t){const n=i.slice();return n[10]=e[t],n}function Z1(i){let e,t;return e=new Jy({props:{sortableClass:"mt-3",$$slots:{default:[nR]},$$scope:{ctx:i}}}),e.$on("update",i[4]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&8193&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function B1(i,e){let t,n,r,s;return n=new qm({props:{file:e[10],hasDelete:!0}}),n.$on("remove_file",e[3]),{key:i,first:null,c(){t=y("div"),V(n.$$.fragment),r=D(),this.first=t},m(o,l){A(o,t,l),Y(n,t,null),v(t,r),s=!0},p(o,l){e=o;const a={};l&1&&(a.file=e[10]),n.$set(a)},i(o){s||(T(n.$$.fragment,o),s=!0)},o(o){R(n.$$.fragment,o),s=!1},d(o){o&&P(t),z(n)}}}function nR(i){let e=[],t=new Map,n,r,s=ue(i[0]??[]);const o=l=>l[10].id;for(let l=0;l0&&Z1(i),d={};return a=new HE({props:d}),i[9](a),a.$on("insert_files",i[5]),a.$on("replace_files",i[6]),{c(){e=y("div"),t=y("button"),t.textContent="Browse",n=D(),r=y("div"),V(s.$$.fragment),o=D(),f&&f.c(),l=D(),V(a.$$.fragment),O(t,"class","button"),O(e,"class","mb-0")},m(m,p){A(m,e,p),v(e,t),v(e,n),v(e,r),Y(s,r,null),A(m,o,p),f&&f.m(m,p),A(m,l,p),Y(a,m,p),c=!0,u||(h=G(t,"click",i[7]),u=!0)},p(m,[p]){const g={};p&2&&(g.recordId=m[1].id),s.$set(g),m[0].length>0?f?(f.p(m,p),p&1&&T(f,1)):(f=Z1(m),f.c(),T(f,1),f.m(l.parentNode,l)):f&&(me(),R(f,1,1,()=>{f=null}),pe());const b={};a.$set(b)},i(m){c||(T(s.$$.fragment,m),T(f),T(a.$$.fragment,m),c=!0)},o(m){R(s.$$.fragment,m),R(f),R(a.$$.fragment,m),c=!1},d(m){m&&(P(e),P(o),P(l)),z(s),f&&f.d(m),i[9](null),z(a,m),u=!1,h()}}}function rR(i){}function sR(i,e,t){let{field:n}=e,{record:r}=e,{value:s=[]}=e,o;function l(d){d.preventDefault(),t(0,s=s.filter(m=>m.id!==d.detail))}async function a(d){t(0,s=await Ry(s,d.detail.source,d.detail.target))}function c(d){d.preventDefault(),o.close(),t(0,s=[...s??[],...d.detail??[]])}function u(d){d.preventDefault(),o.close(),t(0,s=d.detail??[])}function h(d){d.preventDefault(),o.open(r.id)}function f(d){Se[d?"unshift":"push"](()=>{o=d,t(2,o)})}return i.$$set=d=>{"field"in d&&t(8,n=d.field),"record"in d&&t(1,r=d.record),"value"in d&&t(0,s=d.value)},[s,r,o,l,a,c,u,h,n,f]}class oR extends oe{constructor(e){super(),se(this,e,sR,iR,re,{field:8,record:1,value:0})}}function W1(i){let e,t;return{c(){e=y("div"),t=W(i[5]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&32&&K(t,n[5])},d(n){n&&P(e)}}}function lR(i){let e,t,n,r,s,o,l=i[5]&&W1(i);return{c(){e=y("div"),t=y("textarea"),r=D(),l&&l.c(),O(t,"id",i[3]),O(t,"class","form-control svelte-1er4ovm"),O(t,"rows","2"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[5]),O(e,"class","mb-0")},m(a,c){A(a,e,c),v(e,t),Ie(t,i[0]),i[8](t),v(e,r),l&&l.m(e,null),s||(o=[G(t,"input",i[7]),G(t,"input",kd),G(t,"focus",kd)],s=!0)},p(a,[c]){c&8&&O(t,"id",a[3]),c&6&&n!==(n=a[1].readonly&&!a[2])&&(t.readOnly=n),c&1&&Ie(t,a[0]),c&32&&Ae(t,"is-invalid",a[5]),a[5]?l?l.p(a,c):(l=W1(a),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},i:U,o:U,d(a){a&&P(e),i[8](null),l&&l.d(),s=!1,ut(o)}}}function kd(i){let e;i.target?e=i.target:e=i,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function aR(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,a,{id:c}=e;Ti(()=>{kd(a)});function u(){s=this.value,t(0,s)}function h(f){Se[f?"unshift":"push"](()=>{a=f,t(4,a)})}return i.$$set=f=>{"field"in f&&t(1,r=f.field),"value"in f&&t(0,s=f.value),"isCreateMode"in f&&t(2,o=f.isCreateMode),"validationErrors"in f&&t(6,l=f.validationErrors),"id"in f&&t(3,c=f.id)},i.$$.update=()=>{i.$$.dirty&66&&t(5,n=In(l,r.name))},[s,r,o,c,a,n,l,u,h]}class ik extends oe{constructor(e){super(),se(this,e,aR,lR,re,{field:1,value:0,isCreateMode:2,validationErrors:6,id:3})}}function X1(i){let e,t;return{c(){e=y("div"),t=W(i[6]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&64&&K(t,n[6])},d(n){n&&P(e)}}}function cR(i){let e,t,n,r,s,o,l,a,c=i[6]&&X1(i);return{c(){e=y("div"),t=y("input"),r=D(),s=y("span"),s.textContent=`Dates are displayed according to your timezone: ${i[7]}`,o=D(),c&&c.c(),O(t,"type","text"),O(t,"id",i[3]),O(t,"class","form-control"),O(t,"autocomplete","off"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[6]),O(s,"class","system-help-text"),O(e,"class","mb-0")},m(u,h){A(u,e,h),v(e,t),Ie(t,i[0]),i[10](t),v(e,r),v(e,s),v(e,o),c&&c.m(e,null),i[11](e),l||(a=G(t,"input",i[9]),l=!0)},p(u,[h]){h&8&&O(t,"id",u[3]),h&6&&n!==(n=u[1].readonly&&!u[2])&&(t.readOnly=n),h&1&&t.value!==u[0]&&Ie(t,u[0]),h&64&&Ae(t,"is-invalid",u[6]),u[6]?c?c.p(u,h):(c=X1(u),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:U,o:U,d(u){u&&P(e),i[10](null),c&&c.d(),i[11](null),l=!1,a()}}}function uR(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e;const a=Intl.DateTimeFormat().resolvedOptions().timeZone;let{id:c}=e,u,h,f={appendTo:u,static:!0,allowInput:!0,altInput:!0,altFormat:"Y-m-d H:i:S",dateFormat:"Z",enableTime:!0,time_24hr:!0,enableSeconds:!0};r.min&&(f.minDate=r.min),r.max&&(f.maxDate=r.max),Ti(()=>{(!r.readonly||o)&&Yt(h,f)});function d(){s=this.value,t(0,s)}function m(g){Se[g?"unshift":"push"](()=>{h=g,t(5,h)})}function p(g){Se[g?"unshift":"push"](()=>{u=g,t(4,u)})}return i.$$set=g=>{"field"in g&&t(1,r=g.field),"value"in g&&t(0,s=g.value),"isCreateMode"in g&&t(2,o=g.isCreateMode),"validationErrors"in g&&t(8,l=g.validationErrors),"id"in g&&t(3,c=g.id)},i.$$.update=()=>{i.$$.dirty&258&&t(6,n=In(l,r.name))},[s,r,o,c,u,h,n,a,l,d,m,p]}class hR extends oe{constructor(e){super(),se(this,e,uR,cR,re,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}function F1(i,e,t){const n=i.slice();return n[14]=e[t],n}function Y1(i,e,t){const n=i.slice();return n[17]=e[t],n}function fR(i){let e,t;return e=new Gi({props:{$$slots:{button:[pR],default:[mR]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1048576&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function dR(i){let e,t,n;return{c(){e=y("button"),e.textContent="Browse",O(e,"class","button")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[9]),t=!0)},p:U,i:U,o:U,d(r){r&&P(e),t=!1,n()}}}function z1(i){let e,t,n;function r(...s){return i[10](i[17],...s)}return{c(){e=y("a"),e.textContent=`${i[17].label}`,O(e,"class","dropdown-item"),O(e,"href","/")},m(s,o){A(s,e,o),t||(n=G(e,"click",r),t=!0)},p(s,o){i=s},d(s){s&&P(e),t=!1,n()}}}function mR(i){let e,t=ue(i[3]),n=[];for(let r=0;rl[14].id;for(let l=0;l0&&V1(i),m={};return a=new Ny({props:m}),i[12](a),a.$on("insert",i[6]),{c(){e=y("div"),t=y("label"),t.textContent="Rich editor files",n=D(),s.c(),o=D(),d&&d.c(),l=D(),V(a.$$.fragment),O(t,"class","mt-4 mb-3"),O(e,"class","mb-3")},m(p,g){A(p,e,g),v(e,t),v(e,n),h[r].m(e,null),A(p,o,g),d&&d.m(p,g),A(p,l,g),Y(a,p,g),c=!0},p(p,[g]){let b=r;r=f(p),r===b?h[r].p(p,g):(me(),R(h[b],1,1,()=>{h[b]=null}),pe(),s=h[r],s?s.p(p,g):(s=h[r]=u[r](p),s.c()),T(s,1),s.m(e,null)),p[2].length>0?d?(d.p(p,g),g&4&&T(d,1)):(d=V1(p),d.c(),T(d,1),d.m(l.parentNode,l)):d&&(me(),R(d,1,1,()=>{d=null}),pe());const w={};a.$set(w)},i(p){c||(T(s),T(d),T(a.$$.fragment,p),c=!0)},o(p){R(s),R(d),R(a.$$.fragment,p),c=!1},d(p){p&&(P(e),P(o),P(l)),h[r].d(),d&&d.d(p),i[12](null),z(a,p)}}}function OR(i,e,t){let n;const r=je("channel");let{field:s}=e,{record:o}=e,{graph:l}=e,a,c=r.schemas.filter(b=>s.collections.includes(b.name));function u(b){b.preventDefault(),t(7,l.edges=l.edges.filter(w=>!(w.target===b.detail&&w.field===s.name)),l)}function h(b,w){b.preventDefault(),a.open(w)}function f(b){b.preventDefault(),a.close(),t(7,l=zm(l,o,b.detail.records,s.name,b.detail.action))}const d=b=>h(b,c[0].name),m=(b,w)=>h(w,b.name);function p(b){Lr.call(this,i,b)}function g(b){Se[b?"unshift":"push"](()=>{a=b,t(1,a)})}return i.$$set=b=>{"field"in b&&t(0,s=b.field),"record"in b&&t(8,o=b.record),"graph"in b&&t(7,l=b.graph)},i.$$.update=()=>{i.$$.dirty&385&&t(2,n=(l==null?void 0:l.edges.filter(b=>b.field===s.name).map(b=>l.records.find(w=>w.id===b.target&&o.id===b.source)).filter(b=>!!(b!=null&&b.id)))??[])},[s,a,n,c,u,h,f,l,o,d,m,p,g]}class rk extends oe{constructor(e){super(),se(this,e,OR,gR,re,{field:0,record:8,graph:7})}}var bR="2.1.18";const Ss="[data-trix-attachment]",Gm={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},Sn={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(i){return j1(i.parentNode)===Sn[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(i){return j1(i.parentNode)===Sn[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},j1=i=>{var e;return i==null||(e=i.tagName)===null||e===void 0?void 0:e.toLowerCase()},q1=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),Gh=q1&&parseInt(q1[1]);var Da={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:Gh&&Gh>12,samsungAndroid:Gh&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(i=>i in InputEvent.prototype)},sk={ADD_ATTR:["language"],SAFE_FOR_XML:!1,RETURN_DOM:!0},Ve={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption…",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL…",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"};const vR=[Ve.bytes,Ve.KB,Ve.MB,Ve.GB,Ve.TB,Ve.PB];var ok={prefix:"IEC",precision:2,formatter(i){switch(i){case 0:return"0 ".concat(Ve.bytes);case 1:return"1 ".concat(Ve.byte);default:let e;this.prefix==="SI"?e=1e3:this.prefix==="IEC"&&(e=1024);const t=Math.floor(Math.log(i)/Math.log(e)),n=(i/Math.pow(e,t)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(vR[t])}}};const oh="\uFEFF",Rr=" ",lk=function(i){for(const e in i){const t=i[e];this[e]=t}return this},Hm=document.documentElement,wR=Hm.matches,Zt=function(i){let{onElement:e,matchingSelector:t,withCallback:n,inPhase:r,preventDefault:s,times:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const l=e||Hm,a=t,c=r==="capturing",u=function(h){o!=null&&--o==0&&u.destroy();const f=zr(h.target,{matchingSelector:a});f!=null&&(n==null||n.call(f,h,f),s&&h.preventDefault())};return u.destroy=()=>l.removeEventListener(i,u,c),l.addEventListener(i,u,c),u},ak=function(i){let{bubbles:e,cancelable:t,attributes:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e=e!==!1,t=t!==!1;const r=document.createEvent("Events");return r.initEvent(i,e,t),n!=null&&lk.call(r,n),r},Ll=function(i){let{onElement:e,bubbles:t,cancelable:n,attributes:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=e??Hm,o=ak(i,{bubbles:t,cancelable:n,attributes:r});return s.dispatchEvent(o)},ck=function(i,e){if((i==null?void 0:i.nodeType)===1)return wR.call(i,e)},zr=function(i){let{matchingSelector:e,untilNode:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.parentNode;if(i!=null){if(e==null)return i;if(i.closest&&t==null)return i.closest(e);for(;i&&i!==t;){if(ck(i,e))return i;i=i.parentNode}}},Km=i=>document.activeElement!==i&&vs(i,document.activeElement),vs=function(i,e){if(i&&e)for(;e;){if(e===i)return!0;e=e.parentNode}},Hh=function(i){var e;if((e=i)===null||e===void 0||!e.parentNode)return;let t=0;for(i=i.previousSibling;i;)t++,i=i.previousSibling;return t},Vr=i=>{var e;return i==null||(e=i.parentNode)===null||e===void 0?void 0:e.removeChild(i)},vu=function(i){let{onlyNodesOfType:e,usingFilter:t,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=(()=>{switch(e){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(i,r,t??null,n===!0)},kn=i=>{var e;return i==null||(e=i.tagName)===null||e===void 0?void 0:e.toLowerCase()},Ge=function(i){let e,t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof i=="object"?(n=i,i=n.tagName):n={attributes:n};const r=document.createElement(i);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(e in n.attributes)t=n.attributes[e],r.setAttribute(e,t);if(n.style)for(e in n.style)t=n.style[e],r.style[e]=t;if(n.data)for(e in n.data)t=n.data[e],r.dataset[e]=t;return n.className&&n.className.split(" ").forEach(s=>{r.classList.add(s)}),n.textContent&&(r.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(s=>{r.appendChild(s)}),r};let nl;const Il=function(){if(nl!=null)return nl;nl=[];for(const i in Sn){const e=Sn[i];e.tagName&&nl.push(e.tagName)}return nl},Kh=i=>ho(i==null?void 0:i.firstChild),Jh=function(i){let{strict:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return e?ho(i):ho(i)||!ho(i.firstChild)&&function(t){return Il().includes(kn(t))&&!Il().includes(kn(t.firstChild))}(i)},ho=i=>yR(i)&&(i==null?void 0:i.data)==="block",yR=i=>(i==null?void 0:i.nodeType)===Node.COMMENT_NODE,fo=function(i){let{name:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i)return Nl(i)?i.data===oh?!e||i.parentNode.dataset.trixCursorTarget===e:void 0:fo(i.firstChild)},_s=i=>ck(i,Ss),uk=i=>Nl(i)&&(i==null?void 0:i.data)==="",Nl=i=>(i==null?void 0:i.nodeType)===Node.TEXT_NODE,Jm={level2Enabled:!0,getLevel(){return this.level2Enabled&&Da.supportsInputEvents?2:0},pickFiles(i){const e=Ge("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});e.addEventListener("change",()=>{i(e.files),Vr(e)}),Vr(document.getElementById(this.fileInputId)),document.body.appendChild(e),e.click()}};var Fc={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:` -`},As={bold:{tagName:"strong",inheritable:!0,parser(i){const e=window.getComputedStyle(i);return e.fontWeight==="bold"||e.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:i=>window.getComputedStyle(i).fontStyle==="italic"},href:{groupTagName:"a",parser(i){const e="a:not(".concat(Ss,")"),t=i.closest(e);if(t)return t.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},hk={getDefaultHTML:()=>`
+ `),l=y("input"),O(s,"class","spinner-border spinner-border-sm"),O(s,"role","status"),O(s,"aria-hidden","true"),O(l,"class","form-control"),O(l,"type","file"),O(l,"id","formFile"),l.multiple=!0,O(l,"accept",qE),l.disabled=i[0],l.hidden=!0,O(t,"class","button primary btn-spinner"),O(e,"class","upload-button"),e.disabled=i[0]},m(h,f){x(h,e,f),b(e,t),Y(n,t,null),b(t,r),b(t,s),b(t,o),b(t,l),a=!0,c||(u=G(l,"input",i[1]),c=!0)},p(h,[f]){(!a||f&1)&&(l.disabled=h[0]),(!a||f&1)&&(e.disabled=h[0])},i(h){a||(T(n.$$.fragment,h),a=!0)},o(h){R(n.$$.fragment,h),a=!1},d(h){h&&P(e),z(n),c=!1,u()}}}let qE="";function GE(i,e,t){const n=nn(),r=Ue("channel");let{recordId:s}=e,o=[],l=!1;function a(c){t(0,l=!0),o=c.target.files?[...c.target.files]:[];let u=new FormData;u.append("recordId",s),Array.from(o).forEach(function(h){u.append("files[]",h)}),n("beforeUpload",o),fetch(r.lucentUrl+"/files/upload",{method:"POST",body:u,headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').content}}).then(h=>h.json()).then(h=>{h.error?n("uploadError",h.error):n("uploadComplete",h),t(0,l=!1)})}return i.$$set=c=>{"recordId"in c&&t(2,s=c.recordId)},[l,a,s]}class jy extends oe{constructor(e){super(),se(this,e,GE,jE,re,{recordId:2})}}function D1(i,e,t){const n=i.slice();return n[11]=e[t],n}function $1(i){let e,t;return e=new Xy({props:{sortableClass:"mt-3",$$slots:{default:[HE]},$$scope:{ctx:i}}}),e.$on("update",i[4]),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&16385&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function L1(i,e){let t,n,r,s;return n=new Vy({props:{file:e[11],hasDelete:!0}}),n.$on("remove_file",e[3]),{key:i,first:null,c(){t=y("div"),V(n.$$.fragment),r=D(),this.first=t},m(o,l){x(o,t,l),Y(n,t,null),b(t,r),s=!0},p(o,l){e=o;const a={};l&1&&(a.file=e[11]),n.$set(a)},i(o){s||(T(n.$$.fragment,o),s=!0)},o(o){R(n.$$.fragment,o),s=!1},d(o){o&&P(t),z(n)}}}function HE(i){let e=[],t=new Map,n,r,s=fe(i[0]??[]);const o=l=>l[11].id;for(let l=0;l0&&$1(i),m={};return c=new Uy({props:m}),i[10](c),c.$on("insert_files",i[5]),c.$on("replace_files",i[6]),{c(){e=y("div"),t=y("button"),V(n.$$.fragment),r=W(" Browse"),s=D(),V(o.$$.fragment),l=D(),d&&d.c(),a=D(),V(c.$$.fragment),O(t,"class","button"),O(e,"class","mb-0"),le(e,"display","flex"),le(e,"align-items","start"),le(e,"justify-content","start"),le(e,"gap","6px")},m(p,g){x(p,e,g),b(e,t),Y(n,t,null),b(t,r),b(e,s),Y(o,e,null),x(p,l,g),d&&d.m(p,g),x(p,a,g),Y(c,p,g),u=!0,h||(f=G(t,"click",i[8]),h=!0)},p(p,[g]){const v={};g&2&&(v.recordId=p[1].id),o.$set(v),p[0].length>0?d?(d.p(p,g),g&1&&T(d,1)):(d=$1(p),d.c(),T(d,1),d.m(a.parentNode,a)):d&&(Oe(),R(d,1,1,()=>{d=null}),be());const w={};c.$set(w)},i(p){u||(T(n.$$.fragment,p),T(o.$$.fragment,p),T(d),T(c.$$.fragment,p),u=!0)},o(p){R(n.$$.fragment,p),R(o.$$.fragment,p),R(d),R(c.$$.fragment,p),u=!1},d(p){p&&(P(e),P(l),P(a)),z(n),z(o),d&&d.d(p),i[10](null),z(c,p),h=!1,f()}}}function JE(i,e,t){let{field:n}=e,{record:r}=e,{value:s=[]}=e,o;function l(m){m.preventDefault(),t(0,s=s.filter(p=>p.id!==m.detail))}async function a(m){t(0,s=await Sy(s,m.detail.source,m.detail.target))}function c(m){m.preventDefault(),o.close(),t(0,s=[...s??[],...m.detail.files??[]])}function u(m){m.preventDefault(),o.close(),t(0,s=m.detail??[])}function h(m){t(0,s=[...s,...m.detail])}function f(m){m.preventDefault(),o.open(r.id)}function d(m){Ce[m?"unshift":"push"](()=>{o=m,t(2,o)})}return i.$$set=m=>{"field"in m&&t(9,n=m.field),"record"in m&&t(1,r=m.record),"value"in m&&t(0,s=m.value)},[s,r,o,l,a,c,u,h,f,n,d]}class eR extends oe{constructor(e){super(),se(this,e,JE,KE,re,{field:9,record:1,value:0})}}function I1(i){let e,t;return{c(){e=y("div"),t=W(i[5]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&32&&K(t,n[5])},d(n){n&&P(e)}}}function tR(i){let e,t,n,r,s,o,l=i[5]&&I1(i);return{c(){e=y("div"),t=y("textarea"),r=D(),l&&l.c(),O(t,"id",i[3]),O(t,"class","form-control svelte-1er4ovm"),O(t,"rows","2"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[5]),O(e,"class","mb-0")},m(a,c){x(a,e,c),b(e,t),Le(t,i[0]),i[8](t),b(e,r),l&&l.m(e,null),s||(o=[G(t,"input",i[7]),G(t,"input",kd),G(t,"focus",kd)],s=!0)},p(a,[c]){c&8&&O(t,"id",a[3]),c&6&&n!==(n=a[1].readonly&&!a[2])&&(t.readOnly=n),c&1&&Le(t,a[0]),c&32&&Ae(t,"is-invalid",a[5]),a[5]?l?l.p(a,c):(l=I1(a),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},i:U,o:U,d(a){a&&P(e),i[8](null),l&&l.d(),s=!1,ht(o)}}}function kd(i){let e;i.target?e=i.target:e=i,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function nR(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e,a,{id:c}=e;xi(()=>{kd(a)});function u(){s=this.value,t(0,s)}function h(f){Ce[f?"unshift":"push"](()=>{a=f,t(4,a)})}return i.$$set=f=>{"field"in f&&t(1,r=f.field),"value"in f&&t(0,s=f.value),"isCreateMode"in f&&t(2,o=f.isCreateMode),"validationErrors"in f&&t(6,l=f.validationErrors),"id"in f&&t(3,c=f.id)},i.$$.update=()=>{i.$$.dirty&66&&t(5,n=In(l,r.name))},[s,r,o,c,a,n,l,u,h]}class qy extends oe{constructor(e){super(),se(this,e,nR,tR,re,{field:1,value:0,isCreateMode:2,validationErrors:6,id:3})}}function N1(i){let e,t;return{c(){e=y("div"),t=W(i[6]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&64&&K(t,n[6])},d(n){n&&P(e)}}}function iR(i){let e,t,n,r,s,o,l,a,c=i[6]&&N1(i);return{c(){e=y("div"),t=y("input"),r=D(),s=y("span"),s.textContent=`Dates are displayed according to your timezone: ${i[7]}`,o=D(),c&&c.c(),O(t,"type","text"),O(t,"id",i[3]),O(t,"class","form-control"),O(t,"autocomplete","off"),t.readOnly=n=i[1].readonly&&!i[2],Ae(t,"is-invalid",i[6]),O(s,"class","system-help-text"),O(e,"class","mb-0")},m(u,h){x(u,e,h),b(e,t),Le(t,i[0]),i[10](t),b(e,r),b(e,s),b(e,o),c&&c.m(e,null),i[11](e),l||(a=G(t,"input",i[9]),l=!0)},p(u,[h]){h&8&&O(t,"id",u[3]),h&6&&n!==(n=u[1].readonly&&!u[2])&&(t.readOnly=n),h&1&&t.value!==u[0]&&Le(t,u[0]),h&64&&Ae(t,"is-invalid",u[6]),u[6]?c?c.p(u,h):(c=N1(u),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:U,o:U,d(u){u&&P(e),i[10](null),c&&c.d(),i[11](null),l=!1,a()}}}function rR(i,e,t){let n,{field:r}=e,{value:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e;const a=Intl.DateTimeFormat().resolvedOptions().timeZone;let{id:c}=e,u,h,f={appendTo:u,static:!0,allowInput:!0,altInput:!0,altFormat:"Y-m-d H:i:S",dateFormat:"Z",enableTime:!0,time_24hr:!0,enableSeconds:!0};r.min&&(f.minDate=r.min),r.max&&(f.maxDate=r.max),xi(()=>{(!r.readonly||o)&&Yt(h,f)});function d(){s=this.value,t(0,s)}function m(g){Ce[g?"unshift":"push"](()=>{h=g,t(5,h)})}function p(g){Ce[g?"unshift":"push"](()=>{u=g,t(4,u)})}return i.$$set=g=>{"field"in g&&t(1,r=g.field),"value"in g&&t(0,s=g.value),"isCreateMode"in g&&t(2,o=g.isCreateMode),"validationErrors"in g&&t(8,l=g.validationErrors),"id"in g&&t(3,c=g.id)},i.$$.update=()=>{i.$$.dirty&258&&t(6,n=In(l,r.name))},[s,r,o,c,u,h,n,a,l,d,m,p]}class sR extends oe{constructor(e){super(),se(this,e,rR,iR,re,{field:1,value:0,isCreateMode:2,validationErrors:8,id:3})}}function oR(i){let e,t,n,r,s,o,l,a,c,u,h;n=new ut({props:{icon:"photo-film"}}),o=new jy({props:{recordId:i[0].id}}),o.$on("uploadComplete",lR);let f={presetMode:!0};return a=new Uy({props:f}),i[7](a),a.$on("insert_files",i[3]),a.$on("replace_files",i[4]),{c(){e=y("div"),t=y("button"),V(n.$$.fragment),r=W(" Browse"),s=D(),V(o.$$.fragment),l=D(),V(a.$$.fragment),O(t,"class","button"),O(e,"class","mb-0"),le(e,"display","flex"),le(e,"align-items","start"),le(e,"justify-content","start"),le(e,"gap","6px")},m(d,m){x(d,e,m),b(e,t),Y(n,t,null),b(t,r),b(e,s),Y(o,e,null),x(d,l,m),Y(a,d,m),c=!0,u||(h=G(t,"click",i[2]),u=!0)},p(d,[m]){const p={};m&1&&(p.recordId=d[0].id),o.$set(p);const g={};a.$set(g)},i(d){c||(T(n.$$.fragment,d),T(o.$$.fragment,d),T(a.$$.fragment,d),c=!0)},o(d){R(n.$$.fragment,d),R(o.$$.fragment,d),R(a.$$.fragment,d),c=!1},d(d){d&&(P(e),P(l)),z(n),z(o),i[7](null),z(a,d),u=!1,h()}}}function lR(i){}function aR(i,e,t){Ue("channel");let{field:n}=e,{record:r}=e,{onFilesInserted:s}=e,o;function l(h){h.preventDefault(),o.open(r.id)}function a(h){h.preventDefault(),s(h),o.close()}function c(h){h.preventDefault(),o.close()}function u(h){Ce[h?"unshift":"push"](()=>{o=h,t(1,o)})}return i.$$set=h=>{"field"in h&&t(5,n=h.field),"record"in h&&t(0,r=h.record),"onFilesInserted"in h&&t(6,s=h.onFilesInserted)},[r,o,l,a,c,n,s,u]}class Gy extends oe{constructor(e){super(),se(this,e,aR,oR,re,{field:5,record:0,onFilesInserted:6})}}var cR="2.1.18";const _s="[data-trix-attachment]",jm={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},Sn={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(i){return Z1(i.parentNode)===Sn[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(i){return Z1(i.parentNode)===Sn[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},Z1=i=>{var e;return i==null||(e=i.tagName)===null||e===void 0?void 0:e.toLowerCase()},B1=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),Gh=B1&&parseInt(B1[1]);var Da={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:Gh&&Gh>12,samsungAndroid:Gh&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(i=>i in InputEvent.prototype)},Hy={ADD_ATTR:["language"],SAFE_FOR_XML:!1,RETURN_DOM:!0},Ve={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption…",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL…",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"};const uR=[Ve.bytes,Ve.KB,Ve.MB,Ve.GB,Ve.TB,Ve.PB];var Ky={prefix:"IEC",precision:2,formatter(i){switch(i){case 0:return"0 ".concat(Ve.bytes);case 1:return"1 ".concat(Ve.byte);default:let e;this.prefix==="SI"?e=1e3:this.prefix==="IEC"&&(e=1024);const t=Math.floor(Math.log(i)/Math.log(e)),n=(i/Math.pow(e,t)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(uR[t])}}};const oh="\uFEFF",Rr=" ",Jy=function(i){for(const e in i){const t=i[e];this[e]=t}return this},qm=document.documentElement,hR=qm.matches,Zt=function(i){let{onElement:e,matchingSelector:t,withCallback:n,inPhase:r,preventDefault:s,times:o}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const l=e||qm,a=t,c=r==="capturing",u=function(h){o!=null&&--o==0&&u.destroy();const f=Yr(h.target,{matchingSelector:a});f!=null&&(n==null||n.call(f,h,f),s&&h.preventDefault())};return u.destroy=()=>l.removeEventListener(i,u,c),l.addEventListener(i,u,c),u},ek=function(i){let{bubbles:e,cancelable:t,attributes:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e=e!==!1,t=t!==!1;const r=document.createEvent("Events");return r.initEvent(i,e,t),n!=null&&Jy.call(r,n),r},Il=function(i){let{onElement:e,bubbles:t,cancelable:n,attributes:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=e??qm,o=ek(i,{bubbles:t,cancelable:n,attributes:r});return s.dispatchEvent(o)},tk=function(i,e){if((i==null?void 0:i.nodeType)===1)return hR.call(i,e)},Yr=function(i){let{matchingSelector:e,untilNode:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.parentNode;if(i!=null){if(e==null)return i;if(i.closest&&t==null)return i.closest(e);for(;i&&i!==t;){if(tk(i,e))return i;i=i.parentNode}}},Gm=i=>document.activeElement!==i&&ws(i,document.activeElement),ws=function(i,e){if(i&&e)for(;e;){if(e===i)return!0;e=e.parentNode}},Hh=function(i){var e;if((e=i)===null||e===void 0||!e.parentNode)return;let t=0;for(i=i.previousSibling;i;)t++,i=i.previousSibling;return t},zr=i=>{var e;return i==null||(e=i.parentNode)===null||e===void 0?void 0:e.removeChild(i)},vu=function(i){let{onlyNodesOfType:e,usingFilter:t,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=(()=>{switch(e){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(i,r,t??null,n===!0)},kn=i=>{var e;return i==null||(e=i.tagName)===null||e===void 0?void 0:e.toLowerCase()},Ge=function(i){let e,t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof i=="object"?(n=i,i=n.tagName):n={attributes:n};const r=document.createElement(i);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(e in n.attributes)t=n.attributes[e],r.setAttribute(e,t);if(n.style)for(e in n.style)t=n.style[e],r.style[e]=t;if(n.data)for(e in n.data)t=n.data[e],r.dataset[e]=t;return n.className&&n.className.split(" ").forEach(s=>{r.classList.add(s)}),n.textContent&&(r.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(s=>{r.appendChild(s)}),r};let il;const Nl=function(){if(il!=null)return il;il=[];for(const i in Sn){const e=Sn[i];e.tagName&&il.push(e.tagName)}return il},Kh=i=>fo(i==null?void 0:i.firstChild),Jh=function(i){let{strict:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return e?fo(i):fo(i)||!fo(i.firstChild)&&function(t){return Nl().includes(kn(t))&&!Nl().includes(kn(t.firstChild))}(i)},fo=i=>fR(i)&&(i==null?void 0:i.data)==="block",fR=i=>(i==null?void 0:i.nodeType)===Node.COMMENT_NODE,mo=function(i){let{name:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(i)return Zl(i)?i.data===oh?!e||i.parentNode.dataset.trixCursorTarget===e:void 0:mo(i.firstChild)},Cs=i=>tk(i,_s),nk=i=>Zl(i)&&(i==null?void 0:i.data)==="",Zl=i=>(i==null?void 0:i.nodeType)===Node.TEXT_NODE,Hm={level2Enabled:!0,getLevel(){return this.level2Enabled&&Da.supportsInputEvents?2:0},pickFiles(i){const e=Ge("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});e.addEventListener("change",()=>{i(e.files),zr(e)}),zr(document.getElementById(this.fileInputId)),document.body.appendChild(e),e.click()}};var Fc={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:` +`},xs={bold:{tagName:"strong",inheritable:!0,parser(i){const e=window.getComputedStyle(i);return e.fontWeight==="bold"||e.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:i=>window.getComputedStyle(i).fontStyle==="italic"},href:{groupTagName:"a",parser(i){const e="a:not(".concat(_s,")"),t=i.closest(e);if(t)return t.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},ik={getDefaultHTML:()=>`
@@ -73,40 +73,40 @@ var bP=Object.defineProperty;var vP=(i,e,t)=>e in i?bP(i,e,{enumerable:!0,config
- `)};const Sd={interval:5e3};var $a=Object.freeze({__proto__:null,attachments:Gm,blockAttributes:Sn,browser:Da,css:{attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"},dompurify:sk,fileSize:ok,input:Jm,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:Ve,parser:Fc,textAttributes:As,toolbar:hk,undo:Sd});class Kt{static proxyMethod(e){const{name:t,toMethod:n,toProperty:r,optional:s}=kR(e);this.prototype[t]=function(){let o,l;var a,c;return n?l=s?(a=this[n])===null||a===void 0?void 0:a.call(this):this[n]():r&&(l=this[r]),s?(o=(c=l)===null||c===void 0?void 0:c[t],o?G1.call(o,l,arguments):void 0):(o=l[t],G1.call(o,l,arguments))}}}const kR=function(i){const e=i.match(SR);if(!e)throw new Error("can't parse @proxyMethod expression: ".concat(i));const t={name:e[4]};return e[2]!=null?t.toMethod=e[1]:t.toProperty=e[1],e[3]!=null&&(t.optional=!0),t},{apply:G1}=Function.prototype,SR=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$");var ef,tf,nf;class sa extends Kt{static box(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e instanceof this?e:this.fromUCS2String(e==null?void 0:e.toString())}static fromUCS2String(e){return new this(e,_d(e))}static fromCodepoints(e){return new this(Cd(e),e)}constructor(e,t){super(...arguments),this.ucs2String=e,this.codepoints=t,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(e){return Cd(this.codepoints.slice(0,Math.max(0,e))).length}offsetFromUCS2Offset(e){return _d(this.ucs2String.slice(0,Math.max(0,e))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(e){return this.slice(e,e+1)}isEqualTo(e){return this.constructor.box(e).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}}const _R=((ef=Array.from)===null||ef===void 0?void 0:ef.call(Array,"👼").length)===1,CR=((tf=" ".codePointAt)===null||tf===void 0?void 0:tf.call(" ",0))!=null,PR=((nf=String.fromCodePoint)===null||nf===void 0?void 0:nf.call(String,32,128124))===" 👼";let _d,Cd;_d=_R&&CR?i=>Array.from(i).map(e=>e.codePointAt(0)):function(i){const e=[];let t=0;const{length:n}=i;for(;tString.fromCodePoint(...Array.from(i||[])):function(i){return(()=>{const e=[];return Array.from(i).forEach(t=>{let n="";t>65535&&(t-=65536,n+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e.push(n+String.fromCharCode(t))}),e})().join("")};let AR=0;class Is extends Kt{static fromJSONString(e){return this.fromJSON(JSON.parse(e))}constructor(){super(...arguments),this.id=++AR}hasSameConstructorAs(e){return this.constructor===(e==null?void 0:e.constructor)}isEqualTo(e){return this===e}inspect(){const e=[],t=this.contentsForInspection()||{};for(const n in t){const r=t[n];e.push("".concat(n,"=").concat(r))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(e.length?" ".concat(e.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return sa.box(this)}getCacheKey(){return this.id.toString()}}const xs=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==e.length)return!1;for(let t=0;t1?t-1:0),r=1;r(rf||(rf=MR().concat(QR())),rf),zt=i=>Sn[i],QR=()=>(sf||(sf=Object.keys(Sn)),sf),Ad=i=>As[i],MR=()=>(of||(of=Object.keys(As)),of),fk=function(i,e){ER(i).textContent=e.replace(/%t/g,i)},ER=function(i){const e=document.createElement("style");e.setAttribute("type","text/css"),e.setAttribute("data-tag-name",i.toLowerCase());const t=RR();return t&&e.setAttribute("nonce",t),document.head.insertBefore(e,document.head.firstChild),e},RR=function(){const i=H1("trix-csp-nonce")||H1("csp-nonce");if(i){const{nonce:e,content:t}=i;return e==""?t:e}},H1=i=>document.head.querySelector("meta[name=".concat(i,"]")),K1={"application/x-trix-feature-detection":"test"},dk=function(i){const e=i.getData("text/plain"),t=i.getData("text/html");if(!e||!t)return e==null?void 0:e.length;{const{body:n}=new DOMParser().parseFromString(t,"text/html");if(n.textContent===e)return!n.querySelector("*")}},mk=/Mac|^iP/.test(navigator.platform)?i=>i.metaKey:i=>i.ctrlKey,tp=i=>setTimeout(i,1),pk=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e={};for(const t in i){const n=i[t];e[t]=n}return e},Xo=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Object.keys(i).length!==Object.keys(e).length)return!1;for(const t in i)if(i[t]!==e[t])return!1;return!0},bt=function(i){if(i!=null)return Array.isArray(i)||(i=[i,i]),[J1(i[0]),J1(i[1]!=null?i[1]:i[0])]},or=function(i){if(i==null)return;const[e,t]=bt(i);return xd(e,t)},wu=function(i,e){if(i==null||e==null)return;const[t,n]=bt(i),[r,s]=bt(e);return xd(t,r)&&xd(n,s)},J1=function(i){return typeof i=="number"?i:pk(i)},xd=function(i,e){return typeof i=="number"?i===e:Xo(i,e)};class gk extends Kt{constructor(){super(...arguments),this.update=this.update.bind(this),this.selectionManagers=[]}start(){this.started||(this.started=!0,document.addEventListener("selectionchange",this.update,!0))}stop(){if(this.started)return this.started=!1,document.removeEventListener("selectionchange",this.update,!0)}registerSelectionManager(e){if(!this.selectionManagers.includes(e))return this.selectionManagers.push(e),this.start()}unregisterSelectionManager(e){if(this.selectionManagers=this.selectionManagers.filter(t=>t!==e),this.selectionManagers.length===0)return this.stop()}notifySelectionManagersOfSelectionChange(){return this.selectionManagers.map(e=>e.selectionDidChange())}update(){this.notifySelectionManagersOfSelectionChange()}reset(){this.update()}}const Ts=new gk,Ok=function(){const i=window.getSelection();if(i.rangeCount>0)return i},Zl=function(){var i;const e=(i=Ok())===null||i===void 0?void 0:i.getRangeAt(0);if(e&&!DR(e))return e},bk=function(i){const e=window.getSelection();return e.removeAllRanges(),e.addRange(i),Ts.update()},DR=i=>e0(i.startContainer)||e0(i.endContainer),e0=i=>!Object.getPrototypeOf(i),yl=i=>i.replace(new RegExp("".concat(oh),"g"),"").replace(new RegExp("".concat(Rr),"g")," "),np=new RegExp("[^\\S".concat(Rr,"]")),ip=i=>i.replace(new RegExp("".concat(np.source),"g")," ").replace(/\ {2,}/g," "),t0=function(i,e){if(i.isEqualTo(e))return["",""];const t=lf(i,e),{length:n}=t.utf16String;let r;if(n){const{offset:s}=t,o=i.codepoints.slice(0,s).concat(i.codepoints.slice(s+n));r=lf(e,sa.fromCodepoints(o))}else r=lf(e,i);return[t.utf16String.toString(),r.utf16String.toString()]},lf=function(i,e){let t=0,n=i.length,r=e.length;for(;tt+1&&i.charAt(n-1).isEqualTo(e.charAt(r-1));)n--,r--;return{utf16String:i.slice(t,n),offset:t}};class Kn extends Is{static fromCommonAttributesOfObjects(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(!e.length)return new this;let t=il(e[0]),n=t.getKeys();return e.slice(1).forEach(r=>{n=t.getKeysCommonToHash(il(r)),t=t.slice(n)}),t}static box(e){return il(e)}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(...arguments),this.values=Yc(e)}add(e,t){return this.merge($R(e,t))}remove(e){return new Kn(Yc(this.values,e))}get(e){return this.values[e]}has(e){return e in this.values}merge(e){return new Kn(LR(this.values,IR(e)))}slice(e){const t={};return Array.from(e).forEach(n=>{this.has(n)&&(t[n]=this.values[n])}),new Kn(t)}getKeys(){return Object.keys(this.values)}getKeysCommonToHash(e){return e=il(e),this.getKeys().filter(t=>this.values[t]===e.values[t])}isEqualTo(e){return xs(this.toArray(),il(e).toArray())}isEmpty(){return this.getKeys().length===0}toArray(){if(!this.array){const e=[];for(const t in this.values){const n=this.values[t];e.push(e.push(t,n))}this.array=e.slice(0)}return this.array}toObject(){return Yc(this.values)}toJSON(){return this.toObject()}contentsForInspection(){return{values:JSON.stringify(this.values)}}}const $R=function(i,e){const t={};return t[i]=e,t},LR=function(i,e){const t=Yc(i);for(const n in e){const r=e[n];t[n]=r}return t},Yc=function(i,e){const t={};return Object.keys(i).sort().forEach(n=>{n!==e&&(t[n]=i[n])}),t},il=function(i){return i instanceof Kn?i:new Kn(i)},IR=function(i){return i instanceof Kn?i.values:i};class rp{static groupObjects(){let e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:n,asTree:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r&&n==null&&(n=0);const s=[];return Array.from(t).forEach(o=>{var l;if(e){var a,c,u;if((a=o.canBeGrouped)!==null&&a!==void 0&&a.call(o,n)&&(c=(u=e[e.length-1]).canBeGroupedWith)!==null&&c!==void 0&&c.call(u,o,n))return void e.push(o);s.push(new this(e,{depth:n,asTree:r})),e=null}(l=o.canBeGrouped)!==null&&l!==void 0&&l.call(o,n)?e=[o]:s.push(o)}),e&&s.push(new this(e,{depth:n,asTree:r})),s}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:t,asTree:n}=arguments.length>1?arguments[1]:void 0;this.objects=e,n&&(this.depth=t,this.objects=this.constructor.groupObjects(this.objects,{asTree:n,depth:this.depth+1}))}getObjects(){return this.objects}getDepth(){return this.depth}getCacheKey(){const e=["objectGroup"];return Array.from(this.getObjects()).forEach(t=>{e.push(t.getCacheKey())}),e.join("/")}}class NR extends Kt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects={},Array.from(e).forEach(t=>{const n=JSON.stringify(t);this.objects[n]==null&&(this.objects[n]=t)})}find(e){const t=JSON.stringify(e);return this.objects[t]}}class ZR{constructor(e){this.reset(e)}add(e){const t=n0(e);this.elements[t]=e}remove(e){const t=n0(e),n=this.elements[t];if(n)return delete this.elements[t],n}reset(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return this.elements={},Array.from(e).forEach(t=>{this.add(t)}),e}}const n0=i=>i.dataset.trixStoreKey;let yu=class extends Kt{isPerforming(){return this.performing===!0}hasPerformed(){return this.performed===!0}hasSucceeded(){return this.performed&&this.succeeded}hasFailed(){return this.performed&&!this.succeeded}getPromise(){return this.promise||(this.promise=new Promise((e,t)=>(this.performing=!0,this.perform((n,r)=>{this.succeeded=n,this.performing=!1,this.performed=!0,this.succeeded?e(r):t(r)})))),this.promise}perform(e){return e(!1)}release(){var e,t;(e=this.promise)===null||e===void 0||(t=e.cancel)===null||t===void 0||t.call(e),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null}};yu.proxyMethod("getPromise().then"),yu.proxyMethod("getPromise().catch");class Ns extends Kt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.object=e,this.options=t,this.childViews=[],this.rootView=this}getNodes(){return this.nodes||(this.nodes=this.createNodes()),this.nodes.map(e=>e.cloneNode(!0))}invalidate(){var e;return this.nodes=null,this.childViews=[],(e=this.parentView)===null||e===void 0?void 0:e.invalidate()}invalidateViewForObject(e){var t;return(t=this.findViewForObject(e))===null||t===void 0?void 0:t.invalidate()}findOrCreateCachedChildView(e,t,n){let r=this.getCachedViewForObject(t);return r?this.recordChildView(r):(r=this.createChildView(...arguments),this.cacheViewForObject(r,t)),r}createChildView(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};t instanceof rp&&(n.viewClass=e,e=BR);const r=new e(t,n);return this.recordChildView(r)}recordChildView(e){return e.parentView=this,e.rootView=this.rootView,this.childViews.push(e),e}getAllChildViews(){let e=[];return this.childViews.forEach(t=>{e.push(t),e=e.concat(t.getAllChildViews())}),e}findElement(){return this.findElementForObject(this.object)}findElementForObject(e){const t=e==null?void 0:e.id;if(t)return this.rootView.element.querySelector("[data-trix-id='".concat(t,"']"))}findViewForObject(e){for(const t of this.getAllChildViews())if(t.object===e)return t}getViewCache(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?(this.viewCache||(this.viewCache={}),this.viewCache):void 0}isViewCachingEnabled(){return this.shouldCacheViews!==!1}enableViewCaching(){this.shouldCacheViews=!0}disableViewCaching(){this.shouldCacheViews=!1}getCachedViewForObject(e){var t;return(t=this.getViewCache())===null||t===void 0?void 0:t[e.getCacheKey()]}cacheViewForObject(e,t){const n=this.getViewCache();n&&(n[t.getCacheKey()]=e)}garbageCollectCachedViews(){const e=this.getViewCache();if(e){const t=this.getAllChildViews().concat(this).map(n=>n.object.getCacheKey());for(const n in e)t.includes(n)||delete e[n]}}}class BR extends Ns{constructor(){super(...arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}getChildViews(){return this.childViews.length||Array.from(this.objectGroup.getObjects()).forEach(e=>{this.findOrCreateCachedChildView(this.viewClass,e,this.options)}),this.childViews}createNodes(){const e=this.createContainerElement();return this.getChildViews().forEach(t=>{Array.from(t.getNodes()).forEach(n=>{e.appendChild(n)})}),[e]}createContainerElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.objectGroup.getDepth();return this.getChildViews()[0].createContainerElement(e)}}/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */const{entries:vk,setPrototypeOf:i0,isFrozen:WR,getPrototypeOf:XR,getOwnPropertyDescriptor:FR}=Object;let{freeze:An,seal:hi,create:wk}=Object,{apply:Td,construct:Qd}=typeof Reflect<"u"&&Reflect;An||(An=function(i){return i}),hi||(hi=function(i){return i}),Td||(Td=function(i,e){for(var t=arguments.length,n=new Array(t>2?t-2:0),r=2;r1?e-1:0),n=1;n1?t-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:zc;i0&&i0(i,null);let n=e.length;for(;n--;){let r=e[n];if(typeof r=="string"){const s=t(r);s!==r&&(WR(e)||(e[n]=s),r=s)}i[r]=!0}return i}function jR(i){for(let e=0;e/gm),JR=hi(/\$\{[\w\W]*/gm),e4=hi(/^data-[\-\w.\u00B7-\uFFFF]+$/),t4=hi(/^aria-[\-\w]+$/),yk=hi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),n4=hi(/^(?:\w+script|data):/i),i4=hi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kk=hi(/^html$/i),r4=hi(/^[a-z][.\w]*(-[.\w]+)+$/i);var u0=Object.freeze({__proto__:null,ARIA_ATTR:t4,ATTR_WHITESPACE:i4,CUSTOM_ELEMENT:r4,DATA_ATTR:e4,DOCTYPE_NAME:kk,ERB_EXPR:KR,IS_ALLOWED_URI:yk,IS_SCRIPT_OR_DATA:n4,MUSTACHE_EXPR:HR,TMPLIT_EXPR:JR});const s4=1,o4=3,l4=7,a4=8,c4=9,u4=function(){return typeof window>"u"?null:window};var Po=function i(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:u4();const t=Z=>i(Z);if(t.version="3.2.7",t.removed=[],!e||!e.document||e.document.nodeType!==c4||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,s=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:a,Element:c,NodeFilter:u,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:m}=e,p=c.prototype,g=ll(p,"cloneNode"),b=ll(p,"remove"),w=ll(p,"nextSibling"),S=ll(p,"childNodes"),_=ll(p,"parentNode");if(typeof l=="function"){const Z=n.createElement("template");Z.content&&Z.content.ownerDocument&&(n=Z.content.ownerDocument)}let k,Q="";const{implementation:x,createNodeIterator:C,createDocumentFragment:M,getElementsByTagName:$}=n,{importNode:N}=r;let B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};t.isSupported=typeof vk=="function"&&typeof _=="function"&&x&&x.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:J,ERB_EXPR:te,TMPLIT_EXPR:ie,DATA_ATTR:le,ARIA_ATTR:X,IS_SCRIPT_OR_DATA:ee,ATTR_WHITESPACE:Te,CUSTOM_ELEMENT:ve}=u0;let{IS_ALLOWED_URI:Ue}=u0,ne=null;const Ee=et({},[...o0,...uf,...hf,...ff,...l0]);let Re=null;const xt=et({},[...a0,...df,...c0,...oc]);let H=Object.seal(wk(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pe=null,Ye=null,Tt=!0,yt=!0,wt=!1,Qt=!0,Ke=!1,Ut=!0,ct=!1,qe=!1,Mt=!1,ei=!1,ti=!1,Ri=!1,za=!0,jo=!1,ns=!0,vr=!1,gi={},wr=null;const qo=et({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Va=null;const Go=et({},["audio","video","img","source","image","track"]);let Ho=null;const Ua=et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),is="http://www.w3.org/1998/Math/MathML",Fs="http://www.w3.org/2000/svg",Oi="http://www.w3.org/1999/xhtml";let pt=Oi,rs=!1,ss=null;const Ph=et({},[is,Fs,Oi],af);let er=et({},["mi","mo","mn","ms","mtext"]),yr=et({},["annotation-xml"]);const bi=et({},["title","style","font","a","script"]);let os=null;const Ah=["application/xhtml+xml","text/html"];let E=null,L=null;const F=n.createElement("form"),j=function(Z){return Z instanceof RegExp||Z instanceof Function},ae=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!L||L!==Z){if(Z&&typeof Z=="object"||(Z={}),Z=nr(Z),os=Ah.indexOf(Z.PARSER_MEDIA_TYPE)===-1?"text/html":Z.PARSER_MEDIA_TYPE,E=os==="application/xhtml+xml"?af:zc,ne=ki(Z,"ALLOWED_TAGS")?et({},Z.ALLOWED_TAGS,E):Ee,Re=ki(Z,"ALLOWED_ATTR")?et({},Z.ALLOWED_ATTR,E):xt,ss=ki(Z,"ALLOWED_NAMESPACES")?et({},Z.ALLOWED_NAMESPACES,af):Ph,Ho=ki(Z,"ADD_URI_SAFE_ATTR")?et(nr(Ua),Z.ADD_URI_SAFE_ATTR,E):Ua,Va=ki(Z,"ADD_DATA_URI_TAGS")?et(nr(Go),Z.ADD_DATA_URI_TAGS,E):Go,wr=ki(Z,"FORBID_CONTENTS")?et({},Z.FORBID_CONTENTS,E):qo,Pe=ki(Z,"FORBID_TAGS")?et({},Z.FORBID_TAGS,E):nr({}),Ye=ki(Z,"FORBID_ATTR")?et({},Z.FORBID_ATTR,E):nr({}),gi=!!ki(Z,"USE_PROFILES")&&Z.USE_PROFILES,Tt=Z.ALLOW_ARIA_ATTR!==!1,yt=Z.ALLOW_DATA_ATTR!==!1,wt=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,Qt=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ke=Z.SAFE_FOR_TEMPLATES||!1,Ut=Z.SAFE_FOR_XML!==!1,ct=Z.WHOLE_DOCUMENT||!1,ei=Z.RETURN_DOM||!1,ti=Z.RETURN_DOM_FRAGMENT||!1,Ri=Z.RETURN_TRUSTED_TYPE||!1,Mt=Z.FORCE_BODY||!1,za=Z.SANITIZE_DOM!==!1,jo=Z.SANITIZE_NAMED_PROPS||!1,ns=Z.KEEP_CONTENT!==!1,vr=Z.IN_PLACE||!1,Ue=Z.ALLOWED_URI_REGEXP||yk,pt=Z.NAMESPACE||Oi,er=Z.MATHML_TEXT_INTEGRATION_POINTS||er,yr=Z.HTML_INTEGRATION_POINTS||yr,H=Z.CUSTOM_ELEMENT_HANDLING||{},Z.CUSTOM_ELEMENT_HANDLING&&j(Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&j(Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&typeof Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(H.allowCustomizedBuiltInElements=Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ke&&(yt=!1),ti&&(ei=!0),gi&&(ne=et({},l0),Re=[],gi.html===!0&&(et(ne,o0),et(Re,a0)),gi.svg===!0&&(et(ne,uf),et(Re,df),et(Re,oc)),gi.svgFilters===!0&&(et(ne,hf),et(Re,df),et(Re,oc)),gi.mathMl===!0&&(et(ne,ff),et(Re,c0),et(Re,oc))),Z.ADD_TAGS&&(ne===Ee&&(ne=nr(ne)),et(ne,Z.ADD_TAGS,E)),Z.ADD_ATTR&&(Re===xt&&(Re=nr(Re)),et(Re,Z.ADD_ATTR,E)),Z.ADD_URI_SAFE_ATTR&&et(Ho,Z.ADD_URI_SAFE_ATTR,E),Z.FORBID_CONTENTS&&(wr===qo&&(wr=nr(wr)),et(wr,Z.FORBID_CONTENTS,E)),ns&&(ne["#text"]=!0),ct&&et(ne,["html","head","body"]),ne.table&&(et(ne,["tbody"]),delete Pe.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw ol('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ol('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=Z.TRUSTED_TYPES_POLICY,Q=k.createHTML("")}else k===void 0&&(k=function(Ce,ge){if(typeof Ce!="object"||typeof Ce.createPolicy!="function")return null;let Je=null;const ot="data-tt-policy-suffix";ge&&ge.hasAttribute(ot)&&(Je=ge.getAttribute(ot));const ze="dompurify"+(Je?"#"+Je:"");try{return Ce.createPolicy(ze,{createHTML:Wt=>Wt,createScriptURL:Wt=>Wt})}catch{return console.warn("TrustedTypes policy "+ze+" could not be created."),null}}(m,s)),k!==null&&typeof Q=="string"&&(Q=k.createHTML(""));An&&An(Z),L=Z}},be=et({},[...uf,...hf,...qR]),We=et({},[...ff,...GR]),we=function(Z){rl(t.removed,{element:Z});try{_(Z).removeChild(Z)}catch{b(Z)}},Ne=function(Z,Ce){try{rl(t.removed,{attribute:Ce.getAttributeNode(Z),from:Ce})}catch{rl(t.removed,{attribute:null,from:Ce})}if(Ce.removeAttribute(Z),Z==="is")if(ei||ti)try{we(Ce)}catch{}else try{Ce.setAttribute(Z,"")}catch{}},_e=function(Z){let Ce=null,ge=null;if(Mt)Z=""+Z;else{const ze=cf(Z,/^[\r\n\t ]+/);ge=ze&&ze[0]}os==="application/xhtml+xml"&&pt===Oi&&(Z=''+Z+"");const Je=k?k.createHTML(Z):Z;if(pt===Oi)try{Ce=new d().parseFromString(Je,os)}catch{}if(!Ce||!Ce.documentElement){Ce=x.createDocument(pt,"template",null);try{Ce.documentElement.innerHTML=rs?Q:Je}catch{}}const ot=Ce.body||Ce.documentElement;return Z&&ge&&ot.insertBefore(n.createTextNode(ge),ot.childNodes[0]||null),pt===Oi?$.call(Ce,ct?"html":"body")[0]:ct?Ce.documentElement:ot},Me=function(Z){return C.call(Z.ownerDocument||Z,Z,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ht=function(Z){return Z instanceof f&&(typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||!(Z.attributes instanceof h)||typeof Z.removeAttribute!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function")},Nn=function(Z){return typeof a=="function"&&Z instanceof a};function Lt(Z,Ce,ge){sc(Z,Je=>{Je.call(t,Ce,ge,L)})}const kr=function(Z){let Ce=null;if(Lt(B.beforeSanitizeElements,Z,null),ht(Z))return we(Z),!0;const ge=E(Z.nodeName);if(Lt(B.uponSanitizeElement,Z,{tagName:ge,allowedTags:ne}),Ut&&Z.hasChildNodes()&&!Nn(Z.firstElementChild)&&wn(/<[/\w!]/g,Z.innerHTML)&&wn(/<[/\w!]/g,Z.textContent)||Z.nodeType===l4||Ut&&Z.nodeType===a4&&wn(/<[/\w]/g,Z.data))return we(Z),!0;if(!ne[ge]||Pe[ge]){if(!Pe[ge]&&ja(ge)&&(H.tagNameCheck instanceof RegExp&&wn(H.tagNameCheck,ge)||H.tagNameCheck instanceof Function&&H.tagNameCheck(ge)))return!1;if(ns&&!wr[ge]){const Je=_(Z)||Z.parentNode,ot=S(Z)||Z.childNodes;if(ot&&Je)for(let ze=ot.length-1;ze>=0;--ze){const Wt=g(ot[ze],!0);Wt.__removalCount=(Z.__removalCount||0)+1,Je.insertBefore(Wt,w(Z))}}return we(Z),!0}return Z instanceof c&&!function(Je){let ot=_(Je);ot&&ot.tagName||(ot={namespaceURI:pt,tagName:"template"});const ze=zc(Je.tagName),Wt=zc(ot.tagName);return!!ss[Je.namespaceURI]&&(Je.namespaceURI===Fs?ot.namespaceURI===Oi?ze==="svg":ot.namespaceURI===is?ze==="svg"&&(Wt==="annotation-xml"||er[Wt]):!!be[ze]:Je.namespaceURI===is?ot.namespaceURI===Oi?ze==="math":ot.namespaceURI===Fs?ze==="math"&&yr[Wt]:!!We[ze]:Je.namespaceURI===Oi?!(ot.namespaceURI===Fs&&!yr[Wt])&&!(ot.namespaceURI===is&&!er[Wt])&&!We[ze]&&(bi[ze]||!be[ze]):!(os!=="application/xhtml+xml"||!ss[Je.namespaceURI]))}(Z)?(we(Z),!0):ge!=="noscript"&&ge!=="noembed"&&ge!=="noframes"||!wn(/<\/no(script|embed|frames)/i,Z.innerHTML)?(Ke&&Z.nodeType===o4&&(Ce=Z.textContent,sc([J,te,ie],Je=>{Ce=sl(Ce,Je," ")}),Z.textContent!==Ce&&(rl(t.removed,{element:Z.cloneNode()}),Z.textContent=Ce)),Lt(B.afterSanitizeElements,Z,null),!1):(we(Z),!0)},tr=function(Z,Ce,ge){if(za&&(Ce==="id"||Ce==="name")&&(ge in n||ge in F))return!1;if(!(yt&&!Ye[Ce]&&wn(le,Ce))){if(!(Tt&&wn(X,Ce))){if(!Re[Ce]||Ye[Ce]){if(!(ja(Z)&&(H.tagNameCheck instanceof RegExp&&wn(H.tagNameCheck,Z)||H.tagNameCheck instanceof Function&&H.tagNameCheck(Z))&&(H.attributeNameCheck instanceof RegExp&&wn(H.attributeNameCheck,Ce)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(Ce,Z))||Ce==="is"&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&wn(H.tagNameCheck,ge)||H.tagNameCheck instanceof Function&&H.tagNameCheck(ge))))return!1}else if(!Ho[Ce]){if(!wn(Ue,sl(ge,Te,""))){if((Ce!=="src"&&Ce!=="xlink:href"&&Ce!=="href"||Z==="script"||VR(ge,"data:")!==0||!Va[Z])&&!(wt&&!wn(ee,sl(ge,Te,"")))){if(ge)return!1}}}}}return!0},ja=function(Z){return Z!=="annotation-xml"&&cf(Z,ve)},Ys=function(Z){Lt(B.beforeSanitizeAttributes,Z,null);const{attributes:Ce}=Z;if(!Ce||ht(Z))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let Je=Ce.length;for(;Je--;){const ot=Ce[Je],{name:ze,namespaceURI:Wt,value:Sr}=ot,vi=E(ze),Th=Sr;let rn=ze==="value"?Th:UR(Th);if(ge.attrName=vi,ge.attrValue=rn,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Lt(B.uponSanitizeAttribute,Z,ge),rn=ge.attrValue,!jo||vi!=="id"&&vi!=="name"||(Ne(ze,Z),rn="user-content-"+rn),Ut&&wn(/((--!?|])>)|<\/(style|title|textarea)/i,rn)){Ne(ze,Z);continue}if(vi==="attributename"&&cf(rn,"href")){Ne(ze,Z);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){Ne(ze,Z);continue}if(!Qt&&wn(/\/>/i,rn)){Ne(ze,Z);continue}Ke&&sc([J,te,ie],eg=>{rn=sl(rn,eg," ")});const Jp=E(Z.nodeName);if(tr(Jp,vi,rn)){if(k&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Wt)switch(m.getAttributeType(Jp,vi)){case"TrustedHTML":rn=k.createHTML(rn);break;case"TrustedScriptURL":rn=k.createScriptURL(rn)}if(rn!==Th)try{Wt?Z.setAttributeNS(Wt,ze,rn):Z.setAttribute(ze,rn),ht(Z)?we(Z):r0(t.removed)}catch{Ne(ze,Z)}}else Ne(ze,Z)}Lt(B.afterSanitizeAttributes,Z,null)},xh=function Z(Ce){let ge=null;const Je=Me(Ce);for(Lt(B.beforeSanitizeShadowDOM,Ce,null);ge=Je.nextNode();)Lt(B.uponSanitizeShadowNode,ge,null),kr(ge),Ys(ge),ge.content instanceof o&&Z(ge.content);Lt(B.afterSanitizeShadowDOM,Ce,null)};return t.sanitize=function(Z){let Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ge=null,Je=null,ot=null,ze=null;if(rs=!Z,rs&&(Z=""),typeof Z!="string"&&!Nn(Z)){if(typeof Z.toString!="function")throw ol("toString is not a function");if(typeof(Z=Z.toString())!="string")throw ol("dirty is not a string, aborting")}if(!t.isSupported)return Z;if(qe||ae(Ce),t.removed=[],typeof Z=="string"&&(vr=!1),vr){if(Z.nodeName){const vi=E(Z.nodeName);if(!ne[vi]||Pe[vi])throw ol("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof a)ge=_e(""),Je=ge.ownerDocument.importNode(Z,!0),Je.nodeType===s4&&Je.nodeName==="BODY"||Je.nodeName==="HTML"?ge=Je:ge.appendChild(Je);else{if(!ei&&!Ke&&!ct&&Z.indexOf("<")===-1)return k&&Ri?k.createHTML(Z):Z;if(ge=_e(Z),!ge)return ei?null:Ri?Q:""}ge&&Mt&&we(ge.firstChild);const Wt=Me(vr?Z:ge);for(;ot=Wt.nextNode();)kr(ot),Ys(ot),ot.content instanceof o&&xh(ot.content);if(vr)return Z;if(ei){if(ti)for(ze=M.call(ge.ownerDocument);ge.firstChild;)ze.appendChild(ge.firstChild);else ze=ge;return(Re.shadowroot||Re.shadowrootmode)&&(ze=N.call(r,ze,!0)),ze}let Sr=ct?ge.outerHTML:ge.innerHTML;return ct&&ne["!doctype"]&&ge.ownerDocument&&ge.ownerDocument.doctype&&ge.ownerDocument.doctype.name&&wn(kk,ge.ownerDocument.doctype.name)&&(Sr=" -`+Sr),Ke&&sc([J,te,ie],vi=>{Sr=sl(Sr,vi," ")}),k&&Ri?k.createHTML(Sr):Sr},t.setConfig=function(){ae(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),qe=!0},t.clearConfig=function(){L=null,qe=!1},t.isValidAttribute=function(Z,Ce,ge){L||ae({});const Je=E(Z),ot=E(Ce);return tr(Je,ot,ge)},t.addHook=function(Z,Ce){typeof Ce=="function"&&rl(B[Z],Ce)},t.removeHook=function(Z,Ce){if(Ce!==void 0){const ge=YR(B[Z],Ce);return ge===-1?void 0:zR(B[Z],ge,1)[0]}return r0(B[Z])},t.removeHooks=function(Z){B[Z]=[]},t.removeAllHooks=function(){B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},t}();Po.addHook("uponSanitizeAttribute",function(i,e){if(e.attrName==="data-trix-serialized-attributes")return void(e.keepAttr=!1);/^data-trix-/.test(e.attrName)&&(e.forceKeepAttr=!0)});const h4="style href src width height language class".split(" "),f4="javascript:".split(" "),d4="script iframe form noscript".split(" ");class lh extends Kt{static setHTML(e,t,n){const r=new this(t,n).sanitize(),s=r.getHTML?r.getHTML():r.outerHTML;e.innerHTML=s}static sanitize(e,t){const n=new this(e,t);return n.sanitize(),n}constructor(e){let{allowedAttributes:t,forbiddenProtocols:n,forbiddenElements:r,purifyOptions:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.allowedAttributes=t||h4,this.forbiddenProtocols=n||f4,this.forbiddenElements=r||d4,this.purifyOptions=s||{},this.body=m4(e)}sanitize(){this.sanitizeElements(),this.normalizeListElementNesting();const e=Object.assign({},sk,this.purifyOptions);return Po.setConfig(e),this.body=Po.sanitize(this.body),this.body}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){const e=vu(this.body),t=[];for(;e.nextNode();){const n=e.currentNode;switch(n.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(n)?t.push(n):this.sanitizeElement(n);break;case Node.COMMENT_NODE:t.push(n)}}return t.forEach(n=>Vr(n)),this.body}sanitizeElement(e){return e.hasAttribute("href")&&this.forbiddenProtocols.includes(e.protocol)&&e.removeAttribute("href"),Array.from(e.attributes).forEach(t=>{let{name:n}=t;this.allowedAttributes.includes(n)||n.indexOf("data-trix")===0||e.removeAttribute(n)}),e}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach(e=>{const t=e.previousElementSibling;t&&kn(t)==="li"&&t.appendChild(e)}),this.body}elementIsRemovable(e){if((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE)return this.elementIsForbidden(e)||this.elementIsntSerializable(e)}elementIsForbidden(e){return this.forbiddenElements.includes(kn(e))}elementIsntSerializable(e){return e.getAttribute("data-trix-serialize")==="false"&&!_s(e)}}const m4=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";i=i.replace(/<\/html[^>]*>[^]*$/i,"");const e=document.implementation.createHTMLDocument("");return e.documentElement.innerHTML=i,Array.from(e.head.querySelectorAll("style")).forEach(t=>{e.body.appendChild(t)}),e.body},{css:Cr}=$a;class sp extends Ns{constructor(){super(...arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}createContentNodes(){return[]}createNodes(){let e;const t=e=Ge({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),n=this.getHref();return n&&(e=Ge({tagName:"a",editable:!1,attributes:{href:n,tabindex:-1}}),t.appendChild(e)),this.attachment.hasContent()?lh.setHTML(e,this.attachment.getContent()):this.createContentNodes().forEach(r=>{e.appendChild(r)}),e.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=Ge({tagName:"progress",attributes:{class:Cr.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),t.appendChild(this.progressElement)),[h0("left"),t,h0("right")]}createCaptionElement(){const e=Ge({tagName:"figcaption",className:Cr.attachmentCaption}),t=this.attachmentPiece.getCaption();if(t)e.classList.add("".concat(Cr.attachmentCaption,"--edited")),e.textContent=t;else{let n,r;const s=this.getCaptionConfig();if(s.name&&(n=this.attachment.getFilename()),s.size&&(r=this.attachment.getFormattedFilesize()),n){const o=Ge({tagName:"span",className:Cr.attachmentName,textContent:n});e.appendChild(o)}if(r){n&&e.appendChild(document.createTextNode(" "));const o=Ge({tagName:"span",className:Cr.attachmentSize,textContent:r});e.appendChild(o)}}return e}getClassName(){const e=[Cr.attachment,"".concat(Cr.attachment,"--").concat(this.attachment.getType())],t=this.attachment.getExtension();return t&&e.push("".concat(Cr.attachment,"--").concat(t)),e.join(" ")}getData(){const e={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},{attributes:t}=this.attachmentPiece;return t.isEmpty()||(e.trixAttributes=JSON.stringify(t)),this.attachment.isPending()&&(e.trixSerialize=!1),e}getHref(){if(!p4(this.attachment.getContent(),"a")){const e=this.attachment.getHref();if(e&&Po.isValidAttribute("a","href",e))return e}}getCaptionConfig(){var e;const t=this.attachment.getType(),n=pk((e=Gm[t])===null||e===void 0?void 0:e.caption);return t==="file"&&(n.name=!0),n}findProgressElement(){var e;return(e=this.findElement())===null||e===void 0?void 0:e.querySelector("progress")}attachmentDidChangeUploadProgress(){const e=this.attachment.getUploadProgress(),t=this.findProgressElement();t&&(t.value=e)}}const h0=i=>Ge({tagName:"span",textContent:oh,data:{trixCursorTarget:i,trixSerialize:!1}}),p4=function(i,e){const t=Ge("div");return lh.setHTML(t,i||""),t.querySelector(e)};class Sk extends sp{constructor(){super(...arguments),this.attachment.previewDelegate=this}createContentNodes(){return this.image=Ge({tagName:"img",attributes:{src:""},data:{trixMutable:!0}}),this.refresh(this.image),[this.image]}createCaptionElement(){const e=super.createCaptionElement(...arguments);return e.textContent||e.setAttribute("data-trix-placeholder",Ve.captionPlaceholder),e}refresh(e){var t;if(e||(e=(t=this.findElement())===null||t===void 0?void 0:t.querySelector("img")),e)return this.updateAttributesForImage(e)}updateAttributesForImage(e){const t=this.attachment.getURL(),n=this.attachment.getPreviewURL();if(e.src=n||t,n===t)e.removeAttribute("data-trix-serialized-attributes");else{const a=JSON.stringify({src:t});e.setAttribute("data-trix-serialized-attributes",a)}const r=this.attachment.getWidth(),s=this.attachment.getHeight(),o=this.attachment.getAttribute("alt");r!=null&&(e.width=r),s!=null&&(e.height=s),o!=null&&(e.alt=o);const l=["imageElement",this.attachment.id,e.src,e.width,e.height].join("/");e.dataset.trixStoreKey=l}attachmentDidChangeAttributes(){return this.refresh(this.image),this.refresh()}}class _k extends Ns{constructor(){super(...arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),this.textConfig=this.options.textConfig,this.context=this.options.context,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}createNodes(){let e=this.attachment?this.createAttachmentNodes():this.createStringNodes();const t=this.createElement();if(t){const n=function(r){for(;(s=r)!==null&&s!==void 0&&s.firstElementChild;){var s;r=r.firstElementChild}return r}(t);Array.from(e).forEach(r=>{n.appendChild(r)}),e=[t]}return e}createAttachmentNodes(){const e=this.attachment.isPreviewable()?Sk:sp;return this.createChildView(e,this.piece.attachment,{piece:this.piece}).getNodes()}createStringNodes(){var e;if((e=this.textConfig)!==null&&e!==void 0&&e.plaintext)return[document.createTextNode(this.string)];{const t=[],n=this.string.split(` -`);for(let r=0;r0){const o=Ge("br");t.push(o)}if(s.length){const o=document.createTextNode(this.preserveSpaces(s));t.push(o)}}return t}}createElement(){let e,t,n;const r={};for(t in this.attributes){n=this.attributes[t];const o=Ad(t);if(o){if(o.tagName){var s;const l=Ge(o.tagName);s?(s.appendChild(l),s=l):e=s=l}if(o.styleProperty&&(r[o.styleProperty]=n),o.style)for(t in o.style)n=o.style[t],r[t]=n}}if(Object.keys(r).length)for(t in e||(e=Ge("span")),r)n=r[t],e.style[t]=n;return e}createContainerElement(){for(const e in this.attributes){const t=this.attributes[e],n=Ad(e);if(n&&n.groupTagName){const r={};return r[e]=t,Ge(n.groupTagName,r)}}}preserveSpaces(e){return this.context.isLast&&(e=e.replace(/\ $/,Rr)),e=e.replace(/(\S)\ {3}(\S)/g,"$1 ".concat(Rr," $2")).replace(/\ {2}/g,"".concat(Rr," ")).replace(/\ {2}/g," ".concat(Rr)),(this.context.isFirst||this.context.followsWhitespace)&&(e=e.replace(/^\ /,Rr)),e}}class Ck extends Ns{constructor(){super(...arguments),this.text=this.object,this.textConfig=this.options.textConfig}createNodes(){const e=[],t=rp.groupObjects(this.getPieces()),n=t.length-1;for(let s=0;s!e.hasAttribute("blockBreak"))}}const g4=i=>/\s$/.test(i==null?void 0:i.toString()),{css:f0}=$a;class Pk extends Ns{constructor(){super(...arguments),this.block=this.object,this.attributes=this.block.getAttributes()}createNodes(){const e=[document.createComment("block")];if(this.block.isEmpty())e.push(Ge("br"));else{var t;const n=(t=zt(this.block.getLastAttribute()))===null||t===void 0?void 0:t.text,r=this.findOrCreateCachedChildView(Ck,this.block.text,{textConfig:n});e.push(...Array.from(r.getNodes()||[])),this.shouldAddExtraNewlineElement()&&e.push(Ge("br"))}if(this.attributes.length)return e;{let n;const{tagName:r}=Sn.default;this.block.isRTL()&&(n={dir:"rtl"});const s=Ge({tagName:r,attributes:n});return e.forEach(o=>s.appendChild(o)),[s]}}createContainerElement(e){const t={};let n;const r=this.attributes[e],{tagName:s,htmlAttributes:o=[]}=zt(r);if(e===0&&this.block.isRTL()&&Object.assign(t,{dir:"rtl"}),r==="attachmentGallery"){const l=this.block.getBlockBreakPosition();n="".concat(f0.attachmentGallery," ").concat(f0.attachmentGallery,"--").concat(l)}return Object.entries(this.block.htmlAttributes).forEach(l=>{let[a,c]=l;o.includes(a)&&(t[a]=c)}),Ge({tagName:s,className:n,attributes:t})}shouldAddExtraNewlineElement(){return/\n\n$/.test(this.block.toString())}}class ah extends Ns{static render(e){const t=Ge("div"),n=new this(e,{element:t});return n.render(),n.sync(),t}constructor(){super(...arguments),this.element=this.options.element,this.elementStore=new ZR,this.setDocument(this.object)}setDocument(e){e.isEqualTo(this.document)||(this.document=this.object=e)}render(){if(this.childViews=[],this.shadowElement=Ge("div"),!this.document.isEmpty()){const e=rp.groupObjects(this.document.getBlocks(),{asTree:!0});Array.from(e).forEach(t=>{const n=this.findOrCreateCachedChildView(Pk,t);Array.from(n.getNodes()).map(r=>this.shadowElement.appendChild(r))})}}isSynced(){return O4(this.shadowElement,this.element)}sync(){const e=ak("trix-before-render",{cancelable:!1,attributes:{render:(n,r)=>{for(;n.lastChild;)n.removeChild(n.lastChild);n.appendChild(r)}}});this.element.dispatchEvent(e);const t=this.createDocumentFragmentForSync();return e.render(this.element,t),this.didSync()}didSync(){return this.elementStore.reset(d0(this.element)),tp(()=>this.garbageCollectCachedViews())}createDocumentFragmentForSync(){const e=document.createDocumentFragment();return Array.from(this.shadowElement.childNodes).forEach(t=>{e.appendChild(t.cloneNode(!0))}),Array.from(d0(e)).forEach(t=>{const n=this.elementStore.remove(t);n&&t.parentNode.replaceChild(n,t)}),e}}const d0=i=>i.querySelectorAll("[data-trix-store-key]"),O4=(i,e)=>m0(i.innerHTML)===m0(e.innerHTML),m0=i=>i.replace(/ /g," ");function b4(i){var e=function(t,n){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,n);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}(i,"string");return typeof e=="symbol"?e:String(e)}function gn(i,e,t){return(e=b4(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function rt(i,e){return v4(i,Ak(i,e,"get"))}function Bl(i,e,t){return w4(i,Ak(i,e,"set"),t),t}function Ak(i,e,t){if(!e.has(i))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(i)}function v4(i,e){return e.get?e.get.call(i):e.value}function w4(i,e,t){if(e.set)e.set.call(i,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function lc(i,e,t){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return t}function xk(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mo(i,e,t){xk(i,e),e.set(i,t)}class Zs extends Is{static registerType(e,t){t.type=e,this.types[e]=t}static fromJSON(e){const t=this.types[e.type];if(t)return t.fromJSON(e)}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.attributes=Kn.box(t)}copyWithAttributes(e){return new this.constructor(this.getValue(),e)}copyWithAdditionalAttributes(e){return this.copyWithAttributes(this.attributes.merge(e))}copyWithoutAttribute(e){return this.copyWithAttributes(this.attributes.remove(e))}copy(){return this.copyWithAttributes(this.attributes)}getAttribute(e){return this.attributes.get(e)}getAttributesHash(){return this.attributes}getAttributes(){return this.attributes.toObject()}hasAttribute(e){return this.attributes.has(e)}hasSameStringValueAsPiece(e){return e&&this.toString()===e.toString()}hasSameAttributesAsPiece(e){return e&&(this.attributes===e.attributes||this.attributes.isEqualTo(e.attributes))}isBlockBreak(){return!1}isEqualTo(e){return super.isEqualTo(...arguments)||this.hasSameConstructorAs(e)&&this.hasSameStringValueAsPiece(e)&&this.hasSameAttributesAsPiece(e)}isEmpty(){return this.length===0}isSerializable(){return!0}toJSON(){return{type:this.constructor.type,attributes:this.getAttributes()}}contentsForInspection(){return{type:this.constructor.type,attributes:this.attributes.inspect()}}canBeGrouped(){return this.hasAttribute("href")}canBeGroupedWith(e){return this.getAttribute("href")===e.getAttribute("href")}getLength(){return this.length}canBeConsolidatedWith(e){return!1}}gn(Zs,"types",{});class Tk extends yu{constructor(e){super(...arguments),this.url=e}perform(e){const t=new Image;t.onload=()=>(t.width=this.width=t.naturalWidth,t.height=this.height=t.naturalHeight,e(!0,t)),t.onerror=()=>e(!1),t.src=this.url}}class Fo extends Is{static attachmentForFile(e){const t=new this(this.attributesForFile(e));return t.setFile(e),t}static attributesForFile(e){return new Kn({filename:e.name,filesize:e.size,contentType:e.type})}static fromJSON(e){return new this(e)}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(e),this.releaseFile=this.releaseFile.bind(this),this.attributes=Kn.box(e),this.didChangeAttributes()}setAttribute(e,t){this.setAttributes({[e]:t})}getAttribute(e){return this.attributes.get(e)}hasAttribute(e){return this.attributes.has(e)}getAttributes(){return this.attributes.toObject()}setAttributes(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=this.attributes.merge(e);var n,r,s,o;if(!this.attributes.isEqualTo(t))return this.attributes=t,this.didChangeAttributes(),(n=this.previewDelegate)===null||n===void 0||(r=n.attachmentDidChangeAttributes)===null||r===void 0||r.call(n,this),(s=this.delegate)===null||s===void 0||(o=s.attachmentDidChangeAttributes)===null||o===void 0?void 0:o.call(s,this)}didChangeAttributes(){if(this.isPreviewable())return this.preloadURL()}isPending(){return this.file!=null&&!(this.getURL()||this.getHref())}isPreviewable(){return this.attributes.has("previewable")?this.attributes.get("previewable"):Fo.previewablePattern.test(this.getContentType())}getType(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"}getURL(){return this.attributes.get("url")}getHref(){return this.attributes.get("href")}getFilename(){return this.attributes.get("filename")||""}getFilesize(){return this.attributes.get("filesize")}getFormattedFilesize(){const e=this.attributes.get("filesize");return typeof e=="number"?ok.formatter(e):""}getExtension(){var e;return(e=this.getFilename().match(/\.(\w+)$/))===null||e===void 0?void 0:e[1].toLowerCase()}getContentType(){return this.attributes.get("contentType")}hasContent(){return this.attributes.has("content")}getContent(){return this.attributes.get("content")}getWidth(){return this.attributes.get("width")}getHeight(){return this.attributes.get("height")}getFile(){return this.file}setFile(e){if(this.file=e,this.isPreviewable())return this.preloadFile()}releaseFile(){this.releasePreloadedFile(),this.file=null}getUploadProgress(){return this.uploadProgress!=null?this.uploadProgress:0}setUploadProgress(e){var t,n;if(this.uploadProgress!==e)return this.uploadProgress=e,(t=this.uploadProgressDelegate)===null||t===void 0||(n=t.attachmentDidChangeUploadProgress)===null||n===void 0?void 0:n.call(t,this)}toJSON(){return this.getAttributes()}getCacheKey(){return[super.getCacheKey(...arguments),this.attributes.getCacheKey(),this.getPreviewURL()].join("/")}getPreviewURL(){return this.previewURL||this.preloadingURL}setPreviewURL(e){var t,n,r,s;if(e!==this.getPreviewURL())return this.previewURL=e,(t=this.previewDelegate)===null||t===void 0||(n=t.attachmentDidChangeAttributes)===null||n===void 0||n.call(t,this),(r=this.delegate)===null||r===void 0||(s=r.attachmentDidChangePreviewURL)===null||s===void 0?void 0:s.call(r,this)}preloadURL(){return this.preload(this.getURL(),this.releaseFile)}preloadFile(){if(this.file)return this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)}releasePreloadedFile(){this.fileObjectURL&&(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null)}preload(e,t){if(e&&e!==this.getPreviewURL())return this.preloadingURL=e,new Tk(e).then(n=>{let{width:r,height:s}=n;return this.getWidth()&&this.getHeight()||this.setAttributes({width:r,height:s}),this.preloadingURL=null,this.setPreviewURL(e),t==null?void 0:t()}).catch(()=>(this.preloadingURL=null,t==null?void 0:t()))}}gn(Fo,"previewablePattern",/^image(\/(gif|png|webp|jpe?g)|$)/);class Ao extends Zs{static fromJSON(e){return new this(Fo.fromJSON(e.attachment),e.attributes)}constructor(e){super(...arguments),this.attachment=e,this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href"),this.attachment.hasContent()||this.removeProhibitedAttributes()}ensureAttachmentExclusivelyHasAttribute(e){this.hasAttribute(e)&&(this.attachment.hasAttribute(e)||this.attachment.setAttributes(this.attributes.slice([e])),this.attributes=this.attributes.remove(e))}removeProhibitedAttributes(){const e=this.attributes.slice(Ao.permittedAttributes);e.isEqualTo(this.attributes)||(this.attributes=e)}getValue(){return this.attachment}isSerializable(){return!this.attachment.isPending()}getCaption(){return this.attributes.get("caption")||""}isEqualTo(e){var t;return super.isEqualTo(e)&&this.attachment.id===(e==null||(t=e.attachment)===null||t===void 0?void 0:t.id)}toString(){return""}toJSON(){const e=super.toJSON(...arguments);return e.attachment=this.attachment,e}getCacheKey(){return[super.getCacheKey(...arguments),this.attachment.getCacheKey()].join("/")}toConsole(){return JSON.stringify(this.toString())}}gn(Ao,"permittedAttributes",["caption","presentation"]),Zs.registerType("attachment",Ao);class op extends Zs{static fromJSON(e){const t={...e.attributes};return t.href&&!Po.isValidAttribute("a","href",t.href)&&delete t.href,new this(e.string,t)}constructor(e){super(...arguments),this.string=(t=>t.replace(/\r\n?/g,` + `)};const Sd={interval:5e3};var $a=Object.freeze({__proto__:null,attachments:jm,blockAttributes:Sn,browser:Da,css:{attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"},dompurify:Hy,fileSize:Ky,input:Hm,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:Ve,parser:Fc,textAttributes:xs,toolbar:ik,undo:Sd});class Kt{static proxyMethod(e){const{name:t,toMethod:n,toProperty:r,optional:s}=dR(e);this.prototype[t]=function(){let o,l;var a,c;return n?l=s?(a=this[n])===null||a===void 0?void 0:a.call(this):this[n]():r&&(l=this[r]),s?(o=(c=l)===null||c===void 0?void 0:c[t],o?W1.call(o,l,arguments):void 0):(o=l[t],W1.call(o,l,arguments))}}}const dR=function(i){const e=i.match(mR);if(!e)throw new Error("can't parse @proxyMethod expression: ".concat(i));const t={name:e[4]};return e[2]!=null?t.toMethod=e[1]:t.toProperty=e[1],e[3]!=null&&(t.optional=!0),t},{apply:W1}=Function.prototype,mR=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$");var ef,tf,nf;class sa extends Kt{static box(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return e instanceof this?e:this.fromUCS2String(e==null?void 0:e.toString())}static fromUCS2String(e){return new this(e,_d(e))}static fromCodepoints(e){return new this(Cd(e),e)}constructor(e,t){super(...arguments),this.ucs2String=e,this.codepoints=t,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(e){return Cd(this.codepoints.slice(0,Math.max(0,e))).length}offsetFromUCS2Offset(e){return _d(this.ucs2String.slice(0,Math.max(0,e))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(e){return this.slice(e,e+1)}isEqualTo(e){return this.constructor.box(e).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}}const pR=((ef=Array.from)===null||ef===void 0?void 0:ef.call(Array,"👼").length)===1,gR=((tf=" ".codePointAt)===null||tf===void 0?void 0:tf.call(" ",0))!=null,OR=((nf=String.fromCodePoint)===null||nf===void 0?void 0:nf.call(String,32,128124))===" 👼";let _d,Cd;_d=pR&&gR?i=>Array.from(i).map(e=>e.codePointAt(0)):function(i){const e=[];let t=0;const{length:n}=i;for(;tString.fromCodePoint(...Array.from(i||[])):function(i){return(()=>{const e=[];return Array.from(i).forEach(t=>{let n="";t>65535&&(t-=65536,n+=String.fromCharCode(t>>>10&1023|55296),t=56320|1023&t),e.push(n+String.fromCharCode(t))}),e})().join("")};let bR=0;class Ns extends Kt{static fromJSONString(e){return this.fromJSON(JSON.parse(e))}constructor(){super(...arguments),this.id=++bR}hasSameConstructorAs(e){return this.constructor===(e==null?void 0:e.constructor)}isEqualTo(e){return this===e}inspect(){const e=[],t=this.contentsForInspection()||{};for(const n in t){const r=t[n];e.push("".concat(n,"=").concat(r))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(e.length?" ".concat(e.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return sa.box(this)}getCacheKey(){return this.id.toString()}}const Ts=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==e.length)return!1;for(let t=0;t1?t-1:0),r=1;r(rf||(rf=kR().concat(yR())),rf),zt=i=>Sn[i],yR=()=>(sf||(sf=Object.keys(Sn)),sf),Ad=i=>xs[i],kR=()=>(of||(of=Object.keys(xs)),of),rk=function(i,e){SR(i).textContent=e.replace(/%t/g,i)},SR=function(i){const e=document.createElement("style");e.setAttribute("type","text/css"),e.setAttribute("data-tag-name",i.toLowerCase());const t=_R();return t&&e.setAttribute("nonce",t),document.head.insertBefore(e,document.head.firstChild),e},_R=function(){const i=X1("trix-csp-nonce")||X1("csp-nonce");if(i){const{nonce:e,content:t}=i;return e==""?t:e}},X1=i=>document.head.querySelector("meta[name=".concat(i,"]")),F1={"application/x-trix-feature-detection":"test"},sk=function(i){const e=i.getData("text/plain"),t=i.getData("text/html");if(!e||!t)return e==null?void 0:e.length;{const{body:n}=new DOMParser().parseFromString(t,"text/html");if(n.textContent===e)return!n.querySelector("*")}},ok=/Mac|^iP/.test(navigator.platform)?i=>i.metaKey:i=>i.ctrlKey,Jm=i=>setTimeout(i,1),lk=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e={};for(const t in i){const n=i[t];e[t]=n}return e},Fo=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Object.keys(i).length!==Object.keys(e).length)return!1;for(const t in i)if(i[t]!==e[t])return!1;return!0},bt=function(i){if(i!=null)return Array.isArray(i)||(i=[i,i]),[Y1(i[0]),Y1(i[1]!=null?i[1]:i[0])]},or=function(i){if(i==null)return;const[e,t]=bt(i);return xd(e,t)},wu=function(i,e){if(i==null||e==null)return;const[t,n]=bt(i),[r,s]=bt(e);return xd(t,r)&&xd(n,s)},Y1=function(i){return typeof i=="number"?i:lk(i)},xd=function(i,e){return typeof i=="number"?i===e:Fo(i,e)};class ak extends Kt{constructor(){super(...arguments),this.update=this.update.bind(this),this.selectionManagers=[]}start(){this.started||(this.started=!0,document.addEventListener("selectionchange",this.update,!0))}stop(){if(this.started)return this.started=!1,document.removeEventListener("selectionchange",this.update,!0)}registerSelectionManager(e){if(!this.selectionManagers.includes(e))return this.selectionManagers.push(e),this.start()}unregisterSelectionManager(e){if(this.selectionManagers=this.selectionManagers.filter(t=>t!==e),this.selectionManagers.length===0)return this.stop()}notifySelectionManagersOfSelectionChange(){return this.selectionManagers.map(e=>e.selectionDidChange())}update(){this.notifySelectionManagersOfSelectionChange()}reset(){this.update()}}const Qs=new ak,ck=function(){const i=window.getSelection();if(i.rangeCount>0)return i},Bl=function(){var i;const e=(i=ck())===null||i===void 0?void 0:i.getRangeAt(0);if(e&&!CR(e))return e},uk=function(i){const e=window.getSelection();return e.removeAllRanges(),e.addRange(i),Qs.update()},CR=i=>z1(i.startContainer)||z1(i.endContainer),z1=i=>!Object.getPrototypeOf(i),kl=i=>i.replace(new RegExp("".concat(oh),"g"),"").replace(new RegExp("".concat(Rr),"g")," "),ep=new RegExp("[^\\S".concat(Rr,"]")),tp=i=>i.replace(new RegExp("".concat(ep.source),"g")," ").replace(/\ {2,}/g," "),V1=function(i,e){if(i.isEqualTo(e))return["",""];const t=lf(i,e),{length:n}=t.utf16String;let r;if(n){const{offset:s}=t,o=i.codepoints.slice(0,s).concat(i.codepoints.slice(s+n));r=lf(e,sa.fromCodepoints(o))}else r=lf(e,i);return[t.utf16String.toString(),r.utf16String.toString()]},lf=function(i,e){let t=0,n=i.length,r=e.length;for(;tt+1&&i.charAt(n-1).isEqualTo(e.charAt(r-1));)n--,r--;return{utf16String:i.slice(t,n),offset:t}};class Kn extends Ns{static fromCommonAttributesOfObjects(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(!e.length)return new this;let t=rl(e[0]),n=t.getKeys();return e.slice(1).forEach(r=>{n=t.getKeysCommonToHash(rl(r)),t=t.slice(n)}),t}static box(e){return rl(e)}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(...arguments),this.values=Yc(e)}add(e,t){return this.merge(PR(e,t))}remove(e){return new Kn(Yc(this.values,e))}get(e){return this.values[e]}has(e){return e in this.values}merge(e){return new Kn(AR(this.values,xR(e)))}slice(e){const t={};return Array.from(e).forEach(n=>{this.has(n)&&(t[n]=this.values[n])}),new Kn(t)}getKeys(){return Object.keys(this.values)}getKeysCommonToHash(e){return e=rl(e),this.getKeys().filter(t=>this.values[t]===e.values[t])}isEqualTo(e){return Ts(this.toArray(),rl(e).toArray())}isEmpty(){return this.getKeys().length===0}toArray(){if(!this.array){const e=[];for(const t in this.values){const n=this.values[t];e.push(e.push(t,n))}this.array=e.slice(0)}return this.array}toObject(){return Yc(this.values)}toJSON(){return this.toObject()}contentsForInspection(){return{values:JSON.stringify(this.values)}}}const PR=function(i,e){const t={};return t[i]=e,t},AR=function(i,e){const t=Yc(i);for(const n in e){const r=e[n];t[n]=r}return t},Yc=function(i,e){const t={};return Object.keys(i).sort().forEach(n=>{n!==e&&(t[n]=i[n])}),t},rl=function(i){return i instanceof Kn?i:new Kn(i)},xR=function(i){return i instanceof Kn?i.values:i};class np{static groupObjects(){let e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:n,asTree:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r&&n==null&&(n=0);const s=[];return Array.from(t).forEach(o=>{var l;if(e){var a,c,u;if((a=o.canBeGrouped)!==null&&a!==void 0&&a.call(o,n)&&(c=(u=e[e.length-1]).canBeGroupedWith)!==null&&c!==void 0&&c.call(u,o,n))return void e.push(o);s.push(new this(e,{depth:n,asTree:r})),e=null}(l=o.canBeGrouped)!==null&&l!==void 0&&l.call(o,n)?e=[o]:s.push(o)}),e&&s.push(new this(e,{depth:n,asTree:r})),s}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],{depth:t,asTree:n}=arguments.length>1?arguments[1]:void 0;this.objects=e,n&&(this.depth=t,this.objects=this.constructor.groupObjects(this.objects,{asTree:n,depth:this.depth+1}))}getObjects(){return this.objects}getDepth(){return this.depth}getCacheKey(){const e=["objectGroup"];return Array.from(this.getObjects()).forEach(t=>{e.push(t.getCacheKey())}),e.join("/")}}class TR extends Kt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects={},Array.from(e).forEach(t=>{const n=JSON.stringify(t);this.objects[n]==null&&(this.objects[n]=t)})}find(e){const t=JSON.stringify(e);return this.objects[t]}}class QR{constructor(e){this.reset(e)}add(e){const t=U1(e);this.elements[t]=e}remove(e){const t=U1(e),n=this.elements[t];if(n)return delete this.elements[t],n}reset(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return this.elements={},Array.from(e).forEach(t=>{this.add(t)}),e}}const U1=i=>i.dataset.trixStoreKey;let yu=class extends Kt{isPerforming(){return this.performing===!0}hasPerformed(){return this.performed===!0}hasSucceeded(){return this.performed&&this.succeeded}hasFailed(){return this.performed&&!this.succeeded}getPromise(){return this.promise||(this.promise=new Promise((e,t)=>(this.performing=!0,this.perform((n,r)=>{this.succeeded=n,this.performing=!1,this.performed=!0,this.succeeded?e(r):t(r)})))),this.promise}perform(e){return e(!1)}release(){var e,t;(e=this.promise)===null||e===void 0||(t=e.cancel)===null||t===void 0||t.call(e),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null}};yu.proxyMethod("getPromise().then"),yu.proxyMethod("getPromise().catch");class Zs extends Kt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.object=e,this.options=t,this.childViews=[],this.rootView=this}getNodes(){return this.nodes||(this.nodes=this.createNodes()),this.nodes.map(e=>e.cloneNode(!0))}invalidate(){var e;return this.nodes=null,this.childViews=[],(e=this.parentView)===null||e===void 0?void 0:e.invalidate()}invalidateViewForObject(e){var t;return(t=this.findViewForObject(e))===null||t===void 0?void 0:t.invalidate()}findOrCreateCachedChildView(e,t,n){let r=this.getCachedViewForObject(t);return r?this.recordChildView(r):(r=this.createChildView(...arguments),this.cacheViewForObject(r,t)),r}createChildView(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};t instanceof np&&(n.viewClass=e,e=MR);const r=new e(t,n);return this.recordChildView(r)}recordChildView(e){return e.parentView=this,e.rootView=this.rootView,this.childViews.push(e),e}getAllChildViews(){let e=[];return this.childViews.forEach(t=>{e.push(t),e=e.concat(t.getAllChildViews())}),e}findElement(){return this.findElementForObject(this.object)}findElementForObject(e){const t=e==null?void 0:e.id;if(t)return this.rootView.element.querySelector("[data-trix-id='".concat(t,"']"))}findViewForObject(e){for(const t of this.getAllChildViews())if(t.object===e)return t}getViewCache(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?(this.viewCache||(this.viewCache={}),this.viewCache):void 0}isViewCachingEnabled(){return this.shouldCacheViews!==!1}enableViewCaching(){this.shouldCacheViews=!0}disableViewCaching(){this.shouldCacheViews=!1}getCachedViewForObject(e){var t;return(t=this.getViewCache())===null||t===void 0?void 0:t[e.getCacheKey()]}cacheViewForObject(e,t){const n=this.getViewCache();n&&(n[t.getCacheKey()]=e)}garbageCollectCachedViews(){const e=this.getViewCache();if(e){const t=this.getAllChildViews().concat(this).map(n=>n.object.getCacheKey());for(const n in e)t.includes(n)||delete e[n]}}}class MR extends Zs{constructor(){super(...arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}getChildViews(){return this.childViews.length||Array.from(this.objectGroup.getObjects()).forEach(e=>{this.findOrCreateCachedChildView(this.viewClass,e,this.options)}),this.childViews}createNodes(){const e=this.createContainerElement();return this.getChildViews().forEach(t=>{Array.from(t.getNodes()).forEach(n=>{e.appendChild(n)})}),[e]}createContainerElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.objectGroup.getDepth();return this.getChildViews()[0].createContainerElement(e)}}/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */const{entries:hk,setPrototypeOf:j1,isFrozen:ER,getPrototypeOf:RR,getOwnPropertyDescriptor:DR}=Object;let{freeze:An,seal:hi,create:fk}=Object,{apply:Td,construct:Qd}=typeof Reflect<"u"&&Reflect;An||(An=function(i){return i}),hi||(hi=function(i){return i}),Td||(Td=function(i,e){for(var t=arguments.length,n=new Array(t>2?t-2:0),r=2;r1?e-1:0),n=1;n1?t-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:zc;j1&&j1(i,null);let n=e.length;for(;n--;){let r=e[n];if(typeof r=="string"){const s=t(r);s!==r&&(ER(e)||(e[n]=s),r=s)}i[r]=!0}return i}function ZR(i){for(let e=0;e/gm),YR=hi(/\$\{[\w\W]*/gm),zR=hi(/^data-[\-\w.\u00B7-\uFFFF]+$/),VR=hi(/^aria-[\-\w]+$/),dk=hi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),UR=hi(/^(?:\w+script|data):/i),jR=hi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mk=hi(/^html$/i),qR=hi(/^[a-z][.\w]*(-[.\w]+)+$/i);var t0=Object.freeze({__proto__:null,ARIA_ATTR:VR,ATTR_WHITESPACE:jR,CUSTOM_ELEMENT:qR,DATA_ATTR:zR,DOCTYPE_NAME:mk,ERB_EXPR:FR,IS_ALLOWED_URI:dk,IS_SCRIPT_OR_DATA:UR,MUSTACHE_EXPR:XR,TMPLIT_EXPR:YR});const GR=1,HR=3,KR=7,JR=8,e4=9,t4=function(){return typeof window>"u"?null:window};var Ao=function i(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:t4();const t=Z=>i(Z);if(t.version="3.2.7",t.removed=[],!e||!e.document||e.document.nodeType!==e4||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,s=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:a,Element:c,NodeFilter:u,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:m}=e,p=c.prototype,g=al(p,"cloneNode"),v=al(p,"remove"),w=al(p,"nextSibling"),S=al(p,"childNodes"),_=al(p,"parentNode");if(typeof l=="function"){const Z=n.createElement("template");Z.content&&Z.content.ownerDocument&&(n=Z.content.ownerDocument)}let k,A="";const{implementation:C,createNodeIterator:Q,createDocumentFragment:M,getElementsByTagName:L}=n,{importNode:N}=r;let B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};t.isSupported=typeof hk=="function"&&typeof _=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:J,ERB_EXPR:te,TMPLIT_EXPR:ie,DATA_ATTR:ae,ARIA_ATTR:X,IS_SCRIPT_OR_DATA:ee,ATTR_WHITESPACE:Te,CUSTOM_ELEMENT:ve}=t0;let{IS_ALLOWED_URI:je}=t0,ne=null;const Ee=Je({},[...H1,...uf,...hf,...ff,...K1]);let Re=null;const xt=Je({},[...J1,...df,...e0,...oc]);let H=Object.seal(fk(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pe=null,Ye=null,Tt=!0,yt=!0,wt=!1,Qt=!0,He=!1,Ut=!0,ct=!1,qe=!1,Mt=!1,ei=!1,ti=!1,Ri=!1,za=!0,qo=!1,ns=!0,vr=!1,pi={},wr=null;const Go=Je({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Va=null;const Ho=Je({},["audio","video","img","source","image","track"]);let Ko=null;const Ua=Je({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),is="http://www.w3.org/1998/Math/MathML",Ys="http://www.w3.org/2000/svg",gi="http://www.w3.org/1999/xhtml";let pt=gi,rs=!1,ss=null;const Ph=Je({},[is,Ys,gi],af);let er=Je({},["mi","mo","mn","ms","mtext"]),yr=Je({},["annotation-xml"]);const Oi=Je({},["title","style","font","a","script"]);let os=null;const Ah=["application/xhtml+xml","text/html"];let E=null,$=null;const F=n.createElement("form"),j=function(Z){return Z instanceof RegExp||Z instanceof Function},ce=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!$||$!==Z){if(Z&&typeof Z=="object"||(Z={}),Z=nr(Z),os=Ah.indexOf(Z.PARSER_MEDIA_TYPE)===-1?"text/html":Z.PARSER_MEDIA_TYPE,E=os==="application/xhtml+xml"?af:zc,ne=yi(Z,"ALLOWED_TAGS")?Je({},Z.ALLOWED_TAGS,E):Ee,Re=yi(Z,"ALLOWED_ATTR")?Je({},Z.ALLOWED_ATTR,E):xt,ss=yi(Z,"ALLOWED_NAMESPACES")?Je({},Z.ALLOWED_NAMESPACES,af):Ph,Ko=yi(Z,"ADD_URI_SAFE_ATTR")?Je(nr(Ua),Z.ADD_URI_SAFE_ATTR,E):Ua,Va=yi(Z,"ADD_DATA_URI_TAGS")?Je(nr(Ho),Z.ADD_DATA_URI_TAGS,E):Ho,wr=yi(Z,"FORBID_CONTENTS")?Je({},Z.FORBID_CONTENTS,E):Go,Pe=yi(Z,"FORBID_TAGS")?Je({},Z.FORBID_TAGS,E):nr({}),Ye=yi(Z,"FORBID_ATTR")?Je({},Z.FORBID_ATTR,E):nr({}),pi=!!yi(Z,"USE_PROFILES")&&Z.USE_PROFILES,Tt=Z.ALLOW_ARIA_ATTR!==!1,yt=Z.ALLOW_DATA_ATTR!==!1,wt=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,Qt=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,He=Z.SAFE_FOR_TEMPLATES||!1,Ut=Z.SAFE_FOR_XML!==!1,ct=Z.WHOLE_DOCUMENT||!1,ei=Z.RETURN_DOM||!1,ti=Z.RETURN_DOM_FRAGMENT||!1,Ri=Z.RETURN_TRUSTED_TYPE||!1,Mt=Z.FORCE_BODY||!1,za=Z.SANITIZE_DOM!==!1,qo=Z.SANITIZE_NAMED_PROPS||!1,ns=Z.KEEP_CONTENT!==!1,vr=Z.IN_PLACE||!1,je=Z.ALLOWED_URI_REGEXP||dk,pt=Z.NAMESPACE||gi,er=Z.MATHML_TEXT_INTEGRATION_POINTS||er,yr=Z.HTML_INTEGRATION_POINTS||yr,H=Z.CUSTOM_ELEMENT_HANDLING||{},Z.CUSTOM_ELEMENT_HANDLING&&j(Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=Z.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&j(Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=Z.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Z.CUSTOM_ELEMENT_HANDLING&&typeof Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(H.allowCustomizedBuiltInElements=Z.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),He&&(yt=!1),ti&&(ei=!0),pi&&(ne=Je({},K1),Re=[],pi.html===!0&&(Je(ne,H1),Je(Re,J1)),pi.svg===!0&&(Je(ne,uf),Je(Re,df),Je(Re,oc)),pi.svgFilters===!0&&(Je(ne,hf),Je(Re,df),Je(Re,oc)),pi.mathMl===!0&&(Je(ne,ff),Je(Re,e0),Je(Re,oc))),Z.ADD_TAGS&&(ne===Ee&&(ne=nr(ne)),Je(ne,Z.ADD_TAGS,E)),Z.ADD_ATTR&&(Re===xt&&(Re=nr(Re)),Je(Re,Z.ADD_ATTR,E)),Z.ADD_URI_SAFE_ATTR&&Je(Ko,Z.ADD_URI_SAFE_ATTR,E),Z.FORBID_CONTENTS&&(wr===Go&&(wr=nr(wr)),Je(wr,Z.FORBID_CONTENTS,E)),ns&&(ne["#text"]=!0),ct&&Je(ne,["html","head","body"]),ne.table&&(Je(ne,["tbody"]),delete Pe.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw ll('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ll('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=Z.TRUSTED_TYPES_POLICY,A=k.createHTML("")}else k===void 0&&(k=function(_e,me){if(typeof _e!="object"||typeof _e.createPolicy!="function")return null;let Ke=null;const ot="data-tt-policy-suffix";me&&me.hasAttribute(ot)&&(Ke=me.getAttribute(ot));const ze="dompurify"+(Ke?"#"+Ke:"");try{return _e.createPolicy(ze,{createHTML:Wt=>Wt,createScriptURL:Wt=>Wt})}catch{return console.warn("TrustedTypes policy "+ze+" could not be created."),null}}(m,s)),k!==null&&typeof A=="string"&&(A=k.createHTML(""));An&&An(Z),$=Z}},ge=Je({},[...uf,...hf,...BR]),We=Je({},[...ff,...WR]),we=function(Z){sl(t.removed,{element:Z});try{_(Z).removeChild(Z)}catch{v(Z)}},Ne=function(Z,_e){try{sl(t.removed,{attribute:_e.getAttributeNode(Z),from:_e})}catch{sl(t.removed,{attribute:null,from:_e})}if(_e.removeAttribute(Z),Z==="is")if(ei||ti)try{we(_e)}catch{}else try{_e.setAttribute(Z,"")}catch{}},Se=function(Z){let _e=null,me=null;if(Mt)Z=""+Z;else{const ze=cf(Z,/^[\r\n\t ]+/);me=ze&&ze[0]}os==="application/xhtml+xml"&&pt===gi&&(Z=''+Z+"");const Ke=k?k.createHTML(Z):Z;if(pt===gi)try{_e=new d().parseFromString(Ke,os)}catch{}if(!_e||!_e.documentElement){_e=C.createDocument(pt,"template",null);try{_e.documentElement.innerHTML=rs?A:Ke}catch{}}const ot=_e.body||_e.documentElement;return Z&&me&&ot.insertBefore(n.createTextNode(me),ot.childNodes[0]||null),pt===gi?L.call(_e,ct?"html":"body")[0]:ct?_e.documentElement:ot},Me=function(Z){return Q.call(Z.ownerDocument||Z,Z,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ft=function(Z){return Z instanceof f&&(typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||!(Z.attributes instanceof h)||typeof Z.removeAttribute!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function")},Nn=function(Z){return typeof a=="function"&&Z instanceof a};function Lt(Z,_e,me){sc(Z,Ke=>{Ke.call(t,_e,me,$)})}const kr=function(Z){let _e=null;if(Lt(B.beforeSanitizeElements,Z,null),ft(Z))return we(Z),!0;const me=E(Z.nodeName);if(Lt(B.uponSanitizeElement,Z,{tagName:me,allowedTags:ne}),Ut&&Z.hasChildNodes()&&!Nn(Z.firstElementChild)&&wn(/<[/\w!]/g,Z.innerHTML)&&wn(/<[/\w!]/g,Z.textContent)||Z.nodeType===KR||Ut&&Z.nodeType===JR&&wn(/<[/\w]/g,Z.data))return we(Z),!0;if(!ne[me]||Pe[me]){if(!Pe[me]&&ja(me)&&(H.tagNameCheck instanceof RegExp&&wn(H.tagNameCheck,me)||H.tagNameCheck instanceof Function&&H.tagNameCheck(me)))return!1;if(ns&&!wr[me]){const Ke=_(Z)||Z.parentNode,ot=S(Z)||Z.childNodes;if(ot&&Ke)for(let ze=ot.length-1;ze>=0;--ze){const Wt=g(ot[ze],!0);Wt.__removalCount=(Z.__removalCount||0)+1,Ke.insertBefore(Wt,w(Z))}}return we(Z),!0}return Z instanceof c&&!function(Ke){let ot=_(Ke);ot&&ot.tagName||(ot={namespaceURI:pt,tagName:"template"});const ze=zc(Ke.tagName),Wt=zc(ot.tagName);return!!ss[Ke.namespaceURI]&&(Ke.namespaceURI===Ys?ot.namespaceURI===gi?ze==="svg":ot.namespaceURI===is?ze==="svg"&&(Wt==="annotation-xml"||er[Wt]):!!ge[ze]:Ke.namespaceURI===is?ot.namespaceURI===gi?ze==="math":ot.namespaceURI===Ys?ze==="math"&&yr[Wt]:!!We[ze]:Ke.namespaceURI===gi?!(ot.namespaceURI===Ys&&!yr[Wt])&&!(ot.namespaceURI===is&&!er[Wt])&&!We[ze]&&(Oi[ze]||!ge[ze]):!(os!=="application/xhtml+xml"||!ss[Ke.namespaceURI]))}(Z)?(we(Z),!0):me!=="noscript"&&me!=="noembed"&&me!=="noframes"||!wn(/<\/no(script|embed|frames)/i,Z.innerHTML)?(He&&Z.nodeType===HR&&(_e=Z.textContent,sc([J,te,ie],Ke=>{_e=ol(_e,Ke," ")}),Z.textContent!==_e&&(sl(t.removed,{element:Z.cloneNode()}),Z.textContent=_e)),Lt(B.afterSanitizeElements,Z,null),!1):(we(Z),!0)},tr=function(Z,_e,me){if(za&&(_e==="id"||_e==="name")&&(me in n||me in F))return!1;if(!(yt&&!Ye[_e]&&wn(ae,_e))){if(!(Tt&&wn(X,_e))){if(!Re[_e]||Ye[_e]){if(!(ja(Z)&&(H.tagNameCheck instanceof RegExp&&wn(H.tagNameCheck,Z)||H.tagNameCheck instanceof Function&&H.tagNameCheck(Z))&&(H.attributeNameCheck instanceof RegExp&&wn(H.attributeNameCheck,_e)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(_e,Z))||_e==="is"&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&wn(H.tagNameCheck,me)||H.tagNameCheck instanceof Function&&H.tagNameCheck(me))))return!1}else if(!Ko[_e]){if(!wn(je,ol(me,Te,""))){if((_e!=="src"&&_e!=="xlink:href"&&_e!=="href"||Z==="script"||IR(me,"data:")!==0||!Va[Z])&&!(wt&&!wn(ee,ol(me,Te,"")))){if(me)return!1}}}}}return!0},ja=function(Z){return Z!=="annotation-xml"&&cf(Z,ve)},zs=function(Z){Lt(B.beforeSanitizeAttributes,Z,null);const{attributes:_e}=Z;if(!_e||ft(Z))return;const me={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let Ke=_e.length;for(;Ke--;){const ot=_e[Ke],{name:ze,namespaceURI:Wt,value:Sr}=ot,bi=E(ze),Th=Sr;let rn=ze==="value"?Th:NR(Th);if(me.attrName=bi,me.attrValue=rn,me.keepAttr=!0,me.forceKeepAttr=void 0,Lt(B.uponSanitizeAttribute,Z,me),rn=me.attrValue,!qo||bi!=="id"&&bi!=="name"||(Ne(ze,Z),rn="user-content-"+rn),Ut&&wn(/((--!?|])>)|<\/(style|title|textarea)/i,rn)){Ne(ze,Z);continue}if(bi==="attributename"&&cf(rn,"href")){Ne(ze,Z);continue}if(me.forceKeepAttr)continue;if(!me.keepAttr){Ne(ze,Z);continue}if(!Qt&&wn(/\/>/i,rn)){Ne(ze,Z);continue}He&&sc([J,te,ie],Kp=>{rn=ol(rn,Kp," ")});const Hp=E(Z.nodeName);if(tr(Hp,bi,rn)){if(k&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Wt)switch(m.getAttributeType(Hp,bi)){case"TrustedHTML":rn=k.createHTML(rn);break;case"TrustedScriptURL":rn=k.createScriptURL(rn)}if(rn!==Th)try{Wt?Z.setAttributeNS(Wt,ze,rn):Z.setAttribute(ze,rn),ft(Z)?we(Z):q1(t.removed)}catch{Ne(ze,Z)}}else Ne(ze,Z)}Lt(B.afterSanitizeAttributes,Z,null)},xh=function Z(_e){let me=null;const Ke=Me(_e);for(Lt(B.beforeSanitizeShadowDOM,_e,null);me=Ke.nextNode();)Lt(B.uponSanitizeShadowNode,me,null),kr(me),zs(me),me.content instanceof o&&Z(me.content);Lt(B.afterSanitizeShadowDOM,_e,null)};return t.sanitize=function(Z){let _e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,Ke=null,ot=null,ze=null;if(rs=!Z,rs&&(Z=""),typeof Z!="string"&&!Nn(Z)){if(typeof Z.toString!="function")throw ll("toString is not a function");if(typeof(Z=Z.toString())!="string")throw ll("dirty is not a string, aborting")}if(!t.isSupported)return Z;if(qe||ce(_e),t.removed=[],typeof Z=="string"&&(vr=!1),vr){if(Z.nodeName){const bi=E(Z.nodeName);if(!ne[bi]||Pe[bi])throw ll("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof a)me=Se(""),Ke=me.ownerDocument.importNode(Z,!0),Ke.nodeType===GR&&Ke.nodeName==="BODY"||Ke.nodeName==="HTML"?me=Ke:me.appendChild(Ke);else{if(!ei&&!He&&!ct&&Z.indexOf("<")===-1)return k&&Ri?k.createHTML(Z):Z;if(me=Se(Z),!me)return ei?null:Ri?A:""}me&&Mt&&we(me.firstChild);const Wt=Me(vr?Z:me);for(;ot=Wt.nextNode();)kr(ot),zs(ot),ot.content instanceof o&&xh(ot.content);if(vr)return Z;if(ei){if(ti)for(ze=M.call(me.ownerDocument);me.firstChild;)ze.appendChild(me.firstChild);else ze=me;return(Re.shadowroot||Re.shadowrootmode)&&(ze=N.call(r,ze,!0)),ze}let Sr=ct?me.outerHTML:me.innerHTML;return ct&&ne["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&wn(mk,me.ownerDocument.doctype.name)&&(Sr=" +`+Sr),He&&sc([J,te,ie],bi=>{Sr=ol(Sr,bi," ")}),k&&Ri?k.createHTML(Sr):Sr},t.setConfig=function(){ce(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),qe=!0},t.clearConfig=function(){$=null,qe=!1},t.isValidAttribute=function(Z,_e,me){$||ce({});const Ke=E(Z),ot=E(_e);return tr(Ke,ot,me)},t.addHook=function(Z,_e){typeof _e=="function"&&sl(B[Z],_e)},t.removeHook=function(Z,_e){if(_e!==void 0){const me=$R(B[Z],_e);return me===-1?void 0:LR(B[Z],me,1)[0]}return q1(B[Z])},t.removeHooks=function(Z){B[Z]=[]},t.removeAllHooks=function(){B={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},t}();Ao.addHook("uponSanitizeAttribute",function(i,e){if(e.attrName==="data-trix-serialized-attributes")return void(e.keepAttr=!1);/^data-trix-/.test(e.attrName)&&(e.forceKeepAttr=!0)});const n4="style href src width height language class".split(" "),i4="javascript:".split(" "),r4="script iframe form noscript".split(" ");class lh extends Kt{static setHTML(e,t,n){const r=new this(t,n).sanitize(),s=r.getHTML?r.getHTML():r.outerHTML;e.innerHTML=s}static sanitize(e,t){const n=new this(e,t);return n.sanitize(),n}constructor(e){let{allowedAttributes:t,forbiddenProtocols:n,forbiddenElements:r,purifyOptions:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.allowedAttributes=t||n4,this.forbiddenProtocols=n||i4,this.forbiddenElements=r||r4,this.purifyOptions=s||{},this.body=s4(e)}sanitize(){this.sanitizeElements(),this.normalizeListElementNesting();const e=Object.assign({},Hy,this.purifyOptions);return Ao.setConfig(e),this.body=Ao.sanitize(this.body),this.body}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){const e=vu(this.body),t=[];for(;e.nextNode();){const n=e.currentNode;switch(n.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(n)?t.push(n):this.sanitizeElement(n);break;case Node.COMMENT_NODE:t.push(n)}}return t.forEach(n=>zr(n)),this.body}sanitizeElement(e){return e.hasAttribute("href")&&this.forbiddenProtocols.includes(e.protocol)&&e.removeAttribute("href"),Array.from(e.attributes).forEach(t=>{let{name:n}=t;this.allowedAttributes.includes(n)||n.indexOf("data-trix")===0||e.removeAttribute(n)}),e}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach(e=>{const t=e.previousElementSibling;t&&kn(t)==="li"&&t.appendChild(e)}),this.body}elementIsRemovable(e){if((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE)return this.elementIsForbidden(e)||this.elementIsntSerializable(e)}elementIsForbidden(e){return this.forbiddenElements.includes(kn(e))}elementIsntSerializable(e){return e.getAttribute("data-trix-serialize")==="false"&&!Cs(e)}}const s4=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";i=i.replace(/<\/html[^>]*>[^]*$/i,"");const e=document.implementation.createHTMLDocument("");return e.documentElement.innerHTML=i,Array.from(e.head.querySelectorAll("style")).forEach(t=>{e.body.appendChild(t)}),e.body},{css:Cr}=$a;class ip extends Zs{constructor(){super(...arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}createContentNodes(){return[]}createNodes(){let e;const t=e=Ge({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),n=this.getHref();return n&&(e=Ge({tagName:"a",editable:!1,attributes:{href:n,tabindex:-1}}),t.appendChild(e)),this.attachment.hasContent()?lh.setHTML(e,this.attachment.getContent()):this.createContentNodes().forEach(r=>{e.appendChild(r)}),e.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=Ge({tagName:"progress",attributes:{class:Cr.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),t.appendChild(this.progressElement)),[n0("left"),t,n0("right")]}createCaptionElement(){const e=Ge({tagName:"figcaption",className:Cr.attachmentCaption}),t=this.attachmentPiece.getCaption();if(t)e.classList.add("".concat(Cr.attachmentCaption,"--edited")),e.textContent=t;else{let n,r;const s=this.getCaptionConfig();if(s.name&&(n=this.attachment.getFilename()),s.size&&(r=this.attachment.getFormattedFilesize()),n){const o=Ge({tagName:"span",className:Cr.attachmentName,textContent:n});e.appendChild(o)}if(r){n&&e.appendChild(document.createTextNode(" "));const o=Ge({tagName:"span",className:Cr.attachmentSize,textContent:r});e.appendChild(o)}}return e}getClassName(){const e=[Cr.attachment,"".concat(Cr.attachment,"--").concat(this.attachment.getType())],t=this.attachment.getExtension();return t&&e.push("".concat(Cr.attachment,"--").concat(t)),e.join(" ")}getData(){const e={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},{attributes:t}=this.attachmentPiece;return t.isEmpty()||(e.trixAttributes=JSON.stringify(t)),this.attachment.isPending()&&(e.trixSerialize=!1),e}getHref(){if(!o4(this.attachment.getContent(),"a")){const e=this.attachment.getHref();if(e&&Ao.isValidAttribute("a","href",e))return e}}getCaptionConfig(){var e;const t=this.attachment.getType(),n=lk((e=jm[t])===null||e===void 0?void 0:e.caption);return t==="file"&&(n.name=!0),n}findProgressElement(){var e;return(e=this.findElement())===null||e===void 0?void 0:e.querySelector("progress")}attachmentDidChangeUploadProgress(){const e=this.attachment.getUploadProgress(),t=this.findProgressElement();t&&(t.value=e)}}const n0=i=>Ge({tagName:"span",textContent:oh,data:{trixCursorTarget:i,trixSerialize:!1}}),o4=function(i,e){const t=Ge("div");return lh.setHTML(t,i||""),t.querySelector(e)};class pk extends ip{constructor(){super(...arguments),this.attachment.previewDelegate=this}createContentNodes(){return this.image=Ge({tagName:"img",attributes:{src:""},data:{trixMutable:!0}}),this.refresh(this.image),[this.image]}createCaptionElement(){const e=super.createCaptionElement(...arguments);return e.textContent||e.setAttribute("data-trix-placeholder",Ve.captionPlaceholder),e}refresh(e){var t;if(e||(e=(t=this.findElement())===null||t===void 0?void 0:t.querySelector("img")),e)return this.updateAttributesForImage(e)}updateAttributesForImage(e){const t=this.attachment.getURL(),n=this.attachment.getPreviewURL();if(e.src=n||t,n===t)e.removeAttribute("data-trix-serialized-attributes");else{const a=JSON.stringify({src:t});e.setAttribute("data-trix-serialized-attributes",a)}const r=this.attachment.getWidth(),s=this.attachment.getHeight(),o=this.attachment.getAttribute("alt");r!=null&&(e.width=r),s!=null&&(e.height=s),o!=null&&(e.alt=o);const l=["imageElement",this.attachment.id,e.src,e.width,e.height].join("/");e.dataset.trixStoreKey=l}attachmentDidChangeAttributes(){return this.refresh(this.image),this.refresh()}}class gk extends Zs{constructor(){super(...arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),this.textConfig=this.options.textConfig,this.context=this.options.context,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}createNodes(){let e=this.attachment?this.createAttachmentNodes():this.createStringNodes();const t=this.createElement();if(t){const n=function(r){for(;(s=r)!==null&&s!==void 0&&s.firstElementChild;){var s;r=r.firstElementChild}return r}(t);Array.from(e).forEach(r=>{n.appendChild(r)}),e=[t]}return e}createAttachmentNodes(){const e=this.attachment.isPreviewable()?pk:ip;return this.createChildView(e,this.piece.attachment,{piece:this.piece}).getNodes()}createStringNodes(){var e;if((e=this.textConfig)!==null&&e!==void 0&&e.plaintext)return[document.createTextNode(this.string)];{const t=[],n=this.string.split(` +`);for(let r=0;r0){const o=Ge("br");t.push(o)}if(s.length){const o=document.createTextNode(this.preserveSpaces(s));t.push(o)}}return t}}createElement(){let e,t,n;const r={};for(t in this.attributes){n=this.attributes[t];const o=Ad(t);if(o){if(o.tagName){var s;const l=Ge(o.tagName);s?(s.appendChild(l),s=l):e=s=l}if(o.styleProperty&&(r[o.styleProperty]=n),o.style)for(t in o.style)n=o.style[t],r[t]=n}}if(Object.keys(r).length)for(t in e||(e=Ge("span")),r)n=r[t],e.style[t]=n;return e}createContainerElement(){for(const e in this.attributes){const t=this.attributes[e],n=Ad(e);if(n&&n.groupTagName){const r={};return r[e]=t,Ge(n.groupTagName,r)}}}preserveSpaces(e){return this.context.isLast&&(e=e.replace(/\ $/,Rr)),e=e.replace(/(\S)\ {3}(\S)/g,"$1 ".concat(Rr," $2")).replace(/\ {2}/g,"".concat(Rr," ")).replace(/\ {2}/g," ".concat(Rr)),(this.context.isFirst||this.context.followsWhitespace)&&(e=e.replace(/^\ /,Rr)),e}}class Ok extends Zs{constructor(){super(...arguments),this.text=this.object,this.textConfig=this.options.textConfig}createNodes(){const e=[],t=np.groupObjects(this.getPieces()),n=t.length-1;for(let s=0;s!e.hasAttribute("blockBreak"))}}const l4=i=>/\s$/.test(i==null?void 0:i.toString()),{css:i0}=$a;class bk extends Zs{constructor(){super(...arguments),this.block=this.object,this.attributes=this.block.getAttributes()}createNodes(){const e=[document.createComment("block")];if(this.block.isEmpty())e.push(Ge("br"));else{var t;const n=(t=zt(this.block.getLastAttribute()))===null||t===void 0?void 0:t.text,r=this.findOrCreateCachedChildView(Ok,this.block.text,{textConfig:n});e.push(...Array.from(r.getNodes()||[])),this.shouldAddExtraNewlineElement()&&e.push(Ge("br"))}if(this.attributes.length)return e;{let n;const{tagName:r}=Sn.default;this.block.isRTL()&&(n={dir:"rtl"});const s=Ge({tagName:r,attributes:n});return e.forEach(o=>s.appendChild(o)),[s]}}createContainerElement(e){const t={};let n;const r=this.attributes[e],{tagName:s,htmlAttributes:o=[]}=zt(r);if(e===0&&this.block.isRTL()&&Object.assign(t,{dir:"rtl"}),r==="attachmentGallery"){const l=this.block.getBlockBreakPosition();n="".concat(i0.attachmentGallery," ").concat(i0.attachmentGallery,"--").concat(l)}return Object.entries(this.block.htmlAttributes).forEach(l=>{let[a,c]=l;o.includes(a)&&(t[a]=c)}),Ge({tagName:s,className:n,attributes:t})}shouldAddExtraNewlineElement(){return/\n\n$/.test(this.block.toString())}}class ah extends Zs{static render(e){const t=Ge("div"),n=new this(e,{element:t});return n.render(),n.sync(),t}constructor(){super(...arguments),this.element=this.options.element,this.elementStore=new QR,this.setDocument(this.object)}setDocument(e){e.isEqualTo(this.document)||(this.document=this.object=e)}render(){if(this.childViews=[],this.shadowElement=Ge("div"),!this.document.isEmpty()){const e=np.groupObjects(this.document.getBlocks(),{asTree:!0});Array.from(e).forEach(t=>{const n=this.findOrCreateCachedChildView(bk,t);Array.from(n.getNodes()).map(r=>this.shadowElement.appendChild(r))})}}isSynced(){return a4(this.shadowElement,this.element)}sync(){const e=ek("trix-before-render",{cancelable:!1,attributes:{render:(n,r)=>{for(;n.lastChild;)n.removeChild(n.lastChild);n.appendChild(r)}}});this.element.dispatchEvent(e);const t=this.createDocumentFragmentForSync();return e.render(this.element,t),this.didSync()}didSync(){return this.elementStore.reset(r0(this.element)),Jm(()=>this.garbageCollectCachedViews())}createDocumentFragmentForSync(){const e=document.createDocumentFragment();return Array.from(this.shadowElement.childNodes).forEach(t=>{e.appendChild(t.cloneNode(!0))}),Array.from(r0(e)).forEach(t=>{const n=this.elementStore.remove(t);n&&t.parentNode.replaceChild(n,t)}),e}}const r0=i=>i.querySelectorAll("[data-trix-store-key]"),a4=(i,e)=>s0(i.innerHTML)===s0(e.innerHTML),s0=i=>i.replace(/ /g," ");function c4(i){var e=function(t,n){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,n);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}(i,"string");return typeof e=="symbol"?e:String(e)}function gn(i,e,t){return(e=c4(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function it(i,e){return u4(i,vk(i,e,"get"))}function Wl(i,e,t){return h4(i,vk(i,e,"set"),t),t}function vk(i,e,t){if(!e.has(i))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(i)}function u4(i,e){return e.get?e.get.call(i):e.value}function h4(i,e,t){if(e.set)e.set.call(i,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}}function lc(i,e,t){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return t}function wk(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function po(i,e,t){wk(i,e),e.set(i,t)}class Bs extends Ns{static registerType(e,t){t.type=e,this.types[e]=t}static fromJSON(e){const t=this.types[e.type];if(t)return t.fromJSON(e)}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.attributes=Kn.box(t)}copyWithAttributes(e){return new this.constructor(this.getValue(),e)}copyWithAdditionalAttributes(e){return this.copyWithAttributes(this.attributes.merge(e))}copyWithoutAttribute(e){return this.copyWithAttributes(this.attributes.remove(e))}copy(){return this.copyWithAttributes(this.attributes)}getAttribute(e){return this.attributes.get(e)}getAttributesHash(){return this.attributes}getAttributes(){return this.attributes.toObject()}hasAttribute(e){return this.attributes.has(e)}hasSameStringValueAsPiece(e){return e&&this.toString()===e.toString()}hasSameAttributesAsPiece(e){return e&&(this.attributes===e.attributes||this.attributes.isEqualTo(e.attributes))}isBlockBreak(){return!1}isEqualTo(e){return super.isEqualTo(...arguments)||this.hasSameConstructorAs(e)&&this.hasSameStringValueAsPiece(e)&&this.hasSameAttributesAsPiece(e)}isEmpty(){return this.length===0}isSerializable(){return!0}toJSON(){return{type:this.constructor.type,attributes:this.getAttributes()}}contentsForInspection(){return{type:this.constructor.type,attributes:this.attributes.inspect()}}canBeGrouped(){return this.hasAttribute("href")}canBeGroupedWith(e){return this.getAttribute("href")===e.getAttribute("href")}getLength(){return this.length}canBeConsolidatedWith(e){return!1}}gn(Bs,"types",{});class yk extends yu{constructor(e){super(...arguments),this.url=e}perform(e){const t=new Image;t.onload=()=>(t.width=this.width=t.naturalWidth,t.height=this.height=t.naturalHeight,e(!0,t)),t.onerror=()=>e(!1),t.src=this.url}}class Yo extends Ns{static attachmentForFile(e){const t=new this(this.attributesForFile(e));return t.setFile(e),t}static attributesForFile(e){return new Kn({filename:e.name,filesize:e.size,contentType:e.type})}static fromJSON(e){return new this(e)}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(e),this.releaseFile=this.releaseFile.bind(this),this.attributes=Kn.box(e),this.didChangeAttributes()}setAttribute(e,t){this.setAttributes({[e]:t})}getAttribute(e){return this.attributes.get(e)}hasAttribute(e){return this.attributes.has(e)}getAttributes(){return this.attributes.toObject()}setAttributes(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=this.attributes.merge(e);var n,r,s,o;if(!this.attributes.isEqualTo(t))return this.attributes=t,this.didChangeAttributes(),(n=this.previewDelegate)===null||n===void 0||(r=n.attachmentDidChangeAttributes)===null||r===void 0||r.call(n,this),(s=this.delegate)===null||s===void 0||(o=s.attachmentDidChangeAttributes)===null||o===void 0?void 0:o.call(s,this)}didChangeAttributes(){if(this.isPreviewable())return this.preloadURL()}isPending(){return this.file!=null&&!(this.getURL()||this.getHref())}isPreviewable(){return this.attributes.has("previewable")?this.attributes.get("previewable"):Yo.previewablePattern.test(this.getContentType())}getType(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"}getURL(){return this.attributes.get("url")}getHref(){return this.attributes.get("href")}getFilename(){return this.attributes.get("filename")||""}getFilesize(){return this.attributes.get("filesize")}getFormattedFilesize(){const e=this.attributes.get("filesize");return typeof e=="number"?Ky.formatter(e):""}getExtension(){var e;return(e=this.getFilename().match(/\.(\w+)$/))===null||e===void 0?void 0:e[1].toLowerCase()}getContentType(){return this.attributes.get("contentType")}hasContent(){return this.attributes.has("content")}getContent(){return this.attributes.get("content")}getWidth(){return this.attributes.get("width")}getHeight(){return this.attributes.get("height")}getFile(){return this.file}setFile(e){if(this.file=e,this.isPreviewable())return this.preloadFile()}releaseFile(){this.releasePreloadedFile(),this.file=null}getUploadProgress(){return this.uploadProgress!=null?this.uploadProgress:0}setUploadProgress(e){var t,n;if(this.uploadProgress!==e)return this.uploadProgress=e,(t=this.uploadProgressDelegate)===null||t===void 0||(n=t.attachmentDidChangeUploadProgress)===null||n===void 0?void 0:n.call(t,this)}toJSON(){return this.getAttributes()}getCacheKey(){return[super.getCacheKey(...arguments),this.attributes.getCacheKey(),this.getPreviewURL()].join("/")}getPreviewURL(){return this.previewURL||this.preloadingURL}setPreviewURL(e){var t,n,r,s;if(e!==this.getPreviewURL())return this.previewURL=e,(t=this.previewDelegate)===null||t===void 0||(n=t.attachmentDidChangeAttributes)===null||n===void 0||n.call(t,this),(r=this.delegate)===null||r===void 0||(s=r.attachmentDidChangePreviewURL)===null||s===void 0?void 0:s.call(r,this)}preloadURL(){return this.preload(this.getURL(),this.releaseFile)}preloadFile(){if(this.file)return this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)}releasePreloadedFile(){this.fileObjectURL&&(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null)}preload(e,t){if(e&&e!==this.getPreviewURL())return this.preloadingURL=e,new yk(e).then(n=>{let{width:r,height:s}=n;return this.getWidth()&&this.getHeight()||this.setAttributes({width:r,height:s}),this.preloadingURL=null,this.setPreviewURL(e),t==null?void 0:t()}).catch(()=>(this.preloadingURL=null,t==null?void 0:t()))}}gn(Yo,"previewablePattern",/^image(\/(gif|png|webp|jpe?g)|$)/);class xo extends Bs{static fromJSON(e){return new this(Yo.fromJSON(e.attachment),e.attributes)}constructor(e){super(...arguments),this.attachment=e,this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href"),this.attachment.hasContent()||this.removeProhibitedAttributes()}ensureAttachmentExclusivelyHasAttribute(e){this.hasAttribute(e)&&(this.attachment.hasAttribute(e)||this.attachment.setAttributes(this.attributes.slice([e])),this.attributes=this.attributes.remove(e))}removeProhibitedAttributes(){const e=this.attributes.slice(xo.permittedAttributes);e.isEqualTo(this.attributes)||(this.attributes=e)}getValue(){return this.attachment}isSerializable(){return!this.attachment.isPending()}getCaption(){return this.attributes.get("caption")||""}isEqualTo(e){var t;return super.isEqualTo(e)&&this.attachment.id===(e==null||(t=e.attachment)===null||t===void 0?void 0:t.id)}toString(){return""}toJSON(){const e=super.toJSON(...arguments);return e.attachment=this.attachment,e}getCacheKey(){return[super.getCacheKey(...arguments),this.attachment.getCacheKey()].join("/")}toConsole(){return JSON.stringify(this.toString())}}gn(xo,"permittedAttributes",["caption","presentation"]),Bs.registerType("attachment",xo);class rp extends Bs{static fromJSON(e){const t={...e.attributes};return t.href&&!Ao.isValidAttribute("a","href",t.href)&&delete t.href,new this(e.string,t)}constructor(e){super(...arguments),this.string=(t=>t.replace(/\r\n?/g,` `))(e),this.length=this.string.length}getValue(){return this.string}toString(){return this.string.toString()}isBlockBreak(){return this.toString()===` -`&&this.getAttribute("blockBreak")===!0}toJSON(){const e=super.toJSON(...arguments);return e.string=this.string,e}canBeConsolidatedWith(e){return e&&this.hasSameConstructorAs(e)&&this.hasSameAttributesAsPiece(e)}consolidateWith(e){return new this.constructor(this.toString()+e.toString(),this.attributes)}splitAtOffset(e){let t,n;return e===0?(t=null,n=this):e===this.length?(t=this,n=null):(t=new this.constructor(this.string.slice(0,e),this.attributes),n=new this.constructor(this.string.slice(e),this.attributes)),[t,n]}toConsole(){let{string:e}=this;return e.length>15&&(e=e.slice(0,14)+"…"),JSON.stringify(e.toString())}}Zs.registerType("string",op);class ku extends Is{static box(e){return e instanceof this?e:new this(e)}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects=e.slice(0),this.length=this.objects.length}indexOf(e){return this.objects.indexOf(e)}splice(){for(var e=arguments.length,t=new Array(e),n=0;ne(t,n))}insertObjectAtIndex(e,t){return this.splice(t,0,e)}insertSplittableListAtIndex(e,t){return this.splice(t,0,...e.objects)}insertSplittableListAtPosition(e,t){const[n,r]=this.splitObjectAtPosition(t);return new this.constructor(n).insertSplittableListAtIndex(e,r)}editObjectAtIndex(e,t){return this.replaceObjectAtIndex(t(this.objects[e]),e)}replaceObjectAtIndex(e,t){return this.splice(t,1,e)}removeObjectAtIndex(e){return this.splice(e,1)}getObjectAtIndex(e){return this.objects[e]}getSplittableListInRange(e){const[t,n,r]=this.splitObjectsAtRange(e);return new this.constructor(t.slice(n,r+1))}selectSplittableList(e){const t=this.objects.filter(n=>e(n));return new this.constructor(t)}removeObjectsInRange(e){const[t,n,r]=this.splitObjectsAtRange(e);return new this.constructor(t).splice(n,r-n+1)}transformObjectsInRange(e,t){const[n,r,s]=this.splitObjectsAtRange(e),o=n.map((l,a)=>r<=a&&a<=s?t(l):l);return new this.constructor(o)}splitObjectsAtRange(e){let t,[n,r,s]=this.splitObjectAtPosition(k4(e));return[n,t]=new this.constructor(n).splitObjectAtPosition(S4(e)+s),[n,r,t-1]}getObjectAtPosition(e){const{index:t}=this.findIndexAndOffsetAtPosition(e);return this.objects[t]}splitObjectAtPosition(e){let t,n;const{index:r,offset:s}=this.findIndexAndOffsetAtPosition(e),o=this.objects.slice(0);if(r!=null)if(s===0)t=r,n=0;else{const l=this.getObjectAtIndex(r),[a,c]=l.splitAtOffset(s);o.splice(r,1,a,c),t=r+1,n=a.getLength()-s}else t=o.length,n=0;return[o,t,n]}consolidate(){const e=[];let t=this.objects[0];return this.objects.slice(1).forEach(n=>{var r,s;(r=(s=t).canBeConsolidatedWith)!==null&&r!==void 0&&r.call(s,n)?t=t.consolidateWith(n):(e.push(t),t=n)}),t&&e.push(t),new this.constructor(e)}consolidateFromIndexToIndex(e,t){const n=this.objects.slice(0).slice(e,t+1),r=new this.constructor(n).consolidate().toArray();return this.splice(e,n.length,...r)}findIndexAndOffsetAtPosition(e){let t,n=0;for(t=0;tthis.endPosition+=e.getLength())),this.endPosition}toString(){return this.objects.join("")}toArray(){return this.objects.slice(0)}toJSON(){return this.toArray()}isEqualTo(e){return super.isEqualTo(...arguments)||y4(this.objects,e==null?void 0:e.objects)}contentsForInspection(){return{objects:"[".concat(this.objects.map(e=>e.inspect()).join(", "),"]")}}}const y4=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==e.length)return!1;let t=!0;for(let n=0;ni[0],S4=i=>i[1];class _i extends Is{static textForAttachmentWithAttributes(e,t){return new this([new Ao(e,t)])}static textForStringWithAttributes(e,t){return new this([new op(e,t)])}static fromJSON(e){return new this(Array.from(e).map(t=>Zs.fromJSON(t)))}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments);const t=e.filter(n=>!n.isEmpty());this.pieceList=new ku(t)}copy(){return this.copyWithPieceList(this.pieceList)}copyWithPieceList(e){return new this.constructor(e.consolidate().toArray())}copyUsingObjectMap(e){const t=this.getPieces().map(n=>e.find(n)||n);return new this.constructor(t)}appendText(e){return this.insertTextAtPosition(e,this.getLength())}insertTextAtPosition(e,t){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(e.pieceList,t))}removeTextAtRange(e){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(e))}replaceTextAtRange(e,t){return this.removeTextAtRange(t).insertTextAtPosition(e,t[0])}moveTextFromRangeToPosition(e,t){if(e[0]<=t&&t<=e[1])return;const n=this.getTextAtRange(e),r=n.getLength();return e[0]n.copyWithAdditionalAttributes(e)))}removeAttributeAtRange(e,t){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(t,n=>n.copyWithoutAttribute(e)))}setAttributesAtRange(e,t){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(t,n=>n.copyWithAttributes(e)))}getAttributesAtPosition(e){var t;return((t=this.pieceList.getObjectAtPosition(e))===null||t===void 0?void 0:t.getAttributes())||{}}getCommonAttributes(){const e=Array.from(this.pieceList.toArray()).map(t=>t.getAttributes());return Kn.fromCommonAttributesOfObjects(e).toObject()}getCommonAttributesAtRange(e){return this.getTextAtRange(e).getCommonAttributes()||{}}getExpandedRangeForAttributeAtOffset(e,t){let n,r=n=t;const s=this.getLength();for(;r>0&&this.getCommonAttributesAtRange([r-1,n])[e];)r--;for(;n!!e.attachment)}getAttachments(){return this.getAttachmentPieces().map(e=>e.attachment)}getAttachmentAndPositionById(e){let t=0;for(const r of this.pieceList.toArray()){var n;if(((n=r.attachment)===null||n===void 0?void 0:n.id)===e)return{attachment:r.attachment,position:t};t+=r.length}return{attachment:null,position:null}}getAttachmentById(e){const{attachment:t}=this.getAttachmentAndPositionById(e);return t}getRangeOfAttachment(e){const t=this.getAttachmentAndPositionById(e.id),n=t.position;if(e=t.attachment)return[n,n+1]}updateAttributesForAttachment(e,t){const n=this.getRangeOfAttachment(t);return n?this.addAttributesAtRange(e,n):this}getLength(){return this.pieceList.getEndPosition()}isEmpty(){return this.getLength()===0}isEqualTo(e){var t;return super.isEqualTo(e)||(e==null||(t=e.pieceList)===null||t===void 0?void 0:t.isEqualTo(this.pieceList))}isBlockBreak(){return this.getLength()===1&&this.pieceList.getObjectAtIndex(0).isBlockBreak()}eachPiece(e){return this.pieceList.eachObject(e)}getPieces(){return this.pieceList.toArray()}getPieceAtPosition(e){return this.pieceList.getObjectAtPosition(e)}contentsForInspection(){return{pieceList:this.pieceList.inspect()}}toSerializableText(){const e=this.pieceList.selectSplittableList(t=>t.isSerializable());return this.copyWithPieceList(e)}toString(){return this.pieceList.toString()}toJSON(){return this.pieceList.toJSON()}toConsole(){return JSON.stringify(this.pieceList.toArray().map(e=>JSON.parse(e.toConsole())))}getDirection(){return TR(this.toString())}isRTL(){return this.getDirection()==="rtl"}}class Xi extends Is{static fromJSON(e){return new this(_i.fromJSON(e.text),e.attributes,e.htmlAttributes)}constructor(e,t,n){super(...arguments),this.text=_4(e||new _i),this.attributes=t||[],this.htmlAttributes=n||{}}isEmpty(){return this.text.isBlockBreak()}isEqualTo(e){return!!super.isEqualTo(e)||this.text.isEqualTo(e==null?void 0:e.text)&&xs(this.attributes,e==null?void 0:e.attributes)&&Xo(this.htmlAttributes,e==null?void 0:e.htmlAttributes)}copyWithText(e){return new Xi(e,this.attributes,this.htmlAttributes)}copyWithoutText(){return this.copyWithText(null)}copyWithAttributes(e){return new Xi(this.text,e,this.htmlAttributes)}copyWithoutAttributes(){return this.copyWithAttributes(null)}copyUsingObjectMap(e){const t=e.find(this.text);return t?this.copyWithText(t):this.copyWithText(this.text.copyUsingObjectMap(e))}addAttribute(e){const t=this.attributes.concat(p0(e));return this.copyWithAttributes(t)}addHTMLAttribute(e,t){const n=Object.assign({},this.htmlAttributes,{[e]:t});return new Xi(this.text,this.attributes,n)}removeAttribute(e){const{listAttribute:t}=zt(e),n=O0(O0(this.attributes,e),t);return this.copyWithAttributes(n)}removeLastAttribute(){return this.removeAttribute(this.getLastAttribute())}getLastAttribute(){return g0(this.attributes)}getAttributes(){return this.attributes.slice(0)}getAttributeLevel(){return this.attributes.length}getAttributeAtLevel(e){return this.attributes[e-1]}hasAttribute(e){return this.attributes.includes(e)}hasAttributes(){return this.getAttributeLevel()>0}getLastNestableAttribute(){return g0(this.getNestableAttributes())}getNestableAttributes(){return this.attributes.filter(e=>zt(e).nestable)}getNestingLevel(){return this.getNestableAttributes().length}decreaseNestingLevel(){const e=this.getLastNestableAttribute();return e?this.removeAttribute(e):this}increaseNestingLevel(){const e=this.getLastNestableAttribute();if(e){const t=this.attributes.lastIndexOf(e),n=ep(this.attributes,t+1,0,...p0(e));return this.copyWithAttributes(n)}return this}getListItemAttributes(){return this.attributes.filter(e=>zt(e).listAttribute)}isListItem(){var e;return(e=zt(this.getLastAttribute()))===null||e===void 0?void 0:e.listAttribute}isTerminalBlock(){var e;return(e=zt(this.getLastAttribute()))===null||e===void 0?void 0:e.terminal}breaksOnReturn(){var e;return(e=zt(this.getLastAttribute()))===null||e===void 0?void 0:e.breakOnReturn}findLineBreakInDirectionFromPosition(e,t){const n=this.toString();let r;switch(e){case"forward":r=n.indexOf(` +`&&this.getAttribute("blockBreak")===!0}toJSON(){const e=super.toJSON(...arguments);return e.string=this.string,e}canBeConsolidatedWith(e){return e&&this.hasSameConstructorAs(e)&&this.hasSameAttributesAsPiece(e)}consolidateWith(e){return new this.constructor(this.toString()+e.toString(),this.attributes)}splitAtOffset(e){let t,n;return e===0?(t=null,n=this):e===this.length?(t=this,n=null):(t=new this.constructor(this.string.slice(0,e),this.attributes),n=new this.constructor(this.string.slice(e),this.attributes)),[t,n]}toConsole(){let{string:e}=this;return e.length>15&&(e=e.slice(0,14)+"…"),JSON.stringify(e.toString())}}Bs.registerType("string",rp);class ku extends Ns{static box(e){return e instanceof this?e:new this(e)}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.objects=e.slice(0),this.length=this.objects.length}indexOf(e){return this.objects.indexOf(e)}splice(){for(var e=arguments.length,t=new Array(e),n=0;ne(t,n))}insertObjectAtIndex(e,t){return this.splice(t,0,e)}insertSplittableListAtIndex(e,t){return this.splice(t,0,...e.objects)}insertSplittableListAtPosition(e,t){const[n,r]=this.splitObjectAtPosition(t);return new this.constructor(n).insertSplittableListAtIndex(e,r)}editObjectAtIndex(e,t){return this.replaceObjectAtIndex(t(this.objects[e]),e)}replaceObjectAtIndex(e,t){return this.splice(t,1,e)}removeObjectAtIndex(e){return this.splice(e,1)}getObjectAtIndex(e){return this.objects[e]}getSplittableListInRange(e){const[t,n,r]=this.splitObjectsAtRange(e);return new this.constructor(t.slice(n,r+1))}selectSplittableList(e){const t=this.objects.filter(n=>e(n));return new this.constructor(t)}removeObjectsInRange(e){const[t,n,r]=this.splitObjectsAtRange(e);return new this.constructor(t).splice(n,r-n+1)}transformObjectsInRange(e,t){const[n,r,s]=this.splitObjectsAtRange(e),o=n.map((l,a)=>r<=a&&a<=s?t(l):l);return new this.constructor(o)}splitObjectsAtRange(e){let t,[n,r,s]=this.splitObjectAtPosition(d4(e));return[n,t]=new this.constructor(n).splitObjectAtPosition(m4(e)+s),[n,r,t-1]}getObjectAtPosition(e){const{index:t}=this.findIndexAndOffsetAtPosition(e);return this.objects[t]}splitObjectAtPosition(e){let t,n;const{index:r,offset:s}=this.findIndexAndOffsetAtPosition(e),o=this.objects.slice(0);if(r!=null)if(s===0)t=r,n=0;else{const l=this.getObjectAtIndex(r),[a,c]=l.splitAtOffset(s);o.splice(r,1,a,c),t=r+1,n=a.getLength()-s}else t=o.length,n=0;return[o,t,n]}consolidate(){const e=[];let t=this.objects[0];return this.objects.slice(1).forEach(n=>{var r,s;(r=(s=t).canBeConsolidatedWith)!==null&&r!==void 0&&r.call(s,n)?t=t.consolidateWith(n):(e.push(t),t=n)}),t&&e.push(t),new this.constructor(e)}consolidateFromIndexToIndex(e,t){const n=this.objects.slice(0).slice(e,t+1),r=new this.constructor(n).consolidate().toArray();return this.splice(e,n.length,...r)}findIndexAndOffsetAtPosition(e){let t,n=0;for(t=0;tthis.endPosition+=e.getLength())),this.endPosition}toString(){return this.objects.join("")}toArray(){return this.objects.slice(0)}toJSON(){return this.toArray()}isEqualTo(e){return super.isEqualTo(...arguments)||f4(this.objects,e==null?void 0:e.objects)}contentsForInspection(){return{objects:"[".concat(this.objects.map(e=>e.inspect()).join(", "),"]")}}}const f4=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(i.length!==e.length)return!1;let t=!0;for(let n=0;ni[0],m4=i=>i[1];class Si extends Ns{static textForAttachmentWithAttributes(e,t){return new this([new xo(e,t)])}static textForStringWithAttributes(e,t){return new this([new rp(e,t)])}static fromJSON(e){return new this(Array.from(e).map(t=>Bs.fromJSON(t)))}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments);const t=e.filter(n=>!n.isEmpty());this.pieceList=new ku(t)}copy(){return this.copyWithPieceList(this.pieceList)}copyWithPieceList(e){return new this.constructor(e.consolidate().toArray())}copyUsingObjectMap(e){const t=this.getPieces().map(n=>e.find(n)||n);return new this.constructor(t)}appendText(e){return this.insertTextAtPosition(e,this.getLength())}insertTextAtPosition(e,t){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(e.pieceList,t))}removeTextAtRange(e){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(e))}replaceTextAtRange(e,t){return this.removeTextAtRange(t).insertTextAtPosition(e,t[0])}moveTextFromRangeToPosition(e,t){if(e[0]<=t&&t<=e[1])return;const n=this.getTextAtRange(e),r=n.getLength();return e[0]n.copyWithAdditionalAttributes(e)))}removeAttributeAtRange(e,t){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(t,n=>n.copyWithoutAttribute(e)))}setAttributesAtRange(e,t){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(t,n=>n.copyWithAttributes(e)))}getAttributesAtPosition(e){var t;return((t=this.pieceList.getObjectAtPosition(e))===null||t===void 0?void 0:t.getAttributes())||{}}getCommonAttributes(){const e=Array.from(this.pieceList.toArray()).map(t=>t.getAttributes());return Kn.fromCommonAttributesOfObjects(e).toObject()}getCommonAttributesAtRange(e){return this.getTextAtRange(e).getCommonAttributes()||{}}getExpandedRangeForAttributeAtOffset(e,t){let n,r=n=t;const s=this.getLength();for(;r>0&&this.getCommonAttributesAtRange([r-1,n])[e];)r--;for(;n!!e.attachment)}getAttachments(){return this.getAttachmentPieces().map(e=>e.attachment)}getAttachmentAndPositionById(e){let t=0;for(const r of this.pieceList.toArray()){var n;if(((n=r.attachment)===null||n===void 0?void 0:n.id)===e)return{attachment:r.attachment,position:t};t+=r.length}return{attachment:null,position:null}}getAttachmentById(e){const{attachment:t}=this.getAttachmentAndPositionById(e);return t}getRangeOfAttachment(e){const t=this.getAttachmentAndPositionById(e.id),n=t.position;if(e=t.attachment)return[n,n+1]}updateAttributesForAttachment(e,t){const n=this.getRangeOfAttachment(t);return n?this.addAttributesAtRange(e,n):this}getLength(){return this.pieceList.getEndPosition()}isEmpty(){return this.getLength()===0}isEqualTo(e){var t;return super.isEqualTo(e)||(e==null||(t=e.pieceList)===null||t===void 0?void 0:t.isEqualTo(this.pieceList))}isBlockBreak(){return this.getLength()===1&&this.pieceList.getObjectAtIndex(0).isBlockBreak()}eachPiece(e){return this.pieceList.eachObject(e)}getPieces(){return this.pieceList.toArray()}getPieceAtPosition(e){return this.pieceList.getObjectAtPosition(e)}contentsForInspection(){return{pieceList:this.pieceList.inspect()}}toSerializableText(){const e=this.pieceList.selectSplittableList(t=>t.isSerializable());return this.copyWithPieceList(e)}toString(){return this.pieceList.toString()}toJSON(){return this.pieceList.toJSON()}toConsole(){return JSON.stringify(this.pieceList.toArray().map(e=>JSON.parse(e.toConsole())))}getDirection(){return wR(this.toString())}isRTL(){return this.getDirection()==="rtl"}}class Xi extends Ns{static fromJSON(e){return new this(Si.fromJSON(e.text),e.attributes,e.htmlAttributes)}constructor(e,t,n){super(...arguments),this.text=p4(e||new Si),this.attributes=t||[],this.htmlAttributes=n||{}}isEmpty(){return this.text.isBlockBreak()}isEqualTo(e){return!!super.isEqualTo(e)||this.text.isEqualTo(e==null?void 0:e.text)&&Ts(this.attributes,e==null?void 0:e.attributes)&&Fo(this.htmlAttributes,e==null?void 0:e.htmlAttributes)}copyWithText(e){return new Xi(e,this.attributes,this.htmlAttributes)}copyWithoutText(){return this.copyWithText(null)}copyWithAttributes(e){return new Xi(this.text,e,this.htmlAttributes)}copyWithoutAttributes(){return this.copyWithAttributes(null)}copyUsingObjectMap(e){const t=e.find(this.text);return t?this.copyWithText(t):this.copyWithText(this.text.copyUsingObjectMap(e))}addAttribute(e){const t=this.attributes.concat(o0(e));return this.copyWithAttributes(t)}addHTMLAttribute(e,t){const n=Object.assign({},this.htmlAttributes,{[e]:t});return new Xi(this.text,this.attributes,n)}removeAttribute(e){const{listAttribute:t}=zt(e),n=a0(a0(this.attributes,e),t);return this.copyWithAttributes(n)}removeLastAttribute(){return this.removeAttribute(this.getLastAttribute())}getLastAttribute(){return l0(this.attributes)}getAttributes(){return this.attributes.slice(0)}getAttributeLevel(){return this.attributes.length}getAttributeAtLevel(e){return this.attributes[e-1]}hasAttribute(e){return this.attributes.includes(e)}hasAttributes(){return this.getAttributeLevel()>0}getLastNestableAttribute(){return l0(this.getNestableAttributes())}getNestableAttributes(){return this.attributes.filter(e=>zt(e).nestable)}getNestingLevel(){return this.getNestableAttributes().length}decreaseNestingLevel(){const e=this.getLastNestableAttribute();return e?this.removeAttribute(e):this}increaseNestingLevel(){const e=this.getLastNestableAttribute();if(e){const t=this.attributes.lastIndexOf(e),n=Km(this.attributes,t+1,0,...o0(e));return this.copyWithAttributes(n)}return this}getListItemAttributes(){return this.attributes.filter(e=>zt(e).listAttribute)}isListItem(){var e;return(e=zt(this.getLastAttribute()))===null||e===void 0?void 0:e.listAttribute}isTerminalBlock(){var e;return(e=zt(this.getLastAttribute()))===null||e===void 0?void 0:e.terminal}breaksOnReturn(){var e;return(e=zt(this.getLastAttribute()))===null||e===void 0?void 0:e.breakOnReturn}findLineBreakInDirectionFromPosition(e,t){const n=this.toString();let r;switch(e){case"forward":r=n.indexOf(` `,t);break;case"backward":r=n.slice(0,t).lastIndexOf(` -`)}if(r!==-1)return r}contentsForInspection(){return{text:this.text.inspect(),attributes:this.attributes}}toString(){return this.text.toString()}toJSON(){return{text:this.text,attributes:this.attributes,htmlAttributes:this.htmlAttributes}}getDirection(){return this.text.getDirection()}isRTL(){return this.text.isRTL()}getLength(){return this.text.getLength()}canBeConsolidatedWith(e){return!this.hasAttributes()&&!e.hasAttributes()&&this.getDirection()===e.getDirection()}consolidateWith(e){const t=_i.textForStringWithAttributes(` -`),n=this.getTextWithoutBlockBreak().appendText(t);return this.copyWithText(n.appendText(e.text))}splitAtOffset(e){let t,n;return e===0?(t=null,n=this):e===this.getLength()?(t=this,n=null):(t=this.copyWithText(this.text.getTextAtRange([0,e])),n=this.copyWithText(this.text.getTextAtRange([e,this.getLength()]))),[t,n]}getBlockBreakPosition(){return this.text.getLength()-1}getTextWithoutBlockBreak(){return Qk(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()}canBeGrouped(e){return this.attributes[e]}canBeGroupedWith(e,t){const n=e.getAttributes(),r=n[t],s=this.attributes[t];return s===r&&!(zt(s).group===!1&&!(()=>{if(!rc){rc=[];for(const o in Sn){const{listAttribute:l}=Sn[o];l!=null&&rc.push(l)}}return rc})().includes(n[t+1]))&&(this.getDirection()===e.getDirection()||e.isEmpty())}}const _4=function(i){return i=C4(i),i=A4(i)},C4=function(i){let e=!1;const t=i.getPieces();let n=t.slice(0,t.length-1);const r=t[t.length-1];return r?(n=n.map(s=>s.isBlockBreak()?(e=!0,x4(s)):s),e?new _i([...n,r]):i):i},P4=_i.textForStringWithAttributes(` -`,{blockBreak:!0}),A4=function(i){return Qk(i)?i:i.appendText(P4)},Qk=function(i){const e=i.getLength();return e===0?!1:i.getTextAtRange([e-1,e]).isBlockBreak()},x4=i=>i.copyWithoutAttribute("blockBreak"),p0=function(i){const{listAttribute:e}=zt(i);return e?[e,i]:[i]},g0=i=>i.slice(-1)[0],O0=function(i,e){const t=i.lastIndexOf(e);return t===-1?i:ep(i,t,1)};class si extends Is{static fromJSON(e){return new this(Array.from(e).map(t=>Xi.fromJSON(t)))}static fromString(e,t){const n=_i.textForStringWithAttributes(e,t);return new this([new Xi(n)])}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),e.length===0&&(e=[new Xi]),this.blockList=ku.box(e)}isEmpty(){const e=this.getBlockAtIndex(0);return this.blockList.length===1&&e.isEmpty()&&!e.hasAttributes()}copy(){const e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(e)}copyUsingObjectsFromDocument(e){const t=new NR(e.getObjects());return this.copyUsingObjectMap(t)}copyUsingObjectMap(e){const t=this.getBlocks().map(n=>e.find(n)||n.copyUsingObjectMap(e));return new this.constructor(t)}copyWithBaseBlockAttributes(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const t=this.getBlocks().map(n=>{const r=e.concat(n.getAttributes());return n.copyWithAttributes(r)});return new this.constructor(t)}replaceBlock(e,t){const n=this.blockList.indexOf(e);return n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(t,n))}insertDocumentAtRange(e,t){const{blockList:n}=e;t=bt(t);let[r]=t;const{index:s,offset:o}=this.locationFromPosition(r);let l=this;const a=this.getBlockAtPosition(r);return or(t)&&a.isEmpty()&&!a.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(s)):a.getBlockBreakPosition()===o&&r++,l=l.removeTextAtRange(t),new this.constructor(l.blockList.insertSplittableListAtPosition(n,r))}mergeDocumentAtRange(e,t){let n,r;t=bt(t);const[s]=t,o=this.locationFromPosition(s),l=this.getBlockAtIndex(o.index).getAttributes(),a=e.getBaseBlockAttributes(),c=l.slice(-a.length);if(xs(a,c)){const f=l.slice(0,-a.length);n=e.copyWithBaseBlockAttributes(f)}else n=e.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(l);const u=n.getBlockCount(),h=n.getBlockAtIndex(0);if(xs(l,h.getAttributes())){const f=h.getTextWithoutBlockBreak();if(r=this.insertTextAtRange(f,t),u>1){n=new this.constructor(n.getBlocks().slice(1));const d=s+f.getLength();r=r.insertDocumentAtRange(n,d)}}else r=this.insertDocumentAtRange(n,t);return r}insertTextAtRange(e,t){t=bt(t);const[n]=t,{index:r,offset:s}=this.locationFromPosition(n),o=this.removeTextAtRange(t);return new this.constructor(o.blockList.editObjectAtIndex(r,l=>l.copyWithText(l.text.insertTextAtPosition(e,s))))}removeTextAtRange(e){let t;e=bt(e);const[n,r]=e;if(or(e))return this;const[s,o]=Array.from(this.locationRangeFromRange(e)),l=s.index,a=s.offset,c=this.getBlockAtIndex(l),u=o.index,h=o.offset,f=this.getBlockAtIndex(u);if(r-n==1&&c.getBlockBreakPosition()===a&&f.getBlockBreakPosition()!==h&&f.text.getStringAtPosition(h)===` -`)t=this.blockList.editObjectAtIndex(u,d=>d.copyWithText(d.text.removeTextAtRange([h,h+1])));else{let d;const m=c.text.getTextAtRange([0,a]),p=f.text.getTextAtRange([h,f.getLength()]),g=m.appendText(p);d=l!==u&&a===0&&c.getAttributeLevel()>=f.getAttributeLevel()?f.copyWithText(g):c.copyWithText(g);const b=u+1-l;t=this.blockList.splice(l,b,d)}return new this.constructor(t)}moveTextFromRangeToPosition(e,t){let n;e=bt(e);const[r,s]=e;if(r<=t&&t<=s)return this;let o=this.getDocumentAtRange(e),l=this.removeTextAtRange(e);const a=rr=r.editObjectAtIndex(l,function(){return zt(e)?s.addAttribute(e,t):o[0]===o[1]?s:s.copyWithText(s.text.addAttributeAtRange(e,t,o))})),new this.constructor(r)}addAttribute(e,t){let{blockList:n}=this;return this.eachBlock((r,s)=>n=n.editObjectAtIndex(s,()=>r.addAttribute(e,t))),new this.constructor(n)}removeAttributeAtRange(e,t){let{blockList:n}=this;return this.eachBlockAtRange(t,function(r,s,o){zt(e)?n=n.editObjectAtIndex(o,()=>r.removeAttribute(e)):s[0]!==s[1]&&(n=n.editObjectAtIndex(o,()=>r.copyWithText(r.text.removeAttributeAtRange(e,s))))}),new this.constructor(n)}updateAttributesForAttachment(e,t){const n=this.getRangeOfAttachment(t),[r]=Array.from(n),{index:s}=this.locationFromPosition(r),o=this.getTextAtIndex(s);return new this.constructor(this.blockList.editObjectAtIndex(s,l=>l.copyWithText(o.updateAttributesForAttachment(e,t))))}removeAttributeForAttachment(e,t){const n=this.getRangeOfAttachment(t);return this.removeAttributeAtRange(e,n)}setHTMLAttributeAtPosition(e,t,n){const r=this.getBlockAtPosition(e),s=r.addHTMLAttribute(t,n);return this.replaceBlock(r,s)}insertBlockBreakAtRange(e){let t;e=bt(e);const[n]=e,{offset:r}=this.locationFromPosition(n),s=this.removeTextAtRange(e);return r===0&&(t=[new Xi]),new this.constructor(s.blockList.insertSplittableListAtPosition(new ku(t),n))}applyBlockAttributeAtRange(e,t,n){const r=this.expandRangeToLineBreaksAndSplitBlocks(n);let s=r.document;n=r.range;const o=zt(e);if(o.listAttribute){s=s.removeLastListAttributeAtRange(n,{exceptAttributeName:e});const l=s.convertLineBreaksToBlockBreaksInRange(n);s=l.document,n=l.range}else s=o.exclusive?s.removeBlockAttributesAtRange(n):o.terminal?s.removeLastTerminalAttributeAtRange(n):s.consolidateBlocksAtRange(n);return s.addAttributeAtRange(e,t,n)}removeLastListAttributeAtRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{blockList:n}=this;return this.eachBlockAtRange(e,function(r,s,o){const l=r.getLastAttribute();l&&zt(l).listAttribute&&l!==t.exceptAttributeName&&(n=n.editObjectAtIndex(o,()=>r.removeAttribute(l)))}),new this.constructor(n)}removeLastTerminalAttributeAtRange(e){let{blockList:t}=this;return this.eachBlockAtRange(e,function(n,r,s){const o=n.getLastAttribute();o&&zt(o).terminal&&(t=t.editObjectAtIndex(s,()=>n.removeAttribute(o)))}),new this.constructor(t)}removeBlockAttributesAtRange(e){let{blockList:t}=this;return this.eachBlockAtRange(e,function(n,r,s){n.hasAttributes()&&(t=t.editObjectAtIndex(s,()=>n.copyWithoutAttributes()))}),new this.constructor(t)}expandRangeToLineBreaksAndSplitBlocks(e){let t;e=bt(e);let[n,r]=e;const s=this.locationFromPosition(n),o=this.locationFromPosition(r);let l=this;const a=l.getBlockAtIndex(s.index);if(s.offset=a.findLineBreakInDirectionFromPosition("backward",s.offset),s.offset!=null&&(t=l.positionFromLocation(s),l=l.insertBlockBreakAtRange([t,t+1]),o.index+=1,o.offset-=l.getBlockAtIndex(s.index).getLength(),s.index+=1),s.offset=0,o.offset===0&&o.index>s.index)o.index-=1,o.offset=l.getBlockAtIndex(o.index).getBlockBreakPosition();else{const c=l.getBlockAtIndex(o.index);c.text.getStringAtRange([o.offset-1,o.offset])===` -`?o.offset-=1:o.offset=c.findLineBreakInDirectionFromPosition("forward",o.offset),o.offset!==c.getBlockBreakPosition()&&(t=l.positionFromLocation(o),l=l.insertBlockBreakAtRange([t,t+1]))}return n=l.positionFromLocation(s),r=l.positionFromLocation(o),{document:l,range:e=bt([n,r])}}convertLineBreaksToBlockBreaksInRange(e){e=bt(e);let[t]=e;const n=this.getStringAtRange(e).slice(0,-1);let r=this;return n.replace(/.*?\n/g,function(s){t+=s.length,r=r.insertBlockBreakAtRange([t-1,t])}),{document:r,range:e}}consolidateBlocksAtRange(e){e=bt(e);const[t,n]=e,r=this.locationFromPosition(t).index,s=this.locationFromPosition(n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(r,s))}getDocumentAtRange(e){e=bt(e);const t=this.blockList.getSplittableListInRange(e).toArray();return new this.constructor(t)}getStringAtRange(e){let t;const n=e=bt(e);return n[n.length-1]!==this.getLength()&&(t=-1),this.getDocumentAtRange(e).toString().slice(0,t)}getBlockAtIndex(e){return this.blockList.getObjectAtIndex(e)}getBlockAtPosition(e){const{index:t}=this.locationFromPosition(e);return this.getBlockAtIndex(t)}getTextAtIndex(e){var t;return(t=this.getBlockAtIndex(e))===null||t===void 0?void 0:t.text}getTextAtPosition(e){const{index:t}=this.locationFromPosition(e);return this.getTextAtIndex(t)}getPieceAtPosition(e){const{index:t,offset:n}=this.locationFromPosition(e);return this.getTextAtIndex(t).getPieceAtPosition(n)}getCharacterAtPosition(e){const{index:t,offset:n}=this.locationFromPosition(e);return this.getTextAtIndex(t).getStringAtRange([n,n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(e){return this.blockList.eachObject(e)}eachBlockAtRange(e,t){let n,r;e=bt(e);const[s,o]=e,l=this.locationFromPosition(s),a=this.locationFromPosition(o);if(l.index===a.index)return n=this.getBlockAtIndex(l.index),r=[l.offset,a.offset],t(n,r,l.index);for(let c=l.index;c<=a.index;c++)if(n=this.getBlockAtIndex(c),n){switch(c){case l.index:r=[l.offset,n.text.getLength()];break;case a.index:r=[0,a.offset];break;default:r=[0,n.text.getLength()]}t(n,r,c)}}getCommonAttributesAtRange(e){e=bt(e);const[t]=e;if(or(e))return this.getCommonAttributesAtPosition(t);{const n=[],r=[];return this.eachBlockAtRange(e,function(s,o){if(o[0]!==o[1])return n.push(s.text.getCommonAttributesAtRange(o)),r.push(b0(s))}),Kn.fromCommonAttributesOfObjects(n).merge(Kn.fromCommonAttributesOfObjects(r)).toObject()}}getCommonAttributesAtPosition(e){let t,n;const{index:r,offset:s}=this.locationFromPosition(e),o=this.getBlockAtIndex(r);if(!o)return{};const l=b0(o),a=o.text.getAttributesAtPosition(s),c=o.text.getAttributesAtPosition(s-1),u=Object.keys(As).filter(h=>As[h].inheritable);for(t in c)n=c[t],(n===a[t]||u.includes(t))&&(l[t]=n);return l}getRangeOfCommonAttributeAtPosition(e,t){const{index:n,offset:r}=this.locationFromPosition(t),s=this.getTextAtIndex(n),[o,l]=Array.from(s.getExpandedRangeForAttributeAtOffset(e,r)),a=this.positionFromLocation({index:n,offset:o}),c=this.positionFromLocation({index:n,offset:l});return bt([a,c])}getBaseBlockAttributes(){let e=this.getBlockAtIndex(0).getAttributes();for(let t=1;t{const s=[];for(let o=0;o{let{text:n}=t;return e=e.concat(n.getAttachmentPieces())}),e}getAttachments(){return this.getAttachmentPieces().map(e=>e.attachment)}getRangeOfAttachment(e){let t=0;const n=this.blockList.toArray();for(let r=0;r{const s=r.getLength();r.hasAttribute(e)&&n.push([t,t+s]),t+=s}),n}findRangesForTextAttribute(e){let{withValue:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=0,r=[];const s=[];return this.getPieces().forEach(o=>{const l=o.getLength();(function(a){return t?a.getAttribute(e)===t:a.hasAttribute(e)})(o)&&(r[1]===n?r[1]=n+l:s.push(r=[n,n+l])),n+=l}),s}locationFromPosition(e){const t=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,e));if(t.index!=null)return t;{const n=this.getBlocks();return{index:n.length-1,offset:n[n.length-1].getLength()}}}positionFromLocation(e){return this.blockList.findPositionAtIndexAndOffset(e.index,e.offset)}locationRangeFromPosition(e){return bt(this.locationFromPosition(e))}locationRangeFromRange(e){if(!(e=bt(e)))return;const[t,n]=Array.from(e),r=this.locationFromPosition(t),s=this.locationFromPosition(n);return bt([r,s])}rangeFromLocationRange(e){let t;e=bt(e);const n=this.positionFromLocation(e[0]);return or(e)||(t=this.positionFromLocation(e[1])),bt([n,t])}isEqualTo(e){return this.blockList.isEqualTo(e==null?void 0:e.blockList)}getTexts(){return this.getBlocks().map(e=>e.text)}getPieces(){const e=[];return Array.from(this.getTexts()).forEach(t=>{e.push(...Array.from(t.getPieces()||[]))}),e}getObjects(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())}toSerializableDocument(){const e=[];return this.blockList.eachObject(t=>e.push(t.copyWithText(t.text.toSerializableText()))),new this.constructor(e)}toString(){return this.blockList.toString()}toJSON(){return this.blockList.toJSON()}toConsole(){return JSON.stringify(this.blockList.toArray().map(e=>JSON.parse(e.text.toConsole())))}}const b0=function(i){const e={},t=i.getLastAttribute();return t&&(e[t]=!0),e},mf=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{string:i=yl(i),attributes:e,type:"string"}},v0=(i,e)=>{try{return JSON.parse(i.getAttribute("data-trix-".concat(e)))}catch{return{}}};class oa extends Kt{static parse(e,t){const n=new this(e,t);return n.parse(),n}constructor(e){let{referenceElement:t,purifyOptions:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.html=e,this.referenceElement=t,this.purifyOptions=n,this.blocks=[],this.blockElements=[],this.processedElements=[]}getDocument(){return si.fromJSON(this.blocks)}parse(){try{this.createHiddenContainer(),lh.setHTML(this.containerElement,this.html,{purifyOptions:this.purifyOptions});const e=vu(this.containerElement,{usingFilter:Q4});for(;e.nextNode();)this.processNode(e.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}}createHiddenContainer(){return this.referenceElement?(this.containerElement=this.referenceElement.cloneNode(!1),this.containerElement.removeAttribute("id"),this.containerElement.setAttribute("data-trix-internal",""),this.containerElement.style.display="none",this.referenceElement.parentNode.insertBefore(this.containerElement,this.referenceElement.nextSibling)):(this.containerElement=Ge({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.containerElement))}removeHiddenContainer(){return Vr(this.containerElement)}processNode(e){switch(e.nodeType){case Node.TEXT_NODE:if(!this.isInsignificantTextNode(e))return this.appendBlockForTextNode(e),this.processTextNode(e);break;case Node.ELEMENT_NODE:return this.appendBlockForElement(e),this.processElement(e)}}appendBlockForTextNode(e){const t=e.parentNode;if(t===this.currentBlockElement&&this.isBlockElement(e.previousSibling))return this.appendStringWithAttributes(` -`);if(t===this.containerElement||this.isBlockElement(t)){var n;const r=this.getBlockAttributes(t),s=this.getBlockHTMLAttributes(t);xs(r,(n=this.currentBlock)===null||n===void 0?void 0:n.attributes)||(this.currentBlock=this.appendBlockForAttributesWithElement(r,t,s),this.currentBlockElement=t)}}appendBlockForElement(e){const t=this.isBlockElement(e),n=vs(this.currentBlockElement,e);if(t&&!this.isBlockElement(e.firstChild)){if(!this.isInsignificantTextNode(e.firstChild)||!this.isBlockElement(e.firstElementChild)){const r=this.getBlockAttributes(e),s=this.getBlockHTMLAttributes(e);if(e.firstChild){if(n&&xs(r,this.currentBlock.attributes))return this.appendStringWithAttributes(` -`);this.currentBlock=this.appendBlockForAttributesWithElement(r,e,s),this.currentBlockElement=e}}}else if(this.currentBlockElement&&!n&&!t){const r=this.findParentBlockElement(e);if(r)return this.appendBlockForElement(r);this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null}}findParentBlockElement(e){let{parentElement:t}=e;for(;t&&t!==this.containerElement;){if(this.isBlockElement(t)&&this.blockElements.includes(t))return t;t=t.parentElement}return null}processTextNode(e){let t=e.data;var n;return w0(e.parentNode)||(t=ip(t),Mk((n=e.previousSibling)===null||n===void 0?void 0:n.textContent)&&(t=M4(t))),this.appendStringWithAttributes(t,this.getTextAttributes(e.parentNode))}processElement(e){let t;if(_s(e)){if(t=v0(e,"attachment"),Object.keys(t).length){const n=this.getTextAttributes(e);this.appendAttachmentWithAttributes(t,n),e.innerHTML=""}return this.processedElements.push(e)}switch(kn(e)){case"br":return this.isExtraBR(e)||this.isBlockElement(e.nextSibling)||this.appendStringWithAttributes(` -`,this.getTextAttributes(e)),this.processedElements.push(e);case"img":t={url:e.getAttribute("src"),contentType:"image"};const n=(r=>{const s=r.getAttribute("width"),o=r.getAttribute("height"),l={};return s&&(l.width=parseInt(s,10)),o&&(l.height=parseInt(o,10)),l})(e);for(const r in n){const s=n[r];t[r]=s}return this.appendAttachmentWithAttributes(t,this.getTextAttributes(e)),this.processedElements.push(e);case"tr":if(this.needsTableSeparator(e))return this.appendStringWithAttributes(Fc.tableRowSeparator);break;case"td":if(this.needsTableSeparator(e))return this.appendStringWithAttributes(Fc.tableCellSeparator)}}appendBlockForAttributesWithElement(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(t);const r=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(e,n);return this.blocks.push(r),r}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(e,t){return this.appendPiece(mf(e,t))}appendAttachmentWithAttributes(e,t){return this.appendPiece(function(n){return{attachment:n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:"attachment"}}(e,t))}appendPiece(e){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(e)}appendStringToTextAtIndex(e,t){const{text:n}=this.blocks[t],r=n[n.length-1];if((r==null?void 0:r.type)!=="string")return n.push(mf(e));r.string+=e}prependStringToTextAtIndex(e,t){const{text:n}=this.blocks[t],r=n[0];if((r==null?void 0:r.type)!=="string")return n.unshift(mf(e));r.string=e+r.string}getTextAttributes(e){let t;const n={};for(const r in As){const s=As[r];if(s.tagName&&zr(e,{matchingSelector:s.tagName,untilNode:this.containerElement}))n[r]=!0;else if(s.parser){if(t=s.parser(e),t){let o=!1;for(const l of this.findBlockElementAncestors(e))if(s.parser(l)===t){o=!0;break}o||(n[r]=t)}}else s.styleProperty&&(t=e.style[s.styleProperty],t&&(n[r]=t))}if(_s(e)){const r=v0(e,"attributes");for(const s in r)t=r[s],n[s]=t}return n}getBlockAttributes(e){const t=[];for(;e&&e!==this.containerElement;){for(const r in Sn){const s=Sn[r];var n;s.parse!==!1&&kn(e)===s.tagName&&((n=s.test)!==null&&n!==void 0&&n.call(s,e)||!s.test)&&(t.push(r),s.listAttribute&&t.push(s.listAttribute))}e=e.parentNode}return t.reverse()}getBlockHTMLAttributes(e){const t={},n=Object.values(Sn).find(r=>r.tagName===kn(e));return((n==null?void 0:n.htmlAttributes)||[]).forEach(r=>{e.hasAttribute(r)&&(t[r]=e.getAttribute(r))}),t}findBlockElementAncestors(e){const t=[];for(;e&&e!==this.containerElement;){const n=kn(e);Il().includes(n)&&t.push(e),e=e.parentNode}return t}isBlockElement(e){if((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE&&!_s(e)&&!zr(e,{matchingSelector:"td",untilNode:this.containerElement}))return Il().includes(kn(e))||window.getComputedStyle(e).display==="block"}isInsignificantTextNode(e){if((e==null?void 0:e.nodeType)!==Node.TEXT_NODE||!E4(e.data))return;const{parentNode:t,previousSibling:n,nextSibling:r}=e;return T4(t.previousSibling)&&!this.isBlockElement(t.previousSibling)||w0(t)?void 0:!n||this.isBlockElement(n)||!r||this.isBlockElement(r)}isExtraBR(e){return kn(e)==="br"&&this.isBlockElement(e.parentNode)&&e.parentNode.lastChild===e}needsTableSeparator(e){if(Fc.removeBlankTableCells){var t;const n=(t=e.previousSibling)===null||t===void 0?void 0:t.textContent;return n&&/\S/.test(n)}return e.previousSibling}translateBlockElementMarginsToNewlines(){const e=this.getMarginOfDefaultBlockElement();for(let t=0;t2*e.top&&this.prependStringToTextAtIndex(` +`)}if(r!==-1)return r}contentsForInspection(){return{text:this.text.inspect(),attributes:this.attributes}}toString(){return this.text.toString()}toJSON(){return{text:this.text,attributes:this.attributes,htmlAttributes:this.htmlAttributes}}getDirection(){return this.text.getDirection()}isRTL(){return this.text.isRTL()}getLength(){return this.text.getLength()}canBeConsolidatedWith(e){return!this.hasAttributes()&&!e.hasAttributes()&&this.getDirection()===e.getDirection()}consolidateWith(e){const t=Si.textForStringWithAttributes(` +`),n=this.getTextWithoutBlockBreak().appendText(t);return this.copyWithText(n.appendText(e.text))}splitAtOffset(e){let t,n;return e===0?(t=null,n=this):e===this.getLength()?(t=this,n=null):(t=this.copyWithText(this.text.getTextAtRange([0,e])),n=this.copyWithText(this.text.getTextAtRange([e,this.getLength()]))),[t,n]}getBlockBreakPosition(){return this.text.getLength()-1}getTextWithoutBlockBreak(){return kk(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()}canBeGrouped(e){return this.attributes[e]}canBeGroupedWith(e,t){const n=e.getAttributes(),r=n[t],s=this.attributes[t];return s===r&&!(zt(s).group===!1&&!(()=>{if(!rc){rc=[];for(const o in Sn){const{listAttribute:l}=Sn[o];l!=null&&rc.push(l)}}return rc})().includes(n[t+1]))&&(this.getDirection()===e.getDirection()||e.isEmpty())}}const p4=function(i){return i=g4(i),i=b4(i)},g4=function(i){let e=!1;const t=i.getPieces();let n=t.slice(0,t.length-1);const r=t[t.length-1];return r?(n=n.map(s=>s.isBlockBreak()?(e=!0,v4(s)):s),e?new Si([...n,r]):i):i},O4=Si.textForStringWithAttributes(` +`,{blockBreak:!0}),b4=function(i){return kk(i)?i:i.appendText(O4)},kk=function(i){const e=i.getLength();return e===0?!1:i.getTextAtRange([e-1,e]).isBlockBreak()},v4=i=>i.copyWithoutAttribute("blockBreak"),o0=function(i){const{listAttribute:e}=zt(i);return e?[e,i]:[i]},l0=i=>i.slice(-1)[0],a0=function(i,e){const t=i.lastIndexOf(e);return t===-1?i:Km(i,t,1)};class si extends Ns{static fromJSON(e){return new this(Array.from(e).map(t=>Xi.fromJSON(t)))}static fromString(e,t){const n=Si.textForStringWithAttributes(e,t);return new this([new Xi(n)])}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),e.length===0&&(e=[new Xi]),this.blockList=ku.box(e)}isEmpty(){const e=this.getBlockAtIndex(0);return this.blockList.length===1&&e.isEmpty()&&!e.hasAttributes()}copy(){const e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray();return new this.constructor(e)}copyUsingObjectsFromDocument(e){const t=new TR(e.getObjects());return this.copyUsingObjectMap(t)}copyUsingObjectMap(e){const t=this.getBlocks().map(n=>e.find(n)||n.copyUsingObjectMap(e));return new this.constructor(t)}copyWithBaseBlockAttributes(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const t=this.getBlocks().map(n=>{const r=e.concat(n.getAttributes());return n.copyWithAttributes(r)});return new this.constructor(t)}replaceBlock(e,t){const n=this.blockList.indexOf(e);return n===-1?this:new this.constructor(this.blockList.replaceObjectAtIndex(t,n))}insertDocumentAtRange(e,t){const{blockList:n}=e;t=bt(t);let[r]=t;const{index:s,offset:o}=this.locationFromPosition(r);let l=this;const a=this.getBlockAtPosition(r);return or(t)&&a.isEmpty()&&!a.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(s)):a.getBlockBreakPosition()===o&&r++,l=l.removeTextAtRange(t),new this.constructor(l.blockList.insertSplittableListAtPosition(n,r))}mergeDocumentAtRange(e,t){let n,r;t=bt(t);const[s]=t,o=this.locationFromPosition(s),l=this.getBlockAtIndex(o.index).getAttributes(),a=e.getBaseBlockAttributes(),c=l.slice(-a.length);if(Ts(a,c)){const f=l.slice(0,-a.length);n=e.copyWithBaseBlockAttributes(f)}else n=e.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(l);const u=n.getBlockCount(),h=n.getBlockAtIndex(0);if(Ts(l,h.getAttributes())){const f=h.getTextWithoutBlockBreak();if(r=this.insertTextAtRange(f,t),u>1){n=new this.constructor(n.getBlocks().slice(1));const d=s+f.getLength();r=r.insertDocumentAtRange(n,d)}}else r=this.insertDocumentAtRange(n,t);return r}insertTextAtRange(e,t){t=bt(t);const[n]=t,{index:r,offset:s}=this.locationFromPosition(n),o=this.removeTextAtRange(t);return new this.constructor(o.blockList.editObjectAtIndex(r,l=>l.copyWithText(l.text.insertTextAtPosition(e,s))))}removeTextAtRange(e){let t;e=bt(e);const[n,r]=e;if(or(e))return this;const[s,o]=Array.from(this.locationRangeFromRange(e)),l=s.index,a=s.offset,c=this.getBlockAtIndex(l),u=o.index,h=o.offset,f=this.getBlockAtIndex(u);if(r-n==1&&c.getBlockBreakPosition()===a&&f.getBlockBreakPosition()!==h&&f.text.getStringAtPosition(h)===` +`)t=this.blockList.editObjectAtIndex(u,d=>d.copyWithText(d.text.removeTextAtRange([h,h+1])));else{let d;const m=c.text.getTextAtRange([0,a]),p=f.text.getTextAtRange([h,f.getLength()]),g=m.appendText(p);d=l!==u&&a===0&&c.getAttributeLevel()>=f.getAttributeLevel()?f.copyWithText(g):c.copyWithText(g);const v=u+1-l;t=this.blockList.splice(l,v,d)}return new this.constructor(t)}moveTextFromRangeToPosition(e,t){let n;e=bt(e);const[r,s]=e;if(r<=t&&t<=s)return this;let o=this.getDocumentAtRange(e),l=this.removeTextAtRange(e);const a=rr=r.editObjectAtIndex(l,function(){return zt(e)?s.addAttribute(e,t):o[0]===o[1]?s:s.copyWithText(s.text.addAttributeAtRange(e,t,o))})),new this.constructor(r)}addAttribute(e,t){let{blockList:n}=this;return this.eachBlock((r,s)=>n=n.editObjectAtIndex(s,()=>r.addAttribute(e,t))),new this.constructor(n)}removeAttributeAtRange(e,t){let{blockList:n}=this;return this.eachBlockAtRange(t,function(r,s,o){zt(e)?n=n.editObjectAtIndex(o,()=>r.removeAttribute(e)):s[0]!==s[1]&&(n=n.editObjectAtIndex(o,()=>r.copyWithText(r.text.removeAttributeAtRange(e,s))))}),new this.constructor(n)}updateAttributesForAttachment(e,t){const n=this.getRangeOfAttachment(t),[r]=Array.from(n),{index:s}=this.locationFromPosition(r),o=this.getTextAtIndex(s);return new this.constructor(this.blockList.editObjectAtIndex(s,l=>l.copyWithText(o.updateAttributesForAttachment(e,t))))}removeAttributeForAttachment(e,t){const n=this.getRangeOfAttachment(t);return this.removeAttributeAtRange(e,n)}setHTMLAttributeAtPosition(e,t,n){const r=this.getBlockAtPosition(e),s=r.addHTMLAttribute(t,n);return this.replaceBlock(r,s)}insertBlockBreakAtRange(e){let t;e=bt(e);const[n]=e,{offset:r}=this.locationFromPosition(n),s=this.removeTextAtRange(e);return r===0&&(t=[new Xi]),new this.constructor(s.blockList.insertSplittableListAtPosition(new ku(t),n))}applyBlockAttributeAtRange(e,t,n){const r=this.expandRangeToLineBreaksAndSplitBlocks(n);let s=r.document;n=r.range;const o=zt(e);if(o.listAttribute){s=s.removeLastListAttributeAtRange(n,{exceptAttributeName:e});const l=s.convertLineBreaksToBlockBreaksInRange(n);s=l.document,n=l.range}else s=o.exclusive?s.removeBlockAttributesAtRange(n):o.terminal?s.removeLastTerminalAttributeAtRange(n):s.consolidateBlocksAtRange(n);return s.addAttributeAtRange(e,t,n)}removeLastListAttributeAtRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{blockList:n}=this;return this.eachBlockAtRange(e,function(r,s,o){const l=r.getLastAttribute();l&&zt(l).listAttribute&&l!==t.exceptAttributeName&&(n=n.editObjectAtIndex(o,()=>r.removeAttribute(l)))}),new this.constructor(n)}removeLastTerminalAttributeAtRange(e){let{blockList:t}=this;return this.eachBlockAtRange(e,function(n,r,s){const o=n.getLastAttribute();o&&zt(o).terminal&&(t=t.editObjectAtIndex(s,()=>n.removeAttribute(o)))}),new this.constructor(t)}removeBlockAttributesAtRange(e){let{blockList:t}=this;return this.eachBlockAtRange(e,function(n,r,s){n.hasAttributes()&&(t=t.editObjectAtIndex(s,()=>n.copyWithoutAttributes()))}),new this.constructor(t)}expandRangeToLineBreaksAndSplitBlocks(e){let t;e=bt(e);let[n,r]=e;const s=this.locationFromPosition(n),o=this.locationFromPosition(r);let l=this;const a=l.getBlockAtIndex(s.index);if(s.offset=a.findLineBreakInDirectionFromPosition("backward",s.offset),s.offset!=null&&(t=l.positionFromLocation(s),l=l.insertBlockBreakAtRange([t,t+1]),o.index+=1,o.offset-=l.getBlockAtIndex(s.index).getLength(),s.index+=1),s.offset=0,o.offset===0&&o.index>s.index)o.index-=1,o.offset=l.getBlockAtIndex(o.index).getBlockBreakPosition();else{const c=l.getBlockAtIndex(o.index);c.text.getStringAtRange([o.offset-1,o.offset])===` +`?o.offset-=1:o.offset=c.findLineBreakInDirectionFromPosition("forward",o.offset),o.offset!==c.getBlockBreakPosition()&&(t=l.positionFromLocation(o),l=l.insertBlockBreakAtRange([t,t+1]))}return n=l.positionFromLocation(s),r=l.positionFromLocation(o),{document:l,range:e=bt([n,r])}}convertLineBreaksToBlockBreaksInRange(e){e=bt(e);let[t]=e;const n=this.getStringAtRange(e).slice(0,-1);let r=this;return n.replace(/.*?\n/g,function(s){t+=s.length,r=r.insertBlockBreakAtRange([t-1,t])}),{document:r,range:e}}consolidateBlocksAtRange(e){e=bt(e);const[t,n]=e,r=this.locationFromPosition(t).index,s=this.locationFromPosition(n).index;return new this.constructor(this.blockList.consolidateFromIndexToIndex(r,s))}getDocumentAtRange(e){e=bt(e);const t=this.blockList.getSplittableListInRange(e).toArray();return new this.constructor(t)}getStringAtRange(e){let t;const n=e=bt(e);return n[n.length-1]!==this.getLength()&&(t=-1),this.getDocumentAtRange(e).toString().slice(0,t)}getBlockAtIndex(e){return this.blockList.getObjectAtIndex(e)}getBlockAtPosition(e){const{index:t}=this.locationFromPosition(e);return this.getBlockAtIndex(t)}getTextAtIndex(e){var t;return(t=this.getBlockAtIndex(e))===null||t===void 0?void 0:t.text}getTextAtPosition(e){const{index:t}=this.locationFromPosition(e);return this.getTextAtIndex(t)}getPieceAtPosition(e){const{index:t,offset:n}=this.locationFromPosition(e);return this.getTextAtIndex(t).getPieceAtPosition(n)}getCharacterAtPosition(e){const{index:t,offset:n}=this.locationFromPosition(e);return this.getTextAtIndex(t).getStringAtRange([n,n+1])}getLength(){return this.blockList.getEndPosition()}getBlocks(){return this.blockList.toArray()}getBlockCount(){return this.blockList.length}getEditCount(){return this.editCount}eachBlock(e){return this.blockList.eachObject(e)}eachBlockAtRange(e,t){let n,r;e=bt(e);const[s,o]=e,l=this.locationFromPosition(s),a=this.locationFromPosition(o);if(l.index===a.index)return n=this.getBlockAtIndex(l.index),r=[l.offset,a.offset],t(n,r,l.index);for(let c=l.index;c<=a.index;c++)if(n=this.getBlockAtIndex(c),n){switch(c){case l.index:r=[l.offset,n.text.getLength()];break;case a.index:r=[0,a.offset];break;default:r=[0,n.text.getLength()]}t(n,r,c)}}getCommonAttributesAtRange(e){e=bt(e);const[t]=e;if(or(e))return this.getCommonAttributesAtPosition(t);{const n=[],r=[];return this.eachBlockAtRange(e,function(s,o){if(o[0]!==o[1])return n.push(s.text.getCommonAttributesAtRange(o)),r.push(c0(s))}),Kn.fromCommonAttributesOfObjects(n).merge(Kn.fromCommonAttributesOfObjects(r)).toObject()}}getCommonAttributesAtPosition(e){let t,n;const{index:r,offset:s}=this.locationFromPosition(e),o=this.getBlockAtIndex(r);if(!o)return{};const l=c0(o),a=o.text.getAttributesAtPosition(s),c=o.text.getAttributesAtPosition(s-1),u=Object.keys(xs).filter(h=>xs[h].inheritable);for(t in c)n=c[t],(n===a[t]||u.includes(t))&&(l[t]=n);return l}getRangeOfCommonAttributeAtPosition(e,t){const{index:n,offset:r}=this.locationFromPosition(t),s=this.getTextAtIndex(n),[o,l]=Array.from(s.getExpandedRangeForAttributeAtOffset(e,r)),a=this.positionFromLocation({index:n,offset:o}),c=this.positionFromLocation({index:n,offset:l});return bt([a,c])}getBaseBlockAttributes(){let e=this.getBlockAtIndex(0).getAttributes();for(let t=1;t{const s=[];for(let o=0;o{let{text:n}=t;return e=e.concat(n.getAttachmentPieces())}),e}getAttachments(){return this.getAttachmentPieces().map(e=>e.attachment)}getRangeOfAttachment(e){let t=0;const n=this.blockList.toArray();for(let r=0;r{const s=r.getLength();r.hasAttribute(e)&&n.push([t,t+s]),t+=s}),n}findRangesForTextAttribute(e){let{withValue:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=0,r=[];const s=[];return this.getPieces().forEach(o=>{const l=o.getLength();(function(a){return t?a.getAttribute(e)===t:a.hasAttribute(e)})(o)&&(r[1]===n?r[1]=n+l:s.push(r=[n,n+l])),n+=l}),s}locationFromPosition(e){const t=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,e));if(t.index!=null)return t;{const n=this.getBlocks();return{index:n.length-1,offset:n[n.length-1].getLength()}}}positionFromLocation(e){return this.blockList.findPositionAtIndexAndOffset(e.index,e.offset)}locationRangeFromPosition(e){return bt(this.locationFromPosition(e))}locationRangeFromRange(e){if(!(e=bt(e)))return;const[t,n]=Array.from(e),r=this.locationFromPosition(t),s=this.locationFromPosition(n);return bt([r,s])}rangeFromLocationRange(e){let t;e=bt(e);const n=this.positionFromLocation(e[0]);return or(e)||(t=this.positionFromLocation(e[1])),bt([n,t])}isEqualTo(e){return this.blockList.isEqualTo(e==null?void 0:e.blockList)}getTexts(){return this.getBlocks().map(e=>e.text)}getPieces(){const e=[];return Array.from(this.getTexts()).forEach(t=>{e.push(...Array.from(t.getPieces()||[]))}),e}getObjects(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())}toSerializableDocument(){const e=[];return this.blockList.eachObject(t=>e.push(t.copyWithText(t.text.toSerializableText()))),new this.constructor(e)}toString(){return this.blockList.toString()}toJSON(){return this.blockList.toJSON()}toConsole(){return JSON.stringify(this.blockList.toArray().map(e=>JSON.parse(e.text.toConsole())))}}const c0=function(i){const e={},t=i.getLastAttribute();return t&&(e[t]=!0),e},mf=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{string:i=kl(i),attributes:e,type:"string"}},u0=(i,e)=>{try{return JSON.parse(i.getAttribute("data-trix-".concat(e)))}catch{return{}}};class oa extends Kt{static parse(e,t){const n=new this(e,t);return n.parse(),n}constructor(e){let{referenceElement:t,purifyOptions:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(...arguments),this.html=e,this.referenceElement=t,this.purifyOptions=n,this.blocks=[],this.blockElements=[],this.processedElements=[]}getDocument(){return si.fromJSON(this.blocks)}parse(){try{this.createHiddenContainer(),lh.setHTML(this.containerElement,this.html,{purifyOptions:this.purifyOptions});const e=vu(this.containerElement,{usingFilter:y4});for(;e.nextNode();)this.processNode(e.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}}createHiddenContainer(){return this.referenceElement?(this.containerElement=this.referenceElement.cloneNode(!1),this.containerElement.removeAttribute("id"),this.containerElement.setAttribute("data-trix-internal",""),this.containerElement.style.display="none",this.referenceElement.parentNode.insertBefore(this.containerElement,this.referenceElement.nextSibling)):(this.containerElement=Ge({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.containerElement))}removeHiddenContainer(){return zr(this.containerElement)}processNode(e){switch(e.nodeType){case Node.TEXT_NODE:if(!this.isInsignificantTextNode(e))return this.appendBlockForTextNode(e),this.processTextNode(e);break;case Node.ELEMENT_NODE:return this.appendBlockForElement(e),this.processElement(e)}}appendBlockForTextNode(e){const t=e.parentNode;if(t===this.currentBlockElement&&this.isBlockElement(e.previousSibling))return this.appendStringWithAttributes(` +`);if(t===this.containerElement||this.isBlockElement(t)){var n;const r=this.getBlockAttributes(t),s=this.getBlockHTMLAttributes(t);Ts(r,(n=this.currentBlock)===null||n===void 0?void 0:n.attributes)||(this.currentBlock=this.appendBlockForAttributesWithElement(r,t,s),this.currentBlockElement=t)}}appendBlockForElement(e){const t=this.isBlockElement(e),n=ws(this.currentBlockElement,e);if(t&&!this.isBlockElement(e.firstChild)){if(!this.isInsignificantTextNode(e.firstChild)||!this.isBlockElement(e.firstElementChild)){const r=this.getBlockAttributes(e),s=this.getBlockHTMLAttributes(e);if(e.firstChild){if(n&&Ts(r,this.currentBlock.attributes))return this.appendStringWithAttributes(` +`);this.currentBlock=this.appendBlockForAttributesWithElement(r,e,s),this.currentBlockElement=e}}}else if(this.currentBlockElement&&!n&&!t){const r=this.findParentBlockElement(e);if(r)return this.appendBlockForElement(r);this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null}}findParentBlockElement(e){let{parentElement:t}=e;for(;t&&t!==this.containerElement;){if(this.isBlockElement(t)&&this.blockElements.includes(t))return t;t=t.parentElement}return null}processTextNode(e){let t=e.data;var n;return h0(e.parentNode)||(t=tp(t),Sk((n=e.previousSibling)===null||n===void 0?void 0:n.textContent)&&(t=k4(t))),this.appendStringWithAttributes(t,this.getTextAttributes(e.parentNode))}processElement(e){let t;if(Cs(e)){if(t=u0(e,"attachment"),Object.keys(t).length){const n=this.getTextAttributes(e);this.appendAttachmentWithAttributes(t,n),e.innerHTML=""}return this.processedElements.push(e)}switch(kn(e)){case"br":return this.isExtraBR(e)||this.isBlockElement(e.nextSibling)||this.appendStringWithAttributes(` +`,this.getTextAttributes(e)),this.processedElements.push(e);case"img":t={url:e.getAttribute("src"),contentType:"image"};const n=(r=>{const s=r.getAttribute("width"),o=r.getAttribute("height"),l={};return s&&(l.width=parseInt(s,10)),o&&(l.height=parseInt(o,10)),l})(e);for(const r in n){const s=n[r];t[r]=s}return this.appendAttachmentWithAttributes(t,this.getTextAttributes(e)),this.processedElements.push(e);case"tr":if(this.needsTableSeparator(e))return this.appendStringWithAttributes(Fc.tableRowSeparator);break;case"td":if(this.needsTableSeparator(e))return this.appendStringWithAttributes(Fc.tableCellSeparator)}}appendBlockForAttributesWithElement(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.blockElements.push(t);const r=function(){return{text:[],attributes:arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},htmlAttributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}}}(e,n);return this.blocks.push(r),r}appendEmptyBlock(){return this.appendBlockForAttributesWithElement([],null)}appendStringWithAttributes(e,t){return this.appendPiece(mf(e,t))}appendAttachmentWithAttributes(e,t){return this.appendPiece(function(n){return{attachment:n,attributes:arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},type:"attachment"}}(e,t))}appendPiece(e){return this.blocks.length===0&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(e)}appendStringToTextAtIndex(e,t){const{text:n}=this.blocks[t],r=n[n.length-1];if((r==null?void 0:r.type)!=="string")return n.push(mf(e));r.string+=e}prependStringToTextAtIndex(e,t){const{text:n}=this.blocks[t],r=n[0];if((r==null?void 0:r.type)!=="string")return n.unshift(mf(e));r.string=e+r.string}getTextAttributes(e){let t;const n={};for(const r in xs){const s=xs[r];if(s.tagName&&Yr(e,{matchingSelector:s.tagName,untilNode:this.containerElement}))n[r]=!0;else if(s.parser){if(t=s.parser(e),t){let o=!1;for(const l of this.findBlockElementAncestors(e))if(s.parser(l)===t){o=!0;break}o||(n[r]=t)}}else s.styleProperty&&(t=e.style[s.styleProperty],t&&(n[r]=t))}if(Cs(e)){const r=u0(e,"attributes");for(const s in r)t=r[s],n[s]=t}return n}getBlockAttributes(e){const t=[];for(;e&&e!==this.containerElement;){for(const r in Sn){const s=Sn[r];var n;s.parse!==!1&&kn(e)===s.tagName&&((n=s.test)!==null&&n!==void 0&&n.call(s,e)||!s.test)&&(t.push(r),s.listAttribute&&t.push(s.listAttribute))}e=e.parentNode}return t.reverse()}getBlockHTMLAttributes(e){const t={},n=Object.values(Sn).find(r=>r.tagName===kn(e));return((n==null?void 0:n.htmlAttributes)||[]).forEach(r=>{e.hasAttribute(r)&&(t[r]=e.getAttribute(r))}),t}findBlockElementAncestors(e){const t=[];for(;e&&e!==this.containerElement;){const n=kn(e);Nl().includes(n)&&t.push(e),e=e.parentNode}return t}isBlockElement(e){if((e==null?void 0:e.nodeType)===Node.ELEMENT_NODE&&!Cs(e)&&!Yr(e,{matchingSelector:"td",untilNode:this.containerElement}))return Nl().includes(kn(e))||window.getComputedStyle(e).display==="block"}isInsignificantTextNode(e){if((e==null?void 0:e.nodeType)!==Node.TEXT_NODE||!S4(e.data))return;const{parentNode:t,previousSibling:n,nextSibling:r}=e;return w4(t.previousSibling)&&!this.isBlockElement(t.previousSibling)||h0(t)?void 0:!n||this.isBlockElement(n)||!r||this.isBlockElement(r)}isExtraBR(e){return kn(e)==="br"&&this.isBlockElement(e.parentNode)&&e.parentNode.lastChild===e}needsTableSeparator(e){if(Fc.removeBlankTableCells){var t;const n=(t=e.previousSibling)===null||t===void 0?void 0:t.textContent;return n&&/\S/.test(n)}return e.previousSibling}translateBlockElementMarginsToNewlines(){const e=this.getMarginOfDefaultBlockElement();for(let t=0;t2*e.top&&this.prependStringToTextAtIndex(` `,t),n.bottom>2*e.bottom&&this.appendStringToTextAtIndex(` -`,t))}}getMarginOfBlockElementAtIndex(e){const t=this.blockElements[e];if(t&&t.textContent&&!Il().includes(kn(t))&&!this.processedElements.includes(t))return y0(t)}getMarginOfDefaultBlockElement(){const e=Ge(Sn.default.tagName);return this.containerElement.appendChild(e),y0(e)}}const w0=function(i){const{whiteSpace:e}=window.getComputedStyle(i);return["pre","pre-wrap","pre-line"].includes(e)},T4=i=>i&&!Mk(i.textContent),y0=function(i){const e=window.getComputedStyle(i);if(e.display==="block")return{top:parseInt(e.marginTop),bottom:parseInt(e.marginBottom)}},Q4=function(i){return kn(i)==="style"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},M4=i=>i.replace(new RegExp("^".concat(np.source,"+")),""),E4=i=>new RegExp("^".concat(np.source,"*$")).test(i),Mk=i=>/\s$/.test(i),R4=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],Md="data-trix-serialized-attributes",D4="[".concat(Md,"]"),$4=new RegExp("","g"),L4={"application/json":function(i){let e;if(i instanceof si)e=i;else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");e=oa.parse(i.innerHTML).getDocument()}return e.toSerializableDocument().toJSONString()},"text/html":function(i){let e;if(i instanceof si)e=ah.render(i);else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");e=i.cloneNode(!0)}return Array.from(e.querySelectorAll("[data-trix-serialize=false]")).forEach(t=>{Vr(t)}),R4.forEach(t=>{Array.from(e.querySelectorAll("[".concat(t,"]"))).forEach(n=>{n.removeAttribute(t)})}),Array.from(e.querySelectorAll(D4)).forEach(t=>{try{const n=JSON.parse(t.getAttribute(Md));t.removeAttribute(Md);for(const r in n){const s=n[r];t.setAttribute(r,s)}}catch{}}),e.innerHTML.replace($4,"")}};var I4=Object.freeze({__proto__:null});class Nt extends Kt{constructor(e,t){super(...arguments),this.attachmentManager=e,this.attachment=t,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}}Nt.proxyMethod("attachment.getAttribute"),Nt.proxyMethod("attachment.hasAttribute"),Nt.proxyMethod("attachment.setAttribute"),Nt.proxyMethod("attachment.getAttributes"),Nt.proxyMethod("attachment.setAttributes"),Nt.proxyMethod("attachment.isPending"),Nt.proxyMethod("attachment.isPreviewable"),Nt.proxyMethod("attachment.getURL"),Nt.proxyMethod("attachment.getPreviewURL"),Nt.proxyMethod("attachment.setPreviewURL"),Nt.proxyMethod("attachment.getHref"),Nt.proxyMethod("attachment.getFilename"),Nt.proxyMethod("attachment.getFilesize"),Nt.proxyMethod("attachment.getFormattedFilesize"),Nt.proxyMethod("attachment.getExtension"),Nt.proxyMethod("attachment.getContentType"),Nt.proxyMethod("attachment.getFile"),Nt.proxyMethod("attachment.setFile"),Nt.proxyMethod("attachment.releaseFile"),Nt.proxyMethod("attachment.getUploadProgress"),Nt.proxyMethod("attachment.setUploadProgress");class Ek extends Kt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(e).forEach(t=>{this.manageAttachment(t)})}getAttachments(){const e=[];for(const t in this.managedAttachments){const n=this.managedAttachments[t];e.push(n)}return e}manageAttachment(e){return this.managedAttachments[e.id]||(this.managedAttachments[e.id]=new Nt(this,e)),this.managedAttachments[e.id]}attachmentIsManaged(e){return e.id in this.managedAttachments}requestRemovalOfAttachment(e){var t,n;if(this.attachmentIsManaged(e))return(t=this.delegate)===null||t===void 0||(n=t.attachmentManagerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(t,e)}unmanageAttachment(e){const t=this.managedAttachments[e.id];return delete this.managedAttachments[e.id],t}}class Rk{constructor(e){this.composition=e,this.document=this.composition.document;const t=this.composition.getSelectedRange();this.startPosition=t[0],this.endPosition=t[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}shouldInsertBlockBreak(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset!==0:this.breaksOnReturn&&this.nextCharacter!==` +`,t))}}getMarginOfBlockElementAtIndex(e){const t=this.blockElements[e];if(t&&t.textContent&&!Nl().includes(kn(t))&&!this.processedElements.includes(t))return f0(t)}getMarginOfDefaultBlockElement(){const e=Ge(Sn.default.tagName);return this.containerElement.appendChild(e),f0(e)}}const h0=function(i){const{whiteSpace:e}=window.getComputedStyle(i);return["pre","pre-wrap","pre-line"].includes(e)},w4=i=>i&&!Sk(i.textContent),f0=function(i){const e=window.getComputedStyle(i);if(e.display==="block")return{top:parseInt(e.marginTop),bottom:parseInt(e.marginBottom)}},y4=function(i){return kn(i)==="style"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},k4=i=>i.replace(new RegExp("^".concat(ep.source,"+")),""),S4=i=>new RegExp("^".concat(ep.source,"*$")).test(i),Sk=i=>/\s$/.test(i),_4=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],Md="data-trix-serialized-attributes",C4="[".concat(Md,"]"),P4=new RegExp("","g"),A4={"application/json":function(i){let e;if(i instanceof si)e=i;else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");e=oa.parse(i.innerHTML).getDocument()}return e.toSerializableDocument().toJSONString()},"text/html":function(i){let e;if(i instanceof si)e=ah.render(i);else{if(!(i instanceof HTMLElement))throw new Error("unserializable object");e=i.cloneNode(!0)}return Array.from(e.querySelectorAll("[data-trix-serialize=false]")).forEach(t=>{zr(t)}),_4.forEach(t=>{Array.from(e.querySelectorAll("[".concat(t,"]"))).forEach(n=>{n.removeAttribute(t)})}),Array.from(e.querySelectorAll(C4)).forEach(t=>{try{const n=JSON.parse(t.getAttribute(Md));t.removeAttribute(Md);for(const r in n){const s=n[r];t.setAttribute(r,s)}}catch{}}),e.innerHTML.replace(P4,"")}};var x4=Object.freeze({__proto__:null});class Nt extends Kt{constructor(e,t){super(...arguments),this.attachmentManager=e,this.attachment=t,this.id=this.attachment.id,this.file=this.attachment.file}remove(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)}}Nt.proxyMethod("attachment.getAttribute"),Nt.proxyMethod("attachment.hasAttribute"),Nt.proxyMethod("attachment.setAttribute"),Nt.proxyMethod("attachment.getAttributes"),Nt.proxyMethod("attachment.setAttributes"),Nt.proxyMethod("attachment.isPending"),Nt.proxyMethod("attachment.isPreviewable"),Nt.proxyMethod("attachment.getURL"),Nt.proxyMethod("attachment.getPreviewURL"),Nt.proxyMethod("attachment.setPreviewURL"),Nt.proxyMethod("attachment.getHref"),Nt.proxyMethod("attachment.getFilename"),Nt.proxyMethod("attachment.getFilesize"),Nt.proxyMethod("attachment.getFormattedFilesize"),Nt.proxyMethod("attachment.getExtension"),Nt.proxyMethod("attachment.getContentType"),Nt.proxyMethod("attachment.getFile"),Nt.proxyMethod("attachment.setFile"),Nt.proxyMethod("attachment.releaseFile"),Nt.proxyMethod("attachment.getUploadProgress"),Nt.proxyMethod("attachment.setUploadProgress");class _k extends Kt{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];super(...arguments),this.managedAttachments={},Array.from(e).forEach(t=>{this.manageAttachment(t)})}getAttachments(){const e=[];for(const t in this.managedAttachments){const n=this.managedAttachments[t];e.push(n)}return e}manageAttachment(e){return this.managedAttachments[e.id]||(this.managedAttachments[e.id]=new Nt(this,e)),this.managedAttachments[e.id]}attachmentIsManaged(e){return e.id in this.managedAttachments}requestRemovalOfAttachment(e){var t,n;if(this.attachmentIsManaged(e))return(t=this.delegate)===null||t===void 0||(n=t.attachmentManagerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(t,e)}unmanageAttachment(e){const t=this.managedAttachments[e.id];return delete this.managedAttachments[e.id],t}}class Ck{constructor(e){this.composition=e,this.document=this.composition.document;const t=this.composition.getSelectedRange();this.startPosition=t[0],this.endPosition=t[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}shouldInsertBlockBreak(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?this.startLocation.offset!==0:this.breaksOnReturn&&this.nextCharacter!==` `}shouldBreakFormattedBlock(){return this.block.hasAttributes()&&!this.block.isListItem()&&(this.breaksOnReturn&&this.nextCharacter===` `||this.previousCharacter===` -`)}shouldDecreaseListLevel(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()}shouldPrependListItem(){return this.block.isListItem()&&this.startLocation.offset===0&&!this.block.isEmpty()}shouldRemoveLastBlockAttribute(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()}}class Tr extends Kt{constructor(){super(...arguments),this.document=new si,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(e){var t,n;if(!e.isEqualTo(this.document))return this.document=e,this.refreshAttachments(),this.revision++,(t=this.delegate)===null||t===void 0||(n=t.compositionDidChangeDocument)===null||n===void 0?void 0:n.call(t,e)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(e){var t,n,r,s;let{document:o,selectedRange:l}=e;return(t=this.delegate)===null||t===void 0||(n=t.compositionWillLoadSnapshot)===null||n===void 0||n.call(t),this.setDocument(o??new si),this.setSelection(l??[0,0]),(r=this.delegate)===null||r===void 0||(s=r.compositionDidLoadSnapshot)===null||s===void 0?void 0:s.call(r)}insertText(e){let{updatePosition:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0};const n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(e,n));const r=n[0],s=r+e.getLength();return t&&this.setSelection(s),this.notifyDelegateOfInsertionAtRange([r,s])}insertBlock(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Xi;const t=new si([e]);return this.insertDocument(t)}insertDocument(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new si;const t=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(e,t));const n=t[0],r=n+e.getLength();return this.setSelection(r),this.notifyDelegateOfInsertionAtRange([n,r])}insertString(e,t){const n=this.getCurrentTextAttributes(),r=_i.textForStringWithAttributes(e,n);return this.insertText(r,t)}insertBlockBreak(){const e=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(e));const t=e[0],n=t+1;return this.setSelection(n),this.notifyDelegateOfInsertionAtRange([t,n])}insertLineBreak(){const e=new Rk(this);if(e.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(e.startPosition);if(e.shouldPrependListItem()){const t=new si([e.block.copyWithoutText()]);return this.insertDocument(t)}return e.shouldInsertBlockBreak()?this.insertBlockBreak():e.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():e.shouldBreakFormattedBlock()?this.breakFormattedBlock(e):this.insertString(` -`)}insertHTML(e){const t=oa.parse(e,{purifyOptions:{SAFE_FOR_XML:!0}}).getDocument(),n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(t,n));const r=n[0],s=r+t.getLength()-1;return this.setSelection(s),this.notifyDelegateOfInsertionAtRange([r,s])}replaceHTML(e){const t=oa.parse(e).getDocument().copyUsingObjectsFromDocument(this.document),n=this.getLocationRange({strict:!1}),r=this.document.rangeFromLocationRange(n);return this.setDocument(t),this.setSelection(r)}insertFile(e){return this.insertFiles([e])}insertFiles(e){const t=[];return Array.from(e).forEach(n=>{var r;if((r=this.delegate)!==null&&r!==void 0&&r.compositionShouldAcceptFile(n)){const s=Fo.attachmentForFile(n);t.push(s)}}),this.insertAttachments(t)}insertAttachment(e){return this.insertAttachments([e])}insertAttachments(e){let t=new _i;return Array.from(e).forEach(n=>{var r;const s=n.getType(),o=(r=Gm[s])===null||r===void 0?void 0:r.presentation,l=this.getCurrentTextAttributes();o&&(l.presentation=o);const a=_i.textForAttachmentWithAttributes(n,l);t=t.appendText(a)}),this.insertText(t)}shouldManageDeletingInDirection(e){const t=this.getLocationRange();if(or(t)){if(e==="backward"&&t[0].offset===0||this.shouldManageMovingCursorInDirection(e))return!0}else if(t[0].index!==t[1].index)return!0;return!1}deleteInDirection(e){let t,n,r,{length:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getLocationRange();let l=this.getSelectedRange();const a=or(l);if(a?n=e==="backward"&&o[0].offset===0:r=o[0].index!==o[1].index,n&&this.canDecreaseBlockAttributeLevel()){const c=this.getBlock();if(c.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(l[0]),c.isEmpty())return!1}return a&&(l=this.getExpandedRangeInDirection(e,{length:s}),e==="backward"&&(t=this.getAttachmentAtRange(l))),t?(this.editAttachment(t),!1):(this.setDocument(this.document.removeTextAtRange(l)),this.setSelection(l[0]),!n&&!r&&void 0)}moveTextFromRange(e){const[t]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(e,t)),this.setSelection(t)}removeAttachment(e){const t=this.document.getRangeOfAttachment(e);if(t)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(t)),this.setSelection(t[0])}removeLastBlockAttribute(){const[e,t]=Array.from(this.getSelectedRange()),n=this.document.getBlockAtPosition(t);return this.removeCurrentAttribute(n.getLastAttribute()),this.setSelection(e)}insertPlaceholder(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")}selectPlaceholder(){if(this.placeholderPosition!=null)return this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()}forgetPlaceholder(){this.placeholderPosition=null}hasCurrentAttribute(e){const t=this.currentAttributes[e];return t!=null&&t!==!1}toggleCurrentAttribute(e){const t=!this.currentAttributes[e];return t?this.setCurrentAttribute(e,t):this.removeCurrentAttribute(e)}canSetCurrentAttribute(e){return zt(e)?this.canSetCurrentBlockAttribute(e):this.canSetCurrentTextAttribute(e)}canSetCurrentTextAttribute(e){const t=this.getSelectedDocument();if(t){for(const n of Array.from(t.getAttachments()))if(!n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(e){const t=this.getBlock();if(t)return!t.isTerminalBlock()}setCurrentAttribute(e,t){return zt(e)?this.setBlockAttribute(e,t):(this.setTextAttribute(e,t),this.currentAttributes[e]=t,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(e,t,n){var r;const s=this.document.getBlockAtPosition(e),o=(r=zt(s.getLastAttribute()))===null||r===void 0?void 0:r.htmlAttributes;if(s&&o!=null&&o.includes(t)){const l=this.document.setHTMLAttributeAtPosition(e,t,n);this.setDocument(l)}}setTextAttribute(e,t){const n=this.getSelectedRange();if(!n)return;const[r,s]=Array.from(n);if(r!==s)return this.setDocument(this.document.addAttributeAtRange(e,t,n));if(e==="href"){const o=_i.textForStringWithAttributes(t,{href:t});return this.insertText(o)}}setBlockAttribute(e,t){const n=this.getSelectedRange();if(this.canSetCurrentAttribute(e))return this.setDocument(this.document.applyBlockAttributeAtRange(e,t,n)),this.setSelection(n)}removeCurrentAttribute(e){return zt(e)?(this.removeBlockAttribute(e),this.updateCurrentAttributes()):(this.removeTextAttribute(e),delete this.currentAttributes[e],this.notifyDelegateOfCurrentAttributesChange())}removeTextAttribute(e){const t=this.getSelectedRange();if(t)return this.setDocument(this.document.removeAttributeAtRange(e,t))}removeBlockAttribute(e){const t=this.getSelectedRange();if(t)return this.setDocument(this.document.removeAttributeAtRange(e,t))}canDecreaseNestingLevel(){var e;return((e=this.getBlock())===null||e===void 0?void 0:e.getNestingLevel())>0}canIncreaseNestingLevel(){var e;const t=this.getBlock();if(t){if((e=zt(t.getLastNestableAttribute()))===null||e===void 0||!e.listAttribute)return t.getNestingLevel()>0;{const n=this.getPreviousBlock();if(n)return function(){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return xs((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).slice(0,r.length),r)}(n.getListItemAttributes(),t.getListItemAttributes())}}}decreaseNestingLevel(){const e=this.getBlock();if(e)return this.setDocument(this.document.replaceBlock(e,e.decreaseNestingLevel()))}increaseNestingLevel(){const e=this.getBlock();if(e)return this.setDocument(this.document.replaceBlock(e,e.increaseNestingLevel()))}canDecreaseBlockAttributeLevel(){var e;return((e=this.getBlock())===null||e===void 0?void 0:e.getAttributeLevel())>0}decreaseBlockAttributeLevel(){var e;const t=(e=this.getBlock())===null||e===void 0?void 0:e.getLastAttribute();if(t)return this.removeCurrentAttribute(t)}decreaseListLevel(){let[e]=Array.from(this.getSelectedRange());const{index:t}=this.document.locationFromPosition(e);let n=t;const r=this.getBlock().getAttributeLevel();let s=this.document.getBlockAtIndex(n+1);for(;s&&s.isListItem()&&!(s.getAttributeLevel()<=r);)n++,s=this.document.getBlockAtIndex(n+1);e=this.document.positionFromLocation({index:t,offset:0});const o=this.document.positionFromLocation({index:n,offset:0});return this.setDocument(this.document.removeLastListAttributeAtRange([e,o]))}updateCurrentAttributes(){const e=this.getSelectedRange({ignoreLock:!0});if(e){const t=this.document.getCommonAttributesAtRange(e);if(Array.from(Pd()).forEach(n=>{t[n]||this.canSetCurrentAttribute(n)||(t[n]=!1)}),!Xo(t,this.currentAttributes))return this.currentAttributes=t,this.notifyDelegateOfCurrentAttributesChange()}}getCurrentAttributes(){return lk.call({},this.currentAttributes)}getCurrentTextAttributes(){const e={};for(const t in this.currentAttributes){const n=this.currentAttributes[t];n!==!1&&Ad(t)&&(e[t]=n)}return e}freezeSelection(){return this.setCurrentAttribute("frozen",!0)}thawSelection(){return this.removeCurrentAttribute("frozen")}hasFrozenSelection(){return this.hasCurrentAttribute("frozen")}setSelection(e){var t;const n=this.document.locationRangeFromRange(e);return(t=this.delegate)===null||t===void 0?void 0:t.compositionDidRequestChangingSelectionToLocationRange(n)}getSelectedRange(){const e=this.getLocationRange();if(e)return this.document.rangeFromLocationRange(e)}setSelectedRange(e){const t=this.document.locationRangeFromRange(e);return this.getSelectionManager().setLocationRange(t)}getPosition(){const e=this.getLocationRange();if(e)return this.document.positionFromLocation(e[0])}getLocationRange(e){return this.targetLocationRange?this.targetLocationRange:this.getSelectionManager().getLocationRange(e)||bt({index:0,offset:0})}withTargetLocationRange(e,t){let n;this.targetLocationRange=e;try{n=t()}finally{this.targetLocationRange=null}return n}withTargetRange(e,t){const n=this.document.locationRangeFromRange(e);return this.withTargetLocationRange(n,t)}withTargetDOMRange(e,t){const n=this.createLocationRangeFromDOMRange(e,{strict:!1});return this.withTargetLocationRange(n,t)}getExpandedRangeInDirection(e){let{length:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},[n,r]=Array.from(this.getSelectedRange());return e==="backward"?t?n-=t:n=this.translateUTF16PositionFromOffset(n,-1):t?r+=t:r=this.translateUTF16PositionFromOffset(r,1),bt([n,r])}shouldManageMovingCursorInDirection(e){if(this.editingAttachment)return!0;const t=this.getExpandedRangeInDirection(e);return this.getAttachmentAtRange(t)!=null}moveCursorInDirection(e){let t,n;if(this.editingAttachment)n=this.document.getRangeOfAttachment(this.editingAttachment);else{const r=this.getSelectedRange();n=this.getExpandedRangeInDirection(e),t=!wu(r,n)}if(e==="backward"?this.setSelectedRange(n[0]):this.setSelectedRange(n[1]),t){const r=this.getAttachmentAtRange(n);if(r)return this.editAttachment(r)}}expandSelectionInDirection(e){let{length:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getExpandedRangeInDirection(e,{length:t});return this.setSelectedRange(n)}expandSelectionForEditing(){if(this.hasCurrentAttribute("href"))return this.expandSelectionAroundCommonAttribute("href")}expandSelectionAroundCommonAttribute(e){const t=this.getPosition(),n=this.document.getRangeOfCommonAttributeAtPosition(e,t);return this.setSelectedRange(n)}selectionContainsAttachments(){var e;return((e=this.getSelectedAttachments())===null||e===void 0?void 0:e.length)>0}selectionIsInCursorTarget(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())}positionIsCursorTarget(e){const t=this.document.locationFromPosition(e);if(t)return this.locationIsCursorTarget(t)}positionIsBlockBreak(e){var t;return(t=this.document.getPieceAtPosition(e))===null||t===void 0?void 0:t.isBlockBreak()}getSelectedDocument(){const e=this.getSelectedRange();if(e)return this.document.getDocumentAtRange(e)}getSelectedAttachments(){var e;return(e=this.getSelectedDocument())===null||e===void 0?void 0:e.getAttachments()}getAttachments(){return this.attachments.slice(0)}refreshAttachments(){const e=this.document.getAttachments(),{added:t,removed:n}=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const o=[],l=[],a=new Set;r.forEach(u=>{a.add(u)});const c=new Set;return s.forEach(u=>{c.add(u),a.has(u)||o.push(u)}),r.forEach(u=>{c.has(u)||l.push(u)}),{added:o,removed:l}}(this.attachments,e);return this.attachments=e,Array.from(n).forEach(r=>{var s,o;r.delegate=null,(s=this.delegate)===null||s===void 0||(o=s.compositionDidRemoveAttachment)===null||o===void 0||o.call(s,r)}),(()=>{const r=[];return Array.from(t).forEach(s=>{var o,l;s.delegate=this,r.push((o=this.delegate)===null||o===void 0||(l=o.compositionDidAddAttachment)===null||l===void 0?void 0:l.call(o,s))}),r})()}attachmentDidChangeAttributes(e){var t,n;return this.revision++,(t=this.delegate)===null||t===void 0||(n=t.compositionDidEditAttachment)===null||n===void 0?void 0:n.call(t,e)}attachmentDidChangePreviewURL(e){var t,n;return this.revision++,(t=this.delegate)===null||t===void 0||(n=t.compositionDidChangeAttachmentPreviewURL)===null||n===void 0?void 0:n.call(t,e)}editAttachment(e,t){var n,r;if(e!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=e,(n=this.delegate)===null||n===void 0||(r=n.compositionDidStartEditingAttachment)===null||r===void 0?void 0:r.call(n,this.editingAttachment,t)}stopEditingAttachment(){var e,t;this.editingAttachment&&((e=this.delegate)===null||e===void 0||(t=e.compositionDidStopEditingAttachment)===null||t===void 0||t.call(e,this.editingAttachment),this.editingAttachment=null)}updateAttributesForAttachment(e,t){return this.setDocument(this.document.updateAttributesForAttachment(e,t))}removeAttributeForAttachment(e,t){return this.setDocument(this.document.removeAttributeForAttachment(e,t))}breakFormattedBlock(e){let{document:t}=e;const{block:n}=e;let r=e.startPosition,s=[r-1,r];n.getBlockBreakPosition()===e.startLocation.offset?(n.breaksOnReturn()&&e.nextCharacter===` +`)}shouldDecreaseListLevel(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()}shouldPrependListItem(){return this.block.isListItem()&&this.startLocation.offset===0&&!this.block.isEmpty()}shouldRemoveLastBlockAttribute(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()}}class Tr extends Kt{constructor(){super(...arguments),this.document=new si,this.attachments=[],this.currentAttributes={},this.revision=0}setDocument(e){var t,n;if(!e.isEqualTo(this.document))return this.document=e,this.refreshAttachments(),this.revision++,(t=this.delegate)===null||t===void 0||(n=t.compositionDidChangeDocument)===null||n===void 0?void 0:n.call(t,e)}getSnapshot(){return{document:this.document,selectedRange:this.getSelectedRange()}}loadSnapshot(e){var t,n,r,s;let{document:o,selectedRange:l}=e;return(t=this.delegate)===null||t===void 0||(n=t.compositionWillLoadSnapshot)===null||n===void 0||n.call(t),this.setDocument(o??new si),this.setSelection(l??[0,0]),(r=this.delegate)===null||r===void 0||(s=r.compositionDidLoadSnapshot)===null||s===void 0?void 0:s.call(r)}insertText(e){let{updatePosition:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{updatePosition:!0};const n=this.getSelectedRange();this.setDocument(this.document.insertTextAtRange(e,n));const r=n[0],s=r+e.getLength();return t&&this.setSelection(s),this.notifyDelegateOfInsertionAtRange([r,s])}insertBlock(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Xi;const t=new si([e]);return this.insertDocument(t)}insertDocument(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new si;const t=this.getSelectedRange();this.setDocument(this.document.insertDocumentAtRange(e,t));const n=t[0],r=n+e.getLength();return this.setSelection(r),this.notifyDelegateOfInsertionAtRange([n,r])}insertString(e,t){const n=this.getCurrentTextAttributes(),r=Si.textForStringWithAttributes(e,n);return this.insertText(r,t)}insertBlockBreak(){const e=this.getSelectedRange();this.setDocument(this.document.insertBlockBreakAtRange(e));const t=e[0],n=t+1;return this.setSelection(n),this.notifyDelegateOfInsertionAtRange([t,n])}insertLineBreak(){const e=new Ck(this);if(e.shouldDecreaseListLevel())return this.decreaseListLevel(),this.setSelection(e.startPosition);if(e.shouldPrependListItem()){const t=new si([e.block.copyWithoutText()]);return this.insertDocument(t)}return e.shouldInsertBlockBreak()?this.insertBlockBreak():e.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():e.shouldBreakFormattedBlock()?this.breakFormattedBlock(e):this.insertString(` +`)}insertHTML(e){const t=oa.parse(e,{purifyOptions:{SAFE_FOR_XML:!0}}).getDocument(),n=this.getSelectedRange();this.setDocument(this.document.mergeDocumentAtRange(t,n));const r=n[0],s=r+t.getLength()-1;return this.setSelection(s),this.notifyDelegateOfInsertionAtRange([r,s])}replaceHTML(e){const t=oa.parse(e).getDocument().copyUsingObjectsFromDocument(this.document),n=this.getLocationRange({strict:!1}),r=this.document.rangeFromLocationRange(n);return this.setDocument(t),this.setSelection(r)}insertFile(e){return this.insertFiles([e])}insertFiles(e){const t=[];return Array.from(e).forEach(n=>{var r;if((r=this.delegate)!==null&&r!==void 0&&r.compositionShouldAcceptFile(n)){const s=Yo.attachmentForFile(n);t.push(s)}}),this.insertAttachments(t)}insertAttachment(e){return this.insertAttachments([e])}insertAttachments(e){let t=new Si;return Array.from(e).forEach(n=>{var r;const s=n.getType(),o=(r=jm[s])===null||r===void 0?void 0:r.presentation,l=this.getCurrentTextAttributes();o&&(l.presentation=o);const a=Si.textForAttachmentWithAttributes(n,l);t=t.appendText(a)}),this.insertText(t)}shouldManageDeletingInDirection(e){const t=this.getLocationRange();if(or(t)){if(e==="backward"&&t[0].offset===0||this.shouldManageMovingCursorInDirection(e))return!0}else if(t[0].index!==t[1].index)return!0;return!1}deleteInDirection(e){let t,n,r,{length:s}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const o=this.getLocationRange();let l=this.getSelectedRange();const a=or(l);if(a?n=e==="backward"&&o[0].offset===0:r=o[0].index!==o[1].index,n&&this.canDecreaseBlockAttributeLevel()){const c=this.getBlock();if(c.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(l[0]),c.isEmpty())return!1}return a&&(l=this.getExpandedRangeInDirection(e,{length:s}),e==="backward"&&(t=this.getAttachmentAtRange(l))),t?(this.editAttachment(t),!1):(this.setDocument(this.document.removeTextAtRange(l)),this.setSelection(l[0]),!n&&!r&&void 0)}moveTextFromRange(e){const[t]=Array.from(this.getSelectedRange());return this.setDocument(this.document.moveTextFromRangeToPosition(e,t)),this.setSelection(t)}removeAttachment(e){const t=this.document.getRangeOfAttachment(e);if(t)return this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(t)),this.setSelection(t[0])}removeLastBlockAttribute(){const[e,t]=Array.from(this.getSelectedRange()),n=this.document.getBlockAtPosition(t);return this.removeCurrentAttribute(n.getLastAttribute()),this.setSelection(e)}insertPlaceholder(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")}selectPlaceholder(){if(this.placeholderPosition!=null)return this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+1]),this.getSelectedRange()}forgetPlaceholder(){this.placeholderPosition=null}hasCurrentAttribute(e){const t=this.currentAttributes[e];return t!=null&&t!==!1}toggleCurrentAttribute(e){const t=!this.currentAttributes[e];return t?this.setCurrentAttribute(e,t):this.removeCurrentAttribute(e)}canSetCurrentAttribute(e){return zt(e)?this.canSetCurrentBlockAttribute(e):this.canSetCurrentTextAttribute(e)}canSetCurrentTextAttribute(e){const t=this.getSelectedDocument();if(t){for(const n of Array.from(t.getAttachments()))if(!n.hasContent())return!1;return!0}}canSetCurrentBlockAttribute(e){const t=this.getBlock();if(t)return!t.isTerminalBlock()}setCurrentAttribute(e,t){return zt(e)?this.setBlockAttribute(e,t):(this.setTextAttribute(e,t),this.currentAttributes[e]=t,this.notifyDelegateOfCurrentAttributesChange())}setHTMLAtributeAtPosition(e,t,n){var r;const s=this.document.getBlockAtPosition(e),o=(r=zt(s.getLastAttribute()))===null||r===void 0?void 0:r.htmlAttributes;if(s&&o!=null&&o.includes(t)){const l=this.document.setHTMLAttributeAtPosition(e,t,n);this.setDocument(l)}}setTextAttribute(e,t){const n=this.getSelectedRange();if(!n)return;const[r,s]=Array.from(n);if(r!==s)return this.setDocument(this.document.addAttributeAtRange(e,t,n));if(e==="href"){const o=Si.textForStringWithAttributes(t,{href:t});return this.insertText(o)}}setBlockAttribute(e,t){const n=this.getSelectedRange();if(this.canSetCurrentAttribute(e))return this.setDocument(this.document.applyBlockAttributeAtRange(e,t,n)),this.setSelection(n)}removeCurrentAttribute(e){return zt(e)?(this.removeBlockAttribute(e),this.updateCurrentAttributes()):(this.removeTextAttribute(e),delete this.currentAttributes[e],this.notifyDelegateOfCurrentAttributesChange())}removeTextAttribute(e){const t=this.getSelectedRange();if(t)return this.setDocument(this.document.removeAttributeAtRange(e,t))}removeBlockAttribute(e){const t=this.getSelectedRange();if(t)return this.setDocument(this.document.removeAttributeAtRange(e,t))}canDecreaseNestingLevel(){var e;return((e=this.getBlock())===null||e===void 0?void 0:e.getNestingLevel())>0}canIncreaseNestingLevel(){var e;const t=this.getBlock();if(t){if((e=zt(t.getLastNestableAttribute()))===null||e===void 0||!e.listAttribute)return t.getNestingLevel()>0;{const n=this.getPreviousBlock();if(n)return function(){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Ts((arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).slice(0,r.length),r)}(n.getListItemAttributes(),t.getListItemAttributes())}}}decreaseNestingLevel(){const e=this.getBlock();if(e)return this.setDocument(this.document.replaceBlock(e,e.decreaseNestingLevel()))}increaseNestingLevel(){const e=this.getBlock();if(e)return this.setDocument(this.document.replaceBlock(e,e.increaseNestingLevel()))}canDecreaseBlockAttributeLevel(){var e;return((e=this.getBlock())===null||e===void 0?void 0:e.getAttributeLevel())>0}decreaseBlockAttributeLevel(){var e;const t=(e=this.getBlock())===null||e===void 0?void 0:e.getLastAttribute();if(t)return this.removeCurrentAttribute(t)}decreaseListLevel(){let[e]=Array.from(this.getSelectedRange());const{index:t}=this.document.locationFromPosition(e);let n=t;const r=this.getBlock().getAttributeLevel();let s=this.document.getBlockAtIndex(n+1);for(;s&&s.isListItem()&&!(s.getAttributeLevel()<=r);)n++,s=this.document.getBlockAtIndex(n+1);e=this.document.positionFromLocation({index:t,offset:0});const o=this.document.positionFromLocation({index:n,offset:0});return this.setDocument(this.document.removeLastListAttributeAtRange([e,o]))}updateCurrentAttributes(){const e=this.getSelectedRange({ignoreLock:!0});if(e){const t=this.document.getCommonAttributesAtRange(e);if(Array.from(Pd()).forEach(n=>{t[n]||this.canSetCurrentAttribute(n)||(t[n]=!1)}),!Fo(t,this.currentAttributes))return this.currentAttributes=t,this.notifyDelegateOfCurrentAttributesChange()}}getCurrentAttributes(){return Jy.call({},this.currentAttributes)}getCurrentTextAttributes(){const e={};for(const t in this.currentAttributes){const n=this.currentAttributes[t];n!==!1&&Ad(t)&&(e[t]=n)}return e}freezeSelection(){return this.setCurrentAttribute("frozen",!0)}thawSelection(){return this.removeCurrentAttribute("frozen")}hasFrozenSelection(){return this.hasCurrentAttribute("frozen")}setSelection(e){var t;const n=this.document.locationRangeFromRange(e);return(t=this.delegate)===null||t===void 0?void 0:t.compositionDidRequestChangingSelectionToLocationRange(n)}getSelectedRange(){const e=this.getLocationRange();if(e)return this.document.rangeFromLocationRange(e)}setSelectedRange(e){const t=this.document.locationRangeFromRange(e);return this.getSelectionManager().setLocationRange(t)}getPosition(){const e=this.getLocationRange();if(e)return this.document.positionFromLocation(e[0])}getLocationRange(e){return this.targetLocationRange?this.targetLocationRange:this.getSelectionManager().getLocationRange(e)||bt({index:0,offset:0})}withTargetLocationRange(e,t){let n;this.targetLocationRange=e;try{n=t()}finally{this.targetLocationRange=null}return n}withTargetRange(e,t){const n=this.document.locationRangeFromRange(e);return this.withTargetLocationRange(n,t)}withTargetDOMRange(e,t){const n=this.createLocationRangeFromDOMRange(e,{strict:!1});return this.withTargetLocationRange(n,t)}getExpandedRangeInDirection(e){let{length:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},[n,r]=Array.from(this.getSelectedRange());return e==="backward"?t?n-=t:n=this.translateUTF16PositionFromOffset(n,-1):t?r+=t:r=this.translateUTF16PositionFromOffset(r,1),bt([n,r])}shouldManageMovingCursorInDirection(e){if(this.editingAttachment)return!0;const t=this.getExpandedRangeInDirection(e);return this.getAttachmentAtRange(t)!=null}moveCursorInDirection(e){let t,n;if(this.editingAttachment)n=this.document.getRangeOfAttachment(this.editingAttachment);else{const r=this.getSelectedRange();n=this.getExpandedRangeInDirection(e),t=!wu(r,n)}if(e==="backward"?this.setSelectedRange(n[0]):this.setSelectedRange(n[1]),t){const r=this.getAttachmentAtRange(n);if(r)return this.editAttachment(r)}}expandSelectionInDirection(e){let{length:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getExpandedRangeInDirection(e,{length:t});return this.setSelectedRange(n)}expandSelectionForEditing(){if(this.hasCurrentAttribute("href"))return this.expandSelectionAroundCommonAttribute("href")}expandSelectionAroundCommonAttribute(e){const t=this.getPosition(),n=this.document.getRangeOfCommonAttributeAtPosition(e,t);return this.setSelectedRange(n)}selectionContainsAttachments(){var e;return((e=this.getSelectedAttachments())===null||e===void 0?void 0:e.length)>0}selectionIsInCursorTarget(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())}positionIsCursorTarget(e){const t=this.document.locationFromPosition(e);if(t)return this.locationIsCursorTarget(t)}positionIsBlockBreak(e){var t;return(t=this.document.getPieceAtPosition(e))===null||t===void 0?void 0:t.isBlockBreak()}getSelectedDocument(){const e=this.getSelectedRange();if(e)return this.document.getDocumentAtRange(e)}getSelectedAttachments(){var e;return(e=this.getSelectedDocument())===null||e===void 0?void 0:e.getAttachments()}getAttachments(){return this.attachments.slice(0)}refreshAttachments(){const e=this.document.getAttachments(),{added:t,removed:n}=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const o=[],l=[],a=new Set;r.forEach(u=>{a.add(u)});const c=new Set;return s.forEach(u=>{c.add(u),a.has(u)||o.push(u)}),r.forEach(u=>{c.has(u)||l.push(u)}),{added:o,removed:l}}(this.attachments,e);return this.attachments=e,Array.from(n).forEach(r=>{var s,o;r.delegate=null,(s=this.delegate)===null||s===void 0||(o=s.compositionDidRemoveAttachment)===null||o===void 0||o.call(s,r)}),(()=>{const r=[];return Array.from(t).forEach(s=>{var o,l;s.delegate=this,r.push((o=this.delegate)===null||o===void 0||(l=o.compositionDidAddAttachment)===null||l===void 0?void 0:l.call(o,s))}),r})()}attachmentDidChangeAttributes(e){var t,n;return this.revision++,(t=this.delegate)===null||t===void 0||(n=t.compositionDidEditAttachment)===null||n===void 0?void 0:n.call(t,e)}attachmentDidChangePreviewURL(e){var t,n;return this.revision++,(t=this.delegate)===null||t===void 0||(n=t.compositionDidChangeAttachmentPreviewURL)===null||n===void 0?void 0:n.call(t,e)}editAttachment(e,t){var n,r;if(e!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=e,(n=this.delegate)===null||n===void 0||(r=n.compositionDidStartEditingAttachment)===null||r===void 0?void 0:r.call(n,this.editingAttachment,t)}stopEditingAttachment(){var e,t;this.editingAttachment&&((e=this.delegate)===null||e===void 0||(t=e.compositionDidStopEditingAttachment)===null||t===void 0||t.call(e,this.editingAttachment),this.editingAttachment=null)}updateAttributesForAttachment(e,t){return this.setDocument(this.document.updateAttributesForAttachment(e,t))}removeAttributeForAttachment(e,t){return this.setDocument(this.document.removeAttributeForAttachment(e,t))}breakFormattedBlock(e){let{document:t}=e;const{block:n}=e;let r=e.startPosition,s=[r-1,r];n.getBlockBreakPosition()===e.startLocation.offset?(n.breaksOnReturn()&&e.nextCharacter===` `?r+=1:t=t.removeTextAtRange(s),s=[r,r]):e.nextCharacter===` `?e.previousCharacter===` `?s=[r-1,r+1]:(s=[r,r+1],r+=1):e.startLocation.offset-1!=0&&(r+=1);const o=new si([n.removeLastAttribute().copyWithoutText()]);return this.setDocument(t.insertDocumentAtRange(o,s)),this.setSelection(r)}getPreviousBlock(){const e=this.getLocationRange();if(e){const{index:t}=e[0];if(t>0)return this.document.getBlockAtIndex(t-1)}}getBlock(){const e=this.getLocationRange();if(e)return this.document.getBlockAtIndex(e[0].index)}getAttachmentAtRange(e){const t=this.document.getDocumentAtRange(e);if(t.toString()==="".concat("",` -`))return t.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.compositionDidChangeCurrentAttributes)===null||t===void 0?void 0:t.call(e,this.currentAttributes)}notifyDelegateOfInsertionAtRange(e){var t,n;return(t=this.delegate)===null||t===void 0||(n=t.compositionDidPerformInsertionAtRange)===null||n===void 0?void 0:n.call(t,e)}translateUTF16PositionFromOffset(e,t){const n=this.document.toUTF16String(),r=n.offsetFromUCS2Offset(e);return n.offsetToUCS2Offset(r+t)}}Tr.proxyMethod("getSelectionManager().getPointRange"),Tr.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),Tr.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),Tr.proxyMethod("getSelectionManager().locationIsCursorTarget"),Tr.proxyMethod("getSelectionManager().selectionIsExpanded"),Tr.proxyMethod("delegate?.getSelectionManager");class Ed extends Kt{constructor(e){super(...arguments),this.composition=e,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(e){let{context:t,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.undoEntries.slice(-1)[0];if(!n||!N4(r,e,t)){const s=this.createEntry({description:e,context:t});this.undoEntries.push(s),this.redoEntries=[]}}undo(){const e=this.undoEntries.pop();if(e){const t=this.createEntry(e);return this.redoEntries.push(t),this.composition.loadSnapshot(e.snapshot)}}redo(){const e=this.redoEntries.pop();if(e){const t=this.createEntry(e);return this.undoEntries.push(t),this.composition.loadSnapshot(e.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:e,context:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:e==null?void 0:e.toString(),context:JSON.stringify(t),snapshot:this.composition.getSnapshot()}}}const N4=(i,e,t)=>(i==null?void 0:i.description)===(e==null?void 0:e.toString())&&(i==null?void 0:i.context)===JSON.stringify(t),pf="attachmentGallery";class Dk{constructor(e){this.document=e.document,this.selectedRange=e.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(e=>this.document=this.document.removeAttributeAtRange(pf,e))}applyBlockAttribute(){let e=0;this.findRangesOfPieces().forEach(t=>{t[1]-t[0]>1&&(t[0]+=e,t[1]+=e,this.document.getCharacterAtPosition(t[1])!==` +`))return t.getAttachments()[0]}notifyDelegateOfCurrentAttributesChange(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.compositionDidChangeCurrentAttributes)===null||t===void 0?void 0:t.call(e,this.currentAttributes)}notifyDelegateOfInsertionAtRange(e){var t,n;return(t=this.delegate)===null||t===void 0||(n=t.compositionDidPerformInsertionAtRange)===null||n===void 0?void 0:n.call(t,e)}translateUTF16PositionFromOffset(e,t){const n=this.document.toUTF16String(),r=n.offsetFromUCS2Offset(e);return n.offsetToUCS2Offset(r+t)}}Tr.proxyMethod("getSelectionManager().getPointRange"),Tr.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),Tr.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),Tr.proxyMethod("getSelectionManager().locationIsCursorTarget"),Tr.proxyMethod("getSelectionManager().selectionIsExpanded"),Tr.proxyMethod("delegate?.getSelectionManager");class Ed extends Kt{constructor(e){super(...arguments),this.composition=e,this.undoEntries=[],this.redoEntries=[]}recordUndoEntry(e){let{context:t,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.undoEntries.slice(-1)[0];if(!n||!T4(r,e,t)){const s=this.createEntry({description:e,context:t});this.undoEntries.push(s),this.redoEntries=[]}}undo(){const e=this.undoEntries.pop();if(e){const t=this.createEntry(e);return this.redoEntries.push(t),this.composition.loadSnapshot(e.snapshot)}}redo(){const e=this.redoEntries.pop();if(e){const t=this.createEntry(e);return this.undoEntries.push(t),this.composition.loadSnapshot(e.snapshot)}}canUndo(){return this.undoEntries.length>0}canRedo(){return this.redoEntries.length>0}createEntry(){let{description:e,context:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{description:e==null?void 0:e.toString(),context:JSON.stringify(t),snapshot:this.composition.getSnapshot()}}}const T4=(i,e,t)=>(i==null?void 0:i.description)===(e==null?void 0:e.toString())&&(i==null?void 0:i.context)===JSON.stringify(t),pf="attachmentGallery";class Pk{constructor(e){this.document=e.document,this.selectedRange=e.selectedRange}perform(){return this.removeBlockAttribute(),this.applyBlockAttribute()}getSnapshot(){return{document:this.document,selectedRange:this.selectedRange}}removeBlockAttribute(){return this.findRangesOfBlocks().map(e=>this.document=this.document.removeAttributeAtRange(pf,e))}applyBlockAttribute(){let e=0;this.findRangesOfPieces().forEach(t=>{t[1]-t[0]>1&&(t[0]+=e,t[1]+=e,this.document.getCharacterAtPosition(t[1])!==` `&&(this.document=this.document.insertBlockBreakAtRange(t[1]),t[1]0&&arguments[0]!==void 0?arguments[0]:"";const t=oa.parse(e,{referenceElement:this.element}).getDocument();return this.loadDocument(t)}loadJSON(e){let{document:t,selectedRange:n}=e;return t=si.fromJSON(t),this.loadSnapshot({document:t,selectedRange:n})}loadSnapshot(e){return this.undoManager=new Ed(this.composition),this.composition.loadSnapshot(e)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(e){return this.composition.deleteInDirection(e)}insertAttachment(e){return this.composition.insertAttachment(e)}insertAttachments(e){return this.composition.insertAttachments(e)}insertDocument(e){return this.composition.insertDocument(e)}insertFile(e){return this.composition.insertFile(e)}insertFiles(e){return this.composition.insertFiles(e)}insertHTML(e){return this.composition.insertHTML(e)}insertString(e){return this.composition.insertString(e)}insertText(e){return this.composition.insertText(e)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(e){const t=this.getDocument().locationRangeFromRange([e,e+1]);return this.selectionManager.getClientRectAtLocationRange(t)}expandSelectionInDirection(e){return this.composition.expandSelectionInDirection(e)}moveCursorInDirection(e){return this.composition.moveCursorInDirection(e)}setSelectedRange(e){return this.composition.setSelectedRange(e)}activateAttribute(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(e,t)}attributeIsActive(e){return this.composition.hasCurrentAttribute(e)}canActivateAttribute(e){return this.composition.canSetCurrentAttribute(e)}deactivateAttribute(e){return this.composition.removeCurrentAttribute(e)}setHTMLAtributeAtPosition(e,t,n){this.composition.setHTMLAtributeAtPosition(e,t,n)}canDecreaseNestingLevel(){return this.composition.canDecreaseNestingLevel()}canIncreaseNestingLevel(){return this.composition.canIncreaseNestingLevel()}decreaseNestingLevel(){if(this.canDecreaseNestingLevel())return this.composition.decreaseNestingLevel()}increaseNestingLevel(){if(this.canIncreaseNestingLevel())return this.composition.increaseNestingLevel()}canRedo(){return this.undoManager.canRedo()}canUndo(){return this.undoManager.canUndo()}recordUndoEntry(e){let{context:t,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(e,{context:t,consolidatable:n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}}class Ik{constructor(e){this.element=e}findLocationFromContainerAndOffset(e,t){let{strict:n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},r=0,s=!1;const o={index:0,offset:0},l=this.findAttachmentElementParentForNode(e);l&&(e=l.parentNode,t=Hh(l));const a=vu(this.element,{usingFilter:Nk});for(;a.nextNode();){const c=a.currentNode;if(c===e&&Nl(e)){fo(c)||(o.offset+=t);break}if(c.parentNode===e){if(r++===t){!n&&Jh(c,{strict:n})&&(s&&o.index++,o.offset=0,s=!0);break}}else if(!vs(e,c)&&r>0)break;Jh(c,{strict:n})?(s&&o.index++,o.offset=0,s=!0):o.offset+=gf(c)}return o}findContainerAndOffsetFromLocation(e){let t,n;if(e.index===0&&e.offset===0){for(t=this.element,n=0;t.firstChild;)if(t=t.firstChild,Kh(t)){n=1;break}return[t,n]}let[r,s]=this.findNodeAndOffsetFromLocation(e);if(r){if(Nl(r))gf(r)===0?(t=r.parentNode.parentNode,n=Hh(r.parentNode),fo(r,{name:"right"})&&n++):(t=r,n=e.offset-s);else{if(t=r.parentNode,!Jh(r.previousSibling)&&!Kh(t))for(;r===t.lastChild&&(r=t,t=t.parentNode,!Kh(t)););n=Hh(r),e.offset!==0&&n++}return[t,n]}}findNodeAndOffsetFromLocation(e){let t,n,r=0;for(const s of this.getSignificantNodesForIndex(e.index)){const o=gf(s);if(e.offset<=r+o)if(Nl(s)){if(t=s,n=r,e.offset===n&&fo(t))break}else t||(t=s,n=r);if(r+=o,r>e.offset)break}return[t,n]}findAttachmentElementParentForNode(e){for(;e&&e!==this.element;){if(_s(e))return e;e=e.parentNode}}getSignificantNodesForIndex(e){const t=[],n=vu(this.element,{usingFilter:B4});let r=!1;for(;n.nextNode();){const o=n.currentNode;var s;if(ho(o)){if(s!=null?s++:s=0,s===e)r=!0;else if(r)break}else r&&t.push(o)}return t}}const gf=function(i){return i.nodeType===Node.TEXT_NODE?fo(i)?0:i.textContent.length:kn(i)==="br"||_s(i)?1:0},B4=function(i){return W4(i)===NodeFilter.FILTER_ACCEPT?Nk(i):NodeFilter.FILTER_REJECT},W4=function(i){return uk(i)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Nk=function(i){return _s(i.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT};class Zk{createDOMRangeFromPoint(e){let t,{x:n,y:r}=e;if(document.caretPositionFromPoint){const{offsetNode:s,offset:o}=document.caretPositionFromPoint(n,r);return t=document.createRange(),t.setStart(s,o),t}if(document.caretRangeFromPoint)return document.caretRangeFromPoint(n,r);if(document.body.createTextRange){const s=Zl();try{const o=document.body.createTextRange();o.moveToPoint(n,r),o.select()}catch{}return t=Zl(),bk(s),t}}getClientRectsForDOMRange(e){const t=Array.from(e.getClientRects());return[t[0],t[t.length-1]]}}class gs extends Kt{constructor(e){super(...arguments),this.didMouseDown=this.didMouseDown.bind(this),this.selectionDidChange=this.selectionDidChange.bind(this),this.element=e,this.locationMapper=new Ik(this.element),this.pointMapper=new Zk,this.lockCount=0,Zt("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}getLocationRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.strict===!1?this.createLocationRangeFromDOMRange(Zl()):e.ignoreLock?this.currentLocationRange:this.lockedLocationRange?this.lockedLocationRange:this.currentLocationRange}setLocationRange(e){if(this.lockedLocationRange)return;e=bt(e);const t=this.createDOMRangeFromLocationRange(e);t&&(bk(t),this.updateCurrentLocationRange(e))}setLocationRangeFromPointRange(e){e=bt(e);const t=this.getLocationAtPoint(e[0]),n=this.getLocationAtPoint(e[1]);this.setLocationRange([t,n])}getClientRectAtLocationRange(e){const t=this.createDOMRangeFromLocationRange(e);if(t)return this.getClientRectsForDOMRange(t)[1]}locationIsCursorTarget(e){const t=Array.from(this.findNodeAndOffsetFromLocation(e))[0];return fo(t)}lock(){this.lockCount++==0&&(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange())}unlock(){if(--this.lockCount==0){const{lockedLocationRange:e}=this;if(this.lockedLocationRange=null,e!=null)return this.setLocationRange(e)}}clearSelection(){var e;return(e=Ok())===null||e===void 0?void 0:e.removeAllRanges()}selectionIsCollapsed(){var e;return((e=Zl())===null||e===void 0?void 0:e.collapsed)===!0}selectionIsExpanded(){return!this.selectionIsCollapsed()}createLocationRangeFromDOMRange(e,t){if(e==null||!this.domRangeWithinElement(e))return;const n=this.findLocationFromContainerAndOffset(e.startContainer,e.startOffset,t);if(!n)return;const r=e.collapsed?void 0:this.findLocationFromContainerAndOffset(e.endContainer,e.endOffset,t);return bt([n,r])}didMouseDown(){return this.pauseTemporarily()}pauseTemporarily(){let e;this.paused=!0;const t=()=>{if(this.paused=!1,clearTimeout(n),Array.from(e).forEach(r=>{r.destroy()}),vs(document,this.element))return this.selectionDidChange()},n=setTimeout(t,200);e=["mousemove","keydown"].map(r=>Zt(r,{onElement:document,withCallback:t}))}selectionDidChange(){if(!this.paused&&!Km(this.element))return this.updateCurrentLocationRange()}updateCurrentLocationRange(e){var t,n;if((e??(e=this.createLocationRangeFromDOMRange(Zl())))&&!wu(e,this.currentLocationRange))return this.currentLocationRange=e,(t=this.delegate)===null||t===void 0||(n=t.locationRangeDidChange)===null||n===void 0?void 0:n.call(t,this.currentLocationRange.slice(0))}createDOMRangeFromLocationRange(e){const t=this.findContainerAndOffsetFromLocation(e[0]),n=or(e)?t:this.findContainerAndOffsetFromLocation(e[1])||t;if(t!=null&&n!=null){const r=document.createRange();return r.setStart(...Array.from(t||[])),r.setEnd(...Array.from(n||[])),r}}getLocationAtPoint(e){const t=this.createDOMRangeFromPoint(e);var n;if(t)return(n=this.createLocationRangeFromDOMRange(t))===null||n===void 0?void 0:n[0]}domRangeWithinElement(e){return e.collapsed?vs(this.element,e.startContainer):vs(this.element,e.startContainer)&&vs(this.element,e.endContainer)}}gs.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),gs.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),gs.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),gs.proxyMethod("pointMapper.createDOMRangeFromPoint"),gs.proxyMethod("pointMapper.getClientRectsForDOMRange");var Bk=Object.freeze({__proto__:null,Attachment:Fo,AttachmentManager:Ek,AttachmentPiece:Ao,Block:Xi,Composition:Tr,Document:si,Editor:Lk,HTMLParser:oa,HTMLSanitizer:lh,LineBreakInsertion:Rk,LocationMapper:Ik,ManagedAttachment:Nt,Piece:Zs,PointMapper:Zk,SelectionManager:gs,SplittableList:ku,StringPiece:op,Text:_i,UndoManager:Ed}),X4=Object.freeze({__proto__:null,ObjectView:Ns,AttachmentView:sp,BlockView:Pk,DocumentView:ah,PieceView:_k,PreviewableAttachmentView:Sk,TextView:Ck});const{lang:Of,css:cs,keyNames:F4}=$a,bf=function(i){return function(){const e=i.apply(this,arguments);e.do(),this.undos||(this.undos=[]),this.undos.push(e.undo)}};class Wk extends Kt{constructor(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(...arguments),gn(this,"makeElementMutable",bf(()=>({do:()=>{this.element.dataset.trixMutable=!0},undo:()=>delete this.element.dataset.trixMutable}))),gn(this,"addToolbar",bf(()=>{const s=Ge({tagName:"div",className:cs.attachmentToolbar,data:{trixMutable:!0},childNodes:Ge({tagName:"div",className:"trix-button-row",childNodes:Ge({tagName:"span",className:"trix-button-group trix-button-group--actions",childNodes:Ge({tagName:"button",className:"trix-button trix-button--remove",textContent:Of.remove,attributes:{title:Of.remove},data:{trixAction:"remove"}})})})});return this.attachment.isPreviewable()&&s.appendChild(Ge({tagName:"div",className:cs.attachmentMetadataContainer,childNodes:Ge({tagName:"span",className:cs.attachmentMetadata,childNodes:[Ge({tagName:"span",className:cs.attachmentName,textContent:this.attachment.getFilename(),attributes:{title:this.attachment.getFilename()}}),Ge({tagName:"span",className:cs.attachmentSize,textContent:this.attachment.getFormattedFilesize()})]})})),Zt("click",{onElement:s,withCallback:this.didClickToolbar}),Zt("click",{onElement:s,matchingSelector:"[data-trix-action]",withCallback:this.didClickActionButton}),Ll("trix-attachment-before-toolbar",{onElement:this.element,attributes:{toolbar:s,attachment:this.attachment}}),{do:()=>this.element.appendChild(s),undo:()=>Vr(s)}})),gn(this,"installCaptionEditor",bf(()=>{const s=Ge({tagName:"textarea",className:cs.attachmentCaptionEditor,attributes:{placeholder:Of.captionPlaceholder},data:{trixMutable:!0}});s.value=this.attachmentPiece.getCaption();const o=s.cloneNode();o.classList.add("trix-autoresize-clone"),o.tabIndex=-1;const l=function(){o.value=s.value,s.style.height=o.scrollHeight+"px"};Zt("input",{onElement:s,withCallback:l}),Zt("input",{onElement:s,withCallback:this.didInputCaption}),Zt("keydown",{onElement:s,withCallback:this.didKeyDownCaption}),Zt("change",{onElement:s,withCallback:this.didChangeCaption}),Zt("blur",{onElement:s,withCallback:this.didBlurCaption});const a=this.element.querySelector("figcaption"),c=a.cloneNode();return{do:()=>{if(a.style.display="none",c.appendChild(s),c.appendChild(o),c.classList.add("".concat(cs.attachmentCaption,"--editing")),a.parentElement.insertBefore(c,a),l(),this.options.editCaption)return tp(()=>s.focus())},undo(){Vr(c),a.style.display=null}}})),this.didClickToolbar=this.didClickToolbar.bind(this),this.didClickActionButton=this.didClickActionButton.bind(this),this.didKeyDownCaption=this.didKeyDownCaption.bind(this),this.didInputCaption=this.didInputCaption.bind(this),this.didChangeCaption=this.didChangeCaption.bind(this),this.didBlurCaption=this.didBlurCaption.bind(this),this.attachmentPiece=e,this.element=t,this.container=n,this.options=r,this.attachment=this.attachmentPiece.attachment,kn(this.element)==="a"&&(this.element=this.element.firstChild),this.install()}install(){this.makeElementMutable(),this.addToolbar(),this.attachment.isPreviewable()&&this.installCaptionEditor()}uninstall(){var e;let t=this.undos.pop();for(this.savePendingCaption();t;)t(),t=this.undos.pop();(e=this.delegate)===null||e===void 0||e.didUninstallAttachmentEditor(this)}savePendingCaption(){if(this.pendingCaption!=null){const s=this.pendingCaption;var e,t,n,r;this.pendingCaption=null,s?(e=this.delegate)===null||e===void 0||(t=e.attachmentEditorDidRequestUpdatingAttributesForAttachment)===null||t===void 0||t.call(e,{caption:s},this.attachment):(n=this.delegate)===null||n===void 0||(r=n.attachmentEditorDidRequestRemovingAttributeForAttachment)===null||r===void 0||r.call(n,"caption",this.attachment)}}didClickToolbar(e){return e.preventDefault(),e.stopPropagation()}didClickActionButton(e){var t;if(e.target.getAttribute("data-trix-action")==="remove")return(t=this.delegate)===null||t===void 0?void 0:t.attachmentEditorDidRequestRemovalOfAttachment(this.attachment)}didKeyDownCaption(e){var t,n;if(F4[e.keyCode]==="return")return e.preventDefault(),this.savePendingCaption(),(t=this.delegate)===null||t===void 0||(n=t.attachmentEditorDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(t,this.attachment)}didInputCaption(e){this.pendingCaption=e.target.value.replace(/\s/g," ").trim()}didChangeCaption(e){return this.savePendingCaption()}didBlurCaption(e){return this.savePendingCaption()}}class Xk extends Kt{constructor(e,t){super(...arguments),this.didFocus=this.didFocus.bind(this),this.didBlur=this.didBlur.bind(this),this.didClickAttachment=this.didClickAttachment.bind(this),this.element=e,this.composition=t,this.documentView=new ah(this.composition.document,{element:this.element}),Zt("focus",{onElement:this.element,withCallback:this.didFocus}),Zt("blur",{onElement:this.element,withCallback:this.didBlur}),Zt("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),Zt("mousedown",{onElement:this.element,matchingSelector:Ss,withCallback:this.didClickAttachment}),Zt("click",{onElement:this.element,matchingSelector:"a".concat(Ss),preventDefault:!0})}didFocus(e){var t;const n=()=>{var r,s;if(!this.focused)return this.focused=!0,(r=this.delegate)===null||r===void 0||(s=r.compositionControllerDidFocus)===null||s===void 0?void 0:s.call(r)};return((t=this.blurPromise)===null||t===void 0?void 0:t.then(n))||n()}didBlur(e){this.blurPromise=new Promise(t=>tp(()=>{var n,r;return Km(this.element)||(this.focused=null,(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidBlur)===null||r===void 0||r.call(n)),this.blurPromise=null,t()}))}didClickAttachment(e,t){var n,r;const s=this.findAttachmentForElement(t),o=!!zr(e.target,{matchingSelector:"figcaption"});return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidSelectAttachment)===null||r===void 0?void 0:r.call(n,s,{editCaption:o})}getSerializableElement(){return this.isEditingAttachment()?this.documentView.shadowElement:this.element}render(){var e,t,n,r,s,o;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.canSyncDocumentView()&&!this.documentView.isSynced()&&((n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillSyncDocumentView)===null||r===void 0||r.call(n),this.documentView.sync(),(s=this.delegate)===null||s===void 0||(o=s.compositionControllerDidSyncDocumentView)===null||o===void 0||o.call(s)),(e=this.delegate)===null||e===void 0||(t=e.compositionControllerDidRender)===null||t===void 0?void 0:t.call(e)}rerenderViewForObject(e){return this.invalidateViewForObject(e),this.render()}invalidateViewForObject(e){return this.documentView.invalidateViewForObject(e)}isViewCachingEnabled(){return this.documentView.isViewCachingEnabled()}enableViewCaching(){return this.documentView.enableViewCaching()}disableViewCaching(){return this.documentView.disableViewCaching()}refreshViewCache(){return this.documentView.garbageCollectCachedViews()}isEditingAttachment(){return!!this.attachmentEditor}installAttachmentEditorForAttachment(e,t){var n;if(((n=this.attachmentEditor)===null||n===void 0?void 0:n.attachment)===e)return;const r=this.documentView.findElementForObject(e);if(!r)return;this.uninstallAttachmentEditor();const s=this.composition.document.getAttachmentPieceForAttachment(e);this.attachmentEditor=new Wk(s,r,this.element,t),this.attachmentEditor.delegate=this}uninstallAttachmentEditor(){var e;return(e=this.attachmentEditor)===null||e===void 0?void 0:e.uninstall()}didUninstallAttachmentEditor(){return this.attachmentEditor=null,this.render()}attachmentEditorDidRequestUpdatingAttributesForAttachment(e,t){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,t),this.composition.updateAttributesForAttachment(e,t)}attachmentEditorDidRequestRemovingAttributeForAttachment(e,t){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,t),this.composition.removeAttributeForAttachment(e,t)}attachmentEditorDidRequestRemovalOfAttachment(e){var t,n;return(t=this.delegate)===null||t===void 0||(n=t.compositionControllerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(t,e)}attachmentEditorDidRequestDeselectingAttachment(e){var t,n;return(t=this.delegate)===null||t===void 0||(n=t.compositionControllerDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(t,e)}canSyncDocumentView(){return!this.isEditingAttachment()}findAttachmentForElement(e){return this.composition.document.getAttachmentById(parseInt(e.dataset.trixId,10))}}class Fk extends Kt{}const Yk="data-trix-mutable",Y4="[".concat(Yk,"]"),z4={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0};class zk extends Kt{constructor(e){super(e),this.didMutate=this.didMutate.bind(this),this.element=e,this.observer=new window.MutationObserver(this.didMutate),this.start()}start(){return this.reset(),this.observer.observe(this.element,z4)}stop(){return this.observer.disconnect()}didMutate(e){var t,n;if(this.mutations.push(...Array.from(this.findSignificantMutations(e)||[])),this.mutations.length)return(t=this.delegate)===null||t===void 0||(n=t.elementDidMutate)===null||n===void 0||n.call(t,this.getMutationSummary()),this.reset()}reset(){this.mutations=[]}findSignificantMutations(e){return e.filter(t=>this.mutationIsSignificant(t))}mutationIsSignificant(e){if(this.nodeIsMutable(e.target))return!1;for(const t of Array.from(this.nodesModifiedByMutation(e)))if(this.nodeIsSignificant(t))return!0;return!1}nodeIsSignificant(e){return e!==this.element&&!this.nodeIsMutable(e)&&!uk(e)}nodeIsMutable(e){return zr(e,{matchingSelector:Y4})}nodesModifiedByMutation(e){const t=[];switch(e.type){case"attributes":e.attributeName!==Yk&&t.push(e.target);break;case"characterData":t.push(e.target.parentNode),t.push(e.target);break;case"childList":t.push(...Array.from(e.addedNodes||[])),t.push(...Array.from(e.removedNodes||[]))}return t}getMutationSummary(){return this.getTextMutationSummary()}getTextMutationSummary(){const{additions:e,deletions:t}=this.getTextChangesFromCharacterData(),n=this.getTextChangesFromChildList();Array.from(n.additions).forEach(l=>{Array.from(e).includes(l)||e.push(l)}),t.push(...Array.from(n.deletions||[]));const r={},s=e.join("");s&&(r.textAdded=s);const o=t.join("");return o&&(r.textDeleted=o),r}getMutationsByType(e){return Array.from(this.mutations).filter(t=>t.type===e)}getTextChangesFromChildList(){let e,t;const n=[],r=[];Array.from(this.getMutationsByType("childList")).forEach(l=>{n.push(...Array.from(l.addedNodes||[])),r.push(...Array.from(l.removedNodes||[]))}),n.length===0&&r.length===1&&ho(r[0])?(e=[],t=[` -`]):(e=Rd(n),t=Rd(r));const s=e.filter((l,a)=>l!==t[a]).map(yl),o=t.filter((l,a)=>l!==e[a]).map(yl);return{additions:s,deletions:o}}getTextChangesFromCharacterData(){let e,t;const n=this.getMutationsByType("characterData");if(n.length){const r=n[0],s=n[n.length-1],o=function(l,a){let c,u;return l=sa.box(l),(a=sa.box(a)).length0&&arguments[0]!==void 0?arguments[0]:[];const e=[];for(const t of Array.from(i))switch(t.nodeType){case Node.TEXT_NODE:e.push(t.data);break;case Node.ELEMENT_NODE:kn(t)==="br"?e.push(` -`):e.push(...Array.from(Rd(t.childNodes)||[]))}return e};class Vk extends yu{constructor(e){super(...arguments),this.file=e}perform(e){const t=new FileReader;return t.onerror=()=>e(!1),t.onload=()=>{t.onerror=null;try{t.abort()}catch{}return e(!0,this.file)},t.readAsArrayBuffer(this.file)}}class V4{constructor(e){this.element=e}shouldIgnore(e){return!!Da.samsungAndroid&&(this.previousEvent=this.event,this.event=e,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&U4(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!=="insertText"&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var e;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((e=this.event.data)===null||e===void 0?void 0:e.length)>50}isBeforeInputInsertText(){return this.event.type==="beforeinput"&&this.event.inputType==="insertText"}previousEventWasUnidentifiedKeydown(){var e,t;return((e=this.previousEvent)===null||e===void 0?void 0:e.type)==="keydown"&&((t=this.previousEvent)===null||t===void 0?void 0:t.key)==="Unidentified"}}const U4=(i,e)=>k0(i)===k0(e),j4=new RegExp("(".concat("","|").concat(oh,"|").concat(Rr,"|\\s)+"),"g"),k0=i=>i.replace(j4," ").trim();class ch extends Kt{constructor(e){super(...arguments),this.element=e,this.mutationObserver=new zk(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new V4(this.element);for(const t in this.constructor.events)Zt(t,{onElement:this.element,withCallback:this.handlerFor(t)})}elementDidMutate(e){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidRequestRender)===null||t===void 0?void 0:t.call(e)}requestReparse(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidRequestReparse)===null||t===void 0||t.call(e),this.requestRender()}attachFiles(e){const t=Array.from(e).map(n=>new Vk(n));return Promise.all(t).then(n=>{this.handleInput(function(){var r,s;return(r=this.delegate)===null||r===void 0||r.inputControllerWillAttachFiles(),(s=this.responder)===null||s===void 0||s.insertFiles(n),this.requestRender()})})}handlerFor(e){return t=>{t.defaultPrevented||this.handleInput(()=>{if(!Km(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(t))return;this.eventName=e,this.constructor.events[e].call(this,t)}})}}handleInput(e){try{var t;(t=this.delegate)===null||t===void 0||t.inputControllerWillHandleInput(),e.call(this)}finally{var n;(n=this.delegate)===null||n===void 0||n.inputControllerDidHandleInput()}}createLinkHTML(e,t){const n=document.createElement("a");return n.href=e,n.textContent=t||e,n.outerHTML}}var vf;gn(ch,"events",{});const{browser:q4,keyNames:Uk}=$a;let G4=0;class ir extends ch{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(const t in e){const n=e[t];this.inputSummary[t]=n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Ts.reset()}elementDidMutate(e){var t,n;return this.isComposing()?(t=this.delegate)===null||t===void 0||(n=t.inputControllerDidAllowUnhandledInput)===null||n===void 0?void 0:n.call(t):this.handleInput(function(){return this.mutationIsSignificant(e)&&(this.mutationIsExpected(e)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(e){let{textAdded:t,textDeleted:n}=e;if(this.inputSummary.preferDocument)return!0;const r=t!=null?t===this.inputSummary.textAdded:!this.inputSummary.textAdded,s=n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,o=[` +`&&(this.document=this.document.insertBlockBreakAtRange(t[0]),t[0]0&&arguments[0]!==void 0?arguments[0]:"";const t=oa.parse(e,{referenceElement:this.element}).getDocument();return this.loadDocument(t)}loadJSON(e){let{document:t,selectedRange:n}=e;return t=si.fromJSON(t),this.loadSnapshot({document:t,selectedRange:n})}loadSnapshot(e){return this.undoManager=new Ed(this.composition),this.composition.loadSnapshot(e)}getDocument(){return this.composition.document}getSelectedDocument(){return this.composition.getSelectedDocument()}getSnapshot(){return this.composition.getSnapshot()}toJSON(){return this.getSnapshot()}deleteInDirection(e){return this.composition.deleteInDirection(e)}insertAttachment(e){return this.composition.insertAttachment(e)}insertAttachments(e){return this.composition.insertAttachments(e)}insertDocument(e){return this.composition.insertDocument(e)}insertFile(e){return this.composition.insertFile(e)}insertFiles(e){return this.composition.insertFiles(e)}insertHTML(e){return this.composition.insertHTML(e)}insertString(e){return this.composition.insertString(e)}insertText(e){return this.composition.insertText(e)}insertLineBreak(){return this.composition.insertLineBreak()}getSelectedRange(){return this.composition.getSelectedRange()}getPosition(){return this.composition.getPosition()}getClientRectAtPosition(e){const t=this.getDocument().locationRangeFromRange([e,e+1]);return this.selectionManager.getClientRectAtLocationRange(t)}expandSelectionInDirection(e){return this.composition.expandSelectionInDirection(e)}moveCursorInDirection(e){return this.composition.moveCursorInDirection(e)}setSelectedRange(e){return this.composition.setSelectedRange(e)}activateAttribute(e){let t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.composition.setCurrentAttribute(e,t)}attributeIsActive(e){return this.composition.hasCurrentAttribute(e)}canActivateAttribute(e){return this.composition.canSetCurrentAttribute(e)}deactivateAttribute(e){return this.composition.removeCurrentAttribute(e)}setHTMLAtributeAtPosition(e,t,n){this.composition.setHTMLAtributeAtPosition(e,t,n)}canDecreaseNestingLevel(){return this.composition.canDecreaseNestingLevel()}canIncreaseNestingLevel(){return this.composition.canIncreaseNestingLevel()}decreaseNestingLevel(){if(this.canDecreaseNestingLevel())return this.composition.decreaseNestingLevel()}increaseNestingLevel(){if(this.canIncreaseNestingLevel())return this.composition.increaseNestingLevel()}canRedo(){return this.undoManager.canRedo()}canUndo(){return this.undoManager.canUndo()}recordUndoEntry(e){let{context:t,consolidatable:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.undoManager.recordUndoEntry(e,{context:t,consolidatable:n})}redo(){if(this.canRedo())return this.undoManager.redo()}undo(){if(this.canUndo())return this.undoManager.undo()}}class Tk{constructor(e){this.element=e}findLocationFromContainerAndOffset(e,t){let{strict:n}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{strict:!0},r=0,s=!1;const o={index:0,offset:0},l=this.findAttachmentElementParentForNode(e);l&&(e=l.parentNode,t=Hh(l));const a=vu(this.element,{usingFilter:Qk});for(;a.nextNode();){const c=a.currentNode;if(c===e&&Zl(e)){mo(c)||(o.offset+=t);break}if(c.parentNode===e){if(r++===t){!n&&Jh(c,{strict:n})&&(s&&o.index++,o.offset=0,s=!0);break}}else if(!ws(e,c)&&r>0)break;Jh(c,{strict:n})?(s&&o.index++,o.offset=0,s=!0):o.offset+=gf(c)}return o}findContainerAndOffsetFromLocation(e){let t,n;if(e.index===0&&e.offset===0){for(t=this.element,n=0;t.firstChild;)if(t=t.firstChild,Kh(t)){n=1;break}return[t,n]}let[r,s]=this.findNodeAndOffsetFromLocation(e);if(r){if(Zl(r))gf(r)===0?(t=r.parentNode.parentNode,n=Hh(r.parentNode),mo(r,{name:"right"})&&n++):(t=r,n=e.offset-s);else{if(t=r.parentNode,!Jh(r.previousSibling)&&!Kh(t))for(;r===t.lastChild&&(r=t,t=t.parentNode,!Kh(t)););n=Hh(r),e.offset!==0&&n++}return[t,n]}}findNodeAndOffsetFromLocation(e){let t,n,r=0;for(const s of this.getSignificantNodesForIndex(e.index)){const o=gf(s);if(e.offset<=r+o)if(Zl(s)){if(t=s,n=r,e.offset===n&&mo(t))break}else t||(t=s,n=r);if(r+=o,r>e.offset)break}return[t,n]}findAttachmentElementParentForNode(e){for(;e&&e!==this.element;){if(Cs(e))return e;e=e.parentNode}}getSignificantNodesForIndex(e){const t=[],n=vu(this.element,{usingFilter:M4});let r=!1;for(;n.nextNode();){const o=n.currentNode;var s;if(fo(o)){if(s!=null?s++:s=0,s===e)r=!0;else if(r)break}else r&&t.push(o)}return t}}const gf=function(i){return i.nodeType===Node.TEXT_NODE?mo(i)?0:i.textContent.length:kn(i)==="br"||Cs(i)?1:0},M4=function(i){return E4(i)===NodeFilter.FILTER_ACCEPT?Qk(i):NodeFilter.FILTER_REJECT},E4=function(i){return nk(i)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},Qk=function(i){return Cs(i.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT};class Mk{createDOMRangeFromPoint(e){let t,{x:n,y:r}=e;if(document.caretPositionFromPoint){const{offsetNode:s,offset:o}=document.caretPositionFromPoint(n,r);return t=document.createRange(),t.setStart(s,o),t}if(document.caretRangeFromPoint)return document.caretRangeFromPoint(n,r);if(document.body.createTextRange){const s=Bl();try{const o=document.body.createTextRange();o.moveToPoint(n,r),o.select()}catch{}return t=Bl(),uk(s),t}}getClientRectsForDOMRange(e){const t=Array.from(e.getClientRects());return[t[0],t[t.length-1]]}}class gs extends Kt{constructor(e){super(...arguments),this.didMouseDown=this.didMouseDown.bind(this),this.selectionDidChange=this.selectionDidChange.bind(this),this.element=e,this.locationMapper=new Tk(this.element),this.pointMapper=new Mk,this.lockCount=0,Zt("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}getLocationRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.strict===!1?this.createLocationRangeFromDOMRange(Bl()):e.ignoreLock?this.currentLocationRange:this.lockedLocationRange?this.lockedLocationRange:this.currentLocationRange}setLocationRange(e){if(this.lockedLocationRange)return;e=bt(e);const t=this.createDOMRangeFromLocationRange(e);t&&(uk(t),this.updateCurrentLocationRange(e))}setLocationRangeFromPointRange(e){e=bt(e);const t=this.getLocationAtPoint(e[0]),n=this.getLocationAtPoint(e[1]);this.setLocationRange([t,n])}getClientRectAtLocationRange(e){const t=this.createDOMRangeFromLocationRange(e);if(t)return this.getClientRectsForDOMRange(t)[1]}locationIsCursorTarget(e){const t=Array.from(this.findNodeAndOffsetFromLocation(e))[0];return mo(t)}lock(){this.lockCount++==0&&(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange())}unlock(){if(--this.lockCount==0){const{lockedLocationRange:e}=this;if(this.lockedLocationRange=null,e!=null)return this.setLocationRange(e)}}clearSelection(){var e;return(e=ck())===null||e===void 0?void 0:e.removeAllRanges()}selectionIsCollapsed(){var e;return((e=Bl())===null||e===void 0?void 0:e.collapsed)===!0}selectionIsExpanded(){return!this.selectionIsCollapsed()}createLocationRangeFromDOMRange(e,t){if(e==null||!this.domRangeWithinElement(e))return;const n=this.findLocationFromContainerAndOffset(e.startContainer,e.startOffset,t);if(!n)return;const r=e.collapsed?void 0:this.findLocationFromContainerAndOffset(e.endContainer,e.endOffset,t);return bt([n,r])}didMouseDown(){return this.pauseTemporarily()}pauseTemporarily(){let e;this.paused=!0;const t=()=>{if(this.paused=!1,clearTimeout(n),Array.from(e).forEach(r=>{r.destroy()}),ws(document,this.element))return this.selectionDidChange()},n=setTimeout(t,200);e=["mousemove","keydown"].map(r=>Zt(r,{onElement:document,withCallback:t}))}selectionDidChange(){if(!this.paused&&!Gm(this.element))return this.updateCurrentLocationRange()}updateCurrentLocationRange(e){var t,n;if((e??(e=this.createLocationRangeFromDOMRange(Bl())))&&!wu(e,this.currentLocationRange))return this.currentLocationRange=e,(t=this.delegate)===null||t===void 0||(n=t.locationRangeDidChange)===null||n===void 0?void 0:n.call(t,this.currentLocationRange.slice(0))}createDOMRangeFromLocationRange(e){const t=this.findContainerAndOffsetFromLocation(e[0]),n=or(e)?t:this.findContainerAndOffsetFromLocation(e[1])||t;if(t!=null&&n!=null){const r=document.createRange();return r.setStart(...Array.from(t||[])),r.setEnd(...Array.from(n||[])),r}}getLocationAtPoint(e){const t=this.createDOMRangeFromPoint(e);var n;if(t)return(n=this.createLocationRangeFromDOMRange(t))===null||n===void 0?void 0:n[0]}domRangeWithinElement(e){return e.collapsed?ws(this.element,e.startContainer):ws(this.element,e.startContainer)&&ws(this.element,e.endContainer)}}gs.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),gs.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),gs.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),gs.proxyMethod("pointMapper.createDOMRangeFromPoint"),gs.proxyMethod("pointMapper.getClientRectsForDOMRange");var Ek=Object.freeze({__proto__:null,Attachment:Yo,AttachmentManager:_k,AttachmentPiece:xo,Block:Xi,Composition:Tr,Document:si,Editor:xk,HTMLParser:oa,HTMLSanitizer:lh,LineBreakInsertion:Ck,LocationMapper:Tk,ManagedAttachment:Nt,Piece:Bs,PointMapper:Mk,SelectionManager:gs,SplittableList:ku,StringPiece:rp,Text:Si,UndoManager:Ed}),R4=Object.freeze({__proto__:null,ObjectView:Zs,AttachmentView:ip,BlockView:bk,DocumentView:ah,PieceView:gk,PreviewableAttachmentView:pk,TextView:Ok});const{lang:Of,css:cs,keyNames:D4}=$a,bf=function(i){return function(){const e=i.apply(this,arguments);e.do(),this.undos||(this.undos=[]),this.undos.push(e.undo)}};class Rk extends Kt{constructor(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(...arguments),gn(this,"makeElementMutable",bf(()=>({do:()=>{this.element.dataset.trixMutable=!0},undo:()=>delete this.element.dataset.trixMutable}))),gn(this,"addToolbar",bf(()=>{const s=Ge({tagName:"div",className:cs.attachmentToolbar,data:{trixMutable:!0},childNodes:Ge({tagName:"div",className:"trix-button-row",childNodes:Ge({tagName:"span",className:"trix-button-group trix-button-group--actions",childNodes:Ge({tagName:"button",className:"trix-button trix-button--remove",textContent:Of.remove,attributes:{title:Of.remove},data:{trixAction:"remove"}})})})});return this.attachment.isPreviewable()&&s.appendChild(Ge({tagName:"div",className:cs.attachmentMetadataContainer,childNodes:Ge({tagName:"span",className:cs.attachmentMetadata,childNodes:[Ge({tagName:"span",className:cs.attachmentName,textContent:this.attachment.getFilename(),attributes:{title:this.attachment.getFilename()}}),Ge({tagName:"span",className:cs.attachmentSize,textContent:this.attachment.getFormattedFilesize()})]})})),Zt("click",{onElement:s,withCallback:this.didClickToolbar}),Zt("click",{onElement:s,matchingSelector:"[data-trix-action]",withCallback:this.didClickActionButton}),Il("trix-attachment-before-toolbar",{onElement:this.element,attributes:{toolbar:s,attachment:this.attachment}}),{do:()=>this.element.appendChild(s),undo:()=>zr(s)}})),gn(this,"installCaptionEditor",bf(()=>{const s=Ge({tagName:"textarea",className:cs.attachmentCaptionEditor,attributes:{placeholder:Of.captionPlaceholder},data:{trixMutable:!0}});s.value=this.attachmentPiece.getCaption();const o=s.cloneNode();o.classList.add("trix-autoresize-clone"),o.tabIndex=-1;const l=function(){o.value=s.value,s.style.height=o.scrollHeight+"px"};Zt("input",{onElement:s,withCallback:l}),Zt("input",{onElement:s,withCallback:this.didInputCaption}),Zt("keydown",{onElement:s,withCallback:this.didKeyDownCaption}),Zt("change",{onElement:s,withCallback:this.didChangeCaption}),Zt("blur",{onElement:s,withCallback:this.didBlurCaption});const a=this.element.querySelector("figcaption"),c=a.cloneNode();return{do:()=>{if(a.style.display="none",c.appendChild(s),c.appendChild(o),c.classList.add("".concat(cs.attachmentCaption,"--editing")),a.parentElement.insertBefore(c,a),l(),this.options.editCaption)return Jm(()=>s.focus())},undo(){zr(c),a.style.display=null}}})),this.didClickToolbar=this.didClickToolbar.bind(this),this.didClickActionButton=this.didClickActionButton.bind(this),this.didKeyDownCaption=this.didKeyDownCaption.bind(this),this.didInputCaption=this.didInputCaption.bind(this),this.didChangeCaption=this.didChangeCaption.bind(this),this.didBlurCaption=this.didBlurCaption.bind(this),this.attachmentPiece=e,this.element=t,this.container=n,this.options=r,this.attachment=this.attachmentPiece.attachment,kn(this.element)==="a"&&(this.element=this.element.firstChild),this.install()}install(){this.makeElementMutable(),this.addToolbar(),this.attachment.isPreviewable()&&this.installCaptionEditor()}uninstall(){var e;let t=this.undos.pop();for(this.savePendingCaption();t;)t(),t=this.undos.pop();(e=this.delegate)===null||e===void 0||e.didUninstallAttachmentEditor(this)}savePendingCaption(){if(this.pendingCaption!=null){const s=this.pendingCaption;var e,t,n,r;this.pendingCaption=null,s?(e=this.delegate)===null||e===void 0||(t=e.attachmentEditorDidRequestUpdatingAttributesForAttachment)===null||t===void 0||t.call(e,{caption:s},this.attachment):(n=this.delegate)===null||n===void 0||(r=n.attachmentEditorDidRequestRemovingAttributeForAttachment)===null||r===void 0||r.call(n,"caption",this.attachment)}}didClickToolbar(e){return e.preventDefault(),e.stopPropagation()}didClickActionButton(e){var t;if(e.target.getAttribute("data-trix-action")==="remove")return(t=this.delegate)===null||t===void 0?void 0:t.attachmentEditorDidRequestRemovalOfAttachment(this.attachment)}didKeyDownCaption(e){var t,n;if(D4[e.keyCode]==="return")return e.preventDefault(),this.savePendingCaption(),(t=this.delegate)===null||t===void 0||(n=t.attachmentEditorDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(t,this.attachment)}didInputCaption(e){this.pendingCaption=e.target.value.replace(/\s/g," ").trim()}didChangeCaption(e){return this.savePendingCaption()}didBlurCaption(e){return this.savePendingCaption()}}class Dk extends Kt{constructor(e,t){super(...arguments),this.didFocus=this.didFocus.bind(this),this.didBlur=this.didBlur.bind(this),this.didClickAttachment=this.didClickAttachment.bind(this),this.element=e,this.composition=t,this.documentView=new ah(this.composition.document,{element:this.element}),Zt("focus",{onElement:this.element,withCallback:this.didFocus}),Zt("blur",{onElement:this.element,withCallback:this.didBlur}),Zt("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),Zt("mousedown",{onElement:this.element,matchingSelector:_s,withCallback:this.didClickAttachment}),Zt("click",{onElement:this.element,matchingSelector:"a".concat(_s),preventDefault:!0})}didFocus(e){var t;const n=()=>{var r,s;if(!this.focused)return this.focused=!0,(r=this.delegate)===null||r===void 0||(s=r.compositionControllerDidFocus)===null||s===void 0?void 0:s.call(r)};return((t=this.blurPromise)===null||t===void 0?void 0:t.then(n))||n()}didBlur(e){this.blurPromise=new Promise(t=>Jm(()=>{var n,r;return Gm(this.element)||(this.focused=null,(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidBlur)===null||r===void 0||r.call(n)),this.blurPromise=null,t()}))}didClickAttachment(e,t){var n,r;const s=this.findAttachmentForElement(t),o=!!Yr(e.target,{matchingSelector:"figcaption"});return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerDidSelectAttachment)===null||r===void 0?void 0:r.call(n,s,{editCaption:o})}getSerializableElement(){return this.isEditingAttachment()?this.documentView.shadowElement:this.element}render(){var e,t,n,r,s,o;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.canSyncDocumentView()&&!this.documentView.isSynced()&&((n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillSyncDocumentView)===null||r===void 0||r.call(n),this.documentView.sync(),(s=this.delegate)===null||s===void 0||(o=s.compositionControllerDidSyncDocumentView)===null||o===void 0||o.call(s)),(e=this.delegate)===null||e===void 0||(t=e.compositionControllerDidRender)===null||t===void 0?void 0:t.call(e)}rerenderViewForObject(e){return this.invalidateViewForObject(e),this.render()}invalidateViewForObject(e){return this.documentView.invalidateViewForObject(e)}isViewCachingEnabled(){return this.documentView.isViewCachingEnabled()}enableViewCaching(){return this.documentView.enableViewCaching()}disableViewCaching(){return this.documentView.disableViewCaching()}refreshViewCache(){return this.documentView.garbageCollectCachedViews()}isEditingAttachment(){return!!this.attachmentEditor}installAttachmentEditorForAttachment(e,t){var n;if(((n=this.attachmentEditor)===null||n===void 0?void 0:n.attachment)===e)return;const r=this.documentView.findElementForObject(e);if(!r)return;this.uninstallAttachmentEditor();const s=this.composition.document.getAttachmentPieceForAttachment(e);this.attachmentEditor=new Rk(s,r,this.element,t),this.attachmentEditor.delegate=this}uninstallAttachmentEditor(){var e;return(e=this.attachmentEditor)===null||e===void 0?void 0:e.uninstall()}didUninstallAttachmentEditor(){return this.attachmentEditor=null,this.render()}attachmentEditorDidRequestUpdatingAttributesForAttachment(e,t){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,t),this.composition.updateAttributesForAttachment(e,t)}attachmentEditorDidRequestRemovingAttributeForAttachment(e,t){var n,r;return(n=this.delegate)===null||n===void 0||(r=n.compositionControllerWillUpdateAttachment)===null||r===void 0||r.call(n,t),this.composition.removeAttributeForAttachment(e,t)}attachmentEditorDidRequestRemovalOfAttachment(e){var t,n;return(t=this.delegate)===null||t===void 0||(n=t.compositionControllerDidRequestRemovalOfAttachment)===null||n===void 0?void 0:n.call(t,e)}attachmentEditorDidRequestDeselectingAttachment(e){var t,n;return(t=this.delegate)===null||t===void 0||(n=t.compositionControllerDidRequestDeselectingAttachment)===null||n===void 0?void 0:n.call(t,e)}canSyncDocumentView(){return!this.isEditingAttachment()}findAttachmentForElement(e){return this.composition.document.getAttachmentById(parseInt(e.dataset.trixId,10))}}class $k extends Kt{}const Lk="data-trix-mutable",$4="[".concat(Lk,"]"),L4={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0};class Ik extends Kt{constructor(e){super(e),this.didMutate=this.didMutate.bind(this),this.element=e,this.observer=new window.MutationObserver(this.didMutate),this.start()}start(){return this.reset(),this.observer.observe(this.element,L4)}stop(){return this.observer.disconnect()}didMutate(e){var t,n;if(this.mutations.push(...Array.from(this.findSignificantMutations(e)||[])),this.mutations.length)return(t=this.delegate)===null||t===void 0||(n=t.elementDidMutate)===null||n===void 0||n.call(t,this.getMutationSummary()),this.reset()}reset(){this.mutations=[]}findSignificantMutations(e){return e.filter(t=>this.mutationIsSignificant(t))}mutationIsSignificant(e){if(this.nodeIsMutable(e.target))return!1;for(const t of Array.from(this.nodesModifiedByMutation(e)))if(this.nodeIsSignificant(t))return!0;return!1}nodeIsSignificant(e){return e!==this.element&&!this.nodeIsMutable(e)&&!nk(e)}nodeIsMutable(e){return Yr(e,{matchingSelector:$4})}nodesModifiedByMutation(e){const t=[];switch(e.type){case"attributes":e.attributeName!==Lk&&t.push(e.target);break;case"characterData":t.push(e.target.parentNode),t.push(e.target);break;case"childList":t.push(...Array.from(e.addedNodes||[])),t.push(...Array.from(e.removedNodes||[]))}return t}getMutationSummary(){return this.getTextMutationSummary()}getTextMutationSummary(){const{additions:e,deletions:t}=this.getTextChangesFromCharacterData(),n=this.getTextChangesFromChildList();Array.from(n.additions).forEach(l=>{Array.from(e).includes(l)||e.push(l)}),t.push(...Array.from(n.deletions||[]));const r={},s=e.join("");s&&(r.textAdded=s);const o=t.join("");return o&&(r.textDeleted=o),r}getMutationsByType(e){return Array.from(this.mutations).filter(t=>t.type===e)}getTextChangesFromChildList(){let e,t;const n=[],r=[];Array.from(this.getMutationsByType("childList")).forEach(l=>{n.push(...Array.from(l.addedNodes||[])),r.push(...Array.from(l.removedNodes||[]))}),n.length===0&&r.length===1&&fo(r[0])?(e=[],t=[` +`]):(e=Rd(n),t=Rd(r));const s=e.filter((l,a)=>l!==t[a]).map(kl),o=t.filter((l,a)=>l!==e[a]).map(kl);return{additions:s,deletions:o}}getTextChangesFromCharacterData(){let e,t;const n=this.getMutationsByType("characterData");if(n.length){const r=n[0],s=n[n.length-1],o=function(l,a){let c,u;return l=sa.box(l),(a=sa.box(a)).length0&&arguments[0]!==void 0?arguments[0]:[];const e=[];for(const t of Array.from(i))switch(t.nodeType){case Node.TEXT_NODE:e.push(t.data);break;case Node.ELEMENT_NODE:kn(t)==="br"?e.push(` +`):e.push(...Array.from(Rd(t.childNodes)||[]))}return e};class Nk extends yu{constructor(e){super(...arguments),this.file=e}perform(e){const t=new FileReader;return t.onerror=()=>e(!1),t.onload=()=>{t.onerror=null;try{t.abort()}catch{}return e(!0,this.file)},t.readAsArrayBuffer(this.file)}}class I4{constructor(e){this.element=e}shouldIgnore(e){return!!Da.samsungAndroid&&(this.previousEvent=this.event,this.event=e,this.checkSamsungKeyboardBuggyModeStart(),this.checkSamsungKeyboardBuggyModeEnd(),this.buggyMode)}checkSamsungKeyboardBuggyModeStart(){this.insertingLongTextAfterUnidentifiedChar()&&N4(this.element.innerText,this.event.data)&&(this.buggyMode=!0,this.event.preventDefault())}checkSamsungKeyboardBuggyModeEnd(){this.buggyMode&&this.event.inputType!=="insertText"&&(this.buggyMode=!1)}insertingLongTextAfterUnidentifiedChar(){var e;return this.isBeforeInputInsertText()&&this.previousEventWasUnidentifiedKeydown()&&((e=this.event.data)===null||e===void 0?void 0:e.length)>50}isBeforeInputInsertText(){return this.event.type==="beforeinput"&&this.event.inputType==="insertText"}previousEventWasUnidentifiedKeydown(){var e,t;return((e=this.previousEvent)===null||e===void 0?void 0:e.type)==="keydown"&&((t=this.previousEvent)===null||t===void 0?void 0:t.key)==="Unidentified"}}const N4=(i,e)=>d0(i)===d0(e),Z4=new RegExp("(".concat("","|").concat(oh,"|").concat(Rr,"|\\s)+"),"g"),d0=i=>i.replace(Z4," ").trim();class ch extends Kt{constructor(e){super(...arguments),this.element=e,this.mutationObserver=new Ik(this.element),this.mutationObserver.delegate=this,this.flakyKeyboardDetector=new I4(this.element);for(const t in this.constructor.events)Zt(t,{onElement:this.element,withCallback:this.handlerFor(t)})}elementDidMutate(e){}editorWillSyncDocumentView(){return this.mutationObserver.stop()}editorDidSyncDocumentView(){return this.mutationObserver.start()}requestRender(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidRequestRender)===null||t===void 0?void 0:t.call(e)}requestReparse(){var e,t;return(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidRequestReparse)===null||t===void 0||t.call(e),this.requestRender()}attachFiles(e){const t=Array.from(e).map(n=>new Nk(n));return Promise.all(t).then(n=>{this.handleInput(function(){var r,s;return(r=this.delegate)===null||r===void 0||r.inputControllerWillAttachFiles(),(s=this.responder)===null||s===void 0||s.insertFiles(n),this.requestRender()})})}handlerFor(e){return t=>{t.defaultPrevented||this.handleInput(()=>{if(!Gm(this.element)){if(this.flakyKeyboardDetector.shouldIgnore(t))return;this.eventName=e,this.constructor.events[e].call(this,t)}})}}handleInput(e){try{var t;(t=this.delegate)===null||t===void 0||t.inputControllerWillHandleInput(),e.call(this)}finally{var n;(n=this.delegate)===null||n===void 0||n.inputControllerDidHandleInput()}}createLinkHTML(e,t){const n=document.createElement("a");return n.href=e,n.textContent=t||e,n.outerHTML}}var vf;gn(ch,"events",{});const{browser:B4,keyNames:Zk}=$a;let W4=0;class ir extends ch{constructor(){super(...arguments),this.resetInputSummary()}setInputSummary(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.inputSummary.eventName=this.eventName;for(const t in e){const n=e[t];this.inputSummary[t]=n}return this.inputSummary}resetInputSummary(){this.inputSummary={}}reset(){return this.resetInputSummary(),Qs.reset()}elementDidMutate(e){var t,n;return this.isComposing()?(t=this.delegate)===null||t===void 0||(n=t.inputControllerDidAllowUnhandledInput)===null||n===void 0?void 0:n.call(t):this.handleInput(function(){return this.mutationIsSignificant(e)&&(this.mutationIsExpected(e)?this.requestRender():this.requestReparse()),this.reset()})}mutationIsExpected(e){let{textAdded:t,textDeleted:n}=e;if(this.inputSummary.preferDocument)return!0;const r=t!=null?t===this.inputSummary.textAdded:!this.inputSummary.textAdded,s=n!=null?this.inputSummary.didDelete:!this.inputSummary.didDelete,o=[` `,` `].includes(t)&&!r,l=n===` -`&&!s;if(o&&!l||l&&!o){const c=this.getSelectedRange();if(c){var a;const u=o?t.replace(/\n$/,"").length||-1:(t==null?void 0:t.length)||1;if((a=this.responder)!==null&&a!==void 0&&a.positionIsBlockBreak(c[1]+u))return!0}}return r&&s}mutationIsSignificant(e){var t;const n=Object.keys(e).length>0,r=((t=this.compositionInput)===null||t===void 0?void 0:t.getEndData())==="";return n||!r}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new Ar(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(e,t){var n;return((n=this.responder)===null||n===void 0?void 0:n.deleteInDirection(e))!==!1?this.setInputSummary({didDelete:!0}):t?(t.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(e){var t;if(!function(r){if(r==null||!r.setData)return!1;for(const s in K1){const o=K1[s];try{if(r.setData(s,o),!r.getData(s)===o)return!1}catch{return!1}}return!0}(e))return;const n=(t=this.responder)===null||t===void 0?void 0:t.getSelectedDocument().toSerializableDocument();return e.setData("application/x-trix-document",JSON.stringify(n)),e.setData("text/html",ah.render(n).innerHTML),e.setData("text/plain",n.toString().replace(/\n$/,"")),!0}canAcceptDataTransfer(e){const t={};return Array.from((e==null?void 0:e.types)||[]).forEach(n=>{t[n]=!0}),t.Files||t["application/x-trix-document"]||t["text/html"]||t["text/plain"]}getPastedHTMLUsingHiddenElement(e){const t=this.getSelectedRange(),n={position:"absolute",left:"".concat(window.pageXOffset,"px"),top:"".concat(window.pageYOffset,"px"),opacity:0},r=Ge({style:n,tagName:"div",editable:!0});return document.body.appendChild(r),r.focus(),requestAnimationFrame(()=>{const s=r.innerHTML;return Vr(r),this.setSelectedRange(t),e(s)})}}gn(ir,"events",{keydown(i){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;const e=Uk[i.keyCode];if(e){var t;let r=this.keys;["ctrl","alt","shift","meta"].forEach(s=>{var o;i["".concat(s,"Key")]&&(s==="ctrl"&&(s="control"),r=(o=r)===null||o===void 0?void 0:o[s])}),((t=r)===null||t===void 0?void 0:t[e])!=null&&(this.setInputSummary({keyName:e}),Ts.reset(),r[e].call(this,i))}if(mk(i)){const r=String.fromCharCode(i.keyCode).toLowerCase();if(r){var n;const s=["alt","shift"].map(o=>{if(i["".concat(o,"Key")])return o}).filter(o=>o);s.push(r),(n=this.delegate)!==null&&n!==void 0&&n.inputControllerDidReceiveKeyboardCommand(s)&&i.preventDefault()}}},keypress(i){if(this.inputSummary.eventName!=null||i.metaKey||i.ctrlKey&&!i.altKey)return;const e=J4(i);var t,n;return e?((t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e,didDelete:this.selectionIsExpanded()})):void 0},textInput(i){const{data:e}=i,{textAdded:t}=this.inputSummary;if(t&&t!==e&&t.toUpperCase()===e){var n;const r=this.getSelectedRange();return this.setSelectedRange([r[0],r[1]+t.length]),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e}),this.setSelectedRange(r)}},dragenter(i){i.preventDefault()},dragstart(i){var e,t;return this.serializeSelectionToDataTransfer(i.dataTransfer),this.draggedRange=this.getSelectedRange(),(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidStartDrag)===null||t===void 0?void 0:t.call(e)},dragover(i){if(this.draggedRange||this.canAcceptDataTransfer(i.dataTransfer)){i.preventDefault();const n={x:i.clientX,y:i.clientY};var e,t;if(!Xo(n,this.draggingPoint))return this.draggingPoint=n,(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidReceiveDragOverPoint)===null||t===void 0?void 0:t.call(e,this.draggingPoint)}},dragend(i){var e,t;(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidCancelDrag)===null||t===void 0||t.call(e),this.draggedRange=null,this.draggingPoint=null},drop(i){var e,t;i.preventDefault();const n=(e=i.dataTransfer)===null||e===void 0?void 0:e.files,r=i.dataTransfer.getData("application/x-trix-document"),s={x:i.clientX,y:i.clientY};if((t=this.responder)===null||t===void 0||t.setLocationRangeFromPointRange(s),n!=null&&n.length)this.attachFiles(n);else if(this.draggedRange){var o,l;(o=this.delegate)===null||o===void 0||o.inputControllerWillMoveText(),(l=this.responder)===null||l===void 0||l.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()}else if(r){var a;const c=si.fromJSONString(r);(a=this.responder)===null||a===void 0||a.insertDocument(c),this.requestRender()}this.draggedRange=null,this.draggingPoint=null},cut(i){var e,t;if((e=this.responder)!==null&&e!==void 0&&e.selectionIsExpanded()&&(this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillCutText(),this.deleteInDirection("backward"),i.defaultPrevented))return this.requestRender()},copy(i){var e;(e=this.responder)!==null&&e!==void 0&&e.selectionIsExpanded()&&this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault()},paste(i){const e=i.clipboardData||i.testClipboardData,t={clipboard:e};if(!e||eD(i))return void this.getPastedHTMLUsingHiddenElement(_=>{var k,Q,x;return t.type="text/html",t.html=_,(k=this.delegate)===null||k===void 0||k.inputControllerWillPaste(t),(Q=this.responder)===null||Q===void 0||Q.insertHTML(t.html),this.requestRender(),(x=this.delegate)===null||x===void 0?void 0:x.inputControllerDidPaste(t)});const n=e.getData("URL"),r=e.getData("text/html"),s=e.getData("public.url-name");if(n){var o,l,a;let _;t.type="text/html",_=s?ip(s).trim():n,t.html=this.createLinkHTML(n,_),(o=this.delegate)===null||o===void 0||o.inputControllerWillPaste(t),this.setInputSummary({textAdded:_,didDelete:this.selectionIsExpanded()}),(l=this.responder)===null||l===void 0||l.insertHTML(t.html),this.requestRender(),(a=this.delegate)===null||a===void 0||a.inputControllerDidPaste(t)}else if(dk(e)){var c,u,h;t.type="text/plain",t.string=e.getData("text/plain"),(c=this.delegate)===null||c===void 0||c.inputControllerWillPaste(t),this.setInputSummary({textAdded:t.string,didDelete:this.selectionIsExpanded()}),(u=this.responder)===null||u===void 0||u.insertString(t.string),this.requestRender(),(h=this.delegate)===null||h===void 0||h.inputControllerDidPaste(t)}else if(r){var f,d,m;t.type="text/html",t.html=r,(f=this.delegate)===null||f===void 0||f.inputControllerWillPaste(t),(d=this.responder)===null||d===void 0||d.insertHTML(t.html),this.requestRender(),(m=this.delegate)===null||m===void 0||m.inputControllerDidPaste(t)}else if(Array.from(e.types).includes("Files")){var p,g;const _=(p=e.items)===null||p===void 0||(p=p[0])===null||p===void 0||(g=p.getAsFile)===null||g===void 0?void 0:g.call(p);if(_){var b,w,S;const k=H4(_);!_.name&&k&&(_.name="pasted-file-".concat(++G4,".").concat(k)),t.type="File",t.file=_,(b=this.delegate)===null||b===void 0||b.inputControllerWillAttachFiles(),(w=this.responder)===null||w===void 0||w.insertFile(t.file),this.requestRender(),(S=this.delegate)===null||S===void 0||S.inputControllerDidPaste(t)}}i.preventDefault()},compositionstart(i){return this.getCompositionInput().start(i.data)},compositionupdate(i){return this.getCompositionInput().update(i.data)},compositionend(i){return this.getCompositionInput().end(i.data)},beforeinput(i){this.inputSummary.didInput=!0},input(i){return this.inputSummary.didInput=!0,i.stopPropagation()}}),gn(ir,"keys",{backspace(i){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",i)},delete(i){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",i)},return(i){var e,t;return this.setInputSummary({preferDocument:!0}),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0?void 0:t.insertLineBreak()},tab(i){var e,t;(e=this.responder)!==null&&e!==void 0&&e.canIncreaseNestingLevel()&&((t=this.responder)===null||t===void 0||t.increaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){var e;if(this.selectionIsInCursorTarget())return i.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("backward")},right(i){var e;if(this.selectionIsInCursorTarget())return i.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("forward")},control:{d(i){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",i)},h(i){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",i)},o(i){var e,t;return i.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.insertString(` +`&&!s;if(o&&!l||l&&!o){const c=this.getSelectedRange();if(c){var a;const u=o?t.replace(/\n$/,"").length||-1:(t==null?void 0:t.length)||1;if((a=this.responder)!==null&&a!==void 0&&a.positionIsBlockBreak(c[1]+u))return!0}}return r&&s}mutationIsSignificant(e){var t;const n=Object.keys(e).length>0,r=((t=this.compositionInput)===null||t===void 0?void 0:t.getEndData())==="";return n||!r}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new Ar(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(e,t){var n;return((n=this.responder)===null||n===void 0?void 0:n.deleteInDirection(e))!==!1?this.setInputSummary({didDelete:!0}):t?(t.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(e){var t;if(!function(r){if(r==null||!r.setData)return!1;for(const s in F1){const o=F1[s];try{if(r.setData(s,o),!r.getData(s)===o)return!1}catch{return!1}}return!0}(e))return;const n=(t=this.responder)===null||t===void 0?void 0:t.getSelectedDocument().toSerializableDocument();return e.setData("application/x-trix-document",JSON.stringify(n)),e.setData("text/html",ah.render(n).innerHTML),e.setData("text/plain",n.toString().replace(/\n$/,"")),!0}canAcceptDataTransfer(e){const t={};return Array.from((e==null?void 0:e.types)||[]).forEach(n=>{t[n]=!0}),t.Files||t["application/x-trix-document"]||t["text/html"]||t["text/plain"]}getPastedHTMLUsingHiddenElement(e){const t=this.getSelectedRange(),n={position:"absolute",left:"".concat(window.pageXOffset,"px"),top:"".concat(window.pageYOffset,"px"),opacity:0},r=Ge({style:n,tagName:"div",editable:!0});return document.body.appendChild(r),r.focus(),requestAnimationFrame(()=>{const s=r.innerHTML;return zr(r),this.setSelectedRange(t),e(s)})}}gn(ir,"events",{keydown(i){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;const e=Zk[i.keyCode];if(e){var t;let r=this.keys;["ctrl","alt","shift","meta"].forEach(s=>{var o;i["".concat(s,"Key")]&&(s==="ctrl"&&(s="control"),r=(o=r)===null||o===void 0?void 0:o[s])}),((t=r)===null||t===void 0?void 0:t[e])!=null&&(this.setInputSummary({keyName:e}),Qs.reset(),r[e].call(this,i))}if(ok(i)){const r=String.fromCharCode(i.keyCode).toLowerCase();if(r){var n;const s=["alt","shift"].map(o=>{if(i["".concat(o,"Key")])return o}).filter(o=>o);s.push(r),(n=this.delegate)!==null&&n!==void 0&&n.inputControllerDidReceiveKeyboardCommand(s)&&i.preventDefault()}}},keypress(i){if(this.inputSummary.eventName!=null||i.metaKey||i.ctrlKey&&!i.altKey)return;const e=Y4(i);var t,n;return e?((t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e,didDelete:this.selectionIsExpanded()})):void 0},textInput(i){const{data:e}=i,{textAdded:t}=this.inputSummary;if(t&&t!==e&&t.toUpperCase()===e){var n;const r=this.getSelectedRange();return this.setSelectedRange([r[0],r[1]+t.length]),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e}),this.setSelectedRange(r)}},dragenter(i){i.preventDefault()},dragstart(i){var e,t;return this.serializeSelectionToDataTransfer(i.dataTransfer),this.draggedRange=this.getSelectedRange(),(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidStartDrag)===null||t===void 0?void 0:t.call(e)},dragover(i){if(this.draggedRange||this.canAcceptDataTransfer(i.dataTransfer)){i.preventDefault();const n={x:i.clientX,y:i.clientY};var e,t;if(!Fo(n,this.draggingPoint))return this.draggingPoint=n,(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidReceiveDragOverPoint)===null||t===void 0?void 0:t.call(e,this.draggingPoint)}},dragend(i){var e,t;(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidCancelDrag)===null||t===void 0||t.call(e),this.draggedRange=null,this.draggingPoint=null},drop(i){var e,t;i.preventDefault();const n=(e=i.dataTransfer)===null||e===void 0?void 0:e.files,r=i.dataTransfer.getData("application/x-trix-document"),s={x:i.clientX,y:i.clientY};if((t=this.responder)===null||t===void 0||t.setLocationRangeFromPointRange(s),n!=null&&n.length)this.attachFiles(n);else if(this.draggedRange){var o,l;(o=this.delegate)===null||o===void 0||o.inputControllerWillMoveText(),(l=this.responder)===null||l===void 0||l.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()}else if(r){var a;const c=si.fromJSONString(r);(a=this.responder)===null||a===void 0||a.insertDocument(c),this.requestRender()}this.draggedRange=null,this.draggingPoint=null},cut(i){var e,t;if((e=this.responder)!==null&&e!==void 0&&e.selectionIsExpanded()&&(this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillCutText(),this.deleteInDirection("backward"),i.defaultPrevented))return this.requestRender()},copy(i){var e;(e=this.responder)!==null&&e!==void 0&&e.selectionIsExpanded()&&this.serializeSelectionToDataTransfer(i.clipboardData)&&i.preventDefault()},paste(i){const e=i.clipboardData||i.testClipboardData,t={clipboard:e};if(!e||z4(i))return void this.getPastedHTMLUsingHiddenElement(_=>{var k,A,C;return t.type="text/html",t.html=_,(k=this.delegate)===null||k===void 0||k.inputControllerWillPaste(t),(A=this.responder)===null||A===void 0||A.insertHTML(t.html),this.requestRender(),(C=this.delegate)===null||C===void 0?void 0:C.inputControllerDidPaste(t)});const n=e.getData("URL"),r=e.getData("text/html"),s=e.getData("public.url-name");if(n){var o,l,a;let _;t.type="text/html",_=s?tp(s).trim():n,t.html=this.createLinkHTML(n,_),(o=this.delegate)===null||o===void 0||o.inputControllerWillPaste(t),this.setInputSummary({textAdded:_,didDelete:this.selectionIsExpanded()}),(l=this.responder)===null||l===void 0||l.insertHTML(t.html),this.requestRender(),(a=this.delegate)===null||a===void 0||a.inputControllerDidPaste(t)}else if(sk(e)){var c,u,h;t.type="text/plain",t.string=e.getData("text/plain"),(c=this.delegate)===null||c===void 0||c.inputControllerWillPaste(t),this.setInputSummary({textAdded:t.string,didDelete:this.selectionIsExpanded()}),(u=this.responder)===null||u===void 0||u.insertString(t.string),this.requestRender(),(h=this.delegate)===null||h===void 0||h.inputControllerDidPaste(t)}else if(r){var f,d,m;t.type="text/html",t.html=r,(f=this.delegate)===null||f===void 0||f.inputControllerWillPaste(t),(d=this.responder)===null||d===void 0||d.insertHTML(t.html),this.requestRender(),(m=this.delegate)===null||m===void 0||m.inputControllerDidPaste(t)}else if(Array.from(e.types).includes("Files")){var p,g;const _=(p=e.items)===null||p===void 0||(p=p[0])===null||p===void 0||(g=p.getAsFile)===null||g===void 0?void 0:g.call(p);if(_){var v,w,S;const k=X4(_);!_.name&&k&&(_.name="pasted-file-".concat(++W4,".").concat(k)),t.type="File",t.file=_,(v=this.delegate)===null||v===void 0||v.inputControllerWillAttachFiles(),(w=this.responder)===null||w===void 0||w.insertFile(t.file),this.requestRender(),(S=this.delegate)===null||S===void 0||S.inputControllerDidPaste(t)}}i.preventDefault()},compositionstart(i){return this.getCompositionInput().start(i.data)},compositionupdate(i){return this.getCompositionInput().update(i.data)},compositionend(i){return this.getCompositionInput().end(i.data)},beforeinput(i){this.inputSummary.didInput=!0},input(i){return this.inputSummary.didInput=!0,i.stopPropagation()}}),gn(ir,"keys",{backspace(i){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",i)},delete(i){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",i)},return(i){var e,t;return this.setInputSummary({preferDocument:!0}),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0?void 0:t.insertLineBreak()},tab(i){var e,t;(e=this.responder)!==null&&e!==void 0&&e.canIncreaseNestingLevel()&&((t=this.responder)===null||t===void 0||t.increaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){var e;if(this.selectionIsInCursorTarget())return i.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("backward")},right(i){var e;if(this.selectionIsInCursorTarget())return i.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("forward")},control:{d(i){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",i)},h(i){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",i)},o(i){var e,t;return i.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.insertString(` `,{updatePosition:!1}),this.requestRender()}},shift:{return(i){var e,t;(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.insertString(` -`),this.requestRender(),i.preventDefault()},tab(i){var e,t;(e=this.responder)!==null&&e!==void 0&&e.canDecreaseNestingLevel()&&((t=this.responder)===null||t===void 0||t.decreaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("backward")},right(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(i){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}},meta:{backspace(i){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}}}),ir.proxyMethod("responder?.getSelectedRange"),ir.proxyMethod("responder?.setSelectedRange"),ir.proxyMethod("responder?.expandSelectionInDirection"),ir.proxyMethod("responder?.selectionIsInCursorTarget"),ir.proxyMethod("responder?.selectionIsExpanded");const H4=i=>{var e;return(e=i.type)===null||e===void 0||(e=e.match(/\/(\w+)$/))===null||e===void 0?void 0:e[1]},K4=!((vf=" ".codePointAt)===null||vf===void 0||!vf.call(" ",0)),J4=function(i){if(i.key&&K4&&i.key.codePointAt(0)===i.keyCode)return i.key;{let e;if(i.which===null?e=i.keyCode:i.which!==0&&i.charCode!==0&&(e=i.charCode),e!=null&&Uk[e]!=="escape")return sa.fromCodepoints([e]).toString()}},eD=function(i){const e=i.clipboardData;if(e){if(e.types.includes("text/html")){for(const t of e.types){const n=/^CorePasteboardFlavorType/.test(t),r=/^dyn\./.test(t)&&e.getData(t);if(n||r)return!0}return!1}{const t=e.types.includes("com.apple.webarchive"),n=e.types.includes("com.apple.flat-rtfd");return t||n}}};class Ar extends Kt{constructor(e){super(...arguments),this.inputController=e,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(e){if(this.data.start=e,this.isSignificant()){var t,n;this.inputSummary.eventName==="keypress"&&this.inputSummary.textAdded&&((n=this.responder)===null||n===void 0||n.deleteInDirection("left")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(t=this.responder)===null||t===void 0?void 0:t.getSelectedRange()}}update(e){if(this.data.update=e,this.isSignificant()){const t=this.selectPlaceholder();t&&(this.forgetPlaceholder(),this.range=t)}}end(e){return this.data.end=e,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.setSelectedRange(this.range),(r=this.responder)===null||r===void 0||r.insertString(this.data.end),(s=this.responder)===null||s===void 0?void 0:s.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var t,n,r,s}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!q4.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var e,t;return((e=this.data.start)===null||e===void 0?void 0:e.length)===0&&((t=this.data.end)===null||t===void 0?void 0:t.length)>0&&this.range}}Ar.proxyMethod("inputController.setInputSummary"),Ar.proxyMethod("inputController.requestRender"),Ar.proxyMethod("inputController.requestReparse"),Ar.proxyMethod("responder?.selectionIsExpanded"),Ar.proxyMethod("responder?.insertPlaceholder"),Ar.proxyMethod("responder?.selectPlaceholder"),Ar.proxyMethod("responder?.forgetPlaceholder");class Wl extends ch{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidAllowUnhandledInput)===null||t===void 0?void 0:t.call(e):void 0:this.reparse();var e,t}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var e,t;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(t=this.delegate)===null||t===void 0||t.render(),(e=this.afterRender)===null||e===void 0||e.call(this),this.afterRender=null}reparse(){var e;return(e=this.delegate)===null||e===void 0?void 0:e.reparse()}insertString(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.insertString(t,n)})}toggleAttributeIfSupported(e){var t;if(Pd().includes(e))return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformFormatting(e),this.withTargetDOMRange(function(){var n;return(n=this.responder)===null||n===void 0?void 0:n.toggleCurrentAttribute(e)})}activateAttributeIfSupported(e,t){var n;if(Pd().includes(e))return(n=this.delegate)===null||n===void 0||n.inputControllerWillPerformFormatting(e),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.setCurrentAttribute(e,t)})}deleteInDirection(e){let{recordUndoEntry:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{recordUndoEntry:!0};var n;t&&((n=this.delegate)===null||n===void 0||n.inputControllerWillPerformTyping());const r=()=>{var o;return(o=this.responder)===null||o===void 0?void 0:o.deleteInDirection(e)},s=this.getTargetDOMRange({minLength:this.composing?1:2});return s?this.withTargetDOMRange(s,r):r()}withTargetDOMRange(e,t){var n;return typeof e=="function"&&(t=e,e=this.getTargetDOMRange()),e?(n=this.responder)===null||n===void 0?void 0:n.withTargetDOMRange(e,t.bind(this)):(Ts.reset(),t.call(this))}getTargetDOMRange(){var e,t;let{minLength:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{minLength:0};const r=(e=(t=this.event).getTargetRanges)===null||e===void 0?void 0:e.call(t);if(r&&r.length){const s=tD(r[0]);if(n===0||s.toString().length>=n)return s}}withEvent(e,t){let n;this.event=e;try{n=t.call(this)}finally{this.event=null}return n}}gn(Wl,"events",{keydown(i){if(mk(i)){var e;const t=rD(i);(e=this.delegate)!==null&&e!==void 0&&e.inputControllerDidReceiveKeyboardCommand(t)&&i.preventDefault()}else{let t=i.key;i.altKey&&(t+="+Alt"),i.shiftKey&&(t+="+Shift");const n=this.constructor.keys[t];if(n)return this.withEvent(i,n)}},paste(i){var e;let t;const n=(e=i.clipboardData)===null||e===void 0?void 0:e.getData("URL");return jk(i)?(i.preventDefault(),this.attachFiles(i.clipboardData.files)):iD(i)?(i.preventDefault(),t={type:"text/plain",string:i.clipboardData.getData("text/plain")},(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(t),(s=this.responder)===null||s===void 0||s.insertString(t.string),this.render(),(o=this.delegate)===null||o===void 0?void 0:o.inputControllerDidPaste(t)):n?(i.preventDefault(),t={type:"text/html",html:this.createLinkHTML(n)},(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(t),(a=this.responder)===null||a===void 0||a.insertHTML(t.html),this.render(),(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)):void 0;var r,s,o,l,a,c},beforeinput(i){const e=this.constructor.inputTypes[i.inputType],t=(n=i,!(!/iPhone|iPad/.test(navigator.userAgent)||n.inputType&&n.inputType!=="insertParagraph"));var n;e&&(this.withEvent(i,e),t||this.scheduleRender()),t&&this.render()},input(i){Ts.reset()},dragstart(i){var e,t;(e=this.responder)!==null&&e!==void 0&&e.selectionContainsAttachments()&&(i.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:(t=this.responder)===null||t===void 0?void 0:t.getSelectedRange(),point:yf(i)})},dragenter(i){wf(i)&&i.preventDefault()},dragover(i){if(this.dragging){i.preventDefault();const t=yf(i);var e;if(!Xo(t,this.dragging.point))return this.dragging.point=t,(e=this.responder)===null||e===void 0?void 0:e.setLocationRangeFromPointRange(t)}else wf(i)&&i.preventDefault()},drop(i){var e,t;if(this.dragging)return i.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillMoveText(),(t=this.responder)===null||t===void 0||t.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender();if(wf(i)){var n;i.preventDefault();const r=yf(i);return(n=this.responder)===null||n===void 0||n.setLocationRangeFromPointRange(r),this.attachFiles(i.dataTransfer.files)}},dragend(){var i;this.dragging&&((i=this.responder)===null||i===void 0||i.setSelectedRange(this.dragging.range),this.dragging=null)},compositionend(i){this.composing&&(this.composing=!1,Da.recentAndroid||this.scheduleRender())}}),gn(Wl,"keys",{ArrowLeft(){var i,e;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("backward"))return this.event.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("backward")},ArrowRight(){var i,e;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("forward"))return this.event.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("forward")},Backspace(){var i,e,t;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageDeletingInDirection("backward"))return this.event.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.deleteInDirection("backward"),this.render()},Tab(){var i,e;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.event.preventDefault(),(e=this.responder)===null||e===void 0||e.increaseNestingLevel(),this.render()},"Tab+Shift"(){var i,e;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.event.preventDefault(),(e=this.responder)===null||e===void 0||e.decreaseNestingLevel(),this.render()}}),gn(Wl,"inputTypes",{deleteByComposition(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut(){return this.deleteInDirection("backward")},deleteByDrag(){return this.event.preventDefault(),this.withTargetDOMRange(function(){var i;this.deleteByDragRange=(i=this.responder)===null||i===void 0?void 0:i.getSelectedRange()})},deleteCompositionText(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent(){return this.deleteInDirection("backward")},deleteContentBackward(){return this.deleteInDirection("backward")},deleteContentForward(){return this.deleteInDirection("forward")},deleteEntireSoftLine(){return this.deleteInDirection("forward")},deleteHardLineBackward(){return this.deleteInDirection("backward")},deleteHardLineForward(){return this.deleteInDirection("forward")},deleteSoftLineBackward(){return this.deleteInDirection("backward")},deleteSoftLineForward(){return this.deleteInDirection("forward")},deleteWordBackward(){return this.deleteInDirection("backward")},deleteWordForward(){return this.deleteInDirection("forward")},formatBackColor(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold(){return this.toggleAttributeIfSupported("bold")},formatFontColor(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.increaseNestingLevel()})},formatItalic(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.decreaseNestingLevel()})},formatRemove(){this.withTargetDOMRange(function(){for(const t in(i=this.responder)===null||i===void 0?void 0:i.getCurrentAttributes()){var i,e;(e=this.responder)===null||e===void 0||e.removeCurrentAttribute(t)}})},formatSetBlockTextDirection(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough(){return this.toggleAttributeIfSupported("strike")},formatSubscript(){return this.toggleAttributeIfSupported("sub")},formatSuperscript(){return this.toggleAttributeIfSupported("sup")},formatUnderline(){return this.toggleAttributeIfSupported("underline")},historyRedo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformRedo()},historyUndo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformUndo()},insertCompositionText(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop(){const i=this.deleteByDragRange;var e;if(i)return this.deleteByDragRange=null,(e=this.delegate)===null||e===void 0||e.inputControllerWillMoveText(),this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.moveTextFromRange(i)})},insertFromPaste(){const{dataTransfer:i}=this.event,e={dataTransfer:i},t=i.getData("URL"),n=i.getData("text/html");if(t){var r;let a;this.event.preventDefault(),e.type="text/html";const c=i.getData("public.url-name");a=c?ip(c).trim():t,e.html=this.createLinkHTML(t,a),(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(e),this.withTargetDOMRange(function(){var u;return(u=this.responder)===null||u===void 0?void 0:u.insertHTML(e.html)}),this.afterRender=()=>{var u;return(u=this.delegate)===null||u===void 0?void 0:u.inputControllerDidPaste(e)}}else if(dk(i)){var s;e.type="text/plain",e.string=i.getData("text/plain"),(s=this.delegate)===null||s===void 0||s.inputControllerWillPaste(e),this.withTargetDOMRange(function(){var a;return(a=this.responder)===null||a===void 0?void 0:a.insertString(e.string)}),this.afterRender=()=>{var a;return(a=this.delegate)===null||a===void 0?void 0:a.inputControllerDidPaste(e)}}else if(nD(this.event)){var o;e.type="File",e.file=i.files[0],(o=this.delegate)===null||o===void 0||o.inputControllerWillPaste(e),this.withTargetDOMRange(function(){var a;return(a=this.responder)===null||a===void 0?void 0:a.insertFile(e.file)}),this.afterRender=()=>{var a;return(a=this.delegate)===null||a===void 0?void 0:a.inputControllerDidPaste(e)}}else if(n){var l;this.event.preventDefault(),e.type="text/html",e.html=n,(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(e),this.withTargetDOMRange(function(){var a;return(a=this.responder)===null||a===void 0?void 0:a.insertHTML(e.html)}),this.afterRender=()=>{var a;return(a=this.delegate)===null||a===void 0?void 0:a.inputControllerDidPaste(e)}}},insertFromYank(){return this.insertString(this.event.data)},insertLineBreak(){return this.insertString(` -`)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var i;return(i=this.delegate)===null||i===void 0||i.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.insertLineBreak()})},insertReplacementText(){const i=this.event.dataTransfer.getData("text/plain"),e=this.event.getTargetRanges()[0];this.withTargetDOMRange(e,()=>{this.insertString(i,{updatePosition:!1})})},insertText(){var i;return this.insertString(this.event.data||((i=this.event.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});const tD=function(i){const e=document.createRange();return e.setStart(i.startContainer,i.startOffset),e.setEnd(i.endContainer,i.endOffset),e},wf=i=>{var e;return Array.from(((e=i.dataTransfer)===null||e===void 0?void 0:e.types)||[]).includes("Files")},nD=i=>{var e;return((e=i.dataTransfer.files)===null||e===void 0?void 0:e[0])&&!jk(i)&&!(t=>{let{dataTransfer:n}=t;return n.types.includes("Files")&&n.types.includes("text/html")&&n.getData("text/html").includes("urn:schemas-microsoft-com:office:office")})(i)},jk=function(i){const e=i.clipboardData;if(e)return Array.from(e.types).filter(t=>t.match(/file/i)).length===e.types.length&&e.files.length>=1},iD=function(i){const e=i.clipboardData;if(e)return e.types.includes("text/plain")&&e.types.length===1},rD=function(i){const e=[];return i.altKey&&e.push("alt"),i.shiftKey&&e.push("shift"),e.push(i.key),e},yf=i=>({x:i.clientX,y:i.clientY}),Dd="[data-trix-attribute]",$d="[data-trix-action]",sD="".concat(Dd,", ").concat($d),uh="[data-trix-dialog]",oD="".concat(uh,"[data-trix-active]"),lD="".concat(uh," [data-trix-method]"),S0="".concat(uh," [data-trix-input]"),_0=(i,e)=>(e||(e=Ks(i)),i.querySelector("[data-trix-input][name='".concat(e,"']"))),C0=i=>i.getAttribute("data-trix-action"),Ks=i=>i.getAttribute("data-trix-attribute")||i.getAttribute("data-trix-dialog-attribute");class qk extends Kt{constructor(e){super(e),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=e,this.attributes={},this.actions={},this.resetDialogInputs(),Zt("mousedown",{onElement:this.element,matchingSelector:$d,withCallback:this.didClickActionButton}),Zt("mousedown",{onElement:this.element,matchingSelector:Dd,withCallback:this.didClickAttributeButton}),Zt("click",{onElement:this.element,matchingSelector:sD,preventDefault:!0}),Zt("click",{onElement:this.element,matchingSelector:lD,withCallback:this.didClickDialogButton}),Zt("keydown",{onElement:this.element,matchingSelector:S0,withCallback:this.didKeyDownDialogInput})}didClickActionButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();const r=C0(t);return this.getDialog(r)?this.toggleDialog(r):(s=this.delegate)===null||s===void 0?void 0:s.toolbarDidInvokeAction(r,t);var s}didClickAttributeButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();const r=Ks(t);var s;return this.getDialog(r)?this.toggleDialog(r):(s=this.delegate)===null||s===void 0||s.toolbarDidToggleAttribute(r),this.refreshAttributeButtons()}didClickDialogButton(e,t){const n=zr(t,{matchingSelector:uh});return this[t.getAttribute("data-trix-method")].call(this,n)}didKeyDownDialogInput(e,t){if(e.keyCode===13){e.preventDefault();const n=t.getAttribute("name"),r=this.getDialog(n);this.setAttribute(r)}if(e.keyCode===27)return e.preventDefault(),this.hideDialog()}updateActions(e){return this.actions=e,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((e,t)=>{e.disabled=this.actions[t]===!1})}eachActionButton(e){return Array.from(this.element.querySelectorAll($d)).map(t=>e(t,C0(t)))}updateAttributes(e){return this.attributes=e,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((e,t)=>(e.disabled=this.attributes[t]===!1,this.attributes[t]||this.dialogIsVisible(t)?(e.setAttribute("data-trix-active",""),e.classList.add("trix-active")):(e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"))))}eachAttributeButton(e){return Array.from(this.element.querySelectorAll(Dd)).map(t=>e(t,Ks(t)))}applyKeyboardCommand(e){const t=JSON.stringify(e.sort());for(const n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){const r=n.getAttribute("data-trix-key").split("+");if(JSON.stringify(r.sort())===t)return Ll("mousedown",{onElement:n}),!0}return!1}dialogIsVisible(e){const t=this.getDialog(e);if(t)return t.hasAttribute("data-trix-active")}toggleDialog(e){return this.dialogIsVisible(e)?this.hideDialog():this.showDialog(e)}showDialog(e){var t,n;this.hideDialog(),(t=this.delegate)===null||t===void 0||t.toolbarWillShowDialog();const r=this.getDialog(e);r.setAttribute("data-trix-active",""),r.classList.add("trix-active"),Array.from(r.querySelectorAll("input[disabled]")).forEach(o=>{o.removeAttribute("disabled")});const s=Ks(r);if(s){const o=_0(r,e);o&&(o.value=this.attributes[s]||"",o.select())}return(n=this.delegate)===null||n===void 0?void 0:n.toolbarDidShowDialog(e)}setAttribute(e){var t;const n=Ks(e),r=_0(e,n);return!r.willValidate||(r.setCustomValidity(""),r.checkValidity()&&this.isSafeAttribute(r))?((t=this.delegate)===null||t===void 0||t.toolbarDidUpdateAttribute(n,r.value),this.hideDialog()):(r.setCustomValidity("Invalid value"),r.setAttribute("data-trix-validate",""),r.classList.add("trix-validate"),r.focus())}isSafeAttribute(e){return!e.hasAttribute("data-trix-validate-href")||Po.isValidAttribute("a","href",e.value)}removeAttribute(e){var t;const n=Ks(e);return(t=this.delegate)===null||t===void 0||t.toolbarDidRemoveAttribute(n),this.hideDialog()}hideDialog(){const e=this.element.querySelector(oD);var t;if(e)return e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"),this.resetDialogInputs(),(t=this.delegate)===null||t===void 0?void 0:t.toolbarDidHideDialog((n=>n.getAttribute("data-trix-dialog"))(e))}resetDialogInputs(){Array.from(this.element.querySelectorAll(S0)).forEach(e=>{e.setAttribute("disabled","disabled"),e.removeAttribute("data-trix-validate"),e.classList.remove("trix-validate")})}getDialog(e){return this.element.querySelector("[data-trix-dialog=".concat(e,"]"))}}class Xl extends Fk{constructor(e){let{editorElement:t,document:n,html:r}=e;super(...arguments),this.editorElement=t,this.selectionManager=new gs(this.editorElement),this.selectionManager.delegate=this,this.composition=new Tr,this.composition.delegate=this,this.attachmentManager=new Ek(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=Jm.getLevel()===2?new Wl(this.editorElement):new ir(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new Xk(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new qk(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new Lk(this.composition,this.selectionManager,this.editorElement),n?this.editor.loadDocument(n):this.editor.loadHTML(r)}registerSelectionManager(){return Ts.registerSelectionManager(this.selectionManager)}unregisterSelectionManager(){return Ts.unregisterSelectionManager(this.selectionManager)}render(){return this.compositionController.render()}reparse(){return this.composition.replaceHTML(this.editorElement.innerHTML)}compositionDidChangeDocument(e){if(this.notifyEditorElement("document-change"),!this.handlingInput)return this.render()}compositionDidChangeCurrentAttributes(e){return this.currentAttributes=e,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})}compositionDidPerformInsertionAtRange(e){this.pasting&&(this.pastedRange=e)}compositionShouldAcceptFile(e){return this.notifyEditorElement("file-accept",{file:e})}compositionDidAddAttachment(e){const t=this.attachmentManager.manageAttachment(e);return this.notifyEditorElement("attachment-add",{attachment:t})}compositionDidEditAttachment(e){this.compositionController.rerenderViewForObject(e);const t=this.attachmentManager.manageAttachment(e);return this.notifyEditorElement("attachment-edit",{attachment:t}),this.notifyEditorElement("change")}compositionDidChangeAttachmentPreviewURL(e){return this.compositionController.invalidateViewForObject(e),this.notifyEditorElement("change")}compositionDidRemoveAttachment(e){const t=this.attachmentManager.unmanageAttachment(e);return this.notifyEditorElement("attachment-remove",{attachment:t})}compositionDidStartEditingAttachment(e,t){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(e),this.compositionController.installAttachmentEditorForAttachment(e,t),this.selectionManager.setLocationRange(this.attachmentLocationRange)}compositionDidStopEditingAttachment(e){this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null}compositionDidRequestChangingSelectionToLocationRange(e){if(!this.loadingSnapshot||this.isFocused())return this.requestedLocationRange=e,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()}compositionWillLoadSnapshot(){this.loadingSnapshot=!0}compositionDidLoadSnapshot(){this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1}getSelectionManager(){return this.selectionManager}attachmentManagerDidRequestRemovalOfAttachment(e){return this.removeAttachment(e)}compositionControllerWillSyncDocumentView(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()}compositionControllerDidSyncDocumentView(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")}compositionControllerDidRender(){this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision}compositionControllerDidFocus(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")}compositionControllerDidBlur(){return this.notifyEditorElement("blur")}compositionControllerDidSelectAttachment(e,t){return this.toolbarController.hideDialog(),this.composition.editAttachment(e,t)}compositionControllerDidRequestDeselectingAttachment(e){const t=this.attachmentLocationRange||this.composition.document.getLocationRangeOfAttachment(e);return this.selectionManager.setLocationRange(t[1])}compositionControllerWillUpdateAttachment(e){return this.editor.recordUndoEntry("Edit Attachment",{context:e.id,consolidatable:!0})}compositionControllerDidRequestRemovalOfAttachment(e){return this.removeAttachment(e)}inputControllerWillHandleInput(){this.handlingInput=!0,this.requestedRender=!1}inputControllerDidRequestRender(){this.requestedRender=!0}inputControllerDidHandleInput(){if(this.handlingInput=!1,this.requestedRender)return this.requestedRender=!1,this.render()}inputControllerDidAllowUnhandledInput(){return this.notifyEditorElement("change")}inputControllerDidRequestReparse(){return this.reparse()}inputControllerWillPerformTyping(){return this.recordTypingUndoEntry()}inputControllerWillPerformFormatting(e){return this.recordFormattingUndoEntry(e)}inputControllerWillCutText(){return this.editor.recordUndoEntry("Cut")}inputControllerWillPaste(e){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:e})}inputControllerDidPaste(e){return e.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:e})}inputControllerWillMoveText(){return this.editor.recordUndoEntry("Move")}inputControllerWillAttachFiles(){return this.editor.recordUndoEntry("Drop Files")}inputControllerWillPerformUndo(){return this.editor.undo()}inputControllerWillPerformRedo(){return this.editor.redo()}inputControllerDidReceiveKeyboardCommand(e){return this.toolbarController.applyKeyboardCommand(e)}inputControllerDidStartDrag(){this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()}inputControllerDidReceiveDragOverPoint(e){return this.selectionManager.setLocationRangeFromPointRange(e)}inputControllerDidCancelDrag(){this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null}locationRangeDidChange(e){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!wu(this.attachmentLocationRange,e)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")}toolbarDidClickButton(){if(!this.getLocationRange())return this.setLocationRange({index:0,offset:0})}toolbarDidInvokeAction(e,t){return this.invokeAction(e,t)}toolbarDidToggleAttribute(e){if(this.recordFormattingUndoEntry(e),this.composition.toggleCurrentAttribute(e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidUpdateAttribute(e,t){if(this.recordFormattingUndoEntry(e),this.composition.setCurrentAttribute(e,t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidRemoveAttribute(e){if(this.recordFormattingUndoEntry(e),this.composition.removeCurrentAttribute(e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarWillShowDialog(e){return this.composition.expandSelectionForEditing(),this.freezeSelection()}toolbarDidShowDialog(e){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:e})}toolbarDidHideDialog(e){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:e})}freezeSelection(){if(!this.selectionFrozen)return this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render()}thawSelection(){if(this.selectionFrozen)return this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()}canInvokeAction(e){return!!this.actionIsExternal(e)||!((t=this.actions[e])===null||t===void 0||(t=t.test)===null||t===void 0||!t.call(this));var t}invokeAction(e,t){return this.actionIsExternal(e)?this.notifyEditorElement("action-invoke",{actionName:e,invokingElement:t}):(n=this.actions[e])===null||n===void 0||(n=n.perform)===null||n===void 0?void 0:n.call(this);var n}actionIsExternal(e){return/^x-./.test(e)}getCurrentActions(){const e={};for(const t in this.actions)e[t]=this.canInvokeAction(t);return e}updateCurrentActions(){const e=this.getCurrentActions();if(!Xo(e,this.currentActions))return this.currentActions=e,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions})}runEditorFilters(){let e=this.composition.getSnapshot();if(Array.from(this.editor.filters).forEach(r=>{const{document:s,selectedRange:o}=e;e=r.call(this.editor,e)||{},e.document||(e.document=s),e.selectedRange||(e.selectedRange=o)}),t=e,n=this.composition.getSnapshot(),!wu(t.selectedRange,n.selectedRange)||!t.document.isEqualTo(n.document))return this.composition.loadSnapshot(e);var t,n}updateInputElement(){const e=function(t,n){const r=L4[n];if(r)return r(t);throw new Error("unknown content type: ".concat(n))}(this.compositionController.getSerializableElement(),"text/html");return this.editorElement.setFormValue(e)}notifyEditorElement(e,t){switch(e){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(e,t)}removeAttachment(e){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(e),this.render()}recordFormattingUndoEntry(e){const t=zt(e),n=this.selectionManager.getLocationRange();if(t||!or(n))return this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})}recordTypingUndoEntry(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})}getUndoContext(){for(var e=arguments.length,t=new Array(e),n=0;n0?Math.floor(new Date().getTime()/Sd.interval):0}isFocused(){var e;return this.editorElement===((e=this.editorElement.ownerDocument)===null||e===void 0?void 0:e.activeElement)}isFocusedInvisibly(){return this.isFocused()&&!this.getLocationRange()}get actions(){return this.constructor.actions}}gn(Xl,"actions",{undo:{test(){return this.editor.canUndo()},perform(){return this.editor.undo()}},redo:{test(){return this.editor.canRedo()},perform(){return this.editor.redo()}},link:{test(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test(){return this.editor.canIncreaseNestingLevel()},perform(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test(){return this.editor.canDecreaseNestingLevel()},perform(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:()=>!0,perform(){return Jm.pickFiles(this.editor.insertFiles)}}}),Xl.proxyMethod("getSelectionManager().setLocationRange"),Xl.proxyMethod("getSelectionManager().getLocationRange");var aD=Object.freeze({__proto__:null,AttachmentEditorController:Wk,CompositionController:Xk,Controller:Fk,EditorController:Xl,InputController:ch,Level0InputController:ir,Level2InputController:Wl,ToolbarController:qk}),cD=Object.freeze({__proto__:null,MutationObserver:zk,SelectionChangeObserver:gk}),uD=Object.freeze({__proto__:null,FileVerificationOperation:Vk,ImagePreloadOperation:Tk});fk("trix-toolbar",`%t { +`),this.requestRender(),i.preventDefault()},tab(i){var e,t;(e=this.responder)!==null&&e!==void 0&&e.canDecreaseNestingLevel()&&((t=this.responder)===null||t===void 0||t.decreaseNestingLevel(),this.requestRender(),i.preventDefault())},left(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("backward")},right(i){if(this.selectionIsInCursorTarget())return i.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(i){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}},meta:{backspace(i){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}}}),ir.proxyMethod("responder?.getSelectedRange"),ir.proxyMethod("responder?.setSelectedRange"),ir.proxyMethod("responder?.expandSelectionInDirection"),ir.proxyMethod("responder?.selectionIsInCursorTarget"),ir.proxyMethod("responder?.selectionIsExpanded");const X4=i=>{var e;return(e=i.type)===null||e===void 0||(e=e.match(/\/(\w+)$/))===null||e===void 0?void 0:e[1]},F4=!((vf=" ".codePointAt)===null||vf===void 0||!vf.call(" ",0)),Y4=function(i){if(i.key&&F4&&i.key.codePointAt(0)===i.keyCode)return i.key;{let e;if(i.which===null?e=i.keyCode:i.which!==0&&i.charCode!==0&&(e=i.charCode),e!=null&&Zk[e]!=="escape")return sa.fromCodepoints([e]).toString()}},z4=function(i){const e=i.clipboardData;if(e){if(e.types.includes("text/html")){for(const t of e.types){const n=/^CorePasteboardFlavorType/.test(t),r=/^dyn\./.test(t)&&e.getData(t);if(n||r)return!0}return!1}{const t=e.types.includes("com.apple.webarchive"),n=e.types.includes("com.apple.flat-rtfd");return t||n}}};class Ar extends Kt{constructor(e){super(...arguments),this.inputController=e,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(e){if(this.data.start=e,this.isSignificant()){var t,n;this.inputSummary.eventName==="keypress"&&this.inputSummary.textAdded&&((n=this.responder)===null||n===void 0||n.deleteInDirection("left")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(t=this.responder)===null||t===void 0?void 0:t.getSelectedRange()}}update(e){if(this.data.update=e,this.isSignificant()){const t=this.selectPlaceholder();t&&(this.forgetPlaceholder(),this.range=t)}}end(e){return this.data.end=e,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.setSelectedRange(this.range),(r=this.responder)===null||r===void 0||r.insertString(this.data.end),(s=this.responder)===null||s===void 0?void 0:s.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var t,n,r,s}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!B4.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var e,t;return((e=this.data.start)===null||e===void 0?void 0:e.length)===0&&((t=this.data.end)===null||t===void 0?void 0:t.length)>0&&this.range}}Ar.proxyMethod("inputController.setInputSummary"),Ar.proxyMethod("inputController.requestRender"),Ar.proxyMethod("inputController.requestReparse"),Ar.proxyMethod("responder?.selectionIsExpanded"),Ar.proxyMethod("responder?.insertPlaceholder"),Ar.proxyMethod("responder?.selectPlaceholder"),Ar.proxyMethod("responder?.forgetPlaceholder");class Xl extends ch{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidAllowUnhandledInput)===null||t===void 0?void 0:t.call(e):void 0:this.reparse();var e,t}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var e,t;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(t=this.delegate)===null||t===void 0||t.render(),(e=this.afterRender)===null||e===void 0||e.call(this),this.afterRender=null}reparse(){var e;return(e=this.delegate)===null||e===void 0?void 0:e.reparse()}insertString(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.insertString(t,n)})}toggleAttributeIfSupported(e){var t;if(Pd().includes(e))return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformFormatting(e),this.withTargetDOMRange(function(){var n;return(n=this.responder)===null||n===void 0?void 0:n.toggleCurrentAttribute(e)})}activateAttributeIfSupported(e,t){var n;if(Pd().includes(e))return(n=this.delegate)===null||n===void 0||n.inputControllerWillPerformFormatting(e),this.withTargetDOMRange(function(){var r;return(r=this.responder)===null||r===void 0?void 0:r.setCurrentAttribute(e,t)})}deleteInDirection(e){let{recordUndoEntry:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{recordUndoEntry:!0};var n;t&&((n=this.delegate)===null||n===void 0||n.inputControllerWillPerformTyping());const r=()=>{var o;return(o=this.responder)===null||o===void 0?void 0:o.deleteInDirection(e)},s=this.getTargetDOMRange({minLength:this.composing?1:2});return s?this.withTargetDOMRange(s,r):r()}withTargetDOMRange(e,t){var n;return typeof e=="function"&&(t=e,e=this.getTargetDOMRange()),e?(n=this.responder)===null||n===void 0?void 0:n.withTargetDOMRange(e,t.bind(this)):(Qs.reset(),t.call(this))}getTargetDOMRange(){var e,t;let{minLength:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{minLength:0};const r=(e=(t=this.event).getTargetRanges)===null||e===void 0?void 0:e.call(t);if(r&&r.length){const s=V4(r[0]);if(n===0||s.toString().length>=n)return s}}withEvent(e,t){let n;this.event=e;try{n=t.call(this)}finally{this.event=null}return n}}gn(Xl,"events",{keydown(i){if(ok(i)){var e;const t=q4(i);(e=this.delegate)!==null&&e!==void 0&&e.inputControllerDidReceiveKeyboardCommand(t)&&i.preventDefault()}else{let t=i.key;i.altKey&&(t+="+Alt"),i.shiftKey&&(t+="+Shift");const n=this.constructor.keys[t];if(n)return this.withEvent(i,n)}},paste(i){var e;let t;const n=(e=i.clipboardData)===null||e===void 0?void 0:e.getData("URL");return Bk(i)?(i.preventDefault(),this.attachFiles(i.clipboardData.files)):j4(i)?(i.preventDefault(),t={type:"text/plain",string:i.clipboardData.getData("text/plain")},(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(t),(s=this.responder)===null||s===void 0||s.insertString(t.string),this.render(),(o=this.delegate)===null||o===void 0?void 0:o.inputControllerDidPaste(t)):n?(i.preventDefault(),t={type:"text/html",html:this.createLinkHTML(n)},(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(t),(a=this.responder)===null||a===void 0||a.insertHTML(t.html),this.render(),(c=this.delegate)===null||c===void 0?void 0:c.inputControllerDidPaste(t)):void 0;var r,s,o,l,a,c},beforeinput(i){const e=this.constructor.inputTypes[i.inputType],t=(n=i,!(!/iPhone|iPad/.test(navigator.userAgent)||n.inputType&&n.inputType!=="insertParagraph"));var n;e&&(this.withEvent(i,e),t||this.scheduleRender()),t&&this.render()},input(i){Qs.reset()},dragstart(i){var e,t;(e=this.responder)!==null&&e!==void 0&&e.selectionContainsAttachments()&&(i.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:(t=this.responder)===null||t===void 0?void 0:t.getSelectedRange(),point:yf(i)})},dragenter(i){wf(i)&&i.preventDefault()},dragover(i){if(this.dragging){i.preventDefault();const t=yf(i);var e;if(!Fo(t,this.dragging.point))return this.dragging.point=t,(e=this.responder)===null||e===void 0?void 0:e.setLocationRangeFromPointRange(t)}else wf(i)&&i.preventDefault()},drop(i){var e,t;if(this.dragging)return i.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillMoveText(),(t=this.responder)===null||t===void 0||t.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender();if(wf(i)){var n;i.preventDefault();const r=yf(i);return(n=this.responder)===null||n===void 0||n.setLocationRangeFromPointRange(r),this.attachFiles(i.dataTransfer.files)}},dragend(){var i;this.dragging&&((i=this.responder)===null||i===void 0||i.setSelectedRange(this.dragging.range),this.dragging=null)},compositionend(i){this.composing&&(this.composing=!1,Da.recentAndroid||this.scheduleRender())}}),gn(Xl,"keys",{ArrowLeft(){var i,e;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("backward"))return this.event.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("backward")},ArrowRight(){var i,e;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageMovingCursorInDirection("forward"))return this.event.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("forward")},Backspace(){var i,e,t;if((i=this.responder)!==null&&i!==void 0&&i.shouldManageDeletingInDirection("backward"))return this.event.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.deleteInDirection("backward"),this.render()},Tab(){var i,e;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.event.preventDefault(),(e=this.responder)===null||e===void 0||e.increaseNestingLevel(),this.render()},"Tab+Shift"(){var i,e;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.event.preventDefault(),(e=this.responder)===null||e===void 0||e.decreaseNestingLevel(),this.render()}}),gn(Xl,"inputTypes",{deleteByComposition(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut(){return this.deleteInDirection("backward")},deleteByDrag(){return this.event.preventDefault(),this.withTargetDOMRange(function(){var i;this.deleteByDragRange=(i=this.responder)===null||i===void 0?void 0:i.getSelectedRange()})},deleteCompositionText(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent(){return this.deleteInDirection("backward")},deleteContentBackward(){return this.deleteInDirection("backward")},deleteContentForward(){return this.deleteInDirection("forward")},deleteEntireSoftLine(){return this.deleteInDirection("forward")},deleteHardLineBackward(){return this.deleteInDirection("backward")},deleteHardLineForward(){return this.deleteInDirection("forward")},deleteSoftLineBackward(){return this.deleteInDirection("backward")},deleteSoftLineForward(){return this.deleteInDirection("forward")},deleteWordBackward(){return this.deleteInDirection("backward")},deleteWordForward(){return this.deleteInDirection("forward")},formatBackColor(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold(){return this.toggleAttributeIfSupported("bold")},formatFontColor(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canIncreaseNestingLevel())return this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.increaseNestingLevel()})},formatItalic(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent(){var i;if((i=this.responder)!==null&&i!==void 0&&i.canDecreaseNestingLevel())return this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.decreaseNestingLevel()})},formatRemove(){this.withTargetDOMRange(function(){for(const t in(i=this.responder)===null||i===void 0?void 0:i.getCurrentAttributes()){var i,e;(e=this.responder)===null||e===void 0||e.removeCurrentAttribute(t)}})},formatSetBlockTextDirection(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough(){return this.toggleAttributeIfSupported("strike")},formatSubscript(){return this.toggleAttributeIfSupported("sub")},formatSuperscript(){return this.toggleAttributeIfSupported("sup")},formatUnderline(){return this.toggleAttributeIfSupported("underline")},historyRedo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformRedo()},historyUndo(){var i;return(i=this.delegate)===null||i===void 0?void 0:i.inputControllerWillPerformUndo()},insertCompositionText(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop(){const i=this.deleteByDragRange;var e;if(i)return this.deleteByDragRange=null,(e=this.delegate)===null||e===void 0||e.inputControllerWillMoveText(),this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.moveTextFromRange(i)})},insertFromPaste(){const{dataTransfer:i}=this.event,e={dataTransfer:i},t=i.getData("URL"),n=i.getData("text/html");if(t){var r;let a;this.event.preventDefault(),e.type="text/html";const c=i.getData("public.url-name");a=c?tp(c).trim():t,e.html=this.createLinkHTML(t,a),(r=this.delegate)===null||r===void 0||r.inputControllerWillPaste(e),this.withTargetDOMRange(function(){var u;return(u=this.responder)===null||u===void 0?void 0:u.insertHTML(e.html)}),this.afterRender=()=>{var u;return(u=this.delegate)===null||u===void 0?void 0:u.inputControllerDidPaste(e)}}else if(sk(i)){var s;e.type="text/plain",e.string=i.getData("text/plain"),(s=this.delegate)===null||s===void 0||s.inputControllerWillPaste(e),this.withTargetDOMRange(function(){var a;return(a=this.responder)===null||a===void 0?void 0:a.insertString(e.string)}),this.afterRender=()=>{var a;return(a=this.delegate)===null||a===void 0?void 0:a.inputControllerDidPaste(e)}}else if(U4(this.event)){var o;e.type="File",e.file=i.files[0],(o=this.delegate)===null||o===void 0||o.inputControllerWillPaste(e),this.withTargetDOMRange(function(){var a;return(a=this.responder)===null||a===void 0?void 0:a.insertFile(e.file)}),this.afterRender=()=>{var a;return(a=this.delegate)===null||a===void 0?void 0:a.inputControllerDidPaste(e)}}else if(n){var l;this.event.preventDefault(),e.type="text/html",e.html=n,(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(e),this.withTargetDOMRange(function(){var a;return(a=this.responder)===null||a===void 0?void 0:a.insertHTML(e.html)}),this.afterRender=()=>{var a;return(a=this.delegate)===null||a===void 0?void 0:a.inputControllerDidPaste(e)}}},insertFromYank(){return this.insertString(this.event.data)},insertLineBreak(){return this.insertString(` +`)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var i;return(i=this.delegate)===null||i===void 0||i.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.insertLineBreak()})},insertReplacementText(){const i=this.event.dataTransfer.getData("text/plain"),e=this.event.getTargetRanges()[0];this.withTargetDOMRange(e,()=>{this.insertString(i,{updatePosition:!1})})},insertText(){var i;return this.insertString(this.event.data||((i=this.event.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});const V4=function(i){const e=document.createRange();return e.setStart(i.startContainer,i.startOffset),e.setEnd(i.endContainer,i.endOffset),e},wf=i=>{var e;return Array.from(((e=i.dataTransfer)===null||e===void 0?void 0:e.types)||[]).includes("Files")},U4=i=>{var e;return((e=i.dataTransfer.files)===null||e===void 0?void 0:e[0])&&!Bk(i)&&!(t=>{let{dataTransfer:n}=t;return n.types.includes("Files")&&n.types.includes("text/html")&&n.getData("text/html").includes("urn:schemas-microsoft-com:office:office")})(i)},Bk=function(i){const e=i.clipboardData;if(e)return Array.from(e.types).filter(t=>t.match(/file/i)).length===e.types.length&&e.files.length>=1},j4=function(i){const e=i.clipboardData;if(e)return e.types.includes("text/plain")&&e.types.length===1},q4=function(i){const e=[];return i.altKey&&e.push("alt"),i.shiftKey&&e.push("shift"),e.push(i.key),e},yf=i=>({x:i.clientX,y:i.clientY}),Dd="[data-trix-attribute]",$d="[data-trix-action]",G4="".concat(Dd,", ").concat($d),uh="[data-trix-dialog]",H4="".concat(uh,"[data-trix-active]"),K4="".concat(uh," [data-trix-method]"),m0="".concat(uh," [data-trix-input]"),p0=(i,e)=>(e||(e=Js(i)),i.querySelector("[data-trix-input][name='".concat(e,"']"))),g0=i=>i.getAttribute("data-trix-action"),Js=i=>i.getAttribute("data-trix-attribute")||i.getAttribute("data-trix-dialog-attribute");class Wk extends Kt{constructor(e){super(e),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=e,this.attributes={},this.actions={},this.resetDialogInputs(),Zt("mousedown",{onElement:this.element,matchingSelector:$d,withCallback:this.didClickActionButton}),Zt("mousedown",{onElement:this.element,matchingSelector:Dd,withCallback:this.didClickAttributeButton}),Zt("click",{onElement:this.element,matchingSelector:G4,preventDefault:!0}),Zt("click",{onElement:this.element,matchingSelector:K4,withCallback:this.didClickDialogButton}),Zt("keydown",{onElement:this.element,matchingSelector:m0,withCallback:this.didKeyDownDialogInput})}didClickActionButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();const r=g0(t);return this.getDialog(r)?this.toggleDialog(r):(s=this.delegate)===null||s===void 0?void 0:s.toolbarDidInvokeAction(r,t);var s}didClickAttributeButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();const r=Js(t);var s;return this.getDialog(r)?this.toggleDialog(r):(s=this.delegate)===null||s===void 0||s.toolbarDidToggleAttribute(r),this.refreshAttributeButtons()}didClickDialogButton(e,t){const n=Yr(t,{matchingSelector:uh});return this[t.getAttribute("data-trix-method")].call(this,n)}didKeyDownDialogInput(e,t){if(e.keyCode===13){e.preventDefault();const n=t.getAttribute("name"),r=this.getDialog(n);this.setAttribute(r)}if(e.keyCode===27)return e.preventDefault(),this.hideDialog()}updateActions(e){return this.actions=e,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((e,t)=>{e.disabled=this.actions[t]===!1})}eachActionButton(e){return Array.from(this.element.querySelectorAll($d)).map(t=>e(t,g0(t)))}updateAttributes(e){return this.attributes=e,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((e,t)=>(e.disabled=this.attributes[t]===!1,this.attributes[t]||this.dialogIsVisible(t)?(e.setAttribute("data-trix-active",""),e.classList.add("trix-active")):(e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"))))}eachAttributeButton(e){return Array.from(this.element.querySelectorAll(Dd)).map(t=>e(t,Js(t)))}applyKeyboardCommand(e){const t=JSON.stringify(e.sort());for(const n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){const r=n.getAttribute("data-trix-key").split("+");if(JSON.stringify(r.sort())===t)return Il("mousedown",{onElement:n}),!0}return!1}dialogIsVisible(e){const t=this.getDialog(e);if(t)return t.hasAttribute("data-trix-active")}toggleDialog(e){return this.dialogIsVisible(e)?this.hideDialog():this.showDialog(e)}showDialog(e){var t,n;this.hideDialog(),(t=this.delegate)===null||t===void 0||t.toolbarWillShowDialog();const r=this.getDialog(e);r.setAttribute("data-trix-active",""),r.classList.add("trix-active"),Array.from(r.querySelectorAll("input[disabled]")).forEach(o=>{o.removeAttribute("disabled")});const s=Js(r);if(s){const o=p0(r,e);o&&(o.value=this.attributes[s]||"",o.select())}return(n=this.delegate)===null||n===void 0?void 0:n.toolbarDidShowDialog(e)}setAttribute(e){var t;const n=Js(e),r=p0(e,n);return!r.willValidate||(r.setCustomValidity(""),r.checkValidity()&&this.isSafeAttribute(r))?((t=this.delegate)===null||t===void 0||t.toolbarDidUpdateAttribute(n,r.value),this.hideDialog()):(r.setCustomValidity("Invalid value"),r.setAttribute("data-trix-validate",""),r.classList.add("trix-validate"),r.focus())}isSafeAttribute(e){return!e.hasAttribute("data-trix-validate-href")||Ao.isValidAttribute("a","href",e.value)}removeAttribute(e){var t;const n=Js(e);return(t=this.delegate)===null||t===void 0||t.toolbarDidRemoveAttribute(n),this.hideDialog()}hideDialog(){const e=this.element.querySelector(H4);var t;if(e)return e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"),this.resetDialogInputs(),(t=this.delegate)===null||t===void 0?void 0:t.toolbarDidHideDialog((n=>n.getAttribute("data-trix-dialog"))(e))}resetDialogInputs(){Array.from(this.element.querySelectorAll(m0)).forEach(e=>{e.setAttribute("disabled","disabled"),e.removeAttribute("data-trix-validate"),e.classList.remove("trix-validate")})}getDialog(e){return this.element.querySelector("[data-trix-dialog=".concat(e,"]"))}}class Fl extends $k{constructor(e){let{editorElement:t,document:n,html:r}=e;super(...arguments),this.editorElement=t,this.selectionManager=new gs(this.editorElement),this.selectionManager.delegate=this,this.composition=new Tr,this.composition.delegate=this,this.attachmentManager=new _k(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=Hm.getLevel()===2?new Xl(this.editorElement):new ir(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new Dk(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new Wk(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new xk(this.composition,this.selectionManager,this.editorElement),n?this.editor.loadDocument(n):this.editor.loadHTML(r)}registerSelectionManager(){return Qs.registerSelectionManager(this.selectionManager)}unregisterSelectionManager(){return Qs.unregisterSelectionManager(this.selectionManager)}render(){return this.compositionController.render()}reparse(){return this.composition.replaceHTML(this.editorElement.innerHTML)}compositionDidChangeDocument(e){if(this.notifyEditorElement("document-change"),!this.handlingInput)return this.render()}compositionDidChangeCurrentAttributes(e){return this.currentAttributes=e,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})}compositionDidPerformInsertionAtRange(e){this.pasting&&(this.pastedRange=e)}compositionShouldAcceptFile(e){return this.notifyEditorElement("file-accept",{file:e})}compositionDidAddAttachment(e){const t=this.attachmentManager.manageAttachment(e);return this.notifyEditorElement("attachment-add",{attachment:t})}compositionDidEditAttachment(e){this.compositionController.rerenderViewForObject(e);const t=this.attachmentManager.manageAttachment(e);return this.notifyEditorElement("attachment-edit",{attachment:t}),this.notifyEditorElement("change")}compositionDidChangeAttachmentPreviewURL(e){return this.compositionController.invalidateViewForObject(e),this.notifyEditorElement("change")}compositionDidRemoveAttachment(e){const t=this.attachmentManager.unmanageAttachment(e);return this.notifyEditorElement("attachment-remove",{attachment:t})}compositionDidStartEditingAttachment(e,t){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(e),this.compositionController.installAttachmentEditorForAttachment(e,t),this.selectionManager.setLocationRange(this.attachmentLocationRange)}compositionDidStopEditingAttachment(e){this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null}compositionDidRequestChangingSelectionToLocationRange(e){if(!this.loadingSnapshot||this.isFocused())return this.requestedLocationRange=e,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()}compositionWillLoadSnapshot(){this.loadingSnapshot=!0}compositionDidLoadSnapshot(){this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1}getSelectionManager(){return this.selectionManager}attachmentManagerDidRequestRemovalOfAttachment(e){return this.removeAttachment(e)}compositionControllerWillSyncDocumentView(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()}compositionControllerDidSyncDocumentView(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")}compositionControllerDidRender(){this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision}compositionControllerDidFocus(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")}compositionControllerDidBlur(){return this.notifyEditorElement("blur")}compositionControllerDidSelectAttachment(e,t){return this.toolbarController.hideDialog(),this.composition.editAttachment(e,t)}compositionControllerDidRequestDeselectingAttachment(e){const t=this.attachmentLocationRange||this.composition.document.getLocationRangeOfAttachment(e);return this.selectionManager.setLocationRange(t[1])}compositionControllerWillUpdateAttachment(e){return this.editor.recordUndoEntry("Edit Attachment",{context:e.id,consolidatable:!0})}compositionControllerDidRequestRemovalOfAttachment(e){return this.removeAttachment(e)}inputControllerWillHandleInput(){this.handlingInput=!0,this.requestedRender=!1}inputControllerDidRequestRender(){this.requestedRender=!0}inputControllerDidHandleInput(){if(this.handlingInput=!1,this.requestedRender)return this.requestedRender=!1,this.render()}inputControllerDidAllowUnhandledInput(){return this.notifyEditorElement("change")}inputControllerDidRequestReparse(){return this.reparse()}inputControllerWillPerformTyping(){return this.recordTypingUndoEntry()}inputControllerWillPerformFormatting(e){return this.recordFormattingUndoEntry(e)}inputControllerWillCutText(){return this.editor.recordUndoEntry("Cut")}inputControllerWillPaste(e){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:e})}inputControllerDidPaste(e){return e.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:e})}inputControllerWillMoveText(){return this.editor.recordUndoEntry("Move")}inputControllerWillAttachFiles(){return this.editor.recordUndoEntry("Drop Files")}inputControllerWillPerformUndo(){return this.editor.undo()}inputControllerWillPerformRedo(){return this.editor.redo()}inputControllerDidReceiveKeyboardCommand(e){return this.toolbarController.applyKeyboardCommand(e)}inputControllerDidStartDrag(){this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()}inputControllerDidReceiveDragOverPoint(e){return this.selectionManager.setLocationRangeFromPointRange(e)}inputControllerDidCancelDrag(){this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null}locationRangeDidChange(e){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!wu(this.attachmentLocationRange,e)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")}toolbarDidClickButton(){if(!this.getLocationRange())return this.setLocationRange({index:0,offset:0})}toolbarDidInvokeAction(e,t){return this.invokeAction(e,t)}toolbarDidToggleAttribute(e){if(this.recordFormattingUndoEntry(e),this.composition.toggleCurrentAttribute(e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidUpdateAttribute(e,t){if(this.recordFormattingUndoEntry(e),this.composition.setCurrentAttribute(e,t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidRemoveAttribute(e){if(this.recordFormattingUndoEntry(e),this.composition.removeCurrentAttribute(e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarWillShowDialog(e){return this.composition.expandSelectionForEditing(),this.freezeSelection()}toolbarDidShowDialog(e){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:e})}toolbarDidHideDialog(e){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:e})}freezeSelection(){if(!this.selectionFrozen)return this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render()}thawSelection(){if(this.selectionFrozen)return this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()}canInvokeAction(e){return!!this.actionIsExternal(e)||!((t=this.actions[e])===null||t===void 0||(t=t.test)===null||t===void 0||!t.call(this));var t}invokeAction(e,t){return this.actionIsExternal(e)?this.notifyEditorElement("action-invoke",{actionName:e,invokingElement:t}):(n=this.actions[e])===null||n===void 0||(n=n.perform)===null||n===void 0?void 0:n.call(this);var n}actionIsExternal(e){return/^x-./.test(e)}getCurrentActions(){const e={};for(const t in this.actions)e[t]=this.canInvokeAction(t);return e}updateCurrentActions(){const e=this.getCurrentActions();if(!Fo(e,this.currentActions))return this.currentActions=e,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions})}runEditorFilters(){let e=this.composition.getSnapshot();if(Array.from(this.editor.filters).forEach(r=>{const{document:s,selectedRange:o}=e;e=r.call(this.editor,e)||{},e.document||(e.document=s),e.selectedRange||(e.selectedRange=o)}),t=e,n=this.composition.getSnapshot(),!wu(t.selectedRange,n.selectedRange)||!t.document.isEqualTo(n.document))return this.composition.loadSnapshot(e);var t,n}updateInputElement(){const e=function(t,n){const r=A4[n];if(r)return r(t);throw new Error("unknown content type: ".concat(n))}(this.compositionController.getSerializableElement(),"text/html");return this.editorElement.setFormValue(e)}notifyEditorElement(e,t){switch(e){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(e,t)}removeAttachment(e){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(e),this.render()}recordFormattingUndoEntry(e){const t=zt(e),n=this.selectionManager.getLocationRange();if(t||!or(n))return this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})}recordTypingUndoEntry(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})}getUndoContext(){for(var e=arguments.length,t=new Array(e),n=0;n0?Math.floor(new Date().getTime()/Sd.interval):0}isFocused(){var e;return this.editorElement===((e=this.editorElement.ownerDocument)===null||e===void 0?void 0:e.activeElement)}isFocusedInvisibly(){return this.isFocused()&&!this.getLocationRange()}get actions(){return this.constructor.actions}}gn(Fl,"actions",{undo:{test(){return this.editor.canUndo()},perform(){return this.editor.undo()}},redo:{test(){return this.editor.canRedo()},perform(){return this.editor.redo()}},link:{test(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test(){return this.editor.canIncreaseNestingLevel()},perform(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test(){return this.editor.canDecreaseNestingLevel()},perform(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:()=>!0,perform(){return Hm.pickFiles(this.editor.insertFiles)}}}),Fl.proxyMethod("getSelectionManager().setLocationRange"),Fl.proxyMethod("getSelectionManager().getLocationRange");var J4=Object.freeze({__proto__:null,AttachmentEditorController:Rk,CompositionController:Dk,Controller:$k,EditorController:Fl,InputController:ch,Level0InputController:ir,Level2InputController:Xl,ToolbarController:Wk}),eD=Object.freeze({__proto__:null,MutationObserver:Ik,SelectionChangeObserver:ak}),tD=Object.freeze({__proto__:null,FileVerificationOperation:Nk,ImagePreloadOperation:yk});rk("trix-toolbar",`%t { display: block; } @@ -124,7 +124,7 @@ var bP=Object.defineProperty;var vP=(i,e,t)=>e in i?bP(i,e,{enumerable:!0,config %t [data-trix-dialog] [data-trix-validate]:invalid { background-color: #ffdddd; -}`);class Gk extends HTMLElement{connectedCallback(){this.innerHTML===""&&(this.innerHTML=hk.getDefaultHTML())}get editorElements(){if(this.id){var e;const t=(e=this.ownerDocument)===null||e===void 0?void 0:e.querySelectorAll('trix-editor[toolbar="'.concat(this.id,'"]'));return Array.from(t)}return[]}get editorElement(){const[e]=this.editorElements;return e}}let hD=0;const fD=function(i){if(!i.hasAttribute("contenteditable"))return i.toggleAttribute("contenteditable",!i.disabled),function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.times=1,Zt(e,t)}("focus",{onElement:i,withCallback:()=>dD(i)})},dD=function(i){return mD(i),pD()},mD=function(i){var e,t;if((e=(t=document).queryCommandSupported)!==null&&e!==void 0&&e.call(t,"enableObjectResizing"))return document.execCommand("enableObjectResizing",!1,!1),Zt("mscontrolselect",{onElement:i,preventDefault:!0})},pD=function(i){var e,t;if((e=(t=document).queryCommandSupported)!==null&&e!==void 0&&e.call(t,"DefaultParagraphSeparator")){const{tagName:n}=Sn.default;if(["div","p"].includes(n))return document.execCommand("DefaultParagraphSeparator",!1,n)}},P0=Da.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"};fk("trix-editor",`%t { +}`);class Xk extends HTMLElement{connectedCallback(){this.innerHTML===""&&(this.innerHTML=ik.getDefaultHTML())}get editorElements(){if(this.id){var e;const t=(e=this.ownerDocument)===null||e===void 0?void 0:e.querySelectorAll('trix-editor[toolbar="'.concat(this.id,'"]'));return Array.from(t)}return[]}get editorElement(){const[e]=this.editorElements;return e}}let nD=0;const iD=function(i){if(!i.hasAttribute("contenteditable"))return i.toggleAttribute("contenteditable",!i.disabled),function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.times=1,Zt(e,t)}("focus",{onElement:i,withCallback:()=>rD(i)})},rD=function(i){return sD(i),oD()},sD=function(i){var e,t;if((e=(t=document).queryCommandSupported)!==null&&e!==void 0&&e.call(t,"enableObjectResizing"))return document.execCommand("enableObjectResizing",!1,!1),Zt("mscontrolselect",{onElement:i,preventDefault:!0})},oD=function(i){var e,t;if((e=(t=document).queryCommandSupported)!==null&&e!==void 0&&e.call(t,"DefaultParagraphSeparator")){const{tagName:n}=Sn.default;if(["div","p"].includes(n))return document.execCommand("DefaultParagraphSeparator",!1,n)}},O0=Da.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"};rk("trix-editor",`%t { display: block; } @@ -145,24 +145,24 @@ var bP=Object.defineProperty;var vP=(i,e,t)=>e in i?bP(i,e,{enumerable:!0,config height: auto; } -%t `.concat(Ss,` figcaption textarea { +%t `.concat(_s,` figcaption textarea { resize: none; } -%t `).concat(Ss,` figcaption textarea.trix-autoresize-clone { +%t `).concat(_s,` figcaption textarea.trix-autoresize-clone { position: absolute; left: -9999px; max-height: 0px; } -%t `).concat(Ss,` figcaption[data-trix-placeholder]:empty::before { +%t `).concat(_s,` figcaption[data-trix-placeholder]:empty::before { content: attr(data-trix-placeholder); color: graytext; } %t [data-trix-cursor-target] { - display: `).concat(P0.display,` !important; - width: `).concat(P0.width,` !important; + display: `).concat(O0.display,` !important; + width: `).concat(O0.width,` !important; padding: 0 !important; margin: 0 !important; border: none !important; @@ -176,23 +176,23 @@ var bP=Object.defineProperty;var vP=(i,e,t)=>e in i?bP(i,e,{enumerable:!0,config %t [data-trix-cursor-target=right] { vertical-align: bottom !important; margin-right: -1px !important; -}`));var yi=new WeakMap,ac=new WeakMap,al=new WeakSet;class gD{constructor(e){var t,n;xk(t=this,n=al),n.add(t),gn(this,"value",""),mo(this,yi,{writable:!0,value:void 0}),mo(this,ac,{writable:!0,value:void 0}),this.element=e,Bl(this,yi,e.attachInternals()),Bl(this,ac,!1)}connectedCallback(){lc(this,al,cc).call(this)}disconnectedCallback(){}get form(){return rt(this,yi).form}get name(){return this.element.getAttribute("name")}set name(e){this.element.setAttribute("name",e)}get labels(){return rt(this,yi).labels}get disabled(){return rt(this,ac)||this.element.hasAttribute("disabled")}set disabled(e){this.element.toggleAttribute("disabled",e)}get required(){return this.element.hasAttribute("required")}set required(e){this.element.toggleAttribute("required",e),lc(this,al,cc).call(this)}get validity(){return rt(this,yi).validity}get validationMessage(){return rt(this,yi).validationMessage}get willValidate(){return rt(this,yi).willValidate}formDisabledCallback(e){Bl(this,ac,e)}setFormValue(e){this.value=e,lc(this,al,cc).call(this),rt(this,yi).setFormValue(this.element.disabled?void 0:this.value)}checkValidity(){return rt(this,yi).checkValidity()}reportValidity(){return rt(this,yi).reportValidity()}setCustomValidity(e){lc(this,al,cc).call(this,e)}}function cc(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{required:e,value:t}=this.element,n=e&&!t,r=!!i,s=Ge("input",{required:e}),o=i||s.validationMessage;rt(this,yi).setValidity({valueMissing:n,customError:r},o)}var kf=new WeakMap,Sf=new WeakMap,_f=new WeakMap;class OD{constructor(e){mo(this,kf,{writable:!0,value:void 0}),mo(this,Sf,{writable:!0,value:t=>{t.defaultPrevented||t.target===this.element.form&&this.element.reset()}}),mo(this,_f,{writable:!0,value:t=>{if(t.defaultPrevented||this.element.contains(t.target))return;const n=zr(t.target,{matchingSelector:"label"});n&&Array.from(this.labels).includes(n)&&this.element.focus()}}),this.element=e}connectedCallback(){Bl(this,kf,function(e){if(e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby"))return;const t=function(){const n=Array.from(e.labels).map(s=>{if(!s.contains(e))return s.textContent}).filter(s=>s),r=n.join(" ");return r?e.setAttribute("aria-label",r):e.removeAttribute("aria-label")};return t(),Zt("focus",{onElement:e,withCallback:t})}(this.element)),window.addEventListener("reset",rt(this,Sf),!1),window.addEventListener("click",rt(this,_f),!1)}disconnectedCallback(){var e;(e=rt(this,kf))===null||e===void 0||e.destroy(),window.removeEventListener("reset",rt(this,Sf),!1),window.removeEventListener("click",rt(this,_f),!1)}get labels(){const e=[];this.element.id&&this.element.ownerDocument&&e.push(...Array.from(this.element.ownerDocument.querySelectorAll("label[for='".concat(this.element.id,"']"))||[]));const t=zr(this.element,{matchingSelector:"label"});return t&&[this.element,null].includes(t.control)&&e.push(t),e}get form(){return console.warn("This browser does not support the .form property for trix-editor elements."),null}get name(){return console.warn("This browser does not support the .name property for trix-editor elements."),null}set name(e){console.warn("This browser does not support the .name property for trix-editor elements.")}get disabled(){return console.warn("This browser does not support the [disabled] attribute for trix-editor elements."),!1}set disabled(e){console.warn("This browser does not support the [disabled] attribute for trix-editor elements.")}get required(){return console.warn("This browser does not support the [required] attribute for trix-editor elements."),!1}set required(e){console.warn("This browser does not support the [required] attribute for trix-editor elements.")}get validity(){return console.warn("This browser does not support the validity property for trix-editor elements."),null}get validationMessage(){return console.warn("This browser does not support the validationMessage property for trix-editor elements."),""}get willValidate(){return console.warn("This browser does not support the willValidate property for trix-editor elements."),!1}formDisabledCallback(e){}setFormValue(e){}checkValidity(){return console.warn("This browser does not support checkValidity() for trix-editor elements."),!0}reportValidity(){return console.warn("This browser does not support reportValidity() for trix-editor elements."),!0}setCustomValidity(e){console.warn("This browser does not support setCustomValidity(validationMessage) for trix-editor elements.")}}var Xt=new WeakMap;class Su extends HTMLElement{constructor(){super(),mo(this,Xt,{writable:!0,value:void 0}),this.willCreateInput=!0,Bl(this,Xt,this.constructor.formAssociated?new gD(this):new OD(this))}get trixId(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++hD),this.trixId)}get labels(){return rt(this,Xt).labels}get disabled(){const{inputElement:e}=this;return e?e.disabled:rt(this,Xt).disabled}set disabled(e){const{inputElement:t}=this;t&&(t.disabled=e),rt(this,Xt).disabled=e}get required(){return rt(this,Xt).required}set required(e){rt(this,Xt).required=e}get validity(){return rt(this,Xt).validity}get validationMessage(){return rt(this,Xt).validationMessage}get willValidate(){return rt(this,Xt).willValidate}get type(){return this.localName}get toolbarElement(){var e;if(this.hasAttribute("toolbar"))return(e=this.ownerDocument)===null||e===void 0?void 0:e.getElementById(this.getAttribute("toolbar"));if(this.parentNode){const t="trix-toolbar-".concat(this.trixId);return this.setAttribute("toolbar",t),this.internalToolbar=Ge("trix-toolbar",{id:t}),this.parentNode.insertBefore(this.internalToolbar,this),this.internalToolbar}}get form(){const{inputElement:e}=this;return e?e.form:rt(this,Xt).form}get inputElement(){var e;return this.hasAttribute("input")?(e=this.ownerDocument)===null||e===void 0?void 0:e.getElementById(this.getAttribute("input")):void 0}get editor(){var e;return(e=this.editorController)===null||e===void 0?void 0:e.editor}get name(){const{inputElement:e}=this;return e?e.name:rt(this,Xt).name}set name(e){const{inputElement:t}=this;t?t.name=e:rt(this,Xt).name=e}get value(){const{inputElement:e}=this;return e?e.value:rt(this,Xt).value}set value(e){var t;this.defaultValue=e,(t=this.editor)===null||t===void 0||t.loadHTML(this.defaultValue)}attributeChangedCallback(e,t,n){e==="connected"&&this.isConnected&&t!=null&&t!==n&&requestAnimationFrame(()=>this.reconnect())}notify(e,t){if(this.editorController)return Ll("trix-".concat(e),{onElement:this,attributes:t})}setFormValue(e){const{inputElement:t}=this;t&&(t.value=e),rt(this,Xt).setFormValue(e)}connectedCallback(){if(!this.hasAttribute("data-trix-internal")){if(fD(this),function(e){e.hasAttribute("role")||e.setAttribute("role","textbox")}(this),!this.editorController){if(Ll("trix-before-initialize",{onElement:this}),this.defaultValue=this.inputElement?this.inputElement.value:this.innerHTML,!this.hasAttribute("input")&&this.parentNode&&this.willCreateInput){const e="trix-input-".concat(this.trixId);this.setAttribute("input",e);const t=Ge("input",{type:"hidden",id:e});this.parentNode.insertBefore(t,this.nextElementSibling)}this.editorController=new Xl({editorElement:this,html:this.defaultValue}),requestAnimationFrame(()=>Ll("trix-initialize",{onElement:this}))}this.editorController.registerSelectionManager(),rt(this,Xt).connectedCallback(),this.toggleAttribute("connected",!0),function(e){!document.querySelector(":focus")&&e.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===e&&e.focus()}(this)}}disconnectedCallback(){var e;(e=this.editorController)===null||e===void 0||e.unregisterSelectionManager(),rt(this,Xt).disconnectedCallback(),this.toggleAttribute("connected",!1)}reconnect(){this.removeInternalToolbar(),this.disconnectedCallback(),this.connectedCallback()}removeInternalToolbar(){var e;(e=this.internalToolbar)===null||e===void 0||e.remove(),this.internalToolbar=null}checkValidity(){return rt(this,Xt).checkValidity()}reportValidity(){return rt(this,Xt).reportValidity()}setCustomValidity(e){rt(this,Xt).setCustomValidity(e)}formDisabledCallback(e){const{inputElement:t}=this;t&&(t.disabled=e),this.toggleAttribute("contenteditable",!e),rt(this,Xt).formDisabledCallback(e)}formResetCallback(){this.reset()}reset(){this.value=this.defaultValue}}gn(Su,"formAssociated","ElementInternals"in window),gn(Su,"observedAttributes",["connected"]);const io={VERSION:bR,config:$a,core:I4,models:Bk,views:X4,controllers:aD,observers:cD,operations:uD,elements:Object.freeze({__proto__:null,TrixEditorElement:Su,TrixToolbarElement:Gk}),filters:Object.freeze({__proto__:null,Filter:Dk,attachmentGalleryFilter:$k})};Object.assign(io,Bk),window.Trix=io,setTimeout(function(){customElements.get("trix-toolbar")||customElements.define("trix-toolbar",Gk),customElements.get("trix-editor")||customElements.define("trix-editor",Su)},0);function bD(i){let e,t,n,r,s,o,l,a;return{c(){e=y("div"),t=y("input"),r=D(),s=y("trix-editor"),O(t,"id",n="x-"+i[1].name),t.value=i[0],O(t,"type","hidden"),Ko(s,"class","content"),Ko(s,"input",o="x-"+i[1].name),Ko(s,"role","textbox"),Ko(s,"tabindex","0"),O(e,"class","tox-wrapper")},m(c,u){A(c,e,u),v(e,t),v(e,r),v(e,s),i[5](s),l||(a=G(s,"trix-change",i[3]),l=!0)},p(c,[u]){u&2&&n!==(n="x-"+c[1].name)&&O(t,"id",n),u&1&&(t.value=c[0]),u&2&&o!==(o="x-"+c[1].name)&&Ko(s,"input",o)},i:U,o:U,d(c){c&&P(e),i[5](null),l=!1,a()}}}function vD(i,e,t){let{value:n=""}=e,{field:r}=e,s;function o(c){t(0,n=c.target.value)}function l(c){if(c.file.width>0){var u=new io.Attachment({content:c.html});s.editor.insertAttachment(u)}else s.editor.insertHTML(`${c.file.filename}`)}Ti(()=>{s.addEventListener("trix-file-accept",c=>{c.preventDefault()}),s.addEventListener("trix-before-initialize",c=>{io.config.blockAttributes.heading1.tagName="h2";const{toolbarElement:u}=c.target;u.querySelector("[data-trix-attribute=heading1]").insertAdjacentHTML("afterend",'')})}),io.config.blockAttributes.default.breakOnReturn=!1,io.config.blockAttributes.heading3={tagName:"h3",terminal:!0,breakOnReturn:!0,group:!1};function a(c){Se[c?"unshift":"push"](()=>{s=c,t(2,s)})}return i.$$set=c=>{"value"in c&&t(0,n=c.value),"field"in c&&t(1,r=c.field)},[n,r,s,o,l,a]}class wD extends oe{constructor(e){super(),se(this,e,vD,bD,re,{value:0,field:1,insertMedia:4})}get insertMedia(){return this.$$.ctx[4]}}function A0(i){let e,t,n;function r(o){i[11](o)}let s={record:i[3],field:i[2],validationErrors:i[4]};return i[1]!==void 0&&(s.graph=i[1]),e=new rk({props:s}),Se.push(()=>He(e,"graph",r)),e.$on("editor-insert",i[7]),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&8&&(a.record=o[3]),l&4&&(a.field=o[2]),l&16&&(a.validationErrors=o[4]),!t&&l&2&&(t=!0,a.graph=o[1],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function x0(i){let e,t;return{c(){e=y("div"),t=W(i[6]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&64&&K(t,n[6])},d(n){n&&P(e)}}}function yD(i){let e,t,n,r,s,o;function l(h){i[10](h)}let a={field:i[2]};i[0]!==void 0&&(a.value=i[0]),t=new wD({props:a}),i[9](t),Se.push(()=>He(t,"value",l));let c=i[2].collections.length>0&&A0(i),u=i[6]&&x0(i);return{c(){e=y("div"),V(t.$$.fragment),r=D(),c&&c.c(),s=D(),u&&u.c(),O(e,"class","mb-0")},m(h,f){A(h,e,f),Y(t,e,null),v(e,r),c&&c.m(e,null),v(e,s),u&&u.m(e,null),o=!0},p(h,[f]){const d={};f&4&&(d.field=h[2]),!n&&f&1&&(n=!0,d.value=h[0],nt(()=>n=!1)),t.$set(d),h[2].collections.length>0?c?(c.p(h,f),f&4&&T(c,1)):(c=A0(h),c.c(),T(c,1),c.m(e,s)):c&&(me(),R(c,1,1,()=>{c=null}),pe()),h[6]?u?u.p(h,f):(u=x0(h),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(h){o||(T(t.$$.fragment,h),T(c),o=!0)},o(h){R(t.$$.fragment,h),R(c),o=!1},d(h){h&&P(e),i[9](null),z(t),c&&c.d(),u&&u.d()}}}function kD(i,e,t){let n,{value:r}=e,{field:s}=e,{isCreateMode:o}=e,{graph:l}=e,{record:a}=e,{validationErrors:c}=e,u;s.readonly;function h(p){u.insertMedia(p.detail)}function f(p){Se[p?"unshift":"push"](()=>{u=p,t(5,u)})}function d(p){r=p,t(0,r)}function m(p){l=p,t(1,l)}return i.$$set=p=>{"value"in p&&t(0,r=p.value),"field"in p&&t(2,s=p.field),"isCreateMode"in p&&t(8,o=p.isCreateMode),"graph"in p&&t(1,l=p.graph),"record"in p&&t(3,a=p.record),"validationErrors"in p&&t(4,c=p.validationErrors)},i.$$.update=()=>{i.$$.dirty&20&&t(6,n=In(c,s.name))},[r,l,s,a,c,u,n,h,o,f,d,m]}class Hk extends oe{constructor(e){super(),se(this,e,kD,yD,re,{value:0,field:2,isCreateMode:8,graph:1,record:3,validationErrors:4})}}class at{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=xo(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ni.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=xo(this,e,t);let n=[];return this.decompose(e,t,n,0),Ni.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new Fl(this),s=new Fl(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new Fl(this,e)}iterRange(e,t=this.length){return new Kk(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Jk(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?at.empty:e.length<=32?new Ft(e):Ni.from(Ft.split(e,[]))}}class Ft extends at{constructor(e,t=SD(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new _D(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new Ft(T0(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=Vc(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new Ft(l,o.length+s.length));else{let a=l.length>>1;n.push(new Ft(l.slice(0,a)),new Ft(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof Ft))return super.replace(e,t,n);[e,t]=xo(this,e,t);let r=Vc(this.text,Vc(n.text,T0(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new Ft(r,s):Ni.from(Ft.split(r,[]),s)}sliceString(e,t=this.length,n=` -`){[e,t]=xo(this,e,t);let r="";for(let s=0,o=0;s<=t&&oe&&o&&(r+=n),es&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new Ft(n,r)),n=[],r=-1);return r>-1&&t.push(new Ft(n,r)),t}}class Ni extends at{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s=o){let c=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!c?n.push(l):l.decompose(e-o,t-o,n,c)}o=a+1}}replace(e,t,n){if([e,t]=xo(this,e,t),n.lines=s&&t<=l){let a=o.replace(e-s,t-s,n),c=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>c>>6){let u=this.children.slice();return u[r]=a,new Ni(u,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` -`){[e,t]=xo(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ni))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],c=e.children[s];if(a!=c)return n+a.scanIdentical(c,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let m of e)m.flatten(d);return new Ft(d,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,u=[];function h(d){let m;if(d.lines>s&&d instanceof Ni)for(let p of d.children)h(p);else d.lines>o&&(a>o||!a)?(f(),l.push(d)):d instanceof Ft&&a&&(m=u[u.length-1])instanceof Ft&&d.lines+m.lines<=32?(a+=d.lines,c+=d.length+1,u[u.length-1]=new Ft(m.text.concat(d.text),m.length+1+d.length)):(a+d.lines>r&&f(),a+=d.lines,c+=d.length+1,u.push(d))}function f(){a!=0&&(l.push(u.length==1?u[0]:Ni.from(u,c)),c=-1,a=u.length=0)}for(let d of e)h(d);return f(),l.length==1?l[0]:new Ni(l,t)}}at.empty=new Ft([""],0);function SD(i){let e=-1;for(let t of i)e+=t.length+1;return e}function Vc(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(a>n&&(l=l.slice(0,n-r)),r0?1:(e instanceof Ft?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof Ft?r.text.length:r.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(r instanceof Ft){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Ft?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Kk{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Fl(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Jk{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(at.prototype[Symbol.iterator]=function(){return this.iter()},Fl.prototype[Symbol.iterator]=Kk.prototype[Symbol.iterator]=Jk.prototype[Symbol.iterator]=function(){return this});let _D=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function xo(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}let po="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(i=>i?parseInt(i,36):1);for(let i=1;ii)return po[e-1]<=i;return!1}function Q0(i){return i>=127462&&i<=127487}const M0=8205;function hn(i,e,t=!0,n=!0){return(t?eS:PD)(i,e,n)}function eS(i,e,t){if(e==i.length)return e;e&&tS(i.charCodeAt(e))&&nS(i.charCodeAt(e-1))&&e--;let n=ln(i,e);for(e+=oi(n);e=0&&Q0(ln(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function PD(i,e,t){for(;e>0;){let n=eS(i,e-2,t);if(n=56320&&i<57344}function nS(i){return i>=55296&&i<56320}function ln(i,e){let t=i.charCodeAt(e);if(!nS(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return tS(n)?(t-55296<<10)+(n-56320)+65536:t}function lp(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function oi(i){return i<65536?1:2}const Ld=/\r\n?|\n/;var cn=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(cn||(cn={}));class ji{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=l}else{if(n!=cn.Simple&&c>=e&&(n==cn.TrackDel&&re||n==cn.TrackBefore&&re))return null;if(c>e||c==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&l>=e)return rt?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ji(e)}static create(e){return new ji(e)}}class en extends ji{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Id(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return Nd(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length0&&Nr(n,t,s.text),s.forward(u),l+=u}let c=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(u=!1){if(!u&&!r.length)return;of||h<0||f>t)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${t})`);let m=d?typeof d=="string"?at.of(d.split(n||Ld)):d:at.empty,p=m.length;if(h==f&&p==0)return;ho&&mn(r,h-o,-1),mn(r,f-h,p),Nr(s,r,m),o=f}}return c(e),a(!l),l}static empty(e){return new en(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function Nr(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,c,s,u,h),r=c,s=u}}}function Nd(i,e,t,n=!1){let r=[],s=n?[]:null,o=new la(i),l=new la(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);mn(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let c=0,u=o.len;for(;u;)if(l.ins==-1){let h=Math.min(u,l.len);c+=h,u-=h,l.forward(h)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>c),s.forward2(a),o.forward(a)}}}}class la{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?at.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?at.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class ws{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new ws(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return q.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return q.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return q.range(e.anchor,e.head)}static create(e,t,n){return new ws(e,t,n)}}class q{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:q.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new q(e.ranges.map(t=>ws.fromJSON(t)),e.main)}static single(e,t=e){return new q([q.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;re?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?q.range(a,l):q.range(l,a))}}return new q(e,t)}}function rS(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let ap=0;class ye{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=ap++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new ye(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:cp),!!e.static,e.enables)}of(e){return new Uc([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Uc(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Uc(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function cp(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class Uc{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=ap++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let h of this.dependencies)h=="doc"?a=!0:h=="selection"?c=!0:((t=e[h.id])!==null&&t!==void 0?t:1)&1||u.push(e[h.id]);return{create(h){return h.values[o]=n(h),1},update(h,f){if(a&&f.docChanged||c&&(f.docChanged||f.selection)||Zd(h,u)){let d=n(h);if(l?!E0(d,h.values[o],r):!r(d,h.values[o]))return h.values[o]=d,1}return 0},reconfigure:(h,f)=>{let d,m=f.config.address[s];if(m!=null){let p=Cu(f,m);if(this.dependencies.every(g=>g instanceof ye?f.facet(g)===h.facet(g):g instanceof Jt?f.field(g,!1)==h.field(g,!1):!0)||(l?E0(d=n(h),p,r):r(d=n(h),p)))return h.values[o]=p,0}else d=n(h);return h.values[o]=d,1}}}}function E0(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let c=[];for(let u=0;un===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(R0).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,R0.of({field:this,create:e})]}get extension(){return this}}const Os={lowest:4,low:3,default:2,high:1,highest:0};function cl(i){return e=>new sS(e,i)}const gr={highest:cl(Os.highest),high:cl(Os.high),default:cl(Os.default),low:cl(Os.low),lowest:cl(Os.lowest)};class sS{constructor(e,t){this.inner=e,this.prec=t}}class Ur{of(e){return new Bd(this,e)}reconfigure(e){return Ur.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Bd{constructor(e,t){this.compartment=e,this.inner=t}}class _u{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of xD(e,t,o))f instanceof Jt?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],c=[];for(let f of r)l[f.id]=c.length<<1,c.push(d=>f.slot(d));let u=n==null?void 0:n.config.facets;for(let f in s){let d=s[f],m=d[0].facet,p=u&&u[f]||[];if(d.every(g=>g.type==0))if(l[m.id]=a.length<<1|1,cp(p,d))a.push(n.facet(m));else{let g=m.combine(d.map(b=>b.value));a.push(n&&m.compare(g,n.facet(m))?n.facet(m):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=c.length<<1,c.push(b=>g.dynamicSlot(b)));l[m.id]=c.length<<1,c.push(g=>AD(g,m,d))}}let h=c.map(f=>f(l));return new _u(e,o,h,l,a,s)}}function xD(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=n[a].indexOf(o);c>-1&&n[a].splice(c,1),o instanceof Bd&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof Bd){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,l)}else if(o instanceof sS)s(o.inner,o.prec);else if(o instanceof Jt)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Uc)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,Os.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(i,Os.default),n.reduce((o,l)=>o.concat(l))}function Yl(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function Cu(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const oS=ye.define(),Wd=ye.define({combine:i=>i.some(e=>e),static:!0}),lS=ye.define({combine:i=>i.length?i[0]:void 0,static:!0}),aS=ye.define(),cS=ye.define(),uS=ye.define(),hS=ye.define({combine:i=>i.length?i[0]:!1});class Or{constructor(e,t){this.type=e,this.value=t}static define(){return new TD}}class TD{of(e){return new Or(this,e)}}class QD{constructor(e){this.map=e}of(e){return new Fe(this,e)}}class Fe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Fe(this.type,t)}is(e){return this.type==e}static define(e={}){return new QD(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}}Fe.reconfigure=Fe.define();Fe.appendConfig=Fe.define();class Ht{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&rS(n,t.newLength),s.some(l=>l.type==Ht.time)||(this.annotations=s.concat(Ht.time.of(Date.now())))}static create(e,t,n,r,s,o){return new Ht(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Ht.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Ht.time=Or.define();Ht.userEvent=Or.define();Ht.addToHistory=Or.define();Ht.remote=Or.define();function MD(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof Ht?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Ht?i=s[0]:i=dS(e,go(s),!1)}return i}function RD(i){let e=i.startState,t=e.facet(uS),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=fS(n,Xd(e,s,i.changes.newLength),!0))}return n==i?i:Ht.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const DD=[];function go(i){return i==null?DD:Array.isArray(i)?i:[i]}var $t=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}($t||($t={}));const $D=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Fd;try{Fd=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function LD(i){if(Fd)return Fd.test(i);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||$D.test(t)))return!0}return!1}function ID(i){return e=>{if(!/\S/.test(e))return $t.Space;if(LD(e))return $t.Word;for(let t=0;t-1)return $t.Word;return $t.Other}}class tt{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(c,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(Fe.reconfigure)?(t=null,n=l.value):l.is(Fe.appendConfig)&&(t=null,n=go(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=_u.resolve(n,r,this),s=new tt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(Wd)?e.newSelection:e.newSelection.asSingle();new tt(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:q.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=go(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return tt.create({doc:e.doc,selection:q.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=_u.resolve(e.extensions||[],new Map),n=e.doc instanceof at?e.doc:at.of((e.doc||"").split(t.staticFacet(tt.lineSeparator)||Ld)),r=e.selection?e.selection instanceof q?e.selection:q.single(e.selection.anchor,e.selection.head):q.single(0);return rS(r,n.length),t.staticFacet(Wd)||(r=r.asSingle()),new tt(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(tt.tabSize)}get lineBreak(){return this.facet(tt.lineSeparator)||` -`}get readOnly(){return this.facet(hS)}phrase(e,...t){for(let n of this.facet(tt.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let s of this.facet(oS))for(let o of s(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return ID(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=hn(t,o,!1);if(s(t.slice(a,o))!=$t.Word)break;o=a}for(;li.length?i[0]:4});tt.lineSeparator=lS;tt.readOnly=hS;tt.phrases=ye.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(r=>i[r]==e[r])}});tt.languageData=oS;tt.changeFilter=aS;tt.transactionFilter=cS;tt.transactionExtender=uS;Ur.reconfigure=Fe.define();function Qi(i,e,t={}){let n={};for(let r of i)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}class Qs{eq(e){return this==e}range(e,t=e){return Yd.create(e,t,this)}}Qs.prototype.startSide=Qs.prototype.endSide=0;Qs.prototype.point=!1;Qs.prototype.mapMode=cn.TrackDel;let Yd=class mS{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new mS(e,t,n)}};function zd(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}class up{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,n,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,s);sd||f==d&&c.startSide>0&&c.endSide<=0)continue;(d-f||c.endSide-c.startSide)<0||(o<0&&(o=f),c.point&&(l=Math.max(l,d-f)),n.push(c),r.push(f-o),s.push(d-o))}return{mapped:n.length?new up(r,s,n,l):null,pos:o}}}class it{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new it(e,t,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(zd)),this.isEmpty)return t.length?it.of(t):this;let l=new pS(this,null,-1).goto(0),a=0,c=[],u=new jr;for(;l.value||a=0){let h=t[a++];u.addInner(h.from,h.to,h.value)||c.push(h)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&e<=s+o.length&&o.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return aa.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return aa.from(e).goto(t)}static compare(e,t,n,r,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=D0(o,l,n),c=new ul(o,a,s),u=new ul(l,a,s);n.iterGaps((h,f,d)=>$0(c,h,u,f,d,r)),n.empty&&n.length==0&&$0(c,0,u,0,0,r)}static eq(e,t,n=0,r){r==null&&(r=999999999);let s=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),o=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=D0(s,o),a=new ul(s,l,0).goto(n),c=new ul(o,l,0).goto(n);for(;;){if(a.to!=c.to||!Vd(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,t,n,r,s=-1){let o=new ul(e,null,s).goto(t),l=t,a=o.openStart;for(;;){let c=Math.min(o.to,n);if(o.point){let u=o.activeForPoint(o.to),h=o.pointFroml&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new jr;for(let r of e instanceof Yd?[e]:t?ND(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return it.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=it.empty;r=r.nextLayer)t=new it(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}it.empty=new it([],[],null,-1);function ND(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(zd);e=n}return i}it.empty.nextLayer=it.empty;class jr{finishChunk(e){this.chunks.push(new up(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new jr)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(it.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=it.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function D0(i,e,t){let n=new Map;for(let s of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new pS(o,t,n,s));return r.length==1?r[0]:new aa(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)Cf(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)Cf(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Cf(this.heap,0)}}}function Cf(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let r=i[n];if(n+1=0&&(r=i[n+1],n++),t.compare(r)<0)break;i[n]=t,i[e]=r,e=n}}class ul{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=aa.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){uc(this.active,e),uc(this.activeTo,e),uc(this.activeRank,e),this.minActive=L0(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:s}=this.cursor;for(;t0;)t++;hc(this.active,t,n),hc(this.activeTo,t,r),hc(this.activeRank,t,s),e&&hc(e,t,this.cursor.from),this.minActive=L0(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&uc(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[r]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function $0(i,e,t,n,r,s){i.goto(e),t.goto(n);let o=n+r,l=n,a=n-e;for(;;){let c=i.to+a-t.to||i.endSide-t.endSide,u=c<0?i.to+a:t.to,h=Math.min(u,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Vd(i.activeForPoint(i.to),t.activeForPoint(t.to))||s.comparePoint(l,h,i.point,t.point):h>l&&!Vd(i.active,t.active)&&s.compareRange(l,h,i.active,t.active),u>o)break;l=u,c<=0&&i.next(),c>=0&&t.next()}}function Vd(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function L0(i,e){let t=-1,n=1e9;for(let r=0;r=e)return r;if(r==i.length)break;s+=i.charCodeAt(r)==9?t-s%t:1,r=hn(i,r)}return n===!0?-1:i.length}const jd="ͼ",I0=typeof Symbol>"u"?"__"+jd:Symbol.for(jd),qd=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),N0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class qr{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let u=[],h=/^@(\w+)\b/.exec(o[0]),f=h&&h[1]=="keyframes";if(h&&l==null)return a.push(o[0]+";");for(let d in l){let m=l[d];if(/&/.test(d))s(d.split(/,\s*/).map(p=>o.map(g=>p.replace(/&/,g))).reduce((p,g)=>p.concat(g)),m,a);else if(m&&typeof m=="object"){if(!h)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),m,u,f)}else m!=null&&u.push(d.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+m+";")}(u.length||f)&&a.push((n&&!h&&!c?o.map(n):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=N0[I0]||1;return N0[I0]=e+1,jd+e.toString(36)}static mount(e,t,n){let r=e[qd],s=n&&n.nonce;r?s&&r.setNonce(s):r=new ZD(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let Z0=new Map;class ZD{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Z0.get(n);if(s)return e[qd]=s;this.sheet=new r.CSSStyleSheet,Z0.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[qd]=this}mount(e,t){let n=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},BD=typeof navigator<"u"&&/Mac/.test(navigator.platform),WD=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var an=0;an<10;an++)Gr[48+an]=Gr[96+an]=String(an);for(var an=1;an<=24;an++)Gr[an+111]="F"+an;for(var an=65;an<=90;an++)Gr[an]=String.fromCharCode(an+32),ca[an]=String.fromCharCode(an);for(var Pf in Gr)ca.hasOwnProperty(Pf)||(ca[Pf]=Gr[Pf]);function XD(i){var e=BD&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||WD&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?ca:Gr)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function ua(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function Gd(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function FD(i){let e=i.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function jc(i,e){if(!e.anchorNode)return!1;try{return Gd(i,e.anchorNode)}catch{return!1}}function ha(i){return i.nodeType==3?Es(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function zl(i,e,t,n){return t?B0(i,e,t,n,-1)||B0(i,e,t,n,1):!1}function Ms(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function Pu(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function B0(i,e,t,n,r){for(;;){if(i==t&&e==n)return!0;if(e==(r<0?0:fr(i))){if(i.nodeName=="DIV")return!1;let s=i.parentNode;if(!s||s.nodeType!=1)return!1;e=Ms(i)+(r<0?0:1),i=s}else if(i.nodeType==1){if(i=i.childNodes[e+(r<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=r<0?fr(i):0}else return!1}}function fr(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function hh(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function YD(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function gS(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function zD(i,e,t,n,r,s,o,l){let a=i.ownerDocument,c=a.defaultView||window;for(let u=i,h=!1;u&&!h;)if(u.nodeType==1){let f,d=u==a.body,m=1,p=1;if(d)f=YD(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(h=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let w=u.getBoundingClientRect();({scaleX:m,scaleY:p}=gS(u,w)),f={left:w.left,right:w.left+u.clientWidth*m,top:w.top,bottom:w.top+u.clientHeight*p}}let g=0,b=0;if(r=="nearest")e.top0&&e.bottom>f.bottom+b&&(b=e.bottom-f.bottom+b+o)):e.bottom>f.bottom&&(b=e.bottom-f.bottom+o,t<0&&e.top-b0&&e.right>f.right+g&&(g=e.right-f.right+g+s)):e.right>f.right&&(g=e.right-f.right+s,t<0&&e.leftr.clientHeight&&(n=r),!t&&r.scrollWidth>r.clientWidth&&(t=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:t,y:n}}class UD{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?fr(t):0),n,Math.min(e.focusOffset,n?fr(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}}let qs=null;function OS(i){if(i.setActive)return i.setActive();if(qs)return i.focus(qs);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(qs==null?{get preventScroll(){return qs={preventScroll:!0},!0}}:void 0),!qs){qs=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function wS(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=fr(t)}else if(t.parentNode&&!Pu(t))n=Ms(t),t=t.parentNode;else return null}}function yS(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&nt)return h.domBoundsAround(e,t,c);if(f>=e&&r==-1&&(r=a,s=c),c>t&&h.dom.parentNode==this.dom){o=a,l=u;break}u=f,c=f+h.breakAfter}return{from:s,to:l<0?n+this.length:l,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=hp){this.markDirty();for(let r=e;rthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function SS(i,e,t,n,r,s,o,l,a){let{children:c}=i,u=c.length?c[e]:null,h=s.length?s[s.length-1]:null,f=h?h.breakAfter:o;if(!(e==n&&u&&!o&&!f&&s.length<2&&u.merge(t,r,s.length?h:null,t==0,l,a))){if(n0&&(!o&&s.length&&u.merge(t,u.length,s[0],!1,l,0)?u.breakAfter=s.shift().breakAfter:(t2);var ke={mac:Y0||/Mac/.test(En.platform),windows:/Win/.test(En.platform),linux:/Linux|X11/.test(En.platform),ie:fh,ie_version:CS?Hd.documentMode||6:Jd?+Jd[1]:Kd?+Kd[1]:0,gecko:F0,gecko_version:F0?+(/Firefox\/(\d+)/.exec(En.userAgent)||[0,0])[1]:0,chrome:!!Af,chrome_version:Af?+Af[1]:0,ios:Y0,android:/Android\b/.test(En.userAgent),safari:PS,webkit_version:GD?+(/\bAppleWebKit\/(\d+)/.exec(En.userAgent)||[0,0])[1]:0,tabSize:Hd.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const HD=256;class Ai extends St{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof Ai)||this.length-(t-e)+n.length>HD||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Ai(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new pn(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return KD(this.dom,e,t)}}class dr extends St{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let r of t)r.setParent(this)}setAttrs(e){if(bS(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,r,s,o){return n&&(!(n instanceof dr&&n.mark.eq(this.mark))||e&&s<=0||te&&t.push(n=e&&(r=s),n=a,s++}let o=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new dr(this.mark,t,o)}domAtPos(e){return AS(this,e)}coordsAt(e,t){return TS(this,e,t)}}function KD(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let r=e,s=e,o=0;e==0&&t<0||e==n&&t>=0?ke.chrome||ke.gecko||(e?(r--,o=1):s=0)?0:l.length-1];return ke.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?hh(a,o<0):a||null}class Zr extends St{static create(e,t,n){return new Zr(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=Zr.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,r,s,o){return n&&(!(n instanceof Zr)||!this.widget.compare(n.widget)||e>0&&s<=0||t0)?pn.before(this.dom):pn.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?r.length-1:0;s=r[l],!(e>0?l==0:l==r.length-1||s.top0?pn.before(this.dom):pn.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return at.empty}get isHidden(){return!0}}Ai.prototype.children=Zr.prototype.children=To.prototype.children=hp;function AS(i,e){let t=i.dom,{children:n}=i,r=0;for(let s=0;rs&&e0;s--){let o=n[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=r;s0&&e instanceof dr&&r.length&&(n=r[r.length-1])instanceof dr&&n.mark.eq(e.mark)?xS(n,e.children[0],t-1):(r.push(e),e.setParent(i)),i.length+=e.length}function TS(i,e,t){let n=null,r=-1,s=null,o=-1;function l(c,u){for(let h=0,f=0;h=u&&(d.children.length?l(d,u-f):(!s||s.isHidden&&t>0)&&(m>u||f==m&&d.getSide()>0)?(s=d,o=u-f):(f-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(r.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function tm(i,e,t){let n=!1;if(e)for(let r in e)t&&r in t||(n=!0,r=="style"?i.style.cssText="":i.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(n=!0,r=="style"?i.style.cssText=t[r]:i.setAttribute(r,t[r]));return n}function e5(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Hr(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=QS(e,t);n=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new Hr(e,n,r,t,e.widget||null,!0)}static line(e){return new Ia(e)}static set(e,t=!1){return it.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Qe.none=it.empty;class La extends Qe{constructor(e){let{start:t,end:n}=QS(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof La&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Au(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}La.prototype.point=!1;class Ia extends Qe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ia&&this.spec.class==e.spec.class&&Au(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ia.prototype.mapMode=cn.TrackBefore;Ia.prototype.point=!0;class Hr extends Qe{constructor(e,t,n,r,s,o){super(t,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?cn.TrackBefore:cn.TrackAfter:cn.TrackDel}get type(){return this.startSide!=this.endSide?Cn.WidgetRange:this.startSide<=0?Cn.WidgetBefore:Cn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Hr&&t5(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Hr.prototype.point=!0;function QS(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function t5(i,e){return i==e||!!(i&&e&&i.compare(e))}function nm(i,e,t,n=0){let r=t.length-1;r>=0&&t[r]+n>=i?t[r]=Math.max(t[r],e):t.push(i,e)}class qt extends St{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,r,s,o){if(n){if(!(n instanceof qt))return!1;this.dom||n.transferDOM(this)}return r&&this.setDeco(n?n.attrs:null),_S(this,e,t,n?n.children.slice():[],s,o),!0}split(e){let t=new qt;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:r}=this.childPos(e);r&&(t.append(this.children[n].split(r),0),this.children[n].merge(r,this.children[n].length,null,!1,0,0),n++);for(let s=n;s0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Au(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){xS(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=em(t,this.attrs||{})),n&&(this.attrs=em({class:n},this.attrs||{}))}domAtPos(e){return AS(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(bS(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(tm(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&St.get(r)instanceof dr;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((n=St.get(r))===null||n===void 0?void 0:n.isEditable)==!1&&(!ke.ios||!this.children.some(s=>s instanceof Ai))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof Ai)||/[^ -~]/.test(n.text))return null;let r=ha(n.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=TS(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof qt)return s;if(o>t)break}r=o+s.breakAfter}return null}}class ar extends St{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,r,s,o){return n&&(!(n instanceof ar)||!this.widget.compare(n.widget)||e>0&&s<=0||t0}}class im extends br{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Vl{constructor(e,t,n,r){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ar&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new qt),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(fc(new To(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ar)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(fc(new Ai(this.text.slice(this.textOff,this.textOff+r)),t),n),this.atCursorPos=!0,this.textOff+=r,e-=r,n=0}}span(e,t,n,r){this.buildText(t-e,n,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,n,r,s,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Hr){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof Hr)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ar(n.widget||Qo.block,l,n));else{let a=Zr.create(n.widget||Qo.inline,l,l?0:n.startSide),c=this.atCursorPos&&!a.isEditable&&s<=r.length&&(e0),u=!a.isEditable&&(er.length||n.startSide<=0),h=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),c&&(h.append(fc(new To(1),r),s),s=r.length+Math.max(0,s-r.length)),h.append(fc(a,r),s),this.atCursorPos=u,this.pendingBuffer=u?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,n,r,s){let o=new Vl(e,t,n,s);return o.openEnd=it.spans(r,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function fc(i,e){for(let t of e)i=new dr(t,[i],i.length);return i}class Qo extends br{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Qo.inline=new Qo("span");Qo.block=new Qo("div");var Rt=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(Rt||(Rt={}));const Rs=Rt.LTR,fp=Rt.RTL;function MS(i){let e=[];for(let t=0;t=t){if(l.level==n)return o;(s<0||(r!=0?r<0?l.fromt:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function RS(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;p-=3)if(Di[p+1]==-d){let g=Di[p+2],b=g&2?r:g&4?g&1?s:r:0;b&&(kt[h]=kt[Di[p]]=b),l=p;break}}else{if(Di.length==189)break;Di[l++]=h,Di[l++]=f,Di[l++]=a}else if((m=kt[h])==2||m==1){let p=m==r;a=p?0:1;for(let g=l-3;g>=0;g-=3){let b=Di[g+2];if(b&2)break;if(p)Di[g+2]|=2;else{if(b&4)break;Di[g+2]|=4}}}}}function l5(i,e,t,n){for(let r=0,s=n;r<=t.length;r++){let o=r?t[r-1].to:i,l=ra;)m==g&&(m=t[--p].from,g=p?t[p-1].to:i),kt[--m]=d;a=u}else s=c,a++}}}function sm(i,e,t,n,r,s,o){let l=n%2?2:1;if(n%2==r%2)for(let a=e,c=0;aa&&o.push(new Br(a,p.from,d));let g=p.direction==Rs!=!(d%2);om(i,g?n+1:n,r,p.inner,p.from,p.to,o),a=p.to}m=p.to}else{if(m==t||(u?kt[m]!=l:kt[m]==l))break;m++}f?sm(i,a,m,n+1,r,f,o):ae;){let u=!0,h=!1;if(!c||a>s[c-1].to){let p=kt[a-1];p!=l&&(u=!1,h=p==16)}let f=!u&&l==1?[]:null,d=u?n:n+1,m=a;e:for(;;)if(c&&m==s[c-1].to){if(h)break e;let p=s[--c];if(!u)for(let g=p.from,b=c;;){if(g==e)break e;if(b&&s[b-1].to==g)g=s[--b].from;else{if(kt[g-1]==l)break e;break}}if(f)f.push(p);else{p.tokt.length;)kt[kt.length]=256;let n=[],r=e==Rs?0:1;return om(i,r,r,t,0,i.length,n),n}function DS(i){return[new Br(0,i,0)]}let $S="";function c5(i,e,t,n,r){var s;let o=n.head-i.from,l=Br.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),a=e[l],c=a.side(r,t);if(o==c){let f=l+=r?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!r,t),c=a.side(r,t)}let u=hn(i.text,o,a.forward(r,t));(ua.to)&&(u=c),$S=i.text.slice(Math.min(o,u),Math.max(o,u));let h=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return h&&u==c&&h.level+(r?0:1)i.some(e=>e)}),FS=ye.define({combine:i=>i.some(e=>e)}),YS=ye.define();class bo{constructor(e,t="nearest",n="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new bo(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new bo(q.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const dc=Fe.define({map:(i,e)=>i.map(e)}),zS=Fe.define();function _n(i,e,t){let n=i.facet(ZS);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Dr=ye.define({combine:i=>i.length?i[0]:!0});let h5=0;const kl=ye.define();class Vt{constructor(e,t,n,r,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.extension=s(this)}static define(e,t){const{eventHandlers:n,eventObservers:r,provide:s,decorations:o}=t||{};return new Vt(h5++,e,n,r,l=>{let a=[kl.of(l)];return o&&a.push(fa.of(c=>{let u=c.plugin(l);return u?o(u):Qe.none})),s&&a.push(s(l)),a})}static fromClass(e,t){return Vt.define(n=>new e(n),t)}}class xf{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(_n(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){_n(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){_n(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const VS=ye.define(),dp=ye.define(),fa=ye.define(),US=ye.define(),mp=ye.define(),jS=ye.define();function V0(i,e){let t=i.state.facet(jS);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(i):s),r=[];return it.spans(n,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,u=o-e.from,h=r;for(let f=l.length-1;f>=0;f--,a--){let d=l[f].spec.bidiIsolate,m;if(d==null&&(d=u5(e.text,c,u)),a>0&&h.length&&(m=h[h.length-1]).to==c&&m.direction==d)m.to=u,h=m.inner;else{let p={from:c,to:u,direction:d,inner:[]};h.push(p),h=p.inner}}}}),r}const qS=ye.define();function GS(i){let e=0,t=0,n=0,r=0;for(let s of i.state.facet(qS)){let o=s(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:n,bottom:r}}const Sl=ye.define();class ui{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(e){return new ui(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toAu)break;s+=2}if(!a)return n;new ui(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,l=a.toB}}}class xu{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=en.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new ui(s,o,l,a))),this.changedRanges=r}static create(e,t,n){return new xu(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class U0 extends St{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Qe.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new qt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ui(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:u})=>uthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!b5(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?d5(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:u}=this.hasComposition;n=new ui(c,u,e.changes.mapPos(c,-1),e.changes.mapPos(u,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(ke.ie||ke.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=g5(o,l,e.changes);return n=ui.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=ke.chrome||ke.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||r.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?r[o]:null;if(!l)break;let{fromA:a,toA:c,fromB:u,toB:h}=l,f,d,m,p;if(n&&n.range.fromBu){let _=Vl.build(this.view.state.doc,u,n.range.fromB,this.decorations,this.dynamicDecorationMap),k=Vl.build(this.view.state.doc,n.range.toB,h,this.decorations,this.dynamicDecorationMap);d=_.breakAtStart,m=_.openStart,p=k.openEnd;let Q=this.compositionView(n);k.breakAtStart?Q.breakAfter=1:k.content.length&&Q.merge(Q.length,Q.length,k.content[0],!1,k.openStart,0)&&(Q.breakAfter=k.content[0].breakAfter,k.content.shift()),_.content.length&&Q.merge(0,0,_.content[_.content.length-1],!0,0,_.openEnd)&&_.content.pop(),f=_.content.concat(Q).concat(k.content)}else({content:f,breakAtStart:d,openStart:m,openEnd:p}=Vl.build(this.view.state.doc,u,h,this.decorations,this.dynamicDecorationMap));let{i:g,off:b}=s.findPos(c,1),{i:w,off:S}=s.findPos(a,-1);SS(this,w,S,g,b,f,d,m,p)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(zS)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new Ai(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new dr(r,[t],t.length);let n=new qt;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=St.get(s);l&&l!=o&&(l.dom=null),o.setDOM(s)},n=this.childPos(e.range.fromB,1),r=this.children[n.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)n=r.childPos(n.off,1),r=r.children[n.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,r=n==this.dom,s=!r&&jc(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(r||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),c=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(ke.gecko&&l.empty&&!this.hasComposition&&f5(a)){let h=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(h,a.node.childNodes[a.offset]||null)),a=c=new pn(h,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!zl(a.node,a.offset,u.anchorNode,u.anchorOffset)||!zl(c.node,c.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,l))&&(this.view.observer.ignore(()=>{ke.android&&ke.chrome&&this.dom.contains(u.focusNode)&&O5(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let h=ua(this.view.root);if(h)if(l.empty){if(ke.gecko){let f=m5(a.node,a.offset);if(f&&f!=3){let d=(f==1?wS:yS)(a.node,a.offset);d&&(a=new pn(d.node,d.offset))}}h.collapse(a.node,a.offset),l.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=l.bidiLevel)}else if(h.extend){h.collapse(a.node,a.offset);try{h.extend(c.node,c.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,c]=[c,a]),f.setEnd(c.node,c.offset),f.setStart(a.node,a.offset),h.removeAllRanges(),h.addRange(f)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new pn(u.anchorNode,u.anchorOffset),this.impreciseHead=c.precise?null:new pn(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&zl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=ua(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=qt.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(t.head+t.assoc);n.collapse(u.node,u.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=t.from&&n.collapse(r,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let r=e.offset;!n&&r=0;r--){let s=St.get(t.childNodes[r]);s instanceof qt&&(n=s.domAtPos(s.length))}return n?new pn(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=St.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=s-l.breakAfter,c=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof qt&&!(n instanceof qt&&t>=0)))n=l,r=c;else if(n&&c==e&&a==e&&l instanceof ar&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(n=null)}s=c}return n?n.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),r=this.children[t];if(!(r instanceof qt))return null;for(;r.children.length;){let{i:l,off:a}=r.childPos(n,1);for(;;l++){if(l==r.children.length)return null;if((r=r.children[l]).length)break}n=a}if(!(r instanceof Ai))return null;let s=hn(r.text,n);if(s==n)return null;let o=Es(r.dom,n,s).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Rt.LTR;for(let c=0,u=0;ur)break;if(c>=n){let d=h.dom.getBoundingClientRect();if(t.push(d.height),o){let m=h.dom.lastChild,p=m?ha(m):[];if(p.length){let g=p[p.length-1],b=a?g.right-d.left:d.right-g.left;b>l&&(l=b,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=f)}}}c=f+h.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Rt.RTL:Rt.LTR}measureTextSize(){for(let s of this.children)if(s instanceof qt){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=ha(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new kS(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Qe.replace({widget:new im(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return Qe.set(e)}updateDeco(){let e=1,t=this.view.state.facet(fa).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(US).map((s,o)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(it.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=GS(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;zD(this.view.scrollDOM,o,t.head{ne.from&&(t=!0)}),t}function v5(i,e,t=1){let n=i.charCategorizer(e),r=i.doc.lineAt(e),s=e-r.from;if(r.length==0)return q.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,l=s;t<0?o=hn(r.text,s,!1):l=hn(r.text,s);let a=n(r.text.slice(o,l));for(;o>0;){let c=hn(r.text,o,!1);if(n(r.text.slice(c,o))!=a)break;o=c}for(;li?e.left-i:Math.max(0,i-e.right)}function y5(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function Tf(i,e){return i.tope.top+1}function j0(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function am(i,e,t){let n,r,s,o,l=!1,a,c,u,h;for(let m=i.firstChild;m;m=m.nextSibling){let p=ha(m);for(let g=0;gS||o==S&&s>w){n=m,r=b,s=w,o=S;let _=S?t0?g0)}w==0?t>b.bottom&&(!u||u.bottomb.top)&&(c=m,h=b):u&&Tf(u,b)?u=q0(u,b.bottom):h&&Tf(h,b)&&(h=j0(h,b.top))}}if(u&&u.bottom>=t?(n=a,r=u):h&&h.top<=t&&(n=c,r=h),!n)return{node:i,offset:0};let f=Math.max(r.left,Math.min(r.right,e));if(n.nodeType==3)return G0(n,f,t);if(l&&n.contentEditable!="false")return am(n,f,t);let d=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(r.left+r.right)/2?1:0);return{node:i,offset:d}}function G0(i,e,t){let n=i.nodeValue.length,r=-1,s=1e9,o=0;for(let l=0;lt?u.top-t:t-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&h=(u.left+u.right)/2,d=f;if((ke.chrome||ke.gecko)&&Es(i,l).getBoundingClientRect().left==u.right&&(d=!f),h<=0)return{node:i,offset:l+(d?1:0)};r=l+(d?1:0),s=h}}}return{node:i,offset:r>-1?r:o>0?i.nodeValue.length:0}}function KS(i,e,t,n=-1){var r,s;let o=i.contentDOM.getBoundingClientRect(),l=o.top+i.viewState.paddingTop,a,{docHeight:c}=i.viewState,{x:u,y:h}=e,f=h-l;if(f<0)return 0;if(f>c)return i.state.doc.length;for(let _=i.viewState.heightOracle.textHeight/2,k=!1;a=i.elementAtHeight(f),a.type!=Cn.Text;)for(;f=n>0?a.bottom+_:a.top-_,!(f>=0&&f<=c);){if(k)return t?null:0;k=!0,n=-n}h=l+f;let d=a.from;if(di.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:H0(i,o,a,u,h);let m=i.dom.ownerDocument,p=i.root.elementFromPoint?i.root:m,g=p.elementFromPoint(u,h);g&&!i.contentDOM.contains(g)&&(g=null),g||(u=Math.max(o.left+1,Math.min(o.right-1,u)),g=p.elementFromPoint(u,h),g&&!i.contentDOM.contains(g)&&(g=null));let b,w=-1;if(g&&((r=i.docView.nearest(g))===null||r===void 0?void 0:r.isEditable)!=!1){if(m.caretPositionFromPoint){let _=m.caretPositionFromPoint(u,h);_&&({offsetNode:b,offset:w}=_)}else if(m.caretRangeFromPoint){let _=m.caretRangeFromPoint(u,h);_&&({startContainer:b,startOffset:w}=_,(!i.contentDOM.contains(b)||ke.safari&&k5(b,w,u)||ke.chrome&&S5(b,w,u))&&(b=void 0))}}if(!b||!i.docView.dom.contains(b)){let _=qt.find(i.docView,d);if(!_)return f>a.top+a.height/2?a.to:a.from;({node:b,offset:w}=am(_.dom,u,h))}let S=i.docView.nearest(b);if(!S)return null;if(S.isWidget&&((s=S.dom)===null||s===void 0?void 0:s.nodeType)==1){let _=S.dom.getBoundingClientRect();return e.y<_.top||e.y<=_.bottom&&e.x<=(_.left+_.right)/2?S.posAtStart:S.posAtEnd}else return S.localPosFromDOM(b,w)+S.posAtStart}function H0(i,e,t,n,r){let s=Math.round((n-e.left)*i.defaultCharacterWidth);if(i.lineWrapping&&t.height>i.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(i.defaultLineHeight-l)*.5)/l);s+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+Ud(o,s,i.state.tabSize)}function k5(i,e,t){let n;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(let r=i.nextSibling;r;r=r.nextSibling)if(r.nodeType!=1||r.nodeName!="BR")return!1;return Es(i,n-1,n).getBoundingClientRect().left>t}function S5(i,e,t){if(e!=0)return!1;for(let r=i;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let n=i.nodeType==1?i.getBoundingClientRect():Es(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function cm(i,e){let t=i.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==Cn.Text))return n}return t}function _5(i,e,t,n){let r=cm(i,e.head),s=!n||r.type!=Cn.Text||!(i.lineWrapping||r.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(r.from),a=i.posAtCoords({x:t==(l==Rt.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return q.cursor(a,t?-1:1)}return q.cursor(t?r.to:r.from,t?-1:1)}function K0(i,e,t,n){let r=i.state.doc.lineAt(e.head),s=i.bidiSpans(r),o=i.textDirectionAt(r.from);for(let l=e,a=null;;){let c=c5(r,s,o,l,t),u=$S;if(!c){if(r.number==(t?i.state.doc.lines:1))return l;u=` -`,r=i.state.doc.line(r.number+(t?1:-1)),s=i.bidiSpans(r),c=i.visualLineSide(r,!t)}if(a){if(!a(u))return l}else{if(!n)return c;a=n(u)}l=c}}function C5(i,e,t){let n=i.state.charCategorizer(e),r=n(t);return s=>{let o=n(s);return r==$t.Space&&(r=o),r==o}}function P5(i,e,t,n){let r=e.head,s=t?1:-1;if(r==(t?i.state.doc.length:0))return q.cursor(r,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),c=i.coordsAtPos(r,e.assoc||-1),u=i.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let d=i.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(r-d.from))),l=(s<0?d.top:d.bottom)+u}let h=a.left+o,f=n??i.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let m=l+(f+d)*s,p=KS(i,{x:h,y:m},!1,s);if(ma.bottom||(s<0?pr)){let g=i.docView.coordsForChar(p),b=!g||m{if(e>s&&er(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:q.cursor(n,ns)&&this.lineBreak(),r=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(t))&&(s=l.index,o=l[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let t=St.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(x5(e,n.node,n.offset)?t:0))}}function x5(i,e,t){for(;;){if(!e||t-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let l=s||o?[]:E5(e),a=new A5(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=R5(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!Gd(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),c=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Gd(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),u=e.viewport;if((ke.ios||ke.chrome)&&e.state.selection.main.empty&&a!=c&&(u.from>0||u.toDate.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=r.from,c=null;(s===8||ke.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:i.state.doc.slice(r.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,r.to))}:(ke.mac||ke.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&i.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=q.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:at.of([" "])}):ke.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` - `&&i.lineWrapping&&(n&&(n=q.single(n.main.anchor-1,n.main.head-1)),t={from:r.from,to:r.to,insert:at.of([" "])}),t)return pp(i,t,n,s);if(n&&!n.main.eq(r)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function pp(i,e,t,n=-1){if(ke.ios&&i.inputState.flushIOSKey(e))return!0;let r=i.state.selection.main;if(ke.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&i.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Oo(i.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.lengthr.head)&&Oo(i.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Oo(i.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=Q5(i,e,t));return i.state.facet(BS).some(a=>a(i,e.from,e.to,s,l))||i.dispatch(l()),!0}function Q5(i,e,t){let n,r=i.state,s=r.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=s.frome.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=r.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(r.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=i.state.sliceDoc(e.from,e.to),u,h=t&&HS(i,t.main.head);if(h){let m=e.insert.length-(e.to-e.from);u={from:h.from,to:h.to-m}}else u=i.state.doc.lineAt(s.head);let f=s.to-e.to,d=s.to-s.from;n=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:l,range:a||m.map(l)};let p=m.to-f,g=p-c.length;if(m.to-m.from!=d||i.state.sliceDoc(g,p)!=c||m.to>=u.from&&m.from<=u.to)return{range:m};let b=r.changes({from:g,to:p,insert:e.insert}),w=m.to-s.to;return{changes:b,range:a?q.range(Math.max(0,a.anchor+w),Math.max(0,a.head+w)):m.map(b)}})}else n={changes:l,selection:a&&r.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:o,scrollIntoView:!0})}function M5(i,e,t,n){let r=Math.min(i.length,e.length),s=0;for(;s0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));t-=o+a-s}if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}else if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function E5(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}=i.observer.selectionRange;return t&&(e.push(new J0(t,n)),(r!=t||s!=n)&&e.push(new J0(r,s))),e}function R5(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?q.single(t+e,n+e):null}class D5{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ke.safari&&e.contentDOM.addEventListener("input",()=>null),ke.gecko&&G5(e.contentDOM.ownerDocument)}handleEvent(e){!X5(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,t);for(let r of n.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=$5(e),n=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&t2.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ke.android&&ke.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return ke.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=e2.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||L5.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:ke.safari&&!ke.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function eb(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(r){_n(t.state,r)}}}function $5(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let r=n.spec;if(r&&r.domEventHandlers)for(let s in r.domEventHandlers){let o=r.domEventHandlers[s];o&&t(s).handlers.push(eb(n.value,o))}if(r&&r.domEventObservers)for(let s in r.domEventObservers){let o=r.domEventObservers[s];o&&t(s).observers.push(eb(n.value,o))}}for(let n in xi)t(n).handlers.push(xi[n]);for(let n in fi)t(n).observers.push(fi[n]);return e}const e2=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],L5="dthko",t2=[16,17,18,20,91,92,224,225],mc=6;function pc(i){return Math.max(0,i)*.7+8}function I5(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}class N5{constructor(e,t,n,r){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=VD(e.contentDOM),this.atoms=e.state.facet(mp).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(tt.allowMultipleSelections)&&Z5(e,t),this.dragging=W5(e,t)&&r2(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&I5(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=GS(this.view);e.clientX-a.left<=r+mc?t=-pc(r-e.clientX):e.clientX+a.right>=o-mc&&(t=pc(e.clientX-o)),e.clientY-a.top<=s+mc?n=-pc(s-e.clientY):e.clientY+a.bottom>=l-mc&&(n=pc(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Z5(i,e){let t=i.state.facet(LS);return t.length?t[0](e):ke.mac?e.metaKey:e.ctrlKey}function B5(i,e){let t=i.state.facet(IS);return t.length?t[0](e):ke.mac?!e.altKey:!e.ctrlKey}function W5(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=ua(i.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function X5(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=St.get(t))&&n.ignoreEvent(e))return!1;return!0}const xi=Object.create(null),fi=Object.create(null),n2=ke.ie&&ke.ie_version<15||ke.ios&&ke.webkit_version<604;function F5(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),i2(i,t.value)},50)}function i2(i,e){let{state:t}=i,n,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(um!=null&&t.selection.ranges.every(a=>a.empty)&&um==s.toString()){let a=-1;n=t.changeByRange(c=>{let u=t.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let h=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:u.from,insert:h},range:q.cursor(c.from+h.length)}})}else o?n=t.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:q.cursor(a.from+c.length)}}):n=t.replaceSelection(s);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}fi.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};xi.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);fi.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};fi.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};xi.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(NS))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=V5(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new N5(i,e,t,n)),n&&i.observer.ignore(()=>{OS(i.contentDOM);let s=i.root.activeElement;s&&!s.contains(i.contentDOM)&&s.blur()});let r=i.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function tb(i,e,t,n){if(n==1)return q.cursor(e,t);if(n==2)return v5(i.state,e,t);{let r=qt.find(i.docView,e),s=i.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return le>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function Y5(i,e,t,n){let r=qt.find(i.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&nb(t,n,o))return-1;let l=r.coordsAt(s,1);return l&&nb(t,n,l)?1:o&&o.bottom>=n?-1:1}function ib(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Y5(i,t,e.clientX,e.clientY)}}const z5=ke.ie&&ke.ie_version<=11;let rb=null,sb=0,ob=0;function r2(i){if(!z5)return i.detail;let e=rb,t=ob;return rb=i,ob=Date.now(),sb=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(sb+1)%3:1}function V5(i,e){let t=ib(i,e),n=r2(e),r=i.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,l){let a=ib(i,s),c,u=tb(i,a.pos,a.bias,n);if(t.pos!=a.pos&&!o){let h=tb(i,t.pos,t.bias,n),f=Math.min(h.from,u.from),d=Math.max(h.to,u.to);u=f1&&(c=U5(r,a.pos))?c:l?r.addRange(u):q.create([u])}}}function U5(i,e){for(let t=0;t=e)return q.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}xi.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let r=i.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=q.range(s,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",i.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};xi.dragend=i=>(i.inputState.draggedContent=null,!1);function lb(i,e,t,n){if(!t)return;let r=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=i.inputState,o=n&&s&&B5(i,e)?{from:s.from,to:s.to}:null,l={from:r,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}xi.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),r=0,s=()=>{++r==t.length&&lb(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),s()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return lb(i,e,n,!0),!0}return!1};xi.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=n2?null:e.clipboardData;return t?(i2(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(F5(i),!1)};function j5(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function q5(i){let e=[],t=[],n=!1;for(let r of i.selection.ranges)r.empty||(e.push(i.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of i.selection.ranges){let o=i.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),r=o.number}n=!0}return{text:e.join(i.lineBreak),ranges:t,linewise:n}}let um=null;xi.copy=xi.cut=(i,e)=>{let{text:t,ranges:n,linewise:r}=q5(i.state);if(!t&&!r)return!1;um=r?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=n2?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(j5(i,t),!1)};const s2=Or.define();function o2(i,e){let t=[];for(let n of i.facet(WS)){let r=n(i,e);r&&t.push(r)}return t?i.update({effects:t,annotations:s2.of(!0)}):null}function l2(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=o2(i.state,e);t?i.dispatch(t):i.update([])}},10)}fi.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),l2(i)};fi.blur=i=>{i.observer.clearSelectionRange(),l2(i)};fi.compositionstart=fi.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};fi.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,ke.chrome&&ke.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};fi.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};xi.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),c=i.posAtDOM(l.endContainer,l.endOffset);return pp(i,{from:a,to:c,insert:i.state.toText(s)},null),!0}}let r;if(ke.chrome&&ke.android&&(r=e2.find(s=>s.inputType==e.inputType))&&(i.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return ke.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),ke.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>fi.compositionend(i,e),20),!1};const ab=new Set;function G5(i){ab.has(i)||(ab.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}const cb=["pre-wrap","normal","pre-line","break-spaces"];let Mo=!1;function ub(){Mo=!1}class H5{constructor(e){this.lineWrapping=e,this.doc=at.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return cb.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Gc&&(Mo=!0),this.height=e)}replace(e,t,n){return Pn.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,r){let s=this,o=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:h}=r[l],f=s.lineAt(a,Et.ByPosNoHeight,n.setDoc(t),0,0),d=f.to>=c?f:s.lineAt(c,Et.ByPosNoHeight,n,0,0);for(h+=d.to-c,c=d.to;l>0&&f.from<=r[l-1].toA;)a=r[l-1].fromA,u=r[l-1].fromB,l--,as*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.blockAt(0,n,r,s))}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Vn extends a2{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,r){return new Zi(r,this.length,n,this.height,this.breaks)}replace(e,t,n){let r=n[0];return n.length==1&&(r instanceof Vn||r instanceof on&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof on?r=new Vn(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Pn.of(n)}updateHeight(e,t=0,n=!1,r){return r&&r.from<=t&&r.more?this.setHeight(r.heights[r.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class on extends Pn{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:l}}blockAt(e,t,n,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let c=r+(e0){let s=n[n.length-1];s instanceof on?n[n.length-1]=new on(s.length+r):n.push(null,new on(r-1))}if(e>0){let s=n[0];s instanceof on?n[0]=new on(e+s.length):n.unshift(new on(e-1),null)}return Pn.of(n)}decomposeLeft(e,t){t.push(new on(e-1),null)}decomposeRight(e,t){t.push(null,new on(this.length-e-1))}updateHeight(e,t=0,n=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],l=Math.max(t,r.from),a=-1;for(r.from>t&&o.push(new on(r.from-t-1).updateHeight(e,t));l<=s&&r.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let h=r.heights[r.index++];a==-1?a=h:Math.abs(h-a)>=Gc&&(a=-2);let f=new Vn(u,h);f.outdated=!1,o.push(f),l+=u+1}l<=s&&o.push(null,new on(s-l).updateHeight(e,l));let c=Pn.of(o);return(a<0||Math.abs(c.height-this.height)>=Gc||Math.abs(a-this.heightMetrics(e,t).perLine)>=Gc)&&(Mo=!0),Tu(this,c)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class J5 extends Pn{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,r){let s=n+this.left.height;return el))return c;let u=t==Et.ByPosNoHeight?Et.ByPosNoHeight:Et.ByPos;return a?c.join(this.right.lineAt(l,u,n,o,l)):this.left.lineAt(l,u,n,r,s).join(c)}forEachLine(e,t,n,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,o);else{let c=this.lineAt(a,Et.ByPos,n,r,s);e=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,n,l,a,o)}}replace(e,t,n){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of n)s.push(l);if(e>0&&hb(s,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Pn.of(this.break?[e,null,t]:[e,t]):(this.left=Tu(this.left,e),this.right=Tu(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,r){let{left:s,right:o}=this,l=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,n,r):s.updateHeight(e,t,n),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,n,r):o.updateHeight(e,l,n),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function hb(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof on&&(n=i[e+1])instanceof on&&i.splice(e-1,3,new on(t.length+1+n.length))}const e$=5;class gp{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Vn?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Vn(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=e$)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Vn(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new on(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Vn)return e;let t=new Vn(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Vn)&&!this.isCovered?this.nodes.push(new Vn(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&h.overflow!="visible"){let f=u.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(c==i.parentNode?r.innerHeight:a,f.bottom)}c=h.position=="absolute"||h.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function r$(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Mf{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new H5(t),this.stateDeco=e.facet(fa).filter(n=>typeof n!="function"),this.heightMap=Pn.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle.setDoc(e.doc),[new ui(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Qe.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let r=n?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new gc(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?db:new Op(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Cl(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(fa).filter(u=>typeof u!="function");let r=e.changedRanges,s=ui.extendWithRanges(r,t$(n,this.stateDeco,e?e.changes:en.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);ub(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Mo)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(FS)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?Rt.RTL:Rt.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:_,scaleY:k}=gS(t,l);(_>.005&&Math.abs(this.scaleX-_)>.005||k>.005&&Math.abs(this.scaleY-k)>.005)&&(this.scaleX=_,this.scaleY=k,c|=8,o=a=!0)}let h=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=vS(e.scrollDOM);let m=(this.printing?r$:i$)(t,this.paddingTop),p=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let w=l.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let _=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(_)&&(o=!0),o||r.lineWrapping&&Math.abs(w-this.contentDOMWidth)>r.charWidth){let{lineHeight:k,charWidth:Q,textHeight:x}=e.docView.measureTextSize();o=k>0&&r.refresh(s,k,Q,x,w/Q,_),o&&(e.docView.minWidth=0,c|=8)}p>0&&g>0?u=Math.max(p,g):p<0&&g<0&&(u=Math.min(p,g)),ub();for(let k of this.viewports){let Q=k.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(k);this.heightMap=(o?Pn.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle,[new ui(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new K5(k.from,Q))}Mo&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new gc(r.lineAt(o-n*1e3,Et.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,Et.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(ca.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=r.lineAt(c,Et.ByPos,s,0,0),f;t.y=="center"?f=(h.top+h.bottom)/2-u/2:t.y=="start"||t.y=="nearest"&&c=l+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=Rt.LTR&&!n)return[];let l=[],a=(u,h,f,d)=>{if(h-uu&&bb.from>=f.from&&b.to<=f.to&&Math.abs(b.from-u)b.fromw));if(!g){if(hb.from<=h&&b.to>=h)){let b=t.moveToLineBoundary(q.cursor(h),!1,!0).head;b>u&&(h=b)}g=new Mf(u,h,this.gapSize(f,u,h,d))}l.push(g)},c=u=>{if(u.lengthu.from&&a(u.from,d,u,h),mt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];it.spans(e,this.viewport.from,this.viewport.to,{span(r,s){t.push({from:r,to:s})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((r,s)=>r.from!=t[s].from||r.to!=t[s].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Cl(this.heightMap.lineAt(e,Et.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Cl(this.heightMap.lineAt(this.scaler.fromDOM(e),Et.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Cl(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class gc{constructor(e,t){this.from=e,this.to=t}}function o$(i,e,t){let n=[],r=i,s=0;return it.spans(t,i,e,{span(){},point(o,l){o>r&&(n.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(n<=l)return s+n;n-=l}}function bc(i,e){let t=0;for(let{from:n,to:r}of i.ranges){if(e<=r){t+=e-n;break}t+=r-n}return t/i.total}function l$(i,e){for(let t of i)if(e(t))return t}const db={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};class Op{constructor(e,t,n){let r=0,s=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let c=t.lineAt(l,Et.ByPos,e,0,0).top,u=t.lineAt(a,Et.ByPos,e,0,0).bottom;return r+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let t=0,n=0,r=0;;t++){let s=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}}function Cl(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new Zi(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(r=>Cl(r,e)):i._content)}const vc=ye.define({combine:i=>i.join(" ")}),hm=ye.define({combine:i=>i.indexOf(!0)>-1}),fm=qr.newName(),c2=qr.newName(),u2=qr.newName(),h2={"&light":"."+c2,"&dark":"."+u2};function dm(i,e,t){return new qr(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return i;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):i+" "+n}})}const a$=dm("."+fm,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},h2),c$={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ef=ke.ie&&ke.ie_version<=11;class u${constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new UD,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(ke.ie&&ke.ie_version<=11||ke.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(ke.chrome&&ke.chrome_version<126)&&(this.editContext=new f$(e),e.state.facet(Dr)&&(e.contentDOM.editContext=this.editContext.editContext)),Ef&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Dr)?n.root.activeElement!=this.dom:!jc(n.dom,r))return;let s=r.anchorNode&&n.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(ke.ie&&ke.ie_version<=11||ke.android&&ke.chrome)&&!n.state.selection.main.empty&&r.focusNode&&zl(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ua(e.root);if(!t)return!1;let n=ke.safari&&e.root.nodeType==11&&FD(this.dom.ownerDocument)==this.dom&&h$(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let r=jc(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Oo(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:r}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),r=this.selectionChanged&&jc(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new T5(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,r=JS(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=mb(t,e.previousSibling||e.target.previousSibling,-1),r=mb(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Dr)!=e.state.facet(Dr)&&(e.view.contentDOM.editContext=e.state.facet(Dr)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function mb(i,e,t){for(;e;){let n=St.get(e);if(n&&n.parent==i)return n;let r=e.parentNode;e=r!=i.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function pb(i,e){let t=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return zl(o.node,o.offset,r,s)&&([t,n,r,s]=[r,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:s}}function h$(i,e){if(e.getComposedRanges){let r=e.getComposedRanges(i.root)[0];if(r)return pb(i,r)}let t=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?pb(i,t):null}class f${constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let{anchor:r}=e.state.selection.main,s={from:this.toEditorPos(n.updateRangeStart),to:this.toEditorPos(n.updateRangeEnd),insert:at.of(n.text.split(` -`))};s.from==this.from&&rthis.to&&(s.to=r),!(s.from==s.to&&!s.insert.length)&&(this.pendingContextChange=s,e.state.readOnly||pp(e,s,q.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;r.push(Qe.mark({attributes:{style:a}}).range(this.toEditorPos(s.rangeStart),this.toEditorPos(s.rangeEnd)))}}e.dispatch({effects:zS.of(Qe.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=ua(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(n)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,t+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=u,this.to+=u;else if(sthis.to||this.to-this.from+c.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}t+=u}),r&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Oe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||jD(e.parent)||document,this.viewState=new fb(e.state||tt.create(e)),e.scrollTo&&e.scrollTo.is(dc)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(kl).map(r=>new xf(r));for(let r of this.plugins)r.update(this);this.observer=new u$(this),this.inputState=new D5(this),this.inputState.ensureHandlers(this.plugins),this.docView=new U0(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof Ht?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(s2))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=o2(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(tt.phrases)!=this.state.facet(tt.phrases))return this.setState(s);r=xu.create(this,s,e),r.flags|=l;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection;h=new bo(d.empty?d:q.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of f.effects)d.is(dc)&&(h=d.value.clip(this.state))}this.viewState.update(r,h),this.bidiCache=Qu.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Sl)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(vc)!=r.state.facet(vc)&&(this.viewState.mustMeasureContent=!0),(t||n||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(lm))try{f(r)}catch(d){_n(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!JS(this,u)&&c.force&&Oo(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new fb(e),this.plugins=e.facet(kl).map(n=>new xf(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new U0(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(kl),n=e.state.facet(kl);if(t!=n){let r=[];for(let s of n){let o=t.indexOf(s);if(o<0)r.push(new xf(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,r=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(vS(n))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(d=>{try{return d.read(this)}catch(m){return _n(this.state,m),gb}}),h=xu.create(this,this.state,[]),f=!1;h.flags|=a,t?t.flags|=a:t=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let d=0;d1||m<-1){r=r+m,n.scrollTop=r/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(lm))l(t)}get themeClasses(){return fm+" "+(this.state.facet(hm)?u2:c2)+" "+this.state.facet(vc)}updateAttrs(){let e=Ob(this,VS,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Dr)?"true":"false",class:"cm-content",style:`${ke.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Ob(this,dp,t);let n=this.observer.ignore(()=>{let r=tm(this.contentDOM,this.contentAttrs,t),s=tm(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let r of n.effects)if(r.is(Oe.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Sl);let e=this.state.facet(Oe.cspNonce);qr.mount(this.root,this.styleModules.concat(a$).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return Qf(this,e,K0(this,e,t,n))}moveByGroup(e,t){return Qf(this,e,K0(this,e,t,n=>C5(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return q.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,n=!0){return _5(this,e,t,n)}moveVertically(e,t,n){return Qf(this,e,P5(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),KS(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[Br.find(s,e-r.from,-1,t)];return hh(n,o.dir==Rt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(XS)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>d$)return DS(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||RS(s.isolates,n=V0(this,e))))return s.order;n||(n=V0(this,e));let r=a5(e.text,t,n);return this.bidiCache.push(new Qu(e.from,e.to,t,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ke.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{OS(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return dc.of(new bo(typeof e=="number"?q.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return dc.of(new bo(q.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Vt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Vt.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=qr.newName(),r=[vc.of(n),Sl.of(dm(`.${n}`,e))];return t&&t.dark&&r.push(hm.of(!0)),r}static baseTheme(e){return gr.lowest(Sl.of(dm("."+fm,e,h2)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),r=n&&St.get(n)||St.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}Oe.styleModule=Sl;Oe.inputHandler=BS;Oe.scrollHandler=YS;Oe.focusChangeEffect=WS;Oe.perLineTextDirection=XS;Oe.exceptionSink=ZS;Oe.updateListener=lm;Oe.editable=Dr;Oe.mouseSelectionStyle=NS;Oe.dragMovesSelection=IS;Oe.clickAddsSelectionRange=LS;Oe.decorations=fa;Oe.outerDecorations=US;Oe.atomicRanges=mp;Oe.bidiIsolatedRanges=jS;Oe.scrollMargins=qS;Oe.darkTheme=hm;Oe.cspNonce=ye.define({combine:i=>i.length?i[0]:""});Oe.contentAttributes=dp;Oe.editorAttributes=VS;Oe.lineWrapping=Oe.contentAttributes.of({class:"cm-lineWrapping"});Oe.announce=Fe.define();const d$=4096,gb={};class Qu{constructor(e,t,n,r,s,o){this.from=e,this.to=t,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:Rt.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=n[r],o=typeof s=="function"?s(i):s;o&&em(o,t)}return t}const m$=ke.mac?"mac":ke.windows?"win":ke.linux?"linux":"key";function p$(i,e){const t=i.split(/-(?!$)/);let n=t[t.length-1];n=="Space"&&(n=" ");let r,s,o,l;for(let a=0;an.concat(r),[]))),t}function O$(i,e,t){return d2(f2(i.state),e,i,t)}let $r=null;const b$=4e3;function v$(i,e=m$){let t=Object.create(null),n=Object.create(null),r=(o,l)=>{let a=n[o];if(a==null)n[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var h,f;let d=t[o]||(t[o]=Object.create(null)),m=l.split(/ (?!$)/).map(b=>p$(b,e));for(let b=1;b{let _=$r={view:S,prefix:w,scope:o};return setTimeout(()=>{$r==_&&($r=null)},b$),!0}]})}let p=m.join(" ");r(p,!1);let g=d[p]||(d[p]={preventDefault:!1,stopPropagation:!1,run:((f=(h=d._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});a&&g.run.push(a),c&&(g.preventDefault=!0),u&&(g.stopPropagation=!0)};for(let o of i){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in u)u[f].run.push(d=>h(d,mm))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let mm=null;function d2(i,e,t,n){mm=e;let r=XD(e),s=ln(r,0),o=oi(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;$r&&$r.view==t&&$r.scope==n&&(l=$r.prefix+" ",t2.indexOf(e.keyCode)<0&&(c=!0,$r=null));let h=new Set,f=g=>{if(g){for(let b of g.run)if(!h.has(b)&&(h.add(b),b(t)))return g.stopPropagation&&(u=!0),!0;g.preventDefault&&(g.stopPropagation&&(u=!0),c=!0)}return!1},d=i[n],m,p;return d&&(f(d[l+wc(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ke.windows&&e.ctrlKey&&e.altKey)&&(m=Gr[e.keyCode])&&m!=r?(f(d[l+wc(m,e,!0)])||e.shiftKey&&(p=ca[e.keyCode])!=r&&p!=m&&f(d[l+wc(p,e,!1)]))&&(a=!0):o&&e.shiftKey&&f(d[l+wc(r,e,!0)])&&(a=!0),!a&&f(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),mm=null,a}class Na{constructor(e,t,n,r,s){this.className=e,this.left=t,this.top=n,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=m2(e);return[new Na(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return w$(e,t,n)}}function m2(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==Rt.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function vb(i,e,t,n){let r=i.coordsAtPos(e,t*2);if(!r)return n;let s=i.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=i.posAtCoords({x:s.left+1,y:o}),a=i.posAtCoords({x:s.right-1,y:o});return l==null||a==null?n:{from:Math.max(n.from,Math.min(l,a)),to:Math.min(n.to,Math.max(l,a))}}function w$(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),r=Math.min(t.to,i.viewport.to),s=i.textDirection==Rt.LTR,o=i.contentDOM,l=o.getBoundingClientRect(),a=m2(i),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),h=l.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),f=l.right-(u?parseInt(u.paddingRight):0),d=cm(i,n),m=cm(i,r),p=d.type==Cn.Text?d:null,g=m.type==Cn.Text?m:null;if(p&&(i.lineWrapping||d.widgetLineBreaks)&&(p=vb(i,n,1,p)),g&&(i.lineWrapping||m.widgetLineBreaks)&&(g=vb(i,r,-1,g)),p&&g&&p.from==g.from&&p.to==g.to)return w(S(t.from,t.to,p));{let k=p?S(t.from,null,p):_(d,!1),Q=g?S(null,t.to,g):_(m,!0),x=[];return(p||d).to<(g||m).from-(p&&g?1:0)||d.widgetLineBreaks>1&&k.bottom+i.defaultLineHeight/2B&&te.from=le)break;ve>ie&&N(Math.max(Te,ie),k==null&&Te<=B,Math.min(ve,le),Q==null&&ve>=J,ee.dir)}if(ie=X.to+1,ie>=le)break}return $.length==0&&N(B,k==null,J,Q==null,i.textDirection),{top:C,bottom:M,horizontal:$}}function _(k,Q){let x=l.top+(Q?k.top:k.bottom);return{top:x,bottom:x,horizontal:[]}}}function y$(i,e){return i.constructor==e.constructor&&i.eq(e)}class k${constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Hc)!=e.state.facet(Hc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(Hc);for(;t!y$(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[n].constructor&&r.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Hc=ye.define();function p2(i){return[Vt.define(e=>new k$(e,i)),Hc.of(i)]}const g2=!ke.ios,da=ye.define({combine(i){return Qi(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function S$(i={}){return[da.of(i),_$,C$,P$,FS.of(!0)]}function O2(i){return i.startState.facet(da)!=i.state.facet(da)}const _$=p2({above:!0,markers(i){let{state:e}=i,t=e.facet(da),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty?!s||g2:t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:q.cursor(r.head,r.head>r.anchor?-1:1);for(let a of Na.forRange(i,o,l))n.push(a)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=O2(i);return t&&wb(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){wb(e.state,i)},class:"cm-cursorLayer"});function wb(i,e){e.style.animationDuration=i.facet(da).cursorBlinkRate+"ms"}const C$=p2({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:Na.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||O2(i)},class:"cm-selectionLayer"}),pm={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};g2&&(pm[".cm-line"].caretColor=pm[".cm-content"].caretColor="transparent !important");const P$=gr.highest(Oe.theme(pm)),b2=Fe.define({map(i,e){return i==null?null:e.mapPos(i)}}),Pl=Jt.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(b2)?n.value:t,i)}}),A$=Vt.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(Pl);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(Pl)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Pl),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Pl)!=i&&this.view.dispatch({effects:b2.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function x$(){return[Pl,A$]}function yb(i,e,t,n,r){e.lastIndex=0;for(let s=i.iterRange(t,n),o=t,l;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;l=e.exec(s.value);)r(o+l.index,l)}function T$(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let n=[];for(let{from:r,to:s}of t)r=Math.max(i.state.doc.lineAt(r).from,r-e),s=Math.min(i.state.doc.lineAt(s).to,s+e),n.length&&n[n.length-1].to>=r?n[n.length-1].to=s:n.push({from:r,to:s});return n}class Q${constructor(e){const{regexp:t,decoration:n,decorate:r,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(l,a,c,u)=>r(u,c,c+l[0].length,l,a);else if(typeof n=="function")this.addMatch=(l,a,c,u)=>{let h=n(l,a,c);h&&u(c,c+l[0].length,h)};else if(n)this.addMatch=(l,a,c,u)=>u(c,c+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new jr,n=t.add.bind(t);for(let{from:r,to:s}of T$(e,this.maxLength))yb(e.state.doc,this.regexp,r,s,(o,l)=>this.addMatch(l,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),n,r):t}updateRange(e,t,n,r){for(let s of e.visibleRanges){let o=Math.max(s.from,n),l=Math.min(s.to,r);if(l>o){let a=e.state.doc.lineAt(o),c=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){u=o;break}for(;lf.push(b.range(p,g));if(a==c)for(this.regexp.lastIndex=u-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,p,m));t=t.update({filterFrom:u,filterTo:h,filter:(p,g)=>ph,add:f})}}return t}}const gm=/x/.unicode!=null?"gu":"g",M$=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,gm),E$={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Rf=null;function R$(){var i;if(Rf==null&&typeof document<"u"&&document.body){let e=document.body.style;Rf=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return Rf||!1}const Kc=ye.define({combine(i){let e=Qi(i,{render:null,specialChars:M$,addSpecialChars:null});return(e.replaceTabs=!R$())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,gm)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,gm)),e}});function D$(i={}){return[Kc.of(i),$$()]}let kb=null;function $$(){return kb||(kb=Vt.fromClass(class{constructor(i){this.view=i,this.decorations=Qe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(Kc)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new Q$({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:r}=t.state,s=ln(e[0],0);if(s==9){let o=r.lineAt(n),l=t.state.tabSize,a=Pi(o.text,l,n-o.from);return Qe.replace({widget:new Z$((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Qe.replace({widget:new N$(i,s)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(Kc);i.startState.facet(Kc)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}const L$="•";function I$(i){return i>=32?L$:i==10?"␤":String.fromCharCode(9216+i)}class N$ extends br{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=I$(this.code),n=e.state.phrase("Control character")+" "+(E$[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class Z$ extends br{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function B$(){return X$}const W$=Qe.line({class:"cm-activeLine"}),X$=Vt.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let r=i.lineBlockAt(n.head);r.from>e&&(t.push(W$.range(r.from)),e=r.from)}return Qe.set(t)}},{decorations:i=>i.decorations}),Om=2e3;function F$(i,e,t){let n=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>Om||t.off>Om||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=n;a<=r;a++){let c=i.doc.line(a);c.length<=l&&s.push(q.range(c.from+o,c.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=n;a<=r;a++){let c=i.doc.line(a),u=Ud(c.text,o,i.tabSize,!0);if(u<0)s.push(q.cursor(c.to));else{let h=Ud(c.text,l,i.tabSize);s.push(q.range(c.from+u,c.from+h))}}}return s}function Y$(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function Sb(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),r=t-n.from,s=r>Om?-1:r==n.length?Y$(i,e.clientX):Pi(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:s,off:r}}function z$(i,e){let t=Sb(i,e),n=i.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),o=r.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(r.changes)}},get(r,s,o){let l=Sb(i,r);if(!l)return n;let a=F$(i.state,t,l);return a.length?o?q.create(a.concat(n.ranges)):q.create(a):n}}:null}function V$(i){let e=t=>t.altKey&&t.button==0;return Oe.mouseSelectionStyle.of((t,n)=>e(n)?z$(t,n):null)}const U$={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},j$={style:"cursor: crosshair"};function q$(i={}){let[e,t]=U$[i.key||"Alt"],n=Vt.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[n,Oe.contentAttributes.of(r=>{var s;return!((s=r.plugin(n))===null||s===void 0)&&s.isDown?j$:null})]}const hl="-10000px";class v2{constructor(e,t,n,r){this.facet=t,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=n(o,s))}update(e,t){var n;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[c]=a),t.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function G$(i){let{win:e}=i;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Df=ye.define({combine:i=>{var e,t,n;return{position:ke.ios?"absolute":((e=i.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||G$}}}),_b=new WeakMap,bp=Vt.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(Df);this.position=e.position,this.parent=e.parent,this.classes=i.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new v2(i,dh,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(Df);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=hl,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=this.view.dom.getBoundingClientRect(),e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(ke.gecko)n=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==hl&&r.style.left=="0px"){let s=r.getBoundingClientRect();n=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(n||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(e=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:i,parent:this.parent?this.container.getBoundingClientRect():i,pos:this.manager.tooltips.map((r,s)=>{let o=this.manager.tooltipViews[s];return o.getCoords?o.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Df).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:n,scaleX:r,scaleY:s}=i,o=[];for(let l=0;l=Math.min(t.bottom,n.bottom)||h.rightMath.min(t.right,n.right)+.1){u.style.top=hl;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=d?7:0,p=f.right-f.left,g=(e=_b.get(c))!==null&&e!==void 0?e:f.bottom-f.top,b=c.offset||K$,w=this.view.textDirection==Rt.LTR,S=f.width>n.right-n.left?w?n.left:n.right-f.width:w?Math.max(n.left,Math.min(h.left-(d?14:0)+b.x,n.right-p)):Math.min(Math.max(n.left,h.left-p+(d?14:0)-b.x),n.right-p),_=this.above[l];!a.strictSide&&(_?h.top-(f.bottom-f.top)-b.yn.bottom)&&_==n.bottom-h.bottom>h.top-n.top&&(_=this.above[l]=!_);let k=(_?h.top-n.top:n.bottom-h.bottom)-m;if(kS&&C.topQ&&(Q=_?C.top-g-2-m:C.bottom+m+2);if(this.position=="absolute"?(u.style.top=(Q-i.parent.top)/s+"px",u.style.left=(S-i.parent.left)/r+"px"):(u.style.top=Q/s+"px",u.style.left=S/r+"px"),d){let C=h.left+(w?b.x:-b.x)-(S+14-7);d.style.left=C/r+"px"}c.overlap!==!0&&o.push({left:S,top:Q,right:x,bottom:Q+g}),u.classList.toggle("cm-tooltip-above",_),u.classList.toggle("cm-tooltip-below",!_),c.positioned&&c.positioned(i.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let i of this.manager.tooltipViews)i.dom.style.top=hl}},{eventObservers:{scroll(){this.maybeMeasure()}}}),H$=Oe.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),K$={x:0,y:0},dh=ye.define({enables:[bp,H$]}),Mu=ye.define({combine:i=>i.reduce((e,t)=>e.concat(t),[])});class mh{static create(e){return new mh(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new v2(e,Mu,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let r=n[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const J$=dh.compute([Mu],i=>{let e=i.facet(Mu);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:mh.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class eL{constructor(e,t,n,r,s){this.view=e,this.source=t,this.field=n,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(u=>u.from<=r&&u.to>=r),c=a&&a.dir==Rt.RTL?-1:1;s=t.x{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>_n(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(bp),t=e?e.manager.tooltips.findIndex(n=>n.create==mh.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&s&&!tL(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(n=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!nL(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const yc=4;function tL(i,e){let t=i.getBoundingClientRect();return e.clientX>=t.left-yc&&e.clientX<=t.right+yc&&e.clientY>=t.top-yc&&e.clientY<=t.bottom+yc}function nL(i,e,t,n,r,s){let o=i.scrollDOM.getBoundingClientRect(),l=i.documentTop+i.documentPadding.top+i.contentHeight;if(o.left>n||o.rightr||Math.min(o.bottom,l)=e&&a<=t}function iL(i,e={}){let t=Fe.define(),n=Jt.define({create(){return[]},update(r,s){if(r.length&&(e.hideOnChange&&(s.docChanged||s.selection)?r=[]:e.hideOn&&(r=r.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let l of r){let a=s.changes.mapPos(l.pos,-1,cn.TrackDel);if(a!=null){let c=Object.assign(Object.create(null),l);c.pos=a,c.end!=null&&(c.end=s.changes.mapPos(c.end)),o.push(c)}}r=o}for(let o of s.effects)o.is(t)&&(r=o.value),o.is(rL)&&(r=[]);return r},provide:r=>Mu.from(r)});return{active:n,extension:[n,Vt.define(r=>new eL(r,i,n,t,e.hoverTime||300)),J$]}}function w2(i,e){let t=i.plugin(bp);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}const rL=Fe.define(),Cb=ye.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function ma(i,e){let t=i.plugin(y2),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}const y2=Vt.fromClass(class{constructor(i){this.input=i.state.facet(pa),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(Cb);this.top=new kc(i,!0,e.topContainer),this.bottom=new kc(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(Cb);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new kc(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new kc(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(pa);if(t!=this.input){let n=t.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of n){let c=this.specs.indexOf(a),u;c<0?(u=a(i.view),l.push(u)):(u=this.panels[c],u.update&&u.update(i)),r.push(u),(u.top?s:o).push(u)}this.specs=n,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>Oe.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class kc{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Pb(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Pb(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Pb(i){let e=i.nextSibling;return i.remove(),e}const pa=ye.define({enables:y2});class Ki extends Qs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ki.prototype.elementClass="";Ki.prototype.toDOM=void 0;Ki.prototype.mapMode=cn.TrackBefore;Ki.prototype.startSide=Ki.prototype.endSide=-1;Ki.prototype.point=!0;const Jc=ye.define(),sL=ye.define(),oL={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>it.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Ul=ye.define();function k2(i){return[S2(),Ul.of(Object.assign(Object.assign({},oL),i))]}const Ab=ye.define({combine:i=>i.some(e=>e)});function S2(i){return[lL]}const lL=Vt.fromClass(class{constructor(i){this.view=i,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(Ul).map(e=>new Tb(i,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!i.state.facet(Ab),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}i.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Ab)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&this.dom.remove();let t=it.iter(this.view.state.facet(Jc),this.view.viewport.from),n=[],r=this.gutters.map(s=>new aL(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==Cn.Text&&o){bm(t,n,l.from);for(let a of r)a.line(this.view,l,n);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==Cn.Text){bm(t,n,s.from);for(let o of r)o.line(this.view,s,n)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();i&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(i){let e=i.startState.facet(Ul),t=i.state.facet(Ul),n=i.docChanged||i.heightChanged||i.viewportChanged||!it.eq(i.startState.facet(Jc),i.state.facet(Jc),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(i)&&(n=!0);else{n=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new Tb(this.view,s)):(this.gutters[o].update(i),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)this.dom.appendChild(s.dom);this.gutters=r}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove()}},{provide:i=>Oe.scrollMargins.of(e=>{let t=e.plugin(i);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Rt.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function xb(i){return Array.isArray(i)?i:[i]}function bm(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}class aL{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=it.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let l=new _2(e,o,s,n);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,n);this.height=t.bottom,this.i++}line(e,t,n){let r=[];bm(this.cursor,r,t.from),n.length&&(r=r.concat(n));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),r=n?[n]:null;for(let s of e.state.facet(sL)){let o=s(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Tb{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,l,r)&&r.preventDefault()});this.markers=xb(t.markers(e)),t.initialSpacer&&(this.spacer=new _2(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=xb(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let n=e.view.viewport;return!it.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class _2{constructor(e,t,n,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,r)}update(e,t,n,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),cL(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let n="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=ss(l,a,c)||o(l,a,c):o}return n}})}});class $f extends Ki{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Lf(i,e){return i.state.facet(ro).formatNumber(e,i.state)}const fL=Ul.compute([ro],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(uL)},lineMarker(e,t,n){return n.some(r=>r.toDOM)?null:new $f(Lf(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let r of e.state.facet(hL)){let s=r(e,t,n);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(ro)!=e.state.facet(ro),initialSpacer(e){return new $f(Lf(e,Qb(e.state.doc.lines)))},updateSpacer(e,t){let n=Lf(t.view,Qb(t.view.state.doc.lines));return n==e.number?e:new $f(n)},domEventHandlers:i.facet(ro).domEventHandlers}));function dL(i={}){return[ro.of(i),S2(),fL]}function Qb(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.head).from;r>t&&(t=r,e.push(mL.range(r)))}return it.of(e)});function gL(){return pL}const C2=1024;let OL=0;class li{constructor(e,t){this.from=e,this.to=t}}class Ze{constructor(e={}){this.id=OL++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=tn.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}Ze.closedBy=new Ze({deserialize:i=>i.split(" ")});Ze.openedBy=new Ze({deserialize:i=>i.split(" ")});Ze.group=new Ze({deserialize:i=>i.split(" ")});Ze.isolate=new Ze({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});Ze.contextHash=new Ze({perNode:!0});Ze.lookAhead=new Ze({perNode:!0});Ze.mounted=new Ze({perNode:!0});class ga{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Ze.mounted.id]}}const bL=Object.create(null);class tn{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):bL,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new tn(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Ze.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(Ze.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}}tn.none=new tn("",Object.create(null),0,8);class Za{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|Pt.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:yp(tn.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new gt(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new gt(tn.none,t,n,r)))}static build(e){return kL(e)}}gt.empty=new gt(tn.none,[],[],0);class vp{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new vp(this.buffer,this.index)}}class Kr{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return tn.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function Oa(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=c;e+=t){let u=l[e],h=a[e]+o.from;if(P2(r,n,h,h+u.length)){if(u instanceof Kr){if(s&Pt.ExcludeBuffers)continue;let f=u.findChild(0,u.buffer.length,t,n-h,r);if(f>-1)return new Fi(new vL(o,u,e,h),null,f)}else if(s&Pt.IncludeAnonymous||!u.type.isAnonymous||wp(u)){let f;if(!(s&Pt.IgnoreMounts)&&(f=ga.get(u))&&!f.overlay)return new On(f.tree,h,e,o);let d=new On(u,h,e,o);return s&Pt.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?u.children.length-1:0,t,n,r)}}}if(s&Pt.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let r;if(!(n&Pt.IgnoreOverlays)&&(r=ga.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:o,to:l}of r.overlay)if((t>0?o<=s:o=s:l>s))return new On(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Eb(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function vm(i,e,t=e.length-1){for(let n=i.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class vL{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class Fi extends A2{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new Fi(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&Pt.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Fi(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Fi(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Fi(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new gt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function x2(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let l=new On(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(Oa(l,e,t,!1))}}return r?x2(r):n}class Eu{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof On)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof On?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&Pt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Pt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Pt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&Pt.IncludeAnonymous||l instanceof Kr||!l.type.isAnonymous||wp(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return vm(this.node,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function wp(i){return i.children.some(e=>e instanceof Kr||!e.type.isAnonymous||wp(e))}function kL(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=C2,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new vp(t,t.length):t,a=n.types,c=0,u=0;function h(k,Q,x,C,M,$){let{id:N,start:B,end:J,size:te}=l,ie=u;for(;te<0;)if(l.next(),te==-1){let ve=s[N];x.push(ve),C.push(B-k);return}else if(te==-3){c=N;return}else if(te==-4){u=N;return}else throw new RangeError(`Unrecognized record size: ${te}`);let le=a[N],X,ee,Te=B-k;if(J-B<=r&&(ee=g(l.pos-Q,M))){let ve=new Uint16Array(ee.size-ee.skip),Ue=l.pos-ee.size,ne=ve.length;for(;l.pos>Ue;)ne=b(ee.start,ve,ne);X=new Kr(ve,J-ee.start,n),Te=ee.start-k}else{let ve=l.pos-te;l.next();let Ue=[],ne=[],Ee=N>=o?N:-1,Re=0,xt=J;for(;l.pos>ve;)Ee>=0&&l.id==Ee&&l.size>=0?(l.end<=xt-r&&(m(Ue,ne,B,Re,l.end,xt,Ee,ie),Re=Ue.length,xt=l.end),l.next()):$>2500?f(B,ve,Ue,ne):h(B,ve,Ue,ne,Ee,$+1);if(Ee>=0&&Re>0&&Re-1&&Re>0){let H=d(le);X=yp(le,Ue,ne,0,Ue.length,0,J-B,H,H)}else X=p(le,Ue,ne,J-B,ie-J)}x.push(X),C.push(Te)}function f(k,Q,x,C){let M=[],$=0,N=-1;for(;l.pos>Q;){let{id:B,start:J,end:te,size:ie}=l;if(ie>4)l.next();else{if(N>-1&&J=0;te-=3)B[ie++]=M[te],B[ie++]=M[te+1]-J,B[ie++]=M[te+2]-J,B[ie++]=ie;x.push(new Kr(B,M[2]-J,n)),C.push(J-k)}}function d(k){return(Q,x,C)=>{let M=0,$=Q.length-1,N,B;if($>=0&&(N=Q[$])instanceof gt){if(!$&&N.type==k&&N.length==C)return N;(B=N.prop(Ze.lookAhead))&&(M=x[$]+N.length+B)}return p(k,Q,x,C,M)}}function m(k,Q,x,C,M,$,N,B){let J=[],te=[];for(;k.length>C;)J.push(k.pop()),te.push(Q.pop()+x-M);k.push(p(n.types[N],J,te,$-M,B-$)),Q.push(M-x)}function p(k,Q,x,C,M=0,$){if(c){let N=[Ze.contextHash,c];$=$?[N].concat($):[N]}if(M>25){let N=[Ze.lookAhead,M];$=$?[N].concat($):[N]}return new gt(k,Q,x,C,$)}function g(k,Q){let x=l.fork(),C=0,M=0,$=0,N=x.end-r,B={size:0,start:0,skip:0};e:for(let J=x.pos-k;x.pos>J;){let te=x.size;if(x.id==Q&&te>=0){B.size=C,B.start=M,B.skip=$,$+=4,C+=4,x.next();continue}let ie=x.pos-te;if(te<0||ie=o?4:0,X=x.start;for(x.next();x.pos>ie;){if(x.size<0)if(x.size==-3)le+=4;else break e;else x.id>=o&&(le+=4);x.next()}M=X,C+=te,$+=le}return(Q<0||C==k)&&(B.size=C,B.start=M,B.skip=$),B.size>4?B:void 0}function b(k,Q,x){let{id:C,start:M,end:$,size:N}=l;if(l.next(),N>=0&&C4){let J=l.pos-(N-4);for(;l.pos>J;)x=b(k,Q,x)}Q[--x]=B,Q[--x]=$-k,Q[--x]=M-k,Q[--x]=C}else N==-3?c=C:N==-4&&(u=C);return x}let w=[],S=[];for(;l.pos>0;)h(i.start||0,i.bufferStart||0,w,S,-1,0);let _=(e=i.length)!==null&&e!==void 0?e:w.length?S[0]+w[0].length:0;return new gt(a[i.topID],w.reverse(),S.reverse(),_)}const Rb=new WeakMap;function eu(i,e){if(!i.isAnonymous||e instanceof Kr||e.type!=i)return 1;let t=Rb.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof gt)){t=1;break}t+=eu(i,n)}Rb.set(e,t)}return t}function yp(i,e,t,n,r,s,o,l,a){let c=0;for(let m=n;m=u)break;Q+=x}if(S==_+1){if(Q>u){let x=m[_];d(x.children,x.positions,0,x.children.length,p[_]+w);continue}h.push(m[_])}else{let x=p[S-1]+m[S-1].length-k;h.push(yp(i,m,p,_,S,k,x,null,a))}f.push(k+w-s)}}return d(e,t,n,r,0),(l||a)(h,f,o)}class T2{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof Fi?this.setBuffer(e.context.buffer,e.index,t):e instanceof On&&this.map.set(e.tree,t)}get(e){return e instanceof Fi?this.getBuffer(e.context.buffer,e.index):e instanceof On?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class cr{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new cr(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l=n)for(;o&&o.from=f.from||h<=f.to||c){let d=Math.max(f.from,a)-c,m=Math.min(f.to,h)-c;f=d>=m?null:new cr(d,m,f.tree,f.offset+c,l>0,!!u)}if(f&&r.push(f),o.to>h)break;o=snew li(r.from,r.to)):[new li(0,0)]:[new li(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}}class SL{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Q2(i){return(e,t,n,r)=>new CL(e,i,t,n,r)}class Db{constructor(e,t,n,r,s){this.parser=e,this.parse=t,this.overlay=n,this.target=r,this.from=s}}function $b(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class _L{constructor(e,t,n,r,s,o,l){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const wm=new Ze({perNode:!0});class CL{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new gt(n.type,n.children,n.positions,n.length,n.propValues.concat([[wm,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Ze.mounted.id]=new ga(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let c=t.mounts.find(u=>u.frag.from<=r.from&&u.frag.to>=r.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let h=u.from+c.pos,f=u.to+c.pos;h>=r.from&&f<=r.to&&!t.ranges.some(d=>d.fromh)&&t.ranges.push({from:h,to:f})}}l=!1}else if(n&&(o=PL(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew li(h.from-r.from,h.to-r.from)):null,r.tree,u.length?u[0].from:r.from)),s.overlay?u.length&&(n={ranges:u,depth:0,prev:n}):l=!1}}else t&&(a=t.predicate(r))&&(a===!0&&(a=new li(r.from,r.to)),a.fromnew li(u.from-t.start,u.to-t.start)),t.target,c[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function PL(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Lb(i,e,t,n,r,s){if(e=e&&t.enter(n,1,Pt.IgnoreOverlays|Pt.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof gt)t=t.children[0];else break}return!1}}let xL=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(wm))!==null&&t!==void 0?t:n.to,this.inner=new Ib(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(wm))!==null&&e!==void 0?e:t.to,this.inner=new Ib(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(Ze.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function Nb(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new li(l,a.to))):a.to>l?t[s--]=new li(l,a.to):t.splice(s--,1))}}return n}function TL(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,c=[];for(;;){let u=r==i.length?1e9:o?i[r].to:i[r].from,h=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,t),d=Math.min(u,h,n);fnew li(f.from+n,f.to+n)),h=TL(e,u,a,c);for(let f=0,d=a;;f++){let m=f==h.length,p=m?c:h[f].from;if(p>d&&t.push(new cr(d,p,r.tree,-o,s.from>=d||s.openStart,s.to<=p||s.openEnd)),m)break;d=h[f].to}}else t.push(new cr(a,c,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}let QL=0;class jn{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=QL++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof jn&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new jn(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Ru(e);return n=>n.modified.indexOf(t)>-1?n:Ru.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}}let ML=0;class Ru{constructor(e){this.name=e,this.instances=[],this.id=ML++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&EL(t,l.modified));if(n)return n;let r=[],s=new jn(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=RL(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Ru.get(l,a));return s}}function EL(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function RL(i){let e=[[]];for(let t=0;tn.length-t.length)}function Ws(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let h=0;;){if(l=="..."&&h>0&&h+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==r.length)break;let d=r[h++];if(h==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(h)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new Du(n,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return M2.add(e)}const M2=new Ze;class Du{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let c=t[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:n}}function DL(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function $L(i,e,t,n=0,r=i.length){let s=new LL(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}class LL{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=r,u=IL(e)||Du.empty,h=DL(s,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(r+=(r?" ":"")+h)),this.startSpan(Math.max(t,l),c),u.opaque)return;let f=e.tree&&e.tree.prop(Ze.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+l,1),m=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),p=e.firstChild();for(let g=0,b=l;;g++){let w=g=S||!e.nextSibling())););if(!w||S>n)break;b=w.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,w.from+l),Math.min(n,b),"",m),this.startSpan(Math.min(n,b),c))}p&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}}function IL(i){let e=i.type.prop(M2);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const de=jn.define,_c=de(),Qr=de(),Bb=de(Qr),Wb=de(Qr),Mr=de(),Cc=de(Mr),If=de(Mr),Ii=de(),us=de(Ii),$i=de(),Li=de(),ym=de(),fl=de(ym),Pc=de(),I={comment:_c,lineComment:de(_c),blockComment:de(_c),docComment:de(_c),name:Qr,variableName:de(Qr),typeName:Bb,tagName:de(Bb),propertyName:Wb,attributeName:de(Wb),className:de(Qr),labelName:de(Qr),namespace:de(Qr),macroName:de(Qr),literal:Mr,string:Cc,docString:de(Cc),character:de(Cc),attributeValue:de(Cc),number:If,integer:de(If),float:de(If),bool:de(Mr),regexp:de(Mr),escape:de(Mr),color:de(Mr),url:de(Mr),keyword:$i,self:de($i),null:de($i),atom:de($i),unit:de($i),modifier:de($i),operatorKeyword:de($i),controlKeyword:de($i),definitionKeyword:de($i),moduleKeyword:de($i),operator:Li,derefOperator:de(Li),arithmeticOperator:de(Li),logicOperator:de(Li),bitwiseOperator:de(Li),compareOperator:de(Li),updateOperator:de(Li),definitionOperator:de(Li),typeOperator:de(Li),controlOperator:de(Li),punctuation:ym,separator:de(ym),bracket:fl,angleBracket:de(fl),squareBracket:de(fl),paren:de(fl),brace:de(fl),content:Ii,heading:us,heading1:de(us),heading2:de(us),heading3:de(us),heading4:de(us),heading5:de(us),heading6:de(us),contentSeparator:de(Ii),list:de(Ii),quote:de(Ii),emphasis:de(Ii),strong:de(Ii),link:de(Ii),monospace:de(Ii),strikethrough:de(Ii),inserted:de(),deleted:de(),changed:de(),invalid:de(),meta:Pc,documentMeta:de(Pc),annotation:de(Pc),processingInstruction:de(Pc),definition:jn.defineModifier("definition"),constant:jn.defineModifier("constant"),function:jn.defineModifier("function"),standard:jn.defineModifier("standard"),local:jn.defineModifier("local"),special:jn.defineModifier("special")};for(let i in I){let e=I[i];e instanceof jn&&(e.name=i)}E2([{tag:I.link,class:"tok-link"},{tag:I.heading,class:"tok-heading"},{tag:I.emphasis,class:"tok-emphasis"},{tag:I.strong,class:"tok-strong"},{tag:I.keyword,class:"tok-keyword"},{tag:I.atom,class:"tok-atom"},{tag:I.bool,class:"tok-bool"},{tag:I.url,class:"tok-url"},{tag:I.labelName,class:"tok-labelName"},{tag:I.inserted,class:"tok-inserted"},{tag:I.deleted,class:"tok-deleted"},{tag:I.literal,class:"tok-literal"},{tag:I.string,class:"tok-string"},{tag:I.number,class:"tok-number"},{tag:[I.regexp,I.escape,I.special(I.string)],class:"tok-string2"},{tag:I.variableName,class:"tok-variableName"},{tag:I.local(I.variableName),class:"tok-variableName tok-local"},{tag:I.definition(I.variableName),class:"tok-variableName tok-definition"},{tag:I.special(I.variableName),class:"tok-variableName2"},{tag:I.definition(I.propertyName),class:"tok-propertyName tok-definition"},{tag:I.typeName,class:"tok-typeName"},{tag:I.namespace,class:"tok-namespace"},{tag:I.className,class:"tok-className"},{tag:I.macroName,class:"tok-macroName"},{tag:I.propertyName,class:"tok-propertyName"},{tag:I.operator,class:"tok-operator"},{tag:I.comment,class:"tok-comment"},{tag:I.meta,class:"tok-meta"},{tag:I.invalid,class:"tok-invalid"},{tag:I.punctuation,class:"tok-punctuation"}]);var Nf;const ys=new Ze;function Sp(i){return ye.define({combine:i?e=>e.concat(i):void 0})}const _p=new Ze;class ai{constructor(e,t,n=[],r=""){this.data=e,this.name=r,tt.prototype.hasOwnProperty("tree")||Object.defineProperty(tt.prototype,"tree",{get(){return At(this)}}),this.parser=t,this.extension=[Jr.of(this),tt.languageData.of((s,o,l)=>{let a=Xb(s,o,l),c=a.type.prop(ys);if(!c)return[];let u=s.facet(c),h=a.type.prop(_p);if(h){let f=a.resolve(o-a.from,l);for(let d of h)if(d.test(f,s)){let m=s.facet(d.facet);return d.type=="replace"?m:m.concat(u)}}return u})].concat(n)}isActiveAt(e,t,n=-1){return Xb(e,t,n).type.prop(ys)==this.data}findRegions(e){let t=e.facet(Jr);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(ys)==this.data){n.push({from:o,to:o+s.length});return}let l=s.prop(Ze.mounted);if(l){if(l.tree.prop(ys)==this.data){if(l.overlay)for(let a of l.overlay)n.push({from:a.from+o,to:a.to+o});else n.push({from:o,to:o+s.length});return}else if(l.overlay){let a=n.length;if(r(l.tree,l.overlay[0].from+o),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ds(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function At(i){let e=i.field(ai.state,!1);return e?e.tree:gt.empty}class NL{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let dl=null;class ba{constructor(e,t,n=[],r,s,o,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new ba(e,t,[],gt.empty,0,n,[],null)}startParse(){return this.parser.startParse(new NL(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=gt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(cr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=dl;dl=this;try{return e()}finally{dl=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Fb(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,h,f)=>a.push({fromA:c,toA:u,fromB:h,toB:f})),n=cr.applyChanges(n,a),r=gt.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);ue.from&&(this.fragments=Fb(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends kp{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=dl;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new gt(tn.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return dl}}function Fb(i,e,t){return cr.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}class Eo{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new Eo(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=ba.create(e.facet(Jr).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new Eo(n)}}ai.state=Jt.define({create:Eo.init,update(i,e){for(let t of e.effects)if(t.is(ai.setState))return t.value;return e.startState.facet(Jr)!=e.state.facet(Jr)?Eo.init(e.state):i.apply(e)}});let R2=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(R2=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Zf=typeof navigator<"u"&&(!((Nf=navigator.scheduling)===null||Nf===void 0)&&Nf.isInputPending)?()=>navigator.scheduling.isInputPending():null,ZL=Vt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(ai.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(ai.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=R2(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>Zf&&Zf()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ai.setState.of(new Eo(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>_n(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Jr=ye.define({combine(i){return i.length?i[0]:null},enables:i=>[ai.state,ZL,Oe.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]});class Ro{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class $u{constructor(e,t,n,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new $u(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let n=/\.([^.]+)$/.exec(t);if(n){for(let r of e)if(r.extensions.indexOf(n[1])>-1)return r}return null}static matchLanguageName(e,t,n=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(n)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}}const BL=ye.define(),Ba=ye.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Lu(i){let e=i.facet(Ba);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function va(i,e){let t="",n=i.tabSize,r=i.facet(Ba)[0];if(r==" "){for(;e>=n;)t+=" ",e-=n;r=" "}for(let s=0;s=e?WL(i,t,e):null}class ph{constructor(e,t={}){this.state=e,this.options=t,this.unit=Lu(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,t=e.length){return Pi(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Yo=new Ze;function WL(i,e,t){let n=e.resolveStack(t),r=n.node.enterUnfinishedNodesBefore(t);if(r!=n.node){let s=[];for(let o=r;o!=n.node;o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return D2(n,i,t)}function D2(i,e,t){for(let n=i;n;n=n.next){let r=FL(n.node);if(r)return r(Pp.create(e,t,n))}return 0}function XL(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function FL(i){let e=i.type.prop(Yo);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(Ze.closedBy))){let r=i.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>$2(o,!0,1,void 0,s&&!XL(o)?r.from:void 0)}return i.parent==null?YL:null}function YL(){return 0}class Pp extends ph{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Pp(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(zL(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return D2(this.context.next,this.base,this.pos)}}function zL(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function VL(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let r=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==n)return null;if(!a.type.isSkipped)return a.from$2(n,e,t,i)}function $2(i,e,t,n,r){let s=i.textAfter,o=s.match(/^\s*/)[0].length,l=n&&s.slice(o,o+n.length)==n||r==i.pos+o,a=e?VL(i):null;return a?l?i.column(a.from):i.column(a.to):i.baseIndent+(l?0:i.unit*t)}const jL=i=>i.baseIndent;function vo({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const qL=200;function GL(){return tt.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:n}=i.newSelection.main,r=t.lineAt(n);if(n>r.from+qL)return i;let s=t.sliceString(r.from,n);if(!e.some(c=>c.test(s)))return i;let{state:o}=i,l=-1,a=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==l)continue;l=u.from;let h=Cp(o,u.from);if(h==null)continue;let f=/^\s*/.exec(u.text)[0],d=va(o,h);f!=d&&a.push({from:u.from,to:u.from+f.length,insert:d})}return a.length?[i,{changes:a,sequential:!0}]:i})}const L2=ye.define(),Xs=new Ze;function Ap(i){let e=i.firstChild,t=i.lastChild;return e&&e.tot)continue;if(s&&l.from=e&&c.to>t&&(s=c)}}return s}function KL(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function Iu(i,e,t){for(let n of i.facet(L2)){let r=n(i,e,t);if(r)return r}return HL(i,e,t)}function I2(i,e){let t=e.mapPos(i.from,1),n=e.mapPos(i.to,-1);return t>=n?void 0:{from:t,to:n}}const gh=Fe.define({map:I2}),Wa=Fe.define({map:I2});function N2(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(i.lineBlockAt(t));return e}const $s=Jt.define({create(){return Qe.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(gh)&&!JL(i,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(W2),r=n?Qe.replace({widget:new o6(n(e.state,t.value))}):Yb;i=i.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(Wa)&&(i=i.update({filter:(n,r)=>t.value.from!=n||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;i.between(n,n,(r,s)=>{rn&&(t=!0)}),t&&(i=i.update({filterFrom:n,filterTo:n,filter:(r,s)=>s<=n||r>=n}))}return i},provide:i=>Oe.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(n,r)=>{t.push(n,r)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!r||r.from>s)&&(r={from:s,to:o})}),r}function JL(i,e,t){let n=!1;return i.between(e,e,(r,s)=>{r==e&&s==t&&(n=!0)}),n}function Z2(i,e){return i.field($s,!1)?e:e.concat(Fe.appendConfig.of(X2()))}const e6=i=>{for(let e of N2(i)){let t=Iu(i.state,e.from,e.to);if(t)return i.dispatch({effects:Z2(i.state,[gh.of(t),B2(i,t)])}),!0}return!1},t6=i=>{if(!i.state.field($s,!1))return!1;let e=[];for(let t of N2(i)){let n=Nu(i.state,t.from,t.to);n&&e.push(Wa.of(n),B2(i,n,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function B2(i,e,t=!0){let n=i.state.doc.lineAt(e.from).number,r=i.state.doc.lineAt(e.to).number;return Oe.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${i.state.phrase("to")} ${r}.`)}const n6=i=>{let{state:e}=i,t=[];for(let n=0;n{let e=i.state.field($s,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(n,r)=>{t.push(Wa.of({from:n,to:r}))}),i.dispatch({effects:t}),!0},r6=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e6},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t6},{key:"Ctrl-Alt-[",run:n6},{key:"Ctrl-Alt-]",run:i6}],s6={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},W2=ye.define({combine(i){return Qi(i,s6)}});function X2(i){return[$s,c6]}function F2(i,e){let{state:t}=i,n=t.facet(W2),r=o=>{let l=i.lineBlockAt(i.posAtDOM(o.target)),a=Nu(i.state,l.from,l.to);a&&i.dispatch({effects:Wa.of(a)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(i,r,e);let s=document.createElement("span");return s.textContent=n.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const Yb=Qe.replace({widget:new class extends br{toDOM(i){return F2(i,null)}}});class o6 extends br{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return F2(e,this.value)}}const l6={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Bf extends Ki{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function a6(i={}){let e=Object.assign(Object.assign({},l6),i),t=new Bf(e,!0),n=new Bf(e,!1),r=Vt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Jr)!=o.state.facet(Jr)||o.startState.field($s,!1)!=o.state.field($s,!1)||At(o.startState)!=At(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new jr;for(let a of o.viewportLineBlocks){let c=Nu(o.state,a.from,a.to)?n:Iu(o.state,a.from,a.to)?t:null;c&&l.add(a.from,a.from,c)}return l.finish()}}),{domEventHandlers:s}=e;return[r,k2({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(r))===null||l===void 0?void 0:l.markers)||it.empty},initialSpacer(){return new Bf(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let c=Nu(o.state,l.from,l.to);if(c)return o.dispatch({effects:Wa.of(c)}),!0;let u=Iu(o.state,l.from,l.to);return u?(o.dispatch({effects:gh.of(u)}),!0):!1}})}),X2()]}const c6=Oe.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Oh{constructor(e,t){this.specs=e;let n;function r(l){let a=qr.newName();return(n||(n=Object.create(null)))["."+a]=l,a}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof ai?l=>l.prop(ys)==o.data:o?l=>l==o:void 0,this.style=E2(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=n?new qr(n):null,this.themeType=t.themeType}static define(e,t){return new Oh(e,t||{})}}const km=ye.define(),Y2=ye.define({combine(i){return i.length?[i[0]]:null}});function Wf(i){let e=i.facet(km);return e.length?e:i.facet(Y2)}function u6(i,e){let t=[f6],n;return i instanceof Oh&&(i.module&&t.push(Oe.styleModule.of(i.module)),n=i.themeType),e!=null&&e.fallback?t.push(Y2.of(i)):n?t.push(km.computeN([Oe.darkTheme],r=>r.facet(Oe.darkTheme)==(n=="dark")?[i]:[])):t.push(km.of(i)),t}class h6{constructor(e){this.markCache=Object.create(null),this.tree=At(e.state),this.decorations=this.buildDeco(e,Wf(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=At(e.state),n=Wf(e.state),r=n!=Wf(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return Qe.none;let n=new jr;for(let{from:r,to:s}of e.visibleRanges)$L(this.tree,t,(o,l,a)=>{n.add(o,l,this.markCache[a]||(this.markCache[a]=Qe.mark({class:a})))},r,s);return n.finish()}}const f6=gr.high(Vt.fromClass(h6,{decorations:i=>i.decorations})),d6=Oh.define([{tag:I.meta,color:"#404740"},{tag:I.link,textDecoration:"underline"},{tag:I.heading,textDecoration:"underline",fontWeight:"bold"},{tag:I.emphasis,fontStyle:"italic"},{tag:I.strong,fontWeight:"bold"},{tag:I.strikethrough,textDecoration:"line-through"},{tag:I.keyword,color:"#708"},{tag:[I.atom,I.bool,I.url,I.contentSeparator,I.labelName],color:"#219"},{tag:[I.literal,I.inserted],color:"#164"},{tag:[I.string,I.deleted],color:"#a11"},{tag:[I.regexp,I.escape,I.special(I.string)],color:"#e40"},{tag:I.definition(I.variableName),color:"#00f"},{tag:I.local(I.variableName),color:"#30a"},{tag:[I.typeName,I.namespace],color:"#085"},{tag:I.className,color:"#167"},{tag:[I.special(I.variableName),I.macroName],color:"#256"},{tag:I.definition(I.propertyName),color:"#00c"},{tag:I.comment,color:"#940"},{tag:I.invalid,color:"#f00"}]),m6=Oe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),z2=1e4,V2="()[]{}",U2=ye.define({combine(i){return Qi(i,{afterCursor:!0,brackets:V2,maxScanDistance:z2,renderMatch:O6})}}),p6=Qe.mark({class:"cm-matchingBracket"}),g6=Qe.mark({class:"cm-nonmatchingBracket"});function O6(i){let e=[],t=i.matched?p6:g6;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}const b6=Jt.define({create(){return Qe.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet(U2);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=Yi(e.state,r.head,-1,n)||r.head>0&&Yi(e.state,r.head-1,1,n)||n.afterCursor&&(Yi(e.state,r.head,1,n)||r.headOe.decorations.from(i)}),v6=[b6,m6];function w6(i={}){return[U2.of(i),v6]}const j2=new Ze;function Sm(i,e,t){let n=i.prop(e<0?Ze.openedBy:Ze.closedBy);if(n)return n;if(i.name.length==1){let r=t.indexOf(i.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function _m(i){let e=i.type.prop(j2);return e?e(i.node):i}function Yi(i,e,t,n={}){let r=n.maxScanDistance||z2,s=n.brackets||V2,o=At(i),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let c=Sm(a.type,t,s);if(c&&a.from0?e>=u.from&&eu.from&&e<=u.to))return y6(i,e,t,a,u,c,s)}}return k6(i,e,t,o,l.type,r,s)}function y6(i,e,t,n,r,s,o){let l=n.parent,a={from:r.from,to:r.to},c=0,u=l==null?void 0:l.cursor();if(u&&(t<0?u.childBefore(n.from):u.childAfter(n.to)))do if(t<0?u.to<=n.from:u.from>=n.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=i.doc.iterRange(e,t>0?i.doc.length:0),h=0;for(let f=0;!u.next().done&&f<=s;){let d=u.value;t<0&&(f+=d.length);let m=e+f*t;for(let p=t>0?0:d.length-1,g=t>0?d.length:-1;p!=g;p+=t){let b=o.indexOf(d[p]);if(!(b<0||n.resolveInner(m+p,1).type!=r))if(b%2==0==t>0)h++;else{if(h==1)return{start:c,end:{from:m+p,to:m+p+1},matched:b>>1==a>>1};h--}}t>0&&(f+=d.length)}return u.done?{start:c,matched:!1}:null}const S6=Object.create(null),zb=[tn.none],Vb=[],Ub=Object.create(null),_6=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])_6[i]=C6(S6,e);function Xf(i,e){Vb.indexOf(i)>-1||(Vb.push(i),console.warn(e))}function C6(i,e){let t=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=i[c]||I[c];u?typeof u=="function"?a.length?a=a.map(u):Xf(c,`Modifier ${c} used at start of tag`):a.length?Xf(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:Xf(c,`Unknown highlighting tag ${c}`)}for(let c of a)t.push(c)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+t.map(l=>l.id),s=Ub[r];if(s)return s.id;let o=Ub[r]=tn.define({id:zb.length,name:n,props:[Ws({[n]:t})]});return zb.push(o),o.id}Rt.RTL,Rt.LTR;const P6=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=Tp(i.state,t.from);return n.line?A6(i):n.block?T6(i):!1};function xp(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=i(e,t);return r?(n(t.update(r)),!0):!1}}const A6=xp(E6,0),x6=xp(q2,0),T6=xp((i,e)=>q2(i,e,M6(e)),0);function Tp(i,e){let t=i.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const ml=50;function Q6(i,{open:e,close:t},n,r){let s=i.sliceDoc(n-ml,n),o=i.sliceDoc(r,r+ml),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,c=s.length-l;if(s.slice(c-e.length,c)==e&&o.slice(a,a+t.length)==t)return{open:{pos:n-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let u,h;r-n<=2*ml?u=h=i.sliceDoc(n,r):(u=i.sliceDoc(n,n+ml),h=i.sliceDoc(r-ml,r));let f=/^\s*/.exec(u)[0].length,d=/\s*$/.exec(h)[0].length,m=h.length-d-t.length;return u.slice(f,f+e.length)==e&&h.slice(m,m+t.length)==t?{open:{pos:n+f+e.length,margin:/\s/.test(u.charAt(f+e.length))?1:0},close:{pos:r-d-t.length,margin:/\s/.test(h.charAt(m-1))?1:0}}:null}function M6(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),r=t.to<=n.to?n:i.doc.lineAt(t.to),s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function q2(i,e,t=e.selection.ranges){let n=t.map(s=>Tp(e,s.from).block);if(!n.every(s=>s))return null;let r=t.map((s,o)=>Q6(e,n[o],s.from,s.to));if(i!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(i!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>h.from)){r=h.from;let f=/^\s*/.exec(h.text)[0].length,d=f==h.length,m=h.text.slice(f,f+c.length)==c?f:-1;fs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:c,empty:u,single:h}of n)(h||!u)&&s.push({from:l.from+c,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of n)if(l>=0){let c=o.from+l,u=c+a.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}const Cm=Or.define(),R6=Or.define(),D6=ye.define(),G2=ye.define({combine(i){return Qi(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),H2=Jt.define({create(){return zi.empty},update(i,e){let t=e.state.facet(G2),n=e.annotation(Cm);if(n){let a=$n.fromTransaction(e,n.selection),c=n.side,u=c==0?i.undone:i.done;return a?u=Zu(u,u.length,t.minDepth,a):u=e_(u,e.startState.selection),new zi(c==0?n.rest:u,c==0?u:n.rest)}let r=e.annotation(R6);if((r=="full"||r=="before")&&(i=i.isolate()),e.annotation(Ht.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let s=$n.fromTransaction(e),o=e.annotation(Ht.time),l=e.annotation(Ht.userEvent);return s?i=i.addChanges(s,o,l,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(r=="full"||r=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new zi(i.done.map($n.fromJSON),i.undone.map($n.fromJSON))}});function $6(i={}){return[H2,G2.of(i),Oe.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?K2:e.inputType=="historyRedo"?Pm:null;return n?(e.preventDefault(),n(t)):!1}})]}function bh(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let r=t.field(H2,!1);if(!r)return!1;let s=r.pop(i,t,e);return s?(n(s),!0):!1}}const K2=bh(0,!1),Pm=bh(1,!1),L6=bh(0,!0),I6=bh(1,!0);class $n{constructor(e,t,n,r,s){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new $n(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new $n(e.changes&&en.fromJSON(e.changes),[],e.mapped&&ji.fromJSON(e.mapped),e.startSelection&&q.fromJSON(e.startSelection),e.selectionsAfter.map(q.fromJSON))}static fromTransaction(e,t){let n=ci;for(let r of e.startState.facet(D6)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new $n(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,ci)}static selection(e){return new $n(void 0,ci,void 0,void 0,e)}}function Zu(i,e,t,n){let r=e+1>t+20?e-t-1:0,s=i.slice(r,e);return s.push(n),s}function N6(i,e){let t=[],n=!1;return i.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a=c&&o<=u&&(n=!0)}}),n}function Z6(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function J2(i,e){return i.length?e.length?i.concat(e):i:e}const ci=[],B6=200;function e_(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-B6));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),Zu(i,i.length-1,1e9,t.setSelAfter(n)))}else return[$n.selection([e])]}function W6(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Ff(i,e){if(!i.length)return i;let t=i.length,n=ci;for(;t;){let r=X6(i[t-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=i.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,n=r.selectionsAfter}return n.length?[$n.selection(n)]:ci}function X6(i,e,t){let n=J2(i.selectionsAfter.length?i.selectionsAfter.map(l=>l.map(e)):ci,t);if(!i.changes)return $n.selection(n);let r=i.changes.map(e),s=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(s):s;return new $n(r,Fe.mapEffects(i.effects,e),o,i.startSelection.map(s),n)}const F6=/^(input\.type|delete)($|\.)/;class zi{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new zi(this.done,this.undone):this}addChanges(e,t,n,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||F6.test(n))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):vh(t,e))}function bn(i){return i.textDirectionAt(i.state.selection.main.head)==Rt.LTR}const n_=i=>t_(i,!bn(i)),i_=i=>t_(i,bn(i));function r_(i,e){return Mi(i,t=>t.empty?i.moveByGroup(t,e):vh(t,e))}const z6=i=>r_(i,!bn(i)),V6=i=>r_(i,bn(i));function U6(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function wh(i,e,t){let n=At(i).resolveInner(e.head),r=t?Ze.closedBy:Ze.openedBy;for(let a=e.head;;){let c=t?n.childAfter(a):n.childBefore(a);if(!c)break;U6(i,c,r)?n=c:a=t?c.to:c.from}let s=n.type.prop(r),o,l;return s&&(o=t?Yi(i,n.from,1):Yi(i,n.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?n.to:n.from,q.cursor(l,t?-1:1)}const j6=i=>Mi(i,e=>wh(i.state,e,!bn(i))),q6=i=>Mi(i,e=>wh(i.state,e,bn(i)));function s_(i,e){return Mi(i,t=>{if(!t.empty)return vh(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}const o_=i=>s_(i,!1),l_=i=>s_(i,!0);function a_(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):vh(o,e));if(r.eq(n.selection))return!1;let s;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),l=i.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,c=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomc_(i,!1),Am=i=>c_(i,!0);function ts(i,e,t){let n=i.lineBlockAt(e.head),r=i.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?n.to:n.from)&&(r=i.moveToLineBoundary(e,t,!1)),!t&&r.head==n.from&&n.length){let s=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=q.cursor(n.from+s))}return r}const G6=i=>Mi(i,e=>ts(i,e,!0)),H6=i=>Mi(i,e=>ts(i,e,!1)),K6=i=>Mi(i,e=>ts(i,e,!bn(i))),J6=i=>Mi(i,e=>ts(i,e,bn(i))),e7=i=>Mi(i,e=>q.cursor(i.lineBlockAt(e.head).from,1)),t7=i=>Mi(i,e=>q.cursor(i.lineBlockAt(e.head).to,-1));function n7(i,e,t){let n=!1,r=zo(i.selection,s=>{let o=Yi(i,s.head,-1)||Yi(i,s.head,1)||s.head>0&&Yi(i,s.head-1,1)||s.headn7(i,e);function mi(i,e){let t=zo(i.state.selection,n=>{let r=e(n);return q.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(Ji(i.state,t)),!0)}function u_(i,e){return mi(i,t=>i.moveByChar(t,e))}const h_=i=>u_(i,!bn(i)),f_=i=>u_(i,bn(i));function d_(i,e){return mi(i,t=>i.moveByGroup(t,e))}const r7=i=>d_(i,!bn(i)),s7=i=>d_(i,bn(i)),o7=i=>mi(i,e=>wh(i.state,e,!bn(i))),l7=i=>mi(i,e=>wh(i.state,e,bn(i)));function m_(i,e){return mi(i,t=>i.moveVertically(t,e))}const p_=i=>m_(i,!1),g_=i=>m_(i,!0);function O_(i,e){return mi(i,t=>i.moveVertically(t,e,a_(i).height))}const qb=i=>O_(i,!1),Gb=i=>O_(i,!0),a7=i=>mi(i,e=>ts(i,e,!0)),c7=i=>mi(i,e=>ts(i,e,!1)),u7=i=>mi(i,e=>ts(i,e,!bn(i))),h7=i=>mi(i,e=>ts(i,e,bn(i))),f7=i=>mi(i,e=>q.cursor(i.lineBlockAt(e.head).from)),d7=i=>mi(i,e=>q.cursor(i.lineBlockAt(e.head).to)),Hb=({state:i,dispatch:e})=>(e(Ji(i,{anchor:0})),!0),Kb=({state:i,dispatch:e})=>(e(Ji(i,{anchor:i.doc.length})),!0),Jb=({state:i,dispatch:e})=>(e(Ji(i,{anchor:i.selection.main.anchor,head:0})),!0),ev=({state:i,dispatch:e})=>(e(Ji(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),m7=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),p7=({state:i,dispatch:e})=>{let t=yh(i).map(({from:n,to:r})=>q.range(n,Math.min(r+1,i.doc.length)));return e(i.update({selection:q.create(t),userEvent:"select"})),!0},g7=({state:i,dispatch:e})=>{let t=zo(i.selection,n=>{var r;let s=At(i).resolveStack(n.from,1);for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=n.to||l.to>n.to&&l.from<=n.from)&&(!((r=l.parent)===null||r===void 0)&&r.parent))return q.range(l.to,l.from)}return n});return e(Ji(i,t)),!0},O7=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=q.create([t.main]):t.main.empty||(n=q.create([q.cursor(t.main.head)])),n?(e(Ji(i,n)),!0):!1};function Xa(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,r=n.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);ao&&(t="delete.forward",a=Ac(i,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Ac(i,o,!1),l=Ac(i,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:q.cursor(o,or(i)))n.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}const b_=(i,e,t)=>Xa(i,n=>{let r=n.from,{state:s}=i,o=s.doc.lineAt(r),l,a;if(t&&!e&&r>o.from&&rb_(i,!1,!0),v_=i=>b_(i,!0,!1),w_=(i,e)=>Xa(i,t=>{let n=t.head,{state:r}=i,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let l=null;;){if(n==(e?s.to:s.from)){n==t.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let a=hn(s.text,n-s.from,e)+s.from,c=s.text.slice(Math.min(n,a)-s.from,Math.max(n,a)-s.from),u=o(c);if(l!=null&&u!=l)break;(c!=" "||n!=t.head)&&(l=u),n=a}return n}),y_=i=>w_(i,!1),b7=i=>w_(i,!0),v7=i=>Xa(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headXa(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),y7=i=>Xa(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:at.of(["",""])},range:q.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},S7=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let r=n.from,s=i.doc.lineAt(r),o=r==s.from?r-1:hn(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:hn(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:i.doc.slice(r,l).append(i.doc.slice(o,r))},range:q.cursor(l)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function yh(i){let e=[],t=-1;for(let n of i.selection.ranges){let r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=i.doc.lineAt(n.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});t=s.number+1}return e}function k_(i,e,t){if(i.readOnly)return!1;let n=[],r=[];for(let s of yh(i)){if(t?s.to==i.doc.length:s.from==0)continue;let o=i.doc.lineAt(t?s.to+1:s.from-1),l=o.length+1;if(t){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+i.lineBreak});for(let a of s.ranges)r.push(q.range(Math.min(i.doc.length,a.anchor+l),Math.min(i.doc.length,a.head+l)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:i.lineBreak+o.text});for(let a of s.ranges)r.push(q.range(a.anchor-l,a.head-l))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:q.create(r,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}const _7=({state:i,dispatch:e})=>k_(i,e,!1),C7=({state:i,dispatch:e})=>k_(i,e,!0);function S_(i,e,t){if(i.readOnly)return!1;let n=[];for(let r of yh(i))t?n.push({from:r.from,insert:i.doc.slice(r.from,r.to)+i.lineBreak}):n.push({from:r.to,insert:i.lineBreak+i.doc.slice(r.from,r.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const P7=({state:i,dispatch:e})=>S_(i,e,!1),A7=({state:i,dispatch:e})=>S_(i,e,!0),x7=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(yh(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(i.lineWrapping){let o=i.lineBlockAt(r.head),l=i.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+i.documentTop-l.bottom+i.defaultLineHeight/2)}return i.moveVertically(r,!0,s)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function T7(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=At(i).resolveInner(e),n=t.childBefore(e),r=t.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(Ze.closedBy))&&s.indexOf(r.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(r.from).from&&!/\S/.test(i.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}const Q7=__(!1),M7=__(!0);function __(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!i&&s==o&&T7(e,s);i&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new ph(e,{simulateBreak:s,simulateDoubleBreak:!!a}),u=Cp(c,s);for(u==null&&(u=Pi(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));ol.from&&s{let r=[];for(let o=n.from;o<=n.to;){let l=i.doc.lineAt(o);l.number>t&&(n.empty||n.to>l.from)&&(e(l,r,n),t=l.number),o=l.to+1}let s=i.changes(r);return{changes:r,range:q.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}const E7=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new ph(i,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=Qp(i,(s,o,l)=>{let a=Cp(n,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],u=va(i,a);(c!=u||l.fromi.readOnly?!1:(e(i.update(Qp(i,(t,n)=>{n.push({from:t.from,insert:i.facet(Ba)})}),{userEvent:"input.indent"})),!0),P_=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Qp(i,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=Pi(r,i.tabSize),o=0,l=va(i,Math.max(0,s-Lu(i)));for(;o(i.setTabFocusMode(),!0),D7=[{key:"Ctrl-b",run:n_,shift:h_,preventDefault:!0},{key:"Ctrl-f",run:i_,shift:f_},{key:"Ctrl-p",run:o_,shift:p_},{key:"Ctrl-n",run:l_,shift:g_},{key:"Ctrl-a",run:e7,shift:f7},{key:"Ctrl-e",run:t7,shift:d7},{key:"Ctrl-d",run:v_},{key:"Ctrl-h",run:xm},{key:"Ctrl-k",run:v7},{key:"Ctrl-Alt-h",run:y_},{key:"Ctrl-o",run:k7},{key:"Ctrl-t",run:S7},{key:"Ctrl-v",run:Am}],$7=[{key:"ArrowLeft",run:n_,shift:h_,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:z6,shift:r7,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:K6,shift:u7,preventDefault:!0},{key:"ArrowRight",run:i_,shift:f_,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:V6,shift:s7,preventDefault:!0},{mac:"Cmd-ArrowRight",run:J6,shift:h7,preventDefault:!0},{key:"ArrowUp",run:o_,shift:p_,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Hb,shift:Jb},{mac:"Ctrl-ArrowUp",run:jb,shift:qb},{key:"ArrowDown",run:l_,shift:g_,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Kb,shift:ev},{mac:"Ctrl-ArrowDown",run:Am,shift:Gb},{key:"PageUp",run:jb,shift:qb},{key:"PageDown",run:Am,shift:Gb},{key:"Home",run:H6,shift:c7,preventDefault:!0},{key:"Mod-Home",run:Hb,shift:Jb},{key:"End",run:G6,shift:a7,preventDefault:!0},{key:"Mod-End",run:Kb,shift:ev},{key:"Enter",run:Q7},{key:"Mod-a",run:m7},{key:"Backspace",run:xm,shift:xm},{key:"Delete",run:v_},{key:"Mod-Backspace",mac:"Alt-Backspace",run:y_},{key:"Mod-Delete",mac:"Alt-Delete",run:b7},{mac:"Mod-Backspace",run:w7},{mac:"Mod-Delete",run:y7}].concat(D7.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),L7=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:j6,shift:o7},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:q6,shift:l7},{key:"Alt-ArrowUp",run:_7},{key:"Shift-Alt-ArrowUp",run:P7},{key:"Alt-ArrowDown",run:C7},{key:"Shift-Alt-ArrowDown",run:A7},{key:"Escape",run:O7},{key:"Mod-Enter",run:M7},{key:"Alt-l",mac:"Ctrl-l",run:p7},{key:"Mod-i",run:g7,preventDefault:!0},{key:"Mod-[",run:P_},{key:"Mod-]",run:C_},{key:"Mod-Alt-\\",run:E7},{key:"Shift-Mod-k",run:x7},{key:"Shift-Mod-\\",run:i7},{key:"Mod-/",run:P6},{key:"Alt-A",run:x6},{key:"Ctrl-m",mac:"Shift-Alt-m",run:R7}].concat($7),A_={key:"Tab",run:C_,shift:P_};function Ct(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];typeof r=="string"?i.setAttribute(n,r):r!=null&&(i[n]=r)}e++}for(;ei.normalize("NFKD"):i=>i;class Do{constructor(e,t,n=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=s?l=>s(tv(l)):tv,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ln(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=lp(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=oi(e);let r=this.normalize(t);for(let s=0,o=n;;s++){let l=r.charCodeAt(s),a=this.match(l,o,this.bufferPos+this.bufferStart);if(s==r.length-1){if(a)return this.value=a,this;break}o==n&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Bu(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||r.to<=t){let l=new wo(t,e.sliceString(t,n));return Yf.set(e,l),l}if(r.from==t&&r.to==n)return r;let{text:s,from:o}=r;return o>t&&(s=e.sliceString(t,o)+s,o=t),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,r=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this.matchPos=Bu(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=wo.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Q_.prototype[Symbol.iterator]=M_.prototype[Symbol.iterator]=function(){return this});function I7(i){try{return new RegExp(i,Mp),!0}catch{return!1}}function Bu(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function Tm(i){let e=String(i.state.doc.lineAt(i.state.selection.main.head).number),t=Ct("input",{class:"cm-textfield",name:"line",value:e}),n=Ct("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),i.dispatch({effects:Wu.of(!1)}),i.focus()):s.keyCode==13&&(s.preventDefault(),r())},onsubmit:s=>{s.preventDefault(),r()}},Ct("label",i.state.phrase("Go to line"),": ",t)," ",Ct("button",{class:"cm-button",type:"submit"},i.state.phrase("go")));function r(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=i,l=o.doc.lineAt(o.selection.main.head),[,a,c,u,h]=s,f=u?+u.slice(1):0,d=c?+c:l.number;if(c&&h){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else c&&a&&(d=d*(a=="-"?-1:1)+l.number);let m=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),p=q.cursor(m.from+Math.max(0,Math.min(f,m.length)));i.dispatch({effects:[Wu.of(!1),Oe.scrollIntoView(p.from,{y:"center"})],selection:p}),i.focus()}return{dom:n}}const Wu=Fe.define(),nv=Jt.define({create(){return!0},update(i,e){for(let t of e.effects)t.is(Wu)&&(i=t.value);return i},provide:i=>pa.from(i,e=>e?Tm:null)}),N7=i=>{let e=ma(i,Tm);if(!e){let t=[Wu.of(!0)];i.state.field(nv,!1)==null&&t.push(Fe.appendConfig.of([nv,Z7])),i.dispatch({effects:t}),e=ma(i,Tm)}return e&&e.dom.querySelector("input").select(),!0},Z7=Oe.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),B7={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},W7=ye.define({combine(i){return Qi(i,B7,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function X7(i){return[U7,V7]}const F7=Qe.mark({class:"cm-selectionMatch"}),Y7=Qe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function iv(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=$t.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=$t.Word)}function z7(i,e,t,n){return i(e.sliceDoc(t,t+1))==$t.Word&&i(e.sliceDoc(n-1,n))==$t.Word}const V7=Vt.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(W7),{state:t}=i,n=t.selection;if(n.ranges.length>1)return Qe.none;let r=n.main,s,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return Qe.none;let a=t.wordAt(r.head);if(!a)return Qe.none;o=t.charCategorizer(r.head),s=t.sliceDoc(a.from,a.to)}else{let a=r.to-r.from;if(a200)return Qe.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),o=t.charCategorizer(r.head),!(iv(o,t,r.from,r.to)&&z7(o,t,r.from,r.to)))return Qe.none}else if(s=t.sliceDoc(r.from,r.to),!s)return Qe.none}let l=[];for(let a of i.visibleRanges){let c=new Do(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:u,to:h}=c.value;if((!o||iv(o,t,u,h))&&(r.empty&&u<=r.from&&h>=r.to?l.push(Y7.range(u,h)):(u>=r.to||h<=r.from)&&l.push(F7.range(u,h)),l.length>e.maxMatches))return Qe.none}}return Qe.set(l)}},{decorations:i=>i.decorations}),U7=Oe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),j7=({state:i,dispatch:e})=>{let{selection:t}=i,n=q.create(t.ranges.map(r=>i.wordAt(r.head)||q.cursor(r.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function q7(i,e){let{main:t,ranges:n}=i.selection,r=i.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let o=!1,l=new Do(i.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Do(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(a=>a.from==l.value.from))continue;if(s){let a=i.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const G7=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(s=>s.from===s.to))return j7({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(s=>i.sliceDoc(s.from,s.to)!=n))return!1;let r=q7(i,n);return r?(e(i.update({selection:i.selection.addRange(q.range(r.from,r.to),!1),effects:Oe.scrollIntoView(r.to)})),!0):!1},Vo=ye.define({combine(i){return Qi(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new aI(e),scrollToMatch:e=>Oe.scrollIntoView(e)})}});class E_{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||I7(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?` -`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new eI(this):new K7(this)}getCursor(e,t=0,n){let r=e.doc?e:tt.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?eo(this,r,t,n):Js(this,r,t,n)}}class R_{constructor(e){this.spec=e}}function Js(i,e,t,n){return new Do(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:r=>r.toLowerCase(),i.wholeWord?H7(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function H7(i,e){return(t,n,r,s)=>((s>t||s+r.length=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=Js(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function eo(i,e,t,n){return new Q_(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:i.wholeWord?J7(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function Xu(i,e){return i.slice(hn(i,e,!1),e)}function Fu(i,e){return i.slice(e,hn(i,e))}function J7(i){return(e,t,n)=>!n[0].length||(i(Xu(n.input,n.index))!=$t.Word||i(Fu(n.input,n.index))!=$t.Word)&&(i(Fu(n.input,n.index+n[0].length))!=$t.Word||i(Xu(n.input,n.index+n[0].length))!=$t.Word)}class eI extends R_{nextMatch(e,t,n){let r=eo(this.spec,e,n,e.doc.length).next();return r.done&&(r=eo(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let s=Math.max(t,n-r*1e4),o=eo(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let s=eo(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const wa=Fe.define(),Ep=Fe.define(),Wr=Jt.define({create(i){return new zf(Qm(i).create(),null)},update(i,e){for(let t of e.effects)t.is(wa)?i=new zf(t.value.create(),i.panel):t.is(Ep)&&(i=new zf(i.query,t.value?Rp:null));return i},provide:i=>pa.from(i,e=>e.panel)});class zf{constructor(e,t){this.query=e,this.panel=t}}const tI=Qe.mark({class:"cm-searchMatch"}),nI=Qe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),iI=Vt.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(Wr))}update(i){let e=i.state.field(Wr);(e!=i.startState.field(Wr)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return Qe.none;let{view:t}=this,n=new jr;for(let r=0,s=t.visibleRanges,o=s.length;rs[r+1].from-2*250;)a=s[++r].to;i.highlight(t.state,l,a,(c,u)=>{let h=t.state.selection.ranges.some(f=>f.from==c&&f.to==u);n.add(c,u,h?nI:tI)})}return n.finish()}},{decorations:i=>i.decorations});function Fa(i){return e=>{let t=e.state.field(Wr,!1);return t&&t.query.spec.valid?i(e,t):L_(e)}}const Yu=Fa((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let r=q.single(n.from,n.to),s=i.state.facet(Vo);return i.dispatch({selection:r,effects:[Dp(i,n),s.scrollToMatch(r.main,i)],userEvent:"select.search"}),$_(i),!0}),zu=Fa((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,r=e.prevMatch(t,n,n);if(!r)return!1;let s=q.single(r.from,r.to),o=i.state.facet(Vo);return i.dispatch({selection:s,effects:[Dp(i,r),o.scrollToMatch(s.main,i)],userEvent:"select.search"}),$_(i),!0}),rI=Fa((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:q.create(t.map(n=>q.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),sI=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:r}=t.main,s=[],o=0;for(let l=new Do(i.doc,i.sliceDoc(n,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==n&&(o=s.length),s.push(q.range(l.value.from,l.value.to))}return e(i.update({selection:q.create(s,o),userEvent:"select.search.matches"})),!0},rv=Fa((i,{query:e})=>{let{state:t}=i,{from:n,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,n,n);if(!s)return!1;let o=[],l,a,c=[];if(s.from==n&&s.to==r&&(a=t.toText(e.getReplacement(s)),o.push({from:s.from,to:s.to,insert:a}),s=e.nextMatch(t,s.from,s.to),c.push(Oe.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+"."))),s){let u=o.length==0||o[0].from>=s.to?0:s.to-s.from-a.length;l=q.single(s.from-u,s.to-u),c.push(Dp(i,s)),c.push(t.facet(Vo).scrollToMatch(l.main,i))}return i.dispatch({changes:o,selection:l,effects:c,userEvent:"input.replace"}),!0}),oI=Fa((i,{query:e})=>{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(r=>{let{from:s,to:o}=r;return{from:s,to:o,insert:e.getReplacement(r)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:Oe.announce.of(n),userEvent:"input.replace.all"}),!0});function Rp(i){return i.state.facet(Vo).createPanel(i)}function Qm(i,e){var t,n,r,s,o;let l=i.selection.main,a=l.empty||l.to>l.from+100?"":i.sliceDoc(l.from,l.to);if(e&&!a)return e;let c=i.facet(Vo);return new E_({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function D_(i){let e=ma(i,Rp);return e&&e.dom.querySelector("[main-field]")}function $_(i){let e=D_(i);e&&e==i.root.activeElement&&e.select()}const L_=i=>{let e=i.state.field(Wr,!1);if(e&&e.panel){let t=D_(i);if(t&&t!=i.root.activeElement){let n=Qm(i.state,e.query.spec);n.valid&&i.dispatch({effects:wa.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[Ep.of(!0),e?wa.of(Qm(i.state,e.query.spec)):Fe.appendConfig.of(uI)]});return!0},I_=i=>{let e=i.state.field(Wr,!1);if(!e||!e.panel)return!1;let t=ma(i,Rp);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:Ep.of(!1)}),!0},lI=[{key:"Mod-f",run:L_,scope:"editor search-panel"},{key:"F3",run:Yu,shift:zu,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Yu,shift:zu,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:I_,scope:"editor search-panel"},{key:"Mod-Shift-l",run:sI},{key:"Mod-Alt-g",run:N7},{key:"Mod-d",run:G7,preventDefault:!0}];class aI{constructor(e){this.view=e;let t=this.query=e.state.field(Wr).query.spec;this.commit=this.commit.bind(this),this.searchField=Ct("input",{value:t.search,placeholder:Bn(e,"Find"),"aria-label":Bn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ct("input",{value:t.replace,placeholder:Bn(e,"Replace"),"aria-label":Bn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ct("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ct("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ct("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(r,s,o){return Ct("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=Ct("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>Yu(e),[Bn(e,"next")]),n("prev",()=>zu(e),[Bn(e,"previous")]),n("select",()=>rI(e),[Bn(e,"all")]),Ct("label",null,[this.caseField,Bn(e,"match case")]),Ct("label",null,[this.reField,Bn(e,"regexp")]),Ct("label",null,[this.wordField,Bn(e,"by word")]),...e.state.readOnly?[]:[Ct("br"),this.replaceField,n("replace",()=>rv(e),[Bn(e,"replace")]),n("replaceAll",()=>oI(e),[Bn(e,"replace all")])],Ct("button",{name:"close",onclick:()=>I_(e),"aria-label":Bn(e,"close"),type:"button"},["×"])])}commit(){let e=new E_({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:wa.of(e)}))}keydown(e){O$(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?zu:Yu)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),rv(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(wa)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Vo).top}}function Bn(i,e){return i.state.phrase(e)}const xc=30,Tc=/[\s\.,:;?!]/;function Dp(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),r=i.state.doc.lineAt(t).to,s=Math.max(n.from,e-xc),o=Math.min(r,t+xc),l=i.state.sliceDoc(s,o);if(s!=n.from){for(let a=0;al.length-xc;a--)if(!Tc.test(l[a-1])&&Tc.test(l[a])){l=l.slice(0,a);break}}return Oe.announce.of(`${i.state.phrase("current match")}. ${l} ${i.state.phrase("on line")} ${n.number}.`)}const cI=Oe.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),uI=[Wr,gr.low(iI),cI];class $p{constructor(e,t,n,r){this.state=e,this.pos=t,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=At(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),r=t.text.slice(n-t.from,this.pos-t.from),s=r.search(Z_(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function sv(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function hI(i){let e=Object.create(null),t=Object.create(null);for(let{label:r}of i){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:hI(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function fI(i,e){return t=>{for(let n=At(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}class ov{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function Xr(i){return i.selection.main.from}function Z_(i,e){var t;let{source:n}=i,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?i:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}const Lp=Or.define();function dI(i,e,t,n){let{main:r}=i.selection,s=t-r.from,o=n-r.from;return Object.assign(Object.assign({},i.changeByRange(l=>l!=r&&t!=n&&i.sliceDoc(l.from+s,l.from+o)!=i.sliceDoc(t,n)?{range:l}:{changes:{from:l.from+s,to:n==r.from?l.to:l.from+o,insert:e},range:q.cursor(l.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const lv=new WeakMap;function mI(i){if(!Array.isArray(i))return i;let e=lv.get(i);return e||lv.set(i,e=N_(i)),e}const Vu=Fe.define(),ya=Fe.define();class pI{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(Q=lp(k))!=Q.toLowerCase()?1:Q!=Q.toUpperCase()?2:0;(!w||x==1&&g||_==0&&x!=0)&&(t[h]==k||n[h]==k&&(f=!0)?o[h++]=w:o.length&&(b=!1)),_=x,w+=oi(k)}return h==a&&o[0]==0&&b?this.result(-100+(f?-200:0),o,e):d==a&&m==0?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[m,p]):h==a?this.result(-100+(f?-200:0)+-700+(b?0:-1100),o,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],s=0;for(let o of t){let l=o+(this.astral?oi(ln(n,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(e-n.length,r)}}class gI{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:OI,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>av(e(n),t(n)),optionClass:(e,t)=>n=>av(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function av(i,e){return i?e?i+" "+e:i:e}function OI(i,e,t,n,r,s){let o=i.textDirection==Rt.RTL,l=o,a=!1,c="top",u,h,f=e.left-r.left,d=r.right-e.right,m=n.right-n.left,p=n.bottom-n.top;if(l&&f=p||w>e.top?u=t.bottom-e.top:(c="bottom",u=e.bottom-t.top)}let g=(e.bottom-e.top)/s.offsetHeight,b=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${u/g}px; max-width: ${h/b}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function bI(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let c=0;ca&&o.appendChild(document.createTextNode(l.slice(a,u)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(l.slice(u,h))),f.className="cm-completionMatchedText",a=h}return at.position-n.position).map(t=>t.render)}function Vf(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}class vI{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:o}=r.open,l=e.state.facet(un);this.optionContent=bI(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Vf(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(t).open;for(let u=a.target,h;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(h=/-(\d+)$/.exec(u.id))&&+h[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(un).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:ya.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:s,selected:o,disabled:l}=n.open;(!r.open||r.open.options!=s)&&(this.range=Vf(s.length,o,e.state.facet(un).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),l!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=Vf(t.options.length,t.selected,this.view.state.facet(un).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let s=typeof r=="string"?document.createTextNode(r):r(n);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,n)}).catch(o=>_n(this.view.state,o,"completion info")):this.addInfoPane(s,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;n.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&yI(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottomn.from||n.from==0))if(s=f,typeof c!="string"&&c.header)r.appendChild(c.header(c));else{let d=r.appendChild(document.createElement("completion-section"));d.textContent=f}}const u=r.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let h=this.optionClass(l);h&&(u.className=h);for(let f of this.optionContent){let d=f(l,this.view.state,this.view,a);d&&u.appendChild(d)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.tonew vI(t,i,e)}function yI(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),r=t.height/i.offsetHeight;n.topt.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/r)}function cv(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function kI(i,e){let t=[],n=null,r=c=>{t.push(c);let{section:u}=c.completion;if(u){n||(n=[]);let h=typeof u=="string"?u:u.name;n.some(f=>f.name==h)||n.push(typeof u=="string"?{name:h}:u)}},s=e.facet(un);for(let c of i)if(c.hasResult()){let u=c.result.getMatch;if(c.result.filter===!1)for(let h of c.result.options)r(new ov(h,c.source,u?u(h):[],1e9-t.length));else{let h=e.sliceDoc(c.from,c.to),f,d=s.filterStrict?new gI(h):new pI(h);for(let m of c.result.options)if(f=d.match(m.label)){let p=m.displayLabel?u?u(m,f.matched):[]:f.matched;r(new ov(m,c.source,p,f.score+(m.boost||0)))}}}if(n){let c=Object.create(null),u=0,h=(f,d)=>{var m,p;return((m=f.rank)!==null&&m!==void 0?m:1e9)-((p=d.rank)!==null&&p!==void 0?p:1e9)||(f.nameh.score-u.score||a(u.completion,h.completion))){let u=c.completion;!l||l.label!=u.label||l.detail!=u.detail||l.type!=null&&u.type!=null&&l.type!=u.type||l.apply!=u.apply||l.boost!=u.boost?o.push(c):cv(c.completion)>cv(l)&&(o[o.length-1]=c),l=c.completion}return o}class so{constructor(e,t,n,r,s,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new so(this.options,uv(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,s){let o=kI(e,t);if(!o.length)return r&&e.some(a=>a.state==1)?new so(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let l=t.facet(un).selectOnOpen?0:-1;if(r&&r.selected!=l&&r.selected!=-1){let a=r.options[r.selected].completion;for(let c=0;cc.hasResult()?Math.min(a,c.from):a,1e8),create:xI,above:s.aboveCursor},r?r.timestamp:Date.now(),l,!1)}map(e){return new so(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Uu{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new Uu(PI,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(un),s=(n.override||t.languageDataAt("autocomplete",Xr(t)).map(mI)).map(l=>(this.active.find(c=>c.source==l)||new Gn(l,this.active.some(c=>c.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((l,a)=>l==this.active[a])&&(s=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!SI(s,this.active)?o=so.build(s,t,this.id,o,n):o&&o.disabled&&!s.some(l=>l.state==1)&&(o=null),!o&&s.every(l=>l.state!=1)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new Gn(l.source,0):l));for(let l of e.effects)l.is(X_)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new Uu(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?_I:CI}}function SI(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t-1&&(t["aria-activedescendant"]=i+"-"+e),t}const PI=[];function B_(i,e){if(i.isUserEvent("input.complete")){let n=i.annotation(Lp);if(n&&e.activateOnCompletion(n))return 12}let t=i.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}class Gn{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=B_(e,t),r=this;(n&8||n&16&&this.touches(e))&&(r=new Gn(r.source,0)),n&4&&r.state==0&&(r=new Gn(this.source,1)),r=r.updateFor(e,n);for(let s of e.effects)if(s.is(Vu))r=new Gn(r.source,1,s.value?Xr(e.state):-1);else if(s.is(ya))r=new Gn(r.source,0);else if(s.is(W_))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(e,t){return this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Gn(this.source,this.state,e.mapPos(this.explicitPos))}touches(e){return e.changes.touchesRange(Xr(e.state))}}class yo extends Gn{constructor(e,t,n,r,s){super(e,2,t),this.result=n,this.from=r,this.to=s}hasResult(){return!0}updateFor(e,t){var n;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=Xr(e.state);if((this.explicitPos<0?l<=s:lo||!r||t&2&&Xr(e.startState)==this.from)return new Gn(this.source,t&4?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return AI(r.validFor,e.state,s,o)?new yo(this.source,a,r,s,o):r.update&&(r=r.update(r,s,o,new $p(e.state,l,a>=0)))?new yo(this.source,a,r,r.from,(n=r.to)!==null&&n!==void 0?n:Xr(e.state)):new Gn(this.source,1,a)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new yo(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Gn(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function AI(i,e,t,n){if(!i)return!1;let r=e.sliceDoc(t,n);return typeof i=="function"?i(r,t,n,e):Z_(i,!0).test(r)}const W_=Fe.define({map(i,e){return i.map(t=>t.map(e))}}),X_=Fe.define(),Rn=Jt.define({create(){return Uu.start()},update(i,e){return i.update(e)},provide:i=>[dh.from(i,e=>e.tooltip),Oe.contentAttributes.from(i,e=>e.attrs)]});function Ip(i,e){const t=e.completion.apply||e.completion.label;let n=i.state.field(Rn).active.find(r=>r.source==e.source);return n instanceof yo?(typeof t=="string"?i.dispatch(Object.assign(Object.assign({},dI(i.state,t,n.from,n.to)),{annotations:Lp.of(e.completion)})):t(i,e.completion,n.from,n.to),!0):!1}const xI=wI(Rn,Ip);function Qc(i,e="option"){return t=>{let n=t.state.field(Rn,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+r*(i?1:-1):i?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:X_.of(l)}),!0}}const TI=i=>{let e=i.state.field(Rn,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(Rn,!1)?(i.dispatch({effects:Vu.of(!0)}),!0):!1,MI=i=>{let e=i.state.field(Rn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:ya.of(null)}),!0)};class EI{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const RI=50,DI=1e3,$I=Vt.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(Rn).active)e.state==1&&this.startQuery(e)}update(i){let e=i.state.field(Rn),t=i.state.facet(un);if(!i.selectionSet&&!i.docChanged&&i.startState.field(Rn)==e)return;let n=i.transactions.some(s=>{let o=B_(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sRI&&Date.now()-o.time>DI){for(let l of o.context.abortListeners)try{l()}catch(a){_n(this.view.state,a)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(s=>s.effects.some(o=>o.is(Vu)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.state==1&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of i.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(Rn);for(let t of e.active)t.state==1&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t)}startQuery(i){let{state:e}=this.view,t=Xr(e),n=new $p(e,t,i.explicitPos==t,this.view),r=new EI(i,n);this.running.push(r),Promise.resolve(i.source(n)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ya.of(null)}),_n(this.view.state,s)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(un).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(un);for(let n=0;no.source==r.active.source);if(s&&s.state==1)if(r.done==null){let o=new Gn(r.active.source,0);for(let l of r.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(s)}e.length&&this.view.dispatch({effects:W_.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(Rn,!1);if(e&&e.tooltip&&this.view.state.facet(un).closeOnBlur){let t=e.open&&w2(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:ya.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Vu.of(!1)}),20),this.composing=0}}}),LI=typeof navigator=="object"&&/Win/.test(navigator.platform),II=gr.highest(Oe.domEventHandlers({keydown(i,e){let t=e.state.field(Rn,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(LI&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],r=t.active.find(o=>o.source==n.source),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(i.key)>-1&&Ip(e,n),!1}})),F_=Oe.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class NI{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}}class Np{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,cn.TrackDel),n=e.mapPos(this.to,1,cn.TrackDel);return t==null||n==null?null:new Np(this.field,t,n)}}class Zp{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(n.length){let c=o,u=/^\t*/.exec(a)[0].length;for(let h=0;hnew Np(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:n,ranges:l}}static parse(e){let t=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,a=s[2]||s[3]||"",c=-1,u=a.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h=c&&f.field++}r.push(new NI(c,n.length,s.index,s.index+u.length)),o=o.slice(0,s.index)+a+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,a,c)=>{for(let u of r)u.line==n.length&&u.from>c&&(u.from--,u.to--);return a}),n.push(o)}return new Zp(n,r)}}let ZI=Qe.widget({widget:new class extends br{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),BI=Qe.mark({class:"cm-snippetField"});class Uo{constructor(e,t){this.ranges=e,this.active=t,this.deco=Qe.set(e.map(n=>(n.from==n.to?ZI:BI).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new Uo(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}}const Ya=Fe.define({map(i,e){return i&&i.map(e)}}),WI=Fe.define(),ka=Jt.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(Ya))return t.value;if(t.is(WI)&&i)return new Uo(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>Oe.decorations.from(i,e=>e?e.deco:Qe.none)});function Bp(i,e){return q.create(i.filter(t=>t.field==e).map(t=>q.range(t.from,t.to)))}function XI(i){let e=Zp.parse(i);return(t,n,r,s)=>{let{text:o,ranges:l}=e.instantiate(t.state,r),a={changes:{from:r,to:s,insert:at.of(o)},scrollIntoView:!0,annotations:n?[Lp.of(n),Ht.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=Bp(l,0)),l.some(c=>c.field>0)){let c=new Uo(l,0),u=a.effects=[Ya.of(c)];t.state.field(ka,!1)===void 0&&u.push(Fe.appendConfig.of([ka,UI,jI,F_]))}t.dispatch(t.state.update(a))}}function Y_(i){return({state:e,dispatch:t})=>{let n=e.field(ka,!1);if(!n||i<0&&n.active==0)return!1;let r=n.active+i,s=i>0&&!n.ranges.some(o=>o.field==r+i);return t(e.update({selection:Bp(n.ranges,r),effects:Ya.of(s?null:new Uo(n.ranges,r)),scrollIntoView:!0})),!0}}const FI=({state:i,dispatch:e})=>i.field(ka,!1)?(e(i.update({effects:Ya.of(null)})),!0):!1,YI=Y_(1),zI=Y_(-1),VI=[{key:"Tab",run:YI,shift:zI},{key:"Escape",run:FI}],hv=ye.define({combine(i){return i.length?i[0]:VI}}),UI=gr.highest(Bs.compute([hv],i=>i.facet(hv)));function Qn(i,e){return Object.assign(Object.assign({},e),{apply:XI(i)})}const jI=Oe.domEventHandlers({mousedown(i,e){let t=e.state.field(ka,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==t.active?!1:(e.dispatch({selection:Bp(t.ranges,r.field),effects:Ya.of(t.ranges.some(s=>s.field>r.field)?new Uo(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),Sa={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ks=Fe.define({map(i,e){let t=e.mapPos(i,-1,cn.TrackAfter);return t??void 0}}),Wp=new class extends Qs{};Wp.startSide=1;Wp.endSide=-1;const z_=Jt.define({create(){return it.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(ks)&&(i=i.update({add:[Wp.range(t.value,t.value+1)]}));return i}});function qI(){return[HI,z_]}const Uf="()[]{}<>";function V_(i){for(let e=0;e{if((GI?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let r=i.state.selection.main;if(n.length>2||n.length==2&&oi(ln(n,0))==1||e!=r.from||t!=r.to)return!1;let s=eN(i.state,n);return s?(i.dispatch(s),!0):!1}),KI=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=U_(i,i.selection.main.head).brackets||Sa.brackets,r=null,s=i.changeByRange(o=>{if(o.empty){let l=tN(i.doc,o.head);for(let a of n)if(a==l&&kh(i.doc,o.head)==V_(ln(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:q.cursor(o.head-a.length)}}return{range:r=o}});return r||e(i.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},JI=[{key:"Backspace",run:KI}];function eN(i,e){let t=U_(i,i.selection.main.head),n=t.brackets||Sa.brackets;for(let r of n){let s=V_(ln(r,0));if(e==r)return s==r?rN(i,r,n.indexOf(r+r+r)>-1,t):nN(i,r,s,t.before||Sa.before);if(e==s&&j_(i,i.selection.main.from))return iN(i,r,s)}return null}function j_(i,e){let t=!1;return i.field(z_).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function kh(i,e){let t=i.sliceString(e,e+2);return t.slice(0,oi(ln(t,0)))}function tN(i,e){let t=i.sliceString(e-2,e);return oi(ln(t,0))==t.length?t:t.slice(1)}function nN(i,e,t,n){let r=null,s=i.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:ks.of(o.to+e.length),range:q.range(o.anchor+e.length,o.head+e.length)};let l=kh(i.doc,o.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:ks.of(o.head+e.length),range:q.cursor(o.head+e.length)}:{range:r=o}});return r?null:i.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function iN(i,e,t){let n=null,r=i.changeByRange(s=>s.empty&&kh(i.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:q.cursor(s.head+t.length)}:n={range:s});return n?null:i.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function rN(i,e,t,n){let r=n.stringPrefixes||Sa.stringPrefixes,s=null,o=i.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:ks.of(l.to+e.length),range:q.range(l.anchor+e.length,l.head+e.length)};let a=l.head,c=kh(i.doc,a),u;if(c==e){if(fv(i,a))return{changes:{insert:e+e,from:a},effects:ks.of(a+e.length),range:q.cursor(a+e.length)};if(j_(i,a)){let f=t&&i.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+f.length,insert:f},range:q.cursor(a+f.length)}}}else{if(t&&i.sliceDoc(a-2*e.length,a)==e+e&&(u=dv(i,a-2*e.length,r))>-1&&fv(i,u))return{changes:{insert:e+e+e+e,from:a},effects:ks.of(a+e.length),range:q.cursor(a+e.length)};if(i.charCategorizer(a)(c)!=$t.Word&&dv(i,a,r)>-1&&!sN(i,a,e,r))return{changes:{insert:e+e,from:a},effects:ks.of(a+e.length),range:q.cursor(a+e.length)}}return{range:s=l}});return s?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function fv(i,e){let t=At(i).resolveInner(e+1);return t.parent&&t.from==e}function sN(i,e,t,n){let r=At(i).resolveInner(e,-1),s=n.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=i.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),a=l.indexOf(t);if(!a||a>-1&&n.indexOf(l.slice(0,a))>-1){let u=r.firstChild;for(;u&&u.from==r.from&&u.to-u.from>t.length+a;){if(i.sliceDoc(u.to-t.length,u.to)==t)return!1;u=u.firstChild}return!0}let c=r.to==e&&r.parent;if(!c)break;r=c}return!1}function dv(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=$t.Word)return e;for(let r of t){let s=e-r.length;if(i.sliceDoc(s,e)==r&&n(i.sliceDoc(s-1,s))!=$t.Word)return s}return-1}function q_(i={}){return[II,Rn,un.of(i),$I,oN,F_]}const Xp=[{key:"Ctrl-Space",run:QI},{key:"Escape",run:MI},{key:"ArrowDown",run:Qc(!0)},{key:"ArrowUp",run:Qc(!1)},{key:"PageDown",run:Qc(!0,"page")},{key:"PageUp",run:Qc(!1,"page")},{key:"Enter",run:TI}],oN=gr.highest(Bs.computeN([un],i=>i.facet(un).defaultKeymap?[Xp]:[]));class lN{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class bs{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=e,s=n.facet(Vi).markerFilter;s&&(r=s(r,n));let o=Qe.set(r.map(l=>l.from==l.to||l.from==l.to-1&&n.doc.lineAt(l.from).to==l.from?Qe.widget({widget:new pN(l),diagnostic:l}).range(l.from):Qe.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new bs(o,t,$o(o))}}function $o(i,e=null,t=0){let n=null;return i.between(t,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostic!=e))return n=new lN(r,s,o.diagnostic),!1}),n}function G_(i,e){let t=e.pos,n=e.end||t,r=i.state.facet(Vi).hideOn(i,t,n);if(r!=null)return r;let s=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(o=>o.is(Sh))||i.changes.touchesRange(s.from,Math.max(s.to,n)))}function H_(i,e){return i.field(Hn,!1)?e:e.concat(Fe.appendConfig.of(sC))}function aN(i,e){return{effects:H_(i,[Sh.of(e)])}}const Sh=Fe.define(),Fp=Fe.define(),K_=Fe.define(),Hn=Jt.define({create(){return new bs(Qe.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,r=i.panel;if(i.selected){let s=e.changes.mapPos(i.selected.from,1);n=$o(t,i.selected.diagnostic,s)||$o(t,null,s)}!t.size&&r&&e.state.facet(Vi).autoPanel&&(r=null),i=new bs(t,r,n)}for(let t of e.effects)if(t.is(Sh)){let n=e.state.facet(Vi).autoPanel?t.value.length?_a.open:null:i.panel;i=bs.init(t.value,n,e.state)}else t.is(Fp)?i=new bs(i.diagnostics,t.value?_a.open:null,i.selected):t.is(K_)&&(i=new bs(i.diagnostics,i.panel,t.value));return i},provide:i=>[pa.from(i,e=>e.panel),Oe.decorations.from(i,e=>e.diagnostics)]}),cN=Qe.mark({class:"cm-lintRange cm-lintRange-active"});function uN(i,e,t){let{diagnostics:n}=i.state.field(Hn),r=[],s=2e8,o=0;n.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:u})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(enC(i,t,!1)))}const hN=i=>{let e=i.state.field(Hn,!1);(!e||!e.panel)&&i.dispatch({effects:H_(i.state,[Fp.of(!0)])});let t=ma(i,_a.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},mv=i=>{let e=i.state.field(Hn,!1);return!e||!e.panel?!1:(i.dispatch({effects:Fp.of(!1)}),!0)},fN=i=>{let e=i.state.field(Hn,!1);if(!e)return!1;let t=i.state.selection.main,n=e.diagnostics.iter(t.to+1);return!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},eC=[{key:"Mod-Shift-m",run:hN,preventDefault:!0},{key:"F8",run:fN}],dN=Vt.fromClass(class{constructor(i){this.view=i,this.timeout=-1,this.set=!0;let{delay:e}=i.state.facet(Vi);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let i=Date.now();if(iPromise.resolve(n(this.view)))).then(n=>{let r=n.reduce((s,o)=>s.concat(o));this.view.state.doc==e.doc&&this.view.dispatch(aN(this.view.state,r))},n=>{_n(this.view.state,n)})}}update(i){let e=i.state.facet(Vi);(i.docChanged||e!=i.startState.facet(Vi)||e.needsRefresh&&e.needsRefresh(i))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Vi=ye.define({combine(i){return Object.assign({sources:i.map(e=>e.source).filter(e=>e!=null)},Qi(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function mN(i,e={}){return[Vi.of({source:i,config:e}),dN,sC]}function tC(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;ns.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function nC(i,e,t){var n;let r=t?tC(e.actions):[];return Ct("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Ct("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((s,o)=>{let l=!1,a=f=>{if(f.preventDefault(),l)return;l=!0;let d=$o(i.state.field(Hn).diagnostics,e);d&&s.apply(i,d.from,d.to)},{name:c}=s,u=r[o]?c.indexOf(r[o]):-1,h=u<0?c:[c.slice(0,u),Ct("u",c.slice(u,u+1)),c.slice(u+1)];return Ct("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${r[o]})"`}.`},h)}),e.source&&Ct("div",{class:"cm-diagnosticSource"},e.source))}class pN extends br{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Ct("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class pv{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=nC(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class _a{constructor(e){this.view=e,this.items=[];let t=r=>{if(r.keyCode==27)mv(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=tC(s.actions);for(let l=0;l{for(let s=0;smv(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Hn).selected;if(!e)return-1;for(let t=0;t{let c=-1,u;for(let h=n;hn&&(this.items.splice(n,c-n),r=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),s=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),n++});n({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let a=l.height/this.list.offsetHeight;o.topl.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Hn),n=$o(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:K_.of(n)})}static open(e){return new _a(e)}}function tu(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(i)}')`}function Mc(i){return tu(``,'width="6" height="3"')}const gN=Oe.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Mc("#d11")},".cm-lintRange-warning":{backgroundImage:Mc("orange")},".cm-lintRange-info":{backgroundImage:Mc("#999")},".cm-lintRange-hint":{backgroundImage:Mc("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function gv(i){return i=="error"?4:i=="warning"?3:i=="info"?2:1}class ON extends Ki{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce((t,n)=>gv(t)vN(e,t,n)),t}}function bN(i,e){let t=n=>{let r=e.getBoundingClientRect();if(!(n.clientX>r.left-10&&n.clientXr.top-10&&n.clientYe.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,bN(i,e)}let{hoverTime:r}=i.state.facet(_h),s=setTimeout(n,r);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(n,r)}}function wN(i,e){let t=Object.create(null);for(let r of e){let s=i.lineAt(r.from);(t[s.from]||(t[s.from]=[])).push(r)}let n=[];for(let r in t)n.push(new ON(t[r]).range(+r));return it.of(n,!0)}const yN=k2({class:"cm-gutter-lint",markers:i=>i.state.field(iC)}),iC=Jt.define({create(){return it.empty},update(i,e){i=i.map(e.changes);let t=e.state.facet(_h).markerFilter;for(let n of e.effects)if(n.is(Sh)){let r=n.value;t&&(r=t(r||[],e.state)),i=wN(e.state.doc,r.slice(0))}return i}}),Yp=Fe.define(),rC=Jt.define({create(){return null},update(i,e){return i&&e.docChanged&&(i=G_(e,i)?null:Object.assign(Object.assign({},i),{pos:e.changes.mapPos(i.pos)})),e.effects.reduce((t,n)=>n.is(Yp)?n.value:t,i)},provide:i=>dh.from(i)}),kN=Oe.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:tu('')},".cm-lint-marker-warning":{content:tu('')},".cm-lint-marker-error":{content:tu('')}}),sC=[Hn,Oe.decorations.compute([Hn],i=>{let{selected:e,panel:t}=i.field(Hn);return!e||!t||e.from==e.to?Qe.none:Qe.set([cN.range(e.from,e.to)])}),iL(uN,{hideOn:G_}),gN],_h=ye.define({combine(i){return Qi(i,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function SN(i={}){return[_h.of(i),iC,yN,kN,rC]}const ju=[dL(),gL(),D$(),$6(),a6(),S$(),x$(),tt.allowMultipleSelections.of(!0),GL(),u6(d6,{fallback:!0}),w6(),qI(),q_(),V$(),q$(),B$(),X7(),Bs.of([...JI,...L7,...lI,...Y6,...r6,...Xp,...eC])];var Ov={};class qu{constructor(e,t,n,r,s,o,l,a,c,u=0,h){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,this.parent=h}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new qu(e,[],t,n,n,0,[],0,r?new bv(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==n)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;(r>this.pos||t<=o.maxNode)&&(this.pos=r,o.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new qu(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new _N(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class bv{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class _N{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Gu{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Gu(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Gu(this.stack,this.pos,this.index)}}function Al(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class nu{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const vv=new nu;class CN{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=vv,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=vv,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class ko{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;oC(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}ko.prototype.contextual=ko.prototype.fallback=ko.prototype.extend=!1;class Hu{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?Al(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(oC(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Hu.prototype.contextual=ko.prototype.fallback=ko.prototype.extend=!1;class Ei{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function oC(i,e,t,n,r,s){let o=0,l=1<0){let m=i[d];if(a.allows(m)&&(e.token.value==-1||e.token.value==m||PN(m,e.token.value,r,s))){e.acceptToken(m);break}}let u=e.next,h=0,f=i[o+2];if(e.next<0&&f>h&&i[c+f*3-3]==65535){o=i[c+f*3-1];continue e}for(;h>1,m=c+d+(d<<1),p=i[m],g=i[m+1]||65536;if(u=g)h=d+1;else{o=i[m+2],e.advance();continue e}}break}}function wv(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function PN(i,e,t,n){let r=wv(t,n,e);return r<0||wv(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}let AN=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?yv(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?yv(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof gt){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};class xN{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new nu)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;ch.end+25&&(a=Math.max(h.lookAhead,a)),h.value!=0)){let f=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!u.extend&&(n=h,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new nu,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new nu,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new AN(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&MN(r);if(o)return Wn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Wn&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return Wn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let h=this.fragments.nodeAt(r);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?s.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!c||(h.prop(Ze.contextHash)||0)==u))return e.useNode(h,f),Wn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(h.type.id)})`),!0;if(!(h instanceof gt)||h.children.length==0||h.positions[0]>0)break;let d=h.children[0];if(d instanceof gt&&h.positions[0]==0)h=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Wn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;cr?t.push(m):n.push(m)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return kv(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Wn&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let h=l.split(),f=u;for(let d=0;h.forceReduce()&&d<10&&(Wn&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,n));d++)Wn&&(f=this.stackID(h)+" -> ");for(let d of l.recoverByInsert(a))Wn&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),Wn&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),kv(l,n)):(!r||r.scorei;class lC{constructor(e){this.start=e.start,this.shift=e.shift||qf,this.reduce=e.reduce||qf,this.reuse=e.reuse||qf,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ls extends kp{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(u,a,l[c++]);else{let h=l[c+-u];for(let f=-u;f>0;f--)s(l[c++],a,h);c++}}}this.nodeSet=new Za(t.map((l,a)=>tn.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=C2;let o=Al(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new ko(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new TN(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let c=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=rr(this.data,s+2);else break;r=t(rr(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=rr(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(Ls.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Sv(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}const EN=Ws({String:I.string,Number:I.number,"True False":I.bool,PropertyName:I.propertyName,Null:I.null,",":I.separator,"[ ]":I.squareBracket,"{ }":I.brace}),RN=Ls.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[EN],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),DN=()=>i=>{try{JSON.parse(i.state.doc.toString())}catch(e){if(!(e instanceof SyntaxError))throw e;const t=$N(e,i.state.doc);return[{from:t,message:e.message,severity:"error",to:t}]}return[]};function $N(i,e){let t;return(t=i.message.match(/at position (\d+)/))?Math.min(+t[1],e.length):(t=i.message.match(/at line (\d+) column (\d+)/))?Math.min(e.line(+t[1]).from+ +t[2]-1,e.length):0}const LN=Ds.define({name:"json",parser:RN.configure({props:[Yo.add({Object:vo({except:/^\s*\}/}),Array:vo({except:/^\s*\]/})}),Xs.add({"Object Array":Ap})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function _v(){return new Ro(LN)}function IN(i){let e,t;return{c(){e=y("div"),O(e,"class",t="is-editable-"+i[0])},m(n,r){A(n,e,r),i[3](e)},p(n,[r]){r&1&&t!==(t="is-editable-"+n[0])&&O(e,"class",t)},i:U,o:U,d(n){n&&P(e),i[3](null)}}}function NN(i,e,t){let n,r,{value:s}=e,{editable:o=!0}=e;Ti(()=>{let a=new Ur,c=new Ur,u=tt.create({doc:JSON.stringify(s,null,4),extensions:[ju,Bs.of([A_]),a.of(_v()),_v(),c.of(tt.tabSize.of(4)),SN(),ju,Oe.editable.of(o),Oe.updateListener.of(function(h){h.docChanged&&t(2,s=h.state.doc.toString())}),mN(DN())]});r=new Oe({state:u,parent:n})}),uy(()=>{r&&r.destroy()});function l(a){Se[a?"unshift":"push"](()=>{n=a,t(1,n)})}return i.$$set=a=>{"value"in a&&t(2,s=a.value),"editable"in a&&t(0,o=a.editable)},[o,n,s,l]}class ZN extends oe{constructor(e){super(),se(this,e,NN,IN,re,{value:2,editable:0})}}function Cv(i){let e,t;return{c(){e=y("div"),t=W(i[3]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&8&&K(t,n[3])},d(n){n&&P(e)}}}function BN(i){let e,t,n,r,s;function o(c){i[5](c)}let l={editable:!i[1].readonly||i[2]};i[0]!==void 0&&(l.value=i[0]),t=new ZN({props:l}),Se.push(()=>He(t,"value",o));let a=i[3]&&Cv(i);return{c(){e=y("div"),V(t.$$.fragment),r=D(),a&&a.c(),O(e,"class","mb-3")},m(c,u){A(c,e,u),Y(t,e,null),v(e,r),a&&a.m(e,null),s=!0},p(c,[u]){const h={};u&6&&(h.editable=!c[1].readonly||c[2]),!n&&u&1&&(n=!0,h.value=c[0],nt(()=>n=!1)),t.$set(h),c[3]?a?a.p(c,u):(a=Cv(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(c){s||(T(t.$$.fragment,c),s=!0)},o(c){R(t.$$.fragment,c),s=!1},d(c){c&&P(e),z(t),a&&a.d()}}}function WN(i,e,t){let n,{value:r}=e,{field:s}=e,{isCreateMode:o}=e,{validationErrors:l}=e;function a(c){r=c,t(0,r)}return i.$$set=c=>{"value"in c&&t(0,r=c.value),"field"in c&&t(1,s=c.field),"isCreateMode"in c&&t(2,o=c.isCreateMode),"validationErrors"in c&&t(4,l=c.validationErrors)},i.$$.update=()=>{i.$$.dirty&18&&t(3,n=In(l,s.name))},[r,s,o,n,l,a]}let XN=class extends oe{constructor(e){super(),se(this,e,WN,BN,re,{value:0,field:1,isCreateMode:2,validationErrors:4})}};class Ku{static create(e,t,n,r,s){let o=r+(r<<8)+e+(t<<4)|0;return new Ku(e,t,n,o,s,[],[])}constructor(e,t,n,r,s,o,l){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[Ze.contextHash,r]]}addChild(e,t){e.prop(Ze.contextHash)!=this.hash&&(e=new gt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new gt(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,o)=>new gt(tn.none,r,s,o,this.hashProp)})}}var ce;(function(i){i[i.Document=1]="Document",i[i.CodeBlock=2]="CodeBlock",i[i.FencedCode=3]="FencedCode",i[i.Blockquote=4]="Blockquote",i[i.HorizontalRule=5]="HorizontalRule",i[i.BulletList=6]="BulletList",i[i.OrderedList=7]="OrderedList",i[i.ListItem=8]="ListItem",i[i.ATXHeading1=9]="ATXHeading1",i[i.ATXHeading2=10]="ATXHeading2",i[i.ATXHeading3=11]="ATXHeading3",i[i.ATXHeading4=12]="ATXHeading4",i[i.ATXHeading5=13]="ATXHeading5",i[i.ATXHeading6=14]="ATXHeading6",i[i.SetextHeading1=15]="SetextHeading1",i[i.SetextHeading2=16]="SetextHeading2",i[i.HTMLBlock=17]="HTMLBlock",i[i.LinkReference=18]="LinkReference",i[i.Paragraph=19]="Paragraph",i[i.CommentBlock=20]="CommentBlock",i[i.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",i[i.Escape=22]="Escape",i[i.Entity=23]="Entity",i[i.HardBreak=24]="HardBreak",i[i.Emphasis=25]="Emphasis",i[i.StrongEmphasis=26]="StrongEmphasis",i[i.Link=27]="Link",i[i.Image=28]="Image",i[i.InlineCode=29]="InlineCode",i[i.HTMLTag=30]="HTMLTag",i[i.Comment=31]="Comment",i[i.ProcessingInstruction=32]="ProcessingInstruction",i[i.Autolink=33]="Autolink",i[i.HeaderMark=34]="HeaderMark",i[i.QuoteMark=35]="QuoteMark",i[i.ListMark=36]="ListMark",i[i.LinkMark=37]="LinkMark",i[i.EmphasisMark=38]="EmphasisMark",i[i.CodeMark=39]="CodeMark",i[i.CodeText=40]="CodeText",i[i.CodeInfo=41]="CodeInfo",i[i.LinkTitle=42]="LinkTitle",i[i.LinkLabel=43]="LinkLabel",i[i.URL=44]="URL"})(ce||(ce={}));class FN{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class YN{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return jl(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let n=(i.type==ce.OrderedList?Up:Vp)(t,e,!1);return n>0&&(i.type!=ce.BulletList||zp(t,e,!1)<0)&&t.text.charCodeAt(t.pos+n-1)==i.value}const aC={[ce.Blockquote](i,e,t){return t.next!=62?!1:(t.markers.push(st(ce.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(pi(t.text.charCodeAt(t.pos+1))?2:1)),i.end=e.lineStart+t.text.length,!0)},[ce.ListItem](i,e,t){return t.indent-1?!1:(t.moveBaseColumn(t.baseIndent+i.value),!0)},[ce.OrderedList]:Pv,[ce.BulletList]:Pv,[ce.Document](){return!0}};function pi(i){return i==32||i==9||i==10||i==13}function jl(i,e=0){for(;et&&pi(i.charCodeAt(e-1));)e--;return e}function cC(i){if(i.next!=96&&i.next!=126)return-1;let e=i.pos+1;for(;e-1&&i.depth==e.stack.length||n<3?-1:1}function hC(i,e){for(let t=i.stack.length-1;t>=0;t--)if(i.stack[t].type==e)return!0;return!1}function Vp(i,e,t){return(i.next==45||i.next==43||i.next==42)&&(i.pos==i.text.length-1||pi(i.text.charCodeAt(i.pos+1)))&&(!t||hC(e,ce.BulletList)||i.skipSpace(i.pos+2)=48&&r<=57;){n++;if(n==i.text.length)return-1;r=i.text.charCodeAt(n)}return n==i.pos||n>i.pos+9||r!=46&&r!=41||ni.pos+1||i.next!=49)?-1:n+1-i.pos}function fC(i){if(i.next!=35)return-1;let e=i.pos+1;for(;e6?-1:t}function dC(i){if(i.next!=45&&i.next!=61||i.indent>=i.baseIndent+4)return-1;let e=i.pos+1;for(;e/,pC=/\?>/,Em=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,lC=/\?>/,Em=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(s)return i.append(st(ce.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return i.append(st(ce.ProcessingInstruction,t,t+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return l?i.append(st(ce.HTMLTag,t,t+1+l[0].length)):-1},Emphasis(i,e,t){if(e!=95&&e!=42)return-1;let n=t+1;for(;i.char(n)==e;)n++;let r=i.slice(t-1,t),s=i.slice(n,n+1),o=Pa.test(r),l=Pa.test(s),a=/\s|^$/.test(r),c=/\s|^$/.test(s),u=!c&&(!l||a||o),h=!a&&(!o||c||l),f=u&&(e==42||!h||o),d=h&&(e==42||!u||l);return i.append(new ri(e==95?yC:kC,t,n,(f?1:0)|(d?2:0)))},HardBreak(i,e,t){if(e==92&&i.char(t+1)==10)return i.append(st(ce.HardBreak,t,t+2));if(e==32){let n=t+1;for(;i.char(n)==32;)n++;if(i.char(n)==10&&n>=t+2)return i.append(st(ce.HardBreak,t,n+1))}return-1},Link(i,e,t){return e==91?i.append(new ri(to,t,t+1,1)):-1},Image(i,e,t){return e==33&&i.char(t+1)==91?i.append(new ri(Dm,t,t+2,1)):-1},LinkEnd(i,e,t){if(e!=93)return-1;for(let n=i.parts.length-1;n>=0;n--){let r=i.parts[n];if(r instanceof ri&&(r.type==to||r.type==Dm)){if(!r.side||i.skipSpace(r.to)==t&&!/[(\[]/.test(i.slice(t+1,t+2)))return i.parts[n]=null,-1;let s=i.takeContent(n),o=i.parts[n]=HN(i,s,r.type==to?ce.Link:ce.Image,r.from,t+1);if(r.type==to)for(let l=0;le?st(ce.URL,e+t,s+t):s==i.length?null:!1}}function _C(i,e,t){let n=i.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let r=n==40?41:n;for(let s=e+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new ri(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof ri&&(t.type==to||t.type==Dm))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;a--){let p=this.parts[a];if(p instanceof ri&&p.side&1&&p.type==r.type&&!(s&&(r.side&1||p.side&2)&&(p.to-p.from+o)%3==0&&((p.to-p.from)%3||o%3))){l=p;break}}if(!l)continue;let c=r.type.resolve,u=[],h=l.from,f=r.to;if(s){let p=Math.min(2,l.to-l.from,o);h=l.to-p,f=r.from+p,c=p==1?"Emphasis":"StrongEmphasis"}l.type.mark&&u.push(this.elt(l.type.mark,h,l.to));for(let p=a+1;p=0;t--){let n=this.parts[t];if(n instanceof ri&&n.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return jl(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e=="string"?st(this.parser.getNodeType(e),t,n,r):new wC(e,t)}}function $m(i,e){if(!e.length)return i;if(!i.length)return e;let t=i.slice(),n=0;for(let r of e){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` -`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Ze.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,c=l;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let u=PC(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,u);else{let h=new gt(e.parser.nodeSet.types[ce.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,u)}if(t.type.is("Block")&&(JN.indexOf(t.type.id)<0?(o=t.to-n,l=e.block.children.length):(o=a,l=c,a=t.to-n,c=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}}function PC(i,e){let t=i;for(let n=1;nEc[i]),Object.keys(Ec).map(i=>UN[i]),Object.keys(Ec),jN,aC,Object.keys(Hf).map(i=>Hf[i]),Object.keys(Hf),[]);function iZ(i,e,t){let n=[];for(let r=i.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function rZ(i){let{codeParser:e,htmlParser:t}=i;return{wrap:Q2((r,s)=>{let o=r.type.id;if(e&&(o==ce.CodeBlock||o==ce.FencedCode)){let l="";if(o==ce.FencedCode){let c=r.node.getChild(ce.CodeInfo);c&&(l=s.read(c.from,c.to))}let a=e(l);if(a)return{parser:a,overlay:c=>c.type.id==ce.CodeText}}else if(t&&(o==ce.HTMLBlock||o==ce.HTMLTag))return{parser:t,overlay:iZ(r.node,r.from,r.to)};return null})}}const sZ={resolve:"Strikethrough",mark:"StrikethroughMark"},oZ={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":I.strikethrough}},{name:"StrikethroughMark",style:I.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let n=i.slice(t-1,t),r=i.slice(t+2,t+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=Pa.test(n),a=Pa.test(r);return i.addDelimiter(sZ,t,t+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:"Emphasis"}]};function ql(i,e,t=0,n,r=0){let s=0,o=!0,l=-1,a=-1,c=!1,u=()=>{n.push(i.elt("TableCell",r+l,r+a,i.parser.parseInline(e.slice(l,a),r+l)))};for(let h=t;h-1)&&s++,o=!1,n&&(l>-1&&u(),n.push(i.elt("TableDelimiter",h+r,h+r+1))),l=a=-1):(c||f!=32&&f!=9)&&(l<0&&(l=h),a=h+1),c=!c&&f==92}return l>-1&&(s++,n&&u()),s}function Qv(i,e){for(let t=e;tr instanceof Mv)||!Qv(e.text,e.basePos))return!1;let n=i.scanLine(i.absoluteLineEnd+1).text;return AC.test(n)&&ql(i,e.text,e.basePos)==ql(i,n,e.basePos)},before:"SetextHeading"}]};class aZ{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const cZ={defineNodes:[{name:"Task",block:!0,style:I.list},{name:"TaskMarker",style:I.atom}],parseBlock:[{name:"TaskList",leaf(i,e){return/^\[[ xX]\][ \t]/.test(e.content)&&i.parentType().name=="ListItem"?new aZ:null},after:"SetextHeading"}]},Ev=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,Rv=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,uZ=/[\w-]+\.[\w-]+($|\/)/,Dv=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,$v=/\/[a-zA-Z\d@.]+/gy;function Lv(i,e,t,n){let r=0;for(let s=e;s-1)return-1;let n=e+t[0].length;for(;;){let r=i[n-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&Lv(i,e,n,")")>Lv(i,e,n,"("))n--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(i.slice(e,n))))n=e+s.index;else break}return n}function Iv(i,e){Dv.lastIndex=e;let t=Dv.exec(i);if(!t)return-1;let n=t[0][t[0].length-1];return n=="_"||n=="-"?-1:e+t[0].length-(n=="."?1:0)}const fZ={parseInline:[{name:"Autolink",parse(i,e,t){let n=t-i.offset;Ev.lastIndex=n;let r=Ev.exec(i.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=hZ(i.text,n+r[0].length),s>-1&&i.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(i.text.slice(n,s));s=n+o[0].length}}else r[3]?s=Iv(i.text,n):(s=Iv(i.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&($v.lastIndex=s,r=$v.exec(i.text),r&&(s=r.index+r[0].length)));return s<0?-1:(i.addElement(i.elt("URL",t,s+i.offset)),s+i.offset)}}]},dZ=[lZ,cZ,oZ,fZ];function xC(i,e,t){return(n,r,s)=>{if(r!=i||n.char(s+1)==i)return-1;let o=[n.elt(t,s,s+1)];for(let l=s+1;l=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function LC(i){return i==9||i==10||i==13||i==32}let Wv=null,Xv=null,Fv=0;function Im(i,e){let t=i.pos+e;if(Fv==t&&Xv==i)return Wv;let n=i.peek(e);for(;LC(n);)n=i.peek(++e);let r="";for(;ZZ(n);)r+=String.fromCharCode(n),n=i.peek(++e);return Xv=i,Fv=t,Wv=r?r.toLowerCase():n==BZ||n==WZ?void 0:null}const IC=60,eh=62,jp=47,BZ=63,WZ=33,XZ=45;function Yv(i,e){this.name=i,this.parent=e}const FZ=[Ju,EC,TC,QC,MC],YZ=new lC({start:null,shift(i,e,t,n){return FZ.indexOf(e)>-1?new Yv(Im(n,1)||"",i):i},reduce(i,e){return e==RC&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==Ju||r==RZ?new Yv(Im(n,1)||"",i):i},strict:!1}),zZ=new Ei((i,e)=>{if(i.next!=IC){i.next<0&&e.context&&i.acceptToken(Kf);return}i.advance();let t=i.next==jp;t&&i.advance();let n=Im(i,0);if(n===void 0)return;if(!n)return i.acceptToken(t?AZ:Ju);let r=e.context?e.context.name:null;if(t){if(n==r)return i.acceptToken(_Z);if(r&&NZ[r])return i.acceptToken(Kf,-2);if(e.dialectEnabled($Z))return i.acceptToken(CZ);for(let s=e.context;s;s=s.parent)if(s.name==n)return;i.acceptToken(PZ)}else{if(n=="script")return i.acceptToken(TC);if(n=="style")return i.acceptToken(QC);if(n=="textarea")return i.acceptToken(MC);if(IZ.hasOwnProperty(n))return i.acceptToken(EC);r&&Bv[r]&&Bv[r][n]?i.acceptToken(Kf,-1):i.acceptToken(Ju)}},{contextual:!0}),VZ=new Ei(i=>{for(let e=0,t=0;;t++){if(i.next<0){t&&i.acceptToken(Zv);break}if(i.next==XZ)e++;else if(i.next==eh&&e>=2){t>=3&&i.acceptToken(Zv,-2);break}else e=0;i.advance()}});function UZ(i){for(;i;i=i.parent)if(i.name=="svg"||i.name=="math")return!0;return!1}const jZ=new Ei((i,e)=>{if(i.next==jp&&i.peek(1)==eh){let t=e.dialectEnabled(LZ)||UZ(e.context);i.acceptToken(t?SZ:Nv,2)}else i.next==eh&&i.acceptToken(Nv,1)});function qp(i,e,t){let n=2+i.length;return new Ei(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==IC||s==1&&r.next==jp||s>=2&&so?r.acceptToken(e,-o):r.acceptToken(t,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}const qZ=qp("script",OZ,bZ),GZ=qp("style",vZ,wZ),HZ=qp("textarea",yZ,kZ),KZ=Ws({"Text RawText":I.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":I.angleBracket,TagName:I.tagName,"MismatchedCloseTag/TagName":[I.tagName,I.invalid],AttributeName:I.attributeName,"AttributeValue UnquotedAttributeValue":I.attributeValue,Is:I.definitionOperator,"EntityReference CharacterReference":I.character,Comment:I.blockComment,ProcessingInst:I.processingInstruction,DoctypeDecl:I.documentMeta}),JZ=Ls.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:YZ,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[KZ],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=l.type.id;if(c==QZ)return Jf(l,a,t);if(c==MZ)return Jf(l,a,n);if(c==EZ)return Jf(l,a,r);if(c==RC&&s.length){let u=l.node,h=u.firstChild,f=h&&zv(h,a),d;if(f){for(let m of s)if(m.tag==f&&(!m.attrs||m.attrs(d||(d=NC(h,a))))){let p=u.lastChild,g=p.type.id==DZ?p.from:u.to;if(g>h.to)return{parser:m.parser,overlay:[{from:h.to,to:g}]}}}}if(o&&c==DC){let u=l.node,h;if(h=u.firstChild){let f=o[a.read(h.from,h.to)];if(f)for(let d of f){if(d.tagName&&d.tagName!=zv(u.parent,a))continue;let m=u.lastChild;if(m.type.id==Lm){let p=m.from+1,g=m.lastChild,b=m.to-(g&&g.isError?0:1);if(b>p)return{parser:d.parser,overlay:[{from:p,to:b}]}}else if(m.type.id==$C)return{parser:d.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}const e8=99,Vv=1,t8=100,n8=101,Uv=2,BC=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],i8=58,r8=40,WC=95,s8=91,iu=45,o8=46,l8=35,a8=37,c8=38,u8=92,h8=10;function Aa(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function XC(i){return i>=48&&i<=57}const f8=new Ei((i,e)=>{for(let t=!1,n=0,r=0;;r++){let{next:s}=i;if(Aa(s)||s==iu||s==WC||t&&XC(s))!t&&(s!=iu||r>0)&&(t=!0),n===r&&s==iu&&n++,i.advance();else if(s==u8&&i.peek(1)!=h8)i.advance(),i.next>-1&&i.advance(),t=!0;else{t&&i.acceptToken(s==r8?t8:n==2&&e.canShift(Uv)?Uv:n8);break}}}),d8=new Ei(i=>{if(BC.includes(i.peek(-1))){let{next:e}=i;(Aa(e)||e==WC||e==l8||e==o8||e==s8||e==i8&&Aa(i.peek(1))||e==iu||e==c8)&&i.acceptToken(e8)}}),m8=new Ei(i=>{if(!BC.includes(i.peek(-1))){let{next:e}=i;if(e==a8&&(i.advance(),i.acceptToken(Vv)),Aa(e)){do i.advance();while(Aa(i.next)||XC(i.next));i.acceptToken(Vv)}}}),p8=Ws({"AtKeyword import charset namespace keyframes media supports":I.definitionKeyword,"from to selector":I.keyword,NamespaceName:I.namespace,KeyframeName:I.labelName,KeyframeRangeName:I.operatorKeyword,TagName:I.tagName,ClassName:I.className,PseudoClassName:I.constant(I.className),IdName:I.labelName,"FeatureName PropertyName":I.propertyName,AttributeName:I.attributeName,NumberLiteral:I.number,KeywordQuery:I.keyword,UnaryQueryOp:I.operatorKeyword,"CallTag ValueName":I.atom,VariableName:I.variableName,Callee:I.operatorKeyword,Unit:I.unit,"UniversalSelector NestingSelector":I.definitionOperator,MatchOp:I.compareOperator,"ChildOp SiblingOp, LogicOp":I.logicOperator,BinOp:I.arithmeticOperator,Important:I.modifier,Comment:I.blockComment,ColorLiteral:I.color,"ParenthesizedContent StringLiteral":I.string,":":I.punctuation,"PseudoOp #":I.derefOperator,"; ,":I.separator,"( )":I.paren,"[ ]":I.squareBracket,"{ }":I.brace}),g8={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},O8={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},b8={__proto__:null,not:132,only:132},v8=Ls.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[d8,m8,f8,1,2,3,4,new Hu("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:i=>g8[i]||-1},{term:58,get:i=>O8[i]||-1},{term:101,get:i=>b8[i]||-1}],tokenPrec:1200});let ed=null;function td(){if(!ed&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let n in i)n!="cssText"&&n!="cssFloat"&&typeof i[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(n)||(e.push(n),t.add(n)));ed=e.sort().map(n=>({type:"property",label:n}))}return ed||[]}const jv=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(i=>({type:"class",label:i})),qv=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(i=>({type:"keyword",label:i})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(i=>({type:"constant",label:i}))),w8=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(i=>({type:"type",label:i})),Pr=/^(\w[\w-]*|-\w[\w-]*|)$/,y8=/^-(-[\w-]*)?$/;function k8(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let n=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const Gv=new T2,S8=["Declaration"];function _8(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function FC(i,e,t){if(e.to-e.from>4096){let n=Gv.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(Pt.IncludeAnonymous);if(o.firstChild())do for(let l of FC(i,o.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return Gv.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(S8)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=i.sliceString(s.from,s.to);r.has(l)||(r.add(l),n.push({label:l,type:"variable"}))}}),n}}const C8=i=>e=>{let{state:t,pos:n}=e,r=At(t).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:td(),validFor:Pr};if(r.name=="ValueName")return{from:r.from,options:qv,validFor:Pr};if(r.name=="PseudoClassName")return{from:r.from,options:jv,validFor:Pr};if(i(r)||(e.explicit||s)&&k8(r,t.doc))return{from:i(r)||s?r.from:n,options:FC(t.doc,_8(r),i),validFor:y8};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:td(),validFor:Pr};return{from:r.from,options:w8,validFor:Pr}}if(!e.explicit)return null;let o=r.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:jv,validFor:Pr}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:qv,validFor:Pr}:o.name=="Block"||o.name=="Styles"?{from:n,options:td(),validFor:Pr}:null},P8=C8(i=>i.name=="VariableName"),th=Ds.define({name:"css",parser:v8.configure({props:[Yo.add({Declaration:vo()}),Xs.add({"Block KeyframeList":Ap})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function A8(){return new Ro(th,th.data.of({autocomplete:P8}))}const x8=312,Hv=1,T8=2,Q8=3,M8=4,E8=313,R8=315,D8=316,$8=5,L8=6,I8=0,Nm=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],YC=125,N8=59,Zm=47,Z8=42,B8=43,W8=45,X8=60,F8=44,Y8=63,z8=46,V8=new lC({start:!1,shift(i,e){return e==$8||e==L8||e==R8?i:e==D8},strict:!1}),U8=new Ei((i,e)=>{let{next:t}=i;(t==YC||t==-1||e.context)&&i.acceptToken(E8)},{contextual:!0,fallback:!0}),j8=new Ei((i,e)=>{let{next:t}=i,n;Nm.indexOf(t)>-1||t==Zm&&((n=i.peek(1))==Zm||n==Z8)||t!=YC&&t!=N8&&t!=-1&&!e.context&&i.acceptToken(x8)},{contextual:!0}),q8=new Ei((i,e)=>{let{next:t}=i;if(t==B8||t==W8){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(Hv);i.acceptToken(n?Hv:T8)}}else t==Y8&&i.peek(1)==z8&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(Q8))},{contextual:!0});function nd(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const G8=new Ei((i,e)=>{if(i.next!=X8||!e.dialectEnabled(I8)||(i.advance(),i.next==Zm))return;let t=0;for(;Nm.indexOf(i.next)>-1;)i.advance(),t++;if(nd(i.next,!0)){for(i.advance(),t++;nd(i.next,!1);)i.advance(),t++;for(;Nm.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==F8)return;for(let n=0;;n++){if(n==7){if(!nd(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(M8,-t)}),H8=Ws({"get set async static":I.modifier,"for while do if else switch try catch finally return throw break continue default case":I.controlKeyword,"in of await yield void typeof delete instanceof":I.operatorKeyword,"let var const using function class extends":I.definitionKeyword,"import export from":I.moduleKeyword,"with debugger as new":I.keyword,TemplateString:I.special(I.string),super:I.atom,BooleanLiteral:I.bool,this:I.self,null:I.null,Star:I.modifier,VariableName:I.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":I.function(I.variableName),VariableDefinition:I.definition(I.variableName),Label:I.labelName,PropertyName:I.propertyName,PrivatePropertyName:I.special(I.propertyName),"CallExpression/MemberExpression/PropertyName":I.function(I.propertyName),"FunctionDeclaration/VariableDefinition":I.function(I.definition(I.variableName)),"ClassDeclaration/VariableDefinition":I.definition(I.className),PropertyDefinition:I.definition(I.propertyName),PrivatePropertyDefinition:I.definition(I.special(I.propertyName)),UpdateOp:I.updateOperator,"LineComment Hashbang":I.lineComment,BlockComment:I.blockComment,Number:I.number,String:I.string,Escape:I.escape,ArithOp:I.arithmeticOperator,LogicOp:I.logicOperator,BitOp:I.bitwiseOperator,CompareOp:I.compareOperator,RegExp:I.regexp,Equals:I.definitionOperator,Arrow:I.function(I.punctuation),": Spread":I.punctuation,"( )":I.paren,"[ ]":I.squareBracket,"{ }":I.brace,"InterpolationStart InterpolationEnd":I.special(I.brace),".":I.derefOperator,", ;":I.separator,"@":I.meta,TypeName:I.typeName,TypeDefinition:I.definition(I.typeName),"type enum interface implements namespace module declare":I.definitionKeyword,"abstract global Privacy readonly override":I.modifier,"is keyof unique infer":I.operatorKeyword,JSXAttributeValue:I.attributeValue,JSXText:I.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":I.angleBracket,"JSXIdentifier JSXNameSpacedName":I.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":I.attributeName,"JSXBuiltin/JSXIdentifier":I.standard(I.tagName)}),K8={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},J8={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},eB={__proto__:null,"<":187},tB=Ls.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:V8,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[H8],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-K8[i]||-1},{term:338,get:i=>J8[i]||-1},{term:92,get:i=>eB[i]||-1}],tokenPrec:14749}),zC=[Qn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Qn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Qn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Qn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Qn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Qn(`try { +`);n=r<0?t:t.slice(0,r)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=Ku.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e=="number"&&(e=new gt(this.parser.nodeSet.types[e],Io,Io,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements($m(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?cC(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let t=$m(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(ue.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e=="string"?rt(this.parser.getNodeType(e),t,n,r):new fC(e,t)}get buffer(){return new hC(this.parser.nodeSet)}}function cC(i,e,t,n,r){let s=i[e].to,o=[],l=[],a=t.from+n;function c(u,h){for(;h?u>=s:u>s;){let f=i[e+1].from-s;n+=f,u+=f,e++,s=i[e].to}}for(let u=t.firstChild;u;u=u.nextSibling){c(u.from+n,!0);let h=u.from+n,f,d=r.get(u.tree);d?f=d:u.to+n>s?(f=cC(i,e,u,n,r),c(u.to+n,!1)):f=u.toTree(),o.push(f),l.push(h-a)}return c(t.to+n,!1),new gt(t.type,o,l,t.to+n-a,t.tree?t.tree.propValues:void 0)}class Ch extends wp{constructor(e,t,n,r,s,o,l,a,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=a,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,t,n){let r=new WN(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}configure(e){let t=Rm(e);if(!t)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),a=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),h=this.wrappers;if(gl(t.defineNodes)){r=Object.assign({},r);let f=n.types.slice(),d;for(let m of t.defineNodes){let{name:p,block:g,composite:v,style:w}=typeof m=="string"?{name:m}:m;if(f.some(k=>k.name==p))continue;v&&(r[f.length]=(k,A,C)=>v(A,C,k.value));let S=f.length,_=v?["Block","BlockContext"]:g?S>=ue.ATXHeading1&&S<=ue.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(tn.define({id:S,name:p,props:_&&[[Ze.group,_]]})),w&&(d||(d={}),Array.isArray(w)||w instanceof jn?d[p]=w:Object.assign(d,w))}n=new Za(f),d&&(n=n.extend(Xs(d)))}if(gl(t.props)&&(n=n.extend(...t.props)),gl(t.remove))for(let f of t.remove){let d=this.blockNames.indexOf(f),m=this.inlineNames.indexOf(f);d>-1&&(s[d]=o[d]=void 0),m>-1&&(a[m]=void 0)}if(gl(t.parseBlock))for(let f of t.parseBlock){let d=l.indexOf(f.name);if(d>-1)s[d]=f.parse,o[d]=f.leaf;else{let m=f.before?Rc(l,f.before):f.after?Rc(l,f.after)+1:l.length-1;s.splice(m,0,f.parse),o.splice(m,0,f.leaf),l.splice(m,0,f.name)}f.endLeaf&&u.push(f.endLeaf)}if(gl(t.parseInline))for(let f of t.parseInline){let d=c.indexOf(f.name);if(d>-1)a[d]=f.parse;else{let m=f.before?Rc(c,f.before):f.after?Rc(c,f.after)+1:c.length-1;a.splice(m,0,f.parse),c.splice(m,0,f.name)}}return t.wrap&&(h=h.concat(t.wrap)),new Ch(n,s,o,l,u,r,a,c,h)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new FN(this,e,t);e:for(let r=t;r=0){r=l;continue e}}r++}return n.resolveMarkers(0)}}function gl(i){return i!=null&&i.length>0}function Rm(i){if(!Array.isArray(i))return i;if(i.length==0)return null;let e=Rm(i[0]);if(i.length==1)return e;let t=Rm(i.slice(1));if(!t||!e)return e||t;let n=(o,l)=>(o||Io).concat(l||Io),r=e.wrap,s=t.wrap;return{props:n(e.props,t.props),defineNodes:n(e.defineNodes,t.defineNodes),parseBlock:n(e.parseBlock,t.parseBlock),parseInline:n(e.parseInline,t.parseInline),remove:n(e.remove,t.remove),wrap:r?s?(o,l,a,c)=>r(s(o,l,a,c),l,a,c):r:s}}function Rc(i,e){let t=i.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let uC=[tn.none];for(let i=1,e;e=ue[i];i++)uC[i]=tn.define({id:i,name:e,props:i>=ue.Escape?[]:[[Ze.group,i in eC?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Io=[];class hC{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return gt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let Ca=class{constructor(e,t,n,r=Io){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new hC(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class fC{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Io}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function rt(i,e,t,n){return new Ca(i,e,t,n)}const dC={resolve:"Emphasis",mark:"EmphasisMark"},mC={resolve:"Emphasis",mark:"EmphasisMark"},no={},Dm={};class ri{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}}const vv="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Pa=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Pa=new RegExp("[\\p{Pc}|\\p{Pd}|\\p{Pe}|\\p{Pf}|\\p{Pi}|\\p{Po}|\\p{Ps}]","u")}catch{}const Hf={Escape(i,e,t){if(e!=92||t==i.end-1)return-1;let n=i.char(t+1);for(let r=0;r]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(n);if(r)return i.append(rt(ue.Autolink,t,t+1+r[0].length,[rt(ue.LinkMark,t,t+1),rt(ue.URL,t+1,t+r[0].length),rt(ue.LinkMark,t+r[0].length,t+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(s)return i.append(rt(ue.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return i.append(rt(ue.ProcessingInstruction,t,t+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return l?i.append(rt(ue.HTMLTag,t,t+1+l[0].length)):-1},Emphasis(i,e,t){if(e!=95&&e!=42)return-1;let n=t+1;for(;i.char(n)==e;)n++;let r=i.slice(t-1,t),s=i.slice(n,n+1),o=Pa.test(r),l=Pa.test(s),a=/\s|^$/.test(r),c=/\s|^$/.test(s),u=!c&&(!l||a||o),h=!a&&(!o||c||l),f=u&&(e==42||!h||o),d=h&&(e==42||!u||l);return i.append(new ri(e==95?dC:mC,t,n,(f?1:0)|(d?2:0)))},HardBreak(i,e,t){if(e==92&&i.char(t+1)==10)return i.append(rt(ue.HardBreak,t,t+2));if(e==32){let n=t+1;for(;i.char(n)==32;)n++;if(i.char(n)==10&&n>=t+2)return i.append(rt(ue.HardBreak,t,n+1))}return-1},Link(i,e,t){return e==91?i.append(new ri(no,t,t+1,1)):-1},Image(i,e,t){return e==33&&i.char(t+1)==91?i.append(new ri(Dm,t,t+2,1)):-1},LinkEnd(i,e,t){if(e!=93)return-1;for(let n=i.parts.length-1;n>=0;n--){let r=i.parts[n];if(r instanceof ri&&(r.type==no||r.type==Dm)){if(!r.side||i.skipSpace(r.to)==t&&!/[(\[]/.test(i.slice(t+1,t+2)))return i.parts[n]=null,-1;let s=i.takeContent(n),o=i.parts[n]=XN(i,s,r.type==no?ue.Link:ue.Image,r.from,t+1);if(r.type==no)for(let l=0;le?rt(ue.URL,e+t,s+t):s==i.length?null:!1}}function gC(i,e,t){let n=i.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let r=n==40?41:n;for(let s=e+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,s){return this.append(new ri(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof ri&&(t.type==no||t.type==Dm))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;a--){let p=this.parts[a];if(p instanceof ri&&p.side&1&&p.type==r.type&&!(s&&(r.side&1||p.side&2)&&(p.to-p.from+o)%3==0&&((p.to-p.from)%3||o%3))){l=p;break}}if(!l)continue;let c=r.type.resolve,u=[],h=l.from,f=r.to;if(s){let p=Math.min(2,l.to-l.from,o);h=l.to-p,f=r.from+p,c=p==1?"Emphasis":"StrongEmphasis"}l.type.mark&&u.push(this.elt(l.type.mark,h,l.to));for(let p=a+1;p=0;t--){let n=this.parts[t];if(n instanceof ri&&n.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return ql(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e=="string"?rt(this.parser.getNodeType(e),t,n,r):new fC(e,t)}}function $m(i,e){if(!e.length)return i;if(!i.length)return e;let t=i.slice(),n=0;for(let r of e){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` +`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Ze.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,c=l;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let u=bC(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,u);else{let h=new gt(e.parser.nodeSet.types[ue.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,u)}if(t.type.is("Block")&&(YN.indexOf(t.type.id)<0?(o=t.to-n,l=e.block.children.length):(o=a,l=c,a=t.to-n,c=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}}function bC(i,e){let t=i;for(let n=1;nEc[i]),Object.keys(Ec).map(i=>NN[i]),Object.keys(Ec),ZN,eC,Object.keys(Hf).map(i=>Hf[i]),Object.keys(Hf),[]);function jN(i,e,t){let n=[];for(let r=i.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function qN(i){let{codeParser:e,htmlParser:t}=i;return{wrap:k2((r,s)=>{let o=r.type.id;if(e&&(o==ue.CodeBlock||o==ue.FencedCode)){let l="";if(o==ue.FencedCode){let c=r.node.getChild(ue.CodeInfo);c&&(l=s.read(c.from,c.to))}let a=e(l);if(a)return{parser:a,overlay:c=>c.type.id==ue.CodeText}}else if(t&&(o==ue.HTMLBlock||o==ue.HTMLTag))return{parser:t,overlay:jN(r.node,r.from,r.to)};return null})}}const GN={resolve:"Strikethrough",mark:"StrikethroughMark"},HN={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":I.strikethrough}},{name:"StrikethroughMark",style:I.processingInstruction}],parseInline:[{name:"Strikethrough",parse(i,e,t){if(e!=126||i.char(t+1)!=126||i.char(t+2)==126)return-1;let n=i.slice(t-1,t),r=i.slice(t+2,t+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=Pa.test(n),a=Pa.test(r);return i.addDelimiter(GN,t,t+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:"Emphasis"}]};function Gl(i,e,t=0,n,r=0){let s=0,o=!0,l=-1,a=-1,c=!1,u=()=>{n.push(i.elt("TableCell",r+l,r+a,i.parser.parseInline(e.slice(l,a),r+l)))};for(let h=t;h-1)&&s++,o=!1,n&&(l>-1&&u(),n.push(i.elt("TableDelimiter",h+r,h+r+1))),l=a=-1):(c||f!=32&&f!=9)&&(l<0&&(l=h),a=h+1),c=!c&&f==92}return l>-1&&(s++,n&&u()),s}function wv(i,e){for(let t=e;tr instanceof yv)||!wv(e.text,e.basePos))return!1;let n=i.scanLine(i.absoluteLineEnd+1).text;return vC.test(n)&&Gl(i,e.text,e.basePos)==Gl(i,n,e.basePos)},before:"SetextHeading"}]};class JN{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const eZ={defineNodes:[{name:"Task",block:!0,style:I.list},{name:"TaskMarker",style:I.atom}],parseBlock:[{name:"TaskList",leaf(i,e){return/^\[[ xX]\][ \t]/.test(e.content)&&i.parentType().name=="ListItem"?new JN:null},after:"SetextHeading"}]},kv=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,Sv=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,tZ=/[\w-]+\.[\w-]+($|\/)/,_v=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Cv=/\/[a-zA-Z\d@.]+/gy;function Pv(i,e,t,n){let r=0;for(let s=e;s-1)return-1;let n=e+t[0].length;for(;;){let r=i[n-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&Pv(i,e,n,")")>Pv(i,e,n,"("))n--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(i.slice(e,n))))n=e+s.index;else break}return n}function Av(i,e){_v.lastIndex=e;let t=_v.exec(i);if(!t)return-1;let n=t[0][t[0].length-1];return n=="_"||n=="-"?-1:e+t[0].length-(n=="."?1:0)}const iZ={parseInline:[{name:"Autolink",parse(i,e,t){let n=t-i.offset;kv.lastIndex=n;let r=kv.exec(i.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=nZ(i.text,n+r[0].length),s>-1&&i.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(i.text.slice(n,s));s=n+o[0].length}}else r[3]?s=Av(i.text,n):(s=Av(i.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&(Cv.lastIndex=s,r=Cv.exec(i.text),r&&(s=r.index+r[0].length)));return s<0?-1:(i.addElement(i.elt("URL",t,s+i.offset)),s+i.offset)}}]},rZ=[KN,eZ,HN,iZ];function wC(i,e,t){return(n,r,s)=>{if(r!=i||n.char(s+1)==i)return-1;let o=[n.elt(t,s,s+1)];for(let l=s+1;l=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function xC(i){return i==9||i==10||i==13||i==32}let Mv=null,Ev=null,Rv=0;function Im(i,e){let t=i.pos+e;if(Rv==t&&Ev==i)return Mv;let n=i.peek(e);for(;xC(n);)n=i.peek(++e);let r="";for(;QZ(n);)r+=String.fromCharCode(n),n=i.peek(++e);return Ev=i,Rv=t,Mv=r?r.toLowerCase():n==MZ||n==EZ?void 0:null}const TC=60,eh=62,Vp=47,MZ=63,EZ=33,RZ=45;function Dv(i,e){this.name=i,this.parent=e}const DZ=[Ju,_C,yC,kC,SC],$Z=new J_({start:null,shift(i,e,t,n){return DZ.indexOf(e)>-1?new Dv(Im(n,1)||"",i):i},reduce(i,e){return e==CC&&i?i.parent:i},reuse(i,e,t,n){let r=e.type.id;return r==Ju||r==_Z?new Dv(Im(n,1)||"",i):i},strict:!1}),LZ=new Ei((i,e)=>{if(i.next!=TC){i.next<0&&e.context&&i.acceptToken(Kf);return}i.advance();let t=i.next==Vp;t&&i.advance();let n=Im(i,0);if(n===void 0)return;if(!n)return i.acceptToken(t?bZ:Ju);let r=e.context?e.context.name:null;if(t){if(n==r)return i.acceptToken(pZ);if(r&&TZ[r])return i.acceptToken(Kf,-2);if(e.dialectEnabled(PZ))return i.acceptToken(gZ);for(let s=e.context;s;s=s.parent)if(s.name==n)return;i.acceptToken(OZ)}else{if(n=="script")return i.acceptToken(yC);if(n=="style")return i.acceptToken(kC);if(n=="textarea")return i.acceptToken(SC);if(xZ.hasOwnProperty(n))return i.acceptToken(_C);r&&Qv[r]&&Qv[r][n]?i.acceptToken(Kf,-1):i.acceptToken(Ju)}},{contextual:!0}),IZ=new Ei(i=>{for(let e=0,t=0;;t++){if(i.next<0){t&&i.acceptToken(Tv);break}if(i.next==RZ)e++;else if(i.next==eh&&e>=2){t>=3&&i.acceptToken(Tv,-2);break}else e=0;i.advance()}});function NZ(i){for(;i;i=i.parent)if(i.name=="svg"||i.name=="math")return!0;return!1}const ZZ=new Ei((i,e)=>{if(i.next==Vp&&i.peek(1)==eh){let t=e.dialectEnabled(AZ)||NZ(e.context);i.acceptToken(t?mZ:xv,2)}else i.next==eh&&i.acceptToken(xv,1)});function Up(i,e,t){let n=2+i.length;return new Ei(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==TC||s==1&&r.next==Vp||s>=2&&so?r.acceptToken(e,-o):r.acceptToken(t,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}const BZ=Up("script",aZ,cZ),WZ=Up("style",uZ,hZ),XZ=Up("textarea",fZ,dZ),FZ=Xs({"Text RawText":I.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":I.angleBracket,TagName:I.tagName,"MismatchedCloseTag/TagName":[I.tagName,I.invalid],AttributeName:I.attributeName,"AttributeValue UnquotedAttributeValue":I.attributeValue,Is:I.definitionOperator,"EntityReference CharacterReference":I.character,Comment:I.blockComment,ProcessingInst:I.processingInstruction,DoctypeDecl:I.documentMeta}),YZ=Is.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1G/T1G/TO)TQ&rO1G/WOOO`1G/W1G/WO)`Q&rO1G/YOOOa-E7[-E7[O)kQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)pQ#tO'#C|OOOd-E7^-E7^O)uQ#tO'#DPOOO`-E7_-E7_O)zQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O*PQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOO`7+$t7+$tOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rO*[Q#|O,59eO*aQ#|O,59hO*fQ#|O,59kOOO`1G/X1G/XO*kO7[O'#CvO*|OMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O+_O7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+pOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:",]~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:$Z,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[FZ],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=l.type.id;if(c==yZ)return Jf(l,a,t);if(c==kZ)return Jf(l,a,n);if(c==SZ)return Jf(l,a,r);if(c==CC&&s.length){let u=l.node,h=u.firstChild,f=h&&$v(h,a),d;if(f){for(let m of s)if(m.tag==f&&(!m.attrs||m.attrs(d||(d=QC(h,a))))){let p=u.lastChild,g=p.type.id==CZ?p.from:u.to;if(g>h.to)return{parser:m.parser,overlay:[{from:h.to,to:g}]}}}}if(o&&c==PC){let u=l.node,h;if(h=u.firstChild){let f=o[a.read(h.from,h.to)];if(f)for(let d of f){if(d.tagName&&d.tagName!=$v(u.parent,a))continue;let m=u.lastChild;if(m.type.id==Lm){let p=m.from+1,g=m.lastChild,v=m.to-(g&&g.isError?0:1);if(v>p)return{parser:d.parser,overlay:[{from:p,to:v}]}}else if(m.type.id==AC)return{parser:d.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}const zZ=99,Lv=1,VZ=100,UZ=101,Iv=2,EC=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],jZ=58,qZ=40,RC=95,GZ=91,iu=45,HZ=46,KZ=35,JZ=37,e8=38,t8=92,n8=10;function Aa(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function DC(i){return i>=48&&i<=57}const i8=new Ei((i,e)=>{for(let t=!1,n=0,r=0;;r++){let{next:s}=i;if(Aa(s)||s==iu||s==RC||t&&DC(s))!t&&(s!=iu||r>0)&&(t=!0),n===r&&s==iu&&n++,i.advance();else if(s==t8&&i.peek(1)!=n8)i.advance(),i.next>-1&&i.advance(),t=!0;else{t&&i.acceptToken(s==qZ?VZ:n==2&&e.canShift(Iv)?Iv:UZ);break}}}),r8=new Ei(i=>{if(EC.includes(i.peek(-1))){let{next:e}=i;(Aa(e)||e==RC||e==KZ||e==HZ||e==GZ||e==jZ&&Aa(i.peek(1))||e==iu||e==e8)&&i.acceptToken(zZ)}}),s8=new Ei(i=>{if(!EC.includes(i.peek(-1))){let{next:e}=i;if(e==JZ&&(i.advance(),i.acceptToken(Lv)),Aa(e)){do i.advance();while(Aa(i.next)||DC(i.next));i.acceptToken(Lv)}}}),o8=Xs({"AtKeyword import charset namespace keyframes media supports":I.definitionKeyword,"from to selector":I.keyword,NamespaceName:I.namespace,KeyframeName:I.labelName,KeyframeRangeName:I.operatorKeyword,TagName:I.tagName,ClassName:I.className,PseudoClassName:I.constant(I.className),IdName:I.labelName,"FeatureName PropertyName":I.propertyName,AttributeName:I.attributeName,NumberLiteral:I.number,KeywordQuery:I.keyword,UnaryQueryOp:I.operatorKeyword,"CallTag ValueName":I.atom,VariableName:I.variableName,Callee:I.operatorKeyword,Unit:I.unit,"UniversalSelector NestingSelector":I.definitionOperator,MatchOp:I.compareOperator,"ChildOp SiblingOp, LogicOp":I.logicOperator,BinOp:I.arithmeticOperator,Important:I.modifier,Comment:I.blockComment,ColorLiteral:I.color,"ParenthesizedContent StringLiteral":I.string,":":I.punctuation,"PseudoOp #":I.derefOperator,"; ,":I.separator,"( )":I.paren,"[ ]":I.squareBracket,"{ }":I.brace}),l8={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},a8={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},c8={__proto__:null,not:132,only:132},u8=Is.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-xQWO,5;_O-xQWO,5;_POOO'#EV'#EVP.TO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.zQXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/XQ`O1G/^O/rQXO1G/aO0YQXO1G/cO0pQXO1G/dO1WQWO,59|O1]Q[O'#DSO1dQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1kQpO,59]OOQS,59_,59_O${QdO,59aO1sQWO1G/mOOQS,59c,59cO1xQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2QQ[O,59jOOQS,59j,59jO2YQWO'#DjO2eQWO,5:VO2jQWO,5:]O&`Q[O,5:XO&`Q[O'#E_O2rQWO,5;`O2}QWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3`QWO1G0OO3eQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO3pQtO1G/iOOQO,5:x,5:xO4WQ[O,5:xOOQO-E8[-E8[O4eQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO4pQXO'#ErO4wQWO,59nO4|QtO'#EXO5tQdO'#EoO6OQWO,59ZO6TQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XO6]QWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6bQWO,5:yOOQO-E8]-E8]O6pQXO1G/xOOQS7+%j7+%jO6wQYO'#CsOOQO'#EQ'#EQO7SQ`O'#EPOOQO'#EP'#EPO7_QWO'#E`O7gQdO,5:jOOQS,5:j,5:jO7rQtO'#E]O${QdO'#E]O8sQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9WQpO<OAN>OO:xQdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[r8,s8,i8,1,2,3,4,new Hu("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:i=>l8[i]||-1},{term:58,get:i=>a8[i]||-1},{term:101,get:i=>c8[i]||-1}],tokenPrec:1200});let ed=null;function td(){if(!ed&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let n in i)n!="cssText"&&n!="cssFloat"&&typeof i[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(n)||(e.push(n),t.add(n)));ed=e.sort().map(n=>({type:"property",label:n}))}return ed||[]}const Nv=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(i=>({type:"class",label:i})),Zv=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(i=>({type:"keyword",label:i})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(i=>({type:"constant",label:i}))),h8=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(i=>({type:"type",label:i})),Pr=/^(\w[\w-]*|-\w[\w-]*|)$/,f8=/^-(-[\w-]*)?$/;function d8(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let n=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const Bv=new y2,m8=["Declaration"];function p8(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function $C(i,e,t){if(e.to-e.from>4096){let n=Bv.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(Pt.IncludeAnonymous);if(o.firstChild())do for(let l of $C(i,o.node,t))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return Bv.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(m8)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=i.sliceString(s.from,s.to);r.has(l)||(r.add(l),n.push({label:l,type:"variable"}))}}),n}}const g8=i=>e=>{let{state:t,pos:n}=e,r=At(t).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:td(),validFor:Pr};if(r.name=="ValueName")return{from:r.from,options:Zv,validFor:Pr};if(r.name=="PseudoClassName")return{from:r.from,options:Nv,validFor:Pr};if(i(r)||(e.explicit||s)&&d8(r,t.doc))return{from:i(r)||s?r.from:n,options:$C(t.doc,p8(r),i),validFor:f8};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:td(),validFor:Pr};return{from:r.from,options:h8,validFor:Pr}}if(!e.explicit)return null;let o=r.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:Nv,validFor:Pr}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:Zv,validFor:Pr}:o.name=="Block"||o.name=="Styles"?{from:n,options:td(),validFor:Pr}:null},O8=g8(i=>i.name=="VariableName"),th=$s.define({name:"css",parser:u8.configure({props:[zo.add({Declaration:wo()}),Fs.add({"Block KeyframeList":Cp})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function b8(){return new Do(th,th.data.of({autocomplete:O8}))}const v8=312,Wv=1,w8=2,y8=3,k8=4,S8=313,_8=315,C8=316,P8=5,A8=6,x8=0,Nm=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],LC=125,T8=59,Zm=47,Q8=42,M8=43,E8=45,R8=60,D8=44,$8=63,L8=46,I8=new J_({start:!1,shift(i,e){return e==P8||e==A8||e==_8?i:e==C8},strict:!1}),N8=new Ei((i,e)=>{let{next:t}=i;(t==LC||t==-1||e.context)&&i.acceptToken(S8)},{contextual:!0,fallback:!0}),Z8=new Ei((i,e)=>{let{next:t}=i,n;Nm.indexOf(t)>-1||t==Zm&&((n=i.peek(1))==Zm||n==Q8)||t!=LC&&t!=T8&&t!=-1&&!e.context&&i.acceptToken(v8)},{contextual:!0}),B8=new Ei((i,e)=>{let{next:t}=i;if(t==M8||t==E8){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(Wv);i.acceptToken(n?Wv:w8)}}else t==$8&&i.peek(1)==L8&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(y8))},{contextual:!0});function nd(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const W8=new Ei((i,e)=>{if(i.next!=R8||!e.dialectEnabled(x8)||(i.advance(),i.next==Zm))return;let t=0;for(;Nm.indexOf(i.next)>-1;)i.advance(),t++;if(nd(i.next,!0)){for(i.advance(),t++;nd(i.next,!1);)i.advance(),t++;for(;Nm.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==D8)return;for(let n=0;;n++){if(n==7){if(!nd(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(k8,-t)}),X8=Xs({"get set async static":I.modifier,"for while do if else switch try catch finally return throw break continue default case":I.controlKeyword,"in of await yield void typeof delete instanceof":I.operatorKeyword,"let var const using function class extends":I.definitionKeyword,"import export from":I.moduleKeyword,"with debugger as new":I.keyword,TemplateString:I.special(I.string),super:I.atom,BooleanLiteral:I.bool,this:I.self,null:I.null,Star:I.modifier,VariableName:I.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":I.function(I.variableName),VariableDefinition:I.definition(I.variableName),Label:I.labelName,PropertyName:I.propertyName,PrivatePropertyName:I.special(I.propertyName),"CallExpression/MemberExpression/PropertyName":I.function(I.propertyName),"FunctionDeclaration/VariableDefinition":I.function(I.definition(I.variableName)),"ClassDeclaration/VariableDefinition":I.definition(I.className),PropertyDefinition:I.definition(I.propertyName),PrivatePropertyDefinition:I.definition(I.special(I.propertyName)),UpdateOp:I.updateOperator,"LineComment Hashbang":I.lineComment,BlockComment:I.blockComment,Number:I.number,String:I.string,Escape:I.escape,ArithOp:I.arithmeticOperator,LogicOp:I.logicOperator,BitOp:I.bitwiseOperator,CompareOp:I.compareOperator,RegExp:I.regexp,Equals:I.definitionOperator,Arrow:I.function(I.punctuation),": Spread":I.punctuation,"( )":I.paren,"[ ]":I.squareBracket,"{ }":I.brace,"InterpolationStart InterpolationEnd":I.special(I.brace),".":I.derefOperator,", ;":I.separator,"@":I.meta,TypeName:I.typeName,TypeDefinition:I.definition(I.typeName),"type enum interface implements namespace module declare":I.definitionKeyword,"abstract global Privacy readonly override":I.modifier,"is keyof unique infer":I.operatorKeyword,JSXAttributeValue:I.attributeValue,JSXText:I.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":I.angleBracket,"JSXIdentifier JSXNameSpacedName":I.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":I.attributeName,"JSXBuiltin/JSXIdentifier":I.standard(I.tagName)}),F8={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,extends:54,this:58,true:66,false:66,null:78,void:82,typeof:86,super:102,new:136,delete:148,yield:157,await:161,class:166,public:229,private:229,protected:229,readonly:231,instanceof:250,satisfies:253,in:254,const:256,import:290,keyof:345,unique:349,infer:355,is:391,abstract:411,implements:413,type:415,let:418,var:420,using:423,interface:429,enum:433,namespace:439,module:441,declare:445,global:449,for:468,of:477,while:480,with:484,do:488,if:492,else:494,switch:498,case:504,try:510,catch:514,finally:518,return:522,throw:526,break:530,continue:534,debugger:538},Y8={__proto__:null,async:123,get:125,set:127,declare:189,public:191,private:191,protected:191,static:193,abstract:195,override:197,readonly:203,accessor:205,new:395},z8={__proto__:null,"<":187},V8=Is.deserialize({version:14,states:"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#GpOOQO'#K['#K[O;iQWO'#K[O;wQWO'#GxO;wQWO'#GyO;wQWO'#G{O9^QWO'#HOOVQWO'#CeO>gQWO'#H_O>oQWO'#HeO>oQWO'#HgO`Q^O'#HiO>oQWO'#HkO>oQWO'#HnO>tQWO'#HtO>yQ?MyO'#HzO%[Q^O'#H|O?UQ?MyO'#IOO?aQ?MyO'#IQO9hQ?MxO'#ISO?lQ?NdO'#CiO@nQ`O'#DiQOQWOOO%[Q^O'#D}OAUQWO'#EQO:VQ7[O'#EkOAaQWO'#EkOAlQpO'#FdOOQU'#Cg'#CgOOQ?Mp'#Dn'#DnOOQ?Mp'#Jq'#JqO%[Q^O'#JqOOQO'#Jt'#JtOOQO'#Id'#IdOBlQ`O'#EdOOQ?Mp'#Ec'#EcOOQ?Mp'#Jx'#JxOChQ?NQO'#EdOCrQ`O'#ETOOQO'#Js'#JsODWQ`O'#JtOEeQ`O'#ETOCrQ`O'#EdPErO#@ItO'#CbPOOO)CDx)CDxOOOO'#I['#I[OE}O!bO,59UOOQ?Mr,59U,59UOOOO'#I]'#I]OF]O#tO,59UO%[Q^O'#D`OOOO'#I_'#I_OFkO!0LbO,59xOOQ?Mr,59x,59xOFyQ^O'#I`OG^QWO'#JoOI]QrO'#JoO+}Q^O'#JoOIdQWO,5:OOIzQWO'#EmOJXQWO'#KOOJdQWO'#J}OJdQWO'#J}OJlQWO,5;ZOJqQWO'#J|OOQ?Mv,5:Z,5:ZOJxQ^O,5:ZOLvQ?NdO,5:cOMgQWO,5:kONQQ?MxO'#J{ONXQWO'#JzO9WQWO'#JzONmQWO'#JzONuQWO,5;YONzQWO'#JzO!#PQrO'#JnOOQ?Mr'#Ci'#CiO%[Q^O'#EPO!#oQrO,5:pOOQQ'#Ju'#JuOOQO-EpOOQU'#Jc'#JcOOQU,5>q,5>qOOQU-EtQWO'#HTO9^QWO'#HVO!DgQWO'#HVO:VQ7[O'#HXO!DlQWO'#HXOOQU,5=m,5=mO!DqQWO'#HYO!ESQWO'#CoO!EXQWO,59PO!EcQWO,59PO!GhQ^O,59POOQU,59P,59PO!GxQ?MxO,59PO%[Q^O,59PO!JTQ^O'#HaOOQU'#Hb'#HbOOQU'#Hc'#HcO`Q^O,5=yO!JkQWO,5=yO`Q^O,5>PO`Q^O,5>RO!JpQWO,5>TO`Q^O,5>VO!JuQWO,5>YO!JzQ^O,5>`OOQU,5>f,5>fO%[Q^O,5>fO9hQ?MxO,5>hOOQU,5>j,5>jO# UQWO,5>jOOQU,5>l,5>lO# UQWO,5>lOOQU,5>n,5>nO# rQ`O'#D[O%[Q^O'#JqO# |Q`O'#JqO#!kQ`O'#DjO#!|Q`O'#DjO#%_Q^O'#DjO#%fQWO'#JpO#%nQWO,5:TO#%sQWO'#EqO#&RQWO'#KPO#&ZQWO,5;[O#&`Q`O'#DjO#&mQ`O'#ESOOQ?Mr,5:l,5:lO%[Q^O,5:lO#&tQWO,5:lO>tQWO,5;VO!A}Q`O,5;VO!BVQ7[O,5;VO:VQ7[O,5;VO#&|QWO,5@]O#'RQ(CYO,5:pOOQO-EzO+}Q^O,5>zOOQO,5?Q,5?QO#*ZQ^O'#I`OOQO-E<^-E<^O#*hQWO,5@ZO#*pQrO,5@ZO#*wQWO,5@iOOQ?Mr1G/j1G/jO%[Q^O,5@jO#+PQWO'#IfOOQO-EuQ?NdO1G0|O#>|Q?NdO1G0|O#AZQ07bO'#CiO#CUQ07bO1G1_O#C]Q07bO'#JnO#CpQ?NdO,5?WOOQ?Mp-EoQWO1G3oO$3VQ^O1G3qO$7ZQ^O'#HpOOQU1G3t1G3tO$7hQWO'#HvO>tQWO'#HxOOQU1G3z1G3zO$7pQ^O1G3zO9hQ?MxO1G4QOOQU1G4S1G4SOOQ?Mp'#G]'#G]O9hQ?MxO1G4UO9hQ?MxO1G4WO$;wQWO,5@]O!(oQ^O,5;]O9WQWO,5;]O>tQWO,5:UO!(oQ^O,5:UO!A}Q`O,5:UO$;|Q07bO,5:UOOQO,5;],5;]O$tQWO1G0qO!A}Q`O1G0qO!BVQ7[O1G0qOOQ?Mp1G5w1G5wO!ArQ?MxO1G0ZOOQO1G0j1G0jO%[Q^O1G0jO$=aQ?MxO1G0jO$=lQ?MxO1G0jO!A}Q`O1G0ZOCrQ`O1G0ZO$=zQ?MxO1G0jOOQO1G0Z1G0ZO$>`Q?NdO1G0jPOOO-EjQpO,5rQrO1G4fOOQO1G4l1G4lO%[Q^O,5>zO$>|QWO1G5uO$?UQWO1G6TO$?^QrO1G6UO9WQWO,5?QO$?hQ?NdO1G6RO%[Q^O1G6RO$?xQ?MxO1G6RO$@ZQWO1G6QO$@ZQWO1G6QO9WQWO1G6QO$@cQWO,5?TO9WQWO,5?TOOQO,5?T,5?TO$@wQWO,5?TO$(PQWO,5?TOOQO-E[OOQU,5>[,5>[O%[Q^O'#HqO%8mQWO'#HsOOQU,5>b,5>bO9WQWO,5>bOOQU,5>d,5>dOOQU7+)f7+)fOOQU7+)l7+)lOOQU7+)p7+)pOOQU7+)r7+)rO%8rQ`O1G5wO%9WQ07bO1G0wO%9bQWO1G0wOOQO1G/p1G/pO%9mQ07bO1G/pO>tQWO1G/pO!(oQ^O'#DjOOQO,5>{,5>{OOQO-E<_-E<_OOQO,5?R,5?ROOQO-EtQWO7+&]O!A}Q`O7+&]OOQO7+%u7+%uO$>`Q?NdO7+&UOOQO7+&U7+&UO%[Q^O7+&UO%9wQ?MxO7+&UO!ArQ?MxO7+%uO!A}Q`O7+%uO%:SQ?MxO7+&UO%:bQ?NdO7++mO%[Q^O7++mO%:rQWO7++lO%:rQWO7++lOOQO1G4o1G4oO9WQWO1G4oO%:zQWO1G4oOOQQ7+%z7+%zO#&wQWO<|O%[Q^O,5>|OOQO-E<`-E<`O%FwQWO1G5xOOQ?Mr<]OOQU,5>_,5>_O&8uQWO1G3|O9WQWO7+&cO!(oQ^O7+&cOOQO7+%[7+%[O&8zQ07bO1G6UO>tQWO7+%[OOQ?Mr<tQWO<`Q?NdO<pQ?NdO,5?_O&@xQ?NdO7+'zO&CWQrO1G4hO&CbQ07bO7+&^O&EcQ07bO,5=UO&GgQ07bO,5=WO&GwQ07bO,5=UO&HXQ07bO,5=WO&HiQ07bO,59rO&JlQ07bO,5tQWO7+)hO'(OQWO<`Q?NdOAN?[OOQOAN>{AN>{O%[Q^OAN?[OOQO<`Q?NdOG24vO#&wQWOLD,nOOQULD,nLD,nO!&_Q7[OLD,nO'5TQrOLD,nO'5[Q07bO7+'xO'6}Q07bO,5?]O'8}Q07bO,5?_O':}Q07bO7+'zO'kOh%VOk+aO![']O%f+`O~O!d+cOa(WX![(WX'u(WX!Y(WX~Oa%lO![XO'u%lO~Oh%VO!i%cO~Oh%VO!i%cO(O%eO~O!d#vO#h(tO~Ob+nO%g+oO(O+kO(QTO(TUO!Z)TP~O!Y+pO`)SX~O[+tO~O`+uO~O![%}O(O%eO(P!lO`)SP~Oh%VO#]+zO~Oh%VOk+}O![$|O~O![,PO~O},RO![XO~O%k%tO~O!u,WO~Oe,]O~Ob,^O(O#nO(QTO(TUO!Z)RP~Oe%{O~O%g!QO(O&WO~P=RO[,cO`,bO~OPYOQYOSfOdzOeyOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO!fuO!iZO!lYO!mYO!nYO!pvO!uxO!y]O%e}O(QTO(TUO([VO(j[O(yiO~O![!eO!r!gO$V!kO(O!dO~P!EkO`,bOa%lO'u%lO~OPYOQYOSfOd!jOe!iOmkOoYOpkOqkOwkOyYO{YO!PWO!TkO!UkO![!eO!fuO!iZO!lYO!mYO!nYO!pvO!u!hO$V!kO(O!dO(QTO(TUO([VO(j[O(yiO~Oa,hO!rwO#t!OO%i!OO%j!OO%k!OO~P!HTO!i&lO~O&Y,nO~O![,pO~O&k,rO&m,sOP&haQ&haS&haY&haa&had&hae&ham&hao&hap&haq&haw&hay&ha{&ha!P&ha!T&ha!U&ha![&ha!f&ha!i&ha!l&ha!m&ha!n&ha!p&ha!r&ha!u&ha!y&ha#t&ha$V&ha%e&ha%g&ha%i&ha%j&ha%k&ha%n&ha%p&ha%s&ha%t&ha%v&ha&S&ha&Y&ha&[&ha&^&ha&`&ha&c&ha&i&ha&o&ha&q&ha&s&ha&u&ha&w&ha's&ha(O&ha(Q&ha(T&ha([&ha(j&ha(y&ha!Z&ha&a&hab&ha&f&ha~O(O,xO~Oh!bX!Y!OX!Z!OX!d!OX!d!bX!i!bX#]!OX~O!Y!bX!Z!bX~P# ZO!d,}O#],|Oh(eX!Y#eX!Y(eX!Z#eX!Z(eX!d(eX!i(eX~Oh%VO!d-PO!i%cO!Y!^X!Z!^X~Op!nO!P!oO(QTO(TUO(`!mO~OP;POQ;POSfOdkOg'XX!Y'XX~P!+hO!Y.wOg(ka~OSfO![3uO$c3vO~O!Z3zO~Os3{O~P#.aOa$lq!Y$lq'u$lq's$lq!V$lq!h$lqs$lq![$lq%f$lq!d$lq~P!9mO!V3|O~P#.aO})zO!P){O(u%POk'ea(t'ea!Y'ea#]'ea~Og'ea#}'ea~P%)nO})zO!P){Ok'ga(t'ga(u'ga!Y'ga#]'ga~Og'ga#}'ga~P%*aO(m$YO~P#.aO!VfX!V$xX!YfX!Y$xX!d%PX#]fX~P!/gO(OQ#>g#@V#@e#@l#BR#Ba#C|#D[#Db#Dh#Dn#Dx#EO#EU#E`#Er#ExPPPPPPPPPP#FOPPPPPPP#Fs#Iz#KZ#Kb#KjPPP$!sP$!|$%t$,^$,a$,d$-P$-S$-Z$-cP$-i$-lP$.Y$.^$/U$0d$0i$1PPP$1U$1[$1`P$1c$1g$1k$2a$2x$3a$3e$3h$3k$3q$3t$3x$3|R!|RoqOXst!Z#d%k&o&q&r&t,k,p1|2PY!vQ']-]1a5eQ%rvQ%zyQ&R|Q&g!VS'T!e-TQ'c!iS'i!r!yU*e$|*V*jQ+i%{Q+v&TQ,[&aQ-Z'[Q-e'dQ-m'jQ0R*lQ1k,]R;v;T%QdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%k%r&P&h&k&o&q&r&t&x'Q'_'o(P(R(X(`(t(v(z)y+R+V,h,k,p-a-i-w-}.l.s/f0a0g0v1d1t1u1w1y1|2P2R2r2x3^5b5m5}6O6R6f8R8X8h8rS#q];Q!r)Z$Z$n'U)o,|-P.}2b3u5`6]9h9y;P;S;T;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;i;v;x;y;{ < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:376,context:I8,nodeProps:[["isolate",-8,5,6,14,34,36,48,50,52,""],["group",-26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,"Statement",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,"Expression",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,"Type",-3,85,100,106,"ClassItem"],["openedBy",23,"<",35,"InterpolationStart",53,"[",57,"{",70,"(",159,"JSXStartCloseTag"],["closedBy",24,">",37,"InterpolationEnd",47,"]",58,"}",71,")",164,"JSXEndTag"]],propSources:[X8],skippedNodes:[0,5,6,274],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$h&j(RpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(RpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Rp(U!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$h&j(Rp(U!b'w0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(S#S$h&j'x0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$h&j(Rp(U!b'x0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$h&j!m),Q(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#u(Ch$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(Q':f$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$h&j(U!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$h&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$c`$h&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$c``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$c`$h&j(U!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(U!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$c`(U!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$h&j(Rp(U!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$h&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(U!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$h&j(RpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(RpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Rp(U!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$h&j!U7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!U7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!U7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$h&j(U!b!U7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(U!b!U7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(U!b!U7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(U!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$h&j(U!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$h&j(Rp(U!bp'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!d$b$h&j#})Lv(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#O-F8[i]||-1},{term:338,get:i=>Y8[i]||-1},{term:92,get:i=>z8[i]||-1}],tokenPrec:14749}),IC=[Qn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Qn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Qn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Qn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Qn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Qn(`try { \${} } catch (\${error}) { \${} @@ -204,9 +204,10 @@ var bP=Object.defineProperty;var vP=(i,e,t)=>e in i?bP(i,e,{enumerable:!0,config constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Qn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Qn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],nB=zC.concat([Qn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Qn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Qn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Kv=new T2,VC=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function gl(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}const iB=["FunctionDeclaration"],rB={FunctionDeclaration:gl("function"),ClassDeclaration:gl("class"),ClassExpression:()=>!0,EnumDeclaration:gl("constant"),TypeAliasDeclaration:gl("type"),NamespaceDeclaration:gl("namespace"),VariableDefinition(i,e){i.matchContext(iB)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function UC(i,e){let t=Kv.get(e);if(t)return t;let n=[],r=!0;function s(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(Pt.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=rB[o.name];if(l&&l(o,s)||VC.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of UC(i,o.node))n.push(l);return!1}}),Kv.set(e,n),n}const Jv=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,jC=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function sB(i){let e=At(i.state).resolveInner(i.pos,-1);if(jC.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Jv.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)VC.has(r.name)&&(n=n.concat(UC(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Jv}}const qi=Ds.define({name:"javascript",parser:tB.configure({props:[Yo.add({IfStatement:vo({except:/^\s*({|else\b)/}),TryStatement:vo({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:jL,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:UL({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":vo({except:/^{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),Xs.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ap,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),qC={test:i=>/^JSX/.test(i.name),facet:Sp({commentTokens:{block:{open:"{/*",close:"*/}"}}})},GC=qi.configure({dialect:"ts"},"typescript"),HC=qi.configure({dialect:"jsx",props:[_p.add(i=>i.isTop?[qC]:void 0)]}),KC=qi.configure({dialect:"jsx ts",props:[_p.add(i=>i.isTop?[qC]:void 0)]},"typescript");let JC=i=>({label:i,type:"keyword"});const eP="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(JC),oB=eP.concat(["declare","implements","private","protected","public"].map(JC));function lB(i={}){let e=i.jsx?i.typescript?KC:HC:i.typescript?GC:qi,t=i.typescript?nB.concat(oB):zC.concat(eP);return new Ro(e,[qi.data.of({autocomplete:fI(jC,N_(t))}),qi.data.of({autocomplete:sB}),i.jsx?uB:[]])}function aB(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function ew(i,e,t=i.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}const cB=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),uB=Oe.inputHandler.of((i,e,t,n,r)=>{if((cB?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!qi.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var c;let{head:u}=a,h=At(o).resolveInner(u-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=n||h.name=="JSXAttributeValue"&&h.to>u)){if(n==">"&&h.name=="JSXFragmentTag")return{range:a,changes:{from:u,insert:""}};if(n=="/"&&h.name=="JSXStartCloseTag"){let d=h.parent,m=d.parent;if(m&&d.from==u-2&&((f=ew(o.doc,m.firstChild,u))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let p=`${f}>`;return{range:q.cursor(u+p.length,-1),changes:{from:u,insert:p}}}}else if(n==">"){let d=aB(h);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(f=ew(o.doc,d,u)))return{range:a,changes:{from:u,insert:``}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Ol=["_blank","_self","_top","_parent"],id=["ascii","utf-8","utf-16","latin1","latin1"],rd=["get","post","put","delete"],sd=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Xn=["true","false"],xe={},hB={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ol,hreflang:null}},abbr:xe,address:xe,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:xe,aside:xe,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:xe,base:{attrs:{href:null,target:Ol}},bdi:xe,bdo:xe,blockquote:{attrs:{cite:null}},body:xe,br:xe,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:sd,formmethod:rd,formnovalidate:["novalidate"],formtarget:Ol,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:xe,center:xe,cite:xe,code:xe,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:xe,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:xe,div:xe,dl:xe,dt:xe,em:xe,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:xe,figure:xe,footer:xe,form:{attrs:{action:null,name:null,"accept-charset":id,autocomplete:["on","off"],enctype:sd,method:rd,novalidate:["novalidate"],target:Ol}},h1:xe,h2:xe,h3:xe,h4:xe,h5:xe,h6:xe,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:xe,hgroup:xe,hr:xe,html:{attrs:{manifest:null}},i:xe,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:sd,formmethod:rd,formnovalidate:["novalidate"],formtarget:Ol,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:xe,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:xe,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:xe,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:id,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:xe,noscript:xe,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:xe,param:{attrs:{name:null,value:null}},pre:xe,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:xe,rt:xe,ruby:xe,samp:xe,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:id}},section:xe,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:xe,source:{attrs:{src:null,type:null,media:null}},span:xe,strong:xe,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:xe,summary:xe,sup:xe,table:xe,tbody:xe,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:xe,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:xe,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:xe,time:{attrs:{datetime:null}},title:xe,tr:xe,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:xe,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:xe},tP={accesskey:null,class:null,contenteditable:Xn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Xn,autocorrect:Xn,autocapitalize:Xn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Xn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Xn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Xn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Xn,"aria-hidden":Xn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Xn,"aria-multiselectable":Xn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Xn,"aria-relevant":null,"aria-required":Xn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},nP="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(i=>"on"+i);for(let i of nP)tP[i]=null;class xa{constructor(e,t){this.tags=Object.assign(Object.assign({},hB),e),this.globalAttrs=Object.assign(Object.assign({},tP),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}xa.default=new xa;function Io(i,e,t=i.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?i.sliceString(r.from,Math.min(r.to,t)):""}function No(i,e=!1){for(;i;i=i.parent)if(i.name=="Element")if(e)e=!1;else return i;return null}function iP(i,e,t){let n=t.tags[Io(i,No(e))];return(n==null?void 0:n.children)||t.allTags}function Gp(i,e){let t=[];for(let n=No(e);n&&!n.type.isTop;n=No(n.parent)){let r=Io(i,n);if(r&&n.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(r)}return t}const rP=/^[:\-\.\w\u00b7-\uffff]*$/;function tw(i,e,t,n,r){let s=/\s*>/.test(i.sliceDoc(r,r+5))?"":">",o=No(t,!0);return{from:n,to:r,options:iP(i.doc,o,e).map(l=>({label:l,type:"type"})).concat(Gp(i.doc,t).map((l,a)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function nw(i,e,t,n){let r=/\s*>/.test(i.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:Gp(i.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:rP}}function fB(i,e,t,n){let r=[],s=0;for(let o of iP(i.doc,t,e))r.push({label:"<"+o,type:"type"});for(let o of Gp(i.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:n,to:n,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function dB(i,e,t,n,r){let s=No(t),o=s?e.tags[Io(i.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:r,options:a.map(c=>({label:c,type:"property"})),validFor:rP}}function mB(i,e,t,n,r){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],a;if(o){let c=i.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=No(t),f=h?e.tags[Io(i.doc,h)]:null;u=(f==null?void 0:f.attrs)&&f.attrs[c]}if(u){let h=i.sliceDoc(n,r).toLowerCase(),f='"',d='"';/^['"]/.test(h)?(a=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",d=i.sliceDoc(r,r+1)==h[0]?"":h[0],h=h.slice(1),n++):a=/^[^\s<>='"]*$/;for(let m of u)l.push({label:m,apply:f+m+d,type:"constant"})}}return{from:n,to:r,options:l,validFor:a}}function sP(i,e){let{state:t,pos:n}=e,r=At(t).resolveInner(n,-1),s=r.resolve(n);for(let o=n,l;s==r&&(l=r.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromsP(n,r)}const OB=qi.parser.configure({top:"SingleExpression"}),oP=[{tag:"script",attrs:i=>i.type=="text/typescript"||i.lang=="ts",parser:GC.parser},{tag:"script",attrs:i=>i.type=="text/babel"||i.type=="text/jsx",parser:HC.parser},{tag:"script",attrs:i=>i.type=="text/typescript-jsx",parser:KC.parser},{tag:"script",attrs(i){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(i.type)},parser:OB},{tag:"script",attrs(i){return!i.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(i.type)},parser:qi.parser},{tag:"style",attrs(i){return(!i.lang||i.lang=="css")&&(!i.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(i.type))},parser:th.parser}],lP=[{name:"style",parser:th.parser.configure({top:"Styles"})}].concat(nP.map(i=>({name:i,parser:qi.parser}))),aP=Ds.define({name:"html",parser:JZ.configure({props:[Yo.add({Element(i){let e=/^(\s*)(<\/)?/.exec(i.textAfter);return i.node.to<=i.pos+e[0].length?i.continue():i.lineIndent(i.node.from)+(e[2]?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit},Document(i){if(i.pos+/\s*/.exec(i.textAfter)[0].lengthi.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ru=aP.configure({wrap:ZC(oP,lP)});function bB(i={}){let e="",t;i.matchClosingTags===!1&&(e="noMatch"),i.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(i.nestedLanguages&&i.nestedLanguages.length||i.nestedAttributes&&i.nestedAttributes.length)&&(t=ZC((i.nestedLanguages||[]).concat(oP),(i.nestedAttributes||[]).concat(lP)));let n=t?aP.configure({wrap:t,dialect:e}):e?ru.configure({dialect:e}):ru;return new Ro(n,[ru.data.of({autocomplete:gB(i)}),i.autoCloseTags!==!1?vB:[],lB().support,A8().support])}const iw=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),vB=Oe.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!ru.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var c,u,h;let f=o.doc.sliceString(a.from-1,a.to)==n,{head:d}=a,m=At(o).resolveInner(d,-1),p;if(f&&n==">"&&m.name=="EndTag"){let g=m.parent;if(((u=(c=g.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(p=Io(o.doc,g.parent,d))&&!iw.has(p)){let b=d+(o.doc.sliceString(d,d+1)===">"?1:0),w=``;return{range:a,changes:{from:d,to:b,insert:w}}}}else if(f&&n=="/"&&m.name=="IncompleteCloseTag"){let g=m.parent;if(m.from==d-2&&((h=g.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(p=Io(o.doc,g,d))&&!iw.has(p)){let b=d+(o.doc.sliceString(d,d+1)===">"?1:0),w=`${p}>`;return{range:q.cursor(d+w.length,-1),changes:{from:d,to:b,insert:w}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),cP=Sp({commentTokens:{block:{open:""}}}),uP=new Ze,hP=nZ.configure({props:[Xs.add(i=>!i.is("Block")||i.is("Document")||Bm(i)!=null||wB(i)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),uP.add(Bm),Yo.add({Document:()=>null}),ys.add({Document:cP})]});function Bm(i){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(i.name);return e?+e[1]:void 0}function wB(i){return i.name=="OrderedList"||i.name=="BulletList"}function yB(i,e){let t=i;for(;;){let n=t.nextSibling,r;if(!n||(r=Bm(n.type))!=null&&r<=e)break;t=n}return t.to}const kB=L2.of((i,e,t)=>{for(let n=At(i).resolveInner(t,-1);n&&!(n.fromt)return{from:t,to:s}}return null});function Hp(i){return new ai(cP,i,[kB],"markdown")}const SB=Hp(hP),_B=hP.configure([dZ,pZ,mZ,gZ,{props:[Xs.add({Table:(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}]),fP=Hp(_B);function CB(i,e){return t=>{if(t&&i){let n=null;if(t=/\S*/.exec(t)[0],typeof i=="function"?n=i(t):n=$u.matchLanguageName(i,t,!0),n instanceof $u)return n.support?n.support.language.parser:ba.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class Dc{constructor(e,t,n,r,s,o,l){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,t=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;r--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+mP(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function dP(i,e){let t=[];for(let r=i;r&&r.name!="Document";r=r.parent)(r.name=="ListItem"||r.name=="Blockquote"||r.name=="FencedCode")&&t.push(r);let n=[];for(let r=t.length-1;r>=0;r--){let s=t[r],o,l=e.lineAt(s.from),a=s.from-l.from;if(s.name=="FencedCode")n.push(new Dc(s,a,a,"","","",null));else if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(a))))n.push(new Dc(s,a,a+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(a)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),n.push(new Dc(s.parent,a,a+u,o[1],c,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(a)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),n.push(new Dc(s.parent,a,a+u,o[1],c,h,s))}}return n}function mP(i,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(i.from,i.from+10))}function od(i,e,t,n=0){for(let r=-1,s=i;;){if(s.name=="ListItem"){let l=mP(s,e),a=+l[2];if(r>=0){if(a!=r+1)return;t.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+n)})}r=a}let o=s.nextSibling;if(!o)break;s=o}}function Kp(i,e){let t=/^[ \t]*/.exec(i)[0].length;if(!t||e.facet(Ba)!=" ")return i;let n=Pi(i,4,t),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+i.slice(t)}const PB=({state:i,dispatch:e})=>{let t=At(i),{doc:n}=i,r=null,s=i.changeByRange(o=>{if(!o.empty||!fP.isActiveAt(i,o.from))return r={range:o};let l=o.from,a=n.lineAt(l),c=dP(t.resolveInner(l,-1),n);for(;c.length&&c[c.length-1].from>l-a.from;)c.pop();if(!c.length)return r={range:o};let u=c[c.length-1];if(u.to-u.spaceAfter.length>l-a.from)return r={range:o};let h=l>=u.to-u.spaceAfter.length&&!/\S/.test(a.text.slice(u.to));if(u.item&&h){let g=u.node.firstChild,b=u.node.getChild("ListItem","ListItem");if(g.to>=l||b&&b.to0&&!/[^\s>]/.test(n.lineAt(a.from-1).text)){let w=c.length>1?c[c.length-2]:null,S,_="";w&&w.item?(S=a.from+w.from,_=w.marker(n,1)):S=a.from+(w?w.to:0);let k=[{from:S,to:l,insert:_}];return u.node.name=="OrderedList"&&od(u.item,n,k,-2),w&&w.node.name=="OrderedList"&&od(w.item,n,k),{range:q.cursor(S+_.length),changes:k}}else{let w=sw(c,i,a);return{range:q.cursor(l+w.length+1),changes:{from:a.from,insert:w+i.lineBreak}}}}if(u.node.name=="Blockquote"&&h&&a.from){let g=n.lineAt(a.from-1),b=/>\s*$/.exec(g.text);if(b&&b.index==u.from){let w=i.changes([{from:g.from+b.index,to:g.to},{from:a.from+u.from,to:a.to}]);return{range:o.map(w),changes:w}}}let f=[];u.node.name=="OrderedList"&&od(u.item,n,f);let d=u.item&&u.item.from]*/.exec(a.text)[0].length>=u.to)for(let g=0,b=c.length-1;g<=b;g++)m+=g==b&&!d?c[g].marker(n,1):c[g].blank(ga.from&&/\s/.test(a.text.charAt(p-a.from-1));)p--;return m=Kp(m,i),AB(u.node,i.doc)&&(m=sw(c,i,a)+i.lineBreak+m),f.push({from:p,to:l,insert:i.lineBreak+m}),{range:q.cursor(p+m.length+1),changes:f}});return r?!1:(e(i.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)};function rw(i){return i.name=="QuoteMark"||i.name=="ListMark"}function AB(i,e){if(i.name!="OrderedList"&&i.name!="BulletList")return!1;let t=i.firstChild,n=i.getChild("ListItem","ListItem");if(!n)return!1;let r=e.lineAt(t.to),s=e.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let t=At(i),n=null,r=i.changeByRange(s=>{let o=s.from,{doc:l}=i;if(s.empty&&fP.isActiveAt(i,s.from)){let a=l.lineAt(o),c=dP(xB(t,o),l);if(c.length){let u=c[c.length-1],h=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-a.from>h&&!/\S/.test(a.text.slice(h,o-a.from)))return{range:q.cursor(a.from+h),changes:{from:a.from+h,to:o}};if(o-a.from==h&&(!u.item||a.from<=u.item.from||!/\S/.test(a.text.slice(0,u.to)))){let f=a.from+u.from;if(u.item&&u.node.from0?u=`![${c.file.filename}](${c.url})`:u=`[${c.file.filename}](${c.originalUrl})`;const h=r.state.selection.main.head,f=r.state.update({changes:{from:h,insert:u},selection:{anchor:h+1},scrollIntoView:!0});f&&r.dispatch(f)}Ti(()=>{let c=new Ur,u=new Ur,h=tt.create({doc:s,extensions:[ju,Bs.of([A_,...eC,...Xp]),c.of(ow()),ow(),q_(),u.of(tt.tabSize.of(4)),ju,Oe.editable.of(o),Oe.updateListener.of(function(f){f.docChanged&&t(2,s=f.state.doc.toString())}),Oe.lineWrapping,Oe.contentAttributes.of({spellcheck:"true"})]});r=new Oe({state:h,parent:n})}),uy(()=>{r&&r.destroy()});function a(c){Se[c?"unshift":"push"](()=>{n=c,t(1,n)})}return i.$$set=c=>{"value"in c&&t(2,s=c.value),"editable"in c&&t(0,o=c.editable)},[o,n,s,l,a]}class $B extends oe{constructor(e){super(),se(this,e,DB,RB,re,{value:2,editable:0,insertMedia:3})}get insertMedia(){return this.$$.ctx[3]}}function lw(i){let e,t,n;function r(o){i[11](o)}let s={record:i[3],field:i[2],validationErrors:i[5]};return i[1]!==void 0&&(s.graph=i[1]),e=new rk({props:s}),Se.push(()=>He(e,"graph",r)),e.$on("editor-insert",i[8]),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&8&&(a.record=o[3]),l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),!t&&l&2&&(t=!0,a.graph=o[1],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function aw(i){let e,t;return{c(){e=y("div"),t=W(i[7]),O(e,"class","invalid-feedback d-block")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&128&&K(t,n[7])},d(n){n&&P(e)}}}function LB(i){let e,t,n,r,s,o;function l(h){i[10](h)}let a={editable:!i[2].readonly||i[4]};i[0]!==void 0&&(a.value=i[0]),t=new $B({props:a}),i[9](t),Se.push(()=>He(t,"value",l));let c=i[2].collections.length>0&&lw(i),u=i[7]&&aw(i);return{c(){e=y("div"),V(t.$$.fragment),r=D(),c&&c.c(),s=D(),u&&u.c(),O(e,"class","mb-3")},m(h,f){A(h,e,f),Y(t,e,null),v(e,r),c&&c.m(e,null),v(e,s),u&&u.m(e,null),o=!0},p(h,[f]){const d={};f&20&&(d.editable=!h[2].readonly||h[4]),!n&&f&1&&(n=!0,d.value=h[0],nt(()=>n=!1)),t.$set(d),h[2].collections.length>0?c?(c.p(h,f),f&4&&T(c,1)):(c=lw(h),c.c(),T(c,1),c.m(e,s)):c&&(me(),R(c,1,1,()=>{c=null}),pe()),h[7]?u?u.p(h,f):(u=aw(h),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(h){o||(T(t.$$.fragment,h),T(c),o=!0)},o(h){R(t.$$.fragment,h),R(c),o=!1},d(h){h&&P(e),i[9](null),z(t),c&&c.d(),u&&u.d()}}}function IB(i,e,t){let n,{value:r}=e,{field:s}=e,{graph:o}=e,{record:l}=e,{isCreateMode:a}=e,{validationErrors:c}=e,u;function h(p){u.insertMedia(p.detail)}function f(p){Se[p?"unshift":"push"](()=>{u=p,t(6,u)})}function d(p){r=p,t(0,r)}function m(p){o=p,t(1,o)}return i.$$set=p=>{"value"in p&&t(0,r=p.value),"field"in p&&t(2,s=p.field),"graph"in p&&t(1,o=p.graph),"record"in p&&t(3,l=p.record),"isCreateMode"in p&&t(4,a=p.isCreateMode),"validationErrors"in p&&t(5,c=p.validationErrors)},i.$$.update=()=>{i.$$.dirty&36&&t(7,n=In(c,s.name))},[r,o,s,l,a,c,u,n,h,f,d,m]}class pP extends oe{constructor(e){super(),se(this,e,IB,LB,re,{value:0,field:2,graph:1,record:3,isCreateMode:4,validationErrors:5})}}function cw(i){let e,t=i[0].help+"",n;return{c(){e=y("small"),n=W(t),O(e,"class","help-text light-text")},m(r,s){A(r,e,s),v(e,n)},p(r,s){s&1&&t!==(t=r[0].help+"")&&K(n,t)},d(r){r&&P(e)}}}function NB(i){let e,t,n,r,s=i[0].label+"",o,l,a,c,u,h=i[0].name+"",f,d=i[0].help&&cw(i);return{c(){e=y("div"),t=y("div"),n=y("div"),r=y("label"),o=W(s),l=D(),d&&d.c(),a=D(),c=y("span"),u=y("code"),f=W(h),O(r,"for",i[1]),O(n,"class","label-and-help"),O(u,"class","field-id"),O(c,"tabindex","-1"),O(c,"class","text-decoration-none"),O(t,"class","labels"),O(e,"class","field-header")},m(m,p){A(m,e,p),v(e,t),v(t,n),v(n,r),v(r,o),v(n,l),d&&d.m(n,null),v(t,a),v(t,c),v(c,u),v(u,f)},p(m,[p]){p&1&&s!==(s=m[0].label+"")&&K(o,s),p&2&&O(r,"for",m[1]),m[0].help?d?d.p(m,p):(d=cw(m),d.c(),d.m(n,null)):d&&(d.d(1),d=null),p&1&&h!==(h=m[0].name+"")&&K(f,h)},i:U,o:U,d(m){m&&P(e),d&&d.d()}}}function ZB(i,e,t){let{field:n}=e,{id:r}=e;return i.$$set=s=>{"field"in s&&t(0,n=s.field),"id"in s&&t(1,r=s.id)},[n,r]}class BB extends oe{constructor(e){super(),se(this,e,ZB,NB,re,{field:0,id:1})}}function uw(i,e,t){const n=i.slice();return n[2]=e[t],n}function hw(i,e,t){const n=i.slice();return n[24]=e[t],n}function fw(i){let e,t;return{c(){e=y("div"),t=W(i[7]),O(e,"class","invalid-feedback d-block mb-3")},m(n,r){A(n,e,r),v(e,t)},p(n,r){r&128&&K(t,n[7])},d(n){n&&P(e)}}}function dw(i){let e=[],t=new Map,n,r=ue(i[5]);const s=l=>l[24].id;for(let l=0;ll[2].id;for(let l=0;l0&&Ow(i);return{c(){e=y("div"),d&&d.c(),t=D(),n=y("input"),s=D(),o=y("div"),m&&m.c(),l=D(),p&&p.c(),a=D(),g&&g.c(),c=De(),O(n,"type","search"),O(n,"id",i[1]),O(n,"placeholder",r="Search for "+i[0].label),O(n,"autocomplete","off"),Ae(n,"is-invalid",i[7]),O(o,"class","reference-tags-results"),O(e,"class","reference-tags")},m(b,w){A(b,e,w),d&&d.m(e,null),v(e,t),v(e,n),i[15](n),Ie(n,i[4]),v(e,s),v(e,o),m&&m.m(o,null),v(o,l),p&&p.m(o,null),A(b,a,w),g&&g.m(b,w),A(b,c,w),u=!0,h||(f=[G(n,"keyup",i[12]),G(n,"input",i[16])],h=!0)},p(b,[w]){b[7]?d?d.p(b,w):(d=fw(b),d.c(),d.m(e,t)):d&&(d.d(1),d=null),(!u||w&2)&&O(n,"id",b[1]),(!u||w&1&&r!==(r="Search for "+b[0].label))&&O(n,"placeholder",r),w&16&&n.value!==b[4]&&Ie(n,b[4]),(!u||w&128)&&Ae(n,"is-invalid",b[7]),b[5]?m?m.p(b,w):(m=dw(b),m.c(),m.m(o,l)):m&&(m.d(1),m=null),b[4]?p?p.p(b,w):(p=gw(b),p.c(),p.m(o,null)):p&&(p.d(1),p=null),b[6].length>0?g?(g.p(b,w),w&64&&T(g,1)):(g=Ow(b),g.c(),T(g,1),g.m(c.parentNode,c)):g&&(me(),R(g,1,1,()=>{g=null}),pe())},i(b){u||(T(g),u=!0)},o(b){R(g),u=!1},d(b){b&&(P(e),P(a),P(c)),d&&d.d(),i[15](null),m&&m.d(),p&&p.d(),g&&g.d(b),h=!1,ut(f)}}}function XB(i,e,t){let n,r,s;const o=je("channel");let{field:l}=e,{id:a}=e,{record:c}=e,{graph:u}=e,h,{validationErrors:f}=e,d="";function m(M,$){M.preventDefault(),t(13,u.edges=u.edges.filter(N=>!(N.target===$&&N.field===l.name)),u)}function p(M,$){M.preventDefault(),axios.post(o.lucentUrl+"/records",{isCreateMode:!0,record:{schema:l.collections[0],status:"published",data:{[l.searchField]:$}}}).then(N=>{t(5,s=[]),g(M,N.data.records[0]),console.log(N)}).catch(N=>{t(5,s=[]),console.log(N)})}function g(M,$){M.preventDefault(),t(13,u=zm(u,c,[$],l.name,M.detail.action)),t(4,d=""),h.focus(),h.blur()}const b=debounce(M=>{axios.get(o.lucentUrl+"/records/suggestions",{params:{schema:l.collections[0],field:l.searchField,value:d,ui:"text"}}).then($=>{t(5,s=$.data)}).catch($=>{t(5,s=[]),console.log($)})},500);function w(M){Se[M?"unshift":"push"](()=>{h=M,t(3,h)})}function S(){d=this.value,t(4,d)}const _=(M,$)=>g($,M),k=(M,$)=>g($,M),Q=M=>p(M,d),x=M=>p(M,d),C=(M,$)=>m($,M.id);return i.$$set=M=>{"field"in M&&t(0,l=M.field),"id"in M&&t(1,a=M.id),"record"in M&&t(2,c=M.record),"graph"in M&&t(13,u=M.graph),"validationErrors"in M&&t(14,f=M.validationErrors)},i.$$.update=()=>{i.$$.dirty&16385&&t(7,n=In(f,l.name)),i.$$.dirty&8197&&t(6,r=u.edges.filter(M=>M.field===l.name).map(M=>u.records.find($=>$.id==M.target&&c.id==M.source)).filter(M=>!!(M!=null&&M.id))??[])},t(5,s=[]),[l,a,c,h,d,s,r,n,o,m,p,g,b,u,f,w,S,_,k,Q,x,C]}class FB extends oe{constructor(e){super(),se(this,e,XB,WB,re,{field:0,id:1,record:2,graph:13,validationErrors:14})}}function YB(i){let e,t,n,r;function s(a){i[19](a)}var o=i[7];function l(a,c){let u={schema:a[3],field:a[2],validationErrors:a[5],isCreateMode:a[6],id:a[8]};return a[0][a[2].name]!==void 0&&(u.value=a[0][a[2].name]),{props:u}}return o&&(e=Fr(o,l(i)),Se.push(()=>He(e,"value",s))),{c(){e&&V(e.$$.fragment),n=De()},m(a,c){e&&Y(e,a,c),A(a,n,c),r=!0},p(a,c){if(o!==(o=a[7])){if(e){me();const u=e;R(u.$$.fragment,1,0,()=>{z(u,1)}),pe()}o?(e=Fr(o,l(a)),Se.push(()=>He(e,"value",s)),V(e.$$.fragment),T(e.$$.fragment,1),Y(e,n.parentNode,n)):e=null}else if(o){const u={};c&8&&(u.schema=a[3]),c&4&&(u.field=a[2]),c&32&&(u.validationErrors=a[5]),c&64&&(u.isCreateMode=a[6]),!t&&c&5&&(t=!0,u.value=a[0][a[2].name],nt(()=>t=!1)),e.$set(u)}},i(a){r||(e&&T(e.$$.fragment,a),r=!0)},o(a){e&&R(e.$$.fragment,a),r=!1},d(a){a&&P(n),e&&z(e,a)}}}function zB(i){let e,t,n,r;function s(a){i[17](a)}function o(a){i[18](a)}let l={schema:i[3],field:i[2],validationErrors:i[5],isCreateMode:i[6],record:i[4]};return i[0][i[2].name]!==void 0&&(l.value=i[0][i[2].name]),i[1]!==void 0&&(l.graph=i[1]),e=new pP({props:l}),Se.push(()=>He(e,"value",s)),Se.push(()=>He(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&8&&(u.schema=a[3]),c&4&&(u.field=a[2]),c&32&&(u.validationErrors=a[5]),c&64&&(u.isCreateMode=a[6]),c&16&&(u.record=a[4]),!t&&c&5&&(t=!0,u.value=a[0][a[2].name],nt(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],nt(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function VB(i){let e,t,n,r;function s(a){i[15](a)}function o(a){i[16](a)}let l={schema:i[3],field:i[2],validationErrors:i[5],isCreateMode:i[6],record:i[4]};return i[0][i[2].name]!==void 0&&(l.value=i[0][i[2].name]),i[1]!==void 0&&(l.graph=i[1]),e=new Hk({props:l}),Se.push(()=>He(e,"value",s)),Se.push(()=>He(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&8&&(u.schema=a[3]),c&4&&(u.field=a[2]),c&32&&(u.validationErrors=a[5]),c&64&&(u.isCreateMode=a[6]),c&16&&(u.record=a[4]),!t&&c&5&&(t=!0,u.value=a[0][a[2].name],nt(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],nt(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function UB(i){let e,t,n;function r(o){i[14](o)}let s={field:i[2],validationErrors:i[5],isCreateMode:i[6],id:i[8]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new ik({props:s}),Se.push(()=>He(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),l&64&&(a.isCreateMode=o[6]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function jB(i){let e,t,n;function r(o){i[13](o)}let s={field:i[2],id:i[8],validationErrors:i[5],isCreateMode:i[6]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new Ey({props:s}),Se.push(()=>He(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),l&64&&(a.isCreateMode=o[6]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function qB(i){let e,t,n;function r(o){i[12](o)}let s={field:i[2],id:i[8],validationErrors:i[5],isCreateMode:i[6]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new My({props:s}),Se.push(()=>He(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),l&64&&(a.isCreateMode=o[6]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function GB(i){let e,t,n;function r(o){i[11](o)}let s={record:i[4],id:i[8],field:i[2],validationErrors:i[5]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new oR({props:s}),Se.push(()=>He(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&16&&(a.record=o[4]),l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function HB(i){let e,t,n;function r(o){i[10](o)}let s={id:i[8],record:i[4],field:i[2],validationErrors:i[5]};return i[1]!==void 0&&(s.graph=i[1]),e=new gE({props:s}),Se.push(()=>He(e,"graph",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&16&&(a.record=o[4]),l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),!t&&l&2&&(t=!0,a.graph=o[1],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function KB(i){let e,t,n;function r(o){i[9](o)}let s={id:i[8],record:i[4],field:i[2],validationErrors:i[5]};return i[1]!==void 0&&(s.graph=i[1]),e=new FB({props:s}),Se.push(()=>He(e,"graph",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&16&&(a.record=o[4]),l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),!t&&l&2&&(t=!0,a.graph=o[1],nt(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function JB(i){let e,t,n,r,s,o;t=new BB({props:{field:i[2],id:i[8]}});const l=[KB,HB,GB,qB,jB,UB,VB,zB,YB],a=[];function c(u,h){return u[2].info.name==="reference"&&u[2].layout==="tags"?0:u[2].info.name==="reference"?1:u[2].info.name==="file"?2:u[2].info.name==="text"?3:u[2].info.name==="slug"?4:u[2].info.name==="textarea"?5:u[2].info.name==="rich"?6:u[2].info.name==="markdown"?7:8}return r=c(i),s=a[r]=l[r](i),{c(){e=y("div"),V(t.$$.fragment),n=D(),s.c(),O(e,"class","editor-field")},m(u,h){A(u,e,h),Y(t,e,null),v(e,n),a[r].m(e,null),o=!0},p(u,[h]){const f={};h&4&&(f.field=u[2]),t.$set(f);let d=r;r=c(u),r===d?a[r].p(u,h):(me(),R(a[d],1,1,()=>{a[d]=null}),pe(),s=a[r],s?s.p(u,h):(s=a[r]=l[r](u),s.c()),T(s,1),s.m(e,null))},i(u){o||(T(t.$$.fragment,u),T(s),o=!0)},o(u){R(t.$$.fragment,u),R(s),o=!1},d(u){u&&P(e),z(t),a[r].d()}}}function eW(i,e,t){const n={text:My,slug:Ey,textarea:ik,rich:Hk,color:vE,checkbox:kE,number:CE,url:xE,date:IE,datetime:hR,uuid:WE,json:XN,markdown:pP};let{field:r}=e,{data:s}=e,{schema:o}=e,{record:l}=e,{graph:a}=e,{validationErrors:c}=e,{isCreateMode:u}=e,h=n[r.info.name];const f=`field-${r.name}-${l.id}`;function d(C){a=C,t(1,a)}function m(C){a=C,t(1,a)}function p(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function g(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function b(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function w(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function S(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function _(C){a=C,t(1,a)}function k(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function Q(C){a=C,t(1,a)}function x(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}return i.$$set=C=>{"field"in C&&t(2,r=C.field),"data"in C&&t(0,s=C.data),"schema"in C&&t(3,o=C.schema),"record"in C&&t(4,l=C.record),"graph"in C&&t(1,a=C.graph),"validationErrors"in C&&t(5,c=C.validationErrors),"isCreateMode"in C&&t(6,u=C.isCreateMode)},[s,a,r,o,l,c,u,h,f,d,m,p,g,b,w,S,_,k,Q,x]}class gP extends oe{constructor(e){super(),se(this,e,eW,JB,re,{field:2,data:0,schema:3,record:4,graph:1,validationErrors:5,isCreateMode:6})}}function vw(i,e,t){const n=i.slice();return n[3]=e[t],n}function ww(i){let e;return{c(){e=W("Nothing links to this record")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function yw(i){let e,t,n,r,s,o,l,a,c;return l=new ek({props:{record:i[3].record,hasDelete:!1,graph:i[0]}}),{c(){e=y("div"),t=y("span"),n=W("In "),r=y("i"),r.textContent=`${i[3].field}`,s=W(" of"),o=D(),V(l.$$.fragment),a=D(),fe(t,"font-size","14px"),fe(t,"margin-bottom","5px"),fe(t,"display","block"),fe(e,"margin","0 0 15px"),fe(e,"position","relative")},m(u,h){A(u,e,h),v(e,t),v(t,n),v(t,r),v(t,s),v(e,o),Y(l,e,null),v(e,a),c=!0},p(u,h){const f={};h&1&&(f.graph=u[0]),l.$set(f)},i(u){c||(T(l.$$.fragment,u),c=!0)},o(u){R(l.$$.fragment,u),c=!1},d(u){u&&P(e),z(l)}}}function tW(i){let e,t,n=ue(i[1]),r=[];for(let l=0;lR(r[l],1,1,()=>{r[l]=null});let o=null;return n.length||(o=ww()),{c(){e=y("div");for(let l=0;lt.name===e)}function iW(i,e,t){const n=je("channel");let{graph:r}=e,s=r.parentEdges.map(o=>{let l=n.schemas.find(c=>c.name===o.sourceSchema),a=nW(l,o.field);return a?{field:a.label,record:r.records.find(c=>c.id===o.source)}:null}).filter(o=>!!o);return i.$$set=o=>{"graph"in o&&t(0,r=o.graph)},[r,s]}class rW extends oe{constructor(e){super(),se(this,e,iW,tW,re,{graph:0})}}function kw(i,e,t){const n=i.slice();return n[7]=e[t],n}function Sw(i,e,t){const n=i.slice();return n[4]=e[t],n}function sW(i){let e,t=(JSON.stringify(i[1])??"")+"",n,r;return{c(){e=y("div"),n=W(t),O(e,"class",r=i[3]+" field-content svelte-s7tjhg")},m(s,o){A(s,e,o),v(e,n)},p(s,o){o&2&&t!==(t=(JSON.stringify(s[1])??"")+"")&&K(n,t),o&8&&r!==(r=s[3]+" field-content svelte-s7tjhg")&&O(e,"class",r)},i:U,o:U,d(s){s&&P(e)}}}function oW(i){let e,t=(i[1]??"")+"",n;return{c(){e=y("div"),O(e,"class",n=i[3]+" field-content svelte-s7tjhg")},m(r,s){A(r,e,s),e.innerHTML=t},p(r,s){s&2&&t!==(t=(r[1]??"")+"")&&(e.innerHTML=t),s&8&&n!==(n=r[3]+" field-content svelte-s7tjhg")&&O(e,"class",n)},i:U,o:U,d(r){r&&P(e)}}}function lW(i){let e,t=(JSON.stringify(i[1],null,2)??"")+"",n,r;return{c(){e=y("div"),n=W(t),O(e,"class",r=i[3]+" field-content svelte-s7tjhg"),fe(e,"white-space","break-spaces")},m(s,o){A(s,e,o),v(e,n)},p(s,o){o&2&&t!==(t=(JSON.stringify(s[1],null,2)??"")+"")&&K(n,t),o&8&&r!==(r=s[3]+" field-content svelte-s7tjhg")&&O(e,"class",r)},i:U,o:U,d(s){s&&P(e)}}}function aW(i){let e,t,n,r,s=ue(i[1]),o=[];for(let a=0;aR(o[a],1,1,()=>{o[a]=null});return{c(){e=y("div"),t=y("div");for(let a=0;aR(o[a],1,1,()=>{o[a]=null});return{c(){e=y("div"),t=y("div");for(let a=0;a{c[d]=null}),pe(),s=c[r],s?s.p(h,f):(s=c[r]=a[r](h),s.c()),T(s,1),s.m(o.parentNode,o))},i(h){l||(T(s),l=!0)},o(h){R(s),l=!1},d(h){h&&P(o),c[r].d(h)}}}function hW(i,e,t){let{field:n}=e,{side:r}=e,{edges:s}=e,{colorClass:o}=e;return i.$$set=l=>{"field"in l&&t(0,n=l.field),"side"in l&&t(1,r=l.side),"edges"in l&&t(2,s=l.edges),"colorClass"in l&&t(3,o=l.colorClass)},[n,r,s,o]}class Pw extends oe{constructor(e){super(),se(this,e,hW,uW,re,{field:0,side:1,edges:2,colorClass:3})}}function fW(i){let e,t,n,r=i[0].rank+"",s,o,l,a,c,u=i[0].target+"",h,f;return{c(){e=y("div"),t=y("span"),n=W("Rank: "),s=W(r),o=D(),l=y("span"),l.textContent="id:",a=D(),c=y("a"),h=W(u),O(t,"class","me-3"),O(c,"href",f=i[1].lucentUrl+"/records/"+i[0].target),O(c,"target","_blank")},m(d,m){A(d,e,m),v(e,t),v(t,n),v(t,s),v(e,o),v(e,l),v(e,a),v(e,c),v(c,h)},p(d,[m]){m&1&&r!==(r=d[0].rank+"")&&K(s,r),m&1&&u!==(u=d[0].target+"")&&K(h,u),m&1&&f!==(f=d[1].lucentUrl+"/records/"+d[0].target)&&O(c,"href",f)},i:U,o:U,d(d){d&&P(e)}}}function dW(i,e,t){const n=je("channel");let{edge:r}=e;return i.$$set=s=>{"edge"in s&&t(0,r=s.edge)},[r,n]}class OP extends oe{constructor(e){super(),se(this,e,dW,fW,re,{edge:0})}}function Aw(i,e,t){const n=i.slice();return n[16]=e[t][0],n[17]=e[t][1],n}function xw(i,e,t){const n=i.slice();return n[20]=e[t],n}function Tw(i,e,t){const n=i.slice();return n[20]=e[t],n}function Qw(i,e,t){const n=i.slice();return n[16]=e[t],n}function Mw(i,e,t){const n=i.slice();return n[27]=e[t],n}function mW(i){let e;return{c(){e=y("div"),e.innerHTML="Revisions are not enabled for this Schema",O(e,"class","card-body")},m(t,n){A(t,e,n)},p:U,i:U,o:U,d(t){t&&P(e)}}}function pW(i){let e,t,n,r,s=ue(i[8]),o=[];for(let a=0;aR(o[a],1,1,()=>{o[a]=null});return{c(){e=y("div"),e.textContent="Revisions",t=D();for(let a=0;a{n=null}),pe())},i(r){t||(T(n),t=!0)},o(r){R(n),t=!1},d(r){r&&P(e),n&&n.d(r)}}}function Dw(i){let e,t,n,r,s,o,l,a;const c=[OW,gW],u=[];function h(p,g){return p[6].length>0?0:1}t=h(i),n=u[t]=c[t](i);let f=ue(Object.entries(i[7])),d=[];for(let p=0;pR(d[p],1,1,()=>{d[p]=null});return{c(){e=y("div"),n.c(),r=D(),s=y("div"),o=y("p"),o.textContent="Record References",l=D();for(let p=0;p{u[b]=null}),pe(),n=u[t],n?n.p(p,g):(n=u[t]=c[t](p),n.c()),T(n,1),n.m(e,r)),g&128){f=ue(Object.entries(p[7]));let w;for(w=0;wNothing will change",O(e,"class","lx-card text-center")},m(t,n){A(t,e,n)},p:U,i:U,o:U,d(t){t&&P(e)}}}function OW(i){let e,t,n,r,s=i[5].version+"",o,l,a,c,u,h,f,d=i[4]&&$w(i),m=ue(i[6]),p=[];for(let b=0;bR(p[b],1,1,()=>{p[b]=null});return{c(){e=y("p"),e.textContent="If you choose to rollback to this revision",t=D(),n=y("button"),r=W("Rollback to version "),o=W(s),l=D(),d&&d.c(),a=D(),c=y("div");for(let b=0;bR(b[C],1,1,()=>{b[C]=null});let S=null;g.length||(S=Iw());let _=ue(i[17].revision),k=[];for(let C=0;C<_.length;C+=1)k[C]=Bw(xw(i,_,C));const Q=C=>R(k[C],1,1,()=>{k[C]=null});let x=null;return _.length||(x=Zw()),{c(){e=y("div"),t=y("div"),r=W(n),s=W(":"),o=D(),l=y("div"),a=y("p"),a.textContent="Record",c=D();for(let C=0;C0?0:1}Pe=Ut(i),Ye=Ke[Pe]=Qt[Pe](i);let ct=i[5]&&Dw(i);return{c(){e=y("div"),t=y("div"),n=y("div"),r=y("div"),s=y("span"),s.textContent="record id",o=D(),l=y("small"),c=W(a),u=D(),h=y("div"),f=y("span"),f.textContent="current version",d=D(),p=W(m),g=D(),b=y("div"),w=y("span"),w.textContent="created",S=D(),V(_.$$.fragment),k=D(),x=W(Q),C=D(),M=y("div"),$=y("span"),$.textContent="updated",N=D(),V(B.$$.fragment),J=D(),ie=W(te),le=D(),X=y("div"),ee=y("span"),ee.textContent="Rules for this schema",Te=D(),ve=y("small"),Ue=W("Each record maintains the last "),Ee=W(ne),Re=W(` - versions`),xt=D(),H=y("div"),Ye.c(),Tt=D(),yt=y("div"),ct&&ct.c(),O(s,"class","label text-end text-muted"),O(f,"class","label text-end text-muted"),O(w,"class","label text-end text-muted"),O($,"class","label text-end text-muted"),O(n,"class","col-8"),O(ee,"class","label d-block text-muted"),O(X,"class","col-4"),O(t,"class","row"),O(e,"class","lx-card"),O(H,"class","revisions")},m(qe,Mt){A(qe,e,Mt),v(e,t),v(t,n),v(n,r),v(r,s),v(r,o),v(r,l),v(l,c),v(n,u),v(n,h),v(h,f),v(h,d),v(h,p),v(n,g),v(n,b),v(b,w),v(b,S),Y(_,b,null),v(b,k),v(b,x),v(n,C),v(n,M),v(M,$),v(M,N),Y(B,M,null),v(M,J),v(M,ie),v(t,le),v(t,X),v(X,ee),v(X,Te),v(X,ve),v(ve,Ue),v(ve,Ee),v(ve,Re),A(qe,xt,Mt),A(qe,H,Mt),Ke[Pe].m(H,null),A(qe,Tt,Mt),A(qe,yt,Mt),ct&&ct.m(yt,null),i[13](yt),wt=!0},p(qe,[Mt]){(!wt||Mt&1)&&a!==(a=qe[0].id+"")&&K(c,a),(!wt||Mt&1)&&m!==(m=qe[0].version+"")&&K(p,m);const ei={};Mt&3&&(ei.name=Dn(qe[1],qe[0].createdBy)),_.$set(ei),(!wt||Mt&1)&&Q!==(Q=Bi(qe[0].createdAt)+"")&&K(x,Q);const ti={};Mt&3&&(ti.name=Dn(qe[1],qe[0].updatedBy)),B.$set(ti),(!wt||Mt&1)&&te!==(te=Bi(qe[0].updatedAt)+"")&&K(ie,te),(!wt||Mt&4)&&ne!==(ne=qe[2].revisions+"")&&K(Ee,ne);let Ri=Pe;Pe=Ut(qe),Pe===Ri?Ke[Pe].p(qe,Mt):(me(),R(Ke[Ri],1,1,()=>{Ke[Ri]=null}),pe(),Ye=Ke[Pe],Ye?Ye.p(qe,Mt):(Ye=Ke[Pe]=Qt[Pe](qe),Ye.c()),T(Ye,1),Ye.m(H,null)),qe[5]?ct?(ct.p(qe,Mt),Mt&32&&T(ct,1)):(ct=Dw(qe),ct.c(),T(ct,1),ct.m(yt,null)):ct&&(me(),R(ct,1,1,()=>{ct=null}),pe())},i(qe){wt||(T(_.$$.fragment,qe),T(B.$$.fragment,qe),T(Ye),T(ct),wt=!0)},o(qe){R(_.$$.fragment,qe),R(B.$$.fragment,qe),R(Ye),R(ct),wt=!1},d(qe){qe&&(P(e),P(xt),P(H),P(Tt),P(yt)),z(_),z(B),Ke[Pe].d(),ct&&ct.d(),i[13](null)}}}function vW(i,e,t){let n,r,s,o;const l=je("channel");let{record:a}=e,{graph:c}=e,{users:u}=e,{schema:h}=e,f,d="";axios.get(`${l.lucentUrl}/records/${a.id}/revisions`).then(S=>{t(8,n=S.data)}).catch(S=>{console.log(S)});function m(S,_){t(7,o=c.edges.filter(k=>k.depth===1).reduce((k,Q)=>(k[Q.field]||(k[Q.field]={record:[],revision:[]}),k[Q.field].record.push(Q),k),{})),t(7,o=_._edges.reduce((k,Q)=>(k[Q.field]||(k[Q.field]={record:[],revision:[]}),k[Q.field].revision.push(Q),k),o))}function p(S,_){S.preventDefault(),t(5,s=_),t(6,r=h.fields.filter(k=>!na(s.data[k.name],a.data[k.name]))),m(r,_),f.scrollIntoView()}function g(S){S.preventDefault(),t(4,d=""),axios.post(`${l.lucentUrl}/records/${a.id}/rollback/${s.version}`).then(_=>{window.location.reload()}).catch(_=>{const k=_.response.data.error;t(4,d=k.fieldLabel+": "+k.message)})}const b=(S,_)=>p(_,S);function w(S){Se[S?"unshift":"push"](()=>{f=S,t(3,f)})}return i.$$set=S=>{"record"in S&&t(0,a=S.record),"graph"in S&&t(11,c=S.graph),"users"in S&&t(1,u=S.users),"schema"in S&&t(2,h=S.schema)},t(8,n=[]),t(6,r=[]),t(5,s=null),t(7,o={}),[a,u,h,f,d,s,r,o,n,p,g,c,b,w]}class wW extends oe{constructor(e){super(),se(this,e,vW,bW,re,{record:0,graph:11,users:1,schema:2})}}const{window:yW}=CP;function Xw(i,e,t){const n=i.slice();return n[21]=e[t],n}function kW(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=` - Save`,O(e,"type","button"),O(e,"class","button primary ms-2 btn btn-primary btn-spinner")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[11]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function SW(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=` - Create`,O(e,"class","button primary btn-spinner")},m(r,s){A(r,e,s),t||(n=G(e,"click",i[11]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function _W(i){let e,t;return e=new wW({props:{record:i[0],graph:i[1],users:i[4],schema:i[2]}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.record=n[0]),r&2&&(s.graph=n[1]),r&16&&(s.users=n[4]),r&4&&(s.schema=n[2]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function CW(i){let e,t;return e=new rW({props:{graph:i[1],record:i[0]}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&2&&(s.graph=n[1]),r&1&&(s.record=n[0]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function PW(i){let e=[],t=new Map,n,r,s=ue(i[9]);const o=l=>l[21].name;for(let l=0;lHe(e,"data",s)),Se.push(()=>He(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&4&&(u.schema=a[2]),c&1&&(u.record=a[0]),c&32&&(u.validationErrors=a[5]),c&8&&(u.isCreateMode=a[3]),!t&&c&1&&(t=!0,u.data=a[0].data,nt(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],nt(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function Yw(i,e){let t,n,r,s=e[6]===e[21].group&&Fw(e);return{key:i,first:null,c(){t=De(),s&&s.c(),n=De(),this.first=t},m(o,l){A(o,t,l),s&&s.m(o,l),A(o,n,l),r=!0},p(o,l){e=o,e[6]===e[21].group?s?(s.p(e,l),l&64&&T(s,1)):(s=Fw(e),s.c(),T(s,1),s.m(n.parentNode,n)):s&&(me(),R(s,1,1,()=>{s=null}),pe())},i(o){r||(T(s),r=!0)},o(o){R(s),r=!1},d(o){o&&(P(t),P(n)),s&&s.d(o)}}}function AW(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S,_,k;function Q(X){i[12](X)}function x(X){i[13](X)}let C={schema:i[2],isCreateMode:i[3]};i[0]!==void 0&&(C.record=i[0]),i[6]!==void 0&&(C.activeContentTab=i[6]),n=new wy({props:C}),Se.push(()=>He(n,"record",Q)),Se.push(()=>He(n,"activeContentTab",x));function M(X,ee){if(X[3])return SW;if(X[8])return kW}let $=M(i),N=$&&$(i);a=new Dy({props:{schema:i[2],record:i[0],isCreateMode:i[3]}}),u=new Ma({props:{message:i[7]}});function B(X){i[14](X)}let J={schema:i[2],isCreateMode:i[3]};i[6]!==void 0&&(J.active=i[6]),d=new yy({props:J}),Se.push(()=>He(d,"active",B));const te=[PW,CW,_W],ie=[];function le(X,ee){return ee&64&&(g=null),g==null&&(g=!["_graph","_info"].includes(X[6])),g?0:X[6]==="_graph"?1:X[6]==="_info"?2:-1}return~(b=le(i,-1))&&(w=ie[b]=te[b](i)),{c(){e=y("div"),t=y("div"),V(n.$$.fragment),o=D(),N&&N.c(),l=D(),V(a.$$.fragment),c=D(),V(u.$$.fragment),h=D(),f=y("div"),V(d.$$.fragment),p=D(),w&&w.c(),O(t,"class","tools-header"),O(f,"class","mt-4"),fe(f,"margin-bottom","150px"),fe(f,"position","relative"),O(e,"class","record-edit")},m(X,ee){A(X,e,ee),v(e,t),Y(n,t,null),v(t,o),N&&N.m(t,null),v(e,l),Y(a,e,null),v(e,c),Y(u,e,null),v(e,h),v(e,f),Y(d,f,null),v(f,p),~b&&ie[b].m(f,null),S=!0,_||(k=G(yW,"beforeunload",i[10]),_=!0)},p(X,[ee]){const Te={};ee&4&&(Te.schema=X[2]),ee&8&&(Te.isCreateMode=X[3]),!r&&ee&1&&(r=!0,Te.record=X[0],nt(()=>r=!1)),!s&&ee&64&&(s=!0,Te.activeContentTab=X[6],nt(()=>s=!1)),n.$set(Te),$===($=M(X))&&N?N.p(X,ee):(N&&N.d(1),N=$&&$(X),N&&(N.c(),N.m(t,null)));const ve={};ee&4&&(ve.schema=X[2]),ee&1&&(ve.record=X[0]),ee&8&&(ve.isCreateMode=X[3]),a.$set(ve);const Ue={};ee&128&&(Ue.message=X[7]),u.$set(Ue);const ne={};ee&4&&(ne.schema=X[2]),ee&8&&(ne.isCreateMode=X[3]),!m&&ee&64&&(m=!0,ne.active=X[6],nt(()=>m=!1)),d.$set(ne);let Ee=b;b=le(X,ee),b===Ee?~b&&ie[b].p(X,ee):(w&&(me(),R(ie[Ee],1,1,()=>{ie[Ee]=null}),pe()),~b?(w=ie[b],w?w.p(X,ee):(w=ie[b]=te[b](X),w.c()),T(w,1),w.m(f,null)):w=null)},i(X){S||(T(n.$$.fragment,X),T(a.$$.fragment,X),T(u.$$.fragment,X),T(d.$$.fragment,X),T(w),S=!0)},o(X){R(n.$$.fragment,X),R(a.$$.fragment,X),R(u.$$.fragment,X),R(d.$$.fragment,X),R(w),S=!1},d(X){X&&P(e),z(n),N&&N.d(),z(a),z(u),z(d),~b&&ie[b].d(),_=!1,k()}}}function xW(i,e,t){let n,r,s;const o=je("channel");let{schema:l}=e,{record:a}=e,{graph:c={records:[],edges:[]}}=e,{isCreateMode:u}=e,{users:h}=e,f,d="",m=l.fields.filter(C=>C.name!=="id");Ti(()=>{p()});function p(){f={data:JSON.parse(JSON.stringify(a.data)),status:a.status,edges:JSON.parse(JSON.stringify(c.edges))}}cy(()=>{t(8,n=b())});function g(C){return n?C.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete C.returnValue,"...")}function b(){return u?!1:!na(f,{data:a.data,status:a.status,edges:c.edges})}function w(C){return C.preventDefault(),console.log("SAVE: Attempt"),t(5,r=null),t(7,s=""),new Promise(function(M,$){var N;if(!n&&!u){M(null);return}if(!a){M(null);return}t(1,c.edges=(N=c.edges)==null?void 0:N.filter(B=>!B._isTrashed&&B.source===a.id),c),Jn(o.lucentUrl+"/records",{record:a,edges:c.edges,isCreateMode:u}).then(function(B){if(console.log("SAVE: SAVED"),u)window.location=o.lucentUrl+"/records/"+a.id;else{if(t(0,a=B.records[0]??null),!a){t(8,n=!1),window.location=o.lucentUrl;return}t(1,c=B),p()}M(null)}).catch(function(B){B.response&&(typeof B.response.data.error=="string"?t(7,s=B.response.data.error):(t(5,r=B.response.data.error),console.log(r))),M(null)})})}function S(C){a=C,t(0,a)}function _(C){d=C,t(6,d)}function k(C){d=C,t(6,d)}function Q(C){i.$$.not_equal(a.data,C)&&(a.data=C,t(0,a))}function x(C){c=C,t(1,c)}return i.$$set=C=>{"schema"in C&&t(2,l=C.schema),"record"in C&&t(0,a=C.record),"graph"in C&&t(1,c=C.graph),"isCreateMode"in C&&t(3,u=C.isCreateMode),"users"in C&&t(4,h=C.users)},i.$$.update=()=>{i.$$.dirty&32&&t(7,s=r?`Record submission failed. ${Object.entries(r).length} error(s)`:null)},t(8,n=!1),t(5,r=null),[a,c,l,u,h,r,d,s,n,m,g,w,S,_,k,Q,x]}class TW extends oe{constructor(e){super(),se(this,e,xW,AW,re,{schema:2,record:0,graph:1,isCreateMode:3,users:4})}}function zw(i,e,t){const n=i.slice();return n[3]=e[t],n}function Vw(i){let e,t=i[3].label+"",n;return{c(){var r;e=y("a"),n=W(t),O(e,"class","sidebar-item"),O(e,"aria-current","page"),O(e,"href",i[1].lucentUrl+"/content/"+i[3].name),Ae(e,"active",i[3].name===((r=i[0])==null?void 0:r.name))},m(r,s){A(r,e,s),v(e,n)},p(r,s){var o;s&5&&Ae(e,"active",r[3].name===((o=r[0])==null?void 0:o.name))},d(r){r&&P(e)}}}function QW(i){let e,t,n=i[1].name+"",r,s,o,l=ue(i[2]),a=[];for(let c=0;c{"schema"in o&&t(0,n=o.schema)},[n,r,s]}class EW extends oe{constructor(e){super(),se(this,e,MW,QW,re,{schema:0})}}function Uw(i){let e;return{c(){e=y("span"),e.textContent="DRAFT",O(e,"class","status")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function RW(i){let e,t=i[1].data.name+"",n,r;return{c(){e=y("a"),n=W(t),O(e,"href",r=i[2].lucentUrl+"/records/"+i[1].id)},m(s,o){A(s,e,o),v(e,n)},p(s,o){o&2&&t!==(t=s[1].data.name+"")&&K(n,t),o&2&&r!==(r=s[2].lucentUrl+"/records/"+s[1].id)&&O(e,"href",r)},i:U,o:U,d(s){s&&P(e)}}}function DW(i){let e,t;return e=new Wo({props:{record:i[1],size:"tiny",showFilename:!0}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&2&&(s.record=n[1]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function $W(i){let e,t,n,r,s,o,l,a,c=i[3].label+"",u,h,f,d,m,p,g,b,w=i[1].status==="draft"&&Uw();const S=[DW,RW],_=[];function k(Q,x){return Q[3].type==="files"?0:1}return r=k(i),s=_[r]=S[r](i),m=new Ci({props:{name:Dn(i[0],i[1].updatedBy),side:24}}),{c(){e=y("td"),t=y("div"),w&&w.c(),n=D(),s.c(),o=D(),l=y("td"),a=y("a"),u=W(c),h=D(),f=y("td"),d=y("div"),V(m.$$.fragment),p=D(),g=y("div"),g.textContent=`${i[4]}`,O(t,"class","row-name"),O(a,"href",i[2].lucentUrl+"/content/"+i[3].name),O(g,"class","ms-2"),fe(d,"display","flex"),fe(d,"gap","14px")},m(Q,x){A(Q,e,x),v(e,t),w&&w.m(t,null),v(t,n),_[r].m(t,null),A(Q,o,x),A(Q,l,x),v(l,a),v(a,u),A(Q,h,x),A(Q,f,x),v(f,d),Y(m,d,null),v(d,p),v(d,g),b=!0},p(Q,[x]){Q[1].status==="draft"?w||(w=Uw(),w.c(),w.m(t,n)):w&&(w.d(1),w=null),s.p(Q,x);const C={};x&3&&(C.name=Dn(Q[0],Q[1].updatedBy)),m.$set(C)},i(Q){b||(T(s),T(m.$$.fragment,Q),b=!0)},o(Q){R(s),R(m.$$.fragment,Q),b=!1},d(Q){Q&&(P(e),P(o),P(l),P(h),P(f)),w&&w.d(),_[r].d(),z(m)}}}function LW(i,e,t){const n=je("channel");let{users:r}=e,{record:s}=e,o=n.schemas.find(a=>a.name===s.schema),l=by(ih(s.updatedAt),{addSuffix:!0});return i.$$set=a=>{"users"in a&&t(0,r=a.users),"record"in a&&t(1,s=a.record)},[r,s,n,o,l]}class IW extends oe{constructor(e){super(),se(this,e,LW,$W,re,{users:0,record:1})}}function jw(i,e,t){const n=i.slice();return n[3]=e[t],n}function qw(i){let e,t,n,r=[],s=new Map,o,l=ue(i[0]);const a=c=>c[3].id;for(let c=0;c0&&qw(i);return{c(){e=y("h3"),e.textContent="Latest Content changes",t=D(),s&&s.c(),n=De(),O(e,"class","header-small mb-4 mt-5")},m(o,l){A(o,e,l),A(o,t,l),s&&s.m(o,l),A(o,n,l),r=!0},p(o,[l]){o[0].length>0?s?(s.p(o,l),l&1&&T(s,1)):(s=qw(o),s.c(),T(s,1),s.m(n.parentNode,n)):s&&(me(),R(s,1,1,()=>{s=null}),pe())},i(o){r||(T(s),r=!0)},o(o){R(s),r=!1},d(o){o&&(P(e),P(t),P(n)),s&&s.d(o)}}}function ZW(i,e,t){const n=je("channel");let r=[],s=[];return Ti(()=>{Qa(n.lucentUrl+"/home/records").then(o=>{t(0,r=o.records),t(1,s=o.users)}).catch(o=>{console.log(o)})}),[r,s]}class BW extends oe{constructor(e){super(),se(this,e,ZW,NW,re,{})}}function Hw(i){let e;return{c(){e=y("span"),e.textContent="Action in progress",O(e,"class","badge text-bg-warning")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function Kw(i){let e;return{c(){e=y("span"),e.textContent="Action completed",O(e,"class","badge text-bg-info")},m(t,n){A(t,e,n)},d(t){t&&P(e)}}}function WW(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,b,w,S=i[2]&&Hw(),_=!i[2]&&i[3]&&Kw();return{c(){e=y("div"),t=y("div"),n=y("h3"),r=W(i[0]),s=D(),o=y("button"),l=W("Start"),a=D(),c=y("div"),S&&S.c(),u=D(),_&&_.c(),h=D(),f=y("pre"),d=W(i[3]),m=W(` +}`,{label:"class",detail:"definition",type:"keyword"}),Qn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Qn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],U8=IC.concat([Qn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Qn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Qn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Xv=new y2,NC=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ol(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}const j8=["FunctionDeclaration"],q8={FunctionDeclaration:Ol("function"),ClassDeclaration:Ol("class"),ClassExpression:()=>!0,EnumDeclaration:Ol("constant"),TypeAliasDeclaration:Ol("type"),NamespaceDeclaration:Ol("namespace"),VariableDefinition(i,e){i.matchContext(j8)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function ZC(i,e){let t=Xv.get(e);if(t)return t;let n=[],r=!0;function s(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(Pt.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=q8[o.name];if(l&&l(o,s)||NC.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of ZC(i,o.node))n.push(l);return!1}}),Xv.set(e,n),n}const Fv=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,BC=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function G8(i){let e=At(i.state).resolveInner(i.pos,-1);if(BC.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Fv.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let r=e;r;r=r.parent)NC.has(r.name)&&(n=n.concat(ZC(i.state.doc,r)));return{options:n,from:t?e.from:i.pos,validFor:Fv}}const qi=$s.define({name:"javascript",parser:V8.configure({props:[zo.add({IfStatement:wo({except:/^\s*({|else\b)/}),TryStatement:wo({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:ZL,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:NL({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":wo({except:/^{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),Fs.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Cp,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),WC={test:i=>/^JSX/.test(i.name),facet:yp({commentTokens:{block:{open:"{/*",close:"*/}"}}})},XC=qi.configure({dialect:"ts"},"typescript"),FC=qi.configure({dialect:"jsx",props:[kp.add(i=>i.isTop?[WC]:void 0)]}),YC=qi.configure({dialect:"jsx ts",props:[kp.add(i=>i.isTop?[WC]:void 0)]},"typescript");let zC=i=>({label:i,type:"keyword"});const VC="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(zC),H8=VC.concat(["declare","implements","private","protected","public"].map(zC));function K8(i={}){let e=i.jsx?i.typescript?YC:FC:i.typescript?XC:qi,t=i.typescript?U8.concat(H8):IC.concat(VC);return new Do(e,[qi.data.of({autocomplete:iI(BC,Q_(t))}),qi.data.of({autocomplete:G8}),i.jsx?tB:[]])}function J8(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function Yv(i,e,t=i.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}const eB=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),tB=pe.inputHandler.of((i,e,t,n,r)=>{if((eB?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!qi.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var c;let{head:u}=a,h=At(o).resolveInner(u-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=n||h.name=="JSXAttributeValue"&&h.to>u)){if(n==">"&&h.name=="JSXFragmentTag")return{range:a,changes:{from:u,insert:""}};if(n=="/"&&h.name=="JSXStartCloseTag"){let d=h.parent,m=d.parent;if(m&&d.from==u-2&&((f=Yv(o.doc,m.firstChild,u))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let p=`${f}>`;return{range:q.cursor(u+p.length,-1),changes:{from:u,insert:p}}}}else if(n==">"){let d=J8(h);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(f=Yv(o.doc,d,u)))return{range:a,changes:{from:u,insert:``}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),bl=["_blank","_self","_top","_parent"],id=["ascii","utf-8","utf-16","latin1","latin1"],rd=["get","post","put","delete"],sd=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Xn=["true","false"],xe={},nB={a:{attrs:{href:null,ping:null,type:null,media:null,target:bl,hreflang:null}},abbr:xe,address:xe,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:xe,aside:xe,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:xe,base:{attrs:{href:null,target:bl}},bdi:xe,bdo:xe,blockquote:{attrs:{cite:null}},body:xe,br:xe,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:sd,formmethod:rd,formnovalidate:["novalidate"],formtarget:bl,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:xe,center:xe,cite:xe,code:xe,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:xe,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:xe,div:xe,dl:xe,dt:xe,em:xe,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:xe,figure:xe,footer:xe,form:{attrs:{action:null,name:null,"accept-charset":id,autocomplete:["on","off"],enctype:sd,method:rd,novalidate:["novalidate"],target:bl}},h1:xe,h2:xe,h3:xe,h4:xe,h5:xe,h6:xe,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:xe,hgroup:xe,hr:xe,html:{attrs:{manifest:null}},i:xe,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:sd,formmethod:rd,formnovalidate:["novalidate"],formtarget:bl,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:xe,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:xe,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:xe,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:id,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:xe,noscript:xe,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:xe,param:{attrs:{name:null,value:null}},pre:xe,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:xe,rt:xe,ruby:xe,samp:xe,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:id}},section:xe,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:xe,source:{attrs:{src:null,type:null,media:null}},span:xe,strong:xe,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:xe,summary:xe,sup:xe,table:xe,tbody:xe,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:xe,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:xe,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:xe,time:{attrs:{datetime:null}},title:xe,tr:xe,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:xe,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:xe},UC={accesskey:null,class:null,contenteditable:Xn,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Xn,autocorrect:Xn,autocapitalize:Xn,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Xn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Xn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Xn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Xn,"aria-hidden":Xn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Xn,"aria-multiselectable":Xn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Xn,"aria-relevant":null,"aria-required":Xn,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},jC="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(i=>"on"+i);for(let i of jC)UC[i]=null;class xa{constructor(e,t){this.tags=Object.assign(Object.assign({},nB),e),this.globalAttrs=Object.assign(Object.assign({},UC),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}xa.default=new xa;function No(i,e,t=i.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?i.sliceString(r.from,Math.min(r.to,t)):""}function Zo(i,e=!1){for(;i;i=i.parent)if(i.name=="Element")if(e)e=!1;else return i;return null}function qC(i,e,t){let n=t.tags[No(i,Zo(e))];return(n==null?void 0:n.children)||t.allTags}function jp(i,e){let t=[];for(let n=Zo(e);n&&!n.type.isTop;n=Zo(n.parent)){let r=No(i,n);if(r&&n.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(r)}return t}const GC=/^[:\-\.\w\u00b7-\uffff]*$/;function zv(i,e,t,n,r){let s=/\s*>/.test(i.sliceDoc(r,r+5))?"":">",o=Zo(t,!0);return{from:n,to:r,options:qC(i.doc,o,e).map(l=>({label:l,type:"type"})).concat(jp(i.doc,t).map((l,a)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Vv(i,e,t,n){let r=/\s*>/.test(i.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:jp(i.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:GC}}function iB(i,e,t,n){let r=[],s=0;for(let o of qC(i.doc,t,e))r.push({label:"<"+o,type:"type"});for(let o of jp(i.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:n,to:n,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function rB(i,e,t,n,r){let s=Zo(t),o=s?e.tags[No(i.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:r,options:a.map(c=>({label:c,type:"property"})),validFor:GC}}function sB(i,e,t,n,r){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],a;if(o){let c=i.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=Zo(t),f=h?e.tags[No(i.doc,h)]:null;u=(f==null?void 0:f.attrs)&&f.attrs[c]}if(u){let h=i.sliceDoc(n,r).toLowerCase(),f='"',d='"';/^['"]/.test(h)?(a=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",d=i.sliceDoc(r,r+1)==h[0]?"":h[0],h=h.slice(1),n++):a=/^[^\s<>='"]*$/;for(let m of u)l.push({label:m,apply:f+m+d,type:"constant"})}}return{from:n,to:r,options:l,validFor:a}}function HC(i,e){let{state:t,pos:n}=e,r=At(t).resolveInner(n,-1),s=r.resolve(n);for(let o=n,l;s==r&&(l=r.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromHC(n,r)}const aB=qi.parser.configure({top:"SingleExpression"}),KC=[{tag:"script",attrs:i=>i.type=="text/typescript"||i.lang=="ts",parser:XC.parser},{tag:"script",attrs:i=>i.type=="text/babel"||i.type=="text/jsx",parser:FC.parser},{tag:"script",attrs:i=>i.type=="text/typescript-jsx",parser:YC.parser},{tag:"script",attrs(i){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(i.type)},parser:aB},{tag:"script",attrs(i){return!i.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(i.type)},parser:qi.parser},{tag:"style",attrs(i){return(!i.lang||i.lang=="css")&&(!i.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(i.type))},parser:th.parser}],JC=[{name:"style",parser:th.parser.configure({top:"Styles"})}].concat(jC.map(i=>({name:i,parser:qi.parser}))),eP=$s.define({name:"html",parser:YZ.configure({props:[zo.add({Element(i){let e=/^(\s*)(<\/)?/.exec(i.textAfter);return i.node.to<=i.pos+e[0].length?i.continue():i.lineIndent(i.node.from)+(e[2]?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit},Document(i){if(i.pos+/\s*/.exec(i.textAfter)[0].lengthi.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ru=eP.configure({wrap:MC(KC,JC)});function cB(i={}){let e="",t;i.matchClosingTags===!1&&(e="noMatch"),i.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(i.nestedLanguages&&i.nestedLanguages.length||i.nestedAttributes&&i.nestedAttributes.length)&&(t=MC((i.nestedLanguages||[]).concat(KC),(i.nestedAttributes||[]).concat(JC)));let n=t?eP.configure({wrap:t,dialect:e}):e?ru.configure({dialect:e}):ru;return new Do(n,[ru.data.of({autocomplete:lB(i)}),i.autoCloseTags!==!1?uB:[],K8().support,b8().support])}const Uv=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),uB=pe.inputHandler.of((i,e,t,n,r)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!ru.isActiveAt(i.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var c,u,h;let f=o.doc.sliceString(a.from-1,a.to)==n,{head:d}=a,m=At(o).resolveInner(d,-1),p;if(f&&n==">"&&m.name=="EndTag"){let g=m.parent;if(((u=(c=g.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(p=No(o.doc,g.parent,d))&&!Uv.has(p)){let v=d+(o.doc.sliceString(d,d+1)===">"?1:0),w=``;return{range:a,changes:{from:d,to:v,insert:w}}}}else if(f&&n=="/"&&m.name=="IncompleteCloseTag"){let g=m.parent;if(m.from==d-2&&((h=g.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(p=No(o.doc,g,d))&&!Uv.has(p)){let v=d+(o.doc.sliceString(d,d+1)===">"?1:0),w=`${p}>`;return{range:q.cursor(d+w.length,-1),changes:{from:d,to:v,insert:w}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),tP=yp({commentTokens:{block:{open:""}}}),nP=new Ze,iP=UN.configure({props:[Fs.add(i=>!i.is("Block")||i.is("Document")||Bm(i)!=null||hB(i)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),nP.add(Bm),zo.add({Document:()=>null}),ks.add({Document:tP})]});function Bm(i){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(i.name);return e?+e[1]:void 0}function hB(i){return i.name=="OrderedList"||i.name=="BulletList"}function fB(i,e){let t=i;for(;;){let n=t.nextSibling,r;if(!n||(r=Bm(n.type))!=null&&r<=e)break;t=n}return t.to}const dB=x2.of((i,e,t)=>{for(let n=At(i).resolveInner(t,-1);n&&!(n.fromt)return{from:t,to:s}}return null});function qp(i){return new ai(tP,i,[dB],"markdown")}const mB=qp(iP),pB=iP.configure([rZ,oZ,sZ,lZ,{props:[Fs.add({Table:(i,e)=>({from:e.doc.lineAt(i.from).to,to:i.to})})]}]),rP=qp(pB);function gB(i,e){return t=>{if(t&&i){let n=null;if(t=/\S*/.exec(t)[0],typeof i=="function"?n=i(t):n=$u.matchLanguageName(i,t,!0),n instanceof $u)return n.support?n.support.language.parser:ba.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class Dc{constructor(e,t,n,r,s,o,l){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,t=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;r--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+oP(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function sP(i,e){let t=[];for(let r=i;r&&r.name!="Document";r=r.parent)(r.name=="ListItem"||r.name=="Blockquote"||r.name=="FencedCode")&&t.push(r);let n=[];for(let r=t.length-1;r>=0;r--){let s=t[r],o,l=e.lineAt(s.from),a=s.from-l.from;if(s.name=="FencedCode")n.push(new Dc(s,a,a,"","","",null));else if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(a))))n.push(new Dc(s,a,a+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(a)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),n.push(new Dc(s.parent,a,a+u,o[1],c,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(a)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),n.push(new Dc(s.parent,a,a+u,o[1],c,h,s))}}return n}function oP(i,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(i.from,i.from+10))}function od(i,e,t,n=0){for(let r=-1,s=i;;){if(s.name=="ListItem"){let l=oP(s,e),a=+l[2];if(r>=0){if(a!=r+1)return;t.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+n)})}r=a}let o=s.nextSibling;if(!o)break;s=o}}function Gp(i,e){let t=/^[ \t]*/.exec(i)[0].length;if(!t||e.facet(Ba)!=" ")return i;let n=Ci(i,4,t),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+i.slice(t)}const OB=({state:i,dispatch:e})=>{let t=At(i),{doc:n}=i,r=null,s=i.changeByRange(o=>{if(!o.empty||!rP.isActiveAt(i,o.from))return r={range:o};let l=o.from,a=n.lineAt(l),c=sP(t.resolveInner(l,-1),n);for(;c.length&&c[c.length-1].from>l-a.from;)c.pop();if(!c.length)return r={range:o};let u=c[c.length-1];if(u.to-u.spaceAfter.length>l-a.from)return r={range:o};let h=l>=u.to-u.spaceAfter.length&&!/\S/.test(a.text.slice(u.to));if(u.item&&h){let g=u.node.firstChild,v=u.node.getChild("ListItem","ListItem");if(g.to>=l||v&&v.to0&&!/[^\s>]/.test(n.lineAt(a.from-1).text)){let w=c.length>1?c[c.length-2]:null,S,_="";w&&w.item?(S=a.from+w.from,_=w.marker(n,1)):S=a.from+(w?w.to:0);let k=[{from:S,to:l,insert:_}];return u.node.name=="OrderedList"&&od(u.item,n,k,-2),w&&w.node.name=="OrderedList"&&od(w.item,n,k),{range:q.cursor(S+_.length),changes:k}}else{let w=qv(c,i,a);return{range:q.cursor(l+w.length+1),changes:{from:a.from,insert:w+i.lineBreak}}}}if(u.node.name=="Blockquote"&&h&&a.from){let g=n.lineAt(a.from-1),v=/>\s*$/.exec(g.text);if(v&&v.index==u.from){let w=i.changes([{from:g.from+v.index,to:g.to},{from:a.from+u.from,to:a.to}]);return{range:o.map(w),changes:w}}}let f=[];u.node.name=="OrderedList"&&od(u.item,n,f);let d=u.item&&u.item.from]*/.exec(a.text)[0].length>=u.to)for(let g=0,v=c.length-1;g<=v;g++)m+=g==v&&!d?c[g].marker(n,1):c[g].blank(ga.from&&/\s/.test(a.text.charAt(p-a.from-1));)p--;return m=Gp(m,i),bB(u.node,i.doc)&&(m=qv(c,i,a)+i.lineBreak+m),f.push({from:p,to:l,insert:i.lineBreak+m}),{range:q.cursor(p+m.length+1),changes:f}});return r?!1:(e(i.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)};function jv(i){return i.name=="QuoteMark"||i.name=="ListMark"}function bB(i,e){if(i.name!="OrderedList"&&i.name!="BulletList")return!1;let t=i.firstChild,n=i.getChild("ListItem","ListItem");if(!n)return!1;let r=e.lineAt(t.to),s=e.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let t=At(i),n=null,r=i.changeByRange(s=>{let o=s.from,{doc:l}=i;if(s.empty&&rP.isActiveAt(i,s.from)){let a=l.lineAt(o),c=sP(vB(t,o),l);if(c.length){let u=c[c.length-1],h=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-a.from>h&&!/\S/.test(a.text.slice(h,o-a.from)))return{range:q.cursor(a.from+h),changes:{from:a.from+h,to:o}};if(o-a.from==h&&(!u.item||a.from<=u.item.from||!/\S/.test(a.text.slice(0,u.to)))){let f=a.from+u.from;if(u.item&&u.node.from{const v=g.width>0?nT(c,g,h):Gi(c,g);let w=`![${g.filename}](${v})`;return p+` +`+w},""),d=r.state.selection.main.head,m=r.state.update({changes:{from:d,insert:f},selection:{anchor:d+1},scrollIntoView:!0});m&&r.dispatch(m)}xi(()=>{let c=new Vr,u=new Vr,h=et.create({doc:s,extensions:[ju,Ws.of([v_,...V_,...Bp]),c.of(Gv()),Gv(),W_(),u.of(et.tabSize.of(4)),ju,pe.editable.of(o),pe.updateListener.of(function(f){f.docChanged&&t(2,s=f.state.doc.toString())}),pe.lineWrapping,pe.contentAttributes.of({spellcheck:"true"})]});r=new pe({state:h,parent:n})}),Jw(()=>{r&&r.destroy()});function a(c){Ce[c?"unshift":"push"](()=>{n=c,t(1,n)})}return i.$$set=c=>{"value"in c&&t(2,s=c.value),"editable"in c&&t(0,o=c.editable)},[o,n,s,l,a]}class PB extends oe{constructor(e){super(),se(this,e,CB,_B,re,{value:2,editable:0,insertMedia:3})}get insertMedia(){return this.$$.ctx[3]}}function Hv(i){let e,t;return{c(){e=y("div"),t=W(i[6]),O(e,"class","invalid-feedback d-block")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&64&&K(t,n[6])},d(n){n&&P(e)}}}function AB(i){let e,t,n,r,s,o,l;t=new Gy({props:{record:i[2],field:i[1],validationErrors:i[4],onFilesInserted:i[7]}});function a(h){i[9](h)}let c={editable:!i[1].readonly||i[3]};i[0]!==void 0&&(c.value=i[0]),r=new PB({props:c}),i[8](r),Ce.push(()=>nt(r,"value",a));let u=i[6]&&Hv(i);return{c(){e=y("div"),V(t.$$.fragment),n=D(),V(r.$$.fragment),o=D(),u&&u.c(),O(e,"class","mb-3")},m(h,f){x(h,e,f),Y(t,e,null),b(e,n),Y(r,e,null),b(e,o),u&&u.m(e,null),l=!0},p(h,[f]){const d={};f&4&&(d.record=h[2]),f&2&&(d.field=h[1]),f&16&&(d.validationErrors=h[4]),t.$set(d);const m={};f&10&&(m.editable=!h[1].readonly||h[3]),!s&&f&1&&(s=!0,m.value=h[0],st(()=>s=!1)),r.$set(m),h[6]?u?u.p(h,f):(u=Hv(h),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(h){l||(T(t.$$.fragment,h),T(r.$$.fragment,h),l=!0)},o(h){R(t.$$.fragment,h),R(r.$$.fragment,h),l=!1},d(h){h&&P(e),z(t),i[8](null),z(r),u&&u.d()}}}function xB(i,e,t){let n;const r=Ue("channel");let{value:s}=e,{field:o}=e,{record:l}=e,{isCreateMode:a}=e,{validationErrors:c}=e,u;function h(m){const p=m.detail.preset.path;u.insertMedia(r,m.detail.files,p)}function f(m){Ce[m?"unshift":"push"](()=>{u=m,t(5,u)})}function d(m){s=m,t(0,s)}return i.$$set=m=>{"value"in m&&t(0,s=m.value),"field"in m&&t(1,o=m.field),"record"in m&&t(2,l=m.record),"isCreateMode"in m&&t(3,a=m.isCreateMode),"validationErrors"in m&&t(4,c=m.validationErrors)},i.$$.update=()=>{i.$$.dirty&18&&t(6,n=In(c,o.name))},[s,o,l,a,c,u,n,h,f,d]}class lP extends oe{constructor(e){super(),se(this,e,xB,AB,re,{value:0,field:1,record:2,isCreateMode:3,validationErrors:4})}}function Kv(i){let e,t=i[0].help+"",n;return{c(){e=y("small"),n=W(t),O(e,"class","help-text light-text")},m(r,s){x(r,e,s),b(e,n)},p(r,s){s&1&&t!==(t=r[0].help+"")&&K(n,t)},d(r){r&&P(e)}}}function TB(i){let e,t,n,r,s=i[0].label+"",o,l,a,c,u,h=i[0].name+"",f,d=i[0].help&&Kv(i);return{c(){e=y("div"),t=y("div"),n=y("div"),r=y("label"),o=W(s),l=D(),d&&d.c(),a=D(),c=y("span"),u=y("code"),f=W(h),O(r,"for",i[1]),O(n,"class","label-and-help"),O(u,"class","field-id"),O(c,"tabindex","-1"),O(c,"class","text-decoration-none"),O(t,"class","labels"),O(e,"class","field-header")},m(m,p){x(m,e,p),b(e,t),b(t,n),b(n,r),b(r,o),b(n,l),d&&d.m(n,null),b(t,a),b(t,c),b(c,u),b(u,f)},p(m,[p]){p&1&&s!==(s=m[0].label+"")&&K(o,s),p&2&&O(r,"for",m[1]),m[0].help?d?d.p(m,p):(d=Kv(m),d.c(),d.m(n,null)):d&&(d.d(1),d=null),p&1&&h!==(h=m[0].name+"")&&K(f,h)},i:U,o:U,d(m){m&&P(e),d&&d.d()}}}function QB(i,e,t){let{field:n}=e,{id:r}=e;return i.$$set=s=>{"field"in s&&t(0,n=s.field),"id"in s&&t(1,r=s.id)},[n,r]}class MB extends oe{constructor(e){super(),se(this,e,QB,TB,re,{field:0,id:1})}}function Jv(i,e,t){const n=i.slice();return n[2]=e[t],n}function ew(i,e,t){const n=i.slice();return n[24]=e[t],n}function tw(i){let e,t;return{c(){e=y("div"),t=W(i[7]),O(e,"class","invalid-feedback d-block mb-3")},m(n,r){x(n,e,r),b(e,t)},p(n,r){r&128&&K(t,n[7])},d(n){n&&P(e)}}}function nw(i){let e=[],t=new Map,n,r=fe(i[5]);const s=l=>l[24].id;for(let l=0;ll[2].id;for(let l=0;l0&&ow(i);return{c(){e=y("div"),d&&d.c(),t=D(),n=y("input"),s=D(),o=y("div"),m&&m.c(),l=D(),p&&p.c(),a=D(),g&&g.c(),c=Ie(),O(n,"type","search"),O(n,"id",i[1]),O(n,"placeholder",r="Search for "+i[0].label),O(n,"autocomplete","off"),Ae(n,"is-invalid",i[7]),O(o,"class","reference-tags-results"),O(e,"class","reference-tags")},m(v,w){x(v,e,w),d&&d.m(e,null),b(e,t),b(e,n),i[15](n),Le(n,i[4]),b(e,s),b(e,o),m&&m.m(o,null),b(o,l),p&&p.m(o,null),x(v,a,w),g&&g.m(v,w),x(v,c,w),u=!0,h||(f=[G(n,"keyup",i[12]),G(n,"input",i[16])],h=!0)},p(v,[w]){v[7]?d?d.p(v,w):(d=tw(v),d.c(),d.m(e,t)):d&&(d.d(1),d=null),(!u||w&2)&&O(n,"id",v[1]),(!u||w&1&&r!==(r="Search for "+v[0].label))&&O(n,"placeholder",r),w&16&&n.value!==v[4]&&Le(n,v[4]),(!u||w&128)&&Ae(n,"is-invalid",v[7]),v[5]?m?m.p(v,w):(m=nw(v),m.c(),m.m(o,l)):m&&(m.d(1),m=null),v[4]?p?p.p(v,w):(p=sw(v),p.c(),p.m(o,null)):p&&(p.d(1),p=null),v[6].length>0?g?(g.p(v,w),w&64&&T(g,1)):(g=ow(v),g.c(),T(g,1),g.m(c.parentNode,c)):g&&(Oe(),R(g,1,1,()=>{g=null}),be())},i(v){u||(T(g),u=!0)},o(v){R(g),u=!1},d(v){v&&(P(e),P(a),P(c)),d&&d.d(),i[15](null),m&&m.d(),p&&p.d(),g&&g.d(v),h=!1,ht(f)}}}function RB(i,e,t){let n,r,s;const o=Ue("channel");let{field:l}=e,{id:a}=e,{record:c}=e,{graph:u}=e,h,{validationErrors:f}=e,d="";function m(M,L){M.preventDefault(),t(13,u.edges=u.edges.filter(N=>!(N.target===L&&N.field===l.name)),u)}function p(M,L){M.preventDefault(),axios.post(o.lucentUrl+"/records",{isCreateMode:!0,record:{schema:l.collections[0],status:"published",data:{[l.searchField]:L}}}).then(N=>{t(5,s=[]),g(M,N.data.records[0]),console.log(N)}).catch(N=>{t(5,s=[]),console.log(N)})}function g(M,L){M.preventDefault(),t(13,u=ky(u,c,[L],l.name,M.detail.action)),t(4,d=""),h.focus(),h.blur()}const v=debounce(M=>{axios.get(o.lucentUrl+"/records/suggestions",{params:{schema:l.collections[0],field:l.searchField,value:d,ui:"text"}}).then(L=>{t(5,s=L.data)}).catch(L=>{t(5,s=[]),console.log(L)})},500);function w(M){Ce[M?"unshift":"push"](()=>{h=M,t(3,h)})}function S(){d=this.value,t(4,d)}const _=(M,L)=>g(L,M),k=(M,L)=>g(L,M),A=M=>p(M,d),C=M=>p(M,d),Q=(M,L)=>m(L,M.id);return i.$$set=M=>{"field"in M&&t(0,l=M.field),"id"in M&&t(1,a=M.id),"record"in M&&t(2,c=M.record),"graph"in M&&t(13,u=M.graph),"validationErrors"in M&&t(14,f=M.validationErrors)},i.$$.update=()=>{i.$$.dirty&16385&&t(7,n=In(f,l.name)),i.$$.dirty&8197&&t(6,r=u.edges.filter(M=>M.field===l.name).map(M=>u.records.find(L=>L.id==M.target&&c.id==M.source)).filter(M=>!!(M!=null&&M.id))??[])},t(5,s=[]),[l,a,c,h,d,s,r,n,o,m,p,g,v,u,f,w,S,_,k,A,C,Q]}class DB extends oe{constructor(e){super(),se(this,e,RB,EB,re,{field:0,id:1,record:2,graph:13,validationErrors:14})}}function $B(i){let e,t,n,r;function s(a){i[18](a)}var o=i[7];function l(a,c){let u={schema:a[3],field:a[2],validationErrors:a[5],isCreateMode:a[6],id:a[8]};return a[0][a[2].name]!==void 0&&(u.value=a[0][a[2].name]),{props:u}}return o&&(e=Xr(o,l(i)),Ce.push(()=>nt(e,"value",s))),{c(){e&&V(e.$$.fragment),n=Ie()},m(a,c){e&&Y(e,a,c),x(a,n,c),r=!0},p(a,c){if(o!==(o=a[7])){if(e){Oe();const u=e;R(u.$$.fragment,1,0,()=>{z(u,1)}),be()}o?(e=Xr(o,l(a)),Ce.push(()=>nt(e,"value",s)),V(e.$$.fragment),T(e.$$.fragment,1),Y(e,n.parentNode,n)):e=null}else if(o){const u={};c&8&&(u.schema=a[3]),c&4&&(u.field=a[2]),c&32&&(u.validationErrors=a[5]),c&64&&(u.isCreateMode=a[6]),!t&&c&5&&(t=!0,u.value=a[0][a[2].name],st(()=>t=!1)),e.$set(u)}},i(a){r||(e&&T(e.$$.fragment,a),r=!0)},o(a){e&&R(e.$$.fragment,a),r=!1},d(a){a&&P(n),e&&z(e,a)}}}function LB(i){let e,t,n,r;function s(a){i[16](a)}function o(a){i[17](a)}let l={schema:i[3],field:i[2],validationErrors:i[5],isCreateMode:i[6],record:i[4]};return i[0][i[2].name]!==void 0&&(l.value=i[0][i[2].name]),i[1]!==void 0&&(l.graph=i[1]),e=new lP({props:l}),Ce.push(()=>nt(e,"value",s)),Ce.push(()=>nt(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&8&&(u.schema=a[3]),c&4&&(u.field=a[2]),c&32&&(u.validationErrors=a[5]),c&64&&(u.isCreateMode=a[6]),c&16&&(u.record=a[4]),!t&&c&5&&(t=!0,u.value=a[0][a[2].name],st(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],st(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function IB(i){let e,t,n;function r(o){i[15](o)}let s={field:i[2],validationErrors:i[5],record:i[4]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new Fk({props:s}),Ce.push(()=>nt(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),l&16&&(a.record=o[4]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],st(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function NB(i){let e,t,n;function r(o){i[14](o)}let s={field:i[2],validationErrors:i[5],isCreateMode:i[6],id:i[8]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new qy({props:s}),Ce.push(()=>nt(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),l&64&&(a.isCreateMode=o[6]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],st(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function ZB(i){let e,t,n;function r(o){i[13](o)}let s={field:i[2],id:i[8],validationErrors:i[5],isCreateMode:i[6]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new yy({props:s}),Ce.push(()=>nt(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),l&64&&(a.isCreateMode=o[6]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],st(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function BB(i){let e,t,n;function r(o){i[12](o)}let s={field:i[2],id:i[8],validationErrors:i[5],isCreateMode:i[6]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new wy({props:s}),Ce.push(()=>nt(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),l&64&&(a.isCreateMode=o[6]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],st(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function WB(i){let e,t,n;function r(o){i[11](o)}let s={record:i[4],id:i[8],field:i[2],validationErrors:i[5]};return i[0][i[2].name]!==void 0&&(s.value=i[0][i[2].name]),e=new eR({props:s}),Ce.push(()=>nt(e,"value",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&16&&(a.record=o[4]),l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),!t&&l&5&&(t=!0,a.value=o[0][o[2].name],st(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function XB(i){let e,t,n;function r(o){i[10](o)}let s={id:i[8],record:i[4],field:i[2],validationErrors:i[5]};return i[1]!==void 0&&(s.graph=i[1]),e=new hE({props:s}),Ce.push(()=>nt(e,"graph",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&16&&(a.record=o[4]),l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),!t&&l&2&&(t=!0,a.graph=o[1],st(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function FB(i){let e,t,n;function r(o){i[9](o)}let s={id:i[8],record:i[4],field:i[2],validationErrors:i[5]};return i[1]!==void 0&&(s.graph=i[1]),e=new DB({props:s}),Ce.push(()=>nt(e,"graph",r)),{c(){V(e.$$.fragment)},m(o,l){Y(e,o,l),n=!0},p(o,l){const a={};l&16&&(a.record=o[4]),l&4&&(a.field=o[2]),l&32&&(a.validationErrors=o[5]),!t&&l&2&&(t=!0,a.graph=o[1],st(()=>t=!1)),e.$set(a)},i(o){n||(T(e.$$.fragment,o),n=!0)},o(o){R(e.$$.fragment,o),n=!1},d(o){z(e,o)}}}function YB(i){let e,t,n,r,s,o;t=new MB({props:{field:i[2],id:i[8]}});const l=[FB,XB,WB,BB,ZB,NB,IB,LB,$B],a=[];function c(u,h){return u[2].info.name==="reference"&&u[2].layout==="tags"?0:u[2].info.name==="reference"?1:u[2].info.name==="file"?2:u[2].info.name==="text"?3:u[2].info.name==="slug"?4:u[2].info.name==="textarea"?5:u[2].info.name==="rich"?6:u[2].info.name==="markdown"?7:8}return r=c(i),s=a[r]=l[r](i),{c(){e=y("div"),V(t.$$.fragment),n=D(),s.c(),O(e,"class","editor-field")},m(u,h){x(u,e,h),Y(t,e,null),b(e,n),a[r].m(e,null),o=!0},p(u,[h]){const f={};h&4&&(f.field=u[2]),t.$set(f);let d=r;r=c(u),r===d?a[r].p(u,h):(Oe(),R(a[d],1,1,()=>{a[d]=null}),be(),s=a[r],s?s.p(u,h):(s=a[r]=l[r](u),s.c()),T(s,1),s.m(e,null))},i(u){o||(T(t.$$.fragment,u),T(s),o=!0)},o(u){R(t.$$.fragment,u),R(s),o=!1},d(u){u&&P(e),z(t),a[r].d()}}}function zB(i,e,t){const n={text:wy,slug:yy,textarea:qy,rich:Fk,color:mE,checkbox:OE,number:wE,url:SE,date:EE,datetime:sR,uuid:LE,json:RN,markdown:lP};let{field:r}=e,{data:s}=e,{schema:o}=e,{record:l}=e,{graph:a}=e,{validationErrors:c}=e,{isCreateMode:u}=e,h=n[r.info.name];const f=`field-${r.name}-${l.id}`;function d(C){a=C,t(1,a)}function m(C){a=C,t(1,a)}function p(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function g(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function v(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function w(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function S(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function _(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}function k(C){a=C,t(1,a)}function A(C){i.$$.not_equal(s[r.name],C)&&(s[r.name]=C,t(0,s))}return i.$$set=C=>{"field"in C&&t(2,r=C.field),"data"in C&&t(0,s=C.data),"schema"in C&&t(3,o=C.schema),"record"in C&&t(4,l=C.record),"graph"in C&&t(1,a=C.graph),"validationErrors"in C&&t(5,c=C.validationErrors),"isCreateMode"in C&&t(6,u=C.isCreateMode)},[s,a,r,o,l,c,u,h,f,d,m,p,g,v,w,S,_,k,A]}class aP extends oe{constructor(e){super(),se(this,e,zB,YB,re,{field:2,data:0,schema:3,record:4,graph:1,validationErrors:5,isCreateMode:6})}}function aw(i,e,t){const n=i.slice();return n[3]=e[t],n}function cw(i){let e;return{c(){e=W("Nothing links to this record")},m(t,n){x(t,e,n)},d(t){t&&P(e)}}}function uw(i){let e,t,n,r,s,o,l,a,c;return l=new Fy({props:{record:i[3].record,hasDelete:!1,graph:i[0]}}),{c(){e=y("div"),t=y("span"),n=W("In "),r=y("i"),r.textContent=`${i[3].field}`,s=W(" of"),o=D(),V(l.$$.fragment),a=D(),le(t,"font-size","14px"),le(t,"margin-bottom","5px"),le(t,"display","block"),le(e,"margin","0 0 15px"),le(e,"position","relative")},m(u,h){x(u,e,h),b(e,t),b(t,n),b(t,r),b(t,s),b(e,o),Y(l,e,null),b(e,a),c=!0},p(u,h){const f={};h&1&&(f.graph=u[0]),l.$set(f)},i(u){c||(T(l.$$.fragment,u),c=!0)},o(u){R(l.$$.fragment,u),c=!1},d(u){u&&P(e),z(l)}}}function VB(i){let e,t,n=fe(i[1]),r=[];for(let l=0;lR(r[l],1,1,()=>{r[l]=null});let o=null;return n.length||(o=cw()),{c(){e=y("div");for(let l=0;lt.name===e)}function jB(i,e,t){const n=Ue("channel");let{graph:r}=e,s=r.parentEdges.map(o=>{let l=n.schemas.find(c=>c.name===o.sourceSchema),a=UB(l,o.field);return a?{field:a.label,record:r.records.find(c=>c.id===o.source)}:null}).filter(o=>!!o);return i.$$set=o=>{"graph"in o&&t(0,r=o.graph)},[r,s]}class qB extends oe{constructor(e){super(),se(this,e,jB,VB,re,{graph:0})}}function hw(i,e,t){const n=i.slice();return n[7]=e[t],n}function fw(i,e,t){const n=i.slice();return n[4]=e[t],n}function GB(i){let e,t=(JSON.stringify(i[1])??"")+"",n,r;return{c(){e=y("div"),n=W(t),O(e,"class",r=i[3]+" field-content svelte-s7tjhg")},m(s,o){x(s,e,o),b(e,n)},p(s,o){o&2&&t!==(t=(JSON.stringify(s[1])??"")+"")&&K(n,t),o&8&&r!==(r=s[3]+" field-content svelte-s7tjhg")&&O(e,"class",r)},i:U,o:U,d(s){s&&P(e)}}}function HB(i){let e,t=(i[1]??"")+"",n;return{c(){e=y("div"),O(e,"class",n=i[3]+" field-content svelte-s7tjhg")},m(r,s){x(r,e,s),e.innerHTML=t},p(r,s){s&2&&t!==(t=(r[1]??"")+"")&&(e.innerHTML=t),s&8&&n!==(n=r[3]+" field-content svelte-s7tjhg")&&O(e,"class",n)},i:U,o:U,d(r){r&&P(e)}}}function KB(i){let e,t=(JSON.stringify(i[1],null,2)??"")+"",n,r;return{c(){e=y("div"),n=W(t),O(e,"class",r=i[3]+" field-content svelte-s7tjhg"),le(e,"white-space","break-spaces")},m(s,o){x(s,e,o),b(e,n)},p(s,o){o&2&&t!==(t=(JSON.stringify(s[1],null,2)??"")+"")&&K(n,t),o&8&&r!==(r=s[3]+" field-content svelte-s7tjhg")&&O(e,"class",r)},i:U,o:U,d(s){s&&P(e)}}}function JB(i){let e,t,n,r,s=fe(i[1]),o=[];for(let a=0;aR(o[a],1,1,()=>{o[a]=null});return{c(){e=y("div"),t=y("div");for(let a=0;aR(o[a],1,1,()=>{o[a]=null});return{c(){e=y("div"),t=y("div");for(let a=0;a{c[d]=null}),be(),s=c[r],s?s.p(h,f):(s=c[r]=a[r](h),s.c()),T(s,1),s.m(o.parentNode,o))},i(h){l||(T(s),l=!0)},o(h){R(s),l=!1},d(h){h&&P(o),c[r].d(h)}}}function nW(i,e,t){let{field:n}=e,{side:r}=e,{edges:s}=e,{colorClass:o}=e;return i.$$set=l=>{"field"in l&&t(0,n=l.field),"side"in l&&t(1,r=l.side),"edges"in l&&t(2,s=l.edges),"colorClass"in l&&t(3,o=l.colorClass)},[n,r,s,o]}class pw extends oe{constructor(e){super(),se(this,e,nW,tW,re,{field:0,side:1,edges:2,colorClass:3})}}function iW(i){let e,t,n,r=i[0].rank+"",s,o,l,a,c,u=i[0].target+"",h,f;return{c(){e=y("div"),t=y("span"),n=W("Rank: "),s=W(r),o=D(),l=y("span"),l.textContent="id:",a=D(),c=y("a"),h=W(u),O(t,"class","me-3"),O(c,"href",f=i[1].lucentUrl+"/records/"+i[0].target),O(c,"target","_blank")},m(d,m){x(d,e,m),b(e,t),b(t,n),b(t,s),b(e,o),b(e,l),b(e,a),b(e,c),b(c,h)},p(d,[m]){m&1&&r!==(r=d[0].rank+"")&&K(s,r),m&1&&u!==(u=d[0].target+"")&&K(h,u),m&1&&f!==(f=d[1].lucentUrl+"/records/"+d[0].target)&&O(c,"href",f)},i:U,o:U,d(d){d&&P(e)}}}function rW(i,e,t){const n=Ue("channel");let{edge:r}=e;return i.$$set=s=>{"edge"in s&&t(0,r=s.edge)},[r,n]}class cP extends oe{constructor(e){super(),se(this,e,rW,iW,re,{edge:0})}}function gw(i,e,t){const n=i.slice();return n[16]=e[t][0],n[17]=e[t][1],n}function Ow(i,e,t){const n=i.slice();return n[20]=e[t],n}function bw(i,e,t){const n=i.slice();return n[20]=e[t],n}function vw(i,e,t){const n=i.slice();return n[16]=e[t],n}function ww(i,e,t){const n=i.slice();return n[27]=e[t],n}function sW(i){let e;return{c(){e=y("div"),e.innerHTML="Revisions are not enabled for this Schema",O(e,"class","card-body")},m(t,n){x(t,e,n)},p:U,i:U,o:U,d(t){t&&P(e)}}}function oW(i){let e,t,n,r,s=fe(i[8]),o=[];for(let a=0;aR(o[a],1,1,()=>{o[a]=null});return{c(){e=y("div"),e.textContent="Revisions",t=D();for(let a=0;a{n=null}),be())},i(r){t||(T(n),t=!0)},o(r){R(n),t=!1},d(r){r&&P(e),n&&n.d(r)}}}function Sw(i){let e,t,n,r,s,o,l,a;const c=[aW,lW],u=[];function h(p,g){return p[6].length>0?0:1}t=h(i),n=u[t]=c[t](i);let f=fe(Object.entries(i[7])),d=[];for(let p=0;pR(d[p],1,1,()=>{d[p]=null});return{c(){e=y("div"),n.c(),r=D(),s=y("div"),o=y("p"),o.textContent="Record References",l=D();for(let p=0;p{u[v]=null}),be(),n=u[t],n?n.p(p,g):(n=u[t]=c[t](p),n.c()),T(n,1),n.m(e,r)),g&128){f=fe(Object.entries(p[7]));let w;for(w=0;wNothing will change",O(e,"class","lx-card text-center")},m(t,n){x(t,e,n)},p:U,i:U,o:U,d(t){t&&P(e)}}}function aW(i){let e,t,n,r,s=i[5].version+"",o,l,a,c,u,h,f,d=i[4]&&_w(i),m=fe(i[6]),p=[];for(let v=0;vR(p[v],1,1,()=>{p[v]=null});return{c(){e=y("p"),e.textContent="If you choose to rollback to this revision",t=D(),n=y("button"),r=W("Rollback to version "),o=W(s),l=D(),d&&d.c(),a=D(),c=y("div");for(let v=0;vR(v[Q],1,1,()=>{v[Q]=null});let S=null;g.length||(S=Pw());let _=fe(i[17].revision),k=[];for(let Q=0;Q<_.length;Q+=1)k[Q]=Tw(Ow(i,_,Q));const A=Q=>R(k[Q],1,1,()=>{k[Q]=null});let C=null;return _.length||(C=xw()),{c(){e=y("div"),t=y("div"),r=W(n),s=W(":"),o=D(),l=y("div"),a=y("p"),a.textContent="Record",c=D();for(let Q=0;Q0?0:1}Pe=Ut(i),Ye=He[Pe]=Qt[Pe](i);let ct=i[5]&&Sw(i);return{c(){e=y("div"),t=y("div"),n=y("div"),r=y("div"),s=y("span"),s.textContent="record id",o=D(),l=y("small"),c=W(a),u=D(),h=y("div"),f=y("span"),f.textContent="current version",d=D(),p=W(m),g=D(),v=y("div"),w=y("span"),w.textContent="created",S=D(),V(_.$$.fragment),k=D(),C=W(A),Q=D(),M=y("div"),L=y("span"),L.textContent="updated",N=D(),V(B.$$.fragment),J=D(),ie=W(te),ae=D(),X=y("div"),ee=y("span"),ee.textContent="Rules for this schema",Te=D(),ve=y("small"),je=W("Each record maintains the last "),Ee=W(ne),Re=W(` + versions`),xt=D(),H=y("div"),Ye.c(),Tt=D(),yt=y("div"),ct&&ct.c(),O(s,"class","label text-end text-muted"),O(f,"class","label text-end text-muted"),O(w,"class","label text-end text-muted"),O(L,"class","label text-end text-muted"),O(n,"class","col-8"),O(ee,"class","label d-block text-muted"),O(X,"class","col-4"),O(t,"class","row"),O(e,"class","lx-card"),O(H,"class","revisions")},m(qe,Mt){x(qe,e,Mt),b(e,t),b(t,n),b(n,r),b(r,s),b(r,o),b(r,l),b(l,c),b(n,u),b(n,h),b(h,f),b(h,d),b(h,p),b(n,g),b(n,v),b(v,w),b(v,S),Y(_,v,null),b(v,k),b(v,C),b(n,Q),b(n,M),b(M,L),b(M,N),Y(B,M,null),b(M,J),b(M,ie),b(t,ae),b(t,X),b(X,ee),b(X,Te),b(X,ve),b(ve,je),b(ve,Ee),b(ve,Re),x(qe,xt,Mt),x(qe,H,Mt),He[Pe].m(H,null),x(qe,Tt,Mt),x(qe,yt,Mt),ct&&ct.m(yt,null),i[13](yt),wt=!0},p(qe,[Mt]){(!wt||Mt&1)&&a!==(a=qe[0].id+"")&&K(c,a),(!wt||Mt&1)&&m!==(m=qe[0].version+"")&&K(p,m);const ei={};Mt&3&&(ei.name=Dn(qe[1],qe[0].createdBy)),_.$set(ei),(!wt||Mt&1)&&A!==(A=Bi(qe[0].createdAt)+"")&&K(C,A);const ti={};Mt&3&&(ti.name=Dn(qe[1],qe[0].updatedBy)),B.$set(ti),(!wt||Mt&1)&&te!==(te=Bi(qe[0].updatedAt)+"")&&K(ie,te),(!wt||Mt&4)&&ne!==(ne=qe[2].revisions+"")&&K(Ee,ne);let Ri=Pe;Pe=Ut(qe),Pe===Ri?He[Pe].p(qe,Mt):(Oe(),R(He[Ri],1,1,()=>{He[Ri]=null}),be(),Ye=He[Pe],Ye?Ye.p(qe,Mt):(Ye=He[Pe]=Qt[Pe](qe),Ye.c()),T(Ye,1),Ye.m(H,null)),qe[5]?ct?(ct.p(qe,Mt),Mt&32&&T(ct,1)):(ct=Sw(qe),ct.c(),T(ct,1),ct.m(yt,null)):ct&&(Oe(),R(ct,1,1,()=>{ct=null}),be())},i(qe){wt||(T(_.$$.fragment,qe),T(B.$$.fragment,qe),T(Ye),T(ct),wt=!0)},o(qe){R(_.$$.fragment,qe),R(B.$$.fragment,qe),R(Ye),R(ct),wt=!1},d(qe){qe&&(P(e),P(xt),P(H),P(Tt),P(yt)),z(_),z(B),He[Pe].d(),ct&&ct.d(),i[13](null)}}}function uW(i,e,t){let n,r,s,o;const l=Ue("channel");let{record:a}=e,{graph:c}=e,{users:u}=e,{schema:h}=e,f,d="";axios.get(`${l.lucentUrl}/records/${a.id}/revisions`).then(S=>{t(8,n=S.data)}).catch(S=>{console.log(S)});function m(S,_){t(7,o=c.edges.filter(k=>k.depth===1).reduce((k,A)=>(k[A.field]||(k[A.field]={record:[],revision:[]}),k[A.field].record.push(A),k),{})),t(7,o=_._edges.reduce((k,A)=>(k[A.field]||(k[A.field]={record:[],revision:[]}),k[A.field].revision.push(A),k),o))}function p(S,_){S.preventDefault(),t(5,s=_),t(6,r=h.fields.filter(k=>!ia(s.data[k.name],a.data[k.name]))),m(r,_),f.scrollIntoView()}function g(S){S.preventDefault(),t(4,d=""),axios.post(`${l.lucentUrl}/records/${a.id}/rollback/${s.version}`).then(_=>{window.location.reload()}).catch(_=>{const k=_.response.data.error;t(4,d=k.fieldLabel+": "+k.message)})}const v=(S,_)=>p(_,S);function w(S){Ce[S?"unshift":"push"](()=>{f=S,t(3,f)})}return i.$$set=S=>{"record"in S&&t(0,a=S.record),"graph"in S&&t(11,c=S.graph),"users"in S&&t(1,u=S.users),"schema"in S&&t(2,h=S.schema)},t(8,n=[]),t(6,r=[]),t(5,s=null),t(7,o={}),[a,u,h,f,d,s,r,o,n,p,g,c,v,w]}class hW extends oe{constructor(e){super(),se(this,e,uW,cW,re,{record:0,graph:11,users:1,schema:2})}}const{window:fW}=OP;function Mw(i,e,t){const n=i.slice();return n[21]=e[t],n}function dW(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=` + Save`,O(e,"type","button"),O(e,"class","button primary ms-2 btn btn-primary btn-spinner")},m(r,s){x(r,e,s),t||(n=G(e,"click",i[11]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function mW(i){let e,t,n;return{c(){e=y("button"),e.innerHTML=` + Create`,O(e,"class","button primary btn-spinner")},m(r,s){x(r,e,s),t||(n=G(e,"click",i[11]),t=!0)},p:U,d(r){r&&P(e),t=!1,n()}}}function pW(i){let e,t;return e=new hW({props:{record:i[0],graph:i[1],users:i[4],schema:i[2]}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&1&&(s.record=n[0]),r&2&&(s.graph=n[1]),r&16&&(s.users=n[4]),r&4&&(s.schema=n[2]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function gW(i){let e,t;return e=new qB({props:{graph:i[1],record:i[0]}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&2&&(s.graph=n[1]),r&1&&(s.record=n[0]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function OW(i){let e=[],t=new Map,n,r,s=fe(i[9]);const o=l=>l[21].name;for(let l=0;lnt(e,"data",s)),Ce.push(()=>nt(e,"graph",o)),{c(){V(e.$$.fragment)},m(a,c){Y(e,a,c),r=!0},p(a,c){const u={};c&4&&(u.schema=a[2]),c&1&&(u.record=a[0]),c&32&&(u.validationErrors=a[5]),c&8&&(u.isCreateMode=a[3]),!t&&c&1&&(t=!0,u.data=a[0].data,st(()=>t=!1)),!n&&c&2&&(n=!0,u.graph=a[1],st(()=>n=!1)),e.$set(u)},i(a){r||(T(e.$$.fragment,a),r=!0)},o(a){R(e.$$.fragment,a),r=!1},d(a){z(e,a)}}}function Rw(i,e){let t,n,r,s=e[6]===e[21].group&&Ew(e);return{key:i,first:null,c(){t=Ie(),s&&s.c(),n=Ie(),this.first=t},m(o,l){x(o,t,l),s&&s.m(o,l),x(o,n,l),r=!0},p(o,l){e=o,e[6]===e[21].group?s?(s.p(e,l),l&64&&T(s,1)):(s=Ew(e),s.c(),T(s,1),s.m(n.parentNode,n)):s&&(Oe(),R(s,1,1,()=>{s=null}),be())},i(o){r||(T(s),r=!0)},o(o){R(s),r=!1},d(o){o&&(P(t),P(n)),s&&s.d(o)}}}function bW(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S,_,k;function A(X){i[12](X)}function C(X){i[13](X)}let Q={schema:i[2],isCreateMode:i[3]};i[0]!==void 0&&(Q.record=i[0]),i[6]!==void 0&&(Q.activeContentTab=i[6]),n=new cy({props:Q}),Ce.push(()=>nt(n,"record",A)),Ce.push(()=>nt(n,"activeContentTab",C));function M(X,ee){if(X[3])return mW;if(X[8])return dW}let L=M(i),N=L&&L(i);a=new _y({props:{schema:i[2],record:i[0],isCreateMode:i[3]}}),u=new Ma({props:{message:i[7]}});function B(X){i[14](X)}let J={schema:i[2],isCreateMode:i[3]};i[6]!==void 0&&(J.active=i[6]),d=new uy({props:J}),Ce.push(()=>nt(d,"active",B));const te=[OW,gW,pW],ie=[];function ae(X,ee){return ee&64&&(g=null),g==null&&(g=!["_graph","_info"].includes(X[6])),g?0:X[6]==="_graph"?1:X[6]==="_info"?2:-1}return~(v=ae(i,-1))&&(w=ie[v]=te[v](i)),{c(){e=y("div"),t=y("div"),V(n.$$.fragment),o=D(),N&&N.c(),l=D(),V(a.$$.fragment),c=D(),V(u.$$.fragment),h=D(),f=y("div"),V(d.$$.fragment),p=D(),w&&w.c(),O(t,"class","tools-header"),O(f,"class","mt-4"),le(f,"margin-bottom","150px"),le(f,"position","relative"),O(e,"class","record-edit")},m(X,ee){x(X,e,ee),b(e,t),Y(n,t,null),b(t,o),N&&N.m(t,null),b(e,l),Y(a,e,null),b(e,c),Y(u,e,null),b(e,h),b(e,f),Y(d,f,null),b(f,p),~v&&ie[v].m(f,null),S=!0,_||(k=G(fW,"beforeunload",i[10]),_=!0)},p(X,[ee]){const Te={};ee&4&&(Te.schema=X[2]),ee&8&&(Te.isCreateMode=X[3]),!r&&ee&1&&(r=!0,Te.record=X[0],st(()=>r=!1)),!s&&ee&64&&(s=!0,Te.activeContentTab=X[6],st(()=>s=!1)),n.$set(Te),L===(L=M(X))&&N?N.p(X,ee):(N&&N.d(1),N=L&&L(X),N&&(N.c(),N.m(t,null)));const ve={};ee&4&&(ve.schema=X[2]),ee&1&&(ve.record=X[0]),ee&8&&(ve.isCreateMode=X[3]),a.$set(ve);const je={};ee&128&&(je.message=X[7]),u.$set(je);const ne={};ee&4&&(ne.schema=X[2]),ee&8&&(ne.isCreateMode=X[3]),!m&&ee&64&&(m=!0,ne.active=X[6],st(()=>m=!1)),d.$set(ne);let Ee=v;v=ae(X,ee),v===Ee?~v&&ie[v].p(X,ee):(w&&(Oe(),R(ie[Ee],1,1,()=>{ie[Ee]=null}),be()),~v?(w=ie[v],w?w.p(X,ee):(w=ie[v]=te[v](X),w.c()),T(w,1),w.m(f,null)):w=null)},i(X){S||(T(n.$$.fragment,X),T(a.$$.fragment,X),T(u.$$.fragment,X),T(d.$$.fragment,X),T(w),S=!0)},o(X){R(n.$$.fragment,X),R(a.$$.fragment,X),R(u.$$.fragment,X),R(d.$$.fragment,X),R(w),S=!1},d(X){X&&P(e),z(n),N&&N.d(),z(a),z(u),z(d),~v&&ie[v].d(),_=!1,k()}}}function vW(i,e,t){let n,r,s;const o=Ue("channel");let{schema:l}=e,{record:a}=e,{graph:c={records:[],edges:[]}}=e,{isCreateMode:u}=e,{users:h}=e,f,d="",m=l.fields.filter(Q=>Q.name!=="id");xi(()=>{p()});function p(){f={data:JSON.parse(JSON.stringify(a.data)),status:a.status,edges:JSON.parse(JSON.stringify(c.edges))}}Kw(()=>{t(8,n=v())});function g(Q){return n?Q.returnValue="You have unsaved changes. Are you sure you want to exit?":(delete Q.returnValue,"...")}function v(){return u?!1:!ia(f,{data:a.data,status:a.status,edges:c.edges})}function w(Q){return Q.preventDefault(),console.log("SAVE: Attempt"),t(5,r=null),t(7,s=""),new Promise(function(M,L){var N;if(!n&&!u){M(null);return}if(!a){M(null);return}t(1,c.edges=(N=c.edges)==null?void 0:N.filter(B=>!B._isTrashed&&B.source===a.id),c),Jn(o.lucentUrl+"/records",{record:a,edges:c.edges,isCreateMode:u}).then(function(B){if(console.log("SAVE: SAVED"),u)window.location=o.lucentUrl+"/records/"+a.id;else{if(t(0,a=B.records[0]??null),!a){t(8,n=!1),window.location=o.lucentUrl;return}t(1,c=B),p()}M(null)}).catch(function(B){B.response&&(typeof B.response.data.error=="string"?t(7,s=B.response.data.error):(t(5,r=B.response.data.error),console.log(r))),M(null)})})}function S(Q){a=Q,t(0,a)}function _(Q){d=Q,t(6,d)}function k(Q){d=Q,t(6,d)}function A(Q){i.$$.not_equal(a.data,Q)&&(a.data=Q,t(0,a))}function C(Q){c=Q,t(1,c)}return i.$$set=Q=>{"schema"in Q&&t(2,l=Q.schema),"record"in Q&&t(0,a=Q.record),"graph"in Q&&t(1,c=Q.graph),"isCreateMode"in Q&&t(3,u=Q.isCreateMode),"users"in Q&&t(4,h=Q.users)},i.$$.update=()=>{i.$$.dirty&32&&t(7,s=r?`Record submission failed. ${Object.entries(r).length} error(s)`:null)},t(8,n=!1),t(5,r=null),[a,c,l,u,h,r,d,s,n,m,g,w,S,_,k,A,C]}class wW extends oe{constructor(e){super(),se(this,e,vW,bW,re,{schema:2,record:0,graph:1,isCreateMode:3,users:4})}}function Dw(i,e,t){const n=i.slice();return n[3]=e[t],n}function $w(i){let e,t=i[3].label+"",n;return{c(){var r;e=y("a"),n=W(t),O(e,"class","sidebar-item"),O(e,"aria-current","page"),O(e,"href",i[1].lucentUrl+"/content/"+i[3].name),Ae(e,"active",i[3].name===((r=i[0])==null?void 0:r.name))},m(r,s){x(r,e,s),b(e,n)},p(r,s){var o;s&5&&Ae(e,"active",r[3].name===((o=r[0])==null?void 0:o.name))},d(r){r&&P(e)}}}function yW(i){let e,t,n=i[1].name+"",r,s,o,l=fe(i[2]),a=[];for(let c=0;c{"schema"in o&&t(0,n=o.schema)},[n,r,s]}class SW extends oe{constructor(e){super(),se(this,e,kW,yW,re,{schema:0})}}function Lw(i){let e;return{c(){e=y("span"),e.textContent="DRAFT",O(e,"class","status")},m(t,n){x(t,e,n)},d(t){t&&P(e)}}}function _W(i){let e,t=i[1].data.name+"",n,r;return{c(){e=y("a"),n=W(t),O(e,"href",r=i[2].lucentUrl+"/records/"+i[1].id)},m(s,o){x(s,e,o),b(e,n)},p(s,o){o&2&&t!==(t=s[1].data.name+"")&&K(n,t),o&2&&r!==(r=s[2].lucentUrl+"/records/"+s[1].id)&&O(e,"href",r)},i:U,o:U,d(s){s&&P(e)}}}function CW(i){let e,t;return e=new Xo({props:{record:i[1],size:"tiny",showFilename:!0}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&2&&(s.record=n[1]),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function PW(i){let e,t,n,r,s,o,l,a,c=i[3].label+"",u,h,f,d,m,p,g,v,w=i[1].status==="draft"&&Lw();const S=[CW,_W],_=[];function k(A,C){return A[3].type==="files"?0:1}return r=k(i),s=_[r]=S[r](i),m=new _i({props:{name:Dn(i[0],i[1].updatedBy),side:24}}),{c(){e=y("td"),t=y("div"),w&&w.c(),n=D(),s.c(),o=D(),l=y("td"),a=y("a"),u=W(c),h=D(),f=y("td"),d=y("div"),V(m.$$.fragment),p=D(),g=y("div"),g.textContent=`${i[4]}`,O(t,"class","row-name"),O(a,"href",i[2].lucentUrl+"/content/"+i[3].name),O(g,"class","ms-2"),le(d,"display","flex"),le(d,"gap","14px")},m(A,C){x(A,e,C),b(e,t),w&&w.m(t,null),b(t,n),_[r].m(t,null),x(A,o,C),x(A,l,C),b(l,a),b(a,u),x(A,h,C),x(A,f,C),b(f,d),Y(m,d,null),b(d,p),b(d,g),v=!0},p(A,[C]){A[1].status==="draft"?w||(w=Lw(),w.c(),w.m(t,n)):w&&(w.d(1),w=null),s.p(A,C);const Q={};C&3&&(Q.name=Dn(A[0],A[1].updatedBy)),m.$set(Q)},i(A){v||(T(s),T(m.$$.fragment,A),v=!0)},o(A){R(s),R(m.$$.fragment,A),v=!1},d(A){A&&(P(e),P(o),P(l),P(h),P(f)),w&&w.d(),_[r].d(),z(m)}}}function AW(i,e,t){const n=Ue("channel");let{users:r}=e,{record:s}=e,o=n.schemas.find(a=>a.name===s.schema),l=ly(ih(s.updatedAt),{addSuffix:!0});return i.$$set=a=>{"users"in a&&t(0,r=a.users),"record"in a&&t(1,s=a.record)},[r,s,n,o,l]}class xW extends oe{constructor(e){super(),se(this,e,AW,PW,re,{users:0,record:1})}}function Iw(i,e,t){const n=i.slice();return n[3]=e[t],n}function Nw(i){let e,t,n,r=[],s=new Map,o,l=fe(i[0]);const a=c=>c[3].id;for(let c=0;c0&&Nw(i);return{c(){e=y("h3"),e.textContent="Latest Content changes",t=D(),s&&s.c(),n=Ie(),O(e,"class","header-small mb-4 mt-5")},m(o,l){x(o,e,l),x(o,t,l),s&&s.m(o,l),x(o,n,l),r=!0},p(o,[l]){o[0].length>0?s?(s.p(o,l),l&1&&T(s,1)):(s=Nw(o),s.c(),T(s,1),s.m(n.parentNode,n)):s&&(Oe(),R(s,1,1,()=>{s=null}),be())},i(o){r||(T(s),r=!0)},o(o){R(s),r=!1},d(o){o&&(P(e),P(t),P(n)),s&&s.d(o)}}}function QW(i,e,t){const n=Ue("channel");let r=[],s=[];return xi(()=>{Qa(n.lucentUrl+"/home/records").then(o=>{t(0,r=o.records),t(1,s=o.users)}).catch(o=>{console.log(o)})}),[r,s]}class MW extends oe{constructor(e){super(),se(this,e,QW,TW,re,{})}}function Bw(i){let e;return{c(){e=y("span"),e.textContent="Action in progress",O(e,"class","badge text-bg-warning")},m(t,n){x(t,e,n)},d(t){t&&P(e)}}}function Ww(i){let e;return{c(){e=y("span"),e.textContent="Action completed",O(e,"class","badge text-bg-info")},m(t,n){x(t,e,n)},d(t){t&&P(e)}}}function EW(i){let e,t,n,r,s,o,l,a,c,u,h,f,d,m,p,g,v,w,S=i[2]&&Bw(),_=!i[2]&&i[3]&&Ww();return{c(){e=y("div"),t=y("div"),n=y("h3"),r=W(i[0]),s=D(),o=y("button"),l=W("Start"),a=D(),c=y("div"),S&&S.c(),u=D(),_&&_.c(),h=D(),f=y("pre"),d=W(i[3]),m=W(` `),p=y("div"),p.textContent=" ",g=W(` - `),O(n,"class","header-small mb-5"),O(o,"class","button primary mb-3"),o.disabled=i[2],O(c,"class","mb-3"),O(f,"class","logs svelte-16mig2w"),O(t,"class","lx-card mt-5"),O(e,"class","common-wrapper")},m(k,Q){A(k,e,Q),v(e,t),v(t,n),v(n,r),v(t,s),v(t,o),v(o,l),v(t,a),v(t,c),S&&S.m(c,null),v(c,u),_&&_.m(c,null),v(t,h),v(t,f),v(f,d),v(f,m),v(f,p),i[6](p),v(f,g),b||(w=G(o,"click",i[4]),b=!0)},p(k,[Q]){Q&1&&K(r,k[0]),Q&4&&(o.disabled=k[2]),k[2]?S||(S=Hw(),S.c(),S.m(c,u)):S&&(S.d(1),S=null),!k[2]&&k[3]?_||(_=Kw(),_.c(),_.m(c,null)):_&&(_.d(1),_=null),Q&8&&K(d,k[3])},i:U,o:U,d(k){k&&P(e),S&&S.d(),_&&_.d(),i[6](null),b=!1,w()}}}function XW(i,e,t){let n;const r=je("channel");let{title:s}=e,{command:o}=e,l,a=!1;function c(){const f=new EventSource(r.lucentUrl+"/command-report-source/"+o.signature);f.onmessage=function(d){t(2,a=!0);const m=JSON.parse(d.data);m.date,t(3,n=m.logs),l.scrollIntoView()},f.onerror=d=>{console.log(d),f.close(),t(2,a=!1)}}function u(f){f.preventDefault(),t(2,a=!0),Jn(r.lucentUrl+"/command/"+o.signature).then(d=>{c()})}Ti(()=>{c()});function h(f){Se[f?"unshift":"push"](()=>{l=f,t(1,l)})}return i.$$set=f=>{"title"in f&&t(0,s=f.title),"command"in f&&t(5,o=f.command)},t(3,n=""),[s,l,a,n,u,o,h]}class FW extends oe{constructor(e){super(),se(this,e,XW,WW,re,{title:0,command:5})}}function Jw(i,e,t){const n=i.slice();return n[2]=e[t],n}function YW(i){let e,t;return{c(){e=y("a"),t=W("Members"),O(e,"class","top-nav-item"),O(e,"href",i[0].lucentUrl+"/members")},m(n,r){A(n,e,r),v(e,t)},p:U,d(n){n&&P(e)}}}function zW(i){let e,t;return e=new Gi({props:{$$slots:{button:[UW],default:[VW]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&32&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function ey(i){let e,t=i[2].name+"",n;return{c(){e=y("a"),n=W(t),O(e,"href",i[0].lucentUrl+"/command-report/"+i[2].signature),O(e,"class","top-nav-item")},m(r,s){A(r,e,s),v(e,n)},p:U,d(r){r&&P(e)}}}function VW(i){let e,t=ue(i[0].commands),n=[];for(let r=0;r0&&zW(i);const c=[qW,jW],u=[];function h(f,d){return f[0].auth=="lucent"?0:1}return r=h(i),s=u[r]=c[r](i),{c(){e=y("div"),l&&l.c(),t=D(),a&&a.c(),n=D(),s.c(),O(e,"class","top-nav")},m(f,d){A(f,e,d),l&&l.m(e,null),v(e,t),a&&a.m(e,null),v(e,n),u[r].m(e,null),o=!0},p(f,[d]){f[0].auth=="lucent"&&l.p(f,d),f[0].commands.length>0&&a.p(f,d),s.p(f,d)},i(f){o||(T(a),T(s),o=!0)},o(f){R(a),R(s),o=!1},d(f){f&&P(e),l&&l.d(),a&&a.d(),u[r].d()}}}function HW(i){const e=je("channel"),t=je("user");return[e,t]}class KW extends oe{constructor(e){super(),se(this,e,HW,GW,re,{})}}function JW(i){let e,t,n,r,s,o,l,a,c;n=new EW({props:{schema:i[2].schema}}),o=new KW({});const u=[{title:i[0]},i[2]];var h=i[3][i[1]];function f(d,m){let p={};for(let g=0;g{z(g,1)}),pe()}h?(a=Fr(h,f(d,m)),V(a.$$.fragment),T(a.$$.fragment,1),Y(a,s,null)):a=null}else if(h){const g=m&5?So(u,[m&1&&{title:d[0]},m&4&&_o(d[2])]):{};a.$set(g)}},i(d){c||(T(n.$$.fragment,d),T(o.$$.fragment,d),a&&T(a.$$.fragment,d),c=!0)},o(d){R(n.$$.fragment,d),R(o.$$.fragment,d),a&&R(a.$$.fragment,d),c=!1},d(d){d&&P(e),z(n),z(o),a&&z(a)}}}function e9(i,e,t){const n={members:Xx,recordEdit:TW,recordNotFound:zx,contentIndex:Iy,homeIndex:BW,buildReport:FW};let{title:r}=e,{view:s}=e,{user:o}=e,{data:l}=e,{channel:a}=e,{readableSchemas:c}=e;return Tl("channel",a),Tl("readableSchemas",a.schemas.filter(u=>c.includes(u.name))),Tl("user",o),i.$$set=u=>{"title"in u&&t(0,r=u.title),"view"in u&&t(1,s=u.view),"user"in u&&t(4,o=u.user),"data"in u&&t(2,l=u.data),"channel"in u&&t(5,a=u.channel),"readableSchemas"in u&&t(6,c=u.readableSchemas)},[r,s,l,n,o,a,c]}class t9 extends oe{constructor(e){super(),se(this,e,e9,JW,re,{title:0,view:1,user:4,data:2,channel:5,readableSchemas:6})}}const n9={account:Qx,channel:t9};let $c=[],i9=function(){$c.map(t=>t.$destroy()),$c=[];const i=document.body.querySelectorAll(".lucent-component");if(i.length===0)return;const e=function(t){const n=t.attributes["data-layout"].value,[r,s]=Object.entries(n9).find(([c,u])=>n===c);if(!s)return[];const o=document.getElementById("json-"+n).innerHTML,l=JSON.parse(o),a={target:t,props:l};$c=[...$c,new s(a)]};Array.from(i).map(e)};document.addEventListener("DOMContentLoaded",i9); + `),O(n,"class","header-small mb-5"),O(o,"class","button primary mb-3"),o.disabled=i[2],O(c,"class","mb-3"),O(f,"class","logs svelte-16mig2w"),O(t,"class","lx-card mt-5"),O(e,"class","common-wrapper")},m(k,A){x(k,e,A),b(e,t),b(t,n),b(n,r),b(t,s),b(t,o),b(o,l),b(t,a),b(t,c),S&&S.m(c,null),b(c,u),_&&_.m(c,null),b(t,h),b(t,f),b(f,d),b(f,m),b(f,p),i[6](p),b(f,g),v||(w=G(o,"click",i[4]),v=!0)},p(k,[A]){A&1&&K(r,k[0]),A&4&&(o.disabled=k[2]),k[2]?S||(S=Bw(),S.c(),S.m(c,u)):S&&(S.d(1),S=null),!k[2]&&k[3]?_||(_=Ww(),_.c(),_.m(c,null)):_&&(_.d(1),_=null),A&8&&K(d,k[3])},i:U,o:U,d(k){k&&P(e),S&&S.d(),_&&_.d(),i[6](null),v=!1,w()}}}function RW(i,e,t){let n;const r=Ue("channel");let{title:s}=e,{command:o}=e,l,a=!1;function c(){const f=new EventSource(r.lucentUrl+"/command-report-source/"+o.signature);f.onmessage=function(d){t(2,a=!0);const m=JSON.parse(d.data);m.date,t(3,n=m.logs),l.scrollIntoView()},f.onerror=d=>{console.log(d),f.close(),t(2,a=!1)}}function u(f){f.preventDefault(),t(2,a=!0),Jn(r.lucentUrl+"/command/"+o.signature).then(d=>{c()})}xi(()=>{c()});function h(f){Ce[f?"unshift":"push"](()=>{l=f,t(1,l)})}return i.$$set=f=>{"title"in f&&t(0,s=f.title),"command"in f&&t(5,o=f.command)},t(3,n=""),[s,l,a,n,u,o,h]}class DW extends oe{constructor(e){super(),se(this,e,RW,EW,re,{title:0,command:5})}}function Xw(i,e,t){const n=i.slice();return n[2]=e[t],n}function $W(i){let e;return{c(){e=y("a"),e.textContent="Store admin",O(e,"href","/lunar")},m(t,n){x(t,e,n)},p:U,d(t){t&&P(e)}}}function LW(i){let e,t;return{c(){e=y("a"),t=W("Members"),O(e,"class","top-nav-item"),O(e,"href",i[0].lucentUrl+"/members")},m(n,r){x(n,e,r),b(e,t)},p:U,d(n){n&&P(e)}}}function IW(i){let e,t;return e=new ur({props:{$$slots:{button:[ZW],default:[NW]},$$scope:{ctx:i}}}),{c(){V(e.$$.fragment)},m(n,r){Y(e,n,r),t=!0},p(n,r){const s={};r&32&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(T(e.$$.fragment,n),t=!0)},o(n){R(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function Fw(i){let e,t=i[2].name+"",n;return{c(){e=y("a"),n=W(t),O(e,"href",i[0].lucentUrl+"/command-report/"+i[2].signature),O(e,"class","top-nav-item")},m(r,s){x(r,e,s),b(e,n)},p:U,d(r){r&&P(e)}}}function NW(i){let e,t=fe(i[0].commands),n=[];for(let r=0;r0&&IW(i);const h=[WW,BW],f=[];function d(m,p){return m[0].auth=="lucent"?0:1}return r=d(i),s=f[r]=h[r](i),{c(){e=y("div"),c.c(),t=D(),u&&u.c(),n=D(),s.c(),O(e,"class","top-nav")},m(m,p){x(m,e,p),c.m(e,null),b(e,t),u&&u.m(e,null),b(e,n),f[r].m(e,null),o=!0},p(m,[p]){c.p(m,p),m[0].commands.length>0&&u.p(m,p),s.p(m,p)},i(m){o||(T(u),T(s),o=!0)},o(m){R(u),R(s),o=!1},d(m){m&&P(e),c.d(),u&&u.d(),f[r].d()}}}function FW(i){const e=Ue("channel"),t=Ue("user");return[e,t]}class YW extends oe{constructor(e){super(),se(this,e,FW,XW,re,{})}}function zW(i){let e,t,n,r,s,o,l,a,c;n=new SW({props:{schema:i[2].schema}}),o=new YW({});const u=[{title:i[0]},i[2]];var h=i[3][i[1]];function f(d,m){let p={};for(let g=0;g{z(g,1)}),be()}h?(a=Xr(h,f(d,m)),V(a.$$.fragment),T(a.$$.fragment,1),Y(a,s,null)):a=null}else if(h){const g=m&5?_o(u,[m&1&&{title:d[0]},m&4&&Co(d[2])]):{};a.$set(g)}},i(d){c||(T(n.$$.fragment,d),T(o.$$.fragment,d),a&&T(a.$$.fragment,d),c=!0)},o(d){R(n.$$.fragment,d),R(o.$$.fragment,d),a&&R(a.$$.fragment,d),c=!1},d(d){d&&P(e),z(n),z(o),a&&z(a)}}}function VW(i,e,t){const n={members:Dx,recordEdit:wW,recordNotFound:Ix,contentIndex:Ay,homeIndex:MW,buildReport:DW};let{title:r}=e,{view:s}=e,{user:o}=e,{data:l}=e,{channel:a}=e,{readableSchemas:c}=e;return Ql("channel",a),Ql("readableSchemas",a.schemas.filter(u=>c.includes(u.name))),Ql("user",o),i.$$set=u=>{"title"in u&&t(0,r=u.title),"view"in u&&t(1,s=u.view),"user"in u&&t(4,o=u.user),"data"in u&&t(2,l=u.data),"channel"in u&&t(5,a=u.channel),"readableSchemas"in u&&t(6,c=u.readableSchemas)},[r,s,l,n,o,a,c]}class UW extends oe{constructor(e){super(),se(this,e,VW,zW,re,{title:0,view:1,user:4,data:2,channel:5,readableSchemas:6})}}const jW={account:kx,channel:UW};let $c=[],qW=function(){$c.map(t=>t.$destroy()),$c=[];const i=document.body.querySelectorAll(".lucent-component");if(i.length===0)return;const e=function(t){const n=t.attributes["data-layout"].value,[r,s]=Object.entries(jW).find(([c,u])=>n===c);if(!s)return[];const o=document.getElementById("json-"+n).innerHTML,l=JSON.parse(o),a={target:t,props:l};$c=[...$c,new s(a)]};Array.from(i).map(e)};document.addEventListener("DOMContentLoaded",qW); diff --git a/front/dist/manifest.json b/front/dist/manifest.json index caba565..92c9294 100644 --- a/front/dist/manifest.json +++ b/front/dist/manifest.json @@ -1,11 +1,11 @@ { "main.js": { - "file": "assets/main-DH0OAeUr.js", + "file": "assets/main-DtbuHUXl.js", "name": "main", "src": "main.js", "isEntry": true, "css": [ - "assets/main-BVNnoznq.css" + "assets/main-BadhVKbO.css" ] } } \ No newline at end of file diff --git a/front/package-lock.json b/front/package-lock.json index feac619..ae12015 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -1038,6 +1038,7 @@ "integrity": "sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^2.1.0", "debug": "^4.3.4", @@ -1614,6 +1615,7 @@ "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.8.tgz", "integrity": "sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==", "dev": true, + "peer": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", "immutable": "^4.0.0", @@ -1654,6 +1656,7 @@ "integrity": "sha512-eeEgGc2DtiUil5ANdtd8vPwt9AgaMdnuUFnPft9F5oMvU/FHu5IHFic+p1dR/UOB7XU2mX2yHW+NcTch4DCh5Q==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.1", "@jridgewell/sourcemap-codec": "^1.4.15", @@ -1716,6 +1719,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.6.tgz", "integrity": "sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==", "dev": true, + "peer": true, "dependencies": { "esbuild": "^0.20.1", "postcss": "^8.4.36", diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..b7e96e1 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "lucent-laravel", + "lockfileVersion": 3, + "requires": true, + "packages": {} +}