@machinemetrics/mm-react-tools 4.0.14 → 4.0.15

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.
@@ -22795,7 +22795,7 @@ const sl = Ls.createContext(), SF = () => {
22795
22795
  break;
22796
22796
  case "load-options":
22797
22797
  ($e = (xe = x.current)[`option-${_e.name}`]) == null || $e.call(xe, {
22798
- filter: _e.filter
22798
+ filter: _e.filter || ""
22799
22799
  });
22800
22800
  break;
22801
22801
  case "validate":
@@ -128,7 +128,7 @@ function print() { __p += __j.call(arguments, '') }
128
128
  `;A(K)},[y,m,h]),le.useEffect(()=>{_&&P()},[_,x]);const[P,{data:M,loading:$}]=U1(_,{fetchPolicy:"no-cache"});return le.useEffect(()=>{if(!M||!M.quantities)return;const j=ci.last(M.quantities);if(j&&d(j.eventTime),!n)i(M.quantities);else{const K=ci.drop(M.quantities);i([...n,...K])}},[M]),{data:n,error:c,loading:a}},YA=r=>{const[e,t]=le.useState(),[n,i]=le.useState(!0),[a,u]=le.useState(),{urls:c,request:f}=ti();return bo(async h=>{try{i(!0);const d=await f(`${c.apiUrl}/reports/downtime`,{method:"POST",body:r,signal:h});u(null),t(d)}catch(d){u(d)}i(!1)},[r]),{data:e,error:a,loading:n}},KA=r=>{const[e,t]=le.useState(),{urls:n,request:i,clientId:a}=ti(),u=`lab:${a}:${r}`,{data:c,loading:f,error:h}=f0("/templates");return le.useEffect(()=>{if(!c)return;const m=ci.filter(c.templates,{namespace:u});t(m)},[c]),[async({name:m,public:b,config:I})=>{const x={name:m,public:b,namespace:u,config:JSON.stringify(I)},_=JSON.stringify(x),A=await i(`${n.apiUrl}/templates`,{method:"POST",body:_});return t([...e,A.template]),A.template},async(m,{name:b,public:I,config:x})=>{const _={name:b,public:I,namespace:u,config:JSON.stringify(x)},A=JSON.stringify(_),P=await i(`${n.apiUrl}/templates/${m}`,{method:"PUT",body:A}),M=ci.findIndex(e,{id:m}),$=e.slice(0,M),j=e.slice(M+1);return t([...$,P.template,...j]),P.template},async m=>{await i(`${n.apiUrl}/templates/${m}`,{method:"DELETE"}),t(ci.reject(e,{id:m}))},{templates:e,loading:f,error:h}]},ZA=()=>{const[r,e]=le.useState(),[t,n]=le.useState(),{urls:i}=ti();return le.useEffect(()=>{window===window.top?(n(window.location.hash.substring(1)),e(!0)):(window.addEventListener("message",a=>{switch(a.data.event){case"init":n(a.data.hash.substring(1)),e(!0);break}}),window.top.postMessage({event:"ready"},i.appUrl))},[i]),le.useEffect(()=>{r&&(window===window.top?window.location.hash=t:window.top.postMessage({event:"set-hash",hash:t},i.appUrl))},[r,t,i]),[n,{ready:r,hash:t}]},ti=()=>le.useContext(c0),XA=()=>{throw new Error("useMMEmbeddedApp is deprecated. Use useMMAppTools and useMMAppContext.")},ek=()=>{throw new Error("useMMAppTools is deprecated. Use useMMAppParams and useMMAppCommands.")},tk=()=>{const{context:r}=le.useContext(wi);return r},h0=()=>{const{params:r}=le.useContext(wi);return r},d0=()=>{const{commands:r}=le.useContext(wi);return r},rk=(r,e,t=[])=>{const{addSetting:n}=le.useContext(wi);le.useEffect(()=>{n(r,e)},[...t])},nk=(r,e=[])=>{const{registerHandler:t}=le.useContext(wi);le.useEffect(()=>t({requestType:"set-claims",func:r}),[...e])},ik=(r,e=[])=>{const{registerHandler:t}=le.useContext(wi);le.useEffect(()=>t({requestType:"custom-input-open",func:r}),[...e])},sk=(r,e=[])=>{const{registerHandler:t}=le.useContext(wi);le.useEffect(()=>t({requestType:"custom-input-save",func:r}),[...e])},ak=(r,e=[])=>{const{registerHandler:t}=le.useContext(wi);le.useEffect(()=>t({requestType:"custom-input-label",func:r}),[...e])},ok=()=>le.useContext(u0),uk=()=>{const{login:r,isAuthenticated:e}=ti();return bo(async()=>{e===!1&&await r()},[e]),e?nr.jsx(pn.Outlet,{}):nr.jsx("div",{})},p0="%[a-f0-9]{2}",m0=new RegExp("("+p0+")|([^%]+?)","gi"),y0=new RegExp("("+p0+")+","gi");function ah(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;const t=r.slice(0,e),n=r.slice(e);return Array.prototype.concat.call([],ah(t),ah(n))}function ck(r){try{return decodeURIComponent(r)}catch{let e=r.match(m0)||[];for(let t=1;t<e.length;t++)r=ah(e,t).join(""),e=r.match(m0)||[];return r}}function lk(r){const e={"%FE%FF":"��","%FF%FE":"��"};let t=y0.exec(r);for(;t;){try{e[t[0]]=decodeURIComponent(t[0])}catch{const i=ck(t[0]);i!==t[0]&&(e[t[0]]=i)}t=y0.exec(r)}e["%C2"]="�";const n=Object.keys(e);for(const i of n)r=r.replace(new RegExp(i,"g"),e[i]);return r}function fk(r){if(typeof r!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof r+"`");try{return decodeURIComponent(r)}catch{return lk(r)}}function hk(r,e){const t={};if(Array.isArray(e))for(const n of e){const i=Object.getOwnPropertyDescriptor(r,n);i!=null&&i.enumerable&&Object.defineProperty(t,n,i)}else for(const n of Reflect.ownKeys(r)){const i=Object.getOwnPropertyDescriptor(r,n);if(i.enumerable){const a=r[n];e(n,a,r)&&Object.defineProperty(t,n,i)}}return t}function g0(r,e){if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(r===""||e==="")return[];const t=r.indexOf(e);return t===-1?[]:[r.slice(0,t),r.slice(t+e.length)]}const dk=r=>r==null,pk=r=>encodeURIComponent(r).replaceAll(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),oh=Symbol("encodeFragmentIdentifier");function mk(r){switch(r.arrayFormat){case"index":return e=>(t,n)=>{const i=t.length;return n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,[Sr(e,r),"[",i,"]"].join("")]:[...t,[Sr(e,r),"[",Sr(i,r),"]=",Sr(n,r)].join("")]};case"bracket":return e=>(t,n)=>n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,[Sr(e,r),"[]"].join("")]:[...t,[Sr(e,r),"[]=",Sr(n,r)].join("")];case"colon-list-separator":return e=>(t,n)=>n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,[Sr(e,r),":list="].join("")]:[...t,[Sr(e,r),":list=",Sr(n,r)].join("")];case"comma":case"separator":case"bracket-separator":{const e=r.arrayFormat==="bracket-separator"?"[]=":"=";return t=>(n,i)=>i===void 0||r.skipNull&&i===null||r.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[Sr(t,r),e,Sr(i,r)].join("")]:[[n,Sr(i,r)].join(r.arrayFormatSeparator)])}default:return e=>(t,n)=>n===void 0||r.skipNull&&n===null||r.skipEmptyString&&n===""?t:n===null?[...t,Sr(e,r)]:[...t,[Sr(e,r),"=",Sr(n,r)].join("")]}}function yk(r){let e;switch(r.arrayFormat){case"index":return(t,n,i)=>{if(e=/\[(\d*)]$/.exec(t),t=t.replace(/\[\d*]$/,""),!e){i[t]=n;return}i[t]===void 0&&(i[t]={}),i[t][e[1]]=n};case"bracket":return(t,n,i)=>{if(e=/(\[])$/.exec(t),t=t.replace(/\[]$/,""),!e){i[t]=n;return}if(i[t]===void 0){i[t]=[n];return}i[t]=[...i[t],n]};case"colon-list-separator":return(t,n,i)=>{if(e=/(:list)$/.exec(t),t=t.replace(/:list$/,""),!e){i[t]=n;return}if(i[t]===void 0){i[t]=[n];return}i[t]=[...i[t],n]};case"comma":case"separator":return(t,n,i)=>{const a=typeof n=="string"&&n.includes(r.arrayFormatSeparator),u=typeof n=="string"&&!a&&_i(n,r).includes(r.arrayFormatSeparator);n=u?_i(n,r):n;const c=a||u?n.split(r.arrayFormatSeparator).map(f=>_i(f,r)):n===null?n:_i(n,r);i[t]=c};case"bracket-separator":return(t,n,i)=>{const a=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!a){i[t]=n&&_i(n,r);return}const u=n===null?[]:_i(n,r).split(r.arrayFormatSeparator);if(i[t]===void 0){i[t]=u;return}i[t]=[...i[t],...u]};default:return(t,n,i)=>{if(i[t]===void 0){i[t]=n;return}i[t]=[...[i[t]].flat(),n]}}}function v0(r){if(typeof r!="string"||r.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Sr(r,e){return e.encode?e.strict?pk(r):encodeURIComponent(r):r}function _i(r,e){return e.decode?fk(r):r}function b0(r){return Array.isArray(r)?r.sort():typeof r=="object"?b0(Object.keys(r)).sort((e,t)=>Number(e)-Number(t)).map(e=>r[e]):r}function w0(r){const e=r.indexOf("#");return e!==-1&&(r=r.slice(0,e)),r}function gk(r){let e="";const t=r.indexOf("#");return t!==-1&&(e=r.slice(t)),e}function _0(r,e,t){return t==="string"&&typeof r=="string"?r:typeof t=="function"&&typeof r=="string"?t(r):e.parseBooleans&&r!==null&&(r.toLowerCase()==="true"||r.toLowerCase()==="false")?r.toLowerCase()==="true":t==="number"&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""||e.parseNumbers&&!Number.isNaN(Number(r))&&typeof r=="string"&&r.trim()!==""?Number(r):r}function uh(r){r=w0(r);const e=r.indexOf("?");return e===-1?"":r.slice(e+1)}function ch(r,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...e},v0(e.arrayFormatSeparator);const t=yk(e),n=Object.create(null);if(typeof r!="string"||(r=r.trim().replace(/^[?#&]/,""),!r))return n;for(const i of r.split("&")){if(i==="")continue;const a=e.decode?i.replaceAll("+"," "):i;let[u,c]=g0(a,"=");u===void 0&&(u=a),c=c===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?c:_i(c,e),t(_i(u,e),c,n)}for(const[i,a]of Object.entries(n))if(typeof a=="object"&&a!==null&&e.types[i]!=="string")for(const[u,c]of Object.entries(a)){const f=e.types[i]?e.types[i].replace("[]",""):void 0;a[u]=_0(c,e,f)}else typeof a=="object"&&a!==null&&e.types[i]==="string"?n[i]=Object.values(a).join(e.arrayFormatSeparator):n[i]=_0(a,e,e.types[i]);return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,a)=>{const u=n[a];return i[a]=u&&typeof u=="object"&&!Array.isArray(u)?b0(u):u,i},Object.create(null))}function x0(r,e){if(!r)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},v0(e.arrayFormatSeparator);const t=u=>e.skipNull&&dk(r[u])||e.skipEmptyString&&r[u]==="",n=mk(e),i={};for(const[u,c]of Object.entries(r))t(u)||(i[u]=c);const a=Object.keys(i);return e.sort!==!1&&a.sort(e.sort),a.map(u=>{const c=r[u];return c===void 0?"":c===null?Sr(u,e):Array.isArray(c)?c.length===0&&e.arrayFormat==="bracket-separator"?Sr(u,e)+"[]":c.reduce(n(u),[]).join("&"):Sr(u,e)+"="+Sr(c,e)}).filter(u=>u.length>0).join("&")}function S0(r,e){var i;e={decode:!0,...e};let[t,n]=g0(r,"#");return t===void 0&&(t=r),{url:((i=t==null?void 0:t.split("?"))==null?void 0:i[0])??"",query:ch(uh(r),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:_i(n,e)}:{}}}function E0(r,e){e={encode:!0,strict:!0,[oh]:!0,...e};const t=w0(r.url).split("?")[0]||"",n=uh(r.url),i={...ch(n,{sort:!1}),...r.query};let a=x0(i,e);a&&(a=`?${a}`);let u=gk(r.url);if(typeof r.fragmentIdentifier=="string"){const c=new URL(t);c.hash=r.fragmentIdentifier,u=e[oh]?c.hash:`#${r.fragmentIdentifier}`}return`${t}${a}${u}`}function O0(r,e,t){t={parseFragmentIdentifier:!0,[oh]:!1,...t};const{url:n,query:i,fragmentIdentifier:a}=S0(r,t);return E0({url:n,query:hk(i,e),fragmentIdentifier:a},t)}function vk(r,e,t){const n=Array.isArray(e)?i=>!e.includes(i):(i,a)=>!e(i,a);return O0(r,n,t)}const bk=Object.freeze(Object.defineProperty({__proto__:null,exclude:vk,extract:uh,parse:ch,parseUrl:S0,pick:O0,stringify:x0,stringifyUrl:E0},Symbol.toStringTag,{value:"Module"})),Ur=[];for(let r=0;r<256;++r)Ur.push((r+256).toString(16).slice(1));function wk(r,e=0){return(Ur[r[e+0]]+Ur[r[e+1]]+Ur[r[e+2]]+Ur[r[e+3]]+"-"+Ur[r[e+4]]+Ur[r[e+5]]+"-"+Ur[r[e+6]]+Ur[r[e+7]]+"-"+Ur[r[e+8]]+Ur[r[e+9]]+"-"+Ur[r[e+10]]+Ur[r[e+11]]+Ur[r[e+12]]+Ur[r[e+13]]+Ur[r[e+14]]+Ur[r[e+15]]).toLowerCase()}let lh;const _k=new Uint8Array(16);function xk(){if(!lh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");lh=crypto.getRandomValues.bind(crypto)}return lh(_k)}const T0={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function A0(r,e,t){if(T0.randomUUID&&!e&&!r)return T0.randomUUID();r=r||{};const n=r.random||(r.rng||xk)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,wk(n)}const fh="mm-auth-state",hh="mm-auth-destination",dh="mm-auth-access-token",xi=window.localStorage,Sk=()=>xi.getItem(dh),Ek=r=>{r?xi.setItem(dh,r):xi.removeItem(dh)},Ok=()=>xi.getItem(hh),k0=r=>{r?xi.setItem(hh,r):xi.removeItem(hh)},Tk=()=>xi.getItem(fh),I0=r=>{r?xi.setItem(fh,r):xi.removeItem(fh)},C0=async(r,e)=>{const t=await window.fetch(r,e),n=await t.text(),i=n&&JSON.parse(n);return t.status>=200&&t.status<300?i:{...i,error:{message:t.statusText,status:t.status}}};function Ak(r){return er(r)&&"code"in r&&"reason"in r}function kk(r){var e;return er(r)&&((e=r.target)===null||e===void 0?void 0:e.readyState)===WebSocket.CLOSED}var Ik=function(r){Pn(e,r);function e(t){var n=r.call(this)||this;return n.client=t,n}return e.prototype.request=function(t){var n=this;return new Rt(function(i){return n.client.subscribe(L(L({},t),{query:Gs(t.query)}),{next:i.next.bind(i),complete:i.complete.bind(i),error:function(a){if(a instanceof Error)return i.error(a);var u=Ak(a);return u||kk(a)?i.error(new Error("Socket closed".concat(u?" with event ".concat(a.code):"").concat(u?" ".concat(a.reason):""))):i.error(new yn({graphQLErrors:Array.isArray(a)?a:[a]}))}})})},e}(Kr);function un(r){return r===null?"null":Array.isArray(r)?"array":typeof r}function Is(r){return un(r)==="object"}function Ck(r){return Array.isArray(r)&&r.length>0&&r.every(e=>"message"in e)}function P0(r,e){return r.length<124?r:e}const Pk="graphql-transport-ws";var vn;(function(r){r[r.InternalServerError=4500]="InternalServerError",r[r.InternalClientError=4005]="InternalClientError",r[r.BadRequest=4400]="BadRequest",r[r.BadResponse=4004]="BadResponse",r[r.Unauthorized=4401]="Unauthorized",r[r.Forbidden=4403]="Forbidden",r[r.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",r[r.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",r[r.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",r[r.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",r[r.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(vn||(vn={}));var mr;(function(r){r.ConnectionInit="connection_init",r.ConnectionAck="connection_ack",r.Ping="ping",r.Pong="pong",r.Subscribe="subscribe",r.Next="next",r.Error="error",r.Complete="complete"})(mr||(mr={}));function N0(r){if(!Is(r))throw new Error(`Message is expected to be an object, but got ${un(r)}`);if(!r.type)throw new Error("Message is missing the 'type' property");if(typeof r.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${un(r.type)}`);switch(r.type){case mr.ConnectionInit:case mr.ConnectionAck:case mr.Ping:case mr.Pong:{if(r.payload!=null&&!Is(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${r.payload}"`);break}case mr.Subscribe:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${un(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Is(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${un(r.payload)}`);if(typeof r.payload.query!="string")throw new Error(`"${r.type}" message payload expects the 'query' property to be a string, but got ${un(r.payload.query)}`);if(r.payload.variables!=null&&!Is(r.payload.variables))throw new Error(`"${r.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${un(r.payload.variables)}`);if(r.payload.operationName!=null&&un(r.payload.operationName)!=="string")throw new Error(`"${r.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${un(r.payload.operationName)}`);if(r.payload.extensions!=null&&!Is(r.payload.extensions))throw new Error(`"${r.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${un(r.payload.extensions)}`);break}case mr.Next:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${un(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Is(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an object, but got ${un(r.payload)}`);break}case mr.Error:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${un(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);if(!Ck(r.payload))throw new Error(`"${r.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(r.payload)}`);break}case mr.Complete:{if(typeof r.id!="string")throw new Error(`"${r.type}" message expects the 'id' property to be a string, but got ${un(r.id)}`);if(!r.id)throw new Error(`"${r.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${r.type}"`)}return r}function Nk(r,e){return N0(typeof r=="string"?JSON.parse(r,e):r)}function _o(r,e){return N0(r),JSON.stringify(r,e)}var ha=function(r){return this instanceof ha?(this.v=r,this):new ha(r)},Rk=function(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,a=[];return i={},u("next"),u("throw"),u("return"),i[Symbol.asyncIterator]=function(){return this},i;function u(g){n[g]&&(i[g]=function(m){return new Promise(function(b,I){a.push([g,m,b,I])>1||c(g,m)})})}function c(g,m){try{f(n[g](m))}catch(b){y(a[0][3],b)}}function f(g){g.value instanceof ha?Promise.resolve(g.value.v).then(h,d):y(a[0][2],g)}function h(g){c("next",g)}function d(g){c("throw",g)}function y(g,m){g(m),a.shift(),a.length&&c(a[0][0],a[0][1])}};function Mk(r){const{url:e,connectionParams:t,lazy:n=!0,onNonLazyError:i=console.error,lazyCloseTimeout:a=0,keepAlive:u=0,disablePong:c,connectionAckWaitTimeout:f=0,retryAttempts:h=5,retryWait:d=async function(We){let ke=1e3;for(let X=0;X<We;X++)ke*=2;await new Promise(X=>setTimeout(X,ke+Math.floor(Math.random()*2700+300)))},shouldRetry:y=ph,isFatalConnectionProblem:g,on:m,webSocketImpl:b,generateID:I=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,We=>{const ke=Math.random()*16|0;return(We=="x"?ke:ke&3|8).toString(16)})},jsonMessageReplacer:x,jsonMessageReviver:_}=r;let A;if(b){if(!Fk(b))throw new Error("Invalid WebSocket implementation provided");A=b}else typeof WebSocket<"u"?A=WebSocket:typeof global<"u"?A=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(A=window.WebSocket||window.MozWebSocket);if(!A)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const P=A,M=(()=>{const ge=(()=>{const ke={};return{on(X,ye){return ke[X]=ye,()=>{delete ke[X]}},emit(X){var ye;"id"in X&&((ye=ke[X.id])===null||ye===void 0||ye.call(ke,X))}}})(),We={connecting:m!=null&&m.connecting?[m.connecting]:[],opened:m!=null&&m.opened?[m.opened]:[],connected:m!=null&&m.connected?[m.connected]:[],ping:m!=null&&m.ping?[m.ping]:[],pong:m!=null&&m.pong?[m.pong]:[],message:m!=null&&m.message?[ge.emit,m.message]:[ge.emit],closed:m!=null&&m.closed?[m.closed]:[],error:m!=null&&m.error?[m.error]:[]};return{onMessage:ge.on,on(ke,X){const ye=We[ke];return ye.push(X),()=>{ye.splice(ye.indexOf(X),1)}},emit(ke,...X){for(const ye of[...We[ke]])ye(...X)}}})();function $(ge){const We=[M.on("error",ke=>{We.forEach(X=>X()),ge(ke)}),M.on("closed",ke=>{We.forEach(X=>X()),ge(ke)})]}let j,K=0,ee,fe=!1,de=0,Ie=!1;async function pe(){clearTimeout(ee);const[ge,We]=await(j??(j=new Promise((ye,xe)=>(async()=>{if(fe){if(await d(de),!K)return j=void 0,xe({code:1e3,reason:"All Subscriptions Gone"});de++}M.emit("connecting",fe);const Se=new P(typeof e=="function"?await e():e,Pk);let Be,Ke;function Et(){isFinite(u)&&u>0&&(clearTimeout(Ke),Ke=setTimeout(()=>{Se.readyState===P.OPEN&&(Se.send(_o({type:mr.Ping})),M.emit("ping",!1,void 0))},u))}$(Ze=>{j=void 0,clearTimeout(Be),clearTimeout(Ke),xe(Ze),Ze instanceof R0&&(Se.close(4499,"Terminated"),Se.onerror=null,Se.onclose=null)}),Se.onerror=Ze=>M.emit("error",Ze),Se.onclose=Ze=>M.emit("closed",Ze),Se.onopen=async()=>{try{M.emit("opened",Se);const Ze=typeof t=="function"?await t():t;if(Se.readyState!==P.OPEN)return;Se.send(_o(Ze?{type:mr.ConnectionInit,payload:Ze}:{type:mr.ConnectionInit},x)),isFinite(f)&&f>0&&(Be=setTimeout(()=>{Se.close(vn.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},f)),Et()}catch(Ze){M.emit("error",Ze),Se.close(vn.InternalClientError,P0(Ze instanceof Error?Ze.message:new Error(Ze).message,"Internal client error"))}};let Tt=!1;Se.onmessage=({data:Ze})=>{try{const Je=Nk(Ze,_);if(M.emit("message",Je),Je.type==="ping"||Je.type==="pong"){M.emit(Je.type,!0,Je.payload),Je.type==="pong"?Et():c||(Se.send(_o(Je.payload?{type:mr.Pong,payload:Je.payload}:{type:mr.Pong})),M.emit("pong",!1,Je.payload));return}if(Tt)return;if(Je.type!==mr.ConnectionAck)throw new Error(`First message cannot be of type ${Je.type}`);clearTimeout(Be),Tt=!0,M.emit("connected",Se,Je.payload,fe),fe=!1,de=0,ye([Se,new Promise((vt,De)=>$(De))])}catch(Je){Se.onmessage=null,M.emit("error",Je),Se.close(vn.BadResponse,P0(Je instanceof Error?Je.message:new Error(Je).message,"Bad response"))}}})())));ge.readyState===P.CLOSING&&await We;let ke=()=>{};const X=new Promise(ye=>ke=ye);return[ge,ke,Promise.race([X.then(()=>{if(!K){const ye=()=>ge.close(1e3,"Normal Closure");isFinite(a)&&a>0?ee=setTimeout(()=>{ge.readyState===P.OPEN&&ye()},a):ye()}}),We])]}function Ce(ge){if(ph(ge)&&(Dk(ge.code)||[vn.InternalServerError,vn.InternalClientError,vn.BadRequest,vn.BadResponse,vn.Unauthorized,vn.SubprotocolNotAcceptable,vn.SubscriberAlreadyExists,vn.TooManyInitialisationRequests].includes(ge.code)))throw ge;if(Ie)return!1;if(ph(ge)&&ge.code===1e3)return K>0;if(!h||de>=h||!y(ge)||g!=null&&g(ge))throw ge;return fe=!0}n||(async()=>{for(K++;;)try{const[,,ge]=await pe();await ge}catch(ge){try{if(!Ce(ge))return}catch(We){return i==null?void 0:i(We)}}})();function Pe(ge,We){const ke=I(ge);let X=!1,ye=!1,xe=()=>{K--,X=!0};return(async()=>{for(K++;;)try{const[Se,Be,Ke]=await pe();if(X)return Be();const Et=M.onMessage(ke,Tt=>{switch(Tt.type){case mr.Next:{We.next(Tt.payload);return}case mr.Error:{ye=!0,X=!0,We.error(Tt.payload),xe();return}case mr.Complete:{X=!0,xe();return}}});Se.send(_o({id:ke,type:mr.Subscribe,payload:ge},x)),xe=()=>{!X&&Se.readyState===P.OPEN&&Se.send(_o({id:ke,type:mr.Complete},x)),K--,X=!0,Be()},await Ke.finally(Et);return}catch(Se){if(!Ce(Se))return}})().then(()=>{ye||We.complete()}).catch(Se=>{We.error(Se)}),()=>{X||xe()}}return{on:M.on,subscribe:Pe,iterate(ge){const We=[],ke={done:!1,error:null,resolve:()=>{}},X=Pe(ge,{next(xe){We.push(xe),ke.resolve()},error(xe){ke.done=!0,ke.error=xe,ke.resolve()},complete(){ke.done=!0,ke.resolve()}}),ye=function(){return Rk(this,arguments,function*(){for(;;){for(We.length||(yield ha(new Promise(Be=>ke.resolve=Be)));We.length;)yield yield ha(We.shift());if(ke.error)throw ke.error;if(ke.done)return yield ha(void 0)}})}();return ye.throw=async xe=>(ke.done||(ke.done=!0,ke.error=xe,ke.resolve()),{done:!0,value:void 0}),ye.return=async()=>(X(),{done:!0,value:void 0}),ye},async dispose(){if(Ie=!0,j){const[ge]=await j;ge.close(1e3,"Normal Closure")}},terminate(){j&&M.emit("closed",new R0)}}}class R0 extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function ph(r){return Is(r)&&"code"in r&&"reason"in r}function Dk(r){return[1e3,1001,1006,1005,1012,1013,1014].includes(r)?!1:r>=1e3&&r<=1999}function Fk(r){return typeof r=="function"&&"constructor"in r&&"CLOSED"in r&&"CLOSING"in r&&"CONNECTING"in r&&"OPEN"in r}function M0(r){return new Kr(function(e,t){var n=on(e,[]);return new Rt(function(i){var a,u=!1;return Promise.resolve(n).then(function(c){return r(c,e.getContext())}).then(e.setContext).then(function(){u||(a=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){u=!0,a&&a.unsubscribe()}})})}function D0(r){return new Kr(function(e,t){return new Rt(function(n){var i,a,u;try{i=t(e).subscribe({next:function(c){if(c.errors&&(u=r({graphQLErrors:c.errors,response:c,operation:e,forward:t}),u)){a=u.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(c)},error:function(c){if(u=r({operation:e,networkError:c,graphQLErrors:c&&c.result&&c.result.errors||void 0,forward:t}),u){a=u.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(c)},complete:function(){u||n.complete.bind(n)()}})}catch(c){r({networkError:c,operation:e,forward:t}),n.error(c)}return function(){i&&i.unsubscribe(),a&&i.unsubscribe()}})})}(function(r){Pn(e,r);function e(t){var n=r.call(this)||this;return n.link=D0(t),n}return e.prototype.request=function(t,n){return this.link.request(t,n)},e})(Kr);var mh={exports:{}};const Lk=ol(O1),qk=ol(gO);var yh,F0;function da(){return F0||(F0=1,yh=TypeError),yh}const jk=ol(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var gh,L0;function ec(){if(L0)return gh;L0=1;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,a=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=i&&a&&typeof a.get=="function"?a.get:null,c=i&&Set.prototype.forEach,f=typeof WeakMap=="function"&&WeakMap.prototype,h=f?WeakMap.prototype.has:null,d=typeof WeakSet=="function"&&WeakSet.prototype,y=d?WeakSet.prototype.has:null,g=typeof WeakRef=="function"&&WeakRef.prototype,m=g?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,I=Object.prototype.toString,x=Function.prototype.toString,_=String.prototype.match,A=String.prototype.slice,P=String.prototype.replace,M=String.prototype.toUpperCase,$=String.prototype.toLowerCase,j=RegExp.prototype.test,K=Array.prototype.concat,ee=Array.prototype.join,fe=Array.prototype.slice,de=Math.floor,Ie=typeof BigInt=="function"?BigInt.prototype.valueOf:null,pe=Object.getOwnPropertySymbols,Ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ge=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Pe||!0)?Symbol.toStringTag:null,We=Object.prototype.propertyIsEnumerable,ke=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(H){return H.__proto__}:null);function X(H,G){if(H===1/0||H===-1/0||H!==H||H&&H>-1e3&&H<1e3||j.call(/e/,G))return G;var at=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof H=="number"){var wt=H<0?-de(-H):de(H);if(wt!==H){var ft=String(wt),He=A.call(G,ft.length+1);return P.call(ft,at,"$&_")+"."+P.call(P.call(He,/([0-9]{3})/g,"$&_"),/_$/,"")}}return P.call(G,at,"$&_")}var ye=jk,xe=ye.custom,Se=q(xe)?xe:null,Be={__proto__:null,double:'"',single:"'"},Ke={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};gh=function H(G,at,wt,ft){var He=at||{};if(W(He,"quoteStyle")&&!W(Be,He.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(He,"maxStringLength")&&(typeof He.maxStringLength=="number"?He.maxStringLength<0&&He.maxStringLength!==1/0:He.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var Kt=W(He,"customInspect")?He.customInspect:!0;if(typeof Kt!="boolean"&&Kt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(He,"indent")&&He.indent!==null&&He.indent!==" "&&!(parseInt(He.indent,10)===He.indent&&He.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(He,"numericSeparator")&&typeof He.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Zt=He.numericSeparator;if(typeof G>"u")return"undefined";if(G===null)return"null";if(typeof G=="boolean")return G?"true":"false";if(typeof G=="string")return At(G,He);if(typeof G=="number"){if(G===0)return 1/0/G>0?"0":"-0";var Qt=String(G);return Zt?X(G,Qt):Qt}if(typeof G=="bigint"){var kr=String(G)+"n";return Zt?X(G,kr):kr}var Hr=typeof He.depth>"u"?5:He.depth;if(typeof wt>"u"&&(wt=0),wt>=Hr&&Hr>0&&typeof G=="object")return Ze(G)?"[Array]":"[Object]";var Fr=dr(He,wt);if(typeof ft>"u")ft=[];else if($e(ft,G)>=0)return"[Circular]";function Ut(Xe,rt,nt){if(rt&&(ft=fe.call(ft),ft.push(rt)),nt){var bt={depth:He.depth};return W(He,"quoteStyle")&&(bt.quoteStyle=He.quoteStyle),H(Xe,bt,wt+1,ft)}return H(Xe,He,wt+1,ft)}if(typeof G=="function"&&!vt(G)){var Or=ze(G),$r=Ht(G,Ut);return"[Function"+(Or?": "+Or:" (anonymous)")+"]"+($r.length>0?" { "+ee.call($r,", ")+" }":"")}if(q(G)){var Lr=Pe?P.call(String(G),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ce.call(G);return typeof G=="object"&&!Pe?Gt(Lr):Lr}if(Yt(G)){for(var ar="<"+$.call(String(G.nodeName)),Gr=G.attributes||[],Tr=0;Tr<Gr.length;Tr++)ar+=" "+Gr[Tr].name+"="+Et(Tt(Gr[Tr].value),"double",He);return ar+=">",G.childNodes&&G.childNodes.length&&(ar+="..."),ar+="</"+$.call(String(G.nodeName))+">",ar}if(Ze(G)){if(G.length===0)return"[]";var gr=Ht(G,Ut);return Fr&&!sr(gr)?"["+Ar(gr,Fr)+"]":"[ "+ee.call(gr,", ")+" ]"}if(De(G)){var Ir=Ht(G,Ut);return!("cause"in Error.prototype)&&"cause"in G&&!We.call(G,"cause")?"{ ["+String(G)+"] "+ee.call(K.call("[cause]: "+Ut(G.cause),Ir),", ")+" }":Ir.length===0?"["+String(G)+"]":"{ ["+String(G)+"] "+ee.call(Ir,", ")+" }"}if(typeof G=="object"&&Kt){if(Se&&typeof G[Se]=="function"&&ye)return ye(G,{depth:Hr-wt});if(Kt!=="symbol"&&typeof G.inspect=="function")return G.inspect()}if(se(G)){var Sn=[];return n&&n.call(G,function(Xe,rt){Sn.push(Ut(rt,G,!0)+" => "+Ut(Xe,G))}),zt("Map",t.call(G),Sn,Fr)}if(mt(G)){var Un=[];return c&&c.call(G,function(Xe){Un.push(Ut(Xe,G))}),zt("Set",u.call(G),Un,Fr)}if(we(G))return Er("WeakMap");if(yt(G))return Er("WeakSet");if(Qe(G))return Er("WeakRef");if(V(G))return Gt(Ut(Number(G)));if(J(G))return Gt(Ut(Ie.call(G)));if(Q(G))return Gt(b.call(G));if(Ge(G))return Gt(Ut(String(G)));if(typeof window<"u"&&G===window)return"{ [object Window] }";if(typeof globalThis<"u"&&G===globalThis||typeof pi<"u"&&G===pi)return"{ [object globalThis] }";if(!Je(G)&&!vt(G)){var R=Ht(G,Ut),oe=ke?ke(G)===Object.prototype:G instanceof Object||G.constructor===Object,ve=G instanceof Object?"":"null prototype",Ne=!oe&&ge&&Object(G)===G&&ge in G?A.call(_e(G),8,-1):ve?"Object":"",Ve=oe||typeof G.constructor!="function"?"":G.constructor.name?G.constructor.name+" ":"",ct=Ve+(Ne||ve?"["+ee.call(K.call([],Ne||[],ve||[]),": ")+"] ":"");return R.length===0?ct+"{}":Fr?ct+"{"+Ar(R,Fr)+"}":ct+"{ "+ee.call(R,", ")+" }"}return String(G)};function Et(H,G,at){var wt=at.quoteStyle||G,ft=Be[wt];return ft+H+ft}function Tt(H){return P.call(String(H),/"/g,"&quot;")}function Ze(H){return _e(H)==="[object Array]"&&(!ge||!(typeof H=="object"&&ge in H))}function Je(H){return _e(H)==="[object Date]"&&(!ge||!(typeof H=="object"&&ge in H))}function vt(H){return _e(H)==="[object RegExp]"&&(!ge||!(typeof H=="object"&&ge in H))}function De(H){return _e(H)==="[object Error]"&&(!ge||!(typeof H=="object"&&ge in H))}function Ge(H){return _e(H)==="[object String]"&&(!ge||!(typeof H=="object"&&ge in H))}function V(H){return _e(H)==="[object Number]"&&(!ge||!(typeof H=="object"&&ge in H))}function Q(H){return _e(H)==="[object Boolean]"&&(!ge||!(typeof H=="object"&&ge in H))}function q(H){if(Pe)return H&&typeof H=="object"&&H instanceof Symbol;if(typeof H=="symbol")return!0;if(!H||typeof H!="object"||!Ce)return!1;try{return Ce.call(H),!0}catch{}return!1}function J(H){if(!H||typeof H!="object"||!Ie)return!1;try{return Ie.call(H),!0}catch{}return!1}var te=Object.prototype.hasOwnProperty||function(H){return H in this};function W(H,G){return te.call(H,G)}function _e(H){return I.call(H)}function ze(H){if(H.name)return H.name;var G=_.call(x.call(H),/^function\s*([\w$]+)/);return G?G[1]:null}function $e(H,G){if(H.indexOf)return H.indexOf(G);for(var at=0,wt=H.length;at<wt;at++)if(H[at]===G)return at;return-1}function se(H){if(!t||!H||typeof H!="object")return!1;try{t.call(H);try{u.call(H)}catch{return!0}return H instanceof Map}catch{}return!1}function we(H){if(!h||!H||typeof H!="object")return!1;try{h.call(H,h);try{y.call(H,y)}catch{return!0}return H instanceof WeakMap}catch{}return!1}function Qe(H){if(!m||!H||typeof H!="object")return!1;try{return m.call(H),!0}catch{}return!1}function mt(H){if(!u||!H||typeof H!="object")return!1;try{u.call(H);try{t.call(H)}catch{return!0}return H instanceof Set}catch{}return!1}function yt(H){if(!y||!H||typeof H!="object")return!1;try{y.call(H,y);try{h.call(H,h)}catch{return!0}return H instanceof WeakSet}catch{}return!1}function Yt(H){return!H||typeof H!="object"?!1:typeof HTMLElement<"u"&&H instanceof HTMLElement?!0:typeof H.nodeName=="string"&&typeof H.getAttribute=="function"}function At(H,G){if(H.length>G.maxStringLength){var at=H.length-G.maxStringLength,wt="... "+at+" more character"+(at>1?"s":"");return At(A.call(H,0,G.maxStringLength),G)+wt}var ft=Ke[G.quoteStyle||"single"];ft.lastIndex=0;var He=P.call(P.call(H,ft,"\\$1"),/[\x00-\x1f]/g,Wt);return Et(He,"single",G)}function Wt(H){var G=H.charCodeAt(0),at={8:"b",9:"t",10:"n",12:"f",13:"r"}[G];return at?"\\"+at:"\\x"+(G<16?"0":"")+M.call(G.toString(16))}function Gt(H){return"Object("+H+")"}function Er(H){return H+" { ? }"}function zt(H,G,at,wt){var ft=wt?Ar(at,wt):ee.call(at,", ");return H+" ("+G+") {"+ft+"}"}function sr(H){for(var G=0;G<H.length;G++)if($e(H[G],`
129
129
  `)>=0)return!1;return!0}function dr(H,G){var at;if(H.indent===" ")at=" ";else if(typeof H.indent=="number"&&H.indent>0)at=ee.call(Array(H.indent+1)," ");else return null;return{base:at,prev:ee.call(Array(G+1),at)}}function Ar(H,G){if(H.length===0)return"";var at=`
130
130
  `+G.prev+G.base;return at+ee.call(H,","+at)+`
131
- `+G.prev}function Ht(H,G){var at=Ze(H),wt=[];if(at){wt.length=H.length;for(var ft=0;ft<H.length;ft++)wt[ft]=W(H,ft)?G(H[ft],H):""}var He=typeof pe=="function"?pe(H):[],Kt;if(Pe){Kt={};for(var Zt=0;Zt<He.length;Zt++)Kt["$"+He[Zt]]=He[Zt]}for(var Qt in H)W(H,Qt)&&(at&&String(Number(Qt))===Qt&&Qt<H.length||Pe&&Kt["$"+Qt]instanceof Symbol||(j.call(/[^\w$]/,Qt)?wt.push(G(Qt,H)+": "+G(H[Qt],H)):wt.push(Qt+": "+G(H[Qt],H))));if(typeof pe=="function")for(var kr=0;kr<He.length;kr++)We.call(H,He[kr])&&wt.push("["+G(He[kr])+"]: "+G(H[He[kr]],H));return wt}return gh}var vh,q0;function Uk(){if(q0)return vh;q0=1;var r=ec(),e=da(),t=function(c,f,h){for(var d=c,y;(y=d.next)!=null;d=y)if(y.key===f)return d.next=y.next,h||(y.next=c.next,c.next=y),y},n=function(c,f){if(c){var h=t(c,f);return h&&h.value}},i=function(c,f,h){var d=t(c,f);d?d.value=h:c.next={key:f,next:c.next,value:h}},a=function(c,f){return c?!!t(c,f):!1},u=function(c,f){if(c)return t(c,f,!0)};return vh=function(){var f,h={assert:function(d){if(!h.has(d))throw new e("Side channel does not contain "+r(d))},delete:function(d){var y=f&&f.next,g=u(f,d);return g&&y&&y===g&&(f=void 0),!!g},get:function(d){return n(f,d)},has:function(d){return a(f,d)},set:function(d,y){f||(f={next:void 0}),i(f,d,y)}};return h},vh}var bh,j0;function U0(){return j0||(j0=1,bh=Object),bh}var wh,$0;function $k(){return $0||($0=1,wh=Error),wh}var _h,B0;function Bk(){return B0||(B0=1,_h=EvalError),_h}var xh,V0;function Vk(){return V0||(V0=1,xh=RangeError),xh}var Sh,W0;function Wk(){return W0||(W0=1,Sh=ReferenceError),Sh}var Eh,z0;function zk(){return z0||(z0=1,Eh=SyntaxError),Eh}var Oh,H0;function Hk(){return H0||(H0=1,Oh=URIError),Oh}var Th,G0;function Gk(){return G0||(G0=1,Th=Math.abs),Th}var Ah,Q0;function Qk(){return Q0||(Q0=1,Ah=Math.floor),Ah}var kh,J0;function Jk(){return J0||(J0=1,kh=Math.max),kh}var Ih,Y0;function Yk(){return Y0||(Y0=1,Ih=Math.min),Ih}var Ch,K0;function Kk(){return K0||(K0=1,Ch=Math.pow),Ch}var Ph,Z0;function Zk(){return Z0||(Z0=1,Ph=Math.round),Ph}var Nh,X0;function Xk(){return X0||(X0=1,Nh=Number.isNaN||function(e){return e!==e}),Nh}var Rh,eb;function eI(){if(eb)return Rh;eb=1;var r=Xk();return Rh=function(t){return r(t)||t===0?t:t<0?-1:1},Rh}var Mh,tb;function tI(){return tb||(tb=1,Mh=Object.getOwnPropertyDescriptor),Mh}var Dh,rb;function nb(){if(rb)return Dh;rb=1;var r=tI();if(r)try{r([],"length")}catch{r=null}return Dh=r,Dh}var Fh,ib;function rI(){if(ib)return Fh;ib=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return Fh=r,Fh}var Lh,sb;function nI(){return sb||(sb=1,Lh=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(e,t);if(c.value!==i||c.enumerable!==!0)return!1}return!0}),Lh}var qh,ab;function iI(){if(ab)return qh;ab=1;var r=typeof Symbol<"u"&&Symbol,e=nI();return qh=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},qh}var jh,ob;function ub(){return ob||(ob=1,jh=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),jh}var Uh,cb;function lb(){if(cb)return Uh;cb=1;var r=U0();return Uh=r.getPrototypeOf||null,Uh}var $h,fb;function sI(){if(fb)return $h;fb=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(f,h){for(var d=[],y=0;y<f.length;y+=1)d[y]=f[y];for(var g=0;g<h.length;g+=1)d[g+f.length]=h[g];return d},a=function(f,h){for(var d=[],y=h,g=0;y<f.length;y+=1,g+=1)d[g]=f[y];return d},u=function(c,f){for(var h="",d=0;d<c.length;d+=1)h+=c[d],d+1<c.length&&(h+=f);return h};return $h=function(f){var h=this;if(typeof h!="function"||e.apply(h)!==n)throw new TypeError(r+h);for(var d=a(arguments,1),y,g=function(){if(this instanceof y){var _=h.apply(this,i(d,arguments));return Object(_)===_?_:this}return h.apply(f,i(d,arguments))},m=t(0,h.length-d.length),b=[],I=0;I<m;I++)b[I]="$"+I;if(y=Function("binder","return function ("+u(b,",")+"){ return binder.apply(this,arguments); }")(g),h.prototype){var x=function(){};x.prototype=h.prototype,y.prototype=new x,x.prototype=null}return y},$h}var Bh,hb;function tc(){if(hb)return Bh;hb=1;var r=sI();return Bh=Function.prototype.bind||r,Bh}var Vh,db;function Wh(){return db||(db=1,Vh=Function.prototype.call),Vh}var zh,pb;function mb(){return pb||(pb=1,zh=Function.prototype.apply),zh}var Hh,yb;function aI(){return yb||(yb=1,Hh=typeof Reflect<"u"&&Reflect&&Reflect.apply),Hh}var Gh,gb;function oI(){if(gb)return Gh;gb=1;var r=tc(),e=mb(),t=Wh(),n=aI();return Gh=n||r.call(t,e),Gh}var Qh,vb;function bb(){if(vb)return Qh;vb=1;var r=tc(),e=da(),t=Wh(),n=oI();return Qh=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},Qh}var Jh,wb;function uI(){if(wb)return Jh;wb=1;var r=bb(),e=nb(),t;try{t=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Jh=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(c){return a(c==null?c:i(c))}:!1,Jh}var Yh,_b;function cI(){if(_b)return Yh;_b=1;var r=ub(),e=lb(),t=uI();return Yh=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,Yh}var Kh,xb;function lI(){if(xb)return Kh;xb=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=tc();return Kh=t.call(r,e),Kh}var Zh,Sb;function Xh(){if(Sb)return Zh;Sb=1;var r,e=U0(),t=$k(),n=Bk(),i=Vk(),a=Wk(),u=zk(),c=da(),f=Hk(),h=Gk(),d=Qk(),y=Jk(),g=Yk(),m=Kk(),b=Zk(),I=eI(),x=Function,_=function(De){try{return x('"use strict"; return ('+De+").constructor;")()}catch{}},A=nb(),P=rI(),M=function(){throw new c},$=A?function(){try{return arguments.callee,M}catch{try{return A(arguments,"callee").get}catch{return M}}}():M,j=iI()(),K=cI(),ee=lb(),fe=ub(),de=mb(),Ie=Wh(),pe={},Ce=typeof Uint8Array>"u"||!K?r:K(Uint8Array),Pe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":j&&K?K([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":pe,"%AsyncGenerator%":pe,"%AsyncGeneratorFunction%":pe,"%AsyncIteratorPrototype%":pe,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":pe,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":j&&K?K(K([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!j||!K?r:K(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":A,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!j||!K?r:K(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":j&&K?K(""[Symbol.iterator]()):r,"%Symbol%":j?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":$,"%TypedArray%":Ce,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":f,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":Ie,"%Function.prototype.apply%":de,"%Object.defineProperty%":P,"%Object.getPrototypeOf%":ee,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":y,"%Math.min%":g,"%Math.pow%":m,"%Math.round%":b,"%Math.sign%":I,"%Reflect.getPrototypeOf%":fe};if(K)try{null.error}catch(De){var ge=K(K(De));Pe["%Error.prototype%"]=ge}var We=function De(Ge){var V;if(Ge==="%AsyncFunction%")V=_("async function () {}");else if(Ge==="%GeneratorFunction%")V=_("function* () {}");else if(Ge==="%AsyncGeneratorFunction%")V=_("async function* () {}");else if(Ge==="%AsyncGenerator%"){var Q=De("%AsyncGeneratorFunction%");Q&&(V=Q.prototype)}else if(Ge==="%AsyncIteratorPrototype%"){var q=De("%AsyncGenerator%");q&&K&&(V=K(q.prototype))}return Pe[Ge]=V,V},ke={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},X=tc(),ye=lI(),xe=X.call(Ie,Array.prototype.concat),Se=X.call(de,Array.prototype.splice),Be=X.call(Ie,String.prototype.replace),Ke=X.call(Ie,String.prototype.slice),Et=X.call(Ie,RegExp.prototype.exec),Tt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ze=/\\(\\)?/g,Je=function(Ge){var V=Ke(Ge,0,1),Q=Ke(Ge,-1);if(V==="%"&&Q!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(Q==="%"&&V!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var q=[];return Be(Ge,Tt,function(J,te,W,_e){q[q.length]=W?Be(_e,Ze,"$1"):te||J}),q},vt=function(Ge,V){var Q=Ge,q;if(ye(ke,Q)&&(q=ke[Q],Q="%"+q[0]+"%"),ye(Pe,Q)){var J=Pe[Q];if(J===pe&&(J=We(Q)),typeof J>"u"&&!V)throw new c("intrinsic "+Ge+" exists, but is not available. Please file an issue!");return{alias:q,name:Q,value:J}}throw new u("intrinsic "+Ge+" does not exist!")};return Zh=function(Ge,V){if(typeof Ge!="string"||Ge.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof V!="boolean")throw new c('"allowMissing" argument must be a boolean');if(Et(/^%?[^%]*%?$/,Ge)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Q=Je(Ge),q=Q.length>0?Q[0]:"",J=vt("%"+q+"%",V),te=J.name,W=J.value,_e=!1,ze=J.alias;ze&&(q=ze[0],Se(Q,xe([0,1],ze)));for(var $e=1,se=!0;$e<Q.length;$e+=1){var we=Q[$e],Qe=Ke(we,0,1),mt=Ke(we,-1);if((Qe==='"'||Qe==="'"||Qe==="`"||mt==='"'||mt==="'"||mt==="`")&&Qe!==mt)throw new u("property names with quotes must have matching quotes");if((we==="constructor"||!se)&&(_e=!0),q+="."+we,te="%"+q+"%",ye(Pe,te))W=Pe[te];else if(W!=null){if(!(we in W)){if(!V)throw new c("base intrinsic for "+Ge+" exists, but the property is not available.");return}if(A&&$e+1>=Q.length){var yt=A(W,we);se=!!yt,se&&"get"in yt&&!("originalValue"in yt.get)?W=yt.get:W=W[we]}else se=ye(W,we),W=W[we];se&&!_e&&(Pe[te]=W)}}return W},Zh}var ed,Eb;function Ob(){if(Eb)return ed;Eb=1;var r=Xh(),e=bb(),t=e([r("%String.prototype.indexOf%")]);return ed=function(i,a){var u=r(i,!!a);return typeof u=="function"&&t(i,".prototype.")>-1?e([u]):u},ed}var td,Tb;function Ab(){if(Tb)return td;Tb=1;var r=Xh(),e=Ob(),t=ec(),n=da(),i=r("%Map%",!0),a=e("Map.prototype.get",!0),u=e("Map.prototype.set",!0),c=e("Map.prototype.has",!0),f=e("Map.prototype.delete",!0),h=e("Map.prototype.size",!0);return td=!!i&&function(){var y,g={assert:function(m){if(!g.has(m))throw new n("Side channel does not contain "+t(m))},delete:function(m){if(y){var b=f(y,m);return h(y)===0&&(y=void 0),b}return!1},get:function(m){if(y)return a(y,m)},has:function(m){return y?c(y,m):!1},set:function(m,b){y||(y=new i),u(y,m,b)}};return g},td}var rd,kb;function fI(){if(kb)return rd;kb=1;var r=Xh(),e=Ob(),t=ec(),n=Ab(),i=da(),a=r("%WeakMap%",!0),u=e("WeakMap.prototype.get",!0),c=e("WeakMap.prototype.set",!0),f=e("WeakMap.prototype.has",!0),h=e("WeakMap.prototype.delete",!0);return rd=a?function(){var y,g,m={assert:function(b){if(!m.has(b))throw new i("Side channel does not contain "+t(b))},delete:function(b){if(a&&b&&(typeof b=="object"||typeof b=="function")){if(y)return h(y,b)}else if(n&&g)return g.delete(b);return!1},get:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&y?u(y,b):g&&g.get(b)},has:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&y?f(y,b):!!g&&g.has(b)},set:function(b,I){a&&b&&(typeof b=="object"||typeof b=="function")?(y||(y=new a),c(y,b,I)):n&&(g||(g=n()),g.set(b,I))}};return m}:n,rd}var nd,Ib;function hI(){if(Ib)return nd;Ib=1;var r=da(),e=ec(),t=Uk(),n=Ab(),i=fI(),a=i||n||t;return nd=function(){var c,f={assert:function(h){if(!f.has(h))throw new r("Side channel does not contain "+e(h))},delete:function(h){return!!c&&c.delete(h)},get:function(h){return c&&c.get(h)},has:function(h){return!!c&&c.has(h)},set:function(h,d){c||(c=a()),c.set(h,d)}};return f},nd}var id,Cb;function sd(){if(Cb)return id;Cb=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return id={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},id}var ad,Pb;function Nb(){if(Pb)return ad;Pb=1;var r=sd(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var x=[],_=0;_<256;++_)x.push("%"+((_<16?"0":"")+_.toString(16)).toUpperCase());return x}(),i=function(_){for(;_.length>1;){var A=_.pop(),P=A.obj[A.prop];if(t(P)){for(var M=[],$=0;$<P.length;++$)typeof P[$]<"u"&&M.push(P[$]);A.obj[A.prop]=M}}},a=function(_,A){for(var P=A&&A.plainObjects?Object.create(null):{},M=0;M<_.length;++M)typeof _[M]<"u"&&(P[M]=_[M]);return P},u=function x(_,A,P){if(!A)return _;if(typeof A!="object"){if(t(_))_.push(A);else if(_&&typeof _=="object")(P&&(P.plainObjects||P.allowPrototypes)||!e.call(Object.prototype,A))&&(_[A]=!0);else return[_,A];return _}if(!_||typeof _!="object")return[_].concat(A);var M=_;return t(_)&&!t(A)&&(M=a(_,P)),t(_)&&t(A)?(A.forEach(function($,j){if(e.call(_,j)){var K=_[j];K&&typeof K=="object"&&$&&typeof $=="object"?_[j]=x(K,$,P):_.push($)}else _[j]=$}),_):Object.keys(A).reduce(function($,j){var K=A[j];return e.call($,j)?$[j]=x($[j],K,P):$[j]=K,$},M)},c=function(_,A){return Object.keys(A).reduce(function(P,M){return P[M]=A[M],P},_)},f=function(x,_,A){var P=x.replace(/\+/g," ");if(A==="iso-8859-1")return P.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(P)}catch{return P}},h=1024,d=function(_,A,P,M,$){if(_.length===0)return _;var j=_;if(typeof _=="symbol"?j=Symbol.prototype.toString.call(_):typeof _!="string"&&(j=String(_)),P==="iso-8859-1")return escape(j).replace(/%u[0-9a-f]{4}/gi,function(Ce){return"%26%23"+parseInt(Ce.slice(2),16)+"%3B"});for(var K="",ee=0;ee<j.length;ee+=h){for(var fe=j.length>=h?j.slice(ee,ee+h):j,de=[],Ie=0;Ie<fe.length;++Ie){var pe=fe.charCodeAt(Ie);if(pe===45||pe===46||pe===95||pe===126||pe>=48&&pe<=57||pe>=65&&pe<=90||pe>=97&&pe<=122||$===r.RFC1738&&(pe===40||pe===41)){de[de.length]=fe.charAt(Ie);continue}if(pe<128){de[de.length]=n[pe];continue}if(pe<2048){de[de.length]=n[192|pe>>6]+n[128|pe&63];continue}if(pe<55296||pe>=57344){de[de.length]=n[224|pe>>12]+n[128|pe>>6&63]+n[128|pe&63];continue}Ie+=1,pe=65536+((pe&1023)<<10|fe.charCodeAt(Ie)&1023),de[de.length]=n[240|pe>>18]+n[128|pe>>12&63]+n[128|pe>>6&63]+n[128|pe&63]}K+=de.join("")}return K},y=function(_){for(var A=[{obj:{o:_},prop:"o"}],P=[],M=0;M<A.length;++M)for(var $=A[M],j=$.obj[$.prop],K=Object.keys(j),ee=0;ee<K.length;++ee){var fe=K[ee],de=j[fe];typeof de=="object"&&de!==null&&P.indexOf(de)===-1&&(A.push({obj:j,prop:fe}),P.push(de))}return i(A),_},g=function(_){return Object.prototype.toString.call(_)==="[object RegExp]"},m=function(_){return!_||typeof _!="object"?!1:!!(_.constructor&&_.constructor.isBuffer&&_.constructor.isBuffer(_))},b=function(_,A){return[].concat(_,A)},I=function(_,A){if(t(_)){for(var P=[],M=0;M<_.length;M+=1)P.push(A(_[M]));return P}return A(_)};return ad={arrayToObject:a,assign:c,combine:b,compact:y,decode:f,encode:d,isBuffer:m,isRegExp:g,maybeMap:I,merge:u},ad}var od,Rb;function dI(){if(Rb)return od;Rb=1;var r=hI(),e=Nb(),t=sd(),n=Object.prototype.hasOwnProperty,i={brackets:function(x){return x+"[]"},comma:"comma",indices:function(x,_){return x+"["+_+"]"},repeat:function(x){return x}},a=Array.isArray,u=Array.prototype.push,c=function(I,x){u.apply(I,a(x)?x:[x])},f=Date.prototype.toISOString,h=t.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:h,formatter:t.formatters[h],indices:!1,serializeDate:function(x){return f.call(x)},skipNulls:!1,strictNullHandling:!1},y=function(x){return typeof x=="string"||typeof x=="number"||typeof x=="boolean"||typeof x=="symbol"||typeof x=="bigint"},g={},m=function I(x,_,A,P,M,$,j,K,ee,fe,de,Ie,pe,Ce,Pe,ge,We,ke){for(var X=x,ye=ke,xe=0,Se=!1;(ye=ye.get(g))!==void 0&&!Se;){var Be=ye.get(x);if(xe+=1,typeof Be<"u"){if(Be===xe)throw new RangeError("Cyclic object value");Se=!0}typeof ye.get(g)>"u"&&(xe=0)}if(typeof fe=="function"?X=fe(_,X):X instanceof Date?X=pe(X):A==="comma"&&a(X)&&(X=e.maybeMap(X,function(te){return te instanceof Date?pe(te):te})),X===null){if($)return ee&&!ge?ee(_,d.encoder,We,"key",Ce):_;X=""}if(y(X)||e.isBuffer(X)){if(ee){var Ke=ge?_:ee(_,d.encoder,We,"key",Ce);return[Pe(Ke)+"="+Pe(ee(X,d.encoder,We,"value",Ce))]}return[Pe(_)+"="+Pe(String(X))]}var Et=[];if(typeof X>"u")return Et;var Tt;if(A==="comma"&&a(X))ge&&ee&&(X=e.maybeMap(X,ee)),Tt=[{value:X.length>0?X.join(",")||null:void 0}];else if(a(fe))Tt=fe;else{var Ze=Object.keys(X);Tt=de?Ze.sort(de):Ze}var Je=K?_.replace(/\./g,"%2E"):_,vt=P&&a(X)&&X.length===1?Je+"[]":Je;if(M&&a(X)&&X.length===0)return vt+"[]";for(var De=0;De<Tt.length;++De){var Ge=Tt[De],V=typeof Ge=="object"&&typeof Ge.value<"u"?Ge.value:X[Ge];if(!(j&&V===null)){var Q=Ie&&K?Ge.replace(/\./g,"%2E"):Ge,q=a(X)?typeof A=="function"?A(vt,Q):vt:vt+(Ie?"."+Q:"["+Q+"]");ke.set(x,xe);var J=r();J.set(g,ke),c(Et,I(V,q,A,P,M,$,j,K,A==="comma"&&ge&&a(X)?null:ee,fe,de,Ie,pe,Ce,Pe,ge,We,J))}}return Et},b=function(x){if(!x)return d;if(typeof x.allowEmptyArrays<"u"&&typeof x.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof x.encodeDotInKeys<"u"&&typeof x.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(x.encoder!==null&&typeof x.encoder<"u"&&typeof x.encoder!="function")throw new TypeError("Encoder has to be a function.");var _=x.charset||d.charset;if(typeof x.charset<"u"&&x.charset!=="utf-8"&&x.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var A=t.default;if(typeof x.format<"u"){if(!n.call(t.formatters,x.format))throw new TypeError("Unknown format option provided.");A=x.format}var P=t.formatters[A],M=d.filter;(typeof x.filter=="function"||a(x.filter))&&(M=x.filter);var $;if(x.arrayFormat in i?$=x.arrayFormat:"indices"in x?$=x.indices?"indices":"repeat":$=d.arrayFormat,"commaRoundTrip"in x&&typeof x.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var j=typeof x.allowDots>"u"?x.encodeDotInKeys===!0?!0:d.allowDots:!!x.allowDots;return{addQueryPrefix:typeof x.addQueryPrefix=="boolean"?x.addQueryPrefix:d.addQueryPrefix,allowDots:j,allowEmptyArrays:typeof x.allowEmptyArrays=="boolean"?!!x.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:$,charset:_,charsetSentinel:typeof x.charsetSentinel=="boolean"?x.charsetSentinel:d.charsetSentinel,commaRoundTrip:x.commaRoundTrip,delimiter:typeof x.delimiter>"u"?d.delimiter:x.delimiter,encode:typeof x.encode=="boolean"?x.encode:d.encode,encodeDotInKeys:typeof x.encodeDotInKeys=="boolean"?x.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof x.encoder=="function"?x.encoder:d.encoder,encodeValuesOnly:typeof x.encodeValuesOnly=="boolean"?x.encodeValuesOnly:d.encodeValuesOnly,filter:M,format:A,formatter:P,serializeDate:typeof x.serializeDate=="function"?x.serializeDate:d.serializeDate,skipNulls:typeof x.skipNulls=="boolean"?x.skipNulls:d.skipNulls,sort:typeof x.sort=="function"?x.sort:null,strictNullHandling:typeof x.strictNullHandling=="boolean"?x.strictNullHandling:d.strictNullHandling}};return od=function(I,x){var _=I,A=b(x),P,M;typeof A.filter=="function"?(M=A.filter,_=M("",_)):a(A.filter)&&(M=A.filter,P=M);var $=[];if(typeof _!="object"||_===null)return"";var j=i[A.arrayFormat],K=j==="comma"&&A.commaRoundTrip;P||(P=Object.keys(_)),A.sort&&P.sort(A.sort);for(var ee=r(),fe=0;fe<P.length;++fe){var de=P[fe];A.skipNulls&&_[de]===null||c($,m(_[de],de,j,K,A.allowEmptyArrays,A.strictNullHandling,A.skipNulls,A.encodeDotInKeys,A.encode?A.encoder:null,A.filter,A.sort,A.allowDots,A.serializeDate,A.format,A.formatter,A.encodeValuesOnly,A.charset,ee))}var Ie=$.join(A.delimiter),pe=A.addQueryPrefix===!0?"?":"";return A.charsetSentinel&&(A.charset==="iso-8859-1"?pe+="utf8=%26%2310003%3B&":pe+="utf8=%E2%9C%93&"),Ie.length>0?pe+Ie:""},od}var ud,Mb;function pI(){if(Mb)return ud;Mb=1;var r=Nb(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(g){return g.replace(/&#(\d+);/g,function(m,b){return String.fromCharCode(parseInt(b,10))})},a=function(g,m){return g&&typeof g=="string"&&m.comma&&g.indexOf(",")>-1?g.split(","):g},u="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",f=function(m,b){var I={__proto__:null},x=b.ignoreQueryPrefix?m.replace(/^\?/,""):m;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var _=b.parameterLimit===1/0?void 0:b.parameterLimit,A=x.split(b.delimiter,_),P=-1,M,$=b.charset;if(b.charsetSentinel)for(M=0;M<A.length;++M)A[M].indexOf("utf8=")===0&&(A[M]===c?$="utf-8":A[M]===u&&($="iso-8859-1"),P=M,M=A.length);for(M=0;M<A.length;++M)if(M!==P){var j=A[M],K=j.indexOf("]="),ee=K===-1?j.indexOf("="):K+1,fe,de;ee===-1?(fe=b.decoder(j,n.decoder,$,"key"),de=b.strictNullHandling?null:""):(fe=b.decoder(j.slice(0,ee),n.decoder,$,"key"),de=r.maybeMap(a(j.slice(ee+1),b),function(pe){return b.decoder(pe,n.decoder,$,"value")})),de&&b.interpretNumericEntities&&$==="iso-8859-1"&&(de=i(de)),j.indexOf("[]=")>-1&&(de=t(de)?[de]:de);var Ie=e.call(I,fe);Ie&&b.duplicates==="combine"?I[fe]=r.combine(I[fe],de):(!Ie||b.duplicates==="last")&&(I[fe]=de)}return I},h=function(g,m,b,I){for(var x=I?m:a(m,b),_=g.length-1;_>=0;--_){var A,P=g[_];if(P==="[]"&&b.parseArrays)A=b.allowEmptyArrays&&(x===""||b.strictNullHandling&&x===null)?[]:[].concat(x);else{A=b.plainObjects?Object.create(null):{};var M=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,$=b.decodeDotInKeys?M.replace(/%2E/g,"."):M,j=parseInt($,10);!b.parseArrays&&$===""?A={0:x}:!isNaN(j)&&P!==$&&String(j)===$&&j>=0&&b.parseArrays&&j<=b.arrayLimit?(A=[],A[j]=x):$!=="__proto__"&&(A[$]=x)}x=A}return x},d=function(m,b,I,x){if(m){var _=I.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,A=/(\[[^[\]]*])/,P=/(\[[^[\]]*])/g,M=I.depth>0&&A.exec(_),$=M?_.slice(0,M.index):_,j=[];if($){if(!I.plainObjects&&e.call(Object.prototype,$)&&!I.allowPrototypes)return;j.push($)}for(var K=0;I.depth>0&&(M=P.exec(_))!==null&&K<I.depth;){if(K+=1,!I.plainObjects&&e.call(Object.prototype,M[1].slice(1,-1))&&!I.allowPrototypes)return;j.push(M[1])}if(M){if(I.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+I.depth+" and strictDepth is true");j.push("["+_.slice(M.index)+"]")}return h(j,b,I,x)}},y=function(m){if(!m)return n;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var b=typeof m.charset>"u"?n.charset:m.charset,I=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(I!=="combine"&&I!=="first"&&I!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:x,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:b,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||r.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:I,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return ud=function(g,m){var b=y(m);if(g===""||g===null||typeof g>"u")return b.plainObjects?Object.create(null):{};for(var I=typeof g=="string"?f(g,b):g,x=b.plainObjects?Object.create(null):{},_=Object.keys(I),A=0;A<_.length;++A){var P=_[A],M=d(P,I[P],b,typeof g=="string");x=r.merge(x,M,b)}return b.allowSparse===!0?x:r.compact(x)},ud}var cd,Db;function mI(){if(Db)return cd;Db=1;var r=dI(),e=pI(),t=sd();return cd={formats:t,parse:e,stringify:r},cd}(function(r,e){(function(t,n){n(e,Lk,qk,mI())})(pi,function(t,n,i,a){var u=function(V,Q,q,J){function te(W){return W instanceof q?W:new q(function(_e){_e(W)})}return new(q||(q=Promise))(function(W,_e){function ze(we){try{se(J.next(we))}catch(Qe){_e(Qe)}}function $e(we){try{se(J.throw(we))}catch(Qe){_e(Qe)}}function se(we){we.done?W(we.value):te(we.value).then(ze,$e)}se((J=J.apply(V,Q||[])).next())})},c=function(V,Q){var q={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},J,te,W,_e;return _e={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(_e[Symbol.iterator]=function(){return this}),_e;function ze(se){return function(we){return $e([se,we])}}function $e(se){if(J)throw new TypeError("Generator is already executing.");for(;q;)try{if(J=1,te&&(W=se[0]&2?te.return:se[0]?te.throw||((W=te.return)&&W.call(te),0):te.next)&&!(W=W.call(te,se[1])).done)return W;switch(te=0,W&&(se=[se[0]&2,W.value]),se[0]){case 0:case 1:W=se;break;case 4:return q.label++,{value:se[1],done:!1};case 5:q.label++,te=se[1],se=[0];continue;case 7:se=q.ops.pop(),q.trys.pop();continue;default:if(W=q.trys,!(W=W.length>0&&W[W.length-1])&&(se[0]===6||se[0]===2)){q=0;continue}if(se[0]===3&&(!W||se[1]>W[0]&&se[1]<W[3])){q.label=se[1];break}if(se[0]===6&&q.label<W[1]){q.label=W[1],W=se;break}if(W&&q.label<W[2]){q.label=W[2],q.ops.push(se);break}W[2]&&q.ops.pop(),q.trys.pop();continue}se=Q.call(V,q)}catch(we){se=[6,we],te=0}finally{J=W=0}if(se[0]&5)throw se[1];return{value:se[0]?se[1]:void 0,done:!0}}};function f(V,Q){if(V.directives&&V.directives.length){var q={};return V.directives.forEach(function(J){q[J.name.value]=i.argumentsObjectFromField(J,Q)}),q}return null}var h=Object.prototype.hasOwnProperty;function d(V,Q){Q!==null&&typeof Q=="object"&&Object.keys(Q).forEach(function(q){var J=Q[q];h.call(V,q)?d(V[q],J):V[q]=J})}function y(V,Q,q,J,te,W){W===void 0&&(W={});var _e=i.getMainDefinition(Q),ze=i.getFragmentDefinitions(Q),$e=i.createFragmentMap(ze),se=W.resultMapper,we=W.fragmentMatcher||function(){return!0},Qe={fragmentMap:$e,contextValue:J,variableValues:te,resultMapper:se,resolver:V,fragmentMatcher:we};return g(_e.selectionSet,q,Qe)}function g(V,Q,q){return u(this,void 0,void 0,function(){var J,te,W,_e,ze,$e=this;return c(this,function(se){switch(se.label){case 0:return J=q.fragmentMap,te=q.contextValue,W=q.variableValues,_e={},ze=function(we){return u($e,void 0,void 0,function(){var Qe,mt,yt,Yt,At;return c(this,function(Wt){switch(Wt.label){case 0:return i.shouldInclude(we,W)?i.isField(we)?[4,m(we,Q,q)]:[3,2]:[2];case 1:return Qe=Wt.sent(),mt=i.resultKeyNameFromField(we),Qe!==void 0&&(_e[mt]===void 0?_e[mt]=Qe:d(_e[mt],Qe)),[2];case 2:if(i.isInlineFragment(we))yt=we;else if(yt=J[we.name.value],!yt)throw new Error("No fragment named "+we.name.value);return Yt=yt.typeCondition.name.value,q.fragmentMatcher(Q,Yt,te)?[4,g(yt.selectionSet,Q,q)]:[3,4];case 3:At=Wt.sent(),d(_e,At),Wt.label=4;case 4:return[2]}})})},[4,Promise.all(V.selections.map(ze))];case 1:return se.sent(),q.resultMapper?[2,q.resultMapper(_e,Q)]:[2,_e]}})})}function m(V,Q,q){return u(this,void 0,void 0,function(){var J,te,W,_e,ze,$e,se;return c(this,function(we){switch(we.label){case 0:return J=q.variableValues,te=q.contextValue,W=q.resolver,_e=V.name.value,ze=i.argumentsObjectFromField(V,J),$e={isLeaf:!V.selectionSet,resultKey:i.resultKeyNameFromField(V),directives:f(V,J),field:V},[4,W(_e,Q,ze,te,$e)];case 1:return se=we.sent(),V.selectionSet?se==null?[2,se]:Array.isArray(se)?[2,b(V,se,q)]:[2,g(V.selectionSet,se,q)]:[2,se]}})})}function b(V,Q,q){return Promise.all(Q.map(function(J){return J===null?null:Array.isArray(J)?b(V,J,q):g(V.selectionSet,J,q)}))}var I=function(){var V=function(Q,q){return V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,te){J.__proto__=te}||function(J,te){for(var W in te)te.hasOwnProperty(W)&&(J[W]=te[W])},V(Q,q)};return function(Q,q){V(Q,q);function J(){this.constructor=Q}Q.prototype=q===null?Object.create(q):(J.prototype=q.prototype,new J)}}(),x=function(){return x=Object.assign||function(V){for(var Q,q=1,J=arguments.length;q<J;q++){Q=arguments[q];for(var te in Q)Object.prototype.hasOwnProperty.call(Q,te)&&(V[te]=Q[te])}return V},x.apply(this,arguments)},_=function(V,Q,q,J){function te(W){return W instanceof q?W:new q(function(_e){_e(W)})}return new(q||(q=Promise))(function(W,_e){function ze(we){try{se(J.next(we))}catch(Qe){_e(Qe)}}function $e(we){try{se(J.throw(we))}catch(Qe){_e(Qe)}}function se(we){we.done?W(we.value):te(we.value).then(ze,$e)}se((J=J.apply(V,Q||[])).next())})},A=function(V,Q){var q={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},J,te,W,_e;return _e={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(_e[Symbol.iterator]=function(){return this}),_e;function ze(se){return function(we){return $e([se,we])}}function $e(se){if(J)throw new TypeError("Generator is already executing.");for(;q;)try{if(J=1,te&&(W=se[0]&2?te.return:se[0]?te.throw||((W=te.return)&&W.call(te),0):te.next)&&!(W=W.call(te,se[1])).done)return W;switch(te=0,W&&(se=[se[0]&2,W.value]),se[0]){case 0:case 1:W=se;break;case 4:return q.label++,{value:se[1],done:!1};case 5:q.label++,te=se[1],se=[0];continue;case 7:se=q.ops.pop(),q.trys.pop();continue;default:if(W=q.trys,!(W=W.length>0&&W[W.length-1])&&(se[0]===6||se[0]===2)){q=0;continue}if(se[0]===3&&(!W||se[1]>W[0]&&se[1]<W[3])){q.label=se[1];break}if(se[0]===6&&q.label<W[1]){q.label=W[1],W=se;break}if(W&&q.label<W[2]){q.label=W[2],q.ops.push(se);break}W[2]&&q.ops.pop(),q.trys.pop();continue}se=Q.call(V,q)}catch(we){se=[6,we],te=0}finally{J=W=0}if(se[0]&5)throw se[1];return{value:se[0]?se[1]:void 0,done:!0}}},P=function(){for(var V=0,Q=0,q=arguments.length;Q<q;Q++)V+=arguments[Q].length;for(var J=Array(V),te=0,Q=0;Q<q;Q++)for(var W=arguments[Q],_e=0,ze=W.length;_e<ze;_e++,te++)J[te]=W[_e];return J},M=function(V){var Q=V.replace(/\s/g,""),q=Q.replace(/\[(.*)\]/,function(J,te,W,_e){return((te!=null&&te.length)>0?te:null)||Q});return q},$=function(V,Q,q,J){if(Array.isArray(V)){var te=M(Q);return V.map(function(W){return $(W,te,q,J)})}return V==null||typeof V=="number"||typeof V=="boolean"||typeof V=="string"?V:q(V,Q,q,J)},j=function(V){return V.directives&&V.directives.length?V.directives.find(function(Q){return Q.name.value==="rest"}):null};function K(V,Q,q,J,te){return te==null||Q==null||typeof Q=="number"||typeof Q=="boolean"||typeof Q=="string"||te.selections.forEach(function(W){if(i.isInlineFragment(W))K(V,Q,q,J,W.selectionSet);else if(W.kind==="FragmentSpread"){var _e=J[W.name.value];K(V,Q,q,J,_e.selectionSet)}else if(i.isField(W)){var ze=i.resultKeyNameFromField(W);ze===V&&j(W)!=null?ee(Q,q,J,W.selectionSet):K(V,Q,q,J,W.selectionSet)}else return function($e){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()}),Q}function ee(V,Q,q,J){if(!(V==null||typeof V=="number"||typeof V=="boolean"||typeof V=="string")){if(Array.isArray(V)){V.forEach(function(te){return ee(te,Q,q,J)});return}J.selections.forEach(function(te){if(i.isInlineFragment(te))ee(V,Q,q,te.selectionSet);else if(te.kind==="FragmentSpread"){var W=q[te.name.value];ee(V,Q,q,W.selectionSet)}else if(i.isField(te)){var _e=V[te.name.value];te.name.value==="__typename"||(typeof _e>"u"?V[te.name.value]=null:_e!=null&&typeof _e=="object"&&te.selectionSet!=null&&ee(_e,Q,q,te.selectionSet))}else return function(ze){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()})}}var fe=function(V,Q){var q=V[Q||Ze]||V[Ze];return typeof q=="string"?{uri:q}:x({responseTransformer:null},q)},de=function(V,Q,q){return q===void 0||Q===void 0?V:V.replace(":"+Q,q)},Ie=function(){function V(){}return V.replacerForPath=function(Q){if(Q in V.cache)return V.cache[Q];var q=Q.indexOf("?"),J=Q.split(V.argReplacement),te=[],W=!1;J.reduce(function(ze,$e){if($e===""||$e==="{}")return ze+$e.length;var se=ze+$e.length;if($e[0]==="{"&&$e[$e.length-1]==="}"){var we=$e.slice(1,$e.length-1).split(".");te.push(function(Qe,mt){try{var yt=pe(Qe,we);return!mt||typeof yt!="object"||yt==null?String(yt):a.stringify(yt)}catch{var Yt=[Q,we.join(".")].join("|");return Yt in V.warnTable||(console.warn("Warning: RestLink caught an error while unpacking",Yt,"This tends to happen if you forgot to pass a parameter needed for creating an @rest(path, or if RestLink was configured to deeply unpack a path parameter that wasn't provided. This message will only log once per detected instance. Trouble-shooting hint: check @rest(path: and the variables provided to this query."),V.warnTable[Yt]=!0),""}})}else te.push($e),!W&&se>=q&&(W=!0,te.push(!0));return se},0);var _e=function(ze){var $e=!1,se=te.reduce(function(we,Qe){return typeof Qe=="string"?we+Qe:typeof Qe=="boolean"?($e=!0,we):we+Qe(ze,$e)},"");return se};return V.cache[Q]=_e},V.cache={},V.warnTable={},V.argReplacement=/({[._a-zA-Z0-9]*})/,V}();function pe(V,Q){if(Q.length===0)return V;var q=P(Q),J=q.shift();return pe(V[J],q)}var Ce=["__typename"],Pe=typeof globalThis=="object"&&globalThis||pi,ge=function(V,Q,q){q===void 0&&(q=[]);var J=null;return Q.length!=2?J=function(te,W){return Q(te)}:J=Q,Array.isArray(V)?V.map(function(te,W){return ge(te,J,P(q,[String(W)]))}):V==null||typeof V!="object"||V.constructor!==Object||Pe.FileList&&V instanceof FileList||Pe.File&&V instanceof File?V:Object.keys(V).reduce(function(te,W){var _e=V[W];if(Ce.indexOf(W)!==-1)return te[W]=_e,te;var ze=P(q,[W]);return te[J(W,ze)]=ge(_e,J,ze),te},{})},We=function(V){return V},ke=function(V){return V instanceof Headers?V:new Headers(V||{})},X=function(){for(var V=[],Q=0;Q<arguments.length;Q++)V[Q]=arguments[Q];return V.reduce(function(q,J){return J&&(J.forEach||(J=ke(J)),J.forEach(function(te,W){q.append(W,te)})),q},new Headers)},ye=function(V,Q,q){var J=new Headers;return V.forEach(function(te,W){Q.indexOf(W)===-1&&J.append(W,te)}),X(J,q||new Headers)},xe=function(V){return function(Q,q){return ye(Q,V,q)}},Se=["GET","POST","PUT","PATCH","DELETE"],Be=function(V,Q){switch(Q){case"query":if(Se.indexOf(V.toUpperCase())!==-1)return;throw new Error('A "query" operation can only support "GET" requests but got "'+V+'".');case"mutation":if(Se.indexOf(V.toUpperCase())!==-1)return;throw new Error('"mutation" operations do not support that HTTP-verb');case"subscription":throw new Error('A "subscription" operation is not supported yet.');default:var q=Q;return q}},Ke=function(V,Q,q){var J=new Error(q);throw J.response=V,J.statusCode=V.status,J.result=Q,J},Et=function(V,Q){return V==null||typeof V!="object"?V:Array.isArray(V)?V.map(function(q){return Et(q,Q)}):(V.__typename=Q,V)},Tt=function(V,Q,q,J,te){return _(void 0,void 0,void 0,function(){var W,_e,ze,$e,se,we,Qe,mt,yt,Yt,At,Wt,Gt,Er,zt,sr,dr,Ar,Ht,H,G,at,wt,ft,He,Kt,Zt,Qt,kr,Hr,Fr,Ut,Or,$r,Lr,ar,Gr,Tr,gr,Ir,Sn,Un,R,oe,ve,Ne,Ve,ct,Xe,rt;return A(this,function(nt){switch(nt.label){case 0:if(W=te.directives,_e=te.isLeaf,ze=te.resultKey,$e=J.exportVariablesByNode,se=$e.get(Q)||{},we=function(bt){return bt instanceof Array?bt.forEach(we):$e.set(bt,x({},se)),bt},Qe=(Q||{})[ze],mt=(Q||{})[V],Q&&W&&W.export&&(se[W.export.as]=mt),yt=W&&W.type,!_e&&yt){if(W.rest)throw new Error("Invalid use of @type(name: ...) directive on a call that also has @rest(...)");return we(mt),[2,Et(mt,W.type.name)]}if(Yt=!W||!W.rest,Yt)return[2,we(Qe||mt)];if(At=J.credentials,Wt=J.endpoints,Gt=J.headers,Er=J.customFetch,zt=J.operationType,sr=J.typePatcher,dr=J.mainDefinition,Ar=J.fragmentDefinitions,Ht=J.fieldNameNormalizer,H=J.fieldNameDenormalizer,G=J.serializers,at=J.responseTransformer,wt=i.createFragmentMap(Ar),ft=W.rest,He=ft.path,Kt=ft.endpoint,Zt=ft.pathBuilder,Qt=fe(Wt,Kt),kr=He==null&&Zt==null,kr)throw new Error('One of ("path" | "pathBuilder") must be set in the @rest() directive. This request had neither, please add one');if(Zt||(He.includes(":")?(console.warn("Deprecated: '@rest(path:' contains a ':' colon, this format will be removed in future versions"),Zt=function(bt){var w=bt.args,k=bt.exportVariables,T=x(x({},w),k),C=Object.keys(T).reduce(function(D,B){return de(D,B,T[B])},He);if(C.includes(":"))throw new Error('Missing parameters to run query, specify it in the query params or use an export directive. (If you need to use ":" inside a variable string make sure to encode the variables properly using `encodeURIComponent`. Alternatively see documentation about using pathBuilder.)');return C}):Zt=Ie.replacerForPath(He)),Hr={args:q,exportVariables:se,context:J,"@rest":W.rest,replacer:Zt},Fr=Zt(Hr),Ut=W.rest,Or=Ut.method,$r=Ut.type,Lr=Ut.bodyBuilder,ar=Ut.bodyKey,Gr=Ut.fieldNameDenormalizer,Tr=Ut.fieldNameNormalizer,gr=Ut.bodySerializer,Or||(Or="GET"),ar||(ar="input"),Ir=void 0,Sn=void 0,["GET","DELETE"].indexOf(Or)===-1){if(!Lr){if(Un=Hr.exportVariables[ar]||Hr.args&&Hr.args[ar],!Un)throw new Error("[GraphQL "+Or+" "+zt+" using a REST call without a body]. No `"+ar+"` was detected. Pass bodyKey, or bodyBuilder to the @rest() directive to resolve this.");Lr=function(bt){return Un}}if(Ir=ge(Lr(Hr),Gr||H||We),R=void 0,typeof gr=="string"){if(!G.hasOwnProperty(gr))throw new Error('"bodySerializer" must correspond to configured serializer. '+("Please make sure to specify a serializer called "+gr+' in the "bodySerializers" property of the RestLink.'));R=G[gr](Ir,Gt)}else R=gr?gr(Ir,Gt):G[Je](Ir,Gt);Ir=R.body,Sn=new Headers(R.headers)}return Be(Or,zt||"query"),oe=x({method:Or,headers:Sn||Gt,body:Ir},At?{credentials:At}:{}),ve=""+Qt.uri+Fr,[4,(Er||fetch)(ve,oe)];case 1:return Ne=nt.sent(),J.responses.push(Ne),Ne.ok?(Ne.status===204||Ne.headers.get("Content-Length")==="0"?Ve={}:Ve=Ne,[3,9]):[3,2];case 2:return Ne.status!==404?[3,3]:(Ve=null,[3,9]);case 3:ct=void 0,nt.label=4;case 4:return nt.trys.push([4,6,,8]),[4,Ne.clone().json()];case 5:return ct=nt.sent(),[3,8];case 6:return nt.sent(),[4,Ne.clone().text()];case 7:return ct=nt.sent(),[3,8];case 8:Ke(Ne,ct,"Response not successful: Received status code "+Ne.status),nt.label=9;case 9:if(Xe=Qt.responseTransformer||at,!Xe)return[3,14];nt.label=10;case 10:return nt.trys.push([10,12,,13]),[4,Xe(Ve,$r)];case 11:return Ve=nt.sent(),[3,13];case 12:throw rt=nt.sent(),console.warn("An error occurred in a responseTransformer:"),rt;case 13:return[3,16];case 14:return Ve&&Ve.json?[4,Ve.json()]:[3,16];case 15:Ve=nt.sent(),nt.label=16;case 16:return Ve=ge(Ve,Tr||Ht||We),Ve=K(ze,Ve,dr,wt,dr.selectionSet),Ve=$(Ve,$r,sr,{resolverParams:{fieldName:V,root:Q,args:q,context:J,info:te}}),[2,we(Ve)]}})})},Ze="",Je="",vt=function(V,Q){return Q.has("content-type")||Q.append("Content-Type","application/json"),{body:JSON.stringify(V),headers:Q}},De={test:function(V){return V.name.value==="rest"},remove:!0},Ge=function(V){I(Q,V);function Q(q){var J,te=q.uri,W=q.endpoints,_e=q.headers,ze=q.fieldNameNormalizer,$e=q.fieldNameDenormalizer,se=q.typePatcher,we=q.customFetch,Qe=q.credentials,mt=q.bodySerializers,yt=q.defaultSerializer,Yt=q.responseTransformer,At=V.call(this)||this,Wt={};if(Wt[Ze]=te||"",At.endpoints=Object.assign({},W||Wt),te==null&&W==null)throw new Error("A RestLink must be initialized with either 1 uri, or a map of keyed-endpoints");if(te!=null){var Gt=(W||{})[Ze];if(Gt!=null&&Gt!=te)throw new Error("RestLink was configured with a default uri that doesn't match what's passed in to the endpoints map.");At.endpoints[Ze]=te}if(At.endpoints[Ze]==null&&console.warn("RestLink configured without a default URI. All @rest(…) directives must provide an endpoint key!"),se==null)At.typePatcher=function(zt,sr,dr){return x({__typename:sr},zt)};else if(!Array.isArray(se)&&typeof se=="object"&&Object.keys(se).map(function(zt){return se[zt]}).reduce(function(zt,sr){return zt&&typeof sr=="function"},!0)){var Er=se;At.typePatcher=function(zt,sr,dr,Ar){var Ht=zt.__typename||sr;if(Array.isArray(zt))return zt.map(function(G){return dr(G,Ht,dr,Ar)});var H=Er[Ht]||function(G){return G};return x({__typename:Ht},H(zt,Ht,dr,Ar))}}else throw new Error("RestLink was configured with a typePatcher of invalid type!");return mt&&mt.hasOwnProperty(Je)&&console.warn("RestLink was configured to override the default serializer! This may result in unexpected behavior"),At.responseTransformer=Yt||null,At.fieldNameNormalizer=ze||null,At.fieldNameDenormalizer=$e||null,At.headers=ke(_e),At.credentials=Qe||null,At.customFetch=we,At.serializers=x((J={},J[Je]=yt||vt,J),mt||{}),At.processedDocuments=new Map,At}return Q.prototype.removeRestSetsFromDocument=function(q){var J=this.processedDocuments.get(q);if(J)return J;i.checkDocument(q);var te=i.removeDirectivesFromDocument([De],q);return this.processedDocuments.set(q,te),te},Q.prototype.request=function(q,J){var te=q.query,W=q.variables,_e=q.getContext,ze=q.setContext,$e=_e(),se=i.hasDirectives(["rest"],te);if(!se)return J(q);var we=this.removeRestSetsFromDocument(te),Qe=$e.headersMergePolicy;Qe==null&&Array.isArray($e.headersToOverride)?Qe=xe($e.headersToOverride):Qe==null&&(Qe=X);var mt=Qe(this.headers,$e.headers);mt.has("Accept")||mt.append("Accept","application/json");var yt=$e.credentials||this.credentials,Yt=i.addTypenameToDocument(te),At=i.getMainDefinition(te),Wt=i.getFragmentDefinitions(te),Gt=(At||{}).operation||"query",Er={headers:mt,endpoints:this.endpoints,exportVariablesByNode:new Map,credentials:yt,customFetch:this.customFetch,operationType:Gt,fieldNameNormalizer:this.fieldNameNormalizer,fieldNameDenormalizer:this.fieldNameDenormalizer,mainDefinition:At,fragmentDefinitions:Wt,typePatcher:this.typePatcher,serializers:this.serializers,responses:[],responseTransformer:this.responseTransformer},zt={},sr;return we&&J?(q.query=we,sr=J(q)):sr=n.Observable.of({data:{}}),sr.flatMap(function(dr){var Ar=dr.data,Ht=dr.errors;return new n.Observable(function(H){y(Tt,Yt,Ar,Er,W,zt).then(function(G){ze({restResponses:($e.restResponses||[]).concat(Er.responses)}),H.next({data:G,errors:Ht}),H.complete()}).catch(function(G){G.name!=="AbortError"&&(G.result&&G.result.errors&&H.next(G.result),H.error(G))})})})},Q}(n.ApolloLink);t.RestLink=Ge,t.PathBuilder=Ie,Object.defineProperty(t,"__esModule",{value:!0})})})(mh,mh.exports);var yI=mh.exports;const rc=le.createContext(),gI=()=>{const{isAuthenticated:r,login:e}=ti(),{children:t,isEmbedded:n,setIsEmbedded:i,authError:a}=le.useContext(rc),u=pn.useNavigate(),c=pn.useLocation(),[f,h]=le.useState(!1),[d,y]=le.useState(),[g,m]=le.useState(),[b,I]=le.useState({}),x=le.useRef({}),_=le.useRef({}),[A,P]=le.useState(!1),[M,$]=le.useState({}),j=(X,ye={})=>{f&&window.parent.postMessage({type:X,instanceId:g,...ye},d)},K=(X,ye,xe={})=>{if(!X)throw new Error("Namespace is required for sendMessage");j(`${X}:${ye}`,xe)};le.useEffect(()=>{var X;if(!(!c||c.pathname!=="/mm-embedded-login")){if(r||a)if(((X=new URL(origin))==null?void 0:X.protocol)==="http:"){window.close();return}else{const xe=new URLSearchParams(c.search),Se=xe.get("id"),Be=xe.get("origin");a?window.parent.postMessage({type:"authorize-failed",instanceId:Se,error:a,authUrl:window.location.href},Be):window.parent.postMessage({type:"authorized",instanceId:Se,authUrl:window.location.href},Be);return}r===!1&&e()}},[c]),le.useEffect(()=>{var Se,Be;if(r===null||!c||c.pathname!=="/mm-embedded-interop")return;const X=new URLSearchParams(c.search),ye=X.get("id"),xe=X.get("origin");if(xe){const Ke=(Se=new URL(xe))==null?void 0:Se.hostname;if(/^(?:[\w-]+\.)*(?:machinemetrics\.com|machinemetrics-us-gov\.com|m12s\.com)$/.test(Ke))y(xe);else{alert("Invalid Embeddable Zone Host");return}}if(r===!1){if(xe){const Ke={instanceId:ye,authUrl:`${window.location.protocol}//${window.location.host}/mm-embedded-login?id=${ye}&origin=${xe}`,origin:xe};if(((Be=new URL(xe))==null?void 0:Be.protocol)==="http:"){window.parent.postMessage({type:"login",...Ke},xe);return}e({mm_instanceId:Ke.instanceId,mm_authUrl:encodeURIComponent(Ke.authUrl),mm_origin:Ke.origin});return}e();return}ye&&m(ye),ye&&xe&&i(!0)},[c,r]),pn.useBlocker(({nextLocation:X})=>{var ye;return n?(ye=X.state)!=null&&ye.fromParent?(h(!0),!1):(ee(`${X.pathname}${X.search}`),!0):!1}),le.useEffect(()=>{if(!n||!d)return;const X=ye=>{ye.metaKey&&ye.key==="k"&&window.parent.postMessage({type:"open-search",instanceId:g},d)};return window.addEventListener("keydown",X),()=>{window.removeEventListener("keydown",X)}},[n,d]),le.useEffect(()=>{if(!n||!d)return;const X=({origin:ye,data:xe})=>{var Se,Be,Ke,Et,Tt,Ze,Je,vt;if(ye===d)switch(xe.type){case"navigate":u(xe.path,{replace:!0,state:{fromParent:!0}});break;case"set-context":I(xe.context||{});break;case"set-configuring":P(xe.isConfiguring);break;case"set-params":$(xe.params);break;case"load-options":(Be=(Se=x.current)[`option-${xe.name}`])==null||Be.call(Se,{filter:xe.filter});break;case"validate":(Et=(Ke=x.current)[`validate-${xe.name}`])==null||Et.call(Ke,{value:xe.value});break;case"request":(Ze=(Tt=_.current)[xe.requestType])==null||Ze.call(Tt,xe);break;case"response":(vt=(Je=x.current)[xe.callbackId])==null||vt.call(Je,xe.response);break}};return window.addEventListener("message",X),!f&&r&&window.parent.postMessage({type:"ready",instanceId:g},d),()=>{window.removeEventListener("message",X)}},[u,f,n,r,d]);const ee=(X,ye)=>{!f&&!r||j("set-path",{path:X,...ye})},fe=X=>{j("set-summary",{summary:X})},de=X=>{j("toast",{message:X})},Ie=X=>{j("popup",{message:X})},pe=()=>{j("loaded")},Ce=async({header:X,body:ye,choices:xe})=>f?new Promise(Se=>{const Be=A0(),Ke=async Et=>{delete x.current[Be],Se(Et)};x.current[Be]=Ke,j("confirm",{header:X,body:ye,choices:xe,callbackId:Be})}):Promise.reject(new Error("Not ready")),Pe=({requestType:X,func:ye})=>{const xe=async({callbackId:Se,data:Be})=>{try{const Ke=await ye(Be);j("response",{callbackId:Se,response:Ke})}catch(Ke){j("response",{callbackId:Se,error:Ke.message})}};return _.current[X]=xe,j("mark-registered",{requestType:X}),()=>{delete _.current[X]}},ge=({callbackId:X,func:ye,responseType:xe="response",responseKey:Se="response",props:Be={},callOnRegister:Ke=!1})=>{const Et=async Ze=>{const Je=await ye(Ze);j(xe,{...Be,[Se]:Je,callbackId:X})},Tt=x.current[X];x.current[X]=Et,Tt&&Ke&&Et(Be)},We=(X,ye)=>{if(f){if(ye.validate&&typeof ye.validate=="function"&&ge({callbackId:`validate-${X}`,func:ye.validate,responseType:"set-validation",responseKey:"validation",props:{name:X}}),ye.options){const xe=typeof ye.options=="function"?ye.options:()=>ye.options;ge({callbackId:`option-${X}`,func:xe,responseType:"set-options",responseKey:"options",props:{name:X},callOnRegister:!0})}j("add-setting",{setting:{name:X,...ye,options:void 0,validate:void 0}})}},ke=le.useMemo(()=>({commands:{navigateParent:ee,setSummary:fe,toast:de,popup:Ie,confirm:Ce,setLoaded:pe,sendMessage:K},context:{...b,get colorMode(){throw new Error("colorMode has been moved to useMMAppParams")},get isFullScreen(){throw new Error("isFullScreen has been moved to useMMAppParams")}},params:{isEmbedded:n,isConfiguring:A,colorMode:b.colorMode,isFullScreen:b.isFullScreen,...M},addSetting:We,registerHandler:Pe}),[n,A,ee,fe,de,Ie,Ce,pe,K,b,M,We,Pe]);return nr.jsx(wi.Provider,{value:ke,children:c.pathname!=="/mm-embedded-interop"&&c.pathname!=="/mm-embedded-login"&&c.pathname!=="/mm-embedded-print"?t:nr.jsx(nr.Fragment,{})})},vI=()=>{const{urls:r,jwtRef:e,accessToken:t}=ti(),{graphQLRoleOverride:n,children:i}=le.useContext(rc),[a,u]=le.useState(),[c,f]=le.useState(),h=()=>{const g=new URL(r.graphQLUrl);return`//${g.host}${g.pathname}`},d=()=>n?{"X-Hasura-Role":n}:{};le.useEffect(()=>{const g=new Ik(Mk({url:`wss:${h()}`,lazy:!0,reconnect:!0,connectionParams:async()=>({headers:{Authorization:`Bearer ${e.current}`,...d()}})})),m=D0(({operation:P,networkError:M,forward:$})=>(Vi(P.query).operation==="subscription"&&M&&g.client.terminate(),$(P))),I=M0(async(P,{headers:M})=>({headers:{...M,Authorization:`Bearer ${e.current}`,...d()}})).concat(uf({uri:`https:${h()}`,fetch:window.fetch})),x=m.split(({query:P})=>{const M=Vi(P);return M.kind==="OperationDefinition"&&M.operation==="subscription"},g,I),A=M0(async(P,{headers:M})=>({headers:{...M,Authorization:`Bearer ${t}`}})).concat(new yI.RestLink({uri:r.apiUrl}));f(Kr.from([A,x]))},[]),le.useEffect(()=>{c&&u(new Cf({link:c,cache:new Of}))},[c]);const y=le.useMemo(()=>({link:c}),[c]);return nr.jsx(u0.Provider,{value:y,children:a?nr.jsx(T1,{client:a,children:nr.jsx(zA,{children:nr.jsx(gI,{children:i})})}):nr.jsx(nr.Fragment,{})})},bI=Qp.div`
131
+ `+G.prev}function Ht(H,G){var at=Ze(H),wt=[];if(at){wt.length=H.length;for(var ft=0;ft<H.length;ft++)wt[ft]=W(H,ft)?G(H[ft],H):""}var He=typeof pe=="function"?pe(H):[],Kt;if(Pe){Kt={};for(var Zt=0;Zt<He.length;Zt++)Kt["$"+He[Zt]]=He[Zt]}for(var Qt in H)W(H,Qt)&&(at&&String(Number(Qt))===Qt&&Qt<H.length||Pe&&Kt["$"+Qt]instanceof Symbol||(j.call(/[^\w$]/,Qt)?wt.push(G(Qt,H)+": "+G(H[Qt],H)):wt.push(Qt+": "+G(H[Qt],H))));if(typeof pe=="function")for(var kr=0;kr<He.length;kr++)We.call(H,He[kr])&&wt.push("["+G(He[kr])+"]: "+G(H[He[kr]],H));return wt}return gh}var vh,q0;function Uk(){if(q0)return vh;q0=1;var r=ec(),e=da(),t=function(c,f,h){for(var d=c,y;(y=d.next)!=null;d=y)if(y.key===f)return d.next=y.next,h||(y.next=c.next,c.next=y),y},n=function(c,f){if(c){var h=t(c,f);return h&&h.value}},i=function(c,f,h){var d=t(c,f);d?d.value=h:c.next={key:f,next:c.next,value:h}},a=function(c,f){return c?!!t(c,f):!1},u=function(c,f){if(c)return t(c,f,!0)};return vh=function(){var f,h={assert:function(d){if(!h.has(d))throw new e("Side channel does not contain "+r(d))},delete:function(d){var y=f&&f.next,g=u(f,d);return g&&y&&y===g&&(f=void 0),!!g},get:function(d){return n(f,d)},has:function(d){return a(f,d)},set:function(d,y){f||(f={next:void 0}),i(f,d,y)}};return h},vh}var bh,j0;function U0(){return j0||(j0=1,bh=Object),bh}var wh,$0;function $k(){return $0||($0=1,wh=Error),wh}var _h,B0;function Bk(){return B0||(B0=1,_h=EvalError),_h}var xh,V0;function Vk(){return V0||(V0=1,xh=RangeError),xh}var Sh,W0;function Wk(){return W0||(W0=1,Sh=ReferenceError),Sh}var Eh,z0;function zk(){return z0||(z0=1,Eh=SyntaxError),Eh}var Oh,H0;function Hk(){return H0||(H0=1,Oh=URIError),Oh}var Th,G0;function Gk(){return G0||(G0=1,Th=Math.abs),Th}var Ah,Q0;function Qk(){return Q0||(Q0=1,Ah=Math.floor),Ah}var kh,J0;function Jk(){return J0||(J0=1,kh=Math.max),kh}var Ih,Y0;function Yk(){return Y0||(Y0=1,Ih=Math.min),Ih}var Ch,K0;function Kk(){return K0||(K0=1,Ch=Math.pow),Ch}var Ph,Z0;function Zk(){return Z0||(Z0=1,Ph=Math.round),Ph}var Nh,X0;function Xk(){return X0||(X0=1,Nh=Number.isNaN||function(e){return e!==e}),Nh}var Rh,eb;function eI(){if(eb)return Rh;eb=1;var r=Xk();return Rh=function(t){return r(t)||t===0?t:t<0?-1:1},Rh}var Mh,tb;function tI(){return tb||(tb=1,Mh=Object.getOwnPropertyDescriptor),Mh}var Dh,rb;function nb(){if(rb)return Dh;rb=1;var r=tI();if(r)try{r([],"length")}catch{r=null}return Dh=r,Dh}var Fh,ib;function rI(){if(ib)return Fh;ib=1;var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}return Fh=r,Fh}var Lh,sb;function nI(){return sb||(sb=1,Lh=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(var a in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var u=Object.getOwnPropertySymbols(e);if(u.length!==1||u[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(e,t);if(c.value!==i||c.enumerable!==!0)return!1}return!0}),Lh}var qh,ab;function iI(){if(ab)return qh;ab=1;var r=typeof Symbol<"u"&&Symbol,e=nI();return qh=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},qh}var jh,ob;function ub(){return ob||(ob=1,jh=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),jh}var Uh,cb;function lb(){if(cb)return Uh;cb=1;var r=U0();return Uh=r.getPrototypeOf||null,Uh}var $h,fb;function sI(){if(fb)return $h;fb=1;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(f,h){for(var d=[],y=0;y<f.length;y+=1)d[y]=f[y];for(var g=0;g<h.length;g+=1)d[g+f.length]=h[g];return d},a=function(f,h){for(var d=[],y=h,g=0;y<f.length;y+=1,g+=1)d[g]=f[y];return d},u=function(c,f){for(var h="",d=0;d<c.length;d+=1)h+=c[d],d+1<c.length&&(h+=f);return h};return $h=function(f){var h=this;if(typeof h!="function"||e.apply(h)!==n)throw new TypeError(r+h);for(var d=a(arguments,1),y,g=function(){if(this instanceof y){var _=h.apply(this,i(d,arguments));return Object(_)===_?_:this}return h.apply(f,i(d,arguments))},m=t(0,h.length-d.length),b=[],I=0;I<m;I++)b[I]="$"+I;if(y=Function("binder","return function ("+u(b,",")+"){ return binder.apply(this,arguments); }")(g),h.prototype){var x=function(){};x.prototype=h.prototype,y.prototype=new x,x.prototype=null}return y},$h}var Bh,hb;function tc(){if(hb)return Bh;hb=1;var r=sI();return Bh=Function.prototype.bind||r,Bh}var Vh,db;function Wh(){return db||(db=1,Vh=Function.prototype.call),Vh}var zh,pb;function mb(){return pb||(pb=1,zh=Function.prototype.apply),zh}var Hh,yb;function aI(){return yb||(yb=1,Hh=typeof Reflect<"u"&&Reflect&&Reflect.apply),Hh}var Gh,gb;function oI(){if(gb)return Gh;gb=1;var r=tc(),e=mb(),t=Wh(),n=aI();return Gh=n||r.call(t,e),Gh}var Qh,vb;function bb(){if(vb)return Qh;vb=1;var r=tc(),e=da(),t=Wh(),n=oI();return Qh=function(a){if(a.length<1||typeof a[0]!="function")throw new e("a function is required");return n(r,t,a)},Qh}var Jh,wb;function uI(){if(wb)return Jh;wb=1;var r=bb(),e=nb(),t;try{t=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var n=!!t&&e&&e(Object.prototype,"__proto__"),i=Object,a=i.getPrototypeOf;return Jh=n&&typeof n.get=="function"?r([n.get]):typeof a=="function"?function(c){return a(c==null?c:i(c))}:!1,Jh}var Yh,_b;function cI(){if(_b)return Yh;_b=1;var r=ub(),e=lb(),t=uI();return Yh=r?function(i){return r(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:t?function(i){return t(i)}:null,Yh}var Kh,xb;function lI(){if(xb)return Kh;xb=1;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=tc();return Kh=t.call(r,e),Kh}var Zh,Sb;function Xh(){if(Sb)return Zh;Sb=1;var r,e=U0(),t=$k(),n=Bk(),i=Vk(),a=Wk(),u=zk(),c=da(),f=Hk(),h=Gk(),d=Qk(),y=Jk(),g=Yk(),m=Kk(),b=Zk(),I=eI(),x=Function,_=function(De){try{return x('"use strict"; return ('+De+").constructor;")()}catch{}},A=nb(),P=rI(),M=function(){throw new c},$=A?function(){try{return arguments.callee,M}catch{try{return A(arguments,"callee").get}catch{return M}}}():M,j=iI()(),K=cI(),ee=lb(),fe=ub(),de=mb(),Ie=Wh(),pe={},Ce=typeof Uint8Array>"u"||!K?r:K(Uint8Array),Pe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":j&&K?K([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":pe,"%AsyncGenerator%":pe,"%AsyncGeneratorFunction%":pe,"%AsyncIteratorPrototype%":pe,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":x,"%GeneratorFunction%":pe,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":j&&K?K(K([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!j||!K?r:K(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":A,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":i,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!j||!K?r:K(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":j&&K?K(""[Symbol.iterator]()):r,"%Symbol%":j?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":$,"%TypedArray%":Ce,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":f,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":Ie,"%Function.prototype.apply%":de,"%Object.defineProperty%":P,"%Object.getPrototypeOf%":ee,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":y,"%Math.min%":g,"%Math.pow%":m,"%Math.round%":b,"%Math.sign%":I,"%Reflect.getPrototypeOf%":fe};if(K)try{null.error}catch(De){var ge=K(K(De));Pe["%Error.prototype%"]=ge}var We=function De(Ge){var V;if(Ge==="%AsyncFunction%")V=_("async function () {}");else if(Ge==="%GeneratorFunction%")V=_("function* () {}");else if(Ge==="%AsyncGeneratorFunction%")V=_("async function* () {}");else if(Ge==="%AsyncGenerator%"){var Q=De("%AsyncGeneratorFunction%");Q&&(V=Q.prototype)}else if(Ge==="%AsyncIteratorPrototype%"){var q=De("%AsyncGenerator%");q&&K&&(V=K(q.prototype))}return Pe[Ge]=V,V},ke={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},X=tc(),ye=lI(),xe=X.call(Ie,Array.prototype.concat),Se=X.call(de,Array.prototype.splice),Be=X.call(Ie,String.prototype.replace),Ke=X.call(Ie,String.prototype.slice),Et=X.call(Ie,RegExp.prototype.exec),Tt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ze=/\\(\\)?/g,Je=function(Ge){var V=Ke(Ge,0,1),Q=Ke(Ge,-1);if(V==="%"&&Q!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(Q==="%"&&V!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var q=[];return Be(Ge,Tt,function(J,te,W,_e){q[q.length]=W?Be(_e,Ze,"$1"):te||J}),q},vt=function(Ge,V){var Q=Ge,q;if(ye(ke,Q)&&(q=ke[Q],Q="%"+q[0]+"%"),ye(Pe,Q)){var J=Pe[Q];if(J===pe&&(J=We(Q)),typeof J>"u"&&!V)throw new c("intrinsic "+Ge+" exists, but is not available. Please file an issue!");return{alias:q,name:Q,value:J}}throw new u("intrinsic "+Ge+" does not exist!")};return Zh=function(Ge,V){if(typeof Ge!="string"||Ge.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof V!="boolean")throw new c('"allowMissing" argument must be a boolean');if(Et(/^%?[^%]*%?$/,Ge)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Q=Je(Ge),q=Q.length>0?Q[0]:"",J=vt("%"+q+"%",V),te=J.name,W=J.value,_e=!1,ze=J.alias;ze&&(q=ze[0],Se(Q,xe([0,1],ze)));for(var $e=1,se=!0;$e<Q.length;$e+=1){var we=Q[$e],Qe=Ke(we,0,1),mt=Ke(we,-1);if((Qe==='"'||Qe==="'"||Qe==="`"||mt==='"'||mt==="'"||mt==="`")&&Qe!==mt)throw new u("property names with quotes must have matching quotes");if((we==="constructor"||!se)&&(_e=!0),q+="."+we,te="%"+q+"%",ye(Pe,te))W=Pe[te];else if(W!=null){if(!(we in W)){if(!V)throw new c("base intrinsic for "+Ge+" exists, but the property is not available.");return}if(A&&$e+1>=Q.length){var yt=A(W,we);se=!!yt,se&&"get"in yt&&!("originalValue"in yt.get)?W=yt.get:W=W[we]}else se=ye(W,we),W=W[we];se&&!_e&&(Pe[te]=W)}}return W},Zh}var ed,Eb;function Ob(){if(Eb)return ed;Eb=1;var r=Xh(),e=bb(),t=e([r("%String.prototype.indexOf%")]);return ed=function(i,a){var u=r(i,!!a);return typeof u=="function"&&t(i,".prototype.")>-1?e([u]):u},ed}var td,Tb;function Ab(){if(Tb)return td;Tb=1;var r=Xh(),e=Ob(),t=ec(),n=da(),i=r("%Map%",!0),a=e("Map.prototype.get",!0),u=e("Map.prototype.set",!0),c=e("Map.prototype.has",!0),f=e("Map.prototype.delete",!0),h=e("Map.prototype.size",!0);return td=!!i&&function(){var y,g={assert:function(m){if(!g.has(m))throw new n("Side channel does not contain "+t(m))},delete:function(m){if(y){var b=f(y,m);return h(y)===0&&(y=void 0),b}return!1},get:function(m){if(y)return a(y,m)},has:function(m){return y?c(y,m):!1},set:function(m,b){y||(y=new i),u(y,m,b)}};return g},td}var rd,kb;function fI(){if(kb)return rd;kb=1;var r=Xh(),e=Ob(),t=ec(),n=Ab(),i=da(),a=r("%WeakMap%",!0),u=e("WeakMap.prototype.get",!0),c=e("WeakMap.prototype.set",!0),f=e("WeakMap.prototype.has",!0),h=e("WeakMap.prototype.delete",!0);return rd=a?function(){var y,g,m={assert:function(b){if(!m.has(b))throw new i("Side channel does not contain "+t(b))},delete:function(b){if(a&&b&&(typeof b=="object"||typeof b=="function")){if(y)return h(y,b)}else if(n&&g)return g.delete(b);return!1},get:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&y?u(y,b):g&&g.get(b)},has:function(b){return a&&b&&(typeof b=="object"||typeof b=="function")&&y?f(y,b):!!g&&g.has(b)},set:function(b,I){a&&b&&(typeof b=="object"||typeof b=="function")?(y||(y=new a),c(y,b,I)):n&&(g||(g=n()),g.set(b,I))}};return m}:n,rd}var nd,Ib;function hI(){if(Ib)return nd;Ib=1;var r=da(),e=ec(),t=Uk(),n=Ab(),i=fI(),a=i||n||t;return nd=function(){var c,f={assert:function(h){if(!f.has(h))throw new r("Side channel does not contain "+e(h))},delete:function(h){return!!c&&c.delete(h)},get:function(h){return c&&c.get(h)},has:function(h){return!!c&&c.has(h)},set:function(h,d){c||(c=a()),c.set(h,d)}};return f},nd}var id,Cb;function sd(){if(Cb)return id;Cb=1;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return id={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},id}var ad,Pb;function Nb(){if(Pb)return ad;Pb=1;var r=sd(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=function(){for(var x=[],_=0;_<256;++_)x.push("%"+((_<16?"0":"")+_.toString(16)).toUpperCase());return x}(),i=function(_){for(;_.length>1;){var A=_.pop(),P=A.obj[A.prop];if(t(P)){for(var M=[],$=0;$<P.length;++$)typeof P[$]<"u"&&M.push(P[$]);A.obj[A.prop]=M}}},a=function(_,A){for(var P=A&&A.plainObjects?Object.create(null):{},M=0;M<_.length;++M)typeof _[M]<"u"&&(P[M]=_[M]);return P},u=function x(_,A,P){if(!A)return _;if(typeof A!="object"){if(t(_))_.push(A);else if(_&&typeof _=="object")(P&&(P.plainObjects||P.allowPrototypes)||!e.call(Object.prototype,A))&&(_[A]=!0);else return[_,A];return _}if(!_||typeof _!="object")return[_].concat(A);var M=_;return t(_)&&!t(A)&&(M=a(_,P)),t(_)&&t(A)?(A.forEach(function($,j){if(e.call(_,j)){var K=_[j];K&&typeof K=="object"&&$&&typeof $=="object"?_[j]=x(K,$,P):_.push($)}else _[j]=$}),_):Object.keys(A).reduce(function($,j){var K=A[j];return e.call($,j)?$[j]=x($[j],K,P):$[j]=K,$},M)},c=function(_,A){return Object.keys(A).reduce(function(P,M){return P[M]=A[M],P},_)},f=function(x,_,A){var P=x.replace(/\+/g," ");if(A==="iso-8859-1")return P.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(P)}catch{return P}},h=1024,d=function(_,A,P,M,$){if(_.length===0)return _;var j=_;if(typeof _=="symbol"?j=Symbol.prototype.toString.call(_):typeof _!="string"&&(j=String(_)),P==="iso-8859-1")return escape(j).replace(/%u[0-9a-f]{4}/gi,function(Ce){return"%26%23"+parseInt(Ce.slice(2),16)+"%3B"});for(var K="",ee=0;ee<j.length;ee+=h){for(var fe=j.length>=h?j.slice(ee,ee+h):j,de=[],Ie=0;Ie<fe.length;++Ie){var pe=fe.charCodeAt(Ie);if(pe===45||pe===46||pe===95||pe===126||pe>=48&&pe<=57||pe>=65&&pe<=90||pe>=97&&pe<=122||$===r.RFC1738&&(pe===40||pe===41)){de[de.length]=fe.charAt(Ie);continue}if(pe<128){de[de.length]=n[pe];continue}if(pe<2048){de[de.length]=n[192|pe>>6]+n[128|pe&63];continue}if(pe<55296||pe>=57344){de[de.length]=n[224|pe>>12]+n[128|pe>>6&63]+n[128|pe&63];continue}Ie+=1,pe=65536+((pe&1023)<<10|fe.charCodeAt(Ie)&1023),de[de.length]=n[240|pe>>18]+n[128|pe>>12&63]+n[128|pe>>6&63]+n[128|pe&63]}K+=de.join("")}return K},y=function(_){for(var A=[{obj:{o:_},prop:"o"}],P=[],M=0;M<A.length;++M)for(var $=A[M],j=$.obj[$.prop],K=Object.keys(j),ee=0;ee<K.length;++ee){var fe=K[ee],de=j[fe];typeof de=="object"&&de!==null&&P.indexOf(de)===-1&&(A.push({obj:j,prop:fe}),P.push(de))}return i(A),_},g=function(_){return Object.prototype.toString.call(_)==="[object RegExp]"},m=function(_){return!_||typeof _!="object"?!1:!!(_.constructor&&_.constructor.isBuffer&&_.constructor.isBuffer(_))},b=function(_,A){return[].concat(_,A)},I=function(_,A){if(t(_)){for(var P=[],M=0;M<_.length;M+=1)P.push(A(_[M]));return P}return A(_)};return ad={arrayToObject:a,assign:c,combine:b,compact:y,decode:f,encode:d,isBuffer:m,isRegExp:g,maybeMap:I,merge:u},ad}var od,Rb;function dI(){if(Rb)return od;Rb=1;var r=hI(),e=Nb(),t=sd(),n=Object.prototype.hasOwnProperty,i={brackets:function(x){return x+"[]"},comma:"comma",indices:function(x,_){return x+"["+_+"]"},repeat:function(x){return x}},a=Array.isArray,u=Array.prototype.push,c=function(I,x){u.apply(I,a(x)?x:[x])},f=Date.prototype.toISOString,h=t.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:h,formatter:t.formatters[h],indices:!1,serializeDate:function(x){return f.call(x)},skipNulls:!1,strictNullHandling:!1},y=function(x){return typeof x=="string"||typeof x=="number"||typeof x=="boolean"||typeof x=="symbol"||typeof x=="bigint"},g={},m=function I(x,_,A,P,M,$,j,K,ee,fe,de,Ie,pe,Ce,Pe,ge,We,ke){for(var X=x,ye=ke,xe=0,Se=!1;(ye=ye.get(g))!==void 0&&!Se;){var Be=ye.get(x);if(xe+=1,typeof Be<"u"){if(Be===xe)throw new RangeError("Cyclic object value");Se=!0}typeof ye.get(g)>"u"&&(xe=0)}if(typeof fe=="function"?X=fe(_,X):X instanceof Date?X=pe(X):A==="comma"&&a(X)&&(X=e.maybeMap(X,function(te){return te instanceof Date?pe(te):te})),X===null){if($)return ee&&!ge?ee(_,d.encoder,We,"key",Ce):_;X=""}if(y(X)||e.isBuffer(X)){if(ee){var Ke=ge?_:ee(_,d.encoder,We,"key",Ce);return[Pe(Ke)+"="+Pe(ee(X,d.encoder,We,"value",Ce))]}return[Pe(_)+"="+Pe(String(X))]}var Et=[];if(typeof X>"u")return Et;var Tt;if(A==="comma"&&a(X))ge&&ee&&(X=e.maybeMap(X,ee)),Tt=[{value:X.length>0?X.join(",")||null:void 0}];else if(a(fe))Tt=fe;else{var Ze=Object.keys(X);Tt=de?Ze.sort(de):Ze}var Je=K?_.replace(/\./g,"%2E"):_,vt=P&&a(X)&&X.length===1?Je+"[]":Je;if(M&&a(X)&&X.length===0)return vt+"[]";for(var De=0;De<Tt.length;++De){var Ge=Tt[De],V=typeof Ge=="object"&&typeof Ge.value<"u"?Ge.value:X[Ge];if(!(j&&V===null)){var Q=Ie&&K?Ge.replace(/\./g,"%2E"):Ge,q=a(X)?typeof A=="function"?A(vt,Q):vt:vt+(Ie?"."+Q:"["+Q+"]");ke.set(x,xe);var J=r();J.set(g,ke),c(Et,I(V,q,A,P,M,$,j,K,A==="comma"&&ge&&a(X)?null:ee,fe,de,Ie,pe,Ce,Pe,ge,We,J))}}return Et},b=function(x){if(!x)return d;if(typeof x.allowEmptyArrays<"u"&&typeof x.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof x.encodeDotInKeys<"u"&&typeof x.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(x.encoder!==null&&typeof x.encoder<"u"&&typeof x.encoder!="function")throw new TypeError("Encoder has to be a function.");var _=x.charset||d.charset;if(typeof x.charset<"u"&&x.charset!=="utf-8"&&x.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var A=t.default;if(typeof x.format<"u"){if(!n.call(t.formatters,x.format))throw new TypeError("Unknown format option provided.");A=x.format}var P=t.formatters[A],M=d.filter;(typeof x.filter=="function"||a(x.filter))&&(M=x.filter);var $;if(x.arrayFormat in i?$=x.arrayFormat:"indices"in x?$=x.indices?"indices":"repeat":$=d.arrayFormat,"commaRoundTrip"in x&&typeof x.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var j=typeof x.allowDots>"u"?x.encodeDotInKeys===!0?!0:d.allowDots:!!x.allowDots;return{addQueryPrefix:typeof x.addQueryPrefix=="boolean"?x.addQueryPrefix:d.addQueryPrefix,allowDots:j,allowEmptyArrays:typeof x.allowEmptyArrays=="boolean"?!!x.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:$,charset:_,charsetSentinel:typeof x.charsetSentinel=="boolean"?x.charsetSentinel:d.charsetSentinel,commaRoundTrip:x.commaRoundTrip,delimiter:typeof x.delimiter>"u"?d.delimiter:x.delimiter,encode:typeof x.encode=="boolean"?x.encode:d.encode,encodeDotInKeys:typeof x.encodeDotInKeys=="boolean"?x.encodeDotInKeys:d.encodeDotInKeys,encoder:typeof x.encoder=="function"?x.encoder:d.encoder,encodeValuesOnly:typeof x.encodeValuesOnly=="boolean"?x.encodeValuesOnly:d.encodeValuesOnly,filter:M,format:A,formatter:P,serializeDate:typeof x.serializeDate=="function"?x.serializeDate:d.serializeDate,skipNulls:typeof x.skipNulls=="boolean"?x.skipNulls:d.skipNulls,sort:typeof x.sort=="function"?x.sort:null,strictNullHandling:typeof x.strictNullHandling=="boolean"?x.strictNullHandling:d.strictNullHandling}};return od=function(I,x){var _=I,A=b(x),P,M;typeof A.filter=="function"?(M=A.filter,_=M("",_)):a(A.filter)&&(M=A.filter,P=M);var $=[];if(typeof _!="object"||_===null)return"";var j=i[A.arrayFormat],K=j==="comma"&&A.commaRoundTrip;P||(P=Object.keys(_)),A.sort&&P.sort(A.sort);for(var ee=r(),fe=0;fe<P.length;++fe){var de=P[fe];A.skipNulls&&_[de]===null||c($,m(_[de],de,j,K,A.allowEmptyArrays,A.strictNullHandling,A.skipNulls,A.encodeDotInKeys,A.encode?A.encoder:null,A.filter,A.sort,A.allowDots,A.serializeDate,A.format,A.formatter,A.encodeValuesOnly,A.charset,ee))}var Ie=$.join(A.delimiter),pe=A.addQueryPrefix===!0?"?":"";return A.charsetSentinel&&(A.charset==="iso-8859-1"?pe+="utf8=%26%2310003%3B&":pe+="utf8=%E2%9C%93&"),Ie.length>0?pe+Ie:""},od}var ud,Mb;function pI(){if(Mb)return ud;Mb=1;var r=Nb(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(g){return g.replace(/&#(\d+);/g,function(m,b){return String.fromCharCode(parseInt(b,10))})},a=function(g,m){return g&&typeof g=="string"&&m.comma&&g.indexOf(",")>-1?g.split(","):g},u="utf8=%26%2310003%3B",c="utf8=%E2%9C%93",f=function(m,b){var I={__proto__:null},x=b.ignoreQueryPrefix?m.replace(/^\?/,""):m;x=x.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var _=b.parameterLimit===1/0?void 0:b.parameterLimit,A=x.split(b.delimiter,_),P=-1,M,$=b.charset;if(b.charsetSentinel)for(M=0;M<A.length;++M)A[M].indexOf("utf8=")===0&&(A[M]===c?$="utf-8":A[M]===u&&($="iso-8859-1"),P=M,M=A.length);for(M=0;M<A.length;++M)if(M!==P){var j=A[M],K=j.indexOf("]="),ee=K===-1?j.indexOf("="):K+1,fe,de;ee===-1?(fe=b.decoder(j,n.decoder,$,"key"),de=b.strictNullHandling?null:""):(fe=b.decoder(j.slice(0,ee),n.decoder,$,"key"),de=r.maybeMap(a(j.slice(ee+1),b),function(pe){return b.decoder(pe,n.decoder,$,"value")})),de&&b.interpretNumericEntities&&$==="iso-8859-1"&&(de=i(de)),j.indexOf("[]=")>-1&&(de=t(de)?[de]:de);var Ie=e.call(I,fe);Ie&&b.duplicates==="combine"?I[fe]=r.combine(I[fe],de):(!Ie||b.duplicates==="last")&&(I[fe]=de)}return I},h=function(g,m,b,I){for(var x=I?m:a(m,b),_=g.length-1;_>=0;--_){var A,P=g[_];if(P==="[]"&&b.parseArrays)A=b.allowEmptyArrays&&(x===""||b.strictNullHandling&&x===null)?[]:[].concat(x);else{A=b.plainObjects?Object.create(null):{};var M=P.charAt(0)==="["&&P.charAt(P.length-1)==="]"?P.slice(1,-1):P,$=b.decodeDotInKeys?M.replace(/%2E/g,"."):M,j=parseInt($,10);!b.parseArrays&&$===""?A={0:x}:!isNaN(j)&&P!==$&&String(j)===$&&j>=0&&b.parseArrays&&j<=b.arrayLimit?(A=[],A[j]=x):$!=="__proto__"&&(A[$]=x)}x=A}return x},d=function(m,b,I,x){if(m){var _=I.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,A=/(\[[^[\]]*])/,P=/(\[[^[\]]*])/g,M=I.depth>0&&A.exec(_),$=M?_.slice(0,M.index):_,j=[];if($){if(!I.plainObjects&&e.call(Object.prototype,$)&&!I.allowPrototypes)return;j.push($)}for(var K=0;I.depth>0&&(M=P.exec(_))!==null&&K<I.depth;){if(K+=1,!I.plainObjects&&e.call(Object.prototype,M[1].slice(1,-1))&&!I.allowPrototypes)return;j.push(M[1])}if(M){if(I.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+I.depth+" and strictDepth is true");j.push("["+_.slice(M.index)+"]")}return h(j,b,I,x)}},y=function(m){if(!m)return n;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var b=typeof m.charset>"u"?n.charset:m.charset,I=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(I!=="combine"&&I!=="first"&&I!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var x=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:x,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:b,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||r.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:I,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return ud=function(g,m){var b=y(m);if(g===""||g===null||typeof g>"u")return b.plainObjects?Object.create(null):{};for(var I=typeof g=="string"?f(g,b):g,x=b.plainObjects?Object.create(null):{},_=Object.keys(I),A=0;A<_.length;++A){var P=_[A],M=d(P,I[P],b,typeof g=="string");x=r.merge(x,M,b)}return b.allowSparse===!0?x:r.compact(x)},ud}var cd,Db;function mI(){if(Db)return cd;Db=1;var r=dI(),e=pI(),t=sd();return cd={formats:t,parse:e,stringify:r},cd}(function(r,e){(function(t,n){n(e,Lk,qk,mI())})(pi,function(t,n,i,a){var u=function(V,Q,q,J){function te(W){return W instanceof q?W:new q(function(_e){_e(W)})}return new(q||(q=Promise))(function(W,_e){function ze(we){try{se(J.next(we))}catch(Qe){_e(Qe)}}function $e(we){try{se(J.throw(we))}catch(Qe){_e(Qe)}}function se(we){we.done?W(we.value):te(we.value).then(ze,$e)}se((J=J.apply(V,Q||[])).next())})},c=function(V,Q){var q={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},J,te,W,_e;return _e={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(_e[Symbol.iterator]=function(){return this}),_e;function ze(se){return function(we){return $e([se,we])}}function $e(se){if(J)throw new TypeError("Generator is already executing.");for(;q;)try{if(J=1,te&&(W=se[0]&2?te.return:se[0]?te.throw||((W=te.return)&&W.call(te),0):te.next)&&!(W=W.call(te,se[1])).done)return W;switch(te=0,W&&(se=[se[0]&2,W.value]),se[0]){case 0:case 1:W=se;break;case 4:return q.label++,{value:se[1],done:!1};case 5:q.label++,te=se[1],se=[0];continue;case 7:se=q.ops.pop(),q.trys.pop();continue;default:if(W=q.trys,!(W=W.length>0&&W[W.length-1])&&(se[0]===6||se[0]===2)){q=0;continue}if(se[0]===3&&(!W||se[1]>W[0]&&se[1]<W[3])){q.label=se[1];break}if(se[0]===6&&q.label<W[1]){q.label=W[1],W=se;break}if(W&&q.label<W[2]){q.label=W[2],q.ops.push(se);break}W[2]&&q.ops.pop(),q.trys.pop();continue}se=Q.call(V,q)}catch(we){se=[6,we],te=0}finally{J=W=0}if(se[0]&5)throw se[1];return{value:se[0]?se[1]:void 0,done:!0}}};function f(V,Q){if(V.directives&&V.directives.length){var q={};return V.directives.forEach(function(J){q[J.name.value]=i.argumentsObjectFromField(J,Q)}),q}return null}var h=Object.prototype.hasOwnProperty;function d(V,Q){Q!==null&&typeof Q=="object"&&Object.keys(Q).forEach(function(q){var J=Q[q];h.call(V,q)?d(V[q],J):V[q]=J})}function y(V,Q,q,J,te,W){W===void 0&&(W={});var _e=i.getMainDefinition(Q),ze=i.getFragmentDefinitions(Q),$e=i.createFragmentMap(ze),se=W.resultMapper,we=W.fragmentMatcher||function(){return!0},Qe={fragmentMap:$e,contextValue:J,variableValues:te,resultMapper:se,resolver:V,fragmentMatcher:we};return g(_e.selectionSet,q,Qe)}function g(V,Q,q){return u(this,void 0,void 0,function(){var J,te,W,_e,ze,$e=this;return c(this,function(se){switch(se.label){case 0:return J=q.fragmentMap,te=q.contextValue,W=q.variableValues,_e={},ze=function(we){return u($e,void 0,void 0,function(){var Qe,mt,yt,Yt,At;return c(this,function(Wt){switch(Wt.label){case 0:return i.shouldInclude(we,W)?i.isField(we)?[4,m(we,Q,q)]:[3,2]:[2];case 1:return Qe=Wt.sent(),mt=i.resultKeyNameFromField(we),Qe!==void 0&&(_e[mt]===void 0?_e[mt]=Qe:d(_e[mt],Qe)),[2];case 2:if(i.isInlineFragment(we))yt=we;else if(yt=J[we.name.value],!yt)throw new Error("No fragment named "+we.name.value);return Yt=yt.typeCondition.name.value,q.fragmentMatcher(Q,Yt,te)?[4,g(yt.selectionSet,Q,q)]:[3,4];case 3:At=Wt.sent(),d(_e,At),Wt.label=4;case 4:return[2]}})})},[4,Promise.all(V.selections.map(ze))];case 1:return se.sent(),q.resultMapper?[2,q.resultMapper(_e,Q)]:[2,_e]}})})}function m(V,Q,q){return u(this,void 0,void 0,function(){var J,te,W,_e,ze,$e,se;return c(this,function(we){switch(we.label){case 0:return J=q.variableValues,te=q.contextValue,W=q.resolver,_e=V.name.value,ze=i.argumentsObjectFromField(V,J),$e={isLeaf:!V.selectionSet,resultKey:i.resultKeyNameFromField(V),directives:f(V,J),field:V},[4,W(_e,Q,ze,te,$e)];case 1:return se=we.sent(),V.selectionSet?se==null?[2,se]:Array.isArray(se)?[2,b(V,se,q)]:[2,g(V.selectionSet,se,q)]:[2,se]}})})}function b(V,Q,q){return Promise.all(Q.map(function(J){return J===null?null:Array.isArray(J)?b(V,J,q):g(V.selectionSet,J,q)}))}var I=function(){var V=function(Q,q){return V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,te){J.__proto__=te}||function(J,te){for(var W in te)te.hasOwnProperty(W)&&(J[W]=te[W])},V(Q,q)};return function(Q,q){V(Q,q);function J(){this.constructor=Q}Q.prototype=q===null?Object.create(q):(J.prototype=q.prototype,new J)}}(),x=function(){return x=Object.assign||function(V){for(var Q,q=1,J=arguments.length;q<J;q++){Q=arguments[q];for(var te in Q)Object.prototype.hasOwnProperty.call(Q,te)&&(V[te]=Q[te])}return V},x.apply(this,arguments)},_=function(V,Q,q,J){function te(W){return W instanceof q?W:new q(function(_e){_e(W)})}return new(q||(q=Promise))(function(W,_e){function ze(we){try{se(J.next(we))}catch(Qe){_e(Qe)}}function $e(we){try{se(J.throw(we))}catch(Qe){_e(Qe)}}function se(we){we.done?W(we.value):te(we.value).then(ze,$e)}se((J=J.apply(V,Q||[])).next())})},A=function(V,Q){var q={label:0,sent:function(){if(W[0]&1)throw W[1];return W[1]},trys:[],ops:[]},J,te,W,_e;return _e={next:ze(0),throw:ze(1),return:ze(2)},typeof Symbol=="function"&&(_e[Symbol.iterator]=function(){return this}),_e;function ze(se){return function(we){return $e([se,we])}}function $e(se){if(J)throw new TypeError("Generator is already executing.");for(;q;)try{if(J=1,te&&(W=se[0]&2?te.return:se[0]?te.throw||((W=te.return)&&W.call(te),0):te.next)&&!(W=W.call(te,se[1])).done)return W;switch(te=0,W&&(se=[se[0]&2,W.value]),se[0]){case 0:case 1:W=se;break;case 4:return q.label++,{value:se[1],done:!1};case 5:q.label++,te=se[1],se=[0];continue;case 7:se=q.ops.pop(),q.trys.pop();continue;default:if(W=q.trys,!(W=W.length>0&&W[W.length-1])&&(se[0]===6||se[0]===2)){q=0;continue}if(se[0]===3&&(!W||se[1]>W[0]&&se[1]<W[3])){q.label=se[1];break}if(se[0]===6&&q.label<W[1]){q.label=W[1],W=se;break}if(W&&q.label<W[2]){q.label=W[2],q.ops.push(se);break}W[2]&&q.ops.pop(),q.trys.pop();continue}se=Q.call(V,q)}catch(we){se=[6,we],te=0}finally{J=W=0}if(se[0]&5)throw se[1];return{value:se[0]?se[1]:void 0,done:!0}}},P=function(){for(var V=0,Q=0,q=arguments.length;Q<q;Q++)V+=arguments[Q].length;for(var J=Array(V),te=0,Q=0;Q<q;Q++)for(var W=arguments[Q],_e=0,ze=W.length;_e<ze;_e++,te++)J[te]=W[_e];return J},M=function(V){var Q=V.replace(/\s/g,""),q=Q.replace(/\[(.*)\]/,function(J,te,W,_e){return((te!=null&&te.length)>0?te:null)||Q});return q},$=function(V,Q,q,J){if(Array.isArray(V)){var te=M(Q);return V.map(function(W){return $(W,te,q,J)})}return V==null||typeof V=="number"||typeof V=="boolean"||typeof V=="string"?V:q(V,Q,q,J)},j=function(V){return V.directives&&V.directives.length?V.directives.find(function(Q){return Q.name.value==="rest"}):null};function K(V,Q,q,J,te){return te==null||Q==null||typeof Q=="number"||typeof Q=="boolean"||typeof Q=="string"||te.selections.forEach(function(W){if(i.isInlineFragment(W))K(V,Q,q,J,W.selectionSet);else if(W.kind==="FragmentSpread"){var _e=J[W.name.value];K(V,Q,q,J,_e.selectionSet)}else if(i.isField(W)){var ze=i.resultKeyNameFromField(W);ze===V&&j(W)!=null?ee(Q,q,J,W.selectionSet):K(V,Q,q,J,W.selectionSet)}else return function($e){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()}),Q}function ee(V,Q,q,J){if(!(V==null||typeof V=="number"||typeof V=="boolean"||typeof V=="string")){if(Array.isArray(V)){V.forEach(function(te){return ee(te,Q,q,J)});return}J.selections.forEach(function(te){if(i.isInlineFragment(te))ee(V,Q,q,te.selectionSet);else if(te.kind==="FragmentSpread"){var W=q[te.name.value];ee(V,Q,q,W.selectionSet)}else if(i.isField(te)){var _e=V[te.name.value];te.name.value==="__typename"||(typeof _e>"u"?V[te.name.value]=null:_e!=null&&typeof _e=="object"&&te.selectionSet!=null&&ee(_e,Q,q,te.selectionSet))}else return function(ze){throw new Error("Unhandled Node Type in SelectionSetNode.selections")}()})}}var fe=function(V,Q){var q=V[Q||Ze]||V[Ze];return typeof q=="string"?{uri:q}:x({responseTransformer:null},q)},de=function(V,Q,q){return q===void 0||Q===void 0?V:V.replace(":"+Q,q)},Ie=function(){function V(){}return V.replacerForPath=function(Q){if(Q in V.cache)return V.cache[Q];var q=Q.indexOf("?"),J=Q.split(V.argReplacement),te=[],W=!1;J.reduce(function(ze,$e){if($e===""||$e==="{}")return ze+$e.length;var se=ze+$e.length;if($e[0]==="{"&&$e[$e.length-1]==="}"){var we=$e.slice(1,$e.length-1).split(".");te.push(function(Qe,mt){try{var yt=pe(Qe,we);return!mt||typeof yt!="object"||yt==null?String(yt):a.stringify(yt)}catch{var Yt=[Q,we.join(".")].join("|");return Yt in V.warnTable||(console.warn("Warning: RestLink caught an error while unpacking",Yt,"This tends to happen if you forgot to pass a parameter needed for creating an @rest(path, or if RestLink was configured to deeply unpack a path parameter that wasn't provided. This message will only log once per detected instance. Trouble-shooting hint: check @rest(path: and the variables provided to this query."),V.warnTable[Yt]=!0),""}})}else te.push($e),!W&&se>=q&&(W=!0,te.push(!0));return se},0);var _e=function(ze){var $e=!1,se=te.reduce(function(we,Qe){return typeof Qe=="string"?we+Qe:typeof Qe=="boolean"?($e=!0,we):we+Qe(ze,$e)},"");return se};return V.cache[Q]=_e},V.cache={},V.warnTable={},V.argReplacement=/({[._a-zA-Z0-9]*})/,V}();function pe(V,Q){if(Q.length===0)return V;var q=P(Q),J=q.shift();return pe(V[J],q)}var Ce=["__typename"],Pe=typeof globalThis=="object"&&globalThis||pi,ge=function(V,Q,q){q===void 0&&(q=[]);var J=null;return Q.length!=2?J=function(te,W){return Q(te)}:J=Q,Array.isArray(V)?V.map(function(te,W){return ge(te,J,P(q,[String(W)]))}):V==null||typeof V!="object"||V.constructor!==Object||Pe.FileList&&V instanceof FileList||Pe.File&&V instanceof File?V:Object.keys(V).reduce(function(te,W){var _e=V[W];if(Ce.indexOf(W)!==-1)return te[W]=_e,te;var ze=P(q,[W]);return te[J(W,ze)]=ge(_e,J,ze),te},{})},We=function(V){return V},ke=function(V){return V instanceof Headers?V:new Headers(V||{})},X=function(){for(var V=[],Q=0;Q<arguments.length;Q++)V[Q]=arguments[Q];return V.reduce(function(q,J){return J&&(J.forEach||(J=ke(J)),J.forEach(function(te,W){q.append(W,te)})),q},new Headers)},ye=function(V,Q,q){var J=new Headers;return V.forEach(function(te,W){Q.indexOf(W)===-1&&J.append(W,te)}),X(J,q||new Headers)},xe=function(V){return function(Q,q){return ye(Q,V,q)}},Se=["GET","POST","PUT","PATCH","DELETE"],Be=function(V,Q){switch(Q){case"query":if(Se.indexOf(V.toUpperCase())!==-1)return;throw new Error('A "query" operation can only support "GET" requests but got "'+V+'".');case"mutation":if(Se.indexOf(V.toUpperCase())!==-1)return;throw new Error('"mutation" operations do not support that HTTP-verb');case"subscription":throw new Error('A "subscription" operation is not supported yet.');default:var q=Q;return q}},Ke=function(V,Q,q){var J=new Error(q);throw J.response=V,J.statusCode=V.status,J.result=Q,J},Et=function(V,Q){return V==null||typeof V!="object"?V:Array.isArray(V)?V.map(function(q){return Et(q,Q)}):(V.__typename=Q,V)},Tt=function(V,Q,q,J,te){return _(void 0,void 0,void 0,function(){var W,_e,ze,$e,se,we,Qe,mt,yt,Yt,At,Wt,Gt,Er,zt,sr,dr,Ar,Ht,H,G,at,wt,ft,He,Kt,Zt,Qt,kr,Hr,Fr,Ut,Or,$r,Lr,ar,Gr,Tr,gr,Ir,Sn,Un,R,oe,ve,Ne,Ve,ct,Xe,rt;return A(this,function(nt){switch(nt.label){case 0:if(W=te.directives,_e=te.isLeaf,ze=te.resultKey,$e=J.exportVariablesByNode,se=$e.get(Q)||{},we=function(bt){return bt instanceof Array?bt.forEach(we):$e.set(bt,x({},se)),bt},Qe=(Q||{})[ze],mt=(Q||{})[V],Q&&W&&W.export&&(se[W.export.as]=mt),yt=W&&W.type,!_e&&yt){if(W.rest)throw new Error("Invalid use of @type(name: ...) directive on a call that also has @rest(...)");return we(mt),[2,Et(mt,W.type.name)]}if(Yt=!W||!W.rest,Yt)return[2,we(Qe||mt)];if(At=J.credentials,Wt=J.endpoints,Gt=J.headers,Er=J.customFetch,zt=J.operationType,sr=J.typePatcher,dr=J.mainDefinition,Ar=J.fragmentDefinitions,Ht=J.fieldNameNormalizer,H=J.fieldNameDenormalizer,G=J.serializers,at=J.responseTransformer,wt=i.createFragmentMap(Ar),ft=W.rest,He=ft.path,Kt=ft.endpoint,Zt=ft.pathBuilder,Qt=fe(Wt,Kt),kr=He==null&&Zt==null,kr)throw new Error('One of ("path" | "pathBuilder") must be set in the @rest() directive. This request had neither, please add one');if(Zt||(He.includes(":")?(console.warn("Deprecated: '@rest(path:' contains a ':' colon, this format will be removed in future versions"),Zt=function(bt){var w=bt.args,k=bt.exportVariables,T=x(x({},w),k),C=Object.keys(T).reduce(function(D,B){return de(D,B,T[B])},He);if(C.includes(":"))throw new Error('Missing parameters to run query, specify it in the query params or use an export directive. (If you need to use ":" inside a variable string make sure to encode the variables properly using `encodeURIComponent`. Alternatively see documentation about using pathBuilder.)');return C}):Zt=Ie.replacerForPath(He)),Hr={args:q,exportVariables:se,context:J,"@rest":W.rest,replacer:Zt},Fr=Zt(Hr),Ut=W.rest,Or=Ut.method,$r=Ut.type,Lr=Ut.bodyBuilder,ar=Ut.bodyKey,Gr=Ut.fieldNameDenormalizer,Tr=Ut.fieldNameNormalizer,gr=Ut.bodySerializer,Or||(Or="GET"),ar||(ar="input"),Ir=void 0,Sn=void 0,["GET","DELETE"].indexOf(Or)===-1){if(!Lr){if(Un=Hr.exportVariables[ar]||Hr.args&&Hr.args[ar],!Un)throw new Error("[GraphQL "+Or+" "+zt+" using a REST call without a body]. No `"+ar+"` was detected. Pass bodyKey, or bodyBuilder to the @rest() directive to resolve this.");Lr=function(bt){return Un}}if(Ir=ge(Lr(Hr),Gr||H||We),R=void 0,typeof gr=="string"){if(!G.hasOwnProperty(gr))throw new Error('"bodySerializer" must correspond to configured serializer. '+("Please make sure to specify a serializer called "+gr+' in the "bodySerializers" property of the RestLink.'));R=G[gr](Ir,Gt)}else R=gr?gr(Ir,Gt):G[Je](Ir,Gt);Ir=R.body,Sn=new Headers(R.headers)}return Be(Or,zt||"query"),oe=x({method:Or,headers:Sn||Gt,body:Ir},At?{credentials:At}:{}),ve=""+Qt.uri+Fr,[4,(Er||fetch)(ve,oe)];case 1:return Ne=nt.sent(),J.responses.push(Ne),Ne.ok?(Ne.status===204||Ne.headers.get("Content-Length")==="0"?Ve={}:Ve=Ne,[3,9]):[3,2];case 2:return Ne.status!==404?[3,3]:(Ve=null,[3,9]);case 3:ct=void 0,nt.label=4;case 4:return nt.trys.push([4,6,,8]),[4,Ne.clone().json()];case 5:return ct=nt.sent(),[3,8];case 6:return nt.sent(),[4,Ne.clone().text()];case 7:return ct=nt.sent(),[3,8];case 8:Ke(Ne,ct,"Response not successful: Received status code "+Ne.status),nt.label=9;case 9:if(Xe=Qt.responseTransformer||at,!Xe)return[3,14];nt.label=10;case 10:return nt.trys.push([10,12,,13]),[4,Xe(Ve,$r)];case 11:return Ve=nt.sent(),[3,13];case 12:throw rt=nt.sent(),console.warn("An error occurred in a responseTransformer:"),rt;case 13:return[3,16];case 14:return Ve&&Ve.json?[4,Ve.json()]:[3,16];case 15:Ve=nt.sent(),nt.label=16;case 16:return Ve=ge(Ve,Tr||Ht||We),Ve=K(ze,Ve,dr,wt,dr.selectionSet),Ve=$(Ve,$r,sr,{resolverParams:{fieldName:V,root:Q,args:q,context:J,info:te}}),[2,we(Ve)]}})})},Ze="",Je="",vt=function(V,Q){return Q.has("content-type")||Q.append("Content-Type","application/json"),{body:JSON.stringify(V),headers:Q}},De={test:function(V){return V.name.value==="rest"},remove:!0},Ge=function(V){I(Q,V);function Q(q){var J,te=q.uri,W=q.endpoints,_e=q.headers,ze=q.fieldNameNormalizer,$e=q.fieldNameDenormalizer,se=q.typePatcher,we=q.customFetch,Qe=q.credentials,mt=q.bodySerializers,yt=q.defaultSerializer,Yt=q.responseTransformer,At=V.call(this)||this,Wt={};if(Wt[Ze]=te||"",At.endpoints=Object.assign({},W||Wt),te==null&&W==null)throw new Error("A RestLink must be initialized with either 1 uri, or a map of keyed-endpoints");if(te!=null){var Gt=(W||{})[Ze];if(Gt!=null&&Gt!=te)throw new Error("RestLink was configured with a default uri that doesn't match what's passed in to the endpoints map.");At.endpoints[Ze]=te}if(At.endpoints[Ze]==null&&console.warn("RestLink configured without a default URI. All @rest(…) directives must provide an endpoint key!"),se==null)At.typePatcher=function(zt,sr,dr){return x({__typename:sr},zt)};else if(!Array.isArray(se)&&typeof se=="object"&&Object.keys(se).map(function(zt){return se[zt]}).reduce(function(zt,sr){return zt&&typeof sr=="function"},!0)){var Er=se;At.typePatcher=function(zt,sr,dr,Ar){var Ht=zt.__typename||sr;if(Array.isArray(zt))return zt.map(function(G){return dr(G,Ht,dr,Ar)});var H=Er[Ht]||function(G){return G};return x({__typename:Ht},H(zt,Ht,dr,Ar))}}else throw new Error("RestLink was configured with a typePatcher of invalid type!");return mt&&mt.hasOwnProperty(Je)&&console.warn("RestLink was configured to override the default serializer! This may result in unexpected behavior"),At.responseTransformer=Yt||null,At.fieldNameNormalizer=ze||null,At.fieldNameDenormalizer=$e||null,At.headers=ke(_e),At.credentials=Qe||null,At.customFetch=we,At.serializers=x((J={},J[Je]=yt||vt,J),mt||{}),At.processedDocuments=new Map,At}return Q.prototype.removeRestSetsFromDocument=function(q){var J=this.processedDocuments.get(q);if(J)return J;i.checkDocument(q);var te=i.removeDirectivesFromDocument([De],q);return this.processedDocuments.set(q,te),te},Q.prototype.request=function(q,J){var te=q.query,W=q.variables,_e=q.getContext,ze=q.setContext,$e=_e(),se=i.hasDirectives(["rest"],te);if(!se)return J(q);var we=this.removeRestSetsFromDocument(te),Qe=$e.headersMergePolicy;Qe==null&&Array.isArray($e.headersToOverride)?Qe=xe($e.headersToOverride):Qe==null&&(Qe=X);var mt=Qe(this.headers,$e.headers);mt.has("Accept")||mt.append("Accept","application/json");var yt=$e.credentials||this.credentials,Yt=i.addTypenameToDocument(te),At=i.getMainDefinition(te),Wt=i.getFragmentDefinitions(te),Gt=(At||{}).operation||"query",Er={headers:mt,endpoints:this.endpoints,exportVariablesByNode:new Map,credentials:yt,customFetch:this.customFetch,operationType:Gt,fieldNameNormalizer:this.fieldNameNormalizer,fieldNameDenormalizer:this.fieldNameDenormalizer,mainDefinition:At,fragmentDefinitions:Wt,typePatcher:this.typePatcher,serializers:this.serializers,responses:[],responseTransformer:this.responseTransformer},zt={},sr;return we&&J?(q.query=we,sr=J(q)):sr=n.Observable.of({data:{}}),sr.flatMap(function(dr){var Ar=dr.data,Ht=dr.errors;return new n.Observable(function(H){y(Tt,Yt,Ar,Er,W,zt).then(function(G){ze({restResponses:($e.restResponses||[]).concat(Er.responses)}),H.next({data:G,errors:Ht}),H.complete()}).catch(function(G){G.name!=="AbortError"&&(G.result&&G.result.errors&&H.next(G.result),H.error(G))})})})},Q}(n.ApolloLink);t.RestLink=Ge,t.PathBuilder=Ie,Object.defineProperty(t,"__esModule",{value:!0})})})(mh,mh.exports);var yI=mh.exports;const rc=le.createContext(),gI=()=>{const{isAuthenticated:r,login:e}=ti(),{children:t,isEmbedded:n,setIsEmbedded:i,authError:a}=le.useContext(rc),u=pn.useNavigate(),c=pn.useLocation(),[f,h]=le.useState(!1),[d,y]=le.useState(),[g,m]=le.useState(),[b,I]=le.useState({}),x=le.useRef({}),_=le.useRef({}),[A,P]=le.useState(!1),[M,$]=le.useState({}),j=(X,ye={})=>{f&&window.parent.postMessage({type:X,instanceId:g,...ye},d)},K=(X,ye,xe={})=>{if(!X)throw new Error("Namespace is required for sendMessage");j(`${X}:${ye}`,xe)};le.useEffect(()=>{var X;if(!(!c||c.pathname!=="/mm-embedded-login")){if(r||a)if(((X=new URL(origin))==null?void 0:X.protocol)==="http:"){window.close();return}else{const xe=new URLSearchParams(c.search),Se=xe.get("id"),Be=xe.get("origin");a?window.parent.postMessage({type:"authorize-failed",instanceId:Se,error:a,authUrl:window.location.href},Be):window.parent.postMessage({type:"authorized",instanceId:Se,authUrl:window.location.href},Be);return}r===!1&&e()}},[c]),le.useEffect(()=>{var Se,Be;if(r===null||!c||c.pathname!=="/mm-embedded-interop")return;const X=new URLSearchParams(c.search),ye=X.get("id"),xe=X.get("origin");if(xe){const Ke=(Se=new URL(xe))==null?void 0:Se.hostname;if(/^(?:[\w-]+\.)*(?:machinemetrics\.com|machinemetrics-us-gov\.com|m12s\.com)$/.test(Ke))y(xe);else{alert("Invalid Embeddable Zone Host");return}}if(r===!1){if(xe){const Ke={instanceId:ye,authUrl:`${window.location.protocol}//${window.location.host}/mm-embedded-login?id=${ye}&origin=${xe}`,origin:xe};if(((Be=new URL(xe))==null?void 0:Be.protocol)==="http:"){window.parent.postMessage({type:"login",...Ke},xe);return}e({mm_instanceId:Ke.instanceId,mm_authUrl:encodeURIComponent(Ke.authUrl),mm_origin:Ke.origin});return}e();return}ye&&m(ye),ye&&xe&&i(!0)},[c,r]),pn.useBlocker(({nextLocation:X})=>{var ye;return n?(ye=X.state)!=null&&ye.fromParent?(h(!0),!1):(ee(`${X.pathname}${X.search}`),!0):!1}),le.useEffect(()=>{if(!n||!d)return;const X=ye=>{ye.metaKey&&ye.key==="k"&&window.parent.postMessage({type:"open-search",instanceId:g},d)};return window.addEventListener("keydown",X),()=>{window.removeEventListener("keydown",X)}},[n,d]),le.useEffect(()=>{if(!n||!d)return;const X=({origin:ye,data:xe})=>{var Se,Be,Ke,Et,Tt,Ze,Je,vt;if(ye===d)switch(xe.type){case"navigate":u(xe.path,{replace:!0,state:{fromParent:!0}});break;case"set-context":I(xe.context||{});break;case"set-configuring":P(xe.isConfiguring);break;case"set-params":$(xe.params);break;case"load-options":(Be=(Se=x.current)[`option-${xe.name}`])==null||Be.call(Se,{filter:xe.filter||""});break;case"validate":(Et=(Ke=x.current)[`validate-${xe.name}`])==null||Et.call(Ke,{value:xe.value});break;case"request":(Ze=(Tt=_.current)[xe.requestType])==null||Ze.call(Tt,xe);break;case"response":(vt=(Je=x.current)[xe.callbackId])==null||vt.call(Je,xe.response);break}};return window.addEventListener("message",X),!f&&r&&window.parent.postMessage({type:"ready",instanceId:g},d),()=>{window.removeEventListener("message",X)}},[u,f,n,r,d]);const ee=(X,ye)=>{!f&&!r||j("set-path",{path:X,...ye})},fe=X=>{j("set-summary",{summary:X})},de=X=>{j("toast",{message:X})},Ie=X=>{j("popup",{message:X})},pe=()=>{j("loaded")},Ce=async({header:X,body:ye,choices:xe})=>f?new Promise(Se=>{const Be=A0(),Ke=async Et=>{delete x.current[Be],Se(Et)};x.current[Be]=Ke,j("confirm",{header:X,body:ye,choices:xe,callbackId:Be})}):Promise.reject(new Error("Not ready")),Pe=({requestType:X,func:ye})=>{const xe=async({callbackId:Se,data:Be})=>{try{const Ke=await ye(Be);j("response",{callbackId:Se,response:Ke})}catch(Ke){j("response",{callbackId:Se,error:Ke.message})}};return _.current[X]=xe,j("mark-registered",{requestType:X}),()=>{delete _.current[X]}},ge=({callbackId:X,func:ye,responseType:xe="response",responseKey:Se="response",props:Be={},callOnRegister:Ke=!1})=>{const Et=async Ze=>{const Je=await ye(Ze);j(xe,{...Be,[Se]:Je,callbackId:X})},Tt=x.current[X];x.current[X]=Et,Tt&&Ke&&Et(Be)},We=(X,ye)=>{if(f){if(ye.validate&&typeof ye.validate=="function"&&ge({callbackId:`validate-${X}`,func:ye.validate,responseType:"set-validation",responseKey:"validation",props:{name:X}}),ye.options){const xe=typeof ye.options=="function"?ye.options:()=>ye.options;ge({callbackId:`option-${X}`,func:xe,responseType:"set-options",responseKey:"options",props:{name:X},callOnRegister:!0})}j("add-setting",{setting:{name:X,...ye,options:void 0,validate:void 0}})}},ke=le.useMemo(()=>({commands:{navigateParent:ee,setSummary:fe,toast:de,popup:Ie,confirm:Ce,setLoaded:pe,sendMessage:K},context:{...b,get colorMode(){throw new Error("colorMode has been moved to useMMAppParams")},get isFullScreen(){throw new Error("isFullScreen has been moved to useMMAppParams")}},params:{isEmbedded:n,isConfiguring:A,colorMode:b.colorMode,isFullScreen:b.isFullScreen,...M},addSetting:We,registerHandler:Pe}),[n,A,ee,fe,de,Ie,Ce,pe,K,b,M,We,Pe]);return nr.jsx(wi.Provider,{value:ke,children:c.pathname!=="/mm-embedded-interop"&&c.pathname!=="/mm-embedded-login"&&c.pathname!=="/mm-embedded-print"?t:nr.jsx(nr.Fragment,{})})},vI=()=>{const{urls:r,jwtRef:e,accessToken:t}=ti(),{graphQLRoleOverride:n,children:i}=le.useContext(rc),[a,u]=le.useState(),[c,f]=le.useState(),h=()=>{const g=new URL(r.graphQLUrl);return`//${g.host}${g.pathname}`},d=()=>n?{"X-Hasura-Role":n}:{};le.useEffect(()=>{const g=new Ik(Mk({url:`wss:${h()}`,lazy:!0,reconnect:!0,connectionParams:async()=>({headers:{Authorization:`Bearer ${e.current}`,...d()}})})),m=D0(({operation:P,networkError:M,forward:$})=>(Vi(P.query).operation==="subscription"&&M&&g.client.terminate(),$(P))),I=M0(async(P,{headers:M})=>({headers:{...M,Authorization:`Bearer ${e.current}`,...d()}})).concat(uf({uri:`https:${h()}`,fetch:window.fetch})),x=m.split(({query:P})=>{const M=Vi(P);return M.kind==="OperationDefinition"&&M.operation==="subscription"},g,I),A=M0(async(P,{headers:M})=>({headers:{...M,Authorization:`Bearer ${t}`}})).concat(new yI.RestLink({uri:r.apiUrl}));f(Kr.from([A,x]))},[]),le.useEffect(()=>{c&&u(new Cf({link:c,cache:new Of}))},[c]);const y=le.useMemo(()=>({link:c}),[c]);return nr.jsx(u0.Provider,{value:y,children:a?nr.jsx(T1,{client:a,children:nr.jsx(zA,{children:nr.jsx(gI,{children:i})})}):nr.jsx(nr.Fragment,{})})},bI=Qp.div`
132
132
  text-align: center;
133
133
  padding-top: 200px;
134
134
  `,Fb=({loadError:r})=>{const e=Ok();return r&&(!e||e.indexOf("mm-embedded-login")===-1)?nr.jsx(bI,{children:r}):(k0(),nr.jsx(pn.Navigate,{replace:!0,to:e||"/"}))};Qp.div`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-tools",
3
- "version": "4.0.14",
3
+ "version": "4.0.15",
4
4
  "description": "Components, hooks, and helper functions for writing React apps using MachineMetrics APIs.",
5
5
  "author": "machinemetrics",
6
6
  "license": "MIT",