var F1=Object.defineProperty;var j1=(n,e,t)=>e in n?F1(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var it=(n,e,t)=>j1(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))l(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&l(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();function oe(){}function U1(n,e){for(const t in e)n[t]=e[t];return n}function yf(n){return n()}function Io(){return Object.create(null)}function Se(n){n.forEach(yf)}function yn(n){return typeof n=="function"}function $e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ui;function El(n,e){return n===e?!0:(ui||(ui=document.createElement("a")),ui.href=e,n===ui.href)}function H1(n){return Object.keys(n).length===0}function W1(n,e,t,l){if(n){const i=Ef(n,e,t,l);return n[0](i)}}function Ef(n,e,t,l){return n[1]&&l?U1(t.ctx.slice(),n[1](l(e))):t.ctx}function G1(n,e,t,l){if(n[2]&&l){const i=n[2](l(t));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],s=Math.max(e.dirty.length,i.length);for(let c=0;c32){const e=[],t=n.ctx.length/32;for(let l=0;ln.removeEventListener(e,t,l)}function Li(n){return function(e){return e.preventDefault(),n.call(this,e)}}function He(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Kt(n){return function(e){e.target===this&&n.call(this,e)}}function r(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Sl(n){return n===""?null:+n}function q1(n){return Array.from(n.childNodes)}function J(n,e){e=""+e,n.data!==e&&(n.data=e)}function Le(n,e){n.value=e??""}function Xt(n,e,t,l){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function jn(n,e,t){for(let l=0;l{const i=n.$$.callbacks[e];if(i){const o=Z1(e,t,{cancelable:l});return i.slice().forEach(s=>{s.call(n,o)}),!o.defaultPrevented}return!0}}function Cs(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(l=>l.call(this,e))}const kl=[],En=[];let yl=[];const Lo=[],Tf=Promise.resolve();let hs=!1;function Sf(){hs||(hs=!0,Tf.then(Cf))}function Y1(){return Sf(),Tf}function il(n){yl.push(n)}const is=new Set;let gl=0;function Cf(){if(gl!==0)return;const n=Vl;do{try{for(;gln.indexOf(l)===-1?e.push(l):t.push(l)),t.forEach(l=>l()),yl=e}const ki=new Set;let tl;function bt(){tl={r:0,c:[],p:tl}}function vt(){tl.r||Se(tl.c),tl=tl.p}function pe(n,e){n&&n.i&&(ki.delete(n),n.i(e))}function ve(n,e,t,l){if(n&&n.o){if(ki.has(n))return;ki.add(n),tl.c.push(()=>{ki.delete(n),l&&(t&&n.d(1),l())}),n.o(e)}else l&&l()}function ye(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Af(n,e){ve(n,1,1,()=>{e.delete(n.key)})}function Nf(n,e,t,l,i,o,s,c,u,d,p,m){let g=n.length,h=o.length,b=g;const k={};for(;b--;)k[n[b].key]=b;const E=[],y=new Map,T=new Map,N=[];for(b=h;b--;){const I=m(i,o,b),D=t(I);let F=s.get(D);F?N.push(()=>F.p(I,e)):(F=d(D,I),F.c()),y.set(D,E[b]=F),D in k&&T.set(D,Math.abs(b-k[D]))}const A=new Set,R=new Set;function M(I){pe(I,1),I.m(c,p),s.set(I.key,I),p=I.first,h--}for(;g&&h;){const I=E[h-1],D=n[g-1],F=I.key,B=D.key;I===D?(p=I.first,g--,h--):y.has(B)?!s.has(F)||A.has(F)?M(I):R.has(B)?g--:T.get(F)>T.get(B)?(R.add(F),M(I)):(A.add(B),g--):(u(D,s),g--)}for(;g--;){const I=n[g];y.has(I.key)||u(I,s)}for(;h;)M(E[h-1]);return Se(N),E}function Ze(n){n&&n.c()}function Ve(n,e,t){const{fragment:l,after_update:i}=n.$$;l&&l.m(e,t),il(()=>{const o=n.$$.on_mount.map(yf).filter(yn);n.$$.on_destroy?n.$$.on_destroy.push(...o):Se(o),n.$$.on_mount=[]}),i.forEach(il)}function qe(n,e){const t=n.$$;t.fragment!==null&&(J1(t.after_update),Se(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Q1(n,e){n.$$.dirty[0]===-1&&(kl.push(n),Sf(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const b=h.length?h[0]:g;return d.ctx&&i(d.ctx[m],d.ctx[m]=b)&&(!d.skip_bound&&d.bound[m]&&d.bound[m](b),p&&Q1(n,m)),g}):[],d.update(),p=!0,Se(d.before_update),d.fragment=l?l(d.ctx):!1,e.target){if(e.hydrate){const m=q1(e.target);d.fragment&&d.fragment.l(m),m.forEach(S)}else d.fragment&&d.fragment.c();e.intro&&pe(n.$$.fragment),Ve(n,e.target,e.anchor),Cf()}Kl(u)}class tt{constructor(){it(this,"$$");it(this,"$$set")}$destroy(){qe(this,1),this.$destroy=oe}$on(e,t){if(!yn(t))return oe;const l=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return l.push(t),()=>{const i=l.indexOf(t);i!==-1&&l.splice(i,1)}}$set(e){this.$$set&&!H1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const x1="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(x1);function $1(n){let e,t;return{c(){e=ae("path"),t=ae("polyline"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function eh(n){let e,t,l,i,o;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),o=ae("polyline"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","16"),r(l,"y1","13"),r(l,"x2","8"),r(l,"y2","13"),r(i,"x1","16"),r(i,"y1","17"),r(i,"x2","8"),r(i,"y2","17"),r(o,"points","10 9 9 9 8 9")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),C(s,i,c),C(s,o,c)},d(s){s&&(S(e),S(t),S(l),S(i),S(o))}}}function th(n){let e,t;return{c(){e=ae("polyline"),t=ae("polyline"),r(e,"points","16 18 22 12 16 6"),r(t,"points","8 6 2 12 8 18")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function nh(n){let e,t,l,i;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("rect"),r(e,"d","M21 8v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8"),r(t,"points","7 3 12 8 17 3"),r(l,"x1","3"),r(l,"y1","8"),r(l,"x2","21"),r(l,"y2","8"),r(i,"x","10"),r(i,"y","12"),r(i,"width","4"),r(i,"height","4"),r(i,"rx","1")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function lh(n){let e,t,l,i,o;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),o=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","9"),r(l,"y1","12"),r(l,"x2","15"),r(l,"y2","12"),r(i,"x1","9"),r(i,"y1","15"),r(i,"x2","13"),r(i,"y2","15"),r(o,"x1","12"),r(o,"y1","15"),r(o,"x2","12"),r(o,"y2","18")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),C(s,i,c),C(s,o,c)},d(s){s&&(S(e),S(t),S(l),S(i),S(o))}}}function ih(n){let e,t,l,i,o,s;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),o=ae("line"),s=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","8"),r(l,"y1","12"),r(l,"x2","16"),r(l,"y2","12"),r(i,"x1","8"),r(i,"y1","16"),r(i,"x2","16"),r(i,"y2","16"),r(o,"x1","8"),r(o,"y1","14"),r(o,"x2","12"),r(o,"y2","14"),r(s,"x1","12"),r(s,"y1","12"),r(s,"x2","12"),r(s,"y2","18")},m(c,u){C(c,e,u),C(c,t,u),C(c,l,u),C(c,i,u),C(c,o,u),C(c,s,u)},d(c){c&&(S(e),S(t),S(l),S(i),S(o),S(s))}}}function sh(n){let e,t,l,i;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","16"),r(l,"y1","13"),r(l,"x2","8"),r(l,"y2","13"),r(i,"x1","16"),r(i,"y1","17"),r(i,"x2","8"),r(i,"y2","17")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function oh(n){let e,t,l,i,o;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),o=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","8"),r(l,"y1","12"),r(l,"x2","16"),r(l,"y2","12"),r(i,"x1","8"),r(i,"y1","16"),r(i,"x2","16"),r(i,"y2","16"),r(o,"x1","8"),r(o,"y1","14"),r(o,"x2","12"),r(o,"y2","14")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),C(s,i,c),C(s,o,c)},d(s){s&&(S(e),S(t),S(l),S(i),S(o))}}}function rh(n){let e,t,l;return{c(){e=ae("path"),t=ae("circle"),l=ae("circle"),r(e,"d","M9 18V5l12-2v13"),r(t,"cx","6"),r(t,"cy","18"),r(t,"r","3"),r(l,"cx","18"),r(l,"cy","16"),r(l,"r","3")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function ah(n){let e,t;return{c(){e=ae("rect"),t=ae("polyline"),r(e,"x","2"),r(e,"y","4"),r(e,"width","20"),r(e,"height","16"),r(e,"rx","2"),r(t,"points","10 9 16 12 10 15 10 9")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function ch(n){let e,t,l;return{c(){e=ae("rect"),t=ae("circle"),l=ae("polyline"),r(e,"x","3"),r(e,"y","3"),r(e,"width","18"),r(e,"height","18"),r(e,"rx","2"),r(e,"ry","2"),r(t,"cx","8.5"),r(t,"cy","8.5"),r(t,"r","1.5"),r(l,"points","21 15 16 10 5 21")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function uh(n){let e;return{c(){e=ae("path"),r(e,"d","M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function fh(n){let e;function t(o,s){return o[0]==="folder"?uh:o[0]==="image"?ch:o[0]==="video"?ah:o[0]==="audio"?rh:o[0]==="pdf"?oh:o[0]==="document"?sh:o[0]==="spreadsheet"?ih:o[0]==="presentation"?lh:o[0]==="archive"?nh:o[0]==="code"?th:o[0]==="text"?eh:$1}let l=t(n),i=l(n);return{c(){e=ae("svg"),i.c(),r(e,"width",n[1]),r(e,"height",n[1]),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","1.5"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round"),r(e,"xmlns","http://www.w3.org/2000/svg")},m(o,s){C(o,e,s),i.m(e,null)},p(o,[s]){l!==(l=t(o))&&(i.d(1),i=l(o),i&&(i.c(),i.m(e,null))),s&2&&r(e,"width",o[1]),s&2&&r(e,"height",o[1])},i:oe,o:oe,d(o){o&&S(e),i.d()}}}function dh(n,e,t){let{kind:l="generic"}=e,{size:i=20}=e;return n.$$set=o=>{"kind"in o&&t(0,l=o.kind),"size"in o&&t(1,i=o.size)},[l,i]}class Rf extends tt{constructor(e){super(),et(this,e,dh,fh,$e,{kind:0,size:1})}}const ph={"nav.today":"Сегодня","nav.inbox":"Неразобранное","nav.trash":"Корзина","nav.activity":"Активность","nav.journal":"Журнал","nav.clients":"Клиенты","nav.projects":"Проекты","nav.recipes":"Рецепты","nav.documents":"Документы","nav.archive":"Архив","nav.sections":"Разделы","nav.cases":"Дела","nav.noCases":"Нет дел","nav.sync":"Синхронизация","nav.syncSettings":"Настройки синхронизации","nav.syncNow":"Синхронизировать","nav.selectPrompt":"Выберите раздел или дело","nav.brand":"Верстак","nav.system":"Системное","nav.workspace":"Рабочее пространство","nav.noNodes":"Нет узлов","nav.openFolder":"Открыть папку","nav.createInside":"Создать внутри","nav.createNode":"Создать элемент","nav.moveToRoot":"Переместить в корень","inbox.subtitle":"Захваченные материалы, которые нужно разложить по делам","inbox.sortByDate":"по дате","inbox.sortByName":"по имени","inbox.sortByType":"по типу","inbox.sortAsc":"по возрастанию","inbox.sortDesc":"по убыванию","inbox.groupByContext":"Группировать по месту захвата","inbox.noContext":"Без места захвата","inbox.empty":"Неразобранных элементов нет","inbox.pasteClipboard":"Вставить из буфера","inbox.captured":"Добавлено","inbox.clipboardEmpty":"Буфер обмена пуст","inbox.clipboardUnavailable":"Буфер обмена недоступен","inbox.assign":"Разложить","inbox.keepHere":"Прикрепить в захваченном месте","inbox.localEmpty":"Для этого дела неразобранных материалов нет","inbox.capturedIn":"Захвачено в","inbox.suggestedTarget":"Цель","inbox.assignTitle":"Разложить материал","inbox.assignTarget":"Дело","inbox.assignSearchPlaceholder":"Найти дело","inbox.assignSearchHint":"Начните набирать название Дела","inbox.deleteTitle":"Удалить материал","inbox.deleteConfirm":"Удалить «{title}» из неразобранного?","capture.kind.text":"Текст","capture.kind.url":"Ссылка","capture.kind.file":"Файл","capture.kind.folder":"Папка","capture.kind.image":"Изображение","capture.source.clipboard":"Буфер обмена","capture.source.clipboard_button":"Кнопка буфера","capture.source.drop":"Перетаскивание","capture.source.paste":"Вставка","capture.source.browser":"Браузер","capture.source.manual":"Вручную","capture.dropOverlayNode":"Будет добавлено в Неразобранное для: {title}","capture.dropOverlayGlobal":"Будет добавлено в глобальное Неразобранное","trash.openFolder":"Открыть папку корзины","trash.empty":"Корзина пуста","trash.emptyTrash":"Очистить корзину","trash.restore":"Восстановить","trash.deletedNodes":"Удаленные элементы","tab.overview":"Обзор","tab.notes":"Заметки","tab.files":"Файлы","tab.inbox":"Неразобранное","tab.links":"Ссылки","tab.actions":"Действия","tab.worklog":"Журнал","tab.activity":"Активность","common.save":"Сохранить","common.cancel":"Отмена","common.delete":"Удалить","common.rename":"Переименовать","common.close":"Закрыть","common.create":"Создать","common.confirm":"Подтверждение","common.back":"← Назад","common.backLabel":"Назад","common.loading":"Загрузка...","common.error":"Ошибка:","common.yes":"Да","common.ok":"OK","common.copy":"Копировать","common.cut":"Вырезать","common.paste":"Вставить","common.duplicate":"Дублировать","common.run":"Запустить","common.test":"Test","common.all":"Все","common.open":"Открыть","common.no":"Нет","common.date":"Дата","common.search":"Найти","common.testAgain":"Проверить","common.connect":"Подключиться","common.disconnect":"Отключиться","common.settings":"Настройки","common.name":"Название","common.type":"Тип","common.section":"Раздел","common.created":"Создано","common.empty":"Нет","common.newName":"Новое имя","search.placeholder":"Поиск по Верстаку...","search.noResults":"Ничего не найдено","welcome.title":"Верстак","welcome.selectSection":"Выберите раздел в боковой панели.","welcome.createCase":"Или создайте новое дело кнопкой «+».","welcome.addCase":"Добавить дело","event.noteCreated":"Заметка создана","event.noteUpdated":"Заметка изменена","event.fileAdded":"Файл добавлен","event.fileDeleted":"Файл удалён","event.fileRenamed":"Файл переименован","event.fileCopied":"Файл скопирован","event.fileMoved":"Файл перемещён","event.folderAdded":"Папка добавлена","event.folderDeleted":"Папка удалена","event.folderRenamed":"Папка переименована","event.caseCreated":"Дело создано","event.caseUpdated":"Дело изменено","event.noteDeleted":"Заметка удалена","event.folderMoved":"Папка перемещена","event.nodeDeleted":"Узел удалён","event.actionCreated":"Действие создано","event.actionDone":"Действие выполнено","event.worklogAdded":"Запись времени добавлена","kind.project":"Проект","kind.client":"Клиент","kind.document":"Документ","kind.recipe":"Рецепт","kind.folder":"Папка","kind.note":"Заметка","kind.file":"Файл","kind.archive":"Архив","kind.case":"Дело","kind.link":"Ссылка","kind.action":"Действие","links.empty":"Ссылок пока нет","links.editTitle":"Редактировать ссылку","links.note":"Заметка","links.copyUrl":"Копировать URL","links.copied":"URL скопирован","links.copyUnavailable":"Не удалось скопировать URL","links.deleteTitle":"Удалить ссылку","links.deleteConfirm":"Удалить ссылку «{title}»?","action.openUrl":"Открыть URL","action.openFile":"Открыть файл","action.openFolder":"Открыть папку","action.runCommand":"Запустить команду","action.runScript":"Запустить скрипт","action.openTerminal":"Открыть терминал","action.launchApp":"Запустить приложение","action.addAction":"+ Добавить действие","action.newAction":"Новое действие","action.noActions":"Действий пока нет","action.run":"Запустить","action.dataUrl":"URL","action.dataPath":"Путь","action.dataCommand":"Команда","action.urlPlaceholder":"https://example.com","action.pathPlaceholder":"/path/to/file","action.commandPlaceholder":"команда","action.namePlaceholder":"Например: Открыть сайт","note.add":"+ Добавить заметку","note.new":"Новая заметка","note.title":"Название заметки","note.noNotes":"Нет заметок","note.createFirst":"Создайте первую заметку для этого дела.","note.placeholder":"Начните писать...","note.unsavedTitle":"Несохранённые изменения","note.unsavedMessage":"Закрыть редактор? Все несохранённые изменения будут потеряны.","note.unsavedClose":"Закрыть","note.mode.edit":"Редактор","note.mode.preview":"Просмотр","note.mode.split":"Разделённый","note.toolbar.bold":"Жирный (Ctrl+B)","note.toolbar.italic":"Курсив (Ctrl+I)","note.toolbar.heading":"Заголовок","note.toolbar.link":"Ссылка","note.toolbar.code":"Код","note.toolbar.codeBlock":"Блок кода","note.toolbar.bulletList":"Маркированный список","note.toolbar.numberedList":"Нумерованный список","note.toolbar.checkbox":"Чекбокс","note.toolbar.quote":"Цитата","note.toolbar.internalLink":"Внутренняя ссылка Verstak","note.internal.secretNotImplemented":"Сейф доступов ещё не реализован","note.internal.caseNotFound":"Дело не найдено","note.internal.noteNotFound":"Заметка не найдена","note.internal.fileNotFound":"Файл не найден","note.internal.fileFound":"Файл найден: {title}","note.rename":"Переименовать заметку","note.deleteConfirm":"Удалить заметку «{title}»?","note.renameError":"Не удалось переименовать заметку","note.internalLink.title":"Вставить внутреннюю ссылку","note.internalLink.label":"Текст ссылки","note.internalLink.url":"Адрес ссылки","note.internalLink.labelPlaceholder":"Например: Админка","note.internalLink.urlPlaceholder":"verstak://secret/sec_...","note.preview.empty":"Пустая заметка. Переключитесь в режим редактора, чтобы начать писать.","note.preview.error":"Ошибка рендеринга markdown","link.label":"Текст ссылки","link.url":"URL или verstak:// ссылка","link.urlPlaceholder":"https://... или verstak://secret/sec_...","link.insert":"Вставить","file.addFile":"+ Добавить файл","file.addFolder":"+ Добавить папку","file.newFile":"+ Новый файл","file.addFileSimple":"Добавить файл","file.addFolderSimple":"Добавить папку","file.noFiles":"В этой папке пока нет файлов","file.noFilesCase":"В этом проекте пока нет файлов","file.hint":"Добавьте файл или папку, чтобы сохранить материалы проекта.","file.root":"Файлы","file.preview":"Предпросмотр","file.openExternal":"Открыть во внешней программе","file.openFolder":"Открыть папку","file.showInExplorer":"Показать в проводнике","file.more":"Ещё","file.delete":"Удалить","file.ariaFolder":"Папка","file.ariaFile":"Файл","file.scanning":"Сканирование...","file.pickSingle":"Выберите файл","file.pickMultiple":"Выберите файлы","file.pickDirectory":"Выберите папку","file.importTitle":"Добавить в","file.importFiles":"Файлов:","file.importFolders":"Папок:","file.importSize":"Размер:","file.importCopy":"Скопировать","file.importLink":"Привязать","file.selectCaseFirst":"Сначала выберите дело для добавления файлов","worklog.title":"Журнал","worklog.whatDone":"Что сделано","worklog.minutes":"Мин","worklog.min":"мин","worklog.log":"Записать","worklog.addEntry":"Добавить запись","worklog.acceptSuggestion":"Принять предложение","worklog.editEntry":"Редактировать запись","worklog.deleteEntry":"Удалить запись","worklog.deleteConfirm":"Удалить эту запись работы? Связанные события останутся в активности, но связь с записью будет удалена.","worklog.date":"Дата","worklog.empty":"Записей работы пока нет","worklog.details":"Детали","worklog.source":"Источник","worklog.sourceSuggestion":"Из предложения","worklog.sourceSuggestionNoEvents":"Из предложения, но связанные события отсутствуют","worklog.sourceManual":"Ручная запись","worklog.sourceUnknown":"Источник неизвестен","worklog.suggestions":"Предложения на сегодня","worklog.apply":"Применить","sync.title":"Синхронизация","sync.settings":"Настройки синхронизации","sync.status":"Статус","sync.server":"Сервер","sync.device":"Устройство","sync.deviceId":"ID устройства","sync.unpushed":"Неотправлено","sync.lastSync":"Последняя синх.","sync.revoked":"Отозвано","sync.connected":"Подключено","sync.notConnected":"Не подключено","sync.disabled":"Отключена","sync.serverUrl":"URL сервера","sync.serverUrlPlaceholder":"https://example.com:47732","sync.username":"Логин","sync.usernamePlaceholder":"username","sync.password":"Пароль","sync.passwordPlaceholder":"password","sync.interval":"Автосинхронизация (мин)","sync.saveInterval":"Сохранить интервал","sync.syncNow":"Синхронизировать","sync.disconnect":"Отключиться","sync.connect":"Подключиться","sync.test":"Проверить","sync.settingsSaved":"интервал сохранён","today.title":"Сегодня","today.changedCases":"Изменён сегодня","today.timeline":"Лента за сегодня","today.empty":"Сегодня пока тихо","today.emptyHint":"Здесь появятся дела, заметки, файлы и действия, с которыми вы работали сегодня.","today.plural.case_one":"дело","today.plural.case_few":"дела","today.plural.case_many":"дел","today.plural.note_one":"заметка","today.plural.note_few":"заметки","today.plural.note_many":"заметок","today.plural.file_one":"файл","today.plural.file_few":"файла","today.plural.file_many":"файлов","today.plural.event_one":"событие","today.plural.event_few":"события","today.plural.event_many":"событий","today.feed":"Лента","today.suggestionsTab":"Предложения","today.inProgress":"В работе","today.captured":"Захвачено","today.feedEmpty":"Сегодня событий нет","today.inProgressEmpty":"Сегодня ничего не изменяли","today.capturedEmpty":"Сегодня ничего не захвачено","today.feedHint":"События за сегодня: изменения файлов, заметок, действий и другие события.","today.sortByTime":"по времени","today.sortByName":"по имени","today.sortByType":"по типу","today.sortAsc":"по возрастанию","today.sortDesc":"по убыванию","journal.title":"Журнал работы","journal.worklogTab":"Журнал работы","journal.empty":"Нет записей за выбранный период","journal.dateFrom":"От","journal.dateTo":"До","journal.filter":"Фильтр","journal.total":"Всего","journal.exportCSV":"CSV","journal.exportMarkdown":"Markdown","journal.billable":"К оплате","journal.billableYes":"К оплате","journal.billableNo":"Не к оплате","journal.billableHint":"К оплате — можно включать в счёт клиенту","journal.approx":"Тип времени","journal.approxExact":"Точное","journal.approxEstimated":"Оценочное","journal.approxHint":"Оценочное — время предложено системой или введено как примерное","journal.includeChildrenDisabledHint":"Работает только при выбранном деле/клиенте/проекте","journal.node":"Дело","journal.path":"Путь","journal.byDay":"По дням","journal.byNode":"По делам","journal.includeChildren":"Учитывать вложенные дела","journal.nodeSearch":"Поиск дела...","journal.relatedEvents":"Связанные события","journal.filterHeading":"Фильтры","journal.exportHeading":"Экспорт отчёта","journal.reset":"Сбросить","suggest.title":"Предложения на сегодня","suggest.apply":"Записать","suggest.dismiss":"Скрыть","suggest.open":"Открыть","suggest.confidence.low":"Низкая уверенность","suggest.confidence.medium":"Средняя уверенность","suggest.confidence.high":"Высокая уверенность","suggest.minutes":"мин","suggest.edit":"Изменить","suggest.noSuggestions":"Нет предложений для журнала","suggest.detectedEvents":"Что обнаружено","activity.title":"Активность","activity.empty":"Активность пока не зафиксирована","activity.perCaseEmpty":"Активность пока не зафиксирована","overview.type":"Тип","overview.section":"Раздел","overview.created":"Создано","overview.newNote":"Новая заметка","overview.addFile":"Добавить файл","overview.addAction":"Добавить действие","overview.logTime":"Записать время","overview.recentNotes":"Последние заметки","overview.recentEntries":"Последние записи","rename.title":"Переименовать","rename.emptyError":"Имя не может быть пустым","rename.invalidError":"Недопустимое имя","delete.confirmTitle":"Удаление","delete.confirmMessage":"Удалить","delete.folder":"папку","delete.file":"файл","template.optionNone":"Пустое дело","template.optional":"Шаблон (опционально)","template.none.desc":"Без шаблона, простой узел-контейнер","template.folder":"Папка","template.folder.desc":"Папка для группировки элементов внутри рабочего пространства","template.project":"Проект","template.project.desc":"Отдельный проект или задача с файлами, заметками и журналом","template.client":"Клиент","template.client.desc":"Организация или человек, для которых ведутся работы","template.document":"Документ","template.document.desc":"Документ с описанием, заметками и файлами","template.recipe":"Рецепт","template.recipe.desc":"Повторяемая процедура или инструкция","template.note":"Заметка","template.file":"Файл","template.select":"Выберите тип","mime.jpeg":"Изображение JPEG","mime.png":"Изображение PNG","mime.gif":"Изображение GIF","mime.webp":"Изображение WebP","mime.svg":"Изображение SVG","mime.bmp":"Изображение BMP","mime.tiff":"Изображение TIFF","mime.avif":"Изображение AVIF","mime.pdf":"PDF документ","mime.word":"Документ Word","mime.excel":"Таблица Excel","mime.ppt":"Презентация PowerPoint","mime.zip":"ZIP архив","mime.gzip":"GZIP архив","mime.tar":"TAR архив","mime.sevenz":"7z архив","mime.rar":"RAR архив","mime.text":"Текстовый файл","mime.html":"HTML файл","mime.css":"CSS файл","mime.js":"JavaScript файл","mime.json":"JSON файл","mime.xml":"XML файл","mime.yaml":"YAML файл","mime.binary":"Бинарный файл","mime.executable":"Исполняемый файл","mime.folder":"Папка","mime.unknown":"Неизвестно","mime.file":"Файл","error.nameEmpty":"Имя не может быть пустым","error.nameInvalid":"Недопустимое имя","error.selectCaseFirst":"Сначала выберите дело","error.vaultNotOpen":"Хранилище не открыто","delete.files":"файлов ({count})","file.namePrompt":"Введите имя файла:","file.pdfUnavailable":"Предпросмотр PDF недоступен.","file.previewUnavailable":"Предпросмотр недоступен для этого типа файлов.","case.new":"Новое дело","case.namePlaceholder":"Название дела","settings.title":"Настройки","settings.general":"Общие","settings.generalDesc":"Основные настройки интерфейса.","settings.workspace":"Рабочее пространство","settings.workspaceDesc":"Управление хранилищем данных.","settings.appearance":"Внешний вид","settings.localization":"Локализация","settings.templates":"Шаблоны","settings.plugins":"Плагины","settings.files":"Файлы","settings.activity":"Активность","settings.sync":"Синхронизация","settings.backup":"Резервные копии","settings.close":"Закрыть настройки","settings.noPlugins":"Плагины пока не установлены.","settings.openPluginsDir":"Открыть папку plugins","settings.activityStub":"Здесь будут настройки отслеживания активности.","settings.backupStub":"Здесь будут настройки резервного копирования.","settings.theme":"Тема интерфейса","settings.themeSystem":"Системная","settings.themeLight":"Светлая","settings.themeDark":"Тёмная","settings.language":"Язык интерфейса","settings.langRu":"Русский","settings.langEn":"Английский","settings.langSoon":"будет доступно позже","settings.save":"Сохранить настройки","settings.saved":"Настройки сохранены","settings.vaultPath":"Путь к рабочему пространству","settings.noVaultInfo":"Нет информации о хранилище.","settings.vaultInfo":"Информация о рабочем пространстве","settings.openVault":"Открыть папку vault","settings.changeVault":"Изменить путь","settings.checkIntegrity":"Проверить целостность","settings.templatesDesc":"Включите или выключите шаблоны создания элементов.","settings.templateEnabled":"Включён","settings.templateDisabled":"Выключен","settings.filesStub":"Здесь будут настройки файлового хранилища.","settings.syncEnabled":"Синхронизация включена","settings.syncDisabled":"Синхронизация отключена","settings.syncDesc":"Настройте подключение к серверу синхронизации.","settings.serverUrl":"URL сервера","settings.deviceName":"Имя устройства","settings.deviceId":"ID устройства","settings.lastSync":"Последняя синхронизация","settings.lastError":"Последняя ошибка","settings.pendingChanges":"Ожидающие изменения","settings.checkConnection":"Проверить подключение","settings.syncNow":"Синхронизировать сейчас","settings.reconnect":"Переподключить","settings.disconnect":"Отключить устройство","settings.resetKey":"Сбросить ключ","settings.confirmDisconnect":"Вы уверены, что хотите отключить устройство?","settings.confirmDisconnectDesc":"Синхронизация будет остановлена. Для повторного подключения потребуется логин и пароль.","settings.confirmResetKey":"Сбросить ключ синхронизации?","settings.confirmResetKeyDesc":"Текущий ключ устройства будет удалён. Потребуется переподключение.","settings.connected":"Подключено","settings.disconnected":"Не подключено","settings.notConfigured":"Не настроено","settings.error":"Ошибка","settings.revoked":"Отозвано","settings.status":"Статус","firstrun.title":"Добро пожаловать в Верстак","firstrun.desc":"Верстак хранит данные в локальном рабочем пространстве — vault.","firstrun.pathLabel":"Путь к vault","firstrun.defaultPath":"Путь по умолчанию","firstrun.browse":"Выбрать папку","firstrun.create":"Создать рабочее пространство","firstrun.quit":"Выйти","firstrun.pathExists":"Папка существует. Будет создан новый vault.","firstrun.pathHasVault":"Найден существующий vault. Будет подключён.","firstrun.pathNew":"Путь не существует. Будет создан новый vault.","firstrun.errorNoWrite":"Нет прав на запись в выбранную папку.","firstrun.creating":"Создание рабочего пространства...","firstrun.created":"Рабочее пространство создано!","recovery.title":"Рабочее пространство не найдено","recovery.expected":"Ожидался путь","recovery.choose":"Выбрать другой vault","recovery.create":"Создать новый vault","recovery.settings":"Открыть настройки","recovery.quit":"Выйти","recovery.createConfirm":"Будет создано новое пустое рабочее пространство. Старый путь в настройках будет заменён.","recovery.createConfirmTitle":"Создать новое рабочее пространство?","sync.status.connected":"Синхронизация доступна","sync.status.disconnected":"Сервер недоступен","sync.status.disabled":"Синхронизация не настроена","sync.status.syncing":"Синхронизация...","sync.status.error":"Ошибка синхронизации","sync.changes":"изменений","sync.details":"Подробнее","sync.configure":"Настроить","sync.retry":"Повторить","sync.run":"Синхронизировать","sync.running":"Синхронизация...","sync.conflictsCount":"Конфликты: {count}","sync.applyErrorsCount":"Ошибки применения: {count}","sync.pushedPulled":"Отправлено: {pushed}, получено: {pulled}","error.generic":"Произошла ошибка","error.invalidCredentials":"Неверный логин или пароль","error.accountBlocked":"Аккаунт заблокирован","error.emailNotConfirmed":"Email не подтверждён","error.tokenInvalid":"Неверный или просроченный токен","error.tokenExpired":"Срок действия токена истёк"},mh={"nav.today":"Today","nav.inbox":"Inbox","nav.trash":"Trash","nav.activity":"Activity","nav.journal":"Journal","nav.clients":"Clients","nav.projects":"Projects","nav.recipes":"Recipes","nav.documents":"Documents","nav.archive":"Archive","nav.sections":"Sections","nav.cases":"Cases","nav.noCases":"No cases","nav.sync":"Sync","nav.syncSettings":"Sync settings","nav.syncNow":"Sync now","nav.selectPrompt":"Select a section or case","nav.brand":"Verstak","nav.system":"System","nav.workspace":"Workspace","nav.noNodes":"No nodes","nav.openFolder":"Open folder","nav.createInside":"Create inside","nav.createNode":"Create element","nav.moveToRoot":"Move to root","inbox.subtitle":"Captured materials that still need to be assigned to cases","inbox.sortByDate":"by date","inbox.sortByName":"by name","inbox.sortByType":"by type","inbox.sortAsc":"ascending","inbox.sortDesc":"descending","inbox.groupByContext":"Group by capture location","inbox.noContext":"No capture location","inbox.empty":"No unprocessed items","inbox.pasteClipboard":"Paste from clipboard","inbox.captured":"Added","inbox.clipboardEmpty":"Clipboard is empty","inbox.clipboardUnavailable":"Clipboard is unavailable","inbox.assign":"Assign","inbox.keepHere":"Attach at captured location","inbox.localEmpty":"No unprocessed materials for this case","inbox.capturedIn":"Captured in","inbox.suggestedTarget":"Target","inbox.assignTitle":"Assign material","inbox.assignTarget":"Case","inbox.assignSearchPlaceholder":"Find case","inbox.assignSearchHint":"Start typing a Case name","inbox.deleteTitle":"Delete material","inbox.deleteConfirm":'Delete "{title}" from inbox?',"capture.kind.text":"Text","capture.kind.url":"Link","capture.kind.file":"File","capture.kind.folder":"Folder","capture.kind.image":"Image","capture.source.clipboard":"Clipboard","capture.source.clipboard_button":"Clipboard button","capture.source.drop":"Drop","capture.source.paste":"Paste","capture.source.browser":"Browser","capture.source.manual":"Manual","capture.dropOverlayNode":"Will be added to Inbox for: {title}","capture.dropOverlayGlobal":"Will be added to global Inbox","trash.openFolder":"Open trash folder","trash.empty":"Trash is empty","trash.emptyTrash":"Empty trash","trash.restore":"Restore","trash.deletedNodes":"Deleted items","tab.overview":"Overview","tab.notes":"Notes","tab.files":"Files","tab.inbox":"Inbox","tab.links":"Links","tab.actions":"Actions","tab.worklog":"Work Log","tab.activity":"Activity","common.save":"Save","common.cancel":"Cancel","common.delete":"Delete","common.rename":"Rename","common.close":"Close","common.create":"Create","common.confirm":"Confirm","common.back":"← Back","common.backLabel":"Back","common.loading":"Loading...","common.error":"Error:","common.yes":"Yes","common.ok":"OK","common.copy":"Copy","common.cut":"Cut","common.paste":"Paste","common.duplicate":"Duplicate","common.run":"Run","common.test":"Test","common.all":"All","common.open":"Open","common.no":"No","common.date":"Date","common.search":"Search","common.testAgain":"Check","common.connect":"Connect","common.disconnect":"Disconnect","common.settings":"Settings","common.name":"Name","common.type":"Type","common.section":"Section","common.created":"Created","common.empty":"None","common.newName":"New name","search.placeholder":"Search Verstak...","search.noResults":"No results found","welcome.title":"Verstak","welcome.selectSection":"Select a section in the sidebar.","welcome.createCase":"Or create a new case with the + button.","welcome.addCase":"Add case","event.noteCreated":"Note created","event.noteUpdated":"Note updated","event.fileAdded":"File added","event.fileDeleted":"File deleted","event.fileRenamed":"File renamed","event.fileCopied":"File copied","event.fileMoved":"File moved","event.folderAdded":"Folder added","event.folderDeleted":"Folder deleted","event.folderRenamed":"Folder renamed","event.caseCreated":"Case created","event.caseUpdated":"Case updated","event.noteDeleted":"Note deleted","event.folderMoved":"Folder moved","event.nodeDeleted":"Node deleted","event.actionCreated":"Action created","event.actionDone":"Action completed","event.worklogAdded":"Time entry added","kind.project":"Project","kind.client":"Client","kind.document":"Document","kind.recipe":"Recipe","kind.folder":"Folder","kind.note":"Note","kind.file":"File","kind.archive":"Archive","kind.case":"Case","kind.link":"Link","kind.action":"Action","links.empty":"No links yet","links.editTitle":"Edit link","links.note":"Note","links.copyUrl":"Copy URL","links.copied":"URL copied","links.copyUnavailable":"Could not copy URL","links.deleteTitle":"Delete link","links.deleteConfirm":'Delete link "{title}"?',"action.openUrl":"Open URL","action.openFile":"Open file","action.openFolder":"Open folder","action.runCommand":"Run command","action.runScript":"Run script","action.openTerminal":"Open terminal","action.launchApp":"Launch app","action.addAction":"+ Add action","action.newAction":"New action","action.noActions":"No actions yet","action.run":"Run","action.dataUrl":"URL","action.dataPath":"Path","action.dataCommand":"Command","action.urlPlaceholder":"https://example.com","action.pathPlaceholder":"/path/to/file","action.commandPlaceholder":"command","action.namePlaceholder":"Example: Open website","note.add":"+ Add note","note.new":"New note","note.title":"Note title","note.noNotes":"No notes","note.createFirst":"Create the first note for this case.","note.placeholder":"Start writing...","note.unsavedTitle":"Unsaved changes","note.unsavedMessage":"Close the editor? All unsaved changes will be lost.","note.unsavedClose":"Close","note.mode.edit":"Edit","note.mode.preview":"Preview","note.mode.split":"Split","note.toolbar.bold":"Bold (Ctrl+B)","note.toolbar.italic":"Italic (Ctrl+I)","note.toolbar.heading":"Heading","note.toolbar.link":"Link","note.toolbar.code":"Code","note.toolbar.codeBlock":"Code block","note.toolbar.bulletList":"Bullet list","note.toolbar.numberedList":"Numbered list","note.toolbar.checkbox":"Checkbox","note.toolbar.quote":"Quote","note.toolbar.internalLink":"Verstak internal link","note.internal.secretNotImplemented":"Secrets vault is not yet implemented","note.internal.caseNotImplemented":"Case navigation is not yet implemented","note.internal.noteNotImplemented":"Note navigation is not yet implemented","note.internal.fileNotImplemented":"File navigation is not yet implemented","note.rename":"Rename note","note.deleteConfirm":'Delete note "{title}"?',"note.renameError":"Failed to rename note","note.internalLink.title":"Insert internal link","note.internalLink.label":"Link text","note.internalLink.url":"Link address","note.internalLink.labelPlaceholder":"e.g. Admin panel","note.internalLink.urlPlaceholder":"verstak://secret/sec_...","note.preview.empty":"Empty note. Switch to edit mode to start writing.","note.preview.error":"Markdown render error","link.label":"Link text","link.url":"URL or verstak:// link","link.urlPlaceholder":"https://... or verstak://secret/sec_...","link.insert":"Insert","file.addFile":"+ Add file","file.addFolder":"+ Add folder","file.newFile":"+ New file","file.addFileSimple":"Add file","file.addFolderSimple":"Add folder","file.noFiles":"No files in this folder yet","file.noFilesCase":"No files in this project yet","file.hint":"Add a file or folder to store project materials.","file.root":"Files","file.preview":"Preview","file.openExternal":"Open in external program","file.openFolder":"Open folder","file.showInExplorer":"Show in explorer","file.more":"More","file.delete":"Delete","file.ariaFolder":"Folder","file.ariaFile":"File","file.scanning":"Scanning...","file.pickSingle":"Select file","file.pickMultiple":"Select files","file.pickDirectory":"Select folder","file.importTitle":"Add to","file.importFiles":"Files:","file.importFolders":"Folders:","file.importSize":"Size:","file.importCopy":"Copy","file.importLink":"Link","file.selectCaseFirst":"Select a case before adding files","worklog.title":"Work Log","worklog.whatDone":"What was done","worklog.minutes":"Min","worklog.min":"min","worklog.log":"Log","worklog.addEntry":"Add entry","worklog.acceptSuggestion":"Accept suggestion","worklog.editEntry":"Edit entry","worklog.deleteEntry":"Delete entry","worklog.deleteConfirm":"Delete this work entry? Related events stay in activity, but their link to this entry will be removed.","worklog.date":"Date","worklog.empty":"No work logged yet","worklog.details":"Details","worklog.source":"Source","worklog.sourceSuggestion":"From suggestion","worklog.sourceSuggestionNoEvents":"From suggestion, but related events missing","worklog.sourceManual":"Manual entry","worklog.sourceUnknown":"Unknown source","worklog.suggestions":"Suggestions for today","worklog.apply":"Apply","sync.title":"Sync","sync.settings":"Sync settings","sync.status":"Status","sync.server":"Server","sync.device":"Device","sync.deviceId":"Device ID","sync.unpushed":"Unpushed","sync.lastSync":"Last sync","sync.revoked":"Revoked","sync.connected":"Connected","sync.notConnected":"Not connected","sync.disabled":"Disabled","sync.serverUrl":"Server URL","sync.serverUrlPlaceholder":"https://example.com:47732","sync.username":"Username","sync.usernamePlaceholder":"username","sync.password":"Password","sync.passwordPlaceholder":"password","sync.interval":"Auto sync (min)","sync.saveInterval":"Save interval","sync.syncNow":"Sync now","sync.disconnect":"Disconnect","sync.connect":"Connect","sync.test":"Check","sync.settingsSaved":"interval saved","today.title":"Today","today.changedCases":"Changed today","today.timeline":"Timeline for today","today.empty":"Nothing happened today yet","today.emptyHint":"Cases, notes, files, and actions you worked with today will appear here.","today.plural.case_one":"case","today.plural.case_few":"cases","today.plural.case_many":"cases","today.plural.note_one":"note","today.plural.note_few":"notes","today.plural.note_many":"notes","today.plural.file_one":"file","today.plural.file_few":"files","today.plural.file_many":"files","today.plural.event_one":"event","today.plural.event_few":"events","today.plural.event_many":"events","today.feed":"Feed","today.suggestionsTab":"Suggestions","today.inProgress":"In Progress","today.captured":"Captured","today.feedEmpty":"No events today","today.inProgressEmpty":"Nothing modified today","today.capturedEmpty":"Nothing captured today","today.feedHint":"Today's events: file changes, notes, actions and other events.","today.sortByTime":"by time","today.sortByName":"by name","today.sortByType":"by type","today.sortAsc":"ascending","today.sortDesc":"descending","journal.title":"Work Log","journal.worklogTab":"Work Log","journal.empty":"No entries for the selected period","journal.dateFrom":"From","journal.dateTo":"To","journal.filter":"Filter","journal.total":"Total","journal.exportCSV":"CSV","journal.exportMarkdown":"Markdown","journal.billable":"Billable","journal.billableYes":"Billable","journal.billableNo":"Not billable","journal.billableHint":"Billable — can be included in client invoice","journal.approx":"Time type","journal.approxExact":"Exact","journal.approxEstimated":"Estimated","journal.approxHint":"Estimated — time suggested by the system or entered as approximate","journal.includeChildrenDisabledHint":"Only works when a case/client/project is selected","journal.node":"Case","journal.path":"Path","journal.byDay":"By day","journal.byNode":"By case","journal.includeChildren":"Include subtasks","journal.nodeSearch":"Search case...","journal.relatedEvents":"Related events","journal.filterHeading":"Filters","journal.exportHeading":"Export Report","journal.reset":"Reset","suggest.title":"Suggestions","suggest.apply":"Log","suggest.dismiss":"Dismiss","suggest.open":"Open","suggest.confidence.low":"Low confidence","suggest.confidence.medium":"Medium confidence","suggest.confidence.high":"High confidence","suggest.minutes":"min","suggest.edit":"Edit","suggest.noSuggestions":"No suggestions","suggest.detectedEvents":"What was detected","activity.title":"Activity","activity.empty":"No activity recorded yet","activity.perCaseEmpty":"No activity recorded yet","overview.type":"Type","overview.section":"Section","overview.created":"Created","overview.newNote":"New note","overview.addFile":"Add file","overview.addAction":"Add action","overview.logTime":"Log time","overview.recentNotes":"Recent notes","overview.recentEntries":"Recent entries","rename.title":"Rename","rename.emptyError":"Name cannot be empty","rename.invalidError":"Invalid name","delete.confirmTitle":"Delete","delete.confirmMessage":"Delete","delete.folder":"folder","delete.file":"file","template.optionNone":"Empty case","template.optional":"Template (optional)","template.none.desc":"No template, simple container node","template.folder":"Folder","template.folder.desc":"A folder to group items inside a workspace","template.project":"Project","template.project.desc":"A distinct project or task with files, notes and work log","template.client":"Client","template.client.desc":"An organization or person for whom work is performed","template.document":"Document","template.document.desc":"A document with description, notes and files","template.recipe":"Recipe","template.recipe.desc":"A repeatable procedure or instruction","template.note":"Note","template.file":"File","template.select":"Select type","mime.jpeg":"JPEG image","mime.png":"PNG image","mime.gif":"GIF image","mime.webp":"WebP image","mime.svg":"SVG image","mime.bmp":"BMP image","mime.tiff":"TIFF image","mime.avif":"AVIF image","mime.pdf":"PDF document","mime.word":"Word document","mime.excel":"Excel spreadsheet","mime.ppt":"PowerPoint presentation","mime.zip":"ZIP archive","mime.gzip":"GZIP archive","mime.tar":"TAR archive","mime.sevenz":"7z archive","mime.rar":"RAR archive","mime.text":"Text file","mime.html":"HTML file","mime.css":"CSS file","mime.js":"JavaScript file","mime.json":"JSON file","mime.xml":"XML file","mime.yaml":"YAML file","mime.binary":"Binary file","mime.executable":"Executable file","mime.folder":"Folder","mime.unknown":"Unknown","mime.file":"File","error.nameEmpty":"Name cannot be empty","error.nameInvalid":"Invalid name","error.selectCaseFirst":"Select a case first","error.vaultNotOpen":"Vault not open","delete.files":"files ({count})","file.namePrompt":"Enter file name:","file.pdfUnavailable":"PDF preview is unavailable.","file.previewUnavailable":"Preview is unavailable for this file type.","case.new":"New case","case.namePlaceholder":"Case name","settings.title":"Settings","settings.general":"General","settings.generalDesc":"Basic interface settings.","settings.workspace":"Workspace","settings.workspaceDesc":"Manage data storage.","settings.appearance":"Appearance","settings.localization":"Localization","settings.templates":"Templates","settings.plugins":"Plugins","settings.files":"Files","settings.activity":"Activity","settings.sync":"Sync","settings.backup":"Backups","settings.close":"Close settings","settings.noPlugins":"No plugins installed yet.","settings.openPluginsDir":"Open plugins folder","settings.activityStub":"Activity tracking settings will be here.","settings.backupStub":"Backup settings will be here.","settings.theme":"Interface theme","settings.themeSystem":"System","settings.themeLight":"Light","settings.themeDark":"Dark","settings.language":"Interface language","settings.langRu":"Russian","settings.langEn":"English","settings.langSoon":"coming soon","settings.save":"Save settings","settings.saved":"Settings saved","settings.vaultPath":"Workspace path","settings.noVaultInfo":"No workspace information.","settings.vaultInfo":"Workspace information","settings.openVault":"Open vault folder","settings.changeVault":"Change path","settings.checkIntegrity":"Check integrity","settings.templatesDesc":"Enable or disable templates for creating items.","settings.templateEnabled":"Enabled","settings.templateDisabled":"Disabled","settings.filesStub":"File storage settings will be here.","settings.syncEnabled":"Sync enabled","settings.syncDisabled":"Sync disabled","settings.syncDesc":"Configure connection to the sync server.","settings.serverUrl":"Server URL","settings.deviceName":"Device name","settings.deviceId":"Device ID","settings.lastSync":"Last sync","settings.lastError":"Last error","settings.pendingChanges":"Pending changes","settings.checkConnection":"Check connection","settings.syncNow":"Sync now","settings.reconnect":"Reconnect","settings.disconnect":"Disconnect device","settings.resetKey":"Reset key","settings.confirmDisconnect":"Are you sure you want to disconnect this device?","settings.confirmDisconnectDesc":"Sync will stop. Reconnecting will require username and password.","settings.confirmResetKey":"Reset sync key?","settings.confirmResetKeyDesc":"The current device key will be removed. Reconnection will be required.","settings.connected":"Connected","settings.disconnected":"Disconnected","settings.notConfigured":"Not configured","settings.error":"Error","settings.revoked":"Revoked","settings.status":"Status","firstrun.title":"Welcome to Verstak","firstrun.desc":"Verstak stores data in a local workspace called a vault.","firstrun.pathLabel":"Vault path","firstrun.defaultPath":"Default path","firstrun.browse":"Choose folder","firstrun.create":"Create workspace","firstrun.quit":"Quit","firstrun.pathExists":"The folder exists. A new vault will be created.","firstrun.pathHasVault":"Existing vault found. It will be connected.","firstrun.pathNew":"The path does not exist. A new vault will be created.","firstrun.errorNoWrite":"No write permission for the selected folder.","firstrun.creating":"Creating workspace...","firstrun.created":"Workspace created!","recovery.title":"Workspace not found","recovery.expected":"Expected path","recovery.choose":"Choose another vault","recovery.create":"Create new vault","recovery.settings":"Open settings","recovery.quit":"Quit","recovery.createConfirm":"A new empty workspace will be created. The old path in settings will be replaced.","recovery.createConfirmTitle":"Create a new workspace?","sync.status.connected":"Sync available","sync.status.disconnected":"Server unavailable","sync.status.disabled":"Sync is not configured","sync.status.syncing":"Syncing...","sync.status.error":"Sync error","sync.changes":"changes","sync.details":"Details","sync.configure":"Configure","sync.retry":"Retry","sync.run":"Sync","sync.running":"Syncing...","sync.conflictsCount":"Conflicts: {count}","sync.applyErrorsCount":"Apply errors: {count}","sync.pushedPulled":"Pushed: {pushed}, pulled: {pulled}","error.generic":"An error occurred","error.invalidCredentials":"Invalid username or password","error.accountBlocked":"Account blocked","error.emailNotConfirmed":"Email not confirmed","error.tokenInvalid":"Invalid or expired token","error.tokenExpired":"Token expired"},Do={ru:ph,en:mh};let Oo="ru";function v(n,e){var i;const t=Do[Oo];let l=t==null?void 0:t[n];if(l==null&&Oo!=="ru"&&(l=(i=Do.ru)==null?void 0:i[n]),l==null&&(l=n),e!=null)for(const[o,s]of Object.entries(e))l=l.replace(`{${o}}`,String(s));return l}function Ti(n){if(n==null||n<0)return"—";if(n===0)return"0 B";const e=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(n)/Math.log(1024)),e.length-1),l=n/Math.pow(1024,t);return(t===0?l.toFixed(0):l.toFixed(1))+" "+e[t]}const _s={"image/jpeg":v("mime.jpeg"),"image/png":v("mime.png"),"image/gif":v("mime.gif"),"image/webp":v("mime.webp"),"image/svg+xml":v("mime.svg"),"image/bmp":v("mime.bmp"),"image/tiff":v("mime.tiff"),"image/avif":v("mime.avif"),"application/pdf":v("mime.pdf"),"application/msword":v("mime.word"),"application/vnd.openxmlformats-officedocument.wordprocessingml.document":v("mime.word"),"application/vnd.ms-excel":v("mime.excel"),"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":v("mime.excel"),"application/vnd.ms-powerpoint":v("mime.ppt"),"application/vnd.openxmlformats-officedocument.presentationml.presentation":v("mime.ppt"),"application/zip":v("mime.zip"),"application/gzip":v("mime.gzip"),"application/x-tar":v("mime.tar"),"application/x-7z-compressed":v("mime.sevenz"),"application/x-rar-compressed":v("mime.rar"),"text/plain":v("mime.text"),"text/html":v("mime.html"),"text/css":v("mime.css"),"text/javascript":v("mime.js"),"application/json":v("mime.json"),"application/xml":v("mime.xml"),"application/x-yaml":v("mime.yaml"),"application/octet-stream":v("mime.binary"),"application/x-msdos-program":v("mime.executable"),"inode/directory":v("mime.folder")};function Po(n){return n?_s[n]||n:v("mime.unknown")}function gh(n){if(n.type==="folder")return v("mime.folder");const e=(n.mime||"").toLowerCase();if(_s[e])return _s[e];const l=(n.name||"").toLowerCase().split(".").pop();return l?l.toUpperCase():v("mime.file")}function If(n){if(n.type==="folder")return"folder";const e=(n.mime||"").toLowerCase();if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";if(e.startsWith("text/"))return"text";if(e.includes("pdf"))return"pdf";if(e.includes("word")||e.includes("document"))return"document";if(e.includes("spreadsheet")||e.includes("excel"))return"spreadsheet";if(e.includes("presentation")||e.includes("powerpoint"))return"presentation";if(e.includes("zip")||e.includes("tar")||e.includes("gzip")||e.includes("rar")||e.includes("7z")||e.includes("compress"))return"archive";if(e.includes("json")||e.includes("xml")||e.includes("yaml")||e.includes("javascript")||e.includes("css")||e.includes("html"))return"code";const l=(n.name||"").toLowerCase().split(".").pop();return["js","ts","jsx","tsx","vue","svelte","py","rs","go","c","cpp","h","hpp","java","kt","swift","rb","php","pl","sh","bash","zsh","fish","yml","yaml","json","xml","toml","ini","cfg","conf","md","markdown","css","scss","less","sass","sql","graphql","proto","gradle","cmake","makefile","dockerfile","env","gitignore"].includes(l)?"code":"generic"}const Mf=["image/jpeg","image/png","image/gif","image/webp","image/bmp","image/tiff","image/avif","image/svg+xml"],Lf=["text/plain","text/html","text/css","text/javascript","application/json","application/xml","application/x-yaml","text/x-shellscript"],Df=["txt","log","conf","ini","yaml","yml","json","xml","csv","sh","py","js","ts","css","html","md","markdown","cfg"],Of=["jpg","jpeg","png","gif","webp","bmp","tiff","tif","avif","svg"];function ss(n){if(n.type==="folder")return!1;const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return!!(Mf.includes(e)||Of.includes(l)||e.includes("pdf")||Lf.includes(e)||Df.includes(l))}function hh(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return Mf.includes(e)||Of.includes(l)}function _h(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return Lf.includes(e)||Df.includes(l)&&l!=="md"&&l!=="markdown"}function bh(n){return(n.mime||"").toLowerCase().includes("pdf")}function Pf(n){const e=(n.name||"").toLowerCase();return e.endsWith(".md")||e.endsWith(".markdown")}const{window:vh}=Ts;function kh(n){let e,t,l,i=Ti(n[0].size)+"",o;return{c(){e=f("span"),e.textContent="·",t=w(),l=f("span"),o=j(i),r(e,"class","meta-sep svelte-1skuef2")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),a(l,o)},p(s,c){c[0]&1&&i!==(i=Ti(s[0].size)+"")&&J(o,i)},d(s){s&&(S(e),S(t),S(l))}}}function wh(n){let e,t,l,i,o;return{c(){e=f("button"),e.innerHTML='',t=w(),l=f("button"),l.innerHTML='',r(e,"class","action-btn svelte-1skuef2"),r(e,"title",v("file.openFolder")),r(e,"aria-label",v("file.openFolder")),r(l,"class","action-btn svelte-1skuef2"),r(l,"title",v("file.showInExplorer")),r(l,"aria-label",v("file.showInExplorer"))},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),i||(o=[L(e,"click",He(n[30])),L(l,"click",He(n[11]))],i=!0)},p:oe,d(s){s&&(S(e),S(t),S(l)),i=!1,Se(o)}}}function yh(n){let e,t,l,i,o,s,c;return{c(){e=f("button"),e.innerHTML='',t=w(),l=f("button"),l.innerHTML='',i=w(),o=f("button"),o.innerHTML='',r(e,"class","action-btn svelte-1skuef2"),r(e,"title",v("file.preview")),r(e,"aria-label",v("file.preview")),r(l,"class","action-btn svelte-1skuef2"),r(l,"title",v("file.openExternal")),r(l,"aria-label",v("file.openExternal")),r(o,"class","action-btn svelte-1skuef2"),r(o,"title",v("file.showInExplorer")),r(o,"aria-label",v("file.showInExplorer"))},m(u,d){C(u,e,d),C(u,t,d),C(u,l,d),C(u,i,d),C(u,o,d),s||(c=[L(e,"click",He(n[29])),L(l,"click",He(n[10])),L(o,"click",He(n[11]))],s=!0)},p:oe,d(u){u&&(S(e),S(t),S(l),S(i),S(o)),s=!1,Se(c)}}}function zo(n){let e,t,l,i,o,s,c,u,d=v("common.open")+"",p,m,g,h,b,k,E,y,T=v("file.openExternal")+"",N,A,R,M,I,D,F=v("file.showInExplorer")+"",B,U,P,H,V,X,W,z,O,G=v("common.rename")+"",q,Y,x,ne,le,ie,me,Ne=v("common.duplicate")+"",ze,Ye,Re,te,re,Ae,Be,be,We,at=v("common.cut")+"",Te,nt,De,Ce,Fe,je,Ge,Pe=v("common.copy")+"",fe,ge,Q,he,_e,Me,rt,Qe,xe,ut=v("common.delete")+"",$,ee,we;return{c(){e=f("div"),t=w(),l=f("div"),i=f("button"),o=ae("svg"),s=ae("path"),c=ae("circle"),u=w(),p=j(d),m=w(),g=f("button"),h=ae("svg"),b=ae("path"),k=ae("polyline"),E=ae("line"),y=w(),N=j(T),A=w(),R=f("button"),M=ae("svg"),I=ae("path"),D=w(),B=j(F),U=w(),P=f("div"),H=w(),V=f("button"),X=ae("svg"),W=ae("path"),z=ae("path"),O=w(),q=j(G),Y=w(),x=f("button"),ne=ae("svg"),le=ae("rect"),ie=ae("path"),me=w(),ze=j(Ne),Ye=w(),Re=f("button"),te=ae("svg"),re=ae("circle"),Ae=ae("circle"),Be=ae("line"),be=ae("line"),We=w(),Te=j(at),nt=w(),De=f("button"),Ce=ae("svg"),Fe=ae("rect"),je=ae("path"),Ge=w(),fe=j(Pe),ge=w(),Q=f("div"),he=w(),_e=f("button"),Me=ae("svg"),rt=ae("polyline"),Qe=ae("path"),xe=w(),$=j(ut),r(e,"class","menu-backdrop svelte-1skuef2"),r(e,"role","presentation"),r(s,"d","M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"),r(c,"cx","12"),r(c,"cy","12"),r(c,"r","3"),r(o,"width","14"),r(o,"height","14"),r(o,"viewBox","0 0 24 24"),r(o,"fill","none"),r(o,"stroke","currentColor"),r(o,"stroke-width","2"),r(o,"stroke-linecap","round"),r(o,"stroke-linejoin","round"),r(i,"class","menu-item svelte-1skuef2"),r(i,"role","menuitem"),r(b,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),r(k,"points","15 3 21 3 21 9"),r(E,"x1","10"),r(E,"y1","14"),r(E,"x2","21"),r(E,"y2","3"),r(h,"width","14"),r(h,"height","14"),r(h,"viewBox","0 0 24 24"),r(h,"fill","none"),r(h,"stroke","currentColor"),r(h,"stroke-width","2"),r(h,"stroke-linecap","round"),r(h,"stroke-linejoin","round"),r(g,"class","menu-item svelte-1skuef2"),r(g,"role","menuitem"),r(I,"d","M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"),r(M,"width","14"),r(M,"height","14"),r(M,"viewBox","0 0 24 24"),r(M,"fill","none"),r(M,"stroke","currentColor"),r(M,"stroke-width","2"),r(M,"stroke-linecap","round"),r(M,"stroke-linejoin","round"),r(R,"class","menu-item svelte-1skuef2"),r(R,"role","menuitem"),r(P,"class","menu-sep svelte-1skuef2"),r(W,"d","M12 20h9"),r(z,"d","M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"),r(X,"width","14"),r(X,"height","14"),r(X,"viewBox","0 0 24 24"),r(X,"fill","none"),r(X,"stroke","currentColor"),r(X,"stroke-width","2"),r(X,"stroke-linecap","round"),r(X,"stroke-linejoin","round"),r(V,"class","menu-item svelte-1skuef2"),r(V,"role","menuitem"),r(le,"x","9"),r(le,"y","9"),r(le,"width","13"),r(le,"height","13"),r(le,"rx","2"),r(le,"ry","2"),r(ie,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),r(ne,"width","14"),r(ne,"height","14"),r(ne,"viewBox","0 0 24 24"),r(ne,"fill","none"),r(ne,"stroke","currentColor"),r(ne,"stroke-width","2"),r(ne,"stroke-linecap","round"),r(ne,"stroke-linejoin","round"),r(x,"class","menu-item svelte-1skuef2"),r(x,"role","menuitem"),r(re,"cx","6"),r(re,"cy","6"),r(re,"r","3"),r(Ae,"cx","6"),r(Ae,"cy","18"),r(Ae,"r","3"),r(Be,"x1","20"),r(Be,"y1","4"),r(Be,"x2","8.12"),r(Be,"y2","15.88"),r(be,"x1","8.12"),r(be,"y1","8.12"),r(be,"x2","20"),r(be,"y2","20"),r(te,"width","14"),r(te,"height","14"),r(te,"viewBox","0 0 24 24"),r(te,"fill","none"),r(te,"stroke","currentColor"),r(te,"stroke-width","2"),r(te,"stroke-linecap","round"),r(te,"stroke-linejoin","round"),r(Re,"class","menu-item svelte-1skuef2"),r(Re,"role","menuitem"),r(Fe,"x","9"),r(Fe,"y","9"),r(Fe,"width","13"),r(Fe,"height","13"),r(Fe,"rx","2"),r(Fe,"ry","2"),r(je,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),r(Ce,"width","14"),r(Ce,"height","14"),r(Ce,"viewBox","0 0 24 24"),r(Ce,"fill","none"),r(Ce,"stroke","currentColor"),r(Ce,"stroke-width","2"),r(Ce,"stroke-linecap","round"),r(Ce,"stroke-linejoin","round"),r(De,"class","menu-item svelte-1skuef2"),r(De,"role","menuitem"),r(Q,"class","menu-sep svelte-1skuef2"),r(rt,"points","3 6 5 6 21 6"),r(Qe,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),r(Me,"width","14"),r(Me,"height","14"),r(Me,"viewBox","0 0 24 24"),r(Me,"fill","none"),r(Me,"stroke","currentColor"),r(Me,"stroke-width","2"),r(Me,"stroke-linecap","round"),r(Me,"stroke-linejoin","round"),r(_e,"class","menu-item menu-item-danger svelte-1skuef2"),r(_e,"role","menuitem"),r(l,"class","menu svelte-1skuef2"),Xt(l,"left",n[3]+"px"),Xt(l,"top",n[4]+"px"),Xt(l,"position","fixed"),r(l,"role","menu"),r(l,"tabindex","-1")},m(Ke,pt){C(Ke,e,pt),C(Ke,t,pt),C(Ke,l,pt),a(l,i),a(i,o),a(o,s),a(o,c),a(i,u),a(i,p),a(l,m),a(l,g),a(g,h),a(h,b),a(h,k),a(h,E),a(g,y),a(g,N),a(l,A),a(l,R),a(R,M),a(M,I),a(R,D),a(R,B),a(l,U),a(l,P),a(l,H),a(l,V),a(V,X),a(X,W),a(X,z),a(V,O),a(V,q),a(l,Y),a(l,x),a(x,ne),a(ne,le),a(ne,ie),a(x,me),a(x,ze),a(l,Ye),a(l,Re),a(Re,te),a(te,re),a(te,Ae),a(te,Be),a(te,be),a(Re,We),a(Re,Te),a(l,nt),a(l,De),a(De,Ce),a(Ce,Fe),a(Ce,je),a(De,Ge),a(De,fe),a(l,ge),a(l,Q),a(l,he),a(l,_e),a(_e,Me),a(Me,rt),a(Me,Qe),a(_e,xe),a(_e,$),ee||(we=[L(e,"click",He(n[19])),L(i,"click",n[17]),L(g,"click",n[10]),L(R,"click",n[11]),L(V,"click",n[13]),L(x,"click",n[14]),L(Re,"click",n[15]),L(De,"click",n[16]),L(_e,"click",n[12]),L(l,"click",He(n[28])),L(l,"keydown",n[31])],ee=!0)},p(Ke,pt){pt[0]&8&&Xt(l,"left",Ke[3]+"px"),pt[0]&16&&Xt(l,"top",Ke[4]+"px")},d(Ke){Ke&&(S(e),S(t),S(l)),ee=!1,Se(we)}}}function Eh(n){let e,t,l,i,o,s,c=n[0].name+"",u,d,p,m,g,h,b,k,E,y,T,N,A,R,M,I,D,F,B,U,P,H;l=new Rf({props:{kind:n[6],size:22}});let V=!n[7]&&kh(n);function X(G,q){return G[7]?wh:yh}let z=X(n)(n),O=n[2]&&zo(n);return{c(){e=f("div"),t=f("div"),Ze(l.$$.fragment),i=w(),o=f("div"),s=f("div"),u=j(c),p=w(),m=f("div"),g=f("span"),g.textContent=`${n[8]}`,h=w(),V&&V.c(),b=w(),k=f("div"),z.c(),E=w(),y=f("button"),T=ae("svg"),N=ae("circle"),A=ae("circle"),R=ae("circle"),M=w(),I=f("button"),I.innerHTML='',F=w(),O&&O.c(),B=mt(),r(t,"class","file-row-icon svelte-1skuef2"),r(s,"class","file-row-name svelte-1skuef2"),r(s,"title",d=n[0].name),r(m,"class","file-row-meta svelte-1skuef2"),r(o,"class","file-row-body svelte-1skuef2"),r(N,"cx","12"),r(N,"cy","5"),r(N,"r","2"),r(A,"cx","12"),r(A,"cy","12"),r(A,"r","2"),r(R,"cx","12"),r(R,"cy","19"),r(R,"r","2"),r(T,"width","16"),r(T,"height","16"),r(T,"viewBox","0 0 24 24"),r(T,"fill","currentColor"),r(y,"class","action-btn svelte-1skuef2"),r(y,"title",v("file.more")),r(y,"aria-label",v("file.more")),r(y,"aria-expanded",n[2]),r(I,"class","action-btn action-btn-danger svelte-1skuef2"),r(I,"title",v("common.delete")),r(I,"aria-label",v("common.delete")),r(k,"class","file-row-actions svelte-1skuef2"),r(e,"class","file-row svelte-1skuef2"),r(e,"role","button"),r(e,"tabindex","0"),r(e,"draggable","true"),r(e,"aria-label",D=n[7]?v("file.ariaFolder")+" "+n[0].name:v("file.ariaFile")+" "+n[0].name),ce(e,"file-row--selected",n[1])},m(G,q){C(G,e,q),a(e,t),Ve(l,t,null),a(e,i),a(e,o),a(o,s),a(s,u),a(o,p),a(o,m),a(m,g),a(m,h),V&&V.m(m,null),a(e,b),a(e,k),z.m(k,null),a(k,E),a(k,y),a(y,T),a(T,N),a(T,A),a(T,R),a(k,M),a(k,I),C(G,F,q),O&&O.m(G,q),C(G,B,q),U=!0,P||(H=[L(vh,"click",n[19]),L(y,"click",He(n[18])),L(I,"click",He(n[12])),L(e,"click",n[9]),L(e,"keydown",n[24]),L(e,"contextmenu",n[23]),L(e,"dragstart",n[20]),L(e,"dragover",n[21]),L(e,"drop",n[22])],P=!0)},p(G,q){(!U||q[0]&1)&&c!==(c=G[0].name+"")&&J(u,c),(!U||q[0]&1&&d!==(d=G[0].name))&&r(s,"title",d),G[7]||V.p(G,q),z.p(G,q),(!U||q[0]&4)&&r(y,"aria-expanded",G[2]),(!U||q[0]&1&&D!==(D=G[7]?v("file.ariaFolder")+" "+G[0].name:v("file.ariaFile")+" "+G[0].name))&&r(e,"aria-label",D),(!U||q[0]&2)&&ce(e,"file-row--selected",G[1]),G[2]?O?O.p(G,q):(O=zo(G),O.c(),O.m(B.parentNode,B)):O&&(O.d(1),O=null)},i(G){U||(pe(l.$$.fragment,G),U=!0)},o(G){ve(l.$$.fragment,G),U=!1},d(G){G&&(S(e),S(F),S(B)),qe(l),V&&V.d(),z.d(),O&&O.d(G),P=!1,Se(H)}}}function Th(n,e,t){let{item:l}=e,{selected:i=!1}=e,{onDragStart:o}=e,{onDragOver:s}=e,{onDrop:c}=e;const u=tn(),d=If(l),p=l.type==="folder",m=gh(l);let g=!1,h=0,b=0,k=null;function E(q){q.ctrlKey||q.metaKey?u("toggleSelect",l.id):q.shiftKey?u("rangeSelect",l.id):k?(clearTimeout(k),k=null,p?u("navigate",l.id):u("preview",l)):k=setTimeout(()=>{k=null,u("selectOne",l.id)},250)}function y(){u("openExternal",l.fileId)}function T(){t(2,g=!1),u("showInFolder",l.nodeId||l.id)}function N(){t(2,g=!1),u("delete",{id:l.id,type:l.type})}function A(){t(2,g=!1),u("rename",{id:l.id,name:l.name})}function R(){t(2,g=!1),u("duplicate",l.id)}function M(){t(2,g=!1),u("cut",l.id)}function I(){t(2,g=!1),u("copy",l.id)}function D(){t(2,g=!1),p?u("navigate",l.id):u("preview",l)}function F(){t(2,g=!g)}function B(){t(2,g=!1)}function U(q){o&&o(q,l.id)}function P(q){s&&p&&s(q,l.id)}function H(q){c&&p&&c(q,l.id)}function V(q){q.preventDefault(),t(3,h=Math.min(q.clientX,window.innerWidth-240)),t(4,b=Math.min(q.clientY,window.innerHeight-320)),t(2,g=!0)}function X(q){(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),E(q))}function W(q){Cs.call(this,n,q)}const z=()=>u("preview",l),O=()=>u("navigate",l.id),G=q=>{q.key==="Escape"&&(q.stopPropagation(),B())};return n.$$set=q=>{"item"in q&&t(0,l=q.item),"selected"in q&&t(1,i=q.selected),"onDragStart"in q&&t(25,o=q.onDragStart),"onDragOver"in q&&t(26,s=q.onDragOver),"onDrop"in q&&t(27,c=q.onDrop)},[l,i,g,h,b,u,d,p,m,E,y,T,N,A,R,M,I,D,F,B,U,P,H,V,X,o,s,c,W,z,O,G]}class Sh extends tt{constructor(e){super(),et(this,e,Th,Eh,$e,{item:0,selected:1,onDragStart:25,onDragOver:26,onDrop:27},null,[-1,-1])}}function Bo(n,e,t){const l=n.slice();return l[4]=e[t],l[6]=t,l}function Ch(n){let e;return{c(){e=f("span"),e.textContent="/",r(e,"class","sep svelte-csi2lb")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Ah(n){let e,t=n[4].name+"",l,i,o;function s(){return n[2](n[6])}return{c(){e=f("button"),l=j(t),r(e,"class","crumb crumb--link svelte-csi2lb")},m(c,u){C(c,e,u),a(e,l),i||(o=L(e,"click",s),i=!0)},p(c,u){n=c,u&1&&t!==(t=n[4].name+"")&&J(l,t)},d(c){c&&S(e),i=!1,o()}}}function Nh(n){let e,t=n[4].name+"",l;return{c(){e=f("span"),l=j(t),r(e,"class","crumb crumb--current svelte-csi2lb")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&1&&t!==(t=i[4].name+"")&&J(l,t)},d(i){i&&S(e)}}}function Fo(n){let e,t,l=n[6]>0&&Ch();function i(c,u){return c[6]===c[0].length-1?Nh:Ah}let o=i(n),s=o(n);return{c(){l&&l.c(),e=w(),s.c(),t=mt()},m(c,u){l&&l.m(c,u),C(c,e,u),s.m(c,u),C(c,t,u)},p(c,u){o===(o=i(c))&&s?s.p(c,u):(s.d(1),s=o(c),s&&(s.c(),s.m(t.parentNode,t)))},d(c){c&&(S(e),S(t)),l&&l.d(c),s.d(c)}}}function Rh(n){let e,t=ye(n[0]),l=[];for(let i=0;io(c);return n.$$set=c=>{"crumbs"in c&&t(0,l=c.crumbs)},[l,o,s]}class zf extends tt{constructor(e){super(),et(this,e,Ih,Rh,$e,{crumbs:0})}}function Mh(n){let e,t,l,i,o,s;return{c(){e=f("div"),t=f("p"),t.textContent=`${v("file.previewUnavailable")}`,l=w(),i=f("button"),i.textContent=`${v("file.openExternal")}`,r(i,"class","btn btn-sm svelte-1cw3u0m"),r(e,"class","preview-status svelte-1cw3u0m")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),o||(s=L(i,"click",n[9]),o=!0)},p:oe,d(c){c&&S(e),o=!1,s()}}}function Lh(n){let e,t;function l(s,c){return c&2&&(e=null),e==null&&(e=!!(s[1]&&s[1].startsWith("data:"))),e?Fh:Bh}let i=l(n,-1),o=i(n);return{c(){o.c(),t=mt()},m(s,c){o.m(s,c),C(s,t,c)},p(s,c){i===(i=l(s,c))&&o?o.p(s,c):(o.d(1),o=i(s),o&&(o.c(),o.m(t.parentNode,t)))},d(s){s&&S(t),o.d(s)}}}function Dh(n){let e,t,l;return{c(){e=f("pre"),t=f("code"),l=j(n[1]),r(e,"class","preview-text svelte-1cw3u0m")},m(i,o){C(i,e,o),a(e,t),a(t,l)},p(i,o){o&2&&J(l,i[1])},d(i){i&&S(e)}}}function Oh(n){let e,t,l,i;return{c(){e=f("div"),t=f("img"),El(t.src,l=n[1])||r(t,"src",l),r(t,"alt",i=n[0].name),r(t,"class","preview-image svelte-1cw3u0m"),r(e,"class","preview-image-container svelte-1cw3u0m")},m(o,s){C(o,e,s),a(e,t)},p(o,s){s&2&&!El(t.src,l=o[1])&&r(t,"src",l),s&1&&i!==(i=o[0].name)&&r(t,"alt",i)},d(o){o&&S(e)}}}function Ph(n){let e,t,l,i,o,s,c;return{c(){e=f("div"),t=f("p"),l=j(n[3]),i=w(),o=f("button"),o.textContent=`${v("file.openExternal")}`,r(o,"class","btn btn-sm svelte-1cw3u0m"),r(e,"class","preview-status svelte-1cw3u0m")},m(u,d){C(u,e,d),a(e,t),a(t,l),a(e,i),a(e,o),s||(c=L(o,"click",n[9]),s=!0)},p(u,d){d&8&&J(l,u[3])},d(u){u&&S(e),s=!1,c()}}}function zh(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${v("common.loading")}`,r(e,"class","preview-status svelte-1cw3u0m")},m(l,i){C(l,e,i),a(e,t)},p:oe,d(l){l&&S(e)}}}function Bh(n){let e,t,l,i,o,s;return{c(){e=f("div"),t=f("p"),t.textContent=`${v("file.pdfUnavailable")}`,l=w(),i=f("button"),i.textContent=`${v("file.openExternal")}`,r(i,"class","btn btn-sm svelte-1cw3u0m"),r(e,"class","preview-status svelte-1cw3u0m")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),o||(s=L(i,"click",n[9]),o=!0)},p:oe,d(c){c&&S(e),o=!1,s()}}}function Fh(n){let e,t,l;return{c(){e=f("div"),t=f("embed"),El(t.src,l=n[1])||r(t,"src",l),r(t,"type","application/pdf"),r(t,"class","preview-pdf svelte-1cw3u0m"),r(e,"class","preview-pdf-container svelte-1cw3u0m")},m(i,o){C(i,e,o),a(e,t)},p(i,o){o&2&&!El(t.src,l=i[1])&&r(t,"src",l)},d(i){i&&S(e)}}}function jh(n){let e,t,l,i,o,s,c,u=n[0].name+"",d,p,m,g,h=Ti(n[0].size)+"",b,k,E=Po(n[0].mime)+"",y,T,N,A,R,M,I,D,F,B,U;o=new Rf({props:{kind:n[8],size:18}});function P(X,W){return X[2]?zh:X[3]?Ph:X[6]&&X[1]?Oh:X[5]&&X[1]?Dh:X[4]?Lh:Mh}let H=P(n),V=H(n);return{c(){e=f("div"),t=f("div"),l=f("header"),i=f("div"),Ze(o.$$.fragment),s=w(),c=f("span"),d=j(u),m=w(),g=f("div"),b=j(h),k=j(" · "),y=j(E),T=w(),N=f("div"),A=f("button"),A.innerHTML='',R=w(),M=f("button"),M.innerHTML='',I=w(),D=f("div"),V.c(),r(c,"class","preview-name svelte-1cw3u0m"),r(c,"title",p=n[0].name),r(i,"class","preview-title svelte-1cw3u0m"),r(g,"class","preview-meta svelte-1cw3u0m"),r(A,"class","action-btn svelte-1cw3u0m"),r(A,"title",v("file.openExternal")),r(A,"aria-label",v("file.openExternal")),r(M,"class","action-btn action-btn-close svelte-1cw3u0m"),r(M,"title","Close"),r(M,"aria-label","Close preview"),r(N,"class","preview-actions svelte-1cw3u0m"),r(l,"class","preview-header svelte-1cw3u0m"),r(D,"class","preview-body svelte-1cw3u0m"),r(t,"class","modal svelte-1cw3u0m"),r(e,"class","overlay svelte-1cw3u0m"),r(e,"role","presentation")},m(X,W){C(X,e,W),a(e,t),a(t,l),a(l,i),Ve(o,i,null),a(i,s),a(i,c),a(c,d),a(l,m),a(l,g),a(g,b),a(g,k),a(g,y),a(l,T),a(l,N),a(N,A),a(N,R),a(N,M),a(t,I),a(t,D),V.m(D,null),F=!0,B||(U=[L(A,"click",n[9]),L(M,"click",n[10]),L(e,"click",Kt(n[11])),L(e,"keydown",n[12])],B=!0)},p(X,[W]){(!F||W&1)&&u!==(u=X[0].name+"")&&J(d,u),(!F||W&1&&p!==(p=X[0].name))&&r(c,"title",p),(!F||W&1)&&h!==(h=Ti(X[0].size)+"")&&J(b,h),(!F||W&1)&&E!==(E=Po(X[0].mime)+"")&&J(y,E),H===(H=P(X))&&V?V.p(X,W):(V.d(1),V=H(X),V&&(V.c(),V.m(D,null)))},i(X){F||(pe(o.$$.fragment,X),F=!0)},o(X){ve(o.$$.fragment,X),F=!1},d(X){X&&S(e),qe(o),V.d(),B=!1,Se(U)}}}function Uh(n,e,t){let l,i,o,{item:s}=e,{content:c=""}=e,{loading:u=!1}=e,{error:d=""}=e;const p=tn(),m=If(s);function g(y){y.key==="Escape"&&p("close")}function h(){p("openExternal",s.fileId)}Xl(()=>{window.addEventListener("keydown",g)}),Jl(()=>{window.removeEventListener("keydown",g)});const b=()=>p("close"),k=()=>p("close"),E=y=>{y.key==="Escape"&&(y.preventDefault(),p("close"))};return n.$$set=y=>{"item"in y&&t(0,s=y.item),"content"in y&&t(1,c=y.content),"loading"in y&&t(2,u=y.loading),"error"in y&&t(3,d=y.error)},n.$$.update=()=>{n.$$.dirty&3&&t(6,l=hh(s)&&c&&c.startsWith("data:")),n.$$.dirty&1&&t(5,i=_h(s)||Pf(s)),n.$$.dirty&1&&t(4,o=bh(s))},[s,c,u,d,o,i,l,p,m,h,b,k,E]}class Bf extends tt{constructor(e){super(),et(this,e,Uh,jh,$e,{item:0,content:1,loading:2,error:3})}}function Hh(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y;return{c(){e=f("div"),t=f("div"),l=f("h3"),i=j(n[0]),o=w(),s=f("p"),c=j(n[1]),u=w(),d=f("div"),p=f("button"),m=j(n[2]),h=w(),b=f("button"),k=j(n[3]),r(l,"class","svelte-1fv6yyk"),r(s,"class","message svelte-1fv6yyk"),r(p,"class",g="btn "+(n[4]?"btn-danger":"btn-primary")+" svelte-1fv6yyk"),r(b,"class","btn svelte-1fv6yyk"),r(d,"class","actions svelte-1fv6yyk"),r(t,"class","modal svelte-1fv6yyk"),r(e,"class","overlay svelte-1fv6yyk"),r(e,"role","presentation")},m(T,N){C(T,e,N),a(e,t),a(t,l),a(l,i),a(t,o),a(t,s),a(s,c),a(t,u),a(t,d),a(d,p),a(p,m),a(d,h),a(d,b),a(b,k),E||(y=[L(p,"click",n[6]),L(b,"click",n[7]),L(e,"click",Kt(n[8])),L(e,"keydown",n[9])],E=!0)},p(T,[N]){N&1&&J(i,T[0]),N&2&&J(c,T[1]),N&4&&J(m,T[2]),N&16&&g!==(g="btn "+(T[4]?"btn-danger":"btn-primary")+" svelte-1fv6yyk")&&r(p,"class",g),N&8&&J(k,T[3])},i:oe,o:oe,d(T){T&&S(e),E=!1,Se(y)}}}function Wh(n,e,t){let{title:l=v("common.confirm")}=e,{message:i=""}=e,{confirmText:o=v("common.delete")}=e,{cancelText:s=v("common.cancel")}=e,{danger:c=!1}=e;const u=tn(),d=()=>u("confirm"),p=()=>u("cancel"),m=()=>u("cancel"),g=h=>{h.key==="Escape"&&(h.preventDefault(),u("cancel"))};return n.$$set=h=>{"title"in h&&t(0,l=h.title),"message"in h&&t(1,i=h.message),"confirmText"in h&&t(2,o=h.confirmText),"cancelText"in h&&t(3,s=h.cancelText),"danger"in h&&t(4,c=h.danger)},[l,i,o,s,c,u,d,p,m,g]}class Gh extends tt{constructor(e){super(),et(this,e,Wh,Hh,$e,{title:0,message:1,confirmText:2,cancelText:3,danger:4})}}function Kh(n){let e,t,l;return{c(){e=ae("circle"),t=ae("line"),l=ae("line"),r(e,"cx","12"),r(e,"cy","12"),r(e,"r","10"),r(t,"x1","12"),r(t,"y1","16"),r(t,"x2","12"),r(t,"y2","12"),r(l,"x1","12"),r(l,"y1","8"),r(l,"x2","12.01"),r(l,"y2","8")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function Vh(n){let e,t,l,i;return{c(){e=ae("rect"),t=ae("polyline"),l=ae("line"),i=ae("line"),r(e,"x","3"),r(e,"y","5"),r(e,"width","18"),r(e,"height","14"),r(e,"rx","2"),r(t,"points","3 10 21 10"),r(l,"x1","8"),r(l,"y1","5"),r(l,"x2","8"),r(l,"y2","19"),r(i,"x1","16"),r(i,"y1","5"),r(i,"x2","16"),r(i,"y2","19")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function qh(n){let e,t;return{c(){e=ae("path"),t=ae("polyline"),r(e,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),r(t,"points","13 2 13 9 20 9")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function Zh(n){let e,t;return{c(){e=ae("path"),t=ae("path"),r(e,"d","M12 20h9"),r(t,"d","M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function Yh(n){let e,t,l,i,o;return{c(){e=ae("path"),t=ae("path"),l=ae("line"),i=ae("line"),o=ae("line"),r(e,"d","M4 19.5A2.5 2.5 0 0 1 6.5 17H20"),r(t,"d","M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"),r(l,"x1","8"),r(l,"y1","7"),r(l,"x2","16"),r(l,"y2","7"),r(i,"x1","8"),r(i,"y1","11"),r(i,"x2","14"),r(i,"y2","11"),r(o,"x1","8"),r(o,"y1","15"),r(o,"x2","12"),r(o,"y2","15")},m(s,c){C(s,e,c),C(s,t,c),C(s,l,c),C(s,i,c),C(s,o,c)},d(s){s&&(S(e),S(t),S(l),S(i),S(o))}}}function Xh(n){let e,t,l,i;return{c(){e=ae("path"),t=ae("polyline"),l=ae("line"),i=ae("line"),r(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),r(t,"points","14 2 14 8 20 8"),r(l,"x1","16"),r(l,"y1","13"),r(l,"x2","8"),r(l,"y2","13"),r(i,"x1","16"),r(i,"y1","17"),r(i,"x2","8"),r(i,"y2","17")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function Jh(n){let e,t;return{c(){e=ae("path"),t=ae("circle"),r(e,"d","M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"),r(t,"cx","12"),r(t,"cy","7"),r(t,"r","4")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function Qh(n){let e,t,l,i;return{c(){e=ae("rect"),t=ae("rect"),l=ae("rect"),i=ae("rect"),r(e,"x","3"),r(e,"y","3"),r(e,"width","7"),r(e,"height","7"),r(e,"rx","1"),r(t,"x","14"),r(t,"y","3"),r(t,"width","7"),r(t,"height","4"),r(t,"rx","1"),r(l,"x","14"),r(l,"y","10"),r(l,"width","7"),r(l,"height","11"),r(l,"rx","1"),r(i,"x","3"),r(i,"y","14"),r(i,"width","7"),r(i,"height","7"),r(i,"rx","1")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function xh(n){let e;return{c(){e=ae("path"),r(e,"d","M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function $h(n){let e;function t(o,s){return o[0]==="folder"?xh:o[0]==="project"?Qh:o[0]==="client"?Jh:o[0]==="document"?Xh:o[0]==="recipe"?Yh:o[0]==="note"?Zh:o[0]==="file"?qh:o[0]==="case"?Vh:Kh}let l=t(n),i=l(n);return{c(){e=ae("svg"),i.c(),r(e,"width",n[1]),r(e,"height",n[1]),r(e,"viewBox","0 0 24 24"),r(e,"fill","none"),r(e,"stroke","currentColor"),r(e,"stroke-width","1.5"),r(e,"stroke-linecap","round"),r(e,"stroke-linejoin","round"),r(e,"xmlns","http://www.w3.org/2000/svg")},m(o,s){C(o,e,s),i.m(e,null)},p(o,[s]){l!==(l=t(o))&&(i.d(1),i=l(o),i&&(i.c(),i.m(e,null))),s&2&&r(e,"width",o[1]),s&2&&r(e,"height",o[1])},i:oe,o:oe,d(o){o&&S(e),i.d()}}}function e_(n,e,t){let{kind:l="generic"}=e,{size:i=18}=e;return n.$$set=o=>{"kind"in o&&t(0,l=o.kind),"size"in o&&t(1,i=o.size)},[l,i]}class Di extends tt{constructor(e){super(),et(this,e,e_,$h,$e,{kind:0,size:1})}}function jo(n,e,t){const l=n.slice();return l[44]=e[t],l}function t_(n){let e;return{c(){e=f("span"),r(e,"class","tree-toggle-placeholder svelte-zj71cl")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function n_(n){let e,t,l=n[1][n[44].id]?"▾":"▸",i,o,s;function c(){return n[25](n[44])}return{c(){e=f("button"),t=f("span"),i=j(l),r(t,"class","tree-arrow"),r(e,"class","tree-toggle svelte-zj71cl")},m(u,d){C(u,e,d),a(e,t),a(t,i),o||(s=L(e,"click",He(c)),o=!0)},p(u,d){n=u,d[0]&3&&l!==(l=n[1][n[44].id]?"▾":"▸")&&J(i,l)},d(u){u&&S(e),o=!1,s()}}}function Uo(n){let e,t;return e=new Ff({props:{nodes:n[44].children||[],expanded:n[1],selectedNodeId:n[2],level:n[3]+1,onSelect:n[4],onToggle:n[5],onContextMenu:n[6],onDrop:n[7]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const o={};i[0]&1&&(o.nodes=l[44].children||[]),i[0]&2&&(o.expanded=l[1]),i[0]&4&&(o.selectedNodeId=l[2]),i[0]&8&&(o.level=l[3]+1),i[0]&16&&(o.onSelect=l[4]),i[0]&32&&(o.onToggle=l[5]),i[0]&64&&(o.onContextMenu=l[6]),i[0]&128&&(o.onDrop=l[7]),e.$set(o)},i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function Ho(n,e){let t,l,i,o,s,c,u,d=e[44].title+"",p,m,g=e[1][e[44].id]&&bs(e[44]),h,b,k,E;function y(z,O){return O[0]&1&&(l=null),l==null&&(l=!!Hl(z[44])),l?n_:t_}let T=y(e,[-1,-1]),N=T(e);s=new Di({props:{kind:Wo(e[44]),size:16}});function A(...z){return e[26](e[44],...z)}function R(...z){return e[27](e[44],...z)}function M(){return e[28](e[44])}function I(...z){return e[29](e[44],...z)}function D(...z){return e[30](e[44],...z)}function F(...z){return e[31](e[44],...z)}function B(...z){return e[32](e[44],...z)}function U(...z){return e[33](e[44],...z)}function P(...z){return e[34](e[44],...z)}function H(...z){return e[35](e[44],...z)}function V(...z){return e[36](e[44],...z)}function X(...z){return e[37](e[44],...z)}let W=g&&Uo(e);return{key:n,first:null,c(){t=f("div"),N.c(),i=w(),o=f("span"),Ze(s.$$.fragment),c=w(),u=f("span"),p=j(d),m=w(),W&&W.c(),h=mt(),r(o,"class","tree-icon svelte-zj71cl"),r(o,"role","button"),r(o,"tabindex","-1"),r(u,"class","tree-label svelte-zj71cl"),r(u,"role","button"),r(u,"tabindex","-1"),r(t,"class","tree-item svelte-zj71cl"),Xt(t,"padding-left",e[3]*16+4+"px"),r(t,"draggable","true"),r(t,"role","button"),r(t,"tabindex","0"),ce(t,"selected",e[2]===e[44].id),ce(t,"drop-valid",e[8]===e[44].id&&e[9][e[44].id]),ce(t,"drop-invalid",e[8]===e[44].id&&!e[9][e[44].id]),this.first=t},m(z,O){C(z,t,O),N.m(t,null),a(t,i),a(t,o),Ve(s,o,null),a(t,c),a(t,u),a(u,p),C(z,m,O),W&&W.m(z,O),C(z,h,O),b=!0,k||(E=[L(o,"click",A),L(o,"keydown",R),L(o,"dblclick",He(e[24])),L(u,"click",He(M)),L(u,"keydown",I),L(t,"dragstart",D),L(t,"dragover",F),L(t,"dragleave",B),L(t,"drop",U),L(t,"click",P),L(t,"keydown",H),L(t,"dblclick",V),L(t,"contextmenu",Li(X))],k=!0)},p(z,O){e=z,T===(T=y(e,O))&&N?N.p(e,O):(N.d(1),N=T(e),N&&(N.c(),N.m(t,i)));const G={};O[0]&1&&(G.kind=Wo(e[44])),s.$set(G),(!b||O[0]&1)&&d!==(d=e[44].title+"")&&J(p,d),(!b||O[0]&8)&&Xt(t,"padding-left",e[3]*16+4+"px"),(!b||O[0]&5)&&ce(t,"selected",e[2]===e[44].id),(!b||O[0]&769)&&ce(t,"drop-valid",e[8]===e[44].id&&e[9][e[44].id]),(!b||O[0]&769)&&ce(t,"drop-invalid",e[8]===e[44].id&&!e[9][e[44].id]),O[0]&3&&(g=e[1][e[44].id]&&bs(e[44])),g?W?(W.p(e,O),O[0]&3&&pe(W,1)):(W=Uo(e),W.c(),pe(W,1),W.m(h.parentNode,h)):W&&(bt(),ve(W,1,1,()=>{W=null}),vt())},i(z){b||(pe(s.$$.fragment,z),pe(W),b=!0)},o(z){ve(s.$$.fragment,z),ve(W),b=!1},d(z){z&&(S(t),S(m),S(h)),N.d(),qe(s),W&&W.d(z),k=!1,Se(E)}}}function l_(n){let e=[],t=new Map,l,i,o,s,c=ye(n[0]);const u=d=>d[44].id;for(let d=0;d0:n.has_children===!0}function Go(n){const e={};function t(l,i){for(const o of l)e[o.id]=i,o.children&&t(o.children,o.id)}return t(n,""),e}function Ko(n){const e=[];function t(l){for(const i of l)e.push(i),i.children&&t(i.children)}return t(n),e}function i_(n){try{return n.dataTransfer.getData("text/plain")}catch{return""}}function s_(n,e,t){let l,i,o,{nodes:s=[]}=e,{expanded:c={}}=e,{selectedNodeId:u=""}=e,{level:d=0}=e,{onSelect:p=void 0}=e,{onToggle:m=void 0}=e,{onContextMenu:g=void 0}=e,{onDrop:h=void 0}=e,b={},k=null,E="",y="";const T=["folder","project","client","document","recipe","case"];Jl(()=>{for(const te of Object.keys(b))clearTimeout(b[te]);k&&clearInterval(k)});function N(te){return T.includes(te.type)}function A(te,re,Ae){if(!te||!re||re===te.id||!N(te))return!1;let Be=te.id;for(;Be;){if(Be===re)return!1;Be=Ae[Be]||""}return!0}function R(te,re){te.stopPropagation(),te.dataTransfer.effectAllowed="move",te.dataTransfer.setData("text/plain",re.id),t(21,E=re.id)}function M(te,re){te.preventDefault(),te.stopPropagation(),te.dataTransfer.dropEffect="move",y!==re.id&&t(8,y=re.id),Hl(re)&&!c[re.id]&&!b[re.id]&&(b[re.id]=setTimeout(()=>{m&&m(re.id),delete b[re.id]},600));const Ae=te.currentTarget.closest(".workspace-tree-area");if(Ae){const Be=Ae.getBoundingClientRect(),be=30;te.clientY-Be.top{Ae.scrollTop-=10},50)):Be.bottom-te.clientY{Ae.scrollTop+=10},50)):k&&(clearInterval(k),k=null)}}function I(te,re){const Ae=te.relatedTarget;Ae&&te.currentTarget.contains(Ae)||(y===re.id&&t(8,y=""),b[re.id]&&(clearTimeout(b[re.id]),delete b[re.id]),k&&(clearInterval(k),k=null))}function D(te,re){te.preventDefault(),te.stopPropagation(),b[re.id]&&(clearTimeout(b[re.id]),delete b[re.id]),k&&(clearInterval(k),k=null);const Ae=Ko(s),Be=Go(Ae),be=i_(te);if(!A(re,be,Be)){t(8,y=""),t(21,E="");return}h&&h(be,re.id),t(8,y=""),t(21,E="")}function F(){t(8,y=""),t(21,E="");for(const te of Object.keys(b))clearTimeout(b[te]),delete b[te];k&&(clearInterval(k),k=null)}function B(te,re){te.target.closest(".tree-toggle")||te.target.closest(".tree-icon")||p&&p(re)}function U(te,re){Hl(re)&&m&&m(re.id)}function P(te,re){(te.key==="Enter"||te.key===" ")&&(te.preventDefault(),p&&p(re))}function H(te,re){te.stopPropagation(),Hl(re)&&m&&m(re.id)}function V(te,re){(te.key==="Enter"||te.key===" ")&&(te.preventDefault(),te.stopPropagation(),Hl(re)&&m&&m(re.id))}function X(te,re){(te.key==="Enter"||te.key===" ")&&(te.preventDefault(),p&&p(re))}function W(te,re,Ae){const Be={};function be(We){for(const at of We)Be[at.id]=A(at,re,Ae),at.children&&be(at.children)}return be(te),Be}function z(te){Cs.call(this,n,te)}const O=te=>m&&m(te.id),G=(te,re)=>H(re,te),q=(te,re)=>V(re,te),Y=te=>p&&p(te),x=(te,re)=>X(re,te),ne=(te,re)=>R(re,te),le=(te,re)=>M(re,te),ie=(te,re)=>I(re,te),me=(te,re)=>D(re,te),Ne=(te,re)=>B(re,te),ze=(te,re)=>P(re,te),Ye=(te,re)=>U(re,te),Re=(te,re)=>g&&g(re,te);return n.$$set=te=>{"nodes"in te&&t(0,s=te.nodes),"expanded"in te&&t(1,c=te.expanded),"selectedNodeId"in te&&t(2,u=te.selectedNodeId),"level"in te&&t(3,d=te.level),"onSelect"in te&&t(4,p=te.onSelect),"onToggle"in te&&t(5,m=te.onToggle),"onContextMenu"in te&&t(6,g=te.onContextMenu),"onDrop"in te&&t(7,h=te.onDrop)},n.$$.update=()=>{n.$$.dirty[0]&1&&t(23,l=Ko(s)),n.$$.dirty[0]&8388608&&t(22,i=Go(l)),n.$$.dirty[0]&14680064&&t(9,o=W(l,E,i))},[s,c,u,d,p,m,g,h,y,o,R,M,I,D,F,B,U,P,H,V,X,E,i,l,z,O,G,q,Y,x,ne,le,ie,me,Ne,ze,Ye,Re]}class Ff extends tt{constructor(e){super(),et(this,e,s_,l_,$e,{nodes:0,expanded:1,selectedNodeId:2,level:3,onSelect:4,onToggle:5,onContextMenu:6,onDrop:7},null,[-1,-1])}}function Vo(n){let e,t;return{c(){e=f("div"),t=j(n[4]),r(e,"class","path-info svelte-a9f1pd")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&16&&J(t,l[4])},d(l){l&&S(e)}}}function qo(n){let e,t;return{c(){e=f("div"),t=j(n[3]),r(e,"class","error-msg svelte-a9f1pd")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&8&&J(t,l[3])},d(l){l&&S(e)}}}function o_(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y,T=v("firstrun.browse")+"",N,A,R,M,I,D,F=(n[2]?v("firstrun.creating"):v("firstrun.create"))+"",B,U,P,H,V,X,W=n[4]&&Vo(n),z=n[3]&&qo(n);return{c(){e=f("div"),t=f("div"),l=f("img"),o=w(),s=f("h1"),s.textContent=`${v("firstrun.title")}`,c=w(),u=f("p"),u.textContent=`${v("firstrun.desc")}`,d=w(),p=f("div"),m=f("label"),m.textContent=`${v("firstrun.pathLabel")}`,g=w(),h=f("div"),b=f("input"),E=w(),y=f("button"),N=j(T),A=w(),W&&W.c(),R=w(),z&&z.c(),M=w(),I=f("div"),D=f("button"),B=j(F),P=w(),H=f("button"),H.textContent=`${v("firstrun.quit")}`,r(l,"class","first-run-logo svelte-a9f1pd"),El(l.src,i="/assets/app-icons/icon_64x64.png")||r(l,"src",i),r(l,"width","64"),r(l,"height","64"),r(l,"alt",""),r(s,"class","svelte-a9f1pd"),r(u,"class","first-run-desc svelte-a9f1pd"),r(m,"class","form-label svelte-a9f1pd"),r(m,"for","vault-path"),r(b,"id","vault-path"),r(b,"type","text"),r(b,"placeholder",k=n[1]||v("firstrun.defaultPath")),b.disabled=n[2],r(b,"class","svelte-a9f1pd"),r(y,"class","btn"),y.disabled=n[2],r(h,"class","input-row svelte-a9f1pd"),r(p,"class","form-group svelte-a9f1pd"),r(D,"class","btn btn-primary btn-lg svelte-a9f1pd"),D.disabled=U=!n[0].trim()||n[2],r(H,"class","btn btn-lg svelte-a9f1pd"),r(I,"class","first-run-actions svelte-a9f1pd"),r(t,"class","first-run-card svelte-a9f1pd"),r(e,"class","first-run-screen svelte-a9f1pd")},m(O,G){C(O,e,G),a(e,t),a(t,l),a(t,o),a(t,s),a(t,c),a(t,u),a(t,d),a(t,p),a(p,m),a(p,g),a(p,h),a(h,b),Le(b,n[0]),a(h,E),a(h,y),a(y,N),a(t,A),W&&W.m(t,null),a(t,R),z&&z.m(t,null),a(t,M),a(t,I),a(I,D),a(D,B),a(I,P),a(I,H),V||(X=[L(b,"input",n[12]),L(b,"input",n[6]),L(b,"keydown",n[9]),L(y,"click",n[5]),L(D,"click",n[7]),L(H,"click",n[8])],V=!0)},p(O,[G]){G&2&&k!==(k=O[1]||v("firstrun.defaultPath"))&&r(b,"placeholder",k),G&4&&(b.disabled=O[2]),G&1&&b.value!==O[0]&&Le(b,O[0]),G&4&&(y.disabled=O[2]),O[4]?W?W.p(O,G):(W=Vo(O),W.c(),W.m(t,R)):W&&(W.d(1),W=null),O[3]?z?z.p(O,G):(z=qo(O),z.c(),z.m(t,M)):z&&(z.d(1),z=null),G&4&&F!==(F=(O[2]?v("firstrun.creating"):v("firstrun.create"))+"")&&J(B,F),G&5&&U!==(U=!O[0].trim()||O[2])&&(D.disabled=U)},i:oe,o:oe,d(O){O&&S(e),W&&W.d(),z&&z.d(),V=!1,Se(X)}}}function fi(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function r_(n,e,t){let{onComplete:l=null}=e,{onQuit:i=null}=e,o="",s="",c=!1,u="",d="",p=null;async function m(){try{const T=await fi("GetDefaultVaultPath");t(1,s=T||""),t(0,o=s||""),o&&await h()}catch{t(1,s="")}}m();async function g(){try{const T=await fi("PickDirectory");T&&(t(0,o=T),await h())}catch(T){t(3,u=String(T))}}async function h(){if(!o||!o.trim()){t(4,d=""),p=null;return}try{p=await fi("CheckVaultPath",o.trim()),p&&t(4,d=p.description)}catch{t(4,d=""),p=null}}async function b(){if(!(!o||!o.trim())){if(t(2,c=!0),t(3,u=""),p&&!p.writable){t(3,u=v("firstrun.errorNoWrite")),t(2,c=!1);return}try{const T=await fi("CreateVault",o.trim());T&&T.status==="ready"&&l&&l(T)}catch(T){t(3,u=String(T))}t(2,c=!1)}}function k(){i&&i()}function E(T){T.key==="Enter"&&!c&&o.trim()&&b()}function y(){o=this.value,t(0,o)}return n.$$set=T=>{"onComplete"in T&&t(10,l=T.onComplete),"onQuit"in T&&t(11,i=T.onQuit)},[o,s,c,u,d,g,h,b,k,E,l,i,y]}class a_ extends tt{constructor(e){super(),et(this,e,r_,o_,$e,{onComplete:10,onQuit:11})}}function Zo(n){let e,t;return{c(){e=f("div"),t=j(n[2]),r(e,"class","error-msg svelte-s3o8c3")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&4&&J(t,l[2])},d(l){l&&S(e)}}}function Yo(n){let e,t,l,i,o,s,c,u,d=v("common.yes")+"",p,m,g,h,b;return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${v("recovery.createConfirmTitle")}`,i=w(),o=f("p"),o.textContent=`${v("recovery.createConfirm")}`,s=w(),c=f("div"),u=f("button"),p=j(d),m=w(),g=f("button"),g.textContent=`${v("common.cancel")}`,r(l,"class","svelte-s3o8c3"),r(o,"class","modal-desc svelte-s3o8c3"),r(u,"class","btn btn-primary"),u.disabled=n[1],r(g,"class","btn"),r(c,"class","modal-actions svelte-s3o8c3"),r(t,"class","modal svelte-s3o8c3"),r(e,"class","modal-overlay svelte-s3o8c3"),r(e,"role","button"),r(e,"tabindex","0")},m(k,E){C(k,e,E),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(c,u),a(u,p),a(c,m),a(c,g),h||(b=[L(u,"click",n[6]),L(g,"click",n[7]),L(e,"click",Kt(n[7])),L(e,"keydown",n[11])],h=!0)},p(k,E){E&2&&(u.disabled=k[1])},d(k){k&&S(e),h=!1,Se(b)}}}function c_(n){let e,t,l,i,o,s,c,u,d,p=(n[0]||"—")+"",m,g,h,b,k,E=v("recovery.choose")+"",y,T,N,A=v("recovery.create")+"",R,M,I,D,F,B,U,P=n[2]&&Zo(n),H=n[3]&&Yo(n);return{c(){e=f("div"),t=f("div"),l=f("div"),l.textContent="⚠",i=w(),o=f("h1"),o.textContent=`${v("recovery.title")}`,s=w(),c=f("p"),c.textContent=`${v("recovery.expected")}:`,u=w(),d=f("code"),m=j(p),g=w(),P&&P.c(),h=w(),b=f("div"),k=f("button"),y=j(E),T=w(),N=f("button"),R=j(A),M=w(),I=f("button"),I.textContent=`${v("recovery.quit")}`,D=w(),H&&H.c(),F=mt(),r(l,"class","recovery-icon svelte-s3o8c3"),r(o,"class","svelte-s3o8c3"),r(c,"class","recovery-desc svelte-s3o8c3"),r(d,"class","recovery-path svelte-s3o8c3"),r(k,"class","btn btn-primary btn-lg svelte-s3o8c3"),k.disabled=n[1],r(N,"class","btn btn-lg svelte-s3o8c3"),N.disabled=n[1],r(I,"class","btn btn-lg svelte-s3o8c3"),r(b,"class","recovery-actions svelte-s3o8c3"),r(t,"class","recovery-card svelte-s3o8c3"),r(e,"class","recovery-screen svelte-s3o8c3")},m(V,X){C(V,e,X),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(t,u),a(t,d),a(d,m),a(t,g),P&&P.m(t,null),a(t,h),a(t,b),a(b,k),a(k,y),a(b,T),a(b,N),a(N,R),a(b,M),a(b,I),C(V,D,X),H&&H.m(V,X),C(V,F,X),B||(U=[L(k,"click",n[4]),L(N,"click",n[5]),L(I,"click",n[8])],B=!0)},p(V,[X]){X&1&&p!==(p=(V[0]||"—")+"")&&J(m,p),V[2]?P?P.p(V,X):(P=Zo(V),P.c(),P.m(t,h)):P&&(P.d(1),P=null),X&2&&(k.disabled=V[1]),X&2&&(N.disabled=V[1]),V[3]?H?H.p(V,X):(H=Yo(V),H.c(),H.m(F.parentNode,F)):H&&(H.d(1),H=null)},i:oe,o:oe,d(V){V&&(S(e),S(D),S(F)),P&&P.d(),H&&H.d(V),B=!1,Se(U)}}}function os(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function u_(n,e,t){let{vaultPath:l=""}=e,{onComplete:i=null}=e,{onQuit:o=null}=e,s=!1,c="",u=!1;async function d(){try{const k=await os("PickDirectory");if(!k)return;t(1,s=!0),t(2,c="");const E=await os("OpenVault",k);E&&E.status==="ready"&&i&&i(E)}catch(k){t(2,c=String(k))}t(1,s=!1)}function p(){t(3,u=!0)}async function m(){t(3,u=!1),t(1,s=!0),t(2,c="");try{const k=await os("CreateVault",l);k&&k.status==="ready"&&i&&i(k)}catch(k){t(2,c=String(k))}t(1,s=!1)}function g(){t(3,u=!1)}function h(){o&&o()}const b=k=>k.key==="Enter"&&g();return n.$$set=k=>{"vaultPath"in k&&t(0,l=k.vaultPath),"onComplete"in k&&t(9,i=k.onComplete),"onQuit"in k&&t(10,o=k.onQuit)},[l,s,c,u,d,p,m,g,h,i,o,b]}class f_ extends tt{constructor(e){super(),et(this,e,u_,c_,$e,{vaultPath:0,onComplete:9,onQuit:10})}}function Xo(n,e,t){const l=n.slice();return l[5]=e[t],l}function d_(n){let e,t;return{c(){e=ae("circle"),t=ae("path"),r(e,"cx","12"),r(e,"cy","12"),r(e,"r","3"),r(t,"d","M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function p_(n){let e,t,l;return{c(){e=ae("path"),t=ae("path"),l=ae("path"),r(e,"d","M5 4h12l2 2v14H5z"),r(t,"d","M8 4v6h8V4"),r(l,"d","M8 20v-6h8v6")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function m_(n){let e,t,l,i;return{c(){e=ae("path"),t=ae("path"),l=ae("path"),i=ae("path"),r(e,"d","M20 11a8 8 0 0 0-14-4l-2 2"),r(t,"d","M4 5v4h4"),r(l,"d","M4 13a8 8 0 0 0 14 4l2-2"),r(i,"d","M20 19v-4h-4")},m(o,s){C(o,e,s),C(o,t,s),C(o,l,s),C(o,i,s)},d(o){o&&(S(e),S(t),S(l),S(i))}}}function g_(n){let e;return{c(){e=ae("path"),r(e,"d","M4 19V9M10 19V5M16 19v-7M22 19H2")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function h_(n){let e;return{c(){e=ae("path"),r(e,"d","M3 6h6l2 2h10v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6z")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function __(n){let e,t;return{c(){e=ae("path"),t=ae("path"),r(e,"d","M9 3v5M15 3v5M7 8h10v3a5 5 0 0 1-10 0V8z"),r(t,"d","M12 16v5")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function b_(n){let e,t;return{c(){e=ae("rect"),t=ae("path"),r(e,"x","4"),r(e,"y","3"),r(e,"width","16"),r(e,"height","18"),r(e,"rx","2"),r(t,"d","M8 7h8M8 11h8M8 15h5")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function v_(n){let e,t,l;return{c(){e=ae("path"),t=ae("path"),l=ae("path"),r(e,"d","M3 10.5 12 3l9 7.5"),r(t,"d","M5 9.5V21h14V9.5"),r(l,"d","M10 21v-6h4v6")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},d(i){i&&(S(e),S(t),S(l))}}}function k_(n){let e,t;return{c(){e=ae("circle"),t=ae("path"),r(e,"cx","12"),r(e,"cy","12"),r(e,"r","3"),r(t,"d","M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 0 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V22h-4v-.2a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 0 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H2v-4h.2a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 0 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3 1.7 1.7 0 0 0 1-1.5V2h4v.2a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 0 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8 1.7 1.7 0 0 0 1.5 1h.2v4h-.2a1.7 1.7 0 0 0-1.4 1z")},m(l,i){C(l,e,i),C(l,t,i)},d(l){l&&(S(e),S(t))}}}function Jo(n){let e,t,l,i,o,s,c,u;function d(h,b){if(h[5].id==="general")return k_;if(h[5].id==="workspace")return v_;if(h[5].id==="templates")return b_;if(h[5].id==="plugins")return __;if(h[5].id==="files")return h_;if(h[5].id==="activity")return g_;if(h[5].id==="sync")return m_;if(h[5].id==="backup")return p_;if(h[5].id==="browserBridge")return d_}let p=d(n),m=p&&p(n);function g(){return n[4](n[5])}return{c(){e=f("button"),t=f("span"),l=ae("svg"),m&&m.c(),i=w(),o=f("span"),o.textContent=`${n[5].label}`,s=w(),r(l,"width","16"),r(l,"height","16"),r(l,"viewBox","0 0 24 24"),r(l,"fill","none"),r(l,"stroke","currentColor"),r(l,"stroke-width","1.8"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"aria-hidden","true"),r(t,"class","settings-nav-icon svelte-8ag2z0"),r(o,"class","settings-nav-label svelte-8ag2z0"),r(e,"class","settings-nav-item svelte-8ag2z0"),ce(e,"active",n[0]===n[5].id),ce(e,"disabled",n[5].id==="files"||n[5].id==="activity"||n[5].id==="backup")},m(h,b){C(h,e,b),a(e,t),a(t,l),m&&m.m(l,null),a(e,i),a(e,o),a(e,s),c||(u=L(e,"click",g),c=!0)},p(h,b){n=h,b&3&&ce(e,"active",n[0]===n[5].id)},d(h){h&&S(e),m&&m.d(),c=!1,u()}}}function w_(n){let e,t=ye(n[1]),l=[];for(let i=0;is(u.id);return n.$$set=u=>{"activeSection"in u&&t(0,l=u.activeSection),"onSelect"in u&&t(3,i=u.onSelect)},[l,o,s,i,c]}class E_ extends tt{constructor(e){super(),et(this,e,y_,w_,$e,{activeSection:0,onSelect:3})}}function Qo(n){let e;return{c(){e=f("div"),e.textContent=`${v("settings.saved")}`,r(e,"class","save-notice svelte-1e2uhdh")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function T_(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y,T,N,A,R,M,I,D,F,B,U,P,H,V,X,W,z,O=n[1]&&Qo();return{c(){e=f("div"),t=f("h2"),t.textContent=`${v("settings.general")}`,l=w(),i=f("p"),i.textContent=`${v("settings.generalDesc")}`,o=w(),s=f("div"),c=f("h3"),c.textContent=`${v("settings.appearance")}`,u=w(),d=f("div"),p=f("label"),m=f("span"),m.textContent=`${v("settings.theme")}`,g=w(),h=f("select"),b=f("option"),b.textContent=`${v("settings.themeSystem")}`,k=f("option"),k.textContent=`${v("settings.themeLight")} (${v("settings.langSoon")})`,E=f("option"),E.textContent=`${v("settings.themeDark")} (${v("settings.langSoon")})`,y=w(),T=f("div"),N=f("h3"),N.textContent=`${v("settings.localization")}`,A=w(),R=f("div"),M=f("label"),I=f("span"),I.textContent=`${v("settings.language")}`,D=w(),F=f("select"),B=f("option"),B.textContent=`${v("settings.langRu")}`,U=f("option"),U.textContent=`${v("settings.langEn")} (${v("settings.langSoon")})`,P=w(),H=f("div"),O&&O.c(),V=w(),X=f("button"),X.textContent=`${v("settings.save")}`,r(t,"class","svelte-1e2uhdh"),r(i,"class","section-desc svelte-1e2uhdh"),r(c,"class","card-title svelte-1e2uhdh"),r(m,"class","label-text svelte-1e2uhdh"),b.__value="system",Le(b,b.__value),k.__value="light",Le(k,k.__value),k.disabled=!0,E.__value="dark",Le(E,E.__value),E.disabled=!0,n[0]===void 0&&il(()=>n[5].call(h)),r(d,"class","form-group svelte-1e2uhdh"),r(s,"class","settings-card svelte-1e2uhdh"),r(N,"class","card-title svelte-1e2uhdh"),r(I,"class","label-text svelte-1e2uhdh"),B.__value="ru",Le(B,B.__value),U.__value="en",Le(U,U.__value),F.disabled=!0,r(R,"class","form-group svelte-1e2uhdh"),r(T,"class","settings-card svelte-1e2uhdh"),r(X,"class","btn btn-primary"),r(H,"class","settings-actions svelte-1e2uhdh"),r(e,"class","settings-section svelte-1e2uhdh")},m(G,q){C(G,e,q),a(e,t),a(e,l),a(e,i),a(e,o),a(e,s),a(s,c),a(s,u),a(s,d),a(d,p),a(p,m),a(p,g),a(p,h),a(h,b),a(h,k),a(h,E),jn(h,n[0],!0),a(e,y),a(e,T),a(T,N),a(T,A),a(T,R),a(R,M),a(M,I),a(M,D),a(M,F),a(F,B),a(F,U),a(e,P),a(e,H),O&&O.m(H,null),a(H,V),a(H,X),W||(z=[L(h,"change",n[5]),L(X,"click",n[2])],W=!0)},p(G,[q]){q&1&&jn(h,G[0]),G[1]?O||(O=Qo(),O.c(),O.m(H,V)):O&&(O.d(1),O=null)},i:oe,o:oe,d(G){G&&S(e),O&&O.d(),W=!1,Se(z)}}}function S_(n,e,t){let{appConfig:l=null}=e,{onSave:i=null}=e,o="system",s=!1;function c(){l&&t(0,o=l.theme||"system")}async function u(){l&&(t(3,l.theme=o,l),i&&await i(l),t(1,s=!0),setTimeout(()=>t(1,s=!1),2e3))}function d(){o=vi(this),t(0,o)}return n.$$set=p=>{"appConfig"in p&&t(3,l=p.appConfig),"onSave"in p&&t(4,i=p.onSave)},n.$$.update=()=>{n.$$.dirty&8&&l&&c()},[o,s,u,l,i,d]}class C_ extends tt{constructor(e){super(),et(this,e,S_,T_,$e,{appConfig:3,onSave:4})}}function xo(n){let e,t;return{c(){e=f("div"),t=j(n[1]),r(e,"class","notice svelte-1zbky3")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&2&&J(t,l[1])},d(l){l&&S(e)}}}function A_(n){let e;return{c(){e=f("p"),e.textContent=`${v("settings.noVaultInfo")}`,r(e,"class","no-data svelte-1zbky3")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function N_(n){let e,t,l,i,o,s=n[0].path+"",c,u,d,p,m,g,h=n[0].dbPath+"",b,k,E,y=n[0].nodeCount!==void 0&&$o(n),T=n[0].fileCount!==void 0&&er(n);return{c(){e=f("div"),t=f("div"),l=f("span"),l.textContent=`${v("settings.vaultPath")}`,i=w(),o=f("span"),c=j(s),u=w(),d=f("div"),p=f("span"),p.textContent="DB",m=w(),g=f("span"),b=j(h),k=w(),y&&y.c(),E=w(),T&&T.c(),r(l,"class","info-label svelte-1zbky3"),r(o,"class","info-value mono svelte-1zbky3"),r(t,"class","info-row svelte-1zbky3"),r(p,"class","info-label svelte-1zbky3"),r(g,"class","info-value mono small svelte-1zbky3"),r(d,"class","info-row svelte-1zbky3"),r(e,"class","vault-info svelte-1zbky3")},m(N,A){C(N,e,A),a(e,t),a(t,l),a(t,i),a(t,o),a(o,c),a(e,u),a(e,d),a(d,p),a(d,m),a(d,g),a(g,b),a(e,k),y&&y.m(e,null),a(e,E),T&&T.m(e,null)},p(N,A){A&1&&s!==(s=N[0].path+"")&&J(c,s),A&1&&h!==(h=N[0].dbPath+"")&&J(b,h),N[0].nodeCount!==void 0?y?y.p(N,A):(y=$o(N),y.c(),y.m(e,E)):y&&(y.d(1),y=null),N[0].fileCount!==void 0?T?T.p(N,A):(T=er(N),T.c(),T.m(e,null)):T&&(T.d(1),T=null)},d(N){N&&S(e),y&&y.d(),T&&T.d()}}}function $o(n){let e,t,l,i,o=n[0].nodeCount+"",s;return{c(){e=f("div"),t=f("span"),t.textContent="Nodes",l=w(),i=f("span"),s=j(o),r(t,"class","info-label svelte-1zbky3"),r(i,"class","info-value svelte-1zbky3"),r(e,"class","info-row svelte-1zbky3")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u&1&&o!==(o=c[0].nodeCount+"")&&J(s,o)},d(c){c&&S(e)}}}function er(n){let e,t,l,i,o=n[0].fileCount+"",s;return{c(){e=f("div"),t=f("span"),t.textContent="Files",l=w(),i=f("span"),s=j(o),r(t,"class","info-label svelte-1zbky3"),r(i,"class","info-value svelte-1zbky3"),r(e,"class","info-row svelte-1zbky3")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u&1&&o!==(o=c[0].fileCount+"")&&J(s,o)},d(c){c&&S(e)}}}function R_(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y=n[1]&&xo(n);function T(R,M){return R[0]?N_:A_}let N=T(n),A=N(n);return{c(){e=f("div"),t=f("h2"),t.textContent=`${v("settings.workspace")}`,l=w(),i=f("p"),i.textContent=`${v("settings.workspaceDesc")}`,o=w(),y&&y.c(),s=w(),c=f("div"),A.c(),u=w(),d=f("div"),p=f("button"),p.textContent=`${v("settings.openVault")}`,m=w(),g=f("button"),g.textContent=`${v("settings.changeVault")}`,h=w(),b=f("button"),b.textContent=`${v("settings.checkIntegrity")}`,r(t,"class","svelte-1zbky3"),r(i,"class","section-desc svelte-1zbky3"),r(c,"class","settings-card svelte-1zbky3"),r(p,"class","btn svelte-1zbky3"),r(g,"class","btn svelte-1zbky3"),r(b,"class","btn svelte-1zbky3"),r(d,"class","workspace-actions svelte-1zbky3"),r(e,"class","settings-section svelte-1zbky3")},m(R,M){C(R,e,M),a(e,t),a(e,l),a(e,i),a(e,o),y&&y.m(e,null),a(e,s),a(e,c),A.m(c,null),a(e,u),a(e,d),a(d,p),a(d,m),a(d,g),a(d,h),a(d,b),k||(E=[L(p,"click",n[2]),L(g,"click",n[4]),L(b,"click",n[3])],k=!0)},p(R,[M]){R[1]?y?y.p(R,M):(y=xo(R),y.c(),y.m(e,s)):y&&(y.d(1),y=null),N===(N=T(R))&&A?A.p(R,M):(A.d(1),A=N(R),A&&(A.c(),A.m(c,null)))},i:oe,o:oe,d(R){R&&S(e),y&&y.d(),A.d(),k=!1,Se(E)}}}function hl(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function I_(n,e,t){let{onRefresh:l=null}=e,i=null,o="";async function s(){try{t(0,i=await hl("GetVaultInfo"))}catch{t(0,i=null)}}s();async function c(){try{await hl("OpenVaultFolder")}catch(p){t(1,o=String(p))}}async function u(){try{const p=await hl("VaultCheck");p.healthy?t(1,o="Vault healthy"):t(1,o="Issues found: "+(p.errors||[]).join("; "))}catch(p){t(1,o=String(p))}}async function d(){try{const p=await hl("PickDirectory");if(!p)return;const m=await hl("OpenVault",p);m&&m.status==="ready"&&(t(0,i=await hl("GetVaultInfo")),l&&l())}catch(p){t(1,o=String(p))}}return n.$$set=p=>{"onRefresh"in p&&t(5,l=p.onRefresh)},[i,o,c,u,d,l]}class M_ extends tt{constructor(e){super(),et(this,e,I_,R_,$e,{onRefresh:5})}}function tr(n,e,t){const l=n.slice();return l[6]=e[t],l}function L_(n){let e,t=ye(n[0]),l=[];for(let i=0;ic(d);return n.$$set=d=>{"onRefresh"in d&&t(3,l=d.onRefresh)},[i,o,c,l,u]}class B_ extends tt{constructor(e){super(),et(this,e,z_,P_,$e,{onRefresh:3})}}function ir(n,e,t){const l=n.slice();return l[12]=e[t],l}function F_(n){let e,t=ye(n[0]),l=[];for(let i=0;iНет установленных плагинов.

Создайте папку .verstak/plugins/ в хранилище и добавьте туда плагины.

',r(e,"class","empty-state svelte-i9gngw")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function U_(n){let e,t;return{c(){e=f("p"),t=j(n[2]),r(e,"class","error svelte-i9gngw")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&4&&J(t,l[2])},d(l){l&&S(e)}}}function H_(n){let e;return{c(){e=f("p"),e.textContent=`${v("common.loading")}`,r(e,"class","loading svelte-i9gngw")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function sr(n){let e,t,l=n[12].version+"",i;return{c(){e=f("span"),t=j("v"),i=j(l),r(e,"class","plugin-version svelte-i9gngw")},m(o,s){C(o,e,s),a(e,t),a(e,i)},p(o,s){s&1&&l!==(l=o[12].version+"")&&J(i,l)},d(o){o&&S(e)}}}function or(n){let e,t=n[12].description+"",l;return{c(){e=f("div"),l=j(t),r(e,"class","plugin-desc svelte-i9gngw")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&1&&t!==(t=i[12].description+"")&&J(l,t)},d(i){i&&S(e)}}}function rr(n){let e,t=(v("settings.author")||"Автор")+"",l,i,o=n[12].author+"",s;return{c(){e=f("span"),l=j(t),i=j(": "),s=j(o)},m(c,u){C(c,e,u),a(e,l),a(e,i),a(e,s)},p(c,u){u&1&&o!==(o=c[12].author+"")&&J(s,o)},d(c){c&&S(e)}}}function ar(n){let e,t=n[12].uiContribs.sidebarItems.length+"",l,i;return{c(){e=f("span"),l=j(t),i=j(" пункт(а) в сайдбаре")},m(o,s){C(o,e,s),a(e,l),a(e,i)},p(o,s){s&1&&t!==(t=o[12].uiContribs.sidebarItems.length+"")&&J(l,t)},d(o){o&&S(e)}}}function cr(n){let e,t=n[12].uiContribs.nodeTabs.length+"",l,i;return{c(){e=f("span"),l=j(t),i=j(" вкладок(и) в карточке дела")},m(o,s){C(o,e,s),a(e,l),a(e,i)},p(o,s){s&1&&t!==(t=o[12].uiContribs.nodeTabs.length+"")&&J(l,t)},d(o){o&&S(e)}}}function ur(n){let e;return{c(){e=f("span"),e.textContent="🗖 HTML-панель"},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function W_(n){let e,t,l,i,o,s,c,u;function d(){return n[8](n[12])}function p(){return n[9](n[12])}return{c(){e=f("div"),t=f("button"),l=f("span"),o=w(),s=f("button"),s.textContent="🗑",r(l,"class","toggle-knob svelte-i9gngw"),r(t,"class","toggle-btn svelte-i9gngw"),r(t,"role","switch"),r(t,"aria-checked",i=n[12].active),ce(t,"active",n[12].active),r(s,"class","uninstall-btn btn-sm svelte-i9gngw"),r(s,"title","Удалить плагин (очистить данные)"),r(e,"class","toggle-group svelte-i9gngw")},m(m,g){C(m,e,g),a(e,t),a(t,l),a(e,o),a(e,s),c||(u=[L(t,"click",d),L(s,"click",p)],c=!0)},p(m,g){n=m,g&1&&i!==(i=n[12].active)&&r(t,"aria-checked",i),g&1&&ce(t,"active",n[12].active)},d(m){m&&S(e),c=!1,Se(u)}}}function G_(n){let e,t,l;function i(){return n[7](n[12])}return{c(){e=f("button"),e.textContent="📦 Установить",r(e,"class","install-btn svelte-i9gngw")},m(o,s){C(o,e,s),t||(l=L(e,"click",i),t=!0)},p(o,s){n=o},d(o){o&&S(e),t=!1,l()}}}function fr(n){var F,B,U,P;let e,t,l,i=n[12].name+"",o,s,c,u,d,p,m,g,h,b,k,E=n[12].version&&sr(n),y=n[12].description&&or(n),T=n[12].author&&rr(n),N=((B=(F=n[12].uiContribs)==null?void 0:F.sidebarItems)==null?void 0:B.length)&&ar(n),A=((P=(U=n[12].uiContribs)==null?void 0:U.nodeTabs)==null?void 0:P.length)&&cr(n),R=n[12].hasPanel&&ur();function M(H,V){return H[12].installed?W_:G_}let I=M(n),D=I(n);return{c(){e=f("div"),t=f("div"),l=f("div"),o=j(i),s=w(),E&&E.c(),c=w(),y&&y.c(),u=w(),d=f("div"),T&&T.c(),p=w(),N&&N.c(),m=w(),A&&A.c(),g=w(),R&&R.c(),h=w(),b=f("div"),D.c(),k=w(),r(l,"class","plugin-name svelte-i9gngw"),r(d,"class","plugin-meta svelte-i9gngw"),r(t,"class","plugin-info svelte-i9gngw"),r(b,"class","plugin-toggle svelte-i9gngw"),r(e,"class","plugin-card svelte-i9gngw")},m(H,V){C(H,e,V),a(e,t),a(t,l),a(l,o),a(l,s),E&&E.m(l,null),a(t,c),y&&y.m(t,null),a(t,u),a(t,d),T&&T.m(d,null),a(d,p),N&&N.m(d,null),a(d,m),A&&A.m(d,null),a(d,g),R&&R.m(d,null),a(e,h),a(e,b),D.m(b,null),a(e,k)},p(H,V){var X,W,z,O;V&1&&i!==(i=H[12].name+"")&&J(o,i),H[12].version?E?E.p(H,V):(E=sr(H),E.c(),E.m(l,null)):E&&(E.d(1),E=null),H[12].description?y?y.p(H,V):(y=or(H),y.c(),y.m(t,u)):y&&(y.d(1),y=null),H[12].author?T?T.p(H,V):(T=rr(H),T.c(),T.m(d,p)):T&&(T.d(1),T=null),(W=(X=H[12].uiContribs)==null?void 0:X.sidebarItems)!=null&&W.length?N?N.p(H,V):(N=ar(H),N.c(),N.m(d,m)):N&&(N.d(1),N=null),(O=(z=H[12].uiContribs)==null?void 0:z.nodeTabs)!=null&&O.length?A?A.p(H,V):(A=cr(H),A.c(),A.m(d,g)):A&&(A.d(1),A=null),H[12].hasPanel?R||(R=ur(),R.c(),R.m(d,null)):R&&(R.d(1),R=null),I===(I=M(H))&&D?D.p(H,V):(D.d(1),D=I(H),D&&(D.c(),D.m(b,null)))},d(H){H&&S(e),E&&E.d(),y&&y.d(),T&&T.d(),N&&N.d(),A&&A.d(),R&&R.d(),D.d()}}}function K_(n){let e,t,l,i,o;function s(d,p){return d[1]?H_:d[2]?U_:d[0].length===0?j_:F_}let c=s(n),u=c(n);return{c(){e=f("div"),t=f("h3"),t.textContent=`${v("settings.plugins")||"Плагины"}`,l=w(),i=f("p"),i.textContent="Включение и отключение плагинов. Изменения применяются сразу.",o=w(),u.c(),r(t,"class","svelte-i9gngw"),r(i,"class","hint svelte-i9gngw"),r(e,"class","settings-plugins svelte-i9gngw")},m(d,p){C(d,e,p),a(e,t),a(e,l),a(e,i),a(e,o),u.m(e,null)},p(d,[p]){c===(c=s(d))&&u?u.p(d,p):(u.d(1),u=c(d),u&&(u.c(),u.m(e,null)))},i:oe,o:oe,d(d){d&&S(e),u.d()}}}function Jn(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function V_(n,e,t){let{onPluginToggle:l=null}=e,i=[],o=!0,s="";Xl(async()=>{try{t(0,i=await Jn("ListPlugins")||[])}catch(h){t(2,s=String(h))}t(1,o=!1)});async function c(h){const b=!h.active;try{await Jn("SetPluginEnabled",h.name,b),t(0,i=await Jn("ListPlugins")||[]),l&&l()}catch(k){t(2,s=String(k))}}async function u(h){t(2,s="");try{await Jn("InstallPlugin",h.name),h.installed=!0,t(0,i=await Jn("ListPlugins")||[]),l&&l()}catch(b){t(2,s=String(b))}}async function d(h){if(confirm(`Удалить плагин «${h.name}»? Все данные плагина будут очищены. Файлы плагина сохранятся.`)){t(2,s="");try{await Jn("UninstallPlugin",h.name),h.installed=!1,h.active=!1,t(0,i=await Jn("ListPlugins")||[]),l&&l()}catch(b){t(2,s=String(b))}}}const p=h=>u(h),m=h=>c(h),g=h=>d(h);return n.$$set=h=>{"onPluginToggle"in h&&t(6,l=h.onPluginToggle)},n.$$.update=()=>{n.$$.dirty&1&&i.reduce((h,b)=>{var k,E;return h+(((E=(k=b.uiContribs)==null?void 0:k.sidebarItems)==null?void 0:E.length)||0)},0),n.$$.dirty&1&&i.reduce((h,b)=>{var k,E;return h+(((E=(k=b.uiContribs)==null?void 0:k.nodeTabs)==null?void 0:E.length)||0)},0)},[i,o,s,c,u,d,l,p,m,g]}class q_ extends tt{constructor(e){super(),et(this,e,V_,K_,$e,{onPluginToggle:6})}}function Z_(n){let e,t,l,i;return{c(){e=f("div"),t=f("h2"),t.textContent=`${v("settings.files")}`,l=w(),i=f("p"),i.textContent=`${v("settings.filesStub")}`,r(t,"class","svelte-19bo7bn"),r(i,"class","section-desc svelte-19bo7bn"),r(e,"class","settings-section svelte-19bo7bn")},m(o,s){C(o,e,s),a(e,t),a(e,l),a(e,i)},p:oe,i:oe,o:oe,d(o){o&&S(e)}}}class Y_ extends tt{constructor(e){super(),et(this,e,null,Z_,$e,{})}}function X_(n){let e,t,l,i;return{c(){e=f("div"),t=f("h2"),t.textContent=`${v("settings.activity")}`,l=w(),i=f("p"),i.textContent=`${v("settings.activityStub")}`,r(t,"class","svelte-19bo7bn"),r(i,"class","section-desc svelte-19bo7bn"),r(e,"class","settings-section svelte-19bo7bn")},m(o,s){C(o,e,s),a(e,t),a(e,l),a(e,i)},p:oe,i:oe,o:oe,d(o){o&&S(e)}}}class J_ extends tt{constructor(e){super(),et(this,e,null,X_,$e,{})}}function dr(n){let e,t;return{c(){e=f("div"),t=j(n[2]),r(e,"class","error-msg svelte-1fx1e1e")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[0]&4&&J(t,l[2])},d(l){l&&S(e)}}}function pr(n){let e,t;return{c(){e=f("div"),t=j(n[3]),r(e,"class","result-msg svelte-1fx1e1e"),ce(e,"warning",n[4]==="warning")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[0]&8&&J(t,l[3]),i[0]&16&&ce(e,"warning",l[4]==="warning")},d(l){l&&S(e)}}}function Q_(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y,T,N,A,R,M,I=v("settings.checkConnection")+"",D,F,B,U,P=v("common.connect")+"",H,V,X,W,z,O=n[11]!==null&&mr(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("label"),o=f("span"),o.textContent=`${v("settings.serverUrl")}`,s=w(),c=f("input"),u=w(),d=f("div"),p=f("label"),m=f("span"),m.textContent=`${v("sync.username")}`,g=w(),h=f("input"),b=w(),k=f("div"),E=f("label"),y=f("span"),y.textContent=`${v("sync.password")}`,T=w(),N=f("input"),A=w(),R=f("div"),M=f("button"),D=j(I),B=w(),U=f("button"),H=j(P),X=w(),O&&O.c(),r(o,"class","label-text"),r(c,"type","text"),r(c,"placeholder","https://example.com"),r(l,"class","form-group svelte-1fx1e1e"),r(m,"class","label-text"),r(h,"type","text"),r(d,"class","form-group svelte-1fx1e1e"),r(y,"class","label-text"),r(N,"type","password"),r(k,"class","form-group svelte-1fx1e1e"),r(M,"class","btn"),M.disabled=F=n[1]||!n[5],r(U,"class","btn btn-primary"),U.disabled=V=n[1]||!n[5]||!n[6]||!n[7],r(R,"class","sync-setup-actions svelte-1fx1e1e"),r(t,"class","sync-setup svelte-1fx1e1e"),r(e,"class","settings-card svelte-1fx1e1e")},m(G,q){C(G,e,q),a(e,t),a(t,l),a(l,i),a(i,o),a(i,s),a(i,c),Le(c,n[5]),a(t,u),a(t,d),a(d,p),a(p,m),a(p,g),a(p,h),Le(h,n[6]),a(t,b),a(t,k),a(k,E),a(E,y),a(E,T),a(E,N),Le(N,n[7]),a(t,A),a(t,R),a(R,M),a(M,D),a(R,B),a(R,U),a(U,H),a(t,X),O&&O.m(t,null),W||(z=[L(c,"input",n[23]),L(h,"input",n[24]),L(N,"input",n[25]),L(M,"click",n[12]),L(U,"click",n[13])],W=!0)},p(G,q){q[0]&32&&c.value!==G[5]&&Le(c,G[5]),q[0]&64&&h.value!==G[6]&&Le(h,G[6]),q[0]&128&&N.value!==G[7]&&Le(N,G[7]),q[0]&34&&F!==(F=G[1]||!G[5])&&(M.disabled=F),q[0]&226&&V!==(V=G[1]||!G[5]||!G[6]||!G[7])&&(U.disabled=V),G[11]!==null?O?O.p(G,q):(O=mr(G),O.c(),O.m(t,null)):O&&(O.d(1),O=null)},d(G){G&&S(e),O&&O.d(),W=!1,Se(z)}}}function x_(n){let e,t,l,i,o,s,c=n[20](n[0].lastStatus)+"",u,d,p,m,g,h,b,k,E,y=v("settings.syncNow")+"",T,N,A,R=v("settings.disconnect")+"",M,I,D,F=v("settings.resetKey")+"",B,U,P,H,V,X,W,z,O,G,q,Y,x=n[0].serverUrl&&gr(n),ne=n[0].deviceName&&hr(n),le=n[0].deviceId&&_r(n),ie=n[0].lastSyncAt&&br(n),me=n[0].lastError&&vr(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("span"),i.textContent=`${v("settings.status")}`,o=w(),s=f("span"),u=j(c),d=w(),x&&x.c(),p=w(),ne&&ne.c(),m=w(),le&&le.c(),g=w(),ie&&ie.c(),h=w(),me&&me.c(),b=w(),k=f("div"),E=f("button"),T=j(y),N=w(),A=f("button"),M=j(R),I=w(),D=f("button"),B=j(F),U=w(),P=f("div"),H=f("label"),V=f("span"),V.textContent=`${v("sync.interval")}`,X=w(),W=f("div"),z=f("input"),O=w(),G=f("button"),G.textContent=`${v("common.save")}`,r(i,"class","info-label svelte-1fx1e1e"),r(s,"class","info-value svelte-1fx1e1e"),ce(s,"status-ok",n[0].lastStatus==="connected"),ce(s,"status-err",n[0].lastStatus==="error"||n[0].lastStatus==="revoked"),r(l,"class","info-row svelte-1fx1e1e"),r(t,"class","sync-info svelte-1fx1e1e"),r(e,"class","settings-card svelte-1fx1e1e"),r(E,"class","btn btn-primary"),E.disabled=n[1],r(A,"class","btn"),A.disabled=n[1],r(D,"class","btn"),D.disabled=n[1],r(k,"class","sync-actions svelte-1fx1e1e"),r(V,"class","label-text"),r(z,"type","number"),r(z,"min","0"),r(z,"placeholder","0"),r(z,"class","svelte-1fx1e1e"),r(G,"class","btn btn-sm"),r(W,"class","interval-row svelte-1fx1e1e"),r(P,"class","sync-interval svelte-1fx1e1e")},m(Ne,ze){C(Ne,e,ze),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(s,u),a(t,d),x&&x.m(t,null),a(t,p),ne&&ne.m(t,null),a(t,m),le&&le.m(t,null),a(t,g),ie&&ie.m(t,null),a(t,h),me&&me.m(t,null),C(Ne,b,ze),C(Ne,k,ze),a(k,E),a(E,T),a(k,N),a(k,A),a(A,M),a(k,I),a(k,D),a(D,B),C(Ne,U,ze),C(Ne,P,ze),a(P,H),a(H,V),a(H,X),a(H,W),a(W,z),Le(z,n[8]),a(W,O),a(W,G),q||(Y=[L(E,"click",n[14]),L(A,"click",n[16]),L(D,"click",n[18]),L(z,"input",n[22]),L(G,"click",n[15])],q=!0)},p(Ne,ze){ze[0]&1&&c!==(c=Ne[20](Ne[0].lastStatus)+"")&&J(u,c),ze[0]&1&&ce(s,"status-ok",Ne[0].lastStatus==="connected"),ze[0]&1&&ce(s,"status-err",Ne[0].lastStatus==="error"||Ne[0].lastStatus==="revoked"),Ne[0].serverUrl?x?x.p(Ne,ze):(x=gr(Ne),x.c(),x.m(t,p)):x&&(x.d(1),x=null),Ne[0].deviceName?ne?ne.p(Ne,ze):(ne=hr(Ne),ne.c(),ne.m(t,m)):ne&&(ne.d(1),ne=null),Ne[0].deviceId?le?le.p(Ne,ze):(le=_r(Ne),le.c(),le.m(t,g)):le&&(le.d(1),le=null),Ne[0].lastSyncAt?ie?ie.p(Ne,ze):(ie=br(Ne),ie.c(),ie.m(t,h)):ie&&(ie.d(1),ie=null),Ne[0].lastError?me?me.p(Ne,ze):(me=vr(Ne),me.c(),me.m(t,null)):me&&(me.d(1),me=null),ze[0]&2&&(E.disabled=Ne[1]),ze[0]&2&&(A.disabled=Ne[1]),ze[0]&2&&(D.disabled=Ne[1]),ze[0]&256&&Sl(z.value)!==Ne[8]&&Le(z,Ne[8])},d(Ne){Ne&&(S(e),S(b),S(k),S(U),S(P)),x&&x.d(),ne&&ne.d(),le&&le.d(),ie&&ie.d(),me&&me.d(),q=!1,Se(Y)}}}function mr(n){let e,t=(n[11]?v("common.test")+" OK":v("error.generic"))+"",l;return{c(){e=f("div"),l=j(t),r(e,"class","connection-result svelte-1fx1e1e"),ce(e,"ok",n[11]),ce(e,"fail",!n[11])},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&2048&&t!==(t=(i[11]?v("common.test")+" OK":v("error.generic"))+"")&&J(l,t),o[0]&2048&&ce(e,"ok",i[11]),o[0]&2048&&ce(e,"fail",!i[11])},d(i){i&&S(e)}}}function gr(n){let e,t,l,i,o=n[0].serverUrl+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${v("settings.serverUrl")}`,l=w(),i=f("span"),s=j(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value mono svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].serverUrl+"")&&J(s,o)},d(c){c&&S(e)}}}function hr(n){let e,t,l,i,o=n[0].deviceName+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${v("settings.deviceName")}`,l=w(),i=f("span"),s=j(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].deviceName+"")&&J(s,o)},d(c){c&&S(e)}}}function _r(n){let e,t,l,i,o=n[0].deviceId+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${v("settings.deviceId")}`,l=w(),i=f("span"),s=j(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value mono svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].deviceId+"")&&J(s,o)},d(c){c&&S(e)}}}function br(n){let e,t,l,i,o=n[0].lastSyncAt+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${v("settings.lastSync")}`,l=w(),i=f("span"),s=j(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].lastSyncAt+"")&&J(s,o)},d(c){c&&S(e)}}}function vr(n){let e,t,l,i,o=n[0].lastError+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${v("settings.lastError")}`,l=w(),i=f("span"),s=j(o),r(t,"class","info-label svelte-1fx1e1e"),r(i,"class","info-value error svelte-1fx1e1e"),r(e,"class","info-row svelte-1fx1e1e")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&1&&o!==(o=c[0].lastError+"")&&J(s,o)},d(c){c&&S(e)}}}function kr(n){let e,t,l,i,o,s,c,u,d,p,m,g;return{c(){e=f("button"),t=f("div"),l=f("h3"),l.textContent=`${v("settings.confirmDisconnect")}`,i=w(),o=f("p"),o.textContent=`${v("settings.confirmDisconnectDesc")}`,s=w(),c=f("div"),u=f("button"),u.textContent=`${v("common.disconnect")}`,d=w(),p=f("button"),p.textContent=`${v("common.cancel")}`,r(l,"class","svelte-1fx1e1e"),r(o,"class","modal-desc svelte-1fx1e1e"),r(u,"class","btn btn-danger"),r(p,"class","btn"),r(c,"class","modal-actions svelte-1fx1e1e"),r(t,"class","modal svelte-1fx1e1e"),r(e,"class","modal-overlay svelte-1fx1e1e")},m(h,b){C(h,e,b),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(c,u),a(c,d),a(c,p),m||(g=[L(u,"click",n[17]),L(p,"click",n[26]),L(e,"click",n[27])],m=!0)},p:oe,d(h){h&&S(e),m=!1,Se(g)}}}function wr(n){let e,t,l,i,o,s,c,u,d,p,m,g;return{c(){e=f("button"),t=f("div"),l=f("h3"),l.textContent=`${v("settings.confirmResetKey")}`,i=w(),o=f("p"),o.textContent=`${v("settings.confirmResetKeyDesc")}`,s=w(),c=f("div"),u=f("button"),u.textContent=`${v("settings.resetKey")}`,d=w(),p=f("button"),p.textContent=`${v("common.cancel")}`,r(l,"class","svelte-1fx1e1e"),r(o,"class","modal-desc svelte-1fx1e1e"),r(u,"class","btn btn-danger"),r(p,"class","btn"),r(c,"class","modal-actions svelte-1fx1e1e"),r(t,"class","modal svelte-1fx1e1e"),r(e,"class","modal-overlay svelte-1fx1e1e")},m(h,b){C(h,e,b),a(e,t),a(t,l),a(t,i),a(t,o),a(t,s),a(t,c),a(c,u),a(c,d),a(c,p),m||(g=[L(u,"click",n[19]),L(p,"click",n[28]),L(e,"click",n[29])],m=!0)},p:oe,d(h){h&&S(e),m=!1,Se(g)}}}function $_(n){let e,t,l,i,o,s,c,u,d,p,m=n[2]&&dr(n),g=n[3]&&!n[2]&&pr(n);function h(T,N){return T[0]&&T[0].enabled?x_:Q_}let b=h(n),k=b(n),E=n[9]&&kr(n),y=n[10]&&wr(n);return{c(){e=f("div"),t=f("h2"),t.textContent=`${v("settings.sync")}`,l=w(),i=f("p"),i.textContent=`${v("settings.syncDesc")}`,o=w(),m&&m.c(),s=w(),g&&g.c(),c=w(),k.c(),u=w(),E&&E.c(),d=w(),y&&y.c(),p=mt(),r(t,"class","svelte-1fx1e1e"),r(i,"class","section-desc svelte-1fx1e1e"),r(e,"class","settings-section svelte-1fx1e1e")},m(T,N){C(T,e,N),a(e,t),a(e,l),a(e,i),a(e,o),m&&m.m(e,null),a(e,s),g&&g.m(e,null),a(e,c),k.m(e,null),C(T,u,N),E&&E.m(T,N),C(T,d,N),y&&y.m(T,N),C(T,p,N)},p(T,N){T[2]?m?m.p(T,N):(m=dr(T),m.c(),m.m(e,s)):m&&(m.d(1),m=null),T[3]&&!T[2]?g?g.p(T,N):(g=pr(T),g.c(),g.m(e,c)):g&&(g.d(1),g=null),b===(b=h(T))&&k?k.p(T,N):(k.d(1),k=b(T),k&&(k.c(),k.m(e,null))),T[9]?E?E.p(T,N):(E=kr(T),E.c(),E.m(d.parentNode,d)):E&&(E.d(1),E=null),T[10]?y?y.p(T,N):(y=wr(T),y.c(),y.m(p.parentNode,p)):y&&(y.d(1),y=null)},i:oe,o:oe,d(T){T&&(S(e),S(u),S(d),S(p)),m&&m.d(),g&&g.d(),k.d(),E&&E.d(T),y&&y.d(T)}}}function Qn(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function eb(n,e,t){let{onRefresh:l=null}=e,i=null,o=!1,s="",c="",u="",d="",p="",m="",g=0,h=!1,b=!1,k=null;async function E(){try{t(0,i=await Qn("GetSyncSettings")),i&&(t(5,d=i.serverUrl||""),t(8,g=i.syncInterval||0))}catch{t(0,i=null)}}E();async function y(){t(1,o=!0),t(2,s=""),t(4,u=""),t(11,k=null);try{await Qn("SyncTestConnection",d,p,m),t(11,k=!0),t(3,c="connection ok")}catch(G){t(11,k=!1),t(3,c="connection failed: "+String(G))}t(1,o=!1)}async function T(){t(1,o=!0),t(2,s=""),t(4,u="");try{await Qn("SyncConfigure",d,p,m),t(3,c="configured"),t(6,p=""),t(7,m=""),await E(),l&&l()}catch(G){t(2,s=String(G))}t(1,o=!1)}function N(G){const q=Array.isArray(G==null?void 0:G.conflicts)?G.conflicts:[],Y=Array.isArray(G==null?void 0:G.applyErrors)?G.applyErrors:[],x=[];return q.length>0&&x.push(v("sync.conflictsCount",{count:q.length})),Y.length>0&&x.push(v("sync.applyErrorsCount",{count:Y.length})),x.join(" · ")}async function A(){t(1,o=!0),t(2,s=""),t(4,u="");try{const G=await Qn("SyncNow"),q=v("sync.pushedPulled",{pushed:(G==null?void 0:G.pushed)||0,pulled:(G==null?void 0:G.pulled)||0}),Y=N(G);t(3,c=Y?q+" · "+Y:q),t(4,u=Y?"warning":""),await E(),l&&l()}catch(G){t(2,s=String(G))}t(1,o=!1)}async function R(){try{await Qn("SyncSetInterval",g),t(3,c=v("sync.settingsSaved")),t(4,u="")}catch(G){t(2,s=String(G))}}function M(){t(9,h=!0)}async function I(){t(9,h=!1),t(1,o=!0),t(4,u="");try{await Qn("SyncDisconnect"),t(3,c="disconnected"),await E(),l&&l()}catch(G){t(2,s=String(G))}t(1,o=!1)}function D(){t(10,b=!0)}async function F(){t(10,b=!1),t(1,o=!0),t(4,u="");try{await Qn("ResetSyncKey"),t(3,c="key reset"),await E(),l&&l()}catch(G){t(2,s=String(G))}t(1,o=!1)}function B(G){return G?{connected:v("settings.connected"),disconnected:v("settings.disconnected"),disabled:v("settings.notConfigured"),error:v("settings.error"),revoked:v("settings.revoked")}[G]||G:v("settings.notConfigured")}function U(){g=Sl(this.value),t(8,g)}function P(){d=this.value,t(5,d)}function H(){p=this.value,t(6,p)}function V(){m=this.value,t(7,m)}const X=()=>t(9,h=!1),W=()=>t(9,h=!1),z=()=>t(10,b=!1),O=()=>t(10,b=!1);return n.$$set=G=>{"onRefresh"in G&&t(21,l=G.onRefresh)},[i,o,s,c,u,d,p,m,g,h,b,k,y,T,A,R,M,I,D,F,B,l,U,P,H,V,X,W,z,O]}class tb extends tt{constructor(e){super(),et(this,e,eb,$_,$e,{onRefresh:21},null,[-1,-1])}}function nb(n){let e,t,l,i;return{c(){e=f("div"),t=f("h2"),t.textContent=`${v("settings.backup")}`,l=w(),i=f("p"),i.textContent=`${v("settings.backupStub")}`,r(t,"class","svelte-19bo7bn"),r(i,"class","section-desc svelte-19bo7bn"),r(e,"class","settings-section svelte-19bo7bn")},m(o,s){C(o,e,s),a(e,t),a(e,l),a(e,i)},p:oe,i:oe,o:oe,d(o){o&&S(e)}}}class lb extends tt{constructor(e){super(),et(this,e,null,nb,$e,{})}}function yr(n){let e,t;return{c(){e=f("div"),t=j(n[5]),r(e,"class","status-msg svelte-13i6m7m"),ce(e,"ok",n[6]==="ok"),ce(e,"error",n[6]==="error")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&32&&J(t,l[5]),i&64&&ce(e,"ok",l[6]==="ok"),i&64&&ce(e,"error",l[6]==="error")},d(l){l&&S(e)}}}function Er(n){let e,t,l,i,o,s;return{c(){e=f("div"),t=f("span"),t.textContent="Активный порт",l=w(),i=f("span"),o=j("127.0.0.1:"),s=j(n[3]),r(t,"class","info-label svelte-13i6m7m"),r(i,"class","info-value mono svelte-13i6m7m"),r(e,"class","info-row svelte-13i6m7m")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,o),a(i,s)},p(c,u){u&8&&J(s,c[3])},d(c){c&&S(e)}}}function Tr(n){let e,t,l,i;return{c(){e=f("button"),t=j("Перезапустить сервер"),r(e,"class","btn"),e.disabled=n[4]},m(o,s){C(o,e,s),a(e,t),l||(i=L(e,"click",n[8]),l=!0)},p(o,s){s&16&&(e.disabled=o[4])},d(o){o&&S(e),l=!1,i()}}}function ib(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y,T,N,A,R,M,I,D,F,B,U,P=n[2]?"Запущен":"Остановлен",H,V,X,W,z,O,G,q,Y,x=n[5]&&yr(n),ne=n[2]&&n[3]&&Er(n),le=n[0]&&Tr(n);return{c(){e=f("div"),t=f("h2"),t.textContent="Browser Bridge",l=w(),i=f("p"),i.textContent=`Локальный HTTP-сервер для приёма событий от браузерного расширения Verstak Bridge. Работает только на 127.0.0.1.`,o=w(),x&&x.c(),s=w(),c=f("div"),u=f("div"),d=f("label"),p=f("input"),m=w(),g=f("span"),g.textContent="Включить Browser Bridge",h=w(),b=f("div"),k=f("label"),E=f("span"),E.textContent="Порт",y=w(),T=f("input"),A=w(),R=f("p"),R.textContent="По умолчанию: 9786. Требуется перезапуск сервера при изменении.",M=w(),I=f("div"),D=f("div"),F=f("span"),F.textContent="Статус",B=w(),U=f("span"),H=j(P),V=w(),ne&&ne.c(),X=w(),W=f("div"),z=f("button"),O=j("Сохранить"),G=w(),le&&le.c(),r(t,"class","svelte-13i6m7m"),r(i,"class","section-desc svelte-13i6m7m"),r(p,"type","checkbox"),r(g,"class","toggle-text svelte-13i6m7m"),r(d,"class","toggle-label svelte-13i6m7m"),r(u,"class","form-group svelte-13i6m7m"),r(E,"class","label-text svelte-13i6m7m"),r(T,"type","number"),r(T,"min","1024"),r(T,"max","65535"),T.disabled=N=!n[0],r(T,"class","svelte-13i6m7m"),r(R,"class","field-hint svelte-13i6m7m"),r(b,"class","form-group svelte-13i6m7m"),r(F,"class","info-label svelte-13i6m7m"),r(U,"class","info-value svelte-13i6m7m"),ce(U,"status-ok",n[2]),ce(U,"status-off",!n[2]),r(D,"class","info-row svelte-13i6m7m"),r(I,"class","bridge-status svelte-13i6m7m"),r(c,"class","settings-card svelte-13i6m7m"),r(z,"class","btn btn-primary"),z.disabled=n[4],r(W,"class","actions svelte-13i6m7m"),r(e,"class","settings-section svelte-13i6m7m")},m(ie,me){C(ie,e,me),a(e,t),a(e,l),a(e,i),a(e,o),x&&x.m(e,null),a(e,s),a(e,c),a(c,u),a(u,d),a(d,p),p.checked=n[0],a(d,m),a(d,g),a(c,h),a(c,b),a(b,k),a(k,E),a(k,y),a(k,T),Le(T,n[1]),a(b,A),a(b,R),a(c,M),a(c,I),a(I,D),a(D,F),a(D,B),a(D,U),a(U,H),a(I,V),ne&&ne.m(I,null),a(e,X),a(e,W),a(W,z),a(z,O),a(W,G),le&&le.m(W,null),q||(Y=[L(p,"change",n[10]),L(T,"input",n[11]),L(z,"click",n[7])],q=!0)},p(ie,[me]){ie[5]?x?x.p(ie,me):(x=yr(ie),x.c(),x.m(e,s)):x&&(x.d(1),x=null),me&1&&(p.checked=ie[0]),me&1&&N!==(N=!ie[0])&&(T.disabled=N),me&2&&Sl(T.value)!==ie[1]&&Le(T,ie[1]),me&4&&P!==(P=ie[2]?"Запущен":"Остановлен")&&J(H,P),me&4&&ce(U,"status-ok",ie[2]),me&4&&ce(U,"status-off",!ie[2]),ie[2]&&ie[3]?ne?ne.p(ie,me):(ne=Er(ie),ne.c(),ne.m(I,null)):ne&&(ne.d(1),ne=null),me&16&&(z.disabled=ie[4]),ie[0]?le?le.p(ie,me):(le=Tr(ie),le.c(),le.m(W,null)):le&&(le.d(1),le=null)},i:oe,o:oe,d(ie){ie&&S(e),x&&x.d(),ne&&ne.d(),le&&le.d(),q=!1,Se(Y)}}}function sb(n,e,t){let{appConfig:l=null}=e,i=!1,o=9786,s=!1,c=0,u=!1,d="",p="";function m(){if(l&&l.vault&&l.vault.bridge){const y=l.vault.bridge;t(0,i=y.enabled!==!1),t(1,o=y.port||9786)}}async function g(){try{if(window.go&&window.go.main&&window.go.main.App){const y=await window.go.main.App.BridgeInfo();t(2,s=y.running||!1),t(3,c=y.port||0)}}catch{t(2,s=!1),t(3,c=0)}}m(),g();async function h(){t(4,u=!0),t(5,d=""),t(6,p="");try{l||t(9,l={}),l.vault||t(9,l.vault={},l),l.vault.bridge||t(9,l.vault.bridge={},l),t(9,l.vault.bridge.enabled=i,l),t(9,l.vault.bridge.port=o,l),window.go&&window.go.main&&window.go.main.App&&await window.go.main.App.SaveAppConfig(l),t(5,d="saved"),t(6,p="ok"),await g()}catch(y){t(5,d=String(y)),t(6,p="error")}t(4,u=!1)}async function b(){t(4,u=!0),t(5,d=""),t(6,p="");try{window.go&&window.go.main&&window.go.main.App&&await window.go.main.App.RestartBridge(),t(5,d="bridge restarted"),t(6,p="ok"),await g()}catch(y){t(5,d=String(y)),t(6,p="error")}t(4,u=!1)}function k(){i=this.checked,t(0,i)}function E(){o=Sl(this.value),t(1,o)}return n.$$set=y=>{"appConfig"in y&&t(9,l=y.appConfig)},[i,o,s,c,u,d,p,h,b,l,k,E]}class ob extends tt{constructor(e){super(),et(this,e,sb,ib,$e,{appConfig:9})}}const{window:rb}=Ts;function ab(n){let e,t;return e=new ob({props:{appConfig:n[2]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const o={};i&4&&(o.appConfig=l[2]),e.$set(o)},i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function cb(n){let e,t;return e=new lb({}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:oe,i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function ub(n){let e,t;return e=new tb({props:{onRefresh:n[7]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:oe,i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function fb(n){let e,t;return e=new J_({}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:oe,i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function db(n){let e,t;return e=new Y_({}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:oe,i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function pb(n){let e,t;return e=new q_({props:{onPluginToggle:n[0]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const o={};i&1&&(o.onPluginToggle=l[0]),e.$set(o)},i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function mb(n){let e,t;return e=new B_({props:{onRefresh:n[3]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:oe,i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function gb(n){let e,t;return e=new M_({props:{onRefresh:n[3]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:oe,i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function hb(n){let e,t;return e=new C_({props:{appConfig:n[2],onSave:n[6]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const o={};i&4&&(o.appConfig=l[2]),e.$set(o)},i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function _b(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E;d=new E_({props:{activeSection:n[1],onSelect:n[4]}});const y=[hb,gb,mb,pb,db,fb,ub,cb,ab],T=[];function N(A,R){return A[1]==="general"?0:A[1]==="workspace"?1:A[1]==="templates"?2:A[1]==="plugins"?3:A[1]==="files"?4:A[1]==="activity"?5:A[1]==="sync"?6:A[1]==="backup"?7:A[1]==="browserBridge"?8:-1}return~(g=N(n))&&(h=T[g]=y[g](n)),{c(){e=f("button"),t=f("div"),l=f("div"),i=f("h2"),i.textContent=`${v("settings.title")}`,o=w(),s=f("button"),s.innerHTML='',c=w(),u=f("div"),Ze(d.$$.fragment),p=w(),m=f("div"),h&&h.c(),r(i,"class","svelte-zf2zsc"),r(s,"class","close-btn svelte-zf2zsc"),r(s,"title",v("settings.close")),r(l,"class","settings-header svelte-zf2zsc"),r(m,"class","settings-content svelte-zf2zsc"),r(u,"class","settings-body svelte-zf2zsc"),r(t,"class","settings-window svelte-zf2zsc"),r(e,"class","settings-overlay svelte-zf2zsc")},m(A,R){C(A,e,R),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(t,c),a(t,u),Ve(d,u,null),a(u,p),a(u,m),~g&&T[g].m(m,null),b=!0,k||(E=[L(rb,"keydown",n[8]),L(s,"click",n[5]),L(e,"click",Kt(n[5]))],k=!0)},p(A,[R]){const M={};R&2&&(M.activeSection=A[1]),d.$set(M);let I=g;g=N(A),g===I?~g&&T[g].p(A,R):(h&&(bt(),ve(T[I],1,1,()=>{T[I]=null}),vt()),~g?(h=T[g],h?h.p(A,R):(h=T[g]=y[g](A),h.c()),pe(h,1),h.m(m,null)):h=null)},i(A){b||(pe(d.$$.fragment,A),pe(h),b=!0)},o(A){ve(d.$$.fragment,A),ve(h),b=!1},d(A){A&&S(e),qe(d),~g&&T[g].d(),k=!1,Se(E)}}}function Sr(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function bb(n,e,t){let{onClose:l=null}=e,{onSyncRefresh:i=null}=e,{onPluginToggle:o=null}=e,{initialSection:s="general"}=e,c=s,u=null;async function d(){try{t(2,u=await Sr("GetAppConfig"))}catch{t(2,u=null)}}d();function p(k){t(1,c=k)}function m(){l&&l()}async function g(k){try{await Sr("SaveAppConfig",k),t(2,u=k)}catch(E){console.error(E)}}function h(){i&&i()}function b(k){k.key==="Escape"&&m()}return n.$$set=k=>{"onClose"in k&&t(9,l=k.onClose),"onSyncRefresh"in k&&t(10,i=k.onSyncRefresh),"onPluginToggle"in k&&t(0,o=k.onPluginToggle),"initialSection"in k&&t(11,s=k.initialSection)},[o,c,u,d,p,m,g,h,b,l,i,s]}class vb extends tt{constructor(e){super(),et(this,e,bb,_b,$e,{onClose:9,onSyncRefresh:10,onPluginToggle:0,initialSection:11})}}function kb(n){let e,t,l,i,o,s,c,u;return{c(){e=f("div"),t=f("span"),l=w(),i=f("span"),i.textContent=`${v("sync.status.disabled")}`,o=w(),s=f("button"),s.textContent=`${v("sync.configure")}`,r(t,"class","sync-dot dot-disabled svelte-1rxbx0"),r(i,"class","sync-label svelte-1rxbx0"),r(s,"class","btn btn-xs svelte-1rxbx0"),r(e,"class","sync-status-row svelte-1rxbx0")},m(d,p){C(d,e,p),a(e,t),a(e,l),a(e,i),a(e,o),a(e,s),c||(u=L(s,"click",function(){yn(n[5])&&n[5].apply(this,arguments)}),c=!0)},p(d,p){n=d},d(d){d&&S(e),c=!1,u()}}}function wb(n){let e,t,l,i,o,s=n[7](n[0])+"",c,u,d,p,m,g=(n[1]?v("sync.running"):v("sync.run"))+"",h,b,k,E,y,T,N,A=n[0].unpushedOps>0&&Cr(n),R=n[2]&&Ar(n);return{c(){e=f("div"),t=f("span"),i=w(),o=f("span"),c=j(s),u=w(),A&&A.c(),d=w(),p=f("div"),m=f("button"),h=j(g),b=w(),k=f("button"),k.textContent=`${v("sync.details")}`,E=w(),R&&R.c(),y=mt(),r(t,"class",l="sync-dot "+n[6](n[0])+" svelte-1rxbx0"),r(o,"class","sync-label svelte-1rxbx0"),r(m,"class","btn btn-xs svelte-1rxbx0"),m.disabled=n[1],r(k,"class","btn btn-xs btn-link svelte-1rxbx0"),r(p,"class","sync-actions-row svelte-1rxbx0"),r(e,"class","sync-status-row svelte-1rxbx0")},m(M,I){C(M,e,I),a(e,t),a(e,i),a(e,o),a(o,c),a(e,u),A&&A.m(e,null),a(e,d),a(e,p),a(p,m),a(m,h),a(p,b),a(p,k),C(M,E,I),R&&R.m(M,I),C(M,y,I),T||(N=[L(m,"click",function(){yn(n[4])&&n[4].apply(this,arguments)}),L(k,"click",function(){yn(n[5])&&n[5].apply(this,arguments)})],T=!0)},p(M,I){n=M,I&1&&l!==(l="sync-dot "+n[6](n[0])+" svelte-1rxbx0")&&r(t,"class",l),I&1&&s!==(s=n[7](n[0])+"")&&J(c,s),n[0].unpushedOps>0?A?A.p(n,I):(A=Cr(n),A.c(),A.m(e,d)):A&&(A.d(1),A=null),I&2&&g!==(g=(n[1]?v("sync.running"):v("sync.run"))+"")&&J(h,g),I&2&&(m.disabled=n[1]),n[2]?R?R.p(n,I):(R=Ar(n),R.c(),R.m(y.parentNode,y)):R&&(R.d(1),R=null)},d(M){M&&(S(e),S(E),S(y)),A&&A.d(),R&&R.d(M),T=!1,Se(N)}}}function Cr(n){let e,t=n[0].unpushedOps+"",l,i,o=v("sync.changes")+"",s;return{c(){e=f("span"),l=j(t),i=w(),s=j(o),r(e,"class","sync-count svelte-1rxbx0")},m(c,u){C(c,e,u),a(e,l),a(e,i),a(e,s)},p(c,u){u&1&&t!==(t=c[0].unpushedOps+"")&&J(l,t)},d(c){c&&S(e)}}}function Ar(n){let e,t,l;return{c(){e=f("div"),t=j(n[2]),r(e,"class",l=Mo(n[3]==="warning"?"sync-message sync-message-warning":"sync-message")+" svelte-1rxbx0")},m(i,o){C(i,e,o),a(e,t)},p(i,o){o&4&&J(t,i[2]),o&8&&l!==(l=Mo(i[3]==="warning"?"sync-message sync-message-warning":"sync-message")+" svelte-1rxbx0")&&r(e,"class",l)},d(i){i&&S(e)}}}function yb(n){let e;function t(o,s){var c;return(c=o[0])!=null&&c.configured?wb:kb}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","sync-status-widget svelte-1rxbx0")},m(o,s){C(o,e,s),i.m(e,null)},p(o,[s]){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:oe,o:oe,d(o){o&&S(e),i.d()}}}function Eb(n,e,t){let{syncStatus:l=null}=e,{syncLoading:i=!1}=e,{syncMessage:o=""}=e,{syncMessageKind:s=""}=e,{onSync:c=null}=e,{onOpenSettings:u=null}=e;function d(m){return!m||!m.configured?"dot-disabled":i?"dot-syncing":m.revoked?"dot-disabled":m.connected?"dot-connected":m.configured?"dot-warning":"dot-disabled"}function p(m){return!m||!m.configured?v("sync.status.disabled"):i?v("sync.status.syncing"):m.revoked?v("sync.status.error"):m.connected?v("sync.status.connected"):v("sync.status.disconnected")}return n.$$set=m=>{"syncStatus"in m&&t(0,l=m.syncStatus),"syncLoading"in m&&t(1,i=m.syncLoading),"syncMessage"in m&&t(2,o=m.syncMessage),"syncMessageKind"in m&&t(3,s=m.syncMessageKind),"onSync"in m&&t(4,c=m.onSync),"onOpenSettings"in m&&t(5,u=m.onOpenSettings)},[l,i,o,s,c,u,d,p]}class Tb extends tt{constructor(e){super(),et(this,e,Eb,yb,$e,{syncStatus:0,syncLoading:1,syncMessage:2,syncMessageKind:3,onSync:4,onOpenSettings:5})}}function Nr(n,e,t){const l=n.slice();return l[10]=e[t],l}function Sb(n){let e,t=ye(n[0]),l=[];for(let i=0;i0&&Rr(n),I=n[10].ts_start&&Ir(n),D=n[10].status!=="pending"&&Mr(n),F=n[10].selected_text&&Lr(n),B=n[10].status==="pending"&&Dr(n);return{c(){e=f("div"),t=f("div"),i=j(l),o=w(),s=f("div"),c=f("div"),d=j(u),p=w(),m=f("div"),h=j(g),k=w(),E=f("div"),M&&M.c(),y=w(),I&&I.c(),T=w(),D&&D.c(),N=w(),F&&F.c(),A=w(),B&&B.c(),R=w(),r(t,"class","event-icon svelte-slao4o"),r(c,"class","event-domain svelte-slao4o"),r(m,"class","event-title svelte-slao4o"),r(m,"title",b=n[10].title),r(E,"class","event-meta svelte-slao4o"),r(s,"class","event-body svelte-slao4o"),r(e,"class","event-item svelte-slao4o"),ce(e,"pending",n[10].status==="pending")},m(U,P){C(U,e,P),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,d),a(s,p),a(s,m),a(m,h),a(s,k),a(s,E),M&&M.m(E,null),a(E,y),I&&I.m(E,null),a(E,T),D&&D.m(E,null),a(s,N),F&&F.m(s,null),a(e,A),B&&B.m(e,null),a(e,R)},p(U,P){P&1&&l!==(l=Pr(U[10].type)+"")&&J(i,l),P&1&&u!==(u=(U[10].domain||"?")+"")&&J(d,u),P&1&&g!==(g=Si(U[10].title||U[10].url,80)+"")&&J(h,g),P&1&&b!==(b=U[10].title)&&r(m,"title",b),U[10].active_seconds>0?M?M.p(U,P):(M=Rr(U),M.c(),M.m(E,y)):M&&(M.d(1),M=null),U[10].ts_start?I?I.p(U,P):(I=Ir(U),I.c(),I.m(E,T)):I&&(I.d(1),I=null),U[10].status!=="pending"?D?D.p(U,P):(D=Mr(U),D.c(),D.m(E,null)):D&&(D.d(1),D=null),U[10].selected_text?F?F.p(U,P):(F=Lr(U),F.c(),F.m(s,null)):F&&(F.d(1),F=null),U[10].status==="pending"?B?B.p(U,P):(B=Dr(U),B.c(),B.m(e,R)):B&&(B.d(1),B=null),P&1&&ce(e,"pending",U[10].status==="pending")},d(U){U&&S(e),M&&M.d(),I&&I.d(),D&&D.d(),F&&F.d(),B&&B.d()}}}function Ab(n){let e;return{c(){e=f("p"),e.textContent=`${v("noBrowserEvents","Нет событий браузера")}`,r(e,"class","empty-text svelte-slao4o")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Nb(n){let e;return{c(){e=f("p"),e.textContent=`${v("loading","Загрузка...")}`,r(e,"class","loading svelte-slao4o")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Rb(n){let e,t,l,i,o,s=n[1]?"⏳":"🔄",c,u,d,p;function m(b,k){return b[0].length===0?Cb:Sb}let g=m(n),h=g(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${v("browserEvents","События браузера")}`,i=w(),o=f("button"),c=j(s),u=w(),h.c(),r(l,"class","svelte-slao4o"),r(o,"class","refresh-btn svelte-slao4o"),o.disabled=n[1],r(t,"class","browser-header svelte-slao4o"),r(e,"class","browser-events svelte-slao4o")},m(b,k){C(b,e,k),a(e,t),a(t,l),a(t,i),a(t,o),a(o,c),a(e,u),h.m(e,null),d||(p=L(o,"click",function(){yn(n[5])&&n[5].apply(this,arguments)}),d=!0)},p(b,[k]){n=b,k&2&&s!==(s=n[1]?"⏳":"🔄")&&J(c,s),k&2&&(o.disabled=n[1]),g===(g=m(n))&&h?h.p(n,k):(h.d(1),h=g(n),h&&(h.c(),h.m(e,null)))},i:oe,o:oe,d(b){b&&S(e),h.d(),d=!1,p()}}}function Pr(n){return n==="page_visit"?"🌐":n==="note_capture"?"📝":n==="screenshot"?"📸":"•"}function Si(n,e){return n?n.length>e?n.substring(0,e)+"...":n:""}function Ib(n,e,t){let{events:l=[]}=e,{loading:i=!1}=e,{onAccept:o=h=>{}}=e,{onDismiss:s=h=>{}}=e,{onAttach:c=h=>{}}=e,{onRefresh:u=()=>{}}=e,{formatTime:d=h=>""}=e;const p=h=>o(h),m=h=>c(h),g=h=>s(h);return n.$$set=h=>{"events"in h&&t(0,l=h.events),"loading"in h&&t(1,i=h.loading),"onAccept"in h&&t(2,o=h.onAccept),"onDismiss"in h&&t(3,s=h.onDismiss),"onAttach"in h&&t(4,c=h.onAttach),"onRefresh"in h&&t(5,u=h.onRefresh),"formatTime"in h&&t(6,d=h.formatTime)},[l,i,o,s,c,u,d,p,m,g]}class Mb extends tt{constructor(e){super(),et(this,e,Ib,Rb,$e,{events:0,loading:1,onAccept:2,onDismiss:3,onAttach:4,onRefresh:5,formatTime:6})}}function zr(n,e,t){const l=n.slice();return l[69]=e[t],l}function Br(n,e,t){const l=n.slice();return l[69]=e[t],l}function Fr(n,e,t){const l=n.slice();return l[64]=e[t],l[65]=e,l[66]=t,l}function jr(n,e,t){const l=n.slice();return l[61]=e[t],l}function Ur(n,e,t){const l=n.slice();return l[61]=e[t],l}function Hr(n){let e,t;return{c(){e=f("span"),t=j(n[4]),r(e,"class","tab-badge svelte-ii7vwz")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[0]&16&&J(t,l[4])},d(l){l&&S(e)}}}function Wr(n){let e,t=n[3].length+"",l;return{c(){e=f("span"),l=j(t),r(e,"class","tab-badge svelte-ii7vwz")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&8&&t!==(t=i[3].length+"")&&J(l,t)},d(i){i&&S(e)}}}function Gr(n){let e,t=n[15].length+"",l;return{c(){e=f("span"),l=j(t),r(e,"class","tab-badge svelte-ii7vwz")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o[0]&32768&&t!==(t=i[15].length+"")&&J(l,t)},d(i){i&&S(e)}}}function Lb(n){let e,t,l;return t=new Mb({props:{events:n[15],loading:n[16],formatTime:n[5],onAccept:n[17],onDismiss:n[18],onAttach:n[19],onRefresh:n[20]}}),{c(){e=f("div"),Ze(t.$$.fragment),r(e,"class","today-tab-content svelte-ii7vwz")},m(i,o){C(i,e,o),Ve(t,e,null),l=!0},p(i,o){const s={};o[0]&32768&&(s.events=i[15]),o[0]&65536&&(s.loading=i[16]),o[0]&32&&(s.formatTime=i[5]),o[0]&131072&&(s.onAccept=i[17]),o[0]&262144&&(s.onDismiss=i[18]),o[0]&524288&&(s.onAttach=i[19]),o[0]&1048576&&(s.onRefresh=i[20]),t.$set(s)},i(i){l||(pe(t.$$.fragment,i),l=!0)},o(i){ve(t.$$.fragment,i),l=!1},d(i){i&&S(e),qe(t)}}}function Db(n){let e,t,l,i,o,s,c,u,d,p,m=n[25]==="asc"?"↑":"↓",g,h,b,k;function E(N,A){return N[3].length===0?Fb:Bb}let y=E(n),T=y(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),i.textContent=`${v("today.sortByTime")}`,o=w(),s=f("button"),s.textContent=`${v("today.sortByName")}`,c=w(),u=f("button"),u.textContent=`${v("today.sortByType")}`,d=w(),p=f("span"),g=j(m),h=w(),T.c(),r(i,"class","sort-btn svelte-ii7vwz"),ce(i,"active",n[24]==="time"),r(s,"class","sort-btn svelte-ii7vwz"),ce(s,"active",n[24]==="name"),r(u,"class","sort-btn svelte-ii7vwz"),ce(u,"active",n[24]==="type"),r(p,"class","sort-dir svelte-ii7vwz"),r(l,"class","sort-controls svelte-ii7vwz"),r(t,"class","tab-controls svelte-ii7vwz"),r(e,"class","today-tab-content svelte-ii7vwz")},m(N,A){C(N,e,A),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(l,c),a(l,u),a(l,d),a(l,p),a(p,g),a(e,h),T.m(e,null),b||(k=[L(i,"click",n[56]),L(s,"click",n[57]),L(u,"click",n[58])],b=!0)},p(N,A){A[0]&16777216&&ce(i,"active",N[24]==="time"),A[0]&16777216&&ce(s,"active",N[24]==="name"),A[0]&16777216&&ce(u,"active",N[24]==="type"),A[0]&33554432&&m!==(m=N[25]==="asc"?"↑":"↓")&&J(g,m),y===(y=E(N))&&T?T.p(N,A):(T.d(1),T=y(N),T&&(T.c(),T.m(e,null)))},i:oe,o:oe,d(N){N&&S(e),T.d(),b=!1,Se(k)}}}function Ob(n){let e,t,l,i,o,s,c,u,d,p,m=n[23]==="asc"?"↑":"↓",g,h,b,k;function E(N,A){return N[2].length===0?Ub:jb}let y=E(n),T=y(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),i.textContent=`${v("today.sortByTime")}`,o=w(),s=f("button"),s.textContent=`${v("today.sortByName")}`,c=w(),u=f("button"),u.textContent=`${v("today.sortByType")}`,d=w(),p=f("span"),g=j(m),h=w(),T.c(),r(i,"class","sort-btn svelte-ii7vwz"),ce(i,"active",n[22]==="time"),r(s,"class","sort-btn svelte-ii7vwz"),ce(s,"active",n[22]==="name"),r(u,"class","sort-btn svelte-ii7vwz"),ce(u,"active",n[22]==="type"),r(p,"class","sort-dir svelte-ii7vwz"),r(l,"class","sort-controls svelte-ii7vwz"),r(t,"class","tab-controls svelte-ii7vwz"),r(e,"class","today-tab-content svelte-ii7vwz")},m(N,A){C(N,e,A),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(l,c),a(l,u),a(l,d),a(l,p),a(p,g),a(e,h),T.m(e,null),b||(k=[L(i,"click",n[51]),L(s,"click",n[52]),L(u,"click",n[53])],b=!0)},p(N,A){A[0]&4194304&&ce(i,"active",N[22]==="time"),A[0]&4194304&&ce(s,"active",N[22]==="name"),A[0]&4194304&&ce(u,"active",N[22]==="type"),A[0]&8388608&&m!==(m=N[23]==="asc"?"↑":"↓")&&J(g,m),y===(y=E(N))&&T?T.p(N,A):(T.d(1),T=y(N),T&&(T.c(),T.m(e,null)))},i:oe,o:oe,d(N){N&&S(e),T.d(),b=!1,Se(k)}}}function Pb(n){let e;function t(o,s){return o[0].length===0?Wb:Hb}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","today-tab-content svelte-ii7vwz")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:oe,o:oe,d(o){o&&S(e),i.d()}}}function zb(n){let e;function t(o,s){return!o[1]||!o[1].events||o[1].events.length===0?Kb:Gb}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","today-tab-content svelte-ii7vwz")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:oe,o:oe,d(o){o&&S(e),i.d()}}}function Bb(n){let e,t=ye(na(n[3],n[24],n[25])),l=[];for(let i=0;i0&&Zr(n);function le(...te){return n[43](n[64],n[65],n[66],...te)}function ie(){return n[44](n[64])}function me(){return n[45](n[64])}function Ne(){return n[46](n[64])}function ze(){return n[47](n[64],n[65],n[66])}function Ye(...te){return n[48](n[64],n[65],n[66],...te)}let Re=n[64]._expanded&&n[64].events&&n[64].events.length>0&&Yr(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),s=j(o),c=w(),u=f("span"),p=j(d),m=w(),g=f("span"),b=j(h),k=w(),y=j(E),ne&&ne.c(),T=w(),N=f("div"),A=f("span"),I=w(),D=f("input"),B=w(),U=f("span"),U.textContent=`${v("suggest.minutes")}`,P=w(),H=f("button"),H.textContent=`${v("suggest.edit")}`,V=w(),X=f("button"),X.textContent=`${v("suggest.apply")}`,W=w(),z=f("button"),z.textContent=`${v("common.delete")}`,O=w(),Re&&Re.c(),G=w(),r(i,"class","suggestion-node link-btn svelte-ii7vwz"),r(u,"class","suggestion-summary svelte-ii7vwz"),r(g,"class","suggestion-meta svelte-ii7vwz"),r(l,"class","suggestion-info svelte-ii7vwz"),r(A,"class","suggestion-confidence-dot svelte-ii7vwz"),r(A,"title",R=v("suggest.confidence."+n[64].confidence)),r(A,"aria-label",M=v("suggest.confidence."+n[64].confidence)),ce(A,"low",n[64].confidence==="low"),ce(A,"medium",n[64].confidence==="medium"),ce(A,"high",n[64].confidence==="high"),r(D,"type","number"),r(D,"class","suggestion-min-input svelte-ii7vwz"),D.value=F=n[64].suggestedMin,r(D,"min","1"),r(D,"max","480"),r(U,"class","suggestion-min-label svelte-ii7vwz"),r(H,"class","btn btn-sm svelte-ii7vwz"),r(X,"class","btn btn-sm btn-primary svelte-ii7vwz"),r(z,"class","btn btn-sm btn-danger svelte-ii7vwz"),r(N,"class","suggestion-actions svelte-ii7vwz"),r(t,"class","suggestion-main svelte-ii7vwz"),r(t,"role","button"),r(t,"tabindex","0"),r(e,"class","suggestion-card svelte-ii7vwz"),ce(e,"expanded",n[64]._expanded)},m(te,re){C(te,e,re),a(e,t),a(t,l),a(l,i),a(i,s),a(l,c),a(l,u),a(u,p),a(l,m),a(l,g),a(g,b),a(g,k),a(g,y),ne&&ne.m(g,null),a(t,T),a(t,N),a(N,A),a(N,I),a(N,D),a(N,B),a(N,U),a(N,P),a(N,H),a(N,V),a(N,X),a(N,W),a(N,z),a(e,O),Re&&Re.m(e,null),a(e,G),q||(Y=[L(i,"click",He(x)),L(D,"change",He(le)),L(H,"click",He(ie)),L(X,"click",He(me)),L(z,"click",He(Ne)),L(t,"click",ze),L(t,"keydown",Ye)],q=!0)},p(te,re){n=te,re[0]&1&&o!==(o=n[64].nodeTitle+"")&&J(s,o),re[0]&1&&d!==(d=n[64].summary+"")&&J(p,d),re[0]&1&&h!==(h=n[64].suggestedMin+"")&&J(b,h),n[64].events&&n[64].events.length>0?ne?ne.p(n,re):(ne=Zr(n),ne.c(),ne.m(g,null)):ne&&(ne.d(1),ne=null),re[0]&1&&R!==(R=v("suggest.confidence."+n[64].confidence))&&r(A,"title",R),re[0]&1&&M!==(M=v("suggest.confidence."+n[64].confidence))&&r(A,"aria-label",M),re[0]&1&&ce(A,"low",n[64].confidence==="low"),re[0]&1&&ce(A,"medium",n[64].confidence==="medium"),re[0]&1&&ce(A,"high",n[64].confidence==="high"),re[0]&1&&F!==(F=n[64].suggestedMin)&&D.value!==F&&(D.value=F),n[64]._expanded&&n[64].events&&n[64].events.length>0?Re?Re.p(n,re):(Re=Yr(n),Re.c(),Re.m(e,G)):Re&&(Re.d(1),Re=null),re[0]&1&&ce(e,"expanded",n[64]._expanded)},d(te){te&&S(e),ne&&ne.d(),Re&&Re.d(),q=!1,Se(Y)}}}function Gb(n){let e,t=ye(n[1].events),l=[];for(let i=0;i',V=w(),r(t,"class","feed-icon svelte-ii7vwz"),r(u,"class","feed-type svelte-ii7vwz"),r(g,"class","feed-colon svelte-ii7vwz"),r(b,"class","feed-title link-btn svelte-ii7vwz"),r(c,"class","feed-title-line svelte-ii7vwz"),r(R,"class","feed-event-type svelte-ii7vwz"),r(F,"class","feed-time svelte-ii7vwz"),r(T,"class","feed-meta-line svelte-ii7vwz"),r(s,"class","feed-body svelte-ii7vwz"),r(H,"class","feed-nav-btn svelte-ii7vwz"),r(H,"title",v("common.open")),r(e,"class","feed-item svelte-ii7vwz"),r(e,"role","button"),r(e,"tabindex","0")},m(Y,x){C(Y,e,x),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,u),a(u,p),a(c,m),a(c,g),a(c,h),a(c,b),a(b,E),a(s,y),a(s,T),z&&z.m(T,null),a(T,A),a(T,R),a(R,I),a(T,D),a(T,F),a(F,U),a(e,P),a(e,H),a(e,V),X||(W=[L(H,"click",He(O)),L(e,"click",G),L(e,"keydown",q)],X=!0)},p(Y,x){n=Y,x[0]&2&&l!==(l=ta(n[61].eventType)+"")&&J(i,l),x[0]&2&&d!==(d=n[28](n[61])+"")&&J(p,d),x[0]&2&&k!==(k=(n[61].title||"")+"")&&J(E,k),x[0]&2&&(N=Ci(n[61])),N?z?z.p(n,x):(z=$r(n),z.c(),z.m(T,A)):z&&(z.d(1),z=null),x[0]&66&&M!==(M=n[6](n[61].eventType)+"")&&J(I,M),x[0]&34&&B!==(B=n[5](n[61].createdAt)+"")&&J(U,B)},d(Y){Y&&S(e),z&&z.d(),X=!1,Se(W)}}}function Vb(n){var q;let e,t,l,i=(((q=n[1])==null?void 0:q.date)||"")+"",o,s,c,u,d,p,m=v("today.suggestionsTab")+"",g,h,b,k,E,y,T=v("today.captured")+"",N,A,R,M,I,D,F,B,U,P,H,V=n[4]>0&&Hr(n),X=n[3].length>0&&Wr(n),W=n[15].length>0&&Gr(n);const z=[zb,Pb,Ob,Db,Lb],O=[];function G(Y,x){return Y[21]==="feed"?0:Y[21]==="suggestions"?1:Y[21]==="inprogress"?2:Y[21]==="captured"?3:Y[21]==="browser"?4:-1}return~(F=G(n))&&(B=O[F]=z[F](n)),{c(){e=f("div"),t=f("div"),l=f("span"),o=j(i),s=w(),c=f("div"),u=f("button"),u.textContent=`${v("today.feed")}`,d=w(),p=f("button"),g=j(m),h=w(),V&&V.c(),b=w(),k=f("button"),k.textContent=`${v("today.inProgress")}`,E=w(),y=f("button"),N=j(T),A=w(),X&&X.c(),R=w(),M=f("button"),I=j(`Браузер `),W&&W.c(),D=w(),B&&B.c(),r(l,"class","today-date svelte-ii7vwz"),r(t,"class","today-header svelte-ii7vwz"),r(u,"class","today-tab svelte-ii7vwz"),ce(u,"active",n[21]==="feed"),r(p,"class","today-tab svelte-ii7vwz"),ce(p,"active",n[21]==="suggestions"),r(k,"class","today-tab svelte-ii7vwz"),ce(k,"active",n[21]==="inprogress"),r(y,"class","today-tab svelte-ii7vwz"),ce(y,"active",n[21]==="captured"),r(M,"class","today-tab svelte-ii7vwz"),ce(M,"active",n[21]==="browser"),r(c,"class","today-tabs svelte-ii7vwz"),r(e,"class","today-screen svelte-ii7vwz")},m(Y,x){C(Y,e,x),a(e,t),a(t,l),a(l,o),a(e,s),a(e,c),a(c,u),a(c,d),a(c,p),a(p,g),a(p,h),V&&V.m(p,null),a(c,b),a(c,k),a(c,E),a(c,y),a(y,N),a(y,A),X&&X.m(y,null),a(c,R),a(c,M),a(M,I),W&&W.m(M,null),a(e,D),~F&&O[F].m(e,null),U=!0,P||(H=[L(u,"click",n[34]),L(p,"click",n[35]),L(k,"click",n[36]),L(y,"click",n[37]),L(M,"click",n[38])],P=!0)},p(Y,x){var le;(!U||x[0]&2)&&i!==(i=(((le=Y[1])==null?void 0:le.date)||"")+"")&&J(o,i),(!U||x[0]&2097152)&&ce(u,"active",Y[21]==="feed"),Y[4]>0?V?V.p(Y,x):(V=Hr(Y),V.c(),V.m(p,null)):V&&(V.d(1),V=null),(!U||x[0]&2097152)&&ce(p,"active",Y[21]==="suggestions"),(!U||x[0]&2097152)&&ce(k,"active",Y[21]==="inprogress"),Y[3].length>0?X?X.p(Y,x):(X=Wr(Y),X.c(),X.m(y,null)):X&&(X.d(1),X=null),(!U||x[0]&2097152)&&ce(y,"active",Y[21]==="captured"),Y[15].length>0?W?W.p(Y,x):(W=Gr(Y),W.c(),W.m(M,null)):W&&(W.d(1),W=null),(!U||x[0]&2097152)&&ce(M,"active",Y[21]==="browser");let ne=F;F=G(Y),F===ne?~F&&O[F].p(Y,x):(B&&(bt(),ve(O[ne],1,1,()=>{O[ne]=null}),vt()),~F?(B=O[F],B?B.p(Y,x):(B=O[F]=z[F](Y),B.c()),pe(B,1),B.m(e,null)):B=null)},i(Y){U||(pe(B),U=!0)},o(Y){ve(B),U=!1},d(Y){Y&&S(e),V&&V.d(),X&&X.d(),W&&W.d(),~F&&O[F].d(),P=!1,Se(H)}}}function ta(n){return n==="note_created"||n==="file_added"||n==="folder_added"||n==="node_created"?"+":n==="file_deleted"||n==="folder_deleted"?"×":n==="file_renamed"||n==="folder_renamed"||n==="node_updated"?"~":n==="file_copied"?"⧉":n==="file_moved"||n==="folder_moved"?"→":n==="note_updated"?"✎":n==="action_created"?"▶":n==="action_done"?"✓":n==="worklog_added"?"⏱":"•"}function Ci(n){const e=[];return n.nodePath&&e.push(n.nodePath),e.length>0?e.join(" → "):""}function na(n,e,t){const l=[...n];return l.sort((i,o)=>{let s=0;if(e==="name")s=(i.title||"").localeCompare(o.title||"");else if(e==="type"){const c=i.captureKind||i.sourceKind||"",u=o.captureKind||o.sourceKind||"";s=c.localeCompare(u)}else s=(i.capturedAt||i.createdAt||"").localeCompare(o.capturedAt||o.createdAt||"");return t==="asc"?s:-s}),l}function la(n){return{text:"📝",url:"🔗",file:"📄",image:"🖼",folder:"📁"}[n]||"📦"}function qb(n,e,t){let{todayDashboard:l=null}=e,{suggestions:i=[]}=e,{inProgressItems:o=[]}=e,{todayCaptures:s=[]}=e,{suggestionCount:c=0}=e,{formatTime:u=Q=>""}=e,{eventLabel:d=Q=>Q}=e,{eventIcon:p=Q=>""}=e,{inboxMetaText:m=Q=>""}=e,{onOpenNodeById:g=Q=>{}}=e,{onOpenActivityEvent:h=Q=>{}}=e,{onOpenActivityTarget:b=Q=>{}}=e,{onOpenSuggestionWorklog:k=Q=>{}}=e,{onAcceptSuggestion:E=Q=>{}}=e,{onDeleteSuggestion:y=Q=>{}}=e,{onOpenNodeFolder:T=Q=>{}}=e,{onOpenInboxArtifact:N=Q=>{}}=e,{onOpenTrashNode:A=Q=>{}}=e,{browserEvents:R=[]}=e,{browserLoading:M=!1}=e,{onBrowserAccept:I=Q=>{}}=e,{onBrowserDismiss:D=Q=>{}}=e,{onBrowserAttach:F=Q=>{}}=e,{onBrowserRefresh:B=()=>{}}=e,U="feed";function P(Q){E(Q)}function H(Q){y(Q)}function V(Q){return!Q||!Q.eventType?"":d(Q.eventType)}function X(Q){if(!(!Q||!Q.eventType)){if(Q.eventType==="folder_deleted"){Q.targetId&&A(Q.targetId);return}if(["file_added","file_deleted","file_renamed","file_copied","file_moved","folder_added","folder_renamed","folder_moved"].includes(Q.eventType)){Q.targetId?b(Q):Q.nodeId&&g(Q.nodeId);return}if(["note_created","note_updated","note_deleted"].includes(Q.eventType)){Q.targetType==="note"&&Q.targetId?b(Q):Q.nodeId&&g(Q.nodeId);return}if(Q.eventType==="worklog_added"){Q.nodeId&&g(Q.nodeId);return}if(["action_created","action_done"].includes(Q.eventType)){Q.nodeId&&g(Q.nodeId);return}(Q.id||Q.nodeId)&&h(Q)}}function W(Q,he,_e){const Me=[...Q];return Me.sort((rt,Qe)=>{let xe=0;return he==="name"?xe=(rt.title||"").localeCompare(Qe.title||""):he==="type"?xe=(d(rt.eventType)||"").localeCompare(d(Qe.eventType)||""):xe=(rt.createdAt||"").localeCompare(Qe.createdAt||""),_e==="asc"?xe:-xe}),Me}let z="time",O="desc",G="time",q="desc";const Y=()=>t(21,U="feed"),x=()=>t(21,U="suggestions"),ne=()=>t(21,U="inprogress"),le=()=>t(21,U="captured"),ie=()=>t(21,U="browser"),me=Q=>X(Q),Ne=Q=>X(Q),ze=(Q,he)=>he.key==="Enter"&&X(Q),Ye=Q=>g(Q.nodeId),Re=(Q,he,_e,Me)=>t(0,he[_e].suggestedMin=parseInt(Me.target.value),i),te=Q=>k(Q),re=Q=>P(Q),Ae=Q=>H(Q),Be=(Q,he,_e)=>t(0,he[_e]._expanded=!Q._expanded,i),be=(Q,he,_e,Me)=>Me.key==="Enter"&&t(0,he[_e]._expanded=!Q._expanded,i),We=Q=>b(Q),at=Q=>T(Q.nodeId),Te=()=>{t(22,z="time"),t(23,O=z==="time"&&O==="desc"?"asc":"desc")},nt=()=>{t(22,z="name"),t(23,O=z==="name"&&O==="desc"?"asc":"desc")},De=()=>{t(22,z="type"),t(23,O=z==="type"&&O==="desc"?"asc":"desc")},Ce=Q=>h(Q),Fe=(Q,he)=>he.key==="Enter"&&h(Q),je=()=>{t(24,G="time"),t(25,q=G==="time"&&q==="desc"?"asc":"desc")},Ge=()=>{t(24,G="name"),t(25,q=G==="name"&&q==="desc"?"asc":"desc")},Pe=()=>{t(24,G="type"),t(25,q=G==="type"&&q==="desc"?"asc":"desc")},fe=Q=>N(Q),ge=(Q,he)=>he.key==="Enter"&&N(Q);return n.$$set=Q=>{"todayDashboard"in Q&&t(1,l=Q.todayDashboard),"suggestions"in Q&&t(0,i=Q.suggestions),"inProgressItems"in Q&&t(2,o=Q.inProgressItems),"todayCaptures"in Q&&t(3,s=Q.todayCaptures),"suggestionCount"in Q&&t(4,c=Q.suggestionCount),"formatTime"in Q&&t(5,u=Q.formatTime),"eventLabel"in Q&&t(6,d=Q.eventLabel),"eventIcon"in Q&&t(7,p=Q.eventIcon),"inboxMetaText"in Q&&t(8,m=Q.inboxMetaText),"onOpenNodeById"in Q&&t(9,g=Q.onOpenNodeById),"onOpenActivityEvent"in Q&&t(10,h=Q.onOpenActivityEvent),"onOpenActivityTarget"in Q&&t(11,b=Q.onOpenActivityTarget),"onOpenSuggestionWorklog"in Q&&t(12,k=Q.onOpenSuggestionWorklog),"onAcceptSuggestion"in Q&&t(31,E=Q.onAcceptSuggestion),"onDeleteSuggestion"in Q&&t(32,y=Q.onDeleteSuggestion),"onOpenNodeFolder"in Q&&t(13,T=Q.onOpenNodeFolder),"onOpenInboxArtifact"in Q&&t(14,N=Q.onOpenInboxArtifact),"onOpenTrashNode"in Q&&t(33,A=Q.onOpenTrashNode),"browserEvents"in Q&&t(15,R=Q.browserEvents),"browserLoading"in Q&&t(16,M=Q.browserLoading),"onBrowserAccept"in Q&&t(17,I=Q.onBrowserAccept),"onBrowserDismiss"in Q&&t(18,D=Q.onBrowserDismiss),"onBrowserAttach"in Q&&t(19,F=Q.onBrowserAttach),"onBrowserRefresh"in Q&&t(20,B=Q.onBrowserRefresh)},[i,l,o,s,c,u,d,p,m,g,h,b,k,T,N,R,M,I,D,F,B,U,z,O,G,q,P,H,V,X,W,E,y,A,Y,x,ne,le,ie,me,Ne,ze,Ye,Re,te,re,Ae,Be,be,We,at,Te,nt,De,Ce,Fe,je,Ge,Pe,fe,ge]}class Zb extends tt{constructor(e){super(),et(this,e,qb,Vb,$e,{todayDashboard:1,suggestions:0,inProgressItems:2,todayCaptures:3,suggestionCount:4,formatTime:5,eventLabel:6,eventIcon:7,inboxMetaText:8,onOpenNodeById:9,onOpenActivityEvent:10,onOpenActivityTarget:11,onOpenSuggestionWorklog:12,onAcceptSuggestion:31,onDeleteSuggestion:32,onOpenNodeFolder:13,onOpenInboxArtifact:14,onOpenTrashNode:33,browserEvents:15,browserLoading:16,onBrowserAccept:17,onBrowserDismiss:18,onBrowserAttach:19,onBrowserRefresh:20},null,[-1,-1,-1])}}function Yb(n){let e,t,l,i,o=n[3]&&ia(n);return{c(){e=f("div"),o&&o.c(),t=w(),l=f("iframe"),r(l,"class","plugin-frame svelte-xgfxht"),r(l,"srcdoc",n[1]),r(l,"sandbox","allow-scripts allow-same-origin"),r(l,"title",i=n[0]+" panel"),r(e,"class","plugin-frame-container svelte-xgfxht")},m(s,c){C(s,e,c),o&&o.m(e,null),a(e,t),a(e,l),n[9](l)},p(s,c){s[3]?o?o.p(s,c):(o=ia(s),o.c(),o.m(e,t)):o&&(o.d(1),o=null),c&2&&r(l,"srcdoc",s[1]),c&1&&i!==(i=s[0]+" panel")&&r(l,"title",i)},d(s){s&&S(e),o&&o.d(),n[9](null)}}}function Xb(n){let e,t,l,i,o,s,c;return{c(){e=f("div"),t=f("p"),l=j("Плагин «"),i=j(n[0]),o=j("» активен, но HTML-панель не настроена."),s=w(),c=f("p"),c.innerHTML='Для отображения контента добавьте поле panel в plugin.json.',r(c,"class","hint"),r(e,"class","empty-state svelte-xgfxht")},m(u,d){C(u,e,d),a(e,t),a(t,l),a(t,i),a(t,o),a(e,s),a(e,c)},p(u,d){d&1&&J(i,u[0])},d(u){u&&S(e)}}}function Jb(n){let e;return{c(){e=f("p"),e.textContent="Загрузка…",r(e,"class","loading svelte-xgfxht")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function ia(n){let e,t,l;return{c(){e=f("div"),t=j("⚠ "),l=j(n[3]),r(e,"class","plugin-error-bar svelte-xgfxht")},m(i,o){C(i,e,o),a(e,t),a(e,l)},p(i,o){o&8&&J(l,i[3])},d(i){i&&S(e)}}}function Qb(n){let e;function t(o,s){return o[2]?Jb:o[1]?Yb:Xb}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","plugin-page svelte-xgfxht")},m(o,s){C(o,e,s),i.m(e,null)},p(o,[s]){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:oe,o:oe,d(o){o&&S(e),i.d()}}}function xn(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function xb(n,e,t){let l,i,o,s,{sectionId:c=""}=e,u="",d=!0,p="",m=null,g=[],h=!1;function b(I){console.log("[CalendarPluginPage] postToIframe: iframeReady="+h+", hasEl="+!!m+", hasCW="+!!(m!=null&&m.contentWindow)),m&&m.contentWindow&&h?(console.log("[CalendarPluginPage] postToIframe: sending msg.type="+I.type),m.contentWindow.postMessage(I,"*")):(console.log("[CalendarPluginPage] postToIframe: queuing msg.type="+I.type),g.push(I))}function k(I){if(!m||!m.contentWindow||I.source!==m.contentWindow)return;const D=I.data;if(!(!D||typeof D!="object")&&!(!D.source||typeof D.source!="string")&&!(!D.action||typeof D.action!="string"))switch(D.action){case"ready":for(h=!0;g.length>0;)m.contentWindow.postMessage(g.shift(),"*");E();break;case"get-events":y(D.data);break;case"create-event":T(D.data);break;case"update-event":N(D.data);break;case"delete-event":A(D.data);break;default:console.log("[CalendarPluginPage] Unknown iframe action:",D.action)}}async function E(){try{console.log("[CalendarPluginPage] loadCalendarData: step 1");const I=new Date,D=I.getFullYear(),F=I.getMonth(),B=new Date(D,F,1).toISOString().slice(0,10)+"T00:00:00",U=new Date(D,F+1,0).toISOString().slice(0,10)+"T23:59:59";console.log("[CalendarPluginPage] loadCalendarData: step 2, start="+B+", end="+U),console.log("[CalendarPluginPage] loadCalendarData: step 3, calling get_events...");const P=xn("CallPluginFunction",i,s+"get_events",JSON.stringify({start:B,end:U}));console.log("[CalendarPluginPage] loadCalendarData: step 4, calling get_categories...");const H=xn("CallPluginFunction",i,s+"get_categories","{}");console.log("[CalendarPluginPage] loadCalendarData: step 5, awaiting Promise.all...");const[V,X]=await Promise.all([P,H]);console.log("[CalendarPluginPage] loadCalendarData: step 6, got results, eventsRaw="+typeof V+", categoriesRaw="+typeof X);const W=V?JSON.parse(V):[],z=X?JSON.parse(X):[];b({source:"verstak",type:"calendar-data",events:W,categories:z});try{window.go.main.App.WriteDebugLog("[CalendarPluginPage] calendar-data sent to iframe, events.len="+W.length+", categories.len="+((z==null?void 0:z.length)||0)+", typeof events="+typeof W+", typeof eventsRaw="+typeof V+", eventsRaw.length="+V.length+", eventsRaw.substr(0,10)="+String(V).substring(0,10))}catch{}}catch(I){console.error("[CalendarPluginPage] loadCalendarData:",I),console.log("[CalendarPluginPage] error details:",JSON.stringify({message:String(I),stack:I==null?void 0:I.stack})),t(3,p=String(I))}}async function y(I){try{const D=JSON.stringify({start:I.start,end:I.end}),F=await xn("CallPluginFunction",i,s+"get_events",D),B=F?JSON.parse(F):[];b({source:"verstak",type:"calendar-data",events:B})}catch(D){console.error("[CalendarPluginPage] get-events:",D)}}async function T(I){try{const D=JSON.stringify(I),F=await xn("CallPluginFunction",i,s+"create_event",D),B=F?JSON.parse(F):{};b({source:"verstak",type:"event-created",event:B}),E()}catch(D){console.error("[CalendarPluginPage] create-event:",D),b({source:"verstak",type:"error",message:String(D)})}}async function N(I){try{const D=JSON.stringify(I);await xn("CallPluginFunction",i,s+"update_event",D),b({source:"verstak",type:"event-updated",event:I}),E()}catch(D){console.error("[CalendarPluginPage] update-event:",D)}}async function A(I){try{const D=JSON.stringify({id:I.id});await xn("CallPluginFunction",i,s+"delete_event",D),b({source:"verstak",type:"event-deleted",id:I.id}),E()}catch(D){console.error("[CalendarPluginPage] delete-event:",D)}}Xl(async()=>{try{t(1,u=await xn("GetPluginPanelHTML",i)||"")}catch(I){t(3,p=String(I))}t(2,d=!1),window.addEventListener("message",k)}),Jl(()=>{window.removeEventListener("message",k)});function R(I,D){b({source:"verstak",type:"drop",date:D,data:I})}function M(I){En[I?"unshift":"push"](()=>{m=I,t(4,m)})}return n.$$set=I=>{"sectionId"in I&&t(5,c=I.sectionId)},n.$$.update=()=>{n.$$.dirty&32&&t(8,l=c.split(":")),n.$$.dirty&256&&t(0,i=l[1]||""),n.$$.dirty&256&&t(7,o=l[2]||"main"),n.$$.dirty&128&&o.charAt(0).toUpperCase()+o.slice(1),n.$$.dirty&1&&(s=i?i+".":"")},[i,u,d,p,m,c,R,o,l,M]}class $b extends tt{constructor(e){super(),et(this,e,xb,Qb,$e,{sectionId:5,handleDrop:6})}get handleDrop(){return this.$$.ctx[6]}}const jf={й:"q",ц:"w",у:"e",к:"r",е:"t",н:"y",г:"u",ш:"i",щ:"o",з:"p",х:"[",ъ:"]",ф:"a",ы:"s",в:"d",а:"f",п:"g",р:"h",о:"j",л:"k",д:"l",ж:";",э:"'",я:"z",ч:"x",с:"c",м:"v",и:"b",т:"n",ь:"m",ю:",",ё:"`",Й:"Q",Ц:"W",У:"E",К:"R",Е:"T",Н:"Y",Г:"U",Ш:"I",Щ:"O",З:"P",Х:"{",Ъ:"}",Ф:"A",Ы:"S",В:"D",А:"F",П:"G",Р:"H",О:"J",Л:"K",Д:"L",Ж:":",Э:'"',Я:"Z",Ч:"X",С:"C",М:"V",И:"B",Т:"N",Ь:"M",Ю:"<",Ё:"~"},Uf={};for(const[n,e]of Object.entries(jf))Uf[e]=n;function Hf(n,e){let t="";for(const l of n)t+=e[l]??l;return t}function ev(n){return Hf(n,jf)}function tv(n){return Hf(n,Uf)}function Wf(n){const e=new Set;e.add(n);const t=ev(n);t!==n&&e.add(t);const l=tv(n);l!==n&&e.add(l);const i=new Set;for(const o of e)i.add(o.toLowerCase());for(const o of i)e.add(o);return Array.from(e)}function sa(n,e,t){const l=n.slice();return l[25]=e[t],l[27]=t,l}function oa(n){let e;function t(o,s){return o[3]?iv:o[1].length===0?lv:nv}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","global-search-results svelte-1dlr37h")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},d(o){o&&S(e),i.d()}}}function nv(n){let e,t=ye(n[1]),l=[];for(let i=0;i[]}=e,{typeLabel:i=P=>P||""}=e;const o=tn();let s="",c=[],u=!1,d=!1,p=0,m,g;function h(P){const H=[],V=i(P.type),X=ov(P);return V&&H.push(V),X&&H.push(X),H.join(" · ")}async function b(){const P=Gf(s);if(P.length<2){t(1,c=[]),t(2,u=!1),t(3,d=!1);return}t(3,d=!0);try{const H=Wf(P),V=new Set,X=[];for(const O of H)V.has(O)||(V.add(O),X.push(O));const W=await Promise.all(X.map(O=>l("Search",O).catch(()=>[]))),z=new Map;for(let O=0;O0)}catch{t(1,c=[]),t(2,u=!1)}finally{t(3,d=!1)}}function k(){clearTimeout(g),g=setTimeout(b,180)}function E(){t(2,u=!1),t(4,p=0)}function y(){t(0,s=""),t(1,c=[]),E()}function T(P){P&&(o("open",P),y(),m==null||m.blur())}function N(){k()}function A(P){if(P.key==="Escape"){P.preventDefault(),y(),m==null||m.blur();return}!u||c.length===0||(P.key==="ArrowDown"?(P.preventDefault(),t(4,p=Math.min(c.length-1,p+1))):P.key==="ArrowUp"?(P.preventDefault(),t(4,p=Math.max(0,p-1))):P.key==="Enter"&&(P.preventDefault(),T(c[p])))}async function R(){await Y1(),m==null||m.focus(),m==null||m.select()}function M(P){if((P.ctrlKey||P.metaKey)&&P.key.toLowerCase()==="k"){P.preventDefault(),R();return}P.key==="/"&&!rv(P.target)&&(P.preventDefault(),R())}Xl(()=>{window.addEventListener("keydown",M)}),Jl(()=>{window.removeEventListener("keydown",M),clearTimeout(g)});function I(P){En[P?"unshift":"push"](()=>{m=P,t(5,m)})}function D(){s=this.value,t(0,s)}const F=()=>{c.length>0&&t(2,u=!0)},B=()=>setTimeout(E,160),U=P=>T(P);return n.$$set=P=>{"wailsCall"in P&&t(11,l=P.wailsCall),"typeLabel"in P&&t(12,i=P.typeLabel)},[s,c,u,d,p,m,h,E,T,N,A,l,i,I,D,F,B,U]}class cv extends tt{constructor(e){super(),et(this,e,av,sv,$e,{wailsCall:11,typeLabel:12})}}const uv=n=>({}),ua=n=>({});function fa(n){let e,t;return{c(){e=f("span"),t=j(n[1]),r(e,"class","header-subtitle svelte-7x8q9h")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&2&&J(t,l[1])},d(l){l&&S(e)}}}function fv(n){let e,t,l,i=(n[0]||"")+"",o,s,c,u,d,p,m,g=n[1]&&fa(n);d=new cv({props:{wailsCall:n[2],typeLabel:n[3]}}),d.$on("open",n[7]);const h=n[6].actions,b=W1(h,n,n[5],ua);return{c(){e=f("header"),t=f("div"),l=f("span"),o=j(i),s=w(),g&&g.c(),c=w(),u=f("div"),Ze(d.$$.fragment),p=w(),b&&b.c(),r(l,"class","header-title svelte-7x8q9h"),ce(l,"placeholder",!n[0]),r(t,"class","header-left svelte-7x8q9h"),r(u,"class","header-right svelte-7x8q9h"),r(e,"class","header svelte-7x8q9h")},m(k,E){C(k,e,E),a(e,t),a(t,l),a(l,o),a(t,s),g&&g.m(t,null),a(e,c),a(e,u),Ve(d,u,null),a(u,p),b&&b.m(u,null),m=!0},p(k,[E]){(!m||E&1)&&i!==(i=(k[0]||"")+"")&&J(o,i),(!m||E&1)&&ce(l,"placeholder",!k[0]),k[1]?g?g.p(k,E):(g=fa(k),g.c(),g.m(t,null)):g&&(g.d(1),g=null);const y={};E&4&&(y.wailsCall=k[2]),E&8&&(y.typeLabel=k[3]),d.$set(y),b&&b.p&&(!m||E&32)&&K1(b,h,k,k[5],m?G1(h,k[5],E,uv):V1(k[5]),ua)},i(k){m||(pe(d.$$.fragment,k),pe(b,k),m=!0)},o(k){ve(d.$$.fragment,k),ve(b,k),m=!1},d(k){k&&S(e),g&&g.d(),qe(d),b&&b.d(k)}}}function dv(n,e,t){let{$$slots:l={},$$scope:i}=e,{title:o=""}=e,{subtitle:s=""}=e,{wailsCall:c=async()=>[]}=e,{typeLabel:u=m=>m||""}=e,{onOpenSearchResult:d=()=>{}}=e;const p=m=>d(m.detail);return n.$$set=m=>{"title"in m&&t(0,o=m.title),"subtitle"in m&&t(1,s=m.subtitle),"wailsCall"in m&&t(2,c=m.wailsCall),"typeLabel"in m&&t(3,u=m.typeLabel),"onOpenSearchResult"in m&&t(4,d=m.onOpenSearchResult),"$$scope"in m&&t(5,i=m.$$scope)},[o,s,c,u,d,i,l,p]}class pv extends tt{constructor(e){super(),et(this,e,dv,fv,$e,{title:0,subtitle:1,wailsCall:2,typeLabel:3,onOpenSearchResult:4})}}const mv={open:'',showInExplorer:'',delete:'',restore:'',purge:'',move:'',attach:'',back:'',emptyTrash:'',folder:''};function kt(n,e=16){return`${mv[n]||""}`}function gv(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y,T,N,A,R,M,I,D,F,B,U,P,H,V,X,W,z,O,G,q,Y,x;return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),i.innerHTML='B',o=w(),s=f("button"),s.innerHTML='I',c=w(),u=f("button"),u.innerHTML='H',d=w(),p=f("div"),m=w(),g=f("div"),h=f("button"),h.innerHTML='',b=w(),k=f("button"),k.innerHTML='',E=w(),y=f("button"),T=f("span"),T.textContent="",N=w(),A=f("div"),R=w(),M=f("div"),I=f("button"),I.innerHTML='',D=w(),F=f("button"),F.innerHTML='1.',B=w(),U=f("button"),U.innerHTML='',P=w(),H=f("button"),H.innerHTML='"',V=w(),X=f("div"),W=w(),z=f("div"),O=f("button"),O.innerHTML='',G=w(),q=f("textarea"),r(i,"type","button"),r(i,"class","md-toolbar-btn svelte-1etjgc1"),r(i,"title",v("note.toolbar.bold")),r(i,"aria-label",v("note.toolbar.bold")),r(s,"type","button"),r(s,"class","md-toolbar-btn svelte-1etjgc1"),r(s,"title",v("note.toolbar.italic")),r(s,"aria-label",v("note.toolbar.italic")),r(u,"type","button"),r(u,"class","md-toolbar-btn svelte-1etjgc1"),r(u,"title",v("note.toolbar.heading")),r(u,"aria-label",v("note.toolbar.heading")),r(l,"class","md-toolbar-group svelte-1etjgc1"),r(p,"class","md-toolbar-sep svelte-1etjgc1"),r(h,"type","button"),r(h,"class","md-toolbar-btn svelte-1etjgc1"),r(h,"title",v("note.toolbar.link")),r(h,"aria-label",v("note.toolbar.link")),r(k,"type","button"),r(k,"class","md-toolbar-btn svelte-1etjgc1"),r(k,"title",v("note.toolbar.code")),r(k,"aria-label",v("note.toolbar.code")),r(T,"class","md-btn-label md-btn-sm svelte-1etjgc1"),r(y,"type","button"),r(y,"class","md-toolbar-btn svelte-1etjgc1"),r(y,"title",v("note.toolbar.codeBlock")),r(y,"aria-label",v("note.toolbar.codeBlock")),r(g,"class","md-toolbar-group svelte-1etjgc1"),r(A,"class","md-toolbar-sep svelte-1etjgc1"),r(I,"type","button"),r(I,"class","md-toolbar-btn svelte-1etjgc1"),r(I,"title",v("note.toolbar.bulletList")),r(I,"aria-label",v("note.toolbar.bulletList")),r(F,"type","button"),r(F,"class","md-toolbar-btn svelte-1etjgc1"),r(F,"title",v("note.toolbar.numberedList")),r(F,"aria-label",v("note.toolbar.numberedList")),r(U,"type","button"),r(U,"class","md-toolbar-btn svelte-1etjgc1"),r(U,"title",v("note.toolbar.checkbox")),r(U,"aria-label",v("note.toolbar.checkbox")),r(H,"type","button"),r(H,"class","md-toolbar-btn svelte-1etjgc1"),r(H,"title",v("note.toolbar.quote")),r(H,"aria-label",v("note.toolbar.quote")),r(M,"class","md-toolbar-group svelte-1etjgc1"),r(X,"class","md-toolbar-sep svelte-1etjgc1"),r(O,"type","button"),r(O,"class","md-toolbar-btn md-toolbar-btn--internal svelte-1etjgc1"),r(O,"title",v("note.toolbar.internalLink")),r(O,"aria-label",v("note.toolbar.internalLink")),r(z,"class","md-toolbar-group svelte-1etjgc1"),r(t,"class","md-toolbar svelte-1etjgc1"),r(t,"role","toolbar"),r(t,"aria-label","Markdown formatting"),r(q,"class","md-textarea svelte-1etjgc1"),r(q,"placeholder",n[2]),r(q,"spellcheck","true"),r(e,"class","md-editor svelte-1etjgc1"),ce(e,"mode-edit",n[1]==="edit"||n[1]==="split")},m(ne,le){C(ne,e,le),a(e,t),a(t,l),a(l,i),a(l,o),a(l,s),a(l,c),a(l,u),a(t,d),a(t,p),a(t,m),a(t,g),a(g,h),a(g,b),a(g,k),a(g,E),a(g,y),a(y,T),a(t,N),a(t,A),a(t,R),a(t,M),a(M,I),a(M,D),a(M,F),a(M,B),a(M,U),a(M,P),a(M,H),a(t,V),a(t,X),a(t,W),a(t,z),a(z,O),a(e,G),a(e,q),Le(q,n[0]),n[19](q),Y||(x=[L(i,"click",n[4]),L(s,"click",n[5]),L(u,"click",n[8]),L(h,"click",n[7]),L(k,"click",n[6]),L(y,"click",n[13]),L(I,"click",n[10]),L(F,"click",n[11]),L(U,"click",n[12]),L(H,"click",n[9]),L(O,"click",n[14]),L(q,"input",n[18]),L(q,"input",n[15]),L(q,"keydown",n[16])],Y=!0)},p(ne,[le]){le&4&&r(q,"placeholder",ne[2]),le&1&&Le(q,ne[0]),le&2&&ce(e,"mode-edit",ne[1]==="edit"||ne[1]==="split")},i:oe,o:oe,d(ne){ne&&S(e),n[19](null),Y=!1,Se(x)}}}function hv(n,e,t){let{content:l=""}=e,{viewMode:i="edit"}=e,{placeholder:o=""}=e;const s=tn();let c;function u(B){const U=c;if(!U)return;const P=U.selectionStart,H=U.selectionEnd,V=l.substring(0,P),X=l.substring(H),W=V+B+X;t(0,l=W),s("content-change",{content:W}),requestAnimationFrame(()=>{U.focus(),U.selectionStart=U.selectionEnd=P+B.length})}function d(B,U="",P=""){const H=c;if(!H)return;const V=H.selectionStart,X=H.selectionEnd,W=l.substring(V,X),O=B+(W||P)+U,G=l.substring(0,V)+O+l.substring(X);t(0,l=G),s("content-change",{content:G}),requestAnimationFrame(()=>{H.focus(),W?(H.selectionStart=V+B.length,H.selectionEnd=V+B.length+W.length):(H.selectionStart=V+B.length,H.selectionEnd=V+B.length+P.length)})}function p(B){const U=c;if(!U)return;const P=U.selectionStart,H=U.selectionEnd;let V=P;for(;V>0&&l[V-1]!==` `;)V--;let X=H;for(;XY.startsWith(B)?Y:B+Y).join(` `),q=l.substring(0,V)+G+l.substring(X);t(0,l=q),s("content-change",{content:q}),requestAnimationFrame(()=>{U.focus(),U.selectionStart=V,U.selectionEnd=V+G.length})}function m(){d("**","**","bold text")}function g(){d("*","*","italic text")}function h(){d("`","`","code")}function b(){s("insert-link")}function k(){p("## ")}function E(){p("> ")}function y(){p("- ")}function T(){const B=c;if(!B)return;let P=B.selectionStart;for(;P>0&&l[P-1]!==` `;)P--;let H=B.selectionEnd;for(;H{const Y=q.trim();return q.replace(/^\s*\d+\.\s*/,""),`${W++}. ${Y||"item"}`}).join(` `),G=l.substring(0,P)+O+l.substring(H);t(0,l=G),s("content-change",{content:G}),requestAnimationFrame(()=>{B.focus(),B.selectionStart=P,B.selectionEnd=P+O.length})}function N(){p("- [ ] ")}function A(){const B=c;if(!B)return;const U=B.selectionStart,P=B.selectionEnd,H=l.substring(U,P),V=H?"```\n"+H+"\n```":"```\ncode here\n```",X=l.substring(0,U)+V+l.substring(P);t(0,l=X),s("content-change",{content:X}),requestAnimationFrame(()=>{B.focus(),H?(B.selectionStart=U+4,B.selectionEnd=U+4+H.length):(B.selectionStart=U+4,B.selectionEnd=U+4+9)})}function R(){s("insert-internal-link")}function M(B){t(0,l=B.target.value),s("content-change",{content:l})}function I(B){if((B.ctrlKey||B.metaKey)&&B.key==="s"){B.preventDefault(),s("save");return}if(B.key==="Tab"){B.preventDefault();const U=B.target,P=U.selectionStart,H=U.selectionEnd;if(B.shiftKey){let V=P;for(;V>0&&l[V-1]!==` `;)V--;let X=H;for(;X{U.focus(),U.selectionStart=V,U.selectionEnd=V+z.length})}else if(P===H){const V=l.substring(0,P)+" "+l.substring(H);t(0,l=V),s("content-change",{content:V}),requestAnimationFrame(()=>{U.focus(),U.selectionStart=U.selectionEnd=P+2})}else{let V=P;for(;V>0&&l[V-1]!==` `;)V--;let X=H;for(;X{U.focus(),U.selectionStart=V,U.selectionEnd=V+z.length})}}}function D(){l=this.value,t(0,l)}function F(B){En[B?"unshift":"push"](()=>{c=B,t(3,c)})}return n.$$set=B=>{"content"in B&&t(0,l=B.content),"viewMode"in B&&t(1,i=B.viewMode),"placeholder"in B&&t(2,o=B.placeholder)},[l,i,o,c,m,g,h,b,k,E,y,T,N,A,R,M,I,u,D,F]}class Kf extends tt{constructor(e){super(),et(this,e,hv,gv,$e,{content:0,viewMode:1,placeholder:2,insertText:17})}get insertText(){return this.$$.ctx[17]}}function As(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ol=As();function Vf(n){ol=n}var el={exec:()=>null};function _l(n){let e=[];return t=>{let l=Math.max(0,Math.min(3,t-1)),i=e[l];return i||(i=n(l),e[l]=i),i}}function ot(n,e=""){let t=typeof n=="string"?n:n.source,l={replace:(i,o)=>{let s=typeof o=="string"?o:o.source;return s=s.replace(Ht.caret,"$1"),t=t.replace(i,s),l},getRegex:()=>new RegExp(t,e)};return l}var _v=((n="")=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:_l(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:_l(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:_l(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:_l(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:_l(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:_l(n=>new RegExp(`^ {0,${n}}>`))},bv=/^(?:[ \t]*(?:\n|$))+/,vv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ql=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ns=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,qf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Zf=ot(qf).replace(/bull/g,Ns).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),yv=ot(qf).replace(/bull/g,Ns).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Rs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ev=/^[^\n]+/,Is=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Tv=ot(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Is).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Sv=ot(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ns).getRegex(),Oi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ms=/|$))/,Cv=ot("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ms).replace("tag",Oi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yf=ot(Rs).replace("hr",Ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Oi).getRegex(),Av=ot(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Yf).getRegex(),Ls={blockquote:Av,code:vv,def:Tv,fences:kv,heading:wv,hr:Ql,html:Cv,lheading:Zf,list:Sv,newline:bv,paragraph:Yf,table:el,text:Ev},da=ot("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Oi).getRegex(),Nv={...Ls,lheading:yv,table:da,paragraph:ot(Rs).replace("hr",Ql).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",da).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Oi).getRegex()},Rv={...Ls,html:ot(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ms).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:el,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ot(Rs).replace("hr",Ql).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Zf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Iv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Mv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Xf=/^( {2,}|\\)\n(?!\s*$)/,Lv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",_v?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Qf=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Bv=ot(Qf,"u").replace(/punct/g,Cl).getRegex(),Fv=ot(Qf,"u").replace(/punct/g,Jf).getRegex(),xf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",jv=ot(xf,"gu").replace(/notPunctSpace/g,Ds).replace(/punctSpace/g,Pi).replace(/punct/g,Cl).getRegex(),Uv=ot(xf,"gu").replace(/notPunctSpace/g,Pv).replace(/punctSpace/g,Ov).replace(/punct/g,Jf).getRegex(),Hv=ot("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ds).replace(/punctSpace/g,Pi).replace(/punct/g,Cl).getRegex(),Wv=ot(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Cl).getRegex(),Gv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Kv=ot(Gv,"gu").replace(/notPunctSpace/g,Ds).replace(/punctSpace/g,Pi).replace(/punct/g,Cl).getRegex(),Vv=ot(/\\(punct)/,"gu").replace(/punct/g,Cl).getRegex(),qv=ot(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Zv=ot(Ms).replace("(?:-->|$)","-->").getRegex(),Yv=ot("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Zv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ai=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Xv=ot(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ai).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$f=ot(/^!?\[(label)\]\[(ref)\]/).replace("label",Ai).replace("ref",Is).getRegex(),ed=ot(/^!?\[(ref)\](?:\[\])?/).replace("ref",Is).getRegex(),Jv=ot("reflink|nolink(?!\\()","g").replace("reflink",$f).replace("nolink",ed).getRegex(),pa=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Os={_backpedal:el,anyPunctuation:Vv,autolink:qv,blockSkip:zv,br:Xf,code:Mv,del:el,delLDelim:el,delRDelim:el,emStrongLDelim:Bv,emStrongRDelimAst:jv,emStrongRDelimUnd:Hv,escape:Iv,link:Xv,nolink:ed,punctuation:Dv,reflink:$f,reflinkSearch:Jv,tag:Yv,text:Lv,url:el},Qv={...Os,link:ot(/^!?\[(label)\]\((.*?)\)/).replace("label",Ai).getRegex(),reflink:ot(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ai).getRegex()},vs={...Os,emStrongRDelimAst:Uv,emStrongLDelim:Fv,delLDelim:Wv,delRDelim:Kv,url:ot(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",pa).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ot(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},ma=n=>$v[n];function kn(n,e){if(e){if(Ht.escapeTest.test(n))return n.replace(Ht.escapeReplace,ma)}else if(Ht.escapeTestNoEncode.test(n))return n.replace(Ht.escapeReplaceNoEncode,ma);return n}function ga(n){try{n=encodeURI(n).replace(Ht.percentDecode,"%")}catch{return null}return n}function ha(n,e){var o;let t=n.replace(Ht.findPipe,(s,c,u)=>{let d=!1,p=c;for(;--p>=0&&u[p]==="\\";)d=!d;return d?"|":" |"}),l=t.split(Ht.splitPipe),i=0;if(l[0].trim()||l.shift(),l.length>0&&!((o=l.at(-1))!=null&&o.trim())&&l.pop(),e)if(l.length>e)l.splice(e);else for(;l.length=0&&Ht.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(` `)}function e0(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let l=0;l0?-2:-1}function t0(n,e=0){let t=e,l="";for(let i of n)if(i===" "){let o=4-t%4;l+=" ".repeat(o),t+=o}else l+=i,t++;return l}function ba(n,e,t,l,i){let o=e.href,s=e.title||null,c=n[1].replace(i.other.outputLinkReplace,"$1");l.state.inLink=!0;let u={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:o,title:s,text:c,tokens:l.inlineTokens(c)};return l.state.inLink=!1,u}function n0(n,e,t){let l=n.match(t.other.indentCodeCompensation);if(l===null)return e;let i=l[1];return e.split(` `).map(o=>{let s=o.match(t.other.beginningSpace);if(s===null)return o;let[c]=s;return c.length>=i.length?o.slice(i.length):o}).join(` `)}var Ni=class{constructor(n){it(this,"options");it(this,"rules");it(this,"lexer");this.options=n||ol}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=this.options.pedantic?e[0]:_a(e[0]),l=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:l}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],l=n0(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:l}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let l=Pn(t,"#");(this.options.pedantic||!l||this.rules.other.endingSpaceChar.test(l))&&(t=l.trim())}return{type:"heading",raw:Pn(e[0],` `),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Pn(e[0],` `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=Pn(e[0],` `).split(` `),l="",i="",o=[];for(;t.length>0;){let s=!1,c=[],u;for(u=0;u1,i={type:"list",raw:"",ordered:l,start:l?+t.slice(0,-1):"",loose:!1,items:[]};t=l?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=l?t:"[*+-]");let o=this.rules.other.listItemRegex(t),s=!1;for(;n;){let u=!1,d="",p="";if(!(e=o.exec(n))||this.rules.block.hr.test(n))break;d=e[0],n=n.substring(d.length);let m=t0(e[2].split(` `,1)[0],e[1].length),g=n.split(` `,1)[0],h=!m.trim(),b=0;if(this.options.pedantic?(b=2,p=m.trimStart()):h?b=e[1].length+1:(b=m.search(this.rules.other.nonSpaceChar),b=b>4?1:b,p=m.slice(b),b+=e[1].length),h&&this.rules.other.blankLine.test(g)&&(d+=g+` `,n=n.substring(g.length+1),u=!0),!u){let k=this.rules.other.nextBulletRegex(b),E=this.rules.other.hrRegex(b),y=this.rules.other.fencesBeginRegex(b),T=this.rules.other.headingBeginRegex(b),N=this.rules.other.htmlBeginRegex(b),A=this.rules.other.blockquoteBeginRegex(b);for(;n;){let R=n.split(` `,1)[0],M;if(g=R,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),M=g):M=g.replace(this.rules.other.tabCharGlobal," "),y.test(g)||T.test(g)||N.test(g)||A.test(g)||k.test(g)||E.test(g))break;if(M.search(this.rules.other.nonSpaceChar)>=b||!g.trim())p+=` `+M.slice(b);else{if(h||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(m)||T.test(m)||E.test(m))break;p+=` `+g}h=!g.trim(),d+=R+` `,n=n.substring(R.length+1),m=M.slice(b)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(s=!0)),i.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=d}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]);let d=u.tokens[0];if(u.task&&((d==null?void 0:d.type)==="text"||(d==null?void 0:d.type)==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(u.raw);if(p){let m={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};u.checked=m.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=m.raw+u.tokens[0].raw,u.tokens[0].text=m.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(m)):u.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):u.tokens.unshift(m)}}else u.task&&(u.task=!1);if(!i.loose){let p=u.tokens.filter(g=>g.type==="space"),m=p.length>0&&p.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=m}}if(i.loose)for(let u of i.items){u.loose=!0;for(let d of u.tokens)d.type==="text"&&(d.type="paragraph")}return i}}html(n){let e=this.rules.block.html.exec(n);if(e){let t=_a(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),l=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:Pn(e[0],` `),href:l,title:i}}}table(n){var s;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ha(e[1]),l=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(s=e[3])!=null&&s.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` `):[],o={type:"table",raw:Pn(e[0],` `),header:[],align:[],rows:[]};if(t.length===l.length){for(let c of l)this.rules.other.tableAlignRight.test(c)?o.align.push("right"):this.rules.other.tableAlignCenter.test(c)?o.align.push("center"):this.rules.other.tableAlignLeft.test(c)?o.align.push("left"):o.align.push(null);for(let c=0;c({text:u,tokens:this.lexer.inline(u),header:!1,align:o.align[d]})));return o}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:Pn(e[0],` `),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===` `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let o=Pn(t.slice(0,-1),"\\");if((t.length-o.length)%2===0)return}else{let o=e0(e[2],"()");if(o===-2)return;if(o>-1){let s=(e[0].indexOf("!")===0?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,s).trim(),e[3]=""}}let l=e[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(l);o&&(l=o[1],i=o[3])}else i=e[3]?e[3].slice(1,-1):"";return l=l.trim(),this.rules.other.startAngleBracket.test(l)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?l=l.slice(1):l=l.slice(1,-1)),ba(e,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let l=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[l.toLowerCase()];if(!i){let o=t[0].charAt(0);return{type:"text",raw:o,text:o}}return ba(t,i,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let l=this.rules.inline.emStrongLDelim.exec(n);if(!(!l||!l[1]&&!l[2]&&!l[3]&&!l[4]||l[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(l[1]||l[3])||!t||this.rules.inline.punctuation.exec(t))){let i=[...l[0]].length-1,o,s,c=i,u=0,d=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+i);(l=d.exec(e))!==null;){if(o=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!o)continue;if(s=[...o].length,l[3]||l[4]){c+=s;continue}else if((l[5]||l[6])&&i%3&&!((i+s)%3)){u+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c+u);let p=[...l[0]][0].length,m=n.slice(0,i+l.index+p+s);if(Math.min(i,s)%2){let h=m.slice(1,-1);return{type:"em",raw:m,text:h,tokens:this.lexer.inlineTokens(h)}}let g=m.slice(2,-2);return{type:"strong",raw:m,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),l=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return l&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let l=this.rules.inline.delLDelim.exec(n);if(l&&(!l[1]||!t||this.rules.inline.punctuation.exec(t))){let i=[...l[0]].length-1,o,s,c=i,u=this.rules.inline.delRDelim;for(u.lastIndex=0,e=e.slice(-1*n.length+i);(l=u.exec(e))!==null;){if(o=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!o||(s=[...o].length,s!==i))continue;if(l[3]||l[4]){c+=s;continue}if(c-=s,c>0)continue;s=Math.min(s,s+c);let d=[...l[0]][0].length,p=n.slice(0,i+l.index+d+s),m=p.slice(i,-i);return{type:"del",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,l;return e[2]==="@"?(t=e[1],l="mailto:"+t):(t=e[1],l=t),{type:"link",raw:e[0],text:t,href:l,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let l,i;if(e[2]==="@")l=e[0],i="mailto:"+l;else{let o;do o=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(o!==e[0]);l=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:l,href:i,tokens:[{type:"text",raw:l,text:l}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},un=class ks{constructor(e){it(this,"tokens");it(this,"options");it(this,"state");it(this,"inlineQueue");it(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ol,this.options.tokenizer=this.options.tokenizer||new Ni,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Ht,block:di.normal,inline:Bl.normal};this.options.pedantic?(t.block=di.pedantic,t.inline=Bl.pedantic):this.options.gfm&&(t.block=di.gfm,this.options.breaks?t.inline=Bl.breaks:t.inline=Bl.gfm),this.tokenizer.rules=t}static get rules(){return{block:di,inline:Bl}}static lex(e,t){return new ks(t).lex(e)}static lexInline(e,t){return new ks(t).inlineTokens(e)}lex(e){e=e.replace(Ht.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let t=0;t(u=p.call({lexer:this},e,t))?(e=e.substring(u.raw.length),t.push(u),!0):!1))continue;if(u=this.tokenizer.space(e)){e=e.substring(u.raw.length);let p=t.at(-1);u.raw.length===1&&p!==void 0?p.raw+=` `:t.push(u);continue}if(u=this.tokenizer.code(e)){e=e.substring(u.raw.length);let p=t.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(` `)?"":` `)+u.raw,p.text+=` `+u.text,this.inlineQueue.at(-1).src=p.text):t.push(u);continue}if(u=this.tokenizer.fences(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.heading(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.hr(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.blockquote(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.list(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.html(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.def(e)){e=e.substring(u.raw.length);let p=t.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(` `)?"":` `)+u.raw,p.text+=` `+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},t.push(u));continue}if(u=this.tokenizer.table(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.lheading(e)){e=e.substring(u.raw.length),t.push(u);continue}let d=e;if((c=this.options.extensions)!=null&&c.startBlock){let p=1/0,m=e.slice(1),g;this.options.extensions.startBlock.forEach(h=>{g=h.call({lexer:this},m),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(d=e.substring(0,p+1))}if(this.state.top&&(u=this.tokenizer.paragraph(d))){let p=t.at(-1);l&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(` `)?"":` `)+u.raw,p.text+=` `+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):t.push(u),l=d.length!==e.length,e=e.substring(u.raw.length);continue}if(u=this.tokenizer.text(e)){e=e.substring(u.raw.length);let p=t.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(` `)?"":` `)+u.raw,p.text+=` `+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):t.push(u);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var d,p,m,g,h;this.tokenizer.lexer=this;let l=e,i=null;if(this.tokens.links){let b=Object.keys(this.tokens.links);if(b.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(l))!==null;)b.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(l))!==null;)l=l.slice(0,i.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(l))!==null;)o=i[2]?i[2].length:0,l=l.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);l=((p=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:p.call({lexer:this},l))??l;let s=!1,c="",u=1/0;for(;e;){if(e.length(b=E.call({lexer:this},e,t))?(e=e.substring(b.raw.length),t.push(b),!0):!1))continue;if(b=this.tokenizer.escape(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.tag(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.link(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(b.raw.length);let E=t.at(-1);b.type==="text"&&(E==null?void 0:E.type)==="text"?(E.raw+=b.raw,E.text+=b.text):t.push(b);continue}if(b=this.tokenizer.emStrong(e,l,c)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.codespan(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.br(e)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.del(e,l,c)){e=e.substring(b.raw.length),t.push(b);continue}if(b=this.tokenizer.autolink(e)){e=e.substring(b.raw.length),t.push(b);continue}if(!this.state.inLink&&(b=this.tokenizer.url(e))){e=e.substring(b.raw.length),t.push(b);continue}let k=e;if((h=this.options.extensions)!=null&&h.startInline){let E=1/0,y=e.slice(1),T;this.options.extensions.startInline.forEach(N=>{T=N.call({lexer:this},y),typeof T=="number"&&T>=0&&(E=Math.min(E,T))}),E<1/0&&E>=0&&(k=e.substring(0,E+1))}if(b=this.tokenizer.inlineText(k)){e=e.substring(b.raw.length),b.raw.slice(-1)!=="_"&&(c=b.raw.slice(-1)),s=!0;let E=t.at(-1);(E==null?void 0:E.type)==="text"?(E.raw+=b.raw,E.text+=b.text):t.push(b);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},Ri=class{constructor(n){it(this,"options");it(this,"parser");this.options=n||ol}space(n){return""}code({text:n,lang:e,escaped:t}){var o;let l=(o=(e||"").match(Ht.notSpaceStart))==null?void 0:o[0],i=n.replace(Ht.endingNewline,"")+` `;return l?'
'+(t?i:kn(i,!0))+`
`:"
"+(t?i:kn(i,!0))+`
`}blockquote({tokens:n}){return`
${this.parser.parse(n)}
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`${this.parser.parseInline(n)} `}hr(n){return`
`}list(n){let e=n.ordered,t=n.start,l="";for(let s=0;s `+l+" `}listitem(n){return`
  • ${this.parser.parse(n.tokens)}
  • `}checkbox({checked:n}){return" '}paragraph({tokens:n}){return`

    ${this.parser.parseInline(n)}

    `}table(n){let e="",t="";for(let i=0;i${l}`),` `+e+` `+l+`
    `}tablerow({text:n}){return` ${n} `}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+` `}strong({tokens:n}){return`${this.parser.parseInline(n)}`}em({tokens:n}){return`${this.parser.parseInline(n)}`}codespan({text:n}){return`${kn(n,!0)}`}br(n){return"
    "}del({tokens:n}){return`${this.parser.parseInline(n)}`}link({href:n,title:e,tokens:t}){let l=this.parser.parseInline(t),i=ga(n);if(i===null)return l;n=i;let o='
    ",o}image({href:n,title:e,text:t,tokens:l}){l&&(t=this.parser.parseInline(l,this.parser.textRenderer));let i=ga(n);if(i===null)return kn(t);n=i;let o=`${kn(t)}{let u=s[c].flat(1/0);t=t.concat(this.walkTokens(u,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let l={...t};if(l.async=this.defaults.async||l.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let o=e.renderers[i.name];o?e.renderers[i.name]=function(...s){let c=i.renderer.apply(this,s);return c===!1&&(c=o.apply(this,s)),c}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=e[i.level];o?o.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),l.extensions=e),t.renderer){let i=this.defaults.renderer||new Ri(this.defaults);for(let o in t.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,c=t.renderer[s],u=i[s];i[s]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p||""}}l.renderer=i}if(t.tokenizer){let i=this.defaults.tokenizer||new Ni(this.defaults);for(let o in t.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,c=t.tokenizer[s],u=i[s];i[s]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}l.tokenizer=i}if(t.hooks){let i=this.defaults.hooks||new Wl;for(let o in t.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,c=t.hooks[s],u=i[s];Wl.passThroughHooks.has(o)?i[s]=d=>{if(this.defaults.async&&Wl.passThroughHooksRespectAsync.has(o))return(async()=>{let m=await c.call(i,d);return u.call(i,m)})();let p=c.call(i,d);return u.call(i,p)}:i[s]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await c.apply(i,d);return m===!1&&(m=await u.apply(i,d)),m})();let p=c.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}l.hooks=i}if(t.walkTokens){let i=this.defaults.walkTokens,o=t.walkTokens;l.walkTokens=function(s){let c=[];return c.push(o.call(this,s)),i&&(c=c.concat(i.call(this,s))),c}}this.defaults={...this.defaults,...l}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return un.lex(n,e??this.defaults)}parser(n,e){return fn.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let l={...t},i={...this.defaults,...l},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&l.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let s=i.hooks?await i.hooks.preprocess(e):e,c=await(i.hooks?await i.hooks.provideLexer(n):n?un.lex:un.lexInline)(s,i),u=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(u,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser(n):n?fn.parse:fn.parseInline)(u,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(o);try{i.hooks&&(e=i.hooks.preprocess(e));let s=(i.hooks?i.hooks.provideLexer(n):n?un.lex:un.lexInline)(e,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(n):n?fn.parse:fn.parseInline)(s,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(s){return o(s)}}}onError(n,e){return t=>{if(t.message+=` Please report this to https://github.com/markedjs/marked.`,n){let l="

    An error occurred:

    "+kn(t.message+"",!0)+"
    ";return e?Promise.resolve(l):l}if(e)return Promise.reject(t);throw t}}},sl=new l0;function dt(n,e){return sl.parse(n,e)}dt.options=dt.setOptions=function(n){return sl.setOptions(n),dt.defaults=sl.defaults,Vf(dt.defaults),dt};dt.getDefaults=As;dt.defaults=ol;dt.use=function(...n){return sl.use(...n),dt.defaults=sl.defaults,Vf(dt.defaults),dt};dt.walkTokens=function(n,e){return sl.walkTokens(n,e)};dt.parseInline=sl.parseInline;dt.Parser=fn;dt.parser=fn.parse;dt.Renderer=Ri;dt.TextRenderer=Ps;dt.Lexer=un;dt.lexer=un.lex;dt.Tokenizer=Ni;dt.Hooks=Wl;dt.parse=dt;dt.options;dt.setOptions;dt.use;dt.walkTokens;dt.parseInline;fn.parse;un.lex;/*! @license DOMPurify 3.4.10 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.10/LICENSE */function va(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,l=Array(e);t2?l-2:0),o=2;o1?t-1:0),i=1;i"u"?null:Ct(BigInt.prototype.toString),Sa=typeof Symbol>"u"?null:Ct(Symbol.prototype.toString),Gt=Ct(Object.prototype.hasOwnProperty),Ul=Ct(Object.prototype.toString),Dt=Ct(RegExp.prototype.test),$n=_0(TypeError);function Ct(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,l=new Array(t>1?t-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Gl;if(ka&&ka(n,null),!Fn(e))return n;let l=e.length;for(;l--;){let i=e[l];if(typeof i=="string"){const o=t(i);o!==i&&(c0(e)||(e[l]=o),i=o)}n[i]=!0}return n}function b0(n){for(let e=0;e/g),S0=Pt(/\${[\w\W]*/g),C0=Pt(/^data-[\-\w.\u00B7-\uFFFF]+$/),A0=Pt(/^aria-[\-\w]+$/),Ia=Pt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),N0=Pt(/^(?:\w+script|data):/i),R0=Pt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),I0=Pt(/^html$/i),M0=Pt(/^[a-z][.\w]*(-[.\w]+)+$/i),Ma=Pt(/<[/\w!]/g),L0=Pt(/<[/\w]/g),D0=Pt(/<\/no(script|embed|frames)/i),O0=Pt(/\/>/i),vn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},P0=function(){return typeof window>"u"?null:window},z0=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let l=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(l=t.getAttribute(i));const o="dompurify"+(l?"#"+l:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},La=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},zn=function(e,t,l,i){return Gt(e,t)&&Fn(e[t])?st(i.base?Wt(i.base):{},e[t],i.transform):l};function ld(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P0();const e=Ee=>ld(Ee);if(e.version="3.4.10",e.removed=[],!n||!n.document||n.document.nodeType!==vn.document||!n.Element)return e.isSupported=!1,e;let t=n.document;const l=t,i=l.currentScript;n.DocumentFragment;const o=n.HTMLTemplateElement,s=n.Node,c=n.Element,u=n.NodeFilter,d=n.NamedNodeMap;d===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const p=n.DOMParser,m=n.trustedTypes,g=c.prototype,h=wn(g,"cloneNode"),b=wn(g,"remove"),k=wn(g,"nextSibling"),E=wn(g,"childNodes"),y=wn(g,"parentNode"),T=wn(g,"shadowRoot"),N=wn(g,"attributes"),A=s&&s.prototype?wn(s.prototype,"nodeType"):null,R=s&&s.prototype?wn(s.prototype,"nodeName"):null;if(typeof o=="function"){const Ee=t.createElement("template");Ee.content&&Ee.content.ownerDocument&&(t=Ee.content.ownerDocument)}let M,I="",D,F=!1,B=0;const U=function(){if(B>0)throw $n('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},P=function(Z){U(),B++;try{return M.createHTML(Z)}finally{B--}},H=function(Z){U(),B++;try{return M.createScriptURL(Z)}finally{B--}},V=function(){return F||(D=z0(m,i),F=!0),D},X=t,W=X.implementation,z=X.createNodeIterator,O=X.createDocumentFragment,G=X.getElementsByTagName,q=l.importNode;let Y=La();e.isSupported=typeof td=="function"&&typeof y=="function"&&W&&W.createHTMLDocument!==void 0;const x=E0,ne=T0,le=S0,ie=C0,me=A0,Ne=N0,ze=R0,Ye=M0;let Re=Ia,te=null;const re=st({},[...Ca,...as,...cs,...us,...Aa]);let Ae=null;const Be=st({},[...Na,...fs,...Ra,...pi]);let be=Object.seal(wl(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}})),We=null,at=null;const Te=Object.seal(wl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nt=!0,De=!0,Ce=!1,Fe=!0,je=!1,Ge=!0,Pe=!1,fe=!1,ge=!1,Q=!1,he=!1,_e=!1,Me=!0,rt=!1;const Qe="user-content-";let xe=!0,ut=!1,$={},ee=null;const we=st({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ke=null;const pt=st({},["audio","video","img","source","image","track"]);let Mt=null;const Lt=st({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Nt="http://www.w3.org/1998/Math/MathML",ct="http://www.w3.org/2000/svg",yt="http://www.w3.org/1999/xhtml";let Vt=yt,dn=!1,zt=null;const cl=st({},[Nt,ct,yt],rs),Rt=Ot(["mi","mo","mn","ms","mtext"]);let Bt=st({},Rt);const ht=Ot(["annotation-xml"]);let ul=st({},ht);const xl=st({},["title","style","font","a","script"]);let In=null;const nn=["application/xhtml+xml","text/html"],Nl="text/html";let ft=null,Ft=null;const Tn=t.createElement("form"),qt=function(Z){return Z instanceof RegExp||Z instanceof Function},Zt=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ft&&Ft===Z)return;(!Z||typeof Z!="object")&&(Z={}),Z=Wt(Z),In=nn.indexOf(Z.PARSER_MEDIA_TYPE)===-1?Nl:Z.PARSER_MEDIA_TYPE,ft=In==="application/xhtml+xml"?rs:Gl,te=zn(Z,"ALLOWED_TAGS",re,{transform:ft}),Ae=zn(Z,"ALLOWED_ATTR",Be,{transform:ft}),zt=zn(Z,"ALLOWED_NAMESPACES",cl,{transform:rs}),Mt=zn(Z,"ADD_URI_SAFE_ATTR",Lt,{transform:ft,base:Lt}),Ke=zn(Z,"ADD_DATA_URI_TAGS",pt,{transform:ft,base:pt}),ee=zn(Z,"FORBID_CONTENTS",we,{transform:ft}),We=zn(Z,"FORBID_TAGS",Wt({}),{transform:ft}),at=zn(Z,"FORBID_ATTR",Wt({}),{transform:ft}),$=Gt(Z,"USE_PROFILES")?Z.USE_PROFILES&&typeof Z.USE_PROFILES=="object"?Wt(Z.USE_PROFILES):Z.USE_PROFILES:!1,nt=Z.ALLOW_ARIA_ATTR!==!1,De=Z.ALLOW_DATA_ATTR!==!1,Ce=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=Z.SAFE_FOR_TEMPLATES||!1,Ge=Z.SAFE_FOR_XML!==!1,Pe=Z.WHOLE_DOCUMENT||!1,Q=Z.RETURN_DOM||!1,he=Z.RETURN_DOM_FRAGMENT||!1,_e=Z.RETURN_TRUSTED_TYPE||!1,ge=Z.FORCE_BODY||!1,Me=Z.SANITIZE_DOM!==!1,rt=Z.SANITIZE_NAMED_PROPS||!1,xe=Z.KEEP_CONTENT!==!1,ut=Z.IN_PLACE||!1,Re=k0(Z.ALLOWED_URI_REGEXP)?Z.ALLOWED_URI_REGEXP:Ia,Vt=typeof Z.NAMESPACE=="string"?Z.NAMESPACE:yt,Bt=Gt(Z,"MATHML_TEXT_INTEGRATION_POINTS")&&Z.MATHML_TEXT_INTEGRATION_POINTS&&typeof Z.MATHML_TEXT_INTEGRATION_POINTS=="object"?Wt(Z.MATHML_TEXT_INTEGRATION_POINTS):st({},Rt),ul=Gt(Z,"HTML_INTEGRATION_POINTS")&&Z.HTML_INTEGRATION_POINTS&&typeof Z.HTML_INTEGRATION_POINTS=="object"?Wt(Z.HTML_INTEGRATION_POINTS):st({},ht);const se=Gt(Z,"CUSTOM_ELEMENT_HANDLING")&&Z.CUSTOM_ELEMENT_HANDLING&&typeof Z.CUSTOM_ELEMENT_HANDLING=="object"?Wt(Z.CUSTOM_ELEMENT_HANDLING):wl(null);if(be=wl(null),Gt(se,"tagNameCheck")&&qt(se.tagNameCheck)&&(be.tagNameCheck=se.tagNameCheck),Gt(se,"attributeNameCheck")&&qt(se.attributeNameCheck)&&(be.attributeNameCheck=se.attributeNameCheck),Gt(se,"allowCustomizedBuiltInElements")&&typeof se.allowCustomizedBuiltInElements=="boolean"&&(be.allowCustomizedBuiltInElements=se.allowCustomizedBuiltInElements),Pt(be),je&&(De=!1),he&&(Q=!0),$&&(te=st({},Aa),Ae=wl(null),$.html===!0&&(st(te,Ca),st(Ae,Na)),$.svg===!0&&(st(te,as),st(Ae,fs),st(Ae,pi)),$.svgFilters===!0&&(st(te,cs),st(Ae,fs),st(Ae,pi)),$.mathMl===!0&&(st(te,us),st(Ae,Ra),st(Ae,pi))),Te.tagCheck=null,Te.attributeCheck=null,Gt(Z,"ADD_TAGS")&&(typeof Z.ADD_TAGS=="function"?Te.tagCheck=Z.ADD_TAGS:Fn(Z.ADD_TAGS)&&(te===re&&(te=Wt(te)),st(te,Z.ADD_TAGS,ft))),Gt(Z,"ADD_ATTR")&&(typeof Z.ADD_ATTR=="function"?Te.attributeCheck=Z.ADD_ATTR:Fn(Z.ADD_ATTR)&&(Ae===Be&&(Ae=Wt(Ae)),st(Ae,Z.ADD_ATTR,ft))),Gt(Z,"ADD_URI_SAFE_ATTR")&&Fn(Z.ADD_URI_SAFE_ATTR)&&st(Mt,Z.ADD_URI_SAFE_ATTR,ft),Gt(Z,"FORBID_CONTENTS")&&Fn(Z.FORBID_CONTENTS)&&(ee===we&&(ee=Wt(ee)),st(ee,Z.FORBID_CONTENTS,ft)),Gt(Z,"ADD_FORBID_CONTENTS")&&Fn(Z.ADD_FORBID_CONTENTS)&&(ee===we&&(ee=Wt(ee)),st(ee,Z.ADD_FORBID_CONTENTS,ft)),xe&&(te["#text"]=!0),Pe&&st(te,["html","head","body"]),te.table&&(st(te,["tbody"]),delete We.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw $n('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $n('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ke=M;M=Z.TRUSTED_TYPES_POLICY;try{I=P("")}catch(Oe){throw M=ke,Oe}}else Z.TRUSTED_TYPES_POLICY===null?(M=void 0,I=""):(M===void 0&&(M=V()),M&&typeof I=="string"&&(I=P("")));(Y.uponSanitizeElement.length>0||Y.uponSanitizeAttribute.length>0)&&te===re&&(te=Wt(te)),Y.uponSanitizeAttribute.length>0&&Ae===Be&&(Ae=Wt(Ae)),Ot&&Ot(Z),Ft=Z},pn=st({},[...as,...cs,...w0]),Yt=st({},[...us,...y0]),Hn=function(Z,se,ke){return se.namespaceURI===yt?Z==="svg":se.namespaceURI===Nt?Z==="svg"&&(ke==="annotation-xml"||Bt[ke]):!!pn[Z]},mn=function(Z,se,ke){return se.namespaceURI===yt?Z==="math":se.namespaceURI===ct?Z==="math"&&ul[ke]:!!Yt[Z]},Wn=function(Z,se,ke){return se.namespaceURI===ct&&!ul[ke]||se.namespaceURI===Nt&&!Bt[ke]?!1:!Yt[Z]&&(xl[Z]||!pn[Z])},gn=function(Z){let se=y(Z);(!se||!se.tagName)&&(se={namespaceURI:Vt,tagName:"template"});const ke=Gl(Z.tagName),Oe=Gl(se.tagName);return zt[Z.namespaceURI]?Z.namespaceURI===ct?Hn(ke,se,Oe):Z.namespaceURI===Nt?mn(ke,se,Oe):Z.namespaceURI===yt?Wn(ke,se,Oe):!!(In==="application/xhtml+xml"&&zt[Z.namespaceURI]):!1},xt=function(Z){bl(e.removed,{element:Z});try{y(Z).removeChild(Z)}catch{if(b(Z),!y(Z))throw $n("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Sn=function(Z){const se=E(Z);if(se){const Oe=[];Fl(se,Xe=>{bl(Oe,Xe)}),Fl(Oe,Xe=>{try{b(Xe)}catch{}})}const ke=N(Z);if(ke)for(let Oe=ke.length-1;Oe>=0;--Oe){const Xe=ke[Oe],lt=Xe&&Xe.name;if(typeof lt=="string")try{Z.removeAttribute(lt)}catch{}}},$t=function(Z,se){try{bl(e.removed,{attribute:se.getAttributeNode(Z),from:se})}catch{bl(e.removed,{attribute:null,from:se})}if(se.removeAttribute(Z),Z==="is")if(Q||he)try{xt(se)}catch{}else try{se.setAttribute(Z,"")}catch{}},$l=function(Z){const se=N(Z);if(se)for(let ke=se.length-1;ke>=0;--ke){const Oe=se[ke],Xe=Oe&&Oe.name;if(!(typeof Xe!="string"||Ae[ft(Xe)]))try{Z.removeAttribute(Xe)}catch{}}},ei=function(Z){const se=[Z];for(;se.length>0;){const ke=se.pop();(A?A(ke):ke.nodeType)===vn.element&&$l(ke);const Xe=E(ke);if(Xe)for(let lt=Xe.length-1;lt>=0;--lt)se.push(Xe[lt])}},Rl=function(Z){let se=null,ke=null;if(ge)Z=""+Z;else{const lt=ya(Z,/^[\r\n\t ]+/);ke=lt&<[0]}In==="application/xhtml+xml"&&Vt===yt&&(Z=''+Z+"");const Oe=M?P(Z):Z;if(Vt===yt)try{se=new p().parseFromString(Oe,In)}catch{}if(!se||!se.documentElement){se=W.createDocument(Vt,"template",null);try{se.documentElement.innerHTML=dn?I:Oe}catch{}}const Xe=se.body||se.documentElement;return Z&&ke&&Xe.insertBefore(t.createTextNode(ke),Xe.childNodes[0]||null),Vt===yt?G.call(se,Pe?"html":"body")[0]:Pe?se.documentElement:Xe},Il=function(Z){return z.call(Z.ownerDocument||Z,Z,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Cn=function(Z){return Z=jl(Z,x," "),Z=jl(Z,ne," "),Z=jl(Z,le," "),Z},Mn=function(Z){var se;Z.normalize();const ke=z.call(Z.ownerDocument||Z,Z,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let Oe=ke.nextNode();for(;Oe;)Oe.data=Cn(Oe.data),Oe=ke.nextNode();const Xe=(se=Z.querySelectorAll)===null||se===void 0?void 0:se.call(Z,"template");Xe&&Fl(Xe,lt=>{sn(lt.content)&&Mn(lt.content)})},ln=function(Z){const se=R?R(Z):null;return typeof se!="string"||ft(se)!=="form"?!1:typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||Z.attributes!==N(Z)||typeof Z.removeAttribute!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function"||Z.nodeType!==A(Z)||Z.childNodes!==E(Z)},sn=function(Z){if(!A||typeof Z!="object"||Z===null)return!1;try{return A(Z)===vn.documentFragment}catch{return!1}},en=function(Z){if(!A||typeof Z!="object"||Z===null)return!1;try{return typeof A(Z)=="number"}catch{return!1}};function jt(Ee,Z,se){Ee.length!==0&&Fl(Ee,ke=>{ke.call(e,Z,se,Ft)})}const on=function(Z,se){return!!(Ge&&Z.hasChildNodes()&&!en(Z.firstElementChild)&&Dt(Ma,Z.textContent)&&Dt(Ma,Z.innerHTML)||Ge&&Z.namespaceURI===yt&&se==="style"&&en(Z.firstElementChild)||Z.nodeType===vn.processingInstruction||Ge&&Z.nodeType===vn.comment&&Dt(L0,Z.data))},hn=function(Z,se){if(!We[se]&&Ml(se)&&(be.tagNameCheck instanceof RegExp&&Dt(be.tagNameCheck,se)||be.tagNameCheck instanceof Function&&be.tagNameCheck(se)))return!1;if(xe&&!ee[se]){const ke=y(Z),Oe=E(Z);if(Oe&&ke){const Xe=Oe.length;for(let lt=Xe-1;lt>=0;--lt){const Et=ut?Oe[lt]:h(Oe[lt],!0);ke.insertBefore(Et,k(Z))}}}return xt(Z),!0},_n=function(Z){if(jt(Y.beforeSanitizeElements,Z,null),ln(Z))return xt(Z),!0;const se=ft(R?R(Z):Z.nodeName);if(jt(Y.uponSanitizeElement,Z,{tagName:se,allowedTags:te}),on(Z,se))return xt(Z),!0;if(We[se]||!(Te.tagCheck instanceof Function&&Te.tagCheck(se))&&!te[se])return hn(Z,se);if((A?A(Z):Z.nodeType)===vn.element&&!gn(Z)||(se==="noscript"||se==="noembed"||se==="noframes")&&Dt(D0,Z.innerHTML))return xt(Z),!0;if(je&&Z.nodeType===vn.text){const Oe=Cn(Z.textContent);Z.textContent!==Oe&&(bl(e.removed,{element:Z.cloneNode()}),Z.textContent=Oe)}return jt(Y.afterSanitizeElements,Z,null),!1},rn=function(Z,se,ke){if(at[se]||Me&&(se==="id"||se==="name")&&(ke in t||ke in Tn))return!1;const Oe=Ae[se]||Te.attributeCheck instanceof Function&&Te.attributeCheck(se,Z);if(!(De&&Dt(ie,se))){if(!(nt&&Dt(me,se))){if(Oe){if(!Mt[se]){if(!Dt(Re,jl(ke,ze,""))){if(!((se==="src"||se==="xlink:href"||se==="href")&&Z!=="script"&&Ea(ke,"data:")===0&&Ke[Z])){if(!(Ce&&!Dt(Ne,jl(ke,ze,"")))){if(ke)return!1}}}}}else if(!(Ml(Z)&&(be.tagNameCheck instanceof RegExp&&Dt(be.tagNameCheck,Z)||be.tagNameCheck instanceof Function&&be.tagNameCheck(Z))&&(be.attributeNameCheck instanceof RegExp&&Dt(be.attributeNameCheck,se)||be.attributeNameCheck instanceof Function&&be.attributeNameCheck(se,Z))||se==="is"&&be.allowCustomizedBuiltInElements&&(be.tagNameCheck instanceof RegExp&&Dt(be.tagNameCheck,ke)||be.tagNameCheck instanceof Function&&be.tagNameCheck(ke))))return!1}}return!0},fl=st({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ml=function(Z){return!fl[Gl(Z)]&&Dt(Ye,Z)},Ll=function(Z,se,ke,Oe){if(M&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!ke)switch(m.getAttributeType(Z,se)){case"TrustedHTML":return P(Oe);case"TrustedScriptURL":return H(Oe)}return Oe},Dl=function(Z,se,ke,Oe){try{ke?Z.setAttributeNS(ke,se,Oe):Z.setAttribute(se,Oe),ln(Z)?xt(Z):wa(e.removed)}catch{$t(se,Z)}},Ln=function(Z){jt(Y.beforeSanitizeAttributes,Z,null);const se=Z.attributes;if(!se||ln(Z))return;const ke={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae,forceKeepAttr:void 0};let Oe=se.length;const Xe=ft(Z.nodeName);for(;Oe--;){const lt=se[Oe],Et=lt.name,_t=lt.namespaceURI,gt=lt.value,Ut=ft(Et),Tt=gt;let At=Et==="value"?Tt:m0(Tt);if(ke.attrName=Ut,ke.attrValue=At,ke.keepAttr=!0,ke.forceKeepAttr=void 0,jt(Y.uponSanitizeAttribute,Z,ke),At=ke.attrValue,rt&&(Ut==="id"||Ut==="name")&&Ea(At,Qe)!==0&&($t(Et,Z),At=Qe+At),Ge&&Dt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,At)){$t(Et,Z);continue}if(Ut==="attributename"&&ya(At,"href")){$t(Et,Z);continue}if(!ke.forceKeepAttr){if(!ke.keepAttr){$t(Et,Z);continue}if(!Fe&&Dt(O0,At)){$t(Et,Z);continue}if(je&&(At=Cn(At)),!rn(Xe,Ut,At)){$t(Et,Z);continue}At=Ll(Xe,Ut,_t,At),At!==Tt&&Dl(Z,Et,_t,At)}}jt(Y.afterSanitizeAttributes,Z,null)},An=function(Z){let se=null;const ke=Il(Z);for(jt(Y.beforeSanitizeShadowDOM,Z,null);se=ke.nextNode();)if(jt(Y.uponSanitizeShadowNode,se,null),_n(se),Ln(se),sn(se.content)&&An(se.content),(A?A(se):se.nodeType)===vn.element){const Xe=T(se);sn(Xe)&&(Ol(Xe),An(Xe))}jt(Y.afterSanitizeShadowDOM,Z,null)},Ol=function(Z){const se=[{node:Z,shadow:null}];for(;se.length>0;){const ke=se.pop();if(ke.shadow){An(ke.shadow);continue}const Oe=ke.node,lt=(A?A(Oe):Oe.nodeType)===vn.element,Et=E(Oe);if(Et)for(let _t=Et.length-1;_t>=0;--_t)se.push({node:Et[_t],shadow:null});if(lt){const _t=R?R(Oe):null;if(typeof _t=="string"&&ft(_t)==="template"){const gt=Oe.content;sn(gt)&&se.push({node:gt,shadow:null})}}if(lt){const _t=T(Oe);sn(_t)&&se.push({node:null,shadow:_t},{node:_t,shadow:null})}}};return e.sanitize=function(Ee){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},se=null,ke=null,Oe=null,Xe=null;if(dn=!Ee,dn&&(Ee=""),typeof Ee!="string"&&!en(Ee)&&(Ee=v0(Ee),typeof Ee!="string"))throw $n("dirty is not a string, aborting");if(!e.isSupported)return Ee;fe||Zt(Z),e.removed=[];const lt=ut&&typeof Ee!="string"&&en(Ee);if(lt){const gt=R?R(Ee):Ee.nodeName;if(typeof gt=="string"){const Ut=ft(gt);if(!te[Ut]||We[Ut])throw $n("root node is forbidden and cannot be sanitized in-place")}if(ln(Ee))throw $n("root node is clobbered and cannot be sanitized in-place");try{Ol(Ee)}catch(Ut){throw Sn(Ee),Ut}}else if(en(Ee))se=Rl(""),ke=se.ownerDocument.importNode(Ee,!0),ke.nodeType===vn.element&&ke.nodeName==="BODY"||ke.nodeName==="HTML"?se=ke:se.appendChild(ke),Ol(ke);else{if(!Q&&!je&&!Pe&&Ee.indexOf("<")===-1)return M&&_e?P(Ee):Ee;if(se=Rl(Ee),!se)return Q?null:_e?I:""}se&&ge&&xt(se.firstChild);const Et=Il(lt?Ee:se);try{for(;Oe=Et.nextNode();)_n(Oe),Ln(Oe),sn(Oe.content)&&An(Oe.content)}catch(gt){throw lt&&Sn(Ee),gt}if(lt)return Fl(e.removed,gt=>{gt.element&&ei(gt.element)}),je&&Mn(Ee),Ee;if(Q){if(je&&Mn(se),he)for(Xe=O.call(se.ownerDocument);se.firstChild;)Xe.appendChild(se.firstChild);else Xe=se;return(Ae.shadowroot||Ae.shadowrootmode)&&(Xe=q.call(l,Xe,!0)),Xe}let _t=Pe?se.outerHTML:se.innerHTML;return Pe&&te["!doctype"]&&se.ownerDocument&&se.ownerDocument.doctype&&se.ownerDocument.doctype.name&&Dt(I0,se.ownerDocument.doctype.name)&&(_t=" `+_t),je&&(_t=Cn(_t)),M&&_e?P(_t):_t},e.setConfig=function(){let Ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zt(Ee),fe=!0},e.clearConfig=function(){Ft=null,fe=!1,M=D,I=""},e.isValidAttribute=function(Ee,Z,se){Ft||Zt({});const ke=ft(Ee),Oe=ft(Z);return rn(ke,Oe,se)},e.addHook=function(Ee,Z){typeof Z=="function"&&bl(Y[Ee],Z)},e.removeHook=function(Ee,Z){if(Z!==void 0){const se=d0(Y[Ee],Z);return se===-1?void 0:p0(Y[Ee],se,1)[0]}return wa(Y[Ee])},e.removeHooks=function(Ee){Y[Ee]=[]},e.removeAllHooks=function(){Y=La()},e}var id=ld();function B0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function sd(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(e=>{const t=n[e],l=typeof t;(l==="object"||l==="function")&&!Object.isFrozen(t)&&sd(t)}),n}class Da{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function od(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Un(n,...e){const t=Object.create(null);for(const l in n)t[l]=n[l];return e.forEach(function(l){for(const i in l)t[i]=l[i]}),t}const F0="",Oa=n=>!!n.scope,j0=(n,{prefix:e})=>{if(n.startsWith("language:"))return n.replace("language:","language-");if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map((l,i)=>`${l}${"_".repeat(i+1)}`)].join(" ")}return`${e}${n}`};class U0{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=od(e)}openNode(e){if(!Oa(e))return;const t=j0(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){Oa(e)&&(this.buffer+=F0)}value(){return this.buffer}span(e){this.buffer+=``}}const Pa=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class zs{constructor(){this.rootNode=Pa(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=Pa({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(l=>this._walk(e,l)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{zs._collapse(t)}))}}class H0 extends zs{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const l=e.root;t&&(l.scope=`language:${t}`),this.add(l)}toHTML(){return new U0(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ql(n){return n?typeof n=="string"?n:n.source:null}function rd(n){return rl("(?=",n,")")}function W0(n){return rl("(?:",n,")*")}function G0(n){return rl("(?:",n,")?")}function rl(...n){return n.map(t=>ql(t)).join("")}function K0(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function Bs(...n){return"("+(K0(n).capture?"":"?:")+n.map(l=>ql(l)).join("|")+")"}function ad(n){return new RegExp(n.toString()+"|").exec("").length-1}function V0(n,e){const t=n&&n.exec(e);return t&&t.index===0}const q0=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Fs(n,{joinWith:e}){let t=0;return n.map(l=>{t+=1;const i=t;let o=ql(l),s="";for(;o.length>0;){const c=q0.exec(o);if(!c){s+=o;break}s+=o.substring(0,c.index),o=o.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?s+="\\"+String(Number(c[1])+i):(s+=c[0],c[0]==="("&&t++)}return s}).map(l=>`(${l})`).join(e)}const Z0=/\b\B/,cd="[a-zA-Z]\\w*",js="[a-zA-Z_]\\w*",ud="\\b\\d+(\\.\\d+)?",fd="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",dd="\\b(0b[01]+)",Y0="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X0=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=rl(e,/.*\b/,n.binary,/\b.*/)),Un({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,l)=>{t.index!==0&&l.ignoreMatch()}},n)},Zl={begin:"\\\\[\\s\\S]",relevance:0},J0={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Zl]},Q0={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Zl]},x0={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},zi=function(n,e,t={}){const l=Un({scope:"comment",begin:n,end:e,contains:[]},t);l.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Bs("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return l.contains.push({begin:rl(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),l},$0=zi("//","$"),ek=zi("/\\*","\\*/"),tk=zi("#","$"),nk={scope:"number",begin:ud,relevance:0},lk={scope:"number",begin:fd,relevance:0},ik={scope:"number",begin:dd,relevance:0},sk={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Zl,{begin:/\[/,end:/\]/,relevance:0,contains:[Zl]}]},ok={scope:"title",begin:cd,relevance:0},rk={scope:"title",begin:js,relevance:0},ak={begin:"\\.\\s*"+js,relevance:0},ck=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var mi=Object.freeze({__proto__:null,APOS_STRING_MODE:J0,BACKSLASH_ESCAPE:Zl,BINARY_NUMBER_MODE:ik,BINARY_NUMBER_RE:dd,COMMENT:zi,C_BLOCK_COMMENT_MODE:ek,C_LINE_COMMENT_MODE:$0,C_NUMBER_MODE:lk,C_NUMBER_RE:fd,END_SAME_AS_BEGIN:ck,HASH_COMMENT_MODE:tk,IDENT_RE:cd,MATCH_NOTHING_RE:Z0,METHOD_GUARD:ak,NUMBER_MODE:nk,NUMBER_RE:ud,PHRASAL_WORDS_MODE:x0,QUOTE_STRING_MODE:Q0,REGEXP_MODE:sk,RE_STARTERS_RE:Y0,SHEBANG:X0,TITLE_MODE:ok,UNDERSCORE_IDENT_RE:js,UNDERSCORE_TITLE_MODE:rk});function uk(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function fk(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function dk(n,e){e&&n.beginKeywords&&(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=uk,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function pk(n,e){Array.isArray(n.illegal)&&(n.illegal=Bs(...n.illegal))}function mk(n,e){if(n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function gk(n,e){n.relevance===void 0&&(n.relevance=1)}const hk=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},n);Object.keys(n).forEach(l=>{delete n[l]}),n.keywords=t.keywords,n.begin=rl(t.beforeMatch,rd(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},_k=["of","and","for","in","not","or","if","then","parent","list","value"],bk="keyword";function pd(n,e,t=bk){const l=Object.create(null);return typeof n=="string"?i(t,n.split(" ")):Array.isArray(n)?i(t,n):Object.keys(n).forEach(function(o){Object.assign(l,pd(n[o],e,o))}),l;function i(o,s){e&&(s=s.map(c=>c.toLowerCase())),s.forEach(function(c){const u=c.split("|");l[u[0]]=[o,vk(u[0],u[1])]})}}function vk(n,e){return e?Number(e):kk(n)?0:1}function kk(n){return _k.includes(n.toLowerCase())}const za={},ll=n=>{console.error(n)},Ba=(n,...e)=>{console.log(`WARN: ${n}`,...e)},vl=(n,e)=>{za[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),za[`${n}/${e}`]=!0)},Ii=new Error;function md(n,e,{key:t}){let l=0;const i=n[t],o={},s={};for(let c=1;c<=e.length;c++)s[c+l]=i[c],o[c+l]=!0,l+=ad(e[c-1]);n[t]=s,n[t]._emit=o,n[t]._multi=!0}function wk(n){if(Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw ll("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ii;if(typeof n.beginScope!="object"||n.beginScope===null)throw ll("beginScope must be object"),Ii;md(n,n.begin,{key:"beginScope"}),n.begin=Fs(n.begin,{joinWith:""})}}function yk(n){if(Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw ll("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ii;if(typeof n.endScope!="object"||n.endScope===null)throw ll("endScope must be object"),Ii;md(n,n.end,{key:"endScope"}),n.end=Fs(n.end,{joinWith:""})}}function Ek(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function Tk(n){Ek(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),wk(n),yk(n)}function Sk(n){function e(s,c){return new RegExp(ql(s),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(c?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,c]),this.matchAt+=ad(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(u=>u[1]);this.matcherRe=e(Fs(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(c);if(!u)return null;const d=u.findIndex((m,g)=>g>0&&m!==void 0),p=this.matchIndexes[d];return u.splice(0,d),Object.assign(u,p)}}class l{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const u=new t;return this.rules.slice(c).forEach(([d,p])=>u.addRule(d,p)),u.compile(),this.multiRegexes[c]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,u){this.rules.push([c,u]),u.type==="begin"&&this.count++}exec(c){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let d=u.exec(c);if(this.resumingScanAtSamePosition()&&!(d&&d.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,d=p.exec(c)}return d&&(this.regexIndex+=d.position+1,this.regexIndex===this.count&&this.considerAll()),d}}function i(s){const c=new l;return s.contains.forEach(u=>c.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&c.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&c.addRule(s.illegal,{type:"illegal"}),c}function o(s,c){const u=s;if(s.isCompiled)return u;[fk,mk,Tk,hk].forEach(p=>p(s,c)),n.compilerExtensions.forEach(p=>p(s,c)),s.__beforeBegin=null,[dk,pk,gk].forEach(p=>p(s,c)),s.isCompiled=!0;let d=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),d=s.keywords.$pattern,delete s.keywords.$pattern),d=d||/\w+/,s.keywords&&(s.keywords=pd(s.keywords,n.case_insensitive)),u.keywordPatternRe=e(d,!0),c&&(s.begin||(s.begin=/\B|\b/),u.beginRe=e(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=e(u.end)),u.terminatorEnd=ql(u.end)||"",s.endsWithParent&&c.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+c.terminatorEnd)),s.illegal&&(u.illegalRe=e(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(p){return Ck(p==="self"?s:p)})),s.contains.forEach(function(p){o(p,u)}),s.starts&&o(s.starts,c),u.matcher=i(u),u}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=Un(n.classNameAliases||{}),o(n)}function gd(n){return n?n.endsWithParent||gd(n.starts):!1}function Ck(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return Un(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:gd(n)?Un(n,{starts:n.starts?Un(n.starts):null}):Object.isFrozen(n)?Un(n):n}var Ak="11.11.1";class Nk extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const ds=od,Fa=Un,ja=Symbol("nomatch"),Rk=7,hd=function(n){const e=Object.create(null),t=Object.create(null),l=[];let i=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:H0};function u(W){return c.noHighlightRe.test(W)}function d(W){let z=W.className+" ";z+=W.parentNode?W.parentNode.className:"";const O=c.languageDetectRe.exec(z);if(O){const G=D(O[1]);return G||(Ba(o.replace("{}",O[1])),Ba("Falling back to no-highlight mode for this block.",W)),G?O[1]:"no-highlight"}return z.split(/\s+/).find(G=>u(G)||D(G))}function p(W,z,O){let G="",q="";typeof z=="object"?(G=W,O=z.ignoreIllegals,q=z.language):(vl("10.7.0","highlight(lang, code, ...args) has been deprecated."),vl("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),q=W,G=z),O===void 0&&(O=!0);const Y={code:G,language:q};V("before:highlight",Y);const x=Y.result?Y.result:m(Y.language,Y.code,O);return x.code=Y.code,V("after:highlight",x),x}function m(W,z,O,G){const q=Object.create(null);function Y(fe,ge){return fe.keywords[ge]}function x(){if(!Te.keywords){De.addText(Ce);return}let fe=0;Te.keywordPatternRe.lastIndex=0;let ge=Te.keywordPatternRe.exec(Ce),Q="";for(;ge;){Q+=Ce.substring(fe,ge.index);const he=be.case_insensitive?ge[0].toLowerCase():ge[0],_e=Y(Te,he);if(_e){const[Me,rt]=_e;if(De.addText(Q),Q="",q[he]=(q[he]||0)+1,q[he]<=Rk&&(Fe+=rt),Me.startsWith("_"))Q+=ge[0];else{const Qe=be.classNameAliases[Me]||Me;ie(ge[0],Qe)}}else Q+=ge[0];fe=Te.keywordPatternRe.lastIndex,ge=Te.keywordPatternRe.exec(Ce)}Q+=Ce.substring(fe),De.addText(Q)}function ne(){if(Ce==="")return;let fe=null;if(typeof Te.subLanguage=="string"){if(!e[Te.subLanguage]){De.addText(Ce);return}fe=m(Te.subLanguage,Ce,!0,nt[Te.subLanguage]),nt[Te.subLanguage]=fe._top}else fe=h(Ce,Te.subLanguage.length?Te.subLanguage:null);Te.relevance>0&&(Fe+=fe.relevance),De.__addSublanguage(fe._emitter,fe.language)}function le(){Te.subLanguage!=null?ne():x(),Ce=""}function ie(fe,ge){fe!==""&&(De.startScope(ge),De.addText(fe),De.endScope())}function me(fe,ge){let Q=1;const he=ge.length-1;for(;Q<=he;){if(!fe._emit[Q]){Q++;continue}const _e=be.classNameAliases[fe[Q]]||fe[Q],Me=ge[Q];_e?ie(Me,_e):(Ce=Me,x(),Ce=""),Q++}}function Ne(fe,ge){return fe.scope&&typeof fe.scope=="string"&&De.openNode(be.classNameAliases[fe.scope]||fe.scope),fe.beginScope&&(fe.beginScope._wrap?(ie(Ce,be.classNameAliases[fe.beginScope._wrap]||fe.beginScope._wrap),Ce=""):fe.beginScope._multi&&(me(fe.beginScope,ge),Ce="")),Te=Object.create(fe,{parent:{value:Te}}),Te}function ze(fe,ge,Q){let he=V0(fe.endRe,Q);if(he){if(fe["on:end"]){const _e=new Da(fe);fe["on:end"](ge,_e),_e.isMatchIgnored&&(he=!1)}if(he){for(;fe.endsParent&&fe.parent;)fe=fe.parent;return fe}}if(fe.endsWithParent)return ze(fe.parent,ge,Q)}function Ye(fe){return Te.matcher.regexIndex===0?(Ce+=fe[0],1):(Pe=!0,0)}function Re(fe){const ge=fe[0],Q=fe.rule,he=new Da(Q),_e=[Q.__beforeBegin,Q["on:begin"]];for(const Me of _e)if(Me&&(Me(fe,he),he.isMatchIgnored))return Ye(ge);return Q.skip?Ce+=ge:(Q.excludeBegin&&(Ce+=ge),le(),!Q.returnBegin&&!Q.excludeBegin&&(Ce=ge)),Ne(Q,fe),Q.returnBegin?0:ge.length}function te(fe){const ge=fe[0],Q=z.substring(fe.index),he=ze(Te,fe,Q);if(!he)return ja;const _e=Te;Te.endScope&&Te.endScope._wrap?(le(),ie(ge,Te.endScope._wrap)):Te.endScope&&Te.endScope._multi?(le(),me(Te.endScope,fe)):_e.skip?Ce+=ge:(_e.returnEnd||_e.excludeEnd||(Ce+=ge),le(),_e.excludeEnd&&(Ce=ge));do Te.scope&&De.closeNode(),!Te.skip&&!Te.subLanguage&&(Fe+=Te.relevance),Te=Te.parent;while(Te!==he.parent);return he.starts&&Ne(he.starts,fe),_e.returnEnd?0:ge.length}function re(){const fe=[];for(let ge=Te;ge!==be;ge=ge.parent)ge.scope&&fe.unshift(ge.scope);fe.forEach(ge=>De.openNode(ge))}let Ae={};function Be(fe,ge){const Q=ge&&ge[0];if(Ce+=fe,Q==null)return le(),0;if(Ae.type==="begin"&&ge.type==="end"&&Ae.index===ge.index&&Q===""){if(Ce+=z.slice(ge.index,ge.index+1),!i){const he=new Error(`0 width match regex (${W})`);throw he.languageName=W,he.badRule=Ae.rule,he}return 1}if(Ae=ge,ge.type==="begin")return Re(ge);if(ge.type==="illegal"&&!O){const he=new Error('Illegal lexeme "'+Q+'" for mode "'+(Te.scope||"")+'"');throw he.mode=Te,he}else if(ge.type==="end"){const he=te(ge);if(he!==ja)return he}if(ge.type==="illegal"&&Q==="")return Ce+=` `,1;if(Ge>1e5&&Ge>ge.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ce+=Q,Q.length}const be=D(W);if(!be)throw ll(o.replace("{}",W)),new Error('Unknown language: "'+W+'"');const We=Sk(be);let at="",Te=G||We;const nt={},De=new c.__emitter(c);re();let Ce="",Fe=0,je=0,Ge=0,Pe=!1;try{if(be.__emitTokens)be.__emitTokens(z,De);else{for(Te.matcher.considerAll();;){Ge++,Pe?Pe=!1:Te.matcher.considerAll(),Te.matcher.lastIndex=je;const fe=Te.matcher.exec(z);if(!fe)break;const ge=z.substring(je,fe.index),Q=Be(ge,fe);je=fe.index+Q}Be(z.substring(je))}return De.finalize(),at=De.toHTML(),{language:W,value:at,relevance:Fe,illegal:!1,_emitter:De,_top:Te}}catch(fe){if(fe.message&&fe.message.includes("Illegal"))return{language:W,value:ds(z),illegal:!0,relevance:0,_illegalBy:{message:fe.message,index:je,context:z.slice(je-100,je+100),mode:fe.mode,resultSoFar:at},_emitter:De};if(i)return{language:W,value:ds(z),illegal:!1,relevance:0,errorRaised:fe,_emitter:De,_top:Te};throw fe}}function g(W){const z={value:ds(W),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return z._emitter.addText(W),z}function h(W,z){z=z||c.languages||Object.keys(e);const O=g(W),G=z.filter(D).filter(B).map(le=>m(le,W,!1));G.unshift(O);const q=G.sort((le,ie)=>{if(le.relevance!==ie.relevance)return ie.relevance-le.relevance;if(le.language&&ie.language){if(D(le.language).supersetOf===ie.language)return 1;if(D(ie.language).supersetOf===le.language)return-1}return 0}),[Y,x]=q,ne=Y;return ne.secondBest=x,ne}function b(W,z,O){const G=z&&t[z]||O;W.classList.add("hljs"),W.classList.add(`language-${G}`)}function k(W){let z=null;const O=d(W);if(u(O))return;if(V("before:highlightElement",{el:W,language:O}),W.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",W);return}if(W.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(W)),c.throwUnescapedHTML))throw new Nk("One of your code blocks includes unescaped HTML.",W.innerHTML);z=W;const G=z.textContent,q=O?p(G,{language:O,ignoreIllegals:!0}):h(G);W.innerHTML=q.value,W.dataset.highlighted="yes",b(W,O,q.language),W.result={language:q.language,re:q.relevance,relevance:q.relevance},q.secondBest&&(W.secondBest={language:q.secondBest.language,relevance:q.secondBest.relevance}),V("after:highlightElement",{el:W,result:q,text:G})}function E(W){c=Fa(c,W)}const y=()=>{A(),vl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function T(){A(),vl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let N=!1;function A(){function W(){A()}if(document.readyState==="loading"){N||window.addEventListener("DOMContentLoaded",W,!1),N=!0;return}document.querySelectorAll(c.cssSelector).forEach(k)}function R(W,z){let O=null;try{O=z(n)}catch(G){if(ll("Language definition for '{}' could not be registered.".replace("{}",W)),i)ll(G);else throw G;O=s}O.name||(O.name=W),e[W]=O,O.rawDefinition=z.bind(null,n),O.aliases&&F(O.aliases,{languageName:W})}function M(W){delete e[W];for(const z of Object.keys(t))t[z]===W&&delete t[z]}function I(){return Object.keys(e)}function D(W){return W=(W||"").toLowerCase(),e[W]||e[t[W]]}function F(W,{languageName:z}){typeof W=="string"&&(W=[W]),W.forEach(O=>{t[O.toLowerCase()]=z})}function B(W){const z=D(W);return z&&!z.disableAutodetect}function U(W){W["before:highlightBlock"]&&!W["before:highlightElement"]&&(W["before:highlightElement"]=z=>{W["before:highlightBlock"](Object.assign({block:z.el},z))}),W["after:highlightBlock"]&&!W["after:highlightElement"]&&(W["after:highlightElement"]=z=>{W["after:highlightBlock"](Object.assign({block:z.el},z))})}function P(W){U(W),l.push(W)}function H(W){const z=l.indexOf(W);z!==-1&&l.splice(z,1)}function V(W,z){const O=W;l.forEach(function(G){G[O]&&G[O](z)})}function X(W){return vl("10.7.0","highlightBlock will be removed entirely in v12.0"),vl("10.7.0","Please use highlightElement now."),k(W)}Object.assign(n,{highlight:p,highlightAuto:h,highlightAll:A,highlightElement:k,highlightBlock:X,configure:E,initHighlighting:y,initHighlightingOnLoad:T,registerLanguage:R,unregisterLanguage:M,listLanguages:I,getLanguage:D,registerAliases:F,autoDetection:B,inherit:Fa,addPlugin:P,removePlugin:H}),n.debugMode=function(){i=!1},n.safeMode=function(){i=!0},n.versionString=Ak,n.regex={concat:rl,lookahead:rd,either:Bs,optional:G0,anyNumberOfTimes:W0};for(const W in mi)typeof mi[W]=="object"&&sd(mi[W]);return Object.assign(n,mi),n},Tl=hd({});Tl.newInstance=()=>hd({});var Ik=Tl;Tl.HighlightJS=Tl;Tl.default=Tl;const Jt=B0(Ik),Ua="[A-Za-z$_][0-9A-Za-z$_]*",Mk=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Lk=["true","false","null","undefined","NaN","Infinity"],_d=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],bd=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vd=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Dk=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ok=[].concat(vd,_d,bd);function Pk(n){const e=n.regex,t=(O,{after:G})=>{const q="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,G)=>{const q=O[0].length+O.index,Y=O.input[q];if(Y==="<"||Y===","){G.ignoreMatch();return}Y===">"&&(t(O,{after:q})||G.ignoreMatch());let x;const ne=O.input.substring(q);if(x=ne.match(/^\s*=/)){G.ignoreMatch();return}if((x=ne.match(/^\s+extends\s+/))&&x.index===0){G.ignoreMatch();return}}},c={$pattern:Ua,keyword:Mk,literal:Lk,built_in:Ok,"variable.language":Dk},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,g],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},E={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,g]},T={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},N=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,b,k,E,{match:/\$\d+/},m];g.contains=N.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(N)});const A=[].concat(T,g.contains),R=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(A)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},I={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,e.concat(l,"(",e.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[..._d,...bd]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function P(O){return e.concat("(?!",O.join("|"),")")}const H={match:e.concat(/\b/,P([...vd,"super","import"].map(O=>`${O}\\s*\\(`)),l,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:e.concat(/\./,e.lookahead(e.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},W="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",z={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(W)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,b,k,E,T,{match:/\$\d+/},m,D,{scope:"attr",match:l+e.lookahead(":"),relevance:0},z,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,n.REGEXP_MODE,{className:"function",begin:W,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,n.inherit(n.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},H,U,I,X,{match:/\$[(.]/}]}}const Mi="[A-Za-z$_][0-9A-Za-z$_]*",kd=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],wd=["true","false","null","undefined","NaN","Infinity"],yd=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ed=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Td=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Sd=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Cd=[].concat(Td,yd,Ed);function zk(n){const e=n.regex,t=(O,{after:G})=>{const q="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(O,G)=>{const q=O[0].length+O.index,Y=O.input[q];if(Y==="<"||Y===","){G.ignoreMatch();return}Y===">"&&(t(O,{after:q})||G.ignoreMatch());let x;const ne=O.input.substring(q);if(x=ne.match(/^\s*=/)){G.ignoreMatch();return}if((x=ne.match(/^\s+extends\s+/))&&x.index===0){G.ignoreMatch();return}}},c={$pattern:Mi,keyword:kd,literal:wd,built_in:Cd,"variable.language":Sd},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,g],subLanguage:"css"}},k={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},E={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,g]},T={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},N=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,b,k,E,{match:/\$\d+/},m];g.contains=N.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(N)});const A=[].concat(T,g.contains),R=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(A)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},I={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,e.concat(l,"(",e.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...yd,...Ed]}},F={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},B={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function P(O){return e.concat("(?!",O.join("|"),")")}const H={match:e.concat(/\b/,P([...Td,"super","import"].map(O=>`${O}\\s*\\(`)),l,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:e.concat(/\./,e.lookahead(e.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},W="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",z={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(W)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),F,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,b,k,E,T,{match:/\$\d+/},m,D,{scope:"attr",match:l+e.lookahead(":"),relevance:0},z,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[T,n.REGEXP_MODE,{className:"function",begin:W,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},B,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,n.inherit(n.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},H,U,I,X,{match:/\$[(.]/}]}}function Bk(n){const e=n.regex,t=zk(n),l=Mi,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[t.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:Mi,keyword:kd.concat(u),literal:wd,built_in:Cd.concat(i),"variable.language":Sd},p={className:"meta",begin:"@"+l},m=(k,E,y)=>{const T=k.contains.findIndex(N=>N.label===E);if(T===-1)throw new Error("can not find mode to replace");k.contains.splice(T,1,y)};Object.assign(t.keywords,d),t.exports.PARAMS_CONTAINS.push(p);const g=t.contains.find(k=>k.scope==="attr"),h=Object.assign({},g,{match:e.concat(l,e.lookahead(/\s*\?:/))});t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,g,h]),t.contains=t.contains.concat([p,o,s,h]),m(t,"shebang",n.SHEBANG()),m(t,"use_strict",c);const b=t.contains.find(k=>k.label==="func.def");return b.relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}function Fk(n){const e=n.regex,t=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),l=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:l,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},p={begin:/\{\{/,relevance:0},m={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,u,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,u,p,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,p,d]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",h=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,b=`\\b|${l.join("|")}`,k={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${h}))[eE][+-]?(${g})[jJ]?(?=${b})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${g})[jJ](?=${b})`}]},E={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,k,m,n.HASH_COMMENT_MODE]}]};return d.contains=[m,k,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,k,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},m,E,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[k,y,m]}]}}function jk(n){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},g,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},b,k,o,s],y=[...E];return y.pop(),y.push(c),h.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}function Gk(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},l={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},m=n.inherit(d,{contains:[]}),g=n.inherit(p,{contains:[]});d.contains.push(g),p.contains.push(m);let h=[t,u];return[d,p,m,g].forEach(y=>{y.contains=y.contains.concat(h)}),h=h.concat(d,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},t,o,d,p,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},i,l,u,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}const Kk=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Vk=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],qk=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Zk=[...Vk,...qk],Yk=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Xk=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Jk=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Qk=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xk(n){const e=n.regex,t=Kk(n),l={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",c=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,l,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Xk.join("|")+")"},{begin:":(:)?("+Jk.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Qk.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Yk.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Zk.join("|")+")\\b"}]}}function $k(n){const e=n.regex,t=n.COMMENT("--","$"),l={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],p=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],m=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],g=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=p,b=[...d,...u].filter(R=>!p.includes(R)),k={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},E={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:e.concat(/\b/,e.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function T(R){return e.concat(/\b/,e.either(...R.map(M=>M.replace(/\s+/,"\\s+"))),/\b/)}const N={scope:"keyword",match:T(g),relevance:0};function A(R,{exceptions:M,when:I}={}){const D=I;return M=M||[],R.map(F=>F.match(/\|\d+$/)||M.includes(F)?F:D(F)?`${F}|0`:F)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(b,{when:R=>R.length<3}),literal:o,type:c,built_in:m},contains:[{scope:"type",match:T(s)},N,y,k,l,i,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,E]}}function e2(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),l=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=n.inherit(o,{begin:/\(/,end:/\)/}),c=n.inherit(n.APOS_STRING_MODE,{className:"string"}),u=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,u,c,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,u,c]}]}]},n.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}Jt.registerLanguage("javascript",Pk);Jt.registerLanguage("typescript",Bk);Jt.registerLanguage("python",Fk);Jt.registerLanguage("go",jk);Jt.registerLanguage("bash",Uk);Jt.registerLanguage("json",Hk);Jt.registerLanguage("yaml",Wk);Jt.registerLanguage("markdown",Gk);Jt.registerLanguage("css",xk);Jt.registerLanguage("sql",$k);Jt.registerLanguage("xml",e2);const Ad=/^(https?|mailto|verstak):/i,Nd=new Set(["case","note","file","secret"]);id.addHook("afterSanitizeAttributes",n=>{if(n.tagName==="A"){const e=(n.getAttribute("href")||"").trim();if(n.hasAttribute("data-verstak-href"))return;Ad.test(e)||(n.removeAttribute("href"),n.setAttribute("data-blocked-href",e),n.classList.add("md-link--blocked"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"))}n.tagName==="IMG"&&n.remove()});const Al=new dt.Renderer;Al.link=function({href:n,title:e,text:t}){const l=(n||"").trim();if(!Ad.test(l)){const c=nl(t);return`${c}`}if(l.startsWith("verstak://")){const c=Rd(l);if(c&&Nd.has(c.type)){const p=Bn(l),m=nl(t);return`
    ${m}`}const u=nl(t);return`${u}`}const i=Bn(l),o=nl(t),s=e?` title="${Bn(e)}"`:"";return`${o}`};Al.image=function({href:n,title:e,text:t}){return`[Image: ${nl(t)}]`};Al.code=function({text:n,lang:e}){const t=e&&Jt.getLanguage(e)?e:"plaintext";let l;try{l=Jt.highlight(n,{language:t}).value}catch{l=nl(n)}return`
    ${l}
    `};Al.codespan=function({text:n}){return`${nl(n)}`};Al.listitem=function({text:n,task:e,checked:t}){return e?`
  • ${n}
  • `:`
  • ${n}
  • `};dt.setOptions({renderer:Al,gfm:!0,breaks:!1,pedantic:!1});function t2(n){const e=dt.parse(n);return id.sanitize(e,{ADD_ATTR:["target","class","data-verstak-href","data-verstak-type","data-verstak-id","data-blocked-href","role","aria-disabled","checked"],ADD_TAGS:["input","span"],ALLOW_UNKNOWN_PROTOCOLS:!0})}function Rd(n){const e=n.match(/^verstak:\/\/([a-zA-Z_]+)\/(.+)$/);return e?{type:e[1],id:e[2]}:null}function n2(n){return n.replace(/([[\]()])/g,"\\$1")}function l2(n){return Nd.has(n)}function nl(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Bn(n){return n.replace(/"/g,""").replace(/'/g,"'")}function i2(n){let e,t;return{c(){e=new Ei(!1),t=mt(),e.a=t},m(l,i){e.m(n[1],l,i),C(l,t,i)},p(l,i){i&2&&e.p(l[1])},d(l){l&&(S(t),e.d())}}}function s2(n){let e;return{c(){e=f("div"),e.textContent=`${v("note.preview.empty")}`,r(e,"class","md-empty svelte-jdvhib")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function o2(n){let e,t,l,i,o;return{c(){e=f("div"),t=f("p"),t.textContent=`⚠️ ${v("note.preview.error")}`,l=w(),i=f("p"),o=j(n[2]),r(i,"class","md-error-detail svelte-jdvhib"),r(e,"class","md-error svelte-jdvhib")},m(s,c){C(s,e,c),a(e,t),a(e,l),a(e,i),a(i,o)},p(s,c){c&4&&J(o,s[2])},d(s){s&&S(e)}}}function r2(n){let e,t,l,i;function o(u,d){var p;return d&1&&(t=null),u[2]?o2:(t==null&&(t=!((p=u[0])!=null&&p.trim())),t?s2:i2)}let s=o(n,-1),c=s(n);return{c(){e=f("div"),c.c(),r(e,"class","markdown-body svelte-jdvhib"),r(e,"role","article")},m(u,d){C(u,e,d),c.m(e,null),l||(i=L(e,"click",n[3]),l=!0)},p(u,[d]){s===(s=o(u,d))&&c?c.p(u,d):(c.d(1),c=s(u),c&&(c.c(),c.m(e,null)))},i:oe,o:oe,d(u){u&&S(e),c.d(),l=!1,i()}}}function a2(n,e,t){let{content:l=""}=e;const i=tn();let o="",s="";function c(u){const d=u.target.closest("[data-verstak-href]");if(!d)return;const p=d.getAttribute("data-verstak-href");if(!p)return;u.preventDefault(),u.stopPropagation();const m=Rd(p);!m||!l2(m.type)||i("verstak-link",{type:m.type,id:m.id,href:p})}return n.$$set=u=>{"content"in u&&t(0,l=u.content)},n.$$.update=()=>{if(n.$$.dirty&1)try{t(1,o=t2(l||"")),t(2,s="")}catch(u){t(2,s=String(u)),t(1,o="")}},[l,o,s,c]}class Id extends tt{constructor(e){super(),et(this,e,a2,r2,$e,{content:0})}}function c2(n){let e,t,l,i,o,s,c,u={content:n[0],placeholder:n[2],viewMode:"split"};return l=new Kf({props:u}),n[15](l),l.$on("content-change",n[5]),l.$on("save",n[6]),l.$on("insert-link",n[7]),l.$on("insert-internal-link",n[8]),s=new Id({props:{content:n[0]}}),s.$on("verstak-link",n[9]),{c(){e=f("div"),t=f("div"),Ze(l.$$.fragment),i=w(),o=f("div"),Ze(s.$$.fragment),r(t,"class","split-editor svelte-8tdyp9"),r(o,"class","split-preview svelte-8tdyp9"),r(e,"class","split-pane svelte-8tdyp9")},m(d,p){C(d,e,p),a(e,t),Ve(l,t,null),a(e,i),a(e,o),Ve(s,o,null),c=!0},p(d,p){const m={};p&1&&(m.content=d[0]),p&4&&(m.placeholder=d[2]),l.$set(m);const g={};p&1&&(g.content=d[0]),s.$set(g)},i(d){c||(pe(l.$$.fragment,d),pe(s.$$.fragment,d),c=!0)},o(d){ve(l.$$.fragment,d),ve(s.$$.fragment,d),c=!1},d(d){d&&S(e),n[15](null),qe(l),qe(s)}}}function u2(n){let e,t,l;return t=new Id({props:{content:n[0]}}),t.$on("verstak-link",n[9]),{c(){e=f("div"),Ze(t.$$.fragment),r(e,"class","preview-pane svelte-8tdyp9")},m(i,o){C(i,e,o),Ve(t,e,null),l=!0},p(i,o){const s={};o&1&&(s.content=i[0]),t.$set(s)},i(i){l||(pe(t.$$.fragment,i),l=!0)},o(i){ve(t.$$.fragment,i),l=!1},d(i){i&&S(e),qe(t)}}}function f2(n){let e,t,l={content:n[0],placeholder:n[2],viewMode:"edit"};return e=new Kf({props:l}),n[14](e),e.$on("content-change",n[5]),e.$on("save",n[6]),e.$on("insert-link",n[7]),e.$on("insert-internal-link",n[8]),{c(){Ze(e.$$.fragment)},m(i,o){Ve(e,i,o),t=!0},p(i,o){const s={};o&1&&(s.content=i[0]),o&4&&(s.placeholder=i[2]),e.$set(s)},i(i){t||(pe(e.$$.fragment,i),t=!0)},o(i){ve(e.$$.fragment,i),t=!1},d(i){n[14](null),qe(e,i)}}}function d2(n){let e,t,l,i=v("note.mode.edit")+"",o,s,c,u,d=v("note.mode.preview")+"",p,m,g,h,b=v("note.mode.split")+"",k,E,y,T,N,A,R,M,I;const D=[f2,u2,c2],F=[];function B(U,P){return U[1]==="edit"?0:U[1]==="preview"?1:U[1]==="split"?2:-1}return~(N=B(n))&&(A=F[N]=D[N](n)),{c(){e=f("div"),t=f("div"),l=f("button"),o=j(i),c=w(),u=f("button"),p=j(d),g=w(),h=f("button"),k=j(b),y=w(),T=f("div"),A&&A.c(),r(l,"type","button"),r(l,"class","mode-btn svelte-8tdyp9"),r(l,"role","tab"),r(l,"aria-selected",s=n[1]==="edit"),ce(l,"active",n[1]==="edit"),r(u,"type","button"),r(u,"class","mode-btn svelte-8tdyp9"),r(u,"role","tab"),r(u,"aria-selected",m=n[1]==="preview"),ce(u,"active",n[1]==="preview"),r(h,"type","button"),r(h,"class","mode-btn svelte-8tdyp9"),r(h,"role","tab"),r(h,"aria-selected",E=n[1]==="split"),ce(h,"active",n[1]==="split"),r(t,"class","mode-switcher svelte-8tdyp9"),r(t,"role","tablist"),r(t,"aria-label","Note view mode"),r(T,"class","panel-content svelte-8tdyp9"),r(e,"class","note-editor-panel svelte-8tdyp9"),ce(e,"mode-edit",n[1]==="edit"),ce(e,"mode-preview",n[1]==="preview"),ce(e,"mode-split",n[1]==="split")},m(U,P){C(U,e,P),a(e,t),a(t,l),a(l,o),a(t,c),a(t,u),a(u,p),a(t,g),a(t,h),a(h,k),a(e,y),a(e,T),~N&&F[N].m(T,null),R=!0,M||(I=[L(l,"click",n[11]),L(u,"click",n[12]),L(h,"click",n[13])],M=!0)},p(U,[P]){(!R||P&2&&s!==(s=U[1]==="edit"))&&r(l,"aria-selected",s),(!R||P&2)&&ce(l,"active",U[1]==="edit"),(!R||P&2&&m!==(m=U[1]==="preview"))&&r(u,"aria-selected",m),(!R||P&2)&&ce(u,"active",U[1]==="preview"),(!R||P&2&&E!==(E=U[1]==="split"))&&r(h,"aria-selected",E),(!R||P&2)&&ce(h,"active",U[1]==="split");let H=N;N=B(U),N===H?~N&&F[N].p(U,P):(A&&(bt(),ve(F[H],1,1,()=>{F[H]=null}),vt()),~N?(A=F[N],A?A.p(U,P):(A=F[N]=D[N](U),A.c()),pe(A,1),A.m(T,null)):A=null),(!R||P&2)&&ce(e,"mode-edit",U[1]==="edit"),(!R||P&2)&&ce(e,"mode-preview",U[1]==="preview"),(!R||P&2)&&ce(e,"mode-split",U[1]==="split")},i(U){R||(pe(A),R=!0)},o(U){ve(A),R=!1},d(U){U&&S(e),~N&&F[N].d(),M=!1,Se(I)}}}function p2(n,e,t){let{content:l=""}=e,{viewMode:i="edit"}=e,{placeholder:o=""}=e;const s=tn();let c;function u(A){s("mode-change",{mode:A})}function d(A){t(0,l=A.detail.content),s("content-change",A.detail)}function p(){s("save")}function m(){s("insert-link")}function g(){s("insert-internal-link")}function h(A){s("verstak-link",A.detail)}function b(A){c&&typeof c.insertText=="function"&&c.insertText(A)}const k=()=>u("edit"),E=()=>u("preview"),y=()=>u("split");function T(A){En[A?"unshift":"push"](()=>{c=A,t(3,c)})}function N(A){En[A?"unshift":"push"](()=>{c=A,t(3,c)})}return n.$$set=A=>{"content"in A&&t(0,l=A.content),"viewMode"in A&&t(1,i=A.viewMode),"placeholder"in A&&t(2,o=A.placeholder)},[l,i,o,c,u,d,p,m,g,h,b,k,E,y,T,N]}class m2 extends tt{constructor(e){super(),et(this,e,p2,d2,$e,{content:0,viewMode:1,placeholder:2,insertText:10})}get insertText(){return this.$$.ctx[10]}}function Ha(n,e,t){const l=n.slice();return l[25]=e[t],l[27]=t,l}function Wa(n,e,t){const l=n.slice();return l[28]=e[t],l}function Ga(n){let e,t,l,i,o,s,c,u,d,p,m,g,h=ye(n[10]),b=[];for(let T=0;T=2&&s[5].length===0&&!s[7]),t?b2:_2)}let i=l(n,-1),o=i(n);return{c(){e=f("div"),o.c(),r(e,"class","picker-results svelte-12kipyi"),r(e,"role","listbox")},m(s,c){C(s,e,c),o.m(e,null)},p(s,c){i===(i=l(s,c))&&o?o.p(s,c):(o.d(1),o=i(s),o&&(o.c(),o.m(e,null)))},d(s){s&&S(e),o.d()}}}function h2(n){let e;return{c(){e=f("div"),e.innerHTML="

    🔒 Сейф доступов ещё не реализован

    ",r(e,"class","picker-secret-placeholder svelte-12kipyi")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function _2(n){let e,t=ye(n[5]),l=[];for(let i=0;i0?"Нет результатов для этого типа":"Ничего не найдено",l;return{c(){e=f("div"),l=j(t),r(e,"class","picker-empty svelte-12kipyi")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&16&&t!==(t=i[4].length>0?"Нет результатов для этого типа":"Ничего не найдено")&&J(l,t)},d(i){i&&S(e)}}}function v2(n){let e,t;return{c(){e=f("div"),t=j(n[8]),r(e,"class","picker-error svelte-12kipyi")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i&256&&J(t,l[8])},d(l){l&&S(e)}}}function k2(n){let e;return{c(){e=f("div"),e.textContent="Загрузка...",r(e,"class","picker-loading svelte-12kipyi")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function Va(n){let e,t=n[25].path+"",l;return{c(){e=f("span"),l=j(t),r(e,"class","picker-result-path svelte-12kipyi")},m(i,o){C(i,e,o),a(e,l)},p(i,o){o&32&&t!==(t=i[25].path+"")&&J(l,t)},d(i){i&&S(e)}}}function qa(n){let e,t,l=n[25].title+"",i,o,s,c,u,d,p=n[25].path&&Va(n);function m(){return n[18](n[25])}return{c(){e=f("button"),t=f("span"),i=j(l),o=w(),p&&p.c(),s=w(),r(t,"class","picker-result-title svelte-12kipyi"),r(e,"type","button"),r(e,"class","picker-result svelte-12kipyi"),r(e,"role","option"),r(e,"aria-selected",c=n[27]===n[6]),ce(e,"selected",n[27]===n[6])},m(g,h){C(g,e,h),a(e,t),a(t,i),a(e,o),p&&p.m(e,null),a(e,s),u||(d=L(e,"click",m),u=!0)},p(g,h){n=g,h&32&&l!==(l=n[25].title+"")&&J(i,l),n[25].path?p?p.p(n,h):(p=Va(n),p.c(),p.m(e,s)):p&&(p.d(1),p=null),h&64&&c!==(c=n[27]===n[6])&&r(e,"aria-selected",c),h&64&&ce(e,"selected",n[27]===n[6])},d(g){g&&S(e),p&&p.d(),u=!1,d()}}}function w2(n){let e,t=n[0]&&Ga(n);return{c(){t&&t.c(),e=mt()},m(l,i){t&&t.m(l,i),C(l,e,i)},p(l,[i]){l[0]?t?t.p(l,i):(t=Ga(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:oe,o:oe,d(l){l&&S(e),t&&t.d(l)}}}function Za(n){return n==="note"?"note":n==="file"?"file":n==="secret"?"secret":"case"}function y2(n,e,t){let{visible:l=!1}=e;const i=tn(),o=[{id:"case",label:"Дело"},{id:"note",label:"Заметка"},{id:"file",label:"Файл"},{id:"secret",label:"Секрет"}];let s="note",c="",u=[],d=[],p=0,m=!1,g="",h;function b(){t(5,d=u.filter(P=>Za(P.type)===s)),t(6,p=0)}async function k(){if(!c.trim()||c.trim().length<2){t(4,u=[]),t(5,d=[]);return}t(7,m=!0),t(8,g="");try{const P=Wf(c.trim()),H=new Set,V=[];for(const z of P)H.has(z)||(H.add(z),V.push(z));const X=await Promise.all(V.map(z=>window.go.main.App.SearchNodes(z).catch(()=>[]))),W=new Map;for(const z of X)for(const O of z||[])W.has(O.id)||W.set(O.id,O);t(4,u=Array.from(W.values())),b()}catch(P){t(8,g=String(P)),t(4,u=[]),t(5,d=[])}finally{t(7,m=!1)}}function E(){clearTimeout(A),A=setTimeout(k,250)}function y(P){P.key==="ArrowDown"?(P.preventDefault(),t(6,p=Math.min(p+1,d.length-1))):P.key==="ArrowUp"?(P.preventDefault(),t(6,p=Math.max(p-1,0))):P.key==="Enter"?(P.preventDefault(),d[p]&&T(d[p])):P.key==="Escape"&&i("close")}function T(P){const V=`[${n2(P.title||P.id)}](verstak://${Za(P.type)}/${P.id})`;i("insert",{markdown:V})}function N(P){t(2,s=P),b(),h&&h.focus()}let A;function R(P){En[P?"unshift":"push"](()=>{h=P,t(1,h)})}function M(){c=this.value,t(3,c)}const I=P=>P.id!=="secret"&&N(P.id),D=P=>T(P),F=()=>i("close"),B=()=>i("close"),U=P=>P.key==="Escape"&&i("close");return n.$$set=P=>{"visible"in P&&t(0,l=P.visible)},n.$$.update=()=>{n.$$.dirty&3&&l&&h&&setTimeout(()=>h.focus(),50)},[l,h,s,c,u,d,p,m,g,i,o,E,y,T,N,R,M,I,D,F,B,U]}class E2 extends tt{constructor(e){super(),et(this,e,y2,w2,$e,{visible:0})}}function Ya(n){let e,t=n[2](n[0])+"",l,i,o,s,c;return{c(){e=f("div"),l=j(t),i=w(),o=f("button"),o.innerHTML='',r(o,"class","dismiss-btn svelte-13wzf1z"),r(o,"aria-label","Dismiss"),r(e,"class","error-banner svelte-13wzf1z"),r(e,"role","button"),r(e,"tabindex","0")},m(u,d){C(u,e,d),a(e,l),a(e,i),a(e,o),s||(c=[L(o,"click",He(function(){yn(n[1])&&n[1].apply(this,arguments)})),L(e,"click",function(){yn(n[1])&&n[1].apply(this,arguments)}),L(e,"keydown",n[3])],s=!0)},p(u,d){n=u,d&1&&t!==(t=n[2](n[0])+"")&&J(l,t)},d(u){u&&S(e),s=!1,Se(c)}}}function T2(n){let e,t=n[0]&&Ya(n);return{c(){t&&t.c(),e=mt()},m(l,i){t&&t.m(l,i),C(l,e,i)},p(l,[i]){l[0]?t?t.p(l,i):(t=Ya(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:oe,o:oe,d(l){l&&S(e),t&&t.d(l)}}}function S2(n,e,t){let{error:l=""}=e,{onDismiss:i=()=>{}}=e;function o(c){return{"vault not open":v("error.vaultNotOpen")}[c]||c}function s(c){(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),i())}return n.$$set=c=>{"error"in c&&t(0,l=c.error),"onDismiss"in c&&t(1,i=c.onDismiss)},[l,i,o,s]}class C2 extends tt{constructor(e){super(),et(this,e,S2,T2,$e,{error:0,onDismiss:1})}}function Xa(n){let e,t,l;return{c(){e=f("div"),t=f("div"),l=j(n[1]),r(t,"class","capture-drop-box svelte-1vln5q"),r(e,"class","capture-drop-overlay svelte-1vln5q")},m(i,o){C(i,e,o),a(e,t),a(t,l)},p(i,o){o&2&&J(l,i[1])},d(i){i&&S(e)}}}function A2(n){let e,t=n[0]&&Xa(n);return{c(){t&&t.c(),e=mt()},m(l,i){t&&t.m(l,i),C(l,e,i)},p(l,[i]){l[0]?t?t.p(l,i):(t=Xa(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:oe,o:oe,d(l){l&&S(e),t&&t.d(l)}}}function N2(n,e,t){let{show:l=!1}=e,{label:i=""}=e;return n.$$set=o=>{"show"in o&&t(0,l=o.show),"label"in o&&t(1,i=o.label)},[l,i]}class R2 extends tt{constructor(e){super(),et(this,e,N2,A2,$e,{show:0,label:1})}}function Ja(n,e,t){const l=n.slice();return l[12]=e[t],l}function Qa(n,e,t){const l=n.slice();return l[15]=e[t],l}function xa(n){let e,t,l,i=ye(n[1].slice(0,5)),o=[];for(let s=0;s0&&xa(n),Ge=n[2].length>0&&ec(n);return{c(){e=f("div"),t=f("h2"),i=j(l),o=w(),s=f("div"),c=f("div"),u=f("span"),u.textContent=`${v("overview.type")}`,d=f("span"),m=j(p),g=w(),h=f("div"),b=f("span"),b.textContent=`${v("overview.section")}`,k=f("span"),y=j(E),T=w(),N=f("div"),A=f("span"),A.textContent=`${v("overview.created")}`,R=f("span"),I=j(M),D=w(),F=f("div"),B=f("button"),U=ae("svg"),P=ae("path"),H=ae("path"),V=w(),W=j(X),z=w(),O=f("button"),G=ae("svg"),q=ae("path"),Y=w(),ne=j(x),le=w(),ie=f("button"),me=ae("svg"),Ne=ae("polygon"),ze=w(),Re=j(Ye),te=w(),re=f("button"),Ae=ae("svg"),Be=ae("circle"),be=ae("polyline"),We=w(),Te=j(at),nt=w(),je&&je.c(),De=w(),Ge&&Ge.c(),r(t,"class","node-title svelte-1sxmeg5"),r(u,"class","meta-label svelte-1sxmeg5"),r(c,"class","meta-item svelte-1sxmeg5"),r(b,"class","meta-label svelte-1sxmeg5"),r(h,"class","meta-item svelte-1sxmeg5"),r(A,"class","meta-label svelte-1sxmeg5"),r(N,"class","meta-item svelte-1sxmeg5"),r(s,"class","meta-grid svelte-1sxmeg5"),r(P,"d","M12 20h9"),r(H,"d","M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"),r(U,"width","16"),r(U,"height","16"),r(U,"viewBox","0 0 24 24"),r(U,"fill","none"),r(U,"stroke","currentColor"),r(U,"stroke-width","2"),r(U,"stroke-linecap","round"),r(U,"stroke-linejoin","round"),r(B,"class","qa-btn svelte-1sxmeg5"),r(q,"d","M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"),r(G,"width","16"),r(G,"height","16"),r(G,"viewBox","0 0 24 24"),r(G,"fill","none"),r(G,"stroke","currentColor"),r(G,"stroke-width","2"),r(G,"stroke-linecap","round"),r(G,"stroke-linejoin","round"),r(O,"class","qa-btn svelte-1sxmeg5"),r(Ne,"points","13 2 3 14 12 14 11 22 21 10 12 10 13 2"),r(me,"width","16"),r(me,"height","16"),r(me,"viewBox","0 0 24 24"),r(me,"fill","none"),r(me,"stroke","currentColor"),r(me,"stroke-width","2"),r(me,"stroke-linecap","round"),r(me,"stroke-linejoin","round"),r(ie,"class","qa-btn svelte-1sxmeg5"),r(Be,"cx","12"),r(Be,"cy","12"),r(Be,"r","10"),r(be,"points","12 6 12 12 16 14"),r(Ae,"width","16"),r(Ae,"height","16"),r(Ae,"viewBox","0 0 24 24"),r(Ae,"fill","none"),r(Ae,"stroke","currentColor"),r(Ae,"stroke-width","2"),r(Ae,"stroke-linecap","round"),r(Ae,"stroke-linejoin","round"),r(re,"class","qa-btn svelte-1sxmeg5"),r(F,"class","quick-actions svelte-1sxmeg5"),r(e,"class","overview svelte-1sxmeg5")},m(Pe,fe){C(Pe,e,fe),a(e,t),a(t,i),a(e,o),a(e,s),a(s,c),a(c,u),a(c,d),a(d,m),a(s,g),a(s,h),a(h,b),a(h,k),a(k,y),a(s,T),a(s,N),a(N,A),a(N,R),a(R,I),a(e,D),a(e,F),a(F,B),a(B,U),a(U,P),a(U,H),a(B,V),a(B,W),a(F,z),a(F,O),a(O,G),a(G,q),a(O,Y),a(O,ne),a(F,le),a(F,ie),a(ie,me),a(me,Ne),a(ie,ze),a(ie,Re),a(F,te),a(F,re),a(re,Ae),a(Ae,Be),a(Ae,be),a(re,We),a(re,Te),a(e,nt),je&&je.m(e,null),a(e,De),Ge&&Ge.m(e,null),Ce||(Fe=[L(B,"click",n[6]),L(O,"click",n[7]),L(ie,"click",n[8]),L(re,"click",n[9])],Ce=!0)},p(Pe,[fe]){fe&1&&l!==(l=Pe[0].title+"")&&J(i,l),fe&9&&p!==(p=Pe[3](Pe[0].type)+"")&&J(m,p),fe&1&&E!==(E=(Pe[0].section||"—")+"")&&J(y,E),fe&17&&M!==(M=Pe[4](Pe[0].createdAt)+"")&&J(I,M),Pe[1].length>0?je?je.p(Pe,fe):(je=xa(Pe),je.c(),je.m(e,De)):je&&(je.d(1),je=null),Pe[2].length>0?Ge?Ge.p(Pe,fe):(Ge=ec(Pe),Ge.c(),Ge.m(e,null)):Ge&&(Ge.d(1),Ge=null)},i:oe,o:oe,d(Pe){Pe&&S(e),je&&je.d(),Ge&&Ge.d(),Ce=!1,Se(Fe)}}}function nc(n){return e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n())}}function M2(n,e,t){const l=tn();let{node:i=null}=e,{notes:o=[]}=e,{worklog:s=[]}=e,{nodeKindLabel:c=k=>k||""}=e,{formatDate:u=k=>k||""}=e;function d(){l("goTab","notes"),l("createNote")}function p(){l("goTab","files"),l("addFile")}const m=()=>l("createAction"),g=()=>l("goTab","worklog"),h=k=>l("openNote",{note:k}),b=k=>l("openNote",{note:k});return n.$$set=k=>{"node"in k&&t(0,i=k.node),"notes"in k&&t(1,o=k.notes),"worklog"in k&&t(2,s=k.worklog),"nodeKindLabel"in k&&t(3,c=k.nodeKindLabel),"formatDate"in k&&t(4,u=k.formatDate)},[i,o,s,c,u,l,d,p,m,g,h,b]}class L2 extends tt{constructor(e){super(),et(this,e,M2,I2,$e,{node:0,notes:1,worklog:2,nodeKindLabel:3,formatDate:4})}}function lc(n,e,t){const l=n.slice();return l[18]=e[t],l}function ic(n){let e,t,l,i,o,s,c,u,d;return{c(){e=f("div"),t=f("input"),l=w(),i=f("div"),o=f("button"),o.textContent=`${v("common.create")}`,s=w(),c=f("button"),c.textContent=`${v("common.cancel")}`,r(t,"type","text"),r(t,"placeholder",v("note.title")),r(t,"class","svelte-109wv4d"),r(o,"class","btn btn-primary svelte-109wv4d"),r(c,"class","btn svelte-109wv4d"),r(i,"class","form-actions svelte-109wv4d"),r(e,"class","create-form svelte-109wv4d")},m(p,m){C(p,e,m),a(e,t),Le(t,n[3]),a(e,l),a(e,i),a(i,o),a(i,s),a(i,c),u||(d=[L(t,"input",n[11]),L(t,"keydown",n[12]),L(o,"click",n[5]),L(c,"click",n[6])],u=!0)},p(p,m){m&8&&t.value!==p[3]&&Le(t,p[3])},d(p){p&&S(e),u=!1,Se(d)}}}function D2(n){let e,t=ye(n[0]),l=[];for(let i=0;i',h=w(),b=f("button"),b.innerHTML='',k=w(),r(l,"class","note-card-title svelte-109wv4d"),r(c,"class","note-card-date svelte-109wv4d"),r(t,"class","note-card-info svelte-109wv4d"),r(g,"class","note-action-btn svelte-109wv4d"),r(g,"title",v("common.rename")),r(b,"class","note-action-btn note-action-danger svelte-109wv4d"),r(b,"title",v("common.delete")),r(m,"class","note-card-actions svelte-109wv4d"),r(e,"class","note-card svelte-109wv4d"),r(e,"role","button"),r(e,"tabindex","0")},m(M,I){C(M,e,I),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(e,p),a(e,m),a(m,g),a(m,h),a(m,b),a(e,k),E||(y=[L(g,"click",T),L(b,"click",N),L(m,"click",He(n[10])),L(e,"click",A),L(e,"keydown",function(){yn(oc(R))&&oc(R).apply(this,arguments)})],E=!0)},p(M,I){n=M,I&1&&i!==(i=n[18].title+"")&&J(o,i),I&5&&u!==(u=n[2](n[18].createdAt)+"")&&J(d,u)},d(M){M&&S(e),E=!1,Se(y)}}}function P2(n){let e,t,l,i,o,s,c,u=n[1]&&ic(n);function d(g,h){return g[0].length===0&&!g[1]?O2:D2}let p=d(n),m=p(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent=`${v("note.add")}`,i=w(),u&&u.c(),o=w(),m.c(),r(l,"class","btn btn-primary svelte-109wv4d"),r(t,"class","tab-toolbar svelte-109wv4d"),r(e,"class","notes-tab svelte-109wv4d")},m(g,h){C(g,e,h),a(e,t),a(t,l),a(e,i),u&&u.m(e,null),a(e,o),m.m(e,null),s||(c=L(l,"click",n[4]),s=!0)},p(g,[h]){g[1]?u?u.p(g,h):(u=ic(g),u.c(),u.m(e,o)):u&&(u.d(1),u=null),p===(p=d(g))&&m?m.p(g,h):(m.d(1),m=p(g),m&&(m.c(),m.m(e,null)))},i:oe,o:oe,d(g){g&&S(e),u&&u.d(),m.d(),s=!1,c()}}}function oc(n){return e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n())}}function z2(n,e,t){const l=tn();let{notes:i=[]}=e,{showCreateNote:o=!1}=e,{formatDate:s=R=>R||""}=e,c="";function u(){l("createNote")}function d(){c.trim()&&(l("submitCreateNote",{title:c.trim()}),t(3,c=""))}function p(){l("cancelCreateNote")}function m(R){l("openNote",{note:R})}function g(R){l("startRename",{note:R})}function h(R){l("delete",{note:R})}function b(R){Cs.call(this,n,R)}function k(){c=this.value,t(3,c)}const E=R=>R.key==="Enter"&&d(),y=R=>g(R),T=R=>h(R),N=R=>m(R),A=R=>m(R);return n.$$set=R=>{"notes"in R&&t(0,i=R.notes),"showCreateNote"in R&&t(1,o=R.showCreateNote),"formatDate"in R&&t(2,s=R.formatDate)},[i,o,s,c,u,d,p,m,g,h,b,k,E,y,T,N,A]}class B2 extends tt{constructor(e){super(),et(this,e,z2,P2,$e,{notes:0,showCreateNote:1,formatDate:2})}}function rc(n,e,t){const l=n.slice();return l[69]=e[t],l}function ac(n){let e,t=v("common.paste")+"",l,i,o=n[10].items.length+"",s,c,u;return{c(){e=f("button"),l=j(t),i=w(),s=j(o),r(e,"class","btn svelte-1ne4y1t")},m(d,p){C(d,e,p),a(e,l),a(e,i),a(e,s),c||(u=L(e,"click",n[26]),c=!0)},p(d,p){p[0]&1024&&o!==(o=d[10].items.length+"")&&J(s,o)},d(d){d&&S(e),c=!1,u()}}}function F2(n){let e,t,l,i,o,s,c;const u=[H2,U2],d=[];function p(b,k){return b[5].length>0?0:1}e=p(n),t=d[e]=u[e](n);const m=[G2,W2],g=[];function h(b,k){return b[4].length===0?0:1}return i=h(n),o=g[i]=m[i](n),{c(){t.c(),l=w(),o.c(),s=mt()},m(b,k){d[e].m(b,k),C(b,l,k),g[i].m(b,k),C(b,s,k),c=!0},p(b,k){let E=e;e=p(b),e===E?d[e].p(b,k):(bt(),ve(d[E],1,1,()=>{d[E]=null}),vt(),t=d[e],t?t.p(b,k):(t=d[e]=u[e](b),t.c()),pe(t,1),t.m(l.parentNode,l));let y=i;i=h(b),i===y?g[i].p(b,k):(bt(),ve(g[y],1,1,()=>{g[y]=null}),vt(),o=g[i],o?o.p(b,k):(o=g[i]=m[i](b),o.c()),pe(o,1),o.m(s.parentNode,s))},i(b){c||(pe(t),pe(o),c=!0)},o(b){ve(t),ve(o),c=!1},d(b){b&&(S(l),S(s)),d[e].d(b),g[i].d(b)}}}function j2(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${v("common.loading")}`,r(t,"class","svelte-1ne4y1t"),r(e,"class","empty-state svelte-1ne4y1t")},m(l,i){C(l,e,i),a(e,t)},p:oe,i:oe,o:oe,d(l){l&&S(e)}}}function U2(n){let e,t;return e=new zf({props:{crumbs:[{name:v("file.root")}]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:oe,i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function H2(n){let e,t,l,i,o,s,c,u=v("common.backLabel")+"",d,p,m,g;return e=new zf({props:{crumbs:[{name:v("file.root")},...n[5]]}}),e.$on("navigate",n[40]),{c(){Ze(e.$$.fragment),t=w(),l=f("button"),i=ae("svg"),o=ae("line"),s=ae("polyline"),c=w(),d=j(u),r(o,"x1","19"),r(o,"y1","12"),r(o,"x2","5"),r(o,"y2","12"),r(s,"points","12 19 5 12 12 5"),r(i,"width","14"),r(i,"height","14"),r(i,"viewBox","0 0 24 24"),r(i,"fill","none"),r(i,"stroke","currentColor"),r(i,"stroke-width","2"),r(i,"stroke-linecap","round"),r(i,"stroke-linejoin","round"),r(l,"class","btn btn-sm back-btn svelte-1ne4y1t")},m(h,b){Ve(e,h,b),C(h,t,b),C(h,l,b),a(l,i),a(i,o),a(i,s),a(l,c),a(l,d),p=!0,m||(g=L(l,"click",n[17]),m=!0)},p(h,b){const k={};b[0]&32&&(k.crumbs=[{name:v("file.root")},...h[5]]),e.$set(k)},i(h){p||(pe(e.$$.fragment,h),p=!0)},o(h){ve(e.$$.fragment,h),p=!1},d(h){h&&(S(t),S(l)),qe(e,h),m=!1,g()}}}function W2(n){let e,t=[],l=new Map,i,o=ye(n[4]);const s=c=>c[69].id;for(let c=0;c0?v("file.noFiles"):v("file.noFilesCase"))+"",s,c,u,d,p,m,g,h,b,k;return{c(){e=f("div"),t=f("div"),t.innerHTML='',l=w(),i=f("p"),s=j(o),c=w(),u=f("p"),u.textContent=`${v("file.hint")}`,d=w(),p=f("div"),m=f("button"),m.textContent=`${v("file.addFileSimple")}`,g=w(),h=f("button"),h.textContent=`${v("file.addFolderSimple")}`,r(t,"class","empty-icon svelte-1ne4y1t"),r(i,"class","svelte-1ne4y1t"),r(u,"class","hint svelte-1ne4y1t"),r(m,"class","btn btn-primary svelte-1ne4y1t"),r(h,"class","btn svelte-1ne4y1t"),r(p,"class","empty-actions svelte-1ne4y1t"),r(e,"class","empty-state svelte-1ne4y1t")},m(E,y){C(E,e,y),a(e,t),a(e,l),a(e,i),a(i,s),a(e,c),a(e,u),a(e,d),a(e,p),a(p,m),a(p,g),a(p,h),b||(k=[L(m,"click",n[33]),L(h,"click",n[34])],b=!0)},p(E,y){y[0]&32&&o!==(o=(E[5].length>0?v("file.noFiles"):v("file.noFilesCase"))+"")&&J(s,o)},i:oe,o:oe,d(E){E&&S(e),b=!1,Se(k)}}}function cc(n,e){let t,l,i;return l=new Sh({props:{item:e[69],selected:e[11].includes(e[69].id),onDragStart:e[30],onDragOver:e[31],onDrop:e[32]}}),l.$on("navigate",e[41]),l.$on("preview",e[42]),l.$on("openExternal",e[43]),l.$on("showInFolder",e[44]),l.$on("delete",e[45]),l.$on("rename",e[46]),l.$on("duplicate",e[47]),l.$on("cut",e[48]),l.$on("copy",e[49]),l.$on("selectOne",e[50]),l.$on("toggleSelect",e[51]),l.$on("rangeSelect",e[52]),{key:n,first:null,c(){t=mt(),Ze(l.$$.fragment),this.first=t},m(o,s){C(o,t,s),Ve(l,o,s),i=!0},p(o,s){e=o;const c={};s[0]&16&&(c.item=e[69]),s[0]&2064&&(c.selected=e[11].includes(e[69].id)),l.$set(c)},i(o){i||(pe(l.$$.fragment,o),i=!0)},o(o){ve(l.$$.fragment,o),i=!1},d(o){o&&S(t),qe(l,o)}}}function uc(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${v("file.scanning")}`,r(t,"class","svelte-1ne4y1t"),r(e,"class","empty-state svelte-1ne4y1t")},m(l,i){C(l,e,i),a(e,t)},d(l){l&&S(e)}}}function fc(n){let e,t,l,i,o,s,c,u,d=(n[13].path||n[15])+"",p,m,g,h,b,k,E,y,T,N,A,R=n[13].files&&dc(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${v("file.importTitle")}`,i=w(),o=f("div"),s=f("p"),c=f("strong"),c.textContent=`${v("file.path")}:`,u=w(),p=j(d),m=w(),R&&R.c(),g=w(),h=f("div"),b=f("button"),b.textContent=`${v("file.importCopy")}`,k=w(),E=f("button"),E.textContent=`${v("file.importLink")}`,y=w(),T=f("button"),T.textContent=`${v("common.cancel")}`,r(l,"class","svelte-1ne4y1t"),r(s,"class","svelte-1ne4y1t"),r(o,"class","import-summary svelte-1ne4y1t"),r(b,"class","btn btn-primary svelte-1ne4y1t"),r(E,"class","btn svelte-1ne4y1t"),r(T,"class","btn svelte-1ne4y1t"),r(h,"class","form-actions svelte-1ne4y1t"),r(t,"class","modal-box svelte-1ne4y1t"),r(t,"role","document"),r(e,"class","modal-overlay svelte-1ne4y1t"),r(e,"role","dialog"),r(e,"aria-modal","true"),r(e,"aria-label",v("file.importTitle"))},m(M,I){C(M,e,I),a(e,t),a(t,l),a(t,i),a(t,o),a(o,s),a(s,c),a(s,u),a(s,p),a(o,m),R&&R.m(o,null),a(t,g),a(t,h),a(h,b),a(h,k),a(h,E),a(h,y),a(h,T),N||(A=[L(b,"click",n[53]),L(E,"click",n[54]),L(T,"click",n[36]),L(e,"click",Kt(n[36])),L(e,"keydown",n[55])],N=!0)},p(M,I){I[0]&40960&&d!==(d=(M[13].path||M[15])+"")&&J(p,d),M[13].files?R?R.p(M,I):(R=dc(M),R.c(),R.m(o,null)):R&&(R.d(1),R=null)},d(M){M&&S(e),R&&R.d(),N=!1,Se(A)}}}function dc(n){let e,t=v("file.files")+"",l,i,o=n[13].files.length+"",s;return{c(){e=f("p"),l=j(t),i=j(": "),s=j(o),r(e,"class","svelte-1ne4y1t")},m(c,u){C(c,e,u),a(e,l),a(e,i),a(e,s)},p(c,u){u[0]&8192&&o!==(o=c[13].files.length+"")&&J(s,o)},d(c){c&&S(e)}}}function pc(n){let e,t;return e=new Bf({props:{item:n[6],content:n[7],loading:n[8],error:n[9],wailsCall:wt}}),e.$on("close",n[20]),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const o={};i[0]&64&&(o.item=l[6]),i[0]&128&&(o.content=l[7]),i[0]&256&&(o.loading=l[8]),i[0]&512&&(o.error=l[9]),e.$set(o)},i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function K2(n){let e,t,l,i=v("file.addFile")+"",o,s,c,u=v("file.addFolder")+"",d,p,m,g,h,b,k,E,y,T,N,A,R,M=n[10].items.length>0&&ac(n);const I=[j2,F2],D=[];function F(H,V){return H[2]?0:1}b=F(n),k=D[b]=I[b](n);let B=n[12]&&!n[14]&&uc(),U=n[14]&&n[13]&&fc(n),P=n[6]&&pc(n);return{c(){e=f("div"),t=f("div"),l=f("button"),o=j(i),s=w(),c=f("button"),d=j(u),p=w(),m=f("button"),m.textContent=`${v("file.newFile")}`,g=w(),M&&M.c(),h=w(),k.c(),E=w(),B&&B.c(),y=w(),U&&U.c(),T=w(),P&&P.c(),r(l,"class","btn btn-primary svelte-1ne4y1t"),l.disabled=n[12],r(c,"class","btn svelte-1ne4y1t"),c.disabled=n[12],r(m,"class","btn svelte-1ne4y1t"),r(t,"class","tab-toolbar svelte-1ne4y1t"),r(e,"class","files-tab svelte-1ne4y1t")},m(H,V){C(H,e,V),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(t,p),a(t,m),a(t,g),M&&M.m(t,null),a(e,h),D[b].m(e,null),a(e,E),B&&B.m(e,null),a(e,y),U&&U.m(e,null),a(e,T),P&&P.m(e,null),N=!0,A||(R=[L(l,"click",n[33]),L(c,"click",n[34]),L(m,"click",n[21])],A=!0)},p(H,V){(!N||V[0]&4096)&&(l.disabled=H[12]),(!N||V[0]&4096)&&(c.disabled=H[12]),H[10].items.length>0?M?M.p(H,V):(M=ac(H),M.c(),M.m(t,null)):M&&(M.d(1),M=null);let X=b;b=F(H),b===X?D[b].p(H,V):(bt(),ve(D[X],1,1,()=>{D[X]=null}),vt(),k=D[b],k?k.p(H,V):(k=D[b]=I[b](H),k.c()),pe(k,1),k.m(e,E)),H[12]&&!H[14]?B||(B=uc(),B.c(),B.m(e,y)):B&&(B.d(1),B=null),H[14]&&H[13]?U?U.p(H,V):(U=fc(H),U.c(),U.m(e,T)):U&&(U.d(1),U=null),H[6]?P?(P.p(H,V),V[0]&64&&pe(P,1)):(P=pc(H),P.c(),pe(P,1),P.m(e,null)):P&&(bt(),ve(P,1,1,()=>{P=null}),vt())},i(H){N||(pe(k),pe(P),N=!0)},o(H){ve(k),ve(P),N=!1},d(H){H&&S(e),M&&M.d(),D[b].d(),B&&B.d(),U&&U.d(),P&&P.d(),A=!1,Se(R)}}}function wt(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails call error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function V2(n){if(!n)return!1;const e=(n.name||"").toLowerCase();return e.endsWith(".png")||e.endsWith(".jpg")||e.endsWith(".jpeg")||e.endsWith(".gif")||e.endsWith(".webp")||e.endsWith(".svg")||e.endsWith(".bmp")||e.endsWith(".ico")||e.endsWith(".pdf")}function q2(n){if(!n)return!1;const e=(n.name||"").toLowerCase();return e.endsWith(".txt")||e.endsWith(".log")||e.endsWith(".json")||e.endsWith(".xml")||e.endsWith(".csv")||e.endsWith(".md")||e.endsWith(".js")||e.endsWith(".ts")||e.endsWith(".css")||e.endsWith(".html")||e.endsWith(".yaml")||e.endsWith(".yml")}function Z2(n,e,t){const l=tn();let{selectedNode:i=null}=e,o=!1,s=null,c=[],u=[],d=null,p="",m=!1,g="",h={items:[],mode:"copy"},b=[],k=[],E=!1,y=null,T=!1,N="",A="";function R($){if($.ctrlKey||$.metaKey)$.key==="c"||$.key==="C"?($.preventDefault(),ie()):$.key==="x"||$.key==="X"?($.preventDefault(),le()):$.key==="v"||$.key==="V"?($.preventDefault(),z()):$.key==="a"||$.key==="A"?($.preventDefault(),Y()):$.key==="o"||$.key==="O"?($.preventDefault(),Ne()):$.key==="Enter"&&($.preventDefault(),me());else if($.key==="Enter")$.preventDefault(),me();else if($.key==="Delete"){if(d){$.preventDefault(),U();return}if(b.length>0){$.preventDefault(),Ye();return}}else if($.key==="Escape"){if(d){U();return}if(b.length>0){x();return}}else $.key==="F2"&&($.preventDefault(),ze())}async function M($){t(2,o=!0);try{let ee=await wt("ListItems",$)||[];ee.sort((we,Ke)=>we.type!==Ke.type?we.type==="folder"?-1:1:(we.name||"").localeCompare(Ke.name||"")),t(4,u=ee)}catch{t(4,u=[])}t(2,o=!1)}async function I($){if(i){try{const ee=await wt("GetNodeDetail",$);ee&&t(5,c=[...c,{id:$,name:ee.title}])}catch{t(5,c=[...c,{id:$,name:"..."}])}t(3,s=$),await M($)}}function D(){if(c.length<2)t(5,c=[]),t(3,s=null),i&&M(i.id);else{const $=c[c.length-2];t(5,c=c.slice(0,-1)),t(3,s=$.id),M($.id)}}function F($){const ee=c[$];t(5,c=c.slice(0,$+1)),t(3,s=ee.id),M(ee.id)}async function B($){if($&&$.fileId&&Pf($))try{const ee=await wt("CheckFileAction",$.fileId);if(ee.action==="note"){l("openNote",{note:{id:ee.noteId,title:ee.noteTitle}});return}if(ee.action==="external"){await wt("OpenFile",$.fileId);return}}catch(ee){console.warn("CheckFileAction failed, falling back to preview:",ee)}t(6,d=$),t(7,p=""),t(9,g=""),t(8,m=!0);try{V2($)?t(7,p=await wt("GetFileBase64",$.fileId)||""):q2($)&&t(7,p=await wt("ReadFileText",$.fileId)||"")}catch(ee){t(9,g=String(ee))}t(8,m=!1)}function U(){t(6,d=null),t(7,p=""),t(9,g="")}async function P(){const $=prompt(v("file.namePrompt"));if(!(!$||!$.trim()))try{const ee=s||i.id;await wt("CreateEmptyFile",ee,$.trim()),await M(ee),l("refreshParent",{nodeId:ee})}catch(ee){l("error",{message:String(ee)})}}async function H($){try{await wt("DuplicateNode",$);const ee=s||i.id;await M(ee),l("refreshParent",{nodeId:ee})}catch(ee){l("error",{message:String(ee)})}}function V($){const ee=u.find(we=>we.id===$);ee&&l("rename",{id:$,name:ee.name})}function X($){t(10,h={items:[$],mode:"cut"})}function W($){t(10,h={items:[$],mode:"copy"})}async function z(){if(h.items.length===0)return;const $=s||i.id;try{if(h.mode==="copy")for(const ee of h.items)await wt("DuplicateNode",ee);else for(const ee of h.items)await wt("MoveNode",ee,$);t(10,h={items:[],mode:"copy"}),await M($)}catch(ee){l("error",{message:String(ee)})}}function O($){return $.length>0?$:u.map(ee=>ee.id)}function G($){b.includes($)?t(11,b=b.filter(ee=>ee!==$)):t(11,b=[...b,$])}function q($){t(11,b=[$])}function Y(){t(11,b=u.map($=>$.id))}function x(){t(11,b=[])}function ne($){if(u.length===0)return;const ee=b.length>0?b[b.length-1]:u[0].id,we=u.findIndex(ct=>ct.id===ee),Ke=u.findIndex(ct=>ct.id===$);if(we===-1||Ke===-1)return;const pt=Math.min(we,Ke),Mt=Math.max(we,Ke),Lt=u.slice(pt,Mt+1).map(ct=>ct.id),Nt=new Set(b);Lt.forEach(ct=>Nt.add(ct)),t(11,b=[...Nt])}function le(){const $=O(b);t(10,h={items:$,mode:"cut"}),t(11,b=[])}function ie(){const $=O(b);t(10,h={items:$,mode:"copy"}),t(11,b=[])}function me(){if(b.length===1){const $=u.find(ee=>ee.id===b[0]);$&&($.type==="folder"?I($.id):B($))}}function Ne(){if(b.length===1){const $=u.find(ee=>ee.id===b[0]);$&&$.fileId&&wt("OpenFile",$.fileId)}}function ze(){if(b.length===1){const $=u.find(ee=>ee.id===b[0]);$&&l("rename",{id:$.id,name:$.name})}}async function Ye(){const $=O(b),ee=u.find(Ke=>Ke.id===$[0]);let we;$.length===1&&(ee==null?void 0:ee.type)==="folder"?we=v("delete.folder"):$.length===1?we=v("delete.file"):we=v("delete.files",{count:$.length}),l("confirm",{title:v("delete.confirmTitle"),message:v("delete.confirmMessage")+" "+we+"?",confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{for(const pt of $)try{await wt("DeleteFileOrFolder",pt)}catch(Mt){l("error",{message:String(Mt)})}t(11,b=[]);const Ke=s||i.id;await M(Ke)}})}function Re($,ee){$.stopPropagation();const we=b.includes(ee)?b:[ee];k=we,$.dataTransfer.effectAllowed="move",$.dataTransfer.setData("text/plain",we.join(","))}function te($,ee){const we=u.find(Ke=>Ke.id===ee);we&&we.type==="folder"&&($.preventDefault(),$.stopPropagation(),$.dataTransfer.dropEffect="move")}async function re($,ee){if($.preventDefault(),$.stopPropagation(),k.length!==0){for(const we of k)try{await wt("MoveNode",we,ee)}catch(Ke){l("error",{message:String(Ke)})}k=[],t(11,b=[]),await M(s||i.id)}}async function Ae(){const $=await wt("PickFile");if(!$)return;const ee=s||i.id;await be(ee,$)}async function Be(){const $=await wt("PickDirectory");if(!$)return;const ee=s||i.id;await be(ee,$)}async function be($,ee){t(12,E=!0);try{const we=await wt("PreviewImport",ee);t(13,y=we),t(15,N=ee),A=$,t(14,T=!0)}catch(we){l("error",{message:String(we)})}t(12,E=!1)}async function We($){try{const ee=A||i.id,we=$==="copy"?await wt("AddPathCopy",ee,N):await wt("AddPathLink",ee,N);t(14,T=!1),t(13,y=null),t(5,c=[]),t(3,s=null),await M(ee),l("refreshParent",{nodeId:ee})}catch(ee){l("error",{message:String(ee)})}}function at(){t(14,T=!1),t(13,y=null)}async function Te({id:$,type:ee}){const we=v(ee==="folder"?"delete.folder":"delete.file");l("confirm",{title:v("delete.confirmTitle"),message:v("delete.confirmMessage")+" "+we+"?",confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{try{await wt("DeleteFileOrFolder",$);const Ke=s||i.id;await M(Ke)}catch(Ke){l("error",{message:String(Ke)})}}})}function nt($){t(5,c=[]),t(3,s=null),t(11,b=[]),k=[],t(10,h={items:[],mode:"copy"}),t(4,u=[]),t(2,o=!1),t(6,d=null),t(7,p=""),t(9,g=""),t(12,E=!1),t(14,T=!1),t(13,y=null),$&&M($)}const De=$=>{const ee=$.detail;ee===0?(t(5,c=[]),t(3,s=null),i&&M(i.id)):F(ee-1)},Ce=$=>I($.detail),Fe=$=>B($.detail),je=$=>wt("OpenFile",$.detail),Ge=$=>wt("OpenFolder",$.detail),Pe=$=>Te($.detail),fe=$=>V($.detail.id),ge=$=>H($.detail),Q=$=>X($.detail),he=$=>W($.detail),_e=$=>q($.detail),Me=$=>G($.detail),rt=$=>ne($.detail),Qe=()=>We("copy"),xe=()=>We("link"),ut=$=>$.key==="Escape"&&at();return n.$$set=$=>{"selectedNode"in $&&t(0,i=$.selectedNode)},n.$$.update=()=>{n.$$.dirty[0]&29&&i&&i.id&&!s&&u.length===0&&!o&&M(i.id)},[i,M,o,s,u,c,d,p,m,g,h,b,E,y,T,N,I,D,F,B,U,P,H,V,X,W,z,G,q,ne,Re,te,re,Ae,Be,We,at,Te,R,nt,De,Ce,Fe,je,Ge,Pe,fe,ge,Q,he,_e,Me,rt,Qe,xe,ut]}class Y2 extends tt{constructor(e){super(),et(this,e,Z2,K2,$e,{selectedNode:0,filesHandleKeydown:38,loadFolder:1,resetToNode:39},null,[-1,-1,-1])}get filesHandleKeydown(){return this.$$.ctx[38]}get loadFolder(){return this.$$.ctx[1]}get resetToNode(){return this.$$.ctx[39]}}const{Boolean:Md}=Ts;function mc(n,e,t){const l=n.slice();return l[444]=e[t],l}function gc(n,e,t){const l=n.slice();return l[447]=e[t],l}function hc(n,e,t){const l=n.slice();return l[450]=e[t],l}function _c(n,e,t){const l=n.slice();return l[450]=e[t],l}function bc(n,e,t){const l=n.slice();return l[467]=e[t],l}function vc(n,e,t){const l=n.slice();return l[494]=e[t],l}function kc(n,e,t){const l=n.slice();return l[467]=e[t],l}function wc(n,e,t){const l=n.slice();return l[494]=e[t],l}function yc(n,e,t){const l=n.slice();return l[501]=e[t],l}function Ec(n,e,t){const l=n.slice();return l[501]=e[t],l}function Tc(n,e,t){const l=n.slice();return l[470]=e[t],l[490]=e,l[491]=t,l}function Sc(n,e,t){const l=n.slice();return l[467]=e[t],l}function Cc(n,e,t){const l=n.slice();return l[487]=e[t],l}function Ac(n,e,t){const l=n.slice();return l[455]=e[t],l}function Nc(n,e,t){const l=n.slice();return l[480]=e[t],l}function Rc(n,e,t){const l=n.slice();return l[455]=e[t],l}function Ic(n,e,t){const l=n.slice();return l[467]=e[t],l}function Mc(n,e,t){const l=n.slice();return l[464]=e[t],l}function Lc(n,e,t){const l=n.slice();return l[467]=e[t],l}function Dc(n,e,t){const l=n.slice();return l[470]=e[t],l[471]=e,l[472]=t,l}function Oc(n,e,t){const l=n.slice();return l[467]=e[t],l}function Pc(n,e,t){const l=n.slice();return l[461]=e[t],l}function zc(n,e,t){const l=n.slice();return l[458]=e[t],l}function Bc(n,e,t){const l=n.slice();return l[455]=e[t],l}function Fc(n,e,t){const l=n.slice();return l[477]=e[t],l}function jc(n,e,t){const l=n.slice();return l[508]=e[t],l}function X2(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y,T,N,A,R,M,I,D,F,B,U,P,H,V,X,W,z,O,G,q,Y,x,ne,le,ie,me,Ne,ze,Ye,Re,te,re,Ae,Be,be,We,at,Te;t=new R2({props:{show:captureDropActive,label:captureDropLabel}});let nt=ye(n[0]),De=[];for(let ee=0;ee0?0:1}M=je(n),I=Fe[M]=Ce[M](n),B=new Tb({props:{syncStatus:n[105],syncLoading:n[106],syncMessage:n[107],syncMessageKind:n[108],onSync:n[218],onOpenSettings:n[224]}}),G=new pv({props:{title:n[112],subtitle:n[111],wailsCall:de,typeLabel:n[188],onOpenSearchResult:n[213],$$slots:{actions:[nw]},$$scope:{ctx:n}}}),Y=new C2({props:{error:n[35],onDismiss:n[229]}});const Ge=[fw,uw,cw,aw,rw,ow,sw,iw,lw],Pe=[];function fe(ee,we){return we[0]&2&&(ne=null),ee[38]?0:ee[2]?1:ee[1]==="inbox"?2:ee[1]==="trash"?3:ee[1]==="journal"?4:ee[1]==="today"?5:ee[1]==="activity"?6:(ne==null&&(ne=!!(ee[1]&&ee[1].startsWith("plugin:"))),ne?7:8)}le=fe(n,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]),ie=Pe[le]=Ge[le](n);let ge=n[80]&&Yu(n),Q=n[84].visible&&Qu(n),he=n[51]&&tf(n),_e=n[87]&&nf(n),Me=n[97]&&sf(n),rt=n[100]&&rf(n),Qe=n[70]&&ff(n),xe=n[92]&&pf(n),ut=previewItem&&yy(n),$=n[14]&&mf(n);return{c(){e=f("div"),Ze(t.$$.fragment),l=w(),i=f("aside"),o=f("div"),s=f("img"),u=w(),d=f("span"),d.textContent=`${v("nav.brand")}`,p=w(),m=f("nav"),g=f("div"),h=f("div"),h.textContent=`${v("nav.system")}`,b=w();for(let ee=0;ee',V=w(),X=f("span"),W=j(n[34]),z=w(),O=f("main"),Ze(G.$$.fragment),q=w(),Ze(Y.$$.fragment),x=w(),ie.c(),me=w(),ge&&ge.c(),Ne=w(),Q&&Q.c(),ze=w(),he&&he.c(),Ye=w(),_e&&_e.c(),Re=w(),Me&&Me.c(),te=w(),rt&&rt.c(),re=w(),Qe&&Qe.c(),Ae=w(),xe&&xe.c(),Be=w(),ut&&ut.c(),be=w(),$&&$.c(),r(s,"class","logo svelte-5mstt"),El(s.src,c="/assets/app-icons/icon_32x32.png")||r(s,"src",c),r(s,"width","20"),r(s,"height","20"),r(s,"alt",""),r(d,"class","brand-name svelte-5mstt"),r(o,"class","sidebar-brand svelte-5mstt"),r(h,"class","nav-label svelte-5mstt"),r(g,"class","nav-group svelte-5mstt"),r(T,"class","svelte-5mstt"),r(A,"class","nav-add-btn svelte-5mstt"),r(A,"title",v("common.create")),r(y,"class","nav-label-row svelte-5mstt"),r(E,"class","nav-group svelte-5mstt"),r(m,"class","sidebar-nav svelte-5mstt"),r(H,"class","sidebar-settings-btn svelte-5mstt"),r(H,"title",v("common.settings")),r(X,"class","version svelte-5mstt"),r(P,"class","sidebar-footer-row svelte-5mstt"),r(F,"class","sidebar-footer svelte-5mstt"),r(i,"class","sidebar svelte-5mstt"),r(O,"class","main svelte-5mstt"),r(e,"class","app svelte-5mstt")},m(ee,we){C(ee,e,we),Ve(t,e,null),a(e,l),a(e,i),a(i,o),a(o,s),a(o,u),a(o,d),a(i,p),a(i,m),a(m,g),a(g,h),a(g,b);for(let Ke=0;Ke{Fe[Ke]=null}),vt(),I=Fe[M],I?I.p(ee,we):(I=Fe[M]=Ce[M](ee),I.c()),pe(I,1),I.m(E,null));const pt={};we[3]&4096&&(pt.syncStatus=ee[105]),we[3]&8192&&(pt.syncLoading=ee[106]),we[3]&16384&&(pt.syncMessage=ee[107]),we[3]&32768&&(pt.syncMessageKind=ee[108]),B.$set(pt),(!We||we[1]&8)&&J(W,ee[34]);const Mt={};we[3]&524288&&(Mt.title=ee[112]),we[3]&262144&&(Mt.subtitle=ee[111]),we[0]&2|we[2]&16480|we[16]&32768&&(Mt.$$scope={dirty:we,ctx:ee}),G.$set(Mt);const Lt={};we[1]&16&&(Lt.error=ee[35]),we[1]&16&&(Lt.onDismiss=ee[229]),Y.$set(Lt);let Nt=le;le=fe(ee,we),le===Nt?Pe[le].p(ee,we):(bt(),ve(Pe[Nt],1,1,()=>{Pe[Nt]=null}),vt(),ie=Pe[le],ie?ie.p(ee,we):(ie=Pe[le]=Ge[le](ee),ie.c()),pe(ie,1),ie.m(O,me)),ee[80]?ge?(ge.p(ee,we),we[2]&262144&&pe(ge,1)):(ge=Yu(ee),ge.c(),pe(ge,1),ge.m(O,Ne)):ge&&(bt(),ve(ge,1,1,()=>{ge=null}),vt()),ee[84].visible?Q?(Q.p(ee,we),we[2]&4194304&&pe(Q,1)):(Q=Qu(ee),Q.c(),pe(Q,1),Q.m(O,ze)):Q&&(bt(),ve(Q,1,1,()=>{Q=null}),vt()),ee[51]?he?he.p(ee,we):(he=tf(ee),he.c(),he.m(O,Ye)):he&&(he.d(1),he=null),ee[87]?_e?_e.p(ee,we):(_e=nf(ee),_e.c(),_e.m(O,Re)):_e&&(_e.d(1),_e=null),ee[97]?Me?Me.p(ee,we):(Me=sf(ee),Me.c(),Me.m(O,te)):Me&&(Me.d(1),Me=null),ee[100]?rt?rt.p(ee,we):(rt=rf(ee),rt.c(),rt.m(O,re)):rt&&(rt.d(1),rt=null),ee[70]?Qe?Qe.p(ee,we):(Qe=ff(ee),Qe.c(),Qe.m(O,Ae)):Qe&&(Qe.d(1),Qe=null),ee[92]?xe?(xe.p(ee,we),we[2]&1073741824&&pe(xe,1)):(xe=pf(ee),xe.c(),pe(xe,1),xe.m(O,Be)):xe&&(bt(),ve(xe,1,1,()=>{xe=null}),vt()),previewItem&&ut.p(ee,we),ee[14]?$?($.p(ee,we),we[0]&16384&&pe($,1)):($=mf(ee),$.c(),pe($,1),$.m(O,null)):$&&(bt(),ve($,1,1,()=>{$=null}),vt())},i(ee){We||(pe(t.$$.fragment,ee),pe(I),pe(B.$$.fragment,ee),pe(G.$$.fragment,ee),pe(Y.$$.fragment,ee),pe(ie),pe(ge),pe(Q),pe(xe),pe(ut),pe($),We=!0)},o(ee){ve(t.$$.fragment,ee),ve(I),ve(B.$$.fragment,ee),ve(G.$$.fragment,ee),ve(Y.$$.fragment,ee),ve(ie),ve(ge),ve(Q),ve(xe),ve(ut),ve($),We=!1},d(ee){ee&&S(e),qe(t),Je(De,ee),Fe[M].d(),qe(B),qe(G),qe(Y),Pe[le].d(),ge&&ge.d(),Q&&Q.d(),he&&he.d(),_e&&_e.d(),Me&&Me.d(),rt&&rt.d(),Qe&&Qe.d(),xe&&xe.d(),ut&&ut.d(),$&&$.d(),at=!1,Se(Te)}}}function J2(n){var l;let e,t;return e=new f_({props:{vaultPath:((l=n[11])==null?void 0:l.vaultPath)||"",onComplete:n[220]}}),{c(){Ze(e.$$.fragment)},m(i,o){Ve(e,i,o),t=!0},p(i,o){var c;const s={};o[0]&2048&&(s.vaultPath=((c=i[11])==null?void 0:c.vaultPath)||""),e.$set(s)},i(i){t||(pe(e.$$.fragment,i),t=!0)},o(i){ve(e.$$.fragment,i),t=!1},d(i){qe(e,i)}}}function Q2(n){let e,t;return e=new a_({props:{onComplete:n[219]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:oe,i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function Uc(n){let e,t;return{c(){e=f("span"),t=j(n[61]),r(e,"class","nav-badge svelte-5mstt")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[1]&1073741824&&J(t,l[61])},d(l){l&&S(e)}}}function Hc(n){let e,t;return{c(){e=f("span"),t=j(n[75]),r(e,"class","nav-badge svelte-5mstt")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[2]&8192&&J(t,l[75])},d(l){l&&S(e)}}}function Wc(n){let e,t=n[508].label+"",l,i,o,s,c,u,d,p=n[508].id==="journal"&&n[61]>0&&Uc(n),m=n[508].id==="trash"&&n[75]>0&&Hc(n);function g(){return n[223](n[508])}return{c(){e=f("button"),l=j(t),i=w(),p&&p.c(),o=w(),m&&m.c(),s=w(),r(e,"class",c="nav-item "+(n[1]===n[508].id?"selected":"")+" svelte-5mstt")},m(h,b){C(h,e,b),a(e,l),a(e,i),p&&p.m(e,null),a(e,o),m&&m.m(e,null),a(e,s),u||(d=L(e,"click",g),u=!0)},p(h,b){n=h,b[0]&1&&t!==(t=n[508].label+"")&&J(l,t),n[508].id==="journal"&&n[61]>0?p?p.p(n,b):(p=Uc(n),p.c(),p.m(e,o)):p&&(p.d(1),p=null),n[508].id==="trash"&&n[75]>0?m?m.p(n,b):(m=Hc(n),m.c(),m.m(e,s)):m&&(m.d(1),m=null),b[0]&3&&c!==(c="nav-item "+(n[1]===n[508].id?"selected":"")+" svelte-5mstt")&&r(e,"class",c)},d(h){h&&S(e),p&&p.d(),m&&m.d(),u=!1,d()}}}function x2(n){let e;return{c(){e=f("div"),e.textContent=`${v("nav.noNodes")}`,r(e,"class","nav-empty svelte-5mstt")},m(t,l){C(t,e,l)},p:oe,i:oe,o:oe,d(t){t&&S(e)}}}function $2(n){var s;let e,t,l,i,o;return t=new Ff({props:{nodes:n[15],expanded,selectedNodeId:((s=n[2])==null?void 0:s.id)||"",onSelect:n[117],onToggle:n[131],onContextMenu:n[129],onDrop:n[132]}}),{c(){e=f("div"),Ze(t.$$.fragment),r(e,"class","workspace-tree-area svelte-5mstt"),r(e,"role","region"),r(e,"aria-label",v("nav.workspace")),ce(e,"drop-valid",dropRootValid)},m(c,u){C(c,e,u),Ve(t,e,null),l=!0,i||(o=[L(e,"dragover",Li(Cy)),L(e,"dragleave",Ay),L(e,"drop",n[133])],i=!0)},p(c,u){var p;const d={};u[0]&32768&&(d.nodes=c[15]),u[0]&4&&(d.selectedNodeId=((p=c[2])==null?void 0:p.id)||""),t.$set(d)},i(c){l||(pe(t.$$.fragment,c),l=!0)},o(c){ve(t.$$.fragment,c),l=!1},d(c){c&&S(e),qe(t),i=!1,Se(o)}}}function ew(n){let e,t,l,i=kt("emptyTrash",14)+"",o,s=v("trash.emptyTrash")+"",c,u,d,p,m,g=n[76].length>0&&Gc(n);return{c(){g&&g.c(),e=w(),t=f("button"),l=new Ei(!1),o=w(),c=j(s),u=w(),d=f("button"),d.textContent=`${v("trash.openFolder")}`,l.a=o,r(t,"class","btn btn-sm btn-danger svelte-5mstt"),r(d,"class","btn btn-sm svelte-5mstt")},m(h,b){g&&g.m(h,b),C(h,e,b),C(h,t,b),l.m(i,t),a(t,o),a(t,c),C(h,u,b),C(h,d,b),p||(m=[L(t,"click",n[169]),L(d,"click",n[228])],p=!0)},p(h,b){h[76].length>0?g?g.p(h,b):(g=Gc(h),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null)},d(h){h&&(S(e),S(t),S(u),S(d)),g&&g.d(h),p=!1,Se(m)}}}function tw(n){let e,t=(n[67]?v("common.loading"):v("inbox.pasteClipboard"))+"",l,i,o,s,c,u=n[68]&&Kc(n);return{c(){e=f("button"),l=j(t),i=w(),u&&u.c(),o=mt(),r(e,"class","btn btn-primary svelte-5mstt"),e.disabled=n[67]},m(d,p){C(d,e,p),a(e,l),C(d,i,p),u&&u.m(d,p),C(d,o,p),s||(c=L(e,"click",n[190]),s=!0)},p(d,p){p[2]&32&&t!==(t=(d[67]?v("common.loading"):v("inbox.pasteClipboard"))+"")&&J(l,t),p[2]&32&&(e.disabled=d[67]),d[68]?u?u.p(d,p):(u=Kc(d),u.c(),u.m(o.parentNode,o)):u&&(u.d(1),u=null)},d(d){d&&(S(e),S(i),S(o)),u&&u.d(d),s=!1,c()}}}function Gc(n){let e,t,l=kt("restore",14)+"",i,o=v("trash.restore")+"",s,c,u=n[76].length+"",d,p,m,g,h,b=kt("purge",14)+"",k,E=v("common.delete")+"",y,T,N=n[76].length+"",A,R,M,I;return{c(){e=f("button"),t=new Ei(!1),i=w(),s=j(o),c=j(" ("),d=j(u),p=j(")"),m=w(),g=f("button"),h=new Ei(!1),k=w(),y=j(E),T=j(" ("),A=j(N),R=j(")"),t.a=i,r(e,"class","btn btn-sm btn-primary svelte-5mstt"),h.a=k,r(g,"class","btn btn-sm btn-danger svelte-5mstt")},m(D,F){C(D,e,F),t.m(l,e),a(e,i),a(e,s),a(e,c),a(e,d),a(e,p),C(D,m,F),C(D,g,F),h.m(b,g),a(g,k),a(g,y),a(g,T),a(g,A),a(g,R),M||(I=[L(e,"click",n[226]),L(g,"click",n[227])],M=!0)},p(D,F){F[2]&16384&&u!==(u=D[76].length+"")&&J(d,u),F[2]&16384&&N!==(N=D[76].length+"")&&J(A,N)},d(D){D&&(S(e),S(m),S(g)),M=!1,Se(I)}}}function Kc(n){let e,t;return{c(){e=f("span"),t=j(n[68]),r(e,"class","inbox-capture-status svelte-5mstt")},m(l,i){C(l,e,i),a(e,t)},p(l,i){i[2]&64&&J(t,l[68])},d(l){l&&S(e)}}}function nw(n){let e;function t(o,s){if(o[1]==="inbox")return tw;if(o[1]==="trash")return ew}let l=t(n),i=l&&l(n);return{c(){e=f("div"),i&&i.c(),r(e,"slot","actions"),r(e,"class","header-actions svelte-5mstt")},m(o,s){C(o,e,s),i&&i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i&&i.d(1),i=l&&l(o),i&&(i.c(),i.m(e,null)))},d(o){o&&S(e),i&&i.d()}}}function lw(n){let e,t,l;function i(c,u){if(c[91])return mw;if(c[0].length>0)return pw;if(c[35])return dw}let o=i(n),s=o&&o(n);return{c(){e=f("div"),t=f("h2"),t.textContent=`${v("welcome.title")}`,l=w(),s&&s.c(),r(t,"class","svelte-5mstt"),r(e,"class","welcome svelte-5mstt")},m(c,u){C(c,e,u),a(e,t),a(e,l),s&&s.m(e,null)},p(c,u){o===(o=i(c))&&s?s.p(c,u):(s&&s.d(1),s=o&&o(c),s&&(s.c(),s.m(e,null)))},i:oe,o:oe,d(c){c&&S(e),s&&s.d()}}}function iw(n){let e,t;return e=new $b({props:{sectionId:n[1]}}),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const o={};i[0]&2&&(o.sectionId=l[1]),e.$set(o)},i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function sw(n){let e;function t(o,s){return o[18].length===0?hw:gw}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","activity-feed svelte-5mstt")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:oe,o:oe,d(o){o&&S(e),i.d()}}}function ow(n){let e,t,l,i;const o=[bw,_w],s=[];function c(u,d){return u[17]?0:1}return e=c(n),t=s[e]=o[e](n),{c(){t.c(),l=mt()},m(u,d){s[e].m(u,d),C(u,l,d),i=!0},p(u,d){let p=e;e=c(u),e===p?s[e].p(u,d):(bt(),ve(s[p],1,1,()=>{s[p]=null}),vt(),t=s[e],t?t.p(u,d):(t=s[e]=o[e](u),t.c()),pe(t,1),t.m(l.parentNode,l))},i(u){i||(pe(t),i=!0)},o(u){ve(t),i=!1},d(u){u&&S(l),s[e].d(u)}}}function rw(n){let e,t,l,i=v("suggest.title")+"",o,s,c,u,d,p,m,g=n[61]>0&&Zc(n);function h(E,y){return E[29]==="suggestions"?kw:vw}let b=h(n),k=b(n);return{c(){e=f("div"),t=f("div"),l=f("button"),o=j(i),s=w(),g&&g.c(),c=w(),u=f("button"),u.textContent=`${v("journal.worklogTab")}`,d=w(),k.c(),r(l,"class","journal-tab svelte-5mstt"),ce(l,"active",n[29]==="suggestions"),r(u,"class","journal-tab svelte-5mstt"),ce(u,"active",n[29]==="worklog"),r(t,"class","journal-tabs svelte-5mstt"),r(e,"class","journal-screen svelte-5mstt")},m(E,y){C(E,e,y),a(e,t),a(t,l),a(l,o),a(l,s),g&&g.m(l,null),a(t,c),a(t,u),a(e,d),k.m(e,null),p||(m=[L(l,"click",n[304]),L(u,"click",n[305])],p=!0)},p(E,y){E[61]>0?g?g.p(E,y):(g=Zc(E),g.c(),g.m(l,null)):g&&(g.d(1),g=null),y[0]&536870912&&ce(l,"active",E[29]==="suggestions"),y[0]&536870912&&ce(u,"active",E[29]==="worklog"),b===(b=h(E))&&k?k.p(E,y):(k.d(1),k=b(E),k&&(k.c(),k.m(e,null)))},i:oe,o:oe,d(E){E&&S(e),g&&g.d(),k.d(),p=!1,Se(m)}}}function aw(n){let e,t,l,i,o,s;function c(p,m){return!p[7]||(p[7].nodes||[]).length===0?Ow:Dw}let u=c(n),d=u(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("p"),o=j(n[78]),s=w(),d.c(),r(i,"class","svelte-5mstt"),r(l,"class","svelte-5mstt"),r(t,"class","trash-header svelte-5mstt"),r(e,"class","trash-screen svelte-5mstt")},m(p,m){C(p,e,m),a(e,t),a(t,l),a(l,i),a(i,o),a(e,s),d.m(e,null)},p(p,m){m[2]&65536&&J(o,p[78]),u===(u=c(p))&&d?d.p(p,m):(d.d(1),d=u(p),d&&(d.c(),d.m(e,null)))},i:oe,o:oe,d(p){p&&S(e),d.d()}}}function cw(n){let e,t,l,i,o,s,c,u,d=n[3].length>0&&bu(n);function p(h,b){return h[3].length===0?jw:h[110]?Fw:Bw}let m=p(n),g=m(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("p"),i.textContent=`${v("inbox.subtitle")}`,o=w(),d&&d.c(),s=w(),g.c(),r(i,"class","svelte-5mstt"),r(l,"class","svelte-5mstt"),r(t,"class","inbox-header svelte-5mstt"),r(e,"class","inbox-screen svelte-5mstt"),r(e,"role","region"),r(e,"aria-label",v("nav.inbox")),ce(e,"drop-valid",inboxDropValid)},m(h,b){C(h,e,b),a(e,t),a(t,l),a(l,i),a(e,o),d&&d.m(e,null),a(e,s),g.m(e,null),c||(u=[L(e,"dragover",Oy),L(e,"dragleave",Py),L(e,"drop",n[191])],c=!0)},p(h,b){h[3].length>0?d?d.p(h,b):(d=bu(h),d.c(),d.m(e,s)):d&&(d.d(1),d=null),m===(m=p(h))&&g?g.p(h,b):(g.d(1),g=m(h),g&&(g.c(),g.m(e,null)))},i:oe,o:oe,d(h){h&&S(e),d&&d.d(),g.d(),c=!1,Se(u)}}}function uw(n){let e,t,l,i,o,s,c=ye(n[114]),u=[];for(let g=0;g{p[b]=null}),vt()),~i?(o=p[i],o?o.p(g,h):(o=p[i]=d[i](g),o.c()),pe(o,1),o.m(l,null)):o=null)},i(g){s||(pe(o),s=!0)},o(g){ve(o),s=!1},d(g){g&&(S(e),S(t),S(l)),Je(u,g),~i&&p[i].d()}}}function fw(n){let e,t,l,i,o,s,c,u,d,p,m,g;function h(y,T){return y[47]===y[38].id?wy:ky}let b=h(n),k=b(n),E={content:n[38].content,viewMode:n[40],placeholder:v("note.placeholder")};return d=new m2({props:E}),n[233](d),d.$on("content-change",n[154]),d.$on("mode-change",n[155]),d.$on("save",n[146]),d.$on("insert-link",n[156]),d.$on("insert-internal-link",n[157]),d.$on("verstak-link",n[153]),{c(){e=f("div"),t=f("div"),k.c(),l=w(),i=f("div"),o=f("button"),o.textContent=`${v("common.save")}`,s=w(),c=f("button"),c.textContent=`${v("common.close")}`,u=w(),Ze(d.$$.fragment),r(o,"class","btn btn-primary svelte-5mstt"),r(c,"class","btn svelte-5mstt"),r(i,"class","note-editor-actions svelte-5mstt"),r(t,"class","note-editor-header svelte-5mstt"),r(e,"class","note-editor-wrapper svelte-5mstt")},m(y,T){C(y,e,T),a(e,t),k.m(t,null),a(t,l),a(t,i),a(i,o),a(i,s),a(i,c),a(e,u),Ve(d,e,null),p=!0,m||(g=[L(o,"click",n[146]),L(c,"click",n[145])],m=!0)},p(y,T){b===(b=h(y))&&k?k.p(y,T):(k.d(1),k=b(y),k&&(k.c(),k.m(t,l)));const N={};T[1]&128&&(N.content=y[38].content),T[1]&512&&(N.viewMode=y[40]),d.$set(N)},i(y){p||(pe(d.$$.fragment,y),p=!0)},o(y){ve(d.$$.fragment,y),p=!1},d(y){y&&S(e),k.d(),n[233](null),qe(d),m=!1,Se(g)}}}function dw(n){let e,t=v("common.error")+"",l,i,o;return{c(){e=f("p"),l=j(t),i=w(),o=j(n[35]),r(e,"class","error-text svelte-5mstt")},m(s,c){C(s,e,c),a(e,l),a(e,i),a(e,o)},p(s,c){c[1]&16&&J(o,s[35])},d(s){s&&S(e)}}}function pw(n){let e,t,l;return{c(){e=f("p"),e.textContent=`${v("welcome.selectSection")}`,t=w(),l=f("p"),l.textContent=`${v("welcome.createCase")}`,r(e,"class","svelte-5mstt"),r(l,"class","hint svelte-5mstt")},m(i,o){C(i,e,o),C(i,t,o),C(i,l,o)},p:oe,d(i){i&&(S(e),S(t),S(l))}}}function mw(n){let e;return{c(){e=f("p"),e.textContent=`${v("common.loading")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},p:oe,d(t){t&&S(e)}}}function gw(n){let e,t=ye(n[18]),l=[];for(let i=0;in[325].call(Y)),r(O,"title",v("journal.billableHint")),r(O,"class","svelte-5mstt"),r(Ne,"class","label-text svelte-5mstt"),Re.__value="all",Le(Re,Re.__value),r(Re,"class","svelte-5mstt"),te.__value="no",Le(te,te.__value),r(te,"class","svelte-5mstt"),re.__value="yes",Le(re,re.__value),r(re,"class","svelte-5mstt"),r(Ye,"class","svelte-5mstt"),n[26]===void 0&&il(()=>n[326].call(Ye)),r(me,"title",v("journal.approxHint")),r(me,"class","svelte-5mstt"),r(Be,"class","btn btn-sm svelte-5mstt"),r(We,"class","btn btn-sm svelte-5mstt"),r(y,"class","journal-filters-row svelte-5mstt"),r(b,"class","journal-filter-section svelte-5mstt"),r(t,"class","journal-header svelte-5mstt")},m(_e,Me){Ce&&Ce.m(_e,Me),C(_e,e,Me),C(_e,t,Me),a(t,l),a(l,i),a(l,o),a(l,s),a(s,c),a(s,u),a(s,d),a(s,p),a(s,m),a(s,g),Fe&&Fe.m(s,null),a(t,h),a(t,b),a(b,k),a(b,E),a(b,y),a(y,T),a(T,N),a(T,A),a(T,R),Le(R,n[21]),a(y,M),a(y,I),a(I,D),a(I,F),a(I,B),Le(B,n[22]),a(y,U),a(y,P),a(P,H),a(P,V),a(P,X),Pe.m(X,null),a(y,W),fe&&fe.m(y,null),a(y,z),a(y,O),a(O,G),a(O,q),a(O,Y),a(Y,x),a(Y,ne),a(Y,le),jn(Y,n[25],!0),a(y,ie),a(y,me),a(me,Ne),a(me,ze),a(me,Ye),a(Ye,Re),a(Ye,te),a(Ye,re),jn(Ye,n[26],!0),a(y,Ae),a(y,Be),a(y,be),a(y,We),C(_e,at,Me),he.m(_e,Me),C(_e,Te,Me),nt||(De=[L(c,"click",n[315]),L(d,"click",n[316]),L(m,"click",n[317]),L(R,"input",n[318]),L(B,"input",n[319]),L(Y,"change",n[325]),L(Ye,"change",n[326]),L(Be,"click",n[178]),L(We,"click",n[185])],nt=!0)},p(_e,Me){_e[20]?Ce?Ce.p(_e,Me):(Ce=Yc(_e),Ce.c(),Ce.m(e.parentNode,e)):Ce&&(Ce.d(1),Ce=null),_e[28]?Fe?Fe.p(_e,Me):(Fe=$c(_e),Fe.c(),Fe.m(s,null)):Fe&&(Fe.d(1),Fe=null),Me[0]&2097152&&Le(R,_e[21]),Me[0]&4194304&&Le(B,_e[22]),Ge===(Ge=je(_e))&&Pe?Pe.p(_e,Me):(Pe.d(1),Pe=Ge(_e),Pe&&(Pe.c(),Pe.m(X,null))),_e[24]?fe?fe.p(_e,Me):(fe=nu(_e),fe.c(),fe.m(y,z)):fe&&(fe.d(1),fe=null),Me[0]&33554432&&jn(Y,_e[25]),Me[0]&67108864&&jn(Ye,_e[26]),Q===(Q=ge(_e))&&he?he.p(_e,Me):(he.d(1),he=Q(_e),he&&(he.c(),he.m(Te.parentNode,Te)))},d(_e){_e&&(S(e),S(t),S(at),S(Te)),Ce&&Ce.d(_e),Fe&&Fe.d(),Pe.d(),fe&&fe.d(),he.d(_e),nt=!1,Se(De)}}}function kw(n){let e;function t(o,s){return o[60].length===0?Lw:Mw}let l=t(n),i=l(n);return{c(){i.c(),e=mt()},m(o,s){i.m(o,s),C(o,e,s)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){o&&S(e),i.d(o)}}}function Yc(n){let e,t,l=v("journal.total")+"",i,o,s=Math.floor(n[20].totalMinutes/60)+"",c,u,d=n[20].totalMinutes%60+"",p,m,g=n[20].totalEntries+"",h,b,k=v("worklog.min")+"",E,y,T,N,A=n[20].byDay&&n[20].byDay.length>0&&Xc(n),R=n[20].byNode&&n[20].byNode.length>0&&Qc(n);return{c(){e=f("div"),t=f("div"),i=j(l),o=j(": "),c=j(s),u=j("ч "),p=j(d),m=j("м ("),h=j(g),b=w(),E=j(k),y=j(")"),T=w(),A&&A.c(),N=w(),R&&R.c(),r(t,"class","summary-total svelte-5mstt"),r(e,"class","journal-summary svelte-5mstt")},m(M,I){C(M,e,I),a(e,t),a(t,i),a(t,o),a(t,c),a(t,u),a(t,p),a(t,m),a(t,h),a(t,b),a(t,E),a(t,y),a(e,T),A&&A.m(e,null),a(e,N),R&&R.m(e,null)},p(M,I){I[0]&1048576&&s!==(s=Math.floor(M[20].totalMinutes/60)+"")&&J(c,s),I[0]&1048576&&d!==(d=M[20].totalMinutes%60+"")&&J(p,d),I[0]&1048576&&g!==(g=M[20].totalEntries+"")&&J(h,g),M[20].byDay&&M[20].byDay.length>0?A?A.p(M,I):(A=Xc(M),A.c(),A.m(e,N)):A&&(A.d(1),A=null),M[20].byNode&&M[20].byNode.length>0?R?R.p(M,I):(R=Qc(M),R.c(),R.m(e,null)):R&&(R.d(1),R=null)},d(M){M&&S(e),A&&A.d(),R&&R.d()}}}function Xc(n){let e,t,l,i=ye(n[20].byDay),o=[];for(let s=0;s0?Rw:D[494].source==="suggestion"?Nw:D[494].source==="unknown"||D[494].source==="imported"?Aw:D[494]._hasEvents?Cw:Sw}let R=A(n),M=R(n),I=n[494]._events&&ru(n);return{c(){e=f("tr"),t=f("td"),l=f("div"),i=f("div"),o=f("button"),o.textContent=`${v("worklog.editEntry")}`,s=w(),c=f("button"),c.textContent=`${v("worklog.deleteEntry")}`,u=w(),N&&N.c(),d=w(),p=f("div"),m=f("span"),m.textContent=`${v("worklog.source")}`,g=w(),M.c(),h=w(),I&&I.c(),b=w(),r(o,"class","btn btn-sm svelte-5mstt"),r(c,"class","btn btn-sm btn-danger svelte-5mstt"),r(i,"class","journal-detail-actions svelte-5mstt"),r(m,"class","journal-detail-label svelte-5mstt"),r(p,"class","journal-detail-section svelte-5mstt"),r(l,"class","journal-detail-body svelte-5mstt"),r(t,"colspan","8"),r(t,"class","svelte-5mstt"),r(e,"class","journal-row-detail svelte-5mstt")},m(D,F){C(D,e,F),a(e,t),a(t,l),a(l,i),a(i,o),a(i,s),a(i,c),a(l,u),N&&N.m(l,null),a(l,d),a(l,p),a(p,m),a(p,g),M.m(p,null),a(l,h),I&&I.m(l,null),a(e,b),k||(E=[L(o,"click",He(y)),L(c,"click",He(T))],k=!0)},p(D,F){n=D,n[494].details?N?N.p(n,F):(N=ou(n),N.c(),N.m(l,d)):N&&(N.d(1),N=null),R!==(R=A(n))&&(M.d(1),M=R(n),M&&(M.c(),M.m(p,null))),n[494]._events?I?I.p(n,F):(I=ru(n),I.c(),I.m(l,null)):I&&(I.d(1),I=null)},d(D){D&&S(e),N&&N.d(),M.d(),I&&I.d(),k=!1,Se(E)}}}function ou(n){let e,t,l,i,o=n[494].details+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${v("worklog.details")}`,l=w(),i=f("p"),s=j(o),r(t,"class","journal-detail-label svelte-5mstt"),r(i,"class","svelte-5mstt"),r(e,"class","journal-detail-section svelte-5mstt")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[0]&524288&&o!==(o=c[494].details+"")&&J(s,o)},d(c){c&&S(e)}}}function Sw(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceUnknown")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Cw(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceSuggestion")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Aw(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceUnknown")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Nw(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceSuggestionNoEvents")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Rw(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceSuggestion")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Iw(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceManual")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function ru(n){let e,t,l,i=ye(n[494]._events),o=[];for(let s=0;s0&&uu(n);function le(...te){return n[307](n[470],n[490],n[491],...te)}function ie(){return n[308](n[470])}function me(){return n[309](n[470])}function Ne(){return n[310](n[470])}function ze(){return n[311](n[470],n[490],n[491])}function Ye(...te){return n[312](n[470],n[490],n[491],...te)}let Re=n[470]._expanded&&n[470].events&&n[470].events.length>0&&fu(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("button"),s=j(o),c=w(),u=f("span"),p=j(d),m=w(),g=f("span"),b=j(h),k=w(),y=j(E),ne&&ne.c(),T=w(),N=f("div"),A=f("span"),I=w(),D=f("input"),B=w(),U=f("span"),U.textContent=`${v("suggest.minutes")}`,P=w(),H=f("button"),H.textContent=`${v("suggest.edit")}`,V=w(),X=f("button"),X.textContent=`${v("suggest.apply")}`,W=w(),z=f("button"),z.textContent=`${v("common.delete")}`,O=w(),Re&&Re.c(),G=w(),r(i,"class","suggestion-node link-btn svelte-5mstt"),r(u,"class","suggestion-summary svelte-5mstt"),r(g,"class","suggestion-meta svelte-5mstt"),r(l,"class","suggestion-info svelte-5mstt"),r(A,"class","suggestion-confidence-dot svelte-5mstt"),r(A,"title",R=v("suggest.confidence."+n[470].confidence)),r(A,"aria-label",M=v("suggest.confidence."+n[470].confidence)),ce(A,"low",n[470].confidence==="low"),ce(A,"medium",n[470].confidence==="medium"),ce(A,"high",n[470].confidence==="high"),r(D,"type","number"),r(D,"class","suggestion-min-input svelte-5mstt"),D.value=F=n[470].suggestedMin,r(D,"min","1"),r(D,"max","480"),r(U,"class","suggestion-min-label svelte-5mstt"),r(H,"class","btn btn-sm svelte-5mstt"),r(X,"class","btn btn-sm btn-primary svelte-5mstt"),r(z,"class","btn btn-sm btn-danger svelte-5mstt"),r(N,"class","suggestion-actions svelte-5mstt"),r(t,"class","suggestion-main svelte-5mstt"),r(t,"role","button"),r(t,"tabindex","0"),r(e,"class","suggestion-card svelte-5mstt"),ce(e,"expanded",n[470]._expanded)},m(te,re){C(te,e,re),a(e,t),a(t,l),a(l,i),a(i,s),a(l,c),a(l,u),a(u,p),a(l,m),a(l,g),a(g,b),a(g,k),a(g,y),ne&&ne.m(g,null),a(t,T),a(t,N),a(N,A),a(N,I),a(N,D),a(N,B),a(N,U),a(N,P),a(N,H),a(N,V),a(N,X),a(N,W),a(N,z),a(e,O),Re&&Re.m(e,null),a(e,G),q||(Y=[L(i,"click",He(x)),L(D,"change",He(le)),L(H,"click",He(ie)),L(X,"click",He(me)),L(z,"click",He(Ne)),L(t,"click",ze),L(t,"keydown",Ye)],q=!0)},p(te,re){n=te,re[1]&536870912&&o!==(o=n[470].nodeTitle+"")&&J(s,o),re[1]&536870912&&d!==(d=n[470].summary+"")&&J(p,d),re[1]&536870912&&h!==(h=n[470].suggestedMin+"")&&J(b,h),n[470].events&&n[470].events.length>0?ne?ne.p(n,re):(ne=uu(n),ne.c(),ne.m(g,null)):ne&&(ne.d(1),ne=null),re[1]&536870912&&R!==(R=v("suggest.confidence."+n[470].confidence))&&r(A,"title",R),re[1]&536870912&&M!==(M=v("suggest.confidence."+n[470].confidence))&&r(A,"aria-label",M),re[1]&536870912&&ce(A,"low",n[470].confidence==="low"),re[1]&536870912&&ce(A,"medium",n[470].confidence==="medium"),re[1]&536870912&&ce(A,"high",n[470].confidence==="high"),re[1]&536870912&&F!==(F=n[470].suggestedMin)&&D.value!==F&&(D.value=F),n[470]._expanded&&n[470].events&&n[470].events.length>0?Re?Re.p(n,re):(Re=fu(n),Re.c(),Re.m(e,G)):Re&&(Re.d(1),Re=null),re[1]&536870912&&ce(e,"expanded",n[470]._expanded)},d(te){te&&S(e),ne&&ne.d(),Re&&Re.d(),q=!1,Se(Y)}}}function Dw(n){let e,t,l,i,o,s,c,u,d,p,m,g=n[8]&&hu(n);function h(E,y){return E[77].length===0?zw:Pw}let b=h(n),k=b(n);return{c(){e=f("div"),t=f("section"),l=f("div"),g&&g.c(),i=w(),o=f("div"),s=f("h3"),c=j(n[79]),u=w(),d=f("p"),p=j(n[78]),m=w(),k.c(),r(s,"class","svelte-5mstt"),r(d,"class","svelte-5mstt"),r(o,"class","svelte-5mstt"),r(l,"class","trash-section-head svelte-5mstt"),r(t,"class","trash-section svelte-5mstt"),r(e,"class","trash-browser svelte-5mstt")},m(E,y){C(E,e,y),a(e,t),a(t,l),g&&g.m(l,null),a(l,i),a(l,o),a(o,s),a(s,c),a(o,u),a(o,d),a(d,p),a(t,m),k.m(t,null)},p(E,y){E[8]?g?g.p(E,y):(g=hu(E),g.c(),g.m(l,i)):g&&(g.d(1),g=null),y[2]&131072&&J(c,E[79]),y[2]&65536&&J(p,E[78]),b===(b=h(E))&&k?k.p(E,y):(k.d(1),k=b(E),k&&(k.c(),k.m(t,null)))},d(E){E&&S(e),g&&g.d(),k.d()}}}function Ow(n){let e,t;return{c(){e=f("div"),t=f("p"),t.textContent=`${v("trash.empty")}`,r(t,"class","svelte-5mstt"),r(e,"class","empty-state svelte-5mstt")},m(l,i){C(l,e,i),a(e,t)},p:oe,d(l){l&&S(e)}}}function hu(n){let e,t=kt("back")+"",l,i;return{c(){e=f("button"),r(e,"class","inbox-icon-btn svelte-5mstt"),r(e,"title",v("common.backLabel")),r(e,"aria-label",v("common.backLabel"))},m(o,s){C(o,e,s),e.innerHTML=t,l||(i=L(e,"click",n[164]),l=!0)},p:oe,d(o){o&&S(e),l=!1,i()}}}function Pw(n){let e,t=ye(n[77]),l=[];for(let i=0;i0,s,c,u,d=o&&Cu(n);function p(h,b){return h[50].length===0?oy:sy}let m=p(n),g=m(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent=`+ ${v("worklog.addEntry")}`,i=w(),d&&d.c(),s=w(),g.c(),r(l,"class","btn btn-primary btn-sm svelte-5mstt"),r(t,"class","worklog-toolbar svelte-5mstt"),r(e,"class","worklog-tab svelte-5mstt")},m(h,b){C(h,e,b),a(e,t),a(t,l),a(e,i),d&&d.m(e,null),a(e,s),g.m(e,null),c||(u=L(l,"click",n[262]),c=!0)},p(h,b){b[0]&4|b[1]&536870912&&(o=h[2]&&h[60].filter(h[222]).length>0),o?d?d.p(h,b):(d=Cu(h),d.c(),d.m(e,s)):d&&(d.d(1),d=null),m===(m=p(h))&&g?g.p(h,b):(g.d(1),g=m(h),g&&(g.c(),g.m(e,null)))},i:oe,o:oe,d(h){h&&S(e),d&&d.d(),g.d(),c=!1,u()}}}function Qw(n){let e,t,l,i,o,s;function c(p,m){return p[49].length===0?py:dy}let u=c(n),d=u(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent=`${v("action.addAction")}`,i=w(),d.c(),r(l,"class","btn btn-primary svelte-5mstt"),r(t,"class","tab-toolbar svelte-5mstt"),r(e,"class","actions-tab svelte-5mstt")},m(p,m){C(p,e,m),a(e,t),a(t,l),a(e,i),d.m(e,null),o||(s=L(l,"click",n[205]),o=!0)},p(p,m){u===(u=c(p))&&d?d.p(p,m):(d.d(1),d=u(p),d&&(d.c(),d.m(e,null)))},i:oe,o:oe,d(p){p&&S(e),d.d(),o=!1,s()}}}function xw(n){let e,t;function l(c,u){return c[69].length===0?gy:my}let i=l(n),o=i(n),s=n[74]&&Vu(n);return{c(){e=f("div"),o.c(),t=w(),s&&s.c(),r(e,"class","links-tab svelte-5mstt")},m(c,u){C(c,e,u),o.m(e,null),a(e,t),s&&s.m(e,null)},p(c,u){i===(i=l(c))&&o?o.p(c,u):(o.d(1),o=i(c),o&&(o.c(),o.m(e,t))),c[74]?s?s.p(c,u):(s=Vu(c),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},i:oe,o:oe,d(c){c&&S(e),o.d(),s&&s.d()}}}function $w(n){let e;function t(o,s){return o[66].length===0?_y:hy}let l=t(n),i=l(n);return{c(){e=f("div"),i.c(),r(e,"class","inbox-tab svelte-5mstt")},m(o,s){C(o,e,s),i.m(e,null)},p(o,s){l===(l=t(o))&&i?i.p(o,s):(i.d(1),i=l(o),i&&(i.c(),i.m(e,null)))},i:oe,o:oe,d(o){o&&S(e),i.d()}}}function ey(n){let e,t,l={selectedNode:n[2]};return e=new Y2({props:l}),n[243](e),e.$on("openNote",n[244]),e.$on("refreshParent",n[245]),e.$on("error",n[246]),e.$on("rename",n[247]),e.$on("confirm",n[248]),{c(){Ze(e.$$.fragment)},m(i,o){Ve(e,i,o),t=!0},p(i,o){const s={};o[0]&4&&(s.selectedNode=i[2]),e.$set(s)},i(i){t||(pe(e.$$.fragment,i),t=!0)},o(i){ve(e.$$.fragment,i),t=!1},d(i){n[243](null),qe(e,i)}}}function ty(n){let e,t;return e=new B2({props:{notes:n[37],showCreateNote:n[85],formatDate:Rn}}),e.$on("createNote",n[140]),e.$on("submitCreateNote",n[239]),e.$on("cancelCreateNote",n[141]),e.$on("openNote",n[240]),e.$on("startRename",n[241]),e.$on("delete",n[242]),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const o={};i[1]&64&&(o.notes=l[37]),i[2]&8388608&&(o.showCreateNote=l[85]),e.$set(o)},i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function ny(n){let e,t;return e=new L2({props:{node:n[2],notes:n[37],worklog:n[50],nodeKindLabel:n[187],formatDate:Rn}}),e.$on("goTab",n[235]),e.$on("openNote",n[236]),e.$on("createNote",n[237]),e.$on("addFile",n[238]),e.$on("createAction",n[205]),{c(){Ze(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const o={};i[0]&4&&(o.node=l[2]),i[1]&64&&(o.notes=l[37]),i[1]&524288&&(o.worklog=l[50]),e.$set(o)},i(l){t||(pe(e.$$.fragment,l),t=!0)},o(l){ve(e.$$.fragment,l),t=!1},d(l){qe(e,l)}}}function ly(n){let e,t=ye(n[33]),l=[];for(let i=0;i0&&Au(n);function V(){return n[264](n[470])}function X(){return n[265](n[470])}function W(){return n[266](n[470])}function z(){return n[267](n[470],n[471],n[472])}function O(...q){return n[268](n[470],n[471],n[472],...q)}let G=n[470]._expanded&&n[470].events&&n[470].events.length>0&&Nu(n);return{c(){e=f("div"),t=f("div"),l=f("div"),i=f("span"),s=j(o),c=w(),u=f("span"),p=j(d),m=w(),h=j(g),H&&H.c(),b=w(),k=f("div"),E=f("span"),N=w(),A=f("button"),A.textContent=`${v("suggest.edit")}`,R=w(),M=f("button"),M.textContent=`${v("worklog.apply")}`,I=w(),D=f("button"),D.textContent=`${v("common.delete")}`,F=w(),G&&G.c(),B=w(),r(i,"class","suggestion-summary svelte-5mstt"),r(u,"class","suggestion-meta svelte-5mstt"),r(l,"class","suggestion-info svelte-5mstt"),r(E,"class","suggestion-confidence-dot svelte-5mstt"),r(E,"title",y=v("suggest.confidence."+n[470].confidence)),r(E,"aria-label",T=v("suggest.confidence."+n[470].confidence)),ce(E,"low",n[470].confidence==="low"),ce(E,"medium",n[470].confidence==="medium"),ce(E,"high",n[470].confidence==="high"),r(A,"class","btn btn-sm svelte-5mstt"),r(M,"class","btn btn-sm btn-primary svelte-5mstt"),r(D,"class","btn btn-sm btn-danger svelte-5mstt"),r(k,"class","suggestion-actions svelte-5mstt"),r(t,"class","suggestion-main svelte-5mstt"),r(t,"role","button"),r(t,"tabindex","0"),r(e,"class","suggestion-card svelte-5mstt"),ce(e,"expanded",n[470]._expanded)},m(q,Y){C(q,e,Y),a(e,t),a(t,l),a(l,i),a(i,s),a(l,c),a(l,u),a(u,p),a(u,m),a(u,h),H&&H.m(u,null),a(t,b),a(t,k),a(k,E),a(k,N),a(k,A),a(k,R),a(k,M),a(k,I),a(k,D),a(e,F),G&&G.m(e,null),a(e,B),U||(P=[L(A,"click",He(V)),L(M,"click",He(X)),L(D,"click",He(W)),L(t,"click",z),L(t,"keydown",O)],U=!0)},p(q,Y){n=q,Y[0]&4|Y[1]&536870912&&o!==(o=n[470].summary+"")&&J(s,o),Y[0]&4|Y[1]&536870912&&d!==(d=n[470].suggestedMin+"")&&J(p,d),n[470].events&&n[470].events.length>0?H?H.p(n,Y):(H=Au(n),H.c(),H.m(u,null)):H&&(H.d(1),H=null),Y[0]&4|Y[1]&536870912&&y!==(y=v("suggest.confidence."+n[470].confidence))&&r(E,"title",y),Y[0]&4|Y[1]&536870912&&T!==(T=v("suggest.confidence."+n[470].confidence))&&r(E,"aria-label",T),Y[0]&4|Y[1]&536870912&&ce(E,"low",n[470].confidence==="low"),Y[0]&4|Y[1]&536870912&&ce(E,"medium",n[470].confidence==="medium"),Y[0]&4|Y[1]&536870912&&ce(E,"high",n[470].confidence==="high"),n[470]._expanded&&n[470].events&&n[470].events.length>0?G?G.p(n,Y):(G=Nu(n),G.c(),G.m(e,B)):G&&(G.d(1),G=null),Y[0]&4|Y[1]&536870912&&ce(e,"expanded",n[470]._expanded)},d(q){q&&S(e),H&&H.d(),G&&G.d(),U=!1,Se(P)}}}function sy(n){let e,t=ye(n[50]),l=[];for(let i=0;i0?uy:R[464].source==="suggestion"?cy:R[464].source==="unknown"||R[464].source==="imported"?ay:ry}let T=y(n),N=T(n),A=n[464].source==="suggestion"&&n[464]._events&&n[464]._events.length>0&&Fu(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent=`${v("worklog.editEntry")}`,i=w(),o=f("button"),o.textContent=`${v("worklog.deleteEntry")}`,s=w(),E&&E.c(),c=w(),u=f("div"),d=f("span"),d.textContent=`${v("worklog.source")}`,p=w(),N.c(),m=w(),A&&A.c(),r(l,"class","btn btn-sm svelte-5mstt"),r(o,"class","btn btn-sm btn-danger svelte-5mstt"),r(t,"class","worklog-entry-actions svelte-5mstt"),r(d,"class","wl-detail-label svelte-5mstt"),r(u,"class","wl-detail-section svelte-5mstt"),r(e,"class","worklog-entry-detail svelte-5mstt")},m(R,M){C(R,e,M),a(e,t),a(t,l),a(t,i),a(t,o),a(e,s),E&&E.m(e,null),a(e,c),a(e,u),a(u,d),a(u,p),N.m(u,null),a(e,m),A&&A.m(e,null),g||(h=[L(l,"click",He(b)),L(o,"click",He(k))],g=!0)},p(R,M){n=R,n[464].details?E?E.p(n,M):(E=Bu(n),E.c(),E.m(e,c)):E&&(E.d(1),E=null),T!==(T=y(n))&&(N.d(1),N=T(n),N&&(N.c(),N.m(u,null))),n[464].source==="suggestion"&&n[464]._events&&n[464]._events.length>0?A?A.p(n,M):(A=Fu(n),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},d(R){R&&S(e),E&&E.d(),N.d(),A&&A.d(),g=!1,Se(h)}}}function Bu(n){let e,t,l,i,o=n[464].details+"",s;return{c(){e=f("div"),t=f("span"),t.textContent=`${v("worklog.details")}`,l=w(),i=f("p"),s=j(o),r(t,"class","wl-detail-label svelte-5mstt"),r(i,"class","svelte-5mstt"),r(e,"class","wl-detail-section svelte-5mstt")},m(c,u){C(c,e,u),a(e,t),a(e,l),a(e,i),a(i,s)},p(c,u){u[1]&524288&&o!==(o=c[464].details+"")&&J(s,o)},d(c){c&&S(e)}}}function ry(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceUnknown")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function ay(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceUnknown")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function cy(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceSuggestionNoEvents")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function uy(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceSuggestion")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function fy(n){let e;return{c(){e=f("p"),e.textContent=`${v("worklog.sourceManual")}`,r(e,"class","svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Fu(n){let e,t,l,i=ye(n[464]._events),o=[];for(let s=0;s',N=w(),r(l,"class","action-title svelte-5mstt"),r(c,"class","action-type svelte-5mstt"),r(m,"class","action-data svelte-5mstt"),r(t,"class","action-info svelte-5mstt"),r(E,"class","btn btn-sm svelte-5mstt"),r(T,"class","btn btn-sm btn-danger svelte-5mstt"),r(k,"class","action-btns svelte-5mstt"),r(e,"class","action-card svelte-5mstt")},m(D,F){C(D,e,F),a(e,t),a(t,l),a(l,o),a(t,s),a(t,c),a(c,d),a(t,p),a(t,m),a(m,h),a(e,b),a(e,k),a(k,E),a(k,y),a(k,T),a(e,N),A||(R=[L(E,"click",M),L(T,"click",I)],A=!0)},p(D,F){n=D,F[1]&262144&&i!==(i=n[461].title+"")&&J(o,i),F[1]&262144&&u!==(u=n[209](n[461].type)+"")&&J(d,u),F[1]&262144&&g!==(g=n[461].data+"")&&J(h,g)},d(D){D&&S(e),A=!1,Se(R)}}}function my(n){let e,t=ye(n[69]),l=[];for(let i=0;i',s=w(),p&&p.c(),c=mt(),r(e,"class","note-title svelte-5mstt"),r(o,"class","btn btn-sm note-rename-btn svelte-5mstt"),r(o,"title",v("common.rename"))},m(m,g){C(m,e,g),a(e,l),C(m,i,g),C(m,o,g),C(m,s,g),p&&p.m(m,g),C(m,c,g),u||(d=L(o,"click",n[232]),u=!0)},p(m,g){g[1]&128&&t!==(t=m[38].title+"")&&J(l,t),m[38].dirty?p||(p=Zu(),p.c(),p.m(c.parentNode,c)):p&&(p.d(1),p=null)},d(m){m&&(S(e),S(i),S(o),S(s),S(c)),p&&p.d(m),u=!1,d()}}}function wy(n){let e,t,l,i,o,s,c,u;return{c(){e=f("div"),t=f("input"),l=w(),i=f("button"),i.textContent=`${v("common.save")}`,o=w(),s=f("button"),s.textContent=`${v("common.cancel")}`,r(t,"type","text"),r(t,"class","note-rename-input svelte-5mstt"),r(i,"class","btn btn-primary btn-sm svelte-5mstt"),r(s,"class","btn btn-sm svelte-5mstt"),r(e,"class","note-rename-inline svelte-5mstt")},m(d,p){C(d,e,p),a(e,t),Le(t,n[48]),a(e,l),a(e,i),a(e,o),a(e,s),c||(u=[L(t,"input",n[230]),L(t,"keydown",n[231]),L(i,"click",n[152]),L(s,"click",n[151])],c=!0)},p(d,p){p[1]&131072&&t.value!==d[48]&&Le(t,d[48])},d(d){d&&S(e),c=!1,Se(u)}}}function Zu(n){let e;return{c(){e=f("span"),e.textContent="●",r(e,"class","dirty-mark svelte-5mstt")},m(t,l){C(t,e,l)},d(t){t&&S(e)}}}function Yu(n){let e,t,l,i,o,s,c,u,d,p,m,g,h,b,k,E,y,T,N,A,R,M,I,D,F,B,U=v("common.create")+"",P,H,V,X,W,z,O,G=n[82]&&Xu(n);m=new Di({props:{kind:"folder",size:24}});let q=ye(n[16]),Y=[];for(let ne=0;neve(Y[ne],1,1,()=>{Y[ne]=null});return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${v("nav.createNode")}`,i=w(),G&&G.c(),o=w(),s=f("div"),c=f("span"),c.textContent=`${v("template.select")}`,u=w(),d=f("div"),p=f("button"),Ze(m.$$.fragment),g=w(),h=f("div"),b=f("span"),b.textContent=`${v("template.optionNone")}`,k=w(),E=f("span"),E.textContent=`${v("template.none.desc")}`,y=w();for(let ne=0;ne{b=null}),vt()),E[84].node&&E[84].node.parent_id?k?k.p(E,y):(k=ef(E),k.c(),k.m(t,o)):k&&(k.d(1),k=null),(!m||y[2]&4194304)&&Xt(t,"left",E[84].x+"px"),(!m||y[2]&4194304)&&Xt(t,"top",E[84].y+"px")},i(E){m||(pe(b),m=!0)},o(E){ve(b),m=!1},d(E){E&&S(e),b&&b.d(),k&&k.d(),g=!1,Se(h)}}}function xu(n){let e,t,l,i,o,s=ye(n[16].length>0?n[16]:[{id:"",title:"template.optionNone",icon:"folder"}]),c=[];for(let d=0;dve(c[d],1,1,()=>{c[d]=null});return{c(){e=f("div"),e.textContent=`${v("common.create")}`,t=w();for(let d=0;d0?d[16]:[{id:"",title:"template.optionNone",icon:"folder"}]);let m;for(m=0;mn[361].call(k)),r(g,"class","svelte-5mstt"),r(m,"class","form-group svelte-5mstt"),r(N,"class","label-text svelte-5mstt"),r(I,"type","text"),r(I,"placeholder",D=n[89]==="open_url"?v("action.urlPlaceholder"):n[89]==="open_folder"||n[89]==="open_file"?v("action.pathPlaceholder"):v("action.commandPlaceholder")),r(I,"class","svelte-5mstt"),r(T,"class","svelte-5mstt"),r(y,"class","form-group svelte-5mstt"),r(U,"class","btn btn-primary svelte-5mstt"),r(H,"class","btn svelte-5mstt"),r(B,"class","modal-actions svelte-5mstt"),r(t,"class","modal svelte-5mstt"),r(e,"class","modal-overlay svelte-5mstt"),r(e,"role","button"),r(e,"tabindex","0")},m(O,G){C(O,e,G),a(e,t),a(t,l),a(t,i),a(t,o),a(o,s),a(s,c),a(s,u),a(s,d),Le(d,n[88]),a(t,p),a(t,m),a(m,g),a(g,h),a(g,b),a(g,k);for(let q=0;q0&&af(n),H=n[104]&&uf();return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent=`${v("inbox.assignTitle")}`,i=w(),o=f("div"),c=j(s),u=w(),d=f("div"),p=f("label"),m=f("span"),m.textContent=`${v("inbox.assignTarget")}`,g=w(),h=f("input"),b=w(),k=f("div"),k.textContent=`${v("inbox.assignSearchHint")}`,E=w(),P&&P.c(),y=w(),H&&H.c(),T=w(),N=f("div"),A=f("button"),M=j(R),D=w(),F=f("button"),F.textContent=`${v("common.cancel")}`,r(l,"class","svelte-5mstt"),r(o,"class","create-context svelte-5mstt"),r(m,"class","label-text svelte-5mstt"),r(h,"type","text"),r(h,"placeholder",v("inbox.assignSearchPlaceholder")),r(h,"class","svelte-5mstt"),r(k,"class","assign-hint svelte-5mstt"),r(p,"class","svelte-5mstt"),r(d,"class","form-group assign-search svelte-5mstt"),r(A,"class","btn btn-primary svelte-5mstt"),A.disabled=I=!n[103],r(F,"class","btn svelte-5mstt"),r(N,"class","modal-actions svelte-5mstt"),r(t,"class","modal svelte-5mstt"),r(e,"class","modal-overlay svelte-5mstt"),r(e,"role","button"),r(e,"tabindex","0")},m(V,X){C(V,e,X),a(e,t),a(t,l),a(t,i),a(t,o),a(o,c),a(t,u),a(t,d),a(d,p),a(p,m),a(p,g),a(p,h),Le(h,n[101]),a(p,b),a(p,k),a(d,E),P&&P.m(d,null),a(t,y),H&&H.m(t,null),a(t,T),a(t,N),a(N,A),a(A,M),a(N,D),a(N,F),B||(U=[L(h,"input",n[365]),L(h,"input",n[194]),L(h,"keydown",n[366]),L(A,"click",n[196]),L(F,"click",n[193]),L(e,"click",Kt(n[193])),L(e,"keydown",al(n[193]))],B=!0)},p(V,X){X[3]&128&&s!==(s=V[100].title+"")&&J(c,s),X[3]&256&&h.value!==V[101]&&Le(h,V[101]),V[102].length>0?P?P.p(V,X):(P=af(V),P.c(),P.m(d,null)):P&&(P.d(1),P=null),V[104]?H||(H=uf(),H.c(),H.m(t,T)):H&&(H.d(1),H=null),X[3]&1024&&I!==(I=!V[103])&&(A.disabled=I)},d(V){V&&S(e),P&&P.d(),H&&H.d(),B=!1,Se(U)}}}function af(n){let e,t=ye(n[102]),l=[];for(let i=0;i{p[N]=null}),vt(),t=p[e],t?t.p(y,T):(t=p[e]=d[e](y),t.c()),pe(t,1),t.m(l.parentNode,l)),y[41]?g?g.p(y,T):(g=gf(y),g.c(),g.m(i.parentNode,i)):g&&(g.d(1),g=null),y[44]?h?(h.p(y,T),T[1]&8192&&pe(h,1)):(h=hf(y),h.c(),pe(h,1),h.m(o.parentNode,o)):h&&(bt(),ve(h,1,1,()=>{h=null}),vt()),y[47]&&y[47]!==((A=y[38])==null?void 0:A.id)?b?b.p(y,T):(b=_f(y),b.c(),b.m(s.parentNode,s)):b&&(b.d(1),b=null),y[45]?k?k.p(y,T):(k=bf(y),k.c(),k.m(c.parentNode,c)):k&&(k.d(1),k=null)},i(y){u||(pe(t),pe(h),u=!0)},o(y){ve(t),ve(h),u=!1},d(y){y&&(S(l),S(i),S(o),S(s),S(c)),p[e].d(y),g&&g.d(y),h&&h.d(y),b&&b.d(y),k&&k.d(y)}}}function de(n,...e){try{if(window.go&&window.go.main&&window.go.main.App){const t=window.go.main.App[n];if(typeof t=="function")return t(...e)}}catch(t){console.error("Wails call error:",n,t)}return Promise.reject(new Error("Wails not connected: "+n))}function Ty(n,e,t){const l=[...n];return l.sort((i,o)=>{let s=0;if(e==="name")s=(i.title||"").localeCompare(o.title||"");else if(e==="type"){const c=i.captureKind||i.sourceKind||i.type||"",u=o.captureKind||o.sourceKind||o.type||"";s=c.localeCompare(u)}else s=(i.capturedAt||i.createdAt||"").localeCompare(o.capturedAt||o.createdAt||"");return t==="asc"?s:-s}),l}function Sy(n,e){return n.section===e.section&&n.nodeId===e.nodeId&&n.tab===e.tab&&n.trashFolderId===e.trashFolderId}function wi(n){return!n||!(n instanceof Element)?!1:!!n.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]')}function yi(n,e,t){for(const l of n){if(l.id===e)return l.children=t,l.has_children=t.length>0,!0;if(l.children&&yi(l.children,e,t))return!0}return!1}function Cy(n){n.preventDefault(),n.dataTransfer.dropEffect="move",dropRootValid=!0}function Ay(n){dropRootValid=!1}function Ld(n){return(n==null?void 0:n.sourceKind)||(n==null?void 0:n.captureKind)||(n==null?void 0:n.type)||""}function Us(n){return Ld(n)!=="url"&&(n==null?void 0:n.type)!=="link"}function Ny(n,e){return{id:n.id,nodeId:n.id,fileId:e.id||e.fileId,name:e.name||n.title,type:"file",size:e.size||0,mime:e.mime||""}}function Dd(n,e,t){for(const l of n){if(l.id===e)return l.children=t,l.has_children=t.length>0,!0;if(l.children&&Dd(l.children,e,t))return!0}return!1}function Ry(n,e){return e?n.filter(t=>ps(t)===e):n.filter(t=>!ps(t)||!n.some(l=>l.id===ps(t)))}function ps(n){return(n==null?void 0:n.parentId)||(n==null?void 0:n.parentID)||(n==null?void 0:n.parent_id)||""}async function gi(n){previewItem={name:n.title,type:"file",mime:"text/plain",size:0,fileId:n.id},previewContent="",previewError="",previewLoading=!0;try{n.trashFsPath?previewContent=await de("ReadTrashFile",n.trashFsPath)||"":previewContent=await de("ReadTrashFileContent",n.id)||"";const e=(n.title||"").split(".").pop().toLowerCase();["png","jpg","jpeg","gif","webp","bmp","svg"].includes(e)&&(previewContent="data:image/"+(e==="svg"?"svg+xml":e)+";base64,"+btoa(previewContent))}catch(e){previewError=String(e)}previewLoading=!1}function hi(n){return n.eventIds&&n.eventIds.length?n.eventIds:n.events&&n.events.length?n.events.map(e=>e.id).filter(Boolean):[]}function _i(n){try{de("WriteDebugLog",n)}catch{}}function ms(n){return n?n.map(e=>(e._expanded===void 0&&(e._expanded=!1),e)):[]}function Qt(n){return n?new Date(n).toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"}):""}function Yl(n){return n==="note_created"||n==="file_added"||n==="folder_added"||n==="node_created"?"+":n==="file_deleted"||n==="folder_deleted"?"×":n==="file_renamed"||n==="folder_renamed"||n==="note_updated"||n==="node_updated"?"~":n==="file_copied"?"⧉":n==="file_moved"?"→":"•"}function Rn(n){if(!n)return"";try{return new Date(n).toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}catch{return n}}function gs(n){const e=String(n||"").trim();if(!e||/[\s]/.test(e)||e.includes("@"))return"";try{const t=new URL(e);return(t.protocol==="http:"||t.protocol==="https:")&&t.hostname?e:""}catch{try{const l=`https://${e}`,i=new URL(l);return i.hostname&&i.hostname.includes(".")?l:""}catch{return""}}}function Iy(n){return{"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp"}[n]||"bin"}function My(n){return new Promise((e,t)=>{const l=new FileReader;l.onload=()=>{const i=String(l.result||""),o=i.indexOf(",");e(o>=0?i.slice(o+1):i)},l.onerror=()=>t(l.error),l.readAsDataURL(n)})}function Ly(n){const e=String(n||"").split(/\r?\n/).map(t=>t.trim()).filter(Boolean);return e.length?{url:e[0],title:e[1]||""}:null}function Dy(n){return String(n||"").split(/\r?\n/).map(t=>t.trim()).filter(t=>t&&!t.startsWith("#"))[0]||""}function vf(n){if(dragIds.length>0)return!1;const e=Array.from((n==null?void 0:n.types)||[]);return e.includes("Files")||e.includes("text/uri-list")||e.includes("text/x-moz-url")||e.includes("text/plain")&&!e.includes("application/x-verstak-node")}function Od(){captureDragResetTimer&&(clearTimeout(captureDragResetTimer),captureDragResetTimer=null)}function It(){captureDragDepth=0,captureDropActive=!1,captureDropLabel="",lastCaptureDragOverAt=0,inboxDropValid=!1,Od()}function Pd(){captureDragResetTimer||(captureDragResetTimer=setTimeout(()=>{captureDragResetTimer=null,captureDropActive&&Date.now()-lastCaptureDragOverAt>2e3?It():captureDropActive&&Pd()},2500))}function kf(n){captureDragDepth>0&&(captureDragDepth-=1),(n.clientX<=0||n.clientY<=0||n.clientX>=window.innerWidth||n.clientY>=window.innerHeight||captureDragDepth<=0)&&It()}function wf(){document.hidden&&It()}function Oy(n){n.preventDefault(),n.dataTransfer.dropEffect="copy",inboxDropValid=!0}function Py(){inboxDropValid=!1}function zy(n){return["case","client","project","folder","document","recipe"].includes(n.type)}function By(n){return n.targetType==="note"&&n.targetId?{nodeId:n.nodeId,tab:"notes",targetId:n.targetId}:n.targetType==="file"?{nodeId:n.nodeId,tab:"files",targetId:n.targetId,targetPath:n.targetPath}:n.targetType==="folder"?{nodeId:n.nodeId,tab:"files",targetPath:n.targetPath||n.targetId}:{nodeId:n.nodeId}}function al(n){return e=>{wi(e.target)||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n())}}function Fy(n,e,t){var Co;let l,i,o,s,c=null,u=null,d=!1,p=!1,m=!1,g=!1,h=[],b=[],k=[],E=null,y=[],T=0,N=!0,A=[],R=null,M="",I="",D=!1,F="",B="all",U="all",P="",H="",V="suggestions",X="",W=[],z=!1,O=[],G="",q="",Y="",x=null,ne="overview",le=[],ie=null,me,Ne="edit",ze=!1,Ye="",Re="",te=!1,re=!1,Ae="",Be=null,be="",We="",at=[],Te=[],nt=[],De=!1,Ce="",Fe="",je="",Ge="",Pe=!1,fe=!1,ge=null,Q=null,he=[],_e=0,Me=[],rt=[],Qe=[],xe=!1,ut=[],$=[],ee=!1,we="",Ke="date",pt="desc",Mt=!1,Lt=[],Nt=null,ct="",yt="",Vt="",dn="",zt=null,cl=0,Rt=[],Bt="",ht=[],ul=[],xl="",In="",nn=[],Nl=!1,ft=!1,Ft="",Tn=null,qt=null,Zt={visible:!1,x:0,y:0,node:null},pn=!1,Yt="",Hn=!1,mn="",Wn="open_url",gn="",xt=[{id:"open_url",label:v("action.openUrl")},{id:"open_file",label:v("action.openFile")},{id:"open_folder",label:v("action.openFolder")},{id:"run_command",label:v("action.runCommand")},{id:"run_script",label:v("action.runScript")},{id:"open_terminal",label:v("action.openTerminal")},{id:"launch_app",label:v("action.launchApp")}],Sn=!0,$t=!1,$l="",ei="",Rl=!1,Il=v("common.delete"),Cn=null,Mn=null,ln=!1,sn="",en="",jt="",on=null,hn="",_n=[],rn=null,fl=!1,Ml,Ll=null,Dl=!1,Ln="",An="";const Ol=[{id:"overview",label:v("tab.overview")},{id:"notes",label:v("tab.notes")},{id:"files",label:v("tab.files")},{id:"links",label:v("tab.links")},{id:"actions",label:v("tab.actions")},{id:"activity",label:v("tab.activity"),group:"service"},{id:"worklog",label:v("tab.worklog"),group:"service"},{id:"inbox",label:v("tab.inbox"),group:"service"}];let Ee=null;function Z(_){const K={};for(const Ie of _){const Ue=Ie.captureContextLabel||v("inbox.noContext");K[Ue]||(K[Ue]=[]),K[Ue].push(Ie)}const ue=[];for(const[Ie,Ue]of Object.entries(K))ue.push({label:Ie,items:Ue});return ue.sort((Ie,Ue)=>Ie.label.localeCompare(Ue.label)),ue}function se(){return{section:Y||"",nodeId:(x==null?void 0:x.id)||"",tab:x?ne:"",trashFolderId:Y==="trash"?Bt:"",trashFolderStack:Y==="trash"?ht.map(_=>({id:_.id,title:_.title})):[]}}function ke(){if(Nl)return;const _=se(),K=nn[nn.length-1];(!K||!Sy(K,_))&&(nn=[...nn,_].slice(-80))}function Oe(){t(8,Bt=""),t(221,ht=[]),t(76,Rt=[])}function Xe(){return $t?(Fi(),!0):g?(So(),!0):on?($i(),!0):Nt?(es(),!0):ln?(t(97,ln=!1),!0):De?(no(),!0):Hn?(yo(),!0):pn?(Qs(),!0):ft?(Ks(),!0):Zt.visible?(Gn(),!0):ie?(to(),!0):!1}async function lt(_){Nl=!0;try{if(_.nodeId){const K=await de("GetNodeDetail",_.nodeId);return K?(await Tt(K),t(36,ne=_.tab||"overview"),!0):!1}else if(_.section)return h.some(K=>K.id===_.section)?(await Ut(_.section),_.section==="trash"&&(t(8,Bt=_.trashFolderId||""),t(221,ht=_.trashFolderStack||[]),t(76,Rt=[]),await Vn()),!0):!1;return!1}catch{return!1}finally{Nl=!1}}async function Et(){if(!Xe())for(;nn.length>0;){const _=nn[nn.length-1];if(nn=nn.slice(0,-1),await lt(_))return}}function _t(_){_.button!==3&&_.button!==4||wi(_.target)||Xe()&&_.button===3||(_.preventDefault(),_.stopPropagation(),_.button===3&&Et())}function gt(_){ne!==_&&(ke(),t(36,ne=_))}Xl(async()=>{try{if(t(11,u=await de("GetStartupStatus")),d=!0,u.status==="first_run"){t(12,p=!0),t(91,Sn=!1);return}if(u.status==="recovery"){t(13,m=!0),t(91,Sn=!1);return}}catch(_){t(35,q=String(_))}try{t(34,G=await de("VerstakVersion")||"verstak-gui/v2"),t(0,h=await de("ListSystemViewsWithPlugins")||[]),t(15,b=await de("ListWorkspaceTree")||[]),t(16,k=await de("ListEnabledTemplates")||[])}catch(_){t(35,q=String(_)),t(0,h=[{id:"today",label:v("nav.today")},{id:"inbox",label:v("nav.inbox")},{id:"activity",label:v("nav.activity")}]),t(15,b=[]),t(16,k=[])}window.runtime&&window.runtime.EventsOn&&(window.runtime.EventsOn("files-dropped",gp),Ee=()=>window.runtime.EventsOff("files-dropped")),window.addEventListener("keydown",Hs),window.addEventListener("paste",co),window.addEventListener("dragenter",fo),window.addEventListener("dragover",po),window.addEventListener("dragleave",kf),window.addEventListener("dragend",It),window.addEventListener("dragcancel",It),window.addEventListener("drop",mo),window.addEventListener("mouseup",It),window.addEventListener("mouseleave",It),window.addEventListener("blur",It),document.addEventListener("visibilitychange",wf),window.addEventListener("auxclick",_t),window.addEventListener("mouseup",_t),t(91,Sn=!1),ns(),Ki()}),Jl(()=>{Ee&&Ee(),window.removeEventListener("keydown",Hs),window.removeEventListener("paste",co),window.removeEventListener("dragenter",fo),window.removeEventListener("dragover",po),window.removeEventListener("dragleave",kf),window.removeEventListener("dragend",It),window.removeEventListener("dragcancel",It),window.removeEventListener("drop",mo),window.removeEventListener("mouseup",It),window.removeEventListener("mouseleave",It),window.removeEventListener("blur",It),document.removeEventListener("visibilitychange",wf),window.removeEventListener("auxclick",_t),window.removeEventListener("mouseup",_t),Od()});async function Ut(_){ke(),t(1,Y=_),t(2,x=null),t(36,ne="overview"),t(37,le=[]),at=[],t(49,Te=[]),t(50,nt=[]),t(66,$=[]),t(69,Lt=[]),t(60,he=[]),t(3,ut=[]),t(7,zt=null),Oe(),t(80,ft=!1),t(35,q=""),t(17,E=null),t(62,Me=[]),t(63,rt=[]),t(18,y=[]),T=0,N=!0,t(19,A=[]),t(20,R=null);try{_==="today"?(t(17,E=await de("ListTodayView")||{cases:[]}),t(60,he=await de("GetSuggestions")||[]),t(61,_e=he.length),t(62,Me=await de("ListTodayInProgress")||[]),t(63,rt=await de("ListTodayCaptures")||[])):_==="inbox"?t(3,ut=await de("ListInboxNodes")||[]):_==="trash"?await Vn():_==="journal"?await qn():_==="activity"&&(t(18,y=await de("ListActivityFeed",50,0)||[]),T=y.length,N=y.length===50)}catch(K){t(35,q=String(K)),t(17,E={cases:[]}),t(3,ut=[]),t(7,zt=null),t(18,y=[])}}async function Tt(_){ke(),t(2,x=_),t(1,Y=""),t(36,ne="overview"),t(37,le=[]),at=[],t(49,Te=[]),t(50,nt=[]),t(60,he=[]),Oe(),t(38,ie=null),t(80,ft=!1),t(85,pn=!1),t(35,q=""),t(33,O=[]),c&&c.resetToNode(_.id),await At(_.id)}async function At(_){try{t(37,le=await de("ListNotes",_)||[])}catch{}try{at=await de("ListFiles",_)||[]}catch{}try{t(49,Te=await de("ListActions",_)||[])}catch{}try{t(50,nt=ms(await de("ListWorklog",_)))}catch{}try{t(66,$=await de("ListInboxNodesForTarget",_)||[])}catch{t(66,$=[])}try{t(69,Lt=await de("ListLinks",_)||[])}catch{t(69,Lt=[])}try{t(60,he=await de("GetSuggestions")||[]),t(61,_e=he.length)}catch{t(60,he=[]),t(61,_e=0)}try{t(33,O=await de("ListActivityByNode",_,50,0)||[])}catch{}}function Hs(_){if(_.key==="Escape"&&captureDropActive){_.preventDefault(),It();return}if(!wi(_.target)){if(_.key==="Backspace"||_.altKey&&_.key==="ArrowLeft"){_.preventDefault(),Et();return}if(ne==="files"&&c){c.filesHandleKeydown(_);return}}}function Bi(_,K){sn=_,t(98,en=K),t(99,jt=""),t(97,ln=!0)}async function Ws(){const _=en.trim();if(!_){t(99,jt=v("rename.emptyError"));return}try{await de("ValidateName",_)}catch{t(99,jt=v("rename.invalidError"));return}t(97,ln=!1);const K=sn;sn="";try{await de("RenameNode",K,_),x&&x.id===K&&t(2,x={...x,title:_}),await Kn(),currentFolderId&&await loadFolder(currentFolderId)}catch(ue){t(35,q=String(ue))}}function zd(){t(97,ln=!1),sn="",t(98,en=""),t(99,jt="")}function Bd(_){_.key==="Enter"?Ws():t(99,jt="")}function an(_){t(93,$l=_.title||v("common.confirm")),t(94,ei=_.message||""),t(95,Rl=_.danger!==void 0?_.danger:!0),t(96,Il=_.confirmText||v("common.delete")),Cn=_.onConfirm||null,Mn=_.onCancel||null,t(92,$t=!0)}function Fi(){t(92,$t=!1),Cn=null,Mn=null}function Fd(){Cn&&Cn(),Fi()}function jd(){Mn&&Mn(),Fi()}function Gs(_){t(82,Tn=Zt.node),t(83,qt=_),t(81,Ft=""),t(80,ft=!0),Gn()}function Ud(){t(82,Tn=null),t(83,qt=void 0),t(81,Ft=""),t(80,ft=!0)}function Ks(){t(80,ft=!1),t(81,Ft=""),t(82,Tn=null),t(83,qt=void 0)}async function Vs(){if(!(!Ft.trim()||qt===void 0))try{const _=Tn?Tn.id:"",K=qt?qt.id:"",ue=await de("CreateNodeFromTemplate",_,Ft.trim(),K);t(80,ft=!1),t(81,Ft="");const Ie=ue?ue.id:null;if(t(82,Tn=null),t(83,qt=void 0),_){expanded={...expanded,[_]:!0};const Ue=await de("ListWorkspaceChildren",_)||[];yi(b,_,Ue),t(15,b=[...b])}else t(15,b=await de("ListWorkspaceTree")||b);if(Ie){const Ue=await de("GetNodeDetail",Ie);Ue&&(t(1,Y=""),Tt(Ue))}}catch(_){t(35,q=String(_))}}function Hd(_,K){t(84,Zt={visible:!0,x:_.clientX,y:_.clientY,node:K})}function Gn(){t(84,Zt={visible:!1,x:0,y:0,node:null})}async function Wd(_){const K=!expanded[_];if(expanded={...expanded,[_]:K},!K)return;const ue=await de("ListWorkspaceChildren",_)||[];yi(b,_,ue),t(15,b=[...b])}async function Gd(_,K){if(!(!_||!K||_===K))try{const ue=await de("MoveNode",_,K);await Kn();const Ie=await de("GetNodeDetail",_);Ie&&(t(1,Y=""),Tt(Ie))}catch(ue){t(35,q=String(ue))}}async function Kd(_){_.preventDefault(),_.stopPropagation();try{const K=_.dataTransfer.getData("text/plain");if(!K)return;const ue=await de("GetNodeDetail",K);if(!ue||!ue.parent_id)return;await de("MoveNode",K,""),await Kn();const Ie=await de("GetNodeDetail",K);Ie&&(t(1,Y=""),Tt(Ie))}catch(K){t(35,q=String(K))}}function qs(_){Bi(_.id,_.title),Gn()}function Zs(_){Gn(),an({title:v("delete.confirmTitle"),message:v("delete.confirmMessage")+" "+_.title+"?",confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteNode",_.id),await Kn(),await Ki(),x&&x.id===_.id&&t(2,x=null)}catch(K){t(35,q=String(K))}}})}async function Nn(_){Gn();const K=typeof _=="string"?_:_.id;try{await de("OpenFolder",K)}catch(ue){t(35,q=String(ue))}}async function cn(_){const K=Ld(_);try{if(K==="url"||_.type==="link"){if(!_.url)throw new Error("url required");await de("OpenURL",_.url);return}if(K==="text"||_.type==="note"){const ue=await de("ReadNote",_.id);t(38,ie={id:_.id,title:_.title,content:ue||"",dirty:!1});return}if(K==="folder"||_.type==="folder"){ke(),t(1,Y=""),t(2,x=_),t(36,ne="files"),folderStack=[],currentFolderId=null,selectedIds=[],previewItem=null,await At(_.id),await loadFolder(_.id);return}if(K==="file"||K==="image"||_.type==="file"){const Ie=(await de("ListFiles",_.id)||[])[0];if(!Ie)throw new Error("file record not found");const Ue=Ny(_,Ie);ss(Ue)?await openPreview(Ue):await de("OpenFile",Ue.fileId);return}await Pl(_.id)}catch(ue){t(35,q=String(ue))}}async function Ys(_){Gn();try{await de("MoveNode",_.id,""),await Kn();const K=await de("GetNodeDetail",_.id);K&&(t(1,Y=""),Tt(K))}catch(K){t(35,q=String(K))}}async function Kn(){const _=Object.keys(expanded).filter(ue=>expanded[ue]),K=await de("ListWorkspaceTree")||[];for(const ue of _){const Ue=(await de("ListWorkspaceChildren",ue)||[]).map(St=>({...St}));Dd(K,ue,Ue)}t(15,b=K)}async function Xs(_){const K=await de("ListWorkspaceChildren",_)||[];yi(b,_,K),t(15,b=[...b])}function Js(){t(85,pn=!0),t(86,Yt="")}function Qs(){t(85,pn=!1),t(86,Yt="")}async function xs(){if(!(!Yt.trim()||!x))try{const _=await de("CreateNote",x.id,Yt.trim());t(37,le=[...le,_&&_.id?_:{id:Date.now().toString(),title:Yt.trim(),createdAt:new Date().toISOString()}]),t(85,pn=!1),t(86,Yt="")}catch{const K={id:Date.now().toString(),title:Yt.trim(),createdAt:new Date().toISOString()};t(37,le=[...le,K]),t(85,pn=!1),t(86,Yt="")}}async function Dn(_){if(ie&&ie.dirty){an({title:v("note.unsavedTitle"),message:v("note.unsavedMessage"),confirmText:v("note.unsavedClose"),danger:!1,onConfirm:async()=>{await $s(_)}});return}await $s(_)}async function $s(_){try{const K=await de("ReadNote",_.id);t(38,ie={id:_.id,title:_.title,content:K||"",dirty:!1})}catch{t(38,ie={id:_.id,title:_.title,content:"# "+_.title+` `,dirty:!1})}}function eo(_){an({title:v("common.delete"),message:v("note.deleteConfirm",{title:_.title})||`Удалить заметку «${_.title}»?`,confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteNote",_.id),t(37,le=le.filter(K=>K.id!==_.id)),ie&&ie.id===_.id&&t(38,ie=null);try{await Ki()}catch{}}catch(K){t(35,q=String(K))}}})}function to(){if(ie&&ie.dirty){an({title:v("note.unsavedTitle"),message:v("note.unsavedMessage"),confirmText:v("note.unsavedClose"),danger:!1,onConfirm:()=>{t(38,ie=null),t(40,Ne="edit")}});return}t(38,ie=null),t(40,Ne="edit")}async function Vd(){if(ie)try{await de("SaveNote",ie.id,ie.content),t(38,ie.dirty=!1,ie)}catch{t(38,ie.dirty=!1,ie)}}function qd(){t(42,Ye=""),t(43,Re=""),t(41,ze=!0)}function ji(){if(!ie){t(41,ze=!1);return}const _=Ye.trim()||Re.trim()||"link",K=Re.trim()||"#",ue=`[${_}](${K})`;t(38,ie.content=ie.content+(ie.content.endsWith(` `)?"":` `)+ue+` `,ie),t(38,ie.dirty=!0,ie),t(41,ze=!1)}function Zd(){t(44,te=!0)}function Yd(_){const K=_.detail.markdown;me&&typeof me.insertText=="function"&&me.insertText(K),t(44,te=!1)}function Xd(){t(44,te=!1)}function Ui(_,K){t(47,Be=_),t(48,be=K),We=K}function On(){t(47,Be=null),t(48,be=""),We=""}async function Hi(){if(!Be||!be.trim()){On();return}if(be.trim()===We){On();return}try{await de("RenameNote",Be,be.trim()),t(37,le=le.map(_=>_.id===Be?{..._,title:be.trim()}:_)),ie&&ie.id===Be&&t(38,ie.title=be.trim(),ie),On()}catch(_){t(35,q=String(_)),On()}}async function Jd(_){const{type:K,id:ue}=_.detail;if(ue)switch(K){case"case":await Qd(ue);break;case"note":await xd(ue);break;case"file":await $d(ue);break;case"secret":bn(v("note.internal.secretNotImplemented"));break;default:bn(`verstak://${K}/${ue}`)}}async function Qd(_){try{const K=await de("GetNodeDetail",_);if(!K){bn(v("note.internal.caseNotFound"));return}await Tt(K)}catch{bn(v("note.internal.caseNotFound"))}}async function xd(_){try{const K=await de("GetNodeDetail",_);if(!K){bn(v("note.internal.noteNotFound"));return}const ue=K.parent_id||K.parentId||"";if(ue){const Ue=await de("GetNodeDetail",ue);Ue&&await Tt(Ue)}gt("notes");const Ie=le.find(Ue=>Ue.id===_);Ie?await Dn(Ie):await Dn({id:K.id,title:K.title})}catch{bn(v("note.internal.noteNotFound"))}}async function $d(_){try{const K=await de("GetNodeDetail",_);if(!K){bn(v("note.internal.fileNotFound"));return}const ue=K.parent_id||K.parentId||"";if(ue){const Ie=await de("GetNodeDetail",ue);Ie&&await Tt(Ie),gt("files"),await loadFolder(ue);const Ue=fileItems.find(St=>St.id===_);Ue?await openPreview(Ue):bn(v("note.internal.fileFound",{title:K.title}))}else bn(v("note.internal.fileFound",{title:K.title}))}catch{bn(v("note.internal.fileNotFound"))}}function bn(_){t(46,Ae=_),t(45,re=!0),setTimeout(()=>{t(45,re=!1)},3e3)}function ep(_){ie&&(t(38,ie.content=_.detail.content,ie),t(38,ie.dirty=!0,ie))}function tp(_){t(40,Ne=_.detail.mode)}function np(){qd()}function lp(){Zd()}function ti(_=null){t(58,ge=_),t(59,Q=null),t(52,Ce=_?_.summary:""),t(53,Fe=_?String(_.minutes||""):""),t(54,je=_&&_.date||""),t(55,Ge=_&&_.details||""),t(56,Pe=_?!!_.billable:!1),t(57,fe=_?!!_.approximate:!1),t(51,De=!0)}function no(){t(51,De=!1),t(58,ge=null),t(59,Q=null)}async function Wi(_=""){const K=_||(x?x.id:"");x&&x.id===K&&t(50,nt=ms(await de("ListWorklog",x.id))||nt),Y==="journal"&&await qn()}async function ip(){const _=parseInt(Fe,10);if(!(!Ce.trim()||isNaN(_)||_<=0)&&!(!Q&&!ge&&!x)){try{if(Q){const K=JSON.stringify(hi(Q));await de("AcceptSuggestionFull",Q.nodeId,Ce.trim(),Ge,je,_,fe,Pe,K),await ni()}else ge?(await de("UpdateWorklogEntry",ge.id,Ce.trim(),Ge,je,_,fe,Pe),await Wi(ge.nodeId)):(await de("CreateWorklogFull",x.id,Ce.trim(),Ge,je,_,fe,Pe),await Wi(x.id))}catch(K){t(35,q=String(K));return}t(51,De=!1),t(58,ge=null),t(59,Q=null)}}function Gi(_){an({title:v("worklog.deleteEntry"),message:v("worklog.deleteConfirm"),confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteWorklogEntry",_.id),await Wi(_.nodeId)}catch(K){t(35,q=String(K))}}})}async function ni(){t(60,he=await de("GetSuggestions")||[]),t(61,_e=he.length),x&&t(50,nt=ms(await de("ListWorklog",x.id))),Y==="journal"&&await qn()}async function Vn(){t(7,zt=await de("ListTrash")||{nodes:[],entries:[],trashPath:"",count:0}),t(75,cl=zt.count||0);const _=zt.nodes||[];t(76,Rt=Rt.filter(K=>_.some(ue=>ue.id===K))),Bt&&!_.some(K=>K.id===Bt)?Oe():ht.length>0&&(t(221,ht=ht.filter(K=>_.some(ue=>ue.id===K.id))),t(8,Bt=ht.length>0?ht[ht.length-1].id:""))}async function Ki(){try{t(75,cl=await de("TrashCount")||0)}catch{t(75,cl=0)}}function sp(){return Bt&&(((zt==null?void 0:zt.nodes)||[]).find(_=>_.id===Bt)||ht[ht.length-1])||null}function dl(_){ke(),t(8,Bt=_.id);const K=ht.findIndex(ue=>ue.id===_.id);K>=0?t(221,ht=ht.slice(0,K+1)):t(221,ht=[...ht,{id:_.id,title:_.title}]),t(76,Rt=[])}function op(){if(ht.length===0)return;ke();const _=ht.slice(0,-1);t(221,ht=_),t(8,Bt=_.length>0?_[_.length-1].id:""),t(76,Rt=[])}function lo(_){t(76,Rt=Rt.includes(_)?Rt.filter(K=>K!==_):[...Rt,_])}function Vi(_){return Rt.length>0?Rt:[_]}async function qi(_){try{await de("RestoreTrashNodesJSON",JSON.stringify(_)),await Kn(),await Vn()}catch(K){t(35,q=String(K))}}async function Zi(_){an({title:v("delete.confirmTitle"),message:v("delete.confirmMessage")+" "+_.length+"?",confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{try{await de("PurgeTrashNodesJSON",JSON.stringify(_)),await Vn()}catch(K){t(35,q=String(K))}}})}async function rp(){an({title:v("delete.confirmTitle"),message:v("trash.empty")+"?",confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{try{await de("EmptyTrash"),await Vn()}catch(_){t(35,q=String(_))}}})}function li(_){t(59,Q=_),t(58,ge=null),t(52,Ce=_.summary||""),t(53,Fe=String(_.suggestedMin||"")),t(54,je=""),t(55,Ge=""),t(56,Pe=!1),t(57,fe=!0),t(51,De=!0)}async function ii(_){try{await de("DismissSuggestion",_.nodeId,JSON.stringify(hi(_))),await ni()}catch(K){t(35,q=String(K))}}async function ap(){t(65,xe=!0);try{const _=await de("ListBrowserEvents","pending",50,0);t(64,Qe=_||[])}catch(_){console.warn("[browser] load error:",_)}finally{t(65,xe=!1)}}async function cp(_){await de("AcceptBrowserEvent",_.id,""),t(64,Qe=Qe.filter(K=>K.id!==_.id))}async function up(_){await de("DismissBrowserEvent",_.id),t(64,Qe=Qe.filter(K=>K.id!==_.id))}async function fp(_){x&&x.id?(await de("AttachBrowserEventToNode",_.id,x.id),t(64,Qe=Qe.filter(K=>K.id!==_.id))):(await de("DismissBrowserEvent",_.id),t(64,Qe=Qe.filter(K=>K.id!==_.id)))}async function Yi(_){try{const K=hi(_),ue=JSON.stringify(K);_i("acceptTodaySuggestion: nodeId="+_.nodeId+" eventIds="+ue+" events="+JSON.stringify((_.events||[]).map(Ie=>({id:Ie.id,type:Ie.eventType,title:Ie.title})))),await de("AcceptSuggestionWith",_.nodeId,_.summary,_.suggestedMin,"",ue),await ni()}catch(K){_i("acceptTodaySuggestion error: "+K)}}async function io(_){try{const K=hi(_),ue=JSON.stringify(K);_i("acceptJournalSuggestion: nodeId="+_.nodeId+" eventIds="+ue+" events="+JSON.stringify((_.events||[]).map(Ie=>({id:Ie.id,type:Ie.eventType,title:Ie.title})))),await de("AcceptSuggestionWith",_.nodeId,_.summary,_.suggestedMin,"",ue),await ni()}catch(K){_i("acceptJournalSuggestion error: "+K)}}async function qn(){try{const[_,K,ue]=await Promise.all([de("ListWorklogReport",M,I,F,D,B,U),de("WorklogReportSummary",M,I,F,D,B,U),de("GetSuggestions")]);if(t(19,A=(_||[]).map(Ie=>(Ie._expanded===void 0&&(Ie._expanded=!1),Ie))),t(20,R=K||null),t(60,he=ue||[]),t(61,_e=he.length),F&&!P)if(_&&_.length>0&&_[0].nodePath)t(27,P=_[0].nodePath);else try{t(27,P=await de("GetNodeTitle",F))}catch{t(27,P="")}}catch{t(19,A=[]),t(20,R=null),t(60,he=[]),t(61,_e=0)}}async function si(_){try{const K=await de("SaveWorklogReport",_,M,I,F,D,B,U);t(28,H=K),setTimeout(()=>t(28,H=""),4e3)}catch(K){if(String(K).includes("отменено"))return;t(28,H="Ошибка: "+String(K)),setTimeout(()=>t(28,H=""),6e3)}}let so;async function Xi(_){if(_._expanded=!_._expanded,t(19,A),_._expanded&&!_._events&&_._hasEvents===void 0)try{_._events=await de("GetWorklogEntryEvents",_.id)||[],_._hasEvents=_._events.length>0,t(19,A)}catch{_._events=[],_._hasEvents=!1,t(19,A)}}async function Ji(_){if(_._expanded=!_._expanded,_._expanded&&_.source==="suggestion"&&!_._events&&_._hasEvents===void 0)try{_._events=await de("GetWorklogEntryEvents",_.id)||[],_._hasEvents=_._events.length>0}catch(K){K._events=[],K._hasEvents=!1}t(50,nt)}async function dp(){const _=X.trim();if(!_||_.length<2){t(31,W=[]),t(32,z=!1);return}try{t(31,W=await de("SearchNodes",_)||[]),t(32,z=W.length>0)}catch{t(31,W=[]),t(32,z=!1)}}function pp(){clearTimeout(so),so=setTimeout(dp,200)}function oo(_){t(24,F=_.id),t(27,P=_.path||_.title),t(23,D=!0),t(30,X=""),t(31,W=[]),t(32,z=!1),qn()}function ro(){t(24,F=""),t(23,D=!1),t(27,P=""),t(30,X=""),t(31,W=[]),t(32,z=!1),qn()}function mp(){t(21,M=""),t(22,I=""),t(24,F=""),t(23,D=!1),t(25,B="all"),t(26,U="all"),t(27,P=""),t(30,X=""),t(31,W=[]),t(32,z=!1),qn()}async function gp(_){try{if(!_||_.length===0)return;await Ap(_,"drop")}finally{It()}}function hp(_){return{note_created:v("event.noteCreated"),note_updated:v("event.noteUpdated"),note_deleted:v("event.noteDeleted"),file_added:v("event.fileAdded"),file_deleted:v("event.fileDeleted"),file_renamed:v("event.fileRenamed"),file_copied:v("event.fileCopied"),file_moved:v("event.fileMoved"),folder_added:v("event.folderAdded"),folder_deleted:v("event.folderDeleted"),folder_renamed:v("event.folderRenamed"),folder_moved:v("event.folderMoved"),node_created:v("event.caseCreated"),node_updated:v("event.caseUpdated"),node_deleted:v("event.nodeDeleted"),action_created:v("event.actionCreated"),action_done:v("event.actionDone"),worklog_added:v("event.worklogAdded")}[_]||_}function Qi(_){return{project:v("kind.project"),client:v("kind.client"),document:v("kind.document"),recipe:v("kind.recipe"),folder:v("kind.folder"),note:v("kind.note"),file:v("kind.file"),archive:v("kind.archive"),case:v("kind.case"),link:v("kind.link")}[_]||_||v("kind.case")}function _p(_){return _==="action"?v("kind.action"):Qi(_)}function bp(_){return _?v("capture.kind."+_):""}function vp(_){return _?v("capture.source."+_):""}function kp(_){const K=[];return _.captureKind&&K.push(bp(_.captureKind)),_.captureSource&&K.push(vp(_.captureSource)),_.captureContextLabel&&K.push(`${v("inbox.capturedIn")}: ${_.captureContextLabel}`),_.suggestedTargetLabel&&K.push(`${v("inbox.suggestedTarget")}: ${_.suggestedTargetLabel}`),K.push(Rn(_.capturedAt||_.createdAt)),K.filter(Boolean).join(" · ")}function wp(_){!_||!_.id||(t(3,ut=[_,...ut.filter(K=>K.id!==_.id)]),x&&(_.captureContextNodeId===x.id||_.suggestedTargetNodeId===x.id)&&t(66,$=[_,...$.filter(K=>K.id!==_.id)]))}function yp(){return x&&x.id?{contextType:"node",nodeId:x.id,suggestedTargetNodeId:x.id}:Y?{contextType:"section",section:Y}:{contextType:"global",section:"root"}}function Zn(){return JSON.stringify(yp())}function Ep(){return x&&x.id?v("capture.dropOverlayNode",{title:x.title}):v("capture.dropOverlayGlobal")}async function pl(_=null){_&&wp(_),Y==="inbox"&&t(3,ut=await de("ListInboxNodes")||ut)}async function Tp(_,K){const ue=String(_||"").trim();if(!ue)return null;const Ie=gs(ue),Ue=Ie?await de("CaptureURLWithContext",Ie,"",K,Zn()):await de("CaptureTextWithContext",ue,K,Zn());return await pl(Ue),Ue}async function ao(_,K,ue){const Ie=String(_||"").trim();if(!Ie)return null;const Ue=await de("CaptureURLWithContext",Ie,K||"",ue,Zn());return await pl(Ue),Ue}async function Sp(_,K){if(!_)return null;const ue=_.path||_.webkitRelativePath||"";if(ue){const St=await de("CapturePathWithContext",ue,K,Zn());return await pl(St),St}const Ie=await My(_),Ue=await de("CaptureFileDataWithContext",_.name||`clipboard.${Iy(_.type)}`,Ie,K,Zn());return await pl(Ue),Ue}async function xi(_,K){var Ao,No,Ro;if(!_)return!1;let ue=!1;const Ie=Array.from(_.files||[]);for(const Xn of Ie)await Sp(Xn,K),ue=!0;const Ue=(Ao=_.getData)==null?void 0:Ao.call(_,"text/x-moz-url");if(Ue){const Xn=Ly(Ue),zl=Xn?gs(Xn.url):"";if(zl)return await ao(zl,Xn.title,K),!0}const St=(No=_.getData)==null?void 0:No.call(_,"text/uri-list");if(St){const Xn=Dy(St),zl=gs(Xn);if(zl)return await ao(zl,"",K),!0}const ci=(Ro=_.getData)==null?void 0:Ro.call(_,"text/plain");return String(ci||"").trim()&&(await Tp(ci,K),ue=!0),ue}async function Cp(){if(!ee){t(68,we=""),t(67,ee=!0);try{const _=await de("CaptureClipboardTextWithContext",Zn());await pl(_),t(68,we=v("inbox.captured"))}catch(_){t(35,q=String(_).includes("clipboard is empty")?v("inbox.clipboardEmpty"):v("inbox.clipboardUnavailable"))}finally{t(67,ee=!1)}}}async function Ap(_,K="drop"){if(!ee){t(67,ee=!0),t(68,we="");try{for(const ue of _){const Ie=await de("CapturePathWithContext",ue,K,Zn());await pl(Ie)}t(68,we=v("inbox.captured"))}catch(ue){t(35,q=String(ue))}finally{t(67,ee=!1),inboxDropValid=!1}}}async function co(_){if(!(p||m)&&!wi(_.target)&&_.clipboardData)try{await xi(_.clipboardData,"paste")&&(_.preventDefault(),t(68,we=v("inbox.captured")))}catch(K){t(35,q=String(K))}}function uo(_){return vf(_)?(captureDropLabel=Ep(),captureDropActive=!0,lastCaptureDragOverAt=Date.now(),Pd(),!0):!1}function fo(_){uo(_.dataTransfer)&&(captureDragDepth+=1)}function po(_){uo(_.dataTransfer)&&(_.preventDefault(),_.dataTransfer.dropEffect="copy")}async function mo(_){if(vf(_.dataTransfer)){_.preventDefault();try{await xi(_.dataTransfer,"drop")&&t(68,we=v("inbox.captured"))}catch(K){t(35,q=String(K))}finally{It()}}}async function Np(_){_.preventDefault(),_.stopPropagation();try{await xi(_.dataTransfer,"drop")&&t(68,we=v("inbox.captured"))}catch(K){t(35,q=String(K))}finally{It()}}function oi(_){t(100,on=_),t(101,hn=""),t(102,_n=[]),t(103,rn=null)}function $i(){t(100,on=null),t(101,hn=""),t(102,_n=[]),t(103,rn=null),t(104,fl=!1)}async function Rp(){const _=hn.trim();if(!_||_.length<2){t(102,_n=[]);return}t(104,fl=!0);try{const K=await de("SearchNodes",_)||[];t(102,_n=K.filter(ue=>zy(ue)&&ue.id!==(on==null?void 0:on.id)))}catch{t(102,_n=[])}finally{t(104,fl=!1)}}function Ip(_){t(101,hn=_.target.value),t(103,rn=null),clearTimeout(Ml),Ml=setTimeout(Rp,200)}function go(_){t(103,rn=_),t(101,hn=_.path||_.title),t(102,_n=[])}async function ho(){if(!(!on||!rn))try{await _o(on,rn.id),$i()}catch(_){t(35,q=String(_))}}async function _o(_,K){!_||!K||(await de("ResolveInboxNode",_.id,K),t(3,ut=ut.filter(ue=>ue.id!==_.id)),t(66,$=$.filter(ue=>ue.id!==_.id)),await Kn(),x&&await At(x.id))}async function ri(_){const K=(_==null?void 0:_.suggestedTargetNodeId)||(x==null?void 0:x.id)||"";if(K)try{await _o(_,K)}catch(ue){t(35,q=String(ue))}}function ai(_){an({title:v("inbox.deleteTitle"),message:v("inbox.deleteConfirm",{title:_.title}),confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteInboxNode",_.id),t(3,ut=ut.filter(K=>K.id!==_.id)),t(66,$=$.filter(K=>K.id!==_.id))}catch(K){t(35,q=String(K))}}})}function bo(_){t(70,Nt=_),t(71,ct=_.title||""),t(72,yt=_.url||""),t(73,Vt=_.note||""),t(74,dn="")}function es(){t(70,Nt=null),t(71,ct=""),t(72,yt=""),t(73,Vt=""),t(74,dn="")}async function Mp(){if(!(!Nt||!yt.trim()))try{const _=await de("UpdateLink",Nt.id,ct.trim(),yt.trim(),Vt);t(69,Lt=Lt.map(K=>K.id===_.id?_:K)),es()}catch(_){t(74,dn=String(_))}}async function vo(_){an({title:v("links.deleteTitle"),message:v("links.deleteConfirm",{title:_.title}),confirmText:v("common.delete"),danger:!0,onConfirm:async()=>{try{await de("DeleteLink",_.id),t(69,Lt=Lt.filter(K=>K.id!==_.id))}catch(K){t(35,q=String(K))}}})}async function ko(_){try{await de("OpenLink",_.id)}catch(K){t(35,q=String(K))}}async function wo(_){var K,ue;try{await((ue=(K=navigator.clipboard)==null?void 0:K.writeText)==null?void 0:ue.call(K,_.url)),t(74,dn=v("links.copied"))}catch{t(74,dn=v("links.copyUnavailable"))}}function Lp(){t(87,Hn=!0),t(88,mn=""),t(89,Wn="open_url"),t(90,gn="")}function yo(){t(87,Hn=!1),t(88,mn=""),t(90,gn="")}async function ts(){if(!(!mn.trim()||!gn.trim()||!x))try{const _=await de("CreateAction",x.id,Wn,mn.trim(),gn.trim());_&&_.id&&t(49,Te=[...Te,_]),t(87,Hn=!1),t(88,mn=""),t(90,gn="")}catch(_){t(35,q=String(_))}}async function Eo(_){try{await de("DeleteAction",_),t(49,Te=Te.filter(K=>K.id!==_))}catch(K){t(35,q=String(K))}}function Dp(_){const K=xt.find(ue=>ue.id===_);return K?K.label:_}async function Pl(_){try{const K=await de("GetNodeDetail",_);K&&Tt(K)}catch(K){t(35,q=String(K))}}async function Yn(_){const K=By(_),ue=K.nodeId;if(ue)try{const Ie=await de("GetNodeDetail",ue);if(!Ie)return;if(Tt(Ie),K.tab==="notes"){if(gt("notes"),K.targetId){try{t(37,le=await de("ListNotes",ue)||[])}catch{}const Ue=le.find(St=>St.id===K.targetId);Ue&&setTimeout(()=>Dn(Ue),100)}}else if(K.tab==="files")if(gt("files"),K.targetId)try{const Ue=await de("GetNodeDetail",K.targetId);if(Ue&&Ue.parent_id){await loadFolder(Ue.parent_id);const St=fileItems.find(ci=>ci.id===K.targetId);St&&St.type==="file"&&ss(St)&&setTimeout(()=>openPreview(St),150)}else await loadFolder(ue)}catch{await loadFolder(ue)}else await loadFolder(ue)}catch(Ie){t(35,q=String(Ie))}}async function ml(_){return Yn(_)}async function Op(_){if(!(!_||!_.nodeId))try{if(_.type==="link"){const ue=await de("GetNodeDetail",_.nodeId);ue&&(await Tt(ue),gt("links"));return}if(_.type==="action"){const ue=await de("GetNodeDetail",_.nodeId);ue&&(await Tt(ue),gt("actions"));return}const K=await de("GetNodeDetail",_.nodeId);if(!K)return;if(_.type==="note"){const ue=K.parent_id||K.parentId||"",Ie=ue?await de("GetNodeDetail",ue):null;if(Ie){await Tt(Ie),gt("notes"),t(37,le=await de("ListNotes",Ie.id)||[]);const Ue=le.find(St=>St.id===K.id);Ue&&await Dn(Ue)}return}if(_.type==="file"){const ue=K.parent_id||K.parentId||"",Ie=ue?await de("GetNodeDetail",ue):null;if(Ie){await Tt(Ie),gt("files"),await loadFolder(Ie.id);const Ue=fileItems.find(St=>St.id===K.id);Ue&&ss(Ue)&&await openPreview(Ue)}return}if(_.type==="folder"){await Tt(K),gt("files"),await loadFolder(K.id);return}await Tt(K)}catch(K){t(35,q=String(K))}}async function ns(){try{t(105,Ll=await de("SyncStatus"))}catch{t(105,Ll={configured:!1,serverUrl:"",deviceId:"",unpushedOps:0,lastSyncAt:"",syncInterval:0})}}let To="general";function ls(_){t(109,To=_||"general"),t(14,g=!0)}function So(){t(14,g=!1)}async function Pp(){try{t(0,h=await de("ListSystemViewsWithPlugins")||[])}catch{}}function zp(_){const K=Array.isArray(_==null?void 0:_.conflicts)?_.conflicts:[],ue=Array.isArray(_==null?void 0:_.applyErrors)?_.applyErrors:[],Ie=[];return K.length>0&&Ie.push(v("sync.conflictsCount",{count:K.length})),ue.length>0&&Ie.push(v("sync.applyErrorsCount",{count:ue.length})),Ie.join(" · ")}async function Bp(){t(106,Dl=!0),t(107,Ln=""),t(108,An="");try{const _=await de("SyncNow");await ns(),t(107,Ln=zp(_)),t(108,An=Ln?"warning":"")}catch(_){console.error("sync error:",_),t(107,Ln=`${v("sync.status.error")}: ${(_==null?void 0:_.message)||_}`),t(108,An="warning")}finally{t(106,Dl=!1)}}function Fp(_){t(12,p=!1),t(11,u=_),t(91,Sn=!1),window.location.reload()}function jp(_){t(13,m=!1),t(11,u=_),t(91,Sn=!1),window.location.reload()}const Up=_=>_.nodeId===x.id,Hp=_=>Ut(_.id),Wp=()=>ls("sync"),Gp=()=>ls(),Kp=()=>qi(Rt),Vp=()=>Zi(Rt),qp=()=>de("OpenTrashFolder"),Zp=()=>t(35,q="");function Yp(){be=this.value,t(48,be)}const Xp=_=>{_.key==="Enter"&&Hi(),_.key==="Escape"&&On()},Jp=()=>Ui(ie.id,ie.title);function Qp(_){En[_?"unshift":"push"](()=>{me=_,t(39,me)})}const xp=_=>gt(_.id),$p=_=>gt(_.detail),em=_=>Dn(_.detail.note),tm=()=>{gt("notes"),Js()},nm=()=>{gt("files"),addFile()},lm=_=>{t(86,Yt=_.detail.title),xs()},im=_=>Dn(_.detail.note),sm=_=>Ui(_.detail.note.id,_.detail.note.title),om=_=>eo(_.detail.note);function rm(_){En[_?"unshift":"push"](()=>{c=_,t(10,c)})}const am=_=>Dn(_.detail.note),cm=_=>Xs(_.detail.nodeId),um=_=>{t(35,q=_.detail.message)},fm=_=>Bi(_.detail.id,_.detail.name),dm=_=>an(_.detail),pm=_=>ri(_),mm=_=>oi(_),gm=_=>cn(_),hm=_=>Nn(_),_m=_=>ai(_),bm=_=>cn(_),vm=(_,K)=>K.key==="Enter"&&cn(_),km=_=>ko(_),wm=_=>wo(_),ym=_=>bo(_),Em=_=>vo(_),Tm=_=>de("RunAction",_.id),Sm=_=>Eo(_.id),Cm=()=>ti(),Am=_=>_.nodeId===x.id,Nm=_=>li(_),Rm=_=>Yi(_),Im=_=>ii(_),Mm=(_,K,ue)=>t(60,K[ue]._expanded=!_._expanded,he,t(2,x)),Lm=(_,K,ue,Ie)=>Ie.key==="Enter"&&t(60,K[ue]._expanded=!_._expanded,he,t(2,x)),Dm=_=>Yn(_),Om=_=>Nn(_.nodeId),Pm=_=>ti(_),zm=_=>Gi(_),Bm=_=>Yn(_),Fm=_=>Nn(_.nodeId),jm=_=>Ji(_),Um=(_,K)=>K.key==="Enter"&&Ji(_),Hm=_=>ml(_),Wm=(_,K)=>K.key==="Enter"&&ml(_),Gm=()=>{t(4,Ke="date"),t(5,pt=Ke==="date"&&pt==="desc"?"asc":"desc")},Km=()=>{t(4,Ke="name"),t(5,pt=Ke==="name"&&pt==="desc"?"asc":"desc")},Vm=()=>{t(4,Ke="type"),t(5,pt=Ke==="type"&&pt==="desc"?"asc":"desc")};function qm(){Mt=this.checked,t(6,Mt)}const Zm=_=>ri(_),Ym=_=>oi(_),Xm=_=>cn(_),Jm=_=>Nn(_),Qm=_=>ai(_),xm=_=>cn(_),$m=(_,K)=>K.key==="Enter"&&cn(_),eg=_=>ri(_),tg=_=>oi(_),ng=_=>cn(_),lg=_=>Nn(_),ig=_=>ai(_),sg=_=>cn(_),og=(_,K)=>K.key==="Enter"&&cn(_),rg=_=>lo(_.id),ag=_=>_.type!=="file"?dl(_):gi(_),cg=(_,K)=>K.key==="Enter"&&(_.type!=="file"?dl(_):gi(_)),ug=_=>_.type!=="file"?dl(_):gi(_),fg=(_,K)=>K.key==="Enter"&&(_.type!=="file"?dl(_):gi(_)),dg=_=>qi(Vi(_.id)),pg=_=>Zi(Vi(_.id)),mg=()=>t(29,V="suggestions"),gg=()=>t(29,V="worklog"),hg=_=>Pl(_.nodeId),_g=(_,K,ue,Ie)=>t(60,K[ue].suggestedMin=parseInt(Ie.target.value),he),bg=_=>li(_),vg=_=>io(_),kg=_=>ii(_),wg=(_,K,ue)=>t(60,K[ue]._expanded=!_._expanded,he),yg=(_,K,ue,Ie)=>Ie.key==="Enter"&&t(60,K[ue]._expanded=!_._expanded,he),Eg=_=>Yn(_),Tg=_=>Nn(_.nodeId),Sg=()=>si("csv"),Cg=()=>si("markdown"),Ag=()=>si("pdf");function Ng(){M=this.value,t(21,M)}function Rg(){I=this.value,t(22,I)}const Ig=()=>{t(30,X=""),t(27,P=""),ro()};function Mg(){X=this.value,t(30,X)}const Lg=()=>setTimeout(()=>t(32,z=!1),200),Dg=_=>oo(_);function Og(){D=this.checked,t(23,D)}function Pg(){B=vi(this),t(25,B)}function zg(){U=vi(this),t(26,U)}const Bg=_=>Pl(_.nodeId),Fg=_=>Xi(_),jg=(_,K)=>K.key==="Enter"&&Xi(_),Ug=_=>ti(_),Hg=_=>Gi(_),Wg=_=>Yn(_),Gg=_=>Pl(_),Kg=_=>ml(_),Vg=_=>Yn(_),qg=_=>li(_),Zg=_=>Yi(_),Yg=_=>ii(_),Xg=_=>Nn(_),Jg=_=>cn(_),Qg=_=>{Ut("trash"),dl({id:_,title:""}),Vn()},xg=_=>ml(_),$g=(_,K)=>K.key==="Enter"&&ml(_),e1=()=>t(83,qt=null),t1=_=>t(83,qt=_);function n1(){Ft=this.value,t(81,Ft)}const l1=_=>_.key==="Enter"&&Vs(),i1=_=>Gs(_),s1=()=>Ys(Zt.node),o1=()=>qs(Zt.node),r1=()=>Zs(Zt.node),a1=()=>Nn(Zt.node);function c1(){je=this.value,t(54,je)}function u1(){Ce=this.value,t(52,Ce)}function f1(){Fe=Sl(this.value),t(53,Fe)}function d1(){Ge=this.value,t(55,Ge)}function p1(){Pe=this.checked,t(56,Pe)}function m1(){fe=this.checked,t(57,fe)}function g1(){mn=this.value,t(88,mn)}const h1=_=>_.key==="Enter"&&ts();function _1(){Wn=vi(this),t(89,Wn),t(113,xt)}function b1(){gn=this.value,t(90,gn)}const v1=_=>_.key==="Enter"&&ts();function k1(){en=this.value,t(98,en)}function w1(){hn=this.value,t(101,hn)}const y1=_=>_.key==="Enter"&&rn&&ho(),E1=_=>go(_);function T1(){ct=this.value,t(71,ct)}function S1(){yt=this.value,t(72,yt)}function C1(){Vt=this.value,t(73,Vt)}const A1=_=>de("OpenFile",_.detail);function N1(){Ye=this.value,t(42,Ye)}const R1=_=>{_.key==="Enter"&&ji(),_.key==="Escape"&&t(41,ze=!1)};function I1(){Re=this.value,t(43,Re)}const M1=_=>{_.key==="Enter"&&ji(),_.key==="Escape"&&t(41,ze=!1)},L1=()=>t(41,ze=!1),D1=()=>t(41,ze=!1),O1=_=>_.key==="Escape"&&t(41,ze=!1);function P1(){be=this.value,t(48,be)}const z1=_=>{_.key==="Enter"&&Hi(),_.key==="Escape"&&On()},B1=_=>_.key==="Escape"&&On();return n.$$.update=()=>{var _;n.$$.dirty[0]&384&&t(77,ul=Ry((zt==null?void 0:zt.nodes)||[],Bt)),n.$$.dirty[0]&7&&t(112,l=x?x.title:Y?((_=h.find(K=>K.id===Y))==null?void 0:_.label)||"":v("nav.selectPrompt")),n.$$.dirty[0]&4&&t(111,i=x?Qi(x.type):""),n.$$.dirty[0]&56&&t(9,o=Ty(ut,Ke,pt)),n.$$.dirty[0]&576&&t(110,s=Mt?Z(o):null),n.$$.dirty[7]&16&&t(78,xl=ht.length===0?v("nav.trash"):[v("nav.trash"),...ht.map(K=>K.title)].join(" / "))},t(79,In=((Co=sp())==null?void 0:Co.title)||v("trash.deletedNodes")),[h,Y,x,ut,Ke,pt,Mt,zt,Bt,o,c,u,p,m,g,b,k,E,y,A,R,M,I,D,F,B,U,P,H,V,X,W,z,O,G,q,ne,le,ie,me,Ne,ze,Ye,Re,te,re,Ae,Be,be,Te,nt,De,Ce,Fe,je,Ge,Pe,fe,ge,Q,he,_e,Me,rt,Qe,xe,$,ee,we,Lt,Nt,ct,yt,Vt,dn,cl,Rt,ul,xl,In,ft,Ft,Tn,qt,Zt,pn,Yt,Hn,mn,Wn,gn,Sn,$t,$l,ei,Rl,Il,ln,en,jt,on,hn,_n,rn,fl,Ll,Dl,Ln,An,To,s,i,l,xt,Ol,gt,Ut,Tt,Bi,Ws,zd,Bd,an,Fd,jd,Gs,Ud,Ks,Vs,Hd,Gn,Wd,Gd,Kd,qs,Zs,Nn,cn,Ys,Xs,Js,Qs,xs,Dn,eo,to,Vd,ji,Yd,Xd,Ui,On,Hi,Jd,ep,tp,np,lp,ti,no,ip,Gi,Vn,dl,op,lo,Vi,qi,Zi,rp,li,ii,ap,cp,up,fp,Yi,io,qn,si,Xi,Ji,pp,oo,ro,mp,hp,Qi,_p,kp,Cp,Np,oi,$i,Ip,go,ho,ri,ai,bo,es,Mp,vo,ko,wo,Lp,yo,ts,Eo,Dp,Pl,Yn,ml,Op,ns,ls,So,Pp,Bp,Fp,jp,ht,Up,Hp,Wp,Gp,Kp,Vp,qp,Zp,Yp,Xp,Jp,Qp,xp,$p,em,tm,nm,lm,im,sm,om,rm,am,cm,um,fm,dm,pm,mm,gm,hm,_m,bm,vm,km,wm,ym,Em,Tm,Sm,Cm,Am,Nm,Rm,Im,Mm,Lm,Dm,Om,Pm,zm,Bm,Fm,jm,Um,Hm,Wm,Gm,Km,Vm,qm,Zm,Ym,Xm,Jm,Qm,xm,$m,eg,tg,ng,lg,ig,sg,og,rg,ag,cg,ug,fg,dg,pg,mg,gg,hg,_g,bg,vg,kg,wg,yg,Eg,Tg,Sg,Cg,Ag,Ng,Rg,Ig,Mg,Lg,Dg,Og,Pg,zg,Bg,Fg,jg,Ug,Hg,Wg,Gg,Kg,Vg,qg,Zg,Yg,Xg,Jg,Qg,xg,$g,e1,t1,n1,l1,i1,s1,o1,r1,a1,c1,u1,f1,d1,p1,m1,g1,h1,_1,b1,v1,k1,w1,y1,E1,T1,S1,C1,A1,N1,R1,I1,M1,L1,D1,O1,P1,z1,B1]}class jy extends tt{constructor(e){super(),et(this,e,Fy,Ey,$e,{},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}}new jy({target:document.getElementById("app")});