muryshev's picture
init
cf07b75
raw
history blame
92.8 kB
import{n as ae,H as Qn,D as $e,s as ye,w as Ge,e as w,a as Q,c as B,b as A,g as Z,f as _,p as d,T as Ne,i as N,h as T,y as Xe,z as Ye,A as Je,U as zt,k as tt,V as re,W as dt,o as bt,X as Tt,m as Zn,v as xn,r as ze,l as ke,Y as de,Z as Y,_ as He,$ as Ke,t as Fe,d as Ae,q as et,j as st,x as Ce,a0 as it,a1 as $n,a2 as Ft,a3 as Ie,a4 as We,a5 as Pn,F as Rn,a6 as el,a7 as pe,a8 as ot,a9 as ct,E as tl,aa as nl,ab as vt,ac as kt,ad as Et,ae as je,af as ll}from"../chunks/scheduler.Ze4Bbz0A.js";import{n as ul,l as il,f as sl,h as al,a as F,t as U,S as Te,i as Pe,g as Ee,c as Se,j as wn,k as Bn,o as Ue,b as ge,d as _e,m as be,e as ve}from"../chunks/index.76WsQp4a.js";import{w as ut,r as rl}from"../chunks/entry.PoeC27Kh.js";const In=!0;function ol(l,e,t,n){if(!e)return ae;const u=l.getBoundingClientRect();if(e.left===u.left&&e.right===u.right&&e.top===u.top&&e.bottom===u.bottom)return ae;const{delay:i=0,duration:s=300,easing:a=Qn,start:r=ul()+i,end:o=r+s,tick:f=ae,css:c}=t(l,{from:e,to:u},n);let m=!0,h=!1,k;function g(){c&&(k=sl(l,0,1,s,i,a,c)),i||(h=!0)}function v(){c&&al(l,k),m=!1}return il(C=>{if(!h&&C>=r&&(h=!0),h&&C>=o&&(f(1,0),v()),!m)return!1;if(h){const y=C-r,p=0+1*a(y/s);f(p,1-p)}return!0}),g(),f(0,1),v}function cl(l){const e=getComputedStyle(l);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:n}=e,u=l.getBoundingClientRect();l.style.position="absolute",l.style.width=t,l.style.height=n,Fn(l,u)}}function Fn(l,e){const t=l.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const n=getComputedStyle(l),u=n.transform==="none"?"":n.transform;l.style.transform=`${u} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}function xe(l){return l?.length!==void 0?l:Array.from(l)}function fl(l,e){U(l,1,1,()=>{e.delete(l.key)})}function dl(l,e){l.f(),fl(l,e)}function hl(l,e,t,n,u,i,s,a,r,o,f,c){let m=l.length,h=i.length,k=m;const g={};for(;k--;)g[l[k].key]=k;const v=[],C=new Map,y=new Map,p=[];for(k=h;k--;){const b=c(u,i,k),D=t(b);let z=s.get(D);z?n&&p.push(()=>z.p(b,e)):(z=o(D,b),z.c()),C.set(D,v[k]=z),D in g&&y.set(D,Math.abs(k-g[D]))}const R=new Set,M=new Set;function E(b){F(b,1),b.m(a,f),s.set(b.key,b),f=b.first,h--}for(;m&&h;){const b=v[h-1],D=l[m-1],z=b.key,$=D.key;b===D?(f=b.first,m--,h--):C.has($)?!s.has(z)||R.has(z)?E(b):M.has($)?m--:y.get(z)>y.get($)?(M.add(z),E(b)):(R.add($),m--):(r(D,s),m--)}for(;m--;){const b=l[m];C.has(b.key)||r(b,s)}for(;h;)E(v[h-1]);return $e(p),v}function An(l,e){const t={},n={},u={$$scope:1};let i=l.length;for(;i--;){const s=l[i],a=e[i];if(a){for(const r in s)r in a||(n[r]=1);for(const r in a)u[r]||(t[r]=a[r],u[r]=1);l[i]=a}else for(const r in s)u[r]=1}for(const s in n)s in t||(t[s]=void 0);return t}const ml=!0,bi=Object.freeze(Object.defineProperty({__proto__:null,prerender:ml},Symbol.toStringTag,{value:"Module"}));function gt(l){if(!l.endsWith("px"))return;const e=parseFloat(l.slice(0,l.length-2));return isNaN(e)?void 0:e}const On=l=>l?"height":"width",Ct=l=>window.getComputedStyle(l),Dt=l=>l.getBoundingClientRect(),gl=(l,e=!0)=>{if(l.getPropertyValue("box-sizing")==="border-box")return;const t=gt(l.getPropertyValue("border-left-width"));if(t===void 0){console.error("Splitpanes Error: Fail to parse container `border-left-width`.");return}const n=gt(l.getPropertyValue("border-top-width"));if(n===void 0){console.error("Splitpanes Error: Fail to parse container `border-top-width`.");return}const u={left:t,top:n};if(e){const i=gt(l.getPropertyValue("border-right-width"));if(i===void 0){console.error("Splitpanes Error: Fail to parse container `border-right-width`.");return}const s=gt(l.getPropertyValue("border-bottom-width"));if(s===void 0){console.error("Splitpanes Error: Fail to parse container `border-bottom-width`.");return}const a=u;a.right=i,a.bottom=s}return u};function _l(l,e){e||(e=Ct(l));const t=Dt(l),n=gl(e,!0)||{left:0,top:0,right:0,bottom:0};return{width:t.width-n.left-n.right,height:t.height-n.top-n.bottom,left:t.left+n.left,top:t.top+n.top}}const At=(l,e)=>({left:l.left-e.left,top:l.top-e.top});function Ot(l){const e=l,t=l,{clientX:n,clientY:u}="ontouchstart"in window&&t.touches?t.touches[0]:e;return{left:n,top:u}}function Mt(l,e,t,n){let u=0;for(let i=e;i<t;i++)u+=n(l[i],i);return u}function _t(l,e,t,n){for(let u=e;u<t;u++)n(l[u],u)}function bl(l){let e,t,n,u,i=!In;const s=l[16].default,a=Ge(s,l,l[18],null);return{c(){e=w("div"),t=Q(),a&&a.c(),this.h()},l(r){e=B(r,"DIV",{id:!0,class:!0,style:!0});var o=A(e);t=Z(o),a&&a.l(o),o.forEach(_),this.h()},h(){d(e,"id",l[0]),d(e,"class",n=`splitpanes ${l[3]||""} ${l[4]||""}`),d(e,"style",l[2]),Ne(e,"splitpanes--horizontal",l[1]),Ne(e,"splitpanes--vertical",!l[1]),Ne(e,"splitpanes--dragging",l[7]||l[8]),Ne(e,"splitpanes--freeze",!l[6])},m(r,o){N(r,e,o),T(e,t),a&&a.m(e,null),l[17](e),u=!0},p(r,o){a&&a.p&&(!u||o[0]&262144)&&Xe(a,s,r,r[18],u?Je(s,r[18],o,null):Ye(r[18]),null),(!u||o[0]&1)&&d(e,"id",r[0]),(!u||o[0]&24&&n!==(n=`splitpanes ${r[3]||""} ${r[4]||""}`))&&d(e,"class",n),(!u||o[0]&4)&&d(e,"style",r[2]),(!u||o[0]&26)&&Ne(e,"splitpanes--horizontal",r[1]),(!u||o[0]&26)&&Ne(e,"splitpanes--vertical",!r[1]),(!u||o[0]&408)&&Ne(e,"splitpanes--dragging",r[7]||r[8]),(!u||o[0]&88)&&Ne(e,"splitpanes--freeze",!r[6])},i(r){u||(F(i),F(a,r),u=!0)},o(r){U(i),U(a,r),u=!1},d(r){r&&_(e),a&&a.d(r),l[17](null)}}}const Mn={};function vl(l,e,t){let n,u,i,{$$slots:s={},$$scope:a}=e,{id:r=void 0}=e,{horizontal:o=!1}=e,{pushOtherPanes:f=!0}=e,{dblClickSplitter:c=!0}=e,{rtl:m="auto"}=e,{firstSplitter:h=!1}=e,{style:k=null}=e,{theme:g="default-theme"}=e,{class:v=""}=e;const C=zt();let y,p=!1,R=!1,M=!1,E=!1,b=!1,D=-1,z=-1,$,I=new Array,ne=ut(o);tt(l,ne,S=>t(31,i=S));const ue=ut(h);tt(l,ue,S=>t(30,u=S));const te=ut(void 0);tt(l,te,S=>t(29,n=S));let H=null,le=null;re(Mn,{showFirstSplitter:ue,veryFirstPaneKey:te,isHorizontal:ne,ssrRegisterPaneSize:void 0,onPaneInit:S=>(n===void 0&&dt(te,n=S,n),{undefinedPaneInitSize:0}),clientOnly:{onPaneAdd:De,onPaneRemove:L}});function De(S){let W=-1;Array.from(S.element.parentNode.children).some(O=>(O.className.includes("splitpanes__pane")&&W++,O===S.element)),W===0&&dt(te,n=S.key,n),I.splice(W,0,S);for(let O=0;O<I.length;O++)I[O].index=O;p&&St().then(()=>{S.isReady=!0,C("pane-add",{index:W,panes:G()})});const J=(O,x=!0)=>K=>{(x||S.index>0)&&O(K,S)};return{onSplitterDown:J(ft,!1),onSplitterClick:J(Me,!1),onSplitterDblClick:J(at),onPaneClick:J(se),reportGivenSizeChange:J(V)}}async function L(S){const W=I.findIndex(J=>J.key===S);if(W>=0){const J=I.splice(W,1)[0];for(let O=0;O<I.length;O++)I[O].index=O;W===0&&dt(te,n=I.length>0?I[0].key:void 0,n),p&&(await St(),C("pane-remove",{removed:J,panes:G()}))}}function se(S,W){C("pane-click",W)}function V(S,W){W.setSz(S),St()}bt(()=>{Bt(),wt();for(let S=0;S<I.length;S++)I[S].isReady=!0;p=!0,C("ready"),setTimeout(()=>{t(6,M=!0)},0)}),Tt(()=>{p&&X(),p=!1}),Zn(()=>{Bt()});function P(S){if(m==="auto")try{return(S??Ct(y)).direction==="rtl"}catch{}return m===!0}function oe(){document.body.style.cursor=ne?"col-resize":"row-resize",document.addEventListener("mousemove",Oe,{passive:!1}),document.addEventListener("mouseup",qe),"ontouchstart"in window&&(document.addEventListener("touchmove",Oe,{passive:!1}),document.addEventListener("touchend",qe))}function X(){document.body.style.cursor="",document.removeEventListener("mousemove",Oe),document.removeEventListener("mouseup",qe),"ontouchstart"in window&&(document.removeEventListener("touchmove",Oe),document.removeEventListener("touchend",qe))}const ie=S=>S.nodeType===Node.ELEMENT_NODE&&S.classList.contains("splitpanes__splitter");function j(S,W,J){let O=S[o?"top":"left"];return J&&!o&&(O=W-O),O}const we=()=>On(o);function ft(S,W){t(7,E=!0),D=W.index,W.setSplitterActive(!0);let O=W.element;for(;O!=null&&(O=O.previousSibling,!ie(O)););if(O==null){console.error("Splitpane Error: Active splitter wasn't found!");return}H=O;const x=Ot(S),K=Dt(H);le=j(At(x,K),K[we()],P()),oe()}function Oe(S){if(E){S.preventDefault(),t(8,b=!0);const W=Ot(S),J=Ct(y),O=_l(y,J),x=O[we()],K=P(J),q=At(W,O),ee=j(q,x,K);rt(ee,x),C("resize",G())}}function qe(){b&&C("resized",G()),t(7,E=!1),I[D].setSplitterActive(!1),setTimeout(()=>{t(8,b=!1),X()},100)}function Me(S,W){if("ontouchstart"in window){S.preventDefault();const J=W.index;c&&(z===J?($&&clearTimeout($),$=null,at(S,W),z=-1):(z=J,$=setTimeout(()=>{z=-1},500)))}b||C("splitter-click",W)}function at(S,W){if(c){const J=W.index;let O=0;for(let q=0;q<I.length;q++){const ee=I[q];q!==J&&(O+=ee.min())}const x=Math.min(Math.max(0,100-O),W.max()),K=O+x;if(K>=100)for(let q=0;q<I.length;q++){const ee=I[q];ee!==W?ee.setSz(ee.min()):ee.setSz(100-O)}else{let q=100-K;W.setSz(x);const ee=ce=>{const me=ce.min(),Be=ce.max(),Le=Math.min(Math.max(0,q),Be-me);ce.setSz(me+Le),q-=Le};for(let ce=J-1;ce>=0;ce--)ee(I[ce]);for(let ce=J+1;ce<I.length;ce++)ee(I[ce]);q!=0&&console.warn("Splitpanes: there is a left spare size after computation of splitter double click, which means there are issues on the size constains of the panes.")}C("pane-maximize",W),C("resized",G())}t(7,E=!1)}const G=()=>I.map(S=>({min:S.min(),max:S.max(),size:S.sz(),snap:S.snap()}));function he(S,W){const J=Be=>Dt(Be)[we()],O=J(H);let x=0,K=H.previousSibling;for(;K!=null;)ie(K)&&(x+=J(K)),K=K.previousSibling;let q=0,ee=H.nextSibling;for(;ee!=null;)ie(ee)&&(q+=J(ee)),ee=ee.nextSibling;const ce=x+le,me=x+O+q;return(S-ce)/(W-me)*100}function rt(S,W){let J=D-1,O=I[J],x=D,K=I[x],q={prevPanesSize:lt(J),nextPanesSize:ht(x),prevReachedMinPanes:0,nextReachedMinPanes:0};const ee=0+(f?0:q.prevPanesSize),ce=100-(f?0:q.nextPanesSize),me=Math.max(Math.min(he(S,W),ce),ee),Be=q.prevPanesSize+O.min()+O.snap(),Le=100-(q.nextPanesSize+K.min()+K.snap());let fe=me,Ze=!1;me<=Be?me>q.prevPanesSize+O.min()&&(fe=Math.max(O.min()+q.prevPanesSize,100-(K.max()+q.nextPanesSize)),Ze=!0):me>=Le&&me<100-q.nextPanesSize-K.min()&&(fe=Math.min(100-(K.min()+q.nextPanesSize),O.max()+q.prevPanesSize),Ze=!0);const mt=O.max()<100&&fe>=O.max()+q.prevPanesSize,Jn=K.max()<100&&fe<=100-(K.max()+q.nextPanesSize);if(mt||Jn)mt?(O.setSz(O.max()),K.setSz(Math.max(100-O.max()-q.prevPanesSize-q.nextPanesSize,0))):(O.setSz(Math.max(100-K.max()-q.prevPanesSize-q.nextPanesSize,0)),K.setSz(K.max()));else{if(f&&!Ze){const It=Qe(q,fe);if(!It)return;({sums:q,paneBeforeIndex:J,paneAfterIndex:x}=It),O=I[J],K=I[x]}J!=null&&O.setSz(Math.min(Math.max(fe-q.prevPanesSize-q.prevReachedMinPanes,O.min()),O.max())),x!=null&&K.setSz(Math.min(Math.max(100-fe-q.nextPanesSize-q.nextReachedMinPanes,K.min()),K.max()))}}function Qe(S,W){const J=D-1;let O=J,x=J+1;if(W<S.prevPanesSize+I[O].min()&&(O=Hn(J)?.index,S.prevReachedMinPanes=0,O<J&&_t(I,O+1,J+1,K=>{K.setSz(K.min()),S.prevReachedMinPanes+=K.min()}),S.prevPanesSize=lt(O),O==null))return S.prevReachedMinPanes=0,I[0].setSz(I[0].min()),_t(I,1,J+1,K=>{K.setSz(K.min()),S.prevReachedMinPanes+=K.min()}),I[x].setSz(100-S.prevReachedMinPanes-I[0].min()-S.prevPanesSize-S.nextPanesSize),null;if(W>100-S.nextPanesSize-I[x].min()){x=Kn(J)?.index,S.nextReachedMinPanes=0,x>J+1&&_t(I,J+1,x,q=>{q.setSz(q.min()),S.nextReachedMinPanes+=q.min()}),S.nextPanesSize=ht(x);const K=I.length;if(x==null)return S.nextReachedMinPanes=0,I[K-1].setSz(I[K-1].min()),_t(I,J+1,K-1,q=>{q.setSz(q.min()),S.nextReachedMinPanes+=q.min()}),I[O].setSz(100-S.prevPanesSize-S.nextReachedMinPanes-I[K-1].min()-S.nextPanesSize),null}return{sums:S,paneBeforeIndex:O,paneAfterIndex:x}}const nt=S=>S.sz(),lt=S=>Mt(I,0,S,nt),ht=S=>Mt(I,S+1,I.length,nt),Hn=S=>[...I].reverse().find(W=>W.index<S&&W.sz()>W.min()),Kn=S=>I.find(W=>W.index>S+1&&W.sz()>W.min());async function St(){R=!0,await xn(),R&&(wt(),R=!1)}function wt(){Gn(),p&&C("resized",G())}function Gn(){if(I.length===0)return;const S=I.length;let W=100,J=0,O=0,x=0,K=[],q=[];for(let Le=0;Le<S;Le++){const fe=I[Le],Ze=fe.sz();fe.givenSize==null?fe.isReady?(x+=Ze,Ze>=fe.max()&&K.push(fe),Ze<=fe.min()&&q.push(fe)):O+=1:(W-=Ze,J++,K.push(fe),q.push(fe))}const ee=S-J,ce=ee-O;let me,Be;if(ce>0?(me=x/ce,me>.1&&W>.1?(x+=O*me,Be=W/x):(me=0,Be=1)):(me=W/ee,Be=1),W+x>.1){W=100;for(let Le=0;Le<S;Le++){const fe=I[Le];if(fe.givenSize==null){const Ze=fe.isReady?fe.sz():me,mt=Math.max(Math.min(Ze*Be,fe.max()),fe.min());fe.setSz(mt)}W-=fe.sz()}Math.abs(W)>.1&&(W=Xn(W,K,q))}isFinite(W)?Math.abs(W)>.1&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints."):console.warn("Splitpanes: Internal error, sizes might be NaN as a result.")}function Xn(S,W,J){const x=I.length-(S>0?W.length:J.length);if(x<=0)return S;const K=S/x;if(I.length===1)I[0].setSz(100),S=0;else for(let q=0;q<I.length;q++){const ee=I[q],ce=ee.sz();if(S>0&&!W.includes(ee)){const me=Math.max(Math.min(ce+K,ee.max()),ee.min()),Be=me-ce;S-=Be,ee.setSz(me)}else if(!J.includes(ee)){const me=Math.max(Math.min(ce+K,ee.max()),ee.min()),Be=me-ce;S-=Be,ee.setSz(me)}}return S}function Bt(){const{children:S}=y;let W=0,J=!1;for(let O=0;O<S.length;O++){const x=S.item(O),K=x.classList.contains("splitpanes__pane"),q=x.classList.contains("splitpanes__splitter");if(!K&&!q){x.parentNode?.removeChild(x),console.warn("Splitpanes: Only <Pane> elements are allowed at the root of <Splitpanes>. One of your DOM nodes was removed.");return}else K&&(!J&&I[W].element!==x&&(J=!0),W++)}if(J){const O=[];for(let x=0;x<S.length;x++){const K=S.item(x);if(K.classList.contains("splitpanes__pane")){const ee=I.find(ce=>ce.element===K);ee!=null?(ee.index=O.length,O.push(ee)):console.warn("Splitpanes: Internal error - found a <Pane> elements which isn't tracked.")}}I=O,dt(te,n=I.length>0?I[0].key:void 0,n)}}function Yn(S){ze[S?"unshift":"push"](()=>{y=S,t(5,y)})}return l.$$set=S=>{"id"in S&&t(0,r=S.id),"horizontal"in S&&t(1,o=S.horizontal),"pushOtherPanes"in S&&t(12,f=S.pushOtherPanes),"dblClickSplitter"in S&&t(13,c=S.dblClickSplitter),"rtl"in S&&t(14,m=S.rtl),"firstSplitter"in S&&t(15,h=S.firstSplitter),"style"in S&&t(2,k=S.style),"theme"in S&&t(3,g=S.theme),"class"in S&&t(4,v=S.class),"$$scope"in S&&t(18,a=S.$$scope)},l.$$.update=()=>{l.$$.dirty[0]&2&&dt(ne,i=o,i),l.$$.dirty[0]&32768&&dt(ue,u=h,u)},[r,o,k,g,v,y,M,E,b,ne,ue,te,f,c,m,h,s,Yn,a]}class kl extends Te{constructor(e){super(),Pe(this,e,vl,bl,ye,{id:0,horizontal:1,pushOtherPanes:12,dblClickSplitter:13,rtl:14,firstSplitter:15,style:2,theme:3,class:4},null,[-1,-1,-1])}}const pl=(l,e)=>t=>{const n=l();n?.[e](t)},El=l=>pl.bind(null,l);function Sl(l){let e,t,n,u,i,s,a=(l[4]!==l[9]||l[5])&&Lt(l);const r=l[20].default,o=Ge(r,l,l[19],null);return{c(){a&&a.c(),e=Q(),t=w("div"),o&&o.c(),this.h()},l(f){a&&a.l(f),e=Z(f),t=B(f,"DIV",{class:!0,style:!0});var c=A(t);o&&o.l(c),c.forEach(_),this.h()},h(){d(t,"class",n=`splitpanes__pane ${l[0]||""}`),d(t,"style",l[3])},m(f,c){a&&a.m(f,c),N(f,e,c),N(f,t,c),o&&o.m(t,null),l[21](t),u=!0,i||(s=Y(t,"click",l[11]("onPaneClick")),i=!0)},p(f,c){f[4]!==f[9]||f[5]?a?a.p(f,c):(a=Lt(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),o&&o.p&&(!u||c&524288)&&Xe(o,r,f,f[19],u?Je(r,f[19],c,null):Ye(f[19]),null),(!u||c&1&&n!==(n=`splitpanes__pane ${f[0]||""}`))&&d(t,"class",n),(!u||c&8)&&d(t,"style",f[3])},i(f){u||(F(o,f),u=!0)},o(f){U(o,f),u=!1},d(f){f&&(_(e),_(t)),a&&a.d(f),o&&o.d(f),l[21](null),i=!1,s()}}}function Lt(l){let e,t,n,u;return{c(){e=w("div"),this.h()},l(i){e=B(i,"DIV",{class:!0}),A(e).forEach(_),this.h()},h(){d(e,"class",t="splitpanes__splitter "+(l[2]?"splitpanes__splitter__active":""))},m(i,s){N(i,e,s),n||(u=[Y(e,"mousedown",l[11]("onSplitterDown")),Y(e,"touchstart",l[11]("onSplitterDown")),Y(e,"click",l[11]("onSplitterClick")),Y(e,"dblclick",l[11]("onSplitterDblClick"))],n=!0)},p(i,s){s&4&&t!==(t="splitpanes__splitter "+(i[2]?"splitpanes__splitter__active":""))&&d(e,"class",t)},d(i){i&&_(e),n=!1,$e(u)}}}function yl(l){let e,t,n=!l[10]&&Sl(l);return{c(){n&&n.c(),e=ke()},l(u){n&&n.l(u),e=ke()},m(u,i){n&&n.m(u,i),N(u,e,i),t=!0},p(u,[i]){u[10]||n.p(u,i)},i(u){t||(F(n),t=!0)},o(u){U(n),t=!1},d(u){u&&_(e),n&&n.d(u)}}}function Cl(l,e,t){let n,u,i,s,a,{$$slots:r={},$$scope:o}=e;const{ssrRegisterPaneSize:f,onPaneInit:c,clientOnly:m,isHorizontal:h,showFirstSplitter:k,veryFirstPaneKey:g}=de(Mn);tt(l,h,H=>t(18,i=H)),tt(l,k,H=>t(5,a=H)),tt(l,g,H=>t(4,s=H));let{size:v=null}=e,{minSize:C=0}=e,{maxSize:y=100}=e,{snapSize:p=0}=e,{class:R=""}=e;const M={},E=!In,{undefinedPaneInitSize:b}=c(M);let D,z=v??b,$=!1,I;const ne=El(()=>I),ue=H=>{H!=z&&ne("reportGivenSizeChange")(H)};bt(()=>{const H={key:M,element:D,givenSize:v,sz:()=>z,setSz:le=>{t(16,z=le),v!=null&&v!=z&&t(12,v=z)},min:()=>C,max:()=>y,snap:()=>p,setSplitterActive:le=>{t(2,$=le)},isReady:!1};I=m.onPaneAdd(H)}),Tt(()=>{m.onPaneRemove(M)});function te(H){ze[H?"unshift":"push"](()=>{D=H,t(1,D)})}return l.$$set=H=>{"size"in H&&t(12,v=H.size),"minSize"in H&&t(13,C=H.minSize),"maxSize"in H&&t(14,y=H.maxSize),"snapSize"in H&&t(15,p=H.snapSize),"class"in H&&t(0,R=H.class),"$$scope"in H&&t(19,o=H.$$scope)},l.$$.update=()=>{l.$$.dirty&4096&&v!=null&&ue(v),l.$$.dirty&262144&&t(17,n=On(i)),l.$$.dirty&196608&&t(3,u=`${n}: ${z}%;`)},[R,D,$,u,s,a,h,k,g,M,E,ne,v,C,y,p,z,n,i,o,r,te]}class Nt extends Te{constructor(e){super(),Pe(this,e,Cl,yl,ye,{size:12,minSize:13,maxSize:14,snapSize:15,class:0})}}function Dl(l){let e,t,n,u,i,s,a;return{c(){e=He("svg"),t=He("circle"),n=He("animate"),u=He("circle"),i=He("animate"),s=He("circle"),a=He("animate"),this.h()},l(r){e=Ke(r,"svg",{version:!0,id:!0,xmlns:!0,"xmlns:xlink":!0,x:!0,y:!0,viewBox:!0,"enable-background":!0,"xml:space":!0});var o=A(e);t=Ke(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var f=A(t);n=Ke(f,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),A(n).forEach(_),f.forEach(_),u=Ke(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var c=A(u);i=Ke(c,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),A(i).forEach(_),c.forEach(_),s=Ke(o,"circle",{fill:!0,stroke:!0,cx:!0,cy:!0,r:!0});var m=A(s);a=Ke(m,"animate",{attributeName:!0,dur:!0,values:!0,repeatCount:!0,begin:!0}),A(a).forEach(_),m.forEach(_),o.forEach(_),this.h()},h(){d(n,"attributeName","opacity"),d(n,"dur","1s"),d(n,"values","0;1;0"),d(n,"repeatCount","indefinite"),d(n,"begin","0.1"),d(t,"fill","#1976d2"),d(t,"stroke","none"),d(t,"cx","6"),d(t,"cy","50"),d(t,"r","6"),d(i,"attributeName","opacity"),d(i,"dur","1s"),d(i,"values","0;1;0"),d(i,"repeatCount","indefinite"),d(i,"begin","0.2"),d(u,"fill","#1976d2"),d(u,"stroke","none"),d(u,"cx","26"),d(u,"cy","50"),d(u,"r","6"),d(a,"attributeName","opacity"),d(a,"dur","1s"),d(a,"values","0;1;0"),d(a,"repeatCount","indefinite"),d(a,"begin","0.3"),d(s,"fill","#1976d2"),d(s,"stroke","none"),d(s,"cx","46"),d(s,"cy","50"),d(s,"r","6"),d(e,"version","1.1"),d(e,"id","L4"),d(e,"xmlns","http://www.w3.org/2000/svg"),d(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),d(e,"x","0px"),d(e,"y","0px"),d(e,"viewBox","0 0 100 100"),d(e,"enable-background","new 0 0 0 0"),d(e,"xml:space","preserve")},m(r,o){N(r,e,o),T(e,t),T(t,n),T(e,u),T(u,i),T(e,s),T(s,a)},p:ae,i:ae,o:ae,d(r){r&&_(e)}}}function zl(l,e,t){let{size:n=20}=e;return l.$$set=u=>{"size"in u&&t(0,n=u.size)},[n]}class Tl extends Te{constructor(e){super(),Pe(this,e,zl,Dl,ye,{size:0})}}function Pl(l){let e,t,n,u,i;return{c(){e=w("div"),t=He("svg"),n=He("circle"),u=Q(),i=Fe(l[2]),this.h()},l(s){e=B(s,"DIV",{class:!0});var a=A(e);t=Ke(a,"svg",{class:!0,viewBox:!0,xmlns:!0});var r=A(t);n=Ke(r,"circle",{cx:!0,cy:!0,r:!0,fill:!0,style:!0}),A(n).forEach(_),r.forEach(_),u=Z(a),i=Ae(a,l[2]),a.forEach(_),this.h()},h(){d(n,"cx","10"),d(n,"cy","10"),d(n,"r","5"),d(n,"fill",l[0]),et(n,"filter","drop-shadow(0 0 1px "+l[1]+")"),d(t,"class","dot svelte-a20mi8"),d(t,"viewBox","0 0 20 20"),d(t,"xmlns","http://www.w3.org/2000/svg"),d(e,"class","llm-health-status svelte-a20mi8")},m(s,a){N(s,e,a),T(e,t),T(t,n),T(e,u),T(e,i)},p(s,[a]){a&1&&d(n,"fill",s[0]),a&2&&et(n,"filter","drop-shadow(0 0 1px "+s[1]+")"),a&4&&st(i,s[2])},i:ae,o:ae,d(s){s&&_(e)}}}function Rl(l,e,t){let{status:n="unknown"}=e,u="",i="",s="";switch(n){case"ok":u="#4CAF50",i="rgba(0, 128, 0, 0.7)",s="Сервис LLM работает";break;case"error":s="Сервис LLM не работает";break;case"loading model":u="yellow",i="rgba(255, 255, 0, 0.7)",s="Сервис LLM запускается...";break;case"unavailable":u="#af4f4c",i="#af4f4c",s="Сервис LLM не запущен";break;case"unknown":u="#af4f4c",i="#af4f4c",s="Сервис LLM недоступен";break}return l.$$set=a=>{"status"in a&&t(3,n=a.status)},[u,i,s,n]}class wl extends Te{constructor(e){super(),Pe(this,e,Rl,Pl,ye,{status:3})}}function Bl(l){let e,t,n,u,i;return{c(){e=w("div"),t=He("svg"),n=He("circle"),u=Q(),i=Fe(l[2]),this.h()},l(s){e=B(s,"DIV",{class:!0});var a=A(e);t=Ke(a,"svg",{class:!0,viewBox:!0,xmlns:!0});var r=A(t);n=Ke(r,"circle",{cx:!0,cy:!0,r:!0,fill:!0,style:!0}),A(n).forEach(_),r.forEach(_),u=Z(a),i=Ae(a,l[2]),a.forEach(_),this.h()},h(){d(n,"cx","10"),d(n,"cy","10"),d(n,"r","5"),d(n,"fill",l[0]),et(n,"filter","drop-shadow(0 0 1px "+l[1]+")"),d(t,"class","dot svelte-1wcf73j"),d(t,"viewBox","0 0 20 20"),d(t,"xmlns","http://www.w3.org/2000/svg"),d(e,"class","llm-health-status svelte-1wcf73j")},m(s,a){N(s,e,a),T(e,t),T(t,n),T(e,u),T(e,i)},p(s,[a]){a&1&&d(n,"fill",s[0]),a&2&&et(n,"filter","drop-shadow(0 0 1px "+s[1]+")"),a&4&&st(i,s[2])},i:ae,o:ae,d(s){s&&_(e)}}}function Il(l,e,t){let{status:n="unavailable"}=e,u="",i="",s="";switch(n){case"ok":u="#4CAF50",i="rgba(0, 128, 0, 0.7)",s="Поиск работает";break;case"unavailable":u="#af4f4c",i="#af4f4c",s="Поиск не запущен";break;case"unknown":u="#af4f4c",i="#af4f4c",s="Поиск недоступен";break}return l.$$set=a=>{"status"in a&&t(3,n=a.status)},[u,i,s,n]}class Fl extends Te{constructor(e){super(),Pe(this,e,Il,Bl,ye,{status:3})}}function Al(l){let e,t,n,u,i,s="Сохранить",a,r,o="Сбросить",f,c;return{c(){e=w("div"),t=w("div"),n=w("textarea"),u=Q(),i=w("button"),i.textContent=s,a=Q(),r=w("button"),r.textContent=o,this.h()},l(m){e=B(m,"DIV",{class:!0});var h=A(e);t=B(h,"DIV",{class:!0});var k=A(t);n=B(k,"TEXTAREA",{class:!0}),A(n).forEach(_),u=Z(k),i=B(k,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(i)!=="svelte-g0hhac"&&(i.textContent=s),a=Z(k),r=B(k,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(r)!=="svelte-16kemh0"&&(r.textContent=o),k.forEach(_),h.forEach(_),this.h()},h(){d(n,"class","svelte-sfudwy"),d(i,"class","svelte-sfudwy"),d(r,"class","svelte-sfudwy"),d(t,"class","popup svelte-sfudwy"),d(e,"class","modal svelte-sfudwy")},m(m,h){N(m,e,h),T(e,t),T(t,n),it(n,l[0]),T(t,u),T(t,i),T(t,a),T(t,r),f||(c=[Y(n,"input",l[6]),Y(i,"click",l[1]),Y(r,"click",l[2])],f=!0)},p(m,[h]){h&1&&it(n,m[0])},i:ae,o:ae,d(m){m&&_(e),f=!1,$e(c)}}}let Ol='Ты бухгалтер. Ты отвечаешь на русском языке. Ты всегда следуешь моим инструкциям. Ты отвечаешь на вопросы клиентов. Чтобы ответить, ты обязательно используешь только "источники", которые я тебе предоставляю. Ты используешь только официально-деловой стиль и необходимую терминологию. Соблюдай этические нормы. При ответе на вопрос ты используешь только такой формат ответа: 1) Четкий и краткий ответ на поставленный вопрос. Ты можешь начать свой ответ так: "По Вашему вопросу сообщаем...". Используй по возможности слова: да, можно, нет, нельзя. 2) Обоснование (ты используешь для обоснования "источники". Ты используешь только "источники" для поиска необходимых "законов", "статей", "пунктов" и "подпунктов" для ответа на вопрос пользователя). 3) Аргументация (Ты используешь только "источники" для поиска необходимых "писем" и "судебных решений", чтобы аргументировать свой ответ)." 4) Заключение (ты подводишь итоги всего, что сказал выше. Избегай повторения и сложных конструкций). Если в источниках нельзя найти подходящую информацию для ответа, ты отвечаешь так: "Мы не можем ответить на данный вопрос. Обратитесь к специалисту." Вопрос: {{ВОПРОС}} Источники: {{ИСТОЧНИКИ}}';function Ml(l,e,t){let{onSave:n}=e,{onClose:u}=e,{text:i=""}=e,s=i;function a(){n(s),u()}function r(){t(0,s=Ol)}function o(){s=this.value,t(0,s)}return l.$$set=f=>{"onSave"in f&&t(3,n=f.onSave),"onClose"in f&&t(4,u=f.onClose),"text"in f&&t(5,i=f.text)},[s,a,r,n,u,i,o]}class Ll extends Te{constructor(e){super(),Pe(this,e,Ml,Al,ye,{onSave:3,onClose:4,text:5})}}const Nl="drawerStore";function Vl(){const l=jl();return re(Nl,l)}function jl(){const{subscribe:l,set:e,update:t}=ut({});return{subscribe:l,set:e,update:t,open:n=>t(()=>({open:!0,...n})),close:()=>t(n=>(n.open=!1,n))}}const Ul="modalStore";function Wl(){const l=ql();return re(Ul,l)}function ql(){const{subscribe:l,set:e,update:t}=ut([]);return{subscribe:l,set:e,update:t,trigger:n=>t(u=>(u.push(n),u)),close:()=>t(n=>(n.length>0&&n.shift(),n)),clear:()=>e([])}}const Hl={message:"Missing Toast Message",autohide:!0,timeout:5e3},Ln="toastStore";function Nn(){const l=de(Ln);if(!l)throw new Error("toastStore is not initialized. Please ensure that `initializeStores()` is invoked in the root layout file of this app!");return l}function Kl(){const l=Xl();return re(Ln,l)}function Gl(){const l=Math.random();return Number(l).toString(32)}function Xl(){const{subscribe:l,set:e,update:t}=ut([]),n=i=>t(s=>{if(s.length>0){const a=s.findIndex(o=>o.id===i),r=s[a];r&&(r.callback&&r.callback({id:i,status:"closed"}),r.timeoutId&&clearTimeout(r.timeoutId),s.splice(a,1))}return s});function u(i){if(i.autohide===!0)return setTimeout(()=>{n(i.id)},i.timeout)}return{subscribe:l,close:n,trigger:i=>{const s=Gl();return t(a=>{i&&i.callback&&i.callback({id:s,status:"queued"}),i.hideDismiss&&(i.autohide=!0);const r={...Hl,...i,id:s};return r.timeoutId=u(r),a.push(r),a}),s},freeze:i=>t(s=>(s.length>0&&clearTimeout(s[i].timeoutId),s)),unfreeze:i=>t(s=>(s.length>0&&(s[i].timeoutId=u(s[i])),s)),clear:()=>e([])}}function Yl(){Wl(),Kl(),Vl()}const yt={};function Vt(l){return l==="local"?localStorage:sessionStorage}function Pt(l,e,t){const n=t?.serializer??JSON,u=t?.storage??"local";function i(s,a){Vt(u).setItem(s,n.stringify(a))}if(!yt[l]){const s=ut(e,o=>{const f=Vt(u).getItem(l);f&&o(n.parse(f));{const c=m=>{m.key===l&&o(m.newValue?n.parse(m.newValue):null)};return window.addEventListener("storage",c),()=>window.removeEventListener("storage",c)}}),{subscribe:a,set:r}=s;yt[l]={set(o){i(l,o),r(o)},update(o){const f=o($n(s));i(l,f),r(f)},subscribe:a}}return yt[l]}Pt("modeOsPrefers",!1);Pt("modeUserPrefers",void 0);Pt("modeCurrent",!1);const Vn="(prefers-reduced-motion: reduce)";function Jl(){return window.matchMedia(Vn).matches}const jn=rl(Jl(),l=>{{const e=n=>{l(n.matches)},t=window.matchMedia(Vn);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}}});function Rt(l){const e=l-1;return e*e*e+1}function jt(l,{delay:e=0,duration:t=400,easing:n=Rt,x:u=0,y:i=0,opacity:s=0}={}){const a=getComputedStyle(l),r=+a.opacity,o=a.transform==="none"?"":a.transform,f=r*(1-s),[c,m]=Ft(u),[h,k]=Ft(i);return{delay:e,duration:t,easing:n,css:(g,v)=>`
transform: ${o} translate(${(1-g)*c}${m}, ${(1-g)*h}${k});
opacity: ${r-f*v}`}}function Ut(l,{delay:e=0,duration:t=400,easing:n=Rt,axis:u="y"}={}){const i=getComputedStyle(l),s=+i.opacity,a=u==="y"?"height":"width",r=parseFloat(i[a]),o=u==="y"?["top","bottom"]:["left","right"],f=o.map(C=>`${C[0].toUpperCase()}${C.slice(1)}`),c=parseFloat(i[`padding${f[0]}`]),m=parseFloat(i[`padding${f[1]}`]),h=parseFloat(i[`margin${f[0]}`]),k=parseFloat(i[`margin${f[1]}`]),g=parseFloat(i[`border${f[0]}Width`]),v=parseFloat(i[`border${f[1]}Width`]);return{delay:e,duration:t,easing:n,css:C=>`overflow: hidden;opacity: ${Math.min(C*20,1)*s};${a}: ${C*r}px;padding-${o[0]}: ${C*c}px;padding-${o[1]}: ${C*m}px;margin-${o[0]}: ${C*h}px;margin-${o[1]}: ${C*k}px;border-${o[0]}-width: ${C*g}px;border-${o[1]}-width: ${C*v}px;`}}function Ql(l){let e,t,n;const u=l[19].default,i=Ge(u,l,l[18],null);return{c(){e=w("div"),i&&i.c(),this.h()},l(s){e=B(s,"DIV",{class:!0,"data-testid":!0});var a=A(e);i&&i.l(a),a.forEach(_),this.h()},h(){d(e,"class",t="accordion "+l[0]),d(e,"data-testid","accordion")},m(s,a){N(s,e,a),i&&i.m(e,null),n=!0},p(s,[a]){i&&i.p&&(!n||a&262144)&&Xe(i,u,s,s[18],n?Je(u,s[18],a,null):Ye(s[18]),null),(!n||a&1&&t!==(t="accordion "+s[0]))&&d(e,"class",t)},i(s){n||(F(i,s),n=!0)},o(s){U(i,s),n=!1},d(s){s&&_(e),i&&i.d(s)}}}function Zl(l,e,t){let n,u;tt(l,jn,z=>t(20,u=z));let{$$slots:i={},$$scope:s}=e,{autocollapse:a=!1}=e,{width:r="w-full"}=e,{spacing:o="space-y-1"}=e,{disabled:f=!1}=e,{padding:c="py-2 px-4"}=e,{hover:m="hover:bg-primary-hover-token"}=e,{rounded:h="rounded-container-token"}=e,{caretOpen:k="rotate-180"}=e,{caretClosed:g=""}=e,{regionControl:v=""}=e,{regionPanel:C="space-y-4"}=e,{regionCaret:y=""}=e,{transitions:p=!u}=e,{transitionIn:R=Ut}=e,{transitionInParams:M={duration:200}}=e,{transitionOut:E=Ut}=e,{transitionOutParams:b={duration:200}}=e;const D=ut(null);return re("active",D),re("autocollapse",a),re("disabled",f),re("padding",c),re("hover",m),re("rounded",h),re("caretOpen",k),re("caretClosed",g),re("regionControl",v),re("regionPanel",C),re("regionCaret",y),re("transitions",p),re("transitionIn",R),re("transitionInParams",M),re("transitionOut",E),re("transitionOutParams",b),l.$$set=z=>{t(22,e=Ie(Ie({},e),We(z))),"autocollapse"in z&&t(1,a=z.autocollapse),"width"in z&&t(2,r=z.width),"spacing"in z&&t(3,o=z.spacing),"disabled"in z&&t(4,f=z.disabled),"padding"in z&&t(5,c=z.padding),"hover"in z&&t(6,m=z.hover),"rounded"in z&&t(7,h=z.rounded),"caretOpen"in z&&t(8,k=z.caretOpen),"caretClosed"in z&&t(9,g=z.caretClosed),"regionControl"in z&&t(10,v=z.regionControl),"regionPanel"in z&&t(11,C=z.regionPanel),"regionCaret"in z&&t(12,y=z.regionCaret),"transitions"in z&&t(13,p=z.transitions),"transitionIn"in z&&t(14,R=z.transitionIn),"transitionInParams"in z&&t(15,M=z.transitionInParams),"transitionOut"in z&&t(16,E=z.transitionOut),"transitionOutParams"in z&&t(17,b=z.transitionOutParams),"$$scope"in z&&t(18,s=z.$$scope)},l.$$.update=()=>{t(0,n=`${r} ${o} ${e.class??""}`)},e=We(e),[n,a,r,o,f,c,m,h,k,g,v,C,y,p,R,M,E,b,s,i]}class xl extends Te{constructor(e){super(),Pe(this,e,Zl,Ql,ye,{autocollapse:1,width:2,spacing:3,disabled:4,padding:5,hover:6,rounded:7,caretOpen:8,caretClosed:9,regionControl:10,regionPanel:11,regionCaret:12,transitions:13,transitionIn:14,transitionInParams:15,transitionOut:16,transitionOutParams:17})}}function pt(l,e){const{transition:t,params:n,enabled:u}=e;return u?t(l,n):"duration"in n?t(l,{duration:0}):{duration:0}}const $l=l=>({}),Wt=l=>({}),eu=l=>({}),qt=l=>({}),tu=l=>({}),Ht=l=>({}),nu=l=>({}),Kt=l=>({}),lu=l=>({}),Gt=l=>({});function Xt(l){let e,t;const n=l[30].lead,u=Ge(n,l,l[29],Gt);return{c(){e=w("div"),u&&u.c(),this.h()},l(i){e=B(i,"DIV",{class:!0});var s=A(e);u&&u.l(s),s.forEach(_),this.h()},h(){d(e,"class","accordion-lead")},m(i,s){N(i,e,s),u&&u.m(e,null),t=!0},p(i,s){u&&u.p&&(!t||s[0]&536870912)&&Xe(u,n,i,i[29],t?Je(n,i[29],s,lu):Ye(i[29]),Gt)},i(i){t||(F(u,i),t=!0)},o(i){U(u,i),t=!1},d(i){i&&_(e),u&&u.d(i)}}}function uu(l){let e;return{c(){e=Fe("(summary)")},l(t){e=Ae(t,"(summary)")},m(t,n){N(t,e,n)},d(t){t&&_(e)}}}function iu(l){let e,t,n;return{c(){e=w("div"),t=new ot(!1),this.h()},l(u){e=B(u,"DIV",{class:!0});var i=A(e);t=ct(i,!1),i.forEach(_),this.h()},h(){t.a=null,d(e,"class",n="accordion-summary-caret "+l[11])},m(u,i){N(u,e,i),t.m(l[14],e)},p(u,i){i[0]&2048&&n!==(n="accordion-summary-caret "+u[11])&&d(e,"class",n)},i:ae,o:ae,d(u){u&&_(e)}}}function su(l){let e,t,n,u,i;const s=[ru,au],a=[];function r(o,f){return o[8]?0:1}return t=r(l),n=a[t]=s[t](l),{c(){e=w("div"),n.c(),this.h()},l(o){e=B(o,"DIV",{class:!0});var f=A(e);n.l(f),f.forEach(_),this.h()},h(){d(e,"class",u="accordion-summary-icons "+l[10])},m(o,f){N(o,e,f),a[t].m(e,null),i=!0},p(o,f){let c=t;t=r(o),t===c?a[t].p(o,f):(Ee(),U(a[c],1,1,()=>{a[c]=null}),Se(),n=a[t],n?n.p(o,f):(n=a[t]=s[t](o),n.c()),F(n,1),n.m(e,null)),(!i||f[0]&1024&&u!==(u="accordion-summary-icons "+o[10]))&&d(e,"class",u)},i(o){i||(F(n),i=!0)},o(o){U(n),i=!1},d(o){o&&_(e),a[t].d()}}}function au(l){let e;const t=l[30].iconOpen,n=Ge(t,l,l[29],qt),u=n||ou(l);return{c(){u&&u.c()},l(i){u&&u.l(i)},m(i,s){u&&u.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s[0]&536870912)&&Xe(n,t,i,i[29],e?Je(t,i[29],s,eu):Ye(i[29]),qt)},i(i){e||(F(u,i),e=!0)},o(i){U(u,i),e=!1},d(i){u&&u.d(i)}}}function ru(l){let e;const t=l[30].iconClosed,n=Ge(t,l,l[29],Ht),u=n||cu(l);return{c(){u&&u.c()},l(i){u&&u.l(i)},m(i,s){u&&u.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s[0]&536870912)&&Xe(n,t,i,i[29],e?Je(t,i[29],s,tu):Ye(i[29]),Ht)},i(i){e||(F(u,i),e=!0)},o(i){U(u,i),e=!1},d(i){u&&u.d(i)}}}function ou(l){let e,t;return{c(){e=new ot(!1),t=ke(),this.h()},l(n){e=ct(n,!1),t=ke(),this.h()},h(){e.a=t},m(n,u){e.m(l[14],n,u),N(n,t,u)},p:ae,d(n){n&&(_(t),e.d())}}}function cu(l){let e,t;return{c(){e=new ot(!1),t=ke(),this.h()},l(n){e=ct(n,!1),t=ke(),this.h()},h(){e.a=t},m(n,u){e.m(l[14],n,u),N(n,t,u)},p:ae,d(n){n&&(_(t),e.d())}}}function Yt(l){let e,t,n,u,i,s,a;const r=l[30].content,o=Ge(r,l,l[29],Wt),f=o||fu();return{c(){e=w("div"),f&&f.c(),this.h()},l(c){e=B(c,"DIV",{class:!0,id:!0,role:!0,"aria-hidden":!0,"aria-labelledby":!0});var m=A(e);f&&f.l(m),m.forEach(_),this.h()},h(){d(e,"class",t="accordion-panel "+l[9]),d(e,"id",n="accordion-panel-"+l[0]),d(e,"role","region"),d(e,"aria-hidden",u=!l[8]),d(e,"aria-labelledby",l[0])},m(c,m){N(c,e,m),f&&f.m(e,null),a=!0},p(c,m){l=c,o&&o.p&&(!a||m[0]&536870912)&&Xe(o,r,l,l[29],a?Je(r,l[29],m,$l):Ye(l[29]),Wt),(!a||m[0]&512&&t!==(t="accordion-panel "+l[9]))&&d(e,"class",t),(!a||m[0]&1&&n!==(n="accordion-panel-"+l[0]))&&d(e,"id",n),(!a||m[0]&256&&u!==(u=!l[8]))&&d(e,"aria-hidden",u),(!a||m[0]&1)&&d(e,"aria-labelledby",l[0])},i(c){a||(F(f,c),c&&Rn(()=>{a&&(s&&s.end(1),i=wn(e,pt,{transition:l[4],params:l[5],enabled:l[3]}),i.start())}),a=!0)},o(c){U(f,c),i&&i.invalidate(),c&&(s=Bn(e,pt,{transition:l[6],params:l[7],enabled:l[3]})),a=!1},d(c){c&&_(e),f&&f.d(c),c&&s&&s.end()}}}function fu(l){let e;return{c(){e=Fe("(content)")},l(t){e=Ae(t,"(content)")},m(t,n){N(t,e,n)},d(t){t&&_(e)}}}function du(l){let e,t,n,u,i,s,a,r,o,f,c,m,h,k,g=l[16].lead&&Xt(l);const v=l[30].summary,C=Ge(v,l,l[29],Kt),y=C||uu(),p=[su,iu],R=[];function M(b,D){return b[16].iconClosed||b[16].iconOpen?0:1}s=M(l),a=R[s]=p[s](l);let E=l[8]&&Yt(l);return{c(){e=w("div"),t=w("button"),g&&g.c(),n=Q(),u=w("div"),y&&y.c(),i=Q(),a.c(),f=Q(),E&&E.c(),this.h()},l(b){e=B(b,"DIV",{class:!0,"data-testid":!0});var D=A(e);t=B(D,"BUTTON",{type:!0,class:!0,id:!0,"aria-expanded":!0,"aria-controls":!0});var z=A(t);g&&g.l(z),n=Z(z),u=B(z,"DIV",{class:!0});var $=A(u);y&&y.l($),$.forEach(_),i=Z(z),a.l(z),z.forEach(_),f=Z(D),E&&E.l(D),D.forEach(_),this.h()},h(){d(u,"class","accordion-summary flex-1"),d(t,"type","button"),d(t,"class",r="accordion-control "+l[12]),d(t,"id",l[0]),d(t,"aria-expanded",l[8]),d(t,"aria-controls",o="accordion-panel-"+l[0]),t.disabled=l[2],d(e,"class",c="accordion-item "+l[13]),d(e,"data-testid","accordion-item")},m(b,D){N(b,e,D),T(e,t),g&&g.m(t,null),T(t,n),T(t,u),y&&y.m(u,null),T(t,i),R[s].m(t,null),T(e,f),E&&E.m(e,null),m=!0,h||(k=[Y(t,"click",l[15]),Y(t,"click",l[31]),Y(t,"keydown",l[32]),Y(t,"keyup",l[33]),Y(t,"keypress",l[34])],h=!0)},p(b,D){b[16].lead?g?(g.p(b,D),D[0]&65536&&F(g,1)):(g=Xt(b),g.c(),F(g,1),g.m(t,n)):g&&(Ee(),U(g,1,1,()=>{g=null}),Se()),C&&C.p&&(!m||D[0]&536870912)&&Xe(C,v,b,b[29],m?Je(v,b[29],D,nu):Ye(b[29]),Kt);let z=s;s=M(b),s===z?R[s].p(b,D):(Ee(),U(R[z],1,1,()=>{R[z]=null}),Se(),a=R[s],a?a.p(b,D):(a=R[s]=p[s](b),a.c()),F(a,1),a.m(t,null)),(!m||D[0]&4096&&r!==(r="accordion-control "+b[12]))&&d(t,"class",r),(!m||D[0]&1)&&d(t,"id",b[0]),(!m||D[0]&256)&&d(t,"aria-expanded",b[8]),(!m||D[0]&1&&o!==(o="accordion-panel-"+b[0]))&&d(t,"aria-controls",o),(!m||D[0]&4)&&(t.disabled=b[2]),b[8]?E?(E.p(b,D),D[0]&256&&F(E,1)):(E=Yt(b),E.c(),F(E,1),E.m(e,null)):E&&(Ee(),U(E,1,1,()=>{E=null}),Se()),(!m||D[0]&8192&&c!==(c="accordion-item "+b[13]))&&d(e,"class",c)},i(b){m||(F(g),F(y,b),F(a),F(E),m=!0)},o(b){U(g),U(y,b),U(a),U(E),m=!1},d(b){b&&_(e),g&&g.d(),y&&y.d(b),R[s].d(),E&&E.d(),h=!1,$e(k)}}}const hu="",mu="text-start w-full flex items-center space-x-4",Jt="fill-current w-3 transition-transform duration-[200ms]",gu="";function _u(l,e,t){let n,u,i,s,a,r,o,f,c=ae,m=()=>(c(),c=el(R,j=>t(28,f=j)),R);l.$$.on_destroy.push(()=>c());let{$$slots:h={},$$scope:k}=e;const g=Pn(h),v=zt();let{open:C=!1}=e,{id:y=String(Math.random())}=e,{autocollapse:p=de("autocollapse")}=e,{active:R=de("active")}=e;m();let{disabled:M=de("disabled")}=e,{padding:E=de("padding")}=e,{hover:b=de("hover")}=e,{rounded:D=de("rounded")}=e,{caretOpen:z=de("caretOpen")}=e,{caretClosed:$=de("caretClosed")}=e,{regionControl:I=de("regionControl")}=e,{regionPanel:ne=de("regionPanel")}=e,{regionCaret:ue=de("regionCaret")}=e,{transitions:te=de("transitions")}=e,{transitionIn:H=de("transitionIn")}=e,{transitionInParams:le=de("transitionInParams")}=e,{transitionOut:Re=de("transitionOut")}=e,{transitionOutParams:De=de("transitionOutParams")}=e;const L=`
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class={classesControlCaret}>
<path d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z" />
</svg>`;function se(j){p===!0?R.set(y):t(17,C=!C),V(j)}function V(j){const we=p?f===y:C;v("toggle",{event:j,id:y,panelId:`accordion-panel-${y}`,open:we,autocollapse:p})}p&&C&&se();function P(j){pe.call(this,l,j)}function oe(j){pe.call(this,l,j)}function X(j){pe.call(this,l,j)}function ie(j){pe.call(this,l,j)}return l.$$set=j=>{t(37,e=Ie(Ie({},e),We(j))),"open"in j&&t(17,C=j.open),"id"in j&&t(0,y=j.id),"autocollapse"in j&&t(18,p=j.autocollapse),"active"in j&&m(t(1,R=j.active)),"disabled"in j&&t(2,M=j.disabled),"padding"in j&&t(19,E=j.padding),"hover"in j&&t(20,b=j.hover),"rounded"in j&&t(21,D=j.rounded),"caretOpen"in j&&t(22,z=j.caretOpen),"caretClosed"in j&&t(23,$=j.caretClosed),"regionControl"in j&&t(24,I=j.regionControl),"regionPanel"in j&&t(25,ne=j.regionPanel),"regionCaret"in j&&t(26,ue=j.regionCaret),"transitions"in j&&t(3,te=j.transitions),"transitionIn"in j&&t(4,H=j.transitionIn),"transitionInParams"in j&&t(5,le=j.transitionInParams),"transitionOut"in j&&t(6,Re=j.transitionOut),"transitionOutParams"in j&&t(7,De=j.transitionOutParams),"$$scope"in j&&t(29,k=j.$$scope)},l.$$.update=()=>{l.$$.dirty[0]&393216&&C&&p&&se(),l.$$.dirty[0]&268828673&&t(8,n=p?f===y:C),t(13,u=`${hu} ${e.class??""}`),l.$$.dirty[0]&20447232&&t(12,i=`${mu} ${E} ${b} ${D} ${I}`),l.$$.dirty[0]&12583168&&t(27,s=n?z:$),l.$$.dirty[0]&201326592&&t(11,a=`${Jt} ${ue} ${s}`),l.$$.dirty[0]&67108864&&t(10,r=`${Jt} ${ue}`),l.$$.dirty[0]&36175872&&t(9,o=`${gu} ${E} ${D} ${ne}`)},e=We(e),[y,R,M,te,H,le,Re,De,n,o,r,a,i,u,L,se,g,C,p,E,b,D,z,$,I,ne,ue,s,f,k,h,P,oe,X,ie]}class bu extends Te{constructor(e){super(),Pe(this,e,_u,du,ye,{open:17,id:0,autocollapse:18,active:1,disabled:2,padding:19,hover:20,rounded:21,caretOpen:22,caretClosed:23,regionControl:24,regionPanel:25,regionCaret:26,transitions:3,transitionIn:4,transitionInParams:5,transitionOut:6,transitionOutParams:7},null,[-1,-1])}}function vu(l,{from:e,to:t},n={}){const u=getComputedStyle(l),i=u.transform==="none"?"":u.transform,[s,a]=u.transformOrigin.split(" ").map(parseFloat),r=e.left+e.width*s/t.width-(t.left+s),o=e.top+e.height*a/t.height-(t.top+a),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:m=Rt}=n;return{delay:f,duration:tl(c)?c(Math.sqrt(r*r+o*o)):c,easing:m,css:(h,k)=>{const g=k*r,v=k*o,C=h+k*e.width/t.width,y=h+k*e.height/t.height;return`transform: ${i} translate(${g}px, ${v}px) scale(${C}, ${y});`}}}function ku(l){let e,t,n;const u=l[15].default,i=Ge(u,l,l[14],null);return{c(){e=w("div"),i&&i.c(),this.h()},l(s){e=B(s,"DIV",{class:!0,"data-testid":!0,role:!0,"aria-labelledby":!0});var a=A(e);i&&i.l(a),a.forEach(_),this.h()},h(){d(e,"class",t="radio-group "+l[1]),d(e,"data-testid","radio-group"),d(e,"role","radiogroup"),d(e,"aria-labelledby",l[0])},m(s,a){N(s,e,a),i&&i.m(e,null),n=!0},p(s,[a]){i&&i.p&&(!n||a&16384)&&Xe(i,u,s,s[14],n?Je(u,s[14],a,null):Ye(s[14]),null),(!n||a&2&&t!==(t="radio-group "+s[1]))&&d(e,"class",t),(!n||a&1)&&d(e,"aria-labelledby",s[0])},i(s){n||(F(i,s),n=!0)},o(s){U(i,s),n=!1},d(s){s&&_(e),i&&i.d(s)}}}const pu="p-1";function Eu(l,e,t){let n,{$$slots:u={},$$scope:i}=e,{display:s="inline-flex"}=e,{flexDirection:a="flex-row"}=e,{gap:r="gap-1"}=e,{background:o="bg-surface-200-700-token"}=e,{border:f="border-token border-surface-400-500-token"}=e,{rounded:c="rounded-token"}=e,{padding:m="px-4 py-1"}=e,{active:h="variant-filled"}=e,{hover:k="hover:variant-soft"}=e,{color:g=""}=e,{fill:v=""}=e,{regionLabel:C=""}=e,{labelledby:y=""}=e;return re("rounded",c),re("padding",m),re("active",h),re("hover",k),re("color",g),re("fill",v),re("regionLabel",C),l.$$set=p=>{t(16,e=Ie(Ie({},e),We(p))),"display"in p&&t(2,s=p.display),"flexDirection"in p&&t(3,a=p.flexDirection),"gap"in p&&t(4,r=p.gap),"background"in p&&t(5,o=p.background),"border"in p&&t(6,f=p.border),"rounded"in p&&t(7,c=p.rounded),"padding"in p&&t(8,m=p.padding),"active"in p&&t(9,h=p.active),"hover"in p&&t(10,k=p.hover),"color"in p&&t(11,g=p.color),"fill"in p&&t(12,v=p.fill),"regionLabel"in p&&t(13,C=p.regionLabel),"labelledby"in p&&t(0,y=p.labelledby),"$$scope"in p&&t(14,i=p.$$scope)},l.$$.update=()=>{t(1,n=`${pu} ${s} ${a} ${r} ${o} ${f} ${c} ${e.class??""}`)},e=We(e),[y,n,s,a,r,o,f,c,m,h,k,g,v,C,i,u]}class Su extends Te{constructor(e){super(),Pe(this,e,Eu,ku,ye,{display:2,flexDirection:3,gap:4,background:5,border:6,rounded:7,padding:8,active:9,hover:10,color:11,fill:12,regionLabel:13,labelledby:0})}}function yu(l){let e,t,n,u,i,s,a,r,o,f,c,m=[{type:"radio"},{name:l[1]},{__value:l[2]},l[11](),{tabindex:"-1"}],h={};for(let v=0;v<m.length;v+=1)h=Ie(h,m[v]);const k=l[21].default,g=Ge(k,l,l[20],null);return o=nl(l[29][0]),{c(){e=w("label"),t=w("div"),n=w("div"),u=w("input"),i=Q(),g&&g.c(),this.h()},l(v){e=B(v,"LABEL",{class:!0});var C=A(e);t=B(C,"DIV",{class:!0,"data-testid":!0,role:!0,"aria-checked":!0,"aria-label":!0,tabindex:!0,title:!0});var y=A(t);n=B(y,"DIV",{class:!0});var p=A(n);u=B(p,"INPUT",{type:!0,name:!0,tabindex:!0}),p.forEach(_),i=Z(y),g&&g.l(y),y.forEach(_),C.forEach(_),this.h()},h(){vt(u,h),d(n,"class","h-0 w-0 overflow-hidden"),d(t,"class",s="radio-item "+l[8]),d(t,"data-testid","radio-item"),d(t,"role","radio"),d(t,"aria-checked",l[6]),d(t,"aria-label",l[4]),d(t,"tabindex","0"),d(t,"title",l[3]),d(e,"class",a="radio-label "+l[9]+" "+l[5]),o.p(u)},m(v,C){N(v,e,C),T(e,t),T(t,n),T(n,u),u.autofocus&&u.focus(),l[27](u),u.checked=u.__value===l[0],T(t,i),g&&g.m(t,null),r=!0,f||(c=[Y(u,"change",l[28]),Y(u,"click",l[25]),Y(u,"change",l[26]),Y(t,"keydown",l[10]),Y(t,"keydown",l[22]),Y(t,"keyup",l[23]),Y(t,"keypress",l[24])],f=!0)},p(v,C){vt(u,h=An(m,[{type:"radio"},(!r||C[0]&2)&&{name:v[1]},(!r||C[0]&4)&&{__value:v[2]},v[11](),{tabindex:"-1"}])),C[0]&1&&(u.checked=u.__value===v[0]),g&&g.p&&(!r||C[0]&1048576)&&Xe(g,k,v,v[20],r?Je(k,v[20],C,null):Ye(v[20]),null),(!r||C[0]&256&&s!==(s="radio-item "+v[8]))&&d(t,"class",s),(!r||C[0]&64)&&d(t,"aria-checked",v[6]),(!r||C[0]&16)&&d(t,"aria-label",v[4]),(!r||C[0]&8)&&d(t,"title",v[3]),(!r||C[0]&544&&a!==(a="radio-label "+v[9]+" "+v[5]))&&d(e,"class",a)},i(v){r||(F(g,v),r=!0)},o(v){U(g,v),r=!1},d(v){v&&_(e),l[27](null),g&&g.d(v),o.r(),f=!1,$e(c)}}}const Cu="flex-auto",Du="text-base text-center cursor-pointer",zu="opacity-50 cursor-not-allowed";function Tu(l,e,t){let n,u,i,s,a;const r=["group","name","value","title","label","rounded","padding","active","hover","color","fill","regionLabel"];let o=kt(e,r),{$$slots:f={},$$scope:c}=e,{group:m}=e,{name:h}=e,{value:k}=e,{title:g=""}=e,{label:v=""}=e,{rounded:C=de("rounded")}=e,{padding:y=de("padding")}=e,{active:p=de("active")}=e,{hover:R=de("hover")}=e,{color:M=de("color")}=e,{fill:E=de("fill")}=e,{regionLabel:b=de("regionLabel")}=e,D;function z(L){["Enter","Space"].includes(L.code)&&(L.preventDefault(),D.click())}function $(){return delete o.class,o}const I=[[]];function ne(L){pe.call(this,l,L)}function ue(L){pe.call(this,l,L)}function te(L){pe.call(this,l,L)}function H(L){pe.call(this,l,L)}function le(L){pe.call(this,l,L)}function Re(L){ze[L?"unshift":"push"](()=>{D=L,t(7,D)})}function De(){m=this.__value,t(0,m)}return l.$$set=L=>{t(31,e=Ie(Ie({},e),We(L))),t(30,o=kt(e,r)),"group"in L&&t(0,m=L.group),"name"in L&&t(1,h=L.name),"value"in L&&t(2,k=L.value),"title"in L&&t(3,g=L.title),"label"in L&&t(4,v=L.label),"rounded"in L&&t(12,C=L.rounded),"padding"in L&&t(13,y=L.padding),"active"in L&&t(14,p=L.active),"hover"in L&&t(15,R=L.hover),"color"in L&&t(16,M=L.color),"fill"in L&&t(17,E=L.fill),"regionLabel"in L&&t(5,b=L.regionLabel),"$$scope"in L&&t(20,c=L.$$scope)},l.$$.update=()=>{l.$$.dirty[0]&5&&t(6,n=k===m),l.$$.dirty[0]&245824&&t(19,u=n?`${p} ${M} ${E}`:R),t(18,i=e.disabled?zu:""),t(8,a=`${Du} ${y} ${C} ${u} ${i} ${e.class??""}`)},t(9,s=`${Cu}`),e=We(e),[m,h,k,g,v,b,n,D,a,s,z,$,C,y,p,R,M,E,i,u,c,f,ne,ue,te,H,le,Re,De,I]}class Qt extends Te{constructor(e){super(),Pe(this,e,Tu,yu,ye,{group:0,name:1,value:2,title:3,label:4,rounded:12,padding:13,active:14,hover:15,color:16,fill:17,regionLabel:5},null,[-1,-1])}}function Zt(l){let e,t;const n=l[22].default,u=Ge(n,l,l[21],null);return{c(){e=w("div"),u&&u.c(),this.h()},l(i){e=B(i,"DIV",{class:!0});var s=A(e);u&&u.l(s),s.forEach(_),this.h()},h(){d(e,"class","slide-toggle-text ml-3")},m(i,s){N(i,e,s),u&&u.m(e,null),t=!0},p(i,s){u&&u.p&&(!t||s[0]&2097152)&&Xe(u,n,i,i[21],t?Je(n,i[21],s,null):Ye(i[21]),null)},i(i){t||(F(u,i),t=!0)},o(i){U(u,i),t=!1},d(i){i&&_(e),u&&u.d(i)}}}function Pu(l){let e,t,n,u,i,s,a,r,o,f,c,m,h,k,g,v=[{type:"checkbox"},{class:"slide-toggle-input hidden"},{name:l[1]},l[8](),{disabled:u=l[9].disabled}],C={};for(let p=0;p<v.length;p+=1)C=Ie(C,v[p]);let y=l[10].default&&Zt(l);return{c(){e=w("div"),t=w("label"),n=w("input"),i=Q(),s=w("div"),a=w("div"),f=Q(),y&&y.c(),this.h()},l(p){e=B(p,"DIV",{id:!0,class:!0,"data-testid":!0,role:!0,"aria-label":!0,"aria-checked":!0,tabindex:!0});var R=A(e);t=B(R,"LABEL",{class:!0});var M=A(t);n=B(M,"INPUT",{type:!0,class:!0,name:!0}),i=Z(M),s=B(M,"DIV",{class:!0});var E=A(s);a=B(E,"DIV",{class:!0}),A(a).forEach(_),E.forEach(_),f=Z(M),y&&y.l(M),M.forEach(_),R.forEach(_),this.h()},h(){vt(n,C),d(a,"class",r="slide-toggle-thumb "+l[3]),Ne(a,"cursor-not-allowed",l[9].disabled),d(s,"class",o="slide-toggle-track "+l[4]),Ne(s,"cursor-not-allowed",l[9].disabled),d(t,"class",c="slide-toggle-label "+l[5]),d(e,"id",l[2]),d(e,"class",m="slide-toggle "+l[6]),d(e,"data-testid","slide-toggle"),d(e,"role","switch"),d(e,"aria-label",l[2]),d(e,"aria-checked",l[0]),d(e,"tabindex","0")},m(p,R){N(p,e,R),T(e,t),T(t,n),n.autofocus&&n.focus(),n.checked=l[0],T(t,i),T(t,s),T(s,a),T(t,f),y&&y.m(t,null),h=!0,k||(g=[Y(n,"change",l[31]),Y(n,"click",l[23]),Y(n,"keydown",l[24]),Y(n,"keyup",l[25]),Y(n,"keypress",l[26]),Y(n,"mouseover",l[27]),Y(n,"change",l[28]),Y(n,"focus",l[29]),Y(n,"blur",l[30]),Y(e,"keydown",l[7])],k=!0)},p(p,R){vt(n,C=An(v,[{type:"checkbox"},{class:"slide-toggle-input hidden"},(!h||R[0]&2)&&{name:p[1]},p[8](),(!h||R[0]&512&&u!==(u=p[9].disabled))&&{disabled:u}])),R[0]&1&&(n.checked=p[0]),(!h||R[0]&8&&r!==(r="slide-toggle-thumb "+p[3]))&&d(a,"class",r),(!h||R[0]&520)&&Ne(a,"cursor-not-allowed",p[9].disabled),(!h||R[0]&16&&o!==(o="slide-toggle-track "+p[4]))&&d(s,"class",o),(!h||R[0]&528)&&Ne(s,"cursor-not-allowed",p[9].disabled),p[10].default?y?(y.p(p,R),R[0]&1024&&F(y,1)):(y=Zt(p),y.c(),F(y,1),y.m(t,null)):y&&(Ee(),U(y,1,1,()=>{y=null}),Se()),(!h||R[0]&32&&c!==(c="slide-toggle-label "+p[5]))&&d(t,"class",c),(!h||R[0]&4)&&d(e,"id",p[2]),(!h||R[0]&64&&m!==(m="slide-toggle "+p[6]))&&d(e,"class",m),(!h||R[0]&4)&&d(e,"aria-label",p[2]),(!h||R[0]&1)&&d(e,"aria-checked",p[0])},i(p){h||(F(y),h=!0)},o(p){U(y),h=!1},d(p){p&&_(e),y&&y.d(),k=!1,$e(g)}}}const Ru="inline-block",wu="unstyled flex items-center",Bu="flex transition-all duration-[200ms] cursor-pointer",Iu="w-[50%] h-full scale-[0.8] transition-all duration-[200ms] shadow";function Fu(l,e,t){let n,u,i,s,a,r,o,f;const c=["name","checked","size","background","active","border","rounded","label"];let m=kt(e,c),{$$slots:h={},$$scope:k}=e;const g=Pn(h),v=zt();let{name:C}=e,{checked:y=!1}=e,{size:p="md"}=e,{background:R="bg-surface-400 dark:bg-surface-700"}=e,{active:M="bg-surface-900 dark:bg-surface-300"}=e,{border:E=""}=e,{rounded:b="rounded-full"}=e,{label:D=""}=e,z;switch(p){case"sm":z="w-12 h-6";break;case"lg":z="w-20 h-10";break;default:z="w-16 h-8"}function $(V){["Enter","Space"].includes(V.code)&&(V.preventDefault(),v("keyup",V),V.currentTarget.firstChild.click())}function I(){return delete m.class,m}function ne(V){pe.call(this,l,V)}function ue(V){pe.call(this,l,V)}function te(V){pe.call(this,l,V)}function H(V){pe.call(this,l,V)}function le(V){pe.call(this,l,V)}function Re(V){pe.call(this,l,V)}function De(V){pe.call(this,l,V)}function L(V){pe.call(this,l,V)}function se(){y=this.checked,t(0,y)}return l.$$set=V=>{t(9,e=Ie(Ie({},e),We(V))),t(33,m=kt(e,c)),"name"in V&&t(1,C=V.name),"checked"in V&&t(0,y=V.checked),"size"in V&&t(11,p=V.size),"background"in V&&t(12,R=V.background),"active"in V&&t(13,M=V.active),"border"in V&&t(14,E=V.border),"rounded"in V&&t(15,b=V.rounded),"label"in V&&t(2,D=V.label),"$$scope"in V&&t(21,k=V.$$scope)},l.$$.update=()=>{l.$$.dirty[0]&12289&&t(19,n=y?M:`${R} cursor-pointer`),l.$$.dirty[0]&1&&t(18,u=y?"bg-white/75":"bg-white"),l.$$.dirty[0]&1&&t(17,i=y?"translate-x-full":""),t(20,s=e.disabled===!0?"opacity-50":"hover:brightness-[105%] dark:hover:brightness-110 cursor-pointer"),t(6,a=`${Ru} ${b} ${s} ${e.class??""}`),l.$$.dirty[0]&638976&&t(4,o=`${Bu} ${E} ${b} ${z} ${n}`),l.$$.dirty[0]&425984&&t(3,f=`${Iu} ${b} ${u} ${i}`)},t(5,r=`${wu}`),e=We(e),[y,C,D,f,o,r,a,$,I,e,g,p,R,M,E,b,z,i,u,n,s,k,h,ne,ue,te,H,le,Re,De,L,se]}class Un extends Te{constructor(e){super(),Pe(this,e,Fu,Pu,ye,{name:1,checked:0,size:11,background:12,active:13,border:14,rounded:15,label:2},null,[-1,-1])}}function xt(l,e,t){const n=l.slice();return n[36]=e[t],n[38]=t,n}function $t(l){let e,t,n=[],u=new Map,i,s,a,r=xe(l[11]);const o=f=>f[36];for(let f=0;f<r.length;f+=1){let c=xt(l,r,f),m=o(c);u.set(m,n[f]=ln(m,c))}return{c(){e=w("div"),t=w("div");for(let f=0;f<n.length;f+=1)n[f].c();this.h()},l(f){e=B(f,"DIV",{class:!0,"data-testid":!0});var c=A(e);t=B(c,"DIV",{class:!0});var m=A(t);for(let h=0;h<n.length;h+=1)n[h].l(m);m.forEach(_),c.forEach(_),this.h()},h(){d(t,"class",i="snackbar "+l[13]),d(e,"class",s="snackbar-wrapper "+l[14]),d(e,"data-testid","snackbar-wrapper")},m(f,c){N(f,e,c),T(e,t);for(let m=0;m<n.length;m+=1)n[m]&&n[m].m(t,null);a=!0},p(f,c){if(c[0]&499103){r=xe(f[11]),Ee();for(let m=0;m<n.length;m+=1)n[m].r();n=hl(n,c,o,1,f,r,u,t,dl,ln,null,xt);for(let m=0;m<n.length;m+=1)n[m].a();Se()}(!a||c[0]&8192&&i!==(i="snackbar "+f[13]))&&d(t,"class",i),(!a||c[0]&16384&&s!==(s="snackbar-wrapper "+f[14]))&&d(e,"class",s)},i(f){if(!a){for(let c=0;c<r.length;c+=1)F(n[c]);a=!0}},o(f){for(let c=0;c<n.length;c+=1)U(n[c]);a=!1},d(f){f&&_(e);for(let c=0;c<n.length;c+=1)n[c].d()}}}function en(l){let e,t,n=l[36].action&&tn(l),u=!l[36].hideDismiss&&nn(l);return{c(){e=w("div"),n&&n.c(),t=Q(),u&&u.c(),this.h()},l(i){e=B(i,"DIV",{class:!0});var s=A(e);n&&n.l(s),t=Z(s),u&&u.l(s),s.forEach(_),this.h()},h(){d(e,"class","toast-actions "+Nu)},m(i,s){N(i,e,s),n&&n.m(e,null),T(e,t),u&&u.m(e,null)},p(i,s){i[36].action?n?n.p(i,s):(n=tn(i),n.c(),n.m(e,t)):n&&(n.d(1),n=null),i[36].hideDismiss?u&&(u.d(1),u=null):u?u.p(i,s):(u=nn(i),u.c(),u.m(e,null))},d(i){i&&_(e),n&&n.d(),u&&u.d()}}}function tn(l){let e,t,n=l[36].action.label+"",u,i;function s(){return l[30](l[38])}return{c(){e=w("button"),t=new ot(!1),this.h()},l(a){e=B(a,"BUTTON",{class:!0});var r=A(e);t=ct(r,!1),r.forEach(_),this.h()},h(){t.a=null,d(e,"class",l[1])},m(a,r){N(a,e,r),t.m(n,e),u||(i=Y(e,"click",s),u=!0)},p(a,r){l=a,r[0]&2048&&n!==(n=l[36].action.label+"")&&t.p(n),r[0]&2&&d(e,"class",l[1])},d(a){a&&_(e),u=!1,i()}}}function nn(l){let e,t,n,u;function i(){return l[31](l[36])}return{c(){e=w("button"),t=Fe(l[3]),this.h()},l(s){e=B(s,"BUTTON",{class:!0,"aria-label":!0});var a=A(e);t=Ae(a,l[3]),a.forEach(_),this.h()},h(){d(e,"class",l[2]),d(e,"aria-label","Dismiss toast")},m(s,a){N(s,e,a),T(e,t),n||(u=Y(e,"click",i),n=!0)},p(s,a){l=s,a[0]&8&&st(t,l[3]),a[0]&4&&d(e,"class",l[2])},d(s){s&&_(e),n=!1,u()}}}function ln(l,e){let t,n,u,i,s=e[36].message+"",a,r,o,f,c,m,h,k=ae,g,v,C,y=(e[36].action||!e[36].hideDismiss)&&en(e);function p(){return e[32](e[38])}function R(){return e[33](e[38])}return{key:l,first:null,c(){t=w("div"),n=w("div"),u=w("div"),i=new ot(!1),a=Q(),y&&y.c(),o=Q(),this.h()},l(M){t=B(M,"DIV",{role:!0,"aria-live":!0});var E=A(t);n=B(E,"DIV",{class:!0,"data-testid":!0});var b=A(n);u=B(b,"DIV",{class:!0});var D=A(u);i=ct(D,!1),D.forEach(_),a=Z(b),y&&y.l(b),b.forEach(_),o=Z(E),E.forEach(_),this.h()},h(){i.a=null,d(u,"class","text-base"),d(n,"class",r="toast "+e[12]+" "+(e[36].background??e[0])+" "+(e[36].classes??"")),d(n,"data-testid","toast"),d(t,"role",f=e[36].hideDismiss?"alert":"alertdialog"),d(t,"aria-live","polite"),this.first=t},m(M,E){N(M,t,E),T(t,n),T(n,u),i.m(s,u),T(n,a),y&&y.m(n,null),T(t,o),g=!0,v||(C=[Y(t,"mouseenter",p),Y(t,"mouseleave",R)],v=!0)},p(M,E){e=M,(!g||E[0]&2048)&&s!==(s=e[36].message+"")&&i.p(s),e[36].action||!e[36].hideDismiss?y?y.p(e,E):(y=en(e),y.c(),y.m(n,null)):y&&(y.d(1),y=null),(!g||E[0]&6145&&r!==(r="toast "+e[12]+" "+(e[36].background??e[0])+" "+(e[36].classes??"")))&&d(n,"class",r),(!g||E[0]&2048&&f!==(f=e[36].hideDismiss?"alert":"alertdialog"))&&d(t,"role",f)},r(){h=t.getBoundingClientRect()},f(){cl(t),k(),Fn(t,h)},a(){k(),k=ol(t,h,vu,{duration:e[4]?250:0})},i(M){g||(Rn(()=>{g&&(m&&m.end(1),c=wn(t,pt,{transition:e[5],params:{x:e[10].x,y:e[10].y,...e[6]},enabled:e[4]}),c.start())}),g=!0)},o(M){c&&c.invalidate(),m=Bn(t,pt,{transition:e[7],params:{x:e[10].x,y:e[10].y,...e[8]},enabled:e[4]}),g=!1},d(M){M&&_(t),y&&y.d(),M&&m&&m.end(),v=!1,$e(C)}}}function Au(l){let e,t,n=l[9].length&&$t(l);return{c(){n&&n.c(),e=ke()},l(u){n&&n.l(u),e=ke()},m(u,i){n&&n.m(u,i),N(u,e,i),t=!0},p(u,i){u[9].length?n?(n.p(u,i),i[0]&512&&F(n,1)):(n=$t(u),n.c(),F(n,1),n.m(e.parentNode,e)):n&&(Ee(),U(n,1,1,()=>{n=null}),Se())},i(u){t||(F(n),t=!0)},o(u){U(n),t=!1},d(u){u&&_(e),n&&n.d(u)}}}const Ou="flex fixed top-0 left-0 right-0 bottom-0 pointer-events-none",Mu="flex flex-col gap-y-2",Lu="flex justify-between items-center pointer-events-auto",Nu="flex items-center space-x-2";function Vu(l,e,t){let n,u,i,s,a,r;tt(l,jn,P=>t(34,r=P));const o=Nn();tt(l,o,P=>t(9,a=P));let{position:f="b"}=e,{max:c=3}=e,{background:m="variant-filled-secondary"}=e,{width:h="max-w-[640px]"}=e,{color:k=""}=e,{padding:g="p-4"}=e,{spacing:v="space-x-4"}=e,{rounded:C="rounded-container-token"}=e,{shadow:y="shadow-lg"}=e,{zIndex:p="z-[888]"}=e,{buttonAction:R="btn variant-filled"}=e,{buttonDismiss:M="btn-icon btn-icon-sm variant-filled"}=e,{buttonDismissLabel:E="✕"}=e,{transitions:b=!r}=e,{transitionIn:D=jt}=e,{transitionInParams:z={duration:250}}=e,{transitionOut:$=jt}=e,{transitionOutParams:I={duration:250}}=e,ne,ue,te={x:0,y:0};switch(f){case"t":ne="justify-center items-start",ue="items-center",te={x:0,y:-100};break;case"b":ne="justify-center items-end",ue="items-center",te={x:0,y:100};break;case"l":ne="justify-start items-center",ue="items-start",te={x:-100,y:0};break;case"r":ne="justify-end items-center",ue="items-end",te={x:100,y:0};break;case"tl":ne="justify-start items-start",ue="items-start",te={x:-100,y:0};break;case"tr":ne="justify-end items-start",ue="items-end",te={x:100,y:0};break;case"bl":ne="justify-start items-end",ue="items-start",te={x:-100,y:0};break;case"br":ne="justify-end items-end",ue="items-end",te={x:100,y:0};break}function H(P){a[P]?.action?.response(),o.close(a[P].id)}function le(P){a[P]?.hoverable&&(o.freeze(P),t(13,u+=" scale-[105%]"))}function Re(P){a[P]?.hoverable&&(o.unfreeze(P),t(13,u=u.replace(" scale-[105%]","")))}const De=P=>H(P),L=P=>o.close(P.id),se=P=>le(P),V=P=>Re(P);return l.$$set=P=>{t(35,e=Ie(Ie({},e),We(P))),"position"in P&&t(19,f=P.position),"max"in P&&t(20,c=P.max),"background"in P&&t(0,m=P.background),"width"in P&&t(21,h=P.width),"color"in P&&t(22,k=P.color),"padding"in P&&t(23,g=P.padding),"spacing"in P&&t(24,v=P.spacing),"rounded"in P&&t(25,C=P.rounded),"shadow"in P&&t(26,y=P.shadow),"zIndex"in P&&t(27,p=P.zIndex),"buttonAction"in P&&t(1,R=P.buttonAction),"buttonDismiss"in P&&t(2,M=P.buttonDismiss),"buttonDismissLabel"in P&&t(3,E=P.buttonDismissLabel),"transitions"in P&&t(4,b=P.transitions),"transitionIn"in P&&t(5,D=P.transitionIn),"transitionInParams"in P&&t(6,z=P.transitionInParams),"transitionOut"in P&&t(7,$=P.transitionOut),"transitionOutParams"in P&&t(8,I=P.transitionOutParams)},l.$$.update=()=>{t(14,n=`${Ou} ${ne} ${p} ${e.class||""}`),l.$$.dirty[0]&545259520&&t(13,u=`${Mu} ${ue} ${g}`),l.$$.dirty[0]&132120576&&t(12,i=`${Lu} ${h} ${k} ${g} ${v} ${C} ${y}`),l.$$.dirty[0]&1049088&&t(11,s=Array.from(a).slice(0,c))},e=We(e),[m,R,M,E,b,D,z,$,I,a,te,s,i,u,n,o,H,le,Re,f,c,h,k,g,v,C,y,p,ne,ue,De,L,se,V]}class ju extends Te{constructor(e){super(),Pe(this,e,Vu,Au,ye,{position:19,max:20,background:0,width:21,color:22,padding:23,spacing:24,rounded:25,shadow:26,zIndex:27,buttonAction:1,buttonDismiss:2,buttonDismissLabel:3,transitions:4,transitionIn:5,transitionInParams:6,transitionOut:7,transitionOutParams:8},null,[-1,-1])}}class Ve{static findDateInText(e){const t=/\b\d{1,2}\.\d{1,2}\.\d{4}\b/g,n=e.match(t);if(n&&n.length>0){const u=n[0],[i,s,a]=u.split(".").map(Number);return new Date(a,s-1,i)}return null}static sortByRelevanceAndDate(e){return e.sort((t,n)=>{const u=n.relevance-t.relevance;if(u!==0)return u;const i=Ve.findDateInText(t.title),s=Ve.findDateInText(n.title);return i&&s?s.getTime()-i.getTime():i?-1:s?1:0})}static sortByDate(e){const t=e.filter(a=>Ve.findDateInText(a.title)),n=e.filter(a=>!Ve.findDateInText(a.title)),u=t.sort((a,r)=>{const o=Ve.findDateInText(a.title),f=Ve.findDateInText(r.title);return o&&f?f.getTime()-o.getTime():o?-1:f?1:0}),i=[];let s=0;for(const a of e)if(Ve.findDateInText(a.title)){let r=u.shift();r&&i.push(r)}else i.push(n[s]),s++;return i}static sortByRelevance(e){return e.sort((t,n)=>t.relevance&&n.relevance?n.relevance-t.relevance:t.relevance?-1:n.relevance?1:0)}static identifyDocumentType(e){const t=[{regexp:/(ФАС |АС |КС |ВС |[Сс]удебн|[Сс]уд)/,docType:"Решение суда"},{regexp:/[Пп]исьмо [Мм]инфина/,docType:"Письмо Минфина"},{regexp:/[Пп]исьмо (ФНС|фнс)/,docType:"Письмо ФНС"},{regexp:/ст.(\d+\.\d+|\d+) НКРФ/,docType:"НК РФ"},{regexp:/ст.(\d+\.\d+|\d+) ТКРФ/,docType:"ТК РФ"},{regexp:/Приказ ФНС РФ/,docType:"Приказ ФНС РФ"},{regexp:/Постановление Правительства РФ/,docType:"Постановление Правительства РФ"},{regexp:/Решение Коллегии Евразийской экономической комиссии/,docType:"Решение Коллегии ЕЭК"},{regexp:/^Федеральный закон/,docType:"Федеральные законы"}];return e.map(n=>{for(const{regexp:u,docType:i}of t)if(u.test(n.title))return n.docType=i,n;return n.docType="Другие документы",n})}}function un(l,e,t){const n=l.slice();return n[10]=e[t],n}function sn(l){let e,t,n;return{c(){e=w("input"),this.h()},l(u){e=B(u,"INPUT",{type:!0}),this.h()},h(){d(e,"type","checkbox")},m(u,i){N(u,e,i),e.checked=l[1][l[3]],t||(n=Y(e,"change",l[7]),t=!0)},p(u,i){i&10&&(e.checked=u[1][u[3]])},d(u){u&&_(e),t=!1,n()}}}function Uu(l){let e,t;return{c(){e=w("div"),t=Fe(l[4]),this.h()},l(n){e=B(n,"DIV",{class:!0});var u=A(e);t=Ae(u,l[4]),u.forEach(_),this.h()},h(){d(e,"class","annotation svelte-dwjxto")},m(n,u){N(n,e,u),T(e,t)},p(n,u){u&16&&st(t,n[4])},d(n){n&&_(e)}}}function Wu(l){let e,t=xe(l[4].split(`
`)),n=[];for(let u=0;u<t.length;u+=1)n[u]=an(un(l,t,u));return{c(){e=w("div");for(let u=0;u<n.length;u+=1)n[u].c();this.h()},l(u){e=B(u,"DIV",{class:!0});var i=A(e);for(let s=0;s<n.length;s+=1)n[s].l(i);i.forEach(_),this.h()},h(){d(e,"class","annotation full-text svelte-dwjxto")},m(u,i){N(u,e,i);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(e,null)},p(u,i){if(i&16){t=xe(u[4].split(`
`));let s;for(s=0;s<t.length;s+=1){const a=un(u,t,s);n[s]?n[s].p(a,i):(n[s]=an(a),n[s].c(),n[s].m(e,null))}for(;s<n.length;s+=1)n[s].d(1);n.length=t.length}},d(u){u&&_(e),Et(n,u)}}}function an(l){let e,t=l[10]+"",n;return{c(){e=w("p"),n=Fe(t)},l(u){e=B(u,"P",{});var i=A(e);n=Ae(i,t),i.forEach(_)},m(u,i){N(u,e,i),T(e,n)},p(u,i){i&16&&t!==(t=u[10]+"")&&st(n,t)},d(u){u&&_(e)}}}function rn(l){let e;function t(i,s){return i[0][i[2]]?Hu:qu}let n=t(l),u=n(l);return{c(){u.c(),e=ke()},l(i){u.l(i),e=ke()},m(i,s){u.m(i,s),N(i,e,s)},p(i,s){n===(n=t(i))&&u?u.p(i,s):(u.d(1),u=n(i),u&&(u.c(),u.m(e.parentNode,e)))},d(i){i&&_(e),u.d(i)}}}function qu(l){let e,t="читать далее...",n,u;return{c(){e=w("a"),e.textContent=t,this.h()},l(i){e=B(i,"A",{class:!0,"data-svelte-h":!0}),Ce(e)!=="svelte-1pu88dh"&&(e.textContent=t),this.h()},h(){d(e,"class","svelte-dwjxto")},m(i,s){N(i,e,s),n||(u=Y(e,"click",l[9]),n=!0)},p:ae,d(i){i&&_(e),n=!1,u()}}}function Hu(l){let e,t="свернуть",n,u;return{c(){e=w("a"),e.textContent=t,this.h()},l(i){e=B(i,"A",{class:!0,"data-svelte-h":!0}),Ce(e)!=="svelte-18vtpy5"&&(e.textContent=t),this.h()},h(){d(e,"class","svelte-dwjxto")},m(i,s){N(i,e,s),n||(u=Y(e,"click",l[8]),n=!0)},p:ae,d(i){i&&_(e),n=!1,u()}}}function Ku(l){let e,t,n,u,i,s,a,r=l[5]&&sn(l);function o(h,k){return h[0][h[2]]?Wu:Uu}let f=o(l),c=f(l),m=l[4].length>100&&rn(l);return{c(){e=w("div"),t=w("div"),n=w("label"),r&&r.c(),u=Q(),i=Fe(l[3]),s=Q(),c.c(),a=Q(),m&&m.c(),this.h()},l(h){e=B(h,"DIV",{class:!0});var k=A(e);t=B(k,"DIV",{class:!0});var g=A(t);n=B(g,"LABEL",{style:!0});var v=A(n);r&&r.l(v),u=Z(v),i=Ae(v,l[3]),v.forEach(_),g.forEach(_),s=Z(k),c.l(k),a=Z(k),m&&m.l(k),k.forEach(_),this.h()},h(){et(n,"cursor","pointer"),d(t,"class","title svelte-dwjxto"),d(e,"class","search-result svelte-dwjxto")},m(h,k){N(h,e,k),T(e,t),T(t,n),r&&r.m(n,null),T(n,u),T(n,i),T(e,s),c.m(e,null),T(e,a),m&&m.m(e,null)},p(h,[k]){h[5]?r?r.p(h,k):(r=sn(h),r.c(),r.m(n,u)):r&&(r.d(1),r=null),k&8&&st(i,h[3]),f===(f=o(h))&&c?c.p(h,k):(c.d(1),c=f(h),c&&(c.c(),c.m(e,a))),h[4].length>100?m?m.p(h,k):(m=rn(h),m.c(),m.m(e,null)):m&&(m.d(1),m=null)},i:ae,o:ae,d(h){h&&_(e),r&&r.d(),c.d(),m&&m.d()}}}function Gu(l,e,t){let{showFullText:n=Array(10).fill(!1)}=e,{useSearchResult:u}=e,{index:i}=e,{title:s}=e,{text:a}=e,{enableSearchResultSelection:r=!1}=e;function o(h){t(0,n[h]=!n[h],n)}function f(){u[s]=this.checked,t(1,u)}const c=()=>o(i),m=()=>o(i);return l.$$set=h=>{"showFullText"in h&&t(0,n=h.showFullText),"useSearchResult"in h&&t(1,u=h.useSearchResult),"index"in h&&t(2,i=h.index),"title"in h&&t(3,s=h.title),"text"in h&&t(4,a=h.text),"enableSearchResultSelection"in h&&t(5,r=h.enableSearchResultSelection)},[n,u,i,s,a,r,o,f,c,m]}class Wn extends Te{constructor(e){super(),Pe(this,e,Gu,Ku,ye,{showFullText:0,useSearchResult:1,index:2,title:3,text:4,enableSearchResultSelection:5})}}function on(l,e,t){const n=l.slice();return n[20]=e[t].title,n[21]=e[t].text,n[23]=t,n}function cn(l,e,t){const n=l.slice();return n[16]=e[t][0],n[17]=e[t][1],n}function fn(l,e,t){const n=l.slice();return n[20]=e[t].title,n[21]=e[t].text,n[23]=t,n}function Xu(l){let e;return{c(){e=Fe("релевантности")},l(t){e=Ae(t,"релевантности")},m(t,n){N(t,e,n)},d(t){t&&_(e)}}}function Yu(l){let e;return{c(){e=Fe("дате")},l(t){e=Ae(t,"дате")},m(t,n){N(t,e,n)},d(t){t&&_(e)}}}function Ju(l){let e,t,n,u,i,s;function a(c){l[8](c)}let r={name:"sortBy",value:"rel",$$slots:{default:[Xu]},$$scope:{ctx:l}};l[5]!==void 0&&(r.group=l[5]),e=new Qt({props:r}),ze.push(()=>Ue(e,"group",a));function o(c){l[9](c)}let f={name:"sortBy",value:"date",$$slots:{default:[Yu]},$$scope:{ctx:l}};return l[5]!==void 0&&(f.group=l[5]),u=new Qt({props:f}),ze.push(()=>Ue(u,"group",o)),{c(){ge(e.$$.fragment),n=Q(),ge(u.$$.fragment)},l(c){_e(e.$$.fragment,c),n=Z(c),_e(u.$$.fragment,c)},m(c,m){be(e,c,m),N(c,n,m),be(u,c,m),s=!0},p(c,m){const h={};m&33554432&&(h.$$scope={dirty:m,ctx:c}),!t&&m&32&&(t=!0,h.group=c[5],je(()=>t=!1)),e.$set(h);const k={};m&33554432&&(k.$$scope={dirty:m,ctx:c}),!i&&m&32&&(i=!0,k.group=c[5],je(()=>i=!1)),u.$set(k)},i(c){s||(F(e.$$.fragment,c),F(u.$$.fragment,c),s=!0)},o(c){U(e.$$.fragment,c),U(u.$$.fragment,c),s=!1},d(c){c&&_(n),ve(e,c),ve(u,c)}}}function Qu(l){let e;return{c(){e=Fe("Группировать по типу")},l(t){e=Ae(t,"Группировать по типу")},m(t,n){N(t,e,n)},d(t){t&&_(e)}}}function Zu(l){let e,t,n=xe(l[0]),u=[];for(let s=0;s<n.length;s+=1)u[s]=dn(on(l,n,s));const i=s=>U(u[s],1,1,()=>{u[s]=null});return{c(){for(let s=0;s<u.length;s+=1)u[s].c();e=ke()},l(s){for(let a=0;a<u.length;a+=1)u[a].l(s);e=ke()},m(s,a){for(let r=0;r<u.length;r+=1)u[r]&&u[r].m(s,a);N(s,e,a),t=!0},p(s,a){if(a&15){n=xe(s[0]);let r;for(r=0;r<n.length;r+=1){const o=on(s,n,r);u[r]?(u[r].p(o,a),F(u[r],1)):(u[r]=dn(o),u[r].c(),F(u[r],1),u[r].m(e.parentNode,e))}for(Ee(),r=n.length;r<u.length;r+=1)i(r);Se()}},i(s){if(!t){for(let a=0;a<n.length;a+=1)F(u[a]);t=!0}},o(s){u=u.filter(Boolean);for(let a=0;a<u.length;a+=1)U(u[a]);t=!1},d(s){s&&_(e),Et(u,s)}}}function xu(l){let e,t;return e=new xl({props:{$$slots:{default:[ni]},$$scope:{ctx:l}}}),{c(){ge(e.$$.fragment)},l(n){_e(e.$$.fragment,n)},m(n,u){be(e,n,u),t=!0},p(n,u){const i={};u&33554510&&(i.$$scope={dirty:u,ctx:n}),e.$set(i)},i(n){t||(F(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function dn(l){let e,t;return e=new Wn({props:{title:l[20],text:l[21],index:l[23],enableSearchResultSelection:l[3],useSearchResult:l[2],showFullText:l[1]}}),{c(){ge(e.$$.fragment)},l(n){_e(e.$$.fragment,n)},m(n,u){be(e,n,u),t=!0},p(n,u){const i={};u&1&&(i.title=n[20]),u&1&&(i.text=n[21]),u&8&&(i.enableSearchResultSelection=n[3]),u&4&&(i.useSearchResult=n[2]),u&2&&(i.showFullText=n[1]),e.$set(i)},i(n){t||(F(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function hn(l){let e,t,n,u;return{c(){e=w("input"),this.h()},l(i){e=B(i,"INPUT",{type:!0,"data-doctype":!0}),this.h()},h(){d(e,"type","checkbox"),d(e,"data-doctype",t=l[16])},m(i,s){N(i,e,s),n||(u=Y(e,"click",l[7]),n=!0)},p(i,s){s&64&&t!==(t=i[16])&&d(e,"data-doctype",t)},d(i){i&&_(e),n=!1,u()}}}function $u(l){let e,t=l[3]&&hn(l);return{c(){t&&t.c(),e=Q()},l(n){t&&t.l(n),e=Z(n)},m(n,u){t&&t.m(n,u),N(n,e,u)},p(n,u){n[3]?t?t.p(n,u):(t=hn(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&_(e),t&&t.d(n)}}}function ei(l){let e=l[16]+"",t;return{c(){t=Fe(e)},l(n){t=Ae(n,e)},m(n,u){N(n,t,u)},p(n,u){u&64&&e!==(e=n[16]+"")&&st(t,e)},d(n){n&&_(t)}}}function mn(l){let e,t;return e=new Wn({props:{title:l[20],text:l[21],index:l[23],enableSearchResultSelection:l[3],useSearchResult:l[2],showFullText:l[1]}}),{c(){ge(e.$$.fragment)},l(n){_e(e.$$.fragment,n)},m(n,u){be(e,n,u),t=!0},p(n,u){const i={};u&64&&(i.title=n[20]),u&64&&(i.text=n[21]),u&8&&(i.enableSearchResultSelection=n[3]),u&4&&(i.useSearchResult=n[2]),u&2&&(i.showFullText=n[1]),e.$set(i)},i(n){t||(F(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function ti(l){let e,t,n=xe(l[17]),u=[];for(let s=0;s<n.length;s+=1)u[s]=mn(fn(l,n,s));const i=s=>U(u[s],1,1,()=>{u[s]=null});return{c(){for(let s=0;s<u.length;s+=1)u[s].c();e=Q()},l(s){for(let a=0;a<u.length;a+=1)u[a].l(s);e=Z(s)},m(s,a){for(let r=0;r<u.length;r+=1)u[r]&&u[r].m(s,a);N(s,e,a),t=!0},p(s,a){if(a&78){n=xe(s[17]);let r;for(r=0;r<n.length;r+=1){const o=fn(s,n,r);u[r]?(u[r].p(o,a),F(u[r],1)):(u[r]=mn(o),u[r].c(),F(u[r],1),u[r].m(e.parentNode,e))}for(Ee(),r=n.length;r<u.length;r+=1)i(r);Se()}},i(s){if(!t){for(let a=0;a<n.length;a+=1)F(u[a]);t=!0}},o(s){u=u.filter(Boolean);for(let a=0;a<u.length;a+=1)U(u[a]);t=!1},d(s){s&&_(e),Et(u,s)}}}function gn(l){let e,t;return e=new bu({props:{$$slots:{content:[ti],summary:[ei],lead:[$u]},$$scope:{ctx:l}}}),{c(){ge(e.$$.fragment)},l(n){_e(e.$$.fragment,n)},m(n,u){be(e,n,u),t=!0},p(n,u){const i={};u&33554510&&(i.$$scope={dirty:u,ctx:n}),e.$set(i)},i(n){t||(F(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function ni(l){let e,t,n=xe(Object.entries(l[6])),u=[];for(let s=0;s<n.length;s+=1)u[s]=gn(cn(l,n,s));const i=s=>U(u[s],1,1,()=>{u[s]=null});return{c(){for(let s=0;s<u.length;s+=1)u[s].c();e=ke()},l(s){for(let a=0;a<u.length;a+=1)u[a].l(s);e=ke()},m(s,a){for(let r=0;r<u.length;r+=1)u[r]&&u[r].m(s,a);N(s,e,a),t=!0},p(s,a){if(a&206){n=xe(Object.entries(s[6]));let r;for(r=0;r<n.length;r+=1){const o=cn(s,n,r);u[r]?(u[r].p(o,a),F(u[r],1)):(u[r]=gn(o),u[r].c(),F(u[r],1),u[r].m(e.parentNode,e))}for(Ee(),r=n.length;r<u.length;r+=1)i(r);Se()}},i(s){if(!t){for(let a=0;a<n.length;a+=1)F(u[a]);t=!0}},o(s){u=u.filter(Boolean);for(let a=0;a<u.length;a+=1)U(u[a]);t=!1},d(s){s&&_(e),Et(u,s)}}}function li(l){let e,t,n,u,i="Сортировать по:",s,a,r,o,f,c,m,h,k,g,v;a=new Su({props:{background:"",border:"",$$slots:{default:[Ju]},$$scope:{ctx:l}}});function C(b){l[10](b)}let y={name:"groupByChecked",size:"sm",label:"Группировать по типу",$$slots:{default:[Qu]},$$scope:{ctx:l}};l[4]!==void 0&&(y.checked=l[4]),o=new Un({props:y}),ze.push(()=>Ue(o,"checked",C));const p=[xu,Zu],R=[];function M(b,D){return b[4]&&b[6]?0:1}m=M(l),h=R[m]=p[m](l);let E=ui;return{c(){e=w("div"),t=w("div"),n=w("div"),u=w("label"),u.textContent=i,s=Q(),ge(a.$$.fragment),r=Q(),ge(o.$$.fragment),c=Q(),h.c(),k=Q(),g=ke(),this.h()},l(b){e=B(b,"DIV",{class:!0});var D=A(e);t=B(D,"DIV",{class:!0});var z=A(t);n=B(z,"DIV",{class:!0,style:!0});var $=A(n);u=B($,"LABEL",{style:!0,class:!0,"data-svelte-h":!0}),Ce(u)!=="svelte-12wnwfn"&&(u.textContent=i),s=Z($),_e(a.$$.fragment,$),r=Z($),_e(o.$$.fragment,$),$.forEach(_),z.forEach(_),c=Z(D),h.l(D),D.forEach(_),k=Z(b),g=ke(),this.h()},h(){et(u,"display","inline-block"),et(u,"flex-wrap","wrap"),d(u,"class","svelte-1ptibtq"),d(n,"class","card w-full flex p-2 space-y-2"),et(n,"align-items","center"),et(n,"flex-wrap","wrap"),d(t,"class","settings-bar svelte-1ptibtq"),d(e,"class","search-results svelte-1ptibtq")},m(b,D){N(b,e,D),T(e,t),T(t,n),T(n,u),T(n,s),be(a,n,null),T(n,r),be(o,n,null),T(e,c),R[m].m(e,null),N(b,k,D),N(b,g,D),v=!0},p(b,[D]){const z={};D&33554464&&(z.$$scope={dirty:D,ctx:b}),a.$set(z);const $={};D&33554432&&($.$$scope={dirty:D,ctx:b}),!f&&D&16&&(f=!0,$.checked=b[4],je(()=>f=!1)),o.$set($);let I=m;m=M(b),m===I?R[m].p(b,D):(Ee(),U(R[I],1,1,()=>{R[I]=null}),Se(),h=R[m],h?h.p(b,D):(h=R[m]=p[m](b),h.c()),F(h,1),h.m(e,null))},i(b){v||(F(a.$$.fragment,b),F(o.$$.fragment,b),F(h),F(E),v=!0)},o(b){U(a.$$.fragment,b),U(o.$$.fragment,b),U(h),U(E),v=!1},d(b){b&&(_(e),_(k),_(g)),ve(a),ve(o),R[m].d()}}}let ui=!1;function ii(l,e,t){let{showFullText:n=Array(10).fill(!1)}=e,{useSearchResult:u}=e,i=!1,s="rel",{searchResults:a=[]}=e,r,{enableSearchResultSelection:o=!1}=e;const f=g=>g.reduce((v,C)=>{const y=C.docType||"Другие документы";return v[y]||(v[y]=[]),v[y].push(C),v},{}),c=g=>{g.stopPropagation();const v=g.target.dataset.doctype;Object.keys(r[v]).forEach(C=>{t(2,u[r[v][C].title]=g.target.checked,u)})};function m(g){s=g,t(5,s)}function h(g){s=g,t(5,s)}function k(g){i=g,t(4,i)}return l.$$set=g=>{"showFullText"in g&&t(1,n=g.showFullText),"useSearchResult"in g&&t(2,u=g.useSearchResult),"searchResults"in g&&t(0,a=g.searchResults),"enableSearchResultSelection"in g&&t(3,o=g.enableSearchResultSelection)},l.$$.update=()=>{l.$$.dirty&49&&(i&&t(6,r=f(a)),s=="date"?t(0,a=Ve.sortByDate(a)):s=="rel"&&t(0,a=Ve.sortByRelevance(a)))},[a,n,u,o,i,s,r,c,m,h,k]}class qn extends Te{constructor(e){super(),Pe(this,e,ii,li,ye,{showFullText:1,useSearchResult:2,searchResults:0,enableSearchResultSelection:3})}}function _n(l){let e,t;return e=new wl({props:{status:l[1]}}),{c(){ge(e.$$.fragment)},l(n){_e(e.$$.fragment,n)},m(n,u){be(e,n,u),t=!0},p(n,u){const i={};u[0]&2&&(i.status=n[1]),e.$set(i)},i(n){t||(F(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function bn(l){let e,t;return e=new Fl({props:{status:l[2]}}),{c(){ge(e.$$.fragment)},l(n){_e(e.$$.fragment,n)},m(n,u){be(e,n,u),t=!0},p(n,u){const i={};u[0]&4&&(i.status=n[2]),e.$set(i)},i(n){t||(F(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function si(l){let e;return{c(){e=Fe("Выбрать источники для LLM")},l(t){e=Ae(t,"Выбрать источники для LLM")},m(t,n){N(t,e,n)},d(t){t&&_(e)}}}function vn(l){let e,t="Очистить",n,u;return{c(){e=w("button"),e.textContent=t,this.h()},l(i){e=B(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(e)!=="svelte-1rjqwcg"&&(e.textContent=t),this.h()},h(){d(e,"class","btn variant-filled")},m(i,s){N(i,e,s),n||(u=Y(e,"click",l[19]),n=!0)},p:ae,d(i){i&&_(e),n=!1,u()}}}function kn(l){let e,t="Остановить",n,u;return{c(){e=w("button"),e.textContent=t,this.h()},l(i){e=B(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(e)!=="svelte-eu643t"&&(e.textContent=t),this.h()},h(){d(e,"class","btn")},m(i,s){N(i,e,s),n||(u=Y(e,"click",l[24]),n=!0)},p:ae,d(i){i&&_(e),n=!1,u()}}}function pn(l){let e,t,n,u,i,s;return i=new Tl({}),{c(){e=w("div"),t=Fe(l[12]),n=Q(),u=w("div"),ge(i.$$.fragment),this.h()},l(a){e=B(a,"DIV",{class:!0});var r=A(e);t=Ae(r,l[12]),r.forEach(_),n=Z(a),u=B(a,"DIV",{class:!0});var o=A(u);_e(i.$$.fragment,o),o.forEach(_),this.h()},h(){d(e,"class","loading-status svelte-1cldj37"),d(u,"class","loading-container svelte-1cldj37")},m(a,r){N(a,e,r),T(e,t),N(a,n,r),N(a,u,r),be(i,u,null),s=!0},p(a,r){(!s||r[0]&4096)&&st(t,a[12])},i(a){s||(F(i.$$.fragment,a),s=!0)},o(a){U(i.$$.fragment,a),s=!1},d(a){a&&(_(e),_(n),_(u)),ve(i)}}}function En(l){let e,t;return e=new Ll({props:{onSave:l[17],onClose:l[18],text:l[4]}}),{c(){ge(e.$$.fragment)},l(n){_e(e.$$.fragment,n)},m(n,u){be(e,n,u),t=!0},p(n,u){const i={};u[0]&16&&(i.text=n[4]),e.$set(i)},i(n){t||(F(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function Sn(l){let e,t,n,u;const i=[ri,ai],s=[];function a(r,o){return r[0]?0:1}return e=a(l),t=s[e]=i[e](l),{c(){t.c(),n=ke()},l(r){t.l(r),n=ke()},m(r,o){s[e].m(r,o),N(r,n,o),u=!0},p(r,o){let f=e;e=a(r),e===f?s[e].p(r,o):(Ee(),U(s[f],1,1,()=>{s[f]=null}),Se(),t=s[e],t?t.p(r,o):(t=s[e]=i[e](r),t.c()),F(t,1),t.m(n.parentNode,n))},i(r){u||(F(t),u=!0)},o(r){U(t),u=!1},d(r){r&&_(n),s[e].d(r)}}}function ai(l){let e,t;return e=new kl({props:{theme:"modern-theme",$$slots:{default:[fi]},$$scope:{ctx:l}}}),{c(){ge(e.$$.fragment)},l(n){_e(e.$$.fragment,n)},m(n,u){be(e,n,u),t=!0},p(n,u){const i={};u[0]&124576|u[1]&262144&&(i.$$scope={dirty:u,ctx:n}),e.$set(i)},i(n){t||(F(e.$$.fragment,n),t=!0)},o(n){U(e.$$.fragment,n),t=!1},d(n){ve(e,n)}}}function ri(l){let e,t,n,u,i,s,a,r,o,f,c,m,h,k,g=l[15]&&Dn(l),v=!l[7]&&l[9]&&zn(l);function C(E){l[31](E)}function y(E){l[32](E)}function p(E){l[33](E)}function R(E){l[34](E)}let M={};return l[5]!==void 0&&(M.searchResults=l[5]),l[13]!==void 0&&(M.showFullText=l[13]),l[14]!==void 0&&(M.useSearchResult=l[14]),l[15]!==void 0&&(M.enableSearchResultSelection=l[15]),o=new qn({props:M}),ze.push(()=>Ue(o,"searchResults",C)),ze.push(()=>Ue(o,"showFullText",y)),ze.push(()=>Ue(o,"useSearchResult",p)),ze.push(()=>Ue(o,"enableSearchResultSelection",R)),{c(){e=w("div"),t=w("div"),g&&g.c(),n=Q(),u=w("div"),i=new ot(!1),s=Q(),v&&v.c(),a=Q(),r=w("div"),ge(o.$$.fragment),this.h()},l(E){e=B(E,"DIV",{class:!0});var b=A(e);t=B(b,"DIV",{class:!0});var D=A(t);g&&g.l(D),n=Z(D),u=B(D,"DIV",{class:!0});var z=A(u);i=ct(z,!1),z.forEach(_),s=Z(D),v&&v.l(D),D.forEach(_),b.forEach(_),a=Z(E),r=B(E,"DIV",{class:!0});var $=A(r);_e(o.$$.fragment,$),$.forEach(_),this.h()},h(){i.a=null,d(u,"class","textarea svelte-1cldj37"),d(t,"class","textarea svelte-1cldj37"),d(e,"class","textarea-column svelte-1cldj37"),d(r,"class","search-column svelte-1cldj37")},m(E,b){N(E,e,b),T(e,t),g&&g.m(t,null),T(t,n),T(t,u),i.m(l[9],u),T(t,s),v&&v.m(t,null),N(E,a,b),N(E,r,b),be(o,r,null),k=!0},p(E,b){E[15]?g?g.p(E,b):(g=Dn(E),g.c(),g.m(t,n)):g&&(g.d(1),g=null),(!k||b[0]&512)&&i.p(E[9]),!E[7]&&E[9]?v?v.p(E,b):(v=zn(E),v.c(),v.m(t,null)):v&&(v.d(1),v=null);const D={};!f&&b[0]&32&&(f=!0,D.searchResults=E[5],je(()=>f=!1)),!c&&b[0]&8192&&(c=!0,D.showFullText=E[13],je(()=>c=!1)),!m&&b[0]&16384&&(m=!0,D.useSearchResult=E[14],je(()=>m=!1)),!h&&b[0]&32768&&(h=!0,D.enableSearchResultSelection=E[15],je(()=>h=!1)),o.$set(D)},i(E){k||(F(o.$$.fragment,E),k=!0)},o(E){U(o.$$.fragment,E),k=!1},d(E){E&&(_(e),_(a),_(r)),g&&g.d(),v&&v.d(),ve(o)}}}function oi(l){let e,t,n,u,i,s,a;function r(h){l[35](h)}function o(h){l[36](h)}function f(h){l[37](h)}function c(h){l[38](h)}let m={};return l[5]!==void 0&&(m.searchResults=l[5]),l[13]!==void 0&&(m.showFullText=l[13]),l[14]!==void 0&&(m.useSearchResult=l[14]),l[15]!==void 0&&(m.enableSearchResultSelection=l[15]),t=new qn({props:m}),ze.push(()=>Ue(t,"searchResults",r)),ze.push(()=>Ue(t,"showFullText",o)),ze.push(()=>Ue(t,"useSearchResult",f)),ze.push(()=>Ue(t,"enableSearchResultSelection",c)),{c(){e=w("div"),ge(t.$$.fragment),this.h()},l(h){e=B(h,"DIV",{class:!0});var k=A(e);_e(t.$$.fragment,k),k.forEach(_),this.h()},h(){d(e,"class","search-column svelte-1cldj37")},m(h,k){N(h,e,k),be(t,e,null),a=!0},p(h,k){const g={};!n&&k[0]&32&&(n=!0,g.searchResults=h[5],je(()=>n=!1)),!u&&k[0]&8192&&(u=!0,g.showFullText=h[13],je(()=>u=!1)),!i&&k[0]&16384&&(i=!0,g.useSearchResult=h[14],je(()=>i=!1)),!s&&k[0]&32768&&(s=!0,g.enableSearchResultSelection=h[15],je(()=>s=!1)),t.$set(g)},i(h){a||(F(t.$$.fragment,h),a=!0)},o(h){U(t.$$.fragment,h),a=!1},d(h){h&&_(e),ve(t)}}}function yn(l){let e,t="Получить ответ",n,u;return{c(){e=w("button"),e.textContent=t,this.h()},l(i){e=B(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(e)!=="svelte-117yy5h"&&(e.textContent=t),this.h()},h(){d(e,"class","btn variant-filled")},m(i,s){N(i,e,s),n||(u=Y(e,"click",l[25]),n=!0)},p:ae,d(i){i&&_(e),n=!1,u()}}}function Cn(l){let e,t,n="Оцените ответ:",u,i,s="👍",a,r,o="👎",f,c,m,h;return{c(){e=w("div"),t=w("span"),t.textContent=n,u=Q(),i=w("button"),i.textContent=s,a=Q(),r=w("button"),r.textContent=o,f=Q(),c=w("textarea"),this.h()},l(k){e=B(k,"DIV",{});var g=A(e);t=B(g,"SPAN",{"data-svelte-h":!0}),Ce(t)!=="svelte-9pssby"&&(t.textContent=n),u=Z(g),i=B(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(i)!=="svelte-1hnmipt"&&(i.textContent=s),a=Z(g),r=B(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(r)!=="svelte-12wf95"&&(r.textContent=o),f=Z(g),c=B(g,"TEXTAREA",{rows:!0,placeholder:!0,class:!0}),A(c).forEach(_),g.forEach(_),this.h()},h(){d(i,"class","btn-icon"),d(r,"class","btn-icon"),d(c,"rows","3"),d(c,"placeholder","Комментарий"),d(c,"class","svelte-1cldj37")},m(k,g){N(k,e,g),T(e,t),T(e,u),T(e,i),T(e,a),T(e,r),T(e,f),T(e,c),it(c,l[16]),m||(h=[Y(i,"click",l[26]),Y(r,"click",l[27]),Y(c,"input",l[39]),Y(c,"input",l[21])],m=!0)},p(k,g){g[0]&65536&&it(c,k[16])},d(k){k&&_(e),m=!1,$e(h)}}}function ci(l){let e,t,n,u,i,s,a=l[15]&&yn(l),r=!l[7]&&l[9]&&Cn(l);return{c(){e=w("div"),t=w("div"),a&&a.c(),n=Q(),u=w("div"),i=new ot(!1),s=Q(),r&&r.c(),this.h()},l(o){e=B(o,"DIV",{class:!0});var f=A(e);t=B(f,"DIV",{class:!0});var c=A(t);a&&a.l(c),n=Z(c),u=B(c,"DIV",{class:!0});var m=A(u);i=ct(m,!1),m.forEach(_),s=Z(c),r&&r.l(c),c.forEach(_),f.forEach(_),this.h()},h(){i.a=null,d(u,"class","textarea svelte-1cldj37"),d(t,"class","textarea svelte-1cldj37"),d(e,"class","textarea-column svelte-1cldj37")},m(o,f){N(o,e,f),T(e,t),a&&a.m(t,null),T(t,n),T(t,u),i.m(l[9],u),T(t,s),r&&r.m(t,null)},p(o,f){o[15]?a?a.p(o,f):(a=yn(o),a.c(),a.m(t,n)):a&&(a.d(1),a=null),f[0]&512&&i.p(o[9]),!o[7]&&o[9]?r?r.p(o,f):(r=Cn(o),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(o){o&&_(e),a&&a.d(),r&&r.d()}}}function fi(l){let e,t,n,u;return e=new Nt({props:{minSize:20,class:"search-column",size:49,$$slots:{default:[oi]},$$scope:{ctx:l}}}),n=new Nt({props:{size:l[10],$$slots:{default:[ci]},$$scope:{ctx:l}}}),{c(){ge(e.$$.fragment),t=Q(),ge(n.$$.fragment)},l(i){_e(e.$$.fragment,i),t=Z(i),_e(n.$$.fragment,i)},m(i,s){be(e,i,s),N(i,t,s),be(n,i,s),u=!0},p(i,s){const a={};s[0]&57376|s[1]&262144&&(a.$$scope={dirty:s,ctx:i}),e.$set(a);const r={};s[0]&1024&&(r.size=i[10]),s[0]&98944|s[1]&262144&&(r.$$scope={dirty:s,ctx:i}),n.$set(r)},i(i){u||(F(e.$$.fragment,i),F(n.$$.fragment,i),u=!0)},o(i){U(e.$$.fragment,i),U(n.$$.fragment,i),u=!1},d(i){i&&_(t),ve(e,i),ve(n,i)}}}function Dn(l){let e,t="Получить ответ",n,u;return{c(){e=w("button"),e.textContent=t,this.h()},l(i){e=B(i,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(e)!=="svelte-3pb36x"&&(e.textContent=t),this.h()},h(){d(e,"class","btn variant-filled")},m(i,s){N(i,e,s),n||(u=Y(e,"click",l[25]),n=!0)},p:ae,d(i){i&&_(e),n=!1,u()}}}function zn(l){let e,t,n="Оцените ответ:",u,i,s="👍",a,r,o="👎",f,c,m,h;return{c(){e=w("div"),t=w("span"),t.textContent=n,u=Q(),i=w("button"),i.textContent=s,a=Q(),r=w("button"),r.textContent=o,f=Q(),c=w("textarea"),this.h()},l(k){e=B(k,"DIV",{});var g=A(e);t=B(g,"SPAN",{"data-svelte-h":!0}),Ce(t)!=="svelte-9pssby"&&(t.textContent=n),u=Z(g),i=B(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(i)!=="svelte-1hnmipt"&&(i.textContent=s),a=Z(g),r=B(g,"BUTTON",{class:!0,"data-svelte-h":!0}),Ce(r)!=="svelte-12wf95"&&(r.textContent=o),f=Z(g),c=B(g,"TEXTAREA",{rows:!0,placeholder:!0,class:!0}),A(c).forEach(_),g.forEach(_),this.h()},h(){d(i,"class","btn-icon"),d(r,"class","btn-icon"),d(c,"rows","3"),d(c,"placeholder","Комментарий"),d(c,"class","svelte-1cldj37")},m(k,g){N(k,e,g),T(e,t),T(e,u),T(e,i),T(e,a),T(e,r),T(e,f),T(e,c),it(c,l[16]),m||(h=[Y(i,"click",l[26]),Y(r,"click",l[27]),Y(c,"input",l[30]),Y(c,"input",l[21])],m=!0)},p(k,g){g[0]&65536&&it(c,k[16])},d(k){k&&_(e),m=!1,$e(h)}}}function di(l){let e,t,n,u,i,s,a,r,o,f,c,m=l[1],h,k=l[2],g,v,C,y,p,R,M,E,b="Отправить",D,z,$,I,ne,ue,te;n=new ju({});let H=_n(l),le=bn(l);function Re(X){l[29](X)}let De={name:"slider-label",size:"sm",$$slots:{default:[si]},$$scope:{ctx:l}};l[15]!==void 0&&(De.checked=l[15]),C=new Un({props:De}),ze.push(()=>Ue(C,"checked",Re));let L=l[11]&&vn(l),se=l[7]&&kn(l),V=(l[6]||l[7])&&pn(l),P=l[3]&&En(l),oe=l[8]&&Sn(l);return{c(){e=w("meta"),t=Q(),ge(n.$$.fragment),u=Q(),i=w("section"),s=w("div"),a=w("div"),r=w("textarea"),o=Q(),f=w("div"),c=w("div"),H.c(),h=Q(),le.c(),g=Q(),v=w("div"),ge(C.$$.fragment),p=Q(),L&&L.c(),R=Q(),se&&se.c(),M=Q(),E=w("button"),E.textContent=b,D=Q(),z=w("div"),V&&V.c(),$=Q(),P&&P.c(),I=Q(),oe&&oe.c(),this.h()},l(X){const ie=ll("svelte-1wpbm1r",document.head);e=B(ie,"META",{name:!0,content:!0}),ie.forEach(_),t=Z(X),_e(n.$$.fragment,X),u=Z(X),i=B(X,"SECTION",{});var j=A(i);s=B(j,"DIV",{class:!0});var we=A(s);a=B(we,"DIV",{class:!0});var ft=A(a);r=B(ft,"TEXTAREA",{class:!0,rows:!0,placeholder:!0}),A(r).forEach(_),ft.forEach(_),o=Z(we),f=B(we,"DIV",{class:!0});var Oe=A(f);c=B(Oe,"DIV",{class:!0});var qe=A(c);H.l(qe),h=Z(qe),le.l(qe),qe.forEach(_),g=Z(Oe),v=B(Oe,"DIV",{class:!0});var Me=A(v);_e(C.$$.fragment,Me),p=Z(Me),L&&L.l(Me),R=Z(Me),se&&se.l(Me),M=Z(Me),E=B(Me,"BUTTON",{title:!0,class:!0,"data-svelte-h":!0}),Ce(E)!=="svelte-w5ppob"&&(E.textContent=b),Me.forEach(_),D=Z(Oe),z=B(Oe,"DIV",{class:!0});var at=A(z);V&&V.l(at),at.forEach(_),Oe.forEach(_),$=Z(we),P&&P.l(we),we.forEach(_),I=Z(j),oe&&oe.l(j),j.forEach(_),this.h()},h(){document.title="LLM demo app",d(e,"name","description"),d(e,"content","LLM demo app"),d(r,"class","auto-expand-textarea svelte-1cldj37"),d(r,"rows","1"),d(r,"placeholder","Введите ваш запрос..."),d(a,"class","grow-wrap w-full svelte-1cldj37"),d(c,"class","status-components svelte-1cldj37"),d(E,"title","Ctrl+Enter"),d(E,"class","btn variant-filled"),d(v,"class","flex space-x-2 items-center"),d(z,"class","flex space-x-2 items-center w-full"),d(f,"class","search-second-bar w-full flex svelte-1cldj37"),d(s,"class","search-bar flex flex-wrap svelte-1cldj37")},m(X,ie){T(document.head,e),N(X,t,ie),be(n,X,ie),N(X,u,ie),N(X,i,ie),T(i,s),T(s,a),T(a,r),it(r,l[11]),T(s,o),T(s,f),T(f,c),H.m(c,null),T(c,h),le.m(c,null),T(f,g),T(f,v),be(C,v,null),T(v,p),L&&L.m(v,null),T(v,R),se&&se.m(v,null),T(v,M),T(v,E),T(f,D),T(f,z),V&&V.m(z,null),T(s,$),P&&P.m(s,null),T(i,I),oe&&oe.m(i,null),ne=!0,ue||(te=[Y(r,"input",l[28]),Y(r,"input",l[20]),Y(r,"keydown",l[22]),Y(E,"click",l[23])],ue=!0)},p(X,ie){ie[0]&2048&&it(r,X[11]),ie[0]&2&&ye(m,m=X[1])?(Ee(),U(H,1,1,ae),Se(),H=_n(X),H.c(),F(H,1),H.m(c,h)):H.p(X,ie),ie[0]&4&&ye(k,k=X[2])?(Ee(),U(le,1,1,ae),Se(),le=bn(X),le.c(),F(le,1),le.m(c,null)):le.p(X,ie);const j={};ie[1]&262144&&(j.$$scope={dirty:ie,ctx:X}),!y&&ie[0]&32768&&(y=!0,j.checked=X[15],je(()=>y=!1)),C.$set(j),X[11]?L?L.p(X,ie):(L=vn(X),L.c(),L.m(v,R)):L&&(L.d(1),L=null),X[7]?se?se.p(X,ie):(se=kn(X),se.c(),se.m(v,M)):se&&(se.d(1),se=null),X[6]||X[7]?V?(V.p(X,ie),ie[0]&192&&F(V,1)):(V=pn(X),V.c(),F(V,1),V.m(z,null)):V&&(Ee(),U(V,1,1,()=>{V=null}),Se()),X[3]?P?(P.p(X,ie),ie[0]&8&&F(P,1)):(P=En(X),P.c(),F(P,1),P.m(s,null)):P&&(Ee(),U(P,1,1,()=>{P=null}),Se()),X[8]?oe?(oe.p(X,ie),ie[0]&256&&F(oe,1)):(oe=Sn(X),oe.c(),F(oe,1),oe.m(i,null)):oe&&(Ee(),U(oe,1,1,()=>{oe=null}),Se())},i(X){ne||(F(n.$$.fragment,X),F(H),F(le),F(C.$$.fragment,X),F(V),F(P),F(oe),ne=!0)},o(X){U(n.$$.fragment,X),U(H),U(le),U(C.$$.fragment,X),U(V),U(P),U(oe),ne=!1},d(X){X&&(_(t),_(u),_(i)),_(e),ve(n,X),H.d(X),le.d(X),ve(C),L&&L.d(),se&&se.d(),V&&V.d(),P&&P.d(),oe&&oe.d(),ue=!1,$e(te)}}}function Tn(l){return l.map(({title:e,text:t})=>`${e}
${t}`).join(`
`)}function hi(l,e,t){Yl();let n=!1;const u={message:"Спасибо за оценку!",timeout:5e3},i=Nn();bt(()=>{t(0,n=window.innerWidth<=768)});let s="unknown",a="unknown",r=!1,o=`Ты бухгалтер. Ты отвечаешь на русском языке. Ты всегда следуешь моим инструкциям.
Ты отвечаешь на вопросы клиентов. Чтобы ответить, ты обязательно используешь только "источники", которые я тебе предоставляю. Ты используешь только официально-деловой стиль и необходимую терминологию. Соблюдай этические нормы.
При ответе на вопрос ты используешь только такой формат ответа:
1) Четкий и краткий ответ на поставленный вопрос. Ты можешь начать свой ответ так: "По Вашему вопросу сообщаем...". Используй по возможности слова: да, можно, нет, нельзя.
2) Обоснование (ты используешь для обоснования "источники". Ты используешь только "источники" для поиска необходимых "законов", "статей", "пунктов" и "подпунктов" для ответа на вопрос пользователя).
3) Аргументация (Ты используешь только "источники" для поиска необходимых "писем" и "судебных решений", чтобы аргументировать свой ответ)."
4) Заключение (ты подводишь итоги всего, что сказал выше. Избегай повторения и сложных конструкций). Если в источниках нельзя найти подходящую информацию для ответа, ты отвечаешь так: "Мы не можем ответить на данный вопрос. Обратитесь к специалисту."
Вопрос: {{ВОПРОС}}
Источники: {{ИСТОЧНИКИ}}`;function f(G){t(4,o=G)}function c(){t(3,r=!1)}async function m(){try{const G=await fetch(`${window.location.origin}/llm/health`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!G.ok)throw new Error(`Failed to fetch Llama health status: ${G.statusText}`);const he=await G.json();t(1,s=he.status)}catch(G){console.error("Error fetching Llama health status:",G.message)}try{const G=await fetch(`${window.location.origin}/search/health`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!G.ok)throw new Error(`Failed to fetch search health status: ${G.statusText}`);const he=await G.json();t(2,a=he.status)}catch(G){console.error("Error fetching search health status:",G.message)}}bt(async()=>{m()}),Tt(()=>{le()});let h=[],k=!1,g=!1,v=!1,C="",y=0,p="",R="",M=Array(h.length).fill(!1),E,b=!1,D="";const z=async G=>{t(9,C=""),t(6,k=!1),t(7,g=!1),t(8,v=!1),t(5,h=[]),t(11,p=""),le()},$=G=>{t(11,p=G.target.value);const he=G.target.parentNode;he&&(he.dataset.replicatedValue=p)},I=G=>{t(16,D=G.target.value);const he=G.target.parentNode;he&&(he.dataset.replicatedValue=p)},ne=G=>{G.ctrlKey&&G.key==="Enter"&&(G.preventDefault(),H())},ue=async()=>{t(10,y=49);let G="";if(b)G=Tn(h.filter((Qe,nt)=>E[Qe.title]));else{const Qe=h.slice(0,10);G=Tn(Qe)}let he=o.replace("{{ВОПРОС}}",p).replace("{{ИСТОЧНИКИ}}",G);t(7,g=!0),h?t(12,R="Генерируем ответ на основе результатов поиска"):t(12,R="Генерируем ответ");const rt=await fetch("/llm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userprompt:he}),signal:te.signal});try{if(te.signal.aborted){console.log("Request was cancelled.");return}if(!rt.body){console.log("Response has no body");return}const Qe=rt.body.pipeThrough(new TextDecoderStream).getReader();let nt=!0;for(;nt;)try{if(te.signal.aborted){console.log("Request was cancelled during reading.");break}const{value:lt,done:ht}=await Qe.read();if(ht){nt=!1;break}lt&&t(9,C+=lt.replaceAll(`
`,"<br>"))}catch(lt){if(t(12,R="Ошибка генерации ответа"),lt.name==="AbortError"){nt=!1,console.log("Fetch was aborted during reading.");break}else{nt=!1,console.error("Error during reading:",lt);break}}t(12,R=""),t(7,g=!1)}catch(Qe){Qe.name==="AbortError"?console.log("Fetch was aborted."):console.error("Error during fetch:",Qe)}};let te=new AbortController;const H=async G=>{t(13,M=Array(10).fill(!1)),t(14,E={}),t(9,C=""),t(6,k=!0),t(7,g=!1),t(8,v=!0),t(12,R="Ищем релевантные документы");try{const he=await fetch("/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:p})});if(!he.ok)throw new Error(`Failed to fetch search results: ${he.statusText}`);const rt=await he.json();t(5,h=Ve.sortByRelevance(rt.results)),t(5,h=Ve.identifyDocumentType(h)),console.log(h)}catch{}t(12,R=""),t(6,k=!1),b?t(10,y=49):await ue()},le=()=>{te.abort("user canceled"),te=new AbortController};async function Re(){t(9,C=""),await le(),setTimeout(async()=>{await ue()},1e3)}async function De(){await se({userScore:"positive"}),i.trigger(u),t(16,D="")}async function L(){await se({userScore:"negative"}),i.trigger(u),t(16,D="")}async function se(G){try{const he=await fetch("/log/response",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_query:p,prompt_template:o,search_results:h,llm_response:C.replaceAll("<br>",`
`),user_score:G.userScore,user_comment:D})});if(!he.ok)throw new Error(`Failed to fetch search results: ${he.statusText}`);if((await he.json()).success)return!0}catch{}return!1}function V(){p=this.value,t(11,p)}function P(G){b=G,t(15,b)}function oe(){D=this.value,t(16,D)}function X(G){h=G,t(5,h)}function ie(G){M=G,t(13,M)}function j(G){E=G,t(14,E)}function we(G){b=G,t(15,b)}function ft(G){h=G,t(5,h)}function Oe(G){M=G,t(13,M)}function qe(G){E=G,t(14,E)}function Me(G){b=G,t(15,b)}function at(){D=this.value,t(16,D)}return[n,s,a,r,o,h,k,g,v,C,y,p,R,M,E,b,D,f,c,z,$,I,ne,H,le,Re,De,L,V,P,oe,X,ie,j,we,ft,Oe,qe,Me,at]}class vi extends Te{constructor(e){super(),Pe(this,e,hi,di,ye,{},null,[-1,-1])}}export{vi as component,bi as universal};