verstak/cmd/verstak-gui/frontend-dist/assets/main-DMZ01wSM.js

4 lines
66 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var Yl=Object.defineProperty;var Ql=(n,e,t)=>e in n?Yl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var De=(n,e,t)=>Ql(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 s of i)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&l(r)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function l(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();function K(){}function Ut(n){return n()}function tt(){return Object.create(null)}function se(n){n.forEach(Ut)}function Zt(n){return typeof n=="function"}function Me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Le;function Ie(n,e){return n===e?!0:(Le||(Le=document.createElement("a")),Le.href=e,n===Le.href)}function xl(n){return Object.keys(n).length===0}function $l(n){return n??""}function a(n,e){n.appendChild(e)}function k(n,e,t){n.insertBefore(e,t||null)}function m(n){n.parentNode&&n.parentNode.removeChild(n)}function ue(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function f(n){return document.createElement(n)}function W(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function I(n){return document.createTextNode(n)}function j(){return I(" ")}function ae(){return I("")}function O(n,e,t,l){return n.addEventListener(e,t,l),()=>n.removeEventListener(e,t,l)}function pe(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function We(n){return function(e){e.target===this&&n.call(this,e)}}function o(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Xt(n){return n===""?null:+n}function en(n){return Array.from(n.childNodes)}function G(n,e){e=""+e,n.data!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function lt(n,e,t){for(let l=0;l<n.options.length;l+=1){const i=n.options[l];if(i.__value===e){i.selected=!0;return}}(!t||e!==void 0)&&(n.selectedIndex=-1)}function tn(n){const e=n.querySelector(":checked");return e&&e.__value}function ln(n,e,{bubbles:t=!1,cancelable:l=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:l})}let Ce;function je(n){Ce=n}function Re(){if(!Ce)throw new Error("Function called outside component initialization");return Ce}function Yt(n){Re().$$.on_mount.push(n)}function Qt(n){Re().$$.on_destroy.push(n)}function qe(){const n=Re();return(e,t,{cancelable:l=!1}={})=>{const i=n.$$.callbacks[e];if(i){const s=ln(e,t,{cancelable:l});return i.slice().forEach(r=>{r.call(n,s)}),!s.defaultPrevented}return!0}}function nn(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(l=>l.call(this,e))}const we=[],nt=[];let ge=[];const it=[],sn=Promise.resolve();let Ve=!1;function rn(){Ve||(Ve=!0,sn.then(xt))}function Pe(n){ge.push(n)}const He=new Set;let he=0;function xt(){if(he!==0)return;const n=Ce;do{try{for(;he<we.length;){const e=we[he];he++,je(e),on(e.$$)}}catch(e){throw we.length=0,he=0,e}for(je(null),we.length=0,he=0;nt.length;)nt.pop()();for(let e=0;e<ge.length;e+=1){const t=ge[e];He.has(t)||(He.add(t),t())}ge.length=0}while(we.length);for(;it.length;)it.pop()();Ve=!1,He.clear(),je(n)}function on(n){if(n.fragment!==null){n.update(),se(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Pe)}}function cn(n){const e=[],t=[];ge.forEach(l=>n.indexOf(l)===-1?e.push(l):t.push(l)),t.forEach(l=>l()),ge=e}const Fe=new Set;let de;function _e(){de={r:0,c:[],p:de}}function me(){de.r||se(de.c),de=de.p}function ne(n,e){n&&n.i&&(Fe.delete(n),n.i(e))}function ie(n,e,t,l){if(n&&n.o){if(Fe.has(n))return;Fe.add(n),de.c.push(()=>{Fe.delete(n),l&&(t&&n.d(1),l())}),n.o(e)}else l&&l()}function te(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function un(n,e){ie(n,1,1,()=>{e.delete(n.key)})}function an(n,e,t,l,i,s,r,c,u,d,_,b){let p=n.length,v=s.length,w=p;const g={};for(;w--;)g[n[w].key]=w;const y=[],N=new Map,B=new Map,R=[];for(w=v;w--;){const L=b(i,s,w),P=t(L);let C=r.get(P);C?R.push(()=>C.p(L,e)):(C=d(P,L),C.c()),N.set(P,y[w]=C),P in g&&B.set(P,Math.abs(w-g[P]))}const S=new Set,A=new Set;function T(L){ne(L,1),L.m(c,_),r.set(L.key,L),_=L.first,v--}for(;p&&v;){const L=y[v-1],P=n[p-1],C=L.key,E=P.key;L===P?(_=L.first,p--,v--):N.has(E)?!r.has(C)||S.has(C)?T(L):A.has(E)?p--:B.get(C)>B.get(E)?(A.add(C),T(L)):(S.add(E),p--):(u(P,r),p--)}for(;p--;){const L=n[p];N.has(L.key)||u(L,r)}for(;v;)T(y[v-1]);return se(R),y}function ye(n){n&&n.c()}function ve(n,e,t){const{fragment:l,after_update:i}=n.$$;l&&l.m(e,t),Pe(()=>{const s=n.$$.on_mount.map(Ut).filter(Zt);n.$$.on_destroy?n.$$.on_destroy.push(...s):se(s),n.$$.on_mount=[]}),i.forEach(Pe)}function ke(n,e){const t=n.$$;t.fragment!==null&&(cn(t.after_update),se(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function fn(n,e){n.$$.dirty[0]===-1&&(we.push(n),rn(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Ne(n,e,t,l,i,s,r=null,c=[-1]){const u=Ce;je(n);const d=n.$$={fragment:null,ctx:[],props:s,update:K,not_equal:i,bound:tt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:tt(),dirty:c,skip_bound:!1,root:e.target||u.$$.root};r&&r(d.root);let _=!1;if(d.ctx=t?t(n,e.props||{},(b,p,...v)=>{const w=v.length?v[0]:p;return d.ctx&&i(d.ctx[b],d.ctx[b]=w)&&(!d.skip_bound&&d.bound[b]&&d.bound[b](w),_&&fn(n,b)),p}):[],d.update(),_=!0,se(d.before_update),d.fragment=l?l(d.ctx):!1,e.target){if(e.hydrate){const b=en(e.target);d.fragment&&d.fragment.l(b),b.forEach(m)}else d.fragment&&d.fragment.c();e.intro&&ne(n.$$.fragment),ve(n,e.target,e.anchor),xt()}je(u)}class Se{constructor(){De(this,"$$");De(this,"$$set")}$destroy(){ke(this,1),this.$destroy=K}$on(e,t){if(!Zt(t))return K;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&&!xl(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const dn="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(dn);function pn(n){let e,t;return{c(){e=W("path"),t=W("polyline"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8")},m(l,i){k(l,e,i),k(l,t,i)},d(l){l&&(m(e),m(t))}}}function _n(n){let e,t,l,i,s;return{c(){e=W("path"),t=W("polyline"),l=W("line"),i=W("line"),s=W("polyline"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","16"),o(l,"y1","13"),o(l,"x2","8"),o(l,"y2","13"),o(i,"x1","16"),o(i,"y1","17"),o(i,"x2","8"),o(i,"y2","17"),o(s,"points","10 9 9 9 8 9")},m(r,c){k(r,e,c),k(r,t,c),k(r,l,c),k(r,i,c),k(r,s,c)},d(r){r&&(m(e),m(t),m(l),m(i),m(s))}}}function mn(n){let e,t;return{c(){e=W("polyline"),t=W("polyline"),o(e,"points","16 18 22 12 16 6"),o(t,"points","8 6 2 12 8 18")},m(l,i){k(l,e,i),k(l,t,i)},d(l){l&&(m(e),m(t))}}}function vn(n){let e,t,l,i;return{c(){e=W("path"),t=W("polyline"),l=W("line"),i=W("rect"),o(e,"d","M21 8v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8"),o(t,"points","7 3 12 8 17 3"),o(l,"x1","3"),o(l,"y1","8"),o(l,"x2","21"),o(l,"y2","8"),o(i,"x","10"),o(i,"y","12"),o(i,"width","4"),o(i,"height","4"),o(i,"rx","1")},m(s,r){k(s,e,r),k(s,t,r),k(s,l,r),k(s,i,r)},d(s){s&&(m(e),m(t),m(l),m(i))}}}function kn(n){let e,t,l,i,s;return{c(){e=W("path"),t=W("polyline"),l=W("line"),i=W("line"),s=W("line"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","9"),o(l,"y1","12"),o(l,"x2","15"),o(l,"y2","12"),o(i,"x1","9"),o(i,"y1","15"),o(i,"x2","13"),o(i,"y2","15"),o(s,"x1","12"),o(s,"y1","15"),o(s,"x2","12"),o(s,"y2","18")},m(r,c){k(r,e,c),k(r,t,c),k(r,l,c),k(r,i,c),k(r,s,c)},d(r){r&&(m(e),m(t),m(l),m(i),m(s))}}}function bn(n){let e,t,l,i,s,r;return{c(){e=W("path"),t=W("polyline"),l=W("line"),i=W("line"),s=W("line"),r=W("line"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","8"),o(l,"y1","12"),o(l,"x2","16"),o(l,"y2","12"),o(i,"x1","8"),o(i,"y1","16"),o(i,"x2","16"),o(i,"y2","16"),o(s,"x1","8"),o(s,"y1","14"),o(s,"x2","12"),o(s,"y2","14"),o(r,"x1","12"),o(r,"y1","12"),o(r,"x2","12"),o(r,"y2","18")},m(c,u){k(c,e,u),k(c,t,u),k(c,l,u),k(c,i,u),k(c,s,u),k(c,r,u)},d(c){c&&(m(e),m(t),m(l),m(i),m(s),m(r))}}}function hn(n){let e,t,l,i;return{c(){e=W("path"),t=W("polyline"),l=W("line"),i=W("line"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","16"),o(l,"y1","13"),o(l,"x2","8"),o(l,"y2","13"),o(i,"x1","16"),o(i,"y1","17"),o(i,"x2","8"),o(i,"y2","17")},m(s,r){k(s,e,r),k(s,t,r),k(s,l,r),k(s,i,r)},d(s){s&&(m(e),m(t),m(l),m(i))}}}function wn(n){let e,t,l,i,s;return{c(){e=W("path"),t=W("polyline"),l=W("line"),i=W("line"),s=W("line"),o(e,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),o(t,"points","14 2 14 8 20 8"),o(l,"x1","8"),o(l,"y1","12"),o(l,"x2","16"),o(l,"y2","12"),o(i,"x1","8"),o(i,"y1","16"),o(i,"x2","16"),o(i,"y2","16"),o(s,"x1","8"),o(s,"y1","14"),o(s,"x2","12"),o(s,"y2","14")},m(r,c){k(r,e,c),k(r,t,c),k(r,l,c),k(r,i,c),k(r,s,c)},d(r){r&&(m(e),m(t),m(l),m(i),m(s))}}}function gn(n){let e,t,l;return{c(){e=W("path"),t=W("circle"),l=W("circle"),o(e,"d","M9 18V5l12-2v13"),o(t,"cx","6"),o(t,"cy","18"),o(t,"r","3"),o(l,"cx","18"),o(l,"cy","16"),o(l,"r","3")},m(i,s){k(i,e,s),k(i,t,s),k(i,l,s)},d(i){i&&(m(e),m(t),m(l))}}}function yn(n){let e,t;return{c(){e=W("rect"),t=W("polyline"),o(e,"x","2"),o(e,"y","4"),o(e,"width","20"),o(e,"height","16"),o(e,"rx","2"),o(t,"points","10 9 16 12 10 15 10 9")},m(l,i){k(l,e,i),k(l,t,i)},d(l){l&&(m(e),m(t))}}}function jn(n){let e,t,l;return{c(){e=W("rect"),t=W("circle"),l=W("polyline"),o(e,"x","3"),o(e,"y","3"),o(e,"width","18"),o(e,"height","18"),o(e,"rx","2"),o(e,"ry","2"),o(t,"cx","8.5"),o(t,"cy","8.5"),o(t,"r","1.5"),o(l,"points","21 15 16 10 5 21")},m(i,s){k(i,e,s),k(i,t,s),k(i,l,s)},d(i){i&&(m(e),m(t),m(l))}}}function Cn(n){let e;return{c(){e=W("path"),o(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){k(t,e,l)},d(t){t&&m(e)}}}function Mn(n){let e;function t(s,r){return s[0]==="folder"?Cn:s[0]==="image"?jn:s[0]==="video"?yn:s[0]==="audio"?gn:s[0]==="pdf"?wn:s[0]==="document"?hn:s[0]==="spreadsheet"?bn:s[0]==="presentation"?kn:s[0]==="archive"?vn:s[0]==="code"?mn:s[0]==="text"?_n:pn}let l=t(n),i=l(n);return{c(){e=W("svg"),i.c(),o(e,"width",n[1]),o(e,"height",n[1]),o(e,"viewBox","0 0 24 24"),o(e,"fill","none"),o(e,"stroke","currentColor"),o(e,"stroke-width","1.5"),o(e,"stroke-linecap","round"),o(e,"stroke-linejoin","round"),o(e,"xmlns","http://www.w3.org/2000/svg")},m(s,r){k(s,e,r),i.m(e,null)},p(s,[r]){l!==(l=t(s))&&(i.d(1),i=l(s),i&&(i.c(),i.m(e,null))),r&2&&o(e,"width",s[1]),r&2&&o(e,"height",s[1])},i:K,o:K,d(s){s&&m(e),i.d()}}}function Nn(n,e,t){let{kind:l="generic"}=e,{size:i=20}=e;return n.$$set=s=>{"kind"in s&&t(0,l=s.kind),"size"in s&&t(1,i=s.size)},[l,i]}class $t extends Se{constructor(e){super(),Ne(this,e,Nn,Mn,Me,{kind:0,size:1})}}function Oe(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 Sn={"image/jpeg":"JPEG image","image/png":"PNG image","image/gif":"GIF image","image/webp":"WebP image","image/svg+xml":"SVG image","image/bmp":"BMP image","image/tiff":"TIFF image","image/avif":"AVIF image","application/pdf":"PDF document","application/msword":"Word document","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"Word document","application/vnd.ms-excel":"Excel spreadsheet","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"Excel spreadsheet","application/vnd.ms-powerpoint":"PowerPoint presentation","application/vnd.openxmlformats-officedocument.presentationml.presentation":"PowerPoint presentation","application/zip":"ZIP archive","application/gzip":"GZIP archive","application/x-tar":"TAR archive","application/x-7z-compressed":"7z archive","application/x-rar-compressed":"RAR archive","text/plain":"Text file","text/html":"HTML file","text/css":"CSS file","text/javascript":"JavaScript file","application/json":"JSON file","application/xml":"XML file","application/x-yaml":"YAML file","application/octet-stream":"Binary file","application/x-msdos-program":"Executable","inode/directory":"Folder"};function Te(n){return n?Sn[n]||n:"Unknown"}function el(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 En=["image/jpeg","image/png","image/gif","image/webp","image/bmp","image/tiff","image/avif","image/svg+xml"],Ln=["text/plain","text/html","text/css","text/javascript","application/json","application/xml","application/x-yaml","text/x-shellscript"],Fn=["txt","log","conf","ini","yaml","yml","json","xml","csv","sh","py","js","ts","css","html","md","markdown","cfg"],In=["jpg","jpeg","png","gif","webp","bmp","tiff","tif","avif","svg"];function tl(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return En.includes(e)||In.includes(l)}function ll(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return Ln.includes(e)||Fn.includes(l)&&l!=="md"&&l!=="markdown"}function nl(n){return(n.mime||"").toLowerCase().includes("pdf")}function il(n){const e=(n.name||"").toLowerCase();return e.endsWith(".md")||e.endsWith(".markdown")}function Pn(n){return tl(n)||nl(n)}function On(n){return ll(n)||il(n)}function Tn(n){let e,t=Oe(n[0].size)+"",l,i,s,r=n[0].mime&&st(n);return{c(){e=f("span"),l=I(t),i=j(),r&&r.c(),s=ae()},m(c,u){k(c,e,u),a(e,l),k(c,i,u),r&&r.m(c,u),k(c,s,u)},p(c,u){u&1&&t!==(t=Oe(c[0].size)+"")&&G(l,t),c[0].mime?r?r.p(c,u):(r=st(c),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(c){c&&(m(e),m(i),m(s)),r&&r.d(c)}}}function zn(n){let e;return{c(){e=f("span"),e.textContent="Folder"},m(t,l){k(t,e,l)},p:K,d(t){t&&m(e)}}}function st(n){let e,t,l,i=Te(n[0].mime)+"",s;return{c(){e=f("span"),e.textContent="·",t=j(),l=f("span"),s=I(i),o(e,"class","meta-sep svelte-vi5rh0")},m(r,c){k(r,e,c),k(r,t,c),k(r,l,c),a(l,s)},p(r,c){c&1&&i!==(i=Te(r[0].mime)+"")&&G(s,i)},d(r){r&&(m(e),m(t),m(l))}}}function An(n){let e,t,l;return{c(){e=f("button"),e.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path 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"></path><line x1="9" y1="14" x2="15" y2="14"></line></svg>',o(e,"class","action-btn svelte-vi5rh0"),o(e,"title","Open folder"),o(e,"aria-label","Open folder")},m(i,s){k(i,e,s),t||(l=O(e,"click",pe(n[4])),t=!0)},p:K,d(i){i&&m(e),t=!1,l()}}}function Bn(n){let e,t,l,i,s;return{c(){e=f("button"),e.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path><circle cx="12" cy="12" r="3"></circle></svg>',t=j(),l=f("button"),l.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>',o(e,"class","action-btn svelte-vi5rh0"),o(e,"title","Preview"),o(e,"aria-label","Preview"),o(l,"class","action-btn svelte-vi5rh0"),o(l,"title","Open in external program"),o(l,"aria-label","Open externally")},m(r,c){k(r,e,c),k(r,t,c),k(r,l,c),i||(s=[O(e,"click",pe(n[4])),O(l,"click",pe(n[6]))],i=!0)},p:K,d(r){r&&(m(e),m(t),m(l)),i=!1,se(s)}}}function rt(n){let e,t,l,i,s,r,c,u,d,_,b,p;return{c(){e=f("div"),t=j(),l=f("div"),i=f("button"),i.textContent="Rename",s=j(),r=f("button"),r.textContent="Duplicate",c=j(),u=f("button"),u.textContent="Cut",d=j(),_=f("button"),_.textContent="Copy",o(e,"class","menu-backdrop svelte-vi5rh0"),o(e,"role","presentation"),o(i,"class","menu-item svelte-vi5rh0"),o(i,"role","menuitem"),o(r,"class","menu-item svelte-vi5rh0"),o(r,"role","menuitem"),o(u,"class","menu-item svelte-vi5rh0"),o(u,"role","menuitem"),o(_,"class","menu-item svelte-vi5rh0"),o(_,"role","menuitem"),o(l,"class","menu svelte-vi5rh0"),o(l,"role","menu")},m(v,w){k(v,e,w),k(v,t,w),k(v,l,w),a(l,i),a(l,s),a(l,r),a(l,c),a(l,u),a(l,d),a(l,_),b||(p=[O(e,"click",pe(n[13])),O(i,"click",n[8]),O(r,"click",n[9]),O(u,"click",n[10]),O(_,"click",n[11]),O(l,"click",pe(n[15]))],b=!0)},p:K,d(v){v&&(m(e),m(t),m(l)),b=!1,se(p)}}}function Dn(n){let e,t,l,i,s,r,c=n[0].name+"",u,d,_,b,p,v,w,g,y,N,B,R,S,A,T,L,P,C,E,q;l=new $t({props:{kind:n[2],size:22}});function V(D,J){return D[3]?zn:Tn}let Z=V(n)(n);function U(D,J){return D[3]?An:Bn}let $=U(n)(n),Q=n[1]&&rt(n);return{c(){e=f("div"),t=f("div"),ye(l.$$.fragment),i=j(),s=f("div"),r=f("div"),u=I(c),_=j(),b=f("div"),Z.c(),p=j(),v=f("div"),$.c(),w=j(),g=f("button"),y=W("svg"),N=W("circle"),B=W("circle"),R=W("circle"),S=j(),A=f("button"),A.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path 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"></path></svg>',L=j(),Q&&Q.c(),P=ae(),o(t,"class","file-row-icon svelte-vi5rh0"),o(r,"class","file-row-name svelte-vi5rh0"),o(r,"title",d=n[0].name),o(b,"class","file-row-meta svelte-vi5rh0"),o(s,"class","file-row-body svelte-vi5rh0"),o(N,"cx","12"),o(N,"cy","5"),o(N,"r","2"),o(B,"cx","12"),o(B,"cy","12"),o(B,"r","2"),o(R,"cx","12"),o(R,"cy","19"),o(R,"r","2"),o(y,"width","16"),o(y,"height","16"),o(y,"viewBox","0 0 24 24"),o(y,"fill","currentColor"),o(g,"class","action-btn svelte-vi5rh0"),o(g,"title","More actions"),o(g,"aria-label","More actions"),o(g,"aria-expanded",n[1]),o(A,"class","action-btn action-btn-danger svelte-vi5rh0"),o(A,"title","Delete"),o(A,"aria-label","Delete"),o(v,"class","file-row-actions svelte-vi5rh0"),o(e,"class","file-row svelte-vi5rh0"),o(e,"role","button"),o(e,"tabindex","0"),o(e,"aria-label",T=n[3]?`Open folder ${n[0].name}`:`Preview ${n[0].name}`)},m(D,J){k(D,e,J),a(e,t),ve(l,t,null),a(e,i),a(e,s),a(s,r),a(r,u),a(s,_),a(s,b),Z.m(b,null),a(e,p),a(e,v),$.m(v,null),a(v,w),a(v,g),a(g,y),a(y,N),a(y,B),a(y,R),a(v,S),a(v,A),k(D,L,J),Q&&Q.m(D,J),k(D,P,J),C=!0,E||(q=[O(window,"click",n[13]),O(g,"click",pe(n[12])),O(A,"click",pe(n[7])),O(e,"click",n[4]),O(e,"keydown",n[5])],E=!0)},p(D,[J]){(!C||J&1)&&c!==(c=D[0].name+"")&&G(u,c),(!C||J&1&&d!==(d=D[0].name))&&o(r,"title",d),Z.p(D,J),$.p(D,J),(!C||J&2)&&o(g,"aria-expanded",D[1]),(!C||J&1&&T!==(T=D[3]?`Open folder ${D[0].name}`:`Preview ${D[0].name}`))&&o(e,"aria-label",T),D[1]?Q?Q.p(D,J):(Q=rt(D),Q.c(),Q.m(P.parentNode,P)):Q&&(Q.d(1),Q=null)},i(D){C||(ne(l.$$.fragment,D),C=!0)},o(D){ie(l.$$.fragment,D),C=!1},d(D){D&&(m(e),m(L),m(P)),ke(l),Z.d(),$.d(),Q&&Q.d(D),E=!1,se(q)}}}function Hn(n,e,t){let{item:l}=e,{clipboardItems:i=[]}=e;const s=qe(),r=el(l),c=l.type==="folder";let u=!1;function d(){c?s("navigate",l.id):s("preview",l)}function _(S){S.key==="Enter"&&d()}function b(){s("openExternal",l.fileId)}function p(){s("delete",{id:l.id,type:l.type})}function v(){t(1,u=!1),s("rename",{id:l.id,name:l.name})}function w(){t(1,u=!1),s("duplicate",l.id)}function g(){t(1,u=!1),s("cut",l.id)}function y(){t(1,u=!1),s("copy",l.id)}function N(){t(1,u=!u)}function B(){t(1,u=!1)}function R(S){nn.call(this,n,S)}return n.$$set=S=>{"item"in S&&t(0,l=S.item),"clipboardItems"in S&&t(14,i=S.clipboardItems)},[l,u,r,c,d,_,b,p,v,w,g,y,N,B,i,R]}class Vn extends Se{constructor(e){super(),Ne(this,e,Hn,Dn,Me,{item:0,clipboardItems:14})}}function ot(n,e,t){const l=n.slice();return l[4]=e[t],l[6]=t,l}function Wn(n){let e;return{c(){e=f("span"),e.textContent="/",o(e,"class","sep svelte-csi2lb")},m(t,l){k(t,e,l)},d(t){t&&m(e)}}}function Rn(n){let e,t=n[4].name+"",l,i,s;function r(){return n[2](n[6])}return{c(){e=f("button"),l=I(t),o(e,"class","crumb crumb--link svelte-csi2lb")},m(c,u){k(c,e,u),a(e,l),i||(s=O(e,"click",r),i=!0)},p(c,u){n=c,u&1&&t!==(t=n[4].name+"")&&G(l,t)},d(c){c&&m(e),i=!1,s()}}}function qn(n){let e,t=n[4].name+"",l;return{c(){e=f("span"),l=I(t),o(e,"class","crumb crumb--current svelte-csi2lb")},m(i,s){k(i,e,s),a(e,l)},p(i,s){s&1&&t!==(t=i[4].name+"")&&G(l,t)},d(i){i&&m(e)}}}function ct(n){let e,t,l=n[6]>0&&Wn();function i(c,u){return c[6]===c[0].length-1?qn:Rn}let s=i(n),r=s(n);return{c(){l&&l.c(),e=j(),r.c(),t=ae()},m(c,u){l&&l.m(c,u),k(c,e,u),r.m(c,u),k(c,t,u)},p(c,u){s===(s=i(c))&&r?r.p(c,u):(r.d(1),r=s(c),r&&(r.c(),r.m(t.parentNode,t)))},d(c){c&&(m(e),m(t)),l&&l.d(c),r.d(c)}}}function Gn(n){let e,t=te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=ct(ot(n,t,i));return{c(){e=f("nav");for(let i=0;i<l.length;i+=1)l[i].c();o(e,"class","breadcrumbs svelte-csi2lb")},m(i,s){k(i,e,s);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(i,[s]){if(s&3){t=te(i[0]);let r;for(r=0;r<t.length;r+=1){const c=ot(i,t,r);l[r]?l[r].p(c,s):(l[r]=ct(c),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=t.length}},i:K,o:K,d(i){i&&m(e),ue(l,i)}}}function Kn(n,e,t){let{crumbs:l=[]}=e;const i=qe();function s(c){i("navigate",c)}const r=c=>s(c);return n.$$set=c=>{"crumbs"in c&&t(0,l=c.crumbs)},[l,s,r]}class sl extends Se{constructor(e){super(),Ne(this,e,Kn,Gn,Me,{crumbs:0})}}function Jn(n){let e,t,l,i,s,r;return{c(){e=f("div"),t=f("p"),t.textContent="Preview is not available for this file type.",l=j(),i=f("button"),i.textContent="Open in external program",o(i,"class","btn btn-sm svelte-1ybaoro"),o(e,"class","preview-status svelte-1ybaoro")},m(c,u){k(c,e,u),a(e,t),a(e,l),a(e,i),s||(r=O(i,"click",n[9]),s=!0)},p:K,d(c){c&&m(e),s=!1,r()}}}function Un(n){let e,t;function l(r,c){return c&2&&(e=null),e==null&&(e=!!(r[1]&&r[1].startsWith("data:"))),e?$n:xn}let i=l(n,-1),s=i(n);return{c(){s.c(),t=ae()},m(r,c){s.m(r,c),k(r,t,c)},p(r,c){i===(i=l(r,c))&&s?s.p(r,c):(s.d(1),s=i(r),s&&(s.c(),s.m(t.parentNode,t)))},d(r){r&&m(t),s.d(r)}}}function Zn(n){let e,t,l;return{c(){e=f("pre"),t=f("code"),l=I(n[1]),o(e,"class","preview-text svelte-1ybaoro")},m(i,s){k(i,e,s),a(e,t),a(t,l)},p(i,s){s&2&&G(l,i[1])},d(i){i&&m(e)}}}function Xn(n){let e,t,l,i;return{c(){e=f("div"),t=f("img"),Ie(t.src,l=n[1])||o(t,"src",l),o(t,"alt",i=n[0].name),o(t,"class","preview-image svelte-1ybaoro"),o(e,"class","preview-image-container svelte-1ybaoro")},m(s,r){k(s,e,r),a(e,t)},p(s,r){r&2&&!Ie(t.src,l=s[1])&&o(t,"src",l),r&1&&i!==(i=s[0].name)&&o(t,"alt",i)},d(s){s&&m(e)}}}function Yn(n){let e,t,l,i,s,r,c;return{c(){e=f("div"),t=f("p"),l=I(n[3]),i=j(),s=f("button"),s.textContent="Open in external program",o(s,"class","btn btn-sm svelte-1ybaoro"),o(e,"class","preview-status svelte-1ybaoro")},m(u,d){k(u,e,d),a(e,t),a(t,l),a(e,i),a(e,s),r||(c=O(s,"click",n[9]),r=!0)},p(u,d){d&8&&G(l,u[3])},d(u){u&&m(e),r=!1,c()}}}function Qn(n){let e;return{c(){e=f("div"),e.innerHTML="<p>Loading preview...</p>",o(e,"class","preview-status svelte-1ybaoro")},m(t,l){k(t,e,l)},p:K,d(t){t&&m(e)}}}function xn(n){let e,t,l,i,s,r;return{c(){e=f("div"),t=f("p"),t.textContent="PDF preview is not available in this environment.",l=j(),i=f("button"),i.textContent="Open in external program",o(i,"class","btn btn-sm svelte-1ybaoro"),o(e,"class","preview-status svelte-1ybaoro")},m(c,u){k(c,e,u),a(e,t),a(e,l),a(e,i),s||(r=O(i,"click",n[9]),s=!0)},p:K,d(c){c&&m(e),s=!1,r()}}}function $n(n){let e,t,l;return{c(){e=f("div"),t=f("embed"),Ie(t.src,l=n[1])||o(t,"src",l),o(t,"type","application/pdf"),o(t,"class","preview-pdf svelte-1ybaoro"),o(e,"class","preview-pdf-container svelte-1ybaoro")},m(i,s){k(i,e,s),a(e,t)},p(i,s){s&2&&!Ie(t.src,l=i[1])&&o(t,"src",l)},d(i){i&&m(e)}}}function ei(n){let e,t,l,i,s,r,c,u=n[0].name+"",d,_,b,p,v=Oe(n[0].size)+"",w,g,y=Te(n[0].mime)+"",N,B,R,S,A,T,L,P,C,E,q,V;s=new $t({props:{kind:n[8],size:18}});function x(z,$){return z[2]?Qn:z[3]?Yn:z[6]&&z[1]?Xn:z[5]&&z[1]?Zn:z[4]?Un:Jn}let Z=x(n),U=Z(n);return{c(){e=f("div"),t=f("div"),l=f("header"),i=f("div"),ye(s.$$.fragment),r=j(),c=f("span"),d=I(u),b=j(),p=f("div"),w=I(v),g=I(" · "),N=I(y),B=j(),R=f("div"),S=f("button"),S.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>',A=j(),T=f("button"),T.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',L=j(),P=f("div"),U.c(),o(c,"class","preview-name svelte-1ybaoro"),o(c,"title",_=n[0].name),o(i,"class","preview-title svelte-1ybaoro"),o(p,"class","preview-meta svelte-1ybaoro"),o(S,"class","action-btn svelte-1ybaoro"),o(S,"title","Open in external program"),o(S,"aria-label","Open externally"),o(T,"class","action-btn svelte-1ybaoro"),o(T,"title","Close"),o(T,"aria-label","Close preview"),o(R,"class","preview-actions svelte-1ybaoro"),o(l,"class","preview-header svelte-1ybaoro"),o(P,"class","preview-body svelte-1ybaoro"),o(t,"class","modal svelte-1ybaoro"),o(e,"class","overlay svelte-1ybaoro"),o(e,"role","dialog"),o(e,"aria-modal","true"),o(e,"aria-label",C=`Preview: ${n[0].name}`)},m(z,$){k(z,e,$),a(e,t),a(t,l),a(l,i),ve(s,i,null),a(i,r),a(i,c),a(c,d),a(l,b),a(l,p),a(p,w),a(p,g),a(p,N),a(l,B),a(l,R),a(R,S),a(R,A),a(R,T),a(t,L),a(t,P),U.m(P,null),E=!0,q||(V=[O(S,"click",n[9]),O(T,"click",n[10]),O(e,"click",We(n[11]))],q=!0)},p(z,[$]){(!E||$&1)&&u!==(u=z[0].name+"")&&G(d,u),(!E||$&1&&_!==(_=z[0].name))&&o(c,"title",_),(!E||$&1)&&v!==(v=Oe(z[0].size)+"")&&G(w,v),(!E||$&1)&&y!==(y=Te(z[0].mime)+"")&&G(N,y),Z===(Z=x(z))&&U?U.p(z,$):(U.d(1),U=Z(z),U&&(U.c(),U.m(P,null))),(!E||$&1&&C!==(C=`Preview: ${z[0].name}`))&&o(e,"aria-label",C)},i(z){E||(ne(s.$$.fragment,z),E=!0)},o(z){ie(s.$$.fragment,z),E=!1},d(z){z&&m(e),ke(s),U.d(),q=!1,se(V)}}}function ti(n,e,t){let l,i,s,{item:r}=e,{content:c=""}=e,{loading:u=!1}=e,{error:d=""}=e;const _=qe(),b=el(r);function p(y){y.key==="Escape"&&_("close")}function v(){_("openExternal",r.fileId)}Yt(()=>{window.addEventListener("keydown",p)}),Qt(()=>{window.removeEventListener("keydown",p)});const w=()=>_("close"),g=()=>_("close");return n.$$set=y=>{"item"in y&&t(0,r=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=tl(r)&&c&&c.startsWith("data:")),n.$$.dirty&1&&t(5,i=ll(r)||il(r)),n.$$.dirty&1&&t(4,s=nl(r))},[r,c,u,d,s,i,l,_,b,v,w,g]}class li extends Se{constructor(e){super(),Ne(this,e,ti,ei,Me,{item:0,content:1,loading:2,error:3})}}function ut(n,e,t){const l=n.slice();return l[105]=e[t],l}function at(n,e,t){const l=n.slice();return l[108]=e[t],l}function ft(n,e,t){const l=n.slice();return l[119]=e[t],l}function dt(n,e,t){const l=n.slice();return l[116]=e[t],l}function pt(n,e,t){const l=n.slice();return l[111]=e[t],l}function _t(n,e,t){const l=n.slice();return l[108]=e[t],l}function mt(n,e,t){const l=n.slice();return l[111]=e[t],l}function vt(n,e,t){const l=n.slice();return l[124]=e[t],l}function kt(n,e,t){const l=n.slice();return l[105]=e[t],l}function bt(n,e,t){const l=n.slice();return l[129]=e[t],l}function ht(n,e,t){const l=n.slice();return l[132]=e[t],l}function wt(n){let e,t=n[132].label+"",l,i,s,r,c;function u(){return n[63](n[132])}return{c(){e=f("button"),l=I(t),i=j(),o(e,"class",s="nav-item "+(n[4]===n[132].id?"selected":"")+" svelte-1rwjkun")},m(d,_){k(d,e,_),a(e,l),a(e,i),r||(c=O(e,"click",u),r=!0)},p(d,_){n=d,_[0]&1&&t!==(t=n[132].label+"")&&G(l,t),_[0]&17&&s!==(s="nav-item "+(n[4]===n[132].id?"selected":"")+" svelte-1rwjkun")&&o(e,"class",s)},d(d){d&&m(e),r=!1,c()}}}function gt(n){let e,t,l,i,s,r=n[1].length>0&&yt(n),c=te(n[1]),u=[];for(let _=0;_<c.length;_+=1)u[_]=jt(bt(n,c,_));let d=n[1].length===0&&Ct();return{c(){e=f("div"),t=f("div"),l=I("Дела "),r&&r.c(),i=j();for(let _=0;_<u.length;_+=1)u[_].c();s=j(),d&&d.c(),o(t,"class","nav-label svelte-1rwjkun"),o(e,"class","nav-group svelte-1rwjkun")},m(_,b){k(_,e,b),a(e,t),a(t,l),r&&r.m(t,null),a(e,i);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(e,null);a(e,s),d&&d.m(e,null)},p(_,b){if(_[1].length>0?r?r.p(_,b):(r=yt(_),r.c(),r.m(t,null)):r&&(r.d(1),r=null),b[0]&34|b[1]&4){c=te(_[1]);let p;for(p=0;p<c.length;p+=1){const v=bt(_,c,p);u[p]?u[p].p(v,b):(u[p]=jt(v),u[p].c(),u[p].m(e,s))}for(;p<u.length;p+=1)u[p].d(1);u.length=c.length}_[1].length===0?d||(d=Ct(),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},d(_){_&&m(e),r&&r.d(),ue(u,_),d&&d.d()}}}function yt(n){let e,t=n[1].length+"",l,i;return{c(){e=I("("),l=I(t),i=I(")")},m(s,r){k(s,e,r),k(s,l,r),k(s,i,r)},p(s,r){r[0]&2&&t!==(t=s[1].length+"")&&G(l,t)},d(s){s&&(m(e),m(l),m(i))}}}function jt(n){let e,t=n[129].title+"",l,i,s,r;function c(){return n[64](n[129])}return{c(){e=f("button"),l=I(t),o(e,"class",i="nav-item "+(n[5]&&n[5].id===n[129].id?"selected":"")+" svelte-1rwjkun")},m(u,d){k(u,e,d),a(e,l),s||(r=O(e,"click",c),s=!0)},p(u,d){n=u,d[0]&2&&t!==(t=n[129].title+"")&&G(l,t),d[0]&34&&i!==(i="nav-item "+(n[5]&&n[5].id===n[129].id?"selected":"")+" svelte-1rwjkun")&&o(e,"class",i)},d(u){u&&m(e),s=!1,r()}}}function Ct(n){let e;return{c(){e=f("div"),e.textContent="Нет дел",o(e,"class","nav-empty svelte-1rwjkun")},m(t,l){k(t,e,l)},d(t){t&&m(e)}}}function ni(n){let e;return{c(){e=f("span"),e.textContent="Выберите раздел или дело",o(e,"class","crumb placeholder svelte-1rwjkun")},m(t,l){k(t,e,l)},p:K,d(t){t&&m(e)}}}function ii(n){let e,t=te(n[0]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Mt(kt(n,t,i));return{c(){e=f("span");for(let i=0;i<l.length;i+=1)l[i].c();o(e,"class","crumb svelte-1rwjkun")},m(i,s){k(i,e,s);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(i,s){if(s[0]&17){t=te(i[0]);let r;for(r=0;r<t.length;r+=1){const c=kt(i,t,r);l[r]?l[r].p(c,s):(l[r]=Mt(c),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=t.length}},d(i){i&&m(e),ue(l,i)}}}function si(n){let e,t=n[5].title+"",l,i,s,r=n[5].type+"",c;return{c(){e=f("span"),l=I(t),i=j(),s=f("span"),c=I(r),o(e,"class","crumb svelte-1rwjkun"),o(s,"class","crumb-type svelte-1rwjkun")},m(u,d){k(u,e,d),a(e,l),k(u,i,d),k(u,s,d),a(s,c)},p(u,d){d[0]&32&&t!==(t=u[5].title+"")&&G(l,t),d[0]&32&&r!==(r=u[5].type+"")&&G(c,r)},d(u){u&&(m(e),m(i),m(s))}}}function Mt(n){let e=(n[105].id===n[4]?n[105].label:"")+"",t;return{c(){t=I(e)},m(l,i){k(l,t,i)},p(l,i){i[0]&17&&e!==(e=(l[105].id===l[4]?l[105].label:"")+"")&&G(t,e)},d(l){l&&m(t)}}}function Nt(n){let e,t,l,i,s,r;return{c(){e=f("div"),t=I(n[3]),l=j(),i=f("span"),i.textContent="✕",o(i,"class","dismiss svelte-1rwjkun"),o(e,"class","error-banner svelte-1rwjkun")},m(c,u){k(c,e,u),a(e,t),a(e,l),a(e,i),s||(r=O(e,"click",n[65]),s=!0)},p(c,u){u[0]&8&&G(t,c[3])},d(c){c&&m(e),s=!1,r()}}}function ri(n){let e,t,l;function i(c,u){if(c[18])return fi;if(c[0].length>0)return ai;if(c[3])return ui}let s=i(n),r=s&&s(n);return{c(){e=f("div"),t=f("h2"),t.textContent="Верстак",l=j(),r&&r.c(),o(t,"class","svelte-1rwjkun"),o(e,"class","welcome svelte-1rwjkun")},m(c,u){k(c,e,u),a(e,t),a(e,l),r&&r.m(e,null)},p(c,u){s===(s=i(c))&&r?r.p(c,u):(r&&r.d(1),r=s&&s(c),r&&(r.c(),r.m(e,null)))},i:K,o:K,d(c){c&&m(e),r&&r.d()}}}function oi(n){let e,t,l,i,s,r,c=te(n[31]),u=[];for(let p=0;p<c.length;p+=1)u[p]=St(vt(n,c,p));const d=[ki,vi,mi,_i,pi,di],_=[];function b(p,v){return p[6]==="overview"?0:p[6]==="notes"?1:p[6]==="files"?2:p[6]==="actions"?3:p[6]==="worklog"?4:p[6]==="activity"?5:-1}return~(i=b(n))&&(s=_[i]=d[i](n)),{c(){e=f("div");for(let p=0;p<u.length;p+=1)u[p].c();t=j(),l=f("div"),s&&s.c(),o(e,"class","tabs svelte-1rwjkun"),o(l,"class","tab-content svelte-1rwjkun")},m(p,v){k(p,e,v);for(let w=0;w<u.length;w+=1)u[w]&&u[w].m(e,null);k(p,t,v),k(p,l,v),~i&&_[i].m(l,null),r=!0},p(p,v){if(v[0]&41943136|v[1]&9|v[2]&1){c=te(p[31]);let g;for(g=0;g<c.length;g+=1){const y=vt(p,c,g);u[g]?u[g].p(y,v):(u[g]=St(y),u[g].c(),u[g].m(e,null))}for(;g<u.length;g+=1)u[g].d(1);u.length=c.length}let w=i;i=b(p),i===w?~i&&_[i].p(p,v):(s&&(_e(),ie(_[w],1,1,()=>{_[w]=null}),me()),~i?(s=_[i],s?s.p(p,v):(s=_[i]=d[i](p),s.c()),ne(s,1),s.m(l,null)):s=null)},i(p){r||(ne(s),r=!0)},o(p){ie(s),r=!1},d(p){p&&(m(e),m(t),m(l)),ue(u,p),~i&&_[i].d()}}}function ci(n){let e,t,l,i=n[8].title+"",s,r,c,u,d,_,b,p,v,w,g,y=n[8].dirty&&Vt();return{c(){e=f("div"),t=f("div"),l=f("span"),s=I(i),r=j(),y&&y.c(),c=j(),u=f("div"),d=f("button"),d.textContent="Сохранить",_=j(),b=f("button"),b.textContent="Закрыть",p=j(),v=f("textarea"),o(l,"class","note-title svelte-1rwjkun"),o(d,"class","btn btn-primary svelte-1rwjkun"),o(b,"class","btn svelte-1rwjkun"),o(u,"class","note-editor-actions svelte-1rwjkun"),o(t,"class","note-editor-header svelte-1rwjkun"),o(v,"class","note-textarea svelte-1rwjkun"),o(v,"placeholder","Начните писать..."),o(e,"class","note-editor svelte-1rwjkun")},m(N,B){k(N,e,B),a(e,t),a(t,l),a(l,s),a(t,r),y&&y.m(t,null),a(t,c),a(t,u),a(u,d),a(u,_),a(u,b),a(e,p),a(e,v),ce(v,n[8].content),w||(g=[O(d,"click",n[55]),O(b,"click",n[53]),O(v,"input",n[66]),O(v,"input",n[54])],w=!0)},p(N,B){B[0]&256&&i!==(i=N[8].title+"")&&G(s,i),N[8].dirty?y||(y=Vt(),y.c(),y.m(t,c)):y&&(y.d(1),y=null),B[0]&256&&ce(v,N[8].content)},i:K,o:K,d(N){N&&m(e),y&&y.d(),w=!1,se(g)}}}function ui(n){let e,t,l;return{c(){e=f("p"),t=I("Ошибка: "),l=I(n[3]),o(e,"class","error-text svelte-1rwjkun")},m(i,s){k(i,e,s),a(e,t),a(e,l)},p(i,s){s[0]&8&&G(l,i[3])},d(i){i&&m(e)}}}function ai(n){let e,t,l;return{c(){e=f("p"),e.textContent="Выберите раздел в боковой панели.",t=j(),l=f("p"),l.textContent="Или создайте новое дело кнопкой «+».",o(e,"class","svelte-1rwjkun"),o(l,"class","hint svelte-1rwjkun")},m(i,s){k(i,e,s),k(i,t,s),k(i,l,s)},p:K,d(i){i&&(m(e),m(t),m(l))}}}function fi(n){let e;return{c(){e=f("p"),e.textContent="Загрузка...",o(e,"class","svelte-1rwjkun")},m(t,l){k(t,e,l)},p:K,d(t){t&&m(e)}}}function St(n){let e,t=n[124].label+"",l,i,s;function r(){return n[67](n[124])}return{c(){e=f("button"),l=I(t),o(e,"class",$l(n[62](n[124].id))+" svelte-1rwjkun")},m(c,u){k(c,e,u),a(e,l),i||(s=O(e,"click",r),i=!0)},p(c,u){n=c},d(c){c&&m(e),i=!1,s()}}}function di(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Активность появится позже</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){k(t,e,l)},p:K,i:K,o:K,d(t){t&&m(e)}}}function pi(n){let e,t,l,i,s,r,c,u,d,_,b,p;function v(y,N){return y[10].length===0?hi:bi}let w=v(n),g=w(n);return{c(){e=f("div"),t=f("div"),l=f("input"),i=j(),s=f("input"),r=j(),c=f("button"),u=I("Записать"),_=j(),g.c(),o(l,"type","text"),o(l,"placeholder","Что сделано"),o(l,"class","svelte-1rwjkun"),o(s,"type","number"),o(s,"placeholder","Мин"),o(s,"min","1"),o(s,"class","svelte-1rwjkun"),o(c,"class","btn btn-primary svelte-1rwjkun"),c.disabled=d=!n[12].trim()||!n[11],o(t,"class","worklog-form svelte-1rwjkun"),o(e,"class","worklog-tab svelte-1rwjkun")},m(y,N){k(y,e,N),a(e,t),a(t,l),ce(l,n[12]),a(t,i),a(t,s),ce(s,n[11]),a(t,r),a(t,c),a(c,u),a(e,_),g.m(e,null),b||(p=[O(l,"input",n[86]),O(s,"input",n[87]),O(c,"click",n[56])],b=!0)},p(y,N){N[0]&4096&&l.value!==y[12]&&ce(l,y[12]),N[0]&2048&&Xt(s.value)!==y[11]&&ce(s,y[11]),N[0]&6144&&d!==(d=!y[12].trim()||!y[11])&&(c.disabled=d),w===(w=v(y))&&g?g.p(y,N):(g.d(1),g=w(y),g&&(g.c(),g.m(e,null)))},i:K,o:K,d(y){y&&m(e),g.d(),b=!1,se(p)}}}function _i(n){let e;function t(s,r){return s[9].length===0?gi:wi}let l=t(n),i=l(n);return{c(){i.c(),e=ae()},m(s,r){i.m(s,r),k(s,e,r)},p(s,r){l===(l=t(s))&&i?i.p(s,r):(i.d(1),i=l(s),i&&(i.c(),i.m(e.parentNode,e)))},i:K,o:K,d(s){s&&m(e),i.d(s)}}}function mi(n){let e,t,l,i,s,r,c,u,d,_,b,p,v,w,g,y,N,B,R,S=n[30].items.length>0&&Ft(n);const A=[ji,yi],T=[];function L(E,q){return E[22]?0:1}p=L(n),v=T[p]=A[p](n);let P=n[19]&&!n[21]&&Pt(),C=n[26]&&Ot(n);return{c(){e=f("div"),t=f("div"),l=f("button"),i=I("+ Добавить файл"),s=j(),r=f("button"),c=I("+ Добавить папку"),u=j(),d=f("button"),d.textContent="+ Новый файл",_=j(),S&&S.c(),b=j(),v.c(),w=j(),P&&P.c(),g=j(),C&&C.c(),y=ae(),o(l,"class","btn btn-primary svelte-1rwjkun"),l.disabled=n[19],o(r,"class","btn svelte-1rwjkun"),r.disabled=n[19],o(d,"class","btn svelte-1rwjkun"),o(t,"class","tab-toolbar svelte-1rwjkun"),o(e,"class","files-tab svelte-1rwjkun")},m(E,q){k(E,e,q),a(e,t),a(t,l),a(l,i),a(t,s),a(t,r),a(r,c),a(t,u),a(t,d),a(t,_),S&&S.m(t,null),a(e,b),T[p].m(e,null),a(e,w),P&&P.m(e,null),k(E,g,q),C&&C.m(E,q),k(E,y,q),N=!0,B||(R=[O(l,"click",n[57]),O(r,"click",n[58]),O(d,"click",n[40])],B=!0)},p(E,q){(!N||q[0]&524288)&&(l.disabled=E[19]),(!N||q[0]&524288)&&(r.disabled=E[19]),E[30].items.length>0?S?S.p(E,q):(S=Ft(E),S.c(),S.m(t,null)):S&&(S.d(1),S=null);let V=p;p=L(E),p===V?T[p].p(E,q):(_e(),ie(T[V],1,1,()=>{T[V]=null}),me(),v=T[p],v?v.p(E,q):(v=T[p]=A[p](E),v.c()),ne(v,1),v.m(e,w)),E[19]&&!E[21]?P||(P=Pt(),P.c(),P.m(e,null)):P&&(P.d(1),P=null),E[26]?C?(C.p(E,q),q[0]&67108864&&ne(C,1)):(C=Ot(E),C.c(),ne(C,1),C.m(y.parentNode,y)):C&&(_e(),ie(C,1,1,()=>{C=null}),me())},i(E){N||(ne(v),ne(C),N=!0)},o(E){ie(v),ie(C),N=!1},d(E){E&&(m(e),m(g),m(y)),S&&S.d(),T[p].d(),P&&P.d(),C&&C.d(E),B=!1,se(R)}}}function vi(n){let e,t,l,i,s,r,c,u=n[16]&&Tt(n);function d(p,v){return p[7].length===0&&!p[16]?Li:Ei}let _=d(n),b=_(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent="+ Добавить заметку",i=j(),u&&u.c(),s=j(),b.c(),o(l,"class","btn btn-primary svelte-1rwjkun"),o(t,"class","tab-toolbar svelte-1rwjkun"),o(e,"class","notes-tab svelte-1rwjkun")},m(p,v){k(p,e,v),a(e,t),a(t,l),a(e,i),u&&u.m(e,null),a(e,s),b.m(e,null),r||(c=O(l,"click",n[49]),r=!0)},p(p,v){p[16]?u?u.p(p,v):(u=Tt(p),u.c(),u.m(e,s)):u&&(u.d(1),u=null),_===(_=d(p))&&b?b.p(p,v):(b.d(1),b=_(p),b&&(b.c(),b.m(e,null)))},i:K,o:K,d(p){p&&m(e),u&&u.d(),b.d(),r=!1,c()}}}function ki(n){let e,t,l=n[5].title+"",i,s,r,c,u,d,_=n[5].type+"",b,p,v,w,g,y=(n[5].section||"—")+"",N,B,R,S,A,T=fe(n[5].createdAt)+"",L,P,C,E,q,V,x,Z,U,z,$,Q,D,J,X=n[7].length>0&&At(n),H=n[10].length>0&&Dt(n);return{c(){e=f("div"),t=f("h2"),i=I(l),s=j(),r=f("div"),c=f("div"),u=f("span"),u.textContent="Тип",d=f("span"),b=I(_),p=j(),v=f("div"),w=f("span"),w.textContent="Раздел",g=f("span"),N=I(y),B=j(),R=f("div"),S=f("span"),S.textContent="Создано",A=f("span"),L=I(T),P=j(),C=f("div"),E=f("button"),E.textContent="✏️ Новая заметка",q=j(),V=f("button"),V.textContent="📎 Добавить файл",x=j(),Z=f("button"),Z.textContent="⚡ Добавить действие",U=j(),z=f("button"),z.textContent="🕐 Записать время",$=j(),X&&X.c(),Q=j(),H&&H.c(),o(t,"class","svelte-1rwjkun"),o(u,"class","meta-label svelte-1rwjkun"),o(d,"class","svelte-1rwjkun"),o(c,"class","meta-item svelte-1rwjkun"),o(w,"class","meta-label svelte-1rwjkun"),o(g,"class","svelte-1rwjkun"),o(v,"class","meta-item svelte-1rwjkun"),o(S,"class","meta-label svelte-1rwjkun"),o(A,"class","svelte-1rwjkun"),o(R,"class","meta-item svelte-1rwjkun"),o(r,"class","meta-grid svelte-1rwjkun"),o(E,"class","qa-btn svelte-1rwjkun"),o(V,"class","qa-btn svelte-1rwjkun"),o(Z,"class","qa-btn svelte-1rwjkun"),Z.disabled=!0,o(Z,"title","Следующий этап"),o(z,"class","qa-btn svelte-1rwjkun"),o(C,"class","quick-actions svelte-1rwjkun"),o(e,"class","overview svelte-1rwjkun")},m(M,Y){k(M,e,Y),a(e,t),a(t,i),a(e,s),a(e,r),a(r,c),a(c,u),a(c,d),a(d,b),a(r,p),a(r,v),a(v,w),a(v,g),a(g,N),a(r,B),a(r,R),a(R,S),a(R,A),a(A,L),a(e,P),a(e,C),a(C,E),a(C,q),a(C,V),a(C,x),a(C,Z),a(C,U),a(C,z),a(e,$),X&&X.m(e,null),a(e,Q),H&&H.m(e,null),D||(J=[O(E,"click",n[68]),O(V,"click",n[69]),O(z,"click",n[70])],D=!0)},p(M,Y){Y[0]&32&&l!==(l=M[5].title+"")&&G(i,l),Y[0]&32&&_!==(_=M[5].type+"")&&G(b,_),Y[0]&32&&y!==(y=(M[5].section||"—")+"")&&G(N,y),Y[0]&32&&T!==(T=fe(M[5].createdAt)+"")&&G(L,T),M[7].length>0?X?X.p(M,Y):(X=At(M),X.c(),X.m(e,Q)):X&&(X.d(1),X=null),M[10].length>0?H?H.p(M,Y):(H=Dt(M),H.c(),H.m(e,null)):H&&(H.d(1),H=null)},i:K,o:K,d(M){M&&m(e),X&&X.d(),H&&H.d(),D=!1,se(J)}}}function bi(n){let e,t=te(n[10]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Et(at(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=ae()},m(i,s){for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(i,s);k(i,e,s)},p(i,s){if(s[0]&1024){t=te(i[10]);let r;for(r=0;r<t.length;r+=1){const c=at(i,t,r);l[r]?l[r].p(c,s):(l[r]=Et(c),l[r].c(),l[r].m(e.parentNode,e))}for(;r<l.length;r+=1)l[r].d(1);l.length=t.length}},d(i){i&&m(e),ue(l,i)}}}function hi(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Записей работы пока нет</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){k(t,e,l)},p:K,d(t){t&&m(e)}}}function Et(n){let e,t,l=n[108].summary+"",i,s,r,c=n[108].minutes+"",u,d,_=fe(n[108].createdAt)+"",b,p;return{c(){e=f("div"),t=f("div"),i=I(l),s=j(),r=f("div"),u=I(c),d=I(" мин · "),b=I(_),p=j(),o(t,"class","svelte-1rwjkun"),o(r,"class","wl-meta svelte-1rwjkun"),o(e,"class","worklog-entry svelte-1rwjkun")},m(v,w){k(v,e,w),a(e,t),a(t,i),a(e,s),a(e,r),a(r,u),a(r,d),a(r,b),a(e,p)},p(v,w){w[0]&1024&&l!==(l=v[108].summary+"")&&G(i,l),w[0]&1024&&c!==(c=v[108].minutes+"")&&G(u,c),w[0]&1024&&_!==(_=fe(v[108].createdAt)+"")&&G(b,_)},d(v){v&&m(e)}}}function wi(n){let e,t=te(n[9]),l=[];for(let i=0;i<t.length;i+=1)l[i]=Lt(ft(n,t,i));return{c(){for(let i=0;i<l.length;i+=1)l[i].c();e=ae()},m(i,s){for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(i,s);k(i,e,s)},p(i,s){if(s[0]&512){t=te(i[9]);let r;for(r=0;r<t.length;r+=1){const c=ft(i,t,r);l[r]?l[r].p(c,s):(l[r]=Lt(c),l[r].c(),l[r].m(e.parentNode,e))}for(;r<l.length;r+=1)l[r].d(1);l.length=t.length}},d(i){i&&m(e),ue(l,i)}}}function gi(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Действий пока нет</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){k(t,e,l)},p:K,d(t){t&&m(e)}}}function Lt(n){let e,t,l=n[119].title+"",i,s,r=n[119].type+"",c,u,d,_,b,p;function v(){return n[85](n[119])}return{c(){e=f("div"),t=f("span"),i=I(l),s=f("span"),c=I(r),u=j(),d=f("button"),d.textContent="Запустить",_=j(),o(t,"class","svelte-1rwjkun"),o(s,"class","action-type svelte-1rwjkun"),o(d,"class","btn btn-sm svelte-1rwjkun"),o(e,"class","action-card svelte-1rwjkun")},m(w,g){k(w,e,g),a(e,t),a(t,i),a(e,s),a(s,c),a(e,u),a(e,d),a(e,_),b||(p=O(d,"click",v),b=!0)},p(w,g){n=w,g[0]&512&&l!==(l=n[119].title+"")&&G(i,l),g[0]&512&&r!==(r=n[119].type+"")&&G(c,r)},d(w){w&&m(e),b=!1,p()}}}function Ft(n){let e,t,l=n[30].items.length+"",i,s,r;return{c(){e=f("button"),t=I("Вставить "),i=I(l),o(e,"class","btn svelte-1rwjkun")},m(c,u){k(c,e,u),a(e,t),a(e,i),s||(r=O(e,"click",n[45]),s=!0)},p(c,u){u[0]&1073741824&&l!==(l=c[30].items.length+"")&&G(i,l)},d(c){c&&m(e),s=!1,r()}}}function yi(n){let e,t,l,i,s,r,c;const u=[Mi,Ci],d=[];function _(w,g){return w[24].length>0?0:1}e=_(n),t=d[e]=u[e](n);const b=[Si,Ni],p=[];function v(w,g){return w[25].length===0?0:1}return i=v(n),s=p[i]=b[i](n),{c(){t.c(),l=j(),s.c(),r=ae()},m(w,g){d[e].m(w,g),k(w,l,g),p[i].m(w,g),k(w,r,g),c=!0},p(w,g){let y=e;e=_(w),e===y?d[e].p(w,g):(_e(),ie(d[y],1,1,()=>{d[y]=null}),me(),t=d[e],t?t.p(w,g):(t=d[e]=u[e](w),t.c()),ne(t,1),t.m(l.parentNode,l));let N=i;i=v(w),i===N?p[i].p(w,g):(_e(),ie(p[N],1,1,()=>{p[N]=null}),me(),s=p[i],s?s.p(w,g):(s=p[i]=b[i](w),s.c()),ne(s,1),s.m(r.parentNode,r))},i(w){c||(ne(t),ne(s),c=!0)},o(w){ie(t),ie(s),c=!1},d(w){w&&(m(l),m(r)),d[e].d(w),p[i].d(w)}}}function ji(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Загрузка...</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){k(t,e,l)},p:K,i:K,o:K,d(t){t&&m(e)}}}function Ci(n){let e,t;return e=new sl({props:{crumbs:[{name:"Files"}]}}),{c(){ye(e.$$.fragment)},m(l,i){ve(e,l,i),t=!0},p:K,i(l){t||(ne(e.$$.fragment,l),t=!0)},o(l){ie(e.$$.fragment,l),t=!1},d(l){ke(e,l)}}}function Mi(n){let e,t,l,i,s,r;return e=new sl({props:{crumbs:[{name:"Files"},...n[24]]}}),e.$on("navigate",n[75]),{c(){ye(e.$$.fragment),t=j(),l=f("button"),l.textContent="← Back",o(l,"class","btn btn-sm back-btn svelte-1rwjkun")},m(c,u){ve(e,c,u),k(c,t,u),k(c,l,u),i=!0,s||(r=O(l,"click",n[36]),s=!0)},p(c,u){const d={};u[0]&16777216&&(d.crumbs=[{name:"Files"},...c[24]]),e.$set(d)},i(c){i||(ne(e.$$.fragment,c),i=!0)},o(c){ie(e.$$.fragment,c),i=!1},d(c){c&&(m(t),m(l)),ke(e,c),s=!1,r()}}}function Ni(n){let e,t=[],l=new Map,i,s=te(n[25]);const r=c=>c[116].id;for(let c=0;c<s.length;c+=1){let u=dt(n,s,c),d=r(u);l.set(d,t[c]=It(d,u))}return{c(){e=f("div");for(let c=0;c<t.length;c+=1)t[c].c();o(e,"class","file-list svelte-1rwjkun")},m(c,u){k(c,e,u);for(let d=0;d<t.length;d+=1)t[d]&&t[d].m(e,null);i=!0},p(c,u){u[0]&33554432|u[1]&1073757328&&(s=te(c[25]),_e(),t=an(t,u,r,1,c,s,l,e,un,It,null,dt),me())},i(c){if(!i){for(let u=0;u<s.length;u+=1)ne(t[u]);i=!0}},o(c){for(let u=0;u<t.length;u+=1)ie(t[u]);i=!1},d(c){c&&m(e);for(let u=0;u<t.length;u+=1)t[u].d()}}}function Si(n){let e,t,l,i,s=n[24].length>0?"В этой папке пока нет файлов":"В этом проекте пока нет файлов",r,c,u,d,_,b,p,v,w,g;return{c(){e=f("div"),t=f("div"),t.innerHTML='<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="svelte-1rwjkun"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" class="svelte-1rwjkun"></path><polyline points="14 2 14 8 20 8" class="svelte-1rwjkun"></polyline></svg>',l=j(),i=f("p"),r=I(s),c=j(),u=f("p"),u.textContent="Добавьте файл или папку, чтобы сохранить материалы проекта.",d=j(),_=f("div"),b=f("button"),b.textContent="Добавить файл",p=j(),v=f("button"),v.textContent="Добавить папку",o(t,"class","empty-icon svelte-1rwjkun"),o(i,"class","svelte-1rwjkun"),o(u,"class","hint svelte-1rwjkun"),o(b,"class","btn btn-primary svelte-1rwjkun"),o(v,"class","btn svelte-1rwjkun"),o(_,"class","empty-actions svelte-1rwjkun"),o(e,"class","empty-state svelte-1rwjkun")},m(y,N){k(y,e,N),a(e,t),a(e,l),a(e,i),a(i,r),a(e,c),a(e,u),a(e,d),a(e,_),a(_,b),a(_,p),a(_,v),w||(g=[O(b,"click",n[57]),O(v,"click",n[58])],w=!0)},p(y,N){N[0]&16777216&&s!==(s=y[24].length>0?"В этой папке пока нет файлов":"В этом проекте пока нет файлов")&&G(r,s)},i:K,o:K,d(y){y&&m(e),w=!1,se(g)}}}function It(n,e){let t,l,i;return l=new Vn({props:{item:e[116]}}),l.$on("navigate",e[76]),l.$on("preview",e[77]),l.$on("openExternal",e[78]),l.$on("delete",e[79]),l.$on("rename",e[80]),l.$on("duplicate",e[81]),l.$on("cut",e[82]),l.$on("copy",e[83]),{key:n,first:null,c(){t=ae(),ye(l.$$.fragment),this.first=t},m(s,r){k(s,t,r),ve(l,s,r),i=!0},p(s,r){e=s;const c={};r[0]&33554432&&(c.item=e[116]),l.$set(c)},i(s){i||(ne(l.$$.fragment,s),i=!0)},o(s){ie(l.$$.fragment,s),i=!1},d(s){s&&m(t),ke(l,s)}}}function Pt(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Сканирование...</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){k(t,e,l)},d(t){t&&m(e)}}}function Ot(n){let e,t;return e=new li({props:{item:n[26],content:n[27],loading:n[28],error:n[29]}}),e.$on("close",n[39]),e.$on("openExternal",n[84]),{c(){ye(e.$$.fragment)},m(l,i){ve(e,l,i),t=!0},p(l,i){const s={};i[0]&67108864&&(s.item=l[26]),i[0]&134217728&&(s.content=l[27]),i[0]&268435456&&(s.loading=l[28]),i[0]&536870912&&(s.error=l[29]),e.$set(s)},i(l){t||(ne(e.$$.fragment,l),t=!0)},o(l){ie(e.$$.fragment,l),t=!1},d(l){ke(e,l)}}}function Tt(n){let e,t,l,i,s,r,c,u,d;return{c(){e=f("div"),t=f("input"),l=j(),i=f("div"),s=f("button"),s.textContent="Создать",r=j(),c=f("button"),c.textContent="Отмена",o(t,"type","text"),o(t,"placeholder","Название заметки"),o(t,"class","svelte-1rwjkun"),o(s,"class","btn btn-primary svelte-1rwjkun"),o(c,"class","btn svelte-1rwjkun"),o(i,"class","form-actions svelte-1rwjkun"),o(e,"class","create-form svelte-1rwjkun")},m(_,b){k(_,e,b),a(e,t),ce(t,n[17]),a(e,l),a(e,i),a(i,s),a(i,r),a(i,c),u||(d=[O(t,"input",n[72]),O(t,"keydown",n[73]),O(s,"click",n[51]),O(c,"click",n[50])],u=!0)},p(_,b){b[0]&131072&&t.value!==_[17]&&ce(t,_[17])},d(_){_&&m(e),u=!1,se(d)}}}function Ei(n){let e,t=te(n[7]),l=[];for(let i=0;i<t.length;i+=1)l[i]=zt(pt(n,t,i));return{c(){e=f("div");for(let i=0;i<l.length;i+=1)l[i].c();o(e,"class","notes-list svelte-1rwjkun")},m(i,s){k(i,e,s);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(e,null)},p(i,s){if(s[0]&128|s[1]&2097152){t=te(i[7]);let r;for(r=0;r<t.length;r+=1){const c=pt(i,t,r);l[r]?l[r].p(c,s):(l[r]=zt(c),l[r].c(),l[r].m(e,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=t.length}},d(i){i&&m(e),ue(l,i)}}}function Li(n){let e;return{c(){e=f("div"),e.innerHTML='<p class="svelte-1rwjkun">Нет заметок</p><p class="hint svelte-1rwjkun">Создайте первую заметку для этого дела.</p>',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){k(t,e,l)},p:K,d(t){t&&m(e)}}}function zt(n){let e,t,l=n[111].title+"",i,s,r,c=fe(n[111].createdAt)+"",u,d,_,b;function p(){return n[74](n[111])}return{c(){e=f("div"),t=f("div"),i=I(l),s=j(),r=f("div"),u=I(c),d=j(),o(t,"class","note-card-title svelte-1rwjkun"),o(r,"class","note-card-date svelte-1rwjkun"),o(e,"class","note-card svelte-1rwjkun")},m(v,w){k(v,e,w),a(e,t),a(t,i),a(e,s),a(e,r),a(r,u),a(e,d),_||(b=O(e,"click",p),_=!0)},p(v,w){n=v,w[0]&128&&l!==(l=n[111].title+"")&&G(i,l),w[0]&128&&c!==(c=fe(n[111].createdAt)+"")&&G(u,c)},d(v){v&&m(e),_=!1,b()}}}function At(n){let e,t,l,i=te(n[7].slice(0,5)),s=[];for(let r=0;r<i.length;r+=1)s[r]=Bt(mt(n,i,r));return{c(){e=f("div"),t=f("h3"),t.textContent="Последние заметки",l=j();for(let r=0;r<s.length;r+=1)s[r].c();o(t,"class","svelte-1rwjkun"),o(e,"class","recent-section svelte-1rwjkun")},m(r,c){k(r,e,c),a(e,t),a(e,l);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null)},p(r,c){if(c[0]&128|c[1]&2097152){i=te(r[7].slice(0,5));let u;for(u=0;u<i.length;u+=1){const d=mt(r,i,u);s[u]?s[u].p(d,c):(s[u]=Bt(d),s[u].c(),s[u].m(e,null))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}},d(r){r&&m(e),ue(s,r)}}}function Bt(n){let e,t,l=n[111].title+"",i,s,r=fe(n[111].createdAt)+"",c,u,d,_;function b(){return n[71](n[111])}return{c(){e=f("div"),t=f("span"),i=I(l),s=f("span"),c=I(r),u=j(),o(t,"class","svelte-1rwjkun"),o(s,"class","recent-date svelte-1rwjkun"),o(e,"class","recent-note svelte-1rwjkun")},m(p,v){k(p,e,v),a(e,t),a(t,i),a(e,s),a(s,c),a(e,u),d||(_=O(e,"click",b),d=!0)},p(p,v){n=p,v[0]&128&&l!==(l=n[111].title+"")&&G(i,l),v[0]&128&&r!==(r=fe(n[111].createdAt)+"")&&G(c,r)},d(p){p&&m(e),d=!1,_()}}}function Dt(n){let e,t,l,i=te(n[10].slice(0,3)),s=[];for(let r=0;r<i.length;r+=1)s[r]=Ht(_t(n,i,r));return{c(){e=f("div"),t=f("h3"),t.textContent="Последние записи",l=j();for(let r=0;r<s.length;r+=1)s[r].c();o(t,"class","svelte-1rwjkun"),o(e,"class","recent-section svelte-1rwjkun")},m(r,c){k(r,e,c),a(e,t),a(e,l);for(let u=0;u<s.length;u+=1)s[u]&&s[u].m(e,null)},p(r,c){if(c[0]&1024){i=te(r[10].slice(0,3));let u;for(u=0;u<i.length;u+=1){const d=_t(r,i,u);s[u]?s[u].p(d,c):(s[u]=Ht(d),s[u].c(),s[u].m(e,null))}for(;u<s.length;u+=1)s[u].d(1);s.length=i.length}},d(r){r&&m(e),ue(s,r)}}}function Ht(n){let e,t=n[108].summary+"",l,i,s=n[108].minutes+"",r,c;return{c(){e=f("div"),l=I(t),i=I(" ("),r=I(s),c=I(" мин)"),o(e,"class","recent-entry svelte-1rwjkun")},m(u,d){k(u,e,d),a(e,l),a(e,i),a(e,r),a(e,c)},p(u,d){d[0]&1024&&t!==(t=u[108].summary+"")&&G(l,t),d[0]&1024&&s!==(s=u[108].minutes+"")&&G(r,s)},d(u){u&&m(e)}}}function Vt(n){let e;return{c(){e=f("span"),e.textContent="●",o(e,"class","dirty-mark svelte-1rwjkun")},m(t,l){k(t,e,l)},d(t){t&&m(e)}}}function Wt(n){let e,t,l;return{c(){e=f("div"),e.textContent="+",o(e,"class","fab svelte-1rwjkun"),o(e,"title","Добавить дело")},m(i,s){k(i,e,s),t||(l=O(e,"click",n[46]),t=!0)},p:K,d(i){i&&m(e),t=!1,l()}}}function Rt(n){let e,t,l,i,s,r,c,u,d,_,b,p,v,w,g,y,N,B,R,S,A=te(n[0].filter(Jt)),T=[];for(let L=0;L<A.length;L+=1)T[L]=qt(ut(n,A,L));return{c(){e=f("div"),t=f("div"),l=f("h3"),l.textContent="Новое дело",i=j(),s=f("div"),r=f("label"),r.textContent="Название",c=j(),u=f("input"),d=j(),_=f("div"),b=f("label"),b.textContent="Раздел",p=j(),v=f("select");for(let L=0;L<T.length;L+=1)T[L].c();w=j(),g=f("div"),y=f("button"),y.textContent="Создать",N=j(),B=f("button"),B.textContent="Отмена",o(l,"class","svelte-1rwjkun"),o(r,"class","svelte-1rwjkun"),o(u,"type","text"),o(u,"placeholder","Название дела"),u.autofocus=!0,o(u,"class","svelte-1rwjkun"),o(s,"class","form-group svelte-1rwjkun"),o(b,"class","svelte-1rwjkun"),o(v,"class","svelte-1rwjkun"),n[15]===void 0&&Pe(()=>n[90].call(v)),o(_,"class","form-group svelte-1rwjkun"),o(y,"class","btn btn-primary svelte-1rwjkun"),o(B,"class","btn svelte-1rwjkun"),o(g,"class","modal-actions svelte-1rwjkun"),o(t,"class","modal svelte-1rwjkun"),o(e,"class","modal-overlay svelte-1rwjkun")},m(L,P){k(L,e,P),a(e,t),a(t,l),a(t,i),a(t,s),a(s,r),a(s,c),a(s,u),ce(u,n[14]),a(t,d),a(t,_),a(_,b),a(_,p),a(_,v);for(let C=0;C<T.length;C+=1)T[C]&&T[C].m(v,null);lt(v,n[15],!0),a(t,w),a(t,g),a(g,y),a(g,N),a(g,B),u.focus(),R||(S=[O(u,"input",n[88]),O(u,"keydown",n[89]),O(v,"change",n[90]),O(y,"click",n[48]),O(B,"click",n[47]),O(e,"click",We(n[47]))],R=!0)},p(L,P){if(P[0]&16384&&u.value!==L[14]&&ce(u,L[14]),P[0]&1){A=te(L[0].filter(Jt));let C;for(C=0;C<A.length;C+=1){const E=ut(L,A,C);T[C]?T[C].p(E,P):(T[C]=qt(E),T[C].c(),T[C].m(v,null))}for(;C<T.length;C+=1)T[C].d(1);T.length=A.length}P[0]&32769&&lt(v,L[15])},d(L){L&&m(e),ue(T,L),R=!1,se(S)}}}function qt(n){let e,t=n[105].label+"",l,i;return{c(){e=f("option"),l=I(t),e.__value=i=n[105].id,ce(e,e.__value),o(e,"class","svelte-1rwjkun")},m(s,r){k(s,e,r),a(e,l)},p(s,r){r[0]&1&&t!==(t=s[105].label+"")&&G(l,t),r[0]&1&&i!==(i=s[105].id)&&(e.__value=i,ce(e,e.__value))},d(s){s&&m(e)}}}function Gt(n){let e,t,l,i,s=(n[5]?n[5].title:"")+"",r,c,u,d,_,b,p,v=n[20].files+"",w,g,y,N,B,R=n[20].folders+"",S,A,T,L,P,C=(n[20].totalBytes/1024).toFixed(1)+"",E,q,V,x,Z,U,z,$,Q,D,J,X,H=n[20].isDangerous&&Kt(n);return{c(){e=f("div"),t=f("div"),l=f("h3"),i=I("Добавить в «"),r=I(s),c=I("»"),u=j(),d=f("div"),_=f("div"),b=f("span"),b.textContent="Файлов:",p=f("span"),w=I(v),g=j(),y=f("div"),N=f("span"),N.textContent="Папок:",B=f("span"),S=I(R),A=j(),T=f("div"),L=f("span"),L.textContent="Размер:",P=f("span"),E=I(C),q=I(" KB"),V=j(),H&&H.c(),x=j(),Z=f("div"),U=f("button"),U.textContent="Скопировать",z=j(),$=f("button"),$.textContent="Привязать",Q=j(),D=f("button"),D.textContent="Отмена",o(l,"class","svelte-1rwjkun"),o(b,"class","svelte-1rwjkun"),o(p,"class","svelte-1rwjkun"),o(_,"class","summary-row svelte-1rwjkun"),o(N,"class","svelte-1rwjkun"),o(B,"class","svelte-1rwjkun"),o(y,"class","summary-row svelte-1rwjkun"),o(L,"class","svelte-1rwjkun"),o(P,"class","svelte-1rwjkun"),o(T,"class","summary-row svelte-1rwjkun"),o(d,"class","import-summary svelte-1rwjkun"),o(U,"class","btn btn-primary svelte-1rwjkun"),o($,"class","btn svelte-1rwjkun"),o(D,"class","btn svelte-1rwjkun"),o(Z,"class","modal-actions svelte-1rwjkun"),o(t,"class","modal svelte-1rwjkun"),o(e,"class","modal-overlay svelte-1rwjkun")},m(M,Y){k(M,e,Y),a(e,t),a(t,l),a(l,i),a(l,r),a(l,c),a(t,u),a(t,d),a(d,_),a(_,b),a(_,p),a(p,w),a(d,g),a(d,y),a(y,N),a(y,B),a(B,S),a(d,A),a(d,T),a(T,L),a(T,P),a(P,E),a(P,q),a(d,V),H&&H.m(d,null),a(t,x),a(t,Z),a(Z,U),a(Z,z),a(Z,$),a(Z,Q),a(Z,D),J||(X=[O(U,"click",n[91]),O($,"click",n[92]),O(D,"click",n[60]),O(e,"click",We(n[60]))],J=!0)},p(M,Y){Y[0]&32&&s!==(s=(M[5]?M[5].title:"")+"")&&G(r,s),Y[0]&1048576&&v!==(v=M[20].files+"")&&G(w,v),Y[0]&1048576&&R!==(R=M[20].folders+"")&&G(S,R),Y[0]&1048576&&C!==(C=(M[20].totalBytes/1024).toFixed(1)+"")&&G(E,C),M[20].isDangerous?H?H.p(M,Y):(H=Kt(M),H.c(),H.m(d,null)):H&&(H.d(1),H=null)},d(M){M&&m(e),H&&H.d(),J=!1,se(X)}}}function Kt(n){let e,t,l=n[20].dangerReason+"",i;return{c(){e=f("div"),t=I("⚠ "),i=I(l),o(e,"class","summary-warn svelte-1rwjkun")},m(s,r){k(s,e,r),a(e,t),a(e,i)},p(s,r){r[0]&1048576&&l!==(l=s[20].dangerReason+"")&&G(i,l)},d(s){s&&m(e)}}}function Fi(n){let e,t,l,i,s,r,c,u,d,_,b,p,v,w,g,y,N,B,R,S,A,T,L,P,C,E=te(n[0]),q=[];for(let M=0;M<E.length;M+=1)q[M]=wt(ht(n,E,M));let V=n[4]&&gt(n);function x(M,Y){return M[5]?si:M[4]?ii:ni}let Z=x(n),U=Z(n),z=n[3]&&Nt(n);const $=[ci,oi,ri],Q=[];function D(M,Y){return M[8]?0:M[5]?1:2}S=D(n),A=Q[S]=$[S](n);let J=!n[8]&&!n[5]&&Wt(n),X=n[13]&&Rt(n),H=n[21]&&n[20]&&Gt(n);return{c(){e=f("div"),t=f("aside"),l=f("div"),l.innerHTML='<span class="logo svelte-1rwjkun">⚒</span> <span class="brand-name svelte-1rwjkun">Верстак</span>',i=j(),s=f("nav"),r=f("div"),c=f("div"),c.textContent="Разделы",u=j();for(let M=0;M<q.length;M+=1)q[M].c();d=j(),V&&V.c(),_=j(),b=f("div"),p=f("span"),v=I(n[2]),w=j(),g=f("main"),y=f("header"),N=f("div"),U.c(),B=j(),z&&z.c(),R=j(),A.c(),T=j(),J&&J.c(),L=j(),X&&X.c(),P=j(),H&&H.c(),o(l,"class","sidebar-brand svelte-1rwjkun"),o(c,"class","nav-label svelte-1rwjkun"),o(r,"class","nav-group svelte-1rwjkun"),o(s,"class","sidebar-nav svelte-1rwjkun"),o(p,"class","version svelte-1rwjkun"),o(b,"class","sidebar-footer svelte-1rwjkun"),o(t,"class","sidebar svelte-1rwjkun"),o(N,"class","header-left svelte-1rwjkun"),o(y,"class","header svelte-1rwjkun"),o(g,"class","main svelte-1rwjkun"),o(e,"class","app svelte-1rwjkun")},m(M,Y){k(M,e,Y),a(e,t),a(t,l),a(t,i),a(t,s),a(s,r),a(r,c),a(r,u);for(let le=0;le<q.length;le+=1)q[le]&&q[le].m(r,null);a(s,d),V&&V.m(s,null),a(t,_),a(t,b),a(b,p),a(p,v),a(e,w),a(e,g),a(g,y),a(y,N),U.m(N,null),a(g,B),z&&z.m(g,null),a(g,R),Q[S].m(g,null),a(g,T),J&&J.m(g,null),a(g,L),X&&X.m(g,null),a(g,P),H&&H.m(g,null),C=!0},p(M,Y){if(Y[0]&17|Y[1]&2){E=te(M[0]);let re;for(re=0;re<E.length;re+=1){const Ee=ht(M,E,re);q[re]?q[re].p(Ee,Y):(q[re]=wt(Ee),q[re].c(),q[re].m(r,null))}for(;re<q.length;re+=1)q[re].d(1);q.length=E.length}M[4]?V?V.p(M,Y):(V=gt(M),V.c(),V.m(s,null)):V&&(V.d(1),V=null),(!C||Y[0]&4)&&G(v,M[2]),Z===(Z=x(M))&&U?U.p(M,Y):(U.d(1),U=Z(M),U&&(U.c(),U.m(N,null))),M[3]?z?z.p(M,Y):(z=Nt(M),z.c(),z.m(g,R)):z&&(z.d(1),z=null);let le=S;S=D(M),S===le?Q[S].p(M,Y):(_e(),ie(Q[le],1,1,()=>{Q[le]=null}),me(),A=Q[S],A?A.p(M,Y):(A=Q[S]=$[S](M),A.c()),ne(A,1),A.m(g,T)),!M[8]&&!M[5]?J?J.p(M,Y):(J=Wt(M),J.c(),J.m(g,L)):J&&(J.d(1),J=null),M[13]?X?X.p(M,Y):(X=Rt(M),X.c(),X.m(g,P)):X&&(X.d(1),X=null),M[21]&&M[20]?H?H.p(M,Y):(H=Gt(M),H.c(),H.m(g,null)):H&&(H.d(1),H=null)},i(M){C||(ne(A),C=!0)},o(M){ie(A),C=!1},d(M){M&&m(e),ue(q,M),V&&V.d(),U.d(),z&&z.d(),Q[S].d(),J&&J.d(),X&&X.d(),H&&H.d()}}}function ee(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 fe(n){if(!n)return"";try{return new Date(n).toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}catch{return n}}const Jt=n=>n.id!=="today"&&n.id!=="inbox";function Ii(n,e,t){let l=[],i=[],s="",r="",c="",u=null,d="overview",_=[],b=null,p=[],v=[],w=[],g="",y="",N=!1,B="",R="clients",S=!1,A="",T=!0,L=!1,P=null,C=!1,E="",q=!1,V=null,x=[],Z=[],U=null,z="",$=!1,Q="",D={items:[],mode:"copy"};const J=[{id:"overview",label:"Обзор"},{id:"notes",label:"Заметки"},{id:"files",label:"Файлы"},{id:"actions",label:"Действия"},{id:"worklog",label:"Журнал"},{id:"activity",label:"Активность"}];let X=null;Yt(async()=>{try{t(2,s=await ee("VerstakVersion")||"verstak-gui/v2"),t(0,l=await ee("ListSections")||[])}catch(h){t(3,r=String(h)),t(0,l=[{id:"today",label:"Сегодня"},{id:"inbox",label:"Неразобранное"},{id:"clients",label:"Клиенты"},{id:"projects",label:"Проекты"},{id:"recipes",label:"Рецепты"},{id:"documents",label:"Документы"},{id:"archive",label:"Архив"}])}window.runtime&&window.runtime.EventsOn&&(window.runtime.EventsOn("files-dropped",hl),X=()=>window.runtime.EventsOff("files-dropped")),t(18,T=!1)}),Qt(()=>{X&&X()});async function H(h){t(4,c=h),t(5,u=null),t(6,d="overview"),t(7,_=[]),p=[],t(9,v=[]),t(10,w=[]),t(13,N=!1),t(3,r="");try{t(1,i=await ee("ListNodesBySection",h)||[])}catch(F){t(3,r=String(F)),t(1,i=[])}}async function M(h){t(5,u=h),t(6,d="overview"),t(7,_=[]),p=[],t(9,v=[]),t(10,w=[]),t(25,Z=[]),t(24,x=[]),t(23,V=null),t(26,U=null),t(27,z=""),t(8,b=null),t(13,N=!1),t(16,S=!1),t(3,r=""),await Y(h.id)}async function Y(h){try{t(7,_=await ee("ListNotes",h)||[])}catch{}try{p=await ee("ListFiles",h)||[]}catch{}try{t(9,v=await ee("ListActions",h)||[])}catch{}try{t(10,w=await ee("ListWorklog",h)||[])}catch{}}async function le(h){t(22,q=!0);try{let F=await ee("ListItems",h)||[];F.sort((oe,be)=>oe.type!==be.type?oe.type==="folder"?-1:1:(oe.name||"").localeCompare(be.name||"")),t(25,Z=F)}catch{t(25,Z=[])}t(22,q=!1)}async function re(h){if(u){try{const F=await ee("GetNodeDetail",h);F&&t(24,x=[...x,{id:h,name:F.title}])}catch{t(24,x=[...x,{id:h,name:"..."}])}t(23,V=h),await le(h)}}function Ee(){if(x.length<2)t(24,x=[]),t(23,V=null),le(u.id);else{const h=x[x.length-2];t(24,x=x.slice(0,-1)),t(23,V=h.id),le(h.id)}}function Ge(h){const F=x[h];t(24,x=x.slice(0,h+1)),t(23,V=F.id),le(F.id)}async function Ke(h){t(26,U=h),t(27,z=""),t(29,Q=""),t(28,$=!0);try{Pn(h)?t(27,z=await ee("GetFileBase64",h.fileId)||""):On(h)&&t(27,z=await ee("ReadFileText",h.fileId)||"")}catch(F){t(29,Q=String(F))}t(28,$=!1)}function rl(){t(26,U=null),t(27,z=""),t(29,Q="")}async function ol(){const h=prompt("Введите имя файла:");if(!(!h||!h.trim()))try{const F=V||u.id;await ee("CreateEmptyFile",F,h.trim()),await le(F)}catch(F){t(3,r=String(F))}}async function Je(h){try{await ee("DuplicateNode",h);const F=V||u.id;await le(F)}catch(F){t(3,r=String(F))}}function Ue(h){const F=prompt("Новое имя:");!F||!F.trim()||cl(h,F.trim())}async function cl(h,F){try{await ee("RenameNode",h,F);const oe=V||u.id;await le(oe)}catch(oe){t(3,r=String(oe))}}function Ze(h){t(30,D={items:[h],mode:"cut"})}function Xe(h){t(30,D={items:[h],mode:"copy"})}async function ul(){if(D.items.length===0)return;const h=V||u.id;try{if(D.mode==="copy")for(const F of D.items)await ee("DuplicateNode",F);else for(const F of D.items)await ee("MoveNode",F,h);t(30,D={items:[],mode:"copy"}),await le(h)}catch(F){t(3,r=String(F))}}function al(){t(13,N=!0),t(14,B=""),t(15,R=c||"clients")}function fl(){t(13,N=!1),t(14,B="")}async function Ye(){if(B.trim())try{const h=await ee("CreateNode","","case",B.trim(),R);t(13,N=!1),t(14,B=""),await H(R)}catch(h){t(3,r=String(h))}}function Qe(){t(16,S=!0),t(17,A="")}function dl(){t(16,S=!1),t(17,A="")}async function xe(){if(!(!A.trim()||!u))try{const h=await ee("CreateNote",u.id,A.trim());t(7,_=[..._,h&&h.id?h:{id:Date.now().toString(),title:A.trim(),createdAt:new Date().toISOString()}]),t(16,S=!1),t(17,A="")}catch{const F={id:Date.now().toString(),title:A.trim(),createdAt:new Date().toISOString()};t(7,_=[..._,F]),t(16,S=!1),t(17,A="")}}async function ze(h){if(!(b&&b.dirty&&!confirm("Несохранённые изменения. Закрыть?")))try{const F=await ee("ReadNote",h.id);t(8,b={id:h.id,title:h.title,content:F||"",dirty:!1})}catch{t(8,b={id:h.id,title:h.title,content:"# "+h.title+`
`,dirty:!1})}}function pl(){b&&b.dirty&&!confirm("Несохранённые изменения. Закрыть?")||t(8,b=null)}function _l(h){b&&(t(8,b.content=h.target.value,b),t(8,b.dirty=!0,b))}async function ml(){if(b)try{await ee("SaveNote",b.id,b.content),t(8,b.dirty=!1,b)}catch{t(8,b.dirty=!1,b)}}async function vl(){const h=parseInt(g,10);if(!(!y.trim()||isNaN(h)||h<=0||!u)){try{const F=await ee("CreateWorklog",u.id,y.trim(),h);t(10,w=[...w,F&&F.id?F:{id:Date.now().toString(),nodeId:u.id,summary:y.trim(),minutes:h,createdAt:new Date().toISOString()}])}catch{t(10,w=[...w,{id:Date.now().toString(),nodeId:u.id,summary:y.trim(),minutes:h,createdAt:new Date().toISOString()}])}t(12,y=""),t(11,g="")}}async function $e(){const h=await ee("PickFile");h&&await Ae(u.id,h)}async function kl(){const h=await ee("PickDirectory");h&&await Ae(u.id,h)}async function Ae(h,F){t(19,L=!0);try{const oe=await ee("PreviewImport",F);t(20,P=oe),E=F,t(21,C=!0)}catch(oe){t(3,r=String(oe))}t(19,L=!1)}async function Be(h){try{const F=h==="copy"?await ee("AddPathCopy",u.id,E):await ee("AddPathLink",u.id,E);t(21,C=!1),t(20,P=null),t(24,x=[]),t(23,V=null),await Promise.all([Y(u.id),le(u.id)])}catch(F){t(3,r=String(F))}}function bl(){t(21,C=!1),t(20,P=null)}async function et({id:h,type:F}){if(confirm(`Удалить ${F==="folder"?"папку":"файл"}?`))try{await ee("DeleteFileOrFolder",h),p=p.filter(Xl=>Xl.nodeId!==h);const be=V||u.id;await le(be)}catch(be){t(3,r=String(be))}}async function hl(h){if(!h||h.length===0)return;if(!u){t(3,r="Сначала выберите дело для добавления файлов");return}const F=h[0];await Ae(u.id,F)}function wl(h){return d===h?"tab active":"tab"}const gl=h=>H(h.id),yl=h=>M(h),jl=()=>t(3,r="");function Cl(){b.content=this.value,t(8,b)}const Ml=h=>{t(6,d=h.id),h.id==="files"&&u&&Z.length===0&&!V&&le(u.id)},Nl=()=>{t(6,d="notes"),Qe()},Sl=()=>{t(6,d="files"),$e()},El=()=>t(6,d="worklog"),Ll=h=>ze(h);function Fl(){A=this.value,t(17,A)}const Il=h=>h.key==="Enter"&&xe(),Pl=h=>ze(h),Ol=h=>{const F=h.detail;F===0?(t(24,x=[]),t(23,V=null),le(u.id)):Ge(F-1)},Tl=h=>re(h.detail),zl=h=>Ke(h.detail),Al=h=>ee("OpenFile",h.detail),Bl=h=>et(h.detail),Dl=h=>Ue(h.detail.id),Hl=h=>Je(h.detail),Vl=h=>Ze(h.detail),Wl=h=>Xe(h.detail),Rl=h=>ee("OpenFile",h.detail),ql=h=>ee("RunAction",h.id);function Gl(){y=this.value,t(12,y)}function Kl(){g=Xt(this.value),t(11,g)}function Jl(){B=this.value,t(14,B)}const Ul=h=>h.key==="Enter"&&Ye();function Zl(){R=tn(this),t(15,R),t(0,l)}return[l,i,s,r,c,u,d,_,b,v,w,g,y,N,B,R,S,A,T,L,P,C,q,V,x,Z,U,z,$,Q,D,J,H,M,le,re,Ee,Ge,Ke,rl,ol,Je,Ue,Ze,Xe,ul,al,fl,Ye,Qe,dl,xe,ze,pl,_l,ml,vl,$e,kl,Be,bl,et,wl,gl,yl,jl,Cl,Ml,Nl,Sl,El,Ll,Fl,Il,Pl,Ol,Tl,zl,Al,Bl,Dl,Hl,Vl,Wl,Rl,ql,Gl,Kl,Jl,Ul,Zl,()=>Be("copy"),()=>Be("link")]}class Pi extends Se{constructor(e){super(),Ne(this,e,Ii,Fi,Me,{},null,[-1,-1,-1,-1,-1])}}new Pi({target:document.getElementById("app")});