import{ab as u,V as y,a0 as n,ad as i,aG as l,aH as d,aI as q,aJ as h,aK as f}from"./index-Dbk1Plmn.js";import{c as v,a as K,d as Q,r as m}from"./relationships-D_VYvxI6.js";const S=250,_=400;function F(e){const t={};return(e==null?void 0:e.limit)!=null&&(t.limit=e.limit),(e==null?void 0:e.offset)!=null&&(t.offset=e.offset),e!=null&&e.keyword&&(t.keyword=e.keyword),e!=null&&e.entity_type&&(t.entity_type=e.entity_type),y("/schemas",t)}async function I(e){const t=S;let a=0;const r=[];let o=0;for(let c=0;c<_;c++){const s=await F({limit:t,offset:a});if(o=s.total,r.push(...s.schemas),s.schemas.length===0||r.length>=o||s.schemas.length<t)break;a+=t}return{schemas:r,total:o}}function b(e){return y(`/schemas/${encodeURIComponent(e)}`)}function E(e){return u("/register_schema",e)}function R(e){return u("/update_schema_incremental",e)}function M(e){return u("/analyze_schema_candidates",e??{})}function g(e,t,a){return u("/get_schema_recommendations",{entity_type:e})}function k(){const e=n();return i({mutationFn:t=>l(t.from,t.to,t.reason),onSuccess:()=>{e.invalidateQueries({queryKey:["entities"]}),e.invalidateQueries({queryKey:["entity"]}),e.invalidateQueries({queryKey:["stats"]})}})}function T(){const e=n();return i({mutationFn:t=>d(t.id,t.type,t.reason),onSuccess:()=>{e.invalidateQueries({queryKey:["entities"]}),e.invalidateQueries({queryKey:["entity"]}),e.invalidateQueries({queryKey:["stats"]})}})}function w(){const e=n();return i({mutationFn:t=>q(t.id,t.type,t.reason),onSuccess:()=>{e.invalidateQueries({queryKey:["entities"]}),e.invalidateQueries({queryKey:["entity"]}),e.invalidateQueries({queryKey:["stats"]})}})}function A(){const e=n();return i({mutationFn:t=>v(t),onSuccess:()=>{e.invalidateQueries({queryKey:["observations"]}),e.invalidateQueries({queryKey:["entity-observations"]}),e.invalidateQueries({queryKey:["stats"]})}})}function H(){const e=n();return i({mutationFn:t=>h(t),onSuccess:()=>{e.invalidateQueries({queryKey:["sources"]}),e.invalidateQueries({queryKey:["entities"]}),e.invalidateQueries({queryKey:["stats"]})}})}function U(){const e=n();return i({mutationFn:t=>f(t),onSuccess:()=>{e.invalidateQueries({queryKey:["sources"]}),e.invalidateQueries({queryKey:["stats"]})}})}function L(){const e=n();return i({mutationFn:t=>K(t),onSuccess:()=>{e.invalidateQueries({queryKey:["relationships"]}),e.invalidateQueries({queryKey:["entity-relationships"]}),e.invalidateQueries({queryKey:["stats"]})}})}function z(){const e=n();return i({mutationFn:t=>Q(t.type,t.source,t.target,t.reason),onSuccess:()=>{e.invalidateQueries({queryKey:["relationships"]}),e.invalidateQueries({queryKey:["entity-relationships"]}),e.invalidateQueries({queryKey:["stats"]})}})}function D(){const e=n();return i({mutationFn:t=>m(t.type,t.source,t.target,t.reason),onSuccess:()=>{e.invalidateQueries({queryKey:["relationships"]}),e.invalidateQueries({queryKey:["entity-relationships"]})}})}function G(){const e=n();return i({mutationFn:t=>E(t),onSuccess:()=>e.invalidateQueries({queryKey:["schemas"]})})}function O(){const e=n();return i({mutationFn:t=>R(t),onSuccess:()=>{e.invalidateQueries({queryKey:["schemas"]}),e.invalidateQueries({queryKey:["schema"]})}})}export{w as a,k as b,A as c,H as d,U as e,L as f,z as g,D as h,G as i,O as j,b as k,I as l,M as m,g as n,T as u};
