import{S as j,i as k,s as D,E as I,k as p,a as J,l as v,m as E,c as z,h as f,H as m,I as C,b as G,J as w,K as h,O as K,a1 as L,P as Q,D as N,F as X,Q as S,ac as F,T as H,an as Y,af as B}from"./index.f491bb8d.js";import{ah as b,ai as _,aj as P}from"./HoverTooltip.b4b82cd7.js";import{w as M}from"./index.469944cd.js";function O(s){let e;return{c(){e=p("span"),this.h()},l(a){e=v(a,"SPAN",{}),E(e).forEach(f),this.h()},h(){m(e,"bx--label",!0),m(e,"bx--skeleton",!0)},m(a,i){G(a,e,i)},d(a){a&&f(e)}}}function R(s){let e,a,i,o,l,d,n=!s[0]&&O(),c=[s[1]],u={};for(let t=0;t<c.length;t+=1)u=I(u,c[t]);return{c(){e=p("div"),n&&n.c(),a=J(),i=p("div"),o=p("div"),this.h()},l(t){e=v(t,"DIV",{});var r=E(e);n&&n.l(r),a=z(r),i=v(r,"DIV",{});var g=E(i);o=v(g,"DIV",{}),E(o).forEach(f),g.forEach(f),r.forEach(f),this.h()},h(){m(o,"bx--select-input",!0),m(i,"bx--select",!0),m(i,"bx--skeleton",!0),C(e,u),m(e,"bx--form-item",!0)},m(t,r){G(t,e,r),n&&n.m(e,null),w(e,a),w(e,i),w(i,o),l||(d=[h(e,"click",s[2]),h(e,"mouseover",s[3]),h(e,"mouseenter",s[4]),h(e,"mouseleave",s[5])],l=!0)},p(t,[r]){t[0]?n&&(n.d(1),n=null):n||(n=O(),n.c(),n.m(e,a)),C(e,u=K(c,[r&2&&t[1]])),m(e,"bx--form-item",!0)},i:L,o:L,d(t){t&&f(e),n&&n.d(),l=!1,Q(d)}}}function U(s,e,a){const i=["hideLabel"];let o=N(e,i),{hideLabel:l=!1}=e;function d(t){S.call(this,s,t)}function n(t){S.call(this,s,t)}function c(t){S.call(this,s,t)}function u(t){S.call(this,s,t)}return s.$$set=t=>{e=I(I({},e),X(t)),a(1,o=N(e,i)),"hideLabel"in t&&a(0,l=t.hideLabel)},[l,o,d,n,c,u]}class W extends j{constructor(e){super(),k(this,e,U,R,D,{hideLabel:0})}}const ae=W;class q{static getSignals(){return b(_,{method:"GET",url:"/api/v1/signals/"})}static getEmbeddings(){return b(_,{method:"GET",url:"/api/v1/signals/embeddings"})}static compute(e){return b(_,{method:"POST",url:"/api/v1/signals/compute",body:e,mediaType:"application/json",errors:{422:"Validation Error"}})}static schema(e){return b(_,{method:"POST",url:"/api/v1/signals/schema",body:e,mediaType:"application/json",errors:{422:"Validation Error"}})}}const A="signals",ne=P(q.getSignals,A),ie=P(q.getEmbeddings,A),x={};function V(s){return s==="local"?localStorage:sessionStorage}function Z(s,e,a){const i=(a==null?void 0:a.serializer)??JSON,o=(a==null?void 0:a.storage)??"local",l=typeof window<"u"&&typeof document<"u";function d(n,c){l&&V(o).setItem(n,i.stringify(c))}if(!x[s]){const n=M(e,t=>{const r=l?V(o).getItem(s):null;if(r&&t(i.parse(r)),l){const g=T=>{T.key===s&&t(T.newValue?i.parse(T.newValue):null)};return window.addEventListener("storage",g),()=>window.removeEventListener("storage",g)}}),{subscribe:c,set:u}=n;x[s]={set(t){d(s,t),u(t)},update(t){const r=t(F(n));d(s,r),u(r)},subscribe:c}}return x[s]}const y="SETTINGS_CONTEXT",$="settingsStore";function re(){const s={},{subscribe:e,set:a,update:i}=Z($,s,{storage:"session"});return{subscribe:e,set:a,update:i,reset(){a(JSON.parse(JSON.stringify(s)))},setEmbedding(o){i(l=>(l.embedding=o,l))}}}function oe(s){H(y,s)}function le(){if(!Y(y))throw new Error("SettingsContext not found");return B(y)}export{ae as S,ne as a,re as c,le as g,ie as q,oe as s};
