var Tl=Object.defineProperty;var Al=(n,e,t)=>e in n?Tl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ie=(n,e,t)=>Al(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 q(){}function Dt(n){return n()}function Xe(){return Object.create(null)}function ne(n){n.forEach(Dt)}function Vt(n){return typeof n=="function"}function Ce(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ne;function Se(n,e){return n===e?!0:(Ne||(Ne=document.createElement("a")),Ne.href=e,n===Ne.href)}function Hl(n){return Object.keys(n).length===0}function Il(n){return n??""}function a(n,e){n.appendChild(e)}function v(n,e,t){n.insertBefore(e,t||null)}function m(n){n.parentNode&&n.parentNode.removeChild(n)}function ce(n,e){for(let t=0;tn.removeEventListener(e,t,l)}function Fe(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Ve(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 Wt(n){return n===""?null:+n}function Bl(n){return Array.from(n.childNodes)}function V(n,e){e=""+e,n.data!==e&&(n.data=e)}function re(n,e){n.value=e??""}function Ye(n,e,t){for(let l=0;l{const i=n.$$.callbacks[e];if(i){const s=Vl(e,t,{cancelable:l});return i.slice().forEach(r=>{r.call(n,s)}),!s.defaultPrevented}return!0}}const ke=[],Qe=[];let be=[];const xe=[],Wl=Promise.resolve();let De=!1;function ql(){De||(De=!0,Wl.then(Gt))}function ze(n){be.push(n)}const Be=new Set;let ve=0;function Gt(){if(ve!==0)return;const n=je;do{try{for(;ven.indexOf(l)===-1?e.push(l):t.push(l)),t.forEach(l=>l()),be=e}const Ee=new Set;let fe;function de(){fe={r:0,c:[],p:fe}}function pe(){fe.r||ne(fe.c),fe=fe.p}function ee(n,e){n&&n.i&&(Ee.delete(n),n.i(e))}function le(n,e,t,l){if(n&&n.o){if(Ee.has(n))return;Ee.add(n),fe.c.push(()=>{Ee.delete(n),l&&(t&&n.d(1),l())}),n.o(e)}else l&&l()}function $(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Kl(n,e){le(n,1,1,()=>{e.delete(n.key)})}function Jl(n,e,t,l,i,s,r,c,u,d,_,k){let p=n.length,b=s.length,h=p;const w={};for(;h--;)w[n[h].key]=h;const y=[],N=new Map,A=new Map,W=[];for(h=b;h--;){const L=k(i,s,h),I=t(L);let E=r.get(I);E?W.push(()=>E.p(L,e)):(E=d(I,L),E.c()),N.set(I,y[h]=E),I in w&&A.set(I,Math.abs(h-w[I]))}const z=new Set,S=new Set;function M(L){ee(L,1),L.m(c,_),r.set(L.key,L),_=L.first,b--}for(;p&&b;){const L=y[b-1],I=n[p-1],E=L.key,P=I.key;L===I?(_=L.first,p--,b--):N.has(P)?!r.has(E)||z.has(E)?M(L):S.has(P)?p--:A.get(E)>A.get(P)?(S.add(E),M(L)):(z.add(P),p--):(u(I,r),p--)}for(;p--;){const L=n[p];N.has(L.key)||u(L,r)}for(;b;)M(y[b-1]);return ne(W),y}function he(n){n&&n.c()}function _e(n,e,t){const{fragment:l,after_update:i}=n.$$;l&&l.m(e,t),ze(()=>{const s=n.$$.on_mount.map(Dt).filter(Vt);n.$$.on_destroy?n.$$.on_destroy.push(...s):ne(s),n.$$.on_mount=[]}),i.forEach(ze)}function me(n,e){const t=n.$$;t.fragment!==null&&(Gl(t.after_update),ne(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ul(n,e){n.$$.dirty[0]===-1&&(ke.push(n),ql(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const h=b.length?b[0]:p;return d.ctx&&i(d.ctx[k],d.ctx[k]=h)&&(!d.skip_bound&&d.bound[k]&&d.bound[k](h),_&&Ul(n,k)),p}):[],d.update(),_=!0,ne(d.before_update),d.fragment=l?l(d.ctx):!1,e.target){if(e.hydrate){const k=Bl(e.target);d.fragment&&d.fragment.l(k),k.forEach(m)}else d.fragment&&d.fragment.c();e.intro&&ee(n.$$.fragment),_e(n,e.target,e.anchor),Gt()}ye(u)}class Le{constructor(){Ie(this,"$$");Ie(this,"$$set")}$destroy(){me(this,1),this.$destroy=q}$on(e,t){if(!Vt(t))return q;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&&!Hl(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Zl="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Zl);function Xl(n){let e,t;return{c(){e=D("path"),t=D("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){v(l,e,i),v(l,t,i)},d(l){l&&(m(e),m(t))}}}function Yl(n){let e,t,l,i,s;return{c(){e=D("path"),t=D("polyline"),l=D("line"),i=D("line"),s=D("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){v(r,e,c),v(r,t,c),v(r,l,c),v(r,i,c),v(r,s,c)},d(r){r&&(m(e),m(t),m(l),m(i),m(s))}}}function Ql(n){let e,t;return{c(){e=D("polyline"),t=D("polyline"),o(e,"points","16 18 22 12 16 6"),o(t,"points","8 6 2 12 8 18")},m(l,i){v(l,e,i),v(l,t,i)},d(l){l&&(m(e),m(t))}}}function xl(n){let e,t,l,i;return{c(){e=D("path"),t=D("polyline"),l=D("line"),i=D("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){v(s,e,r),v(s,t,r),v(s,l,r),v(s,i,r)},d(s){s&&(m(e),m(t),m(l),m(i))}}}function $l(n){let e,t,l,i,s;return{c(){e=D("path"),t=D("polyline"),l=D("line"),i=D("line"),s=D("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){v(r,e,c),v(r,t,c),v(r,l,c),v(r,i,c),v(r,s,c)},d(r){r&&(m(e),m(t),m(l),m(i),m(s))}}}function en(n){let e,t,l,i,s,r;return{c(){e=D("path"),t=D("polyline"),l=D("line"),i=D("line"),s=D("line"),r=D("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){v(c,e,u),v(c,t,u),v(c,l,u),v(c,i,u),v(c,s,u),v(c,r,u)},d(c){c&&(m(e),m(t),m(l),m(i),m(s),m(r))}}}function tn(n){let e,t,l,i;return{c(){e=D("path"),t=D("polyline"),l=D("line"),i=D("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){v(s,e,r),v(s,t,r),v(s,l,r),v(s,i,r)},d(s){s&&(m(e),m(t),m(l),m(i))}}}function ln(n){let e,t,l,i,s;return{c(){e=D("path"),t=D("polyline"),l=D("line"),i=D("line"),s=D("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){v(r,e,c),v(r,t,c),v(r,l,c),v(r,i,c),v(r,s,c)},d(r){r&&(m(e),m(t),m(l),m(i),m(s))}}}function nn(n){let e,t,l;return{c(){e=D("path"),t=D("circle"),l=D("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){v(i,e,s),v(i,t,s),v(i,l,s)},d(i){i&&(m(e),m(t),m(l))}}}function sn(n){let e,t;return{c(){e=D("rect"),t=D("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){v(l,e,i),v(l,t,i)},d(l){l&&(m(e),m(t))}}}function rn(n){let e,t,l;return{c(){e=D("rect"),t=D("circle"),l=D("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){v(i,e,s),v(i,t,s),v(i,l,s)},d(i){i&&(m(e),m(t),m(l))}}}function on(n){let e;return{c(){e=D("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){v(t,e,l)},d(t){t&&m(e)}}}function cn(n){let e;function t(s,r){return s[0]==="folder"?on:s[0]==="image"?rn:s[0]==="video"?sn:s[0]==="audio"?nn:s[0]==="pdf"?ln:s[0]==="document"?tn:s[0]==="spreadsheet"?en:s[0]==="presentation"?$l:s[0]==="archive"?xl:s[0]==="code"?Ql:s[0]==="text"?Yl:Xl}let l=t(n),i=l(n);return{c(){e=D("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){v(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:q,o:q,d(s){s&&m(e),i.d()}}}function un(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 Kt extends Le{constructor(e){super(),Me(this,e,un,cn,Ce,{kind:0,size:1})}}function Pe(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 an={"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 Oe(n){return n?an[n]||n:"Unknown"}function Jt(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 fn=["image/jpeg","image/png","image/gif","image/webp","image/bmp","image/tiff","image/avif","image/svg+xml"],dn=["text/plain","text/html","text/css","text/javascript","application/json","application/xml","application/x-yaml","text/x-shellscript"],pn=["txt","log","conf","ini","yaml","yml","json","xml","csv","sh","py","js","ts","css","html","md","markdown","cfg"],_n=["jpg","jpeg","png","gif","webp","bmp","tiff","tif","avif","svg"];function Ut(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return fn.includes(e)||_n.includes(l)}function Zt(n){const e=(n.mime||"").toLowerCase(),l=(n.name||"").toLowerCase().split(".").pop();return dn.includes(e)||pn.includes(l)&&l!=="md"&&l!=="markdown"}function Xt(n){return(n.mime||"").toLowerCase().includes("pdf")}function Yt(n){const e=(n.name||"").toLowerCase();return e.endsWith(".md")||e.endsWith(".markdown")}function mn(n){return Ut(n)||Xt(n)}function vn(n){return Zt(n)||Yt(n)}function kn(n){let e,t=Pe(n[0].size)+"",l,i,s,r=n[0].mime&&$e(n);return{c(){e=f("span"),l=F(t),i=j(),r&&r.c(),s=ue()},m(c,u){v(c,e,u),a(e,l),v(c,i,u),r&&r.m(c,u),v(c,s,u)},p(c,u){u&1&&t!==(t=Pe(c[0].size)+"")&&V(l,t),c[0].mime?r?r.p(c,u):(r=$e(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 bn(n){let e;return{c(){e=f("span"),e.textContent="Folder"},m(t,l){v(t,e,l)},p:q,d(t){t&&m(e)}}}function $e(n){let e,t,l,i=Oe(n[0].mime)+"",s;return{c(){e=f("span"),e.textContent="·",t=j(),l=f("span"),s=F(i),o(e,"class","meta-sep svelte-15klzc3")},m(r,c){v(r,e,c),v(r,t,c),v(r,l,c),a(l,s)},p(r,c){c&1&&i!==(i=Oe(r[0].mime)+"")&&V(s,i)},d(r){r&&(m(e),m(t),m(l))}}}function hn(n){let e,t,l;return{c(){e=f("button"),e.innerHTML=' ',o(e,"class","action-btn svelte-15klzc3"),o(e,"title","Open folder"),o(e,"aria-label","Open folder")},m(i,s){v(i,e,s),t||(l=T(e,"click",Fe(n[3])),t=!0)},p:q,d(i){i&&m(e),t=!1,l()}}}function wn(n){let e,t,l,i,s;return{c(){e=f("button"),e.innerHTML=' ',t=j(),l=f("button"),l.innerHTML=' ',o(e,"class","action-btn svelte-15klzc3"),o(e,"title","Preview"),o(e,"aria-label","Preview"),o(l,"class","action-btn svelte-15klzc3"),o(l,"title","Open in external program"),o(l,"aria-label","Open externally")},m(r,c){v(r,e,c),v(r,t,c),v(r,l,c),i||(s=[T(e,"click",Fe(n[3])),T(l,"click",Fe(n[5]))],i=!0)},p:q,d(r){r&&(m(e),m(t),m(l)),i=!1,ne(s)}}}function gn(n){let e,t,l,i,s,r,c=n[0].name+"",u,d,_,k,p,b,h,w,y,N,A,W;l=new Kt({props:{kind:n[1],size:22}});function z(P,G){return P[2]?bn:kn}let M=z(n)(n);function L(P,G){return P[2]?hn:wn}let E=L(n)(n);return{c(){e=f("div"),t=f("div"),he(l.$$.fragment),i=j(),s=f("div"),r=f("div"),u=F(c),_=j(),k=f("div"),M.c(),p=j(),b=f("div"),E.c(),h=j(),w=f("button"),w.innerHTML=' ',o(t,"class","file-row-icon svelte-15klzc3"),o(r,"class","file-row-name svelte-15klzc3"),o(r,"title",d=n[0].name),o(k,"class","file-row-meta svelte-15klzc3"),o(s,"class","file-row-body svelte-15klzc3"),o(w,"class","action-btn action-btn-danger svelte-15klzc3"),o(w,"title","Delete"),o(w,"aria-label","Delete"),o(b,"class","file-row-actions svelte-15klzc3"),o(e,"class","file-row svelte-15klzc3"),o(e,"role","button"),o(e,"tabindex","0"),o(e,"aria-label",y=n[2]?`Open folder ${n[0].name}`:`Preview ${n[0].name}`)},m(P,G){v(P,e,G),a(e,t),_e(l,t,null),a(e,i),a(e,s),a(s,r),a(r,u),a(s,_),a(s,k),M.m(k,null),a(e,p),a(e,b),E.m(b,null),a(b,h),a(b,w),N=!0,A||(W=[T(w,"click",Fe(n[6])),T(e,"click",n[3]),T(e,"keydown",n[4])],A=!0)},p(P,[G]){(!N||G&1)&&c!==(c=P[0].name+"")&&V(u,c),(!N||G&1&&d!==(d=P[0].name))&&o(r,"title",d),M.p(P,G),E.p(P,G),(!N||G&1&&y!==(y=P[2]?`Open folder ${P[0].name}`:`Preview ${P[0].name}`))&&o(e,"aria-label",y)},i(P){N||(ee(l.$$.fragment,P),N=!0)},o(P){le(l.$$.fragment,P),N=!1},d(P){P&&m(e),me(l),M.d(),E.d(),A=!1,ne(W)}}}function yn(n,e,t){let{item:l}=e;const i=qe(),s=Jt(l),r=l.type==="folder";function c(){r?i("navigate",l.id):i("preview",l)}function u(k){k.key==="Enter"&&c()}function d(){i("openExternal",l.fileId)}function _(){i("delete",l.id)}return n.$$set=k=>{"item"in k&&t(0,l=k.item)},[l,s,r,c,u,d,_]}class jn extends Le{constructor(e){super(),Me(this,e,yn,gn,Ce,{item:0})}}function et(n,e,t){const l=n.slice();return l[4]=e[t],l[6]=t,l}function Cn(n){let e;return{c(){e=f("span"),e.textContent="/",o(e,"class","sep svelte-csi2lb")},m(t,l){v(t,e,l)},d(t){t&&m(e)}}}function Mn(n){let e,t=n[4].name+"",l,i,s;function r(){return n[2](n[6])}return{c(){e=f("button"),l=F(t),o(e,"class","crumb crumb--link svelte-csi2lb")},m(c,u){v(c,e,u),a(e,l),i||(s=T(e,"click",r),i=!0)},p(c,u){n=c,u&1&&t!==(t=n[4].name+"")&&V(l,t)},d(c){c&&m(e),i=!1,s()}}}function Ln(n){let e,t=n[4].name+"",l;return{c(){e=f("span"),l=F(t),o(e,"class","crumb crumb--current svelte-csi2lb")},m(i,s){v(i,e,s),a(e,l)},p(i,s){s&1&&t!==(t=i[4].name+"")&&V(l,t)},d(i){i&&m(e)}}}function tt(n){let e,t,l=n[6]>0&&Cn();function i(c,u){return c[6]===c[0].length-1?Ln:Mn}let s=i(n),r=s(n);return{c(){l&&l.c(),e=j(),r.c(),t=ue()},m(c,u){l&&l.m(c,u),v(c,e,u),r.m(c,u),v(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 Nn(n){let e,t=$(n[0]),l=[];for(let i=0;is(c);return n.$$set=c=>{"crumbs"in c&&t(0,l=c.crumbs)},[l,s,r]}class Qt extends Le{constructor(e){super(),Me(this,e,En,Nn,Ce,{crumbs:0})}}function Sn(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){v(c,e,u),a(e,t),a(e,l),a(e,i),s||(r=T(i,"click",n[9]),s=!0)},p:q,d(c){c&&m(e),s=!1,r()}}}function Fn(n){let e,t;function l(r,c){return c&2&&(e=null),e==null&&(e=!!(r[1]&&r[1].startsWith("data:"))),e?Hn:An}let i=l(n,-1),s=i(n);return{c(){s.c(),t=ue()},m(r,c){s.m(r,c),v(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=F(n[1]),o(e,"class","preview-text svelte-1ybaoro")},m(i,s){v(i,e,s),a(e,t),a(t,l)},p(i,s){s&2&&V(l,i[1])},d(i){i&&m(e)}}}function Pn(n){let e,t,l,i;return{c(){e=f("div"),t=f("img"),Se(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){v(s,e,r),a(e,t)},p(s,r){r&2&&!Se(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 On(n){let e,t,l,i,s,r,c;return{c(){e=f("div"),t=f("p"),l=F(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){v(u,e,d),a(e,t),a(t,l),a(e,i),a(e,s),r||(c=T(s,"click",n[9]),r=!0)},p(u,d){d&8&&V(l,u[3])},d(u){u&&m(e),r=!1,c()}}}function Tn(n){let e;return{c(){e=f("div"),e.innerHTML="Loading preview...
",o(e,"class","preview-status svelte-1ybaoro")},m(t,l){v(t,e,l)},p:q,d(t){t&&m(e)}}}function An(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){v(c,e,u),a(e,t),a(e,l),a(e,i),s||(r=T(i,"click",n[9]),s=!0)},p:q,d(c){c&&m(e),s=!1,r()}}}function Hn(n){let e,t,l;return{c(){e=f("div"),t=f("embed"),Se(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){v(i,e,s),a(e,t)},p(i,s){s&2&&!Se(t.src,l=i[1])&&o(t,"src",l)},d(i){i&&m(e)}}}function In(n){let e,t,l,i,s,r,c,u=n[0].name+"",d,_,k,p,b=Pe(n[0].size)+"",h,w,y=Oe(n[0].mime)+"",N,A,W,z,S,M,L,I,E,P,G,K;s=new Kt({props:{kind:n[5],size:18}});function X(O,Y){return O[2]?Tn:O[3]?On:O[6]&&O[1]?Pn:O[7]&&O[1]?zn:O[8]?Fn:Sn}let Z=X(n),U=Z(n);return{c(){e=f("div"),t=f("div"),l=f("header"),i=f("div"),he(s.$$.fragment),r=j(),c=f("span"),d=F(u),k=j(),p=f("div"),h=F(b),w=F(" · "),N=F(y),A=j(),W=f("div"),z=f("button"),z.innerHTML=' ',S=j(),M=f("button"),M.innerHTML=' ',L=j(),I=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(z,"class","action-btn svelte-1ybaoro"),o(z,"title","Open in external program"),o(z,"aria-label","Open externally"),o(M,"class","action-btn svelte-1ybaoro"),o(M,"title","Close"),o(M,"aria-label","Close preview"),o(W,"class","preview-actions svelte-1ybaoro"),o(l,"class","preview-header svelte-1ybaoro"),o(I,"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",E=`Preview: ${n[0].name}`)},m(O,Y){v(O,e,Y),a(e,t),a(t,l),a(l,i),_e(s,i,null),a(i,r),a(i,c),a(c,d),a(l,k),a(l,p),a(p,h),a(p,w),a(p,N),a(l,A),a(l,W),a(W,z),a(W,S),a(W,M),a(t,L),a(t,I),U.m(I,null),P=!0,G||(K=[T(z,"click",n[9]),T(M,"click",n[10]),T(e,"click",Ve(n[11]))],G=!0)},p(O,[Y]){(!P||Y&1)&&u!==(u=O[0].name+"")&&V(d,u),(!P||Y&1&&_!==(_=O[0].name))&&o(c,"title",_),(!P||Y&1)&&b!==(b=Pe(O[0].size)+"")&&V(h,b),(!P||Y&1)&&y!==(y=Oe(O[0].mime)+"")&&V(N,y),Z===(Z=X(O))&&U?U.p(O,Y):(U.d(1),U=Z(O),U&&(U.c(),U.m(I,null))),(!P||Y&1&&E!==(E=`Preview: ${O[0].name}`))&&o(e,"aria-label",E)},i(O){P||(ee(s.$$.fragment,O),P=!0)},o(O){le(s.$$.fragment,O),P=!1},d(O){O&&m(e),me(s),U.d(),G=!1,ne(K)}}}function Bn(n,e,t){let{item:l}=e,{content:i=""}=e,{loading:s=!1}=e,{error:r=""}=e;const c=qe(),u=Jt(l),d=Ut(l)&&i&&i.startsWith("data:"),_=Zt(l)||Yt(l),k=Xt(l);function p(y){y.key==="Escape"&&c("close")}function b(){c("openExternal",l.fileId)}qt(()=>{window.addEventListener("keydown",p)}),Rt(()=>{window.removeEventListener("keydown",p)});const h=()=>c("close"),w=()=>c("close");return n.$$set=y=>{"item"in y&&t(0,l=y.item),"content"in y&&t(1,i=y.content),"loading"in y&&t(2,s=y.loading),"error"in y&&t(3,r=y.error)},[l,i,s,r,c,u,d,_,k,b,h,w]}class Dn extends Le{constructor(e){super(),Me(this,e,Bn,In,Ce,{item:0,content:1,loading:2,error:3})}}function lt(n,e,t){const l=n.slice();return l[93]=e[t],l}function nt(n,e,t){const l=n.slice();return l[96]=e[t],l}function it(n,e,t){const l=n.slice();return l[107]=e[t],l}function st(n,e,t){const l=n.slice();return l[104]=e[t],l}function rt(n,e,t){const l=n.slice();return l[99]=e[t],l}function ot(n,e,t){const l=n.slice();return l[96]=e[t],l}function ct(n,e,t){const l=n.slice();return l[99]=e[t],l}function ut(n,e,t){const l=n.slice();return l[112]=e[t],l}function at(n,e,t){const l=n.slice();return l[93]=e[t],l}function ft(n,e,t){const l=n.slice();return l[117]=e[t],l}function dt(n,e,t){const l=n.slice();return l[120]=e[t],l}function pt(n){let e,t=n[120].label+"",l,i,s,r,c;function u(){return n[56](n[120])}return{c(){e=f("button"),l=F(t),i=j(),o(e,"class",s="nav-item "+(n[4]===n[120].id?"selected":"")+" svelte-1rwjkun")},m(d,_){v(d,e,_),a(e,l),a(e,i),r||(c=T(e,"click",u),r=!0)},p(d,_){n=d,_[0]&1&&t!==(t=n[120].label+"")&&V(l,t),_[0]&17&&s!==(s="nav-item "+(n[4]===n[120].id?"selected":"")+" svelte-1rwjkun")&&o(e,"class",s)},d(d){d&&m(e),r=!1,c()}}}function _t(n){let e,t,l,i,s,r=n[1].length>0&&mt(n),c=$(n[1]),u=[];for(let _=0;_0?r?r.p(_,k):(r=mt(_),r.c(),r.m(t,null)):r&&(r.d(1),r=null),k[0]&34|k[1]&2){c=$(_[1]);let p;for(p=0;p0)return Un;if(c[3])return Jn}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){v(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:q,o:q,d(c){c&&m(e),r&&r.d()}}}function Gn(n){let e,t,l,i,s,r,c=$(n[30]),u=[];for(let p=0;p{_[h]=null}),pe()),~i?(s=_[i],s?s.p(p,b):(s=_[i]=d[i](p),s.c()),ee(s,1),s.m(l,null)):s=null)},i(p){r||(ee(s),r=!0)},o(p){le(s),r=!1},d(p){p&&(m(e),m(t),m(l)),ce(u,p),~i&&_[i].d()}}}function Kn(n){let e,t,l,i=n[8].title+"",s,r,c,u,d,_,k,p,b,h,w,y=n[8].dirty&&Pt();return{c(){e=f("div"),t=f("div"),l=f("span"),s=F(i),r=j(),y&&y.c(),c=j(),u=f("div"),d=f("button"),d.textContent="Сохранить",_=j(),k=f("button"),k.textContent="Закрыть",p=j(),b=f("textarea"),o(l,"class","note-title svelte-1rwjkun"),o(d,"class","btn btn-primary svelte-1rwjkun"),o(k,"class","btn svelte-1rwjkun"),o(u,"class","note-editor-actions svelte-1rwjkun"),o(t,"class","note-editor-header svelte-1rwjkun"),o(b,"class","note-textarea svelte-1rwjkun"),o(b,"placeholder","Начните писать..."),o(e,"class","note-editor svelte-1rwjkun")},m(N,A){v(N,e,A),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,k),a(e,p),a(e,b),re(b,n[8].content),h||(w=[T(d,"click",n[48]),T(k,"click",n[46]),T(b,"input",n[59]),T(b,"input",n[47])],h=!0)},p(N,A){A[0]&256&&i!==(i=N[8].title+"")&&V(s,i),N[8].dirty?y||(y=Pt(),y.c(),y.m(t,c)):y&&(y.d(1),y=null),A[0]&256&&re(b,N[8].content)},i:q,o:q,d(N){N&&m(e),y&&y.d(),h=!1,ne(w)}}}function Jn(n){let e,t,l;return{c(){e=f("p"),t=F("Ошибка: "),l=F(n[3]),o(e,"class","error-text svelte-1rwjkun")},m(i,s){v(i,e,s),a(e,t),a(e,l)},p(i,s){s[0]&8&&V(l,i[3])},d(i){i&&m(e)}}}function Un(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){v(i,e,s),v(i,t,s),v(i,l,s)},p:q,d(i){i&&(m(e),m(t),m(l))}}}function Zn(n){let e;return{c(){e=f("p"),e.textContent="Загрузка...",o(e,"class","svelte-1rwjkun")},m(t,l){v(t,e,l)},p:q,d(t){t&&m(e)}}}function wt(n){let e,t=n[112].label+"",l,i,s;function r(){return n[60](n[112])}return{c(){e=f("button"),l=F(t),o(e,"class",Il(n[55](n[112].id))+" svelte-1rwjkun")},m(c,u){v(c,e,u),a(e,l),i||(s=T(e,"click",r),i=!0)},p(c,u){n=c},d(c){c&&m(e),i=!1,s()}}}function Xn(n){let e;return{c(){e=f("div"),e.innerHTML='Активность появится позже
',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){v(t,e,l)},p:q,i:q,o:q,d(t){t&&m(e)}}}function Yn(n){let e,t,l,i,s,r,c,u,d,_,k,p;function b(y,N){return y[10].length===0?li:ti}let h=b(n),w=h(n);return{c(){e=f("div"),t=f("div"),l=f("input"),i=j(),s=f("input"),r=j(),c=f("button"),u=F("Записать"),_=j(),w.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){v(y,e,N),a(e,t),a(t,l),re(l,n[12]),a(t,i),a(t,s),re(s,n[11]),a(t,r),a(t,c),a(c,u),a(e,_),w.m(e,null),k||(p=[T(l,"input",n[75]),T(s,"input",n[76]),T(c,"click",n[49])],k=!0)},p(y,N){N[0]&4096&&l.value!==y[12]&&re(l,y[12]),N[0]&2048&&Wt(s.value)!==y[11]&&re(s,y[11]),N[0]&6144&&d!==(d=!y[12].trim()||!y[11])&&(c.disabled=d),h===(h=b(y))&&w?w.p(y,N):(w.d(1),w=h(y),w&&(w.c(),w.m(e,null)))},i:q,o:q,d(y){y&&m(e),w.d(),k=!1,ne(p)}}}function Qn(n){let e;function t(s,r){return s[9].length===0?ii:ni}let l=t(n),i=l(n);return{c(){i.c(),e=ue()},m(s,r){i.m(s,r),v(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:q,o:q,d(s){s&&m(e),i.d(s)}}}function xn(n){let e,t,l,i,s,r,c,u,d,_,k,p,b,h,w,y;const N=[ri,si],A=[];function W(M,L){return M[22]?0:1}d=W(n),_=A[d]=N[d](n);let z=n[19]&&!n[21]&&Ct(),S=n[26]&&Mt(n);return{c(){e=f("div"),t=f("div"),l=f("button"),i=F("+ Добавить файл"),s=j(),r=f("button"),c=F("+ Добавить папку"),u=j(),_.c(),k=j(),z&&z.c(),p=j(),S&&S.c(),b=ue(),o(l,"class","btn btn-primary svelte-1rwjkun"),l.disabled=n[19],o(r,"class","btn svelte-1rwjkun"),r.disabled=n[19],o(t,"class","tab-toolbar svelte-1rwjkun"),o(e,"class","files-tab svelte-1rwjkun")},m(M,L){v(M,e,L),a(e,t),a(t,l),a(l,i),a(t,s),a(t,r),a(r,c),a(e,u),A[d].m(e,null),a(e,k),z&&z.m(e,null),v(M,p,L),S&&S.m(M,L),v(M,b,L),h=!0,w||(y=[T(l,"click",n[50]),T(r,"click",n[51])],w=!0)},p(M,L){(!h||L[0]&524288)&&(l.disabled=M[19]),(!h||L[0]&524288)&&(r.disabled=M[19]);let I=d;d=W(M),d===I?A[d].p(M,L):(de(),le(A[I],1,1,()=>{A[I]=null}),pe(),_=A[d],_?_.p(M,L):(_=A[d]=N[d](M),_.c()),ee(_,1),_.m(e,k)),M[19]&&!M[21]?z||(z=Ct(),z.c(),z.m(e,null)):z&&(z.d(1),z=null),M[26]?S?(S.p(M,L),L[0]&67108864&&ee(S,1)):(S=Mt(M),S.c(),ee(S,1),S.m(b.parentNode,b)):S&&(de(),le(S,1,1,()=>{S=null}),pe())},i(M){h||(ee(_),ee(S),h=!0)},o(M){le(_),le(S),h=!1},d(M){M&&(m(e),m(p),m(b)),A[d].d(),z&&z.d(),S&&S.d(M),w=!1,ne(y)}}}function $n(n){let e,t,l,i,s,r,c,u=n[16]&&Lt(n);function d(p,b){return p[7].length===0&&!p[16]?di:fi}let _=d(n),k=_(n);return{c(){e=f("div"),t=f("div"),l=f("button"),l.textContent="+ Добавить заметку",i=j(),u&&u.c(),s=j(),k.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,b){v(p,e,b),a(e,t),a(t,l),a(e,i),u&&u.m(e,null),a(e,s),k.m(e,null),r||(c=T(l,"click",n[42]),r=!0)},p(p,b){p[16]?u?u.p(p,b):(u=Lt(p),u.c(),u.m(e,s)):u&&(u.d(1),u=null),_===(_=d(p))&&k?k.p(p,b):(k.d(1),k=_(p),k&&(k.c(),k.m(e,null)))},i:q,o:q,d(p){p&&m(e),u&&u.d(),k.d(),r=!1,c()}}}function ei(n){let e,t,l=n[5].title+"",i,s,r,c,u,d,_=n[5].type+"",k,p,b,h,w,y=(n[5].section||"—")+"",N,A,W,z,S,M=ae(n[5].createdAt)+"",L,I,E,P,G,K,X,Z,U,O,Y,te,ie,Q,J=n[7].length>0&&Et(n),H=n[10].length>0&&Ft(n);return{c(){e=f("div"),t=f("h2"),i=F(l),s=j(),r=f("div"),c=f("div"),u=f("span"),u.textContent="Тип",d=f("span"),k=F(_),p=j(),b=f("div"),h=f("span"),h.textContent="Раздел",w=f("span"),N=F(y),A=j(),W=f("div"),z=f("span"),z.textContent="Создано",S=f("span"),L=F(M),I=j(),E=f("div"),P=f("button"),P.textContent="✏️ Новая заметка",G=j(),K=f("button"),K.textContent="📎 Добавить файл",X=j(),Z=f("button"),Z.textContent="⚡ Добавить действие",U=j(),O=f("button"),O.textContent="🕐 Записать время",Y=j(),J&&J.c(),te=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(h,"class","meta-label svelte-1rwjkun"),o(w,"class","svelte-1rwjkun"),o(b,"class","meta-item svelte-1rwjkun"),o(z,"class","meta-label svelte-1rwjkun"),o(S,"class","svelte-1rwjkun"),o(W,"class","meta-item svelte-1rwjkun"),o(r,"class","meta-grid svelte-1rwjkun"),o(P,"class","qa-btn svelte-1rwjkun"),o(K,"class","qa-btn svelte-1rwjkun"),o(Z,"class","qa-btn svelte-1rwjkun"),Z.disabled=!0,o(Z,"title","Следующий этап"),o(O,"class","qa-btn svelte-1rwjkun"),o(E,"class","quick-actions svelte-1rwjkun"),o(e,"class","overview svelte-1rwjkun")},m(C,B){v(C,e,B),a(e,t),a(t,i),a(e,s),a(e,r),a(r,c),a(c,u),a(c,d),a(d,k),a(r,p),a(r,b),a(b,h),a(b,w),a(w,N),a(r,A),a(r,W),a(W,z),a(W,S),a(S,L),a(e,I),a(e,E),a(E,P),a(E,G),a(E,K),a(E,X),a(E,Z),a(E,U),a(E,O),a(e,Y),J&&J.m(e,null),a(e,te),H&&H.m(e,null),ie||(Q=[T(P,"click",n[61]),T(K,"click",n[62]),T(O,"click",n[63])],ie=!0)},p(C,B){B[0]&32&&l!==(l=C[5].title+"")&&V(i,l),B[0]&32&&_!==(_=C[5].type+"")&&V(k,_),B[0]&32&&y!==(y=(C[5].section||"—")+"")&&V(N,y),B[0]&32&&M!==(M=ae(C[5].createdAt)+"")&&V(L,M),C[7].length>0?J?J.p(C,B):(J=Et(C),J.c(),J.m(e,te)):J&&(J.d(1),J=null),C[10].length>0?H?H.p(C,B):(H=Ft(C),H.c(),H.m(e,null)):H&&(H.d(1),H=null)},i:q,o:q,d(C){C&&m(e),J&&J.d(),H&&H.d(),ie=!1,ne(Q)}}}function ti(n){let e,t=$(n[10]),l=[];for(let i=0;iЗаписей работы пока нет
',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){v(t,e,l)},p:q,d(t){t&&m(e)}}}function gt(n){let e,t,l=n[96].summary+"",i,s,r,c=n[96].minutes+"",u,d,_=ae(n[96].createdAt)+"",k,p;return{c(){e=f("div"),t=f("div"),i=F(l),s=j(),r=f("div"),u=F(c),d=F(" мин · "),k=F(_),p=j(),o(t,"class","svelte-1rwjkun"),o(r,"class","wl-meta svelte-1rwjkun"),o(e,"class","worklog-entry svelte-1rwjkun")},m(b,h){v(b,e,h),a(e,t),a(t,i),a(e,s),a(e,r),a(r,u),a(r,d),a(r,k),a(e,p)},p(b,h){h[0]&1024&&l!==(l=b[96].summary+"")&&V(i,l),h[0]&1024&&c!==(c=b[96].minutes+"")&&V(u,c),h[0]&1024&&_!==(_=ae(b[96].createdAt)+"")&&V(k,_)},d(b){b&&m(e)}}}function ni(n){let e,t=$(n[9]),l=[];for(let i=0;iДействий пока нет',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){v(t,e,l)},p:q,d(t){t&&m(e)}}}function yt(n){let e,t,l=n[107].title+"",i,s,r=n[107].type+"",c,u,d,_,k,p;function b(){return n[74](n[107])}return{c(){e=f("div"),t=f("span"),i=F(l),s=f("span"),c=F(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(h,w){v(h,e,w),a(e,t),a(t,i),a(e,s),a(s,c),a(e,u),a(e,d),a(e,_),k||(p=T(d,"click",b),k=!0)},p(h,w){n=h,w[0]&512&&l!==(l=n[107].title+"")&&V(i,l),w[0]&512&&r!==(r=n[107].type+"")&&V(c,r)},d(h){h&&m(e),k=!1,p()}}}function si(n){let e,t,l,i,s,r,c;const u=[ci,oi],d=[];function _(h,w){return h[24].length>0?0:1}e=_(n),t=d[e]=u[e](n);const k=[ai,ui],p=[];function b(h,w){return h[25].length===0?0:1}return i=b(n),s=p[i]=k[i](n),{c(){t.c(),l=j(),s.c(),r=ue()},m(h,w){d[e].m(h,w),v(h,l,w),p[i].m(h,w),v(h,r,w),c=!0},p(h,w){let y=e;e=_(h),e===y?d[e].p(h,w):(de(),le(d[y],1,1,()=>{d[y]=null}),pe(),t=d[e],t?t.p(h,w):(t=d[e]=u[e](h),t.c()),ee(t,1),t.m(l.parentNode,l));let N=i;i=b(h),i===N?p[i].p(h,w):(de(),le(p[N],1,1,()=>{p[N]=null}),pe(),s=p[i],s?s.p(h,w):(s=p[i]=k[i](h),s.c()),ee(s,1),s.m(r.parentNode,r))},i(h){c||(ee(t),ee(s),c=!0)},o(h){le(t),le(s),c=!1},d(h){h&&(m(l),m(r)),d[e].d(h),p[i].d(h)}}}function ri(n){let e;return{c(){e=f("div"),e.innerHTML='Загрузка...
',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){v(t,e,l)},p:q,i:q,o:q,d(t){t&&m(e)}}}function oi(n){let e,t;return e=new Qt({props:{crumbs:[{name:"Files"}]}}),{c(){he(e.$$.fragment)},m(l,i){_e(e,l,i),t=!0},p:q,i(l){t||(ee(e.$$.fragment,l),t=!0)},o(l){le(e.$$.fragment,l),t=!1},d(l){me(e,l)}}}function ci(n){let e,t,l,i,s,r;return e=new Qt({props:{crumbs:[{name:"Files"},...n[24]]}}),e.$on("navigate",n[68]),{c(){he(e.$$.fragment),t=j(),l=f("button"),l.textContent="← Back",o(l,"class","btn btn-sm back-btn svelte-1rwjkun")},m(c,u){_e(e,c,u),v(c,t,u),v(c,l,u),i=!0,s||(r=T(l,"click",n[35]),s=!0)},p(c,u){const d={};u[0]&16777216&&(d.crumbs=[{name:"Files"},...c[24]]),e.$set(d)},i(c){i||(ee(e.$$.fragment,c),i=!0)},o(c){le(e.$$.fragment,c),i=!1},d(c){c&&(m(t),m(l)),me(e,c),s=!1,r()}}}function ui(n){let e,t=[],l=new Map,i,s=$(n[25]);const r=c=>c[104].id;for(let c=0;c0?"В этой папке пока нет файлов":"В этом проекте пока нет файлов",r,c,u,d,_,k,p,b,h,w;return{c(){e=f("div"),t=f("div"),t.innerHTML=' ',l=j(),i=f("p"),r=F(s),c=j(),u=f("p"),u.textContent="Добавьте файл или папку, чтобы сохранить материалы проекта.",d=j(),_=f("div"),k=f("button"),k.textContent="Добавить файл",p=j(),b=f("button"),b.textContent="Добавить папку",o(t,"class","empty-icon svelte-1rwjkun"),o(i,"class","svelte-1rwjkun"),o(u,"class","hint svelte-1rwjkun"),o(k,"class","btn btn-primary svelte-1rwjkun"),o(b,"class","btn svelte-1rwjkun"),o(_,"class","empty-actions svelte-1rwjkun"),o(e,"class","empty-state svelte-1rwjkun")},m(y,N){v(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(_,k),a(_,p),a(_,b),h||(w=[T(k,"click",n[50]),T(b,"click",n[51])],h=!0)},p(y,N){N[0]&16777216&&s!==(s=y[24].length>0?"В этой папке пока нет файлов":"В этом проекте пока нет файлов")&&V(r,s)},i:q,o:q,d(y){y&&m(e),h=!1,ne(w)}}}function jt(n,e){let t,l,i;return l=new jn({props:{item:e[104]}}),l.$on("navigate",e[69]),l.$on("preview",e[70]),l.$on("openExternal",e[71]),l.$on("delete",e[72]),{key:n,first:null,c(){t=ue(),he(l.$$.fragment),this.first=t},m(s,r){v(s,t,r),_e(l,s,r),i=!0},p(s,r){e=s;const c={};r[0]&33554432&&(c.item=e[104]),l.$set(c)},i(s){i||(ee(l.$$.fragment,s),i=!0)},o(s){le(l.$$.fragment,s),i=!1},d(s){s&&m(t),me(l,s)}}}function Ct(n){let e;return{c(){e=f("div"),e.innerHTML='Сканирование...
',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){v(t,e,l)},d(t){t&&m(e)}}}function Mt(n){let e,t;return e=new Dn({props:{item:n[26],content:n[27],loading:n[28],error:n[29]}}),e.$on("close",n[38]),e.$on("openExternal",n[73]),{c(){he(e.$$.fragment)},m(l,i){_e(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||(ee(e.$$.fragment,l),t=!0)},o(l){le(e.$$.fragment,l),t=!1},d(l){me(e,l)}}}function Lt(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(_,k){v(_,e,k),a(e,t),re(t,n[17]),a(e,l),a(e,i),a(i,s),a(i,r),a(i,c),u||(d=[T(t,"input",n[65]),T(t,"keydown",n[66]),T(s,"click",n[44]),T(c,"click",n[43])],u=!0)},p(_,k){k[0]&131072&&t.value!==_[17]&&re(t,_[17])},d(_){_&&m(e),u=!1,ne(d)}}}function fi(n){let e,t=$(n[7]),l=[];for(let i=0;iНет заметокСоздайте первую заметку для этого дела.
',o(e,"class","empty-state svelte-1rwjkun")},m(t,l){v(t,e,l)},p:q,d(t){t&&m(e)}}}function Nt(n){let e,t,l=n[99].title+"",i,s,r,c=ae(n[99].createdAt)+"",u,d,_,k;function p(){return n[67](n[99])}return{c(){e=f("div"),t=f("div"),i=F(l),s=j(),r=f("div"),u=F(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(b,h){v(b,e,h),a(e,t),a(t,i),a(e,s),a(e,r),a(r,u),a(e,d),_||(k=T(e,"click",p),_=!0)},p(b,h){n=b,h[0]&128&&l!==(l=n[99].title+"")&&V(i,l),h[0]&128&&c!==(c=ae(n[99].createdAt)+"")&&V(u,c)},d(b){b&&m(e),_=!1,k()}}}function Et(n){let e,t,l,i=$(n[7].slice(0,5)),s=[];for(let r=0;rn[79].call(b)),o(_,"class","form-group svelte-1rwjkun"),o(y,"class","btn btn-primary svelte-1rwjkun"),o(A,"class","btn svelte-1rwjkun"),o(w,"class","modal-actions svelte-1rwjkun"),o(t,"class","modal svelte-1rwjkun"),o(e,"class","modal-overlay svelte-1rwjkun")},m(L,I){v(L,e,I),a(e,t),a(t,l),a(t,i),a(t,s),a(s,r),a(s,c),a(s,u),re(u,n[14]),a(t,d),a(t,_),a(_,k),a(_,p),a(_,b);for(let E=0;E⚒ Верстак ',i=j(),s=f("nav"),r=f("div"),c=f("div"),c.textContent="Разделы",u=j();for(let C=0;C{te[oe]=null}),pe(),S=te[z],S?S.p(C,B):(S=te[z]=Y[z](C),S.c()),ee(S,1),S.m(w,M)),!C[8]&&!C[5]?Q?Q.p(C,B):(Q=Ot(C),Q.c(),Q.m(w,L)):Q&&(Q.d(1),Q=null),C[13]?J?J.p(C,B):(J=Tt(C),J.c(),J.m(w,I)):J&&(J.d(1),J=null),C[21]&&C[20]?H?H.p(C,B):(H=Ht(C),H.c(),H.m(w,null)):H&&(H.d(1),H=null)},i(C){E||(ee(S),E=!0)},o(C){le(S),E=!1},d(C){C&&m(e),ce(G,C),K&&K.d(),U.d(),O&&O.d(),te[z].d(),Q&&Q.d(),J&&J.d(),H&&H.d()}}}function x(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 ae(n){if(!n)return"";try{return new Date(n).toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}catch{return n}}const Bt=n=>n.id!=="today"&&n.id!=="inbox";function _i(n,e,t){let l=[],i=[],s="",r="",c="",u=null,d="overview",_=[],k=null,p=[],b=[],h=[],w="",y="",N=!1,A="",W="clients",z=!1,S="",M=!0,L=!1,I=null,E=!1,P="",G=!1,K=null,X=[],Z=[],U=null,O="",Y=!1,te="";const ie=[{id:"overview",label:"Обзор"},{id:"notes",label:"Заметки"},{id:"files",label:"Файлы"},{id:"actions",label:"Действия"},{id:"worklog",label:"Журнал"},{id:"activity",label:"Активность"}];let Q=null;qt(async()=>{try{t(2,s=await x("VerstakVersion")||"verstak-gui/v2"),t(0,l=await x("ListSections")||[])}catch(g){t(3,r=String(g)),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",cl),Q=()=>window.runtime.EventsOff("files-dropped")),t(18,M=!1)}),Rt(()=>{Q&&Q()});async function J(g){t(4,c=g),t(5,u=null),t(6,d="overview"),t(7,_=[]),p=[],t(9,b=[]),t(10,h=[]),t(13,N=!1),t(3,r="");try{t(1,i=await x("ListNodesBySection",g)||[])}catch(R){t(3,r=String(R)),t(1,i=[])}}async function H(g){t(5,u=g),t(6,d="overview"),t(7,_=[]),p=[],t(9,b=[]),t(10,h=[]),t(25,Z=[]),t(24,X=[]),t(23,K=null),t(26,U=null),t(27,O=""),t(8,k=null),t(13,N=!1),t(16,z=!1),t(3,r=""),await C(g.id)}async function C(g){try{t(7,_=await x("ListNotes",g)||[])}catch{}try{p=await x("ListFiles",g)||[]}catch{}try{t(9,b=await x("ListActions",g)||[])}catch{}try{t(10,h=await x("ListWorklog",g)||[])}catch{}}async function B(g){t(22,G=!0);try{t(25,Z=await x("ListItems",g)||[])}catch{t(25,Z=[])}t(22,G=!1)}async function oe(g){if(u){try{const R=await x("GetNodeDetail",g);R&&t(24,X=[...X,{id:g,name:R.title}])}catch{t(24,X=[...X,{id:g,name:"..."}])}t(23,K=g),await B(g)}}function se(){if(X.length<2)t(24,X=[]),t(23,K=null),B(u.id);else{const g=X[X.length-2];t(24,X=X.slice(0,-1)),t(23,K=g.id),B(g.id)}}function we(g){const R=X[g];t(24,X=X.slice(0,g+1)),t(23,K=R.id),B(R.id)}async function Re(g){t(26,U=g),t(27,O=""),t(29,te=""),t(28,Y=!0);try{mn(g)?t(27,O=await x("GetFileBase64",g.fileId)||""):vn(g)&&t(27,O=await x("ReadFileText",g.fileId)||"")}catch(R){t(29,te=String(R))}t(28,Y=!1)}function xt(){t(26,U=null),t(27,O=""),t(29,te="")}function $t(){t(13,N=!0),t(14,A=""),t(15,W=c||"clients")}function el(){t(13,N=!1),t(14,A="")}async function Ge(){if(A.trim())try{const g=await x("CreateNode","","case",A.trim(),W);t(13,N=!1),t(14,A=""),await J(W)}catch(g){t(3,r=String(g))}}function Ke(){t(16,z=!0),t(17,S="")}function tl(){t(16,z=!1),t(17,S="")}async function Je(){if(!(!S.trim()||!u))try{const g=await x("CreateNote",u.id,S.trim());t(7,_=[..._,g&&g.id?g:{id:Date.now().toString(),title:S.trim(),createdAt:new Date().toISOString()}]),t(16,z=!1),t(17,S="")}catch{const R={id:Date.now().toString(),title:S.trim(),createdAt:new Date().toISOString()};t(7,_=[..._,R]),t(16,z=!1),t(17,S="")}}async function Te(g){if(!(k&&k.dirty&&!confirm("Несохранённые изменения. Закрыть?")))try{const R=await x("ReadNote",g.id);t(8,k={id:g.id,title:g.title,content:R||"",dirty:!1})}catch{t(8,k={id:g.id,title:g.title,content:"# "+g.title+`
`,dirty:!1})}}function ll(){k&&k.dirty&&!confirm("Несохранённые изменения. Закрыть?")||t(8,k=null)}function nl(g){k&&(t(8,k.content=g.target.value,k),t(8,k.dirty=!0,k))}async function il(){if(k)try{await x("SaveNote",k.id,k.content),t(8,k.dirty=!1,k)}catch{t(8,k.dirty=!1,k)}}async function sl(){const g=parseInt(w,10);if(!(!y.trim()||isNaN(g)||g<=0||!u)){try{const R=await x("CreateWorklog",u.id,y.trim(),g);t(10,h=[...h,R&&R.id?R:{id:Date.now().toString(),nodeId:u.id,summary:y.trim(),minutes:g,createdAt:new Date().toISOString()}])}catch{t(10,h=[...h,{id:Date.now().toString(),nodeId:u.id,summary:y.trim(),minutes:g,createdAt:new Date().toISOString()}])}t(12,y=""),t(11,w="")}}async function Ue(){const g=await x("PickFile");g&&await Ae(u.id,g)}async function rl(){const g=await x("PickDirectory");g&&await Ae(u.id,g)}async function Ae(g,R){t(19,L=!0);try{const ge=await x("PreviewImport",R);t(20,I=ge),P=R,t(21,E=!0)}catch(ge){t(3,r=String(ge))}t(19,L=!1)}async function He(g){try{const R=g==="copy"?await x("AddPathCopy",u.id,P):await x("AddPathLink",u.id,P);t(21,E=!1),t(20,I=null),t(24,X=[]),t(23,K=null),await Promise.all([C(u.id),B(u.id)])}catch(R){t(3,r=String(R))}}function ol(){t(21,E=!1),t(20,I=null)}async function Ze(g){if(confirm("Удалить файл?"))try{await x("DeleteFileOrFolder",g),p=p.filter(ge=>ge.nodeId!==g);const R=K||u.id;await B(R)}catch(R){t(3,r=String(R))}}async function cl(g){if(!g||g.length===0)return;if(!u){t(3,r="Сначала выберите дело для добавления файлов");return}const R=g[0];await Ae(u.id,R)}function ul(g){return d===g?"tab active":"tab"}const al=g=>J(g.id),fl=g=>H(g),dl=()=>t(3,r="");function pl(){k.content=this.value,t(8,k)}const _l=g=>{t(6,d=g.id),g.id==="files"&&u&&Z.length===0&&!K&&B(u.id)},ml=()=>{t(6,d="notes"),Ke()},vl=()=>{t(6,d="files"),Ue()},kl=()=>t(6,d="worklog"),bl=g=>Te(g);function hl(){S=this.value,t(17,S)}const wl=g=>g.key==="Enter"&&Je(),gl=g=>Te(g),yl=g=>{const R=g.detail;R===0?(t(24,X=[]),t(23,K=null),B(u.id)):we(R-1)},jl=g=>oe(g.detail),Cl=g=>Re(g.detail),Ml=g=>x("OpenFile",g.detail),Ll=g=>Ze(g.detail),Nl=g=>x("OpenFile",g.detail),El=g=>x("RunAction",g.id);function Sl(){y=this.value,t(12,y)}function Fl(){w=Wt(this.value),t(11,w)}function zl(){A=this.value,t(14,A)}const Pl=g=>g.key==="Enter"&&Ge();function Ol(){W=Dl(this),t(15,W),t(0,l)}return[l,i,s,r,c,u,d,_,k,b,h,w,y,N,A,W,z,S,M,L,I,E,G,K,X,Z,U,O,Y,te,ie,J,H,B,oe,se,we,Re,xt,$t,el,Ge,Ke,tl,Je,Te,ll,nl,il,sl,Ue,rl,He,ol,Ze,ul,al,fl,dl,pl,_l,ml,vl,kl,bl,hl,wl,gl,yl,jl,Cl,Ml,Ll,Nl,El,Sl,Fl,zl,Pl,Ol,()=>He("copy"),()=>He("link")]}class mi extends Le{constructor(e){super(),Me(this,e,_i,pi,Ce,{},null,[-1,-1,-1,-1])}}new mi({target:document.getElementById("app")});