@plitzi/plitzi-sdk 0.35.3 → 0.35.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{n as e,r as t,t as n}from"./rolldown-runtime-CxhCXM28.js";import{$ as r,A as i,B as a,C as o,D as s,E as l,F as c,G as u,H as d,I as p,J as h,K as f,L as m,M as g,N as y,O as b,P as v,Q as x,R as k,S as w,T as S,U as N,V as T,W as C,X as E,Y as I,Z as O,_ as z,a as A,b as _,c as D,d as P,f as M,g as R,h as L,i as j,j as F,k as $,l as V,m as q,n as B,o as U,p as H,q as W,r as G,s as J,t as K,u as Q,v as Y,w as X,x as Z,y as ee,z as te}from"./withElement-Nj-YY2Rh.js";import*as ne from"react";import re,{Children as ie,Fragment as ae,cloneElement as oe,createContext as se,createElement as le,forwardRef as ce,isValidElement as ue,memo as de,use as pe,useCallback as he,useContext as fe,useEffect as me,useId as ge,useImperativeHandle as ye,useLayoutEffect as be,useMemo as ve,useReducer as xe,useRef as ke,useState as we,useSyncExternalStore as Se}from"react";import{createRoot as Ne,hydrateRoot as Te}from"react-dom/client";import{Fragment as Ce,jsx as Ee,jsxs as Ie}from"react/jsx-runtime";import{createPortal as Oe}from"react-dom";import{c as ze}from"react/compiler-runtime";var Ae=Object.defineProperty,_e=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t||Ae(n,Symbol.toStringTag,{value:"Module"}),n},De={previewMode:!0,debugMode:!1,renderMode:"raw",environment:"main",isHydrating:!1,hydrated:!1,overQuota:!1,testAttributes:!0},Pe=()=>{let[[e,t,n,r,i,a,o,s]]=c(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota","render.testAttributes"]);return ve(()=>({previewMode:e??De.previewMode,debugMode:t??De.debugMode,renderMode:n??De.renderMode,environment:r??De.environment,isHydrating:i??De.isHydrating,hydrated:a??De.hydrated,overQuota:o??De.overQuota,testAttributes:s??De.testAttributes}),[e,t,n,r,i,a,o,s])},Me=(e,t)=>"string"!=typeof e||e===t||e.length>t.length&&e.startsWith(t)&&"."===e[t.length]||t.length>e.length&&t.startsWith(e)&&"."===t[e.length],Re=(e,t,n=12)=>{if(!Object.is(e,t)){if(n<=0||!E(e)||!E(t))return{path:"",value:t};for(let r of/* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])){if(Object.is(e[r],t[r]))continue;let i=Re(e[r],t[r],n-1);if(i)return{path:i.path?`${r}.${i.path}`:r,value:i.value}}}},Le=/* @__PURE__ */new WeakMap,je=e=>{let t=e?.enabled;return n=>{if(O(t,n.getState()))return;let{handle:r,record:i}=function(e,t={}){let n=t.limit??100,r=t.path,i=t.shouldRecord,a=[{state:e.getState(),timestamp:Date.now()}],o=0,s=!1,l=()=>({entries:a,index:o,canUndo:o>0,canRedo:o<a.length-1}),c=l(),u=/* @__PURE__ */new Set,d=()=>{c=l(),u.forEach(e=>e())},p=t=>{if(t<0||t>=a.length||t===o)return;let n=a[t].state;if(s=!0,r){let t=I(n,r);e.setState(r,()=>t)}else e.setState(void 0,()=>n);s=!1,o=t,d()};return{handle:{getSnapshot:()=>c,subscribe:e=>(u.add(e),()=>u.delete(e)),undo:()=>p(o-1),redo:()=>p(o+1),travelTo:p,clear:()=>{a=[{state:e.getState(),timestamp:Date.now()}],o=0,d()}},record:({path:t})=>{if(s||i&&!i(t)||r&&void 0!==t&&!Me(t,r))return;let l,c=o<a.length-1?a.slice(0,o+1):a,u=c[c.length-1].state,p=e.getState(),h=t??r,f=t??r;if(f)try{let e=Re(I(u,f),I(p,f));e&&(h=e.path?`${f}.${e.path}`:f,l=e.value)}catch{}let m=[...c,{path:h,value:l,state:p,timestamp:Date.now()}];a=m.length>n?m.slice(m.length-n):m,o=a.length-1,d()}}}(n,e);return Le.set(n,r),{onChange:i}}},Fe=e=>{},$e=e=>{},Ve=(e={})=>{let{filter:t,sink:n=Fe,errorSink:r=$e,enabled:i}="function"==typeof e?{sink:e}:e;return e=>{if(!O(i,e.getState()))return{onChange:e=>{(!t||t(e))&&n(e)},onError:r}}},qe=(e="local")=>{if("string"!=typeof e)return e;try{return"session"===e?globalThis.sessionStorage:globalThis.localStorage}catch{return}},Be=Symbol("@plitzi/nexus/ssr-snapshot");function Ue(e){return"object"==typeof e&&!!e&&Be in e}var He,We=/* @__PURE__ */new Map,Ge=/* @__PURE__ */new Set,Je=0,Ke=()=>{He=void 0;for(let e of Ge)e()},Qe=(e,t,n)=>{let r=e;return We.set(r,{uid:"dev-store-"+ ++Je,store:r,scopeId:t,name:n}),Ke(),()=>{We.delete(r),Ke()}},Ye=e=>(Ge.add(e),()=>{Ge.delete(e)}),Xe=()=>(He??=[...We.values()],He),Ze=f({runs:[]},{id:"action-runs"}),et=0,tt=e=>Ze.setState("runs",e),nt=/* @__PURE__ */new Map,rt=(e,t)=>{let{runs:n}=Ze.getState();n.some(t=>t.id===e)&&tt(n.map(n=>n.id===e?{...n,...t}:n))},it=()=>{let e=new Set(Ze.getState().runs.filter(e=>e.cancellable).map(e=>e.id));[...nt.keys()].forEach(t=>{e.has(t)||nt.delete(t)}),tt([])},at=se(void 0);at.displayName="DevStoreScopeContext";var ot=f,st=se(void 0),lt=e=>!0===e.cascade,ct=({store:e,id:t,segment:n,isolate:r,path:i,value:o,inherit:s,autoSync:l=!0,middlewares:c,name:d,children:p})=>{let h=fe(u),f=fe(st),m=fe(N),g=fe(at),y=h?.scopePath??"",b=ve(()=>void 0===n?y:y?`${y}/${n}`:n,[y,n]),v=ke(void 0),x="live"===s,k=ve(()=>{let e="snapshot"===s&&h?h.getState():{},t="function"==typeof o?o(e):{...e,...o};return Ue(t)?function(e){return Ue(e)?{...e}:e}(t):t},[s,h,o]),w=c??[],S=f?[...f,...w]:w,T=ve(()=>{let e=w.filter(lt);return 0===e.length?f:[...f??[],...e]},[f,c]);v.current||=e??ot(()=>k,{id:t,scopePath:b,exclusive:x?r:void 0,parent:x?h:void 0,middlewares:S.length>0?S:void 0,deferHydrate:!0});let E=ve(()=>t?{id:t,store:v.current,parent:m}:m,[t,m]),I=ke(!1);me(()=>{W&&t&&!I.current&&C(m,t)&&(I.current=!0)},[t,m]),me(()=>(x&&!e&&v.current?.reconnect?.(),()=>{x&&!e&&v.current?.destroy?.()}),[x,e]),me(()=>{if(W||void 0!==g)return Qe(v.current,g,d)},[g,d]);let O=ke(!1);me(()=>{!O.current&&v.current?.hydrate&&(v.current.hydrate(),O.current=!0)},[]),a(i,i?o:k,{enabled:!!o&&l,store:v.current});let z=/* @__PURE__ */Ee(u,{value:v.current,children:p});return E!==m&&(z=/* @__PURE__ */Ee(N,{value:E,children:z})),T!==f&&(z=/* @__PURE__ */Ee(st,{value:T,children:z})),z},ut={entries:[],index:-1,canUndo:!1,canRedo:!1},dt=()=>{},pt=()=>dt,ht=()=>ut,ft=/* @__PURE__ */new WeakSet;function mt(e,t){let n={},r=Array.isArray(t)?t:[t];for(let i of r){let t=s(e,i);void 0!==t&&l(n,i,t)}return n}function gt(e,t=0,n={}){let r,i,a,o,s,l=0,c=n.leading??!1,u=n.trailing??!0,d=n.maxWait,p=()=>Date.now();function h(t){if(!r)return a;l=t;let n=r,o=i;return r=void 0,i=void 0,a=e.apply(o,n),a}function f(e){o=setTimeout(g,e)}function m(e){if(void 0===s)return!0;let n=e-s;return n>=t||n<0||void 0!==d&&e-l>=d}function g(){let e=p();if(m(e))return b(e);f(function(e){let n=e-l,r=t-(e-(s??0));return void 0===d?r:Math.min(r,d-n)}(e))}function y(e){return l=e,f(t),c?h(e):a}function b(e){return o=void 0,u&&r?h(e):(r=i=void 0,a)}function v(...e){let n=p(),l=m(n);if(r=e,i=this,s=n,l){if(!o)return y(n);if(void 0!==d)return clearTimeout(o),f(t),h(n)}return o||f(t),a}return v.cancel=()=>{void 0!==o&&clearTimeout(o),l=0,r=s=i=o=void 0},v.flush=()=>void 0===o?a:b(p()),v.pending=()=>void 0!==o,v}function yt(e,t=0,n={}){return gt(e,t,{leading:n.leading??!0,trailing:n.trailing??!0,maxWait:t})}function bt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=bt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bt(e))&&(r&&(r+=" "),r+=t);return r}var xt=/* @__PURE__ */e({cva:()=>St,cx:()=>wt}),kt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,wt=vt,St=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return wt(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const o=kt(t)||kt(r);return i[e][o]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return wt(e,o,l,null==n?void 0:n.class,null==n?void 0:n.className)},{cva:Nt}=xt,Tt=/* @__PURE__ */new Set,Ct=e=>{for(let t of Tt)t(e)},Et=["missing","expired","revoked","inactive","unverified","malformed","outdated","network"],It=(e,t)=>{if(401!==e)return;let n=t?.reason;return"string"==typeof n&&Et.includes(n)?n:"expired"},Ot=e=>/([^.]+\.[^.]+)$/.exec(e)?.[1]??e;function zt(e){return At(e,[])}function At(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:At(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let a=0;a<n;++a)i.push(At(e[a],t));return 1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);return 0===n.length?"{}":t.length>2?"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+n.map(([e,n])=>e+": "+At(n,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function _t(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var Dt=/\r\n|[\n\r]/g;function Pt(e,t){let n=0,r=1;for(const i of e.body.matchAll(Dt)){if("number"!=typeof i.index&&_t(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Mt(e){return Rt(e.source,Pt(e.source,e.start))}function Rt(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=1===t.line?n:0,l=t.column+s,c=`${e.name}:${o}:${l}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){const e=Math.floor(l/80),t=l%80,n=[];for(let r=0;r<d.length;r+=80)n.push(d.slice(r,r+80));return c+Lt([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return c+Lt([[o-1+" |",u[i-1]],[`${o} |`,d],["|","^".padStart(l)],[`${o+1} |`,u[i+1]]])}function Lt(e){const t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}var jt=class e extends Error{constructor(t,n={}){const{nodes:r,source:i,positions:a,path:o,originalError:s,cause:l,extensions:c}=n,u="cause"in n;super(t,u||null!=s?{cause:u?l:s}:void 0),this.name="GraphQLError",this.path=o??void 0;const d=s??(l instanceof Error?l:void 0);this.originalError=d,this.nodes=Ft(Array.isArray(r)?r:r?[r]:void 0);const p=Ft(this.nodes?.map(e=>e.loc).filter(e=>null!=e));this.source=i??p?.[0]?.source,this.positions=a??p?.map(e=>e.start),this.locations=a&&i?a.map(e=>Pt(i,e)):p?.map(e=>Pt(e.source,e.start));const h=(f=d?.extensions,"object"==typeof f&&null!==f?d.extensions:void 0);var f;this.extensions=c??h??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s?.stack?Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+Mt(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Rt(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function Ft(e){return void 0===e||0===e.length?void 0:e}var $t=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Vt=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},qt={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Bt=new Set(Object.keys(qt));function Ut(e){const t=e?.kind;return"string"==typeof t&&Bt.has(t)}var Ht="query",Wt="mutation",Gt="subscription",Jt=/* @__PURE__ */e({ARGUMENT:()=>tn,ARGUMENT_COORDINATE:()=>Bn,BOOLEAN:()=>dn,DIRECTIVE:()=>yn,DIRECTIVE_ARGUMENT_COORDINATE:()=>Hn,DIRECTIVE_COORDINATE:()=>Un,DIRECTIVE_DEFINITION:()=>_n,DIRECTIVE_EXTENSION:()=>Pn,DOCUMENT:()=>Qt,ENUM:()=>hn,ENUM_TYPE_DEFINITION:()=>On,ENUM_TYPE_EXTENSION:()=>Fn,ENUM_VALUE_DEFINITION:()=>zn,FIELD:()=>en,FIELD_DEFINITION:()=>Tn,FLOAT:()=>cn,FRAGMENT_ARGUMENT:()=>nn,FRAGMENT_DEFINITION:()=>on,FRAGMENT_SPREAD:()=>rn,INLINE_FRAGMENT:()=>an,INPUT_OBJECT_TYPE_DEFINITION:()=>An,INPUT_OBJECT_TYPE_EXTENSION:()=>$n,INPUT_VALUE_DEFINITION:()=>Cn,INT:()=>ln,INTERFACE_TYPE_DEFINITION:()=>En,INTERFACE_TYPE_EXTENSION:()=>Ln,LIST:()=>fn,LIST_TYPE:()=>vn,MEMBER_COORDINATE:()=>qn,NAME:()=>Kt,NAMED_TYPE:()=>bn,NON_NULL_TYPE:()=>xn,NULL:()=>pn,OBJECT:()=>mn,OBJECT_FIELD:()=>gn,OBJECT_TYPE_DEFINITION:()=>Nn,OBJECT_TYPE_EXTENSION:()=>Rn,OPERATION_DEFINITION:()=>Yt,OPERATION_TYPE_DEFINITION:()=>wn,SCALAR_TYPE_DEFINITION:()=>Sn,SCALAR_TYPE_EXTENSION:()=>Mn,SCHEMA_DEFINITION:()=>kn,SCHEMA_EXTENSION:()=>Dn,SELECTION_SET:()=>Zt,STRING:()=>un,TYPE_COORDINATE:()=>Vn,UNION_TYPE_DEFINITION:()=>In,UNION_TYPE_EXTENSION:()=>jn,VARIABLE:()=>sn,VARIABLE_DEFINITION:()=>Xt}),Kt="Name",Qt="Document",Yt="OperationDefinition",Xt="VariableDefinition",Zt="SelectionSet",en="Field",tn="Argument",nn="FragmentArgument",rn="FragmentSpread",an="InlineFragment",on="FragmentDefinition",sn="Variable",ln="IntValue",cn="FloatValue",un="StringValue",dn="BooleanValue",pn="NullValue",hn="EnumValue",fn="ListValue",mn="ObjectValue",gn="ObjectField",yn="Directive",bn="NamedType",vn="ListType",xn="NonNullType",kn="SchemaDefinition",wn="OperationTypeDefinition",Sn="ScalarTypeDefinition",Nn="ObjectTypeDefinition",Tn="FieldDefinition",Cn="InputValueDefinition",En="InterfaceTypeDefinition",In="UnionTypeDefinition",On="EnumTypeDefinition",zn="EnumValueDefinition",An="InputObjectTypeDefinition",_n="DirectiveDefinition",Dn="SchemaExtension",Pn="DirectiveExtension",Mn="ScalarTypeExtension",Rn="ObjectTypeExtension",Ln="InterfaceTypeExtension",jn="UnionTypeExtension",Fn="EnumTypeExtension",$n="InputObjectTypeExtension",Vn="TypeCoordinate",qn="MemberCoordinate",Bn="ArgumentCoordinate",Un="DirectiveCoordinate",Hn="DirectiveArgumentCoordinate";function Wn(e,t){if(!e)throw new Error(t)}function Gn(e){return 9===e||32===e}function Jn(e){return e>=48&&e<=57}function Kn(e){return e>=97&&e<=122||e>=65&&e<=90}function Qn(e){return Kn(e)||95===e}function Yn(e){return Kn(e)||Jn(e)||95===e}function Xn(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i<e.length;++i){const a=e[i],o=Zn(a);o!==a.length&&(n??=i,r=i,0!==i&&o<t&&(t=o))}return e.map((e,n)=>0===n?e:e.slice(t)).slice(n??0,r+1)}function Zn(e){let t=0;for(;t<e.length&&Gn(e.charCodeAt(t));)++t;return t}var er=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function tr(e){return nr[e.charCodeAt(0)]}var nr=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],rr=Object.freeze({});function ir(e,t,n=qt){const r=/* @__PURE__ */new Map;for(const f of Object.values(Jt))r.set(f,ar(t,f));let i,a,o,s=Array.isArray(e),l=[e],c=-1,u=[],d=e;const p=[],h=[];do{c++;const e=c===l.length,f=e&&0!==u.length;if(e){if(a=0===h.length?void 0:p[p.length-1],d=o,o=h.pop(),f)if(s){d=d.slice();let e=0;for(const[t,n]of u){const r=t-e;null===n?(d.splice(r,1),e++):d[r]=n}}else{d={...d};for(const[e,t]of u)d[e]=t}c=i.index,l=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(null!=o){if(a=s?c:l[c],d=o[a],null==d)continue;p.push(a)}let m;if(!Array.isArray(d)){if(Ut(d)||Wn(!1,`Invalid AST Node: ${zt(d)}.`),m=(e?r.get(d.kind)?.leave:r.get(d.kind)?.enter)?.call(t,d,a,o,p,h),m===rr)break;if(!1===m){if(!e){p.pop();continue}}else if(void 0!==m&&(u.push([a,m]),!e)){if(!Ut(m)){p.pop();continue}d=m}}void 0===m&&f&&u.push([a,d]),e?p.pop():(i={inArray:s,index:c,keys:l,edits:u,prev:i},s=Array.isArray(d),l=s?d:n[d.kind]??[],c=-1,u=[],null!=o&&h.push(o),o=d)}while(void 0!==i);return 0!==u.length?u.at(-1)[1]:e}function ar(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}var or={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>sr(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=dr(e.variableDefinitions)?cr("(\n",sr(e.variableDefinitions,"\n"),"\n)"):cr("(",sr(e.variableDefinitions,", "),")"),n=cr("",e.description,"\n")+sr([e.operation,sr([e.name,t]),sr(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>cr("",i,"\n")+e+": "+t+cr(" = ",n)+cr(" ",sr(r," "))},SelectionSet:{leave:({selections:e})=>lr(e)},Field:{leave:({alias:e,name:t,arguments:n,directives:r,selectionSet:i})=>sr([pr(sr([cr("",e,": "),t],""),n),cr(" ",sr(r," ")),cr(" ",i)])},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>pr("..."+e,t)+cr(" ",sr(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>sr(["...",cr("on ",e),sr(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>cr("",a,"\n")+`fragment ${e}${cr("(",sr(n,", "),")")} on ${t} ${cr("",sr(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every(e=>0===e.length||Gn(e.charCodeAt(0))),a=t.endsWith('\\"""'),o=e.endsWith('"')&&!a,s=e.endsWith("\\"),l=o||s,c=!r||e.length>70||l||i||a;let u="";const d=r&&Gn(e.charCodeAt(0));return(c&&!d||i)&&(u+="\n"),u+=t,(c||l)&&(u+="\n"),'"""'+u+'"""'}(e):`"${e.replace(er,tr)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+sr(e,", ")+"]";return t.length>80?"[\n"+ur(sr(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+sr(e,", ")+" }";return t.length>80?lr(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+cr("(",sr(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>cr("",e,"\n")+sr(["schema",sr(t," "),lr(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>cr("",e,"\n")+sr(["scalar",t,sr(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>cr("",e,"\n")+sr(["type",t,cr("implements ",sr(n," & ")),sr(r," "),lr(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>cr("",e,"\n")+t+(dr(n)?cr("(\n",ur(sr(n,"\n")),"\n)"):cr("(",sr(n,", "),")"))+": "+r+cr(" ",sr(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>cr("",e,"\n")+sr([t+": "+n,cr("= ",r),sr(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>cr("",e,"\n")+sr(["interface",t,cr("implements ",sr(n," & ")),sr(r," "),lr(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>cr("",e,"\n")+sr(["union",t,sr(n," "),cr("= ",sr(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>cr("",e,"\n")+sr(["enum",t,sr(n," "),lr(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>cr("",e,"\n")+sr([t,sr(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>cr("",e,"\n")+sr(["input",t,sr(n," "),lr(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>cr("",e,"\n")+"directive @"+t+(dr(n)?cr("(\n",ur(sr(n,"\n")),"\n)"):cr("(",sr(n,", "),")"))+cr(" ",sr(r," "))+(i?" repeatable":"")+" on "+sr(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>sr(["extend schema",sr(e," "),lr(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>sr(["extend scalar",e,sr(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>sr(["extend type",e,cr("implements ",sr(t," & ")),sr(n," "),lr(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>sr(["extend interface",e,cr("implements ",sr(t," & ")),sr(n," "),lr(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>sr(["extend union",e,sr(t," "),cr("= ",sr(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>sr(["extend enum",e,sr(t," "),lr(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>sr(["extend input",e,sr(t," "),lr(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>sr(["extend directive @"+e,sr(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>sr([e,cr(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>sr([e,cr(".",t),cr("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>sr(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>sr(["@",e,cr("(",t,":)")])}};function sr(e,t=""){return e?.filter(e=>void 0!==e&&""!==e).join(t)??""}function lr(e){return cr("{\n",ur(sr(e,"\n")),"\n}")}function cr(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function ur(e){return cr(" ",e.replaceAll("\n","\n "))}function dr(e){return e?.some(e=>e.includes("\n"))??!1}function pr(e,t){let n=e+cr("(",sr(t,", "),")");return n.length>80&&(n=e+cr("(\n",ur(sr(t,"\n")),"\n)")),n}var hr={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};function fr(e,t,n){return new jt(`Syntax Error: ${n}`,{source:e,positions:[t]})}var mr=function(){let e;try{const t=globalThis.process;"function"==typeof t?.getBuiltinModule&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}(),gr=mr?.tracingChannel("graphql:parse"),yr=(mr?.tracingChannel("graphql:validate"),mr?.tracingChannel("graphql:execute"),mr?.tracingChannel("graphql:execute:variableCoercion"),mr?.tracingChannel("graphql:execute:rootSelectionSet"),mr?.tracingChannel("graphql:subscribe"),mr?.tracingChannel("graphql:resolve"),["start","end","asyncStart","asyncEnd","error"]),br="<SOF>",vr="<EOF>",xr="$",kr="(",wr=")",Sr="...",Nr=":",Tr="=",Cr="@",Er="[",Ir="]",Or="{",zr="|",Ar="}",_r="Name",Dr="Float",Pr="String",Mr="BlockString",Rr="Comment",Lr=class{constructor(e){const t=new Vt(br,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==vr)do{if(e.next)e=e.next;else{const t=Ur(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Rr);return e}};function jr(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Fr(e,t){return $r(e.charCodeAt(t))&&Vr(e.charCodeAt(t+1))}function $r(e){return e>=55296&&e<=56319}function Vr(e){return e>=56320&&e<=57343}function qr(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return vr;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Br(e,t,n,r,i){const a=e.line,o=1+n-e.lineStart;return new Vt(t,n,r,a,o,i)}function Ur(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Hr(e,i);case 33:return Br(e,"!",i,i+1);case 36:return Br(e,xr,i,i+1);case 38:return Br(e,"&",i,i+1);case 40:return Br(e,kr,i,i+1);case 41:return Br(e,wr,i,i+1);case 46:{const t=n.charCodeAt(i+1);if(46===t&&46===n.charCodeAt(i+2))return Br(e,Sr,i,i+3);if(46===t)throw fr(e.source,i,'Unexpected "..", did you mean "..."?');if(Jn(t)){const n=e.source.body.slice(i+1,Gr(e,i+1,t));throw fr(e.source,i,`Invalid number, expected digit before ".", did you mean "0.${n}"?`)}break}case 58:return Br(e,Nr,i,i+1);case 61:return Br(e,Tr,i,i+1);case 64:return Br(e,Cr,i,i+1);case 91:return Br(e,Er,i,i+1);case 93:return Br(e,Ir,i,i+1);case 123:return Br(e,Or,i,i+1);case 124:return Br(e,zr,i,i+1);case 125:return Br(e,Ar,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?ei(e,i):Jr(e,i)}if(Jn(t)||45===t)return Wr(e,i,t);if(Qn(t))return ti(e,i);throw fr(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":jr(t)||Fr(n,i)?`Unexpected character: ${qr(e,i)}.`:`Invalid character: ${qr(e,i)}.`)}return Br(e,vr,r,r)}function Hr(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(jr(e))++i;else{if(!Fr(n,i))break;i+=2}}return Br(e,Rr,t,i,n.slice(t+1,i))}function Wr(e,t,n){const r=e.source.body;let i=t,a=n,o=!1;if(45===a&&(a=r.charCodeAt(++i)),48===a){if(a=r.charCodeAt(++i),Jn(a))throw fr(e.source,i,`Invalid number, unexpected digit after 0: ${qr(e,i)}.`)}else i=Gr(e,i,a),a=r.charCodeAt(i);if(46===a&&(o=!0,a=r.charCodeAt(++i),i=Gr(e,i,a),a=r.charCodeAt(i)),69!==a&&101!==a||(o=!0,a=r.charCodeAt(++i),43!==a&&45!==a||(a=r.charCodeAt(++i)),i=Gr(e,i,a),a=r.charCodeAt(i)),46===a||Qn(a))throw fr(e.source,i,`Invalid number, expected digit but got: ${qr(e,i)}.`);return Br(e,o?Dr:"Int",t,i,r.slice(t,i))}function Gr(e,t,n){if(!Jn(n))throw fr(e.source,t,`Invalid number, expected digit but got: ${qr(e,t)}.`);const r=e.source.body;let i=t+1;for(;Jn(r.charCodeAt(i));)++i;return i}function Jr(e,t){const n=e.source.body,r=n.length;let i=t+1,a=i,o="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return o+=n.slice(a,i),Br(e,Pr,t,i+1,o);if(92===r){o+=n.slice(a,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?Kr(e,i):Qr(e,i):Zr(e,i);o+=t.value,i+=t.size,a=i;continue}if(10===r||13===r)break;if(jr(r))++i;else{if(!Fr(n,i))throw fr(e.source,i,`Invalid character within String: ${qr(e,i)}.`);i+=2}}throw fr(e.source,i,"Unterminated string.")}function Kr(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!jr(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Xr(e),r<0)break}throw fr(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Qr(e,t){const n=e.source.body,r=Yr(n,t+2);if(jr(r))return{value:String.fromCodePoint(r),size:6};if($r(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=Yr(n,t+8);if(Vr(e))return{value:String.fromCodePoint(r,e),size:12}}throw fr(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Yr(e,t){return Xr(e.charCodeAt(t))<<12|Xr(e.charCodeAt(t+1))<<8|Xr(e.charCodeAt(t+2))<<4|Xr(e.charCodeAt(t+3))}function Xr(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Zr(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw fr(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ei(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,a=t+3,o=a,s="";const l=[];for(;a<r;){const r=n.charCodeAt(a);if(34===r&&34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)){s+=n.slice(o,a),l.push(s);const r=Br(e,Mr,t,a+3,Xn(l).join("\n"));return e.line+=l.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(a+1)||34!==n.charCodeAt(a+2)||34!==n.charCodeAt(a+3))if(10!==r&&13!==r)if(jr(r))++a;else{if(!Fr(n,a))throw fr(e.source,a,`Invalid character within String: ${qr(e,a)}.`);a+=2}else s+=n.slice(o,a),l.push(s),13===r&&10===n.charCodeAt(a+1)?a+=2:++a,s="",o=a,i=a;else s+=n.slice(o,a),o=a+1,a+=4}throw fr(e.source,a,"Unterminated string.")}function ti(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r&&Yn(n.charCodeAt(i));)++i;return Br(e,_r,t,i,n.slice(t,i))}var ni=Symbol("Source"),ri=class{constructor(e,t="GraphQL request",n={line:1,column:1}){this.__kind=ni,this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Wn(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Wn(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ii(e,t){const n=new ai(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var ai=class{constructor(e,t={}){const{lexer:n,...r}=t;if(n)this._lexer=n;else{const t=function(e){return t=e,n=ni,t?.__kind===n;var t,n}(e)?e:new ri(e);this._lexer=new Lr(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(_r);return this.node(e,{kind:Kt,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Qt,definitions:this.many(br,this.parseDefinition,vr)})}parseDefinition(){if(this.peek(Or))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===Or)throw fr(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===_r){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw fr(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Or))return this.node(e,{kind:Yt,operation:Ht,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),n=this.parseOperationType();let r;return this.peek(_r)&&(r=this.parseName()),this.node(e,{kind:Yt,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(_r);switch(e.value){case"query":return Ht;case"mutation":return Wt;case"subscription":return Gt}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(kr,this.parseVariableDefinition,wr)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Xt,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(Nr),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Tr)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(xr),this.node(e,{kind:sn,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Zt,selections:this.many(Or,this.parseSelection,Ar)})}parseSelection(){return this.peek(Sr)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Nr)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:en,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Or)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(kr,t,wr)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(kr,e,wr)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Nr),this.node(t,{kind:tn,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(Nr),this.node(e,{kind:nn,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(Sr);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(_r)){const t=this.parseFragmentName();return this.peek(kr)&&this._options.experimentalFragmentArguments?this.node(e,{kind:rn,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:rn,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:an,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:on,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:on,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Er:return this.parseList(e);case Or:return this.parseObject(e);case"Int":return this.advanceLexer(),this.node(t,{kind:ln,value:t.value});case Dr:return this.advanceLexer(),this.node(t,{kind:cn,value:t.value});case Pr:case Mr:return this.parseStringLiteral();case _r:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:dn,value:!0});case"false":return this.node(t,{kind:dn,value:!1});case"null":return this.node(t,{kind:pn});default:return this.node(t,{kind:hn,value:t.value})}case xr:if(e){if(this.expectToken(xr),this._lexer.token.kind===_r){const e=this._lexer.token.value;throw fr(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:un,value:e.value,block:e.kind===Mr})}parseList(e){return this.node(this._lexer.token,{kind:fn,values:this.any(Er,()=>this.parseValueLiteral(e),Ir)})}parseObject(e){return this.node(this._lexer.token,{kind:mn,fields:this.any(Or,()=>this.parseObjectField(e),Ar)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Nr),this.node(t,{kind:gn,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Cr);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Cr),this.node(t,{kind:yn,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Er)){const n=this.parseTypeReference();this.expectToken(Ir),t=this.node(e,{kind:vn,type:n})}else t=this.parseNamedType();return this.expectOptionalToken("!")?this.node(e,{kind:xn,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:bn,name:this.parseName()})}peekDescription(){return this.peek(Pr)||this.peek(Mr)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(Or,this.parseOperationTypeDefinition,Ar);return this.node(e,{kind:kn,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Nr);const n=this.parseNamedType();return this.node(e,{kind:wn,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Sn,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:Nn,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany("&",this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(Or,this.parseFieldDefinition,Ar)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Nr);const i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:Tn,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(kr,this.parseInputValueDef,wr)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Nr);const r=this.parseTypeReference();let i;this.expectOptionalToken(Tr)&&(i=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:Cn,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:En,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:In,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Tr)?this.delimitedMany(zr,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:On,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Or,this.parseEnumValueDefinition,Ar)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:zn,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw fr(this._lexer.source,this._lexer.token.start,`${oi(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:An,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Or,this.parseInputValueDef,Ar)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===_r)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(Or,this.parseOperationTypeDefinition,Ar);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:Dn,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:Mn,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Rn,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Ln,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:jn,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:Fn,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:$n,name:t,directives:n,fields:r})}parseDirectiveExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(Cr);const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:Pn,name:t,directives:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Cr);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.parseConstDirectives(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:_n,description:t,name:n,arguments:r,directives:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(zr,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(hr,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(Cr),n=this.parseName();let r,i;return!t&&this.expectOptionalToken(".")&&(r=this.parseName()),(t||r)&&this.expectOptionalToken(kr)&&(i=this.parseName(),this.expectToken(Nr),this.expectToken(wr)),t?i?this.node(e,{kind:Hn,name:n,argumentName:i}):this.node(e,{kind:Un,name:n}):r?i?this.node(e,{kind:Bn,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:qn,name:n,memberName:r}):this.node(e,{kind:Vn,name:n})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new $t(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw fr(this._lexer.source,t.start,`Expected ${si(e)}, found ${oi(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==_r||t.value!==e)throw fr(this._lexer.source,t.start,`Expected "${e}", found ${oi(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===_r&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return fr(this._lexer.source,t.start,`Unexpected ${oi(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==vr&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw fr(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}};function oi(e){const t=e.value;return si(e.kind)+(null!=t?` "${t}"`:"")}function si(e){return function(e){return"!"===e||e===xr||"&"===e||e===kr||e===wr||"."===e||e===Sr||e===Nr||e===Tr||e===Cr||e===Er||e===Ir||e===Or||e===zr||e===Ar}(e)?`"${e}"`:e}var li=function(e,t){return li=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},li(e,t)};function ci(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}li(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ui=function(){return ui=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ui.apply(this,arguments)};function di(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(rM){s=[6,rM],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function pi(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hi(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function fi(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function mi(e){return this instanceof mi?(this.v=e,this):new mi(e)}function gi(e){return"function"==typeof e}function yi(e){var t=e(function(e){Error.call(e),e.stack=/* @__PURE__ */(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var bi=yi(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function vi(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var xi=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=pi(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(h){e={error:h}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var l=this.initialTeardown;if(gi(l))try{l()}catch(rM){i=rM instanceof bi?rM.errors:[rM]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=pi(c),d=u.next();!d.done;d=u.next()){var p=d.value;try{Si(p)}catch(f){i=null!=i?i:[],f instanceof bi?i=fi(fi([],hi(i)),hi(f.errors)):i.push(f)}}}catch(m){n={error:m}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new bi(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Si(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&vi(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&vi(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ki=xi.EMPTY;function wi(e){return e instanceof xi||e&&"closed"in e&&gi(e.remove)&&gi(e.add)&&gi(e.unsubscribe)}function Si(e){gi(e)?e():e.unsubscribe()}var Ni={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Ni.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,fi([e,t],hi(n))):setTimeout.apply(void 0,fi([e,t],hi(n)))},clearTimeout:function(e){var t=Ni.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Ti(e){Ni.setTimeout(function(){throw e})}function Ci(){}var Ei=Ii("C",void 0,void 0);function Ii(e,t,n){return{kind:e,value:t,error:n}}function Oi(e){e()}var zi=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,wi(t)&&t.add(n)):n.destination=Mi,n}return ci(t,e),t.create=function(e,t,n){return new _i(e,t,n)},t.prototype.next=function(e){this.isStopped?Pi(function(e){return Ii("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Pi(Ii("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Pi(Ei,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(xi);Function.prototype.bind;var Ai=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){Di(n)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Di(n)}else Di(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Di(t)}},e}(),_i=function(e){function t(t,n,r){var i,a=e.call(this)||this;return i=gi(t)||!t?{next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:t,a.destination=new Ai(i),a}return ci(t,e),t}(zi);function Di(e){Ti(e)}function Pi(e,t){var n=null;n&&Ni.setTimeout(function(){return n(e,t)})}var Mi={closed:!0,next:Ci,error:function(e){throw e},complete:Ci},Ri="function"==typeof Symbol&&Symbol.observable||"@@observable";function Li(e){return e}var ji=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,i=this,a=(r=e)&&r instanceof zi||function(e){return e&&gi(e.next)&&gi(e.error)&&gi(e.complete)}(r)&&wi(r)?e:new _i(e,t,n);return Oi(function(){var e=i,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?i._subscribe(a):i._trySubscribe(a))}),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Fi(t))(function(t,r){var i=new _i({next:function(t){try{e(t)}catch(n){r(n),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Ri]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0===(e=t).length?Li:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Fi(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Fi(e){var t;return null!==(t=null!=e?e:void 0)&&void 0!==t?t:Promise}function $i(e){return function(t){if(function(e){return gi(null==e?void 0:e.lift)}(t))return t.lift(function(t){try{return e(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Vi(e,t,n,r,i){return new qi(e,t,n,r,i)}var qi=function(e){function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(r){t.error(r)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return ci(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(zi),Bi=yi(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ui=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return ci(t,e),t.prototype.lift=function(e){var t=new Hi(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Bi},t.prototype.next=function(e){var t=this;Oi(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=pi(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(o){n={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Oi(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Oi(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?ki:(this.currentObservers=null,a.push(e),new xi(function(){t.currentObservers=null,vi(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new ji;return e.source=this,e},t.create=function(e,t){return new Hi(e,t)},t}(ji),Hi=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return ci(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:ki},t}(Ui),Wi=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return ci(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Ui),Gi={now:function(){return(Gi.delegate||Date).now()},delegate:void 0},Ji=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Gi);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return ci(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,l=1;l<r.length&&r[l]<=o;l+=2)s=l;s&&r.splice(0,s+1)}},t}(Ui),Ki=function(e){function t(t,n){return e.call(this)||this}return ci(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(xi),Qi={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Qi.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,fi([e,t],hi(n))):setInterval.apply(void 0,fi([e,t],hi(n)))},clearInterval:function(e){var t=Qi.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},Yi=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return ci(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),Qi.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&Qi.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)/* @__PURE__ */return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(rM){r=!0,n=rM||/* @__PURE__ */new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,vi(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Ki),Xi=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Gi.now,e}(),Zi=new(function(e){function t(t,n){void 0===n&&(n=Xi.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return ci(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Xi))(Yi),ea=new ji(function(e){return e.complete()});function ta(e){return e&&gi(e.schedule)}function na(e){return ta((t=e)[t.length-1])?e.pop():void 0;var t}var ra=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function ia(e){return gi(null==e?void 0:e.then)}function aa(e){return gi(e[Ri])}function oa(e){return Symbol.asyncIterator&&gi(null==e?void 0:e[Symbol.asyncIterator])}function sa(e){/* @__PURE__ */
1
+ import{n as e,r as t,t as n}from"./rolldown-runtime-CxhCXM28.js";import{$ as r,A as i,B as a,C as o,D as s,E as l,F as c,G as u,H as d,I as p,J as h,K as f,L as m,M as g,N as y,O as b,P as v,Q as x,R as k,S as w,T as S,U as N,V as T,W as C,X as E,Y as I,Z as O,_ as z,a as A,b as _,c as D,d as P,f as M,g as R,h as L,i as j,j as F,k as $,l as V,m as q,n as B,o as U,p as H,q as W,r as G,s as J,t as K,u as Q,v as Y,w as X,x as Z,y as ee,z as te}from"./withElement-ChViGmkj.js";import*as ne from"react";import re,{Children as ie,Fragment as ae,cloneElement as oe,createContext as se,createElement as le,forwardRef as ce,isValidElement as ue,memo as de,use as pe,useCallback as he,useContext as fe,useEffect as me,useId as ge,useImperativeHandle as ye,useLayoutEffect as be,useMemo as ve,useReducer as xe,useRef as ke,useState as we,useSyncExternalStore as Se}from"react";import{createRoot as Ne,hydrateRoot as Te}from"react-dom/client";import{Fragment as Ce,jsx as Ee,jsxs as Ie}from"react/jsx-runtime";import{createPortal as Oe}from"react-dom";import{c as ze}from"react/compiler-runtime";var Ae=Object.defineProperty,_e=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t||Ae(n,Symbol.toStringTag,{value:"Module"}),n},De={previewMode:!0,debugMode:!1,renderMode:"raw",environment:"main",isHydrating:!1,hydrated:!1,overQuota:!1,testAttributes:!0},Pe=()=>{let[[e,t,n,r,i,a,o,s]]=c(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota","render.testAttributes"]);return ve(()=>({previewMode:e??De.previewMode,debugMode:t??De.debugMode,renderMode:n??De.renderMode,environment:r??De.environment,isHydrating:i??De.isHydrating,hydrated:a??De.hydrated,overQuota:o??De.overQuota,testAttributes:s??De.testAttributes}),[e,t,n,r,i,a,o,s])},Me=(e,t)=>"string"!=typeof e||e===t||e.length>t.length&&e.startsWith(t)&&"."===e[t.length]||t.length>e.length&&t.startsWith(e)&&"."===t[e.length],Re=(e,t,n=12)=>{if(!Object.is(e,t)){if(n<=0||!E(e)||!E(t))return{path:"",value:t};for(let r of/* @__PURE__ */new Set([...Object.keys(e),...Object.keys(t)])){if(Object.is(e[r],t[r]))continue;let i=Re(e[r],t[r],n-1);if(i)return{path:i.path?`${r}.${i.path}`:r,value:i.value}}}},Le=/* @__PURE__ */new WeakMap,je=e=>{let t=e?.enabled;return n=>{if(O(t,n.getState()))return;let{handle:r,record:i}=function(e,t={}){let n=t.limit??100,r=t.path,i=t.shouldRecord,a=[{state:e.getState(),timestamp:Date.now()}],o=0,s=!1,l=()=>({entries:a,index:o,canUndo:o>0,canRedo:o<a.length-1}),c=l(),u=/* @__PURE__ */new Set,d=()=>{c=l(),u.forEach(e=>e())},p=t=>{if(t<0||t>=a.length||t===o)return;let n=a[t].state;if(s=!0,r){let t=I(n,r);e.setState(r,()=>t)}else e.setState(void 0,()=>n);s=!1,o=t,d()};return{handle:{getSnapshot:()=>c,subscribe:e=>(u.add(e),()=>u.delete(e)),undo:()=>p(o-1),redo:()=>p(o+1),travelTo:p,clear:()=>{a=[{state:e.getState(),timestamp:Date.now()}],o=0,d()}},record:({path:t})=>{if(s||i&&!i(t)||r&&void 0!==t&&!Me(t,r))return;let l,c=o<a.length-1?a.slice(0,o+1):a,u=c[c.length-1].state,p=e.getState(),h=t??r,f=t??r;if(f)try{let e=Re(I(u,f),I(p,f));e&&(h=e.path?`${f}.${e.path}`:f,l=e.value)}catch{}let m=[...c,{path:h,value:l,state:p,timestamp:Date.now()}];a=m.length>n?m.slice(m.length-n):m,o=a.length-1,d()}}}(n,e);return Le.set(n,r),{onChange:i}}},Fe=e=>{},$e=e=>{},Ve=(e={})=>{let{filter:t,sink:n=Fe,errorSink:r=$e,enabled:i}="function"==typeof e?{sink:e}:e;return e=>{if(!O(i,e.getState()))return{onChange:e=>{(!t||t(e))&&n(e)},onError:r}}},qe=(e="local")=>{if("string"!=typeof e)return e;try{return"session"===e?globalThis.sessionStorage:globalThis.localStorage}catch{return}},Be=Symbol("@plitzi/nexus/ssr-snapshot");function Ue(e){return"object"==typeof e&&!!e&&Be in e}var He,We=/* @__PURE__ */new Map,Ge=/* @__PURE__ */new Set,Je=0,Ke=()=>{He=void 0;for(let e of Ge)e()},Qe=(e,t,n)=>{let r=e;return We.set(r,{uid:"dev-store-"+ ++Je,store:r,scopeId:t,name:n}),Ke(),()=>{We.delete(r),Ke()}},Ye=e=>(Ge.add(e),()=>{Ge.delete(e)}),Xe=()=>(He??=[...We.values()],He),Ze=f({runs:[]},{id:"action-runs"}),et=0,tt=e=>Ze.setState("runs",e),nt=/* @__PURE__ */new Map,rt=(e,t)=>{let{runs:n}=Ze.getState();n.some(t=>t.id===e)&&tt(n.map(n=>n.id===e?{...n,...t}:n))},it=()=>{let e=new Set(Ze.getState().runs.filter(e=>e.cancellable).map(e=>e.id));[...nt.keys()].forEach(t=>{e.has(t)||nt.delete(t)}),tt([])},at=se(void 0);at.displayName="DevStoreScopeContext";var ot=f,st=se(void 0),lt=e=>!0===e.cascade,ct=({store:e,id:t,segment:n,isolate:r,path:i,value:o,inherit:s,autoSync:l=!0,middlewares:c,name:d,children:p})=>{let h=fe(u),f=fe(st),m=fe(N),g=fe(at),y=h?.scopePath??"",b=ve(()=>void 0===n?y:y?`${y}/${n}`:n,[y,n]),v=ke(void 0),x="live"===s,k=ve(()=>{let e="snapshot"===s&&h?h.getState():{},t="function"==typeof o?o(e):{...e,...o};return Ue(t)?function(e){return Ue(e)?{...e}:e}(t):t},[s,h,o]),w=c??[],S=f?[...f,...w]:w,T=ve(()=>{let e=w.filter(lt);return 0===e.length?f:[...f??[],...e]},[f,c]);v.current||=e??ot(()=>k,{id:t,scopePath:b,exclusive:x?r:void 0,parent:x?h:void 0,middlewares:S.length>0?S:void 0,deferHydrate:!0});let E=ve(()=>t?{id:t,store:v.current,parent:m}:m,[t,m]),I=ke(!1);me(()=>{W&&t&&!I.current&&C(m,t)&&(I.current=!0)},[t,m]),me(()=>(x&&!e&&v.current?.reconnect?.(),()=>{x&&!e&&v.current?.destroy?.()}),[x,e]),me(()=>{if(W||void 0!==g)return Qe(v.current,g,d)},[g,d]);let O=ke(!1);me(()=>{!O.current&&v.current?.hydrate&&(v.current.hydrate(),O.current=!0)},[]),a(i,i?o:k,{enabled:!!o&&l,store:v.current});let z=/* @__PURE__ */Ee(u,{value:v.current,children:p});return E!==m&&(z=/* @__PURE__ */Ee(N,{value:E,children:z})),T!==f&&(z=/* @__PURE__ */Ee(st,{value:T,children:z})),z},ut={entries:[],index:-1,canUndo:!1,canRedo:!1},dt=()=>{},pt=()=>dt,ht=()=>ut,ft=/* @__PURE__ */new WeakSet;function mt(e,t){let n={},r=Array.isArray(t)?t:[t];for(let i of r){let t=s(e,i);void 0!==t&&l(n,i,t)}return n}function gt(e,t=0,n={}){let r,i,a,o,s,l=0,c=n.leading??!1,u=n.trailing??!0,d=n.maxWait,p=()=>Date.now();function h(t){if(!r)return a;l=t;let n=r,o=i;return r=void 0,i=void 0,a=e.apply(o,n),a}function f(e){o=setTimeout(g,e)}function m(e){if(void 0===s)return!0;let n=e-s;return n>=t||n<0||void 0!==d&&e-l>=d}function g(){let e=p();if(m(e))return b(e);f(function(e){let n=e-l,r=t-(e-(s??0));return void 0===d?r:Math.min(r,d-n)}(e))}function y(e){return l=e,f(t),c?h(e):a}function b(e){return o=void 0,u&&r?h(e):(r=i=void 0,a)}function v(...e){let n=p(),l=m(n);if(r=e,i=this,s=n,l){if(!o)return y(n);if(void 0!==d)return clearTimeout(o),f(t),h(n)}return o||f(t),a}return v.cancel=()=>{void 0!==o&&clearTimeout(o),l=0,r=s=i=o=void 0},v.flush=()=>void 0===o?a:b(p()),v.pending=()=>void 0!==o,v}function yt(e,t=0,n={}){return gt(e,t,{leading:n.leading??!0,trailing:n.trailing??!0,maxWait:t})}function bt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=bt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=bt(e))&&(r&&(r+=" "),r+=t);return r}var xt=/* @__PURE__ */e({cva:()=>St,cx:()=>wt}),kt=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,wt=vt,St=(e,t)=>n=>{var r;if(null==(null==t?void 0:t.variants))return wt(e,null==n?void 0:n.class,null==n?void 0:n.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(e=>{const t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;const o=kt(t)||kt(r);return i[e][o]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{}),l=null==t||null===(r=t.compoundVariants)||void 0===r?void 0:r.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]);return wt(e,o,l,null==n?void 0:n.class,null==n?void 0:n.className)},{cva:Nt}=xt,Tt=/* @__PURE__ */new Set,Ct=e=>{for(let t of Tt)t(e)},Et=["missing","expired","revoked","inactive","unverified","malformed","outdated","network"],It=(e,t)=>{if(401!==e)return;let n=t?.reason;return"string"==typeof n&&Et.includes(n)?n:"expired"},Ot=e=>/([^.]+\.[^.]+)$/.exec(e)?.[1]??e;function zt(e){return At(e,[])}function At(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:At(t,n)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const n=Math.min(10,e.length),r=e.length-n,i=[];for(let a=0;a<n;++a)i.push(At(e[a],t));return 1===r?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}(e,n);return function(e,t){const n=Object.entries(e);return 0===n.length?"{}":t.length>2?"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]":"{ "+n.map(([e,n])=>e+": "+At(n,t)).join(", ")+" }"}(e,n)}(e,t);default:return String(e)}}function _t(e,t){if(!e)throw new Error(t??"Unexpected invariant triggered.")}var Dt=/\r\n|[\n\r]/g;function Pt(e,t){let n=0,r=1;for(const i of e.body.matchAll(Dt)){if("number"!=typeof i.index&&_t(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Mt(e){return Rt(e.source,Pt(e.source,e.start))}function Rt(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=1===t.line?n:0,l=t.column+s,c=`${e.name}:${o}:${l}\n`,u=r.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){const e=Math.floor(l/80),t=l%80,n=[];for(let r=0;r<d.length;r+=80)n.push(d.slice(r,r+80));return c+Lt([[`${o} |`,n[0]],...n.slice(1,e+1).map(e=>["|",e]),["|","^".padStart(t)],["|",n[e+1]]])}return c+Lt([[o-1+" |",u[i-1]],[`${o} |`,d],["|","^".padStart(l)],[`${o+1} |`,u[i+1]]])}function Lt(e){const t=e.filter(([e,t])=>void 0!==t),n=Math.max(...t.map(([e])=>e.length));return t.map(([e,t])=>e.padStart(n)+(t?" "+t:"")).join("\n")}var jt=class e extends Error{constructor(t,n={}){const{nodes:r,source:i,positions:a,path:o,originalError:s,cause:l,extensions:c}=n,u="cause"in n;super(t,u||null!=s?{cause:u?l:s}:void 0),this.name="GraphQLError",this.path=o??void 0;const d=s??(l instanceof Error?l:void 0);this.originalError=d,this.nodes=Ft(Array.isArray(r)?r:r?[r]:void 0);const p=Ft(this.nodes?.map(e=>e.loc).filter(e=>null!=e));this.source=i??p?.[0]?.source,this.positions=a??p?.map(e=>e.start),this.locations=a&&i?a.map(e=>Pt(i,e)):p?.map(e=>Pt(e.source,e.start));const h=(f=d?.extensions,"object"==typeof f&&null!==f?d.extensions:void 0);var f;this.extensions=c??h??Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=s?.stack?Object.defineProperty(this,"stack",{value:s.stack,writable:!0,configurable:!0}):null!=Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+Mt(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+Rt(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}};function Ft(e){return void 0===e||0===e.length?void 0:e}var $t=class{constructor(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}},Vt=class{constructor(e,t,n,r,i,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},qt={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentArgument:["name","value"],FragmentSpread:["name","arguments","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Bt=new Set(Object.keys(qt));function Ut(e){const t=e?.kind;return"string"==typeof t&&Bt.has(t)}var Ht="query",Wt="mutation",Gt="subscription",Jt=/* @__PURE__ */e({ARGUMENT:()=>tn,ARGUMENT_COORDINATE:()=>Bn,BOOLEAN:()=>dn,DIRECTIVE:()=>yn,DIRECTIVE_ARGUMENT_COORDINATE:()=>Hn,DIRECTIVE_COORDINATE:()=>Un,DIRECTIVE_DEFINITION:()=>_n,DIRECTIVE_EXTENSION:()=>Pn,DOCUMENT:()=>Qt,ENUM:()=>hn,ENUM_TYPE_DEFINITION:()=>On,ENUM_TYPE_EXTENSION:()=>Fn,ENUM_VALUE_DEFINITION:()=>zn,FIELD:()=>en,FIELD_DEFINITION:()=>Tn,FLOAT:()=>cn,FRAGMENT_ARGUMENT:()=>nn,FRAGMENT_DEFINITION:()=>on,FRAGMENT_SPREAD:()=>rn,INLINE_FRAGMENT:()=>an,INPUT_OBJECT_TYPE_DEFINITION:()=>An,INPUT_OBJECT_TYPE_EXTENSION:()=>$n,INPUT_VALUE_DEFINITION:()=>Cn,INT:()=>ln,INTERFACE_TYPE_DEFINITION:()=>En,INTERFACE_TYPE_EXTENSION:()=>Ln,LIST:()=>fn,LIST_TYPE:()=>vn,MEMBER_COORDINATE:()=>qn,NAME:()=>Kt,NAMED_TYPE:()=>bn,NON_NULL_TYPE:()=>xn,NULL:()=>pn,OBJECT:()=>mn,OBJECT_FIELD:()=>gn,OBJECT_TYPE_DEFINITION:()=>Nn,OBJECT_TYPE_EXTENSION:()=>Rn,OPERATION_DEFINITION:()=>Yt,OPERATION_TYPE_DEFINITION:()=>wn,SCALAR_TYPE_DEFINITION:()=>Sn,SCALAR_TYPE_EXTENSION:()=>Mn,SCHEMA_DEFINITION:()=>kn,SCHEMA_EXTENSION:()=>Dn,SELECTION_SET:()=>Zt,STRING:()=>un,TYPE_COORDINATE:()=>Vn,UNION_TYPE_DEFINITION:()=>In,UNION_TYPE_EXTENSION:()=>jn,VARIABLE:()=>sn,VARIABLE_DEFINITION:()=>Xt}),Kt="Name",Qt="Document",Yt="OperationDefinition",Xt="VariableDefinition",Zt="SelectionSet",en="Field",tn="Argument",nn="FragmentArgument",rn="FragmentSpread",an="InlineFragment",on="FragmentDefinition",sn="Variable",ln="IntValue",cn="FloatValue",un="StringValue",dn="BooleanValue",pn="NullValue",hn="EnumValue",fn="ListValue",mn="ObjectValue",gn="ObjectField",yn="Directive",bn="NamedType",vn="ListType",xn="NonNullType",kn="SchemaDefinition",wn="OperationTypeDefinition",Sn="ScalarTypeDefinition",Nn="ObjectTypeDefinition",Tn="FieldDefinition",Cn="InputValueDefinition",En="InterfaceTypeDefinition",In="UnionTypeDefinition",On="EnumTypeDefinition",zn="EnumValueDefinition",An="InputObjectTypeDefinition",_n="DirectiveDefinition",Dn="SchemaExtension",Pn="DirectiveExtension",Mn="ScalarTypeExtension",Rn="ObjectTypeExtension",Ln="InterfaceTypeExtension",jn="UnionTypeExtension",Fn="EnumTypeExtension",$n="InputObjectTypeExtension",Vn="TypeCoordinate",qn="MemberCoordinate",Bn="ArgumentCoordinate",Un="DirectiveCoordinate",Hn="DirectiveArgumentCoordinate";function Wn(e,t){if(!e)throw new Error(t)}function Gn(e){return 9===e||32===e}function Jn(e){return e>=48&&e<=57}function Kn(e){return e>=97&&e<=122||e>=65&&e<=90}function Qn(e){return Kn(e)||95===e}function Yn(e){return Kn(e)||Jn(e)||95===e}function Xn(e){let t=Number.MAX_SAFE_INTEGER,n=null,r=-1;for(let i=0;i<e.length;++i){const a=e[i],o=Zn(a);o!==a.length&&(n??=i,r=i,0!==i&&o<t&&(t=o))}return e.map((e,n)=>0===n?e:e.slice(t)).slice(n??0,r+1)}function Zn(e){let t=0;for(;t<e.length&&Gn(e.charCodeAt(t));)++t;return t}var er=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function tr(e){return nr[e.charCodeAt(0)]}var nr=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],rr=Object.freeze({});function ir(e,t,n=qt){const r=/* @__PURE__ */new Map;for(const f of Object.values(Jt))r.set(f,ar(t,f));let i,a,o,s=Array.isArray(e),l=[e],c=-1,u=[],d=e;const p=[],h=[];do{c++;const e=c===l.length,f=e&&0!==u.length;if(e){if(a=0===h.length?void 0:p[p.length-1],d=o,o=h.pop(),f)if(s){d=d.slice();let e=0;for(const[t,n]of u){const r=t-e;null===n?(d.splice(r,1),e++):d[r]=n}}else{d={...d};for(const[e,t]of u)d[e]=t}c=i.index,l=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(null!=o){if(a=s?c:l[c],d=o[a],null==d)continue;p.push(a)}let m;if(!Array.isArray(d)){if(Ut(d)||Wn(!1,`Invalid AST Node: ${zt(d)}.`),m=(e?r.get(d.kind)?.leave:r.get(d.kind)?.enter)?.call(t,d,a,o,p,h),m===rr)break;if(!1===m){if(!e){p.pop();continue}}else if(void 0!==m&&(u.push([a,m]),!e)){if(!Ut(m)){p.pop();continue}d=m}}void 0===m&&f&&u.push([a,d]),e?p.pop():(i={inArray:s,index:c,keys:l,edits:u,prev:i},s=Array.isArray(d),l=s?d:n[d.kind]??[],c=-1,u=[],null!=o&&h.push(o),o=d)}while(void 0!==i);return 0!==u.length?u.at(-1)[1]:e}function ar(e,t){const n=e[t];return"object"==typeof n?n:"function"==typeof n?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}var or={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>sr(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=dr(e.variableDefinitions)?cr("(\n",sr(e.variableDefinitions,"\n"),"\n)"):cr("(",sr(e.variableDefinitions,", "),")"),n=cr("",e.description,"\n")+sr([e.operation,sr([e.name,t]),sr(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r,description:i})=>cr("",i,"\n")+e+": "+t+cr(" = ",n)+cr(" ",sr(r," "))},SelectionSet:{leave:({selections:e})=>lr(e)},Field:{leave:({alias:e,name:t,arguments:n,directives:r,selectionSet:i})=>sr([pr(sr([cr("",e,": "),t],""),n),cr(" ",sr(r," ")),cr(" ",i)])},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentArgument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,arguments:t,directives:n})=>pr("..."+e,t)+cr(" ",sr(n," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>sr(["...",cr("on ",e),sr(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i,description:a})=>cr("",a,"\n")+`fragment ${e}${cr("(",sr(n,", "),")")} on ${t} ${cr("",sr(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>!0===t?function(e){const t=e.replaceAll('"""','\\"""'),n=t.split(/\r\n|[\n\r]/g),r=1===n.length,i=n.length>1&&n.slice(1).every(e=>0===e.length||Gn(e.charCodeAt(0))),a=t.endsWith('\\"""'),o=e.endsWith('"')&&!a,s=e.endsWith("\\"),l=o||s,c=!r||e.length>70||l||i||a;let u="";const d=r&&Gn(e.charCodeAt(0));return(c&&!d||i)&&(u+="\n"),u+=t,(c||l)&&(u+="\n"),'"""'+u+'"""'}(e):`"${e.replace(er,tr)}"`},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>{const t="["+sr(e,", ")+"]";return t.length>80?"[\n"+ur(sr(e,"\n"))+"\n]":t}},ObjectValue:{leave:({fields:e})=>{const t="{ "+sr(e,", ")+" }";return t.length>80?lr(e):t}},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+cr("(",sr(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>cr("",e,"\n")+sr(["schema",sr(t," "),lr(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>cr("",e,"\n")+sr(["scalar",t,sr(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>cr("",e,"\n")+sr(["type",t,cr("implements ",sr(n," & ")),sr(r," "),lr(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>cr("",e,"\n")+t+(dr(n)?cr("(\n",ur(sr(n,"\n")),"\n)"):cr("(",sr(n,", "),")"))+": "+r+cr(" ",sr(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>cr("",e,"\n")+sr([t+": "+n,cr("= ",r),sr(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>cr("",e,"\n")+sr(["interface",t,cr("implements ",sr(n," & ")),sr(r," "),lr(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>cr("",e,"\n")+sr(["union",t,sr(n," "),cr("= ",sr(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>cr("",e,"\n")+sr(["enum",t,sr(n," "),lr(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>cr("",e,"\n")+sr([t,sr(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>cr("",e,"\n")+sr(["input",t,sr(n," "),lr(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,directives:r,repeatable:i,locations:a})=>cr("",e,"\n")+"directive @"+t+(dr(n)?cr("(\n",ur(sr(n,"\n")),"\n)"):cr("(",sr(n,", "),")"))+cr(" ",sr(r," "))+(i?" repeatable":"")+" on "+sr(a," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>sr(["extend schema",sr(e," "),lr(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>sr(["extend scalar",e,sr(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>sr(["extend type",e,cr("implements ",sr(t," & ")),sr(n," "),lr(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>sr(["extend interface",e,cr("implements ",sr(t," & ")),sr(n," "),lr(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>sr(["extend union",e,sr(t," "),cr("= ",sr(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>sr(["extend enum",e,sr(t," "),lr(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>sr(["extend input",e,sr(t," "),lr(n)]," ")},DirectiveExtension:{leave:({name:e,directives:t})=>sr(["extend directive @"+e,sr(t," ")]," ")},TypeCoordinate:{leave:({name:e})=>e},MemberCoordinate:{leave:({name:e,memberName:t})=>sr([e,cr(".",t)])},ArgumentCoordinate:{leave:({name:e,fieldName:t,argumentName:n})=>sr([e,cr(".",t),cr("(",n,":)")])},DirectiveCoordinate:{leave:({name:e})=>sr(["@",e])},DirectiveArgumentCoordinate:{leave:({name:e,argumentName:t})=>sr(["@",e,cr("(",t,":)")])}};function sr(e,t=""){return e?.filter(e=>void 0!==e&&""!==e).join(t)??""}function lr(e){return cr("{\n",ur(sr(e,"\n")),"\n}")}function cr(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function ur(e){return cr(" ",e.replaceAll("\n","\n "))}function dr(e){return e?.some(e=>e.includes("\n"))??!1}function pr(e,t){let n=e+cr("(",sr(t,", "),")");return n.length>80&&(n=e+cr("(\n",ur(sr(t,"\n")),"\n)")),n}var hr={QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",FRAGMENT_VARIABLE_DEFINITION:"FRAGMENT_VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION",DIRECTIVE_DEFINITION:"DIRECTIVE_DEFINITION"};function fr(e,t,n){return new jt(`Syntax Error: ${n}`,{source:e,positions:[t]})}var mr=function(){let e;try{const t=globalThis.process;"function"==typeof t?.getBuiltinModule&&(e=t.getBuiltinModule("node:diagnostics_channel"))}catch{}return e}(),gr=mr?.tracingChannel("graphql:parse"),yr=(mr?.tracingChannel("graphql:validate"),mr?.tracingChannel("graphql:execute"),mr?.tracingChannel("graphql:execute:variableCoercion"),mr?.tracingChannel("graphql:execute:rootSelectionSet"),mr?.tracingChannel("graphql:subscribe"),mr?.tracingChannel("graphql:resolve"),["start","end","asyncStart","asyncEnd","error"]),br="<SOF>",vr="<EOF>",xr="$",kr="(",wr=")",Sr="...",Nr=":",Tr="=",Cr="@",Er="[",Ir="]",Or="{",zr="|",Ar="}",_r="Name",Dr="Float",Pr="String",Mr="BlockString",Rr="Comment",Lr=class{constructor(e){const t=new Vt(br,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==vr)do{if(e.next)e=e.next;else{const t=Ur(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===Rr);return e}};function jr(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function Fr(e,t){return $r(e.charCodeAt(t))&&Vr(e.charCodeAt(t+1))}function $r(e){return e>=55296&&e<=56319}function Vr(e){return e>=56320&&e<=57343}function qr(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return vr;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Br(e,t,n,r,i){const a=e.line,o=1+n-e.lineStart;return new Vt(t,n,r,a,o,i)}function Ur(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const t=n.charCodeAt(i);switch(t){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:10===n.charCodeAt(i+1)?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Hr(e,i);case 33:return Br(e,"!",i,i+1);case 36:return Br(e,xr,i,i+1);case 38:return Br(e,"&",i,i+1);case 40:return Br(e,kr,i,i+1);case 41:return Br(e,wr,i,i+1);case 46:{const t=n.charCodeAt(i+1);if(46===t&&46===n.charCodeAt(i+2))return Br(e,Sr,i,i+3);if(46===t)throw fr(e.source,i,'Unexpected "..", did you mean "..."?');if(Jn(t)){const n=e.source.body.slice(i+1,Gr(e,i+1,t));throw fr(e.source,i,`Invalid number, expected digit before ".", did you mean "0.${n}"?`)}break}case 58:return Br(e,Nr,i,i+1);case 61:return Br(e,Tr,i,i+1);case 64:return Br(e,Cr,i,i+1);case 91:return Br(e,Er,i,i+1);case 93:return Br(e,Ir,i,i+1);case 123:return Br(e,Or,i,i+1);case 124:return Br(e,zr,i,i+1);case 125:return Br(e,Ar,i,i+1);case 34:return 34===n.charCodeAt(i+1)&&34===n.charCodeAt(i+2)?ei(e,i):Jr(e,i)}if(Jn(t)||45===t)return Wr(e,i,t);if(Qn(t))return ti(e,i);throw fr(e.source,i,39===t?"Unexpected single quote character ('), did you mean to use a double quote (\")?":jr(t)||Fr(n,i)?`Unexpected character: ${qr(e,i)}.`:`Invalid character: ${qr(e,i)}.`)}return Br(e,vr,r,r)}function Hr(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const e=n.charCodeAt(i);if(10===e||13===e)break;if(jr(e))++i;else{if(!Fr(n,i))break;i+=2}}return Br(e,Rr,t,i,n.slice(t+1,i))}function Wr(e,t,n){const r=e.source.body;let i=t,a=n,o=!1;if(45===a&&(a=r.charCodeAt(++i)),48===a){if(a=r.charCodeAt(++i),Jn(a))throw fr(e.source,i,`Invalid number, unexpected digit after 0: ${qr(e,i)}.`)}else i=Gr(e,i,a),a=r.charCodeAt(i);if(46===a&&(o=!0,a=r.charCodeAt(++i),i=Gr(e,i,a),a=r.charCodeAt(i)),69!==a&&101!==a||(o=!0,a=r.charCodeAt(++i),43!==a&&45!==a||(a=r.charCodeAt(++i)),i=Gr(e,i,a),a=r.charCodeAt(i)),46===a||Qn(a))throw fr(e.source,i,`Invalid number, expected digit but got: ${qr(e,i)}.`);return Br(e,o?Dr:"Int",t,i,r.slice(t,i))}function Gr(e,t,n){if(!Jn(n))throw fr(e.source,t,`Invalid number, expected digit but got: ${qr(e,t)}.`);const r=e.source.body;let i=t+1;for(;Jn(r.charCodeAt(i));)++i;return i}function Jr(e,t){const n=e.source.body,r=n.length;let i=t+1,a=i,o="";for(;i<r;){const r=n.charCodeAt(i);if(34===r)return o+=n.slice(a,i),Br(e,Pr,t,i+1,o);if(92===r){o+=n.slice(a,i);const t=117===n.charCodeAt(i+1)?123===n.charCodeAt(i+2)?Kr(e,i):Qr(e,i):Zr(e,i);o+=t.value,i+=t.size,a=i;continue}if(10===r||13===r)break;if(jr(r))++i;else{if(!Fr(n,i))throw fr(e.source,i,`Invalid character within String: ${qr(e,i)}.`);i+=2}}throw fr(e.source,i,"Unterminated string.")}function Kr(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const e=n.charCodeAt(t+i++);if(125===e){if(i<5||!jr(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Xr(e),r<0)break}throw fr(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function Qr(e,t){const n=e.source.body,r=Yr(n,t+2);if(jr(r))return{value:String.fromCodePoint(r),size:6};if($r(r)&&92===n.charCodeAt(t+6)&&117===n.charCodeAt(t+7)){const e=Yr(n,t+8);if(Vr(e))return{value:String.fromCodePoint(r,e),size:12}}throw fr(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Yr(e,t){return Xr(e.charCodeAt(t))<<12|Xr(e.charCodeAt(t+1))<<8|Xr(e.charCodeAt(t+2))<<4|Xr(e.charCodeAt(t+3))}function Xr(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Zr(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw fr(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function ei(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,a=t+3,o=a,s="";const l=[];for(;a<r;){const r=n.charCodeAt(a);if(34===r&&34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)){s+=n.slice(o,a),l.push(s);const r=Br(e,Mr,t,a+3,Xn(l).join("\n"));return e.line+=l.length-1,e.lineStart=i,r}if(92!==r||34!==n.charCodeAt(a+1)||34!==n.charCodeAt(a+2)||34!==n.charCodeAt(a+3))if(10!==r&&13!==r)if(jr(r))++a;else{if(!Fr(n,a))throw fr(e.source,a,`Invalid character within String: ${qr(e,a)}.`);a+=2}else s+=n.slice(o,a),l.push(s),13===r&&10===n.charCodeAt(a+1)?a+=2:++a,s="",o=a,i=a;else s+=n.slice(o,a),o=a+1,a+=4}throw fr(e.source,a,"Unterminated string.")}function ti(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r&&Yn(n.charCodeAt(i));)++i;return Br(e,_r,t,i,n.slice(t,i))}var ni=Symbol("Source"),ri=class{constructor(e,t="GraphQL request",n={line:1,column:1}){this.__kind=ni,this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||Wn(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Wn(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}};function ii(e,t){const n=new ai(e,t),r=n.parseDocument();return Object.defineProperty(r,"tokenCount",{enumerable:!1,value:n.tokenCount}),r}var ai=class{constructor(e,t={}){const{lexer:n,...r}=t;if(n)this._lexer=n;else{const t=function(e){return t=e,n=ni,t?.__kind===n;var t,n}(e)?e:new ri(e);this._lexer=new Lr(t)}this._options=r,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(_r);return this.node(e,{kind:Kt,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Qt,definitions:this.many(br,this.parseDefinition,vr)})}parseDefinition(){if(this.peek(Or))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(e&&t.kind===Or)throw fr(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(t.kind===_r){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw fr(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");if("extend"===t.value)return this.parseTypeSystemExtension()}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Or))return this.node(e,{kind:Yt,operation:Ht,description:void 0,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:this.parseSelectionSet()});const t=this.parseDescription(),n=this.parseOperationType();let r;return this.peek(_r)&&(r=this.parseName()),this.node(e,{kind:Yt,operation:n,description:t,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(_r);switch(e.value){case"query":return Ht;case"mutation":return Wt;case"subscription":return Gt}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(kr,this.parseVariableDefinition,wr)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Xt,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(Nr),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Tr)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(xr),this.node(e,{kind:sn,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Zt,selections:this.many(Or,this.parseSelection,Ar)})}parseSelection(){return this.peek(Sr)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(Nr)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:en,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Or)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(kr,t,wr)}parseFragmentArguments(){const e=this.parseFragmentArgument;return this.optionalMany(kr,e,wr)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(Nr),this.node(t,{kind:tn,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragmentArgument(){const e=this._lexer.token,t=this.parseName();return this.expectToken(Nr),this.node(e,{kind:nn,name:t,value:this.parseValueLiteral(!1)})}parseFragment(){const e=this._lexer.token;this.expectToken(Sr);const t=this.expectOptionalKeyword("on");if(!t&&this.peek(_r)){const t=this.parseFragmentName();return this.peek(kr)&&this._options.experimentalFragmentArguments?this.node(e,{kind:rn,name:t,arguments:this.parseFragmentArguments(),directives:this.parseDirectives(!1)}):this.node(e,{kind:rn,name:t,directives:this.parseDirectives(!1)})}return this.node(e,{kind:an,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,t=this.parseDescription();return this.expectKeyword("fragment"),!0===this._options.experimentalFragmentArguments?this.node(e,{kind:on,description:t,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:on,description:t,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case Er:return this.parseList(e);case Or:return this.parseObject(e);case"Int":return this.advanceLexer(),this.node(t,{kind:ln,value:t.value});case Dr:return this.advanceLexer(),this.node(t,{kind:cn,value:t.value});case Pr:case Mr:return this.parseStringLiteral();case _r:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:dn,value:!0});case"false":return this.node(t,{kind:dn,value:!1});case"null":return this.node(t,{kind:pn});default:return this.node(t,{kind:hn,value:t.value})}case xr:if(e){if(this.expectToken(xr),this._lexer.token.kind===_r){const e=this._lexer.token.value;throw fr(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:un,value:e.value,block:e.kind===Mr})}parseList(e){return this.node(this._lexer.token,{kind:fn,values:this.any(Er,()=>this.parseValueLiteral(e),Ir)})}parseObject(e){return this.node(this._lexer.token,{kind:mn,fields:this.any(Or,()=>this.parseObjectField(e),Ar)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(Nr),this.node(t,{kind:gn,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(Cr);)t.push(this.parseDirective(e));if(t.length)return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(Cr),this.node(t,{kind:yn,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(Er)){const n=this.parseTypeReference();this.expectToken(Ir),t=this.node(e,{kind:vn,type:n})}else t=this.parseNamedType();return this.expectOptionalToken("!")?this.node(e,{kind:xn,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:bn,name:this.parseName()})}peekDescription(){return this.peek(Pr)||this.peek(Mr)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(Or,this.parseOperationTypeDefinition,Ar);return this.node(e,{kind:kn,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(Nr);const n=this.parseNamedType();return this.node(e,{kind:wn,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Sn,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:Nn,description:t,name:n,interfaces:r,directives:i,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany("&",this.parseNamedType):void 0}parseFieldsDefinition(){return this.optionalMany(Or,this.parseFieldDefinition,Ar)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(Nr);const i=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:Tn,description:t,name:n,arguments:r,type:i,directives:a})}parseArgumentDefs(){return this.optionalMany(kr,this.parseInputValueDef,wr)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(Nr);const r=this.parseTypeReference();let i;this.expectOptionalToken(Tr)&&(i=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:Cn,description:t,name:n,type:r,defaultValue:i,directives:a})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:En,description:t,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:In,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(Tr)?this.delimitedMany(zr,this.parseNamedType):void 0}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:On,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(Or,this.parseEnumValueDefinition,Ar)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:zn,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw fr(this._lexer.source,this._lexer.token.start,`${oi(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:An,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(Or,this.parseInputValueDef,Ar)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===_r)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension();case"directive":return this.parseDirectiveExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(Or,this.parseOperationTypeDefinition,Ar);if(void 0===t&&void 0===n)throw this.unexpected();return this.node(e,{kind:Dn,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:Mn,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Rn,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(void 0===n&&void 0===r&&void 0===i)throw this.unexpected();return this.node(e,{kind:Ln,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:jn,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:Fn,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(void 0===n&&void 0===r)throw this.unexpected();return this.node(e,{kind:$n,name:t,directives:n,fields:r})}parseDirectiveExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("directive"),this.expectToken(Cr);const t=this.parseName(),n=this.parseConstDirectives();if(void 0===n)throw this.unexpected();return this.node(e,{kind:Pn,name:t,directives:n})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Cr);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.parseConstDirectives(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:_n,description:t,name:n,arguments:r,directives:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(zr,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.hasOwn(hr,t.value))return t;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,t=this.expectOptionalToken(Cr),n=this.parseName();let r,i;return!t&&this.expectOptionalToken(".")&&(r=this.parseName()),(t||r)&&this.expectOptionalToken(kr)&&(i=this.parseName(),this.expectToken(Nr),this.expectToken(wr)),t?i?this.node(e,{kind:Hn,name:n,argumentName:i}):this.node(e,{kind:Un,name:n}):r?i?this.node(e,{kind:Bn,name:n,fieldName:r,argumentName:i}):this.node(e,{kind:qn,name:n,memberName:r}):this.node(e,{kind:Vn,name:n})}node(e,t){return!0!==this._options.noLocation&&(t.loc=new $t(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw fr(this._lexer.source,t.start,`Expected ${si(e)}, found ${oi(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==_r||t.value!==e)throw fr(this._lexer.source,t.start,`Expected "${e}", found ${oi(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===_r&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=e??this._lexer.token;return fr(this._lexer.source,t.start,`Unexpected ${oi(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(t.kind!==vr&&(++this._tokenCounter,void 0!==e&&this._tokenCounter>e))throw fr(this._lexer.source,t.start,`Document contains more than ${e} tokens. Parsing aborted.`)}};function oi(e){const t=e.value;return si(e.kind)+(null!=t?` "${t}"`:"")}function si(e){return function(e){return"!"===e||e===xr||"&"===e||e===kr||e===wr||"."===e||e===Sr||e===Nr||e===Tr||e===Cr||e===Er||e===Ir||e===Or||e===zr||e===Ar}(e)?`"${e}"`:e}var li=function(e,t){return li=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},li(e,t)};function ci(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}li(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ui=function(){return ui=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ui.apply(this,arguments)};function di(e,t){var n,r,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(rM){s=[6,rM],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function pi(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function hi(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function fi(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function mi(e){return this instanceof mi?(this.v=e,this):new mi(e)}function gi(e){return"function"==typeof e}function yi(e){var t=e(function(e){Error.call(e),e.stack=/* @__PURE__ */(new Error).stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var bi=yi(function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}});function vi(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var xi=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=pi(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(h){e={error:h}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var l=this.initialTeardown;if(gi(l))try{l()}catch(rM){i=rM instanceof bi?rM.errors:[rM]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var u=pi(c),d=u.next();!d.done;d=u.next()){var p=d.value;try{Si(p)}catch(f){i=null!=i?i:[],f instanceof bi?i=fi(fi([],hi(i)),hi(f.errors)):i.push(f)}}}catch(m){n={error:m}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new bi(i)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Si(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&vi(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&vi(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ki=xi.EMPTY;function wi(e){return e instanceof xi||e&&"closed"in e&&gi(e.remove)&&gi(e.add)&&gi(e.unsubscribe)}function Si(e){gi(e)?e():e.unsubscribe()}var Ni={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Ni.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,fi([e,t],hi(n))):setTimeout.apply(void 0,fi([e,t],hi(n)))},clearTimeout:function(e){var t=Ni.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Ti(e){Ni.setTimeout(function(){throw e})}function Ci(){}var Ei=Ii("C",void 0,void 0);function Ii(e,t,n){return{kind:e,value:t,error:n}}function Oi(e){e()}var zi=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,wi(t)&&t.add(n)):n.destination=Mi,n}return ci(t,e),t.create=function(e,t,n){return new _i(e,t,n)},t.prototype.next=function(e){this.isStopped?Pi(function(e){return Ii("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Pi(Ii("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Pi(Ei,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(xi);Function.prototype.bind;var Ai=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){Di(n)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){Di(n)}else Di(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Di(t)}},e}(),_i=function(e){function t(t,n,r){var i,a=e.call(this)||this;return i=gi(t)||!t?{next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:t,a.destination=new Ai(i),a}return ci(t,e),t}(zi);function Di(e){Ti(e)}function Pi(e,t){var n=null;n&&Ni.setTimeout(function(){return n(e,t)})}var Mi={closed:!0,next:Ci,error:function(e){throw e},complete:Ci},Ri="function"==typeof Symbol&&Symbol.observable||"@@observable";function Li(e){return e}var ji=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,i=this,a=(r=e)&&r instanceof zi||function(e){return e&&gi(e.next)&&gi(e.error)&&gi(e.complete)}(r)&&wi(r)?e:new _i(e,t,n);return Oi(function(){var e=i,t=e.operator,n=e.source;a.add(t?t.call(a,n):n?i._subscribe(a):i._trySubscribe(a))}),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Fi(t))(function(t,r){var i=new _i({next:function(t){try{e(t)}catch(n){r(n),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[Ri]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0===(e=t).length?Li:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Fi(e))(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function Fi(e){var t;return null!==(t=null!=e?e:void 0)&&void 0!==t?t:Promise}function $i(e){return function(t){if(function(e){return gi(null==e?void 0:e.lift)}(t))return t.lift(function(t){try{return e(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function Vi(e,t,n,r,i){return new qi(e,t,n,r,i)}var qi=function(e){function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(r){t.error(r)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return ci(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(zi),Bi=yi(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Ui=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return ci(t,e),t.prototype.lift=function(e){var t=new Hi(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Bi},t.prototype.next=function(e){var t=this;Oi(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=pi(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(o){n={error:o}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Oi(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Oi(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?ki:(this.currentObservers=null,a.push(e),new xi(function(){t.currentObservers=null,vi(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new ji;return e.source=this,e},t.create=function(e,t){return new Hi(e,t)},t}(ji),Hi=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return ci(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:ki},t}(Ui),Wi=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return ci(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Ui),Gi={now:function(){return(Gi.delegate||Date).now()},delegate:void 0},Ji=function(e){function t(t,n,r){void 0===t&&(t=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Gi);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return ci(t,e),t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!e.closed;i+=n?1:2)e.next(r[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,l=1;l<r.length&&r[l]<=o;l+=2)s=l;s&&r.splice(0,s+1)}},t}(Ui),Ki=function(e){function t(t,n){return e.call(this)||this}return ci(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(xi),Qi={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=Qi.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,fi([e,t],hi(n))):setInterval.apply(void 0,fi([e,t],hi(n)))},clearInterval:function(e){var t=Qi.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},Yi=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return ci(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),Qi.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&Qi.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)/* @__PURE__ */return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(rM){r=!0,n=rM||/* @__PURE__ */new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,vi(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Ki),Xi=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=Gi.now,e}(),Zi=new(function(e){function t(t,n){void 0===n&&(n=Xi.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return ci(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Xi))(Yi),ea=new ji(function(e){return e.complete()});function ta(e){return e&&gi(e.schedule)}function na(e){return ta((t=e)[t.length-1])?e.pop():void 0;var t}var ra=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function ia(e){return gi(null==e?void 0:e.then)}function aa(e){return gi(e[Ri])}function oa(e){return Symbol.asyncIterator&&gi(null==e?void 0:e[Symbol.asyncIterator])}function sa(e){/* @__PURE__ */
2
2
  return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var la,ca="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function ua(e){return gi(null==e?void 0:e[ca])}function da(e){return function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){i[e]&&(r[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||s(e,t)})},t&&(r[e]=t(r[e])))}function s(e,t){try{!function(e){e.value instanceof mi?Promise.resolve(e.value.v).then(l,c):u(a[0][2],e)}(i[e](t))}catch(rM){u(a[0][3],rM)}}function l(e){s("next",e)}function c(e){s("throw",e)}function u(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}(this,arguments,function(){var t,n,r;return di(this,function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,mi(t.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,mi(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,mi(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function pa(e){return gi(null==e?void 0:e.getReader)}function ha(e){if(e instanceof ji)return e;if(null!=e){if(aa(e))return i=e,new ji(function(e){var t=i[Ri]();if(gi(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")});if(ra(e))return r=e,new ji(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()});if(ia(e))return n=e,new ji(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,Ti)});if(oa(e))return fa(e);if(ua(e))return t=e,new ji(function(e){var n,r;try{for(var i=pi(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()});if(pa(e))return fa(da(e))}var t,n,r,i;throw sa(e)}function fa(e){return new ji(function(t){(function(e,t){var n,r,i,a;return function(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{l(r.next(e))}catch(rM){a(rM)}}function s(e){try{l(r.throw(e))}catch(rM){a(rM)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}l((r=r.apply(e,t||[])).next())})}(this,void 0,void 0,function(){var o,s;return di(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=pi(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}}}(e),l.label=1;case 1:return[4,n.next()];case 2:if((r=l.sent()).done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})})(e,t).catch(function(e){return t.error(e)})})}function ma(e,t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function ga(e,t){return void 0===t&&(t=0),$i(function(n,r){n.subscribe(Vi(r,function(n){return ma(r,e,function(){return r.next(n)},t)},function(){return ma(r,e,function(){return r.complete()},t)},function(n){return ma(r,e,function(){return r.error(n)},t)}))})}function ya(e,t){return void 0===t&&(t=0),$i(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function ba(e,t){if(!e)throw new Error("Iterable cannot be null");return new ji(function(n){ma(n,t,function(){var r=e[Symbol.asyncIterator]();ma(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function va(e,t){return t?function(e,t){if(null!=e){if(aa(e))return function(e,t){return ha(e).pipe(ya(t),ga(t))}(e,t);if(ra(e))return function(e,t){return new ji(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}(e,t);if(ia(e))return function(e,t){return ha(e).pipe(ya(t),ga(t))}(e,t);if(oa(e))return ba(e,t);if(ua(e))return function(e,t){return new ji(function(n){var r;return ma(n,t,function(){r=e[ca](),ma(n,t,function(){var e,t,i;try{t=(e=r.next()).value,i=e.done}catch(a){return void n.error(a)}i?n.complete():n.next(t)},0,!0)}),function(){return gi(null==r?void 0:r.return)&&r.return()}})}(e,t);if(pa(e))return function(e,t){return ba(da(e),t)}(e,t)}throw sa(e)}(e,t):ha(e)}function xa(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return va(e,na(e))}function ka(e,t){var n=gi(e)?e:function(){return e},r=function(e){return e.error(n())};return new ji(t?function(e){return t.schedule(r,0,e)}:r)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(la||(la={}));var wa=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){return function(e,t){var n,r,i,a=e,o=a.kind,s=a.value,l=a.error;if("string"!=typeof o)throw new TypeError('Invalid notification, missing "kind"');"N"===o?null===(n=t.next)||void 0===n||n.call(t,s):"E"===o?null===(r=t.error)||void 0===r||r.call(t,l):null===(i=t.complete)||void 0===i||i.call(t)}(this,e)},e.prototype.do=function(e,t,n){var r=this,i=r.kind,a=r.value,o=r.error;return"N"===i?null==e?void 0:e(a):"E"===i?null==t?void 0:t(o):null==n?void 0:n()},e.prototype.accept=function(e,t,n){var r;return gi(null===(r=e)||void 0===r?void 0:r.next)?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){var e=this,t=e.kind,n=e.value,r=e.error,i="N"===t?xa(n):"E"===t?ka(function(){return r}):"C"===t?ea:0;if(!i)throw new TypeError("Unexpected notification kind "+t);return i},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e}();yi(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function Sa(e,t){return $i(function(n,r){var i=0;n.subscribe(Vi(r,function(n){r.next(e.call(t,n,i++))}))})}function Na(e,t,n){return void 0===n&&(n=1/0),gi(t)?Na(function(n,r){return Sa(function(e,i){return t(n,e,r,i)})(ha(e(n,r)))},n):("number"==typeof t&&(n=t),$i(function(t,r){return function(e,t,n,r){var i=[],a=0,o=0,s=!1,l=function(){!s||i.length||a||t.complete()},c=function(e){return a<r?u(e):i.push(e)},u=function(e){a++;var s=!1;ha(n(e,o++)).subscribe(Vi(t,function(e){t.next(e)},function(){s=!0},void 0,function(){if(s)try{a--;for(var e=function(){var e=i.shift();u(e)};i.length&&a<r;)e();l()}catch(n){t.error(n)}}))};return e.subscribe(Vi(t,c,function(){s=!0,l()})),function(){}}(t,r,e,n)}))}function Ta(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(void 0===(n=1)&&(n=1/0),Na(Li,n))(va(e,na(e)));var n}function Ca(e,t){return $i(function(n,r){var i=0;n.subscribe(Vi(r,function(n){return e.call(t,n,i++)&&r.next(n)}))})}function Ea(e){return $i(function(t,n){var r,i=null,a=!1;i=t.subscribe(Vi(n,void 0,void 0,function(o){r=ha(e(o,Ea(e)(t))),i?(i.unsubscribe(),i=null,r.subscribe(n)):a=!0})),a&&(i.unsubscribe(),i=null,r.subscribe(n))})}function Ia(e,t){return e===t}function Oa(e){void 0===e&&(e={});var t=e.connector,n=void 0===t?function(){return new Ui}:t,r=e.resetOnError,i=void 0===r||r,a=e.resetOnComplete,o=void 0===a||a,s=e.resetOnRefCountZero,l=void 0===s||s;return function(e){var t,r,a,s=0,c=!1,u=!1,d=function(){null==r||r.unsubscribe(),r=void 0},p=function(){d(),t=a=void 0,c=u=!1},h=function(){var e=t;p(),null==e||e.unsubscribe()};return $i(function(e,f){s++,u||c||d();var m=a=null!=a?a:n();f.add(function(){0!==--s||u||c||(r=za(h,l))}),m.subscribe(f),!t&&s>0&&(t=new _i({next:function(e){return m.next(e)},error:function(e){u=!0,d(),r=za(p,i,e),m.error(e)},complete:function(){c=!0,d(),r=za(p,o),m.complete()}}),ha(e).subscribe(t))})(e)}}function za(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==t){if(!1!==t){var i=new _i({next:function(){i.unsubscribe(),e()}});return ha(t.apply(void 0,fi([],hi(n)))).subscribe(i)}}else e()}function Aa(e,t,n){var r,i,a,o,s=!1;return e&&"object"==typeof e?(r=e.bufferSize,o=void 0===r?1/0:r,i=e.windowTime,t=void 0===i?1/0:i,s=void 0!==(a=e.refCount)&&a,n=e.scheduler):o=null!=e?e:1/0,Oa({connector:function(){return new Ji(o,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function _a(e,t,n){var r=gi(e)||t||n?{next:e,error:t,complete:n}:e;return r?$i(function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var i=!0;e.subscribe(Vi(t,function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)},function(){var e;i=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()},function(e){var n;i=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)},function(){var e,t;i&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)}))}):Li}function Da(e){try{return e()}catch{}}var Pa=Da(()=>globalThis)||Da(()=>window)||Da(()=>self)||Da(()=>global)||Da(function(){return Da.constructor("return this")()}),Ma="4.3.0",Ra=/* @__PURE__ */new Map;function La(e){const t=Ra.get(e)||1;return Ra.set(e,t+1),`${e}:${t}:${Math.random().toString(36).slice(2)}`}var ja="Invariant Violation",Fa=class e extends Error{constructor(t=ja){super(t),this.name=ja,Object.setPrototypeOf(this,e.prototype)}},$a=["debug","log","warn","error","silent"],Va=$a.indexOf("silent");function qa(e,...t){if(!e)throw Ua(...t)}function Ba(e){return function(t,...n){if($a.indexOf(e)>=Va){const r=console[e]||console.log;if("number"==typeof t){const e=t;(t=Ga(e))||(t=Ja(e,n),n=[])}r(t,...n)}}}function Ua(e,...t){return new Fa(Ga(e,t)||Ja(e,t))}qa.debug=Ba("debug"),qa.log=Ba("log"),qa.warn=Ba("warn"),qa.error=Ba("error");var Ha=Symbol.for("ApolloErrorMessageHandler_"+Ma);function Wa(e){if("string"==typeof e)return e;try{return function(e,t=0){const n=La("stringifyForDisplay");return JSON.stringify(e,(e,t)=>void 0===t?n:t,t).split(JSON.stringify(n)).join("<undefined>")}(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Ga(e,t=[]){if(e)return Pa[Ha]&&Pa[Ha](e,t.map(Wa))}function Ja(e,t=[]){if(e)return"string"==typeof e?t.reduce((e,t)=>e.replace(/%[sdfo]/,Wa(t)),e):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:Ma,message:e,args:t.map(Wa)}))}`}function Ka(e,t,n,r){if("IntValue"===n.kind||"FloatValue"===n.kind)e[t.value]=Number(n.value);else if("BooleanValue"===n.kind||"StringValue"===n.kind)e[t.value]=n.value;else if("ObjectValue"===n.kind){const i={};n.fields.map(e=>Ka(i,e.name,e.value,r)),e[t.value]=i}else if("Variable"===n.kind){const i=(r||{})[n.name.value];e[t.value]=i}else if("ListValue"===n.kind)e[t.value]=n.values.map(e=>{const n={};return Ka(n,t,e,r),n[t.value]});else if("EnumValue"===n.kind)e[t.value]=n.value;else{if("NullValue"!==n.kind)throw Ua(21,t.value,n.kind);e[t.value]=null}}function Qa(e,t){if(e.arguments&&e.arguments.length){const n={};return e.arguments.forEach(({name:e,value:r})=>Ka(n,e,r,t)),n}return null}var Ya=Symbol.for("apollo.cacheSize"),Xa={...Pa[Ya]};function Za(e,t){return e.definitions.find(e=>"OperationDefinition"===e.kind&&!!e.name)?.name.value??t}var eo=()=>Object.create(null),{forEach:to,slice:no}=Array.prototype,{hasOwnProperty:ro}=Object.prototype,io=class e{constructor(e=!0,t=eo){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return to.call(e,e=>t=t.getChildTrie(e)),ro.call(t,"data")?t.data:t.data=this.makeData(no.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let n=0,r=e.length;t&&n<r;++n){const r=t.mapFor(e[n],!1);t=r&&r.get(e[n])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const n=e[0],r=this.mapFor(n,!1),i=r&&r.get(n);i&&(t=i.removeArray(no.call(e,1)),i.data||i.weak||i.strong&&i.strong.size||r.delete(n))}else t=this.data,delete this.data;return t}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new e(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(e)?this.weak||(t?this.weak=/* @__PURE__ */new WeakMap:void 0):this.strong||(t?this.strong=/* @__PURE__ */new Map:void 0)}};function ao(){}var oo=class{constructor(e=1/0,t=ao){this.max=e,this.dispose=t,this.map=/* @__PURE__ */new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)}};function so(){}var lo=so,co="undefined"!=typeof WeakRef?WeakRef:function(e){return{deref:()=>e}},uo="undefined"!=typeof WeakMap?WeakMap:Map,po="undefined"!=typeof FinalizationRegistry?FinalizationRegistry:function(){return{register:so,unregister:so}},ho=class{constructor(e=1/0,t=lo){this.max=e,this.dispose=t,this.map=new uo,this.newest=null,this.oldest=null,this.unfinalizedNodes=/* @__PURE__ */new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const e=this.unfinalizedNodes.values();for(let t=0;t<10024;t++){const t=e.next().value;if(!t)break;this.unfinalizedNodes.delete(t);const n=t.key;delete t.key,t.keyRef=new co(n),this.registry.register(n,t,t)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new po(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:e,newer:n}=t;n&&(n.older=e),e&&(e.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t}set(e,t){let n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return!!t&&(this.deleteNode(t),!0)}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}},fo=/* @__PURE__ */new WeakSet;function mo(e){e.size<=(e.max||-1)||fo.has(e)||(fo.add(e),setTimeout(()=>{e.clean(),fo.delete(e)},100))}var go=function(e,t){const n=new ho(e,t);return n.set=function(e,t){const n=ho.prototype.set.call(this,e,t);return mo(this),n},n},yo=function(e,t){const n=new oo(e,t);return n.set=function(e,t){const n=oo.prototype.set.call(this,e,t);return mo(this),n},n};function bo(e,{max:t,makeCacheKey:n=e=>e}){const r=new io(!0),i=new go(t);return(...t)=>{const a=r.lookupArray(n(t)),o=i.get(a);if(o){if(o.error)throw o.error;return o.result}const s=i.set(a,{});try{return s.result=e(...t)}catch(l){throw s.error=l,l}}}var vo=bo((e,t)=>{qa(e&&"Document"===e.kind,1);const n=e.definitions.filter(e=>"OperationDefinition"===e.kind);t&&qa(1==n.length&&n[0].operation===t,4,t,t,n[0].operation),ir(e,{Field(t,r,i,a){if(t.alias&&("__typename"===t.alias.value||t.alias.value.startsWith("__ac_"))&&t.alias.value!==t.name.value){let r=e,i=[];for(const e of a)r=r[e],"Field"===r.kind&&i.push(r.alias?.value||r.name.value);throw i.splice(-1,1,t.name.value),Ua(5,t.alias.value,i.join("."),n[0].operation,Za(e,"(anonymous)"))}}})},{max:Xa.checkDocument||2e3}),{toString:xo}=Object.prototype;function ko(e=[]){const t={};return e.forEach(e=>{t[e.name.value]=e}),t}function wo(e){return e.definitions.filter(e=>"FragmentDefinition"===e.kind)}function So(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{const n=e.name.value;if("function"==typeof t)return t(n);const r=t&&t[n];return qa(r,11,n),r}default:return null}}function No(e){let t;vo(e);for(let n of e.definitions){if("OperationDefinition"===n.kind)return n;"FragmentDefinition"!==n.kind||t||(t=n)}if(t)return t;throw Ua(14)}function To(e){return vo(e),e.definitions.filter(e=>"OperationDefinition"===e.kind)[0]}function Co(e){return"Field"===e.kind}function Eo(e){return e.match(/^\[(.*)\]$/)}function Io(e){return e.alias?e.alias.value:e.name.value}function Oo(e){return e.replace(/[[\]]/g,"")}function zo(...e){const t={};return e.forEach(e=>{e&&Reflect.ownKeys(e).forEach(n=>{const r=e[n];void 0!==r&&(t[n]=r)})}),t}function Ao(e){return null!==e&&"object"==typeof e}var{hasOwnProperty:_o}=Object.prototype,Do=function(e,t,n){return this.merge(e[n],t[n])},Po=e=>isNaN(+e)?{}:[],Mo=class{options;reconciler;constructor(e={}){this.options=e,this.reconciler=e.reconciler||Do}merge(e,t,n={}){const r=n.atPath;if(r?.length){const[i,...a]=r;void 0===e&&(e=Po(i));let o=e[i];void 0===o&&a.length&&(o=Po(a[0]));const s=this.merge(o,t,{...n,atPath:a});return o!==s&&((e=this.shallowCopyForMerge(e))[i]=s),e}return Array.isArray(e)&&Array.isArray(t)&&"truncate"===this.options.arrayMerge&&e.length>t.length&&(e=e.slice(0,t.length),this.pastCopies.add(e)),Ao(t)&&Ao(e)?(Object.keys(t).forEach(n=>{if(_o.call(e,n)){const r=e[n];if(t[n]!==r){const i=this.reconciler(e,t,n);i!==r&&((e=this.shallowCopyForMerge(e))[n]=i)}}else(e=this.shallowCopyForMerge(e))[n]=t[n]}),e):t}isObject=Ao;pastCopies=/* @__PURE__ */new Set;shallowCopyForMerge(e){return Ao(e)&&(this.pastCopies.has(e)||(e=Array.isArray(e)?e.slice(0):{__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}};function Ro(e){const t={},n=e&&e.variableDefinitions;return n&&n.length&&n.forEach(e=>{e.defaultValue&&Ka(t,e.variable.name,e.defaultValue)}),t}function Lo(e,t){let n=t;const r=[];return e.definitions.forEach(e=>{if("OperationDefinition"===e.kind)throw Ua(12,e.operation,e.name?` named '${e.name.value}'`:"");"FragmentDefinition"===e.kind&&r.push(e)}),void 0===n&&(qa(1===r.length,13,r.length),n=r[0].name.value),{...e,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}},...e.definitions]}}var jo,Fo=Object.assign(function(e){return JSON.stringify(e,$o)},{reset(){jo=new yo(Xa.canonicalStringify||1e3)}});function $o(e,t){if(t&&"object"==typeof t){const e=Object.getPrototypeOf(t);if(e===Object.prototype||null===e){const n=Object.keys(t);if(n.every(Vo))return t;const r=JSON.stringify(n);let i=jo.get(r);if(!i){n.sort();const e=JSON.stringify(n);i=jo.get(e)||n,jo.set(r,i),jo.set(e,i)}const a=Object.create(e);return i.forEach(e=>{a[e]=t[e]}),a}}return t}function Vo(e,t,n){return 0===t||n[t-1]<=e}Fo.reset();var qo=["connection","include","skip","client","rest","export","nonreactive","stream"],Bo=Fo,Uo=Object.assign(function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){const e=n.connection.filter?n.connection.filter:[];e.sort();const r={};e.forEach(e=>{r[e]=t[e]});const i=Bo(r);if("{}"!==i)return`${n.connection.key}(${i})`}return n.connection.key}let r=e;if(t){const e=Bo(t);"{}"!==e&&(r+=`(${e})`)}return n&&Object.keys(n).forEach(e=>{-1===qo.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?r+=`@${e}(${Bo(n[e])})`:r+=`@${e}`)}),r},{setStringify(e){const t=Bo;return Bo=e,t}});function Ho(e){return!!e.errors?.length}function Wo(e,t,n){const r=new Set(e),i=r.size;return ir(t,{Directive(e){if(r.delete(e.name.value)&&(!n||!r.size))return rr}}),n?!r.size:r.size<i}function Go(e){let t=!1;return ir(e,{Directive:{enter(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some(e=>"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value),t))return rr}}}),t}var Jo=Array.isArray,Ko=bo(function(e,t){return!!e.directives?.some(e=>{if("defer"!==e.name.value)return!1;for(const n of e.arguments??[])if("if"===n.name.value)switch(n.value.kind){case dn:return n.value.value;case sn:return!!t?.[n.value.name.value]}return!0})},{max:Xa.isDeferredFragment||2e3,makeCacheKey:([e,t])=>[e,Fo(t)]});function Qo(e){return Array.isArray(e)&&e.length>0}function Yo(e){return null!==e&&"object"==typeof e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}var Xo=bo(function(e,t){return!!e.directives?.some(e=>{if("stream"!==e.name.value)return!1;for(const n of e.arguments??[])if("if"===n.name.value)switch(n.value.kind){case dn:return n.value.value;case sn:return!!t?.[n.value.name.value]}return!0})},{max:Xa.isStreamField||2e3,makeCacheKey:([e,t])=>[e,Fo(t)]}),Zo=null,es={},ts=1;function ns(e){try{return e()}catch(t){}}var rs="@wry/context:Slot",is=ns(()=>globalThis)||ns(()=>global)||Object.create(null),as=is[rs]||Array[rs]||function(e){try{Object.defineProperty(is,rs,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(class{constructor(){this.id=["slot",ts++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Zo;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===es)break;return e!==Zo&&(Zo.slots[this.id]=t),!0}return Zo&&(Zo.slots[this.id]=es),!1}getValue(){if(this.hasValue())return Zo.slots[this.id]}withValue(e,t,n,r){const i={__proto__:null,[this.id]:e},a=Zo;Zo={parent:a,slots:i};try{return t.apply(r,n)}finally{Zo=a}}static bind(e){const t=Zo;return function(){const n=Zo;try{return Zo=t,e.apply(this,arguments)}finally{Zo=n}}}static noContext(e,t,n){if(!Zo)return e.apply(n,t);{const r=Zo;try{return Zo=null,e.apply(n,t)}finally{Zo=r}}}}),{bind:os,noContext:ss}=as,ls=new as,{hasOwnProperty:cs}=Object.prototype,us=Array.from||function(e){const t=[];return e.forEach(e=>t.push(e)),t};function ds(e){const{unsubscribe:t}=e;"function"==typeof t&&(e.unsubscribe=void 0,t())}var ps=[];function hs(e,t){if(!e)throw new Error(t||"assertion failure")}function fs(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function ms(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function gs(e){return e.slice(0)}var ys=class e{constructor(t){this.fn=t,this.parents=/* @__PURE__ */new Set,this.childValues=/* @__PURE__ */new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}peek(){if(1===this.value.length&&!xs(this))return bs(this),this.value[0]}recompute(e){return hs(!this.recomputing,"already recomputing"),bs(this),xs(this)?function(e,t){return Es(e),ls.withValue(e,vs,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{ds(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(rM){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,xs(e)||ws(e)}(e),ms(e.value)}(this,e):ms(this.value)}setDirty(){this.dirty||(this.dirty=!0,ks(this),ds(this))}dispose(){this.setDirty(),Es(this),Ss(this,(e,t)=>{e.setDirty(),Is(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=ps.pop()||/* @__PURE__ */new Set),this.deps.add(e)}forgetDeps(){this.deps&&(us(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),ps.push(this.deps),this.deps=null)}};function bs(e){const t=ls.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),xs(e)?Ns(t,e):Ts(t,e),t}function vs(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&1===e.value.length&&(r=gs(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!fs(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch(i){}}catch(rM){e.value[1]=rM}e.recomputing=!1}function xs(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function ks(e){Ss(e,Ns)}function ws(e){Ss(e,Ts)}function Ss(e,t){const n=e.parents.size;if(n){const r=us(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function Ns(e,t){hs(e.childValues.has(t)),hs(xs(t));const n=!xs(e);if(e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=ps.pop()||/* @__PURE__ */new Set;e.dirtyChildren.add(t),n&&ks(e)}function Ts(e,t){hs(e.childValues.has(t)),hs(!xs(t));const n=e.childValues.get(t);0===n.length?e.childValues.set(t,gs(t.value)):fs(n,t.value)||e.setDirty(),Cs(e,t),xs(e)||ws(e)}function Cs(e,t){const n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(ps.length<100&&ps.push(n),e.dirtyChildren=null))}function Es(e){e.childValues.size>0&&e.childValues.forEach((t,n)=>{Is(e,n)}),e.forgetDeps(),hs(null===e.dirtyChildren)}function Is(e,t){t.parents.delete(e),e.childValues.delete(t),Cs(e,t)}ys.count=0;var Os,zs={setDirty:!0,dispose:!0,forget:!0};function As(e){const t=/* @__PURE__ */new Map,n=e&&e.subscribe;function r(e){const r=ls.getValue();if(r){let i=t.get(e);i||t.set(e,i=/* @__PURE__ */new Set),r.dependOn(i),"function"==typeof n&&(ds(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){const r=t.get(e);if(r){const i=n&&cs.call(zs,n)?n:"setDirty";us(r).forEach(e=>e[i]()),t.delete(e),ds(r)}},r}function _s(...e){return(Os||(Os=new io("function"==typeof WeakMap))).lookupArray(e)}var Ds=/* @__PURE__ */new Set;function Ps(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=_s,normalizeResult:i,subscribe:a,cache:o=oo}=Object.create(null)){const s="function"==typeof o?new o(t,e=>e.dispose()):o,l=function(){const t=r.apply(null,n?n.apply(null,arguments):arguments);if(void 0===t)return e.apply(null,arguments);let o=s.get(t);o||(s.set(t,o=new ys(e)),o.normalizeResult=i,o.subscribe=a,o.forget=()=>s.delete(t));const l=o.recompute(Array.prototype.slice.call(arguments));return s.set(t,o),Ds.add(s),ls.hasValue()||(Ds.forEach(e=>e.clean()),Ds.clear()),l};function c(e){const t=e&&s.get(e);t&&t.setDirty()}function u(e){const t=e&&s.get(e);if(t)return t.peek()}function d(e){return!!e&&s.delete(e)}return Object.defineProperty(l,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:a,cache:s}),l.dirtyKey=c,l.dirty=function(){c(r.apply(null,arguments))},l.peekKey=u,l.peek=function(){return u(r.apply(null,arguments))},l.forgetKey=d,l.forget=function(){return d(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(l)}function Ms(e){return{__ref:String(e)}}function Rs(e){let t=e[0]||{};const n=e.length;if(n>1){const r=new Mo;for(let i=1;i<n;++i)t=r.merge(t,e[i])}return t}function Ls(e,t){return zo(e,t,t.variables&&{variables:zo({...e&&e.variables,...t.variables})})}function js(e){return e.catch(()=>{}),e}function Fs(e,t){vo(t);const n=$s(""),r=$s(""),i=e=>{for(let t,i=0;i<e.length&&(t=e[i]);++i)if(!Jo(t)){if("OperationDefinition"===t.kind)return n(t.name&&t.name.value);if("FragmentDefinition"===t.kind)return r(t.name.value)}return qa.error(16),null};let a=0;for(let m=t.definitions.length-1;m>=0;--m)"OperationDefinition"===t.definitions[m].kind&&++a;const o=function(e){const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;return e.forEach(e=>{e&&(e.name?t.set(e.name,e):e.test&&n.set(e.test,e))}),e=>{let r=t.get(e.name.value);return!r&&n.size&&n.forEach((t,n)=>{n(e)&&(r=t)}),r}}(e),s=e=>Qo(e)&&e.map(o).some(e=>e&&e.remove),l=/* @__PURE__ */new Map;let c=!1;const u={enter(e){if(s(e.directives))return c=!0,null}},d=ir(t,{Field:u,InlineFragment:u,VariableDefinition:{enter:()=>!1},Variable:{enter(e,t,n,r,a){const o=i(a);o&&o.variables.add(e.name.value)}},FragmentSpread:{enter(e,t,n,r,a){if(s(e.directives))return c=!0,null;const o=i(a);o&&o.fragmentSpreads.add(e.name.value)}},FragmentDefinition:{enter(e,t,n,r){l.set(JSON.stringify(r),e)},leave:(e,t,n,i)=>e===l.get(JSON.stringify(i))?e:a>0&&e.selectionSet.selections.every(e=>"Field"===e.kind&&"__typename"===e.name.value)?(r(e.name.value).removed=!0,c=!0,null):void 0},Directive:{leave(e){if(o(e))return c=!0,null}}});if(!c)return t;const p=e=>(e.transitiveVars||(e.transitiveVars=new Set(e.variables),e.removed||e.fragmentSpreads.forEach(t=>{p(r(t)).transitiveVars.forEach(t=>{e.transitiveVars.add(t)})})),e),h=/* @__PURE__ */new Set;d.definitions.forEach(e=>{"OperationDefinition"===e.kind?p(n(e.name&&e.name.value)).fragmentSpreads.forEach(e=>{h.add(e)}):"FragmentDefinition"!==e.kind||0!==a||r(e.name.value).removed||h.add(e.name.value)}),h.forEach(e=>{p(r(e)).fragmentSpreads.forEach(e=>{h.add(e)})});const f={enter(e){if(t=e.name.value,!h.has(t)||r(t).removed)return null;var t}};return function(e){return Vs(To(e)||function(e){qa("Document"===e.kind,8),qa(e.definitions.length<=1,9);const t=e.definitions[0];return qa("FragmentDefinition"===t.kind,10),t}(e),ko(wo(e)))?null:e}(ir(d,{FragmentSpread:f,FragmentDefinition:f,OperationDefinition:{leave(e){if(e.variableDefinitions){const t=p(n(e.name&&e.name.value)).transitiveVars;if(t.size<e.variableDefinitions.length)return{...e,variableDefinitions:e.variableDefinitions.filter(e=>t.has(e.variable.name.value))}}}}}))}function $s(e){const t=/* @__PURE__ */new Map;return function(n=e){let r=t.get(n);return r||t.set(n,r={variables:/* @__PURE__ */new Set,fragmentSpreads:/* @__PURE__ */new Set}),r}}function Vs(e,t){return!e||e.selectionSet.selections.every(e=>"FragmentSpread"===e.kind&&Vs(t[e.name.value],t))}function qs(e){return ir(e,{FragmentSpread(e){if(!e.directives?.some(({name:e})=>"unmask"===e.value))return null}})}function Bs({directives:e},t){return!e||!e.length||function(e){const t=[];return e&&e.length&&e.forEach(e=>{if(!function({name:{value:e}}){return"skip"===e||"include"===e}(e))return;const n=e.arguments,r=e.name.value;qa(n&&1===n.length,18,r);const i=n[0];qa(i.name&&"if"===i.name.value,19,r);const a=i.value;qa(a&&("Variable"===a.kind||"BooleanValue"===a.kind),20,r),t.push({directive:e,ifArgument:i})}),t}(e).every(({directive:e,ifArgument:n})=>{let r=!1;return"Variable"===n.value.kind?(r=t&&t[n.value.name.value],qa(void 0!==r,17,e.name.value)):r=n.value.value,"skip"===e.name.value?!r:r})}function Us(e){return"dataState"in e?e:{...e,dataState:e.complete?"complete":null===e.result?"empty":"partial"}}function Hs(e){const t={data:e.data};return e.error&&(t.error=e.error),t}function Ws(e,t=()=>{}){return n=>new ji(r=>{let i=t();return n.subscribe({next(t){let n;try{n=e(t,i)}catch(rM){r.error(rM)}void 0!==n&&r.next(n)},error(e){r.error(e)},complete(){r.complete()}})})}var{toString:Gs,hasOwnProperty:Js}=Object.prototype,Ks=Function.prototype.toString,Qs=/* @__PURE__ */new Map;function Ys(e,t){try{return Xs(e,t)}finally{Qs.clear()}}function Xs(e,t){if(e===t)return!0;const n=Gs.call(e);if(n!==Gs.call(t))return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(nl(e,t))return!0;const n=Zs(e),r=Zs(t),i=n.length;if(i!==r.length)return!1;for(let e=0;e<i;++e)if(!Js.call(t,n[e]))return!1;for(let a=0;a<i;++a){const r=n[a];if(!Xs(e[r],t[r]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e===+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(nl(e,t))return!0;const r=e.entries(),i="[object Map]"===n;for(;;){const e=r.next();if(e.done)break;const[n,a]=e.value;if(!t.has(n))return!1;if(i&&!Xs(a,t.get(n)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let n=e.byteLength;if(n===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const n=Ks.call(e);return n===Ks.call(t)&&!function(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}(n,tl)}}return!1}function Zs(e){return Object.keys(e).filter(el,e)}function el(e){return void 0!==this[e]}var tl="{ [native code] }";function nl(e,t){let n=Qs.get(e);if(n){if(n.has(t))return!0}else Qs.set(e,n=/* @__PURE__ */new Set);return n.add(t),!1}function rl(e,{data:t,...n},{data:r,...i},a){return Ys(n,i)&&il(No(e).selectionSet,t,r,{fragmentMap:ko(wo(e)),variables:a})}function il(e,t,n,r){if(t===n)return!0;const i=/* @__PURE__ */new Set;return e.selections.every(e=>{if(i.has(e))return!0;if(i.add(e),!Bs(e,r.variables))return!0;if(al(e))return!0;if(Co(e)){const i=Io(e),a=t&&t[i],o=n&&n[i],s=e.selectionSet;if(!s)return Ys(a,o);const l=Array.isArray(a),c=Array.isArray(o);if(l!==c)return!1;if(l&&c){const e=a.length;if(o.length!==e)return!1;for(let t=0;t<e;++t)if(!il(s,a[t],o[t],r))return!1;return!0}return il(s,a,o,r)}{const i=So(e,r.fragmentMap);if(i)return!!al(i)||il(i.selectionSet,t,n,r)}})}function al(e){return!!e.directives&&e.directives.some(ol)}function ol(e){return"nonreactive"===e.name.value}var sl=bo(function(e,t,n){return function(e,t){let n,r;function i(e){return e!==n&&(n=e,r=t(n)),r}return Object.assign(e.pipe(Sa(i),Aa({bufferSize:1,refCount:!0})),{getCurrentResult:()=>i(e.getCurrentResult())})}(e,n)},{max:1,makeCacheKey:e=>e.slice(0,2)}),ll=Symbol.for("apollo.result.extensions"),cl=Symbol.for("apollo.result.streamInfo"),ul=Symbol.for("apollo.observableQuery.variablesUnknown"),dl=Symbol.for("apollo.cache.handleIncremental");function pl(...e){return _s.bind(null,...e)}var hl=class{isIncrementalResult(e){return!1}prepareRequest(e){return qa(!Wo(["defer","stream"],e.query),69),e}extractErrors(){}startRequest=void 0};function fl(e){return e}var ml,gl=class e{transform;cached;resultCache=/* @__PURE__ */new WeakSet;getCacheKey(e){return[e]}static identity(){return new e(fl,{cache:!1})}static split(t,n,r=e.identity()){return Object.assign(new e(e=>(t(e)?n:r).transformDocument(e),{cache:!1}),{left:n,right:r})}constructor(e,t={}){this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=!1!==t.cache,this.resetCache()}resetCache(){if(this.cached){const t=new io;this.performWork=Ps(e.prototype.performWork.bind(this),{makeCacheKey:e=>{const n=this.getCacheKey(e);if(n)return qa(Array.isArray(n),22),t.lookupArray(n)},max:Xa["documentTransform.cache"],cache:ho})}}performWork(e){return vo(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(t){return Object.assign(new e(e=>t.transformDocument(this.transformDocument(e)),{cache:!1}),{left:this,right:t})}left;right},yl=Object.assign(e=>{let t=ml.get(e);return t||(t=function(e){return ir(e,or)}(e),ml.set(e,t)),t},{reset(){ml=new go(Xa.print||2e3)}});function bl(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}yl.reset();var vl={kind:en,name:{kind:Kt,value:"__typename"}},xl=Object.assign(function(e){return ir(e,{SelectionSet:{enter(e,t,n){if(n&&"OperationDefinition"===n.kind)return;const{selections:r}=e;if(!r)return;if(r.some(e=>"Field"===e.kind&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))))return;const i=n;return"Field"===i.kind&&i.directives&&i.directives.some(e=>"export"===e.name.value)?void 0:{...e,selections:[...r,vl]}}}})},{added:e=>e===vl});function kl(e,t){return To(e)?.operation===t}function wl(e){return 7===e||8===e}function Sl(e){return!wl(e)}var Nl=class e{static empty(){return new e(()=>ea)}static from(t){if(0===t.length)return e.empty();const[n,...r]=t;return n.concat(...r)}static split(t,n,r=new e((e,t)=>t(e))){const i=new e((e,i)=>t(e)?n.request(e,i):r.request(e,i));return Object.assign(i,{left:n,right:r})}static execute(e,t,n){return e.request(function(e,{client:t}){const n={query:e.query,variables:e.variables||{},extensions:e.extensions||{},operationName:Za(e.query),operationType:To(e.query).operation};let r={...e.context};const i=()=>Object.freeze({...r});return Object.defineProperty(n,"setContext",{enumerable:!1,value:e=>{r="function"==typeof e?{...r,...e(i())}:{...r,...e}}}),Object.defineProperty(n,"getContext",{enumerable:!1,value:i}),Object.defineProperty(n,"client",{enumerable:!1,value:t}),n}(t,n),()=>ea)}static concat(...t){return e.from(t)}constructor(e){e&&(this.request=e)}split(t,n,r){return this.concat(e.split(t,n,r))}concat(...e){return 0===e.length?this:e.reduce(this.combine.bind(this),this)}combine(t,n){const r=new e((e,r)=>t.request(e,e=>n.request(e,r)));return Object.assign(r,{left:t,right:n})}request(e,t){throw Ua(67)}left;right},Tl=Nl.execute,Cl=class{assumeImmutableResults=!1;lookupFragment(e){return null}getRootTypename(e){return(t=e)[0].toUpperCase()+t.slice(1);var t}getScalar(e){}getScalarTypeForField(e,t){}configuresScalars(){return!1}serializeVariables(e,t){return t}batch(e){const t="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;let n;return this.performTransaction(()=>n=e.update(this),t),n}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}fragmentWatches=new io(!0);watchFragment(e){const{fragment:t,fragmentName:n,from:r}=e,i=this.getFragmentDoc(t,n),a=(Array.isArray(r)?r:[r]).map(e=>null==e?e:this.toCacheId(e));if(!Array.isArray(r)){const t=this.watchSingleFragment(a[0],i,e);return null===r?t:sl(t,Symbol.for("apollo.transform.individualResult"),e=>({...e,data:e.data??{}}))}let o;function s(e){const t=e.reduce((e,t,n)=>(e.data.push(t.data),e.complete&&=t.complete,e.dataState=e.complete?"complete":"partial",t.missing&&(e.missing||={},e.missing[n]=t.missing),e),{data:[],dataState:"complete",complete:!0});return Ys(o,t)||(o=t),o}if(0===a.length)return zl;let l=!1;const c=a.map(t=>this.watchSingleFragment(t,i,e)),u=function(e){return 0===e.length?ea:new ji(t=>{const{length:n}=e,r=new Array(n),i=/* @__PURE__ */new Map;e.forEach((e,t)=>{i.has(e)||i.set(e,/* @__PURE__ */new Set),i.get(e).add(t)});let a,o=i.size,s=i.size;i.forEach((n,i)=>{let l=!1;const c=i.subscribe({next:o=>{n.forEach(e=>r[e]=o),l||(l=!0,s--),s||(a||=new Set(e.filter(e=>e.dirty)),a.delete(i),a.size||(t.next(r.slice()),a=void 0))},complete:()=>{o--,o||t.complete()},error:t.error.bind(t)});t.add(c)})})}(c).pipe(Sa(s),_a({subscribe:()=>l=!0,unsubscribe:()=>l=!1}),Aa({bufferSize:1,refCount:!0}));return Object.assign(u,{getCurrentResult:()=>l&&o?o:s(c.map(e=>e.getCurrentResult()))})}onAfterBroadcast=e=>e();watchSingleFragment(e,t,n){if(null===e)return Il;const{optimistic:r=!0,variables:i}=n,a=[t,Fo({id:e,optimistic:r,variables:i})],o=this.fragmentWatches.lookupArray(a);if(!o.observable){let c,u=!1;function d(e){const r=e.result;return c&&rl(t,{data:c.data},{data:r},n.variables)||(c={data:r,dataState:e.complete?"complete":"partial",complete:e.complete},e.missing&&(c.missing=e.missing.missing)),c}const p=new ji(n=>{u=!0;const o=this.watch({variables:i,returnPartialData:!0,id:e,query:t,optimistic:r,immediate:!0,callback:e=>{p.dirty=!0,this.onAfterBroadcast(()=>{n.next(d(e)),p.dirty=!1})}});return()=>{u=!1,o(),this.fragmentWatches.removeArray(a)}}).pipe((void 0===l&&(l=Li),s=null!=s?s:Ia,$i(function(e,t){var n,r=!0;e.subscribe(Vi(t,function(e){var i=l(e);!r&&s(n,i)||(r=!1,n=i,t.next(e))}))})),Oa({connector:()=>new Ji(1),resetOnRefCountZero:()=>function(e,t,n){void 0===e&&(e=0),void 0===n&&(n=Zi);var r=-1;return null!=t&&(ta(t)?n=t:r=t),new ji(function(t){var i,a=(i=e)instanceof Date&&!isNaN(i)?+e-n.now():e;a<0&&(a=0);var o=0;return n.schedule(function(){t.closed||(t.next(o++),0<=r?this.schedule(void 0,r):t.complete())},a)})}(0)}));o.observable=Object.assign(p,{dirty:!1,getCurrentResult:()=>u&&c?c:d(this.diff({id:e,query:t,returnPartialData:!0,optimistic:r,variables:i}))})}var s,l;return o.observable}getFragmentDoc=Ps(Lo,{max:Xa["cache.fragmentQueryDocuments"]||1e3,cache:ho,makeCacheKey:pl(this)});readFragment(e,t=!!e.optimistic){const n=void 0!==e.from?this.toCacheId(e.from):e.id;return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:n,optimistic:t})}writeQuery({id:e,data:t,...n}){return this.write(Object.assign(n,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({data:e,fragment:t,fragmentName:n,...r}){const i=void 0!==r.from?this.toCacheId(r.from):r.id;return this.write(Object.assign(r,{query:this.getFragmentDoc(t,n),dataId:i,result:e}))}updateQuery(e,t){return this.batch({update(n){const r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery({...e,data:i}),i)}})}updateFragment(e,t){return this.batch({update(n){const r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment({...e,data:i}),i)}})}toCacheId(e){return"string"==typeof e?e:this.identify(e)}},El=Object.freeze({data:null,dataState:"complete",complete:!0}),Il=Object.assign(new ji(e=>{e.next(El)}),{dirty:!1,getCurrentResult:()=>El}),Ol=Object.freeze({data:[],dataState:"complete",complete:!0}),zl=Object.assign(new ji(e=>{e.next(Ol)}),{getCurrentResult:()=>Ol}),Al=class e extends Error{message;path;query;variables;constructor(t,n,r,i){if(super(t),this.message=t,this.path=n,this.query=r,this.variables=i,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let e=this.path.length-1;e>=0;--e)this.missing={[this.path[e]]:this.missing}}else this.missing=this.path;this.__proto__=e.prototype}missing},{hasOwnProperty:_l}=Object.prototype;function Dl({__typename:e,id:t,_id:n},r){if("string"==typeof e&&(r&&(r.keyObject=null!=t?{id:t}:null!=n?{_id:n}:void 0),null==t&&null!=n&&(t=n),null!=t))return`${e}:${"number"==typeof t||"string"==typeof t?t:JSON.stringify(t)}`}var Pl={dataIdFromObject:Dl,resultCaching:!0},Ml=/^[_a-z][_0-9a-z]*/i;function Rl(e){const t=e.match(Ml);return t?t[0]:e}function Ll(e,t,n){return!!Ao(t)&&(Jo(t)?t.every(t=>Ll(e,t,n)):e.selections.every(e=>{if(Co(e)&&Bs(e,n)){const r=Io(e);return _l.call(t,r)&&(!e.selectionSet||Ll(e.selectionSet,t[r],n))}return!0}))}function jl(e){return Ao(e)&&!bl(e)&&!Jo(e)}function Fl(e,t){const n=ko(wo(e));return{fragmentMap:n,lookupFragment(e){let r=n[e];return!r&&t&&(r=t.lookup(e)),r||null}}}function $l(e){switch(e.kind){case bn:return e.name.value;case vn:return`[${$l(e.type)}]`;case xn:return $l(e.type)}}var Vl={},ql=()=>Vl,Bl={},Ul=class{policies;group;data={};constructor(e,t){this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return void 0!==this.lookup(e,!0)}get(e,t){if(this.group.depend(e,t),_l.call(this.data,e)){const n=this.data[e];if(n&&_l.call(n,t))return n[t]}return"__typename"===t&&_l.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof Jl?this.parent.get(e,t):void 0}lookup(e,t){return t&&this.group.depend(e,"__exists"),_l.call(this.data,e)?this.data[e]:this instanceof Jl?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?{}:void 0}merge(e,t){let n;bl(e)&&(e=e.__ref),bl(t)&&(t=t.__ref);const r="string"==typeof e?this.lookup(n=e):e;let i="string"==typeof t?this.lookup(n=t):t;if(!i)return;qa("string"==typeof n,108),i=this.coerceStoreObject(i,(e,t)=>e.coerceToParsed(t),i.__typename||r?.__typename||this.policies.rootTypenamesById[n]);const a=new Mo({reconciler:Ql}).merge(r,i);if(this.data[n]=a,a!==r&&(delete this.refs[n],this.group.caching)){const e={};r||(e.__exists=1),Object.keys(i).forEach(t=>{if(!r||r[t]!==a[t]){e[t]=1;const n=Rl(t);n===t||this.policies.hasKeyArgs(a.__typename,n)||(e[n]=1),void 0!==a[t]||this instanceof Jl||delete a[t]}}),!e.__typename||r&&r.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete e.__typename,Object.keys(e).forEach(e=>this.group.dirty(n,e))}}modify(e,t,n){const r=this.lookup(e);if(r){const i={};let a=!1,o=!0;const s={DELETE:Vl,INVALIDATE:Bl,isReference:bl,toReference:this.toReference,canRead:this.canRead,readField:(t,n)=>this.policies.readField("string"==typeof t?{fieldName:t,from:n||Ms(e)}:t,{store:this})};if(Object.keys(r).forEach(l=>{const c=Rl(l);let u=r[l];if(void 0===u)return;const d="function"==typeof t?t:t[l]||(n?void 0:t[c]);if(d){let t=d===ql?Vl:d(u,{...s,fieldName:c,storeFieldName:l,storage:this.getStorage(e,l)});t===Bl?this.group.dirty(e,l):(t===Vl&&(t=void 0),t!==u&&(i[l]=t,a=!0,u=t))}void 0!==u&&(o=!1)}),a)return this.merge(e,i),o&&(this instanceof Jl?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,n){const r=this.lookup(e);if(r){const i=this.getFieldValue(r,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:i,fieldName:t,args:n}):t;return this.modify(e,a?{[a]:ql}:ql,!!n)}return!1}evict(e,t){let n=!1;return e.id&&(_l.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof Jl&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n}clear(){this.replace(null)}extract(){let e=this.toObject();this.hasScalarConfig()&&(e=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t&&this.coerceStoreObject(t,(e,t)=>e.coerceToSerialized(t),t?.__typename||this.policies.rootTypenamesById[e])])));const t=[];return this.getRootIdSet().forEach(e=>{_l.call(this.policies.rootTypenamesById,e)||t.push(e)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}hasScalarConfig(){return!!this.policies.cache.config.scalars}coerceStoreObject(e,t,n=e.__typename){if(!n||!this.hasScalarConfig())return e;let r=!1;const i=Object.entries(e).map(([e,i])=>{const a=Rl(e),o=this.policies.getScalarTypeForField(n,a),s=this.coerceValue(i,t,o,`${n}.${a}`);return r||=s!==i,[e,s]});return r?Object.fromEntries(i):e}coerceValue(e,t,n,r){if(null==e)return e;if(n){const i=Eo(n);if(i&&Array.isArray(e))return e.map(e=>this.coerceValue(e,t,i[1],r));const a=this.policies.cache.getScalar(Oo(n));if(a)return t(a,e)}return Array.isArray(e)?e.map(e=>this.coerceValue(e,t,n,r)):Yo(e)&&"__typename"in e?this.coerceStoreObject(e,t):e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&_l.call(e,t)||this.delete(t)}),e){const{__META:t,...n}=e;Object.keys(n).forEach(e=>{this.merge(e,n[e])}),t&&t.extraRootIds.forEach(this.retain,this)}}rootIds={};retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=/* @__PURE__ */new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof Jl?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(n=>{_l.call(t,n)&&(Object.keys(this.findChildRefIds(n)).forEach(e.add,e),delete t[n])});const n=Object.keys(t);if(n.length){let e=this;for(;e instanceof Jl;)e=e.parent;n.forEach(t=>e.delete(t))}return n}refs={};findChildRefIds(e){if(!_l.call(this.refs,e)){const t=this.refs[e]={},n=this.data[e];if(!n)return t;const r=/* @__PURE__ */new Set([n]);r.forEach(e=>{bl(e)&&(t[e.__ref]=!0),Ao(e)&&Object.keys(e).forEach(t=>{const n=e[t];Ao(n)&&r.add(n)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}getFieldValue=(e,t)=>bl(e)?this.get(e.__ref,t):e&&e[t];canRead=e=>bl(e)?this.has(e.__ref):"object"==typeof e;toReference=(e,t)=>{if("string"==typeof e)return Ms(e);if(bl(e))return e;const[n]=this.policies.identify(e);if(n){const r=Ms(n);return t&&this.merge(n,e),r}};get supportsResultCaching(){return this.group.caching}},Hl=class{caching;parent;d=null;keyMaker;constructor(e,t=null){this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?As():null,this.keyMaker=new io}depend(e,t){if(this.d){this.d(Wl(e,t));const n=Rl(t);n!==t&&this.d(Wl(e,n)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(Wl(e,t),"__exists"===t?"forget":"setDirty")}};function Wl(e,t){return t+"#"+e}function Gl(e,t){Yl(e)&&e.group.depend(t,"__exists")}Ul.Root=class extends Ul{constructor({policies:e,resultCaching:t=!0,seed:n}){super(e,new Hl(t)),n&&this.replace(n)}stump=new Kl(this);addLayer(e,t){return this.stump.addLayer(e,t)}removeLayer(){return this}storageTrie=new io;getStorage(){return this.storageTrie.lookupArray(arguments)}};var Jl=class e extends Ul{id;parent;replay;group;constructor(e,t,n,r){super(t.policies,r),this.id=e,this.parent=t,this.replay=n,this.group=r,n(this)}addLayer(t,n){return new e(t,this,n,this.group)}removeLayer(e){const t=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach(e=>{const n=this.data[e],r=t.lookup(e);r?n?n!==r&&Object.keys(n).forEach(t=>{Ys(n[t],r[t])||this.group.dirty(e,t)}):(this.group.dirty(e,"__exists"),Object.keys(r).forEach(t=>{this.group.dirty(e,t)})):this.delete(e)}),t):t===this.parent?this:t.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(e){const t=this.parent.findChildRefIds(e);return _l.call(this.data,e)?{...t,...super.findChildRefIds(e)}:t}getStorage(...e){let t=this.parent;for(;t.parent;)t=t.parent;return t.getStorage(...e)}},Kl=class extends Jl{constructor(e){super("EntityStore.Stump",e,()=>{},new Hl(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}};function Ql(e,t,n){const r=e[n],i=t[n];return Ys(r,i)?r:i}function Yl(e){return!(!e||!e.supportsResultCaching)}var Xl=new as;function Zl(e){const t=e.directives?.find(({name:e})=>"unmask"===e.value);if(!t)return"mask";const n=t.arguments?.find(({name:e})=>"mode"===e.value);return n&&"value"in n.value&&"migrate"===n.value.value?"migrate":"unmask"}function ec(e,t,n){return Xl.withValue(!0,()=>{const r=tc(e,t,n,!1);return Object.isFrozen(e),r})}function tc(e,t,n,r,i){const{knownChanged:a}=n,o=function(e,t){if(t.has(e))return t.get(e);const n=Array.isArray(e)?[]:{};return t.set(e,n),n}(e,n.mutableTargets);if(Array.isArray(e)){for(const[i,s]of Array.from(e.entries())){if(null===s){o[i]=null;continue}const e=tc(s,t,n,r,void 0);a.has(e)&&a.add(o),o[i]=e}return a.has(o)?o:e}for(const s of t.selections){let t;if(r&&a.add(o),"Field"===s.kind){const i=Io(s),l=s.selectionSet;if(t=o[i]||e[i],void 0===t)continue;if(l&&null!==t){const o=tc(e[i],l,n,r,void 0);a.has(o)&&(t=o)}o[i]=t}if("InlineFragment"!==s.kind||s.typeCondition&&!n.cache.fragmentMatches(s,e.__typename)||(t=tc(e,s.selectionSet,n,r,i)),"FragmentSpread"===s.kind){const r=s.name.value,a=n.fragmentMap[r]||(n.fragmentMap[r]=n.cache.lookupFragment(r));qa(a,41,r);const o=Zl(s);"mask"!==o&&(t=tc(e,a.selectionSet,n,"migrate"===o,i))}a.has(t)&&a.add(o)}return"__typename"in e&&!("__typename"in o)&&(o.__typename=e.__typename),Object.keys(o).length!==Object.keys(e).length&&a.add(o),a.has(o)?o:e}var nc={};function rc(e){const t=JSON.stringify(e);return nc[t]||(nc[t]={})}function ic(e){const t=rc(e);return t.keyFieldsFn||(t.keyFieldsFn=(t,n)=>{const r=(e,t)=>n.readField(t,e),i=n.keyObject=oc(e,e=>{let i=cc(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&_l.call(t,e[0])&&(i=cc(t,e,lc)),qa(void 0!==i,113,e.join("."),t),i});return`${n.typename}:${JSON.stringify(i)}`})}function ac(e){const t=rc(e);return t.keyArgsFn||(t.keyArgsFn=(t,{field:n,variables:r,fieldName:i})=>{const a=oc(e,e=>{const i=e[0],a=i.charAt(0);if("@"!==a){if("$"===a){const t=i.slice(1);if(r&&_l.call(r,t)){const n=e.slice(0);return n[0]=t,cc(r,n)}return}if(t)return cc(t,e)}else if(n&&Qo(n.directives)){const t=i.slice(1),a=n.directives.find(e=>e.name.value===t),o=a&&Qa(a,r);return o&&cc(o,e.slice(1))}}),o=JSON.stringify(a);return(t||"{}"!==o)&&(i+=":"+o),i})}function oc(e,t){const n=new Mo;return sc(e).reduce((e,r)=>{let i=t(r);if(void 0!==i){for(let e=r.length-1;e>=0;--e)i={[r[e]]:i};e=n.merge(e,i)}return e},{})}function sc(e){const t=rc(e);if(!t.paths){const n=t.paths=[],r=[];e.forEach((t,i)=>{Jo(t)?(sc(t).forEach(e=>n.push(r.concat(e))),r.length=0):(r.push(t),Jo(e[i+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function lc(e,t){return e[t]}function cc(e,t,n){return n=n||lc,uc(t.reduce(function e(t,r){return Jo(t)?t.map(t=>e(t,r)):t&&n(t,r)},e))}function uc(e){return Ao(e)?Jo(e)?e.map(uc):oc(Object.keys(e).sort(),t=>cc(e,t)):e}var dc=new as,pc=/* @__PURE__ */new WeakMap;function hc(e){let t=pc.get(e);return t||pc.set(e,t={vars:/* @__PURE__ */new Set,dep:As()}),t}function fc(e){hc(e).vars.forEach(t=>t.forgetCache(e))}function mc(e){const t=/* @__PURE__ */new Set,n=/* @__PURE__ */new Set,r=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(e=>{hc(e).dep.dirty(r),function(e){e.broadcastWatches&&e.broadcastWatches()}(e)});const i=Array.from(n);n.clear(),i.forEach(t=>t(e))}}else{const e=dc.getValue();e&&(i(e),hc(e).dep(r))}return e};r.onNextChange=e=>(n.add(e),()=>{n.delete(e)});const i=r.attachCache=e=>(t.add(e),hc(e).vars.add(r),r);return r.forgetCache=e=>t.delete(e),r}function gc(e){return void 0!==e.args?e.args:e.field?Qa(e.field,e.variables):null}var yc=()=>{},bc=(e,t)=>t.fieldName,vc=(e,t,{mergeObjects:n})=>n(e,t),xc=(e,t)=>t,kc=(e,t,{streamFieldInfo:n,existingData:r})=>{if(!e&&!r)return t;const i=[],a=e??r,o=n?.isLastChunk?t.length:Math.max(a.length,t.length);for(let s=0;s<o;s++)i[s]=void 0===t[s]?a[s]:t[s];return i},wc=class{config;typePolicies={};toBeAdded={};supertypeMap=/* @__PURE__ */new Map;fuzzySubtypes=/* @__PURE__ */new Map;cache;rootIdsByTypename={};rootTypenamesById={};usingPossibleTypes=!1;constructor(e){this.config=e,this.config={dataIdFromObject:Dl,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){const n=this,r=t&&(t.typename||t.storeObject?.__typename)||e.__typename;if(r===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const i=t&&t.storeObject||e,a={...t,typename:r,storeObject:i,readField:t&&t.readField||((...e)=>{const t=Nc(e,i);return n.readField(t,{store:n.cache.data,variables:t.variables})})};let o;const s=r&&this.getTypePolicy(r);let l=s&&s.keyFn||this.config.dataIdFromObject;return Xl.withValue(!0,()=>{for(;l;){const t=l({...e,...i},a);if(!Jo(t)){o=t;break}l=ic(t)}}),o=o?String(o):void 0,a.keyObject?[o,a.keyObject]:[o]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:n,mutationType:r,subscriptionType:i,...a}=e[t];n&&this.setRootTypename("Query",t),r&&this.setRootTypename("Mutation",t),i&&this.setRootTypename("Subscription",t),_l.call(this.toBeAdded,t)?this.toBeAdded[t].push(a):this.toBeAdded[t]=[a]})}updateTypePolicy(e,t,n){const r=this.getTypePolicy(e),{keyFields:i,fields:a}=t;function o(e,t){e.merge="function"==typeof t?t:!0===t?vc:!1===t?xc:e.merge}o(r,t.merge),r.keyFn=!1===i?yc:Jo(i)?ic(i):"function"==typeof i?i:r.keyFn,a&&Object.keys(a).forEach(t=>{let r=n[t];r&&r?.typename===e||(r=n[t]={typename:e});const i=a[t];if("function"==typeof i)r.scalar||(r.read=i);else{let{keyArgs:e,read:t,merge:n,scalar:a}=i;a&&(r.scalar=a),r.scalar&&(r.read=t=void 0,r.merge=n=void 0),r.keyFn=!1===e?bc:Jo(e)?ac(e):"function"==typeof e?e:r.keyFn,"function"==typeof t&&(r.read=t),o(r,n)}r.read&&r.merge&&(r.keyFn=r.keyFn||bc)})}setRootTypename(e,t=e){const n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(qa(!r||r===e,114,e),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(e=>{this.getSupertypeSet(e,!0).add(t);const n=e.match(Ml);n&&n[0]===e||this.fuzzySubtypes.set(e,new RegExp(e))})})}getTypePolicy(e){if(!_l.call(this.typePolicies,e)){const t=this.typePolicies[e]={};t.fields={};let n=this.supertypeMap.get(e);!n&&this.fuzzySubtypes.size&&(n=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((t,r)=>{if(t.test(e)){const e=this.supertypeMap.get(r);e&&e.forEach(e=>n.add(e))}})),n&&n.size&&n.forEach(e=>{const{fields:n,...r}=this.getTypePolicy(e);Object.assign(t,r),Object.assign(t.fields,n)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(t=>{this.updateTypePolicy(e,t,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=/* @__PURE__ */new Set),n}fragmentMatches(e,t,n,r){if(!e.typeCondition)return!0;if(!t)return!1;const i=e.typeCondition.name.value;if(t===i)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(i)){const a=this.getSupertypeSet(t,!0),o=[a],s=e=>{const t=this.getSupertypeSet(e,!1);t&&t.size&&o.indexOf(t)<0&&o.push(t)};let l=!(!n||!this.fuzzySubtypes.size),c=!1;for(let u=0;u<o.length;++u){const d=o[u];if(d.has(i))return a.has(i)||a.add(i),!0;d.forEach(s),l&&u===o.length-1&&Ll(e.selectionSet,n,r)&&(l=!1,c=!0,this.fuzzySubtypes.forEach((e,n)=>{const r=t.match(e);r&&r[0]===t&&s(n)}))}}return!1}hasKeyArgs(e,t){const n=this.getFieldPolicy(e,t);return!(!n||!n.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:n}=e,r=this.getFieldPolicy(t,n);let i,a=r&&r.keyFn;if(a&&t){const r={typename:t,fieldName:n,field:e.field||null,variables:e.variables},o=gc(e);for(;a;){const e=a(o,r);if(!Jo(e)){i=e||n;break}a=ac(e)}}return void 0===i&&(i=e.field?function(e,t){let n=null;e.directives&&(n={},e.directives.forEach(e=>{n[e.name.value]={},e.arguments&&e.arguments.forEach(({name:r,value:i})=>Ka(n[e.name.value],r,i,t))}));let r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(({name:e,value:n})=>Ka(r,e,n,t))),Uo(e.name.value,r,n)}(e.field,e.variables):Uo(n,gc(e))),!1===i?n:n===Rl(i)?i:n+":"+i}getScalarTypeForField(e,t){return this.getFieldPolicy(e,t)?.scalar}readField(e,t){const n=e.from;if(!n)return;if(!e.field&&!e.fieldName)return;if(void 0===e.typename){const r=t.store.getFieldValue(n,"__typename");r&&(e.typename=r)}const r=this.getStoreFieldName(e),i=Rl(r),a=t.store.getFieldValue(n,r),o=this.getFieldPolicy(e.typename,i),s=o&&o.read;if(s){const i=Sc(this,n,e,t,t.store.getStorage(bl(n)?n.__ref:n,r));return dc.withValue(this.cache,s,[a,i])}return a}getReadFunction(e,t){const n=this.getFieldPolicy(e,t);return n&&n.read}getMergeFunction(e,t,n){let r=this.getFieldPolicy(e,t),i=r&&r.merge;return!i&&n&&(r=this.getTypePolicy(n),i=r&&r.merge),i}runMergeFunction(e,t,{field:n,typename:r,merge:i,path:a},o,s){const l=e;if(i===vc)return Tc(o.store)(e,t);if(i===xc)return t;o.overwrite&&(e=void 0);const c=o.extensions?.[cl]?.deref()?.peekArray(a);if(c){const{current:e,previous:n}=c;if(n&&Ys(n.incoming,t)&&Ys(n.streamFieldInfo,e))return n.result}const u=i(e,t,function(e,t,n,r,i,a){const o={...Sc(e,void 0,n,r,i),extensions:r.extensions,existingData:a},s=r.extensions;if(s&&cl in s){const{[cl]:e,...t}=s,r=e?.deref()?.peekArray(n.path);r&&(o.streamFieldInfo=r.current),o.extensions=0===Object.keys(t).length?void 0:t}return o}(this,0,{typename:r,fieldName:n.name.value,field:n,variables:o.variables,path:a},o,s||{},l));return c&&(c.previous={incoming:t,streamFieldInfo:c.current,result:u}),u}};function Sc(e,t,n,r,i){const a=e.getStoreFieldName(n),o=Rl(a),s=n.variables||r.variables,{toReference:l,canRead:c}=r.store;return{args:gc(n),field:n.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:bl,toReference:l,storage:i,cache:e.cache,canRead:c,readField:(...n)=>e.readField(Nc(n,t,s),r),mergeObjects:Tc(r.store)}}function Nc(e,t,n){const{0:r,1:i,length:a}=e;let o;return"string"==typeof r?o={fieldName:r,from:a>1?i:t}:(o={...r},_l.call(o,"from")||(o.from=t)),void 0===o.variables&&(o.variables=n),o}function Tc(e){return function(t,n){if(Jo(t)||Jo(n))throw Ua(117);if(Ao(t)&&Ao(n)){const r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(bl(t)&&jl(n))return e.merge(t.__ref,n),t;if(jl(t)&&bl(n))return e.merge(t,n.__ref),n;if(jl(t)&&jl(n))return{...t,...n}}return n}}function Cc(e){return[e.selectionSet,e.objectOrReference,e.context]}var Ec=class{executeSelectionSet;executeSubSelectedArray;prunePartialStreamArray;prunePartialBoundaries;config;knownResults=/* @__PURE__ */new WeakMap;keyMaker=new io;constructor(e){this.config=e,this.executeSelectionSet=Ps(e=>{const t=Cc(e);return this.executeSelectionSet.peek(...t)||(Gl(e.context.store,e.enclosingRef.__ref),this.execSelectionSetImpl(e))},{max:Xa["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Cc,makeCacheKey(e,t,n){if(Yl(n.store))return n.store.makeCacheKey(e,bl(t)?t.__ref:t,n.varString)}}),this.executeSubSelectedArray=Ps(e=>(Gl(e.context.store,e.enclosingRef.__ref),this.execSubSelectedArrayImpl(e)),{max:Xa["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:e,array:t,context:n}){if(Yl(n.store))return n.store.makeCacheKey(e,t,n.varString)}}),this.prunePartialBoundaries=Ps(e=>this.prunePartialBoundariesImpl(e),{max:Xa["inMemoryCache.prunePartialBoundaries"]||2e4,makeCacheKey:({boundaries:e,context:t,selectionSet:n})=>{if(Yl(t.store))return this.keyMaker.lookup(n,e,t.streamInfo,t.deferInfo)}}),this.prunePartialStreamArray=Ps(e=>{const{field:t,context:n,path:r}=e;return Xo(t,n.variables)&&n.streamInfo?.lookupArray(r).state.depend(),this.prunePartialStreamArrayImpl(e)},{max:Xa["inMemoryCache.prunePartialStreamArray"]||2e4,makeCacheKey:({field:e,context:t,boundaries:n})=>{if(Yl(t.store))return this.keyMaker.lookup(e,n,t.streamInfo,t.deferInfo)}})}diffQueryAgainstStore({store:e,query:t,rootId:n="ROOT_QUERY",variables:r,returnPartialData:i=!0,...a}){const o=Object.hasOwn(a,dl),s=this.config.cache.policies;r=zo(Ro(function(e){const t=To(e);return qa(t&&"query"===t.operation,15),t}(t)),r);const l=Ms(n),c={store:e,query:t,policies:s,variables:r,varString:Fo(r),...Fl(t,this.config.fragments),...a[dl]};let u=this.executeSelectionSet({selectionSet:No(t).selectionSet,objectOrReference:l,enclosingRef:l,context:c});if(o&&function({dataState:e},t){return"deferPartial"===e||"streamPartial"===e||("complete"===e||"streaming"===e)&&!(!t.streamInfo&&!t.deferInfo)}(u,c)){const e=this.prunePartialBoundaries({selectionSet:No(t).selectionSet,data:u.result,boundaries:u.partialBoundaries,context:c,path:[]});u.result!==e.result&&i||(u={result:e.result,partialBoundaries:u.partialBoundaries,dataState:e.dataState})}let{result:d,dataState:p,missing:h}=u;const f=!(!h||"streaming"===p&&o);let m;"streaming"===p&&0===Object.keys(d).length&&(p="empty"),("deferPartial"===p||"streamPartial"===p||"streaming"===p&&!o)&&(p="partial"),"partial"!==p||i||(p="empty");const g="complete"===p,y={result:g||"streaming"===p||i&&Object.keys(d).length?d:null,complete:g,get missing(){return f&&(m||=new Al(function(e){try{JSON.stringify(e,(e,t)=>{if("string"==typeof t)throw t;return t})}catch(d){return d}}(h),h,t,r)),m}};return o&&(y.dataState=p),y}isFresh(e,t,n,r){if(Yl(r.store)&&this.knownResults.get(e)===n){const i=this.executeSelectionSet.peek(n,t,r);if(i&&e===i.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:n,context:r}){if(bl(t)&&!r.policies.rootTypenamesById[t.__ref]&&!r.store.has(t.__ref))return{result:{},dataState:"empty",missing:`Dangling reference to missing ${t.__ref} object`,partialBoundaries:new Ic};const{variables:i,policies:a,store:o}=r,s=o.getFieldValue(t,"__typename"),l=[];let c,u;const d=new Mo,p=new Ic;function h(e,t){return e.missing&&(u=d.merge(u,{[t]:e.missing})),e}"string"!=typeof s||a.rootIdsByTypename[s]||l.push({__typename:s}),new Set(e.selections).forEach(e=>{if(Bs(e,i))if(Co(e)){let i=a.readField({fieldName:e.name.value,field:e,variables:r.variables,from:t},r);const o=Io(e);if(void 0===i){if(!xl.added(e)){const n=bl(t)?t.__ref:t?a.identify(t)[0]:void 0;u=d.merge(u,{[o]:`Can't find field '${e.name.value}' on ${n?`${n} object`:`object ${JSON.stringify(t||{},null,2)}`}`}),c=zc(c,"empty")}}else if(Jo(i))if(i.length>0){const t=h(this.executeSubSelectedArray({field:e,array:i,enclosingRef:n,context:r}),o);i=t.result,c=zc(c,t.dataState),p.set(o,t.partialBoundaries)}else c=zc(c,"complete");else if(e.selectionSet){if(null!=i){const t=h(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:i,enclosingRef:bl(i)?i:n,context:r}),o);i=t.result,p.set(o,t.partialBoundaries),c=zc(c,"empty"===t.dataState?"partial":t.dataState)}}else xl.added(e)||(c=zc(c,"complete"));void 0!==i&&l.push({[o]:i})}else{const i=So(e,r.lookupFragment);if(!i&&"FragmentSpread"===e.kind)throw Ua(120,e.name.value);if(i&&a.fragmentMatches(i,s)){const a=Ko(e,r.variables),o=this.execSelectionSetImpl({selectionSet:i.selectionSet,objectOrReference:t,enclosingRef:n,context:r}),{result:s,dataState:h}=o;p.merge(o.partialBoundaries),void 0!==s&&l.push(s),o.missing&&(u=d.merge(u,o.missing)),!a||"partial"!==h&&"empty"!==h||p.add(e),c=zc(c,a?"empty"===h?"streaming":"partial"===h?"deferPartial":h:h)}}}),c||="complete";const f={result:Rs(l),missing:u,dataState:c,partialBoundaries:p};return f.result&&this.knownResults.set(f.result,e),f}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:n,context:r}){let i,a="complete",o=new Mo;const s=new Ic,l=Xo(e,r.variables);return e.selectionSet&&(t=t.filter(e=>void 0===e||r.store.canRead(e))),t=t.map((t,c)=>{if(null===t)return null;let u;if(Jo(t)?u=this.executeSubSelectedArray({field:e,array:t,enclosingRef:n,context:r}):e.selectionSet&&(u=this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:t,enclosingRef:bl(t)?t:n,context:r})),u){const{dataState:t}=u;return s.set(c,"partial"===t?u.partialBoundaries.clone().add(e):u.partialBoundaries),a=zc(a,l&&"partial"===t?"streamPartial":t),function(e,t){return e.missing&&(i=o.merge(i,{[t]:e.missing})),e.result}(u,c)}return t}),{result:t,dataState:a,missing:i,partialBoundaries:s}}prunePartialBoundariesImpl({boundaries:e,context:t,data:n,path:r,selectionSet:i}){const{variables:a,lookupFragment:o,policies:s}=t;if(null==n||!e)return{result:n,dataState:"complete"};const l=new Mo;let c=!1,u="complete";const d={};Object.hasOwn(n,"__typename")&&(d.__typename=n.__typename);const p=new Set(i.selections);return p.forEach(i=>{if(!Bs(i,a))return;if(Co(i)){const a=Io(i);if(!Object.hasOwn(n,a))return;const o=n[a];if(Array.isArray(o)){const n=this.prunePartialStreamArray({field:i,array:o,boundaries:e.getChild(a),context:t,path:r.concat(a)});c||=n.result!==o,d[a]=n.result,u=zc(u,n.dataState)}else if(i.selectionSet){const n=this.prunePartialBoundaries({data:o,selectionSet:i.selectionSet,boundaries:e.getChild(a),context:t,path:r.concat(a)});c||=n.result!==o,u=zc(u,n.dataState),d[a]=Object.hasOwn(d,a)?l.merge(d[a],n.result):n.result}else d[a]=o;return}const h=So(i,o);let f=!1;if(t.deferInfo&&Ko(i,a)){const e=i.directives?.find(e=>"defer"===e.name.value),n=e&&function(e){const t=e.arguments?.find(e=>"label"===e.name.value);if(t&&"StringValue"===t.value.kind)return t.value.kind===un?t.value.value:void 0}(e);f=!!t.deferInfo.peekArray(r.concat(n||[]))}h&&s.fragmentMatches(h,n.__typename)&&(e.has(i)||f?u=zc(u,"streaming"):h.selectionSet.selections.forEach(p.add,p))}),Object.keys(d).length!==Object.keys(n).length?c=!0:c&&e.hasSelections()&&(c=!Ys(d,n)),{result:c?d:n,dataState:u}}prunePartialStreamArrayImpl({field:e,array:t,boundaries:n,context:r,path:i}){if(!n)return{result:t,dataState:"complete"};let a=!1,o="complete",s=[];const l=r.streamInfo?.peekArray(i)?.state,c=Math.min(t.length,l?.truncate?l.streamPosition:Number.MAX_SAFE_INTEGER);for(let u=0;u<c;u++){const c=t[u];let d={result:c,dataState:"complete"};if(n.getChild(u)?.has(e)){l?(l.truncate=!0,s=s.slice(0,l.streamPosition)):(s=[],o="complete");break}Array.isArray(c)?d=this.prunePartialStreamArray({field:e,array:c,boundaries:n.getChild(u),context:r,path:i.concat(u)}):e.selectionSet&&(d=this.prunePartialBoundaries({data:c,selectionSet:e.selectionSet,boundaries:n.getChild(u),context:r,path:i.concat(u)})),s.push(d.result),a||=d.result!==c,o=zc(o,d.dataState)}return a||=s.length!==t.length,{result:a?s:t,dataState:o}}},Ic=class e{selections=/* @__PURE__ */new Set;children=/* @__PURE__ */new Map;add(e){return this.selections.add(e),this}has(e){return this.selections.has(e)}hasSelections(){return this.selections.size>0}getChild(e){return this.children.get(e)}clone(){return(new e).merge(this)}set(e,t){const n=this.getChild(e);this.children.set(e,n?n.clone().merge(t):t)}merge(e){return e.selections.forEach(e=>this.add(e)),e.children.forEach((e,t)=>this.set(t,e)),this}},Oc={empty:{complete:"partial",deferPartial:"partial",streaming:"partial",streamPartial:"partial"},deferPartial:{empty:"partial"},streamPartial:{deferPartial:"deferPartial",empty:"partial"},streaming:{deferPartial:"deferPartial",empty:"partial",streamPartial:"streamPartial"},complete:{deferPartial:"deferPartial",streaming:"streaming",streamPartial:"streamPartial",empty:"partial"},partial:{}};function zc(e,t){return"partial"===t?"partial":e&&e!==t?Oc[e][t]||e:t}function Ac(e,t,n){const r=`${t}${n}`;let i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:{...e,clientOnly:t,deferred:n}),i}var _c=class{cache;reader;fragments;constructor(e,t,n){this.cache=e,this.reader=t,this.fragments=n}writeToStore(e,{query:t,result:n,dataId:r,variables:i,overwrite:a,extensions:o}){const s=To(t),l=new Mo;i={...Ro(s),...i};const c={store:e,written:{},merge:(e,t)=>l.merge(e,t),variables:i,varString:Fo(i),...Fl(t,this.fragments),overwrite:!!a,incomingById:/* @__PURE__ */new Map,clientOnly:!1,deferred:!1,flavors:/* @__PURE__ */new Map,extensions:o},u=this.processSelectionSet({result:n||{},dataId:r,selectionSet:s.selectionSet,mergeTree:{map:/* @__PURE__ */new Map},context:c,path:[]});if(!bl(u))throw Ua(122,n);return c.incomingById.forEach(({storeObject:t,mergeTree:n,fieldNodeSet:r},i)=>{const a=Ms(i);if(n&&n.map.size){const e=this.applyMerges(n,a,t,c);if(bl(e))return;t=e}e.merge(i,t)}),e.retain(u.__ref),u}processSelectionSet({dataId:e,result:t,selectionSet:n,context:r,mergeTree:i,path:a}){const{policies:o}=this.cache;let s={};const l=e&&o.rootTypenamesById[e]||jc(t,n,r.fragmentMap)||e&&r.store.get(e,"__typename");"string"==typeof l&&(s.__typename=l);const c=(...e)=>{const t=Nc(e,s,r.variables);if(bl(t.from)){const e=r.incomingById.get(t.from.__ref);if(e){const n=o.readField({...t,from:e.storeObject},r);if(void 0!==n)return n}}return o.readField(t,r)},u=/* @__PURE__ */new Set;this.flattenFields(n,t,r,l).forEach((e,n)=>{const r=t[Io(n)],d=[...a,n.name.value];if(u.add(n),void 0!==r){const t=o.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),a=Pc(i,t);let u,p=this.processFieldValue(r,n,n.selectionSet?Ac(e,!1,!1):e,a,d);n.selectionSet&&(bl(p)||jl(p))&&(u=c("__typename",p));const h=o.getMergeFunction(l,n.name.value,u);h?a.info={field:n,typename:l,merge:h,path:d}:e.extensions?.[cl]&&Array.isArray(p)&&Xo(n,e.variables)?a.info={field:n,typename:l,merge:kc,path:d}:Lc(i,t),s=e.merge(s,{[t]:p})}});try{const[i,a]=o.identify(t,{typename:l,selectionSet:n,fragmentMap:r.fragmentMap,storeObject:s,readField:c});e=e||i,a&&(s=r.merge(s,a))}catch(rM){if(!e)throw rM}if("string"==typeof e){const a=Ms(e),o=r.written[e]||(r.written[e]=[]);if(o.indexOf(n)>=0)return a;if(o.push(n),this.reader&&this.reader.isFresh(t,a,n,r))return a;const l=r.incomingById.get(e);return l?(l.storeObject=r.merge(l.storeObject,s),l.mergeTree=Mc(l.mergeTree,i),u.forEach(e=>l.fieldNodeSet.add(e))):r.incomingById.set(e,{storeObject:s,mergeTree:Rc(i)?void 0:i,fieldNodeSet:u}),a}return s}processFieldValue(e,t,n,r,i){return t.selectionSet&&null!==e?Jo(e)?e.map((e,a)=>{const o=this.processFieldValue(e,t,n,Pc(r,a),[...i,a]);return Lc(r,a),o}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r,path:i}):e}flattenFields(e,t,n,r=jc(t,e,n.fragmentMap)){const i=/* @__PURE__ */new Map,{policies:a}=this.cache,o=new io(!1);return function e(s,l){const c=o.lookup(s,l.clientOnly,l.deferred);c.visited||(c.visited=!0,s.selections.forEach(o=>{if(!Bs(o,n.variables))return;let{clientOnly:s,deferred:c}=l;if(s&&c||!Qo(o.directives)||o.directives.forEach(e=>{const t=e.name.value;if("client"===t&&(s=!0),"defer"===t){const t=Qa(e,n.variables);t&&!1===t.if||(c=!0)}}),Co(o)){const e=i.get(o);e&&(s=s&&e.clientOnly,c=c&&e.deferred),i.set(o,Ac(n,s,c))}else{const i=So(o,n.lookupFragment);if(!i&&"FragmentSpread"===o.kind)throw Ua(124,o.name.value);i&&a.fragmentMatches(i,r,t,n.variables)&&e(i.selectionSet,Ac(n,s,c))}}))}(e,n),i}applyMerges(e,t,n,r,i){if(e.map.size&&!bl(n)){const a=Jo(n)||!bl(t)&&!jl(t)?void 0:t,o=n;let s;a&&!i&&(i=[bl(a)?a.__ref:a]);const l=(e,t)=>Jo(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t));e.map.forEach((e,t)=>{const n=l(a,t),c=l(o,t);if(void 0===c)return;i&&i.push(t);const u=this.applyMerges(e,n,c,r,i);u!==c&&(s=s||/* @__PURE__ */new Map,s.set(t,u)),i&&qa(i.pop()===t)}),s&&(n=Jo(o)?o.slice(0):{...o},s.forEach((e,t)=>{n[t]=e}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&r.store.getStorage(...i)):n}},Dc=[];function Pc({map:e},t){return e.has(t)||e.set(t,Dc.pop()||{map:/* @__PURE__ */new Map}),e.get(t)}function Mc(e,t){if(e===t||!t||Rc(t))return e;if(!e||Rc(e))return t;const n=e.info&&t.info?{...e.info,...t.info}:e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?/* @__PURE__ */new Map:e.map.size?e.map:t.map};if(r){const n=new Set(t.map.keys());e.map.forEach((e,r)=>{i.map.set(r,Mc(e,t.map.get(r))),n.delete(r)}),n.forEach(n=>{i.map.set(n,Mc(t.map.get(n),e.map.get(n)))})}return i}function Rc(e){return!e||!(e.info||e.map.size)}function Lc({map:e},t){const n=e.get(t);n&&Rc(n)&&(Dc.push(n),e.delete(t))}function jc(e,t,n){let r;for(const i of t.selections)if(Co(i)){if("__typename"===i.name.value)return e[Io(i)]}else r?r.push(i):r=[i];if("string"==typeof e.__typename)return e.__typename;if(r)for(const i of r){const t=jc(e,So(i,n).selectionSet,n);if("string"==typeof t)return t}}var Fc=class extends Cl{data;optimisticData;config;watches=/* @__PURE__ */new Set;storeReader;storeWriter;addTypenameTransform=new gl(xl);maybeBroadcastWatch;assumeImmutableResults=!0;policies;makeVar=mc;constructor(...e){var t;super(),this.config=(t=e[0]??{},zo(Pl,t)),this.policies=new wc({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const e=this.data=new Ul.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()}resetResultCache(){const{fragments:e}=this.config;this.addTypenameTransform.resetCache(),e?.resetCaches(),this.storeWriter=new _c(this,this.storeReader=new Ec({cache:this,fragments:e}),e),this.maybeBroadcastWatch=Ps((e,t)=>this.broadcastWatch(e,t),{max:Xa["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:e=>{const t=e.optimistic?this.optimisticData:this.data;if(Yl(t)){const{optimistic:n,id:r,variables:i}=e;return t.makeCacheKey(e.query,e.callback,Fo({optimistic:n,id:r,variables:i}))}}}),
3
3
  /* @__PURE__ */new Set([this.data.group,this.optimisticData.group]).forEach(e=>e.resetCaching())}getRootTypename(e){return this.policies.rootTypenamesById[`ROOT_${e.toUpperCase()}`]}getScalar(e){return this.config.scalars?.[e]}getScalarTypeForField(e,t){return this.policies.getScalarTypeForField(e,t)}configuresScalars(){return!!this.config.scalars}serializeVariables(e,t){if(!t||0===Object.keys(t).length||!this.config.scalars&&!this.config.inputObjects)return t;const n=To(e)?.variableDefinitions?.reduce((e,t)=>(e[t.variable.name.value]=$l(t.type),e),{});return n&&0!==Object.keys(n).length?this.serializeVariablesValue(t,n):t}serializeVariablesValue(e,t,n,r){if(null==e)return e;if(n){const i=Eo(n);if(i&&Array.isArray(e))return this.serializeInputArray(e,t,i[1],r);const a=this.getScalar(Oo(n));if(a)return a.coerceToSerialized(e)}return Array.isArray(e)?this.serializeInputArray(e,t,void 0,r):Yo(e)?this.serializeInputObject(e,t,r):e}serializeInputArray(e,t,n,r){let i=!1;const a=e.map(e=>{const a=this.serializeVariablesValue(e,t,n,r);return i||=a!==e,a});return i?a:e}serializeInputObject(e,t,n){let r=!1;const i=Object.entries(e).map(([e,i])=>{const a=t[e],o=n?`${n}.${e}`:e;if(!a)return[e,i];const s=this.config.inputObjects?.[Oo(a)];if(s){const t=this.serializeVariablesValue(i,s.fields,void 0,o);return r||=t!==i,[e,t]}const l=this.serializeVariablesValue(i,t,a,o);return r||=l!==i,[e,l]});return r?Object.fromEntries(i):e}restore(e){return this.init(),e&&this.data.replace(e),this}extract(e=!1){return(e?this.optimisticData:this.data).extract()}read(e){const{query:t,variables:n,returnPartialData:r=!1}=e;return this.storeReader.diffQueryAgainstStore({...e,variables:this.serializeVariables(t,n),store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r}).result}write(e){const{query:t,variables:n}=e;try{return++this.txCount,this.storeWriter.writeToStore(this.data,{...e,variables:this.serializeVariables(t,n)})}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}modify(e){if(_l.call(e,"id")&&!e.id)return!1;const t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields,!1)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}diff(e){const{variables:t}=e;return this.storeReader.diffQueryAgainstStore({...e,variables:this.serializeVariables(e.query,t),store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config})}watch(e){var t;return this.watches.size||hc(t=this).vars.forEach(e=>e.attachCache(t)),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),()=>{this.watches.delete(e)&&!this.watches.size&&fc(this),this.maybeBroadcastWatch.forget(e)}}gc(e){Fo.reset(),yl.reset();const t=this.optimisticData.gc();return e&&!this.txCount&&e.resetResultCache&&this.resetResultCache(),t}retain(e,t){return(t?this.optimisticData:this.data).retain(e)}release(e,t){return(t?this.optimisticData:this.data).release(e)}identify(e){if(bl(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(rM){}}evict(e){if(!e.id){if(_l.call(e,"id"))return!1;e={...e,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}}reset(e){return this.init(),Fo.reset(),e&&e.discardWatches?(this.watches.forEach(e=>this.maybeBroadcastWatch.forget(e)),this.watches.clear(),fc(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(e){const t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())}txCount=0;batch(e){const{update:t,optimistic:n=!0,removeOptimistic:r,onWatchUpdated:i}=e;let a;const o=e=>{const{data:n,optimisticData:r}=this;++this.txCount,e&&(this.data=this.optimisticData=e);try{return a=t(this)}finally{--this.txCount,this.data=n,this.optimisticData=r}},s=/* @__PURE__ */new Set;return i&&!this.txCount&&this.broadcastWatches({...e,onWatchUpdated:e=>(s.add(e),!1)}),"string"==typeof n?this.optimisticData=this.optimisticData.addLayer(n,o):!1===n?o(this.data):o(),"string"==typeof r&&(this.optimisticData=this.optimisticData.removeLayer(r)),i&&s.size?(this.broadcastWatches({...e,onWatchUpdated(e,t){const n=i.call(this,e,t);return!1!==n&&s.delete(e),n}}),s.size&&s.forEach(e=>this.maybeBroadcastWatch.dirty(e))):this.broadcastWatches(e),a}performTransaction(e,t){return this.batch({update:e,optimistic:t||null!==t})}transformDocument(e){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(e))}fragmentMatches(e,t){return this.policies.fragmentMatches(e,t)}lookupFragment(e){return this.config.fragments?.lookup(e)||null}resolvesClientField(e,t){return!!this.policies.getReadFunction(e,t)}broadcastWatches(e){if(!this.txCount){const t=this.onAfterBroadcast,n=/* @__PURE__ */new Set;this.onAfterBroadcast=e=>{n.add(e)};try{this.watches.forEach(t=>this.maybeBroadcastWatch(t,e)),n.forEach(e=>e())}finally{this.onAfterBroadcast=t}}}addFragmentsToDocument(e){const{fragments:t}=this.config;return t?t.transform(e):e}broadcastWatch(e,t){const{lastDiff:n}=e,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&Ys(n.result,r.result)||e.callback(e.lastDiff=r,n)}};function $c(e,t){return"object"==typeof e&&null!==e&&e[Symbol.for("apollo.error")]===t}function Vc(e){Object.defineProperty(e,Symbol.for("apollo.error"),{value:e.name,enumerable:!1,writable:!1,configurable:!1})}function qc(e){return e.map(e=>e.message||"Error message not found.").join("\n")}var Bc=class e extends Error{static is(e){return $c(e,"CombinedProtocolErrors")}static formatMessage=qc;errors;constructor(t){super(e.formatMessage(t,{defaultFormatMessage:qc})),this.name="CombinedProtocolErrors",this.errors=t,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Uc=class e extends Error{static is(e){return $c(e,"UnconventionalError")}constructor(t){super("An error of unexpected shape occurred.",{cause:t}),this.name="UnconventionalError",Vc(this),Object.setPrototypeOf(this,e.prototype)}};function Hc(e){return e.filter(e=>e).map(e=>e.message||"Error message not found.").join("\n")}var Wc=class e extends Error{static is(e){return $c(e,"CombinedGraphQLErrors")}static formatMessage=Hc;errors;data;extensions;constructor(t,n=t.errors||[]){super(e.formatMessage(n,{result:t,defaultFormatMessage:Hc})),this.errors=n,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",Vc(this),Object.setPrototypeOf(this,e.prototype)}},Gc=/* @__PURE__ */new WeakSet,Jc=class e extends Error{static is(e){return $c(e,"ServerError")}response;statusCode;bodyText;constructor(t,n){super(t),this.name="ServerError",this.response=n.response,this.statusCode=n.response.status,this.bodyText=n.bodyText,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Kc=class e extends Error{static is(e){return $c(e,"ServerParseError")}response;statusCode;bodyText;constructor(t,n){super(t instanceof Error?t.message:"Could not parse server response",{cause:t}),this.name="ServerParseError",this.response=n.response,this.statusCode=n.response.status,this.bodyText=n.bodyText,Vc(this),Object.setPrototypeOf(this,e.prototype)}},Qc=Symbol();function Yc(e){return"extensions"in e&&Bc.is(e.extensions[Qc])}function Xc(e){return function(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name&&("string"==typeof e.stack||void 0===e.stack)}(e)?e:"string"==typeof e?new Error(e,{cause:e}):new Uc(e)}var Zc,eu=/* @__PURE__ */new WeakMap;!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error",e[e.streaming=9]="streaming"}(Zc||(Zc={}));var{assign:tu,hasOwnProperty:nu}=Object,ru={loading:!0,networkStatus:Zc.loading,data:void 0,dataState:"empty",partial:!0},iu={loading:!1,networkStatus:Zc.ready,data:void 0,dataState:"empty",partial:!0},au=/* @__PURE__ */new WeakMap;function ou(e,t){const n=e[t];"function"==typeof n&&(e[t]=function(){return au.set(e,(au.get(e)+1)%1e15),n.apply(this,arguments)})}var su=class{options;queryName;variablesUnknown=!1;didWarnOnFeud=!1;lastMissing;get query(){return this.lastQuery}get variables(){return this.options.variables}unsubscribeFromCache;input;subject;isTornDown;queryManager;subscriptions=/* @__PURE__ */new Set;waitForNetworkResult;lastQuery;linkSubscription;pollingInfo;get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}constructor({queryManager:e,options:t,transformedQuery:n=e.transform(t.query)}){this.queryManager=e;const{cache:r}=e;au.has(r)||(au.set(r,0),ou(r,"evict"),ou(r,"modify"),ou(r,"reset")),this.waitForNetworkResult="network-only"===t.fetchPolicy,this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:i="cache-first"}={}}=e.defaultOptions,{fetchPolicy:a=i,initialFetchPolicy:o=("standby"===a?i:a)}=t;t[ul]&&(qa("standby"===a,84),this.variablesUnknown=!0),this.lastQuery=n,this.options={...t,initialFetchPolicy:o,fetchPolicy:a,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const s=To(this.query);this.queryName=s&&s.name&&s.name.value}initializeObservablesQueue(){this.subject=new Wi({query:this.query,variables:this.variables,result:ru,meta:{}});const e=this.subject.pipe(_a({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),Ws(({query:e,variables:t,result:n,meta:r},i)=>{const{shouldEmit:a}=r;if(n===ru&&(i.previous=void 0,i.previousVariables=void 0),"standby"===this.options.fetchPolicy||2===a)return;if(1===a)return l();const{previous:o,previousVariables:s}=i;if(o){const r=this.queryManager.getDocumentInfo(e),i=this.queryManager.dataMasking,a=i?r.nonReactiveQuery:e;if((i||r.hasNonreactiveDirective?rl(a,o,n,t):Ys(o,n))&&Ys(s,t))return}if(3!==a||this.options.notifyOnNetworkStatusChange&&!Ys(o,n))return l();function l(){return i.previous=n,i.previousVariables=t,n}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new Ui,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}subscribe;pipe;[Symbol.observable];"@@observable";getCacheDiff({optimistic:e=!0}={}){return Us(this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e,[dl]:void 0}))}getInitialResult(e){let t=e||this.options.fetchPolicy;!this.queryManager.prioritizeCacheValues||"network-only"!==t&&"cache-and-network"!==t||(t="cache-first");const n=()=>{const e=this.getCacheDiff();let{dataState:t}=e;const n=this.options.returnPartialData||e.complete?e.result??void 0:void 0;return void 0===n&&(t="empty"),this.maskResult({data:n,dataState:t,loading:!e.complete,networkStatus:e.complete?Zc.ready:Zc.loading,partial:!e.complete})};switch(t){case"cache-only":return{...n(),loading:!1,networkStatus:Zc.ready};case"cache-first":return n();case"cache-and-network":return{...n(),loading:!0,networkStatus:Zc.loading};case"standby":return iu;default:return ru}}resubscribeCache(){const{variables:e,fetchPolicy:t}=this.options,n=this.query,r="standby"===t||"no-cache"===t||this.waitForNetworkResult,i=!lu({query:n,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((r||i)&&this.unsubscribeFromCache?.(),r||!i)return;const a={query:n,variables:e,optimistic:!0,watcher:this,callback:e=>{const t=this.queryManager.getDocumentInfo(n);if((t.hasClientExports||t.hasForcedResolvers)&&(a.lastDiff=void 0),a.lastOwnDiff===e)return;const{result:r}=this.subject.getValue();(e.complete||!r.error&&r!==ru&&r!==iu)&&(Ys(r.data,e.result)||this.scheduleNotify())}},o=this.cache.watch(a);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,o()},{query:n,variables:e})}stableLastResult;getCurrentResult(){const{result:e}=this.subject.getValue();let t=e.networkStatus===Zc.error||this.hasObservers()||"no-cache"===this.options.fetchPolicy?e:this.getInitialResult();return t===ru&&(t=this.getInitialResult()),Ys(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){const{fetchPolicy:t}=this.options,n={pollInterval:0};return n.fetchPolicy="no-cache"===t?"no-cache":"network-only",e&&!Ys(this.variables,e)&&(n.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._reobserve(n,{newNetworkStatus:Zc.refetch})}fetchMore({query:e,variables:t,context:n,errorPolicy:r,updateQuery:i}){qa("cache-only"!==this.options.fetchPolicy,86,Za(this.query,"(anonymous)"));const a={...zo(this.options,{errorPolicy:"none"},{query:e,context:n,errorPolicy:r}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};a.query=this.transformDocument(a.query),this.lastQuery=e?this.transformDocument(this.options.query):a.query;let o=!1;const s="no-cache"!==this.options.fetchPolicy;s||qa(i,87);const{finalize:l,pushNotification:c}=this.pushOperation(Zc.fetchMore);c({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:u,operator:d}=cu(),{observable:p}=this.queryManager.fetchObservableWithInfo(a,{networkStatus:Zc.fetchMore,exposeExtensions:!0}),h=p.pipe(d,Ca(e=>"N"===e.kind&&"network"===e.source)).subscribe({next:e=>{o=!1;const t=e.value,n=t[ll];if(wl(e.value.networkStatus)&&l(),s){const e=this.getCacheDiff();this.cache.batch({update:e=>{i?e.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:n},e=>i(e,{fetchMoreResult:t.data,variables:a.variables})):e.writeQuery({query:a.query,variables:a.variables,data:t.data,extensions:n})},onWatchUpdated:(n,r)=>{if(n.watcher===this&&!Ys(r.result,e.result)){o=!0;const e=this.getCurrentResult();Sl(t.networkStatus)&&c({kind:"N",source:"network",value:{...e,networkStatus:t.networkStatus===Zc.error?Zc.ready:t.networkStatus,loading:!1,data:r.result,dataState:r.complete?"complete":"streaming"}})}}})}else{const e=this.getCurrentResult(),n=i(e.data,{fetchMoreResult:t.data,variables:a.variables});c({kind:"N",value:{...e,networkStatus:Zc.ready,loading:!1,data:n,dataState:"streaming"===e.dataState?"streaming":"complete"},source:"network"})}}});return js(u.then(e=>Hs(this.maskResult(e))).finally(()=>{if(h.unsubscribe(),l(),s&&!o){const e=this.getCurrentResult();"streaming"===e.dataState?c({kind:"N",source:"network",value:{...e,dataState:"complete",networkStatus:Zc.ready}}):c({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(e){const t=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:t=>{const{updateQuery:n,onError:r}=e,{error:i}=t;i?r?r(i):qa.error(88,i):n&&this.updateQuery((e,r)=>n(e,{subscriptionData:t,...r}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){const t=zo(this.options,e||{});tu(this.options,t),this.updatePolling()}async setVariables(e){return e=this.getVariablesWithDefaults(e),Ys(this.variables,e)?Hs(this.getCurrentResult()):(this.options.variables=e,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},{newNetworkStatus:Zc.setVariables}):Hs(this.getCurrentResult()))}updateQuery(e){const{queryManager:t}=this,{result:n,complete:r}=this.getCacheDiff({optimistic:!1}),i=e(n,{variables:this.variables,complete:!!r,previousData:n});i&&(this.cache.writeQuery({query:this.options.query,data:i,variables:this.variables}),t.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,t){if(t.nextFetchPolicy){const{fetchPolicy:n="cache-first",initialFetchPolicy:r=n}=t;"standby"===n||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy.call(t,n,{reason:e,options:t,observable:this,initialFetchPolicy:r}):t.fetchPolicy="variables-changed"===e?r:t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,n,r){const i=this.options.fetchPolicy;e.context??={};let a=!1,{observable:o,fromLink:s}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:n,onCacheHit:()=>{a=!0},fetchQueryOperator:e=>new ji(n=>{try{return e.subscribe({next(e){a=!0,n.next(e)},error:e=>n.error(e),complete:()=>n.complete()})}finally{a||(u.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:l,variables:c,meta:{shouldEmit:3,fetchPolicy:i}}))}}),observableQuery:this});const{query:l,variables:c}=this,u={abort:()=>{p.unsubscribe()},query:l,variables:c};this.activeOperations.add(u);let d=t==Zc.refetch||t==Zc.setVariables;o=o.pipe(r,Oa());const p=o.pipe(_a({next:e=>{"newNetworkStatus"===e.source||"N"===e.kind&&e.value.loading?u.override=t:delete u.override},finalize:()=>this.activeOperations.delete(u)})).subscribe({next:e=>{const t={};d&&"N"===e.kind&&"loading"in e.value&&!e.value.loading&&(d=!1,t.shouldEmit=1),this.input.next({...e,query:l,variables:c,meta:t})}});return{fromLink:s,subscription:p,observable:o}}didWarnCacheOnlyPolling=!1;updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{fetchPolicy:t,pollInterval:n}}=this,r=()=>{const{options:e}=this;return!e.pollInterval||!this.hasObservers()||"cache-only"===e.fetchPolicy||"standby"===e.fetchPolicy};if(r())return void this.cancelPolling();if(e?.interval===n)return;(e||(this.pollingInfo={})).interval=n;const i=()=>{if(r())return this.cancelPolling();this.pollingInfo&&(Sl(this.networkStatus)||this.options.skipPollAttempt?.()?a():this._reobserve({fetchPolicy:"no-cache"===this.options.initialFetchPolicy?"no-cache":"network-only"},{newNetworkStatus:Zc.poll}).then(a,a))},a=()=>{const e=this.pollingInfo;e&&(clearTimeout(e.timeout),e.timeout=setTimeout(i,e.interval))};a()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:n,keepLastMissing:r}=t||{};r||(this.lastMissing=void 0),this.queryManager.obsQueries.add(this);const i=n===Zc.refetch||n===Zc.poll,a=this.variables,o=this.options.fetchPolicy,s=zo(this.options,e||{});this.variablesUnknown&&="standby"===s.fetchPolicy;const l=i?s:tu(this.options,s),c=this.transformDocument(l.query);this.lastQuery=c,e&&"variables"in e&&(l.variables=this.getVariablesWithDefaults(e.variables)),i||(this.updatePolling(),!e||!e.variables||Ys(e.variables,a)||"standby"===l.fetchPolicy||l.fetchPolicy!==o&&"function"!=typeof l.nextFetchPolicy||(this.applyNextFetchPolicy("variables-changed",l),void 0===n&&(n=Zc.setVariables)));const u=this.networkStatus;n||(n=Zc.loading,u!==Zc.loading&&e?.variables&&!Ys(e.variables,a)&&(n=Zc.setVariables),"standby"===l.fetchPolicy&&(n=Zc.ready)),"standby"===l.fetchPolicy&&this.cancelPolling(),this.resubscribeCache();const{promise:d,operator:p}=cu("standby"===l.fetchPolicy?{data:void 0}:void 0),{subscription:h,observable:f,fromLink:m}=this.fetch(l,n,c,p);i||!m&&this.linkSubscription||(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=h);const g=Object.assign(js(d.then(e=>Hs(this.maskResult(e))).finally(()=>{this.hasObservers()||0!==this.activeOperations.size||this.tearDownQuery()})),{retain:()=>{const e=f.subscribe({}),t=()=>e.unsubscribe();return d.then(t,t),g}});return g}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){this.isTornDown||(this.resetNotifications(),this.unsubscribeFromCache?.(),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this.lastMissing=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){const t=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return t===e.data?e:{...e,data:t}}dirty=!1;notifyTimeout;resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){const e=this.queryManager.getDocumentInfo(this.query);if(e.hasClientExports||e.hasForcedResolvers)return}const{dirty:t,lastMissing:n}=this,{fetchPolicy:r}=this.options;if(this.resetNotifications(),!t||"cache-only"!==r&&"cache-and-network"!==r&&this.activeOperations.size)return;const i=this.getCacheDiff(),a=this.getCurrentResult();if(Ys(i.result,this.getCacheDiff({optimistic:!1}).result)&&(i.complete||a.networkStatus!==Zc.streaming)){if(i.complete)this.lastMissing=void 0;else if(n&&n.dmCount===au.get(this.cache)&&Ys(n.variables,this.variables)&&Ys(n.missing,i.missing?.missing)){if("cache-only"!==r)return void("partial"===a.dataState&&this.deliverCacheDiff(i))}else this.didWarnOnFeud=!1,this.lastMissing={variables:this.variables,missing:i.missing?.missing,dmCount:au.get(this.cache)};this.reobserveCacheFirst()}else this.deliverCacheDiff(i)}deliverCacheDiff(e){const t=this.getCurrentResult();this.input.next({kind:"N",value:{data:e.result,dataState:e.dataState,networkStatus:t.networkStatus,loading:t.loading,error:void 0,partial:!e.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}activeOperations=/* @__PURE__ */new Set;pushOperation(e){let t=!1;const{query:n,variables:r}=this,i=()=>{this.activeOperations.delete(a)},a={override:e,abort:()=>{t=!0,i()},query:n,variables:r};return this.activeOperations.add(a),{finalize:i,pushNotification:(e,i)=>{t||this.input.next({...e,query:n,variables:r,meta:{...i}})}}}calculateNetworkStatus(e){return e===Zc.streaming?e:Array.from(this.activeOperations.values()).reverse().find(e=>lu(e,this)&&void 0!==e.override)?.override??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e="cache-only"===this.options.fetchPolicy;this.lastMissing=void 0,this.setResult(e?iu:ru,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,t){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...t}})}operator=Ws(e=>{const{query:t,meta:n}=e;if("setResult"===e.source)return{query:t,variables:this.variables,result:e.value,meta:n};if("C"===e.kind)return;const r="resolvedVariables"in e?e.resolvedVariables:void 0;if(e.query!==this.query)return;if(!Ys(r,this.variables)){if(!Ys(e.variables,this.variables))return;r&&(this.options.variables=r,this.resubscribeCache())}const i=this.variables;let a;const o=this.subject.getValue();if("cache"===e.source){if(a=e.value,a.networkStatus===Zc.ready&&"partial"===a.dataState&&(!this.options.returnPartialData||o.result.networkStatus===Zc.error)&&"cache-only"!==this.options.fetchPolicy)return}else if("network"===e.source)this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),a="E"===e.kind?{...lu(o,e)||r&&Ys(r,o.variables)?o.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:Zc.error,loading:!1}:e.value,"E"===e.kind&&"streaming"===a.dataState&&(a.dataState=eu.get(e.error)??"complete"),a.error&&(n.shouldEmit=1);else if("newNetworkStatus"===e.source){const t=lu(o,e)?o.result:this.getInitialResult(n.fetchPolicy),{resetError:r}=e.value,i=r?void 0:t.error,s=i?Zc.error:Zc.ready;a={...t,error:i,networkStatus:s}}return qa(a),a.error||delete a.error,a.networkStatus=this.calculateNetworkStatus(a.networkStatus),a.loading=Sl(a.networkStatus),a=this.maskResult(a),void 0!==o.result.data&&a.data!==o.result.data&&Ys(a.data,o.result.data)&&(a.data=o.result.data),{query:t,variables:i,result:a,meta:n}});reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:t}=this.options;"cache-and-network"===e||"network-only"===e?this._reobserve({fetchPolicy:"cache-first",nextFetchPolicy(n,r){return this.nextFetchPolicy=t,"function"==typeof this.nextFetchPolicy?this.nextFetchPolicy(n,r):e}},{keepLastMissing:!0}):this._reobserve(void 0,{keepLastMissing:!0})}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}};function lu(e,t){return!!(e&&t&&e.query===t.query&&Ys(e.variables,t.variables))}function cu(e){let t,n,r=e;return{promise:new Promise((e,r)=>{t=e,n=r}),operator:_a({next(e){if("E"===e.kind)return n(e.error);"N"!==e.kind||"newNetworkStatus"===e.source||e.value.loading||(r=e.value)},finalize:()=>{if(r)t(r);else{const e="The operation was aborted.",t="AbortError";n("undefined"!=typeof DOMException?new DOMException(e,t):Object.assign(/* @__PURE__ */new Error(e),{name:t}))}}})}}var uu={},du=/* @__PURE__ */new WeakMap,pu=class{cache;queryManager;id;observableQuery;incremental;constructor(e,t){this.cache=e.cache;const n=(du.get(e)||0)+1;du.set(e,n),this.id=n+"",this.observableQuery=t,this.queryManager=e}get hasNext(){return!!this.incremental&&this.incremental.hasNext}get incrementalHandler(){return this.queryManager.incrementalHandler}maybeHandleIncrementalResult(e,t,n){return this.incrementalHandler.isIncrementalResult(t)?(this.incremental||=this.incrementalHandler.startRequest({query:n}),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:n,errorPolicy:r,cacheWriteBehavior:i,returnPartialData:a,fetchPolicy:o,networkStatus:s,prunePendingDeferFragments:l}){const c={query:t,variables:n,optimistic:!0};this.observableQuery?.resetNotifications();const u=0===i,d=u?void 0:this.getDiff({...c,returnPartialData:"none"!==r||!this.incrementalHandler.extractErrors(e)?.length},this.getIncrementalInfo({prune:l})),p=this.maybeHandleIncrementalResult(d?.result,e,t);let h={...p,dataState:null==p.data?"empty":"complete"};return(this.incremental?.getPendingWithInfo?.().some(e=>"defer"===e.type&&!e.delivered)||!this.incremental?.getPendingWithInfo&&this.hasNext&&Wo(["defer"],t))&&(h.dataState="streaming"),u||!hu(h,r)||this.cache.batch({onWatchUpdated:(e,t)=>{e.watcher===this.observableQuery&&(e.lastOwnDiff=t)},update:e=>{e.writeQuery({query:t,data:h.data,variables:n,overwrite:1===i,extensions:h.extensions});const{dataState:r,result:u}=this.getDiff({...c,returnPartialData:a&&("network-only"!==o||s===Zc.refetch)},this.getIncrementalInfo({prune:l}));("complete"===r||"streaming"===r||a&&"partial"===r)&&(h={...h,data:u,dataState:r})}}),h}getIncrementalInfo({prune:e}){const t=this.incremental?.getPendingWithInfo?.()??[],n=this.incremental?.streamInfo,r={streamInfo:n};if(e)for(const i of t)"defer"!==i.type||i.delivered?n&&"stream"===i.type&&(n.lookupArray(i.path).state.truncate=!0):(r.deferInfo||=new io(!0,()=>!0),r.deferInfo.lookupArray(i.path.concat(i.label||[])));return r}getDiff(e,t){return Us(this.cache.diff({...e,[dl]:t}))}markMutationResult(e,t,n=this.cache){const r=[],i=0===t.cacheWriteBehavior;let a=this.maybeHandleIncrementalResult(i?void 0:n.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if("ignore"===t.errorPolicy&&(a={...a,errors:[]}),Ho(a)&&"none"===t.errorPolicy)return Promise.resolve(a);const o=()=>({...a,dataState:this.hasNext?"streaming":"complete"});if(!i&&hu(a,t.errorPolicy)){r.push({result:a.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables,extensions:a.extensions});const{updateQueries:e}=t;e&&this.queryManager.getObservableQueries("all").forEach(t=>{const n=t&&t.queryName;if(!n||!Object.hasOwnProperty.call(e,n))return;const i=e[n],{query:a,variables:s}=t,{result:l,complete:c}=t.getCacheDiff({optimistic:!1});if(c&&l){const e=i(l,{mutationResult:o(),queryName:a&&Za(a)||void 0,queryVariables:s});e&&r.push({result:e,dataId:"ROOT_QUERY",query:a,variables:s})}})}let s=t.refetchQueries;if("function"==typeof s&&(s=s(o())),r.length>0||(s||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){const e=[];if(this.queryManager.refetchQueries({updateCache:e=>{i||r.forEach(t=>e.write(t));const{update:n}=t;if(!i){const n=e.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});n.complete&&(a={...a,data:n.result})}n&&!this.hasNext&&n(e,a,{context:t.context,variables:t.variables}),i||t.keepRootFields||this.hasNext||e.modify({id:"ROOT_MUTATION",fields:(e,{fieldName:t,DELETE:n})=>"__typename"===t?e:n})},include:s,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(t=>e.push(t)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(e).then(()=>a)}return Promise.resolve(a)}markMutationOptimistic(e,t){const n="function"==typeof e?e(t.variables,{IGNORE:uu}):e;return n!==uu&&(this.cache.recordOptimisticTransaction(e=>{try{this.markMutationResult({data:n},t,e)}catch(r){qa.error(r)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:n,errorPolicy:r,cacheWriteBehavior:i}){if(0!==i){if(hu(e,r)){this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:n,extensions:e.extensions});const r=this.cache.diff({query:this.queryManager.getDocumentInfo(t).asQuery,id:"ROOT_SUBSCRIPTION",variables:n,optimistic:!1,returnPartialData:!0});r.complete&&(e.data=r.result)}this.queryManager.broadcastQueries()}}};function hu(e,t="none"){const n="ignore"===t||"all"===t;let r=!Ho(e);return!r&&n&&e.data&&(r=!0),r}var fu=class{defaultOptions;client;clientOptions;assumeImmutableResults;documentTransform;ssrMode;defaultContext;dataMasking;incrementalHandler;localState;queryDeduplication;prioritizeCacheValues=!1;onBroadcast;mutationStore;obsQueries=/* @__PURE__ */new Set;fetchCancelFns=/* @__PURE__ */new Map;constructor(e){const t=new gl(e=>this.cache.transformDocument(e),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const n=e.documentTransform;this.documentTransform=n?t.concat(n).concat(t):t,this.incrementalHandler.documentTransform&&(this.documentTransform=this.documentTransform.concat(this.incrementalHandler.documentTransform)),this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches(Ua(93))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}async mutate({mutation:e,variables:t,optimisticResponse:n,updateQueries:r,refetchQueries:i=[],awaitRefetchQueries:a=!1,update:o,onQueryUpdated:s,fetchPolicy:l,errorPolicy:c,keepRootFields:u,context:d}){const p=new pu(this);e=this.cache.transformForLink(this.transform(e));const{hasClientExports:h}=this.getDocumentInfo(e);t=this.getVariables(e,t),h&&(t=await this.localState.getExportedVariables({client:this.client,document:e,variables:t,context:d}));const f=this.mutationStore&&(this.mutationStore[p.id]={mutation:e,variables:this.cache.serializeVariables(e,t),loading:!0,error:null}),m=n&&p.markMutationOptimistic(n,{document:e,variables:t,cacheWriteBehavior:"no-cache"===l?0:2,errorPolicy:c,context:d,updateQueries:r,update:o,keepRootFields:u});return this.broadcastQueries(),new Promise((h,g)=>{const y={};return this.getObservableFromLink(e,{...d,optimisticResponse:m?n:void 0},t,l,{},!1).observable.pipe(mu(),Na(n=>{const h={...n};return va(p.markMutationResult(h,{document:e,variables:t,cacheWriteBehavior:"no-cache"===l?0:2,errorPolicy:c,context:d,update:o,updateQueries:r,awaitRefetchQueries:a,refetchQueries:i,removeOptimistic:m?p.id:void 0,onQueryUpdated:s,keepRootFields:u}))})).pipe(Sa(e=>{if(Ho(e)&&"none"===c)throw new Wc(yu(e));return f&&(f.loading=!1,f.error=null),e})).subscribe({next:t=>{if(this.broadcastQueries(),!p.hasNext){const n={data:this.maskOperation({document:e,data:t.data,fetchPolicy:l,cause:y})};Ho(t)&&(n.error=new Wc(t)),Object.keys(t.extensions||{}).length&&(n.extensions=t.extensions),h(n)}},error:e=>(f&&(f.loading=!1,f.error=e),m&&this.cache.removeOptimistic(p.id),this.broadcastQueries(),"ignore"===c?h({data:void 0}):"all"===c?h({data:void 0,error:e}):void g(e))})})}fetchQuery(e,t){return vo(e.query,Ht),(async()=>{return n=this.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(Ws(e=>{switch(e.kind){case"E":throw e.error;case"N":if("newNetworkStatus"!==e.source)return Hs(e.value)}})),r={defaultValue:{data:void 0}},new Promise(function(e,t){var i,a=!1;n.subscribe({next:function(e){i=e,a=!0},error:t,complete:function(){e(a?i:r.defaultValue)}})});var n,r})()}transform(e){return this.documentTransform.transformDocument(e)}transformCache=new go(Xa["queryManager.getDocumentInfo"]||2e3);getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const n=To(e),r={hasClientExports:Wo(["client","export"],e,!0),hasForcedResolvers:Go(e),hasNonreactiveDirective:Wo(["nonreactive"],e),hasIncrementalDirective:Wo(["defer"],e),nonReactiveQuery:gu(e),clientQuery:Wo(["client"],e)?e:null,serverQuery:Fs([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:n?.operation,defaultVars:Ro(n),asQuery:{...e,definitions:e.definitions.map(e=>"OperationDefinition"===e.kind&&"query"!==e.operation?{...e,operation:"query"}:e)}};t.set(e,r)}const n=t.get(e);if(n.violation)throw n.violation;return n}getVariables(e,t){const n=this.getDocumentInfo(e).defaultVars,r=Object.entries(t??{}).map(([e,t])=>[e,void 0===t?n[e]:t]);return{...n,...Object.fromEntries(r)}}watchQuery(e){vo(e.query,Ht);const t=this.transform(e.query);return void 0===(e={...e,variables:this.getVariables(t,e.variables)}).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!0),new su({queryManager:this,options:e,transformedQuery:t})}query(e){const t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(n=>({...n,data:this.maskOperation({document:t,data:n?.data,fetchPolicy:e.fetchPolicy})}))}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(Ua(95)),this.obsQueries.forEach(e=>{e.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const t=/* @__PURE__ */new Set,n=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map,i=/* @__PURE__ */new Set;return Array.isArray(e)&&e.forEach(e=>{if("string"==typeof e)n.set(e,e),r.set(e,!1);else if(Ao(t=e)&&"Document"===t.kind&&Array.isArray(t.definitions)){const t=yl(this.transform(e));n.set(t,Za(e)),r.set(t,!1)}else Ao(e)&&e.query&&i.add(e);var t}),this.obsQueries.forEach(n=>{const i=yl(this.transform(n.options.query));if("all"===e)return void t.add(n);const{queryName:a,options:{fetchPolicy:o}}=n;"active"===e&&"standby"===o||("active"===e||a&&r.has(a)||i&&r.has(i))&&(t.add(n),a&&r.set(a,!0),i&&r.set(i,!0))}),i.size&&i.forEach(e=>{const n=new su({queryManager:this,options:{...Ls(this.defaultOptions.watchQuery,e),fetchPolicy:"network-only"}});t.add(n)}),t}refetchObservableQueries(e=!1){const t=[];return this.getObservableQueries(e?"all":"active").forEach(n=>{const{fetchPolicy:r}=n.options;!e&&"standby"===r||"cache-only"===r||t.push(n.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let{query:t,variables:n}=e;const{fetchPolicy:r="cache-first",errorPolicy:i="none",context:a={},extensions:o={}}=e;let s;vo(t,Gt),t=this.transform(t),n=this.getVariables(t,n);const l=(this.getDocumentInfo(t).hasClientExports?va(this.localState.getExportedVariables({client:this.client,document:t,variables:n,context:a})):xa(n)).pipe(Na(e=>{const{observable:n,restart:l}=this.getObservableFromLink(t,a,e,r,o),c=new pu(this);return s=l,n.pipe(Sa(n=>{c.markSubscriptionResult(n,{document:t,variables:e,errorPolicy:i,cacheWriteBehavior:"no-cache"===r?0:2});const a={data:n.data??void 0};return Ho(n)?a.error=new Wc(n):Yc(n)&&(a.error=n.extensions[Qc],delete n.extensions[Qc]),n.extensions&&Object.keys(n.extensions).length&&(a.extensions=n.extensions),a.error&&"none"===i&&(a.data=void 0),"ignore"===i&&delete a.error,a}),Ea(e=>xa("ignore"===i?{data:void 0}:{data:void 0,error:e})),Ca(e=>!(!e.data&&!e.error)))}));return Object.assign(l,{restart:()=>s?.()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}inFlightLinkObservables=new io(!1);getObservableFromLink(e,t,n,r,i,a=t?.queryDeduplication??this.queryDeduplication){let o={};const{serverQuery:s,clientQuery:l,operationType:c,hasIncrementalDirective:u}=this.getDocumentInfo(e),d=Za(e),p={client:this.client};if(n=this.cache.serializeVariables(e,n),s){const{inFlightLinkObservables:m,link:g}=this;try{const y=this.incrementalHandler.prepareRequest({query:s,variables:n,context:{...this.defaultContext,...t,queryDeduplication:a},extensions:i});function b(e){return new ji(t=>{function n(){return e.subscribe({next:t.next.bind(t),complete:t.complete.bind(t),error:t.error.bind(t)})}let r=n();return o.restart||=()=>{r.unsubscribe(),r=n()},()=>{r.unsubscribe(),o.restart=void 0}})}if(t=y.context,a){const v=yl(s),x=Fo(n);o=m.lookup(v,x),o.observable||(o.observable=Tl(g,y,p).pipe(b,(h=()=>{m.peek(v,x)===o&&m.remove(v,x)},$i(function(e,t){try{e.subscribe(t)}finally{t.add(h)}})),c===Gt?Oa():Aa({refCount:!0})))}else o.observable=Tl(g,y,p).pipe(b)}catch(f){o.observable=ka(()=>f)}}else o.observable=xa({data:{}});var h;if(l){const{operation:k}=To(e);qa(!u,100,k[0].toUpperCase()+k.slice(1),d??"(anonymous)"),o.observable=o.observable.pipe(Na(e=>va(this.localState.execute({client:this.client,document:l,remoteResult:e,context:t,variables:n,fetchPolicy:r}))))}return{restart:()=>o.restart?.(),observable:o.observable.pipe(Ea(e=>{throw function(e){Gc.add(e)}(e=Xc(e)),e}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:n,observableQuery:r,exposeExtensions:i,prunePendingDeferFragments:a}){const{errorPolicy:o}=e,s=this.cache.transformForLink(e.query);return this.getObservableFromLink(s,e.context,e.variables,e.fetchPolicy).observable.pipe(Sa(l=>{const{dataState:c,...u}=t.markQueryResult(l,{...e,document:s,cacheWriteBehavior:n,returnPartialData:e.returnPartialData,prunePendingDeferFragments:a}),d=Ho(u);if(d&&"none"===o){r?.resetNotifications();const e=new Wc(yu(u));throw eu.set(e,c),e}const p="complete"!==c,h={data:u.data,...t.hasNext?{loading:!0,networkStatus:Zc.streaming,dataState:c,partial:p}:{dataState:c,loading:!1,networkStatus:Zc.ready,partial:p}};return i&&"extensions"in u&&(h[ll]=u.extensions),d&&"ignore"!==o&&(h.error=new Wc(yu(u)),h.networkStatus!==Zc.streaming&&(h.networkStatus=Zc.error)),h}),Ea(e=>{if("none"===o)throw r?.resetNotifications(),e;const t={data:void 0,dataState:"empty",loading:!1,networkStatus:Zc.ready,partial:!0};return"ignore"!==o&&(t.error=e,t.networkStatus=Zc.error),xa(t)}))}fetchObservableWithInfo(e,{networkStatus:t=Zc.loading,query:n=e.query,fetchQueryOperator:r=e=>e,onCacheHit:i=()=>{},observableQuery:a,exposeExtensions:o}){const s=this.getVariables(n,e.variables);let{fetchPolicy:l="cache-first",errorPolicy:c="none",returnPartialData:u=!1,notifyOnNetworkStatusChange:d=!0,context:p={}}=e;!this.prioritizeCacheValues||"network-only"!==l&&"cache-and-network"!==l||(l="cache-first");const h=Object.assign({},e,{query:n,variables:s,fetchPolicy:l,errorPolicy:c,returnPartialData:u,networkStatus:t,notifyOnNetworkStatusChange:d,context:p}),f=new pu(this,a),m=n=>{h.variables=n;const s="no-cache"===l?0:t===Zc.refetch&&"merge"!==h.refetchWritePolicy?1:2,c=this.fetchQueryByPolicy(h,{queryInfo:f,cacheWriteBehavior:s,onCacheHit:i,observableQuery:a,exposeExtensions:o});return c.observable=c.observable.pipe(r),"standby"!==h.fetchPolicy&&a?.applyNextFetchPolicy("after-fetch",e),c},g=()=>{this.fetchCancelFns.delete(f.id)};this.fetchCancelFns.set(f.id,e=>{y.next({kind:"E",error:e,source:"network"})});const y=new Ui;let b,v;if(this.getDocumentInfo(h.query).hasClientExports)b=va(this.localState.getExportedVariables({client:this.client,document:h.query,variables:h.variables,context:h.context})).pipe(Na(e=>m(e).observable)),v=!0;else{const e=m(h.variables);v=e.fromLink,b=e.observable}return{observable:new ji(e=>{e.add(g),b.subscribe(e),y.subscribe(e)}).pipe(Oa()),fromLink:v}}refetchQueries({updateCache:e,include:t,optimistic:n=!1,removeOptimistic:r=(n?La("refetchQueries"):void 0),onQueryUpdated:i}){const a=/* @__PURE__ */new Map;t&&this.getObservableQueries(t).forEach(e=>{if("cache-only"===e.options.fetchPolicy||e.variablesUnknown)return;const t=e.getCurrentResult();a.set(e,{oq:e,lastDiff:{result:t?.data,complete:!t?.partial}})});const o=/* @__PURE__ */new Map;if(e){const t=/* @__PURE__ */new Set;this.cache.batch({update:e,optimistic:n&&r||!1,removeOptimistic:r,onWatchUpdated(e,n,r){const s=e.watcher;if(s instanceof su&&!t.has(s)){if(t.add(s),i){a.delete(s);let e=i(s,n,r);return!0===e&&(e=s.refetch().retain()),!1!==e&&o.set(s,e),e}null!==i&&"cache-only"!==s.options.fetchPolicy&&a.set(s,{oq:s,lastDiff:r,diff:n})}}})}return a.size&&a.forEach(({oq:e,lastDiff:t,diff:n})=>{let r;i&&(n||(n=e.getCacheDiff()),r=i(e,n,t)),i&&!0!==r||(r=e.refetch().retain()),!1!==r&&o.set(e,r)}),r&&this.cache.removeOptimistic(r),o}noCacheWarningsByCause=/* @__PURE__ */new WeakSet;maskOperation(e){const{document:t,data:n}=e;return this.dataMasking?function(e,t,n){const r=To(t);return qa(r,45),null==e?e:ec(e,r.selectionSet,{operationType:r.operation,operationName:r.name?.value,fragmentMap:ko(wo(t)),cache:n,mutableTargets:/* @__PURE__ */new WeakMap,knownChanged:/* @__PURE__ */new WeakSet})}(n,t,this.cache):n}maskFragment(e){const{data:t,fragment:n,fragmentName:r}=e;return this.dataMasking?function(e,t,n,r){const i=t.definitions.filter(e=>e.kind===on);void 0===r&&(qa(1===i.length,43,i.length),r=i[0].name.value);const a=i.find(e=>e.name.value===r);return qa(!!a,44,r),null==e||Ys(e,{})?e:ec(e,a.selectionSet,{operationType:"fragment",operationName:a.name.value,fragmentMap:ko(wo(t)),cache:n,mutableTargets:/* @__PURE__ */new WeakMap,knownChanged:/* @__PURE__ */new WeakSet})}(t,n,this.cache,r):t}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:n,errorPolicy:r,returnPartialData:i,context:a,networkStatus:o},{cacheWriteBehavior:s,onCacheHit:l,queryInfo:c,observableQuery:u,exposeExtensions:d}){const p=()=>c.getDiff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),h=(o,s)=>{const c=o.result,u=(e,t=o.dataState)=>(o.complete||i||(e=void 0,t="empty"),{data:e,dataState:t,loading:Sl(s),networkStatus:s,partial:!o.complete}),d=e=>xa({kind:"N",value:u(e),resolvedVariables:t,source:"cache"});return(o.complete||i)&&this.getDocumentInfo(e).hasForcedResolvers?(l(),va(this.localState.execute({client:this.client,document:e,remoteResult:c?{data:c}:void 0,context:a,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:n}).then(e=>({kind:"N",value:u(e.data||void 0,o.complete?"complete":e.data?"partial":"empty"),resolvedVariables:t,source:"cache"})))):"none"===r&&s===Zc.refetch&&o.missing?d(void 0):d(c||void 0)},f=({prunePendingDeferFragments:l=!0}={})=>this.getResultsFromLink({query:e,variables:t,context:a,fetchPolicy:n,errorPolicy:r,returnPartialData:i,networkStatus:o},{cacheWriteBehavior:s,queryInfo:c,observableQuery:u,exposeExtensions:d,prunePendingDeferFragments:l}).pipe(mu(),$i(function(e,t){e.subscribe(Vi(t,function(e){t.next(wa.createNext(e))},function(){t.next(wa.createComplete()),t.complete()},function(e){t.next(wa.createError(e)),t.complete()}))}),Sa(e=>({...e,resolvedVariables:t,source:"network"})));switch(n){default:case"cache-first":{const e=p();return e.complete?{fromLink:!1,observable:h(e,Zc.ready)}:i?{fromLink:!0,observable:Ta(h(e,Zc.loading),f())}:{fromLink:!0,observable:f()}}case"cache-and-network":{const e=p();return e.complete||i?{fromLink:!0,observable:Ta(h(e,Zc.loading),f({prunePendingDeferFragments:!1}))}:{fromLink:!0,observable:f()}}case"cache-only":return{fromLink:!1,observable:Ta(h(p(),Zc.ready))};case"network-only":return{fromLink:!0,observable:f({prunePendingDeferFragments:o!==Zc.refetch})};case"no-cache":return{fromLink:!0,observable:f().pipe(Sa(t=>("N"===t.kind&&null!=t.value.data&&this.cache.configuresScalars()&&(t.value.data=function(e,t,n){const r=To(t)?.operation,i=ko(wo(t));function a(e,t,n,r){let i=!1;const a=t.map(t=>{const a=o(e,t,n,r);return i||=a!==t,a});return i?a:t}function o(e,t,r,i){if(Array.isArray(t)&&!i)return a(e,t,r,i);if(e.selectionSet)return s(e.selectionSet,t);if(null===t||!r)return t;if(i){const o=Eo(i);if(o&&Array.isArray(t))return a(e,t,r,o[1]);const s=n.getScalar(Oo(i));if(s)return s.coerceToParsed(t)}return t}function s(e,t,r){if(null===t||"object"!=typeof t)return t;const a={...t};let s=!1;Object.hasOwn(t,"__typename")&&(r=t.__typename);const l=new Set(e.selections);return l.forEach(e=>{if(Co(e)){const i=Io(e);if(!Object.hasOwn(t,i))return;const l=t[i],c=o(e,l,r,r?n.getScalarTypeForField(r,e.name.value):void 0);s||=c!==l,a[i]=c}else{const t=So(e,i);t&&r&&n.fragmentMatches(t,r)&&t.selectionSet.selections.forEach(e=>l.add(e))}}),s?a:t}return qa(r,6),s(No(t).selectionSet,e,n.getRootTypename(r))}(t.value.data,e,this.cache)),t)))};case"standby":return{fromLink:!1,observable:ea}}}};function mu(){let e=!1;return _a({next(){e=!0},complete(){qa(e,104)}})}function gu(e){return ir(e,{FragmentSpread:e=>{if(!e.directives?.some(e=>"unmask"===e.name.value))return{...e,directives:[...e.directives||[],{kind:yn,name:{kind:Kt,value:"nonreactive"}}]}}})}function yu(e){if(null==e.extensions?.[cl])return e;const{extensions:{[cl]:t,...n},...r}=e;return Object.keys(n).length>0&&(r.extensions=n),r}var bu=class{link;cache;disableNetworkFetches;set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}version;queryDeduplication;defaultOptions;devtoolsConfig;refetchEventManager;queryManager;devToolsHookCb;resetStoreCallbacks=[];clearStoreCallbacks=[];constructor(e){const{cache:t,documentTransform:n,ssrMode:r=!1,ssrForceFetchDelay:i=0,queryDeduplication:a=!0,defaultOptions:o,defaultContext:s,assumeImmutableResults:l=t.assumeImmutableResults,localState:c,devtools:u,dataMasking:d,link:p,incrementalHandler:h=new hl,experiments:f=[],refetchEventManager:m}=e;this.link=p,this.cache=t,this.queryDeduplication=a,this.defaultOptions=o||{},this.devtoolsConfig={...u,enabled:u?.enabled??!1},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=Ma,this.queryManager=new fu({client:this,defaultOptions:this.defaultOptions,defaultContext:s,documentTransform:n,queryDeduplication:a,ssrMode:r,dataMasking:!!d,clientOptions:e,incrementalHandler:h,assumeImmutableResults:l,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:c}),this.prioritizeCacheValues=r||i>0,i&&setTimeout(()=>{this.prioritizeCacheValues=!1},i),this.devtoolsConfig.enabled&&this.connectToDevTools(),f.forEach(t=>t.call(this,e)),this.refetchEventManager=m,this.refetchEventManager?.connect(this)}connectToDevTools(){if("undefined"==typeof window)return;const e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop(),this.refetchEventManager?.disconnect(this)}watchQuery(e){const{refetchOn:t}=e;if(this.defaultOptions.watchQuery){const n=this.defaultOptions.watchQuery.refetchOn;let r;t&&"object"==typeof t&&("object"==typeof n?r={...n,...t}:null!=n&&(r=e=>{const r=t[e.source]??n;return"function"==typeof r?r(e):r})),e=Ls(this.defaultOptions.watchQuery,e),r&&(e.refetchOn=r)}return this.queryManager.watchQuery(e)}query=e=>(this.defaultOptions.query&&(e=Ls(this.defaultOptions.query,e)),this.queryManager.query(e));mutate=e=>{const t=Ls(zo({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return vo(t.mutation,Wt),this.queryManager.mutate(t)};subscribe(e){const t={},n=this.queryManager.startGraphQLSubscription(e),r=n.pipe(Sa(n=>({...n,data:this.queryManager.maskOperation({document:e.query,data:n.data,fetchPolicy:e.fetchPolicy,cause:t})})));return Object.assign(r,{restart:n.restart})}readQuery(e,t=!!e.optimistic){return this.cache.readQuery({...e,query:this.transform(e.query)},t)}watchFragment(e){const t=this.queryManager.dataMasking;return this.cache.watchFragment({...e,fragment:this.transform(e.fragment,t)})}readFragment(e,t=!!e.optimistic){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){const t=this.cache.writeQuery(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}writeFragment(e){const t=this.cache.writeFragment(e);return!1!==e.broadcast&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return Tl(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(t=>t!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(t=>t!==e)}}reFetchObservableQueries;refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((e,t)=>{n.push(t),r.push(e)});const i=Promise.all(r);return i.queries=n,i.results=r,i.catch(e=>{}),i}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}maskedFragmentTransform=new gl(qs);transform(e,t=!1){const n=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(n):n}},{hasOwnProperty:vu}=Object.prototype;function xu(e){return Ao(e)&&"payload"in e}function ku(e){const t={};return e.split("\n").forEach(e=>{const n=e.indexOf(":");if(n>-1){const r=e.slice(0,n).trim().toLowerCase(),i=e.slice(n+1).trim();t[r]=i}}),t}function wu(e,t){if(e.status>=300)throw new Jc(`Response not successful: Received status code ${e.status}`,{response:e,bodyText:t});try{return JSON.parse(t)}catch(n){throw new Kc(n,{response:e,bodyText:t})}}var Su={http:{includeQuery:!0,includeExtensions:!0,preserveHeaderCase:!1},headers:{accept:"application/graphql-response+json,application/json;q=0.9","content-type":"application/json"},options:{method:"POST"}},Nu=(e,t)=>t(e);function Tu(e,t,...n){let r={},i={};n.forEach(e=>{r={...r,...e.options,headers:{...r.headers,...e.headers}},e.credentials&&(r.credentials=e.credentials),r.headers.accept=(e.http?.accept||[]).concat(r.headers.accept).join(","),i={...i,...e.http}}),r.headers=function(e,t){if(!t){const t={};return Object.keys(Object(e)).forEach(n=>{t[n.toLowerCase()]=e[n]}),t}const n={};Object.keys(Object(e)).forEach(t=>{n[t.toLowerCase()]={originalName:t,value:e[t]}});const r={};return Object.keys(n).forEach(e=>{r[n[e].originalName]=n[e].value}),r}(r.headers,i.preserveHeaderCase);const{operationName:a,extensions:o,variables:s,query:l}=e,c={operationName:a,variables:s};return i.includeExtensions&&Object.keys(o||{}).length&&(c.extensions=o),i.includeQuery&&(c.query=t(l,yl)),{options:r,body:c}}var Cu=Da(()=>fetch);function Eu(){}var Iu=class extends Nl{constructor(e={}){let{uri:t="/graphql",fetch:n,print:r=Nu,includeExtensions:i,preserveHeaderCase:a,useGETForQueries:o,includeUnusedVariables:s=!1,...l}=e;const c={http:zo({includeExtensions:i,preserveHeaderCase:a}),options:l.fetchOptions,credentials:l.credentials,headers:l.headers};super(e=>{let i=((e,t)=>e.getContext().uri||("function"==typeof t?t(e):t||"/graphql"))(e,t);const a=e.getContext(),l={...a.http};(function(e){return kl(e,"subscription")})(e.query)&&(l.accept=["multipart/mixed;boundary=graphql;subscriptionSpec=1.0",...l.accept||[]]);const u={http:l,options:a.fetchOptions,credentials:a.credentials,headers:a.headers},{options:d,body:p}=Tu(e,r,Su,c,u);p.variables&&!s&&(p.variables=function(e,t){const n={...e},r=new Set(Object.keys(e));return ir(t,{Variable(e,t,n){n&&"VariableDefinition"!==n.kind&&r.delete(e.name.value)}}),r.forEach(e=>{delete n[e]}),n}(p.variables,e.query));let h=new AbortController,f=()=>{h=void 0};if(d.signal){const e=d.signal,t=()=>{h?.abort(e.reason)};e.addEventListener("abort",t,{once:!0}),f=()=>{h?.signal.removeEventListener("abort",f),h=void 0,e.removeEventListener("abort",t),f=Eu},h.signal.addEventListener("abort",f,{once:!0})}return d.signal=h.signal,o&&!function(e){return kl(e,"mutation")}(e.query)&&(d.method="GET"),new ji(t=>{if("GET"===d.method){const{newURI:e,parseError:t}=function(e,n){const r=[],i=(e,t)=>{r.push(`${e}=${encodeURIComponent(t)}`)};if("query"in n&&i("query",n.query),n.operationName&&i("operationName",n.operationName),n.variables){let e;try{e=JSON.stringify(n.variables)}catch(t){return{parseError:t}}i("variables",e)}if(n.extensions){let e;try{e=JSON.stringify(n.extensions)}catch(t){return{parseError:t}}i("extensions",e)}let a="",o=e;const s=e.indexOf("#");-1!==s&&(a=e.substr(s),o=e.substr(0,s));const l=-1===o.indexOf("?")?"?":"&";return{newURI:o+l+r.join("&")+a}}(i,p);if(t)throw t;i=e}else d.body=JSON.stringify(p);const r=n||Da(()=>fetch)||Cu,a=t.next.bind(t);return r(i,d).then(t=>{e.setContext({response:t});const n=t.headers?.get("content-type");return null!==n&&/^multipart\/mixed/i.test(n)?async function(e,t){for await(const n of async function*(e){const t=new TextDecoder("utf-8"),n=(e.headers?.get("content-type"))?.match(/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i),r="\r\n--"+(n?n[1]??n[2]??n[3]??"-":"-");let i="";qa(e.body&&"function"==typeof e.body.getReader,64);const a=e.body.getReader();let o,s=!1,l=!1;const c=()=>l&&"-"==i[0]&&"-"==i[1];try{for(;!s;){({value:o,done:s}=await a.read());const e="string"==typeof o?o:t.decode(o,{stream:!s}),n=i.length-r.length+1;i+=e;let u=i.indexOf(r,n);for(;u>-1&&!c();){let e;l=!0,[e,i]=[i.slice(0,u),i.slice(u+r.length)];const t=e.indexOf("\r\n\r\n"),n=ku(e.slice(0,t))["content-type"];if(n&&-1===n.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");const a=e.slice(t);a&&(yield a),u=i.indexOf(r)}if(c())return}throw new Error("premature end of multipart body")}finally{a.cancel()}}(e)){const r=wu(e,n);if(0!=Object.keys(r).length)if(xu(r)){if(1===Object.keys(r).length&&null===r.payload)return;let e={...r.payload};"errors"in r&&(e.extensions={...e.extensions,[Qc]:new Bc(r.errors??[])}),t(e)}else t(r)}}(t,a):(r=e,e=>e.text().then(t=>{const n=function(e,t){return e.headers.get("content-type")?.includes("application/graphql-response+json")?function(e,t){try{return JSON.parse(t)}catch(n){throw new Kc(n,{response:e,bodyText:t})}}(e,t):wu(e,t)}(e,t);if(!Array.isArray(n)&&!vu.call(n,"data")&&!vu.call(n,"errors"))throw new Jc(`Server response was malformed for query '${Array.isArray(r)?r.map(e=>e.operationName):r.operationName}'.`,{response:e,bodyText:t});return n}))(t).then(a);var r}).then(()=>{f(),t.complete()}).catch(e=>{f(),t.error(e)}),()=>{h&&h.abort()}})})}},Ou=class extends Nl{constructor(e={}){super((t,n)=>{const r=t.client,i=r.queryManager.clientOptions,a=t.getContext();{const{name:n,version:r,transport:o="headers"}=zo({},i.clientAwareness,e.clientAwareness,a.clientAwareness);"headers"===o&&t.setContext(({headers:e})=>({headers:zo({"apollographql-client-name":n,"apollographql-client-version":r},e)}))}{const{transport:n="extensions"}=zo({},i.enhancedClientAwareness,e.enhancedClientAwareness);"extensions"===n&&(t.extensions=zo({clientLibrary:{name:"@apollo/client",version:r.version}},t.extensions)),"headers"===n&&t.setContext(({headers:e})=>({headers:zo({"apollographql-library-name":"@apollo/client","apollographql-library-version":r.version},e)}))}return n(t)})}},zu=class extends Nl{constructor(e={}){const{left:t,right:n,request:r}=Nl.from([new Ou(e),new Iu(e)]);super(r),Object.assign(this,{left:t,right:n})}},Au=/* @__PURE__ */new Map,_u=/* @__PURE__ */new Map,Du=!1;function Pu(e){return e.replace(/[\s,]+/g," ").trim()}function Mu(e){var t,n,r,i=Pu(e);if(!Au.has(i)){var a=function(e,t){return function(e){if(null==e)return!1;const t=e.hasSubscribers;if(void 0!==t)return t;for(const n of yr)if(e[n].hasSubscribers)return!0;return!1}(gr)?gr.traceSync(()=>ii(e,t),{source:e}):ii(e,t)}(e,{experimentalFragmentVariables:Du,allowLegacyFragmentVariables:Du,experimentalFragmentArguments:Du});if(!a||"Document"!==a.kind)throw new Error("Not a valid GraphQL document.");Au.set(i,function(e){var t=new Set(e.definitions);t.forEach(function(e){e.loc&&delete e.loc,Object.keys(e).forEach(function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}((t=a,n=/* @__PURE__ */new Set,r=[],t.definitions.forEach(function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=Pu((o=e.loc).source.body.substring(o.start,o.end)),a=_u.get(t);a&&!a.has(i)||a||_u.set(t,a=/* @__PURE__ */new Set),a.add(i),n.has(i)||(n.add(i),r.push(e))}else r.push(e);var o}),ui(ui({},t),{definitions:r}))))}return Au.get(i)}function Ru(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];"string"==typeof e&&(e=[e]);var r=e[0];return t.forEach(function(t,n){t&&"Document"===t.kind?r+=t.loc.source.body:r+=t,r+=e[n+1]}),Mu(r)}var Lu,ju=Ru;(Lu=Ru||(Ru={})).gql=ju,Lu.resetCaches=function(){Au.clear(),_u.clear()},Lu.disableFragmentWarnings=function(){},Lu.enableExperimentalFragmentVariables=function(){Du=!0},Lu.disableExperimentalFragmentVariables=function(){Du=!1},Ru.default=Ru;var Fu=class extends Nl{constructor(e){super((t,n)=>new ji(r=>{let i,a,o;try{i=n(t).subscribe({next:i=>{const s=t.client.queryManager.incrementalHandler,l=s.isIncrementalResult(i)?s.extractErrors(i):i.errors;l?o=e({error:new Wc(i,l),result:i,operation:t,forward:n}):Yc(i)&&(o=e({error:i.extensions[Qc],result:i,operation:t,forward:n})),a=o?.subscribe(r),a||r.next(i)},error:i=>{o=e({operation:t,error:Xc(i),forward:n}),a=o?.subscribe(r),a||r.error(i)},complete:()=>{o||r.complete()}})}catch(rM){e({error:Xc(rM),operation:t,forward:n}),r.error(rM)}return()=>{i&&i.unsubscribe(),a&&a.unsubscribe()}}))}},$u=e=>new Fu(({error:t})=>{if(!Jc.is(t))return;let n=It(t.statusCode,(e=>{try{return JSON.parse(e)}catch{return}})(t.bodyText));n&&Ct({reason:n,url:e})}),Vu=e=>{let t="number";return/^"/.test(e)?t=/:$/.test(e)?"text-red-700":"text-green-700":/true|false/.test(e)?t="text-blue-700":/null/.test(e)&&(t=""),`<span class="${t}">${e}</span>`},qu=/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,Bu=e=>e?.replace(qu,Vu)??e,Uu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:r,$options:"i"}}}:{[n]:{$regex:r,$options:"i"}}},Hu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:`^${r}`,$options:"i"}}}:{[n]:{$regex:`^${r}`,$options:"i"}}},Wu=(e,t=!1)=>{let{field:n,value:r}=e;return t?{[n]:{$not:{$regex:`${r}$`,$options:"i"}}}:{[n]:{$regex:`${r}$`,$options:"i"}}},Gu=(e,t=!1)=>{let{field:n}=e;return t?{[n]:{$ne:""}}:{[n]:""}},Ju=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&r.includes(",")?i=r.split(",").map(e=>e.trim()):("string"==typeof r||"number"==typeof r)&&(i=[r]),t?{[n]:{$nin:i}}:{[n]:{$in:i}}};function Ku(e,t=!1,n={}){if(!e)return{};let{combinator:r,rules:i,enabled:a}=e;if(!Array.isArray(i)||!1===a)return{};let l=i.filter(e=>!1!==e.enabled).map(e=>"rules"in e?Ku(e,t,n):((e,t)=>{if(!e)return{};let{isBinding:n}=e;n&&(e=((e,t)=>{let{isBinding:n}=e;return n?{...e,value:s(t,e.value,e.value)}:e})(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,operator:n,value:r}=e;switch(n){case"=":return{[t]:r};case"!=":return{[t]:{$ne:r}};case"<":return"string"==typeof r&&Q(r)?{[t]:{$lt:parseFloat(r)}}:{[t]:{$lt:r}};case">":return"string"==typeof r&&Q(r)?{[t]:{$gt:parseFloat(r)}}:{[t]:{$gt:r}};case"<=":return"string"==typeof r&&Q(r)?{[t]:{$lte:parseFloat(r)}}:{[t]:{$lte:r}};case">=":return"string"==typeof r&&Q(r)?{[t]:{$gte:parseFloat(r)}}:{[t]:{$gte:r}};default:return{}}})(e);case"contains":return Uu(e);case"doesNotContain":return Uu(e,!0);case"beginsWith":return Hu(e);case"doesNotBeginWith":return Hu(e,!0);case"endsWith":return Wu(e);case"doesNotEndWith":return Wu(e,!0);case"empty":return Gu(e);case"notEmpty":return Gu(e,!0);case"in":return Ju(e);case"notIn":return Ju(e,!0);case"between":return(e=>{let{field:t,value:n}=e,r=[];return"string"==typeof n&&n.includes(",")&&(r=n.split(",").map(e=>e.trim())),r.length<2?{[t]:!1}:o(r[0])&&o(r[1])?{[t]:{$gte:new Date(r[0]),$lte:new Date(r[1])}}:{[t]:{$gte:r[0],$lte:r[1]}}})(e);default:return{}}})(e,n));return t?l:l.length?1===l.length?l[0]:{[`$${r}`]:l}:{}}var Qu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '%${r}%'`},Yu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '${r}%'`},Xu=(e,t=!1)=>{let{field:n,value:r}=e;return`${n}${t?" not":""} like '%${r}'`},Zu=(e,t=!1)=>{let{field:n}=e;return`${n} is${t?" not":""} NULL`},ed=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&r.includes(",")?i=r.split(","):("string"==typeof r||"number"==typeof r)&&(i=[r.toString()]),0!==i.length&&`${n}${t?" not":""} in (${i.map(e=>`'${e.trim()}'`).join(", ")})`},td=(e,t=!1)=>{let{field:n,value:r}=e,i=[];return"string"==typeof r&&(i=r.split(",").map(e=>e.trim())),!(i.length<2)&&(o(i[0])&&o(i[1])?`${n}${t?" not":""} between DATE '${i[0]}' and '${i[1]}'`:`${n}${t?" not":""} between '${i[0]}' and '${i[1]}'`)};function nd(e,t=!0,n={}){if(!e)return"";let{combinator:r,rules:i,enabled:a}=e;if(!Array.isArray(i)||!1===a)return"";let l=i.filter(e=>!1!==e.enabled).map(e=>"rules"in e?`(${t?nd(e,t,n).toString():nd(e,t,n)})`:((e,t)=>{if(!e)return{};let{isBinding:n}=e;n&&(e=((e,t)=>e.isBinding?{...e,value:s(t,e.value,e.value)}:e)(e,t));let{operator:r}=e;switch(r){case"=":case"!=":case"<":case">":case"<=":case">=":return(e=>{let{field:t,value:n,operator:r}=e;return"boolean"==typeof n?`${t} ${r} ${n?"TRUE":"FALSE"}`:"string"!=typeof n||Q(n)?"number"==typeof n||Q(n)?`${t} ${r} ${n}`:o(n)?`${t} ${r} DATE '${n.toString()}'`:`${t} ${r} '${JSON.stringify(n)}'`:`${t} ${r} '${n}'`})(e);case"contains":return Qu(e);case"doesNotContain":return!Qu(e,!0);case"beginsWith":return Yu(e);case"doesNotBeginWith":return Yu(e,!0);case"endsWith":return Xu(e);case"doesNotEndWith":return Xu(e,!0);case"empty":return Zu(e);case"notEmpty":return Zu(e,!0);case"in":return ed(e);case"notIn":return ed(e,!0);case"between":return td(e);case"notBetween":return td(e,!0);default:return!1}})(e,n));return t?l:l.join(` ${r} `)}function rd(e){if(Array.isArray(e)){let t=!1,n=e.map(e=>{let n=rd(e);return n!==e&&(t=!0),n});return t?n:e}if("object"==typeof e&&e){let t={},n=!1;for(let r in e){if("__typename"===r){n=!0;continue}let i=e[r],a=rd(i);a!==i&&(n=!0),t[r]=a}return n?t:e}return e}var id=se({theme:{components:{}},colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{}});id.displayName="ThemeContext";var ad=(e,t)=>Object.getOwnPropertyDescriptor(e,t)?.enumerable,od=(e,t,n="soft",r={})=>{let{skip:i=[],skipFunctions:a=!1}=r;if(e===t&&"soft"===n)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let a,o,s=[];if(Array.isArray(e)){if(a=e.length,a!=t.length)return!1;for(o=a;0!==o--;)if(!od(e[o],t[o],n,r))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.values())if(!t.has(o))return!1;for(o of e.entries())if(!od(o[1],t.get(o[0]),n,r))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(a=e.length,a!=t.length)return!1;for(o=a;0!==o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.global===t.global&&e.ignoreCase===t.ignoreCase&&e.multiline===t.multiline&&e.unicode===t.unicode&&e.lastIndex===t.lastIndex&&e.sticky===t.sticky;if((e.valueOf!==Object.prototype.valueOf||t.valueOf!==Object.prototype.valueOf)&&"function"==typeof e.valueOf&&"function"==typeof t.valueOf)return e.valueOf()===t.valueOf();if((e.toString!==Object.prototype.toString||t.toString!==Object.prototype.toString)&&"function"==typeof e.toString&&"function"==typeof t.toString)return e.toString()===t.toString();if(s="soft"===n?Object.keys(e):Object.getOwnPropertyNames(e),a=s.length,a!==("soft"===n?Object.keys(t).length:Object.getOwnPropertyNames(t).length))return!1;for(o=a;0!==o--;)if(!Object.prototype.hasOwnProperty.call(t,s[o]))return!1;for(o=a;0!==o--;){let a=s[o];if("_owner"===a&&e.$$typeof)continue;let l="soft"===n||ad(e,a)||!i.includes(a);if(!od(e[a],t[a],n,r)&&l)return!1}return!0}return!!("hard"===n&&e===t||a&&"function"==typeof e&&"function"==typeof t)||e!=e&&t!=t},sd=od,ld=(e,t="soft",n={})=>{let r=ke(e);return sd(r.current,e,t,n)?r.current:(r.current=e,e)},cd=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ud="-",dd=[],pd=e=>{const t=md(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return fd(e);const n=e.split(ud),r=""===n[0]&&n.length>1?1:0;return hd(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],i=n[e];return t?i?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(i,t):t:i||dd}return n[e]||dd}}},hd=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],i=n.nextPart.get(r);if(i){const n=hd(e,t+1,i);if(n)return n}const a=n.validators;if(null===a)return;const o=0===t?e.join(ud):e.slice(t).join(ud),s=a.length;for(let l=0;l<s;l++){const e=a[l];if(e.validator(o))return e.classGroupId}},fd=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),md=e=>{const{theme:t,classGroups:n}=e;return gd(n,t)},gd=(e,t)=>{const n=cd();for(const r in e){const i=e[r];yd(i,n,r,t)}return n},yd=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const i=e[a];bd(i,t,n,r)}},bd=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?kd(e,t,n,r):xd(e,t,n,r):vd(e,t,n)},vd=(e,t,n)=>{(""===e?t:wd(t,e)).classGroupId=n},xd=(e,t,n,r)=>{Sd(e)?yd(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},kd=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[e,a]=i[o];yd(a,wd(t,e),n,r)}},wd=(e,t)=>{let n=e;const r=t.split(ud),i=r.length;for(let a=0;a<i;a++){const e=r[a];let t=n.nextPart.get(e);t||(t=cd(),n.nextPart.set(e,t)),n=t}return n},Sd=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Nd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}},Td=[],Cd=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ed=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,i=0,a=0;const o=e.length;for(let u=0;u<o;u++){const o=e[u];if(0===r&&0===i){if(":"===o){t.push(e.slice(a,u)),a=u+1;continue}if("/"===o){n=u;continue}}"["===o?r++:"]"===o?r--:"("===o?i++:")"===o&&i--}const s=0===t.length?e:e.slice(a);let l=s,c=!1;return s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0),Cd(t,c,l,n&&n>a?n-a:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Cd(Td,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},Id=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let i=0;i<e.length;i++){const a=e[i],o="["===a[0],s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Od=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},zd=/\s+/,Ad=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Ad(e[r]))&&(n&&(n+=" "),n+=t);return n},_d=(e,...t)=>{let n,r,i,a;const o=e=>{const t=r(e);if(t)return t;const a=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],l=e.trim().split(zd);let c="";for(let u=l.length-1;u>=0;u-=1){const e=l[u],{isExternal:t,modifiers:d,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:f}=n(e);if(t){c=e+(c.length>0?" "+c:c);continue}let m,g=!!f;if(g){m=r(h.substring(0,f));const e=m&&o[m]?r(h):void 0;e&&e!==m&&(m=e,g=!1)}else m=r(h);if(!m){if(!g){c=e+(c.length>0?" "+c:c);continue}if(m=r(h),!m){c=e+(c.length>0?" "+c:c);continue}g=!1}const y=0===d.length?"":1===d.length?d[0]:a(d).join(":"),b=p?y+"!":y,v=b+m;if(s.indexOf(v)>-1)continue;s.push(v);const x=i(m,g);for(let n=0;n<x.length;++n){const e=x[n];s.push(b+e)}c=e+(c.length>0?" "+c:c)}return c})(e,n);return i(e,a),a};return a=s=>{const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:Nd(e.cacheSize),parseClassName:Ed(e),sortModifiers:Id(e),postfixLookupClassGroupIds:Od(e),...pd(e)}))(l),r=n.cache.get,i=n.cache.set,a=o,o(s)},(...e)=>a(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=Ad(t))&&(i&&(i+=" "),i+=n);return i})(...e))},Dd=[],Pd=e=>{const t=t=>t[e]||Dd;return t.isThemeGetter=!0,t},Md=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rd=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ld=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$d=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Bd=e=>Ld.test(e),Ud=e=>!!e&&!Number.isNaN(Number(e)),Hd=e=>!!e&&Number.isInteger(Number(e)),Wd=e=>e.endsWith("%")&&Ud(e.slice(0,-1)),Gd=e=>jd.test(e),Jd=()=>!0,Kd=e=>Fd.test(e)&&!$d.test(e),Qd=()=>!1,Yd=e=>Vd.test(e),Xd=e=>qd.test(e),Zd=e=>!np(e)&&!up(e),ep=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),tp=e=>bp(e,wp,Qd),np=e=>Md.test(e),rp=e=>bp(e,Sp,Kd),ip=e=>bp(e,Np,Ud),ap=e=>bp(e,Cp,Jd),op=e=>bp(e,Tp,Qd),sp=e=>bp(e,xp,Qd),lp=e=>bp(e,kp,Xd),cp=e=>bp(e,Ep,Yd),up=e=>Rd.test(e),dp=e=>vp(e,Sp),pp=e=>vp(e,Tp),hp=e=>vp(e,xp),fp=e=>vp(e,wp),mp=e=>vp(e,kp),gp=e=>vp(e,Ep,!0),yp=e=>vp(e,Cp,!0),bp=(e,t,n)=>{const r=Md.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},vp=(e,t,n=!1)=>{const r=Rd.exec(e);return!!r&&(r[1]?t(r[1]):n)},xp=e=>"position"===e||"percentage"===e,kp=e=>"image"===e||"url"===e,wp=e=>"length"===e||"size"===e||"bg-size"===e,Sp=e=>"length"===e,Np=e=>"number"===e,Tp=e=>"family-name"===e,Cp=e=>"number"===e||"weight"===e,Ep=e=>"shadow"===e,Ip=/*#__PURE__*/_d(()=>{const e=Pd("color"),t=Pd("font"),n=Pd("text"),r=Pd("font-weight"),i=Pd("tracking"),a=Pd("leading"),o=Pd("breakpoint"),s=Pd("container"),l=Pd("spacing"),c=Pd("radius"),u=Pd("shadow"),d=Pd("inset-shadow"),p=Pd("text-shadow"),h=Pd("drop-shadow"),f=Pd("blur"),m=Pd("perspective"),g=Pd("aspect"),y=Pd("ease"),b=Pd("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",up,np],x=()=>[up,np,l],k=()=>[Bd,"full","auto",...x()],w=()=>[Hd,"none","subgrid",up,np],S=()=>["auto",{span:["full",Hd,up,np]},Hd,up,np],N=()=>[Hd,"auto",up,np],T=()=>["auto","min","max","fr",up,np],C=()=>["auto",...x()],E=()=>[Bd,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],I=()=>[Bd,"screen","full","dvw","lvw","svw","min","max","fit",...x()],O=()=>[Bd,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],z=()=>[e,up,np],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",hp,sp,{position:[up,np]}],_=()=>["auto","cover","contain",fp,tp,{size:[up,np]}],D=()=>[Wd,dp,rp],P=()=>["","none","full",c,up,np],M=()=>["",Ud,dp,rp],R=()=>[Ud,Wd,hp,sp],L=()=>["","none",f,up,np],j=()=>["none",Ud,up,np],F=()=>["none",Ud,up,np],$=()=>[Ud,up,np],V=()=>[Bd,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gd],breakpoint:[Gd],color:[Jd],container:[Gd],"drop-shadow":[Gd],ease:["in","out","in-out"],font:[Zd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gd],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gd],shadow:[Gd],spacing:["px",Ud],text:[Gd],"text-shadow":[Gd],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Bd,np,up,g]}],container:["container"],"container-type":[{"@container":["","normal","size",up,np]}],"container-named":[ep],columns:[{columns:[Ud,np,up,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{"inset-s":k(),start:k()}],end:[{"inset-e":k(),end:k()}],"inset-bs":[{"inset-bs":k()}],"inset-be":[{"inset-be":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Hd,"auto",up,np]}],basis:[{basis:[Bd,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ud,Bd,"auto","initial","none",np]}],grow:[{grow:["",Ud,up,np]}],shrink:[{shrink:["",Ud,up,np]}],order:[{order:[Hd,"first","last","none",up,np]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...O()]}],"min-block-size":[{"min-block":["auto",...O()]}],"max-block-size":[{"max-block":["none",...O()]}],w:[{w:[s,"screen",...E()]}],"min-w":[{"min-w":[s,"screen","none",...E()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",n,dp,rp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,yp,ap]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wd,np]}],"font-family":[{font:[pp,op,t]}],"font-features":[{"font-features":[np]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,up,np]}],"line-clamp":[{"line-clamp":[Ud,"none",up,ip]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",up,np]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",up,np]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ud,"from-font","auto",up,rp]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[Ud,"auto",up,np]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"tab-size":[{tab:[Hd,up,np]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",up,np]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",up,np]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:A()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hd,up,np],radial:["",up,np],conic:[Hd,up,np]},mp,lp]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-bs":[{"border-bs":M()}],"border-w-be":[{"border-be":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ud,up,np]}],"outline-w":[{outline:["",Ud,dp,rp]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,gp,cp]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,gp,cp]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[Ud,rp]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",p,gp,cp]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[Ud,up,np]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ud]}],"mask-image-linear-from-pos":[{"mask-linear-from":R()}],"mask-image-linear-to-pos":[{"mask-linear-to":R()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":R()}],"mask-image-t-to-pos":[{"mask-t-to":R()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":R()}],"mask-image-r-to-pos":[{"mask-r-to":R()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":R()}],"mask-image-b-to-pos":[{"mask-b-to":R()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":R()}],"mask-image-l-to-pos":[{"mask-l-to":R()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":R()}],"mask-image-x-to-pos":[{"mask-x-to":R()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":R()}],"mask-image-y-to-pos":[{"mask-y-to":R()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[up,np]}],"mask-image-radial-from-pos":[{"mask-radial-from":R()}],"mask-image-radial-to-pos":[{"mask-radial-to":R()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Ud]}],"mask-image-conic-from-pos":[{"mask-conic-from":R()}],"mask-image-conic-to-pos":[{"mask-conic-to":R()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:A()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",up,np]}],filter:[{filter:["","none",up,np]}],blur:[{blur:L()}],brightness:[{brightness:[Ud,up,np]}],contrast:[{contrast:[Ud,up,np]}],"drop-shadow":[{"drop-shadow":["","none",h,gp,cp]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",Ud,up,np]}],"hue-rotate":[{"hue-rotate":[Ud,up,np]}],invert:[{invert:["",Ud,up,np]}],saturate:[{saturate:[Ud,up,np]}],sepia:[{sepia:["",Ud,up,np]}],"backdrop-filter":[{"backdrop-filter":["","none",up,np]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[Ud,up,np]}],"backdrop-contrast":[{"backdrop-contrast":[Ud,up,np]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ud,up,np]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ud,up,np]}],"backdrop-invert":[{"backdrop-invert":["",Ud,up,np]}],"backdrop-opacity":[{"backdrop-opacity":[Ud,up,np]}],"backdrop-saturate":[{"backdrop-saturate":[Ud,up,np]}],"backdrop-sepia":[{"backdrop-sepia":["",Ud,up,np]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",up,np]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ud,"initial",up,np]}],ease:[{ease:["linear","initial",y,up,np]}],delay:[{delay:[Ud,up,np]}],animate:[{animate:["none",b,up,np]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,up,np]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:j()}],"rotate-x":[{"rotate-x":j()}],"rotate-y":[{"rotate-y":j()}],"rotate-z":[{"rotate-z":j()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:$()}],"skew-x":[{"skew-x":$()}],"skew-y":[{"skew-y":$()}],transform:[{transform:[up,np,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],zoom:[{zoom:[Hd,up,np]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",up,np]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",up,np]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[Ud,dp,rp,ip]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}}),Op=function(e,{componentKey:t,className:n,variants:r}){let{theme:i}=pe(id);e=ld(e);let a=ld(n),o=he((t,n={},r="")=>(n={...n,className:r},"string"==typeof e?s(i.components[e],t,void 0)?.(n)??r:e.map(e=>s(i.components[e],t,void 0)?.(n)).filter(Boolean).join(" ")||r),[i.components,e]);return t=ve(()=>void 0!==t?t:e&&"string"==typeof e?Object.keys(i.components[e]):Array.isArray(e)&&e.length>0?e.map(e=>Object.keys(i.components[e])).flat():void 0,[e,i.components]),ve(()=>{if(t&&"string"==typeof t)return Ip(o(t,r,a&&"object"==typeof a?s(a,t,""):a));if(t&&Array.isArray(t)){let e={};return t.forEach((t,n)=>{let i;"object"==typeof a?i=s(a,t):"string"==typeof a&&0===n&&(i=a);let c=Ip(o(t,r,i));t.split(".").length>1?l(e,t.split(".").slice(1).join("."),c):l(e,t,c)}),e}return""},[t,a,o,r])},zp=({ref:e,className:t,children:n,testId:r,direction:i,wrap:a,items:o,gap:s,justify:l,grow:c,basis:u,alignItems:d,shrink:p,...h})=>(t=Op("Flex",{className:t,componentKey:"root",variants:{direction:i,wrap:a,items:o,gap:s,justify:l,grow:c,basis:u,shrink:p,alignItems:d}}),/* @__PURE__ */Ee("div",{...h,"data-testid":r,className:t,ref:e,children:n})),Ap=(e,t,n="primary")=>e?"disabled":t&&"primary"===n?"primaryActive":t&&"secondary"===n?"secondaryActive":t&&"tertiary"===n?"tertiaryActive":n,_p=({className:e,children:t,icon:n,active:r=!1,disabled:i=!1,testId:a,intent:o,size:s,cursor:l,title:c,...u})=>{let d=Op("Icon",{className:e,componentKey:"root",variants:{intent:Ap(i,r,o),size:s,cursor:i?"disabled":l}}),{iconChildren:p}=ve(()=>{let e={iconChildren:void 0};return ie.forEach(t,t=>{ue(t)&&(e.iconChildren=oe(t,{...u,className:vt({"h-[1em] w-[1em]":"custom"!==s},d,t.props.className),title:c}))}),e},[t,d,u,s,c]);return p||/* @__PURE__ */Ee("i",{...u,title:c,"data-testid":a,className:vt(n,d)})},Dp=({ref:e,children:t,testId:n,className:r="",iconPlacement:i="none",loading:a=!1,disabled:o=!1,type:s="button",size:l,intent:c,border:u,justify:d,items:p,aspect:h,...f})=>{let m=Op("Button",{className:r,componentKey:["root","icon"],variants:{intent:c,size:l,border:u,justify:d,items:p,disabled:o,aspect:h}}),{iconChildren:g,contentChildren:y}=ve(()=>{let e={iconChildren:void 0,contentChildren:void 0};return ie.forEach(t,t=>{if("string"!=typeof t){if(ue(t))if(t.type===_p){let r=t.props;e.iconChildren=oe(t,{className:vt(m.icon,r.className),size:l,testId:n?`${n}-icon`:void 0,...r,intent:r.intent??"custom"})}else if("i"===t.type){let r=t.props;e.iconChildren=oe(t,{className:vt(m.icon,r.className),size:l,"data-testid":n?`${n}-icon`:void 0,...r,intent:r.intent??"custom"})}else e.contentChildren=t}else e.contentChildren=t}),e},[t,m.icon,l,n]);/* @__PURE__ */
4
4
  return Ie("button",{ref:e,type:s,"data-testid":n,className:m.root,disabled:o,...f,children:[!a&&y&&/* @__PURE__ */Ie(Ce,{children:[("before"===i||"both"===i)&&y&&g,y,("after"===i||"both"===i)&&y&&g]}),!a&&!y&&g,a&&/* @__PURE__ */Ee("i",{className:"fa-solid fa-sync fa-spin text-base"})]})};Dp.Icon=_p;var Pp={root:Nt("flex outline-none select-none border transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-offset-2",{variants:{intent:{primary:["border-transparent bg-primary-500 text-white","hover:bg-primary-600","focus-visible:ring-primary-500","dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus-visible:ring-primary-400"],secondary:["border-gray-300 text-zinc-700 hover:border-gray-400 hover:bg-gray-50 hover:text-zinc-900","focus-visible:ring-gray-400","dark:border-zinc-700 dark:text-zinc-300 dark:hover:border-zinc-400 dark:hover:bg-zinc-700/50 dark:hover:text-white dark:focus-visible:ring-zinc-500"],danger:["border-transparent bg-red-500 text-white hover:bg-red-600","focus-visible:ring-red-500","dark:bg-red-600 dark:hover:bg-red-700"],custom:""},disabled:{true:["disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none"],false:"cursor-pointer"},aspect:{square:"aspect-square",custom:""},size:{md:"py-2 px-4 gap-2 text-sm rounded-lg",sm:"py-1.5 px-3 gap-1.5 text-sm rounded",xs:"py-1 px-2 gap-1 text-xs rounded-sm min-w-6",custom:""},border:{solid:"border-solid",none:"border-none",custom:""},items:{start:"",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},justify:{normal:"justify-normal",start:"",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"}},compoundVariants:[],defaultVariants:{items:"center",justify:"center",intent:"primary",border:"solid",size:"md",disabled:!1,aspect:"custom"}}),icon:Nt("shrink-0",{variants:{intent:{default:""},size:{md:"text-sm",sm:"text-xs",xs:"text-xs",custom:""}},compoundVariants:[],defaultVariants:{intent:"default",size:"md"}})},Mp=Dp,Rp=({className:e,message:t,disabled:n=!1,error:r=!1,intent:i,size:a})=>(e=Op("ErrorMessage",{className:e,componentKey:"root",variants:{intent:i,size:a,error:r,disabled:n}}),/* @__PURE__ */Ee("p",{className:e,children:t})),Lp=({className:e,children:t,disabled:n=!1,error:r=!1,intent:i,size:a,...o})=>(e=Op("Label",{className:e,componentKey:"root",variants:{intent:i,size:a,error:r,disabled:n}}),/* @__PURE__ */Ee("label",{className:e,...o,children:t})),jp=({ref:e,className:t,id:n,label:r,error:i,disabled:a,intent:o,size:s,prefix:l,children:c,loading:u,clearable:d,inline:p,value:h,onClear:f,...m})=>{let g=Op("Input",{className:t,componentKey:["root","label","inputContainer","iconFloatingContainer","icon","iconError","iconClear"],variants:{intent:o,size:s,disabled:a||u,error:!!i,inline:p}}),y=he(e=>f?.(e),[f]),{iconChildren:b,inputChildren:v}=ve(()=>{let e={iconChildren:void 0,inputChildren:[]};return ie.forEach(c,t=>{if(ue(t))if(t.type===_p){let n=t.props;e.iconChildren=oe(t,{className:vt(g.icon,n.className),size:s,...n,intent:n.intent??"custom"})}else e.inputChildren.push(t)}),e},[c,g.icon,s]);/* @__PURE__ */
@@ -575,7 +575,7 @@ return Ee(_E,{value:a,children:e})},WP={runServerAction:{source:"actions",title:
575
575
  /* @__PURE__ */Ee("b",{children:n})," was refused"]}),{actionId:n,mode:i,runId:f.runId,reason:f.reason,error:f.error,status:String(p.status)}),{status:"failed",reason:f.reason??"failed",runId:f.runId??"",output:{}})},[r,o]),l=he(async e=>{if(!r||!e.runId)return{cancelled:!1};try{let t=204===(await fetch(`${r}/run/${e.runId}`,{method:"DELETE",credentials:"same-origin"})).status;return Gp.info("actions",/* @__PURE__ */Ie("span",{children:["Server action run ",
576
576
  /* @__PURE__ */Ee("b",{children:e.runId})," ",t?"cancelled":"was not cancelled"]}),{actionId:"",mode:"cancel",runId:e.runId,status:t?"aborted":"failed"}),{cancelled:t}}catch{return{cancelled:!1}}},[r]),u=ve(()=>(i??[]).map(e=>({label:`${e.name} (${e.identifier})`,value:e.identifier})),[i]);return t({id:"actions",callbacks:ve(()=>ef(WP,{cancelServerAction:l,runServerAction:s},{runServerAction:{params:e=>{let t=Xh(WP.runServerAction.params),n=(i??[]).find(t=>t.identifier===e.actionId),r=Object.entries(n?.input??{});return{...t,actionId:{...t.actionId,type:()=>u.length>0?"select":"text",canBind:!0,label:!1===a?"Action — this space has no server to run it":"Action",options:u},input:{...t.input,canBind:!0,label:r.length>0?`Input — ${r.map(([e,t])=>`${e}${t.required?"*":""}: ${t.type}`).join(", ")}`:"Input"}}}}}),[s,l,u,i,a])}),e},YP={login:{source:"auth",title:"Auth Login",strictParams:!0,params:{mode:{type:"select",description:"Credentials to sign in with: a username and password, or a token obtained elsewhere.",default:"normal",options:["normal","token"],optionLabels:{normal:"User and Password",token:"Token"},canBind:!1},username:{type:"text",description:"Username.",default:"",when:e=>"normal"===e.mode},password:{type:"text",description:"Password.",default:"",when:e=>"normal"===e.mode},token:{type:"text",description:"A token to exchange for a session.",default:"",when:e=>"token"===e.mode}},preview:{ok:"",reason:"",errors:{username:"",password:"",token:""},accessToken:"",expiresAt:"",refreshToken:""}},refreshDetails:{source:"auth",title:"Auth Refresh Details",strictParams:!0,params:{},preview:{errors:"",accessToken:"",expiresAt:"",refreshToken:""}},logout:{source:"auth",title:"Auth Logout",strictParams:!0,params:{}}},XP=({children:e,authProvider:t="basic"})=>{let{login:n,refresh:r,logout:i}=pe(xE),{useInteractions:a}=pe(_E),o=he(e=>n(e),[n]),s=he(e=>r(e),[r]),l=he(()=>i(),[i]);return a({id:"auth",callbacks:ve(()=>""===t?{}:ef(YP,{login:o,refreshDetails:s,logout:l}),[o,l,s,t])}),e},ZP={hostAction:{source:"host",title:"Host Action",strictParams:!0,params:{action:{type:"text",description:"The name the host registered the handler under — `openSpace`, `signOut`, whatever it offers.",default:""},value:{type:"scalar",description:"What the action is about: the space to open, the workspace to switch to. Optional.",default:""}}}},eM=({children:e,actions:t})=>{let{useInteractions:n}=pe(_E),r=he(e=>{let{action:n,value:r}=e,i=n?t?.[n]:void 0;i&&i({...e,value:r})},[t]);return n({id:"host",callbacks:ve(()=>ef(ZP,{hostAction:r}),[r])}),e},tM={navigate:{source:"navigation",title:"Navigate",strictParams:!0,params:{urlType:{type:"select",description:"Target kind: a space page, an internal space path, or an external URL.",options:["page","internal","external"],optionLabels:{page:"Space Page",internal:"Inside Space",external:"Outside Space"}},url:{type:"text",description:'Destination — a page id when urlType is "page", otherwise a URL/path.',when:e=>!!e.urlType,builderType:e=>"page"===e.urlType?"select":"text"}}}},nM=({children:e,previewMode:t=!1})=>{let{useInteractions:n}=pe(_E),[[r,i,a]]=F(["schema.pages","pageDefinitions","navigation.navigate"]),o=ve(()=>{let e=mt(i,r);return Object.keys(e).reduce((t,n)=>{let r=e[n];return[...t,{key:n,label:s(r,"attributes.name",n),defaultPage:s(r,"attributes.default",!1)}]},[])},[i,r]),l=he(e=>{if(!t)return;let{url:n,urlType:r}=e;"page"===r||"internal"===r?a(n):a(n,!0)},[a,t]);return n({id:"navigation",callbacks:ve(()=>{let{urlType:e,url:t}=Xh(tM.navigate.params);return ef(tM,{navigate:l},{navigate:{params:{urlType:e,url:{...t,defaultValue:o.find(e=>e.defaultPage)?.key??"",options:o.map(e=>({value:e.key,label:e.label}))}}}})},[l,o])}),e},rM={setState:{source:"state",title:"Set State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to set. Stored under `runtime.state.<key>`.",default:""},type:{type:"select",description:'The value type. What is stored is coerced to it — a boolean is a real boolean, not "true".',options:["boolean","number","text"],optionLabels:{boolean:"True / False",number:"Numeric",text:"Text"}},value:{type:"scalar",description:"The value to store — its type follows the `type` param (a real boolean/number, or text).",when:e=>!!e.type,builderType:e=>"boolean"===e.type?"select":"text",options:["true","false"]}}},toggleState:{source:"state",title:"Toggle State",strictParams:!0,params:{key:{type:"text",description:"The state key/path to flip, under `runtime.state.<key>`. Anything not already true is treated as false, so a key that has never been set toggles to true.",default:""}}},appendState:{source:"state",title:"Append To State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`. Created if it is not there.",default:""},value:{type:"scalar",description:"What to add to the end of the list.",default:""},unique:{type:"boolean",description:"Skip the append when the list already holds this value. For a list whose entries are their own identity — anything referring to one refers to it by value, so a second copy is indistinguishable.",default:!1},withId:{type:"boolean",description:"Store the entry as `{ id, value }` with an id of its own, so two entries that read the same are still two entries. Anything reading one back names `.value`; anything referring to one names `.id`.",default:!1}}},removeState:{source:"state",title:"Remove From State",strictParams:!0,params:{key:{type:"text",description:"The state key/path holding the list, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry to drop, by value — every copy of it. Prefer this wherever the list can change under the person: a position is only true until something before it moves.",default:""},by:{type:"text",description:"The FIELD carrying the identity, for a list of records rather than of scalars — `id` for entries appended with `withId`. Without it the whole entry is compared, which never matches a record.",default:""},index:{type:"text",description:"Which entry to drop, by position, when there is no value to go on. Inside a controlled list, `{{ <listSource>.index }}` is the row own position. An index that resolves to nothing removes nothing.",default:""}}},moveState:{source:"state",title:"Move Between Lists",strictParams:!0,params:{from:{type:"text",description:"The list to take it out of, under `runtime.state.<key>`.",default:""},to:{type:"text",description:"The list to put it into. It is not added twice.",default:""},value:{type:"scalar",description:"The entry to move. Absent from `from` means nothing happens.",default:""}}},toggleInState:{source:"state",title:"Toggle In List",strictParams:!0,params:{key:{type:"text",description:"The list to add to or drop from, under `runtime.state.<key>`.",default:""},value:{type:"scalar",description:"The entry the box stands for.",default:""}}},clearState:{source:"state",title:"Clear State",strictParams:!0,params:{key:{type:"text",description:"The list to empty, under `runtime.state.<key>`. Left blank it empties EVERYTHING the space is keeping — which on a page that holds notes beside a list means losing the notes to clear the list.",default:""}}}},iM=0,aM=({children:e})=>{let{useInteractions:t}=pe(_E),n=y(),r=he(e=>{let{key:t,type:r}=e,{value:i}=e;"boolean"===r?i=!0===i||"true"===i:"number"===r&&(i=parseInt(i,10)),n(`runtime.state.${t}`,i)},[n]),i=he(e=>{let{key:t}=e;t&&n(`runtime.state.${t}`,e=>!0!==e&&"true"!==e)},[n]),a=e=>!0===e||"true"===e,o=he(e=>{let{key:t,value:r,unique:i,withId:o}=e;t&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return a(o)?[...t,{id:typeof crypto<"u"&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`e${++iM}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,value:r}]:a(i)&&t.includes(r)?t:[...t,r]})},[n]),s=he(e=>{let{key:t,index:r,value:i,by:a}=e;if(!t)return;if(void 0!==i&&""!==i)return void n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter(e=>a?e?.[a]!==i:e!==i):[]);let o="number"==typeof r?r:parseInt(r??"",10);Number.isNaN(o)||n(`runtime.state.${t}`,e=>Array.isArray(e)?e.filter((e,t)=>t!==o):[])},[n]),l=he(e=>{let{from:t,to:r,value:i}=e;if(!t||!r||void 0===i||""===i)return;let a={moved:!1};n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return a.moved=t.includes(i),a.moved?t.filter(e=>e!==i):t}),a.moved&&n(`runtime.state.${r}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(i)?t:[...t,i]})},[n]),c=he(e=>{let{key:t,value:r}=e;t&&void 0!==r&&""!==r&&n(`runtime.state.${t}`,e=>{let t=Array.isArray(e)?e:[];return t.includes(r)?t.filter(e=>e!==r):[...t,r]})},[n]),u=he(e=>{let{key:t}=e;n(t?`runtime.state.${t}`:"runtime.state",t?[]:{})},[n]);return t({id:"state",callbacks:ve(()=>ef(rM,{setState:r,toggleState:i,appendState:o,removeState:s,moveState:l,toggleInState:c,clearState:u}),[r,i,o,s,l,c,u])}),e},oM=({children:e,hostActions:t})=>{let[[n="basic",r,i,a]]=F(["schema.settings.userProvider","navigation.routeParams","navigation.queryParams","navigation.currentPageId"]),{previewMode:o}=Pe();/* @__PURE__ */
577
577
  return Ee(HP,{currentPageId:a,routeParams:r,queryParams:i,children:/* @__PURE__ */Ee(XP,{authProvider:n,children:/* @__PURE__ */Ee(aM,{children:/* @__PURE__ */Ee(QP,{children:/* @__PURE__ */Ee(nM,{previewMode:o,children:/* @__PURE__ */Ee(eM,{actions:t,children:e})})})})})})},sM=se({});sM.displayName="StyleContext";var lM,cM,uM=({children:e,style:t})=>{let{style:n}=pe(ch),r=ve(()=>({}),[]);return i("style",t??(n||Qp)),/* @__PURE__ */Ee(sM,{value:r,children:e})},dM="/plitzi-sdk.css",pM=({revision:e,webKey:t="",webId:n,environment:r="main",currentPageId:i,server:a,isHydrating:o=!1,offlineMode:s=!1,offlineData:l,offlineDataType:c="json",instanceId:d,renderMode:h=De.renderMode,sdkStylePath:f="./plitzi-sdk.css",sdkDevToolsStylePath:m,previewMode:g=!0,debugMode:y=!1,overQuota:b=!1,analytics:v,onInitEventBridge:x,hostData:k,hostActions:w,onInitStateManager:S,...N})=>{const T=pe(u),[C,E]=we(!o);me(()=>E(!0),[]),p(["render.previewMode","render.debugMode","render.renderMode","render.environment","render.isHydrating","render.hydrated","render.overQuota"],[g,y,h,r,o,C,b]),p(["runtime.host"],[k]);const I=ve(()=>T?.withBase("runtime.state"),[T]),O=ve(()=>({get state(){return I?.getState()??{}},setState:e=>I?.setState(void 0,e),setStateByKey:(e,t)=>I?.setState(e,t),clearState:()=>I?.setState(void 0,{})}),[I]);return me(()=>{S?.(O)},[S,O]),/* @__PURE__ */Ee(CE,{webKey:t,webId:n,instanceId:d,server:a,offlineMode:s,offlineData:l,offlineDataType:c,revision:e,children:/* @__PURE__ */Ee(OE,{children:/* @__PURE__ */Ee(IE,{sdkStylePath:dM,children:/* @__PURE__ */Ee(uM,{children:/* @__PURE__ */Ee(DP,{onInit:x,debugMode:y,children:/* @__PURE__ */Ee(UI,{children:/* @__PURE__ */Ee(oO,{server:a,children:/* @__PURE__ */Ie(wE,{currentPageId:i,children:[/* @__PURE__ */Ee(vE,{analytics:v}),/* @__PURE__ */Ee(AP,{children:/* @__PURE__ */Ee(oM,{hostActions:w,children:/* @__PURE__ */Ee(zP,{enabled:y,instanceId:d,devToolsStyleLink:m||"/plitzi-sdk-devtools.css",renderMode:"shadow",innerClassName:vt({flex:"iframe"===h}),children:/* @__PURE__ */Ee(BI,{sdkStylePath:dM,server:a,...N})})})})]})})})})})})})})},hM=({className:e,scoped:t=!1,children:n})=>{const{theme:r}=Ch();/* @__PURE__ */
578
- return Ee(AE,{className:vt(e,t&&"system"!==r&&r),children:n})},fM=e=>({apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",serverUrl:"https://server.plitzi.com",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",...e}),mM={Button:Pp,ContentEditable:_f,Input:Vp,Heading:FN,ContainerResizable:ZN,ContainerCollapsable:YN,Text:uT,Markdown:Nw,ContainerTabs:oT},gM=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=De.renderMode,routing:a="browser",debugMode:o=!1,themeScope:l="document",theme:c,state:u,...d})=>{const p=ve(()=>R(n,!0),[n]),h=ke(u).current,f=ve(()=>({segments:{},runtime:{sources:{},state:h??{}},render:De}),[h]),m=ve(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[g,y]=we(()=>(e=>{if("undefined"==typeof document)return!0;for(const t of document.cookie.split(";")){const n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return"false"!==decodeURIComponent(t.slice(n+1).trim())}return!0})(m)),b=o&&g,v=ve(()=>fM(r),[r]),x=ve(()=>((e,t)=>{const n=new zu({uri:e.serverUrl}),r=new Fc,i=new hE(e=>({headers:{...e.headers,"sdk-version":"0.35.3",authorization:t?`Bearer ${t}`:""}}));return new bu({link:i.concat($u(e.serverUrl),new Nl((e,t)=>new ji(n=>{let r=t(e).subscribe({next:e=>{n.next(e.data?{...e,data:rd(e.data)}:e)},error:e=>n.error(e),complete:()=>n.complete()});return()=>{r.unsubscribe()}})),n),cache:r})})(v,n),[v,n]);me(()=>{},[]);const k=he(()=>{const e=!g;((e,t)=>{"undefined"!=typeof document&&(document.cookie=`${e}=${JSON.stringify(t)}; path=/; max-age=31536000; samesite=lax`)})(m,e),y(e)},[m,g]);(({authorized:e,onToggle:t})=>{const n=he(e=>{var n;e.shiftKey&&"F12"===e.key?t():!e.shiftKey||!e.altKey||"KeyD"!==e.code||(n=e.target)instanceof HTMLElement&&(n.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(n.tagName))||(e.preventDefault(),t())},[t]);me(()=>{if(e)return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,n])})({authorized:o,onToggle:k}),me(()=>{},[o,g,m]),me(()=>{d.isHydrating&&B.setHydrated()},[d.isHydrating]);const w=ve(()=>{const e={};return ie.forEach(t,t=>{if(!ue(t))return;if(t.type!==LI)return;const{renderType:n,component:r,assets:i=[],...a}=t.props;if(!n||!r)return;const o=r;o.type=n,o.assets=i,o.extraProps=a,e[n]=o}),e},[t]);"undefined"==typeof window&&v.requestUrl;const S="widget"===i?ae:"undefined"==typeof window?cE:"memory"===a?_C:nE,N="widget"===i?{}:{..."memory"===a&&"undefined"!=typeof window?{}:{basename:s(v,"basePath","/"),location:"undefined"==typeof window?v.requestUrl??"":void 0}};/* @__PURE__ */
578
+ return Ee(AE,{className:vt(e,t&&"system"!==r&&r),children:n})},fM=e=>({apiServer:"https://api.plitzi.com",ssrServer:"https://ssr.plitzi.com",serverUrl:"https://server.plitzi.com",websocketServer:"wss://server.plitzi.com",subscriptionServer:"wss://server.plitzi.com/subscriptions",...e}),mM={Button:Pp,ContentEditable:_f,Input:Vp,Heading:FN,ContainerResizable:ZN,ContainerCollapsable:YN,Text:uT,Markdown:Nw,ContainerTabs:oT},gM=({className:e="min-h-screen",children:t,webKey:n="",server:r,renderMode:i=De.renderMode,routing:a="browser",debugMode:o=!1,themeScope:l="document",theme:c,state:u,...d})=>{const p=ve(()=>R(n,!0),[n]),h=ke(u).current,f=ve(()=>({segments:{},runtime:{sources:{},state:h??{}},render:De}),[h]),m=ve(()=>(e=>{let t=e?.split(":")[1];return t?`plitzi_debug_${t}`:"plitzi_debug"})("undefined"==typeof window?void 0:window.location.host),[]),[g,y]=we(()=>(e=>{if("undefined"==typeof document)return!0;for(const t of document.cookie.split(";")){const n=t.indexOf("=");if(-1!==n&&t.slice(0,n).trim()===e)return"false"!==decodeURIComponent(t.slice(n+1).trim())}return!0})(m)),b=o&&g,v=ve(()=>fM(r),[r]),x=ve(()=>((e,t)=>{const n=new zu({uri:e.serverUrl}),r=new Fc,i=new hE(e=>({headers:{...e.headers,"sdk-version":"0.35.5",authorization:t?`Bearer ${t}`:""}}));return new bu({link:i.concat($u(e.serverUrl),new Nl((e,t)=>new ji(n=>{let r=t(e).subscribe({next:e=>{n.next(e.data?{...e,data:rd(e.data)}:e)},error:e=>n.error(e),complete:()=>n.complete()});return()=>{r.unsubscribe()}})),n),cache:r})})(v,n),[v,n]);me(()=>{},[]);const k=he(()=>{const e=!g;((e,t)=>{"undefined"!=typeof document&&(document.cookie=`${e}=${JSON.stringify(t)}; path=/; max-age=31536000; samesite=lax`)})(m,e),y(e)},[m,g]);(({authorized:e,onToggle:t})=>{const n=he(e=>{var n;e.shiftKey&&"F12"===e.key?t():!e.shiftKey||!e.altKey||"KeyD"!==e.code||(n=e.target)instanceof HTMLElement&&(n.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(n.tagName))||(e.preventDefault(),t())},[t]);me(()=>{if(e)return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e,n])})({authorized:o,onToggle:k}),me(()=>{},[o,g,m]),me(()=>{d.isHydrating&&B.setHydrated()},[d.isHydrating]);const w=ve(()=>{const e={};return ie.forEach(t,t=>{if(!ue(t))return;if(t.type!==LI)return;const{renderType:n,component:r,assets:i=[],...a}=t.props;if(!n||!r)return;const o=r;o.type=n,o.assets=i,o.extraProps=a,e[n]=o}),e},[t]);"undefined"==typeof window&&v.requestUrl;const S="widget"===i?ae:"undefined"==typeof window?cE:"memory"===a?_C:nE,N="widget"===i?{}:{..."memory"===a&&"undefined"!=typeof window?{}:{basename:s(v,"basePath","/"),location:"undefined"==typeof window?v.requestUrl??"":void 0}};/* @__PURE__ */
579
579
  return Ee(ct,{value:f,middlewares:[Ve(Jp("sdk")),Fh(p),...b?[()=>({onChange:e=>B.recordStoreChange(e)}),je({shouldRecord:e=>!e?.startsWith("runtime.elements")&&!e?.startsWith("rsc")&&!e?.startsWith("theme")})]:[]],children:/* @__PURE__ */Ee(Th,{defaultTheme:"system",scope:l,theme:c,children:/* @__PURE__ */Ee(cT,{components:mM,children:/* @__PURE__ */Ee(hM,{scoped:"container"===l,className:vt("plitzi-sdk flex",e,{"sdk-debug-mode":b}),children:/* @__PURE__ */Ee(KS,{children:/* @__PURE__ */Ee(S,{...N,children:/* @__PURE__ */Ee(HN,{client:x,children:/* @__PURE__ */Ee(VN,{localCustomComponents:w,localComponents:bM,children:/* @__PURE__ */Ee(pM,{server:v,webKey:n,renderMode:i,debugMode:b,webId:p,...d})})})})})})})})})},yM=K(({ref:e,className:t,spaceKey:n,environment:r="main"})=>{const{settings:{previewMode:i},contexts:{NetworkContext:a}}=U(),{server:o}=pe(a);/* @__PURE__ */
580
580
  return Ee(cf,{ref:e,className:vt("plitzi-component__plitzi-sdk",t,{"with__plitzi-sdk":!i}),children:n&&/* @__PURE__ */Ee(gM,{webKey:n,environment:r,renderMode:"widget",server:o,className:"h-full w-full"})})}),bM={plitziSdk:Object.assign(yM,{type:"plitziSdk",content:{attributes:{spaceId:"",spaceKey:"",environment:"main"},definition:{label:"Plitzi Sdk",type:"plitziSdk",bindings:{},styleSelectors:{base:""},initialState:{visibility:!0}},builder:{canDelete:!0,canSelect:!0,canDragDrop:!0,canMove:!0,canTemplate:!0,itemsAllowed:[],itemsNotAllowed:[]},market:{category:"advanced",owner:"Plitzi",verified:!0,license:"MIT",website:"https://plitzi.com",backgroundColor:"#4422ee",icon:/* @__PURE__ */Ee(qN,{})},defaultStyle:{name:"Plitzi Sdk",displayMode:"desktop",style:{base:{default:{}}}},settings:{}}})};function vM(e,t={},n={},r=!1,i=!1){const a=(e=>{if(e.analytics||e.offlineMode||!e.webKey)return e;const{apiServer:t}=fM(e.server);return t?{...e,analytics:{endpoint:`${t.replace(/\/+$/,"")}/v1/collect`,key:e.webKey}}:e})(t),o=a.debugMode??r,s=({isHydrating:e=!1})=>{const[t,r]=we(!e);me(()=>r(!0),[]);const i=Object.keys(n).filter(e=>t||!n[e].clientOnly);o||(()=>{if(typeof window>"u")return;let e=()=>{},t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;"object"==typeof t&&Object.keys(t).forEach(n=>{let r=t[n];t[n]="function"==typeof r?e:null})})();const s=he(e=>{lM=e},[]),l=he(e=>{cM=e},[]);/* @__PURE__ */
581
- return Ee(gM,{...a,debugMode:o,isHydrating:e,onInitStateManager:s,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ee(BI.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},l="undefined"!=typeof document?document.getElementById(e):void 0;if(!l)return;const c=i?Te(l,/* @__PURE__ */Ee(s,{isHydrating:!0})):Ne(l);return i||c.render(/* @__PURE__ */Ee(s,{})),{unmount:()=>c.unmount()}}Promise.resolve({ });var xM=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=De.renderMode,...o})=>/* @__PURE__ */Ee(gM,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});xM.Plugin=BI.Plugin;var kM=U,wM="0.35.3",SM=()=>lM,NM=()=>cM;export{w as ComponentContext,VN as ComponentProvider,hf as JsxManager,A as PlitziServiceProvider,wf as PluginManager,L as PluginRemote,bN as ReplicaProvider,cf as RootElement,xM as default,NM as getEventBridge,SM as getStateManager,$h as n,vM as render,bM as sdkComponents,uf as t,bE as track,Wh as useElement,kM as usePlitziServiceContext,Gh as useRscData,jh as useRscRefresh,F as useStore,wM as version,K as withElement};
581
+ return Ee(gM,{...a,debugMode:o,isHydrating:e,onInitStateManager:s,onInitEventBridge:l,children:i.filter(e=>!!n[e].component).map(e=>/* @__PURE__ */Ee(BI.Plugin,{renderType:e,component:n[e].component,...n[e].props},e))})},l="undefined"!=typeof document?document.getElementById(e):void 0;if(!l)return;const c=i?Te(l,/* @__PURE__ */Ee(s,{isHydrating:!0})):Ne(l);return i||c.render(/* @__PURE__ */Ee(s,{})),{unmount:()=>c.unmount()}}Promise.resolve({ });var xM=({debugMode:e=!1,isHydrating:t=!1,children:n,webKey:r="",environment:i="main",renderMode:a=De.renderMode,...o})=>/* @__PURE__ */Ee(gM,{...o,isHydrating:t,renderMode:a,debugMode:e,webKey:r,environment:i,children:n});xM.Plugin=BI.Plugin;var kM=U,wM="0.35.5",SM=()=>lM,NM=()=>cM;export{w as ComponentContext,VN as ComponentProvider,hf as JsxManager,A as PlitziServiceProvider,wf as PluginManager,L as PluginRemote,bN as ReplicaProvider,cf as RootElement,xM as default,NM as getEventBridge,SM as getStateManager,$h as n,vM as render,bM as sdkComponents,uf as t,bE as track,Wh as useElement,kM as usePlitziServiceContext,Gh as useRscData,jh as useRscRefresh,F as useStore,wM as version,K as withElement};